aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1998-10-08 16:48:47 +0000
committerRichard Henderson <rth@cygnus.com>1998-10-08 16:48:47 +0000
commit04af8357a3460aadde12fda4b5281b67a1320484 (patch)
tree64192a2408c2b21b27a3505143fc8916e1dbb824
parent13dc3bd31d526d3ec86ceb12be1fffc090966334 (diff)
* Merge from EGCS mainline, tag gc_merge_981008.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/egcs_gc_branch@22927 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10923
-rw-r--r--gcc/ChangeLog.1010110
-rw-r--r--gcc/ChangeLog.1114493
-rw-r--r--gcc/ChangeLog.121244
-rw-r--r--gcc/ChangeLog.GC4
-rw-r--r--gcc/INSTALL248
-rw-r--r--gcc/LANGUAGES23
-rw-r--r--gcc/LITERATURE4
-rw-r--r--gcc/Makefile.in744
-rw-r--r--gcc/NEWS114
-rw-r--r--gcc/PROJECTS50
-rw-r--r--gcc/README2
-rw-r--r--gcc/README.RS600014
-rw-r--r--gcc/README.g77291
-rw-r--r--gcc/README.gnat198
-rw-r--r--gcc/acconfig.h52
-rw-r--r--gcc/aclocal.m445
-rw-r--r--gcc/alias.c188
-rw-r--r--gcc/alloca.c504
-rw-r--r--gcc/basic-block.h5
-rw-r--r--gcc/bitmap.h2
-rw-r--r--gcc/build-make4
-rw-r--r--gcc/c-aux-info.c2
-rw-r--r--gcc/c-common.c369
-rw-r--r--gcc/c-decl.c135
-rw-r--r--gcc/c-gperf.h281
-rw-r--r--gcc/c-iterate.c8
-rw-r--r--gcc/c-lang.c50
-rw-r--r--gcc/c-lex.c460
-rw-r--r--gcc/c-lex.h4
-rw-r--r--gcc/c-parse.c2417
-rw-r--r--gcc/c-parse.gperf2
-rw-r--r--gcc/c-parse.in52
-rw-r--r--gcc/c-parse.y52
-rw-r--r--gcc/c-pragma.c422
-rw-r--r--gcc/c-pragma.h68
-rw-r--r--gcc/c-tree.h29
-rw-r--r--gcc/c-typeck.c30
-rw-r--r--gcc/caller-save.c316
-rw-r--r--gcc/calls.c123
-rw-r--r--gcc/cccp.c950
-rw-r--r--gcc/cexp.c214
-rw-r--r--gcc/cexp.y118
-rw-r--r--gcc/ch/ChangeLog10
-rw-r--r--gcc/ch/decl.c8
-rw-r--r--gcc/ch/typeck.c8
-rw-r--r--gcc/choose-temp.c157
-rw-r--r--gcc/collect2.c185
-rw-r--r--gcc/combine.c212
-rw-r--r--gcc/config.in58
-rwxr-xr-xgcc/config.sub11
-rw-r--r--gcc/config/1750a/1750a.h4
-rw-r--r--gcc/config/alpha/alpha.c2358
-rw-r--r--gcc/config/alpha/alpha.h421
-rw-r--r--gcc/config/alpha/alpha.md863
-rw-r--r--gcc/config/alpha/crtbegin.asm89
-rw-r--r--gcc/config/alpha/crtend.asm3
-rw-r--r--gcc/config/alpha/elf.h18
-rw-r--r--gcc/config/alpha/linux-ecoff.h4
-rw-r--r--gcc/config/alpha/linux-elf.h14
-rw-r--r--gcc/config/alpha/linux.h40
-rw-r--r--gcc/config/alpha/osf.h26
-rw-r--r--gcc/config/alpha/vms.h83
-rw-r--r--gcc/config/alpha/win-nt.h72
-rw-r--r--gcc/config/alpha/x-alpha1
-rw-r--r--gcc/config/alpha/xm-linux.h2
-rw-r--r--gcc/config/arc/arc.c11
-rw-r--r--gcc/config/arc/arc.h3
-rw-r--r--gcc/config/arm/arm.c364
-rw-r--r--gcc/config/arm/arm.h27
-rw-r--r--gcc/config/arm/arm.md221
-rw-r--r--gcc/config/arm/coff.h2
-rw-r--r--gcc/config/arm/netbsd.h15
-rw-r--r--gcc/config/arm/tcoff.h4
-rw-r--r--gcc/config/arm/thumb.c144
-rw-r--r--gcc/config/arm/thumb.h73
-rw-r--r--gcc/config/arm/thumb.md37
-rw-r--r--gcc/config/clipper/clipper.h6
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c25
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h52
-rw-r--r--gcc/config/dsp16xx/dsp16xx.md66
-rw-r--r--gcc/config/fp-bit.c37
-rw-r--r--gcc/config/h8300/h8300.c69
-rw-r--r--gcc/config/h8300/h8300.h25
-rw-r--r--gcc/config/h8300/h8300.md4
-rw-r--r--gcc/config/i386/386bsd.h2
-rw-r--r--gcc/config/i386/aix386ng.h4
-rw-r--r--gcc/config/i386/crtdll.h9
-rw-r--r--gcc/config/i386/cygwin32.h341
-rw-r--r--gcc/config/i386/freebsd-elf.h17
-rw-r--r--gcc/config/i386/freebsd.h8
-rw-r--r--gcc/config/i386/gas.h17
-rw-r--r--gcc/config/i386/go32.h6
-rw-r--r--gcc/config/i386/i386-coff.h8
-rw-r--r--gcc/config/i386/i386.c904
-rw-r--r--gcc/config/i386/i386.h364
-rw-r--r--gcc/config/i386/i386.md1913
-rw-r--r--gcc/config/i386/isc.h2
-rw-r--r--gcc/config/i386/linux-aout.h4
-rw-r--r--gcc/config/i386/linux-oldld.h4
-rw-r--r--gcc/config/i386/linux.h23
-rw-r--r--gcc/config/i386/mingw32.h7
-rw-r--r--gcc/config/i386/netbsd.h2
-rw-r--r--gcc/config/i386/osfelf.h2
-rw-r--r--gcc/config/i386/osfrose.h2
-rw-r--r--gcc/config/i386/ptx4-i.h2
-rw-r--r--gcc/config/i386/rtemself.h4
-rw-r--r--gcc/config/i386/sco.h2
-rw-r--r--gcc/config/i386/sco4.h2
-rw-r--r--gcc/config/i386/sco4dbx.h2
-rw-r--r--gcc/config/i386/sco5.h41
-rw-r--r--gcc/config/i386/sol2.h2
-rw-r--r--gcc/config/i386/sysv3.h2
-rw-r--r--gcc/config/i386/sysv4.h2
-rw-r--r--gcc/config/i386/unix.h6
-rw-r--r--gcc/config/i386/winnt.c472
-rw-r--r--gcc/config/i386/xm-cygwin32.h32
-rw-r--r--gcc/config/i386/xm-go32.h2
-rw-r--r--gcc/config/i386/xm-netbsd.h4
-rw-r--r--gcc/config/i960/i960.c212
-rw-r--r--gcc/config/i960/i960.h25
-rw-r--r--gcc/config/i960/i960.md89
-rw-r--r--gcc/config/m32r/m32r.c621
-rw-r--r--gcc/config/m32r/m32r.h167
-rw-r--r--gcc/config/m32r/m32r.md735
-rw-r--r--gcc/config/m68k/lb1sf68.asm2
-rw-r--r--gcc/config/m68k/linux.h6
-rw-r--r--gcc/config/m68k/m68k.c107
-rw-r--r--gcc/config/m68k/m68k.h32
-rw-r--r--gcc/config/m68k/m68k.md65
-rw-r--r--gcc/config/m68k/t-linux14
-rw-r--r--gcc/config/m68k/x-next4
-rw-r--r--gcc/config/m68k/xm-netbsd.h4
-rw-r--r--gcc/config/m88k/dgux.ld2
-rw-r--r--gcc/config/m88k/m88k.h6
-rw-r--r--gcc/config/m88k/m88k.md12
-rw-r--r--gcc/config/mips/abi64.h2
-rw-r--r--gcc/config/mips/elf.h128
-rw-r--r--gcc/config/mips/elf64.h128
-rw-r--r--gcc/config/mips/iris5.h1
-rw-r--r--gcc/config/mips/iris5gas.h1
-rw-r--r--gcc/config/mips/iris6.h14
-rw-r--r--gcc/config/mips/mips.c347
-rw-r--r--gcc/config/mips/mips.h59
-rw-r--r--gcc/config/mips/mips.md615
-rw-r--r--gcc/config/mips/xm-iris5.h2
-rw-r--r--gcc/config/mips/xm-netbsd.h2
-rw-r--r--gcc/config/mn10200/mn10200.h20
-rw-r--r--gcc/config/mn10200/mn10200.md10
-rw-r--r--gcc/config/mn10300/mn10300.c194
-rw-r--r--gcc/config/mn10300/mn10300.h62
-rw-r--r--gcc/config/mn10300/mn10300.md505
-rw-r--r--gcc/config/netbsd.h4
-rw-r--r--gcc/config/nextstep.c13
-rw-r--r--gcc/config/nextstep.h15
-rw-r--r--gcc/config/ns32k/ns32k.c2
-rw-r--r--gcc/config/ns32k/xm-netbsd.h10
-rw-r--r--gcc/config/pa/pa.c556
-rw-r--r--gcc/config/pa/pa.h85
-rw-r--r--gcc/config/pa/pa.md65
-rw-r--r--gcc/config/rs6000/aix41.h43
-rw-r--r--gcc/config/rs6000/linux.h7
-rw-r--r--gcc/config/rs6000/netware.h14
-rw-r--r--gcc/config/rs6000/powerpc.h61
-rw-r--r--gcc/config/rs6000/rs6000.c1010
-rw-r--r--gcc/config/rs6000/rs6000.h285
-rw-r--r--gcc/config/rs6000/rs6000.md1397
-rw-r--r--gcc/config/rs6000/rtems.h3
-rw-r--r--gcc/config/rs6000/sysv4.h37
-rw-r--r--gcc/config/rs6000/t-ppccomm8
-rw-r--r--gcc/config/rs6000/win-nt.h21
-rw-r--r--gcc/config/rs6000/xm-rs6000.h6
-rw-r--r--gcc/config/sh/elf.h1
-rw-r--r--gcc/config/sh/lib1funcs.asm25
-rw-r--r--gcc/config/sh/rtems.h6
-rw-r--r--gcc/config/sh/sh.c30
-rw-r--r--gcc/config/sh/sh.h24
-rw-r--r--gcc/config/sh/sh.md2
-rw-r--r--gcc/config/sh/t-sh2
-rw-r--r--gcc/config/sparc/lb1spc.asm934
-rw-r--r--gcc/config/sparc/linux-aout.h19
-rw-r--r--gcc/config/sparc/linux.h19
-rw-r--r--gcc/config/sparc/linux64.h174
-rw-r--r--gcc/config/sparc/netbsd.h1
-rw-r--r--gcc/config/sparc/sol2-c1.asm42
-rw-r--r--gcc/config/sparc/sol2-ci.asm8
-rw-r--r--gcc/config/sparc/sol2-cn.asm2
-rw-r--r--gcc/config/sparc/sol2.h32
-rw-r--r--gcc/config/sparc/sp64-elf.h5
-rw-r--r--gcc/config/sparc/sparc.c4459
-rw-r--r--gcc/config/sparc/sparc.h520
-rw-r--r--gcc/config/sparc/sparc.md5838
-rw-r--r--gcc/config/sparc/sun4o3.h19
-rw-r--r--gcc/config/sparc/sunos4.h19
-rw-r--r--gcc/config/sparc/sysv4.h8
-rw-r--r--gcc/config/sparc/t-sol222
-rw-r--r--gcc/config/sparc/xm-netbsd.h4
-rw-r--r--gcc/config/sparc/xm-sp64.h2
-rw-r--r--gcc/config/svr4.h13
-rw-r--r--gcc/config/t-netbsd1
-rw-r--r--gcc/config/v850/lib1funcs.asm13
-rw-r--r--gcc/config/v850/t-v8502
-rw-r--r--gcc/config/v850/v850.c883
-rw-r--r--gcc/config/v850/v850.h335
-rw-r--r--gcc/config/vax/netbsd.h2
-rw-r--r--gcc/config/vax/vax.h2
-rw-r--r--gcc/config/winnt/win-nt.h3
-rw-r--r--gcc/config/xm-linux.h2
-rw-r--r--gcc/config/xm-netbsd.h26
-rwxr-xr-xgcc/configure1495
-rw-r--r--gcc/configure.in1338
-rw-r--r--gcc/configure.lang4
-rw-r--r--gcc/convert.c8
-rw-r--r--gcc/cp/ChangeLog3376
-rw-r--r--gcc/cp/Make-lang.in36
-rw-r--r--gcc/cp/Makefile.in49
-rw-r--r--gcc/cp/NEWS22
-rw-r--r--gcc/cp/call.c1150
-rw-r--r--gcc/cp/class.c2157
-rw-r--r--gcc/cp/cp-tree.def26
-rw-r--r--gcc/cp/cp-tree.h751
-rw-r--r--gcc/cp/cvt.c224
-rw-r--r--gcc/cp/decl.c2876
-rw-r--r--gcc/cp/decl2.c2577
-rw-r--r--gcc/cp/errfn.c31
-rw-r--r--gcc/cp/error.c310
-rw-r--r--gcc/cp/except.c242
-rw-r--r--gcc/cp/exception.cc91
-rw-r--r--gcc/cp/expr.c51
-rw-r--r--gcc/cp/friend.c186
-rw-r--r--gcc/cp/g++.132
-rw-r--r--gcc/cp/g++FAQ.texi550
-rw-r--r--gcc/cp/g++spec.c16
-rw-r--r--gcc/cp/gxx.gperf7
-rw-r--r--gcc/cp/gxxint.texi71
-rw-r--r--gcc/cp/hash.h364
-rw-r--r--gcc/cp/inc/exception8
-rw-r--r--gcc/cp/inc/new12
-rw-r--r--gcc/cp/inc/new.h2
-rw-r--r--gcc/cp/inc/typeinfo6
-rw-r--r--gcc/cp/init.c675
-rw-r--r--gcc/cp/input.c10
-rw-r--r--gcc/cp/lang-options.h202
-rw-r--r--gcc/cp/lang-specs.h31
-rw-r--r--gcc/cp/lex.c589
-rw-r--r--gcc/cp/lex.h1
-rw-r--r--gcc/cp/method.c907
-rw-r--r--gcc/cp/new.cc3
-rw-r--r--gcc/cp/new1.cc4
-rw-r--r--gcc/cp/new2.cc2
-rw-r--r--gcc/cp/parse.c9898
-rw-r--r--gcc/cp/parse.h122
-rw-r--r--gcc/cp/parse.y784
-rw-r--r--gcc/cp/pt.c5604
-rw-r--r--gcc/cp/ptree.c24
-rw-r--r--gcc/cp/repo.c10
-rw-r--r--gcc/cp/rtti.c10
-rw-r--r--gcc/cp/search.c1266
-rw-r--r--gcc/cp/semantics.c619
-rw-r--r--gcc/cp/sig.c79
-rw-r--r--gcc/cp/spew.c48
-rw-r--r--gcc/cp/tinfo.cc6
-rw-r--r--gcc/cp/tinfo.h2
-rw-r--r--gcc/cp/tinfo2.cc1
-rw-r--r--gcc/cp/tree.c786
-rw-r--r--gcc/cp/typeck.c938
-rw-r--r--gcc/cp/typeck2.c49
-rw-r--r--gcc/cp/xref.c30
-rw-r--r--gcc/cplus-dem.c3780
-rw-r--r--gcc/cpp.texi61
-rw-r--r--gcc/cppalloc.c1
-rw-r--r--gcc/cpperror.c61
-rw-r--r--gcc/cppexp.c4
-rw-r--r--gcc/cpphash.c6
-rw-r--r--gcc/cpphash.h2
-rw-r--r--gcc/cpplib.c1616
-rw-r--r--gcc/cpplib.h49
-rw-r--r--gcc/cppmain.c9
-rw-r--r--gcc/cross-make3
-rw-r--r--gcc/crtstuff.c91
-rw-r--r--gcc/cse.c324
-rw-r--r--gcc/dbxout.c83
-rw-r--r--gcc/demangle.h18
-rw-r--r--gcc/doprint.c5
-rw-r--r--gcc/dwarf2out.c263
-rw-r--r--gcc/dwarfout.c77
-rw-r--r--gcc/emit-rtl.c81
-rw-r--r--gcc/except.c918
-rw-r--r--gcc/except.h130
-rw-r--r--gcc/explow.c36
-rw-r--r--gcc/expmed.c126
-rw-r--r--gcc/expr.c1286
-rw-r--r--gcc/expr.h213
-rw-r--r--gcc/extend.texi33
-rw-r--r--gcc/f/BUGS133
-rw-r--r--gcc/f/ChangeLog942
-rw-r--r--gcc/f/ChangeLog.egcs326
-rw-r--r--gcc/f/INSTALL1183
-rw-r--r--gcc/f/Make-lang.in301
-rw-r--r--gcc/f/Makefile.in663
-rw-r--r--gcc/f/NEWS174
-rw-r--r--gcc/f/ansify.c12
-rw-r--r--gcc/f/assert.j28
-rw-r--r--gcc/f/bad.c549
-rw-r--r--gcc/f/bad.def26
-rw-r--r--gcc/f/bad.h109
-rw-r--r--gcc/f/bit.c202
-rw-r--r--gcc/f/bit.h85
-rw-r--r--gcc/f/bld-op.def70
-rw-r--r--gcc/f/bld.c5786
-rw-r--r--gcc/f/bld.h1017
-rw-r--r--gcc/f/bugs.texi200
-rw-r--r--gcc/f/com-rt.def5
-rw-r--r--gcc/f/com.c300
-rw-r--r--gcc/f/com.h50
-rw-r--r--gcc/f/config-lang.in34
-rw-r--r--gcc/f/config.j28
-rw-r--r--gcc/f/convert.j29
-rw-r--r--gcc/f/data.c1817
-rw-r--r--gcc/f/data.h75
-rw-r--r--gcc/f/equiv.c1486
-rw-r--r--gcc/f/equiv.h102
-rw-r--r--gcc/f/expr.c299
-rw-r--r--gcc/f/expr.h195
-rw-r--r--gcc/f/fini.c9
-rw-r--r--gcc/f/flags.j28
-rw-r--r--gcc/f/g77.142
-rw-r--r--gcc/f/g77.texi1393
-rw-r--r--gcc/f/g77install.texi1445
-rw-r--r--gcc/f/g77spec.c681
-rw-r--r--gcc/f/glimits.j29
-rw-r--r--gcc/f/global.c63
-rw-r--r--gcc/f/global.h9
-rw-r--r--gcc/f/hconfig.j28
-rw-r--r--gcc/f/implic.c385
-rw-r--r--gcc/f/implic.h75
-rw-r--r--gcc/f/info-b.def37
-rw-r--r--gcc/f/info-k.def38
-rw-r--r--gcc/f/info-w.def42
-rw-r--r--gcc/f/info.c306
-rw-r--r--gcc/f/info.h187
-rw-r--r--gcc/f/input.j28
-rw-r--r--gcc/f/intdoc.c22
-rw-r--r--gcc/f/intdoc.in58
-rw-r--r--gcc/f/intdoc.texi63
-rw-r--r--gcc/f/intrin.c50
-rw-r--r--gcc/f/intrin.def5
-rw-r--r--gcc/f/intrin.h2
-rw-r--r--gcc/f/lab.c160
-rw-r--r--gcc/f/lab.h155
-rw-r--r--gcc/f/lang-options.h256
-rw-r--r--gcc/f/lang-specs.h50
-rw-r--r--gcc/f/lex.c102
-rw-r--r--gcc/f/lex.h204
-rw-r--r--gcc/f/malloc.c2
-rw-r--r--gcc/f/malloc.h184
-rw-r--r--gcc/f/name.c243
-rw-r--r--gcc/f/name.h110
-rw-r--r--gcc/f/news.texi609
-rw-r--r--gcc/f/parse.c21
-rw-r--r--gcc/f/proj.c5
-rw-r--r--gcc/f/proj.h37
-rw-r--r--gcc/f/rtl.j29
-rw-r--r--gcc/f/src.c3
-rw-r--r--gcc/f/src.h147
-rw-r--r--gcc/f/st.c555
-rw-r--r--gcc/f/st.h82
-rw-r--r--gcc/f/sta.c6
-rw-r--r--gcc/f/sta.h2
-rw-r--r--gcc/f/stb.c33
-rw-r--r--gcc/f/stb.h254
-rw-r--r--gcc/f/stc.c3
-rw-r--r--gcc/f/stc.h361
-rw-r--r--gcc/f/std.c4
-rw-r--r--gcc/f/std.h299
-rw-r--r--gcc/f/ste.c17
-rw-r--r--gcc/f/ste.h169
-rw-r--r--gcc/f/storag.c574
-rw-r--r--gcc/f/storag.h168
-rw-r--r--gcc/f/stp.c60
-rw-r--r--gcc/f/stp.h509
-rw-r--r--gcc/f/str-1t.fin137
-rw-r--r--gcc/f/str-2t.fin61
-rw-r--r--gcc/f/str-fo.fin56
-rw-r--r--gcc/f/str-io.fin44
-rw-r--r--gcc/f/str-nq.fin56
-rw-r--r--gcc/f/str-op.fin58
-rw-r--r--gcc/f/str-ot.fin62
-rw-r--r--gcc/f/str.c218
-rw-r--r--gcc/f/str.h86
-rw-r--r--gcc/f/sts.c2
-rw-r--r--gcc/f/sts.h90
-rw-r--r--gcc/f/stt.c1046
-rw-r--r--gcc/f/stt.h229
-rw-r--r--gcc/f/stu.c2
-rw-r--r--gcc/f/stu.h70
-rw-r--r--gcc/f/stv.c67
-rw-r--r--gcc/f/stv.h166
-rw-r--r--gcc/f/stw.c429
-rw-r--r--gcc/f/stw.h185
-rw-r--r--gcc/f/symbol.c8
-rw-r--r--gcc/f/symbol.def655
-rw-r--r--gcc/f/symbol.h290
-rw-r--r--gcc/f/target.c40
-rw-r--r--gcc/f/target.h1866
-rw-r--r--gcc/f/tconfig.j28
-rw-r--r--gcc/f/tm.j28
-rw-r--r--gcc/f/top.c32
-rw-r--r--gcc/f/top.h267
-rw-r--r--gcc/f/tree.j29
-rw-r--r--gcc/f/type.c108
-rw-r--r--gcc/f/type.h65
-rw-r--r--gcc/f/version.c35
-rw-r--r--gcc/f/version.h27
-rw-r--r--gcc/f/where.c543
-rw-r--r--gcc/f/where.h139
-rw-r--r--gcc/final.c245
-rw-r--r--gcc/fix-header.c97
-rwxr-xr-xgcc/fixinc.irix89
-rwxr-xr-xgcc/fixinc.math53
-rwxr-xr-xgcc/fixinc.sco33
-rw-r--r--gcc/flags.h25
-rw-r--r--gcc/flow.c557
-rw-r--r--gcc/fold-const.c272
-rw-r--r--gcc/frame.c33
-rw-r--r--gcc/function.c241
-rw-r--r--gcc/function.h15
-rw-r--r--gcc/gansidecl.h61
-rw-r--r--gcc/gbl-ctors.h4
-rw-r--r--gcc/gcc.121
-rw-r--r--gcc/gcc.c593
-rw-r--r--gcc/gcc.texi46
-rw-r--r--gcc/gcov-io.h5
-rw-r--r--gcc/gcov.c1
-rw-r--r--gcc/gen-protos.c17
-rw-r--r--gcc/genattr.c19
-rw-r--r--gcc/genattrtab.c122
-rw-r--r--gcc/gencodes.c19
-rw-r--r--gcc/genconfig.c19
-rw-r--r--gcc/genemit.c25
-rw-r--r--gcc/genextract.c34
-rw-r--r--gcc/genflags.c19
-rw-r--r--gcc/gengenrtl.c46
-rw-r--r--gcc/genopinit.c19
-rw-r--r--gcc/genoutput.c38
-rw-r--r--gcc/genpeep.c21
-rw-r--r--gcc/genrecog.c42
-rw-r--r--gcc/getopt.c1051
-rw-r--r--gcc/getopt.h133
-rw-r--r--gcc/getopt1.c190
-rw-r--r--gcc/getpwd.c2
-rw-r--r--gcc/ginclude/stdarg.h4
-rw-r--r--gcc/ginclude/va-alpha.h17
-rw-r--r--gcc/ginclude/va-clipper.h2
-rw-r--r--gcc/ginclude/va-ppc.h3
-rw-r--r--gcc/ginclude/varargs.h4
-rw-r--r--gcc/glimits.h2
-rw-r--r--gcc/global.c299
-rw-r--r--gcc/gthr.h8
-rw-r--r--gcc/haifa-sched.c375
-rw-r--r--gcc/install.texi59
-rw-r--r--gcc/integrate.c285
-rw-r--r--gcc/invoke.texi581
-rw-r--r--gcc/jump.c232
-rw-r--r--gcc/libgcc1-test.c3
-rw-r--r--gcc/libgcc2.c297
-rw-r--r--gcc/local-alloc.c208
-rw-r--r--gcc/longlong.h8
-rw-r--r--gcc/loop.c2904
-rw-r--r--gcc/loop.h20
-rw-r--r--gcc/machmode.h27
-rw-r--r--gcc/md.texi25
-rw-r--r--gcc/mips-tdump.c4
-rw-r--r--gcc/mips-tfile.c167
-rw-r--r--gcc/objc/Make-lang.in155
-rw-r--r--gcc/objc/Makefile.in46
-rw-r--r--gcc/objc/NXConstStr.h44
-rw-r--r--gcc/objc/NXConstStr.m42
-rw-r--r--gcc/objc/Object.h124
-rw-r--r--gcc/objc/Object.m387
-rw-r--r--gcc/objc/Protocol.h58
-rw-r--r--gcc/objc/Protocol.m128
-rw-r--r--gcc/objc/README.threads50
-rw-r--r--gcc/objc/THREADS374
-rw-r--r--gcc/objc/THREADS.MACH23
-rw-r--r--gcc/objc/archive.c1657
-rw-r--r--gcc/objc/class.c358
-rw-r--r--gcc/objc/config-lang.in2
-rw-r--r--gcc/objc/encoding.c554
-rw-r--r--gcc/objc/encoding.h75
-rw-r--r--gcc/objc/hash.c283
-rw-r--r--gcc/objc/hash.h206
-rw-r--r--gcc/objc/init.c832
-rw-r--r--gcc/objc/libobjc.def161
-rw-r--r--gcc/objc/libobjc_entry.c55
-rw-r--r--gcc/objc/linking.m40
-rw-r--r--gcc/objc/makefile.dos56
-rw-r--r--gcc/objc/misc.c152
-rw-r--r--gcc/objc/nil_method.c40
-rw-r--r--gcc/objc/objc-act.c171
-rw-r--r--gcc/objc/objc-api.h584
-rw-r--r--gcc/objc/objc-list.h147
-rw-r--r--gcc/objc/objc-parse.c3892
-rw-r--r--gcc/objc/objc-parse.y52
-rw-r--r--gcc/objc/objc.h157
-rw-r--r--gcc/objc/objects.c92
-rw-r--r--gcc/objc/runtime.h88
-rw-r--r--gcc/objc/sarray.c522
-rw-r--r--gcc/objc/sarray.h237
-rw-r--r--gcc/objc/selector.c458
-rw-r--r--gcc/objc/sendmsg.c651
-rw-r--r--gcc/objc/thr-dce.c281
-rw-r--r--gcc/objc/thr-decosf1.c281
-rw-r--r--gcc/objc/thr-irix.c235
-rw-r--r--gcc/objc/thr-mach.c312
-rw-r--r--gcc/objc/thr-os2.c267
-rw-r--r--gcc/objc/thr-posix.c229
-rw-r--r--gcc/objc/thr-pthreads.c218
-rw-r--r--gcc/objc/thr-single.c192
-rw-r--r--gcc/objc/thr-solaris.c259
-rw-r--r--gcc/objc/thr-vxworks.c192
-rw-r--r--gcc/objc/thr-win32.c272
-rw-r--r--gcc/objc/thr.c534
-rw-r--r--gcc/objc/thr.h143
-rw-r--r--gcc/objc/typedstream.h132
-rw-r--r--gcc/obstack.c593
-rw-r--r--gcc/obstack.h593
-rw-r--r--gcc/optabs.c424
-rw-r--r--gcc/output.h33
-rw-r--r--gcc/pexecute.c775
-rw-r--r--gcc/prefix.c7
-rw-r--r--gcc/print-rtl.c83
-rw-r--r--gcc/print-tree.c1
-rw-r--r--gcc/profile.c5
-rw-r--r--gcc/protoize.c25
-rw-r--r--gcc/real.c52
-rw-r--r--gcc/real.h42
-rw-r--r--gcc/recog.c98
-rw-r--r--gcc/recog.h2
-rw-r--r--gcc/reg-stack.c16
-rw-r--r--gcc/regclass.c238
-rw-r--r--gcc/regmove.c371
-rw-r--r--gcc/regs.h44
-rw-r--r--gcc/reload.c253
-rw-r--r--gcc/reload.h84
-rw-r--r--gcc/reload1.c4251
-rw-r--r--gcc/reorg.c144
-rw-r--r--gcc/rtl.c48
-rw-r--r--gcc/rtl.def67
-rw-r--r--gcc/rtl.h263
-rw-r--r--gcc/rtl.texi39
-rw-r--r--gcc/rtlanal.c136
-rw-r--r--gcc/scan-decls.c2
-rw-r--r--gcc/scan.h2
-rw-r--r--gcc/sched.c55
-rw-r--r--gcc/sdbout.c94
-rw-r--r--gcc/stmt.c246
-rw-r--r--gcc/stor-layout.c76
-rw-r--r--gcc/stupid.c195
-rw-r--r--gcc/system.h118
-rw-r--r--gcc/testsuite/ChangeLog495
-rw-r--r--gcc/testsuite/README.gcc69
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/p12475.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/warn03.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/array1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash39.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash56.C385
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash8.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/groff1.C34
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/reference1.C57
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/spec1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/spec2.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/spec3.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/spec4.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/ref4.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/rfg15.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/scoping12.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/tempcons.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template31.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk2.C49
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk3.C57
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/typeid1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/arm13.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/arm2.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators27.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators29.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility13.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh19.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh23.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh25.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh33.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh34.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh47.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh48.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh5.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh50.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh51.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh55.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns11.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns13.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns14.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/ns9.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p1989.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p785.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit12.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit13.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit34.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit35.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit7.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/instantiate1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memclass7.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memclass8.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp71.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/redecl1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec10.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec11.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec12.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec13.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec15.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec6.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/t05.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typedef1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typename3.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typename4.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typename5.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typename6.C1
-rw-r--r--gcc/testsuite/g++.old-deja/old-deja.exp67
-rw-r--r--gcc/testsuite/g77.f-torture/compile/970125-0.f56
-rw-r--r--gcc/testsuite/g77.f-torture/compile/971014-1.f12
-rw-r--r--gcc/testsuite/g77.f-torture/execute/alpha2.f20
-rw-r--r--gcc/testsuite/g77.f-torture/execute/cabs.f16
-rw-r--r--gcc/testsuite/g77.f-torture/execute/claus.f17
-rw-r--r--gcc/testsuite/g77.f-torture/execute/complex_1.f22
-rw-r--r--gcc/testsuite/g77.f-torture/execute/cpp.F6
-rw-r--r--gcc/testsuite/g77.f-torture/execute/dcomplex.f22
-rw-r--r--gcc/testsuite/g77.f-torture/execute/dnrm2.f2
-rw-r--r--gcc/testsuite/g77.f-torture/execute/erfc.f43
-rw-r--r--gcc/testsuite/g77.f-torture/execute/exp.f4
-rw-r--r--gcc/testsuite/g77.f-torture/execute/le.f38
-rw-r--r--gcc/testsuite/g77.f-torture/execute/short.f61
-rw-r--r--gcc/testsuite/gcc.c-torture/980408-1.c129
-rw-r--r--gcc/testsuite/gcc.c-torture/ChangeLog46
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/920715-1.x8
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c165
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c37
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp4
-rw-r--r--gcc/testsuite/gcc.c-torture/special/special.exp107
-rw-r--r--gcc/testsuite/gcc.c-torture/unsorted/memtst.c27
-rw-r--r--gcc/testsuite/gcc.c-torture/unsorted/stuct.c21
-rw-r--r--gcc/testsuite/gcc.dg/980312-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/980313-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/980414-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/980502-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/switch-1.c2
-rw-r--r--gcc/testsuite/lib/c-torture.exp19
-rw-r--r--gcc/testsuite/lib/f-torture.exp2
-rw-r--r--gcc/testsuite/lib/g77.exp21
-rw-r--r--gcc/testsuite/lib/old-dejagnu.exp38
-rw-r--r--gcc/texinfo.tex707
-rw-r--r--gcc/tlink.c29
-rw-r--r--gcc/tm.texi293
-rw-r--r--gcc/toplev.c1116
-rw-r--r--gcc/toplev.h38
-rw-r--r--gcc/tree.c230
-rw-r--r--gcc/tree.def41
-rw-r--r--gcc/tree.h424
-rw-r--r--gcc/unroll.c79
-rw-r--r--gcc/varasm.c200
-rw-r--r--gcc/version.c2
-rw-r--r--gcc/vfprintf.c21
-rw-r--r--gcc/xcoffout.c15
-rw-r--r--gcc/xcoffout.h24
685 files changed, 80473 insertions, 122066 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35992e14ea5..d7d849048b2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,2903 +1,2199 @@
-Thu May 7 15:39:14 1998 Jim Wilson <wilson@cygnus.com>
+Thu Oct 8 01:25:22 1998 Richard Henderson <rth@cygnus.com>
- * configure.in (enable_threads): Rename to enable_threads_flag before
- main loop. Set enable_threads to enable_threads_flag inside main
- loop.
+ * flow.c (find_basic_blocks): Calc upper bound for extra nops in
+ max_uids_for_flow.
+ (find_basic_blocks_1): Add a nop to the end of a basic block when
+ a trailing call insn does not have abnormal control flow.
+ * gcse.c (pre_transpout): New variable.
+ (alloc_pre_mem, free_pre_mem, dump_pre_data): Bookkeeping for it.
+ (compute_pre_transpout): Calculate it.
+ (compute_pre_ppinout): Use it to eliminate impossible placements
+ due to abnormal control flow through calls.
+ (compute_pre_data): Call compute_pre_transpout.
-Thu May 7 17:38:03 1998 Michael Meissner <meissner@cygnus.com>
+Wed Oct 7 21:40:24 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * r6000/eabi.asm (__eabi): Restore LR in case __eabi is called
- multiple times.
+ * config/sparc/sol2-sld-64.h (ASM_CPU_SPEC): Fix typo.
-Thu May 7 14:26:05 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Wed Oct 7 21:19:46 1998 Ken Raeburn <raeburn@cygnus.com>
- * aclocal.m4 (GCC_FUNC_VFPRINTF_DOPRNT): New macro.
-
- * configure.in: Add a call to GCC_FUNC_VFPRINTF_DOPRNT.
- (AC_CHECK_HEADERS): Remove unused check for varargs.h,sys/varargs.h.
- (AC_CHECK_FUNCS): Remove unused check for vprintf.
-
- * Makefile.in: Add support for linking in vfprintf.c and doprint.c.
- (cccp.o): Depend on gansidecl.h.
- (cexp.o): Likewise.
-
- * cccp.c: Convert from using PRINTF_ALIST/PRINTF_DCL to VPROTO as
- per the rest of gcc source.
- * cexp.y: Likewise. Include gansidecl.h and remove all code made
- redundant.
-
- * cccp.c: Remove checks for HAVE_VPRINTF and the associated code
- used when vfprintf is missing.
- * cexp.y: Likewise.
- * gcc.c: Likewise.
- * genattrtab.c: Likewise.
- * mips-tfile.c: Likewise.
- * toplev.c: Likewise.
-
- * vfprintf.c: New file.
- * doprint.c: New file.
-
-Thu May 7 10:18:41 1998 Jeffrey A Law (law@cygnus.com)
-
- * config/linux.h (ASM_COMMENT_START): Remove from here,
- * config/linux-aout.h (ASM_COMMENT_START): and here,
- * config/i386/linux.h (ASM_COMMENT_START): to here,
- * config/i386/linux-aout.h (ASM_COMMENT_START): and here.
- * config/i386/linux-oldld.h (ASM_COMMENT_START): Define
- here as '#' too.
-
-Thu May 7 10:55:59 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * config/mips/mips.md (tablejump_internal3, tablejump_internal4
+ and matching define_insns): Tack on a `use' of the table label, so
+ flow analysis will recognize a tablejump.
- * config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode
- constant.
+Wed Oct 7 17:33:39 1998 Richard Henderson <rth@cygnus.com>
-Wed May 6 22:32:37 CDT 1998 Robert Lipe <robertl@dgii.com>
+ * gcse.c (pre_insert_insn): Tweek to notice that calls do not
+ always end basic blocks for abnormal edge reasons.
- * Makefile.in (dwarfout.o) Add toplev.h dependency.
- * dwarfout.c, i386.c: Include toplev.h
- * toplev.h: (pfatal_with_name) Add prototype.
+Wed Oct 7 14:40:43 1998 Nick Clifton <nickc@cygnus.com>
-Wed May 6 19:02:29 1998 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in: Fix .SUFFIXES.
-
-Wed May 6 19:31:32 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * config/linux.h (ASM_COMMENT_START): Define as "#".
- * config/linux-aout.h (ASM_COMMENT_START): Likewise.
-
-Wed May 6 15:51:39 1998 Jim Wilson <wilson@cygnus.com>
-
- * objc/Make-lang.h (objc-parse.o): Add toplev.h dependency.
- * objc/objc-parse.y, objc/objc-parse.c: Regenerate.
-
- * toplev.c: Include toplev.h.
- * Makefile.in (c-common.o, c-convert.o, c-decl.o, c-iterate.o,
- c-lex.o, c-parse.o, c-pragma.o, c-typeck.o, calls.o, convert.o,
- dwarf2out.o, except.o, expr.o, final.o, fold-const.o, function.o,
- hash.o, profile.o, real.o, reg-stack.o, regclass.o, reload.o,
- reload1.o, stmt.o, stor-layout.o, tlink.o, tree.o, varasm.o): Add
- toplev.h dependency.
+ * config/i386/i386.h: Remove definition of
+ HANDLE_PRAGMA_PACK_PUSH_POP.
- * mips/mips.c (save_restore_insns): Change FRAME_POINTER_REGNUM to
- HARD_FRAME_POINTER_REGNUM.
-
- * expr.c (target_temp_slot_level): Delete duplicate definition.
-
-Wed May 6 16:46:01 1998 Jeffrey A Law (law@cygnus.com)
-
- * stmt.c (mark_seen_cases): Make it have external linkage again.
- * expr.h (mark_seen_cases): Add declaration, but only when tree.h
- has been included.
-
- * haifa-sched.c (print_value, case SUBREG): Fix typo.
-
- * i386.c (output_387_binary_op): Add some braces to avoid warnings.
- * i386.h (REG_CLASS_CONTENTS): Similarly.
-
- * toplev.c (-fsched-max): Delete flag.
- (-fsched-interblock-max-blocks,-fsched-interblock-max-insns): Likewise.
- * haifa-sched.c: Remove -fsched-max-N, -fsched-interblock-max-blocks-N
- and -fsched-interblock-max-insns-N support. Remove INTERBLOCK_DEBUG
- conditionals.
-
- * haifa-sched.c (find_rgns): Correctly handle reducible loops with
- inner loops which are not reducible.
-
- * loop.c (regs_match_p): Fix typo in prototype.
-
- * regmove.c (try_auto_increment): Wrap declaration inside an
- #ifdef AUTO_INC_DEC.
-
-Wed May 6 17:07:47 1998 Michael Meissner <meissner@cygnus.com>
-
- * final.c (output_operand_lossage): Call fatal with the operand
- lossage message instead of calling abort.
-
-Wed May 6 15:37:27 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-common.c: Convert to using ctype macros defined in system.h.
- * c-lex.c: Likewise.
- * cccp.c: Likewise.
- * collect2.c: Likewise.
- * rs6000.c: Likewise.
- * cpplib.c: Likewise.
- * fix-header.c: Likewise.
- * gcc.c: Likewise.
- * gen-protos.c: Likewise.
- * pexecute.c: Likewise.
- * protoize.c: Likewise.
- * rtl.c: Likewise.
- * scan.c: Likewise.
- * stmt.c: Likewise.
- * tlink.c: Likewise.
- * toplev.c: Likewise.
-
-Wed May 6 14:44:14 1998 Gavin Koch <gavin@cygnus.com>
-
- * config/mips/r3900.h (SUBTARGET_ASM_DEBUGGING_SPEC) :
- Replace -gdwarf-2 with -g0.
-
-Wed May 6 11:43:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (mips-tfile.o, mips-tdump.o): Depend on system.h.
- * mips-tdump.c: Include system.h, remove redundant headers.
- * mips-tfile.c: Likewise. Also, convert all ctype function calls
- to calls of the macro versions defined in system.h.
-
- * objc/Make-lang.in (objc-act.o): Depend on system.h.
- * objc/objc-act.c: Include system.h, remove redundant headers.
-
-Wed May 6 11:21:06 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in (AC_CHECK_FUNCS): Add isascii.
- (GCC_NEED_DECLARATIONS): Add atof.
-
- * system.h: Provide prototypes for abort, atof, atol and sbrk here.
- * rtl.c, rtl.h, toplev.c, tree.h: Not here.
-
-Wed May 6 10:52:49 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * system.h: Wrap time.h and sys/file.h in autoconf checks.
- Provide default definitions for O_RDONLY and O_WRONLY here.
-
- * cccp.c, cpplib.c, fix-header.c, gcc.c, protoize.c: Not here.
-
-1998-05-06 Mark Mitchell <mmitchell@usa.net>
-
- * tree.h (IS_EXPR_CODE_CLASS): Remove bogus '3'.
-
-Wed May 6 06:35:38 1998 Robert Lipe <robertl@dgii.com>
-
- * toplev.h: New file. Protypes for functions in toplev.c.
- * tree.h, rtl.h: Deleted protos for functions in toplev.c.
- * c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c,
- c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c,
- convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c,
- function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c,
- reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c,
- varasm.c: include it.
+ * config/i386/go32.h: Add definition of
+ HANDLE_PRAGMA_PACK_PUSH_POP.
+
+ * config/i386/win32.h: Add definition of
+ HANDLE_PRAGMA_PACK_PUSH_POP.
+
+ * config/i386/cygwin32.h: Add definition of
+ HANDLE_PRAGMA_PACK_PUSH_POP.
-Wed May 6 01:09:01 1998 Jeffrey A Law (law@cygnus.com)
- Jim Wilson (wilson@cygnus.com)
+ * c-pragma.c (insert_pack_attributes): Do not insert
+ attributes unless #pragma pack(push,<n>) is in effect.
- * haifa-sched.c (find_rgns): In no_loops case, fix test for leaf
- blocks. Check for 1 successor which is the EXIT_BLOCK.
+Wed Oct 7 12:10:46 1998 Jim Wilson <wilson@cygnus.com>
- * haifa-sched.c (find_rgns): Detect unreachable blocks, including
- unreachable loops with more than one block.
+ * expr.c (emit_group_store): Handle a PARALLEL destination.
-Wed May 6 08:22:24 1998 Manfred Hollstein <manfred@s-direktnet.de>
+Wed Oct 7 10:07:29 1998 Richard Henderson <rth@cygnus.com>
- * fix-header.c (write_rbrac): Add "abort" to functions which need to
- be protected.
+ * gcse.c (pre_insert_insn): When a call ends a bb, insert
+ the new insns before the argument regs are loaded.
-Wed May 6 00:09:36 1998 Jeffrey A Law (law@cygnus.com)
+Wed Oct 7 12:55:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * Check in merge from gcc2. See ChangeLog.12 for details.
+ * Makefile.in (c-gperf.h): Add -L KR-C -F ', 0, 0' flags to gperf.
+ (c-parse.gperf): Update comments describing invocation flags.
+ (c-gperf.h): Regenerate using gperf 2.7.1 (19981006 egcs).
-Tue May 5 14:33:49 1998 Jim Wilson <wilson@cygnus.com>
+1998-10-07 Manfred Hollstein <manfred@s-direktnet.de>
- * c-common.c (scan_char_table): Separate 's' and 'c'. 'c' does not
- accept 'a' flag. 'S' does accept 'a' flag.
- (check_format_info): When pedantic, warn for m/C/S/a/A formats,
- and `a' flag.
+ * reload1.c (reload): Call free before clobbering the memory
+ locations or constants pointers.
- * elf64.h (MULTILIB_DEFAULTS): Move definition after mips.h include.
+Wed Oct 7 02:05:20 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Tue May 5 10:50:39 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Rework
+ for efficiency by checking whether we need to modify the current
+ stack permission at all.
+ (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Define.
+ * config/sparc/sparc.c (sparc_initialize_trampoline): Emit
+ __enable_execute_stack libcall here too if
+ TRANSFER_FROM_TRAMPOLINE is defined.
+ * config/sparc/sparc.h: Set TARGET_ARCH32 to a constant if
+ IN_LIBGCC2.
- * config/m68k/m68k.h: Declare functions from m68k.c used in
- macros and machine description.
- (ASM_OUTPUT_LONG_DOUBLE): Always use `l' flag in print format for
- long values.
- (ASM_OUTPUT_FLOAT): Likewise.
- (ASM_OUTPUT_FLOAT_OPERAND): Likewise.
+Wed Oct 7 02:27:52 1998 Jeffrey A Law (law@cygnus.com)
-Tue May 5 01:28:12 1998 Jason Merrill <jason@yorick.cygnus.com>
+ * Makefile.in (DRIVER_DEFINES): Remove last change.
+
+Wed Oct 7 01:08:43 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
- * tree.def: Add NAMESPACE_DECL.
- * dwarfout.c (type_ok_for_scope): Ignore NAMESPACE_DECLs for now.
- * dwarf2out.c (push_decl_scope): Likewise.
- (scope_die_for): Likewise.
- * tree.c (decl_function_context): Use TREE_CODE_CLASS to determine
- how to get next context level.
+ * jump.c (duplicate_loop_exit_test): Strip REG_WAS_0 notes off all
+ insns we're going to copy.
+ * regclass.c (reg_scan_mark_refs): Don't test X for NULL_RTX.
-Tue May 5 01:43:16 1998 Jim Wilson <wilson@cygnus.com>
+ * loop.c (count_one_set): Add prototype.
- * i386.c (output_fix_trunc): Add code to emulate non-popping DImode
+ * caller-save.c (restore_referenced_regs): Lose mode argument.
+ (insert_save): Lose mode argument.
+ (insert_restore): Lose mode argument.
+ (insert_one_insn): Lose mode argument.
+ (save_call_clobbered_regs): Lose mode argument.
+ (setup_save_areas): Take no argument and return void. All callers
+ changed.
+ Don't verify validity of memory addresses.
+ * reload.h (setup_save_ares): Adjust prototype.
+ (save_call_clobbered_regs): Likewise.
+ * reload1.c (delete_caller_save_insns): New function.
+ (caller_save_spill_class): Delete variable.
+ (caller_save_group_size): Delete variable.
+ (reload): Call setup_save_areas and save_call_clobbered_regs
+ in the main loop, before calling calculate_needs_all_insns.
+ Don't call save_call_clobbered_regs after the loop.
+ Call delete_caller_save_insns at the end of an iteration if
+ something changed.
+ Delete code to manage caller_save_spill_class.
+ Emit the final note before setting reload_first_uid.
+ Simplify test that determines whether reload_as_needed gets run.
+ (calculate_needs): Delete code to manage caller_save_spill_class.
+
+Tue Oct 6 15:42:27 1998 Richard Henderson <rth@cygnus.com>
+
+ * collect2.c (main): Initialize ld_file_name.
+
+Tue Oct 6 15:45:15 1998 Catherine Moore <clm@cygnus.com>
+
+ * config/sparc/sysv4.h (ASM_OUTPUT_SECTION_NAME): Don't
+ check for flag_function_sections.
+
+Tue Oct 6 20:02:31 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * cse.c (insert_regs): Fix bug in Sep 24 change.
+
+Tue Oct 6 17:00:42 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * flags.h (flag_dump_unnumbered): Declare.
+ * toplev.c (flag_dump_unnumbered): Don't declare.
+ * print-rtl.c (flags.h): Include.
+ (print_rtl_single): Add return value.
+ * rtl.h (print_rtl_single): Update declaration.
+ * flow.c (flag_dump_unnumbered): Don't declare.
+ (print_rtl_with_bb): Use return value of print_rtl_single.
+
+Tue Oct 6 01:36:00 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
+
+ * loop.c (count_one_set): New static function, broken out of
+ count_loop_regs_set
+ (count_loop_regs_set): Call it.
+ * global.c (mark_reg_store): Handle clobbers here by not calling
+ set_preference.
+ (mark_reg_clobber): Just call mark_reg_store after ensuring SETTER
+ is in fact a clobber.
+ * integrate.c (process_reg_param): New function, broken out of
+ expand_inline_function.
+ (expand_inline_function): Call it.
+
+
+ * i386.md (addsidi3_1): Delete unused variable temp.
+ (addsidi3_2): Likewise.
+ (clstrstrsi): Delete unused variable addr1.
+
+ * rtl.h: Don't declare any functions also declared in recog.h.
+
+ * Makefile.in (stupid.o): Update dependencies.
+ (global.o): Likewise.
+
+ * global.c: Include reload.h
+ (reg_becomes_live): New function.
+ (reg_dies): New function.
+ (build_insn_chain): New function.
+ (global_alloc): Call build_insn_chain before calling reload.
+
+ * reload.h (struct needs): New structure definition.
+ (struct insn_chain): Likewise.
+ (reload_insn_chain): Declare variable.
+ (new_insn_chain): Declare function.
+
+
+ * reload1.c (reload_startobj): New variable.
+ (reload_insn_chain): New variable.
+ (unused_insn_chains): New variable.
+ (new_insn_chain): New function.
+ (init_reload): Initialize reload_startobj, not reload_firstobj.
+ (reload): Initialize reload_firstobj.
+ Before returning, free everything on the reload_obstack.
+
+ * stupid.c: Include insn-config.h, reload.h and basic-block.h.
+ (reg_where_dead_chain, reg_where_born_exact, reg_where_born_clobber,
+ current_chain): New variables.
+ (reg_where_born): Delete variable.
+ (REG_WHERE_BORN): New macro.
+ (find_clobbered_regs): New function.
+ (stupid_life_analysis): Don't allocate/free reg_where_born.
+ Allocate and free reg_where_born_exact, reg_where_born_clobber,
+ reg_where_dead_chain.
+ Use REG_WHERE_BORN instead of reg_where_born.
+ While processing the insns, build the reload_insn_chain with
+ information about register lifetimes.
+ (stupid_reg_compare): Use REG_WHERE_BORN instead of reg_where_born.
+ (stupid_mark_refs): Replace arg INSN with arg CHAIN. All callers
+ changed.
+ Compute and information about birth and death of pseudo registers in
+ reg_where_dead_chain, reg_where_born_exact and reg_where_born_clobber.
+ Delete code to set elements of reg_where_born.
+
+Mon Oct 5 22:34:30 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * tree.def (GOTO_EXPR): Modified documentation.
+ * expr.c (expand_expr): Expand GOTO_EXPR into a goto or a computed
+ goto.
+
+Mon Oct 5 22:43:36 1998 David Edelsohn <edelsohn@mhpcc.edu>
+
+ * unroll.c (loop_iteration_var, loop_initial_value, loop_increment
+ loop_final_value, loop_comparison_code): No longer static.
+ (unroll_loop): Delete loop_start_value update.
+ * loop.h (loop_iteration_var, loop_initial_value, loop_increment,
+ loop_final_value, loop_comparison_code): Extern.
+ (loop_start_value): Delete extern.
+ * loop.c (loop_can_insert_bct, loop_increment, loop_start_value,
+ loop_comparison_value, loop_comparison_code): Delete.
+ (loop_optimize): Remove initialization for deleted variables.
+ (strength_reduce): Delete analyze_loop_iterations call. Only call
+ insert_bct if flag_branch_count_on_reg set.
+ (analyze_loop_iterations): Delete.
+ (insert_bct): Remove iteration count calculation. Move checks for
+ viable BCT optimization to here. Obtain iteration count from
+ loop_iterations and correct for unrolling. Check for enough
+ iteration to be beneficial. Comment out runtime iteration count
case.
+ (insert_bct): Print iteration count in dump file. Remove
+ loop_var_mode and use word_mode directly.
-Tue May 5 01:15:06 1998 Jeffrey A Law (law@cygnus.com)
-
- * h8300.h (ADDITIONAL_REGISTER_NAMES): Add "er" registers.
-
- * reorg.c (fill_slots_from_thread): Update REG_DEAD/REG_UNUSED notes
- for any insns skipped at the start of a block because they were
- redundant.
+ * rs6000.h (processor_type): Add PROCESSOR_PPC604e.
+ * rs6000.c (rs6000_override_options): Use it.
+ (optimization_options): Enable use of flag_branch_on_count_reg.
+ * rs6000.md (define_function_unit): Describe 604e.
-Mon May 4 20:23:51 1998 Jim Wilson <wilson@cygnus.com>
+1998-10-05 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
- * alpha.h (DBX_CONTIN_LENGTH): Decrease to 3000.
+ * loop.c (move_movables): Corrected threshold calculation for
+ moved_once registers.
-1998-05-04 Ulrich Drepper <drepper@cygnus.com>
+Mon Oct 5 21:18:45 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
- * c-common.c (format_char_info): Add new field hhlen.
- (print_char_table, scan_char_table, time_char_table): Initialize
- hhlen field appropriately.
- (char_format_info): Recognize hh modifier and lookup correct char
- table entry.
+ * loop.c (combine_givs_p): Fix test for identical givs.
-Mon May 4 19:15:29 1998 Jim Wilson <wilson@cygnus.com>
+Mon Oct 5 10:11:28 1998 Nick Clifton <nickc@cygnus.com>
- * expr.c (expand_expr, case INDIRECT_REF): Don't optimize string
- reference if this is a store.
+ * dwarf2out.c (gen_subprogram_die): If errorcount nonzero, don't
+ call abort if the function is already defined.
-Mon May 4 17:25:17 1998 Richard Henderson <rth@cygnus.com>
+Mon Oct 5 10:02:36 1998 Jeffrey A Law (law@cygnus.com)
- * sparc.c (output_move_quad): Fix typo in mov_by_64 argument.
+ * combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if
+ truncation is not a no-op.
-Sun May 3 23:57:25 1998 Robert Lipe <robertl@dgii.com>
-
- Make UnixWare 7 bootstrap support work with final shipping product.
- * configure.in: (i[34567]86-*-sysv5): append, not overwrite, xm_file.
- Pick up xm-siglist and xm-alloca.
- (xm_defines): Add USG so dbxout will build.
- * configure: Regenerate.
-
-Sun May 3 13:51:34 PDT 1998 Richard Henerson <rth@cygnus.com>
-
- Support for official Sparc V9 ABI:
- * sparc.c (sparc_override_options): Force stack bias off for !arch64.
- Care for flag_pcc_struct_return default.
- (output_move_quad): Rewrite to move by halves on v9 and in the
- proper direction.
- (move_quad_direction): New function.
- (output_fp_move_quad): Use it to determine the direction of copy.
- (function_arg_slotno): Return -1 for FP reg overflow as well.
- (function_arg_record_value*): New functions.
- (function_arg): Use them. Streamline unprototyped parameter passing.
- (function_arg_pass_by_reference): Pass TCmode by reference.
- (function_value): New function.
- * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use
- long long in 64-bit mode.
- (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs.
- (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable.
- (BASE_RETURN_VALUE_REG): Consider complex float types for arch64.
- (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise.
- (BASE_INCOMING_ARG_REG): Likewise.
- (FUNCTION_VALUE): Call function_value.
- (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise.
- * sparc.md (movdi_sp32_v9): Disable for arch64.
- (movsf, movdf, movtf): Sort all ulternatives using fp regs first.
- (call_value_address_sp64): Remove register class constraints.
- (call_value_symbolic_sp64): Likewise.
- (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain
- v9 case to 32-bit constants.
- (goto_handler_and_restore_v9): Provide a version for arch64.
- * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition.
- * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias.
- (CPP_PREDEFINES): New.
- * sparc/sp64-elf.h: Likewise.
- (PREFERRED_DEBUGGING_TYPE): Dwarf2.
- (ASM_OUTPUT_DWARF2_ADDR_CONST): New.
- * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes.
-
-Sat May 2 17:47:17 PDT 1998 Jeff Law (law@cygnus.com)
+Mon Oct 5 09:02:04 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sat May 2 01:37:29 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * reload.c (find_reloads): Emit USEs to mark where a pseudo
- is reloaded with the MEM of its stack slot.
- * reload1.c (cannot_omit_stores): Delete.
- (reload): Don't initialize it.
- Don't apply avoid_return_reg logic to USEs.
- When done, remove USEs that have a REG_EQUAL note on them.
- (emit_reload_insns): Handle case where we have inherited a MEM.
- (delete_output_reload): Don't use cannot_omit_stores.
-
-Thu Apr 30 18:59:03 1998 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (cpp.info, gcc.info): Put -o option before input file.
-
-Thu Apr 30 16:57:34 1998 Michael Meissner <meissner@cygnus.com>
-
- * haifa-sched.c (print_{exp,value}): Various changes to make the
- debug output easier to read. Also, use only one buffer, and make
- sure the buffer we are passed in doesn't overflow.
- (safe_concat): Concatenate to a buffer without overflow.
-
-Thu Apr 30 16:57:34 1998 Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
-
- * haifa-sched.c (alloc_{INSN,EXPR}_LIST): Make static to agree
- with the prototype.
-
-Wed Apr 29 21:45:16 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sched.c (new_insn_dead_notes): Check if the register was
- used in the original instruction.
- * haifa-sched.c (new_insn_dead_notes): Likewise.
-
-Wed Apr 29 13:46:03 1998 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (scope_die_for): If could not find proper scope,
- check for and handle tagged type with incorrect TYPE_CONTEXT.
-
-Wed Apr 29 15:34:40 1998 John Carr <jfc@mit.edu>
-
- * calls.c (expand_call): Fix recognition of C++ operator new.
-
- * alias.c (mode_alias_check): Disable type based alias detection.
-
-Wed Apr 29 15:06:42 1998 Gavin Koch <gavin@cygnus.com>
-
- * config/mips/elf.h (ASM_OUTPUT_DEF,ASM_WEAKEN_LABEL,
- ASM_OUTPUT_WEAK_ALIAS): Define.
- * config/mips/elf64.h: Same.
- * config/mips/r3900.h (ASM_OUTPUT_DEF,SUPPORTS_WEAK,
- ASM_WEAKEN_LABEL): Removed.
-
-Wed Apr 29 10:53:29 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * calls.c (expand_call): Bump the length limit on the specially
- recognized function names to 17.
-
-Tue Apr 28 17:53:33 1998 Jim Wilson <wilson@cygnus.com>
-
- * ginclude/stddef.h: Add check for _MACHINE_ANSI_H_ for BSD/OS
- when undefining macros at the end.
-
- * expr.c (expand_builtin, case BUILT_IN_MEMSET): Break if either
- val or len has TREE_SIDE_EFFECTS set.
-
- * sparc.md (mulsidi3): Call const v8plus and v8plus routines.
- (mulsidi3_v8plus, const_mulsidi3_v8plus): Delete asterisk from name.
- (smuldi3_highpart): Call const v8plus routine.
- (smulsi3_highpart_v8plus): Renamed from smulsidi3_highpart_v8plus.
- (const_smulsi3_highpart_v8plus): New pattern.
- (smulsi3_highpart_sp32): Renamed from smulsidi3_highpart_sp32.
- (umulsidi3): Call const v8plus routine.
- (umulsi3_highpart): Handle const before v8plus. Call const v8plus
- routine.
- (umulsi3_highpart_v8plus): Renamed from umulsidi3_highpart_v8plus.
- (umulsi3_highpart_sp32): Renamed from umulsidi3_highpart_sp32.
-
-Tue Apr 28 08:55:26 1998 Michael Meissner <meissner@cygnus.com>
-
- * m32r.c (*_oper{and|ator}): Change enum arguments and return
- values to int, so they can be prototyped even in files that don't
- include rtl.h.
- ({small,large}_insn_p): Ditto.
- (m32r_select_cc_mode): Ditto.
- (gen_compare): Ditto.
- (function_arg_partial_nregs): Ditto.
- (m32r_setup_incoming_varargs): Ditto.
- (init_reg_tables): Add prototype.
- (m32r_frame_info): Add prolog_size field.
- (m32r_compute_frame_size): Calculate the size of the prologue.
- (m32r_first_insn_address): Return prologue size.
- (m32r_output_function_prologue): Calculate frame size before
- printing out information. Print out the prologue size.
-
- * m32r.h: Prototype all functions in m32r.c.
- (FIRST_INSN_ADDRESS): Declare, returning prologue size.
-
- * m32r.md (bcc functions): Cast enum's to int.
-
- * m32r.c (conditional_move_operand): Silence a debug message.
- ({small,long}_insn): New predicates.
-
- * m32r.h (TARGET_M32R): New macro.
- (PREDICATE_CODES): Rearrange somewhat, add small_insn/long_insn.
- (HAIFA_P): Define as 1/0 depending on whether the Haifa scheduler
- was selected.
- (ISSUE_RATE): Define as 2.
-
- * m32r.md (insn_size): New attribute.
- ({,rev_}branch_insn): Add .s qualifier to branches believed to be
- short.
- (m32r): New attribute.
-
- * configure.in (enable_haifa): Switch m32r to Haifa by default.
- * configure: Regenerate.
-
- (Changes from Nick Clifton <nickc@cygnus.com>)
- * m32r.h (EXTRA_CONSTRAINT): Implement 'S' constraint to perfoirm
- the equivalent of a negated 'I' constraint.
- (PRESERVE_DEATH_INFO_REGNO_P): Define in order to allow peephole
- optimisation to work.
-
- * m32r.md (cmp_ne_small_const_insn): Use 'S' constriant rather
- than 'I' since the value is negated.
- (peephole): Add peephole optimisation to cope with optimization of
- divide and subtracts of the same operands.
-
- * m32r.c zero_and_one, emit_cond_move): Add support for MVFC.
- * m32r.h: Ditto.
- * m32r.md: Ditto.
-
- * m32r.h (PREDICATE_CODES): Add declaration of machine specific
- predicates.
-
-Tue Apr 28 07:25:53 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (libgcc2.ready): Revert last patch (Apr 24).
-
-Mon Apr 27 18:39:47 1998 Nick Clifton <nickc@cygnus.com>
-
- * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Check against
- frame_pointer_rtx not FRAME_POINTER_REGNUM.
-
-Mon Apr 27 18:36:28 1998 Jim Wilson <wilson@cygnus.com>
-
- * reg-stack.c: Revert last patch (Apr 20).
- (convert_regs): Set insn to PREV_INSN (next) after do while loop.
-
- * m68k/lb1sf68.asm (Laddsf$3): Fix typos in mcf5200 exg code.
-
- * loop.c (check_dbra_loop): New locals jump, first_compare, and
- compare_and_branch. Call get_condition to set first_compare.
- Set compare_and_branch to number of compare/branch instructions.
- Replace PREV_INSN (PREV_INSN (loop_end)) with first_compare.
- Replace '2' with compare_and_branch.
-
-Mon Apr 27 15:53:30 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
-
- * cplus-dem.c (demangle_qualified): Replace missing else.
-
-Mon Apr 27 20:22:08 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (gen_ashift_hi): Don't make SUBREG of a SUBREG.
-
-Mon Apr 27 18:23:51 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (sh_expand_prologue, sh_expand_epilogue):
- If TARGET_DOUBLE_ALIGN, preserve 64 bit stack alignment.
- * sh.h (STACK_BOUNDARY): Likewise.
-
-Mon Apr 27 17:22:48 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h (LEGITIMIZE_RELOAD_ADDRESS): Define.
-
-Mon Apr 27 08:55:23 1998 Michael Meissner <meissner@cygnus.com>
-
- * system.h (abort): If abort is not defined, and neither is
- USE_SYSTEM_ABORT, redefine abort to call fprintf and exit,
- reporting the line and filename of the error.
-
- * .gdbinit: Add breakpoints on exit and fancy_abort.
-
- * final.c (split_double): Avoid a compiler warning if
- BITS_PER_WORD is less than or equal to HOST_BIT_PER_WIDE_INT.
-
- * rtl.h (JUMP_{CROSS_JUMP,NOOP_MOVES,AFTER_REGSCAN}): New macros
- for calling jump_optimize.
-
- * toplev.c (rest_of_compilation): Call jump_optimize using JUMP_*
- macros, rather than 0/1's.
-
-Sun Apr 26 23:19:10 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.h (CONST_COSTS): Zero is always free.
- (RTX_COSTS): Add EV6 costs. Abort if alpha_cpu is unknown.
-
-Sun Apr 26 15:38:50 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * cplus-dem.c (gnu_special): Fix off-by-one bug when checking the
- length in the name of a virtual table.
-
-Sun Apr 26 01:21:06 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (print_operand): Don't add 'v' suffix for ALPHA_FPTM_N.
-
-Sat Apr 25 22:11:38 PDT 1998 Jeff Law (law@cygnus.com)
+Mon Oct 5 08:19:55 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sat Apr 25 17:17:15 1998 Jeffrey A Law (law@cygnus.com)
-
- * fold-const.c (fold_convert): Fix typo.
-
-Sat Apr 25 17:55:54 1998 John Carr <jfc@mit.edu>
-
- * alias.c (alias_invariant): New variable.
- (record_base_value): New argument INVARIANT.
- (memrefs_conflict_p): If a register has an entry in the alias_invariant
- array, try substituting that value for the register.
-
- * rtl.h: Declare record_base_value.
-
- * loop.c, unroll.c: Update callers of record_base_value.
-
- * alias.c (find_base_value, find_base_term): SIGN_EXTEND and
- ZERO_EXTEND do not affect base values.
-
-Fri Apr 24 15:57:02 1998 Jeffrey A Law (law@cygnus.com)
-
- * dbxout.c (dbxout_type): Fix typo.
- (dbxout_range_type): Another HOST_WIDE_INT_PRINT_DEC fix.
-
- * configure.in: Use CC_FOR_BUILD, not BUILD_CC.
-
-Fri Apr 24 16:11:47 1998 John Carr <jfc@mit.edu>
-
- * expr.c (expand_builtin, case MEMSET): Set MEM_IN_STRUCT_P
- if the argument is the address of a structure or array.
-
- * configure.in: Enable Haifa scheduler by default for SPARC.
-
-Fri Apr 24 20:55:47 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * cse.c (cse_set_around_loop): Don't do optimization when
- new pseudos are created.
-
-Fri Apr 24 11:00:18 1998 Jeffrey A Law (law@cygnus.com)
-
- * dbxout.c (dbxout_type_fields): Use HOST_WIDE_INT_PRINT_DEC
- appropriately.
- (dbxout_type_method_1, dbxout_type): Likewise.
- (print_int_cst_octal, print_octal, dbxout_symbol): Likewise.
- (dbxout_type): Fix check for when to print a type range in
- octal vs decimal.
-
-Fri Apr 24 16:45:03 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * (gen_shl_and, in case 1): Fix comparison with mask.
-
-Fri Apr 24 06:46:40 1998 Nick Clifton <nickc@cygnus.com>
-
- * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Disallow frame
- pointer as second register in REG+REG pair.
-
-Fri Apr 24 09:22:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-common.c (check_format_info): Don't check for the 'x' format
- character twice, instead check for 'x' and 'X'
-
-Fri Apr 24 08:02:30 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (libgcc2.ready): Add explicit dependancy from
- $(STMP_FIXPROTO) to ensure all necessary include files have
- been created and to guarantee proper parallel builds.
-
-Fri Apr 24 04:42:35 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (sh_expand_prologue, in !SH3E code): Don't push an extra
- register for stdarg functions.
- * sh.h (current_function_varargs): Declare.
- (FUNCTION_ARG): Ignore NAMED for stdarg functions.
-
-1998-04-23 Jim Wilson <wilson@cygnus.com>
-
- * frame.c, libgcc2.c (stdlib.h, unistd.h): Don't include when
- inhibit_libc is defined.
+Mon Oct 5 01:07:23 1998 Torbjorn Granlund <tege@matematik.su.se>
- * c-aux-info.c (gen_type): Use DECL_NAME only for TYPE_DECL.
+ * expmed.c (expand_divmod): Don't widen for computing remainder
+ if we seem to have a divmod pattern for needed mode.
-Thu Apr 23 19:09:33 1998 Jim Wilson <wilson@cygnus.com>
+Mon Oct 5 01:01:42 1998 Zack Weinberg <zack@rabi.phys.columbia.edu>
- * profile.c (tablejump_entry_p): New function.
- (branch_prob): Add code to recognize MIPS tablejump entry branch.
- Use tablejump_entry_p in MIPS and HPPA tablejump checking code.
+ * cpplib.c (macroexpand): Correct off-by-one error in handling
+ of escapes.
-Thu Apr 23 15:01:13 1998 Nick Clifton <nickc@cygnus.com>
+Sun Oct 4 23:58:30 1998 Richard Henderson <rth@cygnus.com>
- * config/arm/arm.c (find_barrier): Return as soon as a barrier is
- found, rather than at end of the loop, after the insn has been
- changed.
-
-Thu Apr 23 20:21:06 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (gen_ashift_hi): Implement right shifts via gen_ashift.
- * sh.md (ashrhi3_k, lshrhi3_k, lshrhi3_m, lshrhi3, lshrhi3+1): Delete.
-
-Wed Apr 22 17:07:35 1998 Michael Meissner <meissner@cygnus.com>
-
- * loop.c (note_addr_stored): Correct function to take 2 arguments,
- instead of 1.
-
- * rtl.def (MATCH_INSN2): Add new matching pattern.
- * genrecog.c (add_to_sequence): Support MATCH_INSN2.
-
-Wed Apr 22 15:52:22 1998 John Carr <jfc@mit.edu>
-
- * emit-rtl.c (gen_highpart): The high part of a CONST_INT is not zero
- if HOST_BITS_PER_WIDE_INT is larger than BITS_PER_WORD.
-
- * final.c (split_double): Sign extend both halves of a split CONST_INT.
-
-Wed Apr 22 10:42:45 1998 Jeffrey A Law (law@cygnus.com)
-
- * mips.c (compute_frame_size): Change only argument to a HOST_WIDE_INT.
-
-Wed Apr 22 10:53:49 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
-
- * cplus-dem.c (struct work stuff): Add field for B and K mangle codes.
- (cplus_demangle_opname): Call mop_up_squangle.
- (cplus_demangle): Initialize squangle info, then call
- internal_cplus_demangle. (Most code moved there as well)
- (internal_cplus_demangle): New function, performs most of what use
- to be done in cplus_demangle, but is only called with this file.
- (squangle_mop_up): New function to clean up B and K code data.
- (mop_up): set pointers to NULL after freeing.
- (demangle_signature, demangle_template, demangle_class): Add
- switch elements to handle K and B codes.
- (demangle_prefix, gnu_special, demangle_qualified): Add
- code to handle K and B codes.
- (do_type, demangle_fund_type): Handle B and K codes.
- (remember_Ktype): New function to store K info.
- (register_Btype, remember_Btype): New functions for B codes.
- (forget_B_and_K_types): New function to destroy B and K info.
+ * combine.c (expand_field_assignment): Don't do bitwise operations
+ on MODE_FLOAT; pun to MODE_INT if possible.
-1998-04-21 Jim Wilson <wilson@cygnus.com>
+Sun Oct 4 18:33:24 1998 Jason Merrill <jason@yorick.cygnus.com>
+ scott snyder <snyder@d0sgif.fnal.gov>
- * stmt.c (check_seenlabel): When search for line number note for
- warning, handle case where there is no such note.
+ * tlink.c (scan_linker_output): Recognize errors from irix 6.2
+ linker. Recognize mangled names in quotes.
-Tue Apr 21 20:48:37 1998 John Carr <jfc@mit.edu>
+Sun Oct 4 02:58:20 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
- * genemit.c (gen_exp): Allow machine description to set mode of
- MATCH_OP_DUP.
+ * config/sparc/sparc.md (ashldi3+1): Name it ashldi3_sp64.
+ (ashlsi3_const1, ashldi3_const1): New combiner patterns.
+ (ashrsi3_extend, ashrsi3_extend2): New combiner patterns.
+ (lshrsi3_extend, lshrsi3_extend2): Ditto.
-Tue Apr 21 16:36:01 1998 John Carr <jfc@mit.edu>
+Sun Oct 4 00:23:00 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * alias.c (mode_alias_check): New function.
- (true_dependence, anti_dependence, output_dependence): Call
- mode_alias_check.
+ * function.c (purge_addressof_1): If trying to take a sub-word
+ integral piece of a floating point mode, put it on the stack.
-Tue Apr 21 12:05:32 1998 Jeffrey A Law (law@cygnus.com)
+Sat Oct 3 19:01:03 1998 Richard Henderson <rth@cygnus.com>
- * mips.h (STACK_BOUNDARY): Allow specific targets to override.
- (MIPS_STACK_ALIGN): Similarly.
+ * alpha/linux.h (CPP_PREDEFINES): Define __alpha__ for imake.
- * c-common.c (type_for_mode): Handle TI types.
- * c-decl.c (intTI_type_node, unsigned_int_TI_type_node): Define.
- (init_decl_processing): Handle TI types.
- * c-tree.h (intTI_type_node, unsigned_int_TI_type_node): Declare.
+Sat Oct 3 14:42:19 1998 Jason Merrill <jason@yorick.cygnus.com>
- * mips.c (block_move_loop): Test Pmode == DImode instead of
- TARGET_MIPS64.
- (expand_block_move, save_restore_insns): Likewise.
- (function_prologue, mips_expand_prologue): Likewise.
- (mips_expand_epilogue): Likewise.
- * mips.h (POINTER_SIZE): Allow specific targets to override.
- (Pmode): Allow specific targets to override.
- (FUNCTION_PROFILER): Test Pmode == DImode instead of TARGET_MIPS64
- (POINTER_BOUNDARY, FUNCTION_MODE): Likewise.
- (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE): Likewise.
- (TRAMPOLINE_ALIGNMENT, INITIALIZE_TRAMPOLINE): Likewise.
- (CASE_VECTOR_MODE, ASM_OUTPUT_ADDR_VEC_ELT): Likewise.
- (ASM_OUTPUT_ADDR_DIFF_ELT, SIZE_TYPE, PTRDIFF_TYPE): Likewise.
- * mips.md (indirect, tablejump & casesi support): Test for
- Pmode == DImode instead of TARGET_MIPS64.
- (call patterns): Likewise.
+ * PROJECTS: Remove template friends.
-Tue Apr 21 09:43:55 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * collect2.c (sort_ids): Remove unused variable.
- * objc/sendmsg.c: Define gen_rtx_MEM() to 1, as is already done
- for gen_rtx(MEM, ...).
+ * tm.texi (MATH_LIBRARY): Document.
+ (NEED_MATH_LIBRARY): Remove.
-Tue Apr 21 02:15:36 1998 Richard Henderson <rth@cygnus.com>
+ * varasm.c (assemble_start_function, assemble_variable, weak_finish,
+ assemble_alias): Do ASM_GLOBALIZE_LABEL for weak symbols, too.
- * sparc.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Rewrite
- to not be so gross, and to properly function with PIC.
+Sat Oct 3 16:14:44 1998 John Carr <jfc@mit.edu>
-Mon Apr 20 20:44:25 1998 Jim Wilson <wilson@cygnus.com>
+ * dwarf2out.c (expand_builtin_dwarf_reg_size): Initialize
+ last_end to 0x7fffffff.
- * frame.c (heapsort): Rename to frame_heapsort.
+Fri Oct 2 19:14:20 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * gcc.c (do_spec_1, case '['): Move flag out of loop and initialize it.
+ * function.c (purge_addressof_1): Do not perform endianness
+ corrections on bitpos, who we call will do it for us.
-Mon Apr 20 12:43:09 1998 Doug Evans <devans@canuck.cygnus.com>
+Fri Oct 2 11:52:35 1998 Jeffrey A Law (law@cygnus.com)
- * flow.c (sbitmap_vector_alloc): Ensure sbitmaps properly aligned.
+ * h8300.c (WORD_REG_USED): Fix typo.
+ (initial_offset): Use WORD_REG_USED.
-Mon Apr 20 15:04:14 1998 John Wehle (john@feith.com)
+ * h8300.c (handle_pragma): Fix typo.
- * i386.md (movsf_push, movdf_push, movxf_push): Allow memory
- operands during and after reload.
+Fri Oct 2 10:51:35 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-Mon Apr 20 22:37:50 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * caller-save.c (insert_save_restore): Break this function up
+ into new functions insert_restore, insert_save and insert_one_insn.
+ All callers changed.
+ (insert_restore): New function, mostly broken out of
+ insert_save_restore.
+ (insert_save): Likewise.
+ (insert_one_insn): Likewise.
+ (restore_referenced_regs): New argument BLOCK. All callers changed.
+ (save_call_clobbered_regs): Don't keep track of basic block boundaries
+ in this function, do it in insert_one_insn instead.
+
+ * reload1.c (reload): Break out some more pieces into separate
+ functions.
+ (dump_needs): New function, broken out of reload.
+ (set_initial_elim_offsets): Likewise.
+ (init_elim_table): Likewise.
+ (update_eliminables): Likewise.
- * final.c (shorten_branches, init_insn_lengths): Move code
- to free label_align, uid_shuid, insn_lengths, insn_addresses
- and uid_align from the former function into the latter one;
- Add code to clear these variables.
- * sh.h (label_align): Remove declaration.
+ * global.c (global_alloc): Delete code to manage the scratch_list.
+ * local-alloc.c (qty_scratch_rtx): Delete.
+ (scratch_block): Delete.
+ (scratch_list): Delete.
+ (scratch_list_length): Delete.
+ (scratch_index): Delete.
+ (alloc_qty_for_scratch): Delete.
+ (local-alloc): Update initialization of max_qty.
+ Delete code to manage the scratch list.
+ Delete code to allocate/initialize qty_scratch_rtx.
+ (block_alloc): Don't allocate quantities for scratches.
+ Delete code to manage the scratch list.
+ * regs.h (scratch_list): Delete declaration.
+ (scratch_block): Delete declaration.
+ (scratch_list_length): Delete declaration.
+ * reload1.c (reload): Delete code to manage the scratch list.
+ (spill_hard_reg): Likewise.
+ (mark_scratch_live): Delete.
-Mon Apr 20 14:48:29 1998 Michael Meissner <meissner@cygnus.com>
+ * recog.c (alter_subreg): Delete declaration.
- * gcc.c (lang_specific_driver): Declare prototype properly so
- fatal can be passed to it without error.
+1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
- * configure.in (AC_CHECK_FUNCS): Check for strchr and strrchr.
- * configure: Regenerate.
- * config.in: Add #undef's for strchr and strrchr.
+ * Makefile.in (cccp.o): Fix typo in last patch.
- * protoize.c (toplevel): If we have rindex, but not strrchr, map
- rindex to strrchr.
- (file_could_be_converted): Use strrchr, not rindex since rindex is
- not defined on Linux systems when _POSIX_SOURCE is defined.
- (file_normally_convertible): Ditto.
- (process_aux_info_file): Ditto.
- (main): Ditto.
+Fri Oct 2 16:13:12 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * rs6000.md (mov{sf,df} define_splits): When splitting a move of
- a constant to an integer register, don't split the insns that do
- the simple AND and OR operations, rather just split each word, and
- let the normal movsi define split handle it further.
+ * t-sh (LIB1ASMFUNCS): Add _set_fpscr .
+ * config/sh/lib1funcs.asm (___set_fpscr): Add.
-Mon Apr 20 18:19:40 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+Fri Oct 2 02:01:59 1998 Jeffrey A Law (law@cygnus.com)
- * sh.c (find_barrier): Fix bug in ADDR_DIFF_VEC handling.
- (split_branches): Call init_insn_lengths.
+ * regclass.c (reg_scan_mark_refs): Return immediately if passed a
+ NULL_RTX as an argument.
-Mon Apr 20 07:37:49 1998 Michael Meissner <meissner@cygnus.com>
+ * Makefile.in (unlibsubdir): Define.
+ (DRIVER_DEFINES): Use unlibsubdir.
+ (cccp.o, cpplib.o, protoize.o, unprotoize.o): Similarly.
+ (stmp-fixinc): Similarly.
- * i386.c: Include expr.h to get the change_address prototype
- declared.
+Thu Oct 1 19:58:30 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-Mon Apr 20 01:00:05 1998 H.J. Lu (hjl@gnu.org)
+ * regmove.c (regmove_optimize): Add variable old_max_uid.
+ At the end of the function, update basic_block_end.
- * reg-stack.c (subst_asm_stack_regs): Change to return the last
- new insn generated by this function.
- (subst_stack_regs): Likewise.
- (convert_regs): Record the last newly generated insn and use
- it for change_stack () instead of INSN.
+Thu Oct 1 17:58:25 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Sun Apr 19 15:41:24 1998 Manfred Hollstein <manfred@s-direktnet.de>
+ * dwarf2out.c (expand_builtin_dwarf_reg_size): Use
+ FIRST_PSEUDO_REGISTER as upper bound for last_end, not an
+ arbitrary constant.
- * fix-header.c (enum special_file): Undefine enumerators if they
- are already defined by include files.
- * fixproto (rel_source_file in unistd.h stdlib.h): Prefix file protection
- macro with '__' to not pollute user namespace.
+Thu Oct 1 17:57:14 1998 Nick Clifton <nickc@cygnus.com>
-Sun Apr 19 02:42:06 1998 Richard Henderson <rth@cygnus.com>
+ * config/arm/arm.c: Improve interworking support.
- * haifa-sched.c (queue_to_ready): Fix typo in prototype.
+Thu Oct 1 18:43:35 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-Sat Apr 18 23:52:35 PDT 1998 Jeff Law (law@cygnus.com)
+ * reload1.c (choose_reload_regs): Fix test if reload_reg_rtx[r] was
+ copied from reload_out[r] .
- * version.c: Bump for snapshot.
+Thu Oct 1 19:20:09 1998 John Carr <jfc@mit.edu>
-Sat Apr 18 18:30:22 1998 Jim Wilson <wilson@cygnus.com>
+ * dwarf2out.c (expand_builtin_dwarf_reg_size): Fix to work
+ with more than three size ranges.
- * i386.md (fix_truncsfdi2+[123]): Add + to operand 1 constraints.
+ * flow.c (sbitmap_copy): Use bcopy to copy bitmap.
- * i386.h (CPP_CPU_DEFAULT): Renamed to CPP_CPU_DEFAULT_SPEC.
- Add missing -Dpentium* options.
- (CPP_CPU_SPEC): Delete redundant definition. Include cpp_cpu_default
- instead of CPP_CPU_DEFAULT.
- (EXTRA_SPECS): Add entry for cpp_cpu_default.
+ * rtl.c (mode_name): Add a null string at the end of the array.
+ (mode_wider_mode): Change type to unsigned char.
+ (mode_mask_array): New variable.
+ (init_rtl): Update for mode_wider_mode type change.
-Sat Apr 18 19:06:59 1998 David Edelsohn <edelsohn@mhpcc.edu>
+ * rtl.h (mode_wider_mode): Change type to unsigned char.
+ (mode_mask_array): Declare.
+ (GET_MODE_MASK): Use mode_mask_array.
- * rs6000.md (floatsidf2_loadaddr): rs6000_fpmem_offset will be
- negative in a stackless frame.
- * rs6000.c (rs6000_stack_info): Don't include fixed-size link area
- in stackless frame size. Support 64-bit stackless frame size.
- Combine fpmem offset calculations and don't add total_size to
- offset if not pushing a stack frame.
+Thu Oct 1 15:56:01 1998 Gavin Romig-Koch <gavin@cygnus.com>
-Sat Apr 18 15:41:16 1998 Jim Wilson <wilson@cygnus.com>
+ * calls.c (expand_call) : Encapsulate code into
+ copy_blkmode_from_reg.
+ * expr.c (copy_blkmode_from_reg): New function.
+ * expr.h (copy_blkmode_from_reg): New function.
+ * integrate.c (function_cannot_inline_p): We can inline
+ these now.
+ (expand_inline_function): Use copy_blkmode_from_reg
+ if needed. Avoid creating BLKmode REGs.
+ (copy_rtx_and_substitute): Don't try to SUBREG a BLKmode
+ object.
- * regmove.c (fixup_match_1): In three places, in flag_exceptions
- check, change p to q.
+Thu Oct 1 10:42:27 1998 Nick Clifton <nickc@cygnus.com>
-Sat Apr 18 15:30:49 1998 Jim Wilson <wilson@cygnus.com>
+ * config/v850/v850.c: Add function prototypes.
+ Add support for v850 special data areas.
- * gcc.c (lang_specific_driver): Add new parm type to prototype.
- (added_libraries): New file scope static variable.
- (process_command): Initialize added_libraries. Pass it to
- lang_specific_driver.
- (main): Use added_libraries in check for no input files.
+ * config/v850/v850.h: Add support for v850 special data areas.
+
+ * c-pragma.c: Add support for HANDLE_PRAGMA_PACK and
+ HANDLE_PRAGMA_PACK_PUSH_POP.
+ (push_alignment): New function: Cache an alignment requested
+ by a #pragma pack(push,<n>).
+ (pop_alignment): New function: Pop an alignment from the
+ alignment stack.
+ (insert_pack_attributes): New function: Generate __packed__
+ and __aligned__ attributes for new decls whilst a #pragma pack
+ is in effect.
+ (add_weak): New function: Cache a #pragma weak directive.
+ (handle_pragma_token): Document calling conventions. Add
+ support for #pragma pack(push,<n>) and #pragma pack (pop).
+
+ * c-pragma.h: If HANDLE_SYSV_PRAGMA or HANDLE_PRAGMA_PACK_PUSH_POP
+ are defined enable HANDLE_PRAGMA_PACK.
+ Move 'struct weak_syms' here (from varasm.c).
+ Add pragma states for push and pop pragmas.
+
+ * c-common.c (decl_attributes): Call PRAGMA_INSERT_ATTRIBUTES
+ if it is defined.
+
+ * c-lex.c: Replace occurances of HANDLE_SYSV_PRAGMA with
+ HANDLE_GENERIC_PRAGMAS.
+
+ * varasm.c: Move definition of 'struct weak_syms' into
+ c-pragma.h.
+ (handle_pragma_weak): Deleted.
-Sat Apr 18 01:23:11 1998 John Carr <jfc@mit.edu>
+ * config/i386/i386.h: Define HANDLE_PRAGMA_PACK_PUSH_POP.
- * sparc.c, sparc.h, sparc.md, sol2.h: Many changes related to V9
- code generation. Use 64 bit instructions in 32 bit mode when
- possible. Use V9 return instruction. UltraSPARC optimizations.
+ * config/winnt/win-nt.h: Define HANDLE_PRAGMA_PACK_PUSH_POP.
- * sparc.h: Change gen_rtx (CODE to gen_rtx_CODE (.
+ * c-decl.c (start_function): Add invocation of
+ SET_DEFAULT_DECL_ATTRIBUTES, if defined.
-Fri Apr 17 22:38:17 1998 Jeffrey A Law (law@cygnus.com)
+ * tm.texi: Remove description of non-existant macro
+ SET_DEFAULT_SECTION_NAME.
+
+ (HANDLE_SYSV_PRAGMA): Document.
+ (HANDLE_PRAGMA_PACK_PUSH_POP): Document.
- * global.c (global_alloc): Don't pass HARD_CONST (0) to find_reg,
- just pass zero. That will work regardless of the size of HARD_REG_SET.
+Wed Sep 30 22:27:53 1998 Robert Lipe <robertl@dgii.com>
- * libgcc2.c (__floatdisf): Fix a couple typos.
+ * config.sub: Recognize i[34567]86-pc-udk as new target.
+ * configure.in: Likewise.
+ * config/i386/t-udk: New file.
+ * config/i386/udk.h: New file.
-Fri Apr 17 17:28:26 1998 Jim Wilson <wilson@cygnus.com>
+Wed Sep 30 19:33:07 1998 Jeffrey A Law (law@cygnus.com)
- * Makefile.in (mostlyclean): Delete *.mach and *.bp files.
+ * reorg.c (check_annul_list_true_false): Remove unused variables.
+ (steal_delay_list_from_target): Add missing "used_annul" variable.
+ (try_merge_delay_insns): Close out half formed comment.
-Fri Apr 17 16:35:35 1998 Greg McGary <gkm@gnu.org>
+Wed Sep 30 19:13:20 1998 Zack Weinberg <zack@rabi.phys.columbia.edu>
- * emit-rtl.c (gen_highpart): initialize `word' properly for pseudo.
+ * cpplib.c (macroexpand): If arg->raw_before or
+ arg->raw_after, remove any no-reexpansion escape at the
+ beginning of the pasted token. Correct handling of whitespace
+ markers and no-reexpand markers at the end if arg->raw_after.
-Fri Apr 17 14:30:37 1998 John Carr <jfc@mit.edu>
+ * toplev.c (documented_lang_options): Recognize -include,
+ -imacros, -iwithprefix, -iwithprefixbefore.
+ * cpplib.c (cpp_start_read): Process -imacros and -include
+ switches at the same time and in command-line order, after
+ initializing the dependency-output code. Emit properly nested
+ #line directives for them. Emit a #line for the main file
+ before processing these switches, and don't do it again
+ afterward.
- * emit-rtl.c (operand_subword_force): If a register can not be
- accessed by words, copy it to a pseudo register.
+Wed Sep 30 18:03:22 1998 Richard Henderson <rth@cygnus.com>
-Fri Apr 17 14:30:37 1998 Jim Wilson <wilson@cygnus.com>
+ * function.c (purge_addressof_1): Use bitfield manipulation
+ routines to handle mem mode < reg mode.
- * rs6000/vxppc.h (CPP_SPEC): Add support for mrelocatable*.
+Wed Sep 30 18:43:32 1998 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
-Fri Apr 17 17:01:25 1998 Michael Meissner <meissner@cygnus.com>
+ * reorg.c (try_merge_delay_insns): Account for resources referenced
+ in each instruction in INSN's delay list before trying to eliminate
+ useless instructions. Similarly when looking at a trial insn's delay
+ slots.
- * tree.h (mark_seen_cases): Delete declaration.
+ * reorg.c (check_annul_list_true_false): New function.
+ (steal_delay_list_from_{target,fallthrough}): Call it and also
+ refine tests for when we may annul if already filled a slot.
+ (fill_slots_from_thread): Likewise.
+ (delete_from_delay_slot): Return newly-created thread.
+ (try_merge_delay_isns): Use its new return value.
-Fri Apr 17 13:32:20 1998 Jeffrey A Law (law@cygnus.com)
+Wed Sep 30 18:29:26 1998 Jeffrey A Law (law@cygnus.com)
- * stmt.c (mark_seen_cases): Make static and add prototype.
+ * loop.c (check_dbra_loop): Use a vanilla loop reversal if the biv is
+ used to compute a giv or as some other non-counting use.
-Fri Apr 17 11:21:43 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Wed Sep 30 18:19:27 1998 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
- * frame.c: Include stdlib.h and unistd.h to possibly get various
- function prototypes. The fixproto script guarantees these header
- files exist on the target system.
- * libgcc2.c: Likewise.
+ * regs.h (HARD_REGNO_CALL_PART_CLOBBERED): New macro.
+ * local-alloc.c (find_free_reg): Use it.
+ * global.c (find_reg): Likewise.
+ * tm.texi: Document HARD_REGNO_CALL_PART_CLOBBERED.
- * gthr-single.h (__gthread_mutex_lock, __gthread_mutex_trylock,
- __gthread_mutex_unlock): Add __attribute__ ((__unused__)) to the
- function parameters.
- * libgcc2.c (__udiv_w_sdiv): Likewise.
+ * regs.h (HARD_REGNO_CALLER_SAVE_MODE): New macro.
+ * caller-save.c (init_caller_save): Use it.
+ * tm.texi: Document HARD_REGNO_CALLER_SAVE_MODE.
-Thu Apr 16 22:41:02 1998 Jeffrey A Law (law@cygnus.com)
+Wed Sep 30 12:57:30 1998 Zack Weinberg <zack@rabi.phys.columbia.edu>
- * varasm.c (asm_output_bss): Add prototype.
- (asm_output_aligned_bss): Likewise.
+ * configure.in: Add --enable-cpplib option which uses cpplib
+ for cpp, but doesn't link cpplib into cc1. Make help text
+ capitalization consistent.
+ * configure: Rebuilt.
- * unroll.c (verify_addresses): Add prototype.
+Wed Sep 30 10:09:39 1998 Mark Mitchell <mark@markmitchell.com>
- * toplev.c: Add many prototypes. Too many to mention here.
+ * function.c (gen_mem_addressof): If the address REG is
+ REG_USERVAR_P make the new REG be so also.
+ * loop.c (scan_loop): Apply DeMorgan's laws and add documentation
+ in an attempt to clarify slightly.
- * stmt.c (check_seenlabel): Add prototype.
+Wed Sep 30 09:57:40 1998 Jeffrey A Law (law@cygnus.com)
- * rtlanal.c (reg_set_p_1): Add prototype.
- (reg_set_last_1): Likewise.
+ * expr.c (expand_expr): Handle COMPONENT_REF, BIT_FIELD_REF ARRAY_REF
+ and INDIRECT_REF in code to check MAX_INTEGER_COMPUTATION_MODE.
- * reorg.c (find_dead_or_set_registers): Add prototype.
+Wed Sep 30 10:13:39 1998 Catherine Moore <clm@cygnus.com>
- * regmove (try_auto_increment): Add prototype.
+ * toplev.c: Fix last patch.
- * reg-stack.c (pop_stack): Add prototype.
+Tue Sep 29 20:03:18 1998 Jim Wilson <wilson@cygnus.com>
- * recog.c (validate_replace_rtx_1): Add prototype.
- (find_cosntant_term_loc): Likewise.
+ * loop.c (get_condition): Fix typo in May 9 change.
- * loop.c (regs_patch_p): Add prototype.
- (add_label_notes, count_nonfixed_reads): Likewise.
- (find_single_use_in_loop): Likewise.
- (express_from): Surround prototype with #ifdef.
- (giv_sort): Similarly.
+Tue Sep 29 11:11:38 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
- * jump.c (mark_modified_reg): Add prototype.
+ * invoke.texi (-fexceptions): Merge 2 different descriptions.
- * haifa-sched.c (is_prisky): Add prototype.
- (queue_to_ready): Likewise.
+Mon Sep 28 22:08:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * genextract.c (gen_insn): Add prototype.
+ * toplev.c (documented_lang_options): Spelling corrections.
- * genemit.c (max_operand_1): Add prototype.
- (max_operand_vec, print_code, gen_exp, gen_insn): Likewise.
- (gen_expand, gen_explit, output_add_clobbers): Likewise.
- (output_init_mov_optab): Likewise.
+Mon Sep 28 19:41:24 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
- * genattrtab.c (attr_hash_add_rtx): Add prototype.
- (attr_hash_add_string, write_length_unit_log): Likewise.
+ * configure.in: new flags --with-ld and --with-as, equivalent
+ to setting LD and AS environment variables. Test whether
+ specified arguments are GNU commands, and report them with
+ checking messages. Use the specified AS for configure
+ tests too.
+ * configure: ditto
+ * acconfig.h: add DEFAULT_ASSEMBLER and DEFAULT_LINKER
+ * config.in: ditto
+ * gcc.c (find_a_file): when looking for `as' and `ld', return
+ the DEFAULT program if it exists
+ * collect2.c (main): use DEFAULT_LINKER if it exists
- * genattr.c (init_range): Add prototype.
+ * gcc.c (find_a_file): the test for existence of a full
+ pathname was reversed
- * combine.c (sets_function_arg_p): Add prototype.
+Mon Sep 28 17:34:35 1998 Michael Meissner <meissner@cygnus.com>
- * expr.c (store_constructor_field): Add prototype.
- (get_memory_usage_from_modifier): Likewise
+ * rs6000.h (ASM_OUTPUT_MI_THUNK): Only define on ELF systems.
+ * rs6000.c (output_mi_thunk): Always use a raw jump for now.
- * expmed.c (synth_mult): Add prototype.
- (choose_multiplier, invert_mod2n): Likewise.
+Mon Sep 28 14:24:03 1998 Mark Mitchell <mark@markmitchell.com>
- * except.c (push_eh_entry): Add prototype.
- (pop_eh_entry, enqueue_eh_entry, dequeu_eh_entry): Likewise.
- (call_get_eh_context, start_dynamic_cleanup): Likewise.
- (start_dynamic_handler, can_throw): Likewise.
- (output_exception_table_entry, scan_region): Likewise.
- (eh_regs, set_insn_eh_region): Likewise.
+ * tree.h (TYPE_BINFO): Document.
- * dwarfout.c (decl_class_context): Add prototype.
- (output_inheritance_die, type_ok_for_scope): Likewise.
+Mon Sep 28 12:55:49 1998 Stan Cox <scox@cygnus.com>
- * c-lex.c (skip_white_space_on_line): Add prototype.
+ * i386-coff.h (dbxcoff.h): Added.
- * alias.c (record_set): Add prototype.
- (find_base_term, base_alias_check): Likewise.
+Mon Sep 28 12:51:00 1998 Catherine Moore <clm@cygnus.com>
- * function.c (assign_outer_stack_local): Make static and add prototype.
+ * toplev.c: fix bad patch around flag_data_sections.
- * haifa-sched.c (build_control_flow): Accept raw data as inputs
- instead of computing it locally. Callers changed.
- (find_rgns): Several new arguments. Callers changed.
- Generally clean up and comment better. Use dominators to
- identify reducible loops. Convert some flag arrays to bitmaps.
- Convert most of the code to work on pred/succ lists instead of
- an edge table. Add comments for future improvements.
- (schedule_insns): Allocate temporary tables for flow data, call
- routines to compute flow data and pass it along to children as
- arguments.
- (debug_control_flow): Delete. Use dump_bb_data instead.
+Mon Sep 28 10:32:28 1998 Nick Clifton <nickc@cygnus.com>
- * basic-block.h (compute_dominators): Declare.
+ * reload1.c (reload): Use reload_address_index_reg_class and
+ reload_address_base_reg_class when setting
+ caller_save_spill_class. (Patch generated by Jim Wilson:
+ wilson@cygnus.com).
- * flow.c (dump_sbitmap, dump_sbitmap_vector): New debugging
- functions.
- * basic-block.h: Declare them.
+Mon Sep 28 07:43:34 1998 Mark Mitchell <mark@markmitchell.com>
-Thu Apr 16 13:45:51 1998 Jim Wilson <wilson@cygnus.com>
+ * c-common.c (c_get_alias_set): Tighten slightly for FUNCTION_TYPEs
+ and ARRAY_TYPEs. Tidy up. Improve support for type-punning.
+ * expr.c (store_field): Add alias_set parameter. Set the
+ MEM_ALIAS_SET accordingly, if the target is a MEM.
+ (expand_assignment): Use it.
+ (store_constructor_field): Pass 0.
+ (expand_expr): Likewise.
- * reg-stack.c (constrain_asm_operands): Set n_alternatives to zero if
- no operands.
+Mon Sep 28 07:54:03 1998 Catherine Moore <clm@cygnus.com>
+
+ * flags.h: Add flag_data_sections.
+ * toplev.c: Add option -fdata-sections. Add flag_data_sections.
+ (compile_file): Error if flag_data_sections not supported.
+ * varasm.c (assemble_variable): Handle flag_data_sections.
+ * config/svr4.h: Modify prefixes for UNIQUE_SECTION_NAME.
+ * config/mips/elf.h: Likewise.
+ * config/mips/elf64.h: Likewise.
+ * invoke.texi: Describe -fdata-sections.
+
+Mon Sep 28 04:15:44 1998 Craig Burley <burley@melange.gnu.org>
-Wed Apr 15 11:33:09 1998 Alexandre Petit-Bianco <apbianco@sendai.cygnus.com>
+ * invoke.texi (-ffloat-store): Clarify that this option
+ does not affect intermediate results -- only variables.
- * tree.c (build_expr_wfl): Use NULL_TREE if the file name is NULL.
- Propagate TREE_SIDE_EFFECTS and TREE_TYPE iff the encapsulated
- node is non NULL. Cache last file name and file name identifier node.
+Mon Sep 28 04:11:35 1998 Jeffrey A Law (law@cygnus.com)
-1998-04-15 Mark Mitchell <mmitchell@usa.net>
+ * cpp.texi: Update for Fortran usage from Craig.
- * c-common.c (declare_hidden_char_array): Use TYPE_DOMAIN to get
- the length of an array, not TREE_TYPE.
+Fri Sep 25 22:09:47 1998 David Edelsohn <edelsohn@mhpcc.edu>
-Wed Apr 15 15:31:34 1998 Jeffrey A Law (law@cygnus.com)
+ * rs6000.c (function_arg_boundary): Revert accidental change on
+ September 18.
- * flow.c (sbitmap_union_of_successors): New function.
- * basic-block.h (sbitmap_union_of_successors): Declare it.
+Fri Sep 25 20:30:00 1998 Michael Meissner <meissner@cygnus.com>
-Wed Apr 15 12:38:03 1998 Jim Wilson <wilson@cygnus.com>
+ * rs6000.h (ASM_OUTPUT_MI_THUNK): Declare, call output_mi_thunk.
+ (output_mi_thunk): Declare.
- * configure.in (gnu_ld): Rename to gnu_ld_flag before main loop.
- Set gnu_ld to gnu_ld_flag inside main loop.
- (gas): Likewise.
+ * rs6000.c (output_mi_thunk): Function to create thunks for MI.
+ (output_function_profiler): Use r12 for temp, instead of r11 so
+ that we preserve the static chain register.
+
+Fri Sep 25 14:18:33 1998 Jim Wilson <wilson@cygnus.com>
-Wed Apr 15 14:50:05 1998 Dave Brolley <brolley@cygnus.com>
+ * sdbout.c (sdbout_one_type): Don't look at TYPE_BINFO field of enums.
- * toplev.c (compile_file): Call init_parse using new interface.
- (init_lex): Remove declaration.
+Fri Sep 25 19:30:19 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * c-lex.c (init_parse): Now returns char* containing filename.
+ * sh.c (gen_shl_sext): Fix case 5.
-Wed Apr 15 12:37:10 1998 Jeffrey A Law (law@cygnus.com)
+Fri Sep 25 17:35:23 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Do nothing if not optimizing.
+ * reload1.c (reload_combine): Re-add line that got accidentally lost.
-Wed Apr 15 12:10:18 1998 Michael Meissner <meissner@cygnus.com>
+Fri Sep 25 10:43:47 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * Makefile.in (gen{config,flags,codes,emit}): Link in host print-rtl.o.
- (gen{extract,peep,opinit,output}): Ditto.
+ * cccp.c (pedwarn_with_file_and_line): For !__STDC__ case, avoid
+ accessing variables until they are initialized via va_arg().
- * gen{attr,codes,config,emit,output}.c (insn_attr_name): Provide a
- global definition so print-rtl.o can be linked in.
- * gen{peep,recog}.c (insn_attr_name): Ditto.
+Thu Sep 24 22:12:16 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Tue Apr 14 07:30:57 1998 K. Richard Pixley <rich@kyoto.noir.com>
+ * reload1.c (reload_combine): Initialize set before using.
- * fixincludes: discard empty C++ comments, as found in sys/time.h
- on hpux-11.0.
+Thu Sep 24 18:53:20 1998 Jason Merrill <jason@yorick.cygnus.com>
-Wed Apr 15 10:47:21 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * sdbout.c (sdbout_field_types): Don't emit the types of fields we
+ won't be emitting.
- * config/m68k/m68k.md (adddi3, subdi3): Optimize for constant
- operand.
+Thu Sep 24 17:05:30 1998 Nick Clifton <nickc@cygnus.com>
-Wed Apr 15 01:21:21 1998 Jeffrey A Law (law@cygnus.com)
+ * config/arm/arm.md (insv): Add comment. In CONST_INT case, and
+ operand3 with mask before using it. Patch provided by Jim Wilson.
- * emit-rtl.c (operand_subword): Rework slightly to avoid
- bogus warning from previous change.
+Thu Sep 24 15:08:08 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
-Tue Apr 14 23:39:13 1998 Richard Henderson <rth@cygnus.com>
+ * config/sparc/sparc.c (function_value): Perform the equivalent of
+ PROMOTE_MODE for ARCH64.
+ (eligible_for_epilogue_delay): Allow DImode operations in delay
+ slot of a return for ARCH64.
- * alpha.md: Revert Oct 27 change, as it is superceeded by Kenner's
- Nov 8 find_replacement change. Move decls of get_unaligned_address
- * alpha.h: ... here.
+Thu Sep 24 22:17:54 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-Tue Apr 14 22:00:39 1998 John Carr <jfc@mit.edu>
+ * sh.md (sqrtsf2): Fix mode of sqrt.
- * function.c (assign_parms): Initialize unsignedp before passing
- its pointer to promote_mode.
+Thu Sep 24 21:48:51 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * genattrtab.c (check_attr_test): Handle MATCH_INSN like MATCH_OPERAND.
- (write_test_expr): Allow MATCH_INSN.
+ * reload1.c (choose_reload_regs): Also try inheritance when
+ reload_in is a stack slot of a pseudo, even if we already got a
+ reload reg.
-Tue Apr 14 21:57:57 1998 Paul Eggert <eggert@twinsun.com>
+Thu Sep 24 21:22:39 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * install.texi: Update section on warnings that can be safely ignored.
+ * reload1.c (reload_cse_regs_1): Renamed from reload_cse_regs.
+ (reload_cse_regs): New function body: call reload_cse_regs_1,
+ reload_combine, reload_cse_move2add.
+ When doing expensive_optimizations, call reload_cse_regs_1 a
+ second time after reload_cse_move2add.
+ (reload_combine, reload_combine_note_store): New functions.
+ (reload_combine_note_use): New function.
+ (reload_cse_move2add, move2add_note_store): New functions.
-Tue Apr 14 14:55:16 1998 Jim Wilson <wilson@cygnus.com>
+Thu Sep 24 18:48:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * mips.md (reload_outdi): Change the scratch mode from DImode to
- TImode. New variable scratch, used instead of operand[2] in template.
- Add code for MIPS16 HILO_REGNUM case where output reg is not M16_REG_P.
+ * reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR
+ reloads to RELOAD_FOR_X_ADDRESS reloads, test for reload sharing.
-Tue Apr 14 16:19:03 1998 Michael Meissner <meissner@cygnus.com>
+ Properly keep track of first RELOAD_FOR_X_ADDRESS also for
+ more than 3 such reloads.
- * expr.c (MOVE_RATIO): Set to 3 if optimizing for space.
+ If there is not more than one RELOAD_FOR_X_ADDRESS, don't change
+ RELOAD_FOR_X_ADDR_ADDR reload.
-Tue Apr 14 11:31:28 1998 Krister Walfridsson <cato@df.lth.se>
+Thu Sep 24 17:45:55 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * i386/bsd386.h (ASM_OUTPUT_ALIGN): Redefine.
+ * expr.c (store_constructor): When initializing a field that is smaller
+ than a word, at the start of a word, try to widen it to a full word.
-Tue Apr 14 09:02:32 1998 Jeffrey A Law (law@cygnus.com)
+ * cse.c (cse_insn): When we are about to change a register,
+ remove any invalid references to it.
- * svr4.h (ASM_DECLARE_OBJECT_NAME): Use HOST_WIDE_INT_PRINT_DEC.
- (ASM_FINISH_DECLARE_OBJECT): Likewise.
+ (remove_invalid_subreg_refs): New function.
+ (mention_regs): Special treatment for SUBREGs.
+ (insert_regs): Don't strip SUBREG for call to mention_regs.
+ Check if reg_tick needs to be bumped up before that call.
+ (lookup_as_function): Try to match known word_mode constants when
+ looking for a norrower constant.
+ (canon_hash): Special treatment for SUBREGs.
- * Idea and part of the patch from HJ.
- * Makefile.in: auto-host.h renamed from auto-config.h. All references
- changed.
- (distclean): Remove auto-build.h too.
- * configure.in: Rename host autoconf generated file to auto-host.h.
- If host != build, then run autoconf to generate auto-build.h for
- the build machine and include it in build_xm_files.
- Check for wait.h and sys/wait.h.
+Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * combine.c (simplify_rtx, case TRUNCATE): Respect value of
- TRULY_NOOP_TRUNCATION.
+ * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define.
+ * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is
+ defined, emit libcall to __enable_execute_stack. Also fix opcodes
+ and offsets in actual stack trampoline code so they match the
+ commentary and actually work.
-Mon Apr 13 11:31:49 1998 Jason Merrill <jason@yorick.cygnus.com>
+Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
- * tree.h (BINFO_OFFSET_ZEROP): Use integer_zerop.
+ * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for
+ tmake_file.
+ (sparc64-*-linux): Use t-linux and sparc/t-linux64 for
+ tmake_file. Set extra_parts to needed crt objects.
+ * configure: Rebuilt.
+ * config/sparc/linux64.h (SPARC_BI_ARCH): Define.
+ (TARGET_DEFAULT): Set if default is v9 or ultra.
+ (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros.
+ (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH.
+ (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise.
+ (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC,
+ LINK_SPEC, LINK_ARCH_SPEC): Likewise.
+ (TARGET_VERSION): Define.
+ (MULTILIB_DEFAULT): Define.
+ * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that
+ mixed 32/64 bit compilers based upon SPARC_BI_ARCH work.
+ (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define
+ appropriately.
+ (TARGET_SWITCHES): Allow ptr32/ptr64 options once more.
+ * config/sparc/sparc.c (sparc_override_options): If arch and
+ pointer size disagree, emit diagnostic and fix it up. If
+ SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off
+ V8PLUS in 64-bit mode.
+ * config/sparc/t-linux64: New file.
+ * config/sparc/t-sol2-64: New file.
+ * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS.
+ * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define.
+ (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC,
+ CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define.
+ (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those.
+ (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC):
+ Define.
+ (STARTFILE_SPEC): Set approriately based upon those.
+ (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon
+ disposition of DEFAULT_ARCH32_P.
+ (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define.
+ (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those.
+ (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P.
+ (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH.
+ * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on
+ arch64/v9.
+ * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise.
+
+Wed Sep 23 22:32:31 1998 Mark Mitchell <mark@markmitchell.com>
-Sun Apr 12 20:55:32 1998 Catherine Moore <clm@cygnus.com>
+ * rtl.h (init_virtual_regs): New function.
+ * emit-rtl.c (init_virtual_regs): Define.
+ (insn_emit): Use it.
+ * integrate.c (save_for_inline_copying): Likewise.
- * invoke.texi (ld options) Include memset requirements
- for options -nodstdlib and -nodefaultlibs.
+Wed Sep 23 16:22:01 1998 Nick Clifton <nickc@cygnus.com>
-1998-04-12 Paul Eggert <eggert@twinsun.com>
+ * config/arm/thumb.h: The following patches were made by Jim Wilson:
+ (enum reg_class): Add NONARG_LO_REGS support.
+ (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS,
+ PREFERRED_RELOAD_CLASS, SECONDARY_RELOAD_CLASS): Likewise.
+ (GO_IF_LEGITIMATE_ADDRESS): Disable REG+REG addresses before reload
+ completes. Re-enable HImode REG+OFFSET addresses.
+ (LEGITIMIZE_RELOAD_ADDRESS): Define.
- This change is from an idea suggested by Arthur David Olson.
+ * expmed.c (extract_bit_field): Add comment from Jim Wilson.
- * c-common.c (decl_attributes, record_function_format,
- check_format_info, init_function_format_info):
- Add support for strftime format checking.
- (enum format_type): New type.
- (record_function_format): Now static, and takes value of type
- enum format_type instead of int.
- (time_char_table): New constant.
- (struct function_format_info): format_type member renamed from is_scan.
- (check_format_info): Use `warning' rather than sprintf followed by
- `warning', to avoid mishandling `%' in warnings.
- Change `pedwarn' to `warning', since these warnings do not necessarily
- mean the program does not conform to the C Standard, as the code
- need not be executed.
+Wed Sep 23 13:26:02 1998 Richard Henderson <rth@cygnus.com>
- * c-tree.h (record_function_format): Remove decl; no longer extern.
+ * alpha.c (get_aligned_mem): Revert Sep 20 change.
+ (alpha_set_memflags, alpha_set_memflags_1): Likewise.
+ (alpha_align_insns): Properly calculate initial offset wrt max_align.
- * extend.texi: Add documentation for strftime format checking.
+Wed Sep 23 10:45:44 1998 Richard Earnshaw (rearnsha@arm.com)
-Sun Apr 12 20:23:03 1998 Jeffrey A Law (law@cygnus.com)
+ * arm.c (find_barrier): Revert change of Apr 23. Handle table
+ jumps as a single entity, taking into account the size of the
+ table.
- * mips/ecoffl.h: Do not include mips.h.
- * mips/elf.h: Likewise.
+Tue Sep 22 15:13:34 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
- * configure.in (mips-*-ecoff): Do not mention mips/mips.h in tm_files.
- * mips/ecoff.h: Include "mips/mips.h".
+ * tree.def (SWITCH_EXPR): New tree node definition.
-Sat Apr 11 22:42:54 PDT 1998 Jeff Law (law@cygnus.com)
+Mon Sep 21 23:40:38 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sat Apr 11 01:24:28 1998 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (count_reg_usage): Correctly handle REG_NONNEG notes.
- (delete_trivially_dead_insns): Renamed from delete_dead_from_cse.
- * toplev.c (rest_of_compilation): Call delete_trivially_dead_insns instead of delete_dead_from_cse. Also call delete_trivially_dead_insns
- between loop optimization passes.
- * rtl.h: Updated appropriately.
-
-Fri Apr 10 22:28:32 1998 Jeffrey A Law (law@cygnus.com)
-
- Reinstall this patch from Jason.
- * function.c (push_function_context_to): Don't call init_emit.
-
-Fri Apr 10 13:40:20 1998 Nick Clifton <nickc@cygnus.com>
-
- * rtl.c (read_skip_spaces): Prevent infinite loops upon
- encountering unterminated comments.
-
-Fri Apr 10 10:43:41 1998 Jeffrey A Law (law@cygnus.com)
-
- * emit-rtl.c (operand_subword): Properly handle CONST_INTs for
- 64x32 cross builds.
-
- * configure.in: Handle --with-fast-fixincludes.
- (fixincludes): If --with-fast-fixincludes, then use a different
- fixincludes program by default.
- * Makefile.in (fixinc.sh): New rule.
-
-Fri Apr 10 00:36:31 1998 H.J. Lu (hjl@gnu.org)
-
- * i386.md (movqi+1): Handle invalid QI register.
- (movsf_push-1): Likewise.
-
-Thu Apr 9 16:53:59 1998 Nick Clifton <nickc@cygnus.com>
-
- * config/m32r/m32r.c: call_address_operand(): Only accept symbolic
- addresses.
- symbolic_memort_operand(), call32_operand(), int8_operand(),
- int16_operand(), uint24_operand(), reg_or_int8_operand(): Removed.
- Not used.
- uint16_operand(): Made static.
-
-Thu Apr 9 01:43:04 1998 Jeffrey A Law (law@cygnus.com)
-
- * calls.c (expand_call): Fix typo.
-
-Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
-
- * c-lex.c (finput): New global.
- (init_parse): Always included. Handle !USE_CPPLIB using
- code originally in compile_file.
- (finish_parse): Update for CPPLIB.
- * toplev.c (init_parse, finish_parse): Declare.
- (finput): Delete variable. Now in front-ends.
- (compile_file): Remove code which is now handled by init_parse
- which is unconditionally called. Similarly for finish_parse.
-
-Wed Apr 8 23:13:50 1998 Gavin Koch <gavin@cygnus.com>
-
- * config/mips/r3900.h (ASM_OUTPUT_DEF,SUPPORTS_WEAK,
- ASM_WEAKEN_LABEL): Add.
-
-Wed Apr 8 18:21:30 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha/crtbegin.asm, alpha/crtend.asm, alpha/t-crtb: New files.
- * configure.in (alpha-*-linux*): Use them.
-
-Fri Apr 3 17:02:13 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
-
- * tree.def (EXPR_WITH_FILE_LOCATION): New tree node definition.
- * tree.h (EXPR_WFL_{NODE,FILENAME,FILENAME_NODE,LINENO,
- COLNO,LINECOL,SET_LINECOL,EMIT_LINE_NOTE}): New macros.
- (build_expr_wfl): New prototype declaration.
- * tree.c (build_expr_wfl): New function, to build
- EXPR_WITH_FILE_LOCATION nodes.
- (copy_node): Don't zero TREE_CHAIN if copying a
- EXPR_WITH_FILE_LOCATION node.
- * print-tree.c (print_node): Handle EXPR_WITH_FILE_LOCATION.
- * expr.c (expand_expr): Handle EXPR_WITH_FILE_LOCATION.
-
-Wed Apr 8 12:51:19 1998 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (v850): Use t-v850.
- (ix86-wrs-vxworks): Recognize 786 just like other x86 configurations.
-
- * protoize.c (creat, read, write): Do not declare.
-
- * jump.c (mark_jump_label): Record REG_LABEL notes for insns which
- refer to the CODE_LABEL before a dispatch table.
-
- * invoke.texi: Add ARC options.
-
- * gcc.c (proces_command): Improve error message for -o with
- either -c or -S.
-
- * i386/x-cygwin32 (CLIB): Link in advapi32.
-
- * alpha.h (ASM_IDENTIFY_GCC): Define to nothing.
- (ASM_IDENTIFY_LANGUAGE): Likewise.
-
- * i386.md (movqi recognizer): Don't perfom byte increment into
- a NON_QI_REG_P.
-
- * configure.in (x86-dg-dgux): Run fixinc.dgux.
-
- * i370.h: Fix typo in GEN_INT changes.
-
- * bitmap.c (bitmap_element_allocate): Use "void" for arglist instead
- of an empty arglist in prototype.
-
- * Makefile.in: Remove bytecode crud that crept back in after the
- gcc2 merge.
-
-1998-04-08 Brendan Kehoe <brendan@cygnus.com>
-
- * c-lex.h (is_class_name): Fix arg type to be tree, not void.
- (make_pointer_declarator, reinit_parse_for_function): Fix typo.
-
-Wed Apr 8 06:16:45 1998 Richard Earnshaw (rearnsha@arm.com)
-
- * arm.h (LEGITIMIZE_RELOAD_ADDRESS): Define.
-
-Wed Apr 8 00:44:18 1998 Bernd Schmidt (crux@pool.informatik.rwth-aachen.de>
-
- * c-lex.c (is_class_name): Delete declaration.
- (whitespace_cr): Make static and add prototype.
- * c-lex.h (make_pointer_declarator, reinit_parse_for_function,
- yylex, get_directive_line): Turn declarations into prototypes.
- (position_after_whitespace, check_newline, yyerror,, is_class_name,
- forget_protocol_qualifiers, remember_protocol_qualifiers): Add
- prototypes.
- * genattr.c (extend_range, write_upcase, gen_attr, write_units): Add
- prototypes.
- * gencodes.c (gen_insn): Add prototype.
- * genconfig.c (walk_insn, gen_insn, gen_expand, gen_split,
- gen_peephole): Add prototypes.
- * genflags.c (num_operands, gen_proto, gen_nonproto, gen_insn): Add
- prototypes.
- * gengenrtl.c (type_from_format, accessor_from_format, special_rtx,
- special_format, find_formats, gendecl, genmacro, gendef, genlegend,
- genheader, gencode): Add prototypes.
- * genopinit.c (gen_insn): Add prototype.
- * genoutput.c (output_prologue, output_epilogue, scan_operands,
- process_template, validate_insn_alternatives, gen_insn, gen_peephole,
- gen_expand, gen_split, n_occurrences): Add prototypes.
- * genpeep.c (gen_peephole): Add prototype.
- * loop.c (find_and_verify_loops, mark_loop_jump, prescan_loop,
- reg_in_basic_block_p, consec_sets_invariant_p, libcall_other_reg,
- labels_in_range_p, count_loop_regs_set, note_addr_stored,
- loop_reg_used_before_p, scan_loop, replace_call_address,
- skip_consec_insns, libcall_benefit, ignore_some_movables,
- force_movables, combine_movables, rtx_equal_for_loop_p, move_movables,
- strength_reduce, valid_initial_value_p, find_mem_givs, record_biv,
- check_final_value, record_giv, update_giv_derive, basic_induction_var,
- simplify_giv_expr, general_induction_var, consec_sets_giv,
- check_dbra_loop, express_from, combine_givs_p, combine_givs,
- product_cheap_p, maybe_eliminate_biv, maybe_eliminate_biv_1,
- last_use_this_basic_block, record_initial, update_reg_last_use,
- iteration_info, analyze_loop_iterations, insert_bct,
- instrument_loop_bct, indirect_jump_in_function_p): Turn declarations
- into prototypes.
-
-Tue Apr 7 21:48:52 1998 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Define.
-
-1998-04-07 Ken Raeburn <raeburn@cygnus.com>
-
- * config/mips/mips.c (siginfo): Deleted.
- (override_options): Don't install SIGINFO signal handler.
-
-Tue Apr 7 11:58:04 1998 Jim Wilson <wilson@cygnus.com>
-
- * loop.c (check_dbra_loop): When normalize comparison_val, add check
- to verify it is non-negative.
-
-Tue Apr 7 02:01:47 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_expand_block_move): Correctly collect block offsets.
- (alpha_expand_block_clear): Likewise.
-
-Mon Apr 6 23:36:01 1998 Richard Henderson <rth@cygnus.com>
-
- * tree.h (sizetype_tab): Fix previous change for K&R.
-
-Mon Apr 6 22:23:29 PDT 1998 Jeff Law (law@cygnus.com)
+Mon Sep 21 22:31:14 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Mon Apr 6 23:16:10 1998 Richard Earnshaw (rearnsha@arm.com)
-
- * configure.in (sparc-*-solaris2*): Add xm-siglist.h to xm_file.
- Add USG and POSIX to xm_defines.
-
-Mon Apr 6 21:49:57 1998 Bob Manson <manson@charmed.cygnus.com>
-
- * gcc.c: Add linker spec.
- (link_command_spec): Use %(linker) instead of ld.
- (main): If collect2 is requested as the linker, see if it exists;
- if not, use ld instead.
-
- * Makefile.in (USE_COLLECT2): It's named collect2 now, not ld.
- (ld:) Deleted.
- (install-collect2): Install as collect2, not ld.
-
- * configure.in(will_use_collect2): It's named collect2 now.
-
- * collect2: Remove checks to see if we were invoked recursively.
- (collect_execute): Use _spawnvp under cygwin32.
-
-Mon Apr 6 17:23:41 1998 Jim Wilson <wilson@cygnus.com>
-
- * haifa-sched.c (build_control_flow): Set unreachable for block whose
- only predecessor is itself.
-
-Mon Apr 6 16:08:04 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-parse.in: Include system.h, and remove stuff now made redundant.
- * cccp.c: Likewise.
- * cexp.y: Likewise.
- * protoize.c: Likewise. Properly check for cpp stringification.
-
- * Makefile.in (c-parse.o, cccp.o, cexp.o, protoize.o, unprotoize.o):
- Depend on system.h.
+Mon Sep 21 22:48:09 1998 Jeffrey A Law (law@cygnus.com)
- * objc/Make-lang.in (objc-parse.o): Likewise.
+ * configure.in: Recognize i[34567]86-*-openbsd* and handle it like
+ NetBSD.
-Mon Apr 6 14:59:58 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Mon Sep 21 22:05:28 1998 Jeffrey A Law (law@cygnus.com)
- * gansidecl.h: Check if compiler supports __attribute__. Provide
- definitions for ATTRIBUTE_UNUSED and ATTRIBUTE_PRINTF using
- __attribute__ when its available. Also provide definitions for
- ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2 and ATTRIBUTE_PRINTF_3 in
- terms of ATTRIBUTE_PRINTF.
+ * Revert this patch.
+ * reload.c (find_reloads): Do not replace a pseudo with
+ (MEM (reg_equiv_addr)) in the initializing insn for the
+ pseudo.
- * genoutput.c (process_template): Use ATTRIBUTE_UNUSED in place
- of __attribute__.
+Mon Sep 21 20:19:41 1998 John Carr <jfc@mit.edu>
-Mon Apr 6 07:17:52 1998 Catherine Moore <clm@cygnus.com>
+ * final.c (final_scan_insn): Disable tracking CC across branches.
- * combine.c (can_combine_p): Include successor in volatile test.
+Mon Sep 21 17:15:26 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
-Mon Apr 6 14:16:33 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * expr.h (eh_rtime_match_libfunc): New extern declaration.
+ * optabs.c (init_optabs): Set eh_rtime_match_libfunc.
+ * except.c (start_catch_handler): Use eh_rtime_match_libfunc.
+ * libgcc2.c (__eh_rtime_match): Always return 0 if the matcher is
+ NULL. Only include <stdio.h> if inhibit_libc is not defined.
- * sh.h (CASE_VECTOR_SHORTEN_MODE): Fix logic when to set
- offset_unsigned.
+Mon Sep 21 14:10:51 1998 Jason Merrill <jason@yorick.cygnus.com>
-Mon Apr 6 02:03:29 1998 Jeffrey A Law (law@cygnus.com)
+ * toplev.c (rest_of_compilation): Skip compiling anything with
+ DECL_EXTERNAL set, not just if it has DECL_INLINE as well.
- * objc/objc-act.c (encode_aggregate_within): Avoid GNU extensions
- in prototype and definition.
+Mon Sep 21 13:51:05 1998 Jim Wilson <wilson@cygnus.com>
-Mon Apr 6 00:48:56 PDT 1998 Jeff Law (law@cygnus.com)
+ * flow.c (find_basic_blocks): Delete check for in_libcall_block when
+ prev_code is a CALL_INSN. Change check for REG_RETVAL note to
+ use in_libcall_block.
+ (find_basic_blocks_1): Delete check for in_libcall_block when prev_code
+ is a CALL_INSN. If CALL_INSN and in_libcall_block, then change code
+ to INSN.
- * version.c: Bump for snapshot.
-
-Mon Apr 6 00:08:50 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_expand_block_clear): Add missing offset arg to
- alpha_expand_unaligned_store_words.
-
-Sun Apr 5 21:31:24 1998 John Wehle (john@feith.com)
+Mon Sep 21 14:02:23 1998
- * i386.md (movsf_push, movsf_mem): Remove.
- (movsf_push): Rename from movsf_push_nomove and move in front of
- movsf. Use nonmemory_operand predicate and don't bother checking
- TARGET_MOVE.
- (movsf_push_memory): New pattern.
- (movsf): Don't bother checking for push_operand. If TARGET_MOVE and
- both operands refer to memory then force operand[1] into a register.
- (movsf_normal): Change to unnamed pattern.
- Likewise for movdf, movxf, and friends.
+ * i386.h: (TARGET_SWITCHES) Improve doc for align-double. Fix
+ typo in no-fancy-math-387 description.
-Sun Apr 5 18:45:51 PDT 1998 Jeff Law (law@cygnus.com)
+Mon Sep 21 09:27:18 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sun Apr 5 16:31:10 1998 Richard Henderson <rth@cygnus.com>
+Mon Sep 21 09:24:49 1998 Stan Cox <scox@cygnus.com>
- * configure.in (alpha-dec-osf*): Match osf1.3 correctly.
+ * i386-coff.h (DBX_DEBUGGING_INFO): Added.
-Sun Apr 5 16:53:37 1998 Don Bowman <don@pixsci.com>
+Mon Sep 21 09:14:49 1998 Robert Lipe <robertl@dgii.com>
- * configure.in (mips-wrs-vxworks): New target.
+ * i386.h: (TARGET_SWITCHES) Add description fields for flags
+ documented in install.texi.
+ (TARGET_OPTIONS) Likewise.
-Sat Apr 4 23:34:32 PST 1998 Jeff Law (law@cygnus.com)
-
- * expmed.c (synth_mult): The value -1, has no zeros, so it can
- never have the form ...011.
+Mon Sep 21 01:39:03 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sat Apr 4 20:16:46 1998 Richard Henderson <rth@cygnus.com>
-
- * i386.c (asm_output_function_prefix, load_pic_register):
- Use ASM_GENERATE_INTERNAL_LABEL properly.
- (output_pic_addr_const): Recognize %X to supress any PIC sym suffix.
- (print_operand): Ignore it.
- (load_pic_register): Use it for the got load call.
- * i386.md (prologue_set_got, prologue_get_pc): Likewise.
- (prologue_get_pc_and_set_got): Likewise.
- * i386.h: Update print_operand docs.
-
-Sat Apr 4 19:08:37 1998 Richard Henderson <rth@cygnus.com>
-
- * i386.md (ffssi, ffshi): Rewrite as define_expands.
- (ffssi_1, ffshi_1): New (unspec [] 5) support patterns.
- * i386.c (notice_update_cc): Recognize unspec 5.
-
-Sat Apr 4 18:07:16 1998 David Mosberger-Tang (davidm@mostang.com)
-
- * alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Accept '(' for s/sv/svi.
- * alpha.c (print_operand): Handle it.
- * alpha.md (fix_truncsfdi2): Use it. Add earlyclobber pattern
- for ALPHA_TP_INSN.
- (fix_truncdfdi2): Likewise.
-
-Sat Apr 4 17:42:05 1998 Richard Henderson <rth@cygnus.com>
-
- * tree.h (sizetype_tab[2], sbitsizetype, ubitsizetype): Merge all
- of these into a single struct, with additional [us]sizetype entries.
- * stor-layout.c (set_sizetype): Initialize [us]sizetype.
- * fold-const.c (size_int_wide): Don't rely on sizetype_tab being
- an array.
-
-Sat Apr 4 17:04:41 1998 Richard Henderson <rth@cygnus.com>
+Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
- * configure.in (alpha-*-linux-*): Undo tm_file changes from gcc2 merge.
+ * c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
+ * cccp.c (main): Likewise.
-Sat Apr 4 13:50:01 1998 Richard Henderson <rth@cygnus.com>
+ * cccp.c, collect2.c, cpplib.c, gcc.c, config/i386/xm-cygwin32.h:
+ Rename GET_ENVIRONMENT to GET_ENV_PATH_LIST, and fix some
+ macro-use bugs.
- * haifa-sched.c (split_block_insns): Don't supress insn splitting
- on subsequent passes.
+Mon Sep 21 00:52:12 1998 Per Bothner <bothner@cygnus.com>
- * alpha.c (hard_fp_register_operand): New function.
- * alpha.h (PREDICATE_CODES): Add it.
- * alpha.md (extendsidi2): Kill bogus f<-f cvtql+cvtlq case. Add an
- f<-m case and accompanying define_split.
- (trapb): Use a unique unspec_volatile number.
+ * Makefile.in (LIBS): Link in libiberty.a.
+ * c-common.c, gcc.c, toplev.c: Replace (some) bcopy calls by memcpy.
-Sat Apr 4 13:32:08 1998 Richard Henderson <rth@cygnus.com>
+Sun Sep 20 23:28:11 1998 Richard Henderson <rth@cygnus.com>
- * configure.in (alpha-*-linux-gnu*): Undo Feb 3 change brought in
- from gcc2 merge.
+ * reload1.c (emit_reload_insns): Accept a new arg for the bb. Use
+ it to update bb boundaries. Update caller.
+ * function.c (reposition_prologue_and_epilogue_notes): Update
+ bb boundaries wrt the moved note.
-Sat Apr 4 10:23:41 1998 Jeffrey A Law (law@cygnus.com)
-
- * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
- for details.
-
- * haifa-sched.c: Mirror recent changes from gcc2.
-
-Fri Apr 3 00:17:01 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (insn*.o): Depend on system.h.
-
- * pa.c (output_global_address): Initialize base.
- * pa.h (GO_IF_LEGITIMATE_ADDRESS): Initialize index.
-
-1998-04-03 Mike Stump <mrs@wrs.com>
-
- * gthr.h: Support systems that don't have weak, but have threads.
- * configure.in (*wrs-vxworks*): Use VxWorks threads by default.
- * gthr-vxworks.h: New file.
- * objc/thr-vxworks.h: Dummy file from thr-single.c for now.
+Sun Sep 20 20:57:02 1998 Robert Lipe <robertl@dgii.com>
+
+ * configure.in (i*86-*-sysv5*): Use fixinc.svr4 to patch byteorder
+ problems.
+ * configure: Regenerate.
-Thu Apr 2 18:00:52 1998 Jim Wilson <wilson@cygnus.com>
+Sun Sep 20 19:01:51 1998 Richard Henderson <rth@cygnus.com>
- * i386.md (movqi+1): Change alternative 1 from *r/r to *r/*rn.
+ * alpha.c (alpha_sr_alias_set): New variable.
+ (override_options): Set it.
+ (alpha_expand_prologue, alpha_expand_epilogue): Use it.
+ (mode_mask_operand): Fix signed-unsigned comparision warning.
+ (alpha_expand_block_move): Likewise.
+ (print_operand): Likewise.
+ (get_aligned_mem): Use change_address.
+ (alpha_set_memflags, alpha_set_memflags_1): Set the alias set.
+ (alphaev4_insn_pipe, alphaev4_next_group): New functions.
+ (alphaev4_next_nop, alphaev5_next_nop): New functions.
+ (alpha_align_insns): Remade from old alphaev5_align_insns
+ to handle multiple processors.
+ (alpha_reorg): Call alpha_align_insns for both ev4 and ev5.
+ * output.h (label_to_alignment): Prototype.
+
+ * tree.c (new_alias_set): New function.
+ * tree.h (new_alias_set): Declare it.
+ * c-common.c (c_get_alias_set): Use it.
+
+Sun Sep 20 12:35:55 1998 Richard Henderson <rth@cygnus.com>
+
+ * fold-const.c (fold): Yet another COND_EXPR bug: when folding
+ to an ABS expr, convert an unsigned input to signed.
+
+Sun Sep 20 12:14:45 1998 Jeffrey A Law (law@cygnus.com)
-1998-04-02 Vladimir N. Makarov <vmakarov@cygnus.com>
+ * fold-const.c (fold): Fix another type in COND_EXPR handling code.
- * ginclude/va-i960.h (va_end): Change void * to void.
+1998-09-20 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
-Thu Apr 2 13:51:10 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * configure.in: Add support for c4x targets.
+ * configure: Rebuilt.
- * Makefile.in (choose-temp.o): Depend on system.h.
+Sun Sep 20 00:00:51 1998 Richard Henderson <rth@cygnus.com>
- * choose-temp.c: Include system.h when IN_GCC.
+ * combine.c (distribute_notes): If an insn is a cc0 user, only
+ delete it if we can also delete the cc0 setter.
-Thu Apr 2 02:37:07 1998 Joern Rennecke (amylaar@cygnus.co.uk)
- Richard Henderson <rth@cygnus.com>
+Sun Sep 20 00:22:23 1998 Michael Tiemann <michael@impact.tiemann.org>
- * reload.c (find_reloads_address): Try LEGITIMIZE_RELOAD_ADDRESS.
- (move_replacements): New function.
- * reload.h: Prototype it.
+ * fold-const.c (fold): Fix typo in COND_EXPR handling code.
+ (invert_truthvalue): Enable truthvalue inversion for
+ floating-point operands if -ffast-math.
- * alpha.h (LEGITIMIZE_RELOAD_ADDRESS): New definition.
+Sat Sep 19 23:58:07 1998 Melissa O'Neill <oneill@cs.sfu.ca>
+
+ * configure.in: Disable collect2 for nextstep. Instead use
+ crtbegin/crtend.
+ * configure: Rebuilt.
+ * config/nextstep.h (STARTFILE_SPEC): Add crtbegin.
+ (ENDFILE_SPEC): Define.
+ (OBJECT_FORMAT_MACHO): Define.
+ (EH_FRAME_SECTION_ASM_OP): Define.
+ * crtstuff.c: Handle MACHO.
-Thu Apr 2 01:01:34 1998 Richard Henderson <rth@cygnus.com>
+Sun Sep 20 00:24:24 1998 Robert Lipe <robertl@dgii.com>
- * configure (alpha-*-linuxecoff, alpha-*-linux-gnulibc1):
- Run fixincludes.
+ * config/i386/sco5.h (TARGET_MEM_FUNCTIONS): Define.
- * emit-rtl.c (gen_lowpart_common): Skip count by HARD_REGNO_NREGS.
- (gen_highpart): Likewise.
- * final.c (alter_subreg): Allow the target to hook by-mode subreg
- hard register number changes.
+1998-09-19 Torbjorn Granlund <tege@matematik.su.se>
-Wed Apr 1 22:26:22 1998 Jeffrey A Law (law@cygnus.com)
+ * fp-bit.c (pack_d): Do not clear SIGN when fraction is 0.
+ (_fpadd_parts): Get sign right for 0.
- * fold-const.c optimze_bit_field_compare): Initialize rnbitpos,
- rnbitsize, rnmode and rinner.
- (make_range): Initialize type.
- (fold): Initialize arg0, arg1 and varop.
+1998-09-19 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
- * function.c (instantiate_virtual_regs_1): Initialize offset, regnoi
- and regnor.
- (expand_function_start): Initialize last_ptr.
+ * ginclude/varargs.h: Add support for C4x target.
+ * ginclude/stdargs.h: Likewise.
- * stor-layout.c (layout_record): Initialize desired_align.
- (get_best_mode): Initialize unit.
+Sat Sep 19 12:05:09 1998 Richard Henderson <rth@cygnus.com>
- * tree.c (copy_node): Initialize length.
+ * alpha.c (alpha_return_addr): SET should be VOIDmode.
+ (alpha_emit_set_long_const): Rewrite to be callable from reload
+ and 32-bit hosts.
+ (alpha_expand_epilogue): Update for alpha_emit_set_long_const.
+ * alpha.md (movdi): Likewise.
- * c-lex.c (yylex): Initialize traditional_type, ansi_type and type.
+Sat Sep 19 07:33:36 1998 Richard Earnshaw (rearnsha@arm.com)
- * caller-save.c (insert_save_restore): Initialize pat, code and
- numregs.
+ * arm.c (add_constant): New parameter address_only, change caller.
+ Set it non-zero if taking the address of an item in the pool.
+ (arm_reorg): Handle cases where we need the address of an item in
+ the pool.
- * emit-rtl.c (push_to_sequence): Initialize top.
- (push_topmost_sequence): Likewise.
+ * arm.c (bad_signed_byte_operand): Check both arms of a sum in
+ a memory address.
+ * arm.md (splits for *extendqihi_insn and *extendqisi_insn): Handle
+ memory addresses that are not in standard canonical form.
- * genattrtab.c (simplify_by_exploding): Initialize defval.
+Sat Sep 19 01:00:32 1998 Michael Hayes (mph@elec.canterbury.ac.nz)
- * profile.c (branch_prob): Initialize dest.
+ * README.C4X: New file with information about the c4x ports.
+ * ginclude/va-c4x.h: New file for c4x varargs support.
+ * config/c4x: New directory with c4x port files.
- * rtl.h (note_stores): Remove duplicate prototype.
- (GEN_INT): Re-instate cast of second arg to HOST_WIDE_INT.
+Fri Sep 18 22:52:05 1998 Jeffrey A Law (law@cygnus.com)
- * cplus-dem.c (gnu_special): Don't get confused by .<digits>
- strings that are not actually lengths.
+ * reload.c (find_reloads): Do not replace a pseudo with
+ (MEM (reg_equiv_addr)) in the initializing insn for the
+ pseudo.
- * genattrtab.c: Make generated file use system.h, instead of
- including stdio.h, etc directly.
- * genextract.c, genopinit.c, genoutput.c: Likewise.
- * genpeep.c, genrecog.c: Likewise
+Fri Sep 18 23:50:56 1998 David Edelsohn <edelsohn@mhpcc.edu>
- * genoutput.c (process_template): Mark operands in the generated
- function as potentially unused if compiling with GNU CC.
+ * toplev.c (rest_of_compilation): Set bct_p on second call to
+ loop_optimize.
+ * loop.c (loop_optimize, scan_loop, strength_reduce): New argument
+ bct_p.
+ (strength_reduce): Only call analyze_loop_iterations and
+ insert_bct if bct_p set.
+ (check_dbra_loop): Fix typo.
+ (insert_bct): Use word_mode instead of SImode.
+ (instrument_loop_bct): Likewise. Do not delete iteration count
+ condition code generation insn. Initialize iteration count before
+ loop start.
+ * rtl.h (loop_optimize): Update prototype.
- * i386/freebsd-elf.h (CPP_PREDEFINES): Update from FreeBSD folks.
+ * ginclude/va-ppc.h (va_arg): longlong types in overflow area are
+ not doubleword aligned.
- * pa.md (reload peepholes): Remove unused variable "mode".
+ * rs6000.c (optimization_options): New function.
+ (secondary_reload_class): Only call true_regnum for PSEUDO_REGs.
+ * rs6000.h (OPTIMIZATION_OPTIONS): Define.
+ (REG_ALLOC_ORDER): Allocate highest numbered condition regsiters
+ first; cr1 can be used for FP record condition insns.
-Wed Apr 1 17:06:19 1998 Nick Clifton <nickc@cygnus.com>
+Fri Sep 18 09:44:55 1998 Nick Clifton <nickc@cygnus.com>
- * config/arm/thumb.h: Add super interworking support.
- * config/arm/thumb.c: Add super interworking support.
- * config/arm/thumb.md: Add super interworking support.
- * config/arm/lib1funcs.asm: Add interworking support.
- * config/arm/lib1thumb.asm: Add super interworking support.
- * config/arm/t-semi: Add interworking support.
- * config/arm/t-thumb: Add interworking support.
- * config/arm/README-interworking: New file.
+ * config/m32r/m32r.h (m32r_block_immediate_operand): Add to
+ PREDICATE_CODES.
-Wed Apr 1 14:38:10 1998 Jim Wilson <wilson@cygnus.com>
+ * config/m32r/m32r.md: Add "movstrsi" and "movstrsi_internal"
+ patterns.
- * config/mips/iris6.h (MD_EXEC_PREFIX): Set to /usr/bin/.
- (MD_STARTFILE_PREFIX): Unset.
+ * config/m32r/m32r.c (m32r_print_operand): Add 's' and 'p'
+ operators.
+ (block_move_call): New function: Call a library routine to copy a
+ block of memory.
+ (m32r_expand_block_move): New function: Expand a "movstrsi"
+ pattern into a sequence of insns.
+ (m32r_output_block_move): New function: Expand a
+ "movstrsi_internal" pattern into a sequence of assembler opcodes.
+ (m32r_block_immediate_operand): New function: Return true if the
+ RTL is an integer constant, less than or equal to MAX_MOVE_BYTES.
+
+Thu Sep 17 16:42:16 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
-1998-04-01 Mark Mitchell <mmitchell@usa.net>
+ * except.c (start_catch_handler): Issue 'fatal' instead of 'error' and
+ re-align some code.
+ * libgcc2.c (__eh_rtime_match): fprintf a runtime error. Use <stdio.h>.
- * varasm.c (make_decl_rtl): Update the DECL_ASSEMBLER_NAME for a
- entity in a local scope.
+Thu Sep 17 12:24:33 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * fold-const.c (fold): Call truthvalue_conversion for values which
- are folded to boolean type.
+ * regmove.c (copy_src_to_dest): Check that modes match.
-Wed Apr 1 06:09:53 1998 Jeffrey A Law (law@cygnus.com)
+Wed Sep 16 22:10:42 1998 Robert Lipe <robertl@dgii.com>
- * 1750a.md, arm.c, clipper.c, clipper.md: Use GEN_INT consistently.
- * convex.h, dsp16xx.c, fx80.md, gmicro.c, gmicro.md: Likewise.
- * i370.h, i370.md, i860.c, i860.h, i860.md, i960.c: Likewise.
- * i960.h, i960.md, m32r.md, m68k.md, m68kv4.h, m88k.c: Likewise.
- * m88k.md, ns32k.c, ns32k.md, pdp11.c, pdp11.h, pdp11.md: Likewise.
- * pyr.c, pyr.h, pyr.md, romp.c, romp.h, romp.md: Likewise.
- * rs6000.md, sparc.c, sparc.h, sparc.md, spur.c, spur.md: Likewise.
- * tahoe.md, vax.h, vax.md, we32k.c, we32k.h, we32k.md: Likewise.
- * md.texi: Likewise.
+ * config/i386/sco5.h (SUPPORTS_WEAK): True only if targeting ELF.
-Wed Apr 1 08:33:44 1998 Manfred Hollstein <manfred@s-direktnet.de>
+Wed Sep 16 15:24:54 1998 Richard Henderson <rth@cygnus.com>
- * fixincludes (limits.h): Fix nested comments in Motorola's
- limits.h and sys/limits.h.
+ * i386.h (PREFERRED_RELOAD_CLASS): Respect an existing class
+ narrower than FLOAT_REGS.
-Tue Mar 31 16:57:33 1998 Jim Wilson <wilson@cygnus.com>
+Wed Sep 16 17:51:00 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
- * alpha.c (alpha_expand_unaligned_load): Use tgt instead of addr
- as dest of expand_binop call.
+ * cpplib.c: removed OLD_GPLUSPLUS_INCLUDE_DIR
+ * cccp.c: ditto
+ * Makefile.in (old_gxx_include_dir): removed
- * alpha.md (extzv): Correct check for valid operand[2] values.
+Wed Sep 16 12:29:22 1998 Nick Clifton <nickc@cygnus.com>
- * profile.c (branch_prob): Add code to recognize HPPA tablejump entry
- branch.
+ * config/sh/sh.h: Update definition of HANDLE_PRAGMA to match
+ new specification.
- * toplev.c (rest_of__compilation): Call init_recog_no_volatile at end.
+ * config/sh/sh.c (handle_pragma): Rename to sh_handle_pragma().
+ (sh_handle_pragma): Change function arguments to match new
+ specification for HANDLE_PRAGMA.
-Mon Mar 30 13:11:05 1998 Stan Cox <scox@cygnus.com>
+Wed Sep 16 12:43:19 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * libgcc2.c: (__main, __do_global_dtors, __do_global_ctors):
- For __CYGWIN32__ use the versions in winsup/dcrt0.cc.
+ * gen-protos.c (parse_fn_proto): Cast argument of ISALNUM to
+ `unsigned char'.
+ (main): Mark parameter `argc' with ATTRIBUTE_UNUSED.
+ When generating output, initialize missing struct member to zero.
- * gcc.c, cccp.c, cpplib.c, collect2.c (GET_ENVIRONMENT): Added.
- cygwin32 can override this to allow both unix and win32 style PATHs.
+Wed Sep 16 14:47:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * i386/xm-cygwin32.h (GET_ENVIRONMENT): Defined to allow win32
- style environment paths.
+ * regmove.c (copy_src_to_dest): Don't copy if that requires
+ (a) new register(s).
-Mon Mar 30 14:43:20 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Wed Sep 16 01:29:12 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
- * Makefile.in (cppalloc.o, cpperror.o, cppexp.o, cpphash.o,
- cpplib.o, cppmain.o, fix-header.o, gcov.o, gen-protos.o,
- gengenrtl.o, halfpic.o, hash.o, scan-decls.o, scan.o): Depend on
- system.h.
+ * global.c (reg_allocno): Now static.
+ * reload1.c (reg_allocno): Delete declaration.
+ (order_regs_for_reload): Take no arguments. Don't treat regs
+ allocated by global differently than those allocated by local-alloc.
- * cpphash.c: Include config.h.
- * cppalloc.c: Include system.h. Add parameters to various
- function prototypes.
- * cpperror.c: Likewise.
- * cppexp.c: Likewise.
- * cpphash.c: Likewise.
- * cpplib.c: Likewise.
- * cppmain.c: Likewise.
- * fix-header.c: Likewise.
- * gcov.c: Likewise.
- * gen-protos.c: Likewise.
- * gengenrtl.c: Likewise.
- * halfpic.c: Likewise.
- * hash.c: Likewise.
- * scan-decls.c: Likewise.
- * scan.c: Likewise.
+Wed Sep 16 01:09:01 1998 Kamil Iskra <iskra@student.uci.agh.edu.pl>
-Mon Mar 30 11:06:45 1998 Jim Wilson <wilson@cygnus.com>
+ * m68k/m68k.c (output_function_prologue): Reverse NO_ADDSUB_Q
+ condition, fix format strings.
+ (output_function_epilogue): Likewise.
- * README.gnat: Add lang_print_xnode definition.
+ * m68k/m68k.c: Don't include <stdlib.h> directly.
-Mon Mar 30 11:12:24 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+Wed Sep 16 00:30:56 1998 Geoff Keating <geoffk@ozemail.com.au>
- * config/m68k/m68k.c (standard_68881_constant_p): Don't use
- fmovecr on the 68060.
+ * gcse.c: New definition NEVER_SET for reg_first_set, reg_last_set,
+ mem_first_set, mem_last_set; because 0 can be a CUID.
+ (oprs_unchanged_p): Use new definition.
+ (record_last_reg_set_info): Likewise.
+ (record_last_mem_set_info): Likewise.
+ (compute_hash_table): Likewise.
-Mon Mar 30 00:21:03 1998 Jeffrey A Law (law@cygnus.com)
+Tue Sep 15 22:59:52 1998 Jeffrey A Law (law@cygnus.com)
- * genemit.c (DONE): Rework so that it works in the true arm if
- an if-else conditional.
- (FAIL): Likewise.
+ * rs6000.c (output_epilogue): Handle Chill.
-Sun Mar 29 12:45:23 1998 Jeffrey A Law (law@cygnus.com)
+ * mn10200.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Define.
+ * mn10300.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Define.
- * rs6000.c: Do not include stdioh or ctype.h anymore.
+ * combine.c (make_extraction): If no mode is specified for
+ an operand of insv, extv, or extzv, default it to word_mode.
+ (simplify_comparison): Similarly.
+ * expmed.c (store_bit_field): Similarly.
+ (extract_bit_field): Similarly.
+ * function.c (fixup_var_regs_1): Similarly.
+ * recog.c (validate_replace_rtx_1): Similarly.
+ * mips.md (extv, extzv, insv expanders): Default modes for most
+ operands. Handle TARGET_64BIT.
+ (movdi_uld, movdi_usd): New patterns.
- * Makefile.in (c-typeck.o): Delete on expr.h, insn-codes.h and
- $(RTL_H).
- (stor-layout.o): Likewise.
- * c-typeck.c: Include rtl.h and expr.h.
- * stor-layout.c: Likewise.
+ * pa.c (emit_move_sequence): Do not replace a pseudo with its
+ equivalent memory location unless we have been provided a scratch
+ register. Similarly do not call find_replacement unless a
+ scratch register has been provided.
- * cpplib.c (cpp_file_line_for_message): Delete unused parameter.
- All callers changed.
- (do_sccs): Wrap in an SCCS_DIRECTIVE ifdef.
- * fix-header.c (cpp_file_line_for_message): Delete unused paramter.
- All callers changed.
+Tue Sep 15 19:23:01 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
- * collect2.c (is_in_list): Wrap inside COLLECT_EXPORT_LIST ifdef.
+ * i386.h (PREFERRED_RELOAD_CLASS): For standard 387 constants,
+ return FLOAT_REGS.
- * local-alloc.c (reg_classes_overlap_p): Delete dead function.
+Tue Sep 15 19:09:06 1998 Richard Henderson <rth@cygnus.com>
- * tree.h (lang_print_xnode): Provide prototype.
+ * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill.
+ (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill.
+ (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill.
+ (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New.
+ * c-decl.c (init_decl_processing): Update accordingly.
+ * expr.c (expand_builtin): Likewise.
-Sat Mar 28 23:50:44 PST 1998 Jeff Law (law@cygnus.com)
+ * rtl.h (global_rtl): Add cfa entry.
+ (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New.
+ (LAST_VIRTUAL_REGISTER): Update.
+ * emit-rtl.c (global_rtl): Add cfa entry.
+ (init_emit): Initialize it.
+ * function.c (cfa_offset): New.
+ (instantiate_virtual_regs): Initialize it.
+ (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx.
+ (expand_function_end): Call expand_eh_return.
+ * tm.texi (ARG_POINTER_CFA_OFFSET): New.
+
+ * except.c (current_function_eh_stub_label): Kill.
+ (current_function_eh_old_stub_label): Likwise; update all references.
+ (expand_builtin_set_return_addr_reg): Kill.
+ (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill.
+ (expand_builtin_set_eh_regs): Kill.
+ (eh_regs): Produce a third reg for the actual handler address.
+ (eh_return_context, eh_return_stack_adjust): New.
+ (eh_return_handler, eh_return_stub_label): New.
+ (init_eh_for_function): Initialize them.
+ (expand_builtin_eh_return, expand_eh_return): New.
+ * except.h: Update prototypes.
+ * flow.c (find_basic_blocks_1): Update references to the stub label.
+ * function.h (struct function): Kill stub label elements.
+
+ * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the
+ register number is one that would be in the previous window.
+ Provide a dummy definition for non-windowed targets.
+ (get_reg_addr): New function.
+ (get_reg, put_reg, copy_reg): Use it.
+ (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub
+ generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa.
+
+ * alpha.c (alpha_eh_epilogue_sp_ofs): New.
+ (alpha_init_expanders): Initialize it.
+ (alpha_expand_epilogue): Use it.
+ * alpha.h: Declare it.
+ * alpha.md (eh_epilogue): New.
+
+ * m68h.h (ARG_POINTER_CFA_OFFSET): New.
+ * sparc.h (ARG_POINTER_CFA_OFFSET): New.
+
+Tue Sep 15 19:31:58 1998 Michael Meissner <meissner@cygnus.com>
+
+ * i960.h (CONST_COSTS): Fix thinko. Test flag, not the constant
+ flag bit mask.
+
+Tue Sep 15 14:10:54 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
+
+ * except.h (struct eh_entry): Add false_label field.
+ (end_catch_handler): Add prototype.
+ * except.c (push_eh_entry): Set false_label field to NULL_RTX.
+ (start_catch_handler): When using old style exceptions, issue
+ runtime typematch code before continuing with the handler.
+ (end_catch_handler): New function, generates label after handler
+ if needed by older style exceptions.
+ (expand_start_all_catch): No need to check for new style exceptions.
+ (output_exception_table_entry): Only output the first handler label
+ for old style exceptions.
+ * libgcc2.c (__eh_rtime_match): New routine to lump runtime matching
+ mechanism into one function, if a runtime matcher is provided.
+
+Tue Sep 15 13:53:59 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
+
+ * config/i960/i960.h (SLOW_BYTE_ACCESS): Change definition to 1.
+
+Tue Sep 15 09:59:01 1998 Mark Mitchell <mark@markmitchell.com>
+
+ * integrate.c (copy_decl_list): Fix typo.
+
+Tue Sep 15 04:18:52 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
+
+ * config/sparc/sparc.md (movdf_const_intreg_sp32): Fix length
+ attribute.
+
+Mon Sep 14 14:02:53 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sun Mar 29 00:42:21 1998 Jeffrey A Law (law@cygnus.com)
-
- * objc/sendmsg.c (__objc_block_forward): Add braces for return
- value if INVISIBLE_STRUCT_RETURN.
-
- * pa.c (arith_double_operand): Fix parens.
-
- * haifa-sched.c (print_pattern): Correct arg to sprintf.
-
- * Makefile.in (libgcc1.null): Make return type for __foo void.
-
-Sat Mar 28 14:37:20 1998 Jeffrey A Law (law@cygnus.com)
-
- * pa.h: Add declarations for many functions defined in pa.c.
-
- * genpeep.c (main): Remove unused variable 'i' from the generated
- file.
-
- * genemit.c (gen_expand): Do not emit "_done" or "_fail" labels.
- (gen_split): Likewise.
- (main): Rework generated definitions of DONE and FAIL so that they
- no longer use gotos. Avoids warnings about unused labels.
-
- * integrate.c (copy_rtx_and_substitute): Rework to avoid need for
- unused "junk" variable.
-
- * genattrtab.c (write_complex_function): Add a default case in
- generated switch statement to keep -W -Wall quiet.
-
-Sat Mar 28 10:47:21 1998 Nick Clifton <nickc@cygnus.com>
-
- * invoke.texi: Document more ARM and Thumb command line options.
-
- * config/arm/xm-thumb.h: New file.
-
-Sat Mar 28 01:37:33 1998 Craig Burley <burley@gnu.ai.mit.edu>
-
- * stmt.c (expand_expr_stmt): Must generate code for
- statements within an expression (gcc's `({ ... )}')
- even if -fsyntax-only.
-
-Sat Mar 28 01:06:12 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
- Jeffrey A Law (law@cygnus.com)
-
- * basic-block.h (basic_block_computed_jump_target): Declare.
- * flags.h: (current_function_has_computed_jump): Declare.
- * flow.c: (basic_block_computed_jump_target): Define.
- (flow_analysis): Allocate it. Set current_function_has_computed_jump
- to 0.
- (find_basic_blocks): Set current_function_has_computed_jump and
- elements of basic_block_computed_jump_target to 1 as appropriate.
- * function.c: (current_function_has_computed_jump): Define.
- * global.c (global_conflicts): Don't allocate pseudos into stack regs
- at the start of a block that is reachable by a computed jump.
- * reg-stack.c (stack_reg_life_analysis): If must restart, do so
- immediately.
- (subst_stack_regs): Undo change from Sep 4 1997.
- (uses_reg_or_mem): Now unused, deleted.
- * stupid.c (stupid_life_analysis): Compute
- current_function_has_computed_jump.
- (stupid_find_reg): Don't allocate stack regs if the function has a
- computed goto.
- * haifa-sched.c (is_cfg_nonregular): Delete code to determine if
- the current function has a computed jump. Use the global value
- instead.
-
-Sat Mar 28 00:21:37 1998 Jeffrey A Law (law@cygnus.com)
-
- * i386/freebsd.h (CPP_PREDEFINES): Remove __386BSD__.
- (DWARF2_UNWIND_INFO): Define to zero.
-
-Fri Mar 27 16:04:49 1998 Michael Meissner <meissner@cygnus.com>
-
- * gcc.c (set_std_prefix): Add declaration.
- (process_command): If GCC_EXEC_PREFIX is set, remove /lib/gcc-lib/
- suffix, and update the standard prefix prefix.c uses.
-
- * prefix.c (std_prefix): New global to hold default prefix value.
- (get_key_value): Change to use std_prefix instead of PREFIX.
- (translate_name): Ditto.
- (update_path): Ditto.
- (get_key_value): Release allocated scratch storage.
- (set_std_prefix): New function to reset the standard prefix.
-
-Fri Mar 27 18:08:21 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (find_barrier): Fix calculations for alignment increase.
-
-Fri Mar 27 08:56:52 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (stmp-fixinc): If we're actually fixing include
- files, copy gcc's assert.h into the fixed include dir.
- * fixincludes (assert.h): Avoid any attempts to fix a probably
- broken system specific assert.h file.
- * fixproto (stdlib.h): Make sure, it'll contain a definition of
- size_t.
-
-Fri Mar 27 00:49:46 1998 Jeffrey A Law (law@cygnus.com)
-
- * regclass.c (reg_scan_mark_refs): Be more selective about
- when we mark a register with REGNO_POINTER_FLAG.
-
-Thu Mar 26 23:00:11 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- reload inheritance improvement:
- * reload1.c (reg_reloaded_contents, reg_reloaded_insn):
- Change meaning: index is now hard reg number.
- (reg_reloaded_valid, reg_reloaded_dead): New variables.
- (reload_spill_index): Content is now a hard reg number.
- (reload_as_needed): Change to fit new variable meaning.
- (forget_old_reloads_1, allocate_reload_reg): Likewise.
- (choose_reload_regs, emit_reload_insns): Likewise.
-
-Thu Mar 26 18:34:13 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * regclass.c (record_reg_classes): '?' increases cost by two.
-
- * reload.c (find_reloads): Double previous costs. Output
- reloads cost one unit extra.
-
- * reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that
- boiled down to && ! 0.
-
- * reload.c (find_equiv_reg): Also consider a goal offset from the
- frame pointer to be constant.
-
-Thu Mar 26 17:34:46 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h (OPTIMIZATION_OPTIONS): Define.
-
-Thu Mar 26 00:19:47 1998 Richard Henderson <rth@cygnus.com>
-
- * combine.c (make_compound_operation): Simplify (subreg (*_extend) 0).
-
-Wed Mar 25 23:53:11 1998 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (pa_adjust_cost): Avoid redundant calls to get_attr_type.
-
-Wed Mar 25 13:40:48 1998 Jim Wilson <wilson@cygnus.com>
-
- * c-common.c (check_format_info): Initialize type, is_type. New local
- integral_format. Don't warn for 'L' when pedantic. Do warn for 'L'
- when pedantic if used with integral format specifier.
-
-Wed Mar 25 16:09:01 1998 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (FUNCTION_ARG_PADDING): Cast result to be enum
- direction.
- (function_arg_padding): Declare.
-
- * rs6000.c: Include system.h.
- (function_arg_padding): Change return type to int, cast enum's to
- int.
-
- (From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>)
- * collect2.c (scan_prog_file): Add explicit braces to avoid
- ambiguous `else'.
-
- * dbxout.c (dbxout_type_fields): Add braces around empty body in
- an if-statement.
- (dbxout_type): Likewise.
-
- * rs6000.c (rs6000_override_options): Change type of `i', `j' and
- `ptt_size' from int to size_t.
- (rs6000_file_start): Likewise for `i'.
- (rs6000_replace_regno): Add default case in enumeration switch.
- (output_epilog): Remove unused variable `i'.
- (rs6000_longcall_ref): Remove unused variables `len', `p', `reg1'
- and `reg2'.
-
- * rs6000.h (ADDITIONAL_REGISTER_NAMES): Add missing braces around
- initializer.
- (get_issue_rate, non_logical_cint_operand): Add prototype.
- (rs6000_output_load_toc_table): Ditto.
-
- * rs6000.md (udivmodsi4): Add explicit braces to avoid ambiguous
- `else'.
-
-Wed Mar 25 10:05:19 1998 Nick Clifton <nickc@cygnus.com>
-
- * config/arm/thumb.c: New File. Support for ARM's Thumb
- instruction set.
- * config/arm/thumb.h: New File. Thumb definitions.
- * config/arm/thumb.md: New File. Thumb machine description.
- * config/arm/tcoff.h: New File. Thumb COFF support.
- * config/arm/t-thumb: New File. Thumb makefile fragment.
- * config/arm/lib1thumb.asm: New File. Thumb libgcc support functions.
-
- * configure.in: Add Thumb-coff target.
- * configure: Add Thumb-coff target.
- * config.sub: Add Thumb-coff target.
-
-Wed Mar 25 10:30:32 1998 Jim Wilson <wilson@cygnus.com>
-
- * loop.c (scan_loop): Initialize move_insn_first to zero.
-
-Wed Mar 25 01:06:49 1998 Joel Sherrill (joel@OARcorp.com)
-
- * config/i386/go32-rtems.h: Defined TARGET_MEM_FUNCTIONS.
- * config/i386/rtems.h: Likewise.
- * config/i960/rtems.h: Likewise.
- * config/m68k/rtems.h: Likewise.
- * config/mips/rtems64.h: Likewise.
- * config/pa/rtems.h: Likewise.
- * config/rs6000/rtems.h: Likewise.
- * config/sh/rtems.h: Likewise.
- * config/sparc/rtems.h: Likewise.
-
-Wed Mar 25 00:57:26 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * pa.c (emit_move_sequence): If in reload, call find_replacement.
-
-Tue Mar 24 10:44:11 1998 Nick Clifton <nickc@cygnus.com>
-
- * Makefile.in (gcov$(exeext)): Support .exe extension to gcov.
-
- * collect2.c (find_a_file): Add debugging.
- (find_a_file): Test for win32 style absolute paths if
- DIR_SERPARATOR is defined.
- (prefix_from_string): Add debugging.
- (main): Test for debug command line switch at start of program
- execution.
- (main): Use GET_ENVIRONMENT rather than getenv().
- (prefix_from_env): Use GET_ENVIRONMENT.
-
-1998-03-24 Mark Mitchell <mmitchell@usa.net>
-
- * cplus-dem.c (optable): Add sizeof.
- (demangle_template_value_parm): New function containing code
- previously found in demangle_template.
- (demangle_integral_value): New function which handles complicated
- integral expressions.
- (demangle_template): Use them.
-
-Tue Mar 24 12:13:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (genconfig.o, genflags.o, gencodes.o, genemit.o,
- genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o,
- genattrtab.o, genoutput.o): Depend on system.h.
-
- * genattr.c: Include system.h. Add arguments to various function
- prototypes. Remove redundant prototype of read_rtx().
- * genattrtab.c: Likewise.
- * gencodes.c: Likewise.
- * genconfig.c: Likewise.
- * genemit.c: Likewise.
- * genextract.c: Likewise.
- * genflags.c: Likewise.
- * genopinit.c: Likewise.
- * genoutput.c: Likewise.
- * genpeep.c: Likewise.
- * genrecog.c: Likewise.
-
-1998-03-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
-
- * c-lang.c (lang_print_xnode): New function.
- * objc/objc-act.c (lang_print_xnode): Likewise.
- * print-tree.c (print_node): Call it
-
-Mon Mar 23 23:59:11 1998 H.J. Lu (hjl@gnu.org)
-
- * c-parse.in: Recognize protocol qualifiers in class
- definitions for objc.
- Include "output.h".
- (yyerror): Remove redundant decl.
- (yyprint): Fix prototype.
-
-Mon Mar 23 23:49:47 1998 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (rtx_cost): Only call CONST_COSTS if it is defined.
-
- * stmt.c (unroll_block_trees): Free block_vector if needed.
-
-Mon Mar 23 23:26:42 1998 Philippe De Muyter <phdm@macqel.be>
-
- * m68k/m68k.md (zero_extendqidi2, zero_extendhidi2): New patterns.
- (zero_extendsidi2): Avoid useless copy.
- (iordi_zext): New pattern.
- (iorsi_zexthi_ashl16): Pattern reworked to avoid "0" constraint for
- operand 2.
- (iorsi_zext): New name for old unnamed pattern; indentation fixes.
-
- * m68k/m68k.md (ashldi_const): Allow shift count in range ]32,63].
- (ashldi3): Allow constant shift count in range ]32,63].
- (ashrdi_const, ashrid3, lshrdi_const, lshrdi3): Likewise.
-
-1998-03-22 Mark Mitchell <mmitchell@usa.net>
-
- * tree.h (IS_EXPR_CODE_CLASS): New macro.
-
-Mon Mar 23 23:18:48 1998 Jeffrey A Law (law@cygnus.com)
-
- * h8300.h (CONST_COSTS): Remove definition.
- (DEFAULT_RTX_COSTS): Define.
-
-Mon Mar 23 22:58:22 1998 Joel Sherrill (joel@OARcorp.com)
-
- * config/sh/rtems.h: Switched from ELF to COFF.
-
-Mon Mar 23 14:14:20 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * freebsd.h (ASM_OUTPUT_ALIGN): Redefine.
-
-Sat Mar 21 23:52:56 PST 1998 Jeff Law (law@cygnus.com)
+Mon Sep 14 10:33:56 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
- Geoff Noer <noer@cygnus.com>
-
- * Makefile.in: Various fixes for building cygwin32 native toolchains.
-
- * objc/Makefile.in: Various fixes for building cygwin32 native toolchains.
- * objc/Make-lang.in: Likewise.
-
- * config/i386/xm-cygwin32.h (PATH_SEPARATOR): Set to a semi-colon.
-
-Sun Mar 22 00:21:46 1998 R. Ganesan <rganesan@novell.com>
-
- * configure.in: Handle with-PACKAGE=no correctly
-
-Fri Mar 20 17:36:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
- c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
- caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
- dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
- expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
- integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
- prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
- reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
- rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
- tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
- on system.h.
-
- * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
- c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
- caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
- dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
- expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
- integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
- prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
- reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
- rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
- stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
- xcoffout.c: Include system.h. Organize include ordering so
- that stdarg/varargs comes before other system headers. Remove
- spurious casts of functions assured of a prototype in system.h.
-
-Fri Mar 20 11:19:40 1998 Stan Cox <scox@equinox.cygnus.com>
-
- * reg-stack.c (pop_stack): Define. Pops any register on the
- regstack and adjusts regstack.
- (compare_for_stack_reg): Use pop_stack.
-
-Thu Mar 19 23:51:01 1998 Jeffrey A Law (law@cygnus.com)
+Mon Sep 14 09:51:05 PDT 1998 Jeff Law (law@cygnus.com)
- * configure.in (hppa1.0-hp-hpux10): Handle threads for this
- config too.
-
-Thu Mar 19 20:30:31 1998 Philippe De Muyter <phdm@macqel.be>
-
- * libgcc2.c (exit): Do not call __bb_exit_func if HAVE_ATEXIT.
-
- * fold-const.c (fold): Replace sign-extension of a zero extended
- value by a single zero extension.
+ * version.c: Bump for snapshot.
-Thu Mar 19 00:58:07 1998 Jason Merrill <jason@yorick.cygnus.com>
+Sun Sep 13 22:10:18 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * except.c (init_eh): Do nothing.
- (save_eh_status): Call init_eh_for_function, not init_eh.
- * function.c (push_function_context_to): Don't call init_emit.
+ * invoke.texi (C Dialect Options): Put back missing @end itemize.
-Thu Mar 19 13:39:52 1998 Michael Meissner <meissner@cygnus.com>
+Mon Sep 14 02:33:46 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
- * rs6000/sysv4.h (RELATIVE_PREFIX_NOT_LINKDIR): Undef for System V
- and EABI.
+ * configure.in: remove usage of `!' to negate the result of a
+ command; some common shells do not support it
-Thu Mar 19 10:10:36 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Sun Sep 13 19:17:35 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * final.c (shorten_branches): Add parentheses around +/- in
- operand of &.
+ * configure.in: in sparc9-sol2 config, use 'if test' not
+ brackets.
+ * configure: Rebuilt.
- * flow.c (life_analysis): Wrap variable `i' in macro ELIMINABLE_REGS.
+ * config/sparc/sol2-sld-64.h (SPARC_DEFAULT_CMODEL): Change to
+ CM_MEDANY.
+ (CPP_CPU_SPEC): Do not define _LP64, header files do this.
+ (CPP_CPU_DEFAULT_SPEC): Likewise.
+ * config/sparc/sol2.h (INIT_SUBTARGET_OPTABS): Get the names right
+ for arch64 libfuncs.
+
+ * config/sparc/sparc.md (goto_handler_and_restore): Allow any mode
+ for operand zero.
-Thu Mar 19 09:15:17 1998 Manfred Hollstein <manfred@s-direktnet.de>
+Sun Sep 13 09:11:59 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * regclass.c (memory_move_secondary_cost): Wrap uses of
- SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS
- with #ifdef tests.
+ * acconfig.h (NEED_DECLARATION_STRSIGNAL): Provide a stub.
-Thu Mar 19 09:06:35 1998 Manfred Hollstein <manfred@s-direktnet.de>
+ * collect2.c: Don't declare `sys_siglist' here.
+ (my_strsignal): Prototype and define new function. Use it in
+ place of `sys_siglist' hacks.
- * config/m68k/m68k.md (addqi3): Fix typo gen_INT vs. GEN_INT.
+ * mips_tfile.c: Likewise.
- * flow.c (life_analysis): #include <sys/types.h> to make sure
- size_t is defined.
- * cplus-dem.c (demangle_function_name): Likewise.
+ * configure.in (AC_CHECK_FUNCS): Check for strsignal.
+ (GCC_NEED_DECLARATIONS): Likewise.
-Thu Mar 19 09:00:01 1998 Manfred Hollstein <manfred@s-direktnet.de>
+ * system.h (strsignal): Prototype it, if necessary.
+ (sys_siglist): Declare it, if necessary.
- * final.c (insn_noperands): Change type to unsigned int.
- (final_scan_insn): Likewise for noperands;
- properly check operand number boundaries.
+Sun Sep 13 04:37:28 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Wed Mar 18 16:20:30 1998 Richard Henderson <rth@cygnus.com>
+ * loop.c (move_movables): While removing insn sequences, preserve
+ the next pointer of the most recently deleted insn when we skip
+ over a NOTE.
- * alpha.md (extzv): Don't reject register operands. Fix
- mode of operand 1.
+Sun Sep 13 08:13:39 1998 Ben Elliston <bje@cygnus.com>
-Wed Mar 18 16:14:23 1998 Richard Henderson <rth@cygnus.com>
+ * objc/config-lang.in: Do not output the name of the selected
+ thread file when building the front-end. The Makefile for the
+ runtime library will do this.
- * dbxout.c (dbxout_function_end): Fix last change. The correct
- predicate is ASM_OUTPUT_SECTION_NAME.
+ * objc/Make-lang.in: Do not build the runtime library or install
+ the Objective C header files. The Makefile for the runtime
+ library will do this.
-Wed Mar 18 12:43:20 1998 Jim Wilson <wilson@cygnus.com>
+ * objc/Makefile.in (all.indirect): Only build the front-end.
+ (compiler): Rename to `frontend'.
+ (obj-runtime): Remove target.
+ (copy-headers): Likewise.
+ (clean): No need to remove `libobjc.a' any longer.
- * sh.md (ashlsi_c-1): Delete 3rd argument to gen_ashlsi_c.
- (ashlsi): Use match_dup 1 instead of match_operand 2.
+Sat Sep 12 11:37:19 1998 Michael Meissner <meissner@cygnus.com>
-Wed Mar 18 13:46:07 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * rs6000.h ({ASM,CPP}_CPU_SPEC): Add support for all machines
+ supported with -mcpu=xxx.
- * fold-const.c (operand_equal_for_comparison_p): See if equal
- when nop conversions are removed.
+Fri Sep 11 23:55:54 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Wed Mar 18 13:42:01 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * flow.c (mark_set_1): Recognize multi-register structure return
+ values in CALL insns.
+ (mark_used_regs): Likewise.
+ (count_reg_sets_1): Likewise.
+ (count_reg_references): Likewise.
+ * rtlanal.c (note_stores): Likewise.
+ (reg_overlap_mentioned_p): Likewise.
+ * haifa-sched.c (check_live_1): Likewise.
+ (update_live_1): Likewise.
+ (sched_analyze_1): Likewise.
+ (sched_note_set): Likewise.
+ (birthing_insn_p): Likewise.
+ (attach_deaths): Likewise.
- * expr.c (expand_expr, case COND_EXPR): If have conditional move,
- don't use ORIGINAL_TARGET unless REG.
+ * config/sparc/sparc.md (movdf_const_intreg_sp64): Disable.
-Wed Mar 18 16:53:19 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * netbsd.h (ASM_OUTPUT_ALIGN): Redefine.
+Fri Sep 11 22:57:55 1998 Eric Dumazet <dumazet@cosmosbay.com>
-Wed Mar 18 12:43:20 1998 Jim Wilson <wilson@cygnus.com>
+ * config/i386/sco5.h (ASM_WEAKEN_LABEL): Defined as in svr4.h.
- * loop.c (struct movable): New field move_insn_first.
- (scan_loop): In consec sets code, set it. Clear it otherwise.
- (move_movables): In consec sets code, use it. Copy REG_NOTES from
- p to i1 only if i1 does not have REG_NOTES. Delete obsolete ifdefed
- out code.
+Thu Sep 10 22:02:04 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Wed Mar 18 09:52:56 1998 Richard Henderson <rth@cygnus.com>
+ * glimits.h (__LONG_MAX__): Recognize __sparcv9 too.
- * rtl.c (read_rtx): Fall back on homebrew atoll if HOST_WIDE_INT
- is large, and the system doesn't provide atoll or atoq.
- (atoll): New.
+Thu Sep 10 21:19:10 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
- * alpha/xm-vms.h (HAVE_ATOLL): Define.
- Reported by Klaus Kaempf <kkaempf@progis.de>.
+ * configure.in: Add check for GAS subsection -1 support.
+ * acconfig.h (HAVE_GAS_SUBSECTION_ORDERING): Add.
+ * configure config.in: Rebuilt.
+ * config/sparc/sparc.h (CASE_VECTOR_MODE): For V9 flag_pic, use
+ SImode is subsection -1 works, else use DImode.
+ (ASM_OUTPUT_ADDR_VEC_START, ASM_OUTPUT_ADDR_VEC_END): Define if
+ subsection -1 works.
+ * config/sparc/sparc.c (sparc_output_addr_vec,
+ sparc_output_addr_diff_vec): Use them if defined.
-Wed Mar 18 09:56:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Thu Sep 10 10:46:01 1998 Mark Mitchell <mark@markmitchell.com>
- * c-lang.c (finish_file): Wrap variable `void_list_node' with macro
- test !ASM_OUTPUT_CONSTRUCTOR || !ASM_OUTPUT_DESTRUCTOR.
+ * tree.h (DECL_ORIGIN): New macro.
+ * integrate.c (copy_and_set_decl_abstract_origin): New function.
+ (copy_decl_list): Use it.
+ (integrate_parm_decls): Likewise.
+ (integrate_decl_tree): Likewise.
+ * dwarf2out.c (decl_ultimate_origin): Simplify.
+ * dwarfout.c (decl_ultimate_origin): Likewise.
+ * c-decl.c (duplicate_decls): Use DECL_ORIGIN.
+ (pushdecl): Likewise.
- * calls.c (emit_call_1): Wrap variable `already_popped' with macro
- test !ACCUMULATE_OUTGOING_ARGS.
+Thu Sep 10 08:01:31 1998 Anthony Green <green@cygnus.com>
- * collect2.c (write_c_file_glob): Wrap function definition in
- macro test !LD_INIT_SWITCH.
+ * config/rs6000/rs6000.c (output_epilog): Add Java support.
- * combine.c (try_combine): Wrap variables `cc_use' and
- `compare_mode' in macro test EXTRA_CC_MODES.
+Thu Sep 10 14:48:59 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
- * cpplib.c (do_ident): Remove unused variable `len'.
- (skip_if_group): Remove unused variables `at_beg_of_line' and
- `after_ident'.
- (cpp_get_token): Remove unused variable `dummy'.
+ * invoke.texi (C++ Dialect Options): Document -fhonor-std.
- * dbxout.c (scope_labelno): Move static variable definition inside
- the one function scope where it is used.
- (dbxout_function_end): Wrap prototype and definition in
- macro test !NO_DBX_FUNCTION_END.
+Thu Sep 10 01:38:05 1998 Jeffrey A Law (law@cygnus.com)
- * dwarf2out.c (add_subscript_info): Wrap variable `dimension_number'
- in macro test !MIPS_DEBUGGING_INFO.
+ * reg-stack.c (straighten_stack): Do nothing if the virtual stack is
+ empty or has a single entry.
- * expr.c (expand_builtin_setjmp): Move declaration of variable `i'
- into the scope where it is used. Wrap empty else-statement body
- in braces.
+ * toplev.c (rest_of_compilation): Open up the dump file for reg-stack
+ before calling reg_to_stack.
- * fix-header.c: Fix typo in comment.
- (inf_skip_spaces): Cast results of INF_UNGET to (void).
- (check_protection, main): Likewise.
+Thu Sep 10 00:03:34 1998 Richard Henderson <rth@cygnus.com>
- * flow.c (find_basic_blocks_1): Remove dangling comment text.
+ * alpha.c (alphaev5_insn_pipe): Abort on default case.
+ (alphaev5_next_group): Swallow CLOBBERs and USEs.
- * function.c (contains): Wrap prototype and definition in macro
- test HAVE_prologue || HAVE_epilogue.
- (fixup_var_refs_1): Remove unused variable `width'.
+ * c-tree.h (warn_long_long): Declare it.
- * gen-protos.c (main): Remove unused variable `optr'.
+Wed Sep 9 23:31:36 1998 (Stephen L Moshier) <moshier@world.std.com>
- * haifa-sched.c (debug_control_flow): Remove unused variable `j'.
+ * emit-rtl.c (gen_lowpart_common): Disable optimization of
+ initialized float-int union if the value is a NaN.
- * libgcc2.c (__udiv_w_sdiv): Provide dummy return value of 0.
- (__sjpopnthrow): Remove unused variable `jmpbuf'.
- (__throw): Remove unused variable `val'.
+Wed Sep 9 23:00:48 1998 Nathan Sidwell <nathan@acm.org>
- * protoize.c: Check for a previously existing definition before
- defining *_OK macros.
+ * c-lex.c (real_yylex): Don't warn about long long constants if
+ we're allowing long long
- * scan-decls.c (scan_decls): Remove unused variable `old_written'.
+Wed Sep 9 21:58:41 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-Tue Mar 17 00:45:48 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * except.h (current_function_eh_stub_label): Declare.
+ (current_function_eh_old_stub_label): Declare.
+ * function.h (struct function): New members eh_stub_label and
+ eh_old_stub_label.
+ * except.c (current_function_eh_stub_label): New variable.
+ (current_function_eh_old_stub_label): New variable.
+ (init_eh_for_function): Clear them.
+ (save_eh_status): Save them.
+ (restore_eh_status): Restore them.
+ (expand_builtin_eh_stub): Set current_function_eh_stub_label.
+ (expand_builtin_eh_stub_old): Set current_function_eh_old_stub_label.
+ * flow.c (find_basic_blocks_1): When handling a REG_LABEL note, don't
+ make an edge from the block that contains it to the block starting
+ with the label if this label is one of the eh stub labels.
+ If eh stub labels exist, show they are reachable from the last block
+ in the function.
- * vax.h (ADDR_VEC_ALIGN): Define.
+ * reload1.c (reload): Break out several subroutines and make some
+ variables global.
+ (calculate_needs_all_insns): New function, broken out of reload.
+ (calculate_needs): Likewise.
+ (find_reload_regs): Likewise.
+ (find_group): Likewise.
+ (find_tworeg_group): Likewise.
+ (something_needs_reloads): New global variable, formerly in reload.
+ (something_needs_elimination): Likewise.
+ (caller_save_spill_class): Likewise.
+ (caller_save_group_size): Likewise.
+ (max_needs): Likewise.
+ (group_size): Likewise.
+ (max_groups): Likewise.
+ (max_nongroups): Likewise.
+ (group_mode): Likewise.
+ (max_needs_insn): Likewise.
+ (max_groups_insn): Likewise.
+ (max_nongroups_insn): Likewise.
+ (failure): Likewise.
+
+ * print-rtl.c (print_rtx): For MEMs, print MEM_ALIAS_SET.
+
+Wed Sep 9 13:14:41 1998 Richard Henderson <rth@cygnus.com>
+
+ * loop.c (load_mems): Copy rtx for output mem.
+
+Wed Sep 9 15:16:58 1998 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * mips/abi64.h (LONG_MAX_SPEC): Don't set LONG_MAX for
+ mips1 or mips2 either.
+
+Wed Sep 9 12:31:35 1998 Jeffrey A Law (law@cygnus.com)
+
+ * pa.c (pa_reorg): New marking scheme for jumps inside switch
+ tables.
+ (pa_adjust_insn_length): Update to work with new marking scheme
+ for jumps inside switch tables.
+ * pa.md (switch_jump): Remove pattern.
+ (jump): Handle jumps inside jump tables.
+
+ * Makefile.in (profile.o): Depend on insn-config.h
+
+Wed Sep 9 09:36:51 1998 Jim Wilson <wilson@cygnus.com>
+
+ * iris6.h (DWARF2_UNWIND_INFO): Undef.
+
+Wed Sep 9 01:32:01 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
+
+ Add preliminary native sparcv9 Solaris support.
+ * configure.in: Recognize sparv9-*-solaris2*
+ * configure: rebuilt
+ * config.sub: Recognize sparcv9 just like sparc64.
+ * config/sparc/sol2-c1.asm config/sparc/sol2-ci.asm
+ config/sparc/sol2-cn.asm: Macroize so it can be shared between
+ 32-bit and 64-bit Solaris systems.
+ * config/sparc/t-sol2: Assemble those with cpp.
+ * config/sparc/sparc.h (TARGET_CPU_sparcv9): New alias for v9.
+ (*TF*_LIBCALL): If ARCH64 use V9 names.
+ * config/sparc/{xm-sysv4-64,sol2-sld-64}.h: New files.
+
+Wed Sep 9 01:07:30 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
+
+ * config/sparc/sparc.h (TARGET_CM_MEDMID): Fix documentation.
+ (CASE_VECTOR_MODE): Set to SImode even if PTR64, when MEDLOW and
+ not doing pic.
+ (ASM_OUTPUT_ADDR_{VEC,DIFF}_ELT): Check CASE_VECTOR_MODE not
+ Pmode.
+ * config/sparc/sparc.md (tablejump): Likewise, and sign extend op0
+ to Pmode if CASE_VECTOR_MODE is something else.
+
+Wed Sep 9 00:10:31 1998 Jeffrey A Law (law@cygnus.com)
+
+ * prefix.c (update_path): Correctly handle cases where PATH is
+ a substring of the builtin prefix, but specifies a different
+ directory location.
+
+Tue Sep 8 23:46:04 1998 Hans-Peter Nilsson <hp@axis.se>
+
+ * expr.c: Corrected comment about what MOVE_RATIO does.
+ * config/alpha/alpha.h: Ditto.
+ * config/1750a/1750a.h: Ditto.
+ * config/clipper/clipper.h: Ditto.
+ * config/i386/i386.h: Ditto.
+
+Tue Sep 8 22:56:12 1998 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in (m68k-next-nextstep3*): Use collect2.
+ Similarly for x86 NeXT configurations.
+ * configure: Rebuilt.
-Mon Mar 16 15:57:17 1998 Michael Meissner <meissner@cygnus.com>
+Tue Sep 8 01:38:57 1998 Nathan Sidwell <nathan@acm.org>
- * gcc.c (default_arg): Don't wander off the end of allocated
- memory.
+ * configure.in: Don't assume srcdir is .../gcc
+ * configure: Rebuilt.
- (From Geoffrey Keating <geoffk@ozemail.com.au>)
- * rs6000.c (small_data_operand): Ensure that any address
- referenced relative to the small data area is inside the SDA.
+Sat Sep 5 16:34:34 EDT 1998 John Wehle (john@feith.com)
-Mon Mar 16 12:55:15 1998 Jim Wilson <wilson@cygnus.com>
+ * global.c: Update comments.
+ (global_alloc): Assign allocation-numbers
+ even for registers allocated by local_alloc in case
+ they are later spilled and retry_global_alloc is called.
+ (mark_reg_store, mark_reg_clobber,
+ mark_reg_conflicts, mark_reg_death): Always record a
+ conflict with a pseudo register even if it has been
+ assigned to a hard register.
+ (dump_conflicts): Don't list pseudo registers already assigned to
+ a hard register as needing to be allocated, but do list their
+ conflicts.
+ * local-alloc.c: Update comment.
- * config/m68k/netbsd.h (ASM_SPEC): Add %{m68060}.
+Mon Sep 7 23:38:01 1998 Jeffrey A Law (law@cygnus.com)
-Mon Mar 16 15:50:20 EST 1998 Andrew MacLeod <amacleod@cygnus.com>
+ * configure.in: Check for bogus GCC_EXEC_PREFIX and LIBRARY_PATH.
+ * configure: Rebuilt.
- * except.h (in_same_eh_region): New prototype.
- (free_insn_eh_region, init_insn_eh_region): New prototypes.
- * except.c (insn_eh_region, maximum_uid): New static variables.
- (set_insn_eh_region): New static function to set region numbers.
- (free_insn_eh_region): New function to free EH region table.
- (init_insn_eh_region): New function to initialize EH region table.
- (in_same_eh_region): New function used to determine if two rtl
- instructions are in the same exception region or not.
- * final.c (final): Initialize the table indicating which instructions
- belong in which exception region.
- * genpeep.c (main): Add "except.h" to include file list in generated
- file insn-peep.c.
- * config/sparc/sparc.md: Add calls to 'in_same_eh_region' in 4
- peepholes involving calls and unconditional branches.
+Mon Sep 7 22:41:46 1998 Michael Meissner <meissner@cygnus.com>
-Mon Mar 16 11:16:50 1998 Jim Wilson <wilson@cygnus.com>
+ * rs6000.c (rs6000_override_options): Fix name for ec603e, to add
+ missing 'c'.
+ * t-ppccomm (MULTILIB_MATCHES_FLOAT): Add support for -mcpu=xxx
+ for all targets that set -msoft-float.
- * README.gnat: New file.
+Mon Sep 7 23:30:07 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-Mon Mar 16 11:14:20 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * toplev.c (print_switch_values): Make static to match prototype.
- * config/m68k/m68k.c: Include <stdlib.h> for atoi. Include
- "recog.h" for offsettable_memref_p.
- (legitimize_pic_address): Remove unused variable `offset'.
- (notice_update_cc): Change return type to void. Add default label
- to switch.
- (standard_68881_constant_p): Remove unused variable mode.
- (print_operand): Define local variable i only if SUPPORT_SUN_FPA.
- (const_int_cost): Explicitly declare as returning int.
- (output_dbcc_and_branch): Change return type to void.
+Mon Sep 7 19:13:59 1998 Jeffrey A Law (law@cygnus.com)
- * config/m68k/linux.h, config/m68k/m68k.md, config/m68k/m68k.c,
- config/m68k/m68k.h: Replace gen_rtx (XXX, ...) with gen_rtx_XXX
- (...). Use GEN_INT instead of gen_rtx_CONST_INT.
+ * configure.in: If we are unable to find the "gnatbind" program,
+ then do not configure the ada subdir.
+ * configure: Rebuilt.
-Sun Mar 15 22:30:44 PST 1998 Jeff Law (law@cygnus.com)
+Sun Sep 6 14:03:58 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Fri Mar 13 11:30:12 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * config/m68k/m68k.h (CONST_OK_FOR_LETTER_P): Fix logic in range
- check for 'M' constraint.
+Sun Sep 6 13:28:07 PDT 1998 Jeff Law (law@cygnus.com)
-Thu Mar 12 14:47:14 1998 Jim Wilson <wilson@cygnus.com>
-
- * cccp.c (create_definition): If pedantic, call pedwarn for macro
- varargs feature.
-
-Thu Mar 12 13:43:25 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * i386.c (ix86_logical_operator): New function.
- (split_di): Ensure that when a MEM is split, the resulting MEMs have
- SImode.
- * i386.md (anddi3, xordi3, iordi3): New patterns. Add a define_split
- to implement them.
-
-Thu Mar 12 15:13:16 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- Richard Earnshaw <rearnsha@arm.com>
- Nick Clifton <nickc@cygnus.com>
-
- * tm.texi (DEFAULT_RTX_COSTS): Document new macro.
-
- * arm.h (DEFAULT_RTX_COSTS): Define instead of RTX_COSTS.
-
- * cse.c (rtx_cost): Provide a default case in an enumeration
- switch, and call DEFAULT_RTX_COSTS if it's defined.
-
-Thu Mar 12 10:02:38 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * basic-block.h (compute_preds_succs): Change return type in
- prototype to void.
- * flow.c (compute_preds_succs): Likewise in function definition.
-
- * regmove.c (find_matches): Cast char used as array index to unsigned char
- to supress warning.
-
-Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * i386.h (RTX_COSTS): Insert braces around nested if.
- (ADDITIONAL_REGISTER_NAMES): Insert braces around structured
- elements.
-
- * gcc.c (default_compilers): Properly put brackets around array elements in
- initializer.
-
- * getopt.c (_getopt_internal): Add explicit braces around nested if;
- reformatted.
-
- * reg-stack.c (record_asm_reg_life): Add explicit braces around nested if's.
- (record_reg_life_pat): Add explicit parens around && and || in expression.
- (stack_reg_life_analysis): Add parens around assignment used as expression.
- (convert_regs): Likewise.
-
-Thu Mar 12 09:25:29 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * bitmap.c (bitmap_element_allocate): Remove unused parameter;
- change callers accordingly.
-
- * cplus-dem.c (arm_special): Remove unused parameter work in prototype
- and definition; change all callers accordingly.
-
- * except.c (init_eh): Avoid assignment of unused return value of
- build_pointer_type; cast it to void, instead, and remove unused
- variable type.
+ * version.c: Bump for snapshot.
- * gcc.c (lang_specific_driver): Define prototype only #ifdef
- LANG_SPECIFIC_DRIVER.
- (temp_names): Define only #ifdef MKTEMP_EACH_FILE.
+Sun Sep 6 08:54:14 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (toplev.o): Depend on $(EXPR_H).
+ (insn-extract.o, insn-attrtab.o): Depend on toplev.h.
+
+ * gansidecl.h: Define ATTRIBUTE_NORETURN.
+
+ * genattrtab.c: Have insn-attrtab.c include toplev.h.
+
+ * genextract.c: Have insn-extract.c include toplev.h.
+
+ * rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'.
+
+ * toplev.c: Include expr.h.
+ (really_sorry, fancy_abort): Remove prototypes.
+ (set_target_switch): Add argument in prototype.
+ (vfatal): Mark prototype with ATTRIBUTE_NORETURN.
+ (v_really_sorry): Likewise.
+ (print_version, print_single_switch, print_switch_values): Make
+ static and add prototype arguments.
+ (decl_printable_name): Add prototype arguments.
+ (lang_expand_expr_t): New typedef.
+ (lang_expand_expr): Declare as a lang_expand_expr_t.
+ (incomplete_decl_finalize_hook): Add prototype argument.
+ (decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED.
+ (botch): Likewise for variable `s'.
+ (rest_of_type_compilation): Mark variables `type' and `toplev'
+ with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO,
+ XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined.
+ (display_help): Make variable `i' an `unsigned long'.
+ (main): Remove unused parameter `envp'.
+ Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'.
+ Cast -1 when comparing it with a `size_t'.
+
+ * toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark
+ prototype with ATTRIBUTE_NORETURN.
+ (fatal_insn_not_found, fatal_insn, really_sorry,
+ push_float_handler, pop_float_handler): Add prototypes.
+ (fancy_abort): Mark prototype with ATTRIBUTE_NORETURN.
+ (do_abort, botch): Add prototypes.
+
+Sat Sep 6 12:05:18 1998 John Carr <jfc@mit.edu>
- * genoutput.c (output_epilogue): Initialize next_name to 0.
+ * final.c (final): If a label is reached only from a single jump,
+ call NOTICE_UPDATE_CC on the jump and its predecessor before
+ emitting the insn after the label.
+
+ * i386.h: Add AMD K6 support.
+ Change TARGET_* macros to use table lookup.
+ (INITIALIZE_TRAMPOLINE): Improve trampoline code.
+ (ADJUST_COST): Change definition to call function in i386.c.
+ (ISSUE_RATE): Define as 2 for anything newer than an 80486.
+ * i386.c: Add AMD K6 support.
+ Add constants for feature tests used by TARGET_* macros.
+ (split_di): If before reload, call gen_lowpart and gen_highpart.
+ (x86_adjust_cost): New function.
+ (put_jump_code): New function.
+ (print_operand): New codes 'D' and 'd'.
+ * i386.md: New insn types. New insn attribute "memory".
+ Redefine scheduling parameters to use new types and add AMD K6
+ support. Explicitly set type of most insns.
+ (move insns): K6 prefers movl $0,reg to xorl reg,reg. Pentium
+ Pro and K6 prefer movl $1,reg to incl reg.
+ (adddi3, subdi3): Set cc_status.
+ (DImode shift patterns): Change label counters from HOST_WIDE_INT
+ to int; x86 can't have more than 2^31 DImode shifts per file.
+ (setcc): Combine all setcc patterns. Allow writing memory.
+ Combine all jump patterns using match_operator.
+ (*bzero): Name pattern. Emit mutliple stos instructions when that
+ is faster than rep stos.
+ (xordi3, anddi3, iordi3): Simplify DImode logical patterns and
+ add define_split.
+
+Sun Sep 6 11:17:20 1998 Dave Love <d.love@dl.ac.uk>
+
+ * config/m68k/x-next (BOOT_LDFLAGS): Define suitably for f771
+ linking.
+
+Sat Sep 5 22:05:25 1998 Richard Henderson <rth@cygnus.com>
+
+ * alpha.c (alpha_ra_ever_killed): Inspect the topmost sequence,
+ not whatever we're generating now.
+
+ * alpha.c (set_frame_related_p, FRP): New.
+ (alpha_expand_prologue): Mark frame related insns.
+ (alpha_expand_epilogue): Likewise, but with a null FRP.
+ * alpha.h (INCOMING_RETURN_ADDR_RTX): New.
+ * alpha.md (exception_receiver): New.
+ * alpha/crtbegin.asm (.eh_frame): New beginning.
+ (__do_frame_setup, __do_frame_takedown): New.
+ * alpha/crtend.asm (.eh_frame): New ending.
+ * alpha/elf.h (DWARF2_DEBUGGING_INFO): Define.
+ (ASM_SPEC): Don't emit both dwarf2 and mdebug.
+ (ASM_FILE_START): Don't emit .file for dwarf2.
- * real.c (efrexp): #if 0 prototype and function definition.
- (eremain): Likewise.
- (uditoe): Likewise.
- (ditoe): Likewise.
- (etoudi): Likewise.
- (etodi): Likewise.
- (esqrt): Likewise.
+ * rtl.h (enum reg_note): Add REG_FRAME_RELATED_EXPR.
+ * rtl.c (reg_note_name): Likewise.
+ * rtl.texi (REG_NOTES): Likewise.
+ * dwarf2out.c (dwarf2out_frame_debug): Use it. Recognize a store
+ without an offset.
- * reload.c (push_secondary_reload): Define prototype only
- #ifdef HAVE_SECONDARY_RELOADS.
+Sat Sep 5 14:47:17 1998 Richard Henderson <rth@cygnus.com>
- * varasm.c (assemble_static_space): Define rounded only
- #ifndef ASM_OUTPUT_ALIGNED_LOCAL.
+ * i386.h (PREFERRED_RELOAD_CLASS): Standard fp constants load to TOS.
+ * i386.md (movsf, movdf, movxf): Validate memory address returned
+ from force_const_mem. Kill useless REG_EQUAL setting code.
-Thu Mar 12 09:11:35 1998 Manfred Hollstein <manfred@s-direktnet.de>
+Sat Sep 5 14:23:31 1998 Torbjorn Granlund <tege@matematik.su.se>
- * i386.md (andsi): Add default case in enumeration switch.
- (iorsi3): Likewise.
- (iorhi3): Likewise.
- (xorsi3): Likewise.
+ * m68k.md (zero_extendsidi2): Fix typo.
-Thu Mar 12 08:37:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
+Sat Sep 5 13:40:24 1998 Krister Walfridsson <cato@df.lth.se>
- * c-decl (finish_struct): Change type of min_align to unsigned.
+ * configure.in: Removed references to the removed file
+ * config/xm-netbsd.h. Use ${cpu_type}/xm-netbsd.h for
+ * arm*-*-netbsd* and ns32k-*-netbsd*.
+ * config/i386/xm-netbsd.h: Removed unnecessary file.
+ * config/m68k/xm-netbsd.h: Likewise.
+ * config/sparc/xm-netbsd.h: Likewise.
+ * config/mips/xm-netbsd.h: Likewise.
- * cplus-dem.c (demangle_function_name): Change type of variable i to size_t;
- remove unused variable len.
+Sat Aug 29 13:32:58 1998 Mumit Khan <khan@xraylith.wisc.edu>
- * dwarf2out.c (reg_save): Add explicit cast of -1 to unsigned and a
- comment indicating this is proper behaviour.
- (reg_loc_descriptor): Remove redundant comparison of unsigned variable
- reg >= 0.
- (based_loc_descr): Likewise.
+ * i386/cygwin32.h (BIGGEST_ALIGNMENT): Define.
+ (PCC_BITFIELD_TYPE_MATTERS): Define to be 0.
- * enquire.c (bitpattern): Change type of variable i to unsigned.
+ * i386/cygwin32.h (ASM_OUTPUT_SECTION_NAME): Don't check for
+ for exact section attributions.
- * final.c (output_asm_insn): Don't cast insn_noperands to unsigned.
+ * i386/mingw32.h (CPP_PREDEFINES): Add __MSVCRT__ for msvc
+ runtime.
+ * i386/crtdll.h (CPP_PREDEFINES): Define.
- * flow.c (life_analysis): Change type of variable i to size_t;
- remove unused variable insn.
+Sat Sep 5 03:23:05 1998 Jeffrey A Law (law@cygnus.com)
- * gcc.c (translate_options): Change type of variables optlen, arglen and
- complen to size_t.
- (input_filename_length): Change type to size_t.
- (do_spec_1): Change type of variable bufsize to size_t.
- (main): Change type of variables i and j to size_t;
- remove subblock local definition of variable i.
- (lookup_compiler): Change type of second argument to size_t;
- change type of variable i to size_t.
+ * m68k.md (5200 movqi): Do not allow byte sized memory references
+ using address regs.
+ * m68k.c (output_move_qimode): Do not use byte sized operations on
+ address registers.
- * genemit.c (output_init_mov_optab): Change type of variable i to size_t.
+ * Makefile.in (pexecute.o): Use pexecute.c from libiberty. Provide
+ explicit rules for building. Similarly for alloca, vfprintf,
+ choose-temp and mkstemp, getopt, getopt1, and obstack.
+ (INCLUDES): Add $(srcdir)/../include.
+ * pexecute.c, alloca.c, vfprintf.c, choose-temp.c, mkstemp.c: Delete.
+ * getopt.h, getopt.c getopt1.c, obstack.c, obstack.h: Likewise.
- * genopinit.c (get_insn): Change type of variable pindex to size_t.
+Fri Sep 4 11:57:50 1998 Tom Tromey <tromey@cygnus.com>
- * genrecog.c (add_to_sequence): Change type of variable i to size_t.
+ * gcc.c (do_spec_1): [case 'o'] Account for
+ lang_specific_extra_outfiles.
+ (main): Correctly clear all slots in outfiles for
+ lang_specific_extra_outfiles. Set input_file_number before
+ calling lang_specific_pre_link.
- * global.c (global_alloc): Change type of variable i to size_t.
+Fri Sep 4 10:37:07 1998 Jim Wilson <wilson@cygnus.com>
- * regclass.c (init_reg_sets): Change type of variables i and j to unsigned.
+ * loop.c (load_mems): Fix JUMP_LABEL field after for_each_rtx call.
- * stmt.c (expand_end_bindings): Change type of variable i to size_t.
- (expand_end_case): Change type of variable count to size_t.
+Fri Sep 4 02:01:05 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * toplev.c (main): Change type of variable j to size_t.
- (set_target_switch): Change type of variable j to size_t.
- (print_switch_values): Change type of variable j to size_t;
- remove unused variable flags.
+ * config/sparc/sparc.c (output_double_int): In all V9 symbolic
+ cases, use xword.
+ (sparc_output_deferred_case_vectors): If no work to do, return.
+ Fix thinko in Sept 1 change.
- * varasm.c (assemble_variable): Change type of variable align to size_t.
- (const_hash_rtx): Change type of variable i to size_t.
+1998-09-03 SL Baur <steve@altair.xemacs.org>
-1998-03-11 Mark Mitchell <mmitchell@usa.net>
+ * Makefile.in: add semicolon in BISON definition for portability.
- * dbxout.c (dbxout_type_methods): Only treat TYPE_METHODS as a
- TREE_VEC if that's what it really is.
+Thu Sep 3 13:34:41 1998 Toon Moene <toon@moene.indiv.nluug.nl>
-Wed Mar 11 15:16:01 1998 Michael Meissner <meissner@cygnus.com>
+ * config/nextstep.c (handle_pragma): Correct name of third
+ argument.
- * {haifa-,}sched.c (rank_for_schedule): Only take void * arguments
- as per ISO C spec.
+Tue Sep 1 11:30:33 1998 Nick Clifton <nickc@cygnus.com>
-Wed Mar 11 12:05:20 1998 Teemu Torma <tot@trema.com>
+ * config/m32r/m32r.md: Change (reg:CC 17) to (reg:SI 17).
+ * config/m32r/m32r.h: Make register 17 be fixed.
+ * config/m32r/m32r.c: Use SImode for cc operations.
- * gthr.h: Changed the comment about return values.
- * gthr-solaris.h (__gthread_once): Do not use errno; return the
- error number instead of -1.
- (__gthread_key_create): Any non-zero return value is an error.
- * libgcc2.c (eh_context_initialize): Check for non-zero return
- value from __gthread_once.
- Check that the value of get_eh_context was really changed.
+Thu Sep 3 18:17:34 1998 Benjamin Kosnik <bkoz@cygnus.com>
-Wed Mar 11 18:26:25 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * invoke.texi (Warning Options): Add -Wnon-template-friend
+ documentation.
- * sh.h (LOOP_ALIGN): Only align when optimizing.
- * sh.c (find_barrier): Clear inc for CODE_LABELs.
- When not optimizing, calculate alignment for BARRIERs directly.
+Thu Sep 3 18:16:16 1998 Michael Meissner <meissner@cygnus.com>
-Wed Mar 11 15:07:18 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * rs6000.c (rs6000_override_options): Add -mcpu={401,e603e}.
- * final.c (shorten_branches): Remove conditionalizing on
- SHORTEN_WITH_ADJUST_INSN_LENGTH
- * sh.h, pa.h (SHORTEN_WITH_ADJUST_INSN_LENGTH): Remove.
+Thu Sep 3 18:05:16 1998 David Edelsohn <edelsohn@mhpcc.edu>
-Wed Mar 11 02:37:41 1998 Jeffrey A Law (law@cygnus.com)
+ * rs6000.md (movsf): Disable explicit secondary-reload-like
+ functionality if TARGET_POWERPC64.
+ (movdf): Remove TARGET_POWERPC64 explicit secondary-reload-like
+ functionality.
- * flow.c (find_basic_blocks_1): Keep the cfg accurate when removing
- an unconditional jump around deleted blocks.
+Thu Sep 3 11:41:40 1998 Robert Lipe <robertl@dgii.com>
-Mon Mar 9 12:02:23 1998 Jim Wilson <wilson@cygnus.com>
+ * fixinc.sco: Borrow code to wrap 'bool' typedefs from tinfo.h
+ and term.h from fixinc.wrap.
- * profile.c (branch_prob): If see computed goto, call fatal instead of
- abort.
+Thu Sep 3 09:47:31 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * config/mips/sni-svr4.h (CPP_PREDEFINE): Add -DSNI and -Dsinix.
+ * aclocal.m4 (GCC_HEADER_STRING): New macro to detect if it is
+ safe to include both string.h and strings.h together.
+ (GCC_NEED_DECLARATION): Test STRING_WITH_STRINGS when deciding
+ which headers to search for function declarations. Continue to
+ prefer string.h over strings.h when both are not acceptable.
- * configure.in (alpha-dec-osf): Add default case for osf* to switch.
- Patch from Bruno Haible.
+ * acconfig.h (STRING_WITH_STRINGS): Add stub.
- * function.c (put_reg_into_stack): Copy MEM_IN_STRUCT_P from new.
- (assign_parms): Set aggregate if hide_last_arg and last_named.
+ * configure.in: Call GCC_HEADER_STRING.
-Mon Mar 9 19:57:56 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * system.h: Test STRING_WITH_STRINGS when deciding which headers
+ to include. Continue to prefer string.h over strings.h when both
+ are not acceptable.
- * final.c (shorten_branches): Initialize insn_addresses.
+Wed Sep 2 23:56:29 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Mon Mar 9 14:10:23 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * config/sparc/sparc.c (output_double_int): If V9 and MEDLOW, do
+ not assume top 32-bits of symbolic addresses are zero if
+ flag_pic.
- * sh.h (MUST_PASS_IN_STACK): Define.
+Thu Sep 3 00:23:21 1998 Richard Henderson <rth@cygnus.com>
-Sun Mar 8 13:01:56 1998 Jeffrey A Law (law@cygnus.com)
+ * ginclude/va-alpha.h: Protect entire second portion of the
+ file against double inclusion.
- * final.c (shorten_branches): Fix minor logic error in
- ADDR_DIFF_VEC shortening support.
+Thu Sep 3 00:37:55 1998 Ovidiu Predescu <ovidiu@aracnet.com>
-Sun Mar 8 02:17:42 PST 1998 Jeff Law (law@cygnus.com)
+ Added support for the Boehm's garbage collector.
+ * configure.in: Handle --enable-objc-gc.
+ * configure: Rebuilt.
+ * Makefile.in (CHECK_TARGETS): Add check-objc.
+ (check-objc): New rule.
+ * objc/Make-lang.in: Build a different Objective-C library that
+ runs with the Boehm's collector.
+ * objc/encoding.c (objc_round_acc_size_for_types): New function.
+ * objc/encoding.c: Correctly compute the size of compound types in
+ the presence of bitfields. Skip the variable name of the type if
+ any. Added support for long long.
+ * objc/encoding.h (_C_GCINVISIBLE): New specifier.
+ (_F_GCINVISIBLE): New mask.
+ * objc/gc.c: New file. Compute the type memory mask associated with
+ a class based on the runtime information.
+ * objc/misc.c: Added the hooks that use the Boehm's collector
+ allocation functions.
+ * objc/objc-act.c (build_class_template): Generate a new class
+ member (gc_object_type) to hold the class' type memory mask.
+ (build_shared_structure_initializer): Initialize the new member to
+ NULL.
+ (encode_complete_bitfield): New function. Generate the new
+ encoding.
+ (encode_field_decl): Generate the new encoding only for the GNU
+ runtime.
+ * objc/objc-api.h (_C_LNG_LNG, _C_ULNG_LNG): New specifiers for the
+ long long types.
+ (class_get_gc_object_type): New function to mark a pointer instance
+ variable as a weak pointer.
+ * objc/objc-features.texi: New file.
+ * objc/objc.h (gc_object_type): New class member.
+ * objc/objects.c (class_create_instance): Create a typed memory
+ object when compiled with Boehm's collector support.
+ * objc/sendmsg.c (__objc_init_install_dtable): Call
+ __objc_send_initialize instead of setting the initialize flag.
+ (__objc_send_initialize): Call __objc_generate_gc_type_description
+ to generate the class type memory mask. Rewrite the code that
+ sends the +initialize so that it is called only once (bug report
+ and fix from Ronald Pijnacker <Ronald.Pijnacker@best.ms.philips.com>).
+ * testsuite/objc: New testsuite for Objective-C type encoding.
+ * testsuite/lib/objc-torture.exp: New file.
+ * testsuite/lib/objc.exp: New file.
+
+Wed Sep 2 14:47:36 1998 Jim Wilson <wilson@cygnus.com>
+
+ * jump.c (jump_optimize): In if/then/else transformations, add
+ another call to modified_between_p for the jump insn.
+
+Wed Sep 2 14:16:49 1998 Jeffrey A Law (law@cygnus.com)
+
+ * fix-header.c (symlink): Treat like readlink.
+
+Wed Sep 2 19:30:06 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * dwarfout.c (fundamental_type_code): Encode 32 bit floats/doubles
+ as FT_float.
+
+Wed Sep 2 10:06:07 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/nextstep.h: Update HANDLE_PRAGMA macro.
+ * config/h8300/h8300.h: Update HANDLE_PRAGMA macro.
+ * config/i960/i960.h: Update HANDLE_PRAGMA macro.
+
+ * config/nextstep.c (handle_pragma): Take three arguments, as per
+ the new HANDLE_PRAGMA macro specification.
+ * config/h8300/h8300.c (handle_pragma): Take three arguments, as
+ per the new HANDLE_PRAGMA macro specification.
+ * config/i960/i960.c (process_pragma): Take three arguments, as
+ per the new HANDLE_PRAGMA macro specification.
+
+Wed Sep 2 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * c-lex.c (check_newline): Call HANDLE_PRAGMA before
+ HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
+ if unknown pragmas are encountered.
+ (handle_sysv_pragma): Interpret return code from
+ handle_pragma_token (). Return success/failure indication rather
+ than next unprocessed character.
+ (pragma_getc): New function: retrieves characters from the
+ input stream. Defined when HANDLE_PRAGMA is enabled.
+ (pragma_ungetc): New function: replaces characters back into the
+ input stream. Defined when HANDLE_PRAGMA is enabled.
+
+ * c-pragma.c (handle_pragma_token): Return success/failure status
+ of the parse.
+
+ * c-pragma.h: Change prototype of handle_pragma_token().
- * version.c: Bump for snapshot.
+ * varasm.c: (handle_pragma_weak): Only create this function if
+ HANDLE_PRAGMA_WEAK is defined.
-Sat Mar 7 00:54:15 1998 Jeffrey A Law (law@cygnus.com)
-
- * haifa-sched.c (is_cfg_nonregular): Change return type to
- an int. No longer compute "estimated" number of edges. Use
- computed_jump_p instead of duplicating the code. Fixup/add
- some comments.
- (build_control_flow): Returns a value indicating an irregularity
- in the cfg was detected. Count the number of edges in the cfg.
- allocate various edge tables.
- (find_rgns): No longer look for unreachable blocks.
- (schedule_insns): Do not allocate memory for edge tables here.
- Free memory for edge tables before returning. Do not perform
- cross block scheduling if build_control_flow returns nonzero.
- * flow.c (compute_preds_succs): More accurately determine when
- a block drops in.
-
- * basic-block.h (free_basic_block_vargs): Provide prototype.
-
- * cccp.c (main): Fix dumb mistakes in last change.
-
-Fri Mar 6 21:28:45 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * rtl.h (addr_diff_vec_flags): New typedef.
- (union rtunion_def): New member rt_addr_diff_vec_flags.
- (ADDR_DIFF_VEC_FLAGS): New macro.
-
- * sh.c (output_branch): Fix offset overflow problems.
-
- * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE.
- (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT.
- * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags).
- * stmt.c (expand_end_case): Supply new arguments to
- gen_rtx_ADDR_DIFF_VEC.
- * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY.
- * alpha.h, arc.h, clipper.h, convex.h : Likewise.
- * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise.
- * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise.
- * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise.
- * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise.
- * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise.
- * i386/386bsd.h, i386/freebsd-elf.h : Likewise.
- * i386/freebsd.h, i386/linux.h : Likewise.
- * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise.
- * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise.
- * m68k/mot3300.h, m68k/sgs.h : Likewise.
- * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise.
- * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define.
- (CASE_VECTOR_SHORTEN_MODE): Define.
- (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare.
- (med_branch_p, braf_branch_p): Don't declare.
- (mdep_reorg_phase, barrier_align): Declare.
- (ADJUST_INSN_LENGTH): Remove alignment handling.
- * sh.c (uid_align, uid_align_max): Deleted.
- (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted.
- (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted.
- (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted.
- (output_far_jump): Don't use braf_branch_p.
- (output_branchy_insn): Don't use branch_offset.
- (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs.
- Remove paired barrier stuff.
- Don't use cache_align_p.
- Take alignment insns into account.
- (fixup_addr_diff_vecs): Reduce to only fixing up the base label of
- the addr_diff_vec.
- (barrier_align, branch_dest): New function.
- (machine_dependent_reorg, split_branches): Remove infrastructure
- for branch shortening that is now provided in the backend.
- * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes.
- (braf_branch_p, braf_cbranch_p): Likewise.
- (attribute length): Use new attributes.
- (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC.
- (addr_diff_vec_adjust): Delete.
- (align_2): Now a define_expand.
- (align_log): Now length 0.
-
-Fri Mar 6 14:41:33 1998 Michael Meissner <meissner@cygnus.com>
-
- * m32r.md (right): Correctly check for length == 2, not 1.
-
-Fri Mar 6 14:00:04 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * mips/mips.h: Prototype `machine_dependent_reorg'.
- (ASM_OUTPUT_ALIGN): Remove unused variable `mask'.
-
-Fri Mar 6 11:43:35 1998 Joern Rennecke (amylaar@cygnus.co.uk)
-
- * final.c (shorten_branches): Restore accidentally removed code.
-
-Fri Mar 6 11:00:49 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure.in: Remove duplicate uses of AC_PROG_CC and
- AC_PROG_MAKE_SET.
-
-Fri Mar 6 00:59:30 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in (target_cpu_default2): Correct typo for alphapca56.
-
-Thu Mar 5 23:24:50 1998 Jeffrey A Law (law@cygnus.com)
- Doug Evans (devans@cygnus.com)
-
- * haifa-sched.c (build_jmp_edges): Delete dead function.
- (build_control_flow): Use cfg routines from flow.c
- (schedule_insns): Remove debugging code accidentally checked
- in earlier today.
-
- * basic-block.h: Add external integer list structures, typdefs,
- accessor macros and function declarations. Simlarly for
- basic block pred/succ support and simple bitmap stuff.
- * flow.c: Add functions for integer list, basic block pred/succ
- support and simple bitmap support.
- (compute_dominators): New function to compute dominators and
- post dominators.
- (find_basic_blocks): Split into two functions.
- (life_analysis): Likewise.
- (flow_analysis): Removed. Now handled by calling find_basic_blocks,
- the life_analysis from toplev.c
- * toplev.c (rest_of_compilation): Call find_basic_blocks, then
- life_analysis instead of flow_analysis.
-
-Thu Mar 5 23:06:26 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * jump.c (jump_optimize): Call mark_jump_label also for deleted
- insns.
- (mark_jump_label): Don't increment ref counts for deleted insns.
-
-Thu Mar 5 09:55:15 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * mips/iris6.h (TARGET_DEFAULT): Parenthesize macro definition.
-
- * mips/mips.c: Include stdlib.h and unistd.h.
- (mips_asm_file_end): Add braces around empty body in an if-statement.
- (function_prologue): Wrap variable `fnname' in
- !FUNCTION_NAME_ALREADY_DECLARED. Correct format specifier in fprintf.
- (mips_select_rtx_section, mips_select_section): Declare as void.
+ * c-common,c (decl_attributes): If defined call the expression
+ contained within the INSERT_ATTRIBUTES macro before adding
+ attributes to a decl.
- * mips/mips.h: Add prototypes for extern functions in mips.c.
- (FUNCTION_ARG_REGNO_P): Add parentheses around && within ||.
- (ENCODE_SECTION_INFO): Add braces around empty body in an
- if-statement.
+ * tm.texi (HANDLE_PRAGMA): Document the new verion of
+ HANDLE_PRAGMA, which takes three arguments.
+ (INSERT_ATTRIBUTES): Document this new macro.
- * mips/mips.md (movdi): Add parentheses around && within ||.
- (movsf, movdf): Likewise.
- (branch_zero, branch_zero_di): Add default case in
- enumeration switch.
+ * LANGUAGES: Document the new version of HANDLE_PRAGMA and the
+ new INSERT_ATTRIBUTES macro.
+Wed Sep 2 02:03:23 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Thu Mar 5 02:45:48 1998 Richard Henderson <rth@cygnus.com>
+ * config/sparc/sparc.md (movdf): Only generate special RTL for
+ LABEL_REFs when PIC.
+ (move_label_di): Remove
+ (movdi_pic_label_ref, movdi_high_pic_label_ref,
+ movdi_lo_sum_pic_label_ref): New patterns for 64-bit label
+ references when PIC.
+ * config/sparc/sparc.h (ASM_OUTPUT_ADDR_VEC_ELT,
+ ASM_OUTPUT_ADDR_DIFF_ELT): Don't do anything special for MEDLOW,
+ output an .xword for all 64-bit cases.
+
+Tue Sep 1 15:55:17 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * alpha/alpha.h (TARGET_WINDOWS_NT, TARGET_OPEN_VMS): Just make them
- real constants, since they can't be changed.
- (TARGET_AS_CAN_SUBTRACT_LABELS): New.
- * alpha/alpha.md (builtin_setjmp_receiver): Use it.
- * alpha/osf.h (TARGET_AS_CAN_SUBTRACT_LABELS): New.
- * alpha/osf2or3.h (TARGET_AS_CAN_SUBTRACT_LABELS): New.
- * alpha/vms.h (TARGET_OPEN_VMS): New.
- * alpha/win-nt.h (TARGET_WINDOWS_NT): New.
+ * config/sparc/sparc.c (finalize_pic): Don't output arbitrary
+ alignment, use FUNCTION_BOUNDARY instead.
+ (sparc_output_deferred_case_vectors): Likewise.
-Thu Mar 5 02:41:27 1998 Richard Henderson <rth@cygnus.com>
+Mon Aug 31 17:25:41 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * reload.c (find_reloads): Always force (subreg (mem)) to be
- reloaded if WORD_REGISTER_OPERATIONS.
+ * config/sparc/sparc.md (movsf_const_intreg): Kill warning.
+ (movtf_insn_sp64, movtf_no_e_insn_sp64): Reorder alternatives.
-Thu Mar 5 02:14:44 1998 Richard Henderson <rth@cygnus.com>
+Mon Aug 31 13:57:55 1998 Richard Henderson <rth@cygnus.com>
- * haifa-sched.c (free_list): Rename from free_pnd_lst.
- (free_pending_lists): Rename free_pnd_lst uses.
- (remove_dependence): Place expunged element on unused_insn_list.
- (alloc_INSN_LIST, alloc_EXPR_LIST): New. Change all callers of
- gen_rtx_*_LIST and alloc_rtx to use them.
- (compute_block_backward_dependences): Free the reg_last_* lists.
+ * alpha/va_list.h: New file.
+ * alpha/x-alpha (EXTRA_HEADERS): New. Add va_list.h.
-Thu Mar 5 00:05:40 1998 Jeffrey A Law (law@cygnus.com)
+Mon Aug 31 14:55:02 1998 Jeffrey A Law (law@cygnus.com)
- * cccp.c (main): Avoid undefined behavior when setting pend_includes
- and pend_files.
+ * NEWS: Add SCO Openserver and Unixware 7 notes.
-Wed Mar 4 21:58:25 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
+ * NEWS: Fix typos.
- * rs6000/linux.h: don't define DEFAULT_VTABLE_THUNKS to 1 if
- USE_GNULIBC_1 is defined
- * configure.in: add a new case powerpc-*-linux-gnulibc1 which
- includes the t-linux-gnulibc1 fragment
+Mon Aug 31 15:42:18 1998 Dave Brolley <brolley@cygnus.com>
-Wed Mar 4 12:11:36 1998 Jim Wilson <wilson@cygnus.com>
+ * varasm.c (compare_constant_1): Handle RANGE_EXPR.
+ (record_constant_1): Handle RANGE_EXPR.
- * mips.md (movdf_internal1a): Fix misplaced parenthesis in condition.
+Mon Aug 31 10:54:03 1998 Richard Henderson <rth@cygnus.com>
-Wed Mar 4 18:47:48 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * print-rtl.c (print_rtx): NOTE_INSN_LIVE has an rtx not a bitmap.
+ * haifa-sched.c (sched_analyze): Handle NOTE_INSN_RANGE_START
+ and NOTE_INSN_RANGE_END specially.
+ (reemit_notes): Likewise.
- * final.c (final_scan_insn, case CODE_LABEL: Cleanup.
+Mon Aug 31 10:18:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-Wed Mar 4 15:51:19 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * sparc.c (TMASK, UMASK): Use `(unsigned)1' not `1U'.
+ (ultrasparc_sched_init): Remove unneeded &.
- * final.c (shorten_branches): Tag the loop alignment onto the
- first label after NOTE_INSN_LOOP_BEG even if there is an
- intervening insn.
+Mon Aug 31 10:47:16 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Tue Mar 3 21:48:35 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * config/m68k/m68k.h (TARGET_SWITCHES): Don't remove MASK_68040
+ for m68020-60, to prevent the use of fintrz.
- * final.c (insn_current_reference_address):
- Use SEQ instead of BRANCH as argument to align_fuzz, to get a
- proper alignment chain.
+Sun Aug 30 22:17:20 1998 Mark Mitchell <mark@markmitchell.com>
- * final.c (max_labelno): New static variable.
- (final_scan_insn): Check max_labelno before outputting an
- alignment for a label.
- (shorten_branches): Remove unused variable length_align.
+ * configure.in: If the native compiler is GCC use $(WARN_CFLAGS)
+ even in stage1.
+ * Makefile.in: Likewise.
+ * configure: Regenerated.
-Tue Mar 3 14:27:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+Sun Aug 30 22:15:41 1998 H.J. Lu (hjl@gnu.org)
- * sparc.c (ultrasparc_adjust_cost): Add default case in
- enumeration switch.
+ * configure.in (gxx_include_dir): Changed to
+ '${prefix}/include/g++'-${libstdcxx_interface}.
+ * configure: Rebuilt.
- * sparc.h: Add prototypes for extern functions defined in
- sparc.c.
+Sun Aug 30 20:19:43 1998 Hans-Peter Nilsson <hp@axis.se>
-Tue Mar 3 10:00:11 1998 Nick Clifton <nickc@cygnus.com>
+ * expr.c (expand_expr): Change ">" to ">=" making MOVE_RATIO use
+ consistent.
+ * tm.texi (Costs): Say MOVE_RATIO is number of mem-mem move
+ *sequences* *below* which scalar moves will be used.
- * toplev.c: Only generate <name>.dbr file when dumping RTL if
- DEALY_SLOTS is defined.
+Sun Aug 30 17:18:43 1998 Jeffrey A Law (law@cygnus.com)
-Tue Mar 3 07:36:37 1998 Manfred Hollstein <manfred@s-direktnet.de>
+ * collect2.c (mktemp): Delete unused declaration.
- * reorg.c (fill_eager_delay_slots): Add new argument delay_list
- in call to fill_slots_from_thread.
+ * config/xm-netbsd.h: Remove unnecessary file.
+ * config/*/xm-netbsd.h: Do not include the generic xm-netbsd.h
+ file anymore, it is not needed.
-Mon Mar 2 13:45:03 1998 Richard Henderson <rth@cygnus.com>
+Sun Aug 30 16:05:45 1998 Mark Mitchell <mark@markmitchell.com>
- * alpha/linux.h (CPP_PREDEFINES): Correct connecting whitespace
- to SUB_CPP_PREDEFINES. Reported by asun@saul4.u.washington.edu.
+ * convert.c (convert_to_integer): Issue an error on conversions to
+ incomplete types.
-Mon Mar 2 22:59:28 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+Sun Aug 30 16:47:20 1998 Martin von Lvwis <loewis@informatik.hu-berlin.de>
- * final.c (insn_last_address, insn_current_align, uid_align):
- New variables.
- (in_align_chain, align_fuzz, align_shrink_fuzz): New functions.
- (insn_current_reference_address): Likewise.
- (shorten_branches, final_scan_insn): Implement LABEL_ALIGN,
- LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros.
- (label_to_alignment): New function.
- * genattrtab.c (write_test_expr): If one of LABEL_ALIGN,
- LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call
- insn_current_reference_address instead of insn_current_address.
- (or_attr_value, write_length_unit_log): New functions.
- (main): Call write_length_unit_log.
- (write_const_num_delay_slots): Output extra '\n'.
- * alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
- replace with:
- (LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER).
- * i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise.
- * arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): replace with:
- (LOOP_ALIGN).
- * i960.h, m88k.h: (ASM_OUTPUT_ALIGN_CODE): Replace with:
- (LABEL_ALIGN_AFTER_BARRIER).
- * ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise.
- * ns32k/tek6000.h: Likewise.
- * i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete.
- * i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of
- ASM_OUTPUT_ALIGN_CODE.
+ * Makefile.in: Add lang_tree_files and gencheck.h.
+ * configure.in: Generate them.
+ * gencheck.c: Include gencheck.h.
-Mon Mar 2 01:05:50 PST 1998 Jeff Law (law@cygnus.com)
+Sat Aug 29 21:38:24 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * version.c: Bump for snapshot.
+ * config/sparc/sparc.md (pic_lo_sum_di, pic_sethi_di): Rename to
+ movdi_lo_sum_pic and movdi_high_pic and make visible.
+ * config/sparc/sparc.c (legitimize_pic_address): For -fPIC,
+ emit these when Pmode is not SImode.
+ * config/sparc/linux64.h (SPARC_DEFAULT_CMODEL): Make CM_MEDLOW.
-Mon Mar 2 00:52:18 PST 1998 Jeff Law (law@cygnus.com)
+Sat Aug 29 14:59:32 1998 Mumit Khan <khan@xraylith.wisc.edu>
- * version.c: Bump for snapshot.
+ * i386/cygwin32.h (ASM_OUTPUT_SECTION_NAME): Don't emit
+ .linkonce directive after the first time.
-Sun Mar 1 18:25:49 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
+Sat Aug 29 12:39:56 1998 Jeffrey A Law (law@cygnus.com)
- * reorg.c (fill_slots_from_thread): Don't steal delay list from target
- if condition code of jump conflicts with opposite_needed.
+ * m68k.md (beq0_di): Generate correct (and more efficient) code when
+ the clobbered operand overlaps with an input.
+ (bne0_di): Similarly.
- * reorg.c (fill_slots_from_thread): Mark resources referenced in
- opposite_needed thread. Return delay_list even when cannot get
- any more delay insns from end of subroutine.
+ * Makefile.in (INSTALL): Remove "--no-header" argument.
-Sun Mar 1 18:26:21 1998 Ken Rose (rose@acm.org)
+ * NEWS: Various updates.
- * reorg.c (fill_slots_from_thread): New parameter, delay_list.
- All callers changed.
+Fri Aug 28 19:00:44 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Sun Mar 1 18:25:37 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+ * config/sparc/sparc.c (arith_operand, const64_operand,
+ const64_high_operand, arith_double_4096_operand): Mark mode as
+ unused.
+ (create_simple_focus_bits): Remove unused arg highest_bit_set, all
+ callers changed.
+ (sparc_emit_set_const64): Remove unused variable i.
+ (sparc_splitdi_legitimate): Likewise for addr_part.
+ (ultra_code_from_mask): Likewise for mask.
+ (ultra_cmove_results_ready_p): Fixup entry modulo calc. and
+ reverse return values so it matches usage and comments.
+ (ultra_flush_pipeline): Likewise.
+ (ultra_fpmode_conflict_exists): Likewise, remove unused variable
+ this_type, and allow loads and stores of differing FP modes as
+ they do not create a conflict.
+ (ultra_find_type): Initialize fpmode to SFmode, fix
+ parenthesization thinkos in large conditional.
+ (ultrasparc_sched_init): Mark dump and sched_verbose as unused.
+ Init free_slot_mask after ultra_cur_hist is reset, not before.
+ (ultrasparc_rescan_pipeline_state): Remove unused variable ucode.
+ (ultrasparc_sched_reorder): Don't bzero current pipeline state,
+ use ultra_flush_pipeline instead, then re-init group pointer.
+ Fix statement with no effect. If no progress made in, and no
+ instructions scheduled at all, advance to new pipeline cycle else
+ we get into an endless loop.
+ (ultrasparc_adjust_cost): Remove previous arg.
+ * config/sparc/sparc.h (ADJUST_COST): Update to reflect that.
+
+Fri Aug 28 13:52:35 1998 Jim Wilson <wilson@cygnus.com>
- * frame.c (start_fde_sort, fde_split, heapsort, fde_merge,
- end_fde_sort): New functions for fast sorting of an FDE array.
- (fde_insert): Simplified.
- (add_fdes): Change argument list.
- (frame_init): Use the new functions.
+ * sparc.md (DImode, DFmode, TFmode splits): Delete self_reference
+ code. Use reg_overlap_mentioned_p to detect when source and
+ destination overlap.
+ (negtf2_notv9+1): Use DFmode instead of SFmode in last two operands.
-Sun Mar 1 18:06:21 1998 Jeffrey A Law (law@cygnus.com)
+1998-08-28 Brendan Kehoe <brendan@cygnus.com>
- * ginclude/va-ppc.h (va_arg): Fix typo in long long support.
+ * loop.c (check_dbra_loop): Pass COMPARISON_VALUE, not
+ COMPARISON_VAL, into invariant_p.
- * i386.c (reg_mentioned_in_mem): Fix dangling else statement.
+Fri Aug 28 15:13:25 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * fold-const.c (fold_range_test): Always return a value.
+ * regmove.c (regclass_compatible_p): New function.
+ (regmove_optimize): Use it.
-Sun Mar 1 17:57:34 1998 Mumit Khan <khan@xraylith.wisc.edu>
+ Use NREGS parameter insted of calling max_reg_num.
- * config/i386/winnt.c (i386_pe_unique_section): Put read-only
- data in the text section unless READONLY_DATA_SECTION is defined.
+ (fixup_match_1): Don't use code = MINUS when later tieing with
+ a hard register is likely.
-Sun Mar 1 17:48:46 1998 Jeffrey A Law (law@cygnus.com)
+Fri Aug 28 14:54:07 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * c-parse.in (undeclared variable error): Tweak error message to
- be clearer.
+ * loop.c (check_dbra_loop): Fix calculation of FINAL_VALUE when
+ COMPARISON_VAL was normalized.
-Sun Mar 1 10:22:36 PST 1998 Jeff Law (law@cygnus.com)
+Thu Aug 27 20:10:46 1998 Jeffrey A Law (law@cygnus.com)
- * version.c: Bump for snapshot.
+ * loop.c (check_dbra_loop): The loop ending comparison value
+ must be an invariant or we can not reverse the loop.
-1998-02-28 Mark Mitchell <mmitchell@usa.net>
-
- * final.c (final_scan_insn): Undo overzealous removal of `set'.
-
-Sat Feb 28 07:54:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * loop.c (scan_loop): Count down from max_reg_num - 1 to
+ FIRST_PSEUDO_REGISTER to avoid calling max_reg_num each iteration
+ of the loop.
+ (load_mems_and_recount_loop_regs_set): Likewise.
- * pa.h (CONST_COSTS): When checking the CONST_DOUBLE enumerated
- case, add parentheses to specify the proper order of precedence in
- the if-statement.
+ * i386.c (print_operand): Remove obsolete 'c' docs.
+Wed Aug 26 17:13:37 1998 Tom Tromey <tromey@cygnus.com>
- * c-aux-info.c: Include string.h/strings.h.
-
- * pa.c: Include stdlib.h.
- (pa_combine_instructions): Prototype the function.
- (pa_can_combine_p, forward_branch_p, shadd_constant_p): Likewise.
- (reloc_needed): Add default case for enumeration switch.
- (remove_useless_addtr_insns): Remove unused variable `all'.
- (hppa_expand_prologue): Add explicit braces to avoid
- ambiguous `else'.
- (output_function_epilogue): Remove unused variable `i'.
- (output_millicode_call): Remove unused variable `link'.
- (shadd_constant_p, forward_branch_p): Make the function static.
- (following_call): Explicitly declare to return int.
- (pa_reorg): Declare as void.
- (pa_combine_instructions): Declare as static void. Add
- parentheses around && within ||.
+ * gthr.h: Document __GTHREAD_MUTEX_INIT_FUNCTION.
+ * frame.c (init_object_mutex): New function.
+ (init_object_mutex_once): Likewise.
+ (find_fde): Call it.
+ (__register_frame_info): Likewise.
+ (__register_frame_info_table): Likewise.
+ (__deregister_frame_info): Likewise.
- * pa.h: Add prototypes for pa_reorg, symbolic_operand,
- following_call, function_label_operand, lhs_lshift_cint_operand
- and zdepi_cint_p.
+Thu Aug 27 15:14:18 1998 Jeffrey A Law (law@cygnus.com)
- * pa.md: Add parentheses around && within ||.
+ * haifa-sched.c (sched_analyze_insn): Fix thinko in last change.
- * cppalloc.c: Include stdlib.h.
+Thu Aug 27 16:34:51 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * cpperror.c (cpp_print_containing_files): Remove unused variable
- `i'. Fix format specifier in fprintf.
+ * loop.c (check_dbra_loop): Enable code for reversal
+ of some loops without a known constant loop end.
- * cse.c (cse_around_loop): Add explicit braces to avoid
- ambiguous `else'.
- (delete_dead_from_cse): Wrap variable `tem' in macro HAVE_cc0.
+Wed Aug 26 18:38:15 1998 Richard Henderson <rth@cygnus.com>
- * expr.c (expand_expr): Add parentheses around && within ||.
+ * haifa-sched.c (last_clock_var): New.
+ (schedule_block): Initialize it.
+ (schedule_insn): Use it to fill insn modes with issue information.
- * final.c (app_enable): Replace fprintf with fputs where there are
- no format specifiers and no trailing argument after the string.
- Eg, when printing ASM_APP_ON/ASM_APP_OFF.
- (app_disable): Likewise.
- (final_end_function): Likewise.
- (final_scan_insn): Likewise. Remove unused variable `set'.
- (profile_function): Wrap empty if-statement body in {} brackets.
+ * alpha.c (alpha_handle_trap_shadows): Remove do-nothing exit.
+ Tag trapb and next insn with TImode.
+ (alphaev5_insn_pipe, alphaev5_next_group, alphaev5_align_insns): New.
+ (alpha_reorg): Add conditional for alpha_handle_trap_shadows.
+ Invoke alphaev5_align_insns as appropriate.
+ * alpha.h (LABEL_ALIGN_AFTER_BARRIER): Was ALIGN_LABEL_AFTER_BARRIER.
+ (MD_SCHED_VARIABLE_ISSUE): New.
+ * alpha.md (attr type): Add multi.
+ (define_asm_attributes): New.
+ (prologue_stack_probe_loop, builtin_setjmp_receiver): Set type multi.
+ (arg_home): Likewise.
+ (fnop, unop, realign): New.
- * function.c: Include stdlib.h.
- (pad_below): Wrap prototype and definition in ARGS_GROW_DOWNWARD.
- (reposition_prologue_and_epilogue_notes): Add parentheses
- around assignment used as truth value.
+Wed Aug 26 15:55:41 1998 Jim Wilson <wilson@cygnus.com>
- * integrate.c (expand_inline_function): Wrap variable
- `cc0_insn' in macro HAVE_cc0.
+ * iris5.h (PREFERRED_DEBUGGING_TYPE): Undef.
+ * iris5gas.h (PREFERRED_DEBUGGING_TYPE): Define.
- * jump.c (jump_optimize): Wrap variable `q' in macro
- HAVE_cc0. Remove unused variable `prev1'.
+ * configure.in (powerpc-ibm-aix4.[12]*): Change from 4.[12].*.
+ (rs6000-ibm-aix4.[12]*): Likewise.
+ * configure: Regnerate.
- * libgcc2.c (__bb_exit_trace_func): Add parentheses around &&
- within ||. Fix format specifier in fprintf.
- (__bb_init_prg): Add parentheses around assignment used as
- truth value.
+Wed Aug 26 09:30:59 1998 Nick Clifton <nickc@cygnus.com>
- * local-alloc.c: Include stdlib.h.
- (requires_inout): Add parentheses around assignment used
- as truth value.
+ * config/arm/thumb.c (thumb_exit): Do not move a4 into lr if it
+ already contains the return address.
- * loop.c (analyze_loop_iterations): Wrap prototype and definition
- in macro HAVE_decrement_and_branch_on_count.
- (insert_bct, instrument_loop_bct): Likewise.
- (move_movables): Add parentheses around assignment used as
- truth value.
- (consec_sets_invariant_p): Likewise.
- (maybe_eliminate_biv_1): Wrap variable `new' in macro HAVE_cc0.
+Wed Aug 26 12:57:09 1998 Jeffrey A Law (law@cygnus.com)
- * objc/objc-act.c: Include stdlib.h.
- (lookup_method_in_protocol_list): Wrap empty else-statement body
- in braces.
- (lookup_protocol_in_reflist): Likewise.
- (objc_add_static_instance): Remove unused variables `decl_expr'
- and `decl_spec'.
- (get_objc_string_decl): Remove unused variable `decl'.
- (generate_static_references): Remove unused variables `idecl' and
- `instance'.
- (check_protocols): Wrap empty else-statement body in braces.
+ * calls.c (expand_call): Use bitfield instructions to extract/deposit
+ word sized hunks when loading unaligned args into registers.
- * protoize.c: Include stdlib.h.
- (substr): Add parentheses around assignment used as truth value.
- (abspath): Likewise.
- (shortpath): Likewise.
+ * haifa-sched.c (sched_analyze_insn): Only create scheduling
+ barriers for LOOP, EH and SETJMP notes on the loop_notes list.
- * regmove.c (fixup_match_1): Add parentheses around assignment
- used as truth value.
+ * mn10300.h (RTX_COSTS): Handle UDIV and UMOD too.
- * reload.c (push_secondary_reload): Remove unused variable `i'.
- (find_reloads): Add parentheses around assignment used as truth
- value.
+Wed Aug 26 16:35:37 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * reload1.c: Include stdlib.h.
+ * loop.c (check_dbra_loop): Add some code that would allow reversal
+ of some loops without a known constant loop end if it were enabled.
- * rtl.h: Correct typo in prototype of offsettable_memref_p.
-
- * stmt.c (add_case_node): Add parentheses around assignment used
- as truth value.
- (case_tree2list): Likewise.
-
- * tree.c (valid_machine_attribute): Wrap variable `decl_attr_list'
- in macro VALID_MACHINE_DECL_ATTRIBUTE. Wrap variable
- `type_attr_list' in macro VALID_MACHINE_TYPE_ATTRIBUTE.
- (merge_attributes): Add explicit braces to avoid ambiguous
- `else'.
-
- * unroll.c (copy_loop_body): Wrap variable `cc0_insn' in
- macro HAVE_cc0.
-
- * varasm.c: Include stdlib.h.
+Wed Aug 26 11:08:44 1998 Gavin Romig-Koch <gavin@cygnus.com>
+ * mips.md (lshrsi3_internal2+2): Fix type-o.
- * system.h: Remove sys/stat.h.
- * gcc.c: Add sys/stat.h.
+Wed Aug 26 10:53:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * genattr.c: Wrap prototype of `free' in NEED_DECLARATION_FREE.
+ * system.h: Include stdarg.h/varargs.h, make sure they are ordered
+ correctly with regards to stdio.h.
+
+ * calls.c: Remove stdarg.h/varargs.h.
+ * cccp.c: Likewise.
+ * cexp.y: Likewise.
+ * combine.c: Likewise.
+ * cpperror.c: Likewise.
+ * cpplib.c: Likewise.
+ * cpplib.h: Likewise.
+ * doprint.c: Likewise.
+ * emit-rtl.c: Likewise.
+ * final.c: Likewise.
+ * fix-header.c: Likewise.
+ * gcc.c: Likewise.
+ * genattr.c: Likewise.
* genattrtab.c: Likewise.
+ * gencodes.c: Likewise.
* genconfig.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
@@ -2906,5937 +2202,1660 @@ Sat Feb 28 07:54:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* genoutput.c: Likewise.
* genpeep.c: Likewise.
* genrecog.c: Likewise.
- * tlink.c: Likewise. Also wrap `getenv' in NEED_DECLARATION_GETENV.
-
-Fri Feb 27 11:02:47 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * invoke.texi: Use @itemx for a secondary item in a @table.
-
- * config/m68k/m68k.md (movsf+1): Optimize moving a CONST_DOUBLE
- zero.
-
-Thu Feb 26 00:13:21 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * choose-temp.c: Fix handling of sys/file.h to work in libiberty.
-
-Wed Feb 25 23:40:54 1998 Jeffrey A Law (law@cygnus.com)
-
- * i386.c (struct machine_function): Add new fields for PIC stuff.
- (save_386_machine_status): Fix argument to xmalloc. Save pic_label_rtx
- and pic_label_name.
- (restore_386_machine_status): Corresponding changes.
- (clear_386_stack_locals): Also clear pic_label_rtx and pic_label_name.
-
-Wed Feb 25 01:31:40 1998 Jeffrey A Law (law@cygnus.com)
-
- * c-parse.y (undeclared variable error): Tweak error message
- to be clearer.
-
-Tue Feb 24 23:54:07 1998 Richard Henderson <rth@cygnus.com>
-
- * flags.h (g_switch_value, g_switch_set): Declare.
- * alpha.c (override_options): Set g_switch_value=8 if not set.
- * alpha/elf.h (CC1_SPEC): New.
- (ASM_SPEC): New.
- (LINK_SPEC): Pass along the -G value we were given.
- (LOCAL_ASM_OP): Remove.
- (ASM_OUTPUT_ALIGNED_LOCAL): Output to .bss or .sbss by size.
- (MAX_OFILE_ALIGNMENT): New.
- (BSS_SECTION_ASM_OP, SBSS_SECTION_ASM_OP, SDATA_SECTION_ASM_OP): New.
- (EXTRA_SECTIONS): Add sbss and sdata.
- (SECTION_FUNCTION_TEMPLATE): New.
- (EXTRA_SECTION_FUNCTIONS): Use it.
- (CTORS_SECTION_FUNCTION, DTORS_SECTION_FUNCTION): Remove.
- (SELECT_SECTION): Use sdata when small enough.
- * alpha/linux.h (ASM_SPEC): Remove.
-
-
-Mon Feb 23 15:09:18 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
- * config.sub (sco5): Fix typo.
-
-Mon Feb 23 18:19:31 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * config/t-linux (LIBGCC1, CROSS_LIBGCC1, LIBGCC1_TEST): Add macros and
- set to empty.
- * config/t-linux-aout (LIBGCC1, CROSS_LIBGCC1, LIBGCC1_TEST): Likewise.
- * config/alpha/t-linux: Remove file.
- * config/sparc/t-linux: Remove file.
- * config/m68k/t-linux (LIBGCC1, CROSS_LIBGCC1): Remove.
- * config/m68k/t-linux-aout (LIBGCC1, CROSS_LIBGCC1): Likewise.
- * configure.in (alpha*-*-linux-gnulibc1*): Use t-linux instead of alpha/t-linux
- for tmake_file.
- (alpha*-*-linux-gnu*): Likewise.
- (sparc-*-linux-gnulibc1*): Use t-linux instead of sparc/t-linux for tmake_file.
- (sparc-*-linux-gnu*): Likewise.
-
-Mon Feb 23 10:47:39 1998 Robert Lipe <robertl@dgii.com>
- * collect2.c (ldd_file_name): Bracket declaration with same
- manifests as use.
- (full_real_ld_suffix): Deleted. Variable was calloced and
- written into, but never read.
-
-1998-02-23 Mike Stump <mrs@wrs.com>
-
- * configure.in: Add support for i386-wrs-vxworks configuration.
- * i386/vxi386.h: New file.
-
-Sun Feb 22 21:16:51 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * tree.c (contains_placeholder_p): Ensure function always returns
- a value.
- * sparc.md (movdi_sp64_insn): Add default case in enumeration switch.
- (movsf_const_insn, movdf_const_insn, movtf_const_insn): Likewise.
-
-Sun Feb 22 20:58:19 1998 Jeffrey A Law (law@cygnus.com)
-
- * vms.h (SELECT_SECTION): Use TREE_CODE_CLASS correctly.
-
-1998-02-22 Paul Eggert <eggert@twinsun.com>
-
- * config/sparc/sol2-sld.h (LINKER_DOES_NOT_WORK_WITH_DWARF2):
- Define this new symbol.
- (DWARF2_DEBUGGING_INFO, DWARF_DEBUGGING_INFO): Do not #undef.
- * toplev.c (main): Do not default to DWARF2_DEBUG with -ggdb if
- LINKER_DOES_NOT_WORK_WITH_DWARF2 is defined.
-
-Sun Feb 22 20:07:32 1998 Jim Wilson <wilson@cygnus.com>
-
- * iris5.h (DWARF2_UNWIND_INFO): Define to 0.
- * iris5gas.h (DWARF2_UNWIND_INFO): Define to 1.
-
-Sun Feb 22 15:29:48 1998 Richard Henderson <rth@cygnus.com>
-
- * objc/Object.m (-error): Call objc_verror with our va_list.
-
-Sun Feb 22 09:45:39 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * collect2.c (scan_prog_file): Completely cover uses of variable
- `exports' with macro COLLECT_EXPORT_LIST.
-
-Sat Feb 21 20:36:23 1998 Jeff Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Fri Feb 20 16:22:13 1998 Michael Meissner <meissner@cygnus.com>
-
- * sched.c (schedule_block): Remove code to get arguments from hard
- regs into pseudos early. Same as Aug 25, 1997 change to
- haifa-sched.c.
-
-1998-02-20 Jason Merrill <jason@yorick.cygnus.com>
-
- * collect2.c (main): Still handle !do_collecting for non-AIX targets.
-
-1998-02-16 Mark Mitchell <mmitchell@usa.net>
-
- * toplev.c (rest_of_compilation): Do not defer the output of a
- nested function.
-
-Fri Feb 20 10:39:47 1998 Michael Tiemann <michael@impact.tiemann.org>
-
- * ginclude/va-mips.h (va_arg): Remove trailing space after '\'
- continuation character (line 243).
-
-Fri Feb 20 12:10:26 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * genrecog.c (main): Remove duplicated sentence in emitted comment.
-
-Thu Feb 19 22:36:53 1998 Andrey Slepuhin <pooh@msu.net>
- David Edelsohn <edelsohn@mhpcc.edu>
-
- * collect2.c (XCOFF_SCAN_LIBS): Remove.
- (export_flag): New variable.
- (export_file): #ifdef COLLECT_EXPORT_LIST.
- (import_file, exports, imports, undefined): New variables.
- (libs, cmdline_lib_dirs, libpath_lib_dirs, libpath, libexts): Same.
- (dump_list, dump_prefix_list, is_in_list): New functions.
- (write_export_file): $ifdef COLLECT_EXPORT_LIST.
- (write_import_file, resolve_lib_name): New functions.
- (use_import_list, ignore_library): Same.
- (collect_exit): maybe_unlink import_file and #ifdef.
- (handler): Same.
- (main): New variable importf, #ifdef exportf. Move parsing of
- -shared before general argument parsing. Resolve AIX library
- paths and import libgcc.a symbols. Treat .so shared libraries the
- same as objects and .a libraries. Create alias for object_lst and
- increment it instead of original pointer. Scan AIX libraries as
- objects earlier instead of using scan_libraries. Perform AIX
- tlink later to resolve templates instead of forking ld.
- (GCC_OK_SYMBOL): Ensure symbol not in undef section.
- (GCC_UNDEF_SYMBOL): New macro.
- (scan_prog_file): Loop for members of AIX libraries. Handle
- export/import of ctors/dtors.
- (aix_std_libs): New variable.
- (scan_libraries, XCOFF): Delete.
-
-Thu Feb 19 22:36:52 1998 Robert Lipe <robertl@dgii.com>
-
- * collect2.c (full_real_ld_suffix): #ifdef CROSS_COMPILE.
-
-1998-02-19 Mike Stump <mrs@wrs.com>
-
- * Makefile.in: Use $tooldir for sys-include to match toplevel
- configure.
-
-Thu Feb 19 01:32:37 1998 Jeffrey A Law (law@cygnus.com)
- Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * emit-rtl.c (gen_lowpart_common): Suppress last change if __complex__.
-
- * emit-rtl.c (hard-reg-set.h): Include.
- (get_lowpart_common): Don't make new REG for hard reg in a
- class that cannot change size.
- * Makefile.in (emit-rtl.o): Depend on hard-reg-set.h.
-
- * combine.c: Revert previous patch.
-
-1998-02-19 Paul Eggert <eggert@twinsun.com>
-
- * config/sparc/sol2-sld.h: New file.
- * configure.in (sparc-*-solaris2*): Use it when using the
- system linker.
-
-Thu Feb 19 00:46:59 1998 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (force_movables): Fix typo.
-
-Thu Feb 19 08:26:30 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * m88k.h: Change file pattern to match reality.
-
-Wed Feb 18 23:19:52 1998 Jeffrey A Law (law@cygnus.com)
-
- * varasm.c (output_constant_pool): Fix dumb thinko in last
- change.
-
- * pa.h (ASM_OUTPUT_FUNCTION_PREFIX): Correctly translate from
- a function name to a section name.
-
-1998-02-18 Doug Evans <devans@cygnus.com>
-
- * tree.h (merge_machine_{type,decl}_attributes): Declare.
- (split_specs_attrs, strip_attrs): Add prototypes.
- * tree.c (merge_machine_{type,decl}_attributes): New functions.
- * c-decl.c (duplicate_decls): Call merge_machine_decl_attributes.
- Update olddecl's attributes too.
- * c-common.c (strip_attrs): New function.
- * c-typeck.c (common_type): Call merge_machine_type_attributes.
- * varasm.c (make_function_rtl): New target macro REDO_SECTION_INFO_P.
- (make_decl_rtl): Likewise.
-
-1998-02-18 Jim Wilson <wilson@cygnus.com>
-
- * c-decl.c (shadow_tag_warned): Call split_specs_attrs.
-
-Wed Feb 18 09:09:50 1998 Jeffrey A Law (law@cygnus.com)
-
- Remove this change until we can fix it correctly.
- * collect2.c: Bracket declaration of 'exportf' and
- 'full_real_ld_suffix'.
-
-Wed Feb 18 08:44:25 1998 Bernd Schmidt <crux@ohara.Informatik.RWTH-Aachen.DE>
-
- * Makefile.in (STAGESTUFF): Add genrtl.c, genrtl.h and gengenrtl.
-
-Tue Feb 17 23:30:20 1998 Bernd Schmidt <crux@ohara.Informatik.RWTH-Aachen.DE>
-
- * c-common.c (c_expand_start_cond, c_expand_end_cond,
- c_expand_start_else): Don't warn about non-ambiguous else even if
- braces are missing.
-
-Tue Feb 17 23:56:50 1998 Robert Lipe <robertl@dgii.com>
-
- * sco5.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
- ASM_OUTPUT_LONG_DOUBLE): Delete. Use the ones from i386.h
- instead.
-
-Tue Feb 17 22:56:14 1998 Richard Henderson <rth@cygnus.com>
-
- * combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when
- simplifying a subreg of a hard reg.
- (expand_compound_operation): Likewise.
- (force_to_mode): Likewise.
-
-Tue Feb 17 22:37:22 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * fold-const.c: Include "system.h" to get stdlib.h and stdio.h.
- (lshift_double): Add parentheses around + or - inside shift.
- (rshift_double): Likewise.
- (size_int_wide): Explicitly set type of `bit_p' to `int'.
-
- * Makefile.in (fold-const.o): Depend on system.h.
-
- * Makefile.in (gcc.o): Depend on system.h, in accordance with last
- change to gcc.c.
-
- * haifa-sched.c: Include "system.h" to get <stdlib.h> and <stdio.h>.
- (BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |.
- (sched_note_set): Remove unused parameter `b', all callers changed.
- (schedule_block): Likewise for `rgn'.
- (split_hard_reg_notes): Likewise for `orig_insn'.
- (check_live): Likewise for `trg'.
- (update_live): Likewise.
- (check_live_1): Explcitly declare variable `i' as int.
- (update_live_1): Likewise.
- (insn_issue_delay): Remove unused variable `link'.
- (sched_analyze_2): Add default case in enumeration switch.
- (schedule_insns): Remove unused variable `i'.
-
- * Makefile.in ($(SCHED_PREFIX)sched.o): Depend on system.h.
-
-Tue Feb 17 22:31:04 1998 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (rtx_equal_for_loop_p): Add some braces to disambiguate
- a dangling else clause.
-
-Tue Feb 17 21:28:12 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips/mips.h (CAN_ELIMINATE): Don't eliminate the frame
- pointer for the stack pointer in MIPS16 and 64BIT.
-
-Tue Feb 17 21:17:30 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * rtl.h (force_line_numbers, restore_line_number_status): Declare.
- * emit-rtl.c (force_line_numbers, restore_line_number_status):
- New functions.
- * stmt.c (struct nesting): Replace seenlabel with line_number_status.
- (expand_start_case): Adjust to this change.
- (check_seenlabel): New function.
- (pushcase, pushcase_range, expand_endcase): Use it.
-
-Tue Feb 17 10:14:32 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * i386.md (adddi3): Add =!r,0,0,X alternative.
-
-Mon Feb 16 16:13:43 1998 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (MY_ISCOFF): Add numeric value of U803XTOCMAGIC.
- * x-aix31 (INSTALL): Delete.
-
-Mon Feb 16 09:24:32 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips/mips.c (mips_expand_epilogue): Update tsize_rtx if
- tsize changes to something other than zero.
-
-Mon Feb 16 09:11:48 1998 Gavin Koch <gavin@cygnus.com>
-
- * ginclude/va-mips.h: Replace casts of pointers to int with
- casts of pointers to __PTRDIFF_TYPE__.
-
-Mon Feb 16 08:17:14 1998 John Carr <jfc@mit.edu>
-
- * loop.c (strength_reduce, record_biv, record_giv): Use
- HOST_WIDE_INT_PRINT_DEC to print CONST_INT values.
-
-1998-02-16 Jason Merrill <jason@yorick.cygnus.com>
-
- * tree.c (first_rtl_op): New fn.
- (unsave_expr_now): Use it.
- * print-tree.c (print_node): Likewise.
- * tree.c (has_cleanups): New fn.
- * fold-const.c (fold, case CLEANUP_POINT_EXPR): Use it. Be more
- conservative about pushing the cleanup point down.
- * tree.h: Declare them.
-
-Sun Feb 15 23:28:44 1998 Jeffrey A Law (law@cygnus.com)
-
- * toplev.c (flag_schedule_reverse_before_reload): Delete variable.
- (flag_schedule_reverse_after_reload): Likewise.
- (f_options): Remove reverse scheduling support.
- * flags.h (flag_schedule_reverse_before_reload): Delete declaration.
- (flag_schedule_reverse_after_reload): Likewise.
- * haifa-sched.c (rank_for_schedule): Remove support for reverse
- scheduling.
-
-Sun Feb 15 21:33:55 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * gcc.c: Get system includes, prototypes and macros via "system.h"
- instead of doing it manually. Change all calls of the ctype
- macros to custom versions defined in "system.h".
-
- * system.h: Fix return type of bcmp prototype from `void' to `int'.
- Make bcopy, bcmp and bzero prototypes explicitly `extern'.
- Add a prototype for getenv.
-
-Sun Feb 15 17:05:41 1998 Jim Wilson <wilson@cygnus.com>
-
- * mips/mips.h (INITIAL_ELIMINATION_OFFSET): Readd Jun 6 change.
-
-Sun Feb 15 15:23:15 1998 John Carr <jfc@mit.edu>
-
- * alias.c: Include <stdlib.h> and <string.h>.
- (init_alias_analysis): Pass NULL_RTX instead of 0 to record_set.
-
-Sat Feb 14 11:23:09 PST 1998 Jeff Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Sat Feb 14 05:08:21 1998 Richard Earnshaw (rearnsha@arm.com)
-
- * arm.md (movsfcc): Also validate operands[3] when compiling hard
- float.
- (movdfcc): Only accept fpu_add_operand for operands[3].
-
- * arm/t-semi (STMP_FIXPROTO): Define to nothing.
- * arm/t-semiaof (STMP_FIXPROTO): Likewise.
-
-Sat Feb 14 02:02:41 1998 Jeffrey A Law (law@cygnus.com)
-
- * varasm.c (output_constant_pool): Bring back 'done' label inside
- an appropriate #ifdef.
-
- * bitmap.c (bitmap_element_allocate): Wrap variable 'i' in an
- appropriate #ifdef.
- (bitmap_copy, bitmap_operation): Likewise.
- * combine.c (combinable_i3pat): Similarly for 'src'.
- * function.c (fixup_var_refs_1): Similarly for 'outerdest'.
- (locate_and_pad_parm): Similarly for 'reg_parm_stack_space'.
- * regclass.c (copy_cost): Similarly for 'secondary_class'.
- * reload.c (make_memloc): Simliarly for 'i'.
- (find_reloads_address_1): Similarly for 'link'.
- * reload1.c (reload): Similarly for 'previous_frame_pointer_needed'.
- (emit_reload_insns): Similarly for 'second_reloadreg'.
- * unroll.c (iteration_info): Similarly for 'v'.
-
- * caller-save.c (insert_save_restore): Remove unused variable 'i'.
- * calls.c (expand_call): Similarly for 'i'.
- (emit_library_call, emit_library_call_value): Similarly for 'mode'.
- * fold-const.c (strip_compund_expr): Similarly for 'type'.
- * function.c (fixup_var_refs_1): Similarly for 'width'.
- (fixup_memory_subreg): Similarly for 'saved'.
- (locate_and_pad_parm): Similarly for 'boundary_in_bytes.'
- (setjmp_protect): Similarly for 'sub'.
- (thread_prologue_and_epilogue_insns): Similarly for 'insn'.
- * loop.c (record_giv): Similarly for 'p'.
- (combine_givs): Similarly for 'temp_iv'.
- (indirect_jump_in_function_p): Similarly for 'is_indirect_jump'.
- * recog.c (validate_replace_rtx_1): Similarly for 'width'.
- * tree.c (get_set_constructor_bytes): Similarly for 'vals'.
- * unroll.c (unroll_loop): Similarly for 'copy'.
- (iteration_info): Similarly for 'b'.
- * varasm.c (assemble_string): Similarly for 'i'.
- * i386.h (LEGITIMIZE_ADDRESS): Similarly for 'orig_x'.
-
-1998-02-13 Martin von Loewis <loewis@informatik.hu-berlin.de>
-
- * c-lang.c (lang_print_xnode): New function.
- * objc/objc-act.c (lang_print_xnode): Likewise.
- * print-tree.c (print_node): Call it
-
-Fri Feb 13 14:38:34 1998 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (decl_scope_node): New type.
- (decl_scope_table): Change type to use it.
- (decl_scope_table_allocated, decl_scope_depth): Change type to int.
- (push_decl_scope): Use new type. New locals containing_scope, i.
- Add code to handle setting previous field.
- (scope_die_for): Change type of local i to int. Add code to use
- previous field.
- (dwarf2out_init): Use new type.
-
-1998-02-13 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c (emit_throw): Lose throw_used.
-
-Fri Feb 13 20:36:05 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sched.c (update_flow_info, REG_WAS_0): Ignore if setting insn
- was deleted.
- * haifa-sched.c (update_flow_info, REG_WAS_0): Likewise.
-
-Fri Feb 13 12:18:40 1998 Jeffrey A Law (law@cygnus.com)
-
- * genextract.c (main): Fix typo.
-
-Fri Feb 13 08:41:49 1998 Robert Lipe <robertl@dgii.com>
-
- * c-lang.c (finish_file): Bracket declaration of static_ctors,
- static_dtors.
-
- * calls.c (expand_call): Bracket declaration of 'rtx_before_call',
- 'old_stack_arg_under_construction'
- (emit_library_call): Bracket declaration of 'upper_bound',
- 'lower_bound', 'i', 'reg_parm_stack_space'
- (emit_library_call_value): Likewise.
- (store_one_arg):
-
- * collect2.c: include <unistd.h> when appropriate.
- Bracket declaration of 'exportf' and 'full_real_ld_suffix'.
-
- * emit-rtl.c (prev_cc0_setter): Remove unused variable 'link'.
-
- * explow.c (plus_constant_for_output_wide): Remove unused variable
- 'code'.
- (memory_address): Remove unused variable 'orig_x'.
-
- * genattrtab.c (make_canonical): Remove unreferenced label 'cond:'.
- (write_const_num_delay_slots): Remove unused variable 'i'.
-
- * genopinit.c (main): Remove unused variables 'dummy', 'insn_ptr'.
- (gen_insn): Remove unused variable 'obstack_ptr'.
-
- * libgcc2.c (__bb_exit_func): Remove unused variables 'ret',
- 'j', 'tmp', 'i'.
- (__bb_exit_trace_func): Remove unused variable 'e'.
-
- * optabs.c (expand_binop): remove unused variables 'lhs', 'rhs',
- 'funexp'.
- (expand_unop): Remove unused variable 'funexp'.
- (expand_complex_abs): Remove unused variable 'funexp'.
- (init_optabs): Bracket declaration of 'j'.
- (init_complex_libfuncs): Deleted. Dead static function.
-
- * profile.c (branch_prob): Remove unused variables 'insn', 'dest'.
-
- * reg-stack.c: Fix typo in proto for 'get_asm_operand_lengths'
- (reg_to_stack): 'initialized', 'before_function_beg'
- explictly type as ints instead of defaulting.
- (emit_swap_insn): Remove unused variable 'i2'.
- (compare_for_stack_reg): Remove unused variable 'src_note'.
-
- * rtlanal.c (computed_jump_p): Remove unused variable 'computed_jump'.
-
- * sched.c (actual_hazard): Bracket declaration of 'this_cost'.
-
- * stmt.c (add_case_node): Add parens for assignment used as truth.
- (all_cases_count): Remove unused variable 'count_high'.
- (mark_seen_cases): Remove unused variable 'i'.
- (check_for_full_enumeration_handling): Remove unused variable 't'.
- Bracket declaration of 'all_values', 'l'.
-
- * tlink.c: Include <stdlib.h>, <unistd.h>, <string.h>/<strings.h>.
-
- * varasm.c (assemble_string): Remove unused variable 'i'.
- (immed_double_const): Remove unused variable 'in_current_obstack'.
- (immed_real_const_1): Likewise.
- (output_constant_pool): Remove unreferenced label 'done'.
- (output_constant): Remove unused variable 'x'.
-
- * i386/i386.h (ENCODE_SECTION_INFO): TREE_PUBLIC is an int, not
- a string.
-
- * i386/sco5.h (ASM_OUTPUT_ASCII): Add parens for assignment used
- as truth.
-
-Fri Feb 13 10:21:41 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * combine.c (can_combine_p): Handle USEs in PARALLELs.
-
-Fri Feb 13 01:34:14 1998 H.J. Lu (hjl@gnu.org)
-
- * config/linux.h (LIB_SPEC): Add -lc for -shared if
- USE_GNULIBC_1 is not defined.
- * config/sparc/linux.h; Ditto.
-
- * config/sparc/linux64.h (LIB_SPEC): Add -lc for -shared.
-
- * config/alpha/linux-elf.h (LIB_SPEC): New. Defined if
- USE_GNULIBC_1 is not defined.
-
-Fri Feb 13 01:29:29 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
-
- * rs6000/sysv4.h (ENDFILE_SPEC): add missing %(endfile_linux)
- for -mcall-linux
-
-Fri Feb 13 01:23:46 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * system.h: New file to get common systems includes and various
- definitions and declarations based on autoconf macros.
-
-Fri Feb 13 00:46:19 1998 Jeffrey A Law (law@cygnus.com)
-
- * cccp.c (new_include_prefix): Correctly handle -I./.
-
-Thu Feb 12 20:16:35 1998 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md: Replace gen_rtx (CONST_INT,...) with GEN_INT.
-
-Thu Feb 12 16:45:17 1998 Robert Lipe <robertl@dgii.com>
-
- * expr.c (expand_assignment): Correct typo exposed by -Wall.
- offset should have been a truth value, not an assignment.
-
-Thu Feb 12 15:26:50 1998 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (delete_dead_from_cse): If a libcall produces a constant
- result and that result can be substituted into SET_SRC of the
- insn with the REG_RETVAL note, then perform the substitution
- and delete the libcall.
-
-Thu Feb 12 14:04:09 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips.md (trucndihi2,truncdiqi2): Change these to support
- mips16.
-
-Thu Feb 12 11:34:55 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips/mips.c (movdi_operand): Direct referances to symbols
- that arn't mips16 consts in mips16 mode arn't valid operands.
-
- * mips/mips.c (mips_move_2words): Add gprel handling.
-
-Thu Feb 12 11:18:37 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips.md (extendsidi2): Allow extension to/from a non-mips16
- register.
-
-Thu Feb 12 00:04:16 1998 Marc Lehmann <pcg@goof.com>
-
- * i386.c: Conditionally include <stdlib.h>, <string.h>, and
- <strings.h>.
-
-Wed Feb 11 11:43:34 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (WARN_CFLAGS): New variable.
- (bootstrap, bootstrap2, bootstrap3, bootstrap4): Use it.
-
-1998-02-11 Mark Mitchell <mmitchell@usa.net>
-
- * config/i386/i386.c (reg_mentioned_in_mem): Don't abort when
- falling through default case in switch.
- (i386_aligned_p): Likewise.
-
-Wed Feb 11 12:59:56 1998 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * mips/mips.h (mips_abi_string): Correct typo in comment.
-
-Wed Feb 11 08:29:56 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips/mips.md (movdi): These PLUS's need to be Pmode.
-
-Wed Feb 11 01:47:54 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (dwarf2out.o, emit-rtl.o, jump.o, cse.o, unroll.o,
- reorg.o, regmove.o): Depend on insn-codes.h, it gets included
- indirectly via expr.h.
-
-Wed Feb 11 01:44:13 1998 Richard Henderson <rth@cygnus.com>
-
- * stor-layout.c (layout_type): Do upper - lower in the native type,
- so as to properly handle negative indices.
-
-Wed Feb 11 01:35:55 1998 Robert Lipe <robertl@dgii.com>
-
- * except.c (start_dynamic_cleanup): Remove unused variable 'dhc'.
- (expand_eh_region_start_tree): Remove unused variable 'note'.
- (exception_optimize): Remove unused variable 'regions'.
- (expand_builtin_eh_stub): Remove unused variable 'temp'.
- (copy_eh_entry): Deleted. Dead function.
-
- * expr.c (move_block_to_reg) Bracket declaration of 'pat' and
- 'last' with same #if HAVE_load_multiple as use of it.
- (move_block_from_reg): Likewise.
- (emit_move_insn_1): Remove unused variable 'insns'.
- (store_constructor): Bracket declaration of startb, endb with
- #if TARGET_MEMFUNCTIONS. Remove unused variables 'set_word_size'
- 'target', and 'xtarget'.
- (expand_builtin_setjmp): Remove unused variables 'op0',
- 'next_arg_reg', 'old_inhibit_defer_pop'.
- (expand_builtin): Remove unused variable 'offset'.
- (do_store_flag): Remove unused variables 'pattern', 'jump_pat'.
- (emit_queue): Add parens for assignment used as conditional.
- (expand_expr): case TARGET_EXPR: Remove unused variable 'temp'.
-
-Wed Feb 11 01:30:49 1998 Marc Lehmann <pcg@goof.com>
-
- * i386.c: Added include for recog.h.
- (override_options): Removed unused variable p. Initialized regno to
- avoid warning.
- (order_regs_for_local_alloc): Initialized regno to avoid warning.
- (legitimize_address): Likewise for 'other'.
- (i386_aligned_reg_p): Added default case with abort ().
- (print_operand): Likewise.
- (reg_mentioned_in_mem): Likewise.
- (ix86_expand_binary_operator): Removed unused variables i & insn.
- (ix86_expand_unary_operator): Removed unused variable insn.
- (output_fp_cc0_set): Removed unused variable unordered_label.
-
-Wed Feb 11 01:23:03 1998 John F. Carr <jfc@mit.edu>
-
- * i386.c, i386.h, i386.md: Change gen_rtx (X, ...) to gen_rtx_X (...).
- Use GEN_INT instead of gen_rtx (CONST_INT). Make printf arguments
- and format string match.
-
-Wed Feb 11 01:17:39 1998 Jeffrey A Law (law@cygnus.com)
-
- * flow.c (life_analysis): Do not conside the stack pointer live at
- the end of a function if the fucntio ncalls alloca.
- (mark_used_regs): Similarly.
-
-1998-02-10 John F Carr <jfc@mit.edu>
-
- * config/sparc/sparc.md (movdi_v8plus): Output stx on alternative
- 1, fzero on alternative 8.
-
-Tue Feb 10 09:02:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * rs6000.c (setup_incoming_varargs): Always set rs6000_sysv_varargs_p.
-
-Tue Feb 10 03:35:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical
- SUBREGs of CONST_INTs.
-
-Mon Feb 9 17:52:36 1998 John Carr <jfc@mit.edu>
-
- * mips.c (print_operand, function_prologue): Make printf format
- match argument type.
-
-Mon Feb 9 02:37:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * alpha.c (alpha_return_addr): Remove unused variable `first'.
- (alpha_ra_ever_killed): Remove unused variables `ra' and `i'.
- (output_epilog): Remove unused variable `frame_size_from_reg_save'.
-
-Sun Feb 8 14:56:03 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * loop.c (strength_reduce): When placing increment for auto-inc
- case, do comparison in loop order.
-
-Sun Feb 8 13:21:38 1998 John Carr <jfc@mit.edu>
-
- * bitmap.c (bitmap_debug_file): HOST_PTR_PRINTF converts a pointer,
- not a HOST_WIDE_INT.
-
- * calls.c (expand_call): Change test of expand_inline_function
- return value to stop compiler warning.
-
- * genattrtab.c (RTL_HASH): Cast pointer to long, not HOST_WIDE_INT.
-
-Sun Feb 8 12:04:24 1998 Jim Wilson (wilson@cygnus.com)
- Jeff Law (law@cygnus.com)
-
- * regmove.c: Fix various minor formatting problems.
- (optimize_reg_copy_1): Stop search at CALL_INSNs if flag_exceptions
- is true. Make end of basic block tests consistent through regmove.c.
- (optimize_reg_copy_2, optimize_reg_copy_3): Likewise.
- (fixup_match_2, fixup_match_1, regmove_optimize): Likewise.
-
-Sun Feb 8 01:49:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * gansidecl.h: Check for a conflicting macro definition before
- attempting to prototype bcopy, bcmp or bzero.
-
-Sun Feb 8 00:09:59 1998 Jeffrey A Law (law@cygnus.com)
-
- * expr.c (clear_pending_stack_adjust): Handle case where a function
- calls alloca, but the user has specified -fomit-fframe-pointer.
-
- * function.c (assign_parms): Fix typo in last change.
-
-Sat Feb 7 23:54:29 1998 Robert Lipe <robertl@dgii.com>
-
- * gcc.c: Include <strings.h>/<string.h>, <stdlib.h>, <unistd.h>,
- <fcntl.h>.
- (free_path_suffix): Remove unreferenced static function.
- (process_command): Remove unused variable temp.
- (default_arg): Remove unused variable i.
- (do_spec_1): Add parens for assignment used as truth value.
- (main): Likewise.
- (validate_all_switches): Likewise.
- (main): Remove unused variables i, first_time>
-
- * c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
-
- * calls.c (expand_call): Remove unused variables funtree,
- n_regs, and tmpmode.
-
- * dbxout.c, except.c: Include <string.h>/<strings.h>.
-
- * explow.c: (plus_constant_for_output_wide) Removed unused
- variable all_constant.
-
- * c-decl.c, genattr.c, genattrtab.c, getconfig.c, genemit.c
- genextract.c, genflags.c, genopinit.c genoutput.c, genpeep.c,
- genrecog.c, global.c, integrate.c , stupid.c : Include
- <stdlib.h>.
-
- * genextract.c: (walk_rtx) Remove unused variable link.
-
- * genrecog.c: (concat) Remove unreferenced static function.
-
- * prefix.c: Include <string.h>/<strings.h>, <stdlib.h>
-
- * stmt.c: Include <stdlib.h>.
- (expand_asm_operands): Remove unused variable val1.
- (expand_return): Remove unused variable block.
- (pushcase): Remove unused variables l and n.
- (pushcaserange): Likewise.
-
- * unroll.c (unroll_loop): Remove unused variable temp.
-
-Sat Feb 7 23:46:09 1998 Greg McGary <gkm@gnu.org>
-
- * c-decl.c (pushdecl): Set DECL_ORIGINAL_TYPE once only.
-
-Sat Feb 7 15:11:28 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * aclocal.m4 (GCC_FUNC_PRINTF_PTR): New macro to test the printf
- functions for whether they support the %p format specifier.
- * acconfig.h (HOST_PTR_PRINTF): Insert stub for autoconf.
- * configure.in (GCC_FUNC_PRINTF_PTR): Use it.
- * configure, config.in: Rebuild.
-
-Fri Feb 6 14:20:16 1998 Jim Wilson <wilson@cygnus.com>
-
- * function.c (assign_parms): New variable named_arg, with value
- depending on STRICT_ARGUMENT_NAMING. Use instead of ! last_named.
-
-Fri Feb 6 14:34:28 1998 Gavin Koch <gavin@cygnus.com>
-
- * mips/t-r3900: New - same as t-ecoff but eliminate
- multilibs: mips1 and mips3.
- * configure.in (tx39*): Use new mips/t-r3900.
- * configure: Rebuild.
- * mips/r3900.h (MULTILIB_DEFAULTS): Eliminate mips1.
-
-1998-02-06 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c: Add old_args_size.
- (dwarf2out_args_size): Use it.
- (dwarf2out_begin_prologue): Initialize it.
- (dwarf2out_stack_adjust): If !asynchronous_exceptions, save up
- pushed args until we see a call.
- * final.c (final_scan_insn): Hand CALL_INSNs off to the dwarf2 code
- before outputting them.
-
-1998-02-06 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
-
- * cplus-dem.c (demangle_template_template_parm): New function.
- (demangle_template): Handle template template parameters.
-
-1998-02-02 Mark Mitchell <mmitchell@usa.net>
-
- * calls.c (expand_call): Don't confuse member functions named
- realloc, setjmp, and so forth with the standard library
- functions of the same names.
-
-Thu Feb 5 21:59:49 1998 Jeffrey A Law (law@cygnus.com)
-
- * stmt.c (expand_asm_operands): Correctly identify asm statements
- no output operands.
-
-Thu Feb 5 21:56:06 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * c-common.c (decl_attributes): Flag unrecognized attribute
- functions as warnings instead of as errors.
-
-1998-02-05 Marc Lehmann <pcg@goof.com>
-
- * integrate.c (INTEGRATE_THRESHOLD): Inline only small functions
- when -Os is specified.
- * toplev.c (main): Don't disable flag_inline_functions anymore when
- -Os is in effect.
-
-Fri Feb 6 00:27:36 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * regmove.c: Update.
- * flags.h (flag_regmove): Declare.
- * rtl.h (optimize_reg_copy_1, optimize_reg_copy_2): Don't declare.
- * local-alloc.c (optimize_reg_copy_1, optimize_reg_copy_2):
- Moved into regmove; changed caller.
- * toplev.c (rest_of_compilation): Call regmove_optimize also for
- expensive_optimizations.
-
-Thu Feb 5 13:38:42 PST 1998 Jeff Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Thu Feb 5 01:45:19 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- Undo this change (the problem was actually in reload):
- Fri Jan 23 23:28:59 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (movqi_i+1): New peephole.
-
-Tue Feb 3 01:11:12 1998 Jeffrey A Law (law@cygnus.com)
-
- * jump.c (jump_optimize): Lose calls to modified_in_p they are
- not needed anymore due to changes elsewhere in jump.c.
-
- * jump.c (jump_optimize): Fix first arg to modified_in_p in
- previous change.
-
-Mon Feb 2 19:18:14 1998 Richard Henderson <rth@cygnus.com>
-
- * expr.c (expand_builtin_setjmp): Accept two new arguments for
- the labels to branch to on first and subsequent executions. Don't
- play with __dummy. Rename `setjmp' insn to `builtin_setjmp_setup',
- and provide it with the jmp_buf. Use only one of
- `builtin_setjmp_receiver' or `nonlocal_goto_receiver',
- and provide the former with the target label.
- (expand_builtin) [BUILTIN_SETJMP]: Generate a label for use by setjmp.
- (expand_builtin) [BUILTIN_LONGJMP]: Split out to ...
- (expand_builtin_longjmp): ... here. Recognize a `builtin_longjmp'
- insn to replace all of the normal nonlocal_goto code. Don't play
- with __dummy. Correct arguments to nonlocal_goto.
- * expr.h (expand_builtin_setjmp): Update prototype.
- * except.c (start_dynamic_handler): When using builtin_setjmp,
- generate more accurate flow information.
-
- * alpha.md (nonlocal_goto_receiver_osf): Delete.
- (nonlocal_goto_receiver_vms): Rename to nonlocal_goto_receiver.
- (builtin_longjmp, builtin_setjmp_receiver): New.
- * sparc.md (update_return): Disambiguate unspec number.
- (nonlocal_goto): Rearrange arguments to match caller in except.c.
- (builtin_setjmp_setup): Rename from setjmp. Match and ignore the
- jmp_buf operand.
- * mips.md (nonlocal_goto_receiver, builtin_setjmp_receiver): Remove.
- (builtin_setjmp_setup*, builtin_longjmp): New.
-
-Mon Feb 2 16:43:10 1998 John Carr <jfc@mit.edu>
-
- * mips.md: Change gen_rtx (CONST_INT) to GEN_INT.
-
-Mon Feb 2 13:06:47 1998 Jim Wilson <wilson@cygnus.com>
-
- * vmsconfig.com: Remove bytecode references.
-
-1998-01-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * dwarf2out.c (dwarf2out_frame_init): Undo last change, so that
- -fno-sjlj-exceptions works for a target that defines
- DWARF2_UNWIND_INFO as zero.
-
- * regmove.c (fixup_match_1): Undo last change which removed some
- "useless" code, and add a comment explaining this.
-
-Mon Feb 2 10:47:14 1998 Gavin Koch (gavin@cygnus.com)
-
- * mips.c (mips_expand_prologue): Change uses of TARGET_64BIT
- to TARGET_LONG64.
-
-Mon Feb 2 10:38:41 1998 Klaus Kaempf <kkaempf@progis.de>
-
- * makefile.vms: Remove bytecode references.
- Create genrtl files.
-
-Mon Feb 2 02:08:04 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * jump.c (jump_optimize): Allow conditional loading of floating point
- constants and constants from memory. Reinstalled modified_in_p tests.
-
-Mon Feb 2 01:38:39 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * loop.c (get_condition): Handle sign-extended constants.
-
-Mon Feb 2 01:22:46 1998 Hans-Peter Nilsson <hp@axis.se>
-
- * expr.c (emit_push_insn): Add code to use movstrti if present.
-
- * expr.c (emit_push_insn): Use same max-move-amount for movstrhi
- and movstrqi as in emit_block_move ().
-
-Mon Feb 2 00:09:52 1998 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * config/m68k/x-next: Remove /NextDeveloper/Headers from
- the directories to fixinclude - /usr/include is a link
- to it and hence its contents are fixed by default.
-
-Sun Feb 1 14:15:33 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
-
- * rs6000/linux.h: define JUMP_TABLES_IN_TEXT_SECTION
-
-Sun Feb 1 13:01:15 1998 Klaus Kaempf <kkaempf@progis.de>
-
- * cccp.c (main): Predefine __VMS_VER on VMS.
-
-Sun Feb 1 12:39:53 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * expr.c (get_inner_reference): Use sbitsizetype for type sizes.
- * fold-const.c (size_int): Replace with
- (size_int_wide).
- (make_bit_field_ref): Use bitsize_int for bit position.
- * stor-layout.c (sizetype): Delete.
- (sizetype_tab, sbitsizetype, ubitsizetype): Declare.
- (layout_record, layout_union, layout_type):
- Use bitsize_int for bit size.
- (set_sizetype): New function.
- (make_signed_type, make_unsigned_type): Use it.
- * c-decl.c (init_decl_processing): Likewise.
- * tree.h (size_int): Don't delcare, #define.
- (size_int_wide, sizetype_tab, sbitsize, ubitsize): Declare.
- (set_sizetype): Declare.
- (bitsize_int, size_int_2, BITS_PER_UNIT_LOG, sizetype, bitsizetype):
- Define.
- * c-typeck.c (c_sizeof, c_sizeof_nowarn, c_size_in_bytes):
- Convert result to sizetype.
- (really_start_incremental_init, push_init_level):
- Set type of constructor_bit_index to sbitsizetype.
- (push_init_level): Use unsigned arithmetic to determine padding.
- (output_init_element): Likewise.
-
-Sun Feb 1 03:32:07 1998 Jeffrey A Law (law@cygnus.com)
-
- * combine.c (simplify_shift_const): Fix typo in last change.
-
-Sun Feb 1 02:50:46 1998 John Carr <jfc@mit.edu>
-
- * combine.c (simplify_shift_const): (lshiftrt (truncate (lshiftrt)))
- is (truncate (lshiftrt)).
-
-Sun Feb 1 01:06:53 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_expand_unaligned_load): Use expand_binop properly.
- Make sure result winds up in TGT.
- (alpha_expand_unaligned_store): Use expand_binop properly. Allow
- src to be other than DImode.
- (alpha_expand_unaligned_load_words): Tidy. Take an offset argument.
- (alpha_expand_unaligned_store_words): Likewise.
- (alpha_expand_block_move): Use REGNO_POINTER_ALIGN. Restructure so
- that source and destination are separately optimized for alignment.
- (alpha_expand_block_clear): Use REGNO_POINTER_ALIGN.
-
-Sun Feb 1 01:55:09 1998 Jeffrey A Law (law@cygnus.com)
-
- * mips.md (adddi3_internal_2): Be consistent with adddi3 expander
- with handling of -32768.
-
-Sun Feb 1 01:48:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * aclocal.m4 (GCC_NEED_DECLARATION): Modify macro to accept a
- shell variable argument instead of only hard coded functions.
- (GCC_NEED_DECLARATIONS): New macro to accept multiple functions.
-
- * configure.in: Collapse multiple calls to AC_CHECK_FUNCS into one
- call. Collapse multiple calls to GCC_NEED_DECLARATION into one
- call to GCC_NEED_DECLARATIONS (new macro.) Check if we need
- declarations for bcopy, bcmp and bzero.
-
- * acconfig.h: Add stubs for bcopy, bcmp and bzero declarations.
-
- * gansidecl.h: If we have bcopy but don't declare it, then do so.
- Likewise for bcmp and bzero. Only define macros for bcopy, bcmp,
- bzero, index and rindex if they aren't already present.
-
-Sat Jan 31 11:26:58 1998 Jeffrey A Law (law@cygnus.com)
-
- * toplev.c (close_dump_file): Wrap function prototype for
- argument "func" in PROTO.
- (dump_rtl): Likewise.
-
-Fri Jan 30 22:30:39 1998 John Carr <jfc@mit.edu>
-
- * sparc.c (sparc_override_options): Make v8plus and ultrasparc set
- MASK_V8PLUS.
- (output_function_epilogue): Omit epilogue if nothing drops through.
- (output_move_double): Supress int ldd usage on ultrasparc and v9.
- (registers_ok_for_ldd_peep): Likewise.
- (print_operand): Supress b,a on ultrasparc. Let Y accept a constant.
- (ultrasparc_adjust_cost): New function.
- (sparc_issue_rate): New function.
- * sparc.h (MASK_VIS, TARGET_VIS): New
- (MASK_V8PLUS, TARGET_V8PLUS): New.
- (TARGET_HARD_MUL32, TARGET_HARD_MUL): New.
- (TARGET_SWITCHES): Add vis and v8plus.
- (REG_CLASS_FROM_LETTER): Accept d and b for VIS.
- (REGISTER_MOVE_COST): FP<->INT move cost 12 for ultrasparc.
- (RTX_COSTS): Use TARGET_HARD_MUL
- (ADJUST_COST): Call ultrasparc_adjust_cost.
- (ISSUE_RATE): New.
- * sparc.md (attr type): Add sload, fpmove, fpcmove. Adjust users
- of load & fp appropritely.
- (supersparc function units): Adjust for Haifa.
- (ultrasparc function units): Likewise.
- (get_pc_via_rdpc): All v9, not just arch64.
- (movdi_v8plus, movdi_v8plus+1): New.
- (adddi3_sp32+1): New.
- (subdi3_sp32+1): New.
- (movsi_insn, movsf_const_insn, movdf_const_insn): Know VIS.
- (addsi3, subsi3, anddi3_sp32, andsi3, and_not_di_sp32): Likewise.
- (and_not_si, iordi3_sp32, iorsi3, or_not_di_sp32, or_not_si): Likewise.
- (xorsi3_sp32, xorsi3, xor_not_di_sp32, xor_not_si): Likewise.
- (one_cmpldi2_sp32, one_cmplsi2): Likewise.
- (ldd peepholes): Suppress for v9.
- (return_adddi): Kill redundant test. Arg1 may be arith_operand.
- (return_subsi): Revmove.
-
-Fri Jan 30 18:30:03 1998 John F Carr <jfc@mit.edu>
-
- * mips.c (save_restore_insns): Set RTX_UNCHANGING_P in register
- save/restore MEM rtl.
-
-Fri Jan 30 09:08:16 1998 Jeffrey A Law (law@cygnus.com)
-
- * configure.in: Check for declaration of abort.
- * acconfig.h: Corresponding changes.
- * toplev.c: Use NEED_DECLARATION_ABORT to determine if abort should
- be declared.
-
-Thu Jan 29 20:26:12 1998 Jeffrey A Law (law@cygnus.com)
-
- * genattrtab.c (optimize): Define in case PRESERVE_DEATH_INFO_REGNO_P
- uses it.
-
-Thu Jan 29 09:27:56 PST 1998 Jeff Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Thu Jan 29 10:12:27 1998 Jeffrey A Law (law@cygnus.com)
-
- * configure.in: Check for atoq and atoll.
- * rtl.c (read_rtx): Use HAVE_ATOLL and HAVE_ATOQ to select the
- proper routine for converting ascii into long long values.
-
-Thu Jan 29 01:28:14 1998 Klaus Kaempf <kkaempf@progis.de>
-
- * cccp.c (SYS$SEARCH, SYS$PARSE): Write as upper-case.
-
- * vmsconfig.com: Remove bytecode references.
-
- * alpha/vms.h (PREFIX): Define.
-
- * alpha/vms.h (ASM_OUTPUT_ALIGNED_COMMON): Remove.
-
- * am-alpha.h: Don't include alloca for OPEN_VMS.
-
- * alpha/xm-vms.h (HAVE_CPP_STRINGIFY): Define.
-
- * alpha/xm-vms.h (INCLUDE_DEFAULTS): Define.
- (GCC_INCLUDE_DIR): Define
-
- * make-cc.com, make-cccp.com, make-cc1.com: Removed.
- * makefile.vms: New file.
-
- * alpha/vms.h (CPP_PREDEFINES): Remove -Dalpha.
-
- * alpha.c (output_prolog): Output '.name' directive
- for minimal traceback information.
-
- * alpha.c (output_prolog): Don't prepend entry point symbols
- with '$' on OPEN_VMS.
-
-Thu Jan 29 00:25:35 1998 David S. Miller <davem@tanya.rutgers.edu>
- Jeffrey A Law (law@cygnus.com)
-
- * rtl.c (read_rtx): Use atol/atoq based upon disposition of
- HOST_WIDE_INT.
-
- * genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC
- as needed.
- * genemit.c (gen_exp): Likewise.
- * genpeep.c (match_rtx): Likewise.
- * genrecog.c (write_tree_1): Likewise.
-
- * c-lex.c (yyprint): Use proper format string based upon
- disposition of HOST_BITS_PER_WIDE_INT.
- (yylex): Put casts in right place for args to build_int_2.
-
-Thu Jan 29 00:24:29 1998 Jeffrey A Law (law@cygnus.com)
-
- * combine.c: Fix typos in Jan27 changes.
-
-Thu Jan 29 00:07:49 1998 Ollivier Robert <roberto@keltia.freenix.fr>
-
- * i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends.
- (LINK_SPEC): Likewise.
- (STARTFILE_SPEC): Likewise.
-
-1998-01-28 Mike Stump <mrs@wrs.com>
-
- * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after
- reload completes.
- * genattrtab.c (reload_completed): Define.
-
- * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Remove obsolete
- comments.
-
-Wed Jan 28 20:11:06 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
- SUBREG_REG if the word count is unchanged, also in the input reload
- case. Disable non-applicable sanity checks.
-
-Wed Jan 28 20:08:26 1998 Jeffrey A Law (law@cygnus.com)
-
- * config/t-svr4 (TARGET_LIBGCC2_CFLAGS): Add -fPIC.
-
-Wed Jan 28 20:04:43 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * i386/t-cygwin32 (LIMITS_H_TEST, LIBGCC2_INCLUDES): Define.
-
-Wed Jan 28 11:45:27 1998 Per Bothner <bothner@cygnus.com>
-
- * dbxout.c (dbxout_type): For a RECORD_TYPE, check that TYPE_BINFO
- is a TREE_VEC before trying to use it for baseclasses.
- (Chill uses the same field for a different purpose.)
-
- * toplev.c (strip_off_ending): Generalize to endings up to 5 chars.
-
-Tue Jan 27 23:15:55 1998 Lassi A. Tuura <lat@iki.fi>
-
- * config.sub: More accurate determination of HP processor types.
-
-Tue Jan 27 23:11:11 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>. Add
- prototype for `handle_sysv_pragma', and make it static. Add
- parentheses around assignment used as truth value.
-
- * combine.c (combine_instructions): Protect variable `prev' with
- macro HAVE_cc0.
- (can_combine_p): Protect variable `link' with AUTO_INC_DEC.
- (extract_left_shift): Add parentheses around operand of &.
- (merge_outer_ops): Avoid an empty body in an else-statement.
- (gen_rtx_combine): Remove unused variable `i'.
-
- * sparc/gmon-sol2.c: Include <fcntl.h>. Make return type of
- function monstartup `void'. Likewise for internal_mcount. Add
- `static void' prototype for moncontrol. Reconcile sprintf format
- vs. args.
-
- * sparc/sparc.c: Include <stdlib.h> and <string.h>/<strings.h>.
- Make return type of function_arg_slotno explicitly `int'.
- (reg_unused_after): Add parentheses around assignment used as
- truth value.
- (save_regs): Add explicit braces to avoid ambiguous `else'.
- (function_arg_slotno): Add parentheses around && within ||.
- (function_arg_pass_by_reference): Likewise.
- (sparc_flat_output_function_prologue): Reconcile fprintf format
- vs. args.
-
- * svr4.h (ASM_OUTPUT_LIMITED_STRING): Add parentheses around
- assignment used as truth value.
-
- * cplus-dem.c: Include <stdlib.h>.
- (demangle_signature): Avoid an empty body in an else-statement.
- (do_type): Remove unused variable `lvl'.
-
- * cppexp.c: Don't have <stdlib.h> depend on MULTIBYTE_CHARS.
- Include <string.h>/<strings.h>.
- (cpp_lex): Remove unused variable `namelen'.
- (cpp_lex): Explicitly declare `num_chars' as an int.
-
- * cpplib.c: Avoid duplicate inclusion of <stdlib.h>, include
- <unistd.h> instead. Explicitly declare is_system_include
- returning int.
- (make_assertion): Remove unused variable `kt'.
- (cpp_expand_to_buffer): Hide variable `obuf'.
- (output_line_command): Remove unused variables, `line_end',
- `line_cmd_buf' and `len'.
- (macarg): Remove unused variable `arg_start'.
- (special_symbol): Remove unused variable `i'. Add parentheses
- around assignment used as truth value.
- (do_include): Remove unused variables `pcfname' and `retried',
- hide `pcf' and `pcfbuflimit'.
- (do_line): Remove unused variable `i'.
- (finclude): Hide variable `missing_newline'.
- (cpp_handle_options): Remove unused variable `j'.
- (read_token_list): Remove unused variable `eofp'.
- (cpp_error_with_line): Remove unused variable `i'.
- (cpp_warning_with_line): Likewise.
- (cpp_pedwarn_with_line): Explicitly declare `column' as int.
- (cpp_error_from_errno): Remove unused variable `i'.
-
- * cse.c (invalidate): Add parentheses around assignment used as
- truth value.
- (find_best_addr): Move declaration of variable `our_cost' inside
- the conditional macro where its used.
- (fold_rtx): Avoid an empty body in an if-statement.
- (cse_insn): Wrap variables `this_insn_cc0_mode' and
- `this_insn_cc0' in macro HAVE_cc0.
-
- * dwarf2out.c: Include <stdlib.h> and <string.h>/<string.h>.
- (ASM_OUTPUT_DWARF_DATA8): Reconcile format vs. args in fprintf's.
- (output_uleb128): Likewise.
- (output_sleb128): Likewise.
- (output_cfi): Likewise.
- (output_call_frame_info): Remove unused variables `j', `fde_size'
- and `fde_pad'.
- (comp_unit_has_inlines): Hide declaration as per rest of file.
- (size_of_line_prolog): Correct typo in prototype.
- (add_arange): Likewise.
- (output_aranges): Likewise.
- (add_name_and_src_coords_attributes): Likewise.
- (gen_array_type_die): Likewise.
- (gen_inlined_subroutine_die): Likewise.
- (equate_decl_number_to_die): Remove unused variable `i'.
- (print_die): Reconcile format vs. args in fprintf's.
- (print_dwarf_line_table): Likewise.
- (output_die): Likewise.
- (output_line_info): Likewise.
- (add_subscript_info): Avoid an empty body in an else-statement.
- (gen_subprogram_die): Remove unused variable `fp_loc'.
-
- * dwarfout.c: Explicitly declare `next_pubname_number' as int.
- Protect `ordering_attribute' prototype with USE_ORDERING_ATTRIBUTE
- macro. Protect `src_coords_attribute' prototype with
- DWARF_DECL_COORDINATES macro. Hide `output_entry_point_die'
- prototype as in the rest of the file. Likewise for
- `output_pointer_type_die' and `output_reference_type_die'. Remove
- prototype for `type_of_for_scope'.
- (output_unsigned_leb128): Reconcile format vs. args in fprintf.
- (type_attribute): Add explicit braces to avoid ambiguous `else'.
-
- * final.c: Include <stdlib.h> and <string.h>/<strings.h>.
- (shorten_branches): Protect declaration of tmp_length with
- SHORTEN_WITH_ADJUST_INSN_LENGTH and ADJUST_INSN_LENGTH macros.
- (profile_function): Protect declaration of `sval' and `cxt'
- variables with appropriate macros.
- (final_scan_insn): Likewise for `note' variable. Add explicit
- braces to avoid empty body in an if-statement.
- (output_asm_insn): Move variable `i' inside macro conditional
- where it is used. Add parentheses around assignment used as truth
- value.
- (asm_fprintf) Likewise, likewise.
-
- * fix-header.c (main): Remove unused variable `done'. Protect
- declaration of `i' with FIXPROTO_IGNORE_LIST.
-
- * pexecute.c: Include <unistd.h>. Prototype `my_strerror'.
-
- * print-rtl.c (print_inline_rtx): Explicitly declare the parameter
- `ind'.
-
- * profile.c: Include <string.h>/<strings.h>.
- (instrument_arcs): Remove unused variables `note', `inverted',
- `zero' and `neg_one'.
- (branch_prob): Avoid empty body in an if-statement.
-
- * regclass.c: Include <stdlib.h>.
- (reg_alternate_class): Explicitly declare parameter `regno'.
-
- * regmove.c (regmove_optimize): Remove unused variable `p'. Add
- parentheses around assignment used as truth value.
- (find_matches): Remove unused variables `output_operand' and
- `matching_operand'.
- (fixup_match_1): Remove statement with no effect: "if (0) ;".
-
- * scan.c (sstring_append): Explicitly declare `count' as int.
- (scan_string): Explicitly declare parameter `init' as int.
-
- * sched.c: Include <stdlib.h>.
- (BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |.
- (rank_for_schedule): Add parentheses around assignment used as
- truth value.
- (schedule_block): Likewise.
- (regno_use_in): Likewise.
- (schedule_insns): Remove unused variable `i'.
-
- * toplev.c: Include <stdlib.h> and <string.h>/<strings.h>.
- (v_message_with_decl): Remove unused variable `n'.
- (botch): Explicitly declare parameter `s' as char *.
- (main): Add parentheses around assignment used as truth value.
-
- * tree.c (make_node): Protect the variable `kind' with the
- GATHER_STATISTICS macro.
- (real_value_from_int_cst): Move variable `e' inside conditional
- macro area where it is used.
- (tree_last): Add parentheses around assignment used as truth value.
- (build1): Protect the variable `kind' with the GATHER_STATISTICS
- macro.
- (print_obstack_statistics): Reconcile format vs. args in fprintf.
- Protect variables `i', `total_nodes', and `total_bytes' with the
- GATHER_STATISTICS macro.
-
-Tue Jan 27 23:01:55 1998 Mike Stump (mrs@wrs.com)
-
- * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Add
- some comments regarding use of dead_or_set_p.
-
-Tue Jan 27 22:14:48 1998 Todd Vierling <tv@pobox.com>
-
- * fixincludes: Tweak fix for struct exception in math.h
-
-Tue Jan 27 17:21:09 1998 Gavin Koch (gavin@cygnus.com)
-
- * mips/mips.c (mips_expand_prologue,mips_expand_epilogue):
- Change mode of registers used to add/sub from
- hard_frame_pointer_rtx from word_mode to Pmode.
-
-Tue Jan 27 11:02:04 1998 Nick Clifton <nickc@cygnus.com>
-
- * v850.h (ASM_OUTPUT_ALIGNED_BSS): Use
- asm_output_aligned_bss() instead of asm_output_bss().
-
- * toplev.c (rest_of_compilation): Replace references to
- stack_reg_dump_file and dbr_sched_dump_file with references to
- rtl_dump_file.
-
-Tue Jan 27 10:22:13 1998 Kamil Iskra <iskra@student.uci.agh.edu.pl>
-
- * tlink.c (scan_linker_output): Call fclose() for opened files.
-
-Tue Jan 27 05:05:26 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (output_epilog [!VMS]): Don't tag global functions if
- compiling with -fpic -- we want to be able to override symbols
- properly.
- (alpha_expand_block_move): Fix thinko in last change.
-
- * alpha.h (ASM_OUTPUT_MI_THUNK): New define.
- * config/alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): New define.
- * config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): New undef.
-
-Tue Jan 27 03:21:23 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.md (abssf, absdf): Revert last change.
-
-Tue Jan 27 00:26:50 1998 John Carr <jfc@mit.edu>
-
- * dwarf2out.c (dwarf2out_frame_init): Test value of DWARF2_UNWIND_INFO.
- * mips/sni-svr4.h: Define DWARF2_UNWIND_INFO as 0.
-
-Tue Jan 27 00:07:02 1998 Jeffrey A Law (law@cygnus.com)
-
- * emit-rtl.c (gen_lowpart_common): Handle more case where converting
- a CONST_INT into SFmode.
-
-Tue Jan 20 16:01:03 1998 Anthony Green <green@cygnus.com>
-
- * flags.h: New flag (optimize_size).
- * toplev.c (main): Parse -Os option and set optimize_space
- accordingly.
- * gcc.c (default_compilers), cp/lang-specs.h, f/lang-specs.h: Define
- __OPTIMIZE_SIZE__ when compiling with -Os.
- * config/dsp16xx/dsp16xx.h, config/i386/i386.h,
- config/i386/dgux.h, config/i960/i960.h, config/pdp11/pdp11.h,
- config/v850/v850.h (OPTIMIZATION_OPTIONS): New SIZE argument
- to macro.
- * config/i386/i386.c (optimization_options): Accept new SIZE argument.
-
-Mon Jan 26 23:57:39 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * libgcc2.c (__clear_insn_cache): On sysV68 enable the memctl
- stuff only if MCT_TEXT is #define'd.
-
-Mon Jan 26 23:52:51 1998 Markus F.X.J. Oberhumer <k3040e4@c210.edvz.uni-linz.ac.at>
-
- * configure.in (i*86-pc-msdosdjgpp): Treat like msdos & go32
- configurations.
-
-Fri Jan 23 09:39:36 1998 Nick Clifton <nickc@cygnus.com>
-
- * toplev.c: Add -dM command line option to dump RTL after the
- machine dependent reorganisation pass, if there is one.
- Reorganise RTL dump code, so that only one file handle is
- needed.
-
-Mon Jan 26 12:09:42 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
-
- * except.c (check_exception_handler_labels): Disable warning when
- flag_syntax_only.
-
-Mon Jan 26 18:17:32 1998 Jim Wilson <wilson@cygnus.com>
-
- * sparc.c (pic_setup_code): Don't set LABEL_PRESERVE_P.
-
-Mon Jan 26 18:11:30 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * c-decl.c (grokdeclarator): Get parameter tags from
- last_function_parm_tags.
- * dwarfout.c (output_formal_types): Set TREE_ASM_WRITTEN before
- traversing the parameter types.
- (output_type): No early exit for FUNCTION_TYPE / METHOD_TYPE context.
-
-Mon Jan 26 01:44:12 1998 Jeffrey A Law (law@cygnus.com)
-
- * h8300.c (print_operand): Handle CONST_DOUBLE for 'e', 'f', and
- the default case.
- (get_shift_alg): Fix typo.
-
-Sun Jan 25 22:22:04 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_expand_block_move): Copy ADDRESSOF to reg.
-
-Sun Jan 25 22:14:28 1998 Richard Henderson <rth@cygnus.com>
-
- * toplev.c (get_run_time): Make sure each case gets its variables.
-
-Sun Jan 25 22:10:21 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in (build_xm_file): Add auto-config.h if host=build.
- (host_xm_file_list): Don't add $(srcdir) to auto-config.h.
- (build_xm_file_list): Likewise.
- * configure: Rebuild.
-
-Sun Jan 25 22:00:25 1998 Alasdair Baird <alasdair@wildcat.demon.co.uk>
-
- * recog.c (validate_replace_rtx_1): Only perform substitutions
- of arguments to commutative and comparison operators once.
-
-Sun Jan 25 12:30:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * sparc.c (output_cbranch): Add default case in
- enumeration switch.
-
- * reorg.c (insn_sets_resource_p): Correct typo in prototype.
- (emit_delay_sequence): Eliminate unused parameter, all callers
- changed.
- (fill_simple_delay_slots): Likewise.
- (fill_slots_from_thread): Likewise.
- (fill_eager_delay_slots): Likewise.
- (mark_referenced_resources): Add default case in enumeration switch.
- (mark_set_resources): Likewise.
- (rare_destination): Likewise.
- (mostly_true_jump): Likewise.
- (find_dead_or_set_registers): Likewise.
- (redirect_with_delay_slots_safe_p): Remove unused variable `slots'.
- (update_reg_unused_notes): Remove unused variable `p'.
- (mark_target_live_regs): Remove unused variables `next' and
- `jump_count'.
- (fill_simple_delay_slots): Remove unused variable `j'.
- (fill_slots_from_thread): Add parentheses around assignment used
- as truth value.
- (dbr_schedule): Likewise.
-
- * objc/Make-lang.in (objc.stage1): Depend on stage1-start.
- (objc.stage2, objc.stage3, objc.stage4): Likewise.
-
-Sun Jan 25 12:13:47 1998 Michael Tiemann <michael@tiemann.org>
-
- * cse.c (simplify_ternary_operation): Don't try to simplify
- IF_THEN_ELSE expressions (created by combine) that don't use
- relational operators.
-
-Fri Jan 23 22:48:24 1998 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (simplify_ternary_operation): Handle more IF_THEN_ELSE
- simplifications.
-
- * crtstuff.c (init_dummy): Keep the epilogue in the init
- section for non-ELF systems.
-
-Fri Jan 23 23:28:59 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (movqi_i+1): New peephole.
-
-Fri Jan 23 15:39:42 1998 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in: Remove remaining bytecode stuff.
- * emit-rtl.c, expr.c: Likewise.
-
-Fri Jan 23 12:41:10 1998 Nick Clifton (nickc@cygnus.com)
-
- * toplev.c (lang_options): Add unknown-pragma options.
-
-Thu Jan 22 23:43:38 1998 Per Bothner <bothner@cygnus.com>
-
- * dwarfout.c (byte_size_attribute): Simplify and fix - don't need
- special (and incomplete) handling for Chill arrays.
-
-Fri Jan 23 00:27:23 1998 John Carr <jfc@mit.edu>
-
- * toplev.c (get_run_time): Call sysconf(_SC_CLK_TCK), when available,
- to get clock rate.
-
-Fri Jan 23 00:19:36 1998 Gavin Koch (gavin@cygnus.com)
-
- * mips.md (muldi3_internal2): Reverse test for TARGET_MIPS16.
-
-1998-01-22 scott snyder <snyder@d0sgif.fnal.gov>
-
- * mips.c (function_prologue): Use HARD_FRAME_POINTER_REGNUM in
- .frame directive instead of FRAME_POINTER_REGNUM.
-
-Fri Jan 23 00:08:55 1998 Robin Kirkham <rjk@mlb.dmt.csiro.au>
-
- * m68k.h (TARGET_SWITCHES): -mcpu32 now clears MASK_68881.
- (MACHINE_STATE_m68010_up): Replaced __mc68332__ with __mcpu32__.
- * m68k/m68k-none.h(CPP_FPU_SPEC): Update relative to TARGET_SWITCHES.
- (CPP_SPEC, ASM_SPEC, CC1_SPEC): Likewise.
- (CPP_SPEC): -m68332 defines both __mc68332 and __mcpu32__.
- * m68k/t-m68kbare (MULTILIB_OPTIONS): Add mcpu32.
- (MULTILIB_MATCHES): -m68332 now uses mcpu32 libraries, not m68000.
- (MULTILIB_EXCEPTIONS): Don't build 68881 libraries for m68000,
- mcpu32 or m5200.
- * longlong.h: Replace __mc68332__ with __mcpu32__.
-
-Thu Jan 22 19:55:40 PST 1998 Jeff Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Thu Jan 22 14:47:31 1998 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (push_reload): In WORD_REGISTER_OPERATIONS code, add test
- to require the SUBREG mode to be smaller than the SUBREG_REG mode.
- * reload1.c (eliminate_regs): Likewise.
-
-Thu Jan 22 14:49:14 1998 Jeffrey A Law (law@cygnus.com)
-
- * regmove.c (find_matches): Initialize matches->earlyclobber too.
-
-Thu Jan 22 01:40:52 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.md (abssf2, absdf2): Disable in IEEE mode.
- (negsf2, negdf2): Use proper subtract in IEEE mode.
-
-Tue Jan 20 09:29:09 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: Remove more bytecode stuff.
- * expr.c, stmt.c, config/msdos/top.sed: Likewise.
- * vax/xm-vms.h, winnt/config-nt.sed: Likewise.
- * f/install.texi, objc/Make-lang.in: Likewise.
-
- * Makefile.in: Remove all bytecode support.
- (OBJS): Make sure last entry is a real object file, not EXTRA_OBJS.
- * emit-rtl.c: Remove all bytecode support.
- * expr.c, expr.h function.c, integrate.c: Likewise.
- * output.h, regclass.c, rtl.h, stmt.c, toplev.c: Likewise.
- * tree.h, varasm.c: Likewise.
- * config/m68k/m68k.h: Likewise.
- * bi-*, bc-*, bytecode*: Delete bytecode related files.
- * modemap.def: Likewise.
-
-Tue Jan 20 09:02:31 1998 Gavin Koch (gavin@cygnus.com)
-
- * mips/mips.md (divsi3,divdi3,modsi3,moddi3,udivsi3,udivdi3,
- umodsi3,umoddi3): Handle mips16 div/mod by a constant.
-
-Mon Jan 19 21:57:00 1998 Richard Henderson <rth@cygnus.com>
-
- * i386.md (push): Prohibit symbolic constants if flag_pic.
- (movsi+1): Likewise for move to non-register.
-
-Mon Jan 19 11:15:38 1998 Jim Wilson <wilson@cygnus.com>
-
- * alpha.c (mode_mask_operand): Accept 0xffffffff on 32 bit host.
- (print_operand): Handle 0xffffffff on 32 bit host.
-
- * configure.in (thread_file): Rename uses before main loop to
- target_thread_file. Initialize to empty in main loop. Set thread_file
- to target_thread_file after main loop if not set.
- * configure: Rebuild.
-
- * genattrtab.c (find_and_mark_used_attributes): Handle CONST_INT.
- (add_values_to_cover): Revert last change (which had no ChangeLog
- entry).
- (simplify_with_current_value_aux): Handle CONST_INT.
-
-Mon Jan 19 10:14:55 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * unprotoize.c: Define UNPROTOIZE first, to actually take effect.
-
-Mon Jan 19 10:11:52 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Add cpp stringify test.
- * acconfig.h (HAVE_CPP_STRINGIFY): New tag.
- * gengenrtl.c: Use it.
- * configure, config.in: Rebuild.
-
-Mon Jan 19 09:43:15 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * Makefile.in (genrtl.c genrtl.h): Add dummy command for GNU make.
-
-Mon Jan 19 09:38:18 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Find declaration for sbrk.
- * acconfig.h (NEED_DECLARATION_SBRK): New tag.
- * config.in, configure: Rebuild.
- * mips-tfile.c: Properly protect declaration of sbrk and free.
- * toplev.c: Properly protect declaration of sbrk.
-
-Sun Jan 18 20:18:01 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_handle_trap_shadows): Ignore CLOBBERs.
-
-Sun Jan 18 01:54:27 1998 Jeffrey A Law (law@cygnus.com)
-
- * alpha/xm-winnt.h (HAS_INIT_SECTION): Undefine.
-
-Sun Jan 18 00:57:35 1998 Mike Stump (mrs@wrs.com)
-
- * configure.in (i960-wrs-vxworks): Default to latest vxworks release.
-
-Sat Jan 17 23:41:36 1998 David S. Miller <davem@tanya.rutgers.edu>
-
- * combine.c (force_to_mode, nonzero_bits): Correctly optimize
- constant offset computations from objects with known alignment in
- the presence of STACK_BIAS.
+ * mips-tfile.c: Likewise.
+ * prefix.c: Likewise.
+ * protoize.c: Likewise.
+ * regmove.c: Likewise.
+ * toplev.c: Likewise.
+ * tree.c: Likewise.
+
+Wed Aug 26 05:09:27 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
+
+ * config/sparc/sparc.c (sparc_override_options): If not
+ TARGET_FPU, turn off TARGET_VIS.
+ * config/sparc/sparc.h (TARGET_SWITCHES): Add no-vis.
+ (LEGITIMATE_CONSTANT_P): Allow SF/DF mode zero when TARGET_VIS.
+ * config/sparc/sparc.md (movsi_insn): Use fzeros not fzero.
+ (movdi_insn_sp64): Add VIS fzero alternative.
+ (clear_sf, clear_df): New VIS patterns.
+ (movsf, movdf expanders): Allow fp_zero_operand flat out when
+ TARGET_VIS.
+ (one_cmpldi2_sp64): Provide new fnot1 VIS alternative.
+
+Tue Aug 25 10:57:41 1998 Mark Mitchell <mark@markmitchell.com>
- * varasm.c (immed_double_const): Add casts to HOST_WIDE_INT where
+ * loop.c (n_times_set, n_times_used, may_not_optimize,
+ reg_single_usage): Convert to varrays. All uses changed.
+ (insert_loop_mem): Return a value.
+ (scan_loop): Tweak AVOID_CC_MODE_COPIES code.
+ (load_mems_and_recount_loop_regs_set): Likewise. Grow the arrays, if
necessary.
- (const_hash): Hash val is unsigned long.
- (SYMHASH): Likewise.
-
- * tree.c (TYPE_HASH): Type of hash val is unsigned long.
-
- * print-tree.c (print_node_brief): HOST_PTR_PRINTF format wants a
- char pointer, not HOST_WIDE_INT.
- (print_node): Likewise. Also hash is unsigned long not
- HOST_WIDE_INT.
-
- * cse.c (canon_hash): Hash is unsigned long not HOST_WIDE_INT.
-
- * explow.c (optimize_save_area_alloca): New function for targets
- where SETJMP_VIA_SAVE_AREA is true.
- (allocate_dynamic_stack_space): On SETJMP_VIA_SAVE_AREA targets,
- compute the amount of stack space needed should we find later that
- setjmp is never called by this function, stuff rtl for this inside
- a REG_NOTE of the final SET of stack_pointer_rtx.
- * toplev.c (rest_of_compilation): If SETJMP_VIA_SAVE_AREA and
- current_function_calls_alloca, call optimize_save_area_alloca.
-
-Sat Jan 17 23:22:59 1998 John Wehle (john@feith.com)
-
- * i386.md: Remove redundant integer push patterns.
- Don't bother checking for TARGET_PUSH_MEMORY when
- pushing constants or registers.
-
-Sat Jan 17 22:35:39 1998 Mumit Khan <khan@xraylith.wisc.edu>
- J.J VanderHeijden <J.J.vanderHeijden@student.utwente.nl>
-
- * pexecute.c (pexecute): New function for mingw32. Supports pipes.
- (pwait): New function for mingw32.
-
- * gcc.c (execute): Mingw32 pexecute() supports pipes, but cygwin32
- pipe support is broken for now.
-
-1998-01-17 Lee Iverson <leei@Canada.AI.SRI.COM>
- * emit_rtl.c (init_emit_once): Ensure that potential aliasing
- between frame_pointer_rtx, hard_frame_pointer_rtx, and
- arg_pointer_rtx is respected in initialization.
- (init_emit_once): Use gen_rtx_raw_REG() to create
- return_address_pointer_rtx.
+Tue Aug 25 23:57:12 1998 Jeffrey A Law (law@cygnus.com)
- * reorg.c: #include "expr.h" for rtx prototypes.
- * Makefile.in (reorg.o): Depend on expr.h
+ * From Alexandre:
+ * configure.in: Do not set thread_file to "irix" since no such
+ support exists yet.
-Sat Jan 17 21:28:08 1998 Pieter Nagel <pnagel@epiuse.co.za>
+ * sparc.md (float abs/neg splits): Check reload_completed before
+ calling alter_subreg.
- * Makefile.in (FLAGS_TO_PASS): Pass down gcc_include_dir and
- local_prefix to sub-make invocations.
-
-Sat Jan 17 21:24:16 1998 David T. McWherter <dtm@waterw.com>
-
- * objc-parse.c: Recognize protocol qualifiers in class definitions.
-
-Sat Jan 17 21:16:19 1998 Jeffrey A Law (law@cygnus.com)
-
- * rtl.h: Fix typos.
-
- * acconfig.h (NEED_DECLARATION_ATOL): New declaration to check for.
- * configure.in: Check for atol.
- * rtl.c (atol): Only provide the declaration if NEED_DECLARATION_ATOL.
-
- * rtl.c (read_rtx): Initialize list_rtx to NULL, not NULL_RTX.
-
- * loop.c (find_and_verify_loops): When attempting to move insns from
- inside the loop outside the loop, create a BARRIER if no suitable
- one was found.
-
- * jump.c (jump_optimize): Remove Dec 17, 1997 chance in
- favor of an equivalent change from gcc-2.8.
-
- * i386/x-sco5 (CC): Remove trailing whitespace.
-
-Sat Jan 17 21:09:46 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * gengenrtl.c (type_from_format): De-ANSIfy function signature.
- (accessor_from_format): Likewise.
- (xmalloc): New function for use when linking with alloca.o.
-
-Mon Jan 5 02:53:01 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * frame.c (find_fde): Correct FDE's upper bound.
-
-Fri Jan 16 16:23:52 1998 Richard Henderson <rth@cygnus.com>
-
- * gengenrtl.c (DEF_RTL_EXPR): Provide a K&R compliant version.
-
-Fri Jan 16 10:16:10 1998 Jeffrey A Law (law@cygnus.com)
-
- * calls.c (expand_call): Move #ifdef code out of macro argument
- lists.
- (emit_library_call, emit_library_call_value): Likewise.
-
-Fri Jan 16 00:46:40 1998 Jeffrey A Law (law@cygnus.com)
-
- * rtl.def (INLINE_HEADER): Fix bug exposed by gen_rtx_FOO changes.
-
-Thu Jan 15 01:02:30 1998 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Wed Jan 14 22:49:17 1998 Richard Henderson <rth@cygnus.com>
-
- * alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
- change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
- * caller-save.c, calls.c, combine.c, cse.c: Likewise.
- * dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
- * final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
- * halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
- * profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
- * reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
- * unroll.c, varasm.c: Likewise.
- * config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
-
-Wed Jan 14 19:36:08 1998 Gavin Koch (gavin@cygnus.com)
-
- * mips.h: Fix some type-o's from a previous change.
-
-Wed Jan 14 01:26:05 1998 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (check_dbra_loop): Make sure initial value is a
- CONST_INT before trying to normalize it.
-
-Tue Jan 13 23:27:54 1998 Robert Lipe (robertl@dgii.com)
-
- * sco5.h (ASM_OUTPUT_SECTION_NAME): Refresh from ../svr4.h.
-
-Tue Jan 13 22:47:02 1998 Herman ten Brugge <herman@htbrug.net.HCC.nl>
-
- * cppexp.c: Include gansidecl.h
-
-Tue Jan 13 22:43:35 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * svr4.h (LINK_SPEC): Never specify -h.
- * ptx4.h (LINK_SPEC): Likewise.
- * rs6000/sysv4.h (LINK_SPEC): Likewise.
- * sparc/sol2.h (LINK_SPEC): Likewise.
-
-Tue Jan 13 22:39:40 1998 Richard Henderson (rth@cygnus.com)
-
- * c-typeck.c (comptypes): Exit early on NULL input.
-
- * haifa-sched.c (schedule_insns): Correctly remove inter-block
- dependencies after reload.
-
-Tue Jan 13 22:22:31 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
-
- * rs6000/linux.h (CPP_PREDEFINES): Add -D__ELF__.
-
-Tue Jan 13 22:14:57 1998 Klaus Kaempf <kkaempf@progis.de>
-
- * alpha/vms.h (DIR_SEPARATOR): define
-
-Tue Jan 13 22:13:04 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * Makefile.in (stamp-proto): Remove.
- (protoize.o, unprotoize.o): Straightforward compile.
- * unprotoize.c: Define UNPROTOIZE here, not in the Makefile.
-
-Tue Jan 13 21:59:39 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * i386/cygwin32.h (STRIP_NAME_ENCODING): Define for Win32 to strip
- off the trailing @[NUM] added by ENCODE_SECTION_INFO.
-
-Tue Jan 13 21:55:06 1998 Jeffrey A Law (law@cygnus.com)
-
- * arm/netbsd.h (DWARF2_UNWIND_INFO): Define as zero for now.
- * i386/netbsd.h, m68k/netbsd.h, ns32k/netbsd.h: Likewise.
- * sparc/netbsd.h, vax/netbsd.h: Likewise.
-
-Tue Jan 13 21:37:07 1998 Shigeya Suzuki <shigeya@foretune.co.jp>
-
- * i386/bsd386.h (DWARF2_UNWIND_INFO): Define as zero for now.
-
-Tue Jan 13 17:50:55 1998 Jim Wilson <wilson@cygnus.com>
-
- * configure.in (target_cpu_default, target_cpu_default2): Use double
- quotes around them when testing their value.
- * configure: Rebuilt.
+Tue Aug 25 19:17:59 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Tue Jan 13 09:07:44 1998 John Carr <jfc@mit.edu>
-
- * gengenrtl.c (gencode): Emit new function obstack_alloc_rtx
- to allocate rtx.
- (gendef): Call obstack_alloc_rtx.
-
-Tue Jan 13 01:16:36 1998 Robert Lipe (robertl@dgii.com)
-
- * configure.in: (i[3456]86-UnixWare7-sysv5): Treat much like SVR4
- for now.
-
-Thu Dec 18 18:40:17 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * i386/mingw32.h (INCOMING_RETURN_ADDR_RTX): Delete. Use the value
- of DWARF2_UNWIND_INFO, if any, from i386/cygwin32.h instead.
- (STANDARD_INCLUDE_DIR): Change to /usr/local/i386-mingw32/include.
-
-Tue Jan 13 00:44:02 1998 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (return_internal): Change mode from SImode to VOIDmode.
-
-Sat Jan 10 22:11:39 1998 J. Kean Johnston <jkj@sco.com>
-
- * i386/sco5.h (STARTFILE_SPEC, ENDFILE_SPEC): Correctly handle
- "-static".
-
-Sat Jan 10 22:04:15 1998 Stan Cox <scox@equinox.cygnus.com>
-
- * i386.md: (movsicc_1, movhicc_1): For alternate 3 set the opcode
- suffix from operand 3.
-
-Sat Jan 10 21:50:16 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- Jeffrey A Law (law@cygnus.com)
-
- * regmove.c: New implementation of regmove pass.
- * local-alloc.c (optimize_reg_copy_1, optimize_reg_copy_2): Remove
- decls, make them have external linkage. Return a value from
- optimize_reg_copy_1.
- * reload.h (count_occurrences): Add decl.
- * reload1.c (count_occurrences): Delete decl, make it have external
- linkage.
- * rtl.h (optimize_reg_copy_1, optimize_reg_copy_2): Declare.
-
-Sat Jan 10 20:30:12 1998 Jeffrey A Law (law@cygnus.com)
-
- * regclass.c (record_address_regs): Don't use REG_OK_FOR_BASE_P
- if it is not defined.
-
-Thu Jan 8 21:06:54 1998 Richard Henderson <rth@cygnus.com>
-
- * Makefile.in (OBJ, GEN, RTL_H): Add genrtl.[oh] bits.
- * emit-rtl.c (gen_rtx): Move special code to ...
- (gen_rtx_CONST_INT): New function.
- (gen_rtx_REG): New function.
- (*): Update all calls to gen_rtx.
- * genemit.c (gen_exp): Emit calls to gen_rtx_FOO for constant FOO.
- * rtl.h: Include genrtl.h; prototype CONST_INT & REG generators.
- (GEN_INT): Call gen_rtx_CONST_INT.
- * gengenrtl.c: New file.
-
-Mon Jan 5 13:00:18 1998 John F. Carr <jfc@mit.edu>
-
- * alias.c (*_dependence): Call base_alias_check before canon_rtx.
- (base_alias_check): If no base found for address call canon_rtx and
- try again.
-
-Mon Jan 5 11:39:49 1998 Jeffrey A Law (law@cygnus.com)
-
- * mips.c (mips_expand_prologue): Handle large frame with no outgoing
- arguments for mips16.
- (mips_expand_epilogue): Pass "orig_tsize" to save_restore_insns.
- Don't lose if tsize is zero after handling large stack for mips16.
- * mips.md (return): For trivial return, return address is in $31.
-
-Sun Jan 4 20:24:00 1998 Nigel Stephens <nigel@algor.co.uk>
-
- * mips/mips16.S: Various changes to make it work with -msingle-float
- and -EL.
-
-Sun Jan 4 14:25:18 1998 Gavin Koch <gavin@cygnus.com>
- Ian Lance Taylor <ian@cygnus.com>
- Jeff Law <law@cygnus.com>
-
- * mips.c, mips.h, mips.md: First cut at merging in mips16
- support. Major modifications throughout all three files.
-
-Sun Jan 4 01:01:50 1998 scott snyder <snyder@d0sgif.fnal.gov>
-
- * configure.in: Make gthr-default.h a forwarding header instead of
- a symlink.
-
-Sat Jan 3 12:08:06 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * gcov-io.h: Include sys/types.h to ensure we get size_t.
-
- * pa.h (ASM_OUTPUT_MI_THUNK): Add missing % in fprintf.
-
-Fri Jan 2 23:40:09 1998 Jim Wilson (wilson@cygnus.com)
- Jeffrey A Law (law@cygnus.com)
-
- * crtstuff.c (__frame_dummy): New function for irix6.
- (__do_global_ctors): Call __frame_dummy for irix6.
- * iris6.h (LINK_SPEC): Hide __frame_dummy too.
-
-Fri Jan 2 04:57:57 1998 Weiwen Liu <liu@hepmail.physics.yale.edu>
-
- * alpha.c (vms_valid_decl_attribute_p): Move within #if OPEN_VMS.
-
-Fri Jan 2 04:34:14 1998 Richard Henderson <rth@cygnus.com>
-
- * c-decl.c (init_decl_processing): Provide proper fallback symbol
- for __builtin_memset.
- * expr.c (expand_builtin) [MEMSET]: Arg 3 type code is INTEGER_TYPE
- not INTEGER_CST. Assert arg 3 is a constant.
-
- * alpha.c (mode_width_operand): Accept 64-bit modes.
- (mode_mask_operand): Likewise.
- (print_operand): Likewise for 'M' and 'U' codes.
- (alpha_expand_unaligned_load): New function.
- (alpha_expand_unaligned_store): Likewise.
- (alpha_expand_unaligned_load_words): Likewise.
- (alpha_expand_unaligned_store_words): Likewise.
- (alpha_expand_block_move): Likewise.
- (alpha_expand_block_clear): Likewise.
- * alpha.h (MOVE_RATIO): New define.
- * alpha.md (extxl, ext*h, ins*l, mskxl): Name them.
- (insql, insxh, mskxh, extv, extzv, insv, movstrqi, clrstrqi): New.
-
- * alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Set to 3.
- (CONSTANT_ALIGNMENT, DATA_ALIGNMENT): Disable.
-
-Thu Jan 1 15:40:15 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Put parenthesis around TARGET_CPU_DEFAULT's value.
- * configure: Update.
-
-Thu Jan 1 10:49:12 1998 Jeffrey A Law (law@cygnus.com)
-
- * emit-rtl.c (operand_subword): Correctly handle extracting a word
- from a CONST_DOUBLE for 16bit targets with !WORDS_BIG_ENDIAN.
-
- * mn10200.md (tstxx, cmpxx): Use "nonimmediate_operand" as predicate
- for first argument.
-
-Wed Dec 31 14:42:18 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Set and subsitute host_exeext. Use it when creating
- the assembler and linker symlinks.
- * configure: Rebuild.
- * Makefile.in (exeext): Set to @host_exeext@.
- (build_exeext): New variable, set to @build_exeext@.
- (FLAGS_TO_PASS): Pass down build_exeext.
- (STAGESTUFF): Use build_exeext, not exeext, for gen* and bi*
- programs.
-
-Wed Dec 31 10:05:44 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10200.md (addsi3, subsi3): Fix thinkos.
-
-Tue Dec 30 00:04:49 1997 Richard Henderson <rth@cygnus.com>
-
- * sparc.h (ASM_OUTPUT_MI_THUNK): Move %o7 through %g1 instead of
- save+restore. Fix pic+big_offset delay slot. Use "pic" case for
- unix always, since we want to be able to thunk to functions in a
- shared library from an application.
-
-Mon Dec 29 14:37:31 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * mips/t-ecoff (CROSS_LIBGCC1): Define to libgcc1-asm.a.
- (LIB1ASMSRC, LIB1ASMFUNCS): Define.
-
-Mon Dec 29 14:03:38 1997 Jeffrey A Law (law@cygnus.com)
-
- * expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF, if the
- offset's mode is not ptr_mode, convert it.
-
-Mon Dec 29 15:58:18 1997 Michael Meissner <meissner@cygnus.com>
-
- * libgcc2.c (inhibit_libc): Don't define inhibit_libc when cross
- compiling if it was already defined.
-
-Sun Dec 28 00:32:16 1997 Jeffrey A Law (law@cygnus.com)
-
- * flow.c (find_basic_blocks): Don't create a new basic block
- for calls in a LIBCALL block.
-
-Sun Dec 28 00:30:24 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * config/fp-bit.c (L_df_to_sf): Fix typo in last change.
-
-Sat Dec 27 22:43:12 1997 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (rtx_cost): Remove conflicting default case.
-
-Sat Dec 27 21:20:02 1997 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Move default enabling of Haifa out of for loop.
- * configure: Rebuild.
-
-Thu Dec 25 01:02:54 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-1997-12-25 Teemu Torma <tot@trema.com>
-
- * Makefile.in (GTHREAD_FLAGS): New var.
- (LIBGCC2_CFLAGS): Added $(GTHREAD_FLAGS).
- (distclean): Remove gthr-default.h.
-
- * configure.in: Accept dce as a thread package.
- Check for thread.h and pthread.h.
- Link gthr-default.h to appropriate thread file and set
- gthread_flags.
- (hppa1.1-*-hpux10*): If --enable-threads, use dce threads and
- include multilib definitions from pa/t-dce-thr.
- (sparc-*-solaris2*): Enable threads by default, if thread.h or
- pthread.h is found, preferring posix threads over solaris ones.
-
- * config/pa/t-dce-thr: New file.
- * config/pa/t-pa: Removed multilibs.
- * config/sparc/t-sol2: Ditto.
-
- * gthr.h: New file.
- * gthr-single.h: New file.
- * gthr-posix.h: New file.
- * gthr-solaris.h: New file.
- * gthr-dce.h: New file.
- * libgcc-thr.h: Removed.
- * objc/thr-dce.c: New file copied from thr-decosf1.c.
-
- * frame.c: Include gthr.h instead of libgcc-thr.h.
- * libgcc2.c: Include gthr.h instead of libgcc-thr.h.
- (eh_context_initialize): If __gthread_once fails, use static eh
- context.
- (eh_context_free): Call __gthread_key_dtor.
-
-Wed Dec 24 23:33:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * expr.h (MUST_PASS_IN_STACK): Allow target port to override.
-
-Wed Dec 24 23:12:14 1997 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (max_insn_uid): New variable.
- (cse_around_loop): Use max_insn_uid.
- (cse_main): Set max_insn_uid.
-
- * abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and TARGET_DEFAULT,
- and define __LONG_MAX__ appropriately. Add support for -mabi=X,
- -mlong64, and -mgp{32,64} options.
- * mips.c (mips_abi): Change type to int.
- * mips.h (enum mips_abi_type): Delete.
- (ABI_32, ABI_N32, ABI_64, ABI_EABI): Define as constants.
- (mips_abi): Change type to int.
-
-Wed Dec 24 22:38:34 1997 John Carr <jfc@mit.edu>
-
- * flags.h, toplev.c, calls.c, alias.c: Remove flag_alias_check;
- optimization is now always enabled.
-
- * calls.c (expand_call): Recognize C++ operator new as malloc-like
+ * config/sparc/sparc.c (sparc_absnegfloat_split_legitimate): New
function.
+ * config/sparc/sparc.h: Declare it.
+ * config/sparc/sparc.md (float abs/neg splits): Use it.
+ (all other splits): Handle SUBREGs properly where necessary.
+ (unnamed (1<<x)-1 V8PLUS pattern): Disable for now.
- * alias.c (memrefs_conflict_p): Eliminate tests now done by
- base_alias_check.
- (*_dependence): Call canon_rtx before base_alias_check.
- (init_alias_once): New function to precompute set of registers which
- can hold Pmode function arguments.
-
- * rtl.h: Declare init_alias_once.
-
- * toplev.c (compile_file): Call init_alias_once.
-
-Wed Dec 24 22:34:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * tree.c (restore_tree_status): Do not dereference a null pointer.
-
-Tue Dec 23 12:56:46 1997 Paul Eggert <eggert@twinsun.com>:
-
- * genattrtab.c (main): Check HAVE_{G,S}ETRLIMIT in addition to
- RLIMIT_STACK. This maintains consistency with the recent, similar
- patch to cccp.c and toplev.c.
-
-Tue Dec 23 05:17:28 1997 Richard Henderson <rth@cygnus.com>
-
- * genattrtab.c (expand_units): For large nr opclasses, expand
- function_units_used with ORX to prevent blowups. Tag with FFS.
- (num_unit_opclasses): New variable.
- (gen_unit): Update it.
- (enum operator): Add ORX_OP.
- (operate_exp): Treat ORX as or, except don't expand across an if.
- Reuse number rtx's after operating on them.
- (check_attr_value): Accept IOR, AND, & FFS.
- (write_test_expr): Transmute `in_comparison' to `flags'. Allow
- for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE.
- (write_expr_attr_cache, write_toplevel_expr): New functions.
- (write_attr_get): Handle FFS-tagged expressions.
- (make_canonical): Don't expand const attributes.
- (convert_const_symbol_ref): Dike out.
- (evaluate_eq_attr): Handle SYMBOL_REF.
- (main): Don't emit get_attr_foo for const attributes.
-
- * alpha.c (override_options): Reinstate PROCESSOR_EV6.
- (alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests.
- * alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly.
- * alpha.md: Redo all of the scheduling, adding EV6 support, and
- combining function units where possible.
- (attr "type"): Split loads, stores, cmov into int/fp. Combine
- multiplies and divides. Add EV6 sqrt, ftoi, itof.
- (attr "opsize"): New attribute.
- (sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns.
- (movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX
- to control register allocation.
- (movsi2-1, movdi2-1): Likewise.
-
-Tue Dec 23 03:53:21 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.h (CPP_PREDEFINES, LIB_SPEC, LINK_SPEC, STARTFILE_SPEC,
- MD_STARTFILE_PREFIX, ASM_FILE_START, ASM_SPEC, ASM_FINAL_SPEC):
- Move OSF/1 specific defines out.
- * alpha/elf.h (TARGET_VERSION, CPP_PREDEFINES, DEFAULT_VTABLE_THUNKS):
- Move Linux specific defines out.
- (LINK_SPEC): Genericize.
- (ASM_FILE_START): Emit .arch if using more than the base insn set.
- (ASM_OUTPUT_SOURCE_LINE): Remove; identical to alpha.h version.
- (SDB_DEBUGGING_INFO): Remove; gas can't handle it.
- (HANDLE_SYSV_PRAGMA): Define.
- * alpha/osf.h: New file.
- * alpha/linux.h: Split. Retain file-format independant defines.
- Import Linux bits from elf.h.
- (CPP_PREDEFINES): Take a file-format specific SUB_CPP_PREDEFINES
- (FUNCTION_PROFILER): _mcount takes its address in $28.
- (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX): Remove undef.
- * alpha/linux-ecoff.h: New file.
- * alpha/linux-elf.h: New file.
- * alpha/vms.h (LIB_SPEC, LINK_SPEC): Copy from osf.h.
- * alpha/win-nt.h (TARGET_DEFAULT): Define.
- * configure.in (alpha*-*-osf*, alpha*-*-linux*) [tm_file]:
- Add new headers as appropriate.
-
- * configure.in (alpha*): Enable Haifa by default.
- (*-*-winnt3*): Change to winnt*, since we're not v3 specific.
- * configure: Rebuild.
-
-Tue Dec 23 03:14:54 1997 Richard Henderson <rth@cygnus.com>
-
- * Makefile.in (clean): Remove the stages with their objects here ...
- (distclean): ... instead of here.
-
-Mon Dec 22 11:24:01 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * cse.c (rtx_cost): Add default case in enumeration switch.
- * fix-header.c (recognized_macro): Likewise.
- (recognized_extern): Likewise.
- (write_rbrac): Likewise.
- * objc/objc-act.c (encode_aggregate): Likewise.
- (gen_declarator): Likewise.
- (gen_declspecs): Likewise.
-
-Mon Dec 22 09:58:51 1997 Jeffrey A Law (law@cygnus.com)
-
- * haifa-sched.c (create_reg_dead_note): Detect and handle another
- case where we kill more regs after sched than were killed before
- sched.
- * sched.c (create_reg_dead_note): Similarly.
-
-Mon Dec 22 09:18:37 1997 Jeffrey A Law (law@cygnus.com)
-
- * c-pragma.c: Include flags.h.
-
-Sun Dec 21 22:10:59 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * i386/cygwin32.h (NO_IMPLICIT_EXTERN_C): Don't assume anything
- about system headers.
- (LIB_SPEC): Add -ladvapi32 -lshell32 to be consistent with mingw32
- and also to resolve symbols in prefix.c.
-
- * i386/xm-cygwin32.h (HAVE_BCOPY): Define. This avoids a conflict
- between gansidecl.h and newlib's _ansi.h when building libgcc2.a,
- when the definitions in auto-config.h is not visible.
- (HAVE_BZERO): Likewise.
- (HAVE_BCMP): Likewise.
- (HAVE_RINDEX): Likewise.
- (HAVE_INDEX): Likewise.
-
-Sun Dec 21 21:54:22 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (emit_move_sequence): Handle a function label source
- operand.
-
-Sun Dec 21 16:13:55 1997 Nick Clifton <nickc@cygnus.com
-
- * c-pragma.c (handle_pragma_token): Generate warning messages
- about unknown pragmas if warn_unknown_pragmas is set.
-
- * c-decl.c (c_decode_option): Parse -Wunknown-pragmas command
- line option to set variable: warn_unknown_pragmas.
-
-Sun Dec 21 15:51:10 1997 Manfred Hollstein <manfred@lts.sel.alcatel.de>
-
- * m68k/mot3300.h (ASM_BYTE_OP): Don't include '\t' in the
- definition.
- (ASM_OUTPUT_ASCII): Prefix ASM_BYTE_OP by one single '\t'.
-
-Sun Dec 21 13:58:39 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (FPBIT_FUNCS, DPBIT_FUNCS): Define.
- (libgcc2.a): Depend on $(DPBIT) and $(FPBIT). Add rules to
- generate more fine grained floating point emulation libraries.
- * config/fp-bit.c: Add protecting #ifdef to all functions so
- that they can be compiled separately. If !FINE_GRAINED_LIBRARIES,
- then compile all suitable functions.
- (pack_d, unpack_d, fpcmp_parts): Add declarations, define with two
- underscores to avoid namespace pollution.
- * t-mn10200 (LIB2FUNCS_EXTRA): Remove fp-bit.c
- (FPBIT): Define.
- * t-mn10300 (LIB2FUNCS_EXTRA): Remove fp-bit.c and dp-bit.c
- (FPBIT): Define.
- (DPBIT): Define.
-
-Sat Dec 20 11:26:47 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- Jeff Law <law@cygnus.com>
-
- * bitmap.c (bitmap_clear): Ensure `inline' is at the beginning
- of the declaration.
- * c-decl.c (finish_decl): Use parentheses around && within ||.
- * rtl.c: Include stdlib.h.
- (read_skip_spaces): Add parentheses around assignments used as
- truth values.
- (read_rtx): Initialize list_rtx.
- * cppexp.c (parse_number): Use || when operands are truth values.
- * alias.c (find_base_value): Add default case.
- (memrefs_conflict): Likewise.
- * combine.c (sets_function_arg_p): Likewise.
- * genemit.c (gen_exp): Likewise.
- * local-alloc.c (contains_replace_regs): Likewise.
- * rtlanal.c (jmp_uses_reg_or_mem): Likewise.
- * fold-const.c (fold_convert): Use "&&" for truth values.
- (fold): Add default case.
- * sdbout.c (sdbout_field_types): Fix typo in declaration.
- (sdbout_one_type): Add default case.
- * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS.
- (some_operand): Add default case.
- (input_operand): Likewise.
- (signed_comparison_operator): Likewise.
- (divmod_operator): Likewise.
- (alpha_set_memflags_1): Likewise.
- * reload1.c (reload_cse_simplify_operands): Ensure function
- always returns a value.
- * scan-decls.c (scan_decls): Likewise.
- * c-lex.c (skip_white_space): Fix typo in declaraion.
- * c-typeck.c (comp_target_types): Add parentheses around assignment
- used as truth value.
- (print_spelling): Likewise.
- (constructor_implicit, constructor_result): Remove unused variables.
- * collect2.c (scan_library): Protect prototype with
- #ifdef SCAN_LIBRARIES.
- * emit-rtl.c (find_line_note): Fix typo in declaration.
- * final.c (asm_insn_count): Protect prototype with
- #ifdef HAVE_ATTR_length.
- * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC.
- (try_pre_increment_1, try_pre_increment): Likewise.
- * regclass.c (auto_inc_dec_reg_p): Protect prototype with
- #ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit.
- * gcov-io.h (__store_long, __write_long, __read_long): Fix
- unsigned/signed comparisons.
- * gcov.c (read_files): Remove unused "first_type" variable.
- (scan _for_source_files): Initialize s_ptr.
- (function_summary): Eliminate "%lf" formatting, use %ld for
- longs.
- (output_data): Initialize branch_probs and last_line_num.
- Eliminate "%lf" formatting, use "%ld" for longs.
-
-Fri Dec 19 17:31:11 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * mips16.S: New file.
-
- * libgcc2.c (varargs): Handle mips16.
-
- * expr.c (do_tablejump): Let CASE_VECTOR_PC_RELATIVE be an
- expression.
- * stmt.c (expand_end_case): Likewise.
- * alpha.h (CASE_VECTOR_PC_RELATIVE): Update.
- * fx80.h, gmicro.h, m68k.h, m88k.h, ns32k.h: Likewise.
- * rs6000.h, sh.h, tahoe.h, v850.h, vax.h: Likewise.
-
-Tue Dec 16 15:14:09 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * objc/Make-lang.in: Create runtime-info.h and libobjc_entry.o in
- the build directory.
- (libobjc.a): Update dependency list.
- (libobjc.dll): Likewise. Use libobjc_entry.o from the build
- directory.
- (objc/sendmsg.o): Add -Iobjc to find runtime-info.h.
- (objc.mostlyclean): Remove runtime-info.h.
-
-Fri Dec 19 00:19:42 1997 Richard Henderson <rth@cygnus.com>
-
- * tree.c (build_range_type): Allow creation of ranges with no maximum.
- * dbxout.c (dbxout_range_type): Handle missing TYPE_MAX_VALUE.
- * dwarf2out.c (add_subscript_info): Likewise.
- * dwarfout.c (subscript_data_attribute, byte_size_attribute): Likewise.
- * sdbout.c (plain_type_1): Likewise.
- * stmt.c (pushcase_range, all_cases_count, node_has_high_bound):
- Likewise.
- * fold-const.c (int_const_binop, fold_convert, make_range, fold):
- Likewise.
-
-Thu Dec 18 17:05:10 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * mips.c (fatal): Remove declaration.
-
-1997-12-18 Mark Mitchell <mmitchell@usa.net>
-
- * integrate.c (get_label_from_map): New function.
- (expand_inline_function): Use it. Initialize the label_map to
- NULL_RTX instead of gen_label_rtx.
- (copy_rtx_and_substitute): Use get_label_from_map.
- * integrate.h (get_label_from_map): New function.
- (set_label_from_map): New macro.
- * unroll.c (unroll_loop): Use them.
- (copy_loop_body): Ditto.
-
-Thu Dec 18 19:19:57 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * mips/mips.h (INIT_SUBTARGET_OPTABS): Define if not defined.
- (INIT_TARGET_OPTABS): Define.
- * mips/ecoff.h: Include gofast.h before mips.h.
- (INIT_SUBTARGET_OPTABS): Define instead of INIT_TARGET_OPTABS.
- * mips/elf64.h: Likewise.
- * mips/elf.h (ASM_OUTPUT_SECTION_NAME): Define.
-
-Thu Dec 18 14:51:12 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c: Remove register_exception_table{,_p}.
-
-Thu Dec 18 14:57:29 1997 Gavin Koch <gavin@cygnus.com>
-
- * unroll.c (calculate_giv_inc): Handle constant increment found in
- a MEM with an appropriate REG_EQUAL note.
-
- * calls.c (expand_call): Implement LOAD_ARGS_REVERSED.
-
- * dwarf2out.c (dwarf2out_frame_debug): Handle adjustments of the
- frame pointer in the prologue.
-
-Thu Dec 18 00:19:38 1997 Robert Lipe <robertl@dgii.com>
-
- * i386/x-sco5 (CLIB) Deleted. (ALLOCA) Added.
- * i386/xm-sco5.h (USE_C_ALLOCA) Added.
+Tue Aug 25 19:48:46 1998 Jeffrey A Law (law@cygnus.com)
-Tue Dec 16 18:51:00 1997 Bill Moyer <billm@cygnus.com>
+ * reorg.c (fill_simple_delay_slots): Do not abort if we encounter
+ an insn on the unfilled_slots_list that has no delay slots.
+ (fill_eager_delay_slots): Similarly.
- * config/m68k/m68k.c (output_function_prologue): Typecast
- dwarf2out_cfi_label to (char *).
- * config/m68k/m68kemb.h (STARTFILE_SPEC): Redefined to "".
+Tue Aug 25 13:35:20 1998 Nick Clifton <nickc@cygnus.com>
-Wed Dec 17 15:06:04 1997 Richard Henderson <rth@cygnus.com>
+ * config/v850/v850.c (movsi_source_operand): Treat CONSTANT_P_RTX
+ as an ordinary operand.
- * sparc.md (jump): Don't use the annul bit around an empty loop.
- Patch from Kevin.Kelly@East.Sun.COM.
+Tue Aug 25 12:54:57 1998 Jason Merrill <jason@yorick.cygnus.com>
-Wed Dec 17 00:51:36 1997 Stan Cox (scox@cygnus.com)
+ * tree.c (valid_machine_attribute): Don't apply attributes to both
+ decl and type.
- * jump.c: (jump_optimize): Don't use the return register as a
- source1 of a conditional move.
+Tue Aug 25 12:23:20 PDT 1998 Richard Henderson <rth@cygnus.com>
-Tue Dec 16 23:45:40 1997 Richard Henderson <rth@cygnus.com>
+ * reload.c (operands_match_p): Handle rtvecs.
- * sparc.c (DF_MODES): Or the mask not the bit number.
- (function_arg) [ARCH64]: Send unprototyped arg to fp reg first.
+ * i386.c (legitimate_pic_address_disp_p): New.
+ (legitimate_address_p): Use it.
+ (legitimize_pic_address): Use unspecs to represent @GOT and @GOTOFF.
+ Handle constant pool symbols just like statics.
+ (emit_pic_move): Use Pmode not SImode for clarity.
+ (output_pic_addr_const) [SYMBOL_REF]: Remove @GOT and @GOTOFF hacks.
+ [UNSPEC]: New, handling what we killed above.
+ [PLUS]: Detect and abort on invalid symbol arithmetic.
+ * i386.h (CONSTANT_ADDRESS_P): Remove HIGH.
-Wed Dec 17 00:13:48 1997 Christian Iseli <Christian.Iseli@lslsun.epfl.ch>
+Tue Aug 25 12:02:23 1998 Mark Mitchell <mark@markmitchell.com>
- * combine.c (force_to_mode): return immediately if operand is a CLOBBER.
-
-Tue Dec 16 23:44:54 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * fixincludes (size_t): Add support for Motorola's stdlib.h
- which fails to provide a definition for size_t.
- (fabs/hypot): Provide a prototype for fabs on m88k-motorola-sysv3.
- (strlen,strspn,strcspn return value): Handle different layout on sysV88.
- (hypot): Provide a fake for hypot for m88k-motorola-sysv3.
-
- * m68k/xm-mot3300.h (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): Define to
- prevent unresolved externals in libio.
- * m88k/xm-sysv3.h (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): Likewise.
-
-Tue Dec 16 23:25:45 1997 H.J. Lu (hjl@gnu.org)
-
- * config/sparc/linux64.h (LIBGCC_SPEC): Removed.
- (CPP_SUBTARGET_SPEC): Add %{pthread:-D_REENTRANT}.
- (LIB_SPEC): Updated for glibc 2.
-
-Tue Dec 16 20:11:36 1997 Jeffrey A Law (law@cygnus.com)
-
- * ginclude/stdarg.h: Undo BeOS changes, they break hpux.
- * ginclude/varargs.h: Likewise.
-
-Tue Dec 16 00:32:01 1997 Jeffrey A Law (law@cygnus.com)
+ * alias.c: Include output.h.
+ (DIFFERENT_ALIAS_SETS_P): Don't treat alias sets as
+ different if we're in a varargs function.
+ * Makefile.in (alias.o): Depend on output.h
+
+Tue Aug 25 19:20:12 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * version.c: Bump for snapshot.
+ * sh.h (GIV_SORT_CRITERION): Delete.
-Tue Dec 16 00:14:29 1997 H.J. Lu (hjl@gnu.org)
+Tue Aug 25 13:19:46 1998 Dave Brolley <brolley@cygnus.com>
- * frame.h (__register_frame, __register_frame_table,
- __deregister_frame): New.
- * frame.c (__register_frame, __register_frame_table,
- __deregister_frame): New.
- * frame.c (__deregister_frame_info): Return void *.
- * frame.h (__deregister_frame_info): Ditto.
- * collect2.c (__deregister_frame_info): Ditto.
+ * regclass.c (regclass): Use xmalloc/free instead of alloca.
+ * stupid.c (stupid_life_analysis): Ditto.
+ * reload1.c (reload): Ditto.
-Mon Dec 15 18:40:08 1997 Richard Henderson <rth@cygnus.com>
+Tue Aug 25 05:48:18 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
- * expmed.c (expand_shift): If SHIFT_COUNT_TRUNCATED, drop a SUBREG.
+ * config/sparc/sparc.c (arith_4096_operand, arith_add_operand,
+ arith_double_4096_operand, arith_double_add_operand): New
+ predicates.
+ * config/sparc/sparc.h (PREDICATE_CODES): Add them, declare them.
+ * config/sparc/sparc.md (adddi3, addsi3, subdi3, subsi3): Use
+ them to transform add/sub 4096 into add/sub -4096.
-Mon Dec 15 18:31:43 1997 Richard Henderson <rth@cygnus.com>
+Mon Aug 24 23:31:03 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * alpha.c (alpha_cpu_name): New variable.
- (alpha_mlat_string): Likewise.
- (alpha_memory_latency): Likewise.
- (override_options): Handle -mmemory-latency.
- (alpha_adjust_cost): Adjust load cost for latency.
- * alpha.h (TARGET_OPTIONS): Add meory-latency.
- (REGISTER_MOVE_COST): Define in terms of memory_latency. Take
- TARGET_CIX into account.
- (MEMORY_MOVE_COST): Define in terms of memory_latency.
- * invoke.texi (DEC Alpha Options): Document -mmemory-latency.
+ * loop.c (scan_loop): Allocate some slop to handle pseudos
+ generated by move_movables.
+ (load_mems_and_recount_loop_regs_set): Honor AVOID_CC_MODE_COPIES
+ here too.
- * alpha.h (ASM_COMMENT_START): New macro.
+Mon Aug 24 19:45:40 1998 Jim Wilson <wilson@cygnus.com>
-Mon Dec 15 17:48:05 1997 Richard Henderson <rth@cygnus.com>
+ * tree.def (DECL_RESULT): Correct documentation.
- * reload.h, reload1.c (eliminate_regs), caller-save.c, dbxout.c,
- dwarfout.c, dwarf2out.c, reload.c, sdbout.c: Revert March 15 change.
+Tue Aug 25 01:15:27 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
- SUBREG_REG if the word count is unchanged.
- * reload1.c (eliminate_regs) [case SET]: If W_R_O, preserve
- subregs of identical word size for push_reload.
+ * reload1.c (reload_reg_free_before_p): New argument EQUIV; Changed
+ all callers. Abort for RELOAD_FOR_INSN. RELOAD_FOR_OUTADDR_ADDR:
+ conflicts will all RELOAD_FOR_OUTPUT reloads.
-Mon Dec 15 Mark Mitchell <mmitchell@usa.net> 11:41:32 1997
+ * reload1.c (reload_cse_regs_1): When deleting a no-op move that
+ loads the function result, substitute with a USE.
- * toplev.c (rest_of_compilation): Don't call save_for_inline_copy
- if all we're doing is dealing with -Wreturn-type.
+Mon Aug 24 15:20:19 1998 David Edelsohn <edelsohn@mhpcc.edu>
-Mon Dec 15 09:44:39 1997 Richard Henderson <rth@cygnus.com>
+ * rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Use TARGET_POWERPC64
+ when testing LEGITIMATE_INDEXED_ADDRESS_P DFmode and DImode.
+ (LEGITIMIZE_ADDRESS): Use TARGET_POWERPC64 for INDEXED fixup.
+ * rs6000.c (print_operand, case 'L'): Add UNITS_PER_WORD, not 4.
+ (print_operand, cases 'O' and 'T'): Fix typos in lossage strings.
+ * rs6000.md (fix_truncdfsi2_store): Remove %w from non-CONST_INT
+ operand.
+ (movdf_softfloat32, movdf_hardfloat64, movdf_softfloat64): Change
+ 'o' to 'm' for GPR variant constraints.
- * alpha.md (zero_extendqihi2, zero_extendqisi2, zero_extendqidi2):
- Use and 255 instead of zapnot 1, since it schedules better.
+Mon Aug 24 10:25:46 1998 Jeffrey A Law (law@cygnus.com)
-Mon Dec 15 08:48:24 1997 Jeffrey A Law (law@cygnus.com)
+ * loop.c (scan_loop): Honor AVOID_CC_MODE_COPIES.
- * stmt.c (expand_asm_operands): If an ASM has no outputs, then treat
- it as volatile.
+ * h8300.h (STRIP_NAME_ENCODING): Fix typo.
-Mon Dec 15 00:04:48 1997 Jeffrey A Law (law@cygnus.com)
+ * sparc.md (TFmode splits): Use reg_overlap_mentioned_p to detect
+ when the source and destination overlap.
- * haifa-sched.c (remove_dependencies): Set RTX_INTEGRATED_P on
- dependency we delete. Properly update prev for multiple consecutive
- deletions.
- (priority): Skip deleted dependence.
+ * stmt.c (emit_case_nodes): Change rtx_function to rtx_fn to avoid
+ clash with global type.
-Fri Dec 12 18:54:23 1997 Per Bothner <bothner@cygnus.com>
+Mon Aug 24 00:53:53 1998 Jason Merrill <jason@yorick.cygnus.com>
- * expr.c (expand_builtin): Support BUILT_IN_FMOD - just call fmod.
+ * fixinc.irix: Add curses.h handling from fixinc.wrap.
-Fri Dec 12 01:19:48 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * c-common.c (combine_strings): Also set TREE_READONLY.
+ Change warn_write_strings to flag_const_strings.
+ * c-decl.c, c-tree.h: Likewise.
- * flow.c (flow_analysis): Be consistent with find_basic_blocks in
- determining when a new basic block starts.
+Sun Aug 23 18:39:11 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * alpha/osf2or3.h (LIB_SPEC): Restore missing defn.
+ * config/sparc/sparc.c (sparc_emit_set_const32): If outputting a
+ CONST_INT, not a symbolic reference, don't use a HIGH/LO_SUM
+ sequence, use SET/IOR instead so CSE can see it.
+ * config/sparc/sparc.md (movhi_const64_special,
+ movsi_const64_special): New patterns necessitated by that change.
+ (movhi_high): Remove.
+ (movhi_lo_sum): Change to match an IOR.
+ (movdf_insn_sp32): Test TARGET_V9 not TARGET_ARCH64.
+ (movdf_insn_v9only): New pattern for when V9 but not ARCH64.
+ (movdf_insn_sp64): Test both TARGET_V9 and TARGET_ARCH64.
+ (movdf splits): Allow when not V9 or when not ARCH64 and integer
+ registers are involved.
+ (snesi_zero_extend split): Remove reload_completed test.
+ (unnamed plus and minus zero_extend sidi splits): Add it.
- * pa.h (TEXT_SPACE_P): Use TREE_CODE_CLASS.
- * pa.md (iorsi3): Add missing args to *_operand calls.
+Sun Aug 23 11:56:08 1998 Mark Mitchell <mark@markmitchell.com>
- * except.c (call_get_eh_context): Don't mess with sequences.
- (emit_eh_context): Include the call in the sequence here.
+ * extend.texi: Remove description of extension to explicit
+ instantiation that is now endorsed by standard C++.
-1997-12-11 Paul Eggert <eggert@twinsun.com>
+Sun Aug 23 09:39:09 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * collect2.c (write_c_file_glob): Allocate initial frame object
- in static storage and pass its address.
+ * config/arc/arc.c (arc_initialize_pic): Remove.
+ * config/arc/arc.h (INITIALIZE_PIC): Similarly, this routine does
+ nothing on any platform and is invoked by no-one, it does not even
+ appear in the documentation.
+ * config/sparc/sparc.h (INITIALIZE_PIC): Likewise.
+ * config/sparc/sparc.c (initialize_pic): Likewise.
+ (find_addr_reg): Remove this as well, no longer referenced after
+ my rewrite.
-Thu Dec 11 23:33:48 1997 Jason Merrill <jason@yorick.cygnus.com>
+Sun Aug 23 00:17:14 1998 Jeffrey A Law (law@cygnus.com)
- * except.c (call_get_eh_context): Don't take a parm.
- Put the call at the top of the function.
- (emit_eh_context): Adjust.
- (get_eh_context): Replace with former use_eh_context.
- (get_eh_context_once, get_saved_pc_ref): Remove.
- (start_eh_unwinder, end_eh_unwinder, emit_unwinder): Remove.
- * except.h: Adjust.
- * integrate.c (expand_inline_function): Adjust.
- * toplev.c (rest_of_compilation): Don't call emit_unwinder.
+ * recog.c (validate_replace_rtx_group): New function.
+ * recog.h (validate_replace_rtx_group): Declare it.
+ * regmove.c (optimize_reg_copy_3): If any substitution fails, then undo
+ the entire group of substitutions.
-Fri Oct 10 17:58:31 CEST 1997 Marc Lehmann <pcg@goof.com>
+Sat Aug 22 23:31:00 1998 Klaus-Georg Adams (Klaus-Georg.Adams@chemie.uni-karlsruhe.de)
- * i386/xm-go32.h (EXECUTABLE_SUFFIX): Define.
- (DIR_SEPARATOR, NO_SYS_SIGLIST): Likewise.
+ * loop.c (load_mems): Fix initializers.
-Thu Dec 11 23:55:17 1997 Manfred Hollstein <manfred@s-direktnet.de>
+Fri Aug 21 23:07:46 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * fixincludes (strlen,strspn,strcspn return value): Handle different
- layout on sysV88.
- (hypot): Provide a fake for hypot which is broken on
- m88k-motorola-sysv3.
+ * config/sparc/sparc.md (TFmode splits): Handle destination
+ registers being referenced in the address correctly.
-Thu Dec 11 23:50:17 1997 John F. Carr <jfc@mit.edu>
+ * expmed.c (make_tree) [CONST_INT]: Sign extend even if
+ TREE_UNSIGNED, when bitsize of type's mode is larger than
+ HOST_BITS_PER_WIDE_INT.
- * tree.c, tree.h: Change tree_code_type, tree_code_length, and
- tree_code_name from pointers to arrays.
- * tree.c: Remove standard_tree_code_* variables, no longer used.
- * print-tree.c: Remove declaration of tree_code_name.
+Fri Aug 21 19:31:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
- * cp/lex.c (init_lex): Update for tree_code_* changes.
- * objc/objc-act.c (init_objc): Likewise.
+ * tree.def (LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR): New tree nodes.
+ * tree.h (LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY,
+ EXIT_BLOCK_LABELED_BLOCK, EXIT_BLOCK_RETURN, LOOP_EXPR_BODY): New
+ macros.
+ * expr.c (expand_expr): Handle LABELED_BLOCK_EXPR and
+ EXIT_BLOCK_EXPR.
- * tree.def, cp/cp-tree.def, objc/objc-tree.def: Update for tree_code
- changes.
+Thu Aug 20 19:43:44 1998 Jeffrey A Law (law@cygnus.com)
-Thu Dec 11 23:34:54 1997 Fred Fish <fnf@ninemoons.com>
+ * h8300.c (h8300_encode_label): Use '&' for tiny data items.
+ * h8300.h (TINY_DATA_NAME_P): Likewise.
+ (STRIP_NAME_ENCODING): Handle '&'.
- * config.sub: Add support for BeOS target.
- * configure.in: Likewise.
- * ginclude/stdarg.h: Likewise.
- * ginclude/stddef.h: Likewise.
- * ginclude/varargs.h: Likewise.
- * rs6000/beos.h: New file for BeOS.
- * rs6000/t-beos: Likewise.
- * rs6000/x-beos: Likewise.
- * rs6000/xm-beos.h: Likewise.
- * toplev.c (get_run_time): Just return 0 on BeOS.
-
-Thu Dec 11 23:25:23 1997 Jeffrey A Law (law@cygnus.com)
- Toon Moene (toon@moene.indiv.nluug.nl)
-
- * m68k.h (GO_IF_LEGITIMATE_ADDRESS): No longer cater to horribly
- old and broken Sun3 assemblers. Newer versions handle large
- offsets correctly as does the GNU assembler.
-
-Thu Dec 11 23:06:48 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * objc/objc-act.c (lang_report_error_function): Disable.
- * objc/objc-parse.y: Include "output.h".
- (yyerror): Remove redundant decl.
- (yyprint): Fix prototype.
- (apply_args_register_offset): Remove redundant decl.
- (get_file_function_name): Likewise.
-
-Thu Dec 11 22:02:10 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * flow.c (find_basic_blocks): A CALL_INSN that can throw starts
- a new basic block.
- (find_basic_blocks_1): Likewise.
-
-Thu Dec 11 21:08:48 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c (use_eh_context): Don't copy_rtx a REG.
- (emit_throw): Lose old unwinder support.
- (expand_internal_throw): Likewise.
- * libgcc2.c (struct eh_context): Likewise.
- (new_eh_context): Likewise.
- (__get_eh_info): Lose redundant cast.
- (__get_dynamic_handler_chain): Likewise.
- (__get_saved_pc): Lose.
- Lose all old unwinder support code.
-
-Thu Dec 11 20:42:18 1997 Teemu Torma <tot@trema.com>
-
- Thread-safe EH support for pthreads, DCE threads and Solaris threads.
-
- * integrate.c (expand_inline_function): If the inline fn uses eh
- context, make sure that the current fn has one.
- * toplev.c (rest_of_compilation): Call emit_eh_context.
- * except.c (use_eh_context): New fn.
- (get_eh_context_once): New fn.
- (call_get_eh_context): New fn.
- (emit_eh_context): New fn.
- (get_eh_context): Call either get_eh_context_once or
- call_get_eh_context, depending on what we have.
- (get_dynamic_handler_chain): Call get_eh_context_once.
- * except.h: Prototypes for fns above.
- * optabs.c (get_eh_context_libfunc): Removed.
- (init_optabs): Don't initialize it.
- * expr.h (get_eh_context_libfunc): Removed.
- * rtl.h, rtl.c: New reg_note REG_EH_CONTEXT.
- * config/pa/pa.h (CPP_SPEC): Support for -threads.
- * config/pa/pa-hpux10.h (LIB_SPEC): Ditto.
- * config/pa/t-pa (MULTILIB_OPTIONS, MULTILIB_DIRNAMES):
- New multilib for -threads.
- * config/sparc/t-sol2: Added multilibs for -threads and
- made -pthreads alias to it.
- * config/sparc/sol2.h (CPP_SPEC, LIB_SPEC):
- Added -threads and -pthreads options.
- * libgcc-thr.h: New file.
- * libgcc2.c: (__get_cpp_eh_context): Removed.
- (struct cpp_eh_context): Removed.
- (struct eh_context): Replaced cpp_eh_context with generic language
- specific pointer.
- (__get_eh_info): New function.
- (__throw): Check eh_context::info.
- (__sjthrow): Ditto.
- * libgcc2.c: Include libgcc-thr.h.
- (new_eh_context, __get_eh_context,
- eh_pthread_initialize, eh_context_initialize, eh_context_static,
- eh_context_specific, eh_context_free): New functions.
- (get_eh_context, eh_context_key): New variables.
- (__sjthrow, __sjpopnthrow, __eh_pcnthrow, __throw): Use
- get_eh_context to get the context.
- (longjmp): Move the declaration inside
- #ifdef DONT_USE_BUILTIN_SETJMP.
- * frame.c: Include libgcc-thr.h.
- (object_mutex): Mutex to protect the object list.
- (find_fde, __register_frame, __register_frame_table,
- __deregister_frame): Hold the lock while accessing objects.
- * except.h (get_eh_context): Declare.
- * except.c (current_function_ehc): Define.
- (current_function_dhc, current_function_dcc): Removed.
- (get_eh_context): New function.
- (get_dynamic_handler_chain): Use get_eh_context.
- (get_saved_pc_ref): Ditto.
- (get_dynamic_cleanup_chain): Removed references to
- current_function_dcc.
- (save_eh_status, restore_eh_status): Save and restore
- current_function_ehc instead.
- * optabs.c (get_eh_context_libfunc): New variable.
- (init_optabs): Initialize it.
- * expr.h: Declare get_eh_context_libfunc.
- * function.h (struct function): Replaced dhc and dcc with ehc.
- * except.c (get_saved_pc_ref): New functions.
- (eh_saved_pc_rtx, eh_saved_pc): Deleted.
- (expand_internal_throw_indirect): Use get_saved_pc_ref() instead
- of eh_saved_pc.
- (end_eh_unwinder): Likewise.
- (init_eh): Remove initialization of eh_saved_pc.
- * optabs.c (get_saved_pc_libfunc): New variable.
- (init_optabs): Initialize it.
- * expr.h: Declare get_saved_pc_libfunc.
- * except.h (eh_saved_pc_rtx): Deleted.
- (get_saved_pc_ref): Declared.
-
- From Scott Snyder <snyder@d0sgif.fnal.gov>:
- * libgcc2.c (__get_saved_pc): New.
- (__eh_type, __eh_pc): Deleted.
- (__eh_pcnthrow): Use __get_saved_pc() instead of __eh_pc.
- (__get_dynamic_handler_chain): Move __dynamic_handler_chain inside
- this fcn.
-
-Thu Dec 11 17:23:48 1997 John F. Carr <jfc@mit.edu>
-
- * sparc/sol2.h: Use 64 bit multiply and divide functions in
- Solaris libc. Define TARGET_LIVE_G0 and TARGET_BROKEN_SAVERESTORE
- as 0.
-
- * rtl.h (global_rtl): New variable, replacing separate variables for
- commonly used rtl.
- (const_int_rtx): Now array of rtx_def, not rtx.
- * emit-rtl.c: Update for new rtl data structures.
- * genattrtab.c: Define global_rtl.
-
-Thu Dec 11 15:50:29 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * configure.in ({rs6000,powerpc}-*-*): Enable Haifa scheduler by
- default.
-
-Wed Dec 10 12:30:18 1997 Anthony Green <green@cygnus.com>
-
- * crtstuff.c (__do_global_ctors): Fix typo.
-
-Tue Dec 9 09:43:59 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * toplev.c (main): Check HAVE_GETRLIMIT and HAVE_SETRLIMIT in addition
- to RLIMIT_STACK to see if we can call getrlimit and setrlimit.
-
-Tue Dec 9 09:38:58 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (FUNCTION_ARG_PADDING): Define.
- * rs6000.c (function_arg_padding): New function.
-
-Tue Dec 9 10:34:21 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * m68k.c: Include tree.h only once.
-
-Tue Dec 9 09:32:33 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * integrate.c (save_for_inline_copying): Make a new reg_parm_stack_loc.
-
-Tue Dec 9 01:16:06 1997 Jeffrey A Law (law@cygnus.com)
-
- * Partially cleaned up prototyping code from HJ.
- * tree.h: Add many prototypes.
- * haifa-sched.c (haifa_classify_insn): Renamed from classify_insn.
- All references changed.
- * rtl.h: Protect from multiple inclusions. Add many prototypes.
+ * mn10200.h (REG_OK_FOR_INDEX_P): Do not check the mode of the
+ register (it could be accessed via an outer SUBREG).
+ (REG_OK_FOR_BASE_P): Likewwise.
+ (GO_IF_LEGITIMATE_ADDRESS): Consistently use REGNO_OK_FOR_BASE_P.
-Tue Dec 9 01:15:15 1997 Fred Fish <fnf@ninemoons.com>
+ * remove.c (optimize_reg_copy_3): Abort instead of silently generating
+ bogus rtl.
- * libgcc2.c (string.h): Hoist inclusion to occur before first use of
- string functions like strlen.
+ * jump.c (rtx_renumbered_equal_p): Do not consider PLUS commutative.
-Tue Dec 9 00:57:38 1997 Manfred Hollstein <manfred@s-direktnet.de>
+Thu Aug 20 17:35:20 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * configure.in: Check for functions getrlimit and setrlimit.
- * cccp.c (main): Check HAVE_GETRLIMIT and HAVE_SETRLIMIT in addition
- to RLIMIT_STACK to see if we can call getrlimit and setrlimit.
+ * config/sparc/sparc.md (movtf_insn_sp32): All memory operands
+ must be offsettable so the splits can be made.
-Mon Dec 8 23:53:26 1997 Jay Sachs <sachs@bull.cs.williams.edu>
+Thu Aug 20 13:56:53 1998 Michael Meissner <meissner@cygnus.com>
- * Makefile.in (compare*): Handle losing behavior from 4.4bsd make.
+ * config/i386/winnt.c: Include system.h, not stdio.h to get
+ sys/param.h pulled in before rtl.h in case the system defines MIN
+ and MAX.
-Mon Dec 8 21:03:28 1997 Richard Henderson <rth@cygnus.com>
+Thu Aug 20 13:44:20 1998 David Edelsohn <edelsohn@mhpcc.edu>
- * alpha.c (REG_RA, alpha_return_addr, output_epilog):
- Fix merge problems.
+ * rs6000.md (movqi, movhi): Add CONSTANT_P_RTX.
- * alpha.c (override_options): Don't know about scheduling for EV6.
- * alpha.md (ev5 function units): Don't overload as ev6.
+Thu Aug 20 13:15:11 1998 Dave Brolley <brolley@cygnus.com>
- * alpha.c (alpha_adjust_cost): Simplify. Fix typo in ev5 mult case.
- * alpha.md (define_attr type): Add mvi.
- (ev5_e0): Define sceduling parameters for it.
- (TARGET_MAX insns): Type is mvi not shift.
+ * stor-layout.c (layout_type): Compute TYPE_SIZE_UNIT correctly for
+ arrays of bits.
+ * cpplib.c (cpp_define): Handle macros with parameters.
-Mon Dec 8 18:15:00 1997 Richard Henderson <rth@cygnus.com>
+Wed Aug 19 21:33:19 1998 David Edelsohn <edelsohn@mhpcc.edu>
- * alpha/win-nt.h (TRAMPOLINE_TEMPLATE): Fix backported gcc-2.8 bug.
+ * rs6000.c (rs6000_output_load_toc_table): Use ld for 64-bit.
+ (output_toc): Use single TOC slot or llong minimal-toc for DFmode
+ and DImode 64-bit. Use llong for minimal-toc SFmode and
+ SYMBOL_REF / LABEL_REF 64-bit.
+ (output_function_profiler): Use llong for profiler label and ld to
+ load 64-bit label address.
-Mon Dec 8 21:17:28 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+Wed Aug 19 17:52:27 1998 Nick Clifton (nickc@cygnus.com)
- * cstamp-h, auto-config.h: Delete.
+ * config/arm/thumb.md (extendqisi2_insn): Cope with REG +
+ OFFSET addressing.
-Sun Dec 7 19:19:03 1997 Jeffrey A Law (law@cygnus.com)
+Wed Aug 19 14:13:31 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
-Sat Dec 6 22:22:22 1997 Jeffrey A Law (law@cygnus.com)
-
- * cccp.c: Fix typo brought over in merge.
-
- * Merge in changes from gcc-2.8.
-
-Mon Nov 3 05:45:32 1997 Philippe De Muyter <phdm@macqel.be>
-
- * m68k.c: Include tree.h for dwarf2out_cfi_label.
-
- * gcc.c (process_command): Do not take address of function fatal when
- calling lang_specific_driver.
-
-Sat Dec 6 01:02:38 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * config/i386/cygwin32.h (DWARF2_UNWIND): Exception handling
- doesn't work with it yet, so set it to 0.
- * config/i386/xm-cygwin32.h (NO_SYS_SIGLIST): Define.
-
-Sat Dec 6 01:01:02 1997 Christian Iseli <Christian.Iseli@lslsun.epfl.ch>
-
- * cse.c (cse_insn): Check for invalid entries when taking references.
-
-Fri Dec 5 18:26:25 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * loop.c (invariant_p): Don't test flag_rerun_loop_opt.
- (loop_optimize, scan_loop, strength_reduce): New argument unroll_p.
- * toplev.c (rest_of_compilation): Pass it. Remove code to
- save / clear / restore flag_unroll_{,all_}loops.
-
-Fri Dec 5 16:26:03 1997 Bernd Schmidt <crux@ohara.Informatik.RWTH-Aachen.DE>
-
- * i386.c (notice_update_cc): Remove bogus pentium GCC code.
-
-Fri Dec 5 16:25:14 1997 Jeffrey A Law (law@cygnus.com)
-
- * stmt.c (warn_if_unused_value): Don't warn for TRY_CATCH_EXPR.
-
-Thu Dec 4 11:51:00 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c (get_dynamic_handler_chain): Only make the call once per
- function.
-
- * except.c (expand_end_all_catch): Fix for sjlj exceptions.
-
-Thu Dec 4 12:30:40 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (final_prescan_insn): Use local label prefix
- when emitting .uses pseudo-ops.
-
-Wed Dec 3 12:01:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (__throw): Use __builtin_return_addr instead of __eh_pc.
- * except.c: Lose outer_context_label_stack.
- (expand_eh_region_end): Rethrow from outer_context here.
- (expand_fixup_region_end): Let expand_eh_region_end do the rethrow.
- (expand_internal_throw): Take no args.
- (expand_internal_throw_indirect): Lose.
- (expand_leftover_cleanups, expand_start_all_catch): Use expand_rethrow.
- (expand_start_all_catch): Start a rethrow region.
- (expand_end_all_catch): End it.
- (expand_rethrow): New fn.
- * except.h: Reflect above changes.
- * flow.c: Revert change of Nov 27.
-
-Thu Dec 4 00:24:09 1997 Jeffrey A Law (law@cygnus.com)
-
- * i386/t-sol2 (CRTSTUFF_T_CFLAGS): Turn on the optimizer.
-
-Wed Dec 3 12:01:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c (expand_fixup_region_end): New fn.
- (expand_fixup_region_start): Likewise.
- (expand_eh_region_start_tree): Store cleanup into finalization here.
- * stmt.c (expand_cleanups): Use them to protect fixups.
-
-Wed Dec 3 11:41:13 1997 Gavin Koch <gavin@cygnus.com>
-
- * mips/mips.md (muldi3_r4000): Broaden the output template
- and attribute assignments to handle three operand dmult;
- rename to muldi3_internal2.
- (muldi3): Call the new muldi3_internal2 for R4000, and
- any GENERATE_MULT3 chip.
-
-Tue Dec 2 19:40:43 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stmt.c (expand_decl_cleanup): Update thisblock after eh_region_start.
-
-Tue Dec 2 12:54:33 1997 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (find_splittable_givs): Remove last change. Handle givs
- with a dest_reg that was created by loop.
-
-Sat Nov 29 12:44:57 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (function_arg_partial_nregs): Undo Nov. 26 patch.
-
- * rs6000/aix41.h (ASM_CPU_SPEC): Define.
-
-Fri Nov 28 10:00:27 1997 Jeffrey A Law (law@cygnus.com)
-
- * configure.in: Fix NCR entries.
-
-Thu Nov 27 12:20:19 1997 Jeffrey A Law (law@cygnus.com)
-
- * flow.c (find_basic_blocks): Handle cfg issues for rethrows and
- nested exceptions correctly.
-
- * unroll.c (find_splittable_givs): Don't split givs with a dest_reg
- that was created by loop.
-
-Thu Nov 27 09:34:58 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (preexpand_calls): Don't look past a TRY_CATCH_EXPR.
-
- * except.c (expand_start_all_catch): One more do_pending_stack_adjust.
-
-Wed Nov 26 15:47:30 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (SMALL_DATA_REG): Register to use for small data relocs.
- (print_operand): Use SMALL_DATA_REG for the register involved in
- small data relocations.
- (print_operand_address): Ditto.
-
- * rs6000/linux.h (LINK_SPEC): Pass -dynamic-linker /lib/ld.so.1 if
- -dynamic linker is not used.
-
- * rs6000.md (call insns): For local calls, use @local suffix under
- System V. Don't use @plt under Solaris.
-
- * rs6000.c (output_function_profiler): Put label address in r0, and
- store LR in 4(sp) for System V/eabi.
-
- * rs6000.h (ASM_OUTPUT_REG_{PUSH,POP}): Keep stack aligned to 16
- byte boundary, and maintain stack backchain.
-
-Tue Nov 25 14:08:12 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (fix_truncdfsi2, fix_truncsfsi2, fix_truncdfdi2,
- fix_truncsfdi2): Change *.
-
-Wed Nov 26 11:12:26 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (main): Complain about -gdwarfn.
-
-Tue Nov 25 22:43:30 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarfout.c (output_type): If finalizing, write out nested types
- of types we've already written.
-
-Tue Nov 25 20:32:24 1997 Michael Meissner <meissner@cygnus.com>
-
- (patches originally from Geoffrey Keating)
- * rs6000.c (function_arg): Excess floating point arguments don't
- go into GPR registers after exhausting FP registers under the
- System V.4 ABI.
- (function_arg_partial_nregs): Ditto.
-
- * rs6000.md (call insns): If -fPIC or -mrelocatable, add @plt
- suffix to calls.
-
-Tue Nov 25 23:37:27 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * integrate.c (output_inline_function): Just unset DECL_INLINE.
-
-Tue Nov 25 23:33:29 1997 scott snyder <snyder@d0sgif.fnal.gov>
-
- * dwarf2out.c (outout_call_frame_info): Ensure that the info has
- proper alignment.
-
- * libgcc2.c (__throw): Initialize HANDLER.
-
-Tue Nov 25 14:08:12 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (fix_truncdfsi2, fix_truncsfsi2, fix_truncdfdi2,
- fix_truncsfdi2): Change *X to ?*X.
-
-Tue Nov 25 10:00:42 1997 Richard Henderson (rth@cygnus.com)
-
- * alpha.h (CONST_OK_FOR_LETTER): Fix 'L' handling.
-
-Tue Nov 25 10:00:42 1997 Jeffrey A Law (law@cygnus.com)
-
- * crtstuff.c (do_global_dtors_aux): Handle multiple calls better.
-
-Tue Nov 25 01:26:55 1997 Bruno Haible <haible@ilog.fr>:
-
- * dwarf2out.c (ASM_OUTPUT_DWARF_DELTA1): Implement.
-
-Mon Nov 24 22:41:55 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c (get_dynamic_handler_chain): Build up a FUNCTION_DECL.
- * optabs.c (init_optabs): Lose get_dynamic_handler_chain_libfunc.
- * expr.h: Likewise.
-
-Sat Nov 22 18:58:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa-hpux10.h (NEW_HP_ASSEMBLER): Define.
- * pa.h (LEGITIMATE_CONSTANT_P): Reject LABEL_REFs if not using
- gas and not using the new HP assembler.
-
-Fri Nov 21 15:20:05 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (program_transform_cross_name): Clean up "-e" confusion.
- (GCC_INSTALL_NAME, GCC_CROSS_NAME): Likewise.
-
-Fri Nov 21 19:37:40 1997 Andrew Cagney <cagney@b1.cygnus.com>
-
- * config/mips/elf64.h (MULTILIB_DEFAULTS): Test for
- TARGET_ENDIAN_DEFAULT == zero instead of testing for macro
- definition.
-
-Fri Nov 21 12:49:56 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * stmt.c (expand_end_bindings): Allow jump into block with cleanups.
-
-Fri Nov 21 12:18:51 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.h: Add outer_context_label_stack.
- * except.c: Likewise.
- (expand_start_all_catch): Push the outer_context for the try block
- onto outer_context_label_stack.
- (expand_end_all_catch): Use it and pop it.
-
-Fri Nov 21 10:13:11 1997 Robert Lipe (robertl@dgii.com)
-
- * i386/sco5.h (HAVE_ATEXIT): Revert last change.
-
-Thu Nov 20 16:11:50 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_emit_set_const_1): Handle narrow hosts better.
-
-Thu Nov 20 16:11:50 1997 Klaus Kaempf <kkaempf@progis.de>
-
- * alpha/vms.h (ASM_OUTPUT_ADDR_VEC_ELT): Add an L for the local label
- to correspond with the change to ASM_GENERATE_INTERNAL_LABEL.
-
-Thu Nov 20 14:42:15 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (LIB2FUNCS): Remove C++ memory management support.
- * libgcc2.c: Remove __builtin_new, __builtin_vec_new, set_new_handler,
- __builtin_delete, and __builtin_vec_delete.
-
- * except.c (output_exception_table): Don't bother with
- __EXCEPTION_END__.
-
-Thu Nov 20 16:11:50 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (pre_stwm, post_stwm, pre_ldwm, post_ldwm): Base register
- is an in/out operand.
- (zero extended variants of stwm/stwm patterns): Similarly.
-
- * mips/x-iris (FIXPROTO_DEFINES): Add -D_SGI_SOURCE.
-
-Thu Nov 20 13:19:32 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (ASM_OUTPUT_DWARF_OFFSET4): Rename from VALUE4.
- Use assemble_name.
- (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Use assemble_name.
- (output_call_frame_info): Emit a \n after using it.
-
-Thu Nov 20 00:38:46 1997 Dave Love <d.love@dl.ac.uk>
-
- * configure.in: Add AC_ARG_ENABLE for Haifa as documentation.
-
-Wed Nov 19 12:03:04 1997 Philippe De Muyter <phdm@macqel.be>
-
- * dwarf2out.c (CIE_LENGTH_LABEL, FDE_LENGTH_LABEL): New macros.
- (ASM_OUTPUT_DWARF_VALUE4): New macro.
- (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Define if SET_ASM_OP is
- defined.
- (output_call_frame_info): Do not output forward label differences
- if ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL is defined.
- * m68k/mot3300.h (SET_ASM_OP): Define when not using gas.
-
-Tue Nov 18 23:03:30 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (attribute "type"): Add nil.
- (movsi_ie): y/y alternative is type nil.
- (movsf_ie): Replace ry/yr/X alternative by r/y/X , y/r/X and y/y/X
- alternatives.
- (movsf_ie+1): Delete.
-
-Tue Nov 18 15:39:59 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips/mips.c (save_restore_insns): If gp_offset or fp_offset are
- large_int, emit two insns instead of one splitable insn.
- * dwarf2out.c (dwarf2out_frame_debug): When set cfa_store_offset
- from cfa_temp_value, use cfa_offset. Add assert checking that
- cfa_reg is SP.
-
-Mon Nov 17 15:35:38 1997 Tom Tromey <tromey@cygnus.com>
-
- * cccp.c (deps_output): Properly quote file names for make.
-
-Mon Nov 17 13:21:40 1997 Jeffrey A Law (law@cygnus.com)
-
- * t-h8300 (MULTILIB_EXCEPTIONS): Define.
-
-Fri Nov 7 15:33:11 1997 Robert Lipe (robertl@dgii.com)
-
- * i386/sco5.h (HAVE_ATEXIT): Delete definition.
-
-Sun Nov 16 23:52:48 1997 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (cse_insn): Don't look at JUMP_LABEL field of a conditionl
- return.
- (cse_end_of_basic_block): Similarly.
-
-Sun Nov 16 23:01:40 1997 J. Kean Johnston <jkj@sco.com>
-
- * i386/sco5.h (ASM_OUTPUT_ALIGNED_BSS): Define.
- (SELECT_RTX_SECTION): Define.
- (LIBGCC_SPEC, LIB_SPEC): Do the right thing for PIC.
-
-Sun Nov 16 22:47:03 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (compare, compare-lean): Define $stage for each
- shell command.
- (gnucompare, gnucompare-lean): Likewise.
-
-Sun Nov 16 22:02:16 1997 Richard Henderson (rth@cygnus.com)
-
- * alpha/win-nt.h (TRAMPOLINE_TEMPLATE): Fix offsets.
-
- * alpha.h (ASM_OUTPUT_ADDR_DIFF_ELT): Add an L for the local label
- to correspond with the change to ASM_GENERATE_INTERNAL_LABEL.
-
-Fri Nov 14 09:09:20 1997 Fred Fish (fnf@cygnus.com)
-
- * dwarfout.c (byte_size_attribute): Add local var upper_bound
- and add case to handle STRING_TYPE.
- * dwarfout.c (output_string_type_die): Fix code to generate
- correct string length attribute for fixed length strings.
- Still needs support for varying length strings.
-
-Fri Nov 14 08:46:56 1997 Jeffrey A Law (law@cygnus.com)
-
- * toplev.c (get_run_time): Do something sensible for cygwin32.
-
-Fri Nov 14 07:24:20 1997 Richard Henderson <rth@cygnus.com>
-
- * expr.c (expand_builtin_setjmp): Set
- current_function_has_nonlocal_label.
- * stupid.c (stupid_life_analysis): If has_nonlocal_label, kill
- call-saved registers across calls.
-
- * alpha.md (exception_receiver): Remove.
- (nonlocal_goto_receiver_osf): New
- (nonlocal_goto_receiver_vms): Renamed from nonlocal_goto_receiver.
- (nonlocal_goto_receiver): New, select _osf or _vms.
-
- * alpha.c (output_prolog [*]): Prefix entry labels with '$' to
- keep them from being propogated to the object file.
- (alpha_write_linkage): Likewise.
- * alpha.md (call_vms): Likewise.
- (call_value_vms): Likewise.
- (unnamed osf call insns): Likewise.
-
- * alpha.h (ASM_OUTPUT_INTERNAL_LABEL): Don't omit L from local label.
- (ASM_GENERATE_INTERNAL_LABEL): Likewise.
-
- * alpha.c (call_operand): Any reg is valid for WinNT.
- * alpha.md (call_nt, call_value_nt): Don't force address into $27.
- (anon nt calls): Add 'R' alternative.
- * alpha/win-nt.h (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE,
- INITIALIZE_TRAMPOLINE): Handle lack of original $27 and 32-bit ptrs.
-
-Fri Nov 14 06:59:33 1997 Jeffrey A Law (law@cygnus.com)
-
- * calls.c (expand_call): Handle pcc_struct_value correctly for C++.
-
- * i386/xm-cygwin32.h (HAVE_FILE_H, HAVE_RUSAGE): Delete defines.
- * i386/xm-mingw32.h (HAVE_FILE_H, HAVE_RUSAGE): Likewise.
- * rs6000/xm-cygwin32.h (HAVE_FILE_H, HAVE_RUSAGE): Likewise.
-
-Thu Nov 13 20:37:33 1997 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * reload1.c (new_spill_reg): Improve fixed or forbidden register
- spill error message.
-
-Thu Nov 13 20:29:08 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * prefix.c: Use stdarg.h only ifdef __STDC__. Otherwise,
- use varargs.h. Wrap header with <>, not "".
-
-Thu Nov 13 20:21:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * integrate.c (save_for_inline_copying): Add return value from
- savealloc.
-
-Thu Nov 13 19:12:33 1997 Brendan Kehoe <brendan@cygnus.com>
-
- * fixincludes: Be a little more restrictive on what we will
- substitute to replace definitions of MAXINT for HPUX.
-
-Thu Nov 13 18:41:02 1997 Michael Meissner <meissner@cygnus.com>
-
- * dbxout.c (dbxout_symbol_location): Don't assume that variables
- whose address is the stack or argument pointers are indirect
- pointers.
-
-1997-11-13 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c, cpplib.c (compare_defs):
- Don't complain about arg name respellings unless pedantic.
- * cpplib.c (compare_defs): Accept pfile as new arg.
- All callers changed.
-
-Thu Nov 13 23:33:50 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * fold-const.c (fold_truthop): Fix bug in last change.
-
-1997-11-13 Paul Eggert <eggert@twinsun.com>
-
- Fix some confusion with IEEE minus zero.
-
- * real.h (REAL_VALUES_IDENTICAL): New macro.
-
- * expr.c (is_zeros_p): Don't consider -0.0 to be all zeros.
- * fold-const.c (operand_equal_p): Don't consider -0.0 to be
- identical to 0.0.
- * tree.c (simple_cst_equal): Don't consider -0.0 to have the
- same tree structure as 0.0.
-
- * varasm.c (immed_real_const_1): Use new REAL_VALUES_IDENTICAL
- macro instead of doing it by hand.
-
-Thu Nov 13 16:56:14 1997 Jeffrey A Law (law@cygnus.com)
-
- * v850/lib1funcs.asm: Minor whitespace changes.
- * v850.c: Fix minor formatting problems in many places.
- (construct_restore_jr, construct_save_jarl): Remove unwanted aborts.
-
-Thu Nov 13 12:53:44 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete code swapping xplus0 and
- xplus1 when xplus0 is not a register.
-
-Thu Nov 13 11:41:42 1997 Jeffrey A Law (law@cygnus.com)
-
- * flow.c (find_basic_blocks): During marking phase, if we encounter
- an insn with a REG_LABEL note, make the target block live and
- create an edge from the insn to the target block. Do not make
- edges from all blocks to the target block.
-
- * m68k/x-next (OTHER_FIXINCLUDES_DIRS): Include /NextDeveloper/Headers.
-
- * confiugre.in: Tweak NCR entries.
- * configure: Rebuilt.
-
-Thu Nov 13 11:07:41 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (num_insns_constant): Use REAL_VALUE_FROM_CONST_DOUBLE to
- pick apart floating point values, instead of using CONST_DOUBLE_LOW
- and CONST_DOUBLE_HIGH.
-
- * rs6000.md (define_splits for DF constants): Use the appropriate
- REAL_VALUE_* interface to pick apart DF floating point constants in
- a machine independent fashion.
-
-Thu Nov 13 00:06:58 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * fold-const.c (fold_truthop): When changing a one-bit comparison
- against zero into a comparison against mask, do a proper sign
- extension.
-
-Wed Nov 12 09:37:01 1997 Jeffrey A Law (law@cygnus.com)
-
- * except.c: Do not include "assert.h".
- (save_eh_status): Turn asserts into conditional aborts.
- (restore_eh_status, scan_region): Likewise.
- * dwarfout.c: Do not include "assert.h".
- (bit_offset_attribute): Turn asserts into conditional aborts.
- (bit_size_attribute, output_inlined_enumeration_type_die): Likewise.
- (output_inlined_structure_type_die): Likewise.
- (output_inlined_union_type_die): Likewise
- (output_tagged_type_instantiation): Likewise.
- (dwarfout_file_scope_decl): Likewise.
- * dwarf2out.c: Do not include "assert.h"
- (expand_builtin_dwarf_reg_size): Turn asserts into conditional aborts.
- (reg_save, initial_return_save, dwarf2out_frame_debug): Likewise.
- (add_child_die, modified_type_die, add_bit_offset_attribute): Likewise.
- (add_bit_size_attribute, scope_die_for): Likewise.
- (output_pending_types_for_scope): Likewise.
- (get_inlined_enumeration_type_die): Likewise.
- (get_inlined_structure_type_die): Likewise.
- (get_inlined_union_type_die, gen_subprogram_die): Likewise.
- (gen_tagged_type_instantiation_die): Likewise.
-
- * flow.c (find_basic_blocks): Refine further to get a more correct
- cfg, especially in the presense of exception handling, computed
- gotos, and other non-trivial cases. Call abort if an inaccuracy
- is detected in the cfg.
-
-Tue Nov 11 21:47:27 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * glimits.h (SHRT_MIN): Define in a way suitable for 16 bit hosts.
-
- * c-lex.c (whitespace_cr, skip_white_space_on_line): New functions.
- (skip_white_space): Use whitespace_cr.
- (check_newline): Handle whitespace more consistently.
-
-Tue Nov 11 16:25:49 1997 Jim Wilson <wilson@cygnus.com>
-
- * i386/cygwin32.h (CPP_PREDEFINES): Delete -DPOSIX.
- * i386/xm-cygwin32.h (POSIX): Define.
-
-Mon Nov 10 20:53:11 1997 Gavin Koch <gavin@cygnus.com>
-
- * config/mips/mips.h (MASK_DEBUG_H): Set to zero, so this bit
- is available elsewhere.
-
-Mon Nov 10 16:21:58 1997 Doug Evans <devans@canuck.cygnus.com>
-
- * sparc/sparc.md (mov[sdt]f_const_insn): Fix condition to match
- what the instruction can handle.
-
-Mon Nov 10 03:02:19 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stmt.c (expand_decl_cleanup_no_eh): New fn.
-
- * except.c (expand_leftover_cleanups): do_pending_stack_adjust.
-
-Mon Nov 10 00:05:56 1997 Jeffrey A Law (law@cygnus.com)
-
- * alias.c (MAX_ALIAS_LOOP_PASSES): Define.
- (init_alias_analysis): Break out of loops after MAX_ALIAS_LOOP_PASSES.
-
-Sun Nov 9 14:34:47 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (lshrdi3_power): Delete '&' from first alternative and
- swap instruction order.
-
-Sun Nov 9 02:07:16 1997 Jeffrey A Law (law@cygnus.com)
-
- * fixinc.svr4 (__STDC__): Add another case.
-
-Sun Nov 9 02:00:29 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * a29k.h (ELIGIBLE_FOR_EPILOGUE_DELAY): Avoid loads from varying
- addresses in the epilogue delay slot.
-
-Sun Nov 9 01:40:40 1997 Manfred Hollstein (manfred@s-direktnet.de)
-
- * m88k/dgux.h (ASM_CPU_SPEC): Reformatted to suppress wrong whitespace
- in generated `specs' file.
-
-Sun Nov 9 01:37:11 1997 Jim Wilson (wilson@cygnus.com)
-
- * flags.h (flag_rerun_loop_opt): Declare.
- * loop.c (invariant_p, case LABEL_REF): Check flag_rerun_loop_opt.
- * toplev.c (flag_rerum_loop_opt): Delete static.
-
-Sat Nov 8 18:20:21 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- Bring over from FSF:
-
- Thu Oct 30 12:21:06 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * va-sh.h (__va_arg_sh1): Define.
- (va_arg): Use it.
- SH3E doesn't use any integer registers for subsequent arguments
- once a non-float value was passed in the stack.
- * sh.c (machine_dependent_reorg): If optimizing, put explicit
- alignment in front label for ADDR_DIFF_VEC.
- * sh.h (PASS_IN_REG_P): Fix SH3E case.
- (ADJUST_INSN_LENGTH): If not optimizing, add two extra bytes length.
-
- Tue Oct 28 15:06:44 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Undefine before including
- svr4.h.
-
- Mon Oct 27 16:11:52 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (machine_dependent_reorg): When -flag_delayed_branches,
- put an use_sfunc_addr before each sfunc.
- * sh.md (use_sfunc_addr, dummy_jump): New insns.
- (casesi): For TARGET_SH2, emit a dummy_jump after LAB.
-
- Tue Oct 21 07:12:28 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Don't redefine.
-
-Fri Nov 7 10:22:24 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * frame.c (add_fdes, count_fdes): Go back to checking pc_begin for
- linked once FDEs.
-
-Wed Nov 5 14:26:05 1997 Jeffrey A Law (law@cygnus.com)
-
- * alias.c (find_base_value): Only return the known base value for
- pseudo registers.
-
-Wed Nov 5 11:27:14 1997 Jim Wilson <wilson@cygnus.com>
-
- * i386.c (load_pic_register): Call prologue_get_pc_and_set_got.
- * i386.md (prologue_set_got, prologue_get_pc): Add UNSPEC_VOLATILE
- to pattern.
- (prologue_get_pc_and_set_got): New pattern.
-
-Tue Nov 4 20:36:50 1997 Richard Henderson (rth@cygnus.com)
-
- * alpha.c (summarize_insn): Handle ASM_OPERANDS. Don't recurse
- for SUBREG, just fall through.
-
- * alpha.c (alpha_handle_trap_shadows): Init sum.defd to zero.
-
- * alpha.md (attr trap): Make TRAP_YES non-zero for sanity's sake.
-
-Tue Nov 4 18:49:42 1997 Jeffrey A Law (law@cygnus.com)
-
- * fixincludes: Fix "hypot" prototype in NeXT math.h.
-
- * Makefile.in (USE_ALLOCA): Always include alloca.o.
- (USE_HOST_ALLOCA): Likewise.
-
- * rtl.def (CODE_LABEL): Use separate fields for LABEL_NUSES
- and LABEL_REFS fields.
- * rtl.h (LABEL_REFS): Update.
-
-Tue Nov 4 16:55:11 1997 Jim Wilson <wilson@cygnus.com>
-
- * combine.c (try_combine): When setting elim_i2, check whether newi2pat
- sets i2dest. When calling distribute_notes for i3dest_killed, pass
- elim_i2 and elim_i1. When setting elim_i1, check if newi2pat
- sets i1dest.
-
- * mips.md (insv, extzv, extv): Add change_address call.
- (movsi_ulw, movsi_usw): Change QImode to BLKmode in pattern.
-
- * integrate.c (save_for_inline_copying): Copy parm_reg_stack_loc.
-
- * reload.c (find_reloads, case 'm' and 'o'): Reject HIGH constants.
-
- * mips.c (mips_expand_epilogue): Emit blockage insn before call to
- save_restore_insns if no FP and GP will be restored.
-
- * dwarf2out.c (expand_builtin_dwarf_reg_size): New variable mode.
- Convert CCmode to word_mode before calling GET_MODE_SIZE.
-
- * acconfig.h (HAVE_INTTYPES_H): Undef.
- * configure.in (inttypes.h): Check for conflicts between sys/types.h
- and inttypes.h, and verify that intmax_t is defined.
- * config/mips/x-iris (CC, OPT, OLDCC): Comment out.
- * config/mips/x-iris3: Likewise.
-
-Tue Nov 4 16:07:15 1997 Jeffrey A Law (law@cygnus.com)
-
- * alias.c (find_base_value): When copying arguments, return the
- tenative value for a hard register.
-
-Tue Nov 4 13:40:35 1997 Doug Evans <devans@canuck.cygnus.com>
-
- * c-lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
- (yylex): Record wide strings using target endianness, not host.
-
-Tue Nov 4 13:13:12 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10200.h (ASM_OUTPUT_BSS): Delete.
- (ASM_OUTPUT_ALIGNED_BSS): New macro
- * mn10300.h (ASM_OUTPUT_BSS): Delete.
- (ASM_OUTPUT_ALIGNED_BSS): New macro.
- * v850.h (ASM_OUTPUT_BSS): Delete.
- (ASM_OUTPUT_ALIGNED_BSS): New macro.
-
-Tue Nov 4 00:55:48 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * profile.c (branch_prob): Insert an insn after a NOTE_INSN_SETJMP.
-
-Mon Nov 3 14:36:50 1997 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (sco5): Use cpio to install header files.
-
-Sun Nov 2 23:31:43 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * aclocal.m4 (conftestdata_from, conftestdata_to): Names shortened to
- 14 char length.
- * configure: Rebuild.
-
-Sun Nov 2 19:44:00 1997 Robert Lipe (robertl@dgii.com)
-
- * i386/sco5.h: enable -gstabs once again.
-
-Sun Nov 2 19:27:21 1997 Jeffrey A Law (law@cygnus.com)
-
- * arm.c (output_move_double): Allocate 3 entries in otherops array.
-
-Sat Nov 1 21:43:00 1997 Mike Stump (mrs@wrs.com)
-
- * except.c (expand_ex_region_start_for_decl): Emit EH_REGION_BEG
- notes for sjlj exceptions too.
- (expand_eh_region_end): Similarly for EH_REGION_END notes.
- (exception_optimize): Optimize EH regions for sjlj exceptions too.
- * final.c (final_scan_insn): Don't output labels for EH REGION
- notes if doing sjlj exceptions.
-
-Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com)
-
- * alias.c (init_alias_analysis): Handle -fno-alias-check when
- optimizing correctly.
-
- * expr.c (expand_builtin_setjmp): Don't emit a SETJMP note
- or set current_function_calls_setjmp anymore.
-
- * flow.c (find_basic_blocks): If we delete the label for an
- exception handler, remove it from the EH label list and remove
- the EH_BEGIN/EH_END notes for that EH region.
-
-Sat Nov 1 16:44:49 1997 Jason Merrill (jason@cygnus.com)
-
- * flow.c (find_basic_blocks): Generate correct flow control
- information when exception handling notes are present.
-
-Sat Nov 1 13:42:19 1997 Jeffrey A Law (law@cygnus.com)
-
- * dwarf2out.c (output_call_frame_info): Fix length argument
- to ASM_OUTPUT_ASCII.
- (output_die, output_pubnames, output_line_info): Likewise.
-
-Fri Oct 31 07:10:09 1997 Jeffrey A Law (law@cygnus.com)
+Wed Aug 19 13:10:30 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
- * dwarf2out.c (output_call_frame_info): Use ASM_OUTPUT_ASCII to
- output ASCII by default. Only use ASM_OUTPUT_DWARF_STRING if
- flag_debug_asm is on.
- (output_die, output_pubnames, output_line_info): Likewise.
-
- * alias.c (init_alias_analysis): Add struct_value_incoming_rtx
- and static_chain_rtx into the potential base values array if
- they are registers.
-
- * alias.c (new_reg_base_value): New array of potential base values.
- (unique_id): Now file scoped static.
- (find_base_value, case REG): Return the value in reg_base_value
- array for the REG if it exists. Else, return the value from
- new_reg_base_value if copying args and REG is a hard register.
- (find_base_value, case PLUS): If either operand of the PLUS is
- a REG, try to get its base value. Handle base + index and
- index + base.
- (record_set): Use new_reg_base_value instead of reg_base_value.
- (init_alias_analysis): Allocate space for new_reg_base_value too.
- Rework code to iterate over the insns propagating base value
- information until nothing changes.
-
- * global.c (global_alloc): Free the conflict matrix after
- reload has finished.
-
-Fri Oct 31 01:45:31 1997 Jason Merrill <jason@yorick.cygnus.com>
+Wed Aug 19 13:06:47 1998 Jason Merrill <jason@yorick.cygnus.com>
- * libgcc2.c (L_eh): Define __eh_pc.
- Replace __eh_type with generic pointer __eh_info.
+ * collect2.c (extract_init_priority): Use atoi instead of strtoul.
-Fri Oct 31 00:34:55 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
+Wed Aug 19 13:51:35 1998 Hans-Peter Nilsson <hp@axis.se>
- * expr.c (expand_increment): When enqueing a postincrement for a MEM,
- use copy_to_reg if address is not a general_operand.
+ * tm.texi (Misc): Fix typo "teh".
-Fri Oct 31 00:16:55 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * tm.texi (PIC): Fix typo "PPIC".
- * profile.c (output_func_start_profiler): Clear flag_inline_functions
- for the duration of the call to rest_of_compilation.
+ * tm.texi (Caller Saves): Say that DEFAULT_CALLER_SAVES has no
+ effect when -O2 and higher.
+ * invoke.texi (Optimize Options): Likewise for -fcaller-saves.
-Thu Oct 30 14:40:10 1997 Doug Evans <devans@canuck.cygnus.com>
+1998-08-19 Michael Hayes <michaelh@ongaonga.chch.cri.nz>
- * configure.in (sparc-*-elf*): Use sparc/elf.h, sparc/t-elf.
- Set extra_parts.
- (sparc*-*-*): Recognize --with-cpu=v9.
- * sparc/elf.h: New file.
- * sparc/t-elf: New file.
+ * regclass.c: Changed register set documentation to be consistent
+ with GCC behaviour.
-Thu Oct 30 13:26:12 1997 Jeffrey A Law (law@cygnus.com)
+ * final.c (final_start_function) Removed redundant test for
+ call_fixed_regs.
- * mn10300.c (const_8bit_operand): New function.
- (mask_ok_for_mem_btst): New funtion.
- * mn10300.md (btst patterns with mem operands): Use new functions
- to avoid creating btst instructions with invalid operands.
+Wed Aug 19 13:28:41 1998 Mark Mitchell <mark@markmitchell.com>
-Wed Oct 29 16:57:19 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/xm-sysv4.h: Include xm-linux.h instead of xm-svr4.h if we
- are running on PowerPC Linux.
-
-Wed Oct 29 13:10:11 1997 Gavin Koch <gavin@cygnus.com>
-
- * config/mips/elf64.h (PREFERRED_DEBUGGING_TYPE): Only define
- if not previously defined.
-
-Tue Oct 28 23:55:27 1997 Doug Evans (devans@cygnus.com)
-
- * function.c (assign_parms): Correct mode of stack_parm if
- entry_parm underwent a mode conversion.
-
-1997-10-28 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * global.c (global_alloc): Use xmalloc instead of alloca for
- CONFLICTS, since max_allocno * allocno_row_words alone can be more
- than 2.5Mb sometimes.
-
-Tue Oct 28 15:29:15 1997 Richard Henderson <rth@cygnus.com>
-
- * reload1.c (eliminate_regs [SET]): If [SUBREG] widened the mode of
- DEST for the spill, adjust mode of SRC to compensate.
-
-Tue Oct 28 14:36:45 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.md (reload_inqi): Check for MEM before strict_memory_address_p,
- since any_memory_operand() allows pseudos during reload.
- (reload_inhi, reload_outqi, reload_outhi): Likewise.
-
-Tue Oct 28 11:53:14 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.md (btst patterns): Add 5200 support.
-
-Tue Oct 28 11:58:40 1997 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * fold-const.c (fold): For ((a * C1) / C3) or (((a * C1) + C2) / C3)
- optimizations, look inside dividend to determine if the expression
- can be simplified by using EXACT_DIV_EXPR.
-
-Tue Oct 28 10:19:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- From Brendan:
- * dwarf2out.c (output_call_frame_info): Use l1 instead of ".".
-
-Tue Oct 28 00:32:14 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (summarize_insn [SUBREG]): Propogate SET.
-
-Mon Oct 27 23:59:26 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_handle_trap_shadows): Don't call get_attr_trap
- on a CLOBBER.
-
-Mon Oct 27 21:25:20 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.md (movqi, movhi): Make sure new insns created during reload
- won't need reloading themselves.
- (reload_inqi, reload_inhi, reload_outqi, reload_outhi): Likewise.
-
-Mon Oct 27 16:11:10 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Disable reg+reg.
-
-Sun Oct 26 13:50:44 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_sa_mask [VMS]): Don't include $26 in the mask.
- Patch from Klaus Kaempf <kkaempf@progis.de>.
-
-Sun Oct 26 13:31:47 1997 Jim Wilson (wilson@cygnus.com)
-
- * expr.c (expand_expr, case INDIRECT_REF): Optimize a reference
- to an element in a constant string.
-
-Sun Oct 26 11:41:49 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (output_call_frame_info): The CIE pointer is now a 32
- bit PC-relative offset. The exception range table pointer is now in
- the CIE.
- * frame.c (dwarf_cie, dwarf_fde): Rename CIE_pointer to CIE_delta.
- (count_fdes, add_fdes, get_cie): Adjust.
- (cie_info, extract_cie_info, __frame_state_for): Adjust eh_ptr uses.
-
- From H.J. Lu:
- * frame.c (count_fdes, add_fdes): Skip linked once FDE entries.
-
-Sun Oct 26 11:52:01 1997 Richard Henderson <rth@cygnus.com>
-
- * alias.c (memrefs_conflict_p): Treat arg_pointer_rtx just
- like stack_pointer_rtx.
-
-Sun Oct 26 11:32:16 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (bootstrap-lean): Combined with `normal' bootstrap
- targets using "$@" to provide support for similar but not identical
- targets without having to duplicate code.
- (bootstrap4): New goal.
-
- * Makefile.in (compare, compare-lean, compare3): Combined to one
- ruleset determining actions to be performed via $@.
- (compare4, compare4-lean): New targets.
- (gnucompare, gnucompare3): Combined to one ruleset determining
- actions to be performed via $@. Also, note which files failed
- the comparison test in .bad_compare.
- (gnucompare-lean, gnucompare3-lean, gnucompare4-lean): New targets.
-
-Sun Oct 26 10:06:11 1997 Toon Moene <toon@moene.indiv.nluug.nl>
-
- * fold-const (fold): Also simplify FLOOR_DIV_EXPR to EXACT_DIV_EXPR
- if the dividend is a multiple of the divisor.
-
-Sun Oct 26 09:21:40 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (LIBGCC2_CFLAGS): Add -fexceptions.
+ * rtl.h (rtx_function): New type.
+ (for_each_rtx): New function.
+ * rtlanal.c (for_each_rtx): Define it.
+
+ * recog.c (change_t): New type.
+ (change_objects, change_old_codes, change_locs, change_olds):
+ Replace with ...
+ (changes): New variable.
+ (validate_change): Dynamically allocate room for more changes, if
+ necessary. Uses changes array instead of change_objects, etc.
+ (apply_change_group): Use changes array instead of
+ change_objects, etc.
+
+ * loop.c (loop_mem_info): New type.
+ (loop_mems): New variable.
+ (loop_mems_idx): Likewise.
+ (looop_mems_allocated): Likewise.
+ (scan_loop): Remove nregs parameter.
+ (next_insn_in_loop): New function.
+ (load_mems_and_recount_loop_regs_set): Likewise.
+ (load_mems): Likewise.
+ (insert_loop_mem): Likewise.
+ (replace_loop_mem): Likewise.
+ (replace_label): Likewise.
+ (INSN_IN_RANGE_P): New macro.
+ (loop_optimize): Don't pass max_reg_num() to scan_loop.
+ (scan_loop): Remove nregs parameter, compute it after any new
+ registers are created by load_mems. Use INSN_IN_RANGE_P and
+ next_insn_in_loop rather than expanding them inline. Call
+ load_mems to load memory into pseudos, if appropriate.
+ (prescan_loop): Figure out whether or not there are jumps from the
+ loop to targets other than the label immediately following the
+ loop. Call insert_loop_mem to notice all the MEMs used in the
+ loop, if it could be safe to pull MEMs into REGs for the duration
+ of the loop.
+ (strength_reduce): Use next_insn_in_loop. Tweak comments.
+
+Wed Aug 19 08:29:44 1998 Richard Earnshaw (rearnsha@arm.com)
+
+ * arm.c (arm_override_options): Remove lie about ignoring PIC flag.
+
+Wed Aug 19 07:08:15 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
+
+ * config/sparc/sparc.c (finalize_pic): Check for the correct
+ nonlocal_goto_receiver UNSPEC number.
+ * config/sparc/sparc.md (nonlocal_goto_receiver): Add comment
+ making note of this dependency existing in sparc.c
+ (negtf2_notv9 split): Give NEG SFmode.
+ (negsf2): Fix insn output string.
+
+Tue Aug 18 12:40:27 1998 Richard Henderson <rth@cygnus.com>
- * alias.c (find_base_term): Handle PRE_INC, PRE_DEC, POST_INC,
- and POS_DEC.
+ * c-common.c (decl_attributes): Issue an error if the argument
+ to alias is not a string.
- * alias.c (true_dependence): Fix typo.
+Tue Aug 18 10:33:30 1998 Jeffrey A Law (law@cygnus.com)
- * toplev.c (flag_rerun_loop_opt): New variable.
- (f_options): Handle -frerun-loop-opt.
- (rest_of_compilation): If -frerun-loop-opt, then run the loop
- optimizer twice.
- (main): Enable -frerun-loop-opt by default for -O2 or greater.
+ * haifa-sched.c (sched_analyze): Put all JUMP_INSNs on the last
+ pending memory flush list.
- * loop.c (simplify_giv_expr): Adding two invariants results
- in an invariant.
+ * combine.c (can_combine_p): Allow combining insns with REG_RETVAL
+ notes.
+ (try_combine): Allow combining insns with REG_LIBCALL notes.
-Sun Oct 26 09:15:15 1997 Richard Henderson <rth@cygnus.com>
+ * expr.c (emit_block_move): Do not call memcpy as a libcall
+ instead build up a CALL_EXPR and call it like any other
+ function.
+ (clear_storage): Similarly for memset.
- * expr.c (get_inner_reference): Remove the array bias after
- converting the index to Pmode.
+ * regmove.c (fixup_match_2): Do not call reg_overlap_mentioned_p
+ on notes.
-Sat Oct 25 12:20:58 1997 Jeffrey A Law (law@cygnus.com)
+ * Makefile.in (cplus-dem.o): Provide explicit rules for building
+ cplus-dem.o
- * mn10300.h (TARGET_SWITCHES): Add -mmult-bug and -mno-mult-bug.
- (TARGET_MULT_BUG): Define.
- (TARGET_DEFAULT): Default to TARGET_MULT_BUG.
- * mn10300.md (mulsi3): Handle TARGET_MULT_BUG.
+ * regmove.c (optimize_reg_copy_1): Update REG_N_CALLS_CROSSED
+ and REG_LIVE_LENGTH as successful substitutions are made.
-Fri Oct 24 17:40:34 1997 Jeffrey A Law (law@cygnus.com)
+Tue Aug 18 07:15:27 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * mn10200.c (indirect_memory_operand): Delete unused function.
- * mn10200.h (EXTRA_CONSTRAINT): Handle 'R'.
- * mn10200.md (bset, bclr insns): Handle output in a reg too.
+ * config/sparc/sparc.c (ultra_find_type): Add empty semicolon
+ statement after end of loop label.
-Fri Oct 24 15:54:57 1997 Richard Henderson <rth@cygnus.com>
+Tue Aug 18 07:13:27 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * alpha.md (call patterns): Revert Oct 16 change; if we are to elide
- the callee's ldgp, we must do it ourselves, and we use the jsr tag
- for more than scheduling.
+ * config/sparc/sparc.c (ultra_types_avail): New variable.
+ (ultra_build_types_avail): New function to record mask of insn
+ types in ready list at this cycle.
+ (ultrasparc_sched_reorder): Call it.
+ (ultra_find_type): Use it to quicken the search. Also simplif
+ dependency check, don't use rtx_equal_p because we know exactly
+ what we are looking for.
-Fri Oct 24 13:23:04 1997 Doug Evans <devans@canuck.cygnus.com>
+Tue Aug 18 03:20:53 1998 Richard Earnshaw (rearnsha@arm.com)
- * sparc/sparc.h (ASM_SPEC): Delete asm_arch.
+ * arm.h (SECONDARY_INPUT_RELOAD_CLASS): Return NO_REGS if compiling
+ for architecture v4.
-Fri Oct 24 13:19:40 1997 Jeffrey A Law (law@cygnus.com)
+Mon Aug 17 21:26:38 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * mn10300.c (symbolic_operand, legitimize_address): New functions.
- * mn10300.h (LEGITIMIZE_ADDRESS): Call legitimize_address.
- (GO_IF_LEGITIMATE_ADDRESS): Don't allow base + symbolic.
+ * config/sparc/sparc.md (sltu, sgeu): Don't FAIL, call
+ gen_compare_reg.
+ (movsf_const_intreg, movsf_const_high, movsf_const_lo,
+ movdf_const_intreg and helper splits): New patterns to move float
+ constants into integer registers.
+ (negtf2, negdf2, abstf2, absdf2): Rework using new patterns and
+ splits.
-Thu Oct 23 09:35:12 1997 Jeffrey A Law (law@cygnus.com)
+Mon Aug 17 11:46:19 1998 Jeffrey A Law (law@cygnus.com)
- * version.c: Bump for snapshot.
+ * From Graham
+ * tree.c (build_index_type): Copy TYPE_SIZE_UNIT from sizetype
+ to itype.
+ * c-decl.c (finish_enum): Copy TYPE_SIZ_UNIT from enumtype to tem.
-Thu Oct 23 08:03:59 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * rs6000.c (secondary_reload_class): For TARGET_ELF, indicate that
+ a BASE_REGS register is needed as an intermediate when copying
+ a symbolic value into any register class other than BASE_REGS.
- * dbxout.c (dbxout_start_new_source_file): Use output_quoted_string
- for FILENAME.
+ * expr.c (move_by_pieces): No longer static. Remove prototype.
+ * rtl.h (move_by_pieces): Add extern prototype.
+ * mips.c (expand_block_move): Handle aligned straight line copy by
+ calling move_by_pieces.
-Wed Oct 22 00:34:12 1997 Jeffrey A Law (law@cygnus.com)
+ * expr.c (expand_expr): Allow assignments from TImode PARM_DECLs
+ and VAR_DECLs.
- * toplev.c (flag_exceptions): Default value is 2.
- (compile_file): If flag_exceptions still has the value 2, then
- set it to 0.
+Mon Aug 17 10:28:52 1998 Mark Mitchell <mark@markmitchell.com>
- * rs6000.c (struct machine_function): Add pic_offset_table_rtx.
- (rs6000_save_machine_status): Save pic_offset_table_rtx.
- (rs6000_restore_machine_status: Restore pic_offset_table_rtx.
+ * stmt.c (expand_end_loop): Tidy. Allow unconditional
+ jumps out of the loop to be treated as part of the exit test.
- * local-alloc.c (block_alloc): Don't lose if two SCRATCH expressions
- are shared.
-
- * rs6000.md (*movsi_got_internal_mem): New pattern.
- (*movsi_got_internal_mem splitter): New define_split.
-
-Tue Oct 21 18:14:03 1997 Jim Wilson <wilson@cygnus.com>
-
- * obstack.h (obstack_empty_p): Fix spurious space after backslash.
-
-Tue Oct 21 18:34:01 1997 Geoffrey KEATING <geoffk@ozemail.com.au>
-
- * rs6000.c: Avoid creating a stack frame under SYSV ABI if we
- only need to save LR.
-
-Tue Oct 21 10:06:40 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (movqi, movhi): Avoid using address registers as
- destinations unless absolutely necessary.
-
- * mn10200.c (expand_prologue): Fix typo.
-
- * mn10200.h (GO_IF_LEGITIMATE_ADDRESS): Do not allow indexed
- addresses.
- * mn10200.md (neghi2): Provide an alternative which works if
- the input and output register are the same.
-
- * mn10300.c (print_operand): Handle 'S'.
- * mn10300.md (ashlsi3, lshrsi3, ashrsi3): Use %S for
- shift amount in last alternative
-
- * mn10300.c (expand_epilogue): Rework to handle register restores
- in "ret" and "retf" instructions correctly.
-
-Mon Oct 20 16:47:08 1997 Jim Wilson <wilson@cygnus.com>
-
- * expmed.c (extract_bit_field): Don't make flag_force_mem disable
- extzv for memory operands.
-
- * cse.c (simplify_ternary_operation, case IF_THEN_ELSE): Collapse
- redundant conditional moves to single operand.
-
-Mon Oct 20 15:30:26 1997 Nick Clifton <nickc@cygnus.com>
-
- * v850.h: Move define of __v850__ from CPP_PREDEFINES
- to CPP_SPEC.
-
- * xm-v850.h: Use __v850 rather than __v850__ to
- identify v850 port.
-
-Mon Oct 20 14:15:02 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips/mips.c (compute_frame_size): Not a leaf function if
- profile_flag set.
-
-Mon Oct 20 14:16:38 1997 Geoffrey KEATING <geoffk@ozemail.com.au>
-
- * rs6000/t-ppccomm: Use -msdata=none for crtstuff.
-
-Mon Oct 20 12:28:17 1997 Doug Evans <devans@canuck.cygnus.com>
-
- * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete.
- (DEFAULT_ARCH32_P): New macro.
- (TARGET_ARCH{32,64}): Allow compile time or runtime selection.
- (enum cmodel): Declare.
- (sparc_cmodel_string,sparc_cmodel): Declare.
- (SPARC_DEFAULT_CMODEL): Provide default.
- (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}.
- (TARGET_FULLANY): Deleted.
- (TARGET_CM_MEDMID): New macro.
- (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC.
- (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC.
- (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch).
- (CPP_SPEC): Rewrite.
- (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros.
- (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros.
- (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros.
- (ASM_SPEC): Add %(asm_arch).
- (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default.
- Rename asm_default to asm_cpu_default.
- Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian,
- cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch.
- (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH.
- ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values.
- (MASK_INT64,MASK_LONG64): Delete.
- (MASK_ARCH64): Renamed to MASK_64BIT.
- (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete.
- (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG.
- (TARGET_SWITCHES): Always provide 64 bit options.
- (ARCH64_SWITCHES): Delete.
- (TARGET_OPTIONS): New option -mcmodel=.
- (INT_TYPE_SIZE): Always 32.
- (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH.
- (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_....
- (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support.
- (PRINT_OPERAND_PUNCT_VALID_P): Add '_'.
- * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by
- CPP_SPEC.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- * sparc/linux.h: Likewise.
- * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete.
- (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC.
- (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT.
- (SPARC_DEFAULT_CMODEL): Define.
- (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- (LONG_DOUBLE_TYPE_SIZE): Define.
- (ASM_SPEC): Add %(asm_arch).
- * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- (TARGET_CPU_DEFAULT): Add ultrasparc case.
- * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete.
- (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT.
- (SPARC_DEFAULT_CMODEL): Define.
- * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete.
- (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete
- MASK_LONG64, MASK_MEDANY.
- (SPARC_DEFAULT_CMODEL): Define.
- (CPP_PREDEFINES): Delete.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- (ASM_SPEC): Add %(asm_arch).
- (LONG_DOUBLE_TYPE_SIZE): Define.
- (DWARF2_DEBUGGING_INFO): Define.
- * sparc/splet.h (CPP_SPEC): Delete.
- * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC.
- (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support.
- (BLOCK_PROFILER): Likewise.
- * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals.
- (sparc_override_options): Handle code model selection.
- (sparc_init_expanders): Renamed from sparc64_init_expanders.
- * sparc/sparc.md: TARGET_<code_model> renamed to TARGET_CM_....
- TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY.
- (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_....
- (sethi_di_fullany): Delete.
-
-Mon Oct 20 02:00:18 1997 Klaus Kaempf <kkaempf@progis.de>
+Mon Aug 17 10:06:11 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Jeff Law <law@cygnus.com>
- Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha/vms.h (DIVSI3_LIBCALL): OTS$ functions are upper case.
- (DIVDI3_LIBCALL, UDIVSI3_LIBCALL, UDIVDI3_LIBVALL): Likewise.
- (MODSI3_LIBCALL, MODDI3_LIBCALL): Likewise.
- (UMODSI3_LIBCALL, UMODDI3_LIBCALL): Likewise.
- * alpha/alpha.md (arg_home): Likewise.
-
- * alpha/alpha.c (vmskrunch): Delete
- * alpha/vms.h (ENCODE_SECTION_INFO, ASM_DECLARE_FUNCTION_NAME): Delete.
- * alpha.c (output_prolog, VMS): Use alloca for entry_label and don't
- truncate to 64 characters.
-
- * make-l2.com: Support openVMS/Alpha.
-
- * vmsconfig.com: Fix to work on openVMS/Alpha and openVMS/VAX.
-
-Sun Oct 19 19:00:35 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * longlong.h (count_leading_zeros): Add missing casts to USItype.
-
-Sun Oct 19 18:44:06 1997 Jeffrey A Law (law@cygnus.com)
-
- * i386/bsd386.h (ASM_COMMENT_START): Define.
-
-Sat Oct 18 13:47:15 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tree.c (restore_tree_status): Also free up temporary storage
- when we finish a toplevel function.
- (dump_tree_statistics): Print stats for backend obstacks.
-
-Sat Oct 18 12:47:31 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * expr.c (use_group_regs): Don't call use_reg for MEMs.
-
-Sat Oct 18 09:49:46 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (__throw): Don't copy the return address.
- * dwarf2out.c (expand_builtin_dwarf_reg_size): Ignore return address.
-
- * except.c (exceptions_via_longjmp): Initialize to 2 (uninitialized).
- * toplev.c (main): Initialize exceptions_via_longjmp.
-
- * tree.c: Add extra_inline_obstacks.
- (save_tree_status): Use it.
- (restore_tree_status): If this is a toplevel inline obstack and we
- didn't want to save anything on it, recycle it.
- (print_inline_obstack_statistics): New fn.
- * function.c (pop_function_context_from): Pass context to
- restore_tree_status.
- * obstack.h (obstack_empty_p): New macro.
-
-Sat Oct 18 00:43:59 1997 Jeffrey A Law (law@cygnus.com)
-
- * i386/freebsd.h (ASM_COMMENT_START): Fix.
-
-Fri Oct 17 23:48:52 1997 Jim Wilson (wilson@cygnus.com)
-
- * v850.c (ep_memory_offset): New function.
- (ep_memory_operand, substitute_ep_register, v850_reorg): Call it.
-
- * v850.h (CONST_OK_FOR_*): Add and correct comments.
- (CONSTANT_ADDRESS_P): Add comment.
- (EXTRA_CONSTRAINT): Define 'U'.
- * v850.md: Add comments on bit field instructions.
- (addsi3): Delete &r/r/r alternative. Add r/r/U alternative.
- (lshrsi3): Use N not J constraint.
-
- * v850.md (v850_tst1+1): New define_split for tst1 instruction.
-
- * v850.c (reg_or_0_operand): Call register_operand.
- (reg_or_int5_operand): Likewise.
- * v850.h (MASK_BIG_SWITCH, TARGET_BIG_SWITCH): New macros.
- (TARGET_SWITCHES): Add "big-switch".
- (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT, CASE_VECTOR_MODE,
- ASM_OUTPUT_BEFORE_BASE_LABEL): Add support for TARGET_BIG_SWITCH.
- (CASE_DROPS_THROUGH): Comment out.
- (CASE_VECTOR_PC_RELATIVE, JUMP_TABLES_IN_TEXT_SECTION): Define.
- * v850.md (cmpsi): Delete compare mode.
- (casesi): New pattern.
-
- * v850.h (CONST_OK_FOR_N): Delete redundant compare against zero.
- * v850.md (ashlsi3): Use SImode not QImode for shift count.
- (lshrsi3): Likewise.
-
- * v850.c (print_operand): Add 'c', 'C', and 'z' support. Delete
- unreachable switch statement after 'b' support. Remove "b" from
- strings for 'b' support.
- * v850.md (branch_normal, branch_invert): Change %b to b%b.
-
-Fri Oct 17 23:33:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (LIBGCC2_CFLAGS): Avoid a backslash then an
- empty line if @inhibit_libc@ is empty.
-
-Fri Oct 17 23:24:40 1997 Robert Lipe (robertl@dgii.com)
-
- * i386/sco5.h: Let ELF use dwarf2 unwinding. COFF uses sjlj.
- (EH_FRAME_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP_ELF): Defined.
- (EH_FRAME_SECTION_ASM_OP_COFF): Likewise.
- (DWARF2_UNWIND_INFO): Let this track object file format.
- (EXTRA_SECTIONS): Add in_eh.
- (EH_FRAME_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP_ELF): Define.
- (EH_FRAME_SECTION_ASM_OP_COFF): Likewise.
-
-Fri Oct 17 17:13:42 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * sparc/linux64.h (LINK_SPEC): Dynamic linker is ld-linux64.so.2.
- * sparc/sparc.h (FUNCTION_PROFILER): Fix format string when
- TARGET_MEDANY.
- * sparc/sparc.c (dwarf2out_cfi_label): Extern no longer needed.
- (output_double_int): Output DI mode values correctly when
- HOST_BITS_PER_WIDE_INT is 64.
- (output_fp_move_quad): If TARGET_V9 and not TARGET_HARD_QUAD, use
- fmovd so it works if a quad float ends up in one of the upper 32
- float regs.
- * sparc/sparc.md (pic_{lo_sum,sethi}_di): New patterns
- necessary for PIC support on sparc64.
-
-Fri Oct 17 13:39:56 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS.
- * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64.
- (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define.
- (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros.
- (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros.
- (SPARC_FP_ARG_FIRST): New macro.
- (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now.
- (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs.
- (NPARM_REGS): There are 32 fp argument registers now.
- (FUNCTION_ARG_REGNO_P): Likewise.
- (FIRST_PARM_OFFSET): Update to new v9 abi.
- (REG_PARM_STACK_SPACE): Define for arch64.
- (enum sparc_arg_class): Delete.
- (sparc_arg_count,sparc_n_named_args): Delete.
- (struct sparc_args): Redefine and use for arch32 as well as arch64.
- (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete.
- (FUNCTION_ARG_ADVANCE): Rewrite.
- (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite.
- (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite.
- (FUNCTION_ARG_CALLEE_COPIES): Delete.
- (FUNCTION_ARG_{PADDING,BOUNDARY}): Define.
- (STRICT_ARGUMENT_NAMING): Define.
- (doublemove_string): Declare.
- * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete.
- (single_move_string): Use GEN_INT, and HOST_WIDE_INT.
- (doublemove_string): New function.
- (output_move_quad): Clean up some of the arch64 support.
- (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64.
- Don't add 8 bytes of reserved space if arch64.
- (sparc_builtin_saveregs): Combine arch32/arch64 versions.
- (init_cumulative_args): New function.
- (function_arg_slotno): New static function.
- (function_arg,function_arg_partial_nregs): New functions.
- (function_arg_{pass_by_reference,advance}): New functions.
- (function_arg_padding): New function.
- * ginclude/va-sparc.h: Rewrite v9 support.
-
-Fri Oct 17 12:29:48 1997 Christian Iseli <Christian.Iseli@lslsun.epfl.ch>
-
- * regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P
- for hard regs to determine base and index registers.
-
- * reload.c (debug_reload_to_stream): New function. Specify stream
- into which to write debug info.
- (debug_reload): Modify to call debug_reload_to_stream with stderr.
-
-Thu Oct 16 15:07:51 1997 Richard Henderson <rth@cygnus.com>
-
- * combine.c (can_combine_p): Don't combine with an asm whose
- output is a hard register.
-
-Thu Oct 16 15:43:26 1997 Mike Stump (mrs@wrs.com)
-
- * c-decl.c (start_struct): Ensure that structs with forward
- declarations are in fact packed when -fpack-struct is given.
-
- * stor-layout.c (layout_record): Ignore STRUCTURE_SIZE_BOUNDARY if
- we are packing a structure. This allows a structure with only
- bytes to be aligned on a byte boundary and have no padding on a
- m68k.
-
-Thu Oct 16 15:17:54 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * rs6000.h (ROUND_TYPE_ALIGN): Don't blow up if no fields in record.
-
-Thu Oct 16 11:20:30 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_return_addr_rtx): New variable.
- (alpha_save_machine_status): New; save it.
- (alpha_restore_machine_status): New; restore it.
- (alpha_init_expanders): New; clear it.
- (alpha_return_addr): New; set it.
- (alpha_ra_ever_killed): New; if alpha_return_addr_rtx, regs_ever_live
- is overly conservative, so search the insns explicitly.
- (alpha_sa_mask [VMS]): Check alpha_ra_ever_killed.
- (alpha_sa_size [VMS && !VMS]): Likewise.
- * alpha.h (RETURN_ADDR_RTX): Call alpha_return_addr.
- (INIT_EXPANDERS): New definition.
-
- * alpha.c: Move REG_PV, REG_RA somewhere more visible in the file.
- (output_prolog [!VMS]): Use them.
-
- * alpha.c (output_prolog [!VMS]): Move gp detection to ...
- (alpha_does_function_need_gp): ... a new function. Refine the
- CALL_INSN test to just TYPE_JSR.
- * alpha.md (most call insns): Fix some jsr/ibr type transpositions.
-
-Thu Oct 16 09:36:47 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Wed Oct 15 21:38:18 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * pa.c (move_operand): Respect -mdisable-indexing.
- * pa.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
-
-Wed Oct 15 21:34:45 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (udivsi3, divsi3): Split into MQ and non-MQ cases for
- PPC601.
- (umulsidi3,umulsi3_highpart): Ditto.
- (smulsi3_highpart_no_mq): Add !TARGET_POWER.
-
-Wed Oct 15 18:21:46 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (final_prescan_insn): Gut, remove and transform to ...
- (alpha_handle_trap_shadows): ... a new function. Handle the entire
- function in one go. Emit RTL for trapb, instead of printf directly.
- (alpha_reorg): New function. Call alpha_handle_trap_shadows.
- (trap_pending): Kill global variable.
- (output_epilog): Don't call final_prescan_insn.
- (struct shadow_summary): Elide $31 and $f31; now it fits in a word.
- * alpha.h (FINAL_PRESCAN_INSN): Remove.
- (MACHINE_DEPENENT_REORG): Define.
- * alpha.md (jsr patterns with trapb): Stupid and useless. Kill.
- (trapb): New insn.
-
-Wed Oct 15 18:16:05 1997 Richard Henderson <rth@cygnus.com>
-
- Tune Haifa scheduler for Alpha:
- * alpha.h (ISSUE_RATE): Define.
- * alpha.c (alpha_adjust_cost): Handle EV5 mult delay; don't apply
- EV4 adjustments to EV5.
- * alpha.md: Remove all scaling from function unit delays. Rework
- EV5 function units to match the CPU.
- (umuldi3_highpart): EV5 added the IMULH insn class.
-
-Wed Oct 15 17:42:41 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (following_call): Fail if the CALL_INSN is an indirect
- call.
-
-Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
-
- * cplus-dem.c (demangle_signature): Don't look for return types on
- constructors. Handle member template constructors.
-
-Tue Oct 14 11:30:29 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tree.c (expr_tree_cons, build_expr_list, expralloc): New fns.
- * tree.h: Declare them.
-
-Fri Oct 10 13:46:56 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * configure.in: Handle --with-newlib.
- * Makefile.in (LIBGCC2_CFLAGS): Add @inhibit_libc@.
-
- * sparc/t-sp64 (LIBGCC2_CFLAGS): Delete.
-
-Wed Oct 8 14:37:44 1997 Jeffrey A Law (law@cygnus.com)
-
- * config/ptx4.h: Fix typo.
-
-Wed Oct 8 08:57:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Tue Oct 7 16:27:34 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * aclocal.m4: Substitute INSTALL.
- * configure: Re-built.
-
-Tue Oct 7 15:37:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * integrate.c (save_for_inline_copying): Avoid undefined pointer
- operations.
- (expand_inline_function): Likewise.
-
- * dwarf2out.c (output_call_frame_info): Reinstate last change
- using flag_debug_asm check instead of flag_verbose_asm.
-
-Tue Oct 7 12:57:26 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (output_call_frame_info): Remove last change.
-
-1997-10-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * frame.c (__frame_state_for): Execute the FDE insns until the
- current pc value is strictly bigger than the target pc value.
-
-Tue Oct 7 11:00:42 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * regclass.c (init_reg_modes): If we can't find a mode for the
- register, use the previous one.
-
-Tue Oct 7 10:55:34 1997 Richard Henderson <rth@cygnus.com>
-
- * haifa-sched.c (print_block_visualization): Call fprintf directly,
- don't sprintf through an alloca'ed buffer.
-
-Tue Oct 7 10:52:29 1997 Thomas Koenig (ig25@rz.uni-karlsruhe.de)
-
- * reload.c (decompose): Always initialize val.base.
-
-Tue Oct 7 10:19:26 1997 Manfred Hollstein (manfred@lts.sel.alcatel.de)
-
- * m68k/mot3300.h (ASM_OUTPUT_ALIGN): Accept any alignment
- instead of aborting.
- * dwarf2out.c (output_call_frame_info): Call app_enable and
- app_disable to let GNU as accept the generated comments.
-
-Tue Oct 7 11:41:21 1997 Michael Meissner <meissner@cygnus.com>
-
- * tree.h (get_file_function_name): Add declaration.
- * dwarf2out.c (output_call_frame_info): No need to cast
- get_file_function_name call anymore.
- * profile.c (toplevel): Remove get_file_function_name
- declaration.
- * c-lang.c (finish_file): Ditto.
-
-Tue Oct 7 10:01:45 1997 Chip Salzenberg <chip@rio.atlantic.net>
-
- * Makefile.in (program_transform_name): Let autoconf substitute
- the correct value.
-
-Tue Oct 7 09:54:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * haifa-sched.c (schedule_block): If the first real insn in a
- block has any special notes attached to it, remove them.
-
-Tue Oct 7 09:48:51 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.h (FLOAT_STORE_FLAG_VALUE): It's 2.0 not 0.5.
-
-Mon Oct 6 12:47:32 1997 Manfred Hollstein (manfred@lts.sel.alcatel.de)
-
- * m88k.c (m88k_begin_prologue): Remove superfluous backslash.
-
-Mon Oct 6 12:04:24 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (check-g77): New test target.
- (CHECK-TARGETS): Add check-g77.
-
-Fri Oct 3 11:56:36 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_compilation): Defer all non-nested inlines.
-
-Fri Oct 3 15:49:27 1997 Michael Meissner <meissner@cygnus.com>
-
- * flow.c (print_rtl_with_bb): Cast alloca return value for
- in_bb_p.
-
-Thu Oct 2 21:15:03 1997 Richard Henderson <rth@cygnus.com>
-
- * i386.h (RETURN_ADDR_RTX): New definition that works for
- __builtin_return_address(0) and -fomit-frame-pointer.
-
-Wed Oct 1 13:43:53 1997 Jim Wilson <wilson@cygnus.com>
-
- Bring over from FSF.
- Tue Aug 5 16:10:45 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips.c (function_arg): Handle passing a struct
- containing a double in a DFmode register without the PARALLEL.
-
-Wed Oct 1 11:13:25 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * pexecute.c: Use spawn if __CYGWIN32__.
-
- * pexecute.c: Include "config.h" first, as per autoconf manual
- (from Paul Eggert <eggert@twinsun.com>).
-
-Wed Oct 1 01:44:36 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k/x-mot3300 (XCFLAGS): Disable as's long/short jump
- optimisation for f/expr.o and f/stb.o.
-
-Tue Sep 30 23:48:57 1997 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (this_insn_cc0_mode): Initialize.
-
-Tue Sep 30 23:09:40 1997 Thomas Koenig <ig25@mvmap66.ciw.uni-karlsruhe.de>
-
- * cccp.c (expand_to_temp_buffer): Initialize all members of obuf.
-
- * haifa-sched.c (get_block_head_tail): Remove unneeded initialization.
-
-Tue Sep 30 23:06:43 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne, since
- that pair will dual-issue on the 21164 and plus+beq won't.
- (bne): Likewise for cmpeq+beq.
-
-Tue Sep 30 16:07:58 1997 Jim Wilson <wilson@cygnus.com>
-
- * except.c (find_exception_handler_labels): Correct argument to free.
-
-Tue Sep 30 11:00:00 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * except.c (find_exception_handler_labels): Free LABELS when we're
- done.
-
-Mon Sep 29 14:04:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Mon Sep 29 10:51:53 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * flow.c (find_basic_blocks): Mark calls as potentially jumping
- to the EH labels.
-
-Mon Sep 29 09:58:06 1997 Jeffrey A Law (law@cygnus.com)
-
- * configure.in: Substitute for "install" too.
- * configure: Rebuilt.
-
-Mon Sep 29 00:38:42 1997 Aaron Jackson <jackson@negril.msrce.howard.edu>
-
- * Makefile.in (bootstrap-lean, compare-lean): New targets.
-
-Mon Sep 29 00:18:16 1997 Richard Henderson (rth@cygnus.com)
-
- * alias.c (base_alias_check): Two symbols can conflict if they
- are accessed via AND.
- (memrefs_conflict_p): Likewise.
-
- * alpha.h (SETUP_INCOMING_VARARGS): Emit a blockage insn
- after flushing argument registers to the stack.
-
- * Makefile.in (mostlyclean): Remove .regmove files.
-
-Sun Sep 28 18:59:58 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (__throw): Fix thinko.
-
-Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net>
- * cplus-dem.c (demangle_template): Add new parameter. Handle new
- template-function mangling.
- (consume_count_with_underscores): New function.
- (demangle_signature): Handle new name-mangling scheme.
+ * Makefile.in (cplus-dep.o): Use cplus-dem.c from libiberty.
+ * cplus-dem.c: Delete.
-Sun Sep 28 01:55:04 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
+ * Makefile.in (fold-const.o): depend on $(RTL_H).
- * flow.c (print_rtl_with_bb): Cast alloca return values for variables
- start and end.
+ * fold-const.c: Include rtl.h to get the prototype for
+ `set_identifier_local_value'.
-Sun Sep 28 01:05:16 1997 Jeffrey A Law (law@cygnus.com)
+ * loop.c (express_from_1): Remove unused variable `tmp'.
+ (combine_givs): cast the first argument of bzero to char *.
- * frame.c: Remove last change.
- * dwarf2.h: Remove last change.
- * tree.h: Add declarations of DWARF2 unwind info support
- functions.
-
-Sat Sep 27 11:02:38 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * c-decl.c (init_decl_processing): Add __builtin_dwarf_reg_size.
- * tree.h (built_in_function): Likewise.
- * expr.c (expand_builtin): Likewise.
- * except.h: Likewise.
- * dwarf2out.c (expand_builtin_dwarf_reg_size): New fn.
- * libgcc2.c (copy_reg): New fn.
- (__throw): Use it.
+ * toplev.c (display_help): Remove unused variable `looking_for_start'.
-Fri Sep 26 08:54:59 1997 Paul Eggert <eggert@twinsun.com>
+ * c-decl.c (init_decl_processing): Remove unneeded &.
- * c-typeck.c (build_binary_op): Warn about comparing signed vs
- unsigned if -W is specified and -Wno-sign-compare is not.
- * c-decl.c (warn_sign_compare): Initialize to -1.
- (c_decode_option): -Wall no longer implies -Wsign-compare.
-
-Fri Sep 26 09:00:13 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * frame.c: Include gansidecl.h for PROTO.
- * dwarf2out.c: Move inclusion of dwarf2.h down so that PROTO is
- defined. Don't declare dwarf2out_cfi_label here.
- * dwarf2.h: Add declarations of DWARF2 unwind info support
- functions.
- * m68k.c: Include dwarf2.h.
- (output_function_prologue): Add dwarf2 support.
- * m68k.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_REGNUM): New macros.
- (INCOMING_FRAME_SP_OFFSET): Likewise.
-
- * integrate.c (expand_inline_function): Make sure there is at
- least one insn that can be used as an insertion point.
-
-Wed Sep 24 21:34:06 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * alpha.h (alpha_initialize_trampoline): Provide prototype.
+
+ * except.c (set_exception_lang_code, set_exception_version_code):
+ Change parameter from `short' to `int' to avoid using a gcc
+ extension.
- * dwarf2out.c: s/flag_verbose_asm/flag_debug_asm/
+ * except.h (set_exception_lang_code, set_exception_version_code):
+ Likewise for prototypes.
-Wed Sep 24 22:05:30 1997 Jeffrey A Law (law@cygnus.com)
+ * flow.c (count_reg_references): Remove unused variables `regno'
+ and `i'.
- * version.c: Bump for snapshot.
+ * gcse.c (hash_scan_insn): Declare parameter `in_libcall_block'.
-Wed Sep 24 17:36:23 1997 Doug Evans <dje@canuck.cygnus.com>
-
- Bring over from FSF.
-
- Wed Sep 24 19:17:08 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/sparc.md (get_pc_via_call): Renamed from get_pc_sp32.
- (get_pc_via_rdpc): Renamed from get_pc_sp64.
- * sparc/sparc.c (finalize_pic): Update call to gen_get_pc_via_call.
-
- Wed Sep 24 18:38:22 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * sparc/sparc.h (ASM_CPU_SPEC): Pass -Av9a for v8plus, ultrasparc.
- (TARGET_OPTIONS): Add -malign-loops=, -malign-jumps=,
- -malign-functions=.
- (sparc_align_{loops,jumps,funcs}_string): Declare.
- (sparc_align_{loops,jumps,funcs}): Declare.
- (DEFAULT_SPARC_ALIGN_FUNCS): New macro.
- (FUNCTION_BOUNDARY): Use sparc_align_funcs.
- (STACK_BIAS): Define.
- (SPARC_SIMM*_P): Cast to unsigned HOST_WIDE_INT first, then perform
- test.
- (SPARC_SETHI_P): New macro.
- (CONST_OK_FOR_LETTER_P): Use it.
- (ASM_OUTPUT_ALIGN_CODE): Define.
- (ASM_OUTPUT_LOOP_ALIGN): Define.
- * sparc/sparc.c (sparc_align_{loops,jumps,funcs}_string): New globals.
- (sparc_align_{loops,jumps,funcs}): New globals.
- (sparc_override_options): Handle -malign-loops=, -malign-jumps=,
- -malign-functions=.
- (move_operand): Use SPARC_SETHI_P.
- (arith_double_operand): Cast to unsigned HOST_WIDE_INT first, then
- perform test.
- (arith11_double_operand): Likewise.
- (arith10_double_operand): Likewise.
- (finalize_pic): Finish sparc64 support.
- (emit_move_sequence): Use SPARC_SETHI_P. Simplify low part of
- 64 bit constants if able.
- (output_fp_move_quad): Don't use fmovq unless TARGET_HARD_QUAD.
- (sparc_builtin_saveregs, sparc64 case): Don't save fp regs if
- ! TARGET_FPU.
- * sparc/sparc.md (*): Use GEN_INT instead of gen_rtx.
- (get_pc_sp32): Use for sparc64 as well.
- (lo_sum_di_sp{32,64}): Fix handling on 64 bit hosts.
- (sethi_di_sp64_const): Likewise.
- (movtf_cc_sp64): Check TARGET_HARD_QUAD.
- (cmp_zero_extract_sp64): Use unsigned HOST_WIDE_INT in cast.
- (ashlsi3, ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise.
+ * prefix.c (translate_name): Cast the result of `alloca'.
- Tue Sep 23 19:02:46 1997 Doug Evans <dje@cygnus.com>
+ * varray.h (VARRAY_FREE): Reimplement as a `do-while(0)' statement.
- * sparc/linux-aout.h (COMMENT_BEGIN): Delete.
- * sparc/linux.h (COMMENT_BEGIN): Likewise.
- * sparc/linux64.h (COMMENT_BEGIN): Likewise.
+Mon Aug 17 09:23:42 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- Tue Sep 23 14:48:18 1997 David S. Miller <davem@tanya.rutgers.edu>
+ * config/m68k/m68k.c: Include "system.h" instead of <stdio.h>.
+ Include "toplev.h".
+ (valid_dbcc_comparison_p): Mark mode argument as unused.
+ (symbolic_operand): Likewise.
+ (legitimize_pic_address): Likewise.
+ (const_uint32_operand): Likewise.
+ (const_sint32_operand): Likewise.
+ * sched.c [!INSN_SCHEDULING]: Define only dummy function
+ schedule_insns and comment out rest of file.
- Add sparc64 linux support.
- * configure.in (sparc64-*-linux*): Recognize. Add sparc/xm-sparc.h
- to xm_file list on 32-bit sparc-linux.
- * sparc/xm-sp64.h: New file.
- * sparc/linux64.h: New file.
- * sparc/xm-linux.h: Include some standard headers if not inhibit_libc.
- Don't include xm-sparc.h.
- * config/xm-linux.h (HAVE_PUTENV, HAVE_ATEXIT): Define.
- * glimits.h (LONG_MAX): Handle sparc64.
+ * m68k.c (output_move_simode_const): Use subl to move a zero into an
+ address register.
+ (output_move_[hq]imode): Likewise.
- Sat Sep 20 03:07:54 1997 Doug Evans <dje@cygnus.com>
+Mon Aug 17 09:15:47 1998 Jeffrey A Law (law@cygnus.com)
- * sparc/sysv4.h (ASM_COMMENT_START): Delete.
- * sparc.h (ASM_COMMENT_START): Define.
- * sparc.c (output_function_prologue): Use it.
- (sparc_flat_output_function_{epi,pro}logue): Likewise.
+ * toplev.c (main): Enable -fstrict-aliasing for -O2 and above.
+ * invoke.texi: Corresponding changes.
- Wed Sep 17 15:04:19 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/sysv4.h (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Delete,
- use sparc.h's copies.
- * sparc/sparc.h (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Print
- ascii form as well.
+Mon Aug 17 02:03:55 1998 Richard Henderson <rth@cygnus.com>
- Mon Sep 8 08:45:19 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * regclass.c (allocate_reg_info): Respect MIN when clearing data.
- * sparc.c (dwarf2out_cfi_label): Add declaration.
- (save_regs, output_function_prologue): Remove cast for it.
- (sparc_flat_{save_restore,output_function_prologue): Likewise.
- ({save,restore}_regs): No longer inline.
+Sun Aug 16 17:37:06 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Tue Sep 23 12:34:51 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * config/sparc/sparc.c (ultra_code_from_mask,
+ ultra_cmove_results_ready_p, ultra_fpmode_conflict_exists,
+ ultra_find_type, ultra_schedule_insn, ultra_flush_pipeline,
+ ultrasparc_sched_init, ultrasparc_variable_issue,
+ ultra_rescan_pipeline_state, ultrasparc_sched_reorder): New
+ functions to describe UltraSPARC pipeline exactly to Haifa.
+ (ultrasparc_adjust_cost): Indicate IMUL type insns have zero cost,
+ as there is nothing the scheduler can do about it. Indicate that
+ REG_DEP_OUTPUT's collide. Fixup formatting.
+ * config/sparc/sparc.h (RTX_COSTS): Fixup integer multiply and
+ divide costs on Ultra for DImode.
+ (MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_VARIABLE_ISSUE):
+ Define.
+ * config/sparc/sparc.md (ieu_unnamed function unit): Rename to
+ ieuN and add call_no_delay_slot to type list.
+ (cti function unit): New unit for branches on UltraSPARC.
+ (subx/addx insns): Set type to misc.
+ (sidi zero/sign extension insns on arch64): Set type to shift.
+ (sign_extendhidi2_insn): Set type to sload.
+
+Sun Aug 16 13:52:00 1998 David Edelsohn <edelsohn@mhpcc.edu>
+
+ * rs6000.c (rs6000_stack_info): Use if == 0 for sizes.
+ (output_epilog): Use if != 0 for offset.
+ (rs6000_fatal_bad_address): Prepare for Intl.
+ * rs6000.h (rs6000_fatal_bad_address): Declare.
+ * rs6000.md (movsfcc, movdfcc): Use else if.
+ (elf_high): Use {liu|lis}.
+ (elf_low): Use {cal|la}. Remove %a template from old mnemonics.
+ (movsi): Use rs6000_fatal_bad_address.
+
+Sun Aug 16 01:53:21 1998 Richard Henderson <rth@cygnus.com>
- * fold-const.c (make_range): Correctly handle cases of converting
- from unsigned to signed type.
+ * reload.c (find_equiv_reg): Reject equivalences separated
+ by a volatile instruction.
-Tue Sep 23 12:34:51 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
+Sun Aug 16 00:21:44 1998 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- * fold-const.c (merge_ranges): Make sure that if one range is subset
- of another, it will always be the second range. Correct (+,-) case to
- account for this.
+ * rs6000/linux.h (CPP_OS_DEFAULT_SPEC): Define.
-Tue Sep 23 08:32:51 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * final.c (final_end_function): Also do dwarf2 thing if
- DWARF2_DEBUGGING_INFO.
- (final_start_function): Likewise.
-
-Tue Sep 23 01:15:50 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * expmed.c (expand_divmod): If compute_mode is not the same as
- mode, handle the case where convert_modes() causes op1 to no
- longer be a CONST_INT.
-
- * reorg.c (dbr_schedule): At end of this pass, add REG_BR_PRED
- note holding get_jump_flags() calculation to all JUMP_INSNs.
- * rtl.h (enum reg_note): New note types REG_BR_PRED and REG_SAVE_AREA.
- * rtl.c (reg_note_name): Add new note types.
-
-Tue Sep 23 00:59:54 1997 Jeffrey A Law (law@cygnus.com)
-
- * rtlanal.c (computed_jump_p): Fix typo in last change.
-
-Tue Sep 23 00:42:44 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+Sat Aug 15 20:51:35 1998 Richard Henderson <rth@cygnus.com>
- * loop.c (indirect_jump_in_function_p): Return 0
- by default.
+ * alpha.md (movsicc): Fix mode mismatch.
-Tue Sep 23 00:33:55 1997 Jeffrey A Law (law@cygnus.com)
+Sat Aug 15 20:22:33 1998 H.J. Lu (hjl@gnu.org)
- * rs6000/xm-rs6000.h: Fix thinko in last change.
- * rs6000/xm-sysv4.h: Likewise.
+ * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Handle aggregated
+ return type.
+ * config/alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): Likewise.
-Mon Sep 22 19:33:53 1997 Jim Wilson <wilson@cygnus.com>
+Sat Aug 15 08:39:49 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * mips.c (save_restore_insns): Only set RTX_FRAME_RELATED_P if store_p.
+ * config/sparc/sparc.md (movsi_lo_sum_pic_label_reg): Remove
+ write-only modifier from operand 1 constraint.
-Mon Sep 22 14:41:00 1997 Jeffrey A Law (law@cygnus.com)
+Sat Aug 15 06:28:19 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * reg-stack.c (find_blocks): Fix thinko in last change.
+ * config/sparc/sparc.c (sparc_emit_set_const64_quick1): If
+ emitting a XOR of -1 at the end, emit a NOT instead for combine's
+ sake.
+ (sparc_emit_set_const64): Likewise, also when computing trailing
+ bits do not negate low_bits and make fast_int an int.
-1997-09-21 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+Fri Aug 14 21:07:03 1998 Jeffrey A Law (law@cygnus.com)
- * m68k.c (output_function_prologue): Add dwarf2 support.
+ * loop.c (add_label_notes): Do not ignore references to labels
+ before dispatch tables. Mirrors Apr 8 change to mark_jump_label.
+ * gcse.c (add_label_notes): Similarly.
- * m68k.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_REGNUM,
- INCOMING_FRAME_SP_OFFSET): New definitions.
+ * pa.h (ASM_OUTPUT_MI_THUNK): Strip name encoding.
-Mon Sep 22 11:36:42 1997 David S. Miller <davem@tanya.rutgers.edu>
+ * m68k.md (adddi_dilshr32): One of the operands must be a register.
+ (adddi_dishl32): Similarly.
- * combine.c (try_combine): Use NULL_RTX instead of '0' where
- appropriate in calls to gen_rtx().
- * cse.c (cse_main): Likewise.
- * emit-rtl.c (gen_label_rtx): Likewise.
- * expr.c (init_expr_once): Likewise.
- * haifa-sched.c (flush_pending_lists, sched_analyze_insn,
- sched_analyze, init_rgn_data_dependences,
- compute_block_backward_dependences): Likewise.
- * sched.c (schedule_insns): Likewise.
- * varasm.c (immed_double_const): Likewise.
+Fri Aug 14 14:12:59 1998 Jason Merrill <jason@yorick.cygnus.com>
- * sparc.h (INCOMING_FRAME_SP_OFFSET): Define to
- SPARC_STACK_BIAS for sake of dwarf2 on sparc64.
+ * i386.h (MODES_TIEABLE_P): Reorganize to shut up warnings.
+ * alias.c (memrefs_conflict_p): Add braces to shut up warnings.
+ * cse.c (cse_basic_block): Add parens to shut up warnings.
-Mon Sep 22 11:21:33 1997 J. Kean Johnston <jkj@sco.com>
+Fri Aug 14 12:58:21 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * i386/sco5.h: Make ELF default file format and add -mcoff/-melf..
- (MULTILIB_DEFAULTS): Define.
- (ASM_SPEC, CPP_SPEC): Handle -mcoff.
- (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): Likewise.
- (LIBGCC_SPEC): Likewise.
- (MASK_COFF, TARGET_COFF, TARGET_ELF): Define.
- (SUBTARGET_SWITCHES): Add -mcoff and -melf.
- * i386/t-sco5 (CRTSTUFF_T_CFLAGS): Add -fPIC.
- (CRTSTUFF_T_CFLAGS_S): Tweak for COFF.
- (EXTRA_PARTS, TAROUTOPTS): Delete.
- (libgcc1-elf, libgcc2-elf, libgcc-elf targets): Delete.
- (MULTILIB_OPTIONS): Define.
- (MULTILIB_DIRNAMES, MULTILIB_EXCEPTIONS): Likewise.
- (MULTILIB_MATCHE, MULTILIB_EXTRA_OPTS): Likewise.
+ * config/sparc/sparc.c (sparc_emit_set_const64_quick2,
+ sparc_emit_set_const64_longway, const64_is_2insns,
+ create_simple_focus_bits, sparc_emit_set_const64): Fix more bugs
+ in 64-bit constant formation.
+ * config/sparc/sparc.md (snesi_zero_extend split): Generate
+ rtl for addx not subx.
+ (define_insn movdi_const64_special): Make available even when
+ HOST_BITS_PER_WIDE_INT is not 64.
+ (movdi_lo_sum_sp64_cint, movdi_high_sp64_cint): Remove.
+ (losum_di_medlow, sethm, setlo): Make op2 symbolic_operand.
+ (cmp_siqi_trunc_set, cmp_diqi_trunc_set): Encapsulate both
+ instances of operand 1 inside a QI subreg.
+ (xordi3_sp64_dbl): Remove '%' constraint for op1.
+ (one_cmpldi2_sp64): Fix output string.
+ (one_cmplsi2_not_liveg0): Rewrite to remove unneeded extra
+ alternative case.
+ (unnamed arch64 ashift DI): Truncate shift count if greater than
+ 63, not 31.
-Mon Sep 22 02:10:43 1997 Jeffrey A Law (law@cygnus.com)
+Fri Aug 14 21:52:53 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * version.c: Bump for snapshot.
+ * expr.c (store_expr): Don't optimize away load-store pair
+ when either source or destination have a side effect.
-Sun Sep 21 17:45:45 1997 Jeffrey A Law (law@cygnus.com)
+Fri Aug 14 16:50:10 1998 John Carr <jfc@mit.edu>
- * loop.c (loop_number): Delete function. Change all references
- to use uid_loop_num array.
- * loop.h (loop_number): Delete declaration.
- * unroll.c (unroll_loop): Change "loop_number" references to
- use uid_loop_num instead.
+ * genrecog.c (add_to_sequence): Fatal error if the modes of the
+ operands of SET are incompatible.
- * loop.c (loop_unroll_factor): Move outside #ifdef HAIFA
- conditional.
- (loop_unroll_iter): Remove unused variable and all references.
- (loop_optimize): Always allocate and clear space for loop_unroll_factor.
- (insert_bct): Fix minor formatting problems.
- * loop.h (loop_unroll_factor): Move decl outside #ifdef HAIFA.
- (loop_unroll_iter): Removed unused decl.
- * unroll.c (unroll_loop): Remove code to set loop_unroll_iter.
- Always record the unrolling factor.
+ * alpha.md: Fix max and min patterns so modes of SET operands match.
- * cse.c (simplify_relational_operation): Set h0u just like h0s.
- Similarly for h1u and h1s.
+Fri Aug 14 12:22:55 1998 Ian Lance Taylor <ian@cygnus.com>
- * flow.c (jmp_uses_reg_or_mem): Deleted unused function.
- (find_basic_blocks): Use computed_jump_p to determine if a
- particular JUMP_INSN is a computed jump.
- * reg-stack.c (find_blocks): Use computed_jump_p to determine
- if a particular JUMP_INSN is a computed jump.
- * rtlanal.c (jmp_uses_reg_or_mem): New function.
- (computed_jump_p): Likewise.
- * rtl.h (computed_jump_p): Declare.
- * genattrtab.c (pc_rtx): Define and initialize.
- * loop.c (loop_optimize): Always determine if the current
- function has a computed jump.
- (indirect_jump_in_function_p): Use computed_jump_p to determine
- if a particular JUMP_INSN is a computed jump.
+ * configure.in: Avoid [[ by using test and changequote.
+ * configure: Rebuild.
- * loop.c (fix_bct_param): Delete unused function.
- (check_bct_param): Likewise.
+Fri Aug 14 01:22:31 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Sat Sep 20 16:22:06 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * rtl.def (CONSTANT_P_RTX): Fix typo in string name.
- * frame.c (__deregister_frame): Check properly for initialized object.
+ * config/sparc/sparc.md (seqdi_special_trunc, snedi_special_trunc,
+ seqsi_special_extend, snesi_special_extend, snesi_zero_extend and
+ split, snedi_zero_trunc and split, seqsi_zero_extend and split,
+ seqdi_zero_trunc and split, pic_lo_sum_di, pic_sethi_di,
+ movdi_cc_sp64_trunc, movdi_cc_reg_sp64_trunc, addx_extend_sp32 and
+ split, addx_extend_sp64, subx_extend_sp64, subx_extend and split):
+ Fix mismatching modes in SET operands.
+ (conditional move patterns): Fix formatting.
+ (unnamed subx arch64 pattern): Remove duplicate insn.
+
+Fri Aug 14 00:34:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
+
+ * config/sparc/sparc.c (const64_operand, const64_high_operand):
+ Get it right when HOST_BITS_PER_WIDE_INT is not 64.
+ (input_operand): Fixup test for what we accept for constant
+ integers.
+ (sparc_emit_set_const32, sparc_emit_set_symbolic_const64): Give
+ set VOIDmode.
+ (safe_constDI): Remove.
+ (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64,
+ gen_safe_XOR64): New functions.
+ (sparc_emit_set_const64_quick1, sparc_emit_set_const64_quick2,
+ sparc_emit_set_const64_longway, sparc_emit_set_const64): Use
+ them.
+ * config/sparc/sparc.md (define_insn xordi3_sp64_dbl): Only make
+ available when HOST_BITS_PER_WIDE_INT is not 64.
+ (define_insn movdi_sp64_dbl, movdi_const64_special): Likewise and
+ move before movdi_insn_sp64 pattern.
+ (define_insn movdi_lo_sum_sp64_dbl, movdi_high_sp64_dbl): Remove.
+ (define_insn sethi_di_medlow, seth44, setm44, sethh): Use
+ symbolic_operand as predicate for second operand.
+ (DImode minus split on arch32, negsi2 expander, one_cmplsi2
+ expander): Give set VOIDmode.
+
+Fri Aug 14 01:45:06 1998 Mumit Khan <khan@xraylith.wisc.edu>
-Fri Sep 19 20:51:03 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+ * i386/cygwin32 (DEFAULT_PCC_STRUCT_RETURN): Define.
- * alpha/linux.h (HANDLE_SYSV_PRAGMA): Defined.
+Fri Aug 14 01:40:21 1998 Geoffrey Keating <geoffk@ozemail.com.au>
-Fri Sep 19 18:53:50 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * rs6000/linux.h (LINK_SPEC): Pass -G args to the linker.
- * jump.c (thread_jumps): check can_reverse_comparison_p before
- threading a reversed-condition jump.
+Fri Aug 14 01:23:23 1998 Richard Earnshaw (rearnsha@arm.com)
- * sched.c (update_flow_info): Don't pass SCRATCH to dead_or_set_p.
- * haifa-sched.c (update_flow_info): Likewise.
+ * arm/netbsd.h (TARGET_DEFAULT): Default includes software floating
+ point.
+ (CPP_FLOAT_DEFAULT_SPEC): Re-define accordingly.
-Thu Sep 18 21:13:40 1997 Jeffrey A Law (law@cygnus.com)
+Fri Aug 14 01:19:08 1998 Robert Lipe <robertl@dgii.com>
- * Makefile.in (BOOT_CFLAGS): Use -O2.
+ * install.texi: Various SCO OpenServer tweaks.
- * configure.in (strtoul, bsearch): Have autoconf check for these
- functions.
- * configure, config.in: Rebuilt.
+Thu Aug 13 20:14:40 1998 Jim Wilson <wilson@cygnus.com>
- * m68k/xm-mot3300.h (alloca): Properly declare if __STDC__.
- * mips/mips.h (alloca): Likewise.
- * rs6000/xm-rs6000.h (alloca): Likewise.
- * rs6000/xm-sysv4.h: Likewise.
+ * reload1.c (eliminate_regs_in_insn): Handle another case when
+ eliminating the frame pointer to the hard frame pointer. Add
+ missing ep->to_rtx check to one existing case.
-Thu Sep 18 14:22:22 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * mips/mips.md (movhi_internal2+2): Fix typo mem:SI -> mem:HI.
- * final.c (final_scan_insn): Hand BARRIERs off to the dwarf2 code.
- * dwarf2out.c (dwarf2out_frame_debug): Pass the whole insn along.
- (dwarf2out_stack_adjust): A BARRIER resets the args space to 0.
+Thu Aug 13 17:08:11 1998 Jason Merrill <jason@yorick.cygnus.com>
- * except.c (end_eh_unwinder): Subtract 1 from return address.
- * libgcc2.c (__throw): Likewise.
- (find_exception_handler): Don't change PC here. Compare end with >.
+ * tree.h: De-conditionalize init_priority code.
-Thu Sep 18 10:43:07 1997 Nick Clifton <nickc@cygnus.com>
+ * mips.h (NM_FLAGS): Change from -Bp to -Bn.
+ * collect2.c (NM_FLAGS): Change from -p to -n.
- * v850.c (compute_register_save_size): Correct register
- number.
- * v850.md (save_interrupt, return_interrupt): Correct
- register number.
- * v850/lib1funcs.asm (save_interrupt): Correct register number.
- (return_interrupt): Use stack pointer, not element pointer.
+ * configure.in: Turn on collect2 for mipstx39-elf.
+ Handle use_collect2=no properly.
-1997-09-18 Brendan Kehoe <brendan@lisa.cygnus.com>
+ * c-common.c: De-conditionalize init_priority code.
+ * collect2.c (extract_init_priority, sort_ids): New fns.
+ (main): Call sort_ids.
+ Move sequence_number to file scope.
- * configure.in, configure: Make sure to create the stage* and include
- symbolic links in each subdirectory.
+ * configure.in: Handle --enable-init-priority.
+ * c-common.c (attrs): Add A_INIT_PRIORITY.
+ (init_attributes, decl_attributes): Likewise.
+ * tree.h (DEFAULT_INIT_PRIORITY, MAX_INIT_PRIORITY): New macros.
+ * tree.c (get_file_function_name_long): Split out...
+ (get_file_function_name): ...from here.
-Thu Sep 18 01:47:06 1997 Jeffrey A Law (law@cygnus.com)
+Thu Aug 13 16:09:53 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
- * pa.md (reload_peepholes): Don't allow addresses with side
- effects for the memory operand.
+ * expr.c (safe_from_p): Change code to ERROR_MARK only when not
+ accessing nodes.
-Wed Sep 17 18:19:53 1997 Jason Merrill <jason@yorick.cygnus.com>
+Thu Aug 13 15:24:48 1998 Jason Merrill <jason@yorick.cygnus.com>
- * libgcc2.c (find_exception_handler): Subtract one from our PC when
- looking for a handler, to avoid hitting the beginning of the next
- region.
+ * toplev.c (display_help): Add braces to shut up warnings.
+ * tree.c (simple_cst_equal): Likewise.
- * except.c (expand_builtin_set_return_addr_reg): Use force_operand.
+ * fold-const.c (non_lvalue): Don't deal with null pointer
+ constants here.
+ (fold, case COMPOUND_EXPR): Wrap a constant 0 in a NOP_EXPR.
-Wed Sep 17 18:33:59 1997 Jeffrey A Law (law@cygnus.com)
+ * c-typeck.c (initializer_constant_valid_p): Allow conversion of 0
+ of any size to a pointer.
- * mips/abi64.h (LONG_MAX_SPEC): Define.
- * mips.h (LONG_MAX_SPEC): Define.
- (CPP_SPEC): Include long_max_spec.
- (EXTRA_SPECS): Include long_max_spec.
+Thu Aug 13 12:53:13 1998 Jim Wilson <wilson@cygnus.com>
-Wed Sep 17 14:11:38 1997 Jeffrey A Law (law@cygnus.com)
+ * i386/winnt.c (i386_pe_asm_file_end): Check TREE_SYMBOL_REFERENCED.
- * v850.c (construct_save_jarl): Fix thinko in last change.
+Wed Aug 12 17:25:18 1998 Jeffrey A Law (law@cygnus.com)
-Wed Sep 17 09:53:07 1997 Jeffrey A Law (law@cygnus.com)
+ * mn10300.c (REG_SAVE_BYTES): Only reserve space for registers
+ which will be saved.
+ * mn10300.md (prologue insn): Only save registers which need saving.
+ (epilogue insn): Similarly.
- * version.c: Bump for snapshot.
+ * mn10300.c, mn10300.h, mn10300.md: Remove "global zero register"
+ optimizations.
-Tue Sep 16 14:22:36 1997 Jason Merrill <jason@yorick.cygnus.com>
+Wed Aug 12 12:39:16 1998 Gavin Romig-Koch <gavin@cygnus.com>
- * libgcc2.c (find_exception_handler): Not found is -1.
+ * mips/mips.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG for
+ VAR_DECL's in gp addressable sections.
- * integrate.c (expand_inline_function): Move expand_start_bindings
- after expanding the arguments.
+Tue Aug 11 23:02:31 1998 John Carr <jfc@mit.edu>
-Tue Sep 16 11:13:46 1997 Jim Wilson <wilson@cygnus.com>
+ * sparc.c: Change return <exp> to <exp>; return; in functions
+ returning void.
+ * sparc.md: Add empty semicolon statement after final label in
+ move expanders.
- * expr.c (expand_expr): Remove previous incorrect change.
- If target and slot has no DECL_RTL, then call mark_addressable
- again for the slot after we give it RTL.
+Tue Aug 11 22:42:01 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Tue Sep 16 09:18:52 1997 Jason Merrill (jason@cygnus.com)
+ * config/sparc/sparc.md (define_insn addx_extend): Rename to
+ addx_extend_sp64, only allow when TARGET_ARCH64.
+ (define_insn addx_extend_sp32 and split): Version that works when
+ not TARGET_ARCH64.
+ (define_insn subx_extend): Likewise.
+ (define_split adddi3 and subdi3 with zero extension): Fixup and
+ correct bugs when not TARGET_ARCH64.
- * expr.c (expand_expr, case TARGET_EXPR): Call mark_addressable
- again for the slot after we give it RTL.
+Tue Aug 11 16:04:34 1998 John Carr <jfc@mit.edu>
-Tue Sep 16 00:13:20 1997 Nick Clifton <nickc@cygnus.com>
+ * except.c (set_exception_lang_code, set_exception_version_code):
+ Use prototype-style definition if __STDC__, to match declaration
+ in except.h.
- * v850.c (register_is_ok_for_epilogue,
- pattern_is_ok_for_epilogue, construct_restore_jr,
- pattern_is_ok_for_prologue, construct_save_jarl): New functions.
+ * genemit.c: Change FAIL and DONE macros not to use loops.
- * v850.h (pattern_is_ok_for_prologue,
- pattern_is_ok_for_epilogue, register_is_ok_for_epilogue): New
- predicates.
+Tue Aug 11 12:27:03 1998 Jim Wilson <wilson@cygnus.com>
- * v850.md: Replace prologue and epilogue patterns with a
- match_parallel pattern.
+ * dwarf2out.c (ASM_OUTPUT_DWARF_ADDR_CONST): Use
+ ASM_OUTPUT_DWARF2_ADDR_CONST if defined.
-Mon Sep 15 22:53:01 1997 Jeffrey A Law (law@cygnus.com)
+ * mips/mips.md (reload_outsi): Use M16_REG_P when TARGET_MIPS16.
- * aclocal.m4: Add replacement for AC_PROG_INSTALL.
- * configure.in: Use EGCS_PROG_INSTALL.
+Tue Aug 11 18:12:53 1998 Dave Love <d.love@dl.ac.uk>
-Mon Sep 15 22:40:55 1997 Jim Wilson (wilson@cygnus.com)
+ * README.g77: Update from Craig.
- * dwarf2out.c (gen_subprogram_die): Handle redefinition of an
- extern inline function.
+Tue Aug 11 04:46:01 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Mon Sep 15 22:40:55 1997 Richard Henderson (rth@cygnus.com)
+ * config/sparc/sparc.c (sparc_emit_set_const32): INTVAL is of
+ type HOST_WIDE_INT.
+ (safe_constDI sparc_emit_set_const64_quick1,
+ sparc_emit_set_const64_quick2, sparc_emit_set_const64_longway,
+ analyze_64bit_constant, const64_is_2insns,
+ create_simple_focus_bits): Fix some bugs when compiled on real
+ 64-bit hosts.
+ (function_arg_record_value_3, function_arg_record_value_2,
+ function_arg_record_value): Add fully prototyped forward decls.
+ * config/sparc/sparc.md (define_insn cmpsi_insn_sp32): Rename back
+ to cmpsi_insn and use on both 64 and 32 bit targets.
+ (define_insn cmpsi_insn_sp64): Remove.
+ (define_expand zero_extendsidi2): Allow for 32-bit target too.
+ (define_insn zero_extendsidi2_insn): Rename to
+ zero_extendsidi2_insn_sp64.
+ (define_insn zero_extendsidi2_insn_sp32): New pattern and
+ assosciated forced split for it.
- * dwarf2out.c (reg_loc_descriptor): Fix prototype.
- (concat_loc_descriptor): New function.
- (loc_descriptor): Call it.
- (add_AT_location_description): Also elide the descriptor if both
- halves of a CONCAT are pseudos.
- (add_location_or_const_value_attribute): Recognize CONCAT too.
+ * config/sparc/sparc.c (const64_operand, const64_high_operand):
+ New predicates.
+ * config/sparc/sparc.h: Declare them.
+ (PREDICATE_CODES): Add them.
+ * config/sparc/sparc.md (movdi_lo_sum_sp64_dbl,
+ movdi_high_sp64_dbl, xordi3_sp64_dbl): Use them.
-Mon Sep 15 15:24:00 1997 Richard Henderson <rth@cygnus.com>
+Mon Aug 10 22:57:24 1998 John Carr <jfc@mit.edu>
- * alpha.md (movdi): Handle CONST_DOUBLE for TARGET_BUILD_CONSTANTS.
+ * config/sparc/sparc.md (define_insn jump): Output ba,pt not b,pt
+ in v9 case as the latter makes the Solaris assembler crash.
- * alpha/alpha.c (output_prolog): New variable sa_reg. Use it for
- out-or-range reg_offset.
- (output_epilog): Likewise.
+Mon Aug 10 22:39:09 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Mon Sep 15 15:39:26 1997 Jeffrey A Law (law@cygnus.com)
+ * config/sparc/sparc.c (input_operand): Do not accept a LO_SUM MEM
+ for TFmode when !v9. We require offsettable memory addresses.
+ * config/sparc/sparc.h (ALTER_HARD_SUBREG): Handle TFmode to
+ DFmode register number conversions.
+ * config/sparc/sparc.md (define_split DFmode moves): If register
+ is a SUBREG do alter_subreg on it before using.
+ (define_expand movtf): Fixup comment about alignment on v9.
+ (define_split TFmode moves): Don't use gen_{high,low}part, create
+ explicit SUBREGs instead.
- * cse.c (simplify_relational_operation): If MODE specifies a
- mode wider than HOST_WIDE_INT, then the high word of a CONST_INT
- is derived from the sign bit of the low word.
+Mon Aug 10 19:02:55 1998 John Carr <jfc@mit.edu>
-Mon Sep 15 11:43:38 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * Makefile.in (mbchar.o): Depend on mbchar.c.
- Support dwarf2 unwinding on PUSH_ROUNDING targets like the x86.
+Mon Aug 10 04:28:13 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
+ Richard Henderson <rth@cygnus.com>
+
+ Rewrite Sparc backend for better code generation and
+ improved sparc64 support.
+ * config/sparc/sp64-elf.h: Set JUMP_TABLES_IN_TEXT_SECTION to
+ zero.
+ * config/sparc/sysv4.h: Likewise.
+ * config/sparc/sparc.c (v8plus_regcmp_p, sparc_operand,
+ move_operand, v8plus_regcmp_op, emit_move_sequence,
+ singlemove_string, doublemove_string, mem_aligned_8,
+ output_move_double, output_move_quad, output_fp_move_double,
+ move_quad_direction, output_fp_move_quad, output_scc_insn):
+ Remove.
+ (small_int_or_double): New predicate.
+ (gen_compare_reg): Remove TARGET_V8PLUS cmpdi_v8plus emission.
+ (legitimize_pic_address): Emit movsi_{high,lo_sum}_pic instead of
+ old pic_{sethi,lo_sum}_si patterns.
+ (mem_min_alignment): New generic function to replace
+ mem_aligned_8, which uses REGNO_POINTER_ALIGN information when
+ available and can test for arbitrary alignments. All callers
+ changed.
+ (save_regs, restore_regs, build_big_number,
+ output_function_prologue, output_cbranch, output_return,
+ sparc_flat_save_restore, sparc_flat_output_function_prologue,
+ sparc_flat_output_function_epilogue): Prettify
+ insn output.
+ (output_function_epilogue): Likewise and add code to output
+ deferred case vectors.
+ (output_v9branch): Likewise, add new arg INSN and use it to tack
+ on branch prediction settings. All callers changed.
+ (print_operand): Likewise and output %l44 for LO_SUMs when
+ TARGET_CM_MEDMID.
+ (sparc_splitdi_legitimate): New function to make sure DImode
+ splits can be run properly when !arch64.
+ (sparc_initialize_trampoline, sparc64_initialize_trampoline):
+ Reformat example code in comments.
+ (set_extends): Remove UNSPEC/v8plus_clear_high case.
+ (sparc_addr_diff_list, sparc_addr_list): New statics to keep track
+ of deferred case vectors we need to output.
+ (sparc_defer_case_vector): Record a case vector.
+ (sparc_output_addr_vec, sparc_output_addr_diff_vec,
+ sparc_output_deferred_case_vectors): New functions to output them.
+ (sparc_emit_set_const32): New function to form 32-bit constants in
+ registers when that requires more than one instruction.
+ (safe_constDI, sparc_emit_set_const64_quick1,
+ sparc_emit_set_const64_quick2, sparc_emit_set_const64_longway,
+ analyze_64bit_constant, const64_is_2insns,
+ create_simple_focus_bits, sparc_emit_set_const64): New functions
+ which do the same for 64-bit constants when arch64.
+ (sparc_emit_set_symbolic_const64): New function to emit address
+ loading for all code models on v9.
+ * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Do not make
+ %g1 fixed when arch64, unfix %g0 when TARGET_LIVE_G0.
+ (ALTER_HARD_SUBREG): Fix thinko, return REGNO + 1 not 1.
+ (SECONDARY_INPUT_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS): Fix
+ inaccuracies in comments, add symbolic and text_segment operands
+ when TARGET_CM_MEDANY and TARGET_CM_EMBMEDANY respectively. Use
+ GENERAL_REGS in these cases as a temp REG is needed to load these
+ addresses into a register properly.
+ (EXTRA_CONSTRAINT): Document more accurately, remove Q case as it
+ is no longer used.
+ (GO_IF_LEGITIMATE_ADDRESS): Allow TFmode for LO_SUM on v9 since fp
+ quads are guarenteed to have 16-byte alignment.
+ (LEGITIMIZE_ADDRESS): For SYMBOL_REF, CONST, and LABEL_REF use
+ copy_to_suggested_reg instead of explicit LO_SUM and HIGH.
+ (ASM_OUTPUT_ADDR_VEC, ASM_OUTPUT_ADDR_DIFF_VEC): New macros for
+ deferred case vector implementation.
+ (ASM_OUTPUT_ADDR_VEC_ELT): Use fputc to output newline.
+ (ASM_OUTPUT_ADDR_DIFF_ELT): Parenthesize LABEL in macro calls.
+ Generate "internal label - label" instead of "label - 1b".
+ (PRINT_OPERAND_ADDRESS): For LO_SUM use %l44 on TARGET_CM_MEDMID.
+ (PREDICATE_CODES): Remove sparc_operand, move_operand,
+ v8plus_regcmp_op. Add small_int_or_double, input_operand, and
+ zero_operand.
+ (doublemove_string, output_block_move, output_fp_move_double,
+ output_fp_move_quad, output_move_double, output_move_quad,
+ output_scc_insn, singlemove_string, mem_aligned_8, move_operand,
+ sparc_operand, v8plus_regcmp_op, v8plus_regcmp_p): Remove externs.
+ (sparc_emit_set_const32, sparc_emit_set_const64,
+ sparc_emit_set_symbolic_const64, input_operand, zero_operand,
+ mem_min_alignment, small_int_or_double): Add externs.
+ * config/sparc/sparc.md: Document the many uses of UNSPEC and
+ UNSPEC_VOLATILE in this backend.
+ (define_function_unit ieu): Rename to ieu_unnamed. Add move and
+ unary to types which execute in it.
+ (define_function_unit ieu_shift): Rename to ieu0.
+ (define_function_unit ieu1): New, executes compare, call, and
+ uncond_branch type insns.
+ (define_function_units for type fdivs, fdivd, fsqrt): These
+ execute in the fpu multiply unit not the adder on UltraSparc.
+ (define_expand cmpdi): Disallow TARGET_V8PLUS.
+ (define_insn cmpsi_insn): Rename to cmpsi_insn_sp32.
+ (define_insn cmpsi_insn_sp64): New, same as sp32 variant except it
+ allows the arith_double_operand predicate and rHI constraint when
+ TARGET_ARCH64.
+ (define_insn cmpdi_sp64, cmpsf_fpe, cmpdf_fpe, cmptf_fpe,
+ cmpsf_fp, cmpdf_fp, cmptf_fp, sltu_insn, neg_sltu_insn,
+ neg_sltu_minux_x, neg_sltu_plus_x, sgeu_insn, neg_sgeu_insn,
+ sltu_plus_x, sltu_plus_x, sltu_plus_x_plus_y, x_minus_sltu,
+ sgeu_plus_x, x_minus_sgeu, movqi_cc_sp64, movhi_cc_sp64,
+ movsi_cc_sp64, movdi_cc_sp64, movsf_cc_sp64, movdf_cc_sp64,
+ movtf_cc_sp64, movqi_cc_reg_sp64, movhi_cc_reg_sp64,
+ movsi_cc_reg_sp64, movdi_cc_reg_sp64, movsf_cc_reg_sp64,
+ movdf_cc_reg_sp64, movtf_cc_reg_sp64, zero_extendhisi2_insn,
+ cmp_siqi_trunc, cmp_siqi_trunc_set, sign_extendhisi2_insn,
+ sign_extendqihi2_insn, sign_extendqisi2_insn,
+ sign_extendqidi2_insn, sign_extendhidi2_insn,
+ extendsfdf2, extendsftf2, extenddftf2, truncdfsf2, trunctfsf2,
+ trunctfdf2, floatsisf2, floatsidf2, floatsitf2, floatdisf2,
+ floatdidf2, floatditf2, fix_truncsfsi2, fix_truncdfsi2,
+ fix_trunctfsi2, fix_truncsfdi2, fix_truncdfdi2, fix_trunctfdi2,
+ adddi3_sp64, addsi3, cmp_ccx_plus, cmp_cc_plus_set, subdi_sp64,
+ subsi3, cmp_minus_ccx, cmp_minus_ccx_set, mulsi3, muldi3,
+ muldi3_v8plus, cmp_mul_set, mulsidi3, mulsidi3_v8plus,
+ const_mulsidi3_v8plus, mulsidi3_sp32, const_mulsidi3,
+ smulsi3_highpart_v8plus, unnamed subreg mult,
+ const_smulsi3_highpart_v8plus, smulsi3_highpart_sp32,
+ const_smulsi3_highpart, umulsidi3_v8plus, umulsidi3_sp32,
+ const_umulsidi3, const_umulsidi3_v8plus, umulsi3_highpart_v8plus,
+ const_umulsi3_highpart_v8plus, umulsi3_highpart_sp32,
+ const_umulsi3_highpart, divsi3, divdi3, cmp_sdiv_cc_set, udivsi3,
+ udivdi3, cmp_udiv_cc_set, smacsi, smacdi, umacdi, anddi3_sp64,
+ andsi3, and_not_di_sp64, and_not_si, iordi3_sp64, iorsi3,
+ or_not_di_sp64, or_not_si, xordi3_sp64, xorsi3, xor_not_di_sp64,
+ xor_not_si, cmp_cc_arith_op, cmp_ccx_arith_op,
+ cmp_cc_arith_op_set, cmp_ccx_arith_op_set, cmp_ccx_xor_not,
+ cmp_cc_xor_not_set, cmp_ccx_xor_not_set, cmp_cc_arith_op_not,
+ cmp_ccx_arith_op_not, cmp_cc_arith_op_not_set,
+ cmp_ccx_arith_op_not_set, negdi2_sp64, cmp_cc_neg, cmp_ccx_neg,
+ cmp_cc_set_neg, cmp_ccx_set_neg, one_cmpldi2_sp64, cmp_cc_not,
+ cmp_ccx_not, cmp_cc_set_not, cmp_ccx_set_not, addtf3, adddf3,
+ addsf3, subtf3, subdf3, subsf3, multf3, muldf3, mulsf3,
+ muldf3_extend, multf3_extend, divtf3, divdf3, divsf3, negtf2,
+ negdf2, negsf2, abstf2, absdf2, abssf2, sqrttf2, sqrtdf2, sqrtsf2,
+ ashlsi3, ashldi3, unnamed DI ashift, cmp_cc_ashift_1,
+ cmp_cc_set_ashift_1, ashrsi3, ashrdi3, unnamed DI ashiftrt,
+ ashrdi3_v8plus, lshrsi3, lshrdi3, unnamed DI lshiftrt,
+ lshrdi3_v8plus, tablejump_sp32, tablejump_sp64, call_address_sp32,
+ call_symbolic_sp32, call_address_sp64, call_symbolic_sp64,
+ call_address_struct_value_sp32, call_symbolic_struct_value_sp32,
+ call_address_untyped_struct_value_sp32,
+ call_symbolic_untyped_struct_value_sp32, call_value_address_sp32,
+ call_value_symbolic_sp32, call_value_address_sp64,
+ call_value_symbolic_sp64, branch_sp32, branch_sp64,
+ flush_register_windows, goto_handler_and_restore,
+ goto_handler_and_restore_v9, goto_handler_and_restore_v9_sp64,
+ flush, all ldd/std peepholes, return_qi, return_hi, return_si,
+ return_addsi, return_di, return_adddi, return_sf, all call+jump
+ peepholes, trap, unnamed trap insns): Prettify output strings.
+ (define_insn anddi3_sp32, and_not_di_sp32, iordi3_sp32,
+ or_not_di_sp32, xordi3_sp32, xor_not_di_sp32, one_cmpldi2):
+ Likewise and force + implement splits for integer cases.
+ (define_insn return_sf_no_fpu): Likewise and allow to match when
+ no-fpu because of our subreg SFmode splits.
+ (define_insn zero_extendqihi2, zero_extendqisi2_insn,
+ zero_extendqidi2_insn, zero_extendhidi2_insn,
+ zero_extendsidi2_insn, sign_extendsidi2_insn): Likewise and use
+ input_operand for second operand.
+ (cmp_minus_cc, cmp_minus_cc_set): Likewise and use
+ reg_or_0_operand for operand 2 so new splits can use it.
+ (cmp_zero_extendqisi2, cmp_zero_extendqisi2_set, cmp_cc_plus,
+ cmp_cc_xor_not): Likewise and don't forget to check TARGET_LIVE_G0
+ too.
+ (cmp_zero_extract, cmp_zero_extract_sp64): Likewise and allow
+ CONST_DOUBLEs for operand 2.
+ (define_insn move_label_di): Likewise and label distance
+ optimization because it no longer works with new deferred case
+ vector scheme. To be revisited.
+ (define_insn x_minus_y_minus_sltu, x_minus_sltu_plus_y): Likewise
+ and allow reg_or_0_operand and J constraint for second operand.
+ (define_insn jump): Set branch predict taken on V9.
+ (define_insn tablejump): Emit LABEL_REF + PLUS memory address for
+ new deferred case vector scheme.
+ (define_insn pic_tablejump_32, pic_tablejump_64): Remove.
+ (define_insn negdi2_sp32): Force + implement splits.
+ (define_insn negsi2, one_cmplsi2): Rename to negsi2_not_liveg0 and
+ one_cmplsi2_not_liveg0 respectively, and create expander of original
+ names which emit special rtl for TARGET_LIVE_G0.
+ (define_insn cmpdi_v8plus, scc_si, scc_di): Remove.
+ (define_insn seq, sne, slt, sge, sle, sltu, sgeu): Don't do
+ gen_compare_reg, FAIL instead.
+ (define_insn sgtu, sleu): Likewise and check gen_s*() return
+ values when trying to reverse condition codes, if they FAIL then
+ do likewise.
+ (define_insn snesi_zero, neg_snesi_zero, snesi_zero_extend,
+ snedi_zero, neg_snedi_zero, snedi_zero_trunc, seqsi_zero,
+ neg_seqsi_zero, seqsi_zero_extend, seqdi_zero, neg_seqdi_zero,
+ seqdi_zero_trunc, x_plus_i_ne_0, x_minus_i_ne_0, x_plus_i_eq_0,
+ x_minus_i_eq_0): Add new splits to perform these multi-insn cases,
+ set output string to # to indicate they are mandatory splits.
+ (define_insn pic_lo_sum_si, pic_sethi_si, pic_lo_sum_di,
+ pic_sethi_di, move_pic_label_si): Remove.
+ (define_insn movsi_low_sum, movsi_high, movsi_lo_sum_pic,
+ movsi_high_pic, movsi_pic_label_reg): New patterns to take their
+ place.
+ (define_expand movsi_pic_label_ref, define_insn
+ movsi_high_pic_label_ref, movsi_lo_sum_pic_label_ref): New
+ expander and insns to handle PIC label references and deferred
+ case vectors.
+ (define_insn get_pc_via_rdpc): Comment out as it is no longer
+ used.
+ (define_expand movqi, movhi, movsi, movdi, movsf, movdf, movtf):
+ Rewrite to not use emit_move_sequence, make use of new constant
+ formation code, and new splits for all multi-insn cases.
+ (define_insn movqi_insn): Remove sethi case, it can never happen.
+ Use reg_or_zero_operand instead of const0_rtx explicit test,
+ use input_operand instead of move_operand for source, and use
+ general_operand now for dest.
+ (define_insn movhi_insn): Similar but leave sethi case.
+ (define_insn lo_sum_qi, store_qi, store_hi): Remove.
+ (define_insn sethi_hi lo_sum_hi): Rename to movhi_high and
+ movhi_lo_sum respectively, prettify output string.
+ (define_insn movsi_zero_liveg0): New pattern to put zero into a
+ register when needed on TARGET_LIVE_G0.
+ (define_insn movsi_insn): Use general_operand and input_operand
+ for dest and src respectively. Simplify applicability test.
+ Prettify output strings, and add clr alternative for J
+ constraint.
+ (define_insn movdi_sp32_v9, movdi_sp32, define_splits for
+ deprecated std and reg-reg DI moves): Remove and...
+ (define_insn movdi_insn_sp32, movdi_insn_sp64): Replace with new
+ implementation which uses forced splits for all non-single insn
+ cases.
+ (define_split DI move cases on !arch64): New splits to handle all
+ situations of 64-bit double register DImode on 32bit, and
+ unaligned registers and memory addresses for all subtargets.
+ (define_insn movsf_const_insn, movdf_const_insn, store_sf):
+ Remove.
+ (define_insn movsf_insn, movsf_no_f_insn): Use general_operand and
+ input_operand for dest and src respectively, prettify output
+ strings.
+ (define_insn movdf_insn, movdf_no_e_insn, store_df,
+ movtf_const_insn, movtf_insn, movtf_no_e_insn, store_tf): Remove
+ and...
+ (define_insn movdf_insn_sp32, movdf_no_e_insn_sp32,
+ movdf_insn_sp64, movdf_no_e_insn_sp64, movtf_insn,
+ movtf_no_e_insn_sp32, movtf_insn_hq_sp64, movtf_insn_sp64,
+ movtf_no_e_insn_sp64) Replace with new
+ implementation which uses forced splits for all non-single insn
+ cases.
+ (define_split DF move cases): New splits in similar vein to DI
+ move counterparts.
+ (define_insn sethi_di_medlow, sethi_di_medium_pic,
+ sethi_di_embmedany_data, sethi_di_embmedany_text, sethi_di_sp64,
+ movdi_sp64_insn): Remove old v9 code model and constant loading
+ support insns and..
+ (define_insn pic_lo_sum_di, pic_sethi_di,
+ sethi_di_medlow_embmedany_pic, sethi_di_medlow, losum_di_medlow,
+ seth44, setm44, setl44, sethh, setlm, sethm, setlo,
+ embmedany_sethi, embmedany_losum, embmedany_brsum,
+ embmedany_textuhi, embmedany_texthi, embmedany_textulo,
+ embmedany_textlo, movdi_lo_sum_sp64_cint, movdi_lo_sum_sp64_dbl,
+ movdi_high_sp64_cint, movdi_high_sp64_dbl): Replace with new
+ scheme, using unspecs, secondary reloads, and one to one sparc
+ insn to rtl insn mapping for better scheduling and code gen.
+ (define_expand reload_indi, reload_outdi): Reload helpers for
+ MEDANY and EMBMEDANY symbol address loading cases which require a
+ temporary register.
+ (define_expand movsicc): Remove v8plus_regcmp cases.
+ (define_insn movdi_cc_sp64_trunc, movdi_cc_reg_sp64_trunc,
+ cmp_zero_extendqidi2, cmp_zero_extendqidi2_set, cmp_qidi_trunc,
+ cmp_diqi_trunc_set): New patterns used by some of the new scc
+ splits on arch64.
+ (define_insn xordi3_sp64_dbl): New pattern used for constant
+ formation when crossing from 32-bit targets.
+ (define_insn movsi_cc_reg_v8plus, v8plus_clear_high, and helper
+ split): Remove.
+ (define_insn addx, subx): Make visible and prettify.
+ (define_insn adddi3_insn_sp32): Likewise and force split.
+ (define_insn addx_extend, subx_extend, unnamed): New patterns for
+ 64bit scc split usage.
+ (define_insn unnamed plusDI zero_extend, unnamed minusDI
+ zero_extend, subdi3): Force and implement splits.
+
+ * final.c (final_scan_insn): Don't output labels if target
+ specifies ASM_OUTPUT_ADDR_{DIFF}_VEC. Do these macro operations
+ instead.
+
+ * reorg.c (dbr_schedule): When taking on BR_PRED notes at the end,
+ don't forget to walk inside SEQUENCESs too as these are what the
+ delay slot scheduler will create.
+
+Mon Aug 10 01:21:01 1998 Richard Henderson <rth@cygnus.com>
- * dwarf2.h: Add DW_CFA_GNU_args_size.
- * frame.c (execute_cfa_insn): Likewise.
- * dwarf2out.c (dwarf_cfi_name, output_cfi): Likewise.
- (dwarf2out_args_size, dwarf2out_stack_adjust): New fns.
- (dwarf2out_frame_debug): If this isn't a prologue or epilogue
- insn, hand it off to dwarf2out_stack_adjust.
- (dwarf2out_begin_prologue): Initialize args_size.
- * frame.h (struct frame_state): Add args_size.
- * libgcc2.c (__throw): Use args_size.
- * final.c (final_scan_insn): If we push args, hand off all insns
- to dwarf2out_frame_debug.
- * defaults.h (DWARF2_UNWIND_INFO): OK for !ACCUMULATE_OUTGOING_ARGS.
+ * alpha.md (extxl+1,+2): New patterns to work around
+ combine lossage.
- * dwarf2out.c dwarf2out_frame_debug): Fix typo.
- Handle epilogue restore of SP from FP.
- * emit-rtl.c (gen_sequence): Still generate a sequence if the
- lone insn has RTX_FRAME_RELATED_P set.
+Sat Aug 8 19:20:22 1998 Gary Thomas (gdt@linuxppc.org)
- * frame.c (extract_cie_info): Handle "e" augmentation.
- * dwarf2out.c (ASM_OUTPUT_DWARF_*): Provide definitions in the
- absence of UNALIGNED_*_ASM_OP.
- (UNALIGNED_*_ASM_OP): Only provide defaults if OBJECT_FORMAT_ELF.
- (output_call_frame_info): Use "e" instead of "z" for augmentation.
- Don't emit augmentation fields length.
- (dwarf2out_do_frame): Move outside of #ifdefs.
- * defaults.h (DWARF2_UNWIND_INFO): Don't require unaligned data
- opcodes.
+ * rs6000.c (rs6000_allocate_stack_space) Fix typo which
+ caused bad assembly code to be generated.
- * sparc.h (UNALIGNED_INT_ASM_OP et al): Don't define here after all.
- * sparc/sysv4.h (UNALIGNED_INT_ASM_OP): Define here.
- * sparc/sunos4.h (DWARF2_UNWIND_INFO): Define to 0.
- * sparc/sun4gas.h: New file.
- * configure.in: Use sun4gas.h if SunOS 4 --with-gnu-as.
+Sat Aug 8 18:53:28 1998 Jeffrey A Law (law@cygnus.com)
- * collect2.c (write_c_file_stat, write_c_file_glob): Declare
- __register_frame_table and __deregister_frame.
+ * netbsd.h: Fix typo.
-1997-09-15 Brendan Kehoe <brendan@cygnus.com>
+Mon Aug 3 00:06:42 1998 Robert Lipe <robertl@dgii.com>
- * except.c (find_exception_handler_labels): Use xmalloc instead of
- alloca, since MAX_LABELNO - MIN_LABELNO can be more than 1 million
- in some cases.
+ * config.sub: Fix typo.
-Sun Sep 14 21:01:23 1997 Jeffrey A Law (law@cygnus.com)
+Sun Aug 2 22:39:08 1998 Hans-Peter Nilsson <hp@axis.se>
- * Makefile.in: Various changes to build info files
- in the object tree rather than the source tree.
+ * invoke.texi (Environment Variables): Typo: Change "ascpects"
+ into "aspects".
+ (Running Protoize): Typo: Change "ther" into "other".
-Sun Sep 14 12:24:30 1997 Jeffrey A Law (law@cygnus.com)
+Sun Aug 2 00:42:50 1998 Jeffrey A Law (law@cygnus.com)
- * fixinc.math: New file to fix math.h on some systems.
- * configure.in (freebsd, netbsd): Use fixinc.math on these
- systems.
- * configure: Rebuilt.
+ * i386/netbsd.h: Undo previous change to DWARF2_UNWIND_INFO.
+ * m68k/netbsd.h: Likewise.
+ * ns32k/netbsd.h: Likewise.
+ * sparc/netbsd.h: Likewise.
-Sun Sep 14 11:11:05 1997 Jeffrey A Law (law@cygnus.com)
+Sat Aug 1 17:59:30 1998 Richard Henderson <rth@cygnus.com>
- * regmove.c (regmove_optimize): If we end up moving the
- original insn due to lifetime overlaps, make sure to move
- REG_NOTES too.
+ * ginclude/va-alpha.h (va_list): Use a typedef, not a define.
+ * ginclude/va-clipper.h (va_list): Likewise.
-Sat Sep 13 15:51:11 1997 Manfred Hollstein <manfred@s-direktnet.de>
+Fri Jul 31 20:22:02 1998 Michael Meissner <meissner@cygnus.com>
- * Makefile.in (INSTALL_{PROGRAM,DATA}): Use value found by configure.
+ * rs6000.c (rs6000_override_options): If big endian and -Os, use
+ load/store multiple instructions unless user overrides.
-Sat Sep 13 12:57:26 1997 Jeffrey A Law (law@cygnus.com)
+Fri Jul 31 17:08:59 1998 Jeffrey A Law (law@cygnus.com)
- * haifa-sched.c (add_branch_dependences): Make each insn in
- a SCHED_GROUP_P block explicitly depend on the previous insn.
+ * ns32k/netbsd.h: Fix typo.
-Fri Sep 12 13:49:58 1997 Jason Merrill <jason@yorick.cygnus.com>
+Fri Jul 31 10:23:55 1998 Doug Evans <devans@canuck.cygnus.com>
- * except.h: Prototype dwarf2 hooks.
- * expr.c: Adjust.
+ * m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Always output line number
+ labels with .debugsym if no parallel insns.
-Thu Sep 11 17:43:55 1997 Jim Wilson <wilson@cygnus.com>
+Thu Jul 30 19:15:53 1998 Richard Henderson <rth@cygnus.com>
- * configure.in (native_prefix): Delete.
- (mips-dec-netbsd): Don't set prefix.
- (*linux*): Don't set prefix.
+ * alpha.md (fp cmp): Replicate patterns for ALPHA_TP_INSN.
+ (fcmov): Remove ALPHA_TP_INSN patterns -- fcmov doesn't trap.
-Thu Sep 11 15:48:32 1997 Fred Fish <fnf@ninemoons.com>
+Thu Jul 30 19:50:15 1998 David Edelsohn <edelsohn@mhpcc.edu>
- * protoize.c: Include <varargs.h> only if HAVE_VARARGS_H is
- defined. If not defined, include <sys/varargs.h> if
- HAVE_SYS_VARARGS_H is defined.
- * configure.in: Test for varargs.h and sys/varargs.h.
- * configure: Regenerate with autoconf.
- * config.in: Regenerate with autoheader.
+ * rs6000/x-aix43 (AR_FOR_TARGET_FLAGS): Delete.
+ (AR_FOR_TARGET): Define.
- * cpplib.c (quote_string): Cast first arg of sprintf call
- from "unsigned char *" to "char *".
- (output_line_command): Ditto.
- (macroexpand): Ditto.
- (do_line): Cast atoi arg from "unsigned char *" to "char *".
+Thu Jul 30 12:29:12 1998 Mark Mitchell <mark@markmitchell.com>
-Wed Sep 10 21:37:30 1997 Jeffrey A Law (law@cygnus.com)
+ * dyn-string.h: New file.
+ * dyn-string.c: Likewise.
+ * Makefile.in (OBJS): Add dyn-string.o.
+ (dwarf2out.o): Add dyn-string.h dependency.
+ (dyn-string.o): List dependencies.
+ * dwarf2out.c: Include dyn-string.h.
+ (ASM_NAME_TO_STRING): Use dyn_string_append, rather than strcpy.
+ (addr_const_to_string): Take a dyn_string_t, not a char* as a
+ prototype. Use dyn_string_append rather than strcat, throughout.
+ (addr_to_string): Use dyn_string_t.
- * version.c: Bump for snapshot.
+Thu Jul 30 13:08:07 1998 Ken Raeburn <raeburn@cygnus.com>
- * Makefile.in (compare): Exit with nonzero status if there
- are comparison failures. Note which files failed the
- comparison test in .bad_compare.
+ Function entry/exit profiling instrumentation:
+ * expr.h (profile_function_entry_libfunc,
+ profile_function_exit_libfunc): Declare new variables.
+ * optabs.c: Define them here.
+ (init_optabs): Initialize them.
+ * tree.h (struct tree_decl): New flag
+ no_instrument_function_entry_exit.
+ (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT): New accessor macro.
+ * c-decl.c (duplicate_decls): Merge it.
+ * c-common.c (enum attrs): New value A_NO_INSTRUMENT_FUNCTION.
+ (init_attributes): Use it for "no_instrument_function".
+ (decl_attributes): Handle it, for functions that have not yet been
+ compiled. Set decl flag.
+ * flags.h (flag_instrument_function_entry_exit): Declare new
+ variable.
+ * toplev.c (flag_instrument_function_entry_exit): Define it here.
+ (f_options): New option "instrument-functions".
+ * function.h (struct function): New field instrument_entry_exit.
+ * function.c (current_function_instrument_entry_exit): New
+ variable.
+ (push_function_context_to, pop_function_context_from): Save and
+ restore.
+ (expand_function_start): Set current_ variable, maybe emit return
+ label and entry profile call.
+ (expand_function_end): Maybe emit exit profile call.
-Wed Sep 10 17:05:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+Thu Jul 30 00:58:34 1998 Jeffrey A Law (law@cygnus.com)
- * config/alpha/elf.h (CPP_PREDEFINES): Remove -D__PIC__ -D__pic__.
+ * i386.md (movqi): When optimizing a load of (const_int 1) into a
+ NON_QI_REG_P, pretend the register is SImode.
-Wed Sep 10 16:37:28 1997 Fred Fish <fnf@ninemoons.com>
+Wed Jul 29 23:49:23 1998 Todd Vierling <tv@netbsd.org>
- * Makefile.in (LN, LN_S): New macros, use where appropriate.
- * aclocal.m4 (GCC_PROG_LN_S, GCC_PROG_LN): New tests.
- * configure.in: Use GCC_PROG_LN_S and GCC_PROG_LN.
+ * configure.in: Use xm-netbsd.h as the NetBSD xm file (not xm-siglist).
+ Accept arm32 as arm, m68k4k as m68k, mipsle as mips-dec, and any
+ manufacturer id for ns32k.
* configure: Regenerated.
+ * config/netbsd.h: When using ASM_WEAKEN_LABEL, make it global too.
+ * config/t-netbsd: Don't compile libgcc1-test as the fns are in libc.
+ * config/i386/netbsd.h: Undefine DWARF2_UNWIND_INFO, not define as 0.
+ * config/m68k/netbsd.h: Same.
+ * config/ns32k/netbsd.h: Same.
+ * config/sparc/netbsd.h: Same.
-Thu Sep 11 11:09:43 1997 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (strength_reduce): Fix typo.
-
-Wed Sep 10 16:01:15 1997 Jim Wilson <wilson@cygnus.com>
-
- * m88k/m88k.c (struct option): Rename to struct options.
- * m88k/dolph.h (INITIALIZE_TRAMPOLINE): Delete here.
- * m88k/sysv3.h (INITIALIZE_TRAMPOLINE): Delete ifdef and comments.
- * libgcc2.c (__enable_execute_stack): Check for __sysV88__ not
- __DOLPHIN__ or sysV88.
-
-Wed Sep 10 14:58:40 1997 Jim Wilson <wilson@cygnus.com>
-
- * emit-rtl.c (gen_lowpart_common): For a SUBREG, add in word when
- create new subreg.
-
-Wed Sep 10 15:19:22 1997 Jeffrey A Law (law@cygnus.com)
-
- * config.sub: Accept 'amigados' for backward compatability.
-
-Wed Sep 10 14:05:08 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (testsuite/site.exp): New target.
- (check-gcc, check-g++): Depend on testsuite/site.exp.
- Don't stop for failure.
-
-Wed Sep 10 12:59:57 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (expand_builtin): Only support __builtin_dwarf_fp_regnum()
- if DWARF2_UNWIND_INFO.
-
-Wed Sep 10 11:49:20 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- Add support for exception handling using DWARF 2 frame unwind info.
- Currently works on SPARC and MIPS, and almost on x86.
-
- * libgcc2.c (get_reg, put_reg, get_return_addr, put_return_addr,
- next_stack_level, in_reg_window): Helper fns.
- (__throw): Implement for DWARF2_UNWIND_INFO.
-
- * expr.c (expand_builtin): Handle builtins used by __throw.
- * tree.h (enum built_in_function): Add builtins used by __throw.
- * c-decl.c (init_decl_processing): Declare builtins used by __throw.
- * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Used by __throw.
- * except.c (expand_builtin_unwind_init): Hook for dwarf2 __throw.
- (expand_builtin_extract_return_addr): Likewise.
- (expand_builtin_frob_return_addr): Likewise.
- (expand_builtin_set_return_addr_reg): Likewise.
- (expand_builtin_eh_stub): Likewise.
- (expand_builtin_set_eh_regs): Likewise.
- (eh_regs): Choose two call-clobbered registers for passing back values.
-
- * frame.c, frame.h: New files for parsing dwarf 2 frame info.
- * Makefile.in (LIB2ADD): New variable. Add $(srcdir)/frame.c.
- (libgcc2.a): Use it instead of $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
- (stmp-multilib): Likewise.
- ($(T)crtbegin.o, $(T)crtend.o): Add -fno-exceptions.
-
- * except.c: #include "defaults.h".
- (exceptions_via_longjmp): Default depends on DWARF2_UNWIND_INFO.
- (emit_throw): Don't defeat assemble_external if DWARF2_UNWIND_INFO.
- (register_exception_table_p): New fn.
- (start_eh_unwinder): Don't do anything if DWARF2_UNWIND_INFO.
- (end_eh_unwinder): Likewise.
-
- * crtstuff.c: Wrap .eh_frame section, use EH_FRAME_SECTION_ASM_OP,
- call __register_frame and __deregister_frame as needed.
- * varasm.c (eh_frame_section): New fn if EH_FRAME_SECTION_ASM_OP.
- * dwarf2out.c (EH_FRAME_SECTION): Now a function-like macro. Check
- EH_FRAME_SECTION_ASM_OP.
- * sparc/sysv4.h (EH_FRAME_SECTION_ASM_OP): Define.
- * mips/iris6.h: (EH_FRAME_SECTION_ASM_OP): Define.
- (LINK_SPEC): Add __EH_FRAME_BEGIN__ to hidden symbols.
+Wed Jul 29 22:39:21 1998 Jeffrey A Law (law@cygnus.com)
- * dwarf2out.c (output_call_frame_info): If no support for
- EXCEPTION_SECTION, mark the start of the frame info with a
- collectable tag.
- * collect2.c (frame_tables): New list.
- (is_ctor_dtor): Recognise frame entries.
- (scan_prog_file): Likewise.
- (main): Pass -fno-exceptions to sub-compile. Also do collection
- if there are any frame entries.
- (write_c_file_stat): Call __register_frame_table and
- __deregister_frame as needed.
- (write_c_file_glob): Likewise.
+ * unroll.c (unroll_loop): Do not abort for an UNROLL_MODULO
+ or UNROLL_COMPLETELY loop that starts with a jump to its
+ exit code.
- * defaults.h (DWARF2_UNWIND_INFO): Default to 1 if supported.
- Also require unaligned reloc support.
- * sparc.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
- UNALIGNED_DOUBLE_INT_ASM_OP): Define here.
- * sparc/sysv4.h: Not here.
+Wed Jul 29 22:18:14 1998 David Edelsohn <edelsohn@mhpcc.edu>
- * toplev.c (compile_file): Call dwarf2out_frame_{init,finish}.
- * dwarf2out.c (dwarf2out_init): Don't call dwarf2out_frame_init.
- (dwarf2out_finish): Don't call dwarf2out_frame_finish.
+ * rs6000/rs6000.md (absdi2 define_split): Swap operands of MINUS.
+ * rs6000/rs6000.c (mask64_operand): Use HOST_BITS_PER_WIDE_INT.
+ (print_operand, case 'B'): Don't fall through.
+ (print_operand, case 'S'): Correct mask begin/end computation.
+ Use HOST_BITS_PER_WIDE_INT.
+ * rs6000/rs6000.h (CPP_PREDEFINES): Define _LONG_LONG.
+ (CONDITIONAL_REGISTER_USAGE): GPR13 fixed if TARGET_64BIT.
+ * rs6000/aix41.h (CPP_PREDEFINES): Same.
+ * rs6000/aix43.h (CPP_PREDEFINES): Same.
- * libgcc2.c (L_eh): Reorganize, moving code shared by different
- EH implementations to the top.
- (find_exception_handler): Split out. Start from 0. Compare against
- end with >=.
- (__find_first_exception_table_match): Use it.
- * except.c (output_exception_table): Don't do anything if there's
- no table. Don't output a first entry of zeroes.
- (eh_outer_context): Adjust properly.
- (add_eh_table_entry): Use xrealloc.
- * toplev.c (compile_file): Just call output_exception_table.
+Wed Jul 29 11:47:10 1998 Nick Clifton <nickc@cygnus.com>
-Wed Sep 10 11:30:36 1997 Jason Merrill <jason@cygnus.com>
+ * config/arm/thumb.md (extendqisi2_insn): Remove earlyclobber
+ constraint from second alternative.
- * i386.c (ix86_prologue): Add dwarf2 support for !do_rtl case.
+Tue Jul 28 23:29:04 1998 Jason Merrill <jason@yorick.cygnus.com>
-Wed Sep 10 08:17:10 1997 Torbjorn Granlund <tege@pdc.kth..se>
+ * configure.in: Fix --without/--disable cases for local-prefix,
+ gxx-include-dir and checking.
- * except.c (eh_outer_context): Do masking using expand_and.
+Tue Jul 28 22:01:23 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Wed Sep 10 01:38:30 1997 Doug Evans <dje@cygnus.com>
+ * configure.in (enable_haifa): Set by default for sparc64 too.
+ configure: Rebuilt.
- Add port done awhile ago for the ARC cpu.
- * arc/arc.h: New file.
- * arc/arc.c: New file.
- * arc/arc.md: New file.
- * arc/initfini.c: New file.
- * arc/lib1funcs.asm: New file.
- * arc/t-arc: New file.
- * arc/xm-arc.h: New file.
- * ginclude/va-arc.h: New file.
- * ginclude/stdarg.h: Include va-arc.h ifdef __arc__.
- * ginclude/varargs.h: Likewise.
- * Makefile.in (USER_H): Add va-arc.h.
- * configure.in (arc-*-elf*): Recognize.
- * longlong.h: Add ARC support.
+Tue Jul 28 23:29:04 1998 Jason Merrill <jason@yorick.cygnus.com>
-Wed Sep 10 01:32:54 1997 Jeffrey A Law (law@cygnus.com)
+ * i386/cygwin32.h (VALID_MACHINE_TYPE_ATTRIBUTE): New macro.
+ * i386/winnt.c (associated_type): New fn.
+ (i386_pe_valid_type_attribute_p): New fn.
+ (i386_pe_check_vtable_importexport): Remove.
+ (i386_pe_dllexport_p): Use associated_type.
+ (i386_pe_dllimport_p): Likewise.
- * expr.c (clear_storage): Use CONST0_RTX instead of const0_rtx.
- when clearing non-BLKmode data.
+ From Antonio M. O. Neto <anmendes@cruzeironet.com.br>:
+ * i386.c (i386_valid_type_attribute_p): Also accept
+ attributes for METHOD_TYPEs.
-Wed Sep 10 00:29:29 1997 Manfred Hollstein <manfred@s-direktnet.de>
+Tue Jul 28 23:17:39 1998 Peter Gerwinski <peter@gerwinski.de>
- * m88k/sysv3.h (INITIALIZE_TRAMPOLINE) Define.
- * libgcc2.c (__enable_execute_stack): Provide for sysV88 too.
+ * tree.c (build_range_type): Copy TYPE_SIZE_UNIT.
- * xm-m88k.h (USG): Only define if it hasn't already been defined.
+Tue Jul 28 22:31:12 1998 Craig Burley <burley@gnu.org>
- * Makefile.in (risky-stage1): Delete gratutious whitespace.
+ * gcc.c: Fix commentary describing %g, %u, %U, and %O.
- * Makefile.in (clean): Delete libgcc1-test.
+ * gcc.c (do_spec_1): Fix handling of %g%O and %U%O to prevent
+ them from generating a new base name for each occurence of
+ a specific suffix.
- * Makefile.in (INSTALL): cd to $(srcdir) before running texinfo.
+1998-07-28 Vladimir N. Makarov <vmakarov@cygnus.com>
-Tue Sep 9 17:07:36 1997 Stan Cox <coxs@dg-rtp.dg.com>
+ * cse.c (cse_insn): Enable subsitution inside libcall only for REG,
+ SUBREG, MEM.
+ * rtlanal.c (replace_rtx): Prohibit replaces in CONST_DOUBLE.
- * m88k.c (m88k_expand_prologue): Set MEM_IN_STRUCT_P of va_list
- template.
-Tue Sep 9 09:50:02 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
- * dwarf2out.c (output_call_frame_info): Call named_section.
-
-Tue Sep 9 09:12:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * haifa-sched.c (print_value): Fix last change.
-
-Tue Sep 9 01:30:37 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips.h (DWARF_FRAME_REGNUM): Use the same numbering regardless of
- write_symbols.
-
-Mon Sep 8 16:32:43 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * cplus-dem.c (type_kind_t): New type.
+ (demangle_template_value_parm): Add type_kind_t parameter. Rely
+ on this paramter, rather than demangling the type again.
+ (demangle_integral_value): Pass tk_integral.
+ (demangle_template_: Pass the value returned from do_type.
+ (do_type): Return a type_kind_t. Pass tk_integral to
+ demangle_template_value_parm for array bounds.
+ (demangle_fund_type): Likewise.
+
+Mon Jul 27 00:54:41 1998 Jason Merrill <jason@yorick.cygnus.com>
- * mips.c (function_prologue): Set up the CFA when ABI_32.
+ * tree.c (simple_cst_equal, case CONSTRUCTOR): OK if the elts are
+ identical.
- * sparc.c (save_regs): Check dwarf2out_do_frame instead of DWARF2_DEBUG
- for dwarf2 unwind info.
- (output_function_prologue, sparc_flat_output_function_prologue): Same.
+Mon Jul 27 22:18:36 1998 Jeffrey A Law (law@cygnus.com)
- * final.c (final_end_function): Check dwarf2out_do_frame instead
- of DWARF2_DEBUG for dwarf2 unwind info.
- (final_scan_insn): Likewise.
- (final_start_function): Likewise. Initialize dwarf2 frame debug here.
- (final): Not here.
+ * pa.c (move_operand): Accept CONSTANT_P_RTX.
- * expr.c (expand_builtin_return_addr): Only SETUP_FRAME_ADDRESSES if
- count > 0.
+Mon Jul 27 17:18:52 1998 Dave Brolley <brolley@cygnus.com>
- * varasm.c (exception_section): Check EXCEPTION_SECTION first.
+ * stor-layout.c (layout_type): Handle arrays of bits, for Chill.
-Mon Sep 8 15:15:11 1997 Nick Clifton <nickc@cygnus.com>
+ * expr.c (get_inner_reference): Handle zero-based, unsigned, array
+ index conversion.
- * v850.h (ASM_SPEC): Pass on target processor.
- (CPP_PREDEFINES): Only define if not already specified.
- (TARGET_VERSION): Only define if not already specified.
- (MASK_CPU, MASK_V850, MASK_DEFAULT): Bits to specify target
- processor.
- (EXTRA_SWITCHES): Extra entries in the switches array.
- (TARGET_DEFAULT): Set default target processor.
+Mon Jul 27 14:51:33 1998 Jeffrey A Law (law@cygnus.com)
-Mon Sep 8 18:26:35 1997 Jim Wilson <wilson@cygnus.com>
+ * mn10300.h (DEBUGGER_AUTO_OFFSET): Define.
+ (DEBUGGER_ARG_OFFSET): Likewise.
- * m68k.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): In MOTOROLA
- cases, add %# and %/, and add : to make them into extended asms.
+ * mn10300.md (movsf): Remove last change. Not needed.
-Sun Sep 7 23:57:50 1997 Weiwen Liu <liu@hepunix.physics.yale.edu>
+Mon Jul 27 14:22:36 1998 Dave Brolley <brolley@cygnus.com>
- * alias.c (init_alias_analysis): Clean up incompatible pointer
- type warning in bzero.
- * regmove.c (regmove_optimize): Ditto.
- * haifa-sched.c (find_rgns): Ditto.
+ * c-lex.c (yylex): Fix boundary conditions in character literal and
+ string literal loops.
- * haifa-sched.c (print_value): Clean up ptr->int cast
- warnings.
+Mon Jul 27 11:43:54 1998 Stan Cox <scox@cygnus.com>
-Sun Sep 7 23:18:32 1997 Fred Fish <fnf@ninemoons.com>
+ * longlong.h (count_leading_zeros): Sparclite scan instruction was
+ being invoked incorrectly.
- * INSTALL: Change 'amigados' to 'amigaos' to match current usage.
- * install.texi (Configurations): Ditto.
+ * i386.c (ix86_prologue): Added SUBTARGET_PROLOGUE invocation.
+ * i386/cygwin32.h (STARTFILE_SPEC, LIB_SPEC, SUBTARGET_PROLOGUE):
+ Add -pg support.
+ * i386/win32.h: New file. Hybrid mingw32.h/cygwin32.h configuration.
+ * configure.in: Added i[34567]86-*-win32
* config.sub: Ditto.
-
-Sun Sep 7 22:56:56 1997 Weiwen Liu (liu@hepvms.physics.yale.edu)
-
- * Makefile.in (sdbout.o): Depend on insn-config.h.
-
-Sun Sep 7 18:44:50 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k/m68k.h (TARGET_SWITCHES): For 68000, 68302, subtract MASK_68881.
- For 68303, 68332, cpu32, subtract MASK_68040_ONLY.
-
-Sun Sep 7 18:30:46 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (dwarf2out_frame_debug): Assume that in a PARALLEL
- prologue insn, only the first elt is significant.
- (output_call_frame_info): For exception handling, always use 4-byte
- fields as specified by the dwarf2 spec.
- Don't skip trivial FDEs.
-
-Sun Sep 7 14:19:39 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Sun Sep 7 14:17:36 1997 Torbjorn Granlund (tege@pdc.kth.se)
-
- * expmed.c (expand_divmod): Make op1_is_pow2 depend on unsignedp
- for negative constants. Promote EXACT_DIV_EXPR to TRUNC_DIV_EXPR
- when op1_is_pow2.
-
-Sun Sep 7 13:46:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * final.c (shorten_branches): During first pass, assume worst
- possible alignment for ADDR_VEC and ADDR_VEC_DIFF insns.
-
- * Makefile.in (distclean): Remove various things left around
- by running the testsuite.
-
-Sun Sep 7 13:16:06 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (out_file): Emit definition to config.status in order
- to have a defined value for configure.lang.
- * configure: Re-built.
-
-Sun Sep 7 09:59:08 1997 Jan-Jaap van der Heijden (J.J.vanderHeijden@student.utwente.nl)
-
- * configure.in: Make symlink to as-new rather than as.new. Similarly
- for ld-new.
- * configure: Rebuilt.
-
-Fri Sep 5 16:54:55 1997 Jim Wilson <wilson@cygnus.com>
-
- * profile.c (output_func_start_profiler): Set DECL_EXTERNAL to zero.
-
-Fri Sep 5 16:16:44 1997 Christian Kuehnke <Christian.Kuehnke@arbi.Informatik.Uni-Oldenburg.DE>
-
- * sparc/sparc.md: Add ultrasparc scheduling support.
- * sparc/sparc.h (RTX_COSTS): For MULT give v9 a cost of 25 insns.
-
-Fri Sep 5 14:04:59 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * integrate.c (save_for_inline_copying): Use 0, not NULL_PTR,
- as initial value for real_label_map.
- (copy_for_inline): Likewise.
-
-Fri Sep 5 13:36:44 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sched.c (update_flow_info) When looking if to set found_split_dest
- or found_orig_dest, look at all parts of a PARALLEL.
- * haifa-sched.c (update_flow_info): Likewise.
-
-Fri Sep 5 10:08:44 1997 Jeffrey A Law (law@cygnus.com)
-
- * v850: New directory for v850 port.
- * v850/lib1funcs.asm: New file.
- * t-v850, v850.c, v850.h, v850.md, xm-v850.h: New files.
- * ginclude/va-v850.h: New file.
- * ginclude/varargs.h, ginclude/stdarg.h: Include va-mn10200.h.
- * configure.in (mn10200-*-*): New target.
* configure: Rebuilt.
- * config.sub: Handle v850-elf.
- * Makefile.in (USER_H): Add va-mn10200.h.
- * invoke.texi: Document v850 stuff.
-
-Fri Sep 5 09:37:50 1997 Jim Wilson (wilson@cygnus.com)
-
- * sdbout.c (plain_type_1, case ARRAY_TYPE): Verify that TYPE_DOMAIN
- has integer TYPE_{MAX,MIN}_VALUE before using them.
-
- * m68k/m68k.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Add
- __HPUX_ASM__ versions.
-
-Fri Sep 5 09:08:44 1997 Jeffrey A Law (law@cygnus.com)
-
- * install.sh: Delete duplicate install script.
-
-Thu Sep 4 23:14:27 1997 Stan Cox (coxs@dg-rtp.dg.com)
-
- * reg-stack.c (subst_stack_regs): Pop the stack register for a
- computed goto which sets the same stack register.
-
- * reg-stack.c (compare_for_stack_reg): Swap only if the source and
- destination are both on the regstack.
- (subst_stack_regs_pat): Put the destination at the top of the regstack.
-
-Thu Sep 4 15:02:27 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (nonlocal_goto_receiver): Define.
-
- * profile.c (output_arc_profiler): Check next_insert_after for non
- NULL before deferencing it.
-
- * i386/t-sol2 (TARGET_LIBGCC2_CFLAGS): Define to -fPIC.
-
-Thu Sep 4 14:51:57 1997 Jeffrey A Law (law@cygnus.com)
-
- * i386.h (CPP_CPU_DEFAULT): Avoid using #elif.
-
-Thu Sep 4 15:01:49 1997 Michael Meissner <meissner@cygnus.com>
-
- * toplev.c (rest_of_compilation): For passes starting with
- flow_analysis, use print_rtl_with_bb instead of print_rtl.
-
- * print-rtl.c (print_rtl_single): Print a single rtl value to a
- file.
-
- * flow.c (print_rtl_with_bb): Print which insns start and end
- basic blocks. For the start of a basic block, also print the live
- information.
-
-Thu Sep 4 11:51:43 1997 Jim Wilson <wilson@cygnus.com>
-
- * toplev.c (main): Change #elif to #else/#ifdef
-
- * tlink.c: Include ctype.h.
- * ginclude/va-mips.h: Add _VA_MIPS_H_ENUM ifdef/define/endif.
-
-Thu Sep 4 11:17:16 1997 Mikeael Meissner (meissner@cygnus.com)
-
- * bitmap.c: Conditionally include stdlib.h.
- (free): Provide a declaration if NEED_DECLARATION_FREE.
-
-Thu Sep 4 09:58:53 1997 Joel Sherrill (joel@OARcorp.com)
-
- * i960/i960.h: Added default for SUBTARGET_SWITCHES macro.
-
-Thu Sep 4 09:53:20 1997 Jim Wilson (wilson@cygnus.com)
-
- * profile.c (output_arc_profiler): Verify next_insert_after is an
- INSN before and after skipping a stack pop.
-
-Thu Sep 4 07:39:19 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * final.c (shorten_branches): Don't count the lengths of deleted
- instructions.
-
-Thu Sep 4 09:43:01 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump for snapshot.
-
-Thu Sep 4 11:04:21 1997 Michael Meissner <meissner@cygnus.com>
-
- * bitmap.h (EXECUTE_IF_AND_IN_BITMAP): New macro, to iterate over
- two bitmaps ANDed together.
- (bitmap_print): Declare.
-
- * bitmap.c (function_obstack): Don't declare any more.
- (bitmap_obstack): Obstack for allocating links from.
- (bitmap_obstack_init): New static to say whether to initialize
- bitmap_obstack.
- (bitmap_element_allocate): Use bitmap_obstack to allocate from.
- (bitmap_release_memory): Free all memory allocated from
- bitmap_obstack.
-
- * basic-block.h (EXECUTE_IF_AND_IN_REG_SET): New macro, invoke
- EXECUTE_IF_AND_IN_BITMAP.
-
-Wed Sep 3 10:39:42 1997 Jim Wilson <wilson@cygnus.com>
-
- * alias.c (true_dependence): Address with AND can alias scalars.
- (anti_dependence, output_dependence): Likewise.
-
- * alias.c (true_dependence): Test x for BLKmode, in addition to mem.
-
-Wed Sep 3 09:28:50 CDT 1997 Joel Sherrill (joel@OARcorp.com)
-
- * i386/go32-rtems.h, i386/rtems.h, i960/rtems.h, m68k/rtems.h,
- mips/rtems64.h, pa/rtems.h, rs6000/rtems.h, sh/rtems.h,
- sparc/rtems.h (subtarget_switches): Removed SUBTARGET_SWITCHES
- definitions. Use -qrtems instead of -mrtems.
-
-Wed Sep 3 09:05:41 1997 Robert Lipe (robert@dgii.com)
-
- * xm-sco5.h (sys_siglist): Define.
- (SYS_SIGLIST_DECLARED): Likewise.
-
-Tue Sep 2 23:33:33 1997 Jeffrey A Law (law@cygnus.com)
-
- * expr.c (convert_move): Handle truncation from TQFmode to QFmode.
-
-Wed Sep 3 02:09:30 1997 Torbjorn Granlund <tege@pdc.kth..se>
-
- * except.c (eh_outer_context): Expand masking operation using
- expand_binop.
-
-Tue Sep 2 18:09:39 1997 Jim Wilson <wilson@cygnus.com>
-
- * alpha.md (floatdisf2-1): New pattern.
-
-Tue Sep 2 18:41:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * xm-svr4.h (SYS_SIGLIST_DECLARED): Define.
- * xm-news.h (SYS_SIGLIST_DECLARED): Likewise.
- * xm-sysv4.h (SYS_SIGLIST_DECLARED): Likewise.
- * gcc.texi: Note that if you define sys_siglist that you should
- also define SYS_SIGLIST_DECLARED.
-
- * mn10200.h (INITIALIZE_TRAMPOLINE): PC relative instructions
- are relative to the next instruction, not the current instruction.
-
-Tue Sep 2 14:22:43 1997 Jim Wilson <wilson@cygnus.com>
-
- * local-alloc.c (contains_replace_regs): New function.
- (update_equiv_regs): When adding a REG_EQUIV note for a set of a MEM,
- verify that there is no existing REG_EQUIV note, and add a call to
- contains_place_regs.
-
-Tue Sep 2 12:48:11 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+Sun Jul 26 01:11:12 1998 H.J. Lu (hjl@gnu.org)
- * config/alpha/elf.h (CPP_PREDEFINES): Add -D__PIC__ -D__pic__.
- (STARTFILE_SPEC): Always use crtbegin.o%s
- (ENDFILE_SPEC): Always use crtend.o%s.
+ * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating
+ the frame pointer and compiling PIC code and reload has not completed.
-Tue Sep 2 12:00:36 1997 Jim Wilson <wilson@cygnus.com>
+ * i386.c (output_to_reg): Add code to emulate non-popping DImode
+ case.
- * alpha/alpha.h (PREFERRED_RELOAD_CLASS): Return NO_REGS if NO_REGS
- is passed in.
- * emit-rtl.c (gen_lowpart_common): Add code to convert CONST_INT to
- SFmode for 64 bit hosts.
+Sun Jul 26 01:01:32 1998 Jeffrey A Law (law@cygnus.com)
-Tue Sep 2 13:42:38 1997 Paul N. Hilfinger <hilfingr@CS.Berkeley.EDU>
+ * regmove.c (regmove_optimize): Fix typo initializing regmove_bb_head.
- * fixincludes: Permits spaces between # and define. Discard C++
- comments in sys/pci.h on HP/UX 10.20.
+Sat Jul 25 23:29:23 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-Mon Sep 1 22:13:18 1997 Jeffrey A Law (law@cygnus.com)
+ * Makefile.in (install-info): Only try to update the info
+ directory file if it exists in the first place.
- * version.c: Bump for snapshot.
+Fri Jul 24 18:58:37 1998 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
- * pa.c (restore_unscaled_index_insn_codes): New function.
- (record_unscaled_index_insn_codes): Likewise.
- (output_function_prologue): Call restore_unscaled_index_insn_codes.
- (output_function_epilogue): Free memory for unscaled_index_insn_codes.
- (pa_reorg): Call record_unscaled_index_insn_codes.
+ * rs6000.h (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Delete.
- * haifa-sched.c (move_insn): Handle notes correctly for insns
- with SCHED_GROUP_P set.
+Fri Jul 24 14:20:26 1998 Jeffrey A Law (law@cygnus.com)
-Mon Sep 1 16:58:57 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+ * mn10300.md (movqi, movhi, movsi, movsf): Correctly handle
+ CONST_DOUBLE source.
- * alpha/xm-linux.h (USE_BFD): Undef before define.
+Fri Jul 24 11:17:04 1998 Nick Clifton <nickc@cygnus.com>
-Mon Sep 1 16:25:34 1997 Jim Wilson <wilson@cygnus.com>
+ * config/arm/thumb.c (thumb_print_operand): Decode %_ in asm
+ strings as the insertion of USER_LABEL_PREFIX.
+ * config/arm/thumb.h (PRINT_OPERAND_PUNCT_VALID_P): Accept _ as a
+ valid code.
+ * config/arm/thumb.md: Use %_ as a prefix to gcc library function
+ calls.
- * cse.c (cse_insn): Don't record BLKmode values.
+Thu Jul 23 18:53:20 1998 Jim Wilson <wilson@cygnus.com>
-Mon Sep 1 11:25:47 1997 Stephen Williams (steve@icarus.icarus.com)
+ * dbxout.c (dbxout_range_type): Only call dbxout_type_index for
+ already defined type.
- * i960.h (LINK_SPEC): Handle "-mjX" and "-mrp" switches.
+Thu Jul 23 13:49:41 1998 Jeffrey A Law (law@cygnus.com)
-Mon Sep 1 08:29:46 1997 Jeffrey A Law (law@cygnus.com)
+ * expr.c (check_max_integer_computation_mode): Allow conversions
+ of constant integers to MAX_INTEGER_COMPUTATION_MODE.
+ (expand_expr): Likewise.
- * cccp.c (sys_errlist): Remove special 4.4bsd declaration.
- * collect2.c (sys_errlist): Likewise.
- * cpplib.c (sys_errlist): Likewise.
- * gcc.c (sys_errlist): Likewise.
- * protoize (sys_errlist): Likewise.
- * configure.in: Check for strerror.
- * xm-freebsd.h (HAVE_STRERROR): Remove definition.
- * xm-gnu.h (HAVE_STRERROR): Likewise.
- * xm-linux.h (HAVE_STRERROR): Likewise.
- * xm-netbsd.h (HAVE_STRERROR): Likewise.
- * xm-bsd386.h (HAVE_STRERROR): Likewise.
- * xm-cygwin32.h (HAVE_STRERROR): Likewise.
- * xm-dos.h (HAVE_STRERROR): Likewise.
- * xm-mingw32.h (HAVE_STRERROR): Likewise.
- * xm-pa.h (HAVE_STRERROR): Likewise.
- * xm-papro.h (HAVE_STRERROR): Likewise.
- * xm-sysv4.h (HAVE_STRERROR): Likewise.
- * configure, config.in: Rebuilt.
+Thu Jul 23 11:12:06 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
- * Makefile.in: Add several missing "else true" clauses.
+ * expr.c (expand_expr): Expand RETURN_EXPR.
- * collect2.c: Change DONT_DECLARE_SYS_SIGLIST to SYS_SIGLIST_DECLARED.
- * mips-tfile.c: Likewise.
- * gcc.texi: DONT_DECLARE_SYS_SIGLIST: Remove docs.
- * xm-linux.h (DONT_DECLARE_SYS_SIGLIST): Delete definition.
- * xm-freebsd.h, xm-bsd386.h, xm-sysv4.h, xm-sol2.h: Likewise.
- * configure.in: Check for sys_siglist declaration.
- * configure, config.in: Rebuilt.
-
-Mon Sep 1 08:04:07 1997 Joel Sherrill (joel@OARcorp.com)
-
- * i386/go32-rtems.h, i386/rtems.h, i960/rtems.h,
- m68k/rtems.h, mips/rtems64.h, pa/rtems.h, rs6000/rtems.h,
- sparc/rtems.h (subtarget_switches): Added -mrtems as a switch.
- * i960/i960.h: Added SUBTARGET_SWITCHES macro.
- * rs6000/sysv4.h (extra_subtarget_switches): Added new
- macro EXTRA_SUBTARGET_SWITCHES.
- * configure.in (sh*-*-rtems*): New target.
- * sh/rtems.h: New file.
- * sh/sh.h: Added SUBTARGET_SWITCHES macro.
- * configure: Rebuilt.
+Thu Jul 23 11:00:29 1998 Jim Wilson <wilson@cygnus.com>
-Sat Aug 30 22:54:26 1997 Jim Wilson <wilson@cygnus.com>
+ * dwarf2out.c (dwarf2out_finish): Call stripattributes on TEXT_SECTION.
- * unroll.c (calculate_giv_inc): Handle increment with code PLUS.
+Wed Jul 22 19:10:00 1998 Catherine Moore <clm@cygnus.com>
-Sat Aug 30 10:49:46 1997 David Edelsohn <edelsohn@mhpcc.edu>
+ * dwarf2out.c (output_aranges): Call stripattributes
+ for TEXT_SECTION references.
+ (output_line_info): Likewise.
- * rs6000.md: Make DF fused-add operations pay attention to
- -mno-fused-add.
+Wed Jul 22 14:08:54 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
-Fri Aug 29 19:19:54 1997 Jim Wilson <wilson@cygnus.com>
+ * profile.c (branch_prob): Call allocate_reg_info after outputting
+ profile rtl in instrument_arcs.
- * i386/xm-sysv4.h (DONT_DECLARE_SYS_SIGLIST): Define.
+Wed Jul 22 12:47:49 1998 Jim Wilson <wilson@cygnus.com>
-Fri Aug 29 16:13:51 1997 Jeffrey A Law (law@cygnus.com)
+ * fixinc.irix (math.h): Install wrapper instead of copying.
- * pa.md (reload_peepholes): Make sure operand is a REG before
- examining REGNO. Allow general registers too.
+Wed Jul 22 12:37:14 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
-Fri Aug 29 11:42:04 1997 Jim Wilson <wilson@cygnus.com>
+ * tree.def (EXPR_WITH_FILE_LOCATION): Defined as an 'e' expression
+ so WFL are expanded correctly when contained in a COMPOUND_EXPR.
+ * tree.h (EXPR_WFL_EMIT_LINE_NOTE): Change macro not to use
+ lang_flag_0. Added documentation in the flag table.
- * varasm.c (mark_constants): Don't look inside CONST_DOUBLEs.
+Tue Jul 21 23:28:35 1998 Klaus Kaempf <kkaempf@rmi.de>
-Fri Aug 29 09:33:20 1997 Philipp Thomas (kthomas@lxi165.gwdg.de)
+ * cccp.c (do_include): Fix vax c style include handling.
- * dwarf2out.c (build_abbrev_table): Use xrealloc, not xmalloc
- to reallocate abbrev_die_table.
+Tue Jul 21 13:28:19 1998 Jason Merrill <jason@yorick.cygnus.com>
-Thu Aug 28 15:14:46 1997 Jim Wilson <wilson@cygnus.com>
+ * cplus-dem.c (do_type): Use demangle_template_value_parm for arrays.
- * m68k/m68k.md (iorsi_zexthi_ashl16): Disable.
+Sun Jul 12 01:27:05 1998 Jason Merrill <jason@yorick.cygnus.com>
-1997-08-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * fold-const.c (non_lvalue): Don't deal with null pointer
+ constants here.
+ (fold, case COMPOUND_EXPR): Wrap a constant 0 in a NOP_EXPR.
- * Makefile.in (config.status): Depend on version.c
+Tue Jul 21 15:49:31 1998 David Edelsohn <edelsohn@mhpcc.edu>
- * expr.h (insn_gen_function): Reenable prototype.
+ * rs6000.h (PREDICATE_CODES): Add CONSTANT_P_RTX.
+ * rs6000.md (movsi, movdi): Add CONSTANT_P_RTX.
+ * rs6000.c (short_cint_operand): Add CONSTANT_P_RTX.
+ (u_short_cint_operand): Same.
+ (reg_or_cint_operand): Same.
+ (logical_operand): Same.
+ (input_operand): Same.
+ (reg_or_short_operand): Use u_short_cint_operand.
- * expr.c (move_by_pieces_1, clear_by_pieces_1): Fix prototype of
- first parameter.
+Tue Jul 21 08:56:42 1998 Richard Henderson <rth@cygnus.com>
-Thu Aug 28 13:01:43 1997 Jim Wilson <wilson@cygnus.com>
+ * alpha.md (fix_truncdfsi2, fix_truncsfsi2): Remove the define_expands,
+ but keep the insns and splits. Adjust so when the ultimate destination
+ is memory, use cvtql.
- * i386.c (ix86_expand_epilogue): Emit blockage instruction when pic.
+Tue Jul 21 08:55:09 1998 Richard Henderson <rth@cygnus.com>
-Thu Aug 28 07:03:15 1997 Jeffrey A Law (law@cygnus.com)
+ * flow.c (regno_uninitialized): Fixed regs are never uninitialized.
- * version.c: Bump for latest snapshot.
+Tue Jul 21 00:31:01 1998 Jeffrey A Law (law@cygnus.com)
- * bc-optab.c: Conditionally include stdlib.h.
- (free): Provide a declaration if NEED_DECLARATION_FREE.
- * tree.c (free): Provide a declaration if NEED_DECLARATION_FREE.
- * rtl.h (free): Remove declaration.
- * tree.h (free): Remvoe declaration.
+ * gcc.c (do_spec): Call "error" not "warning".
+ * configure.in: Fix minor problems with gas feature detection code.
* configure: Rebuilt.
-Wed Aug 27 21:32:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * flags.h (flag_move_all_movables): Declare.
- (flag_reduce_all_givs): Likewise.
- * loop.c (move_movables): Handle flag_move_all_movables.
- (strength_reduce): Handle flag_reduce_all_givs.
- * toplev.c (flag_move_all_movables): Define.
- (flag_reduce_all_givs): Likewise.
- (f_options): Add -fmove-all-movables and -freduce-all-givs.
- * invoke.texi: Document new options, including alias stuff that
- wasn't included last time.
-
-Wed Aug 27 18:08:51 1997 Bob Manson (manson@cygnus.com)
-
- * t-h8300: Use TARGET_LIBGCC2_CFLAGS instead of LIBGCC2_CFLAGS.
- * t-mn10200: Ditto.
- * t-vxsparc: Ditto.
- * t-vxworks68: Ditto.
- * t-vxworks960: Ditto.
- * t-vx29k: Ditto.
-
-Wed Aug 27 16:35:29 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha/xm-alpha.h (alloca): Define alloca to builtin_alloca for GNUC
- if not already defined, and USE_C_ALLOCA not defined.
-
-Wed Aug 27 16:08:43 1997 Jim Wilson <wilson@cygnus.com>
-
- * config.guess: Replace with script that uses ../config.guess.
-
- * config/alpha/elf.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1
- if USE_GNULIBC_1 is not defined.
-
-Wed Aug 27 15:49:12 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha/elf.h (LINK_SPEC): Conditionalize on USE_GNULIBC_1.
- * config.guess: Recognize alpha-linux-gnulibc1.
- * configure.in (alpha-*-linux-gnulibc1): New target.
- (alpha-*-linux-gnu*): Don't build crtbegin/end.
-
-Wed Aug 27 11:52:58 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.md (iorsi3_internal): Readd ! TARGET_5200 check lost in
- last change.
-
-Wed Aug 27 01:56:18 1997 Doug Evans <dje@seba.cygnus.com>
-
- * loop.c (combine_movables): Earlier insns don't match later ones.
-
-Wed Aug 27 01:24:25 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * config/linux.h (CC1_SPEC): Define it only if not defined.
-
- * config/m68k/linux.h (CC1_SPEC): Undefine it before include
- <linux.h>
-
- * config/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1 if
- USE_GNULIBC_1 is not defined.
-
- * config/rs6000/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1.
-
- * config/sparc/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined
- as 1 if USE_GNULIBC_1 is not defined.
-
-Wed Aug 27 00:49:14 1997 Jeffrey A Law (law@cygnus.com)
-
- * reorg.c (dbr_schedule): Allow current_function_return_rtx
- to be something other than a REG.
- * function.c (expand_function_end): Fix current_function_return_rtx
- if it was a pseudo.
-
- * t-freebsd (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS.
- * x-netbsd: Likewise
- * x-dgux (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS
- (INSTALL_HEADERS): Delete.
- * x-dguxbcs: Likewise.
- * x-hp3bsd44: Likewise
- * x-pa: Likewise.
-
-Wed Aug 27 00:30:00 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-
- * i386.md (pop): pop increments the stack pointer.
- (prologue_set_stack_ptr): New pattern.
- * i386.c (ix86_expand_prologue): Use prologue_set_stack_ptr
- instead of subsi3.
-
-Tue Aug 26 18:50:32 1997 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (find_reloads, case '0'): Reject matching a non-offsettable
- address where an offsettable address is required.
-
-Tue Aug 26 17:54:56 1997 Michael P. Hayes (michaelh@ongaonga.chch.cri.nz>
+ * gcc.c (do_spec): Issue a warning for '%[]' usage.
+
+ * Undo this change.
+ * gcc.c: Delete %[spec] support.
+ (do_spec_1, case '('): Likewise.
+ (do_spec_1, case '['): Call error.
+
+Mon Jul 20 22:34:17 1998 Richard Henderson <rth@cygnus.com>
+
+ * alpha.h (CPP_SPEC): Tidy. Hook to cpp_cpu and cpp_subtarget.
+ (CPP_SUBTARGET_SPEC): Default to empty string.
+ (CPP_AM_*, CPP_IM_*, CPP_CPU_*, CPP_CPU_SPEC): New.
+ (EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): New.
+ * alpha/elf.h (LD_SPEC): Use %(elf_dynamic_linker).
+ * alpha/linux-elf.h (SUBTARGET_EXTRA_SPECS): New.
+ (LIB_SPEC): Tidy.
+ * alpha/linux.h (CPP_PREDEFINES): Tidy.
+ * alpha/netbsd-elf.h (SUBTARGET_EXTRA_SPECS): New.
+ * alpha/netbsd.h (CPP_PREDEFINES): Tidy.
+ * alpha/osf.h (CPP_PREDEFINES): Remove bits subsumed by CPP_CPU_SPEC.
+ * alpha/win-nt.h (CPP_PREDEFINES): Likewise.
+ * alpha/vsf.h (CPP_PREDEFINES): Likewise.
+ (CPP_SUBTARGET_SPEC): New. Do this instead of overriding CPP_SPEC.
+ * alpha/vxworks.h: Likewise.
+
+Mon Jul 20 22:51:57 1998 Ken Raeburn <raeburn@cygnus.com>
+
+ * mips.md (reload_outsi): Added missing REGNO call.
+ (smulsi3_highpart, umulsi3_highpart): Provide prototype for
+ function pointer.
+ (mul_acc_di, mul_acc_64bit_di): Don't use match_op_dup, use
+ another match_operator and compare the codes.
+
+ * mips.h (MASK_DEBUG_E, MASK_DEBUG_I): Set to zero.
+
+ * MIPS multiply pattern fixes:
+ * mips.h (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS):
+ Add union classes for HI, LO, or HILO plus general registers.
+ (GENERATE_MADD): Deleted.
+ * mips.md (mulsi3_mult3): Don't disparage output-LO alternative.
+ Add TARGET_MAD to condition.
+ (mulsi3): Test HAVE_mulsi3_mult3, not specific flags.
+ (mul_acc_si): Expand GENERATE_MADD here; it's the only use. Use
+ "*d" for accumulator, to give preference to LO initially but not
+ during reload.
+
+Mon Jul 20 16:16:38 1998 Dave Brolley <brolley@cygnus.com>
+
+ * configure.in (enable_c_mbchar): New configure option.
+ (extra_cpp_objs): Always available now.
+
+ * cexp.y (mbchar.h): #include it.
+ (yylex): Handle Multibyte characters in character literals.
+
+ * cccp.c (mbchar.h): #include it.
+ (main): Set character set based on LANG environment variable.
+ (rescan): Handle multibyte characters in comments.
+ (skip_if_group): See above.
+ (validate_else): See above.
+ (skip_to_end_of_comment): See above.
+ (macarg1): See above.
+ (discard_comments): See above.
+ (rescan): Handle multibyte characters in string and character literals.
+ (collect_expansion): See above.
+ (skip_quoted_string): See above.
+ (macroexpand): See above.
+ (macarg1): See above.
+ (discard_comments): See above.
+ (change_newlines): See above.
- * loop.c (check_final_value): Don't miss a biv increment in a
- parallel.
+ * c-lex.c (mbchar.h): #include it.
+ (GET_ENVIRONMENT): New macro.
+ (init_lex): Set character set based on LANG environment variable.
+ (yylex): Handle multibyte characters in character literals.
+ (yylex): Handle multibyte characters in string literals.
-Tue Aug 26 12:03:49 1997 Jim Wilson (wilson@cygnus.com)
+ * Makefile.in (mbchar.o): New target.
+ (cccp$(exeext)): @extra_cpp_objs@ is always available.
+ (cppmain$(exeext)): @extra_cpp_objs@ is always available.
- * dwarfout.c (dwarfout_file_scope_decl, case TYPE_DECL): Check
- TYPE_DECL_IS_STUB instead of DECL_NAME.
+ * mbchar.[ch]: New files for multibyte character handling.
-Mon Aug 25 23:27:10 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+Mon Jul 20 01:11:11 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
- * objc/Make-lang.in ($(OBJC_O)): Also depend on cc1obj.
+ * jump.c (jump_optimize): When simplifying noop moves and
+ PUSH_ROUNDING, fix thinko so we use same criterion for identifying
+ the PUSHes to rewrite in second loop as we did in the first.
-Mon Aug 25 23:27:10 1997 Jim Meyering <meyering@eng.ascend.com>
+Sun Jul 19 08:23:53 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * objc/Make-lang.in ($(OBJC_O)): Also depend on $(GCC_PASSES).
+ * cplus-dem.c (demangle_nested_args): Make function definition
+ static to match the prototype.
-Mon Aug 25 13:12:24 1997 Jeffrey A Law (law@cygnus.com)
+Fri Jul 17 14:58:44 1998 Richard Henderson <rth@cygnus.com>
- * haifa-sched.c (find_pre_sched_live): Remove #if 0 code.
- (find_post_sched_live): Likewise.
+ * alloca.c: Respect USE_C_ALLOCA.
+ * gencheck.c (xmalloc): Ignore __GNUC__ for definition.
+ * gengenrtl.c (xmalloc): Likewise.
- * haifa-sched.c (schedule_block): Remove old code to get arguments
- from hard regs into pseudos early.
+Fri Jul 17 14:18:14 1998 Richard Henderson <rth@cygnus.com>
-Mon Aug 25 08:55:00 1997 Jeffrey A Law (law@cygnus.com)
+ * loop.h (struct induction): Add no_const_addval.
+ * loop.c (the_movables, reg_address_cost): New variables.
+ (init_loop): Init reg_address_cost.
+ (loop_optimize): Call end_alias_analysis.
+ (scan_loop): Init the_movables.
+ (record_giv): Init induction->no_const_addval.
+ (basic_induction_var) [PLUS]: Use rtx_equal_p instead of ==.
+ [REG]: Rearrange loop search test to catch more cases.
+ (general_induction_var): Return success not benefit; take an extra
+ argument for that. Change all callers.
+ (simplify_giv_expr) [PLUS]: Always combine invariants. Use sge_plus.
+ [MULT]: Use rtx_equal_p instead of ==. Combine simple invariants.
+ [default]: Search the_movables for additional combinations.
+ (sge_plus_constant, sge_plus): New functions.
+ (express_from_1): New function.
+ (express_from): Always define. Rewrite using express_from_1.
+ (combine_givs_p): Handle more cases. Ignore address cost.
+ (cmp_combine_givs_stats): New function.
+ (combine_givs_used_once, combine_givs_benefit_from): New functions.
+ (combine_givs): Rewrite to do best-fit combination.
- * version.c: Bump for new snapshot.
+ * fold-const.c (operand_equal_p): Handle RTL_EXPR.
+ (fold): Do a complete (A*C)+(B*C) association check.
- * local-alloc.c (update_equiv_regs): All the target to reject
- promotion of some REG_EQUAL to REG_EQUIV notes.
- * pa.h (DONT_RECORD_EQUIVALENCE): Define.
+Fri Jul 17 11:21:55 1998 Jim Wilson <wilson@cygnus.com>
- * pa.c (secondary_reload_class): (mem (mem ... )) does not need
- secondary reloads.
+ * function.c (fixup_var_refs_insns): Handle CLOBBER of a CONCAT.
- * pa.c (hppa_builtin_saveregs): Emit a blockage insn after the
- store of the argument registers.
+Fri Jul 17 11:48:55 1998 Jeffrey A Law (law@cygnus.com)
-Mon Aug 25 08:39:02 1997 Craig Burley (burley@gnu.ai.mit.edu)
+ * mn10300.c (MODES_TIEABLE_P): Fix typo.
- * fold-const.c (multiple_of_p): New function.
- (fold): Turn some cases of *_DIV_EXPR into EXACT_DIV_EXPR.
+Fri Jul 17 03:26:12 1998 Rihcard Earnshaw (rearnsha@arm.com)
-Mon Aug 25 01:47:41 1997 Jeffrey A Law (law@cygnus.com)
+ * tree.c (valid_machine_attribute): Only create a new type variant if
+ there is a decl to use it.
- * expr.h (insn_gen_function): Temporarily remove prototype.
+Thu Jul 16 14:48:04 1998 Nick Clifton <nickc@cygnus.com>
-Sun Aug 24 17:22:21 1997 Jim Wilson <wilson@cygnus.com>
+ * gcc.c (do_spec_1): Cope with %g/%u/%U options which do not have
+ a suffix.
- * Makefile.in (install-info): Don't cd into srcdir. Add srcdir to
- filenames. Use sed to extract base filename for install.
+Fri Jul 17 03:24:40 1998 Hans-Peter Nilsson <hp@axis.se>
-Sat Aug 23 18:19:40 1997 John F. Carr <jfc@mit.edu>
+ * extend.texi (Explicit Reg Vars): Typo: change "may deleted" into "may
+ be deleted"
- * unroll.c (find_splittable_givs): Only share if two givs have the
- same add and multiply values.
+Thu Jul 16 14:48:47 1998 Jeffrey A Law (law@cygnus.com)
-Sat Aug 23 14:36:27 1997 Jim Wilson <wilson@cygnus.com>
+ * mn10300.c (count_tst_insns): New arg oreg_countp. Callers changed.
+ Simplify tests for clearing an address register.
+ (expand_prologue): Corresponding changes.
- * m68k/next.h (GO_IF_INDEXABLE_BASE): Fix typo in undef.
- * m68k/m68kemb.h (LIB_SPEC): Add missing comment end before it.
+ * mn10300.md (movXX patterns): Make sure the destination is an
+ ADDRESS_REG when substituting "zero_areg" for (const_int 0).
+ (logical patterns): Split into expanders + patterns
+ (zero and sign extension patterns): Similarly.
+ (shift patterns): Similarly.
-Sat Aug 23 00:18:22 1997 Jeffrey A Law (law@cygnus.com)
+Thu Jul 16 01:17:44 1998 Richard Henderson <rth@cygnus.com>
- * pa.c (pa_reorg): Always put begin_brtab and end_brtab insns
- around branch tables.
- * pa.md (begin_brtab, end_brtab): Only emit the .begin_brtab
- and .end_brtab directives if TARGET_GAS.
+ * loop.c (emit_iv_add_mult): Scan the entire insn list generated
+ for the sequence, recording base values.
-Fri Aug 22 14:05:55 1997 Jim Wilson <wilson@cygnus.com>
+Wed Jul 15 10:49:55 1998 Richard Henderson <rth@cygnus.com>
- * alias.c (true_dependence): Pass x_addr not x to varies.
+ * i386.h (CPP_CPU_SPEC): Remove -Asystem(unix).
- * acconfig.h (NEED_DECLARATION_CALLOC): Add.
- * configure.in: Add GCC_NEED_DECLARATION call for calloc.
- * rs6000/xm-rs6000.h (malloc, realloc, calloc, free): Delete
- declarations.
- * config.in, configure: Regenerate.
+Tue Jul 14 14:15:30 1998 Nick Clifton <nickc@cygnus.com>
-Thu Aug 21 23:52:16 1997 John F. Carr <jfc@mit.edu>
+ * gcc.c: Remove ANSI-C ism from --help code.
- * alias.c (find_base_value): Improve handling of PLUS, MINUS, and
- LO_SUM.
- (record_set): Handle LO_SUM like PLUS.
- (init_alias_analysis): When following chains of base addresses,
- do not stop on reaching a hard register.
+ * toplev.c: Support --help with USE_CPPLIB.
-Thu Aug 21 20:17:37 1997 Jeffrey A Law (law@cygnus.com)
+Tue Jul 14 14:46:08 1998 Jeffrey A Law (law@cygnus.com)
- * version.c: Bump for new snapshot.
+ * configure.in: Rework gas feature code to work with symlink based
+ source trees.
-Thu Aug 21 17:28:00 1997 Jim Wilson <wilson@cygnus.com>
+ * extend.texi: Clarify some issues related to local variables
+ assigned to explicit registers.
- * alpha.h (ARCH_ASM_FILE_START): Define.
- (ASM_FILE_START): Use ARCH_ASM_FILE_START.
- * osf12.h, osf2or3.h (ARCH_ASM_FILE_START): Redefine to null string.
+ * mn10300.md (mulsi): Turn into expander + pattern.
-Thu Aug 21 10:22:19 1997 Jeffrey A Law (law@cygnus.com)
+ * mn10300.md (movsi, movsf, movdi, movdf): Remove "x" from I -> a
+ alternative.
- * Makefile.in (install-common): Put gcov comment at start of line.
+Tue Jul 14 07:41:59 1998 Richard Earnshaw (rearnsha@arm.com)
-Wed Aug 20 22:47:33 1997 Jeffrey A Law (law@cygnus.com)
+ * arm/tcoff.h (USER_LABEL_PREFIX): Make it empty to match coff.h.
- * alias.c (init_alias_analysis): When simplifying the reg_base_value
- array, simplify entries for hard registers too.
+Tue Jul 14 03:02:44 1998 Jeffrey A Law (law@cygnus.com)
-Wed Aug 20 12:35:47 1997 Dave Love <d.love@dl.ac.uk>
+ * version.c: Bump again to distinguish mainline tree from the
+ egcs-1.1 branch.
- * dwarf2.h (enum dwarf_call_frame_info): Remove trailing comma from
- list.
+See ChangeLog.0 for earlier changes.
-Wed Aug 20 11:58:33 1997 Jim Wilson <wilson@cygnus.com>
-
- * stmt.c (start_cleanup_deferal, end_cleanup_deferal): Test
- block_stack before dereferencing it.
-
-Wed Aug 20 11:57:11 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (ISSUE_RATE): Define instead of MACHINE_issue_rate.
-
-Tue Aug 19 17:10:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c: Add 'extern' to prepends_underscore.
-
-Tue Aug 19 09:34:57 1997 Jeffrey A Law (law@cygnus.com)
-
- * haifa-sched.c (ISSUE_RATE): Renamed from MACHINE_issue_rate.
- (get_issue_rate): Delete.
- * pa.h (ISSUE_RATE): Define.
-
- * configure.in: Turn on haifa by default for the PA.
- * configure: Rebuilt.
- * pa.c (override_options): Accept -mschedule=7200 option.
- (pa_adjust_cost): No longer need to scale costs for newer
- processors.
- * pa.h (enum processor_type): Add PROCESSOR_7200.
- * pa.md: Revamp scheduling parameters to work better with
- haifa. Add scheduling parameters for the 7200.
-
- * haifa-sched.c (move_insn): Reemit notes for SCHED_GROUP_P
- insns too.
- (schedule_block): When adjusting basic_block_{head,end}, account
- for movement of SCHED_GROUP_P insns too.
-
- * haifa-sched.c (debug_dependencies): Fix thinko.
-
- * Makefile.in (EXPECT, RUNTEST, RUNTESTFLAGS): Define.
- (site.exp, check, check-g++, check-gcc): New targets.
-
- * haifa-sched.c: Make lots of variables static.
-
-Tue Aug 19 07:18:34 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * expr.h, real.h: Finish prototyping.
-
-Mon Aug 18 21:49:02 1997 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (find_reloads): Add code to convert RELOAD_FOR_OPADDR_ADDR
- reloads to RELOAD_FOR_OPERAND_ADDRESS reloads.
- * reload1.c: Undo bugfix from Aug 11.
-
-Mon Aug 18 17:39:02 1997 Mike Meissner <meissner@cygnus.com>
-
- * configure.in ({powerpc,rs6000}*-*-*, --with-cpu): Remove single
- quotes around the name.
- * configure: Regenerate.
-
-Mon Aug 18 13:46:47 1997 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (stmp-multilib-sub): Fix typo in last change.
-
-Thu Aug 7 10:33:13 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (sub-makes): Pass the current value of LANGUAGES down
- to sub-makes to avoid building more passes than the user might have
- requested on the command line.
-
-Sun Aug 17 15:42:17 1997 Dave Love (d.love@dl.ac.uk)
-
- * configure.in: Expurgate `broken_install' (install is
- autoconfed).
-
- * configure.lang: Substitute autoconfed ${INSTALL} (not currently
- relevant).
-
-Sat Aug 16 01:08:12 1997 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (is_power_of_2, is_conditional_branch): Delete unused
- functions and declarations.
- (analyze_loop_iterations): Use condjump_p.
- (insert_bct): Likewise. Use exact_log2.
-
-Fri Aug 15 23:48:32 1997 Jeffrey A Law (law@cygnus.com)
-
- * haifa-sched.c (find_post_sched_live): Call FREE_REG_SET as needed.
- (schedule_region): Likewise.
- (schedule_insns): Likewise.
-
- * PROJECTS: Update with Haifa stuff.
-
-Fri Aug 15 12:49:56 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Change the version string to look like:
- egcs-2.90.00 970814 (gcc2-970802 experimental).
-
- * loop.c (is_conditional_branch): Make definition match declaration.
-
- * gcc.c: Take out experimental snapshot warning message.
-
-Fri Aug 15 13:43:39 1997 Michael Meissner <meissner@cygnus.com>
-
- * haifa-sched.c (debug_dependencies): Use GET_NOTE_INSN_NAME to
- print out the names of the notes. Print out the name of the insn
- that is not a note, and not an {,CALL_,JUMP_}INSN.
-
-Wed Aug 13 17:32:38 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (expand_expr, case TARGET_EXPR): Call mark_addressable
- again for the slot after we give it RTL.
-
-Wed Aug 13 01:03:37 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * configure.in (haifa configury): Fix typo.
- * configure: Regenerate.
-
-Tue Aug 12 10:20:36 1997 Jeffrey A Law (law@cygnus.com)
-
- * version.c: Bump version to "gcc-3.0.0 970802 experimental".
-
- * gcc.info*: Rebuilt.
-
- * COPYING.g77, README.g77: New files.
- * real.c (ereal_unto_float, ereal_unto_double): New functions.
- * real.h (ereal_unto_float, ereal_unto_double): Declare them.
- (REAL_VALUE_UNTO_TARGET_DOUBLE, REAL_VALUE_UNTO_TARGET_SINGLE): Define.
-
-Mon Aug 11 14:50:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * Integrate Haifa instruction scheduler.
- * Makefile.in (ALL_CFLAGS): Add SCHED_CFLAGS. Prefix all references
- to sched with $(SCHED_CFLAGS.
- * configure.in: Handle --enable-haifa.
- * configure: Rebuilt.
- * flags.h: Add new flags for haifa instruction scheduler.
- * genattrtab.c (expand_units): For haifa, don't subtract one
- when computing blockage.
- * toplev.h (flag_schedule_interblock): Haifa scheduler flag.
- (flag_schedule_speculative): Ditto.
- (flag_schedule_speculative_load): Ditto.
- (flag_schedule_speculative_load_dangerous): Ditto.
- (flag_schedule_reverse_before_reload): Ditto.
- (flag_schedule_reverse_after_reload): Ditto.
- (flag_branch_on_count_reg): Ditto.
- (f_options): Add Haifa switches.
- (main): Turn off some Haifa options if appropriate macro is
- defined. Process Haifa switches.
- * unroll.c (iteration_info): No longer static, since Haifa
- scheduler uses it.
- (unroll_loop): Inform HAIFA scheduler about loop unrolling factor.
- * unroll.c (unroll_loop): Set loop_unroll_iter, loop_start_value.
- * loop.h (loop_unroll_factor, loop_number): Add HAIFA decls.
- * loop.h (loop_initial_value,loop_unroll_iter): New globals.
- * loop.c (loop_optimize): If HAIFA is defined, allocate additional
- storage for the Haifa scheduler.
- (mark_loop_jump): If HAIFA defined, set LABEL_OUTSIDE_LOOP_P and
- LABEL_NEXTREF.
- (strength_reduce): If HAIFA and HAVE_decrement_and_branch_on_count
- are defined, call analyze_loop_iterations and insert_bct to use
- countdown loops.
- (record_giv): Refine test for jumps out of loops if HAIFA is
- defined.
- (analyze_loop_iterations): New function to identify if we can use
- a countdown loop.
- (insert_bct): Insert countdown loop.
- (instrument_loop_bct): Low level code to insert countdown loop.
- (loop_number): Calculate UID of loop.
- (indirect_jump_in_function_p): Return true if an indirect jump is
- in the function.
- (is_power_of_2): Return true if value is a power of 2.
- (is_conditional_branch): Return true if insn is a conditional
- jump.
- (fix_bct_param): Process -fbct-{min,max}-N switches.
- (check_bct_param): Return true if loop should be instrumented.
- * loop.c (loop_initial_value,loop_unroll_iter): New globals.
- (loop_optimize): Initialize.
- (get_condition_for_loop): Ditto.
- * loop.c (strength_reduce): Inside of code that uses #ifdef
- HAVE_decrement_and_branch_on_count code, test it to make sure the
- condition is true.
- (instrument_loop_bct): Ditto.
- * haifa-sched.c: New file.
-
-
- * Integrate regmove pass.
- * Makefile.in (OBJS): Add regmove.o
- (regmove.o): Add dependencies.
- * flow.c (find_use_as_address): No longer static.
- * rtl.h (find_use_as_address): Declare.
- * toplev.c (regmove_dump, flag_regmove): Define.
- (f_options): Add -fregmove.
- (regmove_dump_file, regmove_time): Define.
- (fatal_insn): Close the regmove dump file.
- (compile_file): Initialize regmove_time; open/close the regmove dump
- file as needed. Print regmove time as needed.
- (rest_of_compilation): Run regmove pass if requested, dump
- RTL after regmove if requested.
- (main): If -O2 or more, turn on regmove. Handle dump switches.
- * regmove.c: New file.
-
-Mon Aug 11 14:15:02 1997 Jeffrey A Law (law@cygnus.com)
-
- * Integrate tlink patch from jason@cygnus.com
- * gcc.c (SWITCH_TAKES_ARG): Add 'V', 'B' and 'b'.
- (process_command): Increment n_switches for them. Don't discard
- their args. Validate them.
- (main): Escape " marks when creating COLLECT_GCC_OPTIONS.
- From Rohan Lenard.
- (process_command): Set include_prefixes from COMPILER_PATH.
- (main): Set COLLECT_GCC_OPTIONS sooner.
- * confiugre.in: Link ../ld/ld.new to collect-ld rather than real-ld.
- * tlink.c, hash.c, hash.h: New files.
- * Makefile.in (USE_COLLECT2): Always use collect2.
- (collect2): Depend on and link in hash.o and tlink.o.
- (tlink.o, hash.o): Add dependencies.
-
-Mon Aug 11 10:04:49 1997 Jeffrey A Law (law@cygnus.com)
-
- * Integrate alias analysis changes from jfc@mit.edu
- * Makefile.in (OBJS): Add alias.o
- (alias.o): Add dependencies.
- * alias.c: New file.
- * sched.c: Remove alias analysis code. It lives in alias.c now.
- (sched_analyze_2): Add new arguments to true_dependence.
- (schedule_insns): Always call init_alias_analysis.
- * calls.c (expand_call): Note calls to malloc, calloc, and realloc;
- mark return value from such functions as a pointer and keep track of
- them for alias analysis. If a return value from a function is a
- pointer, mark it as such.
- * combine.c (distribute_notes): Handle REG_NOALIAS.
- * cse.c (struct write_data): Delete. No longer needed.
- (invalidate): Don't call set_nonvarying_address_components anymore.
- Use true_dependence to decide if an entry should be removed from
- the hash table.
- (invalidate_memory): Remove WRITES argument, simplify appropriately.
- Fix all callers.
- (note_mem_written): Similarly for WRITE_PTR argument.
- (invalidate_from_clobbers): Similarly for W argument.
- (invalidate_for_call): Remove memory elements from the hash table.
- (refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
- (cse_rtx_varies_p): New function. Derived from old
- cse_rtx_addr_varies_p.
- (cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
- Don't call note_mem_written anymore. Stack pushes invalidate the stack
- pointer if PUSH_ROUNDING is defined. No longer need to call
- cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
- (skipped_writes_memory): Remove variable.
- (invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
- (invalidate_skipped_block): Simplify for new alias analysis code.
- (cse_set_around_loop): Likewise.
- (cse_main): Call init_alias_analysis.
- * flags.h (flag_alias_check, flag_argument_noalias): Declare.
- * toplev.c (flag_alias_check, flag_argument_noalias): Define.
- (f_options): Add new alias checking arguments.
- (main): Set flag_alias_check when optimizing.
- * local_alloc (validate_equiv_mem_from_store): Add new arguments
- to true_dependence.
- (memref_referenced_p): Likewise.
- * loop.c (NUM_STORES): Increase to 30.
- (prescan_loop): Only non-constant calls set unknown_address_altered.
- (invariant_p): Add new arguments to true_dependence.
- (record_giv): Initialize unrolled and shared fields.
- (emit_iv_add_mult): Call record_base_value as needed.
- * loop.h (struct induction): Add unrolled and shared fields.
- * unroll.c (unroll_loop): Call record_base_value as needed.
- (copy_loop_body): Likewise.
- (final_biv_value): Likewise.
- (final_giv_value): Likewise.
- (find_splittable_regs): Likewise. Only create one new pseudo
- if we have multiple address GIVs that were combined with the same
- dst_reg GIV. Note when a new register is created due to unrolling.
- * rtl.c (reg_note_name): Add REG_NOALIAS.
- * rtl.h (enum reg_note): Similarly.
- (rtx_varies_p, may_trap_p, side_effects_p): Declare.
- (volatile_refs_p, volatile_insn_p, remove_note): Likewise.
- (note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
- (true_dependence, read_dependence, anti_dependence): Likewise.
- (output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
- (mark_user_reg, mark_reg_pointer): Likewise.
-
-
- * Integrate reload bugfix from Wilon which enables the PA port
- to bootstrap again.
- * reload1.c (reload): Sum needs for both OPADDR_ADDR and
- OPERAND_ADDRESS when computing how many registers an insn needs.
- (reload_reg_free_p): OPADDR_ADDR and OPERAND_ADDRESS reloads do
- conflict.
- (reload_reg_free_before_p): Treat OPERAND_ADDRESS reloads just like
- OPADDR_ADDR reload.
- (reload_reg_reaches_end_p): For RELOAD_FOR_OPADDR_ADDR insns, registers
- in reload_reg_use_in_op_addr do not reach the end.
- do not reach the end.
- (reloads_conflict): RELOAD_FOR_OPADDR_ADDR conflicts with
- RELOAD_FOR_OPERAND_ADDRESS.
-
-Sun Aug 10 12:00:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * egcs project officially starts.
+Local Variables:
+add-log-time-format: current-time-string
+End:
diff --git a/gcc/ChangeLog.10 b/gcc/ChangeLog.10
deleted file mode 100644
index 513ac72c28a..00000000000
--- a/gcc/ChangeLog.10
+++ /dev/null
@@ -1,10110 +0,0 @@
-Sun Mar 31 05:10:10 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (layout_decl): Don't make a bitfield an integral mode
- if the mode of the field type is not MODE_INT.
-
- * sched.c (schedule_block): CALL_INSNs don't affect fixed regs.
- * flow.c (propagate_block): CALL_INSNs don't kill fixed regs.
-
-Sat Mar 30 03:32:48 1996 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * expmed.c (expand_divmod, case TRUNC_DIV_EXPR): Move some code
- to avoid shifting by a too large count.
-
-Fri Mar 29 15:45:51 1996 Doug Evans <dje@cygnus.com>
-
- * configure (i[3456]86-*-sunos5*): Delete, config.sub converts
- sunos5 to solaris2.
- (sparc-*-sunos5*): Likewise.
- (sparc64-*-{solaris2*,sunos5*}): Delete. Stick with sparc-*-solaris2*.
-
- * sparc.h (FUNCTION_PROFILER): Save/restore %g2 around mcount call.
-
-Fri Mar 29 14:20:31 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (notice_update_cc): Clear cc_status if ref modified MEM.
-
-Fri Mar 29 09:37:52 1996 Jeffrey A. Law <law@cygnus.com>
-
- * calls.c (expand_call): Remove current_call_is_indirect nonsense.
- Add additional argument to INIT_CUMULATIVE_ARGS.
- (emit_library_call): Likewise.
- (emit_library_call_value): Likewise.
- * expr.c (expand_builtin): Likewise.
- * function.c (assign_parms): Likewise.
- * pa.h (hppa_args): New field "indirect".
- (INIT_CUMULATIVE_ARGS): Initialize "indirect" field.
- (FUNCTION_ARG): Check "indirect" field, rather than
- "current_call_is_indirect".
- * a29k.h (INIT_CUMULATIVE_ARGS):New arg, INDIRECT.
- * alpha.h (INIT_CUMULATIVE_ARGS): Likewise.
- * arm.h (INIT_CUMULATIVE_ARGS): Likewise.
- * clipper.h (INIT_CUMULATIVE_ARGS): Likewise.
- * convex.h (INIT_CUMULATIVE_ARGS): Likewise.
- * dsp16xx.h (INIT_CUMULATIVE_ARGS): Likewise.
- * elxsi.h (INIT_CUMULATIVE_ARGS): Likewise.
- * fx80.h (INIT_CUMULATIVE_ARGS): Likewise.
- * gmicro.h (INIT_CUMULATIVE_ARGS): Likewise.
- * h8300.h (INIT_CUMULATIVE_ARGS): Likewise.
- * i370/mvs.h (INIT_CUMULATIVE_ARGS): Likewise.
- * i386.h (INIT_CUMULATIVE_ARGS): Likewise.
- * i860.h (INIT_CUMULATIVE_ARGS): Likewise.
- * i960.h (INIT_CUMULATIVE_ARGS): Likewise.
- * m68k.h (INIT_CUMULATIVE_ARGS): Likewise.
- * m68k/mot3300.h (INIT_CUMULATIVE_ARGS): Likewise.
- * m88k.h (INIT_CUMULATIVE_ARGS): Likewise.
- * mips.h (INIT_CUMULATIVE_ARGS): Likewise.
- * ns32k.h (INIT_CUMULATIVE_ARGS): Likewise.
- * pdp11.h (INIT_CUMULATIVE_ARGS): Likewise.
- * pyr.h (INIT_CUMULATIVE_ARGS): Likewise.
- * romp.h (INIT_CUMULATIVE_ARGS): Likewise.
- * rs6000.h (INIT_CUMULATIVE_ARGS): Likewise.
- * sh.h (INIT_CUMULATIVE_ARGS): Likewise.
- * sparc.h (INIT_CUMULATIVE_ARGS): Likewise.
- * spur.h (INIT_CUMULATIVE_ARGS): Likewise.
- * tahoe.h (INIT_CUMULATIVE_ARGS): Likewise.
- * vax.h (INIT_CUMULATIVE_ARGS): Likewise.
- * we32k.h (INIT_CUMULATIVE_ARGS): Likewise.
- * mips.c (mips_expand_prologue): Add extra arg to
- INIT_CUMULATIVE_ARGS call.
-
-Thu Mar 28 18:45:49 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.c (summarize_insn): Fix three "off-by-one" bugs in loop bounds.
-
-Thu Mar 28 16:50:10 1996 Doug Evans <dje@cygnus.com>
-
- * ginclude/inl-sparc.h: Deleted.
-
-Thu Mar 28 12:07:31 1996 Jeffrey A. Law <law@cygnus.com>
-
- * va-h8300.h (va_arg): Don't assume sizeof (int) == 4.
-
- * pa.c (hppa_legitimize_address): Don't lose for
- (plus (plus (mult (A) (shadd_const)) (B)) (C)) if
- B + C isn't a valid address for indexing.
- (basereg_operand): Only accept base registers after
- cse has completed. Don't accept the frame pointer if
- it's likely to be eliminated.
- * pa.md (unscaled indexing patterns): Add variants with
- basereg and index register reversed.
- (HImode and QImode loads): Add zero extended variants.
-
-Wed Mar 27 07:45:27 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expmed.c (negate_rtx): Fix typo in previous change.
-
-Tue Mar 26 13:50:43 1996 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * calls.c (expand_call): In convert_to_mode call, use word_mode
- not SImode.
-
-Tue Mar 26 13:44:34 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * configure: Delete unnecessary special handling of --with-cpu.
-
-Tue Mar 26 10:41:57 1996 Jeffrey A. Law <law@cygnus.com>
-
- * expr.c (emit_push_insn): When doing a partial push, emit
- a CLOBBER so that flow doesn't think the entire register
- is live.
-
-Tue Mar 26 10:00:52 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.c (summarize_insn, default case): Properly use format_ptr.
-
-Tue Mar 26 09:51:09 1996 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.h (output_move_simode_const): New extern declaration.
- * m68k.c (output_move_simode_const): New function.
- (singlemove_string): Call it.
- * m68k.md (fullword move): Likewise.
-
-Tue Mar 26 05:43:06 1996 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * vax.md (insv matcher): Call CC_STATUS_INIT.
- * vax.h (NOTICE_UPDATE_CC): Handle ZERO_EXTRACT destination.
-
-Mon Mar 25 19:18:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * function.c (expand_function_start): Don't set up context_display
- unless current_function_needs_context.
-
-Mon Mar 25 18:48:18 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * fold-const.c (fold, case BIT_IOR_EXPR): Recognize rotates
- with variable count.
-
-Mon Mar 25 18:05:28 1996 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (libgcc1-test): Undo Feb 12 change.
-
-Mon Mar 25 08:09:59 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * objc/thread-single.c (objc_mutex_unlock): Properly declare thread_id.
-
-Mon Mar 25 08:02:50 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * configure (m68k-motorola-sysv*): Fixed indentation.
-
-Sun Mar 24 08:16:42 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expmed.c (negate_rtx): Don't try to negate a constant ourself;
- instead call simplify_unary_operation.
-
-Sun Mar 24 07:29:06 1996 Richard Henderson <rth@tamu.edu>
-
- * gcc.c (process_command): Instead of hardcoding non-empty
- switches_need_spaces to turn on "o" and "L", make the string
- contain the switches that need the spaces.
- * m68k/ccur-GAS.h (SWITCHES_NEED_SPACES): Change definition
- correspondingly.
-
-Sat Mar 23 18:34:44 1996 Harry Dolan <dolan@ssd.intel.com>
-
- * i860/paragon.h (LIB_SPEC): Always output -lmach.
-
-Sat Mar 23 18:25:39 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * c-typeck.c (set_init_index): Check for use outside an array
- initializer.
-
- * defaults.h (ASM_OUTPUT_ADDR_DIFF_ELT): Delete.
- * pdp11.h (ASM_OUTPUT_ADDR_DIFF_ELT): Don't define.
-
-Sat Mar 23 15:55:35 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * combine.c (make_extraction): In BITS_BIG_ENDIAN correction of POS,
- need to treat MEM and REG differently.
-
- * sparc.h (SPARC_SIMM{10,11,13}_P): Define.
- (SMALL_INT): Use SPARC_SIMM13_P.
- (CONST_OK_FOR_LETTER_P): Support new letters L,M.
- * sparc.c (arith11_operand): Use SPARC_SIMM11_P.
- (arith10_operand): Use SPARC_SIMM10_P.
- * sparc.md (*mov{qi,hi,si,di}_cc_sp64): Fix constraints.
- (*mov{qi,hi,si,di}_cc_reg_sp64): Likewise.
-
-Sat Mar 23 07:47:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/linux.h (TRAMPOLINE_TEMPLATE): Correct first instruction.
- * m68k/m68kv4.h (TRAMPOLINE_TEMPLATE): Likewise.
-
-Sat Mar 23 07:06:55 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * bc-emit.c (bc_emit_instruction): Add missing va_end call.
-
- * c-typeck.c (build_array_ref): Give error if subscripting a function.
-
-Fri Mar 22 09:11:45 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * local-alloc.c (optimize_reg_copy_1): Only update reg_live_length
- if it is non-negative.
-
-Thu Mar 21 14:42:26 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/splet.h (STARTFILE_SPEC,LINK_SPEC): Define.
-
-Wed Mar 20 17:23:18 1996 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (note_mem_written): Delete obsolete code for handling
- (mem (scratch)).
-
- * mips.c (mips_expand_prologue): In initialization of fnargs, delete
- special treatment of METHOD_TYPE.
-
-Wed Mar 20 17:07:45 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/sol2.h (ASM_CPU_SPEC): Recognize -mcpu=v8plus, not v9.
- Fix typo in ultrasparc entry.
- * sparc.h (CPP_CPU_SPEC): Add v8plus entry.
- (ASM_CPU_SPEC): Likewise.
-
- * sparc.c (fcc_reg_operand): Ensure correct mode.
- (icc_or_fcc_reg_operand): Likewise.
- (gen_v9_scc): IF_THEN_ELSE must have a mode.
- (print_operand): New operand code `x' for all condition codes.
- New operand codes `c,d' for reversed conditional moves.
- * sparc.md (movqicc,movhicc): New named patterns.
- (movdicc): if_then_else must have a mode.
- (movsicc,movsfcc,movdfcc,movtfcc): Likewise.
- Change condition to TARGET_V9, not TARGET_ARCH64.
- Fail if DImode compare and ! TARGET_ARCH64.
- (conditional move matchers): Rewrite.
-
-Wed Mar 20 16:12:29 1996 Stan Cox <coxs@wombat.gnu.ai.mit.edu>
-
- * i386.h (HARD_REGNO_MODE_OK): Relax QImode constraint to
- avoid a reload problem.
-
-Wed Mar 20 13:12:22 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (hppa_legitimize_address): Don't lose for x[n-const]
- when n-const will not be shifted. Don't pessimize code for
- x[n-const] when const is small.
-
-Wed Mar 20 11:42:32 1996 Markus Theissinger <Markus.Theissinger@gmd.de>
-
- * m68k/sun3.h (LIB_SPEC): Don't link /usr/lib/bb_link.o with `gcc -a'.
- (__bb_init_func): Deleted.
- (BLOCK_PROFILER_CODE): Don't set macro to nothing.
-
- * m68k/xm-sun3.h: New file.
- * configure (m68k-sun-sunos*): Use it.
-
- * xm-linux.h (HAVE_POPEN): New define.
-
-Wed Mar 20 11:28:37 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/linux.h (ASM_SPEC): Deleted.
- (STRUCT_VALUE_REGNUM): Redefine as register a0.
- (STATIC_CHAIN_REGNUM): Redefine as register a1.
- (TRAMPOLINE_TEMPLATE): Redefine to use the right register.
-
-Wed Mar 20 08:04:34 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * libgcc2.c (__dummy): New function.
- * Makefile.in (LIB2FUNCS): Add __dummy.
- * expr.c (expand_builtin, case BUILT_IN_SETJMP): Call "setjmp"
- pattern, if any.
- Call dummy function pointed to by static chain pointer.
- (expand_builtin, case BUILT_IN_LONJMP): Ignore second expression.
- Set address of __dummy into static chain pointer.
- Copy the label to return to into a pseudo earlier.
-
- * stupid.c (last_setjmp_suid, regs_crosses_setjmp): New variables.
- (stupid_life_analysis, stupid_mark_refs): Use them to track which
- regs are live over a setjmp; don't allocate such regs.
-
-Tue Mar 19 22:02:07 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c (demangle_template): Fix for non-mangled pointer
- arguments.
-
-Tue Mar 19 13:54:06 1996 Jeffrey A. Law <law@wombat.gnu.ai.mit.edu>
-
- * pa.c (compute_frame_size): Update comments to reflect reality.
- (hppa_expand_prologue): Don't save registers which aren't
- used, even if it creates holes. Partially undoes changes from
- early March.
- (hppa_expand_epilogue): Likewise.
-
-Tue Mar 19 08:25:17 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * stmt.c (struct case_node): New member balance.
- (add_case_node): New function.
- (pushcase, pushcase_range): Use it.
- (case_tree2list): New function.
- (expand_end_case): Use it.
-
-Tue Mar 19 07:44:22 1996 Stephen L Moshier (moshier@world.std.com)
-
- * regstack.c (move_for_stack_reg): Avoid stack overflow while
- storing XFmode from fp reg to memory.
-
-Tue Mar 19 07:38:03 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * m68k.h (MASK_*): New macros.
- (OVERRIDE_OPTIONS): Use them.
- (TARGET_SWITCHES): Likewise.
- Treat -m68332 like -m68000.
-
-Mon Mar 18 20:04:13 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * expmed.c (emit_store_flag): If expanding (GE X 0) will need two
- insns, don't use subtarget for the result of the first insn.
- Move a likely constant to the start of a condition.
-
-Mon Mar 18 19:48:14 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.h (CONST_OK_FOR_LETTER_VALUE): New constraint 'M'.
- * m68k.c (output_function_epilogue): Restore registers using sp+
- instead of fp(n) in leaf functions.
- (USE_MOVQ, use_movq): Function replaced by macro.
- * m68k.md (pushexthisi_const, movsi_const0): New names.
- (andsi3, iorsi3): Allow only 'M', not 'K' constants, if dest is 'd'.
-
-Mon Mar 18 19:33:20 1996 Fila Kolodny <fila@ibi.com>
-
- * i370/t-mvs: New file.
- * configure (i370-*-mvs*): Use it.
- * i370/mvs.h (FUNCTION_PROLOGUE): LE/370 takes 120 bytes for DSA.
- Have only one copy of timestamp and PPA2 per object module.
- Only have unnamed CSECT to match IBM C.
-
-Mon Mar 18 19:26:21 1996 Paul Russell (Rusty.Russell@adelaide.maptek.com.au)
-
- * combine.c (simplify_if_then_else): Allow for case that
- condition might no longer be a condition.
-
-Mon Mar 18 19:14:42 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c (build_conditional_expr): If OP1 is null, set
- both OP1 and ORIG_OP1 to IFEXP.
-
- * c-iterate.c (iterator_loop_epilogue): Don't clear DECL_RTL
- for a static decl.
-
-Mon Mar 18 08:02:25 1996 Stephen L Moshier <moshier@world.std.com>
-
- * alpha.c (summarize_insn, case SUBREG, CONST_*): New cases.
-
-Sun Mar 17 16:55:00 1996 Doug Evans <dje@cygnus.com>
-
- * combine.c (find_split_point): Handle NULL return from
- make_extraction.
- (make_field_assignment): Likewise.
-
-Sat Mar 16 18:56:47 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (substitute_in_expr, case COMPONENT_REF): Ignore
- if inner PLACEHOLDER_EXPR has not yet been initialized.
-
- * i386.c (standard_80386_constant_p): -0.0 is not 0.0.
- * i386.md (insv): Restore missing end of comment.
-
- * combine.c (make_extraction): Correct typo in force_to_mode
- call in previous change.
- Return 0 if pos+len out of range of want desired mode.
-
-Sat Mar 16 16:20:43 1996 David Mosberger-Tang <davidm@azstarnet.com>
-
- * alpha.md (trap): New attribute.
- Modify patterns for all floating-point trap generating instructions.
- * alpha.h (CPP_SPEC): Added -mieee and -mieee-with-inexact.
- (alpha_trap_precision, alpha_fp_rounding_mode, alpha_fp_trap_mode):
- New enum types.
- (target_flags, alpha_tp, alpha_fprm, alpha_fptm): New external vars.
- (alpha_fprm_string, alpha_fptm_string, alpha_tp_string): Likewise.
- (TARGET_IEEE{,_WITH_INEXACT,_CONFORMANT}): New macros.
- (MASK_IEEE{,_WITH_INEXACT,_CONFORMANT}): Likewise.
- (MASK_FP, MASK_FPREGS,
- (TARGET_SWITCHES): Added "ieee-conformant", "ieee", and
- "ieee-with-inexact"; use MASK symbols.
- (TARGET_OPTIONS): New macro.
- (OVERRIDE_OPTIONS, FINAL_PRESCAN_{INSN,LABEL}): New macros.
- (PRINT_OPERAND_PUNCT_VALID_P): Allow operand codes for FP insns.
- (CC1_SPEC): New macro.
- * alpha.c (alpha_tp, alpha_fprm, alpha_fptm): New variables.
- (alpha_tp_string, alpha_fprm_string, alpha_fptm_string
- (trap_pending): Likewise.
- (override_options, summarize_insn, final_prescan_insn): New functions.
- (print_operand): Handle cases '&', '\'', ')', and '+'.
- (output_prolog): Emit ".eflag 48" if TARGET_IEEE_CONFORMANT.
- (output_epilog): Call final_prescan_insn before emitting epilog.
-
- * final.c (final_scan_insn, case CODE_LABEL): Invoke
- FINAL_PRESCAN_INSN if FINAL_SCAN_LABEL is defined.
-
- * alpha/{linux.h,x-linux,xm-linux.h}: New files.
- * configure (alpha-*-linux*): New case.
- * alpha.c (output_prolog): Set alpha_function_needs_gp if profiling
- and TARGET_PROFILING_NEEDS_GP defined.
-
-Thu Mar 14 22:28:20 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (LEGITIMATE_OFFSET_ADDRESS_P): Fix last change.
- * aix41.h (LINK_SPEC): add -bnoentry if shared and no explicit entry.
-
-Thu Mar 14 12:47:33 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.h (ASM_OUTPUT_DOUBLE_INT): Use 'X' if CONST_INT and
- HOST_BITS_PER_WIDE_INT == 64.
-
- * mips.c (mips_expand_prologue): Change TYPE_NEEDS_CONSTRUCTING to
- TREE_ADDRESSABLE;
-
-Thu Mar 14 11:21:37 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (LEGITIMATE_OFFSET_ADDRESS_P): For 32-bit mode,
- allow TImode variables with int offsets, so that structures
- greater than 8 bytes and less than or equal to 16 bytes can be
- instantiated correctly.
-
- * rs6000.c (rs6000_valid_type_attribute_p): Add exception
- attribute for Windows NT.
-
- * win-nt.h (ASM_OUTPUT_FUNCTION_PREFIX): Delete, merge into
- ASM_DECLARE_FUNCTION_NAME.
- (ASM_DECLARE_FUNCTION_NAME): Add support for exception attribute
- setting fields 3 & 4 of the structured exception handling table.
-
-Thu Mar 14 01:53:19 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (ASM_DECLARE_FUNCTION_NAME): Change TYPE_NEEDS_CONSTRUCTING
- to TREE_ADDRESSABLE. From Jim Wilson.
-
-Wed Mar 13 13:40:32 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * c-tree.h (warn_sign_compare): Add extern to declaration.
-
-Wed Mar 13 13:37:00 1996 Doug Evans <dje@cygnus.com>
-
- * configure: Use cross-make and build-make if building
- cross compiler with cross compiler.
-
-Wed Mar 13 12:00:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * i386/cygwin32.h (ASM_OUTPUT_ALIGN): Correct defination.
-
- * rs6000/{win-nt,cygwin32}.h (STARTFILE_SPEC): Add crti.o before
- all objects.
- (ENDFILE_SPEC): Add crtn.o after all objects.
-
- * configure (powerpcle-*-cygwin32): Use t-winnt, not t-cygin32
- * rs6000/t-cygwin32: Delete, no longer used.
-
- * rs6000/t-winnt ({,INSTALL_}LIBGCC): Build and install crti.o and
- crtn.o.
-
- * rs6000/win-nt.h (EXTRA_SECTION_FUNCTIONS): Add ctors_section and
- dtors_section.
- (INVOKE__main): Define, so that __main is called.
- (ASM_OUTPUT_{CONSTRUCTOR,DESTRUCTOR}): Define to put pointers to
- the constructor/destructor in the appropriate section.
-
- * nt-c{i,n}.asm: New files to be linked before/after all of the users'
- objects.
-
-Wed Mar 13 00:42:17 1996 Per Bothner <bothner@cygnus.com>
-
- * dbxout.c (dbxout_type): Better "variant" handling to ignore
- const/volatile but not typedef names. Improves Feb 12 change.
-
-Tue Mar 12 17:25:14 1996 David Mosberger-Tang <davidm@azstarnet.com>
-
- * glimits.h (__LONG_MAX__): On Alpha, use 64 bit value.
-
-Tue Mar 12 15:07:49 1996 Torbjorn Granlund <tege@tmg.se>
-
- * m68k.c (valid_dbcc_comparison_p): Don't test cc_prev_status here.
- (flags_in_68881): New function.
- * m68k.md (dbra peepholes): Use flags_in_68881.
-
-Tue Mar 12 13:54:15 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sparc.md (nonlocal_goto): Emit barrier after jump.
- (setjmp{,_64,_32}): New patterns.
-
-Tue Mar 12 12:43:27 1996 Jim Wilson <wilson@cygnus.com>
-
- * i960.h (ROUND_TYPE_SIZE): Return round_up result instead of
- COMPUTED.
-
- * expr.c (expand_expr, case COMPONENT_REF): For unaligned object in
- an aligned union, delete check for EXPAND_SUM.
-
- * expr.h (clear_storage): Add comment terminator.
-
-Mon Mar 11 19:07:50 1996 Jeffrey A. Law <law@cygnus.com>
-
- * recog.c (constrain_operands, case 'V'): Don't call
- offsettable_memref_p before reload has completed.
-
-Mon Mar 11 16:06:13 1996 Doug Evans <dje@cygnus.com>
-
- * h8300.h (SP_AND_G_REGS): Renamed from SP_AND_G_REG.
- (CC_DONE_CBIT): Delete.
- (CC_OVERFLOW_0,CC_OVERFLOW_UNUSABLE,CC_NO_CARRY): Define.
- * h8300.c (cond_string): Delete CC_DONE_CBIT handling.
- (notice_update_cc): Delete CC_CBIT, CC_WHOOPS. Add CC_SET_ZN_C0.
- (restore_compare_p): New function.
- (shift_one): Use shll instead of shal so overflow bit is usable.
- Set cc_valid bits to cc_status.flags values.
- (emit_a_shift): Set cc_status.flags.
- * h8300.md (attr cc): Delete whoops,cbit. Add set_zn_c0.
- (all patterns) Update cc attr setting.
- (tstqi,tsthi,tstsi): Delete CC_DONE_CBIT handling.
- (addhi3,subhi3): Change define_expand to define_insn.
- (branch_true,branch_false): Check if compare needs to be restored.
-
-Mon Mar 11 13:55:23 1996 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (CONST_DOUBLE_OK_FOR_LETTER_P): Add 'H' for movdi
- patterns in 32 bit that generate 3 instructions.
- (num_insns_constant): Add declaration.
-
- * rs6000.c (num_insns_constant{,_wide}) Functions to determine the
- number of insns it takes to generate an integer constant.
- (easy_fp_constant): Allow DImode in easy constants. Use
- num_insns_constant_wide.
- (input_operand): Allow any CONST_{INT,DOUBLE}'s for {SI,DI}mode.
-
- * rs6000.md (movdi): Generate a normal movdi using a CONST_DOUBLE
- for 32 bit mode rather than using SUBREG's. For 64 bit mode,
- break large integer constants into smaller pieces. Add various
- define_splits to handle loading the various DImode constants.
-
-Mon Mar 11 06:54:19 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (make_extraction): Use proper mode for INNER in all cases.
- (simplify_comparison, case ZERO_EXTRACT): For bits big endian and
- no extzv, use BITS_PER_WORD.
- * fx80.md, gmicro.md, i386.md, m68k.md, tahoe.md, vax.md:
- Use proper modes and predicates for {sign,zero}_extract.
-
-Sun Mar 10 06:23:52 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * emit-rtl.c (free_insn): New variable.
- (init_emit, restore_emit_status): Clear it.
- (gen_sequence): Store insn in free_insn when sequence length is 1.
- (make_insn_raw): Use free_insn if available and still in the
- rtl generation phase.
-
-Fri Mar 8 15:37:31 1996 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_expr, case TARGET_EXPR): Delay putting the cleanup
- on the cleanup chain until after the subexpression has been expanded.
-
-Fri Mar 8 16:14:51 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * i386.c (ix86_binary_operator_ok): One memory operand is OK.
- This is independent of commutativity.
-
-Fri Mar 8 14:07:43 1996 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (store_constructor_field): Call store_field if bitpos is
- nonzero and target is not a MEM.
-
- * jump.c (jump_optimize): When handle a USE insn before an
- unconditional jump, disable the optimization if the USE is the
- only insn in the loop.
-
- * sh.c (reg_unused_after): Return 0 if see a JUMP_INSN.
-
-Fri Mar 8 12:08:36 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/lynx.h (CPP_SPEC): Use %(cpp_cpu).
-
- * sparc/sparc.md (move_pic_label_si,move_label_di): Rewrite length
- attr calcs to be more conservative.
-
-Thu Mar 7 19:14:21 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/t-splet: New file.
- * sparc/splet.h: New file.
- * configure (sparclet-*-aout*): Use them.
-
- * sparc.h (MASK_LIVE_G0,TARGET_LIVE_G0): Define.
- (FIRST_PSEUDO_REGISTER): Add 1 for %icc (now 101).
- (FIXED_REGISTERS,CALL_USED_REGISTERS): Update.
- (FIXED_REGISTERS): %g0 is fixed by default.
- (SPARC_{FIRST,LAST}_V9_FCC_REG): Define.
- (SPARC_{ICC,FCC}_REG): Define.
- (CONDITIONAL_REGISTER_USAGE): Don't fix %fcc0 if v8.
- (REG_CLASS_CONTENTS): Reg 0 is an int reg, reg 100 is %icc.
- (REGNO_REG_CLASS): Rewrite to use global `sparc_regno_reg_class'.
- (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Add %icc.
- (REG_CLASS_FROM_LETTER): Handle 'c' for FPCC_REGS in non-v9 case.
- (REGNO_OK_FOR_{BASE,INDEX}_P): Treat %g0 as a normal reg.
- (REG_OK_FOR_{BASE,INDEX}_P,EXTRA_CONSTRAINT): Likewise.
- (REGISTER_NAMES): Add %icc.
- (ADDITIONAL_REGISTER_NAMES): Use SPARC_ICC_REG.
- * sparc.c (leaf_reg_remap): Add %icc=100.
- (reg_or_0_operand): Don't allow 0 if TARGET_LIVE_G0.
- (fcc_reg_operand): Renamed from ccfp_reg_operand.
- Use SPARC_FCC_REG. Don't treat reg 0 as an fcc reg. Don't match
- modes if `mode' argument is VOIDmode.
- (icc_or_fcc_reg_operand): New function.
- (gen_compare_reg): Use SPARC_FCC_REG for v8 fp compares.
- Use SPARC_ICC_REG for int compares.
- (eligible_for_epilogue_delay): Don't allow anything if TARGET_LIVE_G0.
- Delete unnecessary test for %g0.
- (emit_move_sequence): Don't emit (set (mem) (const_int 0)) if
- TARGET_LIVE_G0.
- (output_scc_insn): Label moved to operand 3. Condition code reg
- moved to operand 2.
- (sparc_mode_class): Enum C_MODE renamed to CC_MODE.
- (hard_32bit_mode_classes): Set reg 0 to S_MODES. Add entry for %icc.
- (hard_64bit_mode_classes): Set reg 0 to D_MODES. Add entry for %icc.
- (sparc_regno_reg_class): New global.
- (sparc_init_modes): Initialize it.
- (output_cbranch): Delete fp_cond_reg argument.
- (print_operand, MEM op): Don't print "%g0+" if TARGET_LIVE_G0.
- (sparc_flat_eligible_for_epilogue_delay): Don't allow anything if
- TARGET_LIVE_G0.
- * sparc.md (live_g0): New attribute.
- (*): Integer condition code register is now reg 100.
- Use SPARC_ICC_REG instead of hardcoding reg 100 where possible.
- Non-v9 floating point condition code register is now reg 96.
- (*cmp{sf,df,tf}_{fpe,fp}_sp{32,64}): Combine v9/non-v9 cases.
- (*{normal,inverted}_{,fp,fpe}_branch): Update call to output_cbranch.
- (*mov{qi,hi,si}_insn): Don't use if TARGET_LIVE_G0.
- (*mov{qi,hi,si}_insn_liveg0): New patterns.
- (*mov{si,di,sf,df,tf}_ccfp{,e}_sp64): ccfp_reg_operand renamed to
- fcc_reg_operand.
- (*negdi2_sp32,negsi2,one_cmplsi2,ffssi2): Ensure %%g0 is 0 if
- TARGET_LIVE_G0.
- (*one_cmpldi2_sp32): Move operand 1 to rs1 and use 0 as rs2.
- (patterns that use %g0 in rs2): Use 0 immediate value instead.
- (patterns that read %g0): Don't use if TARGET_LIVE_G0.
-
-Thu Mar 7 15:39:16 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.h (PASS_IN_REG_P): Change < to <=.
- * va-sh.h (va_start): Change __SH3E___ to __SH3E__.
- (va_arg): Add little-endian SH3E support. Fix big-endian version
- to work for arguments smaller than the word size.
-
-Thu Mar 7 10:37:37 1996 Jeffrey A. Law <law@cygnus.com>
-
- * lib2funcs.asm: Remove entry/exit routines. Move them into...
- * ee.asm: New file. Entry/exit code.
- * ee_fp.asm: New file. Entry/exit code with frame pointer.
- * t-pa: Corresponding changes.
- * t-pro: Corresponding changes.
-
- * pa.c: Fix misc small typos/thinkos in recent changes.
-
-Wed Mar 6 17:36:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c (demangle_template): Fix for address-of-extern arguments.
-
-Wed Mar 6 15:12:55 1996 Jeffrey A. Law <law@cygnus.com>
-
- * t-pro (dp-bit rule): Fix typo.
-
- * lib2funcs.asm (__outline_prologue): Remove frame pointer
- support.
- (__outline_prologue_fp): Out of line prologue with frame pointer.
- (__outline_epilogue, outline_epilogue_fp): Similarly.
- * pa.c (compute_frame_size): Allocate enough space to avoid holes
- in the callee register saves. Remove some special handling of %r3.
- (hppa_expand_prologue): Don't do an out of line prologue/epilogue
- if it would take more insns than an inline prologue/epilogue.
- Don't leave holes in the callee register save set.
- (hppa_expand_prologue): Corresponding changes. Pass stack size
- to out of line epilogue code.
- * pa.h (FRAME_POINTER_REQUIRED): Revert last change.
- * pa.md (outline_prologue_call): Handle outline prologues which
- don't need frame pointers.
- (outline_epilogue_call): Similarly.
- * t-pro: Reenable multilib code. Build a set of libraries that
- optimize for space.
-
-Wed Mar 6 14:28:14 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * Makefile.in (USER_H): Add ginclude/va-sh.h.
- * ginclude/stdarg.h, ginclude/varargs.h: Use va-sh.h.
- * ginclude/va-sh.h: New file.
-
- * sh.h (PASS_IN_REG_P): Fix typo in last change.
-
-Wed Mar 6 11:42:06 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (enum processor_type): Remove PROCESSOR_PPC602.
- (RTX_COSTS): Remove PROCESSOR_PPC602. PPC603 MULT cost depends
- on constant and domain.
- * rs6000.c (processor_target_table): 602 uses PROCESSOR_PPC603.
- (get_issue_rate): Remove CPU_PPC602.
- * rs6000.md (function units): Remove PPC602. Add store and
- fpstore type attribute values. Update patterns.
-
-Tue Mar 5 18:43:43 1996 Richard Henderson <rth@tamu.edu>
-
- * m68k/coff.h (ASM_OUTPUT_SECTION_NAME): New define.
-
- * m68k/{aux-crt1.c,aux-crt[2n].asm}: New files.
- * m68k/{aux-exit.c,aux-low.gld,aux-mcount.c}: More new files.
- * m68k/{aux.h,auxgnu.h,auxstd.h}: Even more new files.
- * m68k/{t-aux,xm-aux.h}: The rest of the new files.
- * m68k/sgs.h (ASM_OUTPUT_CASE_END): Add missing semicolon.
- (switch_table_difference_label_flag): Make extern.
- * fixincludes (sys/param.h): Fix c89 __asm statements.
- * configure (m68k-apple-aux*): New target.
-
-Tue Mar 5 17:38:19 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.md (*mov{qi,hi,si}_insn): Simplify length attribute.
- (*movsi_insn): Use fpload/fpstore attributes for fp loads/stores.
- %r1 -> %1 for fpstore alternative.
- (*movsf_insn,*movsf_no_f_insn): %r1 -> %1.
-
-Tue Mar 5 17:19:17 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (expand_expr, case *_DECL): If we make a non-local
- reference from a function with DECL_NO_STATIC_CHAIN set, abort.
- (expand_expr, case ADDR_EXPR): We don't need a trampoline for a
- function with DECL_NO_STATIC_CHAIN set.
- * function.c (lookup_static_chain): If we're checking on a function
- that doesn't need a static chain, return 0.
- (init_function_start): We don't need context if DECL_NO_STATIC_CHAIN
- is set.
- * tree.c (staticp): Check DECL_NO_STATIC_CHAIN on nested functions.
-
-Tue Mar 5 15:04:29 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.md (push_e, pop_e): Add TARGET_SH3E to condition.
- * sh.h (JUMP_TABLES_IN_TEXT_SECTION): Define.
- * sh.c (find_barrier): Set si_limit to 1018 instead of 1020, and
- hi_limit to 510 instead of 512.
-
-Tue Mar 5 13:39:44 1996 Doug Evans <dje@cygnus.com>
-
- * loop.c (init_loop): Use pseudo reg in add_cost computation
- so cost doesn't vary depending on whether reg 0 happens to be
- fixed or not.
-
-Tue Mar 5 09:32:24 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * reg-stack.c (record_label_references): Check for undefined label.
-
-Tue Mar 5 09:22:20 1996 Scott Christley (scottc@net-community.com)
-
- * objc/objc-api.h, objc/runtime.h: Include objc/thread.h.
- * objc/class.c (__objc_init_class_tables): Surround sarray access
- with mutex lock/unlock.
- (__objc_add_class_to_hash, objc_lookup_class): Likewise.
- (objc_get_class, objc_get_next_class): Likewise.
- (__objc_resolve_class_links, class_pose_as): Likewise.
- * objc/init.c (__objc_runtime_mutux, __objc_runtime_thread_alive):
- New variables.
- (objc_init_statics, __objc_init_protocols): Surround sarray access
- with mutex lock/unlock
- (__objc_exec_class): Likewise.
- Initialization for thread-safe global variables.
- Declarations for thread-safe functions and global variables
- * objc/sendmsg.c (get_imp, __objc_responds_to):
- Surround sarray access with mutex lock/unlock.
- (__objc_init_install_dtable): Likewise.
- (__objc_update_dispatch_table_for_class): Likewise.
- (__objc_print_dtable_stats): Likewise.
- * objc/selector.c (sel_get_typed_uid, sel_get_any_typed_uid): Likewise.
- (sel_get_any_uid, sel_get_name, sel_register_name): Likewise.
- (sel_register_typed_name): Likewise.
- * objc/sarray.h (union sversion): New.
- (struct sarray): Maintain multiple versions.
- (sarray_remove_garbage): Add prototype.
- * objc/sarray.c (sarray_{remove,free}_garbage): New functions.
- (sarray_at_put, sarray_new, sarray_lazy_copy):
- Modify/copy sarray structure/data in a thread-safe manner
- (sarray_{realloc,free}): Reallocate/free sarray structure/data in a
- thread-safe manner.
-
- * objc/THREADS, objc/thread.c, objc/thread.h: New files.
- * objc/thread-{decosf1,irix,solaris,win32,single}.c: New files.
- * objc/objc-list.h: Renamed from objc/list.h.
- * objc/Makefile: Changes to compile new files and name renaming.
- * objc/makefile.dos: Likewise.
-
-Tue Mar 5 07:51:31 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * bc-emit.c, bc-optab.c (free): Delete declaration of library function.
-
- * c-decl.c (duplicate_decl): If making decl non-external, copy
- context from old to new.
-
-Tue Mar 5 02:27:35 1996 Jeffrey A. Law <law@cygnus.com
-
- * lib2funcs.asm (__outline_prologue): New "function".
- (__outline_epilogue): New "function".
- * pa.h (TARGET_SPACE): Define.
- (target_flags): Add -mspace and -mno-space. Enable/disable
- space saving optimizations.
- (FRAME_POINTER_REQUIRED): Frame pointers are always required
- when generating out of line prologues and epilogues.
- * pa.c (compute_frame_size): Handle out of line prologues/epilogues.
- (hppa_expand_prologue): If optimizing for space, emit an out of
- line prologue.
- (hppa_expand_epilogue): Similarly.
- (override_options): Optimizing for space is not compatable with
- either profiling or PIC code generation.
- * pa.md (outline_prologue_call): New pattern.
- (outline_epilogue_call): Likewise.
-
-Tue Mar 5 02:17:32 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.md (*cmp{si,di}_insn): %r0 -> %0.
- (DFmode move define_split): Ensure registers not extended v9 fp regs.
- (*mov{sf,df,tf}_cc_reg_sp64): %r3 -> %3.
-
-Mon Mar 4 18:46:37 1996 Manfred Hollstein <manfred@lts.sel.alcatel.de>
-
- * Makefile.in (CRT0STUFF_T_CFLAGS): New macro.
- (stamp-crt0, crt0.o, mcrt0.o): New goals.
- (STAGESTUFF): stamp-crt0 added.
-
- * collect2.c (main): Check new define DEFAULT_A_OUT_NAME.
-
- * m68k.c (print_operand): Emit .l as scale factor #ifdef MOTOROLA.
- * m68k/mot3300-crt0.S, m68k/mot3300Mcrt0.S: New files.
- * m68k/mot3300g.h: Deleted.
- * m68k/mot3300.h (FUNCTION_PROFILER): Emit label references
- corresponding to those generated by ASM_OUTPUT_INTERNAL_LABEL.
- (MOTOROLA, MOTOROLA_BSR, ...): Define #ifndef USE_GAS.
- (ASM_SPEC): Define properly #ifdef USE_GAS.
- (LIB_SPEC): -L/usr/lib/libp deleted.
- (STARTFILE_SPEC): -L/usr/lib/libp added.
- (DEFAULT_A_OUT_NAME): Define.
- (LINK_SPEC): Pass -v if GNU ld is used.
- (LOCAL_LABEL_PREFIX): Local labels start with .L using GAS, else L%.
- (USER_LABEL_PREFIX): Undefine.
- (FUNCTION_PROFILER): Call asm_fprintf instead of normal fprintf.
- (ASM_APP_ON, ASM_FILE_START): GAS supports it.
- (CTORS_.../DTORS_...): Define if GNU ld is used.
- (ASM_FILE_START): Define properly for Motorola and GNU as syntax.
- (TARGET_VERSION): Re-define only #ifndef USE_GAS.
- (CALL_USED_REGISTERS): Deleted.
- (GLOBAL_ASM_OP): Re-define only #ifndef USE_GAS.
- (ASM_{LONG,SHORT,CHAR,BYTE,BYTE_OP}): New macros.
- (ASM_OUTPUT_{DOUBLE,LONG_DOUBLE,FLOAT,INT,SHORT}): Use them.
- (ASM_OUTPUT_{CHAR,BYTE,ASCII,FLOAT_OPERAND,DOUBLE_OPERAND}): Likewise.
- (ALIGN_ASM_OP, SKIP_ASM_OP): New macros.
- (ASM_OUTPUT_{ALIGN,SKIP}): Use them.
- (ASM_OUTPUT_SOURCE_FILENAME): Define only if not using GNU as.
- (ASM_{GENERATE,OUTPUT}_INTERAL_LABEL): Provide proper definitions for
- Motorola and GNU as syntax.
- (ASM_OUTPUT_ADDR_{VEC,DIFF}_ELT): Changed for portability between
- Motorola and GNU as syntax.
- (ASM_OUTPUT_{CASE_LABEL,OPCODE}): Define only if not using GNU as.
- (ASM_OUTPUT_CASE_FETCH, ASM_RETURN_CASE_JUMP): New macros.
- (ASM_OUTPUT_{COMMON,LOCAL}): Proper defns for Motorola and gas syntax.
- (SDB_...): Define only for Motorola as.
- (ALT_LIBM): New define to tell g++.c about an alternative name for
- `-lm'.
- (MATH_LIBRARY, NEED_ATEXIT, HAVE_ATEXIT, EXIT_BODY): New macros.
- * m68k/t-mot3300, m68k/t-mot3300-{gald,gas,gld}: New files.
- * m68k/x-mot3300-gas: New file.
- * m68k/xm-mot3300.h (USG): Set to 1.
- * configure (m68k-motorola-sysv*): Keep track of new different
- combinations (--with-gnu-...), and provide proper definitions for
- tm_file, xmake_file, tmake_file, use_collect2, and extra_parts.
-
- * gbl-ctors.h (HAVE_ATEXIT): Define if NEED_ATEXIT is defined.
- (atexit): Use `int atexit' prototype also if NEED_ATEXIT is defined.
- (on_exit): According to man on_exit on the Sun it returns int not void.
- * libgcc2.c (L_bb/atexit, onexit): Declarations replaced by
- #include'ing "gbl-ctors.h".
- (L_exit/atexit): New function.
- (L_exit/exit): Call any registered functions.
-
-Mon Mar 4 18:03:38 1996 Bryan Ford (baford@cs.utah.edu)
-
- * configure (i[3456]86-moss-msdos*): New target.
- * i386/moss.h: New file.
-
-Mon Mar 4 17:38:50 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.h (PASS_IN_REG_P): Don't reject BLKmode for SH3e.
- For SH3e, do reject parameter that won't fit entirely in registers.
-
- * sh.md (mulhisi3-2, mulhisi3-1, mulsidi3_i, umulsidi3_i,
- smulsi3_highpart, umulsi3_highpart): Renames operands 1/2 to 0/1.
- (mulsidi3, umulsidi3): Add support for TARGET_LITTLE_ENDIAN.
-
- * sh.c (machine_dependent_reorg): In TARGET_RELAX code, when scan
- forward from LINK, fail if pass a CODE_LABEL before finding INSN.
- Fail if SCAN not INSN is a JUMP_INSN.
-
-Mon Mar 4 11:27:10 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (CALL_LONG): Change CALL_xx values from an enumeration
- to bitmasks. Add CALL_LONG to support longcall attributes.
- (rs6000_args): Call_cookie field is now an int.
- (rs6000_longcall_ref): Add declaration.
-
- * rs6000.c (init_cumulative_args): Add support for longcall
- attributes to always call through a pointer.
- (function_arg): Ditto.
- (rs6000_valid_type_attribute_p): Ditto.
- (rs6000_longcall_ref): New function for long calls.
-
- * rs6000.md (call insns): Add support for longcall attributes.
-
-Mon Mar 4 08:42:14 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * real.c (significand_size): Don't test the modes, but their sizes.
-
- * dwarfout.c (xstrdup): Moved from here.
- * toplev.c (xstrdup): New function.
- * tree.h (xstrdup): Declare.
- * bc-emit.c (bc_xstrdup): Delete.
- * expr.c (bc_strdup): Delete.
- (bc_load_externaddr_id): Use xstrdup instead of bc_xstrdup.
- * function.c (bc_expand_function_start): Likewise.
- * 1750a.c (strdup): Delete.
- (float_label): Use xstrdup instead of strdup.
- * 1750a.h (xstrdup): Declare instead of instead of strdup.
- (ASM_OUTPUT_LABEL): Use xstrdup instead of strdup.
- (FIX_FRAME_POINTER_ADDRESS): Don't use DEPTH in string.
-
-Mon Mar 4 08:23:23 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * xm-we32k.h (NO_WAIT_H): Deleted.
-
- * collect2.c: Never include wait.h.
-
-Sat Mar 2 22:43:07 1996 Torbjorn Granlund <tege@spiff.gnu.ai.mit.edu>
-
- * configure (code for making links): Work around sh bug on FreeBSD.
-
-Sat Mar 2 13:40:29 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.h (BIGGEST_FIELD_ALIGNMENT): Replace uses of
- TARGET_ALIGN_STRUCT_300 with TARGET_ALIGN_300.
- (BIGGEST_ALIGNMENT): Likewise.
-
-Sat Mar 2 08:04:50 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * calls.c (expand_call): If passing by invisible ref, not const.
-
- * sparc.c (SKIP_CALLERS_UNIMP_P): Make agree with test used in call.
-
- * expr.c (do_jump, case COMPOUND_EXPR): Call preserve_temp_slots.
-
- * fold-const.c (fold, case *_DIV_EXPR): Ignore SAVE_EXPR if has RTL.
-
-Fri Mar 1 17:59:17 1996 Jeffrey A. Law <law@cygnus.com>
-
- * optabs.c (emit_cmp_insn): Immediately copy the return
- value from the library call into a pseudo register.
- (emit_float_lib_cmp): Likewise.
-
-Fri Mar 1 14:37:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (BSS_SECTION_ASM_OP): Define.
- (*_SECTION_ASM_OP): Change tab after .section into a space.
- (ASM_OUTPUT_INT): Ditto.
- (ASM_OUTPUT_ALIGNED_LOCAL): Rewrite to use bss_section.
- (ASM_OUTPUT_ALIGNED_BSS): Define to use ASM_GLOBALIZE_LABEL and
- ASM_OUTPUT_ALIGNED_LOCAL.
-
- * rs6000/win-nt.h (BSS_SECTION_ASM_OP): Define.
- (ASM_OUTPUT_ALIGNED_LOCAL): Define.
- (ASM_OUTPUT_LOCAL): Don't define any more.
- (ASM_OUTPUT_ALIGNED_BSS): Define to use ASM_GLOBALIZE_LABEL and
- ASM_OUTPUT_ALIGNED_LOCAL.
-
-Thu Feb 29 17:33:12 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * c-typeck.c (push_init_level): When output padding to align structure
- field, set constructor_unfilled_fields.
-
- * dbxout.c (dbxout_type, case METHOD_TYPE): Add CHARS (1) call
- after emitting second '#' character.
-
-Thu Feb 29 13:59:27 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * h8300.h (ASM_OUTPUT_BSS): Define.
- * m68k/coff.h (BSS_SECTION_ASM_OP): Define.
- (ASM_OUTPUT_ALIGNED_BSS): Define.
- * m68k/m68k-aout.h (BSS_SECTION_ASM_OP): Define.
- (ASM_OUTPUT_BSS): Define.
-
-Thu Feb 29 13:39:39 1996 Per Bothner <bothner@cygnus.com>
-
- * varasm.c (compare_constant_1): For a SET_TYPE CONSTRUCTOR,
- first extract and compare the set length.
-
- * varasm.c (record_constant_1): For SET_TYPE CONSTRUCTOR,
- permanent_obstack.next_free is *end* of available space.
-
-Thu Feb 29 13:14:14 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (TARGET_SWITCHES): Add new flags "-mlong-load-store" and
- "-mno-long-load-store".
- (TARGET_LONG_LOAD_STORE): Define.
- * pa.md (symbolic high part): Handle TARGET_LONG_LOAD_STORE.
-
-Thu Feb 29 11:39:30 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md (cmpxf*): XF compare cannot have mem operands.
- (casesi expand): Put (minus:SI..) into subsi3 format.
- * i386.c (i386_return_pops_args): Cleanup extra argument
- used as address of a returned structure.
-
-Wed Feb 28 22:24:28 1996 Doug Evans <dje@cygnus.com>
-
- * varasm.c (enum in_section): Define in_bss if BSS_SECTION_ASM_OP
- is defined.
- (bss_section,asm_output_bss,asm_output_aligned_bss): New functions.
- (assemble_variable): Delete redundant test for too large an object.
- Rewrite test for uninitialized variables. Use new macros
- ASM_OUTPUT{,_ALIGNED}_BSS if defined to output global uninitialized
- but not common variables.
- * bytecode.h (BC_OUTPUT_BSS): Define.
- * lynx.h (EXTRA_SECTIONS): Delete in_bss.
- (EXTRA_SECTION_FUNCTIONS): Delete BSS_SECTION_FUNCTION.
- * svr3.h (EXTRA_SECTIONS): Likewise.
- (BSS_SECTION_FUNCTION): Delete.
- * convex.h (EXTRA_SECTIONS,EXTRA_SECTIONS_FUNCTIONS): Delete.
- * dsp16xx.h (EXTRA_SECTIONS): Delete in_bss.
- (EXTRA_SECTION_FUNCTIONS): Delete bss_section.
- * gmicro.h (EXTRA_SECTIONS,EXTRA_SECTIONS_FUNCTIONS): Delete.
- * i386/aix386ng.h (EXTRA_SECTION_FUNCTIONS): Delete
- BSS_SECTION_FUNCTION.
- * i386/att.h (BSS_SECTION_FUNCTION): Delete.
- * i386/sco5.h (EXTRA_SECTIONS): Delete in_bss.
- (EXTRA_SECTION_FUNCTIONS): Delete BSS_SECTION_FUNCTION.
- (BSS_SECTION_FUNCTION): Delete.
- * i386/seq-sysv3.h (BSS_SECTION_FUNCTION): Delete.
- * i386/svr3gas.h (EXTRA_SECTIONS): Delete in_bss.
- (EXTRA_SECTION_FUNCTIONS): Delete BSS_SECTION_FUNCTION.
- (BSS_SECTION_FUNCTION): Delete.
- * i860/paragon.h (EXTRA_SECTIONS,EXTRA_SECTIONS_FUNCTIONS): Undef.
- * m68k/crds.h (EXTRA_SECTIONS,EXTRA_SECTIONS_FUNCTIONS): Delete.
- (BSS_SECTION_ASM_OP): Define.
- * m68k/m68k.h (BC_OUTPUT_BSS): Define.
- * mips/iris6.h (EXTRA_SECTIONS): Delete in_bss.
- * pa.h (EXTRA_SECTIONS): Delete in_bss.
- (EXTRA_SECTION_FUNCTIONS): Delete bss_section.
- * sparc/litecoff.h (EXTRA_SECTIONS): Delete in_bss.
-
-Wed Feb 28 14:12:25 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.h (FUNCTION_VALUE_REGNO_P, FUNCTION_ARG_REGNO_P): Include FP
- registers only when TARGET_SH3E.
- (PASS_IN_REG_P): Exclude BLKmode only when ! TARGET_SH3E.
-
-Wed Feb 28 12:03:26 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (rs6000_trampoline_{template,size}): Change Windows NT
- trampoline template so it doesn't require making stack executable.
- Add support for 64 bit systems.
- (rs6000_initialize_trampoline): Ditto.
-
-Tue Feb 27 16:42:00 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (print_operand): New code 'H'.
- * rs6000.md (insv, extzv): Add DImode patterns. Use 'h'
- consistently for masking SImode shifts.
- (rotldi3, ashldi3, lshrdi3, ashrdi3): Use 'H'.
- (movsf split): Generate CONST_INT instead of SUBREG.
-
-Tue Feb 27 15:02:17 1996 Doug Evans <dje@cygnus.com>
-
- * sh.h (HANDLE_PRAGMA): Delete `return'.
-
-Tue Feb 27 08:18:12 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.c (aof_text_section): Remove pseudo read-only hack. Doesn't
- take a parameter any more.
- * arm/aof.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove
- readonly data sections.
- (READONLYDATA_SECTION, READONLY_DATA_SECTION): Delete.
-
- * arm.h (enum arm_cond_code): New enum.
- (ARM_INVERSE_CONDITION_CODE): Moved here from arm.c.
- (SELECT_CC_MODE): Call arm_select_cc_mode to do the work.
- (PREDICATE_CODES): Add dominant_cc_register; delete
- reversible_cc_register.
- * arm.c (arm_current_cc): Now an enum.
- (ARM_INVERSE_CONDITION_CODE): Moved to arm.h
- (revsersible_cc_register): Delete.
- (dominant_cc_register): New function.
- (select_dominance_cc_mode): New function.
- (arm_select_cc_mode): New function.
- (output_return_instruction): New parameter REVERSE, used to
- reverse the condition of a conditional return. All callers
- changed.
- (arm_print_operand case 'D'): Only suppress condition printing
- if the operand is a NULL pointer.
- (get_arm_condition_code): Now a static function returning
- enum arm_cond_code. Handle dominance expressions. Return enum
- values rather than integers.
- * arm.md (*addsi3_compare0_scratch): New insn.
- (*movsi_compare0, *cmpsi_insn, *cmpsi_shiftsi): Make sure the
- compare has mode CC.
- (cmp{si,sf,df,xf} expands): Just provide sufficient information
- to allow the parameters to be matched properly.
- (*cmpsi_negsi): Delete (of dubious validity).
- (*cmpsi_shiftsi_swp): New pattern.
- (*condbranch_reversed): No longer needs to check REVERSIBLE_CC_MODE.
- (mov{si,sf,df}cc, *mov{si,sf,df}{,_hard,_soft}_insn): The mode of the
- IF_THEN_ELSE must be appropriate to the target (not void).
- (*and_scc): Match cc_register, not reversible_cc_register.
- (*ior_compare_compare): Delete.
- (split for ior_compare_compare + condjump): Delete.
- (*impossible_cond_compare): Delete.
- (*condition_compare_ior): Delete.
- (*cond_move): Mode for the IF_THEN_ELSE must be SImode.
- (*and_scc_scc): Delete.
- (split for and_scc_scc + condjump): Delete.
- (*impossible_cond_branch_and): Delete.
- (*cmp_ite0, *cmp_ite1): New patterns.
- (if_compare_not): Should be an anonymous pattern.
- (Peephole for move and compare): Compare mode must be mode CCmode.
- (Split pattern for comparing shifted reg then branch): Delete.
- (*loadqi_compare): Delete, replaced with a split pattern to do
- the same thing.
- (*cond_move_not): Match cc_register, not reversible_cc_register.
-
- * arm.c ({load,store}_multiple_sequence): New functions.
- (emit_{ldm,stm}_seq): New functions.
- * arm.md (load/store multiple peepholes): Rewrite using the above
- functions.
- (all patterns taking immediate_operand): If the code later assumes
- this is a CONST_INT, then match const_int_operand instead.
-
-Mon Feb 26 17:26:13 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.md: Add sparclet scheduling parameters.
- (compare define_insn's): Move closer to compare define_expand's.
- (32 bit multiply patterns): Use for TARGET_SPARCLET.
- (*smacsi,*smacdi,*umacdi): Multiply/accumulate patterns for the
- sparclet.
-
-Sat Feb 24 19:13:29 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (movsf split): Fix typo in last patch.
-
-Sat Feb 24 10:02:55 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * toplev.c (fatal_insn): Flush stdout/stderr.
-
-Sat Feb 24 02:03:28 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.md (abssi2): Rework to avoid matching constraints.
-
-Fri Feb 23 11:21:43 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (override_options): Warn if both PIC code generation and
- profiling are requested.
-
-Fri Feb 23 08:47:38 1996 Richard Kenner (kenner at vlsi1)
-
- * expr.c (expand_builtin, case BUILT_IN_SETJMP): Set CONST_CALL_P
- on NOTE_INSN_SETJMP instead of emitting USE insns for call-saved regs.
- * reload1.c (reload): For special CONST_CALL_P NOTE_INSN_SETJMP,
- mark all call-saved regs as used.
- * sched.c (sched_analyze): Record NOTE_INSN_SETJMP if no
- CALL_INSN as prev; preserve CONST_CALL_P bit.
- (reemit_notes): Restore CONST_CALL_P.
-
-Thu Feb 22 17:45:12 1996 Doug Evans <dje@cygnus.com>
-
- * configure (sparclet-*-aout*): Set extra_headers.
- * ginclude/inl-sparc.h: New file.
-
-Wed Feb 21 20:39:53 1996 Doug Evans <dje@cygnus.com>
-
- * configure (sparc64-*-solaris2*): Merge with sparc-*-solaris2*.
- * sparc.h (enum processor_type): Declare.
- (sparc_cpu_attr): Define.
- (TARGET_OPTIONS): Add -mtune=.
- (sparc_select): Declare.
- (sparc_cpu_string): Delete.
- (FIRST_PSEUDO_REGISTER): Set to 100.
- ({FIXED,CALL_USED}_REGISTERS): Merge !v9/v9 cases.
- (CONDITIONAL_REGISTER_USAGE): Mark %g5 as fixed if !v9.
- Mark %g1 as fixed if v9. Fix v9-only regs if !v9.
- Mark fp{16..47} as call-saved if v9.
- (enum reg_class): Merge !v9/v9 cases.
- (REG_CLASS_NAMES,REG_CLASS_CONTENTS,REGNO_REG_CLASS): Likewise.
- (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER,LEAF_REGISTERS): Likewise.
- (FP_REG_CLASS_P,SPARC_REGISTER_NAMES): Likewise.
- (REG_CLASS_FROM_LETTER): Test TARGET_V9 at runtime.
- * sparc.c (sparc_cpu_string): Delete.
- (sparc_select): New global.
- (sparc_override_options): Handle -mtune=xxx.
- * sparc.md (cpu attr): Add sparc{lite,let} implementations.
- * sparc/sp64-sol2.h: Deleted.
-
- * arm.md (consttable_end): Delete call to text_section.
- (align_4): Delete call to readonly_data_section.
-
-Wed Feb 21 14:29:06 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cplus-dem.c (demangle_template): Initialize is_bool. Correctly
- handle 0 as a pointer value parameter.
-
-Wed Feb 21 14:13:29 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * tree.c (decl_function_context): Do decl_function_context right for
- function-local classes.
-
-Wed Feb 21 12:42:52 1996 Jeffrey A. Law <law@cygnus.com>
-
- * c-typeck.c (initializer_constant_valid_p): Don't dereference
- a null pointer on partial structure initialization.
-
-Wed Feb 21 11:49:58 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (ASM_OUTPUT_EXTERNAL): Append section info
- even when verbatim symbol prefix '*' present.
- * rs6000/aix3newas.h (ASM_OUTPUT_EXTERNAL): Same.
- * rs6000/aix41.h (ASM_OUTPUT_EXTERNAL): Same.
- * rs6000/powerpc.h (ASM_OUTPUT_EXTERNAL): Same.
- * rs6000/win-nt.h (ASM_OUTPUT_EXTERNAL): Same.
-
-Wed Feb 21 03:55:32 1996 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (validate_else): Don't loop given `#endif /'.
- Handle multiple adjacent backslash-newlines correctly.
- Accept a new parameter LIMIT to specify end of input;
- this prevents confusion when the input contains '\0' characters.
- (collect_expansion): Fix off-by-1 error when searching for `*/'
- at end of a comment used for traditional token concatenation.
- (macarg1): Fix off-by-1 error when skipping past `*/'
- at end of comment.
-
-Tue Feb 20 16:12:31 1996 Doug Evans <dje@cygnus.com>
-
- * hard-reg-set.h (twice unrolled GO_IF_HARD_REG_EQUAL): Add missing \.
-
-Tue Feb 20 14:21:16 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (DBX_CONTIN_LENGTH): Define to 4000 characters.
-
- * pa.c (hppa_expand_epilogue): Always emit a blockage insn
- before cutting back the stack.
-
-Mon Feb 19 19:42:15 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * sparc.h (TARGET_SWITCHES): Add -m{,no-}impure-text.
- (MASK_IMPURE_TEXT, TARGET_IMPURE_TEXT): Define.
- (LINK_SPEC): Only add `-assert pure-text' if -mimpure-text wasn't used.
-
-Mon Feb 19 19:20:15 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * configure (sparc-aout): sparc-aout.h renamed to aout.h.
- (sparclet-aout): Likewise.
- (sparclite-*-aout*): Renamed from sparclite-*-*.
- Don't set use_collect2.
- (target_cpu_default): Set to TARGET_CPU_<cpu> for sparc.
-
- * sparc.h (TARGET_CPU_sparc{,let,lite,64}): Define.
- ({CPP,ASM}_DEFAULT_SPEC): Set from TARGET_CPU_foo.
- (SPARC_ARCH64 CPP_PREDEFINES): Define __arch64__.
- (CPP_SPEC): Add %(cpp_cpu).
- (CPP_CPU_SPEC): Define.
- (CC1_SPEC): Convert -m<cpu> to -mcpu=<cpu>.
- (ASM_SPEC): Add %(asm_cpu).
- (ASM_CPU_SPEC): Define.
- (EXTRA_SPECS,SUBTARGET_EXTRA_SPECS): Define.
- (OVERRIDE_OPTIONS): Call SUBTARGET_OVERRIDE_OPTIONS after
- sparc_override_options.
- ({MASK,TARGET}_SUPERSPARC): Delete.
- ({MASK,TARGET}_SPARCLET): Define.
- (MASK_ISA): Renamed from MASK_CPUS.
- (TARGET_SWITCHES): Delete no-{v8,sparclite}.
- (sparc_cpu,sparc_cpu_string): Declare.
- ({SUB,}TARGET_OPTIONS): Define.
- (FIXED_REGISTERS): Add definitions for sparc64 in 32 bit mode.
- (CONDITIONAL_REGISTER_USAGE): Don't set fixed_regs[234] if sparc64.
- Don't set call_used_regs[48..80] for sparc64 in 32 bit mode.
- Don't clobber fixed_regs[234] if -ffixed- was passed.
- (ADJUST_COST): Change test for supersparc.
- * sparc.c (sparc_cpu_string,sparc_cpu): New globals.
- (sparc_override_options): Set ISA and CPU from sparc_cpu_string.
- Delete tests for v9 only switches if not v9.
- Error if -mcpu=v9 and v9 support not compiled in.
- * sparc/sol2.h (CPP_SPEC): Use %(cpp_cpu).
- (ASM_SPEC): Likewise.
- (ASM_{DEFAULT,CPU}_SPEC): Use Solaris syntax for sparc64.
- * sparc/sysv4.h (ASM_SPEC): Add %(asm_cpu).
- * sparc/t-sparcbare (MULTILIB_*): -mv8 renamed to -mcpu=v8.
- * sparc/t-sparclite (MULTILIB_*): Delete msoft-float and mno-flat,
- they're the defaults. Add -mcpu=f934 as synonym for -mfpu.
- * va-sparc.h (__arch64__): Renamed from __sparc_v9__.
-
- * sparc/lite.h: #include aoutos.h.
- (TARGET_DEFAULT): Use MASK_FOO values.
- * sparc/sp64-aout.h: #include aoutos.h.
- (TARGET_DEFAULT): Add MASK_APP_REGS.
- (JUMP_TABLES_IN_TEXT_SECTION,READONLY_DATA_SECTION): Delete.
- * sparc/sp64-elf.h (TARGET_DEFAULT): Add MASK_APP_REGS.
- (CPP_PREDEFINES): Define __arch64__.
- * sparc/sp64-sol2.h (TARGET_DEFAULT, SUBTARGET_SWITCHES): Delete.
- (ASM_SPEC): Delete.
-
- * sparc.h ({MASK,TARGET}_FRW): Delete.
- (FRAME_POINTER_REQUIRED,INITIAL_FRAME_POINTER_OFFSET,
- BASE_{INCOMING_ARG,OUTGOING_VALUE}_REG,INCOMING_REGNO,OUTGOING_REGNO,
- FUNCTION_{PROLOGUE,EPILOGUE},DELAY_SLOTS_FOR_EPILOGUE): TARGET_FRW
- renamed to TARGET_FLAT.
-
- * sparc.md (cpu attr): Add all cpu variants.
- (negtf2,negdf2,abstf2,absdf2): Use isa attr, not arch attr, in
- determining insn lengths.
-
- * sparc/aout.h: Renamed from sparc-aout.h.
- (CPP_PREDEFINES): Delete __GCC_NEW_VARARGS__.
- Add -Acpu(sparc) -Amachine(sparc).
-
-Mon Feb 19 17:49:08 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (movsf split): Use SUBREG, not operand_subword.
- (movdf split): operand_subword TARGET_32BIT and new split using
- SUBREG for TARGET_64BIT.
- * rs6000.c (easy_fp_constant): Rewrite to not use operand_subword.
- (input_operand): Remove final add_operand test made irrelevant by
- Dec. 8 change.
- (output_toc): Handle DImode values.
-
-Mon Feb 19 13:38:00 1996 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * i386/sol2.h (SWITCH_TAKES_ARG): Restore -R.
- * sparc/sol2.h (SWITCH_TAKES_ARG): Likewise.
-
-Mon Feb 19 08:19:00 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * hard-reg-set.h (HARD_REG macros): If more than
- HOST_BITS_PER_WIDE_INT hard registers and less than or equal to
- 4*HOST_BITS_PER_WIDE_INT hard registers, unroll loops by hand.
-
-Mon Feb 19 07:35:07 1996 Torbjorn Granlund <tege@tmg.se>
-
- * rs6000.md (not:SI with assign and compare): Fix typo.
- (not:DI with assign and compare): Likewise.
-
-Mon Feb 19 07:17:25 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sparc.md (nonlocal_goto): No longer need USE of %o0.
- (goto_handler_and_restore): Show uses %o0.
-
- * combine.c (force_to_mode, case IOR): Fix typo in commuting
- IOR and LSHIFTRT.
-
- * alpha.c (call_operand): If in REG, only reg 27 valid.
-
-Mon Feb 19 06:57:34 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * emit-rtl.c (operand_subword): For 32-bit targets, return
- the appropriate subword of extended precision CONST_DOUBLEs.
-
- * arm.c (offsettable_memory_operand): New function.
- (alignable_memory_operand): New function.
- (gen_rotated_half_load): New function.
- (get_arm_condition_code): Extract the mode of the comparison and
- use it to generate the correct return value.
- * arm.h (EXTRA_CC_MODES, EXTRA_CC_NAMES): Add CC_Zmode.
- (SELECT_CC_MODE): return CC_Zmode if the operand is QImode. Allow LT
- and GE comparisons in CC_NOOVmode.
- (PREDICATE_CODES): add offsettable_memory_operand and
- alignable_memory_operand.
- * arm.md (*zeroextract[qs]i_compare0_scratch): Use const_int_operand
- for operands 1 and 2.
- (split patterns for aligned memory half-word operations): New patterns.
- (movhi): Handle memory accesses where the alignment is known in a more
- efficient manner.
- (*compareqi_eq0): Use CC_Zmode.
-
-Mon Feb 19 05:34:08 1996 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * toplev.c (lang_options): Add -W{no-,}sign-compare.
-
- * c-tree.h: Declare warn_sign_compare.
-
- * c-typeck.c (build_binary_op): Check warn_sign_compare rather
- than extra_warnings to decide whether to warn about comparison of
- signed and unsigned.
-
- * c-decl.c (c_decode_option): Handle warn_sign_compare. -Wall
- implies -Wsign-compare.
-
-Sun Feb 18 21:13:44 1996 Pat Rankin (rankin@eql.caltech.edu)
-
- * c-lex.c (yylex, case '0'..'9','.'): For cases '0' and '1',
- check for single digit constant before resorting to general
- number processing.
-
-Sun Feb 18 19:29:44 1996 J.T. Conklin <jtc@netbsd.org>
-
- * m68k.h (TARGET_68060): New macro.
- (TARGET_SWITCHES): Add -m68060.
- * m68k.md (const_umulsi3_highpart): Disable for TARGET_M68060.
- (ftruncdf2, ftruncsf2, muldf3, mulsidi3): Likewise.
- (smulsi3_highpart, umulsi3_highpart, umulsidi3): Likewise.
-
- * {m68k,ns32k,sparc}/netbsd.h (DBX_NO_XREFS): Removed.
-
-Sun Feb 18 13:29:56 1996 Charles M. Hannum (mycroft@netbsd.org)
-
- * c-common.c (check_format_info): Warn about `L' if -pedantic.
-
-Fri Feb 16 20:13:23 1996 Paul Eggert <eggert@twinsun.com>
-
- * c-typeck.c (convert_for_assignment):
- Bring back conversion to union without a cast,
- undoing the Jan 16 change, but with the following differences:
- - The union must have the transparent_union attribute.
- - The conversion must be for a function argument.
- - Warn consistently about such conversions if pedantic.
- - Do not warn about an assignment incompatibility for one union member
- if another union member is compatible with no warning.
-
-Fri Feb 16 12:06:21 1996 Stan Cox <coxs@spiff.gnu.ai.mit.edu>
-
- * i386.c (ix86_*_binary_operator*): Allow CONST_INT as operand1
- of MINUS.
- * i386/dgux.h (OPTIMIZATION_OPTIONS): Call optimization_options.
-
-Fri Feb 16 08:39:47 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure: Change stdout report when have multiple files in
- tm_file, host_xm_file, or build_xm_file.
- (a29k-*-bsd): Use both a29k.h and unix.h.
- (a29k-*-udi): Rename a29k-udi.h to udi.h;
- use a29k.h, dbxcoff.h, and it.
- (a29k-*-vxworks): Use a29k.h, dbxcoff.h, a29k/udi.h, and a29k/vx29k.h.
- (alpha-dec-osf[23456789]*): Use alpha.h, not osf2.h.
- (alpha-dec-osf1.2): Use alpha.h and alpha/osf12.h.
- (alpha-*-osf*): Add explicit assignment of tm_file.
- * a29k/udi.h: Renamed from a29k-udi.h.
- Don't include a29k.h or dbxcoff.h.
- * a29k/unix.h: Don't include a29k.h.
- * a29k/vx29k.h: Don't include a29k-udi.h.
- * alpha.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Use unsigned int.
- * alpha/osf2.h: Deleted.
- * alpha/osf12.h: Don't include alpha.h.
- (WCHAR_TYPE, WCHAR_TYPE_SIZE): Use short unsigned int.
- * alpha/win-nt.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Use short unsigned int.
-
-Thu Feb 15 18:26:04 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/ntstack.asm (__allocate_stack): Round up length to 16
- byte boundary.
-
- * rs6000.md (allocate_stack): On Windows NT, call set_sp to
- indicate to CSE stack pointer changes with call to __allocate_stack.
- (set_sp): New pattern.
-
-Thu Feb 15 16:49:15 1996 Jim Wilson <wilson@cygnus.com>
-
- * integrate.c (save_for_inline_copying): Allocate reg_map with size
- based on regno_pointer_flag_length instead of max_reg+1.
-
-Thu Feb 15 07:48:34 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fixincludes (rpc/types.h): Remove spurious "ls" command.
-
- * reload1.c (eliminate_regs, case USE): If using a register that
- is source of elimination, show can't be eliminated.
-
- * expr.c (expand_builtin, case BUILT_IN_SETJMP): Shows clobbers FP
- and all caller-save registers.
- Set current_function_has_nonlocal_goto.
-
-Wed Feb 14 13:51:55 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (fix_truncdfsi2): Use SUBREG not operand_subword.
- (movdi): Test HOST_BITS_PER_WIDE_INT at build time.
- * collect2.c (scan_libraries): Append '/' to import path if missing.
-
-Wed Feb 14 09:01:55 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (movdi): Use HOST_WIDE_INT, not long long.
-
-Tue Feb 13 19:36:21 1996 Per Bothner <bothner@cygnus.com>
-
- * expr.c (store_constructor): Fix flow control thinko (merge error).
- * expr.c (store_constructor): Pass correct value to recursive call.
-
-Wed Jan 31 11:34:45 1996 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_expr, case TARGET_EXPR): We must always store
- into the allocated slot for TAREGT_EXPRs.
-
-Tue Feb 13 18:27:05 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * configure (powerpc-ibm-aix3): Look for 3.2.x, not 3.2x.
-
- * fixincludes (memory.h): Fix it also on sysV68.
-
-Tue Feb 13 17:59:03 1996 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * gcc.c (DEFAULT_SWITCH_TAKES_ARG): New macro, from SWITCH_TAKES_ARG.
- (SWITCH_TAKES_ARG): Use it.
- * i386/{osfrose,sol2}.h (SWITCH_TAKES_ARG): Likewise.
- * mips/{gnu,mips}.h (SWITCH_TAKES_ARG): Likewise.
- * sparc/sol2.h (SWITCH_TAKES_ARG): Likewise.
- * config/svr4.h (SWITCH_TAKES_ARG): Likewise.
-
-Tue Feb 13 17:43:46 1996 Jim Wilson <wilson@cygnus.com>
-
- * integrate.c (save_constants_in_decl_trees): New function.
- (save_for_inline_copying, save_for_inline_nocopy): Call it.
-
-Tue Feb 13 17:40:27 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (convert_move): Fix typo in extendqfh2 case.
-
- * reload1.c (reload): Make some non-group code no longer
- conditional on SMALL_REGISTER_CLASSES.
-
-Tue Feb 13 17:30:45 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * pdp11.c: #include flags.h
- (output_function_prologue, function_epilogue): Remove declarations
- of call_used_regs and frame_pointer_needed.
-
- * c-common.c (overflow_warning): Fix typo in warning message.
-
- * c-decl.c (finish_decl): TREE_ASM_WRITTEN says if duplicate_decls
- modified declaration to match an outside file scope declaration.
-
- * stmt.c (expand_end_case): Don't use ADDR_DIFF_VEC for PIC if
- ASM_OUTPUT_ADDR_DIFF_ELT is not defined.
- * a29k.h, romp.h (ASM_OUTPUT_ADDR_DIFF_ELT): Remove.
-
-Tue Feb 13 13:36:36 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/cygwin32.h (CPP_PREDEFINES): Do not define PPC, just
- define __PPC__. Also define _ARCH_PPC to be compatible with the
- other rs6000/powerpc ports.
- * rs6000/win-nt.h (CPP_PREDEFINES): Ditto.
-
- * rs6000/cygwin32.h (LIBGCC_SPEC): Don't define, always link in.
- (SDB_DEBUGGING_INFO): Undef.
- (DBX_DEBUGGING_INFO): Define.
- (PREFERRED_DEBUGGING_TYPE): Define as DBX_DEBUG.
-
- * rs6000/t-{cygwin32,winnt} (MULTILIB*): Remove multilib support.
-
- * rs6000/x-cygwin32 (LANGUAGES): Delete, don't override.
-
- * rs6000/ntstack.asm: New file to provide __allocate_stack, which
- guarantees all pages in a dynamically allocated stack frame are
- touched in order, so that the stack is properly grown.
-
- * rs6000/cgywin32.asm: Delete unused file.
-
- * rs6000/t-{cygwin32,winnt} (LIB2FUNCS_EXTRA): Add ntstack.S
- to libgcc2 build.
-
- * rs6000.md (allocate_stack): For NT, call __allocate_stack to
- bump the stack if the size is large or variable.
-
- * libgcc1-test.c (mainCRTStartup,__start): New startup functions
- to silence more linkers.
-
-Tue Feb 13 13:30:53 1996 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (store_constructor_field): Only call change_address if
- bitpos is nonzero.
-
-Tue Feb 13 08:21:01 1996 Fila Kolodny <fila@ibi.com>
-
- * i370/mvs.h (CPP_SPEC): Add '-trigraphs' because IBM's h files
- contain them.
-
-Tue Feb 13 08:17:52 1996 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-
- * c-typeck.c (quality_type prototype): Typo, rename as
- qualify_type.
- (build_binary_op): Fix precedence errors.
- * combine.c (force_to_mode, num_sign_bit_copies, simplify_comparison):
- Fix precedence errors.
- * emit-rtl.c (gen_lowpart): Could return without a value.
- * jump.c (jump_optimize): Fix potential infinite loop.
- * reg-stack.c (record_reg_life_pat): Fix precedence error.
- * reload1.c (emit_reload_insns): Fix precedence errors.
- * stmt.c (bc_pushcase): Fix precedence error.
-
-Mon Feb 12 23:14:02 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_compilation): Also set RTX_INTEGRATED_P when
- we aren't going to emit the inline just yet.
-
-Mon Feb 12 21:31:02 1996 Jim Wilson <wilson@cygnus.com>
-
- * rtl.h (INLINE_REGNO_POINTER_FLAG, INLINE_REGNO_POINTER_ALIGN):
- Add one to array index.
-
-Mon Feb 12 20:55:39 1996 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * configure (i[345]86-*-linux*): Set tmake_file t-linux.
- Add crtbeginS.o and crtendS.o to extra_parts.
- * i386/linux.h (CC1, LIB_SPEC): Deleted.
- * config/linux.h (STARTFILE_SPEC): Add crtbeginS.o if -shared.
- (CC1_SPEC): New.
- (LIB_SPEC): Remove %{mieee-fp:-lieee}; use -lc_p for -profile.
- * config/t-linux: New file.
-
-Mon Feb 12 20:42:11 1996 Randy Smith <randys@camaro.osf.org>
-
- * i386/x-osfrose (XCFLAGS{,_NODEBUG}): Remove $(SHLIB).
- (XCFLAGS): New variable.
- (libdir, mandir, bindir): Delete.
- * i386/t-osf: New file.
- * i860/paragon.h (STARTFILE_SPEC): Make gcc find crt0.o, not loader.
- (LIB_SPEC): Remove /usr/lib.
- * Makefile.in (TCFLAGS): New variable.
- (GCC_CFLAGS): Add $(TCFLAGS).
- (LIBGCC2_CFLAGS): Add -D for __GCC_FLOAT_NOT_NEEDED.
- (libgcc1-test): Remove -nostdlib.
- (float.h-cross): Don't give error #ifdef __GCC_FLOAT_NOT_NEEDED.
- * enquire.c: Define __GCC_FLOAT_NOT_NEEEDED.
- * configure (i[3456]86-*-osfrose): Add t-osf as tmake_file.
-
-Mon Feb 12 18:43:54 1996 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.c (add_1_to_mem): Corrected.
-
-Mon Feb 12 18:23:35 1996 Doug Evans <dje@cygnus.com>
-
- * configure (sparclet-*-aout*): New configuration.
-
-Mon Feb 12 14:43:50 1996 Per Bothner <bothner@cygnus.com>
-
- Changes to distinguish typedef from original type in debug output.
- * tree.h (DECL_ORIGINAL_TYPE): New macro.
- * tree.c (copy_node): Zero out type.symtab union.
- * c-decl.c (pushdecl): Set DECL_ORIGINAL_TYPE for typedef origin.
- * dbxout,c (dbxout_type): Don't canonicalize typedef type to base.
-
-Mon Feb 12 12:01:16 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.h: (CPP_SPEC): Define __ARMEB__, __ARMEL__, and
- __ARMWEL__ depending on the endian flags passed to the compiler.
- (ARM_FLAG_LITTLE_WORDS): Define.
- (TARGET_SWITCHES): Add option -mwords-little-endian.
- (TARGET_LITTLE_WORDS): Define.
- (WORDS_BIG_ENDIAN): Select based on the endian switches.
- (LIBGCC2_WORDS_BIG_ENDIAN): Define based on run-time endian
- defines.
- * arm.c (output_move_double): Cope with both word-endian
- alternatives. Remove extraneous parameters from calls to
- output_mov_immediate.
- (arm_print_operand): New print code 'Q' for the least significant
- register of a DImode operand. Make code 'R' always print the
- most significant register, rather than the highest numbered.
- * arm.md (all DImode output patterns): Use print code
- 'Q' to access the least significant word. Make sure the
- patterns are fully aware of the word endianness.
-
- * arm/semi.h (CPP_SPEC): Define __ARMEB__, __ARMEL__, and
- __ARMWEL__ depending on the endian flags passed to the compiler.
- (LINK_SPEC): Pass -EB to the linker if compiling for big-endian
- mode.
- (ASM_SPEC): Likewise for the assembler.
- * arm/semiaof.h (CPP_SPEC): Define __ARMEB__, __ARMEL__, and
- __ARMWEL__ depending on the endian flags passed to the compiler.
-
-Mon Feb 12 10:15:29 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure: Permit tm_file and xm_file to be a list of header
- file names, rather than just a single file. For many targets,
- handle --with-stabs by adding dbx.h to tm_file, rather than using
- a different tm_file.
- * dbx.h: New file.
- * alpha/gdb-osf2.h, alpha/gdb-osf12.h, alpha/gdb.h: Deleted.
- * i386/sysv4gdb.h, mips/iris{5gdb,4gl,4gdb,3gdb}.h: Likewise.
- * mips/dec-gosf1.h, mips/news{4,5}-gdb.h, mips/svr4-t-gdb.h: Likewise.
- * mips/ultrix-gdb.h, mips/bsd-{4,5}-gdb.h: Likewise.
- * mips/svr{4-5,4-4,3-5,3-4}-gdb.h, mips/mips-5-gdb.h: Likewise.
- * mips/ecoff{,l}-gdb.h, mips/mips-4-gdb.h: Likewise.
-
-Mon Feb 12 07:22:20 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * integrate.c (save_for_inline_copying): Put virtual regs into
- new regno_reg_rtx copy.
-
-Sun Feb 11 18:53:12 1996 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * i386.md: Delete spurious integer subtract patterns.
- Delete % from subtract operand constraints.
-
-Sun Feb 11 19:17:24 1996 Jeffrey A. Law <law@cygnus.com>
-
- * m68k.md (movqi): Call CC_STATUS_INIT when loading to/from
- an address register via a data register.
-
-Sun Feb 11 08:44:49 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-common.c (check_format_info): Handle missing type in format
- when terminated by a new `%'.
-
-Sat Feb 10 15:14:22 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * cross-make (STMP_FIXPROTO): Moved from here to build-make.
- * build-make (STMP_FIXPROTO): Moved here from cross-make.
-
-Sat Feb 10 08:39:05 1996 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.md (movstrqi): Corrected.
- (zero_extendqihi2): Taken out, let GCC synthesize.
- (movhi-1): Added insn to move HImode small constant to memory.
- (movhf-1): Added insn to move HFmode zero to memory.
- (movtqf-1): Added insn to move TQFmode zero to memory.
- (numerous insns): Taken out B (Base Reg with Index) mode.
-
- * 1750a.c (movcnt_regno_adjust): Corrected.
- (mov_memory_operand, zero_operand): Added.
- (b_mode_operand): Corrected.
- (simple_memory_operand, add_1_to_mem): Added.
- (print_operand_address): Corrected case of 'Q' output modifier.
-
- * 1750a.h (REG_ALLOC_ORDER): Changed back to natural order.
- (CONST_DOUBLE_OK_FOR_LETTER_P): Added letter 'G'.
- (EXIT_IGNORE_STACK): Set to 0.
- (REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Use corresponding REGNO_OK.
- (MOVE_MAX, MOVE_RATIO): Defined.
-
-Sat Feb 10 08:28:12 1996 Martin Anantharaman <martin@goofy.imech.uni-duisburg.de>
-
- * configure (m68k-*-psos*): New configuration.
- * psos.h: New file.
- * m68k/m68k-psos.h: New file.
-
-Sat Feb 10 08:07:52 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sched.c (flush_pending_lists): Add new arg, ONLY_WRITE.
- (sched_analyze_{1,2,insn}): Add new arg to flush_pending_lists.
- (sched_analyze): Always flush pending write list for call, even const.
-
- * integrate.c (save_for_inline_copying): Put reg_map in function's
- maybepermanent obstack instead of using alloca; set regno_reg_rtx
- to it; delete recently-added copying of this later.
-
-Sat Feb 10 00:49:58 1996 Doug Evans <dje@cygnus.com>
-
- * sched.c (add_dependence): Add test for next != CODE_LABEL.
-
-Fri Feb 9 16:10:04 1996 Stan Cox (coxs@dg-rtp.dg.com)
-
- * i386.md (fp, integer): Added function units for pentium.
- (cmp*,mov*,add*,sub*,mul*,div*,extend*,trunc*,and*,ior*,xor*,neg*,
- abs*,sqrt*,sin*,cos*,not*,ash*,lsh*,rot*,sub): Tightened constraints,
- added attribute support, and made changes for new `binary' and
- `unary' functions.
-
- * i386.c (processor_costs): New variable.
- (optimization_options, ix86_expand_binary_operator,
- ix86_binary_operator_ok, ix86_expand_unary_operator,
- ix86_unary_operator_ok, is_mul, is_div, copy_all_rtx, rewrite_address,
- last_to_set_cc, doesnt_st_condition_code, sets_condition_code,
- str_immediate_operand, is_fp_insn, is_fp_dest, is_fp_store,
- agi_dependent, reg_mentioned_in_mem): New functions.
-
- * i386.h (OPTIMIZATION_OPTIONS, ALIGN_DFmode, IS_STACK_MODE,
- IX86_EXPAND_BINARY_OPERATOR): New macros.
- (RTX_COSTS, REGISTER_MOVE_COST, ADJUST_BLOCKAGE) Changed for pentium.
-
-Fri Feb 9 14:47:27 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.c (sp64_medium_pic_operand): New function.
- (move_pic_label): Delete.
- (legitimize_pic_address): Simplify using some named patterns.
- (finalize_pic): Add preliminary sparc64 support.
- (emit_move_sequence): Reorganize.
- * sparc.md (pic_lo_sum_si,pic_sethi_si,get_pc_sp32,get_pc_sp64,
- move_pic_label_si,move_label_di,sethi_di_sp64): Make named patterns.
- (sethi_di_sp64_const,sethi_di_medium_pic): New anonymous patterns.
- (move_pic_label_si,move_label_di): Optimize for near labels.
- (tablejump): Use for TARGET_MEDANY.
- (casesi): Delete.
-
-Fri Feb 9 13:48:45 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (probe+2, probe+4): New conditional move patterns.
- (movsicc): Don't truncate comparison if it is DImode.
-
- * sh.h (CPP_SPEC): Add defines for -m1, -m2, and -m3.
-
-Fri Feb 9 09:11:28 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * toplev.c (rest_of_compilation): Set RTX_INTEGRATED_P in
- INLINE_HEADER iff function is inlineable.
- * calls.c (expand_call): Test RTX_INTEGRATED_P in DECL_SAVED_INSNS.
-
-Thu Feb 8 01:11:15 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.md (floatunssisf2 expander): Don't use "general_operand".
- (floatunssidf2 expander): Likewise.
-
-Wed Feb 7 16:59:31 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/{sysv4,win-nt,netware,cygwin32}.h ({ASM,LINK}_SPEC):
- Don't use %{V} for either linker or assembler.
-
-Tue Feb 6 17:22:29 1996 Per Bothner <bothner@cygnus.com>
-
- * dbxout.c (dbxout_range_type): Emit non-range INTEGER_TYPE
- as a sub-range of itself (so gdb can tell the difference).
-
-Tue Feb 6 17:01:44 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (addsi3 and adddi3 split): Use cleaner computation
- and portable HOST_WIDE_INT.
- (iordi3 split): Use HOST_WIDE_INT.
- (movdi): Add TARGET_64BIT support and generate 64 bit constants.
- (movdi matcher, TARGET_POWERPC64): Add immediate constraint handled
- by new define_split.
- (allocate_stack): Use TARGET_32BIT.
- (tablejump): Add TARGET_64BIT support using ...
- (tablejumpsi): Rename original tablejump pattern.
- (tablejumpdi): New pattern.
-
-Tue Feb 6 15:29:22 1996 Per Bothner <bothner@cygnus.com>
-
- * stor-layout.c (layout_type): Use same code to layout CHAR_TYPE
- as for INTEGER_TYPE (instead of hard-wiring in QImode).
-
-Tue Feb 6 15:13:38 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.md (various patterns): Avoid using "general operand" in
- define_insn patterns.
-
-Sun Feb 4 21:37:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi{,sim}.h (LINK_START_SPEC): Bump the default start address
- for the simulator to 0x10000074 so that we don't waste a page in the
- linked file.
-
-Fri Feb 2 19:44:10 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi-c{i,n}.asm (.sdata2, .sbss2): Put these in the
- read-only section, not read-write.
-
- * libgcc2.c (__unwind_function, rs6000/powerpc): Use _ARCH_PPC
- being defined to indicate to use PowerPC mnemonics.
-
- * config/rs6000/t-cygwin32 (MULTILIB*): Add software floating
- point support.
-
-Thu Feb 1 09:10:02 1996 Steve Chamberlain <sac@slash.cygnus.com>
-
- * {i386,rs6000}/cygwin32.{asm,h}: New templates.
- * {i386,rs6000}/{t,x}-cygwin32: Ditto.
- * {i386,rs6000}/xm-cygwin32.h: Ditto.
- * configure (powerpcle-*-cygwin32, i[3456]86-*-cygwin32): New.
-
-Fri Feb 2 17:42:40 1996 Paul Eggert <eggert@twinsun.com>
-
- * c-decl.c (finish_struct):
- Fix typo in transparent union warning that led to core dump.
-
- * c-parse.in (stmt): Warn about `goto *expr;' if pedantic.
- (label): Warn about `case expr ... expr:' if pedantic.
-
-Fri Feb 2 11:05:27 1996 Doug Evans <dje@cygnus.com>
-
- * h8300.h (TARGET_ALIGN_300): Renamed from TARGET_ALIGN_STRUCT_300.
- (TARGET_SWITCHES): Rename -malign-struct-300 to -malign-300.
- (BIGGEST_ALIGNMENT): Use TARGET_ALIGN_300.
-
-Fri Feb 2 08:25:49 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * flow.c (jmp_uses_reg_or_mem): Renamed from uses_reg_or_mem.
- Don't look into condition of an IF_THEN_ELSE; also make faster.
- (find_basic_blocks): Use new name.
-
-Fri Feb 2 06:49:56 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * reload.c (debug_reload): Fix typo for reload_noncombine.
-
-Thu Feb 1 21:49:02 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa-pro.h (TARGET_DEFAULT): Turn on TARGET_SOFT_FLOAT by
- default for all pro targets.
- * t-pro: Delete all multilib references.
-
-Thu Feb 1 17:50:02 1996 Doug Evans <dje@cygnus.com>
-
- * c-lex.c (check_newline): Return result of HANDLE_PRAGMA.
- * h8300.h (HANDLE_PRAGMA): Pass result back to caller.
- * i960/i960.h (HANDLE_PRAGMA): Likewise.
- * sh.h (HANDLE_PRAGMA): Likewise.
- * nextstep.h (HANDLE_PRAGMA): Likewise.
-
-Wed Jan 31 19:26:03 1996 Doug Evans <dje@cygnus.com>
-
- * m68k/m68k-none.h: Rewrite to use EXTRA_SPECS.
- * m68k/vxm68k.h (CPP_SPEC): Delete.
- (SUBTARGET_EXTRA_SPECS): Define.
-
-Wed Jan 31 15:10:59 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (output_epilog): Fix PPC64 typos and use TARGET_32BIT.
- (output_prolog): Same.
- (rs6000_trampoline_template, rs6000_trampoline_size): Use TARGET_32BIT.
- * rs6000.md (movdf TARGET_POWERPC64 matcher): Fix std typo.
- (movdi TARGET_POWERPC64 matcher): Same.
-
-Wed Jan 31 09:46:11 1996 Richard Earnshaw (rearnshaw@armltd.co.uk)
-
- * regs.h (regno_pointer_align, REGNO_POINTER_ALIGN): Delete from here.
- * rtl.h (regno_pointer_align, REGNO_POINTER_ALIGN): Put them here.
-
-Wed Jan 31 08:26:12 1996 Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
-
- * m68k/linux.h (STRICT_ALIGNMENT): Define to zero.
- (LEGITIMATE_PIC_OPERAND_P): Match definition from m68kv4.h.
-
- * m68k.h (TRAMPOLINE_{TEMPLATE,SIZE}): Avoid need for helper function.
- (INITIALIZE_TRAMPOLINE): Likewise.
- (TRAMPOLINE_ALIGNMENT): Renamed from TRAMPOLINE_ALIGN.
- * m68k/next.h (INITIALIZE_TRAMPOLINE): Adjusted accordingly.
-
- * m68kv4.h (STATIC_CHAIN_REGNUM): Redefine to use register a1.
- (TRAMPOLINE_TEMPLATE): Likewise.
-
- * m68k/linux.h, m68kv4.h (LIBCALL_VALUE): Return XFmode value in fp0.
- * m68k.c (init_68881_table): Use SFmode for the first six
- constants and DFmode for the seventh.
-
- * m68k.md (movqi): Use moveq if possible.
-
-Wed Jan 31 08:18:15 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_builtin, case BUILT_IN_NEXT_ARG): Strip off
- INDIRECT_REF when checking second arg.
-
- * calls.c (struct arg_data, expand_call): Test STRICT_ALIGN with #if.
-
-Wed Jan 31 07:47:56 1996 Tim Wright (timw@sequent.com)
-
- * configure (i[345]-sequent-sysv*): Change to sysv3*; add i686.
- (i[3456]86-sequent-ptx4*, i[3456]86-sequent-sysv4*): New cases.
- * fixinc.ptx (sys/mc_param.h): Remove embedded asm.
- * fixinc.svr4 (__STDC__): Add one more case.
- * i386/ptx4-i.h, ptx4.h: New files.
-
-Wed Jan 31 07:15:23 1996 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.h (MACHINE_STATE_{SAVE,RESTORE}): Allow MOTOROLA syntax.
-
- * m68k.md ({adddi,subdi}_sexthishl32): 'a' and 'd' versions merged
- and fixed; do not generate 'add/sub a,m'.
-
- * gcc.c (warn_std_ptr): Initialize with 0 instead of NULL_PTR.
-
-Tue Jan 30 13:29:05 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxout.c: Don't include <string.h>.
- Don't compare strchr result to NULL.
-
- * config/svr4.h (ASM_FINAL_SPEC): Use %|, not ${pipe:-}.
-
-Tue Jan 30 06:48:43 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (nonzero_bits, case REG): Ignore REG_POINTER_ALIGNMENT.
- Restore old code for SP, but use it for all pointers to
- defined locations in the frame.
-
-Mon Jan 29 11:25:28 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxout.c (dbxout_type_methods): Don't use #ifndef inside call to
- strchr.
-
-Sun Jan 28 14:44:09 1996 Doug Evans <dje@cygnus.com>
-
- * config/dbxcoff.h (*): #undef first.
-
-Sat Jan 27 21:46:16 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (rs6000_sync_trampoline): Add cmpdi to 64bit case.
- (rs6000_initialize_trampoline): CSE of Pmode to pmode.
- * rs6000.md (movdf): Handle move between FPR and 64 bit GPR.
- (movdi matcher): Handle SPR move to itself and add "mr." combiner.
-
-Sat Jan 27 10:06:31 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Redefine, put small
- data items in .sbss if -msdata.
- (SWITCH_TAKES_ARG): Add 'B', 'b', and 'V'.
-
-Sat Jan 27 07:59:25 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.h (enum built_in_function): Add BUILT_IN_{SET,LONG}JMP.
- * expr.c: Include hard-reg-set.h.
- (arg_pointer_save_area): New declaration.
- (expand_builtin, case BUILT_IN_{SET,LONG}JMP): New cases.
- * Makefile.in (expr.o): Includes hard-reg-set.h.
- * c-decl.c (init_decl_processing): Add definitions for
- __builtin_setjmp and __builtin_longjmp.
- * cccp.c (initialize_builtins): Add def of __HAVE_BUILTIN_SETJMP__.
-
- * expr.c (expand_expr, case COMPONENT_REF): Pass EXPAND_INITIALIZER
- to recursive call.
-
-Fri Jan 26 17:24:07 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.h (sparc_arch_type): Delete.
- ({,TARGET_}MASK_DEPRECATED_V8_INSNS): Define.
- (ARCH64_SWITCHES): Renamed from V9_SWITCHES.
- * sparc.c (sparc_arch_type): Delete.
- (sparc_init_modes): Likewise.
- (output_move_quad): Don't use ldq/stq unless TARGET_HARD_QUAD.
- * sparc/sp64-sol2.h (TARGET_DEFAULT): Add MASK_DEPRECATED_V8_INSNS.
- (SUBTARGET_SWITCHES): Add -m{no-,}deprecated-v8-insns.
- * sparc.md (arch attribute): Rewrite.
- (isa): New attribute.
- (32 bit multiply/divide patterns): Use if TARGET_DEPRECATED_V8_INSNS.
- (32 bit divide patterns): V9 doesn't require delay after y reg write.
-
-Fri Jan 26 12:08:43 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (TARGET_32BIT): Define.
- (BITS_PER_WORD, UNITS_PER_WORD): Invert so 32bit expected case.
- (LONG_TYPE_SIZE, POINTER_BOUNDARY, PARM_BOUNDARY): Likewise.
- (RS6000_REG_SAVE, RS6000_SAVE_AREA, RS6000_VARARGS_SIZE): Likewise.
- (RETURN_ADDRESS_OFFSET, CASE_VECTOR_MODE, MOVE_MAX): Likewise.
- (Pmode, FUNCTION_MODE): Likewise.
- (LEGITIMATE_OFFSET_ADDRESS_P): Handle TARGET_64BIT.
- (GO_IF_LEGITIMATE_ADDRESS, LEGITIMIZE_ADDRESS): Likewise.
- (GO_IF_MODE_DEPENDENT_ADDRESS): Same.
-
-Fri Jan 26 10:37:52 1996 Stan Coxs <coxs@dg-rtp.dg.com>
-
- * m88k.md (umulsidi3): Added for the 88110
-
-Fri Jan 26 09:35:42 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (STRIP_NAME_ENCODING): Deal with names that have
- both @ and * prefix characters.
- (ASM_OUTPUT_LABELREF): Ditto.
-
-Thu Jan 25 10:03:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (LEGITIMIZE_ADDRESS): Rewrite to use HOST_WIDE_INT, not
- plain int.
- (optimize,flag_expensive_optimizations): Provide declaration for
- expander functions.
-
- * rs6000.md (movsi): Correct code in splitting an address into
- load from the TOC, and add low/high integer parts. If expensive
- optimizations, and reload hasn't started, use separate pseudo regs
- for each step.
-
- * rs6000.c (small_data_operand): Don't use the function
- eliminate_constant_term, unwind code directly.
- (input_operand): SYMBOL_REF/CONST of small data operand is valid.
- (print_{,address_}operand): Add @sda21(0) in appropriate cases for
- small data.
- %L, etc. so that if the item is in small memory, the appropriate
- relocation is used.
- (rs6000_select{,_rtx}_section): Don't put floating point constants
- or small strings in .sdata2 since we can't tell from the pointer
- whether it is in the small data area or not.
-
- * rs6000.h (EXTRA_CONSTRAINT): Add 'U' for small data references.
- (LEGITIMATE_SMALL_DATA_P): Test explicitly for SYMBOL_REF or CONST
- before calling small_data_operand.
-
- * rs6000.md (movsi): Handle the addresses of small data items.
-
- * rs6000/sysv4.h (g_switch_{value,set}): Add declarations.
- (SDATA_DEFAULT_SIZE): Default to 8.
- (SUBTARGET_OVERRIDE_OPTIONS): If -G was not set, set it to
- SDATA_DEFAULT_SIZE.
- (CC1_SPEC): Pass -G nn to the compilers.
- (SWITCH_TAKES_ARG): Add -G nn support.
- (LINK_SPEC): Pass -G nn to the linker.
-
-Thu Jan 25 09:16:34 1996 Doug Evans <dje@cygnus.com>
-
- * configure (sparc64-*-solaris2*): New target.
- * sparc.h (SPARC_{V9,ARCH64}): Default value is 0.
- (*): Replace SPARCV9 with SPARC_{V9,ARCH64}.
- (MASK_CPUS): Define.
- ({MASK,TARGET}_ENV32): Delete.
- ({MASK,TARGET}_ARCH64,TARGET_ARCH32): Define.
- (TARGET_SWITCHES): Reset cpu flags first for each variant.
- (CONDITIONAL_REGISTER_USAGE): If 32 bit v9 system, unfix g1-g4,
- fix g5, and make %f48-%f80 call used.
- * sparc/sp64-aout.h (SPARC_{V9,ARCH64}): Define.
- (TARGET_VERSION): Define.
- (TARGET_DEFAULT): Add MASK_ARCH64, delete MASK_ENV32.
- (JUMP_TABLES_IN_TEXT_SECTION): Define.
- (READONLY_DATA_SECTION): Make text_section.
- * sparc/sp64-elf.h (SPARC_{V9,ARCH64}): Define.
- (TARGET_DEFAULT): Add MASK_ARCH64.
- (ENDFILE_SPEC): No longer need to check for -nostartfiles.
- (ASM_IDENTIFY_GCC): Define as empty.
- * sparc/sp64-sol2.h: New file.
- * sparc.c (*): Replace TARGET_V9 with TARGET_ARCH64.
- (hard_32bit_mode_classes): Add v9 regs.
- (gen_v9_scc): Handle 32 bit v9 case. Call v9_regcmp_p.
- * sparc.md (*): Replace TARGET_V9 with TARGET_ARCH64 in places
- requiring 64 bit environment.
- (multf3_extend): Require TARGET_HARD_QUAD.
-
-Thu Jan 25 00:33:25 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxcoff.h (DBX_USE_BINCL): Define.
- (DBX_CONTIN_LENGTH): Define if not defined.
-
-Wed Jan 24 18:00:12 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * alpha.c (alpha_write_verstamp): Only emit MS_STAMP and LS_STAMP,
- not the extra numbers.
-
-Wed Jan 24 15:18:15 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (init_cumulative_args): Rewrite to use DEFAULT_ABI
- runtime tests, instead of V.4 #ifdefs.
- (function_arg{,_advance,_partial_nregs,_pass_by_reference}): Ditto.
- (setup_incoming_varargs): Ditto.
- (init_cumulative_args): Set call_cookie field to CALL_NORMAL or
- CALL_NT_DLLIMPORT.
- (function_arg): Add support for DLL imports.
- (rs6000_valid_{decl,type}_attribute_p): New functions for NT
- attributes cdecl, stdcall, dllimport, and dllexport.
- (rs6000_comp_type_attributes): New attribute support.
- (rs6000_set_default_type_attributes): Ditto.
- (rs6000_dll_import_ref): Ditto.
-
- * rs6000.h (FP_ARG_{AIX,SYSV}_MAX_REG): Move here from sysv4.h.
- * sysv4.h (FP_ARG_{AIX,SYSV}_MAX_REG): Move to rs6000.h.
-
- * rs6000.h (rs6000_call_cookie): New enum to describe the integer
- that is the 2nd argument to call insns and 3rd argument to
- call_value insns. Add support for NT DLL imports.
- (rs6000_args): Add call_cookie field.
- (VALID_MACHINE_{DECL,TYPE}_ATTRIBUTE): Define to call C functions.
- ({COMP_TYPE,SET_DEFAULT_TYPE}_ATTRIBUTES): Ditto.
- (rs6000_valid_{decl,type}_attribute_p): Add declarations.
- (rs6000_comp_type_attributes): Ditto.
- (rs6000_set_default_type_attributes): Ditto.
- (rs6000_dll_import_ref): Ditto.
-
- * win-nt.h (ASM_DECLARE_FUNCTION_NAME): Add support for dllexport
- attribute.
-
- * rs6000.md (call insns): Add support for NT dllimport functions,
- and fix up NT indirect calls. Also correctly set the flag
- rs6000_save_toc_p on NT indirect calls.
-
- * aix41.h (LINK_SPEC): Use new extra specs to avoid separate
- versions for native and cross compilation.
- * rs6000.h (LINK_SPEC): Ditto.
- * sysv4.h (LINK_SPEC): Ditto.
-
- * rs6000.h (EXTRA_SPECS): Add link_syscalls, link_libg, link_path,
- link_specs, and also allow target to define more with the macro
- SUBTARGET_EXTRA_SPECS.
- (LINK_{LIBG,SYSCALLS}_SPEC): Define as fixed pathnames if native
- compilation, and currently nothing if cross compiling.
- (LINK_START_SPEC): If not defined, define as empty.
- * eabi{,sim}.h (LINK_START_SPEC): Add default -Ttext for
- simulator.
-
- * eabi{aix,le}.h (MULTILIB_DEFAULTS): Add -mno-sdata default.
- * sysv4{,le}.h (MULTILIB_DEFAULTS): Ditto.
-
- * rs6000.c (small_data_operand): New function to return true if
- the operand lives in small data under eabi.
- (rs6000_select{,_rtx}_section): New functions to determine whether
- to put global and static items in the V.4/eabi small data areas if
- -msdata.
-
- * rs6000.h (LEGITIMATE_SMALL_DATA_P): Call small_data_operand it
- if V.4.
- (GO_IF_LEGITIMATE_ADDRESS): If LEGITIMATE_SMALL_DATA_P, the item
- is a valid address.
- (ASM_OUTPUT_LABELREF): Use fputs, not fprintf.
- (small_data_operand): Declare function.
-
- * sysv4.h (TARGET_SWITCHES): New switch -msdata to use V.4 and
- eabi defined small data sections.
- (SUBTARGET_OVERRIDE_OPTIONS): Don't allow -msdata and
- -mrelocatable or -mcall-aix options.
- (EXTRA_SECTION{S,_FUNCTIONS}): Add .sdata, .sdata2, and .sbss
- sections.
- (SELECT{,_RTX}_SECTION): Call (rs6000_select{,_rtx}_section).
- (ASM_SPEC): The -msdata switch passes -memb to the assembler.
- (ENCODE_SECTION_INFO): Prepend a '@' to the name, if the item
- lives in a small data region.
- (STRIP_NAME_ENCODING): Strip '@' in addition to '*'.
- (ASM_OUTPUT_LABELREF): Strip a leading '@'.
-
- * t-{ppc,eabi}gas (MULTILIB*): Add support for libraries built
- with/without -msdata. Drop support for -mcall-aixdesc libraries.
-
-Wed Jan 24 15:18:15 1996 Kim Knuttila <krk@cygnus.com>
-
- * rs6000/win-nt.h (LIB_SPEC): Change options to GNU ld style.
- (From Jason Molenda)
-
-Wed Jan 24 14:32:48 1996 Jim Wilson <wilson@cygnus.com>
-
- * reload1.c (used_spill_regs): New variable.
- (reload): Set it.
- * reorg.c (find_dead_or_set_registers): New function.
- (mark_target_live_regs): Delete loop looking forward from target
- and instead call find_dead_or_set_registers.
- (fix_reg_dead_note): New function.
- (fill_slots_from_thread): Call it.
-
- * loop.c (scan_loop): Correct comment.
- (strength_reduce): Correct comments. Don't set maybe_multiple when
- pass branch to scan_start. Don't set not_every_iteration after
- passing a CODE_LABEL, or after passing a branch out of the loop.
- When outputting DEST_ADDR giv increments, put them next to the memory
- address on machines with auto-increment addresses.
- (record_biv): Set new field always_executed.
- (record_giv): Set new fields always_executed and auto_inc_opt.
- (maybe_eliminate_biv_1): Reject biv with auto_inc_opt optimization
- in some cases.
- * loop.h (struct induction): New fields always_executed and
- auto_inc_opt.
-
- * c-typeck.c (pointer_int_sum): Use TYPE_PRECISION (sizetype) not
- POINTER_SIZE to agree with expr.c.
-
-Tue Jan 23 15:17:30 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/sol2.h (ASM_OUTPUT_ALIGNED_LOCAL): Delete, use svr4.h's.
-
-Tue Jan 23 03:28:01 1996 Paul Eggert <eggert@twinsun.com>
-
- * cexp.y: Use preprocessor arithmetic instead of C arithmetic
- to avoid warnings on some compilers.
- (HOST_WIDE_INT_MASK): Remove.
- (MAX_CHAR_TYPE_MASK, MAX_WCHAR_TYPE_MASK): New macros.
- (yylex): Use them.
-
-Mon Jan 22 18:39:21 1996 Per Bothner <bothner@cygnus.com>
-
- * cppexp.c (cpp_parse_expr): Set HAVE_VALUE flag for unary
- minus, even if skip_evaluation is true.
-
-Mon Jan 22 16:53:48 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (BIGGEST_ALIGNMENT): Increase to 64 always.
- (BIGGEST_FIELD_ALIGNMENT): Define.
- (GO_IF_LEGITIMATE_ADDRESS): Merge PRE_INC and PRE_DEC cases.
- (LEGITIMIZE_ADDRESS): Use Pmode not SImode.
- (CASE_VECTOR_MODE): Depend on TARGET_64BIT.
- (ASM_OUTPUT_COMMON): Delete.
- (ASM_OUTPUT_ALIGNED_COMMON): Define.
- * rs6000/sysv4.h (BIGGEST_FIELD_ALIGNMENT): Undefine.
- * rs6000.md (adddi3, subdi3, negsi2): New PowerPC64 patterns.
- (ashldi3, lshrdi3, ashrdi3, anddi3, iordi3, xordi3): Same.
- (moddi3, cmpdi, tablejump matchers): Same.
- (divdi3): Update PowerPC64 patterns.
- * rs6000.c (rs6000_initialize_trampoline, case ABI_AIX): Use Pmode
- not SImode.
-
-Sun Jan 21 23:33:24 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxout.c: Include <string.h>
-
-Fri Jan 19 17:17:00 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tree.h (CONSTRUCTOR_TARGET_CLEARED_P): Removed.
- * expr.c (is_zeros_p, mostly_zeros_p): Handle SET_TYPE CONSTRUCTORs.
- (store_constructor_field): New helper function.
- (store_constructor): Take 'cleared' parameter.
- (expand_expr): Fix store_constructor_call to pass 'cleared' of 0.
-
- * expr.c (store_constructor, SET_TYPE): Fix off-by-one-error.
- Also, devide start byte by BITS_PER_UNIT before passing to memset.
- (store_constructor): `continue' in wrong place.
-
- * expr.c (store_constructor): If storing into a range of array
- elements, and the range is small, or the target it not memory,
- unroll the loop (and use store_field, which handles REGs).
- (store_constructor): Handle RANGE_EXPR in array index.
-
-Fri Jan 19 16:52:25 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * svr4.h (SWITCH_TAKES_ARG): Add 'x'.
- * sparc/sol2.h (SWITCH_TAKES_ARG): Likewise.
-
-Fri Jan 19 15:18:38 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxout.c (flag_minimal_debug): Initialize to 0 if both
- NO_DOLLAR_IN_LABEL and NO_DOT_IN_LABEL are defined.
- (dbxout_type_methods): If the mangled method name uses the special
- C++ marker character, pass show_arg_types as 1 when calling
- dbxout_type.
-
-Fri Jan 19 11:48:28 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi-ci.asm (_SDA_BASE_): Move the default definition
- from the .got section to the .sdata section. Do not add 32768.
- (_SDA2_BASE_): Provide a default definition.
-
- * rs6000/eabi-cn.asm (.got.blrl): Don't define this section any
- more, linker now directly creates the blrl instruction at
- _GLOBAL_OFFSET_TABLE_-4.
-
-Fri Jan 19 05:12:31 1996 Richard Earnshaw <rearnsha@armltd.co.uk>
-
- * arm/lib1funcs.asm (__divsi3, __modsi3, __udivsi3, __umodsi3):
- Replace with smaller, faster versions.
-
-Thu Jan 18 17:41:46 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.c (ctype.h): Delete.
- (regno_reg_class, reg_class_from_letter): Add SH3e support.
- (prepare_scc_operands, broken_move, push, pop, push_regs): Likewise.
- (calc_live_regs, sh_expand_prologue, sh_expand_epilogue): Likewsie.
- (initial_elimination_offset, arith_reg_operand): Likewise.
- (sh_builtin_saveregs, fp_zero_operand, fp_one_operand): New functions.
- (sh_function_arg, sh_function_arg_partial_nregs): Delete.
- * sh.h (CPP_SPEC, CONDITIONAL_REGISTER_USAGE): Add SH3E support.
- (TARGET_SWITCHES, OVERRIDE_OPTIONS, FIRST_PSEUDO_REGISTER): Likewise.
- (FIXED_REGISTERS, CALL_USED_REGISTERS, HARD_REGNO_MODE_OK): Likweise.
- (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Likewise.
- (REG_ALLOC_ORDER, CONST_DOUBLE_OK_FOR_LETTER_P, NPARM_REGS): Likewise.
- (FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Likewise.
- (FUNCTION_ARG_REGNO_P, CUMULATIVE_ARGS, ROUND_REG): Likewise.
- (INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Likewise.
- (FUNCTION_ARG_PARTIAL_NREGS, LEGITIMATE_CONSTANT_P): Likewise.
- (MODE_DISP_OK_4, REGISTER_MOVE_COST, REGISTER_NAMES): Likewise.
- (DBX_REGISTER_NUMBER, enum processor_type): Likewise.
- (SH3E_BIT, TARGET_SH3E, FPUL_REG, FIRST_FP_REG, LAST_FP_REG): New.
- (FIRST_FP_PARM_REG, FIRST_FP_RET_REG, BASE_RETURN_VALUE_REG): New.
- (BASE_ARG_REG, enum sh_arg_class, struct sh_args): New.
- (GET_SH_ARG_CLASS, PASS_IN_REG_P, sh_builtin_saveregs): New.
- (EXPAND_BUILTIN_SAVEREGS, DOUBLE_TYPE_SIZE): New.
- (TARGET_SWITCHES): Delete broken -m3l option.
- * sh.md (cpu, movsi_i, movsf_i, blt, bge, sle, sge): Add SH3E support.
- (push_e, pop_e, movsi_ie, movsf_ie, addsf3, subsf3): New patterns.
- (mulsf3, macsf3, divsf3, floatsisf2, fix_truncsfsi2): New patterns.
- (cmpgtsf_t, cmpqesf_t, cmpsf, negsf2, sqrtsf2, abssf2): New patterns.
- (abssf2+9, abssf2+10): Add SH3e support to peepholes
- (abssf2+11, abssf2+12): New peepholes for SH3e.
- * t-sh (MULTILIB_OPTIONS): Add SH3E support.
- (MULTILIB_DIRNAMES): Define to empty.
-
-Thu Jan 18 11:29:11 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cplus-dem.c (cplus_demangle_opname): Change type of opname
- parameter to const char *.
- (cplus_mangle_opname): Change return type and type of opname
- parameter to const char *. Don't cast return value.
- * demangle.h (cplus_demangle_opname): Update declaration.
- (cplus_mangle_opname): Likewise.
-
-Thu Jan 18 10:07:33 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gcc.c (extra_specs): If EXTRA_SPECS is defined, define
- extra_specs array to hold the extra specs the machine description
- defines.
- (set_spec): If EXTRA_SPECS is defined, handle the extra
- specifications.
- (process_command, main, validate_all_switches): Likewise.
-
- * rs6000/{rs6000.h,powerpc.h,aix41.h} ({CPP,ASM}_SPEC): Use common
- specs with EXTRA_SPECS, only modifying things in the target that
- needs to be modified, rather than having tons of mostly duplicate
- definitions.
- * rs6000/{sysv4{,le}.h,}netware.h,lynx.h,} ({CPP,ASM}_SPEC): Ditto.
- * rs6000/eabi{le,aix}.h,aix3newas.h}} ({CPP,ASM}_SPEC): Ditto.
-
-Wed Jan 17 19:38:24 1996 Paul Eggert <eggert@twinsun.com>
-
- * cexp.y (HOST_WIDE_INT_MASK): Renamed from LONG_MASK;
- use HOST_WIDE_INT.
- (HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT): Put back.
- (parse_c_expression, expression_value, parse_escape, left_shift,
- right_shift, struct constant, exp, parse_number, yylex):
- Replace `long' with `HOST_WIDE_INT'.
- * cccp.c (PTR_INT_TYPE): Remove obsolete define to `long'.
- (parse_escape, parse_c_expression, eval_if_expression, get_lintcmd,
- do_line, do_if, do_elif): Replace `long' with `HOST_WIDE_INT'.
- (trigraph_pcp): Don't assume a pointer difference fits in an int.
-
-Wed Jan 17 18:56:31 1996 Jim Wilson <wilson@cygnus.com>
-
- * expmed.c (extract_bit_field): For multi-word bitfield, clobber
- target before storing to it.
-
-Wed Jan 17 14:19:34 1996 J.T. Conklin <jtc@slave.cygnus.com>
-
- * sparc/{t-sol2,t-sunos40,t-sunos41}: Define away LIBGCC1_TEST
- so that cross compilers targeted at these systems will build.
-
-Wed Jan 17 09:51:58 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.h (v9 INIT_CUMULATIVE_ARGS): Fix typos.
-
- * gcc.c (process_command): New local lang_n_files, and use
- it in test of -c with -o. Move test of -save-temps.
- Test for trailing NUL in -c.
-
- * i386/t-go32: New file.
- * i386/xm-go32.h: New file.
- * configure (i[345]86-*-go32*): Define xm_file and tmake_file.
-
-Wed Jan 17 07:47:43 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cccp.c (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Put back.
- (pcfinclude): Use HOST_WIDE_INT for casting pointer to integer.
-
-Wed Jan 17 05:25:06 1996 Jeffrey A. Law <law@cygnus.com>
-
- * va-pa.h (__gnuc_va_list): Use a "void *".
-
-Tue Jan 16 18:45:23 1996 Per Bothner <bothner@cygnus.com>
-
- * cppexp.c (cpp_lex): Do cpp_pop_buffer after CPP_POP so retried
- cpp_skip_hspace will actually work.
-
- * cppexp.c (SKIP_OPERAND): New macro.
- (cpp_parse_expr): Suppress evaluation and diagnostics in
- unevaluated subexpressions.
- Corresponds to Eggert's Fri Jun 9 17:58:29 1995 change.
-
-Tue Jan 16 11:59:07 1996 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_expr, case COND_EXPR): Make sure cleanups live on
- the function_obstack as they are used by the exception handling code.
- (defer_cleanups_to): Ditto.
- (TRUTH_ANDIF_EXPR): Ditto.
- (TRUTH_ORIF_EXPR): Ditto.
-
-Tue Jan 16 13:57:13 1996 Jim Wilson <wilson@cygnus.com>
-
- * cccp.c (new_include_prefix): Ignore ENOTDIR error from stat.
-
-Tue Jan 16 12:18:56 1996 Doug Evans <dje@cygnus.com>
-
- * i386/t-sol2 (crt[1in].o): Add missing -c.
- * sparc/t-sol2 (crt[1in].o,gcrt1.o): Likewise.
- Source files are assembler.
-
- * gcc.c (do_spec_1, case 'W'): Rename local `index' to `cur_index' to
- avoid warning on solaris.
-
-Tue Jan 16 11:42:09 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxcoff.h: New file for stabs in COFF support.
- * a29k/a29k-udi.h: Use dbxcoff.h.
- * h8300.h, i960/i960-coff.h, m68k/coff.h, m88k/m88k-coff.h: Likewise.
- * sh.h, sparc/litecoff.h: Likewise.
-
-Tue Jan 16 08:21:45 1996 Hans-Peter Nilsson <Hans-Peter.Nilsson@axis.se>
-
- * optabs.c (expand_fix): Don't copy TARGET to TO if same.
-
- * expr.c (emit_move_insn_1): Don't emit clobber when moving
- by parts and source equals destination.
-
-Tue Jan 16 08:08:29 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expmed.c (extract_bit_field): Don't abort if not MEM_IN_STRUCT_P.
-
- * local-alloc.c (memref_referenced_p, case REG): Fix last change.
-
- * fold-const.c (const_binop): Strip NOPS from both args.
-
- * regclass.c (regclass): Remove useless cast.
-
-Tue Jan 16 07:06:03 1996 Paul Eggert <eggert@twinsun.com>
-
- * cexp.y: General code cleanup in the style of 1995-04-01 change.
- Add prototypes for static functions.
- Add parentheses suggested by `gcc -Wparentheses'.
- Use `long' uniformly, instead of long, int, HOST_WIDE_INT mess.
- (struct constant): Use `signedp' flag (with sign bit) instead of
- `unsignedp' flag; it's a little more convenient.
-
- (HAVE_STDLIB_H, STDC_HEADERS, LONG_MASK, __attribute__, PROTO,
- VA_START, PRINTF_ALIST, PRINTF_DCL, PRINTF_PROTO, PRINTF_PROTO_1,
- vfprintf, SIGNED, UNSIGNED): New symbols.
- <stdlib.h>: Include if HAVE_STDLIB_H.
- <string.h>: New include.
- (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Remove.
- (yylex, yyerror, expression_value, parse_number,
- initialize_random_junk): Now static.
-
- (overflow_sum_sign): Renamed from possible_sum_sign, with an
- extra arg SIGNEDP.
- (parse_number): Inline strcmp when checking for "0x".
- (yylex): Keep track of mask needed when decoding wide characters.
- (parse_escape): New arg RESULT_MASK; use it instead of
- assuming char width.
- (yylex, parse_escape, parse_c_expression): Store all host
- integers as long, not int or HOST_WIDE_INT.
- (left_shift): No need to do signed left shifts separately.
-
- These changes are for the test program (if TEST_EXP_READER):
- (pedantic, traditional): Allocate storage.
- (main): Set pedantic, traditional, yydebug depending on args.
- (is_hor_space, warning, lookup): Change types and implementation
- to match rest of program.
- (pedwarn, check_assertion, xmalloc): New functions.
-
- * cccp.c (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Remove.
- (parse_escape, parse_c_expression, eval_if_expression):
- Change return type to `long'; all callers changed.
- (pcfinclude): Use `int', not HOST_WIDE_INT; any integral type will do.
-
- * cccp.c (skip_quoted_string): If pedantic and not pedantic_errors,
- skipped multiline strings elicit a warning, not an error.
- (rescan): Minor code reorg to keep it parallel with skip_quoted_string.
-
- * fold-const.c (left_shift_overflows): Remove; unused.
-
- * c-typeck.c (convert_for_assignment): Don't automatically convert
- from a union member to the union.
-
-Tue Jan 16 06:26:00 1996 Stefan Vogel (stefan@ssw.de)
-
- * config/svr4.h (ASM_OUTPUT_SECTION_NAME): Define section attributes
- only when a section is defined the first time.
-
-Tue Jan 16 06:03:27 1996 Thomas Graichen <graichen@omega.physik.fu-berlin.de>
-
- * i386/freebsd.h (ASM_WEAKEN_LABEL): Deleted; not supported.
-
-Mon Jan 15 20:59:49 1996 J. Kean Johnston <hug@netcom.com>
-
- * Makefile.in (LIBGCC2_CLFAGS): Add -DIN_LIBGCC2.
- (libgcc1.a): Add -DIN_LIBGCC1.
- (stamp-crtS): Remove -fpic, use CRTSTUFF_CFLAGS_S.
- * config/t-libc-ok: Add CRTSTUFF_CFLAGS_S.
-
- * configure (i[3456]86-*-sco3.2v5*): New case.
- * i386/sco5.h, i386/t-sco5, i386/x-sco5, i386/xm-sco5.h: New files.
- * ginclude/stdarg.h, ginclude/varags.h: Add test for SCO Open Server 5.
-
-Mon Jan 15 20:44:13 1996 J.T. Conklin <jtc@netbsd.org>
-
- * m68k/netbsd.h (ASM_SPEC): New macro.
-
-Mon Jan 15 17:01:16 1996 Doug Evans <dje@cygnus.com>
-
- * c-lex.c (check_newline): Pass character after `#pragma' to
- HANDLE_PRAGMA. Don't call get_directive_line if at end of line.
- * c-common.c (get_directive_line): Watch for EOF.
- * h8300.h (HANDLE_PRAGMA): New argument `c'.
- Must issue `return' now.
- * i960.h (HANDLE_PRAGMA): Likewise.
- * sh.h (HANDLE_PRAGMA): Likewise.
- * nextstep.h (HANDLE_PRAGMA): Likewise.
- * h8300.c (handle_pragma): New argument `ch'.
- Simplify pragma processing. Delete support for `#pragma section'.
- * i960.c (process_pragma): New argument `c'. Change result to
- terminating character.
- * nextstep.c (handle_pragma): Likewise.
- * sh.c (handle_pragma): Likewise. Also simplified.
-
- * sched.c (reemit_notes): Add prototype.
- (sched_analyze_2): Reorganize comments. Call prev_nonnote_insn.
- (sched_analyze): Add abort call.
- (schedule_block): Call prev_nonnote_insn.
- Move call of reemit_notes to after SCHED_GROUP_P scheduling.
- Set `head' to `last'.
-
-Mon Jan 15 16:12:25 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * configure (*-*-gnu*): Use tmake_file=t-gnu.
- * config/t-gnu (CRTSTUFF_T_CFLAGS): New file.
- * configure (*-*-gnu*): Remove crtbeginS.o and crtendS.o frmo
- $extra_parts. Use xmake_file=x-linux.
-
-Mon Jan 15 15:30:49 1996 Gran Uddeborg <gvran@uddeborg.pp.se>
-
- * i386/svr3{,z}.ifile: Allocate address areas for the "stab"
- and "stabstr" sections.
-
-Mon Jan 15 14:39:14 1996 Paul Eggert <eggert@twinsun.com>
-
- * c-decl.c (finish_incomplete_decl): Warn if completing an
- array that wasn't declared extern. Simplify test for whether
- completion is needed.
-
- * cccp.c (do_xifdef): Warn about `#ifdef 0' if not traditional;
- formerly the warning was issued if not pedantic.
-
-Mon Jan 15 13:24:12 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md ({add,sub}di3): Make it work on little endian PowerPC
- systems.
-
- * rs6000/eabi-c{i,n}.asm (.sbss2 section): Don't make .sbss2 a
- .bss section just yet, because it confused the linker.
-
-Mon Jan 15 08:50:31 1996 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (pushdi): Allow "i" for operand 1.
- (extendqidi2): Improve 68000 code generation.
- (adddi_lshrdi_63): New pattern.
-
-Mon Jan 15 08:38:40 1996 H.J. Lu {hjl@gnu.ai.mit.edu)
-
- * configure (i[3456]86-*-linux*): Add extra_parts.
- * i386/linux.h (LIB_SPEC): Remove %{mieee-fp:-lieee}.
- Use -lc_p for -profile.
- (CC1_SPEC): New macro.
- * linux.h (STARTFILE_SPEC): Use crtbegin.o for both shared llibrary
- and normal executable; use gcrt1.o for -profile.
- (ENDFILE_SPEC): Use crtend.o for shared llibrary and normal executable.
- * x-linux (INSTALL_ASSERT_H): Unset it.
- * configure (i[3456]86-*-linux*oldld*): Set xmake_file to x-linux-aout.
- (i[3456]86-*-linux*aout*): Likewise.
- * x-linux-aout: New file, copied from config/x-linux.
-
-Mon Jan 15 07:41:05 1996 Dmitry K. Butskoy (buc@stu.spb.su)
-
- * varasm.c (in_data_section): New function.
-
-Mon Jan 15 07:37:13 1996 Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
-
- * c-typeck.c (build_c_cast): Don't warn about alignment when we
- have an opaque type.
-
-Mon Jan 15 07:22:59 1996 Michel Delval (mfd@ccv.fr)
-
- * reload.c (find_equiv_reg): Apply single_set, not PATTERN, to WHERE.
-
-Mon Jan 15 07:02:21 1996 John F. Carr <jfc@mit.edu>
-
- * reorg.c (mark_referenced_resources, case TRAP_IF): Set volatil.
-
-Mon Jan 15 06:20:38 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * gcc.c (process_commands): Remove inadvertant fallthrough.
-
- * function.c ({,round_}trampoline_address): TRAMPOLINE_ALIGNMENT is
- in bits, not bytes.
-
- * objc/archive.c (objc_{write,read}_type, case _C_STRUCT_B): Fix typo.
-
- * expr.c (expand_expr, case COMPONENT_REF): Don't make recursive
- call on object with EXPAND_SUM.
-
- * stmt.c (save_expr_regs): Delete declaration; unused.
-
-Sun Jan 14 21:44:26 1996 Michael Meissner <meissner@wogglebug.tiac.net>
-
- * rs6000/eabi-ci.asm (__EXCEPT_START__): Provide label for start
- of g++ exception pointers.
-
- * rs6000/eabi-cn.asm (__EXCEPT_END__): Provide label for end of
- g++ exception pointers.
-
- * rs6000/eabi.asm (__eabi): Relocate exception pointers unless
- they are NULL.
-
- * va-ppc.h (va_arg): Long longs are always passed in odd registers.
-
- * rs6000.c (function_arg_boundary): On V.4, long longs are always
- passed in odd registers.
-
- * rs6000.md ({add,sub}di3): Remove restriction for POWER only,
- since all of the instructions used are common to both
- architectures.
-
-Sun Jan 14 20:34:03 1996 Jeffrey A. Law <law@cygnus.com>
-
- * expr.c (expand_assignment): Fix alignment parm in emit_block_move.
-
-Sun Jan 14 19:00:25 1996 Jim Wilson <wilson@cygnus.com>
-
- * sched.c (schedule_block): Copy RTX_INTEGRATE_P bit when create
- a new note.
-
- * integrate.c (save_for_inline_copying, case NOTE): Copy
- RTX_INTEGRATED_P bit.
-
-Sun Jan 14 17:57:52 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stupid.c (stupid_find_reg): Don't try to allocate reg if live
- over more than 5,000 insns.
-
-Sat Jan 13 23:09:07 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (STACK_BOUNDARY): Bring back down to 64bits.
-
- * pa.md (pre_ldwm): Fix bug exposed by recent changes.
- Simplify.
- (pre_stwm, post_ldwm, post_stwm): Likewise.
- (HImode and QImode variants): Likewise.
- * pa.c (hppa_expand_prologue): Corresponding changes.
- (hppa_expand_epilogue): Likewise.
-
- * pa.c (hppa_legitimize_address): Generate more indexing
- address modes.
-
-Fri Jan 12 19:03:21 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/sol2.h (COMMON_ASM_OP): Delete, use sysv4.h's.
-
- * sched.c (schedule_block): Maintain a valid chain so
- emit_note_before works.
-
-Fri Jan 12 13:20:01 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi{,-ci,-cn}.asm: Add support for V.4 .sbss/.sdata, and
- eabi .sbss2/.sdata2 sections, loading up r13 and r2 respectively
- if the sections were used, and we don't need to relocate the
- pointers.
-
-Thu Jan 11 19:41:07 1996 Per Bothner <bothner@cygnus.edu>
-
- * sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use AGGREGATE_TYPE_P so
- QUAL_UNION_TYPE and SET_TYPE are also passed by invisible reference.
- * sparc.h (INIT_CUMULATIVE_ARGS for SPARCV9): Return types of
- QUAL_UNION_TYPE and SET_TYPE also make invisible 1st argument.
-
-Thu Jan 11 18:33:50 1996 Doug Evans <dje@cygnus.com>
-
- * h8300.h (TARGET_ALIGN_STRUCT_300): New macro.
- (TARGET_SWITCHES): Add -malign-struct-300.
- (BIGGEST_FIELD_ALIGNMENT): Update.
-
-Thu Jan 11 12:07:44 1996 J.T. Conklin <jtc@cygnus.com>
-
- * h8300.h (CPP_PREDEFINES): Delete -D_DOUBLE_IS_32BITS.
-
-Thu Jan 11 11:09:33 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (mulsf3 !POWERPC): Use dmul attribute.
- (divsf3 !POWERPC): Use ddiv attribute.
-
-Thu Jan 11 11:09:33 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi-ctors.c (__do_global_ctors): If global variable
- __atexit is non-NULL, call it with __do_global_dtors address to
- register the function to run destructors.
- (__do_global_{c,d}tors): Guard against NULL pointers.
-
- * rs6000/eabi.asm (__eabi): If the __eabi function was already
- called, do nothing.
-
-Thu Jan 11 11:29:09 1996 Doug Evans <dje@cygnus.com>
-
- * fixincludes: Wrap rpc/types.h in extern "C", for osf2.0.
-
-Wed Jan 10 13:16:03 1996 Doug Evans <dje@cygnus.com>
-
- * varasm.c (variable_section): New function.
- (assemble_variable): Call it.
-
-Wed Jan 10 11:27:28 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi-c{i,n}.asm (__DTOR_{LIST,END}__): Fix typo.
- * rs6000/eabi{,sim}.h ({START,END}FILE_SPEC): Add %s to object
- files.
-
- * rs6000/t-{eabi,eabigas,ppc,ppcgas} (MULTILIB_MATCHES): Drop
- support for obsolete -mcpu=mpc403.
- Add -mcpu=821 and -mcpu=860 to soft-float defaults.
-
- * rs6000/t-eabi{,gas} (LIBGCC): Add stmp-crt.
- (INSTALL_LIBGCC): Add install-crt.
- (EXTRA_PARTS): Delete.
- (stmp-crt{,-sub}): New rules to build crti.o and crtn.o in a
- multilib fashion.
- (install-crt): Install the multilib crt values.
-
-Tue Jan 9 17:30:16 1996 Doug Evans <dje@cygnus.com>
-
- * c-tree.h (merge_attributes): Moved from here.
- * tree.h (merge_attributes): To here.
- * c-typeck.c (merge_attributes): Moved from here.
- * tree.c (merge_attributes): To here.
-
-Mon Jan 8 18:27:38 1996 Arne H. Juul <arnej@pvv.unit.no>
-
- * mips/netbsd.h (LINK_SPEC): Change nostdlib to nostartfiles.
- (LOCAL_LABEL_PREFIX): Delete.
- (ASM_OUTPUT_SECTION_NAME): Define.
-
-Sun Jan 7 17:11:11 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * collect2.c (scan_libraries): Correct Import File ID interpretation.
-
-Sun Jan 7 16:56:56 1996 Michael Meissner <meissner@wombat.gnu.ai.mit.edu>
-
- * {svr4,mips/elf{,64}}.h (MAX_OFILE_ALIGNMENT): Define as 32768*8.
-
-Sat Jan 6 15:52:36 1996 Doug Evans <dje@cygnus.com>
-
- * a29k/vx29k.h (CPP_SPEC): Define.
-
- * configure: Recognize any --with/--without option.
-
- * Makefile.in (MAKEINFOFLAGS): New variable.
- (cpp.info,gcc.info): Use it.
-
- * sparc/t-sol2 (crt1.o,crti.o,crtn.o,gcrt1.o): Use $(GCC_FOR_TARGET).
- * i386/t-sol2 (crt1.o,crti.o,crtn.o): Likewise.
-
-Fri Jan 5 10:44:25 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/aix{3newas,41}.h ({ASM,CPP}_SPEC): Update for new
- processors.
- * rs6000/eabi{aix,le}.h ({ASM,CPP}_SPEC): Ditto.
- * rs6000/{lynx,netware,powerpc,sysv4}.h ({ASM,CPP}_SPEC): Ditto.
-
- * rs6000.c (rs6000_override_options): Remove requirement that
- -mcpu=common be big endian.
- (rs6000_stack_info): If NAME__main is defined, mark this function
- as doing a call, even if there are no arguments.
-
- * rs6000.md (SI*SI->DI splitters): Add reload_completed
- condition.
- (mulsidi3): If big endian, do move directly, rather than moving by
- pieces.
-
- * rs6000/eabi{,sim}.h (STARTFILE_SPEC): Add crti.o before any
- other objects.
- (ENDFILE_SPEC): Add crtn.o after any objects.
- * rs6000/t-eabi{,gas}: Build crt{i,n}.o from eabi-crt{i,n}.asm.
- * rs6000/eabi-crt{i,n}.asm: New files to provide begin/end labels
- for all special sections used by eabi as opposed to relying on GLD
- to set all of these symbols.
- * rs6000/eabi.asm (__eabi): Change to use the new labels provided
- above. Don't assume that the .got2, .ctors, .dtors, and .fixup
- sections are contiguous.
-
-Fri Jan 5 10:40:37 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (mulh_call): Remove r4 clobber.
- (quoss_call): Remove cr0 and cr1 clobbers.
-
- * rs6000.md (function units): Add MPC505/821/860 support.
- (SF multiply add combiner patterns): Use dmul attribute when limited
- to DFmode POWER instructions.
- * rs6000.c (processor_target_table): Add MPC505/821/860 support.
- Remove MASK_POWER and add MASK_PPC_GFXOPT for PPC602. Always use
- new mnemonics for common mode.
- (rs6000_override_options): Don't set SOFT_FLOAT based upon
- PROCESSOR_DEFAULT.
- * rs6000.h (processor_type): Add PROCESSOR_MPCCORE.
- (RTX_COSTS): Add PROCESSOR_MPCCORE cases.
- (CPP_SPEC): Add new processor support.
-
-Fri Jan 5 00:32:49 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.h (MACHINE_STATE_RESTORE): Add missing .align.
-
-Wed Jan 3 18:29:32 1996 Doug Evans <dje@cygnus.com>
-
- * arm/lib1funcs.asm (__USER_LABEL_PREFIX__): Define if not already.
- (CONCAT1,CONCAT2,SYM): Define.
- (__udivsi3,__divsi3,__umodsi3,__modsi3,__div0): Use SYM to define
- global labels.
-
-Wed Jan 3 02:41:39 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Call text_section.
-
-Tue Jan 2 16:12:13 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.c (gen_shifty_op): Output a NOP for a shift by 0.
- (find_barrier): New variables si_limit, hi_limit. Set them depending
- on whether we are optimizing. Set found_hi if the destination is
- HImode.
- (machine_dependent_reorg): If not optimizing, then change scan to a
- note instead of calling delete_insn.
- * sh.h (OVERRIDE_OPTIONS): Don't set optimize or flag_delayed_branch.
-
- * dbxout.c (gstab.h): Include if cross compiling.
-
-Mon Jan 1 21:13:43 1996 Arkady Tunik <Arkady_Tunik@comverse.com>
-
- * configure (i[3456]-*-solaris2*): Support stabs.
- * i386/sol2dbg.h: New file.
-
-Mon Jan 1 09:08:01 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c: Use DECL_C_BIT_FIELD, not DECL_BIT_FIELD in all tests.
-
- * global.c (reg_allocno): No longer static.
- * reload1.c (reg_allocno): Declare.
- (order_regs_for_reload): New arg, GLOBAL.
- Bias against regs allocated in local-alloc.
- (reload): Pass new parm to order_regs_for_reload.
-
- * local-alloc.c (reg_equiv_replacement): New variable.
- (memref_referenced_p, case REG): Check for reg_equiv_replacement.
- (update_equiv_regs): reg_equiv_replacement now file-scope.
-
- * c-decl.c (finish_struct): Warn if field with enumeral type is
- narrower than values of that type.
-
- * combine.c (rtx_equal_for_field_assignment_p): New function.
- (make_field_assignment): Use it.
- Expand compound operations on both sides of an IOR.
- Properly adjust constand in IOR when computing bit position.
-
-Sun Dec 31 18:47:22 1995 Doug Evans <dje@cygnus.com>
-
- * m68k-none.h (MULTILIB_DEFAULTS): Define.
-
-Sun Dec 31 15:47:20 1995 Jeffrey A. Law <law@cygnus.com>
-
- * hard-reg-set.h (losing_caller_save_reg_set): Declare.
- * regclass.c (losing_caller_save_reg_set): Define.
- (init_reg_sets_1): Initialize losing_caller_save_reg_set.
- * global.c (find_reg): Avoid caller-saving registers in
- losing_caller_save_reg_set.
- * local-alloc.c (find_free_reg): Avoid caller-saving registers
- in losing_caller_save_reg_set.
- (CLASS_LIKELY_SPILLED_P): Delete definition. Moved into regs.h.
- * regs.h (CLASS_LIKELY_SPILLED_P): Define if not already defined.
-
- * reorg.c (fill_simple_delay_slots): Try to fill from the
- target of an unconditional branch if necessary.
-
- * pa.h (REG_ALLOC_ORDER): Allocate PA1.1 caller-saved FP regs
- before PA1.0 caller-saved FP regs.
-
- * sched.c (adjust_priority): Use ADJUST_PRIORITY if its defined.
-
- * pa.h (ADJUST_PRIORITY): Define to keep lifetimes of registers
- that will be allocated to %r1 shorter.
-
-Sun Dec 31 14:20:49 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * rtl.h (assign_temp): Add extra arg.
- * function.c (assign_temp): Add extra arg, DONT_PROMOTE.
- Don't return (const_int 0) for VOIDmode.
- * stmt.c (expand_asm_operands): Call assign_temp with extra arg.
- * expr.c (save_nocopied_parts, expand_expr): Likewise.
- (expand_expr, case SAVE_EXPR): Set TEMP to (const_int 0)
- if MODE is VOIDmode.
- (expand_expr): Don't use assign_temp for pseudos when might
- want to be TMODE.
-
- * stmt.c (tail_recursion_args): Compare TYPE_MAIN_VARIANTs.
-
- * calls.c (expand_call): Don't warn about not being able to
- inline if -O0.
- * expr.c (clear_pending_stack_adjust): Don't do optimization if -O0.
- * function.c (instantiate_decls): Check DECL_SAVED_INSNS to see
- if obstack change is needed.
- * toplev.c (rest_of_compilation): Leave DECL_INLINE set even if
- won't inline.
-
- * tree.h: Add documentation on uses of common area flags.
- (DECL_ERROR_ISSUED): New macro.
- (DECL_NO_STATIC_CHAIN): New macro; currently unused.
- * c-aux-info.c (gen_decl): DECL_REGISTER isn't defined
- for FUNCTION_DECL.
- * toplev.c (compile_file): Likewise.
- * stmt.c (fixup_gotos): Use DECL_ERROR_ISSUED instead
- of DECL_REGISTER.
- * varasm.c ({bc_,}make_decl_rtl): Don't look at DECL_REGISTER
- for functions.
-
-Sat Dec 30 07:57:11 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sdbout.c (plain_type_1, case ARRAY_TYPE): Subtract lower bound
- when writing dimension.
-
-Fri Dec 29 18:23:58 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (eval_if_expression): End expression with '\n', not '\0'
- so '\0' can be diagnosed properly.
- * cexp.y (yylex, parse_c_expression, main): Likewise.
-
-Thu Dec 28 18:24:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tree.h (TYPE_ARRAY_MAX_SIZE): New macro (used by Chill).
- * function.c (assign_temp): New function. Can handle Chill-style
- variable-sized array with static maximum size.
- * rtl.h (assign_temp): New declaration.
- * stmt.c (expand_asm_operands): Use new assign_temp function.
- * expr.c (save_noncopied_parts, expand_expr): Likewise.
-
-Thu Dec 28 15:28:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * function.c (assign_parms): Fix thinko for struct value arg.
-
-Fri Dec 29 12:41:47 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (movdf): Reinstate 12/24 change accidently dropped in
- undoing 12/27 changes.
-
-Thu Dec 28 22:24:53 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h: (reg_class): Undo 12/27 changes, except for formatting.
- (REG_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS): Likewise.
- (REG_CLASS_FROM_LETTER): Likewie.
- (PREDICATE_CODES): Delete predicate functions.
- (gpc_reg{0,3,4,34}_operand): Delete declaration.
- (cc_reg{0,1}_operand): Likewise.
- * rs6000.c (gpc_reg{0,3,4}_operand): Delete.
- (cc_reg{0,1}_operand): Likewise.
-
- * rs6000.md (common mode functions): Undo 12/27 changes,and add
- appropriate clobbers for common mode calls. Keep define_splits for
- powerpc SI*SI->DI.
-
-Thu Dec 28 11:08:11 1995 Mike Stump <mrs@cygnus.com>
-
- * sparc.h (RETURN_ADDR_OFFSET): Rename from NORMAL_RETURN_ADDR_OFFSET;
- returns offset for the current function specifically.
-
-Thu Dec 28 07:07:14 1995 Paul Eggert <eggert@twinsun.com>
-
- * c-lex.c (yylex): Improve error message for bogus numbers.
- Consolidate duplicated code.
-
- * cexp.y (parse_number): Improve error message for bogus numbers.
- (yylex): Consider `0xe-1' to be a (bogus) number if not traditional.
-
- * cccp.c (do_include): In VMS, worry only about EACCES when open fails.
- (new_include_prefix): Don't try to stat dir prefixes in VMS.
-
-Wed Dec 27 14:02:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fix-header.c: Add EXIT_FAILURE and EXIT_SUCCESS to stdlib.h if
- missing. Re-write how errno is added to be done similarly.
- (XOPEN_SYMBOL, XOPEN_EXTENDED_SYMBOL): New macros, to mark XPG4
- functions.
- (std_include_table): Add a number of functions (mostly XPG4).
-
-Tue Dec 26 23:18:34 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * sys-types.h: Add dummy definition for ssize_t.
- * sys-protos.h (bcmp, bcopy, gethostname, lockf, read, readlink,
- write): Fix prototypes to match Posix and XPG4.
- (socket, strcasecmp, strncasecmp): New prototypes (from XPG4).
-
-Wed Dec 27 15:30:04 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * libgcc2.c (_bb_init_prg): Cast arg to bzero to (char *).
-
- * regs.h (reg_rtx_no, regno_pointer_{flag_length,align): New decls.
- (REGNO_POINTER_ALIGN): New macro.
- * emit-rtl.c (regno_pointer_align): New variable.
- (gen_reg_rtx): Extend regno_pointer_align table.
- Allocate tables in saveable obstack.
- (mark_reg_pointer): New arg, ALIGN.
- (gen_inline_header): New args for reg info.
- (set_new_first_and_last_insn): Set cur_insn_uid.
- ({save,restore}_emit_status): Save and restore regno_pointer_align.
- (restore_reg_data{,_1}): Deleted.
- (init_emit): Allocate register tables in saveable obstack.
- Set REGNO_POINTER_ALIGN for regs pointing into frame.
- * function.c (assign_parms): Set REGNO_POINTER_ALIGN for
- parms that are pointers.
- * function.h (struct function): New field regno_pointer_align.
- * expr.c (expand_expr, case VAR_DECL): Set REGNO_POINTER_ALIGN
- when copying address into memory.
- (expand_expr, case COMPONENT_REF, case ADDR_EXPR): Set alignment
- of register when result or result's address.
- (expand_expr, case CONVERT_EXPR): Don't handle -fforce-mem here.
- * combine.c (set_nonzero_bits_and_sign_copies): Handle reg even
- if only set once and in one basic block.
- (nonzero_bits, case REG): Use REGNO_POINTER_ALIGN instead of
- explicit alignment of registers pointing into frame.
- * stmt.c (expand_decl): Set alignment of register for pointer
- variable.
- * optabs.c (emit_unop_insn): Don't do -fforce-mem for SIGN_EXTEND.
- * cse.c (find_best_addr): Make sure folded address better before using.
- * rtl.h (INLINE_REGNO_{RTX,POINTER_FLAG,POINTER_ALIGN}): New macros.
- (gen_inline_header): Add three new parms.
- * rtl.def (INLINE_HEADER): Add three new fields.
- * integrate.c: Include regs.h.
- (initialize_for_inline): Pass additional args to gen_inline_header.
- (save_for_inline_copying): Make new regno_reg_rtx, regno_pointer_flag,
- and regno_pointer_align arrays.
- (expand_inline_function): Set alignment of reg for parm if passed
- by hidden pointer.
- Set regno_pointer_{flag,align} into remap table.
- (copy_rtx_and_substitute): Set alignment of pointers into
- stack frame.
- Copy pointer flag and alignment to regs that are copies of
- pointer registers from the original regs.
- (output_inline_function): Don't call restore_reg_data.
- Restore reg_rtx_no, regno_{reg_rtx,pointer_flag,pointer_align}.
- * integrate.h (struct inline_remap): New fields regno_pointer_flag
- and regno_pointer_align.
- * unroll.c (unroll_loop): Set regno_pointer_{flag,align} in
- remap table.
- * explow.c (memory_address, allocate_dynamic_stack_space):
- Pass additional arg to mark_reg_pointer.
- * Makefile.in (integrate.o): Includes regs.h.
-
- * alpha.c ({non,}aligned_memory_operand): Test REGNO_POINTER_ALIGN.
- (reg_or_unaligned_mem_operand): New function.
- (get_unaligned_address): Add new arg, EXTRA_OFFSET.
- * alpha.h ({CONSTANT,DATA}_ALIGNMENT): Align to at least BITS_PER_WORD.
- (PREDICATE_CODES): Add reg_or_unaligned_mem_operand.
- * alpha.md (extend{qihi,qisi,hisi}2): Allow unaligned memory
- as arg 1 and pass to extend_{q,h}idi2.
- (unaligned_extend{q,h}idi): New patterns.
- (extend{q,h}idi2): If unaligned memory, call above new patterns.
- (ext{q,l,w}h recognizer): Update to proper RTL.
- (ext define_split): Comment out for now; wrong and maybe useless.
- (unaligned_{load,store}hi): Do similarly to QImode.
- (movhi, reload_{in,out}hi): Call unaligned case differently.
-
-Wed Dec 27 11:38:20 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (mulsidi3{,_common}): Undo previous change using
- register classes instead of fixed registers for SI*SI->DI common
- mode multiplies.
-
- * rs6000.c (gpc_reg34_operand): Delete unused function.
- * rs6000.h (gpc_reg34_operand): Likewise.
-
- * rs6000.c (gpc_reg{3,4}_operand): Reorganize code and don't allow
- SUBREG's.
-
- * rs6000.c (rs6000_override_options): Do not allow -mcpu=common on
- little endian PowerPC's.
- (gpc_reg{0,3,4,34}_operand): New functions to match a specific
- register.
- (cc_reg{0,1}_operand): Likewise.
-
- * rs6000.h (reg_class): Add register classes for register 3 by
- itself, register 4 by itself, registers 3&4, and CR1.
- (REG_NAMES): Add support for new register classes.
- (REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Likewise.
- (PREDICATE_CODES): Add new predicate functions.
- (gpc_reg{0,3,4,34}_operand): Add declaration.
- (cc_reg{0,1}_operand): Likewise.
-
- * rs6000.md (common mode multiplication/division): Move/rename common
- mode calls so they are closer to define_expands that call them.
- Set attribute type to be jmpreg, rather than integer, so optimizer
- knows branch processing unit is used; make SI*SI->DI multiplier use
- register classes instead of hardwired registers.
- Add appropriate clobbers of CR0/CR1 as mandated by PowerOpen spec.
- (PowerPC SI*SI->DI multipliers): Add appropriate define_splits.
-
- * rs6000/t-{,x}newas (MULTILIB*): Don't build power2 or 601
- specific libraries.
-
-Tue Dec 26 21:52:18 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (fold_convert): When converting a NaN to
- another type, change the type of the node before returning it.
-
-Mon Dec 25 17:12:10 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-typeck.c (mark_addressable): Fix error in last change.
-
-Sun Dec 24 22:19:49 1995 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (output_function_epilogue): Use assemble_integer rather
- than calling ASM_OUTPUT_INT directly.
- * pa.h (ASM_OUTPUT_INT): Use labels for everything in the
- exception table section.
-
- * pa.c (print_operand): Don't call fprintf to output a register
- name. Use fputs instead.
-
- * pa.h (ASM_OUTPUT_FUNCTION_PREFIX): Strip any name encoding
- on the section name.
-
-Sun Dec 24 17:46:03 1995 Markus Theissinger <Markus.Theissinger@gmd.de>
-
- * toplev.c (main): Add -ax option.
- * gcc.c (struct compilers): Likewise.
- * final.c (end_final): Extended header increased to 11 words.
- (profile_after_prologue): FUNCTION_BLOCK_PROFILER uses
- count_basic_blocks instead of profile_label_no.
-
- * libgcc2.c (struct bb): Add flags field.
- (HAVE_POPEN): Test new define.
- (struct __bb, struct bb_{edge,func}): New structs.
- (__bb_init_{prg,file},__bb_{init,exit}_trace_func,__bb_trace_ret,
- (__bb_trace_func{,_ret},gopen,gclose): New functions.
-
- * sparc.h, i386.h, m68k.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER):
- Extension for -ax option (profile_block_flag == 2).
- (MACHINE_STATE_SAVE,MACHINE_STATE_RESTORE): New macros.
- (FUNCTION_BLOCK_PROFILER_EXIT): New macro.
- * sparc.c (output_function_epilogue), i386.c (function_epilogue):
- Use FUNCTION_BLOCK_PROFILER_EXIT.
- * m68k.c (output_function_epilogue): Likewise.
- * xm-sparc.h: Define HAVE_POPEN.
-
-Sun Dec 24 06:50:30 1995 Barrett Richardson (barrett@iglou.com)
-
- * floatlib.c (__divdf3): Rewrite to do software divide of two
- doubles instead of using __divsf3.
-
-Sun Dec 24 06:38:15 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * rs6000.md (movdf): Don't copy a word at a time; nearly always loses.
-
- * c-tree.h (DECL_C_BIT_FIELD): New macro.
- * c-decl.c (finish_struct): Set it when set DECL_BIT_FIELD.
- * c-typeck.c (mark_addressable, case COMPONENT_REF):
- Give error if taking address of a bit field.
-
- * gcc.c (unused_prefix_warning): Include machine_suffix if
- require_machine_suffix.
- (warn_B, warn_std, warn_std_ptr): New variables.
- (process_commands): Use them and NULL_PTR as WARN arg to add_prefix.
-
- * gcc.c (process_command): Give error for -c with -o and
- multiple compilations.
- (handle_braces): Rename variable "pipe" to "pipe_p".
-
- * expr.h (clrstr_optab): New declaration.
- (clear_storage): New parm, ALIGN.
- * tree.h (CONSTRUCTOR_TARGET_CLEARED_P): New macro.
- * genopinit.c (optabs): Add "clrstr%a%".
- * optabs.c (init_optabs): Initialize clrstr_optab.
- * expr.c (struct clear_by_pieces): New structure.
- (clear_by_pieces{,_1}, {is,mostly}_zeros_p): New functions.
- (clrstr_optab): New optab.
- (clear_storage): Rework to try to use clear_by_pieces, then
- new clrstr insn, then library call.
- (store_constructor): Track if target is already cleared.
- Clear target first if CONSTRUCTOR is mostly zeros.
- Don't write zeros if target has been cleared.
- Add new arg to clear_storage call.
- (expand_expr, case CONSTRUCTOR): Don't put static constructor
- in memory if mostly zero.
- * i386.md (clrstrsi): New pattern and associate anonymous pattern.
-
-Sat Dec 23 12:21:53 1995 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (output_move_double): Correctly identify and handle
- overlapping moves.
- * pa.md (movdi patterns): Eliminate earlyclobbers in mem<->gr cases.
- (movdf patterns): Likewise.
-
-Fri Dec 22 17:29:42 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_constructor): Don't call change_address on REG.
- (expand_expr, case CONSTRUCTOR): Likewise.
-
- * mips.c (expand_block_move): Preserve MEM flags in call to
- movstrsi_internal.
-
- * pa.c (emit_move_sequence): Don't try to set REGNO_POINTER_FLAG
- for a SUBREG.
-
- * reload.c (find_valid_class): New function.
- (push_reload): Use it in cases where a SUBREG and its contents
- both need to be reloaded.
-
- * toplev.c (rest_of_compilation): Never defer functions that
- contain nested functions.
-
-Fri Dec 22 15:55:00 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (function units): Add 403 support which deleted
- by accident on Nov 21st. Mark all compares from 602, 603, 604,
- 620, 403, like was done for rios{1,2} and 601 as needing the bpu,
- so that compares are hoisted far enough branches for zero cycle
- branch support.
-
-Fri Dec 22 15:13:47 1995 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.h (TARGET_UNROLL_STRLEN): New macro.
- * i386.c (output_strlen_unroll): New function.
- * i386.md (strlensi): New pattern.
-
-Thu Dec 21 18:53:31 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * /gnu.h (GNU_CPP_PREDEFINES): Add missing space after -Amachine(CPU).
-
-Thu Dec 21 12:23:42 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure ({powerpc,rs6000}*): Change --enable-cpu to --with-cpu.
- * rs6000.c (rs6000_select): Likewise.
-
- * rs6000/aix41.h (LINK_SPEC): Do not pass -bexport to the linker
- if -g and -shared.
-
-Wed Dec 20 11:23:39 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure ({powerpc,rs6000}-ibm-aix*): Merge these two into the
- same case statement. Aix 4 now generates -mcpu=common by default.
- ({powerpc,rs6000}*): Add support for --enable-cpu=<value> to
- select the default cpu to compile for.
-
- * rs6000/aix41.h (TARGET_DEFAULT): Make -mcpu=common default behavior.
- (PROCESSOR_DEFAULT): Likewise.
- (MULTILIB_DEFAULTS): Set mcpu=common.
-
- * rs6000.h (TARGET_CPU_DEFAULT): Define to be NULL if not defined.
- (PROCESSOR_COMMON): Set this to PROCESSOR_601.
- (PROCESSOR_POWERPC): Set this to PROCESSOR_604.
- (TARGET_OPTIONS): Add -mtune= switch.
- (rs6000_select): New structure to hold -mcpu=, -mtune= switches
- and the result of configuring --enable-cpu=.
- (OVERRIDE_OPTIONS): Pass TARGET_CPU_DEFAULT to
- rs6000_override_options.
-
- * rs6000.c (rs6000_cpu_string): Delete global variable.
- (rs6000_select): Define new global variable.
- (rs6000_override_options): Take default_cpu argument, and provide
- support for it and -mtune= in addition to -mcpu=.
-
- * rs6000/{aix{3newas,41},lynx,netware,powerpc}.h (ASM_SPEC): Add
- support for -mcpu=power2.
- * rs6000/{rs6000,sysv4}.h (ASM_SPEC): Likewise.
-
- * rs6000/{aix41,eabiaix,eabile,lynx,powerpc}.h (CPP_SPEC): Make
- sure all -mcpu=xxx targets are supports.
- * rs6000/{rs6000,sysv4,sysv4le}.h (CPP_SPEC): Likewise.
-
- * rs6000/t-x{newas,rs6000}: New files to be used when making a
- cross compiler, to prevent libgcc1-test from being made.
-
- * rs6000/t-{x,}newas (MULTILIB_*): Build multlilib libraries for
- power, power2, 601, powerpc, and common mode processors.
-
- * rs6000/aix41ppc.h: Delete, no longer used.
-
-Tue Dec 19 18:31:21 1995 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (mips_reg_names, mips_sw_reg_names, mips_regno_to_class):
- Add entry for new RAP reg.
- * mips.h (FIRST_PSEUDO_REGISTER): Increment.
- (FIXED_REGISTERS, CALL_USED_REGISTERS, REGISTER_NAMES,
- DEBUG_REGISTER_NAMES): Add entry for new RAP reg.
- (RAP_REG_NUM, RETURN_ADDRESS_POINTER_REGNUM): New macros.
- (RETURN_ADDR_RTX): Define.
- (ELIMINABLE_REGS, CAN_ELIMINATE, INITIAL_ELIMINATION_OFFSET):
- Add RETURN_ADDRESS_POINTER_REGNUM support.
- * emit-rtl.c (return_address_pointer_rtx): New global variable.
- (gen_rtx, init_emit_once): Add support for it.
-
-Tue Dec 19 15:08:31 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * collect2.c: Remove auto_export functionality.
-
-Tue Dec 19 10:57:23 1995 Kim Knuttila <krk@cygnus.com>
-
- * ppc-asm.h: Do not compile the register macros under winnt.
-
-Mon Dec 18 19:31:23 1995 Adam Fedor <fedor@wilma.Colorado.EDU>
-
- * objc/encoding.c (objc_alignof_type): Handle _C_PTR case.
-
-Mon Dec 18 18:40:34 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * combine.c (simplify_rtx, case SUBREG): For SUBREG of a constant,
- use <= instead of < when comparing mode sizes.
- (force_to_mode, case NOT): Use full mask inside the NOT operation.
-
- * expr.c (emit_block_move): When call emit_libary_call for bcopy,
- pass arguments using correct types and modes.
- (emit_push_insn, expand_assignment): Likewise.
- (clear_storage, store_expr): Likewise for memset and bzero.
- (store_constructor): Likewise for memset.
- * optabs.c (emit_cmp_insn): Likewise for memcmp and bcmp.
- * convex.c (expand_movstr_call): Likewise for memcpy.
- * m88k.c (expand_block_move): Likewise for memcpy and bcopy.
- * mips.c (block_move_call): Likewise for memcpy and bcopy.
- * mips.h (INITIALIZE_TRAMPOLINE): Likewise for cacheflush.
-
- * c-common.c (WCHAR_TYPE_SIZE): Add a default definition.
-
- * sdbout.c (sdbout_symbol, case FUNCTION_DECL): Use DECL_INITIAL
- instead of DECL_EXTERNAL to identify declarations.
-
- * svr4.h (ASM_IDENTIFY_GCC): Don't output stab here.
- (ASM_IDENTIFY_GCC_AFTER_SOURCE): Output stab here instead of above.
-
- * stmt.c (expand_asm_operands): Handle numeric constraints in
- with the default case.
-
-Mon Dec 18 16:49:43 1995 John F. Carr <jfc@mit.edu>
-
- * expr.h (expand_mult_highpart_adjust): Declare.
-
-Mon Dec 18 16:39:41 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_constructor): Fix error in last change: just
- copy MEM, but be sure to share address.
- (expand_expr, case CONSTRUCTOR): Likewise.
-
-Mon Dec 18 16:22:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (ASM_GENERATE_INTERNAL_LABEL): Put leading '*' in label
- string so as to not confuse dbxout.c.
-
-Mon Dec 18 09:44:56 1995 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__empty): An empty function used by the C++ frontend for
- defaulting cleanup actions.
-
- * tree.c (save_tree_status, restore_tree_status): Save and restore
- temporary_firstobj.
-
-Mon Dec 18 07:49:34 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (fixup_var_refs_1): Fix error in last change (when
- mode of VAR is not the same as PROMOTED_MODE).
-
-Sun Dec 17 12:14:37 1995 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (ASM_OUTPUT_FUNCTION_PREFIX): Don't surround section names
- with '$'; that confuses collect2.
- (ASM_OUTPUT_SECTION_NAME): Likewise.
-
- * sched.c (canon_rtx): Recursively look for equivalences;
- look for expressions equivalent to MEMs.
- (true_dependence): Canonicalize inputs before operating
- on their values.
- (anti_dependence, output_dependence): Likewise.
-
- * jump.c (follow_jumps): Don't follow an unconditional jump
- that is not a simple_jump.
-
- * pa.c (override_options): Make 7100 scheduling the default.
-
- * pa.md: Add 2nd reload peephole somehow omitted from Nov27 changes.
-
- * regclass.c (regclass): Use SECONDARY_RELOAD_CLASS if it's
- defined to avoid useless work.
-
- * combine.c (find_split_point): Try to split SET_DEST
- just like we do for SET_SRC.
-
-Sun Dec 17 11:37:25 1995 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * expmed.c (expand_mult_highpart): When doing widening multiply,
- put constant in a register.
- (expand_mult_highpart): When mode is word_mode use gen_highpart
- instead of right shift by size.
-
- * expr.c (expand_expr, case MULT_EXPR): Generalize code for widening
- multiply to handle signed widening multiply when only unsigned optab
- is defined, and vice versa.
-
-Sun Dec 17 07:35:50 1995 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax/vms.h (WCHAR_TYPE_SIZE): Define.
-
-Sun Dec 17 07:08:34 1995 Ronald F. Guilmette <rfg@monkeys.com>.
-
- * fp-test.c: New file.
-
-Sun Dec 17 07:06:03 1995 Peter Flass <flass@lbdc.senate.state.ny.us>
-
- * i370.md (cmpqi): Fix generation of literal operand of CLM instruction
- to avoid double literals (=X'=F'...).
-
-Sun Dec 17 06:57:02 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c: Try harder not to open or stat the same include file twice.
- Simplify include file names so that they are more likely to match.
- E.g. simplify "./a//b" to "a/b". Represent directories with simplified
- prefixes, e.g. replace "./a//b" with "a/b/", and "." with "".
- (absolute_filename): New function.
- (do_include): Use it.
- (read_name_map): Likewise; this makes things more consistent for DOS.
- (main, do_include, open_include_file): -M output now contains
- operands of -imacros and -include.
- (skip_to_end_of_comment): When copying a // comment, don't try to
- change it to a /* comment.
- (rescan, skip_if_group, skip_to_end_of_comment, macarg1): Tune.
- (rescan, skip_if_group, skip_to_end_of_comment, macarg1):
- If warn_comments is nonzero, warn if backslash-newline appears
- in a // comment. Simplify method for finding /* /* */ comment.
- (skip_if_group): Optionally warn if /* /* */ appears between # and
- a directive inside a skipped if group.
- (macarg): Optionally warn if /* /* */ appears in a macro argument.
- (strncat, VMS_strncat, vms_ino_t, ino_t): Remove.
- (INCLUDE_LEN_FUDGE): Add 2 if VMS, for trailing ".h".
- (INO_T_EQ, INO_T_HASH): New macros.
- (struct file_buf): New member `inc'.
- (expand_to_temp_buffer): Initialize it.
- (struct file_name_list): New member `inc'.
- (struct file_name_list): New member `st'.
- c_system_include_path is now 1 if not 0.
- fname is now an array, not a pointer.
- (struct include_file): New members `next_ino', `deps_output', `st'.
- Remove members `inode' and `dev'; they are now in `st'.
- (INCLUDE_HASHSIZE): Rename from INCLUDE_HASH_SIZE.
- (include_hashtab): Rename from include_hash_table.
- (include_ino_hashtab): New variable.
- (main): Store file status in struct stat, not in long and int pieces.
- Use base_name to strip prefixes from file names.
- When printing directory prefixes, omit trailing / and print "" as ".".
- Fatal error if the input file is a directory.
- (main, path_include): Regularize operands of -include, -imacros,
- -isystem, -iwithprefix, and -iwithprefixbefore.
- Regularize default include directories.
- (do_include):
- Allocate dsp with alloca, since fname is now dynamically allocated.
- Use -3 to represent a never-opened file descriptor.
- Make copy of file name, and simplify the copy.
- Use base_name to identify the end of fname's directory.
- Do not prepend dir for "..." if it matches the search list's first dir.
- open_include_file now subsumes redundant_include_p and lookup_import.
- Use bypass_slot to remember when to skip directories when including
- a file that has already been seen.
- Instead of using 0 to represent the working directory, and ""
- to represent a directory to be ignored, use "" for the former,
- and assume the latter has been removed before we get here.
- Assume the directory prefixes have already been simplified.
- Report as errors all open failures other than ENOENT.
- Fatal error if fstat fails.
- Use new deps_output member to avoid printing dependencies twice.
- (bypass_hashtab): New variable.
- (do_include, open_control_file, record_control_macro): New convention:
- control_macro is "" if the file was imported or had #pragma once.
- (pragma_once_marker): Remove.
- (redundant_include_p, include_hash, lookup_include, lookup_import,
- add_import, file_size_and_mode): Remove; subsumed by open_include_file.
- (skip_redundant_dir_prefix): Remove; subsumed by simplify_filename.
- (is_system_include, read_name_map, remap_include_file):
- Assume arg is a directory prefix.
- (base_name, simplify_filename, remap_include_file,
- lookup_ino_include, new_include_prefix): New functions.
- (open_include_file): New arguments `importing' and `pinc'.
- Move filename mapping into new remap_include_file function.
- First try to find file by name in include_hashtab;
- if that doesn't work, open and fstat it and try to find it
- by inode and dev in include_ino_hashtab.
- (finclude): Get file status from inc->st instead of invoking fstat.
- Store inc into fp->inc so that record_control_macro doesn't
- need to do a table lookup.
- (finclude, record_control_macro): Accept struct include_file *
- instead of char * to identify include file. All callers changed.
- (check_precompiled): Get file status from new argument `st'.
- (do_pragma): Output at most one warning about #pragma implementation.
- Always return 0 instead of returning garbage sometimes.
- (do_pragma, hack_vms_include_specification):
- Use base_name for consistency, and remove redundant code.
-
- From Per Bothner:
- Unify the 3 separate mechanisms for avoiding processing
- of redundant include files: #import, #pragma once, and
- redundant_include_p to use a single more efficient data structure.
- (struct file_name_list): Remove no-longer needed field control_macro.
- (dont_repeat_files, all_include_files): Remove, no longer used.
- (struct import_file): Renmed to struct include_file, moved earlier
- in file, renamed field name to fname, and added control_macro field.
- (pragma_once_marker): New constant.
- (import_hash_table): Renamed to include_hash_table.
- (import_hash): Renamed to include_hash.
- (IMPORT_HASH_SIZE): Renamed to INCLUDE_HASH_SIZE.
- (main, path_include): Don't clear removed control_macro field.
- (lookup_include): New function - look up fname in include_hash_table.
- (redundant_include_p): Re-write to use lookup_include.
- (lookup_import, record_control_macro): Likewise.
- (add_import): Defer fstat to caller. Combine two xmallocs into one.
- (do_once): Use pragma_once_marker in include_hash_table.
- (do_pragma): Re-implement to scan include_hash_table.
- (do_include): Use new lookup_include and add_import.
-
-Sun Dec 17 06:45:43 1995 John F. Carr <jfc@mit.edu>
-
- * configure (savesrcdir): Do not create paths with trailing "/.".
-
- * combine.c (try_combine): When checking for two sets of the same
- register in a split insn, also test for setting a ZERO_EXTRACT,
- STRICT_LOW_PART, or SUBREG.
-
-Sun Dec 17 06:37:00 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * reload.c (push_secondary_reload): Don't strip paradoxical SUBREG
- if reload_class is CLASS_CANNOT_CHANGE_SIZE.
-
-Sat Dec 16 18:24:20 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_assignment): Fix alignment parm in emit_block_move.
-
-Sat Dec 16 18:16:08 1995 John Hassey (hassey@rtp.dg.com)
-
- * local-alloc.c (optimize_reg_copy_2): Don't attempt
- optimization if destination register dies.
-
-Sat Dec 16 08:31:16 1995 Paul Eggert <eggert@twinsun.com>
-
- * fold-const.c (fold): Don't record overflow when negating
- unsigned constants.
-
-Sat Dec 16 07:45:11 1995 Gran Uddeborg (uddeborg@carmen.se)
-
- * configure (i[3456]-*-isc, gas, stabs): Remove crt* from extra_files
-
-Sat Dec 16 07:03:33 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * stor-layout.c (layout_record): When PCC_BITFIELD_TYPE_MATTERS,
- compute bitpos using field_size % type_align instead of field_size.
-
- * fixincludes (stdio.h): Fix return type of fread and fwrite
- on sysV68.
-
-Sat Dec 16 06:57:14 1995 Thomas Lundqvist (d0thomas@dtek.chalmers.se)
-
- * function.c (fixup_var_refs_1): Fix two incorrect calls to single_set.
-
-Fri Dec 15 22:30:27 1995 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * i386.h (REGISTER_MOVE_COST): Simplify.
-
-Fri Dec 15 22:30:27 1995 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.h (TARGET_CPU_DEFAULT*, PROCESSOR_*,
- TARGET_{LEAVE,386_ALIGNMENT,PUSH_MEMORY,ZERO_EXTEND_WITH_AND,
- DOUBLE_WITH_ADD,BIT_TEST}): New macros.
- * i386.c (ix86_cpu*, ix86_isa*): New global variables.
- (override_options): Add -mcpu and -misa support
- * i386.md: Use TARGET* macros.
- * i386/dgux.{c,h}: New files.
- * m88k/t-dgux: (GCC_FOR_TARGET, T_CFLAGS): New macros.
- * m88k/t-dguxbcs: New file.
- * m88k/x-{dgux,dguxbcs}: (GCC_FOR_TARGET, X_CFLAGS): Removed.
-
-Fri Dec 15 18:41:50 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * fixincludes (sys/wait.h): Add forward declaration of struct rusage
- on AIX 3.2.5.
-
-Fri Dec 15 18:39:36 1995 Marco S Hyman (marc@dumbcat.sf.ca.us)
-
- * xm-bsd386.h (DONT_DECLARE_SYS_SIGLIST): Defined.
-
-Fri Dec 15 18:36:42 1995 Gran Uddeborg (uddeborg@carmen.se)
-
- * i386/svr3dbx.h (DO_GLOBAL_DTORS_BODY): Delete; obsolete.
-
-Fri Dec 15 18:21:34 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386/i386iscgas.h, i386/t-iscscodbx: Deleted; long dead.
-
-Fri Dec 15 10:01:27 1995 Stan Cox <coxs@dg-rtp.dg.com>
-
- * configure (target_cpu_default) Set for 486/586/686
- (m88k-dg-dgux) Use t-dguxbcs instead of x-dguxbcs
- (i*86*) Change [345] to [3456]
- (i[3456]86-dg-dgux) Added
- * Makefile.in (out_object_file) Add MAYBE_TARGET_DEFAULT
-
-Fri Dec 15 08:05:49 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (init_temp_slots): New function.
- (init_function_start): Code moved to new function and called here.
- * toplev.c (rest_of_compilation): Call init_temp_slots.
-
- * expmed.c (store_bit_field): Don't use insv for BLKmode value.
- (store_split_bit_field): Set total_bits to BITS_PER_FOR for
- BLKmode value.
-
-Fri Dec 15 06:35:36 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * xcoffout.h (DBX_STATIC_BLOCK_END): Use macro arguments.
- (xcoff_begin_function_line, xcoff_current_function_file): Remove
- unused extern declarations.
- (DBX_OUTPUT_MAIN_SOURCE_FILENAME): Use macro argument.
- * xcoffout.c (xcoff_begin_function_line): Make static.
- (xcoff_inlining): Likewise.
- (xcoff_current_function_file): Likewise.
- (xcoff_output_standard_types): Remove TARGET_64BIT dependencies from
- int and unsigned int.
-
-Mon Oct 16 12:25:52 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fix-header.c: Support different kinds of functions (ANSI and
- Posix1). Enable ANSI proptotypes if __STRICT_ANSI__.
- (namelist_end): Removed.
- (std_include_table): Divide up functions into kinds.
- (add_symbols): New function.
- (read_scanfile, write_rbrac, main): Use new data structures.
-
-Thu Dec 14 19:17:12 1995 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * rs6000.md (umulsidi3): New pattern.
-
-Thu Dec 14 18:08:59 1995 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * expmed.c (expand_divmod, case TRUNC_DIV_EXPR): Only reject
- larger-than-HOST_BITS_PER_WIDE_INT modes for general constants,
- not for powers-of-2.
-
- * i960.md (andsi3): Match op2 with logic_operand, change constraints
- accordingly. Output andnot for negative op2.
- (iorsi3, xorsi3): Analogous changes.
- * i960.c (logic_operand): New function.
- (i960_print_operand): Handle code `C'.
- * i960.h (PREDICATE_CODES): Add logic_operand.
- (CONST_OK_FOR_LETTER_P): Handle `M'.
- * i960.md: Move all plain logical patterns together.
- * i960.h (SHIFT_COUNT_TRUNCATED): Define as 0 as appropriate.
-
- * clipper.md (untyped_call): New pattern.
-
- * m68k.md (ashrsi_31): New pattern.
-
-Thu Dec 14 17:22:14 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.c (output_move_double): Extract DFmode constants using
- REAL_VALUE_TO_TARGET_DOUBLE.
-
-Thu Dec 14 15:05:13 1995 Doug Evans <dje@cygnus.com>
-
- * Makefile.in (distclean): Delete float.h.
- * configure: Set CROSS_FLOAT_H from float_format.
- * config/float-i64.h: New file.
- * config/float-i32.h: New file.
- * config/float-vax.h: New file.
- * arm/cross-float.h: Delete.
- * arm/t-semi (CROSS_FLOAT_H): Delete.
-
-Wed Dec 13 19:16:57 1995 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_expr, case ADDR_EXPR): Ensure op0 isn't QUEUED.
-
-Wed Dec 13 19:12:21 1995 Paul Eggert <eggert@twinsun.com>
-
- * gcc.c (my_strerror): Return "cannot access" if errno is 0.
- (perror_with_name, pfatal_with_name, perror_exec): Don't assume that
- the returned value from my_strerror contains no '%'s.
- (sys_nerr): Declare only if HAVE_STRERROR is not defined.
-
-Wed Dec 13 19:05:47 1995 Alan Modra (alan@spri.levels.unisa.edu.au)
-
- * Makefile.in (c-parse.y, objc-parse.y): Add warning that file is
- automatically generated.
-
-Wed Dec 13 15:40:30 1995 Mike Stump <mrs@cygnus.com>
-
- * function.c (identify_blocks): Start with chain of BLOCKs to match
- rest of backend (dbxout.c), instead of just one BLOCK.
- (reorder_blocks, all_blocks): Likewise.
-
- * stmt.c (find_loop_tree_blocks): Pass the toplevel list of
- blocks, not just the first subblock.
-
-Wed Dec 13 16:11:18 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expmed.c (expand_divmod): Don't use TARGET if it's the wrong mode.
-
-Wed Dec 13 15:02:39 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * dbxout.c (struct typeinfo): Define.
- (typevec): Change to be struct typeinfo *. Change other uses as
- appropriate.
- (struct dbx_file): Define if DBX_USE_BINCL.
- (current_file): New static variable if DBX_USE_BINCL.
- (next_file_number): Likewise.
- (dbxout_init): If DBX_USE_BINCL, initialize new variables.
- (dbxout_start_new_source_file): New function.
- (dbxout_resume_previous_source_file): New function.
- (dbxout_type_index): New function.
- (dbxout_range_type): Use dbxout_type_index.
- (dbxout_type): Likewise. If DBX_USE_BINCL, initialize new typevec
- fields.
- * c-lex.c (check_newline): If DBX_DEBUGGING_INFO and write_symbols
- == DBX_DEBUG, call dbxout_start_new_source_file and
- dbxout_resume_previous_source_file when appropriate.
- * sparc/sunos4.h (DBX_USE_BINCL): Define.
- * svr4.h (DBX_USE_BINCL): Define.
-
-Wed Dec 13 06:52:40 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/win-nt.h (ASM_OUTPUT_EXTERNAL): Do not emit .extern for
- builtin functions.
-
-Tue Dec 12 15:37:48 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c: Replace many uses of fprintf with putc and fputs.
- (output_function_profiler): Use more efficient mnemonics, target
- dependent mnemonics, asm_fprintf, and reg_names array.
-
- * rs6000.h: Replace many uses of fprintf with putc and fputs.
-
- * rs6000.h (INT_TYPE_SIZE): Remove TARGET_64BIT dependency.
- (MAX_INT_TYPE_SIZE): Delete.
-
-Tue Dec 12 13:58:57 1995 Doug Evans <dje@cygnus.com>
-
- * t-h8300 (MULTILIB_{OPTIONS,DIRNAMES}): Add -mint32 support.
-
-Sun Dec 10 18:51:21 1995 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * rs6000.md (matcher for neg:SI (geu:SI ..)): Get ppc syntax right.
-
-Sun Dec 10 08:47:16 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (simplify_if_then_else): Convert "a == b ? b : a" to "a".
-
- * expr.c (expand_expr, case CONSTRUCTOR): If TREE_READONLY,
- set RTX_UNCHANGING_P in TARGET.
- (expand_expr, case COMPONENT_REF): If result is BLKmode,
- use that to access object too.
-
-Sun Dec 10 01:06:57 1995 Jeffrey A. Law <law@cygnus.com>
-
- * pa.md (millicode delay slot description): Remove reference
- to defunct TARGET_MILLICODE_LONG_CALLS.
-
-Sat Dec 9 18:05:03 1995 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (expand_expr, case INDIRECT_REF): Correct typo in May 8
- change.
-
- * sh.h (ADDRESS_COST): Define.
- * sh.md (subsi3): Rename to subsi3_internal. Add new define_expand
- to handle subtracting a register from a constant.
-
-Fri Dec 8 19:17:30 1995 Mike Meissner <meissner@beauty.cygnus.com>
-
- * rs6000.c (input_operand): Allow any integer constant, not
- just integers that fit in 1 instruction.
-
-Fri Dec 8 10:45:07 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm/lib1funcs.asm (RET, RETCOND): Define according to whether we
- are compiling for 32 or 26 bit mode.
- (all return instructions): Use RET or RETCOND as appropriate.
-
-Wed Dec 6 06:58:23 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.c (arm_gen_constant): New function.
- (arm_split_constant): Split most of the functionality into
- arm_gen_constant. Try to decide which way of handling the constant
- is optimal for the target processor.
-
- * arm.c (arm_prgmode): New enum.
- (target_{cpu,fpe}_name, arm_fast_multiply, arm_arch4): New variables.
- (all_procs): New table describing processors and capabilities.
- (arm_override_options): New function.
- (arm_return_in_memory): New function.
- (arm_rtx_costs): Adjust the multiply costs to cope with processors
- with fast multiplication instructions.
- (output_move_double): Use the ldm/stm variants more efficiently.
- Delete cases that can no-longer occur.
- (output_return_instruction, output_func_epilogue): Use TARGET_APCS_32,
- not TARGET_6 for determining the type of return instruction to emit.
- (final_prescan_insn case CALL_INSN): Use TARGET_APCS_32, not TARGET_6
- to determine condition preservation.
- * arm.h (CPP_SPEC): Add defines for the cpu type, hard or soft floating
- point, and the APCS PC size.
- (TARGET_*): Restructure.
- (ARM_FLAG_*): Many new definitions for different target options, not
- all of which are supported yet.
- (TARGET_SWITCHES): Use the ARM_FLAG_* definitions instead of explicit
- numbers.
- (prog_mode_type): New enum.
- (floating_point_type): Split emulated floating point into FP_SOFT[23].
- (OVERRIDE_OPTIONS): Call arm_override_options.
- (ARM_CPU_NAME): Default to NULL if not defined by a subtarget.
- (BYTES_BIG_ENDIAN): Can now be set as a compilation option.
- (RETURN_IN_MEMORY, DEFAULT_PCC_STRUCT_RETURN): New definitions.
- (GO_IF_LEGITIMATE_OFFSET): Use different HImode offsets if compiling
- for an architecture 4 target. The offsets for floating point
- constants are the same as for integers if compiling TARGET_SOFT_FLOAT.
- (GO_IF_LEGITIMATE_ADDRESS): Don't allow PRE_INC and POST_DEC if
- the size is more than 4 bytes. Restrict the range offsets for DImode;
- likewise for DFmode when TARGET_SOFT_FLOAT.
- (LEGITIMIZE_ADDRESS): Use symbol_mentioned_p, not LEGITIMATE_CONSTANT_P
- to determine if a constant address might be better in a register.
- Handle DFmode addresses in the same way as DImode if TARGET_SOFT_FLOAT.
- (LOAD_EXTEND_OP): If arm_arch4, then HImode also zero-extends.
- * arm.md (attributes): Rearrange order, so that condition clobbering
- can be automatically determined for call insns.
- (attribute cpu): Add new cpu ARM7.
- (attribute type): Add new type MULT.
- (attribute prog_mode): New attribute.
- (attribute conds): Clobbering of call insns can now be determined
- using prog_mode attribute.
- (function units "write_buf", "write_blockage"): Model the write buffer
- as two function units, so that conflicts are avoided more often.
- (funcion unit "core"): New function unit, so that elapsed cycles can
- be more accurately determined.
- (all anonymous patterns): Add names.
- (mulsidi3, umulsidi3): New patterns available with fast multiply
- variants.
- (all call insns): The conds attribute is now determined automatically.
- (zero_extendhisi): Expand for architecture 4 variants if appropriate.
- (*zero_extendhisi_insn): New pattern.
- (extendqi{hi,si}, extendhisi): Expand for architecture 4 variants if
- appropriate.
- (*extendhisi_insn, *extendqihi, *extendqisi): New patterns.
- (storehi_single_op): New expand.
- (movhi): Handle architecture 4 expansion.
- (*movhi_insn_arch4): New pattern.
- (*movhi_*): Adjust applicability conditions to handle architecture 4.
- (reload_outdf): Handle pre/post inc/dec reloads.
- (tablejump): Delete.
- (matcher for optimized tablejump): delete.
- (casesi): New expand.
- (casesi_internal): New pattern.
- * semi.h (EXIT_BODY): Delete.
- (TARGET_DEFAULT): Set to ARM_FLAG_APCS_32.
- (CPP_SPEC): Define.
- arm/cross-float.h: New file, used when building a cross-compiler.
- * t-semi: Don't define inhibit_libc when building libgcc2.a.
- (CROSS_FLOAT_H): Define.
-
- * arm.c ({symbol,label}_mentioned_p): New functions.
- (add_constant, dump_table, fixit, find_barrier, broken_move): New
- support functions for handling constant spilling.
- (arm_reorg): New constant spilling pass, for putting unhandlable
- constants into the rtl where we can load them efficiently.
- (output_load_symbol): Delete.
- * arm.h (SECONDARY_OUTPUT_RELOAD_CLASS): No need to handle floating
- point constants any more, since arm_reorg will deal with them.
- (LEGITIMATE_CONSTANT_P): Is now anything that doesn't contain a
- LABEL.
- (GO_IF_LEGITIMATE_ADDRESS): Recognize address expressions generated
- by arm_reorg, but only after reload has completed.
- (MACHINE_DEPENDENT_REORG): Define.
- (ASM_OUTPUT_SPECIAL_POOL_ENTRY): There should be nothing left in
- the pool, even if it might look like it.
- * arm.md (*movsi_insn): Much simpified now that constants are handled
- properly.
- (movaddr): New expand.
- (movsf, movdf): No need to force constants into the pool any more.
- (*movdf_hard_insn): Much simplified.
- (consttable_4, consttable_8, consttable_end, align_4): New patterns
- for supporting embedded constants.
-
- * configure: New target arm-semi-aof.
- * arm.c (strings_fpa): Use a form which is common to both GAS and
- ARMASM.
- (output_return_instruction, output_func_epilogue): Call
- assemble_external_libcall, before trying to generate an abort call
- in the assembler.
- (arm_asm_output_label): Call ARM_OUTPUT_LABEL, rather than assuming
- that labels are followed by a colon.
- (aof_text_section, aof_add_import, aof_delete_import,
- aof_dump_imports): New functions to support ARMASM assembler
- generation.
- * arm/aout.h: New file.
- * arm/aof.h: New file.
- * arm.h (most assembler-specific defines): Move to arm/aout.h.
- (CONSTANT_ADDRESS_P): Can't directly access constant strings when
- generating assembler for ARMASM.
- (ENCODE_SECTION_INFO): Don't define if generating ARMASM assembler.
- (ASM_OUTPUT_INTERNAL_LABEL): Generalize, so that it can be used
- with all targeted assemblers.
- (ASM_OUTPUT_LABEL): Call arm_asm_output_label.
- * riscix.h: Include arm/aout.h, not arm/arm.h.
- * riscix1-1.h: Likewise.
- * semi.h: Likewise.
- * arm/semiaof.h: New file.
- * arm/t-semiaof: New file.
-
-Mon Dec 4 22:17:37 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * gcc.c (LIBGCC_SPEC): Do link with libgcc when -shared.
- * alpha.h (LIBGCC_SPEC): Remove.
- * linux.h (LIBGCC_SPEC): Remove.
- * svr4.h (LIBGCC_SPEC): Remove.
- * i386/t-crtpic (TARGET_LIBGCC2_CFLAGS): Use -fPIC.
- * t-pa (TARGET_LIBGCC2_CFLAGS): Use -fPIC.
- * sparc/t-sunos41 (TARGET_LIBGCC2_CFLAGS): Use -fPIC.
- * sparc/t-sol2 (TARGET_LIBGCC2_CFLAGS): Use -fPIC.
- * configure (i386-linux): Use i386/t-crtpic.
-
- * i386/xm-sco.h: #define NO_SYS_SIGLIST.
-
-Mon Dec 4 21:30:37 1995 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * sh.c (shiftcosts): For SH3, max cost of arithmetic right shift is 3.
- (expand_ashiftrt): For SH3, if shift cost is more than 3, then
- call gen_ashrsi3_d to use shad instruction.
-
-Mon Dec 4 18:29:08 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * c-decl.c (finish_struct): Don't mess with the type of bitfields.
-
-Mon Dec 4 15:28:02 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_constructor, record): If field is READONLY,
- set RTX_UNCHANGING_P in TO_RTX.
-
-Mon Dec 4 12:59:33 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * sparc/t-sol2 (CRTSTUFF_T_CFLAGS): Use -fPIC unconditionally.
-
-Sun Dec 3 20:55:43 1995 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (ASM_OUTPUT_FUNCTION_PREFIX): Handle arbitrary sections.
- (ASM_OUTPUT_SECTION_NAME): Define.
-
-Sat Dec 2 22:19:16 1995 Jeffrey A. Law (law@cygnus.com)
-
- * pa.h: Replace many uses of fprintf with fputs.
- * pa.c: Likewise.
- * pa-pro.h: Likewise.
-
- * pa.h (SECONDARY_RELOAD_CLASS): Don't call secondary_reload_class
- to handle trivial cases.
- * pa.c (secondary_reload_class): Rework to be more efficient.
-
-Sat Dec 2 07:52:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (movsi): Don't split large constants in the
- movsi pattern, let the define_split split it later as needed.
-
-Fri Dec 1 16:00:42 1995 Brendan Kehoe <brendan@cygnus.com>
-
- * sparc.c (output_double_int): Handle CODE_LABEL's if v9.
-
-Fri Dec 1 09:13:23 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * m68k.md (decrement_and_branch_until_zero): Split into a
- define_expand and an anonymous define_insn.
- * fx80.md (decrement_and_branch_until_zero): Ditto.
- * m88k.md (decrement_and_branch_until_zero): Ditto.
-
-Thu Nov 30 15:02:16 1995 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * sh.c (noncall_uses_reg): New function.
- (machine_dependent_reorg): Add support for TARGET_RELAX.
- (final_prescan_insn): Likewise.
- * sh.h (ASM_SPEC, LINK_SPEC): Pass on -mrelax.
- (RELAX_BIT, TARGET_RELAX): New macros.
- (TARGET_SWITCHES): Add -mrelax.
-
- * sh.c (insn-attr.h): Include.
- (pragma_nosave_low_regs): New global variable.
- (calc_live_regs): If SH3 and pragma_nosave_low_regs, then don't
- save registers r0 through r7 for interrupt functions.
- (function_epilogue): Clear pragma_nosave_low_regs.
- (handle_pragma): Set pragma_nosave_low_regs if see pragma for it.
-
- * sh.h (FUNCTION_PROFILER): Use trap #33 instead of trap #5.
- Put additional .align before trapa instruction.
-
-Thu Nov 30 14:45:13 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * sparc.md (seqdi_special_trunc, snedi_special_trunc,
- seqsi_special_extend, snesi_special_extend): Delete uses of SUBREG.
- Make compare modes match modes of operands.
- (snesi_zero_extend, snedi_zero_trunc_sp32, snedi_zero_trunc_sp64,
- seqsi_zero_extend, seqdi_zero_trunc_sp32, seqdi_zero_trunc_sp64):
- New patterns.
-
-Thu Nov 30 12:27:22 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * genmultilib: Take a 4th argument that says are the exceptions to
- the multilibs, so illegal combinations can be eliminated.
-
- * Makefile.in (multilib.h): Pass $(MULILIB_EXCEPTIONS) as the 4th
- argument to genmultilib.
-
- * configure (powerpc*): Remove little endian and eabiaix versions
- of the t-* files. Accept powerpc{,le}-*-sysv in addition to
- *-sysv4.
- (powerpc{,le}-*-eabisim): Use standard t-eabigas instead of
- t-eabisim.
- (powerpcle-*-{winnt3,pe}): Add support for Windows NT on PowerPC.
- * rs6000/t-{eabiaix,eabisim,eabilegas,ppclegas}: Delete.
-
- * rs6000/{t-winnt,win-nt.h}: New files for PowerPC Windows NT.
-
- * ginclude/ppc-asm.h: New file to provide common macros for the
- various PowerPC calling sequences.
- * rs6000/eabi.asm: Use ppc-asm.h.
-
- * rs6000/aix3newas.h (CPP_SPEC): Add support for -mcpu=603e, 602,
- and 620.
- * rs6000/{aix41,powerpc,rs6000,eabi{aix,le}}.h (CPP_SPEC): Ditto.
- * rs6000/sysv4{,le}.h (CPP_SPEC): Ditto.
-
- * rs6000/aix3newas.h (LINK_SPEC): If cross compiling, don't use
- absolute paths.
- * rs6000/{aix41,aixppc,rs6000}.h (LINK_SPEC): Ditto.
-
- * rs6000/eabi.h (INVOKE__main): Don't define any more.
- (ASM_OUTPUT_INT): Move to sysv4.h.
- ({STARTFILE,LIB}_SPEC): If -msim or -mmvme add the appropriate
- libraries.
-
- * rs6000/{eabiaix,eabile,sysv4{,le}}.h (CPP_SPEC): Add support for
- -mcall-{aixdesc,nt} directives.
- (MULTILIB_DEFAULTS): Define.
-
- * rs6000/eabi{,le}sim.h (TARGET_DEFAULT, CPP_SPEC): No longer
- define, simulator supports floating point.
- ({STARTFILE,LIB}_SPEC): If -mvme, use mvme libraries, not
- simulator libraries.
-
- * rs6000/{mach,netware}.h (TARGET_AIX): Define as 0.
-
- * rs6000/netware.h (RS6000_OUTPUT_BASENAME): Don't redefine
- anymore.
- (STRIP_NAME_ENCODING): Undef.
-
- * rs6000.c (rs6000_save_toc_p, rs6000_abi): New globals.
- (rs6000_override_options): Add 602, 603e, and 620 support.
- (count_register_operand): New function to return true if operand
- is the count register.
- (easy_fp_constant): All constants are easy if -msoft-float.
- (volatile_mem_operand): New function to return true if operand is
- in volatile memory.
- ({fp_,}reg_or_mem_operand): Call volatile_mem_operand.
- (input_operand): Allow support for Windows NT loading SYMBOL_REFs
- and LABEL_REFs from the TOC.
- (function_arg_boundary): On Windows NT, any argument >= 8 bytes
- must be double word aligned.
- (function_arg{_advance,}): Call function_arg_boundary to determine
- if we need to align to an odd register for large arguments.
- Changes to accomidate new method of determining which ABI we're
- adhering to.
- (expand_block_move_mem): Copy RTX_UNCHANGING_P, and if
- MEM_UNALIGNED_P is defined, copy that too.
- (expand_block_move): Copy dest/src to registers using
- copy_addr_to_reg.
- (print_operand): Changes to accomidate Windows NT.
- (first_reg_to_save): Ditto.
- (rs6000_stack_info): Ditto.
- (debug_stack_info): Ditto.
- (output_{prolog,epilog,toc,function_profiler}): Ditto.
- (rs6000_stack_info): Save main's arguments around __eabi call.
- (svr4_traceback): Delete, current V.4 ABI no longer wants
- tracebacks in this format.
- (output_prolog): Call __eabi here, saving and restoring main's
- args if needed. Save the toc pointer if needed.
- (get_issue_rate): New function to return # of instructions a
- machine can issue at once.
- (rs6000_sync_trampoline): Emit instructions to synchronize the
- PowerPC caches after a trampoline.
- (rs6000_trampoline_{template,size}): New functions to provide
- common trampoline support for all ABI's.
- (rs6000_initialize_trampoline): Ditto.
-
- * rs6000.h (TARGET_{WINDOWS_NT,AIX,MACOS}): Define.
- (processor_type): Add 602.
- (PROCESSOR_COMMON): Assume current processor is a 604, not a 601.
- (SUBTARGET_OPTIONS): Define if not defined.
- (TARGET_OPTIONS): Include SUBTARGET_OPTIONS.
- (COUNT_REGISTER_REGNUM): Define as 66.
- (EXTRA_CONTRAINT): Add 'S' and 'T' for Windows NT.
- (rs6000_abi): Add ABI_AIX_NODESC, ABI_NT.
- (DEFAULT_ABI): Define if not defined.
- (rs6000_stack): Add fields for Windows NT support.
- (RS6000_SAVE_TOC): Add for Windows NT support.
- (FUNCTION_ARG_BOUNDARY): Call function_arg_boundary.
- (trampoline macros): Call trampoline functions in rs6000.c.
- (RETURN_ADDRESS_OFFSET): Add Windows NT support.
- (toc_section): Skip leading '*'.
- (PREDICATE_CODES): Add volatile_mem_operand,
- count_register_operand.
- (MACHINE_issue_rate): Define.
- (function decls): Add new function decls from rs6000.c.
-
- * rs6000.md (cpu attribute): Add 602.
- (function units): Update to match reality better.
- (calls through pointer): Rework to support Windows NT.
- (movsi): Add Windows NT support.
- (movstrsi): Remove match_operand predicates, since
- expand_block_move does the checking.
- (sync_isync): Delete.
- (icbi, dcbst, sync, isync): New insns to generate named instruction
- for making trampolines on eabi/V.4 properly flush the caches.
- (decrement_and_branch_on_count): Rename from
- decrement_and_branchsi. Add update of count in insn pattern.
-
- * rs6000/sysv4.h (TARGET_SWITCHES): Drop -mtraceback. Keep
- -mno-traceback but don't do anything with it. Add
- -mcalls-{nt,aixdesc}. Add -m{,no-}relocatable-lib. Add -msim,
- -mmvme, and -memb.
- (TARGET_TOC): Update for use with -mcalls-{nt,aixdesc}.
- (SUBTARGET_OVERRIDE_OPTIONS): Update for new switches.
- (RS6000_OUTPUT_BASENAME): Delete.
- (toc_section): Add support for -mcall-{nt,aixdesc}.
- (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Ditto.
- (ASM_DECLARE_FUNCTION_NAME): Use STRIP_NAME_ENCODING instead of
- RS6000_OUTPUT_BASENAME. For -mcall-{nt,aixdesc} emit the proper
- function descriptor.
- (ASM_SPEC): Pass appropriate -mxxx switches to the assembler based
- on the -mcpu=xxx options.
- (ASM_OUTPUT_INT): Move here from eabi.h.
- (ENCODE_SECTION_INFO): If -mcall-{nt,aixdesc} add approriate magic
- so function name has two or one leading periods.
- (ASM_OUTPUT_SOURCE_LINE): Delete, use version in svr4.h.
- (trampoline macros): Call trampoline functions in rs6000.c.
-
- * t-{eabi,ppc}{,gas} (EXTRA_HEADERS): Add ginclude/ppc-asm.h.
- (LIB2FUNCS_EXTRA): Depend on eabi.S, not eabi.s.
- (eabi.S): Rename from eabi.asm.
-
- * t-{eabi,ppc}gas (MULTILIB_*): Add -mcall-aixdesc libraries, but
- don't build either little endian or -mrelocatable versions of
- those libraries.
-
-Tue Nov 28 00:10:27 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (divsi3): Reorder so common mode does not negate
- power-of-2 shift optimization.
-
-Wed Nov 29 22:06:11 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * configure (sparc-*-solaris2*): Add gcrt1.o to extra_parts.
- * sparc/sol2.h (STARTFILE_SPEC): Link with gcrt1.o with -pg.
- * sparc/sol2-g1.asm: New file, startup code for profiled
- executables.
- * sparc/t-sol2: Add make rule for gcrt1.o.
- * sparc/gmon-sol2.c (_mcleanup): Add support for PROFDIR
- environment variable.
-
-Wed Nov 29 21:41:13 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * mips/abi64.h (CPP_SPEC): If -msingle-float and not
- -msoft-float, pass -D__mips_single_float. Likewise for -m4650 and
- not -msoft-float.
- * mips/dec-bsd.h (CPP_SPEC): Likewise.
- * mips/dec-osf1.h (CPP_SPEC): Likewise.
- * mips/elf64.h (CPP_SPEC): Likewise.
- * mips/iris3.h (CPP_SPEC): Likewise.
- * mips/iris5.h (CPP_SPEC): Likewise.
- * mips/mips.h (CPP_SPEC): Likewise.
- * mips/netbsd.h (CPP_SPEC): Likewise.
- * mips/osfrose.h (CPP_SPEC): Likewise.
- * mips/t-ecoff (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
- MULTILIB_MATCHES): Add -msingle-float support.
-
-Wed Nov 29 17:57:48 1995 Doug Evans <dje@cygnus.com>
-
- * toplev.c (main): Invoke OPTIMIZATION_OPTIONS after target_flags
- has been initialized so sets of target_flags aren't clobbered.
-
- * cccp.c (do_include): Recognize c:\foo as absolute path name in DOS.
-
- * svr4.h (MD_EXEC_PREFIX): Don't use if cross compiling.
- (MD_STARTFILE_PREFIX): Likewise.
- (LINK_SPEC): Don't use absolute path names if cross compiling.
- * svr3.h (LIB_SPEC): Likewise.
-
- * gcc.c (do_spec_1): Fix typos in version calculation.
-
-Wed Nov 29 14:06:13 1995 Jim Wilson <wilson@cygnus.com>
-
- * sh.md (ashrsi3_d): Use %0 not %1 in output pattern.
-
- * svr4.h (MAX_OFILE_ALIGNMENT): Define.
-
- * mips/iris5.h (WORD_SWITCH_TAKES_ARG): Define.
- (LINK_SPEC): Add rpath.
- * mips/iris6.h (LINK_SPEC): Likewise.
-
- * stupid.c (stupid_mark_regs): For hard registers, use regno+j
- instead of just regno in MARK_LIVE_AFTER and SET_HARD_REG_BIT calls.
-
- * c-common.c (combine_strings): Add support for WCHAR_TYPE as short.
-
-Wed Nov 29 13:59:58 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * c-decl.c (duplicate_decls): Add new parameter different_binding_level.
- Lots of changes to use new new parameter.
- (pushdecl): Delete variable declared_global. New variable
- different_binding_level and code to set it. Move extern/static
- warning before duplicate_decls call. Don't let global typedefs
- conflict with nested extern declarations. Move oldglobal test
- inside code for setting IDENTIFIER_LIMBO_VALUE.
- (lookup_name_current_level_global): Delete.
- * c-tree.h (merge_attributes): New declaration.
- * c-typeck.c (merge_attributes): New function. Move code from
- common_type to here.
- (common_type): Call merge_attributes instead of having inline code.
- * integrate.c (integrate_decl_tree): Delete variable newd.
- Always set DECL_ABSTRACT_ORIGIN before calling pushdecl.
-
-Tue Nov 28 21:57:04 1995 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (mips_function_value): Add check for i > 0 when deciding
- if structure should be return in FP registers.
-
-Tue Nov 28 12:47:52 1995 Jeffrey A. Law <law@cygnus.com>
-
- * pa.md (define split for (plus (reg) (large_constant)): Try
- another way to handle this with only 2 insns. From Tege.
-
-Mon Nov 27 02:05:18 1995 Jeffrey A. Law <law@cygnus.com>
-
- * lib1funcs.asm, pa-pro.h, t-pro.h, xm-papro.h: New PA
- target files.
- * configure (hppa*-*-pro*): Use new target files.
-
- * toplev.c (rest_of_compilation): Always call jump_optimize
- at least once.
-
- * pa.h (ASM_OUTPUT_EXTERNAL): Don't let assemble_name clobber
- the value of TREE_SYMBOL_REFERENCED.
-
- * pa-ghpux9.h (LINK_SPEC): Pass "-z" to the linker to enable
- trap on null pointer dereference for programs built on hpux9.
- * pa-hpux9.h, pa1-ghpux9.h, pa1-hpux9.h: Likewise.
-
- * pa.c (output_function_prologue): No longer need to keep
- track of the total number code bytes when TARGET_GAS &&
- not TARGET_PORTABLE_RUNTIME.
- * pa.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Use .NSUBSPA when
- not TARGET_PORTABLE_RUNTIME.
- (ASM_OUTPUT_FUNCTION_PREFIX): Define. Prefix functions with
- .NSUBSPA when TARGET_GAS and not TARGET_PORTABLE_RUNTIME.
-
- * pa.md (symbolic high patterns): Use 'H' to print the symbolic
- address so that the constant part gets rounded.
- * pa.c (print_operand): Handle 'H' operand for high part of a
- symbolic address with a rounded constant.
- (output_global_address): New argument "rounded_constant". All
- callers changed appropriately.
-
- * x-pa-hpux (FIXPROTO_DEFINES): Add -D_HPUX_SOURCE.
-
- * pa.h (CPP_SPEC): Only pass -D_HPUX_SOURCE and -D_HIUX_SOURCE if
- -ansi is not present.
- (CPP_PREDEFINES): Remove -D_HPUX_SOURCE and/or -D_HIUX_SOURCE.
- * pa-ghiux.h (CPP_PREDEFINES): Likewise.
- * pa-gux7.h (CPP_PREDEFINES): Likewise.
- * pa-hiux.h (CPP_PREDEFINES): Likewise.
- * pa-hpux.h (CPP_PREDEFINES): Likewise.
- * pa-hpux7.h (CPP_PREDEFINES): Likewise.
- * pa1-ghiux.h (CPP_PREDEFINES): Likewise.
- * pa1-hiux.h (CPP_PREDEFINES): Likewise.
-
- * pa-hpux.h (LINK_SPEC): If -mlinker-opt, then pass -O to the
- linker.
- * pa-ghpux.h, pa-hpux9.h, pa-ghpux9.h: Likewise.
- * pa1-ghpux9.h, pa1-hpux9.h: Likewise.
- * pa.h (LINK_SPEC): Likewise.
- (TARGET_SWITCHES): Add -mlinker-opt.
-
- * pa.md (all peepholes): Disable if TARGET_SOFT_FLOAT.
-
- * pa.c (pa_reorg): If TARGET_GAS, then emit insns to mark
- the beginning and end of the branch table.
- * pa.md (begin_brtab): New insn. Just a marker so GCC knows
- where to put the .begin_brtab pseudo-op.
- (end_brtab): Similarly.
-
- * pa.h (EXTRA_SECTIONS): Add in_ctors and in_dtors if
- CTORS_SECTION_FUNCTION is defined. Else define dummy
- versions of CTORS_SECTION_FUNCTION and DTORS_SECTION_FUNCTION.
- (EXTRA_SECTION_FUNCTIONS): Add CTORS_SECTION_FUNCTION and
- DTORS_SECTION_FUNCTION.
-
- * pa.md: Add peepholes to improve spill code generated
- by reload when we run out of FP registers.
-
- * xm-pa.h: Remove spurious double-quote.
-
- * pa.md (call expanders): For indirect calls, load %r22 with the
- function's address.
- (indirect call patterns): No need to copy the call address into
- %r22 anymore.
-
- * pa.c (output_cbranch): Fix buglet in length handling of
- backwards branches with unfilled delay slots.
- (output_bb, output_bvb, output_dbra, output_movb): Likewise.
-
- * pa.md: Fix off-by-one error in length computations for all
- conditional branch patterns.
-
- * pa.h (output_bvb): Declare.
- * pa.c (output_bvb): New function to output branch on variable
- bit insns.
- * pa.md (branch-on-variable-bit): New patterns.
-
- * pa.h (TARGET_MILLICODE_LONG_CALLS): Delete swtich and all
- references.
- (output_millicode_call): Declare new function
- * pa.md (millicode calls): Update length computation to handle
- variable length millicode calls.
- (call pattners): Likewise.
- (indirect call patterns): Update length compuations and output
- templates to handle variable length millicode calls.
- (plabel_dereference): Likewise.
- * pa.c (override_options): Give warnings when incompatable
- options are used.
- (output_mul_insn): Call output_millicode_call instead of
- output_call, eliminate last argument to output_millicode_call.
- (output_div_insn): Likewise.
- (output_mod_insn): Likewise.
- (output_call): Rewrite long call code to handle variable length
- millicode calls. Eliminate support for calling mul, div and mod
- millicode routines.
- (output_millicode_call): New function for calling mul, div and mod
- millicode routines.
-
- * pa.md (abssi2): New pattern.
-
- * pa.c (secondary_reload_class): Loads from reg+d addresses into
- FP registers don't need secondary reloads.
- * pa.h: Delete soem #if 0 code. Update some comments.
- (EXTRA_CONSTRAINT, case 'Q'): Only accept valid memory addresses.
-
- * pa.h (RTX_COSTS): Tege's rewrite.
-
- * pa.c (hppa_legitimize_address): Generate unscaled indexed
- addressing for (plus (symbol_ref) (reg)).
- (emit_move_sequence): Set REGNO_POINTER_FLAG appropriately
- to encourage unscaled indexing modes.
- (basereg_operand): New function for unscaled index address support.
- * pa.md (unscaled indexing patterns): New patterns for unscaled
- index address support.
-
- * pa.h (MOVE_RATIO): Define.
- * pa.md (movstrsi expander): Refine tests for when to use the
- library routine instead of an inlined loop copy. Provide an
- additional scratch register for use in the inlined loop copy.
- (movstrsi_internal): Name the pattern for ease of use. Add
- additional scratch register.
- * pa.c (output_block_move): Greatly simplify. Use 2X unrolled
- copy loops to improve performance.
- (compute_movstrsi_length): Corresponding changes.
-
- * pa.c (print_operand): Handle 'y' case for reversed FP
- comparisons. Delete some #if 0 code. Fix various comment typos.
- * pa.md (fcmp patterns): Try and reverse the comparison to avoid
- useless add,tr insns.
-
-Sun Nov 26 14:47:42 1995 Richard Kenner <kenner@mole.gnu.ai.mit.edu>
-
- * Version 2.7.2 released.
-
- * function.c (fixup_var_refs_1): Make pseudo for DEST
- in PROMOTED_MODE unless in a SUBREG.
-
- * cse.c (insert): Don't put a REG into qty_const.
-
- * msdos/top.sed: Change version to 2.7.2.
- * winnt/config-nt.sed: Likewise.
-
-Sun Nov 26 14:41:49 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * Makefile.in (stamp-objlist): Change .o to $objext.
-
- * alpha/win-nt.h (CPP_PREDEFINES): Set __unaligned and __stdcall
- to null.
- (ASM_SPEC): Add a translation for -g to -Zi.
- * winnt/ld.c (main): Don't pass -g to link.
- * winnt/oldnames.c: Reformat and add some new functions for gnat1.
- * winnt/win-nt.h (LINK_SPEC): Pass -g to ld.exe.
- Increase default stack size.
- * configure ({alpha-dec,i386-ibm}-winnt3.5): Add oldnames.o
- to extra_objs.
- * libgcc2.c (trampoline): Add getpagesize and mprotect for WINNT.
-
-Sun Nov 26 14:25:26 1995 Uwe Seimet (seimet@chemie.uni-kl.de)
-
- * atari.h (FUNCTION_VALUE): Deleted; incorrect.
-
-Sun Nov 26 14:23:03 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * fixincludes (curses.h): Allow space or tab after bool keyword,
- instead of tab or tab.
-
-Sun Nov 26 14:14:11 1995 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.md (pattern for HImode PSHM): Corrected.
- (trunchiqi2, zero_extendqihi2, extendhftqf2): Corrected.
- (pattern for movhi of CONST_INT to REG): Corrected.
- (divmodqi pattern for DISN): Corrected.
- (all shift patterns): Corrected.
-
- * 1750a.h (REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P): Corrected.
- (ASM_OUTPUT_[datatype]): Corrected datalbl[].size computation
- for output of arrays.
-
-Sun Nov 26 14:08:57 1995 Dave Love <d.love@dl.ac.uk>
-
- * mips/iris5.h (NO_IMPLICIT_EXTERN_C): Define this again so
- that unistd.h doesn't get badly `fixed' for C++. libg++ will now
- build with this definition.
-
-Sun Nov 26 14:02:43 1995 Robert E. Brown (brown@grettir.bibliotech.com)
-
- * configure: Better workaround for Nextstep bug.
-
-Sun Nov 26 13:55:07 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * rs6000.md (load_multiple matcher): Fix typo in opcode.
-
-Sun Nov 26 13:51:08 1995 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * final.c (final_start_function): Move call to sdbout_begin_function
- back to final_scan_insn on MIPS systems so parameter descriptions are
- recognized.
-
-Sun Nov 26 13:43:06 1995 DJ Delorie (dj@delorie.com)
-
- * msdos/top.sed: Don't insert "go32".
-
-Sun Nov 26 12:08:23 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * combine.c (nonzero_bits, case REG): Put POINTERS_EXTEND_UNSIGNED
- code before stack pointer code. Return nonzero at end of stack
- pointer code.
-
- * sparc.h (PRINT_OPERAND_ADDRESS): Handle CONST inside PLUS.
-
- * Makefile.in (cppalloc.o): Add a rule to build it.
-
- * alpha.c (alpha_emit_set_const): Don't output SImode sequences
- that rely on invisible overflow. Sign extend new when SImode.
- Don't recur if new == c. Don't allow shift outside mode. Make
- logical right shift be unsigned.
-
-Sun Nov 26 11:37:50 1995 Arne H. Juul (arnej@idt.unit.no)
-
- * Makefile.in (compare*): Add "|| true" to avoid spurious
- failure messages from some versions of make.
-
-Sun Nov 26 11:20:09 1995 Dmitry K. Butskoy (buc@stu.spb.su)
-
- * expr.c (truthvalue_conversion): Add declaration.
-
-Sun Nov 12 18:09:35 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * Version 2.7.1 released.
-
- * function.c (put_reg_into_stack): New arg volatile_p.
- (put_var_into_stack): Call with new arg.
-
-Sat Nov 11 08:25:34 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * reload.c (output.h): Include it.
- * Makefile.in (reload.o): Add dependence on output.h.
-
-Thu Nov 9 11:24:20 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * mips.h (HARD_REGNO_NREGS): If FP_REG_P, always use UNITS_PER_FPREG
- to calculate number of words needed.
-
-Thu Nov 9 11:04:50 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de)
-
- * 1750a.md (cmphf): Addd Base Reg with Offset address mode (LB,STB,..)
- (movqi,movhi,movhf,addqi3,addhf3,subqi3,subhf3,mulqihi3): Likewise.
- (mulhf3,divhf3,andqi3,iorqi3): Likewise.
- (define_peephole): Remove the Base mode peepholes. Replace the
- special addqi define_insn for "LIM Ra,sym,Rb" by a define_peephole.
- (ashlqi3): Took out futile 0th alternative.
- (lshrqi3, lshrhi3, ashrqi3, ahsrhi3): Correct case of non-constant
- shift count.
-
- * 1750a.h (REG_ALLOC_ORDER): Define.
- (REGNO_OK_FOR_BASE_P): Include stack pointer in test against
- reg_renumber[REGNO].
- (ASM_OUTPUT_DESTRUCTOR): Remove bogus assembler comment.
-
-Thu Nov 9 11:01:33 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_expr, case ARRAY_REF): Properly convert types
- of index, size, and multiplication.
-
-Wed Nov 8 09:00:22 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.md (mov*cc_{,soft_}insn): Use match_operator to test the
- comparison and check that the condition code register is used.
-
-Wed Nov 8 08:49:35 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (ASM_OUTPUT_{CONSTRUCTOR,DESTRUCTOR}): Undef before
- including svr4.h.
-
-Tue Nov 7 10:58:12 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * m68k.md (subxf3): Properly name pattern.
-
-Tue Nov 7 10:53:09 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * libgcc2.c (__{C,D}TOR_LIST): For AIX, initialize these arrays to
- 0,0, just like NeXT to avoid a warning message from the AIX 4.1
- linker.
-
-Tue Nov 7 09:58:34 1995 John F. Carr <jfc@mit.edu>
-
- * cppexp.c (cpp_lex): Correctly parse character constants.
-
-Tue Nov 7 09:52:15 1995 Jason Merrill <jason@yorick.cygnus.com>
-
- * rs6000.h (ASM_OUTPUT_{DES,CONS}TRUCTOR): Define.
-
-Mon Nov 6 10:27:15 1995 Doug Evans <dje@cygnus.com>
-
- * combine.c (force_to_mode): Fix typo.
-
-Sun Nov 5 18:37:02 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * m68k.md (cmpxf): Don't call force_const_mem, it looses for PIC;
- get predicates right instead. Get rid of separate DEFINE_EXPAND.
- (addxf3, subxf3, mulxf3, divxf3): Likewise.
- (All XFmode patterns): Delete `F' and `G' constraints.
- (absxf2, negxf2): Delete spurious condition on TARGET_FPA.
-
-Sun Nov 5 11:05:44 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * fixincludes (malloc.h): Fix return type of {m,re}alloc.
-
-Sun Nov 5 11:02:26 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * cse.c (invalidate): For a pseudo register, do a loop to
- invalidate all table entries, irrespective of mode.
-
-Sun Nov 5 10:57:43 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * combine.c (force_to_mode): Put in last change properly.
-
-Sun Nov 5 10:53:49 1995 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (CONDITIONAL_REGISTER_USAGE): Make sure FP regs
- get disabled regardless of PA1.0 vs PA1.1 code generation
- when TARGET_SOFT_FLOAT or TARGET_DISABLE_FPREGS is on.
-
-Sun Nov 5 10:49:43 1995 Doug Evans <dje@lisa.cygnus.com>
-
- * i960.c (emit_move_sequence): Add a scratch register to
- multi-reg stores.
- (i960_output_move_{double,quad}): New functions.
- (i960_print_operand): Handle new operand types E, F.
- * i960.md (movdi matchers): Rewrite.
- (store_unaligned_di_reg): New pattern.
- (movti matchers): Rewrite.
- (store_unaligned_ti_reg): New pattern.
-
-Sun Nov 5 10:45:24 1995 Ian Lance Taylor (ian@cygnus.com)
-
- * mips.h (MULTILIB_DEFAULTS): Define.
- * mips/elf64.h, mips/iris6.h (MULTILIB_DEFAULTS): Define.
-
-Sun Nov 5 10:41:48 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * reload.c (push_reload): Delete abort for RELOAD_OTHER case added
- in last change.
- * reload1.c (emit_reload_insns): For RELOAD_OTHER output reloads,
- output the reload insns in descending order of reloads.
-
- * sh.md (mulsidi3-1, mulsidi3, umulsidi3-1, umulsidi3): Enable.
- (smulsi3_highpart-1, smulsi3_highpart): New patterns.
- (umulsi3_highpart-1, umulsi3_highpart): Likewise.
- (movdi-1): Add r/x constraint.
- * t-sh (MULTILIB_OPTIONS): Add m2.
- (MULTILIB_DIRNAMES): Add m2.
- (MULTILIB_MATCHES): Define.
-
- * sparc.h (RTX_COSTS, case MULT): Check for TARGET_SPARCLITE.
-
- * abi64.h, elf64.h (CPP_SPEC): Add -EB and -EL support.
-
-Sat Nov 4 10:36:26 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.md (casesi_worker): Change constraint from = to +.
-
- * svr4.h (ASM_IDENTIFY_GCC_AFTER_SOURCE): Delete.
- (ASM_IDENTIFY_GCC): Output stab here.
-
-Sat Nov 4 10:32:37 1995 John Carr <jfc@mit.edu>
-
- * cpplib.c (finclude): Set current input pointer when input
- is not a regular file.
-
- * cppmain.c: Define progname, required by cpplib.
-
-Sun Oct 29 07:48:36 1995 Michael Meissner <meissner@cygnus.com>
-
- * xcoffout.h (DBX_FINISH_SYMBOL): Deal with names created via
- the __asm__ construct that start with a leading '*'.
- * xcoffout.c (xcoff_declare_function): Likewise.
-
-Sun Oct 29 07:45:41 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * stupid.c (stupid_mark_refs): Handle SUBREG of pseudo-reg in a
- SET_DEST same as we handle a pseudo-reg in a SET_DEST.
-
-Sun Oct 29 07:43:15 1995 Pat Rankin <rankin@eql.caltech.edu>
-
- * libgcc2.c (L_eh: __unwind_function): Implement for VAX.
- * vax.h (RETURN_ADDRESS_OFFSET, RETURN_ADDR_RTX): Define.
-
-Sun Oct 29 12:39:08 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>a
-
- * i386/sol2.h (CPP_PREDEFINES): Add -D__SVR4.
-
-Sun Oct 29 07:14:36 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * reload.c (find_equiv_reg): Check for nonsaving setjmp.
-
-Fri Oct 27 15:15:56 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * Makefile.in (out_object_file): Depend on TREE_H.
-
-Fri Oct 27 06:42:36 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (call_operand): Only allow reg 27 on NT too.
- * alpha.md (call_value_nt, call_nt): Force non-SYMBOL_REF
- into reg 27, just like for OSF.
-
- * rs6000.c (struct asm_option): Changed from struct option.
- (expand_block_move_mem): Remove erroneously-added line.
-
- * expr.c (clear_storage): SIZE is now rtx, not int.
- (store_constructor): Call clear_storage with rtx.
- (get_inner_reference): Convert index to precision of
- sizetype, not POINTER_SIZE.
- (expand_expr, case ARRAY_REF): Likewise.
- * expr.h (clear_storage): Second arg is rtx, not int.
-
-Fri Oct 27 05:45:58 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * combine.c (force_to_mode, case ASHIFTRT): Properly handle
- mask wider than HOST_WIDE_INT.
-
- * c-decl.c (pushdecl): Don't test TREE_PUBLIC when deciding whether
- to register a duplicate decl in the current block.
-
-Thu Oct 26 21:55:39 1995 Jason Merrill <jason@sethra.cygnus.com>
-
- * calls.c (expand_call): Don't trust the callee to copy a
- TREE_ADDRESSABLE type.
- * function.c (assign_parms): Likewise.
-
-Thu Oct 26 19:25:05 1995 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__unwind_function): Provide a default definition for
- implementations that don't yet have a function unwinder.
-
-Thu Oct 26 18:08:19 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (handle_directive): Don't treat newline as white
- space when coalescing white space around a backslash-newline.
-
-Thu Oct 26 17:57:34 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * mips-tdump.c (enum st): Define st_Struct, st_Union, and st_Enum.
- (st_to_string): Handle them.
- (type_to_string): Add fdp argument; pass it to emit_aggregate.
- (print_symbol): Add fdp argument; pass it to type_to_string.
- Handle st_Struct, st_Union, and st_Enum.
- (emit_aggregate): Add fdp argument. Handle opaque types. Map
- through RFD entries.
- (print_file_desc): Pass FDR to print_symbol.
- (main): Pass null FDR to type_to_string.
-
-Thu Oct 26 08:07:10 1995 Michael Meissner <meissner@cygnus.com>
-
- * configure (powerpc-ibm-aix[456789]*): Use rs6000/t-newas,
- not rs6000/t-rs6000.
- (rs6000-ibm-aix3.2.[456789]*): Likewise.
- (rs6000-ibm-aix[456789]*): Likewise.
-
- * rs6000/t-newas: Copy from t-rs6000.
- * t-rs6000: Don't build -mcpu=common multilib variants of libgcc.a.
-
- * rs6000.md (load_multiple insn): If address register is among regs,
- don't load it with a lwsi instruction, which is undefined on PowerPC.
-
-Thu Oct 26 08:01:32 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * dwarfout.c (output_compile_unit_die): Handle language_string
- of "GNU F77".
-
- * reload.c (find_reloads_address): When check for out of range constant
- plus register, accept any hard register instead of just fp, ap, sp.
-
- * combine.c (distribute_notes): For Oct 19 change, add additional
- check to verify that place has a valid INSN_CUID.
-
- * sparc/t-vxsparc (LIBGCC1_TEST): Define.
-
- * sh.md (negdi2): Use TARGET_LITTLE_ENDIAN.
-
- * combine.c (force_to_mode, case ASHIFTRT): Verify mode bitsize is
- within HOST_BITS_PER_WIDE_INT before shifting by it.
-
- * final.c (final_scan_insn): When recur for instruction in delay slot,
- add loop around recursive call in case the instruction gets split.
-
-Thu Oct 26 07:28:45 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * genrecog.c (write_tree_1): Avoid emitting '-2147483648'.
-
- * jump.c (duplicate_loop_exit_test): Return 0 if found
- a NOTE_INSN_LOOP_CONT.
-
-Tue Oct 24 15:30:14 1995 Jeffrey A Law <law@cygnus.com>
-
- * calls.c (expand_call): Make sure valreg is at least
- a full word.
-
-Sun Oct 22 19:35:41 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.h (INIT_SECTION_ASM_OP): Delete.
- (HAVE_ATEXIT): Define.
-
-Sun Oct 22 07:46:04 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * libgcc2.c (__fixuns[xds]fsi): #undef MIN and MAX before #include
- of limits.h.
-
- * pa.c (pa_adjust_cost): Use pa_cpu, not pa_cpu_attr.
-
-Sun Oct 22 07:38:58 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * alpha.h (CONST_OK_FOR_LETTER_P): Use 'U' for unsigned constants.
- * alpha.c (alpha_emit_set_const): Likewise.
- * mips.c (gen_int_relational): Likewise.
-
-Sun Oct 22 07:14:35 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * i386.c (i386_return_pops_args): Don't need a FUNDECL to
- check for type attributes in FUNTYPE.
-
-Sat Oct 21 18:17:42 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.md (define_delay): Don't accept any instruction for an annulled
- slot, only accept those for which in_delay_slot is yes.
- * sh.c (find_barrier): When hi_const returns true, increment count_si
- by two if found_si is true.
- Always use get_attr_length to compute length of instructions.
- If count_hi or count_si out of range at end, need two PREV_INSN calls
- not one.
- When create new label, set LABEL_NUSES to 1.
- (reg_unused_after): Ifdef out code for handling labels.
- (prepare_scc_operands): New local variable mode. Set it from
- sh_compare_op0 or sh_compare_op1. Use it instead of SImode in
- force_reg calls.
-
- * optabs.c (expand_float): Emit missing barrier after unconditional
- jump.
-
-Sat Oct 21 14:16:46 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * alpha.md (cmpdf): Make conditional on TARGET_FP.
-
-Fri Oct 20 19:11:12 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * combine.c (distribute_notes): Delete instructions without
- side effect that set a subreg of an unused register.
-
- * m68k.h (PREFERRED_RELOAD_CLASS): Check for !G constants
- for DATA_OR_FP_REGS also.
-
-Fri Oct 20 18:57:10 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * genmultilib: Output negations of unused alternatives, even if
- one of the alternatives is selected.
-
-Fri Oct 20 18:48:50 1995 Jeff Law (law@hurl.cygnus.com)
-
- * integrate.c (output_inline_function): Turn on flag_no_inline
- to avoid function integration once we begin writing deferred
- output functions.
-
-Fri Oct 20 18:46:33 1995 Michael Meissner <meissner@wogglebug.tiac.net>
-
- * rs6000.c (float_conv_temp): Delete global variable.
- (stack_temps): New static array to hold stack temps.
- (offsettable_mem_operand): Delete function.
- (offsettable_addr_operand, rs6000_stack_temp): New functions.
- (output_epilog): Zero stack_temps.
-
- * rs6000.h (offsettable_addr_operand): Declare instead of
- offsettable_mem_operand.
- (PREDICATE_CODES): Use offsettable_addr_operand.
- (float_conv_temp): Delete variable.
-
- * rs6000.md (move_to_float insns): Change move_to_float so
- that it doesn't have a clobber of the memory address, and instead
- passes the stack temp's memory address as one of the unspec args.
- (fix_truncdfsi2): Use rs6000_stack_temp to allocate the temp.
- (multiply, shift insns): Fix all cases of multiply and shift insns so
- that the right mnemonics are used for -mcpu=common with both
- -m{old,new}-mnemonics.
-
-Fri Oct 20 17:58:19 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * expr.c (safe_from_p, case RTL_EXPR): Return 0 if RTL_EXPR_SEQUENCE
- exists. Delete code to return 0 if exp_rtl is zero.
-
- * function.c (init_function_start): Don't call init_insn_lengths here.
- * toplev.c (rest_of_compilation): Call it here.
-
-Thu Oct 19 19:19:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-common.c (check_format_info): Make test for null pointer
- more general.
-
-Thu Oct 19 18:56:16 1995 Satoshi Adachi (adachi@wisdom.aa.ap.titech.ac.jp)
-
- * fixincludes (stdlib.h): Be more general in edit to change
- declaration of {c,m,re}alloc.
-
-Thu Oct 19 18:48:53 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * libgcc2.c (__udiv_w_sdiv): If we don't have sdiv_qrnnd, define
- dummy variant of __udiv_w_sdiv.
-
-Thu Oct 19 18:45:21 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * alpha.h (ASM_SPEC): If GNU as is the default, then pass -g to
- the assembler if -malpha-as. If GNU as is not the default, then pass
- -g to the assembler is not -mgas.
-
- * combine.c (distribute_notes): When search for new place to put
- REG_DEAD note, call distribute_links if this new place is between
- i2 and i3, and i2 uses the register.
-
-Thu Oct 19 18:41:36 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (float{,uns}sidf2): Rewrite to break the conversion
- process into several general insns.
- (move_to_float): New insns to move 2 integer regs into a float register
- through memory, taking endianess into account. Make sure that the
- floating temporary is a valid address. Use one temporary for all
- floats converted.
- (fix_truncdfsi2): Take endianess into account.
-
- * rs6000.c ({low_32_bit,offsettable_mem}_operand): The function
- low_32_bit_operand is now unused, delete it. New function
- offsettable_mem_operand to determine if a memory address is
- offsettable.
- * rs6000.h ({low_32_bit,offsettable_mem}_operand): Ditto.
- (PREDICATE_CODES): Ditto.
-
- * rs6000.{c,h} (float_conv_temp): New global.
- * rs6000.c (output_epilog): Zero out float_conv_temp.
-
- * Makefile.in (libgcc{1,2}.a): Allow LIB{1,2}FUNCS_EXTRA files to
- end in .S as well as .c and .asm.
-
-Wed Oct 18 17:56:45 1995 Jose Alonso (sidinf@fpsp.fapesp.br)
-
- * c-typeck.c (parser_build_binary_op): Warn about x^y==z, etc.
-
-Mon Oct 9 12:38:06 1995 Michael Meissner <meissner@cygnus.com>
-
- * protoize.c (reverse_def_dec_list): Silence compiler warnings.
-
-Mon Oct 9 12:35:54 1995 Andrew Cagney <cagney@highland.com.au>
-
- * ginclude/va-ppc.h (va_arg): Deal with long longs that would be
- passed in the 7th register, and are passed in the stack instead.
-
-Fri Oct 6 13:47:10 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * alpha.h (ASM_SPEC): Add -g.
-
-Fri Oct 6 13:42:50 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.h (alpha_{arg,auto}_offset): Make extern.
-
-Fri Oct 6 13:24:43 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (RETURN_ADDRESS_OFFSET): Correct previous change.
-
-Fri Oct 6 13:14:43 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * rtlanal.c (reg_set_last): Fix call to reg_set_between_p.
-
-Tue Oct 3 12:31:38 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (layout_type, case ARRAY_TYPE): Strip MAX_EXPR
- from upper bound when computing length if it just protects against
- negative length.
-
- * expr.c (emit_move_insn_1): When doing multi-word move, show
- output is clobbered.
-
-Tue Oct 3 12:26:07 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * cse.c (set_nonvarying_address_components, case AND): Add *pend to
- end. Add constant to start instead of subtracting it.
-
-Tue Oct 3 12:23:28 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * combine.c (simplify_rtx): In code that attempts to simplify
- conditional expressions, if the result is an NE around another
- comparison, return the original expression.
-
- * longlong.h (mips umul_ppmm): Use `l' and `h' constraints;
- remove mflo and mfhi instructions.
-
-Tue Oct 3 12:21:29 1995 Michael Meissner <meissner@cygnus.com>
-
- * ginclude/va-ppc.h (va_start, stdarg case): Call
- __builtin_next_arg, and ignore the result, so that the compiler
- can report the proper error, if the second argument is not the
- last argument.
-
-Tue Oct 3 12:02:51 1995 Kohtala Marko <Marko.Kohtala@ntc.nokia.com>
-
- * function.c (assign_stack_temp): Adjust full_size field of
- temp_slot when splitting an unused slot.
-
-Tue Oct 3 11:51:59 1995 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_builtin_return_addr): Break out functionality
- from expand_builtin.
- (expand_builtin): Call expand_builtin_return_addr.
- * rs6000.h (RETURN_ADDR_RTX): Remove call to copy_to_reg.
- Offset to return address is 4 when !TARGET_64BIT and v4_call_p,
- 8 otherwise.
- * sparc.h (RETURN_ADDR_RTX): Remove call to copy_to_reg.
- * alpha.h (RETURN_ADDR_RTX): New definition.
-
-Sun Oct 1 21:23:30 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (staticp, case INDIRECT_EXPR): Disable case.
-
- * expr.c (expand_expr, case COMPONENT_REF): If getting component
- of union of variable size, propagate TARGET.
-
-Fri Sep 29 07:48:09 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_expr): When storing promoted value, don't return
- MEM if address contains target.
-
-Thu Sep 28 14:30:03 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (rescan): Expand `#if foo && #bar' without a bogus
- complaint about preprocessor directives within macro args.
- Expand `foo' in `foo#bar' without requiring a space before `#'.
-
-Thu Sep 28 14:24:26 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (anonymous DImode shift patterns setting cc0): Turned
- off due to reload problems.
-
-Thu Sep 28 14:05:22 1995 Niklas Hallqvist (niklas@appli.se)
-
- * Makefile.in (USER_H): Move up so can override.
- (INSTALL_ASSERT_H): New definition.
- (install-headers): Use it.
- (stmp-int-hdrs): Handle USER_H being empty.
- * config/x-netbsd (INSTALL_ASSERT_H): Define as empty.
-
- * i386/netbsd.h (WCHAR_{TYPE,UNSIGNED,TYPE_SIZE}): Now int.
- * m68k/netbsd.h, ns32k/netbsd.h, sparc/netbsd.h: Likewise.
- * vax/netbsd.h: Likewise.
- (SIZE_TYPE): Use unsigned int.
-
- * m68k.c (output_scc_di): Swap operands when needed.
- * m68k.h (LEGITIMATE_PIC_OPERAND): Allow SYMBOL_REF_FLAG symref.
- * m68k.md: Make both assembler syntaxes do the same for PIC calls.
-
-Tue Sep 26 16:51:44 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * mips.c (override_options): Don't allow anything but integers to
- go in the HI/LO registers.
-
-Tue Sep 26 16:36:18 1995 John F. Carr <jfc@mit.edu>
-
- * c-common.c (check_format_info): Don't warn about format type
- mismatch if the argument is an ERROR_MARK.
-
-Mon Sep 25 17:50:50 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * stor-layout.c (put_pending_sizes): New function.
- * tree.h (put_pending_sizes): Add declaration.
- * tree.c (save_expr): Return original for ERROR_MARK.
-
-Fri Sep 22 19:20:01 1995 Jeff Law (law@hurl.cygnus.com)
-
- * expr.c (expand_builtin, case BUILT_IN_MEMCPY): Strip off
- all NOP exprs from the source and destination nodes, then
- set MEM_IN_STRUCT_P.
-
-Fri Sep 22 18:50:31 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi.h (ASM_OUTPUT_INT): Test for whether the integer
- being output is also a constant so &sym - &sym2 is not fixed up.
-
-Fri Sep 22 18:49:07 1995 Peter Flass (FLASS@LBDRSCS.BITNET)
-
- * i370.md (cmpsi): Add missing constraints to operand 1.
-
-Fri Sep 22 18:27:33 1995 Torbjorn Granlund <tege@matematik.su.se>
-
- * i386.h (CONST_OK_FOR_LETTER_P): Make `N' match range 0..255
- for `outb' instruction.
-
- * pyr.h (PRINT_OPERAND): Handle code `R' for REG.
- * longlong.h (pyr umul_ppmm): Use it.
-
-Fri Sep 22 18:24:38 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-parse.in (enumlist): Propagate error_mark_node.
-
- * c-aux-info.c (gen_type): Handle ERROR_MARK.
-
- * alpha.md (movdi): Avoid memory sharing problem when in reload.
-
-Wed Sep 20 14:27:09 1995 Peter Flass <flass@lbdrscs.bitnet>
-
- * mvs.h (FUNCTION_PROLOGUE): Maintain savearea forward chain
- per MVS standards.
-
-Wed Sep 20 14:20:52 1995 Torbjorn Granlund <tege@matematik.su.se>
-
- * pyr.md (cmphi recognizer): Make condition match constraints.
- (cmpqi recognizer): Likewise.
-
-Wed Sep 20 12:42:59 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * integrate.c (expand_inline_function): Do copy something setting
- the result register if it is setting it to itself and has a REG_NOTE.
-
- * integrate.c (set_decl_{origin_self,abstract_flags}): Treat
- a DECL_INITIAL of error_mark_node the same as one of NULL_TREE.
-
-Tue Sep 19 19:30:18 1995 Dave Pitts (dpitts@nyx.cs.du.edu)
-
- * i370.md (cmphi, movhi, movstricthi, extendhisi2): Correct generation
- of short integer (Halfword)
- ({add,sub,mul,and,ior,xor}hi3): Likewise.
- * i370/mvs.h (MACROPROLOGUE): New macro.
- (FUNCTION_{PRO,EPI}LOGUE): Added ability to use IBM supplied function
- prologue macros.
- (FUNCTION_PROLOGUE): Corrected function "in-line" prologue alignment
- problems.
- (ASM_DECLARE_FUNCTION_NAME): Changed alignment to FullWord.
- (ASM_OUTPUT_{SHORT,ASCII}): Reworked.
-
-Tue Sep 19 19:22:15 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * winnt/win-nt.h: Renamed from winnt/win-nt.h.
- (LINK_SPEC): Add -noinhibit-exec.
- * {alpha,i386}/win-nt.h: Renamed from {alpha,i386}/winnt.h.
- Include winnt/win-nt.h, not winnt/winnt.h.
- * winnt/oldnames.c: New file.
- * winnt/headers.mak (fixinc-nt.obj): Fix typo.
- * winnt/config-nt.bat: Change winnt.h to win-nt.h.
- * i386/config-nt.sed: Likewise.
- * configure ({alpha,i386}-*-winnt3*): Likewise.
-
-Mon Sep 18 14:00:45 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de)
-
- * 1750a.h (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS):
- Added R2 and R0_1.
- (REG_CLASS_FROM_LETTER): New letters 't' and 'z'.
- (EXTRA_CONSTRAINT): New letter 'Q'.
-
-Sun Sep 17 12:39:22 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * pa.h (ASM_DECLARE_FUNCTION_NAME): If a parameter's type
- has TYPE_NEEDS_CONSTRUCTING on, then it's passed by invisible
- reference.
-
-Sat Sep 16 17:42:33 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * loop.c (find_and_verify_loops): Fix error in last change.
-
-Sat Sep 16 08:38:22 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.h (GO_IF_LEGITIMATE_ADDRESS): Disallow SYMBOL_REF for
- current function.
-
- * cse.c (recorded_label_ref): New variable.
- (insert): Set instead of cse_jumps_altered.
- (cse_main): Initialize it and return 1 if nonzero at end.
-
-Fri Sep 15 18:26:49 1995 Torbjorn Granlund (tege@matematik.su.se)
-
- * fold-const (div_and_round_double): Change `carry', `quo_est',
- and `scale' from plain int to `unsigned HOST_WIDE_INT'.
-
-Fri Sep 15 18:24:24 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cse.c (insert): Set cse_jumps_altered when inserting a LABEL_REF.
-
-Fri Sep 15 17:29:41 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de)
-
- * 1750a.c (b_mode_operand): New function.
- (print_operand): Added code 'Q'.
-
-Fri Sep 15 17:27:23 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * loop.c (find_and_verify_loops): When moving exit blocks out of
- the loop, verify that the target of P is within the current loop.
-
- * reorg.c (fill_slots_from_thread): Update thread if it is split.
-
-Fri Sep 15 17:06:51 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (decrement_and_branchsi and related insns): Don't use
- a "2" to select a register preference for operand 1 if operand 2
- hasn't been seen yet.
- Add appropriate clobbers in decrement_and_branchsi.
- Add patterns where the pc/label_ref are interchanged.
-
- * Makefile.in (gnucompare, stmp-multilib-sub): Remove extra . in
- front of $(objext).
-
- * rs6000.c (output_toc): Align DF constants if STRICT_ALIGNMENT.
-
- * config/fp-bit.c (FLO_union_type): Add words field if double
- precision to get at the separate words.
- (FLO_union_type, pack_d, unpack_d): Use FLOAT_BIT_ORDER_MISMATCH
- to determine when the bitfields need to be reversed, and
- FLOAT_WORD_ORDER_MISMATCH when the words need to be reversed.
-
-Fri Sep 15 16:41:43 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * reorg.c (fill_simple_delay_slots): When filling insn's delay slot
- with JUMP_INSN, don't assume it immediately follows insn on
- unfilled slots obstack.
-
- * Makefile.in (caller-save.o): Depend on insn-codes.h.
-
-Thu Sep 14 17:41:49 1995 Jim Meyering (meyering@comco.com)
-
- * protoize.c (do_cleaning): Don't blank out backslash-escaped
- newlines in double quoted strings.
-
-Thu Sep 14 16:20:35 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * emit-rtl.c (gen_lowpart): If gen_lowpart_common fails
- for a REG, load it into a pseudo and try again.
-
-Thu Sep 14 14:15:16 1995 Stan Cox (coxs@dg-rtp.dg.com)
-
- * m88k.h (VERSION_INFO1): Removed BCS reference.
- * m88k/dgux.h (ASM_SPEC, *_LEGEND):
- Added -mno-legend option. -mstandard no longer implies that
- legend information not be produced.
- (LINK_SPEC): Removed -z text
-
-Tue Sep 12 19:05:39 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * cccp.c (is_system_include): Call skip_redundant_dir_prefix.
-
-Tue Sep 12 18:58:21 1995 John Carr <jfc@mit.edu>
-
- * sparc.md: Change `*return "string"' to "string" in patterns.
-
-Tue Sep 12 18:48:47 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * function.c (put_var_into_stack): For CONCAT case, order of
- placement depends on FRAME_GROWS_DOWNWARD, not STACK_GROWS_DOWNWARD.
-
-Tue Sep 12 18:34:10 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * va-sparc.h (v9 varargs va_start): Handle __builtin_va_alist
- being stack argument.
-
- * sparc.h (STATIC_CHAIN_REGNUM): Use %g5 for sparc64.
- (TRAMPOLINE_TEMPLATE): Rewrite for sparc64.
- (TRAMPOLINE_SIZE): Is 40 for sparc64.
- * sparc.c (sparc64_initialize_trampoline): Rewrite.
-
-Tue Sep 12 18:30:22 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * cp/Make-lang.in (cc1plus) : Removed unnecessary $(exeext).
-
- * configure: Added code to handle gcc_extra_objs.
- (alpha-winnt): Changed xmake_file to winnt/x-winnt.
- Added extra_gcc_objs=spawnv.o; changed extra_programs to ld.exe.
- (i386-winnt): Changed xmake_file to winnt/x-winnt.
- Added extra_gcc_objs=spawnv.o; changed extra_programs to ld.exe.
- * configure.bat: Changed to used common winnt/config-nt.bat.
- * Makefile.in: Changed various .o's to .$(objext)'s
- (specs): Removed unnecessary $(exeext).
- (EXTRA_GCC_OBJS): New variable.
- (clean): Removed $(LIB2FUNCS_EXTRA)
- * objc/Makefile: Changed archive command for libobjc.a to use $?
- for objects.
-
- * alpha/x-winnt, i386/x-winnt: Deleted.
- * alpha/config-nt.bat, i386/config-nt.bat: Deleted.
- * alpha/config-nt.sed, i386/config-nt.sed: Moved architecture
- independent commands to config/winnt/config-nt.sed.
- * alpha/winnt.h: Added -D_M_ALPHA to CPP_PREDEFINES.
- Changed LIB_SPEC to be compatible with Gnu ld for NT.
- * i386/winnt.h: Added -D_cdecl=__attribute__((__cdecl__)).
- Change LIB_SPEC to be compatible with Gnu ld for NT.
- * winnt/config-nt.bat, winnt/config-nt.sed: New files.
- * winnt/dirent.{c,h}, winnt/fixinc-nt.c, winnt/headers.mak: New files.
- * winnt/ld.c: Changed precedence of libraries to look for
- libfoo.lib before libfoo.a
- Changed to work like Gnu ld for NT.
- * winnt/libgcc.mak, winnt/mklibgcc.c: New files.
- * winnt/spawnv.c: Changed spawn function entry points to __spawn*
- instead of spawn*.
- * winnt/x-winnt: New file.
- * fixinc-nt.sed: New file.
- * fixinc.winnt: Rewritten to use fixinc-nt.sed.
-
- * gcc.c: Remove fix_argv kludge.
-
-Tue Sep 12 13:24:17 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (power subdi3 pattern): Fix pattern to have 5
- alternatives, and correct 4th alternative to match reality.
-
- * rs6000.md (adddi3, subdi3, negdi2): Add constraints so output reg
- does not overlap one reg with one of the inputs.
-
-Tue Sep 12 13:09:48 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.c (output_scc_di): Fixed for non-SGS_CMP_ORDER syntax.
-
- * collect2.c (scan_libraries): Cast lsyms' alloca to LDSYM*.
-
-Tue Sep 12 13:04:12 1995 Niklas Hallqvist (niklas@appli.se)
-
- * stmt.c (expand_start_stmt_expr): Do stack adjust in right place.
-
- * stdarg.h (__gnuc_va_list): Make char * for NetBSD.
-
-Tue Sep 12 12:44:46 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * ginclude/va-ppc.h (va_arg): Reorganize to avoid BIND_EXPRs of
- aggregate or array type.
-
-Tue Sep 12 12:42:27 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Fix HP/UX <sys/file.h> for g++ -pedantic-errors.
-
- * fixincludes (curses.h): typedef bool need not take up entire line.
-
-Mon Sep 11 19:05:42 1995 Stan Cox (coxs@dg-rtp.dg.com)
-
- * c-typeck.c (digest_init): Don't recursively call digest_init
- when in traditional mode if the type is invalid.
-
-Mon Sep 11 18:58:26 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de)
-
- * 1750a.md: Added DLB/DSTB peepholes for HFmode.
- Corrected mnemonics for HImode DSTB peephole.
-
-Mon Sep 11 18:48:06 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * config/fp-bit.c (FLO_union_type): Remove bitfields to set sign,
- exponent, and mantissa, and add value_raw field, which is an
- integer of the appropriate type. If _DEBUG_BITFLOAT is defined,
- provide little and big endian bitfields. If the macro
- FLOAT_BIT_ORDER_MISMATCH is defined, use explicit bitfields.
- (pack_d, unpack_d): Switch to use value_raw and explicit shifts
- and masks so that we don't have to worry about whether the target
- is big or little endian unless FLOAT_BIT_ORDER_MISMATCH is
- defined. If single precision floating point, rename to pack_f and
- unpack_f, so there is no confusion in the debugger.
-
- * rs6000.h (rs6000_abi): New enumeration to describe which
- ABI we're conforming to.
- (rs6000_stack): Use abi enum, not AIX vs. V.4 boolean.
- (ASM_OUTPUT_OPTIONS): New macro to print output options in .s file.
- (ASM_FILE_START): Use it.
- (output_options,rs6000_float_const): Declare new functions.
-
- * rs6000.c (output_option{,s}): New functions to write -f, -m,
- and -W options to the asm file.
- (rs6000_float_const): New function to generate floating point
- constants portably used in signed,unsigned -> double conversions.
- (rs6000_stack_info,debug_stack_info): Use ABI enumeration instead
- of AIX vs. V.4 boolean.
-
- * rs6000.md (float{,uns}sidf2): Call rs6000_float_const to
- portably build the proper floating point constant for conversions.
- (movdi): Properly handle movdi of CONST_{INT,DOUBLE} on little
- endian systems.
-
- * rs6000/sysv4.h (LIBGCC2_WORDS_BIG_ENDIAN): Define to be 0/1
- depending on the target endianess.
- (ASM_FILE_START): Define, to call output_options in addition to
- output_file_directive.
- (TRAMPOLINE_SIZE): Correct size to match code.
-
- * rs6000/eabi{,le}sim.h (CPP_SPEC): Define the correct endian
- macro for varargs/stdargs use.
-
-Mon Sep 11 18:41:58 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * c-decl.c (redeclaration_error_message): For TYPE_DECLs, return 0
- if TYPE_MAIN_VARIANT of old type is same as new type.
-
-Mon Sep 11 17:39:35 1995 Rob Ryan (robr@cmu.edu)
-
- * xcoffout.c (xcoff_inlining): New variable, used in place of
- xcoff_current_include_file when determining whether to use
- absolute line numbers.
- (xcoffout_source_file): Switched to using xcoff_inlining to
- determine when to emit .bi/.ei directives.
-
-Mon Sep 11 16:55:06 1995 Torbjorn Granlund <tege@matematik.su.se>
-
- * m68k.md (cmpdi): Change patterns to allocate scratch register at
- RTL generation time.
- (tstdi): Likewise.
-
-Sun Sep 3 09:03:50 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (size_binop): Don't pass 1 to NOTRUNC.
-
-Thu Aug 31 19:27:00 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * libgcc2.c: Include longlong.h.
- [L_udivdi3 || L_divdi3 || L_umoddi3 || L_moddi3] (__udivmoddi4):
- Define this `static inline' when defining these, so they all
- remain leaf functions.
-
-Thu Aug 31 18:38:21 1995 Paul Eggert <eggert@twinsun.com>
-
- * c-parse.in (ends_in_label): New %union member.
- (stmts, stmt_or_label): Use new member to avoid lexical lookahead hack.
- (lineno_stmt_or_labels): New rule.
- (lineno_stmt_or_label, stmt_or_label): Yield nonzero if it ends
- in a label.
-
-Thu Aug 31 08:31:40 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cse.c (canon_hash, CONST_DOUBLE): Hash integer and real
- differently.
- * varasm.c (struct rtx_const): Add new field DI to union.
- (decode_rtx_const, case CONST_DOUBLE): Use to hash CONST_DOUBLE
- representing an integer.
-
- * va-alpha.h (__gnuc_va_list): Make __offset an int.
- * alpha.c (alpha_builtin_saveregs): Properly compute address
- of __offset both OSF and WINNT.
-
- * xm-alpha.h (sbrk): Don't define here.
- * gmon.c (sbrk): Define here for __alpha.
- * toplev.c (sbrk): Likewise.
- * mips-tfile.c (malloc, calloc, realloc): Don't define for anybody.
-
- * reload.c (push_reload): Add case for output reload of a SUBREG
- of a hard reg when output mode is invalid for that mode.
- In both that case and existing case for in, don't remove SUBREG.
- * reload1.c (emit_reload_insns): Emit RELOAD_OTHER output reloads last.
-
-Tue Aug 29 19:16:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-common.c (decl_attribute, case A_PACKED): Check is_type first.
- (decl_attribute, case A_T_UNION): Likewise.
- Don't access TYPE_FIELDS if DECL is zero.
- * c-decl.c (finish_struct): If transparent_union attribute
- specified, validate it once we finish laying the union out.
-
-Mon Aug 28 05:58:03 1995 Paul Eggert <eggert@twinsun.com>
-
- * arm.c (arm_gen_movstrqi): Remove unused variable const_sxteen.
-
- * bi-lexer.c (buffer, inpoint): Remove unused variables.
-
- * i370/mvs.h, i370/mvs370.c (mvs_label_emitted): Renamed
- from mvs_label_emited.
-
- * msdos/configur.bat: Fix misspelling of `maintainer-clean'.
-
-Sat Aug 26 06:57:17 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * reload.c (push_secondary_reload): If X is a paradoxical SUBREG,
- get mode and thing to reload from inside.
- * reload1.c (emit_reload_insns): Do nothing for SUBREG whose
- operand is unused subsequently.
- In secondary reload case, if paradoxical SUBREG for output, reload
- thing inside SUBREG, just like gen_reload.
-
-Fri Aug 25 19:26:53 1995 Paul Eggert <eggert@twinsun.com>
-
- * c-typeck.c (set_init_label): Don't die if an entire
- brace-pair level is superfluous in the containing level.
-
-Fri Aug 25 19:22:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure (powerpc{,le}-eabisim): Add support for a new target
- that works under the PSIM simulator.
- * rs6000/eabisim.h, rs6000/eabilesim.h, rs6000/t-eabisim: New files.
-
- * rs6000/eabi.h (STRICT_ALIGNMENT): If little endian, always set
- strict alignment to 1.
-
-Fri Aug 25 19:22:23 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md ({add,sub,mulsi}di3): Support both endian possibilities.
- (negdi2): Likewise.
-
-Fri Aug 25 19:10:41 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de)
-
- * 1750a.md: Added peephole definitions for Load/Store Base insns
- and eliminating redundant load in an equivalent store/load sequence.
-
-Fri Aug 25 18:33:27 1995 Craig Burley (burley@gnu.ai.mit.edu)
-
- * toplev.c (report_error_function): Don't attempt to use input
- file stack to identify nesting of #include's if file name oflocation
- diagnosed is not same as input_filename.
-
-Fri Aug 25 07:31:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * integrate.c (output_inline_function): Switch to function obstack.
-
-Mon Aug 21 13:29:54 1995 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * i386.c (arithmetic_comparison_operator): New function.
- (print_operand): Take into account that overflow flag is not
- set the same as after a compare instruction.
- * i386.md (decrement_and_branch_until_zero): Use
- arithmetic_comparison_operator to decide if there is comparison
- suitable to be expressed by condition code from an arithmetic op.
-
-Mon Aug 21 13:26:13 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (adddi3, subdi3): "&" added to clobber's constraints.
-
-Mon Aug 21 12:11:14 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * t-sparclite (MULTILIB_*, LIBGCC, INSTALL_LIBGCC): Define.
-
- * sh.md (movdi-1, movdf-1): Make conditional on reload_completed,
- delete conditions checking for pseudo registers and Q addresses.
- Add code to handle SUBREG.
-
- * local-alloc.c (wipe_dead_reg): Make a register mentioned in a
- REG_INC note die after the instruction.
-
- * m68k.md: For all dbra pattern, change constraint from 'g' to 'd*g'.
-
- * Makefile.in: (underscore.c): Rename rule to stamp-under, and
- touch stamp-under at the end. Add new rule for underscore.c that
- depends on stamp-under.
-
- * sh.c (reg_unused_after): For a SEQUENCE, make sure all insns are
- safe before returning 1.
-
- * sh.h (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN): Define.
-
- * sh.c (output_stack_adjust): Add new argument reg. Use it instead
- of stack_pointer_rtx.
- (sh_expand_prologue, sh_expand_epilogue): Pass new argument to
- output_stack_adjust.
-
-Sat Aug 19 17:34:15 1995 Jim Wilson <wilson@phydeaux.cygnus.com>
-
- * sparc/gmon-sol2.c (_mcount): Define.
- * sparc/sol2.h (STARTFILE_SPEC, ENDFILE_SPEC): Delete superfluous
- -pg tests.
- (LINK_SPEC): Add libp directories to -Y when -pg.
-
- * unroll.c (calculate_giv_inc): Handle increment computed by ASHIFT.
-
-Sat Aug 19 17:28:56 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (subdi3): Should not be commutative.
- (one_cmpldi2): Fixed typo with register operand.
-
-Sat Aug 19 17:20:43 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (output_prolog): Fixup code to set stack pointer
- if stack size > 32k.
- * rs6000.md (sync_isync): Renamed from sync; added an isync insn
- after the sync to properly deal with PowerPC's with split I/D caches.
- * sysv4.h (INITIALIZE_TRAMPOLINE): Sync function now named sync_isync.
-
-Sat Aug 19 17:07:09 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * h8300.h (STATIC_CHAIN_REGNUM): Use r3.
- (REGISTER_NAMES): Print r7 as sp.
- (ADDITIONAL_REGISTER_NAMES): Recognize r7.
- (ASM_OUTPUT_ALIGN): Alignment is power of 2.
- * h8300.md (fancy_btst,fancy_btst1): Branch target must be
- operand 0 for length attribute to work.
-
-Sat Aug 19 16:43:11 1995 Paul Franklin <paul@cs.washington.edu>
-
- * assert.h: Declare __eprintf with attribute noreturn.
-
-Sat Aug 19 16:40:12 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * stddef.h: Don't define wchar_t if __cplusplus is defined.
-
-Tue Aug 15 18:01:01 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (warning_with_line): Fix typo in declaration when
- !HAVE_VPRINTF and defined (__STDC__).
-
-Tue Aug 15 17:57:54 1995 Stephen L Moshier <moshier@world.std.com>
-
- * real.c (ediv, emul): Set sign bit of IEEE -0.0 result.
-
-Tue Aug 15 17:49:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (safe_from_p): Only safe if EXP is variable-size and X
- is BLKmode.
-
- * stmt.c (fixup_gotos): When some fixups done, reset to point
- to next instead of zeroing TREE_VALUE, which may be shared.
-
-Mon Aug 14 09:15:45 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * m68k/m68kemb.h (STARTFILE_SPEC): Define as empty.
-
-Mon Aug 14 09:08:57 1995 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax.c (vms_check_external): Update `pending_head' properly
- when the first list element is removed.
-
-Mon Aug 14 09:01:32 1995 Jeffrey A. Law <law@adder.cygnus.com>
-
- * pa.md (call expanders): Emit a blockage insn after restoring
- %r19 when generating PIC.
-
-Sun Aug 13 21:58:49 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * toplev.c (main): Change text of unsupported -g option warning.
-
-Sun Aug 13 21:47:57 1995 Andrew McCallum <mccallum@graphite.cs.rochester.edu>
-
- * objc/selector.c (sel_get_any_typed_uid): New function.
- * objc/objc-api.h (sel_get_any_typed_uid): Declare new function.
-
-Sun Aug 13 21:43:17 1995 John Carr <jfc@mit.edu>
-
- * c-typeck.c (c_expand_asm_operands): Check for read-only output
- operand where the variable is read-only but the type is not.
-
-Sun Aug 13 21:16:12 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (direct_return): Epilogue required if CR saved.
-
-Sun Aug 13 19:09:25 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * configure (hppa1.?-hp-hpux10): Recognize and treat just like hpux9.
-
-Sun Aug 13 19:07:23 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * i960.md (movdi matchers): Fix src/dest order in unaligned
- reg->reg case.
-
-Sun Aug 13 18:49:01 1995 DJ Delorie <dj@delorie.com>
-
- * i386/xm-dos.h (HAVE_STRERROR): New definition.
-
- * msdos/configur.bat: Add missing carriage return.
-
-Sun Aug 13 18:40:55 1995 Andrew Cagney <cagney@highland.com.au>
-
- * Makefile.in (USER_H): Add va-ppc.h.
-
-Sun Aug 13 18:36:17 1995 M. Warner Losh <imp@village.org>
-
- * stmt.c (expand_asm_operands): Type '0'..'4' operands may
- allow regs, so move them to the default case.
-
-Sun Aug 13 18:32:35 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (warning_with_line): New function.
- (trigraph_pcp): Use it, to avoid reporting line number.
- (vwarning_with_line): Don't report line number if zero.
-
-Sun Aug 13 18:23:08 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * toplev.c (vmessage): Support four arguments.
-
-Sun Aug 13 18:19:51 1995 Michael Meissner <meissner@cygnus.com>
-
- * ginclude/stdarg.h: Add ppc svr4 calling sequence support.
- * ginclude/varargs.h: Likewise.
- * ginclude/va-ppc.h: New file.
-
-Sun Aug 13 18:05:20 1995 Michael Gschwind <mike@donoussa.vlsivie.tuwien.ac.at>
-
- * configure (pdp-*-*): Add support for t-pdp11.
- * t-pdp11: New file.
- * Makefile.in (LIBGCC2_CFLAGS): Add TARGET_LIBGCC2_CFLAGS.
-
-Sun Aug 13 14:50:58 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * final.c (final_start_function): Always call sdbout_begin_function
- and xcoffout_begin_function, even if no line number info.
-
- * mips/abi64.h (SETUP_INCOMING_VARARGS): In if statement, only
- subtract one for stdarg. Don't subtract PRETEND_SIZE from
- argument pointer when calculating stack address.
- * mips.h (INITIAL_ELIMINATION_OFFSET): For 64 bit ABI, subtract
- current_function_pretend_args_size when converting from argument
- pointer.
- * va-mips.h (va_start): For stdarg, delete separate define for
- 64 bit ABI. For varargs, don't subtract 64, and only add -8 when
- all argument registers are used.
-
- * gcc.c (main): When concat gcc_exec_prefix and
- standard_startfile_prefix, put machine_suffix in the middle.
-
- * iris6.h (INIT_SECTION_ASM_OP): Don't define.
- (LD_INIT_SWITCH, LD_FINI_SWITCH, HAS_INIT_SECTION): Don't undef.
- (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Ifdef out.
- * configure (mips-sgi-irix6, mips-sgi-irix5cross64): Define
- use_collect2 to yes.
-
- * combine.c (move_deaths): When have a multi-reg hard register,
- if don't find a note, then recur for each individual hard register.
-
- * cse.c (set_nonvarying_address_components): Handle addresses
- which are the sum of two constant pseudo regs.
- (cse_rtx_addr_varies_p): Likewise.
-
- * Makefile.in (gfloat.h): Add a - before the rm command.
-
- * loop.c (find_and_verify_loops): Set dest_loop only if
- JUMP_LABEL (insn) is non-zero.
-
-Mon Jul 31 14:31:53 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Avoid clobbering VxWorks drv/netif/if_med.h file.
-
-Sat Jul 29 16:21:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * collect2.c: (XCOFF_SCAN_LIBS): Define if OBJECT_FORMAT_COFF and
- XCOFF_DEBUGGING_FORMAT.
- (SCAN_LIBRARIES): Also define if XCOFF_SCAN_LIBS.
-
-Sat Jul 29 16:19:42 1995 Stuart D. Gathman <stuart@bmsi.com>
-
- * collect2.c (scan_libraries): Implement for AIX.
-
-Sat Jul 29 09:59:33 1995 Michael Gschwind <mike@lanai.vlsivie.tuwien.ac.at>
-
- * configure: (pdp11-*-bsd) New target.
- * 2bsd.h: New file.
-
- * pdp11.c (output_move_double): Handle CONST_INT parameters properly.
- * pdp11.h (RTX_COSTS): Fill in missing default values.
- * pdp11.md (truncdfsf2, extendsfdf2, floatsidf2, fix_truncdfsi2):
- Allow register parameters, required by gcc to generate correct code.
- * xm-pdp11.h: Include tm.h.
-
-Sat Jul 29 09:55:17 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure (m68k-*-linux*aout*, m68k-*-linux*): New targets.
- * m68k/linux-aout.h, m68k/linux.h, m68k/t-linux, m68k/xm-linux.h: New.
- * m68k.md [USE_GAS]: Output `jbsr' instead of `jsr' for normal
- function calls and `bsr.l' instead of `bsr' for pic function calls.
-
-Sat Jul 29 09:44:13 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.h (CAN_DEBUG_WITHOUT_FP): Comment out.
-
- * reload.c (find_reloads_address_1, case PLUS): When handle SUBREG,
- add SUBREG_WORD offset to SUBREG_REG register number.
- (find_reloads_address_1, case SUBREG): If a pseudo register inside
- a SUBREG is larger than the class, then reload the entire SUBREG.
- * sh.h (SUBREG_OK_FOR_INDEX_P): New macro.
- (INDEX_REGISTER_RTX_P): Use it.
-
-Sat Jul 29 09:33:19 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * mips/netbsd.h (CPP_SPEC): Fix typo.
-
- * configure (a29k-*-vxworks*): Define extra_parts for crt{begin,end}.o.
- * t-a29k, t-a29kbase, t-vx29k ({,CROSS_}LIBGCC1): Define as empty.
-
-Sat Jul 29 09:15:17 1995 Jeffrey A. Law <law@rtl.cygnus.com>
-
- * pa/lib2funcs.asm (gcc_plt_call): Rewrite to avoid the need
- for being called by _sr4export. Inline expand $$dyncall to
- avoid the need for long-call and PIC support.
-
-Sat Jul 29 07:30:04 1995 Oliver Kellogg (Oliver.Kellogg@space.otn.dasa.de)
-
- * ms1750.inc (ucim.m, ucr.m, uc.m): New.
- * 1750a.md (cmpqi): Account for unsigned comparisons.
- (rotrqi3, rotrhi3): Reworked.
- * 1750a.c (notice_update_cc): INCM and DECM set condition codes.
- (unsigned_comparison_operator, next_cc_user_is_unsigned): New fcns.
- * 1750a.h (FUNCTION_EPILOGUE): Local variables freed from SP, not FP.
- (ASM_OUTPUT_BYTE): Make distinct from ASM_OUTPUT_CHAR.
- (ASM_OUTPUT_CONSTRUCTOR): Add FILE arg to assemble_name.
-
-Fri Jul 28 09:40:07 1995 Jeffrey A. Law <law@rtl.cygnus.com>
-
- * pa.h (DO_GLOBAL_DTORS_BODY): Use an asm statement to keep optimizer
- from deleting an assignment it believes dead.
-
-Fri Jul 28 08:47:51 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * unroll.c (unroll_loop): When preconditioning, output code to
- execute loop once if initial value is greater than or equal to final
- value.
-
- * configure (lang_specs_files, lang_options_files): Add $srcdir to
- file names when adding them to these variables.
-
- * c-typeck.c (pointer_int_sum): Don't distribute if intop is unsigned
- and not the same size as ptrop.
-
- * function.c (assign_stack_temp): When split a slot, set base_offset
- and full_size in the newly created slot.
- (combine_temp_slots): Update full_size when slots are combined.
-
- * sh.c (reg_unused_after): New function.
- * sh.md (define_peephole): Add peepholes to use r0+rN addressing mode
- for some address reloads.
-
- * final.c (final_start_function): If SDB_DEBUG, call
- sdbout_begin_function. If XCOFF_DEBUG, call xcoffout_begin_function
- instead of xcoffout_output_first_source_line.
- (final_scan_insn): Don't call sdbout_begin_function or
- xcoffout_begin_function.
- * xcoffout.c (xcoffout_output_first_source_line): Delete.
- (xcoffout_begin_function): Call dbxout_parms and
- ASM_OUTPUT_SOURCE_LINE.
-
- * va-mips.h: Change every occurance of #if __mips>=3 to
- #ifdef __mips64.
- * mips/abi64.h (CPP_SPEC): Output -D__mips64 when -mips3, or -mips4,
- or -mgp64. Output -U__mips64 when -mgp32.
- * mips/dec-bsd.h, mips/elf64.h, mips/iris3.h: Likewise.
- * mips/iris5.h, mips/mips.h, mips/netbsd.h, mips/osfrose.h: Likewise.
-
- * i960.c (i960_function_epilogue): Don't clear g14 for functions with
- an argument block.
- (i960_output_reg_insn): Likewise.
- (i960_output_call_insn): Clear g14 for functions wtih an argument
- block.
-
-Fri Jul 28 08:43:52 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * i960.c (i960_arg_size_and_align): Correct alignment of XFmode
- values in library calls.
- * i960.md (movdi matchers): Support odd numbered regs.
-
-Fri Jul 28 08:37:25 1995 Michael Gschwind <mike@lanai.vlsivie.tuwien.ac.at>
-
- * pdp11.md (divhi3, modhi3, divmodhi4): Rewrite.
-
-Wed Jul 26 10:15:52 1995 Hallvard B Furuseth (h.b.furuseth@usit.uio.no)
-
- * collect2.c (end_file): Fix typo in error message text.
-
-Wed Jul 26 09:22:22 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * xm-pa.h (USE_C_ALLOCA): Always define.
- * xm-pahpux.h (USE_C_ALLOCA): Likewise.
-
- * x-pa (CC): Remove useless definition.
- * xm-pa.h (HAVE_STRERROR): Define.
- (__BSD_NET2__): Define.
-
-Wed Jul 26 09:10:25 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * expr.c (preexpand_calls): Don't look past a CLEANUP_POINT_EXPR.
-
-Wed Jul 26 08:43:42 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * cse.c (cse_insn): When do special handling for (set REG0 REG1),
- must delete REG_EQUAL note from insn if it mentions REG0.
-
- * loop.c (find_and_verify_loops): When moving blocks of code, verify
- that the just destination is not in an inner nested loop.
- (mark_loop_jump): Don't mark label as loop exit if it jumps to
- an inner nested loop.
-
-Wed Jul 26 08:40:31 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (do_include, read_name_map): Omit leading "./" and
- trailing "/" when it makes sense.
- (skip_redundant_dir_prefix): New function.
-
-Wed Jul 26 08:36:41 1995 Michael Meissner <meissner@cygnus.com>
-
- * stmt.c (emit_nop): Do not emit a nop if there is a single
- insn before a label or at the start of a function.
-
-Wed Jul 26 08:21:21 1995 Doug Evans <dje@cygnus.com>
-
- * Makefile.in (gfloat.h): Delete previous copy before updating.
-
-Wed Jul 26 08:18:29 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * Makefile.in (STAGESTUFF): Add stamp-crtS.
- (crtbeginS.o, crtendS.o, stamp-crtS): New rules; just like
- crtbegin.o et al, but compiled using -fPIC.
- * configure (*-*-gnu*): Add crtbeginS.o and crtendS.o to $extra_parts.
-
-Wed Jul 26 08:11:52 1995 Michael Gschwind <mike@java.vlsivie.tuwien.ac.at>
-
- * pdp11.md: Fixed typos ('bhos' -> 'bhis').
-
-Wed Jul 26 08:05:41 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * hp320.h, m68k.h, m68kv4.h (LEGITIMATE_PIC_OPERAND_P): Reject
- CONST_DOUBLE with MEM with invalid pic address.
- * reload1.c (real.h): Include it.
- * Makefile.in (reload1.o): Depends on real.h.
-
-Wed Jul 26 07:58:22 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * gcc.c (MULTILIB_DIRS): Provide default if not defined.
- (multilib_defaults): New static variable.
- (default_arg): New static function.
- (set_multilib_dir): Ignore default arguments.
- (print_multilib_info): Ignore entries which use default arguments.
-
-Tue Jul 25 10:06:09 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (allocate_stack): Don't copy the LR register to
- the new stack end.
- * rs6000.c (rs6000_stack_info): Correctly store the LR in
- the caller's frame, not the current frame, for V.4 calls.
- * rs6000/eabi.asm (_save*, _rest*): Provide all mandated V.4 save
- and restore functions, except for the save*_g functions which
- return the GOT address.
-
-Fri Jul 21 14:24:25 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/eabi.h (__eabi): Load up r13 to be the small data
- pointer, unless -mrelocatable.
-
- * rs6000/aix3newas.h (LINK_SPEC): Import machine independent
- functions if -mcpu=common.
- * rs6000/milli.exp: Import file referenced in aix3newas.h.
-
- * rs6000/eabi.asm (__eabi): Support for fixing up user initialized
- pointers when -mrelocatable is used.
- * rs6000/eabi.h (ASM_OUTPUT_INT): Record any pointers initialized
- by the user if -mrelocatable, to be fixed up by __eabi.
- (CONST_SECTION_ASM_OP): If -mrelocatable, put read-only stuff in .data,
- not .rodata, to allow user initialized pointers to be updated by __eabi.
-
- * rs6000.h (TARGET_SWITCHES): Add -mdebug-{stack,arg}.
- (TARGET_{ELF,NO_TOC,TOC}): Add defaults for non system V.
- (rs6000_stack): New structure to describe stack layout.
- (RS6000_{REG_SAVE,SAVE_AREA,VARARGS_*}): New macros used to
- support both AIX and V.4 calling sequences.
- (FP_ARG_*, GP_ARG_*): Ditto.
- (FP_SAVE_INLINE): Ditto.
- (STARTING_FRAME_OFFSET): Modify to support both AIX and V.4
- calling sequences.
- (FIRST_PARM_OFFSET): Ditto.
- (REG_PARM_STACK_SPACE): Ditto.
- (STACK_POINTER_OFFSET): Ditto.
- (FUNCTION_ARG_REGNO_P): Ditto.
- ({,INIT_}CUMULATIVE_ARGS): Ditto.
- (LEGITIMATE_LO_SUM_ADDRESS_P): Ditto.
- (FUNCTION_ARG{,_ADVANCE,PARTIAL_NREGS,PASS_BY_REFERENCE}): Ditto.
- (SETUP_INCOMING_VARARGS): Ditto.
- (EXPAND_BUILTIN_SAVEREGS): Ditto.
- (CAN_ELIMINATE): Ditto.
- (INITIAL_ELIMINATION_OFFSET): Ditto.
- (LEGITIMATE_CONSTANT_POOL_{BASE,ADDRESS}_P): Ditto.
- (GO_IF_{LEGITIMATE_ADDRESS,MODE_DEPENDENT_ADDRESS}): Ditto.
- (LEGITIMIZE_ADDRESS): Ditto.
- (CONST_COSTS): Ditto.
- (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Ditto.
- (ASM_OUTPUT_REG_{PUSH,POP}): Use reg_names to print registers.
- (function declarations): Add new rs6000.c function declarations,
- and delete decls of deleted functions.
- (SHIFT_COUNT_TRUNCATED): Parenthesize the expression.
-
- * rs6000.c (init_cumulative_args): New function to support AIX
- and V.4 calling sequences.
- (function_arg{,_advance,partial_nregs,pass_by_reference}): Ditto.
- (setup_incoming_varargs): Ditto.
- (expand_builtin_saveregs): Ditto.
- (rs6000_stack_info): Ditto.
- (debug_stack_info): Ditto.
- (direct_return): Changes to support AIX and V.4 calling sequences.
- (first_reg_to_save): Ditto.
- (svr4_traceback): Ditto.
- (output_{prolog,epilog}): Ditto.
- (print_operand): Use reg_names to print registers. Add support
- for V.4 HIGH/LO_SUM address modes.
- (must_save_cr): Function deleted, in rewrite of AIX/V.4 calling
- sequence support.
- (rs6000_sa_size): Ditto.
- (rs6000_pushes_stack): Ditto.
- (output_toc): Add abort if no toc.
-
- * rs6000.md (call insns): Add a new argument to flag a V.4
- function needs to set bit 6 of the CR.
- (elf_{low,high}): New V.4 functions to create addresses via HIGH
- and LO_SUM patterns.
- (movsi): Use elf_{low,high} if appropriate.
- (mov{si,di}_update): Name these patterns for allocate_stack.
- (allocate_stack): Support for V.4 stack layout.
- (sync): New pattern for V.4 trampolines to issue the sync
- instruction.
-
- * rs6000/sysv4.h (TARGET_SWTICHES): Add -mcall-{aix,sysv}, and
- -mprototype. Remove separate flag bit for -mno-toc.
- (SUBTARGET_OVERRIDE_OPTIONS): Don't test for -mno-toc.
- (FP_ARG_*): Adjust for V.4 calling sequences.
- (RS6000_*): Ditto.
- (FP_SAVE_INLINE): Ditto.
- (toc_section): Eliminate use of AIX style full TOC.
- (TRAMPOLINE_{TEMPLATE,SIZE}): Redefine for V.4 support.
- (INITIALIZE_TRAMPOLINE): Ditto.
-
- * rs6000/eabi.h (CPP_SPEC): Define _CALL_SYSV or _CALL_AIX,
- depending on whether -mcall-sysv or -mcall-aix was used.
- * rs6000/eabile.h (CPP_SPEC): Ditto.
- * rs6000/sysv4le.h (CPP_SPEC): Ditto.
-
- * rs6000/t-eabigas (MULTILIB_{OPTIONS,DIRNAMES}): Delete no-toc
- libraries, explicit big endian libraries.
- * rs6000/t-ppcgas (MULTILIB_{OPTIONS,DIRNAMES}): Ditto.
-
- * rs6000/t-eabiaix: New file for eabi, using -mcall-aix as the
- default.
- * rs6000/eabiaix.h: Ditto.
-
- * rs6000/t-eabilegas: New file for eabi on little endian systems.
- * rs6000/t-ppclegas: New file for V.4 on little endian systems.
-
- * rs6000/t-rs6000 (MULTILIB_{OPTIONS,DIRNAMES}): Build libgcc.a
- for -mcpu=common.
-
- * configure (powerpc-*-eabiaix): New configuration for defaulting
- to old-style AIX calling sequence.
- (powerpcle*): Use new t-{eabi,ppc}legas files, to avoid building
- explicit little endian multilib libraries.
-
-Fri Jul 21 13:23:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * toplev.c (main): Don't define sbrk #ifdef __alpha__.
-
-Tue Jul 18 19:23:44 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (do_include): Prefix -H output lines with spaces, not dots.
- (output_dots): Remove.
-
- * cccp.c (main): cplusplus_comments now defaults to 1.
- But clear it if -traditional or the new option -lang-c89 is given.
- * gcc.c (default_compilers, cpp): Specify -lang-c89 if -ansi is given.
- This turns off C++ comment recognition.
-
-Tue Jul 18 19:16:38 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * va-sparc.h (va_arg): Add support for 128 bit long double type.
-
-Tue Jul 18 19:11:18 1995 Jorn Rennecke (amylaar@meolyon.hanse.de)
-
- * c-common.c (decl_attributes, case A_ALIGNED): Handle is_type
- case properly.
-
-Tue Jul 18 19:03:02 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (fold, case CONVERT_EXPR): Don't merge conversions
- if outer is to handle a type with differing precision.
-
-Mon Jul 17 14:37:35 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vax/vms.h (HAVE_ATEXIT): Define.
- (DO_GLOBAL_CTORS_BODY): Don't call atexit; let __do_global_ctors do it.
- * vax/xm-vms.h (HAVE_VPRINTF): Define.
-
-Mon Jul 17 06:41:19 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c ({unsigned,signed}_type): Handle intXX_type_node types.
-
- * xm-alpha.h (sbrk): Add declaration.
-
- * convert.c (convert_to_integer): If TYPE is a enumeral type or
- if its precision is not the same as the size of its mode,
- convert in two steps.
-
- * m68k.md (tstdi, cmpdi): Use match_scratch, not match_operand.
-
-Fri Jul 14 19:23:42 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-decl.c (field_decl_cmp): Rewritten to make sure that a null
- name always sorts low against other names.
- * c-typeck.c (lookup_field): Change name comparison to match what
- field_decl_cmp does.
-
-Fri Jul 14 18:46:24 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (movsi): Convert a CONST_DOUBLE into a CONST_INT of
- the low part.
-
-Fri Jul 14 18:30:52 1995 Doug Evans <dje@cygnus.com>
-
- * toplev.c (main): Reword dwarf/c++/-g warning.
-
-Fri Jul 14 18:19:34 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.h (NO_DEFER_POP): Remove last change.
- * expr.c (stor_expr): Force stack adjust before NO_DEFER_POP.
- (expand_expr, case COND_EXPR): Likewise.
- * stmt.c (expand_start_stmt_expr): Likewise.
-
-Fri Jul 14 07:58:35 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * function.c (struct temp_slot): New fields base_offset, full_size.
- (assign_stack_temp): For !FRAME_GROWS_DOWNWARD, set p->size to size.
- Set new fields base_offset and full_size.
- (combine_temp_slots): Use new fields base_offset and full_size instead
- of slot and size.
-
- * loop.c (loop_number_exit_count): New global variable.
- (loop_optimize): Allocate space for it.
- (find_and_verify_loops, mark_loop_jump): Set it.
- (strength_reduce, check_dbra_loop): Use loop_number_exit_count
- instead of loop_number_exit_labels.
- * loop.h (loop_number_exit_count): Declare it.
- * unroll.c (find_splittable_{regs,givs}, final_[bg]iv_value): Use
- loop_number_exit_count instead of loop_number_exit_labels.
- (reg_dead_after_loop): Check loop_number_exit_count, and fail
- if the count doesn't match loop_number_exit_labels.
-
- * cse.c (cse_insn): Ifdef out code that pre-truncates src_folded.
-
- * sparc.md (sethi_di_sp64): Return null string at end.
-
- * function.h (struct function): Add stdarg field.
- * function.c (current_function_stdarg): New global variable.
- (push_function_context_to): Save it.
- (pop_function_context_from): Restore it.
- (assign_parms): Set it.
- (init_function_start): Clear it.
- * output.h (current_function_stdarg): Declare it.
- * i960.md: Modify all patterns which handle stores to memory to also
- check current_function_varargs and current_function_stdarg.
-
- * reorg.c (fill_simple_delay_slots): When trying to take instruction
- from after the branch, don't continue past target label. Local
- variables passed_label and target_uses are no longer necessary.
-
-Thu Jul 13 19:30:04 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * pa.c (output_bb): Fix error in long backwards branch with
- nullified delay slot.
-
-Thu Jul 13 19:26:13 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * expmed.c (SHIFT_COUNT_TRUNCATED): Use #ifdef not #if.
-
-Mon Jul 10 20:16:44 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (rescan): Don't address outside of array when
- preprocessing C++ comments.
-
-Mon Jul 10 20:05:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (expand_block_move): Remove #if 0 conditionals
- against using larger block moves.
-
- * t-rs6000 (EXTRA_PARTS): Copy milli.exp to release dir.
- (milli.exp): Copy to build dir from machine dependend dir.
-
-Mon Jul 10 20:03:29 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.md (matcher for (shiftable_op (cond-exp) (reg))): If
- shiftable_op is minus, then subtract from zero when cond fails.
-
-Mon Jul 10 19:58:26 1995 John F. Carr <jfc@mit.edu>
-
- * sparc.h (SELECT_SECTION): Use TREE_CODE_CLASS instead of directly
- referencing tree_code_type.
-
-Mon Jul 10 19:54:31 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * protoize.c (reverse_def_dec_list): Delete const qualifiers from
- local variables, and delete casts which were casting away const.
-
-Mon Jul 10 19:14:39 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-lang.c (finish_file): Add missing parm to start_function call.
-
- * jump.c (jump_optimize): Pass outer_code arg to rtx_cost.
-
- * varasm.c (assemble_name, bc_assemble_integer): Call
- bc_emit_labelref with proper args.
-
- * function.c (setjmp_args_warning): Remove bogus arg.
-
-Mon Jul 10 18:20:54 1995 Fergus Henderson (fjh@cs.mu.oz.au)
-
- * gcc.c (p{fatal,error}_with_name, perror_exec): Quote filename.
-
-Mon Jul 10 18:12:51 1995 Gran Uddeborg (uddeborg@carmen.se)
-
- * i386/iscdbx.h (STARTFILE_SPEC): Handle -Xp.
-
-Wed Jul 5 02:42:17 1995 Per Bothner (bothner@spiff.gnu.ai.mit.edu)
-
- * cpphash.h (enum node_type): Remove unneeded and non-standard
- forward declaration.
-
-Sat Jul 1 20:15:39 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * mips/t-mips, mips/t-mips-gas (MULTILIB_*, LIBGCC, INSTALL_LIBGCC):
- Delete.
-
- * sparc/sol2.h (LINK_SPEC): Revert March 16 change. Do not add -R
- for each -L.
-
- * collect2.c (libcompare): Verify that file name extensions are valid.
- Put files with invalid extensions last in the sort.
-
- * integrate.c (integrate_decl_tree): Set DECL_ABTRACT_ORIGIN before
- pushdecl call for local variables.
-
-Sat Jul 1 08:13:38 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * cpplib.c (output_line_command): If not emitting #line directives
- delay returning until after adjust_position has been called.
-
- * arm.md (mov{si,sf,df}cc): Call gen_compare_reg to generate
- the condition code register.
-
-Sat Jul 1 06:55:09 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (decode_field_reference): New parm PAND_MASK.
- (unextend): New parm MASK.
- (fold_truthop): Pass new parms to decode_field_reference and unextend.
-
- * va-alpha.h (__va_tsize): Use __extension__ to avoid warning
- on use of `long long'.
-
- * expr.h (NO_DEFER_POP): Do any pending stack adjusts.
-
- * recog.c (register_operand): Disallow subreg of reg not allowed to
- change size.
-
-Thu Jun 29 05:51:57 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * pa.md (reload addsi3): New pattern to avoid reload lossage
- with register eliminations.
-
- * pa.c (output_cbranch): When checking for a jump to the given
- insn's delay slot, handle the case where JUMP_LABEL for the
- given insn does not point to the first label in a series of
- labels.
- (output_bb, output_dbra, output_movb): Likewise.
-
-Wed Jun 28 18:04:56 1995 Jeff Law (law@snake.cs.utah.edu)
-
- * pa.h (PIC_OFFEST_TABLE_REGNUM_SAVED): Define to %r4.
- (CONDITIONAL_REGISTER_USAGE): Make it fixed when compiling
- PIC code.
- (INIT_EXPANDERS): Delete.
- * pa.c (hppa_save_pic_table_rtx): Delete variable.
- (hppa_expand_prologue): For PIC generation, copy the PIC
- register into a fixed callee register at the end of the
- prologue of non-leaf functions.
- * pa.md (call expanders): Reload the PIC register from the
- fixed callee saved register. Don't try to save the PIC
- register before the call.
-
-Wed Jun 28 18:01:14 1995 Stan Cox (coxs@dg-rtp.dg.com)
-
- * m88k/dguxbcs.h (ASM_SPEC): Removed -h flag.
- * m88k/dgux.h (ASM_SPEC): Likewise.
-
-Wed Jun 28 17:01:58 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (processor_target_table): Remove CPU name synonyms.
- * rs6000.h (CPP_SPEC): Likewise.
- * rs6000/sysv4.h (CPP_SPEC): Likewise.
- (ASM_SPEC): Likewise.
- * rs6000/sysv4le.h (CPP_SPEC): Likewise.
- * rs6000/eabile.h (CPP_SPEC): Likewise.
- * rs6000/powerpc.h (CPP_SPEC): Likewise.
- (ASM_SPEC): Set assembler target according to compiler target.
- * rs6000/aix3newas.h (CPP_SPEC): Likewise.
- (ASM_SPEC): Likewise.
- * rs6000/aix41.h (CPP_SPEC): Likewise.
- (ASM_SPEC): Likewise.
-
-Wed Jun 28 16:25:53 1995 Gran Uddeborg (uddeborg@carmen.se)
-
- * i386/x-isc3 (INSTALL_HEADERS_DIR): Delete; done by configure.
-
-Wed Jun 28 16:10:47 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * xm-rs6000.h (alloca): Extern decl added for non-GNU compiler.
-
-Wed Jun 28 11:31:30 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cpplib.c (progname): Remove definition from here.
-
- * final.c (final_scan_insn): Fix error in last change.
-
- * rtlanal.c (reg_set_p_1): Now static; add extra parm.
-
- * stmt.c: Delete redundant forward decls.
- (expand_anon_union_decl): Correctly call expand_decl.
-
- * toplev.c (strip_off_ending): Strip off any ending; don't
- pretend we know what valid endings are.
-
- * svr4.h (ASM_OUTPUT_SECTION_NAME): Don't crash if DECL is null.
-
- * rs6000.md ({load,store}_multiple): Don't use indirect_operand
- in define_insn; use explicit MEM of register_operand instead.
-
-Tue Jun 27 11:42:56 1995 Stephen L Moshier <moshier@world.std.com>
-
- * i386/i386.c (print_operand, case `J'): Use jns for GE and js for
- LT.
-
-Tue Jun 27 07:58:55 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * expr.c (expand_expr, TARGET_EXPR): Only use original_target
- if !ignore.
-
-Tue Jun 27 07:27:26 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (fold_truthop): Commute unextend and convert on
- l_const and r_const.
-
- * c-common.c (decl_attributes, case A_CONSTRUCTOR, A_DESTRUCTOR):
- Set TREE_USED.
-
- * final.c (final_scan_insn): Don't call alter_cond unless
- condition is on cc0.
-
- * stmt.c (expand_asm_operands): Handle input operands that may not
- be in a register.
-
-Mon Jun 26 19:23:05 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm/lib1funcs.asm (L_dvmd_tls): Renamed from L_divmodsi_tools.
- * arm/t-semi (LIB1ASMFUNCS): Rename _dvmd_tls from _divmodsi_tools.
-
-Mon Jun 26 19:18:06 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * unroll.c (find_splittable_regs): When completely unrolling loop,
- check for non-invariant initial biv values.
-
-Mon Jun 26 19:13:54 1995 Gran Uddeborg <uddeborg@carmen.se>
-
- * configure (i[345]86-*-isc*): Fix misspelled "rfile" to "ifile".
-
-Mon Jun 26 18:58:22 1995 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_expr, case COND_EXPR): Protect the condition from
- being evaluated more than once.
- (do_jump, case TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR): Likewise.
-
-Mon Jun 26 18:52:36 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * fixincludes (string.h): Fix return value for mem{ccpy,chr,cpy,set}
- and str{len,spn,cspn} on sysV68.
-
-Mon Jun 26 06:54:50 1995 Michael Meissner (meissner@cygnus.com)
-
- * i386/osfrose.h (LONG_DOUBLE_TYPE_SIZE): Go back to making long
- double == double.
-
-Thu Jun 22 19:14:41 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * make-cc1.com (if DO_LINK): Skip c-parse.* processing when
- only relinking.
- (gas_message): Update to reflect current version, and give
- a different message if/when no version of gas is found.xo
-
-Thu Jun 22 18:52:37 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm/lib1funcs.asm (___modsi3): Correctly set SIGN register for
- modulo involving negative numbers.
-
-Thu Jun 22 18:32:27 1995 Uwe Seimet (seimet@chemie.uni-kl.de)
-
- * xm-atari.h (HZ): Now 100 and don't define if already defined.
-
-Thu Jun 22 18:26:12 1995 Jeffrey A Law (law@snake.cs.utah.edu)
-
- * calls.c (expand_call): Correctly handle returning BLKmode
- structures in registers when the size of the structure is not
- a multiple of word_size.
- * stmt.c (expand_return): Likewise.
-
- * pa-gux7.h (LIB_SPEC): Undefine before redefining.
- * pa-hpux.h (LIB_SPEC): Likewise.
- * pa-hpux7.h (LIB_SPEC): Likewise.
-
- * genmultilib: Work around hpux8 /bin/sh case bug.
-
- * pa.h (LIB_SPEC): Define to avoid -lg.
-
-Thu Jun 22 18:19:09 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * expr.c (expand_expr, TARGET_EXPR): Use original_target.
-
- * collect2.c (locatelib): Fix parsing of LD_LIBRARY_PATH.
-
-Thu Jun 22 18:15:54 1995 Paul Eggert <eggert@twinsun.com>
-
- * configure: Create an empty Makefile.sed first, to work
- around a Nextstep 3.3 bug.
-
-Thu Jun 22 18:03:44 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * Makefile.in (STAGESTUFF): Add stamp-crt.
- (crtbegin.o, crtend.o): Now depend on stamp-crt.
- (stamp-crt): New rule, to actually build crt{begin,end}.o.
-
- * collect2.c (main): Unlink export_file before we return.
-
-Thu Jun 22 14:25:56 1995 Michael Meissner (meissner@cygnus.com)
-
- * rs6000.h (STRIP_NAME_ENCODING): Store NAME and strlen(NAME) into
- local variables; cast result of alloca to avoid compiler warnings.
-
-Tue Jun 20 18:25:29 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * alpha/config-nt.sed, i386/config-nt.sed: Edit to add
- a missing $(exeext) for CCCP.
-
-Tue Jun 20 18:18:00 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * protoize.c (default_include): Use name and two ints to be
- compatible with definition of INCLUDE_DEFAULTS.
-
-Mon Jun 19 19:24:29 1995 Ted Lemon <mellon@toccata.fugue.com>
-
- * mips/netbsd.h (ASM_DECLARE_FUNCTION_NAME): Don't emit function label.
-
-Mon Jun 19 18:34:55 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * fixincludes: Don't define wchar_t under C++.
-
-Mon Jun 19 17:12:41 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (collect_expansion): Work around enum bug in vax
- ultrix 4.3 pcc.
- * tree.c (simple_cst_equal): Likewise.
-
-Mon Jun 19 16:53:00 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * winnt/spawnv.c: New file.
-
-Mon Jun 19 16:30:29 1995 Glenn Brown <glenn@mars.myri.com>
-
- * caller-save.c (save_call_clobbered_regs): If AUTO_INC_DEC, mark
- register indicated by REG_INC notes as live so they will be saved.
-
-Mon Jun 19 16:21:12 1995 Jeffrey A Law (law@snake.cs.utah.edu)
-
- * pa.h (PRINT_OPERAND_ADDRESS, case LOW_SUM): Fix logic bug
- in last change.
-
-Mon Jun 19 14:11:49 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * integrate.c (integrate_decl_tree): Only set DECL_ABSTRACT_ORIGIN
- if the decl returned by pushdecl is the one we started with.
-
- * mips.h (current_function_name): Delete declaration.
- (ASM_DECLARE_FUNCTION_NAME): Don't set current_function_name.
- * gnu.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
- * mips.c (current_function_decl): Delete declaration.
- (function_prologue): New variable fnname. Use it instead of
- current_function_name.
- (function_epilogue): Likewise.
-
-Mon Jun 19 13:13:15 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.h (ASM_OUTPUT_ASCII): Always reset line count when
- starting new line.
-
- * scan-decls.c (scan_decls): Fix typo when resetting PREV_ID_START.
-
- * i386/config-nt.sed, alpha/config-nt.sed: Change version to 2.7.1.
-
-Mon Jun 19 13:06:14 1995 DJ Delorie (dj@delorie.com)
-
- * msdos/top.sed: Support new build variables.
- * msdos/configur.bat: Make options.h and specs.h.
- Change realclean to maintainer-clean.
-
-Fri Jun 16 06:54:03 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * Version 2.7.0 Released.
-
- * obstack.c: Always enable this code for now.
-
- * alpha.c (alpha_builtin_saveregs): Use ptr_mode and conversions
- when need so works for both OSF and NT.
- * va-alpha.h (__va_tsize): Round to long long not long.
-
-Thu Jun 15 17:54:52 1995 Bdale Garbee <bdale@gag.com>
-
- * configure (a29k-*-coff): Synonym for a29k-*-udi.
-
-Thu Jun 15 17:51:21 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (assign_parms): Do all conversions in CONVERSION_INSNS.
-
-Thu Jun 15 17:36:49 1995 Michael Meissner <meissner@cygnus.com>
-
- * reg-stack.c (record_reg_life): Call record_reg_life_pat with 0
- for douse argument so that USE's created to mark variables within
- blocks don't get marked as set.
-
-Thu Jun 15 06:28:15 1995 Dennis Glatting (dennisg@CyberSAFE.COM)
-
- * configure: Change one sed command to work around m68k-next bug.
-
-Wed Jun 14 22:14:39 1995 Jason Merrill <jason@deneb.cygnus.com>
-
- * collect2.c (main): Don't turn off auto_export because of -g.
- (main): Ignore the argument to -o.
-
- * alpha.h (LINK_SPEC): Don't pass -init __main anymore.
- * alpha/osf12.h (LINK_SPEC): Ditto.
- * mips/iris5.h (LINK_SPEC): Ditto.
-
- * collect2.c (main): Place o_file after an initial .o (like crt0.o).
- If we have LD_INIT_SWITCH, use init and fini functions for
- executables, too. Specify the unique function names.
- (write_c_file_stat): Fix the case of destructors but no constructors.
- Don't include the generic-named functions for executables.
- (write_c_file): If we have LD_INIT_SWITCH, always use
- write_c_file_stat.
-
- * collect2.c (main): Also add _GLOBAL__D? to export list.
-
- * ginclude/iso646.h: Do nothing if compiled as C++.
-
-Wed Jun 14 17:39:10 1995 Roland McGrath (roland@gnu.ai.mit.edu)
-
- * c-common.c (format_char_info, case 'm'): Set type to void.
- (check_format_info): If type is void, ignore operand.
-
-Wed Jun 14 17:04:10 1995 Paul F. Kunz (Paul_Kunz@SLAC.Stanford.EDU)
-
- * expr.c (expand_builtin_apply_args): Put back original
- register save and restore order.
-
-Wed Jun 14 16:56:22 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/eabi.h (INVOKE__main): Define, so __eabi is called after
- main's arguments are saved.
-
- * rs6000.c (output_prolog): Don't call __eabi here, let
- compiler call it after the arguments to main are saved.
- (output_{prolog,epilog}): Don't use functions under V.4 to save
- and restore floating point registers.
-
-Wed Jun 14 16:52:12 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k/mot3300.h (PCC_BITFIELD_TYPE_MATTERS): Defined.
-
-Wed Jun 14 16:48:53 1995 Jerry Frain (jerry@tivoli.com)
-
- * Makefile.in (stage[1-4]): Correctly link `as', `ld', and `collect2'.
-
-Wed Jun 14 05:52:04 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * objc-act.c (hack_method_prototype): Set DECL_CONTEXT of parms.
-
- * expmed.c (emit_store_flag): Always set LAST.
-
- * c-decl.c (start_function): New parameter for attributes.
- * c-tree.h (start_function): Likewise.
- * c-lang.c (finish_file): Pass extra parm to start_function.
- * objc-act.c (build_module_descriptor, really_start_method): Likewise.
- * c-parse.in (fndef, nested_function, notype_nested_function):
- Likewise.
-
- * function.c (assign_parms): Use convert_to_mode instead of
- gen_lowpart when converting incoming parm.
-
-Tue Jun 13 19:10:32 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * rs6000.md (decrement_and_branch): Finish last fix; update matching
- constraint.
-
-Tue Jun 13 18:32:51 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * fold-const.c (fold): When converting a COND_EXPR to an ABS_EXPR,
- get the types right for ABS_EXPR to work.
-
-Mon Jun 12 17:09:55 1995 Michael Tiemann (tiemann@axon.cygnus.com)
-
- * reorg.c (fill_simple_delay_slots): Set MAYBE_NEVER according to
- code of TRIAL_DELAY, not TRIAL.
-
-Mon Jun 12 15:02:37 1995 Doug Evans <dje@cygnus.com>
-
- * configure: Restore code to make ld symlink if ! use_collect2.
-
- * gcc.c (link_command_spec): Undo patch of May 11.
- -nostdlib implies -nostartfiles again.
- * dsp16xx.h (CROSS_LINK_SPEC): Likewise.
- * i386/freebsd.h (LINK_SPEC): Undo patch of May 24.
- Don't pass "-e start" if nostdlib.
- * i386/sun.h (LINK_SPEC): Likewise.
- * m68k/sun2o4.h (LINK_SPEC): Likewise.
- * m68k/sun3.h (LINK_SPEC): Likewise.
- * m68k/vxm68k.h (LINK_SPEC): Likewise.
- * mips/netbsd.h (LINK_SPEC): Likewise.
- * config/netbsd.h (LINK_SPEC): Likewise.
- * rs6000/mach.h (LINK_SPEC): Likewise.
- * sparc.h (LINK_SPEC): Likewise.
- * sparc/vxsparc.h (LINK_SPEC): Likewise.
-
- * gcc.c (link_command_spec): New argument -nodefaultlibs.
-
-Sun Jun 11 20:47:53 1995 Stephen L Moshier (moshier@world.std.com)
-
- * Makefile.in (fix-header.o): Depends on xsys-protos.h.
-
-Sun Jun 11 15:07:58 1995 Tim Carver (timc@ibeam.intel.com)
-
- * reload1.c (emit_reload_insns): Don't call HARD_REGNO_NREGS
- on psuedo when clearing reg_last_reload_reg.
-
-Sun Jun 11 14:07:05 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md ({add,sub}di{_mem,3}): Patterns merged.
-
-Sun Jun 11 13:43:26 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * m68k.md (cmpdi matcher): Set cc_status before returning.
-
- * config/xm-freebsd.h (DONT_DECLARE_SYS_SIGLIST): Define.
-
-Sun Jun 11 13:38:49 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * fixincludes (math.h): Keep declaration of abs on HPUX.
-
-Sun Jun 11 12:31:42 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (variable_size): Do nothing if SIZE is constant.
-
- * stmt.c (expand_asm_operands): See if output operand permits
- register. If not, mark output addressable, call expand_operand
- on it, and give error if not MEM.
-
- * function.c (assign_parms): Handle promotions of both
- passed and nominal modes separately and insert needed conversions.
- (promoted_input_arg): Return 0 if nominal and passed modes differ.
-
- * stmt.c (all_cases_count, case INTEGER_TYPE): Fix typo in checking
- for integer bounds.
-
-Sat Jun 10 08:55:25 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * libgcc2.c (_floatdidf): Correctly set float sizes.
-
- * c-decl.c (c_decode_option, case "-Wall"): Don't set extra_warnings.
-
- * Makefile.in (cpplib.o, fix-header.o): Update dependencies.
- (cpperror.o, cppexp.o, cpphash.o): New rules, to show .h dependencies.
-
-Fri Jun 9 18:06:10 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * cse.c (cse_basic_block): Fix test for whether block ends with a
- barrier. Return next insn, not 0, if block ends in a barrier.
-
-Fri Jun 9 17:58:29 1995 Paul Eggert <eggert@twinsun.com>
-
- * fold-const.c (lshift_double): Replace `&' with `%' to fix typo.
- ([lr]shift_double): Truncate shift count only if SHIFT_COUNT_TRUNCATED.
- Remove unnecessary `count >= prec' test.
-
- * cexp.y (left_shift): Ignore integer overflow.
-
- * cexp.y (skip_evaluation): New variable.
- (&&, ||, ?:): Increment it in unevaluated subexpressions.
- (/, %, integer_overflow): Suppress diagnostics if skip_evaluation != 0.
- (yyerror): Clear skip_evaluation.
-
-Fri Jun 9 17:49:05 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * m68k.md (tstdi): Rewrite.
-
-Fri Jun 9 17:28:55 1995 Per Bothner <bothner@cygnus.com>
-
- * scan-decls.c (scan_decls): Handle declarations with
- multiple comma-separated declarators.
-
-Thu Jun 8 19:16:12 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.md (mov[sd]f expands): Don't allow fp constants in pseudos
- when TARGET_SOFT_FLOAT.
-
-Thu Jun 8 19:11:43 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * expmed.c (store_split_bit_field): When adjust arg in
- BYTES_BIT_ENDIAN case, use number of bits in arg for MEM operands
- and BITS_PER_WORD for other operands.
- (extract_fixed_bit_field): Undo last change.
-
- * unroll.c (verify_addresses): New function.
- (find_splittable_givs): Use it instead of memory_address_p.
-
-Thu Jun 8 18:58:18 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * expmed.c (expand_divmod): Always check result of emit_store_flag.
-
-Thu Jun 8 12:02:34 1995 David D Zuhn (zoo@armadillo.com)
-
- * cpplib.c (cpp_push_buffer): Include filename in error message.
-
-Thu Jun 8 11:53:45 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (assign_parms): Don't call promote_mode on arg
- unless PROMOTE_FUNCTION_ARGS defined.
-
- * rs6000.md (decrement_and_branch): Ensure label is operand 0.
-
- * rs6000.md (aux_truncdfsf2): New pattern.
- (movsf): Use it instead of invalid SUBREG and truncdfsf2.
-
- * varasm.c (assemble_name): Disable warn_id_clash around
- get_identifier call.
-
-Wed Jun 7 17:22:25 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * configure (gdb_needs_out_file_path): New variable.
- (m68k-motorola-sysv): Set gdb_needs_out_file_path if not using gas.
- (.gdbinit): If gdb_needs_out_file_path is set, add a 'dir' command
- for $(out_file).
-
-Wed Jun 7 17:17:19 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * fold-const.c (fold): When folding `<' type nodes, make true_value
- and false_value have correct types.
-
-Wed Jun 7 05:06:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * collect2.c (COFF scan_prog_file): Use the AIX duplicate entry.
-
-Tue Jun 6 18:43:09 1995 Jeffrey A Law (law@snake.cs.utah.edu)
-
- * pa.h (FUNCTION_ARG_CALLEE_COPIES): Define.
-
-Tue Jun 6 18:21:18 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_expr, case PLACEHOLDER_EXPR): Consider two types
- identical if their TYPE_MAIN_VARIANTs are the same.
-
- * c-decl.c (start_decl): Set DECL_COMMON before calling
- decl_attributes.
-
- * a29k.c (print_operands): Cast args to bcopy to char *.
-
- * c-decl.c (duplicate_decls): Don't clear DECL_CONTEXT of
- new decl if it is a function.
-
-Tue Jun 6 17:57:44 1995 Eberhard Mattes (mattes@azu.informatik.uni-stuttgart.de)
-
- * gcc.c (do_spec_1, case 'g'): Handle %O as suffix if MKTEMP_EACH_FILE.
-
-Tue Jun 6 17:53:05 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (expand_block_move): Update source and destination pointers
- inside the loop moving the bytes, not outside.
-
-Tue Jun 6 14:58:37 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.h (CONDITIONAL_REGISTER_USAGE): Don't mark pic reg as fixed.
- * m68k.c (finalize_pic): Emit USE insn at start and end of function.
-
-Tue Jun 6 13:46:57 1995 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * sh.c (print_operand): Check for annulled branches.
- (output_movedouble): Handle SUBREG addresses.
- (output_branch): Handle annulled branches.
- (sh_expand_prologue): Correct number of saved registers for
- varargs functions.
- * sh.h: Add some comments.
- * sh.md: Add some comments. Cleanup formatting.
- (type attribute): Add pstore and call.
- (return define_delay): Reorganize to make clearer.
- (call/sfunc define_delay): Define.
- (cbranch define_delay): Define to have annul-true delay slot.
- (subsi3): Use arith_reg_operand for operand 2.
- (shift patterns): Use const_int_operand instead of immediate_operand
- for shift counts.
- (push): Add pstore constraint case.
- (movsi_i): Move t/z constraint pair to the front of the list.
- (calli, call_valuei): Add "call" attribute.
-
-Mon Jun 5 19:23:13 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sched.c (attach_deaths): In last change, use find_reg_note instead
- of find_regno_note.
-
-Mon Jun 5 19:17:31 1995 Tom Quiggle (quiggle@lovelace.engr.sgi.com)
-
- * mips/iris5.h (MACHINE_TYPE): Say "IRIX 5.x", not "5.0".
- (NO_DOLLAR_IN_LABEL): Undefine.
- * mips.h (sdb_begin_function_line): New declaration.
- (PUT_SDB_FUNCTION_END): New definition.
-
-Mon Jun 5 18:56:10 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (expand_block_move): Don't do block moves where we clobber
- fixed numbers of regs, instead move just 1-8 bytes at a time.
-
- * Makefile.in (STAGESTUFF): Copy files produced by -da and
- -save-temps to the stage subdirectories.
-
-Mon Jun 5 08:18:46 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
-
- * combine.c (reg_dead_at_p): When scanning backwards, stop at BARRIER.
-
- * m68k.c (print_operand): Handle 'R' for registers.
- * m68k.md (cmpdi): Rewrite to avoid bogus matching constraints.
-
- * optabs.c (expand_binop): In last change, don't defererence TARGET
- if it is 0.
-
- * pa.md (movsicc): Use MATCH_DUP for operand 4 and 5.
-
-Mon Jun 5 08:14:56 1995 Jeffrey A Law (law@cs.utah.edu)
-
- * pa.c (hppa_encode_label): Allocate stuff on permanent_obstack
- rather than via malloc.
-
- * c-common.c (decl_attributes): Fix typo in size passed to alloca.
-
-Mon Jun 5 08:10:55 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.md: Use "some_operand" for patterns valid only during
- reload and meant to handle adding more PLUS operators during
- register elimination.
-
-Mon Jun 5 07:31:53 1995 Stephen L Moshier (moshier@world.std.com)
-
- * cse.c (simplify_unary_operation, case FLOAT, UNSIGNED_FLOAT):
- Truncate to requested mode.
-
-Sat Jun 3 22:08:51 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sched.c (attach_deaths): Don't add a REG_DEAD note if a REG_UNUSED
- note is already present.
-
-Sat Jun 3 18:36:57 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * pa.h (hppa_builtin_saveregs): Add declaration.
-
-Sat Jun 3 18:11:26 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * Makefile.in (scan-decls.o): Depends on cpplib.h.
-
-Fri Jun 2 19:23:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * optabs.c (expand_binop): Don't use non-REG TARGET in 2-word case.
-
-Thu Jun 1 19:30:30 1995 Tor Egge (tegge@flipper.pvv.unit.no)
-
- * m88k.h (RETURN_POPS_ARGS): New argument.
- * m88k/dolphin.ld: Added start of comment.
-
-Thu Jun 1 19:12:28 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure (a29k-*-bsd*): Fix typo in last change.
-
-Thu Jun 1 18:51:53 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * expmed.c (extract_fixed_bit_field): For REG case, compute total_bits
- from mode instead of assuming BITS_PER_WORD.
-
-Thu Jun 1 18:34:31 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (FIXED_R13): Default to 0.
- ({FIXED,CALL_USED}_REGISTERS): Use FIXED_R13 for register 13.
- * sysv4.h (FIXED_R13): Define to be 1.
-
-Wed May 31 20:57:26 1995 Torbjorn Granlund <tege@matematik.su.se>
-
- * m68k.md ([su]mulsi3_highpart): Pass correct number of arguments to
- const_uint32_operand.
- * m68k.c (const_uint32_operand): Reject negative numbers.
-
- * expmed.c (expand_mult_highpart): Use wide_op1 for all multiplies.
- (expand_divmod): Undo Nov 12 change. Instead, add special case
- for division by MIN_INT in signed TRUNC_DIV_EXPR case.
-
-Wed May 31 20:44:21 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (one_cmpldi2): New pattern.
- ({a,l}shrdi{3,_const}): Allow 63 as shift count.
-
-Wed May 31 14:56:31 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * varasm.c (assemble_start_function, assemble_variable):
- Make sure first_global_object_name is in permanent obstack.
-
- * reload1.c (alter_reg): Clean up setting of RTX_UNCHANGING_P
- when making a MEM.
-
- * reorg.c (struct resources): New field unch_memory.
- (CLEAR_RESOURCES, mark_target_live_regs, dbr_schedule): Clear it.
- (mark_{referenced,set}_resources, redundant_insn): Set it.
- (fill_simple_delay_slots): Likewise.
- (resource_conflicts_p): Test it.
-
- * unroll.c (copy_loop_body): Fix typo in call to sets_cc0_p.
-
- * integrate.c (output_inline_function): Don't call expand_function_end.
-
- * calls.c (prepare_call_address): Only call use_reg on
- static_chain_rtx if it is a REG.
-
- * configure (a29k-*-bsd*): Use t-a29k.
- * t-a29k: New file.
- * a29k/t-a29kbare (LIBGCC1_TEST): New null definition.
- * a29k/t-vx29k (LIBGCC1_TEST): Likewise.
-
-Wed May 31 14:17:42 1995 Jeffrey A Law (law@snake.cs.utah.edu)
-
- * configure (hppa*-*-bsd*): Do not run fixincludes.
- (hppa*-*-osf*): Likewise.
- (hppa*-*-lites*): Likewise.
-
- * pa.h (PRINT_OPERAND_ADDRESS): Use "RR'" rather than "R'" for
- symbolic addresses.
- * pa.md (symbolic HIGH patterns): Likewise.
- (symbolic LO_SUM pattern): Likewise.
-
-Wed May 31 14:11:53 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (all movstri recognizers): Eliminate updating the pointers.
- * rs6000.c (expand_block_move): Don't pass argument of # bytes to
- increment pointers by to movstrsi expanders.
-
- * rs6000.c (rs6000_override_options): Fix typo with -mstring handling.
-
- * rs6000.h (TARGET_SWITCHES): Set MASK_STRING_SET explicitly
- if -mno-string, so that it can override the processor default.
-
-Wed May 31 07:31:53 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * c-common.c (truthvalue_conversion, BIT_AND_EXPR): Make sure that
- the result has boolean_type_node.
-
-Tue May 30 19:03:21 1995 J.T. Conklin <jtc@cygnus.com>
-
- * stddef.h: Undefine _BSD_XXX_T_ if _GCC_XXX_T is defined on BSD
- Net/2 derived systems.
-
-Tue May 30 08:17:37 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (decrement_and_branch_until_zero): Operand 0 constraint
- changed from "+g" to "+d*am".
- (similar anonymous HImode pattern): Likewise.
-
- * m68k.md (tstdi): Use tst/subx #0 instead of neg/negx.
- Allow "a" and ">" for operand 0.
-
-Mon May 29 19:24:43 1995 Niklas Hallqvist (niklas@appli.se)
-
- * m68k.md (addsi_lshrsi_31): Use match_dup, not constraint "1",
- for matching inputs.
-
-Mon May 29 12:39:58 1995 Allen Briggs <briggs@rrinc.com>
-
- * i386/isc.h ({STARTFILE,LIB,CPP}_SPEC): Handle -Xp like -posix.
- * i386/x-isc3 (X_CFLAGS): Add -Xp.
-
-Mon May 29 12:28:41 1995 J.T. Conklin (jtc@cygnus.com)
-
- * configure (sparc-*-netbsd): Add missing asterisk at end.
-
-Mon May 29 08:55:48 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (recog_for_combine): New parm PADDED_SCRATCHES; set it.
- (try_combine): Accumulate number of scratches and update max_scratch.
- (simplify_set): Add extra parm to recog_for_combine.
-
- * romp.md (call): Put USE for r0 in CALL_INSN; call call_internal
- to emit insn.
- (call_internal): New name for anonymous call.
- (call_value, call_value_internal): Likewise.
-
- * winnt/xm-winnt.h: Protect most definitions with #ifndef.
- * alpha/xm-winnt.h: Include alpha/xm-alpha.h, then winnt/xm-winnt.h.
- (POSIX): Undefine.
- * xm-alpha.h: Don't include alloca.h for winnt.
-
-Sun May 28 18:34:01 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure: Make sed commands more uniform.
-
- * Makefile.in: Properly use $(srcdir) for files that have it
- in their reference as a target of a rule.
- (libgcc1.a): Add missing RANLIB_TEST use.
-
- * stmt.c (expand_computed_goto): Call do_pending_stack_adjust.
-
-Sun May 28 18:08:41 1995 Torbjorn Granlund <tege@mole.gnu.ai.mit.edu>
-
- * m68k.md (divmodhi4, udivmodhi4): Use "dmsK" for operand 2.
-
-Fri May 26 17:01:22 1995 Paul Eggert <eggert@twinsun.com>
-
- * fixincludes: Fix bogus recursive <stdlib.h> in NEWS-OS 4.0C.
-
-Fri May 26 08:02:14 1995 Michael Meissner (meissner@cygnus.com)
-
- * c-typeck.c (initializer_constant_valid_p): For the CONSTRUCTOR
- case, if the type is a record, recurse, just like for unions.
-
-Thu May 25 07:56:14 1995 Paul Eggert <eggert@twinsun.com>
-
- * fixincludes: Add `sel', `tahoe', `r3000', `r4000' to the
- list of pre-ANSI symbols that need to be surrounded with __ __.
- Allow white space between `#' and `if' when looking for lines to patch.
-
- * objc/sarray.h (PRECOMPUTE_SELECTORS, struct soffset):
- Use #ifdef __sparc__, not sparc.
-
- * m68k.md (addsi_lshrsi_31, ashldi_const, ashrdi_const, lshrdi_const):
- Replace `mov' with `move'.
-
-Thu May 25 07:35:37 1995 Allen Briggs <briggs@rrinc.com>
-
- * libgcc2.c (L_eh, i386): Remove in-line comments in assembly
- code--the '#' character is not valid for the SYSV as.
-
-Thu May 25 07:28:54 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * Makefile.in (BC_ALL): Restore it from May 22 change; vms uses it.
- (STAGESTUFF): Use it.
-
-Thu May 25 07:11:56 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (alpha_emit_set_const): Don't call expand_binop for
- other than add if SImode and can't create pseudos.
-
-Wed May 24 21:38:24 1995 Jim Wilson <wilson@cygnus.com>
-
- * sched.c (reemit_notes): New function.
- (schedule_block): Call reemit_notes twice. Reorganize code for
- handling SCHED_GROUP_P insns, so that reemit_notes works.
-
- * sh/sh.c (shiftcosts, genshifty_op): Add SH3 support.
- * sh/sh.md (ashlsi3, lshrsi3): Add SH3 support.
- (ashlsi3_d, ashrsi3_d, lshrsi3_d): New patterns for SH3.
- (ashrsi2_31): Remove r/!r constraint.
-
-Wed May 24 17:00:47 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.c (type_list_equal): Call simple_cst_equal before checking
- types.
-
-Wed May 24 16:49:49 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * Makefile.in (libgcc2.a): Handle case of separate srcdir.
-
-Wed May 24 16:22:01 1995 Paul Eggert <eggert@twinsun.com>
-
- * configure: Define $(MAKE) if `make' doesn't.
-
-Wed May 24 15:50:51 1995 Doug Evans <dje@cygnus.com>
-
- * dsp16xx.h (CROSS_LINK_SPEC): ENDFILE_SPEC moved to -nostartfiles.
- * i386/freebsd.h (LINK_SPEC): Don't pass "-e start" if nostartfiles
- rather than nostdlib.
- * i386/sun.h (LINK_SPEC): Likewise.
- * m68k/sun2o4.h (LINK_SPEC): Likewise.
- * m68k/sun3.h (LINK_SPEC): Likewise.
- * m68k/vxm68k.h (LINK_SPEC): Likewise.
- * mips/netbsd.h (LINK_SPEC): Likewise.
- * config/netbsd.h (LINK_SPEC): Likewise.
- * rs6000/mach.h (LINK_SPEC): Likewise.
- * sparc.h (LINK_SPEC): Likewise.
- * sparc/vxsparc.h (LINK_SPEC): Likewise.
-
- * m88k/m88k.h (FUNCTION_ARG_BOUNDARY): Use GET_MODE_BITSIZE.
-
-Wed May 24 15:44:04 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * fold-const.c (fold): Make sure that a folded TRUTH_NOT_EXPR
- retains the same type.
-
- * c-common.c (truthvalue_conversion): Also accept TRUTH_NOT_EXPR.
-
-Wed May 24 15:41:51 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cplus-dem.c (strstr, strncmp, strlen): Remove declarations.
-
- * tree.c (type_list_equal, simple_cst_list_equal, index_type_equal):
- Check for simple_cst_equal return value of -1.
-
-Wed May 24 10:05:24 1995 Michael Meissner <meissner@cygnus.com>
-
- * libgcc1-test.c (start, _start): Provide declarations, so that
- the GNU linker doesn't give a warning message about defaulting the
- start address.
-
- * rs6000/sysv4.h (STRIP_NAME_ENCODING): Redefine back to the
- original defination, rather than the defination used in rs6000.h.
- (ASM_OUTPUT_SOURCE_LINE): Use STRIP_NAME_ENCODING.
- * rs6000.h (STRIP_NAME_ENCODING): Skip leading '*'.
-
- * rs6000.h (MASK_STRING_SET, TARGET_STRING_SET): Add target
- flags bit for whether -mstring was actually used.
- (TARGET_SWITCHES): Add MASK_STRING to all power targets. Set
- MASK_STRING_SET for -mstring and -mno-string.
- (TARGET_DEFAULT): Add MASK_STRING.
-
- * rs6000.c (rs6000_override_options): Add MASK_STRING to
- all power targets. Make an explicit -mstring/-mno-string override
- the -mcpu=processor default.
-
- * rs6000/eabile.h (CPP_SPEC): Copy from sysvle.h to provide the
- appropriate little endian defaults.
-
- * rs6000/sysv4.h (ASM_OUTPUT_SOURCE_LINE): Use assemble_name to
- output the canonical name.
-
-Wed May 24 01:21:15 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * rs6000.h (STRIP_NAME_ENCODING): Define.
- (RS6000_OUTPUT_BASENAME): Use it.
-
-Tue May 23 19:54:21 1995 Doug Evans <dje@cygnus.com>
-
- * gcc.c (link_command_spec): Move ENDFILE_SPEC from -nostdlib
- to -nostartfiles.
-
-Tue May 23 17:01:50 1995 Jim Wilson <wilson@cygnus.com>
-
- * alpha.md (negsi2-2): Change output pattern to #.
-
- * mips.c (embedded_pic_offset): Output RTL to initialize
- embedded_pic_fnaddr_rtx.
- (mips_finalize_pic): Delete.
- * mips.h (mips_finalize_pic): Delete declaration.
- (FINALIZE_PIC): Delete.
- (INIT_EXPANDERS): Clear embedded_pic_fnaddr_rtx.
- * mips.md (get_fnaddr): Add = to output contraint.
-
- * sh.c (shift_amounts): Correct entry for shifts by 29.
- * sh.md (sett): New pattern.
- (movsi_i): Change source constraint for move to T reg to be 'z'.
-
- * mips/ecoff.h (STARTFILE_SPEC): Define to null string.
- * mips/elfl.h, mips/elfl64.h: Correct typo in comment.
-
- * mips/elflorion.h, mips/elforion.h (MIPS_CPU_DEFAULT): Delete.
- * mips.c (override_options): Delete #ifdef MIPS_CPU_DEFAULT code.
- Add #ifdef MIPS_CPU_DEFAULT_STRING code before the first
- mips_cpu_string test.
-
-Tue May 23 07:22:36 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * romp.c (hash_rtx): Avoid warning on int-to-pointer conversion.
- (output_fpops): Cast args to bcopy to char *.
-
- * cpplib.c (initialize_builtins): Add missing parm to timestamp call.
-
- * Makefile.in (install-libobjc): Don't depend on libobjc.a.
-
- * c-parse.in: Objc shift/reduce conflicts now 48.
- (parm): Use setspecs/restore here.
- (parmlist_or_identifiers): Not here.
-
-Mon May 22 19:30:30 1995 Doug Evans <dje@cygnus.com>
-
- * h8300.md (movsf_h8300h): Add missing post-inc case to constraints.
-
-Mon May 22 14:38:36 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (rs6000_override_options): Do SUBTARGET_OVERRIDE_OPTIONS
- here.
- * rs6000.h (OVERRIDE_OPTIONS): Not here.
-
- * rs6000.c (expand_block_move): Handle moves without string
- instructions by generating a series of loads and stores.
- (output_prolog): Support -mno-toc on V.4 and eabi systems.
-
- * rs6000/sysv4.h (TARGET_SWITCHES): Add -mtoc and -mno-toc.
- (SUBTARGET_OVERRIDE_OPTIONS): Add some warnings for incompatible
- switches.
- (TOC_SECTION_FUNCTION): Make -mno-toc like -mrelocatable in that
- we don't put the minimal toc pointer in the global toc section.
- (LINK_SPEC): Use -oformat to set link output format, not -m.
-
- * rs6000/t-eabigas (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Build
- libgcc.a variants with -mno-toc support.
- * rs6000/t-ppcgas (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Ditto.
-
-Mon May 22 07:10:52 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cplus-dem.c (mystrstr): Replacement for strstr.
-
- * configure: Split up long sed command.
- * Makefile.in (SYMLINK): Deleted; unused.
- (oldobjext): Deleted; no longer used.
- (FLAGS_TO_PASS): Include objext and exeext.
- (STAGESTUFF, protoize.o, unprotoize.o): Use $(objext), not .o.
- (test_protoize_simple, compare{,3}, gnucompare{,3}): Likewise.
- (STAGESTUFF, specs, gcc-cross, collect2): Add missing $(exeext).
- (libgcc1.null, libgcc[12].a, stage[1-4]): Likewise.
- (xgcc, cc1, cc1obj, enquire): Use $@ instead of filename for -o value.
- (collect2, mips-tfile, mips-tdump, gen*): Likewise.
- (bi-arity, bi-opcode, bi-opname, cccp, cppmain): Likewise.
- (protoize, unprotoize, gen-protos, fix-header): Likewise.
- (crtbegin.o, crtend.o): Don't use -o; move output to proper
- filename (using objext) instead.
- (BI_ALL, BC_ALL, bytecode): Deleted; unused.
- (bi-*.o, cexp.o, stamp-{proto,fixinc}): Remove unneeded $(srcdir).
- (getopt{,1}.o, SYSCALLS.c.X): Likewise.
- (install-driver): New target.
- (install-normal): Depend on it.
- (install-common): Don't depend on xgcc.
- (maketest): Deleted; no longer used.
- (stage[1-4]): Use name collect-ld, not real-ld.
- (risky-stage[1-4]): Use stage[1-4] as dependencies; don't copy.
- * alpha/config-nt.bat, i386/config-nt.bat: Make {,h,t}config.h
- and tm.h by writing a single #include line.
- Update way specs.h and options.h are written.
- * alpha/config-nt.sed, i386/config-nt.sed: Set new variables
- into Makefile.
- Build winnt.obj.
- Edit CCCP definition.
- * alpha/x-winnt, i386/x-winnt (oldobjext): Deleted.
- Add rules for .c.obj, .adb.obj, and .ads.obj.
- (LIB2FUNCS_EXTRA, spawnv.o): New rules.
- * i386/x-winnt (objext): Now .obj, not .o.
-
- * gcc.c (HAVE_OBJECT_SUFFIX): New macro.
- (process_command): Convert x.o to x.foo for OBJECT_SUFFIX of ".foo".
- (do_spec_1): Avoid shadow variable "i" and always use for loop var.
-
- * c-decl.c (finish_decl_top_level): Removed; no longer used.
- * objc-act.c: Numerous formatting changes.
- (NULLT): Deleted; all uses changed to NULL_TREE.
- (get_{static,object}_reference, objc_add_static_instance):
- Use push_obstacks instead of saving obstacks manually.
- (build_{selector,class}_reference_decl): Likewise.
- (build_objc_string_decl, build_protocol_reference): Likewise.
- (comp_{method,proto}_with_proto): Likewise.
- (create_builtin_decl, synth_module_prologue): Set DECL_ARTIFICIAL
- for internal objects.
- (build_{selector,class}_reference_decl, add_objc_decls): Likewise.
- (generate_objc_symtab_decl, build_module_descriptor): Likewise.
- (build_protocol_reference): Likewise.
- (build_objc_string_decl, synch_forward_declarations): Likewise.
- Delete call to end_temporary_allocation.
- (generate_static_references, generate_strings): Likewise.
- (build_selector_translation_table, generate_category): Likewise.
- (generate_{ivars,protocol}_list, build_protocol_reference): Likewise.
- (build_objc_string_object): If next_runtime, put everything in
- permanent obstack.
- (objc_add_static_instance): Use build_decl instead of start_decl
- and finish_decl_top_level.
- (build_{class_reference,objc_string}_decl): Clear DECL_CONTEXT.
- (start_class): Exit with FATAL_EXIT_CODE, not 1.
- (add_objc_decls): Don't set DECL_IN_SYSTEM_HEADER.
-
- * tree.c (valid_machine_attribute): Handle attribute on
- pointer-to-function types.
-
-Sun May 21 17:16:37 1995 J. T. Conklin <jtc@cygnus.com>
-
- * mips/netbsd.h (HAVE_STRERROR): Remove.
- * mips/xm-netbsd.h: New file.
- * mips/t-mips-netbsd: Deleted.
- * configure (mips-dec-netbsd): Use xm-netbsd.h and t-libc-ok.
-
-Sun May 21 17:16:37 1995 Arne H. Juul (arnej@pvv.unit.no)
-
- * mips/netbsd.h: Use __start as entry point. Ifdef some
- paths on CROSS_COMPILE.
-
-Sun May 21 08:39:26 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-parse.in (datadef, fndef, ivar_decl, mydecls):
- Restore declspec_stack since setspecs is used.
- (parmlist_or_identifiers): Use setspecs before parsing parms
- and restore after parsing parms.
-
-Sun May 21 01:04:52 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.c (hppa_encode_label): New variable "permanent" to
- where/how memory is allocated for the new label. All
- callers changed.
-
-Sat May 20 16:53:30 1995 Mike Meissner <meissner@cygnus.com>
-
- * rs6000.md (insv, extz): Fail if the structure is QI or HI reg to
- avoid paradoxical subreg's being created in RTL phase, which uses
- SImode to load from memory if structure is later moved to stack.
-
-Sat May 20 06:44:59 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (udivmodhi4): Output "divu" instead of "divs".
-
-Sat May 20 06:11:32 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * reload.c (push_reload): Don't reload inside a SUBREG
- when SUBREG_WORD is nonzero.
-
- * c-decl.c (shadow_tag_warned): Don't warn about useless keyword
- if in system header file.
-
- * tree.c (simple_cst_equal): Don't look at language-specific
- nodes since we don't know what's in them.
-
- * cpperror.c: #include config.h before any other .h file.
- * collect2.c: Likewise.
-
- * i386/config-nt.bat: Add missing ^M on two lines.
- Add case for Fortran; fix typo in Ada case.
- * alpha/config-nt.bat: Add case for Fortran; fix typo in Ada case.
-
- * m68k/t-next (LIBGCC1, CROSS_LIBGCC1): Make not, not "libgcc1.null".
- (OTHER_FIXINCLUDES_DIRS, LIMITS_H_TEST): Delete from here.
- * m68k/x-next (OTHER_FIXINCLUDES_DIR, LIMITS_H_TEST): Move to here.
-
-Fri May 19 19:30:20 1995 Stan Cox (gcc@dg-rtp.dg.com)
-
- * crtstuff.c: Added reference to INIT_SECTION_PREAMBLE for systems that
- do something which must be undone prior to __do_global_ctors.
-
-Fri May 19 19:27:08 1995 Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>
-
- * i386/linux-aout.h (CPP_SPEC): Add defines for -fPIC.
- * i386/linux-oldld.h (CPP_SPEC): Likewise.
-
-Fri May 19 17:46:28 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * collect2.c (strstr): Deleted.
- * cplus-dem.c (strstr): Define ifndef POSIX.
-
-Fri May 19 11:16:51 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cpplib.c (collect_expansion): Don't escape '@' inside string.
-
-Fri May 19 06:59:21 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vmsconfig.com (process_objc_lib, configure_makefile): New routines.
- (bc_all.list, ./vax.md, objc-objs.opt, objc-hdrs.list): New files
- created at config time.
- (bc_all.opt, ./md.): No longer created.
- * make-cc1.com: Handle revised filenames from vmsconfig.com;
- (DO_OBJCLIB): New variable, plus code to compile objc/*.{c,m}.
-
-Wed May 17 16:15:31 1995 Torbjorn Granlund <tege@cygnus.com>
-
- * i960.c (i960_output_ldconst): New code for XFmode.
- Also, move SFmode code to immediately after DFmode code.
- (S_MODES, D_MODES): Handle XFmode.
- (XF_MODES): Was TF_MODES, handle XFmode instead of TFmode.
- (hard_regno_mode_ok): Replace TFmode with XFmode.
- (i960_output_long_double): New function.
-
- * i960.h (DATA_ALIGNMENT): Define.
- (ROUND_TYPE_ALIGN): Align XFmode scalars at 128 bit boundaries.
- (ROUND_TYPE_SIZE): Round up the size of XFmode objects to 128 bits.
- (CONST_DOUBLE_OK_FOR_LETTER_P): Use CONST0_RTX and CONST1_RTX
- so that all FP modes are recognized.
- (ASM_OUTPUT_LONG_DOUBLE): Define.
-
- * i960.md: Change all TFmode patterns to have XFmode.
- (movxf recognizer, frame version): Use movt, ldt, and stt.
- (movxf recognizer, non-frame version): Delete.
- (extenddfxf2): Delete * before f constraint.
- (extendsfxf2): Likewise.
-
-Wed May 17 17:53:35 1995 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * unroll.c (unroll_loop): Increment copy_start_luid if copy_start
- is loop_start.
-
-Wed May 17 17:44:57 1995 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * fold-const.c (invert_truthvalue, case CLEANUP_POINT_EXPR): New case.
-
-Tue May 16 18:51:16 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.h (TARGET_SWITCHES): Add -mstring to enable string
- instructions, and -mno-string to disable them.
- (MOVE_MAX): Don't test TARGET_MULTIPLE anymore.
- (MAX_MOVE_MAX): Set to 8, not 16.
- (expand_block_move): Add declaration.
-
- * rs6000/rs6000.c (expand_block_move): New function to expand
- block moves when -mstring is used.
-
- * rs6000/rs6000.md (movti): Use TARGET_STRING, not TARGET_MULTIPLE.
- (load_multiple, store_multiple): Ditto.
- (string insns): Add 8, 6, 4, 2, and 1 register variants for using
- the native string instructions if -mstring.
-
- * rs6000/sysv4.h (CPP_SPEC): If little endian, define
- _LITTLE_ENDIAN and set littleendian assertion. If big endian,
- define _BIG_ENDIAN and set bigendian assertion.
- * rs6000/sysv4le.h (CPP_SPEC): Copy from sysv4.h, and change
- default to little endian.
-
- * rs6000/rs6000.c (override_options): Check for -mmultiple and
- -mstring on little endian systems here.
- * rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Don't do the check
- here.
-
-Tue May 16 18:36:41 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * alpha.c: Changed WINNT to _WIN32.
- * alpha/config-nt.bat, i386/config-nt.bat: Added commands to
- generate specs.h and options.h.
- * i386/config-nt.sed: Changed link32 to link.
- * winnt/ld.c (main): Removed call to free.
- * configure.bat: Added line to echo usage on invalid input.
- * gcc.c (fix_argv): Removed call to free.
- * gcc.c, getpwd.c, protoize.c, sdbout.c: Changed WINNT to _WIN32.
- * toplev.c: Likewise.
-
-Tue May 16 18:04:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * toplev.c (pfatal_with_name, fatal_io_error, vfatal):
- Use FATAL_EXIT_CODE instead of magic number.
- * cccp.c, cpplib.c, cpplib.h: Use FATAL_EXIT_CODE instead
- of FAILURE_EXIT_CODE.
- * fix-header.c, gen-protos.c: Likewise.
- * cpperror.c, cppmain.c: Likewise.
- Include config.h #ifndef EMACS.
- * xm-alpha.h, xm-rs6000.h, xm-vms.h (FAILURE_EXIT_CODE): Remove.
-
-Tue May 16 17:46:57 1995 Adam Fedor <fedor@colorado.edu>
-
- * objc/archive.c (__objc_write_class): Write class version.
- (__objc_write_selector, objc_{write,read}_selector): Handle null
- selector.
-
- * objc/sarray.h (struct sarray): Make capacity size_t.
- * objc/sarray.c (sarray_realloc): Make array index variables size_t.
-
-Tue May 16 06:59:08 1995 Paul Eggert <eggert@twinsun.com>
-
- * dsp16xx.c (print_operand_address): Fix misspellings in messages.
- * i370/mvs.h (FUNCTION_PROFILER): Likewise.
- * mips-tdump.c (type_to_string): Likewise.
- * print-tree.c (print_node): Likewise.
-
- * protoize.c (edit_fn_definition): Fix mispelled local `have_flotsam'.
-
- * objc/sendmsg.c (__objc_init_install_dtable): Fix misspelling
- in name of local label `already_initialized'.
-
- * winnt/winnt.h (STDC_VALUE): Was misspelled.
-
- * m68k/ccur-GAS.h (FUNCTION_BOUNDARY): Was misspelled.
-
- * 1750a.h (DEFAULT_PCC_STRUCT_RETURN): Was misspelled.
-
-Mon May 15 23:41:25 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Make sure to encode section
- info for all libcalls.
-
-Mon May 15 20:58:00 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * collect2.c (strstr): Define ifndef POSIX.
-
- * defaults.h (SUPPORTS_WEAK): Provide default.
- * aoutos.h, sparc/sunos4.h: Don't support weak symbols.
- * netbsd.h, svr4.h, i386/freebsd.h, i386/osfrose.h,
- m88k/m88k.h: Define ASM_WEAKEN_LABEL instead of WEAK_ASM_OP.
- * c-pragma.h: Check ASM_WEAKEN_LABEL instead of WEAK_ASM_OP.
- HANDLE_PRAGMA_WEAK is never defined in a tm.h file.
- * c-decl.c (duplicate_decls): Propagate DECL_WEAK.
- * tree.h (DECL_WEAK): New macro.
- (tree_decl): Add weak_flag.
- * varasm.c (assemble_start_function): Declare the symbol weak if
- appropriate.
- (assemble_variable): Ditto.
- (assemble_alias): Ditto. Mark the decl as written.
- (declare_weak): Check for weak declaration after definition.
- Set DECL_WEAK.
- (weak_finish): Use ASM_WEAKEN_LABEL.
- * libgcc2.c: The C++ free-store management functions are weak
- aliases on targets that always support them.
-
-Mon May 15 19:01:43 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure (out_object_file): New variable; put value in Makefile.
- * Makefile.in (out_object_file): Use in place of aux-output.o.
-
- * fold-const.c (const_binop): Don't pass OVERFLOW to force_fit_type
- if type is unsigned.
-
-Mon May 15 18:48:26 1995 Paul Eggert <eggert@twinsun.com>
-
- * install.sh (transformbasename): Fix misspelling.
-
- * tahoe.h (CHECK_FLOAT_VALUE): Fix misspelling of OVERFLOW parameter.
-
- * i386.h (VALID_MACHINE_{DECL,TYPE_ATTRIBUTE): Fix typo.
-
- * fx80.h (CHECK_FLOAT_VALUE): Fix misspelled use of parameter.
-
- * a29k.c (spec_reg_operand): Fix misspelling of `default:'.
-
-Mon May 15 18:36:41 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.md (b{eq,ne,ge,lt}0_di): Fixed for non-MOTOROLA syntax.
- * m68k/xm-mot3300.h (alloca): Extern decl added for non-GNU compiler.
-
-Mon May 15 13:14:29 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cppexp.c (cpp_reader): Test for '#' (start of assertion) *after*
- skipping hspace, not before.
-
-Mon May 15 08:13:54 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vmsconfig.com: Construct options.h and specs.h to #include
- all "*/lang-{options|specs}.h" files found.
-
-Sun May 14 21:32:49 1995 Doug Evans <dje@cygnus.com>
-
- * alpha/alpha.md (movsicc, case NE): Don't generate unrecognizable
- insn.
- (movdicc, case NE): Likewise.
-
-Sun May 14 15:44:54 1995 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * unroll.c (unroll_loop): Make local_regno have size
- max_reg_before_loop. Don't do local register optimization if
- copy_end has no INSN_LUID.
-
-Sun May 14 10:38:23 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * objc-act.c (start_method_def): Mark _self as possibly unused.
-
- * configure: Create specs.h and options.h from */lang-specs.h
- and */lang-options.h.
- Set lang_specs_files and lang_options_file variables in Makefile.
- * Makefile.in (lang_{specs,options}_files): New variables.
- (gcc.o): Depends on $(lang_specs_files).
- (toplev.o): Depends on $(lang_options_file); merge two dep lists.
- (distclean): Remove spes.h and options.
- * gcc.c (default_compilers): Remove entries for Ada, C++, Chill,
- and Fortran; #include specs.h instead.
- * toplev.c (lang_options): Remove entries for Ada, C++, and Fortran;
- include options.h instead.
-
-Sat May 13 23:11:21 1995 DJ Delorie <dj@delorie.com>
-
- * configure (i[345]86-go32-msdos, i[345]86-*-go32): New targets.
-
-Sat May 13 10:58:38 1995 Jim Wilson <wilson@cygnus.com>
-
- * loop.c (record_giv): When computing replaceable, use
- back_branch_in_range_p instead of looking for branches to named
- labels.
- * loop.h (back_branch_in_range_p): Declare.
- * unroll.c (back_branch_in_range_p): No longer static.
-
-Sat May 13 06:47:11 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (simplify_shift_count, case LSHIFTRT): Don't merge
- shifts of different modes if first is any right shift.
-
-Sat May 13 05:39:09 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * configure (arm-semi-aout): New configuration.
- * config.sub: Add support for semi-hosted ARM.
- * arm/t-semi, arm/semi.h: New files.
-
-Fri May 12 21:51:22 1995 Doug Evans <dje@cygnus.com>
-
- * flow.c (find_basic_blocks): Only perform n_basic_blocks sanity
- check on first pass, and on second pass ensure it has the correct
- value.
-
-Fri May 12 19:23:11 1995 Jim Wilson <wilson@cygnus.com>
-
- * c-typeck.c (build_binary_op): Warn when ~unsigned is compared
- against unsigned, and type promotions result in an unexpected
- answer.
-
-Fri May 12 19:10:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * configure (*-*-gnu*): Always use ELF; set tm_file=${cpu_type}/gnu.h.
- * config/i386/gnu.h: Contents replaced with old i386/gnuelf.h.
- * config/i386/gnuelf.h: File removed.
-
-Fri May 12 17:29:57 1995 Ken Raeburn (raeburn@cygnus.com)
-
- * m68k/lb1sf68.asm (__IMMEDIATE_PREFIX__): Default to #.
- (IMM): New macro.
- (all code): Use IMM macro instead of hardcoding # for immediate
- operands.
-
-Fri May 12 16:52:10 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * m68k.c (output_scc_di): New function.
- (extend_operator) : Allow DImode target.
- * m68k.h (HARD_REGNO_MODE_OK): Don't allow d7/a0 as DImode reg pair.
- * m68k.md (tstdi, cmpdi, addsi_lshrsi_31, ashldi_extsi): New patterns.
- (extendqidi2, extendhidi2, extendsidi2): Allow "general_operand"
- instead of "register_operand" 0.
- (adddid_sexthishl32, subdid_sexthishl32, subdi_dishl32): Likewise.
- (adddi_dilshr32): Operand 0 constraint changed from "ro" to "do";
- Code generation fixed.
- (adddi_mem, subdi_mem): Fixed for "<" and ">" operand 0.
- (adddi3, subdi3): Operand 2 constraint changed from "ao" to "*ao"
- (ashldi_sexthi, ashrdi_const32): Allow only "register_operand"
- instead of "general_operand" 0.
- (ash[lr]di_const, ash[lr]di3): Allow also 8 and 16 as shift count.
- (subreg1ashrdi_const32): Pattern deleted.
- (subreghi1ashrdi_const32, subregsi1ashrdi_const32): New pattern.
- (lshrsi_31): New implementation.
- (scc0_di, scc_di, beq0_di, bne0_di, bge0_di, blt0_di): New patterns.
-
-Fri May 12 16:50:49 1995 Jeffrey A. Law <law@mole.gnu.ai.mit.edu>
-
- * pa.md (bb patterns): Fix bugs in length computation exposed by
- recent branch shortening and genattrtab changes.
-
-Fri May 12 16:22:27 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * cccp.c (enum node_type): Add T_IMMEDIATE_PREFIX_TYPE.
- (special_symbol): Handle it; emit value of IMMEDIATE_PREFIX.
- (IMMEDIATE_PREFIX): Default to empty string.
- (initialize_builtins): Install __IMMEDIATE_PREFIX__ builtin,
- parallel to __REGISTER_PREFIX__.
-
-Fri May 12 14:40:03 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * cccp.c: #if VMS, don't define `stat' macro to be VMS_stat.
- Compare enums explicitly to 0 to work around VAX C bug.
- (do_include): Cast alloca's value.
-
- * make-cc1.com (bc_loop): Process comma-separated list rather
- than space-separated one; restore .h suffix stripped by vmsconfig;
- (loop1): More robust handling of directory prefix on file names.
- * vmsconfig.com (TPU makefile.in): Reorganize and reformat code.
- Make generated .opt files have more consistent format (all comma
- separated, excess whitespace eliminated);
- (additional_compiler): New routine.
- (process_makefile): Use it to handle cc1plus via cp/Make-lang.in.
-
-Fri May 12 13:35:07 1995 Doug Evans <dje@cygnus.com>
-
- * arm.h: Replace ARM_REG_PREFIX with REGISTER_PREFIX.
- Replace ARM_COMMENT_CHAR with ASM_COMMENT_START.
- (REGISTER_PREFIX): Define.
- (USER_LABEL_PREFIX, LOCAL_LABEL_PREFIX): Define.
- (SECONDARY_OUTPUT_RELOAD_CLASS): Handle DFmodes only if
- TARGET_HARD_FLOAT.
- (PREDICATE_CODES): Add soft_df_operand.
- * arm.c: Replace ARM_REG_PREFIX with REGISTER_PREFIX.
- Replace ARM_COMMENT_CHAR with ASM_COMMENT_START.
- (arm_asm_output_label): Use USER_LABEL_PREFIX.
- (soft_df_operand): New function.
- * arm.md (movsicc): New pattern.
- (movsfcc, movdfcc, *movsicc_insn, *movsfcc_hard_insn): Likewise.
- (*movsfcc_soft_insn, *movdfcc_insn): Likewise.
- (*movdf_soft_insn): Rewrite.
- (movsi matcher): Fix typo in type attribute.
-
-Fri May 12 10:25:40 1995 Michael Meissner (meissner@cygnus.com)
-
- * i386.h (TARGET_RTD): Use MASK_RTD, not MASK_REGPARM.
- (TARGET_SWITCHES): Add -m{,no-}align-double switch.
- (TARGET_OPTIONS): Add -mregparm= switch to set number of registers
- to use for passing arguments. Add -malign-loops= switch to set
- the alignment for loops. Add -malign-jumps= switch to set the
- alignment for code that is jumped to. Add -malign-functions=
- switch to set the initial alignment of functions.
- (TARGET_REGPARM): Delete, in favor of -mregparm=
- (TARGET_SWITCHES): Delete -mregparm, add -mdebug-arg switches.
- (RETURN_POPS_ARGS): Call i386_return_pops_args to do the real work.
- (VALID_MACHINE_DECL_ATTRIBUTE): Define as function call.
- (VALID_MACHINE_TYPE_ATTRIBUTE): Define as function call.
- (COMP_TYPE_ATTRIBUTES): Define as function call.
- (REGPARM_MAX): Maximum number of regs to use for passing arguments.
- (CUMULATIVE_ARGS): Make this a structure, not an int.
- (INIT_CUMULATIVE_ARGS, FUNCTION_ARG{,_ADVANCE}): Call function.
- (FUNCTION_ARG_PARTIAL_NREGS): Likewise.
- (MAX_CODE_ALIGN): Maximum value to align loops/jumps to.
- (BIGGEST_ALIGNMENT): Return 64 if -malign-double, 32 otherwise.
- (ASM_OUTPUT_ALIGN_CODE): Use value of -malign-jumps= switch.
- (ASM_OUTPUT_LOOP_ALIGN): Use value of -malign-loops= switch.
- (toplevel): Declare all new functions and external variables added
- in i386.c.
-
- * i386.c (i386_regparm_string, i386_regparm): New variables
- for -mregparm= switch to set the number of registers to use for
- passing arguments.
- (i386_align_loops_string, i386_align_loops): New variables for
- -malign-loops= switch to set alignment to use for loops.
- (i386_align_jumps_string, i386_align_jumps): New variables for
- -malign-jumps= switch to set alignment to use for labels that are
- jumped to.
- (override_options): Support new switches.
- (i386_valid_decl_attribute_p): New function to validate decl
- specific attributes. Presently returns 0.
- (i386_valid_type_attribute_p): New function to validate type
- specific attributes. Recognize "stdcall", which says function
- with fixed numbers of arguments is responsible for popping stack,
- "cdecl", which says to use the normal C calling sequence, even if
- -mrtd is used, and "regparm", which specifies the number of
- registers to use for passing arguments.
- (i386_comp_type_attributes): New function, to validate whether
- attributes are compatible.
- (i386_return_pops_args): New function, to return whether or not
- the function pops its argument list or not, taking into account
- -mrtd, and the stdcall/cdecl attributes.
- (init_cumulative_args): Rewrite as a function, taking variable
- argument functions, and regparm support into account.
- (function_arg{,_advance,_partial_nreg}): Likewise.
- (print_operand): Support %J, to print appropriate jump insn.
-
- * i386.md (decrement_and_branch_until_zero): Define pattern,
- so that loops that count down to zero, don't have an unneeded
- compare after the decrement. Add a general insn recognizer for
- add to a value and compare against zero.
-
- * i386/go32.h, i386/winnt.h (VALID_MACHINE_DECL_ATTRIBUTE):
- Delete, code folded into the mainline.
- (RETURN_POPS_ARGS): Likewise.
-
- * i386/winnt.h (ENCODE_SECTION_INFO): The stdcall attribute is now
- stored on the type field, rather than the decl.
-
- * i386/gas.h (ASM_OUTPUT_ALIGN_CODE, ASM_OUTPUT_LOOP_ALIGN): Use
- i386_align_{loops,jumps} variables to do alignment.
- * i386/osfrose.h, i386/svr3dbx.h: Likewise.
-
-Fri May 12 12:48:19 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (layout_type, case ARRAY_TYPE): Compute length using
- MAX of length and zero if sizetype signed and neither bound constant.
-
- * i386/gnuelf.h, i386/linux-oldld.h, i386/lynx-ng.h, i386/v3gas.h:
- Use <...> in #include instead of "...".
- * m68k/lynx-ng.h, sparc/lynx-ng.h: Likewise.
-
- * c-parse.in (myparm): Handle attributes.
- * objc-act.c (unused_list): New variable.
- (build_tmp_function_decl): Call push_parm_decl with new format.
- (start_class): Initialize unused_list.
- (start_method_def): Call push_parm_decl with new format and
- mark _cmp as possibly unused.
-
- * combine.c (simplify_shift_const): Don't change SHIFT_MODE
- for LSHIFTRT either.
-
- * unroll.c (unroll_loop): Don't move reg if used in copy_end and
- that is a JUMP_INSN.
-
-Fri May 12 12:31:37 1995 Doug Evans <dje@cygnus.com>
-
- * arm/lib1funcs.asm: New file.
-
-Fri May 12 11:52:03 1995 Kung Hsu <kung@cygnus.com>
-
- * configure (a29k-*-vxworks*): New target.
- * config.sub (vxworks29k): New alias.
- * a29k/t-vx29k: New file.
- * a29k/vx29k.h: New file.
-
-Fri May 12 11:17:28 1995 Jim Wilson <wilson@mole.gnu.ai.mit.edu>
-
- * loop.c (check_dbra_loop): When reversing loop when
- no_use_except_counting is false, there must be only one biv.
-
-Fri May 12 07:10:00 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * unroll.c (unroll_loop): Only use local_regno for pseudos.
-
- * genattrtab.c (write_test_expr, case MATCH_DUP): Use operands[N]
- instead of JUMP_LABEL (which may not be set).
- (walk_attr_value, case MATCH_DUP): Set must_extract.
-
- * c-parse.in: Adjust number of shift/reduce conflicts.
- (parm): Support attributes.
- * c-decl.c (push_parm_decl): Pass any attributes to decl_attributes.
-
-Fri May 12 00:36:26 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cpplib.c (skip_quoted_string): Removed - no longer needed.
- (skip_if_group): Use cpp_get_token instead of skip_quoted_string.
-
- * cpplib.h (struct cpp_reader): Remove start_line field.
- Add multiline_string_line field.
-
- * cpplib.c (cpp_error_with_line, cpp_warning_with_line,
- cpp_pedwarn_with_line): Take extra column number parameter.
- (macroexpand, cpp_get_token): Fix reporting of unterminated strings.
- (line_for_error): Removed - no longer needed.
-
-Fri May 12 02:21:34 1995 Jim Wilson <wilson@cygnus.com>
-
- * mips/svr4-t.h (MD_STARTFILE_PREFIX, MD_EXEC_PREFIX,
- STARTFILE_SPEC, LINK_SPEC): Define.
- * configure (mips-tandem-sysv4): Use t-mips not t-svr4.
-
-Thu May 11 19:18:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cpplib.c (line_for_error): Make it work; add extra parameter.
- (skip_quoted_string, cpp_get_token): Update calls to line_for_error.
- (macroexpand): Remember initial line so we can report it if the
- call is unterminated. Also, simplify error logic slightly.
- (do_include): Cast alloca return value, to avoid pcc warning.
-
- * cppexp.c (parse_number): Cleanup some Cygnus crud for MPW.
-
-Thu May 11 21:35:23 1995 Torbjorn Granlund <tege@cygnus.com>
-
- From Moshier:
- * i960.c (i960_output_ldconst): Let split_double handle DImode.
- (i960_print_operand): Use REAL_VALUE_TO_DECIMAL for decimal strings.
- (i960_output_double, i960_output_float): Likewise; also change arg
- VALUE from `double' to `REAL_VALUE_TYPE'.
-
-Thu May 11 21:09:25 1995 Per Bothner (bothner@wombat.gnu.ai.mit.edu)
-
- * cpperror.c (cpp_print_containing_files): Remove some
- Cygnus-local stuff.
-
-Thu May 11 21:06:47 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * gcc.c (link_command_spec): Make -nostdlib no longer imply
- -nostartfiles.
-
-Thu May 11 18:48:57 1995 Paul Eggert <eggert@twinsun.com>
-
- * c-common.c (convert_and_check): Don't diagnose overflow in constant
- expression merely because conversion overflowed.
-
-Thu May 11 18:43:59 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-decl.c (grokdeclarator): Use PARM_FLAG to see if should
- make PARM_DECL.
- * c-parse.in (nested_function, notype_nested_function):
- Allow old-style arg definitions (use xdecls).
-
- * c-decl.c (finish_struct): Properly update DECL_PACKED.
-
-Thu May 11 15:24:15 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * fold-const.c (fold): Also fold CLEANUP_POINT_EXPRs into
- TRUTH_*_EXPRs and into the first operand.
- (operand_equal_for_comparison_p): Also make sure the second operand
- is integral.
-
-Thu May 11 14:22:03 1995 Ted Lemon <mellon@toccata.fugue.com>
-
- * config/mips/netbsd.h: New file.
- * config/mips/t-mips-netbsd: New file.
- * config/mips/x-netbsd: New file.
-
- * configure (mips-dec-netbsd*): Add entry.
-
- * mips.h (LOCAL_LABEL_PREFIX, USER_LABEL_PREFIX): Define.
- (PUT_SDB_BLOCK_START, PUT_SDB_BLOCK_END, ASM_OUTPUT_LABEL_REF,
- ASM_OUTPUT_INTERNAL_LABEL, ASM_GENERATE_INTERNAL_LABEL,
- ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use them.
-
- * mips.c (mips_output_lineno): Use LOCAL_LABEL_PREFIX.
-
-Thu May 11 14:22:03 1995 Stan Cox (gcc@dg-rtp.dg.com)
-
- * dwarfout.c (output_decl): Don't output DIE for struct or union type
- with no name or with ERROR_MARK for the fields.
-
-Thu May 11 06:36:34 1995 Michael Meissner (meissner@cygnus.com)
-
- * flow.c (mark_used_regs): If a SUBREG does not have a REG in the
- SUBREG_REG position, recursively call mark_used_regs, instead of
- segfaulting.
-
-Thu May 11 06:44:34 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * expr.c (do_jump, case EQ_EXPR, NE_EXPR): Fix typo for complex.
-
-Wed May 10 12:34:46 1995 Michael Meissner <meissner@cygnus.com>
-
- * configure: Add support for the little endian variant of the
- PowerPC System V.4 and Eabi targets. If the GNU assembler was not
- specified, don't build libgcc.a variants on the PowerPC systems
- that use -mrelocatable, -mlittle, and -mbig.
-
- * genmultilib: For MULTILIB_MATCHES arguments, map question marks
- into equal signs after spliting the left and right side of
- equivalent options, to all support for options like: -mcpu=403.
-
- * rs6000/rs6000.md (rs6000_immed_double_const): New function that
- is like immed_double_const, except that it reverses the two words
- in the constant if the target is little endian.
-
- * rs6000/rs6000.md (floatsidf2): Use rs6000_immed_double_const,
- not immed_double_const.
- (floatunssidf2): Ditto.
-
- * rs6000/rs6000.h: Add declarations for all functions in rs6000.c.
-
- * rs6000/sysv4.h (TARGET_SWITCHES): Add -mlittle, -mlittle-endian,
- -mbig, and -mbig-endian for bi-endian support.
- (ASM_SPEC): Pass -mlittle/-mbig to the assembler if it was passed
- to us.
- (LINK_SPEC): If explicit little or big endian support was
- requested, tell the GNU linker to use the appropriate target
- format.
-
- * rs6000/t-eabi (MULTILIB_*): Build libgcc.a variants for software
- floating point. Remove mrelocatable libgcc.a variant.
-
- * rs6000/t-eabigas: New file, cloned from t-eabi. Build
- mrelocatable libgcc.a variant in addition to the other variants.
-
- * rs6000/t-ppc: New file, for PowerPC System V.4 support without
- the GNU assembler.
-
- * rs6000/t-ppcgas: New file, for PowerPC System V.4 support with
- the GNU assembler.
-
- * rs6000/eabile.h: New file, little endian eabi config file.
- * rs6000/sysv4le.h: New file, little endian V.4 config file.
-
-Wed May 10 14:22:28 1995 Doug Evans <dje@cygnus.com>
-
- * libgcc1-test.c (main_without__main): Renamed from `main'.
- * Makefile.in (libgcc1-test): Tell the user to ignore warnings.
-
- * configure: Support --enable-foo, --disable-foo.
-
-Wed May 10 10:34:00 1995 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * unroll.c: Add declarations of static functions.
- (unroll_loop): Renumber regs local to loop for each unrolled iteration.
-
-Wed May 10 08:27:03 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (alpha_set_emit_const): Cleanups to work properly
- when run on 32-bit host.
-
- * configure: Instead of symlinking tm.h and {h,t,}config.h,
- make them files that #include the proper file; pass to Makefile.
- Pass out_file and md_file to Makefile instead of making symlinks.
- * Makefile.in (out_file, md_file, tm_file, {build,host}_xm_file):
- New symbols, to be overridden by configure.
- (insn-*): Use $(md_file), not md.
- (aux-output.o): Use $(out_file), not aux-output.c.
- ($(MD_FILE)): Rework to use new conventions.
- (gen*.o, bi-*.o): Depend on $(build_xm_file), not hconfig.h.
- (scan.o, fix-header.o, scan-decls.o): Likewise.
- (distclean): Adjust files removed for new convention.
-
-Tue May 9 19:26:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * rs6000/rs6000.h (LIBGCC_SPEC): Do link with libgcc when -shared.
-
- * Makefile.in (STAGESTUFF): Add underscore.c.
- (underscore.c): Rename temporary files to begin with 'tmp-' so that
- they will be removed by 'make mostlyclean'.
-
-Tue May 9 19:19:55 1995 Mike Stump <mrs@cygnus.com>
-
- * toplev.c (lang_options): Add new flag -ffor-scope.
-
-Tue May 9 19:11:47 1995 Lee Iverson (leei@ai.sri.com)
-
- * objc/init.c (objc_init_statics): Fix missing part of last change.
-
-Tue May 9 18:25:34 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386/gnu.h, i386/linux.h, i386/linux-aout.h, i386/lynx.h:
- Use <...> in #include instead of "..." to avoid recursion.
- * i386/netbsd.h, i386/xm-gnu.h, i386/xm-linux.h: Likewise.
- * i386/xm-lynx.h, i386/xm-freebsd.h, i386/xm-netbsd.h: Likewise.
- * m68k/lynx.h, m68k/netbsd.h, m68k/xm-lynx.h: Likewise.
- * m68k/xm-netbsd.h, mips/gnu.h, ns32k/netbsd.h: Likewise.
- * ns32k/xm-netbsd.h, rs6000/lynx.h, rs6000/xm-lynx.h: Likewise.
- * sparc/lynx.h, sparc/netbsd.h, sparc/xm-lynx.h: Likewise.
- * sparc/xm-netbsd.h, vax/netbsd.h, vax/xm-netbsd.h: Likewise.
-
-Tue May 9 15:52:05 1995 Michael Meissner <meissner@cygnus.com>
-
- * config.sub: Recognize powerpcle as the little endian varient of
- the PowerPC. Recgonize ppc as a PowerPC variant, and ppcle as a
- powerpcle variant. Convert pentium into i586, not i486. Add p5
- alias for i586. Map new x86 variants p6, k5, nexgen into i586
- temporarily.
-
-Tue May 9 15:43:27 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * rs6000/rs6000.h (LINK_SPEC, LIB_SPEC): Don't mess with libg
- if -shared.
- * rs6000/aix41ppc.h (LINK_SPEC): Ditto.
-
- * rs6000/powerpc.h: Don't emit .extern directives.
-
-Tue May 9 14:08:09 1995 Jim Wilson <wilson@cygnus.com>
-
- * sh/lib1funcs.asm (__ashrsi3, __ashlsi3, __lshrsi3): Use .byte
- instead of .word offsets in switch table.
-
-Tue May 9 11:44:47 1995 Jeremy Bettis <jbettis@cse.unl.edu>
-
- * objc/sendmsg.c (__objc_send_initialize): Call superclass if object
- does not implement +initialize.
-
-Tue May 9 02:44:16 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * rs6000/xm-rs6000.h (COLLECT_EXPORT_LIST): Define if not
- cross-compiling.
- * rs6000/xm-mach.h: #undef COLLECT_EXPORT_LIST.
- * rs6000/rs6000.h (COLLECT_SCAN_OBJECTS): Lose.
-
- * collect2.c (collect_exit): Unlink export_file.
- (prefix_from_string): Broken out from prefix_from_env.
- (prefix_from_env): Call it.
- (main): Under AIX, recognize -bE: and -bexport:, and don't
- automatically export everything if we see one. Otherwise, scan the
- objects individually and add all their symbols to an export file to be
- passed to the linker.
- (write_export_file): New function.
- (scan_prog_file): Ignore symbols starting with '.'
-
- * c-common.c (declare_hidden_char_array): Mark decl artificial.
-
-Mon May 8 18:13:57 1995 Adam Fedor <fedor@colorado.edu>
-
- * objc/init.c (_objc_load_callback): Add declaration.
- (__objc_exec_class): Call _objc_load_callback after every Class
- or Category is added.
- * objc/objc-api.h (_objc_load_callback): Add declaration.
-
-Mon May 8 17:56:28 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_expr, case INDIRECT_REF): Set RTX_UNCHANGING_P
- if both TREE_READONLY and TREE_STATIC set.
-
- * c-typeck.c (convert_for_assignment): Don't give errors about
- adding const or volatile unless both sides point to functions.
-
-Mon May 8 11:48:23 1995 Michael Meissner <meissner@cygnus.com>
-
- * configure: If ../ld/Makefile, symlink ../ld/ld.new to collect-ld,
- not real-ld. Don't test for $use_collect2 any more.
-
-Sun May 7 17:52:23 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * calls.c (expand_call): Improve -Winline warnings.
-
-Sun May 7 17:28:27 1995 DJ Delorie (dj@delorie.com)
-
- * configure.bat: Use "go32" instead of "msdos" for future expansion.
-
- * i386/go32.h: Add support for win32's stdcall functions.
-
- * configure.bat: Add ^M to end of each line.
- * i386/config-nt.bat, alpha/config-nt.bat: Likewise.
-
-Sun May 7 02:12:26 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.h (DECL_ARTIFICIAL): New macro.
-
- * function.c (expand_function_end): Don't warn about unused
- anonymous or artificial parms.
-
-Fri May 5 18:41:22 1995 Jim Meyering (meyering@comco.com)
-
- * configure: Fix typo in name of "maintainer-clean".
-
-Fri May 5 14:58:01 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.c (emit_move_sequence): Force problematical constants
- into memory during the reload pass when generating PIC.
-
-Fri May 5 13:30:33 1995 Doug Evans <dje@cygnus.com>
-
- * objc/NXConstStr.m: NXConstantString.h renamed to NXConststr.h.
-
-Fri May 5 07:10:15 1995 Stephen L Moshier (moshier@world.std.com)
-
- * real.c (emdnorm, toe64, etoe64): Significand of Intel long double
- denormals is shifted down one bit.
-
-Fri May 5 07:04:12 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c (process_init_element): Don't clear_momentary if
- constructor_stack is not empty.
-
- * objc/Makefile (SHELL): Now /bin/sh.
-
- * c-typeck.c (build_binary_op): Also warn about ordered
- comparison of pointer with zero if -Wall.
-
- * expr.c (do_jump, case EQ_EXPR, NE_EXPR): Properly compare complex.
-
-Thu May 4 18:01:25 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * objc/Makefile: NXConstantString renamed to NXConstStr.
- * objc/NXConstStr.m: Renamed from objc/NXConstantString.m.
- * objc/NXConstStr.h: Renamed from objc/NXConstantString.h.
-
-Thu May 4 17:38:21 1995 J.T. Conklin <jtc@netbsd.org>
-
- * configure (vax-*-netbsd*): New configuration.
- * vax/netbsd.h, vax/xm-netbsd.h: New files.
-
-Thu May 4 16:39:05 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * collect2.c (main): Add check for 'collect-ld', just like
- 'real-ld', except that old versions won't be looking for it in the
- path. Don't look for 'real-ld' in the path anymore. Sigh.
-
- * collect2.c: #include demangle.h and obstack.h.
- (obstack_chunk_alloc): Define.
- (obstack_chunk_free): Define.
- (generic): Don't define. Don't use.
- (main): Initialize obstacks and demangling.
-
- * collect2.c (dump_file): Adjust space padding in output to
- maintain tabulation with Solaris ld. Don't demangle if the
- environment variable COLLECT_NO_DEMANGLE is set.
-
- * collect2.c (main): Redirect the output of the first link and
- demangle it. Don't collect static c/dtors unless USE_COLLECT2 is
- defined. Null-terminate the list of objects.
- (dump_file): New function.
- (file_exists): New function.
- (collect_exit): Renamed from my_exit. Dump and remove the temporary
- ld output file.
- (collect_execute): Break out from fork_execute. Support redirection.
- (fork_execute): Call it.
- (fatal_perror, fatal, error): Make non-static.
- (xcalloc, xmalloc): Don't use generic.
- (xrealloc): Define.
- (collect_wait): Break out for do_wait. Just return the exit status.
- (do_wait): Call it.
-
- * collect2.c: Check SUNOS4_SHARED_LIBRARIES using #if, not #ifdef.
-
- * Makefile.in (collect2): Now uses cplus-dem.o and underscore.o.
- (collect2.o): Pass MAYBE_USE_COLLECT2 to compile.
- (underscore.c): Rules for creation.
-
- * cplus-dem.c, demangle.h: Copy from libiberty.
-
-Thu May 4 14:12:35 1995 Jim Wilson <wilson@cygnus.com>
-
- * sdbout.c (plain_type): Pass additional argument to plain_type_1.
- (plain_type_1): New parameter level. Increment it when making
- recursive calls. Force the type to void_type_mode before starting
- a 7th level of recursion.
-
- * sh.c (general_movsrc_operand, general_movdst_operand): Delete
- references to POST_DEC and PRE_INC.
- * sh.h: Clean up whitespace, comments, etc.
- (TARGET_SH, RTL_BIT, DT_BIT, C_BIT, R_BIT, TARGET_DUMP_RTL,
- TARGET_DUMP_R, TARGET_CDUMP): Delete.
- (TARGET_SWITCHES): Delete -mR, -mc, -mr options.
- (CONST_DOUBLE_OK_FOR_LETTER_P): Delete 'G' contraint.
- (FUNCTION_VALUE): Simplify.
- (REG_OK_FOR_PRE_POST_P, IS_INDEX): Delete.
- (BASE_REGISTER_RTX_P, INDEX_REGISTER_RTX_P): Rewrite to allow
- SUBREGs.
- (GO_IF_LEGITIMATE_INDEX): Delete unused REGNO argument.
- (GO_IF_LEGITIMATE_ADDRESS): Use BASE_REGISTER_RTX_P instead of
- REG_OK_FOR_PRE_POST_P. Don't accept PRE_INC or POST_DEC addresses.
- (PREDICATE_CODES, PROMOTE_MODE): Define.
-
-Wed May 3 09:57:55 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.md (non power abs insns): If not powerpc, use
- sf/subfc instructions, not subf.
-
-Wed May 3 08:49:06 1995 Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>
-
- * protoize.c (gen_aux_info_file): Use strerror #ifdef HAVE_STRERROR.
-
-Wed May 3 01:06:01 1995 Jeffrey A. Law <law@mole.gnu.ai.mit.edu>
-
- * pa.c (output_call): Fix typo/thinko in last change.
- (output_function_epilogue): Align the data section before
- emitting deferred plabels.
-
- From Torbjorn:
- * pa.c (before functions): Declare deferred_plabels and
- n_deferred_plabels.
- (output_call): When generating pic, don't use LP and RP. Use 32 bit
- plabel instead.
- (output_function_epilogue): Output plabels accumulated in output_call.
-
-Tue May 2 17:15:08 1995 Jeffrey A. Law <law@mole.gnu.ai.mit.edu>
-
- * pa.c (hppa_expand_epilogue): Fix thinko in last change.
-
-Tue May 2 16:54:35 1995 Doug Evans <dje@cygnus.com>
-
- * jump.c (jump_optimize, can_reach_end determination): A barrier can
- follow the return insn.
-
-Tue May 2 12:39:55 1995 Mike Stump <mrs@cygnus.com>
-
- * fold-const.c (fold): Ensure that we don't alter the expression's
- type when folding CLEANUP_POINT_EXPRs.
-
-Tue May 2 13:36:08 1995 Michael Meissner <meissner@cygnus.com>
-
- * expmed.c (emit_store_flag): When creating store flag
- instructions from simpler parts, such as XOR, ABS, etc. do not
- reuse pseudo registers if expensive optimizations, instead create new
- pseudos for each insn result.
-
-Tue May 2 01:25:29 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.c (hppa_expand_epilogue): Correctly handle restore of %rp
- for functions with a stack size of exactly 8kbytes and no frame
- pointer.
-
-Mon May 1 19:27:08 1995 Jim Wilson <wilson@cygnus.com>
-
- * sdbout.c (sdbout_one_type): Don't switch to text section if
- in function with section attribute.
-
- * combine.c (combine_instrutions): Set subst_prev_insn to zero.
- (try_combine, undo_all): Likewise.
- (get_last_value): Return zero if subst_prev_insn set.
-
- * sparc.h (INIT_TARGET_OPTABS): Move INIT_SUBTARGET_OPTABS to end.
-
- * Makefile.in (install-dir): chmod a+rx all newly created directories.
-
- * expr.c (expand_expr, case SAVE_EXPR): Handle the case where
- mode is VOIDmode.
-
-Fri Apr 28 15:39:38 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cpplib.h (cpp_buffer): Note new escape combination "@ ".
- * cpplib.c (macroexpand): Delete "@ " if stringifying.
- (cpp_skip_hspace): Also skip "@ " if input buffer has_escapes.
- (collect_expansion): Cleanup white-space handling.
- (create_definition): Remove all leading spaces, not just first one.
- (cpp_expand_to_buffer): Set has_escapes on resulting input buffer.
- (macroexpand): Set output_escapes during whole function (and
- specifically during calls of macarg).
- (macroexpand): Set "@ " before and after expansion result.
- (push_macro_expansion): Remove unneeded initial "@ ", not " ".
- (cpp_get_token): Remove unneeded "@ " (not " ") at end of expansion.
- (cpp_get_token): Handle "@ ".
-
- * cpplib.c (read_name_map): Add cpp_reader parameter. Access
- map_list from former (instead of having it be static).
- (open_include_file): Extra parameter (because of above changes).
- (do_include, lookup_import): Update calls of open_include_file.
-
- * cpplib.c (do_include): Fix memory leak.
-
- * cpplib.c (delete_assertion): Also delete tokenlist.
- (do_unassert): Don't delete tokenlist (handled by delete_assertion).
- (cpp_cleanup): New function. Frees resources used by a cpp_reader.
- * cpphash.c (cpp_hash_cleanup): New function.
- (delete_macro): Enable commented-out code.
- (file_cleanup): Free actual buffer.
-
- * cpplib.c (cpp_options): Add map_list.
-
- * cpplib.h (PARSE_GETC): Removed. Bogus and unused.
- * cppmain.c (main): Remove commented-out code that used PARSE_GETC.
-
- * cpplib.c: Don't #include <string.h>. Causes clashes
- on Nextstep (when index/rindex are macros).
- (cpp_grow_buffer, int_parse_file): Cast to U_CHAR*, rather than char*.
-
-Sun Apr 30 08:11:23 1995 Alan Modra (alan@spri.levels.unisa.edu.au)
-
- * stdarg.h, varargs.h (va_arg): Don't assume __va_rounded_size (char)
- has the value of 4.
-
-Sun Apr 30 07:13:43 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * vax.h (NOTICE_UPDATE_CC): Correctly handle aob insns.
-
- * expr.c (expand_expr, case CONSTRUCTOR): Don't set target to
- zero if more then one word.
- Pass size and alignment to move_by_pieces_ninsns in bytes, not bits.
-
- * cse.c (cse_insn): Properly set IN_MEMORY for SET_DEST.
-
- * tree.c (substitute_in_expr): Preserve TREE_READONLY.
-
- * c-common.c (enum attrs): Add A_UNUSED.
- (init_attributes): Initialize it.
- (decl_attributes, case A_UNUSED): New case.
-
-Sat Apr 29 15:42:03 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (do_include): Re-fix minor memory leak by using
- alloca instead of xmalloc and free.
-
- * cccp.c (macarg): Except for reporting error, treat unterminated
- macro call as if it were terminated, since `macroexpand' relies
- on *argptr being filled in.
-
-Sat Apr 29 06:09:35 1995 Torbjorn Granlund <tege@cygnus.com>
-
- * pa.c (output_mul_insn): Simplify, it is never called with
- UNSIGNEDP set.
-
- * pa.md (divsi3, udivsi3, modsi3, umodsi3): Simplify.
- (ashlsi3): Clean up indentation and commentary.
-
-Fri Apr 28 12:48:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * integrate.c (expand_inline_function): Don't emit any notes until
- after we've expanded the actual parameters.
-
-Fri Apr 28 11:51:06 1995 Stan Cox (gcc@dg-rtp.dg.com)
-
- * m88k/dgux.h: (ENDFILE_SPEC, LIB_SPEC) Fix crtbegin and crtend
- (SELECT_RTX_SECTION) Put relocatable pic constants in data section
-
- * m88k/dguxbcs.h: (LIB_SPEC) Likewise
-
- * m88k/m88k.c: (symbolic_operand) Put relocatable pic constants in data
-
- * m88k/m88k.h: (FRAME_POINTER_REQUIRED) Add -momit-leaf-frame-pointer
-
- * m88k/m88k.md: (umulsidi3) Doesn't work for 88110 with mod/div changes
-
- * m88k/x-dgux: (GCC_FOR_TARGET) tdesc gets mixed up for crtbegin/crtend
-
-Fri Apr 28 06:36:47 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c (pop_init_level, output_init_element): Pass
- require_constant_* to digest_init.
-
- * alpha.c (alpha_emit_set_const): Now returns rtx and take MODE arg.
- Rework to use a new pseudo for intermediate values if high opt level.
- Also use expand_{bin,un}op.
- * alpha.h (alpha_emit_set_const): Add declaration.
- * alpha.md (mov[sd]i and splits): Change call to alpha_emit_set_const.
-
- * reg-stack.c (stack_result): Fix bug in last change.
-
-Fri Apr 28 01:08:43 1995 Doug Evans <dje@cygnus.com>
-
- * objc-act.c: Update calls to start_decl, finish_struct,
- pass NULLs for attributes.
-
-Thu Apr 27 21:13:14 1995 Doug Evans <dje@cygnus.com>
-
- * sparc.md (tablejump): Only if ! TARGET_MEDANY.
- (casesi): New pattern for TARGET_MEDANY case.
-
- * c-common.c (decl_attributes): Always continue if attribute not found.
- * c-typeck.c (common_type): Call lookup_attribute instead of
- value_member.
- * tree.c (attribute_hash_list): New function.
- (build_type_attribute_variant): Call it.
- (valid_machine_attribute): Handle attributes with arguments.
- (is_attribute_p): New function.
- (lookup_attribute): New function.
- (attribute_in_list): Deleted.
- (attribute_list_contained): Check TREE_PURPOSE and TREE_VALUE.
- * tree.h (valid_machine_attribute): Add prototype.
- (is_attribute_p, lookup_attribute): Likewise.
- * i386/winnt.h (RETURN_POPS_ARGS): Call lookup_attribute.
- (ENCODE_SECTION_INFO): Likewise.
- (CPP_PREDEFINES): Use __stdcall__, __cdecl__.
- (VALID_MACHINE_DECL_ATTRIBUTE): Call is_attribute_p.
- `args' must be NULL.
-
-Thu Apr 27 21:10:41 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (insv): New anonymous patterns to combine insert with
- arbitrary ashift, ashiftrt, lshiftrt, or zero_extract. (Based on
- patch from John Brooks <jbrooks@ea.com>.)
- (ashlsi3): Remove extraneous operand processing.
-
-Thu Apr 27 18:47:24 1995 Jim Wilson <wilson@cygnus.com>
-
- * sh/ashlsi3.c, sh/ashrsi3.c, sh/lshrsi3.c: Delete.
- * sh/lib1funcs.asm (ashiftrt_r4_*): Rewrite for efficiency.
- (ashrsi3, lshrsi3, lshrsi3): Add.
- * t-sh (LIB1ASMFUNCS): Add new functions.
- (LIBGCC2_CFLAGS): Delete.
- (LIB2FUNCS_EXTRA): Remove deleted files.
- (ashlsi3.c, ashrsi3.c, lshrsi3.c): Remove rules for deleted files.
-
- * stmt.c (expand_return): When returning BLKmode structure, use
- operand_subword instead of doing arithmetic on the register number.
- Also, for structures smaller than word_mode, copy it into a word_mode
- temporary and then subreg it.
-
- * sparc.md: Delete two define_peepholes which print `bad peephole'.
-
-Thu Apr 27 16:17:01 1995 Torbjorn Granlund <tege@cygnus.com>
-
- * toplev.c (rest_of_compilation): Call shorten_branches even when
- !optimize.
- * final.c (shorten_branches): For non-optimizing compiles, break
- after first pass.
-
-Thu Apr 27 14:22:50 1995 Michael Meissner <meissner@cygnus.com>
-
- * i386/linux-oldld.h: New file, that is cloned from linux-aout.h,
- except that it does not pass -m i386linux to the linker. This is
- to support the original GNU/Linux ld that is on most distributions.
-
- * configure (i[345]86-*-linux*oldld*): Use i386/linux-oldld.h as
- the target file.
-
-Thu Apr 27 08:56:50 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (valid_machine_attribute): Update last change.
-
-Thu Apr 27 08:06:33 1995 Philippe De Muyter (phdm@info.ucl.ac.be)
-
- * fix-header.c, cpplib.c: Don't include <sys/stat.h> twice.
- * cpplib.c (cpp_grow_buffer, init_parse_file): Cast {xmalloc,xrealloc}
- for token_buffer to U_CHAR* instead of char*.
-
- * m68k/x-mot3300: New file.
- * configure (m68k-motorola-sysv*): Use x-mot3300 instead of x-alloca.
-
-Thu Apr 27 07:04:09 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (do_include): Fix minor memory leak.
-
- * cccp.c (struct argdata): Remove unused `comments' member.
- (macarg): Don't set `comments' member.
-
- * cccp.c (collect_expansion): Assume leading white space
- already removed.
- Don't allocate unnecessary space for expansion.
-
- * cccp.c (deps_output): Don't generate overly long output lines.
- Do not invoke self recursively with spacer == 0; this simplifies
- the code a bit.
-
-Wed Apr 26 19:20:02 1995 Andrew McCallum <mccallum@leopard.cs.rochester.edu>
-
- * objc/Object.h: Changed Class * to Class in order to match NEXTSTEP
- and OpenStep runtime.
- * objc/Object.m, objc/Object.h, objc/archive.c, objc/class.c: Likewise.
- * objc/encoding.c, objc/init.c, objc/objc-api.h, objc/objc.h: Likewise.
- * objc/objects.c, objc/runtime.h, objc/selector.c: Likewise.
- * objc/sendmsg.c, objc/typedstream.h: Likewise.
-
-Wed Apr 26 19:18:52 1995 Pieter Schoenmakers <tiggr@es.ele.tue.nl>
-
- * objc/objc-api.h (objc_static_instances): New struct to record
- static instances of a certain class.
- (objc_module): New tag STATICS to point to the table of
- objc_statics_instances.
-
- * objc/init.c (OBJC_VERSION): Version 7.
- (objc_init_statics): New function.
- (__objc_exec_class): Invoke objc_init_statics if needed.
-
- * objc/NXConstantString.m, objc/NXConstantString.h: New files.
- * objc/Makefile (OBJC_O): Added bare-bones implementation of
- NXConstantString.
-
- * objc-act.c (OBJC_VERSION): Version 7.
- (build_objc_string_object): Build a full declaration if not using
- the next runtime.
- (objc_add_static_instance): New function.
- (init_module_descriptor): Add reference to static instances table.
- (build_module_descriptor): Add field for static instances table.
- (get_objc_string_decl): New function.
- (generate_static_references): New function.
- (finish_objc): Call generate_static_references if needed.
-
- * c-tree.h (finish_decl_top_level): New declaration.
- * c-decl.c (finish_decl_top_level): New function.
-
-Wed Apr 26 18:04:32 1995 Dirk Steinberg (Dirk.Steinberg@gmd.de)
-
- * stddef.h: Treat _MACHINE_ANSI_H_ like _ANSI_H_.
-
-Wed Apr 26 14:09:59 1995 Jim Wilson <wilson@cygnus.com>
-
- * sparc.h (NEGTF2_LIBCALL): Define.
- (INIT_TARGET_OPTABS): Add support for all TFmode *_LIBCALL macros.
- * optabs.c (init_optabs): Delete all uses of undocumented TImode and
- TFmode *_LIBCALL macros.
-
- * combine.c (simplify_rtx, case TRUNCATE): Add. Use force_to_mode.
- (force_to_mode, case AND): Allow some simplifications when GET_MODE (x)
- has more bits than HOST_BITS_PER_WIDE_INT.
- * mips/mips.md (truncdiqi2+[456]): Add patterns to simplify ZERO_EXTEND
- of a TRUNCATE.
-
-Wed Apr 26 13:01:22 1995 Doug Evans <dje@cygnus.com>
-
- * sparc.md (memop define_splits): Rewrite to not use memop.
- Preserve MEM_IN_STRUCT_P, MEM_VOLATILE_P, RTX_UNCHANGING_P bits.
- * sparc.c (memop): Deleted.
- (splittable_symbolic_memory_operand): New function.
- (splittable_immediate_memory_operand): New function.
-
-Wed Apr 26 12:54:26 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * configure: Add hppa1.1-hp-lites support.
-
-Wed Apr 26 08:04:46 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sh.md (ashrsi2_31): Don't use dead_or_set_p after reload.
- * pyr.md: Remove bad peepholes that improperly use dead_or_set_p.
-
- * function.c (expand_function_end): Warn about unused parms
- if both -Wunused and -W.
-
- * tree.h (TYPE_PARSE_INFO): Delete unused field.
- (TYPE_PACKED): Add new macro.
- (struct tree_type): Delete unused field `parse_info'.
- Add new field `packed_flag'.
- * c-tree.h (finish_enum, finish_struct): Add ATTRIBUTES argument.
- * c-common.c (init_attributes): Don't require decl for A_PACKED.
- (decl_attributes, case A_PACKED): Set TYPE_PACKED for type.
- * c-parse.in: Update number of shift/reduce conflicts.
- (structsp): Pass attribute arg to finish_struct.
- Support attributes on enums and pass to finish_enum.
- * c-decl.c (finish_struct): Add ATTRIBUTES argument, call
- decl_attributes and set DECL_PACKED from TYPE_PACKED.
- (finish_enum): Add ATTRIBUTES argument, call decl_attributes,
- and make enum narrow if TYPE_PACKED.
- * print-tree.c (print_node): Print TYPE_PACKED.
-
- * c-decl.c (init_decl_processing): Don't give builtin__constant_p an
- argument type.
- * expr.c (expand_builtin, case BUILT_IN_CONSTANT_P): A pointer to a
- string constant is a constant.
-
- * c-typeck.c (output_init_element): Constructor is not simple if
- a bitfield is being assigned a non-integer.
-
- * c-typeck.c (push_init_level): Update constructor_depth when we
- push spelling level.
-
-Tue Apr 25 19:50:06 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.c (emit_move_sequence): Handle function label arithmetic for
- PIC code generation too.
-
-Tue Apr 25 18:52:43 1995 Stephen R. van den Berg (berg@pool.informatik.rwth-aachen.de)
-
- * reg-stack.c (current_function_returns_real): Deleted (unused).
- (FP_mode_reg): Trimmed to a smaller size, less overhead.
- (FP_MODE_REG): New macro over which FP_mode_reg will be accessed.
- (mark_regs_pat, straighten_stack): New functions.
- (reg_to_stack): Amend initialisation of FP_mode_reg.
- Mark FP registers mentioned in USE insns before NOTE_INSN_FUNCTION_BEG.
- (get_true_reg): Eliminate FP subreg accesses in favour of the
- actual FP register in use.
- (record_reg_life_pat): Make it work on SUBREGs as well. Make use of
- the new mark_regs_pat function. Handle USE insns if called unnested.
- (record_reg_life): Don't check for QImode again, we know that it
- is there. Process CALL_INSNs like all other insns, they might `use'
- some FP argument registers if register passing.
- (stack_result_p): Changed in stack_result and returning an rtx.
- (stack_reg_life_analysis): Take a new stackentry state argument.
- Use stack_result and the rtx to mark using mark_regs_pat. This ensures
- that types that need multiple FP registers are handled correctly.
- Delete the no_live_regs shortcut to save space.
- Use stackentry state to determine filled registers.
- (replace_reg): Accept COMPLEX_FLOAT as well.
- (move_for_stack_reg): Optimise away some pointer dereferencing.
- (subst_stack_regs): Make sure the stack is in the right order
- and of the right size for register passing.
- (goto_block_pat): Make sure the stack is in the right order
- to return possible multi-register values from the function.
- (convert_regs): Fix comment about CALL_INSN, it's no longer valid.
- Make sure the stack is of the right size and in the right order
- to return possible multi-register values from the function.
-
- * function.c (assign_parms): If STACK_REGS is defined, generate USE
- insns before the function body, thus showing which registers are filled
- with parameters.
- * expr.c (expand_builtin_apply_args): Likewise.
- Reverse order of saving registers, more compact code for i387.
- (expand_builtin_apply): Likewise.
- * emit-rtl.c (gen_highpart): Add comment about broken implementation.
- * i386.md (untyped_call): Make it return a complex double.
-
- * c-parse.in (attrib): Permit null-length argument list to attributes.
-
- * tree.c (valid_machine_attribute): Use new function attribute_in_list,
- makes sure type_attribute_variants are reused even when attributes have
- parameters.
- Assign any new type to TREE_TYPE (decl).
- (attribute_in_list): New function.
- (attribute_list_contained): Use it.
- * tree.h (attribute_in_list): New declaration.
-
-Tue Apr 25 18:25:53 1995 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (struct move_by_pieces): Add to_struct and from_struct fields.
- (move_by_pieces): Set to_struct and from_struct fields.
- (move_by_pieces_1): Set MEM_IN_STRUCT_P of to1 and from1.
- (expand_builtin, case BUILT_IN_MEMCPY): New variable type.
- Set MEM_IN_STRUCT_P of src_mem and dest_mem.
-
- * Makefile.in (clean): Delete libgcc1-asm.a.
-
- * m68k/vxm68k.h (CPP_SPEC): Define.
-
- * c-decl.c (pushdecl): Don't test DECL_EXTERNAL when deciding whether
- to register a duplicate decl in the current block.
-
- * cross64.h (INIT_ENVIRONMENT): Define as string not putenv call.
- * gcc.c (main): Pass INIT_ENVIRONMENT to putenv.
-
- * stmt.c (expand_return): When returning BLKmode structure in
- registers, copy it to a psuedo-reg instead of to hard registers.
-
-Tue Apr 25 15:14:58 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (LEGITIMIZE_ADDRESS): Don't create a DF address using two
- regs if -msoft-float or -mcpu=403.
-
-Tue Apr 25 15:45:44 1995 Richard Henderson (richard@atheist.tamu.edu)
-
- * m68k.md (divhi3, udivhi3, modhi3, umodhi3): Deleted
- these insns plus some surrounding trash.
- (divmodhi4, udivmodhi4): Added these insns.
-
-Tue Apr 25 10:12:40 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (alpha_builtin_saveregs): Refine last change to work
- for both stdarg and varargs.
-
- * tree.c (chain_member_purpose): Make similar to chain_member_value.
-
- * Makefile.in, configure: Change "realclean" to "maintainer-clean".
-
- * protoize.c: Removed __NetBSD__ from conditional.
- Declare strerror if HAVE_STRERROR is defined; otherwise
- declare sys_errlist and sys_nerr.
- (my_strerror): New function.
- (errno): Don't define if already defined as a macro.
-
- * alpha.c (current_file_function_operand): Return false if profiling.
-
- * expr.c (convert_move): Don't access a hard reg in an invalid
- mode when doing a truncation.
-
- * alpha.c (add_operand): Test for exactly the constants allowed by
- the constraints.
- * alpha.h (CONST_OK_FOR_LETTER_P, case 'L'): Reject 0x80000000.
-
- * c-parse.in (initdcl, notype_initdcl): Pass attributes to
- start_decl; delete call to decl_attributes.
- * c-tree.h (start_decl): Two new tree parameters.
- * c-decl.c (start_decl): New args for attributes; call decl_attributes.
-
- * c-decl.c (duplicate_decls): Don't look at TYPE_ACTUAL_ARG_TYPES
- if it is not set.
-
- * xm-1750a.h: New file.
-
- * alpha.c (alpha_builtin_saveregs): Add to incoming args addr
- if less than 6 named args, not less than or equal to.
-
-Mon Apr 24 15:25:19 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * mips-tfile.c (fatal, error): Make first arg const to avoid warning.
-
- * stmt.c (expand_end_bindings): Write a BARRIER after call
- to abort in nonlocal handler.
-
- * stmt.c (expand_decl_init): Call preserve_temp_slots to keep
- around any temp whose address was taken.
-
-Fri Apr 21 16:26:15 1995 Torbjorn Granlund <tege@adder.cygnus.com>
-
- * pa.md (call_internal_reg): Fix typos in length calculation.
- (call_value_internal_reg): Likewise.
-
-Fri Apr 21 13:17:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * config/gnu.h (STANDARD_INCLUDE_DIR): New macro.
- * config/mips/gnu.h (STANDARD_INCLUDE_DIR): Macro moved there.
-
-Fri Apr 21 08:23:58 1995 Tom Quiggle (quiggle@lovelace.engr.sgi.com)
-
- * toplev.c (lang_options): Add -I for GNAT.
- * gcc.c (default_compilers): Pass -I to gnat1.
-
-Fri Apr 21 07:58:06 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (integer_all_onesp): Test to size of mode, not TYPE_PRECISION.
-
- * toplev.c (main): Turn on -fforce-mem for -O2.
-
- * fold-const.c ([lr]rotate_double): Replace; old versions were bogus.
- (fold, shift and rotate): Don't call tree_int_cst_sgn on non-integer.
- (fold, case LROTATE_EXPR): If constant count, convert to RROTATE_EXPR.
- (fold, case RROTATE_EXPR): Sometimes commute logical op with rotate.
- Delete pair of counteracting shifts.
-
- * combine.c (simplify_logical, case AND): If still an AND, get
- new values for op0 and op1.
-
-Thu Apr 20 17:52:10 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.c: Completely rewritten.
- * sh.h (FAST_BIT, CONSTLEN_2_BIT, CONSTLEN_3_BIT, CONSTLEN_0_BIT,
- TARGET_FASTCODE, TARGET_CLEN3, TARGET_CLEN0, TARGET_OPTIONS): Delete.
- (TARGET_SWITCHES): Delete -mclen3 and -mclen0 options.
- (TARGET_DEFAULT): Is zero.
- (OVERRIDE_OPTIONS): Delete code to set max_count_si and max_count_hi.
- (SPECIAL_REG): New macro.
- (HARD_REGNO_MODE_OK): Allow any mode in any general register.
- (GO_IF_LEGITIMATE_ADDRESS): Delete constant + reg address case.
- (MOVE_RATIO): Define to 2 when TARGET_SMALLCODE.
- (max_si, max_hi, max_count_si, max_count_hi): Delete.
- * sh.md: Delete spurious constraints from all define_expands.
- (rotlsi3_1): Set T reg instead of clobbering it.
- (ashrsi3): Use expand_ashiftrt instead of gen_shifty_op.
- (movsi_i, movhi_i, movsf_i): Add conditions to reject patterns
- needing a reload.
- (movdi-2, movdf_k): Correct conditions to reject patterns needing
- a reload.
- ([inverse_]branch_{true,false}): Pass operands to output_branch.
- (jump): Delete unnecessary braces.
- (call, call_value): Don't use expand_acall. Force operand0 into
- a register.
-
-Thu Apr 20 12:57:16 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * function.c (assign_parms): Use TREE_ADDRESSABLE rather than
- TYPE_NEEDS_CONSTRUCTING to decide whether a parameter needs to be
- passed by invisible reference.
-
- * calls.c (expand_call): Ditto. Abort if we try to pre-evaluate a
- parameter of TREE_ADDRESSABLE type.
-
-Wed Apr 19 17:50:24 1995 Torbjorn Granlund <tege@cygnus.com>
-
- * pa.h (TARGET_SWITCHES): Fix typo.
-
-Tue Apr 18 18:06:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (store_constructor): Use BYTES_BIG_ENDIAN rather
- than BITS_BIG_ENDIAN to layout bits within bitstring.
- * tree.c (get_set_constructor_bytes): Likewise.
-
-Tue Apr 18 17:22:46 1995 Per Bothner (bothner@wombat.gnu.ai.mit.edu)
-
- * config/m68k/{x-hp320,x-hp320g} (FIXPROTO_DEFINES):
- Define _HPUX_SOURCE so putenv and other functions get seen.
-
-Tue Apr 18 03:57:35 1995 Michael Meissner (meissner@cygnus.com)
-
- * varasm.c (weak_decls): Make this a unique structure, instead of
- a tree structure.
- (handle_pragma_weak): Don't redeclare asm_out_file. Use new weak
- structure to copy name and value to. Protect name and value by
- copying them to the permanent obstack.
- (declare_weak): Call handle_pragma_weak, instead of duplicating
- the code.
- (finish_weak): Rewrite to use new weak symbols list structure.
-
- * c-pragma.h: New file to define the c-pragma.c interfaces.
- * c-pragma.c: Include it.
- * varasm.c: Include it.
- * c-lex.c: Include it.
- * cp/lex.c: Include it.
-
- * varasm.c (handle_pragma_weak): No longer pass output file
- stream, since weak pragmas are delayed until the end of the
- compilation.
- * c-pragma.c (handle_pragma_token): Call handle_pragma_weak
- without file stream argument.
-
- * Makefile.in (varasm.o, c-lex.o, c-pragma.o): Add dependencies on
- c-pragma.h.
-
- * config/rs6000.md (movdf): If -msoft-float, do not generate
- memory to memory references, like is already done for the
- -mhard-float case. Remove an extra test for -mhard-float inside
- of -mhard-float code.
-
-Tue Apr 18 06:19:50 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (size_int): Arg is unsigned HOST_WIDE_INT.
- * tree.h (size_int): Likewise.
-
-Mon Apr 17 23:36:57 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * rs6000/aix41.h: Restore March 11th changes, plus
- (ASM_OUTPUT_EXTERNAL): Do add [DS] or [RW], just don't emit
- anything.
- * rs6000/aix3newas.h (ASM_OUTPUT_EXTERNAL): Ditto.
-
-Mon Apr 17 15:58:52 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * config/mips/x-iris (FIXPROTO_DEFINES): Add -D_LANGUAGE_C_PLUS_PLUS.
- * config/mips/x-iris6: Likewise.
-
- * cpplib.c: Rename make_definition to cpp_define.
- * cpplib.h (cpp_define): New declaration.
-
- * cpplib.c (special_symbol): For T_SPECLINE, calculate __LINE__
- in enclosing file buffer, not current buffer (if macro expanding).
- (cpp_get_token): Fix thinko (in code for chopping unneeded space).
-
-Mon Apr 17 11:36:07 1995 Jim Wilson <wilson@cygnus.com>
-
- * abi64.h (CPP_SPECS): Define and use _ABI64 instead of
- _MIPS_SIM_ABI64.
- (SETUP_INCOMING_VARARGS): Set MEM_IN_STRUCT_P if big endian target.
- * iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Define.
-
- * combine.c (get_last_value): Ignore BARRIER when scanning backwards.
- (move_deaths): New variables before_dead and after_dead. Set them
- to instructions that have valid INSN_CUID values and use in test.
-
- * combine.c (subst_prev_insn): New variable.
- (try_combine): Set it.
- (get_last_value): Use it.
-
- * reload.c (find_reloads): Recompute reg_equiv_address from
- reg_equiv_memory_loc before using it.
- (find_reloads_toplev, make_memloc): Likewise.
-
- * expr.c (expand_builtin, case BUILT_IN_MEMCPY): Call force_operand
- on dest_rtx before returning it.
-
- * function.c (instantiate_decls): Use temporary allocation if
- DECL_DEFER_OUTPUT is set.
-
-Sat Apr 15 23:19:03 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * aoutos.h (ASM_OUTPUT_DEF): Define instead of SET_ASM_OP.
- * sparc/sunos4.h (ASM_OUTPUT_DEF): Ditto.
-
- * varasm.c (weak_finish): Don't handle aliases.
- (declare_weak): Ditto.
- (assemble_alias): Handle aliases.
-
- * c-common.c (enum attrs): Add A_ALIAS.
- (init_attributes): Ditto.
- (decl_attributes): Ditto.
-
-Sat Apr 15 13:26:34 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * calls.c (expand_call): Call preserve_temp_slots on temps
- made for BLKmode args returned in registers.
-
- * pa.c (override_options): Fix typo.
-
-Sat Apr 15 12:11:46 1995 Brendan Kehoe <brendan@cygnus.com>
-
- * alpha/alpha.c (output_epilog): Initialize fp_offset to 0, and
- make sure it's non-zero before we try to use it to restore the
- frame pointer.
-
-Fri Apr 14 19:45:05 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * ginclude/va-{clipper,pa,pyr,sparc,spur}.h (va_arg): Reorganize
- to avoid BIND_EXPRs and COND_EXPRs of aggregate type.
-
-Fri Apr 14 19:31:14 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * config/svr4.h (ASM_OUTPUT_SECTION_NAME): Make the section
- read-only executable "ax" if DECL is a FUNCTION_DECL; read-only
- "a" (previously the case always) if DECL is TREE_READONLY;
- otherwise writable "aw".
-
-Fri Apr 14 18:49:11 1995 Linus Torvalds <Linus.Torvalds@cs.Helsinki.FI>
-
- * alpha.md (probe_stack): Probe with write, not read.
- (allocate_stack): Update and correct stack probe code.
- * alpha.c (output_prolog): Changed stack probe at function entry.
-
-Fri Apr 14 18:42:34 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * jump.c (delete_insn): When deleting after label, delete
- a BARRIER as well.
-
-Fri Apr 14 14:40:48 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * toplev.c (compile_file): Call weak_finish.
-
- * c-common.c (enum attrs): Add A_WEAK.
- (init_attributes): Ditto.
- (decl_attributes): Support __attribute__ ((weak)) by
- calling declare_weak.
-
- * sparc/sunos4.h (HANDLE_PRAGMA_WEAK, WEAK_ASM_OP, SET_ASM_OP):
- Define to support weak symbols with -fgnu-linker.
- * aoutos.h: Ditto.
-
- * varasm.c (handle_pragma_weak): Add declared weak symbols to
- weak_decls rather than emitting them immediately.
- (declare_weak): Add the indicated declaration to weak_decls.
- (weak_finish): Emit .weak directives for any weak symbols.
-
- * libgcc2.c: The C++ free-store management functions are weak.
-
-Fri Apr 14 13:00:29 1995 Michael Meissner (meissner@cygnus.com)
-
- * rs6000/rs6000.c (output_prolog): For eabi systems, emit main's
- call to __eabi before setting up the minimal TOC used with the
- -mrelocatable support.
-
- * rs6000/eabi.h (INVOKE__main): Don't define any more,
- output_prolog will emit the call.
-
-Fri Apr 14 09:09:03 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (call_operand): Any reg is valid for NT.
- (output_prologue): Never need GP for Windows/NT.
- Set SYMBOL_REF_FLAG in current function decl.
-
-Thu Apr 13 20:19:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * alpha/xm-alpha.h (HAVE_VPRINTF): Define.
- (HAVE_PUTENV): Define.
- (POSIX): Define.
-
-Thu Apr 13 19:57:44 1995 Doug Evans <dje@cygnus.com>
-
- * emit-rtl.c (gen_sequence): If the insn has a non-null
- CALL_INSN_FUNCTION_USAGE field, output it as a sequence so the
- latter isn't discarded.
-
- * c-parse.in: Update expected conflict count.
-
-Thu Apr 13 08:10:20 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure.bat: Arg 2 is which machine (i386 or alpha).
- * configure (alpha-*-winnt3*): New configuration.
- * alpha.c: Don't #include stamp.h for WINNT.
- (input_operand, case CONST): Allow ptr_mode and DImode.
- * alpha.h (WINDOWS_NT): Provide default definition.
- (ASM_OUTPUT_INT): Use output_addr_const.
- (ASM_OUTPUT_ADDR_DIFF_ELT): Use .long for NT.
- * alpha.md (calll, tablejump, movsi): New variants for NT.
- * alpha/winnt.h, alpha/xm-winnt.h, alpha/x-winnt: New files.
- * alpha/config-nt.bat, alpha/config-nt.sed: New files.
- * i386/config-nt.bat: Add Ada fragments to Makefile.
- * i386/config-nt.sed: Adjust for deletion of config.run in Makefile.in
- Change version to 2.6.3.
- Add some missing tabs.
- * winnt/winnt.h (TARGET_MEM_FUNCTIONS): Define.
- (LINK_SPEC): Delete "align:0x1000".
- * winnt/xm-winnt.h (OBJECT_SUFFIX): Define.
- * ginclude/stdarg.h, ginclude/varargs.h: Clean up code that
- defines *DEFINED* symbols.
-
- * configure (a29k-*-sym1*): Same as a29k-*-bsd*.
- * a29k.h (ASM_OUTPUT_SECTION_NAME): New macro.
-
-Wed Apr 12 14:36:03 1995 Jim Wilson <wilson@cygnus.com>
-
- * dbxout.c (dbxout_type_fields): Correct arguments to CHARS macro
- in flag_minimal_debug case.
- (dbxout_symbol_name): Use DECL_ASSEMBLER_NAME unconditionally.
- * sdbout.c (sdbout_record_type_name): Correct indentation.
- (sdbout_symbol): Use DECL_ASSEMBLER_NAME unconditionally.
- (sdbout_one_type): Likewise.
-
-Tue Apr 11 13:24:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * fix-header.c (main): Fix loop over required_functions_list.
- (fatal): Also print inc_filename.
-
- * cpplib.c (cpp_push_buffer): Added missing initializatuon of buf.
- (cpp_file_buffer): Compare against CPP_NULL_BUFFER, not NULL.
- (finclude): No longer call cpp_push_buffer - let callers do it.
- (do_include): Add call to cpp_push_buffer.
- (push_parse_file): Call cpp_push_buffer early, so initial
- defines can use file and line from a valid cpp_buffer.
- (nreverse_pending): New function.
- (push_parse_file): Use nreverse_pending.
- (push_parse_file): For -include files, just push them in reverse
- order - we don't need to scan them now.
- (cpp_error_from_errno, cpp_perror_with_name): Don't emit extra '\n'.
-
-Tue Apr 11 13:36:44 1995 Jim Wilson <wilson@cygnus.com>
-
- * configure (mips-dec-mach3): Add.
-
- * sh.c (shiftby_operand): Delete.
- * sh.h (TARGET_SWITCHES): -m3 and -m3l also set SH2_BIT.
- (OVERRIDE_OPTIONS): Don't add CPU_SH2 to CPU_SH3 when TARGET_SH3.
- * sh.md (ashlsi3): Use nonmemory_operand as a predicate instead of
- shiftby_operand. Don't use shiftby_operand in the output statement.
- (lshrsi3): Likewise.
-
- * c-decl.c (poplevel): Do output inline function if
- DECL_ABSTRACT_ORIGIN points to itself.
-
- * varasm.c (output_constant): Cast assemble_string argument to char *.
-
-Mon Apr 10 14:29:28 1995 Torbjorn Granlund <tege@adder.cygnus.com>
-
- * recog.c (constrain_operands, case 'E'): Make this work like
- constraint character `F' when REAL_ARITHMETIC is defined.
- * regclass.c (record_reg_classes, case 'E'): Likewise.
- * reload.c (find_reloads, case 'E'): Likewise.
-
-Mon Apr 10 14:30:31 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/aix3newas.h, rs6000/aix41.h: Eliminate March 11th changes
- to undefine ASM_OUTPUT_EXTERNAL{,_LIBCALL}, since this causes the
- compiler not to bootstrap.
-
-Mon Apr 10 07:17:39 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cppalloc.c: #include config.h.
- * cppexp.c: Add declarations of xmalloc and xrealloc.
- (cpp_parse_expr): Cast args to bcopy to char *.
- * cpphash.c: Add declaration of xmalloc.
- * cpplib.c (init_parse_options, cpp_reader): Cast args to bcopy,
- bcmp, and bzero to char *.
- (add_import, push_parse_file, init_parse_file): Likewise.
-
- * c-common.c (enum attrs): New attribute, A_NOCOMMON.
- (init_attribute): Initialize it.
- (decl_attributes): Implement it.
- * varasm.c (make_decl_rtl): Allow section attribute if -fno-common
- or variable is not to be placed in common for some other reason.
-
- * combine.c (simplify_set): Don't move a SUBREG to dest if it
- is changing the size of a hard reg in CLASS_CANNOT_CHANGE_SIZE.
-
- * reload.c (find_equiv_reg): If goal is a pseudo that got memory,
- a store into memory makes it invalid.
- * reload1.c (reload_as_needed): Call forget_old_reloads_1 on
- pattern before reg elimination.
-
-Mon Apr 10 00:26:14 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.c (pa_reorg): Bump label use count for each entry in an
- exploded ADDR_VEC.
-
-Sun Apr 9 09:22:51 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * i386.md (adddi3, subdi3): Need scratch reg whenever operand 0 in
- mem and operands 1 not '0'.
- (subdi3): Don't treat two non-equal MEMs as non-aliasing.
-
-Sat Apr 8 22:53:38 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.c (pa_reorg): Fix typo.
-
-Sat Apr 8 19:36:36 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.h (SELECT_SECTION): TREE_CODE_CLASS must be called
- with a tree code, not a tree value.
-
-Sat Apr 8 12:41:01 1995 Mike Stump <mrs@cygnus.com>
-
- * cpphash.c: Don't use const on compilers that don't support it.
-
-Sat Apr 8 16:32:22 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_increment): Handle case where INCREMENTED
- has a non-trivial conversion.
-
-Fri Apr 7 19:33:21 1995 Phil Nelson (phil@cs.wwu.edu)
-
- * ns32k.h (TRAMPOLINE_TEMPLATE, TRANSFER_FROM_TRAMPOLINE):
- Fix assembler syntax errors.
-
-Fri Apr 7 19:27:23 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * cccp.c (VMS_fstat, VMS_stat): New functions.
-
-Fri Apr 7 19:25:21 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (collect_expansion): If traditional, set stringify
- member to SHARP_TOKEN regardless of the value of
- stringify_sharp_token_type.
-
-Fri Apr 7 07:48:35 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cse.c (simplify_unary_operation): #ifdef POINTERS_EXTEND_UNSIGNED,
- handle sign- or zero-extending addresses.
-
- * optabs.c (init{,_integral,_floating,_complex}_libfuncs):
- Change SUFFIX to "char" to avoid confusion with prototype.
-
- * explow.c (convert_memory_address): No longer static.
- New arg, TO_MODE.
- Do something special for SYMBOL_REF, LABEL_REF, and CONST.
- (memory_address): Add extra arg to call to convert_memory_address.
- * rtl.h (convert_memory_address): Add extra arg.
- * expr.c (expand_expr, case ADDR_EXPR): Always call
- convert_memory_address when converting; add extra arg.
- * stmt.c (expand_computed_goto): Convert from ptr_mode to Pmode.
-
- * gcc.c (OBJECT_SUFFIX): Default now ".o", not "o".
- (all specs): Remove "." before %O; use %O in a few missing cases.
- * i386/os2.h (OBJECT_SUFFIX): Delete from here.
- * i386/xm-os2.h (OBJECT_SUFFIX): Move to here; now has period.
-
- * Makefile.in (STAGESTUFF): Use $(exeext) for executables.
-
-Fri Apr 7 03:32:29 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
-
- * config.sub: Accept -lites* as op sys.
-
-Thu Apr 6 23:08:50 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cpplib.c (bcopy, bzero, bcmp): Remove #undefs.
- * cppalloc.c (xcalloc): Re-implement using calloc,
- rather than malloc+bzero.
- * cpplib.c (SELF_DIR_DUMMY): New macro.
- (do_include): Don't pass searchptr to finclude if it is dsp,
- since that is on the stack, and would cause a dangling pointer.
- If handling #include_next, recognize SELF_DIR_DUMMY.
-
-Fri Apr 7 00:54:24 1995 Jeffrey A. Law <law@snake.cs.utah.edu>
-
- * pa.h (MACHINE_DEPENDENT_REORG): Define.
- * pa.md (switch_jump): New pattern for jumps which implement
- a switch table.
- * pa.c (pa_reorg): New function to explode jump tables.
- (pa_adjust_insn_length): Account for jumps in switch tables with
- unfilled delay slots.
-
-Thu Apr 6 14:31:10 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * c-typeck.c (build_binary_op): Don't call common_type for
- uncommon pointer types.
-
-Wed Apr 5 13:53:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- Re-write fixproto/fix-header/etc to use cpplib:
- * fix-header.c: Comment out support for adding missing extern "C"
- using #ifdef ADD_MISSING_EXTERN_C instead of #if 0.
- * fixproto: Removed case of required functions. Instead use ...
- * fix-header.c (std_include_table): ... new required-functions table.
- (cpp_file_line_for_message, cpp_print_containing_files, cpp_message):
- New stub functions, to intercept cpplib error message.
- * fixproto: Don't call $CPP, since fix-header now incorporates cpplib.
- * gen-protos.c (fatal, hashf): New functions.
- (main): Use hashf, instead of hash.
- * scan-decls.c (scan_decls, skip_to_closing_brace): Re-write to
- take a cpp_reader* as argument, not a FILE*.
- * scan.h (hash): Make parameter const.
- * scan.c (hash): Removed.
- * scan.c (memory_full, xmalloc, xrealloc): Removed.
- Use functions from cppalloc.c instead.
- * Makefile.in (gen-prtos, fix-header, stmp-fixproto): Update.
-
-Wed Apr 5 13:24:14 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * cpplib.c (cpp_get_token): If traditional, return after comment,
- instead of reading more, so end-of-line can be peeked at.
- * cpperror.c (cpp_file_line_for_message, cpp_message): New
- functions, that do the actual printing of error messages.
- (cpp_print_file_and_line, cpp_error, cpp_warning, cpp_pedwarn,
- cpp_error_with_line, cpp_warning_with_line, cpp_pedwarn_with_line,
- cpp_pedwarn_with_file_and_line, cpp_error_from_errno, my_strerror,
- cpp_perror_with_name): Re-write to use cpp_file_line_for_message
- and cpp_message, and move to cpplib.c.
-
-Tue Apr 4 23:35:49 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * config/gnu.h (GNU_CPP_PREDEFINES): Remove -D__HURD__.
-
-Tue Apr 4 17:15:54 1995 Jeffrey A. Law <law@mole.gnu.ai.mit.edu>
-
- * pa.h (DO_GLOBAL_DTORS_BODY): Fix pointer -> integer assignment
- problem.
-
- * reorg.c (fill_simple_delay_slots): Don't use a JUMP_INSN
- a the target of another JUMP_INSN to fill a delay slot.
-
-Mon Apr 3 19:03:48 1995 Torbjorn Granlund <tege@adder.cygnus.com>
-
- * cse.c (simplify_unary_operation): Sign-extend constants when
- they have the most significant bit set for the target.
-
- * m68k.md (umulsi3_highpart): Test for CONST_INT and CONST_DOUBLE,
- not CONSTANT_P.
- (smulsi3_highpart): Likewise.
- * m68k.c (const_uint32_operand): New function.
- (const_sint32_operand): New function.
- * m68k.md (const_umulsi3_highpart): Use const_uint32_operand instead
- of immediate_operand for op3. Delete mode.
- (const_smulsi3_highpart): Analogous change.
-
-Mon Apr 3 19:03:48 1995 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (simplify_binary_operation): Sign-extend constants when
- they have the most significant bit set for the target.
-
- * combine.c (force_to_mode, case PLUS): Sign extend masks that are
- negative in OP_MODE.
- (simplify_and_const_int): Sign-extend constants when they have the
- most significant bit set for the target.
- (merge_outer_ops): Likewise.
- (simplify_shift_const): Likewise.
-
-Mon Apr 3 18:23:48 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * toplev.c (lang_options): Add -f{no-,}repo.
-
-Mon Apr 3 18:13:15 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (nonzero_bits, case REG): Check POINTERS_EXTEND_UNSIGNED.
- (num_sign_bit_copies, case REG): Likewise.
- * explow.c (convert_memory_address): New function.
- (memory_address): Call if it needed.
- (promote_mode, case POINTER_TYPE): Use Pmode and pointer extension.
- (allocate_dynamic_stack_space): Convert size from ptr_mode.
- * expr.c (clear_storage, expand_assignment, store_{expr,constructor}):
- Use ptr_mode instead of Pmode in some places.
- (expand_expr, expand_builtin): Likewise.
- (push_block, store_expr): Convert size to Pmode.
- (expand_expr, case ADDR_EXPR): Convert from Pmode to ptr_mode.
-
-Mon Apr 3 18:00:52 1995 Jim Wilson <wilson@cygnus.com>
-
- * explow.c (allocate_dynamic_stack_space): Correct typo in last
- change.
-
- * sh.c (gen_shifty_op, case ASHIFTRT): Return 0 if shift count is not
- a constant.
-
-Mon Apr 3 12:17:10 1995 Michael Meissner (meissner@cygnus.com)
-
- * expmed.c (extract_bit_field): When converting a SUBREG into a
- REG, if the system is big endian, adjust the bit offset
- appropriately.
-
-Mon Apr 3 00:08:45 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * config/i386/linux.h: Include "config/linux.h" instead of
- "linux.h", to avoid recursion.
-
-Sun Apr 2 23:50:27 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * config/i386/gnuelf.h: Include i386/linux.h instead of
- i386/linuxelf.h.
-
-Sun Apr 2 17:35:10 1995 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (simplify_relational_operation): Don't simplify A-B for
- compare of A and B when the compare is unsigned.
-
-Sun Apr 2 08:23:38 1995 Paul Eggert <eggert@twinsun.com>
-
- * fixincludes (stdio.h): BSDI 2.0 changed the spelling of _VA_LIST_
- to _BSD_VA_LIST_.
-
-Sun Apr 2 07:57:28 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386/xm-bsd386.h: New file.
- * configure (i[345]86-*-bsd*): Add xm_file.
-
- * gcc.c (default_compilers): Pass -W and -w to gnat1.
-
- * winnt/winnt.h (STDC_VALUE): Add #undef.
- * i386/winnt.h (LIB_SPEC): Likewise.
-
-Sun Apr 2 07:55:25 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * i386/winnt.h (RETURN_POPS_ARGS, ENCODE_SECTION_INFO): Call
- chain_member_purpose, not chain_member_value.
- (ASM_FILE_START, LIB_SPEC): Move to here.
- * winnt/winnt.h (ASM_FILE_START, LIB_SPEC): Delete from here.
- * tree.c (chain_member_purpose): New function.
-
-Sat Apr 1 12:19:14 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * c-typeck.c (build_binary_op): New variable build_type controls
- type given to expression when created. Set to integer_type_node for
- comparison ops instead of result_type so result_type still holds type
- in which comparison is done. When checking for comparison between
- signed and unsigned, use result_type rather than (possibly shortened)
- type of op0. Don't warn about equality comparison of signed operand
- to unsigned constant that fits in signed type.
-
-Sat Apr 1 09:47:02 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * i386/winnt.h (CPP_PREDEFINES): Add definitions for __stdcall
- and __cdecl.
- * winnt/winnt.h (LIB_SPEC): Add OLDNAMES.LIB.
- * winnt/xm-winnt.h: Remove unneeded #define's for non-ANSI functions.
- * fixinc.winnt: Remove unneeded fixes relating to __stdcall.
-
- * objc/Makefile (SHELL): New definition.
-
-Sat Apr 1 08:25:26 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cse.c (cse_insn): When emitting a BARRIER, don't put it after
- a deleted insn.
-
- * reload.c (push_reload): Initialize secondary_{in,out}_icode.
-
- * gcc.c (print_multilib_info): Don't use LAST_PATH if not set.
-
-Sat Apr 1 08:15:59 1995 Pat Rankin (rankin@eql.caltech.edu)
-
- * vax.md (extv, extzv): Don't use immediate value for operand 1.
-
-Sat Apr 1 07:48:29 1995 Yury Shevchuk (sizif@botik.yaroslavl.su)
-
- * stmt.c (expand_asm_operands): Properly ignore invalid reg in clobber.
-
-Sat Apr 1 07:02:24 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c: General code cleanup.
- Add prototypes for static functions.
- Remove unnecessary casts to (char *); add casts to (U_CHAR *).
- Add parentheses suggested by `gcc -Wparentheses'.
- Rename local variables as suggested by `gcc -Wshadow'.
- <fcntl.h>, <stdlib.h>, <string.h>, <unistd.h>: New includes.
- <sys/time.h>, <sys/resource.h>: Include only if defined(RLIMIT_STACK).
- <time.h>: Include, unless <sys/time.h> already does.
- (HAVE_FCNTL_H, HAVE_STDLIB_H, HAVE_SYS_TIME_H): New symbols.
- (HAVE_UNISTD_H, STDC_HEADERS, TIME_WITH_SYS_TIME): Likewise.
- (__attribute__, PROTO, VA_START, PRINTF_ALIST, PRINTF_DCL): New macros.
- (PRINTF_PROTO{,_1,_2,_3}, DO_PROTO): Likewise.
- (bcopy, bzero, bcmp): If #defined by configuration file, use that.
- If STDC_HEADERS is defined, use standard C functions.
- If BSTRING is defined, or USG and VMS are not defined, use
- the C library. Otherwise, use my_bcopy, my_bzero, my_bcmp.
- (localtime): Remove no-longer-necessary explicit declaration.
- (getenv, index, rindex): Don't declare explicitly if the
- appropriate system header should declare it.
- (fdopen): Remove no-longer-used declaration.
- (vprintf): Define a subsitute macro if !defined(HAVE_VPRINTF).
- (main): Replace `fdopen (dup (fileno (stdout)), "w"))'
- with `stdout'.
- (get_lintcmd, rescan, create_definition): Use bcmp instead of strncmp
- when both operands are known to be free of null bytes.
- (check_macro_name, compare_defs, collect_expansion): Likewise.
- (do_assert, compare_token_lists, assertion_lookup, do_line): Likewise.
- (skip_if_group, lookup): Likewise.
- (rescan): Remove unused label `startagain'.
- Abort instead of printing nonsense if the stack is corrupted
- when there was an unterminated successful conditional.
- (pcfinclude): Include explicit double-cast through GENERICPTR
- to identify particularly egregious type puns.
- (create_definition, do_define, check_macro_name): Use %.*s
- printf format to avoid painful copying-and-casting.
- (do_once): Return void, not (unused) int.
- (do_ident, do_pragma, do_sccs): Accept extra arguments so that
- all directive-handler's types match.
- (do_sccs): Define only if SCCS_DIRECTIVE is defined.
- (skip_if_group, dump_single_macro): Add `default: break;' to
- keep -Wswitch happy.
- (error, warning, error_with_line, vwarning_with_line, pedwarn): Use
- stdarg/vararg/vfprintf instead of passing bogus char * args around.
- (pedwarn_with_line, pedwarn_with_file_and_line, fatal): Likewise.
- (verror, vwarning, verror_with_line, vwarning_with_line): New fcns.
- (dump_single_macro): Abort if ap points to garbage.
- (make_definition, make_undef, make_assertion): Parameter now char *.
- (xmalloc, xrealloc, xcalloc, savestring, index0): Make sizes size_t
- instead of unsigned; make pointer parameters GENERICPTR, not char *.
- (xcalloc): Use bzero to clear memory instead of using own loop.
-
-Fri Mar 31 08:33:07 1995 Ken Raeburn (raeburn@wombat.gnu.ai.mit.edu)
-
- * longlong.h (umul_ppmm mc68000): Use %# instead of #.
-
-Fri Mar 31 06:37:54 1995 Michael Meissner (meissner@cygnus.com)
-
- * stor-layout.c (layout_decl): Implment -fpack-struct.
- (layout_record): Ditto.
-
- * flags.h (flag_pack_struct): New flag variable.
-
- * toplev.c (flag_pack_struct): New flag variable.
- (f_options): Add -fpack-struct support.
-
- * Makefile.in (stor-layout.o): Add flags.h dependency.
-
-Fri Mar 31 08:40:16 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * configure (i[345]86-*-winnt3*): Add tmake_file.
- * i386/x-winnt (winnt.o): Deleted.
- * i386/t-winnt: New file.
-
-Fri Mar 31 07:26:37 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * m68k/netbsd.h, m68k/hp3bsd44.h: Remove #include of machine/ansi.h.
-
- * configure (a29k-*-bsd): Set tmake_file to t-libc-ok.
-
- * stmt.c (expand_asm_operands): Properly handle output that can't
- be directly written into.
-
- * c-parse.in (structsp): Correct error in last change.
- * c-common.c (init_attributes): A_FORMAT is only for decls.
-
-Thu Mar 30 18:27:34 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * libgcc2.c: Remove explicit 0-initializations of static variables.
-
-Thu Mar 30 18:22:39 1995 Fergus Henderson <fjh@cs.mu.oz.au>
-
- * c-typeck.c (internal_build_compound_expr): Warn if LHS of comma
- expression has no side effects, or computes value which is not used.
- * stmt.c (make warn_if_unused_value): No longer static.
- * tree.h (warn_if_unused_value): Add declaration.
-
-Thu Mar 30 18:15:11 1995 Jim Wilson <wilson@cygnus.com>
-
- * combine.c (get_last_value): Revert back to use prev_nonnote_insn
- instead of prev_real_insn. Modify test that ignores USE insns.
-
- * rs6000.h (SELECT_SECTION): Apply constant DECL_INITIAL test
- only to DECLs.
-
- * explow.c (allocate_dynamic_stack_space): Test STACK_BOUNDARY against
- BIGGEST_ALIGNMENT at run time instead of at compile time.
- Give MUST_ALIGN macro a value, and test this value in if statements.
-
-Thu Mar 30 08:59:56 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-parse.in: Now have 27 shift/reduce conflicts.
- (attribute_list): Just make chain of all attributes.
- (attrib): Consistently put name as PURPOSE, args, if any, as VALUE.
- (structsp): Allow attributes on any struct or union.
- * c-common.c (enum attrs): New enum class.
- (attrtab, attrtab_idx): New variables.
- (add_attribute, init_attributes): New functions.
- (decl_attributes): Major rewrite.
- * tree.c (valid_machine_attribute): Now receive name and args.
-
-Thu Mar 30 07:20:14 1995 Paul Eggert <eggert@twinsun.com>
-
- * protoize.c: Use the phrase `preprocessing directive' consistently.
- * cccp.c (handle_directive, do_line, skip_if_group): Likewise.
- (output_line_directive): Renamed from output_line_command.
- (no_line_directives): Renamed from no_line_commands.
-
- * cccp.c (rescan): Don't recognize preprocessing directives
- within macro args. Warn if one is found.
-
-Thu Mar 30 06:20:36 1995 H.J. Lu (hjl@nynexst.com)
-
- * configure (i[345]86-*-linux*): Set xmake_file=x-linux,
- tm_file=i386/linux.h, and don't set extra_parts.
- (i[345]86-*-linux*aout*): New configuration.
- (i[345]86-*-linuxelf): Deleted.
- * config/linux{,-aout}.h, config/x-linux, config/xm-linux.h: New files.
- * config/i386/linux-aout.h: New file.
- * config/i386/linux.h: Extensive modifications to use ELF format
- as default.
- (LIB_SPEC): Don't use libc_p.a for -p. don't use libg.a
- unless for -ggdb.
- (LINUX_DEFAULT_ELF): Defined.
- * config/i386/linuxelf.h,config/i386/x-linux: Files deleted.
- * config/i386/xm-linux.h: Just include xm-i386.h and xm-linux.h.
-
-Wed Mar 29 19:09:36 1995 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__throw_type_match): Update to use new calling convention.
-
-Wed Mar 29 14:53:23 1995 Jim Wilson <wilson@cygnus.com>
-
- * gcc.c (process_command): Delete code modifying gcc_exec_prefix.
- (main): Put it here after last use of gcc_exec_prefix. For cross
- compiler, set startfile_prefixes if gcc_exec_prefix is set and
- standard_startfile_prefix is a relative path.
-
- * combine.c (make_compound_operation, AND case): Undo July 7, 1994
- change.
-
- * mips/mips.md (call_internal1, call_value_internal1): Move %* from
- start of assembler output to immediately before the jal.
-
- * mips/mips.c (function_prologue): Put SDB_DEBUGGING_INFO ifdef around
- code for SDB_DEBUG support.
- (mips_select_rtx_section, mips_select_section): Change rdata_section
- to READONLY_DATA_SECTION and sdata_section to SMALL_DATA_SECTION.
- * mips/mips.h (SMALL_DATA_SECTION): Define.
-
- * reorg.c (mark_referenced_resources): Make setjmp use all registers.
-
- * flow.c (mark_used_regs, case SUBREG): Only fall through to REG case
- if operand is a REG.
-
- * i960/i960.h (TARGET_SWITCHES): Make -mold-align set
- TARGET_FLAG_STRICT_ALIGN.
- (STRICT_ALIGNMENT): Test TARGET_STRICT_ALIGN.
-
- * sh/sh.c (andcosts): Modify costs to match the hardware, and add
- explanatory comments.
-
- * sparc/sol2.h (CPP_PREDEFINES): Add -D__SVR4.
-
-Wed Mar 29 14:30:30 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.md (movsf): When moving to/from integer registers,
- don't move floating point to memory if it is being simulated with
- -msoft-float.
-
-Wed Mar 29 06:47:36 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-parse.in (initdcl): Only call decl_attributes once.
- * c-common.c (decl_attributes): Clean up test for __mode__.
-
-Tue Mar 28 08:34:37 1995 John Hassey (hassey@dg-rtp.dg.com)
-
- * i386.md (adddi3): Don't treat two non-equal MEMs as non-aliasing.
-
-Tue Mar 28 08:20:49 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * a29k.h (CONSTANT_ADDRESS_P): Provide consistent definition.
-
-Tue Mar 28 07:26:41 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (do_xifdef, do_endif): Remove unnecessary pointer comparisons.
-
-Mon Mar 27 20:45:15 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * calls.c (expand_call, store_one_arg): Don't set KEEP in calls
- to assign_stack_temp.
- * function.c (preserve_temp_slots): Clear ADDR_TAKEN on item
- that we are preserving.
-
-Mon Mar 27 14:39:35 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * mips/mips.h (FIRST_PSEUDO_REGISTER): Increment.
- (FIXED_REGISTERS, CALL_USED_REGISTERS): Add new register.
- (MD_REG_LAST): Increment.
- (ST_REG_FIRST, ST_REG_LAST): Increment.
- (HILO_REGNUM): Define.
- (enum reg_class): Add HILO_REG.
- (REG_CLASS_NAMES): Add "HILO_REG".
- (REG_CLASS_CONTENTS): Add HILO_REG initializer, and adjust ST_REGS
- and ALL_REGS initializers.
- (SECONDARY_RELOAD_CLASS): Remove.
- (SECONDARY_INPUT_RELOAD_CLASS): Define.
- (SECONDARY_OUTPUT_RELOAD_CLASS): Define.
- (REGISTER_MOVE_COST): Treat HILO_REG as MD_REGS.
- (REGISTER_NAMES): Add initialization line.
- (DEBUG_REGISTER_NAMES): Add "accum".
- * mips/mips.md: For each instruction which sets HI or LO, clobber
- HILO_REGNUM with (clobber (match_scratch:MODE N "=a")). Change
- each explicit reference to register 66 to register 67.
- (mulsidi3): Change to define_expand.
- (mulsidi3_internal): New name of old mulsidi3.
- (mulsidi3_64bit): New insn.
- (umulsidi3): Change to define_expand.
- (umulsidi3_internal): New name of old umulsidi3.
- (umulsidi3_64bit): New insn.
- (madddi_64bit, umaddi_64bit): New insns.
- (movdi_internal2): Add case for setting HILO_REG to zero.
- (reload_indi, reload_outdi): New define_expands.
- (movsi_internal1, movsi_internal2): Add cases for setting MD_REGS
- to zero, and for setting a general reg to HILO_REG.
- (reload_outsi): New define_expand.
- * mips/mips.c (mips_reg_names): Add "accum".
- (mips_sw_reg_names): Likewise.
- (mips_regno_to_class): Map HILO_REGNUM to HILO_REG.
- (mips_move_1word): Handle moving HILO_REGNUM to a general
- register. Make sure that the normal MD_REG cases aren't used for
- HILO_REGNUM. Handle moving zero to a MD_REG.
- (mips_move_2words): Make sure that the normal MD_REG cases aren't
- used for HILO_REGNUM. Handle moving zero to a MD_REG.
- (override_options): Set mips_char_to_class for 'a' and 'b'.
- (mips_secondary_reload_class): Add in_p argument. Handle
- HILO_REGNUM.
-
-Mon Mar 27 07:16:05 1995 Warner Losh <imp@village.org>
-
- * gcc.c: Removed __NetBSD__ from conditional.
- Declare strerror if HAVE_STRERROR is defined; otherwise
- declare sys_errlist and sys_nerr.
- (my_strerror): New function.
-
-Fri Mar 24 18:08:14 1995 Jason Merrill <jason@python.cygnus.com>
-
- * i386/linux.h (LIB_SPEC): Don't try to link with libraries we
- know only exist in archive form unless -static.
-
-Fri Mar 24 16:12:16 1995 Doug Evans <dje@cygnus.com>
-
- * Makefile.in (multilib.h): Depend on Makefile, not config.status.
-
-Fri Mar 24 15:01:17 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.h (TARGET_MULTIPLE_SET): New target_flags bit that
- indicates -mmultiple or -mno-multiple was explicitly passed by the
- user, and not set as part of the cpu defaults.
- (TARGET_SWITCHES): Set TARGET_MULTIPLE_SET bit for both -mmultiple
- and -mno-multiple.
-
- * rs6000/rs6000.c (rs6000_override_options): If -mmultiple or
- -mno-multiple was explicitly used, don't override the setting with
- the processor default.
-
-Wed Mar 22 21:42:13 1995 Doug Evans <dje@cygnus.com>
-
- * i960/i960.c (i960_function_arg_advance): Ensure all regs marked
- as used if stack is also used (for va_start).
- (i960_setup_incoming_varargs): Rewrite to be similar to Intel's
- version, but don't allocate reg block unless necessary.
- * ginclude/va-i960.h (varargs va_start): Save g14 explicitly.
- Account for arguments preceding va_alist.
-
-Wed Mar 22 13:24:55 1995 Torbjorn Granlund <tege@adder.cygnus.com>
-
- * pa.c (singlemove_string): Handle SFmode constants again. Simplify.
- (zdepi_cint_p): Make some variables HOST_WIDE_INT.
- (lhs_lshift_cint_operand): Likewise.
- (output_and): Likewise.
- (output_ior): Likewise.
-
-Wed Mar 22 12:40:09 1995 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * sh.md (udivsi3): Don't clobber register 6.
- (udivsi3, divsi3, mulsi3_call): Use a pseudo-reg with regclass 'z'
- for output rather than hard register 0.
- (block_move_real): Don't clobber registers 4 and 5.
-
- * mips.c (mips_select_section): Apply constant DEC_INITIAL tests
- only to VAR_DECLs.
-
-Wed Mar 22 03:53:17 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
-
- * config.sub (rm400, rm600): New machine names.
- (sinix5.*, sinix): New os aliases.
- (mips-siemens): Default os to sysv4.
-
-Mon Mar 20 21:56:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- Merged Paul Eggert's patch to cccp.c of Wed Mar 8 18:21:51 1995:
- * cpplib.c (do_include): Fix type typo: pcfbuflimit is char *, not int.
-
- Merged Doug Evans' patch to cccp.c of Mon Feb 27 17:06:47 1995:
- * cpplib.c (do_include): Check for redundant file before opening in
- relative path case. Don't call fstat unnecessarily.
-
- Merged J.T. Conklin's patch to cccp.c of Wed Feb 22 20:29:31 1995:
- * cpperror.c: Removed __NetBSD__ from conditional.
-
- Merged Kenner's patch to cccp.c & cexp.y of Tue Sep 20 17:49:47 1994:
- * cppexp.c (struct operation): Make value by HOST_WIDE_INT.
- (cpp_parse_expr): Change return type to HOST_WIDE_INT.
- * cpplib (eval_if_expr): Likewise.
- (do_if, do_elif): Update appropriately.
- * cpplib.h (cpp_parse_expr): Removed, to avoid defining HOST_WIDE_INT.
-
- Merged Paul Eggert's patch to cccp.c of Mon Aug 8 19:42:09 1994:
- * cpplib.c (create_definition): Warn about `#define a@', since a
- diagnostic is now required (see ISO TC1's addition to subclause 6.8).
- Also warn about `#define is-empty(x) (!x)'.
-
-Tue Mar 21 00:10:50 1995 Jeffrey A. Law <law@mole.gnu.ai.mit.edu>
-
- * x-pa (CC): Add "-Dbsd4_4".
-
-Mon Mar 20 18:40:31 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * toplev.c (print_error_function): New function hook.
- (default_print_error_function): New function. Default value
- of print_error_function. Code moved here from report_error_function.
- (report_error_function): Use print_error_function hook.
-
-Mon Mar 20 20:27:43 1995 Doug Evans <dje@cygnus.com>
-
- * cccp.c (do_xifdef): Handle c++ comments.
- (do_endif): Likewise.
-
-Mon Mar 20 15:31:45 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure (i386 configurations): Prepend i386/ to t-crt*.
-
-Mon Mar 20 07:58:04 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stmt.c (fixup_gotos): Add missing call from last change.
-
- * objc/misc.c: Put Alpha-specific decls before #include of runtime.h.
-
- * alpha.h (EXTRA_SECTIONS): Write zeros first time in .rdata.
-
-Sat Mar 18 16:37:24 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * flow.c (mark_used_regs, case SUBREG): Set reg_changes_size even
- for integer modes.
- (mark_used_regs): Set reg_changes_size for RHS, if necessary.
- * combine.c (gen_lowpart_for_combine): Set reg_changes_size, if needed.
- * reload.c (push_reload): Reload a SUBREG if paradoxical and
- class is CLASS_CANNOT_CHANGE_SIZE.
- * reload1.c (gen_reload): Handle paradoxical SUBREGs.
- * alpha.h (SECONDARY_{INPUT,OUTPUT}_RELOAD_CLASS): Need GENERAL_REGS
- for paradoxical SUBREG and FLOAT_REGS.
- (SECONDARY_NEEDED_MODE): Use actual mode for 4 bytes or wider.
- * alpha.md (movsi): Allow FP regs and add case for store of FP reg.
- Remove cvtlq from MEM to FP reg case.
-
- * rtl.h (emit_insns_after): Add declaration.
- * stmt.c (fixup_gotos): Do a cleanup for a block when it is exited
- even if label if not defined yet.
-
- * function.c (pop_function_context): Fix error in last change;
- reference old value of current_function_decl before we modify it.
-
-Fri Mar 17 21:57:44 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * toplev.c (rest_of_compilation): Handle -Wreturn-type properly
- for inlines we aren't compiling yet.
-
-Fri Mar 17 21:26:48 1995 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__register_exceptions): Handle empty tables.
-
-Fri Mar 17 11:48:31 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * i386/winnt.c (winnt_function_prologue): Deleted.
- (gen_stdcall_suffix): New function.
-
-Thu Mar 16 17:36:52 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * svr4.h (LINK_SPEC): If the user did not specify -h name, use the
- output file name, if any.
- * sparc/sol2.h (LINK_SPEC): Ditto. Also, if the user did not
- specify -R path, add an -R for each -L.
-
- Move SunOS 4-specific assembler switches into the appropriate place.
- * m68k/sun[23].h (ASM_SPEC): Add %{R} %{j} %{J} %{h} %{d2}
- %{keep-local-as-symbols:-L}.
- * i386/sun.h (ASM_SPEC): Add %{R} %{keep-local-as-symbols:-L}.
- * sparc/sparc.h (ASM_SPEC): Ditto.
- * gcc.c (default_compilers): Remove %{R} %{j} %{J} %{h} %{d2}
- %{keep-local-as-symbols:-L} from assembler rules.
-
-Thu Mar 16 16:58:09 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/eabi-ctors.c: New file, handle C++ static constructors
- and destructors without requiring anything else from a libc.
-
- * rs6000/t-eabi (LIB2FUNCS_EXTRA): Build eabi-ctors.c.
-
- * rs6000/eabi.asm: Do not load up register 2 if there is no .got
- section. Jump to the __do_global_ctors function at the end of
- processing to call C++ static constructors, and it will return to
- __eabi's caller. Use normal volatile registers, instead of saving
- and restoring registers 30 and 31.
-
- * rs6000/eabi.h (STARTFILE_SPEC): Define as null.
- (LIB_SPEC): Ditto.
- (ENDFILE_SPEC): Ditto.
- (LIBGCC_SPEC): Always look for libgcc.a.
-
-Thu Mar 16 17:05:14 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stmt.c (warn_if_unused_value, case SAVE_EXPR): New case.
- (warn_if_unused_value, case NOP_EXPR): OK if CALL_EXPR inside.
-
- * c-common.c (decl_attributes): Allow alignment for TYPE_DECLs.
-
- * Makefile.in (xsys-protos.h): Fix typo in -U operand.
-
-Thu Mar 16 13:49:10 1995 Per Bothner <bothner@rtl.cygnus.com>
-
- * cpplib.c, cpplib.h: New files - a C PreProcessor library.
- * cpphash.c, cpphash.h, cppalloc.c, cpperror.c, cppexp.c:
- New files - utility features used by cpplib.
- * cppmain.c: New file - cpp replacement main program for cpplib.
- * Makefile.in: New rules to build cppmain.
-
-Thu Mar 16 16:11:05 1995 Douglas Rupp (drupp@cs.washington.edu)
-
- * i386/winnt.h (FUNCTION_PROLOGUE, HAVE_probe, gen_probe): Deleted.
- (ENCODE_SECTION_INFO, VALID_MACHINE_DECL_ATTRIBUTE): New macro.
-
-Thu Mar 16 15:58:24 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (apply_distributive_law, case SUBREG): Fix typo when
- checking for paradoxical SUBREG.
-
-Wed Mar 15 18:45:08 1995 Doug Evans <dje@cygnus.com>
-
- * libgcc1-test.c: Renamed from cross-test.c.
- * Makefile.in (LIBGCC1_TEST): Renamed from CROSS_TEST.
- (all.cross): Delete $(ENQUIRE) dependency.
- (libgcc1-test): Renamed from cross-test.
- Delete unnecessary gcc-cross and $(LIBGCC) dependencies.
- Link with -nostartfiles -nostdlib
- `$(GCC_FOR_TARGET) --print-libgcc-file-name`.
- (libgcc1-test.o): Renamed from cross-test.o.
- Change gcc-cross dependency to xgcc since the latter is used.
-
-Wed Mar 15 13:49:21 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * tree.c (save_tree_status): Now takes a tree 'context' instead of
- a boolean 'toplevel' as an argument. If 'context' is not
- current_function_decl, create a new obstack for the new function.
- Also save inline_obstacks.
- (restore_tree_status): No longer takes a second argument. Also
- restore inline_obstacks.
- (temporary_allocation): Clear inline_obstacks.
- (permanent_allocation): Free up the obstacks in inline_obstacks.
-
- * function.h (struct function): New fields contains_functions and
- inline_obstacks.
-
- * function.c (push_function_context_to): Now takes a tree
- 'context' instead of a boolean 'toplevel' as an argument.
- Also save current_function_contains_functions.
- (push_function_context): Pass current_function_decl to it.
- (pop_function_context_from): Takes 'context' instead of 'toplevel'.
- Set current_function_contains_functions properly.
- (pop_function_context): Pass current_function_decl to it.
-
-Wed Mar 15 14:53:09 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.md (abssi2): Turn into a define_expand. If
- TARGET_POWER, do old code that uses the abs instruction. If not,
- do abs in three instructions, using a temporary register, which
- enables generating more reasonable code for sne. Add a recognizer
- for negative of the absolute value. Add define_splits for the
- PowerPC.
- (sne insn): Add a recognizer for sne on the PowerPc to use two
- instructions, compared to the four generated using the absolute
- value insn.
-
-Tue Mar 14 18:38:40 1995 J.T. Conklin <jtc@cygnus.com>
-
- * m68k.md ({add,sub,mul,div}[sdx]f3): Add new patterns for recognizing
- SImode, HImode, and QImode operands.
-
-Mon Mar 13 18:59:36 EST 1995 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (CPP_SPEC): Add PPC403.
- (processor_type): Add PPC403.
- (RTX_COSTS): Add PPC403.
- * powerpc.h (CPP_SPEC): Add PPC403.
- * sysv4.h (CPP_SPEC): Add PPC403.
- * rs6000.c (processor_target_table): Add PPC403.
- * rs6000.md (define_attr cpu and function units): Add PPC403.
-
-Mon Mar 13 14:40:23 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/rs6000.md (call, call_value insns): Do not put a nop
- after a bl instruction on System V.4 and eABI.
-
- * rs6000/sysv.4 (SUBTARGET_SWITCHES): Add support for
- -mno-traceback to suppress the V.4 traceback word.
- (ASM_DECLARE_FUNCTION_NAME): Don't put out a traceback work if
- -mno-traceback.
-
-Mon Mar 13 13:36:37 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * t-svr4, i386/t-{crtpic,sol2}, m88k/t-svr4, sparc/t-sol2:
- Use -fPIC, rather than -fpic, for building crtstuff.
-
-Sat Mar 11 17:27:08 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * configure: Use aix3newas.h for AIX 3.2.4 and 5.
- * rs6000/aix41.h: Undefine ASM_OUTPUT_EXTERNAL{,_LIBCALL}.
- * rs6000/aix3newas.h: New file. Define ASM_SPEC to -u, and
- undefine ASM_OUTPUT_EXTERNAL{,_LIBCALL}.
-
-Sat Mar 11 06:42:50 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * dbxout.c (dbxout_symbol): Properly handle decl whose DECL_NAME
- points to a TYPE_DECL with a zero TYPE_NAME.
-
-Fri Mar 10 18:18:33 1995 Torbjorn Granlund <tege@cygnus.com>
-
- * pa.h (PROMOTE_MODE): Define.
-
-Fri Mar 10 14:37:58 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sdbout.c (sdbout_record_type_name): If TYPE_NAME is
- a TYPE_DECL, get name from DECL_NAME.
-
-Fri Mar 10 14:09:26 1995 Doug Evans <dje@cygnus.com>
-
- * arm/riscix.h (SUBTARGET_SWITCHES): Renamed from
- ARM_EXTRA_TARGET_SWITCHES.
- * arm/riscix1-1.h (SUBTARGET_SWITCHES): Likewise.
- * arm.h (SUBTARGET_SWITCHES): Likewise.
- (TARGET_HARD_FLOAT, TARGET_SOFT_FLOAT): Define.
- (TARGET_SWITCHES): Add -msoft-float, -mhard-float.
- (BYTES_BIG_ENDIAN): Delete #ifndef/#endif.
- (CONDITIONAL_REGISTER_USAGE): If -msoft-float, disable fp regs.
- (FUNCTION_VALUE): R16 is return reg only if !-msoft-float.
- (LIBCALL_VALUE): Likewise.
- * arm.md (all fp patterns): Conditionalize on TARGET_HARD_FLOAT.
- (*movsf_soft_insn, *movdf_soft_insn): New patterns.
-
-Fri Mar 10 13:53:46 1995 Jim Wilson <wilson@cygnus.com>
-
- * reorg.c (steal_delay_list_from_target): Exit at the top if the
- branch in SEQ is not a single set.
-
- * sh.md (movdi define_split, movdf define_split): Correct indentation
- and formatting. Make the condition fail if an operand is a MEM
- with an auto-inc address.
-
- * varasm.c (copy_constant): Copy operand of ADDR_EXPR if it is a
- constant.
-
- * mips/abi64.h (SETUP_INCOMING_VARARGS): Correct arguments to
- move_block_from_reg call.
-
- * expr.c (expand_assignment): When offset is zero, make new MEM
- before setting MEM_VOLATILE_P.
-
- * reload.c (find_reloads, case 'o'): Accept a fully reloaded
- auto-increment address.
-
- * combine.c (max_uid_cuid): New static variable.
- (INSN_CUID): Call abort if INSN is out of range.
- (combine_instructions): Set max_uid_cuid. Set uid_cuid directly
- instead of through INSN_CUID.
- (get_last_value): Use prev_real_insn instead of prev_nonnote_insn.
- Ignore USE insns generated by combine.
-
-Fri Mar 10 13:47:08 1995 Rod Barman <rodb@cs.ubc.ca>
-
- * m68k/fpgnulib.c (__fixdfsi): Catch values < 0.5 in magnitude.
-
-Fri Mar 10 12:02:33 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Fix `typedef struct term;' on hppa1.1-hp-hpux9.
-
-Fri Mar 10 05:50:11 1995 Oliver Kellogg (Oliver.Kellogg@RST13.DASA.DBMAIL.d400.de)
-
- * 1750a.c (sectname): Reverse Init and Normal.
- (print_operand_address, case PLUS): Add case for LABEL_REF.
- (print_operand_address, case LABEL_REF): Split fom SYMBOL_REF.
- (print_operand_address, case CODE_LABEL): New case.
- (ASM_FILE_END): Delete.
- * 1750a.h (FUNCTION_EPILOGUE): Restore stack before freeing local vars.
- (DEFAULT_SIGNED_CHAR): Now 1.
- (DATA_SECTION_ASM_OP): Use pseudo-op for read-only data (later copied).
- (JUMP_TABLES_IN_TEXT_SECTION): Define.
- (ASM_OUTPUT_ASCII): Split into multiple lines if long.
- (ASM_OUTPUT_{CHAR,SHORT,INT,LONG_INT}): Split up.
- (ASM_OUTPUT_COMMON): Call check_section.
-
-Thu Mar 9 12:46:53 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (movsf): Do not call truncdfsf2 for non PowerPC
- when expanding a store to memory and -msoft-float was used.
-
-Thu Mar 9 08:51:35 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-decl.c (start_function): Handle new parameter ATTRIBUTES.
- * c-tree.h (start_function): Add new parameter.
- * c-lang.c (finish_file): Pass new parm to start_function.
- * objc-act.c (build_module_descriptor, really_start_method): Likewise.
- * c-parse.in (fndef, nested_function): Pass prefix_attributes
- to start_function.
- (setspecs): Save prefix_attributes in declspec_stack.
- (decl rules): Restore prefix_attributes along with current_declspecs.
- (setattrs): Concatenate prefix_attributes to previous value.
- * c-common.c (decl_attributes): Handle prefix and suffix attributes
- the same way.
-
- * print-tree.c (print_node): Fix typo in printing large INTEGER_CST.
-
- * varasm.c (assemble_variable): Consistently use DECL_SIZE for
- everything.
-
- * c-typeck.c (convert_for_assignment): Fix typo in testing for
- pointer to function type.
-
- * varasm.c (record_constant_1): Handle NON_LVALUE_EXPR.
- Rewrite to use switch instead of if/then/elseif/else.
-
-Wed Mar 8 18:21:51 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (do_include): Fix type typo: pcfbuflimit is char *, not int.
-
-Wed Mar 8 17:30:29 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (force_fit_type): Always propagate OVERFLOW.
-
- * rtl.def (INLINE_HEADER): Add new "e" field.
- * rtl.h (FORCED_LABELS): New field; other fields adjusted.
- (gen_inline_header_rtx): New parm FORCED_LABELS.
- * emit-rtl.c (gen_inline_header): Add new parm FORCED_LABELS.
- * integrate.c (initialize_for_inline, output_inline_function):
- Handle FORCED_LABELS.
-
-Wed Mar 8 13:47:20 1995 Jason Merrill (jason@cygnus.com)
-
- * alpha.h (WORD_SWITCH_TAKES_ARG): Add -rpath.
- (LINK_SPEC): Pass through -taso and -rpath.
- * alpha/osf12.h (LINK_SPEC): Ditto.
-
-Wed Mar 8 09:59:56 1995 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/eabi.asm: Rewrite so that the initialized pointers go
- into the .got2 section, which allows eabi.asm to be assembled with
- the -mrelocatable option. Move the data picked up from the bl
- instruction to before the traceback tag.
-
- * rs6000/sysv4.h (CPP_SPEC): Define _RELOCATABLE if -mrelocatable
- switch is used.
-
- * libgcc2.c (__new_handler): Don't initialize the pointer variable
- with the address of __default_new_handler, which may not work in
- some shared library mechanisms.
- (__builtin_new): If __new_handler is NULL, call the function
- __default_new_handler.
-
-Tue Mar 7 17:34:59 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * i960.h (PROCESS_PRAGMA): Define.
- (ROUND_TYPE_ALIGN): Pass maximum of COMPUTED and SPECIFIED to
- i960_round_align.
- (ROUND_TYPE_SIZE): Delete.
- * i960.c (process_pragma): Uncomment, and rewrite for gcc 2.
- (i960_round_size): Delete.
- (i960_round_align): Don't adjust suggested alignment downward.
- Restrict alignment to value set by #pragma align.
-
-Tue Mar 7 12:14:46 1995 Doug Evans <dje@cygnus.com>
-
- * configure (sparc64-*-elf): Add crtbegin.o, crtend.o to extra_parts.
- * sparc/sp64-elf.h (TARGET_VERSION): Define.
- (CPP_PREDEFINES): Delete sun, sparc, unix. Delete OS assertions.
- (ASM_SPEC): Define.
- (LINK_SPEC): Delete solaris stuff, this is an embedded target.
- (STARTFILE_SPEC, ENDFILE_SPEC): Define.
-
-Mon Mar 6 17:54:01 1995 Doug Evans <dje@cygnus.com>
-
- * Makefile.in (install-common): Fix typo in installation of cpp.
- Likewise with gcc-cross.
-
-Mon Mar 6 02:29:05 1995 Jeffrey A. Law <law@mole.gnu.ai.mit.edu>
-
- * pa.md (movsicc): New expander.
-
-Fri Mar 3 13:34:20 1995 Michael Meissner (meissner@cygnus.com)
-
- * rs6000/sysv4.h (ASM_SPEC): If -mrelocatable was passed to
- compiler, pass it on to the assembler.
-
-Fri Mar 3 12:11:28 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Add fixes for VxWorks header files.
- * ginclude/stddef.h: If VxWorks typedef macros are defined, invoke
- them as appropriate.
-
-Fri Mar 3 05:48:54 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (dump_single_macro): Fix typo: % wasn't properly
- doubled in printf formats.
-
-Thu Mar 2 19:44:02 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * expr.c (expand_expr, CLEANUP_POINT_EXPR): Force the operand out
- of memory before running cleanups.
-
-Thu Mar 2 19:15:24 1995 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (rescan): Prevent accidental token-pasting to
- get !=, *=, /=, ==, or ^=.
-
-Thu Mar 2 15:37:13 1995 Jason Merrill <jason@phydeaux.cygnus.com>
-
- * c-typeck.c (build_binary_op): Avoid spurious warning
- comparing enumerator to unsigned variable.
-
-Thu Mar 2 18:18:38 1995 J.T. Conklin <jtc@netbsd.org>
-
- * m68k.md (sqrtsf2,sqrtdf2): Use fp precision specifiers.
-
-Thu Mar 2 18:09:01 1995 Stephen L Moshier (moshier@world.std.com)
-
- * c-lex.c (yylex, case !NOT_FLOAT): Remove previous change.
-
-Thu Mar 2 15:26:50 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * Makefile.in (bootstrap*): Pass new STAGE_PREFIX to recursive makes.
-
-Wed Mar 1 14:52:16 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * i960/i960-coff.h (ASM_FILE_START): Define.
- (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Define.
- (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Define.
- (CTORS_SECTION_FUNCTION, DTORS_SECTION_FUNCTION): Define.
- (INT_ASM_OP): Define.
- (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Define.
- * i960/vx960-coff.h (CPP_PREDEFINES): Define.
- (CPP_SPEC): Define.
- (CC1_SPEC): Default to -mca.
-
-Wed Mar 1 11:10:54 1995 Michael Meissner (meissner@cygnus.com)
-
- * rs6000/rs6000.c (output_prologue): Do not emit the word that
- gives the PC relative location to the local GOT table for the
- -mrelocatable option here.
- * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Emit it here.
-
- * t-eabi (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Build -msoft-float
- and -mrelocatable versions of the library.
-
- * rs6000/powerpc.h (CPP_PREDEFINES): Define the cpu and machine as
- powerpc, not rs6000.
-
- * libgcc2.c (_unwind_function): Clone for powerpc, using the
- PowerPC mnemonics.
-
- * rs6000/rs6000.md (uminsi3, umaxsi3): Silence warnings that
- -2147483648 is too large to fit in a signed integer on 32-bit
- hosts.
-
-Wed Mar 1 06:48:31 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * fold-const.c (decode_field_reference): Don't check TREE_CODE
- of EXP; let get_inner_reference decide if have reference.
- Allow no bit reference if have AND_MASK.
- (all_ones_mask_p): Use tree_int_cst_equal, not operand_equal_p.
- (unextend): New function.
- (fold_truthop): For constant cases, use new function, rework
- conversion, and warn if comparison can never be true.
-
- * expr.c (store_expr): Do conversion in two steps for promoted lhs.
-
-See ChangeLog.9 for earlier changes.
diff --git a/gcc/ChangeLog.11 b/gcc/ChangeLog.11
deleted file mode 100644
index 2bc3d590ac9..00000000000
--- a/gcc/ChangeLog.11
+++ /dev/null
@@ -1,14493 +0,0 @@
-Wed Dec 31 18:40:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stmt.c (expand_asm_operands): Treat ASM with no outputs as volatile.
-
-Wed Dec 31 08:03:45 1997 Paul Eggert <eggert@twinsun.com>
-
- * toplev.c (flag_verbose_asm): Default to 0, not 1.
-
- * i386/bsd386.h (ASM_COMMENT_START): Define to " #".
-
-Tue Dec 30 17:38:55 1997 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (find_splittable_givs): Handle givs with
- dest_reg created by loop.
-
-Tue Dec 30 14:21:33 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * svr4.h (LINK_SPEC): Never specify -h.
- * ptx4.h (LINK_SPEC): Likewise.
- * rs6000/sysv4.h (LINK_SPEC): Likewise.
- * sparc/sol2.h (LINK_SPEC): Likewise.
-
-Tue Dec 30 06:15:23 1997 Philippe De Muyter <phdm@macqel.be>
-
- * libgcc2.c (_eh_compat): Do not include stdlib.h, but provide a
- private extern declaration for malloc.
-
-Mon Dec 29 06:56:41 1997 Laurent Guerby <guerby@gnat.com>
-
- * Makefile.in (stmp-int-hdrs): Add "touch".
-
-Sun Dec 28 19:36:05 1997 Stephen L Moshier <moshier@mediaone.net>
-
- * mips.h (CACHE_FLUSH_FUNC): New, defaults to _flush_cache.
- (INITIALIZE_TRAMPOLINE): Use it.
- * mips/ultrix.h (CACHE_FLUSH_FUNC): Define as cacheflush.
- * mips/news4.h (CACHE_FLUSH_FUNC): Likewise.
-
-Sun Dec 28 08:19:13 1997 Paul Eggert <eggert@twinsun.com>
-
- * arm.c: Don't include assert.h.
- * i960.c: Likewise.
- (i960_arg_size_and_align): Rewrite to avoid assert.
- * m88k.c: Don't include assert.h.
- (expand_block_move): Rewrite to avoid assert.
- * except.c: Don't include assert.h.
- (scan_region): Rewrite to avoid assert.
- (save_eh_status, restore_eh_status, scan_region): Don't bother
- testing whether pointer is null.
- * dwarfout.c, dwarf2out.c: Do not include assert.h.
- (assert): New macro, since we can't use system assert.
-
-Sat Dec 27 19:08:17 1997 Stephen L Moshier <moshier@mediaone.net>
-
- * mips/ultrix.h (DWARF2_UNWIND_INFO): Define as 0.
-
-Fri Dec 26 05:57:06 1997 Philippe De Muyter <phdm@macqel.be>
-
- * m68k/mot3300.h (FINALIZE_TRAMPOLINE): Macro defined.
- * libgcc2.c (__clear_insn_cache): New sysV68-specific helper function
- for trampolines.
-
-Thu Dec 25 15:22:43 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * rs6000.c (function_arg_padding): All aggregates pad upward.
-
-Wed Dec 24 18:05:13 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * sparc.c: Add prototypes for static functions.
- (check_pic): Check for form of pic_pc_rtx, not it itself.
- (pic_setup_code): New function, from finalize_pic.
- (finalize_pic): Call pic_setup_code and insert after nonlocal_receiver.
- * sparc.md (nonlocal_goto_receiver): New pattern.
-
-Tue Dec 23 05:54:38 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_builtin_setjmp): Call builtin_setjmp_receiver.
- * mips.md (builtin_setjmp_receiver): New pattern.
-
- * crtstuff.c (__do_global_ctors_aux): Add missing call to
- FORCE_INIT_SECTION_ALIGN and go back to text section.
- * i386/sol2.h (FORCE_INIT_SECTION_ALIGN): Remove loop.
-
- * expr.c (do_store_flag): For shift, get bit count using tree_pow2.
-
-Tue Dec 23 05:21:18 1997 Paul Eggert <eggert@twinsun.com>
-
- * genattrtab.c (main): Check HAVE_{G,S}ETRLIMIT too.
-
-Mon Dec 22 19:30:59 1997 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * sdbout.c (plain_type_1): Add missing checks for named types "char"
- and "int" and check for int by size first.
-
-Mon Dec 22 19:13:58 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * m68k/xm-mot3300.h (ADD_MISSING_{POSIX,XOPEN}): Define.
- * m88k/xm-sysv3.h: Likewise.
-
- * configure.in (getrlimit, setrlimit): Call AC_CHECK_FUNCS.
- * cccp.c (main): Check HAVE_{G,S}ETRLIMIT in addition to RLIMIT_STACK.
- * toplev.c (main): Likewise.
-
- * fixincludes (target_canonical): New variable.
- (size_t): Add support for Motorola's stdlib.h which fails to provide
- a definition for size_t.
- (str{len,spn,cspn} return value): Handle different layout on sysV88.
- (fabs/hypot): Provide a fake for hypot which is broken on
- m88k-motorola-sysv3; emit a prototype for fabs on m88k-motorola-sysv3.
-
- * m68k/mot3300.h (ASM_BYTE_OP): Don't include '\t' in definition.
- (ASM_OUTPUT_ASCII): Prefix ASM_BYTE_OP by one single '\t'.
-
-Mon Dec 22 19:05:49 1997 Richard Henderson <rth@cygnus.com>
-
- * sparc.md (jump): Don't use the annul bit around an empty loop.
-
-Mon Dec 22 18:52:56 1997 Robert Lipe <robertl@dgii.com>
-
- * i386/x-sco5 (CLIB) Deleted.
- (ALLOCA) Added.
- * i386/xm-sco5.h (USE_C_ALLOCA) Added.
-
-Mon Dec 22 18:42:16 1997 Philippe De Muyter <phdm@macqel.be>
-
- * m68k/mot3300Mcrt0.S (mcount): Function removed.
- (__stop_monitor): New function.
- * m68k/mot3300-crt0.S (__stop_monitor): New (empty) function.
- (mcount, mcount%, monitor): Common symbols removed.
- * m68k/mot3300.h (FUNCTION_PROFILER): USE_GAS and !USE_GAS versions
- fixed and merged.
- (EXIT_BODY): Always call __stop_monitor without tricky tests.
-
-Mon Dec 22 18:35:05 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * objc/Make-lang.in (runtime-info.h, libobjc_entry.o): Create in
- build directory.
- (libobjc.a): Update dependency list.
- (libobjc.dll): Likewise. Use libobjc_entry.o from build directory.
- (objc/sendmsg.o): Add -Iobjc to find runtime-info.h.
- (objc.mostlyclean): Remove runtime-info.h.
-
-Mon Dec 22 18:27:47 1997 Paul Eggert <eggert@twinsun.com>
-
- * libgcc2.c (_eh_compat): New section.
- * Makefile.in (LIB2FUNCS): Add _eh_compat.
-
-Mon Dec 22 17:52:37 1997 Marcus G. Daniels <mgd@wijiji.santafe.edu>
-
- * objc/init.c (_objc_load_callback): Don't initialize.
-
-Sun Dec 21 15:06:00 1997 Paul Eggert <eggert@twinsun.com>
-
- * mips/xm-iris5.h (HAVE_INTTYPES_H): Force undefined.
-
-Sun Dec 21 14:51:51 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * dwarf2out.c (add_bound_info, case COMPONENT_REF): New case.
-
-Sun Dec 14 06:49:05 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_expr, case PLACEHOLDER_EXPR): Use placeholder_list
- expression in preference to any other if correct type.
-
- * i386.h (INITIAL_ELIMINATION_OFFSET): Correctly test for PIC
- register used.
-
-Sat Dec 13 06:11:32 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * frame.h (__register_frame_info_table): Fix typo in declaration.
-
-Fri Dec 12 07:55:18 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * function.c (purge_addressof_1): For (mem (address (mem ...)),
- when collapsing, preserve mode of outer MEM.
-
- * frame.c (__register_frame_info): Renamed from __register_frame.
- (__register_frame_info_table, __deregister_frame_info): Similarly.
- * frame.h (__{,de}register_frame_info): Likewise.
- (__register_frame_info_table): New declaration.
- * crtstuff.c (__do_global_dtors{,_aux}): Rename __deregister_frame.
- (frame_dummy, __do_global_ctors): Likewise for __register_frame.
- * collect2.c (write_c_file_{stat,glob}): Rename __register_frame
- to __register_frame_info and similarly for __deregister_frame and
- __register_frame_table.
-
- * sched.c (remove_dependencies): Set RTX_INTEGRATED_P on dependency
- we delete. Properly update prev for multiple consecutive deletions.
- (priority): Skip deleted dependence.
-
- * integrate.c (initialize_for_inline): In DECL_RTL of a PARM_DECL,
- look inside a (mem (addressof (mem ...))).
-
-Fri Dec 12 05:49:58 1997 Paul Eggert <eggert@twinsun.com>
-
- * collect2.c (write_c_file_glob):
- Allocate initial frame object in static storage and pass its address.
-
-Thu Dec 11 18:01:31 1997 Philippe De Muyter <phdm@macqel.be>
-
- * acconfig.h (NEED_DECLARATION_GETENV): Define slot added.
-
-Thu Dec 11 17:54:23 1997 Paul Eggert <eggert@twinsun.com>
-
- * crtstuff.c (__do_global_ctors): Fix typo in last change.
-
-Wed Dec 10 18:38:28 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * libgcc2.c (__bb_exit_func): Fix test of return value of fopen.
-
-Wed Dec 10 07:07:37 1997 Bernd Schmidt <crux@starsky.Informatik.RWTH-Aachen.DE>
- * combine.c (simplify_rtx, case ABS): Don't get confused by a
- VOIDmode operand.
-
-Tue Dec 9 17:44:14 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (FUNCTION_ARG_PADDING): Define.
- * rs6000.c (function_arg_padding): New function.
-
-Tue Dec 9 08:53:56 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * integrate.c (save_for_inline_copying): Make a new reg_parm_stack_loc.
-
-Mon Dec 8 19:23:58 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * toplev.c (get_run_time): [#if VMS] Cast arg in times call.
-
- * vax/xm-vms.h (HAVE_UNISTD_H): Define for DEC C.
- * make-cccp.com [CC]: Add /Prefix=All for DEC C.
-
-Mon Dec 8 08:09:17 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stmt.c (expand_decl_cleanup_no_eh): Properly return a value.
-
- * fold-const.c (fold_convert): Don't flag overflow when converting
- pointer to integer.
-
-Sun Dec 7 09:42:05 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * make-gcc.com (@make-l2): Pass along any command line arguments.
- * make-l2.com: Add latent support to compile cp/inc/* if `cc1plus'
- is specified [currently disabled].
- * make-cc1.com: When building with GNU C, use -O2.
- * make-cccp.com: Likewise.
-
-Sun Dec 7 06:56:48 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * crtstuff.c (__do_global_ctors): Add missing arg to __register_frame.
-
- * collect2.c (write_c_file_stat): Fix error in last change;
- use __SIZE_TYPE__, not size_t.
-
-Sun Dec 7 05:50:43 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (strings.h): Fix misspelling of `include' introduced
- in last change to this file.
-
-Sat Dec 6 18:54:11 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha/vms.h (CPP_PREDEFINES): Remove redundant setting
- of GCC version and unneeded setting of __VMS_VER.
-
-Fri Dec 5 07:24:36 1997 Richard Stallman <rms@gnu.org>
-
- * sparc/linux64.h (TARGET_VERSION): Write "GNU/Linux".
- * sparc/linux.h, sparc/linux-aout.h, rs6000/linux.h: Likewise.
- * m68k/linux.h, arm/linux.h, alpha/{linux,elf}.h: Likewise.
- * listing: Change linux to gnu-linux.
-
-Fri Dec 5 06:23:22 1997 Paul Eggert <eggert@twinsun.com>
-
- Alter C startup code so that it doesn't invoke malloc on Solaris.
- * frame.h (struct object): Decl moved here from frame.c.
- * frame.c (struct object): Move decl to frame.h.
- ("frame.h"): Include after <stddef.h>, so that size_t is defined.
- (__register_frame, __register_frame_table, __deregister_frame):
- It's now the caller's responsibility to allocate storage for object.
- * crtstuff.c (frame_dummy), collect2.c (write_c_file_stat):
- Allocate initial frame object in static storage and pass its address.
- * crtstuff.c (<stddef.h>, "frame.h"): Include.
- * Makefile.in ($(T)crtbegin.o, $(T)crtend.o, stamp-crtS):
- Depend on defaults.h and frame.h.
-
- * Makefile.in (RTL_H, TREE_H): Add gansidecl.h.
- (DEMANGLE_H): New macro. All dependencies on demangle.h
- changed to $(DEMANGLE_H).
- (RECOG_H): Likewise.
- (libgcc2.a, stmp-multilib): Add dependencies on frame.h, gansidecl.h.
- (collect.o): Add dependency on gansidecl.h.
- (gcc.o, choose-temp.o, pexecute.o, prefix.o): Likewise.
- (obstack.o, choose-temp.o, pexecute.o): Add dependency on $(CONFIG_H).
-
-Fri Dec 5 06:20:06 1997 Dean Deaver <deaver@amt.tay1.dec.com>
-
- * arm.md (casesi_internal): Add USE of label.
-
-Fri Dec 5 05:59:44 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (sys/times.h): Check for this instead of times.h.
- * cpplib.c, toplev.c: Properly test for and include sys/times.h.
-
-Thu Dec 4 12:30:40 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (final_prescan_insn): Use local label prefix when emitting
- .uses pseudo-ops.
-
-Thu Dec 4 07:00:48 1997 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (arm_finalize_pic): Use an offset of 4 when adjusting the
- GOT address.
-
-Thu Dec 4 06:58:32 1997 Dean Deaver <deaver@amt.tay1.dec.com>
-
- * genoutput.c (scan_operands): Treat format of "u" like "e".
-
-Thu Dec 4 06:28:33 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * msdos/top.sed, winnt/config-nt.sed: Change version to 2.8.0.
-
- * stmt.c (pushcase_range): Clean up handling of "infinite" values.
-
-Wed Dec 3 09:03:35 1997 Bernd Schmidt <crux@ohara.Informatik.RWTH-Aachen.DE>
-
- * i386.c (notice_update_cc): Remove bogus Pentium GCC code.
-
-Wed Dec 3 08:46:32 1997 Paul Eggert <eggert@twinsun.com>
-
- * arm.h (CPP_ARCH_DEFAULT_SPEC): Fix misspelling: `TARGET_CPU_DEFUALT'.
- (TARGET_SWITCHES): Fix misspelling: `no-apcs-rentrant'.
- * pa.c (override_options): Fix misspelling: `compatable'.
- * enquire.c (main): Fix misspelling in diagnostic: `mallocatable'.
- * gcov.c (function_summary): Fix misspelling in diagnostic: `funcion'.
- * objc/thr-decosf1.c (__objc_thread_id): Fix misspelling in code:
- `pthread_getuniqe_np'.
-
- * tahoe.c (extensible_operand): Renamed from extendable_operand.
- All callers changed.
- * dwarf2.h (enum dwarf_discrim_list): Renamed from dwarf_descrim_list.
- * dwarf2out.c: Fix misspellings in forward static function
- declarations: `add_AT_setion_offset', `add_sibling_atttributes'.
- * dwarfout.c: Fix misspellings in forward static function
- declarations: `langauge_attribute', `geneate_new_sfname_entry'.
- * stmt.c, tree.h (start_cleanup_deferral):
- Renamed from start_cleanup_deferal.
- (end_cleanup_deferral): Renamed from end_cleanup_deferal.
- * toplev.c (rest_of_compilation): Rename local var from
- inlineable to inlinable.
-
-Wed Dec 3 06:17:03 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stmt.c (expand_decl_cleanup): Update thisblock after eh_region_start.
-
-Wed Dec 3 06:06:38 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (gen_type_die, case POINTER_TYPE): See TREE_ASM_WRITTEN
- before the recursive call.
-
-Wed Dec 3 05:57:29 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (AC_HEADER_{STDC,TIME}): Add calls.
- (AC_CHECK_HEADERS): Add fcntl.h times.h, sys/times.h,
- sys/resource.h, and sys/param.h.
- (getenv): Check if need declaration.
- * cccp.c: Remove obsolete ways of including headers and use autoconf
- symbols instead.
- Include gansidecl.h; remove things defined there.
- See if getenv needs to be declared.
- * cpplib.c: Likewise.
- * cexp.y: Use autoconf symbols to select what include files are needed.
- * genattrtab.c, toplev.c: Likewise.
-
-Tue Dec 2 21:44:25 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * reload1.c (reload): Make copy of MEM before setting
- req_equiv_mem if the address is a PLUS.
-
-Tue Dec 2 07:03:47 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax/xm-vms.h (STDC_HEADERS, HAVE_STDLIB, HAVE_STRING): Define.
- (mesg_implicit_function_declaration): New macro.
-
- * make-l2.com: Compile libgcc2.c with `-fexceptions' specified.
-
-Mon Dec 1 17:44:59 1997 Jeffrey A Law (law@cygnus.com)
-
- * dwarf2out.c (output_call_frame_info): Use ASM_OUTPUT_ASCII to
- output ASCII by default; only use ASM_OUTPUT_DWARF_STRING if
- flag_debug_asm is on.
- (output_die, output_pubnames, output_line_info): Likewise.
-
-Mon Dec 1 17:15:30 1997 Philip Blundell <pb@nexus.co.uk>
-
- * arm/linux.h (SUBTARGET_CPU_DEFAULT): Define instead
- of TARGET_CPU_DEFAULT.
-
-Mon Dec 1 16:51:23 1997 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
-
- * i386/mingw32.h (MATH_LIBRARY): Set to "-lcrtdll".
-
-Mon Dec 1 16:46:57 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-aux-info.c: Add prototypes for static functions.
- * c-lex.c, emit-rtl.c, rtl.c, xcoffout.c: Likewise.
-
- * i386.h (TARGET_SWITCHES): Add entries for "windows" and "dll".
-
-Mon Dec 1 16:42:20 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (fix_trunc{dfsi,sfsi,dfsi}2): Add '*' in operand 3.
-
-Sun Nov 30 20:25:59 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (get_inner_reference): For ARRAY_REF, if need
- WITH_RECORD_EXPR, make it with the ARRAY_REF as exp.
-
- * expr.c (store_constructor): Use TARGET, not EXP, for
- WITH_RECORD_EXPR when offset has a placeholder.
-
-Sun Nov 30 11:19:00 1997 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
-
- * objc/Make-lang.in (libobjc.dll): Rename -dll flag to -mdll.
-
-Sun Nov 30 08:42:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * stmt.c (expand_end_bindings): Cleanups and incoming gotos are
- not incompatible.
-
-Sun Nov 30 05:45:06 1997 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * jump.c (jump_optimize): Use find_insert_position in two more places.
-
-Sat Nov 29 13:47:40 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha/vms.h (HAVE_STRERROR, HAVE_{LIMITS,STDDEF,TIME}_H): Define.
-
-Sat Nov 29 08:29:47 1997 J.J.van der Heijden <J.J.vanderHeijden@student.utwente.nl>
-
- * configure.in: Add check for kill.
- * gcc.c: Define kill as raise if not HAVE_KILL.
-
-Sat Nov 29 06:18:08 1997 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * jump.c (find_insert_position): New function.
- (jump_optimize): Use it when making new copy of insn after test.
-
-Sat Nov 29 05:54:57 1997 Douglas Rupp <rupp@gnat.com>
-
- * alpha/vms.h (BIGGEST_ALIGNMENT, ENCODE_SECTION_INFO): No longer
- override.
-
-Sat Nov 29 05:43:37 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * getpwd.c (getpwd, [VMS]): Only add extra arg if VMS.
-
- * alpha/xm-vms.h (HAVE_VPRINTF, HAVE_PUTENV): Define.
-
- * cccp.c (index, rindex): Add conditional defs to strchr and strrchr.s
- * cpplib.c: Likewise.
- * gcov.c: Include gansidecl.h.
-
-Fri Nov 28 21:17:51 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * objc/objc-act.c: Include "output.h".
-
- * objc/Make-lang.in (objc-parse.o, objc-act.o): Also depend on
- $(srcdir)/output.h.
-
- * objc/Object.m (+conformsTo:): Surround assignment with parentheses.
-
- * objc/archive.c, objc/class.c, objc/encoding.c: Finish prototyping.
- * objc/init.c, objc/objc-act.c, objc/objc-api.h: Likewise.
- * objc/runtime.h, objc/sendmsg.c: Likewise.
-
-Fri Nov 28 19:15:53 1997 Mark Kettenis <kettenis@phys.uva.nl>
-
- * objc/thr-posix.c (__objc_mutex_allocate): Allocate
- mutex type instead of assuming it fits in a void * type.
- (__objc_mutex_deallocate): Free mutex type.
- (__objc_mutex_lock): Pass mutex type instead of pointer to it.
- (__objc_mutex_{try,un}lock): Likewise.
- (__objc_condition_allocate): Allocate condition type instead
- of assuming it fits in a void * type.
- (__objc_condition_deallocate): Free condition type.
- (__objc_condition_wait): Pass condition type instead of pointer to it.
- (__objc_condition_{broadcast,signal}): Likewise.
-
-Fri Nov 28 17:07:25 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (function_arg_partial_nregs): Undo 11/26 change.
-
-Fri Nov 28 12:34:03 1997 Scott Christley <scottc@net-community.com>
-
- * objc/Make-lang.in (runtime-info.h): Add comment in file.
-
- * objc/selector.c: Replace all occurences of sarray_get
- with sarray_get_safe.
- * objc/sendmsg.c: Likewise.
-
- * protoize.c (include_defaults): Add component element as in cccp.c.
- * nextstep.h (INCLUDE_DEFAULTS): Add component element.
- (ASM_COMMENT_START): Correct assembly comment string.
- * objc/Make-lang.in (objc/{NXConstStr,Object,Protocol,linking):
- Compile with GNU runtime.
-
-Fri Nov 28 12:27:50 1997 Ovidiu Predescu <ovidiu@net-community.com>
-
- Generate platform information required by ObjC runtime.
- * toplev.c (lang_options): New ObjC specific compiler flag.
- * objc/Make-lang.in: Add target to generate runtime-info.h file.
- * objc/objc-act.c (print_struct_values): New variable.
- (generate_struct_by_value_array): New function.
- (lang_init): Call generate_struct_by_value_array if requested.
- (lang_decode_option): Check for new compiler flag.s
- * objc/sendmsg.c (__objc_get_forward_imp): Check size of type
- for determining proper forwarding function.
-
-Fri Nov 28 05:58:30 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * regclass.c (record_address_regs): Use REG_OK_FOR_{INDEX,BASE},
- not the REGNO versions.
-
-Thu Nov 27 16:28:04 1997 Scott Snyder <snyder@d0sgif.fnal.gov>
-
- * dwarf2out.c (outout_call_frame_info): Ensure info has proper
- alignment.
-
- * libgcc2.c (__throw): Initialize HANDLER.
-
-Thu Nov 27 16:23:25 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * tree.h, rtl.h: See if need declarations for free.
- * tree.c, bc-optab.c: Get the declaration of free from stdlib.h.
-
-Thu Nov 27 07:21:54 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.h: Add outer_context_label_stack.
- * except.c: Likewise.
- (expand_start_all_catch): Push the outer_context for the try block
- onto outer_context_label_stack.
- (expand_end_all_catch): Use it and pop it.
-
- * except.c (expand_start_all_catch): One more do_pending_stack_adjust.
-
- * expr.c (preexpand_calls): Don't look past a TRY_CATCH_EXPR.
-
-Thu Nov 27 07:15:10 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (SMALL_DATA_REG): Register to use for small data relocs.
- (print_operand{,_address}): Use SMALL_DATA_REG for register involved in
- small data relocations.
-
- * rs6000/linux.h (LINK_SPEC): Pass -dynamic-linker /lib/ld.so.1 if
- -dynamic linker is not used.
-
- * rs6000.md (call insns): For local calls, use @local suffix under
- System V; don't use @plt under Solaris.
-
-Wed Nov 26 15:12:32 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (LIBGCC2_CFLAGS): Add -fexceptions.
-
- * toplev.c (flag_exceptions): Default value is 2.
- (compile_file): If flag_exceptions still has the value 2, then
- set it to 0.
-
-Wed Nov 26 14:58:42 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (output_function_profiler): Put label address in r0, and
- store LR in 4(sp) for System V/eabi.
-
- * rs6000.h (ASM_OUTPUT_REG_{PUSH,POP}): Keep stack aligned to 16
- byte boundary, and maintain stack backchain.
-
- (Originally from Geoffrey Keating)
- * rs6000.c (function_arg): Excess floating point arguments don't
- go into GPR registers after exhausting FP registers under the
- System V.4 ABI.
- (function_arg_partial_nregs): Likewise.
-
- * rs6000.md (call insns): If -fPIC or -mrelocatable, add @plt
- suffix to calls.
-
-Wed Nov 26 14:09:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarfout.c (output_type): If finalizing, write out nested types
- of types we've already written.
-
- * toplev.c (main): Complain about -gdwarfn.
-
-Wed Nov 26 12:37:56 1997 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
-
- * mingw32.h (PATH_SEPARATOR): Moved to xm-mingw32.h
- * xm-mingw32.h (PATH_SEPARATOR): Moved here from mingw32.h.
-
- * getpwd.c (getpwd): Use VMS implementation of _WIN32 unless cygwin32.
-
-Wed Nov 26 12:26:44 1997 John Hassey <hassey@dg-rtp.dg.com>
-
- * m88k/dgux.h (ASM_CPU_SPEC) : No whitespace allowed.
-
- * m88k.h (SUPPORTS_ONE_ONLY) : Must be svr4.
-
- * i386/dgux.h (ASM_OUTPUT_ALIGN): Deleted.
-
- * i386/dgux.c (output_file_start) : Changed ix86_isa_string
- to ix86_arch_string.
-
- * cplus-dem.c (fancy_abort): Added.
-
-Wed Nov 26 06:07:50 1997 Richard Earnshaw <rearnsha@arm.com>
-
- * arm/coff.h (TARGET_DEFAULT): Add ARM_FLAG_APCS_32 to defaults.
-
- * configure.in (arm*-*-*): Recognize --with-cpu for ARM processors.
-
-Wed Nov 26 05:05:36 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * libgcc2.c (inhibit_libc): Define #ifdef CROSS_COMPILE.
-
- * mips/xm-iris6.h (malloc, realloc, calloc): No longer declare.
- (USG): Define here.
- (xm-iris5.h): No longer include; just include xm-mips.h.
-
- * mips-tfile.c (parse_def): Properly recognize bitfield and
- count array dimensions.
-
- * protoize.c: Remove declarations of void, exit, and free.
-
- * i386/mingw32.h (LINK_SPEC, STARTFILE_SPEC): Change -dll to -mdll.
-
- * configure.in: Check for sys/file.h.
- * gcc.c (sys/file.h): Include if HAVE_SYS_FILE_H.
-
- * configure.in: Only give error on bad --with-cpu value for target.
-
-Sat Nov 22 19:21:55 1997 Philippe De Muyter <phdm@macqel.be>
-
- * dwarf2out.c (CIE_LENGTH_LABEL, FDE_LENGTH_LABEL): New macros.
- (ASM_OUTPUT_DWARF_VALUE4): New macro.
- (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Define if SET_ASM_OP is
- defined.
- (output_call_frame_info): Don't output forward label differences
- if ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL is defined.
- Substitute instead simple label and define this label later to be
- difference of desired labels after they have been defined.
- * m68k/mot3300.h (SET_ASM_OP): Define when not using gas.
-
- * gcc.c (process_command): Don't take address of function fatal when
- calling lang_specific_driver.
-
-Sat Nov 22 17:08:03 1997 J. Kean Johnston <jkj@sco.com>
-
- * i386/sco5.h (SELECT_RTX_SECTION): Redefine to work with -fpic.
- (LIBGCC_SPEC, LIB_SPEC): Link with correct libgcc.a.
- (HAVE_ATEXIT): Define.
-
-Sat Nov 22 12:20:22 1997 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.md (movsfcc{,_hard}_insn): Specify mode for all alternatives.
-
-Sat Nov 22 06:56:16 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * function.c (instantiate_decl): Only ignore ADDRESSOF if arg is REG.
-
- * configure.in: Check for functions before checking which need decls.
- (bcopy, bzero, bcmp, index, rindex): Add checks.
- (vax-*-sysv*): Fix typo in setting of xm_file.
- * aclocal.m4: Add conditional definitions of index and rindex.
- * gansidecl.h (bcopy, bzero, bcmp, index, rindex): If don't
- have one of these, define macro to use ANSI form.
- * pa/xm-pahpux.h (bcopy, bzero, bcmp, rindex, index): No longer define.
- * mips/xm-sysv.h, xm-m88k.h, m68k/xm-plexus.h: Likewise.
- * m68k/xm-mot3300.h, m68k/xm-m68kv.h, m68k/xm-hp320.h: Likewise.
- * winnt/xm-winnt.h, vax/xm-vms.h, m68k/xm-3b1.h: Likewise.
- * i386/xm-os2.h, i386/xm-mingw32.h, alpha/xm-vms.h: Likewise.
- * xm-svr4.h, xm-svr3.h: Likewise.
- * clipper/xm-clix.h: Likewise.
- (TARGET_MEM_FUNCTIONS): Define here.
- * xm-linux.h (bcmp, bcopy, bzero, index, rindex): No longer undefine.
- * xm-convex.h (bcopy, bzero): No longer define.
- * vax/xm-vaxv.h, sparc/xm-pbd.h, mips/xm-iris{3,4,5}.h: Likewise.
- * m68k/xm-crds.h, m68k/xm-altos3068.h, i386/xm-sun.h: Likewise.
- * i386/xm-osf.h, i386/xm-aix.h, xm-i370.h, ns32k/xm-genix.h: Likewise.
-
-Sat Nov 22 06:46:26 1997 Paul Eggert <eggert@twinsun.com>
-
- * c-typeck.c, collect2.c, cpplib.c, dwarfout.c, gcov.c, protoize.c:
- Don't include <strings.h> unless there's no <string.h>.
-
-Fri Nov 21 06:46:50 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (i[3456]86-*-freebsd{,elf}*): Delete i386/xm-freebsd.h.
- * xm-freebsd.h, i386/xm-freebsd.h: Deleted.
-
- * i386/xm-cygwin32.h (HAVE_RUSAGE, HAVE_FILE_H): Deleted.
- * i386/xm-mingw32.h, rs6000/xm-cygwin32.h: Likewise.
-
- * xm-std32.h: New file, so far unused.
-
-Fri Nov 21 05:50:54 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.c (legitimize_pic_address): Make sure pic register marked used.
-
- * dwarf2out.c (output_call_frame_info): Call app_enable and
- app_disable if flag_debug_asm, not if flag_verbose_asm.
-
-Thu Nov 20 16:37:36 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_builtin_apply): Fix typo in last change.
-
- * expr.c (expand_assignment): If assigning to readonly field,
- mark rtx as unchanging.
-
- * configure.in: Add checks for functions putenv, popen, and vprintf.
- (i[3456]86-*-netbsd*): No longer need i386/xm-netbsd.h.
- (i860-alliant-*): No longer need i860/xm-fx2800.h.
- (m68k-ncr-sysv*): Use xm-svr3.h instead of m68k/xm-tower.h.
- (m68k-sun-sunos*): No longer need m68k/xm-sun3.h.
- (m68k-*-netbsd*): No longer need m68k/xm-netbsd.h.
- (mips-dec-netbsd*): No longer need mips/xm-netbsd.h.
- (ns32k-pc532-netbsd*): No longer need ns32k/xm-netbsd.h.
- (sparc-*-netbsd*): No longer need sparc/xm-netbsd.h.
- (vax-*-netbsd*): No longer need config/xm-netbsd.h.
- * arm/xm-netbsd.h: No longer include xm-netbsd.h.
- * xm-linux.h (HAVE_VPRINTF, HAVE_POPEN, HAVE_PUTENV): Deleted.
- * xm-mips.h (HAVE_VPRINTF, HAVE_PUTENV): Deleted.
- * i386/xm-osf.h, xm-arm.h, xm-alpha.h: Likewise.
- * xm-sparc.h (HAVE_POPEN): Deleted.
- * xm-sh.h (HAVE_VPRINTF): Deleted.
- * mips/xm-iris4.h, mips/xm-iris5.h, xm-m88k.h: Likewise.
- * m68k/xm-crds.h, m68k/xm-atari.h, m68k/xm-amix.h: Likewise.
- * xm-svr3.h, xm-svr4.h, i386/xm-mingw32.h: Likewise.
- * i386/xm-os2.h (HAVE_PUTENV): Deleted.
- * i386/xm-dos.h, i386/xm-aix.h: Likewise.
- * arm/xm-netbsd.h (HAVE_VPRINTF, HAVE_STRERROR): No longer
- need undefine.
- * xm-netbsd.h, i386/xm-netbsd.h, m68k/xm-netbsd.h: Deleted.
- * mips/xm-netbsd.h, ns32k/xm-netbsd.h, sparc/xm-netbsd.h: Likewise.
- * i860/xm-fx2800.h, m68k/xm-sun3.h, m68k/xm-tower.h: Likewise.
-
-Thu Nov 20 16:04:24 1997 Richard Earnshaw <rearnsha@arm.com>
-
- * explow.c (plus_constant_wide, case MEM): If about to call
- force_const_mem, generate the rtl in a saveable obstack.
-
- * arm.md (movhi): Pass the full MEM to storeinthi, storehi and
- storehi_bigend.
- (storeinthi, storehi, storehi_bigend): Be more conservative about
- when not to force a PLUS or MINUS into a REG. Use change_address
- to create new MEMs.
-
-Wed Nov 19 15:16:04 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * c-common.c (print_char_table): Add a and A to float formats.
- (scan_char_table): Likewise.
- (check_format_info): Recognize `a' as allocate flag only if used
- in correct context.
-
-Wed Nov 19 12:56:54 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure.in: Fix check for <inttypes.h>.
-
-Tue Nov 18 19:27:01 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (attribute "type"): Add nil.
- (movsi_ie): y/y alternative is type nil.
- (movsf_ie): Replace ry/yr/X alternative by r/y/X , y/r/X and y/y/X.
- (movsf_ie+1): Delete.
-
-Tue Nov 18 18:38:41 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (warn_undef): Now static.
- (eval_if_expression): Don't warn about undefined preprocessor symbols
- in system headers.
- * cexp.y (parse_c_expression):
- Now takes new arg specifying whether to warn
- about undefined preprocessor symbols.
- (warn_undef): Now local and static; independent of warn_undef in cccp.c
- (yylex): `register' -> `register int', needed for C9X.
-
- The following changes are only if TEST_EXP_READER is defined:
- (expression_signedp): New var.
- (start): Set expression_signedp to signedness of expression.
- (print_unsigned_host_wide_int): New function.
- (main): Use it to print value of expression, instead of hoping that
- `long' is long enough. Print "u" after unsigned values.
-
-Tue Nov 18 18:33:30 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (save_restore_insns): If gp_offset or fp_offset are
- large_int, emit two insns instead of one splitable insn.
- * dwarf2out.c (dwarf2out_frame_debug): When set cfa_store_offset
- from cfa_temp_value, use cfa_offset. Add assert checking that
- cfa_reg is SP.
-
-Tue Nov 18 09:11:58 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * fold-const.c (div_and_round_double): Return overflow for
- divide-by-zero instead of aborting.
-
- * tree.c (substitute_in_expr, case TREE_LIST): Fix two typos.
-
-Tue Nov 18 05:03:52 1997 Jeffrey A Law <law@cygnus.com>
-
- * arm.c (output_move_double): Allocate 3 entries in otherops array.
-
-Tue Nov 18 02:41:01 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (quote_string_for_make): New function.
- (deps_output): Use it to fix bug with file name quoting in -M output.
-
-Mon Nov 17 13:28:33 1997 Philip Blundell <Philip.Blundell@pobox.com>
-
- * arm/lib1funcs.asm (__div0): Provide GNU/Linux implementation.
- * arm/t-linux (LIB1ASMFUNCS): Use it.
-
-Mon Nov 17 09:13:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * function.c (purge_addressof_1): Make copy when substituting argument
- of ADDRESSOF.
- (fixup_var_refs_1): Likewise.
-
- * m68k.c: Include tree.h.
-
-Mon Nov 17 09:01:05 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * getpwd.c (getpwd, [VMS]): Add extra arg of 0 to getcwd call.
-
- * alpha/vms.h ({OPTIMIZATION,OVERRIDE}_OPTIONS): Delete, for now.
- * alpha/xm-vms.h (DIR_SEPARATOR, PATH_SEPARATOR): Delete.
-
-Mon Nov 17 08:52:45 1997 Richard Earnshaw <rearnsha@arm.com>
-
- * function.c (fixup_stack_1): Also fix-up refs via ARG_POINTER_REGNUM.
-
- * configure.in (arm-*-netbsd*): Doesn't need collect2.
-
-Mon Nov 17 08:50:01 1997 Stephen L Moshier <moshier@world.std.com>
-
- * i386/isc.h (DWARF2_UNWIND_INFO): Define as 0.
-
-Mon Nov 17 08:42:28 1997 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * flow.c (propagate_block): Look for pre-inc/dec within PARALLEL.
-
-Mon Nov 17 03:14:46 1997 Paul Eggert <eggert@twinsun.com>
-
- * cpplib.c (file_size_and_mode): Remove.
- (finclude): Don't assume long and off_t are same size or that
- mode_t fits in int.
- * cccp.c: (main, finclude, check_precompiled): Don't assume size_t
- and off_t are same size.
- * gcov.c (read_files): Don't assume off_t and unsigned are same size.
-
-Sun Nov 16 18:56:40 1997 Scott Christley <scottc@net-community.com>
-
- * objc/objc-act.c (objc_demangle): New function.
- (objc_printable_name): New function.
- (init_objc): Change default function.
-
- * expr.c (expand_builtin_apply): Prefer nonlocal over block.
-
-Sun Nov 16 18:10:13 1997 Fila Kolodny <fila@ibi.com>
-
- * i370.c (i370_function_prolog): New function from i370.h.
- * i370.h (FUNCTION_PROLOG): Just call i370_function_prolog.
-
-Sun Nov 16 08:40:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * calls.c (expand_call, store_one_arg): Don't pass QImode arguments
- to emit_library_call.
- * expr.c (emit_push_insn, expand_assignment, store_expr): Likewise.
- (expand_expr, expand_builtin): Likewise.
- * function.c (put_var_into_stack, assign_parms): Likewise.
- * alpha.c (alpha_builtin_saveregs): Likewise.
- * clipper.c (clipper_builtin_saveregs): Likewise.
- * m88k.c (m88k_builtin_saveregs): Likewise.
- * pa.c (hppa_builtin_saveregs): Likewise.
- * sparc.c (sparc_builtin_saveregs): Likewise.
-
-Sun Nov 16 07:39:08 1997 Paul Eggert <eggert@twinsun.com>
-
- * real.h (REAL_VALUES_IDENTICAL): New macro.
- * expr.c (is_zeros_p): Don't consider -0.0 to be all zeros.
- * fold-const.c (operand_equal_p): Don't consider -0.0 identical to 0.0.
- * tree.c (simple_cst_equal): Likewise.
- * varasm.c (immed_real_const_1): Use new REAL_VALUES_IDENTICAL macro.
-
-Sun Nov 16 07:29:12 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * acconfig.h (NEED_DECLARATION_{,R}INDEX): New cases.
- * configure.in: See if need declarations for index and rindex.
- * c-typeck.c, collect2.c, cpplib.c, dwarfout.c, gcov.c, protoize.c:
- Include stdlib.h, string.h, and strings.h, if they exist.
- Only declare index and rindex if needed.
- * collect2.c: Only declare free if needed.
-
- * regclass.c (record_address_regs): Refine choice of index and base
- when have sum of two regs, one of which is a hard reg.
-
-Sun Nov 16 07:07:45 1997 Robert Lipe (robertl@dgii.com)
-
- * i386/sco5.h (ASM_OUTPUT_ALIGNED_BSS): Define as in sysv4 and linux
- (HAVE_ATEXIT): No longer define. This confused ELF destructors.
- (DBX_DEBUGGING_INFO): Define.
-
-Sat Nov 15 09:55:11 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * arm.h (GO_IF_LEGITIMATE_ADDRESS): Don't accept MINUS (until reload
- knows what to do with it).
-
-Thu Nov 13 11:07:41 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (num_insns_constant): Use REAL_VALUE_FROM_CONST_DOUBLE to
- pick apart floating point values, instead of using CONST_DOUBLE_LOW
- and CONST_DOUBLE_HIGH.
-
- * rs6000.md (define_splits for DF constants): Use the appropriate
- REAL_VALUE_* interface to pick apart DF floating point constants in
- a machine independent fashion.
-
-Thu Nov 13 07:30:53 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * arm/netbsd.h (LINK_SPEC): Redefine -- pass -X.
-
- * arm.md (movsicc_insn): Add extra reload alternatives for better
- register tying.
- (movsfcc_hard_insn, movsfcc_soft_insn, movdfcc_insn): Likewise.
-
-Mon Nov 10 19:32:14 1997 Doug Evans <dje@cygnus.com>
-
- * sparc.md (mov[sdt]f_const_insn): Fix condition to match what
- instruction can handle.
-
-Mon Nov 10 03:02:19 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * stmt.c (expand_decl_cleanup_no_eh): New fn.
-
- * except.c (expand_leftover_cleanups): do_pending_stack_adjust.
-
-Sun Nov 9 14:34:47 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (lshrdi3_power): Delete '&' from first alternative and
- swap instruction order.
-
-Sun Nov 9 09:51:08 1997 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * machmode.def (QCmode, HCmode): New modes.
-
-Sun Nov 9 09:24:21 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * combine.c (sets_function_arg_p): New function.
- (combinable_i3pat): Check if combining with any but the first
- argument register setting insn for a function call.
-
- * a29k.h (ELIGIBLE_FOR_EPILOGUE_DELAY): Avoid sheduling load from
- stack slot.
-
-Sun Nov 9 09:17:53 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * loop.c (strength_reduce): If initial value of BIV is equivalent to
- a constant, record that as initial value.
- (check_dbra_loop): Don't reverse loop if initial value isn't CONST_INT.
-
-Sun Nov 9 09:12:41 1997 Tristan Gingold <gingold@haendel.enst.fr>
-
- * expr.c (emit_push_insn): Avoid infinite recursion
- when -fcheck-memory-usage.
-
-Sun Nov 9 08:03:42 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * cse.c (simplify_binary_operation): Fix error in last change.
-
-Sun Nov 9 07:56:31 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * vmsconfig.com [version.opt]: Parse version string more robustly.
- [@variable@]: Discard configure tokens when using Makefile.in.
- [libgcc2-cxx.list]: Generate this new file for CXX_LIB2FUNCS.
- [cp/input.c]: Suppress it as workaround to avoid linker warning.
- [objc-parse.y]: Now lives in the objc subdirectory.
- * make-cc1.com [objc-parse.{c,y}]: Ditto.
- * make-cccp.com [prefix.c]: Compile additional source file.
-
- * cccp.c (VMS_freopen, VMS_fopen, VMS_open, VMS_fstat): Call
- corresponding library routine specified via its ordinary name
- rather than with a decc$ prefix. (Reverses Oct 19 change.)
-
- * cccp.c, cexp.y [HOST_WIDE_INT]: Manually splice long lines
- of avoid backslash+newline continuation on #if directives.
-
-Sun Nov 9 01:54:54 1997 Jeffrey A Law (law@cygnus.com)
-
- * local-alloc.c (block_alloc): Don't lose if two SCRATCH expressions
- are shared.
-
-Sat Nov 8 23:01:37 1997 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * cse.c (simplify_binary_operation): Don't simplify divide by zero
- for targets that don't support a representation of INFINITY.
-
-Sat Nov 8 22:37:29 1997 Richard Earnshaw <rearnsha@arm.com>
-
- * Makefile.in (cse.o): Depend on expr.h.
- * cse.c: Include expr.h.
- (fold_rtx, case MEM): For ADDRESSOF, create new MEM.
-
-Sat Nov 8 19:27:56 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * expr.c (expand_increment): When enqueing a postincrement for a MEM,
- use copy_to_reg if address is not a general_operand.
-
-Sat Nov 8 18:39:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (L_eh): Define __eh_pc here.
- Replace __eh_type with generic pointer __eh_info.
-
-Sat Nov 8 07:03:47 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.h (SECONDARY_OUTPUT_RELOAD_CLASS): If FLOAT_REGS,
- need secondary reload for QImode and HImode even if BWX.
-
- * expmed.c (store_split_bit_field): Force ADDRESSOF into register.
-
- * cse.c (fold_rtx, case ADDRESSOF): New case (that does nothing).
-
- * function.c (fixup_var_refs_1, case ADDRESSSOF): Check that
- new value is valid for insn.
-
- * stor-layout.c (get_best_mode): Refine test for field within
- unit to work properly for negative positions.
-
- * print-rtl.c (print_inline_rtx): Save and restore sawclose and indent.
-
- * reload.c (find_replacement): If PLUS, MINUS, or MULT, see if
- either arg contains a replacement.
-
-Fri Nov 7 10:22:24 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * frame.c (add_fdes, count_fdes): Go back to checking pc_begin for
- linked once FDEs.
-
-Fri Nov 7 06:50:57 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.h (FUNCTION_VALUE): Take into account promotion of pointers.
-
- * unroll.c (back_branch_in_range_p): Refine check for INSN at loop end.
-
-Wed Nov 5 18:17:50 1997 Paul Eggert <eggert@twinsun.com>
-
- * fixinc.svr4: Replace `__STDC__ - 0 == 1'
- with `defined (__STRICT_ANSI__)'.
-
-Tue Nov 4 18:32:44 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (insv, extzv, extv): Add change_address call.
- (movsi_ulw, movsi_usw): Change QImode to BLKmode in pattern.
- * mips.c (mips_expand_epilogue): Emit blockage insn before call to
- save_restore_insns if no FP and GP will be restored.
-
- * acconfig.h (HAVE_INTTYPES_H): Undef.
- * configure.in (inttypes.h): Check for conflicts between sys/types.h
- and inttypes.h, and verify that intmax_t is defined.
- * mips/x-iris (CC, OPT, OLDCC): Comment out.
- * mips/x-iris3: Likewise.
-
-Tue Nov 4 17:28:31 1997 Doug Evans <dje@cygnus.com>
-
- * c-lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
- (yylex): Record wide strings using target endianness, not host.
-
-Tue Nov 4 16:18:19 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (distdir-start): Add dependency on $(srcdir)/config.in.
-
-Tue Nov 4 06:14:30 1997 Paul Eggert <eggert@twinsun.com>
-
- * c-lex.c (yylex): Don't warn about constants like
- 9223372036854775807 and 18446744073709551615U on an L32LL64 host
- unless pedantic.
-
-Mon Nov 3 18:42:44 1997 Jim Wilson <wilson@cygnus.com>
-
- * i386.c (load_pic_register): Call prologue_get_pc_and_set_got.
- * i386.md (prologue_{set_got,get_pc}): Add UNSPEC_VOLATILE to pattern.
- (prologue_get_pc_and_set_got): New pattern.
-
-Mon Nov 3 13:42:21 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c, cpplib.c (compare_defs): Don't complain about arg name
- respellings unless pedantic.
- * cpplib.c (compare_defs): Accept pfile as new arg.
- All callers changed.
-
-Fri Oct 31 07:10:09 1997 Jeffrey A Law (law@cygnus.com)
-
- * global.c (global_alloc): Free the conflict matrix after
- reload has finished.
-
-Thu Oct 30 17:30:42 1997 Doug Evans <dje@cygnus.com>
-
- * configure.in (sparc-*-elf*): Use sparc/elf.h, sparc/t-elf.
- Set extra_parts.
- (sparc*-*-*): Recognize --with-cpu=v9.
- * sparc/elf.h: New file.
- * sparc/t-elf: New file.
-
-Thu Oct 30 16:36:17 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stmt.c (expand_asm_operand): If error in matching constraint,
- don't emit asm.
-
-Thu Oct 30 12:21:06 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * va-sh.h (__va_arg_sh1): Define.
- (va_arg): Use it.
- SH3E doesn't use any integer registers for subsequent arguments
- once a non-float value was passed in the stack.
- * sh.c (machine_dependent_reorg): If optimizing, put explicit
- alignment in front label for ADDR_DIFF_VEC.
- * sh.h (PASS_IN_REG_P): Fix SH3E case.
- (ADJUST_INSN_LENGTH): If not optimizing, add two extra bytes length.
-
-Tue Oct 28 21:09:25 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.md (btst patterns): Add 5200 support.
-
-1997-10-28 Brendan Kehoe <brendan@cygnus.com>
-
- * global.c (global_alloc): Use xmalloc instead of alloca for
- CONFLICTS, since max_allocno * allocno_row_words alone can be more
- than 2.5Mb sometimes.
-
-Tue Oct 28 15:06:44 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Undefine before including
- svr4.h.
-
-Tue Oct 28 10:19:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- From Brendan:
- * dwarf2out.c (output_call_frame_info): Use l1 instead of ".".
-
-Mon Oct 27 16:01:14 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Disable reg+reg.
-
-Mon Oct 27 16:11:52 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (machine_dependent_reorg): When -flag_delayed_branches,
- put an use_sfunc_addr before each sfunc.
- * sh.md (use_sfunc_addr, dummy_jump): New insns.
- (casesi): For TARGET_SH2, emit a dummy_jump after LAB.
-
-Mon Oct 27 11:49:43 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2.h: Remove dwarf2out prototypes.
- * tree.h: And put them here.
- * m68k.c, i386.c: Don't include dwarf2.h.
-
-Mon Oct 27 00:02:13 1997 Paul Eggert <eggert@twinsun.com>
-
- Remap include files with header.gcc only if user or configuration
- file specifies "-remap".
-
- * cccp.c (remap): New var.
- (main): Set it if user specifies "-remap".
- (open_include_file): Remap only if `remap' is nonzero.
-
- * cpplib.h (struct cpp_options): New member `remap'.
- * cpplib.c (cpp_options_init): Set remap to 0.
- (open_include_file): Remap only if `remap' is nonzero.
- (cpp_handle_options): Set remap if user specifies "-remap".
-
- * i386/cygwin32.h, rs6000/cygwin32.h (CPP_SPEC): Define with -remap.
-
-Sun Oct 26 11:41:49 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (output_call_frame_info): The CIE pointer is now a 32
- bit PC-relative offset. The exception range table pointer is now in
- the CIE.
- * frame.c (dwarf_cie, dwarf_fde): Rename CIE_pointer to CIE_delta.
- (count_fdes, add_fdes, get_cie): Adjust.
- (cie_info, extract_cie_info, __frame_state_for): Adjust eh_ptr uses.
-
- From H.J. Lu:
- * frame.c (count_fdes, add_fdes): Skip linked once FDE entries.
-
-Sat Oct 25 20:29:39 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * Makefile.in (float.h-nat): If float.h is to be empty, ensure it is.
-
-Sat Oct 25 20:16:52 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * prefix.c: Use stdarg.h only ifdef __STDC__. Otherwise,
- use varargs.h. Wrap header with <>, not "".
-
-Sat Oct 25 20:10:57 1997 Robert Lipe (robertl@dgii.com)
-
- * i386/sco5.h (EH_FRAME_SECTION_ASM_OP{,_ELF,_COFF}): Define.
- (DWARF2_UNWIND_INFO): Likewise.
- (EXTRA_SECTIONS): Add in_eh.
-
-Sat Oct 25 12:20:58 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.h (TARGET_SWITCHES): Add -mmult-bug and -mno-mult-bug.
- (TARGET_MULT_BUG): Define.
- (TARGET_DEFAULT): Default to TARGET_MULT_BUG.
- * mn10300.md (mulsi3): Handle TARGET_MULT_BUG.
-
-Fri Oct 24 15:43:57 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (toplevel): Move include stdio.h before config.h.
-
- (Patch from H.J. Lu, Aug 27, 1997)
- * rs6000/linux.h (DEFAULT_VTABLE_THUNKS): New; defined as 1.
-
- (Patch from Jeff Law, Oct 22, 1997)
- * rs6000.c (struct machine_function): Add pic_offset_table_rtx.
- (rs6000_{save,restore}_machine_status): Save/restore it.
-
- * rs6000.md (movsi_got_internal_mem): New pattern to work around
- case where GOT value did not get a register.
- (movsi_got_internal_mem splitter): Split above pattern.
-
- (Patch from Geoffrey Keating, Oct 21, 1997)
- * rs6000.c (rs6000_stack_info): Avoid creating a stack
- frame under System V ABI if we only need to save the LR.
-
- (Patch from Joel Sherrill, Sep 1, 1997)
- * rs6000/sysv4.h (SUBTARGET_SWITCHES): Add new macro
- EXTRA_SUBTARGET_SWITCHES, which defaults to nothing.
-
- (Patch from Geoffrey Keating, Oct 20, 1997)
- * rs6000/t-ppccomm (CRTSTUFF_T_CFLAGS{,_S}): Add -msdata=none
- switch.
-
-Fri Oct 24 15:25:50 1997 Doug Evans <dje@cygnus.com>
-
- * sparc.h (ASM_SPEC): Delete.
-
-Fri Oct 24 13:16:24 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10200.c (indirect_memory_operand): Delete unused function.
- * mn10200.h (EXTRA_CONSTRAINT): Handle 'R'.
- * mn10200.md (bset, bclr insns): Handle output in a reg too.
-
- * mn10300.c (symbolic_operand, legitimize_address): New functions.
- * mn10300.h (LEGITIMIZE_ADDRESS): Call legitimize_address.
- (GO_IF_LEGITIMATE_ADDRESS): Don't allow base + symbolic.
-
-Thu Oct 23 08:03:59 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * dbxout.c (dbxout_start_new_source_file): Use output_quoted_string
- for FILENAME.
-
-Tue Oct 21 16:18:13 1997 Paul Eggert <eggert@twinsun.com>
-
- * winnt/win-nt.h (CPP_SPEC): Remove reference to obsolete
- option -lang-c-c++-comments.
-
-Tue Oct 21 10:00:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (movqi, movhi): Avoid using address registers as
- destinations unless absolutely necessary.
-
- * mn10200.c (expand_prologue): Fix typo.
-
- * mn10200.h (GO_IF_LEGITIMATE_ADDRESS): Do not allow indexed addresses.
- * mn10200.md (neghi2): Provide an alternative which works if
- the input and output register are the same.
-
- * mn10300.c (print_operand): Handle 'S'.
- * mn10300.md (ashlsi3, lshrsi3, ashrsi3): Use %S for
- shift amount in last alternative
-
- * mn10300.c (expand_epilogue): Rework to handle register restores
- in "ret" and "retf" instructions correctly.
-
-Tue Oct 21 07:35:19 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * arm.md (insv): Avoid writing result into a paradoxical subreg.
-
-Tue Oct 21 07:12:28 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Don't redefine.
-
-Mon Oct 20 12:04:04 1997 Nick Clifton <nickc@cygnus.com>
-
- * v850.h (CPP_SPEC): Define __v850__.
- (CPP_PREDEFINES): Do not define __v850__.
-
- * xm-v850.h: Use __v850 rather than __v850__ to identify v850 port.
-
-Mon Oct 20 17:29:55 1997 Doug Evans <dje@cygnus.com>
-
- * sparc.h (SPARC_V9,SPARC_ARCH64): Delete.
- (DEFAULT_ARCH32_P): New macro.
- (TARGET_ARCH{32,64}): Allow compile time or runtime selection.
- (enum cmodel): Declare.
- (sparc_cmodel_string,sparc_cmodel): Declare.
- (SPARC_DEFAULT_CMODEL): Provide default.
- (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}.
- (TARGET_FULLANY): Deleted.
- (TARGET_CM_MEDMID): New macro.
- (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC.
- (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC.
- (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch).
- (CPP_SPEC): Rewrite.
- (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros.
- (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros.
- (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros.
- (ASM_SPEC): Add %(asm_arch).
- (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default.
- Rename asm_default to asm_cpu_default.
- Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian,
- cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch.
- (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH.
- ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values.
- (MASK_INT64,MASK_LONG64): Delete.
- (MASK_ARCH64): Renamed to MASK_64BIT.
- (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete.
- (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG.
- (TARGET_SWITCHES): Always provide 64 bit options.
- (ARCH64_SWITCHES): Delete.
- (TARGET_OPTIONS): New option -mcmodel=.
- (INT_TYPE_SIZE): Always 32.
- (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH.
- (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_....
- (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support.
- (PRINT_OPERAND_PUNCT_VALID_P): Add '_'.
- * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by
- CPP_SPEC.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- * sparc/linux.h: Likewise.
- * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete.
- (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC.
- (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT.
- (SPARC_DEFAULT_CMODEL): Define.
- (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- (LONG_DOUBLE_TYPE_SIZE): Define.
- (ASM_SPEC): Add %(asm_arch).
- * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- (TARGET_CPU_DEFAULT): Add ultrasparc case.
- * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete.
- (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT.
- (SPARC_DEFAULT_CMODEL): Define.
- * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete.
- (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete
- MASK_LONG64, MASK_MEDANY.
- (SPARC_DEFAULT_CMODEL): Define.
- (CPP_PREDEFINES): Delete.
- (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC.
- (ASM_SPEC): Add %(asm_arch).
- (LONG_DOUBLE_TYPE_SIZE): Define.
- (DWARF2_DEBUGGING_INFO): Define.
- * sparc/splet.h (CPP_SPEC): Delete.
- * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC.
- (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support.
- (BLOCK_PROFILER): Likewise.
- * sparc.c (sparc_cmodel_string,sparc_cmodel): New globals.
- (sparc_override_options): Handle code model selection.
- (sparc_init_expanders): Renamed from sparc64_init_expanders.
- * sparc.md: TARGET_<code_model> renamed to TARGET_CM_....
- TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY.
- (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_....
- (sethi_di_fullany): Delete.
-
-Mon Oct 20 17:20:17 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (compute_frame_size): Not a leaf function if profile_flag set.
-
-Sun Oct 19 17:46:02 1997 Douglas Rupp <rupp@gnat.com>
-
- * cccp.c (OBJECT_SUFFIX): Add default definition.
- (main): Use OBJECT_SUFFIX.
- (VMS_{freopen,fopen,open}): Use instead of using macro on
- unprefixed name.
- (VMS_fstat): Use decc$fstat explicitly, not via macro.
-
-Sun Oct 19 09:07:38 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * prefix.c (get_key_value): Initialize prefix to null.
- * Makefile.in (prefix.o): Properly pass in prefix.
-
- * objc/Make-lang.in (objc.distdir): Make the objc directory.
- * Makefile.in (distdir-start): No longer depend on objc-parse.[cy].
- Don't copy objc files here.
- (TAGS): Don't delete objc-parse.y
-
- * i386/mingw32.h (LIB_SPEC): Add -ladvapi32.
- (STARTFILE_SPEC): If -dll, use dllcrt1.o.
- (INCOMING_RETURN_ADDR_RTX): Undefine.
-
- * Makefile.in (float.h-nat): Avoid using /dev/null for input,
- since it's not present on all systems.
-
- * prefix.c : New file.
- * Makefile.in (xgcc, cccp, cppmain, fix-header): Add prefix.o.
- (prefix.o): New rule.
- * cccp.c (update_path): Add extern definition.
- (struct default_include): New field `component'.
- (default_include): Add initializer for new field to all entries.
- (new_include_prefix): Take new arg and call update_path;
- all callers changed.
- Add trailing "." before doing stat of file.
- * cpplib.c (update_path): Add extern definition.
- (struct default_include): New field `component'.
- (default_include): Add initializer for new field to all entries.
- (cpp_start_read): Call update_path.
- * gcc.c (upate_path): Add extern definition.
- (find_a_file): For MS-DOS-based, consider a drive spec as absolute.
- (add_prefix): New arg component and pass to update_path;
- all callers changed.
- * netbsd.h (INCLUDE_DEFAULTS): Add `component' to values.
- * i386/freebsd.h, mips/netbsd.h, winnt/win-nt.h: Likewise.
- * i386/mingw32 (STANDARD_INCLUDE_COMPONENT): New macro.
- * vax/vms.h (INCLUDE_DEFAULTS): New macro.
- * vax/xm-vms.h (INCLUDE_DEFAULTS): Delete from here.
-
- * sparc/sol2.h (WIDEST_HARDWARE_FP_SIZE): New macro.
-
- * i386.c (ix86_prologue): Conditionalize Dwarf2 calls
- on #ifdef INCOMING_RETURN_ADDR_RTX.
- * i386.md (allocate_stack): Fix incorrect operand number.
-
- * alpha.c (vmskrunch): Deleted.
- (output_prolog, VMS): Use alloca for entry_label and don't
- truncate to 64 characters.
- * alpha/vms.h (vmskrunch): No longer define.
- (ENCODE_SECTION_INFO): No longer call vmskrunch.
- (ASM_DECLARE_FUNCTION_NAME): No longer override.
-
- * toplev.c (output_quoted_string): Call new OUTPUT_QUOTED_STRING macro.
- * i386/mingw32.h (OUTPUT_QUOTED_STRING): New macro.
-
- * stmt.c (using_eh_for_cleanups_p): New variable.
- (using_eh_for_cleanups): New function.
- (expand_decl_cleanup): Don't call expand_eh_region_start_tree
- unless using EH for cleanups.
-
- * function.c (purge_addressof_1): When dealing with a
- bare (address (mem)), verify that what's inside is valid in insn.
- (instantiate_virtual_regs_1, case ADDRESSOF): If have MEM, just
- do instantiation inside and leave alone here.
-
- * fold-const.c (fold, case COND_EXPR): Allow creation
- of {MIN,MAX}_EXPR, but preserve info on orginal comparison code.
-
- * function.h (restore_tree_status): Update prototype.
-
- * cse.c (cse_basic_block): Flush the hash table every 1,000 insns.
-
-Sat Oct 18 13:48:14 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * longlong.h (count_leading_zeros): Add missing casts to USItype.
-
-Sat Oct 18 13:35:09 1997 Marc Lehmann (pcg@goof.com)
-
- * toplev.c (main): Don't execute "ps" under MSDOS.
-
-Sat Oct 18 13:26:42 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * function.c (instantiate_virtual_regs): Don't instantiate the
- stack slots for the parm registers until after the insns have had
- their virtuals instantiated.
-
- * varargs.h (va_arg): For ARM systems, definition is endian-dependent.
- * stdarg.h (va_arg): Likewise.
-
-Sat Oct 18 11:23:04 1997 Nick Clifton <nickc@cygnus.com>
-
- * final.c (end_final): Use ASM_OUTPUT_ALIGNED_DECL_LOCAL if defined.
- * varasm.c (assemble_static_space): Likewise.
- (assemble_variable): Use ASM_OUTPUT_ALIGNED_DECL_{COMMON,LOCAL} if def.
-
-Sat Oct 18 11:02:19 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * expr.c (use_group_regs): Don't call use_reg unless REG.
-
-Sat Oct 18 10:39:22 1997 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (simplify_ternary_operation, case IF_THEN_ELSE): Collapse
- redundant conditional moves to single operand.
-
- * expmed.c (extract_bit_field): Don't make flag_force_mem disable
- extzv for memory operands.
-
-Sat Oct 18 09:58:44 1997 Jeffrey A Law <law@cygnus.com>
-
- * ptx4.h: Fix typo.
-
- * integrate.c (save_for_inline_copying): Avoid undefined pointer
- operations.
- (expand_inline_function): Likewise.
-
-Sat Oct 18 09:49:46 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * tree.c (restore_tree_status): Also free up temporary storage
- when we finish a toplevel function.
- (dump_tree_statistics): Print stats for backend obstacks.
-
- * libgcc2.c (__throw): Don't copy the return address.
- * dwarf2out.c (expand_builtin_dwarf_reg_size): Ignore return address.
-
- * tree.c (expr_tree_cons, build_expr_list, expralloc): New fns.
- * tree.h: Declare them.
-
- * except.c (exceptions_via_longjmp): Initialize to 2 (uninitialized).
- * toplev.c (main): Initialize exceptions_via_longjmp.
-
- * tree.c: Add extra_inline_obstacks.
- (save_tree_status): Use it.
- (restore_tree_status): If this is a toplevel inline obstack and we
- didn't want to save anything on it, recycle it.
- (print_inline_obstack_statistics): New fn.
- * function.c (pop_function_context_from): Pass context to
- restore_tree_status.
-
-Sat Oct 18 09:45:22 1997 Michael Meissner <meissner@cygnus.com>
-
- * profile.c (get_file_function_name): Remove declaration.
- * c-lang.c (finish_file): Likewise.
-
-Sat Oct 18 09:35:40 1997 Tristan Gingold <gingold@messiaen.enst.fr>
-
- * expr.c (expand_assignment): If -fcheck-memory-usage, add call to
- chkr_check_addr if size not zero.
- (expand_expr, case COMPONENT_REF): Likewise.
- (expand_builtin): If -fcheck_memory-usage, check memory usage
- of operands for strlen, strcpy, and memcpy or don't use builtins
- for memcmp and strcmp.
- * expr.h (chkr_check_str_libfunc): Declare.
- * optabs.c (chkr_check_str_libfunc): New variable.
- (init_optabs): Initialize it.
-
-Sat Oct 18 09:29:21 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * i386/cygwin32.h (ASM_COMMENT_START): Redefine.
-
-Sat Oct 18 09:23:54 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * frame.c (__frame_state_for): Execute the FDE insns until the
- current pc value is strictly bigger than the target pc value.
-
- * expr.c (expand_expr, case TARGET_EXPR): If target and slot has
- no DECL_RTL, then call mark_addressable again for the slot after
- we give it RTL.
-
-Sat Oct 18 08:58:36 1997 Manfred Hollstein (manfred@lts.sel.alcatel.de)
-
- * m88k/dolph.h (INITIALIZE_TRAMPOLINE): Delete here.
- * m88k/sysv3.h (INITIALIZE_TRAMPOLINE): Unconditionally define.
- * libgcc2.c (__enable_execute_stack): Check for __sysV88__ not
- __DOLPHIN__.
-
- * m68k/mot3300.h (ASM_OUTPUT_ALIGN): Accept any alignment.
- * dwarf2out.c (output_call_frame_info): Call app_enable and
- app_disable to let GNU as accept the generated comments.
-
- * m88k.c (m88k_begin_prologue): Remove superfluous backslash.
-
-Sat Oct 18 08:50:04 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * flow.c (print_rtl_with_bb): Cast alloca return values.
-
-Sat Oct 18 08:47:46 1997 Douglas Rupp <rupp@gnat.com>
-
- * alpha/vms.h (LITERALS_SECTION_ASM_OP, ASM_OUTPUT_DEF):
- (EXTRA_SECTION_FUNCTIONS): Add literals_section.
- (EXTRA_SECTIONS): Include in_literals.
-
-Sat Oct 18 08:40:55 1997 Nick Burrett <nick.burrett@btinternet.com>
-
- * cpplib.c: (initialize_builtins): Cast all string constants for the
- function install, to type U_CHAR *.
- (eval_if_expression): Likewise.
- * cppexp.c: (cpp_lex): Cast string, for cpp_lookup, to type U_CHAR *.
-
-Sat Oct 18 08:38:13 1997 Ken Raeburn <raeburn@cygnus.com>
-
- * c-lex.c (check_newline) At `skipline', flush nextchar as well.
-
-Sat Oct 18 08:17:13 1997 Paul Russell <Paul.Russell@RustCorp.com.au>
-
- * input.h (struct file_stack): Added indent_level.
- * c-lex.c (check_newline): Add {}-count & balance warning.
-
-Sat Oct 18 06:54:39 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * regclass.c (record_address_regs, case PLUS): Refine how to choose
- which is base and index.
-
- * alpha.h (FUNCTION_VALUE): Use word_mode only for integral types,
- not types with integral modes.
-
- * final.c (alter_cond): Properly conditionalize forward decl.
-
- * tree.h (SAVE_EXPR_NOPLACEHOLDER): New flag.
- * tree.c (contains_placeholder_p, case SAVE_EXPR): Avoid
- checking each SAVE_EXPR more than once.
-
- * rs6000.md (nonlocal_goto_receiver): Don't test pool size.
-
- * i386.c (load_pic_register): New function.
- (ix86_prologue): Code to load PIC register moved to new function.
- Don't emit blockage if not generating RTL.
- * i386.md (nolocal_goto_receiver): New pattern.
-
- * i386.c: Major cleanup, mostly reformatting.
- Include dwarf2.h.
- Remove many spurious casts.
- (ix86_{pro,epi}logue): Use proper mode for SET rtx.
-
-Fri Oct 17 17:13:42 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * sparc/linux64.h (LINK_SPEC): Dynamic linker is ld-linux64.so.2.
- * sparc.h (FUNCTION_PROFILER): Fix format string when TARGET_MEDANY.
- * sparc.c (output_double_int): Output DI mode values
- correctly when HOST_BITS_PER_WIDE_INT is 64.
- (output_fp_move_quad): If TARGET_V9 and not TARGET_HARD_QUAD, use
- fmovd so it works if a quad float ends up in one of the upper 32
- float regs.
- * sparc.md (pic_{lo_sum,sethi}_di): New patterns for PIC support
- on sparc64.
-
-Fri Oct 17 16:27:07 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS.
- * sparc.h (PROMOTE_MODE): Promote small ints if arch64.
- (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define.
- (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros.
- (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros.
- (SPARC_FP_ARG_FIRST): New macro.
- (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now.
- (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs.
- (NPARM_REGS): There are 32 fp argument registers now.
- (FUNCTION_ARG_REGNO_P): Likewise.
- (FIRST_PARM_OFFSET): Update to new v9 abi.
- (REG_PARM_STACK_SPACE): Define for arch64.
- (enum sparc_arg_class): Delete.
- (sparc_arg_count,sparc_n_named_args): Delete.
- (struct sparc_args): Redefine and use for arch32 as well as arch64.
- (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete.
- (FUNCTION_ARG_ADVANCE): Rewrite.
- (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite.
- (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite.
- (FUNCTION_ARG_CALLEE_COPIES): Delete.
- (FUNCTION_ARG_{PADDING,BOUNDARY}): Define.
- (STRICT_ARGUMENT_NAMING): Define.
- (doublemove_string): Declare.
- * sparc.c (sparc_arg_count,sparc_n_named_args): Delete.
- (single_move_string): Use GEN_INT, and HOST_WIDE_INT.
- (doublemove_string): New function.
- (output_move_quad): Clean up some of the arch64 support.
- (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64.
- Don't add 8 bytes of reserved space if arch64.
- (sparc_builtin_saveregs): Combine arch32/arch64 versions.
- (init_cumulative_args): New function.
- (function_arg_slotno): New static function.
- (function_arg,function_arg_partial_nregs): New functions.
- (function_arg_{pass_by_reference,advance}): New functions.
- (function_arg_padding): New function.
- * ginclude/va-sparc.h: Rewrite v9 support.
-
-Fri Oct 17 13:21:45 EDT 1997 Philip Blundell <pb@nexus.co.uk>
-
- * arm/netbsd.h (TYPE_OPERAND_FMT): use % not @ to avoid
- problems with comments.
-
-Fri Oct 17 13:00:38 EDT 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * arm/aout.h (ASM_OUTPUT_LABEL): Define in place of ARM_OUTPUT_LABEL.
- * arm/aof.h (ASM_OUTPUT_LABEL): Likewise.
- * arm.h (ASM_OUTPUT_LABEL): Delete.
- (ASM_OUTPUT_INTERNAL_LABEL): Call ASM_OUTPUT_LABEL directly.
- * arm.c (arm_asm_output_label): Delete.
-
- * arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Do what is needed inline.
- * arm.c (output_lcomm_directive): Delete.
-
- * arm.h (PUSH_ROUNDING): Delete; this is not what happens.
- (ACCUMULATE_OUTGOING_ARGS): Define.
- (PROMOTE_FUNCTION_ARGS): Define.
- (INITIAL_ELIMINATION_OFFSET): Take current_function_outgoing_args_size
- into account.
- * arm.c (use_return_insn, output_func_epilogue,
- arm_expand_prologue): Likewise.
-
- * arm.c (const_ok_for_arm): If HOST_WIDE_INT more than 32 bits,
- insist high bits are all zero or all one.
- (output_move_double): Handle case where CONST_INT is more than 32 bits.
-
- * arm.c (load_multiple_sequence): Support SUBREG of MEM.
- (store_multiple_sequence): Likewise.
-
- * arm.c (arm_gen_load_multiple): New args UNCHANGING_P and IN_STRUCT_P.
- Use them if we create any new MEMs; all callers changed.
- (arm_gen_store_multiple): Likewise.
- (arm_gen_movstrqi): Preserve RTX_UNCHANGING_P and MEM_IN_STRUCT_P
- on any MEMs created.
-
- * arm.h (ASM_OUTPUT_MI_THUNK): Use branch instruction to jump to label.
- (RETURN_ADDR_RTX): Use NULL_RTX rather than casting zero.
- (output_move_double): Correct typo in prototype.
-
- * arm.md (movsfcc): If not TARGET_HARD_FLOAT, ensure operand[3] valid.
-
- * arm/netbsd.h (CPP_PREDEFINES): Always predefine __arm__.
- * arm/xm-netbsd.h (SYS_SIGLIST_DECLARED, HAVE_STRERROR): Define these.
-
- * arm/t-netbsd (CROSS_LIBGCC1, LIB1ASMSRC, LIB1ASMFUNCS) Don't define
- these any more.
- * configure.in (arm-*-netbsd*): Pick up t-netbsd before arm/t-netbsd.
-
-Thu Oct 16 19:31:22 1997 Jim Wilson <wilson@cygnus.com>
-
- * v850.c (ep_memory_offset): New function.
- (ep_memory_operand, substitute_ep_register, v850_reorg): Call it.
-
- * v850.h (CONST_OK_FOR_*): Add and correct comments.
- (CONSTANT_ADDRESS_P): Add comment.
- (EXTRA_CONSTRAINT): Define 'U'.
- * v850.md: Add comments on bit field instructions.
- (addsi3): Delete &r/r/r alternative. Add r/r/U alternative.
- (lshrsi3): Use N not J constraint.
-
- * v850.md (v850_tst1+1): New define_split for tst1 instruction.
-
- * v850.c (reg_or_0_operand): Call register_operand.
- (reg_or_int5_operand): Likewise.
- * v850.h (MASK_BIG_SWITCH, TARGET_BIG_SWITCH): New macros.
- (TARGET_SWITCHES): Add "big-switch".
- (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT, CASE_VECTOR_MODE,
- ASM_OUTPUT_BEFORE_BASE_LABEL): Add support for TARGET_BIG_SWITCH.
- (CASE_DROPS_THROUGH): Comment out.
- (CASE_VECTOR_PC_RELATIVE, JUMP_TABLES_IN_TEXT_SECTION): Define.
- * v850.md (cmpsi): Delete compare mode.
- (casesi): New pattern.
-
- * v850.h (CONST_OK_FOR_N): Delete redundant compare against zero.
- * v850.md (ashlsi3): Use SImode not QImode for shift count.
- (lshrsi3): Likewise.
-
- * v850.c (print_operand): Add 'c', 'C', and 'z' support. Delete
- unreachable switch statement after 'b' support. Remove "b" from
- strings for 'b' support.
- * v850.md (branch_normal, branch_invert): Change %b to b%b.
-
-Thu Oct 16 13:08:45 1997 Doug Evans <dje@cygnus.com>
-
- * configure.in (sparc-*-elf*): New target.
-
-Wed Oct 15 22:30:37 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * h8300.h (REG_CLASS_CONTENTS): AP is a general register.
- (REG_OK_FOR_BASE_P, ! REG_OK_STRICT case): Reject special registers.
-
-Wed Oct 15 22:00:57 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (movhi+1): Add x/r alternative.
-
- * sh/elf.h (HANDLE_SYSV_PRAGMA): Undefine.
-
- * va-sh.h (va_arg): Fix big endian bugs for small integers.
-
-Wed Oct 15 21:34:45 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (udivsi3, divsi3): Split into MQ and non-MQ cases for
- PPC601.
- (umulsidi3,umulsi3_highpart): Likewise.
- (smulsi3_highpart_no_mq): Add !TARGET_POWER.
-
-Wed Oct 15 18:45:31 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/t-sp64 (LIBGCC2_CFLAGS): Delete.
-
-Wed Oct 15 17:17:33 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (following_call): Fail if the CALL_INSN is an indirect call.
-
-Wed Oct 1 17:52:09 1997 Douglas Rupp <rupp@gnat.com>
-
- * vms.h (UNALIGNED_{SHORT,INT,DOUBLE_INT}_ASM_OP): Define.
-
-Wed Oct 1 16:09:42 1997 Benjamin Kosnik <bkoz@melange.gnu.ai.mit.edu>
-
- * fixincludes: Fix sys/param.h so that MAXINT will not be redefined
- on HPUX.
-
-Wed Oct 1 08:08:21 1997 Jeffrey A Law <law@chunks.cygnus.com>
-
- * cse.c (this_insn_cc0_mode): Initialize.
-
-Wed Oct 1 07:22:12 1997 Richard Henderson <rth@cygnus.com>
-
- * i386.h (RETURN_ADDR_RTX): Use FRAME arg, not ap.
-
-Tue Sep 30 19:19:58 1997 Jim Wilson <wilson@cygnus.com>
-
- * except.c (find_exception_handler_labels): Correct argument to free.
-
-Fri Sep 26 14:06:45 1997 Mike Stump <mrs@wrs.com>
-
- * c-decl.c (start_struct): Ensure that structs with forward
- declarations are in fact packed when -fpack-struct is given.
-
-Wed Sep 24 11:31:24 1997 Mike Stump <mrs@wrs.com>
-
- * stor-layout.c (layout_record): Ignore STRUCTURE_SIZE_BOUNDARY if
- packing structure. This allows a structure with only bytes to be
- aligned on a byte boundary and have no padding on a m68k.
-
-Tue Sep 30 11:00:00 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * except.c (find_exception_handler_labels): Free LABELS when done.
-
-Tue Sep 30 10:47:33 1997 Paul Eggert <eggert@twinsun.com>
-
- * cexp.y, cppexp.c (HOST_BITS_PER_WIDE_INT):
- Define only if not already defined.
-
-Mon Sep 29 17:55:55 1997 Gavin Koch <gavin@cygnus.com>
-
- * c-decl.c (warn_implicit): Deleted.
- (warn_implicit_int, mesg_implicit_function_declaration}): New vars.
- (c_decode_option): For -Wimplicit, set both new variables.
- Add -Wimplicit-function-declarations, -Wimplicit-int,
- and -Werror-implicit-function-declaration.
- (implicitly_declare, grokdeclarator): Use new flags.
- * toplev.c (lang_options): Add new -W options.
-
-Mon Sep 29 17:55:15 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-common.c (check_format_info): Add check for scanf into
- constant object or via constant pointer type.
-
-Mon Sep 29 16:10:12 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne.
- (bne): Likewise for cmpeq+beq.
-
-Mon Sep 29 15:58:22 1997 Doug Evans <dje@cygnus.com>
-
- * reload1.c (reload_cse_simplify_set): Fix return values.
-
-Mon Sep 29 08:21:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
-
- * i386.c (notice_update_cc): Use reg_overlap_mentioned_p.
-
-Sun Sep 28 18:59:58 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (__throw): Fix thinko.
-
-Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net>
-
- * cplus-dem.c (demangle_template): Add new parameter. Handle new
- template-function mangling.
- (consume_count_with_underscores): New function.
- (demangle_signature): Handle new name-mangling scheme.
-
-Sun Sep 28 11:19:09 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * flow.c (print_rtl_with_bb): Reformat messages about BB boundaries.
-
- * calls.c: Include regs.h.
- * profile.c: Likewise.
- * Makefile.in (calls.o, profile.o): Depend on regs.h.
- * except.h (expand_builtin_dwarf_reg_size): Put in #ifdef TREE_CODE.
-
- * tree.h (get_file_function_name): Add decl.
- * dwarf2out.c (output_call_frame_info): Don't cast its result.
-
-Sun Sep 28 10:58:21 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in (sub-makes): Pass value of LANGUAGES.
-
-Sun Sep 28 10:52:59 1997 Ian Dall <ian.dall@dsto.defence.gov.au>
-
- * regs.h (SMALL_REGISTER_CLASSES): Default to 0.
- * calls.c (prepare_call_address, expand_call):
- Remove #if test on SMALL_REGISTER_CLASSES.
- * combine.c (can_combine_p, combinable_i3pat, try_combine): Likewise.
- * cse.c (canon_hash): Likewise.
- * function.c (expand_function_start): Likewise.
- * jump.c (jump_optimize): Likewise.
- * local-alloc.c (optimize_reg_copy_1): Likewise.
- * loop.c (scan_loop, valid_initial_value_p): Likewise.
- * profile.c (output_arc_profiler): Likewise.
- * reload.c (push_secondary_reload, push_reload): Likewise.
- (combine_reloads): Likewise.
- * reload1.c (reload, scan_paradoxical_subregs): Likewise.
- (order_regs_for_reload, reload_as_needed): Likewise.
- (choose_reload_regs): Likewise.
- (merge_assigned_reloads): Declare unconditionally.
-
-Sat Sep 27 11:02:38 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * c-decl.c (init_decl_processing): Add __builtin_dwarf_reg_size.
- * tree.h (built_in_function): Likewise.
- * expr.c (expand_builtin): Likewise.
- * except.h: Likewise.
- * dwarf2out.c (expand_builtin_dwarf_reg_size): New fn.
- * libgcc2.c (copy_reg): New fn.
- (__throw): Use it.
-
-Fri Sep 26 09:00:13 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * frame.c (gansidecl.h): New include, for PROTO.
- * dwarf2out.c: Move inclusion of dwarf2.h down.
- (dwarf2out_cfi_label): Don't declare here.
- * dwarf2.h (dwarf2out_{do_frame,cfi_label,def_cfa}): New declarations.
- (dwarf2out_{window_save,args_size,reg_save,return_save}): Likewise.
- (dwarf2out_{return_reg,begin_prologue,end_epilogue}): Likewise.
- * m68k.c (dwarf2.h): Include.
- (output_function_prologue): Add dwarf2 support.
- * m68k.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_REGNUM): New macros.
- (INCOMING_FRAME_SP_OFFSET): Likewise.
-
- * integrate.c (copy_rtx_and_substitute, case ADDRESSOF): New case.
-
- * integrate.c (expand_inline_function): Make sure there is at
- least one insn that can be used as an insertion point.
-
-Fri Sep 26 08:54:59 1997 Paul Eggert <eggert@twinsun.com>
-
- * c-typeck.c (build_binary_op): Warn about comparing signed vs
- unsigned if -W is specified and -Wno-sign-compare is not.
- * c-decl.c (warn_sign_compare): Initialize to -1.
- (c_decode_option): -Wall no longer implies -Wsign-compare.
-
-Wed Sep 24 21:34:06 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c: s/flag_verbose_asm/flag_debug_asm/
-
-Wed Sep 24 19:17:08 1997 Doug Evans <dje@cygnus.com>
-
- * sparc.md (get_pc_via_call): Renamed from get_pc_sp32.
- (get_pc_via_rdpc): Renamed from get_pc_sp64.
- * sparc.c (finalize_pic): Update call to gen_get_pc_via_call.
-
-Wed Sep 24 18:38:22 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * sparc.h (ASM_CPU_SPEC): Pass -Av9a for v8plus, ultrasparc.
- (TARGET_OPTIONS): Add -malign-loops=, -malign-jumps=,
- and -malign-functions=.
- (sparc_align_{loops,jumps,funcs}_string): Declare.
- (sparc_align_{loops,jumps,funcs}): Declare.
- (DEFAULT_SPARC_ALIGN_FUNCS): New macro.
- (FUNCTION_BOUNDARY): Use sparc_align_funcs.
- (STACK_BIAS): Define.
- (SPARC_SIMM*_P): Cast to unsigned HOST_WIDE_INT, then perform test.
- (SPARC_SETHI_P): New macro.
- (CONST_OK_FOR_LETTER_P): Use it.
- (ASM_OUTPUT_ALIGN_CODE): Define.
- (ASM_OUTPUT_LOOP_ALIGN): Define.
- * sparc.c (sparc_align_{loops,jumps,funcs}_string): New globals.
- (sparc_align_{loops,jumps,funcs}): New globals.
- (sparc_override_options): Handle -malign-loops=, -malign-jumps=,
- -malign-functions=.
- (move_operand): Use SPARC_SETHI_P.
- (arith_double_operand): Cast to unsigned HOST_WIDE_INT, then test.
- (arith11_double_operand): Likewise.
- (arith10_double_operand): Likewise.
- (finalize_pic): Finish sparc64 support.
- (emit_move_sequence): Use SPARC_SETHI_P. Simplify low part of
- 64 bit constants if able.
- (output_fp_move_quad): Don't use fmovq unless TARGET_HARD_QUAD.
- (sparc_builtin_saveregs [sparc64]): Don't save fp regs if ! TARGET_FPU.
- * sparc.md: Use GEN_INT instead of gen_rtx.
- (get_pc_sp32): Use for sparc64 as well.
- (lo_sum_di_sp{32,64}): Fix handling on 64 bit hosts.
- (sethi_di_sp64_const): Likewise.
- (movtf_cc_sp64): Check TARGET_HARD_QUAD.
- (cmp_zero_extract_sp64): Use unsigned HOST_WIDE_INT in cast.
- (ashlsi3, ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise.
-
-Wed Sep 24 08:25:28 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * i386.md (allocate_stack): Fix typo in last change.
-
-Tue Sep 23 19:02:46 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/linux-aout.h (COMMENT_BEGIN): Delete.
- * sparc/linux.h (COMMENT_BEGIN): Likewise.
- * sparc/linux64.h (COMMENT_BEGIN): Likewise.
-
-Tue Sep 23 14:48:18 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- Add sparc64 linux support.
- * configure.in (sparc64-*-linux*): Recognize. Add sparc/xm-sparc.h
- to xm_file list on 32-bit sparc-linux.
- * sparc/xm-sp64.h: New file.
- * sparc/linux64.h: New file.
- * sparc/xm-linux.h: Include some standard headers if not inhibit_libc.
- Don't include xm-sparc.h.
- * config/xm-linux.h (HAVE_PUTENV, HAVE_ATEXIT): Define.
- * glimits.h (LONG_MAX): Handle sparc64.
-
-Tue Sep 23 08:32:51 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * final.c (final_end_function): Also do dwarf2 thing if
- DWARF2_DEBUGGING_INFO.
- (final_start_function): Likewise.
-
-Tue Sep 23 06:55:40 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * expmed.c (expand_divmod): If compute_mode is not same as mode,
- handle case where convert_modes causes op1 to no longer be CONST_INT.
-
-Tue Sep 23 00:58:48 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (save_restore_insns): Only set RTX_FRAME_RELATED_P if store_p.
-
-Mon Sep 22 18:26:25 1997 J. Kean Johnston <jkj@sco.com>
-
- * i386/sco5.h: Make ELF default file format and add -mcoff/-melf..
- (MULTILIB_DEFAULTS): Define.
- (ASM_SPEC, CPP_SPEC): Handle -mcoff.
- (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): Likewise.
- (LIBGCC_SPEC): Likewise.
- (MASK_COFF, TARGET_COFF, TARGET_ELF): Define.
- (SUBTARGET_SWITCHES): Add -mcoff and -melf.
- * i386/t-sco5 (CRTSTUFF_T_CFLAGS): Add -fPIC.
- (CRTSTUFF_T_CFLAGS_S): Tweak for COFF.
- (EXTRA_PARTS, TAROUTOPTS): Delete.
- (libgcc1-elf, libgcc2-elf, libgcc-elf targets): Delete.
- (MULTILIB_OPTIONS): Define.
- (MULTILIB_DIRNAMES, MULTILIB_EXCEPTIONS): Likewise.
- (MULTILIB_MATCHE, MULTILIB_EXTRA_OPTS): Likewise.
-
-Mon Sep 22 14:42:11 1997 Jeffrey A Law (law@cygnus.com)
-
- * reg-stack.c (find_blocks): Fix thinko in last change.
-
-Mon Sep 22 16:22:41 1997 David S. Miller <davem@tanya.rutgers.edu>
-
- * combine.c (try_combine): Use NULL_RTX, not 0, in gen_rtx calls.
- * cse.c (cse_main): Likewise.
- * emit-rtl.c (gen_label_rtx): Likewise.
- * expr.c (init_expr_once): Likewise.
- * sched.c (schedule_insns): Likewise.
- * varasm.c (immed_double_const): Likewise.
-
- * sparc.h (INCOMING_FRAME_SP_OFFSET): Define as SPARC_STACK_BIAS.
-
-Mon Sep 22 16:13:21 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * alpha/linux.h (HANDLE_SYSV_PRAGMA): Define.
-
-Mon Sep 22 16:02:01 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
-
- * c-common.c (decl_attributes): Add support for TYPE_UNUSED on types.
- * c-decl.c (finish_decl): Set TREE_USED on decls if TREE_USED on type.
- * stmt.c (expand_end_bindings): Check DECL_NAME and DECL_ARTIFICIAL
- before unused variable warning.
-
-Mon Sep 22 14:04:18 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * rtlanal.c (computed_jump_p): Fix typo in last change.
-
- * clipper.md (movstrsi): Use change_address instead of making new MEM.
- * dsp16xx.md (movstrqi): Likewise.
- * i370.md (movstrsi): Likewise.
- * i860.md (movstrsi): Likewise.
- * pa.md (movstrsi): Likewise.
- * mips.md (movstrsi): Fix (unused) pattern in define_expand.
- * pdp11.md (movstrhi): Likewise.
-
- * alpha.md (allocate_stack): Use virtual_stack_dynamic for result.
- * i386.md (allocate_stack): Likewise.
- * rs6000.md (allocate_stack): Likewise.
-
- * alpha.h (FLOAT_STORE_FLAG_VALUE): Different for VAX and IEEE float.
-
- * function.c (assign_parms): Make max_parm_reg handling more
- precise and make it agree with size of parm_reg_stack_loc.
- * integrate.c (save_for_inline_{nocopy,copying}): Remove
- redundant assignment of max_parm_reg.
-
- * function.c (assign_parms): Properly set RTX_UNCHANGING_P for
- copy of parm.
-
- * integrate.c (copy_rtx_and_substitute, case SET): Handle
- a SET_DEST of the virtual fp or ap specially and undo
- the adjustment into the local area as well.
- (mark_stores): Don't wipe out map entries for virtual fp and ap.
-
- * alpha.h (FLOAT_STORE_FLAG_VALUE): Different for VAX and IEEE float.
-
- * emit-rtl.c (gen_lowpart): Handle ADDRESSOF.
-
-Mon Sep 22 13:35:56 1997 Doug Evans <dje@cygnus.com>
-
- * rtlanal.c (replace_regs): Fix up lossage in last patch.
-
-Sun Sep 21 19:28:48 1997 Jeffrey A Law (law@cygnus.com)
-
- * flow.c (jmp_uses_reg_or_mem): Deleted unused function.
- (find_basic_blocks): Use computed_jump_p to determine if a
- particular JUMP_INSN is a computed jump.
- * reg-stack.c (find_blocks): Use computed_jump_p to determine
- if a particular JUMP_INSN is a computed jump.
- * rtlanal.c (jmp_uses_reg_or_mem): New function.
- (computed_jump_p): Likewise.
- * rtl.h (computed_jump_p): Declare.
- * genattrtab.c (pc_rtx): Define and initialize.
-
- * cse.c (simplify_relational_operation): Set h0u just like h0s.
- Similarly for h1u and h1s.
-
-Sun Sep 21 14:13:31 1997 Doug Evans <dje@cygnus.com>
-
- * function.c (instantiate_virtual_regs): Fix thinko in last patch.
-
-Sun Sep 21 10:33:26 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c, cpplib.c (special_symbol): If STDC_0_IN_SYSTEM_HEADERS
- is defined, expand __STDC__ to 0 in system headers.
- * i386/sol2.h, rs6000/sol2.h, sparc/sol2.h:
- (STDC_0_IN_SYSTEM_HEADERS): New macro.
- (CPP_SPEC): Remove -D__STDC__=0; it's no longer needed.
-
- * fixinc.math (_MATH_H_WRAPPER): Define at the end of the
- wrapper, not the start, so that if #include_next gets another
- instance of the wrapper, this will follow the #include_next
- chain until we arrive at the real <math.h>.
-
- * fixproto (subdirs_made): New var, to keep track of which
- subdirectories we've made (in reverse order). At the end,
- attempt to rmdir them all, so that we don't create any empty
- directories.
-
-Sun Sep 21 10:02:07 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * pa.c (move_operand): Respect -mdisable-indexing.
- * pa.h (GO_IF_LEGITIMATE_ADDRESS): Likewise.
-
-Sun Sep 21 09:29:23 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * function.c (purge_addressof_1): Don't convert (MEM (ADDRESSOF (REG)))
- to (SUBREG (REG)) on big endian machines.
- Don't fall through to substitute the inner (REG) unchanged
- when the above conversion cannot be validated.
-
-Sat Sep 20 16:22:06 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * frame.c (__deregister_frame): Properly check for initialized object.
-
- * function.c (instantiate_virtual_regs): Instantiate
- parm_reg_stack_locs.
-
-Sat Sep 20 03:07:54 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/sysv4.h (ASM_COMMENT_START): Delete.
- * sparc.h (ASM_COMMENT_START): Define.
- * sparc.c (output_function_prologue): Use it.
- (sparc_flat_output_function_{epi,pro}logue): Likewise.
-
-Fri Sep 19 19:43:09 1997 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (strength_reduce): Fix typo.
-
- * m68k/xm-mot3300.h (alloca): Properly declare if __STDC__.
- * mips.h, xm-rs6000.h, rs6000/xm-sysv4.h: Likewise.
-
-Fri Sep 19 20:10:30 1997 Doug Evans <dje@cygnus.com>
-
- * rtl.h (find_use_as_address): Delete accidentally added decl.
-
-Fri Sep 19 08:36:16 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * jump.c (thread_jumps): Check can_reverse_comparison_p before
- threading a reversed-condition jump.
-
-Fri Sep 19 08:16:12 1997 Andrew M. Bishop <amb@gedanken.demon.co.uk>.
-
- * Add support for new -dI option for cxref,
- * cccp.c (dump_includes): New variable.
- (struct directive, directive_table): Remove members angle_brackets,
- traditional_comments, pass_thru; all code using struct directive
- now uses `type' member instead.
- (IS_INCLUDE_DIRECTIVE_TYPE): New macro.
- (main, handle_directive): Add support for new -dI option.
- (do_ident): Avoid unnecessary alloca.
- (do_pragma): Avoid unnecessary comparison to newline.
-
- * cpplib.h (struct cpp_options): New member dump_includes.
- * cpplib.c (struct directive, directive_table): Remove members
- traditional_comments, pass_thru; all code using struct directive
- now uses `type' member instead.
- (IS_INCLUDE_DIRECTIVE_TYPE): New macro.
- (handle_directive, cpp_handle_options): Add support for new -dI option.
-
-Fri Sep 19 07:57:19 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax/xm-vms.h (expand_builtin_{extract,set}_return_addr): New macros.
-
-Fri Sep 19 07:47:29 1997 Nick Burrett <n.a.burrett@btinternet.com>
-
- * cpplib.c (pcstring_used, pcfinclude): Delete unused declarations.
- (check_preconditions, print_containing_files, pipe_closed): Likewise.
- (dump_defn_1, dump_arg_n, make_undef): Likewise.
- (trigraph_pcp): Pre-process out decl.
- (quote_string): Cast CPP_PWRITTEN macro to char * for sprintf.
- (output_line_command): Likewise.
- (macro_expand): Likewise.
- (do_line): Cast atoi argument to char *.
- * genattrtab.c (simplify_by_alternatives): Pre-process out decl.
- * genpeep.c (gen_exp): Remove decl.
-
-Fri Sep 19 07:29:40 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * enquire.c (basic): Elminate dangling else warning.
- * except.h (struct function, save_eh_status, restore_eh_status):
- Don't declare.
- * expr.c (clear_storage): Don't return without a value.
- * function.h ({save,restore}_machine_status): Add proper prototype.
- ({save,restore}_{tree,eh,stmt,expr,emit,storage}_status): Declare.
- * real.h (real_value_truncate): Add proper prototype.
- (target_isnan, target_isinf, target_negative, debug_real): Declare.
- (assemble_real): Likewise.
- * recog.c (strict_memory_address_p, memory_address_p): Don't declare.
- (find_single_use_1): Add prototype.
- * recog.h (init_recog, init_recog_no_volatile): Declare.
- (check_asm_operands, constrain_operands, memory_address_p): Likewise.
- (strict_memory_address_p, validate_replace_rtx): Likewise.
- (reg_fits_class_p, find_single_use, general_operand): Likewise.
- (address_operand, register_operand, scratch_operand): Likewise.
- (immediate_operand, const_int_operand, const_double_operand): Likewise.
- (nonimmediate_operand, nonmemory_operand, push_operand): Likewise.
- (memory_operand, indirect_operand, mode_independent_operand): Likewise.
- (comparison_operator, offsettable_{,nonstrict_}memref_p): Likewise.
- (offsettable_address_p, mode_dependent_address_p, recog): Likewise.
- (add_clobbers): Likewise.
- * reload.h (strict_memory_address_p): Don't declare here.
- * rtl.h (struct rtvec_def): Make num_elem an integer.
- (PUT_NUM_ELEM): Delete cast to unsigned.
- (rtx_unstable_p, rtx_varies_p, reg_mentioned_p): Declare.
- (reg_{referenced,used_between,referenced_between}_p: Likewise.
- ({reg_set,modified,no_labels}_between_p, modified_in_p): Likewise.
- (reg_set_p, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
- (note_stores, rtx_equal_p, dead_or_set{,_regno}_p): Likewise.
- (remove_note, side_effects_p, volatile_{refs,insn}_p): Likewise.
- (may_trap_p, inequality_comparison_p): Likewise.
- * rtlanal.c (note_stores, reg_set_p): Don't declare.
- (rtx_addr_can_trap_p): Add prototype, make static.
- (reg_set_p_1): Add declaration for parameter pat.
- * emit-rtl.c: Include recog.h.
- * integrate.c: Likewise.
- * jump.c: Likewise.
- * unroll.c: Likewise.
- * Makefile.in (emit-rtl.o, integrate.o, jump.o, unroll.o): Depend
- on recog.h.
-
-Fri Sep 19 06:52:22 1997 Paul Eggert <eggert@twinsun.com>
-
- * enquire.c (SYS_FLOAT_H_WRAP): New macro.
- Include "float.h" if SYS_FLOAT_H_WRAP is nonzero.
- (f_define): New argument `req'.
- (main): Output `#include_next <float.h>' if wrapping float.h.
- (i_define, f_define): Don't output anything if wrapping float.h
- and if the system defn is already correct. Put other value tests
- inside `#ifdef VERIFY'.
- (UNDEFINED): New macro.
- (I_MAX, I_MIN, U_MAX, F_RADIX, F_MANT_DIG, F_DIG, F_ROUNDS):
- Define even if VERIFY isn't defined, because SYS_FLOAT_H_WRAP may need
- these values. Give them the value UNDEFINED if not already defined.
- (F_EPSILON, F_MIN_EXP, F_MIN, F_MIN_10_EXP, F_MAX_EXP): Likewise.
- (F_MAX, F_MAX_10_EXP): Likewise.
- (FPROP): Prefer system float.h definition of F_ROUNDS.
- Pass system values to f_define.
- * Makefile.in (FLOAT_H_TEST): New var.
- (float.h-nat): Make it empty if we can use the system float.h without
- change.
- (enquire.o): Define SYS_FLOAT_H_WRAP=1 if we can build a wrapper
- around the system <float.h>. Remove include/float.h before compiling.
- (stmp-headers): Remove include/float.h if we would just be installing
- an empty file (which is a placeholder that stands for no file).
-
- * fix-header.c: Don't munge headers for POSIX and XOPEN,
- as this is too error-prone.
- (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): New macros, normally undefed.
- (POSIX1_SYMBOL, POSIX2_SYMBOL): Now 0 unless ADD_MISSING_POSIX.
- (XOPEN_SYMBOL, XOPEN_EXTENDED_SYMBOL): Now 0 unless ADD_MISSING_XOPEN.
- (main): Ignore symbols whose flags are 0.
-
-Thu Sep 18 10:43:07 1997 Nick Clifton <nickc@cygnus.com>
-
- * v850.c (compute_register_save_size): Correct register number.
- * v850.md (save_interrupt, return_interrupt): Likewise.
- * v850/lib1funcs.asm (save_interrupt): Likewise.
- (return_interrupt): Use stack pointer, not element pointer.
-
-Thu Sep 18 14:22:22 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * final.c (final_scan_insn): Hand BARRIERs to dwarf2 code.
- * dwarf2out.c (dwarf2out_frame_debug): Pass the whole insn along.
- (dwarf2out_stack_adjust): A BARRIER resets the args space to 0.
-
- * except.c (end_eh_unwinder): Subtract 1 from return address.
- * libgcc2.c (__throw): Likewise.
- (find_exception_handler): Don't change PC here. Compare end with >.
-
-Thu Sep 18 14:01:20 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * configure.in: Make sure to create the stage* and include
- symbolic links in each subdirectory.
-
-Thu Sep 18 13:20:37 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh/lib1funcs.asm (LOCAL): Define.
- (whole file): Use it.
-
-Thu Sep 18 09:52:24 1997 Benjamin Kosnik <bkoz@beauty.cygnus.com>
-
- * collect2.c (collect_execute): Specify name of new file when
- redirecting stdout/stderr.
-
-Thu Sep 18 01:47:06 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (reload_peepholes): Don't allow addresses with side
- effects for the memory operand.
-
-Wed Sep 17 18:19:53 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (find_exception_handler): Subtract one from our PC when
- looking for a handler, to avoid hitting the beginning of the next
- region.
-
- * except.c (expand_builtin_set_return_addr_reg): Use force_operand.
-
-Wed Sep 17 18:23:09 1997 Jeffrey A Law (law@cygnus.com)
-
- * mips/abi64.h (LONG_MAX_SPEC): Define.
- * mips.h (LONG_MAX_SPEC): Define.
- (CPP_SPEC): Include long_max_spec.
- (EXTRA_SPECS): Include long_max_spec.
-
-Wed Sep 17 14:17:26 1997 Paul Eggert <eggert@twinsun.com>
-
- * configure.in (AC_CHECK_HEADERS): Add inttypes.h, limits.h.
- ({sparc,i[3456]86,powerpcle}-*-solaris2*): Use fixinc.math.
-
- * fixinc.math (PWDCMD, ORIGDIR, LINKS): Remove.
- Remove duplicate test for missing $1.
- Don't cd to $INPUT.
- Build wrapper around system <math.h> instead of copying it;
- this is better if the system <math.h> is updated later by a software
- patch or upgrade.
-
- * cccp.c (HAVE_STDLIB_H, HAVE_UNISTD_H):
- Do not define any more; now autoconfed.
- <limits.h>: Include if HAVE_LIMITS_H.
- (HOST_BITS_PER_WIDE_INT): Remove.
- (HOST_WIDE_INT): Use intmax_t or long long if available.
- (pcfinclude): Use size_t, not HOST_WIDE_INT, for cast from pointer;
- this is less likely to annoy the compiler.
-
- * cexp.y (HAVE_STDLIB_H): Do not define any more; now autoconfed.
- <limits.h>: Include if HAVE_LIMITS_H.
- (HOST_WIDE_INT): Use intmax_t or long long if available.
- (unsigned_HOST_WIDE_INT, CHAR_BIT): New macros.
- (HOST_BITS_PER_WIDE_INT): Define in terms of CHAR_BIT and sizeof.
- (MAX_CHAR_TYPE_MASK, MAX_CHAR_TYPE_MASK): Rewrite so that we don't use
- HOST_BITS_PER_WIDE_INT in a preprocessor expression, since it now
- uses sizeof.
-
- * cppexp.c: <limits.h>: Include if HAVE_LIMITS_H.
- (HOST_WIDE_INT): Use intmax_t or long long if available.
- (CHAR_BIT): New macro.
- (HOST_BITS_PER_WIDE_INT): Define in terms of CHAR_BIT and sizeof.
- * cpplib.c: <limits.h>: Include if HAVE_LIMITS_H.
- (HOST_WIDE_INT): Use intmax_t or long long if available.
- (HOST_BITS_PER_WIDE_INT): Remove.
-
-Wed Sep 17 14:11:38 1997 Jeffrey A Law (law@cygnus.com)
-
- * v850.c (construct_save_jarl): Fix thinko in last change.
-
-Wed Sep 17 15:04:19 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/sysv4.h (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Delete,
- use sparc.h's copies.
- * sparc.h (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Print ascii form
- as well.
-
-Wed Sep 17 14:08:20 1997 Nick Burrett <nick.burrett@btinternet.com>
-
- * explow.c (allocate_dynamic_stack_space): Make allocate_stack
- pass 'target' as an extra operand.
- * expr.c (expand_builtin_apply): Use allocate_dynamic_stack_space
- to push a block of memory onto the stack.
- * alpha.md (allocate_stack): Alter in accordance with new operand.
- * i386.md (allocate_stack): Likewise.
- * rs6000.md (allocate_stack): Likewise.
-
-Wed Sep 17 13:34:43 1997 Robert Lipe <robertl@dgii.com>
-
- * i386/xm-sco5.h (sys_siglist, SYS_SYGLIST_DECLARED): Define.
-
-Wed Sep 17 13:27:05 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (native): Correct dependency to auto-config.h from
- config.h.
-
-Tue Sep 16 10:02:02 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c (find_exception_handler): Not found is -1.
-
- * integrate.c (expand_inline_function): Move expand_start_bindings
- after expanding the arguments.
-
- * i386.c (ix86_prologue): Pass SYMBOL_REF to
- gen_prologue_{get_pc,set_got}.
- * i386.md (prologue_set_got, prologue_get_pc): Adjust.
-
-Tue Sep 16 07:33:15 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * fold-const.c (make_range): Correctly handle cases of converting
- from unsigned to signed type.
-
- * function.c (flush_addressof): New function.
-
- * combine.c (num_sign_bit_copies): If asking about wider mode,
- treat like paradoxical subreg.
-
-Tue Sep 16 00:26:52 1997 Jeffrey A Law (law@cygnus.com)
-
- * cse.c (simplify_relational_operation): If MODE specifies mode wider
- than HOST_WIDE_INT, high word of CONST_INT is derived from sign bit
- of low word.
-
-Tue Sep 16 00:13:20 1997 Nick Clifton <nickc@cygnus.com>
-
- * v850.c ({register,pattern}_is_ok_for_epilogue): New functions.
- (construct_{save,restore}_jr, pattern_is_ok_for_prologue): Likewise.
- * v850.h (pattern_is_ok_for_{pro,epi}logue): New predicates.
- (register_is_ok_for_epilogue): Likewise.
- * v850.md: Replace prologue and epilogue patterns with a
- match_parallel pattern.
- * v850.c (output_move_single_unsigned): Cope with zero
- extending and moving between registers at the same time.
-
-Mon Sep 15 22:02:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * fixinc.math: New file to fix math.h on some systems.
- * configure.in (*-*-freebsd*, *-*-netbsd*): Use fixinc.math on these
- systems.
-
-Mon Sep 15 18:58:36 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sched.c (update_flow_info) When looking if to set found_split_dest
- or found_orig_dest, look at all parts of a PARALLEL.
-
- * sh.md (casesi_0): Reduce functionality, exclude insns from
- mova onwards. Changed expander caller.
- (casesi_worker_0): New insn.
- (casesi_worker_0+[12]): New define_splits.
- (casesi_worker): Need no gen_* function.
- (casesi): Use casesi_worker_0 instead of casesi_worker.
- * sched.c (update_flow_info): Don't pass SCRATCH to dead_or_set_p.
-
-Mon Sep 15 11:43:38 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- Support dwarf2 unwinding on PUSH_ROUNDING targets like the x86.
- * dwarf2.h: Add DW_CFA_GNU_args_size.
- * frame.c (execute_cfa_insn): Likewise.
- * dwarf2out.c (dwarf_cfi_name, output_cfi): Likewise.
- (dwarf2out_args_size, dwarf2out_stack_adjust): New fns.
- (dwarf2out_frame_debug): If this isn't a prologue or epilogue
- insn, hand it off to dwarf2out_stack_adjust.
- (dwarf2out_begin_prologue): Initialize args_size.
- * frame.h (struct frame_state): Add args_size.
- * libgcc2.c (__throw): Use args_size.
- * final.c (final_scan_insn): If we push args, hand off all insns
- to dwarf2out_frame_debug.
- * defaults.h (DWARF2_UNWIND_INFO): OK for !ACCUMULATE_OUTGOING_ARGS.
-
- * dwarf2out.c (dwarf2out_frame_debug): Fix typo.
- Handle epilogue restore of SP from FP.
- * emit-rtl.c (gen_sequence): Still generate a sequence if the
- lone insn has RTX_FRAME_RELATED_P set.
-
- * frame.c (extract_cie_info): Handle "e" augmentation.
- * dwarf2out.c (ASM_OUTPUT_DWARF_*): Provide definitions in the
- absence of UNALIGNED_*_ASM_OP.
- (UNALIGNED_*_ASM_OP): Only provide defaults if OBJECT_FORMAT_ELF.
- (output_call_frame_info): Use "e" instead of "z" for augmentation.
- Don't emit augmentation fields length.
- (dwarf2out_do_frame): Move outside of #ifdefs.
- * defaults.h (DWARF2_UNWIND_INFO): Don't require unaligned data
- opcodes.
-
- * sparc.h (UNALIGNED_INT_ASM_OP et al): Don't define here after all.
- * sparc/sysv4.h (UNALIGNED_INT_ASM_OP): Define here.
- * sparc/sunos4.h (DWARF2_UNWIND_INFO): Define to 0.
- * sparc/sun4gas.h: New file.
- * configure.in: Use sun4gas.h if SunOS 4 --with-gnu-as.
-
- * collect2.c (write_c_file_stat, write_c_file_glob): Declare
- __register_frame_table and __deregister_frame.
-
-Mon Sep 15 19:04:34 1997 Brendan Kehoe <brendan@cygnus.com>
-
- * except.c (find_exception_handler_labels): Use xmalloc instead of
- alloca, since MAX_LABELNO - MIN_LABELNO can be more than 1 million
- in some cases.
-
-Sat Sep 13 23:13:51 1997 Paul Eggert <eggert@twinsun.com>
-
- * cpplib.h (PARAMS): Fix misspelling of __STDC__.
- (cpp_get_token): Arg is cpp_reader *, not struct parse_marker *.
-
- * cpplib.c (cpp_fatal, cpp_file_line_for_message): New decls.
- (ppp_hash_cleanup, cpp_message, cpp_print_containing_files): Likewise.
- (copy_rest_of_line): Fix typo that prevented recognition of
- C++ style comments.
- (output_line_command, special_symbol): Use %ld for long, not %d.
-
- * cppexp.c (xrealloc): Declare first arg as void *, not char *.
- (cpp_lex): Cast 2nd arg of cpp_parse_escape from const char ** to
- char **.
-
-Fri Sep 12 16:54:04 1997 Doug Evans <dje@cygnus.com>
-
- * bitmap.h (bitmap_print): Don't use STDIO_PROTO.
-
-Fri Sep 12 13:49:58 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.h: Prototype dwarf2 hooks.
- * expr.c: Adjust.
-
-Thu Sep 11 18:36:51 1997 Jim Wilson <wilson@cygnus.com>
-
- * local-alloc.c (contains_replace_regs): New function.
- (update_equiv_regs): When adding a REG_EQUIV note for a set of a MEM,
- verify that there is no existing REG_EQUIV note, and add a call to
- contains_place_regs.
-
- * m68k.h (MACHINE_STATE_{SAVE,RESTORE}): Add __HPUX_ASM__ versions.
-
-Wed Sep 10 21:49:38 1997 Michael Meissner <meissner@cygnus.com>
-
- * toplev.c (rest_of_compilation): For passes starting with
- flow_analysis, use print_rtl_with_bb instead of print_rtl.
- * print-rtl.c (print_rtl_single): Print a single rtl value to a
- file.
- * flow.c (print_rtl_with_bb): Print which insns start and end
- basic blocks. For the start of a basic block, also print the live
- information.
- * bitmap.h (EXECUTE_IF_AND_IN_BITMAP): New macro, to iterate over
- two bitmaps ANDed together.
- (bitmap_print): Declare.
- * bitmap.c (function_obstack): Don't declare any more.
- (bitmap_obstack): Obstack for allocating links from.
- (bitmap_obstack_init): New static to say whether to initialize
- bitmap_obstack.
- (bitmap_element_allocate): Use bitmap_obstack to allocate from.
- (bitmap_release_memory): Free all memory allocated from
- bitmap_obstack.
- (toplevel): Conditionally include stdlib.h.
- (free): Provide a declaration if NEED_DECLARATION_FREE.
-
- * basic-block.h (EXECUTE_IF_AND_IN_REG_SET): New macro, invoke
- EXECUTE_IF_AND_IN_BITMAP.
-
-Wed Sep 10 17:53:33 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (addr_diff_vec_adjust): Properly propagate considered
- address changes through alignments.
-
-Wed Sep 10 13:10:52 1997 Per Bothner <bothner@cygnus.com>
-
- * stor-layout.c (layout_type): Simplify special BOOLEAN_TYPE handling.
-
-Wed Sep 10 12:59:57 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (expand_builtin): Only support __builtin_dwarf_fp_regnum()
- if DWARF2_UNWIND_INFO.
-
-Wed Sep 10 15:43:10 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c (demangle_fund_type): Change "complex" to "__complex".
-
-Wed Sep 10 11:13:53 1997 Paul Eggert <eggert@twinsun.com>
-
- Handle `extern int errno;' correctly when fixing <errno.h>.
- * fix-header.c (recognized_extern): Use name_length when comparing.
- * scan-decls.c (scan_decls): Don't ignore the first CPP_NAME in a
- declaration, so that we see the `extern' in `extern int errno;'.
-
-Wed Sep 10 11:49:20 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- Add support for exception handling using DWARF 2 frame unwind info.
- * libgcc2.c (get_reg, put_reg, get_return_addr, put_return_addr,
- next_stack_level, in_reg_window): Helper fns.
- (__throw): Implement for DWARF2_UNWIND_INFO.
-
- * expr.c (expand_builtin): Handle builtins used by __throw.
- * tree.h (enum built_in_function): Add builtins used by __throw.
- * c-decl.c (init_decl_processing): Declare builtins used by __throw.
- * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Used by __throw.
- * except.c (expand_builtin_unwind_init): Hook for dwarf2 __throw.
- (expand_builtin_extract_return_addr): Likewise.
- (expand_builtin_frob_return_addr): Likewise.
- (expand_builtin_set_return_addr_reg): Likewise.
- (expand_builtin_eh_stub): Likewise.
- (expand_builtin_set_eh_regs): Likewise.
- (eh_regs): Choose two call-clobbered registers for passing back values.
-
- * frame.c, frame.h: New files for parsing dwarf 2 frame info.
- * Makefile.in (LIB2ADD): New variable. Add $(srcdir)/frame.c.
- (libgcc2.a): Use it instead of $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
- (stmp-multilib): Likewise.
- ($(T)crtbegin.o, $(T)crtend.o): Add -fno-exceptions.
-
- * except.c: #include "defaults.h".
- (exceptions_via_longjmp): Default depends on DWARF2_UNWIND_INFO.
- (emit_throw): Don't defeat assemble_external if DWARF2_UNWIND_INFO.
- (register_exception_table_p): New fn.
- (start_eh_unwinder): Don't do anything if DWARF2_UNWIND_INFO.
- (end_eh_unwinder): Likewise.
-
- * crtstuff.c: Wrap .eh_frame section, use EH_FRAME_SECTION_ASM_OP,
- call __register_frame and __deregister_frame as needed.
- * varasm.c (eh_frame_section): New fn if EH_FRAME_SECTION_ASM_OP.
- * dwarf2out.c (EH_FRAME_SECTION): Now a function-like macro. Check
- EH_FRAME_SECTION_ASM_OP.
- * sparc/sysv4.h (EH_FRAME_SECTION_ASM_OP): Define.
- * mips/iris6.h: (EH_FRAME_SECTION_ASM_OP): Define.
- (LINK_SPEC): Add __EH_FRAME_BEGIN__ to hidden symbols.
-
- * dwarf2out.c (output_call_frame_info): If no support for
- EXCEPTION_SECTION, mark the start of the frame info with a
- collectable tag.
- * collect2.c (frame_tables): New list.
- (is_ctor_dtor): Recognise frame entries.
- (scan_prog_file): Likewise.
- (main): Pass -fno-exceptions to sub-compile. Also do collection
- if there are any frame entries.
- (write_c_file_stat): Call __register_frame_table and
- __deregister_frame as needed.
- (write_c_file_glob): Likewise.
-
- * defaults.h (DWARF2_UNWIND_INFO): Default to 1 if supported.
- Also require unaligned reloc support.
- * sparc.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
- UNALIGNED_DOUBLE_INT_ASM_OP): Define here.
- * sparc/sysv4.h: Not here.
-
- * toplev.c (compile_file): Call dwarf2out_frame_{init,finish}.
- * dwarf2out.c (dwarf2out_init): Don't call dwarf2out_frame_init.
- (dwarf2out_finish): Don't call dwarf2out_frame_finish.
-
- * libgcc2.c (L_eh): Reorganize, moving code shared by different
- EH implementations to the top.
- (find_exception_handler): Split out. Start from 0. Compare against
- end with >=.
- (__find_first_exception_table_match): Use it.
- * except.c (output_exception_table): Don't do anything if there's
- no table. Don't output a first entry of zeroes.
- (eh_outer_context): Adjust properly.
- (add_eh_table_entry): Use xrealloc.
- * toplev.c (compile_file): Just call output_exception_table.
-
-Wed Sep 10 11:49:20 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (save_varasm_status): Take the target function context.
- * function.c (push_function_context_to): Pass it in.
-
- * rtl.def (ADDRESSOF): Add new field for original regno.
- * function.c (put_reg_into_stack and callers): Add original_regno
- argument.
- (gen_mem_addressof): Remember the original regno.
- * rtl.def (INLINE_HEADER): Add new field for parm_reg_stack_loc.
- * rtl.h (PARMREG_STACK_LOC): New macro.
- (ADDRESSOF_REGNO): New macro.
- * emit-rtl.c (gen_inline_header_rtx): Add parm_reg_stack_loc.
- * function.c (max_parm_reg, parm_reg_stack_loc): No longer static.
- (assign_parms): Allocate parm_reg_stack_loc on saveable obstack.
- * integrate.c (output_inline_function): Set max_parm_reg and
- parm_reg_stack_loc from inline header.
- (initialize_for_inline): Pass in parm_reg_stack_loc.
-
-Wed Sep 10 11:30:36 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (override_options): Don't set TARGET_SCHEDULE_PROLOGUE
- (ix86_expand_prologue, ix86_expand_epilogue): Emit rtl by default.
-
-Wed Sep 10 11:30:36 1997 Jason Merrill <jason@cygnus.com>
-
- * i386.c (ix86_prologue): Add dwarf2 support for !do_rtl case.
-
-Wed Sep 10 08:48:44 1997 Jeffrey A Law (law@cygnus.com)
-
- * xm-m88k.h (USG): Only define if it hasn't already been defined.
-
- * i386.h (CPP_CPU_DEFAULT): Avoid using #elif.
-
- * expr.c (do_jump_by_parts_equality_rtx): Don't clobber the
- source operand when performing an IOR of the parts.
-
- * expr.c (emit_block_move): Always return a value.
-
- * expr.c (clear_storage): Use CONST0_RTX instead of const0_rtx.
- when clearing non-BLKmode data.
-
- * final.c (shorten_branches): Remove last change for ADDR_VEC
- alignment computation. During first pass, assume worst
- possible alignment for ADDR_VEC and ADDR_VEC_DIFF insns.
-
-Wed Sep 10 09:33:19 1997 Kamil Iskra <iskra@student.uci.agh.edu.pl>
-
- * explow.c (emit_stack_save, emit_stack_restore): Correctly
- handle HAVE_{save,restore}_stack_* evaluating to 0.
-
-Wed Sep 10 09:27:45 1997 Weiwen Liu <liu@hepvms.physics.yale.edu>
-
- * Makefile.in (sdbout.o): Add dependency on insn-config.h.
-
-Wed Sep 10 09:24:56 1997 Nick Burrett <n.a.burrett@btinternet.com>
-
- * sched.c (birthing_insn_p): Rename prototype decl from birthing_insn.
- * final.c (leaf_renumber_regs, alter_cond): Declare prototype only
- if LEAF_REGISTERS is defined.
- * reload1.c (merge_assigned_reloads): Declare prototype only if
- SMALL_REGISTER_CLASSES is defined.
- * loop.c (replace_call_address): Pre-process out prototype decl.
- * real.c (dectoe, etodec, todec): Declare proto if DEC is defined
- (ibmtoe, etoibm, toibm): Declare proto if IBM is defined
-
-Wed Sep 10 09:13:51 1997 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (out_file): Emit definition to config.status.
-
-Wed Sep 10 08:37:56 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * final.c (shorten_branches): Fix alignment calculation.
- Don't count the lengths of deleted instructions.
-
-Wed Sep 10 08:34:11 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * cpplib.c (cpp_start_read): Make known_suffixes static.
-
-Wed Sep 10 08:27:05 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.c (print_operand_address) [MOTOROLA]: When compiling
- with -fpic (not -fPIC) force the GOT offset to 16 bits.
-
-Wed Sep 10 08:22:51 1997 Christian Iseli <chris@lslsun.epfl.ch>
-
- * expr.c (convert_move): Add missing use of trunctqtf2.
-
-Wed Sep 10 08:17:10 1997 Torbjorn Granlund <tege@pdc.kth..se>
-
- * except.c (eh_outer_context): Do masking using expand_and.
-
-Wed Sep 10 07:52:21 1997 Joel Sherrill <joel@OARcorp.com>
-
- * pa/rtems.h (subtarget_switches): Removed -mrtems subtarget_switch.
- * configure.in (sh*-*-rtems*): New target.
- * sh.h (TARGET_SWITCHES: Call SUBTARGET_SWITCHES.
- (SUBTARGET_SWITCHES): Provide default definition.
-
-Wed Sep 10 06:33:47 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386/mingw32.h ({LIB,LINK}_SPEC): Check for -mwindows, not -windows.
-
- * alpha/vms.h (ASM_OUTPUT_SECTION): Clear NAME if overlaid.
-
- * c-parse.in (unary_expr): Test DECL_C_BIT_FIELD, not DECL_BIT_FIELD.
- * c-typeck.c (default_conversion): Likewise.
-
- * tree.c (contains_placeholder_p, substitute_in_expr):
- Handle placeholders inside args of CALL_EXPR (and hence in TREE_LIST).
-
- * expr.c (expand_expr, case PLACEHOLDER_EXPR): Check all
- expressions in placeholder_list.
-
-Tue Sep 9 18:10:30 1997 Doug Evans <dje@cygnus.com>
-
- Add port done awhile ago for the ARC cpu.
- * arc.h, arc.c, arc.md, t-arc, xm-arc.h: New files.
- * arc/initfini.c, arc/lib1funcs.asm: New files.
- * ginclude/va-arc.h: New file.
- * ginclude/stdarg.h: Include va-arc.h ifdef __arc__.
- * ginclude/varargs.h: Likewise.
- * Makefile.in (USER_H): Add va-arc.h.
- * configure.in (arc-*-elf*): Recognize.
- * longlong.h: Add ARC support.
-
-Tue Sep 9 01:30:37 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips.h (DWARF_FRAME_REGNUM): Use the same numbering regardless of
- write_symbols.
-
-Mon Sep 8 15:15:11 1997 Nick Clifton <nickc@cygnus.com>
-
- * v850.h (ASM_SPEC): Pass on target processor.
- (CPP_PREDEFINES): Only define if not already specified.
- (TARGET_VERSION): Only define if not already specified.
- (MASK_CPU, MASK_V850, MASK_DEFAULT): Bits to specify target
- processor.
- (EXTRA_SWITCHES): Extra entries in the switches array.
- (TARGET_DEFAULT): Set default target processor.
-
-Tue Sep 9 09:50:02 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (alpha*-*-*): Support pca56 and ev6.
-
- * varasm.c (named_section): Set in section after writing directive.
- * dwarf2out.c (output_call_frame_info): Call named_section.
-
-Mon Sep 8 16:32:43 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips.c (function_prologue): Set up the CFA when ABI_32.
-
- * sparc.c (save_regs): Check dwarf2out_do_frame instead of DWARF2_DEBUG
- for dwarf2 unwind info.
- (output_function_prologue, sparc_flat_output_function_prologue): Same.
-
- * final.c (final_end_function): Check dwarf2out_do_frame instead
- of DWARF2_DEBUG for dwarf2 unwind info.
- (final_scan_insn): Likewise.
- (final_start_function): Likewise. Initialize dwarf2 frame debug here.
- (final): Not here.
-
- * expr.c (expand_builtin_return_addr): Only SETUP_FRAME_ADDRESSES if
- count > 0.
-
- * varasm.c (exception_section): Check EXCEPTION_SECTION first.
-
-Mon Sep 8 14:58:07 1997 Jim Wilson <wilson@cygnus.com>
-
- * toplev.c (main): Change #elif to #else/#ifdef
-
- * i386/t-sol2 (TARGET_LIBGCC2_CFLAGS): Define to -fPIC.
-
-Mon Sep 8 08:45:19 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.h (processor_type): Add EV6.
- ({TARGET,MASK}_BWX): Renamed from _BYTE_OPS.
- ({TARGET,MASK}_{CIX,MAX}): New macros.
- (MASK_CPU_EV5): Change bit number.
- (MASK_CPU_EV6, {TARGET,MASK}_SUPPORT_ARCH): New macros.
- (TARGET_OPTIONS): Rename "byte" to "bwx" and add "cix" and "max".
- (MINIMUM_ATOMIC_ALIGNMENT): Rename TARGET_BYTE_OPS to TARGET_BWX.
- (SECONDARY_{INPUT,OUTPUT}_RELOAD_CLASS, ASM_FILE_START): Likewise.
- (SECONDARY_MEMORY_NEEDED): Not needed if CIX.
- (ASM_FILE_START): Only write if TARGET_SUPPORT_ARCH.
- Add "pca56" and "ev6".
- * alpha.c (input_operand): Rename TARGET_BYTE_OPS to TARGET_BWX.
- (override_options): Likewise; also add new CPU types and subset flags.
- * alpha.md: Rename TARGET_BYTE_OPS to TARGET_BWX.
- (cpu attr): Add "ev6".
- (ev5 function units): Use for ev6 as well, for now.
- (ffsdi2): New define_expand and define_insn, for TARGET_CIX.
- (sqrt[sd]f2): New patterns, for TARGET_CIX.
- (s{min,max}[qh]i3): New patterns, for TARGET_MAX.
- (movsi): Use ldf/lsf when appropriate, instead of lds/sts.
- (mov[sd]i): Add use of ftio/itof for TARGET_CIX.
- * configure.in (alpha*-dec-osf*): Set MASK_SUPPORT_ARCH for >= 4.0B.
- Rename MASK_BYTE_OPS to MASK_BWX.
-
- * i386/mingw32.h (STANDARD_INCLUDE_DIR): New macros.
- (STARTFILE_SPEC, PATH_SEPARATOR): Likewise.
-
- * configure.in (AC_PROG_LN_S): Remove; unneeded.
- (*cygwin32*, *mingw32*): Default prefix to /usr.
- (symbolic_link): Set to "cp -p" if no "ln -s"; add AC_SUBST.
- (configure.lang call): Change remaining use of config.h to auto-conf.h.
-
- * Makefile.in (LN): Add new symbol.
- (FLAGS_TO_PASS): Pass it down.
- (stage[1-4]-start): Use $(LN), not "ln -s".
-
- * mips.h (flag_omit_frame_pointer, frame_pointer_needed, optimize):
- Remove declarations: no longer needed.
- * pyr.md: Remove unneeded declarations of `optimize'.
- * h8300.md: Likewise.
- * sparc.c (dwarf2out_cfi_label): Add declaration.
- (save_regs, output_function_prologue): Remove cast for it.
- (sparc_flat_{save_restore,output_function_prologue): Likewise.
- ({save,restore}_regs): No longer inline.
-
-Mon Sep 8 03:08:35 1997 Jim Wilson <wilson@cygnus.com>
-
- * i960.h (LINK_SPEC): Handle -mjX and -mrp switches.
-
- * mips.md (nonlocal_goto_receiver): Define.
-
- * unroll.c (calculate_giv_inc): Handle increment with code PLUS.
-
- * alpha.h (PREFERRED_RELOAD_CLASS): Return NO_REGS if NO_REGS
- is passed in.
- * emit-rtl.c (gen_lowpart_common): Add code to convert CONST_INT to
- SFmode for 64 bit hosts.
-
- * profile.c (output_arc_profiler): Verify next_insert_after is an
- INSN before and after skipping a stack pop. Check next_insert_after
- for non NULL before deferencing it.
- (output_func_start_profiler): Set DECL_EXTERNAL to zero.
-
- * va-mips.h: Add _VA_MIPS_H_ENUM ifdef/define/endif.
-
- * m68k.md (iorsi_zexthi_ashl16): Disable.
-
- * varasm.c (mark_constants): Don't look inside CONST_DOUBLEs.
-
-Sun Sep 7 18:30:46 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (dwarf2out_frame_debug): Assume that in a PARALLEL
- prologue insn, only the first elt is significant.
- (output_call_frame_info): For exception handling, always use 4-byte
- fields as specified by the dwarf2 spec.
- Don't skip trivial FDEs.
-
-Sun Sep 7 03:35:28 1997 Paul Eggert <eggert@twinsun.com>
-
- * fix-header.c (std_include_table): Remove bogus entry for popen
- under stdio.h with ANSI_SYMBOL. popen is a POSIX2_SYMBOL.
-
-Fri Sep 5 17:19:58 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (movsf_ie+1): Typo fix.
-
-Fri Sep 5 10:08:44 1997 Jeffrey A Law (law@cygnus.com)
-
- * v850: New directory for v850 port.
- * v850/lib1funcs.asm: New file.
- * t-v850, v850.c, v850.h, v850.md, xm-v850.h: New files.
- * ginclude/va-v850.h: New file.
- * varargs.h, stdarg.h: Include va-mn10200.h.
- * configure.in (mn10200-*-*): New target.
- * Makefile.in (USER_H): Add va-mn10200.h.
-
- * xm-svr4.h (SYS_SIGLIST_DECLARED): Define.
- * mips/xm-news.h (SYS_SIGLIST_DECLARED): Define.
- * mips/xm-sysv4.h (SYS_SIGLIST_DECLARED): Define.
-
-Fri Sep 5 03:50:15 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.md (fma patterns): Extend previous -mno-fused-madd
- patch to DFmode patterns inadvertently omitted.
-
-Thu Sep 4 20:06:02 1997 Christian Kuehnke <Christian.Kuehnke@arbi.Informatik.Uni-Oldenburg.DE>
-
- * sparc.md: Add ultrasparc scheduling support.
- * sparc.h (RTX_COSTS): For MULT give v9 a cost of 25 insns.
-
-Wed Sep 3 20:56:24 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP): Define.
-
-Wed Sep 3 20:52:07 1997 Joel Sherrill <joel@OARcorp.com>
-
- * sh/rtems.h: New file.
-
-Wed Sep 3 17:30:36 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * reg-stack.c (subst_stack_regs): Pop the stack register for a
- computed goto which sets the same stack register.
-
-Wed Sep 3 17:30:36 1997 Jim Wilson <wilson@cygnus.com>
-
- * i386.c (ix86_expand_epilogue): Emit blockage instruction when pic.
-
-Wed Sep 3 11:25:19 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (reload peepholes): Fix typo in last change.
-
-Wed Sep 3 03:02:02 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (movsi_ie): Move t/r alternative after r/r alternative.
-
-Tue Sep 2 18:41:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * cccp.c (sys_errlist): Remove special 4.4bsd declaration.
- * collect2.c (sys_errlist): Likewise.
- * cpplib.c (sys_errlist): Likewise.
- * gcc.c (sys_errlist): Likewise.
- * protoize.c (sys_errlist): Likewise.
- * configure.in: Check for strerror.
- * xm-freebsd.h (HAVE_STRERROR): Remove definition.
- * xm-gnu.h (HAVE_STRERROR): Likewise.
- * xm-linux.h (HAVE_STRERROR): Likewise.
- * xm-netbsd.h (HAVE_STRERROR): Likewise.
- * alpha/xm-linux.h (HAVE_STRERROR): Likewise.
- * i386/xm-bsd386.h (HAVE_STRERROR): Likewise.
- * i386/xm-cygwin32.h (HAVE_STRERROR): Likewise.
- * i386/xm-dos.h (HAVE_STRERROR): Likewise.
- * i386/xm-mingw32.h (HAVE_STRERROR): Likewise.
- * pa/xm-pa.h (HAVE_STRERROR): Likewise.
- * pa/xm-papro.h (HAVE_STRERROR): Likewise.
- * rs6000/xm-cygwin32.h (HAVE_STRERROR): Likewise.
- * rs6000/xm-sysv4.h (HAVE_STRERROR): Likewise.
-
- * collect2.c (SYS_SIGLIST_DECLARED): Renamed from
- DONT_DECLARE_SYS_SIGLIST.
- * mips-tfile.c (SYS_SIGLIST_DECLARED): Likewise.
- * xm-linux.h (DONT_DECLARE_SYS_SIGLIST): Delete definition.
- * xm-freebsd.h (DONT_DECLARE_SYS_SIGLIST): Likewise.
- * alpha/xm-linux.h (DONT_DECLARE_SYS_SIGLIST): Delete definition.
- * i386/xm-bsd386.h (DONT_DECLARE_SYS_SIGLIST): Likewise.
- * i386/xm-sysv4.h (DONT_DECLARE_SYS_SIGLIST): Likewise.
- * mips/xm-sysv4.h (DONT_DECLARE_SYS_SIGLIST): Likewise.
- * rs6000/xm-sysv4.h (DONT_DECLARE_SYS_SIGLIST): Likewise.
- * sparc/xm-sol2.h (DONT_DECLARE_SYS_SIGLIST): Likewise.
- * configure.in: Check for sys_siglist declaration.
-
- * Makefile.in (libgcc2.a): Add missing "else true" clause.
- (stage{1,2,3,4}-start): Likewise.
-
- * mn10200.h (INITIALIZE_TRAMPOLINE): PC relative instructions
- are relative to the next instruction, not the current instruction.
-
-Tue Sep 2 14:15:32 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (xrealloc): Handle null ptr.
-
-Tue Sep 2 13:42:38 1997 Paul N. Hilfinger <hilfingr@CS.Berkeley.EDU>
-
- * fixincludes: Permits spaces between # and define. Discard C++
- comments in sys/pci.h on HP/UX 10.20.
-
-Tue Sep 2 09:28:31 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * rs6000.h (ROUND_TYPE_ALIGN): Don't blow up if no fields in record.
-
-Tue Sep 2 00:19:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (expand_expr, case COND_EXPR): It's OK to merge two
- SAVE_EXPRs.
-
-Mon Sep 1 23:36:45 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (restore_unscaled_index_insn_codes): New function.
- (record_unscaled_index_insn_codes): Likewise.
- (output_function_prologue): Call restore_unscaled_index_insn_codes.
- (output_function_epilogue): Free memory for unscaled_index_insn_codes.
- (pa_reorg): Call record_unscaled_index_insn_codes.
-
-Mon Sep 1 14:46:09 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (casesi_jump_1, casesi_jump2): Generate expanders.
- (casesi_jump): Delete.
- (casesi) Use gen_casesi_jump_1 and gen_casesi_jump2 instead of
- gen_casesi_jump.
-
-Mon Sep 1 14:36:36 1997 Paul Eggert <eggert@twinsun.com>
-
- * sparc/sol2.h (CPP_SPEC): Add -D__STDC__=0 unless -ansi
- or -traditional, for compatibility with Sun's practice.
- * i386/sol2.h (CPP_SPEC), rs6000/sol2.h (CPP_SPEC): Likewise.
- * configure.in ({sparc,i[3456]86,powerpcle}-*-solaris2*):
- Set fixincludes=Makefile.in.
-
-Mon Sep 1 14:08:23 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * Makefile.in (config.status): Depend on version.c.
-
-Mon Sep 1 13:48:02 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * acconfig.h: Remove include of config2.h.
- * configure.in: Build auto-config.h, not config.h, from autoconf data.
- Add auto-conf.h in front of all other host_xm_file entries.
- Make config.h, not config2.h, from host_xm_file.
- * Makefile.in (auto-config.h): New rule; was config.h.
- (distclean): Remove auto-config.h, not config2.h.
-
- * expr.c (do_jump_by_parts_equality_rtx): Try to do by IOR of
- all the words.
-
-Mon Sep 1 13:07:36 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * sparc/t-vxsparc (TARGET_LIBGCC2_CFLAGS): New definition.
- (LIBGCC2_CFLAGS): Deleted.
- * m68k/t-vxworks68: Likewise.
- * i960/t-vxworks960: Likewise.
- * a29k/t-vx29k: Likewise.
-
-Sun Aug 31 17:12:27 1997 Paul Eggert <eggert@twinsun.com>
-
- * real.c (EMULONG): Correct typo in spelling of HOST_BITS_PER_LONGLONG.
-
-Fri Aug 29 16:13:51 1997 Jeffrey A Law (law@cygnus.com)
-
- * mips.md (movstrsi_internal[23]): Set insn type to "store" to
- get more accurate schedules.
-
- * pa.md (reload_peepholes): Make sure operand is a REG before
- examining REGNO. Allow general registers too.
-
-Thu Aug 28 12:34:56 1997 Doug Evans <dje@seba.cygnus.com>
-
- * reload1.c (reload_cse_no_longer_dead): Don't pass incremented regno
- to SET_HARD_REG_BIT, it can be evaluated twice.
-
-Wed Aug 27 20:15:53 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh/elf.h: (LINK_SPEC): Use shlelf.
- (USER_LABEL_PREFIX, LOCAL_LABEL_PREFIX, ASM_FILE_START): Redefine.
- * sh/lib1funcs.asm (___ashrsi3, ___ashlsi3, ___lshrsi3):
- Truncate shift count. Use braf if not SH1.
- * sh.c (sfunc_uses_reg): No longer static.
- Check for SImode inside the USE.
- (shiftcosts, expand_ashiftrt, shl_sext_kind):
- Use SH_DYNAMIC_SHIFT_COST.
- (sh_dynamicalize_shift_p, output_branchy_insn): New functions.
- (output_ieee_ccmpeq, mova_p, cache_align_p, fixup_aligns): Likewise.
- (branch_offset, short_cbranch_p, med_branch_p): Likewise.
- (braf_branch_p, align_length, fixup_addr_diff_vecs): Likewise.
- (addr_diff_vec_adjust, get_dest_uid, gen_far_branch): Likewise.
- (split_branches, regs_used, gen_block_redirect): Likewise.
- (from_compare): Can't compare non-zero DImode constant directly.
- Emit special code for TARGET_SH3E floating point with code == GE.
- Force 0.0 into a register for SH3E.
- (print_operand): Add ','.
- Emit the actual comparison instruction.
- (sh_builtin_saveregs): Save floating point registers in order that
- allows pre-decrement.
- (find_barrier): New arguments num_mova and mova. Changed caller.
- When rewinding to before a mova, also restore the last found barrier.
- Branch is now known to be shortened.
- Prefer barriers where no new alignment is needed.
- More generic alignment for cache lines.
- Add checks for pieces of code that use more table space than their
- own size.
- Fix up the barrier we return so that the alignment will always be
- after the table.
- Remove limit adjustments for table alignment.
- Handle PARALLELs correctly.
- (machine_dependent_reorg): Add extra pass to split insns.
- Don't scan instructions twice for broken moves.
- Calculate insn length, call fixup_addr_diff_vecs.
- Call split_branches.
- Add alignment for loops and after BARRIERs.
- Initialize max_uid_before_fixup_addr_diff_vecs.
- Advance mdep_reorg_phase.
- Clear insn_addresses.
- (output_far_jump): Use braf and/or pre-allocated scratch register
- when possible.
- (expand_ashiftrt): Truncate shift count.
- (push_regs): Push PR last.
- (sh_expand_epilogue): Pop PR first.
- (code_for_indirect_jump_scratch, mdep_reorg_phase): New variables.
- (uid_align, uid_align_max): Likewise.
- (max_uid_before_fixup_addr_diff_vecs, sh_addr_diff_vec_mode): Likewise.
- (braf_label_ref_operand): New predicate.
- (initial_elimination_offset): calculate offset from
- RETURN_ADDRESS_POINTER_REGNUM starting with total_saved_regs_space.
- (output_branch): Expect out-of-range condbranches to have been split.
- * sh.md (rotlsi3_16): Named insn.
- (rotlsi3): Rewritten to use superoptimizer patterns.
- (adddi3, subdi3, ashrsi2_16, ashrsi2_31): Always split.
- (movsi_i, movsi_ie): replace t/z alternative with t/r alternative.
- Use pcload_si and load_si insn types.
- (adddi3+1, subdi3+1, ashrsi2_16+1, ashrsi2_31+1) New define_splits.
- (addc, subc, ashlsi_c): New insns.
- (attribute "type"): New values dyn_shift, load_si, pcload_si, fmove,
- jump_ind, arith3 and arith3b.
- (function_unit "fp"): Take fmove into account.
- (function_unit "int"): Uses one cycle for !dyn_shift.
- (function_unit "memory"): Special case for load_si and pcload_si.
- (attribute "in_delay_slot): handle pcload_si.
- (cmpgtdi_t, cmpgedi_t, cmpgeudi_t, cmpgtudi_t): Type arith3.
- (cmpsi+1, cmpeqdi_t) Type arith3b.
- (movsf_ie, alternatives f/fGH/X, f/y/X, y/f/X): Type fmove.
- (extendsidi2): Delete.
- (cmpeqsi_t-2): Delete. (Redundant with movt.)
- (*rotlhi3_8) Name.
- (iorsi3, rotlsi3_1, rotlsi3_31, rotlsi3_16, (*rotlhi3_8): Type arith.
- (ashlsi3_k, ashlhi3_ki, ashrsi2_16, ashrsi2_31, lshrsi3_m): Likewise.
- (lshrsi3_k, lshrhi3_m, lshrhi3_k, ashldi3_k, lshrdi3_k): Likewise.
- (ashrdi3_k, xtrct_left, xtrct_right, dect, mova, movt): Likewise.
- (movt): Likewise.
- (ashlsi3_d, ashrsi3_d, lshrsi3_d): Type dyn_shift.
- (indirect_jump_scratch, *casesi_jump_1, *casesi_jump_2): Type jump_ind.
- (ashlsi3, ashlsi3_n, lshrsi3, lshrsi3_n): Use sh_dynamicalize_shift_p.
- (movsf_ie+1, movsf_ie+2): Exchange.
- (cmpeqdi_t-1, cmpeqdi_t, cmpgtdi_t, cmpgedi_t): New insns.
- (cmpgeudi_t, cmpgtudi_t, movsi_i_lowpart, ieee_ccmpeqsf_t): Likewise.
- (cmpdi, movnegt): New define_expands.
- (movsi_ie): Add y,y alternative.
- (sge): Use it for ! TARGET_IEEE. Use special code for TARGET_IEEE.
- (sle): Use sge.
- (align_4, casesi_jump): Now define_expand.
- (casesi_0, addr_diff_vec_adjust, align_log): New patterns.
- (*casesi_jump_[12]): Likewise.
- (casesi): Use casesi_0 and casesi_jump.
- (casesi_worker): Depends on the mode used for the table.
- (define_delay for cbranches): Test TARGET_SH2.
- Changed all callers of from_compare.
- (attribute "length"): Take use of braf and scratch registers into
- account.
- (indirect_jump_scratch, block_branch_redirect): New patterns.
- (jump): Call output_far_jump for any jump larger than 4 bytes.
- (inverse_branch_true, inverse_branch_false): Remove.
- (bne, blt, ble, bltu, bleu): Canonicalize.
- (attribute "cpu"): Remove "sh0" alternative.
- * sh.h (ADJUST_COST): Lower cost of non-address sfunc dependencies.
- Adjust cost of load_si / pcload_si insns when not used for call.
- (enum reg_class): Move GENERAL_REGS after FPUL_REGS.
- (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Likewise.
- (REGISTER_MOVE_COST): Add costs for fpul <-> mac, pr moves.
- Fix to match default cost in regclass. Move to T reg not costly.
- When checking for GENERAL_REGS, check for R0_REGS too.
- (INITIALIZE_TRAMPOLINE): Include code for constant parts.
- (SHIFT_COUNT_TRUNCATED): Not true for TARGET_SH3.
- (CPP_SPEC): Define __sh1__ if no specific cpu is selected.
- (FUNCTION_BOUNDARY): Align to cache line boundary.
- (optimize, sh_addr_diff_vec_mode, machine_dependent_reorg): Declare.
- (addr_diff_vec_adjust, code_for_indirect_jump_scratch): Declare.
- (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Declare.
- (output_ieee_ccmpeq, output_branchy_insn, sfunc_uses_reg): Declare.
- (ASM_OUTPUT_ADDR_DIFF_ELT): Depends on sh_addr_diff_vec_mode.
- (PREDICATE_CODES): Add braf_label_ref_operand and register_operand.
- (IEEE_BIT, TAGET_IEEE, LOCAL_LABEL_PREFIX, ASSEMBLER_DIALECT): Define.
- (CACHE_LOG, enum mdep_reorg_phase_e, TRAMPOLINE_ALIGNMENT): Define.
- (SH_DYNAMIC_SHIFT_COST): Define.
- (TARGET_SWITCHES): Remove -m0 entry. Add -mieee, -mno-ieee.
- (OVERRIDE_OPTIONS): sh_cpu defaults to CPU_SH1.
- Initialize sh_addr_diff_vec_mode.
- (REG_ALLOC_ORDER): Move FP0 behind FP7.
- Move all FP registers in front of the general registers.
- (SECONDARY_OUTPUT_RELOAD_CLASS): Add case for MAC_REGS / PR_REGS.
- When checking for GENERAL_REGS, check for R0_REGS too.
- Fix direction of compares to {FIR,LA}ST_FP_REG.
- (SECONDARY_INPUT_RELOAD_CLASS): check for fp_one_operand.
- (ASM_OUTPUT_ALIGN_CODE, ASM_OUTPUT_LOOP_ALIGN, SH0_BIT): Delete.
- (TARGET_SH0, PUSH_ROUNDING, TRAMPOLINE_TEMPLATE): Delete.
- (TRAMPOLINE_ALIGN): Delete.
- (processor_type): Remove PROCESSOR_SH0.
- (ADJUST_INSN_LENGTH): Remove check for preceding BARRIER.
- Adjust ADDR_DIFF_VECs. Add code for alignment instructions.
- Check if insn needing a delay slot is already inside a SEQUENCE.
-
- * va-sh.h (__va_rounded_size): Delete.
- (__LITTLE_ENDIAN_P, __SCALAR_TYPE, __PASS_AS_FLOAT): Define.
- (va_arg): Unify big and little endian code.
- Optimization for small integers.
-
- From Fred Fish:
- * sh.h (INITIAL_ELIMINATION_OFFSET): Proper bracketing.
- (REGNO_REG_CLASS, PREFERRED_RELOAD_CLASS): Likewise.
- (SECONDARY_{OUTPUT,INPUT}_RELOAD_CLASS, LIBCALL_VALUE): Likewise.
- (ROUND_ADVANCE, FUNCTION_ARG, FUNCTION_ARG_PARTIAL_NREGS): Likewise.
- (FUNCTION_PROFILE, FUNCTION_EPILOGUE, RETURN_ADDR_RTX): Likewise.
- (REGNO_OK_FOR_INDEX_P, EXTRA_CONSTRAINT_Q, MODE_DISP_OK_4): Likewise.
- (GO_IF_LEGITIMATE_{INDEX,ADDRES}, LEGITIMIZE_ADDRESS): Likewise.
- (CONST_COSTS, REGISTER_MOVE_COST, ASM_OUTPUT_CONSTRUCTOR): Likewise.
- (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Likewise.
- (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP, ASM_OUTPUT_LABEL): Likewise.
- (ASM_OUTPUT_ALIGN), ASM_DECLARE_FUNCTION_NAME): Likewise.
- (ASM_GLOBALIZE_LABEL, ASM_OUTPUT_CASE_LABEL): Likewise.
- (ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT) Likewise.
- (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_INT): Likewise.
- (ASM_OUTPUT_SHORT, ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE): Likewise.
- (ASM_OUTPUT_SKIP, FINAL_PRESCAN_INSN, PRINT_OPERAND): Likewise.
- (PRINT_OPERAND_ADDRESS, HANDLE_PRAGMA, ADJUST_INSN_LENGTH): Likewise.
- (PROMOTE_MODE): Likewise.
- (ASM_GENERATE_INTERNAL_LABEL): Use LOCAL_LABEL_PREFIX.
- (ASM_OUTPUT_INTERNAL_LABEL): Use %L.
- * sh/elf.h: (ASM_OUTPUT_LABELREF): Use %U.
- (ASM_GENERATE_INTERNAL_LABEL): Use LOCAL_LABEL_PREFIX.
- (ASM_OUTPUT_INTERNAL_LABEL, ASM_OUTPUT_SOURCE_LINE): Use %L.
-
-Wed Aug 27 16:42:21 1997 Bob Manson (manson@cygnus.com)
-
- * t-h8300 (TARGET_LIBGCC2_CFLAGS): New definit.
- (LIBGCC2_CFLAGS): Deleted.
- * t-mn10200: Likewise.
-
-Wed Aug 27 17:10:51 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.md (iorsi3_internal): Readd ! TARGET_5200 check lost in
- last change.
-
-Wed Aug 27 15:19:55 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * dwarfout.c (dwarfout_start_new_source_file): Strip leading '*'s
- from label names.
-
-Wed Aug 27 14:33:38 1997 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (find_reloads, case '0'): Reject matching a non-offsettable
- address where an offsettable address is required.
-
-Wed Aug 27 10:38:32 1997 Jeffrey A Law (law@cygnus.com)
-
- * reorg.c (dbr_schedule): Allow current_function_return_rtx
- to be something other than a REG.
- * function.c (expand_function_end): Fix current_function_return_rtx
- if it was a pseudo.
-
- * t-freebsd (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS.
- * x-netbsd: Likewise
- * x-dgux (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS
- (INSTALL_HEADERS): Delete.
- * x-dguxbcs: Likewise.
- * x-hp3bsd44: Likewise
- * x-pa: Likewise.
-
-Wed Aug 27 07:15:58 1997 Klaus Espenlaub <kespenla@hydra.informatik.uni-ulm.de>
-
- * configure.in (AC_PROG_CC, AC_PROG_MAKE_SET): Check for gcc before
- testing for flex.
-
-Wed Aug 27 02:24:35 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarfout.c (dwarfout_file_scope_decl, case TYPE_DECL): Check
- TYPE_DECL_IS_STUB instead of DECL_NAME.
-
- * Makefile.in (install-info): Don't cd into srcdir. Add srcdir to
- filenames. Use sed to extract base filename for install.
-
-Wed Aug 27 01:56:18 1997 Doug Evans <dje@seba.cygnus.com>
-
- * loop.c (combine_movables): Earlier insns don't match later ones.
-
- * c-decl.c (grokdeclarator): If array index or size calculations
- overflow, issue an error.
- * fold-const.c (int_const_binop): New static function.
- (const_binop, size_binop): Call it.
-
-Tue Aug 26 17:51:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * collect2.c (main): Check SCAN_LIBRARIES instead of LDD_SUFFIX
- to decide whether to always emit init and fini handles.
-
-Tue Aug 26 13:51:10 1997 Jim Wilson <wilson@cygnus.com>
-
- * stor-layout.c (layout_record): Test DECL_PACKED instead of
- TYPE_PACKED to determine alignment.
-
- * combine.c (try_combine): Distribute REG_DEAD notes created for
- i3dest_killed similar to the ones created for i2dest_in_i2src
- and for i1dest_in_i1src.
-
-Tue Aug 26 11:36:34 1997 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (check_final_value): Don't miss a biv increment in a
- parallel.
-
- * loop.c (check_dbra_loop): If the loop biv is only used
- for counting, then normalize it so that the initial
- value is zero.
-
-Tue Aug 26 06:19:48 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarfout.c (*_LABEL): Add initial '*'.
-
-Tue Aug 26 05:27:28 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha/elf.h (LINK_SPEC): Conditionalize on USE_GNULIBC_1.
- * configure.in (alpha-*-linux-gnulibc1): New target.
- (alpha-*-linux-gnu*): Don't build crtbegin/end.
-
-Mon Aug 25 19:11:38 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * reload1.c (reload_cse_simplify_operands): Fix typo.
-
-Mon Aug 25 19:04:42 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-typeck.c (common_type): Always prefer long double to double.
-
-Mon Aug 25 08:55:00 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (secondary_reload_class): (mem (mem ... )) does not need
- secondary reloads.
-
- * pa.c (hppa_builtin_saveregs): Emit a blockage insn after the
- store of the argument registers.
-
-Sun Aug 24 21:25:06 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * reload1.c (reload_cse_mem_conflict_p, case MEM): Also check
- for conflict with the address.
-
-Sat Aug 23 18:43:22 1997 Jim Wilson <wilson@cygnus.com>
-
- * acconfig.h (NEED_DECLARATION_CALLOC): Add.
- * configure.in: Add GCC_NEED_DECLARATION call for calloc.
- * rs6000/xm-rs6000.h (malloc, realloc, calloc, free): Delete
- declarations.
-
- * m68k/m68kemb.h (LIB_SPEC): Add missing comment end before it.
- * m68k/next.h (GO_IF_INDEXABLE_BASE): Fix typo in undef.
-
-Sat Aug 23 00:18:22 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (pa_reorg): Always put begin_brtab and end_brtab insns
- around branch tables.
- * pa.md (begin_brtab, end_brtab): Only emit the .begin_brtab
- and .end_brtab directives if TARGET_GAS.
-
-Fri Aug 22 19:17:25 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * function.c (instantiate_virtual_regs_1, case ADDRESSOF):
- New case.
- (fix_lexical_addr): Handle (addressof (mem ...)).
-
-Thu Aug 21 17:56:06 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * reload.c (push_secondary_reload): If SECONDARY_MEM_NEEDED,
- call get_secondary_mem for input before adding reload and
- for output after.
- (push_reload): Likewise.
-
-Thu Aug 21 15:57:03 1997 Jim Wilson <wilson@cygnus.com>
-
- * stmt.c (start_cleanup_deferal, end_cleanup_deferal): Test
- block_stack before dereferencing it.
-
-Wed Aug 20 15:45:52 1997 Dave Love <d.love@dl.ac.uk>
-
- * dwarf2.h (enum dwarf_call_frame_info): Remove trailing comma from
- list.
-
-Wed Aug 20 15:30:36 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (ix86_prologue, ix86_epilogue): New functions.
- ({function,ix86_expand}_{pro,epi}logue, ix86_expand_prologue):
- Use ix86_prologue.
-
-Wed Aug 20 14:57:11 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (ISSUE_RATE): Define instead of MACHINE_issue_rate.
-
-Tue Aug 19 17:10:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c: Add 'extern' to prepends_underscore.
-
-Tue Aug 19 15:46:30 1997 Jeffrey A Law (law@cygnus.com)
-
- * mips/r3900.h (SUBTARGET_CC1_SPEC): Remove some unnecessary stuff.
- (MIPS_CPU_STRING_DEFAULT, MIPS_ISA_DEFAULT): Define.
-
-Mon Aug 18 21:49:02 1997 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (find_reloads): Add code to convert RELOAD_FOR_OPADDR_ADDR
- reloads to RELOAD_FOR_OPERAND_ADDRESS reloads.
-
-Mon Aug 18 17:39:02 1997 Mike Meissner <meissner@cygnus.com>
-
- * configure.in ({powerpc,rs6000}*-*-*, --with-cpu): Remove single
- quotes around the name.
-
-Mon Aug 18 17:26:42 1997 Doug Evans <dje@cygnus.com>
-
- * mips.md (movsi_ulw,movsi_usw,loadgp): Give unspec a mode.
-
-Mon Aug 18 11:05:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * mips/r3900.h (TARGET_DEFAULT): Turn on MASK_MIPS3900.
-
-Sun Aug 17 14:39:18 1997 Gavin Koch (gavin@cygnus.com)
-
- * mips/elf.h (PREFERRED_DEBUGGING_TYPE): Only set if not already set.
- * mips.c (TARGET_{SINGLE,SOFT}_FLOAT): Make sure both aren't set.
- (PROCESSOR_R3900): Set flag from option.
- * mips.h: Add m3900 option.
- ({PROCESSOR,TARGET,MASK}_R3900): Define.
- (GENERATE_{BRANCHLIKELY,MADD,MULT3): Likewise.
- (debugj,MASK_DEBUG_J): Delete to make room for m3900.
- (BRANCH_LIKELY_P): Redefine to include 3900.
- (GAS_ASM_SPEC,CC1_SPEC): Add m3900 option.
- (RTX_COSTS): Add 3900.
- * mips.md: Add 3900, including three op madd and mult.
- * configure.in (mipstx39{,el}-*-elf*): New cases.
- * mips/r3900.h: New file.
-
-Fri Aug 15 07:34:12 1997 Richard Earnshaw (rearnsha@arm.com)
-
- * arm.md (umulsi3_highpart, smulsi3_highpart): Add extra reloading
- alternatives.
-
-Fri Aug 15 07:34:12 1997 Torbjorn Granlund <tege@tege.pdc.kth.se>
-
- * arm.md (umulsi3_highpart, smulsi3_highpart): New patterns.
- * arm.c (arm_rtx_costs, case TRUNCATE): New case.
-
-Fri Aug 15 06:40:03 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * genemit.c (main): Write an include for flags.h.
- * genoutput.c (main): Likewise.
-
- * alpha.c (override_options): Turn off byte insns for cpu=ev4 or ev5.
-
- * alpha.md (allocate_stack): If stupid reg allocation, add USE
- for loop variable.
-
- * fold-const.c (fold, compare cases): Add calls to `fold' to
- previous change.
-
-Wed Aug 13 17:32:38 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * rtl.h ({SET,}ADDRESSOF_DECL): op 1 of ADDRESSOF is now the decl.
- * function.c (put_var_into_stack, gen_mem_addressof,
- put_addressof_into_stack): Adjust.
-
- * expr.c (expand_expr, case TARGET_EXPR): Call mark_addressable
- again for the slot after we give it RTL.
- (expand_expr, case VAR_DECL): Lose gen_mem_addressof case.
-
-Wed Aug 13 17:29:25 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * c-lex.c (check_newline): Pass finput again to HANDLE_PRAGMA.
-
-Wed Aug 13 16:51:35 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * reload1.c (reload_cse_simplify_operands): New function.
- (reload_cse_no_longer_dead,reload_cse_delete_death_notes): Likewise.
- (no_longer_dead_regs): New static variable.
- (reload_cse_simplify_set): Now returns int.
- Don't delete death notes on previous insns, call
- reload_cse_no_longer_dead instead.
- Call validate_change with nonzero value for in_group.
- (reload_cse_noop_set_p): Don't delete death notes on previous insns,
- call reload_cse_no_longer_dead instead.
- (reload_cse_regs): Initialize no_longer_dead_regs and call
- reload_cse_delete_death_notes as appropriate.
- Call apply_change_group after calling reload_cse_simplify_set.
- Call reload_cse_simplify_set on elements of a PARALLEL.
- Call reload_cse_simplify_operands if reload_cse_simplify_set could
- not simplify things.
-
-Wed Aug 13 16:18:42 1997 Douglas Rupp <rupp@gnat.com>
-
- * vms.h (LINK_SPEC): Echo -shared, not -share, to linker.
-
-Wed Aug 13 12:51:11 1997 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
-
- * m68k.md: Add braces to clarify nesting.
-
-Wed Aug 13 12:51:11 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * calls.c (expand_call): Use assign_temp and mark_addressable
- instead of calling gen_mem_addressof directly.
-
-Wed Aug 13 12:40:15 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (install-man): Add missing $(exeext).
-
- * configure.in (alpha*-dec-osf*): Merge various cases;
- split off version-specific files in new case statement.
- Include osf2or3.h even for OSF1.2.
-
- * alpha.c (NUM_ARGS): New macro.
- (CURRENT_FUNCTION_ARGS_INFO): Deleted.
- (alpha_builtin_saveregs): Use new macro.
- (function_arg): Deleted.
- (alpha_arg_type, alpha_arg_info_reg_val): New functions.
- * vms.h (enum avms_arg_type, avms_arg_info): New types.
- (CUMULATIVE_ARGS, INIT_CUMULATIVE_ARGS): Update definitions
- to use new types.
- (SETUP_INCOMING_VARARGS): Likewise.
- (FUNCTION_ARG{,_PARTIAL_NREGS}, FUNCTION_ARG_ADVANCE): Likewise.
- Only update CUM in FUNCTION_ARG_ADVANCE.
-
-Tue Aug 12 19:27:32 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * integrate.c (save_for_inline_copying): Use 0, not NULL_PTR,
- as initial value for real_label_map.
- (copy_for_inline): Likewise.
-
-Tue Aug 12 16:15:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * rtl.h (BYTECODE_LABEL): Use XSTR, not XEXP.
-
- * calls.c (expand_calls): Properly call any_pending_cleanups.
-
-Tue Aug 12 12:18:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * function.c (purge_addressof_1): Add force argument.
- (purge_addressof): If there are any ASM_OPERANDS in an insn, always
- put ADDRESSOFs into the stack.
-
- * function.c (setjmp_protect): See through addressof.
- (setjmp_protect_args): Likewise.
- * calls.c (expand_call): For now, only use addressof if the type
- doesn't promote.
- * function.c (put_var_into_stack): Likewise.
- * expr.c (expand_expr): Likewise.
- * toplev.c (rest_of_compilation): Check inlineable instead of
- DECL_INLINE.
- * function.c (purge_addressof_1): Try recognizing the insn with
- and without the SUBREG. If it doesn't work, just put the REG into
- the stack.
- (gen_mem_addressof): Set the mode of the MEM to the mode of the type.
- (put_var_into_stack): Don't be fooled by addressof in an enclosing
- scope.
-
-Sun Aug 10 22:19:19 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * explow.c (probe_stack_range): Add USE for test_addr if -O0.
-
-Sun Aug 10 22:15:40 1997 Jason Merrill <merrill@churchy.gnu.ai.mit.edu>
-
- * toplev.c (rest_of_compilation): Move purge_addressof before loop.
-
-Sun Aug 10 15:25:51 1997 Jim Wilson <wilson@cygnus.com>
-
- * toplev.c (main): In -g handling code, add code to set len.
-
- * sdbout.c (plain_type_1, case ARRAY_TYPE): Verify that TYPE_DOMAIN
- has integer TYPE_{MAX,MIN}_VALUE before using them.
-
- * alpha.md (extendqihi2): Use HImode not QImode in force_reg call.
-
-Sun Aug 10 16:47:34 1997 Nick Burrett <nick.burrett@btinternet.com>
-
- * arm/aof.h (COMMON_SECTION): New macro, define common_section.
- (EXTRA_SECTION_FUNCTIONS): Add COMMON_SECTION.
- (EXTRA_SECTIONS): Add in_common.
- (ASM_OUTPUT_COMMON): Call common_section() to indicate we've
- changed areas.
-
-Sat Aug 9 20:04:35 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (gen_subprogram_die): Handle redefinition of an
- extern inline function.
-
-Sat Aug 9 13:01:06 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/sysv4.h (*_SPEC): Add support for -mads and -myellowknife.
- Use a common crt0.o for all embedded platforms. Use --start-group
- and --end-group instead of -( and -) to allow better cut and pasting
- when debugging the linker. Set default start for MVME text.
- (TARGET_SWITCHES): Add -mads and -myellowknife.
-
-Fri Aug 8 20:12:43 1997 Per Bothner <bothner@cygnus.com>
-
- * dwarf2out.c (gen_enumeration_type_die):
- Make code work for a tag name, without a TYPE_STUB_DECL.
- (gen_struct_or_union_type_die): Likewise.
-
-Fri Aug 8 18:10:40 1997 Marc Lehmann <pcg@goof.com>
-
- * i386/go32.h (HAS_INIT_SECTION, HAVE_ATEXIT): New macros.
-
-Fri Aug 8 17:30:22 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
-
- * i386.c (output_pic_addr_const, case PLUS): Emit the constant first.
-
-Fri Aug 8 17:07:36 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * m88k.c (m88k_expand_prologue): Set MEM_IN_STRUCT_P of va_list
- template.
-
- * reg-stack.c (compare_for_stack_reg): Swap only if the source and
- destination are both on the regstack.
- (subst_stack_regs_pat): Put the destination at the top of the regstack.
-
-Fri Aug 8 17:03:21 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-
- * i386.md (pop): pop increments the stack pointer.
- (prologue_set_stack_ptr): New pattern.
- * i386.c (ix86_expand_prologue): Use prologue_set_stack_ptr
- instead of subsi3.
-
-Fri Aug 8 17:00:36 1997 Paul Eggert <eggert@twinsun.com>
-
- * gansidecl.h, halfpic.h (STDIO_PROTO): Remove.
- * bitmap.h, c-tree.h, output.h, reload.h, rtl.h (STDIO_PROTO):
- Replace with PROTO in include files.
- * bc-emit.c: Include <stdio.h> before include files that formerly
- used STDIO_PROTO.
- * bc-optab.c, c-common.c, c-decl.c, caller-save.c, calls.c: Likewise.
- * convex.c, i860.c, mips.c, spur.c, tahoe.c, emit-rtl.c: Likewise.
- * explow.c, expmed.c, expr.c, genattrtab.c, halfpic.c: Likewise.
- * jump.c, optabs.c, profile.c, recog.c, regclass.c: Likewise.
- * rtlanal.c, sdbout.c, unroll.c: Likewise.
- * genattrtab.c (main): Generate files that include <stdio.h>
- before including files that formerly used STDIO_PROTO.
- * genemit.c (main), genextract.c (main), genopinit.c (main): Likewise.
- * genoutput.c (output_prologue), genpeep.c (main): Likewise.
- * genrecog.c (main): Likewise.
- * halfpic.h (PROTO): Use "gansidecl.h" to define this instead.
- (half_pic_finish): Declare without prototype; FILE isn't defined.
-
- * bitmap.c, c-aux-info.c, c-lex.c: Include "config.h" first.
- * c-parse.in, c-pragma.c, 1750a.c, a29k.c, alpha.c: Likewise.
- * arm.c, clipper.c, dsp16xx.c, elxsi.c, fx80.c, gmicro.c: Likewise.
- * h8300.c, i370.c, i386.c, i386/winnt.c, i960.c: Likewise.
- * m32r.c, m68k.c, m88k.c, mn10200.c, mn10300.c, ns32k.c: Likewise.
- * pa.c, pdp11.c, pyr.c, romp.c, rs6000.c, sparc.c, vax.c: Likewise.
- * we32k.c, cppmain.c, dbxout.c, flow.c, fold-const.c: Likewise.
- * gcc.c, gcov.c, global.c, integrate.c, local-alloc.c: Likewise.
- * loop.c, mips-tdump.c, mips-tfile.c, objc-act.c: Likewise.
- * real.c, reg-stack.c, reload.c, reload1.c, reorg.c, sched.c: Likewise.
- * stupid.c, tree.c, varasm.c, xcoffout.c: Likewise.
-
-Fri Aug 8 14:52:35 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * function.c (fixup_stack_1): Stack slots can also be relative to
- the frame or stack pointers.
-
-Fri Aug 8 14:13:49 1997 Richard Henderson <richard@gnu.ai.mit.edu>
-
- * dwarf2out.c (reg_loc_descriptor): Fix prototype.
- (concat_loc_descriptor): New function.
- (loc_descriptor): Call it.
- (add_AT_location_description): Also elide the descriptor if both
- halves of a CONCAT are pseudos.
- (add_location_or_const_value_attribute): Recognize CONCAT too.
-
-Fri Aug 8 06:36:29 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * c-common.c (if_stack{,_space,_pointer}): New static variables.
- (c_expand_{start_cond,start_else,end_cond}): New functions.
- * c-parse.in (compstmt_count): New static variable.
- (compstmt_start): New rule.
- (compstmt): Use new rule.
- (do_stmt_start): Update compstmt_count.
- (simple_if, stmt): Use new versions of start_cond, start_else,
- and end_cond.
-
-Thu Aug 7 15:35:25 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips/iris6.h (TARGET_LONG64): Don't define here.
- * mips.c (override_options): Set MASK_LONG64 for ABI_64.
-
- * mips.c (function_prologue): Don't emit ".ent", ".frame",
- ".mask", ".fmask" if flag_inhibit_size_directive is true.
- (function_epilogue): Don't emit ".end" if
- flag_inhibit_size_directive is true.
-
- * mips/iris6.h (STARTFILE_SPEC, LIB_SPEC): Move
- -L/usr/lib{32,64}/mips? from STARTFILE_SPEC to LIB_SPEC.
-
-Thu Aug 7 13:14:21 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
-
- * fold-const.c (fold): Optimize unsigned x <= 0x7fffffff.
-
-Thu Aug 7 12:46:31 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * explow.c (convert_memory_address, case LABEL_REF): Copy
- LABEL_REF_NONLOCAL_P.
-
- * expr.c (store_constructor): Use CONST0_RTX macro, not always
- the integer version, when clearing a register.
-
- * varasm.c (output_constructor): Correctly check for
- multi-word constant.
-
-Thu Aug 7 10:04:42 1997 Douglas Rupp <rupp@gnat.com>
-
- * alpha/vms-tramp.asm: New file.
-
- * gcc.c (execute): Don't allow -pipe on VMS.
-
- * alpha.c (vmskrunch): Don't strip off trailing digits.
- (vms_valid_decl_attribute_p): New function.
- * alpha/vms.h (TRAMPOLINE_TEMPLATE): Add another quadword of zeros.
- (TRAMPOLINE_SIZE): Now 32 bytes.
- (INITIALIZE_TRAMPOLINE): Put FNADDR at offset 16, CXT at 24.
- (DBX_DEBUGGING_INFO, ASM_FORMAT_PRIVATE_NAME): Always undefine.
- (STARTFILE_SPEC): Likewise.
- (PREFERRED_DEBUGGING_TYPE): Define to be Dwarf-2.
- (VALID_MACHINE_DECL_ATTRIBUTE, ASM_OUTPUT_SECTION{,_NAME}): New macros.
- (ASM_OUTPUT_ALIGN{,ED_COMMON}): Redefine.
- (LINK_SPEC): Pass -share and -v.
- (ENDFILE_SPEC, LIBGCC2_SPEC): Don't redefine.
-
-Thu Aug 7 06:21:47 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * Eliminate most -Wswitch warnings.
- * c-common.c (binary_op_error): Add default case to switch.
- (shorten_compare, truthvalue_conversion): Likewise.
- * c-iterate.c (collect_iteratores): Likewise.
- * c-typeck.c (comptypes, build_component_ref): Likewise.
- (build_binary_op, lvalue_p, build_unary_op): Likewise.
- (build_modify_expr, initializer_constant_valid_p): Likewise.
- (c_expand_return): Likewise.
- * calls.c (calls_function_1): Likewise.
- * combine.c (find_split_point, simplify_rtx): Likewise.
- (simplify_if_then_else, simplify_logical): Likewise.
- (extract_left_shift, make_compound_operation, force_to_mode): Likewise.
- (known_cond, nonzero_bits, num_sign_bit_copies): Likewise.
- (merge_outer_ops, simplify_shift_const, simplify_comparison): Likewise.
- (reversible_comparison_p, mark_used_regs_combine): Likewise.
- * convert.c (convert_to_integer): Likewise.
- * cse.c (canon_hash, exp_equiv_p): Likewise.
- (set_nonvarying_address_components, canon_reg): Likewise.
- (simplify_unary_operation, simplify_plus_minus): Likewise.
- (simplify_relational_operation, fold_rtx): Likewise.
- (cse_process_note, count_reg_usage): Likewise.
- * dbxout.c (dbxout_symbol): Likewise.
- * dwarf2out.c (lookup_cfa_1, print_die): Likewise.
- * emit_rtl.c (copy_rtx_if_shared, reset_used_flags): Likewise.
- * explow.c (plus_constant_wide, convert_memory_address): Likewise.
- (promote_mode, emit_stack_save, emit_stack_restore): Likewise.
- * expmed.c (expand_divmod, emit_store_flag): Likewise.
- * expr.c (queued_subexp_p, is_zeros_p, safe_from_p): Likewise.
- (bc_expand_expr, preexpand_calls, convert_move): Likewise.
- * final.c (get_attr_length, final_scan_insn): Likewise.
- (walk_alter_subreg, alter_cond): Likewise.
- * flow.c (jmp_uses_reg_or_mem, mark_used_regs): Likewise.
- * fold-const.c (operand_equal_p, twoval_comparison_p): Likewise.
- (eval_subst, invert_truthvalue, range_binop): Likewise.
- (make_range, fold): Likewise.
- * function.c (fixup_var_refs_1, instantiate_virtual_regs_1): Likewise.
- * genattrtab.c (attr_copy_rtx, make_canonical): Likewise.
- (encode_units_mask, simplify_test_exp): Likewise.
- (find_and_mark_used_attributes, write_test_expr): Likewise.
- (simplify_with_current_value_aux, clear_struct_flag): Likewise.
- (count_sub_rtxs, gen_insn walk_attr_value): Likewise.
- (copy_rtx_unchanging): Likewise.
- * genconfig.c (walk_insn_part): Likewise.
- * genextract.c (walk_rtx): Likewise.
- * genoutput.c (scan_operands): Likewise.
- * genpeep.c (match_rtx): Likewise.
- * genrecog.c (add_to_sequence): Likewise.
- * integrate.c (copy_for_inline, copy_rtx_and_substitute): Likewise.
- (subst_constants): Likewise.
- * jump.c (duplicate_loop_exit_test, comparison_dominates_p): Likewise.
- (mark_jump_label, rtx_renumbered_equal_p): Likewise.
- (rtx_equal_for_thread_p): Likewise.
- * local-alloc.c (memref_referenced_p): Likewise.
- * loop.c (record_excess_regs, reg_in_basic_block_p): Likewise.
- (get_condition, replace_call_address): Likewise.
- (count_nonfixed_reads, find_and_verify_loops, find_mem_givs): Likewise.
- (maybe_eliminate_biv_1, invariant_p, simplify_giv_expr): Likewise.
- * optabs.c (emit_float_lib_cmp): Likewise.
- * print-tree.c (print_node): Likewise.
- * recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
- * reload.c (subst_reg_equivs, find_reloads_address_1): Likewise.
- (refers_to_regno_for_reload_p, find_equiv_reg): Likewise.
- * reload1.c (set_label_offsets, eliminate_regs): Likewise.
- (scan_paradoxical_subregs, count_occurrences): Likewise.
- * rtl.c (copy_rtx, copy_most_rtx): Likewise.
- * rtlanal.c (rtx_varies_p, rtx_addr_can_trap_p): Likewise.
- (reg_mentioned_p, reg_referenced_p, modified_between_p): Likewise.
- (modified_in_p, refers_to_regno_p, volatile_insn_p): Likewise.
- (volatile_refs_p, side_effects_p): Likewise.
- (inequality_comparison_p, replace_regs): Likewise.
- * sched.c (sched_analyze_2): Likewise.
- * stmt.c (expand_return): Likewise.
- * tree.c (staticp, unsave_expr_now, contains_placeholder_p): Likewise.
- (substitute_in_expr, build_type_attribute_variant): Likewise.
- (simple_cst_equal): Likewise.
- * unroll.c (remap_split_bivs): Likewise.
- * varasm.c (const_hash, compare_constant_1): Likewise.
- (decode_rtx_const, output_addressed_constants): Likewise.
- (output_constant): Likewise.
- * print-tree.c (print_node): Convert switch with one case into an if.
- * sched.c (memrefs_conflict_p): Likewise.
- * genrecog.c (write_tree_1): Output default case for every switch.
-
- * profile.c (output_arc_profiler) [SMALL_REGISTER_CLASSES]:
- Apply PATTERN only to insns.
-
-Thu Aug 7 06:13:20 1997 Robert Lipe <robertl@dgii.com>
-
- * i386/t-sco5 (libgcc2-elf.a): Resync with Makefile.in.
-
-Wed Aug 6 19:28:05 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (build_abbrev_table): Use xrealloc not xmalloc.
-
-Wed Aug 6 12:57:24 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (output_call_frame_info): Always emit the info.
- (dwarf2out_frame_debug): We can initialize the temp reg in the
- epilogue, too.
-
- * rtl.def: Add ADDRESSOF.
- * rtl.h (ADDRESSOF_TYPE, SET_ADDRESSOF_TYPE): New macros.
- * Makefile.in (mostlyclean): Remove *.addressof.
- * toplev.c (rest_of_compilation): Set DECL_DEFER_OUTPUT on
- non-nested inlines. Run purge_addressof after CSE.
- (various): Add .addressof RTL dump file.
- * rtl.c (copy_rtx): No need to copy ADDRESSOF.
- * reload1.c (eliminate_regs): Elide ADDRESSOF.
- * recog.c (general_operand): (MEM (ADDRESSOF ())) is a valid operand.
- So is (ADDRESSOF ()).
- (memory_address_p): (ADDRESSOF ()) is a valid memory address.
- * integrate.c (expand_inline_function): If the structure_value_addr
- is an ADDRESSOF, we can use it as a constant.
- (copy_rtx_and_substitute): Copy a '0' operand over unchanged.
- * function.c (fixup_var_refs_1): Remove (ADDRESSOF (MEM ())).
- (gen_mem_addressof): New fn.
- (put_addressof_into_stack): New fn.
- (purge_addressof_1): New fn.
- (purge_addressof): New fn.
- (instantiate_decl): Don't bother looking into an ADDRESSOF.
- (put_var_into_stack): Call gen_mem_addressof for local REGs instead
- of calling put_reg_into_stack.
- * expr.c (expand_expr, case TARGET_EXPR): Put the temp in a register
- if it will fit.
- (expand_expr, case ADDR_EXPR): Call gen_mem_addressof to take the
- address of a REG.
- * explow.c (memory_address): An ADDRESSOF is a valid memory address.
- * dwarfout.c (location_or_const_value_attribute): Handle ADDRESSOF.
- * dwarf2out.c (add_location_or_const_value_attribute): Handle
- ADDRESSOF.
- * cse.c (FIXED_BASE_PLUS_P): Add ADDRESSOF.
- (NONZERO_BASE_PLUS_P): Add ADDRESSOF.
- (canon_hash): Ignore '0' operands.
- (find_best_addr): Don't try to replace an ADDRESSOF.
- (fold_rtx): If our address has a const equiv of an ADDRESSOF, use it.
- * calls.c (expand_call): Put the struct value in a register if
- it fits.
-
-Tue Aug 5 16:10:45 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips.c (function_arg): Handle passing a struct
- containing a double in a DFmode register without the PARALLEL.
-
-Tue Aug 5 12:27:31 1997 Doug Evans <dje@cygnus.com>
-
- * configure.in (sparc-*-solaris2): Set float_format to i128.
- * config/float-i128.h: New file.
-
-Mon Aug 4 17:45:19 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * combine.c (try_combine): If have PARALLEL of independent SETs
- and have cc0, ensure insn using CC0 come first.
-
-Mon Aug 4 15:22:41 1997 Mike Meissner <meissner@cygnus.com>
-
- * rs6000/sysv4.h (JUMP_TABLES_IN_TEXT_SECTION): Undef for System V
- environments.
-
-Mon Aug 4 12:34:41 1997 Philip Blundell <pb@nexus.co.uk>
-
- * configure.in (arm-*-aout): Set tmake_file correctly.
-
-Mon Aug 4 08:06:48 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-
- * reload.c (find_reloads_address_1): Don't pass VOIDmode for an
- integer argument of push_reload.
-
- * rtlanal.c (may_trap_p): Fix unintended fall-through so divisions by
- non-zero constants are handled properly. Return 1 for FP divisions.
-
-Mon Aug 4 06:52:20 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-common.c (check_format_info): Store each flag character only
- once in the flag_chars array.
-
-Sun Aug 3 21:57:31 1997 Jim Meyering <meyering@eng.ascend.com>
-
- * objc/Make-lang.in (objc/*.o): Depend on $(GCC_PASSES).
-
-Sun Aug 3 21:54:51 1997 Nick Burrett <n.a.burrett@btinternet.com>
-
- * cpplib.c (cpp_start_read): Recognise suffixes 'cp' and 'c++'.
-
-Sun Aug 3 19:18:27 1997 Ralf Baechle <ralf@uni-koblenz.de>
-
- * Makefile.in (mostlyclean): Remove libgcc1-test.
-
-Sun Aug 3 19:10:27 1997 Klaus Espenlaub <kespenla@hydra.informatik.uni-ulm.de>
-
- * Makefile.in (T): Move to place where it can be overridden.
- (install_common): Fix permissions of specs and EXTRA_PARTS files.
-
-Sun Aug 3 19:07:04 1997 Jan-Jaap van der Heijden <J.J.vanderHeijden@student.utwente.nl>
-
- * gcc.c (default_compilers): Add default entries for Pascal.
-
-Sun Aug 3 18:38:41 1997 Richard Henderson <rth@cygnus.com>
-
- * alpha.c (alpha_return_addr): New function.
- (output_epilog): Zero alpha_return_addr_rtx.
- * alpha.h (RETURN_ADDR_RTX): Call alpha_return_addr.
-
-Sun Aug 3 17:27:44 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (INSTALL): Build in $(srcdir).
-
- * config/linux.h (DEFAULT_VTABLE_THUNKS): New macro.
-
-Sun Aug 3 17:18:31 1997 Richard Earnshaw (rearnshaw@cambridge.arm.com)
-
- * expr.c (expand_builtin, case BUILT_IN_RETURN_ADDRESS): Emit warning
- if return address cannot be determined.
-
-Sun Aug 3 17:04:00 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-
- * stupid.c (stupid_life_analysis): If function receives non-local
- goto, don't let any registers live across calls.
-
- * fold-const.c (merge_ranges): Make sure that if one range is subset
- of another, it will always be the second range. Correct (+,-) case to
- account for this.
-
-Sun Aug 3 16:48:30 1997 Paul Eggert <eggert@twinsun.com>
-
- * c-lex.c (yylex): Remove duplicate check on high bit before
- invoking int_fits_type_p.
-
-Sun Aug 3 16:44:41 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
-
- * reload.c (find_equiv_reg): If goal is a pseudo that got memory, a
- store into memory makes it invalid. This was handled in the single
- set case, but missing in the PARALLEL case.
-
-Sun Aug 3 09:13:47 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (store_field): Return quickly if EXP is ERROR_MARK.
-
- * c-typeck.c (unary_complex_lvalue): Don't warn about COMPOUND_EXPR
- or COND_EXPR if FUNCTION_TYPE.
-
- * alpha.h (ASM_SPEC): Add -O0.
-
- * expr.h (clear_storage): Now returns rtx.
- (emit_block_move): Likewise; delete duplicate declaration.
- * expr.c (clear_storage, emit_block_move): Return address of
- dest if calling memset/memcpy.
- (expand_builtin, BUILT_IN_MEM{CPY,SET}): Return value from
- clear_storage or emit_block_move if present.
-
- * c-decl.c (start_function): Reset immediate_size_expand on
- error return.
-
-Sat Aug 2 18:50:43 1997 Paul Eggert <eggert@twinsun.com>
-
- * tree.c (int_fits_type_p): Negative ints never fit unsigned
- types, and unsigned ints with top-bit-set never fit signed types.
-
-Sat Aug 2 16:25:43 1997 Per Bothner <bothner@frobnitz.gnu.ai.mit.edu>
-
- * Makefile.in (EXTRA_C_OBJS): Removed.
- (C_AND_OBJC_OBJS): New. Subsumes EXTRA_C_OBJS and OBJC_CCOMMON.
- * objc/Make-lang.in (OBJC_CCOMMON): Removed.
-
-Sat Aug 2 16:11:57 1997 Doug Evans <dje@cygnus.com>
-
- * configure.in: Build .gdbinit for top level build dir here.
- (AC_OUTPUT): Pass oldstyle_subdirs to configure.lang.
- * configure.lang: Fix building of .gdbinit for oldstyle lang subdirs.
-
-Sat Aug 2 13:48:15 1997 Ken Raeburn <raeburn@cygnus.com>
-
- * cse.c (cse_insn): Ignore paradoxical SUBREGs unless we are
- looking for such.
-
-Sat Aug 2 13:25:33 1997 Tristan Gingold (gingold@email.enst.fr)
-
- * calls.c (expand_call): If -fcheck-memory-usage, use pseudo-register,
- check indirectly called function is executable, and set rights of
- memory for aggregate as write only.
- (store_one_arg): If -fcheck-memory-usage, set rights for pushed
- stack argument.
- * c-decl.c (init_decl_processing): Add
- __builtin_aggregate_incoming_address.
- * explow.c (expr_size): Call expand_expr with appropriate flag.
- * expr.c (expand_builtin, case BUILT_IN_AGGREGATE_INCOMING_ADDRESS):
- New case.
- (expand_assignment, expand_expr, emit_push_insn, store_expr):
- Insert calls to chkr_check_addr, chkr_set_right, and chkr_copy_bitmap
- when -fcheck-memory-usage.
- (get_push_address, get_memory_usage_from_modifier): New functions.
- * expr.h: Add expand_modifier flags.
- (chkr_*_libfunc): New decls.
- (memory_use_mode): New declaration.
- * flags.h (flag_check_memory_usage, flag_prefix_function_name): New
- declaration.
- * function.c (put_var_into_stack, assign_parms): If
- -fcheck-memory-usage, set the rights of pushed variable.
- * optabs.c (chkr_{check_addr,set_right}_libfunc): New definitions.
- (chkr_{copy_bitmap,check_exec}_libfunc): Likewise.
- (init_optabs): Initialize these chkr_*_libfunc.
- * stmt.c (expand_computed_goto): If -fcheck-memory-usage, check that
- computed address of a goto is executable.
- (expand_asm, expand_asm_operands): If -fcheck-memory-usage,
- disallow asm statments.
- * toplev.c (flag_check_memory_usage, flag_prefix_function_name): New
- variable.
- (f_options): Add `check-memory-usage' and `prefix_function_name'.
- (main): Disable `-fomit-frame-pointer' if `-fcheck-memory-usage' is set
- and the machine can't debug without the frame pointer.
- * tree.h (built_in_function): Add BUILT_IN_AGGREGATE_INCOMING_ADDRESS.
- * varasm.c (make_function_rtl, make_decl_rtl): Add a prefix when
- flag_prefix_function_name_usage is set.
- (assemble_name): Strip the CHKR_PREFIX.
- * alpha.c (alpha_builtin_saveregs): If -fcheck-memory-usage,
- set rights of saved registers.
- * clipper.c (clipper_builtin_saveregs): Likewise.
- * m88k.c (m88k_builtin_saveregs): Likewise.
- * pa.c (hppa_builtin_saveregs): Likewise.
- * sparc.c (sparc_builtin_saveregs): Likewise.
-
-Sat Aug 2 08:01:12 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-decl.c (grokdeclarator): Give error for `long double' and
- refine text of some error messages.
-
- * alpha.h (FLOAT_VALUE_TYPE, INTIFY, FLOATIFY, FLOAT_ARG_TYPE): Define.
- * i860.h (FLOAT_VALUE_TYPE): Fix typo; was FLOAT_TYPE_VALLUE.
-
- * calls.c (store_one_arg): Allow stack_slot to be SP in
- ARGS_GROW_DOWNWARD case.
-
- * c-decl.c (parmlist_tags_warning): Only suppress warning on
- union if anonymous.
-
- * libgcc2.c (_trampoline): Rework last change; both getpagesize
- and mprotect are in cygwin32.
-
- * reload1.c (reload): Add IN_ADDR to IN_ADDR_ADDR when computing
- needs since they conflict.
-
- * print-rtl.c (indent): Move to file level; was static in print_rtx.
- (print_inline_rtx): New function.
- * reload.c (debug_reload): Rework to make output more compact.
-
- * dwarfout.c (output_compile_unit_die): Add support for Pascal.
- * dwarf2out.c (gen_compile_unit_die): Likewise.
-
- * c-typeck.c (lvalue_p, case BIND_EXPR, RTL_EXPR): Return 1 if array.
-
- * Makefile.in (OBJC_OBJC): Delete from here.
-
- * varasm.c (compare_constant_1, case STRING_CST): Compare TYPE_MODE.
- (record_constant_1, case STRING_CST): Record TYPE_MODE.
-
- * tree.c (contains_this_placeholder_p): Delete.
- (contains_placeholder_p): Now contains code from above function.
- (contains_placeholder_p, case 'r'): Don't look at offset info.
- * expr.c (expand_expr, case PLACEHOLDER_EXPR): Find innermost
- matching and don't check contains_placeholder_p.
-
-Fri Aug 1 17:15:07 1997 Per Bothner <bothner@cygnus.com>
-
- * objc/objc-act.c (lang_init): Don't check_newline #if USE_CPPLIB.
- * c-lex.c (lang_init): Remove (recently moved here).
- * c-lang.c (lang_init): Restore, but add #if !USE_CPPLIB.
-
-Fri Aug 1 11:26:45 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (pa_reorg): Explode ADDR_DIFF_VEC insns too.
-
-Thu Jul 31 19:37:22 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * libgcc2.c (getpagesize): Don't compile if __CYGWIN32__.
-
-Thu Jul 31 16:04:42 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (output_to_reg, output_fix_trunc): Use scratch memory,
- if available, instead of dynamically extending the stack.
- (put_condition_code, print_operand): Added reverse_cc to reverse the
- comparison when $ah is accessed directly instead of using eflags
-
- * i386.md (*trunc*): Use scratch memory for output_fix_trunc.
- (movsicc_1, movhicc_1) Change alternative 3 to:
- jCC L1; mov; jmp L2; L1:mov; L2:
- (movsfcc, movdfcc, movxfcc): Force constant operands to memory.
- (movsfcc_1, movdfcc_1, movxfcc_1): Change alternative 3 as above.
-
-Thu Jul 31 16:04:42 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386.h (MAX_FIXED_MODE_SIZE): Define.
-
-Thu Jul 31 16:04:42 1997 Robert Lipe <robertl@dgii.com>
-
- * i386/sco5.h (SWITCHES_NEED_SPACES) Define.
- Required by the COFF (but not ELF) linker.
-
-Wed Jul 30 15:03:52 1997 Per Bothner <bothner@cygnus.com>
-
- * demangle.h (DMGL_JAVA): New option to request Java demangling.
- * cplus-dem.c: Various changes to produce Java output when passed
- DMGL_JAVA. Thus "::" becomes "." and "JArray<Foo>" becomes "Foo[]".
- (main): Support --java and -j flags to set DMGL_JAVA.
-
-Wed Jul 30 08:56:08 1997 Philip Blundell <Philip.Blundell@pobox.com>
-
- * configure.in (arm-*-*): Replace with arm-*-aout.
- * arm/aout.h (SET_ASM_OP): Define by default.
- * arm/riscix.h (SET_ASM_OP: Undefine.
- * arm.h (CPP_SPEC): Add %(subtarget_cpp_spec).
- (SUBTARGET_CPP_SPEC): New macro.
- * arm/linux.h: Include aout.h rather than arm.h directly.
- (TARGET_CPU_DEFAULT): Define.
- ({ASM,CPP}_SPEC): Remove.
- * arm/t-linux (MULTILIB_OPTIONS): Use -mapcs-NN instead of -mN.
- (LIB1ASMSRC): Use generic ARM version.
- (CROSS_LIBGCC1): Define.
- * arm/lib1funcs-linux.asm: Remove.
-
-Tue Jul 29 17:57:47 1997 Per Bothner <bothner@cygnus.com>
-
- * Add hooks for using autconf-style Makefile.in in language subdirs.
- * configure.in (all_outputs, oldstyle_subdirs): New variables.
- Pass all_outputs to AC_OUTPUT.
- * configure.lang: Only iterate over oldstyle_subdirs.
-
- * Patches to use cpplib with cc1 #if USE_CPPLIB.
- * configure.in (--enable-c-cpplib): New option.
- (extra_c_flags, extra_c_objs): New variables.
- * Makefile.in (EXTRA_C_OBJS): New variable.
- (INTERNAL_CFLAGS): Add @extra_c_flags@.
- (C_OBJS): Add $(EXTRA_C_OBJS).
- * c-lex.c (generally): Replace getc and ungetc by macros GETC and
- UNGETC. Avoid explicit references to finput.
- (yy_get_token): New function, that calls cpp_get_token.
- (init_parse): New function - calls init_lex.
- (finish_parse): New function (called by compile_file).
- (GET_DIRECTIVE_LINE): New macro wrapper replaces get_directive_line.
- (lang_init): Don't check_newline - already know main_input_filename.
- (handle_sysv_pragma): Remove FILE* parameter.
- * toplev.c (finput): Remove #if USE_CPPLIB.
- (compile_file): #if USE_CPPLIB don't open input file here,
- do it in cpp_start_read. Call init_parse instead of init_lex.
- At end, call finish_parse instead of fclose(finput).
-
-Mon Jul 28 15:48:29 1997 Brendan Kehoe <brendan@cygnus.com>
-
- * integrate.c (expand_inline_function): Use xmalloc instead of
- alloca for the LABEL_MAP.
- (save_for_inline_copying): Likewise.
-
-Mon Jul 28 11:22:16 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (compile_file): Also emit any deferred TREE_PUBLIC inlines.
- (rest_of_compilation): Use decl_printable_name instead of DECL_NAME
- to identify functions in the RTL dump files.
-
- * dwarf2out.c (add_location_or_const_value_attribute):
- leaf_renumber_regs_insn. Also eliminate_regs here.
- (add_AT_location_description): Not here. Don't emit anything
- for a variable that has been optimized away.
- (add_const_value_attribute): Likewise.
-
- * dwarfout.c (location_or_const_value_attribute):
- leaf_renumber_regs_insn. Also eliminate_regs here.
- (location_attribute): Not here.
-
- * stor-layout.c (layout_type): Fix ancient code to match ancient
- comment. Use mode of field for one-field structs.
-
-Sun Jul 27 12:09:02 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * function.c (put_var_into_stack, trampoline_address): Treat
- inline_function_decl like current_function_decl.
- * expr.c (expand_expr, case LABEL_DECL): Likewise.
- (expand_expr, case SAVE_EXPR): Handle top-level SAVE_EXPR by
- moving into current function; abort if in incorrect context.
- * fold-const.c (fold_range_test, fold): Avoid making SAVE_EXPR
- if at top level.
-
- * dwarfout.c (ASM_OUTPUT_SOURCE_FILENAME): Delete default value.
-
- * alpha.h (TARGET_SWITCHES): Add -mno-byte.
-
- * expr.c (get_inner_unaligned_p): Deleted.
- (expand_assignment): Remove special-case of constant array.
- (expand_expr, case ARRAY_REF): Likewise, and clean up remaining code.
-
- * explow.c (probe_stack_range): Do probing with loop if more
- than a small number.
-
-Fri Jul 25 15:42:34 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * configure.in: Finish fixing calculation if default thread
- support is enabled.
-
-Fri Jul 25 15:30:09 1997 Doug Evans <dje@cygnus.com>
-
- * Makefile.in (native): Depend on config.h.
- (gcc.o): Depend on Makefile, not config.status.
-
-Fri Jul 25 10:56:50 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (pa_reorg): If TARGET_BIG_SWITCH, then do not explode
- ADDR_VEC insns. Slightly rework code which explodes ADDR_VEC
- insns.
- * pa.h (TARGET_BIG_SWITCH): Define.
- (TARGET_SWITCHES): Add "big-switch" and "no-big-switch".
- (CASE_VECTOR_MODE): Use TI or DI depending on TARGET_BIG_SWITCH.
- (CASE_DROPS_THROUGH): Remove definition.
- (ASM_OUTPUT_ADDR_VEC_ELT): Rewrite to handle TARGET_BIG_SWITCH.
- (ASM_OUTPUT_ADDR_DIFF_ELT): Likewise.
- * pa.md (casesi): Rework to avoid some potential long branch
- problems (also makes generated code faster!). Handle
- TARGET_BIG_SWITCH.
- (casesi0): Corresponding changes.
-
-Fri Jul 25 08:36:47 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * calls.c: (expand_call): If -fstack-check and temp needed
- for arg is too large, use alloca.
- * expr.c (expand_expr, case MODIFY_EXPR): Don't preexpand calls
- if LHS is an indirect via a constant pointer.
-
-Thu Jul 24 21:49:11 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * bitmap.c (bitmap_operation): Reset CURRENT on deferred deletion.
-
-Wed Jul 23 23:52:14 1997 Chris Smith <csmith@convex.hp.com>
-
- * convex.h (CHECK_FLOAT_VALUE): Fix OVERFLOW capitalization.
-
-Wed Jul 23 13:00:47 1997 Richard Earnshaw <rearnsha@cambridge.arm.com>
-
- * configure.in (arm-*-netbsd*): Fix typo setting tmake_file.
-
-Wed Jul 23 06:39:35 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (alpha*): Put quotes around MASK_GAS.
-
-Tue Jul 22 15:24:45 1997 Brendan Kehoe <brendan@cygnus.com>
-
- * tree.c (array_type_nelts): Make sure the domain of TYPE is set
- before we try to use it.
-
-Tue Jul 22 12:26:13 1997 Doug Evans <dje@cygnus.com>
-
- * sparc.c (gen_v9_scc): Handle early clobber of result.
- * sparc.md (seqdi_special): Don't clobber %xcc.
- (snedi_special, seqdi_special_trunc, snedi_special_trunc): Likewise.
- (snedi_zero, neg_snedi_zero, seqdi_zero, neg_seqdi_zero): Likewise.
- (snedi_zero_trunc, seqdi_zero_trunc): Likewise. Renamed from ..._sp64.
- (snedi_zero_trunc_sp32, seqdi_zero_trunc_sp32): Delete.
-
- * Makefile.in (Makefile): Pass xmake_file, tmake_file to
- configure.frag
- (distclean): Delete Make-host, Make-target.
- * configure.in (host_overrides): Set to Make-host.
- (dep_host_xmakefile): Loop over all elements in host_make_file.
- (target_overrides): Set to Make-target.
- (dep_tmake_file): Loop over all elements in tmake_file.
- (configure.frag): Pass dep_host_xmake_file, dep_tmake_file.
- * configure.frag: New arguments xmake_files, tmake_files.
- Build Make-host, Make-target.
-
-Mon Jul 21 23:17:44 1997 Paul Eggert <eggert@twinsun.com>
-
- * objc/Make-lang.in, objc/Makefile.in: Comment out lines containing
- just formfeeds.
-
-Mon Jul 21 14:05:46 1997 Doug Evans <dje@cygnus.com>
-
- * Makefile.in (Makefile): Depend on config.status instead
- of configure.
- (config.status): Depend on configure. Run config.status --recheck
- if out of date.
- (cstamp-h.in): Use echo instead of touch.
-
- * reload1.c (reload_cse_mem_conflict_p): Restore handling of
- (mem:BLK const0_rtx) meaning all memory is clobbered.
-
-Mon Jul 21 06:20:10 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.md (iorsi_zexthi_ashl16): Mark output operand as earlyclobber.
-
-Sun Jul 20 06:11:30 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (alpha*-*-*): Set cpu_type to alpha.
- Change "alpha-" to "alpha*-" in all entries.
- Set target_cpu_default for ev5 and ev56 systems.
- Use symbolic names for target_cpu_default.
- * alpha.c (override_options): Set default for alpha_cpu
- from TARGET_CPU_DEFAULT.
- * alpha.h (MASK_CPU_EV5): New macro.
-
- * tree.c (contains_placeholder_p): Call contains_this_placeholder_p.
- (contains_this_placeholder_p): Renamed from contains_placeholder_p.
- Added new arg, PL.
- Rework to make more consistent, check more codes, and avoid
- undefined fields.
- * expr.c (expand_expr, case PLACEHOLDER_EXPR): Pick outermost
- object in placeholder_list of right type without a PLACEHOLDER_EXPR.
-
-Sat Jul 19 18:00:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.c (override_options): Allow processor of ev56 or 21164a.
- (input_operand, case MEM): Correct test involving TARGET_BYTE_OPS.
- * alpha.h (SECONDARY_{IN,OUT}PUT_RELOAD_CLASS): Don't need for
- QImode or HImode if TARGET_BYTE_OPS.
- (ASM_FILE_START): Write a .arch directive.
- (STACK_CHECK_BUILTIN): New macro.
- * alpha.md ({zero_,}extend[qh]i[dsh]i2): Rework TARGET_BYTE_OPS cases.
- (mov[hq]i): Likewise.
- (extend[qh]i[hsd]i2x): Add missing cases and fix typo in constraint.
- (reload_{in,out}[qh]i): Disable for TARGET_BYTE_OPS.
-
-Fri Jul 18 23:24:57 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (make_decl_rtl): Don't use ASM_FORMAT_PRIVATE_NAME for
- local decls with TREE_PUBLIC set.
- (bc_make_decl_rtl): Likewise.
-
-Fri Jul 18 22:16:28 1997 Doug Evans <dje@cygnus.com>
-
- * configure.in: Invoke AC_CONFIG_HEADER.
- Check for string.h, strings.h, stdlib.h, time.h, unistd.h.
- Check for whether malloc/realloc/free need to be declared.
- (links): Rename config.h to config2.h.
- (AC_OUTPUT): Create cstamp-h.
- * Makefile.in (config.in,cstamp-h.in): Add rules for.
- (config.h,cstamp-h): Add rules for.
- (distclean): Delete config2.h, cstamp-h.
- (ALL_CFLAGS): Add @DEFS@.
- * aclocal.m4, acconfig.h: New files.
-
- * Makefile.in (distclean): Delete Make-host, Make-target.
- * configure.in (host_overrides): Set to host_xmake_file, don't create
- Make-host.
- (target_overrides): Set to tmake_file, don't create Make-target.
- (language subdir support): Keep together.
-
- * c-decl.c (duplicate_decls): Set DECL_ABSTRACT_ORIGIN to olddecl
- if inline function and not new definition.
-
- * configure.in: Don't loop trying to configure language subdirs.
- Don't pass to configure.lang variables it doesn't use.
- * configure.lang: Delete top level directory from loop.
- Delete code not useful for language subdirs.
-
-Fri Jul 18 08:12:53 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * toplev.c (rest_of_compilation): Call reload_cse_regs here.
- * reload1.c (reload): Don't call it here.
- (reload_cse_mem_conflict_p): Remove MEM_OFFSET and MEM_MODE args.
- (reload_cse_mem_conflict_p, case MEM): Call anti_dependence.
- (reload_cse_invalidate_mem): Update call to reload_cse_mem_conflict_p.
- (reload_cse_regs): No longer static.
- Call init_alias_analysis.
- Ignore CLOBBER in a PARALLEL.
-
-Fri Jul 18 06:44:22 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * objc/Make-lang.in (objc-headers): Fix command for the new build
- directory layout, don't pass srcdir variable.
- * objc/Makefile.in (copy-headers): Use $(srcdir) from this
- makefile, not the parent's.
-
-Thu Jul 17 16:03:03 1997 Doug Evans <dje@cygnus.com>
-
- * configure.lang (EXTRA_HEADERS,EXTRA_PASSES,EXTRA_PARTS): Delete.
- (EXTRA_PROGRAMS,EXTRA_OBJS,EXTRA_GCC_OBJS,MD_DEPS): Delete.
- (version) Delete duplicate entry.
- * configure.in (merged_frags): Delete unused variable.
- (extra_headers_list): Move setting outside of subdir loop.
- (extra_headers,extra_passes): Don't pass to configure.lang.
- (extra_programs,extra_parts,extra_objs): Likewise.
- (host_extra_gcc_objs,gxx_include_dir,md_cppflags): Likewise.
-
-Thu Jul 17 07:00:43 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.h (STACK_CHECK_*): Provide default values.
- (probe_stack_range): New declaration.
- * flags.h (flag_stack_check): Likewise.
- * explow.c (allocate_dynamic_stack_space): Call probe_stack_range.
- (emit_stack_probe, probe_stack_range): New functions.
- * function.c (expand_function_end): If function is non-leaf and stack
- checking is requested, emit needed probes.
- * reload1.c (reload): If checking stack, verify frame small enough.
- * stmt.c (expand_decl): If stack checking, use alloca for large vars.
- * toplev.c (flag_stack_check): New variable.
- (f_options): Add "stack-check".
-
- * reorg.c (mark_target_live_regs): Pass FIRST_PSEUDO_REGISTER to
- call to EXECUTE_IF_SET_IN_REG_SET.
-
-Wed Jul 16 14:51:00 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * i960.h (ASM_OUTPUT_ALIGNED_BSS): Define.
- (ASM_OUTPUT_ALIGNED_LOCAL): Use standard method to convert ALIGN
- to power-of-two of bytes.
-
- * sparc.h (ASM_OUTPUT_ALIGNED_BSS): Define.
- * sparc/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Undef before definition.
-
-Wed Jul 16 14:34:09 1997 Klaus Espenlaub (kespenla@hydra.informatik.uni-ulm.de)
-
- * calls.c (emit_library_call_value): Initialize all argvec elements.
-
-Wed Jul 16 14:31:39 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * global.c (global_conflicts): Pass FIRST_PSEUDO_REGISTER to
- call to EXECUTE_IF_SET_IN_REG_SET.
-
-Wed Jul 16 10:57:03 1997 Richard Earnshaw (rearnsha@cambridge.arm.com)
-
- * From Rob Black (r.black@ic.ac.uk) and Mark Brinicombe
- (amb@physig.ph.kcl.ac.uk):
- * configure.in (arm-*-netbsd*): New configuration.
- * arm/netbsd.h, arm/t-netbsd, arm/xm-netbsd.h: New files.
-
-Wed Jul 16 10:57:03 1997 Richard Earnshaw (rearnsha@cambridge.arm.com)
-
- * arm.c (tune_flags): New variable.
- (target_{cpu,fpe}_name): Delete.
- (arm_fpu_arch): New variable.
- (arm_select): Also allow -march=... to configure just the
- architecture.
- (all_procs): Allow armv{2,2a,3,3m,4,4t} for use with -march=.
- (arm_override_options): Handle -march=, but don't let -mcpu=
- and -mtune= match the architecture names, since we can only
- tune for an implementation. Rework selection of tuning options
- for floating point.
- (use_return_insn): Support interworking with Thumb code.
- (arm_rtx_costs): Rework multiply costs so that cost is based on
- the tune, not the architecture.
- (f_register_operand): New function.
- (output_return_instruction): Support interworking with Thumb code.
- (output_func_epilogue): Support interworking with Thumb code.
- Remove redundant calculation of code_size. Use floating-point
- load-multiples if permitted.
- (emit_sfm): New function.
- (arm_expand_prologue): Use floating-point store-multiples if
- permitted.
-
- * arm.h (CPP_CPU_ARCH_SPEC): Handle -march=...
- (TARGET_OPTIONS): Add arch= and fp=. Delete fpe=.
- (enum processor_type): Add PROCESSOR_NONE, for use in all_procs table.
- (FP_DEFAULT): Default floating point architecture for generic
- back-end.
- (PREDICATE_CODES): Add f_register_operand.
-
- * arm.md (*push_fp_multi): New pattern.
-
-
-Tue Jul 15 22:08:47 1997 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (exeext): Set to build_exeext not exeext.
- * configure.in (exeext): Delete redundant set and AC_SUBST call.
- Change remaining AC_SUBST to use build_exeext instead of exeext.
-
-Tue Jul 15 15:48:25 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * configure.in: Fix calculation if default thread support is enabled.
-
-Tue Jul 15 13:38:46 1997 Mike Meissner <meissner@cygnus.com>
-
- * rtl.h (replace_regs): Declare.
-
-Mon Jul 14 16:18:19 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * i960.h (ASM_OUTPUT_MI_THUNK): Define.
-
- * dwarf2out.c (gen_subprogram_die): Remove unreachable and redundant
- code.
-
-Mon Jul 14 14:22:45 1997 Jeffrey A Law (law@cygnus.com)
-
- * calls.c (emit_library_call): Use right index into argvec array
- when iterating over arguments which need to be pushed on the stack.
- (emit_library_call_value): Likewise.
-
-Mon Jul 14 08:17:41 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * gcc.c (convert_filename): Fix typo.
-
-Mon Jul 14 08:10:12 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure.in: Clear headers and lib2funcs before re-reading
- config-lang.in.
-
- * m68k/linux.h (LINK_SPEC): Fix last change.
-
-Mon Jul 14 08:03:38 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * configure.in (sparc-*-linux-gnu{*,libc1*}): Add sparc/t-linux.
- * sparc/t-linux: New file.
-
- * alpha/elf.h (LINK_SPEC): Fix typo.
- * configure.in (alpha-*-linux-gnu*): Set tmake_file.
- * alpha/t-linux: New file.
-
-Mon Jul 14 07:41:37 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.c (output_{and,ior,xor}si3): New functions from patterns bodies.
- * m68k.h (output_{and,ior,xor}si3): New extern declarations.
- * m68k.md (adddi3, subdi3): Allow constant operand.
- (anddi3, iordi3, xordi3): New patterns.
- ({and,ior,xor}si3_internal): Use corresponding output_???si3 function.
-
-Mon Jul 14 07:33:11 1997 Fila Kolodny <fila@ibi.com>
-
- * configure.in (*-*-gnu*): Add crt{begin,end}S.o to extra_parts.
-
-Mon Jul 14 07:26:36 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * varasm.c (assemble_variable): If low part of size
- doesn't fit in an int, variable is too large.
-
-Mon Jul 14 06:51:37 1997 Mike Meissner <meissner@cygnus.com>
-
- * bitmap.{h,c}: New files.
- * Makefile.in (OBJS): Add bitmap.o.
- (BASIC_BLOCK_H): New make variable for basic-block.h, bitmap.h.
- ({flow,combine,regclass,local-alloc,reload1,reorg,sched}.o): Use
- BASIC_BLOCK_H variable instead of basic-block.h.
- * basic-block.h (*REG_SET): Delete old implementation; use bitmap.h.
- (regset_{size,bytes}): Delete.
- (regs_live_at_setjmp): Declare.
- (EXECUTE_IF_SET_AND_RESET_IN_REG_SET): Delete.
- * flow.c (init_regset_vector): Make global; don't take basic block
- times # of pseduos as argument.
- (life_analysis): Change all init_regset_vector calls.
- Use free_regset_vector to release arrays only flow uses at end.
- (allocate_for_life_analysis): Change init_regset_vector call.
- Don't set regset_{size,bytes}.
- (free_regset_vector): Call FREE_REG_SET to release any
- memory allocated by each vector.
- (propagate_block): Call FREE_REG_SET on dead/live.
- (mark_used_regs): Don't use REGSET_ELT_TYPE anymore.
- * output.h (allocate_for_life_analysis): Add declaration.
- (regno_uninitialized, regno_clobbered_at_setjmp): Likewise.
- (dump_flow_info, flow_analysis): Likewise.
- * regclass.c (init_reg_sets): Invoke INIT_ONCE_REG_SET.
- (allocate_reg_info): Invoke MAX_REGNO_REG_SET.
- (regset_release_memory): Free basic_block_live_at_start storage.
- * reorg.c (mark_target_live_regs): Delete unused variables.
- * sched.c (schedule_block): Free space associated with
- reg_pending_sets and old_live_regs.
- (schedule_insns): Free bb_{dead,live}_regs on first pass.
- (sched_analyze_insn): Use EXECUTE_IF_SET_IN_REG_SET and then clear.
- * toplev.c (rest_of_compilation): Call regset_release_memory.
-
-Mon Jul 14 00:14:13 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (main): Prefer DWARF 2 or stabs with -ggdb.
- * ns32k/tek6000.h (PREFERRED_DEBUGGING_TYPE): DBX_DEBUG.
- * alpha.h (PREFERRED_DEBUGGING_TYPE): SDB_DEBUG.
- * mips.h (PREFERRED_DEBUGGING_TYPE): SDB_DEBUG.
-
-Sun Jul 13 15:11:08 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stupid.c (stupid_mark_refs): If setting reg set only in this
- insn and not referenced, make REG_UNUSED note.
-
-Sun Jul 13 14:03:19 1997 Michael Meissner <meissner@cygnus.com>
-
- * gcc.c (process_command): If -save-temps and -pipe were specified
- together, don't do -pipe.
-
-Sun Jul 13 12:27:03 1997 Doug Evans <dje@cygnus.com>
-
- * gcc.c (main): Handle blank in version_string when comparing
- with compiler_version.
-
-Sat Jul 12 01:53:55 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * sparc.c (output_function_prologue): Fix offset from CFA.
- (sparc_flat_output_function_prologue): Likewise.
-
-Fri Jul 11 09:49:15 1997 Jeffrey A Law (law@cygnus.com)
-
- * mips.c (epilogue_reg_mentioned_p): Delete unused function.
- (mips_epilogue_delay_slots): Likewise.
- (function_epilogue): Greatly simplify.
- (mips_expand_epilogue): If we have a null prologue/epilogue,
- then use a normal return insn. Emit blockage insns before
- stack pointer adjustments.
- (mips_can_use_return_insn): Renamed from simple_epilogue_p. All
- callers changed. Do not use return insns if $31 is live in the
- function or if generating profiling information.
- * mips.h (DELAY_SLOTS_FOR_EPILOGUE): Delete.
- (ELIGIBLE_FOR_EPILOGUE_DELAY): Likewise.
- * mips.md (return): Remove expander and change the pattern to
- look like a standard "return" insn.
- (return_internal): Show use of $31 explictly.
- (epilogue expander): Enable.
-
-Thu Jul 10 13:04:53 1997 Doug Evans <dje@cygnus.com>
-
- * cccp.c (INO_T_EQ): Return 0 for MSDOS.
-
- * Makefile.in (CC): Use autoconf value.
-
-Tue Jul 8 18:08:00 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (gen_subprogram_die): When handling declarations, test
- DECL_CONTEXT not decl_class_context before equate_decl_number_to_die.
-
-Tue Jul 8 16:47:13 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (movsi define_split): Use unsigned HOST_WIDE_INT,
- not unsigned.
-
-Sat Jul 7 00:01:41 1997 Jim Meyering <meyering@eng.ascend.com>
-
- * i386/t-sol2 (crt[1in].o): Also depend on $(GCC_PASSES).
-
-Fri Jul 4 11:45:39 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (DWARF_CIE_HEADER_SIZE, DWARF_FDE_HEADER_SIZE,
- size_of_cfi, size_of_fde, calc_fde_sizes, next_fde_offset,
- cie_size): Lose.
- (ASM_OUTPUT_DWARF_STRING): Move earlier.
- (INCOMING_FRAME_SP_OFFSET): Provide default.
- (initial_return_save): Adjust for CFA offset.
- (dwarf2out_frame_debug): Lookup initial CFA offset when setting up.
- (output_call_frame_info): Use label subtraction for length fields.
- Add pointer to exception region information in for_eh case.
- (dwarf2out_do_frame): New fn.
- (dwarf2out_frame_init): Use INCOMING_FRAME_SP_OFFSET.
- (dwarf2out_frame_finish): Don't bother emitting .debug_frame for
- non-Irix targets. Just emit .eh_frame.
- (output_die): Refer to an FDE with label subtraction.
- * i386.h (INCOMING_FRAME_SP_OFFSET): Define.
- * defaults.h (DWARF2_UNWIND_INFO): Define if
- INCOMING_RETURN_ADDR_RTX is provided.
- * final.c (final): Don't call dwarf2out_frame_debug unless we are
- doing dwarf 2.
-
-Thu Jul 3 17:37:52 1997 Jim Wilson <wilson@cygnus.com>
-
- * fp-bit.c (unpack_d): Check fraction not sign to distinquish QNaN.
-
-Wed Jul 2 09:48:03 1997 Michael Meissner <meissner@cygnus.com>
-
- * loop.c (strength_reduce): Make sure register does not exceed the
- table size when looking up the last UID.
-
-Wed Jul 2 07:47:44 1997 Nick Burrett <n.a.burrett@btinternet.com>
-
- * genoutput.c (process_template): Place increment expression
- outside of putchar function call.
-
-Wed Jul 2 06:56:52 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * sparc/linux.h (LIBGCC_SPEC): Removed.
- (CC1_SPEC): Add %{profile:-p}.
- ({CPP,LIB,LINK}_SPEC): Choose glibc 1 or 2 depending on USE_GNULIBC_1.
- * configure.in (sparc-*-linux-gnulibc1*): New configuration.
-
- * configure.in (powerpc-*-linuxgnu*): Default thread_file is posix.
- Set xmake_file to x-linux. Add extra_parts.
- * rs6000/linux.h (LINK_SPEC): Defined.
-
- * m68k/linux.h (LINK_SPEC): Pass -shared for -shared.
- ({CPP,LINK}_SPEC): Choose for glibc 1 or 2 depending on USE_GNULIBC_1.
- * configure.in (m68k-*-linux-gnu*): Default thread_file is `posix'.
- (m68k-*-linux-gnulibc1): New configuration.
-
- * alpha/elf.h (LINK_SPEC): Change ld-gnu.so.1 to ld-linux.so.2.
- * configure.in (alpha-*-linux-gnu*): Default thread_file is `posix'.
-
-Wed Jul 2 06:12:37 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * alpha.md (divsi3, modsi3, udivsi3): Comment out.
- (extendsfsd2_no_tp): Add alternative with output in MEM, input in REG.
-
- * configure.in (*-linux*): Add "-gnu" to names to match.
-
- * libgcc2.c (_trampoline): Add stdcall attribute to VirtualProtect
- on i386.
-
- * objc/objc.gperf: Renamed from gperf.
-
-Wed Jul 2 05:42:19 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * objc/Make-lang.in ($(srcdir)/objc/objc-parse.c): Fix command
- to use the right file names.
-
-Tue Jul 1 23:25:42 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * reorg.c (redundant_insn): If INSN or possible match has REG_UNUSED
- note, don't have match.
-
-Tue Jul 1 18:36:24 1997 Doug Evans <dje@cygnus.com>
-
- * mips.c (mips_output_external): Don't output .extern's for
- variables in user specified sections unless they're .sbss/.sdata.
-
-Tue Jul 1 18:30:26 1997 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (find_best_addr): Add missing rtx_cost arguments.
-
- * fp-bit.c (float_to_usi): Move code for negative numbers before code
- for infinity. Modify infinty code to only handle positive infinities.
-
-Tue Jul 1 11:16:41 1997 Robert Lipe <robertl@dgii.com>
-
- * fixinc.sco: Restore pwd after copy.
- Convert declaration of abs in math.h to prototype.
- Fix static functions in sys/stat.h for C++.
-
-Tue Jul 1 10:55:47 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md ({add,ior,xor}si3): Change to use define_expand wrapper
- and split add/ior/xor of large constants early.
- (andsi3): Remove 6/29 code to do and of large constants.
- (nor, nand, eqv, maskir): Add names to all logical define_insns.
-
-Tue Jul 1 09:03:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * h8300.h (BIGGEST_FIELD_ALIGNMENT): Remove definition.
- * mips.h (BIGGEST_FIELD_ALIGNMENT): Likewise.
-
-Mon Jun 30 14:58:00 1997 Jeffrey A Law (law@cygnus.com)
-
- * sh.c (sh_expand_epilogue): Emit blockage insn before cutting
- back stack.
-
-Sun Jun 29 11:27:07 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (TARGET_FLAGS): Add -m{,no-}update to suppress
- creating load/store with update instructions, and also
- -m{,no-}fused-madd to suppress the generation of fused add and
- multiply instructions. Move debug flags to TARGET_OPTIONS.
- (GO_IF_LEGITIMATE_ADDRESS): Don't allow PRE_{INC,DEC} if -mno-update.
- (GO_IF_MODE_DEPENDENT_ADDRESS): Ditto.
- (rs6000_debug_{name,stack,arg}): Add declarations.
- (toc_initialized): Likewise.
- (got_no_const_operand): Likewise.
- (PREDICATE_CODES): Add got_no_const_operand.
- (toc_section): Make toc_initialized a global.
- (RTX_COSTS): Set appropriate costs for add, logical operators that
- are really two instructions.
-
- * rs6000.c (rs6000_debug_{name,stack,arg}): Add definitions.
- (rs6000_override_options): Process debug flags.
- (toc_initialized): Global to say toc initialized.
- (small_data_operand): Use #if TARGET_ELF, not #ifdef TARGET_SDATA.
- (rs6000_init_expanders): Likewise.
- (SMALL_DATA_RELOC): Likewise.
- (got_no_const_operand): Recognize SYMBOL_REF and LABEL_REF.
- (rs6000_makes_calls): System V profiling doesn't count as a call.
- (rs6000_stack_info): Likewise.
- (rs6000_output_load_toc_table): Take register number argument to
- determine register to load. Generate correct code if more than
- one toc table is done in System V due to profiling or non-local
- gotos. If System V toc is not initialized, initialize it now.
- (rs6000_allocate_stack_space): Move code from output_prolog to
- allocate stack space. Take -mno-update into account.
- (output_prolog): Call rs6000_allocate_stack_space. Only set
- rs6000_pic_func_labelno if not profiling.
- (output_function_profiler): Implement System V profiling.
- (and_operand): Don't call reg_or_short_operand.
- (rs6000_finalize_pic): If not optimizing, insert a USE of the GOT
- register as the last insn.
-
- * rs6000.md (load/store update): Take -mno-update into account.
- If -msoft-float, support SF load/store with update to GPR regs.
- (allocate_stack): Take -mno-update into account.
- (add/subtract + multiply instructions): Take -mno-fused-madd into
- account.
- (nonlocal_goto_receiver): Specify register # to load.
- ({add,and,ior,xor}si3): Recognize operation done with full 32 bit
- constant, splitting latter if need be.
- (andsi3 define_split): Fix up splitting andsi3 of large constant.
- ({ior,xor}si3 define_split): Use GEN_INT to create integer rtx
- values.
- (movsi_got{,_internal}): Split the load of a CONST into load of
- the SYMBOL_REF/LABEL_REF and an add.
- (movsi): Know that addsi3 can handle large values now for NT.
-
- * sysv4.h (TARGET_SDATA): Remove explicit bit for -msdata.
- (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
- (ASM_OUTPUT_ALIGNED_LOCAL): Likewise.
- (SUBTARGET_SWITCHES): Indicate -m{,no-}sdata doesn't set any flags.
- (ASM_SPEC): Only pass -m{,no-}reg-names if assembling .s/.S files.
- (CC1_SPEC): If -msdata, invoke compiler with -msdata=default.
- (PROFILE_BEFORE_PROLOGUE): Likewise.
- (RS6000_MCOUNT): Define as "_mcount".
- (toc_section): Make toc_initialized a global.
-
-Fri Jun 27 19:01:11 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * config/t-linux-gnulibc1: New file.
- * configure.in (i[3456]86-*-linux*): Default thread_file is `posix'.
- (i[3456]86-*-linux*gnulibc1): New case.
- * config/linux.h (LIB_SPEC): Choose for glibc 1 or 2 depending
- on USE_GNULIBC_1.
- * i386/linux.h (CPP_SPEC, LINK_SPEC): Likewise.
-
-Fri Jun 27 19:00:52 1997 Ralf Baechle <ralf@waldorf-gmbh.de>
-
- * config/linux.h (PREFERRED_DEBUGGING_TYPE): Undefine before define.
-
-Fri Jun 27 18:35:04 1997 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * configure.in: Clean up Make-{host,target,hooks} in all
- subdirs, not just '.'.
- * Makefile.in (distclean): Delete */Make-{host,target,lang,hooks}.
-
-Fri Jun 27 18:27:11 1997 Fila Kolodny <fila@ibi.com>
-
- * config/xm-gnu.h (fcntl.h): Only include if not building libgcc.a.
-
-Fri Jun 27 18:17:44 1997 Doug Evans <dje@cygnus.com>
-
- * configure.frag: Rewrite.
-
- * objc/Make-lang.in (OBJC_CCOMMON): Object files don't go in srcdir.
- (OBJC_OBJS): Likewise.
- (OBJC_O): Likewise.
- (objc-parse.o, objc-act.o): Fix rules.
- (objc/libobjc files): Fix rules.
-
-Fri Jun 27 13:23:38 1997 Andrew Cagney <cagney@tpgi.com.au>
-
- * fp-bit.c (float_to_si): Correct return value when Inf.
-
-Fri Jun 27 10:47:09 1997 Scott Christley <scottc@net-community.com>
-
- * Makefile.in (DLLTOOL): Define.
- * objc/Make-lang.in (libobjc_entry.o, libobjc_s.a, libobjc.dll):
- New targets.
- (objc.install-normal): Install Objective-C runtime as a DLL.
- (objc.mostlyclean): Clean up files used to build DLL.
- * objc/libobjc.def: New file.
- * objc/libobjc_entry.c: New file.
-
- * objc/sendmsg.c (search_for_method_in_list): No longer static.
-
- * Makefile.in (GCC_THREAD_FILE): Renamed from OBJC_THREAD_FILE.
- * configure.lang (GCC_THREAD_FILE): Likewise.
- * configure.in (--enable-threads): New parameter.
- * objc/Make-lang.in (OBJC_THREAD_FILE): New definition.e
- * objc/config-lang.in: Print message about ObjC thread file.
-
- * cccp.c (INO_T_EQ): Define for Win32 but not Cygwin32.
- * i386/mingw32.h: New file.
- * i386/xm-mingw32.h: New file.
- * configure.in (i[3456]86-*-mingw32): New target.
- * protoize.c (link): Eliminate definition on Win32.
-
- * objc/thr-posix.c (__objc_thread_yield): Use sched_yield instead.
-
-Fri Jun 27 10:36:41 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * stor-layout.c (layout_record, PCC_BITFIELD_TYPE_MATTERS):
- Round up when calculating possible end address.
-
-Wed Jun 25 19:54:29 1997 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (final_giv_value): Verify that bl->initial_value is
- invariant before trying to use it.
-
-Wed Jun 25 18:13:05 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/sysv4.h (WCHAR_TYPE{,_SIZE}): Make wchar_t long as per
- ABI spec.
-
-Wed Jun 25 16:56:16 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * sparc.h (INCOMING_RETURN_ADDR_RTX): Define.
- (DBX_REGISTER_NUMBER): Fix frame pointer regno for -mflat.
- * sol2.h (DBX_REGISTER_NUMBER): Likewise.
- * sparc.c (save_regs): Emit dwarf2 frame debug info.
- (output_function_prologue, sparc_flat_save_restore,
- sparc_flat_output_function_prologue): Likewise.
-
- * dwarf2.h (enum dwarf_call_frame_info): Add DW_CFA_GNU_window_save.
- * dwarf2out.c (dwarf_cfi_name, output_cfi): Support it.
- (dwarf2out_cfi_label): Make non-static.
- (initial_return_save): Support PLUS.
- (dwarf2out_window_save, dwarf2out_return_save,
- dwarf2out_return_reg): New fns.
-
- * dwarf2out.c (SECTION_FORMAT): Use PUSHSECTION_FORMAT, if defined.
- (DEBUG_INFO_SECTION): Rename from DEBUG_SECTION.
- (DEBUG_LINE_SECTION): Rename from LINE_SECTION.
- * mips/iris6.h: Likewise.
-
-Wed Jun 25 16:25:41 1997 Scott Christley <scottc@net-community.com>
-
- * Makefile.in (GCC_PASSES): Don't define with $(exeext).
- * configure.in ({cc,stage_prefix}_set_by_configure): Eliminate extra
- comma and don't pass value to configure.lang.
- * objc/Make-lang.in (objc-runtime): Add objc-headers.
-
- * configure.in: Execute configure.frag in a shell.
-
- * configure.in (cross_overrides, build_overrides): Default to
- /dev/null to help platforms where sed cannot handle empty filenames.
-
- * Reorganize thread implementation to make a clearly defined
- front-end/back-end interface.
- * objc/thr-{decosf1,irix,mach,os2,posix,pthreads,single}.c: Completely
- rework according to new interface.
- * objc/thr-{solaris,win32}.c: Likewise.
- * objc/thr.c: Likewise.
- * objc/thr.h: Define front-end/back-end interface functions and
- structures.
-
-Wed Jun 25 16:14:10 1997 Ovidiu Predescu <ovidiu@net-community.com>
-
- * Complete implementation of +load.
- * objc/init.c (objc_send_load): New function.
- (objc_class_tree): New structure.
- (create_tree_of_subclasses_inherited_from): New function.
- (__objc_tree_insert_class): New function.
- (objc_tree_insert_class): New function.
- (objc_preorder_traverse): New function.
- (objc_postorder_traverse): New function.
- (__objc_tree_print): New function.
- (__objc_destroy_class_tree_node): New function.
- (class_is_subclass_of_class): New function.
- (__objc_exec_class): Allocate class tree list and load hash table.
- (__objc_send_message_in_list): Rewrite using hash table.
- (__objc_send_load): Remove calls to _objc_load_callback.
- (objc_send_load): Make static. Create Tree of classes resembling
- class hierarchy for all modules. Call __objc_send_load on all of
- the modules in __objc_module_list.
- (__objc_create_classes_tree): New function.
-
- * objc/encoding.h (method_get_sizeof_arguments): Fix typo.
- * objc/objc-api.h (OBJC_ERR_BAD_STATE): New error code.
- On NeXT redefine object_copy and object_dispose to avoid
- a conflict with those defined in system library.
- * objc/selector.c (__objc_register_instance_methods_to_class): New
- function.
- * objc/runtime.h: Likewise. Add missing function prototypes.
-
-Wed Jun 25 15:09:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (Makefile): Execute configure.frag from srcdir.
-
- * Makefile.in (configure): Target is $(srcdir)/configure.
-
-Tue Jun 24 15:18:14 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.h (LIMIT_RELOAD_CLASS): Define.
-
- * recog.c (constrain_operands): When checking earlyclobbers, use
- operands_match_p instead of rtx_equal_p.
-
- * dwarfout.c (field_byte_offset): Check for object_offset_in_bits
- greater than bitpos_int and recompute object_offset_in_bytes if true.
-
- * mips.md (movdi_internal): Add x/J alternative.
- (movdi_internal2): Add x/J alternative; change a/I to a/J.
- (movsi_internal1, movsi_internal2): Change x/I alternative to x/J.
-
-Tue Jun 24 08:49:56 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (ASM_OUTPUT_SECTION_NAME): Fix typo.
-
-Mon Jun 23 22:48:00 1997 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (find_splittable_givs): Set splittable_regs_updates to
- biv_count for reduced givs.
-
-Mon Jun 23 10:51:53 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10200.c, mn10200.h, mn10200.md: New files for mn10200 port.
- * lib1funcs.asm, divmod.c, udivmod.c, udivmodsi4.c: Likewise.
- * t-mn10200, xm-mn10200.h, va-mn10200.h: Likewise.
- * Makefile.in (USER_H): Add va-mn10200.h.
- * varargs.h, stdarg.h: Include va-mn10200.h.
- * configure.in (mn10200-*-*): New target.
-
-Sun Jun 22 06:47:19 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * combine.c (force_to_mode): Don't do anything for ASM_OPERANDS insn.
-
-Sun Jun 22 06:29:28 1997 J. Kean Johnston <jkj@sco.com>
-
- * ginclude/stdarg.h: Protect va_list definition from SCO headers.
- * ginclude/varargs.h: Likewise.
-
-Sat Jun 21 20:56:23 1997 Scott Christley <scottc@net-community.com>
-
- * Make ObjC a front-end language.
- * Makefile.in (LANGUAGES, COMPILERS, .PHONY, stmp-int-hdrs): Remove
- specific references to ObjC compiler and source files.
- ({mostly,dist,maintainer,}clean, install-normal): Likewise
- (OBJC_OBJS, OBJC, OBJECTIVE-C, cc1obj, objc-runtime): Rules deleted.
- (libobjc.a, sublibobjc.a, objc-parse.{o, c, y}): Rules deleted.
- (objc-headers, install-libobjc): Rules deleted.
- * objc/Make-lang.in: New file; from rules deleted above.
- * objc/config-lang.in: New file.
- * objc/Makefile.in: Changes to support ObjC as a front-end language;
- renamed from Makefile.in.
- * objc-act.{c,h}, objc-parse.{c,y}, objc-tree.def: Moved to objc dir.
-
-Sat Jun 21 07:54:36 1997 Robert Lipe <robertl@dgii.com>
-
- * fixinc.sco (math.h): Correct the collision of "exception".
-
-Sat Jun 21 06:51:40 1997 Peter Gerwinski <peter@agnes.dida.physik.uni-essen.de>
-
- * rs6000.c (output_epilog): Name is "GNU Pascal", not all caps.
-
-Sat Jun 21 06:29:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * gcc.c (main): Check for and read ${libdir}/gcc-lib/specs to
- override the default specs.
-
-Fri Jun 20 17:20:15 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (output_block_move): When loading addresses into registers,
- add checks for ABI_N32 and ABI_64.
- (mips_expand_prologue): Add check for SImode in code splitting
- tsize_rtx when it is large_int.
-
-Fri Jun 20 09:07:31 1997 Russell King <rmk92@ecs.soton.ac.uk>
-
- * configure.in (arm-*-linuxaout): New target.
- * arm/lib1funcs-linux.asm, arm/linux-gas.h: New files.
- * arm/linux.h, arm/t-linux, arm/xm-linux.h: New file.
- * xm-linux.h: Undef some macros before defining them.
-
-Thu Jun 19 21:18:20 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (output_line_info): Always use DW_LNE_set_address instead
- of DW_LNS_fixed_advance_pc for line number addresses.
- (size_of_line_info): Adjust size calculation as per above change.
- (text_end_label): Make it static.
-
-Thu Jun 19 14:55:49 1997 Brendan Kehoe <brendan@cygnus.com>
-
- * toplev.c (xmalloc): Only give the fatal msg if SIZE is non-zero.
-
-Sun Apr 27 23:19:13 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * libgcc2.c (__eh_type): Remove `extern' to make this a definition.
-
-Wed Jun 18 18:10:16 1997 Per Bothner <bothner@cygnus.com>
-
- * dbxout.c (dbxout_type_fields): Skip field if DECL_IGNORED_P.
-
-Wed Jun 18 18:04:33 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (end_eh_unwinder): If we have a return instruction, we
- have to make sure we use it and don't fall off the end of the
- function in the unwinder.
-
-Wed Jun 18 14:27:58 1997 Mike Stump <mrs@cygnus.com>
-
- * flow.c (find_basic_blocks): Fix end case bug.
-
-Tue Jun 17 18:35:57 1997 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__eh_pcnthrow): Add support -fno-sjlj-exceptions
- -fPIC exception handling on the SPARC.
- * sparc.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Likewise.
- * libgcc2.c (__eh_ffetmnpc): Remove.
-
-Mon Jun 16 20:28:51 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * collect2.c (extract_string): Null-terminate.
-
-Mon Jun 16 14:38:44 1997 Michael Meissner <meissner@cygnus.com>
-
- * combine.c (set_nonzero_bits_and_sign_copies): Use REG_SET macros
- instead of doing bit operations directly.
- (try_combine,reg_dead_at_p): Ditto.
- * caller-save.c (save_call_clobbered_regs): Ditto.
- * reload1.c (reload): Ditto.
- * local-alloc.c (update_equiv_regs,block_alloc): Ditto.
- * sched.c (schedule_block): Dito.
-
-Sun Jun 15 20:46:12 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (dwarf2out_frame_debug): Handle IOR.
- (struct limbo_die_struct): Define.
- (TYPE_DECL_IS_STUB): Call decl_ultimate_origin if DECL_ABTRACT_ORIGIN
- is set.
- (limbo_die_count): Delete.
- (libmo_die_list): Define.
- (new_die): Add die to limbo_die_list instead of incrementing
- limbo_die_count.
- (add_AT_location_description): Renamed from add_location_attribute.
- New parameter attr_kind.
- (add_location_or_const_value_attribute, gen_subprogram_die,
- add_bound_info): Change call to add_AT_location_description.
- (add_bound_info): Add call to contains_placeholder_p. Ignore
- MAX_EXPR and VAR_DECL.
- (add_subscript_info): Ignore the index type if it is an unnamed
- integral type.
- (scope_die_for): Move check for function-local tags after code setting
- containing_scope, and add check for non-NULL containing_scope
- (add_type_attribute): If unnamed type, use TREE_TYPE instead.
- (gen_enumeration_type_die, gen_struct_or_union_type_die): Call
- add_child_die if die_parent is NULL.
- (gen_subprogram_die): Ifdef out DW_AT_static_link code.
- (decls_for_scope): Delete decrement of limbo_die_count.
- (dwarf2out_finish): Add code to traverse the limbo_die_list, and
- call add_child_die if die_parent is NULL. Delete limbo_die_count code.
- * mips.c (mips_expand_prologue): If tsize_rtx is large_int, emit two
- insns instead of one splitable insn, setting RTX_FRAME_RELATED_P.
-
-Fri Jun 13 19:33:35 1997 Brendan Kehoe <brendan@cygnus.com>
-
- * fixincludes: Also fix AIX NULL macro in sys/{dir,param,types}.h.
-
-Thu Jun 12 22:53:12 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.md (mov[qhs]i): Remove pair of constraints which allow
- offsetable memory addresses to be moved to the same for TARGET_5200.
-
-Thu Jun 12 15:33:01 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (SELECT_RTX_SECTION): Place symbolic operands into the
- data section.
-
- * pa.c (emit_move_sequence): Rewrite code to handle arithmetic
- involving plabels.
-
-Wed Jun 11 08:57:14 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * tree.c (unsave_expr_now): Avoid recursing into the parts of
- the tree that are RTL.
-
-Thu Jun 12 09:43:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * reorg.c (emit_delay_sequence): Call set_new_first_and_last_insn
- after the new sequence insn has been spliced into the insn chain.
-
-Wed Jun 11 23:10:49 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (call, call_value): Use "call" instead of "calls"
- for calls to named functions.
-
-Wed Jun 11 00:22:34 1997 Jim Wilson <wilson@cygnus.com>
-
- * configure, configure.in: Restore changes from Feb 15 to Apr 13
- lost during conversion to autoconf.
-
-Tue Jun 10 18:23:35 1997 Mike Stump <mrs@cygnus.com>
-
- * stmt.c (expand_decl_cleanup): Avoid core dumping when exceptions
- aren't on.
-
-Tue Jun 10 18:22:30 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * collect2.c (extract_string): New fn.
- (main): Use it.
-
-Tue Jun 10 17:40:15 1997 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (emit_group_load): Add case using gen_lowpart.
-
-Tue Jun 10 17:14:58 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (rs6000_override_options): If -mcpu=403, set -mstrict-align.
-
- * rs6000/t-ppc{,gas} (MULTILIB_EXTRA_OPTS): Build libraries with
- -mstrict-align.
-
- * configure.in ({powerpc,rs6000}*-*-*): Add embedded targets to
- --with-cpu=n support.
-
-Tue Jun 10 07:06:12 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * flow.c (mark_used_regs): Fix typo in Jun 4 change.
-
-Mon Jun 9 20:26:26 1997 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (MAYBE_USE_COLLECT2): Renamed from MAYBE_USE_COLLECT.
-
-Mon Jun 9 19:42:21 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * fold-const.c (fold): Don't do COND_EXPR -> MIN_EXPR folding if it
- loses information that might be needed by a later use as an lvalue.
-
-Mon Jun 9 19:10:50 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * configure.in: Don't override a user's setting for prefix
- on platforms that use the native prefix.
-
-Mon Jun 9 19:00:49 1997 Brendan Kehoe <brendan@melange.gnu.ai.mit.edu>
-
- * integrate.c (expand_inline_function): Use the mode of FNDECL's
- result rtl, not the result type itself, in setting ARRIVING_MODE.
-
- * reload1.c (reload): Use xmalloc instead of alloca for the label
- offsets in OFFSETS_AT and OFFSETS_KNOWN_AT.
-
-Mon Jun 9 15:16:52 1997 Mike Stump <mrs@cygnus.com>
-
- * flow.c (find_basic_blocks): Eliminate more dead code, enables
- dead throws to be eliminated.
-
-Mon Jun 9 17:15:50 1997 Stephen L Moshier <moshier@world.std.com>
-
- * alpha.c (check_float_value): Underflow and overflow constants
- are different for FLOAT_VAX and default targets.
-
-Mon Jun 9 16:48:21 1997 Scott Christley <scottc@net-community.com>
-
- * Makefile.in (Makefile): Process language fragments.
- * configure.frag: New file.
- * configure.in: Move language fragment processing to configure.lang.e
-
- * Makefile.in (GCC_PASSES): Prevent all compilers from being
- built when only the C compiler is needed.
-
- * configure.in (cross_overrides, build_overrides): Use absolute
- path to GCC top-level source directory.
-
- * configure.in: Save target alias for language directories.
-
- * configure.in (with-gxx-include-dir): New parameter for
- setting the g++ header file directory.
- * Makefile.in (gxx_include_dir): Use autoconf variable.
-
- * configure.in: Add parameter for setting local prefix.
-
- * configure.lang: New file.
- * configure.in: Move language subdirectory Makefile processing
- into configure.lang.
-
-Mon Jun 9 16:44:47 1997 Jim Wilson <wilson@cygnus.com>
-
- * sched.c (attach_deaths): Fix typo in Jun 4 change.
-
-Mon Jun 9 15:13:00 1997 Marc Lehmann (pcg@goof.com)
-
- * varasm.c (assemble_end_function): Switch back to function
- section after outputting constant pool.
-
-Mon Jun 9 14:47:22 1997 Paul Eggert <eggert@twinsun.com>
-
- * tree.c (change_main_variant): Remove unused function.
- (build_array_type): Remove obsolete references to
- change_main_variant.
- * c-decl.c (complete_array_type): Likewise.
-
- * c-common.c (c_build_type_variant): Don't futz with main type
- variant of array since C Standard requires main type variant of
- array-of-const also be array-of-const.
-
- * Makefile.in: Comment out lines containing just formfeeds.
-
- * Makefile.in (distclean): Remove config.bak.
- (maintainer-clean): Output warning.
- Do not remove `configure'.
-
-Mon Jun 9 14:44:17 1997 J.T. Conklin <jtc@netbsd.org>
-
- * configure.in (*-*-netbsd): Restore changes of Apr 13th lost in
- autoconf conversion: tmake_file now t-netbsd; delete xmake_file.
-
-Mon Jun 9 14:39:29 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_builtin, case BUILT_IN_FRAME_ADDRESS):
- Use correct function name in error message.
-
- * Makefile.in (diff): Exclude bi-parser.h.
-
- * i386.h (CC1_CPU_SPEC): Renamed, was CC1_SPEC.
- (CC1_SPEC): New macro.
- (EXTRA_SPECS): Add "cc1_cpu".
- * i386/linux.h (CC1_SPEC): New macro.
-
-Mon Jun 9 13:23:06 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k/next.h (TARGET_DEFAULT): Use MASK_68040,
- not MASK_68040_ALSO.
- * m68k/mot3300.h, m68k/ccur-GAS.h (TARGET_DEFAULT): Likewise.
-
- * m68k.h (MACHINE_STATE_{SAVE,RESTORE}): Test #ifdef __mcf52000__,
- not if (TARGET_52000); fixed for mc68000 case.
-
- * m68k/mot3300.h (CPP_SPEC): Define __mc68020__ if no -m[c]68000
- command-line option given.
-
-Mon Jun 9 09:19:17 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (target_alias): Substitute with target_alias.
-
- * final.c (final_scan_insn): Use single_set to check cc_status.flags.
-
-Mon Jun 9 09:09:07 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-common.c (check_format_info): Correct handling of the 'a' flag
- which adds another pointer level.
-
-Sun Jun 8 00:34:25 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (conditional branch insns): Get length right for branches
- to targets which can not be reached with a "bl" instruction.
- * pa.c (output_cbranch): Handle branches to targets which can not
- be reached with a "bl" instruction.
-
- * pa.md (alternate dbra pattern): Remove incorrect pattern.
-
-Sat Jun 7 23:30:25 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (struct defer_plab): Renamed to struct deferred_plabel.
- Remove "symbol" field and replace with "name" field.
- (output_function_epilogue): Don't output deferred plabels here.
- (output_deferred_labels): New function. Output them here instead.
- (output_call): Rewrite long call support.
- * pa.h (ASM_FILE_END): Define.
- (LEGITIMATE_CONSTANT_P): Never accept a function_label_operand.
- * pa.md (HIGH and LO_SUM of function address): Remove patterns.
-
-Fri Jun 6 16:09:04 1997 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__eh_ffetmnpc): Add support for machines that cannot
- access globals after throw's epilogue when -fno-sjlj-exceptions is
- used.
- * rs6000.c (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Likewise.
- * mips.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Likewise.
- (INITIAL_ELIMINATION_OFFSET): Fix RETURN_ADDRESS_POINTER_REGNUM
- for 64 bit words, with 32 bit pointers and variable endianness.
-
-Fri Jun 6 17:27:58 1997 Mike Meissner <meissner@cygnus.com>
-
- * regclass.c (allocate_reg_info): Fix off by one error.
-
-Fri Jun 6 17:17:41 1997 Doug Evans <dje@cygnus.com>
-
- * basic-block.h (EXECUTE_IF_SET_IN_REG_SET): Fix setting of scan_rs_.
- (EXECUTE_IF_SET_AND_RESET_IN_REG_SET): Likewise.
- (EXECUTE_IF_AND_IN_REG_SET): Likewise.
- (EXECUTE_IF_AND_COMPL_IN_REG_SET): Likewise.
-
-Fri Jun 6 15:42:59 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (notice_cc_update): Set CC_FCOMI is this is a float compare.
-
-Fri Jun 6 15:12:38 1997 Jim Wilson <wilson@cygnus.com>
-
- * basic-block.h (REG_SET_TO_HARD_REG_SET): Fix typo.
-
- * sched.c (update_flow_info): When add extra REG_DEAD note for original
- dest, handle case where last insn both uses and sets dest.
-
-Thu Jun 5 22:19:36 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * fixinc.irix: Add declaration of __vfork to unistd.h.
-
- * i960/vx960-coff.h (CPP_SPEC): Always define CPU, even if they
- use -ansi; the VxWorks headers assume it's always present.
- * sparc/vxsparc.h (CPP_SPEC): Define, adding the CPU definition to
- what came from sparc.h.
- (CPP_PREDEFINES): Don't define it here.
-
-Thu Jun 5 13:40:33 1997 Mike Meissner <meissner@cygnus.com>
-
- * basic-block.c (OBSTACK_ALLOC_REG_SET): Rename from
- OBALLOC_REG_SET. Add obstack pointer parameter.
-
- * flow.c (function_obstack): Add declaration.
- (life_analysis): Don't allocate the space to hold to vector of
- regsets here.
- (init_regset_vector): Add pointer parameter and delete space
- paramter. Use OBSTACK_ALLOC_REG_SET to allocate. Change callers.
- (propagate_block): Use ALLOCA_REG_SET instead of bare alloca.
-
- * sched.c (schedule_block): Fix typo in yesterday's changes.
- * reorg.c (mark_target_live_regs): Ditto.
-
-Thu Jun 5 09:44:49 1997 Jeffrey A Law (law@cygnus.com)
-
- * sh.c (trap_exit, sp_switch): New variables.
- (print_operand, case '@'): If trap_exit is nonzero, then use
- a trapa instead of an rte/rts to exit the current function.
- (sh_expand_prologue): Switch stacks at function entry as needed.
- (sh_expand_epilogue): Similarly at function exit.
- (function_epilogue): Clear trap_exit and sp_switch too.
- (sh_valid_machine_decl_attribute): New function.
- * sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Define.
- (sp_switch): Declare.
- * sh.md (sp_switch_1, sp_switch_2): New named patterns.
-
-Wed Jun 4 18:11:14 1997 Michael Meissner <meissner@cygnus.com>
-
- * basic-block.h (REGSET_ELT_BITS): Make this explicitly unsigned, so
- that division and modulus of REGSET_ELT_BITS uses a pure shift.
- (*_REG_SET): New macros to abstract the register set interface.
-
- * caller-save.c (save_call_clobbered_regs): Use new *_REG_SET
- macros.
- * flow.c (life_analysis,propagate_block,insn_dead_p): Ditto.
- (regno_uninitialized,regno_clobbered_at_setjmp,mark_set_1): Ditto.
- (mark_used_regs,dump_flow_info,global_conflicts): Ditto.
- global.c (mark_elimination): Ditto.
- * reorg.c (mark_target_live_regs): Ditto.
- * sched.c (sched_{analyze_{1,insn},note_set}): Ditto.
- (birthing_insn_p,attach_deaths,unlink_notes,schedule_block): Ditto.
-
- * sched.c (sometimes structure): Delete offset, bit fields, replace
- with regno.
- (new_sometimes_live): Take regno argument, not offset and bit.
- Change all callers.
-
-Tue Jun 3 19:18:36 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * fixincludes: Fix AIX NULL macro use of void*.
-
-Tue Jun 3 15:21:04 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * sparc.h (ASM_OUTPUT_MI_THUNK): Handle -fpic.
-
-Mon Jun 2 16:53:53 1997 Michael Meissner <meissner@cygnus.com>
-
- * loop.c (n_times_{set,used}): Make type int, not short.
- (scan_loop): n_times{set,used} are now int pointers.
-
- * sched.c (sched_reg_n_deaths): Remove unused variable.
- (struct sometimes): Make fields int sized, not short.
- (schedule_insns): Don't set sched_reg_n_deaths, nobody uses it.
-
- * regclass.c (allocate_reg_info): Allocate space for reg_renumber,
- but don't set unless new argument RENUMBER_P is set. If this is first
- call for function and we need to grow space, use free/xmalloc instead
- of realloc since we will be initializing the whole array. If number
- of registers is < 0, just free up space.
- (reg_scan): Update allocate_reg_info call.
- * regs.h (allocate_reg_info): Change prototype.
- * flow.c (allocate_for_life_analysis): Update allocate_reg_info call.
- * local-alloc.c (local_alloc): Call allocate_reg_info to allocate
- and initialize the reg_renumber array.
- * stupid.c (stupid_life_analysis): Likewise.
-
-Mon Jun 2 14:50:06 1997 Dave Miller <davem@jenolan.rutgers.edu>
-
- * sparc.md (v9 eq/ne cond move patterns): Add early clobber
- constraint to destination.
-
-Fri May 30 11:00:44 1997 Michael Meissner <meissner@cygnus.com>
-
- * regs.h (reg_info): New structure to group the arrays indexed by
- register number created by reg_scan and flow_analysis that are
- globally visiable.
- (reg_n_info): Pointer to the register information array.
- (reg_n_{refs,sets,deaths,calls_crossed}): Delete variables.
- (reg_changes_size): Likewise.
- (REG_N_{REFS,SETS,DEATHS,CALLS_CROSSED}): New macros to reference
- reg_n_info.
- (REG_{CHANGES_SIZE,{FIRST,LAST,LAST_NOTE}_UID}): Likewise.
- (allocate_reg_info): Add declaration.
-
- * basic-block.h (reg_basic_block): Delete.
- (REG_BASIC_BLOCK): Use reg_n_info structure.
-
- * caller-save.c: Change all references to the above arrays to use
- the corresponding macro to access the reg_n_info array.
- * combine.c, cse.c, flow.c, global.c, jump.c, local-alloc.c: Likewise.
- * loop.c, regclass.c, reload1.c, sched.c, stupid.c, unroll.c: Likewise.
-
- * regclass.c (allocate_reg_info): New function to allocate the
- reg_info array and initialize the appropriate fields.
- (reg_scan): Call it.
- * flow.c (allocate_for_life_analysis): Call allocate_reg_info to do
- the actual allocation.
-
-Thu May 29 15:42:59 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md (movsfcc_1, movdfcc_1, movxfcc_1): Use singlemove_string
- for float conditional move when destination and operands all differ.
-
- * i386.h (ASM_OUTPUT_REG_{PUSH,POP}): add %% before register name.
-
- * go32.h (ASM_OUTPUT_ALIGN): Use .p2align, not byte alignments.
-
-Wed May 28 20:44:00 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (push_eh_entry): Eliminate start of exception region
- label, as it isn't used. Rename end_label to outer_context.
- (expand_eh_region_start_for_decl): Likewise.
- (expand_leftover_cleanups): Likewise.
- (expand_start_all_catch): Likewise.
- * except.h (eh_entry): Likewise.
- * except.c (expand_eh_region_end): Likewise. Jump around the nop
- that we insert, so that we can optimize it away, if it is unused,
- also so that flow analysis can tell if we fall through to the end
- of a function or not so that it can know if a function that returns
- a value, in fact does or not.
-
-Wed May 28 10:50:09 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (jump): Handle out of range unconditional jump
- when not optimizing.
-
-Thu May 22 00:57:07 1997 Jeffrey A Law (law@cygnus.com)
-
- * reload1.c (reload_cse_record_set): Ignore values for SREG if
- their mode is narrower than DEST_MODE.
-
- * pa.h (DFMODE_RETURN_STRING): Define.
- (SFMODE_RETURN_STRING): Likewise.
- (ASM_DECLARE_FUNCTION_NAME): Use them.
-
-Wed May 21 23:32:02 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (reload_insi): Handle SUBREG properly.
-
-Tue May 20 22:32:13 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (dwarf2out_def_cfa): Set cfa_reg at the top.
-
-Tue May 20 16:57:50 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * cplus-dem.c (do_type): Handle `J'.
- (demangle_fund_type): Print "complex" for it.
-
-Mon May 19 21:01:53 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.c (output_move_qimode): Add coldfire support.
- * m68k.h (PUSH_ROUNDING): Add coldfire support.
- * m68k.md (scc{,0}_di, seq, sne, sgt, sgtu, slt, sltu, sge, sgeu,
- sle, sleu): Add coldfire support.
-
-Mon May 19 17:53:34 1997 Mike Meissner <meissner@cygnus.com>
-
- * rs6000.c: (rs6000_pic_func_labelno): New variable.
- (rs6000_output_load_toc_table): Use it.
- (output_prolog): Store current value.
-
-Sun May 18 16:32:08 1997 Michael Meissner <meissner@cygnus.com>
-
- * dbxcoff.h (ASM_OUTPUT_SOURCE_LINE): Use macros
- ASM_{GENERATE,OUTPUT}_INTERNAL_LABEL to create/output line
- number label.
-
-Sun May 18 13:55:12 1997 John Vickers (john@rhizik.demon.co.uk)
-
- * m68k.h (TARGET_SWITCHES): Add new target name, cpu32.
-
-Sun May 18 13:50:10 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * cccp.c (VMS_write, VMS_read): Delete.
- (safe_write): If MAX_WRITE_LEN is defined, limit
- incremental write attempts to that amount.
- (safe_read): Analogous situation for MAX_READ_LEN.
- * cpplib.c (safe_read): Likewise.
- * vax/xm-vms.h (MAX_WRITE_LEN, MAX_READ_LEN): Define.
-
- * vax/xm-vms.h (get_dynamic_handler_chain_libfunc): New macro.
- (protect_cleanup_actions_with_terminate): New macro.
-
-Sun May 18 08:50:25 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/linux.h (ASM_COMMENT_START): Define.
- * m68k/linux-aout.h (ASM_COMMENT_START): Define.
-
- * reload1.c (reload_cse_regno_equal_p): Check for value using more
- than one register on a big endian machine.
-
-Sun May 18 08:39:59 1997 Vince Del Vecchio <vdelvecc@spd.analog.com>
-
- * loop.c (maybe_eliminate_biv_1): In (set (cc0) <biv>) case,
- swap compare operands when mult_val < 0 in one additional place.
-
-Sun May 18 08:33:30 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * dwarf2out.c (ASM_COMMENT_START): Add default definition.
-
- * Makefile.in (maintainer-claean): Delete configure.
-
-Sun May 18 08:31:59 1997 Scott Christley <scottc@net-community.com>
-
- * configure.in: New file.
- * Makefile.in: Change to utilize autoconf variables.
- * configure: Now an output file.
-
-Sun May 18 07:48:31 1997 J.T. Conklin <jtc@netbsd.org>
-
- * m68k.md (mov[qhs]i,movstrict[qs]i, mulsi3): Use 'Q' constraint
- for TARGET_5200.
- * m68k.h (EXTRA_CONSTRAINT): New macro.
-
- * m68k.h (TARGET_SWITCHES): Add 68020-60.
- Mask out bits which indicate a particular processor when a different
- processor is selected.
- (MASK_68040_ALSO): Remove.
- (MASK_68040): Change to be a single bit.
-
- * m68k.h (TARGET_ALIGN_INT, MASK_ALIGN_INT): New macros.
- (BIGGEST_ALIGNMENT): Determine according to TARGET_ALIGN_INT.
- (TARGET_SWITCHES): Add align-int and no-align-int.
-
- * m68k.md (mov[qhs]i}): Add pair of constraints which allow
- offsetable memory addresses to be moved to the same for TARGET_5200.
-
- * m68k.c (output_move_strict{hi,qi}): New functions.
- * m68k.h (output_move_strict{hi,qi}): Declare.
- * m68k.md (movstrict*): Changed into define_expands.
- Split insns into m68k and coldfire specific versions with appropriate
- constraints.
-
-Sun May 18 07:26:40 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * libgcc2.c (atexit): Cast malloc and realloc calls.
-
-Sat May 17 16:26:51 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * final.c (profile_function): Call function_section, not
- text_section.
-
-Sat May 17 16:01:00 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * cse.c (notreg_cost): New function, extracted from COST macro.
- (COST): Use notreg_cost.
-
-Sat May 17 15:13:23 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * cse.c (cse_insn): Don't record a SRC that's a MEM and the same
- as a REG_EQUIV note if DEST is set more than once.
-
-Fri May 16 14:50:57 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (output_move_double): Handle loading a general register
- from a scaled indexed memory address.
- * pa.md (movdf, movdi): Allow scaled loads into general registers.
-
-Fri May 16 13:31:08 1997 Mike Stump <mrs@cygnus.com>
-
- * rs6000.c (rs6000_stack_info): Only do eabi setup for "main",
- when main is the global main, not some nested routine that
- happens to be called main.
-
-Thu May 15 17:19:50 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (expand_start_all_catch): If the machine needs to
- perform any actions at the start of an expcetion handler that
- hasn't already been done, use gen_exception_receiver to emit it.
- (expand_leftover_cleanups): Likewise.
- * alpha.md (exception_receiver): Use it.
- * pa.h (exception_receiver): Use it.
-
-Thu May 15 08:36:59 1997 Jeffrey A Law (law@cygnus.com)
-
- * dbxout.c (dbxout_function_end): Don't subtract one from
- the end of function scoping stab.
-
-Wed May 14 23:27:09 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (adddi3, subdi3): Remove expanders and patterns.
-
-Wed May 14 18:51:35 1997 Mike Stump <mrs@cygnus.com>
-
- * function.c (expand_function_end): Make sure we finish off any
- leftover exception handlers.
-
-Tue May 13 14:07:01 1997 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_builtin_setjmp): Remove setting of
- current_function_has_nonlocal_goto, as this isn't a goto.
-
-Tue May 13 14:47:40 1997 Richard Earnshaw (rearnsha@cambridge.arm.com)
-
- * arm.h (CPP_SPEC): Fix typo invoking cpp_endian.
- * arm/t-semi (LIB2FUNCS_EXTRA): Build fp-bit.c when compiling
- with -msoft-float.
- * arm.c: Add prototypes for all static functions.
- (output_multi_immediate, int_log2): Make static.
-
- * arm.h (*_SPEC): Remove all references to mle/mbe.
- * arm/coff.h (MULTILIB_DEFAULTS): Likewise.
- * arm/t-bare (MULTILIB_OPTIONS): Change options mbe/mle to mbig-endian
- and mlittle-endian.
- (MULTILIB_MATCHES): Nothing matches that matters.
-
-Mon May 12 20:42:20 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (expand_start_all_catch): If need nonlocal_goto_receiver,
- add one at the start of exception handler.
- (expand_leftover_cleanups): Likewise.
-
-Mon May 12 17:36:28 1997 Jeffrey A Law (law@cygnus.com)
-
- * mips.c (move_operand): Accept any general operand after reload
- has started.
-
-Fri May 9 14:29:33 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (udivmodhi4, divmodhi4): Remove expander, give
- corresponding pattern [u]divmodhir4 name. Clear MDR register
- in the udivmodhi4 pattern itself.
- (clear_mdr): Delete pattern.
-
-Thu May 8 18:20:30 1997 Richard Earnshaw (rearnshaw@cambridge.arm.com)
-
- * arm/aout.h (ASM_OUTPUT_LONG_DOUBLE): Delete call to
- arm_increase_location.
- (ASM_OUTPUT_{DOUBLE,FLOAT,INT,SHORT,CHAR,BYTE,ASCII,SKIP}): Likewise.
- (ASM_OUTPUT_ALIGN): Delete all code refering to arm_text_location.
-
- * arm.c (arm_increase_location, get_prologue_size): Delete.
- (arm_naked_function_p): Add declaration.
- (arm_pic_register): Define.
- (all_procs): Delete entries for arm{60,620,70,7d,7di,700i,710c}; add
- entries for arm{7m,7500fe,8}, strongarm and strongarm110.
- (arm_override_options): Rework so that configure can properly set
- the default processor type. Add a warning that PIC code is not yet
- supported.
- (legitimate_pic_operand_p, legitimize_pic_address): New functions.
- (is_pic, arm_finalize_pic): New functions.
- (arm_adjust_cost): New function.
- (const_pool_offset, arm_backwards_branch, short_branch): Delete.
- (arm_insn_not_targeted): Delete.
- (add_constant): If generating AOF syntax, then handle pic specially.
- (output_ascii_pseudo_op): Delete calls to arm_increase_location.
- (function_really_clobbers_lr): Calls followed by a barrier don't
- clobber the link register.
- (output_func_prologue): Handle AOF syntax pic code.
- (output_func_epilogue): Handle cases where lr_save_eliminated is set.
- Delete call to arm_increase_location.
- (arm_asm_output_label): Simplify, since we no-longer need to cache the
- label's address.
- (aof_pic_entry): New function to keep track of pic symbols.
- (aof_dump_pic_table): New function.
-
- * arm.h (TARGET_CPU_arm*, TARGET_CPU_strongarm*, TARGET_CPU_generic):
- define.
- (CPP_ARCH_DEFAULT_SPEC): Set up based on setting of TARGET_CPU_DEFAULT.
- (CPP_SPEC): Split up into sub-rule calls.
- (CPP_CPU_SPEC): Add default definition.
- (CPP_APCS_PC_SPEC, CPP_APCS_PC_DEFAULT_SPEC): Add definitions.
- (CPP_FLOAT_SPEC, CPP_FLOAT_DEFAULT_SPEC): Add definitions.
- (CPP_ENDIAN_SPEC, CPP_ENDIAN_DEFAULT_SPEC): Add definitions.
- (CC1_SPEC): Map legacy -m[236] onto -mcpu=.. and -mapcs-{26,32} as
- appropriate. Similarly for -mbe and -mle to -m{big,little}-endian.
- (EXTRA_SPECS): Define.
- (enum processor_type): New types for arm8 and strongarm.
- (CONDITIONAL_REGISTER_USAGE): Handle flag_pic.
- (LEGITIMIZE_ADDRESS): Likewise.
- (ADJUST_COST): Define.
- (PIC_OFFSET_TABLE_REGNUM): Define.
- (FINALIZE_PIC): Define.
- (LEGITIMATE_PIC_OPERAND_P): Define.
- (OUTPUT_INT_ADDR_CONST): Define.
- (ASM_OUTPUT_MI_THUNK): Delete calls to arm_increase_location.
- (MASK_RETURN_ADDR): Use TARGET_APCS_32 not TARGET_6.
-
- * arm.md (attr cpu): Add new cpu types for arm8 and strongarm.
- (attr ldsched): New attribute, set if processor has a load_delay slot.
- (function_unit core): Rework to handle load delay slots.
- (function_unit loader): New function unit.
- (movsi): Handle pic.
- (pic_load_addr): New expand.
- (*pic_load_addr_based_insn, pic_add_dot_plus_eight): New patterns.
- (peepholes to cause flow to return to a label after a function call):
- Delete, these have been disabled for a while now.
-
- * arm/riscix.h (CPP_SPEC): Rewrite using new sub-components.
- (SUBTARGET_CPU_DEFAULT): Set to TARGET_CPU_arm2.
- * arm/riscix1-1.h (CPP_SPEC): Rewrite using new sub-components.
- (SUBTARGET_CPU_DEFAULT): Set to TARGET_CPU_arm2.
- * arm/semi.h: (CPP_SPEC): Delete.
- (PROCESSOR_DEFAULT): Delete.
- (CPP_APCS_PC_DEFAULT_SPEC): Define.
- * arm/semiaof.h (CPP_SPEC): Delete.
- (CPP_APCS_PC_DEFAULT_SPEC): Define.
- * arm/t-semi (LIBGCC1_TEST): Don't build it.
- (MULTILIB_{OPTIONS,DIRNAMES,EXCEPTIONS}): Build a suitable set of
- cross libraries.
- (LIBGCC): Set to stmp-multilib.
- (INSTALL_LIBGCC): Set to install-multilib.
-
-Thu May 8 15:20:46 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (output_float_compare): For pentiumpro use fcomip
- followed by a float stack pop for "compare;pop;pop" cases.
-
-Thu May 8 13:20:20 1997 Chris Torek <torek@elf.bsdi.com>
-
- * fold-const.c (fold, truth_andor): Disable optimization for
- side effects on RHS.
-
-Wed May 7 15:43:57 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (start_dynamic_handler): Fix so we can use __builtin_setjmp,
- and default to using __builtin_setjmp instead of setjmp.
- * expr.c (expand_builtin_setjmp): New routine, split out from
- existing inline code from expand_builtin.
- (expand_builtin): Split out code into expand_builtin_setjmp.
- * expr.h (expand_builtin_setjmp): Add declaration.
- * libgcc2.c (__sjthrow): Default to using __builtin_setjmp instead
- of setjmp.
- (__sjpopnthrow): Likewise.
- * optabs.c (init_optabs): Likewise.
-
-Wed May 7 18:01:24 1997 Samuel Figueroa <Samuel_Figueroa@next.com>
-
- * rs6000.md (insv): Only combine insert with shift if
- remaining source bits >= destination field size.
-
-Tue May 6 15:48:52 1997 Jason Merrill <jason@gerbil.cygnus.com>
-
- * dwarf2out.c (dwarf2out_begin_prologue): Increment
- current_funcdef_number here.
- (dwarf2out_end_epilogue): Not here.
-
-Mon May 5 18:52:32 1997 Jeffrey A Law (law@cygnus.com)
-
- * h8300.c (notice_update_cc): Use CC_SET_ZN and CC_SET_ZNV.
- (shift_one, shift_two): Set CC_NO_CARRY as needed. Remove
- references to CC_OVERFLOW_0.
- (emit_a_shift): Similarly.
- * h8300.h (CC_OVERFLOW_0): Remove.
- * h8300.md: Use set_zn and set_znv for cc0 tracking.
- (bCC): Restore the comparison is CC_OVERFLOW_UNUSABLE is set and
- the comparison needs the overflow bits.
-
- * mn10300.c (notice_update_cc): Use CC_SET_ZN and CC_SET_ZNV.
- * mn10300.h (CC_NO_CARRY): Define.
- * mn10300.md: Use "set_zn" and "set_znv" to more accurately
- describe cc0 status.
-
-Fri May 2 17:00:33 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c: Reorganize, moving .debug_frame support to the top
- of the file, and compile it if INCOMING_RETURN_ADDR_RTX is defined
- even if DWARF2_DEBUGGING_INFO isn't.
- (EH_FRAME_SECTION): New macro.
- (output_call_frame_info): Handle .eh_frame variant.
- (dwarf2out_def_cfa): Update cfa_*{reg,offset}.
- (dwarf2out_frame_debug): Move cfa_*{reg,offset} to file scope.
- (dwarf2out_end_epilogue): Increment current_funcdef_number here.
- (dwarf2out_decl): Not here.
- (dwarf2out_frame_init, dwarf2out_frame_finish): New fns.
- (dwarf2out_init, dwarf2out_finish): Call them.
- (output_die): Add missing 'case 8:'
- (dwarf2out_decl): Revert other context_die = NULL change.
- (add_bound_info): Restore default case.
-
-Fri May 2 15:30:16 1997 Doug Evans <dje@seba.cygnus.com>
-
- * m32r.h (LIT_NAME_P): New macro.
- (SMALL_NAME_P): Use it.
- (ASM_OUTPUT_ALIGNED_COMMON): Don't output to scommon if -msdata=none.
- * m32r.c (addr24_operand): Handle literals.
- (m32r_output_function_prologue): Use IMMEDIATE_PREFIX.
- (m32r_output_function_epilogue): Likewise. Use shorter add insn if
- able.
-
-Fri May 2 14:40:44 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (RS6000_ALIGN): Macro renamed from ALIGN.
- * rs6000.c (rs6000_stack_info): Use it.
-
-Fri May 2 14:15:54 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (reload_cse_noop_set_p): When checking the values
- equivalent to sreg, make sure the mode is right.
-
-Fri May 2 12:53:03 1997 Jeffrey A Law (law@cygnus.com)
-
- * reload1.c (reload_cse_invalidate_regno): Properly set
- the mode for invalidate_regno_rtx.
-
-Thu May 1 14:57:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (call_internal_symref): Fix typo.
-
-Thu May 1 14:44:17 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (mips_asm_file_start): Use new macro TARGET_FILE_SWITCHING.
- (mips_asm_file_end): Likewise.
- * mips.h (TARGET_FILE_SWITCHING): Define.
- (NO_DBX_FUNCTION_END): Define.
-
-Thu May 1 09:08:40 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.c (output_addsi3): Replace "\\;" by "\n\t" in
- assembler templates.
-
-Thu May 1 09:00:42 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * integrate.c (subst_constants, case SUBREG): Cancel changes once
- done with result.
-
-Wed Apr 30 19:45:56 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (override_options): Set mips_split_addresses only if
- TARGET_SPLIT_ADDRESSES is set.
- * mips.h (MASK_SPLIT_ADDR, TARGET_SPLIT_ADDRESSES): New macros.
- (TARGET_SWITCHES): Add -msplit-addresses, -mno-split-addresses.
- * configure (mips*-*-ecoff*, mips*-*-elf*): Set MASK_SPLIT_ADDR
- bit in target_cpu_default2.
-
- * flags.h (current_function_is_thunk): Add extern to declaration.
-
- * dbxout.c (dbxout_function): Test NO_DBX_FUNCTION_END at run time
- instead of compile time.
-
- * unroll.c (set_dominates_use): In second loop, add check for copy_end.
-
- * mips.md (paradoxical_extendhidi2, paradoxical_extendqidi2): New
- patterns.
-
-Wed Apr 30 02:23:24 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * output.h (named_section): Add reloc argument.
- (DECL_READONLY_SECTION): New macro.
- * varasm.c (named_section): Add reloc argument, pass it to
- ASM_OUTPUT_SECTION_NAME.
- (UNIQUE_SECTION, UNIQUE_SECTION_P): Provide defaults.
- (function_section): Pass reloc argument to named_section.
- (variable_section, exception_section): Likewise.
- (output_constant_def_contents): Likewise.
- (assemble_start_function): Use UNIQUE_SECTION_P. UNIQUE_SECTION is
- now a statement.
- (assemble_variable): Likewise.
- * mips/iris6.h (ASM_OUTPUT_SECTION_NAME): Add reloc arg,
- use DECL_READONLY_SECTION.
- * psos.h, ptx4.h, a29k.h, alpha/elf.h, arm/coff.h, h8300.h: Likewise.
- * i386/go32.h, i386/sco5.h, m68k/coff.h, mips/elf64.h: Likewise.
- * mips/netbsd.h, pa.h, rs6000/sysv4.h, sh.h, sparc/sysv4.h: Likewise.
- * config/svr4.h (SELECT_SECTION): Use DECL_READONLY_SECTION.
- (ASM_OUTPUT_SECTION_NAME): Likewise, add reloc argument.
- (MAKE_DECL_ONE_ONLY): Just set DECL_WEAK.
- (UNIQUE_SECTION, UNIQUE_SECTION_P): Define.
- * i386/cygwin32.h (UNIQUE_SECTION_P): Define.
- (SUPPORTS_ONE_ONLY): Define.
- (MAKE_DECL_ONE_ONLY): Lose.
- (ASM_OUTPUT_SECTION_NAME): Add reloc arg, use DECL_READONLY_SECTION.
- * i386/winnt.c (i386_pe_unique_section): Add reloc arg,
- use DECL_READONLY_SECTION.
-
- * mips/iris6.h (CTORS_SECTION_ASM_OP): Change aligment based on ABI.
- (DTORS_SECTION_ASM_OP): Likewise.
-
-Tue Apr 29 16:08:07 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa/lib1funcs.asm (divnorm, modnorm, exitdiv): Fix code to
- negate SImode values.
-
-Tue Apr 29 12:54:14 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (expand_eh_region_start_tree): Add DECL argument so we
- can better track why the region was made for error reporting.
- * except.h (expand_eh_region_start_tree): Likewise.
- * tree.h (expand_dhc_cleanup): Likewise.
- (expand_dcc_cleanup): Likewise.
- * except.c (expand_eh_region_start_for_decl): New routine.
- * except.h (expand_eh_region_start_for_decl): Likewise.
- * stmt.c (expand_decl_cleanup): Add DECL to call of
- expand_eh_region_start_tree.
- (expand_dcc_cleanup): Likewise.
- (expand_dhc_cleanup): Likewise.
- (expand_start_case): Switches introduce conditional contexts.
- (expand_start_case_dummy): Likewise.
- (expand_start_case_dummy): Likewise.
- (expand_end_case): Likewise.
-
-Tue Apr 29 11:45:09 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (dwarf2out_decl): Undo earlier change.
- (constant_size): Likewise.
- (gen_subprogram_die): Handle NULL context_die.
-
- * mips/iris6.h (ASM_OUTPUT_CONSTRUCTOR): Fix for -mabi=64.
- (ASM_OUTPUT_DESTRUCTOR): Likewise.
-
-Mon Apr 28 09:10:19 1997 Jeffrey A Law (law@cygnus.com)
-
- * h8300.c (push_order, pop_order): Add missing initializer entries.
-
-Fri Apr 25 19:39:43 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * h8300.c (output_adds_subs): Check for adding 0.
-
-Fri Apr 25 14:52:31 1997 Jim Wilson <wilson@cygnus.com>
-
- * configure (i[3456]86-*-freebsdelf*, i[3456]86-*-freebsd*): Use
- t-freebsd instead of x-freebsd.
- * i386/t-freebsd: Renamed from x-freebsd.
-
-Fri Apr 25 12:16:20 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * go32.h (DBX_*): Use definitions from config/dbxcoff.h instead.
-
-Fri Apr 25 11:55:54 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386/cygwin32.h (MULTIPLE_SYMBOL_SPACES): Define.
-
-Thu Apr 24 18:32:56 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386/winnt.c (i386_pe_unique_section): New fn.
- * i386/cygwin32.h (UNIQUE_SECTION): Define.
- (MAKE_DECL_ONE_ONLY): Define.
- (ASM_OUTPUT_SECTION_NAME): Support DECL_ONE_ONLY.
-
- * c-decl.c (implicitly_declare): Don't set DECL_ARTIFICIAL.
-
-Thu Apr 24 17:11:23 1997 Jim Wilson <wilson@cygnus.com>
-
- * m68k.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Add
- TARGET_5200 support.
-
-Thu Apr 24 16:39:25 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * stmt.c (pushcase_range): Check for null range first.
-
-Wed Apr 23 23:06:28 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (reload_cse_record_set): Use push_operand to check for
- changes to the stack pointer.
-
-Wed Apr 23 19:56:01 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * calls.c (expand_call): If we're in a thunk, pass through invisible
- references instead of making a copy.
- * flags.h: Add current_function_is_thunk.
- * function.c: Likewise.
- (init_function_start): Initialize it.
- (push_function_context_to): Save it.
- (pop_function_context_from): Restore it.
- * function.h (struct function): Add is_thunk.
-
-Wed Apr 23 17:47:25 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (secondary_reload_class): Handle more cases where we
- need secondary reloads.
- (impossible_plus_operand): Accept anything that involves addition
- of the stack pointer.
- * mn10300.md (reload_insi): Always load the stack pointer into
- the destination (which is always an address register).
- * mn10300.h (STORE_FLAG_VALUE): Remove definition.
- * xm-mn10300.h: Declare malloc, realloc, calloc and free.
-
-Wed Apr 23 14:28:30 1997 Mike Stump <mrs@cygnus.com>
-
- * expr.h (sjthrow_libfunc): Add support for setjmp/longjmp based
- exception handling.
- ({sjpopnthrow,terminate,setjmp,longjmp}_libfunc): Likewise.
- (get_dynamic_handler_chain_libfunc): Likewise.
- * expr.c (expand_expr, case TRY_CATCH_EXPR): Likewise.
- (expand_expr, case POPD{C,H}C_EXPR): Likewise.
- * stmt.c (mark_block_as_eh_region): Likewise.
- (mark_block_as_not_eh_region): Likewise.
- (is_eh_region, conditional_contex, expand_start_bindings): Likewise.
- (expand_end_bindings, expand_{decl,dcc,dhc}_cleanup): Likewise.
- (expand_cleanups): Likewise.
- * tree.h (mark_block_as_eh_region): Likewise.
- (mark_block_as_not_eh_region, is_eh_region): Likewise.
- conditional_context, expand_dhc_cleanup): Likewise.
- * except.c (exception_via_longjmp): Likewise.
- (protect_cleanup_actions_with_terminate): Likewise.
- (current_function_d{h,c}c, add_partial_entry): Likewise.
- (get_dynamic_{handler,cleanup}_chain): Likewise.
- (start_dynamic_{cleanup, handler}): Likewise.
- (expand_eh_region_start{,_tree}, expand_eh_region_end): Likewise.
- (emit_throw, expand_leftover_cleanups): Likewise.
- (expand_{start,end}_all_catch, protect_with_terminate): Likewise.
- ({start,end}_eh_unwinder, init_eh_for_function): Likewise.
- ({save,restore}_eh_status, exception_optimize): Likewise.
- * optabs.c ({sjthrow,sjpopnthrow,terminate,setjmp}_libfunc): Likewise.
- ({longjmp,get_dynamic_handler_chain}_libfunc): Likewise.
- (init_optabs): Likewise.
- * except.h: Likewise.
- * libgcc2.c (__default_terminate): Likewise.
- (__terminate, __get_dynamic_handler_chain, __sjthrow): Likewise.
- (__sjpopnthrow): Likewise.
- * toplev.c (f_options): Likewise.
- * tree.def (TRY_CATCH_EXPR, POPDHC_EXPR, POPDCC_EXPR): Likewise.
- * pa.h (JMP_BUF_SIZE): Define.
- * sparc.h (JMP_BUF_SIZE): Define.
-
- * expr.h (cleanups_this_call): Transform uses of cleanups_this_call
- into uses of the cleanups managed by the block code
- (expand_start_bindings and friends). Remove defer_cleanups_to and
- expand_cleanups_to, and use start_cleanup_deferal and
- end_cleanup_deferal instead. Add exception_region,
- target_temp_slot_level, conditional_code,
- last_unconditional_cleanup and cleanup_ptr to struct nesting to
- facilitate conditional cleanups.
- * expr.c (cleanups_this_call, init_expr): Likewise.
- ({save,restore}_expr_status, store_expr): Likewise.
- (expand_expr, {defer,expand}_cleanups_to): Likewise.
- (do_jump, case TRUTH_{AND,OR}IF_EXPR): Likewise.
- (do_jump, case COND_EXPR): Likewise.
- * stmt.c (struct nesting): Likewise.
- (expand_return, expand_start_bindings, expand_end_bindings): Likewise.
- (expand_cleanups, {start,end}_cleanup_deferal): Likewise.
- * tree.h (start_cleanup_deferal): Likewise.
- (end_cleanup_deferal): Likewise.
- * calls.c (expand_call): Likewise.
- * function.h (struct function): Likewise.
- * except.c (asynchronous_exceptions): Support
- -fasynchronous_exceptions.
- (can_throw): Likewise.
- * toplev.c (f_options): Likewise.
-
- * flags.h (flag_short_temps): Remove support for short temps.
- * calls.c (expand_call): Likewise.
- * toplev.c (flag_short_temps): Likewise.
-
- * stmt.c (expand_start_target_temps): Add for convenience.
- (expand_end_target_temps): Likewise.
- * except.c (jumpif{,not}_rtx): Likewise.
-
- * stmt.c: Remove all traces of empty_cleanup_list.
-
-Wed Apr 23 17:26:40 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (reload_cse_mem_conflict_p): Don't assume that a
- SUBREG can not conflict with a MEM.
-
-Wed Apr 23 09:48:58 1997 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.md (cmphi): Fixed when next CC user is unsigned.
- (mov[hq]i-[23]): New patterns for mem-indirect moves.
- (movhf,movtqf): Corrected.
- * 1750a.c (memop_valid): Memory indirection now valid.
- (nonindirect_operand): Remove.
- (print_operand): Fix the 'J' output modifier.
- * 1750a.h (FRAME_POINTER_REQUIRED): Not required.
- (INITIAL_FRAME_POINTER_OFFSET,FIX_FRAME_POINTER_ADDRESS): Undefine.
- (FUNCTION_PROLOGUE,FUNCTION_EPILOGUE): Honor -fomit-frame-pointer.
- (ELIMINABLE_REGS,CAN_ELIMINATE,INITIAL_ELIMINATION_OFFSET): Defined.
- (PREFERRED_RELOAD_CLASS): Corrected.
- (CONST_COSTS,ADDRESS_COST,REGISTER_MOVE_COST,MEMORY_MOVE_COST):
- Slight adjustments.
- (ASM_APP_ON,ASM_APP_OFF): Corrected.
- * ms1750.inc (DUCR.M,DUC.M): Defined.
-
-Wed Apr 23 09:41:35 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * reload.c (push_reload): Fix last arg of call to find_dummy_reload.
-
-Wed Apr 23 09:29:14 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure (i[3456]86-next-*, m68k-next-nextstep{2,3}*):
- Remove out_file and add extra_objs.
- * config/nextstep.c: Add includes for config.h, stdio.h, and flags.h.
- * {i386,m68k}/t-next (nextstep.o): New rule.
- * m68k/next.h: Remove include of machmode.h.
- * {i386,m68k}/next.c: Files deleted.
-
-Tue Apr 22 20:45:29 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * sparc.h (DBX_CONTIN_LENGTH): Shrink to 1000.
-
-Tue Apr 22 18:21:20 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (gen_variable_dir): Add test for DW_AT_declaration to
- the old_die if statement, and delete assertion for it.
- (decl_ultimate_origin): Remove last change.
-
-Tue Apr 22 10:22:27 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (expand_prologue): End the current sequence before
- counting the tst insns in the current function. Start a new
- one before emitting any prologue instructions.
-
- * mn10300.h (REGISTER_MOVE_COST): Bump up cost of moves in the
- same class.
-
- * mn10300.md (untyped_call): New expander.
-
-Mon Apr 21 16:30:21 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * cse.c (fold_rtx, case PLUS): When seeing if negative of constant
- is around, make sure not dealing with largest negative.
-
-Mon Apr 21 13:57:53 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips/t-ecoff: Set TARGET_LIBGCC2_CFLAGS instead of LIBGCC2_CFLAGS.
-
- * m68k.c (output_addsi3): New function. From addsi3 pattern.
- * m68k.h (output_addsi3): Add declaration.
- * m68k.md (movqi+2): Add address registers.
- (movxf+1): Disable for TARGET_5200.
- (movxf+2): New pattern for TARGET_5200.
- (addsi3): Add define_expand. Move code to output_addsi3.
- (addsi3_internal): Renamed from addsi3. Disable for TARGET_5200.
- (addsi3_5200): New pattern for TARGET_5200.
-
-Sun Apr 20 10:45:35 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * fold-const.c (operand_equal_p): Constants are not equal if there
- has been an overflow.
-
- * toplev.c (compile_file): Shorten "branch-probabilities" in
- output of times.
-
- * alpha/vms.h (MOD[SD]I3_LIBCALL): Call ots$rem, not ots$mod.
- (DWARF2_DEBUGGING_INFO): Define.
-
- * alpha.c (alpha_need_linkage): Call get_identifier.
-
- * rs6000.c (rs6000_output_load_toc_table): New function.
- (output_prolog): Call it instead of doing it directly.
- * rs6000.md (nonlocal_goto_receiver): New pattern.
-
- * dwarf2out.c: Major cleanup; mostly reformatting.
- Include expr.h.
- Undefine inline ifndef __GNUC__; never define to include static.
- Add "static" to header of all inlined functions.
- Add declarations for all static functions, with prototypes.
- (addr_const_to_string): Use HOST_WIDE_INT_PRINT_* macros.
- (add_AT_*, new_{die,loc_descr,cfi): Don't check for xmalloc
- returning zero.
- (modified_type_die): Add missing parm on recursive call.
- ({reg,based}_loc_descriptor): Add missing arg to call to new_loc_descr.
- (add_const_value_attribute): Use REAL_VALUE_TYPE for fp calculations.
- (output_call_frame_info): Add missing arg to output_cfi call.
- (dwarf2out_def_cfa): Local variable OLD_REG must be unsigned long.
- * Makefile.in (dwarf2out.o): Includes expr.h.
-
- * dwarf2out.c: Cast first arg in all calls to bzero to char *.
- (decl_ultimate_origin): Return NULL if equal to decl.
- (constant_size): Never return more than 4.
- (value_format, case 8): New case.
- (dwarf2out_frame_debug): Use HARD_FRAME_POINTER_REGNUM.
- (based_loc_descr): Likewise.
- (add_bound_info): Delete default case.
- Add cases for CONVERT_EXPR and NON_LVALUE_EXPR; treat like NOP_EXPR.
- Change NOP_EXPR to recursive call.
- (add_type_attribute): Ignore unnamed subtype of integral or FP.
- (gen_subprogram_die): Use reg_loc_descriptor.
- (dwarf2out_decl): Ignore nested functions.
-
- * fix-header.c, protoize.c, gcov.c: Use symbolic codes for exit.
-
- * final.c (profile_function): Only call ASM_OUTPUT_REG_{PUSH,POP}
- if defined.
-
- * expr.c ({move,clear}_by_pieces_1, expand_assignment): Ensure
- we have unshared rtx before changing flags.
- (store_{constructor,field}): Likewise.
- (expand_expr, case COMPONENT_REF): Likewise.
- (store_expr): Check if TEMP and TARGET are same with rtx_equal_p.
-
- * emit-rtl.c (change_address, init_emit): Delete forward references.
- (rtl_obstack, stack_depth, max_stack_depth): Delete extern decls.
-
-Fri Apr 18 18:25:52 1997 Jim Wilson <wilson@cygnus.com>
-
- * function.c (instantiate_decls): For DECL_INCOMING_RTL, use max
- of type size and mode size in instantiate_decl call.
-
- * fixincludes (sys/lc_core.h): Fix OSF1/4.x namespace pollution.
-
-Wed Apr 16 19:36:53 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (add_bound_info): Use a DIE instead of a location
- expression for variable bounds. Trust a MEM rtx even when
- optimizing.
- (DWARF_FRAME_RETURN_COLUMN): Default to FIRST_PSEUDO_REGISTER.
-
- * expr.c (expand_expr, case RTL_EXPR): If there is no sequence,
- don't set it to const0_rtx.
- * tree.c (array_type_nelts): Don't return any SAVE_EXPRs.
-
-Mon Apr 14 18:12:57 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (RS6000_ITRUNC, RS6000_UITRUNC): Prepend underscores.
- (RS6000_MCOUNT): New macro.
- (ASM_FILE_START): Use RS6000_MCOUNT.
- * rs6000.c (output_function_profiler): Use RS6000_MCOUNT.
- * rs6000/aix31.h (RS6000_{ITRUNC,UITRUNC,MCOUNT}): New macros.
-
-Mon Apr 14 14:37:27 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (can_use_return_insn): Include outgoing argument
- area in size computation.
- (expand_prologue): Likewise. No longer diddle with sequences.
- Put register saves just before outgoing argument area.
- (expand_epilogue): Similarly.
- (impossible_plus_operand): New function.
- * mn10300.h (FRAME_POINTER_REQUIRED): Never require a frame pointer.
- (ACCUMULATE_OUTGOING_ARGS, OUTGOING_REG_PARM_STACK_SPACE): Define.
- (impossible_plus_operand): Declare.
- * mn10300.md (reload_insi): New expander to handle pathological
- reload cases.
- (addsi3): Fix CC status.
-
- * mn10300.h (FUNCTION_VALUE): Return addresses in $a0.
- (FUNCTION_VALUE_REGNO_P): Corresponding changes.
- * mn10300.md (call_value_internal): Allow output to be in an
- address register.
-
- * calls.c (emit_library_call): Handle saving of stack slots when
- ACCUMULATE_OUTGOING_ARGS is defined.
- (emit_library_call_value): Likewise.
-
-Mon Apr 14 14:48:15 1997 Jim Wilson <wilson@cygnus.com>
-
- * sh.md (xtrct_left, xtrct_right): New patterns.
-
- * combine.c (get_last_value_validate): New argument insn.
- Add check for memory reference clobbered by later store.
- (record_value_for_reg, get_last_values): Pass in new argument.
-
-Mon Apr 14 14:03:18 1997 Mike Meissner <meissner@cygnus.com>
-
- * configure (powerpc --with-cpu=x): Add embedded powerpcs and 604e.
-
- * rs6000.c (rs6000_override_options): Recognize -mcpu=801, -mcpu=823,
- and -mcpu=604e.
-
-Sun Apr 13 18:43:16 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (invalidate_regno_rtx): New static variable.
- (reload_cse_invalidate_regno): Check whether any earlier registers
- have a multi-register value which includes the register we are
- invalidating.
- (reload_cse_regs): Initialize invalidate_regno_rtx.
-
- * reload1.c (reload_cse_record_set): When setting reg_values for a
- copy from one register to another, use gen_lowpart_common to
- adjust the value correctly if the mode changes.
-
-Sun Apr 13 17:24:48 1997 Doug Evans <dje@cygnus.com>
-
- * expr.c (move_block_from_reg): Try using integral mov operation first.
-
- * calls.c (expand_call): When copying unaligned values into a register,
- zero out the register first rather than emitting a clobber.
-
- * integrate.c (copy_rtx_and_substitute): If FRAME_GROWS_DOWNWARD
- and regno == VIRTUAL_STACK_VARS_REGNUM, round size of stack slot up
- before calling assign_stack_temp.
-
-Sun Apr 13 15:29:38 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * enquire.c (fake_f_rep): Add missing element name in cast.
-
-Sun Apr 13 15:20:05 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * stor-layout.c (layout_record, PCC_BITFIELD_TYPE_MATTERS):
- Fix sign bug in last change.
-
-Sun Apr 13 15:03:38 1997 J.T. Conklin <jtc@netbsd.org>
-
- * m68k.md (movstricthi): Remove extraneous comparisons.
-
- * configure (*-*-netbsd): tmake_file now t-netbsd; delete xmake_file.
- * config/t-netbsd: New file.
- * config/x-netbsd: Removed.
-
-Sun Apr 13 14:51:25 1997 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * cse.c (canon_reg, cse_insn): Don't examine insn_n_dups if
- recog_memoized fails to find a match.
-
-Sun Apr 13 14:17:26 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (reload_cse_noop_set_p): Add insn parameter. Change
- all callers. If deleting the instruction, remove any earlier
- REG_DEAD note for DREG.
- (reload_cse_simplify_set): If simplifying, remove any earlier
- REG_DEAD note for the new source register.
-
-Sun Apr 13 14:12:08 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * libgcc2 (L_bb, L_exit): Use 0 rather than NULL for null pointers.
-
-Sun Apr 13 12:53:03 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/linux.h (ASM_SPEC): Define.
- (STRUCT_VALUE_REGNUM, STATIC_CHAIN_REGNUM, INITIALIZE_TRAMPOLINE):
- Remove definitions, undoing the change of Mar 20 1996.
-
- * m68k.c (output_move_qimode): Optimize pushing one byte if source
- operand does not use stack pointer.
-
- * m68k.md (rotl[shq]i3, rotl[hq]i3+1): Don't directly modify operand.
-
- * m68k.md (tstdi): Add missing parallel around the pattern.
-
-Sun Apr 13 12:51:00 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c, cpplib.c (do_include): Diagnose #import and
- #include_next if pedantic and if not in a system header.
- (do_warning): #warning now causes an error if -pedantic-errors
- is given; this is needed since #warning isn't ANSI.
-
- * toplev.c (lang_options): Add -Wundef, -Wno-undef.
- * c-decl.c (c_decode_option): Ignore -Wundef, -Wno-undef.
-
- * cccp.c, cexp.y (warn_undef): New variable.
- * cpplib.h (struct cpp_options): New member warn_undef.
- (CPP_WARN_UNDEF): New macro.
-
- * cccp.c (main), cpplib.c (cpp_handle_options): Set warn_undef
- from -Wundef and -Wno-undef.
-
- * cppexp.c (cpp_lex) New arg skip_evaluation.
- (cpp_parse_expr): Pass skip_evaluation to cpp_lex.
- Abort if cpp_lex returns NAME.
-
- * cexp.y (exp), cppexp.c (cpp_lex): Optionally warn about undefined
- identifiers that evaluate to 0.
-
-Sun Apr 13 11:43:16 1997 Joel Sherrill <joel@OARcorp.com>
-
- * configure (hppa1.1-*-rtems*): New target.
- * mips/rtems.h: New file.
-
-Sun Apr 13 09:48:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * gcov.c (print_usage, open_files): Use FATAL_EXIT_CODE.
- * collect2.c (fatal_perror, fatal, collect_wait): Likewise.
-
- * sparc.c (eligible_for_delay_slot): Clean up and make to agree
- precisely with patterns in MD file.
- * sparc.md (*return_addsi): Change condition to exclude both ints.
- (*return_adddi): Likewise.
- (*return_subsi): New pattern.
-
- * recog.c (validate_replace_rtx_1, case MINUS): New case.
-
-Sun Apr 13 08:20:24 1997 Thomas Bushnell <thomas@gnu.ai.mit.edu>
-
- * i386/gnu.h (TARGET_VERSION): Redefine.
-
-Sun Apr 13 08:15:31 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * c-typeck.c (lookup_field): Don't recurse unless FIELD is
- a RECORD_TYPE or UNION_TYPE.
-
- * final.c (profile_function): Save the static chain register
- around the call to the profiler function.
-
- * loop.c (invariant_p, case REG): Pointers into frame are not
- invariants if function has nonlocal gotos.
- * reload1.c (reload): If function has nonlocal label, mark all
- caller-saved regs as used.
-
-Fri Apr 11 16:49:06 1997 Doug Evans <dje@seba.cygnus.com>
-
- * m32r.h (REG_ALLOC_ORDER): Restore to original setting.
-
- * m32r.h (UPPER16_P): Fix calculation.
- * m32r.c (two_insn_const_operand): New function.
- (m32r_print_operand): Handle 'X'.
- * m32r.md (movsi): Tweak.
- (*movsi_insn): Output hex value of constants too.
- (movsi define_split): Add.
- (andsi3,orsi3,xorsi3): Output hex value of constants too.
-
-Thu Apr 10 18:39:33 1997 Jim Wilson <wilson@cygnus.com>
-
- * sh.md (sne): Modified to use negc instead of xor.
- (sne+1): New define_split for new sne pattern.
- * sh.c (output_stack_adjust): Reorganize code for readability.
- If size is negative, negate and subtract it instead of adding it.
-
-Wed Apr 9 13:51:07 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (output_stack_adjust): When splitting an adjustment into two
- parts, make sure the stack is aligned at all times.
-
-Tue Apr 8 12:34:38 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.h (RETURN_ADDR_RTX): Define.
-
-Mon Apr 7 19:19:57 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (count_tst_insns): New function.
- (expand_prologue): Load zero into data and/or address registers
- if any are free and the function has optimizable tst insns.
- (output_tst): If a suitable register is known to have the
- value zero, use it instead of searching for a suitable register.
- * mn10300.h (zero_dreg, zero_areg): Declare.
- (FRAME_POINTER_NEEDED): Frame pointers are not needed if the
- outgoing argument size is zero.
- * mn10300.md (movXX): Optimize loading zero into an address
- register if possible. Optimize loading a DF/DI mode value
- into an address register from a constant memory address.
- (addsi3): Provide alternative which doesn't require a matching
- inout operand.
- (return): Optimize consecutive return instructions.
-
-Mon Apr 7 17:30:35 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * mips/iris5.h (SUBTARGET_CC1_SPEC): Define.
- (LINK_SPEC, STARTFILE_SPEC): Support -static.
- * mips/iris6.h (SUBTARGET_CC1_SPEC): Define.
- (STARTFILE_SPEC, LINK_SPEC): Support -static.
- * mips.h: (SUBTARGET_CC1_SPEC): Define.
- (CC1_SPEC): Add subtarget_cc1_spec.
- (EXTRA_SPECS): Add subtarget_cc1_spec.
-
-Sun Apr 6 12:24:53 1997 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.md (incscc): Use a match_operand with cc_register to match
- the condition code register.
- (decscc, *condbranch, *condbranch_reversed, *mov_scc): Likewise.
- (*mov_negscc, *mov_notscc, *cond_return): Likewise.
- (*cond_return_inverted, *ior_scc, *cond_move): Likewise.
- (insv): New expand.
- (andsi_notsi_si): Renamed from *andsi_notsi_si.
- (andsi_not_shiftsi_si): New insn.
- (*minmax_arithsi): Don't match this insn if operand1 is an
- eliminable register.
- ({sin,cos}*): Delete, since the ARM always emulates these its
- faster to call a library function.
- (movsicc, *movsicc_insn): Make operand0 an s_register_operand,
- and operand3 an arm_not_operand. Use cc_register to match the
- condition code register.
- (mov[sd]fcc*): Make operand[0,2] s_register_operands, and operand3
- the nonmemory_operand. Use cc_register to match the condition
- code register.
- (*ifcompare_plus_move): Move before *ifcompare_arith_move. Just do
- a split for the output.
- (*ifcompare_move_plus): Similarly, but relative
- to *ifcompare_move_arith.
- (*if_plus_move, *if_move_plus): New patterns.
- (*ifcompare_arith_arith): Simplify the alternatives down to just one,
- and split the insn before output.
- (*if_arith_arith, *if_arith_move, *if_move_arith): New patterns.
- (*ifcompare_move_not, *ifcompare_not_move): Simplify and split the
- insn before output.
- (*if_move_not, *if_not_move): New patterns.
- (*ifcompare_shift_move, *ifcompare_move_shift): Simplify and split the
- insn before output.
- (*if_shift_move, *if_move_shift): New patterns.
- (*ifcompare_shift_shift): Simplify and split the insn before output.
- (*if_shift_shift): New pattern.
- (*ifcompare_not_arith, *ifcompare_arith_not): Simplify and split the
- insn before output.
- (*if_not_arith, *if_arith_not): New patterns.
- (*ifcompare_neg_move, *ifcompare_move_neg): Simplify and split the
- insn before output.
- (*if_neg_move, *if_move_neg): New patterns.
-
-Sat Apr 5 20:17:43 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/sol-ci.asm (_environ): Don't make _envrion a common
- variable, the lastest assembler doesn't let common variables also
- be a weak symbol.
-
-Fri Apr 4 18:30:12 1997 Jim Wilson <wilson@cygnus.com>
-
- * rs6000.md (adddi3): Use non_short_cint_operand instead of
- non_add_cint_operand.
-
-Thu Apr 3 15:08:39 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (can_use_return_insn): Add size of fixed stack space
- for function calls into the size of the frame.
- (expand_prologue, expand_epilogue): Likewise.
- (initial_offset): Corresponding changes..
- * mn10300.h (OUTGOING_REG_PARM_STACK_SPACE): No longer define.
- (STACK_POINTER_OFFSET): Define.
- * mn10300.md (call, call_value expanders): Don't adjust the stack
- pointer here anymore.
-
- * mn10300.md (ashlsi3): Remove some alternatives which are no longer
- needed or desired.
-
-Thu Apr 3 15:06:53 1997 Jim Wilson <wilson@cygnus.com>
-
- * local-alloc.c (no_conflict_p): Reject sequences with foreign insns.
-
- * combine.c (move_deaths): Handle partial REG_DEAD note for
- multi-reg hard register.
-
- * function.c (expand_function_start): Emit queue after expanding
- each dynamic parameter type.
-
- * mips.c (mips_move_2words): Add SIGN_EXTEND support for SYMBOL_REF,
- LABEL_REF, and CONST operands.
-
- * dwarf2out.c: Delete comment referring to README.DWARF.
-
-Wed Apr 2 17:21:23 1997 Jim Wilson <wilson@cygnus.com>
-
- * rs6000.md (ashrdi3_power): Mark alternative 0 as early_clobber
- output.
-
- * rs6000.md (abssi3_nopower define_split): Switch operands of MINUS.
- (nabssi3_nopower define_split): Likewise.
-
-Tue Apr 1 19:30:01 1997 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (find_exception_table): Fix to logic to deal with
- functions that are in their own section, such as template
- instantiations, that cause overlapping EH tables.
-
-Tue Apr 1 17:16:22 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (USER_H): Add va-mn10300.h
-
- * ginclude/stdarg.h: Include va-mn10300.h.
- * ginclude/varargs.h: Likewise.
- * ginclude/va-mn10300.h: New file.
- * mn10300.c (expand_prologue): If current_function_varargs is nonzero,
- flush d0/d1 back into stack.
- (mn10300_builtin_saveregs): New function.
- (function_arg, function_arg_partial_nregs): New functions.
- (initial_offset): Tweak now that the RP save area is allocated
- and deallocated around each call again.
- * mn10300.h (FIRST_PARM_OFFSET): Now 4.
- (FRAME_POINTER_REQUIRED): Require frame pointer for all non-leaf fcns.
- (REG_PARM_STACK_SPACE): Now 8 bytes.
- (FUNCTION_ARG_REGNO_P): Update for new parameter passing conventions.
- (CUMULATIVE_ARGS, INIT_CUMULATIVE_ARGS): Likewise.
- (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Likewise.
- (FUNCTION_ARG_PARTIAL_NREGS): Likewise.
- (TRAMPOLINE_TEMPLATE): Don't clobber d0 anymore.
- (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes.
- (EXPAND_BUILTIN_SAVEREGS): Define.
- * mn10300.md (call, call_value patterns): Allocate and deallocate
- stack slot for return pointer around each call.
-
- * mn10300.h (RTX_COSTS): Refine.
- (CASE_VALUES_THRESHHOLD, NO_FUNCTION_CSE): Likewise.
- * mn10300.c (output_tst): New function.
- * mn10300.md (movdi, movdf): Improve code to load constants into regs.
- (tst insns): Use output_tst to optimize some cases. Add versions to
- encourage more zero extensions instead of sign extensions of HImode
- and QImode values.
- (divsi3, udivsi3): Remove patterns. Replaced by...
- (divmodsi4, udivmodsi4): New expanders/patterns.
- (andsi3): Optimize "and" operations with certain constants.
-
-Tue Apr 1 09:14:29 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h: (ADJUST_COSTS): Define.
-
-Fri Mar 28 17:46:13 1997 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (LANGUAGES): Add gcov.
- (OBJS): Add profile.o.
- (STAGESTUFF): Add gcov.
- (profile.o, gcov.o, gcov): Add rules to build them.
- (install-common): Install gcov.
- * combine.c (distribute_notes): Handle REG_BR_PROB and REG_EXEC_COUNT
- REG_NOTES.
- * sparc.h (OVERRIDE_OPTIONS): Check profile_arc_flag.
- * final.c (LONG_TYPE_SIZE): Define.
- (count_instrumented_arcs): New variable.
- (end_final, profile_after_prologue, leaf_function_p): Add support
- for profile_arc_flag.
- (add_bb): Only call CC_STATUS_INIT if HAVE_cc0.
- * flags.h (profile_arc_flag, flag_test_coverage,
- flag_branch_probabilities): Declare.
- * function.c (expand_function_end): Output NOTE_REPEATED_LINE_NUMBER
- for last line of function.
- * integrate.c (expand_inline_function): Output
- NOTE_REPEATED_LINE_NUMBER after inlined call.
- * jump.c (jump_optimize, follow_jumps, mark_jump_label): Disable some
- optimizations when flag_test_coverage and there is a line number note
- in the way.
- (invert_jump): Add REG_BR_PROB when flag_branch_probabililties.
- * libgcc2.c (__bb_exit_func): Support gcov style output.
- * reorg.c (mostly_true_jump): Use REG_BR_PROB notes when
- flag_branch_probabilities.
- * rtl.c (note_insn_name): Add NOTE_REPEATED_LINE_NUMBER.
- (reg_note_name): Add REG_BR_PROB and REG_EXEC_COUNT.
- * rtl.h (enum reg_note): Add REG_BR_PROB and REG_EXEC_COUNT.
- (REG_BR_PROB_BASE): Define.
- (NOTE_REPEATED_LINE_NUMBER): Define.
- * sched.c (update_flow_info): Handle REG_EXEC_COUNT and REG_BR_PROB
- notes.
- * toplev.c (branch_prob_dump, profile_arc_flag, flag_test_coverage,
- flag_branch_probabilities, branch_prob_dump_file, branch_prob_time):
- New variables.
- (f_options): Add profile-arcs, test-coverage, and
- branch-probabilities.
- (compile_file): Set branch_prob_time. Pass flag_test_coverage to
- init_emit_once. Handle branch_prob_dump. Call init_branch_prob.
- Call end_branch_prob. Call output_func_start_profiler.
- (rest_of_compilation): Handle branch_prob_dump. Call new
- branch_prob pass.
- (main): Set branch_prob_dump.
- * gcov.c, profile.c, gcov-io.h, gcov.texi: New files.
-
-Thu Mar 27 16:52:52 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.h (CPP_CPU_DEFAULT): Define if TARGET_CPU_DEFAULT is not set.
- * i386.h (STACK_BOUNDARY): Define to always be 32.
-
- From J"orn Rennecke <amylaar@cygnus.co.uk>
- * i386.md: (zero_extendhisi2+[12]): Use true_regnum instead of
- REGNO for operand 0.
- (zero_extendqisi2+3): Use reg_overlap_mentioned_p instead of REGNO
- comparison; use true_regnum instead of REGNO for rtx generation.
-
-Wed Mar 26 12:34:21 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (reload): Call reload_cse_regs.
- (reg_values): New static variable.
- (reload_cse_invalidate_regno): New static function.
- (reload_cse_mem_conflict_p): New static function.
- (reload_cse_invalidate_mem): New static function.
- (reload_cse_invalidate_rtx): New static function.
- (reload_cse_regs): New static function.
- (reload_cse_regno_equal_p): New static function.
- (reload_cse_noop_set_p): New static function.
- (reload_cse_simplify_set): New static function.
- (reload_cse_check_clobbered): New static variable.
- (reload_cse_check_src): New static variable.
- (reload_cse_check_clobber): New static function.
- (reload_cse_record_set): New static function.
-
-Wed Mar 26 07:34:06 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * ginclude/stdarg.h (__va_copy): New definition.
-
-Tue Mar 25 13:43:36 1997 Michael Meissner <meissner@cygnus.com>
-
- * gcc.c (init_spec): If -v, print out that the default spec values
- were being used. Fix prototype to reflect no arguments.
- (set_spec): If specs has not been set, set it up with the default
- specs.
- (read_specs): Move to later in the file so that startfile_prefixes
- has been declared. Process "%include <file>" to include another
- specs file, aborting if the file can't be found. Process
- "%include_noerr <file>: to include another specs file, giving no
- error if the file can't be found. Process "%rename var1 var2" to
- rename a specs variable. Take new argument that indicates whether
- we are processing the main file. Only process % commands if this
- is not the main specs file. Change callers.
- (main): Do not call init_spec if a specs file was found.
- (set_spec,read_specs,do_spec_1): If DEBUG_SPECS is defined, print
- debug information.
-
-Tue Mar 25 14:43:58 1997 Doug Evans <dje@cygnus.com>
-
- * expr.c (emit_push_insn): Delete emission of CLOBBER
- when doing partial push, no longer necessary.
-
- * c-decl.c (grokdeclarator): Pedwarn qualified void function return
- type.
-
-Tue Mar 25 14:28:15 1997 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * reload.c (find_dummy_reload): New parameter earlyclobber. If set
- then don't use IN for the reload if it also appears elsewhere in
- the insn. All callers changed.
-
-Tue Mar 25 13:20:18 1997 J.T. Conklin <jtc@cygnus.com>
-
- * m68k/lb1sf68.asm (udivsi3): Fix hunk from previous patch that
- did not apply correctly.
-
- * m68k.md (tablejump): Use extl to explicitly sign extend
- index registeron TARGET_5200.
- * m68k/{apollo68.h,coff.h,linux.h,mot3300.h,pbb.h}
- (ASM_RETURN_CASE_JUMP): Likewise.
-
- * m68k.md (mulsi3): Changed into define_expand. Split insn into
- m68k and coldfire specific versions with appropriate constraints.
-
- * m68k.md (movqi): Disable use of address registers for
- TARGET_5200.
-
- * m68k/lb1sf68.asm (__modsi3, __umodsi3): Use mulsl instruction
- instead of __mulsi3 function call on the coldfire.
-
- * m68k.md (bne0_di): Fix typo in last change.
-
- * m68k.md (xorsi3_5200): Correct constraints.
-
- * m68k.c (output_move_{si,hi,qi}mode): New functions.
- * m68k.h (output_move_{si,hi,qi}mode): Declare.
-
- * m68k.md (move{si,hi,qi,di}): Changed into define_expands. Split
- insns into m68k and coldfire specific versions with appropriate
- constraints.
-
-Tue Mar 25 12:18:41 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (GCC_PASSES): Revert previous change; use cc1$(exeext).
-
-Mon Mar 24 16:12:20 1997 Doug Evans <dje@cygnus.com>
-
- * m32r/*: New files.
- * config.sub: Add m32r.
- * configure: Add m32r.
- * longlong.h: Add m32r support.
- * ginclude/{stdarg.h,varargs.h}: Add m32r support.
- * ginclude/va-m32r.h: New file.
-
-Mon Mar 24 15:53:15 1997 Joel Sherrill <joel@OARcorp.com>
-
- * rs6000/rtems.h: Change to a near clone of the powerpc-eabi target.
- * configure (powerpc*-*-rtems): Move before GNU/Linux configuration.
-
-Mon Mar 24 14:26:37 1997 Gavin Koch <gavin@cygnus.com>
-
- * ginclude/va-mips.h: For little endian, eabi, objects
- less than __va_reg_size are passed in registers.
-
-Fri Mar 21 00:48:02 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (print_operand): Handle 'N'.
-
- * mn10300.c (expand_epilogue): Correctly handle functions
- with large frames, but no callee register saves.
-
- * mn1300.md (movdf, movdi): Handle overlapping moves.
-
- * pa.c (compute_movstrsi_length): Handle residuals correctly.
-
-Thu Mar 20 13:53:30 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.c (easy_fp_constant): If -mrelocatable, consider all fp
- constants to be hard.
-
-Mon Mar 20 13:53:30 1997 Jim Wilson <wilson@cygnus.com>
-
- * rs6000.md (movdf/movsf define_splits): Add SUBREG support.
-
- * rs6000.c (fp_reg_or_mem_operand): Delete.
- * rs6000.h (PREDICATE_CODES): Remove fp_reg_or_mem_operand.
- (fp_reg_or_mem_operand): Delete declaration.
- * rs6000.md (movsf_hardfloat): Use nonimmediate_operand instead
- of fp_reg_or_mem_operand.
-
-Thu Mar 20 08:52:27 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (cmpsi): Handle comparing a register with
- itself by adding zero to the reg. Z bit for such an insn is
- inverted.
- * mn10300.c (notice_update_cc): Handle CC_INVERT.
-
- * pa.c (emit_move_sequence): Don't lose for a secondary reload
- to the SAR register if the input is a MEM with an offset that won't
- fit in 14bits.
-
-Wed Mar 19 17:10:44 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/linux.h (ASM_OUTPUT_MI_THUNK): Define.
-
-Wed Mar 19 16:59:34 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c, cpplib.c (do_error, do_warning): Fix memory leak.
-
- * cccp.c (output_line_directive): Do not output negative line
- numbers when analyzing directives like `#line 0'.
-
- * cexp.y (parse_number, yylex), cccp.c (rescan), cpplib.c
- (cpp_get_token): Unless -lang-c89 is specified, allow C9X-style
- hexadecimal floating-point numbers as preprocessor numbers.
- * cccp.c (c89): New decl.
- (main): Set it to 1 if -lang-c89.
- * cpplib.h (struct cpp_options): New member c89.
- (CPP_C89): New macro.
- * cpplib.c (unsafe_chars): `p' is unsafe before `-' or `+', since it
- might generate a C9X-style hexadecimal floating-point number.
- (cpp_handle_options): Set c89 option to 1 if -lang-c89.
-
-Tue Mar 18 17:05:57 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.h (STACK_BOUNDARY): Determine according to TARGET_ALIGN_DOUBLE.
-
- * i386.c (override_options) Make the default alignment 4 for 486,
- otherwise 2.
-
- * i386/freebsd-elf.h (CPP_SPEC): Remove TARGET_CPU_DEFAULT reference.
- * i386/linux{,-aout,-oldld}.h (CPP_SPEC): Likewise.
-
- * i386/go32.h (DBX_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE,
- NO_STAB_H, ASM_FILE_START, DBX_BLOCKS_FUNCTION_RELATIVE,
- DBX_FUNCTION_FIRST, DBX_OUTPUT_MAIN_SOURCE_FILE_END,
- ASM_OUTPUT_SOURCE_LINE): Added to support stabs.
- (ASM_OUTPUT_SECTION_NAME): Support section attribute.
-
-Tue Mar 18 16:12:28 1997 Jim Wilson <wilson@cygnus.com>
-
- * final.c (shorten_branches): Split all insns before computing insn
- lengths.
- (final_scan_insn, case default): If HAVE_ATTR_length defined, call
- abort for any insn that has a '#' output template.
-
- * expr.c (emit_group_load): Call operand_subword instead of creating
- an explicit SUBREG.
-
- * reload1.c (reload_reg_free_before_p, case
- RELOAD_FOR_OPERAND_ADDRESS): Conflicts with RELOAD_FOR_OPADDR_ADDR
- reloads.
-
- * configure (alpha-dec-osf[23456789]*): Use install-headers-cpio
- for osf4.
-
- * gcc.c (init_spec): Delete parameter. Always initialize extra_specs.
- (process_command, main): Change all callers.
-
- * combine.c (if_then_else_cond): Call copy_rtx to prevent sharing.
-
-Tue Mar 18 14:59:12 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * function.c (assign_parms): Add a REG_EQUIV note to the
- instruction which copies a parameter into a pseudo-register
- whenever there is an associated stack slot, even if the parameter
- actually arrived in a register.
-
-Tue Mar 18 14:24:48 1997 Doug Evans <dje@cygnus.com>
-
- * configure (alpha-dec-osf[23]): Separate osf[23] case.
- * alpha.h (LIB_SPEC): -lprof1 requires -lpdf for OSF 4.
- * alpha/osf2or3.h: New file.
-
-Tue Mar 18 11:32:10 1997 Jeffrey A Law (law@cygnus.com)
-
- * m68k.c (m68k_last_compare_had_fp_operands): New variable.
- * m68k.h (m68k_last_compare_had_fp_operands): Declare it.
- * m68k.md (tst*, cmp*): Turn into define_expand/define_insn pairs.
- Keep track of whether test/compare has fp operands.
- (seq, sne, sgt, slt, sge, sle): Turn into define_expand/define_insn
- pairs. Make expanders FAIL if TARGET_68060 and last comparison/test
- had fp operands.
-
-Tue Mar 18 04:29:29 1997 Richard Earnshaw <rearnsha@armltd.co.uk>
-
- * arm.md (movhi): Handle generation of large constants during
- and after reload.
-
-Mon Mar 17 17:30:24 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * gmicro.h (RETURN_POPS_ARGS): Make sure FUNDECL is non-nil
- before we try to use it.
- * m68k.h (RETURN_POPS_ARGS): Likewise.
- * ns32k.h (RETURN_POPS_ARGS): Likewise.
- * pyr.h (RETURN_POPS_ARGS): Likewise.
-
-Mon Mar 17 17:13:44 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * stor-layout.c (layout_record, PCC_BITFIELD_TYPE_MATTERS):
- Only add padding if a bit field would otherwise span more units
- of alignment than its base type.
-
-Mon Mar 17 17:03:55 1997 J.T. Conklin <jtc@cygnus.com>
-
- * m68k.md (beq0_di, bne0_di, bge0_di, blt0_di): Use cmpw #0
- instead of tstl when testing address registers on the 68000.
-
- * m68k/lb1sf68.asm: Fix prologues/epilogues to deal with the lack
- of predecrement/postincrement addressing modes in the coldfire
- moveml instruction.
-
-Mon Mar 17 17:00:14 1997 Scott Christley <scottc@net-community.com>
-
- * Fix long standing bug where first method call for a class could
- result in a garbled stack or produce an incorrect return value.
- * objc/sendmsg.c (__objc_block_return): Remove function.
- (__objc_word_return, __objc_double_return): Remove functions.
- (__objc_get_forward_imp): New function.
- (__objc_init_dispatch_tables): Install zero instead of
- __objc_init_install_dtable.
- (__objc_init_install_dtable): No longer call the method but
- allow objc_msg_lookup return it for normal execution.
- (obj_msg_lookup): Differentiate between when a method isn't
- implemented and when the dispatch table needs to be installed.
- Return the IMP when the dispatch table is installed versus
- having __objc_init_install_dtable call it.
- (get_imp): Install dispatch table if needed and return IMP
- from the newly installed dispatch table.
- (__objc_responds_to): Install dispatch table if needed before
- checking if method is implemented.
-
-Mon Mar 17 16:29:38 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * tree.c (build_{index,range}_type): Ensure expressions for min
- and max value are in same obstack as type.
-
-Mon Mar 17 15:44:18 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * cccp.c [#if VMS] (O_RDONLY, O_WRONLY): Delete (redundant).
- (BSTRING): Delete (obsolete; usage occurs prior to definition).
- (do_include): Handle old VAX C style includes better.
-
-Mon Mar 17 13:46:47 1997 Paul Eggert <eggert@twinsun.com>
-
- * cexp.y, cppexp.c (parse_number): Invalid integer constants are
- errors if pedantic.
- * cexp.y (yylex): Invalid multibyte characters are errors if pedantic.
- * cppexp.c (cpp_lex): Likewise.
- * cppexp.c (cpp_parse_escape): Character constants that do not fit are
- errors if pedantic.
-
- * c-parse.in (expr_no_commas): Do not store temporary
- skip_evaluation increments on yacc value stack.
-
-Sun Mar 16 19:54:49 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_expr, case PLACEHOLDER_EXPR): Refine which
- object is picked.
-
-Sun Mar 16 15:45:45 1997 Jeffrey A Law (law@cygnus.com)
-
- * loop.c (strength_reduce): Adjust BENEFIT appropriately if an
- autoincrement memory reference will eliminate add insns.
-
-Sun Mar 16 08:41:40 1997 Scott Christley <scottc@net-community.com>
-
- * i386.md (untyped_call): Re-enable code.
- * objc/sendmsg.c (__objc_block_return): New function.
- (__objc_word_return, __objc_double_return): New functions.
- (__objc_init_install_dtable): Call appropriate return function
- based upon method type.
- * objc/thr-pthreads.c: Correct include path.
-
-Sat Mar 15 07:58:33 1997 Scott Christley <scottc@net-community.com>
-
- * objc-act.c (OBJC_VERSION): Increment version.
- * objc/init.c (OBJC_VERSION): Likewise.
-
-Sat Mar 15 07:58:00 1997 Ovidiu Predescu <ovidiu@net-community.com>
-
- * Implement +load.
- * objc/init.c (objc_send_load, __objc_send_load): New functions.
- (__objc_send_message_in_list): New function.
- (__objc_force_linking): New function.
- (__objc_exec_class): Don't call _objc_load_callback here.
- * objc/linking.m: New file.
- * objc/sendmsg.c (class_add_method_list): Check for the +load method
- when adding a methods list to a class.
- * objc/Makefile (OBJC_O): Add linking.m.
-
- * Allow methods defined in categories to override methods that are
- defined in the class implementation.
- * objc/sendmsg.c (__objc_install_methods_in_dtable): New function.
- (class_add_method_list): Don't check anymore for duplicate methods.
-
- * config/nextstep.h (INCLUDE_DEFAULTS): Define to something useful
- when cross-compiling.
-
- * The static instances list moved from the objc_module struct to
- objc_symtab struct, at the end of defs array. This now allows the NeXT
- gdb to work with binaries generated for the GNU ObjC runtime.
- * objc-act.c (build_objc_symtab_template): Make sure
- defs in objc_symtab is a NULL terminated array.
- (init_def_list): Attach statics to end of def list.
- (init_objc_symtab): Take statics list into account.
- (init_module_descriptor, build_module_descriptor): Don't add statics.
- (generate_static_references): Indicate that statics are used.
- (finish_objc): Process statics in the beginning.
- * objc/objc-api.h (objc_module): Eliminate statics variable.
- * objc/init.c (__objc_exec_class): Access statics from their
- new place in the defs variable.
-
-Sat Mar 15 07:29:15 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * reload.c: Include expr.h.
- (find_reloads_address, find_reloads_address_1): New argument INSN.
- (find_reloads_address_1): Reload inside of p{re,ost}_{in,de}c
- instead of entire p{re,ost}_{in,de}c where appropriate.
- * Makefile.in (reload.o): Added expr.h to dependencies list.
-
-Sat Mar 15 07:17:12 1997 Richard Henderson <rth@tamu.edu>
-
- * reload.h (eliminate_regs): Add STORING arg.
- * reload1.c (eliminate_regs): Likewise.
- (eliminate_regs, case SET): Pass that we are storing to recursive call.
- (eliminate_regs, case SUBREG): If storing and same number of words,
- use larger mode.
- * caller-save.c, dbxout.c, dwarfout.c, dwarf2out.c, reload.c, sdbout.c:
- Change all calls to eliminate_regs.
-
-Fri Mar 14 14:18:49 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * cplus-dem.c: Add prototypes for all static functions.
- (mystrstr): Make static. Make arguments and result const.
- (cplus_match): Remove; not used.
-
-Fri Mar 14 10:15:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (const_costs): Remove unused function.
- * mn10300.h (CONST_COSTS): Rework to generate better code.
-
- * mn10300.c (print_operand): Handle 'H' and 'L' output
- modifers for high/low part of a 64bit value.
- * mn10300.h (CONST_DOUBLE_OK_FOR_LETTER_P): Handle 'G'
- (LEGITIMATE_CONSTANT_P): Allow any constant.
- * mn10300.md (movdi, movdf): Implement.
- (adddi3, subdi3): New expanders and patterns.
-
- * mn10300.c (print_operand): Handle 'A' modifier for an
- address which can't be simple register indirect.
- * mn10300.h (EXTRA_CONSTRAINT): Handle 'R' for bit ops.
- * mn10300.md: Add patterns to test, set and clear bitfields.
-
- * mn10300.c (can_use_return_insn): New function.
- (expand_epilogue): Emit a RETURN insn if possible.
- * mn10300.md (return): New pattern.
-
- * mn10300.h (CONST_OK_FOR_LETTER_P): Handle 'N'.
- * mn10300.md (andsi3): Catch "and 255,dn" and "and 65535,dn"
- which were not turned into zero_extend patterns.
-
- * mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Handle symbolic
- constant as an index/base too.
-
- * mn10300.md (movsi): Allow SP to be loaded/saved with
- reg+d8 addresses.
-
- * mn10300.md (cmpsi): Allow second operand to be a constant.
- (subsi3): Likewise.
-
- * mn10300.md (sign extension patterns): Fix thinko when
- extending from memory.
-
- * mn10300.md (tst peepholes): Add peepholes for test/branch
- based on N bit being set/clear and the data value being tested dies.
-
-Tue Mar 11 17:07:51 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (expand_prologue): Rework so that eliminating
- the frame pointer produces faster/smaller code.
- (expand_epilogue): Likewise.
- (initial_offset): New function for argument pointer and frame pointer
- elimination.
- * mn10300.h (FIRST_PSEUDO_REGISTER): Bump to 10.
- (FIXED_REGISTERS): Add argument pointer register, it's a fake fixed
- register.
- (CALL_USED_REGISTERS, REG_ALLOC_ORDER): Corresponding changes.
- (REGNO_REG_CLASS, REG_CLASS_CONTENTS): Likewise.
- (REG_OK_FOR_BASE_P, REGISTER_NAMES): Likewise.
- (reg_class, REG_CLASS_NAMES): Delete unwanted DATA_OR_SP_REGS class.
- (PREFERRED_OUTPUT_RELOAD_CLASS): Define.
- (FIRST_PARM_OFFSET): No longer include register save area in
- computation.
- (STACK_POINTER_REGNUM): Is now register 9.
- (ARG_POINTER_REGNUM): Is now register 8.
- (FRAME_POINTER_REQUIRED): Refine.
- (ELIMINABLE_REGS, INITIAL_ELIMINATION_OFFSET): Define.
- (CAN_DEUG_WITHOUT_FP): Define.
- * mn10300.md (return_internal): Break into two patterns.
-
- * mn10300.h (CONST_OK_FOR_LETTER_P): Handle 'M' too.
- (REGISTER_MOVE_COST): Fix errors and refine.
-
- * mn10300.c (notice_update_cc): SET_ZN_C0 insns leave the
- overflow bit in an unuseable state. Rename CC_SET to CC_TST.
- * mn10300.md (cc attributes): "set" is gone, replaced by
- "tst". Update attributes on various insns.
-
- * mn10300.md: Improve sign and zero extension instructions.
- (ashlsi3): Improve. Handle address registers too.
- (add peephole): Combine two consecutive adjustments of a register
- into a single adjustment.
-
-Tue Mar 11 17:18:40 1997 Brendan Kehoe <brendan@melange.gnu.ai.mit.edu>
-
- * cplus-dem.c (gnu_special): Call demangled_fund_type for other
- __t* symbols.
-
-Mon Mar 10 16:10:34 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * emit-rtl.c (subreg_lowpart_p): Return 0 if SUBREG_REG is VOIDmode.
- * combine.c (simplify_rtx, case SUBREG): Fix direction of test when
- calling operand_subword; use inline code intead of subreg_lowpart_p.
-
-Fri Mar 7 09:22:28 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (expand_{pro,epi}logue): Rework to avoid
- unnecessary "add" operations.
- (expand_epilogue): Likewise.
- * mn10300.h (STARTING_FRAME_OFFSET): Is zero after the last
- round of prologue/epilogue changes.
- (FIRST_PARM_OFFSET): Is now 16 (-4 for REG_PARM_STACK_SPACE + 20 for
- register save area).
- (REG_PARM_STACK_SPACE): Define as 4 bytes.
- (OUTGOING_REG_PARM_STACK_SPACE): Define so caller allocates it.
- * mn10300.md (call{,_value} expander): Don't emit insns to adjust the
- stack here anymore.
-
- * mn10300.md (bCC patterns): Just use "bCC target".
-
-Tue Mar 4 13:21:41 1997 Jim Wilson <wilson@cygnus.com>
-
- * rs6000.md (movsi): Don't emit a USE insn for LABEL_REFs.
-
-Thu Mar 6 16:29:13 1997 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (modified_type_die): Initialize item_type to NULL.
- Move equate_type_number_to_die call before use of sub_die, and move
- recursive modified_type_die calls on item_type after it.
-
- * dwarfout.c (root_type_1, write_modifier_bytes_1): New functions.
- (root_type): Call root_type_1.
- (write_modifier_bytes): Call write_modifier_bytes_1.
- (output_type, case POINTER_TYPE): Set TREE_ASM_WRITTEN before
- recursive call.
-
-Wed Mar 5 14:30:49 1997 Torbjorn Granlund <tege@quiet.matematik.su.se>
-
- Partially undo Jan 11 changes (nor takes only register ops):
- * mips.md (*norsi3_const, *nordi3_const): Delete bogus patterns.
- * mips.c (complemented_arith_operand): Delete function.
- (print_operand): Don't handle `e' for CONST_INT.
- * mips.h (PREDICATE_CODES): Delete complemented_arith_operand.
-
-Tue Mar 4 16:38:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * i386.c (i386_return_pops_args): Make sure FUNDECL is non-nil
- before we try to use it.
- * i386/{isc,next,sco,sco5,scodbx}.h (RETURN_POPS_ARGS): Likewise.
-
-Mon Mar 3 20:17:54 1997 Gavin Koch <gavin@cygnus.com>
-
- * ginclude/va-mips.h: __mips_single_float should have
- the same effect on vararg lists as __mips_soft_float.
-
-Mon Mar 3 18:12:01 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (DBX_CONTIN_LENGTH): Undo 2/26 change.
-
-Mon Mar 3 13:08:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * combine.c (simplify_rtx): Do nothing with (truncate:mode) if
- mode is a partial integer mode.
-
-Sun Mar 2 17:41:18 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * ginclude/varargs.h: Add definition of __va_copy.
- * va-alpha.h, va-clipper.h, va-h8300.h, va-i860.h: Likewise.
- * va-i960.h, va-m88k.h, va-mips.h, va-pa.h, va-ppc.h: Likewise.
- * va-sh.h, va-sparc.h, va-spur.h: Likewise.
-
-Sun Mar 2 13:25:49 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c (process_init_element): Warn and truncate if upper
- bound of index is out of range.
-
-Fri Feb 28 16:08:47 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/sol-c0.c (_start): Disable loading up r13 and r2 with the
- SDA base registers for now.
-
- * rs6000.md (movsi): Emit a USE insn when putting the
- label of constants into the TOC, so that the constant is still
- emitted when expensive optimizations are used.
-
-Thu Feb 27 17:54:42 1997 Karl Heuer <kwzh@gnu.ai.mit.edu>
-
- * fixinc.ptx: Fix sed expression looking for <sys/types.h> in pwd.h.
-
-Thu Feb 27 12:11:16 1997 Dennis Glatting <dennis.glatting@plaintalk.bellevue.wa.us>
-
- * fixincludes: Remove more cases of __const__ from math.h on NeXT.
-
-Wed Feb 26 14:52:27 1997 Michael Meissner <meissner@cygnus.com>
-
- * reload.c (debug_reload): Remove extra argument to fprintf.
- * rs6000.c (output_toc): Make fprintf calls type correct.
-
- * rs6000.h (DBX_CONTIN_LENGTH): Define as 4000 to avoid AIX
- assembler line limit.
-
-Mon Feb 24 17:56:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * fixincludes: Fix need of prototypes for C++ in rpc/xdr.h on SunOS4.
-
-Mon Feb 24 17:33:57 1997 Michael Meissner <meissner@cygnus.com>
-
- * rs6000/xm-sysv4.h (HAVE_STRERROR): Define.
-
-Sun Feb 23 17:18:28 1997 Jim Wilson <wilson@cygnus.com>
-
- * rs6000.md (floatsidf2_loadaddr): Correct syntax for cau instruction.
- (load_multiple, store_multiple): Call change_address instead of
- creating MEM from scratch.
-
-Thu Feb 20 16:39:15 1997 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (unroll_loop): Add check for naive loop that ends with
- conditional branch that does not branch back to loop start.
-
- * reload1.c (reload): Move assign_stack_local call into main loop.
-
-Thu Feb 20 11:40:46 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (zero extension patterns): Turn into define_expand and
- define_insn pair.
-
-Wed Feb 19 17:05:38 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (emit_move_sequence): Don't copy 0.0 (double precision)
- directly to memory, go through a reg if reload hasn't started.
- * pa.md (main movdf pattern): Don't allow 0.0 (double precision)
- to be copied directly to memory.
-
- * pa/pa-hpux10.h (MD_EXEC_PREFIX): Define appropriately for hpux10.
- (MD_STARTFILE_PREFIX): Similarly.
-
- * pa.h (ASM_OUTPUT_SECTION_NAME): Surround the section name
- with '$' if not using GAS.
-
-Wed Feb 19 16:43:47 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sched.c (schedule_insns): If there was no first scheduling pass,
- split instructions after reload.
- (update_flow_info): Tolerate some idiosyncrasies after reload.
-
-Wed Feb 19 11:13:51 1997 Jeffrey A Law (law@cygnus.com)
-
- * combine.c (find_split_point): Don't turn a SIGN_EXTEND into
- a series of shifts if either mode is a partial integer mode.
-
-Mon Feb 17 08:06:02 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * rs6000.c ({,non_}short_cint_operand): Use (unsigned HOST_WIDE_INT).
- (non_add_cint_operand, includes_rshift_p): Likewise.
- * rs6000.h (CONST_OK_FOR_LETTER_P): Likewise.
- (LEGITIMATE_ADDRESS_INTEGER_P, LEGITIMIZE_ADDRESS): Likewise.
-
-Sun Feb 16 07:55:19 1997 J"orn Rennecke (amylaar@cygnus.co.uk)
-
- * libgcc2.c (__negdi2, __lshrdi3, __ashldi3, __ashrdi3, __ffsdi2):
- Use ANSI style definition with full prototype.
- (__muldi3, __udiv_w_sdiv, __udivmoddi4, __divdi3, __moddi3) : Likewise.
- (__udivmoddi4, __udivdi3, __cmpdi2, __ucmpdi2) : Likewise.
- (__fixunstfdi, __fixtfdi, __fixunsxfdi, __fixxfdi) : Likewise.
- (__fixunsdfdi, __fixdfdi, __floatdixf, __floatditf) : Likewise.
- (__floatdidf, __floatdisf, __fixunsxfsi, __fixunsdfsi) : Likewise.
- (__gcc_bcmp, __eprintf, gopen, gclose, __bb_init_file) : Likewise.
- (__bb_init_trace_func, __clear_cache, mprotect) : Likewise.
- (__enable_execute_stack, cacheflush, exit) : Likewise.
- (find_exception_table, __find_first_exception_table_match) : Likewise.
-
-Sun Feb 16 07:52:02 1997 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.md (mulqihi3): Corrected.
- (tst{hf,tqf}): Simplified.
- (movqi): Removed redundant alternative.
- (addqi-3,addqi-2,addqi-1): Set/Reset Bit patterns by C. Nettleton.
- (many patterns): Introduced operand output modifiers d,t,b,B,w.
- * 1750a.c (print_operand): New operand output modifiers d,t,b,B,w.
- (simple_memory_operand): Removed.
- (one_bit_set_p, which_bit): Added from C. Nettleton's m1750 config.
-
-Sun Feb 16 07:43:37 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (special_symbol): Don't treat "L" in "L'...'" as identifier.
- (check_macro_name, collect_expansion, rescan): Likewise.
- * cpplib.c (special_symbol, check_macro_name, collect_expansion):
- Likewise.
-
- * cexp.y (parse_c_expression): Don't check for null lexptr
- or *lexptr == 0. If yyparse returns nonzero value, abort.
-
- * cexp.y (yylex): Use is_space, not is_hor_space, to find keyword end.
- (is_space): New decl.
- (is_hor_space): Removed.
- * cccp.c (is_space): Now external.
- (is_hor_space): Now static.
-
-Sun Feb 16 04:55:11 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c, tree.h (decl_printable_name): Change arguments.
- * c-common.c (declare_function_name): Reflect above change.
- * final.c (final_start_function): Likewise.
- * function.c (init_function_start): Likewise.
- * toplev.c (decl_name): Likewise.
- (announce_function): Likewise.
- (v_message_with_decl): Likewise.
- * dwarf2out.c (dwarf2_name): New fn, uses decl_printable_name.
- (add_pubname): Use it.
- (add_name_and_src_coords_attributes): Use it, add
- DW_AT_MIPS_linkage_name if appropriate.
- (output_aranges): Use DW_AT_MIPS_linkage_name if present.
-
-Sat Feb 15 18:45:30 1997 J.T. Conklin <jtc@cygnus.com>
-
- * m68k.md (cmpsi): Added insn with appropriate constraints for
- TARGET_5200; changed condition of existing insn to !TARGET_5200.
-
-Sat Feb 15 18:26:50 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k/hp320.h (PRINT_OPERAND_FLOAT): Removed.
- (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}_OPERAND): Defined.
- (PRINT_OPERAND): Turned off: use default.
- * m68k/news.h (PRINT_OPERAND): Turned off: use default.
- (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}_OPERAND): Defined.
- * m68k/tower-as.h (PRINT_OPERAND): Turned off: use default.
- (ASM_OUTPUT_{FLOAT,DOUBLE}_OPERAND): Defined.
- * m68k/crds.h (PRINT_OPERAND): Turned off: use default.
- (ASM_OUTPUT_{FLOAT,DOUBLE}_OPERAND): Defined.
- (SGS_NO_LI,STRUCTURE_SIZE_BOUNDARY,IMMEDIATE_PREFIX): Defined.
- (NEED_PROBE): Defined instead of HAVE_probe and gen_probe.
- (FUNCTION_{PRO,EPI}LOGUE): Do not access FPA registers.
- * m68k.c (output_function_prologue): Add CRDS and MOTOROLA probe code.
- (print_operand): Do not output '.' if CRDS.
-
- * gcc.c (set_spec): Fix comment-in-comment typo.
-
-Sat Feb 15 17:54:23 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (COMPILERS): Moved before GCC_PASSES.
- (GCC_PASSES): Use $(COMPILERS) instead of cc1$(exeext).
-
-Sat Feb 15 17:25:44 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * gcc.c (process_command): Allocate space for terminating null.
-
-Sat Feb 15 17:21:34 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax.h (FUNCTION_PROLOGUE): Adjust size by STARTING_FRAME_OFFSET.
- * vax/vms.h (FUNCTION_PROLOGUE): Delete.
-
-Sat Feb 15 08:48:14 1997 Douglas B. Rupp (rupp@gnat.com)
-
- * configure: Fix setting of CC in no-symlink case.
-
-Sat Feb 15 08:42:17 1997 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * expmed.c (expand_divmod): Prefer divmod in same mode over div
- in wider mode.
-
-Sat Feb 15 08:27:50 1997 J"orn Rennecke (amylaar@cygnus.co.uk)
-
- * fold-const.c (fold): Don't assume a nonexplicit constant cannot
- equal an explicit one.
-
- * i386.md (zero_extendqi[hs]i2+3): Ensure operating on REG.
-
-Sat Feb 15 08:11:04 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure (i[3456]86-*-solaris2*): Correct tm.h filename in
- stabs case.
-
- * a29k.h (STORE_FLAG_VALUE): Write so works on both 32 and 64-bit host.
-
-Fri Feb 14 16:03:37 1997 Robert Lipe <robertl@dgii.com>
-
- * i386/t-sco5 (libgcc{1,2}-elf.a): correct target dependencies.
-
-Fri Feb 14 16:00:23 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
-
- * config/svr4.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Set
- current-section variable to text.
-
-Wed Feb 12 16:07:34 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * fixinc.irix: New file.
- * configure (mips-sgi-irix[56]): Set fixincludes to fixinc.irix.
-
-Wed Feb 12 15:40:20 1997 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (LIBGCC2_DEBUG_CFLAGS): New macro.
- (LIBGCC2_CFLAGS): Use it.
-
- * dwarfout.c (output_type): Do early exit only if TYPE_CONTEXT is NULL
- or if TYPE_CONTEXT is another type (e.g. a nested type).
-
-Tue Feb 11 15:53:51 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (calc_live_regs): Exclude RETURN_ADDRESS_POINTER_REGNUM.
- Need not save MACL/MACH when not live or in leaf function.
-
-Mon Feb 10 14:46:32 1997 Jeffrey A Law (law@cygnus.com)
-
- * stmt.c (group_case_nodes): Recognize more opportunities to
- group case nodes.
-
-Sun Feb 9 14:05:48 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (assign_stack_temp): Clear MEM flags from reuse.
-
-Sat Feb 8 17:37:47 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * local-alloc.c (update_equiv_regs): Fix error in last change.
-
-Fri Feb 7 12:42:34 1997 Mike Stump <mrs@cygnus.com>
-
- * pa.h (RETURN_ADDR_RTX): Fix to ignore export stubs.
- * pa.c (return_addr_rtx): Define.
-
-Fri Feb 7 13:56:56 1997 Doug Evans <dje@cygnus.com>
-
- * cse.c (invalidate_from_clobbers): Delete unnecessary test for
- (clobber nil).
-
- * toplev.c (main): Delete redundant settings of flag_no_inline
- and warn_inline if not optimizating.
-
-Fri Feb 7 10:45:02 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (stmp-multilib-sub): Add missing "else true"
- clauses to work around make bug on some systems.
-
-Fri Feb 7 08:19:43 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (const_binop): Don't call size_int if low < 0.
-
- * function.c (instantiate_virtual_regs_1, case USE, CLOBBER):
- Fix error in last change.
-
-Thu Feb 6 17:09:17 1997 Mike Stump <mrs@cygnus.com>
-
- * except.c (find_exception_handler_labels): Initialize label array
- with zeroes.
-
-Wed Feb 5 22:11:55 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (post_ldwm): Fix typos.
-
-Wed Feb 5 15:57:42 1997 Doug Evans <dje@cygnus.com>
-
- * m68k/vxm68k.h (WCHAR_TYPE,WCHAR_TYPE_SIZE,SIZE_TYPE): Fix.
- (PTRDIFF_TYPE): Define.
-
-Wed Feb 5 11:19:13 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload1.c (alter_reg): Don't ask assign_stack_local to round up
- to a multiple of BIGGEST_ALIGNMENT, unless a register appears in a
- paradoxical subreg.
-
-Tue Feb 4 19:29:40 1997 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (find_reloads_address_1, case POST_INC): Don't use
- ADDR_TYPE here.
-
-Tue Feb 4 12:33:45 1997 Jeffrey A Law (law@cygnus.com)
-
- * flow.c (life_analysis): Delete obvious no-op moves
- which use SUBREGs.
-
-Mon Feb 3 20:00:35 1997 Jim Wilson <wilson@cygnus.com>
-
- * jump.c (find_cross_jump): Don't allow old-style and volatile asms
- to match.
-
-Mon Feb 3 15:51:31 1997 Doug Evans <dje@cygnus.com>
-
- * sparc/sol2.h (ASM_SHORT,ASM_LONG): Set to .uahalf/.uaword.
- * sparc/sysv4.h (ASM_LONG): Define.
- (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Use ASM_LONG.
-
-Mon Feb 3 13:01:46 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload.h (enum reload_type): Add RELOAD_FOR_INPADDR_ADDRESS and
- RELOAD_FOR_OUTADDR_ADDRESS.
- * reload.c (ADDR_TYPE): New macro.
- (push_secondary_reload): Check for new reload types.
- (combine_reloads): Likewise.
- (find_reloads): Likewise. Convert INPADDR_ADDRESS and
- OUTADDR_ADDRESS to OPADDR_ADDR. Check OPADDR_ADDR when looking
- for merges.
- (find_reloads_address): When reloading an address, use the
- ADDR_TYPE macro to get the type of the new reload.
- (find_reloads_address_1): Likewise.
- (reload_when_needed_name): Add new reload types.
- * reload1.c (reload): Add in_addr_addr and out_addr_addr fields to
- insn_needs struct. Use them for new reload types, and when
- computing in_max and out_max.
- (reg_used_in_inpaddr_addr): New static array.
- (reg_used_in_outaddr_addr): New static array.
- (mark_reload_reg_in_use): Handle new reload types.
- (clear_reload_reg_in_use, reload_reg_free_p): Likewise.
- (reload_reg_free_before_p, reload_reg_reaches_end_p): Likewise.
- (reloads_conflict, merge_assigned_reloads): Likewise.
- (emit_reload_insns): Likewise.
- (choose_reload_regs): Save arrays for new reload types.
-
-Sun Feb 2 19:43:17 1997 Scott Christley <scottc@net-community.com>
-
- * objc/selector.c (__sel_register_typed_name): Eliminate compiler
- warnings with explicit cast.
-
- * Add condition mutex support to the objc runtime.
- * objc/thr-mach.c (objc_condition_{,de}allocate): New functions.
- (objc_condition_{wait,broadcast,signal}): New functions.
- * objc/thr-pthreads.c (objc_condition_{,de}allocate): New functions.
- (objc_condition_{wait,broadcast,signal}): New functions.
- * objc/thr-solaris.c (objc_condition_{,de}allocate): New functions.
- (objc_condition_{wait,broadcast,signal}): New functions.
- * objc/thr.h: Prototypes for new functions.
-
- * objc/init.c (__objc_runtime_mutex): Eliminate leading underscore
- from name of objc mutex and thread structures.
- * objc/runtime.h: Likewise.
- * objc/thr-{decosf1,irix,mach,os2,posix,pthreads,single}.c: Likewise.
- * objc/thr-{solaris,win32}.c: Likewise.
- * objc/thr.{c,h}: Likewise.
-
- * Major reorganization of objc error handling.
- * objc/Object.m (-error:): Call objc_error function instead of
- using function pointer.
- * objc/archive.c: Replace call to abort or __objc_fatal functions
- with call to objc_error function throughout the complete file.
- * objc/class.c (objc_get_class): Replace call to abort function
- with call to objc_error function.
- * objc/encoding.c (objc_sizeof_type, objc_alignof_type): Replace
- call to abort function with call to objc_error function.
- (objc_skip_typespec): Likewise.
- * objc/init.c (init_check_module_version): Replace call to
- abort function with call to objc_error function.
- * objc/misc.c (objc_verror): New function.
- (objc_fatal): Remove function.
- (objc_set_error_handler): New function.
- (_objc_error_handler): New global variable.
- (__alpha__): Remove unneeded code.
- (objc_error): Allow user specified error handler function to
- trap and handle the objc error. Added an error code parameter
- which indicates the specific error that occured.
- (objc_malloc, objc_atomic_malloc): Replace call to objc_fatal
- function with call to objc_error function.
- (objc_valloc, objc_realloc, objc_calloc): Likewise.
- * objc/objc-api.h: Declare error handling functions and typedef
- for user specified error handler function. Define error codes
- used by the runtime library.
- * objc/runtime.h: Remove error handling declarations.
- * objc/sendmsg.c (__objc_forward): Replace call to abort function
- with call to objc_error function.
-
-Sun Feb 2 19:42:52 1997 Thomas Baier <baier@ci.tuwien.ac.at>
-
- * objc/hash.c (hash_delete): Step through the hash nodes
- versus using hash_next to increase efficiency.
- * objc/archive.c (__objc_finish_read_root_object): Use hash
- table instead of list.
-
-Sun Feb 2 08:25:05 1997 Ovidiu Predescu <ovidiu@net-community.com>
-
- * objc-act.c (encode_aggregate_within): New function.
- (encode_aggregate): Generates encodings for unions similar
- to those for structs except surrounded by parenthesis instead
- of braces.
-
-Sun Feb 2 07:15:54 1997 Mat Hostetter (mat@lcs.mit.edu)
-
- * c-decl.c (start_function): Fix improper installation of last change.
-
-Sun Feb 2 06:50:55 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.c (output_scc_di): Add missing CC_STATUS_INIT.
-
-Sun Feb 2 06:39:55 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-typeck.c (process_init_element): When popping levels, don't
- blow up if constructor_max_index not set due to previous error.
-
- * combine.c (find_split_point, case SET): Fix error in last change.
-
-Sun Feb 2 06:28:56 1997 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (rescan): Insert a space after `.' as well,
- to prevent accidental token-pasting (e.g. `.x' -> `.10').
-
-Sun Feb 2 06:08:14 1997 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.c (modregno_adjust): Fixed case when reg_renumber invalid.
-
-Sat Feb 1 19:11:08 1997 J.T. Conklin <jtc@rhino.cygnus.com>
-
- * m68k.md (movqi): Enable use of clr and st insns on TARGET_5200.
- * m68k.c (output_move_simode_const): Likewise.
-
-Sat Feb 1 18:54:00 1997 Douglas B. Rupp (rupp@gnat.com)
-
- * gcc.c (process_command): Fix improper use of strncpy.
-
-Fri Jan 31 15:35:08 1997 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c: Remove extern for malloc and realloc.
-
-Fri Jan 31 17:08:11 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * local-alloc.c (update_equiv_regs): If register which is equivalent
- to some value is only used in one place, and we can't substitute value
- for use, move register assignment to just before use.
-
-Fri Jan 31 15:57:25 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md (idiv,imul,fpmul): Added new functional units for pentiumpro.
-
- * i386.c (pentiumpro_cost): Added new cost structure for pentiumpro.
- (override_options): Set ix86_cost to appropriate cost structure.
-
-Thu Jan 30 09:34:26 1997 J.T. Conklin <jtc@rhino.cygnus.com>
-
- * m68k.md (stack adjust peepholes): Use lea instead of
- add.w when adding 16 bit constants on all but TARGET_68040.
-
-Thu Jan 30 08:58:08 1997 Ralf Baechle <ralf@waldorf-gmbh.de>
-
- * function.c (TRAMPOLINE_ALIGNMENT): Provide default.
- (expand_function_end): Use TRAMPOLINE_ALIGNMENT instead
- of FUNCTION_BOUNDARY.
- * varasm.c (TRAMPOLINE_ALIGNMENT): Provide default.
- (assemble_trampoline_template): Use TRAMPOLINE_ALIGNMENT instead
- of FUNCTION_BOUNDARY.
-
-Wed Jan 29 18:16:02 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h (REG_CLASS_CONTENTS): Add rap to GENERAL_REGS and its
- superclasses.
-
- * sh.md (movsi_i, movsi_ie, movhi_i, movhi+1): Use type pcload for
- immediate operands where appropriate.
- (movsf_ie+1): Fail when loading anything but a MEM into
- a floating point reguister.
-
-Wed Jan 29 16:00:31 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * varasm.c (force_const_mem): Set MARK instead of clearing it.
- (output_constant_pool): Only mark constant pool if -O.
- Check mark flag unconditionally.
- (mark_constant_pool): Start by clearing all mark flags.
-
- * tree.c (copy_node): Clear TREE_ASM_WRITTEN.
-
- * flow.c (regno_uninitialized): Return 0 if reg is used for args.
-
-Wed Jan 29 15:23:59 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * combine.c (try_combine): Clear reg_n_refs if i2dest is not
- mentioned in newi2pat.
-
-Tue Jan 28 16:00:23 1997 Stan Cox (coxs@dg-rtp.dg.com)
-
- From Robert Lipe <robertl@dgii.com>
- * i386/sco5.h (SCO_DEFAULT_ASM_COFF): Remove bytecode stuff.
- (ASM_OUTPUT_ASCII): Use .ascii in both ELF and COFF modes.
- (ASM_OUTPUT_SECTION_NAME): Handle alternate sections for COFF.
- The OpenServer 5.0.0 assembler gives an error for section
- names over 6 characters long, so we catch the "obvious" case
- and shorten it.
-
- * m88k.h (ASM_OUTPUT_SECTION_NAME): Undefine; fails
- for exception sections. The 88k ABI specifies 'section'
- instead of '.section'.
-
-Mon Jan 27 13:32:46 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (shl_and_kind): Fix typo.
- * sh.md (and_shl_scratch): Fix typo for length 8.
-
-Mon Jan 27 08:56:03 1997 Jeffrey A Law (law@cygnus.com)
-
- * fixincludes (sys/time.h): Fix incorrect forward structure
- declaration on hpux10.20.
-
-Mon Jan 27 09:05:35 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (simplify_rtx): Don't do anything with if_then_else_cond
- result if both one arm and the input are a comparison.
- (simplify_{rtx,if_then_else,logical,shift_const}): Don't
- test STORE_FLAG_VALUE with #if; properly test for just sign bit.
- (num_sign_bit_copies, if_then_else_cond): Likewise.
- * expmed.c (emit_store_flag): Properly test for STORE_FLAG_VALUE
- of just sign bit.
- * fold-const.c (fold): Don't make COND_EXPR when both expr and
- one part are comparisons.
- * a29k.h (STORE_FLAG_VALUE): Make negative.
-
-Fri Jan 24 16:42:26 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * varasm.c (struct pool_constant): Add mark field.
- (force_const_mem): Clear mark field in new constant pool entry.
- (output_constant_pool): Call mark_constant_pool.
- (mark_constant_pool, mark_constants): New static functions.
-
-Thu Jan 23 15:04:17 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * cse.c (COST): Get the right cost for a SUBREG of a register when
- truncation is free.
-
-Thu Jan 23 11:19:40 1997 Mike Stump <mrs@cygnus.com>
-
- * Makefile.in (objc-headers): Don't try and install the headers if
- the objc directory has been removed.
-
-Wed Jan 22 13:26:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * i960.c (process_pragma): Call ungetc on the last character
- that was read by the while loop, to make sure the parser sees it.
-
-Tue Jan 21 17:20:30 1997 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (output_toc): Move STRIP_NAME_ENCODING to common
- code, so the test for vt's works with -mminimal-toc.
-
-Tue Jan 21 16:03:35 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (mark_all_temps_used): Set KEEP as well.
-
-Tue Jan 21 12:16:15 1997 Doug Evans <dje@seba.cygnus.com>
-
- * stor-layout.c (layout_record): Correct test for whether field spans
- its unit of alignment in case where field_size == type_align.
-
-Mon Jan 20 20:27:54 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.md (probe): Comment out.
-
-Sun Jan 19 20:54:45 1997 John F. Carr <jfc@mit.edu>
-
- * integrate.c (expand_inline_function): Handle a PARALLEL containing
- a RETURN the same as a RETURN.
-
-Sun Jan 19 20:35:28 1997 Pat Rankin <rankin@eql.caltech.edu>
-
- * vmsconfig.com: Change all hardcoded references of "vax" to
- use variable expansion instead.
- (arch_indx, arch): New variables.
-
- * vax.c (not_qsort): Don't declare alloca.
- * vax/xm-vms.h: Declare alloca here.
- Do most of the VAX C-specific set up for DEC C.
- #if DEC C, undefine QSORT_WORKAROUND and qsort.
- * make-gcc.com, make-cccp.com, make-cc1.com: Support building
- with GNU C vs VAX C vs DEC C from the DCL command line.
-
-Sun Jan 19 17:20:50 1997 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.md (movh[if]-1): Corrected.
- (movtqf-1): Deleted.
- * 1750a.c (add_1_to_mem): Deleted.
- (output_operand_address): Added output modifier 'A'.
-
-Sun Jan 19 17:17:54 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.md (ashrdi_const, ashrdi3): Allow 31 as shift count.
-
- * m68k.h (CONST_OK_FOR_LETTER_P): Recognize 'N', 'O' and 'P'.
- * m68k.md (rotl[shq]i3, strict_low_part rotl): Allow 'N', 'O'
- or 'P' operands.
-
-Sun Jan 19 17:09:17 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.md (addsi3): Fix previous change: {add,sub}qw should
- be {add,sub}ql. For other uses of {add,sub}q don't check for address
- register and always use {add,sub}ql.
-
-Sun Jan 19 15:05:42 1997 Peter Seebach <seebs@solon.com>
-
- * c-decl.c (start_decl): Add code for -Wmain.
- (c_decode_option): Add -fhosted, -ffreestanding, and -Wmain.
- * toplev.c (lang_options): Likewise.
- * c-tree.h (warn_main, flag_hosted): New variables.
-
-Sun Jan 19 14:35:41 1997 Alex Garthwaite (alex@samwise.cis.upenn.edu)
-
- * fixinc.svr4: Fix problems with symlinks to ".".
-
-Sun Jan 19 14:21:46 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * loop.c (check_final_value): Handle insns with no luid's.
-
-Sun Jan 19 08:57:26 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.md (arg_home): Add CLOBBER of MEM and USE of arg regs.
- * vms.h (SETUP_INCOMING_VARARGS): Delete duplicate definition.
-
- * toplev.c (set_float_handler): Set up signal catcher on first call
- in case a front end has disabled it.
-
- * cccp.c, cexp.y: #define __attribute__ to be null if
- compiling with GCC older than 2.7, not 2.6.
-
- * toplev.c (main): If PREFERRED_DEBUGGING_TYPE used and set
- to NO_DEBUG, say debugging not supported.
- * mips/sni-svr4.h (PREFERRED_DEBUGGING_TYPE): Undefine.
-
- * i386/xm-cygwin32.h (DIR_SEPARATOR): Define.
-
- * explow.c (convert_memory_address, case SYMBOL_REF):
- Copy CONSTANT_POOL_ADDRESS_P.
- * integrate.c (save_constants): Make (address (const ..)) to record
- both modes.
- (copy_for_inline, copy_rtx_and_substitute, restore_constants): Use
- both modes when restoring constant pool entry for ADDRESS.
-
- * alpha.h (MINIMUM_ATOMIC_ALIGNMENT): New macro.
-
- * function.c (instantiate_virtual_regs_1, case USE, case CLOBBER):
- Properly handle case of shared MEM whose replacement is not valid.
-
-Sat Jan 18 14:08:31 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (get_unwidened): Don't crash if FIELD_DECL not layed out.
-
- * varasm.c (const_hash): Treat NON_LVALUE_EXPR like CONVERT_EXPR.
- (compare_constant_1, copy_constant, bc_assemble_integer): Likewise.
- (const_hash, compare_constant_1): Use switch, not if-then-else.
-
-Fri Jan 17 17:10:20 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.h (STACK_POINTER_OFFSET): Don't define.
-
-Thu Jan 16 14:51:03 1997 Bob Manson <manson@charmed.cygnus.com>
-
- * cplus-dem.c: Fix indenting; note that this file also lives in
- libiberty.
- (do_type, case 'M'): Check for a template as well as a class.
-
-Thu Jan 16 15:08:26 1997 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gcc.c (cross_compile): Change to be a char * like all of the
- other specs.
- (process_command): Change how cross_compile is tested.
- (main): Likewise.
- (struct spec_list): Merge with the format used by EXTRA_SPECS.
- Add name length field to speed up repeated calls to strcmp. Add
- flag to say spec was allocated. Add pointer to char * so that
- static spec fields can be updated.
- (extra_specs): Use struct spec_list as type.
- (static_specs): Static list of predefined specs.
- (init_specs): New function, initialize the specs list. Link in
- the default specs and any specs defined via EXTRA_SPECS.
- (set_spec): No longer special case predefined specs.
- (process_command,validate_all_switches): Ditto.
- (process_command): Call init_specs for -dumpspecs.
- (do_spec_1): Use name length field to avoid calling strncmp when
- it is going to fail.
- (main): Call init_spec. Don't handle EXTRA_SPECS here.
-
-Thu Jan 16 17:07:54 1997 Eddie C. Dost <ecd@skynet.be>
-
- * configure: Add sparc-linux{,aout} support.
- * ginclude/va-sparc.h: Likewise.
- * sparc/linux.h: New file.
- * sparc/linux-aout.h: New file.
- * sparc/xm-linux.h: New file.
-
-Thu Jan 16 16:19:13 1997 Jim Wilson <wilson@cygnus.com>
-
- * configure (sparc-*-aout*): Add libgloss.h to tm_file.
- (sparclite-*-coff*): Change "= to =".
-
-Thu Jan 16 12:53:15 CST 1997 Joel Sherrill <joel@OARcorp.com>
-
- * rs6000/rtems.h: Change from being sysv4 based to being eabi based.
-
-Thu Jan 16 13:40:51 1997 Jim Wilson <wilson@cygnus.com>
-
- * mips.h (LINKER_ENDIAN_SPEC): Define.
- (LINK_SPEC): Add linker_endian_spec.
- (EXTRA_SPECS): Add linker_endian_spec.
-
-Thu Jan 16 08:02:13 1997 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.md (bCC, inverted bCC): Use bCC .+X instead of bCC 0f.
-
-Wed Jan 15 14:06:28 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload.h (reload_address_base_reg_class): Declare.
- (reload_address_index_reg_class): Declare.
- * reload1.c (reload_address_base_reg_class): Define.
- (reload_address_index_reg_class): Define.
- (init_reload): Initialize reload_address_{base,index}_reg_class.
- * reload.c (find_reloads_address): Use
- reload_address_base_reg_class rather than BASE_REG_CLASS. Use
- reload_address_index_reg_class rather than INDEX_REG_CLASS.
- (find_reloads_address_1): Likewise.
-
-Tue Jan 14 15:26:33 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * reload.c (REGNO_MODE_OK_FOR_BASE_P): Define if not defined.
- (REG_MODE_OK_FOR_BASE_P): Define if not defined.
- (find_reloads_address): Use REG[NO]_MODE_OK_FOR_BASE_P rather than
- REG[NO]_OK_FOR_BASE_P.
- (find_reloads_address_1): Likewise.
- Add mode parameter; change all callers.
-
- * reload1.c (eliminate_regs_in_insn): Handle more cases when
- eliminating the frame pointer to the hard frame pointer.
-
- * varasm.c (force_const_mem): Copy a CONST_INT rtx like a CONST rtx.
-
- * varasm.c (assemble_end_function): Call
- output_after_function_constants.
- (after_function_constants): New static variable.
- (output_after_function_constants): New static function.
- (output_constant_def): Check CONSTANT_AFTER_FUNCTION_P.
-
-Mon Jan 13 16:44:40 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000/aix41.h (CPP_PREDEFINES): Add -D_AIX41.
-
-Sun Jan 12 20:54:01 1997 Jim Wilson <wilson@cygnus.com>
-
- * libgloss.h (LINK_SPEC): Delete.
- (STARTFILE_SPEC): Delete spurious newline.
-
-Sat Jan 11 00:13:03 1997 Torbjorn Granlund <tege@quiet.matematik.su.se>
-
- * mips.md (norsi3, nordi3): Use canonical RTL. Prepend `*' to pattern
- name. Don't match immediates.
- (norsi3_const, nordi3_const): New patterns.
- (anddi3, iordi3, xordi3): Test TARGET_64BIT, not mips_isa
- in length attribute calculation.
- * mips.c (complemented_arith_operand): New function.
- (print_operand): Handle `e' for CONST_INT.
- * mips.h (PREDICATE_CODES): Add complemented_arith_operand.
-
-Fri Jan 10 14:11:53 1997 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000/aix41.h (SUBTARGET_SWITCHES): Add threads and pe.
- (CPP_SPEC): Add mpe and mthreads cases.
- (LIB_SPEC): Add mpe and mthreads cases to variant from rs6000.h.
- (STARTFILE_SPEC): Add mpe and mthreads support.
-
-Fri Jan 10 07:12:26 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * i386/cygwin32.h (LINK_SPEC): New definition.
-
- * Makefile.in (FLAGS_TO_PASS): Add STAGE_PREFIX, set by configure.
- * configure: Initialize exeext.
- Update STAGE_PREFIX in Makefile.
-
- * dwarfout.c (dwarfout_line): Push to LINE_SECTION after calling
- lookup_filename.
-
-Thu Jan 9 12:06:04 1997 Jim Wilson <wilson@cygnus.com>
-
- * i386.md (addsidi3_2): Add & to operand 0 of alternative 5.
-
-Thu Jan 9 12:06:04 1997 Stan Cox <coxs@dg-rtp.dg.com>
-
- From Linus Torvalds and Mat Hostetter:
- * i386.c (i386_sext16_if_const): Added to sign extend HImode constant.
- (i386_aligned_reg_p): Added to tell if an rtx is aligned.
- (i386_cc_probably_useless_p): Don't trust cc bits.
- * i386.h (TARGET_ZERO_EXTEND_WITH_AND): Don't do this for p6.
- * i386.md (cmpsf_ccfpeq+2): Use SImode test instruction.
- (movhi+1): Use movz instead of mov on p6.
- (addsi3): Add 128 by subtracting -128.
- (zero_extendhisi2): Use SImode move if aligned.
- ({add,sub,and,ior,xor}hi3): Likewise.
-
-Tue Jan 7 16:58:27 1997 Jason Merrill <jason@yorick.cygnus.com>
-
- * c-parse.in (extension): New rule for __extension__.
- (extdef, unary_expr, decl, component_decl): Use it.
-
-Mon Jan 6 15:44:37 1997 Oliver Kellogg (oliver.kellogg@space.otn.dasa.de)
-
- * 1750a.c: Now includes regs.h.
- ({movcnt,mod}_regno_adjust): Corrected typos.
- * 1750a.md (movhi): Corrected case of moving constant to memory.
-
-Mon Jan 6 08:00:57 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * mips.h: Delete redundant definitions of compiler and library fns.
-
- * dwarfout.c (type_attribute): Ignore any subtype for now.
-
- * fold-const.c (operand_equal_p): Rework to consider two
- expressions that have embedded identical SAVE_EXPRs as
- equivalent; also handle some more cases.
-
-Sun Jan 5 23:54:34 1997 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (pic_load_label): Fix test for using just an
- ldo rather than an addil;ldo sequence to load the label's
- address.
-
-Sun Jan 5 07:26:47 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_expr, case COMPONENT_REF): Fix error in last
- change: don't suppress conversion if just EXPAND_SUM.
-
-Sat Jan 4 18:44:01 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.h (struct tree_decl): saved_insns.i is HOST_WIDE_INT.
-
- * fold-const.c (const_binop): Rework to only make constants in
- one place; always use size_int if small enough and of sizetype.
- (size_int): Call force_fit_type.
- (fold): Avoid ever changing type of input tree.
-
- * expr.c (get_inner_reference): Fix type error.
- (expand_expr, case COMPONENT_REF): Don't convert if modifier
- is EXPAND_CONST_ADDRESS, EXPAND_SUM, or EXPAND_INITIALIZER.
- * tree.c (staticp, case COMPONENT_REF, BIT_FIELD_REF): Not
- static if bitfield.
-
- * expr.c (expand_expr, case COMPONENT_REF): If taking value
- from a CONSTRUCTOR, must mask/sign-extend if bitfield.
- (expand_builtin, case BUILT_IN_LONGJMP): Pass type, not IDENTIFIER,
- to second arg of RETURN_POPS_ARGS.
-
- * expr.c (expand_expr, case COND_EXPR): Add additional cases
- to "singleton" cases.
- * tree.c (integer_pow2): Mask value to width of type.
- (tree_log2): New function.
-
- * expmed.c (store_fixed_bit_field): If not SLOW_UNALIGNED_ACCESS,
- treat everything as maximally aligned.
-
- * combine.c (find_split_point, case SET): If SET_SRC is NE and
- STORE_FLAG_VALUE is -1, see if we can convert into NEG of shift.
- (force_to_mode, case NE): Make condition stricter.
-
- * calls.c (emit_library_call_value): Remove redundant check for
- outmode != VOIDmode.
-
-Sat Jan 4 08:12:16 1997 J.T. Conklin <jtc@rhino.cygnus.com>
-
- * Optimizations from John Vickers (john@rhizik.demon.co.uk):
- * m68k.c (output_function_{pro,epi}logue): Use addq/subq when
- adjusting stack pointer by small displacements.
- * m68k.md (addsi3, addhi3): Use two addqw (or subqw) insns when
- adding (or subtracting) small integer constants (8 < N <= 16) to
- both address and data registers.
-
-Sat Jan 4 07:06:07 1997 Kamil Iskra <iskra@student.uci.agh.edu.pl>
-
- * loop.c (basic_induction_var): Return 0 if SUBREG is not a
- promoted variable.
-
-Sat Jan 4 06:22:36 1997 Doug Rupp (rupp@gnat.com)
-
- * alpha.c (vmskrunch): Try to not chop trailing uppercase letters.
- * alpha/vms.h (ENDFILE_SPEC): Use "gnu", not "gnu_cc".
-
- * cccp.c (PRINTF_PROTO): Use __printf__ in __attribute__, not printf.
- * cexp.y (PRINTF_PROTO): Likewise.
-
-Fri Jan 3 09:01:00 1997 Craig Burley <burley@gnu.ai.mit.edu>
-
- * alpha.md (cmov): Fix operand numbers in case involving DF target,
- DF comparison, and SF source.
-
-Fri Jan 3 08:19:46 1997 Paul Eggert <eggert@twinsun.com>
-
- * cpplib.c (macroexpand): Delete any no-reexpansion marker following
- identifier at beginning of an argu concatenated with what precedes it.
-
-Fri Jan 3 07:59:21 1997 Ken Rose (rose@netcom.com)
-
- * reorg.c (fill_slots_from_thread): Skip moved insn in all three cases.
-
-Fri Jan 3 07:51:44 1997 Bob Manson <manson@cygnus.com>
-
- * function.c ({push,pop}_function_context_to): Save and restore
- current_function_args_info.
- * function.h (struct function): New field args_info.
-
-Fri Jan 3 06:55:09 1997 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * jump.c (rtx_equal_for_thread_p): Return 0 for floating-point.
-
- * reload.c (find_reloads): If replaced a PLUS or MULT with a
- simple operand, start over again.
-
- * va-alpha.h: Check for __VMS__, not VMS.
-
-Thu Jan 2 08:52:51 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure: Finish restoring change of default of objc threads to
- "single" for Linux-based GNU systems.
-
-Mon Dec 30 17:03:46 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (fmpy_operands): Remove. No longer needed.
- (combinable_add, combinable_copy, combinable_fmpy): Likewise.
- (combinable_fadd, combineable_fsub): Likewise.
- (pa_reorg): Call pa_combine_instructions.
- (pa_combine_instructions): Combine instructions to make things
- like fmpyadd and fmpysub.
- (pa_can_combine_p): Helper function for pa_combine_instructions.
- * pa.md (pa_combine_type): New attribute. Set it appropriately
- for various insns.
- (define_delays): Use a separate define_delay for unconditional
- branches.
- (fmpyadd, fmpysub peepholes): Remove, no longer needed.
- (fmpyadd, fmpysub insns): Add variant with fadd/fsub first,
- then the fmpy.
-
-Mon Dec 30 14:43:51 1996 Jim Wilson <wilson@cygnus.com>
-
- * reg-stack.c (subst_stack_regs_pat): Set src_note explicitly, instead
- of using invalid aggregate initialization.
-
- * print-tree.c (print_node): Don't try to print nonexistent
- TYPE_ATTRIBUTES field of a decl node.
-
-Mon Dec 30 10:30:25 1996 Richard Stallman <rms@ethanol.gnu.ai.mit.edu>
-
- * config.sub: Handle hiuxmpp as system type.
-
-Thu Dec 26 13:33:27 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (init_v4_pic): Explicitly set the length.
-
-Mon Dec 23 19:39:38 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.h (FUNCTION_ARG_REGNO_P): Correct for TARGET_SOFT_FLOAT and
- TARGET_FLOAT64 cases.
-
- * integrate.c (function_cannot_inline_p): Reject function with
- PARALLEL result.
- (expand_inline_function): Abort if function result not handled.
-
-Sat Dec 21 04:02:46 1996 Jason Merrill <jason@gerbil.cygnus.com>
-
- * mips.c (save_restore_insns): Mark large frame setup insns
- as frame-related.
- (mips_expand_prologue): Likewise.
-
- * dwarf2out.c (dwarf2out_frame_debug): Support MIPS large frames.
- (add_bound_info): Use default lower bounds.
- Handle simple variable bounds with a DIE ref.
- Don't generate a NULL loc descr.
- (add_subscript_info): Always add lower bound.
- (gen_formal_parameter_die): Always equate_decl_number_to_die.
- (gen_variable_die): Likewise. Don't use the old die for automatic
- variables.
-
-Wed Dec 18 10:23:46 1996 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (notice_update_cc): Enable this code.
- * mn10300.h (CC_OVERFLOW_UNUSABLE): Define.
- * mn10300.md (tstsi): Use "set_zn_c0" instead of "set" for cc status.
- (addsi3 pattern): Break "inc" into two different alternatives
- since "inc dn" sets cc0, but "inc an" does not.
- (multiply and divide patterns): Fix cc status.
- (bCC, inverted bCC): Restore any comparison which needs the
- overflow bits when CC_OVERFLOW_UNUSABLE is set.
- (zero and sign extensions): Fix cc status.
- (movm_store): Likewise.
-
-Tue Dec 17 15:02:44 1996 Jim Wilson <wilson@cygnus.com>
-
- * sched.c (update_flow_info): When add REG_DEAD notes for dest of
- last insn, add check for global_regs.
-
-Tue Dec 17 11:07:26 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/win-nt.h (HAS_INIT_SECTION): Delete, so that __main is
- called from main.
-
-Mon Dec 16 15:28:44 1996 Jim Wilson <wilson@cygnus.com>
-
- * combine.c (nonzero_bits): Ifdef out calls to num_sign_bit_copies.
- Add dummy define/undef for num_sign_bit_copies.
-
- * dwarfout.c (location_or_const_value_attribute, case CONCAT): Add.
-
- * combine.c (simplify_comparison): Use mode_width as shift count
- only if it is less than or equal to HOST_BITS_PER_WIDE_INT.
-
-Mon Dec 16 10:10:11 1996 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c (expand_epilogue): Restore registers in the
- "ret" instruction instead of a separate movm instruction.
- Support possible stack deallocation in "ret" instruction too.
- * mn10300.md (return_internal): Use "ret" instead of "rets";
- restore registers and deallocate stack as needed.
- (load_movm): Delete unused pattern.
-
- * mn10300.h (SMALL_REGISTER_CLASSES): Define.
-
-Fri Dec 13 14:46:54 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (dect): Rewrite pattern so that it can be combined.
-
-Fri Dec 13 13:14:51 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * varasm.c (output_constant_pool): If ASM_OUTPUT_POOL_EPILOGUE is
- defined, call it.
-
-Thu Dec 12 20:04:55 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * rtl.h (RTX_FRAME_RELATED_P): New macro.
- (struct rtx_def): Add frame_related bitfield.
- * final.c (final_scan_insn): Call dwarf2out_frame_debug.
- Don't call dwarf2out_begin_function.
- (final): Initialize dwarf2out_frame_debug.
- * dwarf2out.c (dwarf2out_begin_function): Remove.
- (dwarf2out_init): Use INCOMING_RETURN_ADDR_RTX.
- (DWARF_CIE_DATA_ALIGNMENT): Generalize.
- (DWARF_FRAME_REGNUM): Don't add 1.
- (decode_cfi_rtl): Lose.
- (dwarf2out_def_cfa): Now takes reg and offset directly.
- (reg_save): Likewise.
- (dwarf2out_reg_save): Now takes offset.
- (initial_return_save): Grok INCOMING_RETURN_ADDR_RTX.
- Replaces dwarf2out_return_save.
- (dwarf2out_cfi_label): New fn.
- (add_fde_cfi): Use it.
- (dwarf2out_frame_debug): New fn.
- * mips.h (DWARF_FRAME_REGNUM): Tweak r31.
- (INCOMING_RETURN_ADDR_RTX): Define.
- * mips.c (mips_expand_prologue): Set RTX_FRAME_RELATED_P as needed.
- (save_restore_insns): Likewise.
- * i386.c (ix86_expand_prologue): Likewise.
- * i386.h (INCOMING_RETURN_ADDR_RTX): Define.
- (DWARF_FRAME_RETURN_COLUMN): Define.
-
- * dwarf2out.c (add_AT_long_long): Renamed from add_AT_double fo
- clarity.
- (print_die): Adjust.
- (add_AT_float): New fn.
- (add_const_value_attribute): Support fp values.
- (size_of_die): Use blocks for long_long and fp values.
- (value_format, output_die): Likewise.
- (output_loc_operands): Don't support DW_OP_const8?.
-
-Thu Dec 12 19:49:09 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * varasm.c (CONSTANT_POOL_BEFORE_FUNCTION): Define if not
- defined.
- (assemble_start_function): Check CONSTANT_POOL_BEFORE_FUNCTION
- to decide whether to call output_constant_pool.
- (assemble_end_function): Likewise.
-
- * calls.c: Check SMALL_REGISTER_CLASSES at run time, not just
- compile time.
- * combine.c, cse.c, function.c, jump.c, local-alloc.c: Likewise.
- * loop.c, reload.c, reload1.c: Likewise.
- * dsp16xx.h (SMALL_REGISTER_CLASSES): Define with value.
- * h8300.h (SMALL_REGISTER_CLASSES): Likewise.
- * i386.h (SMALL_REGISTER_CLASSES): Likewise.
- * pdp11.h (SMALL_REGISTER_CLASSES): Likewise.
- * sh.h (SMALL_REGISTER_CLASSES): Likewise.
-
-Thu Dec 12 15:25:39 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (sysv call insns): If flag_pic add @plt suffix.
-
- * rs6000.md (fix_truncdfsi2_store): Fix offsets > 32k.
-
- * rs6000/t-ppccomm: New file for common parts of embedded and
- System V target Makefile support.
-
- * rs6000/t-ppcos: New file for System V OS target Makefile
- support.
-
- * rs6000/t-solaris: Delete, merge into rs6000/t-ppcos.
-
- * rs6000/t-{ppc,ppcgas}: Only keep the multilib specific parts,
- moving the rest to rs6000/t-ppccomm.
-
- * configure (powerpc*-*-*): For embedded and System V
- configurations, add rs6000/t-ppccomm.
- For GNU/Linux and Solaris, use t-ppcos.
-
- * ginclude/ppc-asm.h (cr*, f*): Add new macros for register names.
-
- * rs6000/sol-c0.c (_start): Fix uninitialized data bug.
-
- * rs6000.md (init_v4_pic): Add @local to call.
- (icbi,dcbst,sync,isync): Delete PowerPC cache control insns.
-
- * rs6000/sysv4.h (ASM_SPEC): On explicit -mcall-solaris, pass
- -msolaris to the assembler.
-
- * rs6000.c (rs6000_sync_trampoline): Delete.
- (rs6000_trampoline_template): Aix & System V don't need template now.
- (rs6000_initialize_trampoline): For System V, call the function
- __trampoline_setup to set up the trampoline.
-
- * rs6000.h (TRAMPOLINE_TEMPLATE): Delete here.
- * rs6000/win-nt.h (TRAMPOLINE_TEMPLATE): Add it here.
-
- * rs6000/tramp.asm: New file, setup trampolines properly on System
- V systems, properly flushing the caches.
-
-Thu Dec 12 10:53:10 1996 Jeffrey A Law (law@cygnus.com)
-
- * reorg.c (fill_slots_from_thread): Don't call eligible_for_delay
- with an insn with asm operands.
-
- * expmed.c (emit_store_flag_force): Fix typos/thinkos.
-
-Thu Dec 12 08:09:20 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * i386.c (i386_return_pops_args): Libcalls ignore TARGET_RTD.
-
-Thu Dec 12 07:56:03 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.h (maybe_get_identifier): New declaration.
-
- * calls.c (emit_library_call): Don't pass VOIDmode to type_for_mode.
-
- * va-alpha.h: Add definitions for VMS; they differ from Unix.
-
- * Makefile.in (stamp-objlist): Handle first character of object
- file being a digit.
-
- * 1750a.h (function_arg, {movcnt,mod}_regno_adjust): Add decls.
- (branch_or_jump): Likewise.
- (FUNCTION_ARG): Remove cast of function_arg result to rtx.
- * 1750a.md: Remove unneeded casts to char *.
-
-Thu Dec 12 05:55:27 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.c (arm_gen_constant, case [IX]OR): Don't invert constant if
- loading into temporary.
-
-Wed Dec 11 18:57:21 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * toplev.c (rest_of_compilation): Make sure unwinder RTL is saved.
-
- * collect2.c (write_c_file): Wrap the ctor/dtor lists and fns
- with `extern "C" { ... }'.
-
-Wed Dec 11 17:46:48 1996 John F. Carr <jfc@mit.edu>
-
- * tree.h (tree_decl): Reorder field declarations to reduce size
- on 64 bit machines.
-
- * combine.c (try_combine): When splitting an insn, check for the
- new I2 setting a SUBREG.
-
-Wed Dec 11 17:00:47 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of
- using "%ld".
- (output_prolog): Don't print useless comment for VMS.
-
- * alpha.c (output_prolog): SIZE is now HOST_WIDE_INT.
- * alpha.md (mov[hq]i unnamed): Split up for TARGET_BYTE_OPS and not.
-
- * function.c (fixup_var_refs_1, case ZERO_EXTRACT): Don't call
- fixup_memory_subreg if no longer SUBREG of MEM.
-
-Wed Dec 11 14:10:48 1996 Jeffrey A Law (law@cygnus.com)
-
- * mn10300.c: New file for Matsushita MN10300 port.
- * mn10300.h, mn10300.md, t-mn10300, xm-mn10300.h: Likewise.
- * config.sub: Recognize mn10300 as a basic machine type.
- * configure: Similarly.
- * ginclude/stdarg.h: mn10300 is little endian.
- * ginclude/varargs.h: Likewise.
-
-Wed Dec 11 09:09:10 1996 Nagai Takayuki <nagai@ics.es.osaka-u.ac.jp>
-
- * libgcc2.c (cacheflush): Add SONY NEWS-OS 4.2 version.
-
-Wed Dec 11 09:01:39 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * calls.c (emit_library_call, emit_library_call_value):
- Don't pass an identifier node as function type for
- library functions, but rather build a function type that
- has a return type with the correct mode.
- * i386.c (i386_return_pops_args): Don't test for IDENTIFIER_NODE.
- * i386/isc.h (obsolete RETURN_POPS_ARGS): Test first argument
- for IDENTIFIER_NODE.
- * i386/next.h (RETURN_POPS_ARGS): Likewise.
- * i386/sco.h (RETURN_POPS_ARGS): Likewise.
- * i386/sco5.h (RETURN_POPS_ARGS): Likewise.
- * i386/scodbx.h (RETURN_POPS_ARGS): Likewise.
- * m68k.h (RETURN_POPS_ARGS): Likewise.
- * ns32k.h (RETURN_POPS_ARGS): Likewise.
- * pyr.h (RETURN_POPS_ARGS): Likewise.
- * gmicro.h (RETURN_POPS_ARGS): Likewise; fix typo.
-
-Tue Dec 10 17:36:47 1996 J.T. Conklin <jtc@rhino.cygnus.com>
-
- * Add optimizations from John Vickers (john@rhizik.demon.co.uk)
- * m68k.h (TARGET_CPU32): New macro.
- * m68k.md (add[hs]i3): Only use two addq.w or subq.w instructions
- when adding or subtracting constants 8 < N < 16 on TARGET_CPU32.
- Use lea instead of add.w when adding 16 bit constants to address
- registers on all but TARGET_68040.
- * m68k.c (output_function_{pro,epi}logue): Use lea instead of add.w
- when adjusting stack pointer on all but TARGET_68040.
-
-Tue Dec 10 15:55:23 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * optabs.c (emit_unop_insn): Treat ZERO_EXTEND like SIGN_EXTEND.
-
-Tue Dec 10 13:47:24 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * combine.c (combinable_i3pat): Bring back to sync with can_combine_p.
-
- * sh.h (ADJUST_INSN_LENGTH): Don't break from loop when LOOP_BEG found.
- Calculate padding in new variable pad.
-
-Mon Dec 9 18:00:38 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (output_uleb128): Output value in human-readable comment.
- (output_sleb128): Likewise.
- (various): Adjust.
- (output_call_frame_info): Only output info if it's interesting.
- (add_src_coords_attributes): New fn.
- (add_name_and_src_coords_attributes): Split out from here.
- (gen_enumeration_type_die): Add src coordinates.
- (gen_struct_or_union_type_die): Likewise.
- (dwarf2out_finish): Call output_call_frame_info for all targets.
-
-Thu Dec 5 11:25:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (add_pure_or_virtual_attribute): Only add
- AT_containing_type if -g2 or higher.
-
- * dwarf2out.c (gen_struct_or_union_type_die): Make sure that
- the type for AT_containing_type has been generated.
- (gen_decl_die): Likewise.
-
- * dwarf2out.c (type_tag): Check DECL_IGNORED_P.
- (add_pure_or_virtual_attribute): Check DECL_VINDEX instead.
- (scope_die_for): Likewise.
- * dwarfout.c (type_tag): Likewise.
-
-Wed Dec 4 22:51:38 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (decode_cfi_rtl): Support getting a CONST_INT.
- (dwarf2out_begin_function): Adjust.
- (reg_save): Divide offset by the alignment.
- (output_cfi): Support having more than one advance_loc.
- (output_call_frame_info): Re-initialize current_label.
- (dwarf2out_begin_prologue): Initialize current_label to NULL.
- (lookup_cfa, lookup_cfa_1): New fns.
- (dwarf2out_def_cfa): Call lookup_cfa.
- (dwarf2out_finish): Don't generate CIE CFIs.
- (dwarf2out_init): Generate them here.
- (DWARF_FRAME_RETURN_COLUMN): Use PC_REGNUM.
-
- (add_pure_or_virtual_attribute): Note virtual context.
- (gen_formal_parameter_die): Return the die.
- (gen_formal_types_die): Set AT_artificial on `this'.
- (gen_subprogram_die): Add AT_accessibility.
- (gen_variable_die): Likewise.
- (gen_field_die): Likewise. Don't generate location attribute for
- union members.
- (gen_struct_or_union_type_die): Note where our vtable lives.
- (gen_decl_die): Handle anonymous union fields.
- (dwarf2out_decl): Always output `bool'.
-
-Mon Dec 2 03:55:15 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * final.c (final_end_function): Don't call dwarf2out_end_function.
-
- * dwarf2out.c (output_line_info): Emit special opcodes for each line
- entry, even if the line number doesn't change.
- (pend_type, output_pending_types_for_scope): New fns.
- (gen_struct_or_union_type_die): Use them to defer generating member
- dies if we're in the middle of some other context.
- (gen_type_die): Still put nested types in the right place.
- (dwarf2out_decl): Call output_pending_types_for_scope.
-
- * dwarf2out.c (dw_fde_struct): Replace end_prologue, begin_epilogue
- with current_label.
- (DWARF_CIE_INSN_SIZE, DWARF_CIE_SIZE): Remove.
- (DWARF_CIE_HEADER_SIZE): The size without the initial insns.
- (size_of_cfi): Revert.
- (decode_cfi_rtl, add_fde_cfi, dwarf2out_def_cfa, reg_save,
- dwarf2out_reg_save, dwarf2out_return_save): New fns.
- (dwarf2out_begin_function): Use them to generate CFIs.
- (dwarf2out_finish): Use them to generate E CFIs.
- Don't set next_fde_offset.
- (calc_fde_sizes): Initialize cie_size.
- (output_call_frame_info): Don't generate CIE CFIs.
- (dwarf2out_end_function): Remove.
-
- * tree.c (maybe_get_identifier): New fn.
- * varasm.c (assemble_name): Use it instead of get_identifier.
-
-Fri Nov 29 15:13:39 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * jump.c (jump_optimize): Don't move initialization if there is a
- label between it and the jump for if (foo) bar++ to bar += (foo !=0)
-
-Wed Nov 27 16:21:14 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * Remove change of Oct 4.
- * i386.h (outer_function_chain): Remove.
- (current_function_calls_alloca): Remove.
- (rtx_equal_function_value_matters): Remove.
- (N_REGS_USED, N_ALLOCATABLE_REGISTERS): Remove.
- * i386.md (adddi3_1, subdi3_1): Remove.
- (adddi3, subdi3): Revert.
- (movsf, movsf_mem, movsf_normal, movdf, movdf_mem, movdf_mem+1):
- Likewise.
- (movxf, movxf_mem, movxf_mem+1, addsidi3_1, addsidi3_2): Likewise.
- (adddi3_1, subsidi3, subdi3_1): Likewise.
- (addsidi3_1, addsidi3_2, subsidi3): Likewise.
- (addsidi3_1, addsidi3_2, adddi3, subsidi3): Disable the problem
- reload alternatives.
-
-Wed Nov 27 16:21:14 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * i386.md (ashldi3_non_const_int, ashrdi3_non_const_int):
- Use a hidden branch to handle shifts > 32 bit.
- (lshrdi3_non_const_int): Likewise.
- (floatdixf2): Don't use unnecessary XFmode operation.
-
-Wed Nov 27 15:23:41 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (assemble_variable): Don't emit DWARF.
-
- * toplev.c (rest_of_type_compilation): Don't emit DWARF.
- (main): Just let -gdwarf mean DWARF v1; remove -gdwarf-1.
-
- * dwarfout.c (decl_class_context): New fn.
- (output_global_subroutine_die): Fix declaration case.
- (output_global_variable_die): Likewise.
- (output_type): Note when we are in a class defn. If we're a nested
- type and our context hasn't been written, do that. Do early exit
- for nested types.
- (output_decl): Output the class context for fns and vars.
- Don't emit detailed parm info for a fn declaration.
- Use TYPE_DECL_IS_STUB, is_redundant_typedef.
- (type_ok_for_scope): Support emitting nested types later.
- (is_redundant_typedef): New fn.
- (TYPE_DECL_IS_STUB): New macro.
- (output_compile_unit_die): Check use_gnu_debug_info_extensions.
- (output_local_subroutine_die, output_global_subroutine_die,
- dwarfout_begin_function, dwarfout_end_function, dwarfout_line,
- generate_macinfo_entry, dwarfout_init, dwarfout_finish): Likewise.
-
- * dwarf2out.c (decl_class_context): Static.
- (lookup_type_die): Use TYPE_SYMTAB_POINTER.
- (equate_type_number_to_die): Likewise.
- (gen_subprogram_die): If we're in class context, it's a decl.
- (gen_variable_die): Likewise.
- (gen_decl_die): Output the containing type.
- (dwarf2out_init): Lose type_die_table code.
-
-Wed Nov 27 08:30:54 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (DRIVER_DEFINES): New macro, with the macro
- definitions for the driver.
- (gcc.o): Make rule use $(DRIVER_DEFINES).
- * gcc.c (process_command) [LANG_SPECIFIC_DRIVER]: Call
- lang_specific_driver, passing along the addr of FATAL for errors
- along with our ARGC and ARGV.
-
-Wed Nov 27 08:21:13 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.md (iorsi_zexthi_ashl16): New pattern.
- (ashrsi_16): New name for old unnamed pattern.
-
- * objc/misc.c (stdlib.h): Define __USE_FIXED_PROTOTYPES__ before
- including stdlib.h.
-
-Wed Nov 27 08:17:34 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * i386.md (decrement_and_branch_until_zero+[3-8]): Add missing
- CC_STATUS_INIT.
- (decrement_and_branch_until_zero+[5-8]): Delete redundant assignment.
-
-Wed Nov 27 07:56:27 1996 J.T. Conklin <jtc@rhino.cygnus.com>
-
- * m68k.md ({and,ior,xor}si3_internal): Removed !TARGET_5200 from
- conditionals now that entire insn is disabled when !TARGET_5200.
-
-Wed Nov 27 07:52:32 1996 Oliver Kellogg <kellogg@space.otn.dasa.de>
-
- * 1750a.md (movhi pattern): Fixed MEM to MEM move problem.
-
-Tue Nov 26 14:50:54 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (move_by_pieces): Abort only if length positive at end.
- * function.c (frame_offset, get_frame_size): Make HOST_WIDE_INT.
- * function.h (struct function): Make frame_offset be HOST_WIDE_INT.
- (get_frame_size): Add definition.
- * reload1.c (reload): Make starting_frame_size be HOST_WIDE_INT.
-
-Mon Nov 25 16:55:14 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (dwarf2out_finish): Don't emit call frame info
- for non-MIPS targets.
- (is_redundant_typedef): New fn.
- (modified_type_die): Refer to typedef DIEs where appropriate.
- (gen_typedef_die): Support DECL_ORIGINAL_TYPE.
- (gen_type_die): Likewise. Use is_redundant_typedef.
- (gen_subprogram_die): Don't force a spec DIE for local class methods.
-
-Mon Nov 25 15:09:12 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * gcc.c (handle_braces): Rework last change.
-
-Mon Nov 25 13:49:51 1996 Jim Wilson <wilson@cygnus.com>
-
- * configure (build_exeext, exeext): New variables. Use sed to insert
- build_exeext value into Makefile exeext rule.
- (*-*-cygwin32): Set exeext.
- * i386/x-cygwin32 (exeext): Delete.
- * rs6000/x-cygwin32 (exeext): Delete.
-
- * dwarf.h (enum dwarf_location_atom): Add OP_MULT.
- * dwarfout.c (output_mem_loc_descriptor, case MULT): Add.
- * dwarfout2.c (mem_loc_descriptor, case MULT): Add.
-
- * dwarfout.c (dwarf_fund_type_name, case FT_unsigned_int64): Fix typo.
-
-Sun Nov 24 21:42:01 1996 J.T. Conklin <jtc@rhino.cygnus.com>
-
- * m68k.md (andsi3): Changed into define_expand.
- (andsi3_internal): Rename from old andsi3, changed condition
- to !TARGET_5200.
- (andsi2_5200): New insn.
- (iorsi3): Change into define_expand.
- (iorsi2_internal): Rename from old iorsi3, changed condition
- to !TARGET_5200.
- (iorsi2_5200): New insn.
- (xorsi3): Change into define_expand.
- (xorsi2_internal): Rename from old xorsi3, changed condition
- to !TARGET_5200.
- (xorsi2_5200): New insn.
-
-Sun Nov 24 21:31:32 1996 John F. Carr <jfc@mit.edu>
-
- * i386.h (N_ALLOCATABLE_REGISTERS): Remove extra backslash at
- end of macro definition.
-
- * cpplib.c (LOCAL_INCLUDE_DIR): Remove default definition.
- (include_defaults_array): Do not use LOCAL_INCLUDE_DIR or
- TOOL_INCLUDE_DIR if they are not defined.
- * cccp.c: Likewise.
-
- * Makefile.in (cppmain.o): New rule.
-
-Sun Nov 24 19:14:50 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * fold-const.c (merge_ranges): In (+,-) case, if lower bounds are
- the same the result is always false.
-
-Sun Nov 24 18:48:31 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-typeck.c (build_indirect_ref): Don't give warning for
- dereferencing void * if evaluation is being skipped.
-
- * c-decl.c (poplevel): Don't call output_inline_function if
- DECL_SAVED_INSNS is not set.
-
- * gcc.c (give_switch): Add new arg, INCLUDE_BLANKS.
- (handle_braces): All callers changed.
- Add support for new construct: %{S*^}.
-
-Sun Nov 24 18:44:48 1996 Paul Eggert <eggert@twinsun.com>
-
- * c-parse.in (unary_expr, expr_no_commas): Increment skip_evaluation
- when analyzing an expression that is known not to be evaluated.
- (sizeof, alignof): New rules.
- * c-tree.h (skip_evaluation): New variable.
- * c-common.c (skip_evaluation): Likewise.
- (overflow_warning, unsigned_conversion_warning): Don't warn about
- potential runtime errors when skipping evaluation.
- * c-typeck.c (build_binary_op): Likewise.
- (build_conditional_expr): op1 now always nonnull.
-
-Sun Nov 24 17:06:58 1996 Bernd Schmidt (crux@Pool.Informatik.RWTH-Aachen.DE)
-
- * toplev.c (rest_of_compilation): Call regscan before each
- jump threading pass.
-
-Sun Nov 24 16:37:18 1996 Dave Love <d.love@dl.ac.uk>
-
- * configure (objc_thread_file): Set conditionally in each case so
- may be overidden with `--enable-objcthreads=posix'.
- Change GNU/Linux default to `single'.
-
-Fri Nov 22 17:53:15 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (assemble_variable): Output DWARF in the third case, too.
-
- * dwarf2out.c (decls_for_scope): Only add DIEs with no parents to
- our scope.
- (gen_subroutine_type_die): Parm types go under the fn type DIE.
-
- * Makefile.in ($(T)crt{begin,end}.o): Move CRTSTUFF_T_CFLAGS after
- general flags.
-
- * mips/t-iris6 (CRTSTUFF_T_CFLAGS): Define.
- * mips.c (compute_frame_size): Fix fp_save_offset.
-
- * dwarf2out.c (new_die): If we get a NULL parent, inc limbo_die_count.
- (decls_for_scope): Decrement limbo_die_count as appropriate.
- (dwarf2out_finish): Check for good limbo_die_count.
- (size_of_cfi): If regno too big for DW_CFA_offset, use offset_extended
- instead.
- (output_call_frame_info): Add disabled code for specifying ABI.
- (dwarf2out_begin_function): Note all saved regs.
-
- * dwarf2out.c (gen_subprogram_die): Have a DIE for each fn at
- toplevel.
- (scope_die_for): Only use the NULL for fns and tags.
-
-Tue Nov 21 15:53:51 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (output_stack_adjust): New argument TEMP. Changed all callers.
- If the adjust cannot be done with one, but can be done with two
- CONST_OK_FOR_I constants, do it that way.
-
-Thu Nov 21 14:25:55 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Include <stdio.h> in <assert.h> even if not C++ if
- stderr needs to be defined.
-
-Wed Nov 20 15:38:13 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_type_compilation): Do output function-scope tags
- for DWARF 2.
- * c-decl.c (pushtag): Set TYPE_CONTEXT on the tag.
- * toplev.c, varasm.c: s/dwarf2out_file_scope_decl/dwarf2out_decl/g.
- * dwarf2out.c (add_prototyped_attribute): Use a value of 1.
- (gen_subprogram_die): Support AT_static_link.
- (dwarf2out_decl): Rename from dwarf2out_file_scope_decl.
- Give nested fns and tags a die_parent of NULL.
- (decls_for_scope): Fix the die_parent for nested fns and tags.
- (scope_die_for): If we get a context of NULL, just return it.
-
-Tue Nov 19 18:21:11 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (gen_subprogram_die): Support block extern decls.
- (gen_variable_die): Likewise.
- (gen_decl_die): Emit block extern function decls.
-
- * c-decl.c (implicitly_declare): Set DECL_ARTIFICIAL.
-
-Tue Nov 19 16:50:32 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure (powerpc*-{sysv,elf,eabi{,aix,sim}}): Set
- extra_headers to ppc-asm.h.
- (powerpc*-{linux,solaris,rtems,vxworks}): Likewise.
- (powerpc*-{winnt,pe,cygwin32}): Likewise.
-
- * rs6000/t-{ppc,ppcgas,solaris,winnt} (EXTRA_HEADERS): Don't set here.
-
-Mon Nov 18 14:51:46 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (DWARF_CIE_INSN_SIZE): New macro.
- (DWARF_CIE_HEADER_SIZE): Use it.
- (DWARF_FRAME_RETURN_COLUMN, DWARF_FRAME_REGNUM): New macros.
- (output_call_frame_info, dwarf2out_begin_function): Use them.
- For the MIPS, output the first CFA insn in the CIE.
- * dwarf2.h (enum dwarf_call_reg_usage): Lose.
- (dwarf_macinfo_record_type): Fix spelling.
- * mips/mips.h (DWARF_FRAME_REGNUM, DWARF_FRAME_RETURN_COLUMN): Define.
-
- * dwarf2out.c (base_type_die): Just generate the DIEs as needed,
- rather than building up some table.
- (init_base_type_table): Lose.
- (add_subscript_info): Use add_type_attribute. Don't give an upper
- bound for an array of unknown size.
- (gen_unspecified_parameters_die): Remove DWARF-1 kludge.
- (dwarf2out_init): Lose call to init_base_type_table.
- (is_c_family, is_fortran): New fns.
- (gen_compile_unit_die): Recognize GNU F77.
- (gen_array_type_die): Use AT_declaration for an array of unknown size.
- (modified_type_die): Take TYPE_MAIN_VARIANT before passing it
- to build_type_variant, so we ignore named variants.
- (dwarf2out_file_scope_decl): Don't generate DIEs for built-in structs,
- either; they will be emitted if they are used.
- From wilson:
- (gen_array_type_die): Force the element type out first on IRIX 6.
-
-Sun Nov 17 20:23:11 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (get_inner_reference): Fix error in previous change.
-
-Sat Nov 16 06:08:27 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * emit-rtl.c (operand_subword): Avoid confusion if sizeof (float)
- is less than a full word.
-
- * alpha.h (MASK_BYTE_OPS): Now define as 1024.
- * alpha/vms.h (TARGET_DEFAULT): Use symbolic values.
-
- * expr.c (get_inner_reference): Add new arg PALIGNMENT and compute it.
- (expand_assignment, do_jump): Pass new arg to get_inner_reference.
- (expand_expr, case COMPONENT_REF): Likewise.
- * fold-const.c (optimize_bit_field_compare, decode_field_reference):
- Likewise.
- * tree.h (get_inner_reference): Add new arg.
-
- * Add support for Alpha/VMS, mostly from
- Klaus Kaempf (kkaempf@progis.de)
- * configure (alpha-dec-vms*): New target.
- * alpha.c (override_options): Handle VAX format floating-point.
- (print_operand, case ',', '-'): New cases.
- (alpha_builtin_saveregs): Handle VMS convention.
- (alpha_sa_{mask,size}, alpha_pv_save_size, alpha_using_fp):
- New versions for VMS.
- (output_{pro,epi}logue, function_arg): Likewise.
- (direct_return): Never true on VMS.
- (check_float_value): Return 0 for VMS.
- (vmskrunch, alpha_{need,write}_linkage): New function.
- * alpha.h ({MASK,TARGET}_{OPEN_VMS,FLOAT_VAX}): New macros.
- (TARGET_SWITCHES): Add float-vax and float-ieee.
- ({FUNCTION,LIBCALL}_VALUE, FUNCTION_VALUE_REGNO_P): R1 and R33
- are also return registers.
- (ASM_OUTPUT_DOUBLE): Support both floating-point formats.
- (PRINT_OPERAND_FUNCT_VALID_P): Add ',' and '-'.
- * alpha.md ({div,mod}[sd]i3): Only for VMS.
- (fp operations): Add modifiers for multiple floating-point formats.
- (call patterns): Handle new calling sequence for VMS.
- (tablejump): Make new pattern for VMS.
- (nonlocal_goto_receiver, arg_home): New patterns.
- * alpha/t-vms, alpha/vms.h, alpha/xm-vms.h: New files.
-
-Fri Nov 15 17:38:20 1996 Doug Evans <dje@seba.cygnus.com>
-
- * sdbout.c (current_file): New global.
- (PUT_SDB_SRC_FILE): New PUT_SDB_FOO macro.
- (sdbout_init): Initialize current_file ifdef MIPS_DEBUGGING_INFO.
- (sdbout_{start_new,resume_previous}_source_file): New functions.
- * toplev.c (debug_{start,end}_source_file): Call them if SDB_DEBUG.
- * mips.h (PUT_SDB_SRC_FILE): Define.
-
-Fri Nov 15 16:11:25 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarfout.c (dwarfout_line): Don't emit line number info for
- functions outside of .text.
-
-Fri Nov 15 15:52:42 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386/386bsd.h (COMMENT_BEGIN): Delete.
- * i386/freebsd.h (COMMENT_BEGIN): Likewise.
- * i386/netbsd.h (COMMENT_BEGIN): Likewise.
- * i386/unix.h (COMMENT_BEGIN): Likewise.
-
-Fri Nov 15 13:22:42 1996 Jim Wilson <wilson@cygnus.com>
-
- * fold-const.c (unextend): Rewrite type conversions to avoid overflow.
-
-Fri Nov 15 12:11:28 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (try_combine): Properly copy an rtvec.
- * emit-rtl.c (gen_rtvec_vv): New function.
- (copy_rtx_if_shared): Call it.
- * integrate.c (copy_for_inline): Likewise.
- * reload1.c (eliminate_regs): Likewise.
- * rtl.h (gen_rtvec_vv): Declare.
- * genattrtab.c (simplify_cond): Make TESTS an array of rtunions.
- * genextract.c (main): Use loop, not bcopy, to set recog_operands
- from an rtvec.
- * rtl.c (rtvec_alloc): Clear rtwint instead of rtvec.
-
- * machmode.h (HOST_PTR_PRINTF): Handle char * wider than long.
- (HOST_WIDE_INT_PRINT_{DEC,UNSIGNED,HEX,DOUBLE_HEX}): New macros.
- * final.c (asm_fprintf): Use "ll" prefix for a long long HOST_WIDE_INT.
- (output_{asm_insn,addr_const}): Use HOST_WIDE_INT_PRINT_*.
- * print-tree.c (print_node{,_brief}, case INTEGER_CST): Likewise.
- * print-rtl.c (print_rtx, case 'w'): Use HOST_WIDE_INT_PRINT_DEC.
-
- * unroll.c (iteration_info): Fix code so that it knows iteration_var
- is a HOST_WIDE_INT, not a long.
-
- * fold-const.c (operand_equal_p): Do comparison with REAL_VALUES_EQUAL.
- (make_range): Properly decide when to get TREE_TYPE of arg0.
- Handle EXP being an INTEGER_CST at end.
- (fold_range_test): Handle return of 0 from make_range.
- (fold, case TRUTH_AND_EXPR): Handle first arg of 0.
- (fold, case TRUTH_OR_EXPR): Handle first arg of 1.
-
- * c-common.c (decl_attributes, case A_ALIAS): Add missing parens.
-
-Fri Nov 15 06:37:54 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * fold-const.c (range_binop): Set SNG1 to zero if ARG1 is a
- not a lower or upper bound.
-
-Thu Nov 14 23:08:25 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * flags.h (debug_info_type): Add DWARF2_DEBUG.
- * toplev.c (main): Support DWARF2_DEBUG. Add -gdwarf-1, -gdwarf-2
- options. Check debug level after choosing type.
- (debug_{start,end}_source_file, debug_{define,undef}): New functions.
- (compile_file): Support dwarf2 separately from dwarf1.
- (rest_of_type_compilation, rest_of_compilation): Likewise.
- * final.c (final_start_function): Likewise.
- (final_end_function, final_scan_insn, output_source_line): Likewise.
- * varasm.c (assemble_variable): Likewise.
- * dwarfout.c: Don't check DWARF_VERSION.
- * dwarf2out.c: s/dwarfout/dwarf2out/g. Check DWARF2_DEBUGGING_INFO.
- * c-lex.c (check_newline): Use debug_* instead of calling *out
- functions directly.
- * svr4.h (DWARF2_DEBUGGING_INFO): Define.
- * mips/iris6.h (PREFERRED_DEBUGGING_TYPE): DWARF2_DEBUG.
- (DWARF2_DEBUGGING_INFO): Define instead of DWARF_DEBUGGING_INFO.
- (LINK_SPEC): Pass -w through.
- * mips.h (PREFERRED_DEBUGGING_TYPE): Don't check `len'.
-
-Thu Nov 14 17:25:47 1996 Jeffrey A Law (law@cygnus.com)
-
- * h8300.c (dosize): Don't clobber static chain reg if needed by
- current function.
-
-Wed Nov 13 17:05:19 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (stage?-start): Keep a copy of EXTRA_MULTILIB_PARTS
- in the build directory.
-
-Tue Nov 12 23:17:17 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (print_operand, case 'Y'): Fix comparisons to handle
- NaNs properly in all cases.
-
-Tue Nov 12 18:47:24 1996 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (emit_group_store): For REG case, call gen_lowpart if
- modes are different.
-
-Tue Nov 12 18:24:40 1996 Doug Rupp (rupp@gnat.com)
-
- * gcc.c (exit): If VMS, define as __posix_exit.
- (option_map): Add define-macro and undefine-macro.
-
-Tue Nov 12 17:55:10 1996 Torbjorn Granlund <tege@tege.pdc.kth.se>
-
- * alpha.c (input_operand): If TARGET_BYTE_OPS accept HImode and QImode.
- * alpha.h (MASK_BYTE_OPS): New define.
- (TARGET_BYTE_OPS): New define.
- (TARGET_SWITCHES): Handle -mbyte.
- (LOAD_EXTEND_OP): When MODE is not SImode, return ZERO_EXTEND.
- * alpha.md (zero_extendqidi2): Handle TARGET_BYTE_OPS.
- (zero_extend{hidi,qisi,hisi}2): Likewise.
- (extendqisi2): Use extendqidi2x if TARGET_BYTE_OPS.
- (extendqidi2): Likewise.
- (extendqidi2x): New pattern.
- (extendhisi2): Use extendhidi2x if TARGET_BYTE_OPS.
- (extendhidi2): Likewise.
- (extendhidi2x): New pattern.
- (movhi): Handle TARGET_BYTE_OPS.
- (movhi matcher): Output ldwu and stw.
- (movqi): Handle TARGET_BYTE_OPS.
- (movqi matcher): Output ldbu and stb.
-
-Tue Nov 12 16:53:37 1996 Rob Savoye <rob@chinadoll.cygnus.com>
-
- * configure (hppa1.1-pro*, i960-*-coff*,m68k-*-aout*): Add libgloss.h.
- (m68k-*-coff*, mips*-*-elf*, sparc*-*-aout*, sparc*-*-coff*): Likewise.
- * config/libgloss.h: New file.
-
-Tue Nov 12 16:21:45 1996 Joern Rennecke <amylaar@cygnus.com>
-
- * jump.c (jump_optimize): Fix bug in Sep 23 change.
-
-Tue Nov 12 16:15:31 1996 Andrew Cagney (cagney@tpgi.com.au)
-
- * global.c (prune_references): Add missing symmetic CONFLICTP call.
-
-Tue Nov 12 14:34:40 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.c (output_function_{pro,epi}logue): Save and restore
- fp-registers only if TARGET_68881.
-
- * m68k/mot3300.h (ASM_OUTPUT_INTERNAL_LABEL): Prefix labels with "L%".
- (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_CASE_LABEL): Likewise.
- (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Likewise.
-
- * m68k/mot3300.h (TARGET_DEFAULT): Use MASK_68040_ALSO, not MASK_68040.
- * m68k/next.h, m68k/ccur-GAS.h (TARGET_DEFAULT): Likewise.
-
- * fixproto (std_files): Add sys/socket.h.
-
- * m68k.md (movqi): Emit 'st' for INTVAL & 255 == 255, not INTVAL == -1.
- (seq,sne,sgt,sgtu,slt,sltu,sge,sgeu,sle,sleu): Allow "m" as operand 0.
-
-Tue Nov 12 14:17:45 1996 Paul Eggert <eggert@twinsun.com>
-
- * c-decl.c (grokdeclarator): Generate a warning if -Wimplicit,
- unless a warning was already generated by -Wreturn-type.
-
-Tue Nov 12 14:11:02 1996 Pat Rankin <rankin@eql.caltech.edu>
-
- * Make qsort callback routines conform to the ANSI/ISO standard.
- * c-decl.c (field_decl_cmp): Use `const void *' arguments.
- * global.c (allocno_compare): Likewise.
- * reload1.c (hard_reg_use_compare, compare_spill_regs): Likewise.
- (reload_reg_class_lower): Likewise.
- * stupid.c (stupid_reg_compare): Likewise.
- * local-alloc.c (qty_compare_1, qty_sugg_compare_1): Likewise.
- (QTY_CMP_PRI, QTY_CMP_SUGG): New macros.
- (qty_compare_1, qty_sugg_compare_1): Use them.
-
-Tue Nov 12 13:20:25 1996 Jim Wilson <wilson@cygnus.com>
-
- * fold-const.c (merge_ranges): In (+,-) case, treat subset specially
- if lower bounds are the same.
-
-Tue Nov 12 13:10:01 1996 J.T. Conklin <jtc@cygnus.com>
-
- * m68k.md (addsi3): If TARGET_5200, use the lea insn to add small
- constants to address registers.
- (negsi2): Change into define_expand.
- (negsi2_internal): Rename from old negsi2, changed condition
- to !TARGET_5200.
- (negsi2_5200): New insn.
- (one_cmplsi2): Change into define_expand.
- (one_cmplsi2_internal): Rename from old one_cmplsi2, changed
- condition to !TARGET_5200.
- (one_cmplsi2_5200): New insn.
- (negdi2_5200): Corrected constraints.
- (one_cmpldi2): Changed condition to !TARGET_5200.
-
- * m68k.c (m68k_align_loops_string, m68k_align_jumps_string): New vars.
- (m68k_align_funcs_string, m68k_align_loops): Likewise.
- (m68k_align_jumps, m68k_align_funcs): Likewise.
- (override_options): New function.
- * m68k.h (TARGET_OPTIONS): Added alignment options.
- (MAX_CODE_ALIGN, ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE):
- New macros.
- (FUNCTION_BOUNDARY): Use value derrived from m68k_align_funcs
- instead of constant.
-
- * m68k.c (output_function_{pro,epi}logue): Fix typo in last change.
-
-Tue Nov 12 09:26:51 1996 Torbjorn Granlund <tege@wombat.gnu.ai.mit.edu>
-
- * i386.md (parallel inc/dec and branch-if-zero/nonzero): Use `+' in
- constraint.
-
-Mon Nov 11 15:12:22 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * libgcc2.c: Also define WEAK_ALIAS if ASM_OUTPUT_WEAK_ALIAS.
- * mips/iris6.h (ASM_OUTPUT_WEAK_ALIAS): Define.
- * varasm.c (assemble_alias): Use ASM_OUTPUT_WEAK_ALIAS.
-
- * dwarf2out.c (TYPE_USED_FOR_FUNCTION): Lose.
- (gen_compile_unit_die): Only append -g with -g2 or better.
- (scope_die_for): Don't emit any type info with -g1.
- (gen_subprogram_die): Likewise.
- (gen_decl_die): Likewise.
- (dwarfout_file_scope_decl): Likewise.
- (dwarfout_init): Likewise.
-
- * mips/iris6.h (TYPE_ASM_OP): Define.
- (SIZE_ASM_OP): Define.
- (ASM_WEAKEN_LABEL): Define.
- (BSS_SECTION_ASM_OP): Define.
- (ASM_OUTPUT_ALIGNED_LOCAL): Don't use ASM_DECLARE_OBJECT_NAME.
- (ASM_OUTPUT_ALIGNED_BSS): Define.
- (ASM_DECLARE_OBJECT_NAME): Redefine to emit .size directive.
- (ASM_FINISH_DECLARE_OBJECT): Define.
- (ASM_OUTPUT_DEF): Don't define.
-
-Fri Nov 8 20:38:51 1996 Jim Wilson <wilson@cygnus.com>
-
- * function.c (expand_function_end): Handle BLKmode structures returned
- in registers.
-
-Fri Nov 8 20:27:07 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * stor-layout.c (layout_record): Check for VAR_DECL instead
- of TREE_STATIC.
-
- * varasm.c (assemble_variable): Do write out DWARF for
- record-scope variables.
- * toplev.c (rest_of_type_compilation): Do write out DWARF for
- record-scope types.
-
- * dwarf2out.c (gen_enumeration_type_die): Set TREE_ASM_WRITTEN on a
- complete enum type.
- (gen_struct_or_union_type_die): Don't recurse between nested classes.
- (gen_type_die): Write out nested classes by writing out their context.
-
-Fri Nov 8 17:40:27 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * emit-rtl.c (change_address): If MEMREF isn't changing,
- return the old one.
-
- * expr.c (expand_assignment): Remove bogus resetting of alignment
- to inner alignment.
- (expand_expr, case COMPONENT_REF): Likewise.
-
-Fri Nov 8 16:31:31 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * reg-stack.c (compare_for_stack_reg, subst_stack_regs_pat):
- Add support for float conditional move.
-
-Thu Nov 7 07:46:07 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (layout_record): Treat constant size as variable if
- it overflows.
- * fold-const.c (const_binop, case *_DIV_EXPR): Don't do special
- sizetype case if a constant overflows.
- (size_binop): Use integer_{zero,one}p instead of explicit test.
- * tree.c (integer_{zero,one,all_ones,pow2}p, real_{zero,one,two}p):
- Return 0 if TREE_CONSTANT_OVERFLOW.
-
-Wed Nov 6 17:53:33 1996 Torbjorn Granlund <tege@wombat.gnu.ai.mit.edu>
-
- * i386.md (parallel inc and branch-if-zero/nonzero): Add two
- new pattern variants. Change incrementing pattern to use incl/jnz.
-
-Wed Nov 6 09:46:10 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (override_options): Set defaults for -march and -mcpu.
- (output_float_compare): Use cc_status.flags to mark if this
- comparison can be done with fcomi.
- (output_fp_cc0_set): A conditional move may be in a PARALLEL.
-
- * i386.h (CC_FCOMI): Define
-
- * i386.md (sgt,sgtu,sge,sle,bgt,blt,bge,ble): Use CC_FCOMI
- (movsicc_1,movhicc_1): Use correct size suffix.
- (movsfcc_1,movdfcc_1): Cleanup default move case.
-
-Wed Nov 6 09:46:10 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * i386.h (HARD_REGNO_MODE_OK): If long double isn't XFmode, can't
- allow XFmode.
-
-Tue Nov 5 22:49:56 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (define_split for and_shl_scratch):
- Use rtx_equal_p on the operands to find out which alternative is used.
- * sh.c (gen_shl_and): Try to generate shorter constant for and.
-
-Mon Nov 4 19:13:52 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c: Clean up unused variables.
- Use ASM_{GENERATE,OUTPUT}_INTERNAL_LABEL, shorten label names.
- (loc_descriptor): Use reg_loc_descriptor.
- (TYPE_DECL_IS_STUB): New macro.
- (gen_decl_die): Use it.
- (dwarfout_file_scope_decl): Use it.
-
-Mon Nov 4 10:23:46 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * ginclude/va-ppc.h (__va_regsave_t,va_start,va_end): Wrap macro
- and structures inside #ifndef __VA_PPC_H__ to allow reinclusion.
-
- * rs6000.h (LEGITIMATE_SMALL_DATA_P): Don't allow -fpic or TARGET_TOC.
- (LEGITIMATE_LO_SUM_ADDRESS_P, LEGITIMIZE_ADDRESS): Likewise.
-
- * rs6000.md (movsi): Don't call elf_{high,low} if -fpic.
-
- * rs6000/cygwin32.h (STARTFILE_SPEC): Eliminate empty %{}.
-
-Sun Nov 3 15:56:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (TARGET_TOC): Plain -fpic does not require a TOC.
- ({MINIMAL_TOC,CONST}_SECTION_ASM_OP): -fpic should be treated like
- -mrelocatable in these cases.
- (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
- (ASM_OUTPUT_ALIGNED_LOCAL): Use sdata_section, not sbss_section.
-
-Fri Nov 1 19:57:13 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (based_loc_descr): Use DBX_REGISTER_NUMBER. The
- "frame base" is just the frame or stack reg without an offset.
- (gen_subprogram_die): Likewise.
- (dwarfout_begin_function): Use DBX_REGISTER_NUMBER.
-
-Fri Nov 1 09:50:05 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (make_range): Don't merge unsigned case with range
- containing upper bound; instead merge just with zero and convert
- a range with no upper bound to opposite one with no lower bound.
- (merge_ranges): In (+,-) case, don't treat subset specially if
- the upper bounds are the same; fix typo in others case here.
-
-Thu Oct 31 20:12:13 1996 Jeffrey A Law (law@cygnus.com)
-
- * fold-const.c (make_range, case PLUS_EXPR): Correct
- normalization of an unsigned range that wraps around zero.
-
-Thu Oct 31 21:06:37 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips/t-iris6 (EXTRA_MULTILIB_PARTS): Define.
- (EXTRA_PARTS): Don't define.
-
- * dwarf2out.c (gen_struct_or_union_type_die): Use AT_specification
- for nested types defined outside their containing class. Lose
- is_complete.
- (gen_enumeration_type_die): Lose is_complete.
- (gen_type_die): Lose is_complete.
- (add_name_and_src_coords_attributes): Tweak.
- (gen_subroutine_type_die): Use scope_die_for.
- (gen_ptr_to_mbr_type_die): Likewise.
- (gen_subprogram_die): Support AT_artificial.
- (gen_variable_die): Likewise.
- (dwarfout_file_scope_decl): Lose finalizing.
-
-Thu Oct 31 18:43:18 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * pa.c (emit_move_sequence): Refine previous change.
-
-Thu Oct 31 13:25:32 1996 Jim Wilson <wilson@cygnus.com>
-
- * crtstuff.c: Put HAS_INIT_SECTION ifdefs around Irix6 support.
-
- * tree.c (decl_function_context): Handle QUAL_UNION_TYPE.
-
- * calls.c (expand_call): Disable special handling for const calls
- that return a PARALLEL rtx.
- * expr.c (expand_expr, case CONSTRUCTOR): Don't use a PARALLEL
- target.
-
-Thu Oct 31 11:45:00 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/t-{ppcgas,ppc,solaris} (EXTRA_MULTILIB_PARTS): Add
- {e,s}crt{i,n,0}.o.
- ({stmp,install}-crt): Delete, no longer used.
- ({,INSTALL_}LIBGCC): Remove {stmp,install}-crt rule.
-
-Thu Oct 31 02:49:58 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * i386.md (parallel inc and branch-if-zero/nonzero):
- Check for -1, not zero.
-
-Wed Oct 30 15:50:49 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (range_binop): Strip NOPs from result and
- verify it's an INTEGER_CST.
- (make_range, case BIT_NOT_EXPR): Fix typo in constant for PLUS_EXPR.
-
- * stor-layout.c (layout_record): Use HOST_WIDE_INT for size.
-
- * stmt.c (expand_asm_operands): Disallow matching constraints
- on output and validate the numbers on inputs.
-
-Tue Oct 29 16:21:59 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gcc.c (process_command,main): Process -specs=file and -specs
- file after reading the main specs file to allow the user to
- override the default.
- (DEFAULT_WORD_SWITCH_TAKES_ARG): Add specs to list.
- (option_map): Likewise.
-
-Tue Oct 29 15:49:18 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (stmp-multilib): Pass $flags to s-m-sub in
- MULTILIB_CFLAGS.
- (stmp-multilib-sub): Build EXTRA_MULTILIB_PARTS.
- ($(T)crt*.o): Add $(T), lose stamp-crt rule, use MULTILIB_CFLAGS.
- (install-multilib): Install EXTRA_MULTILIB_PARTS.
-
-Mon Oct 28 20:09:39 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (shl_sext_ext): Don't accept simple left/right shift variant.
- * sh.c (EXT_SHIFT_SIGNED): New macro.
- (shl_sext_kind, gen_shl_sext): try left shift - sign extend -
- left shift - arithmetic right shift in case 2.
-
-Mon Oct 28 14:55:42 1996 Jim Wilson <wilson@cygnus.com>
-
- * configure (sh-*-*): Set float_format to sh.
- * config/float-sh.h: New file.
-
-Mon Oct 28 14:26:08 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips/mips.h (RTX_COSTS): Add cases for SIGN_EXTEND and ZERO_EXTEND.
-
- * m68k/lb1sf68.asm: Change # to IMM in udivsi3 __mcf5200__.
-
- * combine.c (simplify_rtx): Add some optimizations for TRUNCATE.
- (expand_compound_operation): Add some optimizations for ZERO_EXTEND.
-
-Mon Oct 28 14:11:20 1996 Gavin Koch <gavin@cygnus.com>
-
- * varasm.c (make_decl_rtl,assemble_variable):
- Allow named sections for uninitialized variables.
-
-Mon Oct 28 13:08:51 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * pa.c (emit_move_sequence): If reload in progress, replace
- reference to pseudo with reference to corresponding MEM.
-
- * c-typeck.c ({un,}signed_type): If can't do anything, call
- signed_or_unsigned_type.
- (signed_or_unsigned_type): If already right signedness, return.
-
-Mon Oct 28 13:05:26 1996 Stephen Williams (steve@icarus.com)
-
- * i960.h: Add specification for -Jx types.
- * i960/t-960bare: Include multilib support for Jx types.
-
-Mon Oct 28 10:06:00 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/t-{ppc{,gas},solaris} (install-crt): Depend on
- installdirs, not install-dir.
-
- * rs6000/sysv4.h (TARGET_TOC): -fpic does not use a TOC area.
-
-Mon Oct 28 09:07:42 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * reload1.c (delete_output_reload): Don't use delete_insn
- when deleting all stores into a replaced pseudo.
-
- * sh.md (movsf_ieq, movsf_ie): Merged the former into the latter.
- Changed matching define_split appropriately.
- (movsf): Changed appropriately.
- (reload_insf) Define.
- * sh.h (SECONDARY_INPUT_RELOAD_CLASS): Define.
-
-Mon Oct 28 08:38:23 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * dsp16xx.h (ASM_OUTPUT_BYTE): Adjust definition to actual type of
- VALUE, which is HOST_WIDE_INT.
-
-Mon Oct 28 07:36:07 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * ginclude/stddef.h: Make sure file is processed if some of the
- known __need_* macros is defined.
-
-Sun Oct 27 21:37:59 1996 J.T. Conklin <jtc@cygnus.com>
-
- * m68k.c (output_function_prologue): Adjust SP then use movmel with
- plain address indirect mode for TARGET_5200.
- (output_function_epilogue): Disable moveml and use several movel's
- instead for TARGET_5200.
- (output_function_{pro,epi}logue): Use lea instruction to adjust
- stack pointer for short displacements for TARGET_5200.
-
-Sun Oct 27 15:27:45 1996 Jeffrey A Law (law@cygnus.com)
-
- * fold-const.c (merge_ranges): Fix thinko/typo.
-
-Sat Oct 26 22:07:04 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * expr.c (convert_modes): Before returning a const_double for a
- large unsigned value, zero extend an integer value if necessary.
-
-Sat Oct 26 15:24:55 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k/x-mot3300 (XCFLAGS): Disable native assembler's jump
- optimization for expr.o and cp/decl.o.
-
-Sat Oct 26 14:04:09 1996 Ben Harris <bjh21@cam.ac.uk>
-
- * m68k.c (output_function_prologue): Add REGISTER_PREFIX to stack
- probe instruction.
-
-Sat Oct 26 13:59:05 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * explow.c (allocate_dynamic_stack_space): Delete reference to
- nonexistant macro ALLOCATE_OUTGOING_ARGS.
-
- * next.h (CPP_PREDEFINES): Add -D_NEXT_SOURCE.
-
-Sat Oct 26 13:50:49 1996 Mark Mitchell (mitchell@centerline.com)
-
- * configure (i486-ncr-sysv4*): Use i386/sysv4gdb if stabs and gas.
-
-Sat Oct 26 12:20:35 1996 John F. Carr <jfc@mit.edu>
-
- * configure: Support --with-cpu=* for SPARC. Or target default
- values instead of adding them.
- * sparc.c (cpu_default): Add entries for v8 and supersparc.
- * sparc.h: Define TARGET_CPU values for v8 and supersparc.
-
-Sat Oct 26 11:38:01 1996 Kamil Iskra <iskra@student.uci.agh.edu.pl>
-
- * collect2.c (dump_file): Call fclose for opened files.
-
-Sat Oct 26 11:29:29 1996 J"orn Rennecke (amylaar@cygnus.co.uk)
-
- * jump.c (jump_optimize): Fix second error in last change.
-
- * svr3.h: Fix typo which makes comment text be non-comment.
-
-Fri Oct 25 16:18:39 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/t-winnt (LIBGCC1): Don't build libgcc1.
- (EXTRA_PARTS): Build crti.o, crtn.o.
- (stmp-crt): Remove old multilib support.
-
-Thu Oct 24 15:09:14 1996 Jim Wilson <wilson@cygnus.com>
-
- * fold-const.c (make_range, case PLUS_EXPR): Normalize an unsigned
- range that wraps around 0.
-
-Thu Oct 24 14:37:17 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.md: Change predicates for 64 bit arithmetic operations
- so that they accept sign extended registers as operands.
- (extendsidi2): Accept hi or lo as input.
- * mips.c (movdi_operand, se_register_operand,
- se_reg_or_0_operand, se_uns_arith_operand, se_arith_operand,
- se_nonmemory_operand, se_nonimmediate_operand): New functions.
- (mips_move_2words): Handle a SIGN_EXTEND source.
- (print_operand): Handle a SIGN_EXTEND operand.
- (mips_secondary_reload_class): Handle a SIGN_EXTEND rtx.
- * mips.h: Declare new mips.c functions.
- (PREDICATE_CODES): Add new functions.
-
-Thu Oct 24 07:41:14 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (make_range, comparison cases): When making range
- for unsigned to merge in, use full range.
-
- * stor-layout.c (GET_MODE_ALIGNMENT): Delete definition; duplicate.
-
-Thu Oct 24 07:28:53 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * reload1.c (emit_reload_insns): Check for second_reloadreg
- in SECONDARY_OUTPUT_RELOAD_CLASS / PRESERVE_DEATH_INFO_REGNO_P case.
-
-Wed Oct 23 14:27:43 1996 Mike Stump <mrs@cygnus.com>
-
- * crtstuff.c (__do_global_dtors_aux): Allow finalization code to
- be run more than once.
- * libgcc2.c (__do_global_dtors): Ditto.
-
-Wed Oct 23 20:42:23 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (dump_table): handle SFmode and DFmode.
- (broken_move): handle simple PARALLEL.
- (machine_dependent_reorg, pc-relative move generation): Likewise.
- * sh.h (CONST_DOUBLE_OK_FOR_LETTER_P): always true for 'F' .
- (LEGITIMATE_CONSTANT_P): accept SFmode and DFmode.
- * sh.md (movdf_k, movsf_i, movsf_ie): new alternative for
- pc-relative load.
- (movsf_ieq): new define_insn with matching define_split.
- (movsf): use it where appropriate.
- (consttable_sf, consttable_df): new define_insns.
-
-Wed Oct 23 17:48:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * svr4.h (MAKE_DECL_ONE_ONLY): Fix typo in use of macro parameter.
-
-Wed Oct 23 17:46:13 1996 Pat Rankin <rankin@eql.caltech.edu>
-
- * cexp.y (yylex): Cast string literal to U_CHAR* for lookup() call.
-
-Wed Oct 23 14:50:04 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * stmt.c (expand_return): Expand cleanups. Make sure we get pseudo
- and provide target in non-BLKmode case. Get proper return type of fn.
-
-Wed Oct 23 14:16:06 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * reload.c (find_reloads): Handle any unary operator.
- * recog.c (constrain_operands): Likewise.
-
- * mips.md: Remove extendsidi2 define_expand.
- Rename extendsidi2_internal define_insn to extendsidi2, and add a
- register to register case.
-
-Wed Oct 23 14:08:31 1996 Jim Wilson <wilson@cygnus.com>
-
- * a29k.c (a29k_makes_calls): New global variable.
- (compute_regstack_size, a29k_compute_reg_names): New functions.
- (output_prolog): Much code moved to two new functions.
- Use a29k_makes_calls instead of makes_calls.
- * a29k.h (ASM_DECLARE_FUNCTION_NAME): Call a29k_compute_reg_names.
-
- * calls.c (expand_call): In target code, move PARALLEL case above
- target != case.
-
- * mips.c (block_move_load_store, block_move_sequence): Delete.
- (block_move_loop): New parameter orig_dest. Call change_address to
- create new MEM instead of gen_rtx.
- (expand_block_move): New local orig_dest. Pass it to block_move_loop.
- Call change_address to create new MEM instead of gen_rtx.
-
-Wed Oct 23 10:30:32 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * loop.c (combine_givs): When combining a DEST_REG giv with its
- only use, always set the benefit of the combined giv to that of
- the DEST_REG giv.
-
- * emit-rtl (gen_lowpart_common): When converting a floating
- point value into an integer, use WORD as (first) word.
-
- * combine.c (can_combine_p): When SMALL_REGISTER_CLASSES is defined,
- avoid substituting a return register into I3.
-
- * optabs.c (emit_libcall_block): Before adding an REG_EQUAL note,
- check that it will really apply to a single instruction.
- (expand_binop, expand_fix): Likewise.
-
-Wed Oct 23 10:20:52 1996 Stephen L Moshier (moshier@world.std.com)
-
- * real.c (exact_real_inverse): New function, if REAL_ARITHMETIC.
- * fold-const.c (exact_real_inverse): Likewise, if no REAL_ARITHMETIC.
- (fold, case RDIV_EXPR): Turn divide by constant into multiplication
- by the reciprocal, if optimizing and result is exact.
- * real.h (exact_real_inverse): Declare.
-
-Wed Oct 23 00:12:52 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * expr.h (emit_store_flag_force): Declare.
-
-Tue Oct 22 18:32:20 1996 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (unroll_loop): Always reject loops with unbalanced blocks.
-
-Tue Oct 22 18:27:06 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * config/fp-bit.c (float_to_usi): Correct thinko: avoid negative shift.
- (df_to_sf): Remember any discarded nonzero bits in the low order
- guard bit.
-
- * ginclude/va-mips.h: Add support for -mips1 and -msoft-float when
- using -mabi=eabi.
- * mips/abi64.h (SETUP_INCOMING_VARARGS): When MIPS EABI, handle
- TARGET_SINGLE_FLOAT or ! TARGET_FLOAT64 correctly when saving
- floating point registers to the stack.
- * mips/mips.c (mips_function_value): If TARGET_SINGLE_FLOAT, use
- GP_RETURN for floating point types larger than 4 bytes.
-
-Tue Oct 22 09:43:49 1996 Geoffrey Noer <noer@cygnus.com>
-
- * rs6000/cygwin32.h (LIB_SPEC): Add -lkernel32 all of the time,
- and {user,gdi,comdlg}32 if -mwindows.
-
-Tue Oct 22 05:24:05 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (scope_die_for): Don't skip lexical blocks.
- (gen_lexical_block_die): Call push_decl_scope.
- (gen_subprogram_die): Never refer to the function symbol.
- (dwarfout_begin_prologue): Likewise.
-
-Mon Oct 21 20:22:49 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * expmed.c (emit_store_flag_force): New function.
- * optabs.c (expand_binop): Use it.
-
- * expr.c (do_store_flag): Don't check if target is 0 in code
- emitting store flag as compare-branch.
-
-Mon Oct 21 17:58:33 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.c (override_options): Correct typo (MASK_64BIT should
- have been TARGET_64BIT).
-
-Mon Oct 21 13:58:54 1996 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (loop_comparison_code): New static variable.
- (unroll_loop): Add check for loop_comparison_code
- (loop_iterations): Set loop_comparison_code.
-
- * sh.c (gen_shl_sext): Add missing parameter to shl_sext_kind call.
-
- * mips.h (INITIAL_FRAME_POINTER_OFFSET): Delete.
-
- * loop.c (strength_reduce): Add check for ! bl->reversed to
- auto_inc_opt code.
-
-Mon Oct 21 12:28:15 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * jump.c (jump_optimize): Fix bug in Oct. 14 change.
-
-Mon Oct 21 07:59:16 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_expr): Disable optimization of using convert
- if exp's type is a subtype.
-
- * c-typeck.c (build_array_ref): If -Wchar-subscripts, also warn
- in case when pointer is being indexed.
-
-Mon Oct 21 07:39:31 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * jump.c (jump_optimize): Use emit_store_flag even if branches
- are cheap, if the store is even cheaper.
-
-Sun Oct 20 20:01:09 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * reload1.c (reload_reg_free_p, reloads_conflict): RELOAD_OTHER
- and RELOAD_FOR_OTHER_ADDRESS conflict.
-
- * i386.md (ffs[sh]i2): Add missing CC_STATUS_INIT.
-
-Fri Oct 18 13:32:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (float conversion insns): Generate correct code
- if the bit 15 of rs6000_fpmem_offset is non-zero.
-
-Thu Oct 17 23:22:03 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarfout.c (data_member_location_attribute): Support binfos.
- (output_inheritance_die): New fn.
- (output_type): Use it.
-
- * dwarf2out.c (value_format): Split out from...
- (output_value_format): Here.
- (build_abbrev_table): Use value_format.
- (size_of_locs): New fn.
- (size_of_die): Don't assume a loc needs a 2-byte length.
- (value_format, output_die): Likewise.
-
-Thu Oct 17 14:46:14 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.c (override_options): In 64 bit EABI mode, set TARGET_LONG64.
-
-Thu Oct 17 11:34:51 1996 Bob Manson <manson@cygnus.com>
-
- * expr.c (do_jump): Conditionalize cleanups for the COND_EXPR case,
- similarly to the way TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR are
- handled.
-
-Thu Oct 17 01:20:16 1996 Jim Wilson <wilson@cygnus.com>
-
- * m68k.h (MASK_68040_ALSO): New macro.
- (TARGET_SWITCHES): Option -m68020-40 includes MASK_68040_ALSO.
-
-Wed Oct 16 16:25:38 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (scope_die_for): Also support decls, add asserts.
- (modified_type_die): Modified types all go under comp_unit_die.
- (add_type_attribute): Just pass context_die through.
- (various): Revert useless lookup_type_die change.
- (gen_subprogram_die): Use scope_die_for. Call push_decl_scope.
- (gen_inlined_subroutine_die): Call push_decl_scope.
- (gen_struct_or_union_type_die): Likewise.
- (gen_decl_die): Don't call push_decl_scope.
-
- * mips/iris6.h (*_SPEC): Replace enumeration of !mabi= with !mabi*.
- (ASM_OUTPUT_{CON,DE}STRUCTOR): Enable.
- (STARTFILE_SPEC): Support -mips4, -shared.
- (ENDFILE_SPEC): Likewise.
- (LIB_SPEC): Support -shared, avoid warning 84.
- (LIBGCC_SPEC): Define.
- (LINK_SPEC): Support -shared, remove -woff 84.
- * mips/t-iris6 (EXTRA_PARTS): Add crtstuff.
- * crtstuff.c: Support Irix 6.
- * configure: Don't use collect2 for Irix 6.
- * libgcc2.c (__main): Don't use any of this stuff if HAS_INIT_SECTION.
-
-Wed Oct 16 11:46:37 1996 Mike Stump <mrs@cygnus.com>
-
- * elxsi.h (CHECK_FLOAT_VALUE): Removed.
-
-Wed Oct 16 14:19:38 1996 Jim Wilson <wilson@cygnus.com>
-
- * iris6.h (CPP_PREDEFINES): Add -D_LONGLONG.
- (CPP_SPECS): Remove -D_LONGLONG.
-
-Wed Oct 16 03:34:42 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * i386.md (parallel inc/dec and branch-if-zero/nonzero): New patterns.
-
-Tue Oct 15 22:28:11 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.h (enum mips_abi_type): Add ABI_EABI.
- (CPP_SPEC): Define __mips_soft_float if -msoft-float, and
- __mips_eabi if -mabi=eabi.
- (INITIAL_ELIMINATION_OFFSET, CUMULATIVE_ARGS,
- GO_IF_LEGITIMATE_ADDRESS, CONSTANT_ADDRESS_P, LEGITIMATE_CONSTANT,
- LEGITIMIZE_ADDRESS): Add support for MIPS EABI.
- * mips/abi64.h (STACK_BOUNDARY, MIPS_STACK_ALIGN,
- FUNCTION_ARG_PADDING, RETURN_IN_MEMORY, SETUP_INCOMING_VARARGS):
- Add support for MIPS EABI.
- (FUNCTION_ARG_PASS_BY_REFERENCE): Define.
- (FUNCTION_ARG_CALLEE_COPIES): Define.
- * mips.c (mips_const_double_ok, function_arg_advance,
- function_arg, function_arg_partial_nregs, override_options,
- compute_frame_size): Add support for MIPS EABI.
- (function_arg_pass_by_reference): New function.
- * ginclude/va-mips.h: Add support for MIPS EABI.
-
-Tue Oct 15 19:10:08 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_type_compilation): Don't write out
- DWARF for function-scope types yet.
- (compile_file): Do send vars with no RTL to the DWARF code.
-
-Tue Oct 15 17:54:43 1996 Doug Evans <dje@cygnus.com>
-
- * loop.c (strength_reduce): Avoid taking PATTERN of a label.
-
-Tue Oct 15 16:52:33 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips/iris6.h: (SUBTARGET_CPP_SIZE_SPEC): Define.
- (SUBTARGET_CPP_SPEC): Remove definitions of __SIZE_TYPE__ and
- __PTRDIFF_TYPE__, now in SUBTARGET_CPP_SIZE_SPEC.
-
-Tue Oct 15 11:19:17 1996 Lee Iverson <leei@Canada.AI.SRI.COM>
-
- * mips.h (CPP_SPEC): Restore -D_LANGUAGE_C for Objective C.
-
-Mon Oct 14 18:03:35 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (gen_decl_die): Do generate dies for classes with -g1.
- (dwarfout_file_scope_decl): Likewise.
-
-Mon Oct 14 16:31:44 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * jump.c (jump_optimize): Check for if (...) { x = a; goto l; } x = b;
-
-Mon Oct 14 14:19:49 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (modified_type_die): Don't bother with AT_address_class.
- (add_data_member_location_attribute): Handle getting a binfo.
- (add_location_or_const_value_attribute): Handle a decl with no RTL.
- (add_pure_or_virtual_attribute): Add AT_vtable_elem_location.
- (add_name_and_src_coords_attributes): Only use DECL_ASSEMBLER_NAME
- for staticp things.
- (gen_subprogram_die): Set up AT_inline for abstract decls.
- (gen_inheritance_die): New fn.
- (gen_member_die): Also emit info for base classes.
-
-Sat Oct 12 00:07:00 1996 Doug Evans <dje@cygnus.com>
-
- * fold-const.c (make_range): Handle NULL operand 0 like in BIND_EXPRs.
-
-Fri Oct 11 15:42:22 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_compilation): If we did a
- save_for_inline_copying, reset DECL_ABSTRACT_ORIGIN for the
- function when we're done.
-
- * toplev.c (main): DWARF works with C++ now.
-
- * dwarf2out.c (gen_subprogram_die): Disable MIPS_AT_has_inline
- support for now.
-
-Fri Oct 11 14:31:10 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * dwarfout.c: (output_bound_representation): Fix typo in prototype.
-
-Fri Oct 11 12:19:21 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.h ({,SUBTARGET_}MIPS_AS_ASM_SPEC): Define.
- ({GAS,TARGET,SUBTARGET}_ASM_SPEC): Define.
- (SUBTARGET_ASM_{OPTIMIZING,DEBUGGING}_SPEC): Define.
- (ASM_SPEC): Rewrite to use above specs.
- (SUBTARGET_CPP{,_SIZE}_SPEC): Define.
- (CPP_SPEC): Use above specs. Don't define _LANGUAGE_C if C++ or
- Objective C.
- ({,SUBTARGET_}EXTRA_SPECS): Define.
- * mips/dec-bsd.h ({CPP,ASM}_SPEC): Don't define.
- * mips/dec-osf1.h (CPP_SPEC): Don't define.
- (SUBTARGET_CPP_SIZE_SPEC): Define.
- * mips/elf64.h (CPP_SPEC): Don't define.
- (SUBTARGET_CPP_SPEC): Define.
- * mips/gnu.h (TARGET_DEFAULT): Define.
- (ASM_SPEC): Don't define.
- * mips/iris3.h (CPP_SPEC): Don't define.
- (SUBTARGET_CPP_SPEC): Define.
- * mips/iris4loser.h (ASM_SPEC): Don't define.
- (SUBTARGET_MIPS_AS_ASM_SPEC): Define.
- (SUBTARGET_ASM_OPTIMIZING_SPEC): Define.
- * mips/iris5.h (CPP_SPEC): Don't define.
- (SUBTARGET_CPP_SPEC): Define.
- * mips/iris6.h ({CPP,ASM}_SPEC): Don't define.
- (SUBTARGET_{CPP,ASM,MIPS_AS_ASM,ASM_DEBUGGING}_SPEC): Define.
- * mips/netbsd.h ({CPP,ASM}_SPEC): Don't define.
- (SUBTARGET_CPP_SPEC): Define.
- * mips/osfrose.h ({CPP,ASM,ASM_FINAL}_SPEC): Don't define.
- (SUBTARGET_CPP{,_SIZE}_SPEC): Define.
- * mips/sni-svr4.h (CPP_SPEC): Don't define.
- (SUBTARGET_CPP_SIZE_SPEC): Define.
-
-Thu Oct 10 17:58:49 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * mips/iris6.h (ASM_OUTPUT_SECTION_NAME): Define.
- (DWARF_OFFSET_SIZE): Define.
-
- * dwarf2out.c (most everywhere): Support SGI/MIPS -mabi=64 by fixing
- code which assumed pointers are 4 bytes long, parameterizing many
- sizes on DWARF_OFFSET_SIZE and using DELTA instead of DELTA4,
- DATA instead of DATA4, FORM_ref instead of FORM_ref4.
- (DWARF_ROUND, UNALIGNED_DOUBLE_INT_ASM_OP): New macros.
- (UNALIGNED_WORD_ASM_OP, ASM_OUTPUT_DWARF_DELTA): Likewise.
- (ASM_OUTPUT_DWARF_DATA, DW_FORM_data, DW_FORM_ref): New macros.
- (gen_variable_die): Only equate_decl_number_to_die if
- decl is TREE_STATIC.
- (get_AT): Fix thinko.
-
- * dwarf2out.c (constant_size): New fn.
- (size_of_die): Use it instead of assuming 4 bytes.
- (output_value_format, output_die): Likewise.
- (build_abbrev_table): Need new abbrev if size of constant differs.
- (dwarf_attr_name): Add new SGI/MIPS extensions.
- (gen_subprogram_die): Support DW_AT_MIPS_has_inlines.
- (gen_inlined_subroutine_die): Likewise.
-
-Thu Oct 10 16:38:58 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.md (mov[sd]fcc): Use register_operand, not reg_or_0_operand,
- for source predicates.
-
-Thu Oct 10 15:19:38 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (floatsidf2_load): For large stack frames, do not
- generate an illegal memory reference.
- (movdi, movdf define_splits): Fix code so that it works for either
- big or little endian hosts generating code for either big or
- little endian targets.
-
- (from Jim Wilson)
- * rs6000.c (rs6000_save_toc_p): Delete global variable.
- (rs6000_{save,restore}_machine_status): Do not save/restore it.
- (rs6000_init_expanders): Do not initialize it.
- (rs6000_stack_info): Always create TOC save space.
-
- * rs6000.md (NT indirect call insns): Do not set
- rs6000_save_toc_p.
-
- * rs6000.h (rs6000_save_toc_p): Delete declaration.
-
-Wed Oct 9 18:06:54 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.h (EMPTY_FIELD_BOUNDARY): Define as 32.
- * mips/abi64.h (EMPTY_FIELD_BOUNDARY): Don't define.
-
- * mips/abi64.h (TARGET_DEFAULT, TARGET_LONG64, CPP_PREDEFINES,
- CPP_SPEC): Move from here...
- * mips/iris6.h: ...to here.
-
-Wed Oct 9 16:43:51 1996 Jim Wilson <wilson@cygnus.com>
-
- * configure (i[3456]86-dg-dgux): Use install-headers-cpio.
-
- * expr.c (store_constructor): Delete unnecessary increment.
-
-Wed Oct 9 16:29:22 1996 Gavin Koch <gavin@cetus.cygnus.com>
-
- * cccp.c (do_include): Treat ENOTDIR like ENOENT when an open fails.
-
-Wed Oct 9 16:26:57 1996 Paul Eggert <eggert@twinsun.com>
-
- * gcc.c (default_compilers): -ansi no longer implies -$ to cpp.
- * c-lex.c (yylex): Treat `$' just like `_', except issue a
- diagnostic if !dollars_in_ident or if pedantic.
- * c-decl.c (dollars_in_ident): DOLLARS_IN_IDENTIFIERS is now Boolean.
- (c_decode_option): -fdollars-in-identifiers is now independent
- of -ansi, of -traditional, and of DOLLARS_IN_IDENTIFIERS.
- * cexp.y (initialize_random_junk): Ignore DOLLARS_IN_IDENTIFIERS.
- * cccp.c (dollars_in_ident): Remove; replaced by is_idchar['$'].
- (main): Initialize is_idchar and is_idstart directly when given -$.
- Ignore DOLLARS_IN_IDENTIFIERS.
- (rescan): Diagnose $ in identifier if pedantic.
- (initialize_char_syntax): Assume $ is allowed in identifier;
- `main' will change this if -$ is given.
- * cpplib.h (DOLLARS_IN_IDENTIFIERS): Remove.
- * cpplib.c (cpp_options_init): Ignore DOLLARS_IN_IDENTIFIERS.
- (parse_name): Diagnose $ in identifier if pedantic.
- (cpp_handle_options): -traditional no longer messes with
- dollars_in_ident.
- * i386/dgux.h, m68k/apollo68.h (DOLLARS_IN_IDENTIFIERS): Remove.
- * m88k.h, mips.h, nextstep.h, pa.h (DOLLARS_IN_IDENTIFIERS): Remove.
- * vax/ultrix.h, vax/vms.h (DOLLARS_IN_IDENTIFIERS): Remove.
- * convex.h (OVERRIDE_OPTIONS): Don't need to set
- dollars_in_ident any more, since -ansi doesn't change it.
-
-Wed Oct 9 07:35:47 1996 Doug Evans <dje@cygnus.com>
-
- * Allow prefix attributes in more places.
- * c-parse.in: Update number of shift/reduce conflicts.
- ({typed_declspecs,reserved_declspecs,declmods}_no_prefix_attr): New.
- (current_declspecs): Initialize to NULL_TREE.
- (fndef): Pass current_declspecs, not $1, to start_function.
- (old_style_parm_decls): Renamed from xdecls.
- (datadecl, declmods): Add references to new rules.
- (setspecs): Call split_specs_attrs.
- (absdcl1): Remove case with setattrs.
- * c-common.c (split_specs_attrs): New function.
-
-Wed Oct 9 05:48:43 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sdbout.c: Include defaults.h.
- * Makefile.in (sdbout.o): Make dependency list match included files.
-
- * fold-const.c (range_test): Function deleted.
- (range_binop, make_range, build_range_check): New functions.
- (merge_ranges, fold_range_test): Likewise.
- (fold_truthop): No longer call range_test.
- (fold, case TRUTH_{AND,OR}{,IF}_EXPR): Call fold_range_test.
-
-Tue Oct 8 22:03:32 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * configure: Set cpu_type for pyramid.
-
-Tue Oct 8 21:54:04 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * final.c (final_start_function): Call dwarfout_begin_prologue.
-
- * dwarf2out.c (pubname_*, arange_*): New data for .debug_pubnames
- and .debug_aranges sections.
- (add_pubname): New fn.
- (size_of_pubnames): Reimplement.
- (output_pubnames): Likewise.
- (add_arange): New fn.
- (size_of_aranges): Include function sections.
- (output_aranges): Likewise.
- (gen_variable_die): Call add_pubname.
- (add_name_and_src_coords_attributes): Use DECL_ASSEMBLER_NAME for now.
- (decl_start_label): Renamed from function_start_label.
- (gen_subprogram_die): If weak or one_only, use a local label for
- AT_low_pc. Call add_pubname and add_arange.
- (dwarfout_begin_prologue): New fn. Start up FDE here.
- (dwarfout_begin_function): Not here.
- (get_AT): Split out. Look in specification and abstract_origin DIEs.
- (get_AT_low_pc, get_AT_string, get_AT_flag, get_AT_unsigned,
- get_AT_hi_pc): Use it.
- (dwarfout_finish): Variables can produce pubnames, too.
-
-Tue Oct 8 19:35:40 1996 Torbjorn Granlund <tege@nada.kth.se>
-
- * m88k/dgux.h (CPP_SPEC): Avoid newline in the string.
-
- * final.c (final): Update insn_current_address before calling
- final_scan_insn.
-
-Tue Oct 8 17:52:02 1996 Jim Wilson <wilson@cygnus.com>
-
- * unroll.c (unroll_loops): Set local_regno only if set_dominates_use
- returns true.
- (set_dominates_use): New function.
-
-Tue Oct 8 16:01:37 1996 Doug Evans <dje@cygnus.com>
-
- * c-typeck.c (decl_constant_value): Delete test for ! TREE_PUBLIC.
-
-Tue Oct 8 10:36:44 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (hppa_legitimize_address): Remove test code accidentally left
- in during last change.
-
-Mon Oct 7 19:55:02 1996 Jim Wilson <wilson@cygnus.com>
-
- * sched.c (schedule_block): Before scheduling, add code to make all
- call used regs not fixed or global live when we see a CALL_INSN.
- During scheduling, change existing code to use same test.
-
- * varasm.c (bss_section): Delete unused parameters.
-
-Mon Oct 7 16:24:21 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2.h: Add new SGI/MIPS attributes.
-
- * dwarf2out.c (*_separate_line_info_*): Parallel line number
- information for functions defined in sections other than .text.
- (size_of_line_info): Support it.
- (output_line_info, dwarfout_line): Likewise.
- (gen_compile_unit_die): Don't add high/low_pc or stmt_list
- attributes here.
- (dwarfout_finish): Add them here if appropriate.
- (remove_AT): Free removed attribute properly.
- (gen_type_die): Don't assume a nested type is complete.
- (dwarfout_finish): Don't emit line info if it would be empty.
-
- * dwarfout.c (output_block): Don't emit a DIE for a body block.
- (output_decls_for_scope): Don't increment next_block_number for the
- outer block.
- (output_decl): Start from the outer block, not
- the first inner block since there can be more than one in C++.
- (type_tag): Handle C++ TYPE_NAME.
- (output_type): Fix handling of TYPE_METHODS.
- (output_decl): Don't output a DIE for artificial typedefs.
-
-Mon Oct 7 15:47:29 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (movdi define_splits): Fix previous change to work
- on both little and big endian hosts.
-
-Sun Oct 6 16:52:34 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (combinable_fsub): Don't return without a value.
-
-Sun Oct 6 14:05:39 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (mov{df,di} define_splits): Use split_double to
- properly split CONST_DOUBLEs.
- (movdi): Likewise.
-
-Sat Oct 5 08:43:14 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * i386/cygwin32.h (LIB_SPEC): Add support for -mwindows.
- Always pass -lkernel32.
- (LIBGCC_SPEC): Don't delete.
- (STARTFILE_SPEC): Remove always-true conditionalization.
- (LONG_DOUBLE_TYPE_SIZE): Use default.
-
-Fri Oct 4 17:22:53 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_type_compilation): Don't emit DWARF for member
- types of a type we haven't emitted yet.
- (compile_file): Still emit DWARF for pending tagged types.
-
- * final.c (final_scan_insn): Do emit DWARF labels for level 1 blocks.
-
- * dwarf2out.c (gen_subprogram_die): Start from the outer block, not
- the first inner block since there can be more than one in C++.
- (gen_lexical_block_die): Keep track of the block depth.
- (gen_block_die): Don't emit a DIE for a body block.
- (gen_inlined_subroutine_die): Don't emit anything for an
- abstract instance.
- (decls_for_scope): Don't increment next_block_number for the
- outer block.
-
-Fri Oct 4 15:27:55 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h (PRESERVE_DEATH_INFO_REGNO_P): Define.
-
- * sh.c (sfunc_uses_reg): New function.
- (noncall_uses_reg, machine_dependent_reorg, final_prescan_insn):
- Handle special functions like function calls for purposes of relaxing.
- (noncall_uses_reg): Added some missing cases of registers
- being used in non-call instructions.
-
-Fri Oct 4 10:51:40 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c: Tear out backchaining brain damage.
- (remove_AT, remove_children): New functions.
- (modified_type_die): Call gen_type_die instead of backchaining.
- (gen_subprogram_die): Don't generate a new specification DIE for
- member functions defined in the class; use the declaration DIE instead.
- (gen_struct_or_union_type_die): Support DW_AT_declaration.
- (gen_type_die): Don't set TREE_ASM_WRITTEN on incomplete structs.
- (gen_decl_die): Revert previous change; it's much simpler to emit
- the class from rest_of_type_compilation.
-
-Fri Oct 4 09:54:21 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * Make sure we have enough registers for the insns we recognize.
- * i386.h (flag_omit_frame_pointer, outer_function_chain): Declare.
- (current_function_calls_alloca): Likewise
- (rtx_equal_function_value_matters): Likewise
- (N_REGS_USED, N_ALLOCATABLE_REGISTERS): Define.
-
- * i386.md (adddi3_1, subdi3_1): Insns renamed from adddi3 and subdi3;
- added missing earlyclobbers.
- (adddi3_1): Removed duplicates from commutativity.
- (adddi3, subdi3): New define_expands.
- (movsf, movsf_mem, movsf_normal, movdf, movdf_mem , movdf_mem+1): Take
- number of used vs. available registers into account.
- (movxf, movxf_mem, movxf_mem+1, addsidi3_1, addsidi3_2): Likewise.
- (adddi3_1, subsidi3, subdi3_1): Likewise.
- (addsidi3_1, addsidi3_2, subsidi3): Need no generate function.
-
- * i386.c (asm_output_function_prefix): Don't use
- ASM_DECLARE_FUNCTION_NAME if it is not defined.
-
-Fri Oct 4 07:01:55 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (layout_decl): Don't turn off DECL_BIT_FIELD
- if DECL's alignment is less than its type.
-
-Thu Oct 3 19:42:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (rest_of_type_compilation): Also do this for DWARF.
- (compile_file): Don't try to write out DWARF for vars with no RTL.
-
-Thu Oct 3 18:31:28 1996 Doug Evans <dje@cygnus.com>
-
- * ginclude/{stdarg.h,varargs.h}: Use #include "", not #include <>.
-
-Wed Oct 2 17:29:53 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Add a hack to the big sed script to work around a
- bug in the sed implementation on HP/UX 10.20.
-
-Wed Oct 2 16:53:56 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (modified_type_die): Don't generate redundant DIEs.
- (gen_{array,pointer,reference,ptr_to_mbr}_type_die): Likewise.
- (gen_{subroutine,string,set}_type_die): Likewise.
-
- * dwarf2out.c: Undo text_end_label, add_src_coords changes.
- (addr_const_to_string): Fix typos.
- (decl_class_context, get_AT_unsigned): New functions.
- (gen_subprogram_die): Only emit src coords info for a specification
- if they changed.
- (gen_variable_die): Support DW_AT_declaration and DW_AT_specification.
- (gen_decl_die): Avoid generating redundant DIEs for member functions
- and variables.
-
-Wed Oct 2 11:22:50 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (EXTRA_CONSTRAINT): Loosen conditions for match of
- 'Q' and 'T' while reload is running.
- * pa.c (hppa_legitimize_address): Rework to generate more
- indexed and scaled indexed addressing.
- * pa.md (scaled indexed store): Add define_splits to undo
- pessimizations created by hppa_legitimize_address for integer stores.
-
- * pa.c (remove_useless_addtr_insns): New function.
- (pa_reorg): Delete code to remove useless add,tr insns.
- Instead call remove_useless_addtr_insns.
- (output_function_prologue): Call remove_useless_addtr_insns
- to catch any add,tr insns created by reorg.
-
- * pa.c (secondary_reload_class): Remove duplicate/useless code.
-
- * pa.h (PARSE_LDD_OUTPUT): Handle output from hpux10.20 "chatr".
-
-Tue Oct 1 17:23:32 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dwarf2out.c (text_end_label): New static.
- (size_of_line_info): The final entry is smaller.
- (output_aranges): Use TEXT_SECTION instead of TEXT_BEGIN_LABEL and
- text_end_label instead of TEXT_END_LABEL.
- (gen_compile_unit_die): Likewise.
- (output_line_info): Likewise. Use a fixed advance for the last entry.
- (dwarfout_init): Don't output starting labels.
- (dwarfout_finish): Set up text_end_label. Don't output ending labels.
-
- (add_pure_or_virtual_attribute): Don't say pure virtual for now.
- (type_tag): Handle C++ TYPE_NAME.
- (gen_formal_parameter_die): Support DW_AT_artificial.
- (gen_formal_types_die): Do emit the type for 'this'.
- (gen_member_die): Fix handling of TYPE_METHODS.
- (gen_decl_die): Do output a DIE for member function declarations.
- Don't output a DIE for artificial typedefs.
-
- (add_member_attribute): Remove, not in DWARF-II.
- (gen_array_type_die): Remove ref to add_member_attribute.
- (gen_set_type_die, gen_entry_point_die, gen_enumeration_type_die,
- gen_subprogram_die, gen_variable_die, gen_field_die,
- gen_pointer_type_die, gen_reference_type_die, gen_ptr_to_mbr_type_die,
- gen_string_type_die, gen_struct_or_union_type_die,
- gen_subroutine_type_die, gen_typedef_die): Likewise.
-
- (get_AT_flag): New fn.
- (add_src_coords_attributes): Split out...
- (add_name_and_src_coords_attributes): From here.
- (gen_subprogram_die): Support DW_AT_declaration and
- DW_AT_specification.
-
- (gen_compile_unit_die): Don't emit full pathname for source file;
- comment claimed that SGI required it, but they don't emit it either.
- Append -g to producer rather than replacing it.
-
-Tue Oct 1 14:19:23 1996 Jim Wilson <wilson@cygnus.com>
-
- * gcc.c (used_arg): When call xmalloc for mswitches, pass 1 if
- n_switches is zero.
-
-Mon Sep 30 17:46:26 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (gen_shl_and, gen_shl_sext): Use gen_lowpart to
- generate rtx in the appropriate mode for zero/sign-extension.
- Don't generate a zero bit shift.
- (gen_shl_sext) Directly use gen_ashift instead of gen_ashrsi3.
-
-Mon Sep 30 17:17:56 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fixinc.svr4: In math.h, redefine exception to __math_exception
- for C++, to avoid conflict with <exception>.
- * fixincludes: Likewise.
- Fix check for class in math.h to not match fp_class.
-
-Mon Sep 30 17:15:19 1996 Jim Wilson <wilson@cygnus.com>
-
- * iris6.h (ASM_SPEC): Add -w.
- (STARTFILE_SPEC): Add mips3 to n32 pathnames.
- Add -L/usr/lib32/mips for n32 cases.
- (ENDFILE_SPEC): Add mips3 to n32 pathnames.
-
-Mon Sep 30 13:20:31 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * genopinit.c (gen_insn): Look through the modes in reverse order,
- to avoid stopping early on CC when EXTRA_CC_MODES is used.
-
- * fixincludes: Add extern "C" to <sys/mman.h> on HP/UX.
-
-Sun Sep 29 12:39:18 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * c-typeck.c (pointer_diff): Do not do default conversions when
- doing the minus expression, in case restype is a short type.
-
-Sun Sep 29 11:22:10 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (build_complex): Add new argument, TYPE.
- * tree.h (build_complex): Likewise.
- * c-lex.c (yylex): Add new arg, TYPE, to call to build_complex.
- * fold-const.c (const_binop): Likewise.
- (fold, case CONJ_EXPR, COMPLEX_EXPR): Likewise.
- * varasm.c (copy_constant, case COMPLEX_CST): Likewise.
- * expr.c (expand_expr, case COMPONENT_REF): Don't try to directly
- load a complex.
- * recog.c (register_operand): Don't reject subreg of complex mode.
- * emit-rtl.c (mark_user_reg): New function.
- * function.c (assign_parms): Use it.
- * stmt.c (expand_decl): Likewise, and simplify code.
-
- * tree.c (contains_placeholder): Return 1 for PLACEHOLDER_EXPR.
-
- * expr.c (store_expr): memset/bzero gets ptr_mode, not Pmode.
-
- * stmt.c (expand_asm_operands): Fix errors in previous patches.
-
- * x-linux: Simplify, but ensure headers aren't changed.
-
- * getpwd.c: No longer include direct.h for _WIN32.
-
- * configure (i[3456]86-*-isc*): Remove bogus echo.
- (m68k-apple-aux*): a-ux.h renamed from aux.h.
- (CC): Escape "$" char in "no-symlink" case for bash/cygwin32 bug.
-
- * Makefile.in (installdirs): Renamed from install-dir.
- Create $(prefix) and $(exec_prefix) if doesn't exist.
- (install-float): Reflect new name for installdirs.
- (install-{common,info,man,libgcc,multilib,libobjc}): Likewise.
- (install-{include-dir,assert-h,collect2}): Likewise.
-
- * reload1.c (gen_reload): Handle SUBREG in PLUS specially too.
- Change calls to emit_move_insn to recursive calls.
-
- * stmt.c (fixup_gotos): When running undefined labels, if no cleanup
- actions for this block, don't clear BEFORE_JUMP.
-
-Fri Sep 27 13:48:21 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * c-decl.c (init_decl_processing): Create short int types before
- creating size_t in case a machine description needs to use
- unsigned short for size_t.
-
-Fri Sep 27 12:28:54 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * gcc.c (do_spec_1): Allow -A in %[Spec].
-
- * i386.h (CPP_CPU_SPEC): New. Added for defining the submodel.
-
- * i386.c (asm_output_function_prefix, function_prologue,
- ix86_expand_prologue): Make the routine that sets the GOT (when pic
- is enabled) a function, to assist debugging.
-
- * i386.md (gen_prologue_get_pc): Call the function created above.
- (divdf3): Added.
-
- * i386/dgux.h (CPP_PREDEFINES, CPP_SPEC): Reference CPP_CPU_SPEC.
- Use svr4 assembler directive .backalign instead of .align.
- (align to x bytes if it takes no more than y bytes to do so.)
-
- * i386/{aix386ng.h,dgux.h} (CPP_SPEC): Use %[cpp_cpu].
- * i386/{freebsd-elf,gas,isc,linux-aout}.h: Likewise.
- * i386/{linux-oldld,linux,osfelf,osfrose,sco,sco4}.h: Likewise.
- * i386/{sco4dbx,sco5,sol2,sysv3}.h: Likewise.
-
-Thu Sep 26 17:58:34 1996 Torbjorn Granlund <tege@matematik.su.se>
-
- * m68k.md (mulsidi3 matcher): Change predicate const_int_operand
- to const_sint32_operand. Get rid of bogus range condition.
-
-Thu Sep 26 17:12:00 1996 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (stmp-int-hdrs): Don't cd to srcdir before copying
- header files to objdir.
-
-Wed Sep 25 21:22:57 1996 Jeffrey A Law (law@cygnus.com)
-
- * h8300.h (FIRST_PSEUDO_REGISTER, ARG_POINTER_REGNUM): Bump up by one.
- (FIXED_REGISTERS): Add entry for MAC register.
- (CALL_USED_REGISTERS, REG_ALLOC_ORDER): Likewise.
- (HARD_REGNO_NREGS): Handle MAC register.
- (HARD_REGNO_MODE_OK, REGNO_OK_FOR_BASE_P, REGISTER_NAMES): Likewise.
- (enum reg_class): New MAC_REGS register class.
- (REG_CLASS_CONTENTS, REGNO_REG_CLASS): Corresponding changes.
- (REG_CLASS_FROM_LETTER): Likewise.
- (REGISTER_MOVE_COST): Make copies to/from MAC register expenseive.
- (CONDITIONAL_REGISTER_USAGE): Define.
- * h8300.md (movsi_h8300hs): Renamed from movsi_h8300h.
- Handle moves to/from the MAC register.
- (mac): Two new patterns to use the mac instruction.
-
- * h8300.c (notice_update_cc): Fix CC_SET case.
- (restore_compare_p): Remove unused function.
- * h8300.md: Handle "set" vs "set_zn_c0" correctly.
- (bCC patterns): No longer need to call restore_compare_p.
-
- * h8300.c (get_shift_alg): Fix HImode ASHIFTRT by 13 or 14 bits.
-
-Wed Sep 25 18:52:19 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md (insv): New pattern.
-
-Wed Sep 25 16:47:26 1996 Doug Evans <dje@seba.cygnus.com>
-
- * sparc/t-sunos41 (MULTILIB_{OPTIONS,DIRNAMES,MATCHES}): Create
- multilib versions of -fpic and -fPIC.
- (TARGET_LIBGCC2_CFLAGS): Comment out.
-
- * sparc.c (print_operand): Handle new codes H/L.
- * sparc.md (lo_sum_di_sp32): Add little endian support.
- (adddi3_sp32,subdi3_sp32,mulsidi3_sp32,const_mulsidi3): Likewise.
- (umulsidi3_sp32,const_umulsidi3,smacdi,umacdi,anddi3_sp32): Likewise.
- (iordi3_sp32,xordi3_sp32,negdi2_sp32): Likewise.
-
-Wed Sep 25 15:32:35 1996 Jim Wilson <wilson@cygnus.com>
-
- * expmed.c (store_bit_field): Don't make flag_force_mem disable insv
- for memory operands.
-
- * function.c (instantiate_decl): Always store addr back into x.
-
-Tue Sep 24 19:37:00 1996 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (push_secondary_reload): Do strip paradoxical SUBREG
- even if reload_class is CLASS_CANNOT_CHANGE_SIZE. Change reload_mode
- to mode in SECONDARY_MEMORY_NEEDED and get_secondary_mem calls.
-
- * reload1.c (emit_reload_insns): For output part of RELOAD_OTHER,
- emit after RELOAD_FOR_OUTPUT, in reverse order of reload number,
- but not separately.
-
-Tue Sep 24 18:13:07 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * expr.c (emit_group_load): Allow target to be smaller than source.
-
-Tue Sep 24 17:40:39 1996 Doug Evans <dje@cygnus.com>
-
- * m68k/a-ux.h: Renamed from aux.h because of MSDOS.
-
-Tue Sep 24 08:33:53 1996 David S. Miller (davem@caip.rutgers.edu)
-
- * tree.c (copy_node): Fix error in last change.
-
-Tue Sep 24 08:29:03 1996 James G. Smith <jsmith@cygnus.co.uk>
-
- * gcc.c (used_arg): Fix multilib_matches parsing to not corrupt
- entry parameter.
-
-Tue Sep 24 08:22:18 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * loop.c (get_condition): Use rtx_equal_p to compare rtx.
-
-Tue Sep 24 08:14:01 1996 Christian Iseli <Christian.Iseli@lslsun.epfl.ch>
-
- * integrate.c (expand_inline_function): Avoid creating paradoxical
- subreg wider than BITS_PER_WORD as inlined function result.
-
-Tue Sep 24 08:00:15 1996 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (struct directive, directive_table, handle_directive):
- pass_thru now 1 for #define and 2 for #pragma.
- (handle_directive): When deciding whether to suppress comment at end
- of directive, ignore tabs and spaces after comment. Remove redundant
- limit test. With -dD -C, copy comment when isolating definition.
- (skip_to_end_of_comment): With -C, don't copy newline at end
- of C++ comment.
-
- * fixinc.ptx, fixinc.svr4, fixincludes: Insert newlines just before
- end of 'sed' command strings if last 'sed' command is 'a' or 'i'.
-
-Tue Sep 24 07:28:58 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * toplev.c (PREFERRED_DEBUGGING_TYPE): If no debugging formats are
- supported, set to NO_DEBUG.
- (main): Don't do setting of PREFERRED_DEBUGGING_TYPE here.
-
-Mon Sep 23 22:45:15 1996 Sean McNeil <sean@mcneil.com>
-
- * rs6000/vxppc.h, sparc/vxsim.h: New files.
- * configure (powerpc-*-vxworks*, sparc-*-vxsim*): New targets.
- * objc/objc.h (BOOL): Define BOOL as int for VxWorks.
-
-Mon Sep 23 21:23:27 1996 Klaus K"ampf (kkaempf@progis.de)
-
- * explow.c (promote_mode, case REFERENCE_TYPE): New case.
-
-Mon Sep 23 21:15:43 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-decl.c (finish_struct): Check PCC_BITFIELD_TYPE_MATTERS value.
-
- * dbxout.c (dbxout_symbol): Fix forgotten case in last change:
- check DECL_ARTIFICIAL also when using the short cut way.
-
-Mon Sep 23 15:55:24 1996 David S. Miller (davem@caip.rutgers.edu)
-
- * tree.c (copy_node): Abort if don't know size of node.
-
- * tree.c (build1): Clean up initialization of OBSTACK.
-
-Mon Sep 23 15:35:33 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * Makefile.in (stmp-multilib): Depend on $(LANG_LIB2FUNCS).
-
- * dbxout.c (dbxout_function): Don't check DECL_SECTION_NAME before
- calling dbxout_function_end.
-
-Mon Sep 23 14:41:12 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * combine.c (can_combine_p): Even if SMALL_REGISTER_CLASSES,
- know lifetime not extended if all_adjacent set.
-
- * stmt.c (expand_asm_operands): Handle '+' constraint.
- * cse.c (fold_rtx): Fold inside ASM_OPERANDS.
-
- * expr.c (expand_increment): If postincrement for MEM can't use add
- directly, load address in reg and enqueue increment and store of reg.
-
- * loop.c (check_dbra_loop): Don't assume label must be second part of
- if_then_else in condjump.
-
- * jump.c (jump_optimize): In no-nop move deletion, don't test
- PRESERVE_DEATH_INFO_REGNO_P; instead test if optimization is performed.
- Check for REG_UNUSED note on to-be deleted insn before searching for
- preceding instruction to delete note from.
- If PRESERVE_DEATH_INFO_REGNO_P is true for SREG, replace INSN with USE.
-
- * reload1.c (reload): Initialize the previous_offset fields
- in reg_eliminate before calling setup_save_areas.
-
- * reload1.c (emit_reload_insns): Declare and set this_reload_insn.
-
- * expr.c (var_rtx): New function.
- (expand_expr, case COND_EXPR): Also use target if same as singleton.
-
-Mon Sep 23 14:22:34 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * recog.c (constrain_operands): Don't test clobbered constraints.
-
- * reload1.c (emit_reload_insns): For output part of RELOAD_OTHER,
- put in front of anything previous for that output, but not separately.
-
-Sun Sep 22 21:06:46 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-common.c (decl_attribtes, case A_SECTION): Allow for static
- local variable.
-
-Sun Sep 22 11:30:27 1996 Christian Iseli (christian.iseli@di.epfl.ch)
-
- * expr.c (convert_move): Replace explicit checks for FP extend ops
- with use of can_extend_p.
- Add missing tests for FP trunc operations.
-
-Sun Sep 22 11:20:02 1996 Pat Rankin <rankin@eql.caltech.edu>
-
- * dwarfout.c (DWARF_VERSION): Define as 1 if not already defined.
- * dwarf2out.c (DWARF_VERSION): Likewise.
-
-Sun Sep 22 11:12:20 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * c-decl.c (pushdecl): Check new declaration actually conflicts before
- warning about implicit external vs. static declarations.
-
- * loop.c (combine_givs): Improve combining DEST_REG giv with only use.
-
-Sun Sep 22 10:50:03 1996 Scott Christley <scottc@net-community.com>
-
- * Create consistent mechanism for memory allocation and release
- so that garbage collection routines can be easily subsititued
- for the ANSI standard malloc, realloc, free, etc.
- * objc/archive.c: Replace use of __objc_xmalloc and free
- with objc_malloc and objc_free.
- * objc/hash.c: Replace use of __objc_xcalloc and free
- with objc_calloc and objc_free.
- * objc/init.c: Replace use of free with objc_free.
- * objc/misc.c (objc_malloc): Renamed from __objc_xmalloc.
- (objc_realloc): Renamed from __objc_realloc.
- (objc_atomic_malloc, objc_valloc): New functions.
- (objc_calloc): Renamed from __objc_calloc.
- (objc_free): New function.
- * objc/objc-api.h (_objc_malloc): New function pointer.
- (_objc_atomic_malloc, _objc_valloc): Likewise.
- (_objc_realloc, _objc_calloc, _objc_free): Likewise
- * objc/objc-list.h: Replace use of __obj_xmalloc and free
- with objc_malloc and objc_free.
- * objc/objects.c: Likewise.
- * objc/sarray.c: Replace use of __objc_xmalloc and free
- with objc_malloc and objc_free.
- * objc/sarray.h (__objc_xmalloc, __objc_xrealloc): Delete.
- * objc/selector.c: Replace use of __objc_xcalloc, __objc_xrealloc,
- and __objc_xmalloc with objc_calloc, objc_realloc, and objc_malloc.
- * objc/thr-decosf1.c: Replace use of __objc_xmalloc and free
- with objc_malloc and objc_free.
- * objc/thr-irix.c, objc/thr-mach.c, objc/thr-os2.c: Likewise.
- * objc/thr-posix.c, objc/thr-pthreads, objc/thr-single: Likewise.
- * objc/thr-solaris.c, objc/thr-win32.c, objc/thr.c: Likewise.
-
-Sun Sep 22 05:26:01 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure: Set up LANG_LIB2FUNCS and LANG_EXTRA_HEADERS.
- * Makefile.in (libgcc2.a): Include LANG_LIB2FUNCS.
- (USER_H): Add LANG_EXTRA_HEADERS.
- (LANG_LIB2FUNCS): New macro.
- (LANG_EXTRA_HEADERS): New macro.
- (stmp-int-hdrs): Don't hardwire ginclude.
- (stamp-objlist): Don't depend on Makefile.
-
-Sat Sep 21 18:00:10 1996 Stephen L Moshier (moshier@world.std.com)
-
- * alpha.md (alpha_swapped_comparison_operator pattern): Fix asm
- operand typo in last change.
-
-Sat Sep 21 07:11:51 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * defaults.h (ASM_OUTPUT_LABELREF): Provide default definition
- if not already defined.
- * 1750a.h (USER_LABEL_PREFIX): Define instead of ASM_OUTPUT_LABELREF.
- * a29k.h, alpha.h, convex.h, dsp16xx.h, elxsi.h, fx80.h: Likewise.
- * gmicro.h, h8300.h, i386/sun386.h, i860.h, i960.h, ns32k.h: Likewise.
- * pdp11.h, pyr.h, romp.h, sh.h, sparc.h, spur.h, tahoe.h: Likewise.
- * vax.h, we32k.h: Likewise.
- * i386/att.h (USER_LABEL_PREFIX): Redefine, not ASM_OUTPUT_LABELREF.
- * i386/bsd.h, i386/lynx.h, i386/sco5.h, i860/fx2800.h: Likewise.
- * m68k/3b1.h, m68k/mot3300.h, m68k/tower-as.h, m68k/tower.h: Likewise.
- * ptx4.h, sparc/pbd.h, svr3.h, svr4.h: Likewise.
- * i386/osfrose.h, m88k.h (USER_LABEL_PREFIX): Redefine.
- * nextstep.h (USER_LABEL_PREFIX): Redefine.
- (ASM_OUTPUT_LABELREF) Use USER_LABEL_PREFIX.
- * arm/aout.h, mips.h (ASM_OUTPUT_LABELREF): Delete.
- * rs6000/lynx.h (USER_LABEL_PREFIX): Undefine.
- * rs6000.h, rs6000/win-nt.h (USER_LABEL_PREFIX): Define.
-
-Thu Sep 19 00:05:53 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * configure: Move i[3456]86-*-gnu* case after linux and don't
- treat linux-gnu like other gnu systems.
-
-Wed Sep 18 20:51:09 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * cplus-dem.c (demangle_template): Fix handling of address args.
- (gnu_special): Handle type_info stuff.
-
-Wed Sep 18 17:57:55 1996 Patrik Lantto (patrik@opq.se)
-
- * jump.c (jump_optimize): Insert conditional move after jump
- insn instead of before.
-
-Wed Sep 18 17:33:36 1996 Richard Henderson <rth@tamu.edu>
-
- * alpha.h (PREDICATE_CODES): Add alpha_swapped_comparison_operator.
- * alpha.c (alpha_swapped_comparison_operator): New function.
- (print_operand): Support unsigned codes for %D, %c, and %d.
- * alpha.md: Add pattern for b%c with swapped comparisons with 0.
- Delete three unnamed cmp patterns that are strict subsets of it.
-
- * alpha.c (alpha_emit_set_long_const): Save one instruction
- when -O2 and high word == low word.
-
-Tue Sep 17 22:46:15 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386/unix.h (ASM_OUTPUT_MI_THUNK): Handle functions
- returning an aggregate.
-
- * varasm.c (supports_one_only): New function.
- (make_decl_one_only): Likewise.
- * svr4.h (MAKE_DECL_ONE_ONLY): Define.
- * tree.h (DECL_ONE_ONLY): New macro.
-
- * varasm.c (assemble_variable): Fix setting of
- first_global_object_name.
- (assemble_start_function): Likewise.
-
-Tue Sep 17 19:42:39 1996 Doug Evans <dje@wabamun.cygnus.com>
-
- * i386/t-cygwin32 (winnt.o): Compile properly.
-
-Tue Sep 17 15:47:20 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * Add support for R5000, and finish MIPS4 support.
- * mips.h (enum processor_type): Add PROCESSOR_R5000.
- (gen_conditional_move): Declare.
- (CONDITIONAL_REGISTER_USAGE): Mark ST_REGS as fixed if not
- HARD_FLOAT, or if mips_isa < 4.
- (FIRST_PSEUDO_REGISTER): Change to 76.
- (FIXED_REGISTERS): Add condition code registers.
- (CALL_USED_REGISTERS): Likewise.
- (ST_REG_LAST): Change to 74.
- (RAP_REG_NUM): Change to 75.
- (ST_REG_P): Look for any condition code register.
- (REG_CLASS_CONTENTS): Update for new condition code registers.
- (RTX_COSTS): Add cases for R5000.
- (REGISTER_MOVE_COST): Add cases for condition code registers.
- (PREDICATE_CODES): Add "const_float_1_operand".
- (EXTRA_CC_{MODES,NAME}, SELECT_CC_MODE): Remove.
- (REGISTER_NAMES): Add entries for new condition code registers.
- (DEBUG_REGISTER_NAMES): Likewise.
- (ADDITIONAL_REGISTER_NAMES): Remove FPSW_REGNUM.
- * mips.md (cpu attribute): Add R5000.
- (function units): Add cases for the R5000.
- ({madd,msub,nmadd,nmsub}.d): Only available if TARGET_DOUBLE_FLOAT.
- (recip.d, recip.s, rsqrt.d, rsqrt.s): New define_insn patterns.
- (movcc): New pattern to move condition code values.
- (reload_incc, reload_out_cc): New define_expand patterns.
- (lwxc1, ldxc1, swxc1, sdxc1): Several new define_insn patterns.
- (various): Replace CC_FP with CC.
- (branch_fp_ne, branch_fp_eq): Match any condition code register.
- (branch_fp_ne_rev, branch_fp_eq_rev): Remove.
- (seq_df, slt_df, sle_df): Match any condition code register.
- (sgt_df, sge_df, seq_sf, slt_sf, sle_sf, sgt_sf, sge_sf): Likewise.
- (sne_df, sne_sf): Remove.
- (FP conditional moves): Match any condition code register.
- Require TARGET_HARD_FLOAT and, if appropriate, TARGET_DOUBLE_FLOAT.
- (movsicc): Just call gen_conditional_move.
- (movdicc, movsfcc, movdfcc): New define_expand patterns.
- * mips.c (mips_reg_names): Add condition code registers.
- (mips_sw_reg_names, mips_regno_to_class): Likewise.
- (const_float_1_operand): New function.
- (mips_move_1word): Treat CCmode as SImode. Handle move from
- ST_REG to GR_REG if mips_isa >= 4. Only permit move from GR_REG
- to ST_REG is mips_isa < 4.
- (gen_conditional_branch): Rewrite. Just use CCmode, not extra
- condition modes.
- (gen_conditional_move): New function.
- (override_options): Recognize vr5000. Look for just CCmode, not
- extra condition modes. If mips_isa >= 4, permit CCmode in GR_REGS
- and FP_REGS.
- (print_operand): Handle %Z.
- (mips_secondary_reload_class): Require a data register to copy a
- value out of a condition code register. Require a floating point
- register to copy a value into a condition code register.
-
-Tue Sep 17 15:10:29 1996 Joern Rennecke <amylaar@cygnus.co.uk>
-
- * sh.md: New define_splits to recombine output from LEGITIMIZE_ADDRESS.
- * sh.h (LEGITIMIZE_ADDRESS): Typo fixes (x -> X).
-
-Mon Sep 16 23:00:35 1996 Jim Wilson <wilson@cygnus.com>
-
- * configure (build_broken_install): Renamed from host_broken_install.
- Set from build not host.
- (build_install_headers): Renamed from host_install_headers. Set from
- build not host.
-
-Mon Sep 16 22:38:55 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * configure (m68k-*-coff*): Use dbx debug format by default.
- * gcc.c (link_command_spec): Move -T to end of link command line.
- * m68k/m68kemb.h (LINK_SPEC, SUBTARTGET_SWITCHES): Delete.
- (LIB_SPEC): Define to just -lc.
- (STARTFILE_SPEC): Define to empty.
-
-Mon Sep 16 13:12:27 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.c (ext_shift_insns, ext_shift_amounts): New arrays.
- (gen_ashift_hi, gen_shifty_hi_op, shl_and_kind): New functions.
- (rtx_equal_function_value_matters): Declare.
- (shl_and_length, shl_and_src_length, gen_shl_and): New functions.
- (shl_sext_kind, shl_sext_length, gen_shl_sext): Likewise.
- * sh.md (ashlhi3_k, lshrhi3_m): New patterns.
- (lshrhi3, shl_sext_ext, shl_sext_sub):
- New insn patterns with matching define_split.
- (and_shl_scratch): Likewise, but also with unnamed variants.
-
-Sat Sep 14 17:05:07 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * gcc.c (convert_filename): Don't start looking for '.' until
- after last directory separator.
-
- * i386.md (clrstrsi): Correct check for constant size.
-
- * Based on code by sac@cygnus.com.
- * i386/cygwin32.h (CHECK_STACK_LIMIT): Make consistent with MD file.
- * i386.c ({function,ix86_expand}_prologue): Use __alloca to allocate
- stack if desired and beyond CHECK_STACK_LIMIT in size.
- * i386.h ({MASK,TARGET}_STACK_PROBE): New macros.
- (TARGET_SWITCHES): Add -mstack-arg-probe.
- * i386.md (allocate_stack{,_worker}): New patterns.
-
-Fri Sep 13 18:23:18 1996 Joel Sherrill <joel@OARcorp.com>
-
- * sparc/lb1spc.asm (.div, .rem): Fixed typo so sign is returned
- correctly. TOPBITS was 2 and should have been 4.
-
-Thu Sep 12 21:51:56 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (call_value_multiple_internal0): Change from define_insn to
- define_expand.
-
-Thu Sep 12 19:22:14 1996 Doug Evans <dje@seba.cygnus.com>
-
- * sparc.md (move_pic_label_si): Operand one is label_ref now.
- * sparc.c (emit_move_sequence): Pass label_ref to
- gen_move_pic_label_si to not lose flags.
-
-Wed Sep 11 12:10:08 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * Makefile.in (GCC_PASSES): Add $(exeext) to names.
- (FLAGS_TO_PASS): Add CLIB.
- (c-pragma.o): Add dependencies on except.h, function.h, defaults.h.
-
-Tue Sep 10 22:25:03 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure (i[3456]86-*-cygwin32): Use xm-cygwin32.h and xm-i386.h.
- Set fixincludes to Makefile.in and objc_thread_file to win32.
- * i386/xm-cywin32.h: Don't include xm-i386.h.
- * i386/x-cygwin32, rs6000/x-cygwin32 (STMP_FIXPROTO, exeext): New defs.
-
- * gcc.c (HAVE_EXECUTABLE_SUFFIX): New macro.
- (convert_filename): New function.
- (process_command, case 'o'): Call it.
- (process_command, default case): Likewise; delete old code.
-
-Tue Sep 10 21:08:43 1996 Torbjorn Granlund <tege@albert.gnu.ai.mit.edu>
-
- * i386.md (decrement_and_branch_until_zero matcher): Fix typo.
-
-Tue Sep 10 19:04:19 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (mips_move_2words): Rewrite 32 bit shifts as 16 bit shifts.
-
-Tue Sep 10 10:39:07 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa/pa-gas.h (DBX_DEBUGGING_INFO): Remove all #define
- and #undef statements related to debugging information.
- * pa/pa-hpux.h, pa-hpux7.h: Likewise
- * pa.c (override_options): Disable "-g" and issue a warning
- if it's used when !TARGET_GAS.
-
-Mon Sep 9 17:57:49 1996 Doug Evans <dje@wabamun.cygnus.com>
-
- * sparc.h ({MASK,TARGET}_FPU_SET): Define.
- (TARGET_SWITCHES): Record if -m{,no-}fpu passed.
- * sparc.c (sparc_override_options): Don't clobber explicit
- -m{,no-}fpu setting with cpu default.
-
-Mon Sep 9 15:57:57 1996 Joel Sherrill <joel@OARcorp.com>
-
- * configure (mips64orion-*-rtems*): New target.
- * mips/rtems64.h: New file.
-
-Sat Sep 7 22:07:53 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_field): If storing a record on big endian targets,
- set up so we store the high-order bits.
- (expand_expr, case COMPONENT_REF): Likewise for loads.
-
-Thu Sep 5 14:59:47 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * sh.h (LEGITIMIZE_ADDRESS): Define nonempty.
-
-Thu Sep 5 10:43:36 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (mov{si,di,sf}): Handle 'R' constraints as needed.
-
-Wed Sep 4 17:13:28 1996 Bob Manson <manson@charmed.cygnus.com>
-
- * except.c: (add_partial_entry): New routine.
- (expand_start_try_stmts): Moved from cp/except.c.
- (expand_start_all_catch): Move functionality of expand_end_try_stmts
- here.
-
-Wed Sep 4 12:30:02 1996 Mike Stump <mrs@cygnus.com>
-
- * except.c (emit_unwinder): Ensure CLOBBER and USE insns come last,
- if present.
-
-Tue Sep 3 12:01:43 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure (sh-*-elf*): New target.
- * sh/elf.h: New file.
-
-Fri Aug 30 17:52:26 1996 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (gen_formal_types_die): Delete extra argument from
- gen_type_die call.
-
-Fri Aug 30 15:40:40 1996 James G. Smith <jsmith@cygnus.co.uk>
-
- * mips/elf64.h: Allow MULTILIB_DEFAULTS to be defined
- before this file is included.
-
-Fri Aug 30 15:00:06 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md: (movsicc,movhicc): Allow reload from memory.
-
- * i386.c (override_options): Don't thread the prologue if profiling.
-
-Fri Aug 30 15:00:06 1996 James Hawtin <cgjwh@sunrise.co.uk>
-
- * i386/t-sol2 (gcrt1.o): Added for profiling Solaris 2
- * i386/sol2.h (STARTFILE_SPEC): New.
- * i386/gmon-sol2.c, i386/sol2-gc1.asm: New files.
-
-Thu Aug 29 22:08:03 1996 Jim Wilson <wilson@cygnus.com>
-
- * except.c (add_eh_table_entry): Multiply realloc size by sizeof int.
-
-Thu Aug 29 15:15:31 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.md (fcmp patterns): Don't try to eliminate useless add,tr
- insns here.
- * pa.c (pa_reorg): Do elimination of useless add,tr insns here instead.
- (print_operand, case 'y'): Remove this code.
-
-Wed Aug 28 16:19:34 1996 Doug Evans <dje@cygnus.com>
-
- * toplev.c (print_single_switch): Ultrix fprintf returns 0 for success.
-
- * toplev.c (main): Rewrite -g parsing.
-
-Mon Aug 26 16:15:49 1996 Fred Fish <fnf@cygnus.com>
-
- * Makefile.in (objc-parse.y): Fix typo in name of temp file.
-
-Mon Aug 26 14:08:37 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (mark_all_temps_used): Fix error in last change.
-
-Sun Aug 25 22:27:19 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (mark_all_temps_used): New function.
-
-Fri Aug 23 11:34:57 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Fixes to make -fPIC
- really the same as -mrelocatable.
- (ASM_SPEC): Pass -K PIC to the assembler if -fpic/-fPIC.
-
- * rs6000/sol2.h (ASM_CPU_SPEC): Remove passing -K PIC to the
- assembler if -fpic/-fPIC.
-
- * bi-{arity,opcode,opname}.c (fancy_abort): Define, so that
- -Dabort=fancy_abort works again.
-
-Thu Aug 22 11:39:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/t-ppcgas ({stmp,install}-crt): Only build and install the
- eabi ecrt[in].o object files in eabi multilib directories, only
- build and install the solaris scrt[in0].o object files in solaris
- directories.
- (MULTILIB_MATCHES): Remove matches for solaris, linux to other
- switches.
-
-Tue Aug 20 18:49:55 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (ASM_OUTPUT_SECTION_NAME): If -mrelocatable or
- -mrelocatable-lib, don't make read-only sections.
-
-Mon Aug 19 18:42:13 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.h ({MASK,TARGET}_LITTLE_ENDIAN): Define.
- (LIBGCC2_WORDS_BIG_ENDIAN): Add little endian support.
- * sparc/sp64-elf.h ({CPP,ASM,LINK}_SPEC): Add little endian support.
- (SUBTARGET_SWITCHES): Recognize -m{big,little}-endian.
- ({BYTES,WORDS}_BIG_ENDIAN): Likewise.
- * sparc/splet.h (SUBTARGET_SWITCHES): Recognize -m{big,little}-endian.
- ({CPP,ASM,LINK}_SPEC): Add little endian support.
- ({BYTES,WORDS}_BIG_ENDIAN): Likewise.
- * sparc/t-splet (MULTILIB_{OPTIONS,DIRNAMES}): Likewise.
-
- * sparc/lynx-ng.h (CPP_SPEC): Use %(cpp_cpu).
-
-Sat Aug 17 15:23:39 1996 Geoffrey Noer <noer@cygnus.com>
-
- * i386/cygwin32.h (CPP_PREDEFINES): Define _WIN32, not WIN32.
- Define only __CYGWIN32__, not CYGWIN32 or __CYGWIN32.
- * rs6000/cygwin32.h (CPP_PREDEFINES): Likewise.
- * cccp.c (absolute_filename): Drive specifiers make the pathname
- absolute in cygwin32.
- * choose-temp.c: Delete !defined(_WIN32) condition when including
- sys/file.h (NO_SYS_FILE_H is still used).
- * gcc.c: Change ifndef _WIN32 to ifndef NO_SYS_FILE_H when deciding
- whether to include sys/file.h.
- (execute): -pipe is supported for cygwin32.
- * getopt.c: Change win32 test from WIN32 to _WIN32.
- * pexecute.c: Update test for win32 (&& ! cygwin32).
- * protoize.c: Likewise.
- (kill): Delete decl.
- * toplev.c: Update test for win32 (&& ! cygwin32).
- * ginclude/stdarg.h: Change __WIN32__ to _WIN32.
- * ginclude/varargs.h: Likewise.
- * ginclude/va-ppc.h: Likewise.
-
-Fri Aug 16 16:02:09 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (rs6000_got_register): Make sure pic_offset_table_rtx
- allocated, even if current_function_uses_pic_offset_table set.
-
-Fri Aug 16 15:56:04 1996 J. Kean Johnston <hug@netcom.com>
-
- * i386/sco5.h (CLASS_LIKELY_SPILLED_P): Deleted.
- (STARTFILE_SPEC): Insert crtbegin.o in correct place, and correct
- versions of values-X?.o.
- (SWITCH_TAKES_ARG): Extend DEFAULT_SWITCH_TAKES_ARG, not replace.
- (CPP_SPEC): Add -Di386, and correctly include extra directories.
- Define HAVE_ATEXIT in ELF mode for global destructors.
-
-Thu Aug 15 16:42:44 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.c (label_ref_operand): New function.
- (emit_move_sequence): Pass label_ref to gen_move_label_di to not
- lose flags.
- * sparc.md (move_label_di): Operand one is label_ref now.
- * genattrtab.c (write_test_expr): Allow label_ref in match_dup.
-
- * sys-protos.h (gethostid): Make return type `int' ifdef __alpha__.
- * gen-protos.c: Delete support for SYS_PROTO_OVERRIDES.
- * alpha.h (SYS_PROTO_OVERRIDES): Delete.
-
-Thu Aug 15 17:36:09 1996 Mike Stump <mrs@cygnus.com>
-
- * libgcc2.c (__throw): New routine.
- (__eh_pc): New data object for exception handling.
-
- * except.c (eh_saved_pc): New object so we can call
- assemble_external.
- (expand_internal_throw_indirect): Call assemble_external for __eh_pc.
- (end_eh_unwinder): Likewise.
- (init_eh): Initialize eh_saved_pc.
-
-Thu Aug 15 13:02:42 1996 Mike Stump <mrs@cygnus.com>
-
- * arm.h (RETURN_ADDR_RTX): Define.
-
- * expr.c (expand_builtin_return_addr): Fix order of parameters.
-
-Wed Aug 14 19:48:00 1996 Torbjorn Granlund <tege@spiff.gnu.ai.mit.edu>
-
- * stmt.c (expand_return): In code for doing scc with jumps,
- stick to default handling if we have corresponding scc pattern.
-
-Wed Aug 14 10:31:28 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (override_options): Treat TARGET_FAST_INDIRECT_CALLS
- just like TARGET_NO_SPACE_REGS.
- (output_millicode_call): Likewise.
- * pa.h (TARGET_FAST_INDIRECT_CALLS): Define.
- (TARGET_SWITCHES): Add "fast-indirect-calls".
- * pa.md (TARGET_FAST_INDIRECT_CALLS): Treat just like
- TARGET_NO_SPACE_REGS in various call/millicode call patterns.
-
- * pa.c (print_operand): Use the right comparison operator
- for reversed EQ and NE comparisons.
-
- * pa.h (OUTPUT_MI_THUNK): Define.
-
-Wed Aug 14 11:40:49 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * ginclude/va-ppc.h: Add Windows NT support.
- * ginclude/{varargs,stdarg}.h: For PowerPC Windows NT, include
- va-ppc.h, instead of using the default handling.
-
-Tue Aug 13 18:30:10 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Remove duplicate volatile from sig_atomic_t in AIX
- sys/signal.h
-
-Tue Aug 13 16:51:37 1996 Jim Wilson <wilson@cygnus.com>
-
- * i960-coff.h (LIB_SPEC): Undef.
-
- * sh.h (PROFILE_BEFORE_PROLOGUE): Define.
-
-Tue Aug 13 11:36:02 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gcc.c (set_spec,process_command): Dump and load the compiler
- version number in the specs file.
-
- * rs6000.c (output_toc): Fix last change, so that it doesn't use
- an uninitialized variable if -mminimal-toc.
- (output_prolog): Increment probe_labelno after last use.
-
- * rs6000/t-ppcgas (MULTILIB_*): Build far fewer multilib
- libraries. Build all libraries with -mrelocatable-lib and
- -mno-eabi. Build special GNU/Linux and Solaris libraries.
- * rs6000/eabi{,aix,le}.h (MULTILIB_DEFAULTS): Adapt to changes in
- t-ppcgas.
- * rs6000/(linux,sol2,sysv4,sysv4le).h (MULTILIB_DEFAULTS): Likewise.
-
-Tue Aug 13 11:36:02 1996 Jeffrey A Law (law@cygnus.com)
-
- * rs6000.c (handle_mac_pragma): Initialize "psize".
-
-Mon Aug 12 18:14:35 1996 Jim Wilson <wilson@cygnus.com>
-
- * gcc.c (used_arg): Initialize cnt to zero.
-
-Mon Aug 12 14:03:16 1996 Jim Wilson <wilson@cygnus.com>
-
- From Mike Stump:
- * sh.c (regno_reg_class): Change entry 23 from NO_REGS to GENERAL_REGS.
- (initial_elimination_offset): New variable live_regs_mask. Add
- code to handle RETURN_ADDRESS_POINTER_REGNUM.
- * sh.h (RAP_REG, RETURN_ADDRESS_POINTER_REGNUM): Define.
- (ELIMINABLE_REGS): Add RETURN_ADDRESS_POINTER_REGNUM support.
- (RETURN_ADDR_RTX): Define.
- (REGISTER_NAMES): Add rap.
-
- * iris5.h (DOLLARS_IN_IDENTIFIERS): Undefine.
-
- * m68kemb.h (LIB_SPEC): Always emit -lc.
-
-Mon Aug 12 12:30:25 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (rs6000_got_register): Test variable
- current_function_uses_pic_offset_table to see whether or not a GOT
- register has been created already.
-
- * Makefile.in (multilib.h): Move to stamp-mlib.
- (stamp-mlib): Use move-if-change to conditionally update
- multilib.h. Pass MULTILIB_EXTRA_OPTS to genmultilib.
- (STAGESTUFF): Add stamp-mlib.
- (mostlyclean): Delete tmp-mlib.h.
-
- * genmultilib: Take fifth argument for options to all multilib builds.
- Restructure output so we pass synonym switches and extra arguments
- separately, and not exponentially slow down genmultilib.
-
- * gcc.c (toplevel): Rearrange multilib support so we support passing
- synonyms separately from normal switches. Add support for passing
- additional switches for all multilib builds. Dump and restore value
- of MULTILIB_DEFAULTS.
- (setspec, process_command, main): Likewise.
- (used_arg,default_arg,print_multilib_info): Likewise.
-
-Mon Aug 12 07:46:47 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_builtin, case BUILT_IN_SETJMP): Add test
- and call for nonlocal_goto_receiver pattern.
- * stmt.c (expand_end_bindings): Likewise.
-
- * stmt.c (expand_asm_operands): Fix off-by-one error when
- scanning constraints.
-
-Sun Aug 11 22:48:02 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * expr.c (store_expr): Handle COND_EXPR cleanups like expand_expr.
-
-Sun Aug 11 22:42:36 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * optabs.c (expand_abs): When OP0 and TARGET are the same
- pseudo register, it is safe to use TARGET.
-
- * local-alloc.c (reg_equiv_replace): New variable.
- (update_equiv_regs): Set reg_equiv_replacement for all REG_EQUIV
- notes encountered or generated.
-
-Sun Aug 11 22:27:14 1996 Scott Christley <scottc@net-community.com>
-
- * objc/hash.c (hash_is_key_in_hash): Function somehow got lost.
-
-Sun Aug 11 21:43:15 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * ginclude/stddef.h (__need_wint_t): Move #undef to right place.
-
-Sun Aug 11 17:46:22 1996 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * c-decl.c (finish_struct): If pedantic, also warn if struct/union
- has no named members.
-
-Sun Aug 11 17:32:52 1996 Joel Sherrill <joel@OARcorp.com>
-
- * i386/rtems.h: Renamed from i386/i386-rtems.h
- * i960/rtems.h: Renamed from i960/i960-rtems.h
- * m68k/rtems.h: Renamed from m68k/m68k-rtems.h
- * rs6000/rtems.h: Renamed from rs6000/powerpc-rtems.h
- * sparc/rtems.h: Renamed from sparc/sparc-rtems.h
- * config/t-rtems: New file.
- * configure (i386-*-rtems*): Added t-rtems to tmake_file.
- Renamed i386/i386-rtems.h to i386/rtems.h.
- (i960-*-rtems*): Added t-rtems to tmake_file.
- Renamed i960/i960-rtems.h to i960/rtems.h.
- Added original tm.h file and dbxcoff.h.
- (m68k-*-rtems*): Added t-rtems to tmake_file.
- Renamed m68k/m68k-rtems.h to m68k/rtems.h.
- (powerpc-*-rtems*): Added t-rtems to tmake_file.
- Renamed rs6000/powerpc-rtems.h to rs6000/rtems.h.
- (sparc-*-rtems*): Added t-rtems to tmake_file.
- Renamed sparc/sparc-rtems.h to sparc/rtems.h.
-
-Fri Aug 9 16:05:13 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md: (untyped_call) Avoid SIGFPE.
-
- * i386.c (output_float_compare): Don't try to initialize
- aggregate local variable; use assignment statements instead.
-
- * i386.h (RTX_COSTS): rtx_cost should pass two parameters.
-
- * i386/go32.h (ASM_OUTPUT_SECTION_NAME): New.
-
-Fri Aug 9 16:00:11 1996 Jim Wilson <wilson@cygnus.com>
-
- * winnt.c (gen_stdcall_suffix): Round parameter size to PARM_BOUNDARY.
-
-Thu Aug 8 17:42:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (output_toc): If we are emitting a reference to a
- vtable, don't put in the section name, just use the symbol.
-
-Wed Aug 7 19:03:36 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.md (casesi_jump): New pattern.
- (casesi): Generate RTL to match it.
-
-Wed Aug 7 14:10:07 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * ginclude/stddef.h (NULL): Use __null for G++.
-
-Tue Aug 6 17:37:53 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (STACK_BOUNDARY): Always define as 64.
- (ABI_STACK_BOUNDARY): Define as 64/128 based on the -mno-eabi
- switch.
-
- * rs6000.c (rs6000_stack_info): Use ABI_STACK_BOUNDARY, not
- STACK_BOUNDARY. Define ABI_STACK_BOUNDARY as STACK_BOUNDARY #ifndef.
-
-Tue Aug 6 14:29:43 1996 Doug Evans <dje@fallis.cygnus.com>
-
- * gen-protos.c (overrides): New static local.
- (add_hash,parse_fn_proto): New static functions.
- (main): Add prototypes from SYS_PROTO_OVERRIDES to hash table before
- parsing sys-protos.h. Reserve entry 0 in std_protos.
- * alpha.h (SYS_PROTO_OVERRIDES): Define.
-
-Mon Aug 5 16:53:36 1996 Doug Evans <dje@fallis.cygnus.com>
-
- * sparc/t-splet (MULTILIB_OPTIONS): Add mbroken-saverestore.
- (MULTILIB_DIRNAMES): Add brknsave.
-
- * stor-layout.c (layout_record): Correct overflow test for 0 sized
- fields.
-
-Mon Aug 5 16:12:19 1996 Jim Wilson <wilson@cygnus.com>
-
- * alpha.c (alpha_output_filename): When emitting stabs, don't
- disable them if using GNU as.
- (alpha_output_lineno): Likewise, when not using GNU as.
-
- * sh.c (arith_reg_operand): Reject SUBREG of an invalid hard reg.
-
- * sparc/lite.h (aoutos.h): Don't include it.
- * configure (sparclite-*-aout*): Add aoutos.h to tm_file.
-
-Sat Aug 3 23:13:55 1996 Jeffrey A Law (law@cygnus.com)
-
- * combine.c (rtx_equal_for_field_assignment_p): Check for
- get_last_value returning (CLOBBER (CONST_INT 0)).
-
-Sat Aug 3 20:19:14 1996 Jim Wilson <wilson@cygnus.com>
-
- * i960.md (subsi3+1): Handle case where first operand is constant
- but second operand is not.
-
- * m68k/vxm68k.h (WCHAR_TYPE_SIZE): Undef, then define to 16.
-
-Fri Aug 2 15:46:19 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa/pa-hpux.h (LINK_SPEC): Don't link in PA1.1 specific
- libraries when creating shared libraries.
- * pa/pa-hpux9.h, pa/pa-hpux10.h: Likewise.
-
-Fri Aug 2 13:36:42 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (output_float_compare): fcomi should be followed by the
- correct conditional jump instead of fcom/pfstsw/and/jne
- (override_options): Added -mbranch-cost to set BRANCH_COST.
-
- * i386.md (sgt+1,slt+1,sge+1,sle+1,bgt+1,blt+1,bge+1,ble+1,bleu+4)
- Added TARGET_CMOVE check for fcomi.
- (movsicc_1+1,movhicc_1+1): Added to handle the general case.
-
- * i386.h (i386_branch_cost, i386_branch_cost_string): Added.
-
-Fri Aug 2 11:53:55 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * sparc/vxsparc.h (CPP_PREDEFINES): Add `-DCPU=SPARC'.
-
-Thu Aug 1 23:56:01 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (ASM_OUTPUT_INT): Remove all hacks for exception table.
-
-Thu Aug 1 10:08:14 1996 Torbjorn Granlund <tege@spiff.gnu.ai.mit.edu>
-
- * m68k.h (RTX_COSTS, case PLUS): Get operand order right.
-
-Wed Jul 31 15:06:46 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.md (negtf2,abstf2): Fix v9 case.
-
-Wed Jul 31 09:49:25 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (ASM_OUTPUT_INT): Use an 'E%' prefix for items in
- the exception table if TARGET_GAS && ! TARGET_PORTABLE_RUNTIME.
-
-Tue Jul 30 15:37:31 1996 Jim Wilson <wilson@cygnus.com>
-
- * i386/cygwin32.h (dbxcoff.h): Include.
- (DBX_DEBUGGING_INFO, SDB_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE):
- Move definitions before include of dbxcoff.h.
- (ASM_OUTPUT_SOURCE_LINE, DBX_OUTPUT_MAIN_SOURCE_FILE_END): Delete.
- (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_FUNCTION_FIRST): Delete.
-
-Tue Jul 30 15:03:53 1996 Torbjorn Granlund <tege@spiff.gnu.ai.mit.edu>
-
- * i960.md (eq reg (const_int 0)): New pattern.
-
-Tue Jul 30 11:15:44 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (RETURN_ADDR_RTX): Offset is -20 from the frame, not +20!
-
-Mon Jul 29 12:16:17 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.h (GO_IF_LEGITIMATE_ADDRESS): Fix thinko in last change.
-
-Fri Jul 26 18:19:47 1996 Doug Evans <dje@cygnus.com>
-
- * dwarfout.c (output_bound_representation): Fix typo.
-
-Thu Jul 25 16:00:10 1996 Mike Stump <mrs@cygnus.com>
-
- * expr.c (do_jump, case TRUTH_ORIF_EXPR): Ensure end of an
- exception region comes after its start.
- (do_jump, case TRUTH_ANDIF_EXPR): Likewise.
-
-Thu Jul 25 13:36:42 1996 Stan Cox <coxs@equinox>
-
- * i386.c (output_float_compare): Added support for Pentium Pro
- fcomi instruction which sets EFLAGS instead of FPU Status Word.
-
-Wed Jul 24 21:48:08 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * cse.c (canon_hash, cse_insn): MEM is not unchanging if it is
- in the frame (since the temp slot might be reused).
-
-Wed Jul 24 17:34:06 1996 J"orn Rennecke (amylaar@cygnus.com)
-
- * sh.md (branch_true, branch_false, inverse_branch_true): Express
- tests of the T bit as comparisons against zero, rather than one.
- (inverse_branch_false, beq, bne, bgt, blt, ble, bge, bgtu): Likewise.
- (bltu, bgeu, bleu, casesi): Likewise.
-
-Wed Jul 24 15:58:06 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md: (mov{sf,df,xf}cc{,_1}): New patterns for P6 FP cmove.
- * i386.c (put_condition_code, print_operand, output_fp_cc0_set):
- Support fcmov suffixes.
-
-Wed Jul 24 10:53:38 1996 Jeffrey A Law (law@cygnus.com)
-
- * pa.c (move_operand): Relax "mode" test. Allow scaled
- indexed addressing modes.
- (output_fp_move_double): Tweak output strings to work with updated
- 'F' and 'M' output modifiers.
- (print_operand): Collapse 'F' and 'M' into a single hunk of code.
- For auto-increment modes output "s,ma" and "s,mb".
- For scaled indexing modes output "x,s"
- For other addresses, output nothing for 'M' and "s" for 'F'.
- * pa.h (EXTRA_CONSTRAINT): Don't accept scaled indexed addresses
- for 'Q' and 'T'. Do accept scaled indexed addresses for 'R'.
- (GO_IF_LEGITIMATE_ADDRESS): Accept scaled indexed addresses
- for SFmode and DFmode.
- * pa.md: Remove all scaled indexed load patterns.
- (movsi patterns): Accept scaled indexed addresses in some
- cases. Update output strings for updated 'M' and 'F' output modifiers.
- (movhi, movqi, movsf, movdf, movdi patterns): Likewise.
-
-Tue Jul 23 23:10:41 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.h (struct tree_int_cst): Add field for TREE_CST_RTL.
- * varasm.c (decode_addr_const, output_constant_def): AllowINTEGER_CST.
-
-Tue Jul 23 16:42:09 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.c (reg_unused_after): Handle JUMP_INSN inside a sequence.
-
-Tue Jul 23 16:33:25 1996 Mike Stump <mrs@cygnus.com>
-
- * Make exception handling work better when optimizations are on.
- * except.c, except.h: New files.
- * Makefile.in (OBJS): Add except.o.
- (except.o): Add.
- (stmt.o, final.o): Add except.h.
- * rtl.c (note_insn_name): Add NOTE_INSN_EH_REGION_{BEG,END}.
- * rtl.h: Likewise.
- * arm.h (MASK_RETURN_ADDR): Define.
- * pa.h (MASK_RETURN_ADDR, RETURN_ADDR_RTX): New macros.
- * sparc.h (DOESNT_NEED_UNWINDER): Define if not doing a flat function.
- * mips.h (RETURN_ADDR_RTX): Improve.
- * vax.h (RETURN_ADDR_RTX): Improve.
- * toplev.c (rest_of_compilation): Use find_handler_labels.
- (main, interim_eh{,_hook}): Remove interim_eh_hook support.
- (flag_exceptions): New flag; also add to table.
- (compile_file): Emit the exception table in the backend now.
- * final.c (final_scan_insn): Support ASM_OUTPUT_EH_REGION_{BEG,END}.
- (final_scan_insn): Redo handler labels, implement
- NOTE_INSN_EH_REGION_BEG and NOTE_INSN_EH_REGION_END and use them
- instead of CODE_LABELs.
- (final): Add call to check_handler_labels.
- * libgcc2.c (L_eh): Add support for EH_TABLE_LOOKUP.
- * sparc.md (return): Add a reference to the return address register.
- * flow.c (find_basic_blocks): Add support for handler_labels.
- * loop.c (find_and_verify_loops): Likewise.
- * jump.c (jump_optimize): Likewise.
- Add call to check_handler_labels. Add call to exception_optimize.
- * sched.c (sched_analyze): Smuggle exception region notes around.
- (unlink_notes, reemit_notes, schedule_block): Likewise.
- (sched_analyze): Add extra element since we remove two at a time.
- * integrate.c (save_for_inline_copying): Add support for exception
- regions.
- (expand_inline_function): Likewise.
- (function_cannot_inline_p): Don't inline functions that have EH
- regions before NOTE_INSN_FUNCTION_BEG.
- (finish_inline): Use FIRST_FUNCTION_INSN, not NEXT_INSN.
- * function.c (expand_start_all_catch): New function.
- * function.h: Add exception handling support information.
- * expr.c (expand_expr, {defer,expand}_cleanups_to, do_jump): Transform
- interim_eh_hook into calls to expand_ehregion_{start,end}.
- * stmt.c (expand_{decl_cleanup,cleanups}): Likewise.
- (init_stmt_for_function): Call init_eh.
- (save_stmt_status): Call save_eh_status.
- (restore_stmt_status): Call restore_eh_status.
- * expr.h (throw_libfunc): Add.
- * optabs.c (throw_libfunc): Initialize.
- * print-rtl.c (print_rtx): Add support for exception regions.
- * rs6000.c (EXCEPTION_SECTION): Define.
- * output.h (exception_section): Declare.
- * varasm.c (exception_section): Define.
- * i386.c, i960.c, rs6000.c: Include except.h for function.h.
- * c-pragma.c, emit-rtl.c, expr.c, final.c, flow.c: Include except.h.
- * function.c, integrate.c, jump.c, loop.c, objc-act.c: Likewise.
- * stmt.c, stor-layout.c, toplev.c, tree.c, varasm.c: Likewise.
-
-Tue Jul 23 12:32:54 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (rs6000_replace_regno): Set pic_offset_table_rtx so
- that other phases will use the PIC register instead of the
- placeholder.
-
- * rs6000.md (movsi_got*): Eliminate -fPIC code, keep -fpic code.
- (movsi): Only call movsi_got if -fpic, not -fPIC.
-
- * sysv4.h (OVERRIDE_OPTIONS): Improve error messages. Always set
- -msdata=data by default, even if -fpic/-fPIC/-mrelocatable. Treat
- -fPIC the same as -mrelocatable-lib and vica versa.
-
- * t-ppcgas: (MULTILIB_*): Use -mreloctable-lib, instead of
- -mrelocatable. Map Solaris into mcall-sysv-noeabi case. Build
- -mrelocatable-lib libraries under non-eabi case. When linking, if
- -fpic, -fPIC, or -shared, link in the -mrelocatable-lib libraries.
-
-Mon Jul 22 19:34:20 1996 Jim Wilson <wilson@cygnus.com>
-
- * iris6.h (ASM_SPEC): Change {% to %{.
-
- * dwarf2out.c (output_call_frame_info): Change FDE CIE offset to
- be section name rather than 0.
- (gen_subprogram_die): Only emit DW_AT_external if origin is NULL.
- Only call equate_decl_number_to_die if origin is NULL.
- (dwarfout_begin_function): In code that computes offset of frame
- pointer, change 4 to UNITS_PER_WORD.
-
- * combine.c (undo_all): Clear previous_undos field.
-
-Mon Jul 22 19:10:45 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure: Don't change target_alias to target in Makefile.
-
-Sat Jul 20 09:28:38 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * dwarfout.c (output_bound_representation): Treat default case
- as variable bounds, then look inside for SAVE_EXPR.
-
- * mips.h (INITIALIZE_TRAMPOLINE): Use `_flush_cache'; flush data
- cache too.
-
-Sat Jul 20 09:24:13 1996 Marco Walther (Marco.Walther@mch.sni.de).
-
- * configure (mips-sni-sysv4): New target.
- * mips/sni-gas.h, mips/sni-svr4.h, mips/x-sni-svr4: New files.
-
-Fri Jul 19 17:44:13 1996 Stan Coxs <coxs@dg-rtp.dg.com>
-
- * i386.md: (leave): Clobbers esp and ebp.
-
- * i386.h: (TARGET_USE_Q_REG): Support inline strlen on PentiumPro
-
-Fri Jul 19 15:56:18 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * m68k/t-m68kbare (MULTILIB_OPTIONS): Add m5200.
- (MULTILIB_EXCEPTIONS): Define.
- * m68k/lb1sf68.asm: Add MCF5200 support.
- * m68k.md (adddi_sexthishl32): Set condition to !TARGET_5200.
- (subdi_sexthishl32, ashrdi3, ashrhi3): Likewise.
- (negdi2): Change into define_expand.
- (negdi2_internal): Rename from old negdi2; condition now !TARGET_5200.
- (negdi2_5200): New insn.
- * m68k.c (output_function_prologue): Don't use add.w if TARGET_5200.
- (output_function_epilogue): Likewise.
-
- * m68k.md (movqi): Remove complex cases which move between address reg
- and memory; rely on secondary reloads instead.
-
-Fri Jul 19 12:22:50 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * fixproto (std_files): Add utime.h.
-
-Fri Jul 19 10:59:46 1996 Jeffrey A Law (law@cygnus.com)
-
- * m68k/m68kemb.h: Remove '\' at EOF.
-
-Fri Jul 19 09:59:00 1996 Joel Sherrill <joel@OARcorp.com>
-
- * m68k/coff.h (STARTFILE_SPEC): Add #undef before definition.
-
-Fri Jul 19 09:44:45 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * m68k.h (LEGITIMATE_INDEX_P): Coldfire does not have scale
- by 8 addressing modes.
-
- * m68k-none.h: Use MASK_* macros instead of explicit constants.
-
-Fri Jul 19 09:08:53 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.md (negdi2): Undo last change: don't apply neg to address regs.
-
-Fri Jul 19 09:03:01 1996 Robert Wilhelm (rwilhelm@Physik.TU-Muenchen.DE)
-
- * toplev.c (main): Correct typo in error message.
-
-Thu Jul 18 20:29:33 1996 Jim Wilson <wilson@cygnus.com>
-
- * Makefile.in (OBJS): Add dwarf2out.o.
- (dwarf2out.o): New rule.
- * dwarf2.h, dwarf2out.c: New files.
- * dwarfout.c: Check DWARF_VERSION macro.
-
- * mips/iris6.h (DWARF_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE):
- Move after header files are included.
- (iris5.h): Include instead of iris5gas.h.
- (MACHINE_TYPE): Change 5.x to 6.x.
- (DEBUG_SECTION, LINE_SECTION): Add debug_ to name, fix attributes.
- (SFNAMES_SECTION, SRCINFO_SECTION, MACINFO_SECTION, PUBNAMES_SECTION,
- ARANGES_SECTION): Fix attributes.
- (DWARF_VERSION, MIPS_DEBUGGING_INFO, ASM_DECLARE_FUNCTION_NAME,
- ASM_DECLARE_FUNCTION_SIZE, FUNCTION_NAME_ALREADY_DECLARED,
- FRAME_SECTION, ABBREV_SECTION): Define.
- (DBX_DEBUGGING_INFO, SDB_DEBUGGING_INFO, MIPS_DEBUGGING_INFO,
- DWARF_DEBUGGING_INFO, PREFERRED_DEBUGGING_INFO): Delete undefs at
- end of file.
- * mips.c (function_{pro,epi}logue): Use FUNCTION_NAME_ALREADY_DECLARED.
-
-Thu Jul 18 19:24:19 1996 David Mosberger-Tang <davidm@azstarnet.com>
-
- * alpha/elf.h (INT_ASM_OP): Change from ".long" to ".quad".
-
-Thu Jul 18 19:20:58 1996 Ulrich Drepper <drepper@myware.rz.uni-karlsruhe.de>
-
- * stddef.h: Undefine __need_wint_t.
-
-Thu Jul 18 19:06:35 1996 J.T. Conklin <jtc@hippo.cygnus.com>
-
- * longlong.h (mc680x0): Define umul_ppmm, udiv_qrnnd, sdiv_qrnnd
- for the '020, '030, '040, and '332. Define count_leading_zeros
- for the '020, '030, '040, and '060.
-
- * m68k.md: Add TARGET_5200 to conditions which determine whether
- the extbl instruction is emitted.
- (mulsi3): Enable pattern with TARGET_5200.
-
- * m68k.md (add patterns): Don't use two addqw instructions when
- adding small (8 < N <= 16) integers to address registers on 68040.
-
-Thu Jul 18 18:06:15 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure: Write target_alias in Makefile.
- (i[3456]86-*-sco3.2v4*): Set truncate_target.
- * Makefile.in (target_alias): New and used for all current uses
- of `target'.
-
-Thu Jul 18 17:46:02 1996 Dave Love <d.love@dl.ac.uk>
-
- * gcc.c (default_compilers): Extra Fortran extensions.
-
-Wed Jul 17 10:28:10 1996 Torbjorn Granlund <tege@spiff.gnu.ai.mit.edu>
-
- * expmed.c (expand_mult_highpart): Revert last change.
-
-Tue Jul 16 12:51:59 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/sparc-rtems.h: #include "sparc/sparc-aout.h" -> sparc/aout.h.
-
-Mon Jul 15 14:42:06 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips/iris6.h (LINK_SPEC): Add -woff 84.
-
-Fri Jul 12 17:34:01 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi.asm (__eabi): Convert pointers in the Global Offset
- Table if -mrelocatable. Move loops into separate subroutines for
- ease of debugging. Reorganize code somewhat.
-
- * rs6000/rs6000.c (small_data_operand): Allow small data under
- Solaris.
-
- * rs6000/sol-c0.c (_start): Initialize r13 to point to the small
- data operand.
-
- * rs6000/sol-c{i,n}.asm (_init, _fini): Enable shared library
- support.
-
- * rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Default to
- -msdata=data, even if -fpic or -mrelocatable. Allow -mrelocatable
- and -mno-eabi.
- (CPP_SYSV_SPEC): If -fpic, define __PIC__ and __pic__ to 1. If
- -fPIC, define them to 2.
- (CPP_ENDIAN_SPEC): Push definition of macros for specific endian
- targets to new specs.
- (CPP_ENDIAN_DEFAULT_SPEC): Define to use CPP_ENDIAN_BIG_SPEC.
- (CPP_ENDIAN_{LITTLE,BIG,SOLARIS}_SPEC): New specs for little
- endian mode, big endian mode, and Solaris, which can't define
- _LITTLE_ENDIAN. Define __LITTLE_ENDIAN__ in all cases for little
- endian systems. Define __BIG_ENDIAN__ in all cases for big endian
- systems.
- (SUBTARGET_EXTRA_SPECS): Add new specs.
-
- * rs6000/{eabile,sysv4le}.h (CPP_ENDIAN_DEFAULT_SPEC): Define to
- use CPP_ENDIAN_LITTLE_SPEC.
-
- * rs6000/sol2.h (CPP_ENDIAN_LITTLE_SPEC): Define as
- CPP_ENDIAN_SOLARIS_SPEC so that _LITTLE_ENDIAN is not define.
-
-Fri Jul 12 17:34:01 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.c (function_arg): Add IBM AIX XL compiler broken FP arg
- passing compatibility mode.
- * rs6000.h (TARGET_XL_CALL): Define default.
- * aix3newas.h (TARGET_XL_CALL, SUBTARGET_SWITCHES): Define.
- * aix41.h (TARGET_XL_CALL, SUBTARGET_SWITCHES): Define.
-
-Fri Jul 12 15:04:43 1996 Doug Evans <dje@cygnus.com>
-
- * arm.h (ASM_OUTPUT_MI_THUNK): Handle fns returning structures.
-
- * ptx4.h ({ASM,LINK}_SPEC): %{V} %{v:%{!V:-V}} -> %{v:-V}.
- * svr4.h ({ASM,LINK}_SPEC): Likewise.
- * dsp16xx/dsp16xx.h ({ASM,LINK}_SPEC): Likewise.
- * i386/dgux.h (LINK_SPEC): Likewise.
- * i386/sol2.h (LINK_SPEC): Likewise.
- * m88k/dgux.h ({LINK,ASM_CPU}_SPEC): Likewise.
- * sparc/sol2.h ({ASM,LINK}_SPEC): Likewise.
- * sparc/sp64-elf.h ({ASM,LINK}_SPEC): Likewise.
- * sparc/sysv4.h (ASM_SPEC): Likewise.
-
-Thu Jul 11 17:29:33 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (GOT_TOC_REGNUM): New macro for r2, which is used as a
- marker for the GOT/TOC register to be allocated later.
- (MACHINE_DEPENDENT_REORG): Call rs6000_reorg.
- (rs6000_reorg): Add declaration.
-
- * rs6000.c (rs6000_got_register): Return REG 2, not a pseudo
- register in order to work with inlined functions.
- (rs6000_replace_regno): New function to replace a register with a
- new pseudo register.
- (rs6000_finalize_pic): Loop through all insns, replacing any
- GOT_TOC_REGNUM registers with new pseudo register, and adding
- initialization of GOT register if it was created.
- (rs6000_reorg): New function to check whether the GOT_TOC register
- marker was removed.
-
-Thu Jul 11 10:12:50 1996 Jeffrey A Law (law@cygnus.com)
-
- * h8300.h (OK_FOR_U): If generating H8/S code, accept
- SYMBOL_REF and SYMBOL_REF + CONST_INT.
-
- * h8300.c ({shift,rotate}_one): Emit tabs between opcode and
- operands to be consistent with the rest of the compiler.
- (shift_two, rotate_two): Define.
- (get_shift_alg): Accept new argument "assembler2_p" for
- rotate/shift by two insns. All callers changed. Rework
- to generate more efficient code on the H8/300, H8/300H, and H8/S.
- Try to simplify somewhat.
- (emit_a_shift): Use shift-by-two insns when they're available.
- Emit tabs between opcode and operands to be consistent with
- the rest of the compiler.
-
-Wed Jul 10 19:32:17 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips/iris6.h (ASM_SPEC): Correct typos in Jun 18 change.
-
-Wed Jul 10 18:56:38 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * sh.c (machine_dependent_reorg): When looking for instruction that
- sets register in LOG_LINKS, skip link if REG_NOTE_KIND is not zero.
-
-Wed Jul 10 15:02:18 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (rs6000_got_register): New function to return a pseudo
- register to hold the pic register. Abort if reload is in progress
- or done.
- (num_insns_constant): Allow SFmode and DFmode.
-
- * rs6000.h (CONST_DOUBLE_OK_FOR_LETTER_P): Redo 'G' so that it
- means a constant that takes exactly two insns.
- (rs6000_got_register): Add declaration.
-
- * rs6000.md (movsi_got): Move setup of pic register to
- rs6000_got_register.
- (movsf): If -msoft-float, don't force constants to memory.
- (mov{sf,df} insns): If soft floating point, allow any constant to
- be loaded. Add define_splits that allow the 604 to use both
- integer units for loading constants. Make sure insn length is
- correct.
-
-Tue Jul 9 17:05:10 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (easy_fp_constant): All FP constants are considered
- hard for -fpic and hardware floating point, so that the GOT
- register is created.
-
-Tue Jul 9 15:21:27 1996 Jim Wilson <wilson@cygnus.com>
-
- * x-iris6 (FIXPROTO_DEFINES): Add -D_SGI_SOURCE.
-
-Mon Jul 8 18:00:33 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.h (enum reg_class): Add new class GENERAL_FP_REGS.
- (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Likewise.
-
- * cse.c (note_mem_written): Varying structure memory access with
- AND address can alias scalars.
- * sched.c ({true,anti,output}_dependence): Likewise.
-
- * sh.c (calc_live_regs): For pragma_interrupt case, exclude call
- clobbered regs that are fixed, explicitly add MACH_REG and MACL_REG.
-
- * calls.c (expand_call): For assign_stack_temp call in PARALLEL case,
- get mode from type instead of using BLKmode.
- * function.c (aggregate_value_p): If hard_function_value returns
- a non-REG, then return 0.
-
- * mips.c (function_arg): Add explicit checks for FIELD_DECLs.
- (mips_function_value): Add explicit checks for FIELD_DECLs, and save
- them in the array FIELDS. When returning structure with 1 float field,
- enclose it in a PARALLEL and set the PARALLEL mode correctly.
- * mips.md (call_value): Call gen_call_value_multiple_internal0
- only if there are multiple return values. Strip the PARALLEL off
- if there is only one return value.
-
-Mon Jul 8 16:27:33 1996 Jeffrey A. Law <law@cygnus.com>
-
- * First cut at support for the H8/S.
- * h8300.c (h8300_init_once): Handle the H8/S (treat it
- like the H8/300H).
- (dosize, adds_subs_operand, one_insn_adds_subs_operand): Likewise.
- (output_adds_subs, const_costs, print_operand): Likewise.
- (output_simode_bld, h8300_adjust_insn_length): Likewise.
- (push_order, pop_order): Reverse.
- (function_prologue): Try to use ldm.l and stm.l insns
- on the H8/S. Minor cleanups.
- (function_epilogue): Likewise.
- (asm_file_start): Emit ".h8300s" when compiling for the H8/S.
- * h8300/h8300.h (CPP_SPEC): Handle the H8/S.
- (TARGET_H8300S): New target.
- (TARGET_SWITCHES): Add "-ms" and "-mno-s".
- (BITS_PER_WORD): Handle the H8/S (treat it like the H8/300H).
- (UNITS_PER_WORD, POINTER_SIZE, PARM_BOUNDARY): Likewise.
- (BIGGEST_ALIGNMENT, BIGGEST_FIELD_ALIGNMENT): Likewise.
- (INITIALIZE_TRAMPOLINE, MOVE_MAX, Pmode): Likewise.
- * h8300.md: Handle H8/S just like H8/300H
- throughout the entire file.
- * t-h8300 (MULTILIB_OPTIONS): Build "-ms" libraries too.
- (MULTILIB_DIRNAMES): Put H8/S libraries in "h8300s" directory.
- * h8300/lib1funcs.asm: Emit ".h8300s" pseudo-op when generating
- h8300s object files. Otherwise treat the H8/S just like the H8/300H.
- * ginclude/stdarg.h: Handle the H8/S.
- * ginclude/varargs.h: Likewise.
-
-Mon Jul 8 14:50:58 1996 Doug Evans <dje@cygnus.com>
-
- * sparc/sol2.h (LINK_SPEC): Don't pass `-z text' if
- -shared -mimpure-text.
-
-Sun Jul 7 18:03:46 1996 Torbjorn Granlund <tege@noisy.tmg.se>
-
- * m68k/lb1sf68.asm (__udivsi3): Use faster tstw instead of btst.
-
-Thu Jul 4 11:44:39 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (get_inner_reference): Delete using alternate mode for
- bitfield; we don't make bitfields anymore if not needed.
-
-Wed Jul 3 18:23:17 1996 Stephen L Moshier (moshier@world.std.com)
-
- * c-common.c (record_function_format): Define as static.
-
- * collect2.c (at SUNOS4_SHARED_LIBRARIES): Fix reference to unistd.h.
-
-Wed Jul 3 17:35:20 1996 Gavin Koch <gavin@cygnus.com>
-
- * c-typeck.c (default_conversion): Add bitfield promotions.
-
-Wed Jul 3 17:09:22 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * gcc.c (default_compilers): Add null entries for languages we
- heard of.
- (main): If found one of those entries, say compiler not installed.
-
-Wed Jul 3 12:52:53 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (fmpy_operands): Define.
- (combinable_{fmpy,add,fsub}): New function.
- * pa.md (parallel_addb, parallel_movb): New patterns.
- (fmpyadd, fmpysub): New patterns.
-
- * pa.c (fmpy{add,sub}operands): Tighten checks. Allow SFmode.
-
-Tue Jul 2 18:57:15 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (ireg_or_int5_operand): New function.
- (output_parallel_movb, output_parallel_addb): Likewise.
- (combinable_copy, combinable_add, following_call): Likewise.
- (pa_adjust_insn_length): Handle parallel unconditional branches.
- (output_movb): Handle case were destination is %sar.
- * pa.h: Declare new functions.
- * pa.md (parallel_branch): New "type" attribute.
- (delay slot descriptions): Don't allow "parallel_branches" in
- delay slots. Fill "parallel_branches" like "branch" insns.
- (movb patterns): Handle %sar as destination register.
-
- * expr.c (compare): If function pointers need canonicalization
- before comparisons, canonicalize them.
- (do_store_flag): Do not use an sCC insn for a function pointer
- comparison if function pointers need canonicalization before
- comparing.
-
-Tue Jul 2 17:56:37 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h ({START,END}FILE_LINUX_SPEC): If -mnewlib is not
- used, use the crtbegin/crtend that 2.7.2 used.
-
-Sat Jun 29 07:10:02 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (INIT_EXPANDERS): Define, call rs6000_init_expanders.
- (RS6000_VARARGS_OFFSET): fpmem area no longer next to outgoing
- argument area.
- (STARTING_FRAME_OFFSET, STACK_DYNAMIC_OFFSET): Likewise.
- (frame_pointer_needed): Add external declaration.
- (rs6000_{save,restore}_machine_status): Ditto.
- (rs6000_init_expanders): Likewise.
-
- * rs6000.c (rs6000_{save,restore}_machine_status): New functions
- to save and restore the globals needed on a per function basis.
- (rs6000_init_expanders): Initialize globals needed on a per
- function basis, and set up so the above save/restore functions are
- called when processing nested functions.
- (output_epilog): Don't initialize per function globals here.
- (rs6000_stack_info): Change where fpmem save area is to below local
- variables, and not just below the outgoing argument area.
-
- * rs6000.md (floatsidf2*, fix_truncdfsi2*): Rewrite conversion
- routines to track new location of the fpmem save area. Allocate a
- new base register temp for the routines in case the stack frame is
- more than 32k in size.
-
-Sat Jun 29 05:44:37 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * explow.c (convert_memory_address, case PLUS): Fix error in
- last change.
-
-Fri Jun 28 23:30:48 1996 Jeffrey A. Law <law@cygnus.com>
-
- * reload1.c (choose_reload_regs): Properly mark spill registers
- as in use for inherited reloads.
-
-Fri Jun 28 18:37:20 1996 Stephen L Moshier <moshier@world.std.com>
-
- * objc/sarray.c (ifdef __alpha__): Don't declare `free'.
- * objc/thr-decosf1.c (objc_thread_id): Use pthread_getunique_np
- to obtain a thread ID value.
- (objc_mutex_allocate): Cast mutex->owner to _objc_thread_t.
- (objc_mutex_{deallocate,unlock}): Likewise.
- (objc_mutex_{try,un,}lock): Declare thread_id as _objc_thread_t.
-
- * real.c (asctoeg): `0.0eX' is zero, regardless of the exponent X.
-
-Fri Jun 28 18:33:13 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * vax.md (rotl): Remove extraneous `$'.
-
- * combine.c (previous_num_undos): Deleted variable.
- (MAX_UNDO): Deleted macro.
- (struct undo): New field, next.
- (struct undobuf): Deleted num_undos and undo.
- New fields undos, frees, and previous_undos.
- (SUBST, SUBST_INT): Rework to allocate memory and chain undo entries.
- (combine_instructions): Initialize undobuf.{undos,previous_undos},
- not undobuf.num_undo and previous_num_undos.
- (try_combine): Likewise.
- (undo_all, gen_rtx_combine): Rework to use new data structures.
-
-Fri Jun 28 16:48:25 1996 Scott Christley <scottc@net-community.com>
-
- * objc/sendmsg.c (__objc_block_forward): New function.
- (get_imp, objc_msg_lookup): Use different forwarding function
- when the returning a floating point value.
-
-Fri Jun 28 16:25:25 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure: Allow multiple makefile frags.
- (i[3456]86-*-linux*oldld*): Add i386/t-crtstuff as target frag.
- (i[3456]86-*-linux*aout*, i[3456]86-*-linux*): Likewise.
- (m68k-*-linux*aout*): Add t-linux-aout as target frag.
- (m68k-*-linux*): Add t-linux as target frag.
- * Makefile.in (Makefile): xmake_file and tmake_file now already
- contain the $(srcdir)/config prefix.
-
- * config/t-linux (BOOT_CFLAGS): Removed, no longer necessary.
- (CRTSTUFF_T_CFLAGS): Don't define.
- (CRTSTUFF_T_CFLAGS_S): Define this instead.
- * config/t-linux-aout (BOOT_CFLAGS): Removed.
- * m68k/t-linux: Remove variables now in t-linux.
-
-Fri Jun 28 15:06:05 1996 John F. Carr <jfc@mit.edu>
-
- * alpha.c (alpha_emit_conditional_move): Emit correct code when
- incoming comparison code is NE.
-
-Fri Jun 28 14:35:45 1996 J.T. Conklin <jtc@hippo.cygnus.com>
-
- * c-decl.c (init_decl_processing): Register __builtin_memset
- and memset as builtin functions.
- * expr.c (expand_builtin, case BUILTIN_MEMSET): Open code memset
- where val == 0.
-
-Fri Jun 28 14:10:03 1996 Richard Henderson <rth@tamu.edu>
-
- * alpha/linux.h (FUNCTION_PROFILER): _mcount has non-standard linkage.
- * alpha/elf.h (LINK_SPEC): Bring emulation name into sync
- with Cygnus snapshot.
-
- * alpha.h ({MASK,TARGET}_BUILD_CONSTANTS): New macros.
- (TARGET_SWITCHES): New target option build-constants.
- * alpha.c (alpha_emit_set_long_const): New function.
- * alpha.md (movdi): Call it.
- * expmed.c (expand_mult_highpart): Use op1 not wide_op1 in
- expansion of mul_highpart.
-
- * alpha.c (output_{pro,epi}log): Flag_inhibit_size_directive
- should supress .ent, .end, and accompanying directives.
- (alpha_output_lineno): Fix polarity on GAS test.
- * alpha.h (NO_DBX_FUNCTION_END): New macro.
- * dbxout.c (dbxout_function): Respect NO_DBX_FUNCTION_END.
- * alpha/elf.h: New file.
- * alpha/linux.h (INITIALIZE_TRAMPOLINE): New definition.
- * alpha/xm-linux.h (HAVE_STRERROR): Define.
- * configure (alpha*-linux*ecoff*): New target, was alpha-*-linux*.
- (alpha-*-linux*): Use elf.h.
- * crtstuff.c (init_dummy): Only i386-linux (at most)
- needs ___brk_addr hack.
-
-Thu Jun 27 20:23:30 1996 Jon Buller (jonb@metronet.com)
-
- * ns32k.c (split_di): New; from i386.c.
- * ns32k.md (adddi3, subdi3, negdi3): New patterns.
-
-Thu Jun 27 19:42:50 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (force_to_mode, case NE): Fix typo and logical error.
- (simplify_comparison): Don't swap args if op1 is CONST_INT.
-
-Thu Jun 27 18:49:35 1996 Jim Wilson <wilson@cygnus.com>
-
- * expmed.c (extract_bit_field): Check TRULY_NOOP_TRUNCATION before
- making a SUBREG of a REG.
-
-Thu Jun 27 11:03:59 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * mips.h (CC1_SPEC): Put spaces between the -mips* cases.
- * mips/osfrose.h (CC1_SPEC): Likewise.
-
- * sh.c (output_branch): Don't call ADJUST_INSN_LENGTH if insn is
- inside sequence.
-
-Wed Jun 26 19:09:43 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (CMP_PSI): Delete.
- (FUNCTION_POINTER_COMPARISON_MODE): Likewise.
- * pa.md (cmppsi): Delete expander.
- (canonicalize_funcptr_for_compare): Renamed from plabel_dereference,
- turned into an expander + anonymous pattern.
-
-Tue Jun 25 22:36:11 1996 Doug Evans <dje@seba.cygnus.com>
-
- * gcc.c (PEXECUTE_VERBOSE): Define.
- (execute): Pass PEXECUTE_VERBOSE to pexecute if -v.
-
-Tue Jun 25 12:23:54 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (FINALIZE_PIC): Define to call rs6000_finalize_pic.
- (rs6000_finalize_pic): Add declaration.
- (svr4_traceback): Delete unused declaration.
-
- * rs6000.md (movsi_got): Don't emit gen_init_v4_pic insn.
- (V.4 call insns): Do not use @plt for PIC calls.
-
- * rs6000.c (print_operand_address): Handle LABEL_REF just like
- SYMBOL_REF.
- (rs6000_finalize_pic): Define, emit the gen_init_v4_pic insn
- before all other insns if needed for V.4 PIC calls.
-
- * eabi-ci.asm (_GLOBAL_OFFSET_TABLE_): Do not provide a default
- definition, since it interferes with the linker generated version.
-
-Tue Jun 25 01:17:50 1996 Jeffrey A. Law <law@cygnsu.com>
-
- * h8300.c (function_prologue): Update "monitor" prologues.
- (function_epilogue): Similarly.
-
- * pa.h (PARSE_LDD_OUTPUT): Handle dynamic libraries that are
- loaded "statically".
-
-Mon Jun 24 19:48:36 1996 Joel Sherrill <joel@merlin.gcs.redstone.army.mil>
-
- * configure ({i386,i960,m68k,powerpc,sparc}-rtems): New targets.
- * i386/go32-rtems.h, i386/i386-rtems.h: New files.
- * i960/i960-rtems.h: New file.
- * m68k/m68k-rtems.h: New file.
- * rs6000/powerpc-rtems.h: New file.
- * sparc/sparc-rtems.h: New file.
-
-Mon Jun 24 23:09:22 1996 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c: (create_definition): Diagnose `#define #' only once.
-
-Mon Jun 24 11:42:58 1996 Jim Wilson <wilson@cygnus.com>
-
- * i386/cygwin32.h, rs6000/cygwin32.h (CPP_PREDEFINES): For consistency,
- change to define WIN32, WINNT, and CYGWIN32.
-
-Mon Jun 24 10:46:50 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (floatsidf2*): Move the xor of the argument into the
- define_insn, since it confuses inline function expands.
-
-Fri Jun 21 20:40:17 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (call_internal1, call_value_internal1): Delete obsolete code.
- (call_internal2, call_value_internal2, call_value_multiple_internal2):
- Delete obsolete code. Explicitly load SYMBOL_REF into register.
- (call_value): Change Pmode to SImode in gen_call_value_internal0 call.
-
-Thu Jun 20 12:20:33 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure (*-aix*): If building a cross compiler, use t-xnewas
- instead of t-newas.
-
- * rs6000.c (num_insns_constant_wide): Fix typo if HOST_WIDE_INT
- has more than 32 bits.
-
-Wed Jun 19 17:50:33 1996 Richard Henderson <richard@atheist.tamu.edu>
-
- * combine.c (move_deaths): New parameter maybe_kill_insn.
- Don't move note if reg killed by maybe_kill_insn.
- (try_combine): Pass new arg to move_deaths.
-
-Wed Jun 19 10:44:47 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * toplev.c (flag_keep_static_consts): Define.
- (f_options): Add "keep-static-consts" entry.
- (compile_file): Check it in addition to !optimize for emitting
- static const variables.
-
-Tue Jun 18 23:37:20 1996 Doug Evans <dje@cygnus.com>
-
- * i386/cygwin32.h (ASM_OUTPUT_SOURCE_LINE): Local symbols begin with L.
-
-Tue Jun 18 12:00:11 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (asm_output_aligned_bss): Don't emit a skip of size 0.
-
-Tue Jun 18 06:24:28 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * integrate.c (expand_inline_function): Add missing call to
- force_operand when getting structure_value_addr into reg.
-
- * alpha.c (override_options): Allow EV4/5 or 21064/21164 for cpu.
- Clean up handling of floating-point options.
- * alpha.h (TARGET_SWITCHES): Have all -mieee options turn
- on MASK_IEEE_CONFORMANT.
- (TARGET_DEFAULT): Use symbolic value.
- * alpha.md: When not involving named pattern, update condition
- to include alpha_tp != ALPHA_TP_INSN.
- Don't do float_extend as part of other pattern when ALPHA_TP_INSN.
- (extendsfsd2): Split into two patterns, depending on
- value of alpha_tp.
-
- * mips/iris6.h (ASM_SPEC): Treat -o32 as -32 and -n64 same as -64.
- * mips.c (override_options): Likewise.
-
- * genattrtab.c (fatal): Declare A1 and A2 as char *.
-
- * function.c (find_temp_slot_from_address): Check for overlap
- from BASE_OFFSET if X is PLUS of virtual_stack_vars_rtx and const.
-
- * flow.c (flow_analysis): Fix typo in last change.
-
- * expr.c (expand_builtin, case BUILT_IN_{SET,LONG}JMP): Properly
- handle case when ptr_mode != Pmode.
-
- * combine.c (try_combine): Don't use split if dest of new I2
- is used between I2 and I3.
-
- * c-typeck.c (pointer_int_sum): Convert integer to both signedness
- and precision of sizetype.
- * explow.c (convert_memory_address, case PLUS, MULT): Don't commute
- operation with extension if not adding small integer.
-
- * Makefile.in (BOOT_LANGUAGES): New variable.
- (bootstrap): Use it to select languages for stage1.
- * configure (extra_host_objs): New variable.
- Separate files needed for target and host and concatenate list.
- (extra_gcc_objs): Use setting for host, not target.
- (objc_thread_file): Start with it as null, then don't include "thr-".
- Print name of file after others and in same format.
- (alpha-*-winnt*, i[3456]86-*-winnt): oldnames.o is in extra_host_objs.
- (all_boot_languages): New variable.
- Set from boot_language variable in config-lang.in.
- Defines value of BOOT_LANGUAGES in Makefile.
- (Makefile): Set target to the canonical form of target.
-
-Mon Jun 17 22:37:07 1996 Mike Meissner <meissner@rtl.cygnus.com>
-
- * rs6000/win-nt.h (ASM_DECLARE_FUNCTION_NAME): Put function
- descriptor in .reldata, not .text.
-
-Mon Jun 17 16:05:34 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * ginclude/stddef.h (wint_t): Don't wrap with #ifndef __cplusplus.
-
-Mon Jun 17 15:03:20 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (mips_split_addresses): New variable.
- (simple_memory_operand): Add comment about mode check. Add check
- for LO_SUM.
- (call_insn_operand): OP is now an addresses instead of a MEM.
- (move_operand, mips_check_split): New functions.
- (mips_count_memory_refs): Add check for LO_SUM.
- (mips_move_1word): Add HIGH support.
- (mips_address_cost): Delete check for HIGH.
- (output_block_move): Handle LO_SUM addresses.
- (override_options): Set mips_split_addresses.
- (print_operand_address): Add LO_SUM support.
- * mips.h (mips_split_addresses, mips_check_split, move_operand):
- New declarations
- (GO_IF_LEGITIMATE_ADDRESS): Reject constant addresses when
- mips_split_addresses is TRUE. Add LO_SUM support.
- (LEGITIMIZE_ADDRESS): Add LO_SUM support.
- (PREDICATE_CODES): Modify call_insn_operand support. Add
- move_operand.
- * mips.md (memory): Change r4100/r4300 support.
- (imuldiv): Add r4300 support.
- (high, low): New patterns.
- (movsi, movdi): Add LO_SUM support.
- (movsi_internal1, movsi_internal2): Use move_operand instead of
- general_operand.
- (movstrsi_internal, movstrsi_internal2): Delete R constraint.
- (call, call_value): Pass address instead of MEM to call_insn_operand.
- Call gen_call_{value_}internal0 instead of internal1.
- (call_internal0, call_value_internal0, call_multiple_internal0):
- New patterns.
- (call_internal1, call_internal2, call_value_internal1,
- call_value_internal2, call_value_multiple_internal2): Add explicit
- MEM before target address.
-
-Sun Jun 16 23:05:16 1996 Jeffrey A. Law <law@cygnus.com>
-
- * configure (hppa*-hp-hpux10*): Use new pa-hpux10 configuration file.
- (hppa*-hp-hpux*): Use hpux9 configuration files by default.
- * pa/pa-hpux10.h: New file.
- * pa/pa-ghpux9.h: Deleted. No longer used.
-
-Sat Jun 15 04:35:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
-
- * i386/gnu.h (LINK_SPEC): Remove -rpath /lib/ option.
- Ignore -ibcs option.
-
-Thu Jun 13 14:49:41 1996 Jim Wilson <wilson@cygnus.com>
-
- * gen-protos.c (main): Change argv[i] to argv[0][i].
-
-Thu Jun 13 10:46:24 1996 Doug Evans <dje@cygnus.com>
-
- * gcc.c (pfatal_pexecute): Delete code to check errno < sys_nerr.
-
-Wed Jun 12 21:47:10 1996 Eliot Dresselhaus <dresselh@rft30.nas.nasa.gov>
-
- * alpha.c (alpha_cpu, alpha_cpu_string): New variables.
- (override_options): Process -mcpu= value.
- (alpha_adjust_cost): Handle adjustments for EV5.
- * alpha.h (enum processor_type): New enum.
- (alpha_cpu, alpha_cpu_string): New declarations.
- (target_options): Add "cpu=".
- (RTX_COSTS): Adjust values for EV5.
- * alpha.md: Add scheduling rules for EV5.
-
-Tue Jun 11 17:51:03 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-common.c (check_format_info): Change text of message about use
- of `0' with precision.
-
-Tue Jun 11 15:14:10 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.h (TARGET_SCHEDULE_PROLOGUE): New. Allows prologue to
- be emitted as asm or rtl.
-
- * i386.c (function_prologue): Emit prologue as asm.
- (override_options): Don't emit rtl for prologue if -fpic.
-
-Tue Jun 11 14:41:01 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi.asm (__eabi): Fix normal code so that it properly
- loads up r2/r13 if needed again.
-
- * rs6000/sysv4.h (CPP_ENDIAN_SPEC): Call cpp_endian_default, not
- cpp_endian_default_spec.
-
-Mon Jun 10 15:10:56 1996 Jeffrey A. Law <law@cygnus.com>
-
- * local-alloc.c (update_equiv_regs): Ignore insns that read or
- write registers that are likely to be spilled.
-
- * pa.h (cmp_type): Add CMP_PSI.
- (FUNCTION_POINTER_COMPARISON_MODE): Define.
- * pa.md (cmppsi): New expander.
- (plabel_dereference): New pattern
-
-Mon Jun 10 14:56:14 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sol2.h (SKIP_ASM_OP): Delete, Solaris accepts .space,
- like rest of PowerPC V4 ports.
-
- * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Emit .lcomm if not
- using the .sbss area. If using the .sbss area, put out
- appropriate .size directive.
-
-Mon Jun 10 14:53:38 1996 Doug Evans <dje@cygnus.com>
-
- * Move fork/exec/wait handling into file of its own.
- * pexecute.c: New file.
- * Makefile.in (pexecute.o): Add rule.
- (xgcc): Link in pexecute.o.
- (protoize,unprotoize): Likewise.
- * gcc.c (_WIN32): Don't include process.h or declare spawnv{,p}.
- (pexecute,pwait): Add prototypes.
- (PEXECUTE_{FIRST,LAST,SEARCH}): Define.
- (execv,execvp): Delete decls.
- (perror_exec): Delete.
- (pfatal_pexecute): New function.
- (pexecute support): Delete.
- (execute): -pipe not supported if _WIN32 or OS2.
- Update call to pexecute. Fatal error if pexecute fails. Call pwait.
- * protoize.c: Include gansidecl.h.
- (my_execvp): Delete.
- (choose_temp_base,pexecute,pwait): Declare.
- (PEXECUTE_{FIRST,LAST,SEARCH}): Define.
- (execvp): Delete decl.
- (usage): Fix typo.
- (gen_aux_info_file): Rewrite to use pexecute/pwait.
-
- * gcc.c (do_spec_1): Allow leading text in version string.
- Delete support for default minor number = 0.
-
-Mon Jun 10 11:49:53 1996 Scott Christley <scottc@net-community.com>
-
- * objc/Makefile (libobjc.a): Don't delete the library.
-
- * objc/thr.h (objc_set_thread_callback): New function.
- (objc_thread_callback): Typedef for the hook function.
- * objc/thr.c (__objc_thread_detach_function): Clear thread storage.
- Call the thread hook function when first becoming multi-threaded.
- (objc_set_thread_callback): New function.
-
- * objc/selector.c (__sel_register_typed_name): Additional parameter
- that indicates whether name and type parameters are constant or not.
- * objc/runtime.h (__sel_register_typed_name): Likewise.
- * objc/init.c (__sel_register_typed_name): Likewise.
-
- * objc/init.c (__objc_init_protocols): Need to unlock mutex.
-
-Mon Jun 10 11:44:44 1996 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * sparc/t-sol2 (gmon.o): Depend on stmp-int-hdrs.
- (crt1.o, crti.o, crtn.o, gcrt1.o): Depend on $(GCC_PASSES).
-
-Mon Jun 10 11:29:46 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * flow.c (flow_analysis, find_basic_blocks): Ignore
- nonlocal_label_list for CALL_INSN that has a REG_RETVAL.
-
- * c-common.c (decl_attributes, case A_T_UNION): Don't look at fields
- of union if there aren't any.
-
-Sat Jun 8 22:13:33 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (ix86_expand_prologue): Keep pic register load ahead
- of reference which may use a pic register.
-
-Sat Jun 8 22:13:33 1996 Jim Wilson <wilson@cygnus.com>
-
- * i386.md (strlensi_unroll4, strlensi_unroll5): Use + not =& for
- constraint for input/output operand 2.
-
-Sat Jun 8 22:13:33 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * i386.h (CONST_COSTS): Even integer constants have a cost.
- (RTX_COSTS): Take costs of subexpressions into account.
- If a multiply is actually a shift, use the cost of the shift.
- * i386/unix.h (SHIFT_DOUBLE_OMITS_COUNT): New macro.
- * i386/{gas, next, seq-gas}.h (SHIFT_DOUBLE_OMITS_COUNT): Redefine
- as zero.
- * i386.c (print_operand): new letter 's'.
-
-Sat Jun 8 15:13:33 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.c (override_options): Add vr4100 and vr4300 support.
- * mips.h (enum processor_type): Likewise.
- (MASK_4300_MUL_FIX, TARGET_4300_MUL_FIX): New macros.
- (TARGET_SWITCHES): Add -mfix4300 option.
- * mips.md (cpu, memory, imuldiv, adder, mult, divide): Add
- vr4100 and vr4300 support.
- (muldf3, mulsf3): Add vr4300 support.
- (muldf3_internal, muldf_r4300, mulsf3_internal, mulsf_r4300): New
- patterns.
-
-Sat Jun 8 14:35:23 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * toplev.c (main): Re-enable -gxcoff+.
-
-Sat Jun 8 14:20:14 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * m68k/lb1sf68.asm (__{eq,ne,gt,lt,ge,le}{df,sf}2): Removed
- extraneous comments, constants, labels, etc.
-
- * m68k/altos3068.h (TARGET_DEFAULT): Use MASK_* macros
- instead of explicit constants in definitions or conditionals.
- * m68k/{apollo68, aux, ccur-GAS, dpx2, hp320, hp3bsd}.h: Likewise.
- * m68k/{hp3bsd44, isi-nfp, isi, linux-aout, linux}.h): Likewise.
- * m68k/{lynx-ng, lynx, m68k-none, m68k-psos, m68kv4}.h): Likewise.
- * m68k/{mot3300, netbsd, news, next, pbb, plexus, sun2o4}.h): Likewise.
- * m68k/{sun3, sun3n, tower}.h): Likewise.
-
-Sat Jun 8 13:55:23 1996 Matthias Pfaller (leo@marco.de)
-
- * ns32k.md (define_insns for ffs[qhs]i2): Deleted.
- (define_expand for ffssi2): New pattern.
-
-Sat Jun 8 13:44:14 1996 Stephen L Moshier (moshier@world.std.com)
-
- * reload.c (find_equiv_reg): Set need_stable_sp if GOAL is the
- stack pointer.
-
-Sat Jun 8 13:36:05 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (fixup_var_refs_1, case SIGN_EXTEND): Handle
- paradoxical SUBREGs as first operand.
- (fixup_var_regs_1, case SET): Handle paradoxical SUBREGs as
- first operand of a ZERO_EXTRACT in SET_DEST.
-
- * c-common.c (enum attrs): Add A_FORMAT_ARG.
- (init_attribute): Initialize it.
- (decl_attributes, case A_FORMAT): Clean up error messages.
- (decl_attributes, case A_FORMAT_ARG): New case.
- (struct international_format_info): New structure and typedef.
- (international_format_list): New variable.
- (record_international_format): New function.
- (init_format_info): Call it for gettext, dcgettext, and dcgettext.
- (check_format_info): See if format arg is call to
- internationalization function.
-
-Fri Jun 7 20:04:40 1996 Jim Wilson <wilson@cygnus.com>
-
- * gcc.c (MULTILIB_SELECT): Delete definition.
- (multilib_select): Delete static initializer.
- (multilib_obstack, multilib_raw): New global variables.
- (multilib.h): Include inside multilib_raw definition.
- (main): Set multilib_select from multilib_raw.
- * genmultilib: Change output to be a sequence of short strings
- separated by commas rather than a single long macro definition.
-
- * cse.c (simplify_binary_operation, case MULT): Check for case
- where width is larger than HOST_BITS_PER_WIDE_INT, and upper most
- bit is set. We can not generate a simple shift in this case.
-
- * gsyms.h (enum sdb_type): Add T_LNGDBL if EXTENDED_SDB_BASIC_TYPES.
- (enum sdb_masks): Add EXTENDED_SDB_BASIC_TYPES masks.
- * sdbout.c (gsyms.h): Include if CROSS_COMPILE is defined.
- (plain_type_1): Use TYPE_PRECISION instead of TYPE_SIZE.
- Add check for LONG_DOUBLE_TYPE_SIZE if EXTENDED_SDB_BASIC_TYPES.
- * i960.h (EXTENDED_SDB_BASIC_TYPES): Define.
- (PUT_SDB_TYPE): Delete now unnecessary shifting and masking.
-
- * i960.h (i960_output_move_{double,quad}): Declare.
-
-Fri Jun 7 19:22:09 1996 Scott Christley <scottc@net-community.com>
-
- * Makefile.in (OBJC_THREAD_FILE): New variable.
- * configure (objc_thread_file): Set new variable to appropriate
- values based upon target operating system; default is `thr-single'.
- * objc/Makefile (OBJC_THREAD_FILE): Add target and dependency.
- (thr.o): Remove OS specific thread files as dependencies.
- * objc/thr-decosf1.c: Now compiles as a separate source file, so
- include appropriate Objective-C headers.
- * objc/thr-{mach,os2,posix,irix,single,solaris,win32}.c: Likewise.
- * objc/thr.c: Remove inclusion of source files.
- * objc/thr.h (__objc_thread_exit_status): Declare global variable.
- * objc/thr-pthreads.c: New file.
-
-Fri Jun 7 19:04:04 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * m68k.h (TARGET_SWITCHES): Treat -m68302 like -m68000 and -m68332
- like -m68020; remove -mno-68302 and -mno-68332.
-
-Fri Jun 7 12:06:12 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * expr.c (safe_from_p): Allow Chill-style variable-sized arrays.
-
-Thu Jun 6 23:11:11 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (h8300_monitor_function_p): New function.
- (h8300_os_task_function_p): Likewise.
- (os_task, monitor): Variables to note if the current
- function is an os_task or monitor.
- (function_prologue): Set monitor and/or os_task as needed. Handle
- os_task and monitor functions.
- (function_epilogue): Clear monitor and os_task. Handle os_task and
- monitor functions.
- (h8300_valid_machine_decl_attribute): Accept "OS_Task" and
- "monitor".
-
-Thu Jun 6 20:01:54 1996 Per Bothner <bothner@cygnus.com>
-
- * gen-protos.c (progname): New variable (needed by cppalloc.c).
- (main): Set progname.
-
- * cpplib.h (struct parse_file): Removed.
- (CPP_FATAL_LIMIT, CPP_FATAL_ERRORS, CPP_OUT_BUFFER): New macros.
- * cpphash.c (cpp_lookup): Change struct parse_file -> cpp_reader.
-
- * cpplib.c (init_parse_option): Renamed to cpp_options_init.
- (push_parse_file): Renamed to ...
- (cpp_start_read): Change to return 1 on success, 0 on failure.
- (init_parse_file): Renamed to cpp_reader_init.
- * cppmain.c (main): Use CPP_SET_WRITTEN and cpp_fatal.
- Use renamed function names, and return protocols.
- * fix-header.c (read_scan_file): Likewise.
-
- * cpperror.c (cpp_message): Generalize for "fatal" errors.
- (cpp_fatal): New function (just calls cpp_message).
- * cpplib.c (cpp_start_read, cpp_handle_options, cpp_finish,
- parse_goto_mark, parse_move_mark): Use cpp_fatal rather than fatal.
-
- * fix-header.c (check_macro_names): Fix struct parse_file->cpp_reader.
- * cpplib.c (newline_fix): Remove unused function.
-
-Thu Jun 6 19:47:26 1996 Jim Wilson <wilson@cygnus.com>
-
- Changes to support parameters and return values in multiple
- non-contiguous locations.
- * calls.c (expand_call): Handle NIL in PARALLEL. Handle PARALLEL
- parameter in REG. Handle PARALLEL return value in VALREG.
- (emit_library_call, emit_library_call_value): Abort for PARALLEL.
- (store_one_arg): Delete code for handling EXPR_LIST.
- * expr.c (emit_group_load, emit_group_store): New functions.
- (use_group_regs): New function.
- (emit_push_insn): Handle PARALLEL parameter in REG.
- (expand_assignment): Handle PARALLEL to_rtx.
- (store_expr): Handle PARALLEL target.
- * expr.h (emit_group_load, emit_group_store, use_group_regs): New
- declarations.
- * function.c (assign_parms): Handle PARALLEL parameter in ENTRY_PARM.
- * stmt.c (expand_value_return): Handle PARALLEL return_reg.
-
- * mips/abi64.h (TYPE_DEPENDENT_REG): Delete.
- * mips.c (function_arg): Return PARALLEL for structure with
- aligned double fields.
- (type_dependent_reg): Delete.
- (mips_function_value): Return PARALLEL for structure
- with two floating point fields.
- * mips/mips.md (call_value): Handle PARALLEL in operands[0].
- (call_value_multiple_internal2): New pattern.
- * pa.h (FUNCTION_ARG): General PARALLEL instead of EXPR_LIST.
- * rs6000.c (init_cumulative_args): Change EXPR_LIST to PARALLEL
- in comments.
- (function_arg): Generate PARALLEL instead of EXPR_LIST.
-
-Thu Jun 6 18:21:27 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * function.c (assign_parms): Tighten up code that makes REG_EQUIV
- notes for parms.
-
- * fold-const.c (fold): Don't do anything with evaluated SAVE_EXPR.
-
-Thu Jun 6 17:54:07 1996 J.T. Conklin <jtc@cygnus.com>
-
- * m68k.h (TARGET_SWITCHES): Group all floating point options.
- When an fp option is selected, unset bits used for other mutually
- exclusive fp options.
- (OVERRIDE_OPTIONS): Remove special case for SUPPORT_SUN_FPA;
- bits used for 68881 and SKY are now cleared by TARGET_SWITCHES.
-
- * m68k.md (movsi_const0, movhi): Favor clr with TARGET_5200.
- (add[qhs]3): Don't use two addqw/subqw insns to add small integers to
- an address register with TARGET_68060.
- (stack push peephole): Use moveq.l with TARGET_5200 (when appropriate).
-
- * m68k.h (MASK_5200, TARGET_5200): New macros.
- (TARGET_SWITCHES): Add "m5200".
- (LEGITIMATE_INDEX_P): Add TARGET_5200 to conditional expression.
- * m68k.c (const_method): Do not synthesize long constants
- with byte or word operations with TARGET_5200.
- * m68k.md: Disable byte and word arithmetic, rotate, integer
- divide, dbcc, etc. insns for TARGET_5200.
- * m68k-none.h: (CPU_FPU_SPEC, CPP_SPEC, ASM_SPEC): Support m5200.
-
-Thu Jun 6 17:32:32 1996 Paul Eggert <eggert@twinsun.com>
-
- * fixproto (subdirs): Work around Solaris 2.5
- /usr/xpgr/bin/sed problem with \+\+.
-
-Thu Jun 6 15:06:27 1996 Jim Wilson <wilson@cygnus.com>
-
- * c-decl.c (grokdeclarator): Call pop_obstacks after creating
- TYPE_DECL.
-
- * loop.c (strength_reduce): If HAVE_cc0 defined, disable auto_inc_opt
- if it would put an insn between a cc0 setter/user pair.
-
-Thu Jun 6 13:06:54 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (LIBGCC2_WORDS_BIG_ENDIAN): If __sun__ is
- defined, treat that as little endian.
-
-Wed Jun 5 20:04:53 1996 Jim Wilson <wilson@cygnus.com>
-
- * i960.h (ROUND_TYPE_ALIGN): Add check for TYPE_PACKED.
-
- * sh.h (SHORT_IMMEDIATES_SIGN_EXTEND): Define.
- * sh.md (branch_true): Add comment about T-bit compares.
-
-Tue Jun 4 23:08:34 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * cpplib.h, cpplib.c: Remove support for !STATIC_BUFFERS.
- * cpplib.h: Use unsigned char rather than U_CHAR.
- * cpplib.h (cpp_reader): Add destructor #ifdef __cplusplus.
- (cpp_cleanup): New prototype.
- * cpplib.c (special_symbol, do_once, do_include, cpp_get_token):
- Compare cpp_buffer against CPP_NULL_BUFFER, not NULL.
-
- * cpplib.c (dump_special_to_buffer): New function.
- (initialize_builtins): Use it.
-
-Wed Jun 5 19:10:22 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa/pa.h (TEXT_SPACE_P): Fix thinko in last change.
-
-Wed Jun 5 16:25:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (ASM_DEFAULT_SPEC): Default to "", not -mpwr.
-
- * sysv4.h (SUBTARGET_SWITCHES): Add -mshlib.
- (LINK_PATH_SPEC): Add -compat-bsd support from Solaris.
- (LINK_SPEC): Eliminate %{b} and %{G}, since they conflict with GCC
- switches. Defer shared library support to LINK_SHLIB_SPEC. Defer
- target selection to LINK_TARGET_SPEC.
- (LINK_SHLIB_SPEC): Provide two different versions, depending on
- whether shared libraries are default or not. Make shared
- libraries not default until linker is fixed.
- (LINK_OS_*_SPEC): New specs for OS specific linker switches.
- (SUBTARGET_EXTRA_SPECS): Add new specs.
-
- * {sol2,sysv4}.h (LINK_SPEC): Move Solaris link into general link spec.
-
- * {sysv4,sysv4le,eabile}.h (LINK_TARGET_SPEC): Only pass -oformat
- to the linker if the user is changing the default endian format.
-
- * {sol2,linux,eabisim,eabilesim}.h (LINK_OS_DEFAULT_SPEC): Define
- to use the appropriate OS link spec.
-
-Wed Jun 5 16:35:10 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ginclude/stddef.h: Fix typo: TYPE_ptrdiff_t to _TYPE_ptrdiff_t.
-
-Wed Jun 5 15:52:57 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * varasm.c (output_constructor): Handle RANGE_EXPR in array index.
-
-Wed Jun 5 13:45:54 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * sparc.md (*call_{address,symbolic}_struct_value_sp32): Allow
- operand 2 to be const0_rtx.
-
-Tue Jun 4 16:43:44 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (make_decl_rtl): Don't update DECL_ASSEMBLER_NAME for
- local statics.
-
- * c-decl.c (start_decl): Always set DECL_COMMON on statics.
- * varasm.c (assemble_variable): Only treat vars with DECL_COMMON
- as common.
-
-Tue Jun 4 14:55:49 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.c (reloc_needed): New function.
- * pa.h (TEXT_SPACE_P): Variables/constants with initializers
- requiring relocs never live in the text space.
-
-Tue Jun 4 14:10:46 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * sh.c (fp_zero_operand): Do not accept minus zero.
-
- * sh.h (ASM_OUTPUT_LOOP_ALIGN): Define.
- (ASM_OUTPUT_ALIGN_CODE): Define.
- (ADJUST_INSN_LENGTH): Add in bytes that may be added by
- alignment.
- * sh.c (output_branch): Run ADJUST_INSN_LENGTH in reverse to get
- correct length. Just call abort rather than returning "bad".
- (find_barrier): Adjust limits for possible alignment.
-
-Tue Jun 4 09:35:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/t-solaris: New target config file for PowerPC Solaris
- without gas.
-
- * rs6000/t-ppc: Eliminate all multilib varients except for
- software floating point.
-
- * configure (powerpcle-*-solaris*): If not --with-gnu-as, use
- t-solaris, not t-ppc.
-
- * rs6000/sol2.h (MULTILIB_DEFAULTS): Add correct defaults for
- Solaris.
-
- * rs6000/sysv4.h (ASM_OUTPUT_SECTION_NAME): Clone from svr4.h, omit
- @progbits, since Solaris assembler doesn't like it.
- (LIB_SOLARIS_SPEC): If -msolaris-cclib, add libabi.a.
- ({START,END}FILE_SOLARIS_SPEC): If -msolaris-cclib, use explicit
- pathnames for the Solaris compiler start/end files.
- (ASM_SPEC): Pass -mno-regnames to the assembler.
-
-Mon Jun 3 19:40:10 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips/abi64.h (CPP_SPEC): Make -mabi=n32 the default.
- * mips/iris6.h (MIPS_ISA_DEFAULT, MIPS_ABI_DEFAULT, MULTILIB_DEFAULTS,
- ASM_SPEC, STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): Likewise.
- * mips.md (tablejump_internal4+1): Fix typo in condition.
- * mips/x-iris6 (CC, OLDCC): Define to be `cc -32'.
-
-Mon Jun 3 07:57:35 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.def ([LR]SHIFT_EXPR): Remove `a' from printed names.
-
- * sparc.md (call): Mask unimp operand to 12 bits, just like Sun.
-
- * expr.c (store_field): Fix typo in last change; update TARGET addr.
-
- * c-decl.c (start_struct): Set TYPE_PACKED from flag_pack_struct.
- (start_enum): Likewise but from flag_short_enums.
- (finish_enum): Test TYPE_PACKED, not flag_short_enums.
- * stor-layout.c (layout_decl): Test DECL_PACKED and TYPE_PACKED
- instead of flag_pack_struct.
- (layout_record): Likewise.
-
-Sun Jun 2 19:41:14 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips.md (tablejump_internal3, tablejump_internal4): New patterns.
- (tablejump): Use them for PIC code.
-
-Fri May 31 17:26:53 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.c (ix86_expand_epilogue): Don't generate references to an
- exposed vacated stack.
- * i386.md (epilogue_set_stack_ptr): New.
-
-Fri May 31 15:07:49 1996 Jim Wilson <wilson@cygnus.com>
-
- * mips/abi64.h: Add -mabi=n32 support.
- (ABI_64BIT): Delete.
- (TARGET_LONG64, CPP_SPEC, STACK_BOUNDARY, MIPS_STACK_ALIGN,
- GP_ARG_LAST, FP_ARG_LAST, SUBTARGET_CONDITIONAL_REGISTER_USAGE,
- MAX_ARGS_IN_REGISTER, FUNCTION_ARG_PADDING, RETURN_IN_MEMORY,
- SETUP_INCOMING_VARARGS): Modify.
- (REG_PARM_STACK_SPACE): Ifdef out.
- (TARGET_DEFAULT, SUBTARGET_TARGET_OPTIONS): Define.
- * mips/iris6.h: Add -mabi=n32 support.
- (TARGET_DEFAULT, ASM_OUTPUT_INTERNAL_LABEL,
- ASM_GENERATE_INTERNAL_LABEL): Delete.
- (MULTILIB_DEFAULTS, ASM_SPEC, EXTRA_SECTION_FUNCTIONS,
- ASM_OUTPUT_ALIGNED_LOCAL, STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC):
- Modify.
- (MIPS_ABI_DEFAULT, LOCAL_LABEL_PREFIX): Define.
- * mips.c: Add -mabi=n32 support.
- (mips_const_double_ok, mips_move_1word, mips_move_2words,
- function_arg, override_options, mips_asm_file_start,
- compute_frame_size, save_restore_insns, function_prologue,
- mips_expand_prologue, function_epilogue, mips_function_value): Modify.
- (mips_abi, mips_abi_string): Define
- * mips.h: Add -mabi=n32 support.
- (ABI_64BIT): Delete.
- (TARGET_OPTIONS, INITIAL_ELIMINATION_OFFSET, GO_IF_LEGITIMATE_ADDRESS,
- CONSTANT_ADDRESS_P, LEGITIMATE_CONSTANT_P, LEGITIMIZE_ADDRESS,
- ASM_OUTPUT_ADDR_DIFF_ELT): Modify.
- (enum mips_abi_type, SUBTARGET_TARGET_OPTIONS): Define.
- (mips_abi, mips_abi_string): Declare.
- * mips.md (jump, tablejump_internal1, tablejump_internal2): Add
- -mabi=n32 support.
- * mips/t-iris6 (MULTILIB_OPTIONS): Add -mabi=n32 support.
- * mips/xm-irix6.h (HOST_BITS_PER_LONG): Use _MIPS_SZLONG not 64.
- * ginclude/va-mips.h (va_start): Add -mabi=n32 support.
-
-Fri May 31 14:45:30 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -msolaris-cclib to use
- the Sun compiler's crt files instead of ours.
- ({START,END}FILE_SOLARIS_SPEC): If -msolaris-cclib, use the Sun
- compiler's crt files instead of ours.
- (SUBTARGET_OVERRIDE_OPTIONS): Don't set -msdata=data for Solaris.
- (SBSS_SECTION_ASM_OP): For Solaris, don't use @nobits.
- (CPP_OS_SOLARIS_SPEC): Remove -Asystem(unix) and -Asystem(svr4).
-
- * rs6000/t-ppc{,gas} (MULTILIB*): Add Solaris specific multilibs.
-
- * rs6000/eabi{,le}sim.h (*_DEFAULT_SPEC): Rather than using
- duplicate definitions, just use %(...) so that there is only one
- place in the specs file where the switches are defined.
- * rs6000/{linux,sol2}.h (*_DEFAULT_SPEC): Ditto.
-
- * rs6000/sol2.h (CPP_PREDEFINES): Use the standard one in sysv4.h.
- (RS6000_ABI_NAME): Default is solaris.
- (ASM_OUTPUT_ALIGNED_LOCAL): Don't redefine.
-
- * rs6000/sol-c{i.asm,n.asm,c0.c}: Provide more things that Solaris
- needs for program startup.
-
-Thu May 30 21:57:34 1996 Mike Stump <mrs@cygnus.com>
-
- * tree.def (OFFSET_REF): Remove.
- * expr.c (expand_expr, case OFFSET_REF): Likewise.
- * tree.c (substitute_in_expr): Remove OFFSET_REF code.
-
-Wed May 29 14:54:44 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/eabi.asm (__eabi): If not -mrelocatable, don't assemble
- relocatable functions, so that it can be assembled with the
- Solaris assembler.
-
- * rs6000/sysv4.h (CPP_SYSV_SPEC): Define _RELOCATABLE if
- -mrelocatable-lib as well as -mrelocatable.
-
- * rs6000.c (rs6000_file_start): New function to print some more
- information to the asm file.
- * rs6000/{sysv4,win-nt,rs6000}.h (ASM_FILE_START): Call it.
-
-Tue May 28 15:21:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.h (FIRST_PSEUDO_REGISTER): Bump to 77.
- ({FIXED,CALL_USED}_REGISTERS): Add support for fpmem pseudo register.
- (REG_ALLOC_ORDER, HARD_REGNO_{NREGS,MODE_OK}): Likewise.
- (REGISTER_MOVE_COST, reg_class, REG_CLASS_{NAMES,CONTENTS}): Likewise.
- (REGNO_REG_CLASS, PREFERRED_RELOAD_CLASS): Likewise.
- (CLASS_{MAX_NREGS,CANNOT_CHANGE_SIZE,MAX_NREGS}): Likewise.
- (rs6000_stack, {,DEBUG_}REGISTER_NAMES): Ditto.
- (FPMEM_{REGNO_P,REGNUM}): New macros for fpmem register.
- (rs6000_fpmem_{offset,size}): New global variables.
- (RS6000_VARARGS_OFFSET): Fpmem temporary storage is located
- between outgoing arg area and varargs save area.
- (STARTING_FRAME_OFFSET, STACK_DYNAMIC_OFFSET): Likewise.
- (PREDICATE_CODES): Add fpmem_operand.
- ({count_register,fpmem}_operand): Add declarations.
-
- * rs6000.c ({rs6000,alt}_reg_names): Add support for fpmem 'register'.
- (rs6000_fpmem_{offset,size}): New global variables.
- (fpmem_operand): Return true for fpmem registers.
- (gpc_reg_operand): The fpmem register is not general purpose.
- (includes_rshift_p): Add casts to silence warnings from Solaris
- PowerPC host compiler.
- (print_operand): Add 'v' operand type for the upper 16 bits of
- signed constants, to placate the Solaris assembler.
- ({rs6000,debug}_stack_info): Add support for fpmem 'register'.
- (output_epilog): Likewise.
-
- * rs6000.md (addsi3,movsi,movsf,movdi): Use %v for constants with
- the upper 16 bits, to get the sign correct for PowerPC Solaris.
- (float{,uns}sidf2,fix_truncdfsi2): Rewrite to use 'register' 76
- for the memory location used to convert between float and integer.
-
- * sysv4.h (ASM_OUTPUT_{CON,DE}STRUCTOR): Use code laid down in
- .init and .fini for making constructors and destructors under
- Solaris.
- (ASM_SPEC): Do not pass -u to the assembler.
- (CC1_SPEC): -mrelocatable implies -meabi.
-
- * sol2.h (RS6000_ABI_NAME): Default ABI is Solaris, not System V.4.
- (ASM_OUTPUT_ALIGNED_LOCAL): Don't define Solaris specific method.
-
-Mon May 27 06:39:13 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (expand_builtin, case BUILT_IN_{LONG,SET}JMP):
- Convert block address from ptr_mode to Pmode.
-
-Sun May 26 20:05:43 1996 Doug Evans <dje@cygnus.com>
-
- * gcc.c (MSDOS pexecute): Call xmalloc, not malloc.
-
-Sun May 26 08:31:54 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure (vax-*-{sysv}): tm_file and xm_file now list.
- (vax-*-ultrix): tm_file is now list.
- (we32k-att-sysv*): xm_file now list.
- * vax/xm-netbsd.h: Deleted.
- * vax/netbsd.h: No longer include vax.h and config/netbsd.h.
- * vax/ultrix.h, vax/vaxv.h: No longer include vax.h.
- * vax/xm-vaxv.h: No longer include xm-vax.h.
- * xm-we32k.h: No longer include xm-svr3.h.
-
- * configure: Separately set target_cpu_default for two
- case statements and then combine if both set.
- (alpha-*-winnt3): tm_file and xm_file are now list.
- Set target_cpu_default to 64.
- * winnt/config-nt.bat: Make .h files properly for Alpha.
- * alpha.h (WINDOWS_NT): No longer defined and used.
- (MASK_WINDOWS_NT, TARGET_WINDOWS_NT): New macros.
- (ASM_OUTPUT_ADDR_DIFF_ELT): Use TARGET_WINDOWS_NT.
- * alpha.c (output_prolog): Test TARGET_WINDOWS_NT, not WINDOWS_NT.
- * alpha.md: Likewise.
- * alpha/config-nt.sed: Properly set tm_file and {build,host}_xm_file.
- * alpha/win-nt.h: Don't include alpha.h
- (WINDOWS_NT): No longer define.
- * alpha/xm-winnt.h: Don't include xm-alpha.h and winnt/xm-winnt.h.
-
-Fri May 24 12:34:22 1996 Doug Evans <dje@seba.cygnus.com>
-
- * configure (cpu_type): Add case for arm.
- (sparclet-*-aout*): Delete extra_headers.
-
- * varasm.c (asm_output_bss): New argument DECL.
- Use ASM_DECLARE_OBJECT_NAME if defined.
- (asm_output_aligned_bss): Likewise.
- (assemble_variable): Pass DECL to ASM_OUTPUT{,_ALIGNED}_BSS.
- * arm/aout.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * h8300.h (ASM_OUTPUT_BSS): Update.
- * i386/linux.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * i386/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * m68k/coff.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * m68k/linux.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * m68k/m68k-aout.h (ASM_OUTPUT_BSS): Update.
- * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * rs6000/win-nt.h (ASM_OUTPUT_ALIGNED_BSS): Update.
- * sparc/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Update.
-
-Thu May 23 19:55:52 1996 Jim Wilson <wilson@cygnus.com>
-
- * combine.c (set_nonzero_bits_and_sign_copies): Set reg_sign_bit_copies
- to one not zero to indicate value is unknown.
-
-Thu May 23 18:39:24 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * config/netbsd.h (SWITCH_TAKES_ARG): Add -R.
- (LINK_SPEC): Add %{R*}.
-
- * m68k/lb1sf68.asm: Construct exception masks at compile time
- instead of or'ing in bits at run time.
-
-Thu May 23 15:53:06 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * sh.md: Add new instruction types fp and fpdiv. Set new
- instruction types where appropriate. Add function unit fp.
- Claim that store instructions use function unit memory.
-
-Thu May 23 00:36:19 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.h (CONSTANT_ADDRESS_P): Don't accept CONST or HIGH on H8/300H.
- * h8300.md: Use "m" rather than "o" constraint everywhere appropriate.
- Cleanup use of "i" and "n" constraints.
-
-Wed May 22 17:43:37 1996 Jim Wilson <wilson@cygnus.com>
-
- * fixincludes (pthread.h): Add extern to __page_size* declarations
- for AIX 4.1.x.
-
- * combine.c (nonzero_bits): Don't assume arg pointer has same
- alignment as stack pointer.
-
-Wed May 22 16:09:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (LINK_START_DEFAULT_SPEC): Spell macro correctly.
- (LIB_DEFAULT_SPEC): Provide default version.
-
-Wed May 22 11:23:57 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * i386.md (return_pop_internal): new pattern.
- (pop): disable emitting of bogus move instruction.
- * i386.c (ix86_expand_epilogue): use gen_return_pop_internal to
- simultanously return and pop args; removed stray semicolon.
- * config/linux-aout.h, config/linux.h (SET_ASM_OP): Added for
- __attribute__ ((alias ())) support.
-
-Wed May 22 08:06:42 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu.edu>
-
- * combine.c (init_reg_last_arrays, setup_incoming_promotions):
- Correct prototypes.
-
-Tue May 21 13:42:17 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.md (div and mode patterns): Rewrite.
-
- * pa.c (basereg_operand): Never accept a CONST_INT.
-
-Tue May 21 12:26:40 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * pa/pa-hpux9.h, pa-osf.h (LINK_SPEC): Provide version for Snake.
-
-Tue May 21 07:20:48 1996 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax.h (TARGET_NAME): Define unless already defined.
- (TARGET_VERSION): Print TARGET_NAME.
- * vax/vms.h (TARGET_NAME): Always redefine.
- (TARGET_VERSION): Delete; retain vax.h definition.
-
-Mon May 20 14:00:44 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.c (output_file_start): Delete misplaced semicolon.
-
-Mon May 20 11:58:15 1996 Jeffrey A. Law <law@cygnus.com>
-
- * reorg.c (relax_delay_slots): Call update_block before
- redirecting a branch past a redundant insn.
-
-Sun May 19 16:40:53 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * Makefile.in (libobjc.a, sublibobjc.a): 'specs' added to
- dependencies.
-
-Sun May 19 12:25:48 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure: Add new switch to provide default for cpu_type;
- delete numerous settings of it in main switch.
- (hppa): Reflect rerrangements below; use new configure features.
- * pa/pa-gas.h, pa/pa-pro-end.h: New files.
- * pa/pa1.h, pa/pa1-osf.h, pa/pa1-ghpux.h, pa/pa1-oldas.h: Deleted.
- * pa/pa1-ghpux9.h, pa/pa1-hpux9.h, pa/pa1-hpux.h: Deleted.
- * pa/pa1-ghiux.h, pa/pa1-hiux.h, pa/pa-ghpux.h: Deleted.
- * pa/pa-gux7.h, pa/pa-ghiux.h: Deleted.
- * pa/pa-hiux.h: No longer include pa-hpux.h.
- * pa/pa-hpux.h: No longer include pa.h.
- (TARGET_DEFAULT): Unset before setting.
- (LINK_SPEC): Provide option for pa1.
- * pa/pa-hpux7.h: No longer include pa.h.
- (HP_FP_ARG_DESCRIPTOR_REVERSED): Don't define here.
- * pa/pa-hpux9.h, pa/pa-oldas.h: No longer include pa-hpux.h.
- (TARGET_DEFAULT): Don't need to set here.
- * pa/pa-osf.h: No longer include pa.h.
- (TARGET_DEFAULT): Don't define; identical to default.
- * pa/pa-pro.h: No longer include pa.h.
- Move definitions after include to new file pa-pro-end.h.
- * pa.h (TARGET_SWITCHES): Include TARGET_CPU_DEFAULT.
- (TARGET_CPU_DEFAULT): Provide default value.
- (CPP_SPEC): Test TARGET_CPU_DEFAULT too.
-
- * Makefile.in (function.o): Includes bc-emit.h.
- (reg-stack.o): Includes insn-flags.h.
- * expr.h (function_value): Deleted; no such function.
- (bc_build_calldesc, bc_runtime_type_code): New declarations.
- * c-decl.c: Add prototypes for all static functions.
- * c-iterate.c: Likewise.
- * dbxout.c: Likewise.
- (adspath): Delete; never used and has numerous parse errors.
- * dwarfout.c: If not GNUC, make `inline' null; otherwise, leave alone.
- Add `static' to inline functions.
- Add prototypes for static function.
- * expr.c (bc_runtime_type_code): Delete redundant declaration.
- * function.c: Include bc-emit.h.
- ({save,restore}_machine_status): Add prototype for args.
- (bc_runtime_type_code, bc_build_calldesc): Delete redundant decls.
- (bc_emit_trampoline, bc_end_function): Likewise.
- * reg-stack.c: Include insn-flags.h.
- Add prototypes for static functions.
- (gen_jump, gen_movdf, gen_movxf): Delete redundant declarations.
- (find_regno_note, emit_jump_insn_before, emit_label_after): Likewise.
- (swap_rtx_condition): Now static.
- * sdbout.c: Add prototypes for static functions.
- (sdbout_parms, sdbout_reg_parms): Delete extra parm to plain_type.
-
-Sun May 19 11:50:10 1996 John Carr <jfc@mit.edu>
-
- * alpha.c (alpha_emit_conditional_move): Compare to 0 in correct mode.
-
-Sat May 18 20:17:27 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.c (prepare_move_operands): If source is r0, and dest is reg+reg
- MEM, then copy source to a pseudo-reg.
- * sh.md (untyped_call): New pattern.
-
- * unroll.c (copy_loop_body): When update split DEST_ADDR giv,
- check to make sure it was split.
- (find_splittable_givs): Fix reversed test of verify_addresses result.
-
-Sat May 18 10:26:04 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * tree.c (unsave_expr_now): Avoid use of NULL_RTX since no rtl.h.
-
- * configure: Set cpu_default, tm_file, and xm_file early.
- Remove redundant settings of those, tmake_file, and xmake_file.
- Use ${tm_file} and ${xm_file} to refer to the main files.
- Sort some entries for consistency and reformat some others.
- (rs6000, powerpc): Remove bogus test on host == target.
- (alpha-*-linux): xm-linux.h no longer includes xm-alpha.
- (alpha-*-osf*): Remove redundant setting of target_cpu_default.
- (*-convex-*): Use target_cpu_default instead of separate .h files.
- (clipper-intergraph-clix*): clix.h no longer includes any files.
- (i860, i960, pdp11): Reflect removal of includes listed below.
- * alpha/xm-linux.h: No longer include xm-alpha.h.
- * clipper/clix.h: No longer include clipper.h and svr3.h.
- * convex.h: Provide a default for TARGET_DEFAULT.
- Take "or" of TARGET_DEFAULT and TARGET_CPU_DEFAULT everywhere.
- * convex/convex{1,2,32,34,38}.h: Deleted.
- * i860/bsd-gas.h: No longer include bsd.h.
- * i860/bsd.h: No longer include i860.h.
- * i860/fx2800.h: No longer include i860/sysv4.h.
- (OUTPUT_TDESC): No longer define.
- (ASM_FILE_END): Move redefinition to here.
- * i860/mach.h: No longer include i860.h.
- * i860/paragon.h, i860/sysv3.h: No longer include i860.h and svr3.h.
- * i860/sysv4.h: No longer include i860.h and svr4.h.
- (ASM_FILE_END): Delete redefinition from here.
- * i860/xm-fx2800.h: No longer include xm-i860.h.
- * i860/xm-paragon.h, i860/xm-sysv{3,4}.h: Deleted.
- * i960/i960-coff.h: No longer include i960.h and dbxcoff.h.
- * i960/vx960-coff.h: No longer include i960-coff.h.
- * i960/vx960.h: No longer include i960.h.
- * pdp11/2bsd.h: No longer include pdp11.h.
-
- * i370/i370.h: Renamed from mvs.h.
- * i370/i370.c: Renamed from mvs370.c.
- * i370/t-i370: Renamed from t-mvs.
- * i370/xm-i370.h: Renamed from xm-mvs.h.
- * configure (i370-*-mvs*): Use default names for all files.
-
- * c-parse.in: Update number of shift/reduce conflicts for objc.
-
-Sat May 18 08:20:17 1996 Dennis Glatting (dennisg@plaintalk.bellevue.wa.us)
-
- * m68k/next.h (FINALIZE_TRAMPOLINE): Add missing backslashes.
-
-Fri May 17 19:57:20 1996 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax/xm-vms.h (dbxout_resume_previous_source_file): New macro.
-
-Fri May 17 14:20:13 1996 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_expr, cond TARGET_EXPR): Make TARGET_EXPRs
- redoable for UNSAVE_EXPR.
- * stmt.c (expand_decl_cleanup): Wrap the cleanup in an UNSAVE_EXPR
- to that we can redo it.
- * tree.c (unsave_expr_now): Handle TARGET_EXPRs fully now.
- * tree.def (TARGET_EXPR): Add a fourth field so that TARGET_EXPRs
- are redoable.
-
- * expr.c (expand_expr, cond UNSAVE_EXPR): Move from the C++
- frontend to the backend where it belongs.
- * tree.c (unsave_expr{,_now}): Likewise.
- * tree.def (UNSAVE_EXPR): Likewise.
- * tree.h (unsave_expr{,_now}): Likewise.
-
-Fri May 17 15:04:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (lshrsi3 insns): Add special case code for shifting by
- 0 to avoid bad code generated with no optimization.
-
-Fri May 17 13:50:55 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386/unix.h (ASM_OUTPUT_MI_THUNK): Define.
- * i386/{att.h,bsd.h,sun386.h} (ASM_OUTPUT_MI_THUNK): Delete.
-
-Fri May 17 13:34:28 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fp-bit.c (_fpdiv_parts): Correct sign handling when
- dividing zero or infinity by something.
-
-Fri May 17 12:36:36 1996 Doug Evans <dje@seba.cygnus.com>
-
- Standardize option output in assembler files.
- * Makefile.in (toplev.o): Pass -DTARGET_NAME.
- * arm/aout.h (ASM_OUTPUT_OPTIONS): Delete.
- (ASM_FILE_START): Delete option output support.
- * arm.c (output_option, output_options, m_options): Delete.
- * m88k.c (output_file_start): Delete option output support.
- * m88k.h (ASM_COMMENT_START): Define.
- * mips.c (target_switches, print_options): Delete.
- (mips_asm_file_start): Put output of -G,Cpu,ISA here.
- * mips.h (ASM_COMMENT_START): Change from "\t\t#" to " #".
- * rs6000.c (output_option, m_options, output_options): Delete.
- * rs6000.h (ASM_OUTPUT_OPTIONS): Delete.
- (ASM_COMMENT_START): Define.
- (ASM_FILE_START): Delete option output support.
- * rs6000/sysv4.h (ASM_FILE_START): Likewise.
- * rs6000/win-nt.h (ASM_FILE_START): Likewise. Delete duplicate.
- * sh.c (output_option, m_options, output_options): Delete.
- (output_file_start): Delete option output support.
- * sh.h (ASM_FILE_START): Likewise.
- (ASM_COMMENT_START): Define.
- * dwarfout.c (*): flag_verbose_asm renamed to flag_debug_asm.
- * flags.h (flag_debug_asm): Declare.
- * toplev.c (print_version): New function.
- (print_single_switch): New arguments pos, max, indent, sep, term.
- (print_switch_values): New arguments pos, max, indent, sep, term.
- Update call to print_single_switch. Output options passed and
- options enabled.
- (MAX_LINE): New macro.
- (flag_debug_asm): Define.
- (compile_file): Output options to assembler file.
- (main): Recognize -dA. Call print_version. Update call to
- print_switch_values.
- (line_position): Deleted.
-
-Fri May 17 10:50:44 1996 Stan Cox (coxs@dg-rtp.dg.com)
-
- * i386.c (function_prologue, ix86_expand_prologue,
- function_epilogue, ix86_expand_epilogue): Generate prologue and
- epilogue as RTL (prior to scheduling) instead of emitting asm.
- (override_options): If only -march is given, make it the default -mcpu.
- * i386.h (FUNCTION_BEGIN_EPILOGUE): Renamed from FUNCTION_EPILOGUE.
- * i386.md (return, return_internal, prologue, prologue_set_got,
- prologue_get_pc, epilogue, leave, pop): New patterns for emitting
- asm from prologue and epilogue RTL.
- * m88k/t-dgux (T_CFLAGS): Delete.
- * m88k/x-dgux (X_CFLAGS): New.
-
-Fri May 17 09:54:23 1996 Jim Meyering (meyering@asic.sc.ti.com)
-
- * Makefile.in (stamp-crt{,S}): Use -o to avoid conflicts if
- both of these are built in parallel.
-
-Fri May 17 08:55:19 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expmed.c (store_split_bit_field): Don't assume the alignment
- of VALUE is the same as the record.
-
- * configure: Write #define TARGET_CPU_DEFAULT into tm.h
- instead of defining MAYBE_TARGET_DEFAULT in Makefile.
- (alpha-*-linux): Set target_cpu_default to 4 and xmake_file to none.
- (alpha-*-osf*): Set target_cpu_default to 4 if --gas.
- * Makefile.in (gcc.o, toplev.o, $(out_object_file)):
- Remove MAYBE_TARGET_DEFAULT.
-
- * combine.c (insn_cuid): New function.
- (INSN_CUID): Sometimes call it.
-
-Fri May 17 08:12:37 1996 Scott Christley <scottc@net-community.com>
-
- * objc/sendmsg.c (objc_get_uninstalled_dtable): New function.
- * objc/objc-api.h (objc_get_uninstalled_dtable): New declaration.
-
- * objc/thr-os2.c, objc/thr-posix.c, objc/thr-mach.c: New files.
- * objc/THREADS.MACH: New file.
-
- * objc/sendmsg.c (nil_method): Deleted from here.
- * objc/nil_method.c: New file.
- * Makefile (OBJC_O): Add dependency for nil_method.c.
-
- * objc/hash.c (hash_is_key_in_hash): New function.
- * objc/hash.h: Include objc/objc.h here instead of in objc/hash.c
- to get BOOL typedef.
-
-Fri May 17 08:01:48 1996 Doug Rupp (rupp@gnat.com)
-
- * msdos/configur.bat: If Ada subdirectory present, adjust Makefile.
-
-Fri May 17 07:40:04 1996 Ulrich Drepper (drepper@cygnus.com)
-
- * stddef.h: If need_wint_t defined, nothing in this file is needed.
- (_WINT_T, __WINT__TYPE__, wint_t): Define under certain circumstances.
-
-Thu May 16 18:53:25 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * fold-const.c (fold, case EQ_EXPR): When folding VAR++ = CONST,
- mask the new const if VAR is a bitfield reference; also for VAR--.
-
-Thu May 16 18:29:03 1996 Doug Evans <dje@seba.cygnus.com>
-
- * varasm.c (function_section): Delete flag_function_sections support.
- (assemble_start_function): Put it here. Use UNIQUE_SECTION if defined.
-
-Wed May 15 13:35:11 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.{h,c,md} (rs6000_pic_register): Delete all uses, use
- pic_offset_table_rtx instead.
-
- * rs6000.md (move_to_float): Rewrite so that it uses the register
- allocator to allocate the stack temp, instead of calling
- rs6000_stack_temp.
- (fix_truncdfsi2): Likewise.
-
- * rs6000.c (rs6000_stack_temp): Delete, no longer used.
-
-Wed May 15 10:39:27 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Define.
-
-Sat May 11 07:42:59 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (store_field): Support BLKmode bitfield if aligned on
- byte boundary using emit_block_move.
- (expand_expr, case COMPONENT_REF): Likewise.
-
-Fri May 10 18:33:39 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * configure (alpha-*-linux): Reverse order in tm_file list.
- Delete xmake_file.
- * alpha/x-linux: Deleted.
- * alpha/linux.h (ASM_FINAL_SPEC): Add #undef.
- * alpha/xm-linux.h: Remove bogus trailing #endif.
-
- * loop.c (maybe_eliminate_biv_1): Disable all but two cases
- of biv elimination with givs and restrict those two cases to
- an ADD_VAL that is an address.
-
- * flow.c (mark_set_1, mark_used_regs): Clean up usages
- of ALL_NEEDED; change to SOME_NOT_NEEDED and set properly.
-
-Fri May 10 11:37:38 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * toplev.c (compile_file): Don't warn about artificial functions
- declared static and not defined.
-
-Thu May 9 22:03:28 1996 Doug Evans <dje@cygnus.com>
-
- * varasm.c (assemble_start_function): ASM_DECLARE_FUNCTION_NAME
- needn't consider bytecodes.
- (assemble_variable): ASM_DECLARE_OBJECT_NAME needn't
- consider bytecodes.
- * toplev.c (rest_of_decl_compilation): Likewise with
- ASM_FINISH_DECLARE_OBJECT.
- * arm/aof.h (ASM_DECLARE_{FUNCTION,OBJECT}_NAME): Delete bytecode
- support.
- * vax/vms.h (ASM_DECLARE_OBJECT_NAME): Likewise.
-
-Thu May 9 19:36:13 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.h (SET_ASM_OP): Define.
-
-Thu May 9 13:31:58 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sysv4.h (SUBTARGET_{SWITCHES,OPTIONS}): Add support for
- finer grain control on -msdata, so that eabi people can specify to
- compile sdata code to only use r13 instead of r2/r13. Make
- -mrelocatable-lib turn off -msdata, just like -m relocatable does.
- (SUBTARGET_OVERRIDE_OPTIONS): Ditto.
- (ENCODE_SECTION_INFO): Move to rs6000.c.
- (ASM_SPEC): -msdata=eabi sets -memb also.
- (CC1_SPEC): -mno-sdata gets converted to -msdata=none.
-
- * rs6000.c (rs6000_sdata{,_name}): Add support for finer grain
- control on -msdata.
- (output_options, small_data_operand, print_operand): Likewise.
- (rs6000_select_section): Likewise.
- (rs6000_encode_section_info): Move here from sysv4.h, section
- names are stored as STRING nodes, not IDENTIFIER.
-
-Wed May 8 21:04:49 1996 Doug Evans <dje@cygnus.com>
-
- * function.c (aggregate_value_p): Return 1 if TREE_ADDRESSABLE.
- * pa.h (RETURN_IN_MEMORY): No longer test for TREE_ADDRESSABLE.
-
-Tue May 7 13:42:57 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c: Include obstack.h.
- (bit_memory_operand): New function.
- (print_operand): Append ":16" to a memory reference to
- the tiny data area.
- (h8300_tiny_data_p): New function.
- (h8300_valid_machine_decl_attribute): Accept "tiny_data". Fix typo.
- (h8300_encode_label): New function.
- (h8300_adjust_insn_length): References to the tiny data section
- are two bytes shorter than normal accesses on the H8/300H.
- * h8300.h (OK_FOR_U): Fix thinko.
- (ENCODE_SECTION_INFO): Encode info for tiny data variables.
- (STRIP_NAME_ENCODING): Define.
- * h8300.md (movqi insn): Fix length for a constant load.
- (movstrictqi, movhi, movstricthi): Likewise.
- (memory btst patterns): Add register to the constraints to keep
- reload happy.
-
- * h8300.h (OK_FOR_U): (const (plus (symbol_ref) (const_int)))
- is valid U operand if SYMBOL_REF_FLAG is set on SYMBOL_REF.
- * h8300.md (memory btst patterns): New patterns.
-
- * h8300.c (h8300_eightbit_data_p): Renamed from h8300_tiny_data_p.
- (h8300_eightbit_data_p): Check for the "eightbit_data"
- attribute instead of "tiny_data".
- (h8300_valid_machine_decl_attribute): Likewise.
- * h8300.h (ENCODE_SECTION_INFO): Call h8300_eightbit_data_p
- instead of h8300_tiny_data_p.
-
- * h8300.h (READONLY_DATA_SECTION): Define.
- (EXTRA_SECTIONS): Add in_readonly_data.
- (READONLY_DATA_SECTION_ASM_OP): Define.
- (EXTRA_SECTION_FUNCTINOS): Add readonly_data.
-
-Tue May 7 09:26:24 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * varasm.c (make_decl_rtl): Update DECL_ASSEMBLER_NAME for local
- statics. Remove reference to flag_no_common.
-
-Mon May 6 21:38:36 1996 Paul Eggert <eggert@twinsun.com>
-
- * cpplib.c (skip_comment, handle_directive): Don't use uninit vars.
-
-Mon May 6 18:47:36 1996 Doug Evans <dje@cygnus.com>
-
- * dbxout.c (dbxout_function): When deciding to call dbxout_function_end
- change test from flag_function_sections to DECL_SECTION_NAME != NULL.
-
- * varasm.c (named_section): Accept any decl.
-
-Mon May 6 16:41:08 1996 Stan Cox (coxs@dg-rtp.dg.com)
-
- * final.c (final_scan_insn): Modify conditional moves whose cc is
- nonstandard.
-
- * c-common.c (decl_attributes): Chain multiple attributes correctly.
-
-Mon May 6 15:41:43 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stmt.c (expand_decl): Don't deduce alignment of SIZE from
- DECL_ALIGN; use TYPE_ALIGN instead.
-
- * function.c (assign_parms): Set RTX_UNCHANGING_P in stack_parm
- if parm is read-only.
-
- * c-common.c (truthvalue_conversion, case ADDR_EXPR): Don't
- treat address of external decl as always nonzero.
-
-Mon May 6 11:33:57 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * c-decl.c (start_decl): Check -fno-common here.
- * varasm.c (assemble_variable): Instead of here.
- * final.c (end_final): Likewise.
- * c-common.c (init_attributes, decl_attributes): Add A_COMMON.
-
-Mon May 6 11:12:39 1996 Mike Stump <mrs@cygnus.com>
-
- * expr.c (expand_increment): Add third parameter to know when to
- ignore the result value.
- (store_constructor): Likewise
- (expand_expr, case {PRE,POST}{INC,DEC}REMENT_EXPR): Likewise.
- * tree.c (stabilize_reference): Always ignore the first operand of
- COMPOUND_EXPRs.
-
-Mon May 6 13:14:45 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.c (gen_shifty_op): Truncate VALUE to avoid out of bounds array
- access.
-
- * expr.c (expand_expr, case INDIRECT_REF): Delete obsolete code
- to special case a SAVE_EXPR operand.
-
-Mon May 6 10:00:12 1996 Pat Rankin <rankin@eql.caltech.edu>
-
- * vax.h (ASM_OUTPUT_MI_THUNK): Define.
-
-Mon May 6 09:49:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/linux.h: Use the new trampoline definition.
- (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE): Deleted.
- (INITIALIZE_TRAMPOLINE): Changed.
- (FINALIZE_TRAMPOLINE, CLEAR_INSN_CACHE): New.
-
-Mon May 6 09:43:55 1996 Patrick J. LoPresti (patl@lcs.mit.edu)
-
- * rtlanal.c (rtx_addr_varies_p): Scan operands of type `E'.
-
-Mon May 6 09:04:40 1996 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * x-linux{,-aout} (BOOT_CFLAGS, STMP_FIXPROTO, STMP_FIXPROTO): Deleted.
- * config/t-linux (BOOT_CFLAGS, STMP_FIXPROTO, STMP_FIXPROTO): New,
- moved from x-linux.
- * t-linux-aout: New file.
- * configure (i[3456]86-*-linux*oldld*, i[3456]86-*-linux*aout*):
- Set tmake_file to t-linux-aout.
-
-Sun May 5 22:13:22 1996 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Makefile.in (gxx_include_dir): Change to $(prefix)/include/g++.
- (old_gxx_include_dir): New - defined as $(libdir)/g++-include.
- (cccp.o, cpplib.o): Also pass OLD_GPLUSPLUS_INCLUDE_DIR (set
- from $(old_gxx_include_dir)).
- * cccp.c (include_defaults_array): For C++, also search
- OLD_GPLUSPLUS_INCLUDE_DIR.
- * cpplib.c (default_include): Likewise.
- * configure: Remove no-longer-needed support for --gxx-include-dir.
-
-Sun May 5 21:59:53 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-lex.c (check_newline): Fix #pragma parsing; issue error message
- for directive that starts with `p' but isn't `pragma'.
-
-Sun May 5 13:13:40 1996 Jeremy Bettis <jeremy@hksys.com>
-
- * objc/hash.c (hash_value_for_key): Prevent endless loop when 0 was
- stored in a hashtable.
-
-Sun May 5 13:09:54 1996 Satoshi Adachi (adachi@wisdom.aa.ap.titech.ac.jp)
-
- * m68k/newsgas.h (SET_ASM_OP, ASM_WEAKEN_LABEL): Define.
-
-Sun May 5 12:48:08 1996 Stephen L Moshier (moshier@world.std.com)
-
- * tree.c (build_real_from_int_cst): Remove spurious test for
- REAL_IS_NOT_DOUBLE.
-
-Sat May 4 12:17:58 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * arm.h (ASM_OUTPUT_MI_THUNK): Moved here from aout.h. Rewrite to be
- independent of the selected assembler, and to use optimal number of
- instructions.
- * arm/aout.h (ASM_OUTPUT_MI_THUNK): Delete.
-
- * arm/aout.h (ASM_OUTPUT_OPTIONS): Define.
- (ASM_FILE_START): Call ASM_OUTPUT_OPTIONS.
- (BSS_SECTION_OP): Define.
- (ASM_OUTPUT_ALIGN): Don't output anything if byte alignment is wanted.
- (ASM_OUTPUT_ALIGNED_BSS): Define.
- * arm.h (target_cpu_name): Delete.
- (TARGET_SWITCHES): Delete "be" and "le".
- (TARGET_OPTIONS): Delete "cpu-", add "tune=".
- (struct arm_cpu_select): New struct.
- (PROCESSOR_DEFAULT, TARGET_CPU_DEFAULT): Define.
- (EXTRA_CC_MODES, EXTRA_CC_NAMES): Add CC_Cmode.
- (CANONICALIZE_COMPARISON): Define.
- * arm.c (arm_select): Declare and initialize.
- (all_procs): Add arm7100.
- (arm_override_options): Parse arm_select structure to determine
- selected architecture and tuning parameters.
- (output_option, output_options): New functions.
- (arm_canonicalize_comparison): New function.
- (arm_gen_movstrqi): Don't add a writeback of the index registers for
- the last instructions.
- (arm_select_cc_mode): Detect case where mode is carry out of unsigned
- arithmetic.
- (output_lcomm_directive): Use bss_section (), and use alignment
- rather than rounding.
- (get_arm_condition_code): Handle CC_Cmode.
- (final_prescan_insn): Avoid boundary case where we would occasionally
- inline MAX_INSNS_SKIPPED+1 insns. Allow call_insns to be inlined in
- APCS_32 mode if they are the last insn in the block.
- * arm.md (*addsi3_compareneg): Delete potentially unsafe insn.
- (*addsi3_compare_op[12]): New insns.
- (*compare_addsi2_op[01]): New insns.
- (*addsi3_carryin, *addsi3_carryin_alt[12]): New insns.
- (*cmp_ite1): Use arm_add_operand instead of arm_rhs_operand.
- * semi.h (PROCESSOR_DEFAULT): Default to PROCESSOR_ARM6.
-
-Fri May 3 10:52:11 1996 1996 Stan Cox (coxs@dg-rtp.dg.com)
-
- * i386.md (movesicc, movehicc) Pentium Pro conditional move insns.
-
- * i386.h (TARGET_PENTIUMPRO, TARGET_CMOVE, BRANCH_COST,
- ASM_OUTPUT_FUNCTION_PREFIX): New macros for conditional move.
-
- * i386.c (asm_output_function_prefix, function_prologue): Setup
- pic on Pentium Pro so a return will match the call.
- (print_operand, put_condition_code): Output conditional move suffixes.
-
-Fri May 3 10:52:11 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386/{att.h,gas.h,bsd.h,sub386.h} (ASM_OUTPUT_MI_THUNK): Define.
-
-Wed May 1 17:54:51 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.h (ASM_OUTPUT_MI_THUNK): Fix for sparc64, optimize.
-
-Wed May 1 13:28:32 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * i386/linux.h (ASM_OUTPUT_ALIGNED_BSS): Define.
- * i386/sysv4.h: Likewise.
- * sparc/sysv4.h: Likewise.
-
-Wed May 1 01:44:47 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (h8300_adjust_insn_length): Adjust the cost of
- shifts by small constant values.
- * h8300.md: Remove names from many patterns which don't need them.
- (compare insns): Don't underestimate lengths.
- (andqi3 expander): Remove constrains.
- (andhi3): Don't underestimate length.
- (andsi3): Don't underestimate length. Improve code when upper
- or lower half of destination is being cleared.
- (indirect_jump_h8300, indirect_jump_h8300h): Simplify.
- (shift insns): Remove useless "I" constraint.
-
- * h8300.md (bcs type): Remove "bcs" type attribute and all references.
- (bcs insns): Delete. No longer needed.
- (setcc from bitfield): Rewrite to use zero_extract. Provide
- QImode, HImode and SImode variants.
-
-Tue Apr 30 18:13:09 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * svr4.h (SELECT_SECTION): If RELOC is true, put it in data.
-
-Tue Apr 30 17:26:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * fold-const.c (fold): Don't call convert to recreate tree nodes
- we already have.
-
-Tue Apr 30 16:52:41 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (one_insn_adds_subs_operand): New function.
- (h8300_adjust_insn_length): New function.
- * h8300.h (ADJUST_INSN_LENGTH): Define.
- * h8300.md: Remove obsolete comments.
- (move patterns): Tweak constraints.
- (tst patterns): Use "register_operand" for predicate.
- (adds pattern): Use one_insn_adds_subs_operand to get length
- computation correct.
- (subs pattern): Similarly.
- (movstrhi): Remove unused expander.
- (fancy*, pxor, and-not patterns): Remove. No longer needed.
-
-Tue Apr 30 13:35:06 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/sol-c0.c (_start): Temporarily display calling
- __do_global_ctors, since the Solaris linker doesn't handle the
- relocations properly.
-
-Mon Apr 29 13:03:12 1996 Doug Evans <dje@cyguns.com>
-
- * sparc/vxsparc.h: sparc-aout.h renamed to aout.h.
-
-Mon Apr 29 00:35:15 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (names_small): Remove "BAD" postfix from %r7 byte registers.
- (rtx_equal_function_value_matters): Remove extra declaration.
- (output_simode_bld): New function.
- * h8300.h (NO_FUNCTION_CSE): Do define this.
- (reg_class): Remove LONG_REGS, SP_REG, SP_AND_G_REGS.
- (REG_CLASS_{NAMES,CONTENTS,FROM_LETTER}): Corresponding changes.
- (REGNO_REG_CLASS): Corresponding changes.
- (output_simode_bld): Declare.
- * h8300.md: Nuke comments for stuff which has been fixed.
- (all patterns): Remove references to register class "a" (SP_REGS)
- which no longer exists.
- (many patterns): Accept auto-inc auto-dec addresses in more cases.
- (zero_extendqisi2): New pattern for the H8/300.
- (zero_extendhisi2): Only use zero_extendhisi2_h8300 when not
- optimizing.
- (extendhisi2): Only use extendhisi2_h8300 when not optimizing.
- (extendqisi2): New pattern for the H8/300.
- (bitfield related patterns): Completely rewrite.
- (fancy_bclr, fancy_btst): Deleted.
- (addhi3 pattern for h8300): Handle case where we can't make matching
- constraints (works around hard to fix reload problem).
- (stack_pointer_manip): Delete.
- (and not patterns): New combiner patterns.
-
- * pa.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Make sure the
- final $CODE$ subspace is in the $TEXT$ space.
-
-Sun Apr 28 14:52:21 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * svr4.h (ASM_OUTPUT_SECTION_NAME): If no decl is specified,
- make the section read/write data.
-
-Sat Apr 27 10:28:59 1996 Michael Meissner <meissner@wogglebug.tiac.net>
-
- * rs6000/t-ppcgas (MULTILIB_EXCEPTIONS): Don't allow -mrelocatable
- and -mcall-sysv-noeabi.
-
- * rs6000/sysv.h (SUBTARGET_OVERRIDE_OPTIONS): The -mcall-aix
- option sets -meabi. Don't allow -mrelocatable without -meabi.
-
-Fri Apr 26 16:10:46 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.md (*smacsi,*smacdi,*umacdi): Fix constraint on
- operand 0.
-
-Fri Apr 26 14:36:33 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * i960/t-{960bare,vxworks960} (MULTILIB*): Add
- soft-float multilib support.
-
-Fri Apr 26 06:38:56 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * stor-layout.c (layout_decl): Turn off DECL_BIT_FIELD for BLKmode
- that's properly aligned and a multiple of a byte.
-
-Thu Apr 25 22:43:19 1996 Doug Evans <dje@cygnus.com>
-
- * i386/gas.h (ASM_OUTPUT_ALIGN): #if 0 out again.
- Undoes change of Apr. 9.
- * i386/go32.h (ASM_OUTPUT_ALIGN): Define.
-
-Thu Apr 25 14:05:33 1996 Richard Kenner (kennervlsi1.ultra.nyu.edu)
-
- * calls.c (expand_call): In inlining case, if BEFORE_CALLS is
- zero, start looking at first insn (one more place).
-
- * expr.c (expand_builtin, case BUILT_IN_SETJMP): CLOBBER the
- static chain after label at setjmp point.
-
-Thu Apr 25 09:02:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (print_operand{,_address}): Correct compile error if
- TARGET_EABI is not defined. Also, just call small_data_operand,
- without testing the ABI.
- (rs6000_select_section): Ditto.
-
- * rs6000/sysv4.h (CC1_SPEC): For -mcall-solaris, don't pass
- -mno-main-init.
-
-Wed Apr 24 18:26:48 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * collect2.c (handler): Delete export_file when we get a signal.
-
-Wed Apr 24 14:54:44 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa/pa1-ghpux.h (LINK_SPEC): Define. Link in PA1.1 libraries
- by default.
- * pa/{pa1-ghpux9.h, pa1-hpux.h, pa1-hpux9.h}: Likewise.
-
-Wed Apr 24 11:12:06 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * configure (powerpc{,le}-*-eabi*): Use t-ppc{,gas}, instead of
- t-eabi{,gas}.
- (powerpc-*-linux,powerpcle-*-solaris): Add definitions.
- (MULTILIB_DIRNAMES): Pick shorter names for the multilib
- directories.
- (MULTILIB_*): Do not build -msdata versions of the library. Build
- both system V and eabi versions of the libraries.
-
- * rs6000/t-ppc{,gas} (MULTILIB*): Don't build -msdata versions of
- the libraries. Split -mcall-sysv libraries into
- -mcall-sysv-{eabi,noeabi} varients.
- (LIB2FUNCS_EXTRA): Add eabi.S, eabi-ctors.c.
- (eabi.S): Use eabi.S, not eabi.s for eabi.asm.
- (crt files): Add support for Solaris crt files.
-
- * rs6000/sol{2.h,-c0.c,-ci.asm,-cn.asm}: New files for Solaris.
-
- * rs6000/linux.h: New file for Linux-based GNU system support.
-
- * rs6000/eabi-ci.asm (ppc-asm.h): Include.
- (.got section): Correct attribute.
-
- * rs6000/eabi-c{i,n}.asm (.init,.finit): Add support for System V
- style .init/.fini sections, that constructors and destructors
- place a bl <func> in the appropriate section.
-
- * rs6000/eabi-ctors.c (__do_global_{c,d}tors): Call __init, and
- __fini to handle constructors/destructors in the .init, .fini
- sections.
-
- * rs6000/{eabi,sysv}.h: Move most eabi configuration stuff from
- eabi.h to sysv.h.
-
- * rs6000/sysv.h (TARGET_*): Convert -mcall-xxx from switch into option.
- Add -mcall-{solaris,linux,sysv-eabi,sysv-noeabi} options.
- Add -m{,no-}eabi options to control whether we adhere to
- the System V spec or the EABI spec. Add -m{,no-}regnames to
- control whether registers are printed out as %r0 instead of 0.
- (SUBTARGET_OVERRIDE_OPTIONS): Add support for new -mcall options.
- (FP_ARG_MAX_REG): Use new macros for ABI conformance.
- (RS6000_REG_SAVE): Likewise.
- (STACK_BOUNDARY,BIGGEST_ALIGNMENT): If eabi, align to 8 byte
- boundary, otherwise 16 byte.
- (EXTRA_SECTIONS): Add .init, .fini sections.
- (*_SPEC): Reorganize so that the different targets all have sub
- specs that go in the specs file. Add support for linux and
- Solaris targets.
-
- * rs6000/{sysv4,eabi}*.h (*_SPECS): Only override the default
- spec, all other specs moved to sysv4.h.
- (RS6000_ABI_NAME): Use RS6000_ABI_NAME to set the default ABI
- name, not TARGET_DEFAULTS.
-
- * rs6000/xm-sysv4.h (alloca): Properly declare alloca if compiler
- is not GCC.
- (DONT_DECLARE_SYS_SIGLIST): Define.
-
- * rs6000.c (rs6000_abi_name): New global for getting the results
- of -mcall-xxx.
- (rs6000_reg_names): New global for holding the normal register names.
- (alt_reg_names): Alternate register names for -mregnames.
- (rs6000_override_options): If -mregnames, copy alt_reg_names into
- rs6000_reg_names.
- (input_operand): Recognize ABI_SOLARIS.
- (small_data_operand, init_cumulative_args): Likewise.
- (function_arg{,_boundary,_advance,_partial_nregs}): Likewise.
- (function_arg_pass_by_reference, setup_incoming_varargs): Likewise.
- ({rs6000,debug}_stack_info, output_{prolog,epilog}): Likewise.
- (print_operand): %$ prints '.' on Solaris, '$' elsewhere.
- (print_operand{,_address}): If not eabi, use @sdarel for small
- data references.
- (rs6000_stack_info): Only emit __eabi call if TARGET_EABI.
-
- * rs6000.h (*_SPECS): Move the System V specs to svr4.h.
- (ABI_SOLARIS): New ABI, mostly like System V.
- (EXTRA_CONSTRAINT): Use ABI_SOLARIS like ABI_V4.
- (RETURN_ADDRESS_OFFSET, (LEGITIMATE_SMALL_DATA_P): Likewise.
- (RETURN_IN_MEMORY): On Solaris, small structures are returned in regs.
- (REGISTER_NAMES): Use rs6000_reg_names array, instead of string
- literals.
- (DEBUG_REGISTER_NAMES): Define.
- (ADDITIONAL_REGISTER_NAMES): Add sp, toc aliases.
- (PRINT_OPERAND_PUNCT_VALID_P): Recognize $ as a punctuation char.
-
- * rs6000.md (got & call patterns): Use ABI_SOLARIS to mean the
- same as ABI_V4.
- (branch patterns): Use %$ for the current location, not just $.
-
- * va-ppc.h: Add Solaris support.
-
-Tue Apr 23 20:02:13 1996 Doug Evans <dje@cygnus.com>
-
- * sparc.c (output_function_prologue): In -mbroken-saverestore
- case, %sp = %fp - size.
- * sparc/t-splet (TARGET_LIBGCC2_CFLAGS): Delete.
- * sparc.md (isa attribute): Add sparclet.
- (*smacsi,*smacdi,*umacdi): Use match_operand, not match_dup
- for third arg.
- (*mulsidi3_sp32,const_mulsidi3,*umulsidi3_sp32,const_umulsidi3): Use
- smuld,umuld for sparclet.
-
-Tue Apr 23 16:28:28 1996 Michael Meissner <meissner@wombat.gnu.ai.mit.edu>
-
- * m68k/m68kemb.h: Add {LINK,STARTFILE,LIB,SUBTARGET}_SPEC, so
- gcc will use libgloss for supported target boards {idp,mvme,bcc}.
-
-Tue Apr 23 16:00:28 1996 Per Bothner <bothner@cygnus.com>
-
- * expr.c (store_constructor): Fix test for missing array elements.
-
-Tue Apr 23 11:21:09 1996 Stephen L Moshier (moshier@world.std.com)
-
- * i386/sco5.h (BSS_SECTION_ASM_OP): Use `data' directive.
- (ASM_OUTPUT_ALIGNED_LOCAL): Generate an `lcomm' directive.
- (TARGET_DEFAULT): Include TARGET_IEEE_FP.
- (CPP_PREDEFINES): Include Di386.
-
-Mon Apr 22 12:00:46 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (BIGGEST_FIELD_ALIGNMENT): Delete.
- (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Define.
- * sysv4.h (BIGGEST_FIELD_ALIGNMENT): Delete.
- (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Undefine.
- * win-nt.h (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Undefine.
-
-Sun Apr 21 17:52:36 1996 Jim Wilson <wilson@cygnus.com>
-
- * m68k/coff.h (ASM_OUTPUT_SECTION): Test DECL before
- dereferencing it.
-
- * cse.c (cse_process_notes): Handle SUBREG like ZERO_EXTEND.
-
-Sun Apr 21 12:57:12 1996 Doug Evans <dje@cygnus.com>
-
- * arm/aout.h (ASM_OUTPUT_MI_THUNK): Define.
-
-Sun Apr 21 09:50:09 1996 Stephen L Moshier (moshier@world.std.com)
-
- * choose-temp.c: Include sys/types.h before sys/file.h for sco3.2v5.
-
-Sun Apr 21 08:42:13 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (check_float_value): Cast args of bcopy to avoid warnings.
-
-Sat Apr 20 21:22:21 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * stor-layout.c (layout_record): Use ADJUST_FIELD_ALIGN to modify
- alignment of fields within records.
-
-Sat Apr 20 19:55:33 1996 Niels Moller <nisse@lysator.liu.se>
-
- * c-parse.in (typespec): Made <SomeProtocol> equivalent
- to (id <SomeProtocol>).
- (non_empty_protocolrefs): New nonterminal.
-
-Sat Apr 20 08:34:02 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * stmt.c (check_for_full_enumeration_handling): Call case_tree2list
- before checking for case expressions not corresponding to enumerators.
- (mark_seen_cases): If SPARSENESS == 2, exploit AVL order.
- Else, convert tree to list.
- Set xlo to -1 if SPARSENESS == 1 search failed.
- (expand_end_case): Avoid calling case_tree2list on list.
-
-Fri Apr 19 16:54:57 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000/win-nt.h (BIGGEST_FIELD_ALIGNMENT): Set to 64, not
- 32 that AIX uses.
-
-Fri Apr 19 16:40:38 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * i386.md (movqi): Handle QImode values in %si and %di.
-
-Thu Apr 18 20:56:56 1996 Jim Wilson <wilson@cygnus.com>
-
- * sh.md (lshrsi3): Change gen_ashlsi3_d to gen_lshrsi3_d.
-
-Thu Apr 18 15:49:28 1996 Per Bothner <bothner@cygnus.com>
-
- * sparc.h (ASM_OUTPUT_MI_THUNK): Define.
-
-Thu Apr 18 15:19:26 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.md: Remove "type" attribute from all patterns except those
- which have varying length branches. Eliminate obsolete "type"
- attributes. Add "length" and "cc" attributes to insns without them;
- fix some length computations. Remove patterns which are commented out.
-
- * h8300.md (zero extension expanders and insns): Simplify, fix various
- length problems, provide optimized versions for the h8300 and h8300h.
- (sign extension expanders and insns): Likewise. Make them
- nearly identical to zero_extension patterns and insns.
-
-Wed Apr 17 18:50:16 1996 Jeffrey A. Law <law@cygnus.com>
-
- * pa.h (SELECT_SECTION): Define. Never place a something
- into the read-only data section if it requires a reloc.
-
- * pa.md (rotlsi3): Delete unnecessary and incorrect pattern.
-
-Wed Apr 17 17:15:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.md (movdi): Never FAIL, even if operand[1] is not a
- general operand, due to being in volatile memory.
-
-Wed Apr 17 15:20:10 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * c-lex.c (check_newline): Rewrite to use tokens.
- (handle_sysv_pragma): Take a token instead of a character.
- * i960.c (process_pragma): Take the IDENTIFIER_POINTER tree
- node instead of a character.
- * sh.c (handle_pragma): Likewise.
- * config/nextstep.c (handle_pragma): Likewise.
- * h8300.c (handle_pragma): Likewise.
- * i960.h (HANDLE_PRAGMA): Expect/pass 2nd arg of NODE, not CH.
- * sh.h (HANDLE_PRAGMA): Likewise.
- * config/nextstep.h (HANDLE_PRAGMA): Likewise.
- * h8300.h (HANDLE_PRAGMA): Likewise.
-
-Wed Apr 17 14:28:43 1996 Doug Evans <dje@cygnus.com>
-
- * choose-temp.c: Don't include sys/file.h ifdef NO_SYS_FILE_H.
- #include <stdio.h>.
- (choose_temp_base): Make tmp,usrtmp, static locals.
-
-Wed Apr 17 08:41:02 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (alpha_emit_conditional_move): Fix some bugs in previous
- change and do some cleanup.
-
-Tue Apr 16 18:53:05 1996 Jim Wilson <wilson@cygnus.com>
-
- * reload.c (push_reload): Add extra reload for inside of SUBREG if
- it is CONSTANT_P.
-
- * expr.c (do_store_flag): Rewrite last change to avoid compiler
- warnings.
-
- * reload.c (push_reload): When reuse an old reload, set the modes
- to be the larger of the old and new modes.
-
- * i960/t-960bare (xp-bit.c): Fix typo in source file name.
-
-Tue Apr 16 18:09:16 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.md (andhi3): If 2nd operand is a CONST_INT that meets 'J'
- constraint, then only two bytes are needed for this insn. Improve
- code generated for the h8300h when both operands are registers.
- (iorhi3, xorhi3): Likewise. Rework to be nearly identical to andhi3.
- (andsi3): If 2nd operand is a CONST_INT that meets the 'J'
- constraint, then only two bytes are need for this insn.
- Improve code generated for the h8300h regardless of the
- type of the 2nd operand. Make this pattern work on the h8300 too.
- (iorsi3, xorsi3): Likewise. Rework to be nearly identical to andsi3.
- (iorqi3_internal): Make this pattern look more like andqi3_internal.
- (one_cmplhi2, one_cmplsi2): Fix length computation for H8300H.
-
-Tue Apr 16 17:43:25 1996 J"orn Rennecke (amylaar@meolyon.hanse.de)
-
- * i386.md (addsidi3_2): Handle non-MEM overlap case.
-
-Tue Apr 16 16:59:49 1996 Richard Henderson <rth@tamu.edu>
-
- * function.c (expand_function_end): Allow TRAMPOLINE_TEMPLATE
- to be omitted on systems for which it is not cost effective.
- * varasm.c (assemble_trampoline_template): No such function
- if no TRAMPOLINE_TEMPLATE.
- * m68k.h: Greatly simplify the run-time trampoline code:
- (TRAMPOLINE_TEMPLATE, TRANSFER_FROM_TRAMPOLINE): Delete define.
- (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Changed.
- (TRAMPOLINE_ALIGN): No point aligning to cache line.
- (FINISH_INIT_TRAMPOLINE): New define.
- * m68k/next.h: Instead of redefining INITIALIZE_TRAMPOLINE,
- make use of the new FINISH_INIT_TRAMPOLINE.
- * m68k/{m68k.h,next.h,aux.h} (FINISH_INIT_TRAMPOLINE):
- Rename to FINALIZE_TRAMPOLINE.
- * m68k/{linux.h,m68kv4.h}: Override trampoline macros.
-
-Tue Apr 16 16:02:50 1996 David Edelsohn <edelsohn@mhpcc.edu>
-
- * combine.c (make_field_assignment): Allow XOR in final case.
-
-Tue Apr 16 11:33:53 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * m68k.h (TARGET_SWITCHES): Don't remove MASK_68060 with -msoft-float.
-
- * m68k.h (MULL_COST, MULW_COST, RTX_COSTS): Add costs for TARGET_68060.
- * m68k.md (ashlsi_16, lshrsi_16): Disable pattern for TARGET_68060;
- this special case is not faster for that cpu.
-
-Tue Apr 16 10:54:55 1996 Eliot Dresselhaus <dresselh@rft30.nas.nasa.gov>
-
- * alpha.c (alpha_emit_conditional_move): New function.
- * alpha.h (alpha_emit_conditional_move): Declare it.
- * alpha.md (cmov* define_expands): Use it.
-
-Tue Apr 16 09:06:17 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * function.h (struct function): New field returns_pointer.
- * function.c (push_function_context_{to,from}): Save and restore
- current_function_returns_pointer.
-
- * config/svr4.h (ENDFILE_SPEC): Add missing `%s'.
-
- * configure (m68k-*-linux*aout*): Set tmake_file to m68k/t-linux-aout.
- (m68k-*-linux*): Set extra_parts.
- * m68k/t-linux (INSTALL_ASSERT_H): New definition.
- (CRTSTUFF_T_CFLAGS_S, TARGET_LIBGCC2_CFLAGS): New definitions.
- * m68k/t-linux-aout: New file.
- * m68k/linux.h (LIB_SPEC): Deleted.
- (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): Define.
-
- * m68k.h (TRAMPOLINE_ALIGNMENT): Specify alignment in bits, not bytes.
-
-Tue Apr 16 08:53:17 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * final.c (final_scan_insn): Allow removal of redundant test and
- compare instructions that use clobbers.
-
-Tue Apr 16 06:22:00 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-decl.c (clear_limbo_values): New function.
- (pushdecl): Call it for function body blocks.
-
- * objc/thr-decosf1.c (_objc_thread_id): Correct return type from
- int to _objc_thread_id.
-
- * expr.c (expand_builtin, case BUILT_IN_LONGJMP): Make a decl
- for __dummy, so we can call make_function_rtl on it.
-
- * expr.c (expand_assignment): Don't pre-evaluate RHS if a CALL_EXPR
- with a variable-size return.
-
-Mon Apr 15 17:38:45 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Fix undefined VOIDFUNCPTR in VxWorks 5.2 <time.h>.
-
-Mon Apr 15 15:12:16 1996 Jim Wilson <wilson@cygnus.com>
-
- * expr.c (do_store_flag): Before calling exact_log2, remove any
- sign extension bits.
-
- * reload1.c (emit_reload_insns): Call reload_reg_reaches_end_p for
- every reg of multi-reg spill register. Invalidate old info for multi
- reg spill registers when only part survives to the end.
-
-Mon Apr 15 14:49:12 1996 Mike Stump <mrs@cygnus.com>
-
- * function.c (preserve_temp_slots): Only preserve temporaries that
- happen to be at the current level.
-
-Mon Apr 15 14:08:12 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * gansidecl.h: New file.
- * choose-temp.c: New file.
- * Makefile.in (xgcc): Depend on and link in choose-temp.o.
- (collect2): Likewise.
- (choose-temp.o): Add rule for.
- * collect2.c: #include "gansidecl.h".
- (const,PROTO): Delete.
- (P_tmpdir): Delete.
- (choose_temp_base): Declare as extern, delete internal copy.
- (main): Update call to choose_temp_base.
- * cpphash.c: #include "gansidecl.h".
- (NULL,const,volatile): Delete.
- * demangle.h: #include "gansidecl.h".
- (PROTO,PTR,const): Delete.
- * expr.h (const): Delete.
- * fix-header.c: #include "gansidecl.h".
- (const): Delete.
- * gcc.c: #include "gansidecl.h".
- (PROTO,VPROTO,PVPROTO,VPROTO,VA_START,NULL): Delete.
- (GENERIC_PTR,NULL_PTR,P_tmpdir): Delete.
- (choose_temp_base): Declare as extern, delete internal copy.
- (concat): Rewrite to take a variable number of arguments.
- (choose_temp_base_try,concat[346]): Delete.
- (translate_options,set_spec,process_command,do_spec_1,
- is_directory,main): Always use concat, not concat[346]. Pass
- NULL_PTR as trailing arg to concat.
- * genattr.c (main): Delete printing of "#define PROTO".
- * machmode.h: #include "gansidecl.h".
- (PROTO): Delete.
- (HAVE_MACHINE_MODES): Move definition to standard place.
- * recog.h: #include "gansidecl.h".
- (PROTO,const): Delete.
- * rtl.h: #include "gansidecl.h".
- (PROTO,VPROTO,PVPROTO,VPROTO,VA_START,STDIO_PROTO): Delete.
- (NULL,GENERIC_PTR,NULL_PTR): Delete.
- * tree.h: Likewise.
-
-Mon Apr 15 08:49:20 1996 Tom May (ftom@netcom.com)
-
- * cse.c (invalidate_skipped_set): Ignore CLOBBER after calling
- note_mem_written, not before.
-
-Mon Apr 15 08:22:03 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * m68k.md (tstdi): Optimized for "d" case.
- (movqi): Allow moving "i" into "a".
- (zero_extendsidi2): Alternatives merged.
- (extendplussidi): Fixed when operands 0 and 1 share a register.
- (adddi_sexthishl32): Constraints reordered for better reload.
- (adddi3,subdi_sexthishl32,subdi3,negdi2): Likewise.
- (ashldi_sexthi): Accept "m" as operand 0.
- (ashldi_const32): Alternatives merged.
- (ashift patterns): Output "lsl" instead of "asl".
- (beq0_di): If condition codes already set, output only branch insn.
- (bne0_di,bge0_di,blt0_di): Likewise.
- * m68k.c (notice_update_cc, case ASHIFT{,RT}, LSHIFTRT, ROTATE{,RT}):
- Don't set CC_NO_OVERFLOW.
- * m68k.h (TARGET_SWITCHES): Fix typo in "c68000" entry.
-
-Mon Apr 15 08:06:17 1996 Stephen L Moshier (moshier@world.std.com)
-
- * real.c (eadd1): Check for overflow on X plus X.
-
-Mon Apr 15 08:02:24 1996 J.T. Conklin <jtc@cygnus.com>
-
- * i386/netbsd.h (HAVE_SYSV_PRAGMA): Removed definition.
- * config/netbsd.h (HAVE_SYSV_PRAGMA): Define.
- (SET_ASM_OP): Define.
-
-Mon Apr 15 07:28:54 1996 Fila Kolodny <fila@ibi.com>
-
- * configure: Add definition for host= into Makefile.
- * build-make (CC): Pass -b $(host), not target.
-
-Mon Apr 15 05:12:39 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (bc_expand_increment): Change declaration to return void.
-
- * toplev.c (max_label_num_after_reload): New variable.
- (rest_of_compilation): Set it.
- * reorg.c (find_dead_or_set_registers): Only kill spill regs after
- label made before jump2.
-
- * combine.c (expand_field_assignment): Take SUBREG_WORD into
- account when have STRICT_LOW_PART.
- (make_extraction): Make a STRICT_LOW_PART at any low-order word.
-
-Mon Apr 15 03:43:11 1996 Jeffrey A. Law <law@cygnus.com>
-
- * flags.h (flag_function_sections): Declare.
- * toplev.c (flag_function_sections): Define.
- (compile_file): Add warnings when -ffunction-sections is
- used with -g, or profiling. Disable -ffunction-sections
- when profiling is used. Add warning when -ffunction-sections
- is used on a target that doesn't support it.
- * varasm.c (named_section): Make a copy of the section name
- in case the original is in temporary storage.
- (function_section): Set DECL_SECTION_NAME for each function
- if flag_function_sections is on and the target supports it.
- * dbxout.c (dbxout_function_end): New function.
- (dbxout_function): Call dbxout_function_end if using extensions
- and flag_function_sections is on.
- * sparc/sysv4.h (ASM_OUTPUT_SECTION_NAME): Prefix a function
- section's name with ".text%" when -ffunction-sections.
-
-Sun Apr 14 19:37:43 1996 Doug Evans <dje@cygnus.com>
-
- * toplev.c (main): Delete redundant test for -p used with -fbytecode.
-
-Sun Apr 14 19:01:59 1996 John F. Carr <jfc@mit.edu>
-
- * c-decl.c (finish_enum): Don't crash if no type can represent all
- enumeration values.
-
-Sun Apr 14 18:56:40 1996 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * m68k.md (ftruncdf2): Enable for m68060 systems.
-
-Sun Apr 14 18:49:30 1996 David L. Reese (david.reese@east.sun.com)
-
- * fold-const.c (range_test): Don't convert hi_cst or lo_cst
- to unsigned when folding signed range tests.
-
-Sun Apr 14 08:56:27 1996 Stephen L Moshier <moshier@world.std.com>
-
- * real.h (ereal_from_{int,uint}): Add new arg, MODE.
- (REAL_VALUE_FROM{,_UNSIGNED}_INT): New arg, MODE.
- * real.c (ereal_from_{int,uint}): New arg, MODE.
- * cse.c (simplify_unary_operation): Add new arg to REAL_VALUE_FROM_INT.
- * fold-const.c (fold_convert): Likewise.
- * tree.c (real_value_from_int_cst): New arg, TYPE.
- Pass mode to REAL_VALUE_FROM_INT.
- (build_real_from_int_cst): Properly deal with truncation.
-
-Sun Apr 14 08:21:29 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * combine.c (try_combine): When substituting in output of I2,
- ensure dest isn't clobbered in I2.
-
- * combine.c (combine_instructions): In initial scan of insns,
- handle a REG_INC note's affect on sign bit copies and nonzero bits.
- (set_nonzero_bits_and_sign_copies): Treat a zero SET arg as a CLOBBER.
-
-Sun Apr 14 07:52:28 1996 Manor Askenazi <manor@santafe.edu>
-
- * objc/encoding.c (objc_skip_typespec): Don't abort for _C_UNDEF.
-
-Sat Apr 13 20:35:36 1996 Richard Henderson (richard@atheist.tamu.edu)
-
- * configure (m68k-apple-aux*): Rework to take advantange
- of list of tm.h files and support all four gas/gld options.
- * m68k/auxas.h, m68k/auxgas.h, m68k/auxgld.h, m68k/auxld.h: New files.
- * m68k/auxstd.h, m68k/auxgnu.h: Deleted.
-
-Sat Apr 13 20:18:11 1996 Stephen L Moshier <moshier@world.std.com>
-
- * alpha.c (check_float_value): New function.
- * alpha.h (CHECK_FLOAT_VALUE): Define.
- (ASM_OUTPUT_FLOAT): Print the value in hex.
-
-Sat Apr 13 15:08:45 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * configure: New target arm{,el}-*-coff*.
- (cpu_default): Sort alphabetically.
- * arm/coff.h: New file.
- * arm/t-bare: New file.
- * arm/arm.c (use_return_insn): Don't use return for naked functions.
- (arm_valid_machine_decl_attribute): New function.
- (arm_naked_function_p): New function.
- (output_func_prologue): Naked functions don't have prologues.
- (arm_expand_prologue): Likewise.
- (output_func_epilogue): Likewise with epilogues.
-
-Sat Apr 13 11:31:32 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (adds_subs_operand): Fix thinko in last change.
-
- * h8300.md (subhi3): Turn into a define_expand.
- (subhi3 using adds_subs): New pattern.
- (H8300 subhi): Derived from old subhi pattern. Simplified.
- (H8300H subhi): Likewise.
- (subsi using adds_subs): New pattern. Only used on H8300H.
- (subsi_h8300): Allow "a" registers as destination.
- (subsi_h8300h): Allow "a" registers as destination. Simplify.
-
- * h8300.md (bcs_qiqi, bcs_hihi, bs_hiqi): Fix thinkos
- in last change.
-
-Sat Apr 13 08:59:48 1996 Fila Kolodny <fila@ibi.com>
-
- * i370/mvs.h (ASM_DECLARE_FUNCTION_NAME): Don't write anything to
- asm file, because everything is handled in FUNCTION_PROLOGUE.
-
-Sat Apr 13 07:55:38 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c (alpha_emit_set_const_1): Renamed from
- alpha_emit_set_const and static.
- Remove change of Nov 26; again use normal mechanism for SImode.
- (alpha_emit_set_const): New function.
-
-Fri Apr 12 18:19:39 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (adds_subs_operand, output_adds_subs): New functions.
- * h8300.md (addhi3): Turn into a define_expand.
- (addhi3 using adds_subs): New pattern.
- (H8300 addhi): Derived from old addhi pattern. Simplified.
- (H8300H addhi): Likewise.
- (addsi using adds_subs): New pattern. Only used on H8300H.
- (addsi_h8300): Allow "a" registers as destination.
- (addsi_h8300h): Simplify. Allow "a" registers as destination.
-
- * h8300.md (bcs): New attribute type.
- (default_length): Compute correct length for bcs insns.
- (bcs_qiqi, bcs_hihi, bs_hiqi): Use new type and update
- to account for correct length computation.
-
- * h8300.md (movhi_internal): Demand at least one operand to be reg.
- (movsi_h8300{{,h}): Optimize loading certain constants.
-
- * h8300.h (NO_FUNCTION_CSE): Comment out.
- (FUNCTION_ARG_REGNO_P): Properly define for TARGET_QUICKCALL.
- (RETURN_IN_MEMORY): Don't return small structs in regs.
-
- * h8300.c (const_costs): -4 and 4 are cheap on the h8300h.
- (notice_update_cc): Remove references to "value2" field.
-
- * h8300.c (dosize): Remove unused "fped" argument. All callers
- changed. Handle add/sub of 5-8 bytes efficiently on the h8300h.
-
- * h8300.c (print_operand): Handle new 'R' case for accessing
- the 8-bit area. Make code for 'Y' fall into code for 'R' when
- operand is not a register. Update some comments.
- (h8300_tiny_data_p): New function.
- (h8300_valid_machine_decl_attribute): Handle "tiny_data" attribute.
- * h8300.h (OK_FOR_U): Handle memory references into 8-bit area.
- (ENCODE_SECTION_INFO): Mark SYMBOL_REFs which refer to 8-bit area.
- * h8300.md (many patterns): Use 'R' rather than 'X' for
- operands that may be memory accesses into the 8-bit area.
- (btst pattern): New pattern to set the cc0 (zbit) based on
- data in the 8-bit area.
-
- * h8300.md (one_cmplsi2): Fix length computation for h8300h.
-
-Fri Apr 12 14:34:39 1996 Doug Evans <dje@cygnus.com>
-
- * arm.md (*ldmsi,*stmsi): Use (mem (match_operand ...))
- to avoid using indirect_operand (reload problems).
- * arm/semi.h (CPP_PREDEFINES): Define __semi__ instead of semi.
- * arm/aout.h (ASM_GENERATE_INTERNAL_LABEL): Use LOCAL_LABEL_PREFIX.
- (ASM_OUTPUT_ADDR_{VEC,DIFF_ELT}): Likewise.
-
-Fri Apr 12 09:43:30 1996 Jason Merrill <jason@yorick.cygnus.com>
-
- * dbxout.c (dbxout_typedefs): Don't emit incomplete types yet.
- (dbxout_symbol): Use DECL_ARTIFICIAL to recognize C++ implicit
- typedefs.
-
-Thu Apr 11 21:56:26 1996 Doug Evans <dje@cygnus.com>
-
- * i386/t-winnt (winnt.o): Rewrite based on .c.o rule.
- (oldnames.o,spawnv.o): Add rules for.
-
-Thu Apr 11 07:25:06 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * calls.c (expand_call): In inlining case, if BEFORE_CALLS is
- zero, start looking at first insn.
-
- * expr.c (preexpand_calls, case CALL_EXPR): Rework to properly
- avoid expanding functions returning variable size objects.
-
- * integrate.c (expand_inline_function): When comparing types
- of formal and actual, use TYPE_MAIN_VARIANT.
-
-Thu Apr 11 00:48:29 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300/lib1funcs.asm (modnorm): New function(s). Like divnorm,
- but gets the sign bit right for modulo operations.
- (__modhi3, modsi3): Use modnorm.
-
- * h8300.c (dosize): On h8300h, do 4 byte adjusts using adds and subs.
- * h8300.h (LONG_LONG_TYPE_SIZE): Always make this 32bits.
- Reverses change from Apr 2, 1996.
-
-Wed Apr 10 18:39:52 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * sparc.h (ASM_OUTPUT_INTERNAL_LABELREF): Delete.
- (FUNCTION_PROFILER): Use ASM_GENERATE_INTERNAL_LABEL instead.
-
- * sparc.c (sparc_override_options): 90c701 renamed to tsc701.
- (eligible_for_epilogue_delay_slot): Don't allow anything if
- -mbroken-saverestore.
- (output_function_prologue): Only use trivial save's if
- -mbroken-saverestore.
- * sparc.h (CPP_SPEC): Handle -mcpu={sparclet,tsc701}.
- (ASM_SPEC): Likewise.
- ({MASK,TARGET}_BROKEN_SAVERESTORE): Define.
- (enum processor_type): 90C701 renamed to TSC701.
- * sparc.md (attr cpu): 90c701 renamed to tsc701.
- * sparc/splet.h (SUBTARGET_SWITCHES): Recognize -mbroken-saverestore.
-
-Wed Apr 10 17:56:02 1996 Stan Cox <coxs@dg-rtp.dg.com>
-
- * m88k/dgux.h (EXTRA_SPECS): Define.
- (ASM_SPEC,CPP_SPEC,STARTFILE_SPEC): Use EXTRA_SPECS.
- * m88k/dguxbcs.h (ASM_SPEC,CPP_SPEC,STARTFILE_SPEC): Use EXTRA_SPECS.
- * m88k/m88k.c (output_ascii) Output literal HT.
-
-Wed Apr 10 17:28:37 1996 James Carlson (carlson@xylogics.com)
-
- * configure: Work around AIX bug when defining SUBDIRS.
-
-Wed Apr 10 17:22:42 1996 Paul Eggert <eggert@twinsun.com>
-
- * cexp.y (parse_number): Don't reject long long constants unless
- pedantic.
-
-Wed Apr 10 17:19:56 1996 Stephen L. Moshier (moshier@world.std.com)
-
- * real.c (e64toe): Properly distinguish between NaN and infinity
- bit patterns for real-words-big-endian targets.
-
-Wed Apr 10 17:17:26 1996 Richard Earnshaw (rearnsha@armltd.co.uk)
-
- * real.c (endian): Add two explicit casts.
- (e64toe): Support ARM extended precision fp format.
- Check negative infinities properly for NaNs.
- (toe64): Support ARM extended precision fp format.
-
-Tue Apr 9 12:53:31 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * i386/gas.h (ASM_OUTPUT_ALIGN): Define and use .balign.
-
-Tue Apr 9 12:48:45 1996 Stephen L Moshier (moshier@world.std.com)
-
- * sparc.c (fp_zero_operand): Exclude -0.0.
-
-Tue Apr 9 07:11:24 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * alpha.c: Fix typo in last change.
-
- * tree.c (substitute_in_expr): Don't return new expression if
- nothing changed.
- (substitute_in_type): Deleted, not used.
- * tree.h (substitute_in_type): Delete declaration.
-
-Mon Apr 8 16:30:18 1996 Jeffrey A. Law <law@cygnus.com>
-
- * flow.c (find_auto_inc): Also make sure there aren't
- any sets of the incremented register between the memory
- reference and increment insn.
-
-Mon Apr 8 15:41:14 1996 John Polstra (jdp@polstra.com)
-
- * configure (i[3456]86-*-freebsdelf*): New target.
- * i386/freebsd-elf.h: New file.
- * i386/x-freebsd (USER_H): New define; to null.
-
-Mon Apr 8 14:44:41 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * c-decl.c (finish_function): Always warn if main doesn't return int.
-
-Mon Apr 8 13:01:37 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * rs6000.c (got_operand): New function, returns true if the
- operand can go in V.4's GOT.
- (rs6000_pic_register): New variable.
- (output_epilog): Reset rs6000_pic_register.
-
- * rs6000.h (rs6000_pic_register, got_operand, flag_pic): Add decls.
- (PREDICATE_CODES): Add got_operand.
-
- * rs6000.md (movsi): Add support for V.4's -fpic and -FPIC.
- (init_v4_pic): Initialize the V4 pic register if needed.
- (call patterns): If -fpic/-fPIC, call function with @plt suffix.
-
- * t-eabigas (MULTILIB_DIRNAMES): Remove errant pic directory.
-
- * rs6000.c (output_prolog): Correctly store & restore the
- arguments to main in their correct save location, when calling the
- start function.
-
-Mon Apr 8 13:01:37 1996 David Reese <Dave.Reese@East.Sun.COM>
-
- * rs6000.c (print_operand): Use reg_names to print registers.
-
-Fri Apr 5 00:40:19 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (h8300_valid_machine_decl_attribute): Use underscores,
- not dashes in attributes.
- (h8300_funcvec_function_p): Corresponding changes.
- (h8300_interrupt_function_p): Likewise.
-
- * pa.h (INIT_CUMULATIVE_INCOMING_ARGS): Initialize "indirect"
- field to zero.
-
-Thu Apr 4 12:52:11 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * loop.c (combine_givs): Use new macro GIV_SORT_CRITERION.
- New variable giv_array. Loop over giv_array instead of following
- next_iv links.
- (giv_sort): New function.
- * sh.h (GIV_SORT_CRITERION): Define.
-
- * c-typeck.c (push_init_level): When output alignment for structure
- field, add check to verify it is the next field to be output.
-
-Thu Apr 4 12:19:26 1996 David Mosberger-Tang <davidm@AZStarNet.com>
-
- * alpha.c: Don't include stamp.h for Linux-based GNU systems.
-
-Thu Apr 4 12:17:08 1996 Richardg Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * objc/Makefile: Rename thread* to thr*.
- * objc/thread.c: Rename thread-* to thr-*.
- * objc/thr-decosf1.c: Renamed from thread-decosf1.c
- * objc/thr-irix.c: Renamed from thread-irix.c.
- * objc/thr-single.c: Renamed from thread-single.c.
- * objc/thr-solarius.c: Renamed from thread-solaris.c.
- * objc/thr-win32.c: Renamed from thread-win32.c.
- * objc/objc-api.h: Include thr.h, not thread.h.
- * objc/runtime.h, objc/sarray.h: Likewise.
-
- * i386.md (ashldi3_const_int): Don't recognize if won't match
- constraint of operand 2.
-
-Thu Apr 4 11:40:55 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * config/fp-bit.c (EXTENDED_FLOAT_STUBS): If EXTENDED_FLOAT_STUBS
- is defined, define all of the XF/TF functions that might be
- generated that we don't have code for yet.
-
- * i960/t-(vxworks960,960bare): (LIB2FUNCS_EXTRA): Make and
- compile xp-bits.c that defines EXTENDED_FLOAT_STUBS.
-
- From: steve chamberlain <sac@slash.cygnus.com>
- * i386/x-cygwin32 (LANGUAGES): Delete.
- * i386/xm-cygwin32.h (EXECUTABLE_SUFFIX): Set to .exe.
- * rs6000/xm-cygwin32.h (EXECUTABLE_SUFFIX): Set to .exe.
-
-Wed Apr 3 14:10:16 1996 Jim Wilson <wilson@chestnut.cygnus.com>
-
- * expr.c (emit_push_insn): Clobber register only if it is non-zero.
-
-Wed Apr 3 11:31:55 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.h (h8300_funcvec_function_p): Declaration moved here.
- * h8300.c (h8300_funcvec_function_p): Declaration removed from here.
- * h8300.md (tstqi): Tweak to work like other tstXX patterns.
- (cmphi): Turn into a define_expand. Add two anonymous
- matterns to match the output of the cmphi expander.
- (cmpsi): Accept constants as the second input operand.
-
-Tue Apr 2 13:52:30 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.md (movqi_internal): Remove useless alternative(s). Fix
- lengths and simplify by reordering remaining alternatives.
- (movstrictqi, movhi_internal, movstricthi): Likewise.
- (movsi_h8300h, movsf_h8300h): Likewise.
-
- * h8300/h8300.c (extra_pop): Remove unused variable.
- (current_function_anonymous_args): Likewise.
- (function_prologue): Remove incorrect varargs/stdarg
- related code.
- (function_epilogue): Likewise.
- (function_arg): Never pass unnamed arguments in registers.
- * h8300.h (LONG_LONG_TYPE_SIZE): Use 64bits when ints are 32bits.
- (SETUP_INCOMING_VARARGS): Remove definition.
-
-Mon Apr 1 16:59:48 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * fixincludes: Fix signal prototype on SunOS to avoid pedantic C++
- error.
-
-Mon Apr 1 16:16:34 1996 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
-
- * expr.c (get_inner_reference): When finding mode to access bitfield
- that ends up properly aligned, use mode class of its type unless
- type's mode was BLKmode.
-
-Mon Apr 1 13:45:30 1996 Jeffrey A. Law <law@cygnus.com>
-
- * h8300.c (interrupt_handler): Renamed from pragma_interrupt.
- All references changed.
- (function_prologue): Set interrupt_handler if the current
- function has the "interrrupt-handler" attribute.
- (small_call_insn_operand): New function.
- (h8300_interrrupt_function_p): New function.
- (h8300_funcvec_function_p): New function.
- (h8300_valid_machine_decl_attribute): New function.
- * h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Define.
- * h8300.md (call insns): Handle calls through the
- function vector. Indirect calls and calls through
- the function vector have a length of two bytes.
-
-See ChangeLog.10 for earlier changes.
-
-Use a consistent time stamp format in ChangeLog entries.
-Not everyone has Emacs 20 yet, so stick with Emacs 19 format for now.
-
-Local Variables:
-add-log-time-format: current-time-string
-End:
diff --git a/gcc/ChangeLog.12 b/gcc/ChangeLog.12
deleted file mode 100644
index ecb29192508..00000000000
--- a/gcc/ChangeLog.12
+++ /dev/null
@@ -1,1244 +0,0 @@
-Sat May 2 20:39:22 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * fold-const.c (fold): When commutting COND_EXPR and binary operation,
- avoid quadratic behavior if have nested COND_EXPRs.
-
-Tue Apr 28 17:30:05 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * mips.h (HOST_WIDE_INT): Define if not already.
- (compute_frame_size, mips_debugger_offset): Return HOST_WIDE_INT.
- (DEBUGGER_{AUTO,ARG}_OFFSET): Cast second arg to HOST_WIDE_INT.
- * /mips.c (mips_debugger_offset): Now returns HOST_WIDE_INT.
- Likewise for internal variable frame_size.
-
- * final.c (alter_subreg): Make new SUBREG if reload replacement
- scheduled inside it.
-
- * dwarf2out.c (add_bound_info, case SAVE_EXPR): Pass
- SAVE_EXPR_RTL address through fix_lexical_addr.
-
-Mon Apr 27 18:57:18 1998 Jim Wilson <wilson@cygnus.com>
-
- * mips/sni-svr4.h (CPP_PREDEFINES): Add -Dsinix and -DSNI.
-
-Mon Apr 20 14:48:29 1998 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md (mov{sf,df} define_splits): When splitting move of
- constant to int reg, don't split insns that do simple AND and OR
- operations; just split each word and let normal movsi define split
- handle it further.
-
-Sun Apr 19 20:21:19 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * real.h (C4X_FLOAT_FORMAT): New macro.
- * real.c (c4xtoe, etoc4x, toc4x): New functions.
-
-Sun Apr 19 20:17:32 1998 Niklas Hallqvist <niklas@petra.appli.se>
-
- * m68k.c (notice_update_cc): Use modified_in_p to check for update.
-
-Sun Apr 19 18:48:07 1998 K. Richard Pixley <rich@kyoto.noir.com>
-
- * fixincludes: Discard empty C++ comments.
- Special case more files with C++ comments nested in C comments.
-
-Sun Apr 19 18:30:11 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.md ({add,sub}di3): Optimize for constant operand.
-
-Sun Apr 19 18:27:11 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * i386.c (output_387_binary_op): Swap operands when popping if result
- is st(0).
-
-Sun Apr 19 17:58:01 1998 Peter Jeremy <peter.jeremy@alcatel.com.au>
-
- * expr.c (do_jump_by_parts_equality_rtx): Now public.
- * expmed.c (do_cmp_and_jump): New function.
- (expand_divmod): Use do_cmp_and_jmp instead of emit_cmp_insn and
- emit_jump_insn.
-
-Sun Apr 19 07:48:37 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-typeck.c (build_c_cast): Check underlying type when seeing
- if discarding const or volatile.
-
- * c-decl.c (pushdecl): Avoid duplicate warning about implicit redecl.
-
- * configure.in (stab.h): Check for it.
- (i386-*-vsta): Include xm-i386.h too.
- * dbxout.c (stab.h): Include based on autoconf results.
- * vax/xm-vms.h (NO_STAB_H): Deleted.
- * alpha/xm-vms.h, xm-mips.h, i386/xm-mingw32.h, i386/go32.h: Likewise.
- * i386/xm-cygwin32.h: Likewise.
- * i386/xm-vsta.h (NO_STAB_H): Likewise.
- (i386/xm-i386.h): No longer include.
-
- * mips.c: Cleanups and reformatting throughout.
- ({expand,output}_block_move): Use HOST_WIDE_INT for sizes.
- (mips_debugger_offset, compute_frame_size): Likewise.
- (save_restore_insns, mips_expand_{pro,epi}logue): Likewise.
- (siginfo): Deleted.
- (override_options): Don't set up to call it; don't call setvbuf.
-
-Mon Apr 13 06:40:17 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * configure.in (sparc-*-vxsim*): Include xm-siglist.h and
- define USG and POSIX.
-
-Sun Apr 12 21:59:27 1998 Jeffrey A. Law <law@cygnus.com>
-
- * calls.c (expand_call): Fix typo in STRICT_ARGUMENT_NAMING.
-
-Sun Apr 12 21:42:23 1998 D. Karthikeyan <karthik@cdotd.ernet.in>
-
- * m68k.h (TARGET_SWITCHES): Add missing comma.
-
-Sun Apr 12 21:33:33 1998 Eric Valette <valette@crf.canon.fr>
-
- * configure.in (i[34567]86-*-rtemself*): New configuration.
- * i386/rtemself.h: New file.
-
-Sun Apr 12 21:08:28 1998 Jim Wilson <wilson@cygnus.com>
-
- * loop.c (loop_optimize): Reset max_uid_for_loop after
- find_and_verify_loops call.
- (strength_reduce): In auto_inc_opt code, verify v->insn has valid
- INSN_LUID.
-
-Sun Apr 12 20:54:59 1998 Richard Earnshaw (rearnsha@arm.com)
-
- * configure.in (sparc-*-solaris2*): Add xm-siglist.h to xm_file.
- Add USG and POSIX to xm_defines.
-
-Sun Apr 12 20:47:37 1998 Pat Rankin <rankin@eql.caltech.edu>
-
- * cccp.c (eprint_string): New function.
- (do_elif, do_else, verror): Use it instead of fwrite(,,,stderr).
- (error_from_errno, vwarning): Likewise.
- ({verror,vwarning,pedwarn}_with_line): Likewise.
- (pedwarn_with_file_and_line, print_containing_files): Likewise.
-
-Sun Apr 12 20:40:44 1998 Richard Henderson <rth@dot.cygnus.com>
-
- * configure.in (alpha*-*-linux-gnu*): Add alpha/t-crtbe.
- Add crt{begin,end}.o in extra_parts and delete crt{begin,end}S.o.o
- * alpha/t-crtbe, alpha/crt{begin,end}.asm: New files.
-
- * alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Accept '(' for s/sv/svi.
- * alpha.c (print_operand): Handle it.
- * alpha.md (fix_trunc[ds]fdi2): Use it. Add earlyclobber pattern
- for ALPHA_TP_INSN.
-
-Sun Apr 12 13:09:46 1998 Scott Christley <scottc@net-community.com>
-
- * objc/encoding.c (objc_sizeof_type, _C_VOID): New case.
-
-Sun Apr 12 13:04:55 1998 Nikolay Yatsenko (nikolay@osf.org)
-
- * configure.in (i[34567]86-*-osf1*): New entry.
- * i386/osf1-c[in].asm: New files for OSF/1.
- * i386/osf1elf{,gdb}.h, i386/[xt]-osf1elf, i386/xm-osf1elf.h: Likewise.
-
-Sun Apr 12 10:03:51 1998 Noel Cragg <noel@red-bean.com>
-
- * fixincludes: Remove specification of parameters when renaming
- functions in Alpha DEC Unix include files.
-
-Sun Apr 12 07:33:46 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * mips.c (large_int): Use HOST_WIDE_INT, not int.
- (print_operand): Use HOST_WIDE_INT_PRINT_* macros.
-
- * toplev.c (main): Sort order of handling of -d letters.
- Use `F' instead of `D' for addressof_dump.
-
- * libgcc2.c (_eh_compat): Deleted.
- * Makefile.in (LIB2FUNCS): Delete _eh_compat.
-
- * configure.in (alpha*-*-linux-gnu*): Don't include alpha/xm-linux.h.
-
- * c-common.c (check_format_info): Properly test for nested pointers.
-
- * pa.md (casesi0): Add missing mode for operand 0.
-
- * function.c (purge_addressof_1, case MEM): If BLKmode, put ADDRESSOF
- into stack.
-
- * c-parse.in (label): Give warning if pedantic and label not integral.
-
- * c-decl.c (grokdeclarator): Don't warn about return type if in
- system header.
-
- * reload.c (reload_nongroup): New variable.
- (push{_secondary,}_reload): Initialize it.
- (find_reloads): Compute it.
- (debug_reload): Print it.
- * reload.h (reload_nongroup): Declare.
- * reload1.c (reload): Use reload_nongroup instead of local computation.
- Check caller_save_spill_class against any nongroup reloads.
- (reloads_conflict): No longer static.
-
-Sun Apr 12 05:52:18 1998 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * vax.md (call patterns): Operand 1 is always a CONST_INT.
-
-Sat Apr 11 16:01:11 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * convert.c (convert_to_{pointer,integer,real,complex}): Use switch.
- Add missing integer-like types.
- Simplify return of zero in error case.
- (convert_to_pointer): Remove dubious abort.
- (convert_to_integer, case POINTER_TYPE): Make recursive call.
- (convert_to_integer, case COND_EXPR): Always convert arms.
- * tree.c (type_precision): Deleted.
-
- * cccp.c (do_warning): Give pedantic warning if -pedantic and not
- in system file.
- * cpplib.c (do_warning): Likewise.
-
- * function.c (target_temp_slot_level): Define here.
- (push_temp_slots_for_target, {get,set}_target_temp_slot_level): New.
- * stmt.c (target_temp_slot_level): Don't define here.
- * expr.h (temp_slot_level): New declaration.
-
-Fri Apr 10 16:35:48 1998 Paul Eggert <eggert@twinsun.com>
-
- * c-common.c (decl_attributes): Support strftime format checking.
- (record_function_format, {check,init_function}_format_info): Likewise.
- (enum format_type): New type.
- (record_function_format): Now static; takes value of type
- enum format_type instead of int.
- (time_char_table): New constant.
- (struct function_format_info): format_type member renamed from is_scan.
- (check_format_info): Use `warning' rather than sprintf followed by
- `warning', to avoid mishandling `%' in warnings.
- Change a `pedwarn' to `warning'.
- * c-tree.h (record_function_format): Remove decl.
-
-Thu Apr 2 17:34:27 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * regclass.c (memory_move_secondary_cost): Protect uses of
- SECONDARY_{INPUT,OUTPUT}_RELOAD_CLASS with #ifdef tests.
-
-Thu Apr 2 07:06:57 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.c (standard_68881_constant_p): Don't use fmovecr on 68060.
-
-Thu Apr 2 06:19:25 1998 Ken Raeburn <raeburn@cygnus.com>
-
- * Makefile.in (version.c): Put "cvs log" output in build directory.
-
- * reload.h (MEMORY_MOVE_COST): Define here if not already defined.
- (memory_move_secondary_cost): Declare.
- * regclass.c (MEMORY_MOVE_COST): Don't define default here.
- (memory_move_secondary_cost) [HAVE_SECONDARY_RELOADS]: New function.
- (regclass, record_reg_classes, copy_cost, record_address_regs):
- Pass register class and direction of move to MEMORY_MOVE_COST.
- (top_of_stack) [HAVE_SECONDARY_RELOADS]: New static array.
- (init_regs) [HAVE_SECONDARY_RELOADS]: Initialize it.
- * reload1.c (MEMORY_MOVE_COST): Don't define default here.
- (emit_reload_insns, reload_cse_simplify_set): Pass register class
- and direction of move to MEMORY_MOVE_COST.
- * 1750a.h (MEMORY_MOVE_COST): Add extra ignored arguments.
- * a29k.h, alpha.h, arc.h, arm.h, dsp16xx.h, i386.h, m32r.h: Likewise.
- * m88k.h, rs6000.h: Likewise.
- * mips.h (MEMORY_MOVE_COST): Likewise.
- Add memory_move_secondary_cost result to cpu-specific cost.
-
-Mon Mar 30 13:56:30 1998 Jim Wilson <wilson@cygnus.com>
-
- * mips/ultrix.h (SUBTARGET_CPP_SPEC): Define.
-
-Wed Mar 25 16:09:01 1998 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.h (FUNCTION_ARG_PADDING): Cast result to be enum direction.
- (function_arg_padding): Declare.
-
- * rs6000.c: Include stdlib.h if we have it.
- (function_arg_padding): Change return type to int, cast enum's to int.
-
- (From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>)
- * rs6000.c (rs6000_override_options): Change type of `i', `j' and
- `ptt_size' from int to size_t.
- (rs6000_file_start): Likewise for `i'.
- (rs6000_replace_regno): Add default case in enumeration switch.
- (output_epilog): Remove unused variable `i'.
- (rs6000_longcall_ref): Remove unused variables `len', `p', `reg[12]'.
-
- * rs6000.h (ADDITIONAL_REGISTER_NAMES): Add missing braces around
- initializer.
- (get_issue_rate, non_logical_cint_operand): Add prototype.
- (rs6000_output_load_toc_table): Likewise.
-
- * rs6000.md (udivmodsi4): Add explicit braces to avoid ambiguous
- `else'.
-
-Wed Mar 25 02:39:01 1998 Paul Eggert <eggert@twinsun.com>
-
- * configure.in (i[[34567]]86-*-solaris2*, powerpcle-*-solaris2*,
- sparc-*-solaris2*): Use fixinc.svr4 if Solaris 2.0 through 2.4.
-
-Mon Mar 23 07:27:19 1998 Philippe De Muyter <phdm@macqel.be>
-
- * m68k.md (ashldi_const): Allow shift count in range ]32,63].
- (ashldi3): Allow constant shift count in range ]32,63].
- (ashrdi_const, ashrid3, lshrdi_const, lshrdi3): Likewise.
-
- * m68k.md (zero_extend[qh]idi2, iordi_zext): New patterns.
- (zero_extendsidi2): Avoid useless copy.
- (iorsi_zexthi_ashl16): Avoid "0" constraint for operand 2.
- (iorsi_zext): New name for old unnamed pattern; indentation fixes.
-
-Mon Mar 23 07:12:05 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * final.c (only_leaf_regs_used): If pic_offset_table_rtx used,
- make sure it is a permitted register.
-
-Sun Mar 22 06:57:04 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expmed.c (extract_bit_field): Don't confuse SUBREG_WORD with
- endian adjustment in SUBREG case.
- Don't abort if can't make SUBREG needed for extv/extzv.
-
-Sat Mar 21 08:02:17 1998 Richard Gorton <gorton@amt.tay1.dec.com>
-
- * alpha.md (zero_extendqi[hsd]i2): Use "and", not "zapnot".
-
-Sat Mar 21 07:47:04 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * unroll.c (verify_addresses): Use validate_replace_rtx.
- (find_splittable_givs): If invalid address, show nothing same_insn.
-
-Fri Mar 20 10:24:12 1998 Philippe De Muyter <phdm@macqel.be>
-
- * fold-const.c (fold, case CONVERT_EXPR): Replace sign-extension of
- a zero-extended value by a single zero-extension.
-
-Thu Mar 19 14:59:32 1998 Andrew Pochinsky <avp@ctp.mit.edu>
-
- * sparc.h (ASM_OUTPUT_LOOP_ALIGN): Fix error in last change.
-
-Thu Mar 19 14:48:35 1998 Michael Meissner <meissner@cygnus.com>
-
- * gcc.c (default_arg): Don't wander off the end of allocated memory.
-
- * rs6000/sysv4.h (RELATIVE_PREFIX_NOT_LINKDIR): Undef for System V
- and EABI.
-
-Thu Mar 19 06:17:59 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (toplev.o): Depend on Makefile.
-
-Wed Mar 18 17:40:09 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * expr.c (convert_move): Add [QH]Imode/P[QH]Imode conversions.
- * machmode.def (PQImode, PHImode): New modes.
-
-Wed Mar 18 17:11:18 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.md (movsf+1): Optimize moving a CONST_DOUBLE zero.
-
-Wed Mar 18 17:07:54 1998 Ken Raeburn <raeburn@cygnus.com>
-
- * regclass.c (init_reg_sets): Delete init of reg-move cost tables.
- (init_reg_sets_1): Put it here.
-
-Wed Mar 18 16:43:11 1998 Jim Wilson <wilson@cygnus.com>
-
- * i960.md (tablejump): Handle flag_pic.
-
- * profile.c (branch_prob): If see computed goto, call fatal.
-
- * calls.c (expand_call): Fix typos in n_named_args computation.
-
-Wed Mar 18 05:54:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * fold-const.c (operand_equal_for_comparison_p): See if equal
- when nop conversions are removed.
-
- * expr.c (expand_expr, case COND_EXPR): If have conditional move,
- don't use ORIGINAL_TARGET unless REG.
-
- * function.c (fixup_var_refs_insns): Also delete insn storing pseudo
- back into arg list.
-
- * combine.c (gen_binary): Don't make AND that does nothing.
- (simplify_comparison, case AND): Commute AND and SUBREG.
- * i386.h (CONST_CONSTS, case CONST_INT): One-byte integers are cost 0.
-
-Mon Mar 16 15:57:17 1998 Geoffrey Keating <geoffk@ozemail.com.au>
-
- * rs6000.c (small_data_operand): Ensure any address referenced
- relative to small data area is inside SDA.
-
-Sun Mar 15 16:01:19 1998 Andrew Pochinsky <avp@ctp.mit.edu>
-
- * sparc.h (ASM_OUTPUT_LOOP_ALIGN): Write nop's.
-
-Sun Mar 15 15:53:39 1998 Philippe De Muyter <phdm@macqel.be>
-
- * libgcc2.c (exit): Don't call __bb_exit_func if HAVE_ATEXIT.
-
-Sun Mar 15 15:44:41 1998 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c: Fix bugs relating to NUL in input file name,
- e.g. with `#line 2 "x\0y"'.
- (PRINTF_PROTO_4): New macro.
- (struct {file_buf,definition,if_stack}): New member nominal_fname_len.
- (main, expand_to_temp_buffer): Store length of input file names.
- (finclude, create_definition, do_line, conditional_skip): Likewise.
- (skip_if_group, macroexpand): Likewise.
- (make_{definition,undef,assertion}): Likewise.
- (special_symbol, do_include): Use stored length of input file names.
- (do_define, do_elif, do_else, output_line_directive, verror): Likewise.
- (error_from_errno, vwarning, verror_with_line): Likewise.
- (vwarning_with_line, pedwarn_with_file_and_line): Likewise.
- (print_containing_files): Likewise.
- (do_line): Fix off-by-1 problem: 1 too many bytes were being allocated.
- (quote_string, pedwarn_with_file_and_line): New arg specifies length.
- All callers changed.
-
-Sun Mar 15 15:38:16 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-typeck.c: Collect pending initializers in AVL tree instead of list.
- (add_pending_init, pending_init_member): New functions.
- (output_init_element): Use them.
- (output_pending_init_elements): Rewritten to exploit AVL order.
-
-Sun Mar 15 05:10:49 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * gnu.h (GNU_CPP_PREDEFINES): Deleted; not valid in traditional C.
- * {i386,mips}/gnu.h (CPP_PREDEFINES): Don't call GNU_CPP_PREDEFINES.
-
- * flow.c (insn_dead_p): A CLOBBER of a dead pseudo is dead.
-
- * alpha.h (REG_ALLOC_ORDER): Put $f1 after other nonsaved.
-
- * sparc.c (sparc_type_code): Fix error in previous change.
-
-Sat Mar 14 05:45:21 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386/xm-aix.h, i386/xm-osf.h (i386/xm-i386.h): Don't include.
- (USG): Don't define.
- * i386/xm-isc.h (i386/xm-sysv3.h): Don't include.
- * i386/xm-sco.h (i386/xm-sysv3.h): Likewise.
- (BROKEN_LDEXP, SMALL_ARG_MAX, NO_SYS_SIGLIST): Don't define.
- * m68k/xm-3b1.h (m68k/xm-m68k.h): Don't include.
- (USG): Don't define.
- * m68k/xm-atari.h (m68k/xm-m68kv.h): Don't include.
- (HAVE_VPRINTF, FULL_PROTOTYPES): Don't define.
- * m68k/xm-crds.h (m68k/xm-m68k.h): Don't include.
- (USE_C_ALLOCA, unos, USG): Don't define.
- * m68k/xm-mot3300.h (m68k/xm-m68k.h): Don't include.
- (USE_C_ALLOCA, NO_SYS_SIGLIST): Don't define.
- * m68k/xm-plexus.h (m68k/xm-m68k.h): Don't include.
- (USE_C_ALLOCA, USG): Don't define.
- * m88k/xm-sysv3.h (m88k/xm-m88k.h): Don't include.
- * m68k/xm-next.h (m68k/xm-m68k.h): Don't include.
- * ns32k/xm-pc532-min.h (ns32k/xm-ns32k.h): Don't include.
- (USG): Don't define.
- * rs6000/xm-mach.h: Don't include xm-rs6000.h.
- * rs6000/xm-cygwin32.h (rs6000/xm-rs6000.h): Don't include.
- (NO_STAB_H): Don't define.
- * sparc/xm-linux.h (xm-linux.h): Don't include.
- * sparc/xm-sol2.h (sparc/xm-sysv4.h): Don't include.
- * a29k/xm-unix.h, alpha/xm-linux.h, arm/xm-linux.h: Deleted.
- * arm/xm-netbsd.h, i386/xm-bsd386.h, i386/xm-gnu.h: Deleted.
- * i386/xm-linux.h, i386/xm-sun.h, i386/xm-sysv3.h: Deleted.
- * i386/xm-winnt.h, m68k/xm-altos3068.h, m68k/xm-amix.h: Deleted.
- * m68k/xm-amix.h, m68k/xm-hp320.h, m68k/xm-linux.h: Deleted.
- * m68k/xm-m68kv.h, mips/xm-iris5.h, ns32k/xm-genix.h: Deleted.
- * sparc/xm-pbd.h, vax/xm-vaxv.h, xm-svr3.h, xm-linux.h: Deleted.
- * configure.in: Reflect above changes.
-
- * xm-siglist.h, xm-alloca.h: New files.
- * i386/xm-sysv4.h (i386/xm-i386.h, xm-svr4.h): Don't include.
- (USE_C_ALLOCA, SMALL_ARG_MAX): Don't define.
- * i386/xm-sco5.h (i386/xm-sysv3.h): Don't include.
- (SYS_SIGLIST_DECLARED, USE_C_ALLOCA): Don't define.
- * rs6000/xm-sysv4.h, sparc/xm-sysv4.h: Don't include xm-svr4.h.
- * xm-svr4.h, i386/xm-dgux.h, mips/xm-news.h, mips/xm-sysv4.h: Deleted.
- * configure.in: Reflect above changes.
-
- * configure.in ({,host_,build_}xm_defines): New variables.
- Set to USG instead of including xm-usg.h.
- Write #define lines in config.h files from xm_defines vars.
- * xm-usg.h: Deleted.
-
-Fri Mar 13 07:10:59 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * calls.c (expand_call): Fix typo in previous change.
-
- * sparc.c (sparc_type_code): Avoid infinite loop when have
- pointer to array of same pointer.
- (sparc_type_code, case REAL_TYPE): Process subtypes here too.
-
- * mips/bsd-4.h, mips/iris3.h, mips/news{4,5}.h: Don't include mips.h.
- * mips/news5.h, mips/osfrose.h, mips/svr{3,4}-4.h: Likewise.
- * mips/ultrix.h: Likewise.
- * mips/cross64.h: Don't include iris6.h.
- * mips/ecoff.h: Don't include mips.h or gofast.h.
- * mips/elforion.h: Don't include elf64.h.
- * mips/iris4.h: Don't include iris3.h.
- * mips/iris4loser.h: Don't include iris4.h.
- * mips/iris5gas.h: Don't include iris5.h.
- * mips/elflorion.h, mips/nws3250v4.h, mips/xm-iris{3,4}.h: Deleted.
- * mips/xm-nws3250v4.h, mips/xm-sysv.h: Deleted.
- * mips/rtems64.h: Don't include elflorion.h.
- * mips/sni-gas.h: Don't include sni-svr4.h.
- * mips/svr4-t.h: Don't include svr4-5.h.
- * mips/dec-osf1.h: Also include mips.h.
- * mips/ecoffl.h, mips/elf.h: Also include mips.h and gofast.h.
- * mips/iris5.h: Also include iris3.h and mips.h.
- * xm-usg.h: New file.
- * mips/xm-iris5.h: Don't include xm-mips.h; don't define USG.
- * mips/xm-news.h, mips/xm-sysv4.h: Don't include xm-sysv.h.
- * configure.in: Reflect above changes.
-
-Thu Mar 12 07:18:48 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.h (STRICT_ARGUMENT_NAMING): Provide default value of 0.
- * calls.c (expand_call): Use value of STRICT_ARGUMENT_NAMING.
- * function.c (assign_parm): Likewise.
- * mips/abi64.h (STRICT_ARGUMENT_NAMING): Return 0 for ABI_32.
- * sparc.h (STRICT_ARGUMENT_NAMING): Only nonzero for V9.
-
- * calls.c (expand_call, expand_library_call{,_value}, store_one_arg):
- Rework handling of REG_PARM_STACK_SPACE to treat return value of
- zero as if macro not defined; add new arg to emit_push_insn.
- * expr.c (emit_push_insn): New arg, REG_PARM_STACK_SPACE.
- * expr.h (emit_push_insn): Likewise.
- * mips/abi64.h (REG_PARM_STACK_SPACE): Define.
-
-Wed Mar 11 06:58:13 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k.h (CONST_OK_FOR_LETTER_P, case 'M'): Correct range check.
-
-Wed Mar 11 06:15:52 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (emit_push_insn): Use loop to find movstr patterns
- instead of explicit tests.
-
- * Makefile.in (extraclean): Don't delete install1.texi.
-
-Tue Mar 10 14:27:51 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * combine.c (make_field_assignment): Don't get confused if OTHER
- has VOIDmode and don't do anything if DEST is wider than a host word.
-
- * vax.c (check_float_value): Cast bcopy args to char *.
-
-Tue Mar 10 13:56:12 1998 Jim Wilson <wilson@cygnus.com>
-
- * mips/abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and
- TARGET_DEFAULT and define __LONG_MAX__ appropriately.
- Add support for -mabi=X, -mlong64, and -mgp{32,64} options.
- * mips.c (mips_abi): Change type to int.
- * mips.h (enum mips_abi_type): Delete.
- (ABI_32, ABI_N32, ABI_64, ABI_EABI): Define as constants.
- (mips_abi): Change type to int.
-
-Mon Mar 2 08:06:58 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Version 2.8.1 released.
-
- * Makefile.in (mostlyclean): Remove duplicate deletion of temp
- files. Delete more stamp files and [df]p-bit.c
- (clean): Don't delete stamp files here.
- (VERSION_DEP): New variable.
- (distdir-finish): Pass a value of null for it.
- (version.c): Use it.
- Avoid broken pipe with cvs log.
-
- * objc/Make-lang.in (objc/runtime-info.h): Rename emptyfile to
- tmp-runtime and delete at end.
-
-Sun Mar 1 05:50:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * tree.c (build_reference_type): Handle obstacks like
- build_pointer_type.
-
- * Makefile.in (tmp-gcc.xtar): Renamed from gcc.xtar.
- (gcc.xtar.gz): Deleted; merged with `dist'.
- (diff): Create gcc-$(oldversion)-$(version).diff.
- (distdir): Depend on distdir-cvs.
- (distdir-cvs): New rule.
- (distdir-start): Depend on version.c and TAGS.
- (TAGS): Use tmp-tags instead of temp.
- (dist): Create gcc-$(version).tar.gz.
-
- * varasm.c (compare_constant_1): Fix typo in previous change.
-
- * objc/Make-lang.in (objc-distdir): Properly rebuild objc-parse.c.
-
-Sat Feb 28 16:58:08 1998 Tristan Gingold <gingold@rossini.enst.fr>
-
- * stmt.c (expand_decl): If -fcheck-memory-usage, put vars in memory.
- * expr.c (get_memory_usage_from_modifier): Convert
- EXPAND_{CONST_ADDRESS, INITIALIZER} to MEMORY_USE_DONT.
-
-Sat Feb 28 08:13:43 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i860/fx2800.h (DATA_ALIGNMENT): Use POINTER_TYPE_P.
- * m68k/a-ux.h (FUNCTION_VALUE): Likewise.
- * expr.c (get_pointer_alignment, compare, do_store_flag): Likewise.
- (expand_builtin): Likewise.
- * fold-const.c (force_fit_type, fold_convert, fold): Likewise.
- * function.c (assign_parms): Likewise.
- * integrate.c (expand_inline_function): Likewise.
- * sdbout.c (sdbout_field_types): Likewise.
- * tree.c (integer_pow2p, tree_log2, valid_machine_attribute): Likewise.
- * stmt.c (expand_decl): Likewise.
- ({,bc_}expand_decl_init): Also test for REFERENCE_TYPE.
-
- * configure.in (version_dep): New variable; if srcdir is CVS working
- directory, set to ChangeLog.
- (version): Supply default if no version.c.
- * Makefile.in (version.c): New rule.
-
- * gcc.c (snapshot_warning): New function.
- (main): Call it for snapshots.
-
- * dwarf2out.c (expand_builtin_dwarf_reg_size): If reg_raw_mode
- not valid for reg, use last size. Also refine range assertion.
-
-Sat Feb 28 05:04:47 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * enquire.c (cprop): Don't perform exhaustive search for char_min
- and char_max when bits_per_byte > 16.
-
-Thu Feb 26 15:12:03 1998 Christopher Taylor <cit@ckshq.com>
-
- * fixincludes: Avoid using '0-~' in egrep.
-
-Thu Feb 26 08:04:05 1998 Tristan Gingold <gingold@messiaen.enst.fr>
-
- * function.c (assign_parms): Call 'chkr_set_right' when DECL_RTL
- is stack_parm.
- * expr.c (get_memory_usage_from_modifier): Convert
- EXPAND_{SUM, CONST_ADDRESS, INITIALIZER} to MEMORY_USE_RO.
-
-Thu Feb 26 07:33:53 1998 Paul Eggert <eggert@twinsun.com>
-
- * c-lex.c (yylex): Don't munge errno before using it.
- * cccp.c (error_from_errno, perror_with_name): Likewise.
- * cpplib.c (cpp_error_from_errno): Likewise.
- * gcc.c (pfatal_pexecute): Likewise.
- * protoize.c (safe_write, find_file, process_aux_info_file): Likewise.
- (rename_c_file, edit_file): Likewise.
-
- * c-lex.c (yylex): Remove unused variable exceeds_double.
-
-Thu Feb 26 07:05:14 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * reorg.c (fill_slots_from_thread): Don't steal delay list from target
- if condition code of jump conflicts with opposite_needed.
-
-Thu Feb 26 06:45:23 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (distdir-start): Don't copy CVS subdirectory of config.
-
- * varasm.c ({compare,record}_constant_1, case CONSTRUCTOR):
- Handle the case when we have TREE_PURPOSE values.
-
-Thu Feb 26 05:59:01 1998 Philippe De Muyter <phdm@macqel.be>
-
- * fixincludes (sys/limits.h): Fix a nested comment problem with
- HUGE_VAL definition on sysV68 R3V7.1.
-
-Wed Feb 25 21:09:38 1998 Philippe De Muyter <phdm@macqel.be>
-
- * toplev.c (TICKS_PER_SECOND): Renamed from CLOCKS_PER_SECOND.
-
-Wed Feb 25 20:50:08 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * reorg.c (fill_slots_from_thread): Mark resources referenced in
- opposite_needed thread. Return delay_list even when cannot get
- any more delay insns from end of subroutine.
-
-Wed Feb 25 19:50:01 1998 Mikael Pettersson <Mikael.Pettersson@sophia.inria.fr>
-
- * gcc.c (lookup_compiler): Remove redundant test.
-
-Wed Feb 25 07:24:22 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * vax.md (call insns): Second operand to CALL rtl is SImode.
-
- * configure.in (i[34567]86-*-mingw32): Support msv and crt suffix.
- * i386/crtdll.h: New file.
-
- * sparc.c (pic_setup_code): If -O0, write USE of pic_offset_table_rtx.
-
- * expr.c (safe_from_p): Add new arg, TOP_P; all callers changed.
-
-Sat Feb 21 07:02:39 1998 Jim Wilson <wilson@cygnus.com>
-
- * mips/iris5.h (DWARF2_UNWIND_INFO): Define to 0.
- * mips/iris5gas.h (DWARF2_UNWIND_INFO): Define to 1.
-
-Fri Feb 20 08:27:46 1998 Paul Eggert <eggert@twinsun.com>
-
- * sparc/sol2-sld.h: New file.
- * configure.in (sparc-*-solaris2*): Use it when using system linker.
- * toplev.c (main): Don't default to DWARF2_DEBUG with -ggdb
- if LINKER_DOES_NOT_WORK_WITH_DWARF2 is defined.
-
-Fri Feb 20 08:21:49 1998 H.J. Lu (hjl@gnu.org)
-
- * alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Support shared library.
- (LIB_SPEC, DEFAULT_VTABLE_THUNKS): Defined #ifndef USE_GNULIBC_1.
- * sparc/linux.h (DEFAULT_VTABLE_THUNKS): Likewise.
- (LIB_SPEC): Add -lc for -shared #ifndef USE_GNULIBC_1.
- * linux.h (LIB_SPEC): Likewise.
- * sparc/linux64.h (LIB_SPEC): Likewise; also updated for glibc 2.
- (LIBGCC_SPEC): Removed.
- (CPP_SUBTARGET_SPEC): Add %{pthread:-D_REENTRANT}.
-
-Fri Feb 20 05:22:12 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (distdir-start): Add dependence on bi-parser.[ch].
-
-Thu Feb 19 18:07:11 1998 Jim Wilson <wilson@cygnus.com>
-
- * m68k.h (TARGET_SWITCHES): For 68000, 68302, subtract MASK_68881.
- For 68303, 68332, cpu32, subtract MASK_68040_ONLY.
-
-Wed Feb 18 09:37:29 1998 Paul Eggert <eggert@twinsun.com>
-
- * fixincludes (stdlib.h): Do not double-wrap the size_t typedef.
-
-Wed Feb 18 07:32:11 1998 Jim Wilson <wilson@cygnus.com>
-
- * i960.c (emit_move_sequence): Handle unaligned stores to pseudos.
- * i960.md (store_unaligned_[dt]i_reg): Handle register dest.
- (store_unaligned_ti_reg): Likewise.
-
- * m68k.h (MACHINE_STATE_{SAVE,RESTORE} [MOTOROLA]): Add %# and %/;
- add : to make them into extended asms.
-
-Wed Feb 18 07:08:05 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * reg-stack.c (compare_for_stack_reg): Only handle FP conditional
- move as next insn specially.
-
- * reload.c (find_reloads): Always convert address reload for
- non-reloaded operand to RELOAD_FOR_OPERAND_ADDRESS.
-
- * emit-rtl.c (hard-reg-set.h): Include.
- (get_lowpart_common): Don't make new REG for hard reg in a
- class that cannot change size.
- * Makefile.in (emit-rtl.o): Depend on hard-reg-set.h.
-
-Sat Feb 14 09:59:00 1998 Richard Earnshaw (rearnsha@arm.com)
-
- * arm.md (movsfcc): Also validate operands[3] for hard float.
- (movdfcc): Only accept fpu_add_operand for operands[3].8
-
-Sat Feb 14 09:32:34 1998 Jim Wilson <wilson@cygnus.com>
-
- * dwarf2out.c (expand_builtin_dwarf_reg_size): New variable mode.
- Convert CCmode to word_mode before calling GET_MODE_SIZE.
-
-Sat Feb 14 09:27:42 1998 David Edelsohn <edelsohn@mhpcc.edu>
-
- * rs6000.h (MY_ISCOFF): Check for U803XTOCMAGIC.
-
-Sat Feb 14 08:29:43 1998 Arvind Sankar <arvind@cse.iitb.ernet.in>
-
- * t-svr4 (TARGET_LIBGCC_CFLAGS): New definition.
-
-Sat Feb 14 07:45:16 1998 Ken Rose (rose@acm.org)
-
- * reorg.c (fill_slots_from_thread): New parameter, delay_list.
- All callers changed.
-
-Sat Feb 14 07:14:02 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * reload.c (debug_reload): Properly output insn codes.
-
- * pa.c (emit_move_sequence): If in reload, call find_replacement.
-
- * gansidecl.h (bcopy, bzero, {,r}index): Don't define if IN_LIBGCC2.
-
- * combine.c (distribute_notes, case REG_DEAD): When seeing if place
- to put new note sets register, use reg_bitfield_target_p, as in
- original code.
-
- * gcc.c (process_command): If file is for linker, set lang to "*".
- (lookup_compiler): Return 0 for language of "*".
-
- * sched.c (attach_deaths, case SUBREG): Fix error in last change.
-
- * i386.md (mov[sdx]fcc): Disable for now.
- (mov[sd]fcc_1): Add earlyclobber for output on last alternative.
-
-Sat Feb 14 06:42:50 1998 Jason Merrill <jason@yorick.cygnus.com>
-
- * except.c (get_dynamic_handler_chain): Only make call once per func.
- (expand_fixup_region_{start,end}): New functions.
- (expand_eh_region_start_tree): Store cleanup into finalization here.
- * stmt.c (expand_cleanups): Use new functions to protect fixups.
-
- * except.c (get_dynamic_handler_chain): Build up a FUNCTION_DECL.
- * optabs.c (init_optabs): Don't init get_dynamic_handler_chain_libfunc.
- * expr.h (get_dynamic_handler_chain_libfunc): Deleted.
-
-Sat Feb 14 06:34:41 1998 Peter Lawrence <Peter.Lawrence@Eng.Sun.COM>
-
- * optabs.c (emit_conditional_move): Don't reverse condition for FP.
-
-Fri Feb 13 07:22:04 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (mostlyclean): Only use s-* convention for stamp
- files in main dir.
-
- * configure.in: Add support for i786 (Pentium II); same as i686.
-
-Thu Feb 12 20:16:35 1998 Michael Meissner <meissner@cygnus.com>
-
- * rs6000.md: Replace gen_rtx (CONST_INT,...) with GEN_INT.
-
-Thu Feb 12 10:08:14 1998 John Hassey <hassey@dg-rtp.dg.com>
-
- * configure.in (i[3456]86-dg-dgux*): Don't need fixincludes.
-
-Thu Feb 12 07:27:39 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * i386/cygwin32.h (NO_IMPLICIT_EXTERN_C): Define.
- about system headers.
- (LIB_SPEC): Add -ladvapi32 -lshell32.
-
-Thu Feb 12 07:19:31 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_assignment): Fix typo in checking OFFSET.
-
- * gbl-ctors.h (atexit): Don't define unless needed.
-
- * combine.c (distribute_notes): Completely check for note operand being
- only partially set on potential note target; adjust what notes
- we make in that case.
-
- * i386/xm-go32.h (HAVE_{BCOPY,BZERO,INDEX,RINDEX}): Deleted.
-
-Wed Feb 11 08:53:27 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * calls.c (emit_call_1): Size args now HOST_WIDE_INT.
- (expand_call): struct_value_size now HOST_WIDE_INT.
-
-Tue Feb 10 09:04:39 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * integrate.c (initialize_for_inline): Ensure DECL_INCOMING_RTL
- is always copied.
-
-Tue Feb 10 06:10:49 1998 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c (rescan): Fix bug with macro name appearing
- immediately after L'x'.
-
-Mon Feb 9 20:45:32 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * c-common.c (format_char_info): Add new field zlen.
- (print_char_table): Remove entry for 'Z' as a format character.
- Initialize zlen field as appropriate.
- (scan_char_table): Set zlen field to NULL in each entry.
- (check_format_info): Recognize 'Z' as a length modifier, with a
- warning in pedantic mode.
- Avoid infinite loop when a repeated flag character is detected.
-
-Mon Feb 9 09:24:04 1998 Paul Eggert <eggert@twinsun.com>
-
- * c-parse.in (primary): Minor wording fix in diagnostic.
-
-Mon Feb 9 07:50:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * c-decl.c (grokdeclarator): Remove warning on inline of varargs.
-
- * reload.c (find_reloads): Check for const_to_mem case before
- checking for invalid reload; use force_const_mem if no_input_reloads.
-
- * function.c (push_function_context_to): Call init_emit last.
-
- * protoize.c (my_link): Define as -1 in mingw32.
- (link): Remove declaration.
-
- * rs6000.c (setup_incoming_varargs): Always set rs6000_sysv_varargs_p.
-
- * integrate.c (expand_inline_function): Clear label_map with bzero.
-
- * unroll.c (copy_loop_body, case JUMP_INSN): Correct error in last
- change: call single_set on COPY, not INSN.
-
-Sun Feb 8 08:07:37 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * msdos/top.sed, winnt/config-nt.sed: Change version number to 2.8.1.
-
- * configure.in (i[3456]86-*-sco3.2v5*): Use cpio for headers.
-
-Sat Feb 7 07:32:46 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386/mingw32.h (LIBGCC_SPEC, STARTFILE_SPEC, MATH_LIBRARY):
- Use msvcrt, not crtdll.
-
-Fri Feb 6 20:32:06 1998 Geert Bosch <bosch@gnat.com>
-
- * i386/xm-os2.h (EMX, USG, BSTRING, HAVE_{PUTENV,VPRINTF,STRERROR}):
- Define ifdef __EMX__.
- (strcasecmp): Define to be stricmp if __EMX__.
- (spawnv{,p}): Don't define if EMX.
- (OBJECT_SUFFIX): Don't define if EMX.
- (MKTEMP_EACH_FILE): Define.
-
-Fri Feb 6 16:37:29 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * objc/Make-lang.in (objc.stage1): Depend on stage1-start.
- (objc.stage2, objc.stage3, objc.stage4): Likewise for the
- respective stageN-start targets.
- (objc/sendmsg.o): Depend on objc/runtime-info.h.
-
-Fri Feb 6 16:27:09 1998 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
-
- * stmt.c (expand_asm_operands): Properly treat asm statement
- statements with no operands as volatile.
-
-Fri Feb 6 16:03:25 1998 Greg McGary <gkm@gnu.org>
-
- * c-decl.c (pushdecl): Set DECL_ORIGINAL_TYPE once only.
-
-Fri Feb 6 15:57:36 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * i386/cygwin32.h (STRIP_NAME_ENCODING): New macro.
-
-Fri Feb 6 15:50:42 1998 Paul Eggert <eggert@twinsun.com>
-
- * libgcc2.c (__floatdi[xtds]f): Round properly even when rounding
- large negative integer to plus or minus infinity.
-
-Fri Feb 6 15:45:16 1998 Philippe De Muyter <phdm@macqel.be>
-
- * sdbout.c (plain_type_1): Return T_DOUBLE, not T_VOID, for
- long double #ifndef EXTENDED_SDB_BASIC_TYPES.
-
-Fri Feb 6 15:23:49 1998 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * vax/ultrix.h (HAVE_ATEXIT): Define.
- * x-vax: File deleted.
-
-Fri Feb 6 14:34:19 1998 Douglas Rupp <rupp@gnat.com>
-
- * gcc.c (process_command, case "-dumpversion"): Print spec_version.
-
-Fri Feb 6 11:01:13 1998 Josh Littlefield <josh@american.com>
-
- * i386/gmon-sol2.c (internal_mcount): Do set-up when program starts
- and install hook to do clean-up when it exits.
- * i386/sol2-c1.asm (_mcount): Make a weak instead of global symbol.
- * i386/sol2dbg.h (ASM_SPEC): Support Solaris bundled assembler's -V
- argument; pass -s argument to assembler.
-
-Fri Feb 6 09:13:21 1998 Jim Wilson (wilson@cygnus.com)
-
- * function.c (assign_parms): New variable named_arg, with value
- depending on STRICT_ARGUMENT_NAMING. Use instead of ! last_named.
-
- * crtstuff.c (__frame_dummy): New function for irix6.
- (__do_global_ctors): Call __frame_dummy for irix6.
- * mips/iris6.h (LINK_SPEC): Hide __frame_dummy too.
-
-Fri Feb 6 09:08:21 1998 Mike Stump <mrs@wrs.com>
-
- * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after reload.
- * genattrtab.c (reload_completed): Define.
-
- * configure.in (i960-wrs-vxworks): Same as i960-wrs-vxworks5*.
-
-Fri Feb 6 08:47:38 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Makefile.in (diff): Add INSTALL, configure, and config.in;
- remove objc-*.
- * objc/config-lang.in (diff_excludes): Add objc-parse.[cy].
-
- * i386/xm-mingw32.h (link): Delete macro.
-
- * alpha.c (output_prolog): Write out frame sizes as longs and
- print too large sizes as zero.
-
- * function.c (combine_temp_slots): No need to allocate and free rtx.
- Don't do anything if too many slots in the list.
- (put_var_into_stack): Don't use ADDRESSOF if not optimizing.
-
- * function.c (purge_addressof_1): Force into mem if VOLATILE reference.
-
- * calls.c (expand_call): Show VAR_DECL made for structure return
- address is used; remove bogus set of MEM_IN_STRUCT_P.
- * expr.c (expand_expr, case SAVE_EXPR, case TARGET_EXPR): Show used.
- (expand_builtin, case BUILT_IN_LONGJMP): Show __dummy used.
- * function.c (put_reg_into_stack): New arg USED_P; all callers changed.
-
- * expr.c (expand_expr, case SAVE_EXPR): assign_temp with KEEP of 3.
- * function.c (var_temp_slot_level): New variable.
- (push_function_context_to, pop_function_context_from): Save/restore
- it and target_temp_slot_level.
- (assign_stack_temp): Implement KEEP of 3.
- (push_temp_slots_for_block): New function.
- (init_temp_slots): Initialize var_temp_slot_level.
- * function.h (struct function, fields {var,target}_temp_slot_level):
- New fields.
- * stmt.c (expand_start_bindings): Call push_temp_slots_for_block.
-
- * function.c (struct temp_slot): SIZE, BASE_OFF_SET, and FULL_SIZE
- now HOST_WIDE_INT.
- (assign_{,outer_}stack_local, assign_{,stack_}temp): Size arg is
- now HOST_WIDE_INT.
- (assign_stack_temp): Do size computations in HOST_WIDE_INT.
- (fixup_var_refs_1, optimize_bit_field, instantiate_decls): Likewise.
- (instantiate_virtual_regs_1, fix_lexical_address): Likewise.
- * rtl.h (assign_stack_{local,temp}): Size arg is HOST_WIDE_INT.
- (assign_temp): Likewise.
- * expr.h (struct args_size): Field CONSTANT is now HOST_WIDE_INT.
-
- * sched.c (attach_deaths, case REG): Don't check for REG_UNUSED.
- (attach_deaths, case SUBREG, STRICT_LOW_PART, {ZERO,SIGN}_EXTRACT):
- Don't pass set_p of 1 if partial assignment.
-
- * tree.h (size_in_bytes): Returns HOST_WIDE_INT.
- * tree.c (size_in_bytes): Likewise.
- Tighen up logic some to avoid returning a bogus value instead of -1.
-
- * expr.c (get_inner_reference, case ARRAY_EXPR): Make WITH_RECORD_EXPR
- just for index.
- (expand_expr, case PLACEHOLDER_EXPR): Refine search again; look
- at each expression and look for pointer to type.
-
- * expr.c (safe_from_p, case ADDR_EXPR): If TREE_STATIC, no trampoline.
- (expand_expr, case ADDR_EXPR): Likewise.
-
- * expr.c (emit_block_move): Use conservative range for movstr mode.
-
- * configure.in: See if "cp -p" works if "ln -s" doesn't; else "cp".
-
- * combine.c (try_combine.c): Pass elim_i2 and elim_i1 to
- distribute_notes for i3dest_killed REG_DEAD note.
-
- * configure.in (mips-dec-netbsd*): Remove bogus setting of prefix.
-
- * c-decl.c (duplicate_decls): Set DECL_IGNORED_P in newdecl if
- different bindings levels.
-
- * configure.in: Test ln -s by symlinking gcc.c.
-
- * configure.in (i[3456]86-dg-dgux): Add wildcard for version.
-
- * crtstuff.c (__do_global_ctors_aux): Switch back to text section
- in proper place.
-
- * rtlanal.c (rtx_varies_p, case REG): pic_offset_table_rtx is fixed.
- * genattrtab.c (pic_offset_table_rtx): Define (dummy).
- * cse.c (set_nonvarying_address_components): Understand PIC refs.
-
- * loop.c (strength_reduce): When placing increment for auto-inc
- case, do comparison in loop order.
-
- * i860.c (output_delayed_branch): Add missing arg to recog.
- (output_delay_insn): Add missing arg to constrain_operands.
-
- * configure.in: Truncate target after finished comparing it with host.
-
- * i386.h (MAX_FIXED_MODE_SIZE): Delete.
-
- * c-parse.in (expr_no_comma): Clarify undefined error.
-
- * prefix.c (get_key_value): Don't default to PREFIX here.
- (translate_name): Remove bogus addition of "$" if getenv fails;
- clean up application of default value of PREFIX.
-
- * fold-const.c (fold_convert): Call force_fit_type even if input
- already overflows.
-
-Fri Feb 6 07:45:01 1998 Robert Hoehne <robert.hoehne@gmx.net>
-
- * i386/xm-go32.h (HAVE_{BCOPY,BZERO,BCMP,RINDEX,INDEX}): Define.
-
- * gcc.c (main): Treat paths starting with '$' or DOS drives
- as absolute in standard_startfile_prefix.
-
-Thu Feb 5 21:07:12 1998 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * cpplib.c (IS_INCLUDE_DIRECTIVE_TYPE): Add casts from enum to int.
- * cccp.c (IS_INCLUDE_DIRECTIVE_TYPE, handle_directive): Likewise.
-
-Thu Feb 5 19:00:44 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (expand_expr, case CONSTRUCTOR): Correct shift count
- when making signed bit field; use EXPAND_NORMAL, not 0.
-
-Thu Feb 5 17:42:43 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * libgcc2.c (__clear_insn_cache): On sysV68 enable the memctl
- stuff only if MCT_TEXT is #define'd.
-
-Thu Feb 5 17:32:01 1998 Robert Hoehne <robert.hoehne@gmx.net>
-
- * Makefile.in: Changed most stamp-* to s-*.
-
-Tue Feb 3 19:45:50 1998 James Hawtin <oolon@ankh.org>
-
- * i386/sol2.h (STARTFILE_SPEC, LIB_SPEC): Update -pg files.
- * configure.in (i[3456]86-*-solaris2*): Add gcrt1.o and gmon.o
- to extra_parts.
-
-Tue Feb 3 17:28:48 1998 Christopher C Chimelis <chris@classnet.med.miami.edu>
-
- * configure.in (alpha*-*-linux-gnu*): Add extra_parts for crtstuff.
-
-Tue Feb 3 17:18:19 1998 Richard Earnshaw <rearnsha@arm.com>
-
- * arm.c (find_barrier): Fix one-too-many bug if fail to find barrier.
-
- * arm.c (arm_reload_in_hi): Handle cases where the MEM is too
- complex for a simple offset.
-
-Tue Feb 3 16:14:21 1998 Robert Hoehne <robert.hoehne@gmx.net>
-
- * i386/xm-go32.h (EXECUTABLE_SUFFIX): Define.
-
- * configure.in (i[3456]86-pc-msdosdjgpp*): New entry.
-
-Tue Feb 3 07:33:58 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * explow.c (probe_stack_range): Properly check for small
- number of probes.
-
- * gcc.c (process_command, case 'V'): Validate arg.
-
- * configure.in (sbrk): Add check for needed declaration.
- * acconfig.h (NEED_DECLARATION_SBRK): New entry.
- * toplev.c (sbrk): Update declaration conditional.
- * mips-tfile.c (sbrk, free): Likewise.
-
- * sparc/sysv4.h (DBX_REGISTER_NUMBER): Remove abort.
-
- * mips.c (mips_expand_prologue): Pass reg 25 to gen_loadgp.
- * mips.md (loadgp): Add second operand for register number to add.
- (builtin_setjmp_receiver): Pass new label and reg 31 to loadgp.
-
- * toplev.c: Include insn-codes.h, insn-config.h, and recog.h.
- (compile_file): Try to emit nop to separate gcc_compiled symbol.
- * Makefile.in (toplev.o): Depends on insn-{codes,config}.h, recog.h.
-
-Tue Feb 3 06:58:46 1998 Mark Mitchell <mmitchell@usa.net>
-
- * integrate.c (get_label_from_map): New function.
- (expand_inline_function): Use it.
- Initialize label_map to NULL_RTX instead of gen_label_rtx.
- (copy_rtx_and_substitute): Use get_label_from_map.
- * integrate.h (get_label_from_map): New function.
- (set_label_from_map): New macro.
- * unroll.c (unroll_loop, copy_loop_body): Use them.
-
-Mon Feb 2 16:33:01 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * i386.md (mov{si,hi,sf,df,xf}cc{,_1}): Remove cases with branches.
-
- * rs6000/x-aix31 (INSTALL): Deleted.
- * mips/x-dec-osf1, mips/x-osfrose, i386/x-osfrose: Likewise.
- * arm/x-riscix: Likewise.
-
- * c-typeck.c (signed_or_unsigned_type): Properly handle pointer types.
-
-Mon Feb 2 15:33:58 1998 Michael P. Hayes <michaelh@ongaonga.chch.cri.nz>
-
- * unroll.c (copy_loop_body): Use single_set instead of
- PATTERN to detect increment of an iv inside a PARALLEL.
-
-Fri Jan 16 20:29:50 1998 Paul Eggert <eggert@twinsun.com>
-
- * toplev.c (<unistd.h>): New include.
- (get_run_time): Prefer CLK_TCK (if available) to HZ, and
- prefer sysconf (_SC_CLK_TCK) (if available) to CLK_TCK.
- * configure.in (sysconf): Call AC_CHECK_FUNCS.
-
-Wed Jan 14 20:10:51 1998 Paul Eggert <eggert@twinsun.com>
-
- * cccp.c: (rescan): Don't report line 0 as the possible real start
- of an unterminated string constant.
- Don't mishandle backslash-newlines that in are the output of
- a macro expansion. Properly skip // style comments between a function
- macro name and '(', as well as backslash-newlines in comments there.
- (handle_directive): Handle / \ newline * between # and directive name.
- In #include directives, \ does not escape ".
- (do_include): For `#include "file', do not bother expanding into temp
- buffer. When error encountered when expanding, do not try result.
- (skip_if_group): When skipping an include directive, use include
- tokenization, not normal tokenization. Backslash-newline is still
- special when skipping. Handle * \ newline / correctly in comments
- when skipping.
- (skip_quoted_string): After \ newline, set *backslash_newlines_p
- even if count_newlines is 0.
- (macroexpand): Newline space is not a special marker inside a string.
- (macroexpand, macarg): Do not generate \ddd for control characters
- when stringifying; the C Standard does not allow this.
- (macarg1): New arg MACRO. All callers changed.
- Do not treat /*, //, or backslash-newline specially when processing
- the output of a macro.
- (discard_comments): Don't go past limit if looking for end of comment.
- Discard backslash-newline properly when discarding comments.
- (change_newlines): \" does not end a string.
- (make_definition): Do not treat backslash-newline specially, as it
- has already been removed before we get here.
-
- * profile.c (output_func_start_profiler): Don't fflush output
- if -quiet.
- * toplev.c (rest_of_compilation): Likewise.
-
- * i386/x-sco5 (CC): Remove trailing white space.
- * x-convex (CCLIBFLAGS): Likewise.
- * arm/t-semi (LIBGCC2_CFLAGS): Likewise.
-
-Wed Jan 7 18:02:42 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * Version 2.8.0 released.
-
-Wed Jan 7 17:54:41 1998 J. Kean Johnston <jkj@sco.com>
-
- * i386/sco5.h ({END,START}FILE_SPEC): Link with correct crtbegin.o
- and crtend.o when using -static.
-
-Wed Jan 7 17:49:14 1998 Jan Christiaan van Winkel <Jan.Christiaan.van.Winkel@ATComputing.nl>
-
- * cppexp.c (gansidecl.h): Include.
-
-Wed Jan 7 17:45:07 1998 Tristan Gingold <gingold@puccini.enst.fr>
-
- * expr.c (get_push_address): Use copy_to_reg instead of force_operand.
- (emit_push_insn): Avoid null pointer deference if aggregate has no
- types.
- (expand_expr): Avoid finite but useless recursion.
- (expand_builtin): Fix typo in calling function.
- * function.c (assign_parms): Avoid useless call to chkr_set_right.
-
-Wed Jan 7 17:31:13 1998 Christian Iseli <Christian.Iseli@lslsun.epfl.ch>
-
- * combine.c (force_to_mode): Return if operand is a CLOBBER.
-
-Wed Jan 7 17:23:24 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * x-rs6000 (INSTALL): Remove.
-
- * jump.c (jump_optimize): Don't use a hard reg as an operand
- of a conditional move if small register classes.
-
-Wed Jan 7 17:09:28 1998 Jim Wilson <wilson@cygnus.com>
-
- * cse.c (max_insn_uid): New variable.
- (cse_around_loop): Use it.
- (cse_main): Set it.
-
-See ChangeLog.11 for earlier changes.
-
-Use a consistent time stamp format in ChangeLog entries.
-Not everyone has Emacs 20 yet, so stick with Emacs 19 format for now.
-
-Local Variables:
-add-log-time-format: current-time-string
-End:
diff --git a/gcc/ChangeLog.GC b/gcc/ChangeLog.GC
index 5bc18f35a8f..17bf7f5d799 100644
--- a/gcc/ChangeLog.GC
+++ b/gcc/ChangeLog.GC
@@ -1,3 +1,7 @@
+Thu Oct 8 16:18:15 1998 Richard Henderson <rth@cygnus.com>
+
+ * Merge from EGCS mainline, tag gc_merge_981008.
+
Sat May 16 14:24:34 1998 Richard Henderson <rth@cygnus.com>
* c-common.c (c_expand_start_cond): Trust xrealloc to function
diff --git a/gcc/INSTALL b/gcc/INSTALL
index ac92f50abe7..a7c63d57de8 100644
--- a/gcc/INSTALL
+++ b/gcc/INSTALL
@@ -1,14 +1,30 @@
-This file documents the installation of the GNU compiler. Copyright
+This is Info file INSTALL, produced by Makeinfo version 1.68 from the
+input file install1.texi.
+
+ This file documents the installation of the GNU compiler. Copyright
(C) 1988, 1989, 1992, 1994, 1995 Free Software Foundation, Inc. You
may copy, distribute, and modify it freely as long as you preserve this
copyright notice and permission notice.
+
+File: INSTALL, Node: Installation, Up: (dir)
+
Installing GNU CC
*****************
Note most of this information is out of date and superceded by the
EGCS install procedures. It is provided for historical reference only.
+* Menu:
+
+* Configurations:: Configurations Supported by GNU CC.
+* Other Dir:: Compiling in a separate directory (not where the source is).
+* Cross-Compiler:: Building and installing a cross-compiler.
+* Sun Install:: See below for installation on the Sun.
+* VMS Install:: See below for installation on VMS.
+* Collect2:: How `collect2' works; how it finds `ld'.
+* Header Dirs:: Understanding the standard header file directories.
+
Here is the procedure for installing GNU CC on a Unix system. See
*Note VMS Install::, for VMS systems. In this section we assume you
compile in the same directory that contains the source files; see *Note
@@ -48,13 +64,13 @@ and includes all the necessary compilation tools and libraries.
what your configuration is or guesses wrong.
In those cases, specify the build machine's "configuration name"
- with the `--build' option; the host and target will default to be
- the same as the build machine. (If you are building a
+ with the `--host' option; the host and target will default to be
+ the same as the host machine. (If you are building a
cross-compiler, see *Note Cross-Compiler::.)
Here is an example:
- ./configure --build=sparc-sun-sunos4.1
+ ./configure --host=sparc-sun-sunos4.1
A configuration name may be canonical or it may be more or less
abbreviated.
@@ -163,7 +179,6 @@ and includes all the necessary compilation tools and libraries.
other systems where it could usefully make a difference.
`--enable-haifa'
-
`--disable-haifa'
Use `--enable-haifa' to enable use of an experimental
instruction scheduler (from IBM Haifa). This may or may not
@@ -182,6 +197,14 @@ and includes all the necessary compilation tools and libraries.
possibilities for TYPE are `single', `posix', `win32',
`solaris', `irix' and `mach'.
+ `--enable-checking'
+ When you specify this option, the compiler is built to
+ perform checking of tree node types when referencing fields
+ of that node. This does not change the generated code, but
+ adds error checking within the compiler. This will slow down
+ the compiler and may only work properly if you are building
+ the compiler with GNU C.
+
The `configure' script searches subdirectories of the source
directory for other compilers that are to be integrated into GNU
CC. The GNU compiler for C++, called G++ is in a subdirectory
@@ -227,20 +250,22 @@ and includes all the necessary compilation tools and libraries.
name to use instead of `/usr/local' for all purposes with one
exception: the directory `/usr/local/include' is searched for
header files no matter where you install the compiler. To override
- this name, use the `--local-prefix' option below.
+ this name, use the `--with-local-prefix' option below. The
+ directory you specify need not exist, but its parent directory
+ must exist.
- 5. Specify `--local-prefix=DIR' if you want the compiler to search
- directory `DIR/include' for locally installed header files
+ 5. Specify `--with-local-prefix=DIR' if you want the compiler to
+ search directory `DIR/include' for locally installed header files
*instead* of `/usr/local/include'.
- You should specify `--local-prefix' *only* if your site has a
+ You should specify `--with-local-prefix' *only* if your site has a
different convention (not `/usr/local') for where to put
site-specific files.
- The default value for `--local-prefix' is `/usr/local' regardless
- of the value of `--prefix'. Specifying `--prefix' has no effect
- on which directory GNU CC searches for local header files. This
- may seem counterintuitive, but actually it is logical.
+ The default value for `--with-local-prefix' is `/usr/local'
+ regardless of the value of `--prefix'. Specifying `--prefix' has
+ no effect on which directory GNU CC searches for local header
+ files. This may seem counterintuitive, but actually it is logical.
The purpose of `--prefix' is to specify where to *install GNU CC*.
The local header files in `/usr/local/include'--if you put any in
@@ -248,12 +273,12 @@ and includes all the necessary compilation tools and libraries.
programs--perhaps many others. (GNU CC installs its own header
files in another directory which is based on the `--prefix' value.)
- *Do not* specify `/usr' as the `--local-prefix'! The directory
- you use for `--local-prefix' *must not* contain any of the
- system's standard header files. If it did contain them, certain
- programs would be miscompiled (including GNU Emacs, on certain
- targets), because this would override and nullify the header file
- corrections made by the `fixincludes' script.
+ *Do not* specify `/usr' as the `--with-local-prefix'! The
+ directory you use for `--with-local-prefix' *must not* contain any
+ of the system's standard header files. If it did contain them,
+ certain programs would be miscompiled (including GNU Emacs, on
+ certain targets), because this would override and nullify the
+ header file corrections made by the `fixincludes' script.
Indications are that people who use this option use it based on
mistaken ideas of what it is for. People use it as if it specified
@@ -300,8 +325,9 @@ and includes all the necessary compilation tools and libraries.
escape sequence" are normal in `genopinit.c' and perhaps some
other files. Likewise, you should ignore warnings about "constant
is so large that it is unsigned" in `insn-emit.c' and
- `insn-recog.c' and a warning about a comparison always being zero
- in `enquire.o'. Any other compilation errors may represent bugs in
+ `insn-recog.c', a warning about a comparison always being zero in
+ `enquire.o', and warnings about shift counts exceeding type widths
+ in `cexp.y'. Any other compilation errors may represent bugs in
the port to your machine or operating system, and should be
investigated and reported.
@@ -433,12 +459,12 @@ and includes all the necessary compilation tools and libraries.
This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1',
`cpp' and `libgcc.a' in the directory
`/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the
- compiler driver program looks for them. Here TARGET is the target
- machine type specified when you ran `configure', and VERSION is
- the version number of GNU CC. This naming scheme permits various
- versions and/or cross-compilers to coexist. It also copies the
- executables for compilers for other languages (e.g., `cc1plus' for
- C++) to the same directory.
+ compiler driver program looks for them. Here TARGET is the
+ canonicalized form of target machine type specified when you ran
+ `configure', and VERSION is the version number of GNU CC. This
+ naming scheme permits various versions and/or cross-compilers to
+ coexist. It also copies the executables for compilers for other
+ languages (e.g., `cc1plus' for C++) to the same directory.
This also copies the driver program `xgcc' into
`/usr/local/bin/gcc', so that it appears in typical execution
@@ -465,8 +491,13 @@ and includes all the necessary compilation tools and libraries.
library. All I/O functionality, special class libraries, etc., are
provided by the C++ runtime library.
- Here's one way to build and install a C++ runtime library for GNU
- CC:
+ The standard C++ runtime library for GNU CC is called `libstdc++'.
+ An obsolescent library `libg++' may also be available, but it's
+ necessary only for older software that hasn't been converted yet;
+ if you don't know whether you need `libg++' then you probably don't
+ need it.
+
+ Here's one way to build and install `libstdc++' for GNU CC:
* Build and install GNU CC, so that invoking `gcc' obtains the
GNU CC that was just built.
@@ -535,6 +566,9 @@ and includes all the necessary compilation tools and libraries.
* thr-win32 Microsoft Win32 API thread support.
+
+File: INSTALL, Node: Configurations, Next: Other Dir, Up: Installation
+
Configurations Supported by GNU CC
==================================
@@ -742,9 +776,10 @@ special things you must know:
AMD Am29050 used in a system running a variant of BSD Unix.
`decstation-*'
- DECstations can support three different personalities: Ultrix, DEC
- OSF/1, and OSF/rose. To configure GCC for these platforms use the
- following configurations:
+ MIPS-based DECstations can support three different personalities:
+ Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products
+ have a configuration name beginning with `alpha-dec'.) To
+ configure GCC for these platforms use the following configurations:
`decstation-ultrix'
Ultrix configuration.
@@ -799,7 +834,9 @@ special things you must know:
later). These can be retrieved from all the traditional GNU ftp
archive sites.
- GAS will need to be installed into a directory before `/bin',
+ On some versions of HP-UX, you will need to install GNU `sed'.
+
+ You will need to be install GAS into a directory before `/bin',
`/usr/bin', and `/usr/ccs/bin' in your search path. You should
install GAS before you build GNU CC.
@@ -834,24 +871,32 @@ special things you must know:
`i386-*-sco3.2v5*'
Use this for the SCO OpenServer Release family including 5.0.0,
- 5.0.2, 5.0.4, Internet FastStart 1.0, and Internet FastStart 1.1.
-
- GNU CC can generate ELF binaries (if you specify `-melf') or COFF
- binaries (the default). If you are going to build your compiler
- in ELF mode (once you have bootstrapped the first stage compiler)
- you *must* specify `-melf' as part of `CC', *not* `CFLAGS', for
- example as `CC="stage1/xgcc -melf -Bstage1/" '. If you do not do
- this, the bootstrap will generate incorrect versions of `libgcc.a'.
-
- You must have TLS597 (from ftp.sco.com/TLS) installed for ELF
- binaries to work correctly. Note that Open Server 5.0.2 *does*
- need TLS597 installed.
-
- *NOTE:* You must follow the instructions about invoking `make
- bootstrap' because the native OpenServer compiler builds a
- `cc1plus' that will not correctly parse many valid C++ programs.
- You must do a `make bootstrap' if you are building with the native
- compiler.
+ 5.0.2, 5.0.4, 5.0.5, Internet FastStart 1.0, and Internet
+ FastStart 1.1.
+
+ GNU CC can generate COFF binaries if you specify `-mcoff' or ELF
+ binaries, the default. A full `make bootstrap' is recommended
+ so that an ELF compiler that builds ELF is generated.
+
+ You must have TLS597 from `ftp://ftp.sco.com/TLS' installed for ELF
+ C++ binaries to work correctly on releases before 5.0.4.
+
+ The native SCO assembler that is provided with the OS at no charge
+ is normally required. If, however, you must be able to use the GNU
+ assembler (perhaps you have complex asms) you must configure this
+ package `--with-gnu-as'. To do this, install (cp or symlink)
+ gcc/as to your copy of the GNU assembler. You must use a recent
+ version of GNU binutils; version 2.9.1 seems to work well. If you
+ select this option, you will be unable to build COFF images.
+ Trying to do so will result in non-obvious failures. In general,
+ the "-with-gnu-as" option isn't as well tested as the native
+ assembler.
+
+ *NOTE:* If you are building C++, you must follow the instructions
+ about invoking `make bootstrap' because the native OpenServer
+ compiler may build a `cc1plus' that will not correctly parse many
+ valid C++ programs. You must do a `make bootstrap' if you are
+ building with the native compiler.
`i386-*-isc'
It may be a good idea to link with GNU malloc instead of the
@@ -872,10 +917,8 @@ special things you must know:
Go to the Berkeley universe before compiling.
`i386-sequent-ptx1*'
- Sequent DYNIX/ptx 1.x.
-
`i386-sequent-ptx2*'
- Sequent DYNIX/ptx 2.x.
+ You must install GNU `sed' before running `configure'.
`i386-sun-sunos4'
You may find that you need another version of GNU CC to begin
@@ -970,7 +1013,7 @@ special things you must know:
options to `configure'.
Note the C compiler that comes with this system cannot compile GNU
- CC. You can fine binaries of GNU CC for bootstrapping on
+ CC. You can find binaries of GNU CC for bootstrapping on
`jagubox.gsfc.nasa.gov'. You will also a patched version of
`/bin/ld' there that raises some of the arbitrary limits found in
the original.
@@ -1059,9 +1102,9 @@ special things you must know:
In addition, if you wish to use gas `--with-gnu-as' you must use
gas version 2.1 or later, and you must use the GNU linker version
2.1 or later. Earlier versions of gas relied upon a program which
- converted the gas output into the native HP/UX format, but that
+ converted the gas output into the native HP-UX format, but that
program has not been kept up to date. gdb does not understand
- that native HP/UX format, so you must use gas if you wish to use
+ that native HP-UX format, so you must use gas if you wish to use
gdb.
`m68k-sun'
@@ -1248,13 +1291,15 @@ special things you must know:
xlc-1.2.1.8, xlc-1.3.0.0 (distributed with AIX 3.2.5), and
xlc-1.3.0.19. Both xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are
known to produce working versions of GNU CC, but most other recent
- releases correctly bootstrap GNU CC. Also, releases of AIX prior
- to AIX 3.2.4 include a version of the IBM assembler which does not
- accept debugging directives: assembler updates are available as
- PTFs. Also, if you are using AIX 3.2.5 or greater and the GNU
- assembler, you must have a version modified after October 16th,
- 1995 in order for the GNU C compiler to build. See the file
- `README.RS6000' for more details on of these problems.
+ releases correctly bootstrap GNU CC.
+
+ Release 4.3.0 of AIX and ones prior to AIX 3.2.4 include a version
+ of the IBM assembler which does not accept debugging directives:
+ assembler updates are available as PTFs. Also, if you are using
+ AIX 3.2.5 or greater and the GNU assembler, you must have a
+ version modified after October 16th, 1995 in order for the GNU C
+ compiler to build. See the file `README.RS6000' for more details
+ on any of these problems.
GNU CC does not yet support the 64-bit PowerPC instructions.
@@ -1401,6 +1446,9 @@ special things you must know:
You may need to raise the ULIMIT setting to build a C++ compiler,
as the file `cc1plus' is larger than one megabyte.
+
+File: INSTALL, Node: Other Dir, Next: Cross-Compiler, Prev: Configurations, Up: Installation
+
Compilation in a Separate Directory
===================================
@@ -1445,6 +1493,9 @@ configuration steps shown above, when ordinary source files change. You
must, however, run `configure' again when the configuration files
change, if your system does not support symbolic links.
+
+File: INSTALL, Node: Cross-Compiler, Next: Sun Install, Prev: Other Dir, Up: Installation
+
Building and Installing a Cross-Compiler
========================================
@@ -1471,6 +1522,20 @@ If you want to link on other than the target machine, you need a
cross-linker as well. You also need header files and libraries suitable
for the target machine that you can install on the host machine.
+* Menu:
+
+* Steps of Cross:: Using a cross-compiler involves several steps
+ that may be carried out on different machines.
+* Configure Cross:: Configuring a cross-compiler.
+* Tools and Libraries:: Where to put the linker and assembler, and the C library.
+* Cross Headers:: Finding and installing header files
+ for a cross-compiler.
+* Cross Runtime:: Supplying arithmetic runtime routines (`libgcc1.a').
+* Build Cross:: Actually compiling the cross-compiler.
+
+
+File: INSTALL, Node: Steps of Cross, Next: Configure Cross, Up: Cross-Compiler
+
Steps of Cross-Compilation
--------------------------
@@ -1496,6 +1561,9 @@ machine, since then you can do it all with a single invocation of GNU
CC. This requires a suitable cross-assembler and cross-linker. For
some targets, the GNU assembler and linker are available.
+
+File: INSTALL, Node: Configure Cross, Next: Tools and Libraries, Prev: Steps of Cross, Up: Cross-Compiler
+
Configuring a Cross-Compiler
----------------------------
@@ -1508,6 +1576,9 @@ system running BSD on a system that `configure' can correctly identify:
./configure --target=m68k-hp-bsd4.3
+
+File: INSTALL, Node: Tools and Libraries, Next: Cross Headers, Prev: Configure Cross, Up: Cross-Compiler
+
Tools and Libraries for a Cross-Compiler
----------------------------------------
@@ -1576,6 +1647,9 @@ machine:
mget *crt*.o
quit
+
+File: INSTALL, Node: Cross Runtime, Next: Build Cross, Prev: Cross Headers, Up: Cross-Compiler
+
`libgcc.a' and Cross-Compilers
------------------------------
@@ -1661,6 +1735,9 @@ Otherwise, you should place your replacement library under the name
`libgcc1.a' in the directory in which you will build the
cross-compiler, before you run `make'.
+
+File: INSTALL, Node: Cross Headers, Next: Cross Runtime, Prev: Tools and Libraries, Up: Cross-Compiler
+
Cross-Compilers and Header Files
--------------------------------
@@ -1709,6 +1786,9 @@ machine. On the target machine, do this:
quit
tar xf tarfile
+
+File: INSTALL, Node: Build Cross, Prev: Cross Runtime, Up: Cross-Compiler
+
Actually Building the Cross-Compiler
------------------------------------
@@ -1742,11 +1822,19 @@ must specify a 68030 as the host when you configure it.
To install the cross-compiler, use `make install', as usual.
+
+File: INSTALL, Node: Sun Install, Next: VMS Install, Prev: Cross-Compiler, Up: Installation
+
Installing GNU CC on the Sun
============================
- On Solaris (version 2.1), do not use the linker or other tools in
-`/usr/ucb' to build GNU CC. Use `/usr/ccs/bin'.
+ On Solaris, do not use the linker or other tools in `/usr/ucb' to
+build GNU CC. Use `/usr/ccs/bin'.
+
+ If the assembler reports `Error: misaligned data' when bootstrapping,
+you are probably using an obsolete version of the GNU assembler.
+Upgrade to the latest version of GNU `binutils', or use the Solaris
+assembler.
Make sure the environment variable `FLOAT_OPTION' is not set when
you compile `libgcc.a'. If this option were set to `f68881' when
@@ -1772,6 +1860,9 @@ error which does not recur if you run it again. To fix the problem,
install Sun recommended patch 100726 (for SunOS 4.1.3) or 101508 (for
SunOS 4.1.3_U1), or upgrade to a later SunOS release.
+
+File: INSTALL, Node: VMS Install, Next: Collect2, Prev: Sun Install, Up: Installation
+
Installing GNU CC on VMS
========================
@@ -1977,6 +2068,9 @@ edit the file `tm.h' (created by `vmsconfig.com') to define the macro
`QSORT_WORKAROUND' is always defined when GNU CC is compiled with
VAX C, to avoid a problem in case `gcclib.olb' is not yet available.
+
+File: INSTALL, Node: Collect2, Next: Header Dirs, Prev: VMS Install, Up: Installation
+
`collect2'
==========
@@ -2042,6 +2136,9 @@ search path.
`collect2' searches for the utilities `nm' and `strip' using the
same algorithm as above for `ld'.
+
+File: INSTALL, Node: Header Dirs, Prev: Collect2, Up: Installation
+
Standard Header File Directories
================================
@@ -2070,3 +2167,22 @@ use. For a cross-compiler, this is the equivalent of `/usr/include'.
When you build a cross-compiler, `fixincludes' processes any header
files in this directory.
+
+
+Tag Table:
+Node: Installation351
+Node: Configurations26618
+Node: Other Dir65739
+Node: Cross-Compiler67454
+Node: Steps of Cross69284
+Node: Configure Cross70401
+Node: Tools and Libraries71037
+Node: Cross Runtime73475
+Node: Cross Headers77555
+Node: Build Cross79553
+Node: Sun Install81428
+Node: VMS Install83099
+Node: Collect293028
+Node: Header Dirs95592
+
+End Tag Table
diff --git a/gcc/LANGUAGES b/gcc/LANGUAGES
index 544e12b4105..c3d4223477e 100644
--- a/gcc/LANGUAGES
+++ b/gcc/LANGUAGES
@@ -6,6 +6,29 @@ time as we can formally start documenting the interface this file will
serve as a repository for information on these interface and any incompatable
changes we've made.
+Aug 31, 1998:
+ The interface to HANDLE_PRAGMA has changed. It now takes three arguments.
+ The first two are pointers to functions that should be used to read characters
+ from the input stream, and to push them back into the input stream respectively.
+ The third argument is a pointer to a null terminate string which is the first
+ word after #pragma. The expression supplied by HANDLE_PRAGMA should return
+ non-zero if it parsed and implemented the pragma. Otherwise it should return
+ zero, and leave the input stream as it was before the expression was evaluated.
+
+ A new back-end definable macro has been added: INSERT_ATTRIBUTES. This macro
+ allows backend to add attributes to decls as they are created.
+
+Jun 10, 1998:
+ The interface to lang_decode_option has changed. It now uses and argc/argv
+ interface to allow for options that use more than one input string. The new
+ declaration is: int lang_decode_option (int argc, char** argv). It now
+ returns the number of input strings processed, or 0 if the option is
+ unknown.
+
+Jun 7, 1998:
+ Front-ends must now define lang_init_options. It is safe for this
+ function to do nothing. See c-lang.c.
+
Apr 21, 1998:
Front ends which link with c-common or other files from the C/C++
front-ends may need to handle TI types. Look for references to
diff --git a/gcc/LITERATURE b/gcc/LITERATURE
index 2cbe780df84..ac35e3a5a74 100644
--- a/gcc/LITERATURE
+++ b/gcc/LITERATURE
@@ -4,7 +4,9 @@ Collected papers/sites on standards, compilers, optimization, etc.
ftp://cs.rice.edu/public/preston/optimizer
-- http://www.lpac.ac.uk/SEL-HPC/Articles/CompilersArchive.html
+- Searchable article archive
+
+ http://hypatia.dcs.qmw.ac.uk/SEL-HPC/Articles/CompilersArchive.html
- David M Keaton's site
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 154321ea432..b141a5119d7 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -53,7 +53,8 @@ ALLOCA_FINISH = true
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
-# WARN_CFLAGS are the warning flags to pass to stage2 and stage3. It is
+# WARN_CFLAGS are the warning flags to pass to stage2 and stage3.
+# (And for stage 1 if the native compiler is GCC.) It is
# separate from BOOT_CFLAGS because people tend to override optimization
# flags and we'd like them to still have warnings turned on. They are free
# to explicitly turn warnings off if they wish.
@@ -61,7 +62,7 @@ ALLOCA_FINISH = true
# TCFLAGS is used for compilations with the GCC just built.
XCFLAGS =
TCFLAGS =
-CFLAGS = -g
+CFLAGS = -g @stage1_warn_cflags@
BOOT_CFLAGS = -O2 $(CFLAGS)
WARN_CFLAGS = -W -Wall
# These exists to be overridden by the x-* and t-* files, respectively.
@@ -72,9 +73,15 @@ X_CPPFLAGS =
T_CPPFLAGS =
CC = @CC@
-BISON = bison
+# srcdir might be a relative pathname which won't be valid in a subdirectory,
+# so we must use objdir/srcdir instead to make it safe. objdir is always
+# a full pathname.
+BISON = `if [ -f $(objdir)/../bison/bison ] ; then case $(srcdir) in \
+ /*) echo $(objdir)/../bison/bison -L $(srcdir)/../bison/ ;; \
+ *) echo $(objdir)/../bison/bison -L $(objdir)/$(srcdir)/../bison/ ;; \
+ esac; else echo bison ; fi`
BISONFLAGS =
-LEX = flex
+LEX = `if [ -f $(objdir)/../flex/flex ] ; then echo $(objdir)/../flex/flex ; else echo flex ; fi`
LEXFLAGS =
AR = ar
AR_FLAGS = rc
@@ -138,8 +145,8 @@ USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
$(srcdir)/ginclude/va-m32r.h $(srcdir)/ginclude/va-sh.h \
$(srcdir)/ginclude/va-v850.h $(srcdir)/ginclude/va-arc.h \
$(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \
- $(srcdir)/ginclude/proto.h $(EXTRA_HEADERS) \
- $(LANG_EXTRA_HEADERS)
+ $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS) \
+ $(srcdir)/ginclude/proto.h $(srcdir)/ginclude/stdbool.h
# Target to use whe installing assert.h. Some systems may
# want to set this empty.
@@ -155,39 +162,66 @@ GCC_FOR_TARGET = ./xgcc -B./
# It also specifies -I./include to find, e.g., stddef.h.
GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include $(TCFLAGS)
-# Special flags for compiling enquire.
-# We disable optimization to make floating point more reliable.
-ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
-ENQUIRE_LDFLAGS = $(LDFLAGS)
-
# Sed command to transform gcc to installed name. Overwritten by configure.
program_transform_name = @program_transform_name@
program_transform_cross_name = s,^,$(target_alias)-,
+build_canonical = @build_canonical@
+host_canonical = @host_canonical@
+
# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
-TARGET_TOOLPREFIX = $(tooldir)/bin/
-AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
+# Use the tools from the build tree, if they are available.
+
+# objdir is set by configure.
+objdir = @objdir@
+
+AR_FOR_TARGET = ` \
+ if [ -f $(objdir)/../binutils/ar ] ; then \
+ echo $(objdir)/../binutils/ar ; \
+ else \
+ if [ "$(host_canonical)" = "$(target)" ] ; then \
+ echo ar; \
+ else \
+ t='$(program_transform_name)'; echo ar | sed -e $$t ; \
+ fi; \
+ fi`
AR_FOR_TARGET_FLAGS = rc
-RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
-RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
-
+RANLIB_FOR_TARGET = ` \
+ if [ -f $(objdir)/../binutils/ranlib ] ; then \
+ echo $(objdir)/../binutils/ranlib ; \
+ else \
+ if [ "$(host_canonical)" = "$(target)" ] ; then \
+ echo ranlib; \
+ else \
+ t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \
+ fi; \
+ fi`
+RANLIB_TEST_FOR_TARGET = \
+ [ -f $(RANLIB_FOR_TARGET) ] \
+ || ( [ "$(host_canonical)" = "$(target)" ] \
+ && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
+
+# We always act like a cross-compiler, even when we're
+# compiling native. This is because we want to use our own tools if
+# we can. We don't just set RANLIB to a complicated expression,
+# because the top level Makefile.in might override RANLIB_FOR_TARGET.
+# These are from the FSF file "cross-make".
+AR = $(AR_FOR_TARGET)
+AR_FLAGS = $(AR_FOR_TARGET_FLAGS)
+OLDAR = $(AR_FOR_TARGET)
+OLDAR_FLAGS = $(AR_FOR_TARGET_FLAGS)
+RANLIB = $(RANLIB_FOR_TARGET)
+RANLIB_TEST = $(RANLIB_TEST_FOR_TARGET)
+
# Dir to search for system headers. Overridden by cross-make.
SYSTEM_HEADER_DIR = /usr/include
# Control whether to run fixproto.
STMP_FIXPROTO = stmp-fixproto
-# Test to see whether <float.h> exists in the system header files,
-# and is not derived from GCC.
-FLOAT_H_TEST = \
- [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
- if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
- then false; \
- else :; fi
-
# Test to see whether <limits.h> exists in the system header files.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
@@ -210,9 +244,14 @@ build_xm_file=@build_xm_file_list@
host_xm_file=@host_xm_file_list@
lang_specs_files=@lang_specs_files@
lang_options_files=@lang_options_files@
+lang_tree_files=@lang_tree_files@
GCC_THREAD_FILE=@thread_file@
+OBJC_BOEHM_GC=@objc_boehm_gc@
GTHREAD_FLAGS=@gthread_flags@
-version=@version@
+# Be prepared for gcc2 merges.
+gcc_version=@gcc_version@
+gcc_version_trigger=@gcc_version_trigger@
+version=$(gcc_version)
mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
# Common prefix for installation directories.
@@ -231,12 +270,10 @@ bindir = @bindir@
libdir = @libdir@
# Directory in which the compiler finds executables, libraries, etc.
libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
+# Used to produce a relative $(tooldir) in gcc.o
+unlibsubdir = ../../..
# Directory in which the compiler finds g++ includes.
gxx_include_dir= @gxx_include_dir@
-# Directory in which the old g++ header files may be found.
-# The reason we use $(libdir)/g++-include rather than using libsubdir
-# is for compatibility with older versions of libg++.
-old_gxx_include_dir= $(libdir)/g++-include
# Directory to search for site-specific includes.
includedir = $(local_prefix)/include
# assertdir is overridden in cross-make.
@@ -297,10 +334,8 @@ LIBGCC2 = libgcc2.a
# we use this here because that should be enough, and also
# so that -g1 will be tested.
#
-# -fexceptions is necessary for eh.o now that the exceptions are
-# the default for g++ only.
LIBGCC2_DEBUG_CFLAGS = -g1
-LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fexceptions @inhibit_libc@
+LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
# Additional options to use when compiling libgcc2.a.
# Some targets override this to -Iinclude
@@ -313,10 +348,6 @@ TARGET_LIBGCC2_CFLAGS =
# Some targets override this to stmp-int-hdrs
LIBGCC2_DEPS =
-# Enquire target (This is a variable so that a target can choose not to
-# build it.)
-ENQUIRE = enquire
-
# libgcc1-test target (must also be overridable for a target)
LIBGCC1_TEST = libgcc1-test
@@ -363,6 +394,10 @@ LIB2FUNCS_EXTRA =
# This is overridden by configure.
CROSS_FLOAT_H=$(srcdir)/config/float-@float_format@.h
+# We do not try to build float.h anymore. Let configure select the
+# appropriate pre-built float.h file for the target.
+FLOAT_H=$(srcdir)/config/float-@float_format@.h
+
# Program to convert libraries.
LIBCONVERT =
@@ -425,9 +460,13 @@ HOST_DOPRINT=$(DOPRINT)
# Actual name to use when installing a native compiler.
GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t`
+PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t`
+UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t`
# Actual name to use when installing a cross-compiler.
GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t`
+PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t`
+UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t`
# Choose the real default target.
ALL=all.internal
@@ -435,9 +474,6 @@ ALL=all.internal
# Choose the real install target.
INSTALL_TARGET=install-normal
-# Source for float.h. Overridden by cross-make.
-FLOAT_H=float.h-nat
-
# Setup the testing framework, if you have one
EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
echo $${rootme}/../expect/expect ; \
@@ -489,8 +525,7 @@ all: all.indirect
all.indirect: $(ALL)
-# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-# ??? IN_GCC should be obsolete now.
+# IN_GCC tells various files that system.h, toplev.c, etc are available.
INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
# This is the variable actually used when we compile.
@@ -520,14 +555,15 @@ HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_
# How to link with both our special library facilities
# and the system's installed libraries.
-LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(CLIB)
+LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(CLIB) \
+ ../libiberty/libiberty.a
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
$(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(HOST_CLIB)
-HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)ggc-none.o
+HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o $(HOST_PREFIX)ggc-none.o
HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
HOST_PRINT = $(HOST_PREFIX)print-rtl.o
@@ -535,7 +571,7 @@ HOST_PRINT = $(HOST_PREFIX)print-rtl.o
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
-INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
+INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
# Always use -I$(srcdir)/config when compiling.
.c.o:
@@ -561,7 +597,7 @@ LANG_EXTRA_HEADERS = @all_headers@
# subdirectories.
# ??? The choices here will need some experimenting with.
FLAGS_TO_PASS = \
- "AR_FLAGS=$(AR_FLAGS)" \
+ "AR_FLAGS=$(AR_FOR_TARGET_FLAGS)" \
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"BISON=$(BISON)" \
"BISONFLAGS=$(BISONFLAGS)" \
@@ -608,34 +644,33 @@ OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o \
varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o real.o regmove.o \
dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o \
- integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
- regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
+ integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o \
+ regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o gcse.o \
insn-peep.o reorg.o $(SCHED_PREFIX)sched.o final.o recog.o reg-stack.o \
insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) \
- convert.o $(GGC)
+ convert.o mbchar.o dyn-string.o $(GGC)
# GEN files are listed separately, so they can be built before doing parallel
# makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
# them before rtl.o is compiled.
GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
- genpeep gengenrtl
+ genpeep gengenrtl gencheck
-CCCP=cccp
-# Uncomment this line if you want to use cppmain (w/cpplib) as cpp.
-#CCCP=cppmain
+CCCP=@cpp_main@
# Files to be copied away after each stage in building.
STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
- insn-attr.h insn-attrtab.c insn-opinit.c genrtl.c genrtl.h \
- s-flags s-config s-codes s-mlib \
- s-output s-recog s-emit s-extract s-peep \
+ insn-attr.h insn-attrtab.c insn-opinit.c genrtl.c genrtl.h tree-check.h \
+ s-flags s-config s-codes s-mlib s-under\
+ s-output s-recog s-emit s-extract s-peep s-check \
s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 \
genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
+ gencheck$(build_exeext) \
xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \
$(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
@@ -643,7 +678,7 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
gcov$(exeext) *.bp \
*.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
- *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack \
+ *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.gcse \
*.[si] \
$(LANG_STAGESTUFF)
@@ -665,7 +700,9 @@ LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_fixtfdi _fixunstfdi _floatditf \
__gcc_bcmp _varargs __dummy _eprintf \
_bb _shtab _clear_cache _trampoline __main _exit \
- _ctors _eh _pure
+ _ctors _pure
+
+LIB2FUNCS_EH = _eh
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 \
@@ -688,10 +725,12 @@ DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
CONFIG_H =
RTL_BASE_H = rtl.h rtl.def gansidecl.h machmode.h machmode.def
RTL_H = $(RTL_BASE_H) genrtl.h
-TREE_H = tree.h real.h tree.def gansidecl.h machmode.h machmode.def
+TREE_H = tree.h real.h tree.def gansidecl.h machmode.h machmode.def tree-check.h
BASIC_BLOCK_H = basic-block.h bitmap.h
DEMANGLE_H = demangle.h gansidecl.h
RECOG_H = recog.h gansidecl.h
+EXPR_H = expr.h insn-codes.h
+REGS_H = regs.h varray.h machmode.h machmode.def gansidecl.h
#
# Language makefile fragments.
@@ -745,6 +784,7 @@ $(srcdir)/configure: $(srcdir)/configure.in
$(srcdir)/config.in: $(srcdir)/cstamp-h.in
$(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
cd $(srcdir) && autoheader
+ @rm -f $(srcdir)/cstamp-h.in
echo timestamp > $(srcdir)/cstamp-h.in
auto-host.h: cstamp-h ; @true
cstamp-h: config.in config.status
@@ -765,14 +805,14 @@ all.internal: start.encap rest.encap
# This is what to compile if making a cross-compiler.
# Note that we can compile enquire using the cross-compiler just built,
# although we can't run it on this machine.
-all.cross: native gcc-cross specs stmp-headers $(LIBGCC) $(STMP_FIXPROTO) \
+all.cross: native gcc-cross specs stmp-headers $(STMP_FIXPROTO) $(LIBGCC) \
$(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross
# This is what to compile if making gcc with a cross-compiler.
all.build: native xgcc$(exeext) $(EXTRA_PARTS) lang.all.build
# This is what must be made before installing GCC and converting libraries.
start.encap: native xgcc$(exeext) specs $(LIBGCC1) xlimits.h lang.start.encap
# These can't be made until after GCC can run.
-rest.encap: stmp-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS) lang.rest.encap
+rest.encap: stmp-headers $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status auto-host.h cpp$(exeext) $(LANGUAGES) \
@@ -811,9 +851,9 @@ stamp-objlist: $(OBJS)
# to avoid confusion if the current directory is in the path
# and CC is `gcc'. It is renamed to `gcc' when it is installed.
xgcc$(exeext): gcc.o version.o choose-temp.o pexecute.o prefix.o version.o \
- $(LIBDEPS) $(EXTRA_GCC_OBJS)
+ mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o prefix.o version.o \
- choose-temp.o pexecute.o $(EXTRA_GCC_OBJS) $(LIBS)
+ choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
# Dump a specs file to make -B./ read these specs over installed ones.
specs: xgcc$(exeext)
@@ -834,37 +874,6 @@ gfloat.h: $(FLOAT_H)
-rm -f gfloat.h
cp $(FLOAT_H) gfloat.h
-# Create float.h source for the native machine.
-# Make it empty if we can use the system float.h without changes.
-float.h-nat: enquire
- -./enquire -f > tmp-float.h
- grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
- mv tmp-float.h float.h-nat
-
-# Create a dummy float.h source for a cross-compiler.
-# ??? This isn't used anymore. Should we create config/float-unkn.h
-# and make that the default float_format in configure?
-float.h-cross:
- echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
- echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
- echo "#endif" >> t-float.h-cross
- mv t-float.h-cross float.h-cross
-
-# Used to compile enquire with standard cc, but have forgotten why.
-# Let's try with GCC.
-enquire: enquire.o $(GCC_PARTS)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
-enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
- rm -f include/float.h
- if $(FLOAT_H_TEST); then \
- SYS_FLOAT_H_WRAP=1; \
- else :; \
- SYS_FLOAT_H_WRAP=0; \
- fi; \
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
- -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
- -I. -c $(srcdir)/enquire.c
-
# Build the version of limits.h that we will install.
xlimits.h: glimits.h limitx.h limity.h
if $(LIMITS_H_TEST) ; then \
@@ -999,7 +1008,7 @@ libgcc1.S: libgcc1.c $(CONFIG_H) config.status
# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
# But recompiling cc1 should not force recompilation of libgcc2.a.
# If you want to force recompilation, delete libgcc2.a.
-libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs
+libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs $(STMP_FIXPROTO)
-if [ -f libgcc2.ready ] ; then \
true; \
else \
@@ -1027,6 +1036,15 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \
$(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
rm -f $${name}$(objext); \
done
+ for name in $(LIB2FUNCS_EH); \
+ do \
+ echo $${name}; \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -fexceptions $(INCLUDES) -c \
+ -DL$${name} $(srcdir)/libgcc2.c -o $${name}$(objext); \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
+ rm -f $${name}$(objext); \
+ done
if [ x$(FPBIT) != x ]; then \
for name in $(FPBIT_FUNCS); \
do \
@@ -1214,12 +1232,12 @@ crtbeginS.o crtendS.o: s-crtS ; @true
s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
- -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \
- -g0 -c $(srcdir)/crtstuff.c
+ -DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
+ -fno-exceptions -g0 -c $(srcdir)/crtstuff.c
mv crtstuff$(objext) crtbeginS$(objext)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
- -DCRT_END -finhibit-size-directive -fno-inline-functions \
- -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
+ -DCRT_END -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
+ -fno-exceptions -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
touch s-crtS
# Compile the start modules crt0.o and mcrt0.o that are linked with every program
@@ -1254,40 +1272,57 @@ $(srcdir)/c-parse.y: c-parse.in
$(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
$(srcdir)/c-gperf.h: c-parse.gperf
- gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \
- $(srcdir)/c-parse.gperf >tmp-gperf.h
+ gperf -L KR-C -F ', 0, 0' -p -j1 -i 1 -g -o -t -G -N is_reserved_word \
+ -k1,3,$$ $(srcdir)/c-parse.gperf >tmp-gperf.h
$(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \
output.h toplev.h
c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \
- output.h expr.h insn-codes.h $(RTL_H) toplev.h
-c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H)
+ output.h $(EXPR_H) $(RTL_H) toplev.h
+c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h toplev.h \
+ output.h
c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \
- $(srcdir)/c-parse.h input.h flags.h $(srcdir)/c-gperf.h c-pragma.h toplev.h
+ $(srcdir)/c-parse.h input.h flags.h $(srcdir)/c-gperf.h c-pragma.h \
+ toplev.h output.h mbchar.h
c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h
c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
-c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(TREE_H) except.h function.h \
- defaults.h c-pragma.h toplev.h
+c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) except.h \
+ function.h defaults.h c-pragma.h toplev.h
c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
- flags.h toplev.h
+ flags.h toplev.h $(EXPR_H)
+mbchar.o: mbchar.c $(CONFIG_H) system.h gansidecl.h mbchar.h
collect2$(exeext): collect2.o tlink.o hash.o cplus-dem.o underscore.o \
- version.o choose-temp.o $(LIBDEPS)
+ version.o choose-temp.o mkstemp.o $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
-rm -f collect2$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ collect2.o tlink.o hash.o \
- cplus-dem.o underscore.o version.o choose-temp.o $(LIBS)
+ cplus-dem.o underscore.o version.o choose-temp.o mkstemp.o $(LIBS)
-collect2.o : collect2.c $(CONFIG_H) system.h gansidecl.h gstab.h obstack.h \
- $(DEMANGLE_H)
+collect2.o : collect2.c $(CONFIG_H) system.h gansidecl.h gstab.h \
+ $(srcdir)/../include/obstack.h $(DEMANGLE_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
-c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h toplev.h
hash.o: hash.c hash.h system.h toplev.h
-cplus-dem.o: cplus-dem.c $(DEMANGLE_H)
+
+cplus-dem.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)
+ rm -f cplus-dem.c
+ $(LN_S) $(srcdir)/../libiberty/cplus-dem.c cplus-dem.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) cplus-dem.c
+
+pexecute.o: $(srcdir)/../libiberty/pexecute.c $(CONFIG_H) system.h gansidecl.h
+ rm -f pexecute.c
+ $(LN_S) $(srcdir)/../libiberty/pexecute.c pexecute.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) pexecute.c
+
+vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(CONFIG_H) system.h gansidecl.h
+ rm -f vfprintf.c
+ $(LN_S) $(srcdir)/../libiberty/vfprintf.c vfprintf.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) vfprintf.c
underscore.c: s-under ; @true
@@ -1307,7 +1342,7 @@ s-under: $(GCC_PASSES)
# A file used by all variants of C.
c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \
- flags.h toplev.h
+ flags.h toplev.h output.h
# Language-independent files.
@@ -1323,13 +1358,40 @@ gcc.o: gcc.c $(CONFIG_H) system.h gansidecl.h multilib.h Makefile \
$(DRIVER_DEFINES) \
-c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
+tree-check.h: s-check ; @true
+s-check : gencheck $(srcdir)/move-if-change
+ ./gencheck > tmp-check.h
+ $(srcdir)/move-if-change tmp-check.h tree-check.h
+ touch s-check
+
+gencheck : gencheck.o tree.def $(lang_tree_files) $(HOST_LIBDEPS)
+ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
+ gencheck.o $(HOST_LIBS)
+
+gencheck.o : gencheck.c hconfig.h system.h
+ $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencheck.c
+
dumpvers: dumpvers.c
version.o: version.c
-obstack.o: obstack.c $(CONFIG_H)
ggc_simple.o: ggc_simple.c $(CONFIG_H) $(RTL_BASE_H) $(TREE_H)
-choose-temp.o: choose-temp.c $(CONFIG_H) gansidecl.h system.h
-pexecute.o: pexecute.c $(CONFIG_H) system.h gansidecl.h
+
+obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
+ rm -f obstack.c
+ $(LN_S) $(srcdir)/../libiberty/obstack.c obstack.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) obstack.c
+
+choose-temp.o: $(srcdir)/../libiberty/choose-temp.c $(CONFIG_H) gansidecl.h \
+ system.h
+ rm -f choose-temp.c
+ $(LN_S) $(srcdir)/../libiberty/choose-temp.c choose-temp.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) choose-temp.c
+
+mkstemp.o: $(srcdir)/../libiberty/mkstemp.c $(CONFIG_H) gansidecl.h system.h
+ rm -f mkstemp.c
+ $(LN_S) $(srcdir)/../libiberty/mkstemp.c mkstemp.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) mkstemp.c
+
prefix.o: prefix.c $(CONFIG_H) system.h gansidecl.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DPREFIX=\"$(prefix)\" \
@@ -1337,134 +1399,148 @@ prefix.o: prefix.c $(CONFIG_H) system.h gansidecl.h Makefile
convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h toplev.h
-tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h
+tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h except.h
print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H)
stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
- function.h expr.h insn-codes.h $(RTL_H) toplev.h
-fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
+ function.h $(EXPR_H) $(RTL_H) toplev.h except.h
+fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
+ $(RTL_H)
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) \
flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
- insn-codes.h insn-config.h recog.h Makefile toplev.h \
+ insn-codes.h insn-config.h $(RECOG_H) Makefile toplev.h dwarfout.h \
+ dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
$(lang_options_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
-DTARGET_NAME=\"$(target_alias)\" \
-c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
-rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H)
+rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h
-print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H)
+print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h
rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
- function.h defaults.h insn-codes.h expr.h hard-reg-set.h regs.h \
- xcoffout.h output.h c-pragma.h toplev.h
+ function.h defaults.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
+ xcoffout.h output.h c-pragma.h toplev.h except.h dbxout.h sdbout.h
function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- function.h insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h \
- insn-config.h $(RECOG_H) output.h toplev.h
+ function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
+ insn-config.h $(RECOG_H) output.h toplev.h except.h
stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
- insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h except.h \
- loop.h $(RECOG_H) toplev.h
+ insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \
+ loop.h $(RECOG_H) toplev.h output.h
except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- function.h insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h \
+ function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
insn-config.h $(RECOG_H) output.h except.h toplev.h
expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
- regs.h insn-flags.h insn-codes.h expr.h insn-config.h $(RECOG_H) output.h \
- typeclass.h hard-reg-set.h toplev.h
-calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h expr.h \
- insn-codes.h insn-flags.h regs.h toplev.h
+ $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) output.h \
+ typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h
+calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
+ insn-flags.h $(REGS_H) toplev.h output.h
expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- insn-flags.h insn-config.h insn-codes.h expr.h $(RECOG_H) real.h
+ insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) real.h
explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- hard-reg-set.h insn-config.h expr.h $(RECOG_H) insn-flags.h insn-codes.h
+ hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) insn-flags.h insn-codes.h
optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- insn-flags.h insn-config.h insn-codes.h expr.h $(RECOG_H) reload.h
-dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h regs.h \
- insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
+ insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h
+dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \
+ insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h dbxout.h \
+ toplev.h
sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
- function.h expr.h output.h hard-reg-set.h regs.h defaults.h real.h \
- insn-config.h obstack.h xcoffout.h c-pragma.h
+ function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) defaults.h real.h \
+ insn-config.h $(srcdir)/../include/obstack.h xcoffout.h c-pragma.h \
+ sdbout.h toplev.h
dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
- flags.h insn-config.h reload.h output.h defaults.h toplev.h
+ flags.h insn-config.h reload.h output.h defaults.h toplev.h dwarfout.h
dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
- flags.h insn-config.h insn-codes.h reload.h output.h defaults.h \
- hard-reg-set.h regs.h expr.h toplev.h
+ flags.h insn-config.h reload.h output.h defaults.h \
+ hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h dyn-string.h
xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
- flags.h
+ flags.h toplev.h output.h dbxout.h
emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- except.h function.h regs.h insn-config.h insn-codes.h $(RECOG_H) real.h \
- expr.h obstack.h hard-reg-set.h
+ except.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h \
+ $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h
real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
getpwd.o : getpwd.c $(CONFIG_H) system.h
integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- integrate.h insn-flags.h insn-config.h insn-codes.h expr.h real.h regs.h \
- function.h output.h $(RECOG_H) except.h
+ integrate.h insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
+ function.h output.h $(RECOG_H) except.h toplev.h
-jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h regs.h \
- insn-config.h insn-codes.h insn-flags.h $(RECOG_H) expr.h real.h except.h
-stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) regs.h hard-reg-set.h flags.h
+jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
+ insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h \
+ toplev.h
+stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
+ $(BASIC_BLOCK_H) insn-config.h reload.h flags.h toplev.h
-cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) regs.h hard-reg-set.h flags.h \
- real.h insn-config.h insn-codes.h $(RECOG_H) expr.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
+gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
+ real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) output.h
profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-flags.h \
- gcov-io.h $(TREE_H) output.h regs.h toplev.h
+ gcov-io.h $(TREE_H) output.h $(REGS_H) toplev.h insn-config.h
loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h loop.h insn-config.h \
- insn-flags.h insn-codes.h regs.h hard-reg-set.h $(RECOG_H) expr.h real.h
-unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h insn-codes.h \
- integrate.h regs.h $(RECOG_H) flags.h expr.h loop.h
+ insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
+ toplev.h
+unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
+ integrate.h $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) loop.h toplev.h
flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-config.h \
- $(BASIC_BLOCK_H) regs.h hard-reg-set.h output.h
+ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h
combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h \
- insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
- $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h
+ insn-config.h insn-flags.h insn-codes.h insn-attr.h $(REGS_H) $(EXPR_H) \
+ $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.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
+ $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h toplev.h \
+ output.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) output.h
+ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) output.h \
+ insn-attr.h toplev.h
bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
- regs.h
-global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h \
- $(BASIC_BLOCK_H) regs.h hard-reg-set.h insn-config.h output.h
+ $(REGS_H)
+global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h \
+ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h
+varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h
-reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h expr.h \
- reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h regs.h \
+reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \
+ reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \
real.h toplev.h
-reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h expr.h \
- reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
+reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h $(EXPR_H) \
+ reload.h $(REGS_H) hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h toplev.h
caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \
- regs.h hard-reg-set.h insn-codes.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) \
- reload.h expr.h
+ $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) \
+ $(RECOG_H) reload.h $(EXPR_H) toplev.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-codes.h insn-attr.h \
- insn-flags.h $(RECOG_H) flags.h output.h expr.h
-alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h regs.h \
- insn-codes.h
+ $(BASIC_BLOCK_H) $(REGS_H) insn-config.h insn-attr.h \
+ insn-flags.h $(RECOG_H) flags.h output.h $(EXPR_H)
+alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
+ $(REGS_H) toplev.h output.h $(EXPR_H)
regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
- insn-codes.h recog.h output.h reload.h regs.h hard-reg-set.h flags.h \
- expr.h insn-flags.h
+ $(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h \
+ $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
$(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) system.h $(RTL_H) \
- $(BASIC_BLOCK_H) regs.h hard-reg-set.h flags.h insn-config.h insn-attr.h
-final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h regs.h \
+ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
+ toplev.h
+final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(REGS_H) \
$(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \
hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h \
- toplev.h
+ toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h dbxout.h
recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) \
- regs.h $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
+ $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
insn-flags.h insn-codes.h real.h
reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) \
- regs.h hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h
+ $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h
+dyn-string.o: dyn-string.c dyn-string.h $(CONFIG_H) system.h gansidecl.h
$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \
- $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
- insn-flags.h output.h insn-attr.h insn-codes.h
+ $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
+ insn-flags.h output.h insn-attr.h insn-codes.h system.h toplev.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
# Build auxiliary files that support ecoff format.
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
+mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h machmode.h
mips-tdump: mips-tdump.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
@@ -1477,9 +1553,11 @@ halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
# Normally this target is not used; but it is used if you
# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
# from the GNU Emacs distribution.
-alloca.o: alloca.c
+alloca.o: $(srcdir)/../libiberty/alloca.c
+ rm -f alloca.c
+ $(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
- -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
+ -c `echo alloca.c | sed 's,^\./,,'`
$(ALLOCA_FINISH)
#
# Generate header and source files from the machine description,
@@ -1526,8 +1604,8 @@ s-codes : $(md_file) gencodes $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-codes.h insn-codes.h
touch s-codes
-insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
- insn-config.h insn-flags.h insn-codes.h system.h
+insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
+ insn-config.h insn-flags.h insn-codes.h system.h reload.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
insn-emit.c: s-emit ; @true
@@ -1547,7 +1625,7 @@ s-recog : $(md_file) genrecog $(srcdir)/move-if-change
touch s-recog
insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
- insn-config.h flags.h $(RECOG_H) expr.h reload.h system.h
+ insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
insn-opinit.c: s-opinit ; @true
@@ -1556,7 +1634,7 @@ s-opinit : $(md_file) genopinit $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
touch s-opinit
-insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h
+insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
insn-extract.c: s-extract ; @true
@@ -1565,7 +1643,7 @@ s-extract : $(md_file) genextract $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-extract.c insn-extract.c
touch s-extract
-insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h system.h
+insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
insn-peep.c: s-peep ; @true
@@ -1574,8 +1652,8 @@ s-peep : $(md_file) genpeep $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-peep.c insn-peep.c
touch 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
+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
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
insn-attr.h: s-attr ; @true
@@ -1596,7 +1674,7 @@ s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
touch s-attrtab
-insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
+insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h conditions.h \
hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h $(RECOG_H) \
insn-codes.h system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
@@ -1607,7 +1685,7 @@ s-output : $(md_file) genoutput $(srcdir)/move-if-change
$(srcdir)/move-if-change tmp-output.c insn-output.c
touch s-output
-genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H)
+genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h
genrtl.c genrtl.h : s-genrtl
@true # force gnu make to recheck modification times.
@@ -1723,7 +1801,7 @@ gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h
# If we are not cross-building, gen* use the same .o's that cc1 will use,
# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
# with the rules for rtl.o, alloca.o, etc.
-$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
+$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h
rm -f $(HOST_PREFIX)rtl.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
@@ -1733,24 +1811,30 @@ $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
+$(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \
+ flags.h $(BASIC_BLOCK_H) $(REGS_H)
+ rm -f $(HOST_PREFIX)bitmap.c
+ sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
+ $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
+
$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
rm -f $(HOST_PREFIX)rtlanal.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
-$(HOST_PREFIX_1)alloca.o: alloca.c
+$(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
rm -f $(HOST_PREFIX)alloca.c
- cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
+ $(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
-$(HOST_PREFIX_1)obstack.o: obstack.c
+$(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c
rm -f $(HOST_PREFIX)obstack.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
+ sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
-$(HOST_PREFIX_1)vfprintf.o: vfprintf.c
+$(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c
rm -f $(HOST_PREFIX)vfprintf.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/vfprintf.c > $(HOST_PREFIX)vfprintf.c
+ sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/vfprintf.c > $(HOST_PREFIX)vfprintf.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)vfprintf.c
$(HOST_PREFIX_1)doprint.o: doprint.c
@@ -1775,48 +1859,51 @@ $(HOST_PREFIX_1):
cpp$(exeext): $(CCCP)$(exeext)
-rm -f cpp$(exeext)
$(LN) $(CCCP)$(exeext) cpp$(exeext)
-cccp$(exeext): cccp.o cexp.o version.o prefix.o $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o \
- version.o $(LIBS)
+cccp$(exeext): cccp.o cexp.o version.o prefix.o mbchar.o @extra_cpp_objs@ $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o mbchar.o \
+ version.o @extra_cpp_objs@ $(LIBS)
cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h gansidecl.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
$(srcdir)/cexp.c: $(srcdir)/cexp.y
cd $(srcdir); $(BISON) -o cexp.c cexp.y
-cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h gansidecl.h
+# We use $(libsubdir)/$(unlibsubdir) to match the
+# -iprefix argument which gcc will pass if GCC_EXEC_PREFIX is used.
+cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h gansidecl.h \
+ mbchar.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
- -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
- -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \
- -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
- -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
- -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
+ -DGPLUSPLUS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include/g++\" \
+ -DLOCAL_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include\" \
+ -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
+ -DTOOL_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/include\" \
-c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
cppmain$(exeext): cppmain.o cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o \
- prefix.o version.o $(LIBDEPS)
+ prefix.o version.o mbchar.o @extra_cpp_objs@ $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cppmain.o cpplib.o cpphash.o \
+ mbchar.o @extra_cpp_objs@ \
cppalloc.o cpperror.o cppexp.o prefix.o version.o $(LIBS)
-cppmain.o: cppmain.c $(CONFIG_H) cpplib.h system.h
+cppmain.o: cppmain.c $(CONFIG_H) cpplib.h system.h gansidecl.h
-cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status system.h
+cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status system.h \
+ gansidecl.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
- -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
-c `echo $(srcdir)/cpplib.c | sed 's,^\./,,'`
-cpperror.o: cpperror.c $(CONFIG_H) cpplib.h system.h
+cpperror.o: cpperror.c $(CONFIG_H) cpplib.h system.h gansidecl.h
-cppexp.o: cppexp.c $(CONFIG_H) cpplib.h system.h
+cppexp.o: cppexp.c $(CONFIG_H) cpplib.h system.h gansidecl.h
-cpphash.o: cpphash.c cpplib.h cpphash.h $(CONFIG_H) system.h
+cpphash.o: cpphash.c cpplib.h cpphash.h $(CONFIG_H) system.h gansidecl.h
-cppalloc.o: cppalloc.c $(CONFIG_H) cpplib.h system.h
+cppalloc.o: cppalloc.c $(CONFIG_H) cpplib.h system.h gansidecl.h
# Note for the stamp targets, we run the program `true' instead of
# having an empty command (nothing following the semicolon).
@@ -1824,41 +1911,46 @@ cppalloc.o: cppalloc.c $(CONFIG_H) cpplib.h system.h
proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
protoize$(exeext): protoize.o getopt.o getopt1.o getpwd.o version.o \
- pexecute.o choose-temp.o $(LIBDEPS)
+ pexecute.o choose-temp.o mkstemp.o $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
protoize.o getopt.o getopt1.o getpwd.o version.o \
- pexecute.o choose-temp.o $(LIBS)
+ pexecute.o choose-temp.o mkstemp.o $(LIBS)
unprotoize$(exeext): unprotoize.o getopt.o getopt1.o getpwd.o version.o \
- pexecute.o choose-temp.o $(LIBDEPS)
+ pexecute.o choose-temp.o mkstemp.o $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
unprotoize.o getopt.o getopt1.o getpwd.o version.o \
- pexecute.o choose-temp.o $(LIBS)
+ pexecute.o choose-temp.o mkstemp.o $(LIBS)
-protoize.o: protoize.c getopt.h $(CONFIG_H) system.h
+protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
- -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
+ -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DSTD_PROTO_DIR=\"$(libsubdir)\" \
$(srcdir)/protoize.c
-unprotoize.o: unprotoize.c protoize.c getopt.h $(CONFIG_H) system.h
+unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
- -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
+ -DCROSS_INCLUDE_DIR=\"$(libsubdir)/$(unlibsubdir)/../$(target_alias)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DSTD_PROTO_DIR=\"$(libsubdir)\" \
$(srcdir)/unprotoize.c
-getopt.o: getopt.c getopt.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
-getopt1.o: getopt1.c getopt.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
+getopt.o: $(srcdir)/../libiberty/getopt.c $(srcdir)/../include/getopt.h
+ rm -f getopt.c
+ $(LN_S) $(srcdir)/../libiberty/getopt.c getopt.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) getopt.c
+
+getopt1.o: $(srcdir)/../libiberty/getopt1.c $(srcdir)/../include/getopt.h
+ rm -f getopt1.c
+ $(LN_S) $(srcdir)/../libiberty/getopt1.c getopt1.c
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) getopt1.c
# This info describes the target machine, so compile with GCC just built.
SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
@@ -1906,9 +1998,9 @@ gcov$(exeext): gcov.o $(LIBDEPS)
# s-* so that mostlyclean does not force the include directory to
# be rebuilt.
-# Build the include directory except for float.h (which depends upon
+# Build the include directory including float.h (which no longer depends upon
# enquire).
-stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h
+stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h gfloat.h
# Copy in the headers provided with gcc.
# The sed command gets just the last file name component;
# this is necessary because VPATH could add a dirname.
@@ -1926,24 +2018,27 @@ stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h
rm -f include/limits.h
cp xlimits.h include/limits.h
chmod a+r include/limits.h
-# Install the README
- rm -f include/README
- cp $(srcdir)/README-fixinc include/README
- chmod a+r include/README
- touch stmp-int-hdrs
-
-# Build the complete include directory, including float.h.
-stmp-headers: stmp-int-hdrs gfloat.h
rm -f include/float.h
if [ -s gfloat.h ]; then \
cp gfloat.h include/float.h && \
chmod a+r include/float.h; \
else :; fi
- touch stmp-headers
+# Install the README
+ rm -f include/README
+ cp $(srcdir)/README-fixinc include/README
+ chmod a+r include/README
+ touch $@
+
+# Now that gfloat.h no longer depends upon enquire, this is actually a no-op.
+stmp-headers:
+ touch $@
fixinc.sh :
- cd ../contrib/fixinc ; CC=$(CC) MAKE=$(MAKE) CFLAGS=$(CFLAGS) \
- $(SHELL) mkfixinc.sh $(target) $(srcdir)
+ DEST=`cd $(srcdir) ; pwd`/$@ CC=$(CC) MAKE=$(MAKE) CFLAGS="$(CFLAGS)" \
+ export DEST CC MAKE CFLAGS ; \
+ echo DEST=$$DEST CC=$$CC MAKE=$$MAKE CFLAGS=$$CFLAGS ; \
+ cd ../contrib/fixinc ; \
+ $(SHELL) mkfixinc.sh $(target) $$DEST
# Build fixed copies of system files.
stmp-fixinc: $(FIXINCLUDES) gsyslimits.h
@@ -1969,15 +2064,33 @@ stmp-fixinc: $(FIXINCLUDES) gsyslimits.h
cp $(srcdir)/gsyslimits.h include/syslimits.h; \
fi
chmod a+r include/syslimits.h
+# If $(SYSTEM_HEADER_DIR) is $(tooldir)/sys-include, and
+# that directory exists, then make sure that $(libsubdir) exists.
+# This is because cpp is compiled to find $(tooldir)/include via
+# $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
+# exists.
+ if [ "$(SYSTEM_HEADER_DIR)" = "$(tooldir)/sys-include" ] \
+ && [ -d $(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
+
touch stmp-fixinc
# Files related to the fixproto script.
deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
- CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \
+ if [ -d $(SYSTEM_HEADER_DIR) ]; \
+ then \
+ CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \
export CC; \
- $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h
- mv tmp-deduced.h deduced.h
+ $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
+ mv tmp-deduced.h deduced.h; \
+ else \
+ touch deduced.h; \
+ fi
gen-protos: gen-protos.o scan.o cppalloc.o $(HOST_LIBDEPS)
${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
@@ -1999,16 +2112,16 @@ xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefil
rm -rf fixtmp.c
fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS) \
- cpplib.o cpphash.o cppalloc.o cppexp.o cpperror.o prefix.o version.o
+ cpplib.o cpphash.o cppalloc.o cppexp.o prefix.o version.o
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
scan-decls.o scan.o cpplib.o cpphash.o cppalloc.o prefix.o \
version.o cppexp.o $(HOST_LIBS)
-fix-header.o: fix-header.c obstack.h scan.h xsys-protos.h $(build_xm_file) \
- system.h
+fix-header.o: fix-header.c $(srcdir)/../include/obstack.h scan.h \
+ xsys-protos.h $(build_xm_file) system.h cpplib.h cpphash.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
-scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h
+scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h gansidecl.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
# stmp-fixproto depends on this, not on fix-header directly.
@@ -2032,7 +2145,9 @@ stmp-fixproto: fixhdr.ready fixproto stmp-headers
else \
: This line works around a 'make' bug in BSDI 1.1.; \
FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
- $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
+ if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
+ $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
+ else true; fi; \
touch include/fixed; \
fi
touch stmp-fixproto
@@ -2067,8 +2182,8 @@ cpp.dvi: $(srcdir)/cpp.texi
INSTALL: $(srcdir)/install1.texi $(srcdir)/install.texi
- $(MAKEINFO) -D INSTALLONLY --no-header --no-split -o INSTALL \
- $(srcdir)/install1.texi
+ cd $(srcdir); $(MAKEINFO) -D INSTALLONLY \
+ --no-split -o INSTALL install1.texi
#
# Deletion of files made during compilation.
# There are four levels of this:
@@ -2100,10 +2215,11 @@ mostlyclean: lang.mostlyclean
-rm -f */stamp-* */tmp-*
# Delete debugging dump files.
-rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
- -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.addressof *.regmove *.mach *.bp
+ -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.addressof
+ -rm -f *.regmove *.mach *.bp *.gcse
-rm -f */*.greg */*.lreg */*.combine */*.flow */*.cse */*.jump */*.rtl
-rm -f */*.tree */*.loop */*.dbr */*.jump2 */*.sched */*.cse2
- -rm -f */*.sched2 */*.stack */*.regmove
+ -rm -f */*.sched2 */*.stack */*.regmove */*.gcse
# Delete some files made during installation.
-rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c
-rm -f collect collect2 mips-tfile mips-tdump alloca.s
@@ -2151,7 +2267,7 @@ distclean: clean lang.distclean
-rm -f md cstamp-h
-rm -f config.status config.run config.cache config.bak
-rm -f Make-lang Make-hooks Make-host Make-target
- -rm -f Makefile specs.h options.h *.oaux
+ -rm -f Makefile specs.h options.h gencheck.h *.oaux
-rm -f gthr-default.h
-rm -f */stage1 */stage2 */stage3 */stage4 */include
-rm -f c-parse.output
@@ -2232,9 +2348,10 @@ installdirs:
-if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
# This dir isn't currently searched by cpp.
# -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
- -if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias) ; fi
- -if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi
- -if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; fi
+ -fdir= ; for dir in `echo $(libsubdir) | tr '/' ' '`; do \
+ fdir=$${fdir}/$${dir}; \
+ if [ -d $${fdir} ] ; then true ; else mkdir $${fdir}; chmod a+rx $${fdir}; fi ; \
+ done
-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
-if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
-if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
@@ -2278,10 +2395,17 @@ install-common: native installdirs $(EXTRA_PARTS) lang.install-common
# Install protoize if it was compiled.
-if [ -f protoize$(exeext) ]; \
then \
- rm -f $(bindir)/protoize$(exeext); \
- $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/protoize$(exeext); \
- rm -f $(bindir)/unprotoize$(exeext); \
- $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/unprotoize$(exeext); \
+ if [ -f gcc-cross$(exeext) ] ; then \
+ rm -f $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
+ rm -f $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
+ else \
+ rm -f $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
+ rm -f $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
+ fi ; \
rm -f $(libsubdir)/SYSCALLS.c.X; \
$(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
chmod a-x $(libsubdir)/SYSCALLS.c.X; \
@@ -2316,13 +2440,19 @@ install-driver: xgcc$(exeext)
# Install the info files.
# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
-# to do the install. The sed rule was copied from stmp-int-hdrs.
+# to do the install.
install-info: doc installdirs lang.install-info
-rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
for f in cpp.info* gcc.info*; do \
- realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
- $(INSTALL_DATA) $$f $(infodir)/$$realfile; \
+ $(INSTALL_DATA) $$f $(infodir)/$$f; \
done
+ -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ if [ -f $(infodir)/dir ] ; then \
+ for f in cpp.info gcc.info; do \
+ install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \
+ done; \
+ else true; fi; \
+ else true; fi;
-chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
# Install the man pages.
@@ -2435,11 +2565,13 @@ uninstall: lang.uninstall
-rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
-rm -rf $(bindir)/protoize$(exeext)
-rm -rf $(bindir)/unprotoize$(exeext)
+ -rm -rf $(bindir)/gcov$(exeext)
-rm -rf $(mandir)/$(GCC_INSTALL_NAME)$(manext)
-rm -rf $(mandir)/$(GCC_CROSS_NAME)$(manext)
-rm -rf $(mandir)/cccp$(manext)
-rm -rf $(mandir)/protoize$(manext)
-rm -rf $(mandir)/unprotoize$(manext)
+ -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
#
# These targets are for the dejagnu testsuites. The file site.exp
# contains global variables that all the testsuites will use.
@@ -2485,10 +2617,7 @@ site.exp: ./config.status Makefile
echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
else true; \
fi
- @if [ $(build_canonical) != $(host_canonical) ] ; then \
- echo "set tmpdir /tmp" >> ./tmp0 ; \
- else echo "set tmpdir $(objdir)/testsuite" >> ./tmp0 ; \
- fi
+ echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
@echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
@cat ./tmp0 > site.exp
@@ -2496,7 +2625,7 @@ site.exp: ./config.status Makefile
-e '1,/^## All variables above are.*##/ d' >> site.exp
-@rm -f ./tmp?
-CHECK_TARGETS = check-gcc check-g++ check-g77
+CHECK_TARGETS = check-gcc check-g++ check-g77 check-objc
check: $(CHECK_TARGETS)
@@ -2539,6 +2668,16 @@ check-g77: testsuite/site.exp
export TCL_LIBRARY ; fi ; \
$(RUNTEST) --tool g77 $(RUNTESTFLAGS)
+check-objc: testsuite/site.exp
+ -rootme=`pwd`; export rootme; \
+ srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+ cd testsuite; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ if [ -f $${rootme}/../expect/expect ] ; then \
+ TCL_LIBRARY=$${srcdir}/../tcl/library ; \
+ export TCL_LIBRARY ; fi ; \
+ $(RUNTEST) --tool objc $(RUNTESTFLAGS)
+
# These exist for maintenance purposes.
# Update the tags table.
@@ -2647,15 +2786,16 @@ bootstrap bootstrap-lean: force
-if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi
$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
-bootstrap2: force
+bootstrap2 bootstrap2-lean: force
$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
$(MAKE) stage2
+ -if test $@ = bootstrap2-lean; then rm -rf stage1; else true; fi
$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
-bootstrap3: force
+bootstrap3 bootstrap3-lean: force
$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
-bootstrap4: force
+bootstrap4 bootstrap4-lean: force
$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
# Compare the object files in the current directory with those in the
@@ -2827,3 +2967,57 @@ risky-stage4: stage4
.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
force:
+
+# ---
+# The enquire rules are still useful for building new float-anything.h.
+# Special flags for compiling enquire.
+# We disable optimization to make floating point more reliable.
+ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
+ENQUIRE_LDFLAGS = $(LDFLAGS)
+
+# Enquire target (This is a variable so that a target can choose not to
+# build it.)
+ENQUIRE = enquire
+
+# Test to see whether <float.h> exists in the system header files,
+# and is not derived from GCC.
+FLOAT_H_TEST = \
+ [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
+ if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
+ then false; \
+ else :; fi
+# We pretend to not having a usable <float.h>, hence disable the FLOAT_H_TEST
+# to ensure, we're emitting a full blown <float.h> ourselves.
+FLOAT_H_TEST = false
+
+# Used to compile enquire with standard cc, but have forgotten why.
+# Let's try with GCC.
+enquire: enquire.o $(GCC_PARTS)
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
+enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
+ if $(FLOAT_H_TEST); then \
+ rm -f include/float.h; \
+ SYS_FLOAT_H_WRAP=1; \
+ else :; \
+ SYS_FLOAT_H_WRAP=0; \
+ fi; \
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
+ -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
+ -I. -c $(srcdir)/enquire.c
+
+# Create float.h source for the native machine.
+# Make it empty if we can use the system float.h without changes.
+float.h-nat: enquire
+ -./enquire -f > tmp-float.h
+ grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
+ mv tmp-float.h float.h-nat
+
+# Create a dummy float.h source for a cross-compiler.
+# ??? This isn't used anymore. Should we create config/float-unkn.h
+# and make that the default float_format in configure?
+float.h-cross:
+ echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
+ echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
+ echo "#endif" >> t-float.h-cross
+ mv t-float.h-cross float.h-cross
+
diff --git a/gcc/NEWS b/gcc/NEWS
index fc09b645f77..427df254eb6 100644
--- a/gcc/NEWS
+++ b/gcc/NEWS
@@ -1,4 +1,112 @@
-Noteworthy changes in GCC for EGCS.
+Noteworthy changes in GCC after EGCS 1.1.
+-----------------------------------------
+
+Target specific NEWS
+
+ RS6000/PowerPC: -mcpu=401 was added as an alias for -mcpu=403. -mcpu=e603e
+ was added to do -mcpu=603e and -msoft-float.
+
+Noteworthy changes in GCC for EGCS 1.1.
+---------------------------------------
+
+The compiler now implements global common subexpression elimination (gcse) as
+well as global constant/copy propagation. (link to gcse page).
+
+More major improvements have been made to the alias analysis code. A new
+option to allow front-ends to provide alias information to the optimizers
+has also been added (-fstrict-aliasing). -fstrict-aliasing is off by default
+now, but will be enabled by default in the future. (link to alias page)
+
+Major changes continue in the exception handling support. This release
+includes some changes to reduce static overhead for exception handling. It
+also includes some major changes to the setjmp/longjmp based EH mechanism to
+make it less pessimistic. And finally, major infrastructure improvements
+to the dwarf2 EH mechanism have been made to make our EH support extensible.
+
+We have fixed the infamous security problems with temporary files.
+
+The "regmove" optimization pass has been nearly completely rewritten. It now
+uses much more information about the target to determine profitability of
+transformations.
+
+The compiler now recomputes register usage information immediately before
+register allocation. Previously such information was only not kept up to
+date after instruction combination which led to poor register allocation
+choices by our priority based register allocator.
+
+The register reloading phase of the compiler has been improved to better
+optimize spill code. This primarily helps targets which generate lots of
+spills (like the x86 ports and many register poor embedded ports).
+
+A few changes in the heuristics used by the register allocator and scheduler
+have been made which can significantly improve performance for certain
+applications.
+
+The compiler's branch shortening algorithms have been significantly improved
+to work better on targets which align jump targets.
+
+The compiler now supports the "ADDRESSOF" optimization which can significantly
+reduce the overhead for certain inline calls (and inline calls in general).
+
+The compiler now supports a code size optimization switch (-Os). When enabled
+the compiler will prefer optimizations which improve code size over those
+which improve code speed.
+
+The compiler has been improved to completely eliminate library calls which
+compute constant values. This is particularly useful on machines which
+do not have integer mul/div or floating point support on-chip.
+
+GCC now supports a "--help" option to print detailed help information.
+
+cpplib has been greatly improved. It is probably useable for some sites now
+(major missing feature is trigraphs).
+
+Memory footprint for the compiler has been significantly reduced for certain
+pathalogical cases.
+
+Build time improvements for targets which support lots of sched parameters
+(alpha and mips primarily).
+
+Compile time for certain programs using large constant initializers has been
+improved (effects glibc significantly).
+
+Plus an incredible number of infrastructure changes, warning fixes, bugfixes
+and local optimizations.
+
+Various improvements have been made to better support cross compilations. They
+are still not easy, but they are improving.
+
+Target specific NEWS
+
+ Sparc: Now includes V8 plus and V9 support, lots of tuning for Ultrasparcs
+ and uses the Haifa scheduler by default.
+
+ Alpha: EV6 tuned, optimized expansion of memcpy/bzero.
+
+ x86: Data in the static store is aligned per Intel recommendations. Jump
+ targets are aligned per Intel recommendations. Improved epilogue
+ sequences for Pentium chips. Backend improvements which should help
+ register allocation on all x86 variants. Support for PPro conditional
+ move instructions has been fixed and enabled. Random changes
+ throughout the port to make generated code more Pentium friendly.
+ Improved support for 64bit integer operations.
+ Unixware 7, a System V Release 5 target is now supported.
+ SCO OpenServer targets can support GAS. See gcc/INSTALL for details.
+
+ RS6000/PowerPC: Includes AIX4.3 support as well as PowerPC64 support.
+ Haifa instruction scheduling is enabled by default now.
+
+ MIPS: Multiply/Multiply-Add support has been largely rewritten to generate
+ more efficient code. Includes mips16 support.
+
+ M68K: Various micro-optimizations and Coldfire fixes.
+
+ M32r: Major improvements to this port.
+
+ Arm: Includes Thumb and super interworking support.
+
+EGCS includes all gcc2 changes up to and including the June 9, 1998 snapshot.
+
Noteworthy changes in GCC version 2.8.1
---------------------------------------
@@ -138,7 +246,7 @@ New features for Motorola 68k family:
New features for the HP PA RISC:
- -mspace and m-no-space
+ -mspace and -mno-space
-mlong-load-store and -mno-long-load-store
-mbig-switch -mno-big-switch
@@ -171,7 +279,7 @@ New features for rs6000 and PowerPC systems:
The Linux-based GNU system running on PowerPC's.
-mcpu=604e,602,603e,620,801,823,mpc505,821,860,power2
-mtune=xxx
- -mrelocatable-lib, m-no-relocatable-lib
+ -mrelocatable-lib, -mno-relocatable-lib
-msim, -mmve, -memb
-mupdate, -mno-update
-mfused-madd, -mno-fused-madd
diff --git a/gcc/PROJECTS b/gcc/PROJECTS
index 2f508e695e1..d5b53404521 100644
--- a/gcc/PROJECTS
+++ b/gcc/PROJECTS
@@ -1,5 +1,3 @@
-C++ template friend functions (mmitchell@usa.net)
-
Haifa scheduler (haifa-sched.c, loop.[ch], unroll.[ch], genattrtab.c):
(contact law@cygnus.com before starting any serious haifa work)
@@ -22,14 +20,9 @@ Haifa scheduler (haifa-sched.c, loop.[ch], unroll.[ch], genattrtab.c):
opinion that gcc already has too many -foptions, and haifa doesn't help
that situation.
- * Testing and benchmarking. Haifa has received little testing inside
- Cygnus -- it needs to be throughly tested on a wide variety of platforms
- which benefit from instruction scheduling (sparc, alpha, pa, ppc, mips, x86,
- i960, m88k, sh, etc). It needs to be benchmarked -- my tests showed
- haifa was very much a hit or miss in terms of performance improvements.
-
- Some benchmarks ran significantly fasters, other significantly slower.
- We need to work on making haifa generate better overall code.
+ * Testing and benchmarking. We've converted a few ports to using the
+ Haifa scheduler (hppa, sparc, ppc, alpha). We need to continue testing
+ and benchmarking the new scheduler on additional targets.
We need to have some kind of docs for how to best describe a machine to
the haifa scheduler to get good performance. Some existing ports have
@@ -38,6 +31,26 @@ Haifa scheduler (haifa-sched.c, loop.[ch], unroll.[ch], genattrtab.c):
+Improvements to global cse and partial redundancy elimination:
+
+The current implementation of global cse uses partial redundancy elimination
+as described in Chow's thesis.
+
+Long term we want to use lazy code motion as the basis for partial redundancy
+elimination. lcm will find as many (or more) redunancies *and* it will
+place the remaining computations at computationally optimal placement points
+within the function. This reduces the number of redundant operations performed
+as well as reducing register lifetimes. My experiments have shown that the
+cases were the current PRE code hurts performance are greatly helped by using
+lazy code motion.
+
+lcm also provides the underlying framework for several additional optimizations
+such as shrink wrapping, spill code motion, dead store elimination, and generic
+load/store motion (all the other examples are subcases of load/store motion).
+
+It can probably also be used to improve the reg-stack pass of the compiler.
+
+Contact law@cygnus.com if you're interested in working on lazy code motion.
-------------
@@ -57,14 +70,6 @@ The difficulty is in finding a clean way for the RTL which refers
to the constant (currently, only by an assembler symbol name)
to point to the constant and cause it to be output.
-* More cse
-
-The techniques for doing full global cse are described in the red
-dragon book, or (a different version) in Frederick Chow's thesis from
-Stanford. It is likely to be slow and use a lot of memory, but it
-might be worth offering as an additional option. Contact dje@cygnus.com
-before doing any work on CSE.
-
* Optimize a sequence of if statements whose conditions are exclusive.
It is possible to optimize
@@ -207,6 +212,10 @@ the same location; and, in between, there is no reference to anything
that might be that location (including no reference to a variable
address).
+This can be modeled as a partial redundancy elimination/lazy code motion
+problem. Contact law@cygnus.com before working on dead store elimination
+optimizations.
+
* Loop optimization.
Strength reduction and iteration variable elimination could be
@@ -275,8 +284,9 @@ to the order in which to generate code for subexpressions of an expression.
* More code motion.
-Consider hoisting common code up past conditional branches or
-tablejumps.
+Consider hoisting common code up past conditional branches or tablejumps.
+
+Contact law@cygnus.com before working on code hoisting.
* Trace scheduling.
diff --git a/gcc/README b/gcc/README
index 3154952a53f..fe0ac0b9f62 100644
--- a/gcc/README
+++ b/gcc/README
@@ -1,4 +1,4 @@
-This directory contains the egcs version 1.0 release of the GNU C
+This directory contains the egcs version 1.1 release of the GNU C
compiler. It includes all of the support for compiling C++ and
Objective C, including a run-time library for Objective C.
diff --git a/gcc/README.RS6000 b/gcc/README.RS6000
index 6a32c164ff7..fde55b01782 100644
--- a/gcc/README.RS6000
+++ b/gcc/README.RS6000
@@ -5,12 +5,19 @@ pseudo-op references symbols in certain sections. If GCC is invoked with
the -g debugging option (including during bootstrapping), incorrect object
files will be produced and the AIX linker will fail with a severe error.
A fix for APAR IX74254 (64BIT DISASSEMBLED OUPUT FROM COMPILER FAILS TO
-ASSEMBLE/BIND) is available from IBM Customer Support and IBM's
-service.boulder.ibm.com website.
+ASSEMBLE/BIND) is available from IBM Customer Support and from its
+service.boulder.ibm.com website as PTF U453956.
AIX 4.1 binder
+Some versions of the AIX binder (linker) can fail with a relocation
+overflow severe error when the -bbigtoc option is used to link
+GCC-produced object files into an executable that overflows the TOC.
+Linking f771, the GNU Fortran backend, will fail in this manner. A fix
+for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
+available from IBM Customer Support and from its website as PTF U455193.
+
Due to changes in the way that GCC invokes the binder (linker) for AIX 4.1,
the link step now may produce warnings of duplicate symbols which were not
reported before. The assembly files generated by GCC for AIX always have
@@ -104,8 +111,7 @@ assembler.
Any customer can order and get the replacement assembler, and install it on
one or more machines. It is available on diskette from IBM Customer Support
-and from the IBM Internet fix anonymous ftp server (FixDist) at
-aix.boulder.ibm.com (198.17.57.66).
+and from its website.
If you contact IBM Customer Support, they may also ask you for your customer
number. If you do not know it, you will still be able to get the fix, but
diff --git a/gcc/README.g77 b/gcc/README.g77
index b2c885bd8b9..f22f1799c35 100644
--- a/gcc/README.g77
+++ b/gcc/README.g77
@@ -1,134 +1,221 @@
-1998-03-08
-
-This directory contains the version 0.5.22 release of the GNU Fortran
-compiler. The GNU Fortran compiler is free software. See the file
-COPYING.g77 for copying permission.
-
-* IMPORTANT: Things you *must* do are marked with a * at the beginning of
- the line in this file!!!
-
-* DO NOT send any email (reporting bugs, asking questions, etc.) to
- <fortran@gnu.org> without *first* reading the g77 documentation,
- using `info', Info mode in GNU Emacs, or a text viewer such as `more'.
- The g77 documentation is in the files named `g77.info', `g77.info-1',
- `g77.info-2', and so on in g77 `f' directory. If these files are
- not present or you can't find them, contact the person or organization
- that put together the g77 distribution you are using (probably not the
- FSF), or ask your system administrator for help.
-
-This README is for GNU Fortran, and describes the files in the f/
-directory. The f/ directory is intended to be a subdirectory of a
-gcc source tree. These directories are referred to below as gcc/,
-which is the top-level directory containing the gcc back end, the
-gcc C front end, and other non-Fortran files, and gcc/f/, which
-contains all of the Fortran files.
-
-* To build GNU Fortran, you must have a source distribution of gcc
- version 2.7.2.3. Do not attempt to use any other version
- of gcc, because this version of g77 is designed to work only with
- gcc version 2.7.2.3.
-
-* Note that you must have source copies of these gcc distributions!!
- You cannot build g77 just using binaries of gcc. Also, unless you
- are an expert, avoid using any distribution of gcc not identical to
- the one distributed by the FSF.
-
-If you have just unpacked the g77 distribution, before proceeding,
+1998-08-11
+
+This directory contains the egcs variant of version 0.5.24 of the
+GNU Fortran compiler (g77). The GNU Fortran compiler is free software.
+See the file COPYING.g77 for copying permission.
+
+Currently, two variants of g77 exist. One is the Free Software Foundation
+(FSF) variant. The other is the egcs variant. As of egcs version 1.1,
+these variants are kept fairly similar in most respects. Pertinent
+differences, such as the layout of the source code, are specified below.
+
+Below, `[FSF]' denotes information applicable to only the FSF variant of
+g77, while `[egcs]' denotes egcs-only information.
+
+
+* IMPORTANT: Things you *must* do (or avoid) are marked with a * at the
+ beginning of the line in this file!!!
+
+
+The email address to which bugs are to be reported is either
+[FSF] <fortran@gnu.org> or [egcs] <egcs-bugs@cygnus.com>.
+
+* *DO NOT* send any email (reporting bugs, asking questions, etc.) to
+ either of these addresses without *first* reading the g77 documentation.
+ Use `info', Info mode in GNU Emacs, or a text viewer such as `more' to
+ do this.
+
+ The g77 documentation is in the source files named `g77.info',
+ `g77.info-1', `g77.info-2', and so on in the `f' subdirectory. If these
+ files are not present or you can't find them, contact the person or
+ organization that put together the g77 distribution you are using (probably
+ not the FSF or egcs), or ask your system administrator for help.
+
+
+This README applies to only the g77-specific portions of the source-code
+tree that contains it. These portions include:
+
+ - The README.g77 and [FSF] COPYING.g77 files, in this directory, "this
+ directory" being [FSF] the top-level directory containing a g77
+ distribution or [egcs] the gcc/ subdirectory of an egcs distribution.
+
+ - The g77 front end, in the f/ subdirectory of this directory.
+
+ - The libg2c library, in [FSF] the f/runtime/ subdirectory of this
+ directory or [egcs] the libf2c/ directory under the top-level
+ directory of the egcs distribution.
+
+
+* To build g77, you must have a source distribution of [FSF] gcc
+ version 2.8 or [egcs] egcs version 1.1. Do not attempt to use
+ any other version of gcc or egcs, because this version of g77 is
+ designed to work with only those versions.
+
+ Note that you must have *source* copies of the gcc or egcs distribution!
+ You cannot build g77 just using binaries of gcc or egcs. Also, unless
+ you are an expert, avoid using any distribution of gcc or egcs not
+ identical to the ones distributed by the FSF and Cygnus Support,
+ respectively. The primary FSF distribution site is:
+
+ <ftp://ftp.gnu.org/pub/gnu/>
+
+ The primary egcs distribution site is:
+
+ <ftp://ftp.cygnus.com/pub/egcs/>
+
+ Both of these sites have approved mirror sites from which valid
+ distributions also may be obtained.
+
+* Do not attempt to combine the egcs version of g77 with the FSF
+ gcc distribution, or the FSF version of g77 with the egcs gcc
+ distribution. Although the differences are minor, they might
+ be sufficient to prevent g77 from building properly, or from
+ working properly if the build appears to succeed.
+
+[FSF] g77 is distributed as g77-<version>/f/ so that unpacking the g77
+distribution is done in the normal GNU way, resulting in a directory having
+the version number in the name. However, to build g77, the g77 distribution
+must be merged with an appropriate gcc distribution, normally in a gcc
+source directory, before configuring, building, and installing g77.
+
+[FSF] If you have just unpacked the g77 distribution, before proceeding,
you must merge the contents of the g77 distribution with the appropriate
-gcc distribution on your system before proceeding.
+gcc distribution on your system.
-* Read and follow the instructions in g77-0.5.22/f/INSTALL that
+* [FSF] Read and follow the instructions in f/INSTALL that
explain how to merge a g77 source directory into a gcc source
directory. You can use Info to read the same installation
instructions via:
- info -f g77-0.5.22/f/g77.info -n Unpacking
+ info -f f/g77.info -n Unpacking
-The resulting directory layout includes the following, where gcc/ might be
-a link to, for example, gcc-2.7.2.3/:
+[FSF] The resulting directory layout includes the following, where gcc/
+might be a link to, for example, gcc-2.8.1/:
- gcc/ Non-Fortran files in gcc (not part of g77*.tar)
+ gcc/ Non-g77 files in gcc
+ gcc/COPYING.g77 A copy of the GPL, under which g77 is licensed
gcc/README.g77 This file
gcc/f/ GNU Fortran front end
- gcc/f/gbe/ Patches required for gcc back end versions
- gcc/f/runtime/ libf2c configuration and f2c.h file generation
- gcc/f/runtime/libF77/ Non-I/O portion of libf2c
- gcc/f/runtime/libI77/ I/O portion of libf2c
- gcc/f/runtime/libU77/ Additional interfaces to libc for libf2c
-
-gcc/f/ as a whole contains the program GNU Fortran (g77), plus a portion
-of the separate program f2c, which is in gcc/f/runtime. NOTE: The libf2c
-code is not part of the program g77, just distributed with it.
+ gcc/f/runtime/ libg2c configuration and g2c.h file generation
+ gcc/f/runtime/libF77/ Non-I/O portion of libg2c
+ gcc/f/runtime/libI77/ I/O portion of libg2c
+ gcc/f/runtime/libU77/ Additional interfaces to libc for libg2c
-This directory is named gcc/f/ because it, along with its contents, is
-designed to be a subdirectory of a GNU CC (gcc) development directory. I.e.
-when a gcc distribution is unpacked into a directory (named gcc/ for
-example), it typically contains subdirectories like gcc/config/ and
-gcc/cp/. The latter is the subdirectory for the GNU C++ (g++) program.
-
-Similarly, the g77 directory f/ is designed to be placed in gcc/ so that
-it becomes the subdirectory gcc/f/. g77 is distributed as g77-someversion/f/
-so that unpacking the g77 distribution is done in the normal GNU way,
-resulting in a directory having the version number in the name. However,
-to build g77, the g77 distribution must be merged with an appropriate gcc
-distribution, normally in a gcc directory, before configuring, building,
-and installing g77.
-
-Applying g77 patches in the form of .diff files is done by typing
-`patch -p1 -d gcc' (where gcc/f/ is the active version). That is,
+[FSF] Applying g77 patches in the form of .diff files is done by typing
+`patch -p1 -d gcc' (where gcc/ contains the f/ subdirectory). That is,
g77 patches are distributed in the same form, and at the same directory
level, as patches to the gcc distribution. (Note: make sure you're
using GNU patch, version 2.5 or later! Other versions of patch
have trouble with g77-related patches.)
-gcc/f/ has text files that document the Fortran compiler, source
+[egcs] The egcs version of g77 is distributed already merged with
+the rest of egcs (such as the gcc back end).
+
+[egcs] The resulting directory layout includes the following, where egcs/
+might be a link to, for example, egcs-1.1/:
+
+ egcs/gcc/ Non-g77 files in gcc
+ egcs/gcc/README.g77 This file
+ egcs/gcc/f/ GNU Fortran front end
+ egcs/libf2c/ libg2c configuration and g2c.h file generation
+ egcs/libf2c/libF77/ Non-I/O portion of libg2c
+ egcs/libf2c/libI77/ I/O portion of libg2c
+ egcs/libf2c/libU77/ Additional interfaces to libc for libg2c
+
+[egcs] Applying g77-specific patches to egcs is done the same way as
+applying other egcs patches.
+
+
+Below, `libf2c/' shall denote [FSF] gcc/f/runtime/ or [egcs] egcs/libf2c/,
+while `f/' shall denote [FSF] the rest of gcc/f/ or [egcs] egcs/gcc/f/.
+
+
+Components of note in g77 are described below.
+
+f/ as a whole contains the program GNU Fortran (g77), while libf2c/
+contains a portion of the separate program f2c. Note: The libf2c
+code is not part of the program g77, just distributed with it.
+
+f/ contains text files that document the Fortran compiler, source
files for the GNU Fortran Front End (FFE), and some other stuff.
+The g77 compiler code is placed in f/ because it, along with its contents,
+is designed to be a subdirectory of a GNU CC (gcc) source directory, gcc/,
+which is structured so that language-specific front ends can be "dropped
+in" as subdirectories. The C++ front end (g++), is an example of this --
+it resides in the cp/ subdirectory. Note that the C front end (also
+referred to as gcc) is an exception to this, as its source files reside
+in the gcc/ directory itself.
+
+libf2c/ contains the run-time libraries for the f2c program, also used
+by g77. These libraries normally referred to collectively as libf2c.
+When built as part of g77, libf2c is installed under the name libg2c to avoid
+conflict with any existing version of libf2c, and thus is often referred
+to as libg2c when the g77 version is specifically being referred to.
+
+The netlib version of libf2c/ contains two distinct libraries, libF77 and
+libI77, each in their own subdirectories. In g77, this distinction is not
+made, beyond maintaining the subdirectory structure in the source-code tree.
+
+libf2c/ is not part of the program g77, just distributed with it. It
+contains files not present in the official (netlib) version of libf2c,
+and also contains some minor changes made from libf2c, to fix some bugs,
+and to facilitate automatic configuration, building, and installation of
+libf2c (as libg2c) for use by g77 users.
-gcc/f/gbe/ has patch files for various versions of gcc, primarily
-needed to patch the GNU compiler Back End (GBE) to fix and improve it
-for use with g77. If a patch file exists for the version of gcc you
-want to build along with g77, you MUST apply the patch before building
-g77 with that version or g77 will not build or work properly.*
+* See libf2c/README for more information, including licensing conditions
+ governing distribution of programs containing code from libg2c.
-* Read gcc/f/gbe/README for more information.
+libg2c, g77's version of libf2c, adds Dave Love's implementation of
+libU77, in the libf2c/libU77/ directory. This library is distributed
+under the GNU Library General Public License (LGPL) -- see the
+file libf2c/libU77/COPYING.LIB for more information, as this license
+governs distribution conditions for programs containing code from
+this portion of the library.
-gcc/f/runtime/ contains the run-time libraries for the f2c program, also used
-by g77, and referred to as libf2c (though libf2c is really a combination of
-two distinct libraries, libF77 and libI77 -- in g77, this distinction is
-not made, and, further, Dave Love's implementation of libU77 is added
-to the mix). This separate subdirectory is not part of the program g77, just
-distributed with it. Some new files have been added to this subdirectory
-and some minor changes made to the files contained therein, to fix some
-bugs and facilitate automatic configuration, building, and installation of
-libf2c for use by g77 users. See gcc/f/runtime/README for more information.
-gcc/f/BUGS lists some important bugs known to be in g77. Or:
+Files of note in g77 are described below.
- info -f gcc/f/g77.info -n "Actual Bugs"
+f/BUGS lists some important bugs known to be in g77. Or:
-gcc/f/ChangeLog lists recent changes to g77 internals.
+ info -f f/g77.info -n "Actual Bugs"
-gcc/f/INSTALL describes how to build and install GNU Fortran. Or:
+f/ChangeLog lists recent changes to g77 internals.
- info -f gcc/f/g77.info -n Installation
+libf2c/ChangeLog lists recent changes to libg2c internals.
-gcc/f/NEWS contains the per-release changes (not just user-visible ones
-seen in gcc/f/DOC) listed in the ~fortran/.plan file. Or:
+[FSF] f/INSTALL describes how to build and install GNU Fortran. Or:
- info -f gcc/f/g77.info -n News
+ info -f f/g77.info -n Installation
-* Read gcc/f/BUGS, gcc/f/INSTALL, and gcc/f/NEWS at the very least!
- All users of g77 (not just installers) should read gcc/f/g77.info*
+f/NEWS contains the per-release changes. These include the user-visible
+changes described under "Changes" in the g77 documentation, plus internal
+changes of import. Or:
+
+ info -f f/g77.info -n News
+
+* All users of g77 (not just installers) should read f/g77.info*
as well, using the `more' command if neither the `info' command,
nor GNU Emacs (with its Info mode), are available, or if they
- aren't yet accustomed to using these tools.
+ aren't yet accustomed to using these tools. Read f/BUGS and f/NEWS
+ plus, if you are planning on building or installing the FSF version
+ of g77, f/INSTALL, at the very least! All of these files are
+ readable as "plain text" files.
+
+* Also see <ftp://alpha.gnu.org/g77.plan> for up-to-date information
+ regarding g77 bug reports, known bugs, bug-fixes, and new versions.
+
+
+The rest of this file is of note to only those who wish to
+debug, modify, or test the FFE (in conjunction with the gcc back end).
-If you want to get into the FFE code, which lives entirely in gcc/f/, here
-are a few clues. The file g77.c is the stand-alone source file for the
-`g77' command driver only -- this just invokes the `gcc' command, so it has
-nothing to do with the rest of the code in g77. Most of the code
-ends up in an executable named `f771', which does the actual compiling,
-so it has the FFE merged with the gcc back end.
+If you want to explore the FFE code, which lives entirely in f/, here
+are a few clues. The file g77spec.c contains the g77-specific source code
+for the `g77' command only -- this just forms a variant of the `gcc'
+command, so, just as the `gcc' command itself does not contain
+the C front end, the `g77' command does not contain the Fortran front
+end (FFE). The FFE code ends up in an executable named `f771', which
+does the actual compiling, so it contains the FFE plus the gcc back end
+(the latter to do most of the optimization, and the code generation).
The file parse.c is the source file for main() for a stand-alone FFE and
yyparse() for f771. (Stand-alone building of the FFE doesn't work these days.)
@@ -158,7 +245,7 @@ is being dynamically configured by ffecom_init_0); com.h and com.c, which
interface to the target back end (currently only FFE stand-alone and the GBE);
ste.c, which contains code for implementing recognized executable statements
in the target back end (again currently either FFE or GBE); src.h and src.c,
-which describe information on the format(s) of source files (like whether
+which describe information on the format(s) of source files (such as whether
they are never to be processed as case-insensitive with regard to Fortran
keywords); and proj.c, which contains whatever code is needed to support
the language defined by proj.h.
@@ -173,4 +260,4 @@ the compiler is in the second pass, otherwise it is in the first.
(This information might help you reduce a test case and/or work around
a bug in g77 until a fix is available.)
-Any questions or comments on these topics, email <fortran@gnu.org>.
+Any questions or comments on these topics? Read the g77 documentation!
diff --git a/gcc/README.gnat b/gcc/README.gnat
index ef43acf7da7..2746665c806 100644
--- a/gcc/README.gnat
+++ b/gcc/README.gnat
@@ -122,7 +122,7 @@ diff -c ada/a-misc.c /home/brolley/comp/egcs/tmp/ada/a-misc.c
void
! init_parse (filename)
-! char *filename
+! char *filename;
{
lang_expand_expr = gnat_expand_expr;
@@ -237,3 +237,199 @@ diff -c ada/a-tree.def /home/brolley/comp/egcs/tmp/ada/a-tree.def
! DEFTREECODE (GNAT_NOP_EXPR, "gnat_nop_expr", '1', 1)
+
+This patch from Fred Fish to GNAT may make building simpler. We haven't
+tested it.
+
+> I put a very short blurb in the faq. GNAT is complicated enough that
+> we should probably write a whole page on how to build/install it.
+
+You may want to use some or all of these patches:
+
+ * Make-lang.in (gnattools): Depends upon GCC_PARTS.
+ (ada.start.encap): Depends upon gnattools.
+ (ada.rest.encap): Depends upon gnatlib.
+ * Makefile.in (../stamp-gnatlib1): Since we are still in the rts
+ subdir when the rule runs, we need to touch ../../stamp-gnatlib1.
+ (../stamp-gnatlib1): Don't unconditionally remove the rts directory,
+ create it if one does not exist.
+ (gnatlib): Remove superflous leading blank char at *-*-pe line.
+ * a-init.c: Define NULL if not yet defined.
+
+Index: Make-lang.in
+===================================================================
+RCS file: /cvsroot/gg/egcs/gcc/ada/Make-lang.in,v
+retrieving revision 1.1.1.1
+retrieving revision 1.3
+diff -c -r1.1.1.1 -r1.3
+*** Make-lang.in 1997/10/17 06:19:09 1.1.1.1
+--- Make-lang.in 1998/03/17 14:26:14 1.3
+***************
+*** 100,106 ****
+
+ # use host-gcc
+ # getopt*.o has to be built before CC=../xgcc
+! gnattools: getopt.o getopt1.o force
+ $(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)\
+ CC="../xgcc -B../" GNATBIND="../gnatbind" \
+ gnatf gnatlink gnatkr gnatmake gnatcmd gnatprep \
+--- 100,107 ----
+
+ # use host-gcc
+ # getopt*.o has to be built before CC=../xgcc
+! # GCC_PARTS has to be built before CC=../xgcc
+! gnattools: getopt.o getopt1.o $(GCC_PARTS) force
+ $(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)\
+ CC="../xgcc -B../" GNATBIND="../gnatbind" \
+ gnatf gnatlink gnatkr gnatmake gnatcmd gnatprep \
+***************
+*** 163,170 ****
+ -if [ -f gnatls$(exeext) ] ; then\
+ mv gnatls$(exeext) gnatls-cross$(exeext); fi
+
+! ada.start.encap:
+! ada.rest.encap:
+ ada.info:
+ ada.dvi:
+
+--- 164,171 ----
+ -if [ -f gnatls$(exeext) ] ; then\
+ mv gnatls$(exeext) gnatls-cross$(exeext); fi
+
+! ada.start.encap: gnattools
+! ada.rest.encap: gnatlib
+ ada.info:
+ ada.dvi:
+
+Index: Makefile.in
+===================================================================
+RCS file: /cvsroot/gg/egcs/gcc/ada/Makefile.in,v
+retrieving revision 1.1.1.1
+retrieving revision 1.5
+diff -c -r1.1.1.1 -r1.5
+*** Makefile.in 1997/10/17 06:19:09 1.1.1.1
+--- Makefile.in 1998/02/19 14:16:34 1.5
+***************
+*** 798,806 ****
+ # 3. copy 3xyyy.ad[sb] -->-- i-yyy.ad[sb]
+
+ ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
+! rm -rf rts
+! mkdir rts
+! chmod u+w rts
+ (\
+ case $(target) in \
+ sparc-sun-sunos4*) letter=u ;;\
+--- 800,806 ----
+ # 3. copy 3xyyy.ad[sb] -->-- i-yyy.ad[sb]
+
+ ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
+! if [ -d rts ]; then true; else mkdir rts; chmod u+w rts; fi
+ (\
+ case $(target) in \
+ sparc-sun-sunos4*) letter=u ;;\
+***************
+*** 888,894 ****
+ done;; \
+ esac ; \
+ rm -f ../stamp-gnatlib ; \
+! touch ../stamp-gnatlib1)
+
+ gnatlib-common: ../stamp-gnatlib1
+ (subdir=`cd $(srcdir); pwd`; \
+--- 888,894 ----
+ done;; \
+ esac ; \
+ rm -f ../stamp-gnatlib ; \
+! touch ../../stamp-gnatlib1)
+
+ gnatlib-common: ../stamp-gnatlib1
+ (subdir=`cd $(srcdir); pwd`; \
+***************
+*** 923,929 ****
+ mips-sni-* |\
+ *-*-cygwin32* |\
+ *-*-mingw32* |\
+! *-*-pe |\
+ *) \
+ \
+ $(MAKE) CC="../../xgcc -B../../" \
+--- 923,929 ----
+ mips-sni-* |\
+ *-*-cygwin32* |\
+ *-*-mingw32* |\
+! *-*-pe |\
+ *) \
+ \
+ $(MAKE) CC="../../xgcc -B../../" \
+Index: a-init.c
+===================================================================
+RCS file: /cvsroot/gg/egcs/gcc/ada/a-init.c,v
+retrieving revision 1.1.1.1
+retrieving revision 1.2
+diff -c -r1.1.1.1 -r1.2
+*** a-init.c 1997/10/17 06:19:10 1.1.1.1
+--- a-init.c 1998/01/04 23:11:42 1.2
+***************
+*** 516,521 ****
+--- 516,525 ----
+ __gnat_raise (exception);
+ }
+
++ #ifndef NULL
++ #define NULL 0
++ #endif
++
+ static void
+ __gnat_install_handler ()
+ {
+
+Wed Jun 24 15:06:09 1998 Dave Brolley <brolley@cygnus.com>
+
+ * a-misc.c (lang_decode_option): New interface.
+ * a-misc.h (lang_decode_option): New interface.
+
+*** /home/brolley/tmp/a-misc.c Wed Jun 24 15:01:22 1998
+--- ada/a-misc.c Wed Jun 24 15:02:42 1998
+*************** init_gnat_args ()
+*** 162,170 ****
+ it returns 0. */
+
+ int
+! lang_decode_option (p)
+! char *p;
+ {
+ extern int save_argc;
+ extern char **save_argv;
+
+--- 162,172 ----
+ it returns 0. */
+
+ int
+! lang_decode_option (argc, argv)
+! int argc;
+! char **argv;
+ {
++ char *p = argv[0];
+ extern int save_argc;
+ extern char **save_argv;
+
+*** /home/brolley/tmp/a-misc.h Wed Jun 24 15:01:22 1998
+--- ada/a-misc.h Wed Jun 24 15:03:20 1998
+*************** enum gnat_tree_code {
+*** 63,69 ****
+ 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. */
+! extern int lang_decode_option PROTO((char *));
+
+ /* Perform all the initialization steps that are language-specific. */
+ extern void lang_init PROTO((void));
+--- 63,69 ----
+ 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. */
+! extern int lang_decode_option PROTO((int, char **));
+
+ /* Perform all the initialization steps that are language-specific. */
+ extern void lang_init PROTO((void));
diff --git a/gcc/acconfig.h b/gcc/acconfig.h
index ea5dc51034b..04875706983 100644
--- a/gcc/acconfig.h
+++ b/gcc/acconfig.h
@@ -1,9 +1,29 @@
-/* Define to "%p" if printf supports it, else machmode.h will define it. */
-#undef HOST_PTR_PRINTF
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p". */
+#undef HAVE_PRINTF_PTR
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
/* Define if your cpp understands the stringify operator. */
#undef HAVE_CPP_STRINGIFY
+/* Define if your compiler understands volatile. */
+#undef HAVE_VOLATILE
+
+/* Define if your assembler supports specifying the maximum number
+ of bytes to skip when using the GAS .p2align command. */
+#undef HAVE_GAS_MAX_SKIP_P2ALIGN
+
+/* Define if your assembler supports .balign and .p2align. */
+#undef HAVE_GAS_BALIGN_AND_P2ALIGN
+
+/* Define if your assembler supports .subsection and .subsection -1 starts
+ emitting at the beginning of your section */
+#undef HAVE_GAS_SUBSECTION_ORDERING
+
/* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -45,4 +65,32 @@
/* Whether abort must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ABORT
+
+/* Whether strerror must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether strsignal must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRSIGNAL
+
+/* Whether getcwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETWD
+
+/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_GETRLIMIT
+
+/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_SETRLIMIT
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
+
+/* Define to enable the use of a default assembler. */
+#undef DEFAULT_ASSEMBLER
+
+/* Define to enable the use of a default linker. */
+#undef DEFAULT_LINKER
+
@TOP@
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 007fb5eb5f6..ce44ba19eb9 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -1,15 +1,32 @@
+dnl See whether we can include both string.h and strings.h.
+AC_DEFUN(GCC_HEADER_STRING,
+[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
+ gcc_cv_header_string,
+[AC_TRY_COMPILE([#include <string.h>
+#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
+if test $gcc_cv_header_string = yes; then
+ AC_DEFINE(STRING_WITH_STRINGS)
+fi
+])
+
dnl See whether we need a declaration for a function.
+dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+# endif
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -22,7 +39,8 @@ AC_CACHE_VAL(gcc_cv_decl_needed_$1,
#endif
#ifndef HAVE_INDEX
#define index strchr
-#endif],
+#endif
+$2],
[char *(*pfn) = (char *(*)) $1],
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
@@ -35,10 +53,11 @@ fi
])dnl
dnl Check multiple functions to see whether each needs a declaration.
+dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATIONS,
[for ac_func in $1
do
-GCC_NEED_DECLARATION($ac_func)
+GCC_NEED_DECLARATION($ac_func, $2)
done
])
@@ -75,7 +94,7 @@ main()
gcc_cv_func_printf_ptr=no)
rm -f core core.* *.core])
if test $gcc_cv_func_printf_ptr = yes ; then
- AC_DEFINE(HOST_PTR_PRINTF, "%p")
+ AC_DEFINE(HAVE_PRINTF_PTR)
fi
])
@@ -143,6 +162,16 @@ fi
AC_SUBST(LN)dnl
])
+dnl See whether the stage1 host compiler accepts the volatile keyword.
+AC_DEFUN(GCC_C_VOLATILE,
+[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
+[AC_TRY_COMPILE(, [volatile int foo;],
+ gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
+if test $gcc_cv_c_volatile = yes ; then
+ AC_DEFINE(HAVE_VOLATILE)
+fi
+])
+
AC_DEFUN(EGCS_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Find a good install program. We prefer a C program (faster),
diff --git a/gcc/alias.c b/gcc/alias.c
index 148b4527345..7c6c75f1975 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
#include "regs.h"
#include "hard-reg-set.h"
#include "flags.h"
+#include "output.h"
+#include "toplev.h"
static rtx canon_rtx PROTO((rtx));
static int rtx_equal_for_memref_p PROTO((rtx, rtx));
@@ -35,12 +37,37 @@ static int memrefs_conflict_p PROTO((int, rtx, int, rtx,
static void record_set PROTO((rtx, rtx));
static rtx find_base_term PROTO((rtx));
static int base_alias_check PROTO((rtx, rtx));
-static int mode_alias_check PROTO((rtx, rtx, int (*)(rtx)));
+static rtx find_base_value PROTO((rtx));
/* Set up all info needed to perform alias analysis on memory references. */
#define SIZE_FOR_MODE(X) (GET_MODE_SIZE (GET_MODE (X)))
+/* Perform a basic sanity check. Namely, that there are
+ no alias sets if we're not doing strict aliasing. This helps
+ to catch bugs whereby someone uses PUT_CODE, but doesn't clear
+ MEM_ALIAS_SET, or where a MEM is allocated in some way other
+ than by the use of gen_rtx_MEM, and the MEM_ALIAS_SET is not
+ cleared. */
+#ifdef ENABLE_CHECKING
+#define CHECK_ALIAS_SETS_FOR_CONSISTENCY(MEM1, MEM2) \
+ (!flag_strict_aliasing \
+ && (MEM_ALIAS_SET (MEM1) || MEM_ALIAS_SET (MEM2)) \
+ ? (abort (), 0) : 0)
+#else
+#define CHECK_ALIAS_SETS_FOR_CONSISTENCY(MEM1, MEM2) ((void)0)
+#endif
+
+/* Returns nonzero if MEM1 and MEM2 do not alias because they are in
+ different alias sets. We ignore alias sets in functions making use
+ of variable arguments because the va_arg macros on some systems are
+ not legal ANSI C. */
+#define DIFFERENT_ALIAS_SETS_P(MEM1, MEM2) \
+ (CHECK_ALIAS_SETS_FOR_CONSISTENCY(MEM1, MEM2), \
+ MEM_ALIAS_SET (MEM1) && MEM_ALIAS_SET (MEM2) \
+ && MEM_ALIAS_SET (MEM1) != MEM_ALIAS_SET (MEM2) \
+ && !current_function_stdarg && !current_function_varargs)
+
/* Cap the number of passes we make over the insns propagating alias
information through set chains.
@@ -130,6 +157,7 @@ find_base_value (src)
The test above is not sufficient because the scheduler may move
a copy out of an arg reg past the NOTE_INSN_FUNCTION_BEGIN. */
if (REGNO (src) >= FIRST_PSEUDO_REGISTER
+ && REGNO (src) < reg_base_value_size
&& reg_base_value[REGNO (src)])
return reg_base_value[REGNO (src)];
@@ -370,6 +398,7 @@ canon_rtx (x)
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (x);
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (x);
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (x);
+ MEM_ALIAS_SET (new) = MEM_ALIAS_SET (x);
x = new;
}
}
@@ -468,6 +497,10 @@ rtx_equal_for_memref_p (x, y)
return 0;
break;
+ /* This can happen for an asm which clobbers memory. */
+ case '0':
+ break;
+
/* It is believed that rtx's at this level will never
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
@@ -642,11 +675,7 @@ base_alias_check (x, y)
align memory references, as is done on the Alpha.
Nice to notice that varying addresses cannot conflict with fp if no
- local variables had their addresses taken, but that's too hard now.
-
- TODO: (symbol_ref foo) can not alias (plus REG N) if N is a positive
- integer because REG would have to point outside of the object, which
- is not allowed in C or C++. */
+ local variables had their addresses taken, but that's too hard now. */
static int
@@ -701,11 +730,14 @@ memrefs_conflict_p (xsize, x, ysize, y, c)
if (rtx_equal_for_memref_p (x0, y0))
return memrefs_conflict_p (xsize, x1, ysize, y1, c);
if (GET_CODE (x1) == CONST_INT)
- if (GET_CODE (y1) == CONST_INT)
- return memrefs_conflict_p (xsize, x0, ysize, y0,
- c - INTVAL (x1) + INTVAL (y1));
- else
- return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1));
+ {
+ if (GET_CODE (y1) == CONST_INT)
+ return memrefs_conflict_p (xsize, x0, ysize, y0,
+ c - INTVAL (x1) + INTVAL (y1));
+ else
+ return memrefs_conflict_p (xsize, x0, ysize, y,
+ c - INTVAL (x1));
+ }
else if (GET_CODE (y1) == CONST_INT)
return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1));
@@ -847,70 +879,6 @@ memrefs_conflict_p (xsize, x, ysize, y, c)
generate aligned addresses from unaligned addresses, for instance, the
alpha storeqi_unaligned pattern. */
-
-/* This subroutine implements the type and struct/varying part of the
- alias check.
-
- Return 0 if the memory references can never alias.
- Return 1 if the values of the addresses should be checked. */
-
-static int
-mode_alias_check (x, y, varies)
- register rtx x, y;
- int (*varies) PROTO ((rtx));
-{
-#if 1
- /* gcc rules: all type aliasing allowed */
- return 1;
-#else
- /* ANSI C rules: different types do not alias. */
- enum machine_mode x_mode = GET_MODE (x), y_mode = GET_MODE (y);
- rtx x_addr = XEXP (x, 0), y_addr = XEXP (y, 0);
- int x_varies, y_varies, x_struct, y_struct;
-
- /* If either address is an AND then neither the mode check nor the
- struct/varying check is valid. */
- if (GET_CODE (x_addr) == AND || GET_CODE (y_addr) == AND)
- return 1;
-
- x_struct = MEM_IN_STRUCT_P (x);
- y_struct = MEM_IN_STRUCT_P (y);
-
- /* QImode and BLKmode references can alias anything. */
- if (x_mode == QImode || x_mode == BLKmode
- || y_mode == QImode || y_mode == BLKmode)
- return 1;
-
- /* Otherwise, different modes can only alias if they are structure
- references. gcc bitfield operations can access an entire word,
- but that word may also contain integers accessed directly.
-
- ??? It appears that bitfield accesses can not be larger than
- word_mode?
- ??? Can complex modes alias their components? */
- if (x_mode != y_mode && ! (x_struct && y_struct))
- return 0;
-
- /* Modes are the same or may alias. */
-
- /* No alias if one reference is a struct at a varying address and the
- other is a scalar at a fixed address.
-
- If either reference is a varying scalar or a fixed struct nothing
- is known about aliasing. */
- x_varies = varies (x_addr);
- if (x_struct != x_varies)
- return 1;
- y_varies = varies (y_addr);
- if (y_struct != y_varies)
- return 1;
-
- /* Both are varying structs or fixed scalars. Check that they are not
- the same type. */
- return (x_struct == y_struct);
-#endif
-}
-
/* Read dependence: X is read after read in MEM takes place. There can
only be a dependence here if both reads are volatile. */
@@ -929,13 +897,16 @@ true_dependence (mem, mem_mode, x, varies)
rtx mem;
enum machine_mode mem_mode;
rtx x;
- int (*varies)();
+ int (*varies) PROTO((rtx));
{
register rtx x_addr, mem_addr;
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
+ if (DIFFERENT_ALIAS_SETS_P (x, mem))
+ return 0;
+
/* If X is an unchanging read, then it can't possibly conflict with any
non-unchanging store. It may conflict with an unchanging write though,
because there may be a single store to this address to initialize it.
@@ -949,17 +920,40 @@ true_dependence (mem, mem_mode, x, varies)
if (! base_alias_check (XEXP (x, 0), XEXP (mem, 0)))
return 0;
- if (! mode_alias_check (x, mem, varies))
- return 0;
-
x_addr = canon_rtx (XEXP (x, 0));
mem_addr = canon_rtx (XEXP (mem, 0));
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
- return memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
- SIZE_FOR_MODE (x), x_addr, 0);
+ if (! memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
+ SIZE_FOR_MODE (x), x_addr, 0))
+ return 0;
+
+ /* If both references are struct references, or both are not, nothing
+ is known about aliasing.
+
+ If either reference is QImode or BLKmode, ANSI C permits aliasing.
+
+ If both addresses are constant, or both are not, nothing is known
+ about aliasing. */
+ if (MEM_IN_STRUCT_P (x) == MEM_IN_STRUCT_P (mem)
+ || mem_mode == QImode || mem_mode == BLKmode
+ || GET_MODE (x) == QImode || GET_MODE (x) == BLKmode
+ || GET_CODE (x_addr) == AND || GET_CODE (mem_addr) == AND
+ || varies (x_addr) == varies (mem_addr))
+ return 1;
+
+ /* One memory reference is to a constant address, one is not.
+ One is to a structure, the other is not.
+
+ If either memory reference is a variable structure the other is a
+ fixed scalar and there is no aliasing. */
+ if ((MEM_IN_STRUCT_P (mem) && varies (mem_addr))
+ || (MEM_IN_STRUCT_P (x) && varies (x_addr)))
+ return 0;
+
+ return 1;
}
/* Anti dependence: X is written after read in MEM takes place. */
@@ -986,14 +980,22 @@ anti_dependence (mem, x)
x = canon_rtx (x);
mem = canon_rtx (mem);
+ if (DIFFERENT_ALIAS_SETS_P (x, mem))
+ return 0;
+
x_addr = XEXP (x, 0);
mem_addr = XEXP (mem, 0);
- if (! mode_alias_check (x, mem, rtx_varies_p))
- return 0;
-
- return memrefs_conflict_p (SIZE_FOR_MODE (mem), mem_addr,
- SIZE_FOR_MODE (x), x_addr, 0);
+ return (memrefs_conflict_p (SIZE_FOR_MODE (mem), mem_addr,
+ SIZE_FOR_MODE (x), x_addr, 0)
+ && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
+ && GET_MODE (mem) != QImode
+ && GET_CODE (mem_addr) != AND
+ && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x))
+ && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x)
+ && GET_MODE (x) != QImode
+ && GET_CODE (x_addr) != AND
+ && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)));
}
/* Output dependence: X is written after store in MEM takes place. */
@@ -1012,11 +1014,19 @@ output_dependence (mem, x)
x = canon_rtx (x);
mem = canon_rtx (mem);
- if (! mode_alias_check (x, mem, rtx_varies_p))
+ if (DIFFERENT_ALIAS_SETS_P (x, mem))
return 0;
- return memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0),
- SIZE_FOR_MODE (x), XEXP (x, 0), 0);
+ return (memrefs_conflict_p (SIZE_FOR_MODE (mem), XEXP (mem, 0),
+ SIZE_FOR_MODE (x), XEXP (x, 0), 0)
+ && ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
+ && GET_MODE (mem) != QImode
+ && GET_CODE (XEXP (mem, 0)) != AND
+ && ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x))
+ && ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x)
+ && GET_MODE (x) != QImode
+ && GET_CODE (XEXP (x, 0)) != AND
+ && ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)));
}
diff --git a/gcc/alloca.c b/gcc/alloca.c
deleted file mode 100644
index 8f98b73dbb9..00000000000
--- a/gcc/alloca.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/* alloca.c -- allocate automatically reclaimed memory
- (Mostly) portable public-domain implementation -- D A Gwyn
-
- This implementation of the PWB library alloca function,
- which is used to allocate space off the run-time stack so
- that it is automatically reclaimed upon procedure exit,
- was inspired by discussions with J. Q. Johnson of Cornell.
- J.Otto Tennant <jot@cray.com> contributed the Cray support.
-
- There are some preprocessor constants that can
- be defined when compiling for your specific system, for
- improved efficiency; however, the defaults should be okay.
-
- The general concept of this implementation is to keep
- track of all alloca-allocated blocks, and reclaim any
- that are found to be deeper in the stack than the current
- invocation. This heuristic does not reclaim storage as
- soon as it becomes invalid, but it will do so eventually.
-
- As a special case, alloca(0) reclaims storage without
- allocating any. It is a good idea to use alloca(0) in
- your main control loop, etc. to force garbage collection. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef emacs
-#include "blockinput.h"
-#endif
-
-/* If compiling with GCC 2, this file's not needed. */
-#if !defined (__GNUC__) || __GNUC__ < 2
-
-/* If someone has defined alloca as a macro,
- there must be some other way alloca is supposed to work. */
-#ifndef alloca
-
-#ifdef emacs
-#ifdef static
-/* actually, only want this if static is defined as ""
- -- this is for usg, in which emacs must undefine static
- in order to make unexec workable
- */
-#ifndef STACK_DIRECTION
-you
-lose
--- must know STACK_DIRECTION at compile-time
-#endif /* STACK_DIRECTION undefined */
-#endif /* static */
-#endif /* emacs */
-
-/* If your stack is a linked list of frames, you have to
- provide an "address metric" ADDRESS_FUNCTION macro. */
-
-#if defined (CRAY) && defined (CRAY_STACKSEG_END)
-long i00afunc ();
-#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
-#else
-#define ADDRESS_FUNCTION(arg) &(arg)
-#endif
-
-#if __STDC__
-typedef void *pointer;
-#else
-typedef char *pointer;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-/* Different portions of Emacs need to call different versions of
- malloc. The Emacs executable needs alloca to call xmalloc, because
- ordinary malloc isn't protected from input signals. On the other
- hand, the utilities in lib-src need alloca to call malloc; some of
- them are very simple, and don't have an xmalloc routine.
-
- Non-Emacs programs expect this to call use xmalloc.
-
- Callers below should use malloc. */
-
-#ifndef emacs
-#define malloc xmalloc
-#endif
-extern pointer malloc ();
-
-/* Define STACK_DIRECTION if you know the direction of stack
- growth for your system; otherwise it will be automatically
- deduced at run-time.
-
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-
-#ifndef STACK_DIRECTION
-#define STACK_DIRECTION 0 /* Direction unknown. */
-#endif
-
-#if STACK_DIRECTION != 0
-
-#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
-
-#else /* STACK_DIRECTION == 0; need run-time code. */
-
-static int stack_dir; /* 1 or -1 once known. */
-#define STACK_DIR stack_dir
-
-static void
-find_stack_direction ()
-{
- static char *addr = NULL; /* Address of first `dummy', once known. */
- auto char dummy; /* To get stack address. */
-
- if (addr == NULL)
- { /* Initial entry. */
- addr = ADDRESS_FUNCTION (dummy);
-
- find_stack_direction (); /* Recurse once. */
- }
- else
- {
- /* Second entry. */
- if (ADDRESS_FUNCTION (dummy) > addr)
- stack_dir = 1; /* Stack grew upward. */
- else
- stack_dir = -1; /* Stack grew downward. */
- }
-}
-
-#endif /* STACK_DIRECTION == 0 */
-
-/* An "alloca header" is used to:
- (a) chain together all alloca'ed blocks;
- (b) keep track of stack depth.
-
- It is very important that sizeof(header) agree with malloc
- alignment chunk size. The following default should work okay. */
-
-#ifndef ALIGN_SIZE
-#define ALIGN_SIZE sizeof(double)
-#endif
-
-typedef union hdr
-{
- char align[ALIGN_SIZE]; /* To force sizeof(header). */
- struct
- {
- union hdr *next; /* For chaining headers. */
- char *deep; /* For stack depth measure. */
- } h;
-} header;
-
-static header *last_alloca_header = NULL; /* -> last alloca header. */
-
-/* Return a pointer to at least SIZE bytes of storage,
- which will be automatically reclaimed upon exit from
- the procedure that called alloca. Originally, this space
- was supposed to be taken from the current stack frame of the
- caller, but that method cannot be made to work for some
- implementations of C, for example under Gould's UTX/32. */
-
-pointer
-alloca (size)
- unsigned size;
-{
- auto char probe; /* Probes stack depth: */
- register char *depth = ADDRESS_FUNCTION (probe);
-
-#if STACK_DIRECTION == 0
- if (STACK_DIR == 0) /* Unknown growth direction. */
- find_stack_direction ();
-#endif
-
- /* Reclaim garbage, defined as all alloca'd storage that
- was allocated from deeper in the stack than currently. */
-
- {
- register header *hp; /* Traverses linked list. */
-
-#ifdef emacs
- BLOCK_INPUT;
-#endif
-
- for (hp = last_alloca_header; hp != NULL;)
- if ((STACK_DIR > 0 && hp->h.deep > depth)
- || (STACK_DIR < 0 && hp->h.deep < depth))
- {
- register header *np = hp->h.next;
-
- free ((pointer) hp); /* Collect garbage. */
-
- hp = np; /* -> next header. */
- }
- else
- break; /* Rest are not deeper. */
-
- last_alloca_header = hp; /* -> last valid storage. */
-
-#ifdef emacs
- UNBLOCK_INPUT;
-#endif
- }
-
- if (size == 0)
- return NULL; /* No allocation required. */
-
- /* Allocate combined header + user data storage. */
-
- {
- register pointer new = malloc (sizeof (header) + size);
- /* Address of header. */
-
- if (new == 0)
- abort();
-
- ((header *) new)->h.next = last_alloca_header;
- ((header *) new)->h.deep = depth;
-
- last_alloca_header = (header *) new;
-
- /* User storage begins just after header. */
-
- return (pointer) ((char *) new + sizeof (header));
- }
-}
-
-#if defined (CRAY) && defined (CRAY_STACKSEG_END)
-
-#ifdef DEBUG_I00AFUNC
-#include <stdio.h>
-#endif
-
-#ifndef CRAY_STACK
-#define CRAY_STACK
-#ifndef CRAY2
-/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
-struct stack_control_header
- {
- long shgrow:32; /* Number of times stack has grown. */
- long shaseg:32; /* Size of increments to stack. */
- long shhwm:32; /* High water mark of stack. */
- long shsize:32; /* Current size of stack (all segments). */
- };
-
-/* The stack segment linkage control information occurs at
- the high-address end of a stack segment. (The stack
- grows from low addresses to high addresses.) The initial
- part of the stack segment linkage control information is
- 0200 (octal) words. This provides for register storage
- for the routine which overflows the stack. */
-
-struct stack_segment_linkage
- {
- long ss[0200]; /* 0200 overflow words. */
- long sssize:32; /* Number of words in this segment. */
- long ssbase:32; /* Offset to stack base. */
- long:32;
- long sspseg:32; /* Offset to linkage control of previous
- segment of stack. */
- long:32;
- long sstcpt:32; /* Pointer to task common address block. */
- long sscsnm; /* Private control structure number for
- microtasking. */
- long ssusr1; /* Reserved for user. */
- long ssusr2; /* Reserved for user. */
- long sstpid; /* Process ID for pid based multi-tasking. */
- long ssgvup; /* Pointer to multitasking thread giveup. */
- long sscray[7]; /* Reserved for Cray Research. */
- long ssa0;
- long ssa1;
- long ssa2;
- long ssa3;
- long ssa4;
- long ssa5;
- long ssa6;
- long ssa7;
- long sss0;
- long sss1;
- long sss2;
- long sss3;
- long sss4;
- long sss5;
- long sss6;
- long sss7;
- };
-
-#else /* CRAY2 */
-/* The following structure defines the vector of words
- returned by the STKSTAT library routine. */
-struct stk_stat
- {
- long now; /* Current total stack size. */
- long maxc; /* Amount of contiguous space which would
- be required to satisfy the maximum
- stack demand to date. */
- long high_water; /* Stack high-water mark. */
- long overflows; /* Number of stack overflow ($STKOFEN) calls. */
- long hits; /* Number of internal buffer hits. */
- long extends; /* Number of block extensions. */
- long stko_mallocs; /* Block allocations by $STKOFEN. */
- long underflows; /* Number of stack underflow calls ($STKRETN). */
- long stko_free; /* Number of deallocations by $STKRETN. */
- long stkm_free; /* Number of deallocations by $STKMRET. */
- long segments; /* Current number of stack segments. */
- long maxs; /* Maximum number of stack segments so far. */
- long pad_size; /* Stack pad size. */
- long current_address; /* Current stack segment address. */
- long current_size; /* Current stack segment size. This
- number is actually corrupted by STKSTAT to
- include the fifteen word trailer area. */
- long initial_address; /* Address of initial segment. */
- long initial_size; /* Size of initial segment. */
- };
-
-/* The following structure describes the data structure which trails
- any stack segment. I think that the description in 'asdef' is
- out of date. I only describe the parts that I am sure about. */
-
-struct stk_trailer
- {
- long this_address; /* Address of this block. */
- long this_size; /* Size of this block (does not include
- this trailer). */
- long unknown2;
- long unknown3;
- long link; /* Address of trailer block of previous
- segment. */
- long unknown5;
- long unknown6;
- long unknown7;
- long unknown8;
- long unknown9;
- long unknown10;
- long unknown11;
- long unknown12;
- long unknown13;
- long unknown14;
- };
-
-#endif /* CRAY2 */
-#endif /* not CRAY_STACK */
-
-#ifdef CRAY2
-/* Determine a "stack measure" for an arbitrary ADDRESS.
- I doubt that "lint" will like this much. */
-
-static long
-i00afunc (long *address)
-{
- struct stk_stat status;
- struct stk_trailer *trailer;
- long *block, size;
- long result = 0;
-
- /* We want to iterate through all of the segments. The first
- step is to get the stack status structure. We could do this
- more quickly and more directly, perhaps, by referencing the
- $LM00 common block, but I know that this works. */
-
- STKSTAT (&status);
-
- /* Set up the iteration. */
-
- trailer = (struct stk_trailer *) (status.current_address
- + status.current_size
- - 15);
-
- /* There must be at least one stack segment. Therefore it is
- a fatal error if "trailer" is null. */
-
- if (trailer == 0)
- abort ();
-
- /* Discard segments that do not contain our argument address. */
-
- while (trailer != 0)
- {
- block = (long *) trailer->this_address;
- size = trailer->this_size;
- if (block == 0 || size == 0)
- abort ();
- trailer = (struct stk_trailer *) trailer->link;
- if ((block <= address) && (address < (block + size)))
- break;
- }
-
- /* Set the result to the offset in this segment and add the sizes
- of all predecessor segments. */
-
- result = address - block;
-
- if (trailer == 0)
- {
- return result;
- }
-
- do
- {
- if (trailer->this_size <= 0)
- abort ();
- result += trailer->this_size;
- trailer = (struct stk_trailer *) trailer->link;
- }
- while (trailer != 0);
-
- /* We are done. Note that if you present a bogus address (one
- not in any segment), you will get a different number back, formed
- from subtracting the address of the first block. This is probably
- not what you want. */
-
- return (result);
-}
-
-#else /* not CRAY2 */
-/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
- Determine the number of the cell within the stack,
- given the address of the cell. The purpose of this
- routine is to linearize, in some sense, stack addresses
- for alloca. */
-
-static long
-i00afunc (long address)
-{
- long stkl = 0;
-
- long size, pseg, this_segment, stack;
- long result = 0;
-
- struct stack_segment_linkage *ssptr;
-
- /* Register B67 contains the address of the end of the
- current stack segment. If you (as a subprogram) store
- your registers on the stack and find that you are past
- the contents of B67, you have overflowed the segment.
-
- B67 also points to the stack segment linkage control
- area, which is what we are really interested in. */
-
- stkl = CRAY_STACKSEG_END ();
- ssptr = (struct stack_segment_linkage *) stkl;
-
- /* If one subtracts 'size' from the end of the segment,
- one has the address of the first word of the segment.
-
- If this is not the first segment, 'pseg' will be
- nonzero. */
-
- pseg = ssptr->sspseg;
- size = ssptr->sssize;
-
- this_segment = stkl - size;
-
- /* It is possible that calling this routine itself caused
- a stack overflow. Discard stack segments which do not
- contain the target address. */
-
- while (!(this_segment <= address && address <= stkl))
- {
-#ifdef DEBUG_I00AFUNC
- fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
-#endif
- if (pseg == 0)
- break;
- stkl = stkl - pseg;
- ssptr = (struct stack_segment_linkage *) stkl;
- size = ssptr->sssize;
- pseg = ssptr->sspseg;
- this_segment = stkl - size;
- }
-
- result = address - this_segment;
-
- /* If you subtract pseg from the current end of the stack,
- you get the address of the previous stack segment's end.
- This seems a little convoluted to me, but I'll bet you save
- a cycle somewhere. */
-
- while (pseg != 0)
- {
-#ifdef DEBUG_I00AFUNC
- fprintf (stderr, "%011o %011o\n", pseg, size);
-#endif
- stkl = stkl - pseg;
- ssptr = (struct stack_segment_linkage *) stkl;
- size = ssptr->sssize;
- pseg = ssptr->sspseg;
- result += size;
- }
- return (result);
-}
-
-#endif /* not CRAY2 */
-#endif /* CRAY */
-
-#endif /* no alloca */
-#endif /* not GCC version 2 */
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 45789a3f967..552f74a5d9f 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -1,5 +1,5 @@
/* Define control and data flow tables, and regsets.
- Copyright (C) 1987, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -132,7 +132,7 @@ extern regset regs_live_at_setjmp;
#define REG_BLOCK_UNKNOWN -1
#define REG_BLOCK_GLOBAL -2
-#define REG_BASIC_BLOCK(N) (reg_n_info[(N)].basic_block)
+#define REG_BASIC_BLOCK(N) (VARRAY_REG (reg_n_info, N)->basic_block)
/* List of integers.
These are used for storing things like predecessors, etc.
@@ -184,6 +184,7 @@ extern void free_int_list PROTO ((int_list_block **));
#define EXIT_BLOCK (-2)
/* from flow.c */
+extern void free_regset_vector PROTO ((regset *, int nelts));
extern int *uid_block_number;
#define BLOCK_NUM(INSN) uid_block_number[INSN_UID (INSN)]
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 2df648965f5..2941574e59c 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -97,6 +97,8 @@ extern bitmap bitmap_initialize PROTO((bitmap));
/* Release all memory held by bitmaps. */
extern void bitmap_release_memory PROTO((void));
+extern void debug_bitmap PROTO((bitmap));
+
/* Allocate a bitmap with oballoc. */
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \
bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)))
diff --git a/gcc/build-make b/gcc/build-make
index 116d579ba66..f9049ae0db9 100644
--- a/gcc/build-make
+++ b/gcc/build-make
@@ -28,8 +28,8 @@ FIXINCLUDES=Makefile.in
STMP_FIXPROTO =
# Cause installation using install-build. We do nothing here.
-INSTALL_TARGET = install-build
+#INSTALL_TARGET = install-build
# Don't try to compile the things we can't compile or we have made
# while making gcc with the cross-compiler.
-ALL = all.build
+#ALL = all.build
diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c
index 84ab0e90e38..3e2edde0449 100644
--- a/gcc/c-aux-info.c
+++ b/gcc/c-aux-info.c
@@ -27,8 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "c-tree.h"
-extern char *xmalloc ();
-
enum formals_style_enum {
ansi,
k_and_r_names,
diff --git a/gcc/c-common.c b/gcc/c-common.c
index ee23a70b3ff..bc6f8c007e4 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -26,6 +26,15 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "obstack.h"
#include "toplev.h"
+#include "output.h"
+#include "c-pragma.h"
+
+#if USE_CPPLIB
+#include "cpplib.h"
+cpp_reader parse_in;
+cpp_options parse_options;
+static enum cpp_token cpp_token;
+#endif
#ifndef WCHAR_TYPE_SIZE
#ifdef INT_TYPE_SIZE
@@ -42,8 +51,10 @@ extern struct obstack permanent_obstack;
int skip_evaluation;
enum attrs {A_PACKED, A_NOCOMMON, A_COMMON, A_NORETURN, A_CONST, A_T_UNION,
+ A_NO_INSTRUMENT_FUNCTION,
A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED,
- A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK, A_ALIAS};
+ A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK, A_ALIAS,
+ A_INIT_PRIORITY};
enum format_type { printf_format_type, scanf_format_type,
strftime_format_type };
@@ -80,6 +91,12 @@ static int if_stack_pointer = 0;
/* Generate RTL for the start of an if-then, and record the start of it
for ambiguous else detection. */
+/* A list of objects which have constructors or destructors which
+ reside in the global scope, and have an init_priority attribute
+ associated with them. The decl is stored in the TREE_VALUE slot
+ and the priority number is stored in the TREE_PURPOSE slot. */
+tree static_aggregates_initp;
+
void
c_expand_start_cond (cond, exitflag, compstmt_count)
tree cond;
@@ -249,7 +266,7 @@ combine_strings (strings)
? wchar_bytes : 1));
if ((TREE_TYPE (t) == wchar_array_type_node) == wide_flag)
{
- bcopy (TREE_STRING_POINTER (t), q, len);
+ memcpy (q, TREE_STRING_POINTER (t), len);
q += len;
}
else
@@ -286,7 +303,6 @@ combine_strings (strings)
value = make_node (STRING_CST);
TREE_STRING_POINTER (value) = p;
TREE_STRING_LENGTH (value) = length;
- TREE_CONSTANT (value) = 1;
}
else
{
@@ -301,8 +317,9 @@ combine_strings (strings)
/* Create the array type for the string constant.
-Wwrite-strings says make the string constant an array of const char
- so that copying it to a non-const pointer will get a warning. */
- if (warn_write_strings
+ so that copying it to a non-const pointer will get a warning.
+ For C++, this is the standard behavior. */
+ if (flag_const_strings
&& (! flag_traditional && ! flag_writable_strings))
{
tree elements
@@ -316,7 +333,8 @@ combine_strings (strings)
TREE_TYPE (value)
= build_array_type (wide_flag ? wchar_type_node : char_type_node,
build_index_type (build_int_2 (nchars - 1, 0)));
- TREE_CONSTANT (value) = 1;
+
+ TREE_READONLY (value) = TREE_CONSTANT (value) = ! flag_writable_strings;
TREE_STATIC (value) = 1;
return value;
}
@@ -378,6 +396,8 @@ init_attributes ()
add_attribute (A_FORMAT_ARG, "format_arg", 1, 1, 1);
add_attribute (A_WEAK, "weak", 0, 0, 1);
add_attribute (A_ALIAS, "alias", 1, 1, 1);
+ add_attribute (A_INIT_PRIORITY, "init_priority", 0, 1, 0);
+ add_attribute (A_NO_INSTRUMENT_FUNCTION, "no_instrument_function", 0, 0, 1);
}
/* Process the attributes listed in ATTRIBUTES and PREFIX_ATTRIBUTES
@@ -405,6 +425,18 @@ decl_attributes (node, attributes, prefix_attributes)
else if (TREE_CODE_CLASS (TREE_CODE (node)) == 't')
type = node, is_type = 1;
+#ifdef PRAGMA_INSERT_ATTRIBUTES
+ /* If the code in c-pragma.c wants to insert some attributes then
+ allow it to do so. Do this before allowing machine back ends to
+ insert attributes, so that they have the opportunity to override
+ anything done here. */
+ PRAGMA_INSERT_ATTRIBUTES (node, & attributes, & prefix_attributes);
+#endif
+
+#ifdef INSERT_ATTRIBUTES
+ INSERT_ATTRIBUTES (node, & attributes, & prefix_attributes);
+#endif
+
attributes = chainon (prefix_attributes, attributes);
for (a = attributes; a; a = TREE_CHAIN (a))
@@ -629,7 +661,7 @@ decl_attributes (node, attributes, prefix_attributes)
= (args ? TREE_VALUE (args)
: size_int (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
int align;
-
+
/* Strip any NOPs of any kind. */
while (TREE_CODE (align_expr) == NOP_EXPR
|| TREE_CODE (align_expr) == CONVERT_EXPR
@@ -841,8 +873,16 @@ decl_attributes (node, attributes, prefix_attributes)
"`%s' defined both normally and as an alias");
else if (decl_function_context (decl) == 0)
{
- tree id = get_identifier (TREE_STRING_POINTER
- (TREE_VALUE (args)));
+ tree id;
+
+ id = TREE_VALUE (args);
+ if (TREE_CODE (id) != STRING_CST)
+ {
+ error ("alias arg not a string");
+ break;
+ }
+ id = get_identifier (TREE_STRING_POINTER (id));
+
if (TREE_CODE (decl) == FUNCTION_DECL)
DECL_INITIAL (decl) = error_mark_node;
else
@@ -852,6 +892,79 @@ decl_attributes (node, attributes, prefix_attributes)
else
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
break;
+
+ case A_INIT_PRIORITY:
+ {
+ tree initp_expr = (args ? TREE_VALUE (args): NULL_TREE);
+ int pri;
+
+ if (initp_expr)
+ STRIP_NOPS (initp_expr);
+
+ if (!initp_expr || TREE_CODE (initp_expr) != INTEGER_CST)
+ {
+ error ("requested init_priority is not an integer constant");
+ continue;
+ }
+
+ pri = TREE_INT_CST_LOW (initp_expr);
+
+ if (is_type || TREE_CODE (decl) != VAR_DECL
+ || ! TREE_STATIC (decl)
+ || DECL_EXTERNAL (decl)
+ || (TREE_CODE (TREE_TYPE (decl)) != RECORD_TYPE
+ && TREE_CODE (TREE_TYPE (decl)) != UNION_TYPE)
+ /* Static objects in functions are initialized the
+ first time control passes through that
+ function. This is not precise enough to pin down an
+ init_priority value, so don't allow it. */
+ || current_function_decl)
+ {
+ error ("can only use init_priority attribute on file-scope definitions of objects of class type");
+ continue;
+ }
+
+ /* Check for init_priorities that are reserved for
+ implementation. Reserved for language and runtime
+ support implementations.*/
+ if ((10 <= pri && pri <= 99)
+ /* Reserved for standard library implementations. */
+ || (500 <= pri && pri <= 999)
+ /* Reserved for objects with no attributes. */
+ || pri > (MAX_INIT_PRIORITY - 50))
+ {
+ warning
+ ("requested init_priority is reserved for internal use");
+ continue;
+ }
+
+ if (pri > MAX_INIT_PRIORITY || pri <= 0)
+ {
+ error ("requested init_priority is out of range");
+ continue;
+ }
+
+ static_aggregates_initp
+ = perm_tree_cons (initp_expr, decl, static_aggregates_initp);
+ break;
+ }
+
+ case A_NO_INSTRUMENT_FUNCTION:
+ if (TREE_CODE (decl) != FUNCTION_DECL)
+ {
+ error_with_decl (decl,
+ "`%s' attribute applies only to functions",
+ IDENTIFIER_POINTER (name));
+ }
+ else if (DECL_INITIAL (decl))
+ {
+ error_with_decl (decl,
+ "can't set `%s' attribute after definition",
+ IDENTIFIER_POINTER (name));
+ }
+ else
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
+ break;
}
}
}
@@ -975,10 +1088,10 @@ typedef struct {
int pointer_count;
/* Type of argument if no length modifier is used. */
tree *nolen;
- /* Type of argument if length modifier for shortening is used.
+ /* Type of argument if length modifier for shortening to byte is used.
If NULL, then this modifier is not allowed. */
tree *hhlen;
- /* Type of argument if length modifier for shortening to byte if used.
+ /* Type of argument if length modifier for shortening is used.
If NULL, then this modifier is not allowed. */
tree *hlen;
/* Type of argument if length modifier `l' is used.
@@ -1236,17 +1349,16 @@ check_format_info (info, params)
int i;
int arg_num;
int suppressed, wide, precise;
- int length_char;
+ int length_char = 0;
int format_char;
int format_length;
- int integral_format;
tree format_tree;
tree cur_param;
tree cur_type;
tree wanted_type;
tree first_fillin_param;
char *format_chars;
- format_char_info *fci;
+ format_char_info *fci = NULL;
char flag_chars[8];
int has_operand_number = 0;
@@ -1553,6 +1665,13 @@ check_format_info (info, params)
if (pedantic)
warning ("ANSI C does not support the `ll' length modifier");
}
+ else if (length_char == 'h' && *format_chars == 'h')
+ {
+ length_char = 'H', format_chars++;
+ /* FIXME: Is allowed in ISO C 9x. */
+ if (pedantic)
+ warning ("ANSI C does not support the `hh' length modifier");
+ }
if (*format_chars == 'a' && info->format_type == scanf_format_type)
{
if (format_chars[1] == 's' || format_chars[1] == 'S'
@@ -1685,15 +1804,6 @@ check_format_info (info, params)
warning ("use of `%c' length character with `%c' type character",
length_char, format_char);
- /*
- ** XXX -- should kvetch about stuff such as
- ** {
- ** const int i;
- **
- ** scanf ("%d", &i);
- ** }
- */
-
/* Finally. . .check type of argument against desired type! */
if (info->first_arg_num == 0)
continue;
@@ -1736,8 +1846,10 @@ check_format_info (info, params)
}
/* See if this is an attempt to write into a const type with
- scanf. */
- if (info->format_type == scanf_format_type
+ scanf or with printf "%n". */
+ if ((info->format_type == scanf_format_type
+ || (info->format_type == printf_format_type
+ && format_char == 'n'))
&& i == fci->pointer_count + aflag
&& wanted_type != 0
&& TREE_CODE (cur_type) != ERROR_MARK
@@ -2667,16 +2779,118 @@ truthvalue_conversion (expr)
}
if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)
- return (build_binary_op
- ((TREE_SIDE_EFFECTS (expr)
- ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR),
- truthvalue_conversion (build_unary_op (REALPART_EXPR, expr, 0)),
- truthvalue_conversion (build_unary_op (IMAGPART_EXPR, expr, 0)),
- 0));
+ {
+ tree tem = save_expr (expr);
+ return (build_binary_op
+ ((TREE_SIDE_EFFECTS (expr)
+ ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR),
+ truthvalue_conversion (build_unary_op (REALPART_EXPR, tem, 0)),
+ truthvalue_conversion (build_unary_op (IMAGPART_EXPR, tem, 0)),
+ 0));
+ }
return build_binary_op (NE_EXPR, expr, integer_zero_node, 1);
}
+#if USE_CPPLIB
+/* Read the rest of a #-directive from input stream FINPUT.
+ In normal use, the directive name and the white space after it
+ have already been read, so they won't be included in the result.
+ We allow for the fact that the directive line may contain
+ a newline embedded within a character or string literal which forms
+ a part of the directive.
+
+ The value is a string in a reusable buffer. It remains valid
+ only until the next time this function is called. */
+unsigned char *yy_cur, *yy_lim;
+
+#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
+#define UNGETC(c) ((c), yy_cur--)
+
+int
+yy_get_token ()
+{
+ for (;;)
+ {
+ parse_in.limit = parse_in.token_buffer;
+ cpp_token = cpp_get_token (&parse_in);
+ if (cpp_token == CPP_EOF)
+ return -1;
+ yy_lim = CPP_PWRITTEN (&parse_in);
+ yy_cur = parse_in.token_buffer;
+ if (yy_cur < yy_lim)
+ return *yy_cur++;
+ }
+}
+
+char *
+get_directive_line ()
+{
+ static char *directive_buffer = NULL;
+ static unsigned buffer_length = 0;
+ register char *p;
+ register char *buffer_limit;
+ register int looking_for = 0;
+ register int char_escaped = 0;
+
+ if (buffer_length == 0)
+ {
+ directive_buffer = (char *)xmalloc (128);
+ buffer_length = 128;
+ }
+
+ buffer_limit = &directive_buffer[buffer_length];
+
+ for (p = directive_buffer; ; )
+ {
+ int c;
+
+ /* Make buffer bigger if it is full. */
+ if (p >= buffer_limit)
+ {
+ register unsigned bytes_used = (p - directive_buffer);
+
+ buffer_length *= 2;
+ directive_buffer
+ = (char *)xrealloc (directive_buffer, buffer_length);
+ p = &directive_buffer[bytes_used];
+ buffer_limit = &directive_buffer[buffer_length];
+ }
+
+ c = GETC ();
+
+ /* Discard initial whitespace. */
+ if ((c == ' ' || c == '\t') && p == directive_buffer)
+ continue;
+
+ /* Detect the end of the directive. */
+ if (c == '\n' && looking_for == 0)
+ {
+ UNGETC (c);
+ c = '\0';
+ }
+
+ *p++ = c;
+
+ if (c == 0)
+ return directive_buffer;
+
+ /* Handle string and character constant syntax. */
+ if (looking_for)
+ {
+ if (looking_for == c && !char_escaped)
+ looking_for = 0; /* Found terminator... stop looking. */
+ }
+ else
+ if (c == '\'' || c == '"')
+ looking_for = c; /* Don't stop buffering until we see another
+ another one of these (or an EOF). */
+
+ /* Handle backslash. */
+ char_escaped = (c == '\\' && ! char_escaped);
+ }
+}
+#else
/* Read the rest of a #-directive from input stream FINPUT.
In normal use, the directive name and the white space after it
have already been read, so they won't be included in the result.
@@ -2759,6 +2973,7 @@ get_directive_line (finput)
char_escaped = (c == '\\' && ! char_escaped);
}
}
+#endif /* !USE_CPPLIB */
/* Make a variant type in the proper way for C/C++, propagating qualifiers
down to the element type of an array. */
@@ -2774,3 +2989,95 @@ c_build_type_variant (type, constp, volatilep)
TYPE_DOMAIN (type));
return build_type_variant (type, constp, volatilep);
}
+
+/* Return the typed-based alias set for T, which may be an expression
+ or a type. */
+
+int
+c_get_alias_set (t)
+ tree t;
+{
+ tree type;
+
+ if (t == error_mark_node)
+ return 0;
+
+ type = (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ ? t : TREE_TYPE (t);
+
+ if (type == error_mark_node)
+ return 0;
+
+ /* Deal with special cases first; for certain kinds of references
+ we're interested in more than just the type. */
+
+ if (TREE_CODE (t) == BIT_FIELD_REF)
+ /* Perhaps reads and writes to this piece of data alias fields
+ neighboring the bitfield. Perhaps that's impossible. For now,
+ let's just assume that bitfields can alias everything, which is
+ the conservative assumption. */
+ return 0;
+
+ if (TREE_CODE (t) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == UNION_TYPE)
+ /* Permit type-punning when accessing a union, provided the
+ access is directly through the union. For example, this code does
+ not permit taking the address of a union member and then
+ storing through it. Even the type-punning allowed here is a
+ GCC extension, albeit a common and useful one; the C standard
+ says that such accesses have implementation-defined behavior. */
+ return 0;
+
+ /* From here on, only the type matters. */
+
+ if (TYPE_ALIAS_SET_KNOWN_P (type))
+ /* If we've already calculated the value, just return it. */
+ return TYPE_ALIAS_SET (type);
+ else if (TYPE_MAIN_VARIANT (type) != type)
+ /* The C standard specifically allows aliasing between
+ cv-qualified variants of types. */
+ TYPE_ALIAS_SET (type) = c_get_alias_set (TYPE_MAIN_VARIANT (type));
+ else if (TREE_CODE (type) == INTEGER_TYPE)
+ {
+ tree signed_variant;
+
+ /* The C standard specifically allows aliasing between signed and
+ unsigned variants of the same type. We treat the signed
+ variant as canonical. */
+ signed_variant = signed_type (type);
+
+ if (signed_variant != type)
+ TYPE_ALIAS_SET (type) = c_get_alias_set (signed_variant);
+ else if (signed_variant == signed_char_type_node)
+ /* The C standard guarantess that any object may be accessed
+ via an lvalue that has character type. We don't have to
+ check for unsigned_char_type_node or char_type_node because
+ we are specifically looking at the signed variant. */
+ TYPE_ALIAS_SET (type) = 0;
+ }
+ else if (TREE_CODE (type) == ARRAY_TYPE)
+ /* Anything that can alias one of the array elements can alias
+ the entire array as well. */
+ TYPE_ALIAS_SET (type) = c_get_alias_set (TREE_TYPE (type));
+ else if (TREE_CODE (type) == FUNCTION_TYPE)
+ /* There are no objects of FUNCTION_TYPE, so there's no point in
+ using up an alias set for them. (There are, of course,
+ pointers and references to functions, but that's
+ different.) */
+ TYPE_ALIAS_SET (type) = 0;
+ else if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE)
+ /* If TYPE is a struct or union type then we're reading or
+ writing an entire struct. Thus, we don't know anything about
+ aliasing. (In theory, such an access can only alias objects
+ whose type is the same as one of the fields, recursively, but
+ we don't yet make any use of that information.) */
+ TYPE_ALIAS_SET (type) = 0;
+
+ if (!TYPE_ALIAS_SET_KNOWN_P (type))
+ /* TYPE is something we haven't seen before. Put it in a new
+ alias set. */
+ TYPE_ALIAS_SET (type) = new_alias_set ();
+
+ return TYPE_ALIAS_SET (type);
+}
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 9b49d6aa30b..99052dcd5ed 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -36,6 +36,13 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "ggc.h"
+#if USE_CPPLIB
+#include "cpplib.h"
+extern cpp_reader parse_in;
+extern cpp_options parse_options;
+static int cpp_initialized;
+#endif
+
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
{ NORMAL, /* Ordinary declaration */
@@ -490,6 +497,10 @@ int flag_no_ident = 0;
int warn_implicit_int;
+/* Nonzero means warn about usage of long long when `-pedantic'. */
+
+int warn_long_long = 1;
+
/* Nonzero means message about use of implicit function declarations;
1 means warning; 2 means error. */
@@ -499,7 +510,7 @@ int mesg_implicit_function_declaration;
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
-int warn_write_strings;
+int flag_const_strings;
/* Nonzero means warn about pointer casts that can drop a type qualifier
from the pointer target type. */
@@ -582,6 +593,10 @@ int warn_unknown_pragmas = 0; /* Tri state variable. */
int warn_sign_compare = -1;
+/* Nonzero means warn about use of multicharacter literals. */
+
+int warn_multichar = 1;
+
/* Nonzero means `$' can be in an identifier. */
#ifndef DOLLARS_IN_IDENTIFIERS
@@ -590,13 +605,28 @@ int warn_sign_compare = -1;
int dollars_in_ident = DOLLARS_IN_IDENTIFIERS;
/* Decode the string P as a language-specific option for C.
- Return 1 if it is recognized (and handle it);
- return 0 if not recognized. */
+ Return the number of strings consumed. */
int
-c_decode_option (p)
- char *p;
+c_decode_option (argc, argv)
+ int argc;
+ char **argv;
{
+ int strings_processed;
+ char *p = argv[0];
+#if USE_CPPLIB
+ if (! cpp_initialized)
+ {
+ cpp_reader_init (&parse_in);
+ parse_in.data = &parse_options;
+ cpp_options_init (&parse_options);
+ cpp_initialized = 1;
+ }
+ strings_processed = cpp_handle_option (&parse_in, argc, argv);
+#else
+ strings_processed = 0;
+#endif /* ! USE_CPPLIB */
+
if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
{
flag_traditional = 1;
@@ -690,10 +720,14 @@ c_decode_option (p)
}
else if (!strcmp (p, "-Wno-implicit"))
warn_implicit_int = 0, mesg_implicit_function_declaration = 0;
+ else if (!strcmp (p, "-Wlong-long"))
+ warn_long_long = 1;
+ else if (!strcmp (p, "-Wno-long-long"))
+ warn_long_long = 0;
else if (!strcmp (p, "-Wwrite-strings"))
- warn_write_strings = 1;
+ flag_const_strings = 1;
else if (!strcmp (p, "-Wno-write-strings"))
- warn_write_strings = 0;
+ flag_const_strings = 0;
else if (!strcmp (p, "-Wcast-qual"))
warn_cast_qual = 1;
else if (!strcmp (p, "-Wno-cast-qual"))
@@ -782,6 +816,10 @@ c_decode_option (p)
warn_sign_compare = 1;
else if (!strcmp (p, "-Wno-sign-compare"))
warn_sign_compare = 0;
+ else if (!strcmp (p, "-Wmultichar"))
+ warn_multichar = 1;
+ else if (!strcmp (p, "-Wno-multichar"))
+ warn_multichar = 0;
else if (!strcmp (p, "-Wunknown-pragmas"))
/* Set to greater than 1, so that even unknown pragmas in system
headers will be warned about. */
@@ -811,7 +849,7 @@ c_decode_option (p)
warn_unknown_pragmas = 1;
}
else
- return 0;
+ return strings_processed;
return 1;
}
@@ -820,17 +858,17 @@ c_decode_option (p)
void
print_lang_decl (file, node, indent)
- FILE *file;
- tree node;
- int indent;
+ FILE *file ATTRIBUTE_UNUSED;
+ tree node ATTRIBUTE_UNUSED;
+ int indent ATTRIBUTE_UNUSED;
{
}
void
print_lang_type (file, node, indent)
- FILE *file;
- tree node;
- int indent;
+ FILE *file ATTRIBUTE_UNUSED;
+ tree node ATTRIBUTE_UNUSED;
+ int indent ATTRIBUTE_UNUSED;
{
}
@@ -1905,6 +1943,9 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
{
DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl);
DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
+
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
+ |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
}
pop_obstacks ();
@@ -1991,14 +2032,21 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl);
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
if (DECL_INLINE (newdecl))
- DECL_ABSTRACT_ORIGIN (newdecl) = olddecl;
+ DECL_ABSTRACT_ORIGIN (newdecl) = DECL_ORIGIN (olddecl);
}
}
if (different_binding_level)
{
/* Don't output a duplicate symbol or debugging information for this
- declaration. */
- TREE_ASM_WRITTEN (newdecl) = DECL_IGNORED_P (newdecl) = 1;
+ declaration.
+
+ Do not set TREE_ASM_WRITTEN for a FUNCTION_DECL since we may actually
+ just have two declarations without a definition. VAR_DECLs may need
+ the same treatment, I'm not sure. */
+ if (TREE_CODE (newdecl) == FUNCTION_DECL)
+ DECL_IGNORED_P (newdecl) = 1;
+ else
+ TREE_ASM_WRITTEN (newdecl) = DECL_IGNORED_P (newdecl) = 1;
return 0;
}
@@ -2348,7 +2396,7 @@ pushdecl (x)
DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal);
DECL_RESULT (x) = DECL_RESULT (oldglobal);
TREE_ASM_WRITTEN (x) = TREE_ASM_WRITTEN (oldglobal);
- DECL_ABSTRACT_ORIGIN (x) = oldglobal;
+ DECL_ABSTRACT_ORIGIN (x) = DECL_ORIGIN (oldglobal);
}
/* Inner extern decl is built-in if global one is. */
if (DECL_BUILT_IN (oldglobal))
@@ -3024,7 +3072,7 @@ init_decl_processing ()
pushdecl (build_decl (TYPE_DECL, NULL_TREE, intDI_type_node));
intTI_type_node = make_signed_type (GET_MODE_BITSIZE (TImode));
- pushdecl (build_decl (TYPE_DECL, NULL_TREE, intDI_type_node));
+ pushdecl (build_decl (TYPE_DECL, NULL_TREE, intTI_type_node));
unsigned_intQI_type_node = make_unsigned_type (GET_MODE_BITSIZE (QImode));
pushdecl (build_decl (TYPE_DECL, NULL_TREE, unsigned_intQI_type_node));
@@ -3273,8 +3321,8 @@ init_decl_processing ()
builtin_function ("__builtin_unwind_init",
build_function_type (void_type_node, endlink),
BUILT_IN_UNWIND_INIT, NULL_PTR);
- builtin_function ("__builtin_fp", ptr_ftype_void, BUILT_IN_FP, NULL_PTR);
- builtin_function ("__builtin_sp", ptr_ftype_void, BUILT_IN_SP, NULL_PTR);
+ builtin_function ("__builtin_dwarf_cfa", ptr_ftype_void,
+ BUILT_IN_DWARF_CFA, NULL_PTR);
builtin_function ("__builtin_dwarf_fp_regnum",
build_function_type (unsigned_type_node, endlink),
BUILT_IN_DWARF_FP_REGNUM, NULL_PTR);
@@ -3284,22 +3332,16 @@ init_decl_processing ()
BUILT_IN_FROB_RETURN_ADDR, NULL_PTR);
builtin_function ("__builtin_extract_return_addr", ptr_ftype_ptr,
BUILT_IN_EXTRACT_RETURN_ADDR, NULL_PTR);
- builtin_function ("__builtin_set_return_addr_reg",
- build_function_type (void_type_node,
- tree_cons (NULL_TREE,
- ptr_type_node,
- endlink)),
- BUILT_IN_SET_RETURN_ADDR_REG, NULL_PTR);
- builtin_function ("__builtin_eh_stub", ptr_ftype_void,
- BUILT_IN_EH_STUB, NULL_PTR);
builtin_function
- ("__builtin_set_eh_regs",
+ ("__builtin_eh_return",
build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE,
type_for_mode (ptr_mode, 0),
- endlink))),
- BUILT_IN_SET_EH_REGS, NULL_PTR);
+ tree_cons (NULL_TREE,
+ ptr_type_node,
+ endlink)))),
+ BUILT_IN_EH_RETURN, NULL_PTR);
builtin_function ("__builtin_alloca",
build_function_type (ptr_type_node,
@@ -3431,6 +3473,9 @@ init_decl_processing ()
integer_type_node,
endlink))),
BUILT_IN_LONGJMP, NULL_PTR);
+ builtin_function ("__builtin_trap",
+ build_function_type (void_type_node, endlink),
+ BUILT_IN_TRAP, NULL_PTR);
/* In an ANSI C program, it is okay to supply built-in meanings
for these functions, since applications cannot validly use them
@@ -3510,6 +3555,8 @@ init_decl_processing ()
incomplete_decl_finalize_hook = finish_incomplete_decl;
+ lang_get_alias_set = c_get_alias_set;
+
/* Record our roots. */
ggc_add_tree_root (c_global_trees, sizeof(c_global_trees)/sizeof(tree));
@@ -3606,7 +3653,7 @@ shadow_tag_warned (declspecs, warned)
following code. */
split_specs_attrs (declspecs, &specs, &attrs);
- for (link = declspecs; link; link = TREE_CHAIN (link))
+ for (link = specs; link; link = TREE_CHAIN (link))
{
register tree value = TREE_VALUE (link);
register enum tree_code code = TREE_CODE (value);
@@ -3719,7 +3766,8 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
/* The corresponding pop_obstacks is in finish_decl. */
push_obstacks_nochange ();
- if (warn_main && !strcmp (IDENTIFIER_POINTER (declarator), "main"))
+ if (warn_main && TREE_CODE (decl) != FUNCTION_DECL
+ && !strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "main"))
warning_with_decl (decl, "`%s' is usually a function");
if (initialized)
@@ -3814,6 +3862,10 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (! flag_no_common || ! TREE_PUBLIC (decl))
DECL_COMMON (decl) = 1;
+#ifdef SET_DEFAULT_DECL_ATTRIBUTES
+ SET_DEFAULT_DECL_ATTRIBUTES (decl, attributes);
+#endif
+
/* Set attributes here so if duplicate decl, will have proper attributes. */
decl_attributes (decl, attributes, prefix_attributes);
@@ -4136,7 +4188,7 @@ finish_decl (decl, init, asmspec_tree)
tree
maybe_build_cleanup (decl)
- tree decl;
+ tree decl ATTRIBUTE_UNUSED;
{
/* There are no cleanups in C. */
return NULL_TREE;
@@ -4410,7 +4462,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
error ("`long long long' is too long for GCC");
else
{
- if (pedantic && ! in_system_header)
+ if (pedantic && ! in_system_header && warn_long_long)
pedwarn ("ANSI C does not support `long long'");
longlong = 1;
}
@@ -4463,6 +4515,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if ((! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT)
| (1 << (int) RID_SIGNED)
| (1 << (int) RID_UNSIGNED))))
+ /* Don't warn about typedef foo = bar. */
+ && ! (specbits & (1 << (int) RID_TYPEDEF) && initialized)
&& ! (in_system_header && ! allocation_temporary_p ()))
{
/* C9x will probably require a diagnostic here.
@@ -5227,8 +5281,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
/* Record presence of `inline', if it is reasonable. */
if (inlinep)
{
- tree last = tree_last (TYPE_ARG_TYPES (type));
-
if (! strcmp (IDENTIFIER_POINTER (declarator), "main"))
warning ("cannot inline function `main'");
else
@@ -6212,6 +6264,7 @@ finish_enum (enumtype, values, attributes)
TYPE_MIN_VALUE (tem) = TYPE_MIN_VALUE (enumtype);
TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
+ TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
TYPE_MODE (tem) = TYPE_MODE (enumtype);
TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
@@ -6423,6 +6476,10 @@ start_function (declspecs, declarator, prefix_attributes, attributes, nested)
except for defining how to inline. So set DECL_EXTERNAL in that case. */
DECL_EXTERNAL (decl1) = current_extern_inline;
+#ifdef SET_DEFAULT_DECL_ATTRIBUTES
+ SET_DEFAULT_DECL_ATTRIBUTES (decl1, attributes);
+#endif
+
/* This function exists in static storage.
(This does not mean `static' in the C sense!) */
TREE_STATIC (decl1) = 1;
@@ -7350,6 +7407,6 @@ pop_c_function_context ()
void
copy_lang_decl (node)
- tree node;
+ tree node ATTRIBUTE_UNUSED;
{
}
diff --git a/gcc/c-gperf.h b/gcc/c-gperf.h
index b20f82b85ff..2932feb6cc8 100644
--- a/gcc/c-gperf.h
+++ b/gcc/c-gperf.h
@@ -1,6 +1,6 @@
-/* C code produced by gperf version 2.5 (GNU C++ version) */
-/* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ /puke/law/tmp/merge/egcs/gcc/c-parse.gperf */
-/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
+/* KR-C code produced by gperf version 2.7.1 (19981006 egcs) */
+/* Command-line: gperf -L KR-C -F , 0, 0 -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ./c-parse.gperf */
+/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
struct resword { char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 79
@@ -11,28 +11,41 @@ struct resword { char *name; short token; enum rid rid; };
/* maximum key range = 135, duplicates = 0 */
#ifdef __GNUC__
-inline
+__inline
#endif
static unsigned int
hash (str, len)
register char *str;
- register int unsigned len;
+ register unsigned int len;
{
static unsigned char asso_values[] =
{
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 25, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 1, 145, 46, 8, 15,
- 61, 6, 36, 48, 3, 5, 145, 18, 63, 25,
- 29, 76, 1, 145, 13, 2, 1, 51, 37, 9,
- 9, 1, 3, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 25, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 1, 145, 46, 8, 15,
+ 61, 6, 36, 48, 3, 5, 145, 18, 63, 25,
+ 29, 76, 1, 145, 13, 2, 1, 51, 37, 9,
+ 9, 1, 3, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145
};
register int hval = len;
@@ -40,130 +53,130 @@ hash (str, len)
{
default:
case 3:
- hval += asso_values[str[2]];
+ hval += asso_values[(unsigned char)str[2]];
case 2:
case 1:
- hval += asso_values[str[0]];
+ hval += asso_values[(unsigned char)str[0]];
break;
}
- return hval + asso_values[str[len - 1]];
+ return hval + asso_values[(unsigned char)str[len - 1]];
}
static struct resword wordlist[] =
-{
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"",},
- {"int", TYPESPEC, RID_INT},
- {"",}, {"",},
- {"__typeof__", TYPEOF, NORID},
- {"__signed__", TYPESPEC, RID_SIGNED},
- {"__imag__", IMAGPART, NORID},
- {"switch", SWITCH, NORID},
- {"__inline__", SCSPEC, RID_INLINE},
- {"else", ELSE, NORID},
- {"__iterator__", SCSPEC, RID_ITERATOR},
- {"__inline", SCSPEC, RID_INLINE},
- {"__extension__", EXTENSION, NORID},
- {"struct", STRUCT, NORID},
- {"__real__", REALPART, NORID},
- {"__const", TYPE_QUAL, RID_CONST},
- {"while", WHILE, NORID},
- {"__const__", TYPE_QUAL, RID_CONST},
- {"case", CASE, NORID},
- {"__complex__", TYPESPEC, RID_COMPLEX},
- {"__iterator", SCSPEC, RID_ITERATOR},
- {"bycopy", TYPE_QUAL, RID_BYCOPY},
- {"",}, {"",}, {"",},
- {"__complex", TYPESPEC, RID_COMPLEX},
- {"",},
- {"in", TYPE_QUAL, RID_IN},
- {"break", BREAK, NORID},
- {"@defs", DEFS, NORID},
- {"",}, {"",}, {"",},
- {"extern", SCSPEC, RID_EXTERN},
- {"if", IF, NORID},
- {"typeof", TYPEOF, NORID},
- {"typedef", SCSPEC, RID_TYPEDEF},
- {"__typeof", TYPEOF, NORID},
- {"sizeof", SIZEOF, NORID},
- {"",},
- {"return", RETURN, NORID},
- {"const", TYPE_QUAL, RID_CONST},
- {"__volatile__", TYPE_QUAL, RID_VOLATILE},
- {"@private", PRIVATE, NORID},
- {"@selector", SELECTOR, NORID},
- {"__volatile", TYPE_QUAL, RID_VOLATILE},
- {"__asm__", ASM_KEYWORD, NORID},
- {"",}, {"",},
- {"continue", CONTINUE, NORID},
- {"__alignof__", ALIGNOF, NORID},
- {"__imag", IMAGPART, NORID},
- {"__attribute__", ATTRIBUTE, NORID},
- {"",}, {"",},
- {"__attribute", ATTRIBUTE, NORID},
- {"for", FOR, NORID},
- {"",},
- {"@encode", ENCODE, NORID},
- {"id", OBJECTNAME, RID_ID},
- {"static", SCSPEC, RID_STATIC},
- {"@interface", INTERFACE, NORID},
- {"",},
- {"__signed", TYPESPEC, RID_SIGNED},
- {"",},
- {"__label__", LABEL, NORID},
- {"",}, {"",},
- {"__asm", ASM_KEYWORD, NORID},
- {"char", TYPESPEC, RID_CHAR},
- {"",},
- {"inline", SCSPEC, RID_INLINE},
- {"out", TYPE_QUAL, RID_OUT},
- {"register", SCSPEC, RID_REGISTER},
- {"__real", REALPART, NORID},
- {"short", TYPESPEC, RID_SHORT},
- {"",},
- {"enum", ENUM, NORID},
- {"inout", TYPE_QUAL, RID_INOUT},
- {"",},
- {"oneway", TYPE_QUAL, RID_ONEWAY},
- {"union", UNION, NORID},
- {"",},
- {"__alignof", ALIGNOF, NORID},
- {"",},
- {"@implementation", IMPLEMENTATION, NORID},
- {"",},
- {"@class", CLASS, NORID},
- {"",},
- {"@public", PUBLIC, NORID},
- {"asm", ASM_KEYWORD, NORID},
- {"",}, {"",}, {"",}, {"",}, {"",},
- {"default", DEFAULT, NORID},
- {"",},
- {"void", TYPESPEC, RID_VOID},
- {"",},
- {"@protected", PROTECTED, NORID},
- {"@protocol", PROTOCOL, NORID},
- {"",}, {"",}, {"",},
- {"volatile", TYPE_QUAL, RID_VOLATILE},
- {"",}, {"",},
- {"signed", TYPESPEC, RID_SIGNED},
- {"float", TYPESPEC, RID_FLOAT},
- {"@end", END, NORID},
- {"",}, {"",},
- {"unsigned", TYPESPEC, RID_UNSIGNED},
- {"@compatibility_alias", ALIAS, NORID},
- {"double", TYPESPEC, RID_DOUBLE},
- {"",}, {"",},
- {"auto", SCSPEC, RID_AUTO},
- {"",},
- {"goto", GOTO, NORID},
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"do", DO, NORID},
- {"",}, {"",}, {"",}, {"",},
- {"long", TYPESPEC, RID_LONG},
-};
+ {
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0},
+ {"int", TYPESPEC, RID_INT},
+ {"", 0, 0}, {"", 0, 0},
+ {"__typeof__", TYPEOF, NORID},
+ {"__signed__", TYPESPEC, RID_SIGNED},
+ {"__imag__", IMAGPART, NORID},
+ {"switch", SWITCH, NORID},
+ {"__inline__", SCSPEC, RID_INLINE},
+ {"else", ELSE, NORID},
+ {"__iterator__", SCSPEC, RID_ITERATOR},
+ {"__inline", SCSPEC, RID_INLINE},
+ {"__extension__", EXTENSION, NORID},
+ {"struct", STRUCT, NORID},
+ {"__real__", REALPART, NORID},
+ {"__const", TYPE_QUAL, RID_CONST},
+ {"while", WHILE, NORID},
+ {"__const__", TYPE_QUAL, RID_CONST},
+ {"case", CASE, NORID},
+ {"__complex__", TYPESPEC, RID_COMPLEX},
+ {"__iterator", SCSPEC, RID_ITERATOR},
+ {"bycopy", TYPE_QUAL, RID_BYCOPY},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"__complex", TYPESPEC, RID_COMPLEX},
+ {"", 0, 0},
+ {"in", TYPE_QUAL, RID_IN},
+ {"break", BREAK, NORID},
+ {"@defs", DEFS, NORID},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"extern", SCSPEC, RID_EXTERN},
+ {"if", IF, NORID},
+ {"typeof", TYPEOF, NORID},
+ {"typedef", SCSPEC, RID_TYPEDEF},
+ {"__typeof", TYPEOF, NORID},
+ {"sizeof", SIZEOF, NORID},
+ {"", 0, 0},
+ {"return", RETURN, NORID},
+ {"const", TYPE_QUAL, RID_CONST},
+ {"__volatile__", TYPE_QUAL, RID_VOLATILE},
+ {"@private", PRIVATE, NORID},
+ {"@selector", SELECTOR, NORID},
+ {"__volatile", TYPE_QUAL, RID_VOLATILE},
+ {"__asm__", ASM_KEYWORD, NORID},
+ {"", 0, 0}, {"", 0, 0},
+ {"continue", CONTINUE, NORID},
+ {"__alignof__", ALIGNOF, NORID},
+ {"__imag", IMAGPART, NORID},
+ {"__attribute__", ATTRIBUTE, NORID},
+ {"", 0, 0}, {"", 0, 0},
+ {"__attribute", ATTRIBUTE, NORID},
+ {"for", FOR, NORID},
+ {"", 0, 0},
+ {"@encode", ENCODE, NORID},
+ {"id", OBJECTNAME, RID_ID},
+ {"static", SCSPEC, RID_STATIC},
+ {"@interface", INTERFACE, NORID},
+ {"", 0, 0},
+ {"__signed", TYPESPEC, RID_SIGNED},
+ {"", 0, 0},
+ {"__label__", LABEL, NORID},
+ {"", 0, 0}, {"", 0, 0},
+ {"__asm", ASM_KEYWORD, NORID},
+ {"char", TYPESPEC, RID_CHAR},
+ {"", 0, 0},
+ {"inline", SCSPEC, RID_INLINE},
+ {"out", TYPE_QUAL, RID_OUT},
+ {"register", SCSPEC, RID_REGISTER},
+ {"__real", REALPART, NORID},
+ {"short", TYPESPEC, RID_SHORT},
+ {"", 0, 0},
+ {"enum", ENUM, NORID},
+ {"inout", TYPE_QUAL, RID_INOUT},
+ {"", 0, 0},
+ {"oneway", TYPE_QUAL, RID_ONEWAY},
+ {"union", UNION, NORID},
+ {"", 0, 0},
+ {"__alignof", ALIGNOF, NORID},
+ {"", 0, 0},
+ {"@implementation", IMPLEMENTATION, NORID},
+ {"", 0, 0},
+ {"@class", CLASS, NORID},
+ {"", 0, 0},
+ {"@public", PUBLIC, NORID},
+ {"asm", ASM_KEYWORD, NORID},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"default", DEFAULT, NORID},
+ {"", 0, 0},
+ {"void", TYPESPEC, RID_VOID},
+ {"", 0, 0},
+ {"@protected", PROTECTED, NORID},
+ {"@protocol", PROTOCOL, NORID},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"volatile", TYPE_QUAL, RID_VOLATILE},
+ {"", 0, 0}, {"", 0, 0},
+ {"signed", TYPESPEC, RID_SIGNED},
+ {"float", TYPESPEC, RID_FLOAT},
+ {"@end", END, NORID},
+ {"", 0, 0}, {"", 0, 0},
+ {"unsigned", TYPESPEC, RID_UNSIGNED},
+ {"@compatibility_alias", ALIAS, NORID},
+ {"double", TYPESPEC, RID_DOUBLE},
+ {"", 0, 0}, {"", 0, 0},
+ {"auto", SCSPEC, RID_AUTO},
+ {"", 0, 0},
+ {"goto", GOTO, NORID},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"do", DO, NORID},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"long", TYPESPEC, RID_LONG}
+ };
#ifdef __GNUC__
-inline
+__inline
#endif
struct resword *
is_reserved_word (str, len)
@@ -178,7 +191,7 @@ is_reserved_word (str, len)
{
register char *s = wordlist[key].name;
- if (*s == *str && !strcmp (str + 1, s + 1))
+ if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
diff --git a/gcc/c-iterate.c b/gcc/c-iterate.c
index 97235e89fe5..b8f51d090d6 100644
--- a/gcc/c-iterate.c
+++ b/gcc/c-iterate.c
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "rtl.h"
#include "toplev.h"
+#include "expr.h"
/*
KEEPING TRACK OF EXPANSIONS
@@ -287,7 +288,8 @@ iterator_loop_prologue (idecl, start_note, end_note)
/* Force the save_expr in DECL_INITIAL to be calculated
if it hasn't been calculated yet. */
- expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode, 0);
+ expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode,
+ EXPAND_NORMAL);
if (DECL_RTL (idecl) == 0)
expand_decl (idecl);
@@ -298,7 +300,7 @@ iterator_loop_prologue (idecl, start_note, end_note)
/* Initialize counter. */
expr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, integer_zero_node);
TREE_SIDE_EFFECTS (expr) = 1;
- expand_expr (expr, const0_rtx, VOIDmode, 0);
+ expand_expr (expr, const0_rtx, VOIDmode, EXPAND_NORMAL);
expand_start_loop_continue_elsewhere (1);
@@ -339,7 +341,7 @@ iterator_loop_epilogue (idecl, start_note, end_note)
incr = build_binary_op (PLUS_EXPR, idecl, integer_one_node, 0);
incr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, incr);
TREE_SIDE_EFFECTS (incr) = 1;
- expand_expr (incr, const0_rtx, VOIDmode, 0);
+ expand_expr (incr, const0_rtx, VOIDmode, EXPAND_NORMAL);
test = build_binary_op (LT_EXPR, idecl, DECL_INITIAL (idecl), 0);
expand_exit_loop_if_false (0, test);
expand_end_loop ();
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index 52ddee0ab83..375be91d07e 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -24,16 +24,25 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "input.h"
#include "c-tree.h"
+#include "c-lex.h"
+#include "toplev.h"
+#include "output.h"
#include "ggc.h"
/* Each of the functions defined here
is an alternative to a function in objc-actions.c. */
int
-lang_decode_option (p)
- char *p;
+lang_decode_option (argc, argv)
+ int argc;
+ char **argv;
+{
+ return c_decode_option (argc, argv);
+}
+
+void
+lang_init_options ()
{
- return c_decode_option (p);
}
void
@@ -67,9 +76,9 @@ print_lang_statistics ()
void
lang_print_xnode (file, node, indent)
- FILE *file;
- tree node;
- int indent;
+ FILE *file ATTRIBUTE_UNUSED;
+ tree node ATTRIBUTE_UNUSED;
+ int indent ATTRIBUTE_UNUSED;
{
}
@@ -77,35 +86,36 @@ lang_print_xnode (file, node, indent)
tree
lookup_interface (arg)
- tree arg;
+ tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
tree
is_class_name (arg)
- tree arg;
+ tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
void
maybe_objc_check_decl (decl)
- tree decl;
+ tree decl ATTRIBUTE_UNUSED;
{
}
int
maybe_objc_comptypes (lhs, rhs, reflexive)
- tree lhs, rhs;
- int reflexive;
+ tree lhs ATTRIBUTE_UNUSED;
+ tree rhs ATTRIBUTE_UNUSED;
+ int reflexive ATTRIBUTE_UNUSED;
{
return -1;
}
tree
maybe_objc_method_name (decl)
- tree decl;
+ tree decl ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -124,25 +134,13 @@ recognize_objc_keyword ()
tree
build_objc_string (len, str)
- int len;
- char *str;
+ int len ATTRIBUTE_UNUSED;
+ char *str ATTRIBUTE_UNUSED;
{
abort ();
return NULL_TREE;
}
-void
-GNU_xref_begin ()
-{
- fatal ("GCC does not yet support XREF");
-}
-
-void
-GNU_xref_end ()
-{
- fatal ("GCC does not yet support XREF");
-}
-
/* Called at end of parsing, but before end-of-file processing. */
void
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 6f84131dc3e..af627cd5315 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "tree.h"
#include "input.h"
+#include "output.h"
#include "c-lex.h"
#include "c-tree.h"
#include "flags.h"
@@ -32,27 +33,22 @@ Boston, MA 02111-1307, USA. */
#include "c-pragma.h"
#include "toplev.h"
-/* MULTIBYTE_CHARS support only works for native compilers.
- ??? Ideally what we want is to model widechar support after
- the current floating point support. */
-#ifdef CROSS_COMPILE
-#undef MULTIBYTE_CHARS
-#endif
-
#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
#include <locale.h>
-#endif
+#endif /* MULTIBYTE_CHARS */
#if USE_CPPLIB
#include "cpplib.h"
-cpp_reader parse_in;
-cpp_options parse_options;
-static enum cpp_token cpp_token;
+extern cpp_reader parse_in;
+extern cpp_options parse_options;
#else
/* Stream for reading from the input file. */
FILE *finput;
#endif
+extern void yyprint PROTO((FILE *, int, YYSTYPE));
+
/* The elements of `ridpointers' are identifier nodes
for the reserved type names and storage classes.
It is indexed by a RID_... value. */
@@ -62,24 +58,10 @@ tree ridpointers[(int) RID_MAX];
#define YYDEBUG 1
#if USE_CPPLIB
-static unsigned char *yy_cur, *yy_lim;
-
-int
-yy_get_token ()
-{
- for (;;)
- {
- parse_in.limit = parse_in.token_buffer;
- cpp_token = cpp_get_token (&parse_in);
- if (cpp_token == CPP_EOF)
- return -1;
- yy_lim = CPP_PWRITTEN (&parse_in);
- yy_cur = parse_in.token_buffer;
- if (yy_cur < yy_lim)
- return *yy_cur++;
- }
-}
-
+extern unsigned char *yy_cur, *yy_lim;
+
+extern int yy_get_token ();
+
#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
#define UNGETC(c) ((c), yy_cur--)
#else
@@ -128,15 +110,14 @@ static int end_of_file;
static int nextchar = -1;
#endif
-#ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((int));
-#endif /* HANDLE_SYSV_PRAGMA */
+#ifdef HANDLE_GENERIC_PRAGMAS
+static int handle_generic_pragma PROTO((int));
+#endif /* HANDLE_GENERIC_PRAGMAS */
static int whitespace_cr PROTO((int));
static int skip_white_space PROTO((int));
static int skip_white_space_on_line PROTO((void));
static char *extend_token_buffer PROTO((char *));
static int readescape PROTO((int *));
-int check_newline ();
/* Do not insert generated code into the source, instead, include it.
This allows us to build gcc automatically even for targets that
@@ -214,10 +195,6 @@ init_parse (filename)
yy_cur = "\n";
yy_lim = yy_cur+1;
- cpp_reader_init (&parse_in);
- parse_in.data = &parse_options;
- cpp_options_init (&parse_options);
- cpp_handle_options (&parse_in, 0, NULL); /* FIXME */
parse_in.show_column = 1;
if (! cpp_start_read (&parse_in, filename))
abort ();
@@ -249,6 +226,7 @@ init_lex ()
#ifdef MULTIBYTE_CHARS
/* Change to the native locale for multibyte conversions. */
setlocale (LC_CTYPE, "");
+ literal_codeset = getenv ("LANG");
#endif
maxtoken = 40;
@@ -497,88 +475,22 @@ extend_token_buffer (p)
return token_buffer + offset;
}
-#if !USE_CPPLIB
-#define GET_DIRECTIVE_LINE() get_directive_line (finput)
-#else /* USE_CPPLIB */
-/* Read the rest of a #-directive from input stream FINPUT.
- In normal use, the directive name and the white space after it
- have already been read, so they won't be included in the result.
- We allow for the fact that the directive line may contain
- a newline embedded within a character or string literal which forms
- a part of the directive.
-
- The value is a string in a reusable buffer. It remains valid
- only until the next time this function is called. */
-
-static char *
-GET_DIRECTIVE_LINE ()
+#if defined HANDLE_PRAGMA
+/* Local versions of these macros, that can be passed as function pointers. */
+static int
+pragma_getc ()
{
- static char *directive_buffer = NULL;
- static unsigned buffer_length = 0;
- register char *p;
- register char *buffer_limit;
- register int looking_for = 0;
- register int char_escaped = 0;
-
- if (buffer_length == 0)
- {
- directive_buffer = (char *)xmalloc (128);
- buffer_length = 128;
- }
-
- buffer_limit = &directive_buffer[buffer_length];
-
- for (p = directive_buffer; ; )
- {
- int c;
-
- /* Make buffer bigger if it is full. */
- if (p >= buffer_limit)
- {
- register unsigned bytes_used = (p - directive_buffer);
-
- buffer_length *= 2;
- directive_buffer
- = (char *)xrealloc (directive_buffer, buffer_length);
- p = &directive_buffer[bytes_used];
- buffer_limit = &directive_buffer[buffer_length];
- }
-
- c = GETC ();
-
- /* Discard initial whitespace. */
- if ((c == ' ' || c == '\t') && p == directive_buffer)
- continue;
-
- /* Detect the end of the directive. */
- if (c == '\n' && looking_for == 0)
- {
- UNGETC (c);
- c = '\0';
- }
-
- *p++ = c;
-
- if (c == 0)
- return directive_buffer;
-
- /* Handle string and character constant syntax. */
- if (looking_for)
- {
- if (looking_for == c && !char_escaped)
- looking_for = 0; /* Found terminator... stop looking. */
- }
- else
- if (c == '\'' || c == '"')
- looking_for = c; /* Don't stop buffering until we see another
- one of these (or an EOF). */
+ return GETC();
+}
- /* Handle backslash. */
- char_escaped = (c == '\\' && ! char_escaped);
- }
+static void
+pragma_ungetc (arg)
+ int arg;
+{
+ UNGETC (arg);
}
-#endif /* USE_CPPLIB */
-
+#endif
+
/* At the beginning of a line, increment the line number
and process any #-directive on this line.
If the line is a #-directive, read the entire line and return a newline.
@@ -630,29 +542,46 @@ check_newline ()
c = GETC ();
if (c == '\n')
return c;
-#ifdef HANDLE_SYSV_PRAGMA
+
+#if defined HANDLE_PRAGMA || defined HANDLE_GENERIC_PRAGMAS
UNGETC (c);
token = yylex ();
if (token != IDENTIFIER)
goto skipline;
- return handle_sysv_pragma (token);
-#else /* !HANDLE_SYSV_PRAGMA */
+#endif /* HANDLE_PRAGMA || HANDLE_GENERIC_PRAGMAS */
+
#ifdef HANDLE_PRAGMA
+ /* We invoke HANDLE_PRAGMA before HANDLE_GENERIC_PRAGMAS (if
+ both are defined), in order to give the back end a chance to
+ override the interpretation of generic style pragmas. */
#if !USE_CPPLIB
- UNGETC (c);
- token = yylex ();
- if (token != IDENTIFIER)
- goto skipline;
- if (HANDLE_PRAGMA (finput, yylval.ttype))
+ if (nextchar >= 0)
{
- c = GETC ();
- return c;
+ c = nextchar, nextchar = -1;
+ UNGETC (c);
}
-#else
- ??? do not know what to do ???;
#endif /* !USE_CPPLIB */
+
+ if (TREE_CODE (yylval.ttype) != IDENTIFIER_NODE)
+ goto skipline;
+
+ if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc,
+ IDENTIFIER_POINTER (yylval.ttype)))
+ return GETC ();
#endif /* HANDLE_PRAGMA */
-#endif /* !HANDLE_SYSV_PRAGMA */
+
+#ifdef HANDLE_GENERIC_PRAGMAS
+ if (handle_generic_pragma (token))
+ return GETC ();
+#endif /* HANDLE_GENERIC_PRAGMAS */
+
+ /* Issue a warning message if we have been asked to do so.
+ Ignoring unknown pragmas in system header file unless
+ an explcit -Wunknown-pragmas has been given. */
+ if (warn_unknown_pragmas > 1
+ || (warn_unknown_pragmas && ! in_system_header))
+ warning ("ignoring pragma: %s", token_buffer);
+
goto skipline;
}
}
@@ -911,17 +840,17 @@ linenum:
return c;
}
-#ifdef HANDLE_SYSV_PRAGMA
+#ifdef HANDLE_GENERIC_PRAGMAS
/* Handle a #pragma directive.
TOKEN is the token we read after `#pragma'. Processes the entire input
- line and returns a character for the caller to reread: either \n or EOF. */
+ line and return non-zero iff the pragma has been successfully parsed. */
/* This function has to be in this file, in order to get at
the token types. */
static int
-handle_sysv_pragma (token)
+handle_generic_pragma (token)
register int token;
{
register int c;
@@ -937,7 +866,7 @@ handle_sysv_pragma (token)
handle_pragma_token (token_buffer, yylval.ttype);
break;
default:
- handle_pragma_token (token_buffer, 0);
+ handle_pragma_token (token_buffer, NULL);
}
#if !USE_CPPLIB
if (nextchar >= 0)
@@ -948,17 +877,16 @@ handle_sysv_pragma (token)
while (c == ' ' || c == '\t')
c = GETC ();
- if (c == '\n' || c == EOF)
- {
- handle_pragma_token (0, 0);
- return c;
- }
UNGETC (c);
+
+ if (c == '\n' || c == EOF)
+ return handle_pragma_token (NULL, NULL);
+
token = yylex ();
}
}
-#endif /* HANDLE_SYSV_PRAGMA */
+#endif /* HANDLE_GENERIC_PRAGMAS */
#define ENDFILE -1 /* token that represents end-of-file */
@@ -1717,7 +1645,7 @@ yylex ()
{
if (spec_long_long)
error ("three `l's in integer constant");
- else if (pedantic)
+ else if (pedantic && ! in_system_header && warn_long_long)
pedwarn ("ANSI C forbids long long integer constants");
spec_long_long = 1;
}
@@ -1889,30 +1817,27 @@ yylex ()
{
register int result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = TYPE_PRECISION (char_type_node);
int max_chars;
-
- if (wide_flag)
- {
- width = WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = TYPE_PRECISION (integer_type_node) / width;
+
+ max_chars = TYPE_PRECISION (integer_type_node) / width;
+ if (wide_flag)
+ width = WCHAR_TYPE_SIZE;
while (1)
{
tryagain:
-
c = GETC();
if (c == '\'' || c == EOF)
break;
+ ++chars_seen;
if (c == '\\')
{
int ignore = 0;
@@ -1933,18 +1858,76 @@ yylex ()
pedwarn ("ANSI C forbids newline in character constant");
lineno++;
}
-#ifdef MAP_CHARACTER
else
- c = MAP_CHARACTER (c);
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ if (i > maxtoken - 4)
+ extend_token_buffer (token_buffer);
+
+ token_buffer[i] = c;
+ char_len = local_mbtowc (& wc,
+ token_buffer + 1,
+ i);
+ if (char_len != -1)
+ break;
+ c = GETC ();
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ UNGETC (c);
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i];
+ }
+ num_chars += char_len;
+ goto tryagain;
+ }
+ c = wc;
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ if (wide_flag)
+ c = wc;
+#ifdef MAP_CHARACTER
+ else
+ c = MAP_CHARACTER (c);
#endif
+ }
+#else /* ! MULTIBYTE_CHARS */
+#ifdef MAP_CHARACTER
+ c = MAP_CHARACTER (c);
+#endif
+#endif /* ! MULTIBYTE_CHARS */
+ }
- num_chars++;
- if (num_chars > maxtoken - 4)
- extend_token_buffer (token_buffer);
-
- token_buffer[num_chars] = c;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = c;
+ goto tryagain;
+ }
/* Merge character into result; ignore excess chars. */
+ num_chars += (width / TYPE_PRECISION (char_type_node));
if (num_chars < max_chars + 1)
{
if (width < HOST_BITS_PER_INT)
@@ -1954,19 +1937,16 @@ yylex ()
}
}
- token_buffer[num_chars + 1] = '\'';
- token_buffer[num_chars + 2] = 0;
-
if (c != '\'')
error ("malformatted character constant");
- else if (num_chars == 0)
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1 && ! flag_traditional)
+ else if (chars_seen != 1 && ! flag_traditional && warn_multichar)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
@@ -1991,22 +1971,6 @@ yylex ()
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[1] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL_PTR, NULL_PTR, 0);
- if (mbtowc (& wc, token_buffer + 1, num_chars) == num_chars)
- result = wc;
- else
- warning ("Ignoring invalid multibyte character");
- }
-#endif
yylval.ttype = build_int_2 (result, 0);
TREE_TYPE (yylval.ttype) = wchar_type_node;
}
@@ -2018,7 +1982,13 @@ yylex ()
case '"':
string_constant:
{
- c = GETC();
+ unsigned width = wide_flag ? WCHAR_TYPE_SIZE
+ : TYPE_PRECISION (char_type_node);
+#ifdef MULTIBYTE_CHARS
+ int longest_char = local_mb_cur_max ();
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
+#endif
+ c = GETC ();
p = token_buffer + 1;
while (c != '"' && c >= 0)
@@ -2029,9 +1999,8 @@ yylex ()
c = readescape (&ignore);
if (ignore)
goto skipnewline;
- if (!wide_flag
- && TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT
- && c >= (1 << TYPE_PRECISION (char_type_node)))
+ if (width < HOST_BITS_PER_INT
+ && (unsigned) c >= (1 << width))
pedwarn ("escape sequence out of range for character");
}
else if (c == '\n')
@@ -2040,15 +2009,94 @@ yylex ()
pedwarn ("ANSI C forbids newline in string constant");
lineno++;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 0; i < longest_char; ++i)
+ {
+ if (p + i >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ p[i] = c;
- if (p == token_buffer + maxtoken)
- p = extend_token_buffer (p);
- *p++ = c;
+ char_len = local_mbtowc (& wc, p, i + 1);
+ if (char_len != -1)
+ break;
+ c = GETC ();
+ }
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ else
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len <= i)
+ UNGETC (c);
+ if (wide_flag)
+ {
+ *(wchar_t *)p = wc;
+ p += sizeof (wc);
+ }
+ else
+ p += (i + 1);
+ c = GETC ();
+ continue;
+ }
+#endif /* MULTIBYTE_CHARS */
+ }
+
+ /* Add this single character into the buffer either as a wchar_t
+ or as a single byte. */
+ if (wide_flag)
+ {
+ unsigned width = TYPE_PRECISION (char_type_node);
+ unsigned bytemask = (1 << width) - 1;
+ int byte;
+
+ if (p + WCHAR_BYTES > token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+
+ for (byte = 0; byte < WCHAR_BYTES; ++byte)
+ {
+ int value;
+ if (byte >= sizeof (c))
+ value = 0;
+ else
+ value = (c >> (byte * width)) & bytemask;
+ if (BYTES_BIG_ENDIAN)
+ p[WCHAR_BYTES - byte - 1] = value;
+ else
+ p[byte] = value;
+ }
+ p += WCHAR_BYTES;
+ }
+ else
+ {
+ if (p >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ *p++ = c;
+ }
skipnewline:
- c = GETC();
+ c = GETC ();
+ }
+
+ /* Terminate the string value, either with a single byte zero
+ or with a wide zero. */
+ if (wide_flag)
+ {
+ if (p + WCHAR_BYTES > token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ bzero (p, WCHAR_BYTES);
+ p += WCHAR_BYTES;
+ }
+ else
+ {
+ if (p >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ *p++ = 0;
}
- *p = 0;
if (c < 0)
error ("Unterminated string constant");
@@ -2058,53 +2106,27 @@ yylex ()
if (wide_flag)
{
- /* If this is a L"..." wide-string, convert the multibyte string
- to a wide character string. */
- char *widep = (char *) alloca ((p - token_buffer) * WCHAR_BYTES);
- int len;
-
-#ifdef MULTIBYTE_CHARS
- len = mbstowcs ((wchar_t *) widep, token_buffer + 1, p - token_buffer);
- if (len < 0 || len >= (p - token_buffer))
- {
- warning ("Ignoring invalid multibyte string");
- len = 0;
- }
- bzero (widep + (len * WCHAR_BYTES), WCHAR_BYTES);
-#else
- {
- char *wp, *cp;
-
- wp = widep + (BYTES_BIG_ENDIAN ? WCHAR_BYTES - 1 : 0);
- bzero (widep, (p - token_buffer) * WCHAR_BYTES);
- for (cp = token_buffer + 1; cp < p; cp++)
- *wp = *cp, wp += WCHAR_BYTES;
- len = p - token_buffer - 1;
- }
-#endif
- yylval.ttype = build_string ((len + 1) * WCHAR_BYTES, widep);
+ yylval.ttype = build_string (p - (token_buffer + 1),
+ token_buffer + 1);
TREE_TYPE (yylval.ttype) = wchar_array_type_node;
value = STRING;
}
else if (objc_flag)
{
- extern tree build_objc_string();
/* Return an Objective-C @"..." constant string object. */
- yylval.ttype = build_objc_string (p - token_buffer,
+ yylval.ttype = build_objc_string (p - (token_buffer + 1),
token_buffer + 1);
TREE_TYPE (yylval.ttype) = char_array_type_node;
value = OBJC_STRING;
}
else
{
- yylval.ttype = build_string (p - token_buffer, token_buffer + 1);
+ yylval.ttype = build_string (p - (token_buffer + 1),
+ token_buffer + 1);
TREE_TYPE (yylval.ttype) = char_array_type_node;
value = STRING;
}
- *p++ = '"';
- *p = 0;
-
break;
}
diff --git a/gcc/c-lex.h b/gcc/c-lex.h
index 66726ab7b3c..bd0b9d4b91f 100644
--- a/gcc/c-lex.h
+++ b/gcc/c-lex.h
@@ -75,14 +75,12 @@ extern char *token_buffer; /* Pointer to token buffer. */
extern tree make_pointer_declarator PROTO((tree, tree));
extern void reinit_parse_for_function PROTO((void));
-extern void position_after_whitespace PROTO((void));
+extern void position_after_white_space PROTO((void));
extern int check_newline PROTO((void));
extern int yylex PROTO((void));
extern void yyerror PROTO((char *));
-extern char *get_directive_line PROTO((FILE *));
-
extern void forget_protocol_qualifiers PROTO((void));
extern void remember_protocol_qualifiers PROTO((void));
extern tree is_class_name PROTO((tree));
diff --git a/gcc/c-parse.c b/gcc/c-parse.c
index 2165908d500..842d2526312 100644
--- a/gcc/c-parse.c
+++ b/gcc/c-parse.c
@@ -97,7 +97,7 @@ char *language_string = "GNU C";
#line 87 "c-parse.y"
typedef union {long itype; tree ttype; enum tree_code code;
char *filename; int lineno; int ends_in_label; } YYSTYPE;
-#line 203 "c-parse.y"
+#line 204 "c-parse.y"
/* Number of statements (loosely speaking) and compound statements
seen so far. */
@@ -134,11 +134,11 @@ extern void yyprint PROTO ((FILE *, int, YYSTYPE));
-#define YYFINAL 682
+#define YYFINAL 688
#define YYFLAG -32768
#define YYNTBASE 84
-#define YYTRANSLATE(x) ((unsigned)(x) <= 316 ? yytranslate[x] : 239)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 316 ? yytranslate[x] : 242)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -200,44 +200,45 @@ static const short yyprhs[] = { 0,
612, 619, 620, 626, 627, 632, 633, 639, 640, 641,
647, 648, 649, 655, 657, 659, 663, 667, 672, 676,
680, 684, 686, 690, 695, 699, 703, 707, 709, 713,
- 717, 721, 726, 730, 734, 736, 737, 745, 751, 754,
- 755, 763, 769, 772, 773, 782, 783, 791, 794, 795,
- 797, 798, 800, 802, 805, 806, 810, 813, 817, 819,
- 823, 825, 827, 830, 832, 836, 841, 848, 854, 856,
- 860, 862, 864, 868, 871, 874, 875, 877, 879, 882,
- 883, 886, 890, 894, 897, 901, 906, 910, 913, 917,
- 920, 922, 924, 927, 930, 931, 933, 936, 937, 938,
- 940, 942, 945, 949, 951, 954, 956, 959, 966, 972,
- 978, 981, 984, 989, 990, 995, 996, 997, 1001, 1006,
- 1010, 1012, 1014, 1016, 1018, 1021, 1022, 1027, 1029, 1033,
- 1034, 1035, 1043, 1049, 1052, 1053, 1054, 1055, 1068, 1069,
- 1076, 1079, 1082, 1085, 1089, 1096, 1105, 1116, 1129, 1133,
- 1138, 1140, 1142, 1143, 1150, 1154, 1160, 1163, 1166, 1167,
- 1169, 1170, 1172, 1173, 1175, 1177, 1181, 1186, 1188, 1192,
- 1193, 1196, 1199, 1200, 1205, 1208, 1209, 1211, 1213, 1217,
- 1219, 1223, 1228, 1233, 1238, 1243, 1248, 1249, 1252, 1254,
- 1257, 1259, 1263, 1265, 1269
+ 717, 721, 726, 730, 734, 736, 738, 741, 743, 746,
+ 748, 751, 752, 760, 766, 769, 770, 778, 784, 787,
+ 788, 797, 798, 806, 809, 810, 812, 813, 815, 817,
+ 820, 821, 825, 828, 832, 834, 838, 840, 842, 845,
+ 847, 851, 856, 863, 869, 871, 875, 877, 879, 883,
+ 886, 889, 890, 892, 894, 897, 898, 901, 905, 909,
+ 912, 916, 921, 925, 928, 932, 935, 937, 939, 942,
+ 945, 946, 948, 951, 952, 953, 955, 957, 960, 964,
+ 966, 969, 971, 974, 981, 987, 993, 996, 999, 1004,
+ 1005, 1010, 1011, 1012, 1016, 1021, 1025, 1027, 1029, 1031,
+ 1033, 1036, 1037, 1042, 1044, 1048, 1049, 1050, 1058, 1064,
+ 1067, 1068, 1069, 1070, 1083, 1084, 1091, 1094, 1097, 1100,
+ 1104, 1111, 1120, 1131, 1144, 1148, 1153, 1155, 1157, 1158,
+ 1165, 1169, 1175, 1178, 1181, 1182, 1184, 1185, 1187, 1188,
+ 1190, 1192, 1196, 1201, 1203, 1207, 1208, 1211, 1214, 1215,
+ 1220, 1223, 1224, 1226, 1228, 1232, 1234, 1238, 1243, 1248,
+ 1253, 1258, 1263, 1264, 1267, 1269, 1272, 1274, 1278, 1280,
+ 1284
};
static const short yyrhs[] = { -1,
85, 0, 0, 86, 88, 0, 0, 85, 87, 88,
0, 90, 0, 89, 0, 27, 59, 99, 76, 77,
- 0, 238, 88, 0, 122, 136, 77, 0, 129, 122,
+ 0, 241, 88, 0, 122, 136, 77, 0, 129, 122,
136, 77, 0, 125, 122, 135, 77, 0, 129, 77,
0, 125, 77, 0, 1, 77, 0, 1, 78, 0,
77, 0, 0, 0, 125, 122, 165, 91, 116, 92,
- 196, 0, 125, 122, 165, 1, 0, 0, 0, 129,
- 122, 168, 93, 116, 94, 196, 0, 129, 122, 168,
- 1, 0, 0, 0, 122, 168, 95, 116, 96, 196,
+ 199, 0, 125, 122, 165, 1, 0, 0, 0, 129,
+ 122, 168, 93, 116, 94, 199, 0, 129, 122, 168,
+ 1, 0, 0, 0, 122, 168, 95, 116, 96, 199,
0, 122, 168, 1, 0, 3, 0, 4, 0, 43,
0, 49, 0, 48, 0, 54, 0, 55, 0, 79,
0, 80, 0, 101, 0, 0, 101, 0, 107, 0,
- 101, 81, 107, 0, 113, 0, 50, 105, 0, 238,
+ 101, 81, 107, 0, 113, 0, 50, 105, 0, 241,
105, 0, 98, 105, 0, 40, 97, 0, 103, 102,
- 0, 103, 59, 183, 76, 0, 104, 102, 0, 104,
- 59, 183, 76, 0, 33, 105, 0, 34, 105, 0,
- 11, 0, 29, 0, 102, 0, 59, 183, 76, 105,
- 0, 0, 59, 183, 76, 82, 106, 150, 78, 0,
+ 0, 103, 59, 186, 76, 0, 104, 102, 0, 104,
+ 59, 186, 76, 0, 33, 105, 0, 34, 105, 0,
+ 11, 0, 29, 0, 102, 0, 59, 186, 76, 105,
+ 0, 0, 59, 186, 76, 82, 106, 150, 78, 0,
105, 0, 107, 48, 107, 0, 107, 49, 107, 0,
107, 50, 107, 0, 107, 51, 107, 0, 107, 52,
107, 0, 107, 46, 107, 0, 107, 47, 107, 0,
@@ -248,26 +249,26 @@ static const short yyrhs[] = { -1,
107, 0, 0, 107, 37, 112, 38, 107, 0, 107,
36, 107, 0, 107, 35, 107, 0, 3, 0, 8,
0, 115, 0, 59, 99, 76, 0, 59, 1, 76,
- 0, 0, 59, 114, 198, 76, 0, 113, 59, 100,
+ 0, 0, 59, 114, 201, 76, 0, 113, 59, 100,
76, 0, 113, 60, 99, 83, 0, 113, 58, 97,
0, 113, 57, 97, 0, 113, 54, 0, 113, 55,
0, 9, 0, 115, 9, 0, 0, 118, 0, 118,
- 10, 0, 203, 204, 119, 0, 117, 0, 191, 0,
- 118, 117, 0, 117, 191, 0, 127, 122, 135, 77,
+ 10, 0, 206, 207, 119, 0, 117, 0, 194, 0,
+ 118, 117, 0, 117, 194, 0, 127, 122, 135, 77,
0, 130, 122, 136, 77, 0, 127, 77, 0, 130,
- 77, 0, 203, 204, 124, 0, 120, 0, 191, 0,
- 121, 120, 0, 120, 191, 0, 0, 0, 125, 122,
+ 77, 0, 206, 207, 124, 0, 120, 0, 194, 0,
+ 121, 120, 0, 120, 194, 0, 0, 0, 125, 122,
135, 77, 0, 129, 122, 136, 77, 0, 125, 122,
159, 0, 129, 122, 162, 0, 125, 77, 0, 129,
- 77, 0, 238, 124, 0, 133, 126, 0, 129, 133,
+ 77, 0, 241, 124, 0, 133, 126, 0, 129, 133,
126, 0, 0, 126, 134, 0, 126, 5, 0, 126,
143, 0, 133, 128, 0, 130, 133, 128, 0, 0,
128, 134, 0, 128, 5, 0, 130, 0, 143, 0,
129, 130, 0, 129, 143, 0, 7, 0, 5, 0,
- 130, 7, 0, 130, 5, 0, 133, 132, 0, 185,
- 133, 132, 0, 0, 132, 134, 0, 6, 0, 169,
+ 130, 7, 0, 130, 5, 0, 133, 132, 0, 188,
+ 133, 132, 0, 0, 132, 134, 0, 6, 0, 172,
0, 4, 0, 28, 59, 99, 76, 0, 28, 59,
- 183, 76, 0, 6, 0, 7, 0, 169, 0, 138,
+ 186, 76, 0, 6, 0, 7, 0, 172, 0, 138,
0, 135, 81, 138, 0, 140, 0, 136, 81, 138,
0, 0, 27, 59, 115, 76, 0, 0, 165, 137,
142, 36, 139, 148, 0, 165, 137, 142, 0, 0,
@@ -278,121 +279,124 @@ static const short yyrhs[] = { -1,
147, 59, 3, 81, 101, 76, 0, 147, 59, 100,
76, 0, 97, 0, 5, 0, 6, 0, 7, 0,
107, 0, 0, 82, 149, 150, 78, 0, 1, 0,
- 0, 151, 174, 0, 152, 0, 151, 81, 152, 0,
+ 0, 151, 177, 0, 152, 0, 151, 81, 152, 0,
107, 0, 0, 82, 153, 150, 78, 0, 1, 0,
0, 60, 107, 10, 107, 83, 36, 154, 152, 0,
0, 60, 107, 83, 36, 155, 152, 0, 0, 60,
107, 83, 156, 152, 0, 0, 97, 38, 157, 152,
0, 0, 58, 97, 36, 158, 152, 0, 0, 0,
- 165, 160, 116, 161, 198, 0, 0, 0, 168, 163,
- 116, 164, 198, 0, 166, 0, 168, 0, 59, 166,
- 76, 0, 166, 59, 233, 0, 166, 60, 99, 83,
- 0, 166, 60, 83, 0, 50, 186, 166, 0, 143,
- 123, 166, 0, 4, 0, 167, 59, 233, 0, 167,
- 60, 99, 83, 0, 167, 60, 83, 0, 50, 186,
+ 165, 160, 116, 161, 201, 0, 0, 0, 168, 163,
+ 116, 164, 201, 0, 166, 0, 168, 0, 59, 166,
+ 76, 0, 166, 59, 236, 0, 166, 60, 99, 83,
+ 0, 166, 60, 83, 0, 50, 189, 166, 0, 143,
+ 123, 166, 0, 4, 0, 167, 59, 236, 0, 167,
+ 60, 99, 83, 0, 167, 60, 83, 0, 50, 189,
167, 0, 143, 123, 167, 0, 4, 0, 168, 59,
- 233, 0, 59, 168, 76, 0, 50, 186, 168, 0,
+ 236, 0, 59, 168, 76, 0, 50, 189, 168, 0,
168, 60, 99, 83, 0, 168, 60, 83, 0, 143,
- 123, 168, 0, 3, 0, 0, 13, 97, 82, 170,
- 176, 78, 142, 0, 13, 82, 176, 78, 142, 0,
- 13, 97, 0, 0, 14, 97, 82, 171, 176, 78,
- 142, 0, 14, 82, 176, 78, 142, 0, 14, 97,
- 0, 0, 12, 97, 82, 172, 181, 175, 78, 142,
- 0, 0, 12, 82, 173, 181, 175, 78, 142, 0,
- 12, 97, 0, 0, 81, 0, 0, 81, 0, 177,
- 0, 177, 178, 0, 0, 177, 178, 77, 0, 177,
- 77, 0, 131, 122, 179, 0, 131, 0, 185, 122,
- 179, 0, 185, 0, 1, 0, 238, 178, 0, 180,
- 0, 179, 81, 180, 0, 203, 204, 165, 142, 0,
- 203, 204, 165, 38, 107, 142, 0, 203, 204, 38,
- 107, 142, 0, 182, 0, 181, 81, 182, 0, 1,
- 0, 97, 0, 97, 36, 107, 0, 131, 184, 0,
- 185, 184, 0, 0, 187, 0, 7, 0, 185, 7,
- 0, 0, 186, 7, 0, 59, 187, 76, 0, 50,
- 186, 187, 0, 50, 186, 0, 187, 59, 226, 0,
- 187, 60, 99, 83, 0, 187, 60, 83, 0, 59,
- 226, 0, 60, 99, 83, 0, 60, 83, 0, 189,
- 0, 206, 0, 189, 206, 0, 189, 191, 0, 0,
- 188, 0, 1, 77, 0, 0, 0, 194, 0, 195,
- 0, 194, 195, 0, 32, 237, 77, 0, 198, 0,
- 1, 198, 0, 82, 0, 197, 78, 0, 197, 192,
- 193, 121, 190, 78, 0, 197, 192, 193, 1, 78,
- 0, 197, 192, 193, 188, 78, 0, 200, 205, 0,
- 200, 1, 0, 15, 59, 99, 76, 0, 0, 18,
- 202, 205, 17, 0, 0, 0, 203, 204, 208, 0,
- 203, 204, 219, 205, 0, 203, 204, 207, 0, 208,
- 0, 219, 0, 198, 0, 216, 0, 99, 77, 0,
- 0, 199, 16, 209, 205, 0, 199, 0, 199, 16,
- 1, 0, 0, 0, 17, 210, 59, 99, 76, 211,
- 205, 0, 201, 59, 99, 76, 77, 0, 201, 1,
- 0, 0, 0, 0, 19, 59, 221, 77, 212, 221,
- 77, 213, 221, 76, 214, 205, 0, 0, 20, 59,
- 99, 76, 215, 205, 0, 23, 77, 0, 24, 77,
- 0, 25, 77, 0, 25, 99, 77, 0, 27, 220,
- 59, 99, 76, 77, 0, 27, 220, 59, 99, 38,
- 222, 76, 77, 0, 27, 220, 59, 99, 38, 222,
- 38, 222, 76, 77, 0, 27, 220, 59, 99, 38,
- 222, 38, 222, 38, 225, 76, 77, 0, 26, 97,
- 77, 0, 26, 50, 99, 77, 0, 77, 0, 217,
- 0, 0, 19, 59, 113, 76, 218, 205, 0, 21,
- 107, 38, 0, 21, 107, 10, 107, 38, 0, 22,
- 38, 0, 97, 38, 0, 0, 7, 0, 0, 99,
- 0, 0, 223, 0, 224, 0, 223, 81, 224, 0,
- 9, 59, 99, 76, 0, 115, 0, 225, 81, 115,
- 0, 0, 227, 228, 0, 230, 76, 0, 0, 231,
- 77, 229, 228, 0, 1, 76, 0, 0, 10, 0,
- 231, 0, 231, 81, 10, 0, 232, 0, 231, 81,
- 232, 0, 125, 122, 167, 142, 0, 125, 122, 168,
- 142, 0, 125, 122, 184, 142, 0, 129, 122, 168,
- 142, 0, 129, 122, 184, 142, 0, 0, 234, 235,
- 0, 228, 0, 236, 76, 0, 3, 0, 236, 81,
- 3, 0, 97, 0, 237, 81, 97, 0, 31, 0
+ 123, 168, 0, 3, 0, 13, 0, 13, 143, 0,
+ 14, 0, 14, 143, 0, 12, 0, 12, 143, 0,
+ 0, 169, 97, 82, 173, 179, 78, 142, 0, 169,
+ 82, 179, 78, 142, 0, 169, 97, 0, 0, 170,
+ 97, 82, 174, 179, 78, 142, 0, 170, 82, 179,
+ 78, 142, 0, 170, 97, 0, 0, 171, 97, 82,
+ 175, 184, 178, 78, 142, 0, 0, 171, 82, 176,
+ 184, 178, 78, 142, 0, 171, 97, 0, 0, 81,
+ 0, 0, 81, 0, 180, 0, 180, 181, 0, 0,
+ 180, 181, 77, 0, 180, 77, 0, 131, 122, 182,
+ 0, 131, 0, 188, 122, 182, 0, 188, 0, 1,
+ 0, 241, 181, 0, 183, 0, 182, 81, 183, 0,
+ 206, 207, 165, 142, 0, 206, 207, 165, 38, 107,
+ 142, 0, 206, 207, 38, 107, 142, 0, 185, 0,
+ 184, 81, 185, 0, 1, 0, 97, 0, 97, 36,
+ 107, 0, 131, 187, 0, 188, 187, 0, 0, 190,
+ 0, 7, 0, 188, 7, 0, 0, 189, 7, 0,
+ 59, 190, 76, 0, 50, 189, 190, 0, 50, 189,
+ 0, 190, 59, 229, 0, 190, 60, 99, 83, 0,
+ 190, 60, 83, 0, 59, 229, 0, 60, 99, 83,
+ 0, 60, 83, 0, 192, 0, 209, 0, 192, 209,
+ 0, 192, 194, 0, 0, 191, 0, 1, 77, 0,
+ 0, 0, 197, 0, 198, 0, 197, 198, 0, 32,
+ 240, 77, 0, 201, 0, 1, 201, 0, 82, 0,
+ 200, 78, 0, 200, 195, 196, 121, 193, 78, 0,
+ 200, 195, 196, 1, 78, 0, 200, 195, 196, 191,
+ 78, 0, 203, 208, 0, 203, 1, 0, 15, 59,
+ 99, 76, 0, 0, 18, 205, 208, 17, 0, 0,
+ 0, 206, 207, 211, 0, 206, 207, 222, 208, 0,
+ 206, 207, 210, 0, 211, 0, 222, 0, 201, 0,
+ 219, 0, 99, 77, 0, 0, 202, 16, 212, 208,
+ 0, 202, 0, 202, 16, 1, 0, 0, 0, 17,
+ 213, 59, 99, 76, 214, 208, 0, 204, 59, 99,
+ 76, 77, 0, 204, 1, 0, 0, 0, 0, 19,
+ 59, 224, 77, 215, 224, 77, 216, 224, 76, 217,
+ 208, 0, 0, 20, 59, 99, 76, 218, 208, 0,
+ 23, 77, 0, 24, 77, 0, 25, 77, 0, 25,
+ 99, 77, 0, 27, 223, 59, 99, 76, 77, 0,
+ 27, 223, 59, 99, 38, 225, 76, 77, 0, 27,
+ 223, 59, 99, 38, 225, 38, 225, 76, 77, 0,
+ 27, 223, 59, 99, 38, 225, 38, 225, 38, 228,
+ 76, 77, 0, 26, 97, 77, 0, 26, 50, 99,
+ 77, 0, 77, 0, 220, 0, 0, 19, 59, 113,
+ 76, 221, 208, 0, 21, 107, 38, 0, 21, 107,
+ 10, 107, 38, 0, 22, 38, 0, 97, 38, 0,
+ 0, 7, 0, 0, 99, 0, 0, 226, 0, 227,
+ 0, 226, 81, 227, 0, 9, 59, 99, 76, 0,
+ 115, 0, 228, 81, 115, 0, 0, 230, 231, 0,
+ 233, 76, 0, 0, 234, 77, 232, 231, 0, 1,
+ 76, 0, 0, 10, 0, 234, 0, 234, 81, 10,
+ 0, 235, 0, 234, 81, 235, 0, 125, 122, 167,
+ 142, 0, 125, 122, 168, 142, 0, 125, 122, 187,
+ 142, 0, 129, 122, 168, 142, 0, 129, 122, 187,
+ 142, 0, 0, 237, 238, 0, 231, 0, 239, 76,
+ 0, 3, 0, 239, 81, 3, 0, 97, 0, 240,
+ 81, 97, 0, 31, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 232, 237, 251, 253, 253, 254, 256, 258, 259, 267,
- 271, 282, 287, 292, 294, 296, 297, 298, 303, 310,
- 312, 317, 322, 328, 330, 335, 340, 346, 348, 353,
- 360, 362, 365, 367, 369, 371, 373, 375, 377, 381,
- 385, 388, 391, 394, 398, 400, 403, 406, 410, 438,
- 444, 447, 450, 453, 455, 459, 463, 467, 469, 472,
- 476, 503, 505, 507, 509, 511, 513, 515, 517, 519,
- 521, 523, 525, 527, 529, 533, 535, 539, 541, 544,
- 548, 550, 557, 560, 563, 569, 668, 669, 671, 677,
- 679, 693, 716, 718, 720, 724, 730, 732, 737, 739,
- 744, 746, 747, 757, 762, 764, 765, 766, 773, 779,
- 784, 787, 795, 800, 802, 803, 804, 811, 822, 826,
- 832, 837, 842, 847, 849, 851, 860, 863, 867, 869,
- 871, 876, 880, 883, 887, 890, 892, 904, 907, 909,
- 911, 915, 919, 921, 924, 937, 940, 944, 946, 954,
- 955, 956, 960, 962, 968, 969, 970, 973, 975, 978,
- 980, 983, 986, 992, 999, 1001, 1008, 1015, 1018, 1025,
- 1028, 1032, 1035, 1039, 1044, 1047, 1051, 1054, 1056, 1058,
- 1060, 1067, 1069, 1070, 1071, 1076, 1078, 1083, 1091, 1096,
- 1100, 1103, 1105, 1110, 1113, 1115, 1117, 1121, 1124, 1124,
- 1127, 1127, 1130, 1130, 1133, 1133, 1136, 1138, 1149, 1157,
- 1161, 1172, 1180, 1187, 1189, 1194, 1197, 1202, 1204, 1206,
- 1213, 1215, 1223, 1229, 1231, 1233, 1240, 1242, 1248, 1254,
- 1256, 1258, 1260, 1267, 1269, 1272, 1277, 1279, 1283, 1285,
- 1287, 1289, 1293, 1295, 1298, 1301, 1304, 1307, 1311, 1313,
- 1316, 1318, 1322, 1325, 1330, 1332, 1334, 1348, 1355, 1360,
- 1366, 1371, 1373, 1378, 1380, 1384, 1388, 1392, 1402, 1404,
- 1409, 1414, 1417, 1421, 1424, 1428, 1431, 1434, 1437, 1441,
- 1444, 1448, 1452, 1454, 1456, 1458, 1460, 1462, 1464, 1466,
- 1476, 1484, 1486, 1488, 1492, 1494, 1497, 1500, 1511, 1513,
- 1518, 1520, 1523, 1537, 1540, 1543, 1545, 1547, 1555, 1563,
- 1574, 1579, 1582, 1596, 1605, 1609, 1613, 1617, 1623, 1627,
- 1632, 1635, 1640, 1643, 1644, 1661, 1666, 1669, 1681, 1683,
- 1693, 1703, 1704, 1712, 1715, 1727, 1731, 1748, 1758, 1767,
- 1772, 1777, 1782, 1786, 1790, 1801, 1808, 1815, 1822, 1833,
- 1839, 1842, 1847, 1870, 1904, 1935, 1966, 1981, 1992, 1996,
- 2000, 2003, 2008, 2010, 2013, 2015, 2019, 2024, 2027, 2033,
- 2038, 2043, 2045, 2054, 2055, 2061, 2063, 2073, 2075, 2079,
- 2082, 2088, 2098, 2107, 2116, 2126, 2140, 2145, 2150, 2152,
- 2161, 2164, 2169, 2172, 2176
+ 233, 238, 252, 254, 254, 255, 257, 259, 260, 268,
+ 272, 283, 288, 293, 295, 297, 298, 299, 304, 311,
+ 313, 318, 323, 329, 331, 336, 341, 347, 349, 354,
+ 361, 363, 366, 368, 370, 372, 374, 376, 378, 382,
+ 386, 389, 392, 395, 399, 401, 404, 407, 411, 439,
+ 445, 448, 451, 454, 456, 460, 464, 468, 470, 473,
+ 477, 504, 506, 508, 510, 512, 514, 516, 518, 520,
+ 522, 524, 526, 528, 530, 534, 536, 540, 542, 545,
+ 549, 551, 558, 561, 564, 570, 669, 670, 672, 678,
+ 680, 694, 717, 719, 721, 725, 731, 733, 738, 740,
+ 745, 747, 748, 758, 763, 765, 766, 767, 774, 780,
+ 785, 788, 796, 801, 803, 804, 805, 812, 823, 827,
+ 833, 838, 843, 848, 850, 852, 861, 864, 868, 870,
+ 872, 877, 881, 884, 888, 891, 893, 905, 908, 910,
+ 912, 916, 920, 922, 925, 938, 941, 945, 947, 955,
+ 956, 957, 961, 963, 969, 970, 971, 974, 976, 979,
+ 981, 984, 987, 993, 1000, 1002, 1009, 1016, 1019, 1026,
+ 1029, 1033, 1036, 1040, 1045, 1048, 1052, 1055, 1057, 1059,
+ 1061, 1068, 1070, 1071, 1072, 1077, 1079, 1084, 1092, 1097,
+ 1101, 1104, 1106, 1111, 1114, 1116, 1118, 1122, 1125, 1125,
+ 1128, 1128, 1131, 1131, 1134, 1134, 1137, 1139, 1150, 1158,
+ 1162, 1173, 1181, 1188, 1190, 1195, 1198, 1203, 1205, 1207,
+ 1214, 1216, 1224, 1230, 1232, 1234, 1241, 1243, 1249, 1255,
+ 1257, 1259, 1261, 1268, 1270, 1273, 1276, 1280, 1283, 1287,
+ 1290, 1294, 1299, 1301, 1305, 1307, 1309, 1311, 1315, 1317,
+ 1320, 1323, 1326, 1329, 1333, 1335, 1338, 1340, 1344, 1347,
+ 1352, 1354, 1356, 1370, 1377, 1382, 1388, 1393, 1395, 1400,
+ 1402, 1406, 1410, 1414, 1424, 1426, 1431, 1436, 1439, 1443,
+ 1446, 1450, 1453, 1456, 1459, 1463, 1466, 1470, 1474, 1476,
+ 1478, 1480, 1482, 1484, 1486, 1488, 1498, 1506, 1508, 1510,
+ 1514, 1516, 1519, 1522, 1533, 1535, 1540, 1542, 1545, 1559,
+ 1562, 1565, 1567, 1569, 1577, 1585, 1596, 1601, 1604, 1618,
+ 1627, 1631, 1635, 1639, 1645, 1649, 1654, 1657, 1662, 1665,
+ 1666, 1683, 1688, 1691, 1703, 1705, 1715, 1725, 1726, 1734,
+ 1737, 1749, 1753, 1770, 1780, 1789, 1794, 1799, 1804, 1808,
+ 1812, 1823, 1830, 1837, 1844, 1855, 1861, 1864, 1869, 1892,
+ 1926, 1957, 1988, 2003, 2014, 2018, 2022, 2025, 2030, 2032,
+ 2035, 2037, 2041, 2046, 2049, 2055, 2060, 2065, 2067, 2076,
+ 2077, 2083, 2085, 2095, 2097, 2101, 2104, 2110, 2120, 2129,
+ 2138, 2148, 2162, 2167, 2172, 2174, 2183, 2186, 2191, 2194,
+ 2198
};
#endif
@@ -421,17 +425,18 @@ static const char * const yytname[] = { "$","error","$undefined.","IDENTIFIER"
"attrib","any_word","init","@18","initlist_maybe_comma","initlist1","initelt",
"@19","@20","@21","@22","@23","@24","nested_function","@25","@26","notype_nested_function",
"@27","@28","declarator","after_type_declarator","parm_declarator","notype_declarator",
-"structsp","@29","@30","@31","@32","maybecomma","maybecomma_warn","component_decl_list",
-"component_decl_list2","component_decl","components","component_declarator",
-"enumlist","enumerator","typename","absdcl","nonempty_type_quals","type_quals",
-"absdcl1","stmts","lineno_stmt_or_labels","xstmts","errstmt","pushlevel","maybe_label_decls",
-"label_decls","label_decl","compstmt_or_error","compstmt_start","compstmt","simple_if",
-"if_prefix","do_stmt_start","@33","save_filename","save_lineno","lineno_labeled_stmt",
-"lineno_stmt_or_label","stmt_or_label","stmt","@34","@35","@36","@37","@38",
-"@39","@40","all_iter_stmt","all_iter_stmt_simple","@41","label","maybe_type_qual",
-"xexpr","asm_operands","nonnull_asm_operands","asm_operand","asm_clobbers","parmlist",
-"@42","parmlist_1","@43","parmlist_2","parms","parm","parmlist_or_identifiers",
-"@44","parmlist_or_identifiers_1","identifiers","identifiers_or_typenames","extension", NULL
+"struct_head","union_head","enum_head","structsp","@29","@30","@31","@32","maybecomma",
+"maybecomma_warn","component_decl_list","component_decl_list2","component_decl",
+"components","component_declarator","enumlist","enumerator","typename","absdcl",
+"nonempty_type_quals","type_quals","absdcl1","stmts","lineno_stmt_or_labels",
+"xstmts","errstmt","pushlevel","maybe_label_decls","label_decls","label_decl",
+"compstmt_or_error","compstmt_start","compstmt","simple_if","if_prefix","do_stmt_start",
+"@33","save_filename","save_lineno","lineno_labeled_stmt","lineno_stmt_or_label",
+"stmt_or_label","stmt","@34","@35","@36","@37","@38","@39","@40","all_iter_stmt",
+"all_iter_stmt_simple","@41","label","maybe_type_qual","xexpr","asm_operands",
+"nonnull_asm_operands","asm_operand","asm_clobbers","parmlist","@42","parmlist_1",
+"@43","parmlist_2","parms","parm","parmlist_or_identifiers","@44","parmlist_or_identifiers_1",
+"identifiers","identifiers_or_typenames","extension", NULL
};
#endif
@@ -459,23 +464,24 @@ static const short yyr1[] = { 0,
152, 156, 152, 157, 152, 158, 152, 160, 161, 159,
163, 164, 162, 165, 165, 166, 166, 166, 166, 166,
166, 166, 167, 167, 167, 167, 167, 167, 168, 168,
- 168, 168, 168, 168, 168, 170, 169, 169, 169, 171,
- 169, 169, 169, 172, 169, 173, 169, 169, 174, 174,
- 175, 175, 176, 176, 177, 177, 177, 178, 178, 178,
- 178, 178, 178, 179, 179, 180, 180, 180, 181, 181,
- 181, 182, 182, 183, 183, 184, 184, 185, 185, 186,
- 186, 187, 187, 187, 187, 187, 187, 187, 187, 187,
- 188, 189, 189, 189, 190, 190, 191, 192, 193, 193,
- 194, 194, 195, 196, 196, 197, 198, 198, 198, 198,
- 199, 199, 200, 202, 201, 203, 204, 205, 205, 206,
- 207, 207, 208, 208, 208, 209, 208, 208, 208, 210,
- 211, 208, 208, 208, 212, 213, 214, 208, 215, 208,
- 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
- 208, 216, 218, 217, 219, 219, 219, 219, 220, 220,
- 221, 221, 222, 222, 223, 223, 224, 225, 225, 227,
- 226, 228, 229, 228, 228, 230, 230, 230, 230, 231,
- 231, 232, 232, 232, 232, 232, 234, 233, 235, 235,
- 236, 236, 237, 237, 238
+ 168, 168, 168, 168, 168, 169, 169, 170, 170, 171,
+ 171, 173, 172, 172, 172, 174, 172, 172, 172, 175,
+ 172, 176, 172, 172, 177, 177, 178, 178, 179, 179,
+ 180, 180, 180, 181, 181, 181, 181, 181, 181, 182,
+ 182, 183, 183, 183, 184, 184, 184, 185, 185, 186,
+ 186, 187, 187, 188, 188, 189, 189, 190, 190, 190,
+ 190, 190, 190, 190, 190, 190, 191, 192, 192, 192,
+ 193, 193, 194, 195, 196, 196, 197, 197, 198, 199,
+ 199, 200, 201, 201, 201, 201, 202, 202, 203, 205,
+ 204, 206, 207, 208, 208, 209, 210, 210, 211, 211,
+ 211, 212, 211, 211, 211, 213, 214, 211, 211, 211,
+ 215, 216, 217, 211, 218, 211, 211, 211, 211, 211,
+ 211, 211, 211, 211, 211, 211, 211, 219, 221, 220,
+ 222, 222, 222, 222, 223, 223, 224, 224, 225, 225,
+ 226, 226, 227, 228, 228, 230, 229, 231, 232, 231,
+ 231, 233, 233, 233, 233, 234, 234, 235, 235, 235,
+ 235, 235, 237, 236, 238, 238, 239, 239, 240, 240,
+ 241
};
static const short yyr2[] = { 0,
@@ -502,561 +508,547 @@ static const short yyr2[] = { 0,
6, 0, 5, 0, 4, 0, 5, 0, 0, 5,
0, 0, 5, 1, 1, 3, 3, 4, 3, 3,
3, 1, 3, 4, 3, 3, 3, 1, 3, 3,
- 3, 4, 3, 3, 1, 0, 7, 5, 2, 0,
- 7, 5, 2, 0, 8, 0, 7, 2, 0, 1,
- 0, 1, 1, 2, 0, 3, 2, 3, 1, 3,
- 1, 1, 2, 1, 3, 4, 6, 5, 1, 3,
- 1, 1, 3, 2, 2, 0, 1, 1, 2, 0,
- 2, 3, 3, 2, 3, 4, 3, 2, 3, 2,
- 1, 1, 2, 2, 0, 1, 2, 0, 0, 1,
- 1, 2, 3, 1, 2, 1, 2, 6, 5, 5,
- 2, 2, 4, 0, 4, 0, 0, 3, 4, 3,
- 1, 1, 1, 1, 2, 0, 4, 1, 3, 0,
- 0, 7, 5, 2, 0, 0, 0, 12, 0, 6,
- 2, 2, 2, 3, 6, 8, 10, 12, 3, 4,
- 1, 1, 0, 6, 3, 5, 2, 2, 0, 1,
- 0, 1, 0, 1, 1, 3, 4, 1, 3, 0,
- 2, 2, 0, 4, 2, 0, 1, 1, 3, 1,
- 3, 4, 4, 4, 4, 4, 0, 2, 1, 2,
- 1, 3, 1, 3, 1
+ 3, 4, 3, 3, 1, 1, 2, 1, 2, 1,
+ 2, 0, 7, 5, 2, 0, 7, 5, 2, 0,
+ 8, 0, 7, 2, 0, 1, 0, 1, 1, 2,
+ 0, 3, 2, 3, 1, 3, 1, 1, 2, 1,
+ 3, 4, 6, 5, 1, 3, 1, 1, 3, 2,
+ 2, 0, 1, 1, 2, 0, 2, 3, 3, 2,
+ 3, 4, 3, 2, 3, 2, 1, 1, 2, 2,
+ 0, 1, 2, 0, 0, 1, 1, 2, 3, 1,
+ 2, 1, 2, 6, 5, 5, 2, 2, 4, 0,
+ 4, 0, 0, 3, 4, 3, 1, 1, 1, 1,
+ 2, 0, 4, 1, 3, 0, 0, 7, 5, 2,
+ 0, 0, 0, 12, 0, 6, 2, 2, 2, 3,
+ 6, 8, 10, 12, 3, 4, 1, 1, 0, 6,
+ 3, 5, 2, 2, 0, 1, 0, 1, 0, 1,
+ 1, 3, 4, 1, 3, 0, 2, 2, 0, 4,
+ 2, 0, 1, 1, 3, 1, 3, 4, 4, 4,
+ 4, 4, 0, 2, 1, 2, 1, 3, 1, 3,
+ 1
};
static const short yydefact[] = { 3,
- 5, 0, 0, 0, 152, 143, 150, 142, 0, 0,
- 0, 0, 0, 0, 395, 18, 4, 8, 7, 0,
- 118, 118, 138, 129, 139, 172, 151, 0, 6, 16,
- 17, 31, 32, 246, 248, 255, 239, 255, 243, 0,
- 0, 0, 235, 280, 0, 0, 160, 119, 0, 15,
- 0, 14, 0, 140, 129, 141, 145, 144, 127, 173,
- 10, 0, 244, 0, 0, 236, 0, 240, 86, 87,
- 99, 56, 57, 0, 0, 0, 33, 35, 34, 0,
- 36, 37, 0, 38, 39, 0, 0, 40, 58, 0,
- 0, 62, 43, 45, 88, 0, 278, 0, 276, 148,
- 0, 276, 177, 0, 0, 11, 0, 0, 30, 0,
- 387, 0, 0, 170, 222, 280, 0, 0, 158, 119,
- 0, 214, 215, 0, 0, 128, 131, 155, 156, 130,
- 132, 157, 271, 272, 251, 269, 0, 170, 262, 257,
- 118, 254, 118, 0, 255, 170, 255, 54, 55, 49,
- 46, 0, 0, 0, 0, 48, 0, 0, 0, 50,
- 0, 52, 0, 0, 79, 77, 75, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
- 98, 0, 0, 41, 0, 100, 47, 153, 280, 370,
- 0, 274, 277, 146, 154, 279, 148, 275, 183, 184,
- 185, 182, 0, 175, 178, 281, 231, 230, 161, 162,
- 234, 0, 229, 0, 233, 0, 0, 28, 0, 316,
- 106, 317, 169, 171, 0, 0, 13, 0, 0, 22,
- 0, 170, 387, 0, 12, 26, 0, 0, 252, 0,
- 251, 238, 316, 256, 316, 263, 0, 242, 0, 90,
- 89, 306, 298, 0, 0, 9, 44, 0, 0, 85,
- 84, 0, 0, 0, 0, 73, 74, 72, 71, 70,
- 68, 69, 63, 64, 65, 66, 67, 96, 95, 0,
- 42, 0, 284, 0, 288, 0, 290, 0, 370, 0,
- 149, 147, 0, 177, 41, 0, 0, 391, 377, 118,
- 118, 389, 0, 378, 380, 388, 0, 232, 297, 0,
- 108, 103, 107, 0, 167, 220, 216, 159, 221, 20,
- 166, 217, 219, 0, 24, 273, 270, 170, 0, 258,
- 264, 317, 260, 170, 170, 307, 299, 92, 60, 59,
- 51, 53, 0, 0, 78, 76, 93, 94, 283, 282,
- 371, 289, 285, 287, 0, 174, 176, 86, 0, 163,
- 375, 276, 276, 372, 373, 0, 390, 0, 0, 29,
- 304, 104, 118, 118, 135, 0, 0, 164, 218, 0,
- 247, 170, 316, 0, 237, 241, 0, 0, 300, 301,
- 0, 80, 83, 286, 179, 0, 181, 228, 280, 370,
- 119, 170, 170, 170, 280, 170, 170, 0, 379, 381,
- 392, 305, 111, 0, 112, 0, 135, 133, 189, 187,
- 186, 168, 21, 0, 25, 245, 265, 0, 170, 393,
- 0, 0, 0, 316, 0, 0, 115, 317, 292, 302,
- 197, 86, 0, 0, 195, 0, 194, 0, 249, 192,
- 0, 0, 284, 0, 387, 0, 382, 383, 384, 284,
- 385, 386, 374, 0, 0, 162, 134, 137, 136, 0,
- 165, 170, 0, 266, 303, 0, 309, 117, 116, 296,
- 0, 310, 294, 317, 293, 0, 0, 0, 0, 204,
- 61, 0, 191, 81, 180, 226, 280, 227, 223, 225,
- 0, 109, 110, 0, 268, 170, 394, 308, 0, 152,
- 0, 330, 314, 0, 0, 0, 0, 0, 0, 0,
- 0, 359, 351, 0, 0, 113, 118, 118, 323, 328,
- 0, 0, 320, 321, 324, 352, 322, 0, 206, 0,
- 202, 0, 0, 193, 0, 224, 188, 267, 0, 0,
- 316, 361, 0, 0, 357, 341, 342, 343, 0, 0,
- 0, 360, 0, 358, 325, 124, 0, 125, 0, 0,
- 312, 317, 311, 334, 0, 126, 0, 0, 200, 0,
- 196, 205, 0, 0, 0, 362, 45, 0, 0, 0,
- 355, 344, 0, 349, 0, 0, 122, 208, 0, 123,
- 211, 329, 316, 0, 0, 207, 0, 0, 203, 313,
- 0, 315, 353, 335, 339, 0, 350, 0, 120, 0,
- 121, 0, 327, 318, 316, 0, 198, 201, 331, 316,
- 361, 316, 356, 363, 0, 209, 212, 319, 333, 0,
- 316, 354, 0, 340, 0, 0, 364, 365, 345, 0,
- 0, 199, 332, 336, 0, 363, 0, 0, 210, 213,
- 361, 0, 0, 346, 366, 0, 367, 0, 0, 337,
- 368, 0, 347, 316, 0, 0, 338, 348, 369, 0,
- 0, 0
+ 5, 0, 0, 0, 152, 143, 150, 142, 240, 236,
+ 238, 0, 0, 0, 401, 18, 4, 8, 7, 0,
+ 118, 118, 138, 129, 139, 172, 0, 0, 0, 151,
+ 0, 6, 16, 17, 241, 237, 239, 0, 0, 0,
+ 235, 286, 0, 0, 160, 119, 0, 15, 0, 14,
+ 0, 140, 129, 141, 145, 144, 127, 173, 31, 32,
+ 261, 245, 261, 249, 252, 254, 10, 86, 87, 99,
+ 56, 57, 0, 0, 0, 33, 35, 34, 0, 36,
+ 37, 0, 38, 39, 0, 0, 40, 58, 0, 0,
+ 62, 43, 45, 88, 0, 284, 0, 282, 148, 0,
+ 282, 177, 0, 0, 11, 0, 0, 30, 0, 393,
+ 0, 0, 170, 222, 286, 0, 0, 158, 119, 0,
+ 214, 215, 0, 0, 128, 131, 155, 156, 130, 132,
+ 157, 0, 0, 242, 0, 246, 0, 250, 54, 55,
+ 49, 46, 0, 0, 0, 0, 48, 0, 0, 0,
+ 50, 0, 52, 0, 0, 79, 77, 75, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 97, 98, 0, 0, 41, 0, 100, 47, 153, 286,
+ 376, 0, 280, 283, 146, 154, 285, 148, 281, 183,
+ 184, 185, 182, 0, 175, 178, 287, 231, 230, 161,
+ 162, 234, 0, 229, 0, 233, 0, 0, 28, 0,
+ 322, 106, 323, 169, 171, 0, 0, 13, 0, 0,
+ 22, 0, 170, 393, 0, 12, 26, 0, 170, 268,
+ 263, 118, 260, 118, 0, 261, 170, 261, 277, 278,
+ 257, 275, 0, 90, 89, 312, 304, 0, 0, 9,
+ 44, 0, 0, 85, 84, 0, 0, 0, 0, 73,
+ 74, 72, 71, 70, 68, 69, 63, 64, 65, 66,
+ 67, 96, 95, 0, 42, 0, 290, 0, 294, 0,
+ 296, 0, 376, 0, 149, 147, 0, 177, 41, 0,
+ 0, 397, 383, 118, 118, 395, 0, 384, 386, 394,
+ 0, 232, 303, 0, 108, 103, 107, 0, 167, 220,
+ 216, 159, 221, 20, 166, 217, 219, 0, 24, 244,
+ 322, 262, 322, 269, 0, 248, 0, 0, 258, 0,
+ 257, 313, 305, 92, 60, 59, 51, 53, 0, 0,
+ 78, 76, 93, 94, 289, 288, 377, 295, 291, 293,
+ 0, 174, 176, 86, 0, 163, 381, 282, 282, 378,
+ 379, 0, 396, 0, 0, 29, 310, 104, 118, 118,
+ 135, 0, 0, 164, 218, 0, 264, 270, 323, 266,
+ 170, 170, 279, 276, 170, 0, 0, 0, 306, 307,
+ 0, 80, 83, 292, 179, 0, 181, 228, 286, 376,
+ 119, 170, 170, 170, 286, 170, 170, 0, 385, 387,
+ 398, 311, 111, 0, 112, 0, 135, 133, 189, 187,
+ 186, 168, 21, 0, 25, 322, 0, 243, 247, 253,
+ 170, 399, 0, 0, 0, 322, 0, 0, 115, 323,
+ 298, 308, 197, 86, 0, 0, 195, 0, 194, 0,
+ 255, 192, 0, 0, 290, 0, 393, 0, 388, 389,
+ 390, 290, 391, 392, 380, 0, 0, 162, 134, 137,
+ 136, 0, 165, 271, 0, 170, 251, 309, 0, 315,
+ 117, 116, 302, 0, 316, 300, 323, 299, 0, 0,
+ 0, 0, 204, 61, 0, 191, 81, 180, 226, 286,
+ 227, 223, 225, 0, 109, 110, 0, 170, 0, 272,
+ 400, 314, 0, 152, 0, 336, 320, 0, 0, 0,
+ 0, 0, 0, 0, 0, 365, 357, 0, 0, 113,
+ 118, 118, 329, 334, 0, 0, 326, 327, 330, 358,
+ 328, 0, 206, 0, 202, 0, 0, 193, 0, 224,
+ 188, 274, 170, 0, 0, 322, 367, 0, 0, 363,
+ 347, 348, 349, 0, 0, 0, 366, 0, 364, 331,
+ 124, 0, 125, 0, 0, 318, 323, 317, 340, 0,
+ 126, 0, 0, 200, 0, 196, 205, 273, 0, 0,
+ 0, 368, 45, 0, 0, 0, 361, 350, 0, 355,
+ 0, 0, 122, 208, 0, 123, 211, 335, 322, 0,
+ 0, 207, 0, 0, 203, 319, 0, 321, 359, 341,
+ 345, 0, 356, 0, 120, 0, 121, 0, 333, 324,
+ 322, 0, 198, 201, 337, 322, 367, 322, 362, 369,
+ 0, 209, 212, 325, 339, 0, 322, 360, 0, 346,
+ 0, 0, 370, 371, 351, 0, 0, 199, 338, 342,
+ 0, 369, 0, 0, 210, 213, 367, 0, 0, 352,
+ 372, 0, 373, 0, 0, 343, 374, 0, 353, 322,
+ 0, 0, 344, 354, 375, 0, 0, 0
};
-static const short yydefgoto[] = { 680,
- 1, 2, 3, 17, 18, 19, 231, 377, 237, 380,
- 113, 310, 446, 86, 153, 280, 88, 89, 90, 91,
- 92, 391, 93, 265, 264, 262, 451, 263, 94, 154,
- 95, 218, 219, 220, 372, 433, 434, 20, 108, 526,
- 300, 59, 373, 418, 301, 23, 99, 194, 24, 130,
- 118, 46, 114, 119, 424, 47, 376, 223, 224, 26,
- 203, 204, 205, 422, 470, 448, 449, 450, 489, 640,
- 608, 580, 543, 577, 597, 620, 650, 600, 622, 651,
- 210, 122, 496, 123, 27, 145, 147, 137, 62, 493,
- 240, 64, 65, 142, 330, 331, 135, 136, 101, 192,
- 102, 104, 193, 435, 436, 481, 221, 337, 388, 389,
- 390, 370, 253, 371, 530, 531, 532, 551, 572, 314,
- 573, 439, 533, 534, 603, 550, 641, 631, 661, 674,
- 632, 535, 536, 630, 537, 563, 588, 646, 647, 648,
- 672, 285, 286, 302, 408, 303, 304, 305, 213, 214,
- 306, 307, 431, 96
+static const short yydefgoto[] = { 686,
+ 1, 2, 3, 17, 18, 19, 222, 373, 228, 376,
+ 112, 304, 448, 85, 144, 274, 87, 88, 89, 90,
+ 91, 391, 92, 259, 258, 256, 453, 257, 93, 145,
+ 94, 209, 210, 211, 368, 435, 436, 20, 107, 530,
+ 294, 57, 369, 418, 295, 23, 98, 185, 24, 129,
+ 117, 44, 113, 118, 424, 45, 372, 214, 215, 26,
+ 194, 195, 196, 422, 472, 450, 451, 452, 492, 646,
+ 614, 585, 547, 582, 603, 626, 656, 606, 628, 657,
+ 201, 121, 499, 122, 27, 28, 29, 30, 236, 238,
+ 243, 137, 496, 330, 132, 133, 233, 377, 378, 241,
+ 242, 100, 183, 101, 103, 184, 437, 438, 484, 212,
+ 333, 388, 389, 390, 366, 247, 367, 534, 535, 536,
+ 556, 577, 308, 578, 441, 537, 538, 609, 555, 647,
+ 637, 667, 680, 638, 539, 540, 636, 541, 568, 594,
+ 652, 653, 654, 678, 279, 280, 296, 408, 297, 298,
+ 299, 204, 205, 300, 301, 433, 95
};
-static const short yypact[] = { 66,
- 82, 2070, 2070, 286,-32768,-32768,-32768,-32768, 77, 84,
- 103, 30, 55, 79,-32768,-32768,-32768,-32768,-32768, 60,
- 113, 405, 142,-32768, 183,-32768,-32768, 2070,-32768,-32768,
--32768,-32768,-32768,-32768, 163,-32768, 170,-32768, 173, 1932,
- 1866, 165,-32768,-32768, 60, 35,-32768, 183, 589,-32768,
- 530,-32768, 60, 142,-32768, 183,-32768,-32768, 1138,-32768,
--32768, 458,-32768, 192, 267,-32768, 200,-32768,-32768,-32768,
--32768,-32768,-32768, 1932, 1932, 229,-32768,-32768,-32768, 1932,
--32768,-32768, 850,-32768,-32768, 1932, 206, 211,-32768, 1959,
- 1986,-32768, 2136, 366, 288, 1932,-32768, 243, 161,-32768,
- 271, 438, 842, 237, 150,-32768, 530, 60,-32768, 254,
--32768, 1408, 361, 183,-32768,-32768, 530, 106,-32768, 183,
- 732, 389, 413, 112, 1354, 1138,-32768,-32768,-32768,-32768,
- 183,-32768,-32768, 318, 297,-32768, 458, 183,-32768,-32768,
- 412, 306, 639, 824,-32768, 183,-32768,-32768,-32768,-32768,
--32768, 315, 321, 322, 331,-32768, 352, 1932, 850,-32768,
- 850,-32768, 1932, 1932, 401,-32768,-32768, 1932, 1932, 1932,
- 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932,-32768,
--32768, 229, 229, 1932, 1932,-32768,-32768,-32768,-32768, 161,
- 1421,-32768, 442, 648,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, 93,-32768, 394,-32768, 413,-32768,-32768, 443,
- 413, 466,-32768, 907,-32768, 377, 407,-32768, 323, 59,
--32768,-32768, 456, 183, 199, 283,-32768, 530, 530,-32768,
- 361, 183,-32768, 1474,-32768,-32768, 361, 1932, 229, 400,
- 297,-32768,-32768,-32768,-32768,-32768, 409,-32768, 416,-32768,
--32768,-32768, 418, 423, 1755,-32768, 2136, 427, 432, 2136,
- 2136, 1932, 479, 1932, 1932, 1725, 2193, 1903, 1130, 1357,
- 960, 960, 455, 455,-32768,-32768,-32768,-32768,-32768, 450,
- 211, 448, 310, 296,-32768, 628,-32768, 457,-32768, 1487,
--32768, 648, 465, 842, 2013, 52, 467,-32768,-32768,-32768,
- 1088,-32768, 470, 257,-32768,-32768, 154,-32768,-32768, 57,
--32768,-32768,-32768, 861,-32768, 389,-32768,-32768, 389,-32768,
- 512,-32768,-32768, 468,-32768, 2136,-32768, 183, 475, 473,
--32768,-32768, 473, 183, 183,-32768, 526,-32768,-32768,-32768,
--32768,-32768, 523, 1932, 2171, 2183,-32768,-32768, 442,-32768,
--32768,-32768,-32768,-32768, 482,-32768,-32768, 209, 490,-32768,
--32768, 177, 67,-32768,-32768, 1058,-32768, 576, 322,-32768,
--32768,-32768, 505, 451,-32768, 1343, 57,-32768,-32768, 57,
--32768, 183,-32768, 261,-32768,-32768, 229, 944, 526,-32768,
- 1163,-32768, 2065,-32768,-32768, 1932,-32768,-32768,-32768, 67,
- 183, 137, 242, 183,-32768, 242, 183, 628,-32768,-32768,
--32768,-32768,-32768, 530,-32768, 60,-32768, 387,-32768,-32768,
- 2136,-32768,-32768, 1343,-32768,-32768,-32768, 1932, 187,-32768,
- 276, 433, 672, 507, 508, 762,-32768,-32768,-32768,-32768,
--32768, 549, 229, 1932,-32768, 550, 2136, 514, 516,-32768,
- 1932, 250, 188, 609,-32768, 1540,-32768,-32768,-32768, 216,
--32768,-32768,-32768, 309, 325, 155, 387,-32768,-32768, 1163,
--32768, 1642, 1932,-32768,-32768, 229,-32768,-32768,-32768,-32768,
- 520,-32768,-32768,-32768,-32768, 1621, 564, 2109, 1163,-32768,
--32768, 1223,-32768, 2065,-32768, 459,-32768, 459,-32768,-32768,
- 524,-32768,-32768, 532,-32768, 1642,-32768,-32768, 1701, 573,
- 555,-32768,-32768, 559, 561, 1932, 584, 546, 547, 1879,
- 201, 619,-32768, 590, 553,-32768, 567, 794,-32768, 611,
- 1026, 61,-32768,-32768,-32768,-32768,-32768, 1812,-32768, 1932,
- 600, 569, 1283,-32768, 302,-32768,-32768,-32768, 1932, 591,
--32768, 1932, 1932, 1565,-32768,-32768,-32768,-32768, 580, 1932,
- 588,-32768, 610,-32768,-32768,-32768, 530,-32768, 60, 1106,
--32768,-32768,-32768,-32768, 1932,-32768, 1283, 2091,-32768, 1283,
--32768,-32768, 596, 1932, 665,-32768, 868, 630, 612, 1932,
--32768,-32768, 632,-32768, 1932, 350,-32768, 227, 355,-32768,
- 955,-32768,-32768, 1701, 634,-32768, 675, 1283,-32768,-32768,
- 637,-32768,-32768,-32768,-32768, 2158,-32768, 39,-32768, 361,
--32768, 361,-32768,-32768,-32768, 641,-32768,-32768,-32768,-32768,
- 1932,-32768,-32768, 705, 642,-32768,-32768,-32768,-32768, 1283,
--32768,-32768, 646,-32768, 666, 47, 643,-32768,-32768, 322,
- 322,-32768,-32768,-32768, 1932, 705, 651, 705,-32768,-32768,
- 1932, 653, 48,-32768,-32768, 654,-32768, 466, 655,-32768,
- 288, 303,-32768,-32768, 657, 466,-32768,-32768, 288, 735,
- 740,-32768
+static const short yypact[] = { 93,
+ 154, 1950, 1950, 173,-32768,-32768,-32768,-32768, 130, 130,
+ 130, 143, 166, 215,-32768,-32768,-32768,-32768,-32768, 554,
+ 87, 336, 318,-32768, 130,-32768, 80, 83, 88,-32768,
+ 1950,-32768,-32768,-32768, 130, 130, 130, 1812, 1746, 228,
+-32768,-32768, 554, 111,-32768, 130, 387,-32768, 327,-32768,
+ 554, 318,-32768, 130,-32768,-32768, 858,-32768,-32768,-32768,
+-32768, 257,-32768, 265,-32768, 283,-32768,-32768,-32768,-32768,
+-32768,-32768, 1812, 1812, 290,-32768,-32768,-32768, 1812,-32768,
+-32768, 567,-32768,-32768, 1812, 136, 235,-32768, 1839, 1866,
+-32768, 2137, 1030, 326, 1812,-32768, 292, 20,-32768, 296,
+ 1483, 975, 428, 29,-32768, 327, 554,-32768, 323,-32768,
+ 1288, 808, 130,-32768,-32768, 327, 114,-32768, 130, 626,
+ 243, 253, 151, 1234, 858,-32768,-32768,-32768,-32768, 130,
+-32768, 332, 885,-32768, 334,-32768, 436,-32768,-32768,-32768,
+-32768,-32768, 328, 340, 347, 342,-32768, 359, 1812, 567,
+-32768, 567,-32768, 1812, 1812, 407,-32768,-32768, 1812, 1812,
+ 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812,
+-32768,-32768, 290, 290, 1812, 1812,-32768,-32768,-32768,-32768,
+ 20, 1301,-32768, 321, 1036,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768, 92,-32768, 389,-32768, 253,-32768,-32768,
+ 430, 253, 450,-32768, 963,-32768, 380, 395,-32768, 728,
+ 49,-32768,-32768, 438, 130, 207, 141,-32768, 327, 327,
+-32768, 808, 130,-32768, 1354,-32768,-32768, 808, 130,-32768,
+-32768, 376, 408, 1954, 2122,-32768, 130,-32768,-32768, 455,
+ 412,-32768, 436,-32768,-32768,-32768, 421, 442, 1635,-32768,
+ 2137, 447, 448, 2137, 2137, 1812, 492, 1812, 1812, 1605,
+ 2159, 1783, 463, 1237, 973, 973, 310, 310,-32768,-32768,
+-32768,-32768,-32768, 458, 235, 452, 48, 374,-32768, 1558,
+-32768, 461,-32768, 1367,-32768, 1036, 465, 975, 1893, 57,
+ 469,-32768,-32768,-32768, 1452,-32768, 473, 159,-32768,-32768,
+ 102,-32768,-32768, 52,-32768,-32768,-32768, 1533,-32768, 243,
+-32768,-32768, 243,-32768, 495,-32768,-32768, 471,-32768,-32768,
+-32768,-32768,-32768,-32768, 478,-32768, 486, 1812, 290, 488,
+ 412,-32768, 533,-32768,-32768,-32768,-32768,-32768, 529, 1812,
+ 2097, 2149,-32768,-32768, 321,-32768,-32768,-32768,-32768,-32768,
+ 494,-32768,-32768, 104, 506,-32768,-32768, 348, 269,-32768,
+-32768, 638,-32768, 584, 347,-32768,-32768,-32768, 512, 192,
+-32768, 1223, 52,-32768,-32768, 52, 509,-32768,-32768, 509,
+ 130, 130, 2137,-32768, 130, 514, 290, 746, 533,-32768,
+ 1043,-32768, 1974,-32768,-32768, 1812,-32768,-32768,-32768, 269,
+ 130, 149, 203, 130,-32768, 203, 130, 1558,-32768,-32768,
+-32768,-32768,-32768, 327,-32768, 554,-32768, 785,-32768,-32768,
+ 2137,-32768,-32768, 1223,-32768,-32768, 294,-32768,-32768,-32768,
+ 130,-32768, 161, 393, 666, 515, 516, 826,-32768,-32768,
+-32768,-32768,-32768, 559, 290, 1812,-32768, 564, 2137, 525,
+ 524,-32768, 1812, 153, 402, 892,-32768, 1420,-32768,-32768,
+-32768, 487,-32768,-32768,-32768, 171, 179, 50, 785,-32768,
+-32768, 1043,-32768,-32768, 1812, 91,-32768,-32768, 290,-32768,
+-32768,-32768,-32768, 528,-32768,-32768,-32768,-32768, 1501, 573,
+ 1998, 1043,-32768,-32768, 1103,-32768, 1974,-32768, 424,-32768,
+ 424,-32768,-32768, 531,-32768,-32768, 534, 2047, 1812,-32768,
+-32768,-32768, 1581, 580, 560,-32768,-32768, 561, 565, 1812,
+ 590, 557, 558, 1759, 144, 630,-32768, 603, 578,-32768,
+ 581, 1982,-32768, 641, 906, 56,-32768,-32768,-32768,-32768,
+-32768, 1692,-32768, 1812, 623, 583, 1163,-32768, 781,-32768,
+-32768,-32768, 2047, 1812, 605,-32768, 1812, 1812, 2070,-32768,
+-32768,-32768,-32768, 588, 1812, 599,-32768, 643,-32768,-32768,
+-32768, 327,-32768, 554, 986,-32768,-32768,-32768,-32768, 1812,
+-32768, 1163, 2021,-32768, 1163,-32768,-32768,-32768, 606, 1812,
+ 687,-32768, 422, 628, 634, 1812,-32768,-32768, 636,-32768,
+ 1812, 223,-32768, 349, 234,-32768, 1001,-32768,-32768, 1581,
+ 635,-32768, 681, 1163,-32768,-32768, 642,-32768,-32768,-32768,
+-32768, 2119,-32768, 36,-32768, 808,-32768, 808,-32768,-32768,
+-32768, 645,-32768,-32768,-32768,-32768, 1812,-32768,-32768, 710,
+ 646,-32768,-32768,-32768,-32768, 1163,-32768,-32768, 647,-32768,
+ 667, 43, 650,-32768,-32768, 347, 347,-32768,-32768,-32768,
+ 1812, 710, 651, 710,-32768,-32768, 1812, 660, 61,-32768,
+-32768, 661,-32768, 450, 662,-32768, 326, 168,-32768,-32768,
+ 701, 450,-32768,-32768, 326, 727, 782,-32768
};
static const short yypgoto[] = {-32768,
--32768,-32768,-32768, 65,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, -5,-32768, -40, 446, -137, 424,-32768,-32768,
- -55,-32768, 399,-32768,-32768,-32768,-32768,-32768, 190,-32768,
- -191, -207, 527,-32768,-32768, 314,-32768, 22, -98, 215,
- 0, 700,-32768, 339, 7, -7, -15, 560, 11, -149,
- -366, -45, -107, -52,-32768,-32768,-32768, 202, 14, 53,
--32768, 464,-32768, 337,-32768, -378,-32768, -409,-32768,-32768,
+-32768,-32768,-32768, 73,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, -24,-32768, -38, 498, -123, 432,-32768,-32768,
+ -10,-32768, 116,-32768,-32768,-32768,-32768,-32768, 224,-32768,
+ -178, -204, 572,-32768,-32768, 357,-32768, 27, -93, 260,
+ 8, 750,-32768, 390, 13, 1, -72, 616, 19, -151,
+ -386, -49, -101, -63,-32768,-32768,-32768, -48, 11, 105,
+-32768, 518,-32768, 384,-32768, -376,-32768, -424,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- -38, -68, -298, -13, -30,-32768,-32768,-32768,-32768,-32768,
- 528, 41,-32768, 620, 522, 391, 635, 537, 1, -79,
- -11, -89, -139, 344,-32768,-32768, -180,-32768,-32768,-32768,
- 403, -278,-32768, -128,-32768,-32768,-32768,-32768, -95, -286,
- -495, 358,-32768, 193,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 214,-32768, -556, 147,-32768, 146,
--32768, 531,-32768, -233,-32768,-32768,-32768, 449, -195,-32768,
--32768,-32768,-32768, 9
+ -43, -44, -311, -13,-32768,-32768,-32768, -28,-32768,-32768,
+-32768,-32768,-32768, 485, -23,-32768, 582, 496, 392, 589,
+ 504, -26, -69, -68, -98, -145, 388,-32768,-32768, -143,
+-32768,-32768,-32768, 449, -230,-32768, -118,-32768,-32768,-32768,
+-32768, -100, -334, -454, 401,-32768, 232,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, 244,-32768, -542,
+ 194,-32768, 197,-32768, 575,-32768, -234,-32768,-32768,-32768,
+ 500, -189,-32768,-32768,-32768,-32768, 6
};
-#define YYLAST 2245
-
-
-static const short yytable[] = { 87,
- 98, 21, 21, 35, 37, 39, 49, 124, 22, 22,
- 28, 28, 121, 232, 54, 25, 25, 222, 148, 149,
- 296, 229, 198, 320, 151, 254, 225, 21, 132, 325,
- 156, 105, 55, 48, 22, 56, 28, 322, 311, 125,
- 187, 25, 51, 53, 291, 384, 281, 464, 226, 141,
- 284, 100, 351, 143, 209, 585, 134, 369, 48, -102,
- 186, 574, 43, 402, 120, -1, 48, 29, 312, 43,
- 150, 216, 131, 144, 643, 100, 634, 60, 67, 32,
- 33, -2, 544, 155, 656, 668, 32, 33, 40, 14,
- 207, 504, 61, 100, 211, 132, 14, 202, 423, 283,
- 60, 425, 232, 105, 666, 32, 33, 623, 60, 44,
- 542, 106, 197, 41, 635, 107, 405, 48, 45, 575,
- 120, 48, 657, 669, 222, 400, 191, 360, 141, 638,
- 120, 134, 143, 582, 642, 222, 644, 42, 252, 131,
- -102, 222, 291, 349, 282, 653, 57, 332, 58, 332,
- 288, 486, 144, 197, 100, 498, 316, 281, 34, 258,
- 319, 259, 243, 132, 245, 36, 14, 606, 293, 100,
- 609, 100, 60, 294, 463, 318, 278, 279, 677, 43,
- 398, 110, 227, 60, 38, 247, 228, 249, 235, 50,
- 43, 398, 107, 324, 206, 455, 456, 509, 628, 340,
- 596, 43, 115, 32, 33, 206, 14, 437, 111, 112,
- 189, 207, 14, 111, 112, 211, 14, 14, 43, 190,
- 191, 343, 206, 103, 473, 208, 399, 25, 14, 367,
- 652, 32, 33, 134, 368, 400, 191, 399, 120, 43,
- 412, 120, 120, 206, 63, 14, 400, 191, 116, 355,
- 560, 66, 478, 110, 68, 483, -162, 117, 452, 499,
- 284, 132, -162, 43, 115, 405, 14, 139, 469, 138,
- 5, 14, 7, 97, 400, 191, 60, 146, 9, 10,
- 11, 157, 404, 407, 395, 604, 44, 332, 202, 396,
- 14, 158, 438, 54, 13, 45, 186, 15, 428, 25,
- 111, 112, 454, -162, 43, 398, 374, -162, 206, 453,
- 116, 55, 212, 349, 56, 460, 206, 469, 188, 117,
- 349, 362, 363, 217, 375, 495, -105, -105, -105, -105,
- 158, 14, -105, 365, -105, -105, -105, 366, 438, 242,
- 484, 233, 234, 140, -253, 429, 195, 248, 403, 406,
- -105, 497, 475, 238, 289, 290, 476, 529, 317, 189,
- 45, 217, 30, 31, -316, -316, -316, -316, 190, 191,
- 465, 350, -316, -316, -316, 401, 48, 239, 675, 25,
- 529, 430, 244, 676, 417, 502, 105, 132, -316, 228,
- 250, 468, 128, 129, 414, 416, 251, 120, 9, 10,
- 11, 503, 466, 252, -105, 107, 255, 545, 5, 6,
- 7, 8, 636, 48, 637, 501, 9, 10, 11, 180,
- 181, 25, 182, 183, 184, 185, 619, 120, 256, 48,
- 228, 621, 13, 321, 14, 107, 132, 487, -82, 207,
- 211, 5, -101, 7, 196, 525, 207, 233, 234, 9,
- 10, 11, 295, 60, 5, 57, 7, 58, 133, 308,
- 32, 33, 9, 10, 11, 13, 401, 401, 525, 110,
- 507, 111, 112, 48, 71, 529, 671, 328, 13, 559,
- 524, 52, 187, 309, 679, 527, 334, 189, -259, -259,
- 232, 315, 528, 335, 538, 336, 190, 191, 338, 25,
- 289, 290, 341, 524, 177, 178, 179, 342, 583, 309,
- 477, 586, 589, 160, 162, 561, 344, 455, 456, 593,
- 54, 659, 660, 599, 222, 347, 222, 415, 598, 381,
- 348, 207, 43, 115, 605, 385, 386, 527, 55, 352,
- 356, 56, 361, 611, 528, 364, 538, 378, 567, 569,
- 379, 25, 382, 383, 618, 601, 257, 387, 401, 14,
- 392, 260, 261, 525, 394, 397, 266, 267, 268, 269,
- 270, 271, 272, 273, 274, 275, 276, 277, 411, 116,
- 120, 413, 48, 426, -295, 482, -31, 490, 117, 109,
- 586, 491, -27, -27, -27, -27, 492, 508, 524, 539,
- -27, -27, -27, 457, 458, 459, 546, 461, 462, 547,
- -32, 43, 398, 549, 662, 110, -27, 552, -162, 553,
- 586, 555, 556, 557, -162, 562, 570, 564, 297, 565,
- 474, 5, 6, 7, 8, 579, 326, 299, 14, 9,
- 10, 11, 5, 566, 7, 196, 581, 111, 112, 584,
- 9, 10, 11, 128, 129, 13, 592, 14, 497, 9,
- 10, 11, 345, 346, 594, -162, 13, 45, 595, -162,
- -27, 610, 217, 505, -114, -114, -114, -114, -114, -114,
- -114, 612, -114, -114, -114, -114, -114, 615, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -376, -114, -114, 614, 548, 617, 626,
- 627, -114, 629, 645, -114, -261, -261, 639, 649, -114,
- -114, -114, 654, 658, 655, -114, -114, 664, 667, 670,
- -114, 673, 230, 678, 681, -19, -19, -19, -19, 682,
- 359, 587, 393, -19, -19, -19, 313, 479, -114, -114,
- -114, -114, 576, -114, 126, 467, 292, 357, 110, -19,
- 471, -162, 217, 246, -316, -316, 333, -162, 329, -316,
- -316, 241, -316, 427, 421, 327, -316, 480, -316, -316,
- -316, -316, -316, -316, -316, -316, -316, -316, -316, 447,
- -316, 440, -316, 485, -316, -316, 624, 5, 6, 7,
- 8, -316, 663, 665, -316, 9, 10, 11, -162, -316,
- -316, -316, -162, -19, 410, -316, -316, 625, 0, 353,
- -316, 13, 421, 14, 139, 0, 472, 5, 0, 7,
- 97, 0, 0, 0, 0, 9, 10, 11, -316, -291,
- -316, -316, 488, -316, 32, 33, 199, 200, 201, 494,
- 152, 13, 69, 5, 15, 7, 97, 70, 71, 0,
- 72, 9, 10, 11, 5, 6, 7, 8, 447, 0,
- 568, 506, 9, 10, 11, 0, 0, 13, 73, 0,
- 15, 0, 74, 75, 0, 0, 0, 447, 13, 76,
- 447, 0, 77, 0, 0, 0, 0, 78, 79, 80,
- 0, 0, 0, 81, 82, 0, 0, 297, 83, 298,
- 5, 6, 7, 8, 554, 0, 299, 0, 9, 10,
- 11, 180, 181, 0, 182, 183, 184, 185, 84, 85,
- 0, -91, 0, 0, 13, 0, 14, 0, 578, 0,
- 0, 447, 0, 613, 432, 0, -316, -316, -316, -316,
- -316, -316, -316, 0, -316, -316, -316, -316, -316, 0,
- -316, -316, -316, -316, -316, -316, -316, -316, -316, -316,
- -316, -316, -316, -316, -316, 447, -316, -316, 447, 0,
- 0, 110, -376, -316, -162, 0, -316, 0, 616, 0,
- -162, -316, -316, -316, 0, 0, 0, -316, -316, 0,
- 0, 0, -316, 0, 0, 0, 447, 175, 176, 177,
- 178, 179, 0, 111, 112, 0, 0, 0, 0, 0,
- -316, 0, -316, -316, 0, -316, 571, 0, -316, -316,
- 0, -162, 0, -316, -316, -162, -316, 0, 447, 0,
- -316, 0, -316, -316, -316, -316, -316, -316, -316, -316,
- -316, -316, -316, 0, -316, 0, -316, 0, -316, -316,
- 0, 5, 6, 7, 8, -316, 0, 409, -316, 9,
- 10, 11, 0, -316, -316, -316, 0, 0, 0, -316,
- -316, 0, 0, 0, -316, 13, 0, 14, 0, 0,
- 0, 5, 6, 7, 8, 0, 0, 0, 0, 9,
- 10, 11, -316, 0, -316, -316, 602, -316, -326, -326,
- 0, 0, 0, -326, -326, 13, -326, 14, 0, 0,
- -326, 0, -326, -326, -326, -326, -326, -326, -326, -326,
- -326, -326, -326, 0, -326, 0, -326, 0, -326, -326,
- 0, 0, 127, 128, 129, -326, 0, 0, -326, 9,
- 10, 11, 0, -326, -326, -326, 0, 0, 0, -326,
- -326, 0, 0, 441, -326, 442, 33, 14, 0, 0,
- 70, 71, 0, 72, 172, 173, 174, 175, 176, 177,
- 178, 179, -326, 0, -326, -326, 0, -326, 0, 0,
- 0, 73, 0, 15, 0, 74, 75, 0, 0, 0,
- 0, 0, 76, 0, 0, 77, 0, 0, 0, 0,
- 78, 79, 80, 0, 0, 0, 81, 82, 0, 0,
- 443, 83, 444, 441, 0, 442, 33, 0, 0, 0,
- 70, 71, 0, 72, 0, 0, 0, 0, 0, 0,
- -190, 84, 85, 0, 445, 0, 0, 0, 0, 0,
- 0, 73, 0, 15, 0, 74, 75, 0, 0, 0,
- 0, 0, 76, 0, 0, 77, 0, 0, 0, 0,
- 78, 79, 80, 0, 0, 0, 81, 82, 0, 0,
- 443, 83, 444, 441, 0, 442, 33, 0, 0, 0,
- 70, 71, 0, 72, 0, 0, 0, 0, 0, 0,
- -250, 84, 85, 0, 445, 0, 0, 0, 0, 0,
- 0, 73, 0, 15, 0, 74, 75, 0, 0, 0,
- 0, 0, 76, 0, 0, 77, 0, 0, 0, 0,
- 78, 79, 80, 0, 0, 0, 81, 82, 0, 0,
- 443, 83, 444, 419, 0, 69, 0, 0, 0, 0,
- 70, 71, 0, 72, 236, 0, 0, -23, -23, -23,
- -23, 84, 85, 0, 445, -23, -23, -23, 0, 0,
- 0, 73, 0, 15, 0, 74, 75, 0, 0, 0,
- 110, -23, 76, -162, 0, 77, 0, 0, 0, -162,
- 78, 79, 80, 0, 0, 0, 81, 82, 0, 0,
- 0, 83, 173, 174, 175, 176, 177, 178, 179, 0,
- 69, 0, 111, 112, 0, 70, 71, 0, 72, 0,
- 0, 84, 85, 69, 420, 0, 0, 0, 70, 71,
- -162, 72, 0, 0, -162, -23, 73, 0, 15, 0,
- 74, 75, 0, 0, 0, 0, 0, 76, 0, 73,
- 77, 15, 0, 74, 75, 78, 79, 80, 0, 0,
- 76, 81, 82, 77, 0, 0, 83, 0, 78, 79,
- 80, 0, 0, 0, 81, 82, 69, 0, 0, 83,
- 0, 70, 71, 0, 72, 0, 84, 85, 0, 69,
- 215, 0, 0, 0, 70, 71, 0, 72, 0, 84,
- 85, 0, 73, 287, 15, 0, 74, 75, 0, 0,
- 0, 0, 0, 76, 0, 73, 77, 15, 0, 74,
- 75, 78, 79, 80, 0, 0, 76, 81, 82, 77,
- 0, 0, 83, 0, 78, 79, 80, 0, 0, 0,
- 81, 82, 69, 0, 0, 83, 0, 70, 71, 0,
- 72, 0, 84, 85, 0, 0, 323, 0, 0, 0,
- 0, 0, 0, 0, 0, 84, 85, 0, 73, 354,
- 15, 0, 74, 75, 590, 0, 0, 0, 0, 76,
- 0, 0, 77, 0, 0, 0, 0, 78, 79, 80,
- 0, 0, 0, 81, 82, 0, 0, 0, 83, 163,
- 164, 165, 591, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 0, 84, 85,
- 0, 0, 500, 442, 510, 6, 7, 8, 70, 71,
- 0, 72, 9, 10, 11, 511, 0, 512, 513, 514,
- 515, 516, 517, 518, 519, 520, 521, 522, 13, 73,
- 14, 15, 0, 74, 75, 0, 0, 0, 0, 0,
- 76, 0, 0, 77, 0, 0, 0, 0, 78, 79,
- 80, 14, 0, 0, 81, 82, 163, 164, 165, 83,
- 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
- 176, 177, 178, 179, 0, 0, 0, 523, 0, 84,
- 85, 0, 252, 442, 33, 0, 0, 0, 70, 71,
- 0, 72, 0, 0, 0, 511, 0, 512, 513, 514,
- 515, 516, 517, 518, 519, 520, 521, 522, 0, 73,
- 0, 15, 0, 74, 75, 0, 0, 0, 0, 0,
- 76, 0, 0, 77, 0, 0, 0, 0, 78, 79,
- 80, 0, 0, 0, 81, 82, 0, 69, 0, 83,
- 0, 0, 70, 71, 0, 72, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 523, 0, 84,
- 85, 0, 252, 73, 0, 15, 0, 74, 75, 0,
- 0, 0, 0, 0, 76, 0, 0, 77, 0, 0,
- 0, 0, 78, 79, 80, 0, 0, 0, 81, 82,
- 0, 0, 0, 83, 69, 5, 6, 7, 8, 70,
- 71, 0, 72, 9, 10, 11, 0, 0, 0, 0,
- 0, 0, 0, 84, 85, 0, 339, 0, 0, 13,
- 73, 14, 15, 0, 74, 75, 0, 0, 0, 0,
- 0, 76, 0, 0, 77, 0, 0, 0, 0, 78,
- 79, 80, 0, 0, 0, 81, 82, 0, 69, 5,
- 83, 7, 97, 70, 71, 0, 72, 9, 10, 11,
- 0, 69, 0, 0, 0, 0, 70, 71, 0, 72,
- 84, 85, 0, 13, 73, 0, 15, 0, 74, 75,
- 0, 0, 0, 0, 0, 76, 0, 73, 77, 15,
- 0, 74, 75, 78, 79, 80, 0, 0, 76, 81,
- 82, 77, 0, 0, 83, 0, 78, 79, 80, 0,
- 0, 0, 81, 82, 69, 0, 0, 83, 0, 70,
- 71, 0, 72, 0, 84, 85, 171, 172, 173, 174,
- 175, 176, 177, 178, 179, 558, 0, 84, 85, 0,
- 73, 69, 15, 0, 74, 75, 70, 71, 0, 72,
- 0, 76, 0, 0, 77, 0, 0, 0, 0, 78,
- 79, 80, 0, 0, 0, 81, 82, 73, 69, 15,
- 83, 74, 75, 70, 71, 0, 72, 0, 76, 0,
- 0, 77, 0, 0, 0, 0, 78, 79, 80, 0,
- 84, 85, 81, 82, 73, 358, 15, 159, 74, 75,
- 70, 71, 0, 72, 0, 76, 0, 0, 77, 0,
- 0, 0, 0, 78, 79, 80, 0, 84, 85, 81,
- 82, 73, 0, 15, 161, 74, 75, 0, 0, 0,
- 0, 0, 76, 0, 0, 77, 0, 0, 0, 0,
- 78, 79, 80, 0, 84, 85, 81, 82, 0, 0,
- 4, 83, -118, 5, 6, 7, 8, 0, 0, 0,
- 0, 9, 10, 11, 0, 0, 0, 0, 0, 0,
- 0, 84, 85, 0, 0, 0, 12, 13, 0, 14,
- 15, 165, 0, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 0, 540, -118,
- 0, 0, 0, 0, 0, 163, 164, 165, -118, 166,
- 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
- 177, 178, 179, 163, 164, 165, 16, 166, 167, 168,
- 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
- 179, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 163, 164, 165, 607, 166, 167, 168, 169, 170, 171,
- 172, 173, 174, 175, 176, 177, 178, 179, 0, 0,
- 0, 541, 163, 164, 165, 633, 166, 167, 168, 169,
- 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
- 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
- 177, 178, 179, 168, 169, 170, 171, 172, 173, 174,
- 175, 176, 177, 178, 179, 170, 171, 172, 173, 174,
- 175, 176, 177, 178, 179
+#define YYLAST 2211
+
+
+static const short yytable[] = { 86,
+ 97, 123, 62, 64, 66, 120, 47, 31, 31, 21,
+ 21, 213, 25, 25, 22, 22, 216, 314, 223, 35,
+ 36, 37, 52, 319, 290, 220, 248, 466, 131, 104,
+ 46, 189, 54, 285, 316, 278, 31, 124, 21, 135,
+ 53, 25, 200, 22, 427, 347, 402, 49, 51, -102,
+ 141, 275, 365, 46, 197, 146, 579, 99, 306, 119,
+ 232, 46, 139, 140, 234, 177, 305, 130, 142, 180,
+ 548, 217, 207, 640, 147, 32, 109, 193, 181, 182,
+ 662, 277, 59, 60, 178, 59, 60, 110, 111, 198,
+ 59, 60, -1, 202, 649, 507, 131, 180, 674, 223,
+ 99, 591, 104, 67, 199, 489, 181, 182, 110, 111,
+ 213, 641, 240, 46, 580, 546, 119, 46, 663, 188,
+ 14, 213, 587, 252, 672, 253, 119, 213, 509, 58,
+ -102, 345, 356, 246, 285, 130, 675, 276, 235, 58,
+ 58, 58, 423, 282, 501, 425, 59, 60, 272, 273,
+ 58, 99, 513, -2, 629, 312, 131, 612, 58, 14,
+ 615, 61, 232, 48, 63, 275, 234, 287, 99, 65,
+ 99, 310, 288, 465, 315, 313, 644, 363, 14, 395,
+ 320, 648, 364, 650, 396, 602, 318, 105, 326, 634,
+ 218, 106, 659, 565, 219, 5, 55, 7, 56, 224,
+ 225, 38, 198, 9, 10, 11, 202, 457, 458, 41,
+ 114, 148, 325, 197, 327, 25, 311, 339, 240, 13,
+ 379, 658, 379, 58, 39, 683, 119, 226, 498, 119,
+ 119, 106, 14, 149, 58, 361, 14, 478, 336, 362,
+ 235, 479, 610, 681, 439, 351, 412, 505, 682, 33,
+ 34, 219, 188, 99, 278, 506, 115, 131, 321, 106,
+ 323, 110, 111, 193, 251, 116, 471, 502, 415, 254,
+ 255, 41, 454, 40, 260, 261, 262, 263, 264, 265,
+ 266, 267, 268, 269, 270, 271, 102, 440, 404, 407,
+ 25, 481, 59, 60, 486, 52, 41, 114, 14, 625,
+ 455, 224, 225, 219, 240, 54, 462, 456, 370, 345,
+ 627, 110, 111, 53, 106, 149, 345, 471, 405, 58,
+ 358, 359, 55, 14, 56, 379, 371, 400, 182, 41,
+ 114, 475, 428, 429, 177, 440, 430, 487, 134, 5,
+ 6, 7, 8, 115, 403, 406, 136, 9, 10, 11,
+ 41, 398, 116, 459, 460, 461, 14, 463, 464, 168,
+ 169, 170, 432, 13, 138, 14, 467, 179, 401, 46,
+ 533, 186, 25, 341, 342, 109, 115, 14, -162, 283,
+ 284, 203, 477, 476, -162, 116, 104, 108, 417, 131,
+ -27, -27, -27, -27, 533, 414, 416, 399, -27, -27,
+ -27, 549, 468, 244, 41, 398, 400, 182, 197, 229,
+ 46, 237, 50, 109, -27, 245, -162, 249, 25, 504,
+ 490, 642, -162, 643, 119, -162, 46, 510, 246, -162,
+ 41, 14, 283, 284, 197, 250, 239, 119, 59, 60,
+ 131, 198, 202, 383, -82, 110, 111, 289, 198, 346,
+ 529, 399, -265, -265, 511, 393, 109, 14, 70, 552,
+ 400, 182, 302, -162, 528, 401, 401, -162, -27, 303,
+ 480, 303, 46, 309, 529, 171, 172, 42, 173, 174,
+ 175, 176, 457, 458, 322, 564, 43, 421, 528, 41,
+ 328, 533, 329, 197, 542, 677, 531, 619, 332, 25,
+ 566, 532, 223, 685, 588, 58, 449, 163, 164, 165,
+ 166, 167, 168, 169, 170, 589, 14, 334, 592, 595,
+ 151, 153, 337, 338, 605, 213, 599, 213, 604, 340,
+ 374, 178, 52, 343, 344, 198, 405, 665, 666, 421,
+ 352, 611, 54, 348, 357, 400, 182, 542, 360, 531,
+ 53, 617, 25, 375, 532, 381, 41, 572, 574, 401,
+ 607, 491, 624, 382, 387, 385, 392, 143, 497, 68,
+ 5, 529, 7, 96, 69, 70, 394, 71, 9, 10,
+ 11, 397, 119, 14, 46, 528, 411, 449, 413, 426,
+ 508, 431, -301, 485, 13, 72, -31, 15, 592, 73,
+ 74, 493, 494, 42, 495, 512, 75, 449, 543, 76,
+ 449, 551, 43, 550, 77, 78, 79, -32, 554, 557,
+ 80, 81, 668, 558, 553, 82, 221, 560, 592, -19,
+ -19, -19, -19, 561, 562, 559, 567, -19, -19, -19,
+ 569, 5, 6, 7, 8, 83, 84, 409, -91, 9,
+ 10, 11, 109, -19, 570, -162, 575, 571, 584, 583,
+ 586, -162, 449, 590, 598, 13, 208, 14, -114, -114,
+ -114, -114, -114, -114, -114, 600, -114, -114, -114, -114,
+ -114, 616, -114, -114, -114, -114, -114, -114, -114, -114,
+ -114, -114, -114, -114, -114, -114, -114, 449, -114, -114,
+ 449, 601, -162, 618, 620, -114, -162, -19, -114, 621,
+ 632, 622, 623, -114, -114, -114, 633, 635, 651, -114,
+ -114, 645, 655, 660, -114, 661, 687, 670, 208, 449,
+ 664, -105, -105, -105, -105, 673, 676, -105, 679, -105,
+ -105, -105, -114, -114, -114, -114, 434, -114, -322, -322,
+ -322, -322, -322, -322, -322, -105, -322, -322, -322, -322,
+ -322, 449, -322, -322, -322, -322, -322, -322, -322, -322,
+ -322, -322, -322, -322, -322, -322, -322, 684, -322, -322,
+ 593, 688, 307, 41, 398, -322, 355, 197, -322, 470,
+ 127, 128, 482, -322, -322, -322, 9, 10, 11, -322,
+ -322, 581, 125, 286, -322, 353, 469, 473, 208, -105,
+ 14, -322, -322, -322, -322, 386, 324, 474, 380, -322,
+ -322, -322, -322, 483, -322, -322, 208, -322, -322, -322,
+ 500, 331, 384, -322, -322, -322, -322, 442, 488, 43,
+ -322, 630, -322, -322, -322, -322, -322, -322, -322, -322,
+ -322, -322, -322, 631, -322, 669, -322, 349, -322, -322,
+ 671, 410, 126, 127, 128, -322, 0, 0, -322, 9,
+ 10, 11, 0, -322, -322, -322, 0, 0, 0, -322,
+ -322, 0, 0, 0, -322, 230, 0, 14, 5, -101,
+ 7, 96, 0, 0, 41, 398, 9, 10, 11, 0,
+ 0, 0, -322, -297, -322, -322, 576, -322, -322, -322,
+ 0, 0, 13, -322, -322, 15, -322, 0, 0, 0,
+ -322, 14, -322, -322, -322, -322, -322, -322, -322, -322,
+ -322, -322, -322, 0, -322, 0, -322, 0, -322, -322,
+ 0, 500, 0, 0, 0, -322, 0, 0, -322, 0,
+ 43, 0, 0, -322, -322, -322, 0, 0, 0, -322,
+ -322, 231, -259, 291, -322, 292, 5, 6, 7, 8,
+ 0, 0, 293, 0, 9, 10, 11, 59, 60, 190,
+ 191, 192, -322, 0, -322, -322, 608, -322, -332, -332,
+ 13, 0, 14, -332, -332, 0, -332, 0, 0, 0,
+ -332, 0, -332, -332, -332, -332, -332, -332, -332, -332,
+ -332, -332, -332, 0, -332, 0, -332, 0, -332, -332,
+ 166, 167, 168, 169, 170, -332, 0, 109, -332, 0,
+ -162, 0, 0, -332, -332, -332, -162, 0, -382, -332,
+ -332, 127, 128, 443, -332, 444, 60, 9, 10, 11,
+ 69, 70, 0, 71, 0, 0, 0, 0, 0, 110,
+ 111, 0, -332, 0, -332, -332, 0, -332, 0, 0,
+ 0, 72, 0, 15, 0, 73, 74, -162, 0, 0,
+ 0, -162, 75, 171, 172, 76, 173, 174, 175, 176,
+ 77, 78, 79, 0, 0, 0, 80, 81, 0, 0,
+ 445, 82, 446, 443, 0, 444, 60, 0, 0, 0,
+ 69, 70, 0, 71, 0, 0, 0, 0, 0, 0,
+ -190, 83, 84, 0, 447, 0, 0, 0, 0, 0,
+ 0, 72, 0, 15, 0, 73, 74, 0, 0, 0,
+ 0, 0, 75, 0, 0, 76, 0, 0, 0, 0,
+ 77, 78, 79, 0, 0, 0, 80, 81, 0, 0,
+ 445, 82, 446, 443, 0, 444, 60, 0, 0, 0,
+ 69, 70, 0, 71, 0, 0, 0, 0, 0, 0,
+ -256, 83, 84, 0, 447, 0, 0, 0, 0, 0,
+ 0, 72, 0, 15, 0, 73, 74, 0, 0, 0,
+ 0, 0, 75, 0, 0, 76, 0, 0, 0, 0,
+ 77, 78, 79, 0, 0, 0, 80, 81, 0, 0,
+ 445, 82, 446, 419, 0, 68, 0, 0, 0, 0,
+ 69, 70, 0, 71, 227, 0, 0, -23, -23, -23,
+ -23, 83, 84, 0, 447, -23, -23, -23, 0, 0,
+ 0, 72, 0, 15, 0, 73, 74, 0, 0, 0,
+ 109, -23, 75, -162, 0, 76, 0, 0, 0, -162,
+ 77, 78, 79, 0, 0, 0, 80, 81, 0, 0,
+ 0, 82, 164, 165, 166, 167, 168, 169, 170, 0,
+ 68, 0, 110, 111, 0, 69, 70, 0, 71, 0,
+ 0, 83, 84, 68, 420, 0, 0, 0, 69, 70,
+ -162, 71, 0, 0, -162, -23, 72, 0, 15, 0,
+ 73, 74, 0, 0, 0, 0, 0, 75, 0, 72,
+ 76, 15, 0, 73, 74, 77, 78, 79, 0, 0,
+ 75, 80, 81, 76, 0, 0, 82, 0, 77, 78,
+ 79, 0, 0, 0, 80, 81, 68, 0, 0, 82,
+ 0, 69, 70, 0, 71, 0, 83, 84, 0, 68,
+ 206, 0, 0, 0, 69, 70, 0, 71, 0, 83,
+ 84, 0, 72, 281, 15, 0, 73, 74, 0, 0,
+ 0, 0, 0, 75, 0, 72, 76, 15, 0, 73,
+ 74, 77, 78, 79, 0, 0, 75, 80, 81, 76,
+ 0, 0, 82, 0, 77, 78, 79, 0, 0, 0,
+ 80, 81, 68, 0, 0, 82, 0, 69, 70, 0,
+ 71, 0, 83, 84, 0, 0, 317, 0, 0, 0,
+ 0, 0, 0, 0, 0, 83, 84, 0, 72, 350,
+ 15, 0, 73, 74, 0, 5, 6, 7, 8, 75,
+ 0, 0, 76, 9, 10, 11, 0, 77, 78, 79,
+ 0, 0, 0, 80, 81, 0, 0, 0, 82, 13,
+ 0, 14, 0, 0, 0, 0, 5, 0, 7, 187,
+ 0, 0, 0, 0, 9, 10, 11, 0, 83, 84,
+ 0, 0, 503, 444, 514, 6, 7, 8, 69, 70,
+ 13, 71, 9, 10, 11, 515, 0, 516, 517, 518,
+ 519, 520, 521, 522, 523, 524, 525, 526, 13, 72,
+ 14, 15, 180, 73, 74, 0, 5, 6, 7, 8,
+ 75, 181, 182, 76, 9, 10, 11, 0, 77, 78,
+ 79, 0, 0, 0, 80, 81, 0, 0, 291, 82,
+ 13, 5, 6, 7, 8, 0, 0, 293, 0, 9,
+ 10, 11, 0, 0, 0, 0, 0, 527, 0, 83,
+ 84, 0, 246, 444, 60, 13, 0, 14, 69, 70,
+ 0, 71, 0, 0, 0, 515, 0, 516, 517, 518,
+ 519, 520, 521, 522, 523, 524, 525, 526, 0, 72,
+ 0, 15, 0, 73, 74, 0, 0, 0, 0, 0,
+ 75, 0, 0, 76, 0, 0, 0, 0, 77, 78,
+ 79, 0, 0, -382, 80, 81, 0, 68, 0, 82,
+ 0, 0, 69, 70, 0, 71, 160, 161, 162, 163,
+ 164, 165, 166, 167, 168, 169, 170, 527, 0, 83,
+ 84, 0, 246, 72, 0, 15, 0, 73, 74, 0,
+ 0, 0, 0, 0, 75, 0, 0, 76, 0, 0,
+ 0, 0, 77, 78, 79, 0, 0, 0, 80, 81,
+ 0, 0, 0, 82, 68, 5, 6, 7, 8, 69,
+ 70, 0, 71, 9, 10, 11, 0, 0, 0, 0,
+ 0, 0, 0, 83, 84, 0, 335, 0, 0, 13,
+ 72, 14, 15, 0, 73, 74, 0, 0, 0, 0,
+ 0, 75, 0, 0, 76, 0, 0, 0, 0, 77,
+ 78, 79, 0, 0, 0, 80, 81, 0, 68, 5,
+ 82, 7, 96, 69, 70, 0, 71, 9, 10, 11,
+ 0, 68, 0, 0, 0, 0, 69, 70, 0, 71,
+ 83, 84, 0, 13, 72, 0, 15, 0, 73, 74,
+ 0, 0, 0, 0, 0, 75, 0, 72, 76, 15,
+ 0, 73, 74, 77, 78, 79, 0, 0, 75, 80,
+ 81, 76, 0, 0, 82, 0, 77, 78, 79, 0,
+ 0, 0, 80, 81, 68, 0, 0, 82, 0, 69,
+ 70, 0, 71, 0, 83, 84, 162, 163, 164, 165,
+ 166, 167, 168, 169, 170, 563, 0, 83, 84, 0,
+ 72, 68, 15, 0, 73, 74, 69, 70, 0, 71,
+ 0, 75, 0, 0, 76, 0, 0, 0, 0, 77,
+ 78, 79, 0, 0, 0, 80, 81, 72, 68, 15,
+ 82, 73, 74, 69, 70, 0, 71, 0, 75, 0,
+ 0, 76, 0, 0, 0, 0, 77, 78, 79, 0,
+ 83, 84, 80, 81, 72, 354, 15, 150, 73, 74,
+ 69, 70, 0, 71, 0, 75, 0, 0, 76, 0,
+ 0, 0, 0, 77, 78, 79, 0, 83, 84, 80,
+ 81, 72, 0, 15, 152, 73, 74, 0, 0, 0,
+ 0, 0, 75, 0, 0, 76, 0, 0, 0, 0,
+ 77, 78, 79, 0, 83, 84, 80, 81, 0, 0,
+ 4, 82, -118, 5, 6, 7, 8, 5, 0, 7,
+ 187, 9, 10, 11, 0, 9, 10, 11, 0, 0,
+ 0, 83, 84, 0, 0, 0, 12, 13, 0, 14,
+ 15, 13, 0, 0, 0, 5, 6, 7, 8, 0,
+ 0, 0, 0, 9, 10, 11, 0, 0, 0, -118,
+ 0, 0, 0, 0, 0, 0, 0, 544, -118, 13,
+ 156, 14, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 16, 0, 0, 0,
+ -267, -267, 154, 155, 156, 0, 157, 158, 159, 160,
+ 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
+ 0, 0, 0, 0, 0, 154, 155, 156, 573, 157,
+ 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 170, 0, 0, 0, 14, 0, 0, 596,
+ 545, 154, 155, 156, 0, 157, 158, 159, 160, 161,
+ 162, 163, 164, 165, 166, 167, 168, 169, 170, 0,
+ 0, 0, 0, 613, 154, 155, 156, 597, 157, 158,
+ 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
+ 169, 170, 230, 0, 0, 5, 0, 7, 96, 0,
+ 0, 0, 0, 9, 10, 11, 158, 159, 160, 161,
+ 162, 163, 164, 165, 166, 167, 168, 169, 170, 13,
+ 0, 0, 15, 154, 155, 156, 639, 157, 158, 159,
+ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+ 170, 154, 155, 156, 0, 157, 158, 159, 160, 161,
+ 162, 163, 164, 165, 166, 167, 168, 169, 170, 159,
+ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+ 170, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+ 170
};
-static const short yycheck[] = { 40,
- 41, 2, 3, 9, 10, 11, 20, 53, 2, 3,
- 2, 3, 51, 121, 22, 2, 3, 113, 74, 75,
- 212, 120, 102, 231, 80, 154, 116, 28, 59, 237,
- 86, 45, 22, 20, 28, 22, 28, 233, 219, 53,
- 96, 28, 21, 22, 194, 332, 184, 414, 117, 65,
- 190, 41, 286, 65, 107, 551, 62, 1, 45, 1,
- 9, 1, 3, 362, 51, 0, 53, 3, 10, 3,
- 76, 112, 59, 65, 631, 65, 38, 25, 38, 3,
- 4, 0, 492, 83, 38, 38, 3, 4, 59, 30,
- 104, 470, 28, 83, 108, 126, 30, 103, 377, 189,
- 48, 380, 210, 117, 661, 3, 4, 603, 56, 50,
- 489, 77, 102, 59, 76, 81, 50, 104, 59, 59,
- 107, 108, 76, 76, 220, 59, 60, 76, 144, 625,
- 117, 137, 144, 543, 630, 231, 632, 59, 82, 126,
- 82, 237, 292, 283, 185, 641, 5, 243, 7, 245,
- 191, 438, 144, 143, 144, 454, 225, 295, 82, 159,
- 229, 161, 141, 194, 143, 82, 30, 577, 76, 159,
- 580, 161, 120, 81, 408, 228, 182, 183, 674, 3,
- 4, 27, 77, 131, 82, 145, 81, 147, 77, 77,
- 3, 4, 81, 234, 7, 59, 60, 484, 608, 255,
- 567, 3, 4, 3, 4, 7, 30, 388, 59, 60,
- 50, 225, 30, 59, 60, 229, 30, 30, 3, 59,
- 60, 262, 7, 59, 38, 76, 50, 214, 30, 76,
- 640, 3, 4, 239, 81, 59, 60, 50, 225, 3,
- 369, 228, 229, 7, 82, 30, 59, 60, 50, 290,
- 50, 82, 433, 27, 82, 436, 30, 59, 396, 455,
- 400, 292, 36, 3, 4, 50, 30, 1, 418, 78,
- 4, 30, 6, 7, 59, 60, 224, 78, 12, 13,
- 14, 76, 362, 363, 76, 572, 50, 383, 294, 81,
- 30, 81, 388, 301, 28, 59, 9, 31, 38, 286,
- 59, 60, 401, 77, 3, 4, 314, 81, 7, 399,
- 50, 301, 59, 453, 301, 405, 7, 467, 76, 59,
- 460, 300, 301, 1, 314, 76, 4, 5, 6, 7,
- 81, 30, 10, 77, 12, 13, 14, 81, 434, 138,
- 436, 59, 60, 77, 78, 384, 76, 146, 362, 363,
- 28, 50, 77, 36, 59, 60, 81, 486, 76, 50,
- 59, 1, 77, 78, 4, 5, 6, 7, 59, 60,
- 416, 76, 12, 13, 14, 362, 363, 81, 76, 366,
- 509, 387, 77, 81, 374, 77, 400, 418, 28, 81,
- 76, 5, 6, 7, 373, 374, 76, 384, 12, 13,
- 14, 77, 416, 82, 82, 81, 76, 497, 4, 5,
- 6, 7, 620, 400, 622, 456, 12, 13, 14, 54,
- 55, 408, 57, 58, 59, 60, 77, 414, 77, 416,
- 81, 77, 28, 232, 30, 81, 467, 443, 38, 453,
- 454, 4, 82, 6, 7, 486, 460, 59, 60, 12,
- 13, 14, 59, 401, 4, 5, 6, 7, 1, 83,
- 3, 4, 12, 13, 14, 28, 453, 454, 509, 27,
- 476, 59, 60, 460, 9, 604, 668, 78, 28, 520,
- 486, 77, 538, 77, 676, 486, 78, 50, 77, 78,
- 598, 36, 486, 78, 486, 78, 59, 60, 76, 486,
- 59, 60, 76, 509, 50, 51, 52, 76, 549, 77,
- 78, 552, 553, 90, 91, 521, 38, 59, 60, 560,
- 528, 650, 651, 569, 620, 76, 622, 77, 567, 328,
- 83, 545, 3, 4, 575, 334, 335, 538, 528, 83,
- 76, 528, 76, 584, 538, 76, 538, 36, 527, 528,
- 83, 538, 78, 81, 595, 569, 158, 32, 545, 30,
- 38, 163, 164, 604, 83, 76, 168, 169, 170, 171,
- 172, 173, 174, 175, 176, 177, 178, 179, 3, 50,
- 567, 77, 569, 382, 78, 78, 38, 38, 59, 1,
- 631, 78, 4, 5, 6, 7, 81, 78, 604, 36,
- 12, 13, 14, 402, 403, 404, 83, 406, 407, 78,
- 38, 3, 4, 59, 655, 27, 28, 59, 30, 59,
- 661, 38, 77, 77, 36, 7, 16, 38, 1, 77,
- 429, 4, 5, 6, 7, 36, 238, 10, 30, 12,
- 13, 14, 4, 77, 6, 7, 78, 59, 60, 59,
- 12, 13, 14, 6, 7, 28, 77, 30, 50, 12,
- 13, 14, 264, 265, 77, 77, 28, 59, 59, 81,
- 82, 76, 1, 472, 3, 4, 5, 6, 7, 8,
- 9, 17, 11, 12, 13, 14, 15, 76, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 76, 33, 34, 77, 506, 77, 76,
- 36, 40, 76, 9, 43, 77, 78, 77, 77, 48,
- 49, 50, 77, 81, 59, 54, 55, 77, 76, 76,
- 59, 77, 1, 77, 0, 4, 5, 6, 7, 0,
- 295, 552, 344, 12, 13, 14, 220, 434, 77, 78,
- 79, 80, 538, 82, 55, 417, 197, 294, 27, 28,
- 424, 30, 1, 144, 3, 4, 245, 36, 241, 8,
- 9, 137, 11, 383, 376, 239, 15, 434, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 391,
- 29, 389, 31, 436, 33, 34, 604, 4, 5, 6,
- 7, 40, 656, 658, 43, 12, 13, 14, 77, 48,
- 49, 50, 81, 82, 366, 54, 55, 604, -1, 289,
- 59, 28, 424, 30, 1, -1, 428, 4, -1, 6,
- 7, -1, -1, -1, -1, 12, 13, 14, 77, 78,
- 79, 80, 444, 82, 3, 4, 5, 6, 7, 451,
- 1, 28, 3, 4, 31, 6, 7, 8, 9, -1,
- 11, 12, 13, 14, 4, 5, 6, 7, 470, -1,
- 77, 473, 12, 13, 14, -1, -1, 28, 29, -1,
- 31, -1, 33, 34, -1, -1, -1, 489, 28, 40,
- 492, -1, 43, -1, -1, -1, -1, 48, 49, 50,
- -1, -1, -1, 54, 55, -1, -1, 1, 59, 3,
- 4, 5, 6, 7, 516, -1, 10, -1, 12, 13,
- 14, 54, 55, -1, 57, 58, 59, 60, 79, 80,
- -1, 82, -1, -1, 28, -1, 30, -1, 540, -1,
- -1, 543, -1, 76, 1, -1, 3, 4, 5, 6,
- 7, 8, 9, -1, 11, 12, 13, 14, 15, -1,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 577, 33, 34, 580, -1,
- -1, 27, 76, 40, 30, -1, 43, -1, 590, -1,
- 36, 48, 49, 50, -1, -1, -1, 54, 55, -1,
- -1, -1, 59, -1, -1, -1, 608, 48, 49, 50,
- 51, 52, -1, 59, 60, -1, -1, -1, -1, -1,
- 77, -1, 79, 80, -1, 82, 1, -1, 3, 4,
- -1, 77, -1, 8, 9, 81, 11, -1, 640, -1,
- 15, -1, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, -1, 29, -1, 31, -1, 33, 34,
- -1, 4, 5, 6, 7, 40, -1, 10, 43, 12,
+static const short yycheck[] = { 38,
+ 39, 51, 27, 28, 29, 49, 20, 2, 3, 2,
+ 3, 112, 2, 3, 2, 3, 115, 222, 120, 9,
+ 10, 11, 22, 228, 203, 119, 145, 414, 57, 43,
+ 20, 101, 22, 185, 224, 181, 31, 51, 31, 63,
+ 22, 31, 106, 31, 379, 280, 358, 21, 22, 1,
+ 75, 175, 1, 43, 7, 82, 1, 39, 10, 49,
+ 133, 51, 73, 74, 133, 9, 210, 57, 79, 50,
+ 495, 116, 111, 38, 85, 3, 27, 102, 59, 60,
+ 38, 180, 3, 4, 95, 3, 4, 59, 60, 103,
+ 3, 4, 0, 107, 637, 472, 125, 50, 38, 201,
+ 82, 556, 116, 31, 76, 440, 59, 60, 59, 60,
+ 211, 76, 137, 103, 59, 492, 106, 107, 76, 101,
+ 30, 222, 547, 150, 667, 152, 116, 228, 38, 25,
+ 82, 277, 76, 82, 286, 125, 76, 176, 133, 35,
+ 36, 37, 373, 182, 456, 376, 3, 4, 173, 174,
+ 46, 133, 487, 0, 609, 219, 185, 582, 54, 30,
+ 585, 82, 235, 77, 82, 289, 235, 76, 150, 82,
+ 152, 216, 81, 408, 223, 220, 631, 76, 30, 76,
+ 229, 636, 81, 638, 81, 572, 225, 77, 237, 614,
+ 77, 81, 647, 50, 81, 4, 5, 6, 7, 59,
+ 60, 59, 216, 12, 13, 14, 220, 59, 60, 3,
+ 4, 76, 236, 7, 238, 205, 76, 256, 243, 28,
+ 321, 646, 323, 119, 59, 680, 216, 77, 76, 219,
+ 220, 81, 30, 81, 130, 77, 30, 77, 249, 81,
+ 235, 81, 577, 76, 388, 284, 365, 77, 81, 77,
+ 78, 81, 234, 235, 400, 77, 50, 286, 232, 81,
+ 234, 59, 60, 288, 149, 59, 418, 457, 77, 154,
+ 155, 3, 396, 59, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 59, 388, 358, 359,
+ 280, 435, 3, 4, 438, 295, 3, 4, 30, 77,
+ 399, 59, 60, 81, 329, 295, 405, 401, 308, 455,
+ 77, 59, 60, 295, 81, 81, 462, 469, 50, 215,
+ 294, 295, 5, 30, 7, 426, 308, 59, 60, 3,
+ 4, 38, 381, 382, 9, 436, 385, 438, 82, 4,
+ 5, 6, 7, 50, 358, 359, 82, 12, 13, 14,
+ 3, 4, 59, 402, 403, 404, 30, 406, 407, 50,
+ 51, 52, 387, 28, 82, 30, 416, 76, 358, 359,
+ 489, 76, 362, 258, 259, 27, 50, 30, 30, 59,
+ 60, 59, 431, 427, 36, 59, 400, 1, 370, 418,
+ 4, 5, 6, 7, 513, 369, 370, 50, 12, 13,
+ 14, 500, 416, 76, 3, 4, 59, 60, 7, 78,
+ 400, 78, 77, 27, 28, 76, 30, 76, 408, 458,
+ 445, 626, 36, 628, 414, 77, 416, 476, 82, 81,
+ 3, 30, 59, 60, 7, 77, 1, 427, 3, 4,
+ 469, 455, 456, 328, 38, 59, 60, 59, 462, 76,
+ 489, 50, 77, 78, 479, 340, 27, 30, 9, 508,
+ 59, 60, 83, 77, 489, 455, 456, 81, 82, 77,
+ 78, 77, 462, 36, 513, 54, 55, 50, 57, 58,
+ 59, 60, 59, 60, 77, 524, 59, 372, 513, 3,
+ 36, 610, 81, 7, 489, 674, 489, 76, 78, 489,
+ 525, 489, 604, 682, 553, 401, 391, 45, 46, 47,
+ 48, 49, 50, 51, 52, 554, 30, 76, 557, 558,
+ 89, 90, 76, 76, 574, 626, 565, 628, 572, 38,
+ 36, 542, 532, 76, 83, 549, 50, 656, 657, 424,
+ 76, 580, 532, 83, 76, 59, 60, 542, 76, 542,
+ 532, 590, 542, 83, 542, 78, 3, 531, 532, 549,
+ 574, 446, 601, 78, 32, 78, 38, 1, 453, 3,
+ 4, 610, 6, 7, 8, 9, 83, 11, 12, 13,
+ 14, 76, 572, 30, 574, 610, 3, 472, 77, 81,
+ 475, 78, 78, 78, 28, 29, 38, 31, 637, 33,
+ 34, 38, 78, 50, 81, 78, 40, 492, 36, 43,
+ 495, 78, 59, 83, 48, 49, 50, 38, 59, 59,
+ 54, 55, 661, 59, 509, 59, 1, 38, 667, 4,
+ 5, 6, 7, 77, 77, 520, 7, 12, 13, 14,
+ 38, 4, 5, 6, 7, 79, 80, 10, 82, 12,
+ 13, 14, 27, 28, 77, 30, 16, 77, 36, 544,
+ 78, 36, 547, 59, 77, 28, 1, 30, 3, 4,
+ 5, 6, 7, 8, 9, 77, 11, 12, 13, 14,
+ 15, 76, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 582, 33, 34,
+ 585, 59, 77, 17, 77, 40, 81, 82, 43, 76,
+ 76, 596, 77, 48, 49, 50, 36, 76, 9, 54,
+ 55, 77, 77, 77, 59, 59, 0, 77, 1, 614,
+ 81, 4, 5, 6, 7, 76, 76, 10, 77, 12,
+ 13, 14, 77, 78, 79, 80, 1, 82, 3, 4,
+ 5, 6, 7, 8, 9, 28, 11, 12, 13, 14,
+ 15, 646, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 77, 33, 34,
+ 557, 0, 211, 3, 4, 40, 289, 7, 43, 5,
+ 6, 7, 436, 48, 49, 50, 12, 13, 14, 54,
+ 55, 542, 53, 188, 59, 288, 417, 424, 1, 82,
+ 30, 4, 5, 6, 7, 331, 235, 426, 323, 12,
+ 13, 14, 77, 436, 79, 80, 1, 82, 3, 4,
+ 50, 243, 329, 8, 9, 28, 11, 389, 438, 59,
+ 15, 610, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 610, 29, 662, 31, 283, 33, 34,
+ 664, 362, 5, 6, 7, 40, -1, -1, 43, 12,
13, 14, -1, 48, 49, 50, -1, -1, -1, 54,
- 55, -1, -1, -1, 59, 28, -1, 30, -1, -1,
- -1, 4, 5, 6, 7, -1, -1, -1, -1, 12,
- 13, 14, 77, -1, 79, 80, 1, 82, 3, 4,
- -1, -1, -1, 8, 9, 28, 11, 30, -1, -1,
+ 55, -1, -1, -1, 59, 1, -1, 30, 4, 82,
+ 6, 7, -1, -1, 3, 4, 12, 13, 14, -1,
+ -1, -1, 77, 78, 79, 80, 1, 82, 3, 4,
+ -1, -1, 28, 8, 9, 31, 11, -1, -1, -1,
+ 15, 30, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, -1, 29, -1, 31, -1, 33, 34,
+ -1, 50, -1, -1, -1, 40, -1, -1, 43, -1,
+ 59, -1, -1, 48, 49, 50, -1, -1, -1, 54,
+ 55, 77, 78, 1, 59, 3, 4, 5, 6, 7,
+ -1, -1, 10, -1, 12, 13, 14, 3, 4, 5,
+ 6, 7, 77, -1, 79, 80, 1, 82, 3, 4,
+ 28, -1, 30, 8, 9, -1, 11, -1, -1, -1,
15, -1, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, -1, 29, -1, 31, -1, 33, 34,
- -1, -1, 5, 6, 7, 40, -1, -1, 43, 12,
- 13, 14, -1, 48, 49, 50, -1, -1, -1, 54,
- 55, -1, -1, 1, 59, 3, 4, 30, -1, -1,
- 8, 9, -1, 11, 45, 46, 47, 48, 49, 50,
- 51, 52, 77, -1, 79, 80, -1, 82, -1, -1,
- -1, 29, -1, 31, -1, 33, 34, -1, -1, -1,
- -1, -1, 40, -1, -1, 43, -1, -1, -1, -1,
+ 48, 49, 50, 51, 52, 40, -1, 27, 43, -1,
+ 30, -1, -1, 48, 49, 50, 36, -1, 76, 54,
+ 55, 6, 7, 1, 59, 3, 4, 12, 13, 14,
+ 8, 9, -1, 11, -1, -1, -1, -1, -1, 59,
+ 60, -1, 77, -1, 79, 80, -1, 82, -1, -1,
+ -1, 29, -1, 31, -1, 33, 34, 77, -1, -1,
+ -1, 81, 40, 54, 55, 43, 57, 58, 59, 60,
48, 49, 50, -1, -1, -1, 54, 55, -1, -1,
58, 59, 60, 1, -1, 3, 4, -1, -1, -1,
8, 9, -1, 11, -1, -1, -1, -1, -1, -1,
@@ -1093,25 +1085,25 @@ static const short yycheck[] = { 40,
54, 55, 3, -1, -1, 59, -1, 8, 9, -1,
11, -1, 79, 80, -1, -1, 83, -1, -1, -1,
-1, -1, -1, -1, -1, 79, 80, -1, 29, 83,
- 31, -1, 33, 34, 10, -1, -1, -1, -1, 40,
- -1, -1, 43, -1, -1, -1, -1, 48, 49, 50,
- -1, -1, -1, 54, 55, -1, -1, -1, 59, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, -1, 79, 80,
+ 31, -1, 33, 34, -1, 4, 5, 6, 7, 40,
+ -1, -1, 43, 12, 13, 14, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, -1, 59, 28,
+ -1, 30, -1, -1, -1, -1, 4, -1, 6, 7,
+ -1, -1, -1, -1, 12, 13, 14, -1, 79, 80,
-1, -1, 83, 3, 4, 5, 6, 7, 8, 9,
- -1, 11, 12, 13, 14, 15, -1, 17, 18, 19,
+ 28, 11, 12, 13, 14, 15, -1, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, -1, 33, 34, -1, -1, -1, -1, -1,
- 40, -1, -1, 43, -1, -1, -1, -1, 48, 49,
- 50, 30, -1, -1, 54, 55, 35, 36, 37, 59,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, -1, -1, -1, 77, -1, 79,
- 80, -1, 82, 3, 4, -1, -1, -1, 8, 9,
+ 30, 31, 50, 33, 34, -1, 4, 5, 6, 7,
+ 40, 59, 60, 43, 12, 13, 14, -1, 48, 49,
+ 50, -1, -1, -1, 54, 55, -1, -1, 1, 59,
+ 28, 4, 5, 6, 7, -1, -1, 10, -1, 12,
+ 13, 14, -1, -1, -1, -1, -1, 77, -1, 79,
+ 80, -1, 82, 3, 4, 28, -1, 30, 8, 9,
-1, 11, -1, -1, -1, 15, -1, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, -1, 29,
-1, 31, -1, 33, 34, -1, -1, -1, -1, -1,
40, -1, -1, 43, -1, -1, -1, -1, 48, 49,
- 50, -1, -1, -1, 54, 55, -1, 3, -1, 59,
+ 50, -1, -1, 76, 54, 55, -1, 3, -1, 59,
-1, -1, 8, 9, -1, 11, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 77, -1, 79,
80, -1, 82, 29, -1, 31, -1, 33, 34, -1,
@@ -1143,27 +1135,36 @@ static const short yycheck[] = { 40,
55, 29, -1, 31, 59, 33, 34, -1, -1, -1,
-1, -1, 40, -1, -1, 43, -1, -1, -1, -1,
48, 49, 50, -1, 79, 80, 54, 55, -1, -1,
- 1, 59, 3, 4, 5, 6, 7, -1, -1, -1,
- -1, 12, 13, 14, -1, -1, -1, -1, -1, -1,
+ 1, 59, 3, 4, 5, 6, 7, 4, -1, 6,
+ 7, 12, 13, 14, -1, 12, 13, 14, -1, -1,
-1, 79, 80, -1, -1, -1, 27, 28, -1, 30,
- 31, 37, -1, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, -1, 10, 50,
- -1, -1, -1, -1, -1, 35, 36, 37, 59, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 35, 36, 37, 77, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 35, 36, 37, 83, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, -1, -1,
- -1, 83, 35, 36, 37, 38, 39, 40, 41, 42,
+ 31, 28, -1, -1, -1, 4, 5, 6, 7, -1,
+ -1, -1, -1, 12, 13, 14, -1, -1, -1, 50,
+ -1, -1, -1, -1, -1, -1, -1, 10, 59, 28,
+ 37, 30, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 77, -1, -1, -1,
+ 77, 78, 35, 36, 37, -1, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ -1, -1, -1, -1, -1, 35, 36, 37, 77, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52
+ 50, 51, 52, -1, -1, -1, 30, -1, -1, 10,
+ 83, 35, 36, 37, -1, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, -1,
+ -1, -1, -1, 83, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 1, -1, -1, 4, -1, 6, 7, -1,
+ -1, -1, -1, 12, 13, 14, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 28,
+ -1, -1, 31, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 35, 36, 37, -1, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/bison.simple"
+#line 3 "/usr/cygnus/progressive-98r1/share/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -1356,7 +1357,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/share/bison.simple"
+#line 196 "/usr/cygnus/progressive-98r1/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -1661,14 +1662,14 @@ yyreduce:
switch (yyn) {
case 1:
-#line 233 "c-parse.y"
+#line 234 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids an empty source file");
finish_file ();
;
break;}
case 2:
-#line 238 "c-parse.y"
+#line 239 "c-parse.y"
{
/* In case there were missing closebraces,
get us back to the global binding level. */
@@ -1678,15 +1679,15 @@ case 2:
;
break;}
case 3:
-#line 252 "c-parse.y"
+#line 253 "c-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 5:
-#line 253 "c-parse.y"
+#line 254 "c-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 9:
-#line 260 "c-parse.y"
+#line 261 "c-parse.y"
{ STRIP_NOPS (yyvsp[-2].ttype);
if ((TREE_CODE (yyvsp[-2].ttype) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (yyvsp[-2].ttype, 0)) == STRING_CST)
@@ -1696,11 +1697,11 @@ case 9:
error ("argument of `asm' is not a constant string"); ;
break;}
case 10:
-#line 268 "c-parse.y"
+#line 269 "c-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 11:
-#line 273 "c-parse.y"
+#line 274 "c-parse.y"
{ if (pedantic)
error ("ANSI C forbids data definition with no type or storage class");
else if (!flag_traditional)
@@ -1712,45 +1713,45 @@ case 11:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 12:
-#line 283 "c-parse.y"
+#line 284 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 13:
-#line 288 "c-parse.y"
+#line 289 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 14:
-#line 293 "c-parse.y"
+#line 294 "c-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 15:
-#line 295 "c-parse.y"
+#line 296 "c-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 18:
-#line 299 "c-parse.y"
+#line 300 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C does not allow extra `;' outside of a function"); ;
break;}
case 19:
-#line 305 "c-parse.y"
+#line 306 "c-parse.y"
{ if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 20:
-#line 310 "c-parse.y"
+#line 311 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 21:
-#line 312 "c-parse.y"
+#line 313 "c-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -1758,25 +1759,25 @@ case 21:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 22:
-#line 318 "c-parse.y"
+#line 319 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 23:
-#line 323 "c-parse.y"
+#line 324 "c-parse.y"
{ if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 24:
-#line 328 "c-parse.y"
+#line 329 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 25:
-#line 330 "c-parse.y"
+#line 331 "c-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -1784,25 +1785,25 @@ case 25:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 26:
-#line 336 "c-parse.y"
+#line 337 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 27:
-#line 341 "c-parse.y"
+#line 342 "c-parse.y"
{ if (! start_function (NULL_TREE, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 28:
-#line 346 "c-parse.y"
+#line 347 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 29:
-#line 348 "c-parse.y"
+#line 349 "c-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -1810,72 +1811,72 @@ case 29:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 30:
-#line 354 "c-parse.y"
+#line 355 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 33:
-#line 366 "c-parse.y"
+#line 367 "c-parse.y"
{ yyval.code = ADDR_EXPR; ;
break;}
case 34:
-#line 368 "c-parse.y"
+#line 369 "c-parse.y"
{ yyval.code = NEGATE_EXPR; ;
break;}
case 35:
-#line 370 "c-parse.y"
+#line 371 "c-parse.y"
{ yyval.code = CONVERT_EXPR; ;
break;}
case 36:
-#line 372 "c-parse.y"
+#line 373 "c-parse.y"
{ yyval.code = PREINCREMENT_EXPR; ;
break;}
case 37:
-#line 374 "c-parse.y"
+#line 375 "c-parse.y"
{ yyval.code = PREDECREMENT_EXPR; ;
break;}
case 38:
-#line 376 "c-parse.y"
+#line 377 "c-parse.y"
{ yyval.code = BIT_NOT_EXPR; ;
break;}
case 39:
-#line 378 "c-parse.y"
+#line 379 "c-parse.y"
{ yyval.code = TRUTH_NOT_EXPR; ;
break;}
case 40:
-#line 382 "c-parse.y"
+#line 383 "c-parse.y"
{ yyval.ttype = build_compound_expr (yyvsp[0].ttype); ;
break;}
case 41:
-#line 387 "c-parse.y"
+#line 388 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 43:
-#line 393 "c-parse.y"
+#line 394 "c-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 44:
-#line 395 "c-parse.y"
+#line 396 "c-parse.y"
{ chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 46:
-#line 401 "c-parse.y"
+#line 402 "c-parse.y"
{ yyval.ttype = build_indirect_ref (yyvsp[0].ttype, "unary *"); ;
break;}
case 47:
-#line 404 "c-parse.y"
+#line 405 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 48:
-#line 407 "c-parse.y"
+#line 408 "c-parse.y"
{ yyval.ttype = build_unary_op (yyvsp[-1].code, yyvsp[0].ttype, 0);
overflow_warning (yyval.ttype); ;
break;}
case 49:
-#line 411 "c-parse.y"
+#line 412 "c-parse.y"
{ tree label = lookup_label (yyvsp[0].ttype);
if (pedantic)
pedwarn ("ANSI C forbids `&&'");
@@ -1890,7 +1891,7 @@ case 49:
;
break;}
case 50:
-#line 439 "c-parse.y"
+#line 440 "c-parse.y"
{ skip_evaluation--;
if (TREE_CODE (yyvsp[0].ttype) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (yyvsp[0].ttype, 1)))
@@ -1898,49 +1899,49 @@ case 50:
yyval.ttype = c_sizeof (TREE_TYPE (yyvsp[0].ttype)); ;
break;}
case 51:
-#line 445 "c-parse.y"
+#line 446 "c-parse.y"
{ skip_evaluation--;
yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 52:
-#line 448 "c-parse.y"
+#line 449 "c-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof_expr (yyvsp[0].ttype); ;
break;}
case 53:
-#line 451 "c-parse.y"
+#line 452 "c-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 54:
-#line 454 "c-parse.y"
+#line 455 "c-parse.y"
{ yyval.ttype = build_unary_op (REALPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 55:
-#line 456 "c-parse.y"
+#line 457 "c-parse.y"
{ yyval.ttype = build_unary_op (IMAGPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 56:
-#line 460 "c-parse.y"
+#line 461 "c-parse.y"
{ skip_evaluation++; ;
break;}
case 57:
-#line 464 "c-parse.y"
+#line 465 "c-parse.y"
{ skip_evaluation++; ;
break;}
case 59:
-#line 470 "c-parse.y"
+#line 471 "c-parse.y"
{ tree type = groktypename (yyvsp[-2].ttype);
yyval.ttype = build_c_cast (type, yyvsp[0].ttype); ;
break;}
case 60:
-#line 473 "c-parse.y"
+#line 474 "c-parse.y"
{ start_init (NULL_TREE, NULL, 0);
yyvsp[-2].ttype = groktypename (yyvsp[-2].ttype);
really_start_incremental_init (yyvsp[-2].ttype); ;
break;}
case 61:
-#line 477 "c-parse.y"
+#line 478 "c-parse.y"
{ char *name;
tree result = pop_init_level (0);
tree type = yyvsp[-5].ttype;
@@ -1967,90 +1968,90 @@ case 61:
;
break;}
case 63:
-#line 506 "c-parse.y"
+#line 507 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 64:
-#line 508 "c-parse.y"
+#line 509 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 65:
-#line 510 "c-parse.y"
+#line 511 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 66:
-#line 512 "c-parse.y"
+#line 513 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 67:
-#line 514 "c-parse.y"
+#line 515 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 68:
-#line 516 "c-parse.y"
+#line 517 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 69:
-#line 518 "c-parse.y"
+#line 519 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 70:
-#line 520 "c-parse.y"
+#line 521 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 71:
-#line 522 "c-parse.y"
+#line 523 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 72:
-#line 524 "c-parse.y"
+#line 525 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 73:
-#line 526 "c-parse.y"
+#line 527 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 74:
-#line 528 "c-parse.y"
+#line 529 "c-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 75:
-#line 530 "c-parse.y"
+#line 531 "c-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 76:
-#line 533 "c-parse.y"
+#line 534 "c-parse.y"
{ skip_evaluation -= yyvsp[-3].ttype == boolean_false_node;
yyval.ttype = parser_build_binary_op (TRUTH_ANDIF_EXPR, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 77:
-#line 536 "c-parse.y"
+#line 537 "c-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 78:
-#line 539 "c-parse.y"
+#line 540 "c-parse.y"
{ skip_evaluation -= yyvsp[-3].ttype == boolean_true_node;
yyval.ttype = parser_build_binary_op (TRUTH_ORIF_EXPR, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 79:
-#line 542 "c-parse.y"
+#line 543 "c-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 80:
-#line 545 "c-parse.y"
+#line 546 "c-parse.y"
{ skip_evaluation += ((yyvsp[-4].ttype == boolean_true_node)
- (yyvsp[-4].ttype == boolean_false_node)); ;
break;}
case 81:
-#line 548 "c-parse.y"
+#line 549 "c-parse.y"
{ skip_evaluation -= yyvsp[-6].ttype == boolean_true_node;
yyval.ttype = build_conditional_expr (yyvsp[-6].ttype, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 82:
-#line 551 "c-parse.y"
+#line 552 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids omitting the middle term of a ?: expression");
/* Make sure first operand is calculated only once. */
@@ -2059,23 +2060,23 @@ case 82:
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 83:
-#line 558 "c-parse.y"
+#line 559 "c-parse.y"
{ skip_evaluation -= yyvsp[-4].ttype == boolean_true_node;
yyval.ttype = build_conditional_expr (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 84:
-#line 561 "c-parse.y"
+#line 562 "c-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, NOP_EXPR, yyvsp[0].ttype);
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, MODIFY_EXPR); ;
break;}
case 85:
-#line 564 "c-parse.y"
+#line 565 "c-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, yyvsp[-1].code, yyvsp[0].ttype);
/* This inhibits warnings in truthvalue_conversion. */
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, ERROR_MARK); ;
break;}
case 86:
-#line 571 "c-parse.y"
+#line 572 "c-parse.y"
{
yyval.ttype = lastiddecl;
if (!yyval.ttype || yyval.ttype == error_mark_node)
@@ -2175,11 +2176,11 @@ case 86:
;
break;}
case 88:
-#line 670 "c-parse.y"
+#line 671 "c-parse.y"
{ yyval.ttype = combine_strings (yyvsp[0].ttype); ;
break;}
case 89:
-#line 672 "c-parse.y"
+#line 673 "c-parse.y"
{ char class = TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype));
if (class == 'e' || class == '1'
|| class == '2' || class == '<')
@@ -2187,11 +2188,11 @@ case 89:
yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 90:
-#line 678 "c-parse.y"
+#line 679 "c-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 91:
-#line 680 "c-parse.y"
+#line 681 "c-parse.y"
{ if (current_function_decl == 0)
{
error ("braced-group within expression allowed only inside a function");
@@ -2207,7 +2208,7 @@ case 91:
yyval.ttype = expand_start_stmt_expr (); ;
break;}
case 92:
-#line 694 "c-parse.y"
+#line 695 "c-parse.y"
{ tree rtl_exp;
if (pedantic)
pedwarn ("ANSI C forbids braced-groups within expressions");
@@ -2232,21 +2233,21 @@ case 92:
;
break;}
case 93:
-#line 717 "c-parse.y"
+#line 718 "c-parse.y"
{ yyval.ttype = build_function_call (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 94:
-#line 719 "c-parse.y"
+#line 720 "c-parse.y"
{ yyval.ttype = build_array_ref (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 95:
-#line 721 "c-parse.y"
+#line 722 "c-parse.y"
{
yyval.ttype = build_component_ref (yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
case 96:
-#line 725 "c-parse.y"
+#line 726 "c-parse.y"
{
tree expr = build_indirect_ref (yyvsp[-2].ttype, "->");
@@ -2254,56 +2255,56 @@ case 96:
;
break;}
case 97:
-#line 731 "c-parse.y"
+#line 732 "c-parse.y"
{ yyval.ttype = build_unary_op (POSTINCREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 98:
-#line 733 "c-parse.y"
+#line 734 "c-parse.y"
{ yyval.ttype = build_unary_op (POSTDECREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 100:
-#line 740 "c-parse.y"
+#line 741 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 103:
-#line 749 "c-parse.y"
+#line 750 "c-parse.y"
{ c_mark_varargs ();
if (pedantic)
pedwarn ("ANSI C does not permit use of `varargs.h'"); ;
break;}
case 104:
-#line 759 "c-parse.y"
+#line 760 "c-parse.y"
{ ;
break;}
case 109:
-#line 775 "c-parse.y"
+#line 776 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 110:
-#line 780 "c-parse.y"
+#line 781 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 111:
-#line 785 "c-parse.y"
+#line 786 "c-parse.y"
{ shadow_tag_warned (yyvsp[-1].ttype, 1);
pedwarn ("empty declaration"); ;
break;}
case 112:
-#line 788 "c-parse.y"
+#line 789 "c-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 113:
-#line 797 "c-parse.y"
+#line 798 "c-parse.y"
{ ;
break;}
case 118:
-#line 812 "c-parse.y"
+#line 813 "c-parse.y"
{ yyval.itype = suspend_momentary ();
pending_xref_error ();
declspec_stack = tree_cons (prefix_attributes,
@@ -2313,131 +2314,131 @@ case 118:
&current_declspecs, &prefix_attributes); ;
break;}
case 119:
-#line 823 "c-parse.y"
+#line 824 "c-parse.y"
{ prefix_attributes = chainon (prefix_attributes, yyvsp[0].ttype); ;
break;}
case 120:
-#line 828 "c-parse.y"
+#line 829 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 121:
-#line 833 "c-parse.y"
+#line 834 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 122:
-#line 838 "c-parse.y"
+#line 839 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
case 123:
-#line 843 "c-parse.y"
+#line 844 "c-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
case 124:
-#line 848 "c-parse.y"
+#line 849 "c-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 125:
-#line 850 "c-parse.y"
+#line 851 "c-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 126:
-#line 852 "c-parse.y"
+#line 853 "c-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 127:
-#line 862 "c-parse.y"
+#line 863 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 128:
-#line 864 "c-parse.y"
+#line 865 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 129:
-#line 868 "c-parse.y"
+#line 869 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 130:
-#line 870 "c-parse.y"
+#line 871 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 131:
-#line 872 "c-parse.y"
+#line 873 "c-parse.y"
{ if (extra_warnings)
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 132:
-#line 877 "c-parse.y"
+#line 878 "c-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 133:
-#line 882 "c-parse.y"
+#line 883 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 134:
-#line 884 "c-parse.y"
+#line 885 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 135:
-#line 889 "c-parse.y"
+#line 890 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 136:
-#line 891 "c-parse.y"
+#line 892 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 137:
-#line 893 "c-parse.y"
+#line 894 "c-parse.y"
{ if (extra_warnings)
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 138:
-#line 906 "c-parse.y"
+#line 907 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 139:
-#line 908 "c-parse.y"
+#line 909 "c-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
case 140:
-#line 910 "c-parse.y"
+#line 911 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 141:
-#line 912 "c-parse.y"
+#line 913 "c-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 142:
-#line 917 "c-parse.y"
+#line 918 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 143:
-#line 920 "c-parse.y"
+#line 921 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 144:
-#line 922 "c-parse.y"
+#line 923 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 145:
-#line 925 "c-parse.y"
+#line 926 "c-parse.y"
{ if (extra_warnings && TREE_STATIC (yyvsp[-1].ttype))
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
@@ -2445,138 +2446,138 @@ case 145:
TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ;
break;}
case 146:
-#line 939 "c-parse.y"
+#line 940 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 147:
-#line 941 "c-parse.y"
+#line 942 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 148:
-#line 945 "c-parse.y"
+#line 946 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 149:
-#line 947 "c-parse.y"
+#line 948 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 152:
-#line 957 "c-parse.y"
+#line 958 "c-parse.y"
{ /* For a typedef name, record the meaning, not the name.
In case of `foo foo, bar;'. */
yyval.ttype = lookup_name (yyvsp[0].ttype); ;
break;}
case 153:
-#line 961 "c-parse.y"
+#line 962 "c-parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[-1].ttype); ;
break;}
case 154:
-#line 963 "c-parse.y"
+#line 964 "c-parse.y"
{ yyval.ttype = groktypename (yyvsp[-1].ttype); ;
break;}
case 162:
-#line 985 "c-parse.y"
+#line 986 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 163:
-#line 987 "c-parse.y"
+#line 988 "c-parse.y"
{ if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype);
yyval.ttype = yyvsp[-1].ttype;
;
break;}
case 164:
-#line 994 "c-parse.y"
+#line 995 "c-parse.y"
{ yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1,
yyvsp[-1].ttype, prefix_attributes);
start_init (yyval.ttype, yyvsp[-2].ttype, global_bindings_p ()); ;
break;}
case 165:
-#line 999 "c-parse.y"
+#line 1000 "c-parse.y"
{ finish_init ();
finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 166:
-#line 1002 "c-parse.y"
+#line 1003 "c-parse.y"
{ tree d = start_decl (yyvsp[-2].ttype, current_declspecs, 0,
yyvsp[0].ttype, prefix_attributes);
finish_decl (d, NULL_TREE, yyvsp[-1].ttype);
;
break;}
case 167:
-#line 1010 "c-parse.y"
+#line 1011 "c-parse.y"
{ yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1,
yyvsp[-1].ttype, prefix_attributes);
start_init (yyval.ttype, yyvsp[-2].ttype, global_bindings_p ()); ;
break;}
case 168:
-#line 1015 "c-parse.y"
+#line 1016 "c-parse.y"
{ finish_init ();
decl_attributes (yyvsp[-1].ttype, yyvsp[-3].ttype, prefix_attributes);
finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 169:
-#line 1019 "c-parse.y"
+#line 1020 "c-parse.y"
{ tree d = start_decl (yyvsp[-2].ttype, current_declspecs, 0,
yyvsp[0].ttype, prefix_attributes);
finish_decl (d, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 170:
-#line 1027 "c-parse.y"
+#line 1028 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 171:
-#line 1029 "c-parse.y"
+#line 1030 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 172:
-#line 1034 "c-parse.y"
+#line 1035 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 173:
-#line 1036 "c-parse.y"
+#line 1037 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 174:
-#line 1041 "c-parse.y"
+#line 1042 "c-parse.y"
{ yyval.ttype = yyvsp[-2].ttype; ;
break;}
case 175:
-#line 1046 "c-parse.y"
+#line 1047 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 176:
-#line 1048 "c-parse.y"
+#line 1049 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 177:
-#line 1053 "c-parse.y"
+#line 1054 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 178:
-#line 1055 "c-parse.y"
+#line 1056 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 179:
-#line 1057 "c-parse.y"
+#line 1058 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ;
break;}
case 180:
-#line 1059 "c-parse.y"
+#line 1060 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ;
break;}
case 181:
-#line 1061 "c-parse.y"
+#line 1062 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 187:
-#line 1079 "c-parse.y"
+#line 1080 "c-parse.y"
{ really_start_incremental_init (NULL_TREE);
/* Note that the call to clear_momentary
is in process_init_element. */
push_momentary (); ;
break;}
case 188:
-#line 1084 "c-parse.y"
+#line 1085 "c-parse.y"
{ yyval.ttype = pop_init_level (0);
if (yyval.ttype == error_mark_node
&& ! (yychar == STRING || yychar == CONSTANT))
@@ -2585,48 +2586,48 @@ case 188:
pop_momentary_nofree (); ;
break;}
case 189:
-#line 1092 "c-parse.y"
+#line 1093 "c-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 190:
-#line 1098 "c-parse.y"
+#line 1099 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids empty initializer braces"); ;
break;}
case 194:
-#line 1112 "c-parse.y"
+#line 1113 "c-parse.y"
{ process_init_element (yyvsp[0].ttype); ;
break;}
case 195:
-#line 1114 "c-parse.y"
+#line 1115 "c-parse.y"
{ push_init_level (0); ;
break;}
case 196:
-#line 1116 "c-parse.y"
+#line 1117 "c-parse.y"
{ process_init_element (pop_init_level (0)); ;
break;}
case 198:
-#line 1122 "c-parse.y"
+#line 1123 "c-parse.y"
{ set_init_index (yyvsp[-4].ttype, yyvsp[-2].ttype); ;
break;}
case 200:
-#line 1125 "c-parse.y"
+#line 1126 "c-parse.y"
{ set_init_index (yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 202:
-#line 1128 "c-parse.y"
+#line 1129 "c-parse.y"
{ set_init_index (yyvsp[-1].ttype, NULL_TREE); ;
break;}
case 204:
-#line 1131 "c-parse.y"
+#line 1132 "c-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 206:
-#line 1134 "c-parse.y"
+#line 1135 "c-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 208:
-#line 1140 "c-parse.y"
+#line 1141 "c-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -2637,16 +2638,16 @@ case 208:
reinit_parse_for_function (); ;
break;}
case 209:
-#line 1149 "c-parse.y"
+#line 1150 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 210:
-#line 1157 "c-parse.y"
+#line 1158 "c-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 211:
-#line 1163 "c-parse.y"
+#line 1164 "c-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -2657,328 +2658,352 @@ case 211:
reinit_parse_for_function (); ;
break;}
case 212:
-#line 1172 "c-parse.y"
+#line 1173 "c-parse.y"
{ store_parm_decls (); ;
break;}
case 213:
-#line 1180 "c-parse.y"
+#line 1181 "c-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 216:
-#line 1196 "c-parse.y"
+#line 1197 "c-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 217:
-#line 1198 "c-parse.y"
+#line 1199 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 218:
-#line 1203 "c-parse.y"
+#line 1204 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 219:
-#line 1205 "c-parse.y"
+#line 1206 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 220:
-#line 1207 "c-parse.y"
+#line 1208 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 221:
-#line 1214 "c-parse.y"
+#line 1215 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 223:
-#line 1225 "c-parse.y"
+#line 1226 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 224:
-#line 1230 "c-parse.y"
+#line 1231 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 225:
-#line 1232 "c-parse.y"
+#line 1233 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 226:
-#line 1234 "c-parse.y"
+#line 1235 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 227:
-#line 1241 "c-parse.y"
+#line 1242 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 229:
-#line 1250 "c-parse.y"
+#line 1251 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 230:
-#line 1255 "c-parse.y"
+#line 1256 "c-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 231:
-#line 1257 "c-parse.y"
+#line 1258 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 232:
-#line 1259 "c-parse.y"
+#line 1260 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 233:
-#line 1261 "c-parse.y"
+#line 1262 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 234:
-#line 1268 "c-parse.y"
+#line 1269 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 236:
-#line 1274 "c-parse.y"
-{ yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype);
- /* Start scope of tag before parsing components. */
- ;
+#line 1275 "c-parse.y"
+{ yyval.ttype = NULL_TREE; ;
break;}
case 237:
-#line 1278 "c-parse.y"
-{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
+#line 1277 "c-parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 238:
-#line 1280 "c-parse.y"
-{ yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
- yyvsp[-2].ttype, yyvsp[0].ttype);
- ;
+#line 1282 "c-parse.y"
+{ yyval.ttype = NULL_TREE; ;
break;}
case 239:
#line 1284 "c-parse.y"
-{ yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ;
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 240:
-#line 1286 "c-parse.y"
-{ yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ;
+#line 1289 "c-parse.y"
+{ yyval.ttype = NULL_TREE; ;
break;}
case 241:
-#line 1288 "c-parse.y"
-{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
+#line 1291 "c-parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 242:
-#line 1290 "c-parse.y"
-{ yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
- yyvsp[-2].ttype, yyvsp[0].ttype);
+#line 1296 "c-parse.y"
+{ yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype);
+ /* Start scope of tag before parsing components. */
;
break;}
case 243:
-#line 1294 "c-parse.y"
-{ yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ;
+#line 1300 "c-parse.y"
+{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); ;
break;}
case 244:
-#line 1296 "c-parse.y"
+#line 1302 "c-parse.y"
+{ yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
+ yyvsp[-2].ttype, chainon (yyvsp[-4].ttype, yyvsp[0].ttype));
+ ;
+ break;}
+case 245:
+#line 1306 "c-parse.y"
+{ yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ;
+ break;}
+case 246:
+#line 1308 "c-parse.y"
+{ yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ;
+ break;}
+case 247:
+#line 1310 "c-parse.y"
+{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); ;
+ break;}
+case 248:
+#line 1312 "c-parse.y"
+{ yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
+ yyvsp[-2].ttype, chainon (yyvsp[-4].ttype, yyvsp[0].ttype));
+ ;
+ break;}
+case 249:
+#line 1316 "c-parse.y"
+{ yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ;
+ break;}
+case 250:
+#line 1318 "c-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (yyvsp[-1].ttype); ;
break;}
-case 245:
-#line 1299 "c-parse.y"
-{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
+case 251:
+#line 1321 "c-parse.y"
+{ yyval.ttype= finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), chainon (yyvsp[-7].ttype, yyvsp[0].ttype));
resume_momentary (yyvsp[-5].itype); ;
break;}
-case 246:
-#line 1302 "c-parse.y"
+case 252:
+#line 1324 "c-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (NULL_TREE); ;
break;}
-case 247:
-#line 1305 "c-parse.y"
-{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
+case 253:
+#line 1327 "c-parse.y"
+{ yyval.ttype= finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), chainon (yyvsp[-6].ttype, yyvsp[0].ttype));
resume_momentary (yyvsp[-5].itype); ;
break;}
-case 248:
-#line 1308 "c-parse.y"
+case 254:
+#line 1330 "c-parse.y"
{ yyval.ttype = xref_tag (ENUMERAL_TYPE, yyvsp[0].ttype); ;
break;}
-case 252:
-#line 1319 "c-parse.y"
+case 258:
+#line 1341 "c-parse.y"
{ if (pedantic) pedwarn ("comma at end of enumerator list"); ;
break;}
-case 253:
-#line 1324 "c-parse.y"
+case 259:
+#line 1346 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 254:
-#line 1326 "c-parse.y"
+case 260:
+#line 1348 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
pedwarn ("no semicolon at end of struct or union"); ;
break;}
-case 255:
-#line 1331 "c-parse.y"
+case 261:
+#line 1353 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 256:
-#line 1333 "c-parse.y"
+case 262:
+#line 1355 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 257:
-#line 1335 "c-parse.y"
+case 263:
+#line 1357 "c-parse.y"
{ if (pedantic)
pedwarn ("extra semicolon in struct or union specified"); ;
break;}
-case 258:
-#line 1350 "c-parse.y"
+case 264:
+#line 1372 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
-case 259:
-#line 1356 "c-parse.y"
+case 265:
+#line 1378 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids member declarations with no members");
shadow_tag(yyvsp[0].ttype);
yyval.ttype = NULL_TREE; ;
break;}
-case 260:
-#line 1361 "c-parse.y"
+case 266:
+#line 1383 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
-case 261:
-#line 1367 "c-parse.y"
+case 267:
+#line 1389 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids member declarations with no members");
shadow_tag(yyvsp[0].ttype);
yyval.ttype = NULL_TREE; ;
break;}
-case 262:
-#line 1372 "c-parse.y"
+case 268:
+#line 1394 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 263:
-#line 1374 "c-parse.y"
+case 269:
+#line 1396 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
-case 265:
-#line 1381 "c-parse.y"
+case 271:
+#line 1403 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 266:
-#line 1386 "c-parse.y"
+case 272:
+#line 1408 "c-parse.y"
{ yyval.ttype = grokfield (yyvsp[-3].filename, yyvsp[-2].lineno, yyvsp[-1].ttype, current_declspecs, NULL_TREE);
decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 267:
-#line 1390 "c-parse.y"
+case 273:
+#line 1412 "c-parse.y"
{ yyval.ttype = grokfield (yyvsp[-5].filename, yyvsp[-4].lineno, yyvsp[-3].ttype, current_declspecs, yyvsp[-1].ttype);
decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 268:
-#line 1393 "c-parse.y"
+case 274:
+#line 1415 "c-parse.y"
{ yyval.ttype = grokfield (yyvsp[-4].filename, yyvsp[-3].lineno, NULL_TREE, current_declspecs, yyvsp[-1].ttype);
decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 270:
-#line 1405 "c-parse.y"
+case 276:
+#line 1427 "c-parse.y"
{ if (yyvsp[-2].ttype == error_mark_node)
yyval.ttype = yyvsp[-2].ttype;
else
yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-2].ttype); ;
break;}
-case 271:
-#line 1410 "c-parse.y"
+case 277:
+#line 1432 "c-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
-case 272:
-#line 1416 "c-parse.y"
+case 278:
+#line 1438 "c-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 273:
-#line 1418 "c-parse.y"
+case 279:
+#line 1440 "c-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 274:
-#line 1423 "c-parse.y"
+case 280:
+#line 1445 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 275:
-#line 1425 "c-parse.y"
+case 281:
+#line 1447 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 276:
-#line 1430 "c-parse.y"
+case 282:
+#line 1452 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 278:
-#line 1436 "c-parse.y"
+case 284:
+#line 1458 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 279:
-#line 1438 "c-parse.y"
+case 285:
+#line 1460 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 280:
-#line 1443 "c-parse.y"
+case 286:
+#line 1465 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 281:
-#line 1445 "c-parse.y"
+case 287:
+#line 1467 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 282:
-#line 1450 "c-parse.y"
+case 288:
+#line 1472 "c-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 283:
-#line 1453 "c-parse.y"
+case 289:
+#line 1475 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 284:
-#line 1455 "c-parse.y"
+case 290:
+#line 1477 "c-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 285:
-#line 1457 "c-parse.y"
+case 291:
+#line 1479 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 286:
-#line 1459 "c-parse.y"
+case 292:
+#line 1481 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 287:
-#line 1461 "c-parse.y"
+case 293:
+#line 1483 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
-case 288:
-#line 1463 "c-parse.y"
+case 294:
+#line 1485 "c-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 289:
-#line 1465 "c-parse.y"
+case 295:
+#line 1487 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 290:
-#line 1467 "c-parse.y"
+case 296:
+#line 1489 "c-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
-case 291:
-#line 1478 "c-parse.y"
+case 297:
+#line 1500 "c-parse.y"
{
if (pedantic && yyvsp[0].ends_in_label)
pedwarn ("ANSI C forbids label at end of compound statement");
;
break;}
-case 293:
-#line 1487 "c-parse.y"
+case 299:
+#line 1509 "c-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
-case 294:
-#line 1489 "c-parse.y"
+case 300:
+#line 1511 "c-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
-case 298:
-#line 1501 "c-parse.y"
+case 304:
+#line 1523 "c-parse.y"
{ emit_line_note (input_filename, lineno);
pushlevel (0);
clear_last_expr ();
@@ -2986,13 +3011,13 @@ case 298:
expand_start_bindings (0);
;
break;}
-case 300:
-#line 1514 "c-parse.y"
+case 306:
+#line 1536 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids label declarations"); ;
break;}
-case 303:
-#line 1525 "c-parse.y"
+case 309:
+#line 1547 "c-parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -3002,20 +3027,20 @@ case 303:
}
;
break;}
-case 304:
-#line 1539 "c-parse.y"
+case 310:
+#line 1561 "c-parse.y"
{;
break;}
-case 306:
-#line 1543 "c-parse.y"
+case 312:
+#line 1565 "c-parse.y"
{ compstmt_count++; ;
break;}
-case 307:
-#line 1546 "c-parse.y"
+case 313:
+#line 1568 "c-parse.y"
{ yyval.ttype = convert (void_type_node, integer_zero_node); ;
break;}
-case 308:
-#line 1548 "c-parse.y"
+case 314:
+#line 1570 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
yyval.ttype = poplevel (1, 1, 0);
@@ -3024,8 +3049,8 @@ case 308:
else
pop_momentary (); ;
break;}
-case 309:
-#line 1556 "c-parse.y"
+case 315:
+#line 1578 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
yyval.ttype = poplevel (kept_level_p (), 0, 0);
@@ -3034,8 +3059,8 @@ case 309:
else
pop_momentary (); ;
break;}
-case 310:
-#line 1564 "c-parse.y"
+case 316:
+#line 1586 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
yyval.ttype = poplevel (kept_level_p (), 0, 0);
@@ -3044,8 +3069,8 @@ case 310:
else
pop_momentary (); ;
break;}
-case 313:
-#line 1584 "c-parse.y"
+case 319:
+#line 1606 "c-parse.y"
{ emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_cond (truthvalue_conversion (yyvsp[-1].ttype), 0,
compstmt_count);
@@ -3054,8 +3079,8 @@ case 313:
if_stmt_line = yyvsp[-4].lineno;
position_after_white_space (); ;
break;}
-case 314:
-#line 1598 "c-parse.y"
+case 320:
+#line 1620 "c-parse.y"
{ stmt_count++;
compstmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
@@ -3064,44 +3089,44 @@ case 314:
expand_start_loop_continue_elsewhere (1);
position_after_white_space (); ;
break;}
-case 315:
-#line 1606 "c-parse.y"
+case 321:
+#line 1628 "c-parse.y"
{ expand_loop_continue_here (); ;
break;}
-case 316:
-#line 1610 "c-parse.y"
+case 322:
+#line 1632 "c-parse.y"
{ yyval.filename = input_filename; ;
break;}
-case 317:
-#line 1614 "c-parse.y"
+case 323:
+#line 1636 "c-parse.y"
{ yyval.lineno = lineno; ;
break;}
-case 318:
-#line 1619 "c-parse.y"
+case 324:
+#line 1641 "c-parse.y"
{ ;
break;}
-case 319:
-#line 1624 "c-parse.y"
+case 325:
+#line 1646 "c-parse.y"
{ ;
break;}
-case 320:
-#line 1629 "c-parse.y"
+case 326:
+#line 1651 "c-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
-case 321:
-#line 1634 "c-parse.y"
+case 327:
+#line 1656 "c-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
-case 322:
-#line 1636 "c-parse.y"
+case 328:
+#line 1658 "c-parse.y"
{ yyval.ends_in_label = 1; ;
break;}
-case 323:
-#line 1642 "c-parse.y"
+case 329:
+#line 1664 "c-parse.y"
{ stmt_count++; ;
break;}
-case 325:
-#line 1645 "c-parse.y"
+case 331:
+#line 1667 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
/* It appears that this should not be done--that a non-lvalue array
@@ -3119,20 +3144,20 @@ case 325:
iterator_expand (yyvsp[-1].ttype);
clear_momentary (); ;
break;}
-case 326:
-#line 1662 "c-parse.y"
+case 332:
+#line 1684 "c-parse.y"
{ c_expand_start_else ();
yyvsp[-1].itype = stmt_count;
position_after_white_space (); ;
break;}
-case 327:
-#line 1666 "c-parse.y"
+case 333:
+#line 1688 "c-parse.y"
{ c_expand_end_cond ();
if (extra_warnings && stmt_count == yyvsp[-3].itype)
warning ("empty body in an else-statement"); ;
break;}
-case 328:
-#line 1670 "c-parse.y"
+case 334:
+#line 1692 "c-parse.y"
{ c_expand_end_cond ();
/* This warning is here instead of in simple_if, because we
do not want a warning if an empty if is followed by an
@@ -3142,12 +3167,12 @@ case 328:
warning_with_file_and_line (if_stmt_file, if_stmt_line,
"empty body in an if-statement"); ;
break;}
-case 329:
-#line 1682 "c-parse.y"
+case 335:
+#line 1704 "c-parse.y"
{ c_expand_end_cond (); ;
break;}
-case 330:
-#line 1684 "c-parse.y"
+case 336:
+#line 1706 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
/* The emit_nop used to come before emit_line_note,
@@ -3158,8 +3183,8 @@ case 330:
We will see. --rms, July 15, 1991. */
emit_nop (); ;
break;}
-case 331:
-#line 1694 "c-parse.y"
+case 337:
+#line 1716 "c-parse.y"
{ /* Don't start the loop till we have succeeded
in parsing the end test. This is to make sure
that we end every loop we start. */
@@ -3169,25 +3194,25 @@ case 331:
truthvalue_conversion (yyvsp[-1].ttype));
position_after_white_space (); ;
break;}
-case 332:
-#line 1703 "c-parse.y"
+case 338:
+#line 1725 "c-parse.y"
{ expand_end_loop (); ;
break;}
-case 333:
-#line 1706 "c-parse.y"
+case 339:
+#line 1728 "c-parse.y"
{ emit_line_note (input_filename, lineno);
expand_exit_loop_if_false (NULL_PTR,
truthvalue_conversion (yyvsp[-2].ttype));
expand_end_loop ();
clear_momentary (); ;
break;}
-case 334:
-#line 1713 "c-parse.y"
+case 340:
+#line 1735 "c-parse.y"
{ expand_end_loop ();
clear_momentary (); ;
break;}
-case 335:
-#line 1717 "c-parse.y"
+case 341:
+#line 1739 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
/* See comment in `while' alternative, above. */
@@ -3199,13 +3224,13 @@ case 335:
fn without calling expand_end_loop. */
;
break;}
-case 336:
-#line 1729 "c-parse.y"
+case 342:
+#line 1751 "c-parse.y"
{ yyvsp[0].lineno = lineno;
yyval.filename = input_filename; ;
break;}
-case 337:
-#line 1732 "c-parse.y"
+case 343:
+#line 1754 "c-parse.y"
{
/* Start the loop. Doing this after parsing
all the expressions ensures we will end the loop. */
@@ -3222,8 +3247,8 @@ case 337:
yyvsp[-2].filename = input_filename;
position_after_white_space (); ;
break;}
-case 338:
-#line 1748 "c-parse.y"
+case 344:
+#line 1770 "c-parse.y"
{ /* Emit the increment expression, with a line number. */
emit_line_note (yyvsp[-4].filename, yyvsp[-5].lineno);
expand_loop_continue_here ();
@@ -3235,8 +3260,8 @@ case 338:
pop_momentary ();
expand_end_loop (); ;
break;}
-case 339:
-#line 1759 "c-parse.y"
+case 345:
+#line 1781 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_case (yyvsp[-1].ttype);
@@ -3245,42 +3270,42 @@ case 339:
push_momentary ();
position_after_white_space (); ;
break;}
-case 340:
-#line 1767 "c-parse.y"
+case 346:
+#line 1789 "c-parse.y"
{ expand_end_case (yyvsp[-3].ttype);
if (yychar == CONSTANT || yychar == STRING)
pop_momentary_nofree ();
else
pop_momentary (); ;
break;}
-case 341:
-#line 1773 "c-parse.y"
+case 347:
+#line 1795 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
if ( ! expand_exit_something ())
error ("break statement not within loop or switch"); ;
break;}
-case 342:
-#line 1778 "c-parse.y"
+case 348:
+#line 1800 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
if (! expand_continue_loop (NULL_PTR))
error ("continue statement not within a loop"); ;
break;}
-case 343:
-#line 1783 "c-parse.y"
+case 349:
+#line 1805 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
c_expand_return (NULL_TREE); ;
break;}
-case 344:
-#line 1787 "c-parse.y"
+case 350:
+#line 1809 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
c_expand_return (yyvsp[-1].ttype); ;
break;}
-case 345:
-#line 1791 "c-parse.y"
+case 351:
+#line 1813 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-7].filename, yyvsp[-6].lineno);
STRIP_NOPS (yyvsp[-2].ttype);
@@ -3291,32 +3316,32 @@ case 345:
else
error ("argument of `asm' is not a constant string"); ;
break;}
-case 346:
-#line 1802 "c-parse.y"
+case 352:
+#line 1824 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-9].filename, yyvsp[-8].lineno);
c_expand_asm_operands (yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, NULL_TREE,
yyvsp[-6].ttype == ridpointers[(int)RID_VOLATILE],
input_filename, lineno); ;
break;}
-case 347:
-#line 1809 "c-parse.y"
+case 353:
+#line 1831 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-11].filename, yyvsp[-10].lineno);
c_expand_asm_operands (yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE,
yyvsp[-8].ttype == ridpointers[(int)RID_VOLATILE],
input_filename, lineno); ;
break;}
-case 348:
-#line 1817 "c-parse.y"
+case 354:
+#line 1839 "c-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-13].filename, yyvsp[-12].lineno);
c_expand_asm_operands (yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype,
yyvsp[-10].ttype == ridpointers[(int)RID_VOLATILE],
input_filename, lineno); ;
break;}
-case 349:
-#line 1823 "c-parse.y"
+case 355:
+#line 1845 "c-parse.y"
{ tree decl;
stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
@@ -3328,16 +3353,16 @@ case 349:
}
;
break;}
-case 350:
-#line 1834 "c-parse.y"
+case 356:
+#line 1856 "c-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids `goto *expr;'");
stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
expand_computed_goto (convert (ptr_type_node, yyvsp[-1].ttype)); ;
break;}
-case 353:
-#line 1849 "c-parse.y"
+case 359:
+#line 1871 "c-parse.y"
{
/* The value returned by this action is */
/* 1 if everything is OK */
@@ -3359,15 +3384,15 @@ case 353:
}
;
break;}
-case 354:
-#line 1870 "c-parse.y"
+case 360:
+#line 1892 "c-parse.y"
{
if (yyvsp[-1].itype)
iterator_for_loop_end (yyvsp[-3].ttype);
;
break;}
-case 355:
-#line 1905 "c-parse.y"
+case 361:
+#line 1927 "c-parse.y"
{ register tree value = check_case_value (yyvsp[-1].ttype);
register tree label
= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -3399,8 +3424,8 @@ case 355:
}
position_after_white_space (); ;
break;}
-case 356:
-#line 1936 "c-parse.y"
+case 362:
+#line 1958 "c-parse.y"
{ register tree value1 = check_case_value (yyvsp[-3].ttype);
register tree value2 = check_case_value (yyvsp[-1].ttype);
register tree label
@@ -3432,8 +3457,8 @@ case 356:
}
position_after_white_space (); ;
break;}
-case 357:
-#line 1967 "c-parse.y"
+case 363:
+#line 1989 "c-parse.y"
{
tree duplicate;
register tree label
@@ -3449,8 +3474,8 @@ case 357:
}
position_after_white_space (); ;
break;}
-case 358:
-#line 1982 "c-parse.y"
+case 364:
+#line 2004 "c-parse.y"
{ tree label = define_label (input_filename, lineno, yyvsp[-1].ttype);
stmt_count++;
emit_nop ();
@@ -3458,53 +3483,53 @@ case 358:
expand_label (label);
position_after_white_space (); ;
break;}
-case 359:
-#line 1994 "c-parse.y"
+case 365:
+#line 2016 "c-parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
-case 360:
-#line 1997 "c-parse.y"
+case 366:
+#line 2019 "c-parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
-case 361:
-#line 2002 "c-parse.y"
+case 367:
+#line 2024 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 363:
-#line 2009 "c-parse.y"
+case 369:
+#line 2031 "c-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 366:
-#line 2016 "c-parse.y"
+case 372:
+#line 2038 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 367:
-#line 2021 "c-parse.y"
+case 373:
+#line 2043 "c-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 368:
-#line 2026 "c-parse.y"
+case 374:
+#line 2048 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), NULL_TREE); ;
break;}
-case 369:
-#line 2028 "c-parse.y"
+case 375:
+#line 2050 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), yyvsp[-2].ttype); ;
break;}
-case 370:
-#line 2034 "c-parse.y"
+case 376:
+#line 2056 "c-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (0); ;
break;}
-case 371:
-#line 2038 "c-parse.y"
+case 377:
+#line 2060 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
-case 373:
-#line 2046 "c-parse.y"
+case 379:
+#line 2068 "c-parse.y"
{ tree parm;
if (pedantic)
pedwarn ("ANSI C forbids forward parameter declarations");
@@ -3513,20 +3538,20 @@ case 373:
TREE_ASM_WRITTEN (parm) = 1;
clear_parm_order (); ;
break;}
-case 374:
-#line 2054 "c-parse.y"
+case 380:
+#line 2076 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 375:
-#line 2056 "c-parse.y"
+case 381:
+#line 2078 "c-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); ;
break;}
-case 376:
-#line 2062 "c-parse.y"
+case 382:
+#line 2084 "c-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
-case 377:
-#line 2064 "c-parse.y"
+case 383:
+#line 2086 "c-parse.y"
{ yyval.ttype = get_parm_info (0);
/* Gcc used to allow this as an extension. However, it does
not work for all targets, and thus has been disabled.
@@ -3537,24 +3562,24 @@ case 377:
error ("ANSI C requires a named argument before `...'");
;
break;}
-case 378:
-#line 2074 "c-parse.y"
+case 384:
+#line 2096 "c-parse.y"
{ yyval.ttype = get_parm_info (1); ;
break;}
-case 379:
-#line 2076 "c-parse.y"
+case 385:
+#line 2098 "c-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
-case 380:
-#line 2081 "c-parse.y"
+case 386:
+#line 2103 "c-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
-case 381:
-#line 2083 "c-parse.y"
+case 387:
+#line 2105 "c-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
-case 382:
-#line 2090 "c-parse.y"
+case 388:
+#line 2112 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3564,8 +3589,8 @@ case 382:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 383:
-#line 2099 "c-parse.y"
+case 389:
+#line 2121 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3575,8 +3600,8 @@ case 383:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 384:
-#line 2108 "c-parse.y"
+case 390:
+#line 2130 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3586,8 +3611,8 @@ case 384:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 385:
-#line 2117 "c-parse.y"
+case 391:
+#line 2139 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3597,8 +3622,8 @@ case 385:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 386:
-#line 2127 "c-parse.y"
+case 392:
+#line 2149 "c-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -3608,50 +3633,50 @@ case 386:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 387:
-#line 2141 "c-parse.y"
+case 393:
+#line 2163 "c-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (1); ;
break;}
-case 388:
-#line 2145 "c-parse.y"
+case 394:
+#line 2167 "c-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
-case 390:
-#line 2153 "c-parse.y"
+case 396:
+#line 2175 "c-parse.y"
{ tree t;
for (t = yyvsp[-1].ttype; t; t = TREE_CHAIN (t))
if (TREE_VALUE (t) == NULL_TREE)
error ("`...' in old-style identifier list");
yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 391:
-#line 2163 "c-parse.y"
+case 397:
+#line 2185 "c-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 392:
-#line 2165 "c-parse.y"
+case 398:
+#line 2187 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 393:
-#line 2171 "c-parse.y"
+case 399:
+#line 2193 "c-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 394:
-#line 2173 "c-parse.y"
+case 400:
+#line 2195 "c-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 395:
-#line 2178 "c-parse.y"
+case 401:
+#line 2200 "c-parse.y"
{ yyval.itype = pedantic;
pedantic = 0; ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/bison.simple"
+#line 498 "/usr/cygnus/progressive-98r1/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -3847,5 +3872,5 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 2182 "c-parse.y"
+#line 2204 "c-parse.y"
diff --git a/gcc/c-parse.gperf b/gcc/c-parse.gperf
index 90cab6ad1d8..017dcb5497e 100644
--- a/gcc/c-parse.gperf
+++ b/gcc/c-parse.gperf
@@ -1,5 +1,5 @@
%{
-/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
+/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
%}
struct resword { char *name; short token; enum rid rid; };
%%
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index d7725e5ca57..16500c5fe35 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -197,6 +197,7 @@ end ifc
%type <ttype> structsp component_decl_list component_decl_list2
%type <ttype> component_decl components component_declarator
%type <ttype> enumlist enumerator
+%type <ttype> struct_head union_head enum_head
%type <ttype> typename absdcl absdcl1 type_quals
%type <ttype> xexpr parms parm identifiers
@@ -1440,42 +1441,63 @@ notype_declarator:
| IDENTIFIER
;
+struct_head:
+ STRUCT
+ { $$ = NULL_TREE; }
+ | STRUCT attributes
+ { $$ = $2; }
+ ;
+
+union_head:
+ UNION
+ { $$ = NULL_TREE; }
+ | UNION attributes
+ { $$ = $2; }
+ ;
+
+enum_head:
+ ENUM
+ { $$ = NULL_TREE; }
+ | ENUM attributes
+ { $$ = $2; }
+ ;
+
structsp:
- STRUCT identifier '{'
+ struct_head identifier '{'
{ $$ = start_struct (RECORD_TYPE, $2);
/* Start scope of tag before parsing components. */
}
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, $5, $7); }
- | STRUCT '{' component_decl_list '}' maybe_attribute
+ { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
+ | struct_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
- $3, $5);
+ $3, chainon ($1, $5));
}
- | STRUCT identifier
+ | struct_head identifier
{ $$ = xref_tag (RECORD_TYPE, $2); }
- | UNION identifier '{'
+ | union_head identifier '{'
{ $$ = start_struct (UNION_TYPE, $2); }
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, $5, $7); }
- | UNION '{' component_decl_list '}' maybe_attribute
+ { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
+ | union_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
- $3, $5);
+ $3, chainon ($1, $5));
}
- | UNION identifier
+ | union_head identifier
{ $$ = xref_tag (UNION_TYPE, $2); }
- | ENUM identifier '{'
+ | enum_head identifier '{'
{ $<itype>3 = suspend_momentary ();
$$ = start_enum ($2); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>4, nreverse ($5), $8);
+ { $$= finish_enum ($<ttype>4, nreverse ($5), chainon ($1, $8));
resume_momentary ($<itype>3); }
- | ENUM '{'
+ | enum_head '{'
{ $<itype>2 = suspend_momentary ();
$$ = start_enum (NULL_TREE); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>3, nreverse ($4), $7);
+ { $$= finish_enum ($<ttype>3, nreverse ($4), chainon ($1, $7));
resume_momentary ($<itype>2); }
- | ENUM identifier
+ | enum_head identifier
{ $$ = xref_tag (ENUMERAL_TYPE, $2); }
;
diff --git a/gcc/c-parse.y b/gcc/c-parse.y
index a67718984cb..ab0d7d16b9d 100644
--- a/gcc/c-parse.y
+++ b/gcc/c-parse.y
@@ -185,6 +185,7 @@ char *language_string = "GNU C";
%type <ttype> structsp component_decl_list component_decl_list2
%type <ttype> component_decl components component_declarator
%type <ttype> enumlist enumerator
+%type <ttype> struct_head union_head enum_head
%type <ttype> typename absdcl absdcl1 type_quals
%type <ttype> xexpr parms parm identifiers
@@ -1269,42 +1270,63 @@ notype_declarator:
| IDENTIFIER
;
+struct_head:
+ STRUCT
+ { $$ = NULL_TREE; }
+ | STRUCT attributes
+ { $$ = $2; }
+ ;
+
+union_head:
+ UNION
+ { $$ = NULL_TREE; }
+ | UNION attributes
+ { $$ = $2; }
+ ;
+
+enum_head:
+ ENUM
+ { $$ = NULL_TREE; }
+ | ENUM attributes
+ { $$ = $2; }
+ ;
+
structsp:
- STRUCT identifier '{'
+ struct_head identifier '{'
{ $$ = start_struct (RECORD_TYPE, $2);
/* Start scope of tag before parsing components. */
}
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, $5, $7); }
- | STRUCT '{' component_decl_list '}' maybe_attribute
+ { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
+ | struct_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
- $3, $5);
+ $3, chainon ($1, $5));
}
- | STRUCT identifier
+ | struct_head identifier
{ $$ = xref_tag (RECORD_TYPE, $2); }
- | UNION identifier '{'
+ | union_head identifier '{'
{ $$ = start_struct (UNION_TYPE, $2); }
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, $5, $7); }
- | UNION '{' component_decl_list '}' maybe_attribute
+ { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
+ | union_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
- $3, $5);
+ $3, chainon ($1, $5));
}
- | UNION identifier
+ | union_head identifier
{ $$ = xref_tag (UNION_TYPE, $2); }
- | ENUM identifier '{'
+ | enum_head identifier '{'
{ $<itype>3 = suspend_momentary ();
$$ = start_enum ($2); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>4, nreverse ($5), $8);
+ { $$= finish_enum ($<ttype>4, nreverse ($5), chainon ($1, $8));
resume_momentary ($<itype>3); }
- | ENUM '{'
+ | enum_head '{'
{ $<itype>2 = suspend_momentary ();
$$ = start_enum (NULL_TREE); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>3, nreverse ($4), $7);
+ { $$= finish_enum ($<ttype>3, nreverse ($4), chainon ($1, $7));
resume_momentary ($<itype>2); }
- | ENUM identifier
+ | enum_head identifier
{ $$ = xref_tag (ENUMERAL_TYPE, $2); }
;
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 270cd20c572..a28679e6e06 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -1,5 +1,5 @@
/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
- Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "rtl.h"
#include "tree.h"
#include "except.h"
#include "function.h"
@@ -28,147 +29,412 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "toplev.h"
-#ifdef HANDLE_SYSV_PRAGMA
+#ifdef HANDLE_GENERIC_PRAGMAS
+#ifdef HANDLE_PRAGMA_PACK
/* When structure field packing is in effect, this variable is the
number of bits to use as the maximum alignment. When packing is not
in effect, this is zero. */
extern int maximum_field_alignment;
+#endif
-/* File used for outputting assembler code. */
-extern FILE *asm_out_file;
-/* Handle one token of a pragma directive. TOKEN is the
- current token, and STRING is its printable form. */
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+typedef struct align_stack
+{
+ int alignment;
+ unsigned int num_pushes;
+ struct align_stack * prev;
+} align_stack;
+
+static struct align_stack * alignment_stack = NULL;
+
+static int push_alignment PROTO((int));
+static int pop_alignment PROTO((void));
+
+/* Push an alignment value onto the stack. */
+static int
+push_alignment (alignment)
+ int alignment;
+{
+ switch (alignment)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ case 16:
+ break;
+ default:
+ warning ("\
+Alignment must be a small power of two, not %d, in #pragma pack",
+ alignment);
+ return 0;
+ }
+
+ if (alignment_stack == NULL
+ || alignment_stack->alignment != alignment)
+ {
+ align_stack * entry;
+
+ entry = (align_stack *) xmalloc (sizeof (* entry));
+
+ if (entry == NULL)
+ {
+ warning ("Out of memory pushing #pragma pack");
+ return 0;
+ }
+
+ entry->alignment = alignment;
+ entry->num_pushes = 1;
+ entry->prev = alignment_stack;
+
+ alignment_stack = entry;
+
+ if (alignment < 8)
+ maximum_field_alignment = alignment * 8;
+ else
+ /* MSVC ignores alignments > 4. */
+ maximum_field_alignment = 0;
+ }
+ else
+ alignment_stack->num_pushes ++;
+
+ return 1;
+}
+
+/* Undo a push of an alignment onto the stack. */
+static int
+pop_alignment ()
+{
+ if (alignment_stack == NULL)
+ {
+ warning ("\
+#pragma pack(pop) encountered without corresponding #pragma pack(push,<n>)");
+ return 0;
+ }
+
+ if (-- alignment_stack->num_pushes == 0)
+ {
+ align_stack * entry;
+
+ entry = alignment_stack->prev;
+
+ if (entry == NULL || entry->alignment > 4)
+ maximum_field_alignment = 0;
+ else
+ maximum_field_alignment = entry->alignment * 8;
+ free (alignment_stack);
+
+ alignment_stack = entry;
+ }
+
+ return 1;
+}
+
+/* Generate 'packed' and 'aligned' attributes for decls whilst a
+ #pragma pack(push... is in effect. */
void
+insert_pack_attributes (node, attributes, prefix)
+ tree node;
+ tree * attributes;
+ tree * prefix;
+{
+ tree a;
+
+ /* If we are not packing, then there is nothing to do. */
+ if (maximum_field_alignment == 0
+ || alignment_stack == NULL)
+ return;
+
+ /* We are only interested in fields. */
+ if (TREE_CODE_CLASS (TREE_CODE (node)) != 'd'
+ || TREE_CODE (node) != FIELD_DECL)
+ return;
+
+ /* Add a 'packed' attribute. */
+ * attributes = tree_cons (get_identifier ("packed"), NULL, * attributes);
+
+ /* If the alignment is > 8 then add an alignment attribute as well. */
+ if (maximum_field_alignment > 8)
+ {
+ /* If the aligned attribute is already present then do not override it. */
+ for (a = * attributes; a; a = TREE_CHAIN (a))
+ {
+ tree name = TREE_PURPOSE (a);
+ if (strcmp (IDENTIFIER_POINTER (name), "aligned") == 0)
+ break;
+ }
+
+ if (a == NULL)
+ for (a = * prefix; a; a = TREE_CHAIN (a))
+ {
+ tree name = TREE_PURPOSE (a);
+ if (strcmp (IDENTIFIER_POINTER (name), "aligned") == 0)
+ break;
+ }
+
+ if (a == NULL)
+ {
+ * attributes = tree_cons
+ (get_identifier ("aligned"),
+ tree_cons (NULL,
+ build_int_2 (maximum_field_alignment / 8, 0),
+ NULL),
+ * attributes);
+ }
+ }
+
+ return;
+}
+#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
+
+#ifdef HANDLE_PRAGMA_WEAK
+static int add_weak PROTO((char *, char *));
+
+static int
+add_weak (name, value)
+ char * name;
+ char * value;
+{
+ struct weak_syms * weak;
+
+ weak = (struct weak_syms *) permalloc (sizeof (struct weak_syms));
+
+ if (weak == NULL)
+ return 0;
+
+ weak->next = weak_decls;
+ weak->name = name;
+ weak->value = value;
+ weak_decls = weak;
+
+ return 1;
+}
+#endif /* HANDLE_PRAGMA_WEAK */
+
+/* Handle one token of a pragma directive. TOKEN is the current token, and
+ STRING is its printable form. Some front ends do not support generating
+ tokens, and will only pass in a STRING. Also some front ends will reuse
+ the buffer containing STRING, so it must be copied to a local buffer if
+ it needs to be preserved.
+
+ If STRING is non-NULL, then the return value will be ignored, and there
+ will be futher calls to handle_pragma_token() in order to handle the rest of
+ the line containing the #pragma directive. If STRING is NULL, the entire
+ line has now been presented to handle_pragma_token() and the return value
+ should be zero if the pragma flawed in some way, or if the pragma was not
+ recognised, and non-zero if it was successfully handled. */
+
+int
handle_pragma_token (string, token)
- char *string;
+ char * string;
tree token;
{
- static enum pragma_state state = ps_start, type;
- static char *name;
- static char *value;
+ static enum pragma_state state = ps_start;
+ static enum pragma_state type;
+ static char * name;
+ static char * value;
static int align;
- if (string == 0)
+ /* If we have reached the end of the #pragma directive then
+ determine what value we should return. */
+
+ if (string == NULL)
{
- if (type == ps_pack)
+ int ret_val = 0;
+
+ switch (type)
{
+ default:
+ abort ();
+ break;
+
+ case ps_done:
+ /* The pragma was not recognised. */
+ break;
+
+#ifdef HANDLE_PRAGMA_PACK
+ case ps_pack:
if (state == ps_right)
- maximum_field_alignment = align * 8;
+ {
+ maximum_field_alignment = align * 8;
+ ret_val = 1;
+ }
else
warning ("malformed `#pragma pack'");
- }
- else if (type == ps_weak)
- {
+ break;
+#endif /* HANDLE_PRAGMA_PACK */
+
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+ case ps_push:
+ if (state == ps_right)
+ ret_val = push_alignment (align);
+ else
+ warning ("incomplete '#pragma pack(push,<n>)'");
+ break;
+
+ case ps_pop:
+ if (state == ps_right)
+ ret_val = pop_alignment ();
+ else
+ warning ("missing closing parenthesis in '#pragma pack(pop)'");
+ break;
+#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
+
#ifdef HANDLE_PRAGMA_WEAK
+ case ps_weak:
if (HANDLE_PRAGMA_WEAK)
- handle_pragma_weak (state, name, value);
-
+ {
+ if (state == ps_name)
+ ret_val = add_weak (name, NULL);
+ else if (state == ps_value)
+ ret_val = add_weak (name, value);
+ else
+ warning ("malformed `#pragma weak'");
+ }
+ else
+ ret_val = 1; /* Ignore the pragma. */
+ break;
#endif /* HANDLE_PRAGMA_WEAK */
}
type = state = ps_start;
- return;
+
+ return ret_val;
}
+ /* If we have been given a token, but it is not an identifier,
+ or a small constant, then something has gone wrong. */
+ if (token)
+ {
+ switch (TREE_CODE (token))
+ {
+ case IDENTIFIER_NODE:
+ break;
+
+ case INTEGER_CST:
+ if (TREE_INT_CST_HIGH (token) != 0)
+ return 0;
+ break;
+
+ default:
+ return 0;
+ }
+ }
+
switch (state)
{
case ps_start:
- if (token && TREE_CODE (token) == IDENTIFIER_NODE)
+ type = state = ps_done;
+#ifdef HANDLE_PRAGMA_PACK
+ if (strcmp (string, "pack") == 0)
+ type = state = ps_pack;
+#endif
+#ifdef HANDLE_PRAGMA_WEAK
+ if (strcmp (string, "weak") == 0)
+ type = state = ps_weak;
+#endif
+ break;
+
+#ifdef HANDLE_PRAGMA_WEAK
+ case ps_weak:
+ name = permalloc (strlen (string) + 1);
+ if (name == NULL)
{
- if (strcmp (IDENTIFIER_POINTER (token), "pack") == 0)
- type = state = ps_pack;
- else if (strcmp (IDENTIFIER_POINTER (token), "weak") == 0)
- type = state = ps_weak;
- else
- {
- type = state = ps_done;
-
- /* Issue a warning message if we have been asked to do so.
- Ignoring unknown pragmas in system header file unless
- an explcit -Wunknown-pragmas has been given. */
- if (warn_unknown_pragmas > 1
- || (warn_unknown_pragmas && ! in_system_header))
- warning ("ignoring pragma: %s", string);
- }
+ warning ("Out of memory parsing #pragma weak");
+ state = ps_bad;
}
else
- type = state = ps_done;
- break;
-
- case ps_weak:
- if (token && TREE_CODE (token) == IDENTIFIER_NODE)
{
- name = IDENTIFIER_POINTER (token);
+ strcpy (name, string);
state = ps_name;
}
- else
- state = ps_bad;
break;
-
+
case ps_name:
state = (strcmp (string, "=") ? ps_bad : ps_equals);
break;
case ps_equals:
- if (token && TREE_CODE (token) == IDENTIFIER_NODE)
+ value = permalloc (strlen (string) + 1);
+ if (value == NULL)
{
- value = IDENTIFIER_POINTER (token);
- state = ps_value;
+ warning ("Out of memory parsing #pragma weak");
+ state = ps_bad;
}
else
- state = ps_bad;
+ {
+ strcpy (value, string);
+ state = ps_value;
+ }
break;
case ps_value:
state = ps_bad;
break;
-
+#endif /* HANDLE_PRAGMA_WEAK */
+
+#ifdef HANDLE_PRAGMA_PACK
case ps_pack:
- if (strcmp (string, "(") == 0)
- state = ps_left;
- else
- state = ps_bad;
+ state = (strcmp (string, "(") ? ps_bad : ps_left);
break;
case ps_left:
- if (token && TREE_CODE (token) == INTEGER_CST
- && TREE_INT_CST_HIGH (token) == 0)
- switch (TREE_INT_CST_LOW (token))
- {
- case 1:
- case 2:
- case 4:
- align = TREE_INT_CST_LOW (token);
- state = ps_align;
- break;
-
- default:
- state = ps_bad;
- }
- else if (! token && strcmp (string, ")") == 0)
+ align = atoi (string);
+ switch (align)
{
- align = 0;
- state = ps_right;
+ case 1:
+ case 2:
+ case 4:
+ state = ps_align;
+ break;
+
+ case 0:
+ state = (strcmp (string, ")") ? ps_bad : ps_right);
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+ if (state == ps_bad)
+ {
+ if (strcmp (string, "push") == 0)
+ type = state = ps_push;
+ else if (strcmp (string, "pop") == 0)
+ type = state = ps_pop;
+ }
+#endif
+ break;
+
+ default:
+ state = ps_bad;
+ break;
}
- else
- state = ps_bad;
break;
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+ case ps_pop:
+#endif
case ps_align:
- if (strcmp (string, ")") == 0)
- state = ps_right;
- else
- state = ps_bad;
+ state = (strcmp (string, ")") ? ps_bad : ps_right);
break;
case ps_right:
state = ps_bad;
break;
+#endif /* HANDLE_PRAGMA_PACK */
+
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+ case ps_push:
+ state = (strcmp (string, ",") ? ps_bad : ps_comma);
+ break;
+ case ps_comma:
+ align = atoi (string);
+ state = ps_align;
+ break;
+#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
+
case ps_bad:
case ps_done:
break;
@@ -176,5 +442,7 @@ handle_pragma_token (string, token)
default:
abort ();
}
+
+ return 1;
}
-#endif /* HANDLE_SYSV_PRAGMA */
+#endif /* HANDLE_GENERIC_PRAGMAS */
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h
index 49c39fa591e..685f54aeb78 100644
--- a/gcc/c-pragma.h
+++ b/gcc/c-pragma.h
@@ -1,5 +1,5 @@
/* Pragma related interfaces.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,29 +18,83 @@ 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. */
+#ifndef _C_PRAGMA_H
+#define _C_PRAGMA_H
+
+#ifdef HANDLE_SYSV_PRAGMA
/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_DEF are
defined. */
#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
#endif
+/* We always support #pragma pack for SYSV pragmas. */
+#ifndef HANDLE_PRAGMA_PACK
+#define HANDLE_PRAGMA_PACK 1
+#endif
+#endif /* HANDLE_SYSV_PRAGMA */
+
+
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+/* If we are supporting #pragma pack(push... then we automatically
+ support #pragma pack(<n>) */
+#define HANDLE_PRAGMA_PACK 1
+#define PRAGMA_INSERT_ATTRIBUTES(node, pattr, prefix_attr) \
+ insert_pack_attributes (node, pattr, prefix_attr)
+extern void insert_pack_attributes PROTO((tree, tree *, tree *));
+#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
+
+
+#ifdef HANDLE_PRAGMA_WEAK
+/* This structure contains any weak symbol declarations waiting to be emitted. */
+struct weak_syms
+{
+ struct weak_syms * next;
+ char * name;
+ char * value;
+};
+
+/* Declared in varasm.c */
+extern struct weak_syms * weak_decls;
+#endif /* HANDLE_PRAGMA_WEAK */
+
+
+#if defined HANDLE_PRAGMA_PACK || defined HANDLE_PRAGMA_WEAK
+/* Define HANDLE_GENERIC_PRAGMAS if any kind of front-end pragma
+ parsing is to be done. The code in GCC's generic C source files
+ will only look for the definition of this constant. They will
+ ignore definitions of HANDLE_PRAGMA_PACK and so on. */
+#define HANDLE_GENERIC_PRAGMAS 1
+#endif
+
+
+#ifdef HANDLE_GENERIC_PRAGMAS
enum pragma_state
{
ps_start,
ps_done,
- ps_bad,
+#ifdef HANDLE_PRAGMA_WEAK
ps_weak,
ps_name,
ps_equals,
ps_value,
+#endif
+#ifdef HANDLE_PRAGMA_PACK
ps_pack,
ps_left,
ps_align,
- ps_right
+ ps_right,
+#endif
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
+ ps_push,
+ ps_pop,
+ ps_comma,
+#endif
+ ps_bad
};
-/* Output asm to handle ``#pragma weak'' */
-extern void handle_pragma_weak PROTO((enum pragma_state, char *, char *));
-
/* Handle a C style pragma */
-extern void handle_pragma_token PROTO((char *, tree));
+extern int handle_pragma_token PROTO((char *, tree));
+
+#endif /* HANDLE_GENERIC_PRAGMAS */
+#endif /* _C_PRAGMA_H */
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 22478522aab..87ec4dac845 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -149,6 +149,7 @@ struct lang_type
extern tree lookup_interface PROTO((tree));
extern tree is_class_name PROTO((tree));
extern void maybe_objc_check_decl PROTO((tree));
+extern void finish_file PROTO((void));
extern int maybe_objc_comptypes PROTO((tree, tree, int));
extern tree maybe_building_objc_message_expr PROTO((void));
extern tree maybe_objc_method_name PROTO((tree));
@@ -163,10 +164,14 @@ extern void declare_function_name PROTO((void));
extern void decl_attributes PROTO((tree, tree, tree));
extern void init_function_format_info PROTO((void));
extern void check_function_format PROTO((tree, tree, tree));
+extern int c_get_alias_set PROTO((tree));
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PROTO((enum tree_code));
extern void c_expand_expr_stmt PROTO((tree));
+extern void c_expand_start_cond PROTO((tree, int, int));
+extern void c_expand_start_else PROTO((void));
+extern void c_expand_end_cond PROTO((void));
/* Validate the expression after `case' and apply default promotions. */
extern tree check_case_value PROTO((tree));
/* Concatenate a list of STRING_CST nodes into one STRING_CST. */
@@ -176,7 +181,14 @@ extern tree convert_and_check PROTO((tree, tree));
extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree));
/* Read the rest of the current #-directive line. */
+#if USE_CPPLIB
+extern char *get_directive_line PROTO((void));
+#define GET_DIRECTIVE_LINE() get_directive_line ()
+#else
extern char *get_directive_line PROTO((FILE *));
+#define GET_DIRECTIVE_LINE() get_directive_line (finput)
+#endif
+
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
@@ -253,7 +265,7 @@ extern tree build_enumerator PROTO((tree, tree));
extern tree builtin_function PROTO((char *, tree, enum built_in_function function_, char *));
/* Add qualifiers to a type, in the fashion for C. */
extern tree c_build_type_variant PROTO((tree, int, int));
-extern int c_decode_option PROTO((char *));
+extern int c_decode_option PROTO((int, char **));
extern void c_mark_varargs PROTO((void));
extern tree check_identifier PROTO((tree, tree));
extern void clear_parm_order PROTO((void));
@@ -367,6 +379,7 @@ extern void c_expand_return PROTO((tree));
extern tree c_expand_start_case PROTO((tree));
/* in c-iterate.c */
+extern void init_iterators PROTO((void));
extern void iterator_expand PROTO((tree));
extern void iterator_for_loop_start PROTO((tree));
extern void iterator_for_loop_end PROTO((tree));
@@ -418,7 +431,7 @@ extern int warn_implicit;
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
-extern int warn_write_strings;
+extern int flag_const_strings;
/* Nonzero means warn about sizeof (function) or addition/subtraction
of function pointers. */
@@ -493,10 +506,13 @@ extern int warn_missing_braces;
extern int warn_sign_compare;
-/* Nonzero means this is a function to call to perform comptypes
- on two record types. */
+/* Warn about multicharacter constants. */
+
+extern int warn_multichar;
-extern int (*comptypes_record_hook) ();
+/* Warn about long long. */
+
+extern int warn_long_long;
/* Nonzero means we are reading code that came from a system header file. */
@@ -506,4 +522,7 @@ extern int system_header_p;
extern int doing_objc_thang;
+/* In c-decl.c */
+extern void finish_incomplete_decl PROTO((tree));
+
#endif /* not _C_TREE_H */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 6c235cd6a67..d77d9cf6bab 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -4423,13 +4423,18 @@ initializer_constant_valid_p (value, endtype)
return initializer_constant_valid_p (TREE_OPERAND (value, 0),
endtype);
- /* Likewise conversions from int to pointers. */
+ /* Likewise conversions from int to pointers, but also allow
+ conversions from 0. */
if (TREE_CODE (TREE_TYPE (value)) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE
- && (TYPE_PRECISION (TREE_TYPE (value))
- <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))))
- return initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE)
+ {
+ if (integer_zerop (TREE_OPERAND (value, 0)))
+ return null_pointer_node;
+ else if (TYPE_PRECISION (TREE_TYPE (value))
+ <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))
+ return initializer_constant_valid_p (TREE_OPERAND (value, 0),
+ endtype);
+ }
/* Allow conversions to union types if the value inside is okay. */
if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE)
@@ -5612,6 +5617,17 @@ pop_init_level (implicit)
if (constructor_type != 0)
size = int_size_in_bytes (constructor_type);
+ /* Warn when some struct elements are implicitly initialized to zero. */
+ if (extra_warnings
+ && constructor_type
+ && TREE_CODE (constructor_type) == RECORD_TYPE
+ && constructor_unfilled_fields)
+ {
+ push_member_name (constructor_unfilled_fields);
+ warning_init ("missing initializer%s", " for `%s'", NULL);
+ RESTORE_SPELLING_DEPTH (constructor_depth);
+ }
+
/* Now output all pending elements. */
output_pending_init_elements (1);
@@ -6855,7 +6871,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (o[i] != TREE_VALUE (tail))
{
expand_expr (build_modify_expr (o[i], NOP_EXPR, TREE_VALUE (tail)),
- 0, VOIDmode, 0);
+ NULL_RTX, VOIDmode, EXPAND_NORMAL);
free_temp_slots ();
}
/* Detect modification of read-only values.
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index c808ecaeeea..03fceaebe65 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#include "basic-block.h"
#include "reload.h"
#include "expr.h"
+#include "toplev.h"
#ifndef MAX_MOVE_MAX
#define MAX_MOVE_MAX MOVE_MAX
@@ -81,9 +82,11 @@ int n_regs_saved;
static void set_reg_live PROTO((rtx, rtx));
static void clear_reg_live PROTO((rtx));
-static void restore_referenced_regs PROTO((rtx, rtx, enum machine_mode));
-static int insert_save_restore PROTO((rtx, int, int,
- enum machine_mode, int));
+static void restore_referenced_regs PROTO((rtx, rtx, int));
+static int insert_restore PROTO((rtx, int, int, int, int));
+static int insert_save PROTO((rtx, int, int, int));
+static void insert_one_insn PROTO((rtx, int, enum rtx_code,
+ rtx, int));
/* Initialize for caller-save.
@@ -114,7 +117,7 @@ init_caller_save ()
{
for (j = 1; j <= MOVE_MAX / UNITS_PER_WORD; j++)
{
- regno_save_mode[i][j] = choose_hard_reg_mode (i, j);
+ regno_save_mode[i][j] = HARD_REGNO_CALLER_SAVE_MODE (i, j);
if (regno_save_mode[i][j] == VOIDmode && j == 1)
{
call_fixed_regs[i] = 1;
@@ -228,13 +231,6 @@ init_save_areas ()
overestimate slightly (especially if some of these registers are later
used as spill registers), but it should not be significant.
- Then perform register elimination in the addresses of the save area
- locations; return 1 if all eliminated addresses are strictly valid.
- We assume that our caller has set up the elimination table to the
- worst (largest) possible offsets.
-
- Set *PCHANGED to 1 if we had to allocate some memory for the save area.
-
Future work:
In the fallback case we should iterate backwards across all possible
@@ -247,14 +243,11 @@ init_save_areas ()
machine independent since they might be saving non-consecutive
registers. (imagine caller-saving d0,d1,a0,a1 on the 68k) */
-int
-setup_save_areas (pchanged)
- int *pchanged;
+void
+setup_save_areas ()
{
int i, j, k;
HARD_REG_SET hard_regs_used;
- int ok = 1;
-
/* Allocate space in the save area for the largest multi-register
pseudos first, then work backwards to single register
@@ -328,28 +321,16 @@ setup_save_areas (pchanged)
regno_save_mem[i+k][1]
= adj_offsettable_operand (temp, k * UNITS_PER_WORD);
}
- *pchanged = 1;
}
}
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- for (j = 1; j <= MOVE_MAX / UNITS_PER_WORD; j++)
- if (regno_save_mem[i][j] != 0)
- ok &= strict_memory_address_p (GET_MODE (regno_save_mem[i][j]),
- XEXP (eliminate_regs (regno_save_mem[i][j], 0, NULL_RTX), 0));
-
- return ok;
+ return;
}
-/* Find the places where hard regs are live across calls and save them.
-
- INSN_MODE is the mode to assign to any insns that we add. This is used
- by reload to determine whether or not reloads or register eliminations
- need be done on these insns. */
+/* Find the places where hard regs are live across calls and save them. */
void
-save_call_clobbered_regs (insn_mode)
- enum machine_mode insn_mode;
+save_call_clobbered_regs ()
{
rtx insn;
int b;
@@ -357,7 +338,6 @@ save_call_clobbered_regs (insn_mode)
for (b = 0; b < n_basic_blocks; b++)
{
regset regs_live = basic_block_live_at_start[b];
- rtx prev_block_last = PREV_INSN (basic_block_head[b]);
int i, j;
int regno;
@@ -398,7 +378,7 @@ save_call_clobbered_regs (insn_mode)
any of them. We must restore them before the insn if so. */
if (n_regs_saved)
- restore_referenced_regs (PATTERN (insn), insn, insn_mode);
+ restore_referenced_regs (PATTERN (insn), insn, b);
/* NB: the normal procedure is to first enliven any
registers set by insn, then deaden any registers that
@@ -448,8 +428,7 @@ save_call_clobbered_regs (insn_mode)
/* It must not be set by this instruction. */
&& ! TEST_HARD_REG_BIT (this_call_sets, regno)
&& ! TEST_HARD_REG_BIT (hard_regs_saved, regno))
- regno += insert_save_restore (insn, 1, regno,
- insn_mode, 0);
+ regno += insert_save (insn, 1, regno, b);
/* Put the information for this CALL_INSN on top of what
we already had. */
@@ -488,13 +467,9 @@ save_call_clobbered_regs (insn_mode)
if (n_regs_saved)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (TEST_HARD_REG_BIT (hard_regs_need_restore, regno))
- regno += insert_save_restore ((GET_CODE (insn) == JUMP_INSN
- ? insn : NEXT_INSN (insn)), 0,
- regno, insn_mode, MOVE_MAX / UNITS_PER_WORD);
-
- /* If we added any insns at the start of the block, update the start
- of the block to point at those insns. */
- basic_block_head[b] = NEXT_INSN (prev_block_last);
+ regno += insert_restore (insn, GET_CODE (insn) == JUMP_INSN,
+ regno,
+ MOVE_MAX / UNITS_PER_WORD, b);
}
}
@@ -505,7 +480,8 @@ save_call_clobbered_regs (insn_mode)
static void
set_reg_live (reg, setter)
- rtx reg, setter;
+ rtx reg;
+ rtx setter ATTRIBUTE_UNUSED;
{
register int regno, endregno, i;
enum machine_mode mode = GET_MODE (reg);
@@ -556,14 +532,14 @@ clear_reg_live (reg)
}
/* If any register currently residing in the save area is referenced in X,
- which is part of INSN, emit code to restore the register in front of INSN.
- INSN_MODE is the mode to assign to any insns that we add. */
+ which is part of INSN, emit code to restore the register in front of
+ INSN. */
static void
-restore_referenced_regs (x, insn, insn_mode)
+restore_referenced_regs (x, insn, block)
rtx x;
rtx insn;
- enum machine_mode insn_mode;
+ int block;
{
enum rtx_code code = GET_CODE (x);
char *fmt;
@@ -582,11 +558,11 @@ restore_referenced_regs (x, insn, insn_mode)
if (regno >= FIRST_PSEUDO_REGISTER
&& reg_equiv_mem[regno] != 0)
restore_referenced_regs (XEXP (reg_equiv_mem[regno], 0),
- insn, insn_mode);
+ insn, block);
else if (regno >= FIRST_PSEUDO_REGISTER
&& reg_equiv_address[regno] != 0)
restore_referenced_regs (reg_equiv_address[regno],
- insn, insn_mode);
+ insn, block);
/* Otherwise if this is a hard register, restore any piece of it that
is currently saved. */
@@ -595,13 +571,13 @@ restore_referenced_regs (x, insn, insn_mode)
{
int numregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
/* Save at most SAVEREGS at a time. This can not be larger than
- MOVE_MAX, because that causes insert_save_restore to fail. */
+ MOVE_MAX, because that causes insert_restore to fail. */
int saveregs = MIN (numregs, MOVE_MAX / UNITS_PER_WORD);
int endregno = regno + numregs;
for (i = regno; i < endregno; i++)
if (TEST_HARD_REG_BIT (hard_regs_need_restore, i))
- i += insert_save_restore (insn, 0, i, insn_mode, saveregs);
+ i += insert_restore (insn, 1, i, saveregs, block);
}
return;
@@ -611,17 +587,16 @@ restore_referenced_regs (x, insn, insn_mode)
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
- restore_referenced_regs (XEXP (x, i), insn, insn_mode);
+ restore_referenced_regs (XEXP (x, i), insn, block);
else if (fmt[i] == 'E')
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- restore_referenced_regs (XVECEXP (x, i, j), insn, insn_mode);
+ restore_referenced_regs (XVECEXP (x, i, j), insn, block);
}
}
-/* Insert a sequence of insns to save or restore, SAVE_P says which,
- REGNO. Place these insns in front of INSN. INSN_MODE is the mode
- to assign to these insns. MAXRESTORE is the maximum number of registers
- which should be restored during this call (when SAVE_P == 0). It should
+/* Insert a sequence of insns to restore REGNO. Place these insns in front
+ of or after INSN (determined by BEFORE_P). MAXRESTORE is the maximum
+ number of registers which should be restored during this call. It should
never be less than 1 since we only work with entire registers.
Note that we have verified in init_caller_save that we can do this
@@ -633,16 +608,18 @@ restore_referenced_regs (x, insn, insn_mode)
Return the extra number of registers saved. */
static int
-insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
+insert_restore (insn, before_p, regno, maxrestore, block)
rtx insn;
- int save_p;
+ int before_p;
int regno;
- enum machine_mode insn_mode;
int maxrestore;
+ int block;
{
rtx pat = NULL_RTX;
enum insn_code code = CODE_FOR_nothing;
int numregs = 0;
+ int i, j, k;
+ int ok;
/* A common failure mode if register status is not correct in the RTL
is for this routine to be called with a REGNO we didn't expect to
@@ -654,108 +631,155 @@ insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
if (regno_save_mem[regno][1] == 0)
abort ();
-#ifdef HAVE_cc0
- /* If INSN references CC0, put our insns in front of the insn that sets
- CC0. This is always safe, since the only way we could be passed an
- insn that references CC0 is for a restore, and doing a restore earlier
- isn't a problem. We do, however, assume here that CALL_INSNs don't
- reference CC0. Guard against non-INSN's like CODE_LABEL. */
-
- if ((GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
- && reg_referenced_p (cc0_rtx, PATTERN (insn)))
- insn = prev_nonnote_insn (insn);
-#endif
-
/* Get the pattern to emit and update our status. */
- if (save_p)
+
+ /* See if we can restore `maxrestore' registers at once. Work
+ backwards to the single register case. */
+ for (i = maxrestore; i > 0; i--)
{
- int i, j, k;
- int ok;
+ ok = 1;
+ if (regno_save_mem[regno][i])
+ for (j = 0; j < i; j++)
+ {
+ if (! TEST_HARD_REG_BIT (hard_regs_need_restore, regno + j))
+ ok = 0;
+ }
+ else
+ continue;
- /* See if we can save several registers with a single instruction.
- Work backwards to the single register case. */
- for (i = MOVE_MAX / UNITS_PER_WORD; i > 0; i--)
+ /* Must do this one restore at a time */
+ if (! ok)
+ continue;
+
+ pat = gen_rtx_SET (VOIDmode,
+ gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
+ regno),
+ regno_save_mem[regno][i]);
+ code = reg_restore_code[regno][i];
+
+
+ /* Clear status for all registers we restored. */
+ for (k = 0; k < i; k++)
{
- ok = 1;
- if (regno_save_mem[regno][i] != 0)
- for (j = 0; j < i; j++)
- {
- if (! call_used_regs[regno + j] || call_fixed_regs[regno + j]
- || ! TEST_HARD_REG_BIT (hard_regs_live, regno + j)
- || TEST_HARD_REG_BIT (hard_regs_saved, regno + j))
- ok = 0;
- }
- else
- continue;
+ CLEAR_HARD_REG_BIT (hard_regs_need_restore, regno + k);
+ n_regs_saved--;
+ }
- /* Must do this one save at a time */
- if (! ok)
- continue;
+ numregs = i;
+ break;
+ }
- pat = gen_rtx_SET (VOIDmode, regno_save_mem[regno][i],
- gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
- regno));
- code = reg_save_code[regno][i];
+ insert_one_insn (insn, before_p, code, pat, block);
- /* Set hard_regs_saved for all the registers we saved. */
- for (k = 0; k < i; k++)
- {
- SET_HARD_REG_BIT (hard_regs_saved, regno + k);
- SET_HARD_REG_BIT (hard_regs_need_restore, regno + k);
- n_regs_saved++;
- }
+ /* Tell our callers how many extra registers we saved/restored */
+ return numregs - 1;
+}
- numregs = i;
- break;
- }
- }
- else
- {
- int i, j, k;
- int ok;
+/* Like insert_restore, but emit code to save REGNO. */
+static int
+insert_save (insn, before_p, regno, block)
+ rtx insn;
+ int before_p;
+ int regno;
+ int block;
+{
+ rtx pat = NULL_RTX;
+ enum insn_code code = CODE_FOR_nothing;
+ int numregs = 0;
+ int i, j, k;
+ int ok;
- /* See if we can restore `maxrestore' registers at once. Work
- backwards to the single register case. */
- for (i = maxrestore; i > 0; i--)
- {
- ok = 1;
- if (regno_save_mem[regno][i])
- for (j = 0; j < i; j++)
- {
- if (! TEST_HARD_REG_BIT (hard_regs_need_restore, regno + j))
- ok = 0;
- }
- else
- continue;
+ /* A common failure mode if register status is not correct in the RTL
+ is for this routine to be called with a REGNO we didn't expect to
+ save. That will cause us to write an insn with a (nil) SET_DEST
+ or SET_SRC. Instead of doing so and causing a crash later, check
+ for this common case and abort here instead. This will remove one
+ step in debugging such problems. */
- /* Must do this one restore at a time */
- if (! ok)
- continue;
-
- pat = gen_rtx_SET (VOIDmode,
- gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
- regno),
- regno_save_mem[regno][i]);
- code = reg_restore_code[regno][i];
+ if (regno_save_mem[regno][1] == 0)
+ abort ();
+ /* Get the pattern to emit and update our status. */
- /* Clear status for all registers we restored. */
- for (k = 0; k < i; k++)
- {
- CLEAR_HARD_REG_BIT (hard_regs_need_restore, regno + k);
- n_regs_saved--;
- }
+ /* See if we can save several registers with a single instruction.
+ Work backwards to the single register case. */
+ for (i = MOVE_MAX / UNITS_PER_WORD; i > 0; i--)
+ {
+ ok = 1;
+ if (regno_save_mem[regno][i] != 0)
+ for (j = 0; j < i; j++)
+ {
+ if (! call_used_regs[regno + j] || call_fixed_regs[regno + j]
+ || ! TEST_HARD_REG_BIT (hard_regs_live, regno + j)
+ || TEST_HARD_REG_BIT (hard_regs_saved, regno + j))
+ ok = 0;
+ }
+ else
+ continue;
- numregs = i;
- break;
- }
+ /* Must do this one save at a time */
+ if (! ok)
+ continue;
+
+ pat = gen_rtx_SET (VOIDmode, regno_save_mem[regno][i],
+ gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
+ regno));
+ code = reg_save_code[regno][i];
+
+ /* Set hard_regs_saved for all the registers we saved. */
+ for (k = 0; k < i; k++)
+ {
+ SET_HARD_REG_BIT (hard_regs_saved, regno + k);
+ SET_HARD_REG_BIT (hard_regs_need_restore, regno + k);
+ n_regs_saved++;
+ }
+
+ numregs = i;
+ break;
}
- /* Emit the insn and set the code and mode. */
- insn = emit_insn_before (pat, insn);
- PUT_MODE (insn, insn_mode);
- INSN_CODE (insn) = code;
+ insert_one_insn (insn, before_p, code, pat, block);
/* Tell our callers how many extra registers we saved/restored */
return numregs - 1;
}
+
+/* Emit one insn, set the code, and update basic block boundaries. */
+static void
+insert_one_insn (insn, before_p, code, pat, block)
+ rtx insn;
+ int before_p;
+ enum rtx_code code;
+ rtx pat;
+ int block;
+{
+ rtx insert_point = insn;
+ rtx new;
+#ifdef HAVE_cc0
+ /* If INSN references CC0, put our insns in front of the insn that sets
+ CC0. This is always safe, since the only way we could be passed an
+ insn that references CC0 is for a restore, and doing a restore earlier
+ isn't a problem. We do, however, assume here that CALL_INSNs don't
+ reference CC0. Guard against non-INSN's like CODE_LABEL. */
+
+ if ((GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
+ && before_p
+ && reg_referenced_p (cc0_rtx, PATTERN (insn)))
+ insert_point = prev_nonnote_insn (insn);
+#endif
+
+ if (before_p)
+ {
+ new = emit_insn_before (pat, insert_point);
+ if (insert_point == basic_block_head[block])
+ basic_block_head[block] = new;
+ }
+ else
+ {
+ new = emit_insn_after (pat, insert_point);
+ if (insert_point == basic_block_end[block])
+ basic_block_end[block] = new;
+ }
+
+ INSN_CODE (new) = code;
+}
diff --git a/gcc/calls.c b/gcc/calls.c
index 16a0346c6a9..2bddc2a32a1 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -19,11 +19,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include "rtl.h"
#include "tree.h"
@@ -32,6 +27,7 @@ Boston, MA 02111-1307, USA. */
#include "regs.h"
#include "insn-flags.h"
#include "toplev.h"
+#include "output.h"
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
@@ -1804,16 +1800,16 @@ expand_call (exp, target, ignore)
{
rtx reg = gen_reg_rtx (word_mode);
rtx word = operand_subword_force (args[i].value, j, BLKmode);
- int bitsize = TYPE_ALIGN (TREE_TYPE (args[i].tree_value));
- int bitpos;
+ int bitsize = MIN (bytes * BITS_PER_UNIT, BITS_PER_WORD);
+ int bitalign = TYPE_ALIGN (TREE_TYPE (args[i].tree_value));
args[i].aligned_regs[j] = reg;
- /* Clobber REG and move each partword into it. Ensure we don't
- go past the end of the structure. Note that the loop below
- works because we've already verified that padding
- and endianness are compatible.
+ /* There is no need to restrict this code to loading items
+ in TYPE_ALIGN sized hunks. The bitfield instructions can
+ load up entire word sized registers efficiently.
+ ??? This may not be needed anymore.
We use to emit a clobber here but that doesn't let later
passes optimize the instructions we emit. By storing 0 into
the register later passes know the first AND to zero out the
@@ -1822,20 +1818,14 @@ expand_call (exp, target, ignore)
emit_move_insn (reg, const0_rtx);
- for (bitpos = 0;
- bitpos < BITS_PER_WORD && bytes > 0;
- bitpos += bitsize, bytes -= bitsize / BITS_PER_UNIT)
- {
- int xbitpos = bitpos + big_endian_correction;
-
- store_bit_field (reg, bitsize, xbitpos, word_mode,
- extract_bit_field (word, bitsize, bitpos, 1,
- NULL_RTX, word_mode,
- word_mode,
- bitsize / BITS_PER_UNIT,
- BITS_PER_WORD),
- bitsize / BITS_PER_UNIT, BITS_PER_WORD);
- }
+ bytes -= bitsize / BITS_PER_UNIT;
+ store_bit_field (reg, bitsize, big_endian_correction, word_mode,
+ extract_bit_field (word, bitsize, 0, 1,
+ NULL_RTX, word_mode,
+ word_mode,
+ bitalign / BITS_PER_UNIT,
+ BITS_PER_WORD),
+ bitalign / BITS_PER_UNIT, BITS_PER_WORD);
}
}
@@ -1921,7 +1911,12 @@ expand_call (exp, target, ignore)
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (reg) == PARALLEL)
- emit_group_load (reg, args[i].value);
+ {
+ emit_group_load (reg, args[i].value,
+ int_size_in_bytes (TREE_TYPE (args[i].tree_value)),
+ (TYPE_ALIGN (TREE_TYPE (args[i].tree_value))
+ / BITS_PER_UNIT));
+ }
/* If simple case, just do move. If normal partial, store_one_arg
has already loaded the register for us. In all other cases,
@@ -2088,15 +2083,17 @@ expand_call (exp, target, ignore)
The Irix 6 ABI has examples of this. */
else if (GET_CODE (valreg) == PARALLEL)
{
+ int bytes = int_size_in_bytes (TREE_TYPE (exp));
+
if (target == 0)
{
- int bytes = int_size_in_bytes (TREE_TYPE (exp));
target = assign_stack_temp (TYPE_MODE (TREE_TYPE (exp)), bytes, 0);
MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp));
preserve_temp_slots (target);
}
- emit_group_store (target, valreg);
+ emit_group_store (target, valreg, bytes,
+ TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT);
}
else if (target && GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp))
&& GET_MODE (target) == GET_MODE (valreg))
@@ -2108,75 +2105,7 @@ expand_call (exp, target, ignore)
when function inlining is being done. */
emit_move_insn (target, valreg);
else if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode)
- {
- /* Some machines (the PA for example) want to return all small
- structures in registers regardless of the structure's alignment.
-
- Deal with them explicitly by copying from the return registers
- into the target MEM locations. */
- int bytes = int_size_in_bytes (TREE_TYPE (exp));
- rtx src, dst;
- int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (exp)), BITS_PER_WORD);
- int bitpos, xbitpos, big_endian_correction = 0;
-
- if (target == 0)
- {
- target = assign_stack_temp (BLKmode, bytes, 0);
- MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp));
- preserve_temp_slots (target);
- }
-
- /* This code assumes valreg is at least a full word. If it isn't,
- copy it into a new pseudo which is a full word. */
- if (GET_MODE (valreg) != BLKmode
- && GET_MODE_SIZE (GET_MODE (valreg)) < UNITS_PER_WORD)
- valreg = convert_to_mode (word_mode, valreg,
- TREE_UNSIGNED (TREE_TYPE (exp)));
-
- /* Structures whose size is not a multiple of a word are aligned
- to the least significant byte (to the right). On a BYTES_BIG_ENDIAN
- machine, this means we must skip the empty high order bytes when
- calculating the bit offset. */
- if (BYTES_BIG_ENDIAN && bytes % UNITS_PER_WORD)
- big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD)
- * BITS_PER_UNIT));
-
- /* Copy the structure BITSIZE bites at a time.
-
- We could probably emit more efficient code for machines
- which do not use strict alignment, but it doesn't seem
- worth the effort at the current time. */
- for (bitpos = 0, xbitpos = big_endian_correction;
- bitpos < bytes * BITS_PER_UNIT;
- bitpos += bitsize, xbitpos += bitsize)
- {
-
- /* We need a new source operand each time xbitpos is on a
- word boundary and when xbitpos == big_endian_correction
- (the first time through). */
- if (xbitpos % BITS_PER_WORD == 0
- || xbitpos == big_endian_correction)
- src = operand_subword_force (valreg,
- xbitpos / BITS_PER_WORD,
- BLKmode);
-
- /* We need a new destination operand each time bitpos is on
- a word boundary. */
- if (bitpos % BITS_PER_WORD == 0)
- dst = operand_subword (target, bitpos / BITS_PER_WORD, 1, BLKmode);
-
- /* Use xbitpos for the source extraction (right justified) and
- xbitpos for the destination store (left justified). */
- store_bit_field (dst, bitsize, bitpos % BITS_PER_WORD, word_mode,
- extract_bit_field (src, bitsize,
- xbitpos % BITS_PER_WORD, 1,
- NULL_RTX, word_mode,
- word_mode,
- bitsize / BITS_PER_UNIT,
- BITS_PER_WORD),
- bitsize / BITS_PER_UNIT, BITS_PER_WORD);
- }
- }
+ target = copy_blkmode_from_reg (target, valreg, TREE_TYPE (exp));
else
target = copy_to_reg (valreg);
diff --git a/gcc/cccp.c b/gcc/cccp.c
index cecdd2ac4eb..b39675d4c93 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -19,11 +19,6 @@ Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#ifdef __STDC__
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
#define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
@@ -45,8 +40,13 @@ typedef unsigned char U_CHAR;
#include "gansidecl.h"
#include "pcp.h"
-#ifndef GET_ENVIRONMENT
-#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
+#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
+#include <locale.h>
+#endif /* MULTIBYTE_CHARS */
+
+#ifndef GET_ENV_PATH_LIST
+#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif
#ifndef STANDARD_INCLUDE_DIR
@@ -78,7 +78,7 @@ static int VMS_fstat (), VMS_stat ();
static int VMS_open ();
static FILE *VMS_fopen ();
static FILE *VMS_freopen ();
-static void hack_vms_include_specification ();
+static int hack_vms_include_specification ();
#define INO_T_EQ(a, b) (!bcmp((char *) &(a), (char *) &(b), sizeof (a)))
#define INO_T_HASH(a) 0
#define INCLUDE_LEN_FUDGE 12 /* leave room for VMS syntax conversion */
@@ -138,16 +138,6 @@ static void hack_vms_include_specification ();
extern char *version_string;
extern char *update_path PROTO((char *, char *));
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT));
HOST_WIDE_INT parse_c_expression PROTO((char *, int));
@@ -431,7 +421,6 @@ static struct default_include {
= {
/* Pick up GNU C++ specific include files. */
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },
- { OLD_GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 },
#ifdef CROSS_COMPILE
/* This is the dir for fixincludes. Put it just before
the files that we fix. */
@@ -1003,7 +992,7 @@ static int discard_comments PROTO((U_CHAR *, int, int));
static int change_newlines PROTO((U_CHAR *, int));
-char *my_strerror PROTO((int));
+static char *my_strerror PROTO((int));
void error PRINTF_PROTO_1((char *, ...));
static void verror PROTO((char *, va_list));
static void error_from_errno PROTO((char *));
@@ -1057,6 +1046,7 @@ GENERIC_PTR xmalloc PROTO((size_t));
static GENERIC_PTR xrealloc PROTO((GENERIC_PTR, size_t));
static GENERIC_PTR xcalloc PROTO((size_t, size_t));
static char *savestring PROTO((char *));
+static void print_help PROTO((void));
/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
retrying if necessary. If MAX_READ_LEN is defined, read at most
@@ -1156,6 +1146,73 @@ eprint_string (string, length)
}
+static void
+print_help ()
+{
+ printf ("Usage: %s [switches] input output\n", progname);
+ printf ("Switches:\n");
+ printf (" -include <file> Include the contents of <file> before other files\n");
+ printf (" -imacros <file> Accept definition of marcos in <file>\n");
+ printf (" -iprefix <path> Specify <path> as a prefix for next two options\n");
+ printf (" -iwithprefix <dir> Add <dir> to the end of the system include paths\n");
+ printf (" -iwithprefixbefore <dir> Add <dir> to the end of the main include paths\n");
+ printf (" -isystem <dir> Add <dir> to the start of the system include paths\n");
+ printf (" -idirafter <dir> Add <dir> to the end of the system include paths\n");
+ printf (" -I <dir> Add <dir> to the end of the main include paths\n");
+ printf (" -nostdinc Do not search the system include directories\n");
+ printf (" -nostdinc++ Do not search the system include directories for C++\n");
+ printf (" -o <file> Put output into <file>\n");
+ printf (" -pedantic Issue all warnings demanded by strict ANSI C\n");
+ printf (" -traditional Follow K&R pre-processor behaviour\n");
+ printf (" -trigraphs Support ANSI C trigraphs\n");
+ printf (" -lang-c Assume that the input sources are in C\n");
+ printf (" -lang-c89 Assume that the input sources are in C89\n");
+ printf (" -lang-c++ Assume that the input sources are in C++\n");
+ printf (" -lang-objc Assume that the input sources are in ObjectiveC\n");
+ printf (" -lang-objc++ Assume that the input sources are in ObjectiveC++\n");
+ printf (" -lang-asm Assume that the input sources are in assembler\n");
+ printf (" -lang-chill Assume that the input sources are in Chill\n");
+ printf (" -+ Allow parsing of C++ style features\n");
+ printf (" -w Inhibit warning messages\n");
+ printf (" -Wtrigraphs Warn if trigraphs are encountered\n");
+ printf (" -Wno-trigraphs Do not warn about trigraphs\n");
+ printf (" -Wcomment{s} Warn if one comment starts inside another\n");
+ printf (" -Wno-comment{s} Do not warn about comments\n");
+ printf (" -Wtraditional Warn if a macro argument is/would be turned into\n");
+ printf (" a string if -tradtional is specified\n");
+ printf (" -Wno-traditional Do not warn about stringification\n");
+ printf (" -Wundef Warn if an undefined macro is used by #if\n");
+ printf (" -Wno-undef Do not warn about testing udefined macros\n");
+ printf (" -Wimport Warn about the use of the #import directive\n");
+ printf (" -Wno-import Do not warn about the use of #import\n");
+ printf (" -Werror Treat all warnings as errors\n");
+ printf (" -Wno-error Do not treat warnings as errors\n");
+ printf (" -Wall Enable all preprocessor warnings\n");
+ printf (" -M Generate make dependencies\n");
+ printf (" -MM As -M, but ignore system header files\n");
+ printf (" -MD As -M, but put output in a .d file\n");
+ printf (" -MMD As -MD, but ignore system header files\n");
+ printf (" -MG Treat missing header file as generated files\n");
+ printf (" -g Include #define and #undef directives in the output\n");
+ printf (" -D<macro> Define a <macro> with string '1' as its value\n");
+ printf (" -D<macro>=<val> Define a <macro> with <val> as its value\n");
+ printf (" -A<question> (<answer>) Assert the <answer> to <question>\n");
+ printf (" -U<macro> Undefine <macro> \n");
+ printf (" -u or -undef Do not predefine any macros\n");
+ printf (" -v Display the version number\n");
+ printf (" -H Print the name of header files as they are used\n");
+ printf (" -C Do not discard comments\n");
+ printf (" -dM Display a list of macro definitions active at end\n");
+ printf (" -dD Preserve macro definitions in output\n");
+ printf (" -dN As -dD except that only the names are preserved\n");
+ printf (" -dI Include #include directives in the output\n");
+ printf (" -ifoutput Describe skipped code blocks in output \n");
+ printf (" -P Do not generate #line directives\n");
+ printf (" -$ Do not include '$' in identifiers\n");
+ printf (" -remap Remap file names when including files.\n");
+ printf (" -h or --help Display this information\n");
+}
+
int
main (argc, argv)
int argc;
@@ -1250,12 +1307,21 @@ main (argc, argv)
bzero ((char *) pend_assertions, argc * sizeof (char *));
bzero ((char *) pend_includes, argc * sizeof (char *));
+#ifdef MULTIBYTE_CHARS
+ /* Change to the native locale for multibyte conversions. */
+ setlocale (LC_CTYPE, "");
+ literal_codeset = getenv ("LANG");
+#endif
+
/* Process switches and find input file name. */
for (i = 1; i < argc; i++) {
if (argv[i][0] != '-') {
if (out_fname != NULL)
- fatal ("Usage: %s [switches] input output", argv[0]);
+ {
+ print_help ();
+ fatal ("Too many arguments");
+ }
else if (in_fname != NULL)
out_fname = argv[i];
else
@@ -1535,6 +1601,13 @@ main (argc, argv)
debug_output = 1;
break;
+ case '-':
+ if (strcmp (argv[i], "--help") != 0)
+ return i;
+ print_help ();
+ exit (0);
+ break;
+
case 'v':
fprintf (stderr, "GNU CPP version %s", version_string);
#ifdef TARGET_VERSION
@@ -1669,7 +1742,7 @@ main (argc, argv)
/* Some people say that CPATH should replace the standard include dirs,
but that seems pointless: it comes before them, so it overrides them
anyway. */
- GET_ENVIRONMENT (cp, "CPATH");
+ GET_ENV_PATH_LIST (cp, "CPATH");
if (cp && ! no_standard_includes)
path_include (cp);
@@ -1853,16 +1926,16 @@ main (argc, argv)
switch ((objc << 1) + cplusplus)
{
case 0:
- GET_ENVIRONMENT (epath, "C_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "C_INCLUDE_PATH");
break;
case 1:
- GET_ENVIRONMENT (epath, "CPLUS_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "CPLUS_INCLUDE_PATH");
break;
case 2:
- GET_ENVIRONMENT (epath, "OBJC_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "OBJC_INCLUDE_PATH");
break;
case 3:
- GET_ENVIRONMENT (epath, "OBJCPLUS_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "OBJCPLUS_INCLUDE_PATH");
break;
}
/* If the environment var for this language is set,
@@ -2706,9 +2779,27 @@ do { ip = &instack[indepth]; \
bp += 2;
else if (*bp == '/' && bp[1] == '*') {
bp += 2;
- while (!(*bp == '*' && bp[1] == '/'))
- bp++;
- bp += 2;
+ while (1)
+ {
+ if (*bp == '*')
+ {
+ if (bp[1] == '/')
+ {
+ bp += 2;
+ break;
+ }
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
+ bp++;
+ }
}
/* There is no point in trying to deal with C++ // comments here,
because if there is one, then this # must be part of the
@@ -2869,6 +2960,24 @@ do { ip = &instack[indepth]; \
if (ibp[-1] == c)
goto while2end;
break;
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ --ibp;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 0)
+ {
+ --obp;
+ bcopy (ibp, obp, length);
+ obp += length;
+ ibp += length;
+ }
+ else
+ ++ibp;
+ }
+ break;
+#endif
}
}
while2end:
@@ -2915,6 +3024,15 @@ do { ip = &instack[indepth]; \
*obp++ = '\n';
++op->lineno;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+#endif
+ }
}
break;
}
@@ -3003,6 +3121,16 @@ do { ip = &instack[indepth]; \
goto limit_reached;
}
break;
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+ }
+ break;
+#endif
}
}
comment_end:
@@ -3365,11 +3493,27 @@ randomchar:
break;
}
}
- if (*ibp == '\n') {
+ else if (*ibp == '\n') {
/* Newline in a file. Count it. */
++ip->lineno;
++op->lineno;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ if (put_out_comments)
+ {
+ bcopy (ibp, obp, length - 1);
+ obp += length - 1;
+ }
+ ibp += (length - 1);
+ }
+#endif
+ }
if (put_out_comments)
*obp++ = *ibp;
}
@@ -3380,9 +3524,32 @@ randomchar:
} else if (! traditional) {
*obp++ = ' ';
}
- for (ibp += 2; *ibp != '\n' || ibp[-1] == '\\'; ibp++)
- if (put_out_comments)
- *obp++ = *ibp;
+ for (ibp += 2; ; ibp++)
+ {
+ if (*ibp == '\n')
+ {
+ if (ibp[-1] != '\\')
+ break;
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ if (put_out_comments)
+ {
+ bcopy (ibp, obp, length - 1);
+ obp += length - 1;
+ }
+ ibp += (length - 1);
+ }
+#endif
+ }
+ if (put_out_comments)
+ *obp++ = *ibp;
+ }
} else
break;
}
@@ -4327,6 +4494,16 @@ get_filename:
simplify_filename (dsp->fname);
nam = base_name (dsp->fname);
*nam = 0;
+#ifdef VMS
+ /* for hack_vms_include_specification(), a local
+ dir specification must start with "./" on VMS. */
+ if (nam == dsp->fname)
+ {
+ *nam++ = '.';
+ *nam++ = '/';
+ *nam = 0;
+ }
+#endif
/* But for efficiency's sake, do not insert the dir
if it matches the search list's first dir. */
dsp->next = search_start;
@@ -4364,7 +4541,7 @@ get_filename:
*/
/* Note: The argument of ISALPHA() can be evaluated twice, so do
the pre-decrement outside of the macro. */
- if (retried && (--fbeg, ISALPHA(*(U_CHAR *) (fbeg)))) {
+ if (retried && (--fin, ISALPHA(*(U_CHAR *) (fin)))) {
while (fin != limit && (!ISSPACE(*fin)))
*fend++ = *fin++;
warning ("VAX-C-style include specification found, use '#include <filename.h>' !");
@@ -4485,22 +4662,37 @@ get_filename:
}
}
- strcpy (fname, searchptr->fname);
- strcat (fname, fbeg);
#ifdef VMS
/* Change this 1/2 Unix 1/2 VMS file specification into a
full VMS file specification */
- if (searchptr->fname[0]) {
- /* Fix up the filename */
- hack_vms_include_specification (fname, vaxc_include);
- } else {
- /* This is a normal VMS filespec, so use it unchanged. */
- strcpy (fname, fbeg);
- /* if it's '#include filename', add the missing .h */
- if (vaxc_include && index(fname,'.')==NULL) {
- strcat (fname, ".h");
+ if (searchptr->fname[0])
+ {
+ strcpy (fname, searchptr->fname);
+ if (fname[strlen (fname) - 1] == ':')
+ {
+ char *slashp;
+ slashp = strchr (fbeg, '/');
+
+ /* start at root-dir of logical device if no path given. */
+ if (slashp == 0)
+ strcat (fname, "[000000]");
+ }
+ strcat (fname, fbeg);
+
+ /* Fix up the filename */
+ hack_vms_include_specification (fname, vaxc_include);
}
- }
+ else
+ {
+ /* This is a normal VMS filespec, so use it unchanged. */
+ strcpy (fname, fbeg);
+ /* if it's '#include filename', add the missing .h */
+ if (vaxc_include && index(fname,'.')==NULL)
+ strcat (fname, ".h");
+ }
+#else
+ strcpy (fname, searchptr->fname);
+ strcat (fname, fbeg);
#endif /* VMS */
f = open_include_file (fname, searchptr, importing, &inc);
if (f != -1) {
@@ -4688,6 +4880,9 @@ absolute_filename (filename)
/* At present, any path that begins with a drive spec is absolute. */
if (ISALPHA (filename[0]) && filename[1] == ':') return 1;
#endif
+#ifdef VMS
+ if (index (filename, ':') != 0) return 1;
+#endif
if (filename[0] == '/') return 1;
#ifdef DIR_SEPARATOR
if (filename[0] == DIR_SEPARATOR) return 1;
@@ -4737,9 +4932,12 @@ simplify_filename (filename)
to0 = to;
for (;;) {
+#ifndef VMS
if (from[0] == '.' && from[1] == '/')
from += 2;
- else {
+ else
+#endif
+ {
/* Copy this component and trailing /, if any. */
while ((*to++ = *from++) != '/') {
if (!to[-1]) {
@@ -4937,7 +5135,16 @@ open_include_file (filename, searchptr, importing, pinc)
fd = open (fname, O_RDONLY, 0);
if (fd < 0)
- return fd;
+ {
+#ifdef VMS
+ /* if #include <dir/file> fails, try again with hacked spec. */
+ if (!hack_vms_include_specification (fname, 0))
+ return fd;
+ fd = open (fname, O_RDONLY, 0);
+ if (fd < 0)
+#endif
+ return fd;
+ }
if (!inc) {
/* FNAME was not in include_hashtab; insert a new entry. */
@@ -5194,7 +5401,7 @@ static char *
check_precompiled (pcf, st, fname, limit)
int pcf;
struct stat *st;
- char *fname;
+ char *fname ATTRIBUTE_UNUSED;
char **limit;
{
int length = 0;
@@ -6078,6 +6285,25 @@ collect_expansion (buf, end, nargs, arglist)
}
}
+#ifdef MULTIBYTE_CHARS
+ /* Handle multibyte characters inside string and character literals. */
+ if (expected_delimiter != '\0')
+ {
+ int length;
+ --p;
+ length = local_mblen (p, limit - p);
+ if (length > 1)
+ {
+ --exp_p;
+ bcopy (p, exp_p, length);
+ p += length;
+ exp_p += length;
+ continue;
+ }
+ ++p;
+ }
+#endif
+
/* Handle the start of a symbol. */
if (is_idchar[c] && nargs > 0) {
U_CHAR *id_beg = p - 1;
@@ -6190,8 +6416,8 @@ collect_expansion (buf, end, nargs, arglist)
static int
do_assert (buf, limit, op, keyword)
U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
+ FILE_BUF *op ATTRIBUTE_UNUSED;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
U_CHAR *bp; /* temp ptr into input buffer */
U_CHAR *symname; /* remember where symbol name starts */
@@ -6267,8 +6493,8 @@ do_assert (buf, limit, op, keyword)
static int
do_unassert (buf, limit, op, keyword)
U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
+ FILE_BUF *op ATTRIBUTE_UNUSED;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
U_CHAR *bp; /* temp ptr into input buffer */
U_CHAR *symname; /* remember where symbol name starts */
@@ -6599,7 +6825,7 @@ static int
do_line (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
register U_CHAR *bp;
FILE_BUF *ip = &instack[indepth];
@@ -6788,8 +7014,8 @@ do_undef (buf, limit, op, keyword)
static int
do_error (buf, limit, op, keyword)
U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
+ FILE_BUF *op ATTRIBUTE_UNUSED;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
int length = limit - buf;
U_CHAR *copy = (U_CHAR *) alloca (length + 1);
@@ -6807,8 +7033,8 @@ do_error (buf, limit, op, keyword)
static int
do_warning (buf, limit, op, keyword)
U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
+ FILE_BUF *op ATTRIBUTE_UNUSED;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
int length = limit - buf;
U_CHAR *copy = (U_CHAR *) alloca (length + 1);
@@ -6846,7 +7072,7 @@ static int
do_ident (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
FILE_BUF trybuf;
int len;
@@ -6875,9 +7101,9 @@ do_ident (buf, limit, op, keyword)
static int
do_pragma (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
+ U_CHAR *buf, *limit ATTRIBUTE_UNUSED;
+ FILE_BUF *op ATTRIBUTE_UNUSED;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
SKIP_WHITE_SPACE (buf);
if (!strncmp ((char *) buf, "once", 4)) {
@@ -6946,9 +7172,9 @@ nope:
static int
do_sccs (buf, limit, op, keyword)
- U_CHAR *buf, *limit;
- FILE_BUF *op;
- struct directive *keyword;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
+ FILE_BUF *op ATTRIBUTE_UNUSED;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
if (pedantic)
pedwarn ("ANSI C does not allow `#sccs'");
@@ -6972,7 +7198,7 @@ static int
do_if (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
HOST_WIDE_INT value;
FILE_BUF *ip = &instack[indepth];
@@ -6989,7 +7215,7 @@ static int
do_elif (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
HOST_WIDE_INT value;
FILE_BUF *ip = &instack[indepth];
@@ -7304,9 +7530,27 @@ skip_if_group (ip, any, op)
bp += 2;
else if (*bp == '/' && bp[1] == '*') {
bp += 2;
- while (!(*bp == '*' && bp[1] == '/'))
- bp++;
- bp += 2;
+ while (1)
+ {
+ if (*bp == '*')
+ {
+ if (bp[1] == '/')
+ {
+ bp += 2;
+ break;
+ }
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, endb - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
+ bp++;
+ }
}
/* There is no point in trying to deal with C++ // comments here,
because if there is one, then this # must be part of the
@@ -7350,6 +7594,15 @@ skip_if_group (ip, any, op)
if (bp[1] == '/')
break;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, endb - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
bp += 2;
} else if (bp[1] == '/' && cplusplus_comments) {
@@ -7361,6 +7614,15 @@ skip_if_group (ip, any, op)
warning ("multiline `//' comment");
ip->lineno++;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, endb - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
} else
break;
@@ -7522,7 +7784,7 @@ static int
do_else (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
FILE_BUF *ip = &instack[indepth];
@@ -7569,7 +7831,7 @@ static int
do_endif (buf, limit, op, keyword)
U_CHAR *buf, *limit;
FILE_BUF *op;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
{
if (pedantic) {
SKIP_WHITE_SPACE (buf);
@@ -7656,6 +7918,15 @@ validate_else (p, limit)
break;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (p, limit - p);
+ if (length > 1)
+ p += (length - 1);
+#endif
+ }
}
}
else if (cplusplus_comments && p[1] == '/')
@@ -7709,6 +7980,22 @@ skip_to_end_of_comment (ip, line_counter, nowarn)
if (op)
++op->lineno;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ {
+ if (op)
+ {
+ bcopy (bp, op->bufp, length - 1);
+ op->bufp += (length - 1);
+ }
+ bp += (length - 1);
+ }
+#endif
+ }
if (op)
*op->bufp++ = *bp;
}
@@ -7746,6 +8033,23 @@ skip_to_end_of_comment (ip, line_counter, nowarn)
return bp;
}
break;
+#ifdef MULTIBYTE_CHARS
+ default:
+ {
+ int length;
+ bp--;
+ length = local_mblen (bp, limit - bp);
+ if (length <= 0)
+ length = 1;
+ if (op)
+ {
+ op->bufp--;
+ bcopy (bp, op->bufp, length);
+ op->bufp += length;
+ }
+ bp += length;
+ }
+#endif
}
}
@@ -7836,6 +8140,16 @@ skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p,
}
} else if (c == match)
break;
+#ifdef MULTIBYTE_CHARS
+ {
+ int length;
+ --bp;
+ length = local_mblen (bp, limit - bp);
+ if (length <= 0)
+ length = 1;
+ bp += length;
+ }
+#endif
}
return bp;
}
@@ -8273,9 +8587,23 @@ macroexpand (hp, op)
else {
if (c == '\\')
escaped = 1;
- if (in_string) {
+ else if (in_string) {
if (c == in_string)
in_string = 0;
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (arg->raw + i, arglen - i);
+ if (length > 1)
+ {
+ bcopy (arg->raw + i, xbuf + totlen, length);
+ i += length - 1;
+ totlen += length;
+ continue;
+ }
+#endif
+ }
} else if (c == '\"' || c == '\'')
in_string = c;
}
@@ -8609,6 +8937,15 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args)
break;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
} else if (bp[1] == '/' && cplusplus_comments) {
*comments = 1;
@@ -8620,6 +8957,15 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args)
if (warn_comments)
warning ("multiline `//' comment");
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
}
break;
@@ -8643,6 +8989,15 @@ macarg1 (start, limit, macro, depthptr, newlines, comments, rest_args)
if (quotec == '\'')
break;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ length = local_mblen (bp, limit - bp);
+ if (length > 1)
+ bp += (length - 1);
+#endif
+ }
}
}
break;
@@ -8720,8 +9075,23 @@ discard_comments (start, length, newlines)
/* Comments are equivalent to spaces. */
obp[-1] = ' ';
ibp++;
- while (ibp < limit && (*ibp != '\n' || ibp[-1] == '\\'))
- ibp++;
+ while (ibp < limit)
+ {
+ if (*ibp == '\n')
+ {
+ if (ibp[-1] != '\\')
+ break;
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+#endif
+ }
+ ibp++;
+ }
break;
}
if (ibp[0] != '*' || ibp + 1 >= limit)
@@ -8741,6 +9111,14 @@ discard_comments (start, length, newlines)
break;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ ibp += (length - 1);
+#endif
+ }
}
break;
@@ -8755,9 +9133,12 @@ discard_comments (start, length, newlines)
*obp++ = c = *ibp++;
if (c == quotec)
break;
- if (c == '\n' && quotec == '\'')
- break;
- if (c == '\\') {
+ if (c == '\n')
+ {
+ if (quotec == '\'')
+ break;
+ }
+ else if (c == '\\') {
if (ibp < limit && *ibp == '\n') {
ibp++;
obp--;
@@ -8768,6 +9149,23 @@ discard_comments (start, length, newlines)
*obp++ = *ibp++;
}
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ ibp--;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ obp--;
+ bcopy (ibp, obp, length);
+ ibp += length;
+ obp += length;
+ }
+ else
+ ibp++;
+#endif
+ }
}
}
break;
@@ -8817,10 +9215,33 @@ change_newlines (start, length)
int quotec = c;
while (ibp < limit) {
*obp++ = c = *ibp++;
- if (c == quotec && ibp[-2] != '\\')
- break;
- if (c == '\n' && quotec == '\'')
- break;
+ if (c == quotec)
+ {
+ if (ibp[-2] != '\\')
+ break;
+ }
+ else if (c == '\n')
+ {
+ if (quotec == '\'')
+ break;
+ }
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ int length;
+ ibp--;
+ length = local_mblen (ibp, limit - ibp);
+ if (length > 1)
+ {
+ obp--;
+ bcopy (ibp, obp, length);
+ ibp += length;
+ obp += length;
+ }
+ else
+ ibp++;
+#endif
+ }
}
}
break;
@@ -8833,7 +9254,7 @@ change_newlines (start, length)
/* my_strerror - return the descriptive text associated with an
`errno' code. */
-char *
+static char *
my_strerror (errnum)
int errnum;
{
@@ -9147,14 +9568,7 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
if (!pedantic_errors && inhibit_warnings)
return;
- if (file) {
- eprint_string (file, file_len);
- fprintf (stderr, ":%d: ", line);
- }
- if (pedantic_errors)
- errors++;
- if (!pedantic_errors)
- fprintf (stderr, "warning: ");
+
VA_START (args, msg);
#ifndef __STDC__
@@ -9164,6 +9578,15 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
msg = va_arg (args, char *);
#endif
+ if (file) {
+ eprint_string (file, file_len);
+ fprintf (stderr, ":%d: ", line);
+ }
+ if (pedantic_errors)
+ errors++;
+ if (!pedantic_errors)
+ fprintf (stderr, "warning: ");
+
vfprintf (stderr, msg, args);
va_end (args);
fprintf (stderr, "\n");
@@ -9976,7 +10399,12 @@ new_include_prefix (prev_file_name, component, prefix, name)
if (len == 1 && dir->fname[len - 1] == '.')
len = 0;
else
+#ifdef VMS
+ /* must be '/', hack_vms_include_specification triggers on it. */
+ dir->fname[len++] = '/';
+#else
dir->fname[len++] = DIR_SEPARATOR;
+#endif
dir->fname[len] = 0;
}
@@ -10224,7 +10652,7 @@ pfatal_with_name (name)
static void
pipe_closed (signo)
/* If this is missing, some compilers complain. */
- int signo;
+ int signo ATTRIBUTE_UNUSED;
{
fatal ("output pipe has been closed");
}
@@ -10281,31 +10709,84 @@ savestring (input)
#ifdef VMS
-/* Under VMS we need to fix up the "include" specification filename so
- that everything following the 1st slash is changed into its correct
- VMS file specification. */
+/* Under VMS we need to fix up the "include" specification filename.
-static void
-hack_vms_include_specification (fname, vaxc_include)
- char *fname;
+ Rules for possible conversions
+
+ fullname tried paths
+
+ name name
+ ./dir/name [.dir]name
+ /dir/name dir:name
+ /name [000000]name, name
+ dir/name dir:[000000]name, dir:name, dir/name
+ dir1/dir2/name dir1:[dir2]name, dir1:[000000.dir2]name
+ path:/name path:[000000]name, path:name
+ path:/dir/name path:[000000.dir]name, path:[dir]name
+ path:dir/name path:[dir]name
+ [path]:[dir]name [path.dir]name
+ path/[dir]name [path.dir]name
+
+ The path:/name input is constructed when expanding <> includes.
+
+ return 1 if name was changed, 0 else. */
+
+static int
+hack_vms_include_specification (fullname, vaxc_include)
+ char *fullname;
int vaxc_include;
{
- register char *cp, *cp1, *cp2;
- int f, check_filename_before_returning;
+ register char *basename, *unixname, *local_ptr, *first_slash;
+ int f, check_filename_before_returning, must_revert;
char Local[512];
check_filename_before_returning = 0;
+ must_revert = 0;
+ /* See if we can find a 1st slash. If not, there's no path information. */
+ first_slash = index (fullname, '/');
+ if (first_slash == 0)
+ return 0; /* Nothing to do!!! */
+
+ /* construct device spec if none given. */
- cp = base_name (fname);
+ if (index (fullname, ':') == 0)
+ {
+
+ /* If fullname has a slash, take it as device spec. */
+
+ if (first_slash == fullname)
+ {
+ first_slash = index (fullname+1, '/'); /* 2nd slash ? */
+ if (first_slash)
+ *first_slash = ':'; /* make device spec */
+ for (basename = fullname; *basename != 0; basename++)
+ *basename = *(basename+1); /* remove leading slash */
+ }
+ else if ((first_slash[-1] != '.') /* keep ':/', './' */
+ && (first_slash[-1] != ':')
+ && (first_slash[-1] != ']')) /* or a vms path */
+ {
+ *first_slash = ':';
+ }
+ else if ((first_slash[1] == '[') /* skip './' in './[dir' */
+ && (first_slash[-1] == '.'))
+ fullname += 2;
+ }
+
+ /* Get part after first ':' (basename[-1] == ':')
+ or last '/' (basename[-1] == '/'). */
+
+ basename = base_name (fullname);
/*
* Check if we have a vax-c style '#include filename'
* and add the missing .h
*/
- if (vaxc_include && !index (cp,'.'))
- strcat (cp, ".h");
- cp2 = Local; /* initialize */
+ if (vaxc_include && !index (basename,'.'))
+ strcat (basename, ".h");
+
+ local_ptr = Local; /* initialize */
/* We are trying to do a number of things here. First of all, we are
trying to hammer the filenames into a standard format, such that later
@@ -10318,112 +10799,195 @@ hack_vms_include_specification (fname, vaxc_include)
If no device is specified, then the first directory name is taken to be
a device name (or a rooted logical). */
- /* See if we found that 1st slash */
- if (cp == 0) return; /* Nothing to do!!! */
- if (*cp != '/') return; /* Nothing to do!!! */
- /* Point to the UNIX filename part (which needs to be fixed!) */
- cp1 = cp+1;
+ /* Point to the UNIX filename part (which needs to be fixed!)
+ but skip vms path information.
+ [basename != fullname since first_slash != 0]. */
+
+ if ((basename[-1] == ':') /* vms path spec. */
+ || (basename[-1] == ']')
+ || (basename[-1] == '>'))
+ unixname = basename;
+ else
+ unixname = fullname;
+
+ if (*unixname == '/')
+ unixname++;
+
/* If the directory spec is not rooted, we can just copy
- the UNIX filename part and we are done */
- if (((cp - fname) > 1) && ((cp[-1] == ']') || (cp[-1] == '>'))) {
- if (cp[-2] != '.') {
- /*
- * The VMS part ends in a `]', and the preceding character is not a `.'.
- * We strip the `]', and then splice the two parts of the name in the
- * usual way. Given the default locations for include files in cccp.c,
- * we will only use this code if the user specifies alternate locations
- * with the /include (-I) switch on the command line. */
- cp -= 1; /* Strip "]" */
- cp1--; /* backspace */
- } else {
- /*
- * The VMS part has a ".]" at the end, and this will not do. Later
- * processing will add a second directory spec, and this would be a syntax
- * error. Thus we strip the ".]", and thus merge the directory specs.
- * We also backspace cp1, so that it points to a '/'. This inhibits the
- * generation of the 000000 root directory spec (which does not belong here
- * in this case).
- */
- cp -= 2; /* Strip ".]" */
- cp1--; }; /* backspace */
- } else {
+ the UNIX filename part and we are done. */
- /* We drop in here if there is no VMS style directory specification yet.
- * If there is no device specification either, we make the first dir a
- * device and try that. If we do not do this, then we will be essentially
- * searching the users default directory (as if they did a #include "asdf.h").
- *
- * Then all we need to do is to push a '[' into the output string. Later
- * processing will fill this in, and close the bracket.
- */
- if (cp[-1] != ':') *cp2++ = ':'; /* dev not in spec. take first dir */
- *cp2++ = '['; /* Open the directory specification */
- }
+ if (((basename - fullname) > 1)
+ && ( (basename[-1] == ']')
+ || (basename[-1] == '>')))
+ {
+ if (basename[-2] != '.')
+ {
+
+ /* The VMS part ends in a `]', and the preceding character is not a `.'.
+ -> PATH]:/name (basename = '/name', unixname = 'name')
+ We strip the `]', and then splice the two parts of the name in the
+ usual way. Given the default locations for include files in cccp.c,
+ we will only use this code if the user specifies alternate locations
+ with the /include (-I) switch on the command line. */
+
+ basename -= 1; /* Strip "]" */
+ unixname--; /* backspace */
+ }
+ else
+ {
+
+ /* The VMS part has a ".]" at the end, and this will not do. Later
+ processing will add a second directory spec, and this would be a syntax
+ error. Thus we strip the ".]", and thus merge the directory specs.
+ We also backspace unixname, so that it points to a '/'. This inhibits the
+ generation of the 000000 root directory spec (which does not belong here
+ in this case). */
+
+ basename -= 2; /* Strip ".]" */
+ unixname--; /* backspace */
+ }
+ }
+
+ else
+
+ {
+
+ /* We drop in here if there is no VMS style directory specification yet.
+ If there is no device specification either, we make the first dir a
+ device and try that. If we do not do this, then we will be essentially
+ searching the users default directory (as if they did a #include "asdf.h").
+
+ Then all we need to do is to push a '[' into the output string. Later
+ processing will fill this in, and close the bracket. */
+
+ if ((unixname != fullname) /* vms path spec found. */
+ && (basename[-1] != ':'))
+ *local_ptr++ = ':'; /* dev not in spec. take first dir */
+
+ *local_ptr++ = '['; /* Open the directory specification */
+ }
+
+ if (unixname == fullname) /* no vms dir spec. */
+ {
+ must_revert = 1;
+ if ((first_slash != 0) /* unix dir spec. */
+ && (*unixname != '/') /* not beginning with '/' */
+ && (*unixname != '.')) /* or './' or '../' */
+ *local_ptr++ = '.'; /* dir is local ! */
+ }
/* at this point we assume that we have the device spec, and (at least
the opening "[" for a directory specification. We may have directories
- specified already */
+ specified already.
- /* If there are no other slashes then the filename will be
+ If there are no other slashes then the filename will be
in the "root" directory. Otherwise, we need to add
directory specifications. */
- if (index (cp1, '/') == 0) {
- /* Just add "000000]" as the directory string */
- strcpy (cp2, "000000]");
- cp2 += strlen (cp2);
- check_filename_before_returning = 1; /* we might need to fool with this later */
- } else {
- /* As long as there are still subdirectories to add, do them. */
- while (index (cp1, '/') != 0) {
- /* If this token is "." we can ignore it */
- if ((cp1[0] == '.') && (cp1[1] == '/')) {
- cp1 += 2;
- continue;
- }
- /* Add a subdirectory spec. Do not duplicate "." */
- if (cp2[-1] != '.' && cp2[-1] != '[' && cp2[-1] != '<')
- *cp2++ = '.';
- /* If this is ".." then the spec becomes "-" */
- if ((cp1[0] == '.') && (cp1[1] == '.') && (cp[2] == '/')) {
- /* Add "-" and skip the ".." */
- *cp2++ = '-';
- cp1 += 3;
- continue;
- }
- /* Copy the subdirectory */
- while (*cp1 != '/') *cp2++= *cp1++;
- cp1++; /* Skip the "/" */
+
+ if (index (unixname, '/') == 0)
+ {
+ /* if no directories specified yet and none are following. */
+ if (local_ptr[-1] == '[')
+ {
+ /* Just add "000000]" as the directory string */
+ strcpy (local_ptr, "000000]");
+ local_ptr += strlen (local_ptr);
+ check_filename_before_returning = 1; /* we might need to fool with this later */
+ }
+ }
+ else
+ {
+
+ /* As long as there are still subdirectories to add, do them. */
+ while (index (unixname, '/') != 0)
+ {
+ /* If this token is "." we can ignore it
+ if it's not at the beginning of a path. */
+ if ((unixname[0] == '.') && (unixname[1] == '/'))
+ {
+ /* remove it at beginning of path. */
+ if ( ((unixname == fullname) /* no device spec */
+ && (fullname+2 != basename)) /* starts with ./ */
+ /* or */
+ || ((basename[-1] == ':') /* device spec */
+ && (unixname-1 == basename))) /* and ./ afterwards */
+ *local_ptr++ = '.'; /* make '[.' start of path. */
+ unixname += 2;
+ continue;
+ }
+
+ /* Add a subdirectory spec. Do not duplicate "." */
+ if ( local_ptr[-1] != '.'
+ && local_ptr[-1] != '['
+ && local_ptr[-1] != '<')
+ *local_ptr++ = '.';
+
+ /* If this is ".." then the spec becomes "-" */
+ if ( (unixname[0] == '.')
+ && (unixname[1] == '.')
+ && (unixname[2] == '/'))
+ {
+ /* Add "-" and skip the ".." */
+ if ((local_ptr[-1] == '.')
+ && (local_ptr[-2] == '['))
+ local_ptr--; /* prevent [.- */
+ *local_ptr++ = '-';
+ unixname += 3;
+ continue;
+ }
+
+ /* Copy the subdirectory */
+ while (*unixname != '/')
+ *local_ptr++= *unixname++;
+
+ unixname++; /* Skip the "/" */
+ }
+
+ /* Close the directory specification */
+ if (local_ptr[-1] == '.') /* no trailing periods */
+ local_ptr--;
+
+ if (local_ptr[-1] == '[') /* no dir needed */
+ local_ptr--;
+ else
+ *local_ptr++ = ']';
}
- /* Close the directory specification */
- if (cp2[-1] == '.') /* no trailing periods */
- cp2--;
- *cp2++ = ']';
- }
- /* Now add the filename */
- while (*cp1) *cp2++ = *cp1++;
- *cp2 = 0;
+
+ /* Now add the filename. */
+
+ while (*unixname)
+ *local_ptr++ = *unixname++;
+ *local_ptr = 0;
+
/* Now append it to the original VMS spec. */
- strcpy (cp, Local);
+
+ strcpy ((must_revert==1)?fullname:basename, Local);
/* If we put a [000000] in the filename, try to open it first. If this fails,
remove the [000000], and return that name. This provides flexibility
to the user in that they can use both rooted and non-rooted logical names
to point to the location of the file. */
- if (check_filename_before_returning) {
- f = open (fname, O_RDONLY, 0666);
- if (f >= 0) {
- /* The file name is OK as it is, so return it as is. */
- close (f);
- return;
+ if (check_filename_before_returning)
+ {
+ f = open (fullname, O_RDONLY, 0666);
+ if (f >= 0)
+ {
+ /* The file name is OK as it is, so return it as is. */
+ close (f);
+ return 1;
+ }
+
+ /* The filename did not work. Try to remove the [000000] from the name,
+ and return it. */
+
+ basename = index (fullname, '[');
+ local_ptr = index (fullname, ']') + 1;
+ strcpy (basename, local_ptr); /* this gets rid of it */
+
}
- /* The filename did not work. Try to remove the [000000] from the name,
- and return it. */
- cp = index (fname, '[');
- cp2 = index (fname, ']') + 1;
- strcpy (cp, cp2); /* this gets rid of it */
- }
- return;
+
+ return 1;
}
#endif /* VMS */
diff --git a/gcc/cexp.c b/gcc/cexp.c
index f9c6d847406..a577b24b2d1 100644
--- a/gcc/cexp.c
+++ b/gcc/cexp.c
@@ -22,11 +22,6 @@
#line 27 "cexp.y"
#include "config.h"
-#ifdef __STDC__
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
#define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
@@ -35,12 +30,12 @@
#include "system.h"
#include <setjmp.h>
/* #define YYDEBUG 1 */
+#include "gansidecl.h"
#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
#include <locale.h>
-#endif
-
-#include "gansidecl.h"
+#endif /* MULTIBYTE_CHARS */
typedef unsigned char U_CHAR;
@@ -187,7 +182,7 @@ static void integer_overflow PROTO((void));
#define SIGNED (~0)
#define UNSIGNED 0
-#line 251 "cexp.y"
+#line 195 "cexp.y"
typedef union {
struct constant {HOST_WIDE_INT value; int signedp;} integer;
struct name {U_CHAR *address; int length;} name;
@@ -268,10 +263,10 @@ static const short yyrhs[] = { 35,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 281, 291, 292, 299, 304, 307, 309, 312, 316, 318,
- 323, 328, 341, 358, 371, 377, 383, 389, 395, 398,
- 401, 408, 415, 422, 429, 432, 435, 438, 441, 444,
- 447, 450, 452, 455, 458, 460, 462, 470, 472, 485
+ 225, 235, 236, 243, 248, 251, 253, 256, 260, 262,
+ 267, 272, 285, 302, 315, 321, 327, 333, 339, 342,
+ 345, 352, 359, 366, 373, 376, 379, 382, 385, 388,
+ 391, 394, 396, 399, 402, 404, 406, 414, 416, 429
};
#endif
@@ -377,7 +372,7 @@ static const short yycheck[] = { 4,
26, 27, 23, 24, 25, 26, 27, 0, 9
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/cygnus/latest-940103/share/bison.simple"
+#line 3 "/usr/cygnus/gnupro-98r1/share/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -570,7 +565,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/cygnus/latest-940103/share/bison.simple"
+#line 196 "/usr/cygnus/gnupro-98r1/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -875,7 +870,7 @@ yyreduce:
switch (yyn) {
case 1:
-#line 282 "cexp.y"
+#line 226 "cexp.y"
{
expression_value = yyvsp[0].integer.value;
#ifdef TEST_EXP_READER
@@ -884,55 +879,55 @@ case 1:
;
break;}
case 3:
-#line 293 "cexp.y"
+#line 237 "cexp.y"
{ if (pedantic)
pedwarn ("comma operator in operand of `#if'");
yyval.integer = yyvsp[0].integer; ;
break;}
case 4:
-#line 300 "cexp.y"
+#line 244 "cexp.y"
{ yyval.integer.value = - yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[0].integer.signedp;
if ((yyval.integer.value & yyvsp[0].integer.value & yyval.integer.signedp) < 0)
integer_overflow (); ;
break;}
case 5:
-#line 305 "cexp.y"
+#line 249 "cexp.y"
{ yyval.integer.value = ! yyvsp[0].integer.value;
yyval.integer.signedp = SIGNED; ;
break;}
case 6:
-#line 308 "cexp.y"
+#line 252 "cexp.y"
{ yyval.integer = yyvsp[0].integer; ;
break;}
case 7:
-#line 310 "cexp.y"
+#line 254 "cexp.y"
{ yyval.integer.value = ~ yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[0].integer.signedp; ;
break;}
case 8:
-#line 313 "cexp.y"
+#line 257 "cexp.y"
{ yyval.integer.value = check_assertion (yyvsp[0].name.address, yyvsp[0].name.length,
0, NULL_PTR);
yyval.integer.signedp = SIGNED; ;
break;}
case 9:
-#line 317 "cexp.y"
+#line 261 "cexp.y"
{ keyword_parsing = 1; ;
break;}
case 10:
-#line 319 "cexp.y"
+#line 263 "cexp.y"
{ yyval.integer.value = check_assertion (yyvsp[-4].name.address, yyvsp[-4].name.length,
1, yyvsp[-1].keywords);
keyword_parsing = 0;
yyval.integer.signedp = SIGNED; ;
break;}
case 11:
-#line 324 "cexp.y"
+#line 268 "cexp.y"
{ yyval.integer = yyvsp[-1].integer; ;
break;}
case 12:
-#line 329 "cexp.y"
+#line 273 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (yyval.integer.signedp)
{
@@ -947,7 +942,7 @@ case 12:
* yyvsp[0].integer.value); ;
break;}
case 13:
-#line 342 "cexp.y"
+#line 286 "cexp.y"
{ if (yyvsp[0].integer.value == 0)
{
if (!skip_evaluation)
@@ -966,7 +961,7 @@ case 13:
/ yyvsp[0].integer.value); ;
break;}
case 14:
-#line 359 "cexp.y"
+#line 303 "cexp.y"
{ if (yyvsp[0].integer.value == 0)
{
if (!skip_evaluation)
@@ -981,7 +976,7 @@ case 14:
% yyvsp[0].integer.value); ;
break;}
case 15:
-#line 372 "cexp.y"
+#line 316 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value + yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (overflow_sum_sign (yyvsp[-2].integer.value, yyvsp[0].integer.value,
@@ -989,7 +984,7 @@ case 15:
integer_overflow (); ;
break;}
case 16:
-#line 378 "cexp.y"
+#line 322 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value - yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
if (overflow_sum_sign (yyval.integer.value, yyvsp[0].integer.value,
@@ -997,7 +992,7 @@ case 16:
integer_overflow (); ;
break;}
case 17:
-#line 384 "cexp.y"
+#line 328 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp;
if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
yyval.integer.value = right_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@@ -1005,7 +1000,7 @@ case 17:
yyval.integer.value = left_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
break;}
case 18:
-#line 390 "cexp.y"
+#line 334 "cexp.y"
{ yyval.integer.signedp = yyvsp[-2].integer.signedp;
if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
yyval.integer.value = left_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@@ -1013,17 +1008,17 @@ case 18:
yyval.integer.value = right_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
break;}
case 19:
-#line 396 "cexp.y"
+#line 340 "cexp.y"
{ yyval.integer.value = (yyvsp[-2].integer.value == yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 20:
-#line 399 "cexp.y"
+#line 343 "cexp.y"
{ yyval.integer.value = (yyvsp[-2].integer.value != yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 21:
-#line 402 "cexp.y"
+#line 346 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value <= yyvsp[0].integer.value;
@@ -1032,7 +1027,7 @@ case 21:
<= yyvsp[0].integer.value); ;
break;}
case 22:
-#line 409 "cexp.y"
+#line 353 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value >= yyvsp[0].integer.value;
@@ -1041,7 +1036,7 @@ case 22:
>= yyvsp[0].integer.value); ;
break;}
case 23:
-#line 416 "cexp.y"
+#line 360 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value < yyvsp[0].integer.value;
@@ -1050,7 +1045,7 @@ case 23:
< yyvsp[0].integer.value); ;
break;}
case 24:
-#line 423 "cexp.y"
+#line 367 "cexp.y"
{ yyval.integer.signedp = SIGNED;
if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
yyval.integer.value = yyvsp[-2].integer.value > yyvsp[0].integer.value;
@@ -1059,64 +1054,64 @@ case 24:
> yyvsp[0].integer.value); ;
break;}
case 25:
-#line 430 "cexp.y"
+#line 374 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value & yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 26:
-#line 433 "cexp.y"
+#line 377 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value ^ yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 27:
-#line 436 "cexp.y"
+#line 380 "cexp.y"
{ yyval.integer.value = yyvsp[-2].integer.value | yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 28:
-#line 439 "cexp.y"
+#line 383 "cexp.y"
{ skip_evaluation += !yyvsp[-1].integer.value; ;
break;}
case 29:
-#line 441 "cexp.y"
+#line 385 "cexp.y"
{ skip_evaluation -= !yyvsp[-3].integer.value;
yyval.integer.value = (yyvsp[-3].integer.value && yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 30:
-#line 445 "cexp.y"
+#line 389 "cexp.y"
{ skip_evaluation += !!yyvsp[-1].integer.value; ;
break;}
case 31:
-#line 447 "cexp.y"
+#line 391 "cexp.y"
{ skip_evaluation -= !!yyvsp[-3].integer.value;
yyval.integer.value = (yyvsp[-3].integer.value || yyvsp[0].integer.value);
yyval.integer.signedp = SIGNED; ;
break;}
case 32:
-#line 451 "cexp.y"
+#line 395 "cexp.y"
{ skip_evaluation += !yyvsp[-1].integer.value; ;
break;}
case 33:
-#line 453 "cexp.y"
+#line 397 "cexp.y"
{ skip_evaluation += !!yyvsp[-4].integer.value - !yyvsp[-4].integer.value; ;
break;}
case 34:
-#line 455 "cexp.y"
+#line 399 "cexp.y"
{ skip_evaluation -= !!yyvsp[-6].integer.value;
yyval.integer.value = yyvsp[-6].integer.value ? yyvsp[-3].integer.value : yyvsp[0].integer.value;
yyval.integer.signedp = yyvsp[-3].integer.signedp & yyvsp[0].integer.signedp; ;
break;}
case 35:
-#line 459 "cexp.y"
+#line 403 "cexp.y"
{ yyval.integer = yylval.integer; ;
break;}
case 36:
-#line 461 "cexp.y"
+#line 405 "cexp.y"
{ yyval.integer = yylval.integer; ;
break;}
case 37:
-#line 463 "cexp.y"
+#line 407 "cexp.y"
{ if (warn_undef && !skip_evaluation)
warning ("`%.*s' is not defined",
yyvsp[0].name.length, yyvsp[0].name.address);
@@ -1124,11 +1119,11 @@ case 37:
yyval.integer.signedp = SIGNED; ;
break;}
case 38:
-#line 471 "cexp.y"
+#line 415 "cexp.y"
{ yyval.keywords = 0; ;
break;}
case 39:
-#line 473 "cexp.y"
+#line 417 "cexp.y"
{ struct arglist *temp;
yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
yyval.keywords->next = yyvsp[-2].keywords;
@@ -1143,7 +1138,7 @@ case 39:
temp->next->length = 1; ;
break;}
case 40:
-#line 486 "cexp.y"
+#line 430 "cexp.y"
{ yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
yyval.keywords->name = yyvsp[-1].name.address;
yyval.keywords->length = yyvsp[-1].name.length;
@@ -1151,7 +1146,7 @@ case 40:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/cygnus/latest-940103/share/bison.simple"
+#line 498 "/usr/cygnus/gnupro-98r1/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -1347,7 +1342,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 491 "cexp.y"
+#line 435 "cexp.y"
/* During parsing of a C expression, the pointer to the next character
@@ -1557,23 +1552,18 @@ yylex ()
{
register HOST_WIDE_INT result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = MAX_CHAR_TYPE_SIZE;
int max_chars;
- char *token_buffer;
-
- if (wide_flag)
- {
- width = MAX_WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ char *token_buffer = (char *) alloca (longest_char);
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = MAX_LONG_TYPE_SIZE / width;
- token_buffer = (char *) alloca (max_chars + 1);
+ max_chars = MAX_LONG_TYPE_SIZE / width;
+ if (wide_flag)
+ width = MAX_WCHAR_TYPE_SIZE;
while (1)
{
@@ -1582,44 +1572,96 @@ yylex ()
if (c == '\'' || c == EOF)
break;
+ ++chars_seen;
if (c == '\\')
{
c = parse_escape (&lexptr, mask);
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ token_buffer[i - 1] = c;
+ char_len = local_mbtowc (& wc, token_buffer, i);
+ if (char_len != -1)
+ break;
+ c = *lexptr++;
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ lexptr--;
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i - 1]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i - 1];
+ }
+ num_chars += char_len;
+ continue;
+ }
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ }
+ if (wide_flag)
+ c = wc;
+#endif /* ! MULTIBYTE_CHARS */
+ }
- num_chars++;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = c;
+ continue;
+ }
/* Merge character into result; ignore excess chars. */
+ num_chars++;
if (num_chars <= max_chars)
{
- if (width < HOST_BITS_PER_WIDE_INT)
- result = (result << width) | c;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width) | (c & ((1 << width) - 1));
else
result = c;
- token_buffer[num_chars - 1] = c;
}
}
- token_buffer[num_chars] = 0;
-
if (c != '\'')
error ("malformatted character constant");
- else if (num_chars == 0)
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1 && ! traditional)
+ else if (chars_seen != 1 && ! traditional)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
if (! wide_flag)
{
int num_bits = num_chars * width;
-
- if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
+ if (num_bits == 0)
+ /* We already got an error; avoid invalid shift. */
+ yylval.integer.value = 0;
+ else if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
sizeof ("__CHAR_UNSIGNED__") - 1, -1)
|| ((result >> (num_bits - 1)) & 1) == 0)
yylval.integer.value
@@ -1632,22 +1674,6 @@ yylex ()
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[0] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL_PTR, NULL_PTR, 0);
- if (mbtowc (& wc, token_buffer, num_chars) == num_chars)
- result = wc;
- else
- pedwarn ("Ignoring invalid multibyte character");
- }
-#endif
yylval.integer.value = result;
}
}
diff --git a/gcc/cexp.y b/gcc/cexp.y
index 6280aedeb80..c7d25c19658 100644
--- a/gcc/cexp.y
+++ b/gcc/cexp.y
@@ -26,11 +26,6 @@ Boston, MA 02111-1307, USA.
%{
#include "config.h"
-#ifdef __STDC__
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
#define PRINTF_PROTO(ARGS, m, n) PVPROTO (ARGS) ATTRIBUTE_PRINTF(m, n)
@@ -39,12 +34,12 @@ Boston, MA 02111-1307, USA.
#include "system.h"
#include <setjmp.h>
/* #define YYDEBUG 1 */
+#include "gansidecl.h"
#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
#include <locale.h>
-#endif
-
-#include "gansidecl.h"
+#endif /* MULTIBYTE_CHARS */
typedef unsigned char U_CHAR;
@@ -641,23 +636,18 @@ yylex ()
{
register HOST_WIDE_INT result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = MAX_CHAR_TYPE_SIZE;
int max_chars;
- char *token_buffer;
-
- if (wide_flag)
- {
- width = MAX_WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ char *token_buffer = (char *) alloca (longest_char);
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = MAX_LONG_TYPE_SIZE / width;
- token_buffer = (char *) alloca (max_chars + 1);
+ max_chars = MAX_LONG_TYPE_SIZE / width;
+ if (wide_flag)
+ width = MAX_WCHAR_TYPE_SIZE;
while (1)
{
@@ -666,44 +656,96 @@ yylex ()
if (c == '\'' || c == EOF)
break;
+ ++chars_seen;
if (c == '\\')
{
c = parse_escape (&lexptr, mask);
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ token_buffer[i - 1] = c;
+ char_len = local_mbtowc (& wc, token_buffer, i);
+ if (char_len != -1)
+ break;
+ c = *lexptr++;
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ lexptr--;
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i - 1]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i - 1];
+ }
+ num_chars += char_len;
+ continue;
+ }
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ }
+ if (wide_flag)
+ c = wc;
+#endif /* ! MULTIBYTE_CHARS */
+ }
- num_chars++;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = c;
+ continue;
+ }
/* Merge character into result; ignore excess chars. */
+ num_chars++;
if (num_chars <= max_chars)
{
- if (width < HOST_BITS_PER_WIDE_INT)
- result = (result << width) | c;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width) | (c & ((1 << width) - 1));
else
result = c;
- token_buffer[num_chars - 1] = c;
}
}
- token_buffer[num_chars] = 0;
-
if (c != '\'')
error ("malformatted character constant");
- else if (num_chars == 0)
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1 && ! traditional)
+ else if (chars_seen != 1 && ! traditional)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
if (! wide_flag)
{
int num_bits = num_chars * width;
-
- if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
+ if (num_bits == 0)
+ /* We already got an error; avoid invalid shift. */
+ yylval.integer.value = 0;
+ else if (lookup ((U_CHAR *) "__CHAR_UNSIGNED__",
sizeof ("__CHAR_UNSIGNED__") - 1, -1)
|| ((result >> (num_bits - 1)) & 1) == 0)
yylval.integer.value
@@ -716,22 +758,6 @@ yylex ()
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[0] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL_PTR, NULL_PTR, 0);
- if (mbtowc (& wc, token_buffer, num_chars) == num_chars)
- result = wc;
- else
- pedwarn ("Ignoring invalid multibyte character");
- }
-#endif
yylval.integer.value = result;
}
}
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog
index 558632dc1ad..450c956793a 100644
--- a/gcc/ch/ChangeLog
+++ b/gcc/ch/ChangeLog
@@ -1,13 +1,3 @@
-Thu Oct 8 05:57:41 1998 Jeffrey A Law (law@cygnus.com)
-
- * typeck (type_for_mode): Only return TItype nodes when
- HOST_BITS_PER_WIDE_INT is >= 64 bits.
- (type_for_size): Similarly.
- * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
- when HOST_BITS_PER_WIDE_INT is >= 64 bits.
- (init_decl_processing): Only create TItype nodes when
- HOST_BITS_PER_WIDE_INT is >= 64 bits.
-
Wed Oct 7 12:19:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (hash.h): Add -L KR-C -F ', 0, 0, 0' flags to gperf.
diff --git a/gcc/ch/decl.c b/gcc/ch/decl.c
index bf2561f4219..9c4735962f8 100644
--- a/gcc/ch/decl.c
+++ b/gcc/ch/decl.c
@@ -353,17 +353,13 @@ tree intQI_type_node;
tree intHI_type_node;
tree intSI_type_node;
tree intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
tree intTI_type_node;
-#endif
tree unsigned_intQI_type_node;
tree unsigned_intHI_type_node;
tree unsigned_intSI_type_node;
tree unsigned_intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
tree unsigned_intTI_type_node;
-#endif
/* a VOID_TYPE node. */
@@ -3535,16 +3531,12 @@ init_decl_processing ()
intHI_type_node = make_signed_type (GET_MODE_BITSIZE (HImode));
intSI_type_node = make_signed_type (GET_MODE_BITSIZE (SImode));
intDI_type_node = make_signed_type (GET_MODE_BITSIZE (DImode));
-#if HOST_BITS_PER_WIDE_INT >= 64
intTI_type_node = make_signed_type (GET_MODE_BITSIZE (TImode));
-#endif
unsigned_intQI_type_node = make_unsigned_type (GET_MODE_BITSIZE (QImode));
unsigned_intHI_type_node = make_unsigned_type (GET_MODE_BITSIZE (HImode));
unsigned_intSI_type_node = make_unsigned_type (GET_MODE_BITSIZE (SImode));
unsigned_intDI_type_node = make_unsigned_type (GET_MODE_BITSIZE (DImode));
-#if HOST_BITS_PER_WIDE_INT >= 64
unsigned_intTI_type_node = make_unsigned_type (GET_MODE_BITSIZE (TImode));
-#endif
float_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (float_type_node) = FLOAT_TYPE_SIZE;
diff --git a/gcc/ch/typeck.c b/gcc/ch/typeck.c
index 1132babc896..a4795dfddf4 100644
--- a/gcc/ch/typeck.c
+++ b/gcc/ch/typeck.c
@@ -41,17 +41,13 @@ extern tree intQI_type_node;
extern tree intHI_type_node;
extern tree intSI_type_node;
extern tree intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
extern tree intTI_type_node;
-#endif
extern tree unsigned_intQI_type_node;
extern tree unsigned_intHI_type_node;
extern tree unsigned_intSI_type_node;
extern tree unsigned_intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
extern tree unsigned_intTI_type_node;
-#endif
/* forward declarations */
static int chill_l_equivalent PROTO((tree, tree, struct mode_chain*));
@@ -3842,10 +3838,8 @@ type_for_size (bits, unsignedp)
if (bits <= TYPE_PRECISION (intDI_type_node))
return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
if (bits <= TYPE_PRECISION (intTI_type_node))
return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
-#endif
return 0;
}
@@ -3886,10 +3880,8 @@ type_for_mode (mode, unsignedp)
if (mode == TYPE_MODE (intDI_type_node))
return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
if (mode == TYPE_MODE (intTI_type_node))
return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
-#endif
if (mode == TYPE_MODE (float_type_node))
return float_type_node;
diff --git a/gcc/choose-temp.c b/gcc/choose-temp.c
deleted file mode 100644
index ea4f9ed5f32..00000000000
--- a/gcc/choose-temp.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Utility to pick a temporary filename prefix.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB. If not,
-write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file exports one function: choose_temp_base. */
-
-/* This file lives in at least two places: libiberty and gcc.
- Don't change one without the other. */
-
-#if defined (IN_GCC) || defined (HAVE_CONFIG_H)
-#include "config.h"
-#endif
-
-#ifdef IN_GCC
-#include "system.h"
-#else
-
-/* If we are in gcc, system.h has handled everything. When not in
- gcc, if we have a config.h we assume that HAVE_SYS_FILE_H tells us
- whether to include sys/file.h. However, libiberty does not have a
- config.h, and instead arranges to define NO_SYS_FILE_H on the
- command line when there is no sys/file.h. */
-
-#if defined (HAVE_CONFIG_H) ? defined (HAVE_SYS_FILE_H) : ! defined (NO_SYS_FILE_H)
-#include <sys/types.h>
-#include <sys/file.h> /* May get R_OK, etc. on some systems. */
-#endif
-
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
-#include <stdio.h> /* May get P_tmpdir. */
-#endif /* IN_GCC */
-
-#ifdef IN_GCC
-#include "gansidecl.h"
-extern char *xmalloc ();
-#else
-#include "ansidecl.h"
-#include "libiberty.h"
-#if defined (__MSDOS__) || defined (_WIN32)
-#define DIR_SEPARATOR '\\'
-#endif
-#endif
-
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
-/* On MSDOS, write temp files in current dir
- because there's no place else we can expect to use. */
-/* ??? Although the current directory is tried as a last resort,
- this is left in so that on MSDOS it is preferred to /tmp on the
- off chance that someone requires this, since that was the previous
- behaviour. */
-#ifdef __MSDOS__
-#ifndef P_tmpdir
-#define P_tmpdir "."
-#endif
-#endif
-
-/* Name of temporary file.
- mktemp requires 6 trailing X's. */
-#define TEMP_FILE "ccXXXXXX"
-
-/* Subroutine of choose_temp_base.
- If BASE is non-NULL, return it.
- Otherwise it checks if DIR is a usable directory.
- If success, DIR is returned.
- Otherwise NULL is returned. */
-
-static char *
-try (dir, base)
- char *dir, *base;
-{
- if (base != 0)
- return base;
- if (dir != 0
- && access (dir, R_OK | W_OK | X_OK) == 0)
- return dir;
- return 0;
-}
-
-/* Return a prefix for temporary file names or NULL if unable to find one.
- The current directory is chosen if all else fails so the program is
- exited if a temporary directory can't be found (mktemp fails).
- The buffer for the result is obtained with xmalloc. */
-
-char *
-choose_temp_base ()
-{
- char *base = 0;
- char *temp_filename;
- int len;
- static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
- static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
-
-#ifndef MPW
- base = try (getenv ("TMPDIR"), base);
- base = try (getenv ("TMP"), base);
- base = try (getenv ("TEMP"), base);
-
-#ifdef P_tmpdir
- base = try (P_tmpdir, base);
-#endif
-
- /* Try /usr/tmp, then /tmp. */
- base = try (usrtmp, base);
- base = try (tmp, base);
-
- /* If all else fails, use the current directory! */
- if (base == 0)
- base = ".";
-
-#else /* MPW */
- base = ":";
-#endif
-
- len = strlen (base);
- temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/
- + strlen (TEMP_FILE) + 1);
- strcpy (temp_filename, base);
-
-#ifndef MPW
- if (len != 0
- && temp_filename[len-1] != '/'
- && temp_filename[len-1] != DIR_SEPARATOR)
- temp_filename[len++] = DIR_SEPARATOR;
-#else /* MPW */
- if (temp_filename[len-1] != ':')
- temp_filename[len++] = ':';
-#endif /* MPW */
- strcpy (temp_filename + len, TEMP_FILE);
-
- mktemp (temp_filename);
- if (strlen (temp_filename) == 0)
- abort ();
- return temp_filename;
-}
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 0cba7ef144b..bfa91550874 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -39,13 +39,6 @@ Boston, MA 02111-1307, USA. */
#include <process.h>
#endif
-#ifndef HAVE_STRERROR
-extern char *sys_errlist[];
-extern int sys_nerr;
-#else
-char *strerror();
-#endif
-
/* Obstack allocation and deallocation routines. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -67,7 +60,7 @@ char *strerror();
#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
#endif
-extern char *choose_temp_base ();
+extern char *make_temp_file PROTO ((char *));
/* On certain systems, we have code that works by scanning the object file
directly. But this code uses system-specific header files and library
@@ -144,7 +137,7 @@ extern char *choose_temp_base ();
/* Default flags to pass to nm. */
#ifndef NM_FLAGS
-#define NM_FLAGS "-p"
+#define NM_FLAGS "-n"
#endif
#endif /* OBJECT_FORMAT_NONE */
@@ -193,11 +186,6 @@ enum pass {
PASS_SECOND /* with constructors linked in */
};
-#ifndef NO_SYS_SIGLIST
-#ifndef SYS_SIGLIST_DECLARED
-extern char *sys_siglist[];
-#endif
-#endif
extern char *version_string;
int vflag; /* true if -v */
@@ -211,8 +199,6 @@ int debug; /* true if -debug */
static int shared_obj; /* true if -shared */
-static int temp_filename_length; /* Length of temp_filename */
-static char *temp_filename; /* Base of temp filenames */
static char *c_file; /* <xxx>.c for constructor/destructor list. */
static char *o_file; /* <xxx>.o for constructor/destructor list. */
#ifdef COLLECT_EXPORT_LIST
@@ -245,12 +231,10 @@ char * temporary_firstobj;
/* Defined in the automatically-generated underscore.c. */
extern int prepends_underscore;
-extern char *getenv ();
-extern char *mktemp ();
extern FILE *fdopen ();
-#ifndef GET_ENVIRONMENT
-#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
+#ifndef GET_ENV_PATH_LIST
+#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif
/* Structure to hold all the directories in which to search for files to
@@ -279,9 +263,8 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
static char *libexts[3] = {"a", "so", NULL}; /* possible library extentions */
#endif
-void collect_exit PROTO((int));
-void collect_execute PROTO((char *, char **, char *));
-void dump_file PROTO((char *));
+static char *my_strerror PROTO((int));
+static const char *my_strsignal PROTO((int));
static void handler PROTO((int));
static int is_ctor_dtor PROTO((char *));
static char *find_a_file PROTO((struct path_prefix *, char *));
@@ -292,9 +275,15 @@ static void do_wait PROTO((char *));
static void fork_execute PROTO((char *, char **));
static void maybe_unlink PROTO((char *));
static void add_to_list PROTO((struct head *, char *));
+static int extract_init_priority PROTO((char *));
+static void sort_ids PROTO((struct head *));
static void write_list PROTO((FILE *, char *, struct id *));
+#ifdef COLLECT_EXPORT_LIST
static void dump_list PROTO((FILE *, char *, struct id *));
+#endif
+#if 0
static void dump_prefix_list PROTO((FILE *, char *, struct prefix_list *));
+#endif
static void write_list_with_asm PROTO((FILE *, char *, struct id *));
static void write_c_file PROTO((FILE *, char *));
static void scan_prog_file PROTO((char *, enum pass));
@@ -336,7 +325,7 @@ dup2 (oldfd, newfd)
}
#endif
-char *
+static char *
my_strerror (e)
int e;
{
@@ -357,6 +346,29 @@ my_strerror (e)
return buffer;
#endif
}
+
+static const char *
+my_strsignal (s)
+ int s;
+{
+#ifdef HAVE_STRSIGNAL
+ return strsignal (s);
+#else
+ if (s >= 0 && s < NSIG)
+ {
+# ifdef NO_SYS_SIGLIST
+ static char buffer[30];
+
+ sprintf (buffer, "Unknown signal %d", s);
+ return buffer;
+# else
+ return sys_siglist[s];
+# endif
+ }
+ else
+ return NULL;
+#endif /* HAVE_STRSIGNAL */
+}
/* Delete tempfiles and exit function. */
@@ -850,7 +862,7 @@ prefix_from_env (env, pprefix)
struct path_prefix *pprefix;
{
char *p;
- GET_ENVIRONMENT (p, env);
+ GET_ENV_PATH_LIST (p, env);
if (p)
prefix_from_string (p, pprefix);
@@ -938,7 +950,7 @@ main (argc, argv)
char **object_lst = (char **) xcalloc (sizeof (char *), argc);
char **object = object_lst;
int first_file;
- int num_c_args = argc+7;
+ int num_c_args = argc+9;
#ifdef DEBUG
debug = 1;
@@ -1063,6 +1075,12 @@ main (argc, argv)
/* Try to discover a valid linker/nm/strip to use. */
/* Maybe we know the right file to use (if not cross). */
+ ld_file_name = 0;
+#ifdef DEFAULT_LINKER
+ if (access (DEFAULT_LINKER, X_OK) == 0)
+ ld_file_name = DEFAULT_LINKER;
+ if (ld_file_name == 0)
+#endif
#ifdef REAL_LD_FILE_NAME
ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME);
if (ld_file_name == 0)
@@ -1137,23 +1155,16 @@ main (argc, argv)
*ld1++ = *ld2++ = ld_file_name;
/* Make temp file names. */
- temp_filename = choose_temp_base ();
- temp_filename_length = strlen (temp_filename);
- c_file = xcalloc (temp_filename_length + sizeof (".c"), 1);
- o_file = xcalloc (temp_filename_length + sizeof (".o"), 1);
+ c_file = make_temp_file (".c");
+ o_file = make_temp_file (".o");
#ifdef COLLECT_EXPORT_LIST
- export_file = xmalloc (temp_filename_length + sizeof (".x"));
- import_file = xmalloc (temp_filename_length + sizeof (".p"));
-#endif
- ldout = xmalloc (temp_filename_length + sizeof (".ld"));
- sprintf (ldout, "%s.ld", temp_filename);
- sprintf (c_file, "%s.c", temp_filename);
- sprintf (o_file, "%s.o", temp_filename);
-#ifdef COLLECT_EXPORT_LIST
- sprintf (export_file, "%s.x", temp_filename);
- sprintf (import_file, "%s.p", temp_filename);
+ export_file = make_temp_file (".x");
+ import_file = make_temp_file (".p");
#endif
+ ldout = make_temp_file (".ld");
*c_ptr++ = c_file_name;
+ *c_ptr++ = "-x";
+ *c_ptr++ = "c";
*c_ptr++ = "-c";
*c_ptr++ = "-o";
*c_ptr++ = o_file;
@@ -1428,7 +1439,11 @@ main (argc, argv)
/* If -r or they will be run via some other method, do not build the
constructor or destructor list, just return now. */
- if (rflag || ! do_collecting)
+ if (rflag
+#ifndef COLLECT_EXPORT_LIST
+ || ! do_collecting
+#endif
+ )
{
#ifdef COLLECT_EXPORT_LIST
/* But make sure we delete the export file we may have created. */
@@ -1437,6 +1452,8 @@ main (argc, argv)
if (import_file != 0 && import_file[0])
maybe_unlink (import_file);
#endif
+ maybe_unlink (c_file);
+ maybe_unlink (o_file);
return 0;
}
@@ -1487,9 +1504,15 @@ main (argc, argv)
maybe_unlink (export_file);
maybe_unlink (import_file);
#endif
+ maybe_unlink (c_file);
+ maybe_unlink (o_file);
return 0;
}
+ /* Sort ctor and dtor lists by priority. */
+ sort_ids (&constructors);
+ sort_ids (&destructors);
+
maybe_unlink(output_file);
outf = fopen (c_file, "w");
if (outf == (FILE *) 0)
@@ -1580,18 +1603,11 @@ collect_wait (prog)
if (WIFSIGNALED (status))
{
int sig = WTERMSIG (status);
-#ifdef NO_SYS_SIGLIST
- error ("%s terminated with signal %d %s",
- prog,
- sig,
- (status & 0200) ? ", core dumped" : "");
-#else
error ("%s terminated with signal %d [%s]%s",
prog,
sig,
- sys_siglist[sig],
+ my_strsignal(sig),
(status & 0200) ? ", core dumped" : "");
-#endif
collect_exit (FATAL_EXIT_CODE);
}
@@ -1704,6 +1720,8 @@ maybe_unlink (file)
}
+static long sequence_number = 0;
+
/* Add a name to a linked list. */
static void
@@ -1714,7 +1732,6 @@ add_to_list (head_ptr, name)
struct id *newid
= (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p;
- static long sequence_number = 0;
strcpy (newid->name, name);
if (head_ptr->first)
@@ -1739,6 +1756,66 @@ add_to_list (head_ptr, name)
head_ptr->number++;
}
+/* Grab the init priority number from an init function name that
+ looks like "_GLOBAL_.I.12345.foo". */
+
+static int
+extract_init_priority (name)
+ char *name;
+{
+ int pos = 0;
+
+ while (name[pos] == '_')
+ ++pos;
+ pos += 10; /* strlen ("GLOBAL__X_") */
+
+ /* Extract init_p number from ctor/dtor name. */
+ return atoi (name + pos);
+}
+
+/* Insertion sort the ids from ctor/dtor list HEAD_PTR in descending order.
+ ctors will be run from right to left, dtors from left to right. */
+
+static void
+sort_ids (head_ptr)
+ struct head *head_ptr;
+{
+ /* id holds the current element to insert. id_next holds the next
+ element to insert. id_ptr iterates through the already sorted elements
+ looking for the place to insert id. */
+ struct id *id, *id_next, **id_ptr;
+
+ id = head_ptr->first;
+
+ /* We don't have any sorted elements yet. */
+ head_ptr->first = NULL;
+
+ for (; id; id = id_next)
+ {
+ id_next = id->next;
+ id->sequence = extract_init_priority (id->name);
+
+ for (id_ptr = &(head_ptr->first); ; id_ptr = &((*id_ptr)->next))
+ if (*id_ptr == NULL
+ /* If the sequence numbers are the same, we put the id from the
+ file later on the command line later in the list. */
+ || id->sequence > (*id_ptr)->sequence
+ /* Hack: do lexical compare, too.
+ || (id->sequence == (*id_ptr)->sequence
+ && strcmp (id->name, (*id_ptr)->name) > 0) */
+ )
+ {
+ id->next = *id_ptr;
+ *id_ptr = id;
+ break;
+ }
+ }
+
+ /* Now set the sequence numbers properly so write_c_file works. */
+ for (id = head_ptr->first; id; id = id->next)
+ id->sequence = ++sequence_number;
+}
+
/* Write: `prefix', the names on list LIST, `suffix'. */
static void
@@ -1771,6 +1848,7 @@ is_in_list (prefix, list)
#endif
/* Added for debugging purpose. */
+#ifdef COLLECT_EXPORT_LIST
static void
dump_list (stream, prefix, list)
FILE *stream;
@@ -1783,7 +1861,9 @@ dump_list (stream, prefix, list)
list = list->next;
}
}
+#endif
+#if 0
static void
dump_prefix_list (stream, prefix, list)
FILE *stream;
@@ -1796,6 +1876,7 @@ dump_prefix_list (stream, prefix, list)
list = list->next;
}
}
+#endif
static void
write_list_with_asm (stream, prefix, list)
@@ -2820,8 +2901,8 @@ scan_prog_file (prog_name, which_pass)
#else
if (debug)
fprintf (stderr,
- "\tiss = %5d, value = %5d, index = %5d, name = %s\n",
- symbol.iss, symbol.value, symbol.index, name);
+ "\tiss = %5d, value = %5ld, index = %5d, name = %s\n",
+ symbol.iss, (long) symbol.value, symbol.index, name);
#endif
}
#ifdef COLLECT_EXPORT_LIST
diff --git a/gcc/combine.c b/gcc/combine.c
index ef8ed46333d..420a60fca5f 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -75,27 +75,21 @@ Boston, MA 02111-1307, USA. */
combine anyway. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/* stdio.h must precede rtl.h for FFS. */
#include "system.h"
-
-#include "rtl.h"
+#include "rtl.h" /* stdio.h must precede rtl.h for FFS. */
#include "flags.h"
#include "regs.h"
#include "hard-reg-set.h"
-#include "expr.h"
#include "basic-block.h"
#include "insn-config.h"
+/* Include expr.h after insn-config.h so we get HAVE_conditional_move. */
+#include "expr.h"
#include "insn-flags.h"
#include "insn-codes.h"
#include "insn-attr.h"
#include "recog.h"
#include "real.h"
+#include "toplev.h"
/* It is not safe to use ordinary gen_lowpart in combine.
Use gen_lowpart_for_combine instead. See comments there. */
@@ -956,8 +950,14 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
/* Don't substitute into an incremented register. */
|| FIND_REG_INC_NOTE (i3, dest)
|| (succ && FIND_REG_INC_NOTE (succ, dest))
+#if 0
/* Don't combine the end of a libcall into anything. */
+ /* ??? This gives worse code, and appears to be unnecessary, since no
+ pass after flow uses REG_LIBCALL/REG_RETVAL notes. Local-alloc does
+ use REG_RETVAL notes for noconflict blocks, but other code here
+ makes sure that those insns don't disappear. */
|| find_reg_note (insn, REG_RETVAL, NULL_RTX)
+#endif
/* Make sure that DEST is not used after SUCC but before I3. */
|| (succ && ! all_adjacent
&& reg_used_between_p (dest, succ, i3))
@@ -1369,7 +1369,12 @@ try_combine (i3, i2, i1)
if (GET_RTX_CLASS (GET_CODE (i3)) != 'i'
|| GET_RTX_CLASS (GET_CODE (i2)) != 'i'
|| (i1 && GET_RTX_CLASS (GET_CODE (i1)) != 'i')
- || find_reg_note (i3, REG_LIBCALL, NULL_RTX))
+#if 0
+ /* ??? This gives worse code, and appears to be unnecessary, since no
+ pass after flow uses REG_LIBCALL/REG_RETVAL notes. */
+ || find_reg_note (i3, REG_LIBCALL, NULL_RTX)
+#endif
+)
return 0;
combine_attempts++;
@@ -3768,10 +3773,12 @@ simplify_rtx (x, op0_mode, last, in_dest)
return SUBREG_REG (XEXP (x, 0));
/* If we know that the value is already truncated, we can
- replace the TRUNCATE with a SUBREG. */
- if (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) <= HOST_BITS_PER_WIDE_INT
- && (nonzero_bits (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
- &~ GET_MODE_MASK (mode)) == 0)
+ replace the TRUNCATE with a SUBREG if TRULY_NOOP_TRUNCATION is
+ nonzero for the corresponding modes. */
+ if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
+ GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))))
+ && num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
+ >= GET_MODE_BITSIZE (mode) + 1)
return gen_lowpart_for_combine (mode, XEXP (x, 0));
/* A truncate of a comparison can be replaced with a subreg if
@@ -4700,7 +4707,7 @@ simplify_set (x)
we only care about the low bits of the result.
However, on machines without WORD_REGISTER_OPERATIONS defined, we cannot
- perform a narrower operation that requested since the high-order bits will
+ perform a narrower operation than requested since the high-order bits will
be undefined. On machine where it is defined, this transformation is safe
as long as M1 and M2 have the same number of words. */
@@ -5202,7 +5209,7 @@ expand_compound_operation (x)
&& subreg_lowpart_p (XEXP (x, 0))
&& GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT
&& (nonzero_bits (SUBREG_REG (XEXP (x, 0)), GET_MODE (x))
- & ~ GET_MODE_MASK (GET_MODE (SUBREG_REG (x)))) == 0)
+ & ~ GET_MODE_MASK (GET_MODE (XEXP (x, 0)))) == 0)
return SUBREG_REG (XEXP (x, 0));
/* (zero_extend:DI (truncate:SI foo:DI)) is just foo:DI when foo
@@ -5380,6 +5387,24 @@ expand_field_assignment (x)
compute_mode = GET_MODE (inner);
+ /* Don't attempt bitwise arithmetic on non-integral modes. */
+ if (! INTEGRAL_MODE_P (compute_mode))
+ {
+ enum machine_mode imode;
+
+ /* Something is probably seriously wrong if this matches. */
+ if (! FLOAT_MODE_P (compute_mode))
+ break;
+
+ /* Try to find an integral mode to pun with. */
+ imode = mode_for_size (GET_MODE_BITSIZE (compute_mode), MODE_INT, 0);
+ if (imode == BLKmode)
+ break;
+
+ compute_mode = imode;
+ inner = gen_lowpart_for_combine (imode, inner);
+ }
+
/* Compute a mask of LEN bits, if we can do this on the host machine. */
if (len < HOST_BITS_PER_WIDE_INT)
mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1);
@@ -5601,27 +5626,45 @@ make_extraction (mode, inner, pos, pos_rtx, len,
#ifdef HAVE_insv
if (in_dest)
{
- wanted_inner_reg_mode = insn_operand_mode[(int) CODE_FOR_insv][0];
- pos_mode = insn_operand_mode[(int) CODE_FOR_insv][2];
- extraction_mode = insn_operand_mode[(int) CODE_FOR_insv][3];
+ wanted_inner_reg_mode
+ = (insn_operand_mode[(int) CODE_FOR_insv][0] == VOIDmode
+ ? word_mode
+ : insn_operand_mode[(int) CODE_FOR_insv][0]);
+ pos_mode = (insn_operand_mode[(int) CODE_FOR_insv][2] == VOIDmode
+ ? word_mode : insn_operand_mode[(int) CODE_FOR_insv][2]);
+ extraction_mode = (insn_operand_mode[(int) CODE_FOR_insv][3] == VOIDmode
+ ? word_mode
+ : insn_operand_mode[(int) CODE_FOR_insv][3]);
}
#endif
#ifdef HAVE_extzv
if (! in_dest && unsignedp)
{
- wanted_inner_reg_mode = insn_operand_mode[(int) CODE_FOR_extzv][1];
- pos_mode = insn_operand_mode[(int) CODE_FOR_extzv][3];
- extraction_mode = insn_operand_mode[(int) CODE_FOR_extzv][0];
+ wanted_inner_reg_mode
+ = (insn_operand_mode[(int) CODE_FOR_extzv][1] == VOIDmode
+ ? word_mode
+ : insn_operand_mode[(int) CODE_FOR_extzv][1]);
+ pos_mode = (insn_operand_mode[(int) CODE_FOR_extzv][3] == VOIDmode
+ ? word_mode : insn_operand_mode[(int) CODE_FOR_extzv][3]);
+ extraction_mode = (insn_operand_mode[(int) CODE_FOR_extzv][0] == VOIDmode
+ ? word_mode
+ : insn_operand_mode[(int) CODE_FOR_extzv][0]);
}
#endif
#ifdef HAVE_extv
if (! in_dest && ! unsignedp)
{
- wanted_inner_reg_mode = insn_operand_mode[(int) CODE_FOR_extv][1];
- pos_mode = insn_operand_mode[(int) CODE_FOR_extv][3];
- extraction_mode = insn_operand_mode[(int) CODE_FOR_extv][0];
+ wanted_inner_reg_mode
+ = (insn_operand_mode[(int) CODE_FOR_extv][1] == VOIDmode
+ ? word_mode
+ : insn_operand_mode[(int) CODE_FOR_extv][1]);
+ pos_mode = (insn_operand_mode[(int) CODE_FOR_extv][3] == VOIDmode
+ ? word_mode : insn_operand_mode[(int) CODE_FOR_extv][3]);
+ extraction_mode = (insn_operand_mode[(int) CODE_FOR_extv][0] == VOIDmode
+ ? word_mode
+ : insn_operand_mode[(int) CODE_FOR_extv][0]);
}
#endif
@@ -6951,8 +6994,6 @@ rtx_equal_for_field_assignment_p (x, y)
rtx x;
rtx y;
{
- rtx last_x, last_y;
-
if (x == y || rtx_equal_p (x, y))
return 1;
@@ -6974,19 +7015,12 @@ rtx_equal_for_field_assignment_p (x, y)
gen_lowpart_for_combine (GET_MODE (SUBREG_REG (x)), y)))
return 1;
- last_x = get_last_value (x);
- last_y = get_last_value (y);
-
- return ((last_x != 0
- && GET_CODE (last_x) != CLOBBER
- && rtx_equal_for_field_assignment_p (last_x, y))
- || (last_y != 0
- && GET_CODE (last_y) != CLOBBER
- && rtx_equal_for_field_assignment_p (x, last_y))
- || (last_x != 0 && last_y != 0
- && GET_CODE (last_x) != CLOBBER
- && GET_CODE (last_y) != CLOBBER
- && rtx_equal_for_field_assignment_p (last_x, last_y)));
+ /* We used to see if get_last_value of X and Y were the same but that's
+ not correct. In one direction, we'll cause the assignment to have
+ the wrong destination and in the case, we'll import a register into this
+ insn that might have already have been dead. So fail if none of the
+ above cases are true. */
+ return 0;
}
/* See if X, a SET operation, can be rewritten as a bit-field assignment.
@@ -7692,15 +7726,23 @@ nonzero_bits (x, mode)
{
nonzero &= nonzero_bits (SUBREG_REG (x), mode);
-#ifndef WORD_REGISTER_OPERATIONS
- /* On many CISC machines, accessing an object in a wider mode
- causes the high-order bits to become undefined. So they are
- not known to be zero. */
- if (GET_MODE_SIZE (GET_MODE (x))
- > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
- nonzero |= (GET_MODE_MASK (GET_MODE (x))
- & ~ GET_MODE_MASK (GET_MODE (SUBREG_REG (x))));
+#if defined (WORD_REGISTER_OPERATIONS) && defined (LOAD_EXTEND_OP)
+ /* If this is a typical RISC machine, we only have to worry
+ about the way loads are extended. */
+ if (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND
+ ? (nonzero
+ & (1L << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1)))
+ : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND)
#endif
+ {
+ /* On many CISC machines, accessing an object in a wider mode
+ causes the high-order bits to become undefined. So they are
+ not known to be zero. */
+ if (GET_MODE_SIZE (GET_MODE (x))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
+ nonzero |= (GET_MODE_MASK (GET_MODE (x))
+ & ~ GET_MODE_MASK (GET_MODE (SUBREG_REG (x))));
+ }
}
break;
@@ -9471,10 +9513,10 @@ simplify_comparison (code, pop0, pop1)
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner_op0))))
&& (GET_MODE (SUBREG_REG (inner_op0))
== GET_MODE (SUBREG_REG (inner_op1)))
- && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0)))
+ && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (inner_op0)))
<= HOST_BITS_PER_WIDE_INT)
&& (0 == ((~c0) & nonzero_bits (SUBREG_REG (inner_op0),
- GET_MODE (SUBREG_REG (op0)))))
+ GET_MODE (SUBREG_REG (inner_op0)))))
&& (0 == ((~c1) & nonzero_bits (SUBREG_REG (inner_op1),
GET_MODE (SUBREG_REG (inner_op1))))))
{
@@ -9759,12 +9801,16 @@ simplify_comparison (code, pop0, pop1)
&& (i = exact_log2 (INTVAL (XEXP (op0, 0)))) >= 0)
{
if (BITS_BIG_ENDIAN)
+ {
#ifdef HAVE_extzv
- i = (GET_MODE_BITSIZE
- (insn_operand_mode[(int) CODE_FOR_extzv][1]) - 1 - i);
+ mode = insn_operand_mode[(int) CODE_FOR_extzv][1];
+ if (mode == VOIDmode)
+ mode = word_mode;
+ i = (GET_MODE_BITSIZE (mode) - 1 - i);
#else
- i = BITS_PER_WORD - 1 - i;
+ i = BITS_PER_WORD - 1 - i;
#endif
+ }
op0 = XEXP (op0, 2);
op1 = GEN_INT (i);
@@ -10150,14 +10196,30 @@ simplify_comparison (code, pop0, pop1)
if (GET_CODE (XEXP (op0, 0)) == SUBREG
&& ((mode_width
>= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0)))))
- || subreg_lowpart_p (XEXP (op0, 0)))
+#ifdef WORD_REGISTER_OPERATIONS
+ || subreg_lowpart_p (XEXP (op0, 0))
+#endif
+ )
+#ifndef WORD_REGISTER_OPERATIONS
+ /* It is unsafe to commute the AND into the SUBREG if the SUBREG
+ is paradoxical and WORD_REGISTER_OPERATIONS is not defined.
+ As originally written the upper bits have a defined value
+ due to the AND operation. However, if we commute the AND
+ inside the SUBREG then they no longer have defined values
+ and the meaning of the code has been changed. */
+ && (GET_MODE_SIZE (GET_MODE (XEXP (op0, 0)))
+ <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0)))))
+#endif
&& GET_CODE (XEXP (op0, 1)) == CONST_INT
&& mode_width <= HOST_BITS_PER_WIDE_INT
&& (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0))))
<= HOST_BITS_PER_WIDE_INT)
&& (INTVAL (XEXP (op0, 1)) & ~ mask) == 0
&& 0 == (~ GET_MODE_MASK (GET_MODE (SUBREG_REG (XEXP (op0, 0))))
- & INTVAL (XEXP (op0, 1))))
+ & INTVAL (XEXP (op0, 1)))
+ && INTVAL (XEXP (op0, 1)) != mask
+ && (INTVAL (XEXP (op0, 1))
+ != GET_MODE_MASK (GET_MODE (SUBREG_REG (XEXP (op0, 0))))))
{
op0
@@ -11501,6 +11563,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
{
rtx set = single_set (tem);
rtx inner_dest = 0;
+ rtx cc0_setter = NULL_RTX;
if (set != 0)
for (inner_dest = SET_DEST (set);
@@ -11511,10 +11574,21 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
;
/* Verify that it was the set, and not a clobber that
- modified the register. */
+ modified the register.
+
+ CC0 targets must be careful to maintain setter/user
+ pairs. If we cannot delete the setter due to side
+ effects, mark the user with an UNUSED note instead
+ of deleting it. */
if (set != 0 && ! side_effects_p (SET_SRC (set))
- && rtx_equal_p (XEXP (note, 0), inner_dest))
+ && rtx_equal_p (XEXP (note, 0), inner_dest)
+#ifdef HAVE_cc0
+ && (! reg_mentioned_p (cc0_rtx, SET_SRC (set))
+ || ((cc0_setter = prev_cc0_setter (tem)) != NULL
+ && sets_cc0_p (PATTERN (cc0_setter)) > 0))
+#endif
+ )
{
/* Move the notes and links of TEM elsewhere.
This might delete other dead insns recursively.
@@ -11530,6 +11604,23 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
PUT_CODE (tem, NOTE);
NOTE_LINE_NUMBER (tem) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (tem) = 0;
+
+#ifdef HAVE_cc0
+ /* Delete the setter too. */
+ if (cc0_setter)
+ {
+ PATTERN (cc0_setter) = pc_rtx;
+
+ distribute_notes (REG_NOTES (cc0_setter),
+ cc0_setter, cc0_setter,
+ NULL_RTX, NULL_RTX, NULL_RTX);
+ distribute_links (LOG_LINKS (cc0_setter));
+
+ PUT_CODE (cc0_setter, NOTE);
+ NOTE_LINE_NUMBER (cc0_setter) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (cc0_setter) = 0;
+ }
+#endif
}
/* If the register is both set and used here, put the
REG_DEAD note here, but place a REG_UNUSED note
@@ -11542,8 +11633,9 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (! find_regno_note (tem, REG_UNUSED,
REGNO (XEXP (note, 0))))
REG_NOTES (tem)
- = gen_rtx (EXPR_LIST, REG_UNUSED, XEXP (note, 0),
- REG_NOTES (tem));
+ = gen_rtx_EXPR_LIST (REG_UNUSED,
+ XEXP (note, 0),
+ REG_NOTES (tem));
}
else
{
diff --git a/gcc/config.in b/gcc/config.in
index 772c165e248..05b300231b1 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,10 +1,30 @@
/* config.in. Generated automatically from configure.in by autoheader. */
-/* Define to "%p" if printf supports it, else machmode.h will define it. */
-#undef HOST_PTR_PRINTF
+/* Define if you can safely include both <string.h> and <strings.h>. */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p". */
+#undef HAVE_PRINTF_PTR
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
/* Define if your cpp understands the stringify operator. */
#undef HAVE_CPP_STRINGIFY
+/* Define if your compiler understands volatile. */
+#undef HAVE_VOLATILE
+
+/* Define if your assembler supports specifying the maximum number
+ of bytes to skip when using the GAS .p2align command. */
+#undef HAVE_GAS_MAX_SKIP_P2ALIGN
+
+/* Define if your assembler supports .balign and .p2align. */
+#undef HAVE_GAS_BALIGN_AND_P2ALIGN
+
+/* Define if your assembler supports .subsection and .subsection -1 starts
+ emitting at the beginning of your section */
+#undef HAVE_GAS_SUBSECTION_ORDERING
+
/* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -47,6 +67,34 @@
/* Whether abort must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ABORT
+/* Whether strerror must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether strsignal must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRSIGNAL
+
+/* Whether getcwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETWD
+
+/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_GETRLIMIT
+
+/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
+#undef NEED_DECLARATION_SETRLIMIT
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
+
+/* Define to enable the use of a default assembler. */
+#undef DEFAULT_ASSEMBLER
+
+/* Define to enable the use of a default linker. */
+#undef DEFAULT_LINKER
+
+
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
@@ -83,6 +131,9 @@
/* Define if you have the getrlimit function. */
#undef HAVE_GETRLIMIT
+/* Define if you have the gettimeofday function. */
+#undef HAVE_GETTIMEOFDAY
+
/* Define if you have the index function. */
#undef HAVE_INDEX
@@ -113,6 +164,9 @@
/* Define if you have the strrchr function. */
#undef HAVE_STRRCHR
+/* Define if you have the strsignal function. */
+#undef HAVE_STRSIGNAL
+
/* Define if you have the strtoul function. */
#undef HAVE_STRTOUL
diff --git a/gcc/config.sub b/gcc/config.sub
index b491c9f5ce0..f1ee4a1714b 100755
--- a/gcc/config.sub
+++ b/gcc/config.sub
@@ -117,6 +117,9 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -156,7 +159,7 @@ case $basic_machine in
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | v850)
+ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850)
basic_machine=$basic_machine-unknown
;;
thumb | thumbel)
@@ -182,7 +185,7 @@ case $basic_machine in
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | mips64-* | mipsel-* \
+ | sparc64-* | sparcv9-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
@@ -663,7 +666,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sparc)
+ sparc | sparcv9)
basic_machine=sparc-sun
;;
cydra)
@@ -732,7 +735,7 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* )
+ | -win32* | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -udk* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
diff --git a/gcc/config/1750a/1750a.h b/gcc/config/1750a/1750a.h
index e49f6943e5d..0a3aa8e3c98 100644
--- a/gcc/config/1750a/1750a.h
+++ b/gcc/config/1750a/1750a.h
@@ -854,8 +854,8 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
in one reasonably fast instruction. */
#define MOVE_MAX 65536
-/* MOVE_RATIO is the number of move instructions that is better than a
- block move. */
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead. */
#define MOVE_RATIO 4
/* Define this if zero-extension is slow (more than one real instruction). */
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 334f77c50a4..5f738b599b2 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -21,8 +21,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
-#include <ctype.h>
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -35,11 +34,12 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "recog.h"
#include "reload.h"
+#include "tree.h"
#include "expr.h"
#include "obstack.h"
-#include "tree.h"
#include "except.h"
#include "function.h"
+#include "toplev.h"
/* External data. */
extern char *version_string;
@@ -79,20 +79,15 @@ char *alpha_mlat_string; /* -mmemory-latency= */
rtx alpha_compare_op0, alpha_compare_op1;
int alpha_compare_fp_p;
-/* Save the name of the current function as used by the assembler. This
- is used by the epilogue. */
+/* Define the information needed to modify the epilogue for EH. */
-char *alpha_function_name;
+rtx alpha_eh_epilogue_sp_ofs;
/* Non-zero if inside of a function, because the Alpha asm can't
handle .files inside of functions. */
static int inside_function = FALSE;
-/* Nonzero if the current function needs gp. */
-
-int alpha_function_needs_gp;
-
/* If non-null, this rtx holds the return address for the function. */
static rtx alpha_return_addr_rtx;
@@ -101,17 +96,29 @@ static rtx alpha_return_addr_rtx;
int alpha_memory_latency = 3;
+/* Whether the function needs the GP. */
+
+static int alpha_function_needs_gp;
+
+/* The alias set for prologue/epilogue register save/restore. */
+
+static int alpha_sr_alias_set;
+
/* Declarations of static functions. */
-static void alpha_set_memflags_1 PROTO((rtx, int, int, int));
-static rtx alpha_emit_set_const_1 PROTO((rtx, enum machine_mode,
- HOST_WIDE_INT, int));
-static void add_long_const PROTO((FILE *, HOST_WIDE_INT, int, int, int));
+static void alpha_set_memflags_1
+ PROTO((rtx, int, int, int));
+static rtx alpha_emit_set_const_1
+ PROTO((rtx, enum machine_mode, HOST_WIDE_INT, int));
+static void alpha_expand_unaligned_load_words
+ PROTO((rtx *out_regs, rtx smem, HOST_WIDE_INT words, HOST_WIDE_INT ofs));
+static void alpha_expand_unaligned_store_words
+ PROTO((rtx *out_regs, rtx smem, HOST_WIDE_INT words, HOST_WIDE_INT ofs));
+static void alpha_sa_mask
+ PROTO((unsigned long *imaskP, unsigned long *fmaskP));
+static int alpha_does_function_need_gp
+ PROTO((void));
+
-/* Compute the size of the save area in the stack. */
-#if OPEN_VMS
-static void alpha_sa_mask PROTO((unsigned long *imaskP,
- unsigned long *fmaskP));
-#endif
/* Get the number of args of a function in one of two ways. */
#ifdef OPEN_VMS
#define NUM_ARGS current_function_args_info.num_args
@@ -119,20 +126,14 @@ static void alpha_sa_mask PROTO((unsigned long *imaskP,
#define NUM_ARGS current_function_args_info
#endif
-#if OPEN_VMS
#define REG_PV 27
#define REG_RA 26
-#else
-#define REG_RA 26
-#endif
/* Parse target option strings. */
void
override_options ()
{
- /* 971208 -- EV6 scheduling parameters are still secret, so don't even
- pretend and just schedule for an EV5 for now. -- r~ */
alpha_cpu
= TARGET_CPU_DEFAULT & MASK_CPU_EV6 ? PROCESSOR_EV6
: (TARGET_CPU_DEFAULT & MASK_CPU_EV5 ? PROCESSOR_EV5 : PROCESSOR_EV4);
@@ -305,6 +306,9 @@ override_options ()
/* Default the definition of "small data" to 8 bytes. */
if (!g_switch_set)
g_switch_value = 8;
+
+ /* Acquire a unique set number for our register saves and restores. */
+ alpha_sr_alias_set = new_alias_set ();
}
/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
@@ -344,6 +348,7 @@ reg_or_6bit_operand (op, mode)
{
return ((GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 64)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| register_operand (op, mode));
}
@@ -357,6 +362,7 @@ reg_or_8bit_operand (op, mode)
{
return ((GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| register_operand (op, mode));
}
@@ -365,10 +371,11 @@ reg_or_8bit_operand (op, mode)
int
cint8_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
- return (GET_CODE (op) == CONST_INT
- && (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100);
+ return ((GET_CODE (op) == CONST_INT
+ && (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100)
+ || GET_CODE (op) == CONSTANT_P_RTX);
}
/* Return 1 if the operand is a valid second operand to an add insn. */
@@ -382,6 +389,8 @@ add_operand (op, mode)
return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'K')
|| CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')
|| CONST_OK_FOR_LETTER_P (INTVAL (op), 'O'));
+ else if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
return register_operand (op, mode);
}
@@ -397,6 +406,8 @@ sext_add_operand (op, mode)
if (GET_CODE (op) == CONST_INT)
return ((unsigned HOST_WIDE_INT) INTVAL (op) < 255
|| (unsigned HOST_WIDE_INT) (- INTVAL (op)) < 255);
+ else if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
return register_operand (op, mode);
}
@@ -406,7 +417,7 @@ sext_add_operand (op, mode)
int
const48_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 4 || INTVAL (op) == 8));
@@ -427,6 +438,8 @@ and_operand (op, mode)
return ((unsigned HOST_WIDE_INT) INTVAL (op) < 0x100
|| (unsigned HOST_WIDE_INT) ~ INTVAL (op) < 0x100
|| zap_mask (INTVAL (op)));
+ else if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
return register_operand (op, mode);
}
@@ -441,6 +454,8 @@ or_operand (op, mode)
if (GET_CODE (op) == CONST_INT)
return ((unsigned HOST_WIDE_INT) INTVAL (op) < 0x100
|| (unsigned HOST_WIDE_INT) ~ INTVAL (op) < 0x100);
+ else if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
return register_operand (op, mode);
}
@@ -451,7 +466,7 @@ or_operand (op, mode)
int
mode_width_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 8 || INTVAL (op) == 16
@@ -464,7 +479,7 @@ mode_width_operand (op, mode)
int
mode_mask_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
#if HOST_BITS_PER_WIDE_INT == 32
if (GET_CODE (op) == CONST_DOUBLE)
@@ -479,9 +494,9 @@ mode_mask_operand (op, mode)
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 0xff
|| INTVAL (op) == 0xffff
- || INTVAL (op) == 0xffffffff
+ || INTVAL (op) == (HOST_WIDE_INT)0xffffffff
#if HOST_BITS_PER_WIDE_INT == 64
- || INTVAL (op) == 0xffffffffffffffff
+ || INTVAL (op) == -1
#endif
));
}
@@ -491,7 +506,7 @@ mode_mask_operand (op, mode)
int
mul8_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 64
@@ -539,7 +554,9 @@ reg_or_cint_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- return GET_CODE (op) == CONST_INT || register_operand (op, mode);
+ return (GET_CODE (op) == CONST_INT
+ || GET_CODE (op) == CONSTANT_P_RTX
+ || register_operand (op, mode));
}
/* Return 1 if OP is something that can be reloaded into a register;
@@ -555,8 +572,8 @@ some_operand (op, mode)
switch (GET_CODE (op))
{
- case REG: case MEM: case CONST_DOUBLE:
- case CONST_INT: case LABEL_REF: case SYMBOL_REF: case CONST:
+ case REG: case MEM: case CONST_DOUBLE: case CONST_INT: case LABEL_REF:
+ case SYMBOL_REF: case CONST: case CONSTANT_P_RTX:
return 1;
case SUBREG:
@@ -587,7 +604,7 @@ input_operand (op, mode)
case LABEL_REF:
case SYMBOL_REF:
case CONST:
- /* This handles both the Windows/NT and OSF cases. */
+ /* This handles both the Windows/NT and OSF cases. */
return mode == ptr_mode || mode == DImode;
case REG:
@@ -605,6 +622,7 @@ input_operand (op, mode)
return GET_MODE_CLASS (mode) == MODE_FLOAT && op == CONST0_RTX (mode);
case CONST_INT:
+ case CONSTANT_P_RTX:
return mode == QImode || mode == HImode || add_operand (op, mode);
default:
@@ -620,7 +638,7 @@ input_operand (op, mode)
int
current_file_function_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == SYMBOL_REF
&& ! profile_flag && ! profile_block_flag
@@ -682,7 +700,7 @@ alpha_swapped_comparison_operator (op, mode)
int
signed_comparison_operator (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -701,7 +719,7 @@ signed_comparison_operator (op, mode)
int
divmod_operator (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -804,7 +822,7 @@ reg_or_unaligned_mem_operand (op, mode)
int
any_memory_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == MEM
|| (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG)
@@ -815,6 +833,17 @@ any_memory_operand (op, mode)
&& REGNO (SUBREG_REG (op)) >= FIRST_PSEUDO_REGISTER));
}
+/* Return 1 if this function can directly return via $26. */
+
+int
+direct_return ()
+{
+ return (! TARGET_OPEN_VMS && reload_completed && alpha_sa_size () == 0
+ && get_frame_size () == 0
+ && current_function_outgoing_args_size == 0
+ && current_function_pretend_args_size == 0);
+}
+
/* REF is an alignable memory location. Place an aligned SImode
reference into *PALIGNED_MEM and the number of bits to shift into
*PBITNUM. */
@@ -848,12 +877,15 @@ get_aligned_mem (ref, paligned_mem, pbitnum)
if (GET_CODE (base) == PLUS)
offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0);
- *paligned_mem = gen_rtx_MEM (SImode,
- plus_constant (base, offset & ~3));
+ *paligned_mem = gen_rtx_MEM (SImode, plus_constant (base, offset & ~3));
MEM_IN_STRUCT_P (*paligned_mem) = MEM_IN_STRUCT_P (ref);
MEM_VOLATILE_P (*paligned_mem) = MEM_VOLATILE_P (ref);
RTX_UNCHANGING_P (*paligned_mem) = RTX_UNCHANGING_P (ref);
+ /* Sadly, we cannot use alias sets here because we may overlap other
+ data in a different alias set. */
+ /* MEM_ALIAS_SET (*paligned_mem) = MEM_ALIAS_SET (ref); */
+
*pbitnum = GEN_INT ((offset & 3) * 8);
}
@@ -927,6 +959,12 @@ alpha_set_memflags_1 (x, in_struct_p, volatile_p, unchanging_p)
MEM_IN_STRUCT_P (x) = in_struct_p;
MEM_VOLATILE_P (x) = volatile_p;
RTX_UNCHANGING_P (x) = unchanging_p;
+ /* Sadly, we cannot use alias sets because the extra aliasing
+ produced by the AND interferes. Given that two-byte quantities
+ are the only thing we would be able to differentiate anyway,
+ there does not seem to be any point in convoluting the early
+ out of the alias check. */
+ /* MEM_ALIAS_SET (x) = alias_set; */
break;
default:
@@ -945,14 +983,19 @@ alpha_set_memflags (insn, ref)
rtx insn;
rtx ref;
{
- /* Note that it is always safe to get these flags, though they won't
- be what we think if REF is not a MEM. */
- int in_struct_p = MEM_IN_STRUCT_P (ref);
- int volatile_p = MEM_VOLATILE_P (ref);
- int unchanging_p = RTX_UNCHANGING_P (ref);
-
- if (GET_CODE (ref) != MEM
- || (! in_struct_p && ! volatile_p && ! unchanging_p))
+ int in_struct_p, volatile_p, unchanging_p;
+
+ if (GET_CODE (ref) != MEM)
+ return;
+
+ in_struct_p = MEM_IN_STRUCT_P (ref);
+ volatile_p = MEM_VOLATILE_P (ref);
+ unchanging_p = RTX_UNCHANGING_P (ref);
+
+ /* This is only called from alpha.md, after having had something
+ generated from one of the insn patterns. So if everything is
+ zero, the pattern is already up-to-date. */
+ if (! in_struct_p && ! volatile_p && ! unchanging_p)
return;
alpha_set_memflags_1 (insn, in_struct_p, volatile_p, unchanging_p);
@@ -1158,70 +1201,181 @@ alpha_emit_set_const_1 (target, mode, c, n)
return 0;
}
-#if HOST_BITS_PER_WIDE_INT == 64
/* Having failed to find a 3 insn sequence in alpha_emit_set_const,
fall back to a straight forward decomposition. We do this to avoid
exponential run times encountered when looking for longer sequences
with alpha_emit_set_const. */
rtx
-alpha_emit_set_long_const (target, c)
+alpha_emit_set_long_const (target, c1, c2)
rtx target;
- HOST_WIDE_INT c;
+ HOST_WIDE_INT c1, c2;
{
- /* Use a pseudo if highly optimizing and still generating RTL. */
- rtx subtarget
- = (flag_expensive_optimizations && rtx_equal_function_value_matters
- ? 0 : target);
HOST_WIDE_INT d1, d2, d3, d4;
- rtx r1, r2;
/* Decompose the entire word */
- d1 = ((c & 0xffff) ^ 0x8000) - 0x8000;
- c -= d1;
- d2 = ((c & 0xffffffff) ^ 0x80000000) - 0x80000000;
- c = (c - d2) >> 32;
- d3 = ((c & 0xffff) ^ 0x8000) - 0x8000;
- c -= d3;
- d4 = ((c & 0xffffffff) ^ 0x80000000) - 0x80000000;
-
- if (c - d4 != 0)
- abort();
+#if HOST_BITS_PER_WIDE_INT >= 64
+ if (c2 != -(c1 < 0))
+ abort ();
+ d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
+ c1 -= d1;
+ d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ c1 = (c1 - d2) >> 32;
+ d3 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
+ c1 -= d3;
+ d4 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ if (c1 != d4)
+ abort ();
+#else
+ d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
+ c1 -= d1;
+ d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ if (c1 != d2)
+ abort ();
+ c2 += (d2 < 0);
+ d3 = ((c2 & 0xffff) ^ 0x8000) - 0x8000;
+ c2 -= d3;
+ d4 = ((c2 & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ if (c2 != d4)
+ abort ();
+#endif
/* Construct the high word */
- if (d3 == 0)
- r1 = copy_to_suggested_reg (GEN_INT (d4), subtarget, DImode);
- else if (d4 == 0)
- r1 = copy_to_suggested_reg (GEN_INT (d3), subtarget, DImode);
+ if (d4)
+ {
+ emit_move_insn (target, GEN_INT (d4));
+ if (d3)
+ emit_move_insn (target, gen_rtx_PLUS (DImode, target, GEN_INT (d3)));
+ }
else
- r1 = expand_binop (DImode, add_optab, GEN_INT (d3), GEN_INT (d4),
- subtarget, 0, OPTAB_WIDEN);
+ emit_move_insn (target, GEN_INT (d3));
/* Shift it into place */
- r2 = expand_binop (DImode, ashl_optab, r1, GEN_INT (32),
- subtarget, 0, OPTAB_WIDEN);
+ emit_move_insn (target, gen_rtx_ASHIFT (DImode, target, GEN_INT (32)));
+
+ /* Add in the low bits. */
+ if (d2)
+ emit_move_insn (target, gen_rtx_PLUS (DImode, target, GEN_INT (d2)));
+ if (d1)
+ emit_move_insn (target, gen_rtx_PLUS (DImode, target, GEN_INT (d1)));
+
+ return target;
+}
+
+/* Generate the comparison for a conditional branch. */
+
+rtx
+alpha_emit_conditional_branch (code)
+ enum rtx_code code;
+{
+ enum rtx_code cmp_code, branch_code;
+ enum machine_mode cmp_mode, branch_mode = VOIDmode;
+ rtx op0 = alpha_compare_op0, op1 = alpha_compare_op1;
+ rtx tem;
+
+ /* The general case: fold the comparison code to the types of compares
+ that we have, choosing the branch as necessary. */
+ switch (code)
+ {
+ case EQ: case LE: case LT: case LEU: case LTU:
+ /* We have these compares: */
+ cmp_code = code, branch_code = NE;
+ break;
+
+ case NE:
+ /* This must be reversed. */
+ cmp_code = EQ, branch_code = EQ;
+ break;
+
+ case GE: case GT: case GEU: case GTU:
+ /* For FP, we swap them, for INT, we reverse them. */
+ if (alpha_compare_fp_p)
+ {
+ cmp_code = swap_condition (code);
+ branch_code = NE;
+ tem = op0, op0 = op1, op1 = tem;
+ }
+ else
+ {
+ cmp_code = reverse_condition (code);
+ branch_code = EQ;
+ }
+ break;
+
+ default:
+ abort ();
+ }
- if (subtarget == 0 && d1 == d3 && d2 == d4)
- r1 = expand_binop (DImode, add_optab, r1, r2, subtarget, 0, OPTAB_WIDEN);
+ if (alpha_compare_fp_p)
+ {
+ cmp_mode = DFmode;
+ if (flag_fast_math)
+ {
+ /* When we are not as concerned about non-finite values, and we
+ are comparing against zero, we can branch directly. */
+ if (op1 == CONST0_RTX (DFmode))
+ cmp_code = NIL, branch_code = code;
+ else if (op0 == CONST0_RTX (DFmode))
+ {
+ /* Undo the swap we probably did just above. */
+ tem = op0, op0 = op1, op1 = tem;
+ branch_code = swap_condition (cmp_code);
+ cmp_code = NIL;
+ }
+ }
+ else
+ {
+ /* ??? We mark the the branch mode to be CCmode to prevent the
+ compare and branch from being combined, since the compare
+ insn follows IEEE rules that the branch does not. */
+ branch_mode = CCmode;
+ }
+ }
else
{
- r1 = r2;
-
- /* Add in the low word */
- if (d2 != 0)
- r1 = expand_binop (DImode, add_optab, r1, GEN_INT (d2),
- subtarget, 0, OPTAB_WIDEN);
- if (d1 != 0)
- r1 = expand_binop (DImode, add_optab, r1, GEN_INT (d1),
- subtarget, 0, OPTAB_WIDEN);
+ cmp_mode = DImode;
+
+ /* The following optimizations are only for signed compares. */
+ if (code != LEU && code != LTU && code != GEU && code != GTU)
+ {
+ /* Whee. Compare and branch against 0 directly. */
+ if (op1 == const0_rtx)
+ cmp_code = NIL, branch_code = code;
+
+ /* We want to use cmpcc/bcc when we can, since there is a zero delay
+ bypass between logicals and br/cmov on EV5. But we don't want to
+ force valid immediate constants into registers needlessly. */
+ else if (GET_CODE (op1) == CONST_INT)
+ {
+ HOST_WIDE_INT v = INTVAL (op1), n = -v;
+
+ if (! CONST_OK_FOR_LETTER_P (v, 'I')
+ && (CONST_OK_FOR_LETTER_P (n, 'K')
+ || CONST_OK_FOR_LETTER_P (n, 'L')))
+ {
+ cmp_code = PLUS, branch_code = code;
+ op1 = GEN_INT (n);
+ }
+ }
+ }
}
- if (subtarget == 0)
- r1 = copy_to_suggested_reg(r1, target, DImode);
+ /* Force op0 into a register. */
+ if (GET_CODE (op0) != REG)
+ op0 = force_reg (cmp_mode, op0);
+
+ /* Emit an initial compare instruction, if necessary. */
+ tem = op0;
+ if (cmp_code != NIL)
+ {
+ tem = gen_reg_rtx (cmp_mode);
+ emit_move_insn (tem, gen_rtx_fmt_ee (cmp_code, cmp_mode, op0, op1));
+ }
- return r1;
+ /* Return the branch comparison. */
+ return gen_rtx_fmt_ee (branch_code, branch_mode, tem, CONST0_RTX (cmp_mode));
}
-#endif /* HOST_BITS_PER_WIDE_INT == 64 */
+
/* Rewrite a comparison against zero CMP of the form
(CODE (cc0) (const_int 0)) so it can be written validly in
@@ -1241,6 +1395,7 @@ alpha_emit_conditional_move (cmp, mode)
enum machine_mode cmp_mode
= (GET_MODE (op0) == VOIDmode ? DImode : GET_MODE (op0));
enum machine_mode cmp_op_mode = alpha_compare_fp_p ? DFmode : DImode;
+ enum machine_mode cmov_mode = VOIDmode;
rtx tem;
if (alpha_compare_fp_p != FLOAT_MODE_P (mode))
@@ -1249,6 +1404,7 @@ alpha_emit_conditional_move (cmp, mode)
/* We may be able to use a conditional move directly.
This avoids emitting spurious compares. */
if (signed_comparison_operator (cmp, cmp_op_mode)
+ && (!alpha_compare_fp_p || flag_fast_math)
&& (op0 == CONST0_RTX (cmp_mode) || op1 == CONST0_RTX (cmp_mode)))
return gen_rtx_fmt_ee (code, VOIDmode, op0, op1);
@@ -1281,9 +1437,15 @@ alpha_emit_conditional_move (cmp, mode)
abort ();
}
+ /* ??? We mark the branch mode to be CCmode to prevent the compare
+ and cmov from being combined, since the compare insn follows IEEE
+ rules that the cmov does not. */
+ if (alpha_compare_fp_p && !flag_fast_math)
+ cmov_mode = CCmode;
+
tem = gen_reg_rtx (cmp_op_mode);
emit_move_insn (tem, gen_rtx_fmt_ee (code, cmp_op_mode, op0, op1));
- return gen_rtx_fmt_ee (cmov_code, VOIDmode, tem, CONST0_RTX (cmp_op_mode));
+ return gen_rtx_fmt_ee (cmov_code, cmov_mode, tem, CONST0_RTX (cmp_op_mode));
}
/* Use ext[wlq][lh] as the Architecture Handbook describes for extracting
@@ -1838,7 +2000,7 @@ alpha_expand_block_move (operands)
}
src_done:
- if (nregs > sizeof(data_regs)/sizeof(*data_regs))
+ if (nregs > (int)(sizeof(data_regs)/sizeof(*data_regs)))
abort();
/*
@@ -2290,6 +2452,7 @@ void
alpha_init_expanders ()
{
alpha_return_addr_rtx = NULL_RTX;
+ alpha_eh_epilogue_sp_ofs = NULL_RTX;
/* Arrange to save and restore machine status around nested functions. */
save_machine_status = alpha_save_machine_status;
@@ -2301,7 +2464,7 @@ alpha_init_expanders ()
rtx
alpha_return_addr (count, frame)
int count;
- rtx frame;
+ rtx frame ATTRIBUTE_UNUSED;
{
rtx init;
@@ -2313,7 +2476,7 @@ alpha_return_addr (count, frame)
/* No rtx yet. Invent one, and initialize it from $26 in the prologue. */
alpha_return_addr_rtx = gen_reg_rtx (Pmode);
- init = gen_rtx_SET (Pmode, alpha_return_addr_rtx,
+ init = gen_rtx_SET (VOIDmode, alpha_return_addr_rtx,
gen_rtx_REG (Pmode, REG_RA));
/* Emit the insn to the prologue with the other argument copies. */
@@ -2327,11 +2490,20 @@ alpha_return_addr (count, frame)
static int
alpha_ra_ever_killed ()
{
+ rtx top;
+
+#ifdef ASM_OUTPUT_MI_THUNK
+ if (current_function_is_thunk)
+ return 0;
+#endif
if (!alpha_return_addr_rtx)
return regs_ever_live[REG_RA];
- return reg_set_between_p (gen_rtx_REG (Pmode, REG_RA),
- get_insns(), NULL_RTX);
+ push_topmost_sequence ();
+ top = get_insns ();
+ pop_topmost_sequence ();
+
+ return reg_set_between_p (gen_rtx_REG (Pmode, REG_RA), top, NULL_RTX);
}
@@ -2374,6 +2546,23 @@ print_operand (file, x, code)
fputs ("su", file);
break;
+ case '`':
+ /* Generates trap-mode suffix for instructions that accept the
+ v and sv suffix. The only instruction that needs this is cvtql. */
+ switch (alpha_fptm)
+ {
+ case ALPHA_FPTM_N:
+ break;
+ case ALPHA_FPTM_U:
+ fputs ("v", file);
+ break;
+ case ALPHA_FPTM_SU:
+ case ALPHA_FPTM_SUI:
+ fputs ("sv", file);
+ break;
+ }
+ break;
+
case '(':
/* Generates trap-mode suffix for instructions that accept the
v, sv, and svi suffix. The only instruction that needs this
@@ -2419,7 +2608,8 @@ print_operand (file, x, code)
suffix (cvtqt and cvtqs). */
switch (alpha_fptm)
{
- case ALPHA_FPTM_N: case ALPHA_FPTM_U:
+ case ALPHA_FPTM_N:
+ case ALPHA_FPTM_U:
case ALPHA_FPTM_SU: /* cvtqt/cvtqs can't cause underflow */
break;
case ALPHA_FPTM_SUI:
@@ -2561,7 +2751,7 @@ print_operand (file, x, code)
&& CONST_DOUBLE_LOW (x) == -1)
fprintf (file, "q");
#else
- else if (GET_CODE (x) == CONST_INT && INTVAL (x) == 0xffffffffffffffff)
+ else if (GET_CODE (x) == CONST_INT && INTVAL (x) == -1)
fprintf (file, "q");
else if (GET_CODE (x) == CONST_DOUBLE
&& CONST_DOUBLE_HIGH (x) == 0
@@ -2659,6 +2849,65 @@ print_operand (file, x, code)
}
}
+/* Emit RTL insns to initialize the variable parts of a trampoline at
+ TRAMP. FNADDR is an RTX for the address of the function's pure
+ code. CXT is an RTX for the static chain value for the function.
+
+ The three offset parameters are for the individual template's
+ layout. A JMPOFS < 0 indicates that the trampoline does not
+ contain instructions at all.
+
+ We assume here that a function will be called many more times than
+ its address is taken (e.g., it might be passed to qsort), so we
+ take the trouble to initialize the "hint" field in the JMP insn.
+ Note that the hint field is PC (new) + 4 * bits 13:0. */
+
+void
+alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs)
+ rtx tramp, fnaddr, cxt;
+ int fnofs, cxtofs, jmpofs;
+{
+ rtx temp, temp1, addr;
+ /* ??? Something is wrong with VMS codegen in that we get aborts when
+ using ptr_mode. Hack around it for now. */
+ enum machine_mode mode = TARGET_OPEN_VMS ? Pmode : ptr_mode;
+
+ /* Store function address and CXT. */
+ addr = memory_address (mode, plus_constant (tramp, fnofs));
+ emit_move_insn (gen_rtx (MEM, mode, addr), fnaddr);
+ addr = memory_address (mode, plus_constant (tramp, cxtofs));
+ emit_move_insn (gen_rtx (MEM, mode, addr), cxt);
+
+ /* This has been disabled since the hint only has a 32k range, and in
+ no existing OS is the stack within 32k of the text segment. */
+ if (0 && jmpofs >= 0)
+ {
+ /* Compute hint value. */
+ temp = force_operand (plus_constant (tramp, jmpofs+4), NULL_RTX);
+ temp = expand_binop (DImode, sub_optab, fnaddr, temp, temp, 1,
+ OPTAB_WIDEN);
+ temp = expand_shift (RSHIFT_EXPR, Pmode, temp,
+ build_int_2 (2, 0), NULL_RTX, 1);
+ temp = expand_and (gen_lowpart (SImode, temp), GEN_INT (0x3fff), 0);
+
+ /* Merge in the hint. */
+ addr = memory_address (SImode, plus_constant (tramp, jmpofs));
+ temp1 = force_reg (SImode, gen_rtx (MEM, SImode, addr));
+ temp1 = expand_and (temp1, GEN_INT (0xffffc000), NULL_RTX);
+ temp1 = expand_binop (SImode, ior_optab, temp1, temp, temp1, 1,
+ OPTAB_WIDEN);
+ emit_move_insn (gen_rtx (MEM, SImode, addr), temp1);
+ }
+
+#ifdef TRANSFER_FROM_TRAMPOLINE
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
+ 0, VOIDmode, 1, addr, Pmode);
+#endif
+
+ if (jmpofs >= 0)
+ emit_insn (gen_imb ());
+}
+
/* Do what is necessary for `va_start'. The argument is ignored;
We look at the current function to determine if stdarg or varargs
is used and fill in an initial va_list. A pointer to this constructor
@@ -2666,7 +2915,7 @@ print_operand (file, x, code)
struct rtx_def *
alpha_builtin_saveregs (arglist)
- tree arglist;
+ tree arglist ATTRIBUTE_UNUSED;
{
rtx block, addr, dest, argsize;
tree fntype = TREE_TYPE (current_function_decl);
@@ -2761,28 +3010,26 @@ alpha_builtin_saveregs (arglist)
/* Compute the size of the save area in the stack. */
-#if OPEN_VMS
-
/* These variables are used for communication between the following functions.
They indicate various things about the current function being compiled
that are used to tell what kind of prologue, epilogue and procedure
descriptior to generate. */
/* Nonzero if we need a stack procedure. */
-static int is_stack_procedure;
+static int vms_is_stack_procedure;
/* Register number (either FP or SP) that is used to unwind the frame. */
-static int unwind_regno;
+static int vms_unwind_regno;
/* Register number used to save FP. We need not have one for RA since
we don't modify it for register procedures. This is only defined
for register frame procedures. */
-static int save_fp_regno;
+static int vms_save_fp_regno;
/* Register number used to reference objects off our PV. */
-static int base_regno;
+static int vms_base_regno;
-/* Compute register masks for saved registers. */
+/* Compute register masks for saved registers. */
static void
alpha_sa_mask (imaskP, fmaskP)
@@ -2793,75 +3040,99 @@ alpha_sa_mask (imaskP, fmaskP)
unsigned long fmask = 0;
int i;
- if (is_stack_procedure)
- imask |= (1L << HARD_FRAME_POINTER_REGNUM);
+#ifdef ASM_OUTPUT_MI_THUNK
+ if (!current_function_is_thunk)
+#endif
+ {
+ if (TARGET_OPEN_VMS && vms_is_stack_procedure)
+ imask |= (1L << HARD_FRAME_POINTER_REGNUM);
- /* One for every register we have to save. */
+ /* One for every register we have to save. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (! fixed_regs[i] && ! call_used_regs[i]
+ && regs_ever_live[i] && i != REG_RA)
+ {
+ if (i < 32)
+ imask |= (1L << i);
+ else
+ fmask |= (1L << (i - 32));
+ }
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
- && regs_ever_live[i] && i != REG_RA)
- {
- if (i < 32)
- imask |= (1L << i);
- else
- fmask |= (1L << (i - 32));
- }
+ if (imask || fmask || alpha_ra_ever_killed ())
+ imask |= (1L << REG_RA);
+ }
*imaskP = imask;
*fmaskP = fmask;
-
- return;
}
int
alpha_sa_size ()
{
int sa_size = 0;
- HOST_WIDE_INT stack_needed;
int i;
- /* One for every register we have to save. */
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
- && regs_ever_live[i] && i != REG_RA)
- sa_size++;
-
- /* Start by assuming we can use a register procedure if we don't make any
- calls (REG_RA not used) or need to save any registers and a stack
- procedure if we do. */
- is_stack_procedure = sa_size != 0 || alpha_ra_ever_killed ();
-
- /* Decide whether to refer to objects off our PV via FP or PV.
- If we need FP for something else or if we receive a nonlocal
- goto (which expects PV to contain the value), we must use PV.
- Otherwise, start by assuming we can use FP. */
- base_regno = (frame_pointer_needed || current_function_has_nonlocal_label
- || is_stack_procedure
- || current_function_outgoing_args_size
- ? REG_PV : HARD_FRAME_POINTER_REGNUM);
-
- /* If we want to copy PV into FP, we need to find some register in which to
- save FP. */
-
- save_fp_regno = -1;
-
- if (base_regno == HARD_FRAME_POINTER_REGNUM)
- for (i = 0; i < 32; i++)
- if (! fixed_regs[i] && call_used_regs[i] && ! regs_ever_live[i])
- save_fp_regno = i;
-
- if (save_fp_regno == -1)
- base_regno = REG_PV, is_stack_procedure = 1;
-
- /* Stack unwinding should be done via FP unless we use it for PV. */
- unwind_regno
- = base_regno == REG_PV ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM;
+#ifdef ASM_OUTPUT_MI_THUNK
+ if (current_function_is_thunk)
+ sa_size = 0;
+ else
+#endif
+ {
+ /* One for every register we have to save. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (! fixed_regs[i] && ! call_used_regs[i]
+ && regs_ever_live[i] && i != REG_RA)
+ sa_size++;
+ }
- /* If this is a stack procedure, allow space for saving FP and RA. */
- if (is_stack_procedure)
- sa_size += 2;
+ if (TARGET_OPEN_VMS)
+ {
+ /* Start by assuming we can use a register procedure if we don't
+ make any calls (REG_RA not used) or need to save any
+ registers and a stack procedure if we do. */
+ vms_is_stack_procedure = sa_size != 0 || alpha_ra_ever_killed ();
+
+ /* Decide whether to refer to objects off our PV via FP or PV.
+ If we need FP for something else or if we receive a nonlocal
+ goto (which expects PV to contain the value), we must use PV.
+ Otherwise, start by assuming we can use FP. */
+ vms_base_regno = (frame_pointer_needed
+ || current_function_has_nonlocal_label
+ || vms_is_stack_procedure
+ || current_function_outgoing_args_size
+ ? REG_PV : HARD_FRAME_POINTER_REGNUM);
+
+ /* If we want to copy PV into FP, we need to find some register
+ in which to save FP. */
+
+ vms_save_fp_regno = -1;
+ if (vms_base_regno == HARD_FRAME_POINTER_REGNUM)
+ for (i = 0; i < 32; i++)
+ if (! fixed_regs[i] && call_used_regs[i] && ! regs_ever_live[i])
+ vms_save_fp_regno = i;
+
+ if (vms_save_fp_regno == -1)
+ vms_base_regno = REG_PV, vms_is_stack_procedure = 1;
+
+ /* Stack unwinding should be done via FP unless we use it for PV. */
+ vms_unwind_regno = (vms_base_regno == REG_PV
+ ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
+
+ /* If this is a stack procedure, allow space for saving FP and RA. */
+ if (vms_is_stack_procedure)
+ sa_size += 2;
+ }
+ else
+ {
+ /* If some registers were saved but not RA, RA must also be saved,
+ so leave space for it. */
+ if (sa_size != 0 || alpha_ra_ever_killed ())
+ sa_size++;
+
+ /* Our size must be even (multiple of 16 bytes). */
+ if (sa_size & 1)
+ sa_size++;
+ }
return sa_size * 8;
}
@@ -2870,58 +3141,72 @@ int
alpha_pv_save_size ()
{
alpha_sa_size ();
- return is_stack_procedure ? 8 : 0;
+ return vms_is_stack_procedure ? 8 : 0;
}
int
alpha_using_fp ()
{
alpha_sa_size ();
- return unwind_regno == HARD_FRAME_POINTER_REGNUM;
+ return vms_unwind_regno == HARD_FRAME_POINTER_REGNUM;
}
-#else /* ! OPEN_VMS */
-
int
-alpha_sa_size ()
+vms_valid_decl_attribute_p (decl, attributes, identifier, args)
+ tree decl ATTRIBUTE_UNUSED;
+ tree attributes ATTRIBUTE_UNUSED;
+ tree identifier;
+ tree args;
{
- int size = 0;
- int i;
+ if (is_attribute_p ("overlaid", identifier))
+ return (args == NULL_TREE);
+ return 0;
+}
+
+static int
+alpha_does_function_need_gp ()
+{
+ rtx insn;
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
- && regs_ever_live[i] && i != REG_RA)
- size++;
+ /* We never need a GP for Windows/NT or VMS. */
+ if (TARGET_WINDOWS_NT || TARGET_OPEN_VMS)
+ return 0;
- /* If some registers were saved but not reg 26, reg 26 must also
- be saved, so leave space for it. */
- if (size != 0 || alpha_ra_ever_killed ())
- size++;
+#ifdef TARGET_PROFILING_NEEDS_GP
+ if (profile_flag)
+ return 1;
+#endif
- /* Our size must be even (multiple of 16 bytes). */
- if (size & 1)
- size ++;
+#ifdef ASM_OUTPUT_MI_THUNK
+ if (current_function_is_thunk)
+ return 1;
+#endif
- return size * 8;
-}
+ /* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
+ Even if we are a static function, we still need to do this in case
+ our address is taken and passed to something like qsort. */
-#endif /* ! OPEN_VMS */
+ push_topmost_sequence ();
+ insn = get_insns ();
+ pop_topmost_sequence ();
-/* Return 1 if this function can directly return via $26. */
+ for (; insn; insn = NEXT_INSN (insn))
+ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
+ && GET_CODE (PATTERN (insn)) != USE
+ && GET_CODE (PATTERN (insn)) != CLOBBER)
+ {
+ enum attr_type type = get_attr_type (insn);
+ if (type == TYPE_LDSYM || type == TYPE_JSR)
+ return 1;
+ }
-int
-direct_return ()
-{
- return (! TARGET_OPEN_VMS && reload_completed && alpha_sa_size () == 0
- && get_frame_size () == 0
- && current_function_outgoing_args_size == 0
- && current_function_pretend_args_size == 0);
+ return 0;
}
/* Write a version stamp. Don't write anything if we are running as a
cross-compiler. Otherwise, use the versions in /usr/include/stamp.h. */
-#if !defined(CROSS_COMPILE) && !defined(_WIN32) && !defined(__linux__) && !defined(VMS)
+#ifdef HAVE_STAMP_H
#include <stamp.h>
#endif
@@ -2934,67 +3219,33 @@ alpha_write_verstamp (file)
#endif
}
-/* Write code to add constant C to register number IN_REG (possibly 31)
- and put the result into OUT_REG. Use TEMP_REG as a scratch register;
- usually this will be OUT_REG, but should not be if OUT_REG is
- STACK_POINTER_REGNUM, since it must be updated in a single instruction.
- Write the code to FILE. */
+/* Helper function to set RTX_FRAME_RELATED_P on instructions, including
+ sequences. */
-static void
-add_long_const (file, c, in_reg, out_reg, temp_reg)
- FILE *file;
- HOST_WIDE_INT c;
- int in_reg, out_reg, temp_reg;
+static rtx
+set_frame_related_p ()
{
- HOST_WIDE_INT low = (c & 0xffff) - 2 * (c & 0x8000);
- HOST_WIDE_INT tmp1 = c - low;
- HOST_WIDE_INT high = ((tmp1 >> 16) & 0xffff) - 2 * ((tmp1 >> 16) & 0x8000);
- HOST_WIDE_INT extra = 0;
-
- /* We don't have code to write out constants larger than 32 bits. */
-#if HOST_BITS_PER_LONG_INT == 64
- if ((unsigned HOST_WIDE_INT) c >> 32 != 0)
- abort ();
-#endif
-
- /* If HIGH will be interpreted as negative, we must adjust it to do two
- ldha insns. Note that we will never be building a negative constant
- here. */
-
- if (high & 0x8000)
- {
- extra = 0x4000;
- tmp1 -= 0x40000000;
- high = ((tmp1 >> 16) & 0xffff) - 2 * ((tmp1 >> 16) & 0x8000);
- }
+ rtx seq = gen_sequence ();
+ end_sequence ();
- if (low != 0)
+ if (GET_CODE (seq) == SEQUENCE)
{
- int result_reg = (extra == 0 && high == 0) ? out_reg : temp_reg;
-
- if (low >= 0 && low < 255)
- fprintf (file, "\taddq $%d,%d,$%d\n", in_reg, low, result_reg);
- else
- fprintf (file, "\tlda $%d,%d($%d)\n", result_reg, low, in_reg);
-
- in_reg = result_reg;
+ int i = XVECLEN (seq, 0);
+ while (--i >= 0)
+ RTX_FRAME_RELATED_P (XVECEXP (seq, 0, i)) = 1;
+ return emit_insn (seq);
}
-
- if (extra)
+ else
{
- int result_reg = (high == 0) ? out_reg : temp_reg;
-
- fprintf (file, "\tldah $%d,%d($%d)\n", result_reg, extra, in_reg);
- in_reg = result_reg;
+ seq = emit_insn (seq);
+ RTX_FRAME_RELATED_P (seq) = 1;
+ return seq;
}
-
- if (high)
- fprintf (file, "\tldah $%d,%d($%d)\n", out_reg, high, in_reg);
}
-/* Write function prologue. */
+#define FRP(exp) (start_sequence (), exp, set_frame_related_p ())
-#if OPEN_VMS
+/* Write function prologue. */
/* On vms we have two kinds of functions:
@@ -3008,13 +3259,13 @@ add_long_const (file, c, in_reg, out_reg, temp_reg)
proper pdsc (procedure descriptor)
This is done with the '.pdesc' command.
- size is the stack size needed for local variables. */
+ On not-vms, we don't really differentiate between the two, as we can
+ simply allocate stack without saving registers. */
void
-output_prolog (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+alpha_expand_prologue ()
{
+ /* Registers to save. */
unsigned long imask = 0;
unsigned long fmask = 0;
/* Stack space needed for pushing registers clobbered by us. */
@@ -3022,33 +3273,30 @@ output_prolog (file, size)
/* Complete stack size needed. */
HOST_WIDE_INT frame_size;
/* Offset from base reg to register save area. */
- int rsa_offset = 8;
- /* Offset during register save. */
- int reg_offset;
- /* Label for the procedure entry. */
- char *entry_label = (char *) alloca (strlen (alpha_function_name) + 6);
+ HOST_WIDE_INT reg_offset;
+ rtx sa_reg, mem;
int i;
sa_size = alpha_sa_size ();
- frame_size
- = ALPHA_ROUND (sa_size
- + (is_stack_procedure ? 8 : 0)
- + size + current_function_pretend_args_size);
-
- /* Issue function start and label. */
- fprintf (file, "\t.ent ");
- assemble_name (file, alpha_function_name);
- fprintf (file, "\n");
- sprintf (entry_label, "%s..en", alpha_function_name);
- ASM_OUTPUT_LABEL (file, entry_label);
- inside_function = TRUE;
- fprintf (file, "\t.base $%d\n", base_regno);
+ frame_size = get_frame_size ();
+ if (TARGET_OPEN_VMS)
+ frame_size = ALPHA_ROUND (sa_size
+ + (vms_is_stack_procedure ? 8 : 0)
+ + frame_size
+ + current_function_pretend_args_size);
+ else
+ frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
+ + sa_size
+ + ALPHA_ROUND (frame_size
+ + current_function_pretend_args_size));
- /* Calculate register masks for clobbered registers. */
+ if (TARGET_OPEN_VMS)
+ reg_offset = 8;
+ else
+ reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
- if (is_stack_procedure)
- alpha_sa_mask (&imask, &fmask);
+ alpha_sa_mask (&imask, &fmask);
/* Adjust the stack by the frame size. If the frame size is > 4096
bytes, we need to be sure we probe somewhere in the first and last
@@ -3059,28 +3307,30 @@ output_prolog (file, size)
Note that we are only allowed to adjust sp once in the prologue. */
- if (frame_size < 32768)
+ if (frame_size <= 32768)
{
if (frame_size > 4096)
{
int probed = 4096;
- fprintf (file, "\tstq $31,-%d($30)\n", probed);
-
- while (probed + 8192 < frame_size)
- fprintf (file, "\tstq $31,-%d($30)\n", probed += 8192);
+ do
+ emit_insn (gen_probe_stack (GEN_INT (-probed)));
+ while ((probed += 8192) < frame_size);
/* We only have to do this probe if we aren't saving registers. */
if (sa_size == 0 && probed + 4096 < frame_size)
- fprintf (file, "\tstq $31,-%d($30)\n", frame_size);
+ emit_insn (gen_probe_stack (GEN_INT (-frame_size)));
}
if (frame_size != 0)
- fprintf (file, "\tlda $30,-%d($30)\n", frame_size);
+ {
+ FRP (emit_move_insn (stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx, -frame_size)));
+ }
}
else
{
- /* Here we generate code to set R4 to SP + 4096 and set R23 to the
+ /* Here we generate code to set R22 to SP + 4096 and set R23 to the
number of 8192 byte blocks to probe. We then probe each block
in the loop and then set SP to the proper location. If the
amount remaining is > 4096, we have to do one more probe if we
@@ -3088,290 +3338,186 @@ output_prolog (file, size)
HOST_WIDE_INT blocks = (frame_size + 4096) / 8192;
HOST_WIDE_INT leftover = frame_size + 4096 - blocks * 8192;
+ rtx ptr = gen_rtx_REG (DImode, 22);
+ rtx count = gen_rtx_REG (DImode, 23);
- add_long_const (file, blocks, 31, 23, 23);
-
- fprintf (file, "\tlda $22,4096($30)\n");
-
- fputc ('$', file);
- assemble_name (file, alpha_function_name);
- fprintf (file, "..sc:\n");
+ emit_move_insn (count, GEN_INT (blocks));
+ emit_move_insn (ptr, plus_constant (stack_pointer_rtx, 4096));
- fprintf (file, "\tstq $31,-8192($22)\n");
- fprintf (file, "\tsubq $23,1,$23\n");
- fprintf (file, "\tlda $22,-8192($22)\n");
-
- fprintf (file, "\tbne $23,$");
- assemble_name (file, alpha_function_name);
- fprintf (file, "..sc\n");
+ /* Because of the difficulty in emitting a new basic block this
+ late in the compilation, generate the loop as a single insn. */
+ emit_insn (gen_prologue_stack_probe_loop (count, ptr));
if (leftover > 4096 && sa_size == 0)
- fprintf (file, "\tstq $31,-%d($22)\n", leftover);
+ {
+ rtx last = gen_rtx_MEM (DImode, plus_constant (ptr, -leftover));
+ MEM_VOLATILE_P (last) = 1;
+ emit_move_insn (last, const0_rtx);
+ }
- fprintf (file, "\tlda $30,-%d($22)\n", leftover);
+ ptr = emit_move_insn (stack_pointer_rtx, plus_constant (ptr, -leftover));
+
+ /* This alternative is special, because the DWARF code cannot possibly
+ intuit through the loop above. So we invent this note it looks at
+ instead. */
+ RTX_FRAME_RELATED_P (ptr) = 1;
+ REG_NOTES (ptr)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ GEN_INT (-frame_size))),
+ REG_NOTES (ptr));
}
- if (is_stack_procedure)
+ /* Cope with very large offsets to the register save area. */
+ sa_reg = stack_pointer_rtx;
+ if (reg_offset + sa_size > 0x8000)
{
- int reg_offset = rsa_offset;
-
- /* Store R26 (RA) first. */
- fprintf (file, "\tstq $26,%d($30)\n", reg_offset);
- reg_offset += 8;
-
- /* Store integer regs. according to mask. */
- for (i = 0; i < 32; i++)
- if (imask & (1L<<i))
- {
- fprintf (file, "\tstq $%d,%d($30)\n", i, reg_offset);
- reg_offset += 8;
- }
-
- /* Print the register mask and do floating-point saves. */
-
- if (imask)
- fprintf (file, "\t.mask 0x%x,0\n", imask);
-
- for (i = 0; i < 32; i++)
- {
- if (fmask & (1L << i))
- {
- fprintf (file, "\tstt $f%d,%d($30)\n", i, reg_offset);
- reg_offset += 8;
- }
- }
+ int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000;
+ HOST_WIDE_INT bias;
- /* Print the floating-point mask, if we've saved any fp register. */
- if (fmask)
- fprintf (file, "\t.fmask 0x%x,0\n", fmask);
+ if (low + sa_size <= 0x8000)
+ bias = reg_offset - low, reg_offset = low;
+ else
+ bias = reg_offset, reg_offset = 0;
- fprintf (file, "\tstq $27,0($30)\n");
+ sa_reg = gen_rtx_REG (DImode, 24);
+ FRP (emit_move_insn (sa_reg, plus_constant (stack_pointer_rtx, bias)));
}
- else
+
+ /* Save regs in stack order. Beginning with VMS PV. */
+ if (TARGET_OPEN_VMS && vms_is_stack_procedure)
{
- fprintf (file, "\t.fp_save $%d\n", save_fp_regno);
- fprintf (file, "\tbis $%d,$%d,$%d\n", HARD_FRAME_POINTER_REGNUM,
- HARD_FRAME_POINTER_REGNUM, save_fp_regno);
+ mem = gen_rtx_MEM (DImode, stack_pointer_rtx);
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (mem, gen_rtx_REG (DImode, REG_PV)));
}
- if (base_regno != REG_PV)
- fprintf (file, "\tbis $%d,$%d,$%d\n", REG_PV, REG_PV, base_regno);
-
- if (unwind_regno == HARD_FRAME_POINTER_REGNUM)
- fprintf (file, "\tbis $%d,$%d,$%d\n", STACK_POINTER_REGNUM,
- STACK_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM);
-
- /* Describe our frame. */
- fprintf (file, "\t.frame $%d,", unwind_regno);
-
- /* If the frame size is larger than an integer, print it as zero to
- avoid an assembler error. We won't be properly describing such a
- frame, but that's the best we can do. */
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
-#if HOST_BITS_PER_WIDE_INT == 64
- frame_size >= (1l << 31) ? 0:
-#endif
- frame_size
- );
- fprintf (file, ",$26,%d\n", rsa_offset);
-
- /* If we have to allocate space for outgoing args, do it now. */
- if (current_function_outgoing_args_size != 0)
- fprintf (file, "\tlda $%d,%d($%d)\n", STACK_POINTER_REGNUM,
- - ALPHA_ROUND (current_function_outgoing_args_size),
- HARD_FRAME_POINTER_REGNUM);
-
- fprintf (file, "\t.prologue\n");
-
- readonly_section ();
- fprintf (file, "\t.align 3\n");
- assemble_name (file, alpha_function_name); fputs ("..na:\n", file);
- fputs ("\t.ascii \"", file);
- assemble_name (file, alpha_function_name);
- fputs ("\\0\"\n", file);
-
- link_section ();
- fprintf (file, "\t.align 3\n");
- fputs ("\t.name ", file);
- assemble_name (file, alpha_function_name);
- fputs ("..na\n", file);
- ASM_OUTPUT_LABEL (file, alpha_function_name);
- fprintf (file, "\t.pdesc ");
- assemble_name (file, alpha_function_name);
- fprintf (file, "..en,%s\n", is_stack_procedure ? "stack" : "reg");
- alpha_need_linkage (alpha_function_name, 1);
- text_section ();
-
- return;
-}
-
-/* Write function epilogue. */
-
-void
-output_epilog (file, size)
- FILE *file;
- int size;
-{
- unsigned long imask = 0;
- unsigned long fmask = 0;
- /* Stack space needed for pushing registers clobbered by us. */
- HOST_WIDE_INT sa_size = alpha_sa_size ();
- /* Complete stack size needed. */
- HOST_WIDE_INT frame_size
- = ALPHA_ROUND (sa_size
- + (is_stack_procedure ? 8 : 0)
- + size + current_function_pretend_args_size);
- int i;
- rtx insn = get_last_insn ();
+ /* Save register RA next. */
+ if (imask & (1L << REG_RA))
+ {
+ mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (mem, gen_rtx_REG (DImode, REG_RA)));
+ imask &= ~(1L << REG_RA);
+ reg_offset += 8;
+ }
- /* If the last insn was a BARRIER, we don't have to write anything except
- the .end pseudo-op. */
+ /* Now save any other registers required to be saved. */
+ for (i = 0; i < 32; i++)
+ if (imask & (1L << i))
+ {
+ mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (mem, gen_rtx_REG (DImode, i)));
+ reg_offset += 8;
+ }
- if (GET_CODE (insn) == NOTE)
- insn = prev_nonnote_insn (insn);
+ for (i = 0; i < 32; i++)
+ if (fmask & (1L << i))
+ {
+ mem = gen_rtx_MEM (DFmode, plus_constant (sa_reg, reg_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (mem, gen_rtx_REG (DFmode, i+32)));
+ reg_offset += 8;
+ }
- if (insn == 0 || GET_CODE (insn) != BARRIER)
+ if (TARGET_OPEN_VMS)
{
- /* Restore clobbered registers, load FP last. */
-
- if (is_stack_procedure)
+ if (!vms_is_stack_procedure)
{
- int rsa_offset = 8;
- int reg_offset;
- int fp_offset;
-
- if (unwind_regno == HARD_FRAME_POINTER_REGNUM)
- fprintf (file, "\tbis $%d,$%d,$%d\n", HARD_FRAME_POINTER_REGNUM,
- HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM);
-
- alpha_sa_mask (&imask, &fmask);
-
- /* Start reloading registers after RA. */
- reg_offset = rsa_offset + 8;
-
- for (i = 0; i < 32; i++)
- if (imask & (1L<<i))
- {
- if (i == HARD_FRAME_POINTER_REGNUM)
- fp_offset = reg_offset;
- else
- fprintf (file, "\tldq $%d,%d($30)\n",
- i, reg_offset);
- reg_offset += 8;
- }
-
- for (i = 0; i < 32; i++)
- if (fmask & (1L << i))
- {
- fprintf (file, "\tldt $f%d,%d($30)\n", i, reg_offset);
- reg_offset += 8;
- }
+ /* Register frame procedures fave the fp. */
+ FRP (emit_move_insn (gen_rtx_REG (DImode, vms_save_fp_regno),
+ hard_frame_pointer_rtx));
+ }
- /* Restore R26 (RA). */
- fprintf (file, "\tldq $26,%d($30)\n", rsa_offset);
+ if (vms_base_regno != REG_PV)
+ FRP (emit_move_insn (gen_rtx_REG (DImode, vms_base_regno),
+ gen_rtx_REG (DImode, REG_PV)));
- /* Restore R29 (FP). */
- fprintf (file, "\tldq $29,%d($30)\n", fp_offset);
+ if (vms_unwind_regno == HARD_FRAME_POINTER_REGNUM)
+ {
+ FRP (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
}
- else
- fprintf (file, "\tbis $%d,$%d,$%d\n", save_fp_regno, save_fp_regno,
- HARD_FRAME_POINTER_REGNUM);
- if (frame_size != 0)
+ /* If we have to allocate space for outgoing args, do it now. */
+ if (current_function_outgoing_args_size != 0)
+ {
+ FRP (emit_move_insn (stack_pointer_rtx,
+ plus_constant (hard_frame_pointer_rtx,
+ - ALPHA_ROUND (current_function_outgoing_args_size))));
+ }
+ }
+ else
+ {
+ /* If we need a frame pointer, set it from the stack pointer. */
+ if (frame_pointer_needed)
{
- if (frame_size < 32768)
- fprintf (file, "\tlda $30,%d($30)\n", frame_size);
+ if (TARGET_CAN_FAULT_IN_PROLOGUE)
+ FRP (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
else
{
- long high = frame_size >> 16;
- long low = frame_size & 0xffff;
- if (low & 0x8000)
- {
- high++;
- low = -32768 + (low & 0x7fff);
- }
- fprintf (file, "\tldah $2,%ld($31)\n", high);
- fprintf (file, "\tlda $2,%ld($2)\n", low);
- fprintf (file, "\taddq $30,$2,$30\n");
+ /* This must always be the last instruction in the
+ prologue, thus we emit a special move + clobber. */
+ FRP (emit_insn (gen_init_fp (hard_frame_pointer_rtx,
+ stack_pointer_rtx, sa_reg)));
}
}
-
- /* Finally return to the caller. */
- fprintf (file, "\tret $31,($26),1\n");
}
- /* End the function. */
- fprintf (file, "\t.end ");
- assemble_name (file, alpha_function_name);
- fprintf (file, "\n");
- inside_function = FALSE;
+ /* The ABIs for VMS and OSF/1 say that while we can schedule insns into
+ the prologue, for exception handling reasons, we cannot do this for
+ any insn that might fault. We could prevent this for mems with a
+ (clobber:BLK (scratch)), but this doesn't work for fp insns. So we
+ have to prevent all such scheduling with a blockage.
- /* Show that we know this function if it is called again. */
- SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
-}
+ Linux, on the other hand, never bothered to implement OSF/1's
+ exception handling, and so doesn't care about such things. Anyone
+ planning to use dwarf2 frame-unwind info can also omit the blockage. */
-int
-vms_valid_decl_attribute_p (decl, attributes, identifier, args)
- tree decl;
- tree attributes;
- tree identifier;
- tree args;
-{
- if (is_attribute_p ("overlaid", identifier))
- return (args == NULL_TREE);
- return 0;
+ if (! TARGET_CAN_FAULT_IN_PROLOGUE)
+ emit_insn (gen_blockage ());
}
-#else /* !OPEN_VMS */
+/* Output the textual info surrounding the prologue. */
-static int
-alpha_does_function_need_gp ()
+void
+alpha_start_function (file, fnname, decl)
+ FILE *file;
+ char *fnname;
+ tree decl ATTRIBUTE_UNUSED;
{
- rtx insn;
-
- /* We never need a GP for Windows/NT. */
- if (TARGET_WINDOWS_NT)
- return 0;
-
-#ifdef TARGET_PROFILING_NEEDS_GP
- if (profile_flag)
- return 1;
-#endif
+ unsigned long imask = 0;
+ unsigned long fmask = 0;
+ /* Stack space needed for pushing registers clobbered by us. */
+ HOST_WIDE_INT sa_size;
+ /* Complete stack size needed. */
+ HOST_WIDE_INT frame_size;
+ /* Offset from base reg to register save area. */
+ HOST_WIDE_INT reg_offset;
+ char *entry_label = (char *) alloca (strlen (fnname) + 6);
+ int i;
- /* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
- Even if we are a static function, we still need to do this in case
- our address is taken and passed to something like qsort. */
+ sa_size = alpha_sa_size ();
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && GET_CODE (PATTERN (insn)) != USE
- && GET_CODE (PATTERN (insn)) != CLOBBER)
- {
- enum attr_type type = get_attr_type (insn);
- if (type == TYPE_LDSYM || type == TYPE_JSR)
- return 1;
- }
+ frame_size = get_frame_size ();
+ if (TARGET_OPEN_VMS)
+ frame_size = ALPHA_ROUND (sa_size
+ + (vms_is_stack_procedure ? 8 : 0)
+ + frame_size
+ + current_function_pretend_args_size);
+ else
+ frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
+ + sa_size
+ + ALPHA_ROUND (frame_size
+ + current_function_pretend_args_size));
- return 0;
-}
+ if (TARGET_OPEN_VMS)
+ reg_offset = 8;
+ else
+ reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
-void
-output_prolog (file, size)
- FILE *file;
- HOST_WIDE_INT size;
-{
- HOST_WIDE_INT out_args_size
- = ALPHA_ROUND (current_function_outgoing_args_size);
- HOST_WIDE_INT sa_size = alpha_sa_size ();
- HOST_WIDE_INT frame_size
- = (out_args_size + sa_size
- + ALPHA_ROUND (size + current_function_pretend_args_size));
- HOST_WIDE_INT reg_offset = out_args_size;
- HOST_WIDE_INT start_reg_offset = reg_offset;
- HOST_WIDE_INT actual_start_reg_offset = start_reg_offset;
- int int_reg_save_area_size = 0;
- unsigned reg_mask = 0;
- int i, sa_reg;
+ alpha_sa_mask (&imask, &fmask);
/* Ecoff can handle multiple .file directives, so put out file and lineno.
We have to do that before the .ent directive as we cannot switch
@@ -3390,314 +3536,353 @@ output_prolog (file, size)
DECL_SOURCE_LINE (current_function_decl));
}
- /* The assembly language programmer's guide states that the second argument
- to the .ent directive, the lex_level, is ignored by the assembler,
- so we might as well omit it. */
-
- if (!flag_inhibit_size_directive)
+ /* Issue function start and label. */
+ if (TARGET_OPEN_VMS || !flag_inhibit_size_directive)
{
- fprintf (file, "\t.ent ");
- assemble_name (file, alpha_function_name);
- fprintf (file, "\n");
+ fputs ("\t.ent ", file);
+ assemble_name (file, fnname);
+ putc ('\n', file);
}
- ASM_OUTPUT_LABEL (file, alpha_function_name);
- inside_function = TRUE;
-
- if (TARGET_IEEE_CONFORMANT && !flag_inhibit_size_directive)
- /* Set flags in procedure descriptor to request IEEE-conformant
- math-library routines. The value we set it to is PDSC_EXC_IEEE
- (/usr/include/pdsc.h). */
- fprintf (file, "\t.eflag 48\n");
- /* Set up offsets to alpha virtual arg/local debugging pointer. */
-
- alpha_auto_offset = -frame_size + current_function_pretend_args_size;
- alpha_arg_offset = -frame_size + 48;
+ strcpy (entry_label, fnname);
+ if (TARGET_OPEN_VMS)
+ strcat (entry_label, "..en");
+ ASM_OUTPUT_LABEL (file, entry_label);
+ inside_function = TRUE;
- alpha_function_needs_gp = alpha_does_function_need_gp ();
+ if (TARGET_OPEN_VMS)
+ fprintf (file, "\t.base $%d\n", vms_base_regno);
- if (TARGET_WINDOWS_NT == 0)
+ if (!TARGET_OPEN_VMS && TARGET_IEEE_CONFORMANT
+ && !flag_inhibit_size_directive)
{
- if (alpha_function_needs_gp)
- fprintf (file, "\tldgp $29,0($27)\n");
-
- /* Put a label after the GP load so we can enter the function at it. */
- fputc ('$', file);
- assemble_name (file, alpha_function_name);
- fprintf (file, "..ng:\n");
+ /* Set flags in procedure descriptor to request IEEE-conformant
+ math-library routines. The value we set it to is PDSC_EXC_IEEE
+ (/usr/include/pdsc.h). */
+ fputs ("\t.eflag 48\n", file);
}
- /* Adjust the stack by the frame size. If the frame size is > 4096
- bytes, we need to be sure we probe somewhere in the first and last
- 4096 bytes (we can probably get away without the latter test) and
- every 8192 bytes in between. If the frame size is > 32768, we
- do this in a loop. Otherwise, we generate the explicit probe
- instructions.
-
- Note that we are only allowed to adjust sp once in the prologue. */
-
- if (frame_size < 32768)
- {
- if (frame_size > 4096)
- {
- int probed = 4096;
-
- fprintf (file, "\tstq $31,-%d($30)\n", probed);
-
- while (probed + 8192 < frame_size)
- fprintf (file, "\tstq $31,-%d($30)\n", probed += 8192);
-
- /* We only have to do this probe if we aren't saving registers. */
- if (sa_size == 0 && probed + 4096 < frame_size)
- fprintf (file, "\tstq $31,-%d($30)\n", frame_size);
- }
+ /* Set up offsets to alpha virtual arg/local debugging pointer. */
+ alpha_auto_offset = -frame_size + current_function_pretend_args_size;
+ alpha_arg_offset = -frame_size + 48;
- if (frame_size != 0)
- fprintf (file, "\tlda $30,-%d($30)\n", frame_size);
- }
- else
+ /* Describe our frame. If the frame size is larger than an integer,
+ print it as zero to avoid an assembler error. We won't be
+ properly describing such a frame, but that's the best we can do. */
+ if (TARGET_OPEN_VMS)
{
- /* Here we generate code to set R4 to SP + 4096 and set R5 to the
- number of 8192 byte blocks to probe. We then probe each block
- in the loop and then set SP to the proper location. If the
- amount remaining is > 4096, we have to do one more probe if we
- are not saving any registers. */
-
- HOST_WIDE_INT blocks = (frame_size + 4096) / 8192;
- HOST_WIDE_INT leftover = frame_size + 4096 - blocks * 8192;
-
- add_long_const (file, blocks, 31, 5, 5);
-
- fprintf (file, "\tlda $4,4096($30)\n");
-
- fputc ('$', file);
- assemble_name (file, alpha_function_name);
- fprintf (file, "..sc:\n");
-
- fprintf (file, "\tstq $31,-8192($4)\n");
- fprintf (file, "\tsubq $5,1,$5\n");
- fprintf (file, "\tlda $4,-8192($4)\n");
-
- fprintf (file, "\tbne $5,$");
- assemble_name (file, alpha_function_name);
- fprintf (file, "..sc\n");
-
- if (leftover > 4096 && sa_size == 0)
- fprintf (file, "\tstq $31,-%d($4)\n", leftover);
-
- fprintf (file, "\tlda $30,-%d($4)\n", leftover);
+ fprintf (file, "\t.frame $%d,", vms_unwind_regno);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ frame_size >= (1l << 31) ? 0 : frame_size);
+ fputs (",$26,", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, reg_offset);
+ fputs ("\n", file);
}
-
- /* Describe our frame. */
- if (!flag_inhibit_size_directive)
+ else if (!flag_inhibit_size_directive)
{
fprintf (file, "\t.frame $%d,",
(frame_pointer_needed
- ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM));
-
- /* If the frame size is larger than an integer, print it as zero to
- avoid an assembler error. We won't be properly describing such a
- frame, but that's the best we can do. */
+ ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM));
fprintf (file, HOST_WIDE_INT_PRINT_DEC,
-#if HOST_BITS_PER_WIDE_INT == 64
- frame_size >= (1l << 31) ? 0 :
-#endif
- frame_size
- );
+ frame_size >= (1l << 31) ? 0 : frame_size);
fprintf (file, ",$26,%d\n", current_function_pretend_args_size);
}
- /* Cope with very large offsets to the register save area. */
- sa_reg = 30;
- if (reg_offset + sa_size > 0x8000)
+ /* Describe which registers were spilled. */
+ if (TARGET_OPEN_VMS)
{
- int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000;
- if (low + sa_size <= 0x8000)
+ if (imask)
+ /* ??? Does VMS care if mask contains ra? The old code did'nt
+ set it, so I don't here. */
+ fprintf (file, "\t.mask 0x%lx,0\n", imask & ~(1L << REG_RA));
+ if (fmask)
+ fprintf (file, "\t.fmask 0x%lx,0\n", fmask);
+ if (!vms_is_stack_procedure)
+ fprintf (file, "\t.fp_save $%d\n", vms_save_fp_regno);
+ }
+ else if (!flag_inhibit_size_directive)
+ {
+ if (imask)
{
- add_long_const (file, reg_offset - low, 30, 24, 24);
- reg_offset = low;
+ fprintf (file, "\t.mask 0x%lx,", imask);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ frame_size >= (1l << 31) ? 0 : reg_offset - frame_size);
+ putc ('\n', file);
+
+ for (i = 0; i < 32; ++i)
+ if (imask & (1L << i))
+ reg_offset += 8;
}
- else
+
+ if (fmask)
{
- add_long_const (file, reg_offset, 30, 24, 24);
- reg_offset = 0;
+ fprintf (file, "\t.fmask 0x%lx,", fmask);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ frame_size >= (1l << 31) ? 0 : reg_offset - frame_size);
+ putc ('\n', file);
}
- sa_reg = 24;
}
-
- /* Save register RA if any other register needs to be saved. */
- if (sa_size != 0)
- {
- reg_mask |= 1 << REG_RA;
- fprintf (file, "\tstq $26,%d($%d)\n", reg_offset, sa_reg);
- reg_offset += 8;
- int_reg_save_area_size += 8;
- }
-
- /* Now save any other used integer registers required to be saved. */
- for (i = 0; i < 32; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
- && regs_ever_live[i] && i != REG_RA)
- {
- reg_mask |= 1 << i;
- fprintf (file, "\tstq $%d,%d($%d)\n", i, reg_offset, sa_reg);
- reg_offset += 8;
- int_reg_save_area_size += 8;
- }
- /* Print the register mask and do floating-point saves. */
- if (reg_mask && !flag_inhibit_size_directive)
+ /* Emit GP related things. It is rather unfortunate about the alignment
+ issues surrounding a CODE_LABEL that forces us to do the label in
+ plain text. */
+ if (!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT)
{
- fprintf (file, "\t.mask 0x%x,", reg_mask);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
-#if HOST_BITS_PER_WIDE_INT == 64
- frame_size >= (1l << 31) ? 0 :
-#endif
- actual_start_reg_offset - frame_size);
- fprintf (file, "\n");
- }
-
- start_reg_offset = reg_offset;
- reg_mask = 0;
+ alpha_function_needs_gp = alpha_does_function_need_gp ();
+ if (alpha_function_needs_gp)
+ fputs ("\tldgp $29,0($27)\n", file);
- for (i = 0; i < 32; i++)
- if (! fixed_regs[i + 32] && ! call_used_regs[i + 32]
- && regs_ever_live[i + 32])
- {
- reg_mask |= 1 << i;
- fprintf (file, "\tstt $f%d,%d($%d)\n", i, reg_offset, sa_reg);
- reg_offset += 8;
- }
+ putc ('$', file);
+ assemble_name (file, fnname);
+ fputs ("..ng:\n", file);
+ }
- /* Print the floating-point mask, if we've saved any fp register. */
- if (reg_mask && !flag_inhibit_size_directive)
- fprintf (file, "\t.fmask 0x%x,%d\n", reg_mask,
- actual_start_reg_offset - frame_size + int_reg_save_area_size);
+#ifdef OPEN_VMS
+ /* Ifdef'ed cause readonly_section and link_section are only
+ available then. */
+ readonly_section ();
+ fprintf (file, "\t.align 3\n");
+ assemble_name (file, fnname); fputs ("..na:\n", file);
+ fputs ("\t.ascii \"", file);
+ assemble_name (file, fnname);
+ fputs ("\\0\"\n", file);
+
+ link_section ();
+ fprintf (file, "\t.align 3\n");
+ fputs ("\t.name ", file);
+ assemble_name (file, fnname);
+ fputs ("..na\n", file);
+ ASM_OUTPUT_LABEL (file, fnname);
+ fprintf (file, "\t.pdesc ");
+ assemble_name (file, fnname);
+ fprintf (file, "..en,%s\n", vms_is_stack_procedure ? "stack" : "reg");
+ alpha_need_linkage (fnname, 1);
+ text_section ();
+#endif
+}
- /* If we need a frame pointer, set it from the stack pointer. Note that
- this must always be the last instruction in the prologue. */
- if (frame_pointer_needed)
- fprintf (file, "\tbis $30,$30,$15\n");
+/* Emit the .prologue note at the scheduled end of the prologue. */
- /* End the prologue and say if we used gp. */
- if (!flag_inhibit_size_directive)
+void
+output_end_prologue (file)
+ FILE *file;
+{
+ if (TARGET_OPEN_VMS)
+ fputs ("\t.prologue\n", file);
+ else if (TARGET_WINDOWS_NT)
+ fputs ("\t.prologue 0\n", file);
+ else if (!flag_inhibit_size_directive)
fprintf (file, "\t.prologue %d\n", alpha_function_needs_gp);
}
/* Write function epilogue. */
+/* ??? At some point we will want to support full unwind, and so will
+ need to mark the epilogue as well. At the moment, we just confuse
+ dwarf2out. */
+#undef FRP
+#define FRP(exp) exp
+
void
-output_epilog (file, size)
- FILE *file;
- int size;
+alpha_expand_epilogue ()
{
- rtx insn = get_last_insn ();
- HOST_WIDE_INT out_args_size
- = ALPHA_ROUND (current_function_outgoing_args_size);
- HOST_WIDE_INT sa_size = alpha_sa_size ();
- HOST_WIDE_INT frame_size
- = (out_args_size + sa_size
- + ALPHA_ROUND (size + current_function_pretend_args_size));
- HOST_WIDE_INT reg_offset = out_args_size;
- int restore_fp
- = frame_pointer_needed && regs_ever_live[HARD_FRAME_POINTER_REGNUM];
+ /* Registers to save. */
+ unsigned long imask = 0;
+ unsigned long fmask = 0;
+ /* Stack space needed for pushing registers clobbered by us. */
+ HOST_WIDE_INT sa_size;
+ /* Complete stack size needed. */
+ HOST_WIDE_INT frame_size;
+ /* Offset from base reg to register save area. */
+ HOST_WIDE_INT reg_offset;
+ int fp_is_frame_pointer, fp_offset;
+ rtx sa_reg, sa_reg_exp = NULL;
+ rtx sp_adj1, sp_adj2, mem;
int i;
- /* If the last insn was a BARRIER, we don't have to write anything except
- the .end pseudo-op. */
- if (GET_CODE (insn) == NOTE)
- insn = prev_nonnote_insn (insn);
- if (insn == 0 || GET_CODE (insn) != BARRIER)
- {
- int fp_offset = 0;
- int sa_reg;
+ sa_size = alpha_sa_size ();
+
+ frame_size = get_frame_size ();
+ if (TARGET_OPEN_VMS)
+ frame_size = ALPHA_ROUND (sa_size
+ + (vms_is_stack_procedure ? 8 : 0)
+ + frame_size
+ + current_function_pretend_args_size);
+ else
+ frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
+ + sa_size
+ + ALPHA_ROUND (frame_size
+ + current_function_pretend_args_size));
+
+ if (TARGET_OPEN_VMS)
+ reg_offset = 8;
+ else
+ reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
+
+ alpha_sa_mask (&imask, &fmask);
+
+ fp_is_frame_pointer = ((TARGET_OPEN_VMS && vms_is_stack_procedure)
+ || (!TARGET_OPEN_VMS && frame_pointer_needed));
+ if (sa_size)
+ {
/* If we have a frame pointer, restore SP from it. */
- if (frame_pointer_needed)
- fprintf (file, "\tbis $15,$15,$30\n");
+ if ((TARGET_OPEN_VMS
+ && vms_unwind_regno == HARD_FRAME_POINTER_REGNUM)
+ || (!TARGET_OPEN_VMS && frame_pointer_needed))
+ {
+ FRP (emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx));
+ }
- /* Cope with large offsets to the register save area. */
- sa_reg = 30;
+ /* Cope with very large offsets to the register save area. */
+ sa_reg = stack_pointer_rtx;
if (reg_offset + sa_size > 0x8000)
{
- int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000;
- if (low + sa_size <= 0x8000)
- {
- add_long_const (file, reg_offset - low, 30, 24, 24);
- reg_offset = low;
- }
- else
- {
- add_long_const (file, reg_offset, 30, 24, 24);
- reg_offset = 0;
- }
- sa_reg = 24;
+ int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000;
+ HOST_WIDE_INT bias;
+
+ if (low + sa_size <= 0x8000)
+ bias = reg_offset - low, reg_offset = low;
+ else
+ bias = reg_offset, reg_offset = 0;
+
+ sa_reg = gen_rtx_REG (DImode, 22);
+ sa_reg_exp = plus_constant (stack_pointer_rtx, bias);
+
+ FRP (emit_move_insn (sa_reg, sa_reg_exp));
}
+
+ /* Restore registers in order, excepting a true frame pointer. */
- /* Restore all the registers, starting with the return address
- register. */
- if (sa_size != 0)
+ if (! alpha_eh_epilogue_sp_ofs)
{
- fprintf (file, "\tldq $26,%d($%d)\n", reg_offset, sa_reg);
- reg_offset += 8;
+ mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, reg_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (gen_rtx_REG (DImode, REG_RA), mem));
}
+ reg_offset += 8;
+ imask &= ~(1L << REG_RA);
- /* Now restore any other used integer registers that we saved,
- except for FP if it is being used as FP, since it must be
- restored last. */
-
- for (i = 0; i < 32; i++)
- if (! fixed_regs[i] && ! call_used_regs[i] && regs_ever_live[i]
- && i != 26)
+ for (i = 0; i < 32; ++i)
+ if (imask & (1L << i))
{
- if (i == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)
+ if (i == HARD_FRAME_POINTER_REGNUM && fp_is_frame_pointer)
fp_offset = reg_offset;
else
- fprintf (file, "\tldq $%d,%d($%d)\n", i, reg_offset, sa_reg);
+ {
+ mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, reg_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (gen_rtx_REG (DImode, i), mem));
+ }
reg_offset += 8;
}
- for (i = 0; i < 32; i++)
- if (! fixed_regs[i + 32] && ! call_used_regs[i + 32]
- && regs_ever_live[i + 32])
+ for (i = 0; i < 32; ++i)
+ if (fmask & (1L << i))
{
- fprintf (file, "\tldt $f%d,%d($%d)\n", i, reg_offset, sa_reg);
+ mem = gen_rtx_MEM (DFmode, plus_constant(sa_reg, reg_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (gen_rtx_REG (DFmode, i+32), mem));
reg_offset += 8;
}
+ }
+
+ if (frame_size || alpha_eh_epilogue_sp_ofs)
+ {
+ sp_adj1 = stack_pointer_rtx;
+
+ if (alpha_eh_epilogue_sp_ofs)
+ {
+ sp_adj1 = gen_rtx_REG (DImode, 23);
+ emit_move_insn (sp_adj1,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ alpha_eh_epilogue_sp_ofs));
+ }
- /* If the stack size is large and we have a frame pointer, compute the
- size of the stack into a register because the old FP restore, stack
- pointer adjust, and return are required to be consecutive
- instructions. */
- if (frame_size > 32767 && restore_fp)
- add_long_const (file, frame_size, 31, 1, 1);
-
- /* If we needed a frame pointer and we have to restore it, do it
- now. This must be done in one instruction immediately
- before the SP update. */
- if (restore_fp && fp_offset)
- fprintf (file, "\tldq $15,%d($%d)\n", fp_offset, sa_reg);
-
- /* Now update the stack pointer, if needed. Only one instruction must
- modify the stack pointer. It must be the last instruction in the
- sequence and must be an ADDQ or LDA instruction. If the frame
- pointer was loaded above, we may only put one instruction here. */
-
- if (frame_size > 32768 && restore_fp)
- fprintf (file, "\taddq $1,$30,$30\n");
+ /* If the stack size is large, begin computation into a temporary
+ register so as not to interfere with a potential fp restore,
+ which must be consecutive with an SP restore. */
+ if (frame_size < 32768)
+ sp_adj2 = GEN_INT (frame_size);
+ else if (frame_size < 0x40007fffL)
+ {
+ int low = ((frame_size & 0xffff) ^ 0x8000) - 0x8000;
+
+ sp_adj2 = plus_constant (sp_adj1, frame_size - low);
+ if (sa_reg_exp && rtx_equal_p (sa_reg_exp, sp_adj2))
+ sp_adj1 = sa_reg;
+ else
+ {
+ sp_adj1 = gen_rtx_REG (DImode, 23);
+ FRP (emit_move_insn (sp_adj1, sp_adj2));
+ }
+ sp_adj2 = GEN_INT (low);
+ }
else
- add_long_const (file, frame_size, 30, 30, 1);
+ {
+ rtx tmp = gen_rtx_REG (DImode, 23);
+ FRP (sp_adj2 = alpha_emit_set_const (tmp, DImode, frame_size, 3));
+ if (!sp_adj2)
+ {
+ /* We can't drop new things to memory this late, afaik,
+ so build it up by pieces. */
+ FRP (sp_adj2 = alpha_emit_set_long_const (tmp, frame_size,
+ -(frame_size < 0)));
+ if (!sp_adj2)
+ abort ();
+ }
+ }
+
+ /* From now on, things must be in order. So emit blockages. */
+
+ /* Restore the frame pointer. */
+ if (fp_is_frame_pointer)
+ {
+ emit_insn (gen_blockage ());
+ mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, fp_offset));
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (hard_frame_pointer_rtx, mem));
+ }
+ else if (TARGET_OPEN_VMS)
+ {
+ emit_insn (gen_blockage ());
+ FRP (emit_move_insn (hard_frame_pointer_rtx,
+ gen_rtx_REG (DImode, vms_save_fp_regno)));
+ }
- /* Finally return to the caller. */
- fprintf (file, "\tret $31,($26),1\n");
+ /* Restore the stack pointer. */
+ emit_insn (gen_blockage ());
+ FRP (emit_move_insn (stack_pointer_rtx,
+ gen_rtx_PLUS (DImode, sp_adj1, sp_adj2)));
+ }
+ else
+ {
+ if (TARGET_OPEN_VMS && !vms_is_stack_procedure)
+ {
+ emit_insn (gen_blockage ());
+ FRP (emit_move_insn (hard_frame_pointer_rtx,
+ gen_rtx_REG (DImode, vms_save_fp_regno)));
+ }
}
+ /* Return. */
+ emit_jump_insn (gen_return_internal ());
+}
+
+/* Output the rest of the textual info surrounding the epilogue. */
+
+void
+alpha_end_function (file, fnname, decl)
+ FILE *file;
+ char *fnname;
+ tree decl ATTRIBUTE_UNUSED;
+{
/* End the function. */
if (!flag_inhibit_size_directive)
{
- fprintf (file, "\t.end ");
- assemble_name (file, alpha_function_name);
- fprintf (file, "\n");
+ fputs ("\t.end ", file);
+ assemble_name (file, fnname);
+ putc ('\n', file);
}
inside_function = FALSE;
@@ -3711,7 +3896,6 @@ output_epilog (file, size)
if (!flag_pic || !TREE_PUBLIC (current_function_decl))
SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
}
-#endif /* !OPEN_VMS */
/* Debugging support. */
@@ -3815,6 +3999,9 @@ struct shadow_summary
} used, defd;
};
+static void summarize_insn PROTO((rtx, struct shadow_summary *, int));
+static void alpha_handle_trap_shadows PROTO((rtx));
+
/* Summary the effects of expression X on the machine. Update SUM, a pointer
to the summary structure. SET is nonzero if the insn is setting the
object, otherwise zero. */
@@ -3859,8 +4046,8 @@ summarize_insn (x, sum, set)
break;
case SUBREG:
- x = SUBREG_REG (x);
- /* FALLTHRU */
+ summarize_insn (SUBREG_REG (x), sum, 0);
+ break;
case REG:
{
@@ -3933,38 +4120,45 @@ summarize_insn (x, sum, set)
summarize_insn (XVECEXP (x, i, j), sum, 0);
break;
+ case 'i':
+ break;
+
default:
abort ();
}
}
}
-/* Ensure a sufficient number of `trapb' insns are in the code when the user
- requests code with a trap precision of functions or instructions.
-
- In naive mode, when the user requests a trap-precision of "instruction", a
- trapb is needed after every instruction that may generate a trap (and after
- jsr/bsr instructions, because called functions may import a trap from the
- caller). This ensures that the code is resumption safe but it is also slow.
-
- When optimizations are turned on, we delay issuing a trapb as long as
- possible. In this context, a trap shadow is the sequence of instructions
- that starts with a (potentially) trap generating instruction and extends to
- the next trapb or call_pal instruction (but GCC never generates call_pal by
- itself). We can delay (and therefore sometimes omit) a trapb subject to the
- following conditions:
-
- (a) On entry to the trap shadow, if any Alpha register or memory location
- contains a value that is used as an operand value by some instruction in
- the trap shadow (live on entry), then no instruction in the trap shadow
- may modify the register or memory location.
-
- (b) Within the trap shadow, the computation of the base register for a
- memory load or store instruction may not involve using the result
- of an instruction that might generate an UNPREDICTABLE result.
-
- (c) Within the trap shadow, no register may be used more than once as a
- destination register. (This is to make life easier for the trap-handler.)
+/* Ensure a sufficient number of `trapb' insns are in the code when
+ the user requests code with a trap precision of functions or
+ instructions.
+
+ In naive mode, when the user requests a trap-precision of
+ "instruction", a trapb is needed after every instruction that may
+ generate a trap. This ensures that the code is resumption safe but
+ it is also slow.
+
+ When optimizations are turned on, we delay issuing a trapb as long
+ as possible. In this context, a trap shadow is the sequence of
+ instructions that starts with a (potentially) trap generating
+ instruction and extends to the next trapb or call_pal instruction
+ (but GCC never generates call_pal by itself). We can delay (and
+ therefore sometimes omit) a trapb subject to the following
+ conditions:
+
+ (a) On entry to the trap shadow, if any Alpha register or memory
+ location contains a value that is used as an operand value by some
+ instruction in the trap shadow (live on entry), then no instruction
+ in the trap shadow may modify the register or memory location.
+
+ (b) Within the trap shadow, the computation of the base register
+ for a memory load or store instruction may not involve using the
+ result of an instruction that might generate an UNPREDICTABLE
+ result.
+
+ (c) Within the trap shadow, no register may be used more than once
+ as a destination register. (This is to make life easier for the
+ trap-handler.)
(d) The trap shadow may not include any branch instructions. */
@@ -3974,10 +4168,7 @@ alpha_handle_trap_shadows (insns)
{
struct shadow_summary shadow;
int trap_pending, exception_nesting;
- rtx i;
-
- if (alpha_tp == ALPHA_TP_PROG && !flag_exceptions)
- return;
+ rtx i, n;
trap_pending = 0;
exception_nesting = 0;
@@ -4080,7 +4271,9 @@ alpha_handle_trap_shadows (insns)
else
{
close_shadow:
- emit_insn_before (gen_trapb (), i);
+ n = emit_insn_before (gen_trapb (), i);
+ PUT_MODE (n, TImode);
+ PUT_MODE (i, TImode);
trap_pending = 0;
shadow.used.i = 0;
shadow.used.fp = 0;
@@ -4102,20 +4295,578 @@ alpha_handle_trap_shadows (insns)
}
}
}
+
+#ifdef HAIFA
+/* Alpha can only issue instruction groups simultaneously if they are
+ suitibly aligned. This is very processor-specific. */
+
+enum alphaev4_pipe {
+ EV4_STOP = 0,
+ EV4_IB0 = 1,
+ EV4_IB1 = 2,
+ EV4_IBX = 4
+};
+
+enum alphaev5_pipe {
+ EV5_STOP = 0,
+ EV5_NONE = 1,
+ EV5_E01 = 2,
+ EV5_E0 = 4,
+ EV5_E1 = 8,
+ EV5_FAM = 16,
+ EV5_FA = 32,
+ EV5_FM = 64
+};
+
+static enum alphaev4_pipe alphaev4_insn_pipe PROTO((rtx));
+static enum alphaev5_pipe alphaev5_insn_pipe PROTO((rtx));
+static rtx alphaev4_next_group PROTO((rtx, int*, int*));
+static rtx alphaev5_next_group PROTO((rtx, int*, int*));
+static rtx alphaev4_next_nop PROTO((int*));
+static rtx alphaev5_next_nop PROTO((int*));
+
+static void alpha_align_insns
+ PROTO((rtx, int, rtx (*)(rtx, int*, int*), rtx (*)(int*), int));
+
+static enum alphaev4_pipe
+alphaev4_insn_pipe (insn)
+ rtx insn;
+{
+ if (recog_memoized (insn) < 0)
+ return EV4_STOP;
+ if (get_attr_length (insn) != 4)
+ return EV4_STOP;
+
+ switch (get_attr_type (insn))
+ {
+ case TYPE_ILD:
+ case TYPE_FLD:
+ return EV4_IBX;
+
+ case TYPE_LDSYM:
+ case TYPE_IADD:
+ case TYPE_ILOG:
+ case TYPE_ICMOV:
+ case TYPE_ICMP:
+ case TYPE_IST:
+ case TYPE_FST:
+ case TYPE_SHIFT:
+ case TYPE_IMUL:
+ case TYPE_FBR:
+ return EV4_IB0;
+
+ case TYPE_MISC:
+ case TYPE_IBR:
+ case TYPE_JSR:
+ case TYPE_FCPYS:
+ case TYPE_FCMOV:
+ case TYPE_FADD:
+ case TYPE_FDIV:
+ case TYPE_FMUL:
+ return EV4_IB1;
+
+ default:
+ abort();
+ }
+}
+
+static enum alphaev5_pipe
+alphaev5_insn_pipe (insn)
+ rtx insn;
+{
+ if (recog_memoized (insn) < 0)
+ return EV5_STOP;
+ if (get_attr_length (insn) != 4)
+ return EV5_STOP;
+
+ switch (get_attr_type (insn))
+ {
+ case TYPE_ILD:
+ case TYPE_FLD:
+ case TYPE_LDSYM:
+ case TYPE_IADD:
+ case TYPE_ILOG:
+ case TYPE_ICMOV:
+ case TYPE_ICMP:
+ return EV5_E01;
+
+ case TYPE_IST:
+ case TYPE_FST:
+ case TYPE_SHIFT:
+ case TYPE_IMUL:
+ case TYPE_MISC:
+ case TYPE_MVI:
+ return EV5_E0;
+
+ case TYPE_IBR:
+ case TYPE_JSR:
+ return EV5_E1;
+
+ case TYPE_FCPYS:
+ return EV5_FAM;
+
+ case TYPE_FBR:
+ case TYPE_FCMOV:
+ case TYPE_FADD:
+ case TYPE_FDIV:
+ return EV5_FA;
+
+ case TYPE_FMUL:
+ return EV5_FM;
+
+ default:
+ abort();
+ }
+}
+
+/* IN_USE is a mask of the slots currently filled within the insn group.
+ The mask bits come from alphaev4_pipe above. If EV4_IBX is set, then
+ the insn in EV4_IB0 can be swapped by the hardware into EV4_IB1.
+
+ LEN is, of course, the length of the group in bytes. */
+
+static rtx
+alphaev4_next_group (insn, pin_use, plen)
+ rtx insn;
+ int *pin_use, *plen;
+{
+ int len, in_use;
+
+ len = in_use = 0;
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i'
+ || GET_CODE (PATTERN (insn)) == CLOBBER
+ || GET_CODE (PATTERN (insn)) == USE)
+ goto next_and_done;
+
+ while (1)
+ {
+ enum alphaev4_pipe pipe;
+
+ pipe = alphaev4_insn_pipe (insn);
+ switch (pipe)
+ {
+ case EV4_STOP:
+ /* Force complex instructions to start new groups. */
+ if (in_use)
+ goto done;
+
+ /* If this is a completely unrecognized insn, its an asm.
+ We don't know how long it is, so record length as -1 to
+ signal a needed realignment. */
+ if (recog_memoized (insn) < 0)
+ len = -1;
+ else
+ len = get_attr_length (insn);
+ goto next_and_done;
+
+ case EV4_IBX:
+ if (in_use & EV4_IB0)
+ {
+ if (in_use & EV4_IB1)
+ goto done;
+ in_use |= EV4_IB1;
+ }
+ else
+ in_use |= EV4_IB0 | EV4_IBX;
+ break;
+
+ case EV4_IB0:
+ if (in_use & EV4_IB0)
+ {
+ if (!(in_use & EV4_IBX) || (in_use & EV4_IB1))
+ goto done;
+ in_use |= EV4_IB1;
+ }
+ in_use |= EV4_IB0;
+ break;
+
+ case EV4_IB1:
+ if (in_use & EV4_IB1)
+ goto done;
+ in_use |= EV4_IB1;
+ break;
+
+ default:
+ abort();
+ }
+ len += 4;
+
+ /* Haifa doesn't do well scheduling branches. */
+ if (GET_CODE (insn) == JUMP_INSN)
+ goto next_and_done;
+
+ next:
+ insn = next_nonnote_insn (insn);
+
+ if (!insn || GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ goto done;
+
+ /* Let Haifa tell us where it thinks insn group boundaries are. */
+ if (GET_MODE (insn) == TImode)
+ goto done;
+
+ if (GET_CODE (insn) == CLOBBER || GET_CODE (insn) == USE)
+ goto next;
+ }
+
+ next_and_done:
+ insn = next_nonnote_insn (insn);
+
+ done:
+ *plen = len;
+ *pin_use = in_use;
+ return insn;
+}
+
+/* IN_USE is a mask of the slots currently filled within the insn group.
+ The mask bits come from alphaev5_pipe above. If EV5_E01 is set, then
+ the insn in EV5_E0 can be swapped by the hardware into EV5_E1.
+
+ LEN is, of course, the length of the group in bytes. */
+
+static rtx
+alphaev5_next_group (insn, pin_use, plen)
+ rtx insn;
+ int *pin_use, *plen;
+{
+ int len, in_use;
+
+ len = in_use = 0;
+
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i'
+ || GET_CODE (PATTERN (insn)) == CLOBBER
+ || GET_CODE (PATTERN (insn)) == USE)
+ goto next_and_done;
+
+ while (1)
+ {
+ enum alphaev5_pipe pipe;
+
+ pipe = alphaev5_insn_pipe (insn);
+ switch (pipe)
+ {
+ case EV5_STOP:
+ /* Force complex instructions to start new groups. */
+ if (in_use)
+ goto done;
+
+ /* If this is a completely unrecognized insn, its an asm.
+ We don't know how long it is, so record length as -1 to
+ signal a needed realignment. */
+ if (recog_memoized (insn) < 0)
+ len = -1;
+ else
+ len = get_attr_length (insn);
+ goto next_and_done;
+
+ /* ??? Most of the places below, we would like to abort, as
+ it would indicate an error either in Haifa, or in the
+ scheduling description. Unfortunately, Haifa never
+ schedules the last instruction of the BB, so we don't
+ have an accurate TI bit to go off. */
+ case EV5_E01:
+ if (in_use & EV5_E0)
+ {
+ if (in_use & EV5_E1)
+ goto done;
+ in_use |= EV5_E1;
+ }
+ else
+ in_use |= EV5_E0 | EV5_E01;
+ break;
+
+ case EV5_E0:
+ if (in_use & EV5_E0)
+ {
+ if (!(in_use & EV5_E01) || (in_use & EV5_E1))
+ goto done;
+ in_use |= EV5_E1;
+ }
+ in_use |= EV5_E0;
+ break;
+
+ case EV5_E1:
+ if (in_use & EV5_E1)
+ goto done;
+ in_use |= EV5_E1;
+ break;
+
+ case EV5_FAM:
+ if (in_use & EV5_FA)
+ {
+ if (in_use & EV5_FM)
+ goto done;
+ in_use |= EV5_FM;
+ }
+ else
+ in_use |= EV5_FA | EV5_FAM;
+ break;
+
+ case EV5_FA:
+ if (in_use & EV5_FA)
+ goto done;
+ in_use |= EV5_FA;
+ break;
+
+ case EV5_FM:
+ if (in_use & EV5_FM)
+ goto done;
+ in_use |= EV5_FM;
+ break;
+
+ case EV5_NONE:
+ break;
+
+ default:
+ abort();
+ }
+ len += 4;
+
+ /* Haifa doesn't do well scheduling branches. */
+ /* ??? If this is predicted not-taken, slotting continues, except
+ that no more IBR, FBR, or JSR insns may be slotted. */
+ if (GET_CODE (insn) == JUMP_INSN)
+ goto next_and_done;
+
+ next:
+ insn = next_nonnote_insn (insn);
+
+ if (!insn || GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ goto done;
+
+ /* Let Haifa tell us where it thinks insn group boundaries are. */
+ if (GET_MODE (insn) == TImode)
+ goto done;
+
+ if (GET_CODE (insn) == CLOBBER || GET_CODE (insn) == USE)
+ goto next;
+ }
+
+ next_and_done:
+ insn = next_nonnote_insn (insn);
+
+ done:
+ *plen = len;
+ *pin_use = in_use;
+ return insn;
+}
+
+static rtx
+alphaev4_next_nop (pin_use)
+ int *pin_use;
+{
+ int in_use = *pin_use;
+ rtx nop;
+
+ if (!(in_use & EV4_IB0))
+ {
+ in_use |= EV4_IB0;
+ nop = gen_nop ();
+ }
+ else if ((in_use & (EV4_IBX|EV4_IB1)) == EV4_IBX)
+ {
+ in_use |= EV4_IB1;
+ nop = gen_nop ();
+ }
+ else if (TARGET_FP && !(in_use & EV4_IB1))
+ {
+ in_use |= EV4_IB1;
+ nop = gen_fnop ();
+ }
+ else
+ nop = gen_unop ();
+
+ *pin_use = in_use;
+ return nop;
+}
+
+static rtx
+alphaev5_next_nop (pin_use)
+ int *pin_use;
+{
+ int in_use = *pin_use;
+ rtx nop;
+
+ if (!(in_use & EV5_E1))
+ {
+ in_use |= EV5_E1;
+ nop = gen_nop ();
+ }
+ else if (TARGET_FP && !(in_use & EV5_FA))
+ {
+ in_use |= EV5_FA;
+ nop = gen_fnop ();
+ }
+ else if (TARGET_FP && !(in_use & EV5_FM))
+ {
+ in_use |= EV5_FM;
+ nop = gen_fnop ();
+ }
+ else
+ nop = gen_unop ();
+
+ *pin_use = in_use;
+ return nop;
+}
+
+/* The instruction group alignment main loop. */
+
+static void
+alpha_align_insns (insns, max_align, next_group, next_nop, gp_in_use)
+ rtx insns;
+ int max_align;
+ rtx (*next_group) PROTO((rtx, int*, int*));
+ rtx (*next_nop) PROTO((int*));
+ int gp_in_use;
+{
+ /* ALIGN is the known alignment for the insn group. */
+ int align;
+ /* OFS is the offset of the current insn in the insn group. */
+ int ofs;
+ int prev_in_use, in_use, len;
+ rtx i, next;
+
+ /* Let shorten branches care for assigning alignments to code labels. */
+ shorten_branches (insns);
+
+ align = (FUNCTION_BOUNDARY/BITS_PER_UNIT < max_align
+ ? FUNCTION_BOUNDARY/BITS_PER_UNIT : max_align);
+
+ /* Account for the initial GP load, which happens before the scheduled
+ prologue we emitted as RTL. */
+ ofs = prev_in_use = 0;
+ if (alpha_does_function_need_gp())
+ {
+ ofs = 8 & (align - 1);
+ prev_in_use = gp_in_use;
+ }
+
+ i = insns;
+ if (GET_CODE (i) == NOTE)
+ i = next_nonnote_insn (i);
+
+ while (i)
+ {
+ next = (*next_group)(i, &in_use, &len);
+
+ /* When we see a label, resync alignment etc. */
+ if (GET_CODE (i) == CODE_LABEL)
+ {
+ int new_align = 1 << label_to_alignment (i);
+ if (new_align >= align)
+ {
+ align = new_align < max_align ? new_align : max_align;
+ ofs = 0;
+ }
+ else if (ofs & (new_align-1))
+ ofs = (ofs | (new_align-1)) + 1;
+ if (len != 0)
+ abort();
+ }
+
+ /* Handle complex instructions special. */
+ else if (in_use == 0)
+ {
+ /* Asms will have length < 0. This is a signal that we have
+ lost alignment knowledge. Assume, however, that the asm
+ will not mis-align instructions. */
+ if (len < 0)
+ {
+ ofs = 0;
+ align = 4;
+ len = 0;
+ }
+ }
+
+ /* If the known alignment is smaller than the recognized insn group,
+ realign the output. */
+ else if (align < len)
+ {
+ int new_log_align = len > 8 ? 4 : 3;
+ rtx where;
+
+ where = prev_nonnote_insn (i);
+ if (!where || GET_CODE (where) != CODE_LABEL)
+ where = i;
+
+ emit_insn_before (gen_realign (GEN_INT (new_log_align)), where);
+ align = 1 << new_log_align;
+ ofs = 0;
+ }
+
+ /* If the group won't fit in the same INT16 as the previous,
+ we need to add padding to keep the group together. Rather
+ than simply leaving the insn filling to the assembler, we
+ can make use of the knowledge of what sorts of instructions
+ were issued in the previous group to make sure that all of
+ the added nops are really free. */
+ else if (ofs + len > align)
+ {
+ int nop_count = (align - ofs) / 4;
+ rtx where;
+
+ /* Insert nops before labels and branches to truely merge the
+ execution of the nops with the previous instruction group. */
+ where = prev_nonnote_insn (i);
+ if (where)
+ {
+ if (GET_CODE (where) == CODE_LABEL)
+ {
+ rtx where2 = prev_nonnote_insn (where);
+ if (where2 && GET_CODE (where2) == JUMP_INSN)
+ where = where2;
+ }
+ else if (GET_CODE (where) != JUMP_INSN)
+ where = i;
+ }
+ else
+ where = i;
+
+ do
+ emit_insn_before ((*next_nop)(&prev_in_use), where);
+ while (--nop_count);
+ ofs = 0;
+ }
+
+ ofs = (ofs + len) & (align - 1);
+ prev_in_use = in_use;
+ i = next;
+ }
+}
+#endif /* HAIFA */
+
/* Machine dependant reorg pass. */
void
alpha_reorg (insns)
rtx insns;
{
- alpha_handle_trap_shadows (insns);
+ if (alpha_tp != ALPHA_TP_PROG || flag_exceptions)
+ alpha_handle_trap_shadows (insns);
+
+#ifdef HAIFA
+ /* Due to the number of extra trapb insns, don't bother fixing up
+ alignment when trap precision is instruction. Moreover, we can
+ only do our job when sched2 is run and Haifa is our scheduler. */
+ if (optimize && !optimize_size
+ && alpha_tp != ALPHA_TP_INSN
+ && flag_schedule_insns_after_reload)
+ {
+ if (alpha_cpu == PROCESSOR_EV4)
+ alpha_align_insns (insns, 8, alphaev4_next_group,
+ alphaev4_next_nop, EV4_IB0);
+ else if (alpha_cpu == PROCESSOR_EV5)
+ alpha_align_insns (insns, 16, alphaev5_next_group,
+ alphaev5_next_nop, EV5_E01 | EV5_E0);
+ }
+#endif
}
/* Check a floating-point value for validity for a particular machine mode. */
-static char *float_strings[] =
+static char * const float_strings[] =
{
/* These are for FLOAT_VAX. */
"1.70141173319264430e+38", /* 2^127 (2^24 - 1) / 2^24 */
@@ -4137,7 +4888,7 @@ int
check_float_value (mode, d, overflow)
enum machine_mode mode;
REAL_VALUE_TYPE *d;
- int overflow;
+ int overflow ATTRIBUTE_UNUSED;
{
if (TARGET_IEEE || TARGET_IEEE_CONFORMANT || TARGET_IEEE_WITH_INEXACT)
@@ -4327,10 +5078,9 @@ alpha_write_linkage (stream)
void
alpha_need_linkage (name, is_local)
- char *name;
- int is_local;
+ char *name ATTRIBUTE_UNUSED;
+ int is_local ATTRIBUTE_UNUSED;
{
}
#endif /* OPEN_VMS */
-
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 8f3f1b42b20..0a99e07a556 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -23,14 +23,18 @@ Boston, MA 02111-1307, USA. */
/* Write out the correct language type definition for the header files.
Unless we have assembler language, write out the symbols for C. */
#define CPP_SPEC "\
-%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \
-%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
-%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \
-%{mieee:-D_IEEE_FP} \
-%{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT}"
+%{!undef:\
+%{.S:-D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY }}\
+%{.cc|.cxx|.C:-D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus }\
+%{.m:-D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C }\
+%{!.S:%{!.cc:%{!.cxx:%{!.C:%{!.m:-D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C }}}}}}\
+%{mieee:-D_IEEE_FP }\
+%{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT }}\
+%(cpp_cpu) %(cpp_subtarget)"
+
+#ifndef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC ""
+#endif
/* Set the spec to use for signed char. The default tests the above macro
but DEC's compiler can't handle the conditional in a "constant"
@@ -171,7 +175,9 @@ extern enum alpha_fp_trap_mode alpha_fptm;
#ifndef TARGET_AS_CAN_SUBTRACT_LABELS
#define TARGET_AS_CAN_SUBTRACT_LABELS TARGET_GAS
#endif
-
+#ifndef TARGET_CAN_FAULT_IN_PROLOGUE
+#define TARGET_CAN_FAULT_IN_PROLOGUE 0
+#endif
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
@@ -238,6 +244,88 @@ extern char *alpha_mlat_string; /* For -mmemory-latency= */
{"memory-latency=", &alpha_mlat_string}, \
}
+/* Attempt to describe CPU characteristics to the preprocessor. */
+
+/* Corresponding to amask... */
+#define CPP_AM_BWX_SPEC "-D__alpha_bwx__ -Acpu(bwx)"
+#define CPP_AM_MAX_SPEC "-D__alpha_max__ -Acpu(max)"
+#define CPP_AM_CIX_SPEC "-D__alpha_cix__ -Acpu(cix)"
+
+/* Corresponding to implver... */
+#define CPP_IM_EV4_SPEC "-D__alpha_ev4__ -Acpu(ev4)"
+#define CPP_IM_EV5_SPEC "-D__alpha_ev5__ -Acpu(ev5)"
+#define CPP_IM_EV6_SPEC "-D__alpha_ev6__ -Acpu(ev6)"
+
+/* Common combinations. */
+#define CPP_CPU_EV4_SPEC "%(cpp_im_ev4)"
+#define CPP_CPU_EV5_SPEC "%(cpp_im_ev5)"
+#define CPP_CPU_EV56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx)"
+#define CPP_CPU_PCA56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx) %(cpp_am_max)"
+#define CPP_CPU_EV6_SPEC "%(cpp_im_ev6) %(cpp_am_bwx) %(cpp_am_max) %(cpp_am_cix)"
+
+#ifndef CPP_CPU_DEFAULT_SPEC
+# if TARGET_CPU_DEFAULT & MASK_CPU_EV6
+# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV6_SPEC
+# else
+# if TARGET_CPU_DEFAULT & MASK_CPU_EV5
+# if TARGET_CPU_DEFAULT & MASK_MAX
+# define CPP_CPU_DEFAULT_SPEC CPP_CPU_PCA56_SPEC
+# else
+# if TARGET_CPU_DEFAULT & MASK_BWX
+# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV56_SPEC
+# else
+# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV5_SPEC
+# endif
+# endif
+# else
+# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV4_SPEC
+# endif
+# endif
+#endif /* CPP_CPU_DEFAULT_SPEC */
+
+#ifndef CPP_CPU_SPEC
+#define CPP_CPU_SPEC "\
+%{!undef:-Acpu(alpha) -Amachine(alpha) -D__alpha -D__alpha__ \
+%{mcpu=ev4|mcpu=21064:%(cpp_cpu_ev4) }\
+%{mcpu=ev5|mcpu=21164:%(cpp_cpu_ev5) }\
+%{mcpu=ev56|mcpu=21164a:%(cpp_cpu_ev56) }\
+%{mcpu=pca56|mcpu=21164pc|mcpu=21164PC:%(cpp_cpu_pca56) }\
+%{mcpu=ev6|mcpu=21264:%(cpp_cpu_ev6) }\
+%{!mcpu*:%(cpp_cpu_default) }}"
+#endif
+
+/* 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.
+
+ Each subgrouping contains a string constant, that defines the
+ specification name, and a string constant that used by the GNU CC driver
+ program.
+
+ Do not define this macro if it does not need to do anything. */
+
+#ifndef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS
+#endif
+
+#define EXTRA_SPECS \
+ { "cpp_am_bwx", CPP_AM_BWX_SPEC }, \
+ { "cpp_am_max", CPP_AM_MAX_SPEC }, \
+ { "cpp_am_cix", CPP_AM_CIX_SPEC }, \
+ { "cpp_im_ev4", CPP_IM_EV4_SPEC }, \
+ { "cpp_im_ev5", CPP_IM_EV5_SPEC }, \
+ { "cpp_im_ev6", CPP_IM_EV6_SPEC }, \
+ { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC }, \
+ { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC }, \
+ { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC }, \
+ { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC }, \
+ { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC }, \
+ { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
+ { "cpp_cpu", CPP_CPU_SPEC }, \
+ { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
+ SUBTARGET_EXTRA_SPECS
+
+
/* Sometimes certain combinations of command options do not make sense
on a particular target machine. You can define a macro
`OVERRIDE_OPTIONS' to take account of this. This macro, if
@@ -371,7 +459,7 @@ extern void override_options ();
#define STACK_BOUNDARY 64
/* Allocation boundary (in *bits*) for the code of a function. */
-#define FUNCTION_BOUNDARY 64
+#define FUNCTION_BOUNDARY 256
/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 64
@@ -387,20 +475,16 @@ extern void override_options ();
??? Kludge this and the next macro for the moment by not doing anything if
we don't optimize and also if we are writing ECOFF symbols to work around
a bug in DEC's assembler. */
-/* Aligning past 2**3 wastes insn cache lines, and doesn't buy much
- issue-wise on average anyway. */
#define LOOP_ALIGN(LABEL) \
- (optimize > 0 && write_symbols != SDB_DEBUG ? 3 : 0)
+ (optimize > 0 && write_symbols != SDB_DEBUG ? 4 : 0)
-/* This is how to align an instruction for optimal branching.
- On Alpha we'll get better performance by aligning on a quadword
+/* This is how to align an instruction for optimal branching. On
+ Alpha we'll get better performance by aligning on an octaword
boundary. */
-/* Aligning past 2**3 wastes insn cache lines, and doesn't buy much
- issue-wise on average anyway. */
-#define ALIGN_LABEL_AFTER_BARRIER(FILE) \
- (optimize > 0 && write_symbols != SDB_DEBUG ? 3 : 0)
+#define LABEL_ALIGN_AFTER_BARRIER(FILE) \
+ (optimize > 0 && write_symbols != SDB_DEBUG ? 4 : 0)
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 64
@@ -678,12 +762,17 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
For the Alpha, `Q' means that this is a memory operand but not a
reference to an unaligned location.
+
`R' is a SYMBOL_REF that has SYMBOL_REF_FLAG set or is the current
- function. */
+ function.
+
+ 'S' is a 6-bit constant (valid for a shift insn). */
#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) != AND \
- : (C) == 'R' ? current_file_function_operand (OP, Pmode) \
+ ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) != AND \
+ : (C) == 'R' ? current_file_function_operand (OP, Pmode) \
+ : (C) == 'S' ? (GET_CODE (OP) == CONST_INT \
+ && (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \
: 0)
/* Given an rtx X being reloaded into a reg required to be
@@ -1076,6 +1165,7 @@ extern int alpha_memory_latency;
insns and emitted. */
extern struct rtx_def *alpha_emit_set_const ();
extern struct rtx_def *alpha_emit_set_long_const ();
+extern struct rtx_def *alpha_emit_conditional_branch ();
extern struct rtx_def *alpha_emit_conditional_move ();
/* Generate necessary RTL for __builtin_saveregs().
@@ -1090,8 +1180,11 @@ extern struct rtx_def *alpha_builtin_saveregs ();
extern struct rtx_def *alpha_compare_op0, *alpha_compare_op1;
extern int alpha_compare_fp_p;
-/* Make (or fake) .linkage entry for function call.
+/* Define the information needed to modify the epilogue for EH. */
+extern struct rtx_def *alpha_eh_epilogue_sp_ofs;
+
+/* Make (or fake) .linkage entry for function call.
IS_LOCAL is 0 if name is used in call, 1 if name is used in definition. */
extern void alpha_need_linkage ();
@@ -1099,25 +1192,26 @@ extern void alpha_need_linkage ();
#define ASM_COMMENT_START " #"
-/* This macro produces the initial definition of a function name. On the
- Alpha, we need to save the function name for the prologue and epilogue. */
+/* This macro produces the initial definition of a function. */
-extern char *alpha_function_name;
+#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
+ alpha_start_function(FILE,NAME,DECL);
+extern void alpha_start_function ();
-#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
-{ \
- alpha_function_name = NAME; \
-}
+/* This macro closes up a function definition for the assembler. */
+
+#define ASM_DECLARE_FUNCTION_SIZE(FILE,NAME,DECL) \
+ alpha_end_function(FILE,NAME,DECL)
+extern void alpha_end_function ();
-/* This macro generates the assembly code for function entry.
- FILE is a stdio stream to output the code to.
- SIZE is an int: how many units of temporary storage to allocate.
- Refer to the array `regs_ever_live' to determine which registers
- to save; `regs_ever_live[I]' is nonzero if register number I
- is ever used in the function. This macro is responsible for
- knowing which registers should not be saved even if used. */
+/* This macro notes the end of the prologue. */
+
+#define FUNCTION_END_PROLOGUE(FILE) output_end_prologue (FILE)
+extern void output_end_prologue ();
+
+/* Output any profiling code before the prologue. */
-#define FUNCTION_PROLOGUE(FILE, SIZE) output_prolog (FILE, SIZE)
+#define PROFILE_BEFORE_PROLOGUE 1
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. Under OSF/1, profiling is enabled
@@ -1167,19 +1261,6 @@ extern char *alpha_function_name;
No definition is equivalent to always zero. */
#define EXIT_IGNORE_STACK 1
-
-/* This macro generates the assembly code for function exit,
- on machines that need it. If FUNCTION_EPILOGUE is not defined
- then individual return instructions are generated for each
- return statement. Args are same as for FUNCTION_PROLOGUE.
-
- The function epilogue should not depend on the current stack pointer!
- It should use the frame pointer only. This is mandatory because
- of alloca; we also take advantage of it to omit stack adjustments
- before returning. */
-
-#define FUNCTION_EPILOGUE(FILE, SIZE) output_epilog (FILE, SIZE)
-
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts.
@@ -1191,13 +1272,13 @@ extern char *alpha_function_name;
aligned to FUNCTION_BOUNDARY, which is 64 bits. */
#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
+do { \
fprintf (FILE, "\tldq $1,24($27)\n"); \
fprintf (FILE, "\tldq $27,16($27)\n"); \
fprintf (FILE, "\tjmp $31,($27),0\n"); \
fprintf (FILE, "\tnop\n"); \
fprintf (FILE, "\t.quad 0,0\n"); \
-}
+} while (0)
/* Section in which to place the trampoline. On Alpha, instructions
may only be placed in a text segment. */
@@ -1210,77 +1291,28 @@ extern char *alpha_function_name;
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. We assume
- here that a function will be called many more times than its address
- is taken (e.g., it might be passed to qsort), so we take the trouble
- to initialize the "hint" field in the JMP insn. Note that the hint
- field is PC (new) + 4 * bits 13:0. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- rtx _temp, _temp1, _addr; \
- \
- _addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
- emit_move_insn (gen_rtx (MEM, Pmode, _addr), (FNADDR)); \
- _addr = memory_address (Pmode, plus_constant ((TRAMP), 24)); \
- emit_move_insn (gen_rtx (MEM, Pmode, _addr), (CXT)); \
- \
- _temp = force_operand (plus_constant ((TRAMP), 12), NULL_RTX); \
- _temp = expand_binop (DImode, sub_optab, (FNADDR), _temp, _temp, 1, \
- OPTAB_WIDEN); \
- _temp = expand_shift (RSHIFT_EXPR, Pmode, _temp, \
- build_int_2 (2, 0), NULL_RTX, 1); \
- _temp = expand_and (gen_lowpart (SImode, _temp), \
- GEN_INT (0x3fff), 0); \
- \
- _addr = memory_address (SImode, plus_constant ((TRAMP), 8)); \
- _temp1 = force_reg (SImode, gen_rtx (MEM, SImode, _addr)); \
- _temp1 = expand_and (_temp1, GEN_INT (0xffffc000), NULL_RTX); \
- _temp1 = expand_binop (SImode, ior_optab, _temp1, _temp, _temp1, 1, \
- OPTAB_WIDEN); \
- \
- emit_move_insn (gen_rtx (MEM, SImode, _addr), _temp1); \
- \
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, \
- "__enable_execute_stack"), \
- 0, VOIDmode, 1,_addr, Pmode); \
- \
- emit_insn (gen_rtx (UNSPEC_VOLATILE, VOIDmode, \
- gen_rtvec (1, const0_rtx), 0)); \
-}
-
-/* Attempt to turn on access permissions for the stack. */
+ CXT is an RTX for the static chain value for the function. */
-#define TRANSFER_FROM_TRAMPOLINE \
- \
-void \
-__enable_execute_stack (addr) \
- void *addr; \
-{ \
- long size = getpagesize (); \
- long mask = ~(size-1); \
- char *page = (char *) (((long) addr) & mask); \
- char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
- \
- /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
- if (mprotect (page, end - page, 7) < 0) \
- perror ("mprotect of trampoline code"); \
-}
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
+ alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, 8)
+extern void alpha_initialize_trampoline ();
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of
- the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME} is defined. */
+ the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined. */
#define RETURN_ADDR_RTX alpha_return_addr
extern struct rtx_def *alpha_return_addr ();
+/* Before the prologue, RA lives in $26. */
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
+
/* Initialize data used by insn expanders. This is called from insn_emit,
once for every function before code is generated. */
#define INIT_EXPANDERS alpha_init_expanders ()
extern void alpha_init_expanders ();
-
/* Addressing modes, and classification of registers for them. */
@@ -1558,9 +1590,11 @@ do { \
#define MOVE_MAX 8
-/* Controls how many units are moved by expr.c before resorting to movstr.
- Without byte/word accesses, we want no more than one; with, several single
- byte accesses are better. */
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead.
+
+ Without byte/word accesses, we want no more than four instructions;
+ with, several single byte accesses are better. */
#define MOVE_RATIO (TARGET_BWX ? 7 : 2)
@@ -1655,6 +1689,12 @@ do { \
/* The EV4 is dual issue; EV5/EV6 are quad issue. */
#define ISSUE_RATE (alpha_cpu == PROCESSOR_EV4 ? 2 : 4)
+/* Describe the fact that MULTI instructions are multiple instructions
+ and so to assume they don't pair with anything. */
+#define MD_SCHED_VARIABLE_ISSUE(DUMP, SCHED_VERBOSE, INSN, CAN_ISSUE_MORE) \
+ if (recog_memoized (INSN) < 0 || get_attr_type (INSN) == TYPE_MULTI) \
+ (CAN_ISSUE_MORE) = 0
+
/* Compute the cost of computing a constant rtl expression RTX
whose rtx-code is CODE. The body of this macro is a portion
of a switch statement. If the code is computed here,
@@ -1819,8 +1859,8 @@ do { \
sized text section with no associated exception handling info. The
DEC linker sees this text section, and gives a warning saying that
the exception handling info is missing. */
-#define ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_LANGUAGE
+#define ASM_IDENTIFY_GCC(x)
+#define ASM_IDENTIFY_LANGUAGE(x)
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@@ -1987,12 +2027,12 @@ literal_section () \
#define ASM_OUTPUT_SHORT(FILE,VALUE) \
fprintf (FILE, "\t.word %d\n", \
- (GET_CODE (VALUE) == CONST_INT \
+ (int)(GET_CODE (VALUE) == CONST_INT \
? INTVAL (VALUE) & 0xffff : (abort (), 0)))
#define ASM_OUTPUT_CHAR(FILE,VALUE) \
fprintf (FILE, "\t.byte %d\n", \
- (GET_CODE (VALUE) == CONST_INT \
+ (int)(GET_CODE (VALUE) == CONST_INT \
? INTVAL (VALUE) & 0xff : (abort (), 0)))
/* We use the default ASCII-output routine, except that we don't write more
@@ -2059,7 +2099,7 @@ literal_section () \
/* This is how to output an assembler line for a numeric constant byte. */
#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.byte 0x%x\n", (VALUE) & 0xff)
+ fprintf (FILE, "\t.byte 0x%x\n", (int) ((VALUE) & 0xff))
/* This is how to output an element of a case-vector that is absolute.
(Alpha does not use such vectors, but we must define this macro anyway.) */
@@ -2120,21 +2160,15 @@ literal_section () \
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
- char *fn_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)); \
+ char *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
+ int reg; \
\
- fprintf (FILE, "\t.ent "); \
- assemble_name (FILE, alpha_function_name); \
- fputc ('\n', FILE); \
- ASM_OUTPUT_LABEL (FILE, alpha_function_name); \
- fprintf (FILE, "\tldgp $29,0($27)\n"); \
- fputc ('$', FILE); \
- assemble_name (FILE, alpha_function_name); \
- fprintf (FILE, "..ng:\n"); \
- fprintf (FILE, "\t.frame $30,0,$26,0\n"); \
- fprintf (FILE, "\t.prologue 1\n"); \
+ /* Mark end of prologue. */ \
+ output_end_prologue (FILE); \
\
/* Rely on the assembler to macro expand a large delta. */ \
- fprintf (FILE, "\tlda $16,%ld($16)\n", (long)(DELTA)); \
+ reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
+ fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
\
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
{ \
@@ -2144,19 +2178,13 @@ do { \
} \
else \
{ \
- fprintf (FILE, "\tlda $27,"); \
- assemble_name (FILE, fn_name); \
- fprintf (FILE, "\n\tjmp $31,($27),"); \
+ fprintf (FILE, "\tjmp $31,"); \
assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} \
- \
- fprintf (FILE, "\t.end "); \
- assemble_name (FILE, alpha_function_name); \
- fputc ('\n', FILE); \
} while (0)
-
+
/* Define results of standard character escape sequences. */
#define TARGET_BELL 007
#define TARGET_BS 010
@@ -2184,6 +2212,9 @@ do { \
' Generates trap-mode suffix for instructions that accept the
su suffix only (cmpt et al).
+ ` Generates trap-mode suffix for instructions that accept the
+ v and sv suffix. The only instruction that needs this is cvtql.
+
( Generates trap-mode suffix for instructions that accept the
v, sv, and svi suffix. The only instruction that needs this
is cvttq.
@@ -2203,8 +2234,8 @@ do { \
*/
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
- ((CODE) == '&' || (CODE) == '\'' || (CODE) == '(' || (CODE) == ')' \
- || (CODE) == '+' || (CODE) == ',' || (CODE) == '-')
+ ((CODE) == '&' || (CODE) == '`' || (CODE) == '\'' || (CODE) == '(' \
+ || (CODE) == ')' || (CODE) == '+' || (CODE) == ',' || (CODE) == '-')
/* Print a memory address as an operand to reference that memory location. */
@@ -2227,40 +2258,41 @@ do { \
else \
abort (); \
\
- fprintf (FILE, "%d($%d)", offset, basereg); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, offset); \
+ fprintf (FILE, "($%d)", basereg); \
}
/* Define the codes that are matched by predicates in alpha.c. */
-#define PREDICATE_CODES \
- {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
- {"reg_or_6bit_operand", {SUBREG, REG, CONST_INT}}, \
- {"reg_or_8bit_operand", {SUBREG, REG, CONST_INT}}, \
- {"cint8_operand", {CONST_INT}}, \
- {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
- {"add_operand", {SUBREG, REG, CONST_INT}}, \
- {"sext_add_operand", {SUBREG, REG, CONST_INT}}, \
- {"const48_operand", {CONST_INT}}, \
- {"and_operand", {SUBREG, REG, CONST_INT}}, \
- {"or_operand", {SUBREG, REG, CONST_INT}}, \
- {"mode_mask_operand", {CONST_INT}}, \
- {"mul8_operand", {CONST_INT}}, \
- {"mode_width_operand", {CONST_INT}}, \
- {"reg_or_fp0_operand", {SUBREG, REG, CONST_DOUBLE}}, \
- {"alpha_comparison_operator", {EQ, LE, LT, LEU, LTU}}, \
- {"alpha_swapped_comparison_operator", {EQ, GE, GT, GEU, GTU}}, \
- {"signed_comparison_operator", {EQ, NE, LE, LT, GE, GT}}, \
- {"divmod_operator", {DIV, MOD, UDIV, UMOD}}, \
- {"fp0_operand", {CONST_DOUBLE}}, \
- {"current_file_function_operand", {SYMBOL_REF}}, \
- {"call_operand", {REG, SYMBOL_REF}}, \
- {"input_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
- SYMBOL_REF, CONST, LABEL_REF}}, \
- {"some_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
- SYMBOL_REF, CONST, LABEL_REF}}, \
- {"aligned_memory_operand", {MEM}}, \
- {"unaligned_memory_operand", {MEM}}, \
- {"reg_or_unaligned_mem_operand", {SUBREG, REG, MEM}}, \
- {"any_memory_operand", {MEM}}, \
+#define PREDICATE_CODES \
+ {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_6bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"reg_or_8bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"cint8_operand", {CONST_INT, CONSTANT_P_RTX}}, \
+ {"reg_or_cint_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"add_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"sext_add_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"const48_operand", {CONST_INT}}, \
+ {"and_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"or_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"mode_mask_operand", {CONST_INT}}, \
+ {"mul8_operand", {CONST_INT}}, \
+ {"mode_width_operand", {CONST_INT}}, \
+ {"reg_or_fp0_operand", {SUBREG, REG, CONST_DOUBLE}}, \
+ {"alpha_comparison_operator", {EQ, LE, LT, LEU, LTU}}, \
+ {"alpha_swapped_comparison_operator", {EQ, GE, GT, GEU, GTU}}, \
+ {"signed_comparison_operator", {EQ, NE, LE, LT, GE, GT}}, \
+ {"divmod_operator", {DIV, MOD, UDIV, UMOD}}, \
+ {"fp0_operand", {CONST_DOUBLE}}, \
+ {"current_file_function_operand", {SYMBOL_REF}}, \
+ {"call_operand", {REG, SYMBOL_REF}}, \
+ {"input_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
+ SYMBOL_REF, CONST, LABEL_REF, CONSTANT_P_RTX}}, \
+ {"some_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
+ SYMBOL_REF, CONST, LABEL_REF, CONSTANT_P_RTX}}, \
+ {"aligned_memory_operand", {MEM}}, \
+ {"unaligned_memory_operand", {MEM}}, \
+ {"reg_or_unaligned_mem_operand", {SUBREG, REG, MEM}}, \
+ {"any_memory_operand", {MEM}}, \
{"hard_fp_register_operand", {SUBREG, REG}},
/* Tell collect that the object format is ECOFF. */
@@ -2387,7 +2419,7 @@ do { \
#define PUT_SDB_FUNCTION_END(LINE)
-#define PUT_SDB_EPILOGUE_END(NAME)
+#define PUT_SDB_EPILOGUE_END(NAME) ((void)(NAME))
/* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for
mips-tdump.c to print them out.
@@ -2417,6 +2449,47 @@ do { \
/* The system headers under Alpha systems are generally C++-aware. */
#define NO_IMPLICIT_EXTERN_C
-/* Prototypes for alpha.c functions used in the md file. */
+/* Prototypes for alpha.c functions used in the md file & elsewhere. */
extern struct rtx_def *get_unaligned_address ();
-
+extern void alpha_write_verstamp ();
+extern void alpha_reorg ();
+extern int check_float_value ();
+extern int direct_return ();
+extern int const48_operand ();
+extern int add_operand ();
+extern int and_operand ();
+extern int unaligned_memory_operand ();
+extern int zap_mask ();
+extern int current_file_function_operand ();
+extern int alpha_sa_size ();
+extern int alpha_adjust_cost ();
+extern void print_operand ();
+extern int reg_or_0_operand ();
+extern int reg_or_8bit_operand ();
+extern int mul8_operand ();
+extern int reg_or_6bit_operand ();
+extern int alpha_comparison_operator ();
+extern int alpha_swapped_comparison_operator ();
+extern int sext_add_operand ();
+extern int cint8_operand ();
+extern int mode_mask_operand ();
+extern int or_operand ();
+extern int mode_width_operand ();
+extern int reg_or_fp0_operand ();
+extern int signed_comparison_operator ();
+extern int fp0_operand ();
+extern int some_operand ();
+extern int input_operand ();
+extern int divmod_operator ();
+extern int call_operand ();
+extern int reg_or_cint_operand ();
+extern int hard_fp_register_operand ();
+extern void alpha_set_memflags ();
+extern int aligned_memory_operand ();
+extern void get_aligned_mem ();
+extern void alpha_expand_unaligned_load ();
+extern void alpha_expand_unaligned_store ();
+extern int alpha_expand_block_move ();
+extern int alpha_expand_block_clear ();
+extern void alpha_expand_prologue ();
+extern void alpha_expand_epilogue ();
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 9d2dd3139b7..bcd0b1e1fa8 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -28,6 +28,7 @@
;; 2 insxh
;; 3 mskxh
;; 4 cvtlq
+;; 5 cvtql
;;
;; UNSPEC_VOLATILE:
;;
@@ -36,7 +37,9 @@
;; 2 builtin_setjmp_receiver
;; 3 builtin_longjmp
;; 4 trapb
-
+;; 5 prologue_stack_probe_loop
+;; 6 realign
+;; 7 exception_receiver
;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in alpha.h.
@@ -50,16 +53,27 @@
;; separately.
(define_attr "type"
- "ild,fld,ldsym,ist,fst,ibr,fbr,jsr,iadd,ilog,shift,icmov,fcmov,icmp,imul,fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof"
+ "ild,fld,ldsym,ist,fst,ibr,fbr,jsr,iadd,ilog,shift,icmov,fcmov,icmp,imul,fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
(const_string "iadd"))
+;; Describe a user's asm statement.
+(define_asm_attributes
+ [(set_attr "type" "multi")])
+
+;; Define the operand size an insn operates on. Used primarily by mul
+;; and div operations that have size dependant timings.
+
(define_attr "opsize" "si,di,udi" (const_string "di"))
;; The TRAP_TYPE attribute marks instructions that may generate traps
;; (which are imprecise and may need a trapb if software completion
;; is desired).
+
(define_attr "trap" "no,yes" (const_string "no"))
+;; The length of an instruction sequence in bytes.
+
+(define_attr "length" "" (const_int 4))
;; On EV4 there are two classes of resources to consider: resources needed
;; to issue, and resources needed to execute. IBUS[01] are in the first
@@ -384,7 +398,8 @@
addl %1,$31,%0
ldl %0,%1
lds %0,%1\;cvtlq %0,%0"
- [(set_attr "type" "iadd,ild,fld")])
+ [(set_attr "type" "iadd,ild,fld")
+ (set_attr "length" "*,*,8")])
;; Due to issues with CLASS_CANNOT_CHANGE_SIZE, we cannot use a subreg here.
(define_split
@@ -803,61 +818,66 @@
;; The divide and remainder operations always take their inputs from
;; r24 and r25, put their output in r27, and clobber r23 and r28.
-;; ??? comment out the divsi routines since the library functions
-;; don't seem to do the right thing with the high 32-bits of a
-;; register nonzero.
-
-;(define_expand "divsi3"
-; [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
-; (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
-; (parallel [(set (reg:SI 27)
-; (div:SI (reg:SI 24)
-; (reg:SI 25)))
-; (clobber (reg:DI 23))
-; (clobber (reg:DI 28))])
-; (set (match_operand:SI 0 "general_operand" "")
-; (reg:SI 27))]
-; "!TARGET_OPEN_VMS"
-; "")
-
-;(define_expand "udivsi3"
-; [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
-; (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
-; (parallel [(set (reg:SI 27)
-; (udiv:SI (reg:SI 24)
-; (reg:SI 25)))
-; (clobber (reg:DI 23))
-; (clobber (reg:DI 28))])
-; (set (match_operand:SI 0 "general_operand" "")
-; (reg:SI 27))]
-; "!TARGET_OPEN_VMS"
-; "")
-
-;(define_expand "modsi3"
-; [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
-; (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
-; (parallel [(set (reg:SI 27)
-; (mod:SI (reg:SI 24)
-; (reg:SI 25)))
-; (clobber (reg:DI 23))
-; (clobber (reg:DI 28))])
-; (set (match_operand:SI 0 "general_operand" "")
-; (reg:SI 27))]
-; "!TARGET_OPEN_VMS"
-; "")
-
-;(define_expand "umodsi3"
-; [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
-; (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
-; (parallel [(set (reg:SI 27)
-; (umod:SI (reg:SI 24)
-; (reg:SI 25)))
-; (clobber (reg:DI 23))
-; (clobber (reg:DI 28))])
-; (set (match_operand:SI 0 "general_operand" "")
-; (reg:SI 27))]
-; "!TARGET_OPEN_VMS"
-; "")
+;; ??? Force sign-extension here because some versions of OSF/1 don't
+;; do the right thing if the inputs are not properly sign-extended.
+;; But Linux, for instance, does not have this problem. Is it worth
+;; the complication here to eliminate the sign extension?
+
+(define_expand "divsi3"
+ [(set (reg:DI 24)
+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
+ (set (reg:DI 25)
+ (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
+ (parallel [(set (reg:DI 27)
+ (sign_extend:DI (div:SI (reg:DI 24) (reg:DI 25))))
+ (clobber (reg:DI 23))
+ (clobber (reg:DI 28))])
+ (set (match_operand:SI 0 "general_operand" "")
+ (subreg:SI (reg:DI 27) 0))]
+ "!TARGET_OPEN_VMS"
+ "")
+
+(define_expand "udivsi3"
+ [(set (reg:DI 24)
+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
+ (set (reg:DI 25)
+ (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
+ (parallel [(set (reg:DI 27)
+ (sign_extend:DI (udiv:SI (reg:DI 24) (reg:DI 25))))
+ (clobber (reg:DI 23))
+ (clobber (reg:DI 28))])
+ (set (match_operand:SI 0 "general_operand" "")
+ (subreg:SI (reg:DI 27) 0))]
+ "!TARGET_OPEN_VMS"
+ "")
+
+(define_expand "modsi3"
+ [(set (reg:DI 24)
+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
+ (set (reg:DI 25)
+ (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
+ (parallel [(set (reg:DI 27)
+ (sign_extend:DI (mod:SI (reg:DI 24) (reg:DI 25))))
+ (clobber (reg:DI 23))
+ (clobber (reg:DI 28))])
+ (set (match_operand:SI 0 "general_operand" "")
+ (subreg:SI (reg:DI 27) 0))]
+ "!TARGET_OPEN_VMS"
+ "")
+
+(define_expand "umodsi3"
+ [(set (reg:DI 24)
+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
+ (set (reg:DI 25)
+ (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
+ (parallel [(set (reg:DI 27)
+ (sign_extend:DI (umod:SI (reg:DI 24) (reg:DI 25))))
+ (clobber (reg:DI 23))
+ (clobber (reg:DI 28))])
+ (set (match_operand:SI 0 "general_operand" "")
+ (subreg:SI (reg:DI 27) 0))]
+ "!TARGET_OPEN_VMS"
+ "")
(define_expand "divdi3"
[(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
@@ -911,15 +931,18 @@
"!TARGET_OPEN_VMS"
"")
-;(define_insn ""
-; [(set (reg:SI 27)
-; (match_operator:SI 1 "divmod_operator"
-; [(reg:SI 24) (reg:SI 25)]))
-; (clobber (reg:DI 23))
-; (clobber (reg:DI 28))]
-; "!TARGET_OPEN_VMS"
-; "%E1 $24,$25,$27"
-; [(set_attr "type" "jsr")])
+;; Lengths of 8 for ldq $t12,__divq($gp); jsr $t9,($t12),__divq as
+;; expanded by the assembler.
+(define_insn ""
+ [(set (reg:DI 27)
+ (sign_extend:DI (match_operator:SI 1 "divmod_operator"
+ [(reg:DI 24) (reg:DI 25)])))
+ (clobber (reg:DI 23))
+ (clobber (reg:DI 28))]
+ "!TARGET_OPEN_VMS"
+ "%E1 $24,$25,$27"
+ [(set_attr "type" "jsr")
+ (set_attr "length" "8")])
(define_insn ""
[(set (reg:DI 27)
@@ -929,7 +952,8 @@
(clobber (reg:DI 28))]
"!TARGET_OPEN_VMS"
"%E1 $24,$25,$27"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "8")])
;; Next are the basic logical operations. These only exist in DImode.
@@ -1159,7 +1183,7 @@
(define_insn "ashldi3"
[(set (match_operand:DI 0 "register_operand" "=r,r")
(ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ")
- (match_operand:DI 2 "reg_or_6bit_operand" "P,rI")))]
+ (match_operand:DI 2 "reg_or_6bit_operand" "P,rS")))]
""
"*
{
@@ -1172,6 +1196,8 @@
return \"s%P2addq %r1,0,%0\";
case 1:
return \"sll %r1,%2,%0\";
+ default:
+ abort();
}
}"
[(set_attr "type" "iadd,shift")])
@@ -1198,7 +1224,7 @@
(define_insn "lshrdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
- (match_operand:DI 2 "reg_or_6bit_operand" "rI")))]
+ (match_operand:DI 2 "reg_or_6bit_operand" "rS")))]
""
"srl %r1,%2,%0"
[(set_attr "type" "shift")])
@@ -1206,7 +1232,7 @@
(define_insn "ashrdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(ashiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
- (match_operand:DI 2 "reg_or_6bit_operand" "rI")))]
+ (match_operand:DI 2 "reg_or_6bit_operand" "rS")))]
""
"sra %r1,%2,%0"
[(set_attr "type" "shift")])
@@ -1475,6 +1501,29 @@
"ext%M2l %r1,%3,%0"
[(set_attr "type" "shift")])
+;; Combine has some strange notion of preserving existing undefined behaviour
+;; in shifts larger than a word size. So capture these patterns that it
+;; should have turned into zero_extracts.
+
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (and (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
+ (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+ (const_int 3)))
+ (match_operand:DI 3 "mode_mask_operand" "n")))]
+ ""
+ "ext%U3l %1,%2,%0"
+ [(set_attr "type" "shift")])
+
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
+ (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+ (const_int 3))))]
+ ""
+ "extql %1,%2,%0"
+ [(set_attr "type" "shift")])
+
(define_insn "extqh"
[(set (match_operand:DI 0 "register_operand" "=r")
(ashift:DI
@@ -1608,6 +1657,39 @@
"insql %1,%2,%0"
[(set_attr "type" "shift")])
+;; Combine has this sometimes habit of moving the and outside of the
+;; shift, making life more interesting.
+
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (and:DI (ashift:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "mul8_operand" "I"))
+ (match_operand:DI 3 "immediate_operand" "i")))]
+ "HOST_BITS_PER_WIDE_INT == 64
+ && GET_CODE (operands[3]) == CONST_INT
+ && (((unsigned HOST_WIDE_INT) 0xff << INTVAL (operands[2])
+ == INTVAL (operands[3]))
+ || ((unsigned HOST_WIDE_INT) 0xffff << INTVAL (operands[2])
+ == INTVAL (operands[3]))
+ || ((unsigned HOST_WIDE_INT) 0xffffffff << INTVAL (operands[2])
+ == INTVAL (operands[3])))"
+ "*
+{
+#if HOST_BITS_PER_WIDE_INT == 64
+ if ((unsigned HOST_WIDE_INT) 0xff << INTVAL (operands[2])
+ == INTVAL (operands[3]))
+ return \"insbl %1,%s2,%0\";
+ if ((unsigned HOST_WIDE_INT) 0xffff << INTVAL (operands[2])
+ == INTVAL (operands[3]))
+ return \"inswl %1,%s2,%0\";
+ if ((unsigned HOST_WIDE_INT) 0xffffffff << INTVAL (operands[2])
+ == INTVAL (operands[3]))
+ return \"insll %1,%s2,%0\";
+#endif
+ abort();
+}"
+ [(set_attr "type" "shift")])
+
;; We do not include the insXh insns because they are complex to express
;; and it does not appear that we would ever want to generate them.
;;
@@ -1669,26 +1751,10 @@
(define_insn "negsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(neg:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
- "TARGET_FP && alpha_fptm == ALPHA_FPTM_N"
+ "TARGET_FP"
"cpysn %R1,%R1,%0"
[(set_attr "type" "fadd")])
-(define_insn ""
- [(set (match_operand:SF 0 "register_operand" "=&f")
- (neg:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
- "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
- "sub%,%)%& $f31,%R1,%0"
- [(set_attr "type" "fadd")
- (set_attr "trap" "yes")])
-
-(define_insn ""
- [(set (match_operand:SF 0 "register_operand" "=f")
- (neg:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
- "TARGET_FP"
- "sub%,%)%& $f31,%R1,%0"
- [(set_attr "type" "fadd")
- (set_attr "trap" "yes")])
-
(define_insn "negdf2"
[(set (match_operand:DF 0 "register_operand" "=f")
(neg:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
@@ -1697,22 +1763,6 @@
[(set_attr "type" "fadd")])
(define_insn ""
- [(set (match_operand:DF 0 "register_operand" "=&f")
- (neg:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
- "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
- "sub%-%)%& $f31,%R1,%0"
- [(set_attr "type" "fadd")
- (set_attr "trap" "yes")])
-
-(define_insn ""
- [(set (match_operand:DF 0 "register_operand" "=f")
- (neg:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
- "TARGET_FP"
- "sub%-%)%& $f31,%R1,%0"
- [(set_attr "type" "fadd")
- (set_attr "trap" "yes")])
-
-(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=&f")
(plus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
(match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
@@ -1769,6 +1819,64 @@
[(set_attr "type" "fadd")
(set_attr "trap" "yes")])
+;; Define conversion operators between DFmode and SImode, using the cvtql
+;; instruction. To allow combine et al to do useful things, we keep the
+;; operation as a unit until after reload, at which point we split the
+;; instructions.
+;;
+;; Note that we (attempt to) only consider this optimization when the
+;; ultimate destination is memory. If we will be doing further integer
+;; processing, it is cheaper to do the truncation in the int regs.
+
+(define_insn "*cvtql"
+ [(set (match_operand:SI 0 "register_operand" "=f")
+ (unspec:SI [(match_operand:DI 1 "reg_or_fp0_operand" "fG")] 5))]
+ "TARGET_FP"
+ "cvtql%` %R1,%0"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
+(define_split
+ [(set (match_operand:SI 0 "memory_operand" "")
+ (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "")) 0))
+ (clobber (match_scratch:DI 2 ""))
+ (clobber (match_scratch:SI 3 ""))]
+ "TARGET_FP && reload_completed"
+ [(set (match_dup 2) (fix:DI (match_dup 1)))
+ (set (match_dup 3) (unspec:SI [(match_dup 2)] 5))
+ (set (match_dup 0) (match_dup 3))]
+ "")
+
+(define_split
+ [(set (match_operand:SI 0 "memory_operand" "")
+ (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "")) 0))
+ (clobber (match_scratch:DI 2 ""))]
+ "TARGET_FP && reload_completed"
+ [(set (match_dup 2) (fix:DI (match_dup 1)))
+ (set (match_dup 3) (unspec:SI [(match_dup 2)] 5))
+ (set (match_dup 0) (match_dup 3))]
+ ;; Due to REG_CANNOT_CHANGE_SIZE issues, we cannot simply use SUBREG.
+ "operands[3] = gen_rtx_REG (SImode, REGNO (operands[2]));")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "memory_operand" "=m")
+ (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")) 0))
+ (clobber (match_scratch:DI 2 "=&f"))
+ (clobber (match_scratch:SI 3 "=&f"))]
+ "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
+ "#"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "memory_operand" "=m")
+ (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")) 0))
+ (clobber (match_scratch:DI 2 "=f"))]
+ "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "#"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=&f")
(fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
@@ -1785,6 +1893,53 @@
[(set_attr "type" "fadd")
(set_attr "trap" "yes")])
+;; Likewise between SFmode and SImode.
+
+(define_split
+ [(set (match_operand:SI 0 "memory_operand" "")
+ (subreg:SI (fix:DI (float_extend:DF
+ (match_operand:SF 1 "reg_or_fp0_operand" ""))) 0))
+ (clobber (match_scratch:DI 2 ""))
+ (clobber (match_scratch:SI 3 ""))]
+ "TARGET_FP && reload_completed"
+ [(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1))))
+ (set (match_dup 3) (unspec:SI [(match_dup 2)] 5))
+ (set (match_dup 0) (match_dup 3))]
+ "")
+
+(define_split
+ [(set (match_operand:SI 0 "memory_operand" "")
+ (subreg:SI (fix:DI (float_extend:DF
+ (match_operand:SF 1 "reg_or_fp0_operand" ""))) 0))
+ (clobber (match_scratch:DI 2 ""))]
+ "TARGET_FP && reload_completed"
+ [(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1))))
+ (set (match_dup 3) (unspec:SI [(match_dup 2)] 5))
+ (set (match_dup 0) (match_dup 3))]
+ ;; Due to REG_CANNOT_CHANGE_SIZE issues, we cannot simply use SUBREG.
+ "operands[3] = gen_rtx_REG (SImode, REGNO (operands[2]));")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "memory_operand" "=m")
+ (subreg:SI (fix:DI (float_extend:DF
+ (match_operand:SF 1 "reg_or_fp0_operand" "fG"))) 0))
+ (clobber (match_scratch:DI 2 "=&f"))
+ (clobber (match_scratch:SI 3 "=&f"))]
+ "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
+ "#"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "memory_operand" "=m")
+ (subreg:SI (fix:DI (float_extend:DF
+ (match_operand:SF 1 "reg_or_fp0_operand" "fG"))) 0))
+ (clobber (match_scratch:DI 2 "=f"))]
+ "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "#"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=&f")
(fix:DI (float_extend:DF
@@ -2135,7 +2290,7 @@
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
- (if_then_else:DI
+ (if_then_else:SI
(match_operator 2 "signed_comparison_operator"
[(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
(match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
@@ -2212,7 +2367,8 @@
(clobber (match_scratch:DI 4 "=&r"))]
""
"addq %0,%1,%4\;cmov%C2 %r3,%4,%0"
- [(set_attr "type" "icmov")])
+ [(set_attr "type" "icmov")
+ (set_attr "length" "8")])
(define_split
[(set (match_operand:DI 0 "register_operand" "")
@@ -2332,7 +2488,7 @@
(define_insn "sminqi3"
[(set (match_operand:QI 0 "register_operand" "=r")
- (smin:SI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
+ (smin:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
(match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"minsb8 %r1,%2,%0"
@@ -2340,7 +2496,7 @@
(define_insn "uminqi3"
[(set (match_operand:QI 0 "register_operand" "=r")
- (umin:SI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
+ (umin:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
(match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"minub8 %r1,%2,%0"
@@ -2348,7 +2504,7 @@
(define_insn "smaxqi3"
[(set (match_operand:QI 0 "register_operand" "=r")
- (smax:SI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
+ (smax:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
(match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"maxsb8 %r1,%2,%0"
@@ -2356,7 +2512,7 @@
(define_insn "umaxqi3"
[(set (match_operand:QI 0 "register_operand" "=r")
- (umax:SI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
+ (umax:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
(match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"maxub8 %r1,%2,%0"
@@ -2364,7 +2520,7 @@
(define_insn "sminhi3"
[(set (match_operand:HI 0 "register_operand" "=r")
- (smin:SI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
+ (smin:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
(match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"minsw4 %r1,%2,%0"
@@ -2372,7 +2528,7 @@
(define_insn "uminhi3"
[(set (match_operand:HI 0 "register_operand" "=r")
- (umin:SI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
+ (umin:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
(match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"minuw4 %r1,%2,%0"
@@ -2380,7 +2536,7 @@
(define_insn "smaxhi3"
[(set (match_operand:HI 0 "register_operand" "=r")
- (smax:SI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
+ (smax:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
(match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"maxsw4 %r1,%2,%0"
@@ -2388,7 +2544,7 @@
(define_insn "umaxhi3"
[(set (match_operand:HI 0 "register_operand" "=r")
- (umax:SI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
+ (umax:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
(match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
"TARGET_MAX"
"maxuw4 %r1,%2,%0"
@@ -2602,6 +2758,17 @@
(set_attr "trap" "yes")])
(define_insn ""
+ [(set (match_operand:DF 0 "register_operand" "=&f")
+ (match_operator:DF 1 "alpha_comparison_operator"
+ [(float_extend:DF
+ (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
+ (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
+ "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
+ "cmp%-%C1%' %R2,%R3,%0"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
+(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f")
(match_operator:DF 1 "alpha_comparison_operator"
[(float_extend:DF
@@ -2613,6 +2780,17 @@
(set_attr "trap" "yes")])
(define_insn ""
+ [(set (match_operand:DF 0 "register_operand" "=&f")
+ (match_operator:DF 1 "alpha_comparison_operator"
+ [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
+ (float_extend:DF
+ (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
+ "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
+ "cmp%-%C1%' %R2,%R3,%0"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
+
+(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f")
(match_operator:DF 1 "alpha_comparison_operator"
[(match_operand:DF 2 "reg_or_fp0_operand" "fG")
@@ -2624,30 +2802,28 @@
(set_attr "trap" "yes")])
(define_insn ""
- [(set (match_operand:DF 0 "register_operand" "=f")
+ [(set (match_operand:DF 0 "register_operand" "=&f")
(match_operator:DF 1 "alpha_comparison_operator"
[(float_extend:DF
(match_operand:SF 2 "reg_or_fp0_operand" "fG"))
(float_extend:DF
(match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
"cmp%-%C1%' %R2,%R3,%0"
[(set_attr "type" "fadd")
(set_attr "trap" "yes")])
(define_insn ""
- [(set (match_operand:DF 0 "register_operand" "=&f,f")
- (if_then_else:DF
- (match_operator 3 "signed_comparison_operator"
- [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
- (match_operand:DF 2 "fp0_operand" "G,G")])
- (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
- (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
- "@
- fcmov%C3 %R4,%R1,%0
- fcmov%D3 %R4,%R5,%0"
- [(set_attr "type" "fcmov")])
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (match_operator:DF 1 "alpha_comparison_operator"
+ [(float_extend:DF
+ (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
+ (float_extend:DF
+ (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
+ "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "cmp%-%C1%' %R2,%R3,%0"
+ [(set_attr "type" "fadd")
+ (set_attr "trap" "yes")])
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f,f")
@@ -2657,21 +2833,7 @@
(match_operand:DF 2 "fp0_operand" "G,G")])
(match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
(match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
- "@
- fcmov%C3 %R4,%R1,%0
- fcmov%D3 %R4,%R5,%0"
- [(set_attr "type" "fcmov")])
-
-(define_insn ""
- [(set (match_operand:SF 0 "register_operand" "=&f,f")
- (if_then_else:SF
- (match_operator 3 "signed_comparison_operator"
- [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
- (match_operand:DF 2 "fp0_operand" "G,G")])
- (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
- (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp == ALPHA_TP_INSN"
+ "TARGET_FP"
"@
fcmov%C3 %R4,%R1,%0
fcmov%D3 %R4,%R5,%0"
@@ -2685,7 +2847,7 @@
(match_operand:DF 2 "fp0_operand" "G,G")])
(match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
(match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "TARGET_FP"
"@
fcmov%C3 %R4,%R1,%0
fcmov%D3 %R4,%R5,%0"
@@ -2699,7 +2861,7 @@
(match_operand:DF 2 "fp0_operand" "G,G")])
(float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0"))
(match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "TARGET_FP"
"@
fcmov%C3 %R4,%R1,%0
fcmov%D3 %R4,%R5,%0"
@@ -2714,7 +2876,7 @@
(match_operand:DF 2 "fp0_operand" "G,G")])
(match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
(match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "TARGET_FP"
"@
fcmov%C3 %R4,%R1,%0
fcmov%D3 %R4,%R5,%0"
@@ -2729,7 +2891,7 @@
(match_operand:DF 2 "fp0_operand" "G,G")])
(match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
(match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "TARGET_FP"
"@
fcmov%C3 %R4,%R1,%0
fcmov%D3 %R4,%R5,%0"
@@ -2744,7 +2906,7 @@
(match_operand:DF 2 "fp0_operand" "G,G")])
(float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0"))
(match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
- "TARGET_FP && alpha_tp != ALPHA_TP_INSN"
+ "TARGET_FP"
"@
fcmov%C3 %R4,%R1,%0
fcmov%D3 %R4,%R5,%0"
@@ -2855,212 +3017,84 @@
}")
(define_expand "beq"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- enum machine_mode mode;
- enum rtx_code compare_code = EQ, branch_code = NE;
-
- if (alpha_compare_fp_p)
- mode = DFmode;
- else
- {
- mode = DImode;
- /* We want to use cmpeq/bne when we can, since there is a zero-delay
- bypass between logicals and br/cmov on the 21164. But we don't
- want to force valid immediate constants into registers needlessly. */
- if (GET_CODE (alpha_compare_op1) == CONST_INT
- && ((INTVAL (alpha_compare_op1) >= -0x8000
- && INTVAL (alpha_compare_op1) < 0)
- || (INTVAL (alpha_compare_op1) > 0xff
- && INTVAL (alpha_compare_op1) < 0x8000)))
- {
- compare_code = PLUS, branch_code = EQ;
- alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1));
- }
- }
-
- operands[1] = gen_reg_rtx (mode);
- operands[2] = gen_rtx_fmt_ee (compare_code, mode,
- alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_fmt_ee (branch_code, VOIDmode,
- operands[1], CONST0_RTX (mode));
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (EQ); }")
(define_expand "bne"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- enum machine_mode mode;
- enum rtx_code compare_code = EQ, branch_code = EQ;
-
- if (alpha_compare_fp_p)
- mode = DFmode;
- else
- {
- mode = DImode;
- /* We want to use cmpeq/bne when we can, since there is a zero-delay
- bypass between logicals and br/cmov on the 21164. But we don't
- want to force valid immediate constants into registers needlessly. */
- if (GET_CODE (alpha_compare_op1) == CONST_INT
- && ((INTVAL (alpha_compare_op1) >= -0x8000
- && INTVAL (alpha_compare_op1) < 0)
- || (INTVAL (alpha_compare_op1) > 0xff
- && INTVAL (alpha_compare_op1) < 0x8000)))
- {
- compare_code = PLUS, branch_code = NE;
- alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1));
- }
- }
-
- operands[1] = gen_reg_rtx (mode);
- operands[2] = gen_rtx_fmt_ee (compare_code, mode,
- alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_fmt_ee (branch_code, VOIDmode,
- operands[1], CONST0_RTX (mode));
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (NE); }")
(define_expand "blt"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
- operands[1] = gen_reg_rtx (mode);
- operands[2] = gen_rtx_LT (mode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (mode));
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (LT); }")
(define_expand "ble"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
- operands[1] = gen_reg_rtx (mode);
- operands[2] = gen_rtx_LE (mode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (mode));
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (LE); }")
(define_expand "bgt"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- if (alpha_compare_fp_p)
- {
- operands[1] = gen_reg_rtx (DFmode);
- operands[2] = gen_rtx_LT (DFmode, alpha_compare_op1, alpha_compare_op0);
- operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (DFmode));
- }
- else
- {
- operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx_LE (DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
- }
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (GT); }")
(define_expand "bge"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- if (alpha_compare_fp_p)
- {
- operands[1] = gen_reg_rtx (DFmode);
- operands[2] = gen_rtx_LE (DFmode, alpha_compare_op1, alpha_compare_op0);
- operands[3] = gen_rtx_NE (VOIDmode, operands[1], CONST0_RTX (DFmode));
- }
- else
- {
- operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx_LT (DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
- }
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (GE); }")
(define_expand "bltu"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx_LTU (DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_NE (VOIDmode, operands[1], const0_rtx);
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (LTU); }")
(define_expand "bleu"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx_LEU (DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_NE (VOIDmode, operands[1], const0_rtx);
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (LEU); }")
(define_expand "bgtu"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx_LEU (DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (GTU); }")
(define_expand "bgeu"
- [(set (match_dup 1) (match_dup 2))
- (set (pc)
- (if_then_else (match_dup 3)
+ [(set (pc)
+ (if_then_else (match_dup 1)
(label_ref (match_operand 0 "" ""))
(pc)))]
""
- "
-{
- operands[1] = gen_reg_rtx (DImode);
- operands[2] = gen_rtx_LTU (DImode, alpha_compare_op0, alpha_compare_op1);
- operands[3] = gen_rtx_EQ (VOIDmode, operands[1], const0_rtx);
-}")
+ "{ operands[1] = alpha_emit_conditional_branch (GEU); }")
(define_expand "seq"
[(set (match_operand:DI 0 "register_operand" "")
@@ -3191,7 +3225,7 @@
(define_expand "movsicc"
[(set (match_operand:SI 0 "register_operand" "")
- (if_then_else:DI (match_operand 1 "comparison_operator" "")
+ (if_then_else:SI (match_operand 1 "comparison_operator" "")
(match_operand:SI 2 "reg_or_8bit_operand" "")
(match_operand:SI 3 "reg_or_8bit_operand" "")))]
""
@@ -3523,10 +3557,13 @@
if (GET_CODE (operands[0]) == SYMBOL_REF)
{
extern char *savealloc ();
- char *symbol = XSTR (operands[0], 0);
- char *linksym = savealloc (strlen (symbol) + 6);
+ char *linksym, *symbol = XSTR (operands[0], 0);
rtx linkage;
+ if (*symbol == '*')
+ symbol++;
+ linksym = savealloc (strlen (symbol) + 6);
+
alpha_need_linkage (symbol, 0);
linksym[0] = '$';
@@ -3628,10 +3665,13 @@
if (GET_CODE (operands[1]) == SYMBOL_REF)
{
extern char *savealloc ();
- char *symbol = XSTR (operands[1], 0);
- char *linksym = savealloc (strlen (symbol) + 6);
+ char *linksym, *symbol = XSTR (operands[1], 0);
rtx linkage;
+ if (*symbol == '*')
+ symbol++;
+ linksym = savealloc (strlen (symbol) + 6);
+
alpha_need_linkage (symbol, 0);
linksym[0] = '$';
strcpy (linksym+1, symbol);
@@ -3662,7 +3702,8 @@
jsr $26,($27),0\;ldgp $29,0($26)
bsr $26,$%0..ng
jsr $26,%0\;ldgp $29,0($26)"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "12,*,12")])
(define_insn ""
[(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,i"))
@@ -3673,7 +3714,8 @@
jsr $26,(%0)
bsr $26,%0
jsr $26,%0"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "*,*,12")])
(define_insn ""
[(call (mem:DI (match_operand:DI 0 "call_operand" "r,i"))
@@ -3686,7 +3728,8 @@
"@
bis %2,%2,$27\;jsr $26,0\;ldq $27,0($29)
ldq $27,%2\;jsr $26,%0\;ldq $27,0($29)"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "12,16")])
(define_insn ""
[(set (match_operand 0 "register_operand" "=rf,rf,rf")
@@ -3699,7 +3742,8 @@
jsr $26,($27),0\;ldgp $29,0($26)
bsr $26,$%1..ng
jsr $26,%1\;ldgp $29,0($26)"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "12,*,12")])
(define_insn ""
[(set (match_operand 0 "register_operand" "=rf,rf,rf")
@@ -3711,7 +3755,8 @@
jsr $26,(%1)
bsr $26,%1
jsr $26,%1"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "*,*,12")])
(define_insn ""
[(set (match_operand 0 "register_operand" "")
@@ -3725,7 +3770,8 @@
"@
bis %3,%3,$27\;jsr $26,0\;ldq $27,0($29)
ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "length" "12,16")])
;; Call subroutine returning any type.
@@ -3762,7 +3808,8 @@
(define_insn "blockage"
[(unspec_volatile [(const_int 0)] 1)]
""
- "")
+ ""
+ [(set_attr "length" "0")])
(define_insn "jump"
[(set (pc)
@@ -3777,18 +3824,21 @@
"ret $31,($26),1"
[(set_attr "type" "ibr")])
+;; Use a different pattern for functions which have non-trivial
+;; epilogues so as not to confuse jump and reorg.
+(define_insn "return_internal"
+ [(use (reg:DI 26))
+ (return)]
+ ""
+ "ret $31,($26),1"
+ [(set_attr "type" "ibr")])
+
(define_insn "indirect_jump"
[(set (pc) (match_operand:DI 0 "register_operand" "r"))]
""
"jmp $31,(%0),0"
[(set_attr "type" "ibr")])
-(define_insn "nop"
- [(const_int 0)]
- ""
- "bis $31,$31,$31"
- [(set_attr "type" "ilog")])
-
(define_expand "tablejump"
[(use (match_operand:SI 0 "register_operand" ""))
(use (match_operand:SI 1 "" ""))]
@@ -3883,7 +3933,8 @@
else
return \"addq %0,$29,%2\;jmp $31,(%2),0\";
}"
- [(set_attr "type" "ibr")])
+ [(set_attr "type" "ibr")
+ (set_attr "length" "8")])
(define_insn ""
[(set (pc)
@@ -3947,7 +3998,7 @@
;; Technically the type for call_pal is jsr, but we use that for determining
;; if we need a GP. Use ibr instead since it has the same EV5 scheduling
;; characteristics.
-(define_insn ""
+(define_insn "imb"
[(unspec_volatile [(const_int 0)] 0)]
""
"call_pal 0x86"
@@ -4291,24 +4342,31 @@
{
if (TARGET_BUILD_CONSTANTS)
{
-#if HOST_BITS_PER_WIDE_INT == 64
- HOST_WIDE_INT i;
+ HOST_WIDE_INT i0, i1;
if (GET_CODE (operands[1]) == CONST_INT)
- i = INTVAL (operands[1]);
+ {
+ i0 = INTVAL (operands[1]);
+ i1 = -(i0 < 0);
+ }
else if (GET_CODE (operands[1]) == CONST_DOUBLE)
- i = CONST_DOUBLE_LOW (operands[1]);
+ {
+#if HOST_BITS_PER_WIDE_INT >= 64
+ i0 = CONST_DOUBLE_LOW (operands[1]);
+ i1 = -(i0 < 0);
+#else
+ i0 = CONST_DOUBLE_LOW (operands[1]);
+ i1 = CONST_DOUBLE_HIGH (operands[1]);
+#endif
+ }
else
abort();
- tem = alpha_emit_set_long_const (operands[0], i);
+ tem = alpha_emit_set_long_const (operands[0], i0, i1);
if (rtx_equal_p (tem, operands[0]))
DONE;
else
operands[1] = tem;
-#else
- abort();
-#endif
}
else
{
@@ -5041,6 +5099,74 @@
}
}")
+;; This is used by alpha_expand_prolog to do the same thing as above,
+;; except we cannot at that time generate new basic blocks, so we hide
+;; the loop in this one insn.
+
+(define_insn "prologue_stack_probe_loop"
+ [(unspec_volatile [(match_operand 0 "register_operand" "r")
+ (match_operand 1 "register_operand" "r")] 5)]
+ ""
+ "*
+{
+ static int label_no;
+ int count_regno = REGNO (operands[0]);
+ int ptr_regno = REGNO (operands[1]);
+ char label[64];
+
+ /* Ho hum, output the hard way to get the label at the beginning of
+ the line. Wish there were a magic char you could get
+ asm_output_printf to do that. Then we could use %= as well and
+ get rid of the label_no bits here too. */
+
+ ASM_GENERATE_INTERNAL_LABEL (label, \"LSC\", label_no);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LSC\", label_no++);
+
+ fprintf (asm_out_file, \"\\tstq $31,-8192($%d)\\n\", ptr_regno);
+ fprintf (asm_out_file, \"\\tsubq $%d,1,$%d\\n\", count_regno, count_regno);
+ fprintf (asm_out_file, \"\\tlda $%d,-8192($%d)\\n\", ptr_regno, ptr_regno);
+ fprintf (asm_out_file, \"\\tbne $%d,\", count_regno);
+ assemble_name (asm_out_file, label);
+ putc ('\\n', asm_out_file);
+
+ return \"\";
+}"
+ [(set_attr "length" "16")
+ (set_attr "type" "multi")])
+
+(define_expand "prologue"
+ [(clobber (const_int 0))]
+ ""
+ "alpha_expand_prologue (); DONE;")
+
+(define_insn "init_fp"
+ [(set (match_operand:DI 0 "register_operand" "r")
+ (match_operand:DI 1 "register_operand" "r"))
+ (clobber (mem:BLK (match_operand:DI 2 "register_operand" "r")))]
+ ""
+ "bis %1,%1,%0")
+
+(define_expand "epilogue"
+ [(clobber (const_int 0))]
+ ""
+ "alpha_expand_epilogue (); DONE;")
+
+(define_expand "eh_epilogue"
+ [(use (match_operand:DI 0 "register_operand" "r"))
+ (use (match_operand:DI 1 "register_operand" "r"))
+ (use (match_operand:DI 2 "register_operand" "r"))]
+ "! TARGET_OPEN_VMS"
+ "
+{
+ alpha_eh_epilogue_sp_ofs = operands[1];
+ if (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != 26)
+ {
+ rtx ra = gen_rtx_REG (Pmode, 26);
+ emit_move_insn (ra, operands[2]);
+ operands[2] = ra;
+ }
+}")
+
(define_expand "builtin_longjmp"
[(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)]
"! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT"
@@ -5068,12 +5194,23 @@
(define_insn "builtin_setjmp_receiver"
[(unspec_volatile [(match_operand 0 "" "")] 2)]
"! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT && TARGET_AS_CAN_SUBTRACT_LABELS"
- "\\n$LSJ%=:\;ldgp $29,$LSJ%=-%l0($27)")
+ "\\n$LSJ%=:\;ldgp $29,$LSJ%=-%l0($27)"
+ [(set_attr "length" "8")
+ (set_attr "type" "multi")])
(define_insn ""
[(unspec_volatile [(match_operand 0 "" "")] 2)]
"! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT"
- "br $27,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($27)")
+ "br $29,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($29)"
+ [(set_attr "length" "12")
+ (set_attr "type" "multi")])
+
+(define_insn "exception_receiver"
+ [(unspec_volatile [(const_int 0)] 7)]
+ "! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT"
+ "br $29,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($29)"
+ [(set_attr "length" "12")
+ (set_attr "type" "multi")])
(define_expand "nonlocal_goto_receiver"
[(unspec_volatile [(const_int 0)] 1)
@@ -5104,7 +5241,9 @@
(clobber (reg:DI 25))
(clobber (reg:DI 0))]
"TARGET_OPEN_VMS"
- "lda $0,OTS$HOME_ARGS\;ldq $0,8($0)\;jsr $0,OTS$HOME_ARGS")
+ "lda $0,OTS$HOME_ARGS\;ldq $0,8($0)\;jsr $0,OTS$HOME_ARGS"
+ [(set_attr "length" "16")
+ (set_attr "type" "multi")])
;; Close the trap shadow of preceeding instructions. This is generated
;; by alpha_reorg.
@@ -5114,3 +5253,53 @@
""
"trapb"
[(set_attr "type" "misc")])
+
+;; No-op instructions used by machine-dependant reorg to preserve
+;; alignment for instruction issue.
+
+(define_insn "nop"
+ [(const_int 0)]
+ ""
+ "nop"
+ [(set_attr "type" "ilog")])
+
+(define_insn "fnop"
+ [(const_int 1)]
+ "TARGET_FP"
+ "fnop"
+ [(set_attr "type" "fcpys")])
+
+(define_insn "unop"
+ [(const_int 2)]
+ ""
+ "unop")
+
+(define_insn "realign"
+ [(unspec_volatile [(match_operand 0 "immediate_operand" "i")] 6)]
+ ""
+ ".align %0 #realign")
+
+;; Peepholes go at the end.
+
+;; Optimize sign-extension of SImode loads. This shows up in the wake of
+;; reload when converting fp->int.
+;;
+;; ??? What to do now that we actually care about the packing and
+;; alignment of instructions? Perhaps reload can be enlightened, or
+;; the peephole pass moved up after reload but before sched2?
+;
+;(define_peephole
+; [(set (match_operand:SI 0 "register_operand" "=r")
+; (match_operand:SI 1 "memory_operand" "m"))
+; (set (match_operand:DI 2 "register_operand" "=r")
+; (sign_extend:DI (match_dup 0)))]
+; "dead_or_set_p (insn, operands[0])"
+; "ldl %2,%1")
+;
+;(define_peephole
+; [(set (match_operand:SI 0 "register_operand" "=r")
+; (match_operand:SI 1 "hard_fp_register_operand" "f"))
+; (set (match_operand:DI 2 "register_operand" "=r")
+; (sign_extend:DI (match_dup 0)))]
+; "TARGET_CIX && dead_or_set_p (insn, operands[0])"
+; "ftois %1,%2")
diff --git a/gcc/config/alpha/crtbegin.asm b/gcc/config/alpha/crtbegin.asm
index c28440d8a24..f954f1ab0d3 100644
--- a/gcc/config/alpha/crtbegin.asm
+++ b/gcc/config/alpha/crtbegin.asm
@@ -50,6 +50,8 @@ __CTOR_LIST__:
__DTOR_LIST__:
.quad -1
+.section .eh_frame,"aw"
+__EH_FRAME_BEGIN__:
#
# Fragment of the ELF _fini routine that invokes our dtor cleanup.
@@ -67,18 +69,33 @@ __DTOR_LIST__:
1: ldgp $29,0($29)
jsr $26,__do_global_dtors_aux
+ # Ideally this call would go in crtend.o, except that we can't
+ # get hold of __EH_FRAME_BEGIN__ there.
+
+ jsr $26,__do_frame_takedown
+
# Must match the alignment we got from crti.o else we get
# zero-filled holes in our _fini function and then SIGILL.
.align 3
#
+ # Fragment of the ELF _init routine that sets up the frame info.
+ #
+
+.section .init,"ax"
+ br $29,1f
+1: ldgp $29,0($29)
+ jsr $26,__do_frame_setup
+ .align 3
+
+ #
# Invoke our destructors in order.
#
.data
# Support recursive calls to exit.
-9: .quad __DTOR_LIST__
+$ptr: .quad __DTOR_LIST__
.text
@@ -86,15 +103,14 @@ __DTOR_LIST__:
.ent __do_global_dtors_aux
__do_global_dtors_aux:
- ldgp $29,0($27)
lda $30,-16($30)
.frame $30,16,$26,0
stq $9,8($30)
stq $26,0($30)
.mask 0x4000200,-16
- .prologue 1
+ .prologue 0
- lda $9,9b
+ lda $9,$ptr
br 1f
0: stq $1,0($9)
jsr $26,($27)
@@ -109,3 +125,68 @@ __do_global_dtors_aux:
ret
.end __do_global_dtors_aux
+
+ #
+ # Install our frame info.
+ #
+
+ # ??? How can we rationally keep this size correct?
+
+.section .bss
+ .type $object,@object
+ .align 3
+$object:
+ .zero 48
+ .size $object, 48
+
+.text
+
+ .align 3
+ .ent __do_frame_setup
+
+__do_frame_setup:
+ ldgp $29,0($27)
+ lda $30,-16($30)
+ .frame $30,16,$26,0
+ stq $26,0($30)
+ .mask 0x4000000,-16
+ .prologue 1
+
+ lda $1,__register_frame_info
+ beq $1,0f
+ lda $16,__EH_FRAME_BEGIN__
+ lda $17,$object
+ jsr $26,__register_frame_info
+ ldq $26,0($30)
+0: lda $30,16($30)
+ ret
+
+ .end __do_frame_setup
+
+ #
+ # Remove our frame info.
+ #
+
+ .align 3
+ .ent __do_frame_takedown
+
+__do_frame_takedown:
+ ldgp $29,0($27)
+ lda $30,-16($30)
+ .frame $30,16,$26,0
+ stq $26,0($30)
+ .mask 0x4000000,-16
+ .prologue 1
+
+ lda $1,__deregister_frame_info
+ beq $1,0f
+ lda $16,__EH_FRAME_BEGIN__
+ jsr $26,__deregister_frame_info
+ ldq $26,0($30)
+0: lda $30,16($30)
+ ret
+
+ .end __do_frame_takedown
+
+.weak __register_frame_info
+.weak __deregister_frame_info
diff --git a/gcc/config/alpha/crtend.asm b/gcc/config/alpha/crtend.asm
index 36f11b9723a..4a0cc5e9f61 100644
--- a/gcc/config/alpha/crtend.asm
+++ b/gcc/config/alpha/crtend.asm
@@ -50,6 +50,9 @@ __CTOR_END__:
__DTOR_END__:
.quad 0
+.section .eh_frame,"aw"
+__FRAME_END__:
+ .quad 0
#
# Fragment of the ELF _init routine that invokes our ctor startup
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index d28847c44d9..89eda748c06 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#define OBJECT_FORMAT_ELF
#define DBX_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
@@ -34,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#define CC1_SPEC "%{G*}"
#undef ASM_SPEC
-#define ASM_SPEC "%{G*} %{relax:-relax}"
+#define ASM_SPEC "%{G*} %{relax:-relax} %{gdwarf*:-no-mdebug}"
#undef LINK_SPEC
#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
@@ -43,24 +44,27 @@ Boston, MA 02111-1307, USA. */
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}}\
+ %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \
%{static:-static}}"
/* Output at beginning of assembler file. */
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- output_file_directive (FILE, main_input_filename); \
+do { \
+ if (write_symbols != DWARF2_DEBUG) \
+ { \
+ alpha_write_verstamp (FILE); \
+ output_file_directive (FILE, main_input_filename); \
+ } \
fprintf (FILE, "\t.set noat\n"); \
- fprintf (FILE, "\t.set noreorder\n"); \
+ fprintf (FILE, "\t.set noreorder\n"); \
if (TARGET_BWX | TARGET_MAX | TARGET_CIX) \
{ \
fprintf (FILE, "\t.arch %s\n", \
(alpha_cpu == PROCESSOR_EV6 ? "ev6" \
: TARGET_MAX ? "pca56" : "ev56")); \
} \
-}
+} while (0)
extern void output_file_directive ();
diff --git a/gcc/config/alpha/linux-ecoff.h b/gcc/config/alpha/linux-ecoff.h
index a6cd5b238c8..bc271506b5c 100644
--- a/gcc/config/alpha/linux-ecoff.h
+++ b/gcc/config/alpha/linux-ecoff.h
@@ -22,8 +22,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ECOFF)");
-#undef SUB_CPP_PREDEFINES
-#define SUB_CPP_PREDEFINES "-D__ECOFF__"
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC "-D__ECOFF__"
#undef LINK_SPEC
#define LINK_SPEC "-G 8 %{O*:-O3} %{!O*:-O1}"
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 40aa332d189..90009f1c5d0 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -22,13 +22,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ELF)");
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
#undef SUB_CPP_PREDEFINES
-#define SUB_CPP_PREDEFINES "-D__ELF__"
+#define SUB_CPP_PREDEFINES "-D__ELF__"
#ifdef USE_GNULIBC_1
-#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
#else
-#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#endif
#ifndef USE_GNULIBC_1
@@ -39,7 +43,5 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef USE_GNULIBC_1
#undef LIB_SPEC
#define LIB_SPEC \
- "%{shared: -lc} \
- %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
- %{profile:-lc_p} %{!profile: -lc}}"
+"%{shared:-lc}%{!shared:%{pthread:-lpthread }%{profile:-lc_p}%{!profile:-lc}} "
#endif
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index 5eeee1f0334..01b4e9daeea 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for Alpha Linux-based GNU systems.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Richard Henderson.
This file is part of GNU CC.
@@ -23,45 +23,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "\
--D__alpha -D__alpha__ -D__linux__ -D__linux -D_LONGLONG -Dlinux -Dunix \
--Asystem(linux) -Acpu(alpha) -Amachine(alpha) " SUB_CPP_PREDEFINES
+#define CPP_PREDEFINES \
+"-Dlinux -Dunix -Asystem(linux) -D_LONGLONG -D__alpha__ " \
+SUB_CPP_PREDEFINES
#undef LIB_SPEC
#define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}"
/* Generate calls to memcpy, etc., not bcopy, etc. */
-#define TARGET_MEM_FUNCTIONS
+#define TARGET_MEM_FUNCTIONS 1
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
fputs ("\tlda $28,_mcount\n\tjsr $28,($28),_mcount\n", (FILE))
/* Show that we need a GP when profiling. */
-#define TARGET_PROFILING_NEEDS_GP
+#define TARGET_PROFILING_NEEDS_GP 1
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function.
-
- This differs from the standard version in that:
-
- We do not initialize the "hint" field because it only has an 8k
- range and so the target is in range of something on the stack.
- Omitting the hint saves a bogus branch-prediction cache line load.
-
- GNU/Linux always has an executable stack -- no need for a system call. */
-
-#undef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- rtx _addr; \
- \
- _addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
- emit_move_insn (gen_rtx (MEM, Pmode, _addr), (FNADDR)); \
- _addr = memory_address (Pmode, plus_constant ((TRAMP), 24)); \
- emit_move_insn (gen_rtx (MEM, Pmode, _addr), (CXT)); \
- \
- emit_insn (gen_rtx (UNSPEC_VOLATILE, VOIDmode, \
- gen_rtvec (1, const0_rtx), 0)); \
-}
+/* Don't care about faults in the prologue. */
+#undef TARGET_CAN_FAULT_IN_PROLOGUE
+#define TARGET_CAN_FAULT_IN_PROLOGUE 1
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index ae4170d25e3..956961f7cf3 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -27,8 +27,8 @@ Boston, MA 02111-1307, USA. */
/* Names to predefine in the preprocessor for this target machine. */
#define CPP_PREDEFINES "\
--Dunix -D__osf__ -D__alpha -D__alpha__ -D_LONGLONG -DSYSTYPE_BSD \
--D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4) -Acpu(alpha) -Amachine(alpha)"
+-Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD \
+-D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4)"
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
@@ -103,3 +103,25 @@ Boston, MA 02111-1307, USA. */
%{.s:%i} %{!.s:%g.s}}}"
#endif
+
+/* Indicate that we have a stamp.h to use. */
+#ifndef CROSS_COMPILE
+#define HAVE_STAMP_H 1
+#endif
+
+/* Attempt to turn on access permissions for the stack. */
+
+#define TRANSFER_FROM_TRAMPOLINE \
+void \
+__enable_execute_stack (addr) \
+ void *addr; \
+{ \
+ long size = getpagesize (); \
+ long mask = ~(size-1); \
+ char *page = (char *) (((long) addr) & mask); \
+ char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ \
+ /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
+ if (mprotect (page, end - page, 7) < 0) \
+ perror ("mprotect of trampoline code"); \
+}
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index d43a60d67a2..44cf5bf82df 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -31,20 +31,13 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
-"-D__ALPHA -Dvms -DVMS -D__alpha__ -D__alpha -D__vms__ -D__VMS__\
- -Asystem(vms) -Acpu(alpha) -Amachine(alpha)"
+"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem(vms)"
-#undef CPP_SPEC
-#define CPP_SPEC "\
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC "\
%{mfloat-ieee:-D__IEEE_FLOAT} \
%{mfloat-vax:-D__G_FLOAT} \
-%{!mfloat-vax:-D__IEEE_FLOAT} \
-%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \
-%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
-%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
-%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C}"
+%{!mfloat-vax:-D__IEEE_FLOAT}"
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
@@ -289,9 +282,11 @@ extern struct rtx_def *alpha_arg_info_reg_val ();
#define LINK_SECTION_ASM_OP ".link"
#define READONLY_SECTION_ASM_OP ".rdata"
#define LITERALS_SECTION_ASM_OP ".literals"
+#define CTORS_SECTION_ASM_OP ".ctors"
+#define DTORS_SECTION_ASM_OP ".dtors"
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_link, in_rdata, in_literals
+#define EXTRA_SECTIONS in_link, in_rdata, in_literals, in_ctors, in_dtors
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
@@ -321,6 +316,24 @@ literals_section () \
fprintf (asm_out_file, "%s\n", LITERALS_SECTION_ASM_OP); \
in_section = in_literals; \
} \
+} \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+} \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
}
#undef ASM_OUTPUT_ADDR_DIFF_ELT
@@ -343,6 +356,19 @@ literals_section () \
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
{ ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. */
+
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+do { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+} while (0)
+
#define NO_MD_PROTOTYPES
/* Output assembler code for a block containing the constant parts
@@ -372,19 +398,28 @@ literals_section () \
CXT is an RTX for the static chain value for the function. */
#undef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- emit_move_insn (gen_rtx (MEM, Pmode, \
- memory_address (Pmode, \
- plus_constant ((TRAMP), 16))), \
- (FNADDR)); \
- emit_move_insn (gen_rtx (MEM, Pmode, \
- memory_address (Pmode, \
- plus_constant ((TRAMP), 24))), \
- (CXT)); \
-}
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
+ alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, -1)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctors_section (); \
+ fprintf (FILE, "\t.quad "); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
-#undef TRANSFER_FROM_TRAMPOLINE
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtors_section (); \
+ fprintf (FILE, "\t.quad "); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
(vms_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
diff --git a/gcc/config/alpha/win-nt.h b/gcc/config/alpha/win-nt.h
index 30c8d6d07cd..a3aa27519b6 100644
--- a/gcc/config/alpha/win-nt.h
+++ b/gcc/config/alpha/win-nt.h
@@ -29,10 +29,8 @@ Boston, MA 02111-1307, USA. */
/* Names to predefine in the preprocessor for this target machine. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-DWIN32 -D_WIN32 -DWINNT -D__STDC__=0 -DALMOST_STDC\
- -D_M_ALPHA -D_ALPHA_ -D__alpha -D__alpha__\
- -D_LONGLONG -D__unaligned= -D__stdcall= \
- -Asystem(winnt) -Acpu(alpha) -Amachine(alpha)"
+#define CPP_PREDEFINES "-DWIN32 -D_WIN32 -DWINNT -D__STDC__=0 -DALMOST_STDC \
+-D_M_ALPHA -D_ALPHA_ -D_LONGLONG -D__unaligned= -D__stdcall= -Asystem(winnt)"
#undef ASM_SPEC
#undef ASM_FINAL_SPEC
@@ -101,71 +99,31 @@ Boston, MA 02111-1307, USA. */
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function.
-
- This differs from the standard version in that:
-
- We are not passed the current address in any register, and so have to
- load it ourselves.
-
- We do not initialize the "hint" field because it only has an 8k
- range and so the target is in range of something on the stack.
- Omitting the hint saves a bogus branch-prediction cache line load.
-
- Always have an executable stack -- no need for a system call.
- */
+ CXT is an RTX for the static chain value for the function. */
#undef INITIALIZE_TRAMPOLINE
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-{ \
- rtx _addr, _val; \
- \
- _addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
- _val = force_reg(Pmode, (FNADDR)); \
- emit_move_insn (gen_rtx (MEM, SImode, _addr), \
- gen_rtx (SUBREG, SImode, _val, 0)); \
- _addr = memory_address (Pmode, plus_constant ((TRAMP), 20)); \
- _val = force_reg(Pmode, (CXT)); \
- emit_move_insn (gen_rtx (MEM, SImode, _addr), \
- gen_rtx (SUBREG, SImode, _val, 0)); \
- \
- emit_insn (gen_rtx (UNSPEC_VOLATILE, VOIDmode, \
- gen_rtvec (1, const0_rtx), 0)); \
-}
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
+ alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 20, 12)
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
-#undef ASM_OUTPUT_MI_THUNK
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
- char *fn_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)); \
+ char *op, *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
+ int reg; \
\
- fprintf (FILE, "\t.ent "); \
- assemble_name (FILE, alpha_function_name); \
- fputc ('\n', FILE); \
- ASM_OUTPUT_LABEL (FILE, alpha_function_name); \
- fprintf (FILE, "\t.frame $30,0,$26,0\n"); \
- fprintf (FILE, "\t.prologue 1\n"); \
+ /* Mark end of prologue. */ \
+ output_end_prologue (FILE); \
\
/* Rely on the assembler to macro expand a large delta. */ \
- fprintf (FILE, "\tlda $16,%ld($16)\n", (long)(DELTA)); \
+ reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
+ fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
\
+ op = "jsr"; \
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
- { \
- fprintf (FILE, "\tbr $31,"); \
- assemble_name (FILE, fn_name); \
- fputc ('\n', FILE); \
- } \
- else \
- { \
- fprintf (FILE, "\tjmp $31,"); \
- assemble_name (FILE, fn_name); \
- fputc ('\n', FILE); \
- } \
- \
- fprintf (FILE, "\t.end "); \
- assemble_name (FILE, alpha_function_name); \
+ op = "br"; \
+ fprintf (FILE, "\t%s $31,", op); \
+ assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} while (0)
-
diff --git a/gcc/config/alpha/x-alpha b/gcc/config/alpha/x-alpha
index 99197479798..9686ab96472 100644
--- a/gcc/config/alpha/x-alpha
+++ b/gcc/config/alpha/x-alpha
@@ -1 +1,2 @@
CLIB=-lmld
+EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h
diff --git a/gcc/config/alpha/xm-linux.h b/gcc/config/alpha/xm-linux.h
deleted file mode 100644
index b85269b58e0..00000000000
--- a/gcc/config/alpha/xm-linux.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#undef USE_BFD
-#define USE_BFD
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 7272cc927c8..64aec442508 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -1366,15 +1366,6 @@ arc_eligible_for_epilogue_delay (trial, slot)
/* PIC */
-/* Set up PIC-specific rtl. This should not cause any insns
- to be emitted. */
-
-void
-arc_initialize_pic ()
-{
- /* nothing to do */
-}
-
/* Emit special PIC prologues and epilogues. */
void
@@ -1910,7 +1901,7 @@ arc_final_prescan_insn (insn, opvec, noperands)
record_cc_ref (insn);
/* Allow -mdebug-ccfsm to turn this off so we can see how well it does.
- We can't do this in macro FINAL_PRESCAN_INSN because it's called from
+ We can't do this in macro FINAL_PRESCAN_INSN because its called from
final_scan_insn which has `optimize' as a local. */
if (optimize < 2 || TARGET_NO_COND_EXEC)
return;
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 0ddc91afb89..ab1dc153116 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1242,7 +1242,6 @@ do { \
included in functions which used inline functions and were compiled to
assembly language.) */
-#define INITIALIZE_PIC arc_initialize_pic ()
#define FINALIZE_PIC arc_finalize_pic ()
/* A C expression that is nonzero if X is a legitimate immediate
@@ -1583,7 +1582,7 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); } while (0)
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
/* ??? The arc doesn't have full 32 bit pointers, but making this PSImode has
- it's own problems (you have to add extendpsisi2 and trucnsipsi2 but how does
+ its own problems (you have to add extendpsisi2 and trucnsipsi2 but how does
one do it without getting excess code?). Try to avoid it. */
#define Pmode SImode
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 28614a2d2e9..a4719c61379 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "reload.h"
#include "tree.h"
#include "expr.h"
+#include "toplev.h"
/* The maximum number of insns skipped which will be conditionalised if
possible. */
@@ -54,7 +55,7 @@ static int arm_naked_function_p PROTO ((tree));
static void init_fpa_table PROTO ((void));
static enum machine_mode select_dominance_cc_mode PROTO ((enum rtx_code, rtx,
rtx, HOST_WIDE_INT));
-static HOST_WIDE_INT add_constant PROTO ((rtx, enum machine_mode));
+static HOST_WIDE_INT add_constant PROTO ((rtx, enum machine_mode, int *));
static void dump_table PROTO ((rtx));
static int fixit PROTO ((rtx, enum machine_mode, int));
static rtx find_barrier PROTO ((rtx, int));
@@ -220,7 +221,7 @@ arm_override_options ()
{
int arm_thumb_aware = 0;
int flags = 0;
- int i;
+ unsigned i;
struct arm_cpu_select *ptr;
static struct cpu_default {
int cpu;
@@ -309,7 +310,7 @@ arm_override_options ()
assembler and linker, and the ARMASM assembler seems to lack some
required directives. */
if (flag_pic)
- warning ("Position independent code not supported. Ignored");
+ warning ("Position independent code not supported");
if (TARGET_APCS_FLOAT)
warning ("Passing floating point arguments in fp regs not yet supported");
@@ -328,7 +329,7 @@ arm_override_options ()
assume the user has an FPA.
Note: this does not prevent use of floating point instructions,
-msoft-float does that. */
- if (tune_flags & FL_CO_PROC == 0)
+ if ((tune_flags & FL_CO_PROC) == 0)
arm_fpu = FP_SOFT3;
arm_fast_multiply = (flags & FL_FAST_MULT) != 0;
@@ -405,13 +406,14 @@ int
const_ok_for_arm (i)
HOST_WIDE_INT i;
{
- unsigned HOST_WIDE_INT mask = ~0xFF;
+ unsigned HOST_WIDE_INT mask = ~(unsigned HOST_WIDE_INT)0xFF;
/* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must
be all zero, or all one. */
if ((i & ~(unsigned HOST_WIDE_INT) 0xffffffff) != 0
&& ((i & ~(unsigned HOST_WIDE_INT) 0xffffffff)
- != (((HOST_WIDE_INT) -1) & ~(unsigned HOST_WIDE_INT) 0xffffffff)))
+ != ((~(unsigned HOST_WIDE_INT) 0)
+ & ~(unsigned HOST_WIDE_INT) 0xffffffff)))
return FALSE;
/* Fast return for 0 and powers of 2 */
@@ -425,7 +427,7 @@ const_ok_for_arm (i)
mask =
(mask << 2) | ((mask & (unsigned HOST_WIDE_INT) 0xffffffff)
>> (32 - 2)) | ~((unsigned HOST_WIDE_INT) 0xffffffff);
- } while (mask != ~0xFF);
+ } while (mask != ~(unsigned HOST_WIDE_INT) 0xFF);
return FALSE;
}
@@ -481,8 +483,6 @@ arm_split_constant (code, mode, val, target, source, subtargets)
|| (GET_CODE (target) == REG && GET_CODE (source) == REG
&& REGNO (target) != REGNO (source)))
{
- rtx temp;
-
if (arm_gen_constant (code, mode, val, target, source, 1, 0)
> arm_constant_limit + (code != SET))
{
@@ -526,7 +526,6 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
int subtargets;
int generate;
{
- int can_add = 0;
int can_invert = 0;
int can_negate = 0;
int can_negate_initial = 0;
@@ -538,7 +537,6 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
int clear_zero_bit_copies = 0;
int set_zero_bit_copies = 0;
int insns = 0;
- rtx new_src;
unsigned HOST_WIDE_INT temp1, temp2;
unsigned HOST_WIDE_INT remainder = val & 0xffffffff;
@@ -702,7 +700,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
{
if (generate)
{
- new_src = subtargets ? gen_reg_rtx (mode) : target;
+ rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
emit_insn (gen_rtx (SET, VOIDmode, new_src,
GEN_INT (temp1)));
emit_insn (gen_ashrsi3 (target, new_src,
@@ -717,7 +715,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
{
if (generate)
{
- new_src = subtargets ? gen_reg_rtx (mode) : target;
+ rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
emit_insn (gen_rtx (SET, VOIDmode, new_src,
GEN_INT (temp1)));
emit_insn (gen_ashrsi3 (target, new_src,
@@ -743,10 +741,10 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if ((((temp2 | (temp2 << i)) & 0xffffffff) == remainder)
&& ! const_ok_for_arm (temp2))
{
- insns = arm_gen_constant (code, mode, temp2,
- new_src = (subtargets
- ? gen_reg_rtx (mode)
- : target),
+ rtx new_src = (subtargets
+ ? (generate ? gen_reg_rtx (mode) : NULL_RTX)
+ : target);
+ insns = arm_gen_constant (code, mode, temp2, new_src,
source, subtargets, generate);
source = new_src;
if (generate)
@@ -765,10 +763,10 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (((temp1 | (temp1 >> i)) == remainder)
&& ! const_ok_for_arm (temp1))
{
- insns = arm_gen_constant (code, mode, temp1,
- new_src = (subtargets
- ? gen_reg_rtx (mode)
- : target),
+ rtx new_src = (subtargets
+ ? (generate ? gen_reg_rtx (mode) : NULL_RTX)
+ : target);
+ insns = arm_gen_constant (code, mode, temp1, new_src,
source, subtargets, generate);
source = new_src;
if (generate)
@@ -789,6 +787,7 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
single instruction, and we can find a temporary to put it in,
then this can be done in two instructions instead of 3-4. */
if (subtargets
+ /* TARGET can't be NULL if SUBTARGETS is 0 */
|| (reload_completed && ! reg_mentioned_p (target, source)))
{
if (const_ok_for_arm (ARM_SIGN_EXTEND (~ val)))
@@ -875,29 +874,31 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
HOST_WIDE_INT shift_mask = ((0xffffffff
<< (32 - clear_sign_bit_copies))
& 0xffffffff);
- rtx new_source;
- rtx shift;
if ((remainder | shift_mask) != 0xffffffff)
{
if (generate)
{
- new_source = subtargets ? gen_reg_rtx (mode) : target;
+ rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
insns = arm_gen_constant (AND, mode, remainder | shift_mask,
- new_source, source, subtargets, 1);
- source = new_source;
+ new_src, source, subtargets, 1);
+ source = new_src;
}
else
- insns = arm_gen_constant (AND, mode, remainder | shift_mask,
- new_source, source, subtargets, 0);
+ {
+ rtx targ = subtargets ? NULL_RTX : target;
+ insns = arm_gen_constant (AND, mode, remainder | shift_mask,
+ targ, source, subtargets, 0);
+ }
}
if (generate)
{
- shift = GEN_INT (clear_sign_bit_copies);
- new_source = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_ashlsi3 (new_source, source, shift));
- emit_insn (gen_lshrsi3 (target, new_source, shift));
+ rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
+ rtx shift = GEN_INT (clear_sign_bit_copies);
+
+ emit_insn (gen_ashlsi3 (new_src, source, shift));
+ emit_insn (gen_lshrsi3 (target, new_src, shift));
}
return insns + 2;
@@ -906,29 +907,33 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
if (clear_zero_bit_copies >= 16 && clear_zero_bit_copies < 24)
{
HOST_WIDE_INT shift_mask = (1 << clear_zero_bit_copies) - 1;
- rtx new_source;
- rtx shift;
if ((remainder | shift_mask) != 0xffffffff)
{
if (generate)
{
- new_source = subtargets ? gen_reg_rtx (mode) : target;
+ rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
+
insns = arm_gen_constant (AND, mode, remainder | shift_mask,
- new_source, source, subtargets, 1);
- source = new_source;
+ new_src, source, subtargets, 1);
+ source = new_src;
}
else
- insns = arm_gen_constant (AND, mode, remainder | shift_mask,
- new_source, source, subtargets, 0);
+ {
+ rtx targ = subtargets ? NULL_RTX : target;
+
+ insns = arm_gen_constant (AND, mode, remainder | shift_mask,
+ targ, source, subtargets, 0);
+ }
}
if (generate)
{
- shift = GEN_INT (clear_zero_bit_copies);
- new_source = subtargets ? gen_reg_rtx (mode) : target;
- emit_insn (gen_lshrsi3 (new_source, source, shift));
- emit_insn (gen_ashlsi3 (target, new_source, shift));
+ rtx new_src = subtargets ? gen_reg_rtx (mode) : target;
+ rtx shift = GEN_INT (clear_zero_bit_copies);
+
+ emit_insn (gen_lshrsi3 (new_src, source, shift));
+ emit_insn (gen_ashlsi3 (target, new_src, shift));
}
return insns + 2;
@@ -1003,31 +1008,24 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
| ((i < end) ? (0xff >> (32 - end)) : 0));
remainder &= ~temp1;
- if (code == SET)
+ if (generate)
{
- if (generate)
+ rtx new_src;
+
+ if (code == SET)
emit_insn (gen_rtx (SET, VOIDmode,
new_src = (subtargets
? gen_reg_rtx (mode)
: target),
GEN_INT (can_invert ? ~temp1 : temp1)));
- can_invert = 0;
- code = PLUS;
- }
- else if (code == MINUS)
- {
- if (generate)
+ else if (code == MINUS)
emit_insn (gen_rtx (SET, VOIDmode,
new_src = (subtargets
? gen_reg_rtx (mode)
: target),
gen_rtx (code, mode, GEN_INT (temp1),
source)));
- code = PLUS;
- }
- else
- {
- if (generate)
+ else
emit_insn (gen_rtx (SET, VOIDmode,
new_src = (remainder
? (subtargets
@@ -1039,10 +1037,18 @@ arm_gen_constant (code, mode, val, target, source, subtargets, generate)
: (can_negate
? -temp1
: temp1)))));
+ source = new_src;
}
+ if (code == SET)
+ {
+ can_invert = 0;
+ code = PLUS;
+ }
+ else if (code == MINUS)
+ code = PLUS;
+
insns++;
- source = new_src;
i -= 6;
}
i -= 2;
@@ -1059,7 +1065,7 @@ arm_canonicalize_comparison (code, op1)
enum rtx_code code;
rtx *op1;
{
- HOST_WIDE_INT i = INTVAL (*op1);
+ unsigned HOST_WIDE_INT i = INTVAL (*op1);
switch (code)
{
@@ -1069,7 +1075,8 @@ arm_canonicalize_comparison (code, op1)
case GT:
case LE:
- if (i != (1 << (HOST_BITS_PER_WIDE_INT - 1) - 1)
+ if (i != ((((unsigned HOST_WIDE_INT) 1) << (HOST_BITS_PER_WIDE_INT - 1))
+ - 1)
&& (const_ok_for_arm (i+1) || const_ok_for_arm (- (i+1))))
{
*op1 = GEN_INT (i+1);
@@ -1079,7 +1086,7 @@ arm_canonicalize_comparison (code, op1)
case GE:
case LT:
- if (i != (1 << (HOST_BITS_PER_WIDE_INT - 1))
+ if (i != (((unsigned HOST_WIDE_INT) 1) << (HOST_BITS_PER_WIDE_INT - 1))
&& (const_ok_for_arm (i-1) || const_ok_for_arm (- (i-1))))
{
*op1 = GEN_INT (i-1);
@@ -1089,7 +1096,7 @@ arm_canonicalize_comparison (code, op1)
case GTU:
case LEU:
- if (i != ~0
+ if (i != ~((unsigned HOST_WIDE_INT) 0)
&& (const_ok_for_arm (i+1) || const_ok_for_arm (- (i+1))))
{
*op1 = GEN_INT (i + 1);
@@ -1467,10 +1474,10 @@ arm_rtx_costs (x, code, outer_code)
|| (subcode == MULT
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
&& ((INTVAL (XEXP (XEXP (x, 0), 1)) &
- (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
+ (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0)))
&& (REG_OR_SUBREG_REG (XEXP (XEXP (x, 0), 0)))
&& ((REG_OR_SUBREG_REG (XEXP (XEXP (x, 0), 1)))
- || GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)))
+ || GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT))
? 0 : 4));
return 8;
@@ -1560,6 +1567,9 @@ arm_rtx_costs (x, code, outer_code)
case SImode:
return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+
+ default:
+ break;
}
abort ();
@@ -1745,6 +1755,35 @@ reload_memory_operand (op, mode)
&& REGNO (op) >= FIRST_PSEUDO_REGISTER)));
}
+/* Return 1 if OP is a valid memory address, but not valid for a signed byte
+ memory access (architecture V4) */
+int
+bad_signed_byte_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (! memory_operand (op, mode) || GET_CODE (op) != MEM)
+ return 0;
+
+ op = XEXP (op, 0);
+
+ /* A sum of anything more complex than reg + reg or reg + const is bad */
+ if ((GET_CODE (op) == PLUS || GET_CODE (op) == MINUS)
+ && (! s_register_operand (XEXP (op, 0), VOIDmode)
+ || (! s_register_operand (XEXP (op, 1), VOIDmode)
+ && GET_CODE (XEXP (op, 1)) != CONST_INT)))
+ return 1;
+
+ /* Big constants are also bad */
+ if (GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT
+ && (INTVAL (XEXP (op, 1)) > 0xff
+ || -INTVAL (XEXP (op, 1)) > 0xff))
+ return 1;
+
+ /* Everything else is good, or can will automatically be made so. */
+ return 0;
+}
+
/* Return TRUE for valid operands for the rhs of an ARM instruction. */
int
@@ -2257,7 +2296,7 @@ load_multiple_operation (op, mode)
for (; i < count; i++)
{
- rtx elt = XVECEXP (op, 0, i);
+ elt = XVECEXP (op, 0, i);
if (GET_CODE (elt) != SET
|| GET_CODE (SET_DEST (elt)) != REG
@@ -2355,7 +2394,7 @@ load_multiple_sequence (operands, nops, regs, base, load_offset)
int unsorted_regs[4];
HOST_WIDE_INT unsorted_offsets[4];
int order[4];
- int base_reg;
+ int base_reg = -1;
int i;
/* Can only handle 2, 3, or 4 insns at present, though could be easily
@@ -2558,7 +2597,7 @@ store_multiple_sequence (operands, nops, regs, base, load_offset)
int unsorted_regs[4];
HOST_WIDE_INT unsorted_offsets[4];
int order[4];
- int base_reg;
+ int base_reg = -1;
int i;
/* Can only handle 2, 3, or 4 insns at present, though could be easily
@@ -2880,13 +2919,12 @@ arm_gen_movstrqi (operands)
rtx *operands;
{
HOST_WIDE_INT in_words_to_go, out_words_to_go, last_bytes;
- int i, r;
+ int i;
rtx src, dst;
- rtx st_src, st_dst, end_src, end_dst, fin_src, fin_dst;
+ rtx st_src, st_dst, fin_src, fin_dst;
rtx part_bytes_reg = NULL;
rtx mem;
int dst_unchanging_p, dst_in_struct_p, src_unchanging_p, src_in_struct_p;
- extern int optimize;
if (GET_CODE (operands[2]) != CONST_INT
|| GET_CODE (operands[3]) != CONST_INT
@@ -3112,6 +3150,7 @@ select_dominance_cc_mode (op, x, y, cond_or)
case LEU: return CC_DLEUmode;
case GE: return CC_DGEmode;
case GEU: return CC_DGEUmode;
+ default: break;
}
break;
@@ -3168,6 +3207,9 @@ select_dominance_cc_mode (op, x, y, cond_or)
case GEU:
return CC_DGEUmode;
+
+ default:
+ break;
}
abort ();
@@ -3254,6 +3296,7 @@ rtx
gen_compare_reg (code, x, y, fp)
enum rtx_code code;
rtx x, y;
+ int fp;
{
enum machine_mode mode = SELECT_CC_MODE (code, x, y);
rtx cc_reg = gen_rtx (REG, mode, 24);
@@ -3405,19 +3448,31 @@ static pool_node pool_vector[MAX_POOL_SIZE];
static int pool_size;
static rtx pool_vector_label;
-/* Add a constant to the pool and return its label. */
+/* Add a constant to the pool and return its offset within the current
+ pool.
+
+ X is the rtx we want to replace. MODE is its mode. On return,
+ ADDRESS_ONLY will be non-zero if we really want the address of such
+ a constant, not the constant itself. */
static HOST_WIDE_INT
-add_constant (x, mode)
+add_constant (x, mode, address_only)
rtx x;
enum machine_mode mode;
+ int * address_only;
{
int i;
- rtx lab;
HOST_WIDE_INT offset;
+ * address_only = 0;
+
if (mode == SImode && GET_CODE (x) == MEM && CONSTANT_P (XEXP (x, 0))
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
x = get_pool_constant (XEXP (x, 0));
+ else if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P(x))
+ {
+ *address_only = 1;
+ x = get_pool_constant (x);
+ }
#ifndef AOF_ASSEMBLER
else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == 3)
x = XVECEXP (x, 0, 0);
@@ -3538,17 +3593,34 @@ find_barrier (from, max_count)
while (from && count < max_count)
{
+ rtx tmp;
+
if (GET_CODE (from) == BARRIER)
- return from;
+ found_barrier = from;
/* Count the length of this insn */
if (GET_CODE (from) == INSN
&& GET_CODE (PATTERN (from)) == SET
&& CONSTANT_P (SET_SRC (PATTERN (from)))
&& CONSTANT_POOL_ADDRESS_P (SET_SRC (PATTERN (from))))
+ count += 8;
+ /* Handle table jumps as a single entity. */
+ else if (GET_CODE (from) == JUMP_INSN
+ && JUMP_LABEL (from) != 0
+ && ((tmp = next_real_insn (JUMP_LABEL (from)))
+ == next_real_insn (from))
+ && tmp != NULL
+ && GET_CODE (tmp) == JUMP_INSN
+ && (GET_CODE (PATTERN (tmp)) == ADDR_VEC
+ || GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC))
{
- rtx src = SET_SRC (PATTERN (from));
- count += 8;
+ int elt = GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC ? 1 : 0;
+ count += (get_attr_length (from)
+ + GET_MODE_SIZE (SImode) * XVECLEN (PATTERN (tmp), elt));
+ /* Continue after the dispatch table. */
+ last = from;
+ from = NEXT_INSN (tmp);
+ continue;
}
else
count += get_attr_length (from);
@@ -3557,28 +3629,27 @@ find_barrier (from, max_count)
from = NEXT_INSN (from);
}
- if (!found_barrier)
+ if (! found_barrier)
{
/* We didn't find a barrier in time to
- dump our stuff, so we'll make one */
+ dump our stuff, so we'll make one. */
rtx label = gen_label_rtx ();
-
+
if (from)
from = PREV_INSN (last);
else
from = get_last_insn ();
-
- /* Walk back to be just before any jump */
+
+ /* Walk back to be just before any jump. */
while (GET_CODE (from) == JUMP_INSN
|| GET_CODE (from) == NOTE
|| GET_CODE (from) == CODE_LABEL)
from = PREV_INSN (from);
-
+
from = emit_jump_insn_after (gen_jump (label), from);
JUMP_LABEL (from) = label;
found_barrier = emit_barrier_after (from);
emit_label_after (label, found_barrier);
- return found_barrier;
}
return found_barrier;
@@ -3598,6 +3669,7 @@ broken_move (insn)
rtx dst = SET_DEST (pat);
int destreg;
enum machine_mode mode = GET_MODE (dst);
+
if (dst == pc_rtx)
return 0;
@@ -3605,6 +3677,8 @@ broken_move (insn)
destreg = REGNO (dst);
else if (GET_CODE (dst) == SUBREG && GET_CODE (SUBREG_REG (dst)) == REG)
destreg = REGNO (SUBREG_REG (dst));
+ else
+ return 0;
return fixit (src, mode, destreg);
}
@@ -3617,7 +3691,6 @@ arm_reorg (first)
{
rtx insn;
int count_size;
- int regno;
#if 0
/* The ldr instruction can work with up to a 4k offset, and most constants
@@ -3632,12 +3705,16 @@ arm_reorg (first)
PC, so to make things simple we restrict all loads for such functions.
*/
if (TARGET_HARD_FLOAT)
- for (regno = 16; regno < 24; regno++)
- if (regs_ever_live[regno])
- {
- count_size = 1000;
- break;
- }
+ {
+ int regno;
+
+ for (regno = 16; regno < 24; regno++)
+ if (regs_ever_live[regno])
+ {
+ count_size = 1000;
+ break;
+ }
+ }
#else
count_size = 1000;
#endif /* 0 */
@@ -3666,6 +3743,7 @@ arm_reorg (first)
rtx newsrc;
rtx addr;
int scratch;
+ int address_only;
/* If this is an HImode constant load, convert it into
an SImode constant load. Since the register is always
@@ -3679,39 +3757,50 @@ arm_reorg (first)
PUT_MODE (dst, SImode);
}
- offset = add_constant (src, mode);
+ offset = add_constant (src, mode, &address_only);
addr = plus_constant (gen_rtx (LABEL_REF, VOIDmode,
pool_vector_label),
offset);
- /* For wide moves to integer regs we need to split the
- address calculation off into a separate insn, so that
- the load can then be done with a load-multiple. This is
- safe, since we have already noted the length of such
- insns to be 8, and we are immediately over-writing the
- scratch we have grabbed with the final result. */
- if (GET_MODE_SIZE (mode) > 4
+ /* If we only want the address of the pool entry, or
+ for wide moves to integer regs we need to split
+ the address calculation off into a separate insn.
+ If necessary, the load can then be done with a
+ load-multiple. This is safe, since we have
+ already noted the length of such insns to be 8,
+ and we are immediately over-writing the scratch
+ we have grabbed with the final result. */
+ if ((address_only || GET_MODE_SIZE (mode) > 4)
&& (scratch = REGNO (dst)) < 16)
{
- rtx reg = gen_rtx (REG, SImode, scratch);
+ rtx reg;
+
+ if (mode == SImode)
+ reg = dst;
+ else
+ reg = gen_rtx (REG, SImode, scratch);
+
newinsn = emit_insn_after (gen_movaddr (reg, addr),
newinsn);
addr = reg;
}
- newsrc = gen_rtx (MEM, mode, addr);
-
- /* Build a jump insn wrapper around the move instead
- of an ordinary insn, because we want to have room for
- the target label rtx in fld[7], which an ordinary
- insn doesn't have. */
- newinsn = emit_jump_insn_after (gen_rtx (SET, VOIDmode,
- dst, newsrc),
- newinsn);
- JUMP_LABEL (newinsn) = pool_vector_label;
-
- /* But it's still an ordinary insn */
- PUT_CODE (newinsn, INSN);
+ if (! address_only)
+ {
+ newsrc = gen_rtx (MEM, mode, addr);
+
+ /* XXX Fixme -- I think the following is bogus. */
+ /* Build a jump insn wrapper around the move instead
+ of an ordinary insn, because we want to have room for
+ the target label rtx in fld[7], which an ordinary
+ insn doesn't have. */
+ newinsn = emit_jump_insn_after
+ (gen_rtx (SET, VOIDmode, dst, newsrc), newinsn);
+ JUMP_LABEL (newinsn) = pool_vector_label;
+
+ /* But it's still an ordinary insn */
+ PUT_CODE (newinsn, INSN);
+ }
/* Kill old insn */
delete_insn (scan);
@@ -3808,7 +3897,12 @@ output_call (operands)
output_asm_insn ("mov%?\t%0, %|lr", operands);
}
output_asm_insn ("mov%?\t%|lr, %|pc", operands);
- output_asm_insn ("mov%?\t%|pc, %0", operands);
+
+ if (TARGET_THUMB_INTERWORK)
+ output_asm_insn ("bx%?\t%0", operands);
+ else
+ output_asm_insn ("mov%?\t%|pc, %0", operands);
+
return "";
}
@@ -3856,8 +3950,18 @@ output_call_mem (operands)
if (eliminate_lr2ip (&operands[0]))
output_asm_insn ("mov%?\t%|ip, %|lr", operands);
- output_asm_insn ("mov%?\t%|lr, %|pc", operands);
- output_asm_insn ("ldr%?\t%|pc, %0", operands);
+ if (TARGET_THUMB_INTERWORK)
+ {
+ output_asm_insn ("ldr%?\t%|ip, %0", operands);
+ output_asm_insn ("mov%?\t%|lr, %|pc", operands);
+ output_asm_insn ("bx%?\t%|ip", operands);
+ }
+ else
+ {
+ output_asm_insn ("mov%?\t%|lr, %|pc", operands);
+ output_asm_insn ("ldr%?\t%|pc, %0", operands);
+ }
+
return "";
}
@@ -4726,15 +4830,29 @@ output_return_instruction (operand, really_return, reverse)
strcat (instr, reg_names[13]);
strcat (instr, ", ");
strcat (instr, "%|");
- strcat (instr, really_return ? reg_names[15] : reg_names[14]);
+ strcat (instr, TARGET_THUMB_INTERWORK || (! really_return)
+ ? reg_names[14] : reg_names[15] );
}
else
{
strcat (instr, "%|");
- strcat (instr, really_return ? reg_names[15] : reg_names[14]);
+ if (TARGET_THUMB_INTERWORK && really_return)
+ strcat (instr, reg_names[12]);
+ else
+ strcat (instr, really_return ? reg_names[15] : reg_names[14]);
}
strcat (instr, (TARGET_APCS_32 || !really_return) ? "}" : "}^");
output_asm_insn (instr, &operand);
+
+ if (TARGET_THUMB_INTERWORK && really_return)
+ {
+ strcpy (instr, "bx%?");
+ strcat (instr, reverse ? "%D0" : "%d0");
+ strcat (instr, "\t%|");
+ strcat (instr, frame_pointer_needed ? "lr" : "ip");
+
+ output_asm_insn (instr, & operand);
+ }
}
else if (really_return)
{
@@ -4743,7 +4861,8 @@ output_return_instruction (operand, really_return, reverse)
else
sprintf (instr, "mov%%?%%%s0%s\t%%|pc, %%|lr",
reverse ? "D" : "d", TARGET_APCS_32 ? "" : "s");
- output_asm_insn (instr, &operand);
+
+ output_asm_insn (instr, & operand);
}
return "";
@@ -4776,7 +4895,6 @@ output_func_prologue (f, frame_size)
int frame_size;
{
int reg, live_regs_mask = 0;
- rtx operands[3];
int volatile_func = (optimize > 0
&& TREE_THIS_VOLATILE (current_function_decl));
@@ -4932,7 +5050,7 @@ output_func_epilogue (f, frame_size)
REGISTER_PREFIX, reg_names[reg + 1],
start_reg - reg, REGISTER_PREFIX, floats_offset);
}
-
+
if (TARGET_THUMB_INTERWORK)
{
live_regs_mask |= 0x6800;
@@ -5126,8 +5244,6 @@ arm_expand_prologue ()
int reg;
rtx amount = GEN_INT (-(get_frame_size ()
+ current_function_outgoing_args_size));
- rtx push_insn;
- int num_regs;
int live_regs_mask = 0;
int store_arg_regs = 0;
int volatile_func = (optimize > 0
@@ -5688,8 +5804,6 @@ final_prescan_insn (insn, opvec, noperands)
if (!this_insn)
break;
- scanbody = PATTERN (this_insn);
-
switch (GET_CODE (this_insn))
{
case CODE_LABEL:
@@ -5764,8 +5878,9 @@ final_prescan_insn (insn, opvec, noperands)
/* If this is an unconditional branch to the same label, succeed.
If it is to another label, do nothing. If it is conditional,
fail. */
- /* XXX Probably, the test for the SET and the PC are unnecessary. */
+ /* XXX Probably, the tests for SET and the PC are unnecessary. */
+ scanbody = PATTERN (this_insn);
if (GET_CODE (scanbody) == SET
&& GET_CODE (SET_DEST (scanbody)) == PC)
{
@@ -5800,6 +5915,7 @@ final_prescan_insn (insn, opvec, noperands)
case INSN:
/* Instructions using or affecting the condition codes make it
fail. */
+ scanbody = PATTERN (this_insn);
if ((GET_CODE (scanbody) == SET
|| GET_CODE (scanbody) == PARALLEL)
&& get_attr_conds (this_insn) != CONDS_NOCOND)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index dab507f2e79..ed5e4de9729 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -759,12 +759,12 @@ extern int arm_arch4;
least likely to contain a function parameter; in addition results are
returned in r0.
*/
-#define REG_ALLOC_ORDER \
+#define REG_ALLOC_ORDER \
{ \
- 3, 2, 1, 0, 12, 14, 4, 5, \
- 6, 7, 8, 10, 9, 11, 13, 15, \
+ 3, 2, 1, 0, 12, 14, 4, 5, \
+ 6, 7, 8, 10, 9, 11, 13, 15, \
16, 17, 18, 19, 20, 21, 22, 23, \
- 24, 25 \
+ 24, 25, 26 \
}
/* Register and constant classes. */
@@ -873,8 +873,11 @@ enum reg_class
? GENERAL_REGS : NO_REGS)
/* If we need to load shorts byte-at-a-time, then we need a scratch. */
-#define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,X) \
- (((MODE) == HImode && TARGET_SHORT_BY_BYTES && true_regnum (X) == -1) \
+#define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,X) \
+ (((MODE) == HImode && ! arm_arch4 && TARGET_SHORT_BY_BYTES \
+ && (GET_CODE (X) == MEM \
+ || ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG) \
+ && true_regnum (X) == -1))) \
? GENERAL_REGS : NO_REGS)
/* Try a machine-dependent way of reloading an illegitimate address
@@ -1408,7 +1411,9 @@ do \
&& INTVAL (op) <= 31) \
goto LABEL; \
} \
- range = (MODE) == HImode ? (arm_arch4 ? 256 : 4095) : 4096; \
+ /* NASTY: Since this limits the addressing of unsigned byte loads */ \
+ range = ((MODE) == HImode || (MODE) == QImode) \
+ ? (arm_arch4 ? 256 : 4095) : 4096; \
if (code == CONST_INT && INTVAL (INDEX) < range \
&& INTVAL (INDEX) > -range) \
goto LABEL; \
@@ -1759,6 +1764,7 @@ do \
{ \
rtx const_op = OP1; \
CODE = arm_canonicalize_comparison ((CODE), &const_op); \
+ OP1 = const_op; \
} \
} while (0)
@@ -1781,6 +1787,7 @@ extern int arm_compare_fp;
{"fpu_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \
{"arm_not_operand", {SUBREG, REG, CONST_INT}}, \
{"offsettable_memory_operand", {MEM}}, \
+ {"bad_signed_byte_operand", {MEM}}, \
{"alignable_memory_operand", {MEM}}, \
{"shiftable_operator", {PLUS, MINUS, AND, IOR, XOR}}, \
{"minmax_operator", {SMIN, SMAX, UMIN, UMAX}}, \
@@ -1982,8 +1989,7 @@ do { \
} \
} \
fputs ("\tb\t", FILE); \
- assemble_name (FILE, \
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fputc ('\n', FILE); \
} while (0)
@@ -2025,7 +2031,7 @@ struct rtx_def *legitimize_pic_address (/* struct rtx_def *,
int is_pic (/* struct rtx_def * */);
void arm_finalize_pic (/* void */);
int arm_rtx_costs (/* struct rtx_def *, enum rtx_code, enum rtx_code */);
-int arm_adjust_code (/* struct rtx_def *, struct rtx_def *,
+int arm_adjust_cost (/* struct rtx_def *, struct rtx_def *,
struct rtx_def *, int */);
int const_double_rtx_ok_for_fpu (/* struct rtx_def * */);
int neg_const_double_rtx_ok_for_fpu (/* struct rtx_def * */);
@@ -2039,6 +2045,7 @@ int arm_add_operand (/* struct rtx_def *, enum machine_mode */);
int arm_not_operand (/* struct rtx_def *, enum machine_mode */);
int offsettable_memory_operand (/* struct rtx_def *, enum machine_mode */);
int alignable_memory_operand (/* struct rtx_def *, enum machine_mode */);
+int bad_signed_byte_operand (/* struct rtx_def *, enum machine_mode */);
int fpu_rhs_operand (/* struct rtx_def *, enum machine_mode */);
int fpu_add_operand (/* struct rtx_def *, enum machine_mode */);
int power_of_two_operand (/* struct rtx_def *, enum machine_mode */);
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 1920112e5c5..20b8d57b40a 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -1199,6 +1199,15 @@
[(set_attr "conds" "set")
(set_attr "length" "8")])
+;;; ??? This pattern is bogus. If operand3 has bits outside the range
+;;; represented by the bitfield, then this will produce incorrect results.
+;;; Somewhere, the value needs to be truncated. On targets like the m68k,
+;;; which have a real bitfield insert instruction, the truncation happens
+;;; in the bitfield insert instruction itself. Since arm does not have a
+;;; bitfield insert instruction, we would have to emit code here to truncate
+;;; the value before we insert. This loses some of the advantage of having
+;;; this insv pattern, so this pattern needs to be reevalutated.
+
(define_expand "insv"
[(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "")
(match_operand:SI 1 "general_operand" "")
@@ -1207,9 +1216,11 @@
""
"
{
- HOST_WIDE_INT mask = (((HOST_WIDE_INT)1) << INTVAL (operands[1])) - 1;
+ int start_bit = INTVAL (operands[2]);
+ int width = INTVAL (operands[1]);
+ HOST_WIDE_INT mask = (((HOST_WIDE_INT)1) << width) - 1;
rtx target, subtarget;
-
+
target = operands[0];
/* Avoid using a subreg as a subtarget, and avoid writing a paradoxical
subreg as the final target. */
@@ -1228,16 +1239,19 @@
/* Since we are inserting a known constant, we may be able to
reduce the number of bits that we have to clear so that
the mask becomes simple. */
+ /* ??? This code does not check to see if the new mask is actually
+ simpler. It may not be. */
rtx op1 = gen_reg_rtx (SImode);
- HOST_WIDE_INT mask2 = ((mask & ~INTVAL (operands[3]))
- << INTVAL (operands[2]));
+ /* ??? Truncate operand3 to fit in the bitfield. See comment before
+ start of this pattern. */
+ HOST_WIDE_INT op3_value = mask & INTVAL (operands[3]);
+ HOST_WIDE_INT mask2 = ((mask & ~op3_value) << start_bit);
emit_insn (gen_andsi3 (op1, operands[0], GEN_INT (~mask2)));
emit_insn (gen_iorsi3 (subtarget, op1,
- GEN_INT (INTVAL (operands[3])
- << INTVAL (operands[2]))));
+ GEN_INT (op3_value << start_bit)));
}
- else if (INTVAL (operands[2]) == 0
+ else if (start_bit == 0
&& ! (const_ok_for_arm (mask)
|| const_ok_for_arm (~mask)))
{
@@ -1245,18 +1259,18 @@
we can shift operand[3] up, operand[0] down, OR them together
and rotate the result back again. This takes 3 insns, and
the third might be mergable into another op. */
-
+ /* The shift up copes with the possibility that operand[3] is
+ wider than the bitfield. */
rtx op0 = gen_reg_rtx (SImode);
rtx op1 = gen_reg_rtx (SImode);
- emit_insn (gen_ashlsi3 (op0, operands[3],
- GEN_INT (32 - INTVAL (operands[1]))));
+ emit_insn (gen_ashlsi3 (op0, operands[3], GEN_INT (32 - width)));
emit_insn (gen_iorsi3 (op1, gen_rtx (LSHIFTRT, SImode, operands[0],
operands[1]),
op0));
emit_insn (gen_rotlsi3 (subtarget, op1, operands[1]));
}
- else if ((INTVAL (operands[1]) + INTVAL (operands[2]) == 32)
+ else if ((width + start_bit == 32)
&& ! (const_ok_for_arm (mask)
|| const_ok_for_arm (~mask)))
{
@@ -1265,8 +1279,7 @@
rtx op0 = gen_reg_rtx (SImode);
rtx op1 = gen_reg_rtx (SImode);
- emit_insn (gen_ashlsi3 (op0, operands[3],
- GEN_INT (32 - INTVAL (operands[1]))));
+ emit_insn (gen_ashlsi3 (op0, operands[3], GEN_INT (32 - width)));
emit_insn (gen_ashlsi3 (op1, operands[0], operands[1]));
emit_insn (gen_iorsi3 (subtarget,
gen_rtx (LSHIFTRT, SImode, op1,
@@ -1286,13 +1299,14 @@
op0 = tmp;
}
+ /* Mask out any bits in operand[3] that are not needed. */
emit_insn (gen_andsi3 (op1, operands[3], op0));
if (GET_CODE (op0) == CONST_INT
- && (const_ok_for_arm (mask << INTVAL (operands[2]))
- || const_ok_for_arm (~ (mask << INTVAL (operands[2])))))
+ && (const_ok_for_arm (mask << start_bit)
+ || const_ok_for_arm (~ (mask << start_bit))))
{
- op0 = GEN_INT (~(mask << INTVAL (operands[2])));
+ op0 = GEN_INT (~(mask << start_bit));
emit_insn (gen_andsi3 (op2, operands[0], op0));
}
else
@@ -1305,12 +1319,13 @@
op0 = tmp;
}
- if (INTVAL (operands[2]) != 0)
+ if (start_bit != 0)
op0 = gen_rtx (ASHIFT, SImode, op0, operands[2]);
+
emit_insn (gen_andsi_notsi_si (op2, operands[0], op0));
}
- if (INTVAL (operands[2]) != 0)
+ if (start_bit != 0)
op1 = gen_rtx (ASHIFT, SImode, op1, operands[2]);
emit_insn (gen_iorsi3 (subtarget, op1, op2));
@@ -2258,19 +2273,32 @@
}")
(define_expand "extendhisi2_mem"
- [(set (match_dup 2) (zero_extend:SI (mem:QI (match_operand:HI 1 "" ""))))
+ [(set (match_dup 2) (zero_extend:SI (match_operand:HI 1 "" "")))
(set (match_dup 3)
- (zero_extend:SI (mem:QI (plus:SI (match_dup 1) (const_int 1)))))
+ (zero_extend:SI (match_dup 7)))
(set (match_dup 6) (ashift:SI (match_dup 4) (const_int 24)))
(set (match_operand:SI 0 "" "")
(ior:SI (ashiftrt:SI (match_dup 6) (const_int 16)) (match_dup 5)))]
""
"
+{
+ rtx mem1, mem2;
+ rtx addr = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
+
+ mem1 = gen_rtx (MEM, QImode, addr);
+ MEM_VOLATILE_P (mem1) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (mem1) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (mem1) = RTX_UNCHANGING_P (operands[1]);
+ mem2 = gen_rtx (MEM, QImode, plus_constant (addr, 1));
+ MEM_VOLATILE_P (mem2) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (mem2) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (mem2) = RTX_UNCHANGING_P (operands[1]);
operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
+ operands[1] = mem1;
operands[2] = gen_reg_rtx (SImode);
operands[3] = gen_reg_rtx (SImode);
operands[6] = gen_reg_rtx (SImode);
+ operands[7] = mem2;
if (BYTES_BIG_ENDIAN)
{
@@ -2282,6 +2310,7 @@
operands[4] = operands[3];
operands[5] = operands[2];
}
+}
")
(define_insn "*extendhisi_insn"
@@ -2344,16 +2373,59 @@
operands[2] = gen_reg_rtx (SImode);
}")
+; Rather than restricting all byte accesses to memory addresses that ldrsb
+; can handle, we fix up the ones that ldrsb can't grok with a split.
(define_insn "*extendqihi_insn"
[(set (match_operand:HI 0 "s_register_operand" "=r")
- (sign_extend:HI (match_operand:QI 1 "memory_operand" "o<>")))]
+ (sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
"arm_arch4"
- "ldr%?sb\\t%0, %1"
-[(set_attr "type" "load")])
+ "*
+ /* If the address is invalid, this will split the instruction into two. */
+ if (bad_signed_byte_operand(operands[1], QImode))
+ return \"#\";
+ return \"ldr%?sb\\t%0, %1\";
+"
+[(set_attr "type" "load")
+ (set_attr "length" "8")])
+
+(define_split
+ [(set (match_operand:HI 0 "s_register_operand" "")
+ (sign_extend:HI (match_operand:QI 1 "bad_signed_byte_operand" "")))]
+ "arm_arch4 && reload_completed"
+ [(set (match_dup 3) (match_dup 1))
+ (set (match_dup 0) (sign_extend:HI (match_dup 2)))]
+ "
+ {
+ HOST_WIDE_INT offset;
+
+ operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]));
+ operands[2] = gen_rtx (MEM, QImode, operands[3]);
+ MEM_VOLATILE_P (operands[2]) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (operands[2]) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (operands[2]) = RTX_UNCHANGING_P (operands[1]);
+ operands[1] = XEXP (operands[1], 0);
+ if (GET_CODE (operands[1]) == PLUS
+ && GET_CODE (XEXP (operands[1], 1)) == CONST_INT
+ && ! (const_ok_for_arm (offset = INTVAL (XEXP (operands[1], 1)))
+ || const_ok_for_arm (-offset)))
+ {
+ HOST_WIDE_INT low = (offset > 0
+ ? (offset & 0xff) : -((-offset) & 0xff));
+ XEXP (operands[2], 0) = plus_constant (operands[3], low);
+ operands[1] = plus_constant (XEXP (operands[1], 0), offset - low);
+ }
+ /* Ensure the sum is in correct canonical form */
+ else if (GET_CODE (operands[1]) == PLUS
+ && GET_CODE (XEXP (operands[1], 1)) != CONST_INT
+ && ! s_register_operand (XEXP (operands[1], 1), VOIDmode))
+ operands[1] = gen_rtx (PLUS, GET_MODE (operands[1]),
+ XEXP (operands[1], 1), XEXP (operands[1], 0));
+ }
+")
(define_expand "extendqisi2"
[(set (match_dup 2)
- (ashift:SI (match_operand:QI 1 "s_register_operand" "")
+ (ashift:SI (match_operand:QI 1 "general_operand" "")
(const_int 24)))
(set (match_operand:SI 0 "s_register_operand" "")
(ashiftrt:SI (match_dup 2)
@@ -2373,12 +2445,54 @@
operands[2] = gen_reg_rtx (SImode);
}")
+; Rather than restricting all byte accesses to memory addresses that ldrsb
+; can handle, we fix up the ones that ldrsb can't grok with a split.
(define_insn "*extendqisi_insn"
[(set (match_operand:SI 0 "s_register_operand" "=r")
- (sign_extend:SI (match_operand:QI 1 "memory_operand" "o<>")))]
+ (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
"arm_arch4"
- "ldr%?sb\\t%0, %1"
-[(set_attr "type" "load")])
+ "*
+ /* If the address is invalid, this will split the instruction into two. */
+ if (bad_signed_byte_operand(operands[1], QImode))
+ return \"#\";
+ return \"ldr%?sb\\t%0, %1\";
+"
+[(set_attr "type" "load")
+ (set_attr "length" "8")])
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (sign_extend:SI (match_operand:QI 1 "bad_signed_byte_operand" "")))]
+ "arm_arch4 && reload_completed"
+ [(set (match_dup 0) (match_dup 1))
+ (set (match_dup 0) (sign_extend:SI (match_dup 2)))]
+ "
+ {
+ HOST_WIDE_INT offset;
+
+ operands[2] = gen_rtx (MEM, QImode, operands[0]);
+ MEM_VOLATILE_P (operands[2]) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (operands[2]) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (operands[2]) = RTX_UNCHANGING_P (operands[1]);
+ operands[1] = XEXP (operands[1], 0);
+ if (GET_CODE (operands[1]) == PLUS
+ && GET_CODE (XEXP (operands[1], 1)) == CONST_INT
+ && ! (const_ok_for_arm (offset = INTVAL (XEXP (operands[1], 1)))
+ || const_ok_for_arm (-offset)))
+ {
+ HOST_WIDE_INT low = (offset > 0
+ ? (offset & 0xff) : -((-offset) & 0xff));
+ XEXP (operands[2], 0) = plus_constant (operands[0], low);
+ operands[1] = plus_constant (XEXP (operands[1], 0), offset - low);
+ }
+ /* Ensure the sum is in correct canonical form */
+ else if (GET_CODE (operands[1]) == PLUS
+ && GET_CODE (XEXP (operands[1], 1)) != CONST_INT
+ && ! s_register_operand (XEXP (operands[1], 1), VOIDmode))
+ operands[1] = gen_rtx (PLUS, GET_MODE (operands[1]),
+ XEXP (operands[1], 1), XEXP (operands[1], 0));
+ }
+")
(define_insn "extendsfdf2"
[(set (match_operand:DF 0 "s_register_operand" "=f")
@@ -2774,9 +2888,14 @@
&& REGNO_POINTER_ALIGN (REGNO (base)) >= 4)
{
HOST_WIDE_INT new_offset = INTVAL (offset) & ~2;
-
- emit_insn (gen_movsi (reg, gen_rtx (MEM, SImode,
- plus_constant (base, new_offset))));
+ rtx new;
+
+ new = gen_rtx (MEM, SImode,
+ plus_constant (base, new_offset));
+ MEM_VOLATILE_P (new) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (operands[1]);
+ emit_insn (gen_movsi (reg, new));
if (((INTVAL (offset) & 2) != 0)
^ (BYTES_BIG_ENDIAN ? 1 : 0))
{
@@ -2803,21 +2922,25 @@
&& REGNO_POINTER_ALIGN (REGNO (base)) >= 4)
{
rtx reg = gen_reg_rtx (SImode);
- rtx new_mem;
+ rtx new;
if ((INTVAL (offset) & 2) == 2)
{
HOST_WIDE_INT new_offset = INTVAL (offset) ^ 2;
- new_mem = gen_rtx (MEM, SImode,
- plus_constant (base, new_offset));
-
- emit_insn (gen_movsi (reg, new_mem));
+ new = gen_rtx (MEM, SImode,
+ plus_constant (base, new_offset));
+ MEM_VOLATILE_P (new) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (operands[1]);
+ emit_insn (gen_movsi (reg, new));
}
else
{
- new_mem = gen_rtx (MEM, SImode,
- XEXP (operands[1], 0));
- emit_insn (gen_rotated_loadsi (reg, new_mem));
+ new = gen_rtx (MEM, SImode, XEXP (operands[1], 0));
+ MEM_VOLATILE_P (new) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (operands[1]);
+ emit_insn (gen_rotated_loadsi (reg, new));
}
operands[1] = gen_lowpart (HImode, reg);
@@ -2865,17 +2988,30 @@
[(set_attr "type" "load")])
(define_expand "movhi_bytes"
- [(set (match_dup 2) (zero_extend:SI (mem:QI (match_operand:HI 1 "" ""))))
+ [(set (match_dup 2) (zero_extend:SI (match_operand:HI 1 "" "")))
(set (match_dup 3)
- (zero_extend:SI (mem:QI (plus:SI (match_dup 1) (const_int 1)))))
+ (zero_extend:SI (match_dup 6)))
(set (match_operand:SI 0 "" "")
(ior:SI (ashift:SI (match_dup 4) (const_int 8)) (match_dup 5)))]
""
"
+{
+ rtx mem1, mem2;
+ rtx addr = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
+
+ mem1 = gen_rtx (MEM, QImode, addr);
+ MEM_VOLATILE_P (mem1) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (mem1) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (mem1) = RTX_UNCHANGING_P (operands[1]);
+ mem2 = gen_rtx (MEM, QImode, plus_constant (addr, 1));
+ MEM_VOLATILE_P (mem2) = MEM_VOLATILE_P (operands[1]);
+ MEM_IN_STRUCT_P (mem2) = MEM_IN_STRUCT_P (operands[1]);
+ RTX_UNCHANGING_P (mem2) = RTX_UNCHANGING_P (operands[1]);
operands[0] = gen_lowpart (SImode, operands[0]);
- operands[1] = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
+ operands[1] = mem1;
operands[2] = gen_reg_rtx (SImode);
operands[3] = gen_reg_rtx (SImode);
+ operands[6] = mem2;
if (BYTES_BIG_ENDIAN)
{
@@ -2887,6 +3023,7 @@
operands[4] = operands[3];
operands[5] = operands[2];
}
+}
")
(define_expand "movhi_bigend"
diff --git a/gcc/config/arm/coff.h b/gcc/config/arm/coff.h
index 92101588c8f..4e568cb7941 100644
--- a/gcc/config/arm/coff.h
+++ b/gcc/config/arm/coff.h
@@ -104,7 +104,7 @@ do { \
/* Define this macro if jump tables (for `tablejump' insns) should be
output in the text section, along with the assembler instructions.
Otherwise, the readonly data section is used. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
#undef READONLY_DATA_SECTION
#define READONLY_DATA_SECTION rdata_section
diff --git a/gcc/config/arm/netbsd.h b/gcc/config/arm/netbsd.h
index 596da18452b..374d5bf65ab 100644
--- a/gcc/config/arm/netbsd.h
+++ b/gcc/config/arm/netbsd.h
@@ -36,7 +36,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
/* Default is to use APCS-32 mode. */
-#define TARGET_DEFAULT ARM_FLAG_APCS_32
+#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SOFT_FLOAT)
#include "arm/aout.h"
@@ -45,6 +45,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <netbsd.h>
+/* Until they use ELF or something that handles dwarf2 unwinds
+ and initialization stuff better. */
+#undef DWARF2_UNWIND_INFO
+
/* Some defines for CPP.
arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */
#undef CPP_PREDEFINES
@@ -63,6 +67,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#undef CPP_APCS_PC_DEFAULT_SPEC
#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+/* Because TARGET_DEFAULT sets ARM_FLAG_SOFT_FLOAT */
+#undef CPP_FLOAT_DEFAULT_SPEC
+#define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__"
+
/* Pass -X to the linker so that it will strip symbols starting with 'L' */
#undef LINK_SPEC
#define LINK_SPEC "\
@@ -141,8 +149,3 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
requirements. */
#undef STRUCTURE_SIZE_BOUNDARY
#define STRUCTURE_SIZE_BOUNDARY 8
-
-/* Until they use ELF or something that handles dwarf2 unwinds
- and initialization stuff better. */
-#define DWARF2_UNWIND_INFO 0
-
diff --git a/gcc/config/arm/tcoff.h b/gcc/config/arm/tcoff.h
index 5fabe5dd555..6fa4705b504 100644
--- a/gcc/config/arm/tcoff.h
+++ b/gcc/config/arm/tcoff.h
@@ -49,7 +49,7 @@ extern int arm_structure_size_boundary;
#define LOCAL_LABEL_PREFIX "."
#undef USER_LABEL_PREFIX
-#define USER_LABEL_PREFIX "_"
+#define USER_LABEL_PREFIX ""
/* A C statement to output assembler commands which will identify the
object file as having been compiled with GNU CC (or another GNU
@@ -87,7 +87,7 @@ do { \
/* Define this macro if jump tables (for `tablejump' insns) should be
output in the text section, along with the assembler instructions.
Otherwise, the readonly data section is used. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
#undef READONLY_DATA_SECTION
#define READONLY_DATA_SECTION rdata_section
diff --git a/gcc/config/arm/thumb.c b/gcc/config/arm/thumb.c
index 53ce57c84de..c7cc7a28e45 100644
--- a/gcc/config/arm/thumb.c
+++ b/gcc/config/arm/thumb.c
@@ -603,7 +603,6 @@ number_of_first_bit_set (mask)
/* Generate code to return from a thumb function. If
'reg_containing_return_addr' is -1, then the return address is
actually on the stack, at the stack pointer. */
-
static void
thumb_exit (f, reg_containing_return_addr)
FILE * f;
@@ -620,7 +619,6 @@ thumb_exit (f, reg_containing_return_addr)
int restore_a4 = FALSE;
/* Compute the registers we need to pop. */
-
regs_to_pop = 0;
pops_needed = 0;
@@ -633,16 +631,14 @@ thumb_exit (f, reg_containing_return_addr)
if (TARGET_BACKTRACE)
{
/* Restore frame pointer and stack pointer. */
-
regs_to_pop |= (1 << FRAME_POINTER) | (1 << STACK_POINTER);
pops_needed += 2;
}
- /* If there is nothing to pop then just emit the BX instruction and return. */
-
+ /* If there is nothing to pop then just emit the BX instruction and return.*/
if (pops_needed == 0)
{
- asm_fprintf (f, "\tbx\t%s\n", reg_names[ reg_containing_return_addr ]);
+ asm_fprintf (f, "\tbx\t%s\n", reg_names [reg_containing_return_addr]);
return;
}
@@ -650,7 +646,6 @@ thumb_exit (f, reg_containing_return_addr)
/* Otherwise if we are not supporting interworking and we have not created
a backtrace structure and the function was not entered in ARM mode then
just pop the return address straight into the PC. */
-
else if ( ! TARGET_THUMB_INTERWORK
&& ! TARGET_BACKTRACE
&& ! is_called_in_ARM_mode (current_function_decl))
@@ -661,7 +656,6 @@ thumb_exit (f, reg_containing_return_addr)
}
/* Find out how many of the (return) argument registers we can corrupt. */
-
regs_available_for_popping = 0;
#ifdef RTX_CODE
@@ -671,14 +665,10 @@ thumb_exit (f, reg_containing_return_addr)
the register is used to hold a return value. */
if (current_function_return_rtx != 0)
- {
mode = GET_MODE (current_function_return_rtx);
- }
else
#endif
- {
mode = DECL_MODE (DECL_RESULT (current_function_decl));
- }
size = GET_MODE_SIZE (mode);
@@ -687,17 +677,23 @@ thumb_exit (f, reg_containing_return_addr)
/* In a void function we can use any argument register.
In a function that returns a structure on the stack
we can use the second and third argument registers. */
-
if (mode == VOIDmode)
- regs_available_for_popping = (1 << ARG_1_REGISTER) | (1 << ARG_2_REGISTER) | (1 << ARG_3_REGISTER);
+ regs_available_for_popping =
+ (1 << ARG_1_REGISTER)
+ | (1 << ARG_2_REGISTER)
+ | (1 << ARG_3_REGISTER);
else
- regs_available_for_popping = (1 << ARG_2_REGISTER) | (1 << ARG_3_REGISTER);
+ regs_available_for_popping =
+ (1 << ARG_2_REGISTER)
+ | (1 << ARG_3_REGISTER);
}
- else if (size <= 4) regs_available_for_popping = (1 << ARG_2_REGISTER) | (1 << ARG_3_REGISTER);
- else if (size <= 8) regs_available_for_popping = (1 << ARG_3_REGISTER);
+ else if (size <= 4) regs_available_for_popping =
+ (1 << ARG_2_REGISTER)
+ | (1 << ARG_3_REGISTER);
+ else if (size <= 8) regs_available_for_popping =
+ (1 << ARG_3_REGISTER);
/* Match registers to be popped with registers into which we pop them. */
-
for (available = regs_available_for_popping,
required = regs_to_pop;
required != 0 && available != 0;
@@ -706,41 +702,35 @@ thumb_exit (f, reg_containing_return_addr)
-- pops_needed;
/* If we have any popping registers left over, remove them. */
-
if (available > 0)
regs_available_for_popping &= ~ available;
/* Otherwise if we need another popping register we can use
the fourth argument register. */
-
else if (pops_needed)
{
/* If we have not found any free argument registers and
reg a4 contains the return address, we must move it. */
-
- if (regs_available_for_popping == 0 && reg_containing_return_addr == ARG_4_REGISTER)
+ if (regs_available_for_popping == 0
+ && reg_containing_return_addr == ARG_4_REGISTER)
{
asm_fprintf (f, "\tmov\t%s, %s\n",
- reg_names[ LINK_REGISTER ],
- reg_names[ ARG_4_REGISTER ]);
+ reg_names [LINK_REGISTER], reg_names [ARG_4_REGISTER]);
reg_containing_return_addr = LINK_REGISTER;
}
else if (size > 12)
{
/* Register a4 is being used to hold part of the return value,
but we have dire need of a free, low register. */
-
restore_a4 = TRUE;
asm_fprintf (f, "\tmov\t%s, %s\n",
- reg_names[ IP_REGISTER ],
- reg_names[ ARG_4_REGISTER ]);
+ reg_names [IP_REGISTER], reg_names [ARG_4_REGISTER]);
}
if (reg_containing_return_addr != ARG_4_REGISTER)
{
/* The fourth argument register is available. */
-
regs_available_for_popping |= 1 << ARG_4_REGISTER;
-- pops_needed;
@@ -748,41 +738,34 @@ thumb_exit (f, reg_containing_return_addr)
}
/* Pop as many registers as we can. */
-
- thumb_pushpop (f, regs_available_for_popping, FALSE );
+ thumb_pushpop (f, regs_available_for_popping, FALSE);
/* Process the registers we popped. */
-
if (reg_containing_return_addr == -1)
{
/* The return address was popped into the lowest numbered register. */
-
regs_to_pop &= ~ (1 << LINK_REGISTER);
- reg_containing_return_addr = number_of_first_bit_set (regs_available_for_popping);
+ reg_containing_return_addr =
+ number_of_first_bit_set (regs_available_for_popping);
/* Remove this register for the mask of available registers, so that
the return address will not be corrupted by futher pops. */
-
regs_available_for_popping &= ~ (1 << reg_containing_return_addr);
}
/* If we popped other registers then handle them here. */
-
if (regs_available_for_popping)
{
int frame_pointer;
/* Work out which register currently contains the frame pointer. */
-
frame_pointer = number_of_first_bit_set (regs_available_for_popping);
/* Move it into the correct place. */
-
- asm_fprintf (f, "\tmov\tfp, %s\n", reg_names[ frame_pointer ]);
+ asm_fprintf (f, "\tmov\tfp, %s\n", reg_names [frame_pointer]);
/* (Temporarily) remove it from the mask of popped registers. */
-
regs_available_for_popping &= ~ (1 << frame_pointer);
regs_to_pop &= ~ (1 << FRAME_POINTER);
@@ -790,20 +773,19 @@ thumb_exit (f, reg_containing_return_addr)
{
int stack_pointer;
- /* We popped the stack pointer as well, find the register that contains it. */
-
+ /* We popped the stack pointer as well, find the register that
+ contains it.*/
stack_pointer = number_of_first_bit_set (regs_available_for_popping);
/* Move it into the stack register. */
-
- asm_fprintf (f, "\tmov\tsp, %s\n", reg_names[ stack_pointer ]);
+ asm_fprintf (f, "\tmov\tsp, %s\n", reg_names [stack_pointer]);
/* At this point we have popped all necessary registers, so
do not worry about restoring regs_available_for_popping
to its correct value:
assert (pops_needed == 0)
- assert (regs_available_for_popping == (1 << stack_frame_pointer))
+ assert (regs_available_for_popping == (1 << frame_pointer))
assert (regs_to_pop == (1 << STACK_POINTER)) */
}
else
@@ -811,44 +793,27 @@ thumb_exit (f, reg_containing_return_addr)
/* Since we have just move the popped value into the frame
pointer, the popping register is available for reuse, and
we know that we still have the stack pointer left to pop. */
-
regs_available_for_popping |= (1 << frame_pointer);
}
}
- /* If we still have registers left on the stack, but we no longer
- have any registers into which we can pop them, then we must
- move the return address into the link register and make
- available the register that contained it. */
-
+ /* If we still have registers left on the stack, but we no longer have
+ any registers into which we can pop them, then we must move the return
+ address into the link register and make available the register that
+ contained it. */
if (regs_available_for_popping == 0 && pops_needed > 0)
{
regs_available_for_popping |= 1 << reg_containing_return_addr;
asm_fprintf (f, "\tmov\t%s, %s\n",
- reg_names[ LINK_REGISTER ],
- reg_names[ reg_containing_return_addr ]);
+ reg_names [LINK_REGISTER],
+ reg_names [reg_containing_return_addr]);
reg_containing_return_addr = LINK_REGISTER;
}
/* If we have registers left on the stack then pop some more.
- We know that we will only be popping one register here for
- the following reasons:
-
- 1. We know that at most we want to pop LR, FP and SP.
- 2. We have already popped at least one register.
- 3. If there were 3 registers available for popping then
- we have already popped all three of the registers.
- 4. If there were 2 registers available for popping then
- we have already popped LR and FP, so there can only
- be one register left on the stack: SP. And since we
- had two registers available for popping we will have
- left the LR in one of those registers and leaving
- only one register left for popping the SP.
- 5. If there was only 1 register available for popping
- then we can only be popping one register here. */
-
+ We know that at most we will want to pop FP and SP. */
if (pops_needed > 0)
{
int popped_into;
@@ -856,23 +821,21 @@ thumb_exit (f, reg_containing_return_addr)
thumb_pushpop (f, regs_available_for_popping, FALSE);
- /* We have popped either FP or SP. Move whichever one
- it is into the correct register. */
-
+ /* We have popped either FP or SP.
+ Move whichever one it is into the correct register. */
popped_into = number_of_first_bit_set (regs_available_for_popping);
move_to = number_of_first_bit_set (regs_to_pop);
- asm_fprintf (f, "\tmov\t%s, %s\n", reg_names[ move_to ], reg_names[ popped_into ]);
+ asm_fprintf (f, "\tmov\t%s, %s\n",
+ reg_names [move_to], reg_names [popped_into]);
regs_to_pop &= ~ (1 << move_to);
-- pops_needed;
}
-
- /* If we still have not popped everything then we must have
- only had one register available to us and we are now
- popping the SP. */
+ /* If we still have not popped everything then we must have only
+ had one register available to us and we are now popping the SP. */
if (pops_needed > 0)
{
int popped_into;
@@ -881,7 +844,7 @@ thumb_exit (f, reg_containing_return_addr)
popped_into = number_of_first_bit_set (regs_available_for_popping);
- asm_fprintf (f, "\tmov\tsp, %s\n", reg_names[ popped_into ]);
+ asm_fprintf (f, "\tmov\tsp, %s\n", reg_names [popped_into]);
/*
assert (regs_to_pop == (1 << STACK_POINTER))
@@ -892,21 +855,25 @@ thumb_exit (f, reg_containing_return_addr)
/* If necessary restore the a4 register. */
if (restore_a4)
{
- asm_fprintf (f, "\tmov\t%s, %s\n", reg_names[ LINK_REGISTER ], reg_names[ ARG_4_REGISTER ]);
- asm_fprintf (f, "\tmov\t%s, %s\n", reg_names[ ARG_4_REGISTER ], reg_names[ IP_REGISTER ]);
- reg_containing_return_addr = LINK_REGISTER;
- }
+ if (reg_containing_return_addr != LINK_REGISTER)
+ {
+ asm_fprintf (f, "\tmov\t%s, %s\n",
+ reg_names [LINK_REGISTER], reg_names [ARG_4_REGISTER]);
+ reg_containing_return_addr = LINK_REGISTER;
+ }
- /* Return to caller. */
+ asm_fprintf (f, "\tmov\t%s, %s\n",
+ reg_names [ARG_4_REGISTER], reg_names [IP_REGISTER]);
+ }
- asm_fprintf (f, "\tbx\t%s\n", reg_names[ reg_containing_return_addr ]);
+ /* Return to caller. */
+ asm_fprintf (f, "\tbx\t%s\n", reg_names [reg_containing_return_addr]);
}
/* Emit code to push or pop registers to or from the stack. */
-
static void
thumb_pushpop (f, mask, push)
- FILE *f;
+ FILE * f;
int mask;
int push;
{
@@ -915,7 +882,8 @@ thumb_pushpop (f, mask, push)
if (lo_mask == 0 && ! push && (mask & (1 << 15)))
{
- /* Special case. Do not generate a POP PC statement here, do it in thumb_exit() */
+ /* Special case. Do not generate a POP PC statement here, do it in
+ thumb_exit() */
thumb_exit (f, -1);
return;
@@ -1762,6 +1730,10 @@ thumb_print_operand (f, x, code)
fputs (ASM_COMMENT_START, f);
return;
+ case '_':
+ fputs (USER_LABEL_PREFIX, f);
+ return;
+
case 'D':
if (x)
fputs (thumb_condition_code (x, 1), f);
diff --git a/gcc/config/arm/thumb.h b/gcc/config/arm/thumb.h
index 0d3051cf0a1..0f6c60c6390 100644
--- a/gcc/config/arm/thumb.h
+++ b/gcc/config/arm/thumb.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for ARM/Thumb.
- Copyright (C) 19996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
The basis of this contribution was generated by
Richard Earnshaw, Advanced RISC Machines Ltd
@@ -472,9 +472,15 @@ extern char * structure_size_string;
#define MODES_TIEABLE_P(MODE1,MODE2) 1
+/* The NOARG_LO_REGS class is the set of LO_REGS that are not used for passing
+ arguments to functions. These are the registers that are available for
+ spilling during reload. The code in reload1.c:init_reload() will detect this
+ class and place it into 'reload_address_base_reg_class'. */
+
enum reg_class
{
NO_REGS,
+ NONARG_LO_REGS,
LO_REGS,
STACK_REG,
BASE_REGS,
@@ -490,6 +496,7 @@ enum reg_class
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
+ "NONARG_LO_REGS", \
"LO_REGS", \
"STACK_REG", \
"BASE_REGS", \
@@ -500,6 +507,7 @@ enum reg_class
#define REG_CLASS_CONTENTS \
{ \
0x00000, \
+ 0x000f0, \
0x000ff, \
0x02000, \
0x020ff, \
@@ -509,7 +517,8 @@ enum reg_class
#define REGNO_REG_CLASS(REGNO) \
((REGNO) == STACK_POINTER_REGNUM ? STACK_REG \
- : (REGNO) < 8 ? LO_REGS \
+ : (REGNO) < 8 ? ((REGNO) < 4 ? LO_REGS \
+ : NONARG_LO_REGS) \
: HI_REGS)
#define BASE_REG_CLASS BASE_REGS
@@ -555,8 +564,15 @@ enum reg_class
abort. Alternatively, this could be fixed by modifying BASE_REG_CLASS
to be LO_REGS instead of BASE_REGS. It is not clear what affect this
change would have. */
+/* ??? This looks even more suspiciously wrong. PREFERRED_RELOAD_CLASS
+ must always return a strict subset of the input class. Just blindly
+ returning LO_REGS is safe only if the input class is a superset of LO_REGS,
+ but there is no check for this. Added another exception for NONARG_LO_REGS
+ because it is not a superset of LO_REGS. */
+/* ??? We now use NONARG_LO_REGS for caller_save_spill_class, so the
+ comments about BASE_REGS are now obsolete. */
#define PREFERRED_RELOAD_CLASS(X,CLASS) \
- ((CLASS) == BASE_REGS ? (CLASS) \
+ ((CLASS) == BASE_REGS || (CLASS) == NONARG_LO_REGS ? (CLASS) \
: LO_REGS)
/*
((CONSTANT_P ((X)) && GET_CODE ((X)) != CONST_INT \
@@ -565,9 +581,10 @@ enum reg_class
&& (unsigned HOST_WIDE_INT) INTVAL ((X)) > 255) ? NO_REGS \
: LO_REGS) */
-/* Must leave BASE_REGS reloads alone, see comment above. */
+/* Must leave BASE_REGS and NONARG_LO_REGS reloads alone, see comment
+ above. */
#define SECONDARY_RELOAD_CLASS(CLASS,MODE,X) \
- ((CLASS) != LO_REGS && (CLASS) != BASE_REGS \
+ ((CLASS) != LO_REGS && (CLASS) != BASE_REGS && (CLASS) != NONARG_LO_REGS \
? ((true_regnum (X) == -1 ? LO_REGS \
: (true_regnum (X) + HARD_REGNO_NREGS (0, MODE) > 8) ? LO_REGS \
: NO_REGS)) \
@@ -885,6 +902,16 @@ int thumb_shiftable_const ();
else if (GET_CODE (X) == PLUS) \
{ \
/* REG+REG address can be any two index registers. */ \
+ /* ??? REG+REG addresses have been completely disabled before \
+ reload completes, because we do not have enough available \
+ reload registers. We only have 3 guaranteed reload registers \
+ (NONARG_LO_REGS - the frame pointer), but we need at least 4 \
+ to support REG+REG addresses. We have left them enabled after \
+ reload completes, in the hope that reload_cse_regs and related \
+ routines will be able to create them after the fact. It is \
+ probably possible to support REG+REG addresses with additional \
+ reload work, but I do not not have enough time to attempt such \
+ a change at this time. */ \
/* ??? Normally checking the mode here is wrong, since it isn't \
impossible to use REG+REG with DFmode. However, the movdf \
pattern requires offsettable addresses, and REG+REG is not \
@@ -898,10 +925,14 @@ int thumb_shiftable_const ();
will be replaced with STACK, and SP relative addressing only \
permits SP+OFFSET. */ \
if (GET_MODE_SIZE (MODE) <= 4 \
+ /* ??? See comment above. */ \
+ && reload_completed \
&& GET_CODE (XEXP (X, 0)) == REG \
&& GET_CODE (XEXP (X, 1)) == REG \
- && XEXP (X, 0) != frame_pointer_rtx \
- && XEXP (X, 1) != frame_pointer_rtx \
+ && XEXP (X, 0) != frame_pointer_rtx \
+ && XEXP (X, 1) != frame_pointer_rtx \
+ && XEXP (X, 0) != virtual_stack_vars_rtx \
+ && XEXP (X, 1) != virtual_stack_vars_rtx \
&& REG_OK_FOR_INDEX_P (XEXP (X, 0)) \
&& REG_OK_FOR_INDEX_P (XEXP (X, 1))) \
goto WIN; \
@@ -926,6 +957,32 @@ int thumb_shiftable_const ();
} \
}
+/* ??? If an HImode FP+large_offset address is converted to an HImode
+ SP+large_offset address, then reload won't know how to fix it. It sees
+ only that SP isn't valid for HImode, and so reloads the SP into an index
+ register, but the resulting address is still invalid because the offset
+ is too big. We fix it here instead by reloading the entire address. */
+/* We could probably achieve better results by defining PROMOTE_MODE to help
+ cope with the variances between the Thumb's signed and unsigned byte and
+ halfword load instructions. */
+#define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \
+{ \
+ if (GET_CODE (X) == PLUS \
+ && GET_MODE_SIZE (MODE) < 4 \
+ && GET_CODE (XEXP (X, 0)) == REG \
+ && XEXP (X, 0) == stack_pointer_rtx \
+ && GET_CODE (XEXP (X, 1)) == CONST_INT \
+ && ! LEGITIMATE_OFFSET (MODE, INTVAL (XEXP (X, 1)))) \
+ { \
+ rtx orig_X = X; \
+ X = copy_rtx (X); \
+ push_reload (orig_X, NULL_RTX, &X, NULL_PTR, \
+ reload_address_base_reg_class, \
+ Pmode, VOIDmode, 0, 0, OPNUM, TYPE); \
+ goto WIN; \
+ } \
+}
+
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)
@@ -1045,7 +1102,7 @@ int thumb_shiftable_const ();
output_addr_const ((STREAM), (X)); \
}
-#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '@')
+#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '@' || ((CODE) == '_'))
/* Emit a special directive when defining a function name.
This is used by the assembler to assit with interworking. */
diff --git a/gcc/config/arm/thumb.md b/gcc/config/arm/thumb.md
index 2334aa1b10c..93d0c050314 100644
--- a/gcc/config/arm/thumb.md
+++ b/gcc/config/arm/thumb.md
@@ -1,5 +1,5 @@
;; thumb.md Machine description for ARM/Thumb processors
-;; Copyright (C) 19996, 1997, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
;; The basis of this contribution was generated by
;; Richard Earnshaw, Advanced RISC Machines Ltd
@@ -470,7 +470,7 @@
")
(define_insn "*extendqisi2_insn"
- [(set (match_operand:SI 0 "register_operand" "=l,&l")
+ [(set (match_operand:SI 0 "register_operand" "=l,l")
(sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))]
""
"*
@@ -484,16 +484,37 @@
{
ops[1] = XEXP (XEXP (operands[1], 0), 0);
ops[2] = XEXP (XEXP (operands[1], 0), 1);
+
+ if (GET_CODE (ops[1]) == REG && GET_CODE (ops[2]) == REG)
+ output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops);
+ else if (GET_CODE (ops[1]) == REG)
+ {
+ if (REGNO (ops[1]) == REGNO (operands[0]))
+ output_asm_insn (\"ldrb\\t%0, [%1, %2]\;lsl\\t%0, %0, #24\;asr\\t%0, %0, #24\", ops);
+ else
+ output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+ }
+ else
+ {
+ if (REGNO (ops[2]) == REGNO (operands[0]))
+ output_asm_insn (\"ldrb\\t%0, [%2, %1]\;lsl\\t%0, %0, #24\;asr\\t%0, %0, #24\", ops);
+ else
+ output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+ }
+ }
+ else if (REGNO (operands[0]) == REGNO (XEXP (operands[1], 0)))
+ {
+ output_asm_insn (\"ldrb\\t%0, [%0, #0]\;lsl\\t%0, %0, #24\;asr\\t%0, %0, #24\", ops);
}
else
{
ops[1] = XEXP (operands[1], 0);
ops[2] = const0_rtx;
+ output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
}
- output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
return \"\";
}"
-[(set_attr "length" "2,4")])
+[(set_attr "length" "2,6")])
;; We don't really have extzv, but defining this using shifts helps
;; to reduce register pressure later on.
@@ -990,7 +1011,7 @@
[(call (mem:SI (match_operand:SI 0 "register_operand" "l*r"))
(match_operand 1 "" ""))]
"! TARGET_CALLER_INTERWORKING"
- "bl\\t__call_via_%0"
+ "bl\\t%__call_via_%0"
[(set_attr "length" "4")])
;; The non THUMB_INTERWORK, non TARGET_CALLER_INTERWORKING version
;; used to be: "mov\\tlr,pc\;bx\\t%0", but the mov does not set
@@ -1001,7 +1022,7 @@
[(call (mem:SI (match_operand:SI 0 "register_operand" "l*r"))
(match_operand 1 "" ""))]
"TARGET_CALLER_INTERWORKING"
- "bl\\t__interwork_call_via_%0"
+ "bl\\t%__interwork_call_via_%0"
[(set_attr "length" "4")])
(define_expand "call_value"
@@ -1016,7 +1037,7 @@
(call (mem:SI (match_operand:SI 1 "register_operand" "l*r"))
(match_operand 2 "" "")))]
"! TARGET_CALLER_INTERWORKING"
- "bl\\t__call_via_%1"
+ "bl\\t%__call_via_%1"
[(set_attr "length" "4")])
;; See comment for call_indirect pattern
@@ -1025,7 +1046,7 @@
(call (mem:SI (match_operand:SI 1 "register_operand" "l*r"))
(match_operand 2 "" "")))]
"TARGET_CALLER_INTERWORKING"
- "bl\\t__interwork_call_via_%1"
+ "bl\\t%__interwork_call_via_%1"
[(set_attr "length" "4")])
diff --git a/gcc/config/clipper/clipper.h b/gcc/config/clipper/clipper.h
index 407caa2345f..8ce8c473f59 100644
--- a/gcc/config/clipper/clipper.h
+++ b/gcc/config/clipper/clipper.h
@@ -815,8 +815,10 @@ do \
in one reasonably fast instruction. */
#define MOVE_MAX 4
-/* MOVE_RATIO is the number of move instructions that is better than a
- block move. Make this large on clipper, since the block move is very
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead.
+
+ Make this large on clipper, since the block move is very
inefficient with small blocks, and the hard register needs of the
block move require much reload work. */
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index dc9763ee32d..e7bcdced235 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -1531,8 +1531,6 @@ override_options ()
}
}
-enum rtx_code save_next_cc_user_code;
-
enum rtx_code
next_cc_user_code (insn)
rtx insn;
@@ -1551,6 +1549,22 @@ rtx insn;
abort ();
}
+int
+next_cc_user_unsigned (insn)
+ rtx insn;
+{
+ switch (next_cc_user_code (insn))
+ {
+ case GTU:
+ case GEU:
+ case LTU:
+ case LEU:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
void
print_operand(file, op, letter)
FILE *file;
@@ -1624,12 +1638,13 @@ int letter;
output_address( XEXP(op,0) );
else if( code == CONST_INT )
{
+ HOST_WIDE_INT val = INTVAL (op);
if( letter == 'H' )
- fprintf( file, "0x%x", (INTVAL(op) & 0xffff) );
+ fprintf( file, HOST_WIDE_INT_PRINT_HEX, val & 0xffff);
else if (letter == 'h')
- fprintf( file, "%d", INTVAL (op) );
+ fprintf( file, HOST_WIDE_INT_PRINT_DEC, val);
else if( letter == 'U' )
- fprintf( file, "0x%x", ((INTVAL(op) & 0xffff0000) >> 16) & 0xffff );
+ fprintf( file, HOST_WIDE_INT_PRINT_HEX, (val >> 16) & 0xffff);
else
output_addr_const( file, op );
}
diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h
index ee4b140ba2f..d63cc800337 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -76,7 +76,7 @@ extern void bss_section ();
extern struct rtx_def *dsp16xx_function_arg ();
extern void dsp16xx_function_arg_advance ();
extern enum rtx_code next_cc_user_code ();
-extern enum rtx_code save_next_cc_user_code;
+extern int next_cc_user_unsigned ();
extern struct rtx_def *gen_tst_reg ();
extern char *output_block_move();
@@ -138,7 +138,7 @@ extern char *output_block_move();
/* Tell gcc where to look for the startfile */
#define STANDARD_STARTFILE_PREFIX "/d1600/lib"
-/* Tell gcc where to look for it's executables */
+/* Tell gcc where to look for its executables */
#define STANDARD_EXEC_PREFIX "/d1600/bin"
/* Command line options to the AT&T assembler */
@@ -282,35 +282,25 @@ extern int target_flags;
on a particular target machine. You can define a macro
`OVERRIDE_OPTIONS' to take account of this. This macro, if
defined, is executed once just after all the command options have
- been parsed. */
+ been parsed.
+
+ Don't use this macro to turn on various extra optimizations for
+ `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
#define OVERRIDE_OPTIONS override_options ()
-#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
-{ \
- flag_gnu_linker = FALSE; \
- \
- if (LEVEL) \
- { \
- flag_omit_frame_pointer = TRUE; \
- flag_thread_jumps = TRUE; \
- } \
- \
- if (LEVEL >= 2) \
- { \
- if (! SIZE) \
- flag_strength_reduce = TRUE; \
- flag_cse_follow_jumps = TRUE; \
- flag_cse_skip_blocks = TRUE; \
- flag_expensive_optimizations = TRUE; \
- flag_rerun_cse_after_loop = TRUE; \
- } \
- \
- if ((LEVEL >= 3) && ! SIZE) \
- { \
- flag_inline_functions = 1; \
- } \
-}
+#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
+do \
+ { \
+ flag_gnu_linker = FALSE; \
+ \
+ if (SIZE) \
+ { \
+ flag_strength_reduce = FALSE; \
+ flag_inline_functions = FALSE; \
+ } \
+ } \
+while (0)
/* STORAGE LAYOUT */
@@ -436,7 +426,7 @@ extern int target_flags;
The hardware registers are assigned numbers for the compiler
from 0 to FIRST_PSEUDO_REGISTER-1 */
-#define FIRST_PSEUDO_REGISTER REG_YBASE31 + 1
+#define FIRST_PSEUDO_REGISTER (REG_YBASE31 + 1)
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator.
@@ -1131,11 +1121,11 @@ extern struct dsp16xx_frame_info current_frame_info;
#define VALUE_REGNO(MODE) (REG_Y)
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))
+ gen_rtx_REG (TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
-#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, VALUE_REGNO(MODE))
+#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, VALUE_REGNO(MODE))
/* 1 if N is a possible register number for a function value. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_Y)
diff --git a/gcc/config/dsp16xx/dsp16xx.md b/gcc/config/dsp16xx/dsp16xx.md
index 9274f47082e..9923178d90c 100644
--- a/gcc/config/dsp16xx/dsp16xx.md
+++ b/gcc/config/dsp16xx/dsp16xx.md
@@ -149,14 +149,10 @@
if (GET_CODE (operands[1]) == CONST_INT)
operands[1] = force_reg (HImode, operands[1]);
- if (operands[0]) /* Avoid unused code warning */
- {
- dsp16xx_compare_gen = gen_compare_reg;
- dsp16xx_compare_op0 = operands[0];
- dsp16xx_compare_op1 = operands[1];
- DONE;
- }
-
+ dsp16xx_compare_gen = gen_compare_reg;
+ dsp16xx_compare_op0 = operands[0];
+ dsp16xx_compare_op1 = operands[1];
+ DONE;
}")
(define_insn ""
@@ -167,10 +163,7 @@
(clobber (match_scratch:QI 3 "=&A"))
(clobber (match_scratch:QI 4 "=&A"))
(clobber (match_scratch:QI 5 "=&A"))]
- "(save_next_cc_user_code = next_cc_user_code (insn)) == GTU \
- || save_next_cc_user_code == GEU \
- || save_next_cc_user_code == LTU \
- || save_next_cc_user_code == LEU"
+ "next_cc_user_unsigned (insn)"
"*
{
if (GET_CODE(operands[0]) == REG)
@@ -195,7 +188,7 @@
{
rtx xoperands[2];
- xoperands[0] = gen_rtx (REG, HImode, REG_A0);
+ xoperands[0] = gen_rtx_REG (HImode, REG_A0);
xoperands[1] = operands[0];
double_reg_from_memory (xoperands);
}
@@ -218,7 +211,7 @@
{
rtx xoperands[2];
- xoperands[0] = gen_rtx (REG, HImode, REG_A1);
+ xoperands[0] = gen_rtx_REG (HImode, REG_A1);
xoperands[1] = operands[1];
double_reg_from_memory (xoperands);
}
@@ -262,10 +255,7 @@
(match_operand:QI 1 "nonmemory_operand" "w,z,u,i,w,z,k,i")))
(clobber (match_scratch:QI 2 "=j,j,j,j,q,q,q,q"))
(clobber (match_scratch:QI 3 "=v,y,q,X,v,y,j,X"))]
- "(save_next_cc_user_code = next_cc_user_code (insn)) == GTU \
- || save_next_cc_user_code == GEU \
- || save_next_cc_user_code == LTU \
- || save_next_cc_user_code == LEU"
+ "next_cc_user_unsigned (insn)"
"@
%2=0\;%3=0\;%2-%3
%2=0\;%3=0\;%2-%3
@@ -302,7 +292,7 @@
"
{
if (!dsp16xx_cmphf3_libcall)
- dsp16xx_cmphf3_libcall = gen_rtx (SYMBOL_REF, Pmode, CMPHF3_LIBCALL);
+ dsp16xx_cmphf3_libcall = gen_rtx_SYMBOL_REF (Pmode, CMPHF3_LIBCALL);
dsp16xx_compare_gen = gen_compare_reg;
dsp16xx_compare_op0 = operands[0];
@@ -426,7 +416,7 @@
"
{
if (!dsp16xx_addhf3_libcall)
- dsp16xx_addhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, ADDHF3_LIBCALL);
+ dsp16xx_addhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, ADDHF3_LIBCALL);
emit_library_call (dsp16xx_addhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -506,7 +496,7 @@
"
{
if (!dsp16xx_subhf3_libcall)
- dsp16xx_subhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, SUBHF3_LIBCALL);
+ dsp16xx_subhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, SUBHF3_LIBCALL);
emit_library_call (dsp16xx_subhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -529,7 +519,7 @@
"
{
if (!dsp16xx_neghf2_libcall)
- dsp16xx_neghf2_libcall = gen_rtx (SYMBOL_REF, Pmode, NEGHF2_LIBCALL);
+ dsp16xx_neghf2_libcall = gen_rtx_SYMBOL_REF (Pmode, NEGHF2_LIBCALL);
emit_library_call (dsp16xx_neghf2_libcall, 1, HFmode, 1,
operands[1], HFmode);
@@ -553,7 +543,7 @@
"
{
if (!dsp16xx_mulhi3_libcall)
- dsp16xx_mulhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, MULHI3_LIBCALL);
+ dsp16xx_mulhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MULHI3_LIBCALL);
emit_library_call (dsp16xx_mulhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -595,7 +585,7 @@
"
{
if (!dsp16xx_mulhf3_libcall)
- dsp16xx_mulhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, MULHF3_LIBCALL);
+ dsp16xx_mulhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, MULHF3_LIBCALL);
emit_library_call (dsp16xx_mulhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -620,7 +610,7 @@
"
{
if (!dsp16xx_divhi3_libcall)
- dsp16xx_divhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, DIVHI3_LIBCALL);
+ dsp16xx_divhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVHI3_LIBCALL);
emit_library_call (dsp16xx_divhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -637,7 +627,7 @@
"
{
if (!dsp16xx_udivhi3_libcall)
- dsp16xx_udivhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UDIVHI3_LIBCALL);
+ dsp16xx_udivhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UDIVHI3_LIBCALL);
emit_library_call (dsp16xx_udivhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -654,7 +644,7 @@
"
{
if (!dsp16xx_divqi3_libcall)
- dsp16xx_divqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, DIVQI3_LIBCALL);
+ dsp16xx_divqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVQI3_LIBCALL);
emit_library_call (dsp16xx_divqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -671,7 +661,7 @@
"
{
if (!dsp16xx_udivqi3_libcall)
- dsp16xx_udivqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UDIVQI3_LIBCALL);
+ dsp16xx_udivqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UDIVQI3_LIBCALL);
emit_library_call (dsp16xx_udivqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -695,7 +685,7 @@
"
{
if (!dsp16xx_modhi3_libcall)
- dsp16xx_modhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, MODHI3_LIBCALL);
+ dsp16xx_modhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MODHI3_LIBCALL);
emit_library_call (dsp16xx_modhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -712,7 +702,7 @@
"
{
if (!dsp16xx_umodhi3_libcall)
- dsp16xx_umodhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UMODHI3_LIBCALL);
+ dsp16xx_umodhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UMODHI3_LIBCALL);
emit_library_call (dsp16xx_umodhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -729,7 +719,7 @@
"
{
if (!dsp16xx_modqi3_libcall)
- dsp16xx_modqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, MODQI3_LIBCALL);
+ dsp16xx_modqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MODQI3_LIBCALL);
emit_library_call (dsp16xx_modqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -746,7 +736,7 @@
"
{
if (!dsp16xx_umodqi3_libcall)
- dsp16xx_umodqi3_libcall = gen_rtx (SYMBOL_REF, Pmode, UMODQI3_LIBCALL);
+ dsp16xx_umodqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UMODQI3_LIBCALL);
emit_library_call (dsp16xx_umodqi3_libcall, 1, QImode, 2,
operands[1], QImode,
@@ -763,7 +753,7 @@
"
{
if (!dsp16xx_divhf3_libcall)
- dsp16xx_divhf3_libcall = gen_rtx (SYMBOL_REF, Pmode, DIVHF3_LIBCALL);
+ dsp16xx_divhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVHF3_LIBCALL);
emit_library_call (dsp16xx_divhf3_libcall, 1, HFmode, 2,
operands[1], HFmode,
@@ -1322,7 +1312,7 @@
"
{
if (!dsp16xx_floathihf2_libcall)
- dsp16xx_floathihf2_libcall = gen_rtx (SYMBOL_REF, Pmode, FLOATHIHF2_LIBCALL);
+ dsp16xx_floathihf2_libcall = gen_rtx_SYMBOL_REF (Pmode, FLOATHIHF2_LIBCALL);
emit_library_call (dsp16xx_floathihf2_libcall, 1, HFmode, 1,
operands[1], HImode);
@@ -1337,7 +1327,7 @@
"
{
if (!dsp16xx_fixhfhi2_libcall)
- dsp16xx_fixhfhi2_libcall = gen_rtx (SYMBOL_REF, Pmode, FIXHFHI2_LIBCALL);
+ dsp16xx_fixhfhi2_libcall = gen_rtx_SYMBOL_REF (Pmode, FIXHFHI2_LIBCALL);
emit_library_call (dsp16xx_fixhfhi2_libcall, 1, HImode, 1,
operands[1], HFmode);
@@ -1448,7 +1438,7 @@
#if 0
if (!dsp16xx_ashrhi3_libcall)
- dsp16xx_ashrhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, ASHRHI3_LIBCALL);
+ dsp16xx_ashrhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, ASHRHI3_LIBCALL);
emit_library_call (dsp16xx_ashrhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -1572,7 +1562,7 @@
rtx label2 = gen_label_rtx ();
#if 0
if (!dsp16xx_lshrhi3_libcall)
- dsp16xx_lshrhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, LSHRHI3_LIBCALL);
+ dsp16xx_lshrhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, LSHRHI3_LIBCALL);
emit_library_call (dsp16xx_lshrhi3_libcall, 1, HImode, 2,
operands[1], HImode,
@@ -1714,7 +1704,7 @@
rtx label2 = gen_label_rtx ();
#if 0
if (!dsp16xx_ashlhi3_libcall)
- dsp16xx_ashlhi3_libcall = gen_rtx (SYMBOL_REF, Pmode, ASHLHI3_LIBCALL);
+ dsp16xx_ashlhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, ASHLHI3_LIBCALL);
emit_library_call (dsp16xx_ashlhi3_libcall, 1, HImode, 2,
operands[1], HImode,
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 4ff8e028cc7..2acc3852dd7 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -1,7 +1,7 @@
/* This is a software floating point library which can be used instead of
the floating point routines in libgcc1.c for targets without hardware
floating point.
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -150,6 +150,9 @@ __negtf2 (){ abort(); }
__netf2 (){ abort(); }
__subtf3 (){ abort(); }
__trunctfdf2 (){ abort(); }
+__gexf2 (){ abort(); }
+__fixxfsi (){ abort(); }
+__floatsixf (){ abort(); }
#else /* !EXTENDED_FLOAT_STUBS, rest of file */
@@ -286,7 +289,9 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
#endif
+#ifndef INLINE
#define INLINE __inline__
+#endif
/* Preserve the sticky-bit when shifting fractions to the right. */
#define LSHIFT(a) { a = (a & 1) | (a >> 1); }
@@ -455,7 +460,6 @@ pack_d ( fp_number_type * src)
else if (fraction == 0)
{
exp = 0;
- sign = 0;
}
else
{
@@ -663,6 +667,12 @@ _fpadd_parts (fp_number_type * a,
}
if (iszero (b))
{
+ if (iszero (a))
+ {
+ *tmp = *a;
+ tmp->sign = a->sign & b->sign;
+ return tmp;
+ }
return a;
}
if (iszero (a))
@@ -724,7 +734,7 @@ _fpadd_parts (fp_number_type * a,
{
tfraction = a_fraction - b_fraction;
}
- if (tfraction > 0)
+ if (tfraction >= 0)
{
tmp->sign = 0;
tmp->normal_exp = a_normal_exp;
@@ -847,13 +857,13 @@ _fpmul_parts ( fp_number_type * a,
/* Calculate the mantissa by multiplying both 64bit numbers to get a
128 bit number */
{
- fractype x = a->fraction.ll;
- fractype ylow = b->fraction.ll;
- fractype yhigh = 0;
- int bit;
-
#if defined(NO_DI_MODE)
{
+ fractype x = a->fraction.ll;
+ fractype ylow = b->fraction.ll;
+ fractype yhigh = 0;
+ int bit;
+
/* ??? This does multiplies one bit at a time. Optimize. */
for (bit = 0; bit < FRAC_NBITS; bit++)
{
@@ -992,14 +1002,10 @@ _fpdiv_parts (fp_number_type * a,
fp_number_type * b,
fp_number_type * tmp)
{
- fractype low = 0;
- fractype high = 0;
- fractype r0, r1, y0, y1, bit;
- fractype q;
+ fractype bit;
fractype numerator;
fractype denominator;
fractype quotient;
- fractype remainder;
if (isnan (a))
{
@@ -1028,15 +1034,12 @@ _fpdiv_parts (fp_number_type * a,
if (iszero (b))
{
a->class = CLASS_INFINITY;
- return b;
+ return a;
}
/* Calculate the mantissa by multiplying both 64bit numbers to get a
128 bit number */
{
- int carry;
- intfrac d0, d1; /* weren't unsigned before ??? */
-
/* quotient =
( numerator / denominator) * 2^(numerator exponent - denominator exponent)
*/
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 8ff9ec460f9..603b3e0f64e 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -1,5 +1,5 @@
/* Subroutines for insn-output.c for Hitachi H8/300.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@@ -127,7 +127,7 @@ byte_reg (x, b)
(interrupt_handler \
|| pragma_saveall \
|| (regno == FRAME_POINTER_REGNUM && regs_ever_live[regno]) \
- || (regs_ever_live[regno] & !call_used_regs[regno])))
+ || (regs_ever_live[regno] && !call_used_regs[regno])))
/* Output assembly language to FILE for the operation OP with operand size
SIZE to adjust the stack pointer. */
@@ -856,17 +856,13 @@ eq_operator (x, mode)
with this attribute may be safely used in an interrupt vector. */
int
-handle_pragma (file, t)
- FILE *file;
- tree t;
+handle_pragma (p_getc, p_ungetc, pname)
+ int (* p_getc) PROTO ((void));
+ void (* p_ungetc) PROTO ((int));
+ char * pname;
{
int retval = 0;
- register char *pname;
-
- if (TREE_CODE (t) != IDENTIFIER_NODE)
- return 0;
- pname = IDENTIFIER_POINTER (t);
if (strcmp (pname, "interrupt") == 0)
interrupt_handler = retval = 1;
else if (strcmp (pname, "saveall") == 0)
@@ -1024,7 +1020,6 @@ const_costs (r, c)
'E' like s but negative.
'F' like t but negative.
'G' constant just the negative
- 'L' fake label, changed after used twice.
'M' turn a 'M' constant into its negative mod 2.
'P' if operand is incing/decing sp, print .w, otherwise .b.
'R' print operand as a byte:8 address if appropriate, else fall back to
@@ -1098,9 +1093,6 @@ print_operand (file, x, code)
rtx x;
int code;
{
- /* This is used to general unique labels for the 'L' code. */
- static int lab = 1000;
-
/* This is used for communication between the 'P' and 'U' codes. */
static char *last_p;
@@ -1149,12 +1141,6 @@ print_operand (file, x, code)
abort ();
fprintf (file, "#%d", 0xff & (-INTVAL (x)));
break;
- case 'L':
- /* 'L' must always be used twice in a single pattern. It generates
- the same label twice, and then will generate a unique label the
- next time it is used. */
- asm_fprintf (file, "tl%d", (lab++) / 2);
- break;
case 'M':
/* For 3/-3 and 4/-4, the other 2 is handled separately. */
switch (INTVAL (x))
@@ -1588,8 +1574,7 @@ initial_offset (from, to)
int regno;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if ((regs_ever_live[regno]
- && (!call_used_regs[regno] || regno == FRAME_POINTER_REGNUM)))
+ if (WORD_REG_USED (regno))
offset += UNITS_PER_WORD;
/* See the comments for get_frame_size. We need to round it up to
@@ -2378,6 +2363,24 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
return SHIFT_SPECIAL;
}
}
+ else if (count == 8 && !TARGET_H8300)
+ {
+ switch (shift_type)
+ {
+ case SHIFT_ASHIFT:
+ *assembler_p = "mov.w\t%e0,%f4\n\tmov.b\t%s4,%t4\n\tmov.b\t%t0,%s4\n\tmov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tmov.w\t%f4,%e0";
+ *cc_valid_p = 0;
+ return SHIFT_SPECIAL;
+ case SHIFT_LSHIFTRT:
+ *assembler_p = "mov.w\t%e0,%f4\n\tmov.b\t%t0,%s0\n\tmov.b\t%s4,%t0\n\tmov.b\t%t4,%s4\n\textu.w\t%f4\n\tmov.w\t%f4,%e0";
+ *cc_valid_p = 0;
+ return SHIFT_SPECIAL;
+ case SHIFT_ASHIFTRT:
+ *assembler_p = "mov.w\t%e0,%f4\n\tmov.b\t%t0,%s0\n\tmov.b\t%s4,%t0\n\tmov.b\t%t4,%s4\n\texts.w\t%f4\n\tmov.w\t%f4,%e0";
+ *cc_valid_p = 0;
+ return SHIFT_SPECIAL;
+ }
+ }
else if (count == 16)
{
switch (shift_type)
@@ -2489,6 +2492,24 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
return SHIFT_SPECIAL;
}
}
+ else if (count == 24 && !TARGET_H8300)
+ {
+ switch (shift_type)
+ {
+ case SHIFT_ASHIFT:
+ *assembler_p = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tmov.w\t%f0,%e0\n\tsub.w\t%f0,%f0";
+ *cc_valid_p = 0;
+ return SHIFT_SPECIAL;
+ case SHIFT_LSHIFTRT:
+ *assembler_p = "mov.w\t%e0,%f0\n\tmov.b\t%t0,%s0\n\textu.w\t%f0\n\textu.l\t%S0";
+ *cc_valid_p = 0;
+ return SHIFT_SPECIAL;
+ case SHIFT_ASHIFTRT:
+ *assembler_p = "mov.w\t%e0,%f0\n\tmov.b\t%t0,%s0\n\texts.w\t%f0\n\texts.l\t%S0";
+ *cc_valid_p = 0;
+ return SHIFT_SPECIAL;
+ }
+ }
else if (count >= 28 && count <= 30 && !TARGET_H8300)
{
if (shift_type == SHIFT_ASHIFTRT)
@@ -2970,7 +2991,7 @@ h8300_encode_label (decl)
newstr = obstack_alloc (saveable_obstack, len + 2);
strcpy (newstr + 1, str);
- *newstr = '*';
+ *newstr = '&';
XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
}
@@ -3001,7 +3022,7 @@ output_simode_bld (bild, log2, operands)
return "";
}
-/* Given INSN and it's current length LENGTH, return the adjustment
+/* Given INSN and its current length LENGTH, return the adjustment
(in bytes) to correctly compute INSN's length.
We use this to get the lengths of various memory references correct. */
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 8a492d76985..f159174980d 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1117,7 +1117,7 @@ readonly_data() \
} \
}
-#define TINY_DATA_NAME_P(NAME) (*(NAME) == '*')
+#define TINY_DATA_NAME_P(NAME) (*(NAME) == '&')
/* If we are referencing a function that is supposed to be called
through the function vector, the SYMBOL_REF_FLAG in the rtl
@@ -1138,7 +1138,7 @@ readonly_data() \
/* Store the user-specified part of SYMBOL_NAME in VAR.
This is sort of inverse to ENCODE_SECTION_INFO. */
#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
- (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@');
+ (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@' || (SYMBOL_NAME)[0] == '&')
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
@@ -1202,7 +1202,10 @@ readonly_data() \
#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. */
+ 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)
@@ -1355,11 +1358,17 @@ do { char dstr[30]; \
/* Define this macro if you want to implement any pragmas. If defined, it
should be a C expression to be executed when #pragma is seen. The
- argument STREAM is the stdio input stream from which the source
- text can be read. CH is the first character after the #pragma. The
- result of the expression is the terminating character found
- (newline or EOF). */
-#define HANDLE_PRAGMA(FILE, NODE) handle_pragma (FILE, NODE)
+ argument GETC is a function which will return the next character in the
+ input stream, or EOF if no characters are left. The argument UNGETC is
+ a function which will push a character back into the input stream. The
+ argument NAME is the word following #pragma in the input stream. The input
+ stream pointer will be pointing just beyond the end of this word. The
+ expression should return true if it handled the pragma, false otherwise.
+ The input stream should be left undistrubed if false is returned, otherwise
+ it should be pointing at the last character after the end of the pragma
+ (newline or end-of-file). */
+#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
+extern int handle_pragma ();
#define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index ebc1a29cea4..a94a5ad55b2 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -1487,7 +1487,7 @@
else if (get_attr_length (insn) == 4)
return \"b%j1 %l0:16\";
else
- return \"b%k1 %L0\;jmp @%l0\;%L0:\";
+ return \"b%k1 .Lh8BR%=\;jmp @%l0\\n.Lh8BR%=:\";
}"
[(set_attr "type" "branch")
(set_attr "cc" "none")])
@@ -1516,7 +1516,7 @@
else if (get_attr_length (insn) == 4)
return \"b%k1 %l0:16\";
else
- return \"b%j1 %L0\;jmp @%l0\;%L0:\";
+ return \"b%j1 .Lh8BR%=\;jmp @%l0\\n.Lh8BR%=:\";
}"
[(set_attr "type" "branch")
(set_attr "cc" "none")])
diff --git a/gcc/config/i386/386bsd.h b/gcc/config/i386/386bsd.h
index 25994376aea..7962321325c 100644
--- a/gcc/config/i386/386bsd.h
+++ b/gcc/config/i386/386bsd.h
@@ -69,7 +69,7 @@
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions. */
diff --git a/gcc/config/i386/aix386ng.h b/gcc/config/i386/aix386ng.h
index ec283a4fa4e..a177b69250f 100644
--- a/gcc/config/i386/aix386ng.h
+++ b/gcc/config/i386/aix386ng.h
@@ -46,8 +46,8 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Dps2 -Dunix -Asystem(aix)"
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
- "%{posix:-D_POSIX_SOURCE}%{!posix:-DAIX} -D_I386 -D_AIX -D_MBCS"
+#define CPP_SPEC "%(cpp_cpu) \
+ %{posix:-D_POSIX_SOURCE}%{!posix:-DAIX} -D_I386 -D_AIX -D_MBCS"
/* special flags for the aix assembler to generate the short form for all
qualifying forward reference */
diff --git a/gcc/config/i386/crtdll.h b/gcc/config/i386/crtdll.h
index c6b219ae020..9a6d9a176a9 100644
--- a/gcc/config/i386/crtdll.h
+++ b/gcc/config/i386/crtdll.h
@@ -22,6 +22,15 @@ 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 CPP_PREDEFINES
+#define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
+ -D__MINGW32__ -DWINNT -D_X86_=1 -D__STDC__=1\
+ -D__stdcall=__attribute__((__stdcall__)) \
+ _D_stdcall=__attribute__((__stdcall__)) \
+ -D__cdecl=__attribute__((__cdecl__)) \
+ -D__declspec(x)=__attribute__((x)) \
+ -Asystem(winnt) -Acpu(i386) -Amachine(i386)"
+
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "-lmingw32 -lgcc -lmoldname -lcrtdll"
diff --git a/gcc/config/i386/cygwin32.h b/gcc/config/i386/cygwin32.h
index 15963bdb299..e52c7100591 100644
--- a/gcc/config/i386/cygwin32.h
+++ b/gcc/config/i386/cygwin32.h
@@ -30,6 +30,14 @@ Boston, MA 02111-1307, USA. */
#include "i386/gas.h"
#include "dbxcoff.h"
+/* Support the __declspec keyword by turning them into attributes.
+ We currently only support: dllimport and dllexport.
+ Note that the current way we do this may result in a collision with
+ predefined attributes later on. This can be solved by using one attribute,
+ say __declspec__, and passing args to it. The problem with that approach
+ is that args are not accumulated: each new appearance would clobber any
+ existing args. */
+
#ifdef CPP_PREDEFINES
#undef CPP_PREDEFINES
#endif
@@ -38,10 +46,11 @@ Boston, MA 02111-1307, USA. */
-D__CYGWIN32__ -DWINNT -D_X86_=1 -D__STDC__=1\
-D__stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
+ -D__declspec(x)=__attribute__((x)) \
-Asystem(winnt) -Acpu(i386) -Amachine(i386)"
#undef CPP_SPEC
-#define CPP_SPEC "-remap %(cpp_cpu) %[cpp_cpu] %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
/* We have to dynamic link to get to the system DLLs. All of libc, libm and
the Unix stuff is in cygwin.dll. The import library is called
@@ -50,17 +59,18 @@ Boston, MA 02111-1307, USA. */
ld, but that doesn't work just yet. */
#undef LIB_SPEC
-#define LIB_SPEC "-lcygwin %{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 \
- -ladvapi32 -lshell32"
+#define LIB_SPEC "%{pg:-lgmon} -lcygwin %{mwindows:-luser32 -lgdi32 -lcomdlg32}\
+ -lkernel32 -ladvapi32 -lshell32"
#define LINK_SPEC "%{mwindows:--subsystem windows}"
/* Normally, -lgcc is not needed since everything in it is in the DLL, but we
want to allow things to be added to it when installing new versions of
- GCC without making a new CYGWIN.DLL, so we leave it. */
+ GCC without making a new CYGWIN.DLL, so we leave it. Profiling is handled
+ by calling the init function from the prologue. */
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "crt0%O%s"
+#define STARTFILE_SPEC "%{pg:gcrt0%O%s} crt0%O%s"
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
@@ -69,13 +79,63 @@ Boston, MA 02111-1307, USA. */
#define WCHAR_TYPE "short unsigned int"
#define HAVE_ATEXIT 1
+
+/* Ignore dllimport for functions. */
+#define TARGET_NOP_FUN_DLLIMPORT (target_flags & 0x20000)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "nop-fun-dllimport", 0x20000 }, \
+ { "no-nop-fun-dllimport", -0x20000 }, \
+ { "windows", 0x0 },
+
+/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
+#define HANDLE_PRAGMA_PACK_PUSH_POP 1
+
+/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
+ is a valid machine specific attribute for DECL.
+ The attributes in ATTRIBUTES have previously been assigned to DECL. */
+extern int i386_pe_valid_decl_attribute_p ();
+
+#undef VALID_MACHINE_DECL_ATTRIBUTE
+#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
+ i386_pe_valid_decl_attribute_p (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
+
+/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
+ is a valid machine specific attribute for TYPE.
+ The attributes in ATTRIBUTES have previously been assigned to TYPE. */
+
+#undef VALID_MACHINE_TYPE_ATTRIBUTE
+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
+ i386_pe_valid_type_attribute_p (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
+extern int i386_pe_valid_type_attribute_p ();
+
+extern union tree_node *i386_pe_merge_decl_attributes ();
+#define MERGE_MACHINE_DECL_ATTRIBUTES(OLD, NEW) \
+ i386_pe_merge_decl_attributes ((OLD), (NEW))
+
+/* Used to implement dllexport overriding dllimport semantics. It's also used
+ to handle vtables - the first pass won't do anything because
+ DECL_CONTEXT (DECL) will be 0 so i386_pe_dll{ex,im}port_p will return 0.
+ It's also used to handle dllimport override semantics. */
+#if 0
+#define REDO_SECTION_INFO_P(DECL) \
+ ((DECL_MACHINE_ATTRIBUTES (DECL) != NULL_TREE) \
+ || (TREE_CODE (DECL) == VAR_DECL && DECL_VIRTUAL_P (DECL)))
+#else
+#define REDO_SECTION_INFO_P(DECL) 1
+#endif
+
+
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_ctor, in_dtor
+#define EXTRA_SECTIONS in_ctor, in_dtor, in_drectve
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
CTOR_SECTION_FUNCTION \
- DTOR_SECTION_FUNCTION
+ DTOR_SECTION_FUNCTION \
+ DRECTVE_SECTION_FUNCTION \
+ SWITCH_TO_SECTION_FUNCTION
#define CTOR_SECTION_FUNCTION \
void \
@@ -99,6 +159,41 @@ dtor_section () \
} \
}
+#define DRECTVE_SECTION_FUNCTION \
+void \
+drectve_section () \
+{ \
+ if (in_section != in_drectve) \
+ { \
+ fprintf (asm_out_file, "%s\n", "\t.section .drectve\n"); \
+ in_section = in_drectve; \
+ } \
+}
+
+/* Switch to SECTION (an `enum in_section').
+
+ ??? This facility should be provided by GCC proper.
+ The problem is that we want to temporarily switch sections in
+ ASM_DECLARE_OBJECT_NAME and then switch back to the original section
+ afterwards. */
+#define SWITCH_TO_SECTION_FUNCTION \
+void \
+switch_to_section (section, decl) \
+ enum in_section section; \
+ tree decl; \
+{ \
+ switch (section) \
+ { \
+ case in_text: text_section (); break; \
+ case in_data: data_section (); break; \
+ case in_named: named_section (decl, NULL, 0); break; \
+ case in_ctor: ctor_section (); break; \
+ case in_dtor: dtor_section (); break; \
+ case in_drectve: drectve_section (); break; \
+ default: abort (); break; \
+ } \
+}
+
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctor_section (); \
@@ -111,7 +206,7 @@ dtor_section () \
do { \
dtor_section (); \
fprintf (FILE, "%s\t", ASM_LONG); \
- assemble_name (FILE, NAME); \
+ assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -119,44 +214,38 @@ dtor_section () \
differently depending on something about the variable or
function named by the symbol (such as what section it is in).
- On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
- so that we may access it directly in the GOT.
-
On i386 running Windows NT, modify the assembler name with a suffix
consisting of an atsign (@) followed by string of digits that represents
the number of bytes of arguments passed to the function, if it has the
- attribute STDCALL. */
+ attribute STDCALL.
+
+ In addition, we must mark dll symbols specially. Definitions of
+ dllexport'd objects install some info in the .drectve section.
+ References to dllimport'd objects are fetched indirectly via
+ _imp__. If both are declared, dllexport overrides. This is also
+ needed to implement one-only vtables: they go into their own
+ section and we need to set DECL_SECTION_NAME so we do that here.
+ Note that we can be called twice on the same decl. */
+
+extern void i386_pe_encode_section_info ();
#ifdef ENCODE_SECTION_INFO
#undef ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL) \
-do \
- { \
- if (flag_pic) \
- { \
- rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
- ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
- SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
- = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
- || ! TREE_PUBLIC (DECL)); \
- } \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- if (lookup_attribute ("stdcall", \
- TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \
- XEXP (DECL_RTL (DECL), 0) = \
- gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL)); \
- } \
-while (0)
#endif
+#define ENCODE_SECTION_INFO(DECL) i386_pe_encode_section_info (DECL)
-/* This macro gets just the user-specified name out of the string in a
- SYMBOL_REF. Discard trailing @[NUM] encoded by ENCODE_SECTION_INFO. */
+/* Utility used only in this file. */
+#define I386_PE_STRIP_ENCODING(SYM_NAME) \
+ ((SYM_NAME) + ((SYM_NAME)[0] == '@' ? 3 : 0))
+/* This macro gets just the user-specified name
+ out of the string in a SYMBOL_REF. Discard
+ trailing @[NUM] encoded by ENCODE_SECTION_INFO. */
#undef STRIP_NAME_ENCODING
#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
do { \
char *_p; \
- char *_name = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*')); \
+ char *_name = I386_PE_STRIP_ENCODING (SYMBOL_NAME); \
for (_p = _name; *_p && *_p != '@'; ++_p) \
; \
if (*_p == '@') \
@@ -170,6 +259,48 @@ do { \
(VAR) = _name; \
} while (0)
+
+/* Output a reference to a label. */
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
+ fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, \
+ I386_PE_STRIP_ENCODING (NAME)) \
+
+/* Output a common block. */
+#undef ASM_OUTPUT_COMMON
+#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
+do { \
+ if (i386_pe_dllexport_name_p (NAME)) \
+ { \
+ drectve_section (); \
+ fprintf ((STREAM), "\t.ascii \" -export:%s\"\n", \
+ I386_PE_STRIP_ENCODING (NAME)); \
+ } \
+ if (! i386_pe_dllimport_name_p (NAME)) \
+ { \
+ fprintf ((STREAM), "\t.comm\t"); \
+ assemble_name ((STREAM), (NAME)); \
+ fprintf ((STREAM), ", %d\t%s %d\n", \
+ (ROUNDED), ASM_COMMENT_START, (SIZE)); \
+ } \
+} while (0)
+
+/* Output the label for an initialized variable. */
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
+do { \
+ if (i386_pe_dllexport_name_p (NAME)) \
+ { \
+ enum in_section save_section = in_section; \
+ drectve_section (); \
+ fprintf ((STREAM), "\t.ascii \" -export:%s\"\n", \
+ I386_PE_STRIP_ENCODING (NAME)); \
+ switch_to_section (save_section, (DECL)); \
+ } \
+ ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
+} while (0)
+
+
/* Emit code to check the stack when allocating more that 4000
bytes in one go. */
@@ -207,23 +338,90 @@ extern void i386_pe_unique_section ();
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
#undef ASM_OUTPUT_SECTION_NAME
-#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
-do { \
- if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
- fprintf (STREAM, "\t.section %s,\"x\"\n", (NAME)); \
- else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
- fprintf (STREAM, "\t.section %s,\"\"\n", (NAME)); \
- else \
- fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
- /* Functions may have been compiled at various levels of \
- optimization so we can't use `same_size' here. Instead, \
- have the linker pick one. */ \
- if ((DECL) && DECL_ONE_ONLY (DECL)) \
- fprintf (STREAM, "\t.linkonce %s\n", \
- TREE_CODE (DECL) == FUNCTION_DECL \
- ? "discard" : "same_size"); \
+#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
+do { \
+ static struct section_info \
+ { \
+ struct section_info *next; \
+ char *name; \
+ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
+ } *sections; \
+ struct section_info *s; \
+ char *mode; \
+ enum sect_enum type; \
+ \
+ for (s = sections; s; s = s->next) \
+ if (!strcmp (NAME, s->name)) \
+ break; \
+ \
+ if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
+ type = SECT_EXEC, mode = "x"; \
+ else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
+ type = SECT_RO, mode = ""; \
+ else \
+ type = SECT_RW, mode = "w"; \
+ \
+ if (s == 0) \
+ { \
+ s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
+ s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
+ strcpy (s->name, NAME); \
+ s->type = type; \
+ s->next = sections; \
+ sections = s; \
+ fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \
+ /* Functions may have been compiled at various levels of \
+ optimization so we can't use `same_size' here. Instead, \
+ have the linker pick one. */ \
+ if ((DECL) && DECL_ONE_ONLY (DECL)) \
+ fprintf (STREAM, "\t.linkonce %s\n", \
+ TREE_CODE (DECL) == FUNCTION_DECL \
+ ? "discard" : "same_size"); \
+ } \
+ else \
+ { \
+ fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \
+ } \
} while (0)
+/* Write the extra assembler code needed to declare a function
+ properly. If we are generating SDB debugging information, this
+ will happen automatically, so we only need to handle other cases. */
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ do \
+ { \
+ if (i386_pe_dllexport_name_p (NAME)) \
+ { \
+ drectve_section (); \
+ fprintf ((FILE), "\t.ascii \" -export:%s\"\n", \
+ I386_PE_STRIP_ENCODING (NAME)); \
+ function_section (DECL); \
+ } \
+ if (write_symbols != SDB_DEBUG) \
+ i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \
+ ASM_OUTPUT_LABEL (FILE, NAME); \
+ } \
+ while (0)
+
+/* Add an external function to the list of functions to be declared at
+ the end of the file. */
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+ do \
+ { \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ i386_pe_record_external_function (NAME); \
+ } \
+ while (0)
+
+/* Declare the type properly for any external libcall. */
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1)
+
+/* Output function declarations at the end of the file. */
+#define ASM_FILE_END(FILE) \
+ i386_pe_asm_file_end (FILE)
+
#undef ASM_COMMENT_START
#define ASM_COMMENT_START " #"
@@ -232,3 +430,50 @@ do { \
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
+
+#define SUBTARGET_PROLOGUE \
+ if (profile_flag \
+ && strcmp (IDENTIFIER_POINTER (DECL_NAME (current_function_decl)),\
+ "main") == 0) \
+ { \
+ rtx xops[1]; \
+ xops[0] = gen_rtx_MEM (FUNCTION_MODE, \
+ gen_rtx (SYMBOL_REF, Pmode, "_monstartup")); \
+ if (do_rtl) \
+ emit_call_insn (gen_rtx (CALL, VOIDmode, xops[0], const0_rtx)); \
+ else \
+ output_asm_insn (AS1 (call,%P1), xops); \
+ }
+
+/* External function declarations. */
+
+#ifndef PROTO
+#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
+#define PROTO(ARGS) ARGS
+#else
+#define PROTO(ARGS) ()
+#endif
+#endif
+
+#ifdef BUFSIZ /* stdio.h has been included, ok to use FILE * */
+#define STDIO_PROTO(ARGS) PROTO(ARGS)
+#else
+#define STDIO_PROTO(ARGS) ()
+#endif
+
+extern void i386_pe_record_external_function PROTO((char *));
+extern void i386_pe_declare_function_type STDIO_PROTO((FILE *, char *, int));
+extern void i386_pe_asm_file_end STDIO_PROTO((FILE *));
+
+/* For Win32 ABI compatibility */
+#undef DEFAULT_PCC_STRUCT_RETURN
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* No data type wants to be aligned rounder than this. */
+#undef BIGGEST_ALIGNMENT
+#define BIGGEST_ALIGNMENT 128
+
+/* A bitfield declared as `int' forces `int' alignment for the struct. */
+#undef PCC_BITFIELDS_TYPE_MATTERS
+#define PCC_BITFIELDS_TYPE_MATTERS 0
+
diff --git a/gcc/config/i386/freebsd-elf.h b/gcc/config/i386/freebsd-elf.h
index 196a76a18f9..3c1934b4cda 100644
--- a/gcc/config/i386/freebsd-elf.h
+++ b/gcc/config/i386/freebsd-elf.h
@@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
/* Copy this from the svr4 specifications... */
/* Define the register numbers to be used in Dwarf debugging information.
@@ -143,7 +143,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
#if 1
@@ -185,3 +185,16 @@ Boston, MA 02111-1307, USA. */
%{static:-static}}}"
/* Get perform_* macros to build libgcc.a. */
+
+/* A C statement to output to the stdio stream FILE an assembler
+ command to advance the location counter to a multiple of 1<<LOG
+ bytes if it is within MAX_SKIP bytes.
+
+ This is used to align code labels according to Intel recommendations. */
+
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
+ if ((LOG)!=0) \
+ if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
+#endif
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
index d5deacdc348..df653ae3bd9 100644
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -47,12 +47,12 @@ Boston, MA 02111-1307, USA. */
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE
-#define WCHAR_TYPE "short unsigned int"
+#define WCHAR_TYPE "int"
-#define WCHAR_UNSIGNED 1
+#define WCHAR_UNSIGNED 0
#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 16
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
#define HAVE_ATEXIT
@@ -84,7 +84,7 @@ Boston, MA 02111-1307, USA. */
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions. */
diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h
index 50976cf8bec..173bf1920ff 100644
--- a/gcc/config/i386/gas.h
+++ b/gcc/config/i386/gas.h
@@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#define CPP_PREDEFINES "-Dunix"
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
/* Allow #sccs in preprocessor. */
@@ -80,11 +80,24 @@ Boston, MA 02111-1307, USA. */
doubt or guess work, and since this file is used for both a.out and other
file formats, we use one of them. */
-#if 0 /* ??? However, not every port uses binutils 2.6 yet. */
+#ifdef HAVE_GAS_BALIGN_AND_P2ALIGN
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1<<(LOG))
#endif
+
+/* A C statement to output to the stdio stream FILE an assembler
+ command to advance the location counter to a multiple of 1<<LOG
+ bytes if it is within MAX_SKIP bytes.
+
+ This is used to align code labels according to Intel recommendations. */
+
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+# define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
+ if ((LOG)!=0) \
+ if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
+#endif
/* A C statement or statements which output an assembler instruction
opcode to the stdio stream STREAM. The macro-operand PTR is a
diff --git a/gcc/config/i386/go32.h b/gcc/config/i386/go32.h
index 191041b4ab5..c190f7fed15 100644
--- a/gcc/config/i386/go32.h
+++ b/gcc/config/i386/go32.h
@@ -7,6 +7,9 @@
#define HANDLE_SYSV_PRAGMA
+/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
+#define HANDLE_PRAGMA_PACK_PUSH_POP 1
+
#define YES_UNDERSCORES
#include "i386/gas.h"
@@ -91,7 +94,6 @@ dtor_section () \
#undef HAVE_ATEXIT
#define HAVE_ATEXIT
-/* djgpp automatically calls it's own version of __main, so don't define one
+/* djgpp automatically calls its own version of __main, so don't define one
in libgcc, nor call one in main(). */
#define HAS_INIT_SECTION
-
diff --git a/gcc/config/i386/i386-coff.h b/gcc/config/i386/i386-coff.h
index 915e307d17b..2e00b7a8907 100644
--- a/gcc/config/i386/i386-coff.h
+++ b/gcc/config/i386/i386-coff.h
@@ -22,14 +22,20 @@ Boston, MA 02111-1307, USA. */
#include "i386/gas.h"
+#include "dbxcoff.h"
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Di386"
+/* We want to be able to get DBX debugging information via -gstabs. */
+
#undef DBX_DEBUGGING_INFO
-#define SDB_DEBUGGING_INFO
+#define DBX_DEBUGGING_INFO
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
/* Support the ctors and dtors sections for g++. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index c9dae27f9dc..fc8edbd64d1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -18,10 +18,9 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include <setjmp.h>
-#include <ctype.h>
#include "config.h"
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -39,18 +38,6 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "toplev.h"
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
#ifdef EXTRA_CONSTRAINT
/* If EXTRA_CONSTRAINT is defined, then the 'S'
constraint in REG_CLASS_FROM_LETTER will no longer work, and various
@@ -113,8 +100,37 @@ struct processor_costs pentiumpro_cost = {
17 /* cost of a divide/mod */
};
+struct processor_costs k6_cost = {
+ 1, /* cost of an add instruction */
+ 1, /* cost of a lea instruction */
+ 1, /* variable shift costs */
+ 1, /* constant shift costs */
+ 2, /* cost of starting a multiply */
+ 0, /* cost of multiply per each bit set */
+ 18 /* cost of a divide/mod */
+};
+
struct processor_costs *ix86_cost = &pentium_cost;
+/* Processor feature/optimization bitmasks. */
+#define m_386 (1<<PROCESSOR_I386)
+#define m_486 (1<<PROCESSOR_I486)
+#define m_PENT (1<<PROCESSOR_PENTIUM)
+#define m_PPRO (1<<PROCESSOR_PENTIUMPRO)
+#define m_K6 (1<<PROCESSOR_K6)
+
+const int x86_use_leave = m_386 | m_K6;
+const int x86_push_memory = m_386 | m_K6;
+const int x86_zero_extend_with_and = m_486 | m_PENT;
+const int x86_movx = m_386 | m_PPRO | 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;
+const int x86_use_q_reg = m_PENT | m_PPRO | m_K6;
+const int x86_use_any_reg = m_486;
+const int x86_cmove = m_PPRO;
+const int x86_deep_branch = m_PPRO| m_K6;
+
#define AT_BP(mode) (gen_rtx_MEM ((mode), frame_pointer_rtx))
extern FILE *asm_out_file;
@@ -142,7 +158,7 @@ enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] =
SIREG, DIREG, INDEX_REGS, GENERAL_REGS,
/* FP registers */
FP_TOP_REG, FP_SECOND_REG, FLOAT_REGS, FLOAT_REGS,
- FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS,
+ FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS,
/* arg pointer */
INDEX_REGS
};
@@ -226,7 +242,8 @@ override_options ()
{PROCESSOR_I686_STRING, PROCESSOR_PENTIUMPRO, &pentiumpro_cost,
0, 0},
{PROCESSOR_PENTIUMPRO_STRING, PROCESSOR_PENTIUMPRO,
- &pentiumpro_cost, 0, 0}};
+ &pentiumpro_cost, 0, 0},
+ {PROCESSOR_K6_STRING, PROCESSOR_K6, &k6_cost, 0, 0}};
int ptt_size = sizeof (processor_target_table) / sizeof (struct ptt);
@@ -240,7 +257,7 @@ override_options ()
for (i = 0; (ch = i386_reg_alloc_order[i]) != '\0'; i++)
{
int regno = 0;
-
+
switch (ch)
{
case 'a': regno = 0; break;
@@ -267,7 +284,7 @@ override_options ()
if (ix86_cpu_string == 0)
ix86_cpu_string = PROCESSOR_DEFAULT_STRING;
}
-
+
for (i = 0; i < ptt_size; i++)
if (! strcmp (ix86_arch_string, processor_target_table[i].name))
{
@@ -292,7 +309,7 @@ override_options ()
{
ix86_cpu = processor_target_table[j].processor;
ix86_cost = processor_target_table[j].cost;
- if (i > j && (int) ix86_arch >= (int) PROCESSOR_PENTIUMPRO)
+ if (i > j && (int) ix86_arch >= (int) PROCESSOR_K6)
error ("-mcpu=%s does not support -march=%s",
ix86_cpu_string, ix86_arch_string);
@@ -332,7 +349,11 @@ override_options ()
i386_align_loops, MAX_CODE_ALIGN);
}
else
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
+ i386_align_loops = 4;
+#else
i386_align_loops = 2;
+#endif
/* Validate -malign-jumps= value, or provide default. */
if (i386_align_jumps_string)
@@ -343,7 +364,11 @@ override_options ()
i386_align_jumps, MAX_CODE_ALIGN);
}
else
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
+ i386_align_jumps = 4;
+#else
i386_align_jumps = def_align;
+#endif
/* Validate -malign-functions= value, or provide default. */
if (i386_align_funcs_string)
@@ -397,7 +422,7 @@ order_regs_for_local_alloc ()
for (i = order = 0; (ch = i386_reg_alloc_order[i]) != '\0'; i++)
{
int regno = 0;
-
+
switch (ch)
{
case 'a': regno = 0; break;
@@ -430,7 +455,7 @@ order_regs_for_local_alloc ()
void
optimization_options (level, size)
int level;
- int size;
+ int size ATTRIBUTE_UNUSED;
{
/* For -O2 and beyond, turn off -fschedule-insns by default. It tends to
make the problem with not enough registers even worse. */
@@ -507,7 +532,7 @@ i386_aligned_p (op)
case REG:
return i386_aligned_reg_p (REGNO (op));
-
+
default:
break;
}
@@ -531,10 +556,10 @@ i386_cc_probably_useless_p (insn)
int
i386_valid_decl_attribute_p (decl, attributes, identifier, args)
- tree decl;
- tree attributes;
- tree identifier;
- tree args;
+ tree decl ATTRIBUTE_UNUSED;
+ tree attributes ATTRIBUTE_UNUSED;
+ tree identifier ATTRIBUTE_UNUSED;
+ tree args ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -546,11 +571,12 @@ i386_valid_decl_attribute_p (decl, attributes, identifier, args)
int
i386_valid_type_attribute_p (type, attributes, identifier, args)
tree type;
- tree attributes;
+ tree attributes ATTRIBUTE_UNUSED;
tree identifier;
tree args;
{
if (TREE_CODE (type) != FUNCTION_TYPE
+ && TREE_CODE (type) != METHOD_TYPE
&& TREE_CODE (type) != FIELD_DECL
&& TREE_CODE (type) != TYPE_DECL)
return 0;
@@ -596,8 +622,8 @@ i386_valid_type_attribute_p (type, attributes, identifier, args)
int
i386_comp_type_attributes (type1, type2)
- tree type1;
- tree type2;
+ tree type1 ATTRIBUTE_UNUSED;
+ tree type2 ATTRIBUTE_UNUSED;
{
return 1;
}
@@ -625,27 +651,27 @@ i386_return_pops_args (fundecl, funtype, size)
tree fundecl;
tree funtype;
int size;
-{
+{
int rtd = TARGET_RTD && (!fundecl || TREE_CODE (fundecl) != IDENTIFIER_NODE);
/* Cdecl functions override -mrtd, and never pop the stack. */
if (! lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) {
-
+
/* Stdcall functions will pop the stack if not variable args. */
if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (funtype)))
rtd = 1;
-
+
if (rtd
&& (TYPE_ARG_TYPES (funtype) == NULL_TREE
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (funtype)))
== void_type_node)))
return size;
}
-
+
/* Lose any fake structure return argument. */
if (aggregate_value_p (TREE_TYPE (funtype)))
return GET_MODE_SIZE (Pmode);
-
+
return 0;
}
@@ -810,10 +836,10 @@ function_arg (cum, mode, type, named)
int
function_arg_partial_nregs (cum, mode, type, named)
- CUMULATIVE_ARGS *cum; /* current arg information */
- enum machine_mode mode; /* current arg mode */
- tree type; /* type of the argument or 0 if lib support */
- int named; /* != 0 for normal args, == 0 for ... args */
+ CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED; /* current arg information */
+ enum machine_mode mode ATTRIBUTE_UNUSED; /* current arg mode */
+ tree type ATTRIBUTE_UNUSED; /* type of the argument or 0 if lib support */
+ int named ATTRIBUTE_UNUSED; /* != 0 for normal args, == 0 for ... args */
{
return 0;
}
@@ -896,6 +922,17 @@ output_to_reg (dest, dies, scratch_mem)
{
if (dies)
output_asm_insn (AS1 (fistp%z3,%y0), xops);
+ else if (GET_MODE (xops[3]) == DImode && ! dies)
+ {
+ /* There is no DImode version of this without a stack pop, so
+ we must emulate it. It doesn't matter much what the second
+ instruction is, because the value being pushed on the FP stack
+ is not used except for the following stack popping store.
+ This case can only happen without optimization, so it doesn't
+ matter that it is inefficient. */
+ output_asm_insn (AS1 (fistp%z3,%0), xops);
+ output_asm_insn (AS1 (fild%z3,%0), xops);
+ }
else
output_asm_insn (AS1 (fist%z3,%y0), xops);
}
@@ -932,7 +969,7 @@ output_to_reg (dest, dies, scratch_mem)
output_asm_insn (AS1 (pop%L0,%0), &dest);
else
{
- xops[0] = adj_offsettable_operand (xops[0], 4);
+ xops[0] = adj_offsettable_operand (xops[0], 4);
xops[3] = dest;
output_asm_insn (AS2 (mov%L0,%0,%3), xops);
}
@@ -944,7 +981,7 @@ output_to_reg (dest, dies, scratch_mem)
output_asm_insn (AS1 (pop%L0,%0), &dest);
else
{
- xops[0] = adj_offsettable_operand (xops[0], 4);
+ xops[0] = adj_offsettable_operand (xops[0], 4);
output_asm_insn (AS2 (mov%L0,%0,%3), xops);
}
}
@@ -1150,7 +1187,7 @@ output_move_double (operands)
middlehalf[0] = operands[0];
latehalf[0] = operands[0];
}
-
+
if (optype1 == REGOP)
{
middlehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
@@ -1370,7 +1407,7 @@ output_move_pushmem (operands, insn, length, tmp_start, n_operands)
char *push;
rtx xops[2];
} tmp_info[MAX_TMPS];
-
+
rtx src = operands[1];
int max_tmps = 0;
int offset = 0;
@@ -1579,6 +1616,7 @@ standard_80387_constant_p (x)
/* Note that on the 80387, other constants, such as pi,
are much slower to load as standard constants
than to load from doubles in memory! */
+ /* ??? Not true on K6: all constants are equal cost. */
#endif
return 0;
@@ -1620,7 +1658,7 @@ output_move_const_single (operands)
int
symbolic_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -1647,7 +1685,7 @@ symbolic_operand (op, mode)
int
call_insn_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == MEM
&& ((CONSTANT_ADDRESS_P (XEXP (op, 0))
@@ -1668,7 +1706,7 @@ call_insn_operand (op, mode)
int
expander_call_insn_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == MEM
&& (CONSTANT_ADDRESS_P (XEXP (op, 0))
@@ -1704,7 +1742,7 @@ arithmetic_comparison_operator (op, mode)
int
ix86_logical_operator (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR;
}
@@ -1782,7 +1820,7 @@ ix86_expand_binary_operator (code, mode, operands)
emit_move_insn (temp, operands[1]);
operands[1] = temp;
return TRUE;
- }
+ }
}
if (!ix86_binary_operator_ok (code, mode, operands))
@@ -1815,7 +1853,7 @@ ix86_expand_binary_operator (code, mode, operands)
emit_move_insn (temp, operands[1]);
operands[1] = temp;
return TRUE;
- }
+ }
if (modified && ! ix86_binary_operator_ok (code, mode, operands))
return FALSE;
@@ -1833,7 +1871,7 @@ ix86_expand_binary_operator (code, mode, operands)
int
ix86_binary_operator_ok (code, mode, operands)
enum rtx_code code;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
rtx operands[3];
{
return (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)
@@ -1880,9 +1918,9 @@ ix86_expand_unary_operator (code, mode, operands)
int
ix86_unary_operator_ok (code, mode, operands)
- enum rtx_code code;
- enum machine_mode mode;
- rtx operands[2];
+ enum rtx_code code ATTRIBUTE_UNUSED;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+ rtx operands[2] ATTRIBUTE_UNUSED;
{
return TRUE;
}
@@ -1897,7 +1935,7 @@ static int pic_label_no = 0;
void
asm_output_function_prefix (file, name)
FILE *file;
- char *name;
+ char *name ATTRIBUTE_UNUSED;
{
rtx xops[2];
int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
@@ -1919,9 +1957,16 @@ asm_output_function_prefix (file, name)
prologue_node = make_node (FUNCTION_DECL);
DECL_RESULT (prologue_node) = 0;
-#ifdef ASM_DECLARE_FUNCTION_NAME
- ASM_DECLARE_FUNCTION_NAME (file, pic_label_name, prologue_node);
-#endif
+
+ /* This used to call ASM_DECLARE_FUNCTION_NAME() but since it's an
+ internal (non-global) label that's being emitted, it didn't make
+ sense to have .type information for local labels. This caused
+ the SCO OpenServer 5.0.4 ELF assembler grief (why are you giving
+ me debug info for a label that you're declaring non-global?) this
+ was changed to call ASM_OUTPUT_LABEL() instead. */
+
+
+ ASM_OUTPUT_LABEL (file, pic_label_name);
output_asm_insn ("movl (%1),%0", xops);
output_asm_insn ("ret", xops);
}
@@ -1933,15 +1978,15 @@ asm_output_function_prefix (file, name)
void
function_prologue (file, size)
- FILE *file;
- int size;
+ FILE *file ATTRIBUTE_UNUSED;
+ int size ATTRIBUTE_UNUSED;
{
if (TARGET_SCHEDULE_PROLOGUE)
{
pic_label_rtx = 0;
return;
}
-
+
ix86_prologue (0);
}
@@ -1952,7 +1997,7 @@ ix86_expand_prologue ()
{
if (! TARGET_SCHEDULE_PROLOGUE)
return;
-
+
ix86_prologue (1);
}
@@ -1979,9 +2024,9 @@ load_pic_register (do_rtl)
if (do_rtl)
{
emit_insn (gen_prologue_get_pc (xops[0], xops[1]));
- emit_insn (gen_prologue_set_got (xops[0],
+ emit_insn (gen_prologue_set_got (xops[0],
gen_rtx (SYMBOL_REF, Pmode,
- "$_GLOBAL_OFFSET_TABLE_"),
+ "$_GLOBAL_OFFSET_TABLE_"),
xops[1]));
}
else
@@ -1996,7 +2041,7 @@ load_pic_register (do_rtl)
{
xops[0] = pic_offset_table_rtx;
xops[1] = gen_label_rtx ();
-
+
if (do_rtl)
{
/* We can't put a raw CODE_LABEL into the RTL, and we can't emit
@@ -2007,12 +2052,12 @@ load_pic_register (do_rtl)
else
{
output_asm_insn (AS1 (call,%P1), xops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
CODE_LABEL_NUMBER (xops[1]));
output_asm_insn (AS1 (pop%L0,%0), xops);
output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0", xops);
}
- }
+ }
/* When -fpic, we must emit a scheduling barrier, so that the instruction
that restores %ebx (which is PIC_OFFSET_TABLE_REGNUM), does not get
@@ -2034,7 +2079,7 @@ ix86_prologue (do_rtl)
long tsize = get_frame_size ();
rtx insn;
int cfa_offset = INCOMING_FRAME_SP_OFFSET, cfa_store_offset = cfa_offset;
-
+
xops[0] = stack_pointer_rtx;
xops[1] = frame_pointer_rtx;
xops[2] = GEN_INT (tsize);
@@ -2056,7 +2101,7 @@ ix86_prologue (do_rtl)
else
{
- output_asm_insn ("push%L1 %1", xops);
+ output_asm_insn ("push%L1 %1", xops);
#ifdef INCOMING_RETURN_ADDR_RTX
if (dwarf2out_do_frame ())
{
@@ -2069,7 +2114,7 @@ ix86_prologue (do_rtl)
}
#endif
- output_asm_insn (AS2 (mov%L0,%0,%1), xops);
+ output_asm_insn (AS2 (mov%L0,%0,%1), xops);
#ifdef INCOMING_RETURN_ADDR_RTX
if (dwarf2out_do_frame ())
dwarf2out_def_cfa ("", FRAME_POINTER_REGNUM, cfa_offset);
@@ -2086,7 +2131,7 @@ ix86_prologue (do_rtl)
insn = emit_insn (gen_prologue_set_stack_ptr (xops[2]));
RTX_FRAME_RELATED_P (insn) = 1;
}
- else
+ else
{
output_asm_insn (AS2 (sub%L0,%2,%0), xops);
#ifdef INCOMING_RETURN_ADDR_RTX
@@ -2102,7 +2147,7 @@ ix86_prologue (do_rtl)
#endif
}
}
- else
+ else
{
xops[3] = gen_rtx_REG (SImode, 0);
if (do_rtl)
@@ -2166,6 +2211,10 @@ ix86_prologue (do_rtl)
}
}
+#ifdef SUBTARGET_PROLOGUE
+ SUBTARGET_PROLOGUE;
+#endif
+
if (pic_reg_used)
load_pic_register (do_rtl);
@@ -2180,7 +2229,7 @@ ix86_prologue (do_rtl)
/* Return 1 if it is appropriate to emit `ret' instructions in the
body of a function. Do this only if the epilogue is simple, needing a
couple of insns. Prior to reloading, we can't tell how many registers
- must be saved, so return 0 then. Return 0 if there is no frame
+ must be saved, so return 0 then. Return 0 if there is no frame
marker to de-allocate.
If NON_SAVING_SETJMP is defined and true, then it is not possible
@@ -2221,13 +2270,13 @@ ix86_can_use_return_insn_p ()
void
function_epilogue (file, size)
- FILE *file;
- int size;
+ FILE *file ATTRIBUTE_UNUSED;
+ int size ATTRIBUTE_UNUSED;
{
return;
}
-/* Restore function stack, frame, and registers. */
+/* Restore function stack, frame, and registers. */
void
ix86_expand_epilogue ()
@@ -2351,14 +2400,57 @@ ix86_epilogue (do_rtl)
else if (tsize)
{
- /* If there is no frame pointer, we must still release the frame. */
- xops[0] = GEN_INT (tsize);
+ /* Intel's docs say that for 4 or 8 bytes of stack frame one should
+ use `pop' and not `add'. */
+ int use_pop = tsize == 4;
- if (do_rtl)
- emit_insn (gen_rtx (SET, VOIDmode, xops[2],
- gen_rtx (PLUS, SImode, xops[2], xops[0])));
+ /* Use two pops only for the Pentium processors. */
+ if (tsize == 8 && !TARGET_386 && !TARGET_486)
+ {
+ rtx retval = current_function_return_rtx;
+
+ xops[1] = gen_rtx_REG (SImode, 1); /* %edx */
+
+ /* This case is a bit more complex. Since we cannot pop into
+ %ecx twice we need a second register. But this is only
+ available if the return value is not of DImode in which
+ case the %edx register is not available. */
+ use_pop = (retval == NULL
+ || ! reg_overlap_mentioned_p (xops[1], retval));
+ }
+
+ if (use_pop)
+ {
+ xops[0] = gen_rtx_REG (SImode, 2); /* %ecx */
+
+ if (do_rtl)
+ {
+ /* We have to prevent the two pops here from being scheduled.
+ GCC otherwise would try in some situation to put other
+ instructions in between them which has a bad effect. */
+ emit_insn (gen_blockage ());
+ emit_insn (gen_pop (xops[0]));
+ if (tsize == 8)
+ emit_insn (gen_pop (xops[1]));
+ }
+ else
+ {
+ output_asm_insn ("pop%L0 %0", xops);
+ if (tsize == 8)
+ output_asm_insn ("pop%L1 %1", xops);
+ }
+ }
else
- output_asm_insn (AS2 (add%L2,%0,%2), xops);
+ {
+ /* If there is no frame pointer, we must still release the frame. */
+ xops[0] = GEN_INT (tsize);
+
+ if (do_rtl)
+ emit_insn (gen_rtx (SET, VOIDmode, xops[2],
+ gen_rtx (PLUS, SImode, xops[2], xops[0])));
+ else
+ output_asm_insn (AS2 (add%L2,%0,%2), xops);
+ }
}
#ifdef FUNCTION_BLOCK_PROFILER_EXIT
@@ -2395,7 +2487,7 @@ ix86_epilogue (do_rtl)
output_asm_insn ("jmp %*%0", xops);
}
}
- else
+ else
{
if (do_rtl)
emit_jump_insn (gen_return_pop_internal (xops[1]));
@@ -2446,6 +2538,37 @@ do { \
} \
} while (0)
+static int
+legitimate_pic_address_disp_p (disp)
+ register rtx disp;
+{
+ if (GET_CODE (disp) != CONST)
+ return 0;
+ disp = XEXP (disp, 0);
+
+ if (GET_CODE (disp) == PLUS)
+ {
+ if (GET_CODE (XEXP (disp, 1)) != CONST_INT)
+ return 0;
+ disp = XEXP (disp, 0);
+ }
+
+ if (GET_CODE (disp) != UNSPEC
+ || XVECLEN (disp, 0) != 1)
+ return 0;
+
+ /* Must be @GOT or @GOTOFF. */
+ if (XINT (disp, 1) != 6
+ && XINT (disp, 1) != 7)
+ return 0;
+
+ if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF
+ && GET_CODE (XVECEXP (disp, 0, 0)) != LABEL_REF)
+ return 0;
+
+ return 1;
+}
+
int
legitimate_address_p (mode, addr, strict)
enum machine_mode mode;
@@ -2607,20 +2730,10 @@ legitimate_address_p (mode, addr, strict)
}
}
- /* Validate displacement
- Constant pool addresses must be handled special. They are
- considered legitimate addresses, but only if not used with regs.
- When printed, the output routines know to print the reference with the
- PIC reg, even though the PIC reg doesn't appear in the RTL. */
+ /* Validate displacement. */
if (disp)
{
- if (GET_CODE (disp) == SYMBOL_REF
- && CONSTANT_POOL_ADDRESS_P (disp)
- && base == 0
- && indx == 0)
- ;
-
- else if (!CONSTANT_ADDRESS_P (disp))
+ if (!CONSTANT_ADDRESS_P (disp))
{
ADDR_INVALID ("Displacement is not valid.\n", disp);
return FALSE;
@@ -2632,20 +2745,32 @@ legitimate_address_p (mode, addr, strict)
return FALSE;
}
- else if (flag_pic && SYMBOLIC_CONST (disp)
- && base != pic_offset_table_rtx
- && (indx != pic_offset_table_rtx || scale != NULL_RTX))
+ if (flag_pic && SYMBOLIC_CONST (disp))
{
- ADDR_INVALID ("Displacement is an invalid pic reference.\n", disp);
- return FALSE;
+ if (! legitimate_pic_address_disp_p (disp))
+ {
+ ADDR_INVALID ("Displacement is an invalid PIC construct.\n",
+ disp);
+ return FALSE;
+ }
+
+ if (base != pic_offset_table_rtx
+ && (indx != pic_offset_table_rtx || scale != NULL_RTX))
+ {
+ ADDR_INVALID ("PIC displacement against invalid base.\n", disp);
+ return FALSE;
+ }
}
- else if (HALF_PIC_P () && HALF_PIC_ADDRESS_P (disp)
- && (base != NULL_RTX || indx != NULL_RTX))
+ else if (HALF_PIC_P ())
{
- ADDR_INVALID ("Displacement is an invalid half-pic reference.\n",
- disp);
- return FALSE;
+ if (! HALF_PIC_ADDRESS_P (disp)
+ || (base != NULL_RTX || indx != NULL_RTX))
+ {
+ ADDR_INVALID ("Displacement is an invalid half-pic reference.\n",
+ disp);
+ return FALSE;
+ }
}
}
@@ -2659,29 +2784,20 @@ legitimate_address_p (mode, addr, strict)
/* Return a legitimate reference for ORIG (an address) using the
register REG. If REG is 0, a new pseudo is generated.
- There are three types of references that must be handled:
+ There are two types of references that must be handled:
1. Global data references must load the address from the GOT, via
the PIC reg. An insn is emitted to do this load, and the reg is
returned.
- 2. Static data references must compute the address as an offset
- from the GOT, whose base is in the PIC reg. An insn is emitted to
- compute the address into a reg, and the reg is returned. Static
- data objects have SYMBOL_REF_FLAG set to differentiate them from
- global data objects.
-
- 3. Constant pool addresses must be handled special. They are
- considered legitimate addresses, but only if not used with regs.
- When printed, the output routines know to print the reference with the
- PIC reg, even though the PIC reg doesn't appear in the RTL.
+ 2. Static data references, constant pool addresses, and code labels
+ compute the address as an offset from the GOT, whose base is in
+ the PIC reg. Static data objects have SYMBOL_REF_FLAG set to
+ differentiate them from global data objects. The returned
+ address is the PIC reg + an unspec constant.
GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC
- reg also appears in the address (except for constant pool references,
- noted above).
-
- "switch" statements also require special handling when generating
- PIC code. See comments by the `casesi' insn in i386.md for details. */
+ reg also appears in the address. */
rtx
legitimize_pic_address (orig, reg)
@@ -2690,60 +2806,99 @@ legitimize_pic_address (orig, reg)
{
rtx addr = orig;
rtx new = orig;
+ rtx base;
- if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF)
+ if (GET_CODE (addr) == LABEL_REF
+ || (GET_CODE (addr) == SYMBOL_REF
+ && (CONSTANT_POOL_ADDRESS_P (addr)
+ || SYMBOL_REF_FLAG (addr))))
{
- if (GET_CODE (addr) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (addr))
- reg = new = orig;
- else
- {
- if (reg == 0)
- reg = gen_reg_rtx (Pmode);
+ /* This symbol may be referenced via a displacement from the PIC
+ base address (@GOTOFF). */
- if ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr))
- || GET_CODE (addr) == LABEL_REF)
- new = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
- else
- new = gen_rtx_MEM (Pmode,
- gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig));
+ current_function_uses_pic_offset_table = 1;
+ new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, addr), 7);
+ new = gen_rtx_CONST (VOIDmode, new);
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
+ if (reg != 0)
+ {
emit_move_insn (reg, new);
+ new = reg;
}
- current_function_uses_pic_offset_table = 1;
- return reg;
}
-
- else if (GET_CODE (addr) == CONST || GET_CODE (addr) == PLUS)
+ else if (GET_CODE (addr) == SYMBOL_REF)
{
- rtx base;
+ /* This symbol must be referenced via a load from the
+ Global Offset Table (@GOT). */
+ current_function_uses_pic_offset_table = 1;
+ new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, addr), 6);
+ new = gen_rtx_CONST (VOIDmode, new);
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
+ new = gen_rtx_MEM (Pmode, new);
+ RTX_UNCHANGING_P (new) = 1;
+
+ if (reg == 0)
+ reg = gen_reg_rtx (Pmode);
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ else
+ {
if (GET_CODE (addr) == CONST)
{
addr = XEXP (addr, 0);
- if (GET_CODE (addr) != PLUS)
- abort ();
+ if (GET_CODE (addr) == UNSPEC)
+ {
+ /* Check that the unspec is one of the ones we generate? */
+ }
+ else if (GET_CODE (addr) != PLUS)
+ abort();
}
+ if (GET_CODE (addr) == PLUS)
+ {
+ rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1);
+
+ /* Check first to see if this is a constant offset from a @GOTOFF
+ symbol reference. */
+ if ((GET_CODE (op0) == LABEL_REF
+ || (GET_CODE (op0) == SYMBOL_REF
+ && (CONSTANT_POOL_ADDRESS_P (op0)
+ || SYMBOL_REF_FLAG (op0))))
+ && GET_CODE (op1) == CONST_INT)
+ {
+ current_function_uses_pic_offset_table = 1;
+ new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, op0), 7);
+ new = gen_rtx_PLUS (VOIDmode, new, op1);
+ new = gen_rtx_CONST (VOIDmode, new);
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
- if (XEXP (addr, 0) == pic_offset_table_rtx)
- return orig;
-
- if (reg == 0)
- reg = gen_reg_rtx (Pmode);
-
- base = legitimize_pic_address (XEXP (addr, 0), reg);
- addr = legitimize_pic_address (XEXP (addr, 1),
- base == reg ? NULL_RTX : reg);
-
- if (GET_CODE (addr) == CONST_INT)
- return plus_constant (base, INTVAL (addr));
+ if (reg != 0)
+ {
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ }
+ else
+ {
+ base = legitimize_pic_address (XEXP (addr, 0), reg);
+ new = legitimize_pic_address (XEXP (addr, 1),
+ base == reg ? NULL_RTX : reg);
- if (GET_CODE (addr) == PLUS && CONSTANT_P (XEXP (addr, 1)))
- {
- base = gen_rtx (PLUS, Pmode, base, XEXP (addr, 0));
- addr = XEXP (addr, 1);
+ if (GET_CODE (new) == CONST_INT)
+ new = plus_constant (base, INTVAL (new));
+ else
+ {
+ if (GET_CODE (new) == PLUS && CONSTANT_P (XEXP (new, 1)))
+ {
+ base = gen_rtx_PLUS (Pmode, base, XEXP (new, 0));
+ new = XEXP (new, 1);
+ }
+ new = gen_rtx_PLUS (Pmode, base, new);
+ }
+ }
}
-
- return gen_rtx (PLUS, Pmode, base, addr);
}
return new;
}
@@ -2753,12 +2908,12 @@ legitimize_pic_address (orig, reg)
void
emit_pic_move (operands, mode)
rtx *operands;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
if (GET_CODE (operands[0]) == MEM && SYMBOLIC_CONST (operands[1]))
- operands[1] = force_reg (SImode, operands[1]);
+ operands[1] = force_reg (Pmode, operands[1]);
else
operands[1] = legitimize_pic_address (operands[1], temp);
}
@@ -2787,7 +2942,7 @@ emit_pic_move (operands, mode)
rtx
legitimize_address (x, oldx, mode)
register rtx x;
- register rtx oldx;
+ register rtx oldx ATTRIBUTE_UNUSED;
enum machine_mode mode;
{
int changed = 0;
@@ -2809,8 +2964,8 @@ legitimize_address (x, oldx, mode)
&& (log = (unsigned)exact_log2 (INTVAL (XEXP (x, 1)))) < 4)
{
changed = 1;
- x = gen_rtx (MULT, Pmode, force_reg (Pmode, XEXP (x, 0)),
- GEN_INT (1 << log));
+ x = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (x, 0)),
+ GEN_INT (1 << log));
}
if (GET_CODE (x) == PLUS)
@@ -2971,31 +3126,14 @@ output_pic_addr_const (file, x, code)
break;
case SYMBOL_REF:
- case LABEL_REF:
- if (GET_CODE (x) == SYMBOL_REF)
- assemble_name (file, XSTR (x, 0));
- else
- {
- ASM_GENERATE_INTERNAL_LABEL (buf, "L",
- CODE_LABEL_NUMBER (XEXP (x, 0)));
- assemble_name (asm_out_file, buf);
- }
-
- if (code == 'X')
- ; /* No suffix, dammit. */
- else if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
- fprintf (file, "@GOTOFF(%%ebx)");
- else if (code == 'P')
- fprintf (file, "@PLT");
- else if (GET_CODE (x) == LABEL_REF)
- fprintf (file, "@GOTOFF");
- else if (! SYMBOL_REF_FLAG (x))
- fprintf (file, "@GOT");
- else
- fprintf (file, "@GOTOFF");
-
+ assemble_name (file, XSTR (x, 0));
+ if (code == 'P' && ! SYMBOL_REF_FLAG (x))
+ fputs ("@PLT", file);
break;
+ case LABEL_REF:
+ x = XEXP (x, 0);
+ /* FALLTHRU */
case CODE_LABEL:
ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x));
assemble_name (asm_out_file, buf);
@@ -3033,17 +3171,17 @@ output_pic_addr_const (file, x, code)
if (GET_CODE (XEXP (x, 0)) == CONST_INT)
{
output_pic_addr_const (file, XEXP (x, 0), code);
- if (INTVAL (XEXP (x, 1)) >= 0)
- fprintf (file, "+");
+ fprintf (file, "+");
output_pic_addr_const (file, XEXP (x, 1), code);
}
- else
+ else if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
output_pic_addr_const (file, XEXP (x, 1), code);
- if (INTVAL (XEXP (x, 0)) >= 0)
- fprintf (file, "+");
+ fprintf (file, "+");
output_pic_addr_const (file, XEXP (x, 0), code);
}
+ else
+ abort ();
break;
case MINUS:
@@ -3052,11 +3190,140 @@ output_pic_addr_const (file, x, code)
output_pic_addr_const (file, XEXP (x, 1), code);
break;
+ case UNSPEC:
+ if (XVECLEN (x, 0) != 1)
+ abort ();
+ output_pic_addr_const (file, XVECEXP (x, 0, 0), code);
+ switch (XINT (x, 1))
+ {
+ case 6:
+ fputs ("@GOT", file);
+ break;
+ case 7:
+ fputs ("@GOTOFF", file);
+ break;
+ case 8:
+ fputs ("@PLT", file);
+ break;
+ default:
+ output_operand_lossage ("invalid UNSPEC as operand");
+ break;
+ }
+ break;
+
default:
output_operand_lossage ("invalid expression as operand");
}
}
+static void
+put_jump_code (code, reverse, file)
+ enum rtx_code code;
+ int reverse;
+ FILE *file;
+{
+ int flags = cc_prev_status.flags;
+ int ieee = (TARGET_IEEE_FP && (flags & CC_IN_80387));
+ const char *suffix;
+
+ if (flags & CC_Z_IN_NOT_C)
+ switch (code)
+ {
+ case EQ:
+ fputs (reverse ? "c" : "nc", file);
+ return;
+
+ case NE:
+ fputs (reverse ? "nc" : "c", file);
+ return;
+
+ default:
+ abort ();
+ }
+ if (ieee)
+ {
+ switch (code)
+ {
+ case LE:
+ suffix = reverse ? "ae" : "b";
+ break;
+ case GT:
+ case LT:
+ case GE:
+ suffix = reverse ? "ne" : "e";
+ break;
+ case EQ:
+ suffix = reverse ? "ne" : "e";
+ break;
+ case NE:
+ suffix = reverse ? "e" : "ne";
+ break;
+ default:
+ abort ();
+ }
+ fputs (suffix, file);
+ return;
+ }
+ if (flags & CC_TEST_AX)
+ abort();
+ if ((flags & CC_NO_OVERFLOW) && (code == LE || code == GT))
+ abort ();
+ if (reverse)
+ code = reverse_condition (code);
+ switch (code)
+ {
+ case EQ:
+ suffix = "e";
+ break;
+
+ case NE:
+ suffix = "ne";
+ break;
+
+ case GT:
+ suffix = flags & CC_IN_80387 ? "a" : "g";
+ break;
+
+ case GTU:
+ suffix = "a";
+ break;
+
+ case LT:
+ if (flags & CC_NO_OVERFLOW)
+ suffix = "s";
+ else
+ suffix = flags & CC_IN_80387 ? "b" : "l";
+ break;
+
+ case LTU:
+ suffix = "b";
+ break;
+
+ case GE:
+ if (flags & CC_NO_OVERFLOW)
+ suffix = "ns";
+ else
+ suffix = flags & CC_IN_80387 ? "ae" : "ge";
+ break;
+
+ case GEU:
+ suffix = "ae";
+ break;
+
+ case LE:
+ suffix = flags & CC_IN_80387 ? "be" : "le";
+ break;
+
+ case LEU:
+ suffix = "be";
+ break;
+
+ default:
+ abort ();
+ }
+ fputs (suffix, file);
+}
+
/* Append the correct conditional move suffix which corresponds to CODE. */
static void
@@ -3074,7 +3341,7 @@ put_condition_code (code, reverse_cc, mode, file)
if (mode == MODE_INT)
switch (code)
{
- case NE:
+ case NE:
if (cc_prev_status.flags & CC_Z_IN_NOT_C)
fputs ("b", file);
else
@@ -3089,7 +3356,10 @@ put_condition_code (code, reverse_cc, mode, file)
return;
case GE:
- fputs ("ge", file);
+ if (cc_prev_status.flags & CC_NO_OVERFLOW)
+ fputs ("ns", file);
+ else
+ fputs ("ge", file);
return;
case GT:
@@ -3101,7 +3371,10 @@ put_condition_code (code, reverse_cc, mode, file)
return;
case LT:
- fputs ("l", file);
+ if (cc_prev_status.flags & CC_NO_OVERFLOW)
+ fputs ("s", file);
+ else
+ fputs ("l", file);
return;
case GEU:
@@ -3127,34 +3400,34 @@ put_condition_code (code, reverse_cc, mode, file)
else if (mode == MODE_FLOAT)
switch (code)
{
- case NE:
+ case NE:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "ne", file);
return;
- case EQ:
+ case EQ:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "e", file);
return;
- case GE:
+ case GE:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "nb", file);
return;
- case GT:
+ case GT:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "nbe", file);
return;
- case LE:
+ case LE:
fputs (ieee ? (reverse_cc ? "nb" : "b") : "be", file);
return;
- case LT:
+ case LT:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "b", file);
return;
- case GEU:
+ case GEU:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "nb", file);
return;
- case GTU:
+ case GTU:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "nbe", file);
return;
- case LEU:
+ case LEU:
fputs (ieee ? (reverse_cc ? "nb" : "b") : "be", file);
return;
- case LTU:
+ case LTU:
fputs (ieee ? (reverse_cc ? "ne" : "e") : "b", file);
return;
default:
@@ -3167,12 +3440,13 @@ put_condition_code (code, reverse_cc, mode, file)
C -- print opcode suffix for set/cmov insn.
c -- like C, but print reversed condition
F -- print opcode suffix for fcmov insn.
- f -- like C, but print reversed condition
+ f -- like F, but print reversed condition
+ D -- print the opcode suffix for a jump
+ d -- like D, but print reversed condition
R -- print the prefix for register names.
z -- print the opcode suffix for the size of the current operand.
* -- print a star (in certain assembler syntax)
w -- print the operand as if it's a "word" (HImode) even if it isn't.
- c -- don't print special prefixes before constant operands.
J -- print the appropriate jump operand.
s -- print a shift double count, followed by the assemblers argument
delimiter.
@@ -3294,9 +3568,9 @@ print_operand (file, x, code)
case GTU: fputs ("jne", file); return;
case LEU: fputs ("je", file); return;
case LTU: fputs ("#branch never", file); return;
-
+
/* no matching branches for GT nor LE */
-
+
default:
abort ();
}
@@ -3310,6 +3584,14 @@ print_operand (file, x, code)
return;
+ case 'D':
+ put_jump_code (GET_CODE (x), 0, file);
+ return;
+
+ case 'd':
+ put_jump_code (GET_CODE (x), 1, file);
+ return;
+
/* This is used by the conditional move instructions. */
case 'C':
put_condition_code (GET_CODE (x), 0, MODE_INT, file);
@@ -3365,7 +3647,7 @@ print_operand (file, x, code)
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
REAL_VALUE_TO_TARGET_SINGLE (r, l);
PRINT_IMMED_PREFIX (file);
- fprintf (file, "0x%x", l);
+ fprintf (file, "0x%lx", l);
}
/* These float cases don't actually occur as immediate operands. */
@@ -3388,7 +3670,7 @@ print_operand (file, x, code)
REAL_VALUE_TO_DECIMAL (r, "%.22e", dstr);
fprintf (file, "%s", dstr);
}
- else
+ else
{
if (code != 'P')
{
@@ -3582,7 +3864,9 @@ notice_update_cc (exp)
(Note that moving a constant 0 or 1 MAY set the cc's). */
if (REG_P (SET_DEST (exp))
&& (REG_P (SET_SRC (exp)) || GET_CODE (SET_SRC (exp)) == MEM
- || GET_RTX_CLASS (GET_CODE (SET_SRC (exp))) == '<'))
+ || GET_RTX_CLASS (GET_CODE (SET_SRC (exp))) == '<'
+ || (GET_CODE (SET_SRC (exp)) == IF_THEN_ELSE
+ && GET_MODE_CLASS (GET_MODE (SET_DEST (exp))) == MODE_INT)))
{
if (cc_status.value1
&& reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value1))
@@ -3659,6 +3943,7 @@ notice_update_cc (exp)
cc_status.flags
= CC_NOT_POSITIVE | CC_NOT_NEGATIVE | CC_NO_OVERFLOW;
cc_status.value1 = XVECEXP (SET_SRC (exp), 0, 0);
+ cc_status.value2 = 0;
break;
}
/* FALLTHRU */
@@ -3683,7 +3968,7 @@ notice_update_cc (exp)
if (stack_regs_mentioned_p (SET_SRC (XVECEXP (exp, 0, 0))))
{
cc_status.flags |= CC_IN_80387;
- if (TARGET_CMOVE && stack_regs_mentioned_p
+ if (0 && TARGET_CMOVE && stack_regs_mentioned_p
(XEXP (SET_SRC (XVECEXP (exp, 0, 0)), 1)))
cc_status.flags |= CC_FCOMI;
}
@@ -3715,7 +4000,12 @@ split_di (operands, num, lo_half, hi_half)
while (num--)
{
rtx op = operands[num];
- if (GET_CODE (op) == REG)
+ if (! reload_completed)
+ {
+ lo_half[num] = gen_lowpart (SImode, op);
+ hi_half[num] = gen_highpart (SImode, op);
+ }
+ else if (GET_CODE (op) == REG)
{
lo_half[num] = gen_rtx_REG (SImode, REGNO (op));
hi_half[num] = gen_rtx_REG (SImode, REGNO (op) + 1);
@@ -3788,7 +4078,7 @@ shift_op (op, mode)
int
VOIDmode_compare_op (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == COMPARE && GET_MODE (op) == VOIDmode;
}
@@ -4013,7 +4303,7 @@ output_float_compare (insn, operands)
int unordered_compare = GET_MODE (SET_SRC (body)) == CCFPEQmode;
rtx tmp;
- if (TARGET_CMOVE && STACK_REG_P (operands[1]))
+ if (0 && TARGET_CMOVE && STACK_REG_P (operands[1]))
{
cc_status.flags |= CC_FCOMI;
cc_prev_status.flags &= ~CC_TEST_AX;
@@ -4026,7 +4316,7 @@ output_float_compare (insn, operands)
operands[1] = tmp;
cc_status.flags |= CC_REVERSED;
}
-
+
if (! STACK_TOP_P (operands[0]))
abort ();
@@ -4085,7 +4375,7 @@ output_float_compare (insn, operands)
if (NON_STACK_REG_P (operands[1]))
output_op_from_reg (operands[1], strcat (buf, AS1 (%z0,%1)));
- else if (cc_status.flags & CC_FCOMI)
+ else if (cc_status.flags & CC_FCOMI)
{
output_asm_insn (strcat (buf, AS2 (%z1,%y1,%0)), operands);
return "";
@@ -4120,7 +4410,7 @@ output_fp_cc0_set (insn)
if (!(cc_status.flags & CC_REVERSED))
{
next = next_cc0_user (insn);
-
+
if (GET_CODE (next) == JUMP_INSN
&& GET_CODE (PATTERN (next)) == SET
&& SET_DEST (PATTERN (next)) == pc_rtx
@@ -4316,14 +4606,14 @@ assign_386_stack_local (mode, n)
int is_mul(op,mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == MULT);
}
int is_div(op,mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == DIV);
}
@@ -4383,7 +4673,7 @@ copy_all_rtx (orig)
copy->integrated = orig->integrated;
/* intel1 */
copy->is_spill_rtx = orig->is_spill_rtx;
-
+
format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++)
@@ -4435,7 +4725,7 @@ copy_all_rtx (orig)
/* Try to rewrite a memory address to make it valid */
-void
+void
rewrite_address (mem_rtx)
rtx mem_rtx;
{
@@ -4472,7 +4762,7 @@ rewrite_address (mem_rtx)
obfree (storage);
}
- /* This part is utilized by loop.c.
+ /* This part is utilized by loop.c.
If the address contains PLUS (reg,const) and this pattern is invalid
in this case - try to rewrite the address to make it valid. */
storage = oballoc (0);
@@ -4794,7 +5084,7 @@ sets_condition_code (pat)
int
str_immediate_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == CONST_INT && INTVAL (op) <= 32 && INTVAL (op) >= 0)
return 1;
@@ -4829,7 +5119,7 @@ is_fp_dest (insn)
|| GET_MODE (SET_DEST (PATTERN (insn))) == XFmode)
&& GET_CODE (SET_DEST (PATTERN (insn))) == REG
&& REGNO (SET_DEST (PATTERN (insn))) >= FIRST_FLOAT_REG
- && GET_CODE (SET_SRC (insn)) != MEM)
+ && GET_CODE (SET_SRC (PATTERN (insn))) != MEM)
return 1;
return 0;
@@ -5105,7 +5395,7 @@ output_strlen_unroll (operands)
/* Check third byte. */
output_asm_insn (AS2 (test%L1,%16,%1), xops);
output_asm_insn (AS1 (je,%l10), xops);
-
+
/* Check fourth byte and increment address. */
output_asm_insn (AS2 (add%L0,%5,%0), xops);
output_asm_insn (AS2 (test%L1,%17,%1), xops);
@@ -5124,3 +5414,167 @@ output_strlen_unroll (operands)
return "";
}
+
+char *
+output_fp_conditional_move (which_alternative, operands)
+ int which_alternative;
+ rtx operands[];
+{
+ switch (which_alternative)
+ {
+ case 0:
+ /* r <- cond ? arg : r */
+ output_asm_insn (AS2 (fcmov%F1,%2,%0), operands);
+ break;
+
+ case 1:
+ /* r <- cond ? r : arg */
+ output_asm_insn (AS2 (fcmov%f1,%3,%0), operands);
+ break;
+
+ case 2:
+ /* r <- cond ? r : arg */
+ output_asm_insn (AS2 (fcmov%F1,%2,%0), operands);
+ output_asm_insn (AS2 (fcmov%f1,%3,%0), operands);
+ break;
+
+ default:
+ abort ();
+ }
+
+ return "";
+}
+
+char *
+output_int_conditional_move (which_alternative, operands)
+ int which_alternative;
+ rtx operands[];
+{
+ int code = GET_CODE (operands[1]);
+ enum machine_mode mode;
+ rtx xops[4];
+
+ /* This is very tricky. We have to do it right. For a code segement
+ like:
+
+ int foo, bar;
+ ....
+ foo = foo - x;
+ if (foo >= 0)
+ bar = y;
+
+ final_scan_insn () may delete the insn which sets CC. We have to
+ tell final_scan_insn () if it should be reinserted. When CODE is
+ GT or LE, we have to check the CC_NO_OVERFLOW bit and return
+ NULL_PTR to tell final to reinsert the test insn because the
+ conditional move cannot be handled properly without it. */
+ if ((code == GT || code == LE)
+ && (cc_prev_status.flags & CC_NO_OVERFLOW))
+ return NULL_PTR;
+
+ mode = GET_MODE (operands [0]);
+ if (mode == DImode)
+ {
+ xops [0] = gen_rtx_SUBREG (SImode, operands [0], 1);
+ xops [1] = operands [1];
+ xops [2] = gen_rtx_SUBREG (SImode, operands [2], 1);
+ xops [3] = gen_rtx_SUBREG (SImode, operands [3], 1);
+ }
+
+ switch (which_alternative)
+ {
+ case 0:
+ /* r <- cond ? arg : r */
+ output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
+ if (mode == DImode)
+ output_asm_insn (AS2 (cmov%C1,%2,%0), xops);
+ break;
+
+ case 1:
+ /* r <- cond ? r : arg */
+ output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
+ if (mode == DImode)
+ output_asm_insn (AS2 (cmov%c1,%3,%0), xops);
+ break;
+
+ case 2:
+ /* rm <- cond ? arg1 : arg2 */
+ output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
+ output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
+ if (mode == DImode)
+ {
+ output_asm_insn (AS2 (cmov%C1,%2,%0), xops);
+ output_asm_insn (AS2 (cmov%c1,%3,%0), xops);
+ }
+ break;
+
+ default:
+ abort ();
+ }
+
+ return "";
+}
+
+int
+x86_adjust_cost (insn, link, dep_insn, cost)
+ rtx insn, link, dep_insn;
+ int cost;
+{
+ rtx next_inst;
+
+ if (GET_CODE (dep_insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN)
+ return 0;
+
+ if (GET_CODE (dep_insn) == INSN
+ && GET_CODE (PATTERN (dep_insn)) == SET
+ && GET_CODE (SET_DEST (PATTERN (dep_insn))) == REG
+ && GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SET
+ && !reg_overlap_mentioned_p (SET_DEST (PATTERN (dep_insn)),
+ SET_SRC (PATTERN (insn))))
+ return 0; /* ??? */
+
+
+ switch (ix86_cpu)
+ {
+ case PROCESSOR_PENTIUM:
+ if (cost != 0 && is_fp_insn (insn) && is_fp_insn (dep_insn)
+ && !is_fp_dest (dep_insn))
+ return 0;
+
+ if (agi_dependent (insn, dep_insn))
+ return 3;
+
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SET
+ && SET_DEST (PATTERN (insn)) == cc0_rtx
+ && (next_inst = next_nonnote_insn (insn))
+ && GET_CODE (next_inst) == JUMP_INSN)
+ /* compare probably paired with jump */
+ return 0;
+ break;
+
+ case PROCESSOR_K6:
+ default:
+ if (!is_fp_dest (dep_insn))
+ {
+ if(!agi_dependent (insn, dep_insn))
+ return 0;
+ if (TARGET_486)
+ return 2;
+ }
+ else
+ if (is_fp_store (insn) && is_fp_insn (dep_insn)
+ && NEXT_INSN (insn) && NEXT_INSN (NEXT_INSN (insn))
+ && NEXT_INSN (NEXT_INSN (NEXT_INSN (insn)))
+ && (GET_CODE (NEXT_INSN (insn)) == INSN)
+ && (GET_CODE (NEXT_INSN (NEXT_INSN (insn))) == JUMP_INSN)
+ && (GET_CODE (NEXT_INSN (NEXT_INSN (NEXT_INSN (insn)))) == NOTE)
+ && (NOTE_LINE_NUMBER (NEXT_INSN (NEXT_INSN (NEXT_INSN (insn))))
+ == NOTE_INSN_LOOP_END))
+ return 3;
+ break;
+ }
+
+ return cost;
+}
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index ef344b2803d..0bb72415367 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -155,48 +155,55 @@ extern int target_flags;
#define TARGET_486 (ix86_cpu == PROCESSOR_I486)
#define TARGET_PENTIUM (ix86_cpu == PROCESSOR_PENTIUM)
#define TARGET_PENTIUMPRO (ix86_cpu == PROCESSOR_PENTIUMPRO)
-#define TARGET_USE_LEAVE (ix86_cpu == PROCESSOR_I386)
-#define TARGET_PUSH_MEMORY (ix86_cpu == PROCESSOR_I386)
-#define TARGET_ZERO_EXTEND_WITH_AND (ix86_cpu != PROCESSOR_I386 \
- && ix86_cpu != PROCESSOR_PENTIUMPRO)
-#define TARGET_DOUBLE_WITH_ADD (ix86_cpu != PROCESSOR_I386)
-#define TARGET_USE_BIT_TEST (ix86_cpu == PROCESSOR_I386)
-#define TARGET_UNROLL_STRLEN (ix86_cpu != PROCESSOR_I386)
-#define TARGET_USE_Q_REG (ix86_cpu == PROCESSOR_PENTIUM \
- || ix86_cpu == PROCESSOR_PENTIUMPRO)
-#define TARGET_USE_ANY_REG (ix86_cpu == PROCESSOR_I486)
-#define TARGET_CMOVE (ix86_arch == PROCESSOR_PENTIUMPRO)
-#define TARGET_DEEP_BRANCH_PREDICTION (ix86_cpu == PROCESSOR_PENTIUMPRO)
+#define TARGET_K6 (ix86_cpu == PROCESSOR_K6)
+
+#define CPUMASK (1 << ix86_cpu)
+extern const int x86_use_leave, x86_push_memory, x86_zero_extend_with_and;
+extern const int x86_use_bit_test, x86_cmove, x86_deep_branch;
+extern const int x86_unroll_strlen, x86_use_q_reg, x86_use_any_reg;
+extern const int x86_double_with_add;
+
+#define TARGET_USE_LEAVE (x86_use_leave & CPUMASK)
+#define TARGET_PUSH_MEMORY (x86_push_memory & CPUMASK)
+#define TARGET_ZERO_EXTEND_WITH_AND (x86_zero_extend_with_and & CPUMASK)
+#define TARGET_USE_BIT_TEST (x86_use_bit_test & CPUMASK)
+#define TARGET_UNROLL_STRLEN (x86_unroll_strlen & CPUMASK)
+#define TARGET_USE_Q_REG (x86_use_q_reg & CPUMASK)
+#define TARGET_USE_ANY_REG (x86_use_any_reg & CPUMASK)
+#define TARGET_CMOVE (x86_cmove & (1 << ix86_arch))
+#define TARGET_DEEP_BRANCH_PREDICTION (x86_deep_branch & CPUMASK)
+#define TARGET_DOUBLE_WITH_ADD (x86_double_with_add & CPUMASK)
+
#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
#define TARGET_SWITCHES \
-{ { "80387", MASK_80387 }, \
- { "no-80387", -MASK_80387 }, \
- { "hard-float", MASK_80387 }, \
- { "soft-float", -MASK_80387 }, \
- { "no-soft-float", MASK_80387 }, \
- { "386", 0 }, \
- { "no-386", 0 }, \
- { "486", 0 }, \
- { "no-486", 0 }, \
- { "pentium", 0 }, \
- { "pentiumpro", 0 }, \
- { "rtd", MASK_RTD }, \
- { "no-rtd", -MASK_RTD }, \
- { "align-double", MASK_ALIGN_DOUBLE }, \
- { "no-align-double", -MASK_ALIGN_DOUBLE }, \
- { "svr3-shlib", MASK_SVR3_SHLIB }, \
- { "no-svr3-shlib", -MASK_SVR3_SHLIB }, \
- { "ieee-fp", MASK_IEEE_FP }, \
- { "no-ieee-fp", -MASK_IEEE_FP }, \
- { "fp-ret-in-387", MASK_FLOAT_RETURNS }, \
- { "no-fp-ret-in-387", -MASK_FLOAT_RETURNS }, \
- { "no-fancy-math-387", MASK_NO_FANCY_MATH_387 }, \
- { "fancy-math-387", -MASK_NO_FANCY_MATH_387 }, \
+{ { "80387", MASK_80387, "Use hardware fp" }, \
+ { "no-80387", -MASK_80387, "Do not use hardware fp" },\
+ { "hard-float", MASK_80387, "Use hardware fp" }, \
+ { "soft-float", -MASK_80387, "Do not use hardware fp" },\
+ { "no-soft-float", MASK_80387, "Use hardware fp" }, \
+ { "386", 0, "Optimize for i80386" }, \
+ { "no-386", 0, "" }, \
+ { "486", 0, "Optimize for i80486" }, \
+ { "no-486", 0, "" }, \
+ { "pentium", 0, "Optimize for Pentium" }, \
+ { "pentiumpro", 0, "Optimize for Pentium Pro, Pentium II" },\
+ { "rtd", MASK_RTD, "Alternate calling convention" },\
+ { "no-rtd", -MASK_RTD, "Use normal calling convention" },\
+ { "align-double", MASK_ALIGN_DOUBLE, "Align some doubles on dword boundary" },\
+ { "no-align-double", -MASK_ALIGN_DOUBLE, "Align doubles on word boundary" }, \
+ { "svr3-shlib", MASK_SVR3_SHLIB, "Uninitialized locals in .bss" }, \
+ { "no-svr3-shlib", -MASK_SVR3_SHLIB, "Uninitialized locals in .data" }, \
+ { "ieee-fp", MASK_IEEE_FP, "Use IEEE math for fp comparisons" }, \
+ { "no-ieee-fp", -MASK_IEEE_FP, "Do not use IEEE math for fp comparisons" }, \
+ { "fp-ret-in-387", MASK_FLOAT_RETURNS, "Return values of functions in FPU registers" }, \
+ { "no-fp-ret-in-387", -MASK_FLOAT_RETURNS , "Do not return values of functions in FPU registers"}, \
+ { "no-fancy-math-387", MASK_NO_FANCY_MATH_387, "Do not generate sin, cos, sqrt for 387" }, \
+ { "fancy-math-387", -MASK_NO_FANCY_MATH_387, "Generate sin, cos, sqrt for FPU"}, \
{ "omit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER }, \
{ "no-omit-leaf-frame-pointer",-MASK_OMIT_LEAF_FRAME_POINTER }, \
- { "no-wide-multiply", MASK_NO_WIDE_MULTIPLY }, \
- { "wide-multiply", -MASK_NO_WIDE_MULTIPLY }, \
+ { "no-wide-multiply", MASK_NO_WIDE_MULTIPLY, "multiplies of 32 bits constrained to 32 bits" }, \
+ { "wide-multiply", -MASK_NO_WIDE_MULTIPLY, "multiplies of 32 bits are 64 bits" }, \
{ "schedule-prologue", MASK_SCHEDULE_PROLOGUE }, \
{ "no-schedule-prologue", -MASK_SCHEDULE_PROLOGUE }, \
{ "debug-addr", MASK_DEBUG_ADDR }, \
@@ -219,7 +226,8 @@ enum processor_type
{PROCESSOR_I386, /* 80386 */
PROCESSOR_I486, /* 80486DX, 80486SX, 80486DX[24] */
PROCESSOR_PENTIUM,
- PROCESSOR_PENTIUMPRO};
+ PROCESSOR_PENTIUMPRO,
+ PROCESSOR_K6};
#define PROCESSOR_I386_STRING "i386"
#define PROCESSOR_I486_STRING "i486"
@@ -227,28 +235,20 @@ enum processor_type
#define PROCESSOR_PENTIUM_STRING "pentium"
#define PROCESSOR_I686_STRING "i686"
#define PROCESSOR_PENTIUMPRO_STRING "pentiumpro"
+#define PROCESSOR_K6_STRING "k6"
extern enum processor_type ix86_cpu;
extern int ix86_arch;
/* Define the default processor. This is overridden by other tm.h files. */
-#define PROCESSOR_DEFAULT \
- ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_I486) \
- ? PROCESSOR_I486 \
- : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUM) \
- ? PROCESSOR_PENTIUM \
- : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUMPRO) \
- ? PROCESSOR_PENTIUMPRO \
- : PROCESSOR_I386
+#define PROCESSOR_DEFAULT (enum processor_type) TARGET_CPU_DEFAULT
#define PROCESSOR_DEFAULT_STRING \
- ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_I486) \
- ? PROCESSOR_I486_STRING \
- : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUM) \
- ? PROCESSOR_PENTIUM_STRING \
- : ((enum processor_type) TARGET_CPU_DEFAULT == PROCESSOR_PENTIUMPRO) \
- ? PROCESSOR_PENTIUMPRO_STRING \
- : PROCESSOR_I386_STRING
+ (PROCESSOR_DEFAULT == PROCESSOR_I486 ? PROCESSOR_I486_STRING \
+ : PROCESSOR_DEFAULT == PROCESSOR_PENTIUM ? PROCESSOR_PENTIUM_STRING \
+ : PROCESSOR_DEFAULT == PROCESSOR_PENTIUMPRO ? PROCESSOR_PENTIUMPRO_STRING \
+ : PROCESSOR_DEFAULT == PROCESSOR_K6 ? PROCESSOR_K6_STRING \
+ : PROCESSOR_I386_STRING)
/* This macro is similar to `TARGET_SWITCHES' but defines names of
command options that have values. Its definition is an
@@ -260,13 +260,13 @@ extern int ix86_arch;
option if the fixed part matches. The actual option name is made
by appending `-m' to the specified name. */
#define TARGET_OPTIONS \
-{ { "cpu=", &ix86_cpu_string}, \
- { "arch=", &ix86_arch_string}, \
- { "reg-alloc=", &i386_reg_alloc_order }, \
- { "regparm=", &i386_regparm_string }, \
- { "align-loops=", &i386_align_loops_string }, \
- { "align-jumps=", &i386_align_jumps_string }, \
- { "align-functions=", &i386_align_funcs_string }, \
+{ { "cpu=", &ix86_cpu_string, "Schedule code for given CPU"}, \
+ { "arch=", &ix86_arch_string, "Generate code for given CPU"}, \
+ { "reg-alloc=", &i386_reg_alloc_order, "Control allocation order of integer registers" }, \
+ { "regparm=", &i386_regparm_string, "Number of registers used to pass integer arguments" }, \
+ { "align-loops=", &i386_align_loops_string, "Loop code aligned to this power of 2" }, \
+ { "align-jumps=", &i386_align_jumps_string, "Jump targets are aligned to this power of 2" }, \
+ { "align-functions=", &i386_align_funcs_string, "Function starts are aligned to this power of 2" }, \
{ "branch-cost=", &i386_branch_cost_string }, \
SUBTARGET_OPTIONS \
}
@@ -304,15 +304,21 @@ extern int ix86_arch;
%{mpentiumpro:-mcpu=pentiumpro}}"
#endif
+#define CPP_486_SPEC "%{!ansi:-Di486} -D__i486 -D__i486__"
+#define CPP_586_SPEC "%{!ansi:-Di586 -Dpentium} \
+ -D__i586 -D__i586__ -D__pentium -D__pentium__"
+#define CPP_686_SPEC "%{!ansi:-Di686 -Dpentiumpro} \
+ -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__"
+
#ifndef CPP_CPU_DEFAULT_SPEC
#if TARGET_CPU_DEFAULT == 1
-#define CPP_CPU_DEFAULT_SPEC "-Di486"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_486)"
#else
#if TARGET_CPU_DEFAULT == 2
-#define CPP_CPU_DEFAULT_SPEC "-Dpentium -Di586"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_586)"
#else
#if TARGET_CPU_DEFAULT == 3
-#define CPP_CPU_DEFAULT_SPEC "-Dpentiumpro -Di686"
+#define CPP_CPU_DEFAULT_SPEC "%(cpp_686)"
#else
#define CPP_CPU_DEFAULT_SPEC ""
#endif
@@ -322,11 +328,12 @@ extern int ix86_arch;
#ifndef CPP_CPU_SPEC
#define CPP_CPU_SPEC "\
--Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) \
-%{mcpu=i486:-Di486} %{m486:-Di486} \
-%{mpentium:-Dpentium -Di586} %{mcpu=pentium:-Dpentium -Di586} \
-%{mpentiumpro:-Dpentiumpro -Di686} %{mcpu=pentiumpro:-Dpentiumpro -Di686} \
-%{!mcpu*:%{!m486:%{!mpentium*: %[cpp_cpu_default]}}}"
+-Acpu(i386) -Amachine(i386) \
+%{!ansi:-Di386} -D__i386 -D__i386__ \
+%{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} \
+%{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} \
+%{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} \
+%{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}"
#endif
#ifndef CC1_SPEC
@@ -348,6 +355,9 @@ extern int ix86_arch;
#endif
#define EXTRA_SPECS \
+ { "cpp_486", CPP_486_SPEC}, \
+ { "cpp_586", CPP_586_SPEC}, \
+ { "cpp_686", CPP_686_SPEC}, \
{ "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
{ "cpp_cpu", CPP_CPU_SPEC }, \
{ "cc1_cpu", CC1_CPU_SPEC }, \
@@ -419,8 +429,78 @@ extern int ix86_arch;
aligned on 64 bit boundaries. */
#define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
-/* align DFmode constants and nonaggregates */
-#define ALIGN_DFmode (!TARGET_386)
+/* If defined, a C expression to compute the alignment given to a
+ constant that is being placed in memory. CONSTANT is the constant
+ and ALIGN is the alignment that the object would ordinarily have.
+ The value of this macro is used instead of that alignment to align
+ the object.
+
+ If this macro is not defined, then ALIGN is used.
+
+ The typical use of this macro is to increase alignment for string
+ constants to be word aligned so that `strcpy' calls that copy
+ constants can be done inline. */
+
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
+ (TREE_CODE (EXP) == REAL_CST \
+ ? ((TYPE_MODE (TREE_TYPE (EXP)) == DFmode && (ALIGN) < 64) \
+ ? 64 \
+ : (TYPE_MODE (TREE_TYPE (EXP)) == XFmode && (ALIGN) < 128) \
+ ? 128 \
+ : (ALIGN)) \
+ : TREE_CODE (EXP) == STRING_CST \
+ ? ((TREE_STRING_LENGTH (EXP) >= 31 && (ALIGN) < 256) \
+ ? 256 \
+ : (ALIGN)) \
+ : (ALIGN))
+
+/* If defined, a C expression to compute the alignment for a static
+ variable. TYPE is the data type, and ALIGN is the alignment that
+ the object would ordinarily have. The value of this macro is used
+ instead of that alignment to align the object.
+
+ If this macro is not defined, then ALIGN is used.
+
+ One use of this macro is to increase alignment of medium-size
+ data to make it all fit in fewer cache lines. Another is to
+ cause character arrays to be word-aligned so that `strcpy' calls
+ that copy constants to character arrays can be done inline. */
+
+#define DATA_ALIGNMENT(TYPE, ALIGN) \
+ ((AGGREGATE_TYPE_P (TYPE) \
+ && TYPE_SIZE (TYPE) \
+ && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
+ && (TREE_INT_CST_LOW (TYPE_SIZE (TYPE)) >= 256 \
+ || TREE_INT_CST_HIGH (TYPE_SIZE (TYPE))) && (ALIGN) < 256) \
+ ? 256 \
+ : TREE_CODE (TYPE) == ARRAY_TYPE \
+ ? ((TYPE_MODE (TREE_TYPE (TYPE)) == DFmode && (ALIGN) < 64) \
+ ? 64 \
+ : (TYPE_MODE (TREE_TYPE (TYPE)) == XFmode && (ALIGN) < 128) \
+ ? 128 \
+ : (ALIGN)) \
+ : TREE_CODE (TYPE) == COMPLEX_TYPE \
+ ? ((TYPE_MODE (TYPE) == DCmode && (ALIGN) < 64) \
+ ? 64 \
+ : (TYPE_MODE (TYPE) == XCmode && (ALIGN) < 128) \
+ ? 128 \
+ : (ALIGN)) \
+ : ((TREE_CODE (TYPE) == RECORD_TYPE \
+ || TREE_CODE (TYPE) == UNION_TYPE \
+ || TREE_CODE (TYPE) == QUAL_UNION_TYPE) \
+ && TYPE_FIELDS (TYPE)) \
+ ? ((DECL_MODE (TYPE_FIELDS (TYPE)) == DFmode && (ALIGN) < 64) \
+ ? 64 \
+ : (DECL_MODE (TYPE_FIELDS (TYPE)) == XFmode && (ALIGN) < 128) \
+ ? 128 \
+ : (ALIGN)) \
+ : TREE_CODE (TYPE) == REAL_TYPE \
+ ? ((TYPE_MODE (TYPE) == DFmode && (ALIGN) < 64) \
+ ? 64 \
+ : (TYPE_MODE (TYPE) == XFmode && (ALIGN) < 128) \
+ ? 128 \
+ : (ALIGN)) \
+ : (ALIGN))
/* Set this non-zero if move instructions will actually fail to work
when given unaligned data. */
@@ -436,11 +516,13 @@ extern int ix86_arch;
/* Align loop starts for optimal branching. */
#define LOOP_ALIGN(LABEL) (i386_align_loops)
+#define LOOP_ALIGN_MAX_SKIP (i386_align_loops_string ? 0 : 7)
/* This is how to align an instruction for optimal branching.
On i486 we'll get better performance by aligning on a
cache line (i.e. 16 byte) boundary. */
#define LABEL_ALIGN_AFTER_BARRIER(LABEL) (i386_align_jumps)
+#define LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP (i386_align_jumps_string ? 0 : 7)
/* Standard register usage. */
@@ -567,8 +649,7 @@ extern int ix86_arch;
for cross-compiler testing. */
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
- ((REGNO) < 2 ? 1 \
- : (REGNO) < 4 ? 1 \
+ ((REGNO) < 4 ? 1 \
: FP_REGNO_P (REGNO) \
? (((int) GET_MODE_CLASS (MODE) == (int) MODE_FLOAT \
|| (int) GET_MODE_CLASS (MODE) == (int) MODE_COMPLEX_FLOAT) \
@@ -581,7 +662,10 @@ extern int ix86_arch;
If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
for any hard reg, then this must be 0 for correct output. */
-#define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) == (MODE2))
+#define MODES_TIEABLE_P(MODE1, MODE2) \
+ ((MODE1) == (MODE2) \
+ || ((MODE1) == SImode && (MODE2) == HImode) \
+ || ((MODE1) == HImode && (MODE2) == SImode))
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
@@ -812,10 +896,19 @@ enum reg_class
/* Similar, but for floating constants, and defining letters G and H.
Here VALUE is the CONST_DOUBLE rtx itself. We allow constants even if
TARGET_387 isn't set, because the stack register converter may need to
- load 0.0 into the function value register. */
+ load 0.0 into the function value register.
+
+ We disallow these constants when -fomit-frame-pointer and compiling
+ PIC code since reload might need to force the constant to memory.
+ Forcing the constant to memory changes the elimination offsets after
+ the point where they must stay constant.
+
+ However, we must allow them after reload as completed as reg-stack.c
+ will create insns which use these constants. */
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0)
+ (((reload_completed || !flag_pic || !flag_omit_frame_pointer) && (C) == 'G') \
+ ? standard_80387_constant_p (VALUE) : 0)
/* Place additional restrictions on the register class to use when it
is necessary to be able to hold a value of mode MODE in a reload
@@ -838,8 +931,11 @@ enum reg_class
Narrow ALL_REGS to GENERAL_REGS. This supports allowing movsf and
movdf to do mem-to-mem moves through integer regs. */
-#define PREFERRED_RELOAD_CLASS(X,CLASS) \
- (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode ? NO_REGS \
+#define PREFERRED_RELOAD_CLASS(X,CLASS) \
+ (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode \
+ ? (standard_80387_constant_p (X) \
+ ? reg_class_subset_p (CLASS, FLOAT_REGS) ? CLASS : FLOAT_REGS \
+ : NO_REGS) \
: GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
: ((CLASS) == ALL_REGS \
&& GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS \
@@ -1439,25 +1535,16 @@ do { \
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts. */
-/* On the 386, the trampoline contains three instructions:
+/* On the 386, the trampoline contains two instructions:
mov #STATIC,ecx
- mov #FUNCTION,eax
- jmp @eax */
-#define TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb9)); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb8)); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_CHAR (FILE, GEN_INT (0xff)); \
- ASM_OUTPUT_CHAR (FILE, GEN_INT (0xe0)); \
-}
+ jmp FUNCTION
+ The trampoline is generated entirely at runtime. The operand of JMP
+ is the address of FUNCTION relative to the instruction following the
+ JMP (which is 5 bytes long). */
/* Length in units of the trampoline for entering a nested function. */
-#define TRAMPOLINE_SIZE 12
+#define TRAMPOLINE_SIZE 10
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
@@ -1465,8 +1552,14 @@ do { \
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
+ /* Compute offset from the end of the jmp to the target function. */ \
+ rtx disp = expand_binop (SImode, sub_optab, FNADDR, \
+ plus_constant (TRAMP, 10), \
+ NULL_RTX, 1, OPTAB_DIRECT); \
+ emit_move_insn (gen_rtx_MEM (QImode, TRAMP), GEN_INT (0xb9)); \
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 1)), CXT); \
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 6)), FNADDR); \
+ emit_move_insn (gen_rtx_MEM (QImode, plus_constant (TRAMP, 5)), GEN_INT (0xe9));\
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 6)), disp); \
}
/* Definitions for register eliminations.
@@ -1610,10 +1703,9 @@ do { \
#define MAX_REGS_PER_ADDRESS 2
-#define CONSTANT_ADDRESS_P(X) \
- (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
- || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
- || GET_CODE (X) == HIGH)
+#define CONSTANT_ADDRESS_P(X) \
+ (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
+ || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST)
/* Nonzero if the constant value X is a legitimate general operand.
It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
@@ -1800,10 +1892,10 @@ while (0)
in one reasonably fast instruction. */
#define MOVE_MAX 4
-/* The number of scalar move insns which should be generated instead
- of a string move insn or a library call. Increasing the value
- will always make code faster, but eventually incurs high cost in
- increased code size.
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction pairs, we will do a movstr or libcall instead.
+ Increasing the value will always make code faster, but eventually
+ incurs high cost in increased code size.
If you don't define this, a reasonable default is used.
@@ -2150,70 +2242,7 @@ while (0)
the same cost as a data-dependence. */
#define ADJUST_COST(insn,link,dep_insn,cost) \
- { \
- rtx next_inst; \
- if (GET_CODE (dep_insn) == CALL_INSN) \
- (cost) = 0; \
- \
- else if (GET_CODE (dep_insn) == INSN \
- && GET_CODE (PATTERN (dep_insn)) == SET \
- && GET_CODE (SET_DEST (PATTERN (dep_insn))) == REG \
- && GET_CODE (insn) == INSN \
- && GET_CODE (PATTERN (insn)) == SET \
- && !reg_overlap_mentioned_p (SET_DEST (PATTERN (dep_insn)), \
- SET_SRC (PATTERN (insn)))) \
- { \
- (cost) = 0; \
- } \
- \
- else if (GET_CODE (insn) == JUMP_INSN) \
- { \
- (cost) = 0; \
- } \
- \
- if (TARGET_PENTIUM) \
- { \
- if (cost !=0 && is_fp_insn (insn) && is_fp_insn (dep_insn) \
- && !is_fp_dest (dep_insn)) \
- { \
- (cost) = 0; \
- } \
- \
- if (agi_dependent (insn, dep_insn)) \
- { \
- (cost) = 3; \
- } \
- else if (GET_CODE (insn) == INSN \
- && GET_CODE (PATTERN (insn)) == SET \
- && SET_DEST (PATTERN (insn)) == cc0_rtx \
- && (next_inst = next_nonnote_insn (insn)) \
- && GET_CODE (next_inst) == JUMP_INSN) \
- { /* compare probably paired with jump */ \
- (cost) = 0; \
- } \
- } \
- else \
- if (!is_fp_dest (dep_insn)) \
- { \
- if(!agi_dependent (insn, dep_insn)) \
- (cost) = 0; \
- else if (TARGET_486) \
- (cost) = 2; \
- } \
- else \
- if (is_fp_store (insn) && is_fp_insn (dep_insn) \
- && NEXT_INSN (insn) && NEXT_INSN (NEXT_INSN (insn)) \
- && NEXT_INSN (NEXT_INSN (NEXT_INSN (insn))) \
- && (GET_CODE (NEXT_INSN (insn)) == INSN) \
- && (GET_CODE (NEXT_INSN (NEXT_INSN (insn))) == JUMP_INSN) \
- && (GET_CODE (NEXT_INSN (NEXT_INSN (NEXT_INSN (insn)))) == NOTE) \
- && (NOTE_LINE_NUMBER (NEXT_INSN (NEXT_INSN (NEXT_INSN (insn)))) \
- == NOTE_INSN_LOOP_END)) \
- { \
- (cost) = 3; \
- } \
- }
-
+ (cost) = x86_adjust_cost(insn, link, dep_insn, cost)
#define ADJUST_BLOCKAGE(last_insn,insn,blockage) \
{ \
@@ -2230,6 +2259,8 @@ while (0)
} \
}
+#define ISSUE_RATE ((int)ix86_cpu > (int)PROCESSOR_I486 ? 2 : 1)
+
/* Add any extra modes needed to represent the condition code.
@@ -2697,6 +2728,9 @@ extern int is_fp_dest ();
extern int is_fp_store ();
extern int agi_dependent ();
extern int reg_mentioned_in_mem ();
+extern char *output_int_conditional_move ();
+extern char *output_fp_conditional_move ();
+extern int ix86_can_use_return_insn_p ();
#ifdef NOTYET
extern struct rtx_def *copy_all_rtx ();
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 7fe22aafbd1..eea2b34c2e1 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -64,13 +64,50 @@
;; prevent insns referencing it being scheduled across the initial
;; decrement of the stack pointer.
;; 5 This is a `bsf' operation.
+;; 6 This is the @GOT offset of a PIC address.
+;; 7 This is the @GOTOFF offset of a PIC address.
+;; 8 This is a reference to a symbol's @PLT address.
;; This shadows the processor_type enumeration, so changes must be made
;; to i386.h at the same time.
-(define_attr "type" "integer,idiv,imul,fld,fpop,fpdiv,fpmul"
+(define_attr "type"
+ "integer,binary,memory,test,compare,fcompare,idiv,imul,lea,fld,fpop,fpdiv,fpmul"
(const_string "integer"))
+(define_attr "memory" "none,load,store"
+ (cond [(eq_attr "type" "idiv,lea")
+ (const_string "none")
+
+ (eq_attr "type" "fld")
+ (const_string "load")
+
+ (eq_attr "type" "test")
+ (if_then_else (match_operand 0 "memory_operand" "")
+ (const_string "load")
+ (const_string "none"))
+
+ (eq_attr "type" "compare,fcompare")
+ (if_then_else (ior (match_operand 0 "memory_operand" "")
+ (match_operand 1 "memory_operand" ""))
+ (const_string "load")
+ (const_string "none"))
+
+ (and (eq_attr "type" "integer,memory,fpop")
+ (match_operand 0 "memory_operand" ""))
+ (const_string "store")
+
+ (and (eq_attr "type" "integer,memory,fpop")
+ (match_operand 1 "memory_operand" ""))
+ (const_string "load")
+
+ (and (eq_attr "type" "binary,imul,fpmul,fpdiv")
+ (ior (match_operand 1 "memory_operand" "")
+ (match_operand 2 "memory_operand" "")))
+ (const_string "load")]
+
+ (const_string "none")))
+
;; Functional units
; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
@@ -89,11 +126,11 @@
;; Floating point
(define_function_unit "fp" 1 0
- (and (eq_attr "type" "fpop") (eq_attr "cpu" "i386,i486"))
+ (and (eq_attr "type" "fpop,fcompare") (eq_attr "cpu" "i386,i486"))
5 5)
(define_function_unit "fp" 1 0
- (and (eq_attr "type" "fpop") (eq_attr "cpu" "pentium,pentiumpro"))
+ (and (eq_attr "type" "fpop,fcompare") (eq_attr "cpu" "pentium,pentiumpro"))
3 0)
(define_function_unit "fp" 1 0
@@ -117,12 +154,69 @@
10 10)
(define_function_unit "fp" 1 0
- (eq_attr "type" "fld")
+ (and (eq_attr "type" "fld") (eq_attr "cpu" "!pentiumpro,k6"))
1 0)
-(define_function_unit "integer" 1 0
- (and (eq_attr "type" "integer") (eq_attr "cpu" "!i386"))
- 2 0)
+;; K6 FPU is not pipelined.
+(define_function_unit "fp" 1 0
+ (and (eq_attr "type" "fpop,fpmul,fcompare") (eq_attr "cpu" "k6"))
+ 2 2)
+
+;; i386 and i486 have one integer unit, which need not be modeled
+
+(define_function_unit "integer" 2 0
+ (and (eq_attr "type" "integer,binary,test,compare,lea") (eq_attr "cpu" "pentium,pentiumpro"))
+ 1 0)
+
+(define_function_unit "integer" 2 0
+ (and (eq_attr "cpu" "k6")
+ (and (eq_attr "type" "integer,binary,test,compare")
+ (eq_attr "memory" "!load")))
+ 1 0)
+
+;; Internally, K6 converts REG OP MEM instructions into a load (2 cycles)
+;; and a register operation (1 cycle).
+(define_function_unit "integer" 2 0
+ (and (eq_attr "cpu" "k6")
+ (and (eq_attr "type" "integer,binary,test,compare")
+ (eq_attr "memory" "load")))
+ 3 0)
+
+;; Multiplies use one of the integer units
+(define_function_unit "integer" 2 0
+ (and (eq_attr "cpu" "pentium") (eq_attr "type" "imul"))
+ 11 11)
+
+(define_function_unit "integer" 2 0
+ (and (eq_attr "cpu" "k6") (eq_attr "type" "imul"))
+ 2 2)
+
+(define_function_unit "integer" 2 0
+ (and (eq_attr "cpu" "pentium") (eq_attr "type" "idiv"))
+ 25 25)
+
+(define_function_unit "integer" 2 0
+ (and (eq_attr "cpu" "k6") (eq_attr "type" "idiv"))
+ 17 17)
+
+;; Pentium Pro and K6 have a separate load unit.
+(define_function_unit "load" 1 0
+ (and (eq_attr "cpu" "pentiumpro") (eq_attr "memory" "load"))
+ 3 0)
+
+(define_function_unit "load" 1 0
+ (and (eq_attr "cpu" "k6") (eq_attr "memory" "load"))
+ 2 0)
+
+;; Pentium Pro and K6 have a separate store unit.
+(define_function_unit "store" 1 0
+ (and (eq_attr "cpu" "pentiumpro,k6") (eq_attr "memory" "store"))
+ 1 0)
+
+;; lea executes in the K6 store unit with 1 cycle latency
+(define_function_unit "store" 1 0
+ (and (eq_attr "cpu" "k6") (eq_attr "type" "lea"))
+ 1 0)
;; "movl MEM,REG / testl REG,REG" is faster on a 486 than "cmpl $0,MEM".
@@ -140,7 +234,7 @@
;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in i386.h.
-(define_attr "cpu" "i386,i486,pentium,pentiumpro"
+(define_attr "cpu" "i386,i486,pentium,pentiumpro,k6"
(const (symbol_ref "ix86_cpu")))
(define_insn "tstsi_1"
@@ -154,7 +248,8 @@
operands[1] = const0_rtx;
return AS2 (cmp%L0,%1,%0);
-}")
+}"
+ [(set_attr "type" "test")])
(define_expand "tstsi"
[(set (cc0)
@@ -164,6 +259,7 @@
{
i386_compare_gen = gen_tstsi_1;
i386_compare_op0 = operands[0];
+ i386_compare_op1 = const0_rtx;
DONE;
}")
@@ -178,7 +274,8 @@
operands[1] = const0_rtx;
return AS2 (cmp%W0,%1,%0);
-}")
+}"
+ [(set_attr "type" "test")])
(define_expand "tsthi"
[(set (cc0)
@@ -188,6 +285,7 @@
{
i386_compare_gen = gen_tsthi_1;
i386_compare_op0 = operands[0];
+ i386_compare_op1 = const0_rtx;
DONE;
}")
@@ -202,7 +300,8 @@
operands[1] = const0_rtx;
return AS2 (cmp%B0,%1,%0);
-}")
+}"
+ [(set_attr "type" "test")])
(define_expand "tstqi"
[(set (cc0)
@@ -212,6 +311,7 @@
{
i386_compare_gen = gen_tstqi_1;
i386_compare_op0 = operands[0];
+ i386_compare_op1 = const0_rtx;
DONE;
}")
@@ -231,7 +331,8 @@
output_asm_insn (AS1 (fstp,%y0), operands);
return output_fp_cc0_set (insn);
-}")
+}"
+ [(set_attr "type" "test")])
;; Don't generate tstsf if generating IEEE code, since the `ftst' opcode
;; isn't IEEE compliant.
@@ -245,6 +346,7 @@
{
i386_compare_gen = gen_tstsf_cc;
i386_compare_op0 = operands[0];
+ i386_compare_op1 = const0_rtx;
DONE;
}")
@@ -264,7 +366,8 @@
output_asm_insn (AS1 (fstp,%y0), operands);
return output_fp_cc0_set (insn);
-}")
+}"
+ [(set_attr "type" "test")])
;; Don't generate tstdf if generating IEEE code, since the `ftst' opcode
;; isn't IEEE compliant.
@@ -278,6 +381,7 @@
{
i386_compare_gen = gen_tstdf_cc;
i386_compare_op0 = operands[0];
+ i386_compare_op1 = const0_rtx;
DONE;
}")
@@ -297,7 +401,8 @@
output_asm_insn (AS1 (fstp,%y0), operands);
return output_fp_cc0_set (insn);
-}")
+}"
+ [(set_attr "type" "test")])
;; Don't generate tstxf if generating IEEE code, since the `ftst' opcode
;; isn't IEEE compliant.
@@ -311,6 +416,7 @@
{
i386_compare_gen = gen_tstxf_cc;
i386_compare_op0 = operands[0];
+ i386_compare_op1 = const0_rtx;
DONE;
}")
@@ -322,15 +428,8 @@
(compare (match_operand:SI 0 "nonimmediate_operand" "mr,r")
(match_operand:SI 1 "general_operand" "ri,mr")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
- "*
-{
- if (CONSTANT_P (operands[0]) || GET_CODE (operands[1]) == MEM)
- {
- cc_status.flags |= CC_REVERSED;
- return AS2 (cmp%L0,%0,%1);
- }
- return AS2 (cmp%L0,%1,%0);
-}")
+ "* return AS2 (cmp%L0,%1,%0);"
+ [(set_attr "type" "compare")])
(define_expand "cmpsi"
[(set (cc0)
@@ -353,15 +452,8 @@
(compare (match_operand:HI 0 "nonimmediate_operand" "mr,r")
(match_operand:HI 1 "general_operand" "ri,mr")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
- "*
-{
- if (CONSTANT_P (operands[0]) || GET_CODE (operands[1]) == MEM)
- {
- cc_status.flags |= CC_REVERSED;
- return AS2 (cmp%W0,%0,%1);
- }
- return AS2 (cmp%W0,%1,%0);
-}")
+ "* return AS2 (cmp%W0,%1,%0);"
+ [(set_attr "type" "compare")])
(define_expand "cmphi"
[(set (cc0)
@@ -384,15 +476,8 @@
(compare (match_operand:QI 0 "nonimmediate_operand" "q,mq")
(match_operand:QI 1 "general_operand" "qm,nq")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
- "*
-{
- if (CONSTANT_P (operands[0]) || GET_CODE (operands[1]) == MEM)
- {
- cc_status.flags |= CC_REVERSED;
- return AS2 (cmp%B0,%0,%1);
- }
- return AS2 (cmp%B0,%1,%0);
-}")
+ "* return AS2 (cmp%B0,%1,%0);"
+ [(set_attr "type" "compare")])
(define_expand "cmpqi"
[(set (cc0)
@@ -421,7 +506,8 @@
(match_operand:XF 1 "register_operand" "f")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -431,7 +517,8 @@
(match_operand:SI 1 "nonimmediate_operand" "rm"))]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -441,7 +528,8 @@
(match_operand:XF 1 "register_operand" "f")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -451,17 +539,19 @@
(match_operand:DF 1 "nonimmediate_operand" "fm"))]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
(match_operator 2 "VOIDmode_compare_op"
[(float_extend:XF
- (match_operand:DF 1 "nonimmediate_operand" "fm"))
- (match_operand:XF 0 "register_operand" "f")]))
+ (match_operand:DF 0 "nonimmediate_operand" "fm"))
+ (match_operand:XF 1 "register_operand" "f")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -471,7 +561,19 @@
(match_operand:SF 1 "nonimmediate_operand" "fm"))]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
+
+(define_insn ""
+ [(set (cc0)
+ (match_operator 2 "VOIDmode_compare_op"
+ [(float_extend:XF
+ (match_operand:SF 0 "nonimmediate_operand" "fm"))
+ (match_operand:XF 1 "register_operand" "f")]))
+ (clobber (match_scratch:HI 3 "=a"))]
+ "TARGET_80387"
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -479,7 +581,8 @@
(match_operand:XF 1 "register_operand" "f")))
(clobber (match_scratch:HI 2 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -489,7 +592,8 @@
(clobber (match_scratch:HI 3 "=a,a"))]
"TARGET_80387
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -499,7 +603,8 @@
(match_operand:SI 1 "nonimmediate_operand" "rm"))]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -509,7 +614,8 @@
(match_operand:DF 1 "register_operand" "f")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -519,7 +625,8 @@
(match_operand:SF 1 "nonimmediate_operand" "fm"))]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -529,7 +636,8 @@
(match_operand:DF 1 "register_operand" "f")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -539,7 +647,8 @@
(match_operand:DF 1 "nonimmediate_operand" "fm")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -547,7 +656,8 @@
(match_operand:DF 1 "register_operand" "f")))
(clobber (match_scratch:HI 2 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
;; These two insns will never be generated by combine due to the mode of
;; the COMPARE.
@@ -569,7 +679,7 @@
; "TARGET_80387"
; "* return output_float_compare (insn, operands);")
-(define_insn "cmpsf_cc_1"
+(define_insn "*cmpsf_cc_1"
[(set (cc0)
(match_operator 2 "VOIDmode_compare_op"
[(match_operand:SF 0 "nonimmediate_operand" "f,fm")
@@ -577,7 +687,8 @@
(clobber (match_scratch:HI 3 "=a,a"))]
"TARGET_80387
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -587,7 +698,8 @@
(match_operand:SI 1 "nonimmediate_operand" "rm"))]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -597,7 +709,8 @@
(match_operand:SF 1 "register_operand" "f")]))
(clobber (match_scratch:HI 3 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_insn ""
[(set (cc0)
@@ -605,7 +718,8 @@
(match_operand:SF 1 "register_operand" "f")))
(clobber (match_scratch:HI 2 "=a"))]
"TARGET_80387"
- "* return output_float_compare (insn, operands);")
+ "* return output_float_compare (insn, operands);"
+ [(set_attr "type" "fcompare")])
(define_expand "cmpxf"
[(set (cc0)
@@ -765,7 +879,8 @@
return AS2 (test%L0,%1,%0);
return AS2 (test%L1,%0,%1);
-}")
+}"
+ [(set_attr "type" "compare")])
(define_insn ""
[(set (cc0)
@@ -813,7 +928,8 @@
return AS2 (test%W0,%1,%0);
return AS2 (test%W1,%0,%1);
-}")
+}"
+ [(set_attr "type" "compare")])
(define_insn ""
[(set (cc0)
@@ -826,7 +942,8 @@
return AS2 (test%B0,%1,%0);
return AS2 (test%B1,%0,%1);
-}")
+}"
+ [(set_attr "type" "compare")])
;; move instructions.
;; There is one for each machine mode,
@@ -837,13 +954,15 @@
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "rn"))]
"flag_pic"
- "* return AS1 (push%L0,%1);")
+ "* return AS1 (push%L0,%1);"
+ [(set_attr "memory" "store")])
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "ri"))]
"!flag_pic"
- "* return AS1 (push%L0,%1);")
+ "* return AS1 (push%L0,%1);"
+ [(set_attr "memory" "store")])
;; On a 386, it is faster to push MEM directly.
@@ -851,7 +970,9 @@
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "memory_operand" "m"))]
"TARGET_PUSH_MEMORY"
- "* return AS1 (push%L0,%1);")
+ "* return AS1 (push%L0,%1);"
+ [(set_attr "type" "memory")
+ (set_attr "memory" "load")])
;; General case of fullword move.
@@ -882,18 +1003,24 @@
;; On i486, incl reg is faster than movl $1,reg.
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=g,r")
- (match_operand:SI 1 "general_operand" "rn,im"))]
+ [(set (match_operand:SI 0 "general_operand" "=g,r,r")
+ (match_operand:SI 1 "general_operand" "rn,i,m"))]
"((!TARGET_MOVE || GET_CODE (operands[0]) != MEM)
|| (GET_CODE (operands[1]) != MEM))
&& flag_pic"
"*
{
rtx link;
- if (operands[1] == const0_rtx && REG_P (operands[0]))
+
+ /* K6: mov reg,0 is slightly faster than xor reg,reg but is 3 bytes
+ longer. */
+ if ((ix86_cpu != PROCESSOR_K6 || optimize_size)
+ && operands[1] == const0_rtx && REG_P (operands[0]))
return AS2 (xor%L0,%0,%0);
if (operands[1] == const1_rtx
+ /* PPRO and K6 prefer mov to inc to reduce dependencies. */
+ && (optimize_size || (int)ix86_cpu < (int)PROCESSOR_PENTIUMPRO)
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
&& ! INSN_DELETED_P (XEXP (link, 0))
@@ -909,7 +1036,9 @@
return AS2 (lea%L0,%a1,%0);
return AS2 (mov%L0,%1,%0);
-}")
+}"
+ [(set_attr "type" "integer,integer,memory")
+ (set_attr "memory" "*,*,load")])
(define_insn ""
[(set (match_operand:SI 0 "general_operand" "=g,r")
@@ -920,10 +1049,13 @@
"*
{
rtx link;
- if (operands[1] == const0_rtx && REG_P (operands[0]))
+ if ((ix86_cpu != PROCESSOR_K6 || optimize_size)
+ && operands[1] == const0_rtx && REG_P (operands[0]))
return AS2 (xor%L0,%0,%0);
if (operands[1] == const1_rtx
+ /* PPRO and K6 prefer mov to inc to reduce dependencies. */
+ && (optimize_size || (int)ix86_cpu < (int)PROCESSOR_PENTIUMPRO)
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
&& ! INSN_DELETED_P (XEXP (link, 0))
@@ -936,19 +1068,25 @@
return AS1 (inc%L0,%0);
return AS2 (mov%L0,%1,%0);
-}")
+}"
+ [(set_attr "type" "integer,memory")
+ (set_attr "memory" "*,load")])
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
(match_operand:HI 1 "nonmemory_operand" "ri"))]
""
- "* return AS1 (push%W0,%1);")
+ "* return AS1 (push%W0,%1);"
+ [(set_attr "type" "memory")
+ (set_attr "memory" "store")])
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
(match_operand:HI 1 "memory_operand" "m"))]
"TARGET_PUSH_MEMORY"
- "* return AS1 (push%W0,%1);")
+ "* return AS1 (push%W0,%1);"
+ [(set_attr "type" "memory")
+ (set_attr "memory" "load")])
;; On i486, an incl and movl are both faster than incw and movw.
@@ -979,6 +1117,8 @@
return AS2 (xor%L0,%k0,%k0);
if (REG_P (operands[0]) && operands[1] == const1_rtx
+ /* PPRO and K6 prefer mov to inc to reduce dependencies. */
+ && (optimize_size || (int)ix86_cpu < (int)PROCESSOR_PENTIUMPRO)
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
&& ! INSN_DELETED_P (XEXP (link, 0))
@@ -997,7 +1137,7 @@
operands[1] = i386_sext16_if_const (operands[1]);
return AS2 (mov%L0,%k1,%k0);
}
- if (TARGET_PENTIUMPRO)
+ if (! TARGET_ZERO_EXTEND_WITH_AND)
{
/* movzwl is faster than movw on the Pentium Pro,
* although not as fast as an aligned movl. */
@@ -1010,7 +1150,9 @@
}
return AS2 (mov%W0,%1,%0);
-}")
+}"
+ [(set_attr "type" "integer,memory")
+ (set_attr "memory" "*,load")])
(define_expand "movstricthi"
[(set (strict_low_part (match_operand:HI 0 "general_operand" ""))
@@ -1035,10 +1177,13 @@
"*
{
rtx link;
- if (operands[1] == const0_rtx && REG_P (operands[0]))
+ if ((ix86_cpu != PROCESSOR_K6 || optimize_size)
+ && operands[1] == const0_rtx && REG_P (operands[0]))
return AS2 (xor%W0,%0,%0);
if (operands[1] == const1_rtx
+ /* PPRO and K6 prefer mov to inc to reduce dependencies. */
+ && (optimize_size || (int)ix86_cpu < (int)PROCESSOR_PENTIUMPRO)
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
&& ! INSN_DELETED_P (XEXP (link, 0))
@@ -1051,7 +1196,8 @@
return AS1 (inc%W0,%0);
return AS2 (mov%W0,%1,%0);
-}")
+}"
+ [(set_attr "type" "integer,memory")])
;; emit_push_insn when it calls move_by_pieces
;; requires an insn to "push a byte".
@@ -1101,10 +1247,12 @@
"*
{
rtx link;
- if (operands[1] == const0_rtx && REG_P (operands[0]))
- return AS2 (xor%L0,%k0,%k0);
+
+ /* movb $0,reg8 is 2 bytes, the same as xorl reg8,reg8.
+ It is at least as fast as xor on any processor except a Pentium. */
if (operands[1] == const1_rtx
+ && ix86_cpu == PROCESSOR_PENTIUM
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
&& ! INSN_DELETED_P (XEXP (link, 0))
@@ -1117,7 +1265,7 @@
/* Fastest way to change a 0 to a 1.
If inc%B0 isn't allowed, use inc%L0. */
if (NON_QI_REG_P (operands[0]))
- return AS1 (inc%L0,%0);
+ return AS1 (inc%L0,%k0);
else
return AS1 (inc%B0,%0);
}
@@ -1161,10 +1309,11 @@
"*
{
rtx link;
- if (operands[1] == const0_rtx && REG_P (operands[0]))
- return AS2 (xor%B0,%0,%0);
+
+ /* movb $0,reg8 is 2 bytes, the same as xorl reg8,reg8. */
if (operands[1] == const1_rtx
+ && ix86_cpu == PROCESSOR_PENTIUM
&& ! NON_QI_REG_P (operands[0])
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
@@ -1239,27 +1388,14 @@
}
/* If we are loading a floating point constant that isn't 0 or 1
- into a register, indicate we need the pic register loaded. This could
- be optimized into stores of constants if the target eventually moves
- to memory, but better safe than sorry. */
+ into a register, force the value to memory now, since we'll
+ get better code out the back end. */
else if ((reload_in_progress | reload_completed) == 0
- && GET_CODE (operands[0]) != MEM
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && !standard_80387_constant_p (operands[1]))
+ && GET_CODE (operands[0]) != MEM
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && !standard_80387_constant_p (operands[1]))
{
- rtx insn, note, fp_const;
-
- fp_const = force_const_mem (SFmode, operands[1]);
- if (flag_pic)
- current_function_uses_pic_offset_table = 1;
-
- insn = emit_insn (gen_rtx_SET (SFmode, operands[0], fp_const));
- note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
-
- if (note)
- XEXP (note, 0) = operands[1];
- else
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn));
+ operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
}
}")
@@ -1335,6 +1471,7 @@
return AS1 (fxch,%0);
}")
+
(define_insn "movdf_push"
[(set (match_operand:DF 0 "push_operand" "=<,<")
(match_operand:DF 1 "general_operand" "*rfF,o"))]
@@ -1391,23 +1528,11 @@
optimized into stores of constants if the target eventually moves to
memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0
- && GET_CODE (operands[0]) != MEM
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && !standard_80387_constant_p (operands[1]))
+ && GET_CODE (operands[0]) != MEM
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && !standard_80387_constant_p (operands[1]))
{
- rtx insn, note, fp_const;
-
- fp_const = force_const_mem (DFmode, operands[1]);
- if (flag_pic)
- current_function_uses_pic_offset_table = 1;
-
- insn = emit_insn (gen_rtx_SET (DFmode, operands[0], fp_const));
- note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
-
- if (note)
- XEXP (note, 0) = operands[1];
- else
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn));
+ operands[1] = validize_mem (force_const_mem (DFmode, operands[1]));
}
}")
@@ -1540,23 +1665,11 @@
be optimized into stores of constants if the target eventually moves
to memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0
- && GET_CODE (operands[0]) != MEM
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && !standard_80387_constant_p (operands[1]))
+ && GET_CODE (operands[0]) != MEM
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && !standard_80387_constant_p (operands[1]))
{
- rtx insn, note, fp_const;
-
- fp_const = force_const_mem (XFmode, operands[1]);
- if (flag_pic)
- current_function_uses_pic_offset_table = 1;
-
- insn = emit_insn (gen_rtx_SET (XFmode, operands[0], fp_const));
- note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
-
- if (note)
- XEXP (note, 0) = operands[1];
- else
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn));
+ operands[1] = validize_mem (force_const_mem (XFmode, operands[1]));
}
}")
@@ -1633,36 +1746,42 @@
}")
(define_insn ""
- [(set (match_operand:DI 0 "push_operand" "=<,<,<,<")
- (match_operand:DI 1 "general_operand" "riF,o,o,o"))
- (clobber (match_scratch:SI 2 "=X,&r,&r,X"))
- (clobber (match_scratch:SI 3 "=X,&r,X,X"))]
+ [(set (match_operand:DI 0 "push_operand" "=<")
+ (match_operand:DI 1 "general_operand" "riF"))]
""
- "*
-{
- if (GET_CODE (operands[1]) != MEM)
- return output_move_double (operands);
+ "* return output_move_double (operands);")
- else
- return output_move_pushmem (operands, insn, GET_MODE_SIZE (DImode), 2, 4);
-}")
+(define_insn ""
+ [(set (match_operand:DI 0 "push_operand" "=<")
+ (match_operand:DI 1 "memory_operand" "o"))]
+ "TARGET_PUSH_MEMORY"
+ "* return output_move_pushmem (operands, insn, GET_MODE_SIZE (DImode),0,0);")
-(define_insn "movdi"
- [(set (match_operand:DI 0 "general_operand" "=o,o,r,rm")
- (match_operand:DI 1 "general_operand" "o,o,m,riF"))
- (clobber (match_scratch:SI 2 "=&r,&r,X,X"))
- (clobber (match_scratch:SI 3 "=&r,X,X,X"))]
+(define_expand "movdi"
+ [(set (match_operand:DI 0 "general_operand" "")
+ (match_operand:DI 1 "general_operand" ""))]
""
- "*
+ "
{
- rtx low[2], high[2], xop[6];
-
- if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- return output_move_double (operands);
- else
- return output_move_memory (operands, insn, GET_MODE_SIZE (DImode), 2, 4);
+ /* Don't generate memory->memory moves, go through a register */
+ if (TARGET_MOVE
+ && (reload_in_progress | reload_completed) == 0
+ && GET_CODE (operands[0]) == MEM
+ && GET_CODE (operands[1]) == MEM)
+ {
+ operands[1] = force_reg (DImode, operands[1]);
+ }
}")
+(define_insn ""
+ [(set (match_operand:DI 0 "general_operand" "=g,r")
+ (match_operand:DI 1 "general_operand" "riF,m"))]
+ "(!TARGET_MOVE || GET_CODE (operands[0]) != MEM)
+ || (GET_CODE (operands[1]) != MEM)"
+ "* return output_move_double (operands);"
+ [(set_attr "type" "integer,memory")
+ (set_attr "memory" "*,load")])
+
;;- conversion instructions
;;- NONE
@@ -2662,7 +2781,7 @@
;;- add instructions
-(define_insn "addsidi3_1"
+(define_insn "*addsidi3_1"
[(set (match_operand:DI 0 "nonimmediate_operand" "=&r,r,o,!&r,!r,o,!o")
(plus:DI (match_operand:DI 1 "general_operand" "0,0,0,o,riF,riF,o")
(zero_extend:DI (match_operand:SI 2 "general_operand" "o,ri,ri,roi,roi,ri,ri"))))
@@ -2670,7 +2789,7 @@
""
"*
{
- rtx low[3], high[3], xops[7], temp;
+ rtx low[3], high[3], xops[7];
CC_STATUS_INIT;
@@ -2707,8 +2826,11 @@
output_asm_insn (AS2 (add%L0,%2,%0), low);
output_asm_insn (AS2 (adc%L0,%2,%0), high);
+ cc_status.value1 = high[0];
+ cc_status.flags = CC_NO_OVERFLOW;
RET;
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "addsidi3_2"
[(set (match_operand:DI 0 "nonimmediate_operand" "=&r,r,o,&r,!&r,&r,o,o,!o")
@@ -2718,7 +2840,7 @@
""
"*
{
- rtx low[3], high[3], xops[7], temp;
+ rtx low[3], high[3], xops[7];
CC_STATUS_INIT;
@@ -2785,8 +2907,11 @@
output_asm_insn (AS2 (add%L0,%2,%0), low);
output_asm_insn (AS2 (adc%L0,%2,%0), high);
+ cc_status.value1 = high[0];
+ cc_status.flags = CC_NO_OVERFLOW;
RET;
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "adddi3"
[(set (match_operand:DI 0 "general_operand" "=&r,&ro,!r,o,!&r,!o,!o")
@@ -2835,6 +2960,9 @@
}
}
+ cc_status.value1 = high[0];
+ cc_status.flags = CC_NO_OVERFLOW;
+
if (GET_CODE (operands[3]) == REG && GET_CODE (operands[2]) != REG)
{
xops[0] = high[0];
@@ -2859,7 +2987,8 @@
output_asm_insn (AS2 (add%L0,%2,%0), high);
RET;
-}")
+}"
+ [(set_attr "type" "binary")])
;; On a 486, it is faster to do movl/addl than to do a single leal if
;; operands[1] and operands[2] are both registers.
@@ -2924,7 +3053,8 @@
}
return AS2 (add%L0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
;; addsi3 is faster, so put this after.
@@ -2953,7 +3083,8 @@
CC_STATUS_INIT;
return AS2 (lea%L0,%a1,%0);
-}")
+}"
+ [(set_attr "type" "lea")])
;; ??? `lea' here, for three operand add? If leaw is used, only %bx,
;; %si and %di can appear in SET_SRC, and output_asm_insn might not be
@@ -3023,7 +3154,8 @@
return AS1 (dec%W0,%0);
return AS2 (add%W0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_expand "addqi3"
[(set (match_operand:QI 0 "general_operand" "")
@@ -3048,7 +3180,8 @@
return AS1 (dec%B0,%0);
return AS2 (add%B0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
;Lennart Augustsson <augustss@cs.chalmers.se>
;says this pattern just makes slower code:
@@ -3145,8 +3278,12 @@
output_asm_insn (AS2 (sub%L0,%2,%0), low);
output_asm_insn (AS2 (sbb%L0,%2,%0), high);
+ cc_status.value1 = high[0];
+ cc_status.flags = CC_NO_OVERFLOW;
+
RET;
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "subdi3"
[(set (match_operand:DI 0 "general_operand" "=&r,&ro,o,o,!&r,!o")
@@ -3189,6 +3326,9 @@
}
}
+ cc_status.value1 = high[0];
+ cc_status.flags = CC_NO_OVERFLOW;
+
if (GET_CODE (operands[3]) == REG)
{
xops[0] = high[0];
@@ -3210,10 +3350,12 @@
}
else
- output_asm_insn (AS2 (sub%L0,%2,%0), high);
+ output_asm_insn (AS2 (sub%L0,%2,%0), high);
+
RET;
-}")
+}"
+ [(set_attr "type" "binary")])
(define_expand "subsi3"
[(set (match_operand:SI 0 "nonimmediate_operand" "")
@@ -3227,7 +3369,8 @@
(minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
(match_operand:SI 2 "general_operand" "ri,rm")))]
"ix86_binary_operator_ok (MINUS, SImode, operands)"
- "* return AS2 (sub%L0,%2,%0);")
+ "* return AS2 (sub%L0,%2,%0);"
+ [(set_attr "type" "binary")])
(define_expand "subhi3"
[(set (match_operand:HI 0 "general_operand" "")
@@ -3252,7 +3395,8 @@
return AS2 (sub%L0,%k2,%k0);
}
return AS2 (sub%W0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_expand "subqi3"
[(set (match_operand:QI 0 "general_operand" "")
@@ -3266,7 +3410,8 @@
(minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")
(match_operand:QI 2 "general_operand" "qn,qmn")))]
"ix86_binary_operator_ok (MINUS, QImode, operands)"
- "* return AS2 (sub%B0,%2,%0);")
+ "* return AS2 (sub%B0,%2,%0);"
+ [(set_attr "type" "binary")])
;; The patterns that match these are at the end of this file.
@@ -3692,7 +3837,8 @@ word_zero_and_operation:
}
return AS2 (and%L0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "andhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
@@ -3770,14 +3916,16 @@ word_zero_and_operation:
}
return AS2 (and%W0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "andqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
(and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
(match_operand:QI 2 "general_operand" "qn,qmn")))]
""
- "* return AS2 (and%B0,%2,%0);")
+ "* return AS2 (and%B0,%2,%0);"
+ [(set_attr "type" "binary")])
/* I am nervous about these two.. add them later..
;I presume this means that we have something in say op0= eax which is small
@@ -3893,7 +4041,8 @@ byte_or_operation:
}
return AS2 (or%L0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "iorhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
@@ -3977,14 +4126,16 @@ byte_or_operation:
}
return AS2 (or%W0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "iorqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
(ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
(match_operand:QI 2 "general_operand" "qn,qmn")))]
""
- "* return AS2 (or%B0,%2,%0);")
+ "* return AS2 (or%B0,%2,%0);"
+ [(set_attr "type" "binary")])
;;- xor instructions
@@ -4072,7 +4223,8 @@ byte_xor_operation:
}
return AS2 (xor%L0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "xorhi3"
[(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
@@ -4133,115 +4285,55 @@ byte_xor_operation:
}
return AS2 (xor%W0,%2,%0);
-}")
+}"
+ [(set_attr "type" "binary")])
(define_insn "xorqi3"
[(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
(xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
(match_operand:QI 2 "general_operand" "qn,qm")))]
""
- "* return AS2 (xor%B0,%2,%0);")
+ "* return AS2 (xor%B0,%2,%0);"
+ [(set_attr "type" "binary")])
;; logical operations for DImode
-
(define_insn "anddi3"
- [(set (match_operand:DI 0 "general_operand" "=&r,&ro,!r,o,!&r,!o,!o")
- (and:DI (match_operand:DI 1 "general_operand" "%0,0,0,0iF,or,riF,o")
- (match_operand:DI 2 "general_operand" "o,riF,0,or,or,oriF,o")))
- (clobber (match_scratch:SI 3 "=X,X,X,&r,X,&r,&r"))]
+ [(set (match_operand:DI 0 "general_operand" "=&r,&ro")
+ (and:DI (match_operand:DI 1 "general_operand" "0,0")
+ (match_operand:DI 2 "general_operand" "oriF,riF")))]
""
- "#")
+ "#"
+ [(set_attr "type" "binary")])
+
(define_insn "iordi3"
- [(set (match_operand:DI 0 "general_operand" "=&r,&ro,!r,o,!&r,!o,!o")
- (ior:DI (match_operand:DI 1 "general_operand" "%0,0,0,0iF,or,riF,o")
- (match_operand:DI 2 "general_operand" "o,riF,0,or,or,oriF,o")))
- (clobber (match_scratch:SI 3 "=X,X,X,&r,X,&r,&r"))]
+ [(set (match_operand:DI 0 "general_operand" "=&r,&ro")
+ (ior:DI (match_operand:DI 1 "general_operand" "0,0")
+ (match_operand:DI 2 "general_operand" "oriF,riF")))]
""
- "#")
-
+ "#"
+ [(set_attr "type" "binary")])
+
(define_insn "xordi3"
- [(set (match_operand:DI 0 "general_operand" "=&r,&ro,!r,o,!&r,!o,!o")
- (xor:DI (match_operand:DI 1 "general_operand" "%0,0,0,0iF,or,riF,o")
- (match_operand:DI 2 "general_operand" "o,riF,0,or,or,oriF,o")))
- (clobber (match_scratch:SI 3 "=X,X,X,&r,X,&r,&r"))]
+ [(set (match_operand:DI 0 "general_operand" "=&r,&ro")
+ (xor:DI (match_operand:DI 1 "general_operand" "0,0")
+ (match_operand:DI 2 "general_operand" "oriF,riF")))]
""
- "#")
+ "#"
+ [(set_attr "type" "binary")])
(define_split
- [(set (match_operand:DI 0 "general_operand" "=&r,&ro,!r,o,!&r,!o,!o")
- (match_operator:DI 4 "ix86_logical_operator"
- [(match_operand:DI 1 "general_operand" "%0,0,0,0iF,or,riF,o")
- (match_operand:DI 2 "general_operand" "o,riF,0,or,or,oriF,o")]))
- (clobber (match_scratch:SI 3 "=X,X,X,&r,X,&r,&r"))]
- "reload_completed"
- [(const_int 0)]
- "
-{
- rtx low[3], high[3], xops[7], temp;
- rtx (*genfunc)() = (GET_CODE (operands[4]) == AND ? gen_andsi3
- : GET_CODE (operands[4]) == IOR ? gen_iorsi3
- : GET_CODE (operands[4]) == XOR ? gen_xorsi3
- : 0);
-
- if (rtx_equal_p (operands[0], operands[2]))
- {
- temp = operands[1];
- operands[1] = operands[2];
- operands[2] = temp;
- }
-
- split_di (operands, 3, low, high);
- if (!rtx_equal_p (operands[0], operands[1]))
- {
- xops[0] = high[0];
- xops[1] = low[0];
- xops[2] = high[1];
- xops[3] = low[1];
-
- if (GET_CODE (operands[0]) != MEM)
- {
- emit_insn (gen_movsi (xops[1], xops[3]));
- emit_insn (gen_movsi (xops[0], xops[2]));
- }
- else
- {
- xops[4] = high[2];
- xops[5] = low[2];
- xops[6] = operands[3];
- emit_insn (gen_movsi (xops[6], xops[3]));
- emit_insn ((*genfunc) (xops[6], xops[6], xops[5]));
- emit_insn (gen_movsi (xops[1], xops[6]));
- emit_insn (gen_movsi (xops[6], xops[2]));
- emit_insn ((*genfunc) (xops[6], xops[6], xops[4]));
- emit_insn (gen_movsi (xops[0], xops[6]));
- DONE;
- }
- }
-
- if (GET_CODE (operands[3]) == REG && GET_CODE (operands[2]) != REG)
- {
- xops[0] = high[0];
- xops[1] = low[0];
- xops[2] = high[2];
- xops[3] = low[2];
- xops[4] = operands[3];
-
- emit_insn (gen_movsi (xops[4], xops[3]));
- emit_insn ((*genfunc) (xops[1], xops[1], xops[4]));
- emit_insn (gen_movsi (xops[4], xops[2]));
- emit_insn ((*genfunc) (xops[0], xops[0], xops[4]));
- }
-
- else
- {
- emit_insn ((*genfunc) (low[0], low[0], low[2]));
- emit_insn ((*genfunc) (high[0], high[0], high[2]));
- }
-
- DONE;
-}")
+ [(set (match_operand:DI 0 "general_operand" "")
+ (match_operator:DI 3 "ix86_logical_operator"
+ [(match_operand:DI 1 "general_operand" "")
+ (match_operand:DI 2 "general_operand" "")]))]
+ ""
+ [(set (match_dup 4) (match_op_dup:SI 3 [(match_dup 6) (match_dup 8)]))
+ (set (match_dup 5) (match_op_dup:SI 3 [(match_dup 7) (match_dup 9)]))]
+ "split_di (&operands[0], 1, &operands[4], &operands[5]);
+ split_di (&operands[1], 1, &operands[6], &operands[7]);
+ split_di (&operands[2], 1, &operands[8], &operands[9]);")
;;- negation instructions
@@ -4549,7 +4641,7 @@ byte_xor_operation:
"*
{
rtx xops[4], low[1], high[1];
- static HOST_WIDE_INT ashldi_label_number;
+ static int ashldi_label_number;
CC_STATUS_INIT;
@@ -4737,7 +4829,7 @@ byte_xor_operation:
"*
{
rtx xops[4], low[1], high[1];
- static HOST_WIDE_INT ashrdi_label_number;
+ static int ashrdi_label_number;
CC_STATUS_INIT;
@@ -4892,7 +4984,7 @@ byte_xor_operation:
"*
{
rtx xops[4], low[1], high[1];
- static HOST_WIDE_INT lshrdi_label_number;
+ static int lshrdi_label_number;
CC_STATUS_INIT;
@@ -5265,10 +5357,6 @@ byte_xor_operation:
;; For all sCOND expanders, also expand the compare or test insn that
;; generates cc0. Generate an equality comparison if `seq' or `sne'.
-;; The 386 sCOND opcodes can write to memory. But a gcc sCOND insn may
-;; not have any input reloads. A MEM write might need an input reload
-;; for the address of the MEM. So don't allow MEM as the SET_DEST.
-
(define_expand "seq"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5283,18 +5371,6 @@ byte_xor_operation:
operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);
}")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (eq:QI (cc0) (const_int 0)))]
- ""
- "*
-{
- if (cc_prev_status.flags & CC_Z_IN_NOT_C)
- return AS1 (setnb,%0);
- else
- return AS1 (sete,%0);
-}")
-
(define_expand "sne"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5309,19 +5385,6 @@ byte_xor_operation:
operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);
}")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (ne:QI (cc0) (const_int 0)))]
- ""
- "*
-{
- if (cc_prev_status.flags & CC_Z_IN_NOT_C)
- return AS1 (setb,%0);
- else
- return AS1 (setne,%0);
-}
-")
-
(define_expand "sgt"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5329,19 +5392,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (gt:QI (cc0) (const_int 0)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (sete,%0);
-
- OUTPUT_JUMP (\"setg %0\", \"seta %0\", NULL_PTR);
-}")
-
(define_expand "sgtu"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5349,12 +5399,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (gtu:QI (cc0) (const_int 0)))]
- ""
- "* return \"seta %0\"; ")
-
(define_expand "slt"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5362,19 +5406,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (lt:QI (cc0) (const_int 0)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (sete,%0);
-
- OUTPUT_JUMP (\"setl %0\", \"setb %0\", \"sets %0\");
-}")
-
(define_expand "sltu"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5382,12 +5413,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (ltu:QI (cc0) (const_int 0)))]
- ""
- "* return \"setb %0\"; ")
-
(define_expand "sge"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5395,19 +5420,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (ge:QI (cc0) (const_int 0)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (sete,%0);
-
- OUTPUT_JUMP (\"setge %0\", \"setae %0\", \"setns %0\");
-}")
-
(define_expand "sgeu"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5415,12 +5427,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (geu:QI (cc0) (const_int 0)))]
- ""
- "* return \"setae %0\"; ")
-
(define_expand "sle"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5428,19 +5434,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (le:QI (cc0) (const_int 0)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (setb,%0);
-
- OUTPUT_JUMP (\"setle %0\", \"setbe %0\", NULL_PTR);
-}")
-
(define_expand "sleu"
[(match_dup 1)
(set (match_operand:QI 0 "register_operand" "")
@@ -5448,11 +5441,61 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=q")
- (leu:QI (cc0) (const_int 0)))]
- ""
- "* return \"setbe %0\"; ")
+;; The 386 sCOND opcodes can write to memory. But a gcc sCOND insn may
+;; not have any input reloads. A MEM write might need an input reload
+;; for the address of the MEM. So don't allow MEM as the SET_DEST.
+
+(define_insn "*setcc"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
+ (match_operator:QI 1 "comparison_operator" [(cc0) (const_int 0)]))]
+ "reload_completed || register_operand (operands[0], QImode)"
+ "*
+{
+ enum rtx_code code = GET_CODE (operands[1]);
+ if (cc_prev_status.flags & CC_TEST_AX)
+ {
+ int eq;
+ HOST_WIDE_INT c;
+ operands[2] = gen_rtx_REG (SImode, 0);
+ switch (code)
+ {
+ case EQ:
+ c = 0x4000;
+ eq = 0;
+ break;
+ case NE:
+ c = 0x4000;
+ eq = 1;
+ break;
+ case GT:
+ c = 0x4100;
+ eq = 1;
+ break;
+ case LT:
+ c = 0x100;
+ eq = 0;
+ break;
+ case GE:
+ c = 0x100;
+ eq = 1;
+ break;
+ case LE:
+ c = 0x4100;
+ eq = 0;
+ break;
+ default:
+ abort ();
+ }
+ operands[3] = GEN_INT (c);
+ output_asm_insn (AS2 (testl,%3,%2), operands);
+ return eq ? AS1 (sete,%0) : AS1 (setne, %0);
+ }
+
+ if ((cc_status.flags & CC_NO_OVERFLOW) && (code == LE || code == GT))
+ return (char *)0;
+ return AS1(set%D1,%0);
+}")
+
;; Basic conditional jump instructions.
;; We ignore the overflow flag for signed branch instructions.
@@ -5477,29 +5520,6 @@ byte_xor_operation:
operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);
}")
-(define_insn ""
- [(set (pc)
- (if_then_else (eq (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "*
-{
- if (cc_prev_status.flags & CC_Z_IN_NOT_C)
- return \"jnc %l0\";
- else
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4000);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (jne,%l0);
- }
-
- return \"je %l0\";
-}")
-
(define_expand "bne"
[(match_dup 1)
(set (pc)
@@ -5517,28 +5537,6 @@ byte_xor_operation:
operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);
}")
-(define_insn ""
- [(set (pc)
- (if_then_else (ne (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "*
-{
- if (cc_prev_status.flags & CC_Z_IN_NOT_C)
- return \"jc %l0\";
- else
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4000);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (je,%l0);
- }
-
- return \"jne %l0\";
-}")
(define_expand "bgt"
[(match_dup 1)
@@ -5550,29 +5548,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (gt (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (je,%l0);
-
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (je,%l0);
- }
- OUTPUT_JUMP (\"jg %l0\", \"ja %l0\", NULL_PTR);
-}")
-
(define_expand "bgtu"
[(match_dup 1)
(set (pc)
@@ -5583,15 +5558,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (gtu (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "ja %l0")
-
(define_expand "blt"
[(match_dup 1)
(set (pc)
@@ -5602,28 +5568,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (lt (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (je,%l0);
-
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (jne,%l0);
- }
- OUTPUT_JUMP (\"jl %l0\", \"jb %l0\", \"js %l0\");
-}")
(define_expand "bltu"
[(match_dup 1)
@@ -5635,15 +5579,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (ltu (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "jb %l0")
-
(define_expand "bge"
[(match_dup 1)
(set (pc)
@@ -5654,28 +5589,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (ge (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (je,%l0);
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (je,%l0);
- }
- OUTPUT_JUMP (\"jge %l0\", \"jae %l0\", \"jns %l0\");
-}")
-
(define_expand "bgeu"
[(match_dup 1)
(set (pc)
@@ -5686,15 +5599,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (geu (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "jae %l0")
-
(define_expand "ble"
[(match_dup 1)
(set (pc)
@@ -5705,29 +5609,6 @@ byte_xor_operation:
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
-(define_insn ""
- [(set (pc)
- (if_then_else (le (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
- (pc)))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (jb,%l0);
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (jne,%l0);
- }
-
- OUTPUT_JUMP (\"jle %l0\", \"jbe %l0\", NULL_PTR);
-}")
-
(define_expand "bleu"
[(match_dup 1)
(set (pc)
@@ -5740,184 +5621,111 @@ byte_xor_operation:
(define_insn ""
[(set (pc)
- (if_then_else (leu (cc0)
- (const_int 0))
- (label_ref (match_operand 0 "" ""))
+ (if_then_else (match_operator 0 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 1 "" ""))
(pc)))]
""
- "jbe %l0")
-
-;; Negated conditional jump instructions.
-
-(define_insn ""
- [(set (pc)
- (if_then_else (eq (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "*
-{
- if (cc_prev_status.flags & CC_Z_IN_NOT_C)
- return \"jc %l0\";
- else
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4000);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (je,%l0);
- }
- return \"jne %l0\";
-}")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (ne (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "*
-{
- if (cc_prev_status.flags & CC_Z_IN_NOT_C)
- return \"jnc %l0\";
- else
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4000);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (jne,%l0);
- }
- return \"je %l0\";
-}")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (gt (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (jne,%l0);
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (jne,%l0);
- }
- OUTPUT_JUMP (\"jle %l0\", \"jbe %l0\", NULL_PTR);
-}")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (gtu (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "jbe %l0")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (lt (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
"*
{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (jne,%l0);
+ enum rtx_code code = GET_CODE (operands[0]);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (je,%l0);
+ int eq;
+ HOST_WIDE_INT c;
+ operands[2] = gen_rtx_REG (SImode, 0);
+ switch (code)
+ {
+ case EQ:
+ c = 0x4000;
+ eq = 0;
+ break;
+ case NE:
+ c = 0x4000;
+ eq = 1;
+ break;
+ case GT:
+ c = 0x4100;
+ eq = 1;
+ break;
+ case LT:
+ c = 0x100;
+ eq = 0;
+ break;
+ case GE:
+ c = 0x100;
+ eq = 1;
+ break;
+ case LE:
+ c = 0x4100;
+ eq = 0;
+ break;
+ default:
+ abort ();
+ }
+ operands[3] = GEN_INT (c);
+ output_asm_insn (AS2 (testl,%3,%2), operands);
+ return eq ? AS1 (je,%l1) : AS1 (jne, %l1);
}
+ if ((cc_status.flags & CC_NO_OVERFLOW) && (code == LE || code == GT))
+ return (char *)0;
- OUTPUT_JUMP (\"jge %l0\", \"jae %l0\", \"jns %l0\");
+ return AS1(j%D0,%l1);
}")
(define_insn ""
[(set (pc)
- (if_then_else (ltu (cc0)
- (const_int 0))
+ (if_then_else (match_operator 0 "comparison_operator"
+ [(cc0) (const_int 0)])
(pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "jae %l0")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (ge (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
+ (label_ref (match_operand 1 "" ""))))]
""
"*
{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (jne,%l0);
+ enum rtx_code code = GET_CODE (operands[0]);
if (cc_prev_status.flags & CC_TEST_AX)
{
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (jne,%l0);
+ int eq;
+ HOST_WIDE_INT c;
+ operands[2] = gen_rtx_REG (SImode, 0);
+ switch (code)
+ {
+ case EQ:
+ c = 0x4000;
+ eq = 1;
+ break;
+ case NE:
+ c = 0x4000;
+ eq = 0;
+ break;
+ case GT:
+ c = 0x4100;
+ eq = 0;
+ break;
+ case LT:
+ c = 0x100;
+ eq = 1;
+ break;
+ case GE:
+ c = 0x100;
+ eq = 0;
+ break;
+ case LE:
+ c = 0x4100;
+ eq = 1;
+ break;
+ default:
+ abort ();
+ }
+ operands[3] = GEN_INT (c);
+ output_asm_insn (AS2 (testl,%3,%2), operands);
+ return eq ? AS1 (je,%l1) : AS1 (jne, %l1);
}
- OUTPUT_JUMP (\"jl %l0\", \"jb %l0\", \"js %l0\");
-}")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (geu (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "jb %l0")
+ if ((cc_status.flags & CC_NO_OVERFLOW) && (code == LE || code == GT))
+ return (char *)0;
-(define_insn ""
- [(set (pc)
- (if_then_else (le (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "*
-{
- if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387)
- && ! (cc_prev_status.flags & CC_FCOMI))
- return AS1 (jae,%l0);
-
- if (cc_prev_status.flags & CC_TEST_AX)
- {
- operands[1] = gen_rtx_REG (SImode, 0);
- operands[2] = GEN_INT (0x4100);
- output_asm_insn (AS2 (testl,%2,%1), operands);
- return AS1 (je,%l0);
- }
- OUTPUT_JUMP (\"jg %l0\", \"ja %l0\", NULL_PTR);
+ return AS1(j%d0,%l1);
}")
-
-(define_insn ""
- [(set (pc)
- (if_then_else (leu (cc0)
- (const_int 0))
- (pc)
- (label_ref (match_operand 0 "" ""))))]
- ""
- "ja %l0")
;; Unconditional and other jump instructions
@@ -5956,7 +5764,7 @@ byte_xor_operation:
(define_insn ""
[(set (pc)
(if_then_else (match_operator 0 "arithmetic_comparison_operator"
- [(plus:SI (match_operand:SI 1 "nonimmediate_operand" "+r,m")
+ [(plus:SI (match_operand:SI 1 "nonimmediate_operand" "+c*r,m")
(match_operand:SI 2 "general_operand" "rmi,ri"))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
@@ -5968,6 +5776,11 @@ byte_xor_operation:
"*
{
CC_STATUS_INIT;
+
+ if (GET_CODE (operands[1]) == REG && REGNO (operands[2]) == 2 &&
+ operands[2] == constm1_rtx && ix86_cpu == PROCESSOR_K6)
+ return \"loop %l3\";
+
if (operands[2] == constm1_rtx)
output_asm_insn (AS1 (dec%L1,%1), operands);
@@ -6702,7 +6515,7 @@ byte_xor_operation:
""
"
{
- rtx addr0, addr1;
+ rtx addr0;
if (GET_CODE (operands[1]) != CONST_INT)
FAIL;
@@ -6719,7 +6532,7 @@ byte_xor_operation:
;; But strength reduction might offset the MEM expression. So we let
;; reload put the address into %edi.
-(define_insn ""
+(define_insn "*bzero"
[(set (mem:BLK (match_operand:SI 0 "address_operand" "D"))
(const_int 0))
(use (match_operand:SI 1 "const_int_operand" "n"))
@@ -6735,17 +6548,35 @@ byte_xor_operation:
output_asm_insn (\"cld\", operands);
if (GET_CODE (operands[1]) == CONST_INT)
{
- if (INTVAL (operands[1]) & ~0x03)
+ unsigned int count = INTVAL (operands[1]) & 0xffffffff;
+ if (count & ~0x03)
{
- xops[0] = GEN_INT ((INTVAL (operands[1]) >> 2) & 0x3fffffff);
+ xops[0] = GEN_INT (count / 4);
xops[1] = operands[4];
- output_asm_insn (AS2 (mov%L1,%0,%1), xops);
+ /* K6: stos takes 1 cycle, rep stos takes 8 + %ecx cycles.
+ 80386: 4/5+5n (+2 for set of ecx)
+ 80486: 5/7+5n (+1 for set of ecx)
+ */
+ if (count / 4 < ((int) ix86_cpu < (int)PROCESSOR_PENTIUM ? 4 : 6))
+ {
+ do
#ifdef INTEL_SYNTAX
- output_asm_insn (\"rep stosd\", xops);
+ output_asm_insn (\"stosd\", xops);
#else
- output_asm_insn (\"rep\;stosl\", xops);
+ output_asm_insn (\"stosl\", xops);
#endif
+ while ((count -= 4) > 3);
+ }
+ else
+ {
+ output_asm_insn (AS2 (mov%L1,%0,%1), xops);
+#ifdef INTEL_SYNTAX
+ output_asm_insn (\"rep stosd\", xops);
+#else
+ output_asm_insn (\"rep\;stosl\", xops);
+#endif
+ }
}
if (INTVAL (operands[1]) & 0x02)
output_asm_insn (\"stosw\", operands);
@@ -7226,253 +7057,533 @@ byte_xor_operation:
/* Conditional move define_insns. */
(define_expand "movsicc"
- [(match_dup 4)
- (parallel [(set (match_operand 0 "register_operand" "")
+ [(set (match_operand:SI 0 "register_operand" "")
(if_then_else:SI (match_operand 1 "comparison_operator" "")
- (match_operand:SI 2 "general_operand" "")
- (match_operand:SI 3 "general_operand" "")))
- (clobber (match_scratch:SI 4 "=&r"))])]
+ (match_operand:SI 2 "nonimmediate_operand" "")
+ (match_operand:SI 3 "nonimmediate_operand" "")))]
"TARGET_CMOVE"
"
{
- operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
+ if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
+ FAIL;
+
+ operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+ GET_MODE (i386_compare_op0),
+ i386_compare_op0, i386_compare_op1);
}")
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (if_then_else:SI (match_operator 1 "comparison_operator"
+ [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
+ (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
+ (match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
+ (match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
+ "TARGET_CMOVE"
+ "#")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (if_then_else:SI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
+ (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
+ (match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
+ (match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
+ "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
+ "#")
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (if_then_else:SI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (const_int 0)])
+ (match_operand:SI 3 "nonimmediate_operand" "rm,0,rm")
+ (match_operand:SI 4 "nonimmediate_operand" "0,rm,rm")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (if_then_else:SI (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 3) (match_dup 4)))]
+ "")
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (if_then_else:SI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (match_operand 3 "general_operand" "")])
+ (match_operand:SI 4 "nonimmediate_operand" "rm,0,rm")
+ (match_operand:SI 5 "nonimmediate_operand" "0,rm,rm")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0) (compare (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (if_then_else:SI (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 4) (match_dup 5)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (if_then_else:SI (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (match_operand:SI 2 "nonimmediate_operand" "rm,0,rm")
+ (match_operand:SI 3 "nonimmediate_operand" "0,rm,rm")))]
+ "TARGET_CMOVE && reload_completed"
+ "* return output_int_conditional_move (which_alternative, operands);")
+
(define_expand "movhicc"
- [(match_dup 4)
- (parallel [(set (match_operand 0 "register_operand" "")
+ [(set (match_operand:HI 0 "register_operand" "")
(if_then_else:HI (match_operand 1 "comparison_operator" "")
- (match_operand:HI 2 "general_operand" "")
- (match_operand:HI 3 "general_operand" "")))
- (clobber (match_scratch:SI 4 "=&r"))])]
+ (match_operand:HI 2 "nonimmediate_operand" "")
+ (match_operand:HI 3 "nonimmediate_operand" "")))]
"TARGET_CMOVE"
"
{
- operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
+ if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
+ FAIL;
+
+ operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+ GET_MODE (i386_compare_op0),
+ i386_compare_op0, i386_compare_op1);
}")
-(define_insn "movsicc_1"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,&r,rm")
- (if_then_else:SI (match_operator 1 "comparison_operator"
- [(cc0) (const_int 0)])
- (match_operand:SI 2 "general_operand" "rm,0,rm,g")
- (match_operand:SI 3 "general_operand" "0,rm,rm,g")))
- (clobber (match_scratch:SI 4 "X,X,X,=&r"))]
+(define_insn ""
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
+ (if_then_else:HI (match_operator 1 "comparison_operator"
+ [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
+ (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
+ (match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
+ (match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
"TARGET_CMOVE"
- "*
-{
- if (which_alternative == 0)
- {
- /* r <- cond ? arg : r */
- output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
- }
- else if (which_alternative == 1)
- {
- /* r <- cond ? r : arg */
- output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
- }
- else if (which_alternative == 2)
- {
- /* r <- cond ? arg1 : arg2 */
- output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
- output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
- }
- else if (which_alternative == 3)
- {
- /* r <- cond ? arg1 : arg2 */
- rtx xops[3];
-
- xops[0] = gen_label_rtx ();
- xops[1] = gen_label_rtx ();
- xops[2] = operands[1];
-
- output_asm_insn (\"j%c2 %l0\", xops);
- if (! rtx_equal_p (operands[0], operands[2]))
- if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[2]) == MEM)
- {
- output_asm_insn (AS2 (mov%z2,%2,%4), operands);
- output_asm_insn (AS2 (mov%z2,%4,%0), operands);
- }
- else
- output_asm_insn (AS2 (mov%z0,%2,%0), operands);
- output_asm_insn (\"jmp %l1\", xops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
- if (! rtx_equal_p (operands[0], operands[3]))
- {
- if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[3]) == MEM)
- {
- output_asm_insn (AS2 (mov%z3,%3,%4), operands);
- output_asm_insn (AS2 (mov%z3,%4,%0), operands);
- }
- else
- output_asm_insn (AS2 (mov%z0,%3,%0), operands);
- }
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
- }
- RET;
-}")
+ "#")
+
+(define_insn ""
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
+ (if_then_else:HI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
+ (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
+ (match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
+ (match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
+ "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
+ "#")
+
+(define_split
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r")
+ (if_then_else:HI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (const_int 0)])
+ (match_operand:HI 3 "nonimmediate_operand" "rm,0,rm")
+ (match_operand:HI 4 "nonimmediate_operand" "0,rm,rm")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (if_then_else:HI (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 3) (match_dup 4)))]
+ "")
+
+(define_split
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r")
+ (if_then_else:HI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (match_operand 3 "general_operand" "")])
+ (match_operand:HI 4 "nonimmediate_operand" "rm,0,rm")
+ (match_operand:HI 5 "nonimmediate_operand" "0,rm,rm")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (compare (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (if_then_else:HI (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 4) (match_dup 5)))]
+ "")
-(define_insn "movhicc_1"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,&r,rm")
+(define_insn ""
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r")
(if_then_else:HI (match_operator 1 "comparison_operator"
[(cc0) (const_int 0)])
- (match_operand:HI 2 "general_operand" "rm,0,rm,g")
- (match_operand:HI 3 "general_operand" "0,rm,rm,g")))
- (clobber (match_scratch:SI 4 "X,X,X,=&r"))]
- "TARGET_CMOVE"
- "*
-{
- if (which_alternative == 0)
- {
- /* r <- cond ? arg : r */
- output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
- }
- else if (which_alternative == 1)
- {
- /* r <- cond ? r : arg */
- output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
- }
- else if (which_alternative == 2)
- {
- /* r <- cond ? arg1 : arg2 */
- output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
- output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
- }
- else if (which_alternative == 3)
- {
- /* r <- cond ? arg1 : arg2 */
- rtx xops[3];
-
- xops[0] = gen_label_rtx ();
- xops[1] = gen_label_rtx ();
- xops[2] = operands[1];
-
- output_asm_insn (\"j%c2 %l0\", xops);
- if (! rtx_equal_p (operands[0], operands[2]))
- if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[2]) == MEM)
- {
- output_asm_insn (AS2 (mov%z2,%2,%4), operands);
- output_asm_insn (AS2 (mov%z2,%4,%0), operands);
- }
- else
- output_asm_insn (AS2 (mov%z0,%2,%0), operands);
- output_asm_insn (\"jmp %l1\", xops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
- if (! rtx_equal_p (operands[0], operands[3]))
- {
- if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[3]) == MEM)
- {
- output_asm_insn (AS2 (mov%z3,%3,%4), operands);
- output_asm_insn (AS2 (mov%z3,%4,%0), operands);
- }
- else
- output_asm_insn (AS2 (mov%z0,%3,%0), operands);
- }
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
- }
- RET;
-}")
-;; We need to disable the FP forms of these since they do not support
-;; memory as written, but no input reloads are permitted for insns
-;; that use cc0. Also, movxfcc is not present.
+ (match_operand:HI 2 "nonimmediate_operand" "rm,0,rm")
+ (match_operand:HI 3 "nonimmediate_operand" "0,rm,rm")))]
+ "TARGET_CMOVE && reload_completed"
+ "* return output_int_conditional_move (which_alternative, operands);")
(define_expand "movsfcc"
- [(match_dup 4)
- (set (match_operand 0 "register_operand" "")
+ [(set (match_operand:SF 0 "register_operand" "")
(if_then_else:SF (match_operand 1 "comparison_operator" "")
(match_operand:SF 2 "register_operand" "")
(match_operand:SF 3 "register_operand" "")))]
- "0 && TARGET_CMOVE"
+ "TARGET_CMOVE"
"
{
- operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
+ rtx temp;
+
+ if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
+ FAIL;
+
+ /* The floating point conditional move instructions don't directly
+ support conditions resulting from a signed integer comparison. */
+
+ switch (GET_CODE (operands[1]))
+ {
+ case LT:
+ case LE:
+ case GE:
+ case GT:
+ temp = emit_store_flag (gen_reg_rtx (QImode),
+ GET_CODE (operands[1]), i386_compare_op0, i386_compare_op1,
+ VOIDmode, 0, 0);
+
+ if (!temp)
+ FAIL;
+
+ operands[1] = gen_rtx_fmt_ee (NE, QImode, temp, const0_rtx);
+ break;
+
+ default:
+ operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+ GET_MODE (i386_compare_op0),
+ i386_compare_op0, i386_compare_op1);
+ break;
+ }
}")
+(define_insn ""
+ [(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
+ (if_then_else:SF (match_operator 1 "comparison_operator"
+ [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
+ (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
+ (match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
+ (match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
+ "TARGET_CMOVE
+ && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+ && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
+ "#")
+
+(define_insn ""
+ [(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
+ (if_then_else:SF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
+ (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
+ (match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
+ (match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
+ "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT
+ && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+ && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
+ "#")
+
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "=f,f,f")
+ (if_then_else:SF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (const_int 0)])
+ (match_operand:SF 3 "register_operand" "f,0,f")
+ (match_operand:SF 4 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (if_then_else:SF (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 3) (match_dup 4)))]
+ "")
+
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "=f,f,f")
+ (if_then_else:SF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (match_operand 3 "general_operand" "")])
+ (match_operand:SF 4 "register_operand" "f,0,f")
+ (match_operand:SF 5 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0) (compare (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (if_then_else:SF (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 4) (match_dup 5)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:SF 0 "register_operand" "=f,f,f")
+ (if_then_else:SF (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (match_operand:SF 2 "register_operand" "f,0,f")
+ (match_operand:SF 3 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ "* return output_fp_conditional_move (which_alternative, operands);")
+
(define_expand "movdfcc"
- [(match_dup 4)
- (set (match_operand 0 "register_operand" "t")
+ [(set (match_operand:DF 0 "register_operand" "")
(if_then_else:DF (match_operand 1 "comparison_operator" "")
(match_operand:DF 2 "register_operand" "")
(match_operand:DF 3 "register_operand" "")))]
- "0 && TARGET_CMOVE"
+ "TARGET_CMOVE"
"
{
- operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
+ rtx temp;
+
+ if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
+ FAIL;
+
+ /* The floating point conditional move instructions don't directly
+ support conditions resulting from a signed integer comparison. */
+
+ switch (GET_CODE (operands[1]))
+ {
+ case LT:
+ case LE:
+ case GE:
+ case GT:
+ temp = emit_store_flag (gen_reg_rtx (QImode),
+ GET_CODE (operands[1]), i386_compare_op0, i386_compare_op1,
+ VOIDmode, 0, 0);
+
+ if (!temp)
+ FAIL;
+
+ operands[1] = gen_rtx_fmt_ee (NE, QImode, temp, const0_rtx);
+ break;
+
+ default:
+ operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+ GET_MODE (i386_compare_op0),
+ i386_compare_op0, i386_compare_op1);
+ break;
+ }
}")
+(define_insn ""
+ [(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
+ (if_then_else:DF (match_operator 1 "comparison_operator"
+ [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
+ (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
+ (match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
+ (match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
+ "TARGET_CMOVE
+ && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+ && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
+ "#")
+
+(define_insn ""
+ [(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
+ (if_then_else:DF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
+ (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
+ (match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
+ (match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
+ "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT
+ && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+ && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
+ "#")
+
+(define_split
+ [(set (match_operand:DF 0 "register_operand" "=f,f,f")
+ (if_then_else:DF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (const_int 0)])
+ (match_operand:DF 3 "register_operand" "f,0,f")
+ (match_operand:DF 4 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (if_then_else:DF (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 3) (match_dup 4)))]
+ "")
+
+(define_split
+ [(set (match_operand:DF 0 "register_operand" "=f,f,f")
+ (if_then_else:DF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (match_operand 3 "general_operand" "")])
+ (match_operand:DF 4 "register_operand" "f,0,f")
+ (match_operand:DF 5 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0) (compare (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (if_then_else:DF (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 4) (match_dup 5)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:DF 0 "register_operand" "=f,f,f")
+ (if_then_else:DF (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (match_operand:DF 2 "register_operand" "f,0,f")
+ (match_operand:DF 3 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ "* return output_fp_conditional_move (which_alternative, operands);")
+
(define_expand "movxfcc"
- [(match_dup 4)
- (set (match_operand 0 "register_operand" "")
+ [(set (match_operand:XF 0 "register_operand" "")
(if_then_else:XF (match_operand 1 "comparison_operator" "")
(match_operand:XF 2 "register_operand" "")
(match_operand:XF 3 "register_operand" "")))]
- "0 && TARGET_CMOVE"
+ "TARGET_CMOVE"
"
{
- operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
-}")
+ rtx temp;
-(define_insn "movsfcc_1"
- [(set (match_operand:SF 0 "general_operand" "=f,f,&f")
- (if_then_else:SF (match_operator 1 "comparison_operator"
- [(cc0) (const_int 0)])
- (match_operand:SF 2 "register_operand" "0,f,f")
- (match_operand:SF 3 "register_operand" "f,0,f")))]
- "TARGET_CMOVE"
- "*
-{
- switch (which_alternative)
+ if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
+ FAIL;
+
+ /* The floating point conditional move instructions don't directly
+ support conditions resulting from a signed integer comparison. */
+
+ switch (GET_CODE (operands[1]))
{
- case 0:
- /* r <- cond ? arg : r */
- output_asm_insn (AS2 (fcmov%f1,%3,%0), operands);
- break;
+ case LT:
+ case LE:
+ case GE:
+ case GT:
+ temp = emit_store_flag (gen_reg_rtx (QImode),
+ GET_CODE (operands[1]), i386_compare_op0, i386_compare_op1,
+ VOIDmode, 0, 0);
+
+ if (!temp)
+ FAIL;
- case 1:
- /* r <- cond ? r : arg */
- output_asm_insn (AS2 (fcmov%F1,%2,%0), operands);
+ operands[1] = gen_rtx_fmt_ee (NE, QImode, temp, const0_rtx);
break;
- case 2:
- /* r <- cond ? r : arg */
- output_asm_insn (AS2 (fcmov%F1,%2,%0), operands);
- output_asm_insn (AS2 (fcmov%f1,%3,%0), operands);
+ default:
+ operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+ GET_MODE (i386_compare_op0),
+ i386_compare_op0, i386_compare_op1);
break;
}
-
- RET;
}")
-(define_insn "movdfcc_1"
- [(set (match_operand:DF 0 "general_operand" "=f,f,&f")
- (if_then_else:DF (match_operator 1 "comparison_operator"
- [(cc0) (const_int 0)])
- (match_operand:DF 2 "register_operand" "0,f,f")
- (match_operand:DF 3 "register_operand" "f,0,f")))]
+(define_insn ""
+ [(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
+ (if_then_else:XF (match_operator 1 "comparison_operator"
+ [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
+ (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
+ (match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
+ (match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
+ "TARGET_CMOVE
+ && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+ && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
+ "#")
+
+(define_insn ""
+ [(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
+ (if_then_else:XF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
+ (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
+ (match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
+ (match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
+ "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT
+ && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+ && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
+ "#")
+
+(define_split
+ [(set (match_operand:XF 0 "register_operand" "=f,f,f")
+ (if_then_else:XF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (const_int 0)])
+ (match_operand:XF 3 "register_operand" "f,0,f")
+ (match_operand:XF 4 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (if_then_else:XF (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 3) (match_dup 4)))]
+ "")
+
+(define_split
+ [(set (match_operand:XF 0 "register_operand" "=f,f,f")
+ (if_then_else:XF (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (match_operand 3 "general_operand" "")])
+ (match_operand:XF 4 "register_operand" "f,0,f")
+ (match_operand:XF 5 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0) (compare (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (if_then_else:XF (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 4) (match_dup 5)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:XF 0 "register_operand" "=f,f,f")
+ (if_then_else:XF (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (match_operand:XF 2 "register_operand" "f,0,f")
+ (match_operand:XF 3 "register_operand" "0,f,f")))]
+ "TARGET_CMOVE && reload_completed"
+ "* return output_fp_conditional_move (which_alternative, operands);")
+
+(define_expand "movdicc"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (if_then_else:DI (match_operand 1 "comparison_operator" "")
+ (match_operand:DI 2 "nonimmediate_operand" "")
+ (match_operand:DI 3 "nonimmediate_operand" "")))]
"TARGET_CMOVE"
- "*
+ "
{
- switch (which_alternative)
- {
- case 0:
- /* r <- cond ? arg : r */
- output_asm_insn (AS2 (fcmov%f1,%3,%0), operands);
- break;
+ if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
+ FAIL;
- case 1:
- /* r <- cond ? r : arg */
- output_asm_insn (AS2 (fcmov%F1,%2,%0), operands);
- break;
+ operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+ GET_MODE (i386_compare_op0),
+ i386_compare_op0, i386_compare_op1);
+}")
- case 2:
- /* r <- cond ? r : arg */
- output_asm_insn (AS2 (fcmov%F1,%2,%0), operands);
- output_asm_insn (AS2 (fcmov%f1,%3,%0), operands);
- break;
- }
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
+ (if_then_else:DI (match_operator 1 "comparison_operator"
+ [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
+ (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
+ (match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
+ (match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
+ "TARGET_CMOVE"
+ "#")
- RET;
-}")
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
+ (if_then_else:DI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
+ (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
+ (match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
+ (match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
+ "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
+ "#")
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "=&r,&r,&r")
+ (if_then_else:DI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (const_int 0)])
+ (match_operand:DI 3 "nonimmediate_operand" "ro,0,ro")
+ (match_operand:DI 4 "nonimmediate_operand" "0,ro,ro")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (if_then_else:DI (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 3) (match_dup 4)))]
+ "")
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "=&r,&r,&r")
+ (if_then_else:DI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "nonimmediate_operand" "")
+ (match_operand 3 "general_operand" "")])
+ (match_operand:DI 4 "nonimmediate_operand" "ro,0,ro")
+ (match_operand:DI 5 "nonimmediate_operand" "0,ro,ro")))]
+ "TARGET_CMOVE && reload_completed"
+ [(set (cc0) (compare (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (if_then_else:DI (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 4) (match_dup 5)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=&r,&r,&r")
+ (if_then_else:DI (match_operator 1 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (match_operand:DI 2 "nonimmediate_operand" "ro,0,ro")
+ (match_operand:DI 3 "nonimmediate_operand" "0,ro,ro")))]
+ "TARGET_CMOVE && reload_completed"
+ "* return output_int_conditional_move (which_alternative, operands);")
(define_insn "strlensi_unroll"
[(set (match_operand:SI 0 "register_operand" "=&r,&r")
@@ -7532,7 +7643,7 @@ byte_xor_operation:
DONE;
}")
-(define_expand "nonlocal_goto_receiver"
+(define_expand "exception_receiver"
[(const_int 0)]
"flag_pic"
"
diff --git a/gcc/config/i386/isc.h b/gcc/config/i386/isc.h
index d0b2dcc7a55..5c39896df01 100644
--- a/gcc/config/i386/isc.h
+++ b/gcc/config/i386/isc.h
@@ -19,7 +19,7 @@
#define LIB_SPEC "%{shlib:-lc_s} %{posix:-lcposix} %{Xp:-lcposix} -lc -lg"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{posix:-D_POSIX_SOURCE} %{Xp:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{Xp:-D_POSIX_SOURCE}"
/* ISC 2.2 uses `char' for `wchar_t'. */
#undef WCHAR_TYPE
diff --git a/gcc/config/i386/linux-aout.h b/gcc/config/i386/linux-aout.h
index 349642fa7c7..de81d878317 100644
--- a/gcc/config/i386/linux-aout.h
+++ b/gcc/config/i386/linux-aout.h
@@ -1,5 +1,5 @@
/* Definitions for Intel 386 running Linux-based GNU systems using a.out.
- Copyright (C) 1992, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
Contributed by H.J. Lu (hjl@nynexst.com)
This file is part of GNU CC.
@@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Dunix -Dlinux -Asystem(posix)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
diff --git a/gcc/config/i386/linux-oldld.h b/gcc/config/i386/linux-oldld.h
index 116a5bf4b30..4e3085bc2ca 100644
--- a/gcc/config/i386/linux-oldld.h
+++ b/gcc/config/i386/linux-oldld.h
@@ -1,6 +1,6 @@
/* Definitions for Intel 386 running Linux-based GNU systems with pre-BFD
a.out linkers.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
Contributed by Michael Meissner (meissner@cygnus.com)
This file is part of GNU CC.
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Dunix -Dlinux -Asystem(posix)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index e1780156454..373c80444cf 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -1,5 +1,5 @@
-/* Definitions for Intel 386 running Linux with ELF format
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu.
@@ -49,7 +49,7 @@ Boston, MA 02111-1307, USA. */
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
/* Copy this from the svr4 specifications... */
/* Define the register numbers to be used in Dwarf debugging information.
@@ -155,9 +155,9 @@ Boston, MA 02111-1307, USA. */
#undef CPP_SPEC
#ifdef USE_GNULIBC_1
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#else
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#endif
#undef CC1_SPEC
@@ -218,3 +218,16 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* A C statement to output to the stdio stream FILE an assembler
+ command to advance the location counter to a multiple of 1<<LOG
+ bytes if it is within MAX_SKIP bytes.
+
+ This is used to align code labels according to Intel recommendations. */
+
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
+ if ((LOG)!=0) \
+ if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
+#endif
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 7c7a3bbc6fa..a320a61f780 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -26,11 +26,16 @@ Boston, MA 02111-1307, USA. */
#include "i386/cygwin32.h"
+/* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The
+ only difference between the two should be __MSVCRT__ needed to
+ distinguish MSVC from CRTDLL runtime in mingw headers. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
- -D__MINGW32__ -DWINNT -D_X86_=1 -D__STDC__=1\
+ -D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 -D__STDC__=1\
-D__stdcall=__attribute__((__stdcall__)) \
+ _D_stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
+ -D__declspec(x)=__attribute__((x)) \
-Asystem(winnt) -Acpu(i386) -Amachine(i386)"
/* Specific a different directory for the standard include files. */
diff --git a/gcc/config/i386/netbsd.h b/gcc/config/i386/netbsd.h
index c7aeddf6605..5978aec5c4b 100644
--- a/gcc/config/i386/netbsd.h
+++ b/gcc/config/i386/netbsd.h
@@ -50,7 +50,7 @@
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions. */
diff --git a/gcc/config/i386/osfelf.h b/gcc/config/i386/osfelf.h
index 4604a341175..381ffc26313 100644
--- a/gcc/config/i386/osfelf.h
+++ b/gcc/config/i386/osfelf.h
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem(xpg4)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
+#define CPP_SPEC "%(cpp_cpu) \
%{mrose: -D__ROSE__ %{!pic-none: -D__SHARED__}} \
%{!mrose: -D__ELF__ %{fpic: -D__SHARED__}} \
%{mno-underscores: -D__NO_UNDERSCORES__} \
diff --git a/gcc/config/i386/osfrose.h b/gcc/config/i386/osfrose.h
index e2e6231ed87..9cfe187ea09 100644
--- a/gcc/config/i386/osfrose.h
+++ b/gcc/config/i386/osfrose.h
@@ -93,7 +93,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem(xpg4)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
+#define CPP_SPEC "%(cpp_cpu) \
%{!melf: -D__ROSE__ %{!pic-none: -D__SHARED__}} \
%{melf: -D__ELF__ %{fpic: -D__SHARED__}} \
%{mno-underscores: -D__NO_UNDERSCORES__} \
diff --git a/gcc/config/i386/ptx4-i.h b/gcc/config/i386/ptx4-i.h
index 36836f6ed30..1537b4a4cee 100644
--- a/gcc/config/i386/ptx4-i.h
+++ b/gcc/config/i386/ptx4-i.h
@@ -244,4 +244,4 @@ do { long value[3]; \
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
diff --git a/gcc/config/i386/rtemself.h b/gcc/config/i386/rtemself.h
index 6486102abdc..d9d97337aa9 100644
--- a/gcc/config/i386/rtemself.h
+++ b/gcc/config/i386/rtemself.h
@@ -41,12 +41,12 @@ Boston, MA 02111-1307, USA. */
This is only used for PIC code. See comments by the `casesi' insn in
i386.md for an explanation of the expression this outputs. */
#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
/* Copy this from the svr4 specifications... */
/* Define the register numbers to be used in Dwarf debugging information.
diff --git a/gcc/config/i386/sco.h b/gcc/config/i386/sco.h
index 9c94a766a83..016e0a00ce0 100644
--- a/gcc/config/i386/sco.h
+++ b/gcc/config/i386/sco.h
@@ -58,7 +58,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem(svr3)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{scointl:-DM_INTERNAT}"
+#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}"
/* This spec is used for telling cpp whether char is signed or not. */
diff --git a/gcc/config/i386/sco4.h b/gcc/config/i386/sco4.h
index 1b17d674cd5..5d1ea471dbf 100644
--- a/gcc/config/i386/sco4.h
+++ b/gcc/config/i386/sco4.h
@@ -66,7 +66,7 @@ Boston, MA 02111-1307, USA. */
"-Asystem(svr3)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
+#define CPP_SPEC "%(cpp_cpu) \
-D_i386 -D_M_I386 -D_M_I86 -D_M_I86SM -D_M_SDATA -D_M_STEXT \
-D_unix -D_M_UNIX -D_M_XENIX \
-D_M_SYS5 -D_M_SYSV -D_M_SYS3 -D_M_SYSIII \
diff --git a/gcc/config/i386/sco4dbx.h b/gcc/config/i386/sco4dbx.h
index 6ff5714c56b..3d075b6a2e2 100644
--- a/gcc/config/i386/sco4dbx.h
+++ b/gcc/config/i386/sco4dbx.h
@@ -64,7 +64,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Dunix -Asystem(svr3)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
+#define CPP_SPEC "%(cpp_cpu) \
-D_M_I386 -D_M_I86 -D_M_I86SM -D_M_SDATA -D_M_STEXT \
-D_M_UNIX -D_M_XENIX \
-D_M_SYS5 -D_M_SYSV -D_M_SYS3 -D_M_SYSIII \
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index 70d1bdd66c2..b97fffc73ff 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -653,7 +653,7 @@ dtors_section () \
(current_function_calls_setjmp || current_function_calls_longjmp))
#undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION 1
+#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_ELF && flag_pic)
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX \
@@ -731,6 +731,14 @@ dtors_section () \
#undef HANDLE_SYSV_PRAGMA
#define HANDLE_SYSV_PRAGMA 1
+/* Though OpenServer support .weak in COFF, g++ doesn't play nice with it
+ * so we'll punt on it for now
+ */
+#define SUPPORTS_WEAK (TARGET_ELF)
+#define ASM_WEAKEN_LABEL(FILE,NAME) \
+ do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
+ fputc ('\n', FILE); } while (0)
+
#undef SCCS_DIRECTIVE
#define SCCS_DIRECTIVE 1
@@ -777,19 +785,29 @@ dtors_section () \
SCO also allows you to compile, link and generate either ELF or COFF
binaries. With gcc, unlike the SCO compiler, the default is ELF.
- Specify -mcoff to gcc to produce elf binaries. -fpic will get the
+ Specify -mcoff to gcc to produce COFF binaries. -fpic will get the
assembler and linker to produce PIC code.
*/
/* Set up assembler flags for PIC and ELF compilations */
#undef ASM_SPEC
+
+#if USE_GAS
+ /* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c
+ * Undef MD_EXEC_PREFIX becuase we don't know where GAS is, but it's not
+ * likely in /usr/ccs/bin/
+ */
+#undef MD_EXEC_PREFIX
+#else
+
#define ASM_SPEC \
- "-b %{!mcoff:elf}%{mcoff:coff \
- %{static:%e-static not valid with -mcoff} \
- %{shared:%e-shared not valid with -mcoff} \
- %{symbolic:%e-symbolic not valid with -mcoff}} \
- %{Ym,*} %{Yd,*} %{Wa,*:%*} \
- %{!mcoff:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}"
+ "-b %{!mcoff:elf}%{mcoff:coff \
+ %{static:%e-static not valid with -mcoff} \
+ %{shared:%e-shared not valid with -mcoff} \
+ %{symbolic:%e-symbolic not valid with -mcoff}} \
+ %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+ %{!mcoff:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}"
+#endif
/* Use crt1.o as a startup file and crtn.o as a closing file. */
@@ -822,7 +840,7 @@ dtors_section () \
/* You are in a maze of GCC specs ... all alike */
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
+#define CPP_SPEC "%(cpp_cpu) \
%{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \
%{fPIC:%{mcoff:%e-fPIC is not valid with -mcoff}} \
-D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX \
@@ -898,6 +916,11 @@ dtors_section () \
#define NO_DOLLAR_IN_LABEL
+/* Implicit library calls should use memcpy, not bcopy, etc. They are
+ faster on OpenServer libraries. */
+
+#define TARGET_MEM_FUNCTIONS
+
/*
Here comes some major hackery to get the crt stuff to compile properly.
Since we can (and do) compile for both COFF and ELF environments, we
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index fc93bf1e99e..8fc3e6140e7 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */
"-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem(svr4)"
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
+#define CPP_SPEC "%(cpp_cpu) \
%{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
#undef LIB_SPEC
diff --git a/gcc/config/i386/sysv3.h b/gcc/config/i386/sysv3.h
index b6a1fcc8e2a..ce898899011 100644
--- a/gcc/config/i386/sysv3.h
+++ b/gcc/config/i386/sysv3.h
@@ -44,7 +44,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-Dunix -Asystem(svr3)"
-#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
/* Writing `int' for a bitfield forces int alignment for the structure. */
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
index 3a72cdd7dcf..e688f7b8c9f 100644
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -242,7 +242,7 @@ do { long value[3]; \
/* Indicate that jump tables go in the text section. This is
necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
diff --git a/gcc/config/i386/unix.h b/gcc/config/i386/unix.h
index c74911c7107..47440ddd943 100644
--- a/gcc/config/i386/unix.h
+++ b/gcc/config/i386/unix.h
@@ -179,15 +179,13 @@ do { \
output_asm_insn (AS1 (pop%L0,%0), xops); \
output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0", xops); \
fprintf (FILE, "\tmovl "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "@GOT(%%ebx),%%ecx\n\tpopl %%ebx\n\tjmp *%%ecx\n"); \
} \
else \
{ \
fprintf (FILE, "\tjmp "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "\n"); \
} \
} while (0)
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 8c35f3979c7..0058eb76499 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -20,7 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -28,6 +28,342 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "flags.h"
+/* i386/PE specific attribute support.
+
+ i386/PE has two new attributes:
+ dllexport - for exporting a function/variable that will live in a dll
+ dllimport - for importing a function/variable from a dll
+
+ Microsoft allows multiple declspecs in one __declspec, separating
+ them with spaces. We do NOT support this. Instead, use __declspec
+ multiple times.
+*/
+
+/* Return nonzero if ATTR is a valid attribute for DECL.
+ ATTRIBUTES are any existing attributes and ARGS are the arguments
+ supplied with ATTR. */
+
+int
+i386_pe_valid_decl_attribute_p (decl, attributes, attr, args)
+ tree decl;
+ tree attributes;
+ tree attr;
+ tree args;
+{
+ if (args == NULL_TREE)
+ {
+ if (is_attribute_p ("dllexport", attr))
+ return 1;
+ if (is_attribute_p ("dllimport", attr))
+ return 1;
+ }
+
+ return i386_valid_decl_attribute_p (decl, attributes, attr, args);
+}
+
+/* Return nonzero if ATTR is a valid attribute for TYPE.
+ ATTRIBUTES are any existing attributes and ARGS are the arguments
+ supplied with ATTR. */
+
+int
+i386_pe_valid_type_attribute_p (type, attributes, attr, args)
+ tree type;
+ tree attributes;
+ tree attr;
+ tree args;
+{
+ if (args == NULL_TREE
+ && (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE))
+ {
+ if (is_attribute_p ("dllexport", attr))
+ return 1;
+ if (is_attribute_p ("dllimport", attr))
+ return 1;
+ }
+
+ return i386_valid_type_attribute_p (type, attributes, attr, args);
+}
+
+/* Merge attributes in decls OLD and NEW.
+
+ This handles the following situation:
+
+ __declspec (dllimport) int foo;
+ int foo;
+
+ The second instance of `foo' nullifies the dllimport. */
+
+tree
+i386_pe_merge_decl_attributes (old, new)
+ tree old, new;
+{
+ tree a;
+ int delete_dllimport_p;
+
+ old = DECL_MACHINE_ATTRIBUTES (old);
+ new = DECL_MACHINE_ATTRIBUTES (new);
+
+ /* What we need to do here is remove from `old' dllimport if it doesn't
+ appear in `new'. dllimport behaves like extern: if a declaration is
+ marked dllimport and a definition appears later, then the object
+ is not dllimport'd. */
+
+ if (lookup_attribute ("dllimport", old) != NULL_TREE
+ && lookup_attribute ("dllimport", new) == NULL_TREE)
+ delete_dllimport_p = 1;
+ else
+ delete_dllimport_p = 0;
+
+ a = merge_attributes (old, new);
+
+ if (delete_dllimport_p)
+ {
+ tree prev,t;
+
+ /* Scan the list for dllimport and delete it. */
+ for (prev = NULL_TREE, t = a; t; prev = t, t = TREE_CHAIN (t))
+ {
+ if (is_attribute_p ("dllimport", TREE_PURPOSE (t)))
+ {
+ if (prev == NULL_TREE)
+ a = TREE_CHAIN (a);
+ else
+ TREE_CHAIN (prev) = TREE_CHAIN (t);
+ break;
+ }
+ }
+ }
+
+ return a;
+}
+
+/* Return the type that we should use to determine if DECL is
+ imported or exported. */
+
+static tree
+associated_type (decl)
+ tree decl;
+{
+ tree t = NULL_TREE;
+
+ /* In the C++ frontend, DECL_CONTEXT for a method doesn't actually refer
+ to the containing class. So we look at the 'this' arg. */
+ if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
+ {
+ /* Artificial methods are not affected by the import/export status of
+ their class unless they are virtual. */
+ if (! DECL_ARTIFICIAL (decl) || DECL_VINDEX (decl))
+ t = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))));
+ }
+ else if (DECL_CONTEXT (decl)
+ && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (decl))) == 't')
+ t = DECL_CONTEXT (decl);
+
+ return t;
+}
+
+/* Return non-zero if DECL is a dllexport'd object. */
+
+int
+i386_pe_dllexport_p (decl)
+ tree decl;
+{
+ tree exp;
+
+ if (TREE_CODE (decl) != VAR_DECL
+ && TREE_CODE (decl) != FUNCTION_DECL)
+ return 0;
+ exp = lookup_attribute ("dllexport", DECL_MACHINE_ATTRIBUTES (decl));
+ if (exp)
+ return 1;
+
+ /* Class members get the dllexport status of their class. */
+ if (associated_type (decl))
+ {
+ exp = lookup_attribute ("dllexport",
+ TYPE_ATTRIBUTES (associated_type (decl)));
+ if (exp)
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Return non-zero if DECL is a dllimport'd object. */
+
+int
+i386_pe_dllimport_p (decl)
+ tree decl;
+{
+ tree imp;
+
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && TARGET_NOP_FUN_DLLIMPORT)
+ return 0;
+
+ if (TREE_CODE (decl) != VAR_DECL
+ && TREE_CODE (decl) != FUNCTION_DECL)
+ return 0;
+ imp = lookup_attribute ("dllimport", DECL_MACHINE_ATTRIBUTES (decl));
+ if (imp)
+ return 1;
+
+ /* Class members get the dllimport status of their class. */
+ if (associated_type (decl))
+ {
+ imp = lookup_attribute ("dllimport",
+ TYPE_ATTRIBUTES (associated_type (decl)));
+ if (imp)
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Return non-zero if SYMBOL is marked as being dllexport'd. */
+
+int
+i386_pe_dllexport_name_p (symbol)
+ char *symbol;
+{
+ return symbol[0] == '@' && symbol[1] == 'e' && symbol[2] == '.';
+}
+
+/* Return non-zero if SYMBOL is marked as being dllimport'd. */
+
+int
+i386_pe_dllimport_name_p (symbol)
+ char *symbol;
+{
+ return symbol[0] == '@' && symbol[1] == 'i' && symbol[2] == '.';
+}
+
+/* Mark a DECL as being dllexport'd.
+ Note that we override the previous setting (eg: dllimport). */
+
+void
+i386_pe_mark_dllexport (decl)
+ tree decl;
+{
+ char *oldname, *newname;
+ rtx rtlname;
+ tree idp;
+
+ rtlname = XEXP (DECL_RTL (decl), 0);
+ if (GET_CODE (rtlname) == SYMBOL_REF)
+ oldname = XSTR (rtlname, 0);
+ else if (GET_CODE (rtlname) == MEM
+ && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF)
+ oldname = XSTR (XEXP (rtlname, 0), 0);
+ else
+ abort ();
+ if (i386_pe_dllimport_name_p (oldname))
+ oldname += 9;
+ else if (i386_pe_dllexport_name_p (oldname))
+ return; /* already done */
+
+ newname = alloca (strlen (oldname) + 4);
+ sprintf (newname, "@e.%s", oldname);
+
+ /* We pass newname through get_identifier to ensure it has a unique
+ address. RTL processing can sometimes peek inside the symbol ref
+ and compare the string's addresses to see if two symbols are
+ identical. */
+ idp = get_identifier (newname);
+
+ XEXP (DECL_RTL (decl), 0) =
+ gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
+}
+
+/* Mark a DECL as being dllimport'd. */
+
+void
+i386_pe_mark_dllimport (decl)
+ tree decl;
+{
+ char *oldname, *newname;
+ tree idp;
+ rtx rtlname, newrtl;
+
+ rtlname = XEXP (DECL_RTL (decl), 0);
+ if (GET_CODE (rtlname) == SYMBOL_REF)
+ oldname = XSTR (rtlname, 0);
+ else if (GET_CODE (rtlname) == MEM
+ && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF)
+ oldname = XSTR (XEXP (rtlname, 0), 0);
+ else
+ abort ();
+ if (i386_pe_dllexport_name_p (oldname))
+ {
+ error ("`%s' declared as both exported to and imported from a DLL.",
+ IDENTIFIER_POINTER (DECL_NAME (decl)));
+ return;
+ }
+ else if (i386_pe_dllimport_name_p (oldname))
+ {
+ /* Already done, but force correct linkage since the redeclaration
+ might have omitted explicit extern. Sigh. */
+ if (TREE_CODE (decl) == VAR_DECL
+ /* ??? Is this test for vtables needed? */
+ && !DECL_VIRTUAL_P (decl))
+ {
+ DECL_EXTERNAL (decl) = 1;
+ TREE_PUBLIC (decl) = 1;
+ }
+ return;
+ }
+
+ /* ??? One can well ask why we're making these checks here,
+ and that would be a good question. */
+
+ /* Imported variables can't be initialized. Note that C++ classes
+ are marked initial, so we need to check. */
+ if (TREE_CODE (decl) == VAR_DECL
+ && !DECL_VIRTUAL_P (decl)
+ && (DECL_INITIAL (decl)
+ && ! TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))))
+ {
+ error_with_decl (decl, "initialized variable `%s' is marked dllimport");
+ return;
+ }
+ /* Nor can they be static. */
+ if (TREE_CODE (decl) == VAR_DECL
+ /* ??? Is this test for vtables needed? */
+ && !DECL_VIRTUAL_P (decl)
+ && 0 /*???*/)
+ {
+ error_with_decl (decl, "static variable `%s' is marked dllimport");
+ return;
+ }
+
+ /* `extern' needn't be specified with dllimport.
+ Specify `extern' now and hope for the best. Sigh. */
+ if (TREE_CODE (decl) == VAR_DECL
+ /* ??? Is this test for vtables needed? */
+ && !DECL_VIRTUAL_P (decl))
+ {
+ DECL_EXTERNAL (decl) = 1;
+ TREE_PUBLIC (decl) = 1;
+ }
+
+ newname = alloca (strlen (oldname) + 11);
+ sprintf (newname, "@i._imp__%s", oldname);
+
+ /* We pass newname through get_identifier to ensure it has a unique
+ address. RTL processing can sometimes peek inside the symbol ref
+ and compare the string's addresses to see if two symbols are
+ identical. */
+ idp = get_identifier (newname);
+
+ newrtl = gen_rtx (MEM, Pmode,
+ gen_rtx (SYMBOL_REF, Pmode,
+ IDENTIFIER_POINTER (idp)));
+ XEXP (DECL_RTL (decl), 0) = newrtl;
+
+ /* Can't treat a pointer to this as a constant address */
+ DECL_NON_ADDR_CONST_P (decl) = 1;
+}
+
/* Return string which is the former assembler name modified with a
suffix consisting of an atsign (@) followed by the number of bytes of
arguments */
@@ -37,6 +373,8 @@ gen_stdcall_suffix (decl)
tree decl;
{
int total = 0;
+ /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
+ of DECL_ASSEMBLER_NAME. */
char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym;
@@ -64,6 +402,59 @@ gen_stdcall_suffix (decl)
return IDENTIFIER_POINTER (get_identifier (newsym));
}
+/* Cover function to implement ENCODE_SECTION_INFO. */
+
+void
+i386_pe_encode_section_info (decl)
+ tree decl;
+{
+ /* This bit is copied from i386.h. */
+ if (optimize > 0 && TREE_CONSTANT (decl)
+ && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))
+ {
+ rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'
+ ? TREE_CST_RTL (decl) : DECL_RTL (decl));
+ SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
+ }
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ if (lookup_attribute ("stdcall",
+ TYPE_ATTRIBUTES (TREE_TYPE (decl))))
+ XEXP (DECL_RTL (decl), 0) =
+ gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl));
+
+ /* Mark the decl so we can tell from the rtl whether the object is
+ dllexport'd or dllimport'd. */
+
+ if (i386_pe_dllexport_p (decl))
+ i386_pe_mark_dllexport (decl);
+ else if (i386_pe_dllimport_p (decl))
+ i386_pe_mark_dllimport (decl);
+ /* It might be that DECL has already been marked as dllimport, but a
+ subsequent definition nullified that. The attribute is gone but
+ DECL_RTL still has @i._imp__foo. We need to remove that. Ditto
+ for the DECL_NON_ADDR_CONST_P flag. */
+ else if ((TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == VAR_DECL)
+ && DECL_RTL (decl) != NULL_RTX
+ && GET_CODE (DECL_RTL (decl)) == MEM
+ && GET_CODE (XEXP (DECL_RTL (decl), 0)) == MEM
+ && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == SYMBOL_REF
+ && i386_pe_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0)))
+ {
+ char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
+ tree idp = get_identifier (oldname + 9);
+ rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
+
+ XEXP (DECL_RTL (decl), 0) = newrtl;
+
+ DECL_NON_ADDR_CONST_P (decl) = 0;
+
+ /* We previously set TREE_PUBLIC and DECL_EXTERNAL.
+ We leave these alone for now. */
+ }
+}
+
/* Cover function for UNIQUE_SECTION. */
void
@@ -75,6 +466,8 @@ i386_pe_unique_section (decl, reloc)
char *name,*string,*prefix;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ /* Strip off any encoding in fnname. */
+ STRIP_NAME_ENCODING (name, name);
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
@@ -98,3 +491,80 @@ i386_pe_unique_section (decl, reloc)
DECL_SECTION_NAME (decl) = build_string (len, string);
}
+
+/* The Microsoft linker requires that every function be marked as
+ DT_FCN. When using gas on cygwin32, we must emit appropriate .type
+ directives. */
+
+#include "gsyms.h"
+
+/* Mark a function appropriately. This should only be called for
+ functions for which we are not emitting COFF debugging information.
+ FILE is the assembler output file, NAME is the name of the
+ function, and PUBLIC is non-zero if the function is globally
+ visible. */
+
+void
+i386_pe_declare_function_type (file, name, public)
+ FILE *file;
+ char *name;
+ int public;
+{
+ fprintf (file, "\t.def\t");
+ assemble_name (file, name);
+ fprintf (file, ";\t.scl\t%d;\t.type\t%d;\t.endef\n",
+ public ? (int) C_EXT : (int) C_STAT,
+ (int) DT_FCN << N_BTSHFT);
+}
+
+/* Keep a list of external functions. */
+
+struct extern_list
+{
+ struct extern_list *next;
+ char *name;
+};
+
+static struct extern_list *extern_head;
+
+/* Assemble an external function reference. We need to keep a list of
+ these, so that we can output the function types at the end of the
+ assembly. We can't output the types now, because we might see a
+ definition of the function later on and emit debugging information
+ for it then. */
+
+void
+i386_pe_record_external_function (name)
+ char *name;
+{
+ struct extern_list *p;
+
+ p = (struct extern_list *) permalloc (sizeof *p);
+ p->next = extern_head;
+ p->name = name;
+ extern_head = p;
+}
+
+/* This is called at the end of assembly. For each external function
+ which has not been defined, we output a declaration now. */
+
+void
+i386_pe_asm_file_end (file)
+ FILE *file;
+{
+ struct extern_list *p;
+
+ for (p = extern_head; p != NULL; p = p->next)
+ {
+ tree decl;
+
+ decl = get_identifier (p->name);
+
+ /* Positively ensure only one declaration for any given symbol. */
+ if (! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl))
+ {
+ TREE_ASM_WRITTEN (decl) = 1;
+ i386_pe_declare_function_type (file, p->name, TREE_PUBLIC (decl));
+ }
+ }
+}
diff --git a/gcc/config/i386/xm-cygwin32.h b/gcc/config/i386/xm-cygwin32.h
index 521a6530991..fd9c6db5923 100644
--- a/gcc/config/i386/xm-cygwin32.h
+++ b/gcc/config/i386/xm-cygwin32.h
@@ -32,22 +32,22 @@ Boston, MA 02111-1307, USA. */
/* If we allow both '/' and '\' as dir separators, then
allow both unix and win32 PATH syntax */
-#undef GET_ENVIRONMENT
-#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) \
-{ \
- char *epath; \
- char *win32epath; \
- \
- epath = win32epath = getenv (ENV_NAME); \
- /* if we have a posix path list, convert to win32 path list */ \
- if (epath != NULL && *epath != 0 && cygwin32_posix_path_list_p (epath)) \
- { \
- win32epath = (char *) xmalloc \
- (cygwin32_posix_to_win32_path_list_buf_size (epath)); \
- cygwin32_posix_to_win32_path_list (epath, win32epath); \
- } \
- ENV_VALUE = win32epath; \
-}
+#undef GET_ENV_PATH_LIST
+#define GET_ENV_PATH_LIST(VAR,NAME) \
+do { \
+ char *_epath; \
+ char *_win32epath; \
+ _epath = _win32epath = getenv (NAME); \
+ /* if we have a posix path list, convert to win32 path list */ \
+ if (_epath != NULL && *_epath != 0 \
+ && cygwin32_posix_path_list_p (_epath)) \
+ { \
+ _win32epath = (char *) xmalloc \
+ (cygwin32_posix_to_win32_path_list_buf_size (_epath)); \
+ cygwin32_posix_to_win32_path_list (_epath, _win32epath); \
+ } \
+ (VAR) = _win32epath; \
+} while (0)
#define PATH_SEPARATOR ';'
diff --git a/gcc/config/i386/xm-go32.h b/gcc/config/i386/xm-go32.h
index 3cfd6b39992..c44e73ea421 100644
--- a/gcc/config/i386/xm-go32.h
+++ b/gcc/config/i386/xm-go32.h
@@ -20,8 +20,6 @@ Boston, MA 02111-1307, USA. */
#define __MSDOS__ 1
-#define NO_STAB_H
-
#include "i386/xm-i386.h"
/* Use semicolons to separate elements of a path. */
diff --git a/gcc/config/i386/xm-netbsd.h b/gcc/config/i386/xm-netbsd.h
deleted file mode 100644
index 3a9f3241990..00000000000
--- a/gcc/config/i386/xm-netbsd.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Intel i386 running NetBSD as host. */
-
-#include <i386/xm-i386.h>
-#include <xm-netbsd.h>
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index 11b2a21f9be..9fa8889c301 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -89,86 +89,83 @@ static int ret_label = 0;
intel compilers understand. */
int
-process_pragma (finput, t)
- FILE *finput;
- tree t;
+process_pragma (p_getc, p_ungetc, pname)
+ int (* p_getc) PROTO ((void));
+ void (* p_ungetc) PROTO ((int));
+ char * pname;
{
int i;
register int c;
- register char *pname;
+ char buf[20];
+ char *s = buf;
+ int align;
- if (TREE_CODE (t) != IDENTIFIER_NODE)
+ /* Should be pragma 'far' or equivalent for callx/balx here. */
+ if (strcmp (pname, "align") != 0)
return 0;
-
- pname = IDENTIFIER_POINTER (t);
-
- if (strcmp (pname, "align") == 0)
+
+ do
{
- char buf[20];
- char *s = buf;
- int align;
-
- do {
- c = getc (finput);
- } while (c == ' ' || c == '\t');
-
- if (c == '(')
- c = getc (finput);
- while (c >= '0' && c <= '9')
- {
- if (s < buf + sizeof buf - 1)
- *s++ = c;
- c = getc (finput);
- }
- *s = '\0';
-
- /* We had to read a non-numerical character to get out of the
- while loop---often a newline. So, we have to put it back to
- make sure we continue to parse everything properly. */
- ungetc (c, finput);
-
- align = atoi (buf);
- switch (align)
- {
- case 0:
- /* Return to last alignment. */
- align = i960_last_maxbitalignment / 8;
- /* Fall through. */
- case 16:
- case 8:
- case 4:
- case 2:
- case 1:
- i960_last_maxbitalignment = i960_maxbitalignment;
- i960_maxbitalignment = align * 8;
- break;
-
- default:
- /* Silently ignore bad values. */
- break;
- }
-
- /* NOTE: ic960 R3.0 pragma align definition:
-
- #pragma align [(size)] | (identifier=size[,...])
- #pragma noalign [(identifier)[,...]]
+ c = p_getc ();
+ }
+ while (c == ' ' || c == '\t');
- (all parens are optional)
+ if (c == '(')
+ c = p_getc ();
+
+ while (c >= '0' && c <= '9')
+ {
+ if (s < buf + sizeof buf - 1)
+ *s++ = c;
+ c = p_getc ();
+ }
+
+ *s = '\0';
- - size is [1,2,4,8,16]
- - noalign means size==1
- - applies only to component elements of a struct (and union?)
- - identifier applies to structure tag (only)
- - missing identifier means next struct
+ /* We had to read a non-numerical character to get out of the
+ while loop---often a newline. So, we have to put it back to
+ make sure we continue to parse everything properly. */
+
+ p_ungetc (c);
- - alignment rules for bitfields need more investigation */
+ align = atoi (buf);
- return 1;
+ switch (align)
+ {
+ case 0:
+ /* Return to last alignment. */
+ align = i960_last_maxbitalignment / 8;
+ /* Fall through. */
+ case 16:
+ case 8:
+ case 4:
+ case 2:
+ case 1:
+ i960_last_maxbitalignment = i960_maxbitalignment;
+ i960_maxbitalignment = align * 8;
+ break;
+
+ default:
+ /* Silently ignore bad values. */
+ break;
}
-
- /* Should be pragma 'far' or equivalent for callx/balx here. */
-
- return 0;
+
+ /* NOTE: ic960 R3.0 pragma align definition:
+
+ #pragma align [(size)] | (identifier=size[,...])
+ #pragma noalign [(identifier)[,...]]
+
+ (all parens are optional)
+
+ - size is [1,2,4,8,16]
+ - noalign means size==1
+ - applies only to component elements of a struct (and union?)
+ - identifier applies to structure tag (only)
+ - missing identifier means next struct
+
+ - alignment rules for bitfields need more investigation */
+
+ return 1;
}
/* Initialize variables before compiling any files. */
@@ -531,6 +528,12 @@ i960_address_cost (x)
if (GET_CODE (x) == REG)
return 1;
#endif
+ /* This is a MEMA operand -- it's free. */
+ if (GET_CODE (x) == CONST_INT
+ && INTVAL (x) >= 0
+ && INTVAL (x) < 4096)
+ return 0;
+
if (GET_CODE (x) == PLUS)
{
rtx base = XEXP (x, 0);
@@ -2067,40 +2070,57 @@ i960_alignment (size, align)
}
#endif
-/* Modes for condition codes. */
-#define C_MODES \
- ((1 << (int) CCmode) | (1 << (int) CC_UNSmode) | (1<< (int) CC_CHKmode))
-
-/* Modes for single-word (and smaller) quantities. */
-#define S_MODES \
- (~C_MODES \
- & ~ ((1 << (int) DImode) | (1 << (int) TImode) \
- | (1 << (int) DFmode) | (1 << (int) XFmode)))
-/* Modes for double-word (and smaller) quantities. */
-#define D_MODES \
- (~C_MODES \
- & ~ ((1 << (int) TImode) | (1 << (int) XFmode)))
+int
+hard_regno_mode_ok (regno, mode)
+ int regno;
+ enum machine_mode mode;
+{
+ if (regno < 32)
+ {
+ switch (mode)
+ {
+ case CCmode: case CC_UNSmode: case CC_CHKmode:
+ return 0;
-/* Modes for quad-word quantities. */
-#define T_MODES (~C_MODES)
+ case DImode: case DFmode:
+ return (regno & 1) == 0;
-/* Modes for single-float quantities. */
-#define SF_MODES ((1 << (int) SFmode))
+ case TImode: case XFmode:
+ return (regno & 3) == 0;
-/* Modes for double-float quantities. */
-#define DF_MODES (SF_MODES | (1 << (int) DFmode) | (1 << (int) SCmode))
+ default:
+ return 1;
+ }
+ }
+ else if (regno >= 32 && regno < 36)
+ {
+ switch (mode)
+ {
+ case SFmode: case DFmode: case XFmode:
+ case SCmode: case DCmode:
+ return 1;
-/* Modes for quad-float quantities. */
-#define XF_MODES (DF_MODES | (1 << (int) XFmode) | (1 << (int) DCmode))
+ default:
+ return 0;
+ }
+ }
+ else if (regno == 36)
+ {
+ switch (mode)
+ {
+ case CCmode: case CC_UNSmode: case CC_CHKmode:
+ return 1;
-unsigned int hard_regno_mode_ok[FIRST_PSEUDO_REGISTER] = {
- T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
- T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
- T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
- T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
+ default:
+ return 0;
+ }
+ }
+ else if (regno == 37)
+ return 0;
- XF_MODES, XF_MODES, XF_MODES, XF_MODES, C_MODES};
+ abort ();
+}
/* Return the minimum alignment of an expression rtx X in bytes. This takes
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index ed07e9a485f..fac037bb348 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -122,7 +122,8 @@ Boston, MA 02111-1307, USA. */
fprintf (asm_out_file, "\t.type\t0x%x;", A)
/* Handle pragmas for compatibility with Intel's compilers. */
-#define HANDLE_PRAGMA(FILE, NODE) process_pragma (FILE, NODE)
+#define HANDLE_PRAGMA(GET, UNGET, NAME) process_pragma (GET, UNGET, NAME)
+extern int process_pragma ();
/* Run-time compilation parameters selecting different hardware subsets. */
@@ -506,9 +507,8 @@ extern int target_flags;
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
On 80960, the cpu registers can hold any mode but the float registers
can only hold SFmode, DFmode, or XFmode. */
-extern unsigned int hard_regno_mode_ok[FIRST_PSEUDO_REGISTER];
-#define HARD_REGNO_MODE_OK(REGNO, MODE) \
- ((hard_regno_mode_ok[REGNO] & (1 << (int) (MODE))) != 0)
+extern int hard_regno_mode_ok ();
+#define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok ((REGNO), (MODE))
/* Value is 1 if it is a good idea to tie two pseudo registers
when one has mode MODE1 and one has mode MODE2.
@@ -1109,9 +1109,10 @@ extern struct rtx_def *legitimize_address ();
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
/* Nonzero if access to memory by bytes is no faster than for words.
- Defining this results in worse code on the i960. */
+ Value changed to 1 after reports of poor bitfield code with g++.
+ Indications are that code is usually as good, sometimes better. */
-#define SLOW_BYTE_ACCESS 0
+#define SLOW_BYTE_ACCESS 1
/* We assume that the store-condition-codes instructions store 0 for false
and some other value for true. This is the value stored for true. */
@@ -1194,7 +1195,7 @@ extern struct rtx_def *gen_compare_reg ();
case CONST: \
case LABEL_REF: \
case SYMBOL_REF: \
- return (TARGET_FLAG_C_SERIES ? 6 : 8); \
+ return (TARGET_C_SERIES ? 6 : 8); \
case CONST_DOUBLE: \
if ((RTX) == CONST0_RTX (DFmode) || (RTX) == CONST0_RTX (SFmode) \
|| (RTX) == CONST1_RTX (DFmode) || (RTX) == CONST1_RTX (SFmode))\
@@ -1496,6 +1497,13 @@ extern struct rtx_def *gen_compare_reg ();
CXT); \
}
+/* Generate RTL to flush the register windows so as to make arbitrary frames
+ available. */
+#define SETUP_FRAME_ADDRESSES() \
+ emit_insn (gen_flush_register_windows ())
+
+#define BUILTIN_SETJMP_FRAME_VALUE hard_frame_pointer_rtx
+
#if 0
/* Promote char and short arguments to ints, when want compatibility with
the iC960 compilers. */
@@ -1568,7 +1576,6 @@ do { \
fprintf (FILE, "\taddo r5,g0,g0\n"); \
} \
fprintf (FILE, "\tbx "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "\n"); \
} while (0);
diff --git a/gcc/config/i960/i960.md b/gcc/config/i960/i960.md
index a4aae0f252a..c99c6c1fdc9 100644
--- a/gcc/config/i960/i960.md
+++ b/gcc/config/i960/i960.md
@@ -2287,6 +2287,95 @@
"* return i960_output_ret_insn (insn);"
[(set_attr "type" "branch")])
+;; A return instruction. Used only by nonlocal_goto to change the
+;; stack pointer, frame pointer, previous frame pointer and the return
+;; instruction pointer.
+(define_insn "ret"
+ [(use (reg:SI 16))
+ (unspec_volatile [(const_int 0)] 3)]
+ ""
+ "ret"
+ [(set_attr "type" "branch")
+ (set_attr "length" "1")])
+
+(define_expand "nonlocal_goto"
+ [(match_operand:SI 0 "" "")
+ (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_operand" "")
+ (match_operand:SI 3 "general_operand" "")]
+ ""
+ "
+{
+ rtx fp = operands[1];
+ rtx new_pc = operands[3];
+ rtx stack = operands[2];
+ rtx val = operands[0];
+
+ /* This code isn't sufficient to make nonlocal_gotos for nested
+ functions to work fully. Here we assume that the passed frame
+ pointer is a real hard frame pointer, not a
+ virtual_stack_vars_rtx type of frame. */
+
+ /* We must restore the stack pointer, frame pointer, previous frame
+ pointer and the return instruction pointer. Since the ret
+ instruction does all this for us with one instruction, we arrange
+ everything so that ret will do everything we need done. */
+
+ if (GET_CODE (fp) != REG)
+ fp = force_reg (Pmode, fp);
+ if (GET_CODE (val) != REG)
+ val = force_reg (Pmode, val);
+ if (GET_CODE (new_pc) != REG)
+ new_pc = force_reg (Pmode, new_pc);
+
+
+ /* First, we must flush the register windows, so that we can modify
+ the saved local registers on the stack directly and because we
+ are going to change the previous frame pointer. */
+
+ emit_insn (gen_flush_register_windows ());
+
+ /* Next, we put the address that we want to transfer to, into the
+ saved $rip value on the stack. Once we ret below, that value
+ will be loaded into the pc (IP). */
+
+ emit_move_insn (gen_rtx (MEM, SImode,
+ plus_constant (fp, 8)),
+ new_pc);
+
+ /* Next, we put the value into the static chain register's save
+ area on the stack. After the ret below, this will be loaded into
+ r3 (the static chain). */
+
+ emit_move_insn (gen_rtx (MEM, SImode,
+ plus_constant (fp, 12)),
+ val);
+
+ /* We now load pfp (the previous frame pointer) with the value that
+ we want fp to be. */
+
+ emit_move_insn (gen_rtx (REG, SImode, 16), fp);
+
+ /* And finally, we can now just ret to get all the values saved
+ above into all the right registers, and also, all the local
+ register that were in use in the function, are restored from
+ their saved values (from the call instruction) on the stack
+ because we are very careful to ret from the exact save area in
+ use during the original call. */
+
+ emit_insn (gen_ret ());
+ emit_barrier ();
+ DONE;
+}")
+
+;; Special insn to flush register windows.
+(define_insn "flush_register_windows"
+ [(unspec_volatile [(const_int 0)] 1)]
+ ""
+ "flushreg"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
(define_insn "nop"
[(const_int 0)]
""
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 3f800578e5c..41f7ce330ce 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -19,7 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
@@ -729,10 +729,7 @@ move_double_src_operand (op, int_mode)
{
case CONST_INT :
case CONST_DOUBLE :
- if (mode == DFmode)
- return easy_df_const (op);
- else
- return easy_di_const (op);
+ return 1;
case REG :
return register_operand (op, mode);
case SUBREG :
@@ -901,7 +898,7 @@ m32r_select_cc_mode (op, x, y)
int op;
rtx x, y;
{
- return (int)CCmode;
+ return (int)SImode;
}
/* X and Y are two things to compare using CODE. Emit the compare insn and
@@ -1115,6 +1112,123 @@ gen_compare (int_code, x, y, need_compare)
return gen_rtx (branch_code, VOIDmode, cc_reg, CONST0_RTX (mode));
}
+/* Split a 2 word move (DI or DF) into component parts. */
+
+rtx
+gen_split_move_double (operands)
+ rtx operands[];
+{
+ enum machine_mode mode = GET_MODE (operands[0]);
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ rtx val;
+
+ start_sequence ();
+ if (GET_CODE (dest) == REG || GET_CODE (dest) == SUBREG)
+ {
+ /* reg = reg */
+ if (GET_CODE (src) == REG || GET_CODE (src) == SUBREG)
+ {
+ /* We normally copy the low-numbered register first. However, if
+ the first register operand 0 is the same as the second register of
+ operand 1, we must copy in the opposite order. */
+ int reverse = (REGNO (operands[0]) == REGNO (operands[1]) + 1);
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operand_subword (dest, reverse, TRUE, mode),
+ operand_subword (src, reverse, TRUE, mode)));
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operand_subword (dest, !reverse, TRUE, mode),
+ operand_subword (src, !reverse, TRUE, mode)));
+ }
+
+ /* reg = constant */
+ else if (GET_CODE (src) == CONST_INT || GET_CODE (src) == CONST_DOUBLE)
+ {
+ rtx words[2];
+ split_double (src, &words[0], &words[1]);
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operand_subword (dest, 0, TRUE, mode),
+ words[0]));
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operand_subword (dest, 1, TRUE, mode),
+ words[1]));
+ }
+
+ /* reg = mem */
+ else if (GET_CODE (src) == MEM)
+ {
+ /* If the high-address word is used in the address, we must load it
+ last. Otherwise, load it first. */
+ rtx addr = XEXP (src, 0);
+ int reverse = (refers_to_regno_p (REGNO (dest), REGNO (dest)+1,
+ addr, 0) != 0);
+
+ /* We used to optimize loads from single registers as
+
+ ld r1,r3+; ld r2,r3
+
+ if r3 were not used subsequently. However, the REG_NOTES aren't
+ propigated correctly by the reload phase, and it can cause bad
+ code to be generated. We could still try:
+
+ ld r1,r3+; ld r2,r3; addi r3,-4
+
+ which saves 2 bytes and doesn't force longword alignment. */
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operand_subword (dest, reverse, TRUE, mode),
+ change_address (src, SImode,
+ plus_constant (addr,
+ reverse * UNITS_PER_WORD))));
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operand_subword (dest, !reverse, TRUE, mode),
+ change_address (src, SImode,
+ plus_constant (addr,
+ (!reverse) * UNITS_PER_WORD))));
+ }
+
+ else
+ abort ();
+ }
+
+ /* mem = reg */
+ /* We used to optimize loads from single registers as
+
+ st r1,r3; st r2,+r3
+
+ if r3 were not used subsequently. However, the REG_NOTES aren't
+ propigated correctly by the reload phase, and it can cause bad
+ code to be generated. We could still try:
+
+ st r1,r3; st r2,+r3; addi r3,-4
+
+ which saves 2 bytes and doesn't force longword alignment. */
+ else if (GET_CODE (dest) == MEM
+ && (GET_CODE (src) == REG || GET_CODE (src) == SUBREG))
+ {
+ rtx addr = XEXP (dest, 0);
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ change_address (dest, SImode, addr),
+ operand_subword (src, 0, TRUE, mode)));
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ change_address (dest, SImode,
+ plus_constant (addr, UNITS_PER_WORD)),
+ operand_subword (src, 1, TRUE, mode)));
+ }
+
+ else
+ abort ();
+
+ val = gen_sequence ();
+ end_sequence ();
+ return val;
+}
+
+
/* Implements the FUNCTION_ARG_PARTIAL_NREGS macro. */
int
@@ -1298,7 +1412,6 @@ struct m32r_frame_info
unsigned int args_size; /* # bytes that outgoing arguments take up */
unsigned int reg_size; /* # bytes needed to store regs */
unsigned int var_size; /* # bytes that variables take up */
- unsigned int prolog_size; /* # bytes that the prologue takes up */
unsigned int gmask; /* mask of saved gp registers */
unsigned int save_fp; /* nonzero if fp must be saved */
unsigned int save_lr; /* nonzero if lr (return addr) must be saved */
@@ -1322,7 +1435,7 @@ static struct m32r_frame_info zero_frame_info;
&& (regs_ever_live[regno] && (!call_used_regs[regno] || interrupt_p)))
#define MUST_SAVE_FRAME_POINTER (regs_ever_live[FRAME_POINTER_REGNUM])
-#define MUST_SAVE_RETURN_ADDR (regs_ever_live[RETURN_ADDR_REGNUM])
+#define MUST_SAVE_RETURN_ADDR (regs_ever_live[RETURN_ADDR_REGNUM] || profile_flag)
#define SHORT_INSN_SIZE 2 /* size of small instructions */
#define LONG_INSN_SIZE 4 /* size of long instructions */
@@ -1338,7 +1451,7 @@ m32r_compute_frame_size (size)
{
int regno;
unsigned int total_size, var_size, args_size, pretend_size, extra_size;
- unsigned int reg_size, prolog_size, frame_size;
+ unsigned int reg_size, frame_size;
unsigned int gmask;
enum m32r_function_type fn_type;
int interrupt_p;
@@ -1349,7 +1462,6 @@ m32r_compute_frame_size (size)
extra_size = FIRST_PARM_OFFSET (0);
total_size = extra_size + pretend_size + args_size + var_size;
reg_size = 0;
- prolog_size = 0;
gmask = 0;
/* See if this is an interrupt handler. Call used registers must be saved
@@ -1379,33 +1491,8 @@ m32r_compute_frame_size (size)
handler will do the right thing if this changes total_size. */
total_size = M32R_STACK_ALIGN (total_size);
- /* Calculate prologue size. Obviously any changes to
- m32r_output_function_prologue must be mirrored here. */
- if (pretend_size)
- prolog_size += SHORT_INSN_SIZE; /* addi sp,-pretend_size */
-
- prolog_size += SHORT_INSN_SIZE * (reg_size / UNITS_PER_WORD); /* pushes */
frame_size = total_size - (pretend_size + reg_size);
- if (frame_size == 0)
- ; /* nothing to do */
- else if (frame_size <= 128)
- prolog_size += SHORT_INSN_SIZE; /* addi sp,-<frame> */
- else
- {
- if ((prolog_size % LONG_INSN_SIZE) != 0)
- prolog_size += SHORT_INSN_SIZE; /* nop */
-
- if (frame_size <= 32768)
- prolog_size += LONG_INSN_SIZE; /* add3 sp,sp,-<frame> */
- else
- prolog_size += (LONG_INSN_SIZE /* ld24 tmp,<frame>/sub sp,tmp */
- + SHORT_INSN_SIZE);
- }
-
- if (frame_pointer_needed)
- prolog_size += SHORT_INSN_SIZE; /* mv fp,sp */
-
/* Save computed information. */
current_frame_info.total_size = total_size;
current_frame_info.extra_size = extra_size;
@@ -1413,7 +1500,6 @@ m32r_compute_frame_size (size)
current_frame_info.var_size = var_size;
current_frame_info.args_size = args_size;
current_frame_info.reg_size = reg_size;
- current_frame_info.prolog_size = prolog_size;
current_frame_info.gmask = gmask;
current_frame_info.initialized = reload_completed;
@@ -1431,74 +1517,37 @@ m32r_first_insn_address ()
if (! current_frame_info.initialized)
m32r_compute_frame_size (get_frame_size ());
- return current_frame_info.prolog_size;
+ return 0;
}
-/* Set up the stack and frame pointer (if desired) for the function.
- Note, if this is changed, you need to mirror the changes in
- m32r_compute_frame_size which calculates the prolog size. */
+/* Expand the m32r prologue as a series of insns. */
void
-m32r_output_function_prologue (file, size)
- FILE * file;
- int size;
+m32r_expand_prologue ()
{
int regno;
- int total_size, frame_size;
- char *sp_str = reg_names[STACK_POINTER_REGNUM];
- char *fp_str = reg_names[FRAME_POINTER_REGNUM];
+ int frame_size;
unsigned int gmask = current_frame_info.gmask;
- enum m32r_function_type fn_type = m32r_compute_function_type (current_function_decl);
-
- /* If this is an interrupt handler, mark it as such. */
- if (M32R_INTERRUPT_P (fn_type))
- {
- fprintf (file, "\t%s interrupt handler\n",
- ASM_COMMENT_START);
- }
- total_size = (! current_frame_info.initialized
- ? m32r_compute_frame_size (size)
- : current_frame_info.total_size);
+ if (! current_frame_info.initialized)
+ m32r_compute_frame_size (get_frame_size ());
- /* This is only for the human reader. */
- fprintf (file,
- "\t%s BEGIN PROLOGUE, vars= %d, regs= %d, args= %d, extra= %d, prolog= %d\n",
- ASM_COMMENT_START,
- current_frame_info.var_size,
- current_frame_info.reg_size / 4,
- current_frame_info.args_size,
- current_frame_info.extra_size,
- current_frame_info.prolog_size);
+ gmask = current_frame_info.gmask;
/* These cases shouldn't happen. Catch them now. */
- if (total_size == 0 && gmask)
+ if (current_frame_info.total_size == 0 && gmask)
abort ();
-#if 1
/* Allocate space for register arguments if this is a variadic function. */
if (current_frame_info.pretend_size != 0)
- fprintf (file, "\taddi %s,%s%d\n",
- sp_str, IMMEDIATE_PREFIX,
- -current_frame_info.pretend_size);
-#else
- /* If there are unnamed args in registers, save them. */
- if (current_function_stdarg || current_function_varargs)
- {
- int i;
- fprintf (file, "\taddi %s,%s%d\n",
- sp_str, IMMEDIATE_PREFIX,
- - M32R_MAX_PARM_REGS * UNITS_PER_WORD);
- for (i = 0; i < M32R_MAX_PARM_REGS; ++i)
- fprintf (file, "\tst %s,@(sp,%d)\n",
- reg_names[i], i * UNITS_PER_WORD);
- }
-#endif
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-current_frame_info.pretend_size)));
/* Save any registers we need to and set up fp. */
if (current_frame_info.save_fp)
- fprintf (file, "\tpush %s\n", fp_str);
+ emit_insn (gen_movsi_push (stack_pointer_rtx, frame_pointer_rtx));
gmask &= ~(FRAME_POINTER_MASK | RETURN_ADDR_MASK);
@@ -1507,33 +1556,68 @@ m32r_output_function_prologue (file, size)
for (regno = 0; regno <= M32R_MAX_INT_REGS; ++regno)
{
if ((gmask & (1 << regno)) != 0)
- fprintf (file, "\tpush %s\n", reg_names[regno]);
+ emit_insn (gen_movsi_push (stack_pointer_rtx,
+ gen_rtx_REG (Pmode, regno)));
}
if (current_frame_info.save_lr)
- fprintf (file, "\tpush %s\n", reg_names[RETURN_ADDR_REGNUM]);
+ emit_insn (gen_movsi_push (stack_pointer_rtx,
+ gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM)));
/* Allocate the stack frame. */
- frame_size = total_size - (current_frame_info.pretend_size
- + current_frame_info.reg_size);
+ frame_size = (current_frame_info.total_size
+ - (current_frame_info.pretend_size
+ + current_frame_info.reg_size));
+
if (frame_size == 0)
; /* nothing to do */
- else if (frame_size <= 128)
- fprintf (file, "\taddi %s,%s%d\n",
- sp_str, IMMEDIATE_PREFIX, -frame_size);
else if (frame_size <= 32768)
- fprintf (file, "\tadd3 %s,%s,%s%d\n",
- sp_str, sp_str, IMMEDIATE_PREFIX, -frame_size);
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (-frame_size)));
else
- fprintf (file, "\tld24 %s,%s%d\n\tsub %s,%s\n",
- reg_names[PROLOGUE_TMP_REGNUM],
- IMMEDIATE_PREFIX, frame_size,
- sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
+ {
+ rtx tmp = gen_rtx_REG (Pmode, PROLOGUE_TMP_REGNUM);
+ emit_insn (gen_movsi (tmp, GEN_INT (frame_size)));
+ emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, tmp));
+ }
if (frame_pointer_needed)
- fprintf (file, "\tmv %s,%s\n", fp_str, sp_str);
+ emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx));
- fprintf (file, "\t%s END PROLOGUE\n", ASM_COMMENT_START);
+ if (profile_flag || profile_block_flag)
+ emit_insn (gen_blockage ());
+}
+
+
+/* Set up the stack and frame pointer (if desired) for the function.
+ Note, if this is changed, you need to mirror the changes in
+ m32r_compute_frame_size which calculates the prolog size. */
+
+void
+m32r_output_function_prologue (file, size)
+ FILE * file;
+ int size;
+{
+ enum m32r_function_type fn_type = m32r_compute_function_type (current_function_decl);
+
+ /* If this is an interrupt handler, mark it as such. */
+ if (M32R_INTERRUPT_P (fn_type))
+ {
+ fprintf (file, "\t%s interrupt handler\n",
+ ASM_COMMENT_START);
+ }
+
+ if (! current_frame_info.initialized)
+ m32r_compute_frame_size (size);
+
+ /* This is only for the human reader. */
+ fprintf (file,
+ "\t%s PROLOGUE, vars= %d, regs= %d, args= %d, extra= %d\n",
+ ASM_COMMENT_START,
+ current_frame_info.var_size,
+ current_frame_info.reg_size / 4,
+ current_frame_info.args_size,
+ current_frame_info.extra_size);
}
/* Do any necessary cleanup after a function to restore stack, frame,
@@ -1695,8 +1779,26 @@ m32r_print_operand (file, x, code)
rtx x;
int code;
{
+ rtx addr;
+
switch (code)
{
+ /* The 's' and 'p' codes are used by output_block_move() to
+ indicate post-increment 's'tores and 'p're-increment loads. */
+ case 's':
+ if (GET_CODE (x) == REG)
+ fprintf (file, "@+%s", reg_names [REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand to %s code");
+ return;
+
+ case 'p':
+ if (GET_CODE (x) == REG)
+ fprintf (file, "@%s+", reg_names [REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand to %p code");
+ return;
+
case 'R' :
/* Write second word of DImode or DFmode reference,
register or memory. */
@@ -1736,7 +1838,7 @@ m32r_print_operand (file, x, code)
rtx first, second;
split_double (x, &first, &second);
- fprintf (file, "0x%08lx",
+ fprintf (file, "0x%08x",
code == 'L' ? INTVAL (first) : INTVAL (second));
}
else
@@ -1866,16 +1968,34 @@ m32r_print_operand (file, x, code)
break;
case MEM :
- fprintf (file, "@(");
- if (GET_CODE (XEXP (x, 0)) == PRE_INC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0),
- GET_MODE_SIZE (GET_MODE (x))));
- else if (GET_CODE (XEXP (x, 0)) == PRE_DEC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0),
- - GET_MODE_SIZE (GET_MODE (x))));
+ addr = XEXP (x, 0);
+ if (GET_CODE (addr) == PRE_INC)
+ {
+ if (GET_CODE (XEXP (addr, 0)) != REG)
+ abort ();
+
+ fprintf (file, "@+%s", reg_names[REGNO (XEXP (addr, 0))]);
+ }
+ else if (GET_CODE (addr) == PRE_DEC)
+ {
+ if (GET_CODE (XEXP (addr, 0)) != REG)
+ abort ();
+
+ fprintf (file, "@-%s", reg_names[REGNO (XEXP (addr, 0))]);
+ }
+ else if (GET_CODE (addr) == POST_INC)
+ {
+ if (GET_CODE (XEXP (addr, 0)) != REG)
+ abort ();
+
+ fprintf (file, "@%s+", reg_names[REGNO (XEXP (addr, 0))]);
+ }
else
- output_address (XEXP (x, 0));
- fputc (')', file);
+ {
+ fputs ("@(", file);
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ }
break;
case CONST_DOUBLE :
@@ -1975,11 +2095,16 @@ m32r_print_operand_address (file, addr)
fputs (reg_names[REGNO (XEXP (addr, 0))], file);
break;
- case PRE_INC :
- case PRE_DEC :
- /* We shouldn't get here as we've lost the mode of the memory object
- (which says how much to inc/dec by). */
- abort ();
+ case PRE_INC : /* Assume SImode */
+ fprintf (file, "+%s", reg_names[REGNO (XEXP (addr, 0))]);
+ break;
+
+ case PRE_DEC : /* Assume SImode */
+ fprintf (file, "-%s", reg_names[REGNO (XEXP (addr, 0))]);
+ break;
+
+ case POST_INC : /* Assume SImode */
+ fprintf (file, "%s+", reg_names[REGNO (XEXP (addr, 0))]);
break;
default :
@@ -2041,7 +2166,7 @@ carry_compare_operand (op, int_mode)
{
rtx x;
- if (GET_MODE (op) != CCmode && GET_MODE (op) != VOIDmode)
+ if (GET_MODE (op) != SImode && GET_MODE (op) != VOIDmode)
return FALSE;
if (GET_CODE (op) != NE && GET_CODE (op) != EQ)
@@ -2070,7 +2195,8 @@ emit_cond_move (operands, insn)
rtx insn;
{
static char buffer [100];
-
+ char * dest = reg_names [REGNO (operands [0])];
+
buffer [0] = 0;
/* Destination must be a register. */
@@ -2081,7 +2207,6 @@ emit_cond_move (operands, insn)
if (! conditional_move_operand (operands [3], SImode))
abort();
-
/* Check to see if the test is reversed. */
if (GET_CODE (operands [1]) == NE)
{
@@ -2090,24 +2215,260 @@ emit_cond_move (operands, insn)
operands [3] = tmp;
}
- /* Catch a special case where 0 or 1 is being loaded into the destination.
- Since we already have these values in the C bit we can use a special
- instruction. */
- if (zero_and_one (operands [2], operands [3]))
+ sprintf (buffer, "mvfc %s, cbr", dest);
+
+ /* If the true value was '0' then we need to invert the results of the move. */
+ if (INTVAL (operands [2]) == 0)
+ sprintf (buffer + strlen (buffer), "\n\txor3 %s, %s, #1",
+ dest, dest);
+
+ return buffer;
+}
+
+
+
+/* Use a library function to move some bytes. */
+static void
+block_move_call (dest_reg, src_reg, bytes_rtx)
+ rtx dest_reg;
+ rtx src_reg;
+ rtx bytes_rtx;
+{
+ /* We want to pass the size as Pmode, which will normally be SImode
+ but will be DImode if we are using 64 bit longs and pointers. */
+ if (GET_MODE (bytes_rtx) != VOIDmode
+ && GET_MODE (bytes_rtx) != Pmode)
+ bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
+
+#ifdef TARGET_MEM_FUNCTIONS
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0,
+ VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
+ convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
+ TREE_UNSIGNED (sizetype)),
+ TYPE_MODE (sizetype));
+#else
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "bcopy"), 0,
+ VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
+ convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
+ TREE_UNSIGNED (integer_type_node)),
+ TYPE_MODE (integer_type_node));
+#endif
+}
+
+/* The maximum number of bytes to copy using pairs of load/store instructions.
+ If a block is larger than this then a loop will be generated to copy
+ MAX_MOVE_BYTES chunks at a time. The value of 32 is a semi-arbitary choice.
+ A customer uses Dhrystome as their benchmark, and Dhrystone has a 31 byte
+ string copy in it. */
+#define MAX_MOVE_BYTES 32
+
+/* Expand string/block move operations.
+
+ operands[0] is the pointer to the destination.
+ operands[1] is the pointer to the source.
+ operands[2] is the number of bytes to move.
+ operands[3] is the alignment. */
+
+void
+m32r_expand_block_move (operands)
+ rtx operands[];
+{
+ rtx orig_dst = operands[0];
+ rtx orig_src = operands[1];
+ rtx bytes_rtx = operands[2];
+ rtx align_rtx = operands[3];
+ int constp = GET_CODE (bytes_rtx) == CONST_INT;
+ HOST_WIDE_INT bytes = constp ? INTVAL (bytes_rtx) : 0;
+ int align = INTVAL (align_rtx);
+ int leftover;
+ rtx src_reg;
+ rtx dst_reg;
+
+ if (constp && bytes <= 0)
+ return;
+
+ /* Move the address into scratch registers. */
+ dst_reg = copy_addr_to_reg (XEXP (orig_dst, 0));
+ src_reg = copy_addr_to_reg (XEXP (orig_src, 0));
+
+ if (align > UNITS_PER_WORD)
+ align = UNITS_PER_WORD;
+
+ /* If we prefer size over speed, always use a function call.
+ If we do not know the size, use a function call.
+ If the blocks are not word aligned, use a function call. */
+ if (optimize_size || ! constp || align != UNITS_PER_WORD)
{
- char * dest = reg_names [REGNO (operands [0])];
+ block_move_call (dst_reg, src_reg, bytes_rtx);
+ return;
+ }
+
+ leftover = bytes % MAX_MOVE_BYTES;
+ bytes -= leftover;
+
+ /* If necessary, generate a loop to handle the bulk of the copy. */
+ if (bytes)
+ {
+ rtx label;
+ rtx final_src;
- sprintf (buffer, "mvfc %s, cbr", dest);
+ bytes_rtx = GEN_INT (MAX_MOVE_BYTES);
- /* If the true value was '0' then we need to invert the results of the move. */
- if (INTVAL (operands [2]) == 0)
- sprintf (buffer + strlen (buffer), "\n\txor3 %s, %s, #1",
- dest, dest);
+ /* If we are going to have to perform this loop more than
+ once, then generate a label and compute the address the
+ source register will contain upon completion of the final
+ itteration. */
+ if (bytes > MAX_MOVE_BYTES)
+ {
+ final_src = gen_reg_rtx (Pmode);
+
+ if (INT16_P(bytes))
+ emit_insn (gen_addsi3 (final_src, src_reg, bytes_rtx));
+ else
+ {
+ emit_insn (gen_movsi (final_src, bytes_rtx));
+ emit_insn (gen_addsi3 (final_src, final_src, src_reg));
+ }
+
+ label = gen_label_rtx ();
+ emit_label (label);
+ }
+
+ /* It is known that output_block_move() will update src_reg to point
+ to the word after the end of the source block, and dst_reg to point
+ to the last word of the destination block, provided that the block
+ is MAX_MOVE_BYTES long. */
+ emit_insn (gen_movstrsi_internal (dst_reg, src_reg, bytes_rtx));
+ emit_insn (gen_addsi3 (dst_reg, dst_reg, GEN_INT (4)));
- return buffer;
+ if (bytes > MAX_MOVE_BYTES)
+ {
+ emit_insn (gen_cmpsi (src_reg, final_src));
+ emit_jump_insn (gen_bne (label));
+ }
}
+ if (leftover)
+ emit_insn (gen_movstrsi_internal (dst_reg, src_reg, GEN_INT (leftover)));
+}
- return buffer;
+
+/* Emit load/stores for a small constant word aligned block_move.
+
+ operands[0] is the memory address of the destination.
+ operands[1] is the memory address of the source.
+ operands[2] is the number of bytes to move.
+ operands[3] is a temp register.
+ operands[4] is a temp register. */
+
+char *
+m32r_output_block_move (insn, operands)
+ rtx insn;
+ rtx operands[];
+{
+ HOST_WIDE_INT bytes = INTVAL (operands[2]);
+ int first_time;
+ int got_extra = 0;
+
+ if (bytes < 1 || bytes > MAX_MOVE_BYTES)
+ abort ();
+
+ /* We do not have a post-increment store available, so the first set of
+ stores are done without any increment, then the remaining ones can use
+ the pre-increment addressing mode.
+
+ Note: expand_block_move() also relies upon this behaviour when building
+ loops to copy large blocks. */
+ first_time = 1;
+
+ while (bytes > 0)
+ {
+ if (bytes >= 8)
+ {
+ if (first_time)
+ {
+ output_asm_insn ("ld\t%3, %p1", operands);
+ output_asm_insn ("ld\t%4, %p1", operands);
+ output_asm_insn ("st\t%3, @%0", operands);
+ output_asm_insn ("st\t%4, %s0", operands);
+ }
+ else
+ {
+ output_asm_insn ("ld\t%3, %p1", operands);
+ output_asm_insn ("ld\t%4, %p1", operands);
+ output_asm_insn ("st\t%3, %s0", operands);
+ output_asm_insn ("st\t%4, %s0", operands);
+ }
+
+ bytes -= 8;
+ }
+ else if (bytes >= 4)
+ {
+ if (bytes > 4)
+ got_extra = 1;
+
+ output_asm_insn ("ld\t%3, %p1", operands);
+
+ if (got_extra)
+ output_asm_insn ("ld\t%4, %p1", operands);
+
+ if (first_time)
+ output_asm_insn ("st\t%3, @%0", operands);
+ else
+ output_asm_insn ("st\t%3, %s0", operands);
+
+ bytes -= 4;
+ }
+ else
+ {
+ /* Get the entire next word, even though we do not want all of it.
+ The saves us from doing several smaller loads, and we assume that
+ we cannot cause a page fault when at least part of the word is in
+ valid memory. If got_extra is true then we have already loaded
+ the next word as part of loading and storing the previous word. */
+ if (! got_extra)
+ output_asm_insn ("ld\t%4, @%1", operands);
+
+ if (bytes >= 2)
+ {
+ bytes -= 2;
+
+ output_asm_insn ("sth\t%4, @%0", operands);
+
+ /* If there is a byte left to store then increment the
+ destination address and shift the contents of the source
+ register down by 16 bits. We could not do the address
+ increment in the store half word instruction, because it does
+ not have an auto increment mode. */
+ if (bytes > 0) /* assert (bytes == 1) */
+ {
+ output_asm_insn ("srai\t%4, #16", operands);
+ output_asm_insn ("addi\t%0, #2", operands);
+ }
+ }
+
+ output_asm_insn ("stb\t%4, @%0", operands);
+
+ bytes = 0;
+ }
+
+ first_time = 0;
+ }
+
+ return "";
}
+/* Return true if op is an integer constant, less than or equal to
+ MAX_MOVE_BYTES. */
+int
+m32r_block_immediate_operand (op, mode)
+ rtx op;
+ int mode;
+{
+ if (GET_CODE (op) != CONST_INT
+ || INTVAL (op) > MAX_MOVE_BYTES
+ || INTVAL (op) <= 0)
+ return 0;
+
+ return 1;
+}
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index e5dfc20ebe3..382f66ef978 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -72,11 +72,11 @@ Boston, MA 02111-1307, USA. */
#endif
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%{!shared:crt0.o%s crtsysc.o%s} crtinit.o%s"
+#define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s"
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "crtfini.o%s"
+#define ENDFILE_SPEC "-lgloss crtfini.o%s"
#undef LIB_SPEC
@@ -434,7 +434,7 @@ if (GET_MODE_CLASS (MODE) == MODE_INT \
#define FIXED_REGISTERS \
{ 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 1, \
- 1, 0 }
+ 1, 1 }
/* 1 for registers not available across function calls.
@@ -606,16 +606,17 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define INT32_P(X) ((X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \
&& (X) <= (unsigned HOST_WIDE_INT) 0xffffffff)
#define UINT5_P(X) ((unsigned) (X) < 32)
+#define INVERTED_SIGNED_8BIT(VAL) ((VAL) >= -127 && (VAL) <= 128)
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
-((C) == 'I' ? INT8_P (VALUE) \
- : (C) == 'J' ? INT16_P (VALUE) \
- : (C) == 'K' ? UINT16_P (VALUE) \
- : (C) == 'L' ? UPPER16_P (VALUE) \
- : (C) == 'M' ? UINT24_P (VALUE) \
- : (C) == 'N' ? INT32_P (VALUE) \
- : (C) == 'O' ? UINT5_P (VALUE) \
- : (C) == 'P' ? CMP_INT16_P (VALUE) \
+#define CONST_OK_FOR_LETTER_P(VALUE, C) \
+((C) == 'I' ? INT8_P (VALUE) \
+ : (C) == 'J' ? INT16_P (VALUE) \
+ : (C) == 'K' ? UINT16_P (VALUE) \
+ : (C) == 'L' ? UPPER16_P (VALUE) \
+ : (C) == 'M' ? UINT24_P (VALUE) \
+ : (C) == 'N' ? INVERTED_SIGNED_8BIT (VALUE) \
+ : (C) == 'O' ? UINT5_P (VALUE) \
+ : (C) == 'P' ? CMP_INT16_P (VALUE) \
: 0)
/* Similar, but for floating constants, and defining letters G and H.
@@ -623,8 +624,8 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
For the m32r, handle a few constants inline.
??? We needn't treat DI and DF modes differently, but for now we do. */
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
-((C) == 'G' ? easy_di_const (VALUE) \
- : (C) == 'H' ? easy_df_const (VALUE) \
+((C) == 'G' ? easy_di_const (VALUE) \
+ : (C) == 'H' ? easy_df_const (VALUE) \
: 0)
/* A C expression that defines the optional machine-dependent constraint
@@ -635,19 +636,25 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
be 0 regardless of VALUE. */
/* Q is for symbolic addresses loadable with ld24.
R is for symbolic addresses when ld24 can't be used.
- S is for an 8 bit signed integer in the range +128 to -127 */
-
-#define INVERTED_SIGNED_8BIT(VAL) ((VAL) >= -127 && (VAL) <= 128)
-
-#define EXTRA_CONSTRAINT(VALUE, C) \
-((C) == 'Q' \
- ? ((TARGET_ADDR24 && GET_CODE (VALUE) == LABEL_REF) \
- || addr24_operand (VALUE, VOIDmode)) \
- : (C) == 'R' \
- ? ((TARGET_ADDR32 && GET_CODE (VALUE) == LABEL_REF) \
- || addr32_operand (VALUE, VOIDmode)) \
- : (C) == 'S' \
- ? ((GET_CODE (VALUE) == CONST_INT) && INVERTED_SIGNED_8BIT (INTVAL (VALUE))) \
+ S is unused.
+ T is for indirect of a pointer.
+ U is for pushes and pops of the stack pointer. */
+
+#define EXTRA_CONSTRAINT(VALUE, C) \
+((C) == 'Q' \
+ ? ((TARGET_ADDR24 && GET_CODE (VALUE) == LABEL_REF) \
+ || addr24_operand (VALUE, VOIDmode)) \
+ : (C) == 'R' \
+ ? ((TARGET_ADDR32 && GET_CODE (VALUE) == LABEL_REF) \
+ || addr32_operand (VALUE, VOIDmode)) \
+ : (C) == 'S' \
+ ? 0 \
+ : (C) == 'T' \
+ ? (GET_CODE (VALUE) == MEM \
+ && memreg_operand (VALUE, GET_MODE (VALUE))) \
+ : (C) == 'U' \
+ ? (GET_CODE (VALUE) == MEM \
+ && PUSH_POP_P (GET_MODE (VALUE), XEXP (VALUE, 0))) \
: 0)
/* Stack layout and stack pointer usage. */
@@ -836,6 +843,12 @@ M32R_STACK_ALIGN (current_function_outgoing_args_size)
SIZE is the number of bytes of arguments passed on the stack. */
#define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
+/* Nonzero if we do not know how to pass TYPE solely in registers. */
+#define MUST_PASS_IN_STACK(MODE,TYPE) \
+ ((TYPE) != 0 \
+ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
+ || TREE_ADDRESSABLE (TYPE)))
+
/* Define a data type for recording info about an argument list
during the scan of that argument list. This data type should
hold all necessary information about the function itself
@@ -1069,7 +1082,7 @@ m32r_output_function_epilogue (FILE, SIZE)
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
-#define FUNCTION_PROFILER(FILE, LABELNO)
+#define FUNCTION_PROFILER(FILE, LABELNO) abort ()
/* Trampolines. */
@@ -1184,24 +1197,37 @@ do { \
(GET_CODE (X) == CONST_INT && INT16_P (INTVAL (X)))
/* local to this file */
-#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
-(GET_CODE (X) == PLUS \
- && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
+#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
+(GET_CODE (X) == PLUS \
+ && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
&& RTX_OK_FOR_OFFSET_P (XEXP (X, 1)))
/* local to this file */
-#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \
-(GET_CODE (X) == LO_SUM \
- && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
+/* For LO_SUM addresses, do not allow them if the MODE is > 1 word,
+ since more than one instruction will be required. */
+#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \
+(GET_CODE (X) == LO_SUM \
+ && (MODE != BLKmode && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \
+ && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
&& CONSTANT_P (XEXP (X, 1)))
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ if (RTX_OK_FOR_BASE_P (X)) \
- goto ADDR; \
- if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X))) \
- goto ADDR; \
- if (LEGITIMATE_LO_SUM_ADDRESS_P ((MODE), (X))) \
- goto ADDR; \
+/* local to this file */
+/* Memory address that is a push/pop of the stack pointer. */
+#define PUSH_POP_P(MODE, X) \
+((MODE) == SImode \
+ && (GET_CODE (X) == POST_INC \
+ || GET_CODE (X) == PRE_INC \
+ || GET_CODE (X) == PRE_DEC))
+
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+{ if (RTX_OK_FOR_BASE_P (X)) \
+ goto ADDR; \
+ if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X))) \
+ goto ADDR; \
+ if (LEGITIMATE_LO_SUM_ADDRESS_P ((MODE), (X))) \
+ goto ADDR; \
+ if (PUSH_POP_P ((MODE), (X))) \
+ goto ADDR; \
}
/* Try machine-dependent ways of modifying an illegitimate address
@@ -1223,14 +1249,13 @@ do { \
/* Go to LABEL if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for. */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
-do { \
- if (GET_CODE (ADDR) == PRE_DEC) \
- goto LABEL; \
- if (GET_CODE (ADDR) == PRE_INC) \
- goto LABEL; \
- if (GET_CODE (ADDR) == POST_INC) \
- goto LABEL; \
+#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
+do { \
+ if (GET_CODE (ADDR) == PRE_DEC \
+ || GET_CODE (ADDR) == PRE_INC \
+ || GET_CODE (ADDR) == POST_INC \
+ || GET_CODE (ADDR) == LO_SUM) \
+ goto LABEL; \
} while (0)
/* Condition code usage. */
@@ -1286,7 +1311,7 @@ do { \
/* Compute the cost of moving data between registers and memory. */
/* Memory is 3 times as expensive as registers.
??? Is that the right way to look at it? */
-#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
+#define MEMORY_MOVE_COST(MODE,CLASS,IN_P) \
(GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12)
/* The cost of a branch insn. */
@@ -1355,7 +1380,10 @@ do { \
#define HAIFA_P 0
#endif
-/* Indicate how many instructions can be issued at the same time. */
+/* Indicate how many instructions can be issued at the same time.
+ This is 1/2 of a lie. The m32r can issue only 1 long insn at
+ once, but 2. However doing so allows the scheduler to group
+ the two short insns together. */
#define ISSUE_RATE 2
/* When the `length' insn attribute is used, this macro specifies the
@@ -1635,6 +1663,32 @@ do { \
fprintf (FILE, "%s%s", USER_LABEL_PREFIX, real_name); \
} while (0)
+/* If -Os, don't force line number labels to begin at the beginning of
+ the word; we still want the assembler to try to put things in parallel,
+ should that be possible.
+ For m32r/d, instructions are never in parallel (other than with a nop)
+ and the simulator and stub both handle a breakpoint in the middle of
+ a word so don't ever force line number labels to begin at the beginning
+ of a word. */
+
+#undef ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+do \
+ { \
+ static int sym_lineno = 1; \
+ fprintf (file, ".stabn 68,0,%d,.LM%d-", \
+ line, sym_lineno); \
+ assemble_name (file, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
+ fprintf (file, \
+ (optimize_size || TARGET_M32R) \
+ ? "\n\t.debugsym .LM%d\n" \
+ : "\n.LM%d:\n", \
+ sym_lineno); \
+ sym_lineno += 1; \
+ } \
+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. */
@@ -1869,7 +1923,7 @@ do { \
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
/* ??? The M32R doesn't have full 32 bit pointers, but making this PSImode has
- it's own problems (you have to add extendpsisi2 and truncsipsi2).
+ its own problems (you have to add extendpsisi2 and truncsipsi2).
Try to avoid it. */
#define Pmode SImode
@@ -1933,6 +1987,7 @@ enum m32r_function_type
{ "cmp_int16_operand", { CONST_INT }}, \
{ "call_address_operand", { SYMBOL_REF, LABEL_REF, CONST }}, \
{ "small_insn_p", { INSN, CALL_INSN, JUMP_INSN }}, \
+{ "m32r_block_immediate_operand",{ CONST_INT }}, \
{ "large_insn_p", { INSN, CALL_INSN, JUMP_INSN }},
/* Functions declared in m32r.c */
@@ -1944,7 +1999,7 @@ enum m32r_function_type
#endif
#endif
-#ifdef BUFSIZE /* stdio.h has been included, ok to use FILE * */
+#ifdef BUFSIZ /* stdio.h has been included, ok to use FILE * */
#define STDIO_PROTO(ARGS) PROTO(ARGS)
#else
#define STDIO_PROTO(ARGS) ()
@@ -1998,6 +2053,7 @@ extern int small_insn_p PROTO((Rtx, int));
extern int large_insn_p PROTO((Rtx, int));
extern int m32r_select_cc_mode PROTO((int, Rtx, Rtx));
extern Rtx gen_compare PROTO((int, Rtx, Rtx, int));
+extern Rtx gen_split_move_double PROTO((Rtx *));
extern int function_arg_partial_nregs PROTO((CUMULATIVE_ARGS *,
int, Tree, int));
extern void m32r_setup_incoming_varargs PROTO((CUMULATIVE_ARGS *,
@@ -2008,6 +2064,7 @@ extern enum m32r_function_type m32r_compute_function_type
PROTO((Tree));
extern unsigned m32r_compute_frame_size PROTO((int));
extern int m32r_first_insn_address PROTO((void));
+extern void m32r_expand_prologue PROTO((void));
extern void m32r_output_function_prologue STDIO_PROTO((FILE *, int));
extern void m32r_output_function_epilogue STDIO_PROTO((FILE *, int));
extern void m32r_finalize_pic PROTO((void));
@@ -2022,3 +2079,7 @@ extern char *emit_cond_move PROTO((Rtx *, Rtx));
/* Needed by a peephole optimisation. */
#define PRESERVE_DEATH_INFO_REGNO_P(regno) (regno < FIRST_PSEUDO_REGISTER)
+
+extern char * m32r_output_block_move PROTO((Rtx, Rtx *));
+extern int m32r_block_immediate_operand PROTO((Rtx, int));
+extern void m32r_expand_block_move PROTO((Rtx *));
diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md
index 49f71d6edda..e1638903ad6 100644
--- a/gcc/config/m32r/m32r.md
+++ b/gcc/config/m32r/m32r.md
@@ -24,33 +24,20 @@
;; 0 - blockage
;; 1 - flush_icache
;; 2 - load_sda_base
+;; 3 - setting carry in addx/subx instructions.
;; Insn type. Used to default other attribute values.
-;; move4 = 4 byte move
(define_attr "type"
- "move,move4,load,store,unary,binary,compare,shift,mul,div,uncond_branch,branch,call,multi,misc"
+ "int2,int4,load2,load4,load8,store2,store4,store8,shift2,shift4,mul2,div4,uncond_branch,branch,call,multi,misc"
(const_string "misc"))
;; Length in bytes.
(define_attr "length" ""
- (cond [(eq_attr "type" "move,unary,shift,mul,div")
+ (cond [(eq_attr "type" "int2,load2,store2,shift2,mul2")
(const_int 2)
- (eq_attr "type" "binary")
- (if_then_else (match_operand 2 "register_operand" "")
- (const_int 2) (const_int 4))
-
- (eq_attr "type" "compare")
- (if_then_else (match_operand 1 "register_operand" "")
- (const_int 2) (const_int 4))
-
- (eq_attr "type" "load")
- (if_then_else (match_operand 1 "memreg_operand" "")
- (const_int 2) (const_int 4))
-
- (eq_attr "type" "store")
- (if_then_else (match_operand 0 "memreg_operand" "")
- (const_int 2) (const_int 4))
+ (eq_attr "type" "int4,load4,store4,shift4,div4")
+ (const_int 4)
(eq_attr "type" "multi")
(const_int 8)
@@ -69,10 +56,16 @@
;; Whether an instruction is 16-bit or 32-bit
(define_attr "insn_size" "short,long"
- (if_then_else (eq_attr "length" "2")
+ (if_then_else (eq_attr "type" "int2,load2,store2,shift2,mul2")
(const_string "short")
(const_string "long")))
+(define_attr "debug" "no,yes"
+ (const (symbol_ref "(TARGET_DEBUG != 0)")))
+
+(define_attr "opt_size" "no,yes"
+ (const (symbol_ref "(optimize_size != 0)")))
+
(define_attr "m32r" "no,yes"
(const (symbol_ref "(TARGET_M32R != 0)")))
@@ -196,39 +189,52 @@
;; (define_function_unit {name} {multiplicity} {simulataneity} {test}
;; {ready-delay} {issue-delay} [{conflict-list}])
-;; References to loaded registers should wait a cycle.
-;; Memory with load-delay of 1 (i.e. 2 cycle load).
-(define_function_unit "memory" 1 1 (eq_attr "type" "load") 2 0)
-
;; Hack to get GCC to better pack the instructions.
;; We pretend there is a separate long function unit that conflicts with
;; both the left and right 16 bit insn slots.
-(define_function_unit "left" 1 1
- (eq_attr "length" "2")
+(define_function_unit "short" 2 2
+ (and (eq_attr "m32r" "yes")
+ (and (eq_attr "insn_size" "short")
+ (eq_attr "type" "!load2")))
1 0
- [(not (eq_attr "length" "2"))])
+ [(eq_attr "insn_size" "long")])
-(define_function_unit "right" 1 1
- (eq_attr "length" "2")
- 1 0
- [(not (eq_attr "length" "2"))])
+(define_function_unit "short" 2 2 ;; load delay of 1 clock for mem execution + 1 clock for WB
+ (and (eq_attr "m32r" "yes")
+ (eq_attr "type" "load2"))
+ 3 0
+ [(eq_attr "insn_size" "long")])
(define_function_unit "long" 1 1
- (not (eq_attr "length" "2"))
+ (and (eq_attr "m32r" "yes")
+ (and (eq_attr "insn_size" "long")
+ (eq_attr "type" "!load4,load8")))
1 0
- [(eq_attr "length" "2")])
+ [(eq_attr "insn_size" "short")])
+
+(define_function_unit "long" 1 1 ;; load delay of 1 clock for mem execution + 1 clock for WB
+ (and (eq_attr "m32r" "yes")
+ (and (eq_attr "insn_size" "long")
+ (eq_attr "type" "load4,load8")))
+ 3 0
+ [(eq_attr "insn_size" "short")])
+
+
+
+;; Instruction grouping
;; Expand prologue as RTL
-;; ??? Unfinished.
-
-;(define_expand "prologue"
-; [(const_int 1)]
-; ""
-; "
-;{
-;}")
+(define_expand "prologue"
+ [(const_int 1)]
+ ""
+ "
+{
+ m32r_expand_prologue ();
+ DONE;
+}")
+
;; Move instructions.
;;
@@ -251,16 +257,19 @@
}")
(define_insn "*movqi_insn"
- [(set (match_operand:QI 0 "move_dest_operand" "=r,r,r,r,m")
- (match_operand:QI 1 "move_src_operand" "r,I,JQR,m,r"))]
+ [(set (match_operand:QI 0 "move_dest_operand" "=r,r,r,r,r,T,m")
+ (match_operand:QI 1 "move_src_operand" "r,I,JQR,T,m,r,r"))]
"register_operand (operands[0], QImode) || register_operand (operands[1], QImode)"
"@
mv %0,%1
ldi %0,%#%1
ldi %0,%#%1
ldub %0,%1
+ ldub %0,%1
+ stb %1,%0
stb %1,%0"
- [(set_attr "type" "move,move,move4,load,store")])
+ [(set_attr "type" "int2,int2,int4,load2,load4,store2,store4")
+ (set_attr "length" "2,2,4,2,4,2,4")])
(define_expand "movhi"
[(set (match_operand:HI 0 "general_operand" "")
@@ -275,8 +284,8 @@
}")
(define_insn "*movhi_insn"
- [(set (match_operand:HI 0 "move_dest_operand" "=r,r,r,r,r,m")
- (match_operand:HI 1 "move_src_operand" "r,I,JQR,K,m,r"))]
+ [(set (match_operand:HI 0 "move_dest_operand" "=r,r,r,r,r,r,T,m")
+ (match_operand:HI 1 "move_src_operand" "r,I,JQR,K,T,m,r,r"))]
"register_operand (operands[0], HImode) || register_operand (operands[1], HImode)"
"@
mv %0,%1
@@ -284,8 +293,23 @@
ldi %0,%#%1
ld24 %0,%#%1
lduh %0,%1
+ lduh %0,%1
+ sth %1,%0
sth %1,%0"
- [(set_attr "type" "move,move,move4,move4,load,store")])
+ [(set_attr "type" "int2,int2,int4,int4,load2,load4,store2,store4")
+ (set_attr "length" "2,2,4,4,2,4,2,4")])
+
+(define_expand "movsi_push"
+ [(set (mem:SI (pre_dec:SI (match_operand:SI 0 "register_operand" "")))
+ (match_operand:SI 1 "register_operand" ""))]
+ ""
+ "")
+
+(define_expand "movsi_pop"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (mem:SI (post_inc:SI (match_operand:SI 1 "register_operand" ""))))]
+ ""
+ "")
(define_expand "movsi"
[(set (match_operand:SI 0 "general_operand" "")
@@ -314,21 +338,60 @@
}
}")
-(define_insn "*movsi_insn"
- [(set (match_operand:SI 0 "move_dest_operand" "=r,r,r,r,r,r,r,m")
;; ??? Do we need a const_double constraint here for large unsigned values?
- (match_operand:SI 1 "move_src_operand" "r,I,J,MQ,L,N,m,r"))]
+(define_insn "*movsi_insn"
+ [(set (match_operand:SI 0 "move_dest_operand" "=r,r,r,r,r,r,r,r,r,T,U,m")
+ (match_operand:SI 1 "move_src_operand" "r,I,J,MQ,L,n,T,U,m,r,r,r"))]
"register_operand (operands[0], SImode) || register_operand (operands[1], SImode)"
- "@
- mv %0,%1
- ldi %0,%#%1 ; %X1
- ldi %0,%#%1 ; %X1
- ld24 %0,%#%1 ; %X1
- seth %0,%#%T1
- seth %0,%#%T1\;or3 %0,%0,%#%B1
- ld %0,%1
- st %1,%0"
- [(set_attr "type" "move,move,move4,move4,move4,multi,load,store")])
+ "*
+{
+ if (GET_CODE (operands[0]) == REG || GET_CODE (operands[1]) == SUBREG)
+ {
+ switch (GET_CODE (operands[1]))
+ {
+ HOST_WIDE_INT value;
+
+ default:
+ break;
+
+ case REG:
+ case SUBREG:
+ return \"mv %0,%1\";
+
+ case MEM:
+ return \"ld %0,%1\";
+
+ case CONST_INT:
+ value = INTVAL (operands[1]);
+ if (INT16_P (value))
+ return \"ldi %0,%#%1\\t; %X1\";
+
+ if (UINT24_P (value))
+ return \"ld24 %0,%#%1\\t; %X1\";
+
+ if (UPPER16_P (value))
+ return \"seth %0,%#%T1\\t; %X1\";
+
+ return \"#\";
+
+ case CONST:
+ case SYMBOL_REF:
+ case LABEL_REF:
+ if (TARGET_ADDR24)
+ return \"ld24 %0,%#%1\";
+
+ return \"#\";
+ }
+ }
+
+ else if (GET_CODE (operands[0]) == MEM
+ && (GET_CODE (operands[1]) == REG || GET_CODE (operands[1]) == SUBREG))
+ return \"st %1,%0\";
+
+ fatal_insn (\"bad movsi insn\", insn);
+}"
+ [(set_attr "type" "int2,int2,int4,int4,int4,multi,load2,load2,load4,store2,store2,store4")
+ (set_attr "length" "2,2,4,4,4,8,2,2,4,2,2,4")])
; Try to use a four byte / two byte pair for constants not loadable with
; ldi, ld24, seth.
@@ -376,6 +439,17 @@
operands[3] = GEN_INT ((val) & 0xffff);
}")
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "seth_add3_operand" "i"))]
+ "TARGET_ADDR32"
+ [(set (match_dup 0)
+ (high:SI (match_dup 1)))
+ (set (match_dup 0)
+ (lo_sum:SI (match_dup 0)
+ (match_dup 1)))]
+ "")
+
;; Small data area support.
;; The address of _SDA_BASE_ is loaded into a register and all objects in
;; the small data area are indexed off that. This is done for each reference
@@ -413,7 +487,8 @@
(unspec [(const_int 0)] 2))]
""
"ld24 %0,#_SDA_BASE_"
- [(set_attr "type" "move4")])
+ [(set_attr "type" "int4")
+ (set_attr "length" "4")])
;; 32 bit address support.
@@ -438,7 +513,8 @@
(high:SI (match_operand 1 "symbolic_operand" "")))]
""
"seth %0,%#shigh(%1)"
- [(set_attr "type" "move4")])
+ [(set_attr "type" "int4")
+ (set_attr "length" "4")])
(define_insn "lo_sum_si"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -446,7 +522,8 @@
(match_operand:SI 2 "immediate_operand" "in")))]
""
"add3 %0,%1,%#%B2"
- [(set_attr "length" "4")])
+ [(set_attr "type" "int4")
+ (set_attr "length" "4")])
(define_expand "movdi"
[(set (match_operand:DI 0 "general_operand" "")
@@ -458,85 +535,22 @@
if (GET_CODE (operands[0]) == MEM)
operands[1] = force_reg (DImode, operands[1]);
-
- if (CONSTANT_P (operands[1])
- && ! easy_di_const (operands[1]))
- {
- rtx mem = force_const_mem (DImode, operands[1]);
- rtx reg = ((reload_in_progress || reload_completed)
- ? copy_to_suggested_reg (XEXP (mem, 0),
- gen_rtx (REG, Pmode, REGNO (operands[0])),
- Pmode)
- : force_reg (Pmode, XEXP (mem, 0)));
- operands[1] = change_address (mem, DImode, reg);
- }
}")
(define_insn "*movdi_insn"
- [(set (match_operand:DI 0 "move_dest_operand" "=r,r,r,m")
- (match_operand:DI 1 "move_double_src_operand" "r,nG,m,r"))]
+ [(set (match_operand:DI 0 "move_dest_operand" "=r,r,r,r,m")
+ (match_operand:DI 1 "move_double_src_operand" "r,nG,F,m,r"))]
"register_operand (operands[0], DImode) || register_operand (operands[1], DImode)"
- "*
-{
- switch (which_alternative)
- {
- case 0 :
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register of
- operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"mv %R0,%R1\;mv %0,%1\";
- else
- return \"mv %0,%1\;mv %R0,%R1\";
- case 1 :
- return \"#\";
- case 2 :
- /* If the low-address word is used in the address, we must load it
- last. Otherwise, load it first. Note that we cannot have
- auto-increment in that case since the address register is known to be
- dead. */
- if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
- operands [1], 0))
- {
- return \"ld %R0,%R1\;ld %0,%1\";
- }
- else
- {
- /* Try to use auto-inc addressing if we can. */
- if (GET_CODE (XEXP (operands[1], 0)) == REG
- && dead_or_set_p (insn, XEXP (operands[1], 0)))
- {
- operands[1] = XEXP (operands[1], 0);
- return \"ld %0,@%1+\;ld %R0,@%1\";
- }
- return \"ld %0,%1\;ld %R0,%R1\";
- }
- case 3 :
- /* Try to use auto-inc addressing if we can. */
- if (GET_CODE (XEXP (operands[0], 0)) == REG
- && dead_or_set_p (insn, XEXP (operands[0], 0)))
- {
- operands[0] = XEXP (operands[0], 0);
- return \"st %1,@%0\;st %R1,@+%0\";
- }
- return \"st %1,%0\;st %R1,%R0\";
- }
-}"
- [(set_attr "type" "multi,multi,multi,multi")
- (set_attr "length" "4,4,6,6")])
+ "#"
+ [(set_attr "type" "multi,multi,multi,load8,store8")
+ (set_attr "length" "4,4,16,6,6")])
(define_split
- [(set (match_operand:DI 0 "register_operand" "")
- (match_operand:DI 1 "const_double_operand" ""))]
+ [(set (match_operand:DI 0 "move_dest_operand" "")
+ (match_operand:DI 1 "move_double_src_operand" ""))]
"reload_completed"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
- "
-{
- operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
- operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
- split_double (operands[1], operands + 4, operands + 5);
-}")
+ [(match_dup 2)]
+ "operands[2] = gen_split_move_double (operands);")
;; Floating point move insns.
@@ -553,37 +567,36 @@
}")
(define_insn "*movsf_insn"
- [(set (match_operand:SF 0 "move_dest_operand" "=r,r,r,m")
- (match_operand:SF 1 "move_src_operand" "r,F,m,r"))]
+ [(set (match_operand:SF 0 "move_dest_operand" "=r,r,r,r,T,m")
+ (match_operand:SF 1 "move_src_operand" "r,F,T,m,r,r"))]
"register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode)"
- "*
-{
- switch (which_alternative)
- {
- case 0 :
- return \"mv %0,%1\";
- case 1 :
- {
- REAL_VALUE_TYPE r;
- long l;
- REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
- REAL_VALUE_TO_TARGET_SINGLE (r, l);
- operands[1] = GEN_INT (l);
- if (l == 0)
- return \"ldi %0,%#0\";
- if ((l & 0xffff) == 0)
- return \"seth %0,%#%T1\";
- else
- return \"seth %0,%#%T1\;or3 %0,%0,%#%B1\";
- }
- case 2 :
- return \"ld %0,%1\";
- case 3 :
- return \"st %1,%0\";
- }
-}"
+ "@
+ mv %0,%1
+ #
+ ld %0,%1
+ ld %0,%1
+ st %1,%0
+ st %1,%0"
;; ??? Length of alternative 1 is either 2, 4 or 8.
- [(set_attr "type" "move,multi,load,store")])
+ [(set_attr "type" "int2,multi,load2,load4,store2,store4")
+ (set_attr "length" "2,8,2,4,2,4")])
+
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "")
+ (match_operand:SF 1 "const_double_operand" ""))]
+ "reload_completed"
+ [(set (match_dup 2) (match_dup 3))]
+ "
+{
+ long l;
+ REAL_VALUE_TYPE rv;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
+ REAL_VALUE_TO_TARGET_SINGLE (rv, l);
+
+ operands[2] = operand_subword (operands[0], 0, 0, SFmode);
+ operands[3] = GEN_INT (l);
+}")
(define_expand "movdf"
[(set (match_operand:DF 0 "general_operand" "")
@@ -595,118 +608,57 @@
if (GET_CODE (operands[0]) == MEM)
operands[1] = force_reg (DFmode, operands[1]);
-
- if (GET_CODE (operands[1]) == CONST_DOUBLE
- && ! easy_df_const (operands[1]))
- {
- rtx mem = force_const_mem (DFmode, operands[1]);
- rtx reg = ((reload_in_progress || reload_completed)
- ? copy_to_suggested_reg (XEXP (mem, 0),
- gen_rtx (REG, Pmode, REGNO (operands[0])),
- Pmode)
- : force_reg (Pmode, XEXP (mem, 0)));
- operands[1] = change_address (mem, DFmode, reg);
- }
}")
(define_insn "*movdf_insn"
[(set (match_operand:DF 0 "move_dest_operand" "=r,r,r,m")
- (match_operand:DF 1 "move_double_src_operand" "r,H,m,r"))]
+ (match_operand:DF 1 "move_double_src_operand" "r,F,m,r"))]
"register_operand (operands[0], DFmode) || register_operand (operands[1], DFmode)"
- "*
-{
- switch (which_alternative)
- {
- case 0 :
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register of
- operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"mv %R0,%R1\;mv %0,%1\";
- else
- return \"mv %0,%1\;mv %R0,%R1\";
- case 1 :
- {
- REAL_VALUE_TYPE r;
- long l[2];
- REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
- REAL_VALUE_TO_TARGET_DOUBLE (r, l);
- operands[1] = GEN_INT (l[0]);
- if (l[0] == 0 && l[1] == 0)
- return \"ldi %0,%#0\;ldi %R0,%#0\";
- else if (l[1] != 0)
- abort ();
- else if ((l[0] & 0xffff) == 0)
- return \"seth %0,%#%T1\;ldi %R0,%#0\";
- else
- abort ();
- }
- case 2 :
- /* If the low-address word is used in the address, we must load it
- last. Otherwise, load it first. Note that we cannot have
- auto-increment in that case since the address register is known to be
- dead. */
- if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
- operands [1], 0))
- {
- return \"ld %R0,%R1\;ld %0,%1\";
- }
- else
- {
- /* Try to use auto-inc addressing if we can. */
- if (GET_CODE (XEXP (operands[1], 0)) == REG
- && dead_or_set_p (insn, XEXP (operands[1], 0)))
- {
- operands[1] = XEXP (operands[1], 0);
- return \"ld %0,@%1+\;ld %R0,@%1\";
- }
- return \"ld %0,%1\;ld %R0,%R1\";
- }
- case 3 :
- /* Try to use auto-inc addressing if we can. */
- if (GET_CODE (XEXP (operands[0], 0)) == REG
- && dead_or_set_p (insn, XEXP (operands[0], 0)))
- {
- operands[0] = XEXP (operands[0], 0);
- return \"st %1,@%0\;st %R1,@+%0\";
- }
- return \"st %1,%0\;st %R1,%R0\";
- }
-}"
- [(set_attr "type" "multi,multi,multi,multi")
- (set_attr "length" "4,6,6,6")])
+ "#"
+ [(set_attr "type" "multi,multi,load8,store8")
+ (set_attr "length" "4,16,6,6")])
+
+(define_split
+ [(set (match_operand:DF 0 "move_dest_operand" "")
+ (match_operand:DF 1 "move_double_src_operand" ""))]
+ "reload_completed"
+ [(match_dup 2)]
+ "operands[2] = gen_split_move_double (operands);")
;; Zero extension instructions.
(define_insn "zero_extendqihi2"
- [(set (match_operand:HI 0 "register_operand" "=r,r")
- (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r")
+ (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "r,T,m")))]
""
"@
and3 %0,%1,%#255
+ ldub %0,%1
ldub %0,%1"
- [(set_attr "type" "unary,load")
- (set_attr "length" "4,*")])
+ [(set_attr "type" "int4,load2,load4")
+ (set_attr "length" "4,2,4")])
(define_insn "zero_extendqisi2"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,T,m")))]
""
"@
and3 %0,%1,%#255
+ ldub %0,%1
ldub %0,%1"
- [(set_attr "type" "unary,load")
- (set_attr "length" "4,*")])
+ [(set_attr "type" "int4,load2,load4")
+ (set_attr "length" "4,2,4")])
(define_insn "zero_extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,T,m")))]
""
"@
and3 %0,%1,%#65535
+ lduh %0,%1
lduh %0,%1"
- [(set_attr "type" "unary,load")
- (set_attr "length" "4,*")])
+ [(set_attr "type" "int4,load2,load4")
+ (set_attr "length" "4,2,4")])
;; Sign extension instructions.
;; ??? See v850.md.
@@ -747,11 +699,12 @@
}")
(define_insn "*sign_extendqihi2_insn"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
+ [(set (match_operand:HI 0 "register_operand" "=r,r")
+ (sign_extend:HI (match_operand:QI 1 "memory_operand" "T,m")))]
""
"ldb %0,%1"
- [(set_attr "type" "load")])
+ [(set_attr "type" "load2,load4")
+ (set_attr "length" "2,4")])
(define_expand "extendqisi2"
[(set (match_operand:SI 0 "register_operand" "")
@@ -777,11 +730,12 @@
}")
(define_insn "*sign_extendqisi2_insn"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (sign_extend:SI (match_operand:QI 1 "memory_operand" "T,m")))]
""
"ldb %0,%1"
- [(set_attr "type" "load")])
+ [(set_attr "type" "load2,load4")
+ (set_attr "length" "2,4")])
(define_expand "extendhisi2"
[(set (match_operand:SI 0 "register_operand" "")
@@ -807,11 +761,12 @@
}")
(define_insn "*sign_extendhisi2_insn"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (sign_extend:SI (match_operand:HI 1 "memory_operand" "T,m")))]
""
"ldh %0,%1"
- [(set_attr "type" "load")])
+ [(set_attr "type" "load2,load4")
+ (set_attr "length" "2,4")])
;; Arithmetic instructions.
@@ -828,7 +783,7 @@
add %0,%2
addi %0,%#%2
add3 %0,%1,%#%2"
- [(set_attr "type" "binary")
+ [(set_attr "type" "int2,int2,int4")
(set_attr "length" "2,2,4")])
;(define_split
@@ -847,37 +802,123 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_operand:DI 1 "register_operand" "%0")
(match_operand:DI 2 "register_operand" "r")))
- (clobber (reg:CC 17))]
+ (clobber (reg:SI 17))]
""
- "*
-{
- /* ??? The cmp clears the condition bit. Can we speed up somehow? */
- return \"cmp %L0,%L0\;addx %L0,%L2\;addx %H0,%H2\";
-}"
- [(set_attr "type" "binary")
+ "#"
+ [(set_attr "type" "multi")
(set_attr "length" "6")])
+;; ??? The cmp clears the condition bit. Can we speed up somehow?
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (clobber (match_operand 3 "" ""))]
+ "reload_completed"
+ [(parallel [(set (match_dup 3)
+ (const_int 0))
+ (use (match_dup 4))])
+ (parallel [(set (match_dup 4)
+ (plus:SI (match_dup 4)
+ (plus:SI (match_dup 5)
+ (match_dup 3))))
+ (set (match_dup 3)
+ (unspec [(const_int 0)] 3))])
+ (parallel [(set (match_dup 6)
+ (plus:SI (match_dup 6)
+ (plus:SI (match_dup 7)
+ (match_dup 3))))
+ (set (match_dup 3)
+ (unspec [(const_int 0)] 3))])]
+ "
+{
+ operands[4] = operand_subword (operands[0], (WORDS_BIG_ENDIAN != 0), 0, DImode);
+ operands[5] = operand_subword (operands[2], (WORDS_BIG_ENDIAN != 0), 0, DImode);
+ operands[6] = operand_subword (operands[0], (WORDS_BIG_ENDIAN == 0), 0, DImode);
+ operands[7] = operand_subword (operands[2], (WORDS_BIG_ENDIAN == 0), 0, DImode);
+}")
+
+(define_insn "*clear_c"
+ [(set (reg:SI 17)
+ (const_int 0))
+ (use (match_operand:SI 0 "register_operand" "r"))]
+ ""
+ "cmp %0,%0"
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
+
+(define_insn "*add_carry"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0")
+ (plus:SI (match_operand:SI 2 "register_operand" "r")
+ (reg:SI 17))))
+ (set (reg:SI 17)
+ (unspec [(const_int 0)] 3))]
+ ""
+ "addx %0,%2"
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
+
(define_insn "subsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
""
"sub %0,%2"
- [(set_attr "type" "binary")])
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
(define_insn "subdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "0")
(match_operand:DI 2 "register_operand" "r")))
- (clobber (reg:CC 17))]
+ (clobber (reg:SI 17))]
""
- "*
-{
- /* ??? The cmp clears the condition bit. Can we speed up somehow? */
- return \"cmp %L0,%L0\;subx %L0,%L2\;subx %H0,%H2\";
-}"
- [(set_attr "type" "binary")
+ "#"
+ [(set_attr "type" "multi")
(set_attr "length" "6")])
+
+;; ??? The cmp clears the condition bit. Can we speed up somehow?
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (minus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (clobber (match_operand 3 "" ""))]
+ "reload_completed"
+ [(parallel [(set (match_dup 3)
+ (const_int 0))
+ (use (match_dup 4))])
+ (parallel [(set (match_dup 4)
+ (minus:SI (match_dup 4)
+ (minus:SI (match_dup 5)
+ (match_dup 3))))
+ (set (match_dup 3)
+ (unspec [(const_int 0)] 3))])
+ (parallel [(set (match_dup 6)
+ (minus:SI (match_dup 6)
+ (minus:SI (match_dup 7)
+ (match_dup 3))))
+ (set (match_dup 3)
+ (unspec [(const_int 0)] 3))])]
+ "
+{
+ operands[4] = operand_subword (operands[0], (WORDS_BIG_ENDIAN != 0), 0, DImode);
+ operands[5] = operand_subword (operands[2], (WORDS_BIG_ENDIAN != 0), 0, DImode);
+ operands[6] = operand_subword (operands[0], (WORDS_BIG_ENDIAN == 0), 0, DImode);
+ operands[7] = operand_subword (operands[2], (WORDS_BIG_ENDIAN == 0), 0, DImode);
+}")
+
+(define_insn "*sub_carry"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (minus:SI (match_operand:SI 1 "register_operand" "%0")
+ (minus:SI (match_operand:SI 2 "register_operand" "r")
+ (reg:SI 17))))
+ (set (reg:SI 17)
+ (unspec [(const_int 0)] 3))]
+ ""
+ "subx %0,%2"
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
; Multiply/Divide instructions.
@@ -887,7 +928,7 @@
(sign_extend:SI (match_operand:HI 2 "register_operand" "r"))))]
""
"mullo %1,%2\;mvfacmi %0"
- [(set_attr "type" "mul")
+ [(set_attr "type" "multi")
(set_attr "length" "4")])
(define_insn "mulsi3"
@@ -896,7 +937,8 @@
(match_operand:SI 2 "register_operand" "r")))]
""
"mul %0,%2"
- [(set_attr "type" "mul")])
+ [(set_attr "type" "mul2")
+ (set_attr "length" "2")])
(define_insn "divsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -904,7 +946,8 @@
(match_operand:SI 2 "register_operand" "r")))]
""
"div %0,%2"
- [(set_attr "type" "div")])
+ [(set_attr "type" "div4")
+ (set_attr "length" "4")])
(define_insn "udivsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -912,7 +955,8 @@
(match_operand:SI 2 "register_operand" "r")))]
""
"divu %0,%2"
- [(set_attr "type" "div")])
+ [(set_attr "type" "div4")
+ (set_attr "length" "4")])
(define_insn "modsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -920,7 +964,8 @@
(match_operand:SI 2 "register_operand" "r")))]
""
"rem %0,%2"
- [(set_attr "type" "div")])
+ [(set_attr "type" "div4")
+ (set_attr "length" "4")])
(define_insn "umodsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -928,7 +973,8 @@
(match_operand:SI 2 "register_operand" "r")))]
""
"remu %0,%2"
- [(set_attr "type" "div")])
+ [(set_attr "type" "div4")
+ (set_attr "length" "4")])
;; Boolean instructions.
;;
@@ -942,8 +988,9 @@
""
"@
and %0,%2
- and3 %0,%1,%#%2 ; %X2"
- [(set_attr "type" "binary")])
+ and3 %0,%1,%#%2\\t; %X2"
+ [(set_attr "type" "int2,int4")
+ (set_attr "length" "2,4")])
(define_insn "iorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r")
@@ -952,8 +999,9 @@
""
"@
or %0,%2
- or3 %0,%1,%#%2 ; %X2"
- [(set_attr "type" "binary")])
+ or3 %0,%1,%#%2\\t; %X2"
+ [(set_attr "type" "int2,int4")
+ (set_attr "length" "2,4")])
(define_insn "xorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r")
@@ -962,22 +1010,25 @@
""
"@
xor %0,%2
- xor3 %0,%1,%#%2 ; %X2"
- [(set_attr "type" "binary")])
+ xor3 %0,%1,%#%2\\t; %X2"
+ [(set_attr "type" "int2,int4")
+ (set_attr "length" "2,4")])
(define_insn "negsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (match_operand:SI 1 "register_operand" "r")))]
""
"neg %0,%1"
- [(set_attr "type" "unary")])
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
(define_insn "one_cmplsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(not:SI (match_operand:SI 1 "register_operand" "r")))]
""
"not %0,%1"
- [(set_attr "type" "unary")])
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
;; Shift instructions.
@@ -990,7 +1041,7 @@
sll %0,%2
slli %0,%#%2
sll3 %0,%1,%#%2"
- [(set_attr "type" "shift")
+ [(set_attr "type" "shift2,shift2,shift4")
(set_attr "length" "2,2,4")])
(define_insn "ashrsi3"
@@ -1002,7 +1053,7 @@
sra %0,%2
srai %0,%#%2
sra3 %0,%1,%#%2"
- [(set_attr "type" "shift")
+ [(set_attr "type" "shift2,shift2,shift4")
(set_attr "length" "2,2,4")])
(define_insn "lshrsi3"
@@ -1014,7 +1065,7 @@
srl %0,%2
srli %0,%#%2
srl3 %0,%1,%#%2"
- [(set_attr "type" "shift")
+ [(set_attr "type" "shift2,shift2,shift4")
(set_attr "length" "2,2,4")])
;; Compare instructions.
@@ -1029,8 +1080,8 @@
;; preferred.
(define_expand "cmpsi"
- [(set (reg:CC 17)
- (compare:CC (match_operand:SI 0 "register_operand" "")
+ [(set (reg:SI 17)
+ (compare:SI (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "nonmemory_operand" "")))]
""
"
@@ -1046,8 +1097,8 @@
;; is quite inefficient. However, it is rarely used.
(define_insn "cmp_eqsi_insn"
- [(set (reg:CC 17)
- (eq:CC (match_operand:SI 0 "register_operand" "r,r")
+ [(set (reg:SI 17)
+ (eq:SI (match_operand:SI 0 "register_operand" "r,r")
(match_operand:SI 1 "reg_or_cmp_int16_operand" "r,P")))
(clobber (match_scratch:SI 2 "=&r,&r"))]
""
@@ -1067,34 +1118,30 @@
return \"add3 %2,%0,%#%N1\;cmpui %2,#1\";
}
}"
- [(set_attr "type" "compare,compare")
+ [(set_attr "type" "multi,multi")
(set_attr "length" "8,8")])
(define_insn "cmp_ltsi_insn"
- [(set (reg:CC 17)
- (lt:CC (match_operand:SI 0 "register_operand" "r,r")
+ [(set (reg:SI 17)
+ (lt:SI (match_operand:SI 0 "register_operand" "r,r")
(match_operand:SI 1 "reg_or_int16_operand" "r,J")))]
""
"@
cmp %0,%1
cmpi %0,%#%1"
- [(set_attr "type" "compare,compare")
- (set_attr "length" "4,6")])
+ [(set_attr "type" "int2,int4")
+ (set_attr "length" "2,4")])
(define_insn "cmp_ltusi_insn"
- [(set (reg:CC 17)
- (ltu:CC (match_operand:SI 0 "register_operand" "r,r")
+ [(set (reg:SI 17)
+ (ltu:SI (match_operand:SI 0 "register_operand" "r,r")
(match_operand:SI 1 "reg_or_uint16_operand" "r,K")))]
""
- "*
-{
- if (which_alternative == 0)
- return \"cmpu %0,%1\";
- else
- return \"cmpui %0,%#%1\";
-}"
- [(set_attr "type" "compare")
- (set_attr "length" "4,6")])
+ "@
+ cmpu %0,%1
+ cmpui %0,%#%1"
+ [(set_attr "type" "int2,int4")
+ (set_attr "length" "2,4")])
;; reg == small constant comparisons are best handled by putting the result
;; of the comparison in a tmp reg and then using beqz/bnez.
@@ -1104,12 +1151,12 @@
(define_insn "cmp_ne_small_const_insn"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(ne:SI (match_operand:SI 1 "register_operand" "0,r")
- (match_operand:SI 2 "cmp_int16_operand" "S,P")))]
+ (match_operand:SI 2 "cmp_int16_operand" "N,P")))]
""
"@
addi %0,%#%N2
add3 %0,%1,%#%N2"
- [(set_attr "type" "compare")
+ [(set_attr "type" "int2,int4")
(set_attr "length" "2,4")])
;; These control RTL generation for conditional jump insns.
@@ -1582,7 +1629,7 @@
[(const_int 0)]
""
"nop"
- [(set_attr "type" "misc")
+ [(set_attr "type" "int2")
(set_attr "length" "2")])
;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
@@ -1599,7 +1646,8 @@
[(unspec_volatile [(match_operand 0 "memory_operand" "m")] 0)]
""
"* return \"nop ; flush-icache\";"
- [(set_attr "type" "misc")])
+ [(set_attr "type" "int2")
+ (set_attr "length" "2")])
;; Conditional move instructions
;; Based on those done for the d10v
@@ -1638,12 +1686,19 @@
)]
"zero_and_one (operands [2], operands[3])"
"* return emit_cond_move (operands, insn);"
- [(set_attr "type" "move")
+ [(set_attr "type" "multi")
(set_attr "length" "8")
]
)
-
+(define_insn "movcc_insn"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (reg:SI 17))]
+ ""
+ "mvfc %0, cbr"
+ [(set_attr "type" "misc")
+ (set_attr "length" "2")]
+)
;; Split up troublesome insns for better scheduling.
@@ -1657,9 +1712,9 @@
[(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "r")
(const_int 4)))
(match_operand:SI 1 "register_operand" "r"))]
- "dead_or_set_p (insn, operands[0])"
+ "0 && dead_or_set_p (insn, operands[0])"
"st %1,@+%0"
- [(set_attr "type" "store")
+ [(set_attr "type" "store2")
(set_attr "length" "2")])
;; This case is triggered by compiling this code:
@@ -1698,9 +1753,45 @@
(match_dup 0)
)
]
- "dead_or_set_p (insn, operands [0])"
+ "0 && dead_or_set_p (insn, operands [0])"
"st %1,@(%3,%2)"
- [(set_attr "type" "store")
+ [(set_attr "type" "store4")
(set_attr "length" "4")
]
)
+
+;; Block moves, see m32r.c for more details.
+;; Argument 0 is the destination
+;; Argument 1 is the source
+;; Argument 2 is the length
+;; Argument 3 is the alignment
+
+(define_expand "movstrsi"
+ [(parallel [(set (match_operand:BLK 0 "general_operand" "")
+ (match_operand:BLK 1 "general_operand" ""))
+ (use (match_operand:SI 2 "immediate_operand" ""))
+ (use (match_operand:SI 3 "immediate_operand" ""))])]
+ ""
+ "
+{
+ if (operands[0]) /* avoid unused code messages */
+ {
+ m32r_expand_block_move (operands);
+ DONE;
+ }
+}")
+
+;; Insn generated by block moves
+
+(define_insn "movstrsi_internal"
+ [(set (mem:BLK (match_operand:SI 0 "register_operand" "r")) ;; destination
+ (mem:BLK (match_operand:SI 1 "register_operand" "r"))) ;; source
+ (use (match_operand:SI 2 "m32r_block_immediate_operand" "J"));; # bytes to move
+ (clobber (match_scratch:SI 3 "=&r")) ;; temp 1
+ (clobber (match_scratch:SI 4 "=&r")) ;; temp 2
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))]
+ ""
+ "* return m32r_output_block_move (insn, operands);"
+ [(set_attr "type" "store8")
+ (set_attr "length" "72")]) ;; Maximum
diff --git a/gcc/config/m68k/lb1sf68.asm b/gcc/config/m68k/lb1sf68.asm
index 7d6dba32d1e..9e33ccb4b2f 100644
--- a/gcc/config/m68k/lb1sf68.asm
+++ b/gcc/config/m68k/lb1sf68.asm
@@ -1,5 +1,5 @@
/* libgcc1 routines for 68000 w/o floating-point hardware.
- Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 4dfd56a97c3..0df0bd8e575 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -375,15 +375,13 @@ do { \
if (flag_pic) \
{ \
fprintf (FILE, "\tbra.l "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "@PLTPC\n"); \
} \
else \
{ \
fprintf (FILE, "\tjmp "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "\n"); \
} \
} while (0)
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 164cf6bc223..9303c6f2b76 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
/* Some output-actions in m68k.md need these. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
@@ -33,14 +33,11 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "insn-attr.h"
#include "recog.h"
+#include "toplev.h"
/* Needed for use_return_insn. */
#include "flags.h"
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
#ifdef SUPPORT_SUN_FPA
/* Index into this array by (register number >> 3) to find the
@@ -234,25 +231,25 @@ output_function_prologue (stream, size)
{
if (fsize + 4 < 0x8000)
{
-#ifdef NO_ADDSUB_Q
+#ifndef NO_ADDSUB_Q
if (fsize + 4 <= 8)
{
if (!TARGET_5200)
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.w %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubq.w %0I%d,%Rsp\n", fsize + 4);
#else
- asm_fprintf (stream, "\tsubqw %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubqw %0I%d,%Rsp\n", fsize + 4);
#endif
}
else
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.l %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubq.l %0I%d,%Rsp\n", fsize + 4);
#else
- asm_fprintf (stream, "\tsubql %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\tsubql %0I%d,%Rsp\n", fsize + 4);
#endif
}
}
@@ -262,15 +259,15 @@ output_function_prologue (stream, size)
subtract a small integer (8 < N <= 16) to a register. */
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.w %OI8,%Rsp\n\tsubq.w %OI%d,%Rsp\n",
+ asm_fprintf (stream, "\tsubq.w %0I8,%Rsp\n\tsubq.w %0I%d,%Rsp\n",
fsize + 4);
#else
- asm_fprintf (stream, "\tsubqw %OI8,%Rsp\n\tsubqw %OI%d,%Rsp\n",
+ asm_fprintf (stream, "\tsubqw %0I8,%Rsp\n\tsubqw %0I%d,%Rsp\n",
fsize + 4);
#endif
}
else
-#endif /* NO_ADDSUB_Q */
+#endif /* not NO_ADDSUB_Q */
if (TARGET_68040)
{
/* Adding negative number is faster on the 68040. */
@@ -774,23 +771,23 @@ output_function_epilogue (stream, size)
reg_names[FRAME_POINTER_REGNUM]);
else if (fsize)
{
-#ifdef NO_ADDSUB_Q
+#ifndef NO_ADDSUB_Q
if (fsize + 4 <= 8)
{
if (!TARGET_5200)
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.w %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddq.w %0I%d,%Rsp\n", fsize + 4);
#else
- asm_fprintf (stream, "\taddqw %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddqw %0I%d,%Rsp\n", fsize + 4);
#endif
}
else
{
#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.l %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddq.l %0I%d,%Rsp\n", fsize + 4);
#else
- asm_fprintf (stream, "\taddql %OI%d,%Rsp\n", fsize + 4);
+ asm_fprintf (stream, "\taddql %0I%d,%Rsp\n", fsize + 4);
#endif
}
}
@@ -800,15 +797,15 @@ output_function_epilogue (stream, size)
add a small integer (8 < N <= 16) to a register. */
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.w %OI8,%Rsp\n\taddq.w %OI%d,%Rsp\n",
+ asm_fprintf (stream, "\taddq.w %0I8,%Rsp\n\taddq.w %0I%d,%Rsp\n",
fsize + 4);
#else
- asm_fprintf (stream, "\taddqw %OI8,%Rsp\n\taddqw %OI%d,%Rsp\n",
+ asm_fprintf (stream, "\taddqw %0I8,%Rsp\n\taddqw %0I%d,%Rsp\n",
fsize + 4);
#endif
}
else
-#endif /* NO_ADDSUB_Q */
+#endif /* not NO_ADDSUB_Q */
if (fsize + 4 < 0x8000)
{
if (TARGET_68040)
@@ -866,7 +863,7 @@ not_sp_operand (op, mode)
int
valid_dbcc_comparison_p (x, mode)
rtx x;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (x))
{
@@ -1046,25 +1043,52 @@ output_scc_di(op, operand1, operand2, dest)
}
loperands[4] = gen_label_rtx();
if (operand2 != const0_rtx)
+ {
#ifdef MOTOROLA
#ifdef SGS_CMP_ORDER
- output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands);
+ output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands);
#else
- output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands);
+ output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands);
#endif
#else
#ifdef SGS_CMP_ORDER
- output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands);
+ output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands);
#else
- output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands);
+ output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands);
#endif
#endif
+ }
else
+ {
+ if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (loperands[0]))
+ output_asm_insn ("tst%.l %0", loperands);
+ else
+ {
+#ifdef SGS_CMP_ORDER
+ output_asm_insn ("cmp%.w %0,%#0", loperands);
+#else
+ output_asm_insn ("cmp%.w %#0,%0", loperands);
+#endif
+ }
+
#ifdef MOTOROLA
- output_asm_insn ("tst%.l %0\n\tjbne %l4\n\ttst%.l %1", loperands);
+ output_asm_insn ("jbne %l4", loperands);
#else
- output_asm_insn ("tst%.l %0\n\tjne %l4\n\ttst%.l %1", loperands);
+ output_asm_insn ("jne %l4", loperands);
#endif
+
+ if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (loperands[1]))
+ output_asm_insn ("tst%.l %1", loperands);
+ else
+ {
+#ifdef SGS_CMP_ORDER
+ output_asm_insn ("cmp%.w %1,%#0", loperands);
+#else
+ output_asm_insn ("cmp%.w %#0,%1", loperands);
+#endif
+ }
+ }
+
loperands[5] = dest;
switch (op_code)
@@ -1216,7 +1240,7 @@ output_btst (operands, countop, dataop, insn, signpos)
int
symbolic_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -1304,7 +1328,7 @@ extend_operator(x, mode)
rtx
legitimize_pic_address (orig, mode, reg)
rtx orig, reg;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
rtx pic_ref = orig;
@@ -1480,6 +1504,9 @@ output_move_simode_const (operands)
|| !(GET_CODE (operands[0]) == MEM
&& MEM_VOLATILE_P (operands[0]))))
return "clr%.l %0";
+ else if (operands[1] == const0_rtx
+ && ADDRESS_REG_P (operands[0]))
+ return "sub%.l %0,%0";
else if (DATA_REG_P (operands[0]))
return output_move_const_into_data_reg (operands);
else if (ADDRESS_REG_P (operands[0])
@@ -1527,6 +1554,9 @@ output_move_himode (operands)
|| !(GET_CODE (operands[0]) == MEM
&& MEM_VOLATILE_P (operands[0]))))
return "clr%.w %0";
+ else if (operands[1] == const0_rtx
+ && ADDRESS_REG_P (operands[0]))
+ return "sub%.l %0,%0";
else if (DATA_REG_P (operands[0])
&& INTVAL (operands[1]) < 128
&& INTVAL (operands[1]) >= -128)
@@ -1641,12 +1671,13 @@ output_move_qimode (operands)
return "moveq %1,%0";
#endif
}
+ if (operands[1] == const0_rtx && ADDRESS_REG_P (operands[0]))
+ return "sub%.l %0,%0";
if (GET_CODE (operands[1]) != CONST_INT && CONSTANT_P (operands[1]))
return "move%.l %1,%0";
- /* 68k family doesn't support byte moves to from address registers. The
- 5200 (coldfire) does not have this restriction. */
- if ((ADDRESS_REG_P (operands[0]) || ADDRESS_REG_P (operands[1]))
- && ! TARGET_5200)
+ /* 68k family (including the 5200 coldfire) does not support byte moves to
+ from address registers. */
+ if (ADDRESS_REG_P (operands[0]) || ADDRESS_REG_P (operands[1]))
return "move%.w %1,%0";
return "move%.b %1,%0";
}
@@ -3217,8 +3248,10 @@ strict_low_part_peephole_ok (mode, first_insn, target)
int
const_uint32_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
+ if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
#if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */
return (GET_CODE (op) == CONST_INT
@@ -3236,8 +3269,10 @@ const_uint32_operand (op, mode)
int
const_sint32_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
+ if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
/* All allowed constants will fit a CONST_INT. */
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) >= (-0x7fffffff - 1) && INTVAL (op) <= 0x7fffffff));
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 623e3ce1979..a4bfef9a638 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -153,10 +153,11 @@ extern int target_flags;
{ "68881", - (MASK_FPA|MASK_SKY)}, \
{ "68881", MASK_68881}, \
{ "soft-float", - (MASK_FPA|MASK_SKY|MASK_68040_ONLY|MASK_68881)}, \
- { "68020-40", -(MASK_5200|MASK_68060)}, \
+ { "68020-40", -(MASK_5200|MASK_68060|MASK_68040_ONLY)}, \
{ "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040)}, \
- { "68020-60", -(MASK_5200|MASK_68040)}, \
- { "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68060)}, \
+ { "68020-60", -(MASK_5200|MASK_68040_ONLY)}, \
+ { "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040 \
+ |MASK_68060)}, \
{ "68030", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY)}, \
{ "68030", (MASK_68020|MASK_BITFIELD)}, \
{ "68040", - (MASK_5200|MASK_68060)}, \
@@ -165,8 +166,8 @@ extern int target_flags;
{ "68060", - (MASK_5200|MASK_68040)}, \
{ "68060", (MASK_68020|MASK_68881|MASK_BITFIELD \
|MASK_68040_ONLY|MASK_68060)}, \
- { "5200", - (MASK_68060|MASK_68040|MASK_68020|MASK_BITFIELD \
- |MASK_68881)}, \
+ { "5200", - (MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
+ |MASK_BITFIELD|MASK_68881)}, \
{ "5200", (MASK_5200)}, \
{ "68851", 0}, \
{ "no-68851", 0}, \
@@ -586,14 +587,14 @@ enum reg_class {
#define REG_CLASS_CONTENTS \
{ \
- 0x00000000, /* NO_REGS */ \
- 0x000000ff, /* DATA_REGS */ \
- 0x0000ff00, /* ADDR_REGS */ \
- 0x00ff0000, /* FP_REGS */ \
- 0x0000ffff, /* GENERAL_REGS */ \
- 0x00ff00ff, /* DATA_OR_FP_REGS */ \
- 0x00ffff00, /* ADDR_OR_FP_REGS */ \
- 0x00ffffff, /* ALL_REGS */ \
+ {0x00000000}, /* NO_REGS */ \
+ {0x000000ff}, /* DATA_REGS */ \
+ {0x0000ff00}, /* ADDR_REGS */ \
+ {0x00ff0000}, /* FP_REGS */ \
+ {0x0000ffff}, /* GENERAL_REGS */ \
+ {0x00ff00ff}, /* DATA_OR_FP_REGS */ \
+ {0x00ffff00}, /* ADDR_OR_FP_REGS */ \
+ {0x00ffffff}, /* ALL_REGS */ \
}
/* The same information, inverted:
@@ -857,6 +858,9 @@ extern enum reg_class regno_reg_class[];
/* Offset of first parameter from the argument pointer register value. */
#define FIRST_PARM_OFFSET(FNDECL) 8
+/* Offset of the CFA from the argument pointer register value. */
+#define ARG_POINTER_CFA_OFFSET 8
+
/* Value is the number of byte of arguments automatically
popped when returning from a subroutine call.
FUNDECL is the declaration node of the function (as a tree),
@@ -2121,6 +2125,8 @@ extern int use_return_insn ();
extern void print_operand_address ();
extern void print_operand ();
extern void notice_update_cc ();
+extern void finalize_pic ();
+extern void override_options ();
/*
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index cb31fa5f092..dfe0cbc313e 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -1023,8 +1023,8 @@
"* return output_move_qimode (operands);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=d*a<Q>,d*am")
- (match_operand:QI 1 "general_operand" "d*ami,d*a<Q>"))]
+ [(set (match_operand:QI 0 "general_operand" "=d<Q>,dm,d*a")
+ (match_operand:QI 1 "general_operand" "dmi,d<Q>,di*a"))]
"TARGET_5200"
"* return output_move_qimode (operands);")
@@ -1483,7 +1483,7 @@
return \"clr%.l %0\;move%.l %1,%0\";
else
operands[2] = adj_offsettable_operand (operands[0], 4);
- if (GET_CODE (operands[1]) != REG || GET_CODE (operands[1]) != REG
+ if (GET_CODE (operands[1]) != REG || GET_CODE (operands[2]) != REG
|| REGNO (operands[1]) != REGNO (operands[2]))
output_asm_insn (\"move%.l %1,%2\", operands);
if (ADDRESS_REG_P (operands[0]))
@@ -1584,9 +1584,10 @@
{
if (GET_CODE (operands[1]) == REG
&& REGNO (operands[0]) == REGNO (operands[1]))
- return \"and%.w %#0xFF,%0\";
+ return (!TARGET_5200 ? \"and%.w %#0xFF,%0\" : \"and%.l %#0xFF,%0\");
if (reg_mentioned_p (operands[0], operands[1]))
- return \"move%.b %1,%0\;and%.w %#0xFF,%0\";
+ return (!TARGET_5200 ? \"move%.b %1,%0\;and%.w %#0xFF,%0\"
+ : \"move%.b %1,%0\;and%.l %#0xFF,%0\");
return \"clr%.w %0\;move%.b %1,%0\";
}
else if (GET_CODE (operands[0]) == MEM
@@ -2094,13 +2095,13 @@
} ")
(define_insn "adddi_dilshr32"
- [(set (match_operand:DI 0 "general_operand" "=do")
+ [(set (match_operand:DI 0 "general_operand" "=d,o")
;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
;; (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
;; (const_int 32))))]
- (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
+ (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "o,r")
(const_int 32))
- (match_operand:DI 2 "general_operand" "0")))]
+ (match_operand:DI 2 "general_operand" "0,0")))]
""
"*
{
@@ -2113,13 +2114,13 @@
} ")
(define_insn "adddi_dishl32"
- [(set (match_operand:DI 0 "general_operand" "=ro")
+ [(set (match_operand:DI 0 "general_operand" "=r,o")
;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
;; (ashift:DI (match_operand:DI 1 "general_operand" "ro")
;; (const_int 32))))]
- (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro")
+ (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "o,r")
(const_int 32))
- (match_operand:DI 2 "general_operand" "0")))]
+ (match_operand:DI 2 "general_operand" "0,0")))]
""
"*
{
@@ -2220,6 +2221,8 @@
return \"add%.l %R2,%1\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%0\";
}
}
+ else
+ abort ();
} ")
(define_insn "addsi_lshrsi_31"
@@ -2777,6 +2780,8 @@
return \"sub%.l %R2,%1\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%0\";
}
}
+ else
+ abort ();
} ")
(define_insn "subsi3"
@@ -5953,6 +5958,25 @@
operands[3] = adj_offsettable_operand (operands[0], 4);
if (! ADDRESS_REG_P (operands[0]))
{
+ if (reg_overlap_mentioned_p (operands[2], operands[0]))
+ {
+ if (reg_overlap_mentioned_p (operands[2], operands[3]))
+ {
+#ifdef MOTOROLA
+ return \"or%.l %0,%2\;jbeq %l1\";
+#else
+ return \"or%.l %0,%2\;jeq %l1\";
+#endif
+ }
+ else
+ {
+#ifdef MOTOROLA
+ return \"or%.l %3,%2\;jbeq %l1\";
+#else
+ return \"or%.l %3,%2\;jeq %l1\";
+#endif
+ }
+ }
#ifdef MOTOROLA
return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
#else
@@ -6014,6 +6038,25 @@
operands[3] = adj_offsettable_operand (operands[0], 4);
if (!ADDRESS_REG_P (operands[0]))
{
+ if (reg_overlap_mentioned_p (operands[2], operands[0]))
+ {
+ if (reg_overlap_mentioned_p (operands[2], operands[3]))
+ {
+#ifdef MOTOROLA
+ return \"or%.l %0,%2\;jbne %l1\";
+#else
+ return \"or%.l %0,%2\;jne %l1\";
+#endif
+ }
+ else
+ {
+#ifdef MOTOROLA
+ return \"or%.l %3,%2\;jbne %l1\";
+#else
+ return \"or%.l %3,%2\;jne %l1\";
+#endif
+ }
+ }
#ifdef MOTOROLA
return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\";
#else
diff --git a/gcc/config/m68k/t-linux b/gcc/config/m68k/t-linux
index 7c2e5e3b84a..99dc4522ea4 100644
--- a/gcc/config/m68k/t-linux
+++ b/gcc/config/m68k/t-linux
@@ -1,16 +1,2 @@
-# Don't run fixproto
-STMP_FIXPROTO =
# On GNU/Linux we can print long double
ENQUIRE_CFLAGS = -DNO_MEM -O0
-# Don't install assert.h
-INSTALL_ASSERT_H =
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC
-# Compile libgcc2.a with pic.
-TARGET_LIBGCC2_CFLAGS = -fPIC
-# Don't install assert.h
-INSTALL_ASSERT_H =
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC
-# Compile libgcc2.a with pic.
-TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/m68k/x-next b/gcc/config/m68k/x-next
index ac101bb9ff9..f1a9836636d 100644
--- a/gcc/config/m68k/x-next
+++ b/gcc/config/m68k/x-next
@@ -7,3 +7,7 @@ OTHER_FIXINCLUDES_DIRS= /LocalDeveloper/Headers
# <limits.h> is sometimes in /usr/include/ansi/limits.h.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h -o -f $(SYSTEM_HEADER_DIR)/ansi/limits.h ]
+
+# f771 is so big, we need to tell linker on m68k-next-nextstep* to
+# make enough room for it.
+BOOT_LDFLAGS=-segaddr __DATA 6000000
diff --git a/gcc/config/m68k/xm-netbsd.h b/gcc/config/m68k/xm-netbsd.h
deleted file mode 100644
index 27a33cd5b83..00000000000
--- a/gcc/config/m68k/xm-netbsd.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Motorola 68k running NetBSD as host. */
-
-#include <m68k/xm-m68k.h>
-#include <xm-netbsd.h>
diff --git a/gcc/config/m88k/dgux.ld b/gcc/config/m88k/dgux.ld
index 26848959c65..cc5dc0fec2a 100644
--- a/gcc/config/m88k/dgux.ld
+++ b/gcc/config/m88k/dgux.ld
@@ -22,7 +22,7 @@
64kb can be mapped out, thus catching references through null
pointers. We actually start at 0x10200 (for efficiency). Ideally,
we want the page offset of a given word of the .text (output)
- section to be the same as it's page offset in the actual (output)
+ section to be the same as its page offset in the actual (output)
linked core file so that paging of the .text section is efficient.
In order to do this we allow for up to 0x200 bytes of header stuff
in the output (linked) object file.
diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h
index 441674c08de..40230029e5b 100644
--- a/gcc/config/m88k/m88k.h
+++ b/gcc/config/m88k/m88k.h
@@ -198,13 +198,13 @@ extern char * reg_names[];
Redefined in sysv4.h, and luna.h. */
#define VERSION_INFO1 "m88k, "
#ifndef VERSION_INFO2
-#define VERSION_INFO2 "$Revision: 1.11 $"
+#define VERSION_INFO2 "$Revision: 1.9 $"
#endif
#ifndef VERSION_STRING
#define VERSION_STRING version_string
#ifdef __STDC__
-#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.11 $ " __DATE__
+#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.9 $ " __DATE__
#else
#define TM_RCS_ID "$What: <@(#) m88k.h,v 1.1.1.2.2.2> $"
#endif /* __STDC__ */
@@ -2079,7 +2079,7 @@ do { \
sprintf (LABEL, TARGET_SVR4 ? "*.%s%d" : "*@%s%d", PREFIX, NUM)
/* Internal macro to get a single precision floating point value into
- an int, so we can print it's value in hex. */
+ an int, so we can print its value in hex. */
#define FLOAT_TO_INT_INTERNAL( FVALUE, IVALUE ) \
{ union { \
REAL_VALUE_TYPE d; \
diff --git a/gcc/config/m88k/m88k.md b/gcc/config/m88k/m88k.md
index 54ec6486773..118ebe366da 100644
--- a/gcc/config/m88k/m88k.md
+++ b/gcc/config/m88k/m88k.md
@@ -1125,7 +1125,7 @@
;; The comparison operations store the comparison into a register and
;; record that register. The following Bxx or Sxx insn uses that
;; register as an input. To facilitate use of bcnd instead of cmp/bb1,
-;; cmpsi records it's operands and produces no code when any operand
+;; cmpsi records its operands and produces no code when any operand
;; is constant. In this case, the Bxx insns use gen_bcnd and the
;; Sxx insns use gen_test to ensure a cmp has been emitted.
;;
@@ -2810,7 +2810,7 @@
;; Division by 0 trap
(define_insn "trap_divide_by_zero"
- [(trap_if (const_int 1) 503)]
+ [(trap_if (const_int 1) (const_int 503))]
""
"tb0 0,%#r0,503"
[(set_attr "type" "weird")])
@@ -2822,7 +2822,7 @@
(const_int 0))
(pc)
(match_operand 1 "" "")))
- (trap_if (const_int 1) 503)]
+ (trap_if (const_int 1) (const_int 503))]
""
"
{
@@ -3451,14 +3451,14 @@
(define_insn "tbnd"
[(trap_if (gtu (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "arith_operand" "rI"))
- 7)]
+ (const_int 7))]
""
"tbnd %r0,%1"
[(set_attr "type" "weird")])
;; Just in case the optimizer decides to fold away the test.
(define_insn ""
- [(trap_if (const_int 1) 7)]
+ [(trap_if (const_int 1) (const_int 7))]
""
"tbnd %#r31,0"
[(set_attr "type" "weird")])
@@ -3972,7 +3972,7 @@
;; This insn is used for some loop tests, typically loops reversed when
;; strength reduction is used. It is actually created when the instruction
;; combination phase combines the special loop test. Since this insn
-;; is both a jump insn and has an output, it must deal with it's own
+;; is both a jump insn and has an output, it must deal with its own
;; reloads, hence the `m' constraints. The `!' constraints direct reload
;; to not choose the register alternatives in the event a reload is needed.
diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h
index 188939497ce..ea3f28c7381 100644
--- a/gcc/config/mips/abi64.h
+++ b/gcc/config/mips/abi64.h
@@ -217,7 +217,7 @@ extern struct rtx_def *mips_function_value ();
#undef LONG_MAX_SPEC
#if ((MIPS_ABI_DEFAULT == ABI_64) || ((MIPS_ABI_DEFAULT == ABI_EABI) && ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_64BIT)))
#define LONG_MAX_SPEC \
- "%{!mabi=n32:%{!mno-long64:%{!mgp32:-D__LONG_MAX__=9223372036854775807L}}}"
+ "%{!mabi=n32:%{!mno-long64:%{!mgp32:%{!mips1:%{!mips2:-D__LONG_MAX__=9223372036854775807L}}}}}"
#else
#define LONG_MAX_SPEC \
"%{mabi=64:-D__LONG_MAX__=9223372036854775807L} \
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index f987de393c1..a5401f84311 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -71,6 +71,73 @@ do { \
fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \
} while (0)
+/* The following macro defines the format used to output the second
+ operand of the .type assembler directive. Different svr4 assemblers
+ expect various different forms for this operand. The one given here
+ is just a default. You may need to override it in your machine-
+ specific tm.h file (depending upon the particulars of your assembler). */
+
+#define TYPE_OPERAND_FMT "@%s"
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#undef TYPE_ASM_OP
+#undef SIZE_ASM_OP
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* These macros generate the special .type and .size directives which
+ are used to set the corresponding fields of the linker symbol table
+ entries in an ELF object file under SVR4. These macros also output
+ the starting labels for the relevant functions/objects. */
+
+/* Write the extra assembler code needed to declare an object properly. */
+
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
+ putc ('\n', FILE); \
+ size_directive_output = 0; \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+ } \
+ mips_declare_object (FILE, NAME, "", ":\n", 0); \
+ } while (0)
+
+/* Output the size directive for a decl in rest_of_decl_compilation
+ in the case where we did not do so before the initializer.
+ Once we find the error_mark_node, we know that the value of
+ size_directive_output was set
+ by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
+do { \
+ char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
+ && ! AT_END && TOP_LEVEL \
+ && DECL_INITIAL (DECL) == error_mark_node \
+ && !size_directive_output) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, name); \
+ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+ } \
+ } while (0)
+
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
assemble_name (FILE, LABEL1); \
@@ -102,3 +169,64 @@ do { \
fputc ('\n', FILE); \
} while (0)
+#define UNIQUE_SECTION(DECL,RELOC) \
+do { \
+ int len, size, sec; \
+ char *name, *string, *prefix; \
+ static char *prefixes[4][2] = { \
+ { ".text.", ".gnu.linkonce.t." }, \
+ { ".rodata.", ".gnu.linkonce.r." }, \
+ { ".data.", ".gnu.linkonce.d." }, \
+ { ".sdata.", ".gnu.linkonce.s." } \
+ }; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ size = int_size_in_bytes (TREE_TYPE (decl)); \
+ \
+ /* Determine the base section we are interested in: \
+ 0=text, 1=rodata, 2=data, 3=sdata. */ \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ sec = 0; \
+ else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
+ && TREE_CODE (decl) == STRING_CST \
+ && !flag_writable_strings) \
+ { \
+ /* For embedded position independent code, put constant strings \
+ in the text section, because the data section is limited to \
+ 64K in size. For mips16 code, put strings in the text \
+ section so that a PC relative load instruction can be used to \
+ get their address. */ \
+ sec = 0; \
+ } \
+ else if (TARGET_EMBEDDED_DATA) \
+ { \
+ /* For embedded applications, always put an object in read-only data \
+ if possible, in order to reduce RAM usage. */ \
+ \
+ if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ sec = 1; \
+ else if (size > 0 && size <= mips_section_threshold) \
+ sec = 3; \
+ else \
+ sec = 2; \
+ } \
+ else \
+ { \
+ /* For hosted applications, always put an object in small data if \
+ possible, as this gives the best performance. */ \
+ \
+ if (size > 0 && size <= mips_section_threshold) \
+ sec = 3; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ sec = 1; \
+ else \
+ sec = 2; \
+ } \
+ \
+ prefix = prefixes[sec][DECL_ONE_ONLY (DECL)]; \
+ len = strlen (name) + strlen (prefix); \
+ string = alloca (len + 1); \
+ sprintf (string, "%s%s", prefix, name); \
+ \
+ DECL_SECTION_NAME (DECL) = build_string (len, string); \
+} while (0)
diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h
index edd00bbe921..b6cf3721c77 100644
--- a/gcc/config/mips/elf64.h
+++ b/gcc/config/mips/elf64.h
@@ -97,6 +97,73 @@ do { \
fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \
} while (0)
+/* The following macro defines the format used to output the second
+ operand of the .type assembler directive. Different svr4 assemblers
+ expect various different forms for this operand. The one given here
+ is just a default. You may need to override it in your machine-
+ specific tm.h file (depending upon the particulars of your assembler). */
+
+#define TYPE_OPERAND_FMT "@%s"
+
+/* Define the strings used for the special svr4 .type and .size directives.
+ These strings generally do not vary from one system running svr4 to
+ another, but if a given system (e.g. m88k running svr) needs to use
+ different pseudo-op names for these, they may be overridden in the
+ file which includes this one. */
+
+#undef TYPE_ASM_OP
+#undef SIZE_ASM_OP
+#define TYPE_ASM_OP ".type"
+#define SIZE_ASM_OP ".size"
+
+/* These macros generate the special .type and .size directives which
+ are used to set the corresponding fields of the linker symbol table
+ entries in an ELF object file under SVR4. These macros also output
+ the starting labels for the relevant functions/objects. */
+
+/* Write the extra assembler code needed to declare an object properly. */
+
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
+ putc ('\n', FILE); \
+ size_directive_output = 0; \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+ } \
+ mips_declare_object (FILE, NAME, "", ":\n", 0); \
+ } while (0)
+
+/* Output the size directive for a decl in rest_of_decl_compilation
+ in the case where we did not do so before the initializer.
+ Once we find the error_mark_node, we know that the value of
+ size_directive_output was set
+ by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
+do { \
+ char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
+ && ! AT_END && TOP_LEVEL \
+ && DECL_INITIAL (DECL) == error_mark_node \
+ && !size_directive_output) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, name); \
+ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+ } \
+ } while (0)
+
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
do { fputc ( '\t', FILE); \
assemble_name (FILE, LABEL1); \
@@ -128,3 +195,64 @@ do { \
fputc ('\n', FILE); \
} while (0)
+#define UNIQUE_SECTION(DECL,RELOC) \
+do { \
+ int len, size, sec; \
+ char *name, *string, *prefix; \
+ static char *prefixes[4][2] = { \
+ { ".text.", ".gnu.linkonce.t." }, \
+ { ".rodata.", ".gnu.linkonce.r." }, \
+ { ".data.", ".gnu.linkonce.d." }, \
+ { ".sdata.", ".gnu.linkonce.s." } \
+ }; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ size = int_size_in_bytes (TREE_TYPE (decl)); \
+ \
+ /* Determine the base section we are interested in: \
+ 0=text, 1=rodata, 2=data, 3=sdata. */ \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ sec = 0; \
+ else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
+ && TREE_CODE (decl) == STRING_CST \
+ && !flag_writable_strings) \
+ { \
+ /* For embedded position independent code, put constant strings \
+ in the text section, because the data section is limited to \
+ 64K in size. For mips16 code, put strings in the text \
+ section so that a PC relative load instruction can be used to \
+ get their address. */ \
+ sec = 0; \
+ } \
+ else if (TARGET_EMBEDDED_DATA) \
+ { \
+ /* For embedded applications, always put an object in read-only data \
+ if possible, in order to reduce RAM usage. */ \
+ \
+ if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ sec = 1; \
+ else if (size > 0 && size <= mips_section_threshold) \
+ sec = 3; \
+ else \
+ sec = 2; \
+ } \
+ else \
+ { \
+ /* For hosted applications, always put an object in small data if \
+ possible, as this gives the best performance. */ \
+ \
+ if (size > 0 && size <= mips_section_threshold) \
+ sec = 3; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ sec = 1; \
+ else \
+ sec = 2; \
+ } \
+ \
+ prefix = prefixes[sec][DECL_ONE_ONLY (DECL)]; \
+ len = strlen (name) + strlen (prefix); \
+ string = alloca (len + 1); \
+ sprintf (string, "%s%s", prefix, name); \
+ \
+ DECL_SECTION_NAME (DECL) = build_string (len, string); \
+} while (0)
diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h
index f81fe1c0fda..7910eef88d6 100644
--- a/gcc/config/mips/iris5.h
+++ b/gcc/config/mips/iris5.h
@@ -123,6 +123,7 @@ Boston, MA 02111-1307, USA. */
#undef DBX_DEBUGGING_INFO
#undef SDB_DEBUGGING_INFO
#undef MIPS_DEBUGGING_INFO
+#undef PREFERRED_DEBUGGING_TYPE
/* Likewise, the assembler doesn't handle DWARF2 directives. */
#define DWARF2_UNWIND_INFO 0
diff --git a/gcc/config/mips/iris5gas.h b/gcc/config/mips/iris5gas.h
index f1c2c483f88..477a55fb647 100644
--- a/gcc/config/mips/iris5gas.h
+++ b/gcc/config/mips/iris5gas.h
@@ -4,6 +4,7 @@
#define DBX_DEBUGGING_INFO
#define SDB_DEBUGGING_INFO
#define MIPS_DEBUGGING_INFO
+#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
/* GNU as does handle DWARF2 directives. */
#undef DWARF2_UNWIND_INFO
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 55d42c7fc50..30e1860267f 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -30,6 +30,10 @@ Boston, MA 02111-1307, USA. */
#include "mips/iris5.h"
#include "mips/abi64.h"
+/* Irix6 assembler does handle DWARF2 directives. Override setting in
+ irix5.h file. */
+#undef DWARF2_UNWIND_INFO
+
/* For Irix 6, -mabi=64 implies TARGET_LONG64. */
/* This is handled in override_options. */
@@ -96,6 +100,9 @@ Boston, MA 02111-1307, USA. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+/* Force the generation of dwarf .debug_frame sections even if not
+ compiling -g. This guarantees that we can unwind the stack. */
+#define DWARF2_FRAME_INFO 1
/* The size in bytes of a DWARF field indicating an offset or length
relative to a debug info section, specified to be 4 bytes in the DWARF-2
specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
@@ -118,8 +125,8 @@ Boston, MA 02111-1307, USA. */
/* The Irix 6.0.1 assembler doesn't like labels in the text section, so
just avoid emitting them. */
-#define ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_LANGUAGE
+#define ASM_IDENTIFY_GCC(x) ((void)0)
+#define ASM_IDENTIFY_LANGUAGE(x) ((void)0)
/* Irix 5 stuff that we don't need for Irix 6. */
/* ??? We do need this for the -mabi=32 switch though. */
@@ -554,4 +561,5 @@ do { \
%{!shared: %{!non_shared: %{!call_shared: -call_shared -no_unresolved}}}} \
%{rpath} -init __do_global_ctors -fini __do_global_dtors \
%{shared:-hidden_symbol __do_global_ctors,__do_global_dtors,__EH_FRAME_BEGIN__,__frame_dummy} \
--_SYSTYPE_SVR4 %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64} %{!mabi*: -n32}"
+-_SYSTYPE_SVR4 -woff 131 \
+%{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 960caf1c56e..98c634dc34a 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -27,14 +27,8 @@ Boston, MA 02111-1307, USA. */
be replaced with something better designed. */
#include "config.h"
-
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "system.h"
+#include <signal.h>
#include "rtl.h"
#include "regs.h"
@@ -46,27 +40,18 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "insn-codes.h"
#include "recog.h"
-#include "output.h"
+#include "toplev.h"
#undef MAX /* sys/param.h may also define these */
#undef MIN
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <ctype.h>
#include "tree.h"
#include "expr.h"
#include "flags.h"
#include "reload.h"
+#include "output.h"
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
-#if defined(USG) || defined(NO_STAB_H)
+#if defined(USG) || !defined(HAVE_STAB_H)
#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
#else
#include <stab.h> /* On BSD, use the system's stab.h. */
@@ -78,22 +63,8 @@ Boston, MA 02111-1307, USA. */
#define STAB_CODE_TYPE int
#endif
-extern void abort ();
-extern int atoi ();
-extern char *getenv ();
extern char *mktemp ();
-
-extern rtx adj_offsettable_operand ();
-extern rtx copy_to_reg ();
-extern void error ();
extern tree lookup_name ();
-extern void pfatal_with_name ();
-extern void warning ();
-
-extern FILE *asm_out_file;
-
-static void mips16_output_gp_offset ();
-static void build_mips16_function_stub ();
/* Enumeration for all of the relational tests, so that we can build
arrays indexed by the test type, and not worry about the order
@@ -113,6 +84,30 @@ enum internal_test {
ITEST_MAX
};
+
+struct constant;
+static enum internal_test map_test_to_internal_test PROTO ((enum rtx_code));
+static int mips16_simple_memory_operand PROTO ((rtx, rtx,
+ enum machine_mode));
+static int m16_check_op PROTO ((rtx, int, int, int));
+static void block_move_loop PROTO ((rtx, rtx, int, int,
+ rtx, rtx));
+static void block_move_call PROTO ((rtx, rtx, rtx));
+static FILE *make_temp_file PROTO ((void));
+static void save_restore_insns PROTO ((int, rtx,
+ long, FILE *));
+static void mips16_output_gp_offset PROTO ((FILE *, rtx));
+static void mips16_fp_args PROTO ((FILE *, int, int));
+static void build_mips16_function_stub PROTO ((FILE *));
+static void mips16_optimize_gp PROTO ((rtx));
+static rtx add_constant PROTO ((struct constant **,
+ rtx,
+ enum machine_mode));
+static void dump_constants PROTO ((struct constant *,
+ rtx));
+static rtx mips_find_symbol PROTO ((rtx));
+
+
/* Global variables for machine-dependent things. */
/* Threshold for data being put into the small data/bss area, instead
@@ -213,7 +208,7 @@ int mips_abi;
/* Strings to hold which cpu and instruction set architecture to use. */
char *mips_cpu_string; /* for -mcpu=<xxx> */
char *mips_isa_string; /* for -mips{1,2,3,4} */
-char *mips_abi_string; /* for -mabi={o32,32,n32,n64,64,eabi} */
+char *mips_abi_string; /* for -mabi={32,n32,64,eabi} */
/* Whether we are generating mips16 code. This is a synonym for
TARGET_MIPS16, and exists for use as an attribute. */
@@ -249,6 +244,9 @@ enum mips_abicalls_type mips_abicalls;
initialized in override_options. */
REAL_VALUE_TYPE dfhigh, dflow, sfhigh, sflow;
+/* Mode used for saving/restoring general purpose registers. */
+static enum machine_mode gpr_mode;
+
/* Array giving truth value on whether or not a given hard register
can support a given mode. */
char mips_hard_regno_mode_ok[(int)MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
@@ -478,7 +476,7 @@ arith32_operand (op, mode)
int
small_int (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT && SMALL_INT (op));
}
@@ -489,7 +487,7 @@ small_int (op, mode)
int
large_int (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
HOST_WIDE_INT value;
@@ -807,6 +805,17 @@ double_memory_operand (op, mode)
&& double_memory_operand (reg_equiv_mem[REGNO (op)], mode))
return 1;
+ /* All reloaded addresses are valid in TARGET_64BIT mode. This is
+ the same test performed for 'm' in find_reloads. */
+
+ if (reload_in_progress
+ && TARGET_64BIT
+ && (GET_CODE (op) == MEM
+ || (GET_CODE (op) == REG
+ && REGNO (op) >= FIRST_PSEUDO_REGISTER
+ && reg_renumber[REGNO (op)] < 0)))
+ return 1;
+
if (reload_in_progress
&& TARGET_MIPS16
&& GET_CODE (op) == MEM)
@@ -921,7 +930,7 @@ cmp_op (op, mode)
int
pc_or_label_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (op == pc_rtx)
return 1;
@@ -940,7 +949,7 @@ pc_or_label_operand (op, mode)
int
call_insn_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (CONSTANT_ADDRESS_P (op)
|| (GET_CODE (op) == REG && op != arg_pointer_rtx
@@ -1123,7 +1132,7 @@ se_nonimmediate_operand (op, mode)
int
consttable_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return CONSTANT_P (op);
}
@@ -1185,7 +1194,7 @@ m16_check_op (op, low, high, mask)
int
m16_uimm3_b (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, 0x1, 0x8, 0);
}
@@ -1193,7 +1202,7 @@ m16_uimm3_b (op, mode)
int
m16_simm4_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0x8, 0x7, 0);
}
@@ -1201,7 +1210,7 @@ m16_simm4_1 (op, mode)
int
m16_nsimm4_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0x7, 0x8, 0);
}
@@ -1209,7 +1218,7 @@ m16_nsimm4_1 (op, mode)
int
m16_simm5_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0x10, 0xf, 0);
}
@@ -1217,7 +1226,7 @@ m16_simm5_1 (op, mode)
int
m16_nsimm5_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0xf, 0x10, 0);
}
@@ -1225,7 +1234,7 @@ m16_nsimm5_1 (op, mode)
int
m16_uimm5_4 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, (- 0x10) << 2, 0xf << 2, 3);
}
@@ -1233,7 +1242,7 @@ m16_uimm5_4 (op, mode)
int
m16_nuimm5_4 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, (- 0xf) << 2, 0x10 << 2, 3);
}
@@ -1241,7 +1250,7 @@ m16_nuimm5_4 (op, mode)
int
m16_simm8_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0x80, 0x7f, 0);
}
@@ -1249,7 +1258,7 @@ m16_simm8_1 (op, mode)
int
m16_nsimm8_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0x7f, 0x80, 0);
}
@@ -1257,7 +1266,7 @@ m16_nsimm8_1 (op, mode)
int
m16_uimm8_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, 0x0, 0xff, 0);
}
@@ -1265,7 +1274,7 @@ m16_uimm8_1 (op, mode)
int
m16_nuimm8_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0xff, 0x0, 0);
}
@@ -1273,7 +1282,7 @@ m16_nuimm8_1 (op, mode)
int
m16_uimm8_m1_1 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, - 0x1, 0xfe, 0);
}
@@ -1281,7 +1290,7 @@ m16_uimm8_m1_1 (op, mode)
int
m16_uimm8_4 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, 0x0, 0xff << 2, 3);
}
@@ -1289,7 +1298,7 @@ m16_uimm8_4 (op, mode)
int
m16_nuimm8_4 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, (- 0xff) << 2, 0x0, 3);
}
@@ -1297,7 +1306,7 @@ m16_nuimm8_4 (op, mode)
int
m16_simm8_8 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, (- 0x80) << 3, 0x7f << 3, 7);
}
@@ -1305,7 +1314,7 @@ m16_simm8_8 (op, mode)
int
m16_nsimm8_8 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return m16_check_op (op, (- 0x7f) << 3, 0x80 << 3, 7);
}
@@ -1319,7 +1328,7 @@ m16_nsimm8_8 (op, mode)
int
m16_usym8_4 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == SYMBOL_REF
&& SYMBOL_REF_FLAG (op)
@@ -1346,7 +1355,7 @@ m16_usym8_4 (op, mode)
int
m16_usym5_4 (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == SYMBOL_REF
&& SYMBOL_REF_FLAG (op)
@@ -1758,7 +1767,7 @@ mips_move_1word (operands, insn, unsignedp)
if (ret != (char *)0 && MEM_VOLATILE_P (op1))
{
- int i = strlen (ret);
+ size_t i = strlen (ret);
if (i > sizeof (volatile_buffer) - sizeof ("%{%}"))
abort ();
@@ -1982,7 +1991,7 @@ mips_move_1word (operands, insn, unsignedp)
if (ret != 0 && MEM_VOLATILE_P (op0))
{
- int i = strlen (ret);
+ size_t i = strlen (ret);
if (i > sizeof (volatile_buffer) - sizeof ("%{%}"))
abort ();
@@ -2315,7 +2324,7 @@ mips_move_2words (operands, insn)
if (ret != 0 && MEM_VOLATILE_P (op1))
{
- int i = strlen (ret);
+ size_t i = strlen (ret);
if (i > sizeof (volatile_buffer) - sizeof ("%{%}"))
abort ();
@@ -2426,7 +2435,7 @@ mips_move_2words (operands, insn)
if (ret != 0 && MEM_VOLATILE_P (op0))
{
- int i = strlen (ret);
+ size_t i = strlen (ret);
if (i > sizeof (volatile_buffer) - sizeof ("%{%}"))
abort ();
@@ -3104,6 +3113,10 @@ expand_block_move (operands)
if (TARGET_MEMCPY)
block_move_call (dest_reg, src_reg, bytes_rtx);
+ else if (constp && bytes <= 2 * MAX_MOVE_BYTES
+ && align == UNITS_PER_WORD)
+ move_by_pieces (orig_dest, orig_src, bytes, align);
+
else if (constp && bytes <= 2 * MAX_MOVE_BYTES)
emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode,
dest_reg),
@@ -3529,9 +3542,9 @@ output_block_move (insn, operands, num_regs, move_type)
void
init_cumulative_args (cum, fntype, libname)
- CUMULATIVE_ARGS *cum; /* argument info to initialize */
- tree fntype; /* tree ptr for function decl */
- rtx libname; /* SYMBOL_REF of library name or 0 */
+ CUMULATIVE_ARGS *cum; /* argument info to initialize */
+ tree fntype; /* tree ptr for function decl */
+ rtx libname ATTRIBUTE_UNUSED; /* SYMBOL_REF of library name or 0 */
{
static CUMULATIVE_ARGS zero_cum;
tree param, next_param;
@@ -3579,10 +3592,14 @@ function_arg_advance (cum, mode, type, named)
int named; /* whether or not the argument was named */
{
if (TARGET_DEBUG_E_MODE)
- fprintf (stderr,
- "function_adv({gp reg found = %d, arg # = %2d, words = %2d}, %4s, 0x%.8x, %d )\n\n",
- cum->gp_reg_found, cum->arg_number, cum->arg_words,
- GET_MODE_NAME (mode), type, named);
+ {
+ fprintf (stderr,
+ "function_adv({gp reg found = %d, arg # = %2d, words = %2d}, %4s, ",
+ cum->gp_reg_found, cum->arg_number, cum->arg_words,
+ GET_MODE_NAME (mode));
+ fprintf (stderr, HOST_PTR_PRINTF, type);
+ fprintf (stderr, ", %d )\n\n", named);
+ }
cum->arg_number++;
switch (mode)
@@ -3658,10 +3675,15 @@ function_arg (cum, mode, type, named)
|| TREE_CODE (type) == QUAL_UNION_TYPE));
if (TARGET_DEBUG_E_MODE)
- fprintf (stderr,
- "function_arg( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, 0x%.8x, %d ) = ",
- cum->gp_reg_found, cum->arg_number, cum->arg_words,
- GET_MODE_NAME (mode), type, named);
+ {
+ fprintf (stderr,
+ "function_arg( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, ",
+ cum->gp_reg_found, cum->arg_number, cum->arg_words,
+ GET_MODE_NAME (mode));
+ fprintf (stderr, HOST_PTR_PRINTF, type);
+ fprintf (stderr, ", %d ) = ", named);
+ }
+
cum->last_arg_fp = 0;
switch (mode)
@@ -3893,7 +3915,7 @@ function_arg_partial_nregs (cum, mode, type, named)
CUMULATIVE_ARGS *cum; /* current arg information */
enum machine_mode mode; /* current arg mode */
tree type; /* type of the argument or 0 if lib support */
- int named; /* != 0 for normal args, == 0 for ... args */
+ int named ATTRIBUTE_UNUSED;/* != 0 for normal args, == 0 for ... args */
{
if ((mode == BLKmode
|| GET_MODE_CLASS (mode) != MODE_COMPLEX_INT
@@ -3986,7 +4008,7 @@ override_options ()
if (mips_isa_string == 0)
mips_isa = MIPS_ISA_DEFAULT;
- else if (isdigit (*mips_isa_string))
+ else if (ISDIGIT (*mips_isa_string))
{
mips_isa = atoi (mips_isa_string);
if (mips_isa == 16)
@@ -4022,13 +4044,11 @@ override_options ()
/* Get the ABI to use. Currently this code is only used for Irix 6. */
if (mips_abi_string == (char *) 0)
mips_abi = MIPS_ABI_DEFAULT;
- else if (! strcmp (mips_abi_string, "32")
- || ! strcmp (mips_abi_string, "o32"))
+ else if (! strcmp (mips_abi_string, "32"))
mips_abi = ABI_32;
else if (! strcmp (mips_abi_string, "n32"))
mips_abi = ABI_N32;
- else if (! strcmp (mips_abi_string, "64")
- || ! strcmp (mips_abi_string, "n64"))
+ else if (! strcmp (mips_abi_string, "64"))
mips_abi = ABI_64;
else if (! strcmp (mips_abi_string, "eabi"))
mips_abi = ABI_EABI;
@@ -4443,6 +4463,10 @@ override_options ()
mips_hard_regno_mode_ok[(int)mode][regno] = temp;
}
}
+
+ /* Save GPR registers in word_mode sized hunks. word_mode hasn't been
+ initialized yet, so we can't use that here. */
+ gpr_mode = TARGET_64BIT ? DImode : SImode;
}
/* On the mips16, we want to allocate $24 (T_REG) before other
@@ -4790,7 +4814,7 @@ print_operand (file, op, letter)
}
else if (letter == 'x' && GET_CODE (op) == CONST_INT)
- fprintf (file, "0x%04x", 0xffff & INTVAL(op));
+ fprintf (file, HOST_WIDE_INT_PRINT_HEX, 0xffff & INTVAL(op));
else if (letter == 'X' && GET_CODE(op) == CONST_INT)
fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (op));
@@ -4948,7 +4972,7 @@ print_operand_address (file, addr)
int
mips_output_external (file, decl, name)
- FILE *file;
+ FILE *file ATTRIBUTE_UNUSED;
tree decl;
char *name;
{
@@ -5160,8 +5184,8 @@ mips_output_lineno (stream, line)
void
final_prescan_insn (insn, opvec, noperands)
rtx insn;
- rtx opvec[];
- int noperands;
+ rtx opvec[] ATTRIBUTE_UNUSED;
+ int noperands ATTRIBUTE_UNUSED;
{
if (dslots_number_nops > 0)
{
@@ -5489,7 +5513,7 @@ compute_frame_size (size)
|| (GET_MODE_SIZE (DECL_MODE (DECL_RESULT (current_function_decl)))
<= 4))))
{
- gp_reg_size += UNITS_PER_WORD;
+ gp_reg_size += GET_MODE_SIZE (gpr_mode);
mask |= 1L << (regno - GP_REG_FIRST);
/* The entry and exit pseudo instructions can not save $17
@@ -5576,9 +5600,10 @@ compute_frame_size (size)
top of the stack. */
if (! mips_entry)
offset = (args_size + extra_size + var_size
- + gp_reg_size - UNITS_PER_WORD);
+ + gp_reg_size - GET_MODE_SIZE (gpr_mode));
else
- offset = total_size - UNITS_PER_WORD;
+ offset = total_size - GET_MODE_SIZE (gpr_mode);
+
current_frame_info.gp_sp_offset = offset;
current_frame_info.gp_save_offset = offset - total_size;
}
@@ -5654,11 +5679,12 @@ save_restore_insns (store_p, large_reg, large_offset, file)
gp_offset = current_frame_info.gp_sp_offset;
end_offset
- = gp_offset - (current_frame_info.gp_reg_size - UNITS_PER_WORD);
+ = gp_offset - (current_frame_info.gp_reg_size
+ - GET_MODE_SIZE (gpr_mode));
if (gp_offset < 0 || end_offset < 0)
fatal ("gp_offset (%ld) or end_offset (%ld) is less than zero.",
- gp_offset, end_offset);
+ (long) gp_offset, (long) end_offset);
/* If we see a large frame in mips16 mode, we save the registers
before adjusting the stack pointer, and load them afterward. */
@@ -5736,13 +5762,16 @@ save_restore_insns (store_p, large_reg, large_offset, file)
RTX_FRAME_RELATED_P (insn) = 1;
}
else
- fprintf (file, "\tli\t%s,0x%.08lx\t# %ld\n\t%s\t%s,%s,%s\n",
- reg_names[MIPS_TEMP2_REGNUM],
- base_offset, base_offset,
- Pmode == DImode ? "daddu" : "addu",
- reg_names[MIPS_TEMP2_REGNUM],
- reg_names[MIPS_TEMP2_REGNUM],
- reg_names[STACK_POINTER_REGNUM]);
+ {
+ fprintf (file, "\tli\t%s,0x%.08lx\t# ",
+ reg_names[MIPS_TEMP2_REGNUM], base_offset);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, base_offset);
+ fprintf (file, "\n\t%s\t%s,%s,%s\n",
+ Pmode == DImode ? "daddu" : "addu",
+ reg_names[MIPS_TEMP2_REGNUM],
+ reg_names[MIPS_TEMP2_REGNUM],
+ reg_names[STACK_POINTER_REGNUM]);
+ }
}
/* When we restore the registers in MIPS16 mode, then if we are
@@ -5765,7 +5794,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
{
rtx reg_rtx;
rtx mem_rtx
- = gen_rtx (MEM, word_mode,
+ = gen_rtx (MEM, gpr_mode,
gen_rtx (PLUS, Pmode, base_reg_rtx,
GEN_INT (gp_offset - base_offset)));
@@ -5775,23 +5804,23 @@ save_restore_insns (store_p, large_reg, large_offset, file)
$31, so we load $7 instead, and work things out
in the caller. */
if (TARGET_MIPS16 && ! store_p && regno == GP_REG_FIRST + 31)
- reg_rtx = gen_rtx (REG, word_mode, GP_REG_FIRST + 7);
+ reg_rtx = gen_rtx (REG, gpr_mode, GP_REG_FIRST + 7);
/* The mips16 sometimes needs to save $18. */
else if (TARGET_MIPS16
&& regno != GP_REG_FIRST + 31
&& ! M16_REG_P (regno))
{
if (! store_p)
- reg_rtx = gen_rtx (REG, word_mode, 6);
+ reg_rtx = gen_rtx (REG, gpr_mode, 6);
else
{
- reg_rtx = gen_rtx (REG, word_mode, 3);
+ reg_rtx = gen_rtx (REG, gpr_mode, 3);
emit_move_insn (reg_rtx,
- gen_rtx (REG, word_mode, regno));
+ gen_rtx (REG, gpr_mode, regno));
}
}
else
- reg_rtx = gen_rtx (REG, word_mode, regno);
+ reg_rtx = gen_rtx (REG, gpr_mode, regno);
if (store_p)
{
@@ -5805,7 +5834,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
if (TARGET_MIPS16
&& regno != GP_REG_FIRST + 31
&& ! M16_REG_P (regno))
- emit_move_insn (gen_rtx (REG, word_mode, regno),
+ emit_move_insn (gen_rtx (REG, gpr_mode, regno),
reg_rtx);
}
}
@@ -5835,13 +5864,14 @@ save_restore_insns (store_p, large_reg, large_offset, file)
reg_names[r], reg_names[regno]);
}
}
- fprintf (file, "\t%s\t%s,%ld(%s)\n",
+ fprintf (file, "\t%s\t%s,",
(TARGET_64BIT
? (store_p) ? "sd" : "ld"
: (store_p) ? "sw" : "lw"),
- reg_names[r],
- gp_offset - base_offset,
- reg_names[REGNO(base_reg_rtx)]);
+ reg_names[r]);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ gp_offset - base_offset);
+ fprintf (file, "(%s)\n", reg_names[REGNO(base_reg_rtx)]);
if (! store_p
&& TARGET_MIPS16
&& regno != GP_REG_FIRST + 31
@@ -5851,7 +5881,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
}
}
- gp_offset -= UNITS_PER_WORD;
+ gp_offset -= GET_MODE_SIZE (gpr_mode);
}
}
else
@@ -5869,7 +5899,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
if (fp_offset < 0 || end_offset < 0)
fatal ("fp_offset (%ld) or end_offset (%ld) is less than zero.",
- fp_offset, end_offset);
+ (long) fp_offset, (long) end_offset);
else if (fp_offset < 32768)
base_reg_rtx = stack_pointer_rtx, base_offset = 0;
@@ -5949,13 +5979,16 @@ save_restore_insns (store_p, large_reg, large_offset, file)
RTX_FRAME_RELATED_P (insn) = 1;
}
else
- fprintf (file, "\tli\t%s,0x%.08lx\t# %ld\n\t%s\t%s,%s,%s\n",
- reg_names[MIPS_TEMP2_REGNUM],
- base_offset, base_offset,
- Pmode == DImode ? "daddu" : "addu",
- reg_names[MIPS_TEMP2_REGNUM],
- reg_names[MIPS_TEMP2_REGNUM],
- reg_names[STACK_POINTER_REGNUM]);
+ {
+ fprintf (file, "\tli\t%s,0x%.08lx\t# ",
+ reg_names[MIPS_TEMP2_REGNUM], base_offset);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, base_offset);
+ fprintf (file, "\n\t%s\t%s,%s,%s\n",
+ Pmode == DImode ? "daddu" : "addu",
+ reg_names[MIPS_TEMP2_REGNUM],
+ reg_names[MIPS_TEMP2_REGNUM],
+ reg_names[STACK_POINTER_REGNUM]);
+ }
}
for (regno = FP_REG_LAST-1; regno >= FP_REG_FIRST; regno -= fp_inc)
@@ -5981,13 +6014,16 @@ save_restore_insns (store_p, large_reg, large_offset, file)
emit_move_insn (reg_rtx, mem_rtx);
}
else
- fprintf (file, "\t%s\t%s,%ld(%s)\n",
- (TARGET_SINGLE_FLOAT
- ? (store_p ? "s.s" : "l.s")
- : (store_p ? "s.d" : "l.d")),
- reg_names[regno],
- fp_offset - base_offset,
- reg_names[REGNO(base_reg_rtx)]);
+ {
+ fprintf (file, "\t%s\t%s,",
+ (TARGET_SINGLE_FLOAT
+ ? (store_p ? "s.s" : "l.s")
+ : (store_p ? "s.d" : "l.d")),
+ reg_names[regno]);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ fp_offset - base_offset);
+ fprintf (file, "(%s)\n", reg_names[REGNO(base_reg_rtx)]);
+ }
fp_offset -= fp_size;
}
@@ -5999,7 +6035,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
void
function_prologue (file, size)
FILE *file;
- int size;
+ int size ATTRIBUTE_UNUSED;
{
#ifndef FUNCTION_NAME_ALREADY_DECLARED
char *fnname;
@@ -6325,9 +6361,10 @@ mips_expand_prologue ()
{
if (offset != 0)
ptr = gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (offset));
- emit_move_insn (gen_rtx (MEM, word_mode, ptr),
- gen_rtx (REG, word_mode, regno));
- offset += UNITS_PER_WORD;
+ emit_move_insn (gen_rtx (MEM, gpr_mode, ptr),
+ gen_rtx (REG, gpr_mode, regno));
+
+ offset += GET_MODE_SIZE (gpr_mode);
}
}
@@ -6372,7 +6409,7 @@ mips_expand_prologue ()
moment. */
if (TARGET_MIPS16 && BITSET_P (current_frame_info.mask, 18))
{
- rtx reg_rtx = gen_rtx (REG, word_mode, GP_REG_FIRST + 3);
+ rtx reg_rtx = gen_rtx (REG, gpr_mode, GP_REG_FIRST + 3);
long gp_offset, base_offset;
gp_offset = current_frame_info.gp_sp_offset;
@@ -6388,8 +6425,8 @@ mips_expand_prologue ()
base_offset = 0;
start_sequence ();
emit_move_insn (reg_rtx,
- gen_rtx (REG, word_mode, GP_REG_FIRST + 18));
- emit_move_insn (gen_rtx (MEM, word_mode,
+ gen_rtx (REG, gpr_mode, GP_REG_FIRST + 18));
+ emit_move_insn (gen_rtx (MEM, gpr_mode,
gen_rtx (PLUS, Pmode, stack_pointer_rtx,
GEN_INT (gp_offset
- base_offset))),
@@ -6556,8 +6593,8 @@ mips_expand_prologue ()
void
function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+ FILE *file ATTRIBUTE_UNUSED;
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED;
{
char *fnname;
@@ -6588,7 +6625,7 @@ function_epilogue (file, size)
dslots_load_total += num_regs;
fprintf (stderr,
- "%-20s fp=%c leaf=%c alloca=%c setjmp=%c stack=%4ld arg=%3ld reg=%2d/%d delay=%3d/%3dL %3d/%3dJ refs=%3d/%3d/%3d",
+ "%-20s fp=%c leaf=%c alloca=%c setjmp=%c stack=%4ld arg=%3d reg=%2d/%d delay=%3d/%3dL %3d/%3dJ refs=%3d/%3d/%3d",
name, frame_pointer_needed ? 'y' : 'n',
(current_frame_info.mask & RA_MASK) != 0 ? 'n' : 'y',
current_function_calls_alloca ? 'y' : 'n',
@@ -6790,7 +6827,7 @@ mips_can_use_return_insn ()
void
mips_select_rtx_section (mode, x)
enum machine_mode mode;
- rtx x;
+ rtx x ATTRIBUTE_UNUSED;
{
if (TARGET_MIPS16)
{
@@ -6890,7 +6927,7 @@ mips_select_section (decl, reloc)
rtx
mips_function_value (valtype, func)
tree valtype;
- tree func;
+ tree func ATTRIBUTE_UNUSED;
{
int reg = GP_RETURN;
enum machine_mode mode = TYPE_MODE (valtype);
@@ -6985,10 +7022,10 @@ mips_function_value (valtype, func)
int
function_arg_pass_by_reference (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
+ CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
enum machine_mode mode;
tree type;
- int named;
+ int named ATTRIBUTE_UNUSED;
{
int size;
@@ -7054,14 +7091,14 @@ mips_secondary_reload_class (class, mode, x, in_p)
to a general register, or when copying from register 0. */
if (class == HILO_REG && regno != GP_REG_FIRST + 0)
return ((! in_p
- && GP_REG_P (regno)
+ && gp_reg_p
&& GET_MODE_SIZE (mode) <= GET_MODE_SIZE (SImode))
- ? NO_REGS : GR_REGS);
+ ? NO_REGS : gr_regs);
else if (regno == HILO_REGNUM)
return ((in_p
- && class == GR_REGS
+ && class == gr_regs
&& GET_MODE_SIZE (mode) <= GET_MODE_SIZE (SImode))
- ? NO_REGS : GR_REGS);
+ ? NO_REGS : gr_regs);
/* Copying from HI or LO to anywhere other than a general register
requires a general register. */
@@ -7072,7 +7109,7 @@ mips_secondary_reload_class (class, mode, x, in_p)
/* We can't really copy to HI or LO at all in mips16 mode. */
return M16_REGS;
}
- return gp_reg_p ? NO_REGS : GR_REGS;
+ return gp_reg_p ? NO_REGS : gr_regs;
}
if (MD_REG_P (regno))
{
@@ -7081,7 +7118,7 @@ mips_secondary_reload_class (class, mode, x, in_p)
/* We can't really copy to HI or LO at all in mips16 mode. */
return M16_REGS;
}
- return class == gr_regs ? NO_REGS : GR_REGS;
+ return class == gr_regs ? NO_REGS : gr_regs;
}
/* We can only copy a value to a condition code register from a
@@ -8376,3 +8413,29 @@ machine_dependent_reorg (first)
constants table, we don't need to output the constant in the real
constant table, but we have no way to prevent that. */
}
+
+/* Return nonzero if X is a SIGN or ZERO extend operator. */
+int
+extend_operator (x, mode)
+ rtx x;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ enum rtx_code code = GET_CODE (x);
+ return code == SIGN_EXTEND || code == ZERO_EXTEND;
+}
+
+/* Accept any operator that can be used to shift the high half of the
+ input value to the lower half, suitable for truncation. The
+ remainder (the lower half of the input, and the upper half of the
+ output) will be discarded. */
+int
+highpart_shift_operator (x, mode)
+ rtx x;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ enum rtx_code code = GET_CODE (x);
+ return (code == LSHIFTRT
+ || code == ASHIFTRT
+ || code == ROTATERT
+ || code == ROTATE);
+}
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index f8907e5d6a4..72e77b01398 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -260,6 +260,8 @@ extern int se_uns_arith_operand ();
extern int se_arith_operand ();
extern int se_nonmemory_operand ();
extern int se_nonimmediate_operand ();
+extern int extend_operator ();
+extern int highpart_shift_operator ();
extern int m16_uimm3_b ();
extern int m16_simm4_1 ();
extern int m16_nsimm4_1 ();
@@ -340,11 +342,11 @@ extern void mips_select_section ();
#define MASK_DEBUG_B 0x10000000 /* GO_IF_LEGITIMATE_ADDRESS debug */
#define MASK_DEBUG_C 0x08000000 /* don't expand seq, etc. */
#define MASK_DEBUG_D 0x04000000 /* don't do define_split's */
-#define MASK_DEBUG_E 0x02000000 /* function_arg debug */
+#define MASK_DEBUG_E 0 /* function_arg debug */
#define MASK_DEBUG_F 0
#define MASK_DEBUG_G 0 /* don't support 64 bit arithmetic */
#define MASK_DEBUG_H 0 /* allow ints in FP registers */
-#define MASK_DEBUG_I 0x00200000 /* unused */
+#define MASK_DEBUG_I 0 /* unused */
/* r4000 64 bit sizes */
#define TARGET_INT64 (target_flags & MASK_INT64)
@@ -568,12 +570,10 @@ extern void mips_select_section ();
#define SUBTARGET_TARGET_OPTIONS
#define GENERATE_BRANCHLIKELY (!TARGET_MIPS16 && (TARGET_MIPS3900 || (mips_isa >= 2)))
+
+/* Generate three-operand multiply instructions for both SImode and DImode. */
#define GENERATE_MULT3 (TARGET_MIPS3900 \
&& !TARGET_MIPS16)
-#define GENERATE_MADD (TARGET_MIPS3900 \
- && !TARGET_MIPS16)
-
-
/* Macros to decide whether certain features are available or not,
depending on the instruction set architecture level. */
@@ -716,7 +716,7 @@ while (0)
/* Tell collect what flags to pass to nm. */
#ifndef NM_FLAGS
-#define NM_FLAGS "-Bp"
+#define NM_FLAGS "-Bn"
#endif
@@ -1710,6 +1710,9 @@ enum reg_class
LO_REG, /* lo register */
HILO_REG, /* hilo register pair for 64 bit mode mult */
MD_REGS, /* multiply/divide registers (hi/lo) */
+ HI_AND_GR_REGS, /* union classes */
+ LO_AND_GR_REGS,
+ HILO_AND_GR_REGS,
ST_REGS, /* status registers (fp status) */
ALL_REGS, /* all registers */
LIM_REG_CLASSES /* max value + 1 */
@@ -1736,6 +1739,9 @@ enum reg_class
"LO_REG", \
"HILO_REG", \
"MD_REGS", \
+ "HI_AND_GR_REGS", \
+ "LO_AND_GR_REGS", \
+ "HILO_AND_GR_REGS", \
"ST_REGS", \
"ALL_REGS" \
}
@@ -1764,6 +1770,9 @@ enum reg_class
{ 0x00000000, 0x00000000, 0x00000002 }, /* lo register */ \
{ 0x00000000, 0x00000000, 0x00000004 }, /* hilo register */ \
{ 0x00000000, 0x00000000, 0x00000003 }, /* mul/div registers */ \
+ { 0xffffffff, 0x00000000, 0x00000001 }, /* union classes */ \
+ { 0xffffffff, 0x00000000, 0x00000002 }, \
+ { 0xffffffff, 0x00000000, 0x00000004 }, \
{ 0x00000000, 0x00000000, 0x000007f8 }, /* status registers */ \
{ 0xffffffff, 0xffffffff, 0x000007ff } /* all registers */ \
}
@@ -3034,7 +3043,13 @@ typedef struct mips_args {
constants which are put in the .text section. We also record the
total length of all such strings; this total is used to decide
whether we need to split the constant table, and need not be
- precisely correct. */
+ precisely correct.
+
+ When not mips16 code nor embedded PIC, if a symbol is in a
+ gp addresable section, SYMBOL_REF_FLAG is set prevent gcc from
+ splitting the reference so that gas can generate a gp relative
+ reference.
+ */
#define ENCODE_SECTION_INFO(DECL) \
do \
@@ -3061,6 +3076,16 @@ do \
SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (DECL), 0)) = 1; \
} \
\
+ else if (TREE_CODE (DECL) == VAR_DECL \
+ && DECL_SECTION_NAME (DECL) != NULL_TREE \
+ && (0 == strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (DECL)), \
+ ".sdata") \
+ || 0 == strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (DECL)),\
+ ".sbss"))) \
+ { \
+ SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
+ } \
+ \
else if (TARGET_GP_OPT && TREE_CODE (DECL) == VAR_DECL) \
{ \
int size = int_size_in_bytes (TREE_TYPE (DECL)); \
@@ -3561,6 +3586,13 @@ while (0)
(((mips_cpu == PROCESSOR_R4000 || mips_cpu == PROCESSOR_R6000) ? 6 : 4) \
+ memory_move_secondary_cost ((MODE), (CLASS), (TO_P)))
+/* Define if copies to/from condition code registers should be avoided.
+
+ This is needed for the MIPS because reload_outcc is not complete;
+ it needs to handle cases where the source is a general or another
+ condition code register. */
+#define AVOID_CCMODE_COPIES
+
/* A C expression for the cost of a branch instruction. A value of
1 is the default; other values are interpreted relative to that. */
@@ -3634,7 +3666,10 @@ while (0)
REG, SIGN_EXTEND }}, \
{"se_nonimmediate_operand", { SUBREG, REG, MEM, SIGN_EXTEND }}, \
{"consttable_operand", { LABEL_REF, SYMBOL_REF, CONST_INT, \
- CONST_DOUBLE, CONST }},
+ CONST_DOUBLE, CONST }}, \
+ {"extend_operator", { SIGN_EXTEND, ZERO_EXTEND }}, \
+ {"highpart_shift_operator", { ASHIFTRT, LSHIFTRT, ROTATERT, ROTATE }},
+
/* If defined, a C statement to be executed just prior to the
@@ -3980,7 +4015,7 @@ while (0)
#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
mips_output_lineno (STREAM, LINE)
-/* The MIPS implementation uses some labels for it's own purpose. The
+/* The MIPS implementation uses some labels for its own purpose. The
following lists what labels are created, and are all formed by the
pattern $L[a-z].*. The machine independent portion of GCC creates
labels matching: $L[A-Z][0-9]+ and $L[0-9]+.
@@ -4098,7 +4133,7 @@ while (0)
This is suitable for output with `assemble_name'. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM)
+ sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM))
/* This is how to output an assembler line defining a `double' constant. */
@@ -4215,7 +4250,7 @@ do { \
to a multiple of 2**LOG bytes. */
#define ASM_OUTPUT_ALIGN(STREAM,LOG) \
- fprintf (STREAM, "\t.align\t%d\n", (LOG));
+ fprintf (STREAM, "\t.align\t%d\n", (LOG))
/* This is how to output an assembler line to advance the location
counter by SIZE bytes. */
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 37b0519c305..18d4a76c303 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -69,15 +69,6 @@
;; # instructions (4 bytes each)
(define_attr "length" "" (const_int 1))
-;; whether or not an instruction has a mandatory delay slot
-(define_attr "dslot" "no,yes"
- (if_then_else (ior (eq_attr "type" "branch,jump,call,xfer,hilo,fcmp")
- (and (eq_attr "type" "load")
- (and (eq (symbol_ref "mips_isa") (const_int 1))
- (eq (symbol_ref "mips16") (const_int 0)))))
- (const_string "yes")
- (const_string "no")))
-
;; Attribute describing the processor. This attribute must match exactly
;; with the processor_type enumeration in mips.h.
@@ -94,6 +85,18 @@
"default,r3000,r3900,r6000,r4000,r4100,r4300,r4600,r4650,r5000,r8000"
(const (symbol_ref "mips_cpu_attr")))
+;; Does the instruction have a mandatory delay slot?
+;; The 3900, is (mostly) mips1, but does not have a manditory load delay
+;; slot.
+(define_attr "dslot" "no,yes"
+ (if_then_else (ior (eq_attr "type" "branch,jump,call,xfer,hilo,fcmp")
+ (and (eq_attr "type" "load")
+ (and (eq (symbol_ref "mips_isa") (const_int 1))
+ (and (eq (symbol_ref "mips16") (const_int 0))
+ (eq_attr "cpu" "!r3900")))))
+ (const_string "yes")
+ (const_string "no")))
+
;; Attribute defining whether or not we can use the branch-likely instructions
(define_attr "branch_likely" "no,yes"
@@ -1628,6 +1631,7 @@
(set_attr "mode" "SF")
(set_attr "length" "2")]) ;; mul.s + nop
+
;; ??? The R4000 (only) has a cpu bug. If a double-word shift executes while
;; a multiply is in progress, it may give an incorrect result. Avoid
;; this by keeping the mflo with the mult on the R4000.
@@ -1641,10 +1645,8 @@
""
"
{
- if (GENERATE_MULT3)
+ if (HAVE_mulsi3_mult3)
emit_insn (gen_mulsi3_mult3 (operands[0], operands[1], operands[2]));
- else if (TARGET_MAD)
- emit_insn (gen_mulsi3_r4650 (operands[0], operands[1], operands[2]));
else if (mips_cpu != PROCESSOR_R4000 || TARGET_MIPS16)
emit_insn (gen_mulsi3_internal (operands[0], operands[1], operands[2]));
else
@@ -1653,14 +1655,22 @@
}")
(define_insn "mulsi3_mult3"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (mult:SI (match_operand:SI 1 "register_operand" "d")
- (match_operand:SI 2 "register_operand" "d")))
- (clobber (match_scratch:SI 3 "=h"))
- (clobber (match_scratch:SI 4 "=l"))
- (clobber (match_scratch:SI 5 "=a"))]
- "GENERATE_MULT3"
- "mult\\t%0,%1,%2"
+ [(set (match_operand:SI 0 "register_operand" "=d,l")
+ (mult:SI (match_operand:SI 1 "register_operand" "d,d")
+ (match_operand:SI 2 "register_operand" "d,d")))
+ (clobber (match_scratch:SI 3 "=h,h"))
+ (clobber (match_scratch:SI 4 "=l,X"))
+ (clobber (match_scratch:SI 5 "=a,a"))]
+ "GENERATE_MULT3
+ || TARGET_MAD"
+ "*
+{
+ if (which_alternative == 1)
+ return \"mult\\t%1,%2\";
+ if (TARGET_MAD)
+ return \"mul\\t%0,%1,%2\";
+ return \"mult\\t%0,%1,%2\";
+}"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
@@ -1700,18 +1710,76 @@
(set_attr "mode" "SI")
(set_attr "length" "3")]) ;; mult + mflo + delay
-(define_insn "mulsi3_r4650"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (mult:SI (match_operand:SI 1 "register_operand" "d")
- (match_operand:SI 2 "register_operand" "d")))
- (clobber (match_scratch:SI 3 "=h"))
- (clobber (match_scratch:SI 4 "=l"))
- (clobber (match_scratch:SI 5 "=a"))]
- "TARGET_MAD"
- "mul\\t%0,%1,%2"
- [(set_attr "type" "imul")
+;; Multiply-accumulate patterns
+
+;; For processors that can copy the output to a general register:
+;;
+;; The all-d alternative is needed because the combiner will find this
+;; pattern and then register alloc/reload will move registers around to
+;; make them fit, and we don't want to trigger unnecessary loads to LO.
+;;
+;; The last alternative should be made slightly less desirable, but adding
+;; "?" to the constraint is too strong, and causes values to be loaded into
+;; LO even when that's more costly. For now, using "*d" mostly does the
+;; trick.
+(define_insn "*mul_acc_si"
+ [(set (match_operand:SI 0 "register_operand" "=l,*d,*d")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d,d,d")
+ (match_operand:SI 2 "register_operand" "d,d,d"))
+ (match_operand:SI 3 "register_operand" "0,l,*d")))
+ (clobber (match_scratch:SI 4 "=h,h,h"))
+ (clobber (match_scratch:SI 5 "=X,3,l"))
+ (clobber (match_scratch:SI 6 "=a,a,a"))
+ (clobber (match_scratch:SI 7 "=X,X,d"))]
+ "TARGET_MIPS3900
+ && !TARGET_MIPS16"
+ "*
+{
+ static char *const madd[] = { \"madd\\t%1,%2\", \"madd\\t%0,%1,%2\" };
+ if (which_alternative == 2)
+ return \"#\";
+ return madd[which_alternative];
+}"
+ [(set_attr "type" "imul,imul,multi")
(set_attr "mode" "SI")
- (set_attr "length" "1")])
+ (set_attr "length" "1,1,2")])
+
+;; Split the above insn if we failed to get LO allocated.
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" ""))
+ (match_operand:SI 3 "register_operand" "")))
+ (clobber (match_scratch:SI 4 ""))
+ (clobber (match_scratch:SI 5 ""))
+ (clobber (match_scratch:SI 6 ""))
+ (clobber (match_scratch:SI 7 ""))]
+ "reload_completed && GP_REG_P (true_regnum (operands[0])) && GP_REG_P (true_regnum (operands[3]))"
+ [(parallel [(set (match_dup 7)
+ (mult:SI (match_dup 1) (match_dup 2)))
+ (clobber (match_dup 4))
+ (clobber (match_dup 5))
+ (clobber (match_dup 6))])
+ (set (match_dup 0) (plus:SI (match_dup 7) (match_dup 3)))]
+ "")
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (minus:SI (match_operand:SI 1 "register_operand" "")
+ (mult:SI (match_operand:SI 2 "register_operand" "")
+ (match_operand:SI 3 "register_operand" ""))))
+ (clobber (match_scratch:SI 4 ""))
+ (clobber (match_scratch:SI 5 ""))
+ (clobber (match_scratch:SI 6 ""))
+ (clobber (match_scratch:SI 7 ""))]
+ "reload_completed && GP_REG_P (true_regnum (operands[0])) && GP_REG_P (true_regnum (operands[1]))"
+ [(parallel [(set (match_dup 7)
+ (mult:SI (match_dup 2) (match_dup 3)))
+ (clobber (match_dup 4))
+ (clobber (match_dup 5))
+ (clobber (match_dup 6))])
+ (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 7)))]
+ "")
(define_expand "muldi3"
[(set (match_operand:DI 0 "register_operand" "=l")
@@ -1720,6 +1788,7 @@
(clobber (match_scratch:DI 3 "=h"))
(clobber (match_scratch:DI 4 "=a"))]
"TARGET_64BIT"
+
"
{
if (GENERATE_MULT3 || mips_cpu == PROCESSOR_R4000 || TARGET_MIPS16)
@@ -1786,50 +1855,16 @@
""
"
{
+ rtx dummy = gen_rtx (SIGN_EXTEND, DImode, const0_rtx);
if (TARGET_64BIT)
- emit_insn (gen_mulsidi3_64bit (operands[0], operands[1], operands[2]));
+ emit_insn (gen_mulsidi3_64bit (operands[0], operands[1], operands[2],
+ dummy, dummy));
else
- emit_insn (gen_mulsidi3_internal (operands[0], operands[1], operands[2]));
+ emit_insn (gen_mulsidi3_internal (operands[0], operands[1], operands[2],
+ dummy, dummy));
DONE;
}")
-(define_insn "mulsidi3_internal"
- [(set (match_operand:DI 0 "register_operand" "=x")
- (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
- (sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))
- (clobber (match_scratch:SI 3 "=a"))]
- "!TARGET_64BIT"
- "mult\\t%1,%2"
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
-(define_insn "mulsidi3_64bit"
- [(set (match_operand:DI 0 "register_operand" "=a")
- (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
- (sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))
- (clobber (match_scratch:DI 3 "=l"))
- (clobber (match_scratch:DI 4 "=h"))]
- "TARGET_64BIT"
- "mult\\t%1,%2"
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
-(define_insn "smulsi3_highpart"
- [(set (match_operand:SI 0 "register_operand" "=h")
- (truncate:SI
- (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
- (sign_extend:DI (match_operand:SI 2 "register_operand" "d")))
- (const_int 32))))
- (clobber (match_scratch:SI 3 "=l"))
- (clobber (match_scratch:SI 4 "=a"))]
- ""
- "mult\\t%1,%2"
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
(define_expand "umulsidi3"
[(set (match_operand:DI 0 "register_operand" "=x")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
@@ -1837,46 +1872,117 @@
""
"
{
+ rtx dummy = gen_rtx (ZERO_EXTEND, DImode, const0_rtx);
if (TARGET_64BIT)
- emit_insn (gen_umulsidi3_64bit (operands[0], operands[1], operands[2]));
+ emit_insn (gen_mulsidi3_64bit (operands[0], operands[1], operands[2],
+ dummy, dummy));
else
- emit_insn (gen_umulsidi3_internal (operands[0], operands[1], operands[2]));
+ emit_insn (gen_mulsidi3_internal (operands[0], operands[1], operands[2],
+ dummy, dummy));
DONE;
}")
-(define_insn "umulsidi3_internal"
+(define_insn "mulsidi3_internal"
[(set (match_operand:DI 0 "register_operand" "=x")
- (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
- (zero_extend:DI (match_operand:SI 2 "register_operand" "d"))))
- (clobber (match_scratch:SI 3 "=a"))]
- "!TARGET_64BIT"
- "multu\\t%1,%2"
+ (mult:DI (match_operator:DI 3 "extend_operator"
+ [(match_operand:SI 1 "register_operand" "d")])
+ (match_operator:DI 4 "extend_operator"
+ [(match_operand:SI 2 "register_operand" "d")])))
+ (clobber (match_scratch:SI 5 "=a"))]
+ "!TARGET_64BIT && GET_CODE (operands[3]) == GET_CODE (operands[4])"
+ "*
+{
+ if (GET_CODE (operands[3]) == SIGN_EXTEND)
+ return \"mult\\t%1,%2\";
+ return \"multu\\t%1,%2\";
+}"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
-(define_insn "umulsidi3_64bit"
+(define_insn "mulsidi3_64bit"
[(set (match_operand:DI 0 "register_operand" "=a")
- (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
- (zero_extend:DI (match_operand:SI 2 "register_operand" "d"))))
- (clobber (match_scratch:DI 3 "=l"))
- (clobber (match_scratch:DI 4 "=h"))]
- "TARGET_64BIT"
- "multu\\t%1,%2"
+ (mult:DI (match_operator:DI 3 "extend_operator"
+ [(match_operand:SI 1 "register_operand" "d")])
+ (match_operator:DI 4 "extend_operator"
+ [(match_operand:SI 2 "register_operand" "d")])))
+ (clobber (match_scratch:DI 5 "=l"))
+ (clobber (match_scratch:DI 6 "=h"))]
+ "TARGET_64BIT && GET_CODE (operands[3]) == GET_CODE (operands[4])"
+ "*
+{
+ if (GET_CODE (operands[3]) == SIGN_EXTEND)
+ return \"mult\\t%1,%2\";
+ return \"multu\\t%1,%2\";
+}"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
-(define_insn "umulsi3_highpart"
+;; _highpart patterns
+(define_expand "smulsi3_highpart"
+ [(set (match_operand:SI 0 "register_operand" "=h")
+ (truncate:SI
+ (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
+ (sign_extend:DI (match_operand:SI 2 "register_operand" "d")))
+ (const_int 32))))]
+ ""
+ "
+{
+ rtx dummy = gen_rtx (SIGN_EXTEND, DImode, const0_rtx);
+ rtx dummy2 = gen_rtx_LSHIFTRT (DImode, const0_rtx, const0_rtx);
+#ifndef NO_MD_PROTOTYPES
+ rtx (*genfn) PROTO((rtx, rtx, rtx, rtx, rtx, rtx));
+#else
+ rtx (*genfn) ();
+#endif
+ genfn = gen_xmulsi3_highpart_internal;
+ emit_insn ((*genfn) (operands[0], operands[1], operands[2], dummy,
+ dummy, dummy2));
+ DONE;
+}")
+
+(define_expand "umulsi3_highpart"
[(set (match_operand:SI 0 "register_operand" "=h")
(truncate:SI
(lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "d")))
- (const_int 32))))
- (clobber (match_scratch:SI 3 "=l"))
- (clobber (match_scratch:SI 4 "=a"))]
+ (const_int 32))))]
""
- "multu\\t%1,%2"
+ "
+{
+ rtx dummy = gen_rtx (ZERO_EXTEND, DImode, const0_rtx);
+ rtx dummy2 = gen_rtx_LSHIFTRT (DImode, const0_rtx, const0_rtx);
+#ifndef NO_MD_PROTOTYPES
+ rtx (*genfn) PROTO((rtx, rtx, rtx, rtx, rtx, rtx));
+#else
+ rtx (*genfn) ();
+#endif
+ genfn = gen_xmulsi3_highpart_internal;
+ emit_insn ((*genfn) (operands[0], operands[1], operands[2], dummy,
+ dummy, dummy2));
+ DONE;
+}")
+
+(define_insn "xmulsi3_highpart_internal"
+ [(set (match_operand:SI 0 "register_operand" "=h")
+ (truncate:SI
+ (match_operator:DI 5 "highpart_shift_operator"
+ [(mult:DI (match_operator:DI 3 "extend_operator"
+ [(match_operand:SI 1 "register_operand" "d")])
+ (match_operator:DI 4 "extend_operator"
+ [(match_operand:SI 2 "register_operand" "d")]))
+ (const_int 32)])))
+ (clobber (match_scratch:SI 6 "=l"))
+ (clobber (match_scratch:SI 7 "=a"))]
+ "GET_CODE (operands[3]) == GET_CODE (operands[4])"
+ "*
+{
+ if (GET_CODE (operands[3]) == SIGN_EXTEND)
+ return \"mult\\t%1,%2\";
+ else
+ return \"multu\\t%1,%2\";
+}"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
@@ -1919,86 +2025,53 @@
(match_dup 0)))
(clobber (match_scratch:SI 3 "=h"))
(clobber (match_scratch:SI 4 "=a"))]
- "TARGET_MAD || GENERATE_MADD"
- "*
-{
- if (TARGET_MAD)
- return \"mad\\t%1,%2\";
- else
- return \"madd\\t%1,%2\";
-}"
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
-(define_insn "maddi"
- [(set (match_operand:DI 0 "register_operand" "+x")
- (plus:DI (mult:DI (sign_extend:DI
- (match_operand:SI 1 "register_operand" "d"))
- (sign_extend:DI
- (match_operand:SI 2 "register_operand" "d")))
- (match_dup 0)))
- (clobber (match_scratch:SI 3 "=a"))]
- "TARGET_MAD && ! TARGET_64BIT"
- "mad\\t%1,%2"
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
-(define_insn "maddi_64bit"
- [(set (match_operand:DI 0 "register_operand" "+a")
- (plus:DI (mult:DI (sign_extend:DI
- (match_operand:SI 1 "register_operand" "d"))
- (sign_extend:DI
- (match_operand:SI 2 "register_operand" "d")))
- (match_dup 0)))
- (clobber (match_scratch:DI 3 "=l"))
- (clobber (match_scratch:DI 4 "=h"))]
- "TARGET_MAD && TARGET_64BIT"
+ "TARGET_MAD"
"mad\\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
-(define_insn "umaddi"
+(define_insn "*mul_acc_di"
[(set (match_operand:DI 0 "register_operand" "+x")
- (plus:DI (mult:DI (zero_extend:DI
- (match_operand:SI 1 "register_operand" "d"))
- (zero_extend:DI
- (match_operand:SI 2 "register_operand" "d")))
+ (plus:DI (mult:DI (match_operator:DI 3 "extend_operator"
+ [(match_operand:SI 1 "register_operand" "d")])
+ (match_operator:DI 4 "extend_operator"
+ [(match_operand:SI 2 "register_operand" "d")]))
(match_dup 0)))
- (clobber (match_scratch:SI 3 "=a"))]
- "TARGET_MAD && ! TARGET_64BIT"
- "madu\\t%1,%2"
+ (clobber (match_scratch:SI 5 "=a"))]
+ "TARGET_MAD
+ && ! TARGET_64BIT
+ && GET_CODE (operands[3]) == GET_CODE (operands[4])"
+ "*
+{
+ if (GET_CODE (operands[3]) == SIGN_EXTEND)
+ return \"mad\\t%1,%2\";
+ else
+ return \"madu\\t%1,%2\";
+}"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
-(define_insn "umaddi_64bit"
+(define_insn "*mul_acc_64bit_di"
[(set (match_operand:DI 0 "register_operand" "+a")
- (plus:DI (mult:DI (zero_extend:DI
- (match_operand:SI 1 "register_operand" "d"))
- (zero_extend:DI
- (match_operand:SI 2 "register_operand" "d")))
+ (plus:DI (mult:DI (match_operator:DI 3 "extend_operator"
+ [(match_operand:SI 1 "register_operand" "d")])
+ (match_operator:DI 4 "extend_operator"
+ [(match_operand:SI 2 "register_operand" "d")]))
(match_dup 0)))
- (clobber (match_scratch:DI 3 "=l"))
- (clobber (match_scratch:DI 4 "=h"))]
- "TARGET_MAD && TARGET_64BIT"
- "madu\\t%1,%2"
- [(set_attr "type" "imul")
- (set_attr "mode" "SI")
- (set_attr "length" "1")])
-
-(define_insn "madd3"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d")
- (match_operand:SI 2 "register_operand" "d"))
- (match_operand:SI 3 "register_operand" "l")))
- (clobber (match_scratch:SI 4 "=l"))
(clobber (match_scratch:SI 5 "=h"))
- (clobber (match_scratch:SI 6 "=a"))]
- "GENERATE_MADD"
- "madd\\t%0,%1,%2"
+ (clobber (match_scratch:SI 6 "=l"))]
+ "TARGET_MAD
+ && TARGET_64BIT
+ && GET_CODE (operands[3]) == GET_CODE (operands[4])"
+ "*
+{
+ if (GET_CODE (operands[3]) == SIGN_EXTEND)
+ return \"mad\\t%1,%2\";
+ else
+ return \"madu\\t%1,%2\";
+}"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
(set_attr "length" "1")])
@@ -4151,24 +4224,30 @@ move\\t%0,%z4\\n\\
;; Bit field extract patterns which use lwl/lwr.
-;; ??? There should be DImode variants for 64 bit code, but the current
-;; bitfield scheme can't handle that. We would need to add new optabs
-;; in order to make that work.
-
;; ??? There could be HImode variants for the ulh/ulhu/ush macros.
;; It isn't clear whether this will give better code.
+;; Only specify the mode operand 1, the rest are assumed to be word_mode.
(define_expand "extv"
- [(set (match_operand:SI 0 "register_operand" "")
- (sign_extract:SI (match_operand:QI 1 "memory_operand" "")
- (match_operand:SI 2 "immediate_operand" "")
- (match_operand:SI 3 "immediate_operand" "")))]
+ [(set (match_operand 0 "register_operand" "")
+ (sign_extract (match_operand:QI 1 "memory_operand" "")
+ (match_operand 2 "immediate_operand" "")
+ (match_operand 3 "immediate_operand" "")))]
"!TARGET_MIPS16"
"
{
- /* If this isn't a 32 bit field, and it doesn't start on a byte boundary
- then fail. */
- if (INTVAL (operands[2]) != 32 || (INTVAL (operands[3]) % 8) != 0)
+ /* If the field does not start on a byte boundary, then fail. */
+ if (INTVAL (operands[3]) % 8 != 0)
+ FAIL;
+
+ /* MIPS I and MIPS II can only handle a 32bit field. */
+ if (!TARGET_64BIT && INTVAL (operands[2]) != 32)
+ FAIL;
+
+ /* MIPS III and MIPS IV can handle both 32bit and 64bit fields. */
+ if (TARGET_64BIT
+ && INTVAL (operands[2]) != 64
+ && INTVAL (operands[2]) != 32)
FAIL;
/* This can happen for a 64 bit target, when extracting a value from
@@ -4180,22 +4259,43 @@ move\\t%0,%z4\\n\\
/* Change the mode to BLKmode for aliasing purposes. */
operands[1] = change_address (operands[1], BLKmode, XEXP (operands[1], 0));
- /* Otherwise, emit a lwl/lwr pair to load the value. */
- emit_insn (gen_movsi_ulw (operands[0], operands[1]));
+ /* Otherwise, emit a l[wd]l/l[wd]r pair to load the value. */
+ if (INTVAL (operands[2]) == 64)
+ emit_insn (gen_movdi_uld (operands[0], operands[1]));
+ else
+ {
+ if (TARGET_64BIT)
+ {
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ if (operands[0] == NULL_RTX)
+ FAIL;
+ }
+ emit_insn (gen_movsi_ulw (operands[0], operands[1]));
+ }
DONE;
}")
+;; Only specify the mode operand 1, the rest are assumed to be word_mode.
(define_expand "extzv"
- [(set (match_operand:SI 0 "register_operand" "")
- (zero_extract:SI (match_operand:QI 1 "memory_operand" "")
- (match_operand:SI 2 "immediate_operand" "")
- (match_operand:SI 3 "immediate_operand" "")))]
+ [(set (match_operand 0 "register_operand" "")
+ (zero_extract (match_operand:QI 1 "memory_operand" "")
+ (match_operand 2 "immediate_operand" "")
+ (match_operand 3 "immediate_operand" "")))]
"!TARGET_MIPS16"
"
{
- /* If this isn't a 32 bit field, and it doesn't start on a byte boundary
- then fail. */
- if (INTVAL (operands[2]) != 32 || (INTVAL (operands[3]) % 8) != 0)
+ /* If the field does not start on a byte boundary, then fail. */
+ if (INTVAL (operands[3]) % 8 != 0)
+ FAIL;
+
+ /* MIPS I and MIPS II can only handle a 32bit field. */
+ if (!TARGET_64BIT && INTVAL (operands[2]) != 32)
+ FAIL;
+
+ /* MIPS III and MIPS IV can handle both 32bit and 64bit fields. */
+ if (TARGET_64BIT
+ && INTVAL (operands[2]) != 64
+ && INTVAL (operands[2]) != 32)
FAIL;
/* This can happen for a 64 bit target, when extracting a value from
@@ -4208,21 +4308,42 @@ move\\t%0,%z4\\n\\
operands[1] = change_address (operands[1], BLKmode, XEXP (operands[1], 0));
/* Otherwise, emit a lwl/lwr pair to load the value. */
- emit_insn (gen_movsi_ulw (operands[0], operands[1]));
+ if (INTVAL (operands[2]) == 64)
+ emit_insn (gen_movdi_uld (operands[0], operands[1]));
+ else
+ {
+ if (TARGET_64BIT)
+ {
+ operands[0] = gen_lowpart (SImode, operands[0]);
+ if (operands[0] == NULL_RTX)
+ FAIL;
+ }
+ emit_insn (gen_movsi_ulw (operands[0], operands[1]));
+ }
DONE;
}")
+;; Only specify the mode operands 0, the rest are assumed to be word_mode.
(define_expand "insv"
- [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "")
- (match_operand:SI 1 "immediate_operand" "")
- (match_operand:SI 2 "immediate_operand" ""))
- (match_operand:SI 3 "register_operand" ""))]
+ [(set (zero_extract (match_operand:QI 0 "memory_operand" "")
+ (match_operand 1 "immediate_operand" "")
+ (match_operand 2 "immediate_operand" ""))
+ (match_operand 3 "register_operand" ""))]
"!TARGET_MIPS16"
"
{
- /* If this isn't a 32 bit field, and it doesn't start on a byte boundary
- then fail. */
- if (INTVAL (operands[1]) != 32 || (INTVAL (operands[2]) % 8) != 0)
+ /* If the field does not start on a byte boundary, then fail. */
+ if (INTVAL (operands[2]) % 8 != 0)
+ FAIL;
+
+ /* MIPS I and MIPS II can only handle a 32bit field. */
+ if (!TARGET_64BIT && INTVAL (operands[1]) != 32)
+ FAIL;
+
+ /* MIPS III and MIPS IV can handle both 32bit and 64bit fields. */
+ if (TARGET_64BIT
+ && INTVAL (operands[1]) != 64
+ && INTVAL (operands[1]) != 32)
FAIL;
/* This can happen for a 64 bit target, when storing into a 32 bit union
@@ -4234,8 +4355,19 @@ move\\t%0,%z4\\n\\
/* Change the mode to BLKmode for aliasing purposes. */
operands[0] = change_address (operands[0], BLKmode, XEXP (operands[0], 0));
- /* Otherwise, emit a swl/swr pair to load the value. */
- emit_insn (gen_movsi_usw (operands[0], operands[3]));
+ /* Otherwise, emit a s[wd]l/s[wd]r pair to load the value. */
+ if (INTVAL (operands[1]) == 64)
+ emit_insn (gen_movdi_usd (operands[0], operands[3]));
+ else
+ {
+ if (TARGET_64BIT)
+ {
+ operands[3] = gen_lowpart (SImode, operands[3]);
+ if (operands[3] == NULL_RTX)
+ FAIL;
+ }
+ emit_insn (gen_movsi_usw (operands[0], operands[3]));
+ }
DONE;
}")
@@ -4296,6 +4428,65 @@ move\\t%0,%z4\\n\\
(set_attr "mode" "SI")
(set_attr "length" "2,4")])
+;; Bit field extract patterns which use ldl/ldr.
+
+;; unaligned double word moves generated by the bit field patterns
+
+(define_insn "movdi_uld"
+ [(set (match_operand:DI 0 "register_operand" "=&d,&d")
+ (unspec:DI [(match_operand:BLK 1 "general_operand" "R,o")] 0))]
+ ""
+ "*
+{
+ rtx offset = const0_rtx;
+ rtx addr = XEXP (operands[1], 0);
+ rtx mem_addr = eliminate_constant_term (addr, &offset);
+ char *ret;
+
+ if (TARGET_STATS)
+ mips_count_memory_refs (operands[1], 2);
+
+ /* The stack/frame pointers are always aligned, so we can convert
+ to the faster lw if we are referencing an aligned stack location. */
+
+ if ((INTVAL (offset) & 7) == 0
+ && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
+ ret = \"ld\\t%0,%1\";
+ else
+ ret = \"uld\\t%0,%1\";
+
+ return mips_fill_delay_slot (ret, DELAY_LOAD, operands, insn);
+}"
+ [(set_attr "type" "load,load")
+ (set_attr "mode" "SI")
+ (set_attr "length" "2,4")])
+
+(define_insn "movdi_usd"
+ [(set (match_operand:BLK 0 "memory_operand" "=R,o")
+ (unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ,dJ")] 1))]
+ ""
+ "*
+{
+ rtx offset = const0_rtx;
+ rtx addr = XEXP (operands[0], 0);
+ rtx mem_addr = eliminate_constant_term (addr, &offset);
+
+ if (TARGET_STATS)
+ mips_count_memory_refs (operands[0], 2);
+
+ /* The stack/frame pointers are always aligned, so we can convert
+ to the faster sw if we are referencing an aligned stack location. */
+
+ if ((INTVAL (offset) & 7) == 0
+ && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
+ return \"sd\\t%1,%0\";
+
+ return \"usd\\t%z1,%0\";
+}"
+ [(set_attr "type" "store")
+ (set_attr "mode" "SI")
+ (set_attr "length" "2,4")])
+
;; These two patterns support loading addresses with two instructions instead
;; of using the macro instruction la.
@@ -4576,7 +4767,7 @@ move\\t%0,%z4\\n\\
(define_expand "reload_indi"
[(set (match_operand:DI 0 "register_operand" "=b")
- (match_operand:DI 1 "movdi_operand" "b"))
+ (match_operand:DI 1 "" "b"))
(clobber (match_operand:TI 2 "register_operand" "=&d"))]
"TARGET_64BIT"
"
@@ -4591,10 +4782,12 @@ move\\t%0,%z4\\n\\
if (GET_CODE (operands[1]) == MEM)
{
rtx memword, offword, hiword, loword;
+ rtx addr = find_replacement (&XEXP (operands[1], 0));
+ rtx op1 = change_address (operands[1], VOIDmode, addr);
scratch = gen_rtx (REG, SImode, REGNO (scratch));
- memword = change_address (operands[1], SImode, NULL_RTX);
- offword = change_address (adj_offsettable_operand (operands[1], 4),
+ memword = change_address (op1, SImode, NULL_RTX);
+ offword = change_address (adj_offsettable_operand (op1, 4),
SImode, NULL_RTX);
if (BYTES_BIG_ENDIAN)
{
@@ -4643,7 +4836,7 @@ move\\t%0,%z4\\n\\
;; use a TImode scratch reg.
(define_expand "reload_outdi"
- [(set (match_operand:DI 0 "general_operand" "=b")
+ [(set (match_operand:DI 0 "" "=b")
(match_operand:DI 1 "se_register_operand" "b"))
(clobber (match_operand:TI 2 "register_operand" "=&d"))]
"TARGET_64BIT"
@@ -4665,10 +4858,12 @@ move\\t%0,%z4\\n\\
if (GET_CODE (operands[0]) == MEM)
{
rtx scratch, memword, offword, hiword, loword;
+ rtx addr = find_replacement (&XEXP (operands[0], 0));
+ rtx op0 = change_address (operands[0], VOIDmode, addr);
scratch = gen_rtx (REG, SImode, REGNO (operands[2]));
- memword = change_address (operands[0], SImode, NULL_RTX);
- offword = change_address (adj_offsettable_operand (operands[0], 4),
+ memword = change_address (op0, SImode, NULL_RTX);
+ offword = change_address (adj_offsettable_operand (op0, 4),
SImode, NULL_RTX);
if (BYTES_BIG_ENDIAN)
{
@@ -5053,7 +5248,9 @@ move\\t%0,%z4\\n\\
DONE;
}
/* FIXME: I don't know how to get a value into the HI register. */
- if (GET_CODE (operands[0]) == REG && GP_REG_P (operands[0]))
+ if (GET_CODE (operands[0]) == REG
+ && (TARGET_MIPS16 ? M16_REG_P (REGNO (operands[0]))
+ : GP_REG_P (REGNO (operands[0]))))
{
emit_move_insn (operands[0], operands[1]);
DONE;
@@ -5360,7 +5557,7 @@ move\\t%0,%z4\\n\\
(define_split
[(set (match_operand:HI 0 "register_operand" "")
- (mem:SI (plus:SI (match_dup 0)
+ (mem:HI (plus:SI (match_dup 0)
(match_operand:SI 1 "const_int_operand" ""))))]
"TARGET_MIPS16 && reload_completed
&& GET_CODE (operands[0]) == REG
@@ -6687,7 +6884,7 @@ move\\t%0,%z4\\n\\
;; to make it simple enough for combine to understand.
(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "d,d")
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
(lshiftrt:SI (match_operand:SI 1 "memory_operand" "R,m")
(match_operand:SI 2 "immediate_operand" "I,I")))]
"TARGET_MIPS16"
@@ -8630,8 +8827,6 @@ move\\t%0,%z4\\n\\
""
"
{
- rtx dest;
-
if (operands[0]) /* eliminate unused code warnings */
{
if (TARGET_MIPS16)
@@ -8688,9 +8883,10 @@ move\\t%0,%z4\\n\\
(set_attr "length" "1")])
(define_expand "tablejump_internal3"
- [(set (pc)
- (plus:SI (match_operand:SI 0 "register_operand" "d")
- (label_ref:SI (match_operand:SI 1 "" ""))))]
+ [(parallel [(set (pc)
+ (plus:SI (match_operand:SI 0 "register_operand" "d")
+ (label_ref:SI (match_operand:SI 1 "" ""))))
+ (use (label_ref:SI (match_dup 1)))])]
""
"")
@@ -8739,7 +8935,8 @@ move\\t%0,%z4\\n\\
}")
;;; Make sure that this only matches the insn before ADDR_DIFF_VEC. Otherwise
-;;; it is not valid.
+;;; it is not valid. ??? With the USE, the condition tests may not be required
+;;; any longer.
;;; ??? The length depends on the ABI. It is two for o32, and one for n32.
;;; We just use the conservative number here.
@@ -8747,7 +8944,8 @@ move\\t%0,%z4\\n\\
(define_insn ""
[(set (pc)
(plus:SI (match_operand:SI 0 "register_operand" "d")
- (label_ref:SI (match_operand:SI 1 "" ""))))]
+ (label_ref:SI (match_operand:SI 1 "" ""))))
+ (use (label_ref:SI (match_dup 1)))]
"!(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]"
@@ -8763,19 +8961,22 @@ move\\t%0,%z4\\n\\
(set_attr "length" "2")])
(define_expand "tablejump_internal4"
- [(set (pc)
- (plus:DI (match_operand:DI 0 "se_register_operand" "d")
- (label_ref:DI (match_operand:SI 1 "" ""))))]
+ [(parallel [(set (pc)
+ (plus:DI (match_operand:DI 0 "se_register_operand" "d")
+ (label_ref:DI (match_operand:SI 1 "" ""))))
+ (use (label_ref:DI (match_dup 1)))])]
""
"")
;;; Make sure that this only matches the insn before ADDR_DIFF_VEC. Otherwise
-;;; it is not valid.
+;;; it is not valid. ??? With the USE, the condition tests may not be required
+;;; any longer.
(define_insn ""
[(set (pc)
(plus:DI (match_operand:DI 0 "se_register_operand" "d")
- (label_ref:DI (match_operand:SI 1 "" ""))))]
+ (label_ref:DI (match_operand:SI 1 "" ""))))
+ (use (label_ref:DI (match_dup 1)))]
"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]"
diff --git a/gcc/config/mips/xm-iris5.h b/gcc/config/mips/xm-iris5.h
index f3eb9cdb753..616055f27f7 100644
--- a/gcc/config/mips/xm-iris5.h
+++ b/gcc/config/mips/xm-iris5.h
@@ -1,7 +1,5 @@
#include "mips/xm-mips.h"
-#define USG
-
/* On SGI IRIX 5.3, inttypes.h clashes with sys/types.h, but the clash
(when compiled with GCC) is a warning, so configure.in thinks it's OK
to use it. Work around this problem. */
diff --git a/gcc/config/mips/xm-netbsd.h b/gcc/config/mips/xm-netbsd.h
deleted file mode 100644
index b9d3c709d9d..00000000000
--- a/gcc/config/mips/xm-netbsd.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "mips/xm-mips.h"
-#include "config/xm-netbsd.h"
diff --git a/gcc/config/mn10200/mn10200.h b/gcc/config/mn10200/mn10200.h
index 20db8a5ad09..d2b474d5d70 100644
--- a/gcc/config/mn10200/mn10200.h
+++ b/gcc/config/mn10200/mn10200.h
@@ -645,20 +645,18 @@ extern struct rtx_def *function_arg();
/* Nonzero if X is a hard reg that can be used as an index
or if it is a pseudo reg. */
#define REG_OK_FOR_INDEX_P(X) \
- (GET_MODE (X) == PSImode \
- && ((REGNO (X) >= 0 && REGNO(X) <= 3) || REGNO (X) >= FIRST_PSEUDO_REGISTER))
+ (((REGNO (X) >= 0 && REGNO(X) <= 3) || REGNO (X) >= FIRST_PSEUDO_REGISTER))
/* Nonzero if X is a hard reg that can be used as a base reg
or if it is a pseudo reg. */
#define REG_OK_FOR_BASE_P(X) \
- (GET_MODE (X) == PSImode \
- && ((REGNO (X) >= 4 && REGNO(X) <= 8) || REGNO (X) >= FIRST_PSEUDO_REGISTER))
+ (((REGNO (X) >= 4 && REGNO(X) <= 8) || REGNO (X) >= FIRST_PSEUDO_REGISTER))
#else
/* Nonzero if X is a hard reg that can be used as an index. */
#define REG_OK_FOR_INDEX_P(X) \
- (GET_MODE (X) == PSImode) && REGNO_OK_FOR_INDEX_P (REGNO (X))
+ REGNO_OK_FOR_INDEX_P (REGNO (X))
/* Nonzero if X is a hard reg that can be used as a base reg. */
#define REG_OK_FOR_BASE_P(X) \
- (GET_MODE (X) == PSImode) && REGNO_OK_FOR_BASE_P (REGNO (X))
+ REGNO_OK_FOR_BASE_P (REGNO (X))
#endif
@@ -691,11 +689,9 @@ extern struct rtx_def *function_arg();
if (GET_CODE (X) == PLUS) \
{ \
rtx base = 0, index = 0; \
- if (REG_P (XEXP (X, 0)) \
- && REG_OK_FOR_BASE_P (XEXP (X, 0))) \
+ if (RTX_OK_FOR_BASE_P (XEXP (X, 0))) \
base = XEXP (X, 0), index = XEXP (X, 1); \
- if (REG_P (XEXP (X, 1)) \
- && REG_OK_FOR_BASE_P (XEXP (X, 1))) \
+ if (RTX_OK_FOR_BASE_P (XEXP (X, 1))) \
base = XEXP (X, 1), index = XEXP (X, 0); \
if (base != 0 && index != 0) \
{ \
@@ -983,6 +979,10 @@ do { char dstr[30]; \
((GET_CODE (X) == PLUS ? OFFSET : 0) \
+ (frame_pointer_needed ? 0 : -total_frame_size ()))
+/* We need to prepend underscores. */
+#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \
+ fprintf ((FILE), "\t%s\t_%s", UNALIGNED_WORD_ASM_OP, (ADDR))
+
/* Define to use software floating point emulator for REAL_ARITHMETIC and
decimal <-> binary conversion. */
#define REAL_ARITHMETIC
diff --git a/gcc/config/mn10200/mn10200.md b/gcc/config/mn10200/mn10200.md
index fe46101130b..7659ce763cc 100644
--- a/gcc/config/mn10200/mn10200.md
+++ b/gcc/config/mn10200/mn10200.md
@@ -1020,7 +1020,7 @@
extxbu %L0\;sub %H0,%H0
mov %1,%L0\;extxbu %L0\;sub %H0,%H0
movbu %1,%L0\;sub %H0,%H0"
- [(set_attr "cc" "none_0hit")])
+ [(set_attr "cc" "clobber")])
(define_insn "zero_extendhipsi2"
[(set (match_operand:PSI 0 "general_operand" "=d,d,d")
@@ -1041,7 +1041,7 @@
"@
sub %H0,%H0
mov %1,%L0\;sub %H0,%H0"
- [(set_attr "cc" "none_0hit")])
+ [(set_attr "cc" "clobber,clobber")])
;; The last alternative is necessary because the second operand might
;; have been the frame pointer. The frame pointer would get replaced
@@ -1118,7 +1118,7 @@
else
return \"movb %1,%L0\;mov %L0,%H0\;add %H0,%H0\;subc %H0,%H0\";
}"
- [(set_attr "cc" "none_0hit")])
+ [(set_attr "cc" "clobber")])
(define_insn "extendhipsi2"
[(set (match_operand:PSI 0 "general_operand" "=d,d,d")
@@ -1140,7 +1140,7 @@
mov %L0,%H0\;add %H0,%H0\;subc %H0,%H0
mov %1,%L0\;mov %L0,%H0\;add %H0,%H0\;subc %H0,%H0
mov %1,%L0\;mov %L0,%H0\;add %H0,%H0\;subc %H0,%H0"
- [(set_attr "cc" "none_0hit")])
+ [(set_attr "cc" "clobber")])
;; The last alternative is necessary because the second operand might
;; have been the frame pointer. The frame pointer would get replaced
@@ -1186,7 +1186,7 @@
extxbu %L0\;sub %H0,%H0
mov %1,%L0\;extxbu %L0\;sub %H0,%H0
movbu %1,%L0\;sub %H0,%H0"
- [(set_attr "cc" "none_0hit")])
+ [(set_attr "cc" "clobber")])
(define_insn ""
[(set (match_operand:PSI 0 "general_operand" "=d,d,d")
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index d813f2c32cc..9f1ff842ab3 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -36,25 +36,13 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "obstack.h"
-/* Global registers known to hold the value zero.
-
- Normally we'd depend on CSE and combine to put zero into a
- register and re-use it.
-
- However, on the mn10x00 processors we implicitly use the constant
- zero in tst instructions, so we might be able to do better by
- loading the value into a register in the prologue, then re-useing
- that register throughout the function.
-
- We could perform similar optimizations for other constants, but with
- gcse due soon, it doesn't seem worth the effort.
-
- These variables hold a rtx for a register known to hold the value
- zero throughout the entire function, or NULL if no register of
- the appropriate class has such a value throughout the life of the
- function. */
-rtx zero_dreg;
-rtx zero_areg;
+/* The size of the callee register save area. Right now we save everything
+ on entry since it costs us nothing in code size. It does cost us from a
+ speed standpoint, so we want to optimize this sooner or later. */
+#define REG_SAVE_BYTES (4 * regs_ever_live[2] \
+ + 4 * regs_ever_live[3] \
+ + 4 * regs_ever_live[6] \
+ + 4 * regs_ever_live[7])
void
asm_file_start (file)
@@ -374,127 +362,11 @@ can_use_return_insn ()
&& !frame_pointer_needed);
}
-/* Count the number of tst insns which compare a data or address
- register with zero. */
-static void
-count_tst_insns (dreg_countp, areg_countp)
- int *dreg_countp;
- int *areg_countp;
-{
- rtx insn;
-
- /* Assume no tst insns exist. */
- *dreg_countp = 0;
- *areg_countp = 0;
-
- /* If not optimizing, then quit now. */
- if (!optimize)
- return;
-
- /* Walk through all the insns. */
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- rtx pat;
-
- /* Ignore anything that is not a normal INSN. */
- if (GET_CODE (insn) != INSN)
- continue;
-
- /* Ignore anything that isn't a SET. */
- pat = PATTERN (insn);
- if (GET_CODE (pat) != SET)
- continue;
-
- /* Check for a tst insn. */
- if (SET_DEST (pat) == cc0_rtx
- && GET_CODE (SET_SRC (pat)) == REG)
- {
- if (REGNO_REG_CLASS (REGNO (SET_SRC (pat))) == DATA_REGS)
- (*dreg_countp)++;
-
- if (REGNO_REG_CLASS (REGNO (SET_SRC (pat))) == ADDRESS_REGS)
- (*areg_countp)++;
- }
-
- /* Setting an address register to zero can also be optimized,
- so count it just like a tst insn. */
- if (GET_CODE (SET_DEST (pat)) == REG
- && GET_CODE (SET_SRC (pat)) == CONST_INT
- && INTVAL (SET_SRC (pat)) == 0
- && REGNO_REG_CLASS (REGNO (SET_DEST (pat))) == ADDRESS_REGS)
- (*areg_countp)++;
- }
-}
-
void
expand_prologue ()
{
unsigned int size;
- /* We need to end the current sequence so that count_tst_insns can
- look at all the insns in this function. Normally this would be
- unsafe, but it's OK in the prologue/epilogue expanders. */
- end_sequence ();
-
- /* Determine if it is profitable to put the value zero into a register
- for the entire function. If so, set ZERO_DREG and ZERO_AREG. */
- if (regs_ever_live[2] || regs_ever_live[3]
- || regs_ever_live[6] || regs_ever_live[7]
- || frame_pointer_needed)
- {
- int dreg_count, areg_count;
-
- /* Get a count of the number of tst insns which use address and
- data registers. */
- count_tst_insns (&dreg_count, &areg_count);
-
- /* If there's more than one tst insn using a data register, then
- this optimization is a win. */
- if (dreg_count > 1
- && (!regs_ever_live[2] || !regs_ever_live[3]))
- {
- if (!regs_ever_live[2])
- {
- regs_ever_live[2] = 1;
- zero_dreg = gen_rtx (REG, SImode, 2);
- }
- else
- {
- regs_ever_live[3] = 1;
- zero_dreg = gen_rtx (REG, SImode, 3);
- }
- }
- else
- zero_dreg = NULL_RTX;
-
- /* If there's more than two tst insns using an address register,
- then this optimization is a win. */
- if (areg_count > 2
- && (!regs_ever_live[6] || !regs_ever_live[7]))
- {
- if (!regs_ever_live[6])
- {
- regs_ever_live[6] = 1;
- zero_areg = gen_rtx (REG, SImode, 6);
- }
- else
- {
- regs_ever_live[7] = 1;
- zero_areg = gen_rtx (REG, SImode, 7);
- }
- }
- else
- zero_areg = NULL_RTX;
- }
- else
- {
- zero_dreg = NULL_RTX;
- zero_areg = NULL_RTX;
- }
-
- /* Start a new sequence. */
- start_sequence ();
-
/* SIZE includes the fixed stack space needed for function calls. */
size = get_frame_size () + current_function_outgoing_args_size;
size += (current_function_outgoing_args_size ? 4 : 0);
@@ -529,13 +401,6 @@ expand_prologue ()
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
GEN_INT (-size)));
-
- /* Load zeros into registers as needed. */
- if (zero_dreg)
- emit_move_insn (zero_dreg, const0_rtx);
-
- if (zero_areg)
- emit_move_insn (zero_areg, const0_rtx);
}
void
@@ -569,7 +434,7 @@ expand_epilogue ()
}
else if ((regs_ever_live[2] || regs_ever_live[3]
|| regs_ever_live[6] || regs_ever_live[7])
- && size + 16 > 255)
+ && size + REG_SAVE_BYTES > 255)
{
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
@@ -585,7 +450,7 @@ expand_epilogue ()
if (regs_ever_live[2] || regs_ever_live[3]
|| regs_ever_live[6] || regs_ever_live[7]
|| frame_pointer_needed)
- emit_jump_insn (gen_return_internal_regs (GEN_INT (size + 16)));
+ emit_jump_insn (gen_return_internal_regs (GEN_INT (size + REG_SAVE_BYTES)));
else
{
if (size)
@@ -689,7 +554,9 @@ secondary_reload_class (class, mode, in)
if (GET_CODE (in) == MEM
&& (mode == QImode || mode == HImode)
&& (class == ADDRESS_REGS || class == SP_REGS))
- return DATA_REGS;
+ {
+ return DATA_REGS;
+ }
/* We can't directly load sp + const_int into a data register;
we must use an address register as an intermediate. */
@@ -705,9 +572,10 @@ secondary_reload_class (class, mode, in)
if (GET_CODE (in) == PLUS
&& (XEXP (in, 0) == stack_pointer_rtx
|| XEXP (in, 1) == stack_pointer_rtx))
- return DATA_REGS;
+ {
+ return DATA_REGS;
+ }
-
/* Otherwise assume no secondary reloads are needed. */
return NO_REGS;
}
@@ -723,7 +591,7 @@ initial_offset (from, to)
if (regs_ever_live[2] || regs_ever_live[3]
|| regs_ever_live[6] || regs_ever_live[7]
|| frame_pointer_needed)
- return 16;
+ return REG_SAVE_BYTES;
else
return 0;
}
@@ -736,7 +604,7 @@ initial_offset (from, to)
if (regs_ever_live[2] || regs_ever_live[3]
|| regs_ever_live[6] || regs_ever_live[7]
|| frame_pointer_needed)
- return (get_frame_size () + 16
+ return (get_frame_size () + REG_SAVE_BYTES
+ (current_function_outgoing_args_size
? current_function_outgoing_args_size + 4 : 0));
else
@@ -889,29 +757,6 @@ output_tst (operand, insn)
rtx temp;
int past_call = 0;
- /* If we have a data register which is known to be zero throughout
- the function, then use it instead of doing a search. */
- if (zero_dreg && REGNO_REG_CLASS (REGNO (operand)) == DATA_REGS)
- {
- rtx xoperands[2];
- xoperands[0] = operand;
- xoperands[1] = zero_dreg;
-
- output_asm_insn ("cmp %1,%0", xoperands);
- return "";
- }
-
- /* Similarly for address registers. */
- if (zero_areg && REGNO_REG_CLASS (REGNO (operand)) == ADDRESS_REGS)
- {
- rtx xoperands[2];
- xoperands[0] = operand;
- xoperands[1] = zero_areg;
-
- output_asm_insn ("cmp %1,%0", xoperands);
- return "";
- }
-
/* We can save a byte if we can find a register which has the value
zero in it. */
temp = PREV_INSN (insn);
@@ -950,7 +795,10 @@ output_tst (operand, insn)
If it's a call clobbered register, have we past a call?
Make sure the register we find isn't the same as ourself;
- the mn10300 can't encode that. */
+ the mn10300 can't encode that.
+
+ ??? reg_set_between_p return nonzero anytime we pass a CALL_INSN
+ so the code to detect calls here isn't doing anything useful. */
if (REG_P (SET_DEST (set))
&& SET_SRC (set) == CONST0_RTX (GET_MODE (SET_DEST (set)))
&& !reg_set_between_p (SET_DEST (set), temp, insn)
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index ac1fe2e025a..e54b77a718b 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. Matsushita MN10300 series
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GNU CC.
@@ -36,10 +36,6 @@ Boston, MA 02111-1307, USA. */
extern int target_flags;
-/* Global registers known to hold the value zero. */
-extern struct rtx_def *zero_dreg;
-extern struct rtx_def *zero_areg;
-
/* Macros used in the machine description to test the flags. */
/* Macro to define tables used to set the flags.
@@ -182,7 +178,7 @@ extern struct rtx_def *zero_areg;
If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
for any hard reg, then this must be 0 for correct output. */
#define MODES_TIEABLE_P(MODE1, MODE2) \
- (MODE1 == MODE2 || GET_MODE_SIZE (MODE1) <= 4 && GET_MODE_SIZE (MODE2) <= 4)
+ (MODE1 == MODE2 || (GET_MODE_SIZE (MODE1) <= 4 && GET_MODE_SIZE (MODE2) <= 4))
/* 4 data, and effectively 3 address registers is small as far as I'm
concerned. */
@@ -209,7 +205,9 @@ extern struct rtx_def *zero_areg;
class that represents their union. */
enum reg_class {
- NO_REGS, DATA_REGS, ADDRESS_REGS, SP_REGS, DATA_OR_ADDRESS_REGS, SP_OR_ADDRESS_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
+ NO_REGS, DATA_REGS, ADDRESS_REGS, SP_REGS,
+ DATA_OR_ADDRESS_REGS, SP_OR_ADDRESS_REGS,
+ GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
};
#define N_REG_CLASSES (int) LIM_REG_CLASSES
@@ -244,10 +242,9 @@ enum reg_class {
#define REGNO_REG_CLASS(REGNO) \
((REGNO) < 4 ? DATA_REGS : \
(REGNO) < 9 ? ADDRESS_REGS : \
- (REGNO) == 9 ? SP_REGS: 0)
+ (REGNO) == 9 ? SP_REGS : 0)
/* The class value for index registers, and the one for base regs. */
-
#define INDEX_REG_CLASS DATA_REGS
#define BASE_REG_CLASS SP_OR_ADDRESS_REGS
@@ -256,7 +253,7 @@ enum reg_class {
#define REG_CLASS_FROM_LETTER(C) \
((C) == 'd' ? DATA_REGS : \
(C) == 'a' ? ADDRESS_REGS : \
- (C) == 'x' ? SP_REGS : NO_REGS)
+ (C) == 'y' ? SP_REGS : NO_REGS)
/* Macros to check register numbers against specific register classes. */
@@ -270,6 +267,10 @@ enum reg_class {
(((regno) > 3 && regno < FIRST_PSEUDO_REGISTER) \
|| (reg_renumber[regno] > 3 && reg_renumber[regno] < FIRST_PSEUDO_REGISTER))
+#define REGNO_OK_FOR_BIT_BASE_P(regno) \
+ (((regno) > 3 && regno < 10) \
+ || (reg_renumber[regno] > 3 && reg_renumber[regno] < 10))
+
#define REGNO_OK_FOR_INDEX_P(regno) \
(((regno) >= 0 && regno < 4) \
|| (reg_renumber[regno] >= 0 && reg_renumber[regno] < 4))
@@ -585,11 +586,11 @@ extern struct rtx_def *mn10300_builtin_saveregs ();
&& GET_MODE (OP) == QImode \
&& (CONSTANT_ADDRESS_P (XEXP (OP, 0)) \
|| (GET_CODE (XEXP (OP, 0)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (OP, 0)) \
+ && REG_OK_FOR_BIT_BASE_P (XEXP (OP, 0)) \
&& XEXP (OP, 0) != stack_pointer_rtx) \
|| (GET_CODE (XEXP (OP, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (XEXP (OP, 0), 0)) \
+ && REG_OK_FOR_BIT_BASE_P (XEXP (XEXP (OP, 0), 0)) \
&& XEXP (XEXP (OP, 0), 0) != stack_pointer_rtx \
&& GET_CODE (XEXP (XEXP (OP, 0), 1)) == CONST_INT \
&& INT_8_BITS (INTVAL (XEXP (XEXP (OP, 0), 1))))))
@@ -618,16 +619,20 @@ extern struct rtx_def *mn10300_builtin_saveregs ();
/* Nonzero if X is a hard reg that can be used as an index
or if it is a pseudo reg. */
#define REG_OK_FOR_INDEX_P(X) \
- ((REGNO (X) >= 0 && REGNO(X) <= 3) || REGNO (X) >= FIRST_PSEUDO_REGISTER)
+ ((REGNO (X) >= 0 && REGNO(X) <= 3) || REGNO (X) >= 10)
/* Nonzero if X is a hard reg that can be used as a base reg
or if it is a pseudo reg. */
#define REG_OK_FOR_BASE_P(X) \
- ((REGNO (X) >= 4 && REGNO(X) <= 9) || REGNO (X) >= FIRST_PSEUDO_REGISTER)
+ ((REGNO (X) >= 4 && REGNO(X) <= 9) || REGNO (X) >= 10)
+#define REG_OK_FOR_BIT_BASE_P(X) \
+ ((REGNO (X) >= 4 && REGNO(X) <= 9))
#else
/* Nonzero if X is a hard reg that can be used as an index. */
#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
/* Nonzero if X is a hard reg that can be used as a base reg. */
#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
+/* Nonzero if X is a hard reg that can be used as a base reg. */
+#define REG_OK_FOR_BIT_BASE_P(X) REGNO_OK_FOR_BIT_BASE_P (REGNO (X))
#endif
@@ -766,6 +771,8 @@ extern struct rtx_def *legitimize_address ();
/* Provide the costs of a rtl expression. This is in the body of a
switch on CODE. */
#define RTX_COSTS(RTX,CODE,OUTER_CODE) \
+ case UMOD: \
+ case UDIV: \
case MOD: \
case DIV: \
return 8; \
@@ -945,6 +952,33 @@ do { char dstr[30]; \
#define DBX_REGISTER_NUMBER(REGNO) REGNO
+/* GDB always assumes the current function's frame begins at the value
+ of the stack pointer upon entry to the current function. Accessing
+ local variables and parameters passed on the stack is done using the
+ base of the frame + an offset provided by GCC.
+
+ For functions which have frame pointers this method works fine;
+ the (frame pointer) == (stack pointer at function entry) and GCC provides
+ an offset relative to the frame pointer.
+
+ This loses for functions without a frame pointer; GCC provides an offset
+ which is relative to the stack pointer after adjusting for the function's
+ frame size. GDB would prefer the offset to be relative to the value of
+ the stack pointer at the function's entry. Yuk! */
+#define DEBUGGER_AUTO_OFFSET(X) \
+ ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) \
+ + (frame_pointer_needed \
+ ? 0 : -initial_offset (FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM)))
+
+#define DEBUGGER_ARG_OFFSET(OFFSET, X) \
+ ((GET_CODE (X) == PLUS ? OFFSET : 0) \
+ + (frame_pointer_needed \
+ ? 0 : -initial_offset (ARG_POINTER_REGNUM, STACK_POINTER_REGNUM)))
+
+/* We need to prepend underscores. */
+#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \
+ fprintf ((FILE), "\t%s\t_%s", UNALIGNED_WORD_ASM_OP, (ADDR))
+
/* Define to use software floating point emulator for REAL_ARITHMETIC and
decimal <-> binary conversion. */
#define REAL_ARITHMETIC
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 726418fba68..d3061ad54b8 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -57,8 +57,8 @@
}")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=d,*a,d,*a,d,*a,d,*a,d,m")
- (match_operand:QI 1 "general_operand" "0,0,I,I,a,d,di,ia,m,d"))]
+ [(set (match_operand:QI 0 "general_operand" "=dx,*a,dx,*a,dx,*a,dx,*a,dx,m")
+ (match_operand:QI 1 "general_operand" "0,0,I,I,a,dx,dxi,ia,m,dx"))]
"register_operand (operands[0], QImode)
|| register_operand (operands[1], QImode)"
"*
@@ -71,24 +71,19 @@
case 2:
return \"clr %0\";
case 3:
- if (zero_areg)
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
rtx xoperands[2];
-
xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %1,%0\", xoperands);
- else
- output_asm_insn (\"mov %1,%0\", xoperands);
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+ output_asm_insn (\"mov %1,%0\", xoperands);
return \"\";
}
- /* FALLTHROUGH */
- case 4:
- case 5:
- case 6:
- case 7:
return \"mov %1,%0\";
case 8:
case 9:
@@ -112,8 +107,8 @@
}")
(define_insn ""
- [(set (match_operand:HI 0 "general_operand" "=d,*a,d,*a,d,*a,d,*a,d,m")
- (match_operand:HI 1 "general_operand" "0,0,I,I,a,d,di,ia,m,d"))]
+ [(set (match_operand:HI 0 "general_operand" "=dx,*a,dx,*a,dx,*a,dx,*a,dx,m")
+ (match_operand:HI 1 "general_operand" "0,0,I,I,a,dx,dxi,ia,m,dx"))]
"register_operand (operands[0], HImode)
|| register_operand (operands[1], HImode)"
"*
@@ -126,24 +121,18 @@
case 2:
return \"clr %0\";
case 3:
- if (zero_areg)
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
rtx xoperands[2];
-
xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %1,%0\", xoperands);
- else
- output_asm_insn (\"mov %1,%0\", xoperands);
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+ output_asm_insn (\"mov %1,%0\", xoperands);
return \"\";
}
-
- /* FALLTHROUGH */
- case 4:
- case 5:
- case 6:
- case 7:
return \"mov %1,%0\";
case 8:
case 9:
@@ -206,9 +195,9 @@
(define_insn ""
[(set (match_operand:SI 0 "general_operand"
- "=d,a,d,a,dm,dm,am,am,d,d,a,a,aR,x")
+ "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax,axR,y")
(match_operand:SI 1 "general_operand"
- "0,0,I,I,d,a,d,a,dim,aim,dim,aim,x,aR"))]
+ "0,0,I,I,dx,ax,dx,ax,dixm,aixm,dixm,aixm,xy,axR"))]
"register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode)"
"*
@@ -221,20 +210,6 @@
case 2:
return \"clr %0\";
case 3:
- if (zero_areg)
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %1,%0\", xoperands);
- else
- output_asm_insn (\"mov %1,%0\", xoperands);
- return \"\";
- }
-
- /* FALLTHROUGH */
case 4:
case 5:
case 6:
@@ -245,6 +220,14 @@
case 11:
case 12:
case 13:
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ {
+ rtx xoperands[2];
+ xoperands[0] = operands[0];
+ xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+ output_asm_insn (\"mov %1,%0\", xoperands);
+ return \"\";
+ }
return \"mov %1,%0\";
}
}"
@@ -263,8 +246,8 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=d,a,d,a,dam,da")
- (match_operand:SF 1 "general_operand" "0,0,G,G,da,daim"))]
+ [(set (match_operand:SF 0 "general_operand" "=dx,ax,dx,a,daxm,dax")
+ (match_operand:SF 1 "general_operand" "0,0,G,G,dax,daxim"))]
"register_operand (operands[0], SFmode)
|| register_operand (operands[1], SFmode)"
"*
@@ -277,20 +260,6 @@
case 2:
return \"clr %0\";
case 3:
- if (zero_areg)
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %1,%0\", xoperands);
- else
- output_asm_insn (\"mov %1,%0\", xoperands);
- return \"\";
- }
-
- /* FALLTHROUGH */
case 4:
case 5:
return \"mov %1,%0\";
@@ -312,9 +281,9 @@
(define_insn ""
[(set (match_operand:DI 0 "general_operand"
- "=d,a,d,a,dm,dm,am,am,d,d,a,a")
+ "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax")
(match_operand:DI 1 "general_operand"
- "0,0,I,I,d,a,d,a,dim,aim,dim,aim"))]
+ "0,0,I,I,dx,ax,dx,ax,dxim,axim,dxim,axim"))]
"register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode)"
"*
@@ -332,17 +301,10 @@
return \"clr %L0\;clr %H0\";
case 3:
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg ? zero_areg : operands[1];
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %L1,%L0\;mov %L0,%H0\", xoperands);
- else
- output_asm_insn (\"mov %1,%L0\;mov %L0,%H0\", xoperands);
- return \"\";
- }
+ if (rtx_equal_p (operands[0], operands[1]))
+ return \"sub %L1,%L0\;mov %L0,%H0\";
+ else
+ return \"mov %1,%L0\;mov %L0,%H0\";
case 4:
case 5:
case 6:
@@ -410,17 +372,6 @@
{
if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)
output_asm_insn (\"clr %L0\", operands);
- else if (zero_areg)
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %L0,%L0\", xoperands);
- else
- output_asm_insn (\"mov %1,%L0\", xoperands);
- }
else
output_asm_insn (\"mov %L1,%L0\", operands);
}
@@ -433,17 +384,6 @@
{
if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)
output_asm_insn (\"clr %H0\", operands);
- else if (zero_areg)
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %H0,%H0\", xoperands);
- else
- output_asm_insn (\"mov %1,%H0\", xoperands);
- }
else
output_asm_insn (\"mov %H1,%H0\", operands);
}
@@ -473,9 +413,9 @@
(define_insn ""
[(set (match_operand:DF 0 "general_operand"
- "=d,a,d,a,dm,dm,am,am,d,d,a,a")
+ "=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax")
(match_operand:DF 1 "general_operand"
- "0,0,G,G,d,a,d,a,dim,aim,dim,aim"))]
+ "0,0,G,G,dx,ax,dx,ax,dxim,axim,dxim,axim"))]
"register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)"
"*
@@ -493,17 +433,10 @@
return \"clr %L0\;clr %H0\";
case 3:
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg ? zero_areg : operands[1];
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %L1,%L0\;mov %L0,%H0\", xoperands);
- else
- output_asm_insn (\"mov %1,%L0\;mov %L0,%H0\", xoperands);
- return \"\";
- }
+ if (rtx_equal_p (operands[0], operands[1]))
+ return \"sub %L1,%L0\;mov %L0,%H0\";
+ else
+ return \"mov %1,%L0\;mov %L0,%H0\";
case 4:
case 5:
case 6:
@@ -571,17 +504,6 @@
{
if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)
output_asm_insn (\"clr %L0\", operands);
- else if (zero_areg)
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %L0,%L0\", xoperands);
- else
- output_asm_insn (\"mov %1,%L0\", xoperands);
- }
else
output_asm_insn (\"mov %L1,%L0\", operands);
}
@@ -594,17 +516,6 @@
{
if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)
output_asm_insn (\"clr %H0\", operands);
- else if (zero_areg)
- {
- rtx xoperands[2];
-
- xoperands[0] = operands[0];
- xoperands[1] = zero_areg;
- if (rtx_equal_p (xoperands[0], xoperands[1]))
- output_asm_insn (\"sub %H0,%H0\", xoperands);
- else
- output_asm_insn (\"mov %1,%H0\", xoperands);
- }
else
output_asm_insn (\"mov %H1,%H0\", operands);
}
@@ -629,19 +540,19 @@
;; Go ahead and define tstsi so we can eliminate redundant tst insns
;; when we start trying to optimize this port.
(define_insn "tstsi"
- [(set (cc0) (match_operand:SI 0 "register_operand" "da"))]
+ [(set (cc0) (match_operand:SI 0 "register_operand" "dax"))]
""
"* return output_tst (operands[0], insn);"
[(set_attr "cc" "set_znv")])
(define_insn ""
- [(set (cc0) (zero_extend:SI (match_operand:QI 0 "memory_operand" "d")))]
+ [(set (cc0) (zero_extend:SI (match_operand:QI 0 "memory_operand" "dx")))]
""
"* return output_tst (operands[0], insn);"
[(set_attr "cc" "set_znv")])
(define_insn ""
- [(set (cc0) (zero_extend:SI (match_operand:HI 0 "memory_operand" "d")))]
+ [(set (cc0) (zero_extend:SI (match_operand:HI 0 "memory_operand" "dx")))]
""
"* return output_tst (operands[0], insn);"
[(set_attr "cc" "set_znv")])
@@ -649,8 +560,8 @@
(define_insn "cmpsi"
[(set (cc0)
- (compare (match_operand:SI 0 "register_operand" "!*d*a,da")
- (match_operand:SI 1 "nonmemory_operand" "!*0,dai")))]
+ (compare (match_operand:SI 0 "register_operand" "!*d*a*x,dax")
+ (match_operand:SI 1 "nonmemory_operand" "!*0,daxi")))]
""
"@
add 0,%0
@@ -682,27 +593,60 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=d,a,a,da,x,&!da")
- (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,da")
- (match_operand:SI 2 "nonmemory_operand" "J,J,L,dai,i,da")))]
+ [(set (match_operand:SI 0 "register_operand" "=dx,ax,ax,dax,xy,!dax")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,dax")
+ (match_operand:SI 2 "nonmemory_operand" "J,J,L,daxi,i,dax")))]
""
- "@
- inc %0
- inc %0
- inc4 %0
- add %2,%0
- add %2,%0
- mov %2,%0\;add %1,%0"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0:
+ case 1:
+ return \"inc %0\";
+ case 2:
+ return \"inc4 %0\";
+ case 3:
+ case 4:
+ return \"add %2,%0\";
+ case 5:
+ /* I'm not sure if this can happen or not. Might as well be prepared
+ and generate the best possible code if it does happen. */
+ if (true_regnum (operands[0]) == true_regnum (operands[1]))
+ return \"add %2,%0\";
+ if (true_regnum (operands[0]) == true_regnum (operands[2]))
+ return \"add %1,%0\";
+
+ /* We have to copy one of the sources into the destination, then add
+ the other source to the destination.
+
+ Carefully select which source to copy to the destination; a naive
+ implementation will waste a byte when the source classes are different
+ and the destination is an address register. Selecting the lowest
+ cost register copy will optimize this sequence. */
+ if (REGNO_REG_CLASS (true_regnum (operands[1]))
+ == REGNO_REG_CLASS (true_regnum (operands[0])))
+ return \"mov %1,%0\;add %2,%0\";
+ return \"mov %2,%0\;add %1,%0\";
+ }
+}"
[(set_attr "cc" "set_zn,none_0hit,none_0hit,set_zn,none_0hit,set_zn")])
;; ----------------------------------------------------------------------
;; SUBTRACT INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "subsi3"
- [(set (match_operand:SI 0 "register_operand" "=da")
+(define_expand "subsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (minus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dax")
(minus:SI (match_operand:SI 1 "register_operand" "0")
- (match_operand:SI 2 "nonmemory_operand" "dai")))]
+ (match_operand:SI 2 "nonmemory_operand" "daxi")))]
""
"sub %2,%0"
[(set_attr "cc" "set_zn")])
@@ -725,10 +669,17 @@
;; MULTIPLY INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "mulsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
+(define_expand "mulsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (mult:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx")
(mult:SI (match_operand:SI 1 "register_operand" "%0")
- (match_operand:SI 2 "register_operand" "d")))]
+ (match_operand:SI 2 "register_operand" "dx")))]
""
"*
{
@@ -740,18 +691,15 @@
[(set_attr "cc" "set_zn")])
(define_insn "udivmodsi4"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "general_operand" "=dx")
(udiv:SI (match_operand:SI 1 "general_operand" "0")
- (match_operand:SI 2 "general_operand" "d")))
+ (match_operand:SI 2 "general_operand" "dx")))
(set (match_operand:SI 3 "general_operand" "=&d")
(umod:SI (match_dup 1) (match_dup 2)))]
""
"*
{
- if (zero_dreg)
- output_asm_insn (\"mov %0,mdr\", &zero_dreg);
- else
- output_asm_insn (\"sub %3,%3\;mov %3,mdr\", operands);
+ output_asm_insn (\"sub %3,%3\;mov %3,mdr\", operands);
if (find_reg_note (insn, REG_UNUSED, operands[3]))
return \"divu %2,%0\";
@@ -761,9 +709,9 @@
[(set_attr "cc" "set_zn")])
(define_insn "divmodsi4"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "general_operand" "=dx")
(div:SI (match_operand:SI 1 "general_operand" "0")
- (match_operand:SI 2 "general_operand" "d")))
+ (match_operand:SI 2 "general_operand" "dx")))
(set (match_operand:SI 3 "general_operand" "=d")
(mod:SI (match_dup 1) (match_dup 2)))]
""
@@ -781,10 +729,17 @@
;; AND INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "andsi3"
- [(set (match_operand:SI 0 "register_operand" "=d,d")
+(define_expand "andsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (and:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx,dx")
(and:SI (match_operand:SI 1 "register_operand" "%0,0")
- (match_operand:SI 2 "nonmemory_operand" "N,di")))]
+ (match_operand:SI 2 "nonmemory_operand" "N,dxi")))]
""
"*
{
@@ -799,7 +754,7 @@
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0x1fffffff)
return \"add %0,%0\;asl2 %0\;lsr 3,%0\";
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0x0fffffff)
- return \"asl2 %0,%0\;asl2 %0\;lsr 4,%0\";
+ return \"asl2 %0\;asl2 %0\;lsr 4,%0\";
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xfffffffe)
return \"lsr 1,%0\;add %0,%0\";
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xfffffffc)
@@ -816,10 +771,17 @@
;; OR INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "iorsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
+(define_expand "iorsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ior:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx")
(ior:SI (match_operand:SI 1 "register_operand" "%0")
- (match_operand:SI 2 "nonmemory_operand" "di")))]
+ (match_operand:SI 2 "nonmemory_operand" "dxi")))]
""
"or %2,%0"
[(set_attr "cc" "set_znv")])
@@ -828,10 +790,17 @@
;; XOR INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "xorsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
+(define_expand "xorsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (xor:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx")
(xor:SI (match_operand:SI 1 "register_operand" "%0")
- (match_operand:SI 2 "nonmemory_operand" "di")))]
+ (match_operand:SI 2 "nonmemory_operand" "dxi")))]
""
"xor %2,%0"
[(set_attr "cc" "set_znv")])
@@ -840,8 +809,14 @@
;; NOT INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "one_cmplsi2"
- [(set (match_operand:SI 0 "register_operand" "=d")
+(define_expand "one_cmplsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (not:SI (match_operand:SI 1 "register_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx")
(not:SI (match_operand:SI 1 "register_operand" "0")))]
""
"not %0"
@@ -897,7 +872,7 @@
(define_insn ""
[(set (cc0)
- (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
+ (zero_extract:SI (match_operand:SI 0 "register_operand" "dx")
(match_operand 1 "const_int_operand" "")
(match_operand 2 "const_int_operand" "")))]
""
@@ -924,7 +899,7 @@
(define_insn ""
[(set (cc0)
- (zero_extract:SI (match_operand:QI 0 "general_operand" "R,d")
+ (zero_extract:SI (match_operand:QI 0 "general_operand" "R,dx")
(match_operand 1 "const_int_operand" "")
(match_operand 2 "const_int_operand" "")))]
"mask_ok_for_mem_btst (INTVAL (operands[1]), INTVAL (operands[2]))"
@@ -968,7 +943,7 @@
[(set_attr "cc" "set_znv")])
(define_insn ""
- [(set (cc0) (and:SI (match_operand:SI 0 "register_operand" "d")
+ [(set (cc0) (and:SI (match_operand:SI 0 "register_operand" "dx")
(match_operand:SI 1 "const_int_operand" "")))]
""
"btst %1,%0"
@@ -977,7 +952,7 @@
(define_insn ""
[(set (cc0)
(and:SI
- (subreg:SI (match_operand:QI 0 "general_operand" "R,d") 0)
+ (subreg:SI (match_operand:QI 0 "general_operand" "R,dx") 0)
(match_operand:SI 1 "const_8bit_operand" "")))]
""
"@
@@ -1188,7 +1163,7 @@
}")
(define_insn "call_value_internal"
- [(set (match_operand 0 "" "=da")
+ [(set (match_operand 0 "" "=dax")
(call (mem:QI (match_operand:SI 1 "call_address_operand" "aS"))
(match_operand:SI 2 "general_operand" "g")))]
""
@@ -1231,8 +1206,15 @@
;; EXTEND INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn "zero_extendqisi2"
- [(set (match_operand:SI 0 "general_operand" "=d,d,d")
+(define_expand "zero_extendqisi2"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (zero_extend:SI
+ (match_operand:QI 1 "general_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=dx,dx,dx")
(zero_extend:SI
(match_operand:QI 1 "general_operand" "0,d,m")))]
""
@@ -1242,10 +1224,17 @@
movbu %1,%0"
[(set_attr "cc" "none_0hit")])
-(define_insn "zero_extendhisi2"
- [(set (match_operand:SI 0 "general_operand" "=d,d,d")
+(define_expand "zero_extendhisi2"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (zero_extend:SI
+ (match_operand:HI 1 "general_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=dx,dx,dx")
(zero_extend:SI
- (match_operand:HI 1 "general_operand" "0,d,m")))]
+ (match_operand:HI 1 "general_operand" "0,dx,m")))]
""
"@
exthu %0
@@ -1255,20 +1244,34 @@
;;- sign extension instructions
-(define_insn "extendqisi2"
- [(set (match_operand:SI 0 "general_operand" "=d,d")
+(define_expand "extendqisi2"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (sign_extend:SI
+ (match_operand:QI 1 "general_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=dx,dx")
(sign_extend:SI
- (match_operand:QI 1 "general_operand" "0,d")))]
+ (match_operand:QI 1 "general_operand" "0,dx")))]
""
"@
extb %0
mov %1,%0\;extb %0"
[(set_attr "cc" "none_0hit")])
-(define_insn "extendhisi2"
- [(set (match_operand:SI 0 "general_operand" "=d,d")
+(define_expand "extendhisi2"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (sign_extend:SI
+ (match_operand:HI 1 "general_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=dx,dx")
(sign_extend:SI
- (match_operand:HI 1 "general_operand" "0,d")))]
+ (match_operand:HI 1 "general_operand" "0,dx")))]
""
"@
exth %0
@@ -1279,11 +1282,19 @@
;; SHIFTS
;; ----------------------------------------------------------------------
-(define_insn "ashlsi3"
- [(set (match_operand:SI 0 "register_operand" "=da,d,d,d,d")
+(define_expand "ashlsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ashift:SI
+ (match_operand:SI 1 "register_operand" "")
+ (match_operand:QI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dax,dx,dx,dx,dx")
(ashift:SI
(match_operand:SI 1 "register_operand" "0,0,0,0,0")
- (match_operand:QI 2 "nonmemory_operand" "J,K,M,L,di")))]
+ (match_operand:QI 2 "nonmemory_operand" "J,K,M,L,dxi")))]
""
"@
add %0,%0
@@ -1293,20 +1304,36 @@
asl %S2,%0"
[(set_attr "cc" "set_zn")])
-(define_insn "lshrsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
+(define_expand "lshrsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (lshiftrt:SI
+ (match_operand:SI 1 "register_operand" "")
+ (match_operand:QI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx")
(lshiftrt:SI
(match_operand:SI 1 "register_operand" "0")
- (match_operand:QI 2 "nonmemory_operand" "di")))]
+ (match_operand:QI 2 "nonmemory_operand" "dxi")))]
""
"lsr %S2,%0"
[(set_attr "cc" "set_zn")])
-(define_insn "ashrsi3"
- [(set (match_operand:SI 0 "register_operand" "=d")
+(define_expand "ashrsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ashiftrt:SI
+ (match_operand:SI 1 "register_operand" "")
+ (match_operand:QI 2 "nonmemory_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=dx")
(ashiftrt:SI
(match_operand:SI 1 "register_operand" "0")
- (match_operand:QI 2 "nonmemory_operand" "di")))]
+ (match_operand:QI 2 "nonmemory_operand" "dxi")))]
""
"asr %S2,%0"
[(set_attr "cc" "set_zn")])
@@ -1341,13 +1368,83 @@
(match_operand:SI 0 "const_int_operand" "i")
(return)]
""
- "ret [d2,d3,a2,a3],%0"
+ "*
+{
+ int i, need_comma;
+ int d2, d3, a2, a3;
+
+ need_comma = 0;
+ fputs (\"\\tret [\", asm_out_file);
+ if (regs_ever_live[2])
+ {
+ fputs (\"d2\", asm_out_file);
+ need_comma = 1;
+ }
+ if (regs_ever_live[3])
+ {
+ if (need_comma)
+ fputc (',', asm_out_file);
+ fputs (\"d3\", asm_out_file);
+ need_comma = 1;
+ }
+ if (regs_ever_live[6])
+ {
+ if (need_comma)
+ fputc (',', asm_out_file);
+ fputs (\"a2\", asm_out_file);
+ need_comma = 1;
+ }
+ if (regs_ever_live[7])
+ {
+ if (need_comma)
+ fputc (',', asm_out_file);
+ fputs (\"a3\", asm_out_file);
+ need_comma = 1;
+ }
+ fprintf (asm_out_file, \"],%d\\n\", INTVAL (operands[0]));
+ return \"\";
+}"
[(set_attr "cc" "clobber")])
(define_insn "store_movm"
[(const_int 1)]
""
- "movm [d2,d3,a2,a3],(sp)"
+ "*
+{
+ int i, need_comma;
+ int d2, d3, a2, a3;
+
+ need_comma = 0;
+ fputs (\"\\tmovm [\", asm_out_file);
+ if (regs_ever_live[2])
+ {
+ fputs (\"d2\", asm_out_file);
+ need_comma = 1;
+ }
+ if (regs_ever_live[3])
+ {
+ if (need_comma)
+ fputc (',', asm_out_file);
+ fputs (\"d3\", asm_out_file);
+ need_comma = 1;
+ }
+ if (regs_ever_live[6])
+ {
+ if (need_comma)
+ fputc (',', asm_out_file);
+ fputs (\"a2\", asm_out_file);
+ need_comma = 1;
+ }
+ if (regs_ever_live[7])
+ {
+ if (need_comma)
+ fputc (',', asm_out_file);
+ fputs (\"a3\", asm_out_file);
+ need_comma = 1;
+ }
+ fputs (\"],(sp)\\n\", asm_out_file);
+ return \"\";
+}"
[(set_attr "cc" "clobber")])
(define_insn "return"
@@ -1369,7 +1466,7 @@
;; Try to combine consecutive updates of the stack pointer (or any
;; other register for that matter).
(define_peephole
- [(set (match_operand:SI 0 "register_operand" "=dax")
+ [(set (match_operand:SI 0 "register_operand" "=dxay")
(plus:SI (match_dup 0)
(match_operand 1 "const_int_operand" "")))
(set (match_dup 0)
@@ -1393,7 +1490,7 @@
;; This will work on the mn10200 because we can check the ZX flag
;; if the comparison is in HImode.
(define_peephole
- [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
+ [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
@@ -1402,7 +1499,7 @@
[(set_attr "cc" "clobber")])
(define_peephole
- [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
+ [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
@@ -1411,7 +1508,7 @@
[(set_attr "cc" "clobber")])
(define_peephole
- [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
+ [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
@@ -1420,7 +1517,7 @@
[(set_attr "cc" "clobber")])
(define_peephole
- [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
+ [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h
index 5fecd35d483..0fb4d400ee2 100644
--- a/gcc/config/netbsd.h
+++ b/gcc/config/netbsd.h
@@ -100,7 +100,9 @@
#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) \
- do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
+ do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \
+ fputc ('\n', FILE); \
+ fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
fputc ('\n', FILE); } while (0)
/* The following macro defines the format used to output the second
diff --git a/gcc/config/nextstep.c b/gcc/config/nextstep.c
index e909a948cda..1c658fb1171 100644
--- a/gcc/config/nextstep.c
+++ b/gcc/config/nextstep.c
@@ -45,12 +45,12 @@ extern char *get_directive_line ();
The result is 1 if the pragma was handled. */
int
-handle_pragma (finput, node)
- FILE *finput;
- tree node;
+handle_pragma (p_getc, p_ungetc, pname)
+ int (* p_getc) PROTO ((void));
+ void (* p_ungetc) PROTO ((int));
+ char * pname;
{
int retval = 0;
- register char *pname;
/* Record initial setting of optimize flag, so we can restore it. */
if (!pragma_initialized)
@@ -59,11 +59,6 @@ handle_pragma (finput, node)
initial_optimize_flag = optimize;
}
- if (TREE_CODE (node) != IDENTIFIER_NODE)
- return 0;
-
- pname = IDENTIFIER_POINTER (node);
-
if (strcmp (pname, "CC_OPT_ON") == 0)
{
optimize = 1, obey_regdecls = 0;
diff --git a/gcc/config/nextstep.h b/gcc/config/nextstep.h
index 96435fc67ea..a3919f7f023 100644
--- a/gcc/config/nextstep.h
+++ b/gcc/config/nextstep.h
@@ -167,7 +167,12 @@ Boston, MA 02111-1307, USA. */
%{!p:-lcrt0.o}}}\
%{posix*:%{pg:-lgposixcrt0.o}%{!pg: \
%{p:%e-p profiling is no longer supported. Use -pg instead.} \
- %{!p:-lposixcrt0.o}}}"
+ %{!p:-lposixcrt0.o}}} \
+ -lcrtbegin.o"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "-lcrtend.o"
/* Allow #sscs (but don't do anything). */
@@ -203,6 +208,9 @@ Boston, MA 02111-1307, USA. */
"\t.text\n\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n", \
"" , N_SO)
+/* Define our object format type for crtstuff.c */
+#define OBJECT_FORMAT_MACHO
+
/* Don't use .gcc_compiled symbols to communicate with GDB;
They interfere with numerically sorted symbol lists. */
@@ -232,6 +240,8 @@ Boston, MA 02111-1307, USA. */
fprintf (FILE, ".reference .destructors_used\n"); \
} while (0)
+#define EH_FRAME_SECTION_ASM_OP ".section __TEXT,__eh_frame,regular"
+
/* Don't output a .file directive. That is only used by the assembler for
error reporting. */
#undef ASM_FILE_START
@@ -252,7 +262,8 @@ Boston, MA 02111-1307, USA. */
/* How to parse #pragma's */
#undef HANDLE_PRAGMA
-#define HANDLE_PRAGMA(FINPUT, NODE) handle_pragma (FINPUT, NODE)
+#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
+extern int handle_pragma ();
/* Give methods pretty symbol names on NeXT. */
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index 1c759aed060..8c2fb1f784b 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -495,7 +495,7 @@ print_operand (file, x, code)
u.i[0] = CONST_DOUBLE_LOW (x); u.i[1] = CONST_DOUBLE_HIGH (x);
PUT_IMMEDIATE_PREFIX(file);
#ifdef SEQUENT_ASM
- /* Sequent likes it's floating point constants as integers */
+ /* Sequent likes its floating point constants as integers */
fprintf (file, "0Dx%08x%08x", u.i[1], u.i[0]);
#else
#ifdef ENCORE_ASM
diff --git a/gcc/config/ns32k/xm-netbsd.h b/gcc/config/ns32k/xm-netbsd.h
index 4040751d1d9..e69de29bb2d 100644
--- a/gcc/config/ns32k/xm-netbsd.h
+++ b/gcc/config/ns32k/xm-netbsd.h
@@ -1,10 +0,0 @@
-/* Configuration for GCC for ns32k running NetBSD as host. */
-
-#include <ns32k/xm-ns32k.h>
-
-/* ns32k/xm-ns32k.h defines these macros, but we don't need them */
-#undef memcmp
-#undef memcpy
-#undef memset
-
-#include <xm-netbsd.h>
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 5a30176fd4f..41642041e32 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -20,10 +20,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include "system.h"
+
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -39,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "c-tree.h"
#include "expr.h"
#include "obstack.h"
+#include "toplev.h"
static void restore_unscaled_index_insn_codes PROTO((rtx));
static void record_unscaled_index_insn_codes PROTO((rtx));
@@ -174,7 +173,7 @@ reg_or_0_operand (op, mode)
int
call_operand_address (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (CONSTANT_P (op) && ! TARGET_PORTABLE_RUNTIME);
}
@@ -197,7 +196,7 @@ symbolic_expression_p (x)
int
symbolic_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -220,7 +219,7 @@ symbolic_operand (op, mode)
int
symbolic_memory_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
@@ -289,6 +288,9 @@ move_operand (op, mode)
if (register_operand (op, mode))
return 1;
+ if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
+
if (GET_CODE (op) == CONST_INT)
return cint_ok_for_move (INTVAL (op));
@@ -340,7 +342,7 @@ reg_or_cint_move_operand (op, mode)
int
pic_label_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (!flag_pic)
return 0;
@@ -361,7 +363,7 @@ pic_label_operand (op, mode)
int
fp_reg_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return reg_renumber && FP_REG_P (op);
}
@@ -397,7 +399,7 @@ arith11_operand (op, mode)
int
pre_cint_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) >= -0x2000 && INTVAL (op) < 0x10);
@@ -408,7 +410,7 @@ pre_cint_operand (op, mode)
int
post_cint_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) < 0x2000 && INTVAL (op) >= -0x10);
@@ -434,7 +436,7 @@ arith_double_operand (op, mode)
int
ireg_or_int5_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return ((GET_CODE (op) == CONST_INT && INT_5_BITS (op))
|| (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32));
@@ -446,7 +448,7 @@ ireg_or_int5_operand (op, mode)
int
int5_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT && INT_5_BITS (op));
}
@@ -454,7 +456,7 @@ int5_operand (op, mode)
int
uint5_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT && INT_U5_BITS (op));
}
@@ -462,7 +464,7 @@ uint5_operand (op, mode)
int
int11_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT && INT_11_BITS (op));
}
@@ -470,7 +472,7 @@ int11_operand (op, mode)
int
uint32_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
#if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */
@@ -543,7 +545,7 @@ ior_mask_p (mask)
int
ior_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op)));
}
@@ -562,7 +564,7 @@ lhs_lshift_operand (op, mode)
int
lhs_lshift_cint_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
unsigned HOST_WIDE_INT x;
if (GET_CODE (op) != CONST_INT)
@@ -582,7 +584,7 @@ arith32_operand (op, mode)
int
pc_or_label_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == PC || GET_CODE (op) == LABEL_REF);
}
@@ -595,7 +597,7 @@ pc_or_label_operand (op, mode)
rtx
legitimize_pic_address (orig, mode, reg)
rtx orig, reg;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
rtx pic_ref = orig;
@@ -614,13 +616,17 @@ legitimize_pic_address (orig, mode, reg)
if (flag_pic == 2)
{
emit_insn (gen_pic2_highpart (reg, pic_offset_table_rtx, orig));
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (LO_SUM, Pmode, reg,
- gen_rtx (UNSPEC, SImode, gen_rtvec (1, orig), 0)));
+ pic_ref
+ = gen_rtx_MEM (Pmode,
+ gen_rtx_LO_SUM (Pmode, reg,
+ gen_rtx_UNSPEC (SImode,
+ gen_rtvec (1, orig),
+ 0)));
}
else
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig));
+ pic_ref = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode,
+ pic_offset_table_rtx, orig));
current_function_uses_pic_offset_table = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
emit_move_insn (reg, pic_ref);
@@ -650,7 +656,7 @@ legitimize_pic_address (orig, mode, reg)
return plus_constant_for_output (base, INTVAL (orig));
orig = force_reg (Pmode, orig);
}
- pic_ref = gen_rtx (PLUS, Pmode, base, orig);
+ pic_ref = gen_rtx_PLUS (Pmode, base, orig);
/* Likewise, should we set special REG_NOTEs here? */
}
return pic_ref;
@@ -709,7 +715,7 @@ legitimize_pic_address (orig, mode, reg)
rtx
hppa_legitimize_address (x, oldx, mode)
- rtx x, oldx;
+ rtx x, oldx ATTRIBUTE_UNUSED;
enum machine_mode mode;
{
rtx orig = x;
@@ -728,7 +734,7 @@ hppa_legitimize_address (x, oldx, mode)
&& GET_CODE (XEXP (x, 1)) == SYMBOL_REF)
{
rtx reg = force_reg (SImode, XEXP (x, 1));
- return force_reg (SImode, gen_rtx (PLUS, SImode, reg, XEXP (x, 0)));
+ return force_reg (SImode, gen_rtx_PLUS (SImode, reg, XEXP (x, 0)));
}
/* Note we must reject symbols which represent function addresses
@@ -760,17 +766,16 @@ hppa_legitimize_address (x, oldx, mode)
if (! VAL_14_BITS_P (newoffset)
&& GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
{
- rtx const_part = gen_rtx (CONST, VOIDmode,
- gen_rtx (PLUS, Pmode,
- XEXP (x, 0),
- GEN_INT (newoffset)));
+ rtx const_part
+ = gen_rtx_CONST (VOIDmode, gen_rtx_PLUS (Pmode,
+ XEXP (x, 0),
+ GEN_INT (newoffset)));
rtx tmp_reg
= force_reg (Pmode,
- gen_rtx (HIGH, Pmode, const_part));
+ gen_rtx_HIGH (Pmode, const_part));
ptr_reg
= force_reg (Pmode,
- gen_rtx (LO_SUM, Pmode,
- tmp_reg, const_part));
+ gen_rtx_LO_SUM (Pmode, tmp_reg, const_part));
}
else
{
@@ -780,9 +785,9 @@ hppa_legitimize_address (x, oldx, mode)
int_part = GEN_INT (newoffset);
ptr_reg = force_reg (Pmode,
- gen_rtx (PLUS, Pmode,
- force_reg (Pmode, XEXP (x, 0)),
- int_part));
+ gen_rtx_PLUS (Pmode,
+ force_reg (Pmode, XEXP (x, 0)),
+ int_part));
}
return plus_constant (ptr_reg, offset - newoffset);
}
@@ -807,10 +812,10 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg2) != REG)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- reg2, GEN_INT (val)),
- reg1));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, reg2,
+ GEN_INT (val)),
+ reg1));
}
/* Similarly for (plus (plus (mult (a) (shadd_constant)) (b)) (c)).
@@ -849,11 +854,11 @@ hppa_legitimize_address (x, oldx, mode)
{
base = reg1;
orig_base = XEXP (XEXP (x, 0), 1);
- idx = gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- XEXP (XEXP (XEXP (x, 0), 0), 0),
- XEXP (XEXP (XEXP (x, 0), 0), 1)),
- XEXP (x, 1));
+ idx = gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode,
+ XEXP (XEXP (XEXP (x, 0), 0), 0),
+ XEXP (XEXP (XEXP (x, 0), 0), 1)),
+ XEXP (x, 1));
}
else if (GET_CODE (reg2) == REG
&& REGNO_POINTER_FLAG (REGNO (reg2)))
@@ -881,13 +886,14 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg1) != REG)
reg1 = force_reg (Pmode, force_operand (reg1, 0));
- reg1 = force_reg (Pmode, gen_rtx (PLUS, Pmode, reg1, GEN_INT (val)));
+ reg1 = force_reg (Pmode, gen_rtx_PLUS (Pmode, reg1, GEN_INT (val)));
/* We can now generate a simple scaled indexed address. */
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, reg1,
- XEXP (XEXP (idx, 0), 1)),
- base));
+ return force_reg (Pmode,
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, reg1,
+ XEXP (XEXP (idx, 0), 1)),
+ base));
}
/* If B + C is still a valid base register, then add them. */
@@ -898,16 +904,16 @@ hppa_legitimize_address (x, oldx, mode)
int val = INTVAL (XEXP (XEXP (idx, 0), 1));
rtx reg1, reg2;
- reg1 = force_reg (Pmode, gen_rtx (PLUS, Pmode, base, XEXP (idx, 1)));
+ reg1 = force_reg (Pmode, gen_rtx_PLUS (Pmode, base, XEXP (idx, 1)));
reg2 = XEXP (XEXP (idx, 0), 0);
if (GET_CODE (reg2) != CONST_INT)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- reg2, GEN_INT (val)),
- reg1));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, reg2,
+ GEN_INT (val)),
+ reg1));
}
/* Get the index into a register, then add the base + index and
@@ -923,13 +929,14 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg2) != REG)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- reg1 = force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, reg1,
- XEXP (XEXP (idx, 0), 1)),
- reg2));
+ reg1 = force_reg (Pmode,
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, reg1,
+ XEXP (XEXP (idx, 0), 1)),
+ reg2));
/* Add the result to our base register and return. */
- return force_reg (Pmode, gen_rtx (PLUS, Pmode, base, reg1));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode, base, reg1));
}
@@ -988,9 +995,10 @@ hppa_legitimize_address (x, oldx, mode)
if (GET_CODE (reg2) != REG)
reg2 = force_reg (Pmode, force_operand (reg2, 0));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode,
- reg2, GEN_INT (val)),
+ return force_reg (Pmode,
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, reg2,
+ GEN_INT (val)),
reg1));
}
else if ((mode == DFmode || mode == SFmode)
@@ -1007,13 +1015,14 @@ hppa_legitimize_address (x, oldx, mode)
regx2 = XEXP (XEXP (x, 0), 0);
if (GET_CODE (regx2) != REG)
regx2 = force_reg (Pmode, force_operand (regx2, 0));
- regx2 = force_reg (Pmode, gen_rtx (GET_CODE (y), Pmode,
- regx2, regx1));
+ regx2 = force_reg (Pmode, gen_rtx_fmt_ee (GET_CODE (y), Pmode,
+ regx2, regx1));
return force_reg (Pmode,
- gen_rtx (PLUS, Pmode,
- gen_rtx (MULT, Pmode, regx2,
- XEXP (XEXP (x, 0), 1)),
- force_reg (Pmode, XEXP (y, 0))));
+ gen_rtx_PLUS (Pmode,
+ gen_rtx_MULT (Pmode, regx2,
+ XEXP (XEXP (x, 0),
+ 1)),
+ force_reg (Pmode, XEXP (y, 0))));
}
else if (GET_CODE (XEXP (y, 1)) == CONST_INT
&& INTVAL (XEXP (y, 1)) >= -4096
@@ -1031,8 +1040,9 @@ hppa_legitimize_address (x, oldx, mode)
regy1 = force_reg (Pmode, force_operand (XEXP (y, 0), 0));
regy2 = force_reg (Pmode, force_operand (XEXP (y, 1), 0));
regx1 = force_reg (Pmode,
- gen_rtx (GET_CODE (y), Pmode, regx1, regy2));
- return force_reg (Pmode, gen_rtx (PLUS, Pmode, regx1, regy1));
+ gen_rtx_fmt_ee (GET_CODE (y), Pmode,
+ regx1, regy2));
+ return force_reg (Pmode, gen_rtx_PLUS (Pmode, regx1, regy1));
}
}
}
@@ -1076,10 +1086,12 @@ emit_move_sequence (operands, mode, scratch_reg)
register rtx operand1 = operands[1];
register rtx tem;
- if (reload_in_progress && GET_CODE (operand0) == REG
+ if (scratch_reg
+ && reload_in_progress && GET_CODE (operand0) == REG
&& REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
operand0 = reg_equiv_mem[REGNO (operand0)];
- else if (reload_in_progress && GET_CODE (operand0) == SUBREG
+ else if (scratch_reg
+ && reload_in_progress && GET_CODE (operand0) == SUBREG
&& GET_CODE (SUBREG_REG (operand0)) == REG
&& REGNO (SUBREG_REG (operand0)) >= FIRST_PSEUDO_REGISTER)
{
@@ -1087,10 +1099,12 @@ emit_move_sequence (operands, mode, scratch_reg)
operand0 = alter_subreg (operand0);
}
- if (reload_in_progress && GET_CODE (operand1) == REG
+ if (scratch_reg
+ && reload_in_progress && GET_CODE (operand1) == REG
&& REGNO (operand1) >= FIRST_PSEUDO_REGISTER)
operand1 = reg_equiv_mem[REGNO (operand1)];
- else if (reload_in_progress && GET_CODE (operand1) == SUBREG
+ else if (scratch_reg
+ && reload_in_progress && GET_CODE (operand1) == SUBREG
&& GET_CODE (SUBREG_REG (operand1)) == REG
&& REGNO (SUBREG_REG (operand1)) >= FIRST_PSEUDO_REGISTER)
{
@@ -1098,14 +1112,14 @@ emit_move_sequence (operands, mode, scratch_reg)
operand1 = alter_subreg (operand1);
}
- if (reload_in_progress && GET_CODE (operand0) == MEM
+ if (scratch_reg && reload_in_progress && GET_CODE (operand0) == MEM
&& ((tem = find_replacement (&XEXP (operand0, 0)))
!= XEXP (operand0, 0)))
- operand0 = gen_rtx (MEM, GET_MODE (operand0), tem);
- if (reload_in_progress && GET_CODE (operand1) == MEM
+ operand0 = gen_rtx_MEM (GET_MODE (operand0), tem);
+ if (scratch_reg && reload_in_progress && GET_CODE (operand1) == MEM
&& ((tem = find_replacement (&XEXP (operand1, 0)))
!= XEXP (operand1, 0)))
- operand1 = gen_rtx (MEM, GET_MODE (operand1), tem);
+ operand1 = gen_rtx_MEM (GET_MODE (operand1), tem);
/* Handle secondary reloads for loads/stores of FP registers from
REG+D addresses where D does not fit in 5 bits, including
@@ -1121,22 +1135,22 @@ emit_move_sequence (operands, mode, scratch_reg)
if (GET_CODE (operand1) == SUBREG)
operand1 = XEXP (operand1, 0);
- scratch_reg = gen_rtx (REG, SImode, REGNO (scratch_reg));
+ scratch_reg = gen_rtx_REG (SImode, REGNO (scratch_reg));
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
if (!memory_address_p (SImode, XEXP (operand1, 0)))
{
emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
- emit_move_insn (scratch_reg, gen_rtx (GET_CODE (XEXP (operand1, 0)),
- SImode,
- XEXP (XEXP (operand1, 0), 0),
- scratch_reg));
+ emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)),
+ SImode,
+ XEXP (XEXP (operand1, 0), 0),
+ scratch_reg));
}
else
emit_move_insn (scratch_reg, XEXP (operand1, 0));
- emit_insn (gen_rtx (SET, VOIDmode, operand0, gen_rtx (MEM, mode,
- scratch_reg)));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, gen_rtx_MEM (mode,
+ scratch_reg)));
return 1;
}
else if (fp_reg_operand (operand1, mode)
@@ -1150,21 +1164,23 @@ emit_move_sequence (operands, mode, scratch_reg)
if (GET_CODE (operand0) == SUBREG)
operand0 = XEXP (operand0, 0);
- scratch_reg = gen_rtx (REG, SImode, REGNO (scratch_reg));
+ scratch_reg = gen_rtx_REG (SImode, REGNO (scratch_reg));
/* D might not fit in 14 bits either; for such cases load D into
scratch reg. */
if (!memory_address_p (SImode, XEXP (operand0, 0)))
{
emit_move_insn (scratch_reg, XEXP (XEXP (operand0, 0), 1));
- emit_move_insn (scratch_reg, gen_rtx (GET_CODE (XEXP (operand0, 0)),
- SImode,
- XEXP (XEXP (operand0, 0), 0),
- scratch_reg));
+ emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand0,
+ 0)),
+ SImode,
+ XEXP (XEXP (operand0, 0),
+ 0),
+ scratch_reg));
}
else
emit_move_insn (scratch_reg, XEXP (operand0, 0));
- emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, mode, scratch_reg),
- operand1));
+ emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_MEM (mode, scratch_reg),
+ operand1));
return 1;
}
/* Handle secondary reloads for loads of FP registers from constant
@@ -1189,8 +1205,7 @@ emit_move_sequence (operands, mode, scratch_reg)
emit_move_sequence (xoperands, Pmode, 0);
/* Now load the destination register. */
- emit_insn (gen_rtx (SET, mode, operand0,
- gen_rtx (MEM, mode, scratch_reg)));
+ emit_insn (gen_rtx_SET (mode, operand0, gen_rtx_MEM (mode, scratch_reg)));
return 1;
}
/* Handle secondary reloads for SAR. These occur when trying to load
@@ -1209,12 +1224,14 @@ emit_move_sequence (operands, mode, scratch_reg)
&& !memory_address_p (SImode, XEXP (operand1, 0)))
{
emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
- emit_move_insn (scratch_reg, gen_rtx (GET_CODE (XEXP (operand1, 0)),
- SImode,
- XEXP (XEXP (operand1, 0), 0),
- scratch_reg));
- emit_move_insn (scratch_reg, gen_rtx (MEM, GET_MODE (operand1),
- scratch_reg));
+ emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand1,
+ 0)),
+ SImode,
+ XEXP (XEXP (operand1, 0),
+ 0),
+ scratch_reg));
+ emit_move_insn (scratch_reg, gen_rtx_MEM (GET_MODE (operand1),
+ scratch_reg));
}
else
emit_move_insn (scratch_reg, operand1);
@@ -1233,7 +1250,7 @@ emit_move_sequence (operands, mode, scratch_reg)
|| GET_CODE (operand1) == MEM)
{
/* Run this case quickly. */
- emit_insn (gen_rtx (SET, VOIDmode, operand0, operand1));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, operand1));
return 1;
}
}
@@ -1244,14 +1261,14 @@ emit_move_sequence (operands, mode, scratch_reg)
{
rtx temp = gen_reg_rtx (DFmode);
- emit_insn (gen_rtx (SET, VOIDmode, temp, operand1));
- emit_insn (gen_rtx (SET, VOIDmode, operand0, temp));
+ emit_insn (gen_rtx_SET (VOIDmode, temp, operand1));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, temp));
return 1;
}
if (register_operand (operand1, mode) || operand1 == CONST0_RTX (mode))
{
/* Run this case quickly. */
- emit_insn (gen_rtx (SET, VOIDmode, operand0, operand1));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, operand1));
return 1;
}
if (! (reload_in_progress || reload_completed))
@@ -1330,7 +1347,7 @@ emit_move_sequence (operands, mode, scratch_reg)
/* Now load from the memory location into our destination
register. */
- operands[1] = gen_rtx (MEM, Pmode, operands[0]);
+ operands[1] = gen_rtx_MEM (Pmode, operands[0]);
emit_move_sequence (operands, mode, scratch_reg);
/* And add back in the constant part. */
@@ -1367,7 +1384,7 @@ emit_move_sequence (operands, mode, scratch_reg)
else
{
operands[1] = legitimize_pic_address (operand1, mode, temp);
- emit_insn (gen_rtx (SET, VOIDmode, operand0, operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0, operands[1]));
}
}
/* On the HPPA, references to data space are supposed to use dp,
@@ -1392,15 +1409,14 @@ emit_move_sequence (operands, mode, scratch_reg)
if (REGNO (temp) >= FIRST_PSEUDO_REGISTER)
REGNO_POINTER_FLAG (REGNO (temp)) = 1;
if (ishighonly)
- set = gen_rtx (SET, mode, operand0, temp);
+ set = gen_rtx_SET (mode, operand0, temp);
else
- set = gen_rtx (SET, VOIDmode,
- operand0,
- gen_rtx (LO_SUM, mode, temp, operand1));
+ set = gen_rtx_SET (VOIDmode, operand0,
+ gen_rtx_LO_SUM (mode, temp, operand1));
- emit_insn (gen_rtx (SET, VOIDmode,
- temp,
- gen_rtx (HIGH, mode, operand1)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ temp,
+ gen_rtx_HIGH (mode, operand1)));
emit_insn (set);
}
@@ -1416,9 +1432,9 @@ emit_move_sequence (operands, mode, scratch_reg)
else
temp = gen_reg_rtx (mode);
- emit_insn (gen_rtx (SET, VOIDmode, temp,
- gen_rtx (HIGH, mode, operand1)));
- operands[1] = gen_rtx (LO_SUM, mode, temp, operand1);
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_HIGH (mode, operand1)));
+ operands[1] = gen_rtx_LO_SUM (mode, temp, operand1);
}
}
/* Now have insn-emit do whatever it normally does. */
@@ -1630,7 +1646,7 @@ output_move_double (operands)
rtx addr = XEXP (operands[0], 0);
if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == POST_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[1], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[1], 0);
operands[0] = XEXP (addr, 0);
if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG)
@@ -1650,7 +1666,7 @@ output_move_double (operands)
}
else if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[1], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[1], 0);
operands[0] = XEXP (addr, 0);
if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG)
@@ -1677,7 +1693,7 @@ output_move_double (operands)
rtx addr = XEXP (operands[1], 0);
if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == POST_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
operands[1] = XEXP (addr, 0);
if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG)
@@ -1704,7 +1720,7 @@ output_move_double (operands)
}
else if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
operands[1] = XEXP (addr, 0);
if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG)
@@ -1732,7 +1748,7 @@ output_move_double (operands)
else if (GET_CODE (addr) == PLUS
&& GET_CODE (XEXP (addr, 0)) == MULT)
{
- rtx high_reg = gen_rtx (SUBREG, SImode, operands[0], 0);
+ rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
if (!reg_overlap_mentioned_p (high_reg, addr))
{
@@ -1777,14 +1793,14 @@ output_move_double (operands)
operands in OPERANDS to be suitable for the low-numbered word. */
if (optype0 == REGOP)
- latehalf[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ latehalf[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
else if (optype0 == OFFSOP)
latehalf[0] = adj_offsettable_operand (operands[0], 4);
else
latehalf[0] = operands[0];
if (optype1 == REGOP)
- latehalf[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ latehalf[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
else if (optype1 == OFFSOP)
latehalf[1] = adj_offsettable_operand (operands[1], 4);
else if (optype1 == CNSTOP)
@@ -1875,7 +1891,7 @@ output_fp_move_double (operands)
if (GET_CODE (operands[0]) == REG)
{
rtx xoperands[2];
- xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
xoperands[0] = operands[0];
output_asm_insn ("copy %%r0,%0\n\tcopy %%r0,%1", xoperands);
}
@@ -1928,7 +1944,7 @@ find_addr_reg (addr)
char *
output_block_move (operands, size_is_constant)
rtx *operands;
- int size_is_constant;
+ int size_is_constant ATTRIBUTE_UNUSED;
{
int align = INTVAL (operands[5]);
unsigned long n_bytes = INTVAL (operands[4]);
@@ -2421,22 +2437,22 @@ store_reg (reg, disp, base)
{
if (VAL_14_BITS_P (disp))
{
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (PLUS, SImode,
- gen_rtx (REG, SImode, base),
- GEN_INT (disp))),
- gen_rtx (REG, SImode, reg));
+ emit_move_insn (gen_rtx_MEM (SImode,
+ gen_rtx_PLUS (SImode,
+ gen_rtx_REG (SImode, base),
+ GEN_INT (disp))),
+ gen_rtx_REG (SImode, reg));
}
else
{
- emit_insn (gen_add_high_const (gen_rtx (REG, SImode, 1),
- gen_rtx (REG, SImode, base),
+ emit_insn (gen_add_high_const (gen_rtx_REG (SImode, 1),
+ gen_rtx_REG (SImode, base),
GEN_INT (disp)));
- emit_move_insn (gen_rtx (MEM, SImode,
- gen_rtx (LO_SUM, SImode,
- gen_rtx (REG, SImode, 1),
- GEN_INT (disp))),
- gen_rtx (REG, SImode, reg));
+ emit_move_insn (gen_rtx_MEM (SImode,
+ gen_rtx_LO_SUM (SImode,
+ gen_rtx_REG (SImode, 1),
+ GEN_INT (disp))),
+ gen_rtx_REG (SImode, reg));
}
}
@@ -2451,22 +2467,22 @@ load_reg (reg, disp, base)
{
if (VAL_14_BITS_P (disp))
{
- emit_move_insn (gen_rtx (REG, SImode, reg),
- gen_rtx (MEM, SImode,
- gen_rtx (PLUS, SImode,
- gen_rtx (REG, SImode, base),
- GEN_INT (disp))));
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_MEM (SImode,
+ gen_rtx_PLUS (SImode,
+ gen_rtx_REG (SImode, base),
+ GEN_INT (disp))));
}
else
{
- emit_insn (gen_add_high_const (gen_rtx (REG, SImode, 1),
- gen_rtx (REG, SImode, base),
+ emit_insn (gen_add_high_const (gen_rtx_REG (SImode, 1),
+ gen_rtx_REG (SImode, base),
GEN_INT (disp)));
- emit_move_insn (gen_rtx (REG, SImode, reg),
- gen_rtx (MEM, SImode,
- gen_rtx (LO_SUM, SImode,
- gen_rtx (REG, SImode, 1),
- GEN_INT (disp))));
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_MEM (SImode,
+ gen_rtx_LO_SUM (SImode,
+ gen_rtx_REG (SImode, 1),
+ GEN_INT (disp))));
}
}
@@ -2481,20 +2497,20 @@ set_reg_plus_d(reg, base, disp)
{
if (VAL_14_BITS_P (disp))
{
- emit_move_insn (gen_rtx (REG, SImode, reg),
- gen_rtx (PLUS, SImode,
- gen_rtx (REG, SImode, base),
- GEN_INT (disp)));
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_PLUS (SImode,
+ gen_rtx_REG (SImode, base),
+ GEN_INT (disp)));
}
else
{
- emit_insn (gen_add_high_const (gen_rtx (REG, SImode, 1),
- gen_rtx (REG, SImode, base),
+ emit_insn (gen_add_high_const (gen_rtx_REG (SImode, 1),
+ gen_rtx_REG (SImode, base),
GEN_INT (disp)));
- emit_move_insn (gen_rtx (REG, SImode, reg),
- gen_rtx (LO_SUM, SImode,
- gen_rtx (REG, SImode, 1),
- GEN_INT (disp)));
+ emit_move_insn (gen_rtx_REG (SImode, reg),
+ gen_rtx_LO_SUM (SImode,
+ gen_rtx_REG (SImode, 1),
+ GEN_INT (disp)));
}
}
@@ -2555,7 +2571,7 @@ static char hp_profile_label_name[8];
void
output_function_prologue (file, size)
FILE *file;
- int size;
+ int size ATTRIBUTE_UNUSED;
{
/* The function's label and associated .PROC must never be
separated and must be output *after* any profiling declarations
@@ -2636,7 +2652,7 @@ hppa_expand_prologue()
actual_fsize = compute_frame_size (size, &save_fregs);
/* Compute a few things we will use often. */
- tmpreg = gen_rtx (REG, SImode, 1);
+ tmpreg = gen_rtx_REG (SImode, 1);
size_rtx = GEN_INT (actual_fsize);
/* Handle out of line prologues and epilogues. */
@@ -2699,16 +2715,16 @@ hppa_expand_prologue()
if (inline_insn_count > outline_insn_count)
{
/* Put the local_fisze into %r19. */
- operands[0] = gen_rtx (REG, SImode, 19);
+ operands[0] = gen_rtx_REG (SImode, 19);
operands[1] = GEN_INT (local_fsize);
emit_move_insn (operands[0], operands[1]);
/* Put the stack size into %r21. */
- operands[0] = gen_rtx (REG, SImode, 21);
+ operands[0] = gen_rtx_REG (SImode, 21);
operands[1] = size_rtx;
emit_move_insn (operands[0], operands[1]);
- operands[0] = gen_rtx (REG, SImode, 22);
+ operands[0] = gen_rtx_REG (SImode, 22);
operands[1] = GEN_INT (saves);
emit_move_insn (operands[0], operands[1]);
@@ -2815,8 +2831,7 @@ hppa_expand_prologue()
place to get the expected results. sprintf here is just to
put something in the name. */
sprintf(hp_profile_label_name, "LP$%04d", -1);
- hp_profile_label_rtx = gen_rtx (SYMBOL_REF, SImode,
- hp_profile_label_name);
+ hp_profile_label_rtx = gen_rtx_SYMBOL_REF (SImode, hp_profile_label_name);
if (current_function_returns_struct)
store_reg (STRUCT_VALUE_REGNUM, - 12 - offsetadj, basereg);
@@ -2828,10 +2843,10 @@ hppa_expand_prologue()
pc_offset += VAL_14_BITS_P (arg_offset) ? 4 : 8;
}
- emit_move_insn (gen_rtx (REG, SImode, 26), gen_rtx (REG, SImode, 2));
- emit_move_insn (tmpreg, gen_rtx (HIGH, SImode, hp_profile_label_rtx));
- emit_move_insn (gen_rtx (REG, SImode, 24),
- gen_rtx (LO_SUM, SImode, tmpreg, hp_profile_label_rtx));
+ emit_move_insn (gen_rtx_REG (SImode, 26), gen_rtx_REG (SImode, 2));
+ emit_move_insn (tmpreg, gen_rtx_HIGH (SImode, hp_profile_label_rtx));
+ emit_move_insn (gen_rtx_REG (SImode, 24),
+ gen_rtx_LO_SUM (SImode, tmpreg, hp_profile_label_rtx));
/* %r25 is set from within the output pattern. */
emit_insn (gen_call_profiler (GEN_INT (- pc_offset - 20)));
@@ -2873,7 +2888,7 @@ hppa_expand_prologue()
{
merge_sp_adjust_with_store = 0;
emit_insn (gen_post_stwm (stack_pointer_rtx,
- gen_rtx (REG, SImode, i),
+ gen_rtx_REG (SImode, i),
GEN_INT (-offset)));
}
else
@@ -2908,9 +2923,9 @@ hppa_expand_prologue()
{
if (regs_ever_live[i] || regs_ever_live[i + 1])
{
- emit_move_insn (gen_rtx (MEM, DFmode,
- gen_rtx (POST_INC, DFmode, tmpreg)),
- gen_rtx (REG, DFmode, i));
+ emit_move_insn (gen_rtx_MEM (DFmode,
+ gen_rtx_POST_INC (DFmode, tmpreg)),
+ gen_rtx_REG (DFmode, i));
fr_saved++;
}
}
@@ -2934,15 +2949,15 @@ hppa_expand_prologue()
Avoid this if the callee saved register wasn't used (these are
leaf functions). */
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM_SAVED])
- emit_move_insn (gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED),
- gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM));
+ emit_move_insn (gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM_SAVED),
+ gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM));
}
void
output_function_epilogue (file, size)
FILE *file;
- int size;
+ int size ATTRIBUTE_UNUSED;
{
rtx insn = get_last_insn ();
@@ -3007,16 +3022,16 @@ hppa_expand_epilogue ()
emit_insn (gen_blockage ());
/* Put the local_fisze into %r19. */
- operands[0] = gen_rtx (REG, SImode, 19);
+ operands[0] = gen_rtx_REG (SImode, 19);
operands[1] = GEN_INT (local_fsize);
emit_move_insn (operands[0], operands[1]);
/* Put the stack size into %r21. */
- operands[0] = gen_rtx (REG, SImode, 21);
+ operands[0] = gen_rtx_REG (SImode, 21);
operands[1] = GEN_INT (actual_fsize);
emit_move_insn (operands[0], operands[1]);
- operands[0] = gen_rtx (REG, SImode, 22);
+ operands[0] = gen_rtx_REG (SImode, 22);
operands[1] = GEN_INT (saves);
emit_move_insn (operands[0], operands[1]);
@@ -3026,7 +3041,7 @@ hppa_expand_epilogue ()
}
/* We will use this often. */
- tmpreg = gen_rtx (REG, SImode, 1);
+ tmpreg = gen_rtx_REG (SImode, 1);
/* Try to restore RP early to avoid load/use interlocks when
RP gets used in the return (bv) instruction. This appears to still
@@ -3088,9 +3103,9 @@ hppa_expand_epilogue ()
{
if (regs_ever_live[i] || regs_ever_live[i + 1])
{
- emit_move_insn (gen_rtx (REG, DFmode, i),
- gen_rtx (MEM, DFmode,
- gen_rtx (POST_INC, DFmode, tmpreg)));
+ emit_move_insn (gen_rtx_REG (DFmode, i),
+ gen_rtx_MEM (DFmode,
+ gen_rtx_POST_INC (DFmode, tmpreg)));
}
}
}
@@ -3132,8 +3147,7 @@ hppa_expand_epilogue ()
}
/* If we were deferring a callee register restore, do it now. */
else if (! frame_pointer_needed && merge_sp_adjust_with_load)
- emit_insn (gen_pre_ldwm (gen_rtx (REG, SImode,
- merge_sp_adjust_with_load),
+ emit_insn (gen_pre_ldwm (gen_rtx_REG (SImode, merge_sp_adjust_with_load),
stack_pointer_rtx,
GEN_INT (- actual_fsize)));
else if (actual_fsize != 0)
@@ -3171,7 +3185,7 @@ hppa_expand_epilogue ()
rtx
return_addr_rtx (count, frameaddr)
- int count;
+ int count ATTRIBUTE_UNUSED;
rtx frameaddr;
{
rtx label;
@@ -3189,9 +3203,9 @@ return_addr_rtx (count, frameaddr)
privilege level from the two low order bits of the return address
pointer here so that ins will point to the start of the first
instruction that would have been executed if we returned. */
- ins = copy_to_reg (gen_rtx (AND, Pmode,
- copy_to_reg (gen_rtx (MEM, Pmode, saved_rp)),
- MASK_RETURN_ADDR));
+ ins = copy_to_reg (gen_rtx_AND (Pmode,
+ copy_to_reg (gen_rtx_MEM (Pmode, saved_rp)),
+ MASK_RETURN_ADDR));
label = gen_label_rtx ();
/* Check the instruction stream at the normal return address for the
@@ -3205,22 +3219,22 @@ return_addr_rtx (count, frameaddr)
If it is an export stub, than our return address is really in
-24[frameaddr]. */
- emit_cmp_insn (gen_rtx (MEM, SImode, ins),
+ emit_cmp_insn (gen_rtx_MEM (SImode, ins),
GEN_INT (0x4bc23fd1),
NE, NULL_RTX, SImode, 1, 0);
emit_jump_insn (gen_bne (label));
- emit_cmp_insn (gen_rtx (MEM, SImode, plus_constant (ins, 4)),
+ emit_cmp_insn (gen_rtx_MEM (SImode, plus_constant (ins, 4)),
GEN_INT (0x004010a1),
NE, NULL_RTX, SImode, 1, 0);
emit_jump_insn (gen_bne (label));
- emit_cmp_insn (gen_rtx (MEM, SImode, plus_constant (ins, 8)),
+ emit_cmp_insn (gen_rtx_MEM (SImode, plus_constant (ins, 8)),
GEN_INT (0x00011820),
NE, NULL_RTX, SImode, 1, 0);
emit_jump_insn (gen_bne (label));
- emit_cmp_insn (gen_rtx (MEM, SImode, plus_constant (ins, 12)),
+ emit_cmp_insn (gen_rtx_MEM (SImode, plus_constant (ins, 12)),
GEN_INT (0xe0400002),
NE, NULL_RTX, SImode, 1, 0);
@@ -3237,7 +3251,7 @@ return_addr_rtx (count, frameaddr)
emit_move_insn (saved_rp, plus_constant (frameaddr, -6 * UNITS_PER_WORD));
emit_label (label);
- return gen_rtx (MEM, Pmode, memory_address (Pmode, saved_rp));
+ return gen_rtx_MEM (Pmode, memory_address (Pmode, saved_rp));
}
/* This is only valid once reload has completed because it depends on
@@ -3262,13 +3276,14 @@ emit_bcond_fp (code, operand0)
enum rtx_code code;
rtx operand0;
{
- emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx,
- gen_rtx (IF_THEN_ELSE, VOIDmode,
- gen_rtx (code, VOIDmode,
- gen_rtx (REG, CCFPmode, 0),
- const0_rtx),
- gen_rtx (LABEL_REF, VOIDmode, operand0),
- pc_rtx)));
+ emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
+ gen_rtx_IF_THEN_ELSE (VOIDmode,
+ gen_rtx_fmt_ee (code,
+ VOIDmode,
+ gen_rtx_REG (CCFPmode, 0),
+ const0_rtx),
+ gen_rtx_LABEL_REF (VOIDmode, operand0),
+ pc_rtx)));
}
@@ -3277,8 +3292,8 @@ gen_cmp_fp (code, operand0, operand1)
enum rtx_code code;
rtx operand0, operand1;
{
- return gen_rtx (SET, VOIDmode, gen_rtx (REG, CCFPmode, 0),
- gen_rtx (code, CCFPmode, operand0, operand1));
+ return gen_rtx_SET (VOIDmode, gen_rtx_REG (CCFPmode, 0),
+ gen_rtx_fmt_ee (code, CCFPmode, operand0, operand1));
}
/* Adjust the cost of a scheduling dependency. Return the new cost of
@@ -3552,7 +3567,7 @@ pa_adjust_insn_length (insn, length)
also need adjustment. */
else if (GET_CODE (insn) == JUMP_INSN
&& simplejump_p (insn)
- && GET_MODE (PATTERN (insn)) == DImode)
+ && GET_MODE (insn) == SImode)
return 4;
/* Millicode insn with an unfilled delay slot. */
else if (GET_CODE (insn) == INSN
@@ -3981,8 +3996,8 @@ output_deferred_plabels (file)
for (i = 0; i < n_deferred_plabels; i++)
{
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
- assemble_integer (gen_rtx (SYMBOL_REF, VOIDmode,
- deferred_plabels[i].name), 4, 1);
+ assemble_integer (gen_rtx_SYMBOL_REF (VOIDmode,
+ deferred_plabels[i].name), 4, 1);
}
}
@@ -4015,11 +4030,11 @@ import_milli (code)
char *
output_mul_insn (unsignedp, insn)
- int unsignedp;
+ int unsignedp ATTRIBUTE_UNUSED;
rtx insn;
{
import_milli (mulI);
- return output_millicode_call (insn, gen_rtx (SYMBOL_REF, SImode, "$$mulI"));
+ return output_millicode_call (insn, gen_rtx_SYMBOL_REF (SImode, "$$mulI"));
}
/* Emit the rtl for doing a division by a constant. */
@@ -4055,19 +4070,20 @@ emit_hpdiv_const (operands, unsignedp)
&& INTVAL (operands[2]) < 16
&& magic_milli[INTVAL (operands[2])])
{
- emit_move_insn ( gen_rtx (REG, SImode, 26), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 26), operands[1]);
emit
(gen_rtx
(PARALLEL, VOIDmode,
- gen_rtvec (5, gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 29),
- gen_rtx (unsignedp ? UDIV : DIV, SImode,
- gen_rtx (REG, SImode, 26),
- operands[2])),
- gen_rtx (CLOBBER, VOIDmode, operands[3]),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 26)),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 25)),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, 31)))));
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 29));
+ gen_rtvec (5, gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, 29),
+ gen_rtx_fmt_ee (unsignedp ? UDIV : DIV,
+ SImode,
+ gen_rtx_REG (SImode, 26),
+ operands[2])),
+ gen_rtx_CLOBBER (VOIDmode, operands[3]),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 26)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 25)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 31)))));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 29));
return 1;
}
return 0;
@@ -4099,13 +4115,13 @@ output_div_insn (operands, unsignedp, insn)
{
sprintf (buf, "$$divU_%d", INTVAL (operands[0]));
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, buf));
+ gen_rtx_SYMBOL_REF (SImode, buf));
}
else
{
sprintf (buf, "$$divI_%d", INTVAL (operands[0]));
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, buf));
+ gen_rtx_SYMBOL_REF (SImode, buf));
}
}
/* Divisor isn't a special constant. */
@@ -4115,13 +4131,13 @@ output_div_insn (operands, unsignedp, insn)
{
import_milli (divU);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$divU"));
+ gen_rtx_SYMBOL_REF (SImode, "$$divU"));
}
else
{
import_milli (divI);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$divI"));
+ gen_rtx_SYMBOL_REF (SImode, "$$divI"));
}
}
}
@@ -4137,13 +4153,13 @@ output_mod_insn (unsignedp, insn)
{
import_milli (remU);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$remU"));
+ gen_rtx_SYMBOL_REF (SImode, "$$remU"));
}
else
{
import_milli (remI);
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode, "$$remI"));
+ gen_rtx_SYMBOL_REF (SImode, "$$remI"));
}
}
@@ -4344,7 +4360,7 @@ function_arg_padding (mode, type)
struct rtx_def *
hppa_builtin_saveregs (arglist)
- tree arglist;
+ tree arglist ATTRIBUTE_UNUSED;
{
rtx offset, dest;
tree fntype = TREE_TYPE (current_function_decl);
@@ -4359,8 +4375,9 @@ hppa_builtin_saveregs (arglist)
offset = current_function_arg_offset_rtx;
/* Store general registers on the stack. */
- dest = gen_rtx (MEM, BLKmode,
- plus_constant (current_function_internal_arg_pointer, -16));
+ dest = gen_rtx_MEM (BLKmode,
+ plus_constant (current_function_internal_arg_pointer,
+ -16));
move_block_from_reg (23, dest, 4, 4 * UNITS_PER_WORD);
/* move_block_from_reg will emit code to store the argument registers
@@ -4572,7 +4589,7 @@ output_cbranch (operands, nullify, length, negated, insn)
char *
output_bb (operands, nullify, length, negated, insn, which)
- rtx *operands;
+ rtx *operands ATTRIBUTE_UNUSED;
int nullify, length, negated;
rtx insn;
int which;
@@ -4710,7 +4727,7 @@ output_bb (operands, nullify, length, negated, insn, which)
char *
output_bvb (operands, nullify, length, negated, insn, which)
- rtx *operands;
+ rtx *operands ATTRIBUTE_UNUSED;
int nullify, length, negated;
rtx insn;
int which;
@@ -5295,14 +5312,14 @@ output_call (insn, call_dest)
if (arg_mode == SFmode)
{
xoperands[0] = XEXP (use, 0);
- xoperands[1] = gen_rtx (REG, SImode, 26 - (regno - 32) / 2);
+ xoperands[1] = gen_rtx_REG (SImode, 26 - (regno - 32) / 2);
output_asm_insn ("fstws %0,-16(%%sr0,%%r30)", xoperands);
output_asm_insn ("ldw -16(%%sr0,%%r30),%1", xoperands);
}
else
{
xoperands[0] = XEXP (use, 0);
- xoperands[1] = gen_rtx (REG, DImode, 25 - (regno - 34) / 2);
+ xoperands[1] = gen_rtx_REG (DImode, 25 - (regno - 34) / 2);
output_asm_insn ("fstds %0,-16(%%sr0,%%r30)", xoperands);
output_asm_insn ("ldw -12(%%sr0,%%r30),%R1", xoperands);
output_asm_insn ("ldw -16(%%sr0,%%r30),%1", xoperands);
@@ -5494,7 +5511,7 @@ hppa_encode_label (sym, permanent)
int
function_label_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == SYMBOL_REF && FUNCTION_NAME_P (XSTR (op, 0));
}
@@ -5634,7 +5651,7 @@ fmpysuboperands (operands)
int
plus_xor_ior_operator (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == PLUS || GET_CODE (op) == XOR
|| GET_CODE (op) == IOR);
@@ -5657,7 +5674,7 @@ shadd_constant_p (val)
int
shadd_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op)));
}
@@ -5711,7 +5728,7 @@ basereg_operand (op, mode)
int
non_hard_reg_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return ! (GET_CODE (op) == REG && REGNO (op) < FIRST_PSEUDO_REGISTER);
}
@@ -5739,7 +5756,7 @@ forward_branch_p (insn)
int
eq_neq_comparison_operator (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE);
}
@@ -5748,7 +5765,7 @@ eq_neq_comparison_operator (op, mode)
int
movb_comparison_operator (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE
|| GET_CODE (op) == LT || GET_CODE (op) == GE);
@@ -6043,18 +6060,52 @@ pa_reorg (insns)
if (GET_CODE (pattern) == ADDR_VEC)
{
/* Emit the jump itself. */
- tmp = gen_switch_jump (XEXP (XVECEXP (pattern, 0, i), 0));
+ tmp = gen_jump (XEXP (XVECEXP (pattern, 0, i), 0));
tmp = emit_jump_insn_after (tmp, location);
JUMP_LABEL (tmp) = XEXP (XVECEXP (pattern, 0, i), 0);
+ /* It is easy to rely on the branch table markers
+ during assembly output to trigger the correct code
+ for a switch table jump with an unfilled delay slot,
+
+ However, that requires state and assumes that we look
+ at insns in order.
+
+ We can't make such assumptions when computing the length
+ of instructions. Ugh. We could walk the insn chain to
+ determine if this instruction is in a branch table, but
+ that can get rather expensive, particularly during the
+ branch shortening phase of the compiler.
+
+ So instead we mark this jump as being special. This is
+ far from ideal and knows that no code after this will
+ muck around with the mode of the JUMP_INSN itself. */
+ PUT_MODE (tmp, SImode);
LABEL_NUSES (JUMP_LABEL (tmp))++;
location = NEXT_INSN (location);
}
else
{
/* Emit the jump itself. */
- tmp = gen_switch_jump (XEXP (XVECEXP (pattern, 1, i), 0));
+ tmp = gen_jump (XEXP (XVECEXP (pattern, 1, i), 0));
tmp = emit_jump_insn_after (tmp, location);
JUMP_LABEL (tmp) = XEXP (XVECEXP (pattern, 1, i), 0);
+ /* It is easy to rely on the branch table markers
+ during assembly output to trigger the correct code
+ for a switch table jump with an unfilled delay slot,
+
+ However, that requires state and assumes that we look
+ at insns in order.
+
+ We can't make such assumptions when computing the length
+ of instructions. Ugh. We could walk the insn chain to
+ determine if this instruction is in a branch table, but
+ that can get rather expensive, particularly during the
+ branch shortening phase of the compiler.
+
+ So instead we mark this jump as being special. This is
+ far from ideal and knows that no code after this will
+ muck around with the mode of the JUMP_INSN itself. */
+ PUT_MODE (tmp, SImode);
LABEL_NUSES (JUMP_LABEL (tmp))++;
location = NEXT_INSN (location);
}
@@ -6138,7 +6189,7 @@ pa_reorg (insns)
static void
pa_combine_instructions (insns)
- rtx insns;
+ rtx insns ATTRIBUTE_UNUSED;
{
rtx anchor, new;
@@ -6152,7 +6203,7 @@ pa_combine_instructions (insns)
may be combined with "floating" insns. As the name implies,
"anchor" instructions don't move, while "floating" insns may
move around. */
- new = gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2, NULL_RTX, NULL_RTX));
+ new = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, NULL_RTX, NULL_RTX));
new = make_insn_raw (new);
for (anchor = get_insns (); anchor; anchor = NEXT_INSN (anchor))
@@ -6287,17 +6338,18 @@ pa_combine_instructions (insns)
|| anchor_attr == PA_COMBINE_TYPE_FMPY))
{
/* Emit the new instruction and delete the old anchor. */
- emit_insn_before (gen_rtx (PARALLEL, VOIDmode,
- gen_rtvec (2, PATTERN (anchor),
- PATTERN (floater))),
- anchor);
+ emit_insn_before (gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (2,
+ PATTERN (anchor),
+ PATTERN (floater))),
+ anchor);
PUT_CODE (anchor, NOTE);
NOTE_LINE_NUMBER (anchor) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (anchor) = 0;
/* Emit a special USE insn for FLOATER, then delete
the floating insn. */
- emit_insn_before (gen_rtx (USE, VOIDmode, floater), floater);
+ emit_insn_before (gen_rtx_USE (VOIDmode, floater), floater);
delete_insn (floater);
continue;
@@ -6307,7 +6359,7 @@ pa_combine_instructions (insns)
{
rtx temp;
/* Emit the new_jump instruction and delete the old anchor. */
- temp = emit_jump_insn_before (gen_rtx (PARALLEL, VOIDmode,
+ temp = emit_jump_insn_before (gen_rtx_PARALLEL (VOIDmode,
gen_rtvec (2, PATTERN (anchor),
PATTERN (floater))),
anchor);
@@ -6318,7 +6370,7 @@ pa_combine_instructions (insns)
/* Emit a special USE insn for FLOATER, then delete
the floating insn. */
- emit_insn_before (gen_rtx (USE, VOIDmode, floater), floater);
+ emit_insn_before (gen_rtx_USE (VOIDmode, floater), floater);
delete_insn (floater);
continue;
}
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 73e7962bef5..1c92f211cba 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -803,7 +803,7 @@ int zdepi_cint_p ();
/* Return the stack location to use for secondary memory needed reloads. */
#define SECONDARY_MEMORY_NEEDED_RTX(MODE) \
- gen_rtx (MEM, MODE, gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (-16)))
+ gen_rtx_MEM (MODE, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-16)))
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
@@ -909,18 +909,18 @@ int zdepi_cint_p ();
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), ((! TARGET_SOFT_FLOAT \
- && (TYPE_MODE (VALTYPE) == SFmode || \
- TYPE_MODE (VALTYPE) == DFmode)) ? \
- 32 : 28))
+ gen_rtx_REG (TYPE_MODE (VALTYPE), ((! TARGET_SOFT_FLOAT \
+ && (TYPE_MODE (VALTYPE) == SFmode || \
+ TYPE_MODE (VALTYPE) == DFmode)) ? \
+ 32 : 28))
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
#define LIBCALL_VALUE(MODE) \
- gen_rtx (REG, MODE, \
- (! TARGET_SOFT_FLOAT \
- && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28))
+ gen_rtx_REG (MODE, \
+ (! TARGET_SOFT_FLOAT \
+ && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28))
/* 1 if N is a possible register number for a function value
as seen by the caller. */
@@ -1044,7 +1044,7 @@ struct hppa_args {int words, nargs_prototype, indirect; };
? (!TARGET_PORTABLE_RUNTIME || (TYPE) == 0 \
|| !FLOAT_MODE_P (MODE) || TARGET_SOFT_FLOAT \
|| (CUM).nargs_prototype > 0) \
- ? gen_rtx (REG, (MODE), \
+ ? gen_rtx_REG ((MODE), \
(FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \
? (((!(CUM).indirect \
|| TARGET_PORTABLE_RUNTIME) \
@@ -1061,17 +1061,17 @@ struct hppa_args {int words, nargs_prototype, indirect; };
(TYPE))))))\
/* We are calling a non-prototyped function with floating point \
arguments using the portable conventions. */ \
- : gen_rtx (PARALLEL, (MODE), \
+ : gen_rtx_PARALLEL ((MODE), \
gen_rtvec \
(2, \
- gen_rtx (EXPR_LIST, VOIDmode, \
- gen_rtx (REG, (MODE), \
+ gen_rtx_EXPR_LIST (VOIDmode, \
+ gen_rtx_REG ((MODE), \
(FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \
? ((CUM).words ? 38 : 34) \
: (32 + 2 * (CUM).words))), \
const0_rtx), \
- gen_rtx (EXPR_LIST, VOIDmode, \
- gen_rtx (REG, (MODE), \
+ gen_rtx_EXPR_LIST (VOIDmode, \
+ gen_rtx_REG ((MODE), \
(FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \
? ((CUM).words ? 23 : 25) \
: (27 - (CUM).words - \
@@ -1126,8 +1126,8 @@ extern enum cmp_type hppa_branch_type;
#endif
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-{ char *my_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (THUNK_FNDECL)); \
- char *target_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)); \
+{ char *target_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
+ STRIP_NAME_ENCODING (target_name, target_name); \
output_function_prologue (FILE, 0); \
if (VAL_14_BITS_P (DELTA)) \
fprintf (FILE, "\tb %s\n\tldo %d(%%r26),%%r26\n", target_name, DELTA); \
@@ -1344,9 +1344,9 @@ extern union tree_node *current_function_decl;
rtx start_addr, end_addr; \
\
start_addr = memory_address (Pmode, plus_constant ((TRAMP), 36)); \
- emit_move_insn (gen_rtx (MEM, Pmode, start_addr), (FNADDR)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR)); \
start_addr = memory_address (Pmode, plus_constant ((TRAMP), 40)); \
- emit_move_insn (gen_rtx (MEM, Pmode, start_addr), (CXT)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT)); \
/* fdc and fic only use registers for the address to flush, \
they do not accept integer displacements. */ \
start_addr = force_reg (SImode, (TRAMP)); \
@@ -1639,14 +1639,22 @@ extern struct rtx_def *hppa_builtin_saveregs ();
#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
do { \
int offset, newoffset, mask; \
+ rtx new, temp = NULL_RTX; \
mask = GET_MODE_CLASS (MODE) == MODE_FLOAT ? 0x1f : 0x3fff; \
\
if (optimize \
- && GET_CODE (AD) == PLUS \
- && GET_CODE (XEXP (AD, 0)) == REG \
- && GET_CODE (XEXP (AD, 1)) == CONST_INT) \
+ && GET_CODE (AD) == PLUS) \
+ temp = simplify_binary_operation (PLUS, Pmode, \
+ XEXP (AD, 0), XEXP (AD, 1)); \
+ \
+ new = temp ? temp : AD; \
+ \
+ if (optimize \
+ && GET_CODE (new) == PLUS \
+ && GET_CODE (XEXP (new, 0)) == REG \
+ && GET_CODE (XEXP (new, 1)) == CONST_INT) \
{ \
- offset = INTVAL (XEXP ((AD), 1)); \
+ offset = INTVAL (XEXP ((new), 1)); \
\
/* Choose rounding direction. Round up if we are >= halfway. */ \
if ((offset & mask) >= ((mask + 1) / 2)) \
@@ -1657,11 +1665,8 @@ do { \
if (newoffset != 0 \
&& VAL_14_BITS_P (newoffset)) \
{ \
- rtx temp; \
\
- /* Unshare the sum as well. */ \
- AD = copy_rtx (AD); \
- temp = gen_rtx_PLUS (Pmode, XEXP (AD, 0), \
+ temp = gen_rtx_PLUS (Pmode, XEXP (new, 0), \
GEN_INT (newoffset)); \
AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\
push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \
@@ -1824,8 +1829,14 @@ while (0)
/* Nonzero if access to memory by bytes is slow and undesirable. */
#define SLOW_BYTE_ACCESS 1
-/* Do not break .stabs pseudos into continuations. */
-#define DBX_CONTIN_LENGTH 4000
+/* Do not break .stabs pseudos into continuations.
+
+ This used to be zero (no max length), but big enums and such can
+ cause huge strings which killed gas.
+
+ We also have to avoid lossage in dbxout.c -- it does not compute the
+ string size accurately, so we are real conservative here. */
+#define DBX_CONTIN_LENGTH 3000
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
@@ -2316,7 +2327,7 @@ DTORS_SECTION_FUNCTION
fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE)
/* Jump tables are executable code and live in the TEXT section on the PA. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* This is how to output an element of a case-vector that is relative.
This must be defined correctly as it is used when generating PIC code.
@@ -2469,11 +2480,25 @@ extern char *output_div_insn ();
extern char *output_mod_insn ();
extern char *singlemove_string ();
extern void output_arg_descriptor ();
+extern void output_deferred_plabels ();
+extern void override_options ();
+extern void output_ascii ();
+extern void output_function_prologue ();
+extern void output_function_epilogue ();
extern void output_global_address ();
+extern void print_operand ();
extern struct rtx_def *legitimize_pic_address ();
extern struct rtx_def *gen_cmp_fp ();
extern void hppa_encode_label ();
extern int arith11_operand ();
+extern int symbolic_expression_p ();
+extern int reloc_needed ();
+extern int compute_frame_size ();
+extern int hppa_address_cost ();
+extern int and_mask_p ();
+extern int symbolic_memory_operand ();
+extern int pa_adjust_cost ();
+extern int pa_adjust_insn_length ();
extern int int11_operand ();
extern int reg_or_cint_move_operand ();
extern int arith5_operand ();
@@ -2511,7 +2536,7 @@ extern void hppa_expand_epilogue ();
extern int hppa_can_use_return_insn_p ();
extern int is_function_label_plus_const ();
extern int jump_in_call_delay ();
-
+extern enum reg_class secondary_reload_class ();
/* Declare functions defined in pa.c and used in templates. */
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index f1fb4bce19f..2f3848c28b3 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -808,7 +808,7 @@
/* operands[1] is currently the result of compare_from_rtx. We want to
emit a compare of the original operands. */
- operands[1] = gen_rtx (code, SImode, hppa_compare_op0, hppa_compare_op1);
+ operands[1] = gen_rtx_fmt_ee (code, SImode, hppa_compare_op0, hppa_compare_op1);
operands[4] = hppa_compare_op0;
operands[5] = hppa_compare_op1;
}")
@@ -1316,7 +1316,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -1331,7 +1331,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2190,7 +2190,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2205,7 +2205,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2341,7 +2341,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2356,7 +2356,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2495,7 +2495,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2510,7 +2510,7 @@
DONE;
/* We don't want the clobber emitted, so handle this ourselves. */
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}")
@@ -2937,7 +2937,7 @@
}
else if (cint_ok_for_move (-intval))
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[4], GEN_INT (-intval)));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[4], GEN_INT (-intval)));
emit_insn (gen_subsi3 (operands[0], operands[1], operands[4]));
DONE;
}
@@ -3019,9 +3019,9 @@
operands[1] = force_reg (SImode, operands[1]);
operands[2] = force_reg (SImode, operands[2]);
emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2]));
- emit_insn (gen_rtx (SET, VOIDmode,
- operands[0],
- gen_rtx (SUBREG, SImode, scratch, 1)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_SUBREG (SImode, scratch, 1)));
DONE;
}
operands[3] = gen_reg_rtx (SImode);
@@ -3910,19 +3910,16 @@
""
[(set_attr "length" "0")])
-(define_insn "switch_jump"
- [(set:DI (pc) (label_ref (match_operand 0 "" "")))]
- ""
- "bl %l0,0%#"
- [(set_attr "type" "uncond_branch")
- (set_attr "length" "4")])
-
(define_insn "jump"
[(set (pc) (label_ref (match_operand 0 "" "")))]
""
"*
{
extern int optimize;
+
+ if (GET_MODE (insn) == SImode)
+ return \"bl %l0,0%#\";
+
/* An unconditional branch which can reach its target. */
if (get_attr_length (insn) != 24
&& get_attr_length (insn) != 16)
@@ -4029,7 +4026,7 @@
if (TARGET_BIG_SWITCH)
{
rtx temp = gen_reg_rtx (SImode);
- emit_move_insn (temp, gen_rtx (PLUS, SImode, operands[0], operands[0]));
+ emit_move_insn (temp, gen_rtx_PLUS (SImode, operands[0], operands[0]));
operands[0] = temp;
}
emit_jump_insn (gen_casesi0 (operands[0], operands[3]));
@@ -4074,7 +4071,7 @@
call_insn = emit_call_insn (gen_call_internal_symref (op, operands[1]));
else
{
- rtx tmpreg = gen_rtx (REG, SImode, 22);
+ rtx tmpreg = gen_rtx_REG (SImode, 22);
emit_move_insn (tmpreg, force_reg (SImode, op));
call_insn = emit_call_insn (gen_call_internal_reg (operands[1]));
}
@@ -4089,8 +4086,8 @@
This will set regs_ever_live for the callee saved register we
stored the PIC register in. */
emit_move_insn (pic_offset_table_rtx,
- gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
/* Gross. We have to keep the scheduler from moving the restore
of the PIC register away from the call. SCHED_GROUP_P is
@@ -4114,7 +4111,7 @@
"*
{
output_arg_descriptor (insn);
- return output_call (insn, operands[0], gen_rtx (REG, SImode, 2));
+ return output_call (insn, operands[0], gen_rtx_REG (SImode, 2));
}"
[(set_attr "type" "call")
(set (attr "length")
@@ -4231,7 +4228,7 @@
operands[2]));
else
{
- rtx tmpreg = gen_rtx (REG, SImode, 22);
+ rtx tmpreg = gen_rtx_REG (SImode, 22);
emit_move_insn (tmpreg, force_reg (SImode, op));
call_insn = emit_call_insn (gen_call_value_internal_reg (operands[0],
operands[2]));
@@ -4246,8 +4243,8 @@
This will set regs_ever_live for the callee saved register we
stored the PIC register in. */
emit_move_insn (pic_offset_table_rtx,
- gen_rtx (REG, SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM_SAVED));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
/* Gross. We have to keep the scheduler from moving the restore
of the PIC register away from the call. SCHED_GROUP_P is
@@ -4273,7 +4270,7 @@
"*
{
output_arg_descriptor (insn);
- return output_call (insn, operands[1], gen_rtx (REG, SImode, 2));
+ return output_call (insn, operands[1], gen_rtx_REG (SImode, 2));
}"
[(set_attr "type" "call")
(set (attr "length")
@@ -4508,7 +4505,7 @@
;; This insn is used for some loop tests, typically loops reversed when
;; strength reduction is used. It is actually created when the instruction
;; combination phase combines the special loop test. Since this insn
-;; is both a jump insn and has an output, it must deal with it's own
+;; is both a jump insn and has an output, it must deal with its own
;; reloads, hence the `m' constraints. The `!' constraints direct reload
;; to not choose the register alternatives in the event a reload is needed.
(define_insn "decrement_and_branch_until_zero"
@@ -5112,8 +5109,7 @@
/* Else call $$sh_func_adrs to extract the function's real add24. */
return output_millicode_call (insn,
- gen_rtx (SYMBOL_REF, SImode,
- \"$$sh_func_adrs\"));
+ gen_rtx_SYMBOL_REF (SImode, \"$$sh_func_adrs\"));
}"
[(set_attr "type" "multi")
(set (attr "length")
@@ -5159,9 +5155,8 @@
/* Load the PIC register from the stack slot (in our caller's
frame). */
emit_move_insn (pic_offset_table_rtx,
- gen_rtx (MEM, SImode,
- plus_constant (stack_pointer_rtx, -32)));
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, -32)));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
emit_insn (gen_blockage ());
DONE;
}")
diff --git a/gcc/config/rs6000/aix41.h b/gcc/config/rs6000/aix41.h
index 2e9b093eaca..b35fe93de71 100644
--- a/gcc/config/rs6000/aix41.h
+++ b/gcc/config/rs6000/aix41.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX version 4.1.
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@npac.syr.edu).
This file is part of GNU CC.
@@ -38,15 +38,13 @@ Boston, MA 02111-1307, USA. */
/* Common ASM definitions used by ASM_SPEC amonst the various targets
for handling -mcpu=xxx switches. */
-
#undef ASM_CPU_SPEC
#define ASM_CPU_SPEC \
"%{!mcpu*: \
%{mpower: %{!mpower2: -mpwr}} \
%{mpower2: -mpwr2} \
%{mpowerpc*: -mppc} \
- %{mno-power: %{!mpowerpc*: -mcom}} \
- %{!mno-power: %{!mpower2: %(asm_default)}}} \
+ %{!mpower*: %{!mpowerpc*: %(asm_default)}}} \
%{mcpu=common: -mcom} \
%{mcpu=power: -mpwr} \
%{mcpu=power2: -mpwr2} \
@@ -67,9 +65,12 @@ Boston, MA 02111-1307, USA. */
%{mcpu=821: -mppc} \
%{mcpu=860: -mppc}"
+#undef ASM_DEFAULT_SPEC
+#define ASM_DEFAULT_SPEC "-mcom"
+
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 \
--Asystem(unix) -Asystem(aix)"
+-D_LONG_LONG -Asystem(unix) -Asystem(aix)"
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
@@ -77,12 +78,38 @@ Boston, MA 02111-1307, USA. */
%{mthreads: -D_THREAD_SAFE}\
%(cpp_cpu)"
+/* Common CPP definitions used by CPP_SPEC among the various targets
+ for handling -mcpu=xxx switches. */
+#undef CPP_CPU_SPEC
+#define CPP_CPU_SPEC \
+"%{!mcpu*: \
+ %{mpower: %{!mpower2: -D_ARCH_PWR}} \
+ %{mpower2: -D_ARCH_PWR2} \
+ %{mpowerpc*: -D_ARCH_PPC} \
+ %{!mpower*: %{!mpowerpc*: %(cpp_default)}}} \
+%{mcpu=common: -D_ARCH_COM} \
+%{mcpu=power: -D_ARCH_PWR} \
+%{mcpu=power2: -D_ARCH_PWR2} \
+%{mcpu=powerpc: -D_ARCH_PPC} \
+%{mcpu=rios: -D_ARCH_PWR} \
+%{mcpu=rios1: -D_ARCH_PWR} \
+%{mcpu=rios2: -D_ARCH_PWR2} \
+%{mcpu=rsc: -D_ARCH_PWR} \
+%{mcpu=rsc1: -D_ARCH_PWR} \
+%{mcpu=403: -D_ARCH_PPC} \
+%{mcpu=505: -D_ARCH_PPC} \
+%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
+%{mcpu=602: -D_ARCH_PPC} \
+%{mcpu=603: -D_ARCH_PPC} \
+%{mcpu=603e: -D_ARCH_PPC} \
+%{mcpu=604: -D_ARCH_PPC} \
+%{mcpu=620: -D_ARCH_PPC} \
+%{mcpu=821: -D_ARCH_PPC} \
+%{mcpu=860: -D_ARCH_PPC}"
+
#undef CPP_DEFAULT_SPEC
#define CPP_DEFAULT_SPEC "-D_ARCH_COM"
-#undef ASM_DEFAULT_SPEC
-#define ASM_DEFAULT_SPEC "-mcom"
-
#undef TARGET_DEFAULT
#define TARGET_DEFAULT MASK_NEW_MNEMONICS
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index 21d9bc8dbfb..19f939f7a69 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -25,8 +25,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define CPP_PREDEFINES \
"-DPPC -D__ELF__ -Dunix -Dlinux -Dpowerpc -Asystem(unix) -Asystem(linux) -Acpu(powerpc) -Amachine(powerpc)"
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
+
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32ppc %{shared:-shared} \
+#define LINK_SPEC "-m elf32ppc %{G*} %{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
@@ -69,4 +72,4 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
diff --git a/gcc/config/rs6000/netware.h b/gcc/config/rs6000/netware.h
index f6de2aab0ea..a465c63fe3b 100644
--- a/gcc/config/rs6000/netware.h
+++ b/gcc/config/rs6000/netware.h
@@ -1,6 +1,6 @@
/* Core target definitions for GNU compiler
for IBM RS/6000 PowerPC running NetWare
- Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GNU CC.
@@ -21,7 +21,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define TARGET_AIX 0
-#include "rs6000/powerpc.h"
+#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
+
+#define ASM_DEFAULT_SPEC "-mppc"
+
+#include "rs6000/rs6000.h"
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
+
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_PPC601
/* Don't generate XCOFF debugging information. */
diff --git a/gcc/config/rs6000/powerpc.h b/gcc/config/rs6000/powerpc.h
deleted file mode 100644
index 9f1ffd606cc..00000000000
--- a/gcc/config/rs6000/powerpc.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Definitions of target machine for GNU compiler,
- for IBM RS/6000 PowerPC running AIX version 3.2.
- Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
- Contributed by David Edelsohn (edelsohn@npac.syr.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. */
-
-
-#include "rs6000/rs6000.h"
-
-#undef ASM_SPEC
-#define ASM_SPEC "-u %(asm_cpu)"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 \
--Asystem(unix) -Asystem(aix) -Acpu(powerpc) -Amachine(powerpc)"
-
-#undef CPP_DEFAULT_SPEC
-#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
-
-#undef ASM_DEFAULT_SPEC
-#define ASM_DEFAULT_SPEC "-mppc"
-
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
-
-#undef PROCESSOR_DEFAULT
-#define PROCESSOR_DEFAULT PROCESSOR_PPC601
-
-/* These are not necessary when we pass -u to the assembler, and undefining
- them saves a great deal of space in object files. */
-
-#undef ASM_OUTPUT_EXTERNAL
-#undef ASM_OUTPUT_EXTERNAL_LIBCALL
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
-{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
- if ((TREE_CODE (DECL) == VAR_DECL \
- || TREE_CODE (DECL) == FUNCTION_DECL) \
- && (NAME)[strlen (NAME) - 1] != ']') \
- { \
- char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
- strcpy (_name, XSTR (_symref, 0)); \
- strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
- XSTR (_symref, 0) = _name; \
- } \
-}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d0663d7a65b..b1b36fe423e 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1,5 +1,5 @@
/* Subroutines used for code generation on IBM RS/6000.
- Copyright (C) 1991, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1991, 93-7, 1998 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "insn-config.h"
#include "conditions.h"
#include "insn-flags.h"
-#include "output.h"
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
@@ -37,6 +36,8 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "except.h"
#include "function.h"
+#include "output.h"
+#include "toplev.h"
#ifndef TARGET_NO_PROTOTYPE
#define TARGET_NO_PROTOTYPE 0
@@ -200,6 +201,9 @@ rs6000_override_options (default_cpu)
{"rios2", PROCESSOR_RIOS2,
MASK_POWER | MASK_MULTIPLE | MASK_STRING | MASK_POWER2,
POWERPC_MASKS | MASK_NEW_MNEMONICS},
+ {"401", PROCESSOR_PPC403,
+ MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
+ POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
{"403", PROCESSOR_PPC403,
MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN,
POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
@@ -218,15 +222,18 @@ rs6000_override_options (default_cpu)
{"603e", PROCESSOR_PPC603,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
+ {"ec603e", PROCESSOR_PPC603,
+ MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
+ POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
{"604", PROCESSOR_PPC604,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"604e", PROCESSOR_PPC604,
+ {"604e", PROCESSOR_PPC604e,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
{"620", PROCESSOR_PPC620,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
+ POWER_MASKS | MASK_PPC_GPOPT},
{"801", PROCESSOR_MPCCORE,
MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
@@ -275,6 +282,11 @@ rs6000_override_options (default_cpu)
}
}
+ /* If we are optimizing big endian systems for space, use the
+ store multiple instructions. */
+ if (BYTES_BIG_ENDIAN && optimize_size)
+ target_flags |= MASK_MULTIPLE;
+
/* If -mmultiple or -mno-multiple was explicitly used, don't
override with the processor default */
if (TARGET_MULTIPLE_SET)
@@ -304,6 +316,13 @@ rs6000_override_options (default_cpu)
}
}
+ if (flag_pic && (DEFAULT_ABI == ABI_AIX))
+ {
+ warning ("-f%s ignored for AIX (all code is position independent)",
+ (flag_pic > 1) ? "PIC" : "pic");
+ flag_pic = 0;
+ }
+
/* Set debug flags */
if (rs6000_debug_name)
{
@@ -328,6 +347,18 @@ rs6000_override_options (default_cpu)
SUBTARGET_OVERRIDE_OPTIONS;
#endif
}
+
+void
+optimization_options (level, size)
+ int level;
+ int size ATTRIBUTE_UNUSED;
+{
+#ifdef HAIFA
+ /* When optimizing, enable use of BCT instruction. */
+ if (level >= 1)
+ flag_branch_on_count_reg = 1;
+#endif
+}
/* Do anything needed at the start of the asm file. */
@@ -388,22 +419,6 @@ rs6000_float_const (string, mode)
REAL_VALUE_TYPE value = REAL_VALUE_ATOF (string, mode);
return immed_real_const_1 (value, mode);
}
-
-
-/* Create a CONST_DOUBLE like immed_double_const, except reverse the
- two parts of the constant if the target is little endian. */
-
-struct rtx_def *
-rs6000_immed_double_const (i0, i1, mode)
- HOST_WIDE_INT i0, i1;
- enum machine_mode mode;
-{
- if (! WORDS_BIG_ENDIAN)
- return immed_double_const (i1, i0, mode);
-
- return immed_double_const (i0, i1, mode);
-}
-
/* Return non-zero if this function is known to have a null epilogue. */
@@ -429,8 +444,8 @@ direct_return ()
int
any_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+ register rtx op ATTRIBUTE_UNUSED;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return 1;
}
@@ -439,7 +454,7 @@ any_operand (op, mode)
int
count_register_operand(op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != REG)
return 0;
@@ -458,7 +473,7 @@ count_register_operand(op, mode)
int
fpmem_operand(op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != REG)
return 0;
@@ -479,10 +494,11 @@ fpmem_operand(op, mode)
int
short_cint_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
- return (GET_CODE (op) == CONST_INT
- && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) < 0x10000);
+ return ((GET_CODE (op) == CONST_INT
+ && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) < 0x10000)
+ || GET_CODE (op) == CONSTANT_P_RTX);
}
/* Similar for a unsigned D field. */
@@ -490,9 +506,11 @@ short_cint_operand (op, mode)
int
u_short_cint_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
- return (GET_CODE (op) == CONST_INT && (INTVAL (op) & 0xffff0000) == 0);
+ return ((GET_CODE (op) == CONST_INT
+ && (INTVAL (op) & (~ (HOST_WIDE_INT) 0xffff)) == 0)
+ || GET_CODE (op) == CONSTANT_P_RTX);
}
/* Return 1 if OP is a CONST_INT that cannot fit in a signed D field. */
@@ -500,7 +518,7 @@ u_short_cint_operand (op, mode)
int
non_short_cint_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) >= 0x10000);
@@ -568,11 +586,7 @@ reg_or_u_short_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- if (GET_CODE (op) == CONST_INT
- && (INTVAL (op) & 0xffff0000) == 0)
- return 1;
-
- return gpc_reg_operand (op, mode);
+ return u_short_cint_operand (op, mode) || gpc_reg_operand (op, mode);
}
/* Return 1 is the operand is either a non-special register or ANY
@@ -583,7 +597,9 @@ reg_or_cint_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- return GET_CODE (op) == CONST_INT || gpc_reg_operand (op, mode);
+ return (GET_CODE (op) == CONST_INT
+ || GET_CODE (op) == CONSTANT_P_RTX
+ || gpc_reg_operand (op, mode));
}
/* Return 1 if the operand is an operand that can be loaded via the GOT */
@@ -591,7 +607,7 @@ reg_or_cint_operand (op, mode)
int
got_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == SYMBOL_REF
|| GET_CODE (op) == CONST
@@ -604,7 +620,7 @@ got_operand (op, mode)
int
got_no_const_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF);
}
@@ -706,6 +722,9 @@ num_insns_constant (op, mode)
&& ((low & 0x80000000) != 0))
return num_insns_constant_wide (low);
+ else if (mask64_operand (op, mode))
+ return 2;
+
else if (low == 0)
return num_insns_constant_wide (high) + 1;
@@ -770,8 +789,10 @@ easy_fp_constant (op, mode)
return num_insns_constant_wide (l) == 1;
}
- else if (mode == DImode && TARGET_32BIT)
- return num_insns_constant (op, DImode) == 2;
+ else if (mode == DImode)
+ return ((TARGET_64BIT
+ && GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_LOW (op) == 0)
+ || (num_insns_constant (op, DImode) <= 2));
else
abort ();
@@ -844,7 +865,7 @@ add_operand (op, mode)
int
non_add_cint_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) >= 0x10000
@@ -861,8 +882,9 @@ logical_operand (op, mode)
{
return (gpc_reg_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
- && ((INTVAL (op) & 0xffff0000) == 0
- || (INTVAL (op) & 0xffff) == 0)));
+ && ((INTVAL (op) & (~ (HOST_WIDE_INT) 0xffff)) == 0
+ || (INTVAL (op) & 0xffff) == 0))
+ || GET_CODE (op) == CONSTANT_P_RTX);
}
/* Return 1 if C is a constant that is not a logical operand (as
@@ -871,10 +893,10 @@ logical_operand (op, mode)
int
non_logical_cint_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == CONST_INT
- && (INTVAL (op) & 0xffff0000) != 0
+ && (INTVAL (op) & (~ (HOST_WIDE_INT) 0xffff)) != 0
&& (INTVAL (op) & 0xffff) != 0);
}
@@ -885,7 +907,7 @@ non_logical_cint_operand (op, mode)
int
mask_constant (c)
- register int c;
+ register HOST_WIDE_INT c;
{
int i;
int last_bit_value;
@@ -908,32 +930,110 @@ mask_constant (c)
int
mask_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == CONST_INT && mask_constant (INTVAL (op));
}
-/* Return 1 if the operand is either a non-special register or a
- constant that can be used as the operand of an RS/6000 logical AND insn. */
+/* Return 1 if the operand is a constant that is a PowerPC64 mask.
+ It is if there are no more than one 1->0 or 0->1 transitions.
+ Reject all ones and all zeros, since these should have been optimized
+ away and confuse the making of MB and ME. */
int
-and_operand (op, mode)
+mask64_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT)
+ {
+ HOST_WIDE_INT c = INTVAL (op);
+ int i;
+ int last_bit_value;
+ int transitions = 0;
+
+ if (c == 0 || c == ~0)
+ return 0;
+
+ last_bit_value = c & 1;
+
+ for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
+ if (((c >>= 1) & 1) != last_bit_value)
+ last_bit_value ^= 1, transitions++;
+
+#if HOST_BITS_PER_WIDE_INT == 32
+ /* Consider CONST_INT sign-extended. */
+ transitions += (last_bit_value != 1);
+#endif
+
+ return transitions <= 1;
+ }
+ else if (GET_CODE (op) == CONST_DOUBLE
+ && (mode == VOIDmode || mode == DImode))
+ {
+ HOST_WIDE_INT low = CONST_DOUBLE_LOW (op);
+#if HOST_BITS_PER_WIDE_INT == 32
+ HOST_WIDE_INT high = CONST_DOUBLE_HIGH (op);
+#endif
+ int i;
+ int last_bit_value;
+ int transitions = 0;
+
+ if ((low == 0
+#if HOST_BITS_PER_WIDE_INT == 32
+ && high == 0
+#endif
+ )
+ || (low == ~0
+#if HOST_BITS_PER_WIDE_INT == 32
+ && high == ~0
+#endif
+ ))
+ return 0;
+
+ last_bit_value = low & 1;
+
+ for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
+ if (((low >>= 1) & 1) != last_bit_value)
+ last_bit_value ^= 1, transitions++;
+
+#if HOST_BITS_PER_WIDE_INT == 32
+ if ((high & 1) != last_bit_value)
+ last_bit_value ^= 1, transitions++;
+
+ for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
+ if (((high >>= 1) & 1) != last_bit_value)
+ last_bit_value ^= 1, transitions++;
+#endif
+
+ return transitions <= 1;
+ }
+ else
+ return 0;
+}
+
+/* Return 1 if the operand is either a non-special register or a constant
+ that can be used as the operand of a PowerPC64 logical AND insn. */
+
+int
+and64_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
return (logical_operand (op, mode)
- || mask_operand (op, mode));
+ || mask64_operand (op, mode));
}
-/* Return 1 if the operand is a constant but not a valid operand for an AND
- insn. */
+/* Return 1 if the operand is either a non-special register or a
+ constant that can be used as the operand of an RS/6000 logical AND insn. */
int
-non_and_cint_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+and_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
{
- return GET_CODE (op) == CONST_INT && ! and_operand (op, mode);
+ return (logical_operand (op, mode)
+ || mask_operand (op, mode));
}
/* Return 1 if the operand is a general register or memory operand. */
@@ -991,7 +1091,7 @@ call_operand (op, mode)
int
current_file_function_operand (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == SYMBOL_REF
&& (SYMBOL_REF_FLAG (op)
@@ -1018,7 +1118,9 @@ input_operand (op, mode)
/* Allow any integer constant. */
if (GET_MODE_CLASS (mode) == MODE_INT
- && (GET_CODE (op) == CONST_INT || GET_CODE (op) == CONST_DOUBLE))
+ && (GET_CODE (op) == CONST_INT
+ || GET_CODE (op) == CONSTANT_P_RTX
+ || GET_CODE (op) == CONST_DOUBLE))
return 1;
/* For floating-point or multi-word mode, the only remaining valid type
@@ -1057,8 +1159,13 @@ input_operand (op, mode)
int
small_data_operand (op, mode)
+#if TARGET_ELF
rtx op;
enum machine_mode mode;
+#else
+ rtx op ATTRIBUTE_UNUSED;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+#endif
{
#if TARGET_ELF
rtx sym_ref, const_part;
@@ -1114,7 +1221,7 @@ void
init_cumulative_args (cum, fntype, libname, incoming)
CUMULATIVE_ARGS *cum;
tree fntype;
- rtx libname;
+ rtx libname ATTRIBUTE_UNUSED;
int incoming;
{
static CUMULATIVE_ARGS zero_cumulative;
@@ -1240,7 +1347,8 @@ function_arg_advance (cum, mode, type, named)
tree type;
int named;
{
- int align = ((cum->words & 1) != 0 && function_arg_boundary (mode, type) == 64) ? 1 : 0;
+ int align = (TARGET_32BIT && (cum->words & 1) != 0
+ && function_arg_boundary (mode, type) == 64) ? 1 : 0;
cum->words += align;
cum->nargs_prototype--;
@@ -1313,7 +1421,8 @@ function_arg (cum, mode, type, named)
tree type;
int named;
{
- int align = ((cum->words & 1) != 0 && function_arg_boundary (mode, type) == 64) ? 1 : 0;
+ int align = (TARGET_32BIT && (cum->words & 1) != 0
+ && function_arg_boundary (mode, type) == 64) ? 1 : 0;
int align_words = cum->words + align;
if (TARGET_DEBUG_ARG)
@@ -1362,12 +1471,12 @@ function_arg (cum, mode, type, named)
&& (DEFAULT_ABI != ABI_AIX
|| ! TARGET_XL_CALL
|| (align_words < GP_ARG_NUM_REG))))
- return gen_rtx (REG, mode, cum->fregno);
+ return gen_rtx_REG (mode, cum->fregno);
- return gen_rtx (PARALLEL, mode,
+ return gen_rtx_PARALLEL (mode,
gen_rtvec
(2,
- gen_rtx (EXPR_LIST, VOIDmode,
+ gen_rtx_EXPR_LIST (VOIDmode,
((align_words >= GP_ARG_NUM_REG)
? NULL_RTX
: (align_words
@@ -1376,13 +1485,13 @@ function_arg (cum, mode, type, named)
/* If this is partially on the stack, then
we only include the portion actually
in registers here. */
- ? gen_rtx (REG, SImode,
+ ? gen_rtx_REG (SImode,
GP_ARG_MIN_REG + align_words)
- : gen_rtx (REG, mode,
+ : gen_rtx_REG (mode,
GP_ARG_MIN_REG + align_words))),
const0_rtx),
- gen_rtx (EXPR_LIST, VOIDmode,
- gen_rtx (REG, mode, cum->fregno),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode, cum->fregno),
const0_rtx)));
}
@@ -1396,7 +1505,7 @@ function_arg (cum, mode, type, named)
}
else if (align_words < GP_ARG_NUM_REG)
- return gen_rtx (REG, mode, GP_ARG_MIN_REG + align_words);
+ return gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words);
return NULL_RTX;
}
@@ -1447,10 +1556,10 @@ function_arg_partial_nregs (cum, mode, type, named)
int
function_arg_pass_by_reference (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
+ CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
tree type;
- int named;
+ int named ATTRIBUTE_UNUSED;
{
if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
&& type && AGGREGATE_TYPE_P (type))
@@ -1489,7 +1598,7 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
{
rtx save_area = virtual_incoming_args_rtx;
- int reg_size = (TARGET_64BIT) ? 8 : 4;
+ int reg_size = TARGET_32BIT ? 4 : 8;
if (TARGET_DEBUG_ARG)
fprintf (stderr,
@@ -1518,7 +1627,7 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
if (!no_rtl && first_reg_offset != GP_ARG_NUM_REG)
move_block_from_reg
(GP_ARG_MIN_REG + first_reg_offset,
- gen_rtx (MEM, BLKmode,
+ gen_rtx_MEM (BLKmode,
plus_constant (save_area, first_reg_offset * reg_size)),
GP_ARG_NUM_REG - first_reg_offset,
(GP_ARG_NUM_REG - first_reg_offset) * UNITS_PER_WORD);
@@ -1534,21 +1643,21 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
if (num_fp_reg >= 0)
{
- rtx cr1 = gen_rtx (REG, CCmode, 69);
+ rtx cr1 = gen_rtx_REG (CCmode, 69);
rtx lab = gen_label_rtx ();
int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG) * 8);
- emit_jump_insn (gen_rtx (SET, VOIDmode,
+ emit_jump_insn (gen_rtx_SET (VOIDmode,
pc_rtx,
- gen_rtx (IF_THEN_ELSE, VOIDmode,
- gen_rtx (NE, VOIDmode, cr1, const0_rtx),
- gen_rtx (LABEL_REF, VOIDmode, lab),
+ gen_rtx_IF_THEN_ELSE (VOIDmode,
+ gen_rtx_NE (VOIDmode, cr1, const0_rtx),
+ gen_rtx_LABEL_REF (VOIDmode, lab),
pc_rtx)));
while ( num_fp_reg-- >= 0)
{
- emit_move_insn (gen_rtx (MEM, DFmode, plus_constant (save_area, off)),
- gen_rtx (REG, DFmode, fregno++));
+ emit_move_insn (gen_rtx_MEM (DFmode, plus_constant (save_area, off)),
+ gen_rtx_REG (DFmode, fregno++));
off += 8;
}
@@ -1575,7 +1684,7 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
struct rtx_def *
expand_builtin_saveregs (args)
- tree args;
+ tree args ATTRIBUTE_UNUSED;
{
return virtual_incoming_args_rtx;
}
@@ -1590,7 +1699,7 @@ expand_block_move_mem (mode, addr, orig_mem)
rtx addr;
rtx orig_mem;
{
- rtx mem = gen_rtx (MEM, mode, addr);
+ rtx mem = gen_rtx_MEM (mode, addr);
RTX_UNCHANGING_P (mem) = RTX_UNCHANGING_P (orig_mem);
MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (orig_mem);
@@ -1766,8 +1875,8 @@ expand_block_move (operands)
}
else
{
- src_addr = gen_rtx (PLUS, Pmode, src_reg, GEN_INT (offset));
- dest_addr = gen_rtx (PLUS, Pmode, dest_reg, GEN_INT (offset));
+ src_addr = gen_rtx_PLUS (Pmode, src_reg, GEN_INT (offset));
+ dest_addr = gen_rtx_PLUS (Pmode, dest_reg, GEN_INT (offset));
}
/* Generate the appropriate load and store, saving the stores for later */
@@ -1822,7 +1931,7 @@ expand_block_move (operands)
int
load_multiple_operation (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
int count = XVECLEN (op, 0);
int dest_regno;
@@ -1865,7 +1974,7 @@ load_multiple_operation (op, mode)
int
store_multiple_operation (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
int count = XVECLEN (op, 0) - 1;
int src_regno;
@@ -1908,7 +2017,7 @@ store_multiple_operation (op, mode)
int
branch_comparison_operator (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
enum rtx_code code = GET_CODE (op);
enum machine_mode cc_mode;
@@ -1969,6 +2078,17 @@ scc_comparison_operator (op, mode)
return 1;
}
+
+int
+trap_comparison_operator (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (mode != VOIDmode && mode != GET_MODE (op))
+ return 0;
+ return (GET_RTX_CLASS (GET_CODE (op)) == '<'
+ || GET_CODE (op) == EQ || GET_CODE (op) == NE);
+}
/* Return 1 if ANDOP is a mask that has no bits on that are not in the
mask required to convert the result of a rotate insn into a shift
@@ -2077,12 +2197,38 @@ addrs_ok_for_quad_peep (addr1, addr2)
enum reg_class
secondary_reload_class (class, mode, in)
enum reg_class class;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
rtx in;
{
- int regno = true_regnum (in);
-
- if (regno >= FIRST_PSEUDO_REGISTER)
+ int regno;
+
+ /* We can not copy a symbolic operand directly into anything other than
+ BASE_REGS for TARGET_ELF. So indicate that a register from BASE_REGS
+ is needed as an intermediate register. */
+ if (TARGET_ELF
+ && class != BASE_REGS
+ && (GET_CODE (in) == SYMBOL_REF
+ || GET_CODE (in) == LABEL_REF
+ || GET_CODE (in) == CONST))
+ return BASE_REGS;
+
+ if (GET_CODE (in) == REG)
+ {
+ regno = REGNO (in);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ {
+ regno = true_regnum (in);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ regno = -1;
+ }
+ }
+ else if (GET_CODE (in) == SUBREG)
+ {
+ regno = true_regnum (in);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ regno = -1;
+ }
+ else
regno = -1;
/* We can place anything into GENERAL_REGS and can put GENERAL_REGS
@@ -2173,7 +2319,7 @@ rs6000_got_register (value)
fatal_insn ("internal error -- needed new GOT register during reload phase to load:", value);
current_function_uses_pic_offset_table = 1;
- pic_offset_table_rtx = gen_rtx (REG, Pmode, GOT_TOC_REGNUM);
+ pic_offset_table_rtx = gen_rtx_REG (Pmode, GOT_TOC_REGNUM);
}
return pic_offset_table_rtx;
@@ -2294,7 +2440,7 @@ rs6000_finalize_pic ()
rtx init = gen_init_v4_pic (reg);
emit_insn_before (init, first_insn);
if (!optimize && last_insn)
- emit_insn_after (gen_rtx (USE, VOIDmode, reg), last_insn);
+ emit_insn_after (gen_rtx_USE (VOIDmode, reg), last_insn);
}
}
}
@@ -2309,7 +2455,7 @@ rs6000_reorg (insn)
{
if (flag_pic && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS))
{
- rtx got_reg = gen_rtx (REG, Pmode, GOT_TOC_REGNUM);
+ rtx got_reg = gen_rtx_REG (Pmode, GOT_TOC_REGNUM);
for ( ; insn != NULL_RTX; insn = NEXT_INSN (insn))
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& reg_mentioned_p (got_reg, PATTERN (insn)))
@@ -2395,7 +2541,7 @@ print_operand (file, x, code)
char code;
{
int i;
- int val;
+ HOST_WIDE_INT val;
/* These macros test for integers and extract the low-order bits. */
#define INT_P(X) \
@@ -2443,6 +2589,12 @@ print_operand (file, x, code)
fprintf (file, "%d", INT_LOWPART (x) & 0xffff);
return;
+ case 'B':
+ /* If the low-order bit is zero, write 'r'; otherwise, write 'l'
+ for 64-bit mask direction. */
+ putc (((INT_LOWPART(x) & 1) == 0 ? 'r' : 'l'), file);
+ return;
+
case 'C':
/* This is an optional cror needed for LE or GE floating-point
comparisons. Otherwise write nothing. */
@@ -2577,12 +2729,13 @@ print_operand (file, x, code)
else if (GET_CODE (x) == MEM)
{
/* Handle possible auto-increment. Since it is pre-increment and
- we have already done it, we can just use an offset of four. */
+ we have already done it, we can just use an offset of word. */
if (GET_CODE (XEXP (x, 0)) == PRE_INC
|| GET_CODE (XEXP (x, 0)) == PRE_DEC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0), 4));
+ output_address (plus_constant (XEXP (XEXP (x, 0), 0),
+ UNITS_PER_WORD));
else
- output_address (plus_constant (XEXP (x, 0), 4));
+ output_address (plus_constant (XEXP (x, 0), UNITS_PER_WORD));
if (small_data_operand (x, GET_MODE (x)))
fprintf (file, "@%s(%s)", SMALL_DATA_RELOC,
reg_names[SMALL_DATA_REG]);
@@ -2619,7 +2772,7 @@ print_operand (file, x, code)
if (((val >>= 1) & 1) == 0)
break;
- /* If we ended in ...01, I would be 0. The correct value is 31, so
+ /* If we ended in ...01, i would be 0. The correct value is 31, so
we want 31 - i. */
fprintf (file, "%d", 31 - i);
return;
@@ -2627,7 +2780,7 @@ print_operand (file, x, code)
case 'M':
/* ME value for a mask operand. */
if (! mask_operand (x, VOIDmode))
- output_operand_lossage ("invalid %%m value");
+ output_operand_lossage ("invalid %%M value");
val = INT_LOWPART (x);
@@ -2645,7 +2798,7 @@ print_operand (file, x, code)
if ((val >>= 1) & 1)
break;
- /* If we had ....10, I would be 0. The result should be
+ /* If we had ....10, i would be 0. The result should be
30, so we need 30 - i. */
fprintf (file, "%d", 30 - i);
return;
@@ -2671,7 +2824,7 @@ print_operand (file, x, code)
case 'O':
/* Similar, but subtract 1 first. */
if (GET_CODE (x) != PARALLEL)
- output_operand_lossage ("invalid %%N value");
+ output_operand_lossage ("invalid %%O value");
fprintf (file, "%d", (XVECLEN (x, 0) - 1) * 4);
return;
@@ -2711,6 +2864,68 @@ print_operand (file, x, code)
fprintf (file, "%d", (32 - INT_LOWPART (x)) & 31);
return;
+ case 'S':
+ /* PowerPC64 mask position. All 0's and all 1's are excluded.
+ CONST_INT 32-bit mask is considered sign-extended so any
+ transition must occur within the CONST_INT, not on the boundary. */
+ if (! mask64_operand (x, VOIDmode))
+ output_operand_lossage ("invalid %%S value");
+
+ val = INT_LOWPART (x);
+
+ if (val & 1) /* Clear Left */
+ {
+ for (i = 0; i < HOST_BITS_PER_WIDE_INT; i++)
+ if (!((val >>= 1) & 1))
+ break;
+
+#if HOST_BITS_PER_WIDE_INT == 32
+ if (GET_CODE (x) == CONST_DOUBLE && i == 32)
+ {
+ val = CONST_DOUBLE_HIGH (x);
+
+ if (val == 0)
+ --i;
+ else
+ for (i = 32; i < 64; i++)
+ if (!((val >>= 1) & 1))
+ break;
+ }
+#endif
+ /* i = index of last set bit from right
+ mask begins at 63 - i from left */
+ if (i > 63)
+ output_operand_lossage ("%%S computed all 1's mask");
+ fprintf (file, "%d", 63 - i);
+ return;
+ }
+ else /* Clear Right */
+ {
+ for (i = 0; i < HOST_BITS_PER_WIDE_INT; i++)
+ if ((val >>= 1) & 1)
+ break;
+
+#if HOST_BITS_PER_WIDE_INT == 32
+ if (GET_CODE (x) == CONST_DOUBLE && i == 32)
+ {
+ val = CONST_DOUBLE_HIGH (x);
+
+ if (val == (HOST_WIDE_INT) -1)
+ --i;
+ else
+ for (i = 32; i < 64; i++)
+ if ((val >>= 1) & 1)
+ break;
+ }
+#endif
+ /* i = index of last clear bit from right
+ mask ends at 62 - i from left */
+ if (i > 62)
+ output_operand_lossage ("%%S computed all 0's mask");
+ fprintf (file, "%d", 62 - i);
+ return;
+ }
+
case 't':
/* Write 12 if this jump operation will branch if true, 4 otherwise.
All floating-point operations except NE branch true and integer
@@ -2732,7 +2947,7 @@ print_operand (file, x, code)
/* Opposite of 't': write 4 if this jump operation will branch if true,
12 otherwise. */
if (GET_RTX_CLASS (GET_CODE (x)) != '<')
- output_operand_lossage ("invalid %%t value");
+ output_operand_lossage ("invalid %%T value");
else if ((GET_MODE (XEXP (x, 0)) == CCFPmode
&& GET_CODE (x) != NE)
@@ -2776,6 +2991,45 @@ print_operand (file, x, code)
putc ('u', file);
return;
+ case 'V':
+ /* Print the trap code for this operand. */
+ switch (GET_CODE (x))
+ {
+ case EQ:
+ fputs ("eq", file); /* 4 */
+ break;
+ case NE:
+ fputs ("ne", file); /* 24 */
+ break;
+ case LT:
+ fputs ("lt", file); /* 16 */
+ break;
+ case LE:
+ fputs ("le", file); /* 20 */
+ break;
+ case GT:
+ fputs ("gt", file); /* 8 */
+ break;
+ case GE:
+ fputs ("ge", file); /* 12 */
+ break;
+ case LTU:
+ fputs ("llt", file); /* 2 */
+ break;
+ case LEU:
+ fputs ("lle", file); /* 6 */
+ break;
+ case GTU:
+ fputs ("lgt", file); /* 1 */
+ break;
+ case GEU:
+ fputs ("lge", file); /* 5 */
+ break;
+ default:
+ abort ();
+ }
+ break;
+
case 'w':
/* If constant, low-order 16 bits of constant, signed. Otherwise, write
normally. */
@@ -3006,23 +3260,23 @@ rs6000_makes_calls ()
sequence and the V.4 calling sequence.
AIX stack frames look like:
-
+ 32-bit 64-bit
SP----> +---------------------------------------+
- | back chain to caller | 0
+ | back chain to caller | 0 0
+---------------------------------------+
- | saved CR | 4
+ | saved CR | 4 8 (8-11)
+---------------------------------------+
- | saved LR | 8
+ | saved LR | 8 16
+---------------------------------------+
- | reserved for compilers | 12
+ | reserved for compilers | 12 24
+---------------------------------------+
- | reserved for binders | 16
+ | reserved for binders | 16 32
+---------------------------------------+
- | saved TOC pointer | 20
+ | saved TOC pointer | 20 40
+---------------------------------------+
- | Parameter save area (P) | 24
+ | Parameter save area (P) | 24 48
+---------------------------------------+
- | Alloca space (A) | 24+P
+ | Alloca space (A) | 24+P etc.
+---------------------------------------+
| Local variable space (L) | 24+P+A
+---------------------------------------+
@@ -3035,6 +3289,10 @@ rs6000_makes_calls ()
old SP->| back chain to caller's caller |
+---------------------------------------+
+ The required alignment for AIX configurations is two words (i.e., 8
+ or 16 bytes).
+
+
V.4 stack frames look like:
SP----> +---------------------------------------+
@@ -3061,6 +3319,13 @@ rs6000_makes_calls ()
old SP->| back chain to caller's caller |
+---------------------------------------+
+ The required alignment for V.4 is 16 bytes, or 8 bytes if -meabi is
+ given. (But note below and in sysv4.h that we require only 8 and
+ may round up the size of our stack frame anyways. The historical
+ reason is early versions of powerpc-linux which didn't properly
+ align the stack at program startup. A happy side-effect is that
+ -mno-eabi libraries can be used with -meabi programs.)
+
A PowerPC Windows/NT frame looks like:
@@ -3104,7 +3369,17 @@ rs6000_makes_calls ()
order to support __builtin_return_address, the save area for the
link register needs to be in a known place, so we use -4 off of the
old SP. To support calls through pointers, we also allocate a
- fixed slot to store the TOC, -8 off the old SP. */
+ fixed slot to store the TOC, -8 off the old SP.
+
+ The required alignment for NT is 16 bytes.
+
+
+ The EABI configuration defaults to the V.4 layout, unless
+ -mcall-aix is used, in which case the AIX layout is used. However,
+ the stack alignment requirements may differ. If -mno-eabi is not
+ given, the required stack alignment is 8 bytes; if -mno-eabi is
+ given, the required alignment is 16 bytes. (But see V.4 comment
+ above.) */
#ifndef ABI_STACK_BOUNDARY
#define ABI_STACK_BOUNDARY STACK_BOUNDARY
@@ -3115,7 +3390,7 @@ rs6000_stack_info ()
{
static rs6000_stack_t info, zero_info;
rs6000_stack_t *info_ptr = &info;
- int reg_size = TARGET_64BIT ? 8 : 4;
+ int reg_size = TARGET_32BIT ? 4 : 8;
enum rs6000_abi abi;
int total_raw_size;
@@ -3205,6 +3480,13 @@ rs6000_stack_info ()
info_ptr->cr_size = reg_size;
}
+ /* Ensure that fp_save_offset will be aligned to an 8-byte boundary. */
+ if (info_ptr->fpmem_p)
+ {
+ info_ptr->gp_size = RS6000_ALIGN (info_ptr->gp_size, 8);
+ info_ptr->main_size = RS6000_ALIGN (info_ptr->main_size, 8);
+ }
+
/* Determine various sizes */
info_ptr->reg_size = reg_size;
info_ptr->fixed_size = RS6000_SAVE_AREA;
@@ -3250,7 +3532,7 @@ rs6000_stack_info ()
else
info_ptr->push_p = (frame_pointer_needed
|| write_symbols != NO_DEBUG
- || ((info_ptr->total_size - info_ptr->fixed_size)
+ || ((total_raw_size - info_ptr->fixed_size)
> (TARGET_32BIT ? 220 : 296)));
/* Calculate the offsets */
@@ -3265,8 +3547,8 @@ rs6000_stack_info ()
info_ptr->fp_save_offset = - info_ptr->fp_size;
info_ptr->gp_save_offset = info_ptr->fp_save_offset - info_ptr->gp_size;
info_ptr->main_save_offset = info_ptr->gp_save_offset - info_ptr->main_size;
- info_ptr->cr_save_offset = 4;
- info_ptr->lr_save_offset = 8;
+ info_ptr->cr_save_offset = reg_size; /* first word when 64-bit. */
+ info_ptr->lr_save_offset = 2*reg_size;
break;
case ABI_V4:
@@ -3280,13 +3562,13 @@ rs6000_stack_info ()
break;
case ABI_NT:
- info_ptr->lr_save_offset = -4;
+ info_ptr->lr_save_offset = -reg_size;
info_ptr->toc_save_offset = info_ptr->lr_save_offset - info_ptr->lr_size;
info_ptr->cr_save_offset = info_ptr->toc_save_offset - info_ptr->toc_size;
info_ptr->gp_save_offset = info_ptr->cr_save_offset - info_ptr->cr_size - info_ptr->gp_size + reg_size;
info_ptr->fp_save_offset = info_ptr->gp_save_offset - info_ptr->fp_size;
if (info_ptr->fp_size && ((- info_ptr->fp_save_offset) % 8) != 0)
- info_ptr->fp_save_offset -= 4;
+ info_ptr->fp_save_offset -= reg_size;
info_ptr->main_save_offset = info_ptr->fp_save_offset - info_ptr->main_size;
break;
@@ -3296,18 +3578,18 @@ rs6000_stack_info ()
{
info_ptr->fpmem_offset = info_ptr->main_save_offset - info_ptr->fpmem_size;
rs6000_fpmem_size = info_ptr->fpmem_size;
- rs6000_fpmem_offset = info_ptr->push_p
- ? info_ptr->total_size + info_ptr->fpmem_offset
- : info_ptr->fpmem_offset;
+ rs6000_fpmem_offset = (info_ptr->push_p
+ ? info_ptr->total_size + info_ptr->fpmem_offset
+ : info_ptr->fpmem_offset);
}
else
info_ptr->fpmem_offset = 0;
/* Zero offsets if we're not saving those registers */
- if (!info_ptr->fp_size)
+ if (info_ptr->fp_size == 0)
info_ptr->fp_save_offset = 0;
- if (!info_ptr->gp_size)
+ if (info_ptr->gp_size == 0)
info_ptr->gp_save_offset = 0;
if (!info_ptr->lr_save_p)
@@ -3484,7 +3766,7 @@ rs6000_output_load_toc_table (file, reg)
address before loading. */
if (rs6000_pic_func_labelno != rs6000_pic_labelno)
{
- char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long";
+ char *init_ptr = TARGET_32BIT ? ".long" : ".quad";
char *buf_ptr;
ASM_OUTPUT_INTERNAL_LABEL (file, "LCL", rs6000_pic_labelno);
@@ -3501,26 +3783,14 @@ rs6000_output_load_toc_table (file, reg)
fprintf (file, "\tmflr %s\n", reg_names[reg]);
if (rs6000_pic_func_labelno != rs6000_pic_labelno)
- {
- if (TARGET_POWERPC64)
- fprintf (file, "\taddi %s,%s,8\n", reg_names[reg], reg_names[reg]);
- else if (TARGET_NEW_MNEMONICS)
- fprintf (file, "\taddi %s,%s,4\n", reg_names[reg], reg_names[reg]);
- else
- fprintf (file, "\tcal %s,4(%s)\n", reg_names[reg], reg_names[reg]);
- }
-
- if (TARGET_POWERPC64)
- fprintf (file, "\tld");
- else if (TARGET_NEW_MNEMONICS)
- fprintf (file, "\tlwz");
- else
- fprintf (file, "\tl");
+ asm_fprintf(file, "\t{cal|la} %s,%d(%s)\n", reg_names[reg],
+ (TARGET_32BIT ? 4 : 8), reg_names[reg]);
- fprintf (file, " %s,(", reg_names[0]);
+ asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s,(" : "\tld %s,(",
+ reg_names[0]);
ASM_GENERATE_INTERNAL_LABEL (buf, "LCL", rs6000_pic_labelno);
assemble_name (file, buf);
- fprintf (file, "-");
+ fputs ("-", file);
ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);
assemble_name (file, buf);
fprintf (file, ")(%s)\n", reg_names[reg]);
@@ -3531,28 +3801,20 @@ rs6000_output_load_toc_table (file, reg)
else if (!TARGET_64BIT)
{
ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1);
- asm_fprintf (file, "\t{cau|addis} %s,%s,", reg_names[reg], reg_names[0]);
+ asm_fprintf (file, "\t{liu|lis} %s,", reg_names[reg]);
assemble_name (file, buf);
- asm_fprintf (file, "@ha\n");
- if (TARGET_NEW_MNEMONICS)
- {
- asm_fprintf (file, "\taddi %s,%s,", reg_names[reg], reg_names[reg]);
- assemble_name (file, buf);
- asm_fprintf (file, "@l\n");
- }
- else
- {
- asm_fprintf (file, "\tcal %s,", reg_names[reg]);
- assemble_name (file, buf);
- asm_fprintf (file, "@l(%s)\n", reg_names[reg]);
- }
+ fputs ("@ha\n", file);
+ asm_fprintf (file, "\t{cal|la} %s,", reg_names[reg]);
+ assemble_name (file, buf);
+ asm_fprintf (file, "@l(%s)\n", reg_names[reg]);
}
else
abort ();
#else /* !USING_SVR4_H */
ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 0);
- asm_fprintf (file, "\t{l|lwz} %s,", reg_names[reg]);
+ asm_fprintf (file, TARGET_32BIT ? "\t{l|lwz} %s," : "\tld %s,",
+ reg_names[reg]);
assemble_name (file, buf);
asm_fprintf (file, "(%s)\n", reg_names[2]);
#endif /* USING_SVR4_H */
@@ -3592,12 +3854,8 @@ rs6000_allocate_stack_space (file, size, copy_r12)
{
fprintf (file, "\tmr %s,%s\n", reg_names[12], reg_names[1]);
if (size < 32767)
- {
- if (TARGET_NEW_MNEMONICS)
- fprintf (file, "\taddi %s,%s,%d\n", reg_names[1], reg_names[1], neg_size);
- else
- fprintf (file, "\tcal %s,%d(%s)\n", reg_names[1], neg_size, reg_names[1]);
- }
+ asm_fprintf (file, "\t{cal|la} %s,%d(%s)\n",
+ reg_names[1], neg_size, reg_names[1]);
else
{
asm_fprintf (file, "\t{liu|lis} %s,%d\n\t{oril|ori} %s,%s,%d\n",
@@ -3618,7 +3876,7 @@ rs6000_allocate_stack_space (file, size, copy_r12)
void
output_prolog (file, size)
FILE *file;
- int size;
+ int size ATTRIBUTE_UNUSED;
{
rs6000_stack_t *info = rs6000_stack_info ();
int reg_size = info->reg_size;
@@ -3725,7 +3983,7 @@ output_prolog (file, size)
int loc = info->main_save_offset + sp_offset;
int size = info->main_size;
- for (regno = 3; size > 0; regno++, loc -= reg_size, size -= reg_size)
+ for (regno = 3; size > 0; regno++, loc += reg_size, size -= reg_size)
asm_fprintf (file, store_reg, reg_names[regno], loc, reg_names[sp_reg]);
}
#endif
@@ -3829,7 +4087,7 @@ output_prolog (file, size)
if (info->total_size < 32767)
{
loc = info->total_size + info->main_save_offset;
- for (regno = 3; size > 0; regno++, size -= reg_size, loc -= reg_size)
+ for (regno = 3; size > 0; regno++, size -= reg_size, loc += reg_size)
asm_fprintf (file, load_reg, reg_names[regno], loc, reg_names[1]);
}
else
@@ -3843,7 +4101,7 @@ output_prolog (file, size)
asm_fprintf (file, "\t{sf|subf} %s,%s,%s\n", reg_names[0], reg_names[0],
reg_names[1]);
- for (regno = 3; size > 0; regno++, size -= reg_size, loc -= reg_size)
+ for (regno = 3; size > 0; regno++, size -= reg_size, loc += reg_size)
asm_fprintf (file, load_reg, reg_names[regno], loc, reg_names[0]);
}
}
@@ -3874,7 +4132,7 @@ output_prolog (file, size)
void
output_epilog (file, size)
FILE *file;
- int size;
+ int size ATTRIBUTE_UNUSED;
{
rs6000_stack_t *info = rs6000_stack_info ();
char *load_reg = (TARGET_32BIT) ? "\t{l|lwz} %s,%d(%s)\n" : "\tld %s,%d(%s)\n";
@@ -3905,10 +4163,9 @@ output_epilog (file, size)
{
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
sp_offset = info->total_size;
- else if (TARGET_NEW_MNEMONICS)
- asm_fprintf (file, "\taddi %s,%s,%d\n", reg_names[1], reg_names[1], info->total_size);
else
- asm_fprintf (file, "\tcal %s,%d(%s)\n", reg_names[1], info->total_size, reg_names[1]);
+ asm_fprintf (file, "\t{cal|la} %s,%d(%s)\n",
+ reg_names[1], info->total_size, reg_names[1]);
}
/* Get the old lr if we saved it. */
@@ -3958,14 +4215,11 @@ output_epilog (file, size)
+ (regs_ever_live[71] != 0) * 0x10
+ (regs_ever_live[72] != 0) * 0x8, reg_names[12]);
- /* If this is V.4, unwind the stack pointer after all of the loads have been done */
- if (sp_offset)
- {
- if (TARGET_NEW_MNEMONICS)
- asm_fprintf (file, "\taddi %s,%s,%d\n", reg_names[1], reg_names[1], sp_offset);
- else
- asm_fprintf (file, "\tcal %s,%d(%s)\n", reg_names[1], sp_offset, reg_names[1]);
- }
+ /* If this is V.4, unwind the stack pointer after all of the loads
+ have been done */
+ if (sp_offset != 0)
+ asm_fprintf (file, "\t{cal|la} %s,%d(%s)\n",
+ reg_names[1], sp_offset, reg_names[1]);
else if (sp_reg != 1)
asm_fprintf (file, "\tmr %s,%s\n", reg_names[1], reg_names[sp_reg]);
@@ -4027,7 +4281,9 @@ output_epilog (file, size)
/* Language type. Unfortunately, there doesn't seem to be any
official way to get this info, so we use language_string. C
is 0. C++ is 9. No number defined for Obj-C, so use the
- value for C for now. */
+ value for C for now. There is no official value for Java,
+ although IBM appears to be using 13. There is no official value
+ for Chill, so we've choosen 44 pseudo-randomly. */
if (! strcmp (language_string, "GNU C")
|| ! strcmp (language_string, "GNU Obj-C"))
i = 0;
@@ -4039,6 +4295,10 @@ output_epilog (file, size)
i = 2;
else if (! strcmp (language_string, "GNU C++"))
i = 9;
+ else if (! strcmp (language_string, "GNU Java"))
+ i = 13;
+ else if (! strcmp (language_string, "GNU CHILL"))
+ i = 44;
else
abort ();
fprintf (file, "%d,", i);
@@ -4162,7 +4422,7 @@ output_epilog (file, size)
/* Omit this list of longs, because there are no CTL anchors. */
/* Length of function name. */
- fprintf (file, "\t.short %d\n", strlen (fname));
+ fprintf (file, "\t.short %d\n", (int) strlen (fname));
/* Function name. */
assemble_string (fname, strlen (fname));
@@ -4182,6 +4442,238 @@ output_epilog (file, size)
}
}
+/* A C compound statement that outputs the assembler code for a thunk function,
+ used to implement C++ virtual function calls with multiple inheritance. The
+ thunk acts as a wrapper around a virtual function, adjusting the implicit
+ object parameter before handing control off to the real function.
+
+ First, emit code to add the integer DELTA to the location that contains the
+ incoming first argument. Assume that this argument contains a pointer, and
+ is the one used to pass the `this' pointer in C++. This is the incoming
+ argument *before* the function prologue, e.g. `%o0' on a sparc. The
+ addition must preserve the values of all other incoming arguments.
+
+ After the addition, emit code to jump to FUNCTION, which is a
+ `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
+ the return address. Hence returning from FUNCTION will return to whoever
+ called the current `thunk'.
+
+ The effect must be as if FUNCTION had been called directly with the adjusted
+ first argument. This macro is responsible for emitting all of the code for
+ a thunk function; `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' are not
+ invoked.
+
+ The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
+ extracted from it.) It might possibly be useful on some targets, but
+ probably not.
+
+ If you do not define this macro, the target-independent code in the C++
+ frontend will generate a less efficient heavyweight thunk that calls
+ FUNCTION instead of jumping to it. The generic approach does not support
+ varargs. */
+
+void
+output_mi_thunk (file, thunk_fndecl, delta, function)
+ FILE *file;
+ tree thunk_fndecl;
+ int delta;
+ tree function;
+{
+ char *this_reg = reg_names[ aggregate_value_p (TREE_TYPE (function)) ? 3 : 4 ];
+ char *r0 = reg_names[0];
+ char *sp = reg_names[1];
+ char *toc = reg_names[2];
+ char *schain = reg_names[11];
+ char *r12 = reg_names[12];
+ char *prefix;
+ char *fname;
+ char buf[512];
+ static int labelno = 0;
+
+ /* Small constants that can be done by one add instruction */
+ if (delta >= -32768 && delta <= 32767)
+ {
+ if (!TARGET_NEW_MNEMONICS)
+ fprintf (file, "\tcal %s,%d(%s)\n", this_reg, delta, this_reg);
+ else
+ fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta);
+ }
+
+ /* Large constants that can be done by one addis instruction */
+ else if ((delta & 0xffff) == 0 && num_insns_constant_wide (delta) == 1)
+ asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
+ delta >> 16);
+
+ /* 32-bit constants that can be done by an add and addis instruction. */
+ else if (TARGET_32BIT || num_insns_constant_wide (delta) == 1)
+ {
+ /* Break into two pieces, propigating the sign bit from the low word to
+ the upper word. */
+ int delta_high = delta >> 16;
+ int delta_low = delta & 0xffff;
+ if ((delta_low & 0x8000) != 0)
+ {
+ delta_high++;
+ delta_low = (delta_low ^ 0x8000) - 0x8000; /* sign extend */
+ }
+
+ asm_fprintf (file, "\t{cau|addis} %s,%s,%d\n", this_reg, this_reg,
+ delta_high);
+
+ if (!TARGET_NEW_MNEMONICS)
+ fprintf (file, "\tcal %s,%d(%s)\n", this_reg, delta_low, this_reg);
+ else
+ fprintf (file, "\taddi %s,%s,%d\n", this_reg, this_reg, delta_low);
+ }
+
+ /* 64-bit constants, fixme */
+ else
+ abort ();
+
+ /* Get the prefix in front of the names. */
+ switch (DEFAULT_ABI)
+ {
+ default:
+ abort ();
+
+ case ABI_AIX:
+ prefix = ".";
+ break;
+
+ case ABI_V4:
+ case ABI_AIX_NODESC:
+ case ABI_SOLARIS:
+ prefix = "";
+ break;
+
+ case ABI_NT:
+ prefix = "..";
+ break;
+ }
+
+ /* If the function is compiled in this module, jump to it directly.
+ Otherwise, load up its address and jump to it. */
+
+ fname = XSTR (XEXP (DECL_RTL (function), 0), 0);
+#if 1
+ /* For now, just emit a branch always, until we can figure out better when we
+ need to load the address into the count register and emit the slower bctr
+ instruction. */
+ fprintf (file, "\tb %s", prefix);
+ assemble_name (file, fname);
+ fprintf (file, "\n");
+
+#else
+ if (TREE_ASM_WRITTEN (function)
+ && !lookup_attribute ("longcall", TYPE_ATTRIBUTES (TREE_TYPE (function))))
+ {
+ fprintf (file, "\tb %s", prefix);
+ assemble_name (file, fname);
+ fprintf (file, "\n");
+ }
+
+ else
+ {
+ switch (DEFAULT_ABI)
+ {
+ default:
+ case ABI_NT:
+ abort ();
+
+ case ABI_AIX:
+ /* Set up a TOC entry for the function. */
+ ASM_GENERATE_INTERNAL_LABEL (buf, "Lthunk", labelno);
+ toc_section ();
+ ASM_OUTPUT_INTERNAL_LABEL (file, "Lthunk", labelno);
+ labelno++;
+
+ /* Note, MINIMAL_TOC doesn't make sense in the case of a thunk, since
+ there will be only one TOC entry for this function. */
+ fputs ("\t.tc\t", file);
+ assemble_name (file, buf);
+ fputs ("[TC],", file);
+ assemble_name (file, buf);
+ putc ('\n', file);
+ text_section ();
+ asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s," : "\tld %s", r12);
+ assemble_name (file, buf);
+ asm_fprintf (file, "(%s)\n", reg_names[2]);
+ asm_fprintf (file,
+ (TARGET_32BIT) ? "\t{l|lwz} %s,0(%s)\n" : "\tld %s,0(%s)\n",
+ r0, r12);
+
+ asm_fprintf (file,
+ (TARGET_32BIT) ? "\t{l|lwz} %s,4(%s)\n" : "\tld %s,8(%s)\n",
+ toc, r12);
+
+ asm_fprintf (file, "\tmtctr %s\n", r0);
+ asm_fprintf (file,
+ (TARGET_32BIT) ? "\t{l|lwz} %s,8(%s)\n" : "\tld %s,16(%s)\n",
+ schain, r12);
+
+ asm_fprintf (file, "\tbctr\n");
+ break;
+
+ /* Don't use r11, that contains the static chain, just use r0/r12. */
+ case ABI_V4:
+ case ABI_AIX_NODESC:
+ case ABI_SOLARIS:
+ if (flag_pic == 1)
+ {
+ fprintf (file, "\tmflr %s\n", r0);
+ fputs ("\tbl _GLOBAL_OFFSET_TABLE_@local-4\n", file);
+ asm_fprintf (file, "\tmflr %s\n", r12);
+ asm_fprintf (file, "\tmtlr %s\n", r0);
+ asm_fprintf (file, "\t{l|lwz} %s,", r0);
+ assemble_name (file, fname);
+ asm_fprintf (file, "@got(%s)\n", r12);
+ asm_fprintf (file, "\tmtctr %s\n", r0);
+ asm_fprintf (file, "\tbctr\n");
+ }
+#if TARGET_ELF
+ else if (flag_pic > 1 || TARGET_RELOCATABLE)
+ {
+ ASM_GENERATE_INTERNAL_LABEL (buf, "Lthunk", labelno);
+ labelno++;
+ fprintf (file, "\tmflr %s\n", r0);
+ asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", r0, sp);
+ rs6000_pic_func_labelno = rs6000_pic_labelno;
+ rs6000_output_load_toc_table (file, 12);
+ asm_fprintf (file, "\t{l|lwz} %s,", r0);
+ assemble_name (file, buf);
+ asm_fprintf (file, "(%s)\n", r12);
+ asm_fprintf (file, "\t{l|lwz} %s,4(%s)\n", r12, sp);
+ asm_fprintf (file, "\tmtlr %s\n", r12);
+ asm_fprintf (file, "\tmtctr %s\n", r0);
+ asm_fprintf (file, "\tbctr\n");
+ asm_fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
+ assemble_name (file, buf);
+ fputs (" = .-.LCTOC1\n", file);
+ fputs ("\t.long ", file);
+ assemble_name (file, fname);
+ fputs ("\n\t.previous\n", file);
+ }
+#endif /* TARGET_ELF */
+
+ else
+ {
+ asm_fprintf (file, "\t{liu|lis} %s,", r12);
+ assemble_name (file, fname);
+ asm_fprintf (file, "@ha\n");
+ asm_fprintf (file, "\t{cal|la} %s,", r12);
+ assemble_name (file, fname);
+ asm_fprintf (file, "@l(%s)\n", r12);
+ asm_fprintf (file, "\tmtctr %s\n", r12);
+ asm_fprintf (file, "\tbctr\n");
+ }
+
+ break;
+ }
+ }
+#endif /* #if 0 out code to use bctr for far away jumps */
+}
+
+
/* Output a TOC entry. We derive the entry name from what is
being written. */
@@ -4231,12 +4723,24 @@ output_toc (file, x, labelno)
REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
REAL_VALUE_TO_TARGET_DOUBLE (rv, k);
- if (TARGET_MINIMAL_TOC)
- fprintf (file, "\t.long %ld\n\t.long %ld\n", k[0], k[1]);
+ if (TARGET_64BIT)
+ {
+ if (TARGET_MINIMAL_TOC)
+ fprintf (file, "\t.llong 0x%lx%08lx\n", k[0], k[1]);
+ else
+ fprintf (file, "\t.tc FD_%lx_%lx[TC],0x%lx%08lx\n",
+ k[0], k[1], k[0] & 0xffffffff, k[1] & 0xffffffff);
+ return;
+ }
else
- fprintf (file, "\t.tc FD_%lx_%lx[TC],%ld,%ld\n",
- k[0], k[1], k[0], k[1]);
- return;
+ {
+ if (TARGET_MINIMAL_TOC)
+ fprintf (file, "\t.long %ld\n\t.long %ld\n", k[0], k[1]);
+ else
+ fprintf (file, "\t.tc FD_%lx_%lx[TC],%ld,%ld\n",
+ k[0], k[1], k[0], k[1]);
+ return;
+ }
}
else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == SFmode
&& ! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC))
@@ -4248,7 +4752,7 @@ output_toc (file, x, labelno)
REAL_VALUE_TO_TARGET_SINGLE (rv, l);
if (TARGET_MINIMAL_TOC)
- fprintf (file, "\t.long %ld\n", l);
+ fprintf (file, TARGET_32BIT ? "\t.long %ld\n" : "\t.llong %ld\n", l);
else
fprintf (file, "\t.tc FS_%lx[TC],%ld\n", l, l);
return;
@@ -4278,12 +4782,25 @@ output_toc (file, x, labelno)
}
#endif
- if (TARGET_MINIMAL_TOC)
- fprintf (file, "\t.long %ld\n\t.long %ld\n", (long)high, (long)low);
+ if (TARGET_64BIT)
+ {
+ if (TARGET_MINIMAL_TOC)
+ fprintf (file, "\t.llong 0x%lx%08lx\n", (long)high, (long)low);
+ else
+ fprintf (file, "\t.tc ID_%lx_%lx[TC],0x%lx%08lx\n",
+ (long)high, (long)low, (long)high, (long)low);
+ return;
+ }
else
- fprintf (file, "\t.tc ID_%lx_%lx[TC],%ld,%ld\n",
- (long)high, (long)low, (long)high, (long)low);
- return;
+ {
+ if (TARGET_MINIMAL_TOC)
+ fprintf (file, "\t.long %ld\n\t.long %ld\n",
+ (long)high, (long)low);
+ else
+ fprintf (file, "\t.tc ID_%lx_%lx[TC],%ld,%ld\n",
+ (long)high, (long)low, (long)high, (long)low);
+ return;
+ }
}
if (GET_CODE (x) == CONST)
@@ -4303,7 +4820,7 @@ output_toc (file, x, labelno)
STRIP_NAME_ENCODING (real_name, name);
if (TARGET_MINIMAL_TOC)
- fputs ("\t.long ", file);
+ fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", file);
else
{
fprintf (file, "\t.tc %s", real_name);
@@ -4484,55 +5001,41 @@ output_function_profiler (file, labelno)
fprintf (file, "\tmflr %s\n", reg_names[0]);
if (flag_pic == 1)
{
- fprintf (file, "\tbl _GLOBAL_OFFSET_TABLE_@local-4\n");
- fprintf (file, "\t%s %s,4(%s)\n",
- (TARGET_NEW_MNEMONICS) ? "stw" : "st",
- reg_names[0], reg_names[1]);
- fprintf (file, "\tmflr %s\n", reg_names[11]);
- fprintf (file, "\t%s %s,", (TARGET_NEW_MNEMONICS) ? "lwz" : "l",
- reg_names[0]);
+ fputs ("\tbl _GLOBAL_OFFSET_TABLE_@local-4\n", file);
+ asm_fprintf (file, "\t{st|stw} %s,4(%s)\n",
+ reg_names[0], reg_names[1]);
+ asm_fprintf (file, "\tmflr %s\n", reg_names[12]);
+ asm_fprintf (file, "\t{l|lwz} %s,", reg_names[0]);
assemble_name (file, buf);
- fprintf (file, "@got(%s)\n", reg_names[11]);
+ asm_fprintf (file, "@got(%s)\n", reg_names[12]);
}
#if TARGET_ELF
else if (flag_pic > 1 || TARGET_RELOCATABLE)
{
- fprintf (file, "\t%s %s,4(%s)\n",
- (TARGET_NEW_MNEMONICS) ? "stw" : "st",
- reg_names[0], reg_names[1]);
+ asm_fprintf (file, "\t{st|stw} %s,4(%s)\n",
+ reg_names[0], reg_names[1]);
rs6000_pic_func_labelno = rs6000_pic_labelno;
- rs6000_output_load_toc_table (file, 11);
- fprintf (file, "\t%s %s,", (TARGET_NEW_MNEMONICS) ? "lwz" : "l",
- reg_names[11]);
+ rs6000_output_load_toc_table (file, 12);
+ asm_fprintf (file, "\t{l|lwz} %s,", reg_names[12]);
assemble_name (file, buf);
- fprintf (file, "X(%s)\n", reg_names[11]);
- fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
+ asm_fprintf (file, "X(%s)\n", reg_names[12]);
+ asm_fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
assemble_name (file, buf);
- fprintf (file, "X = .-.LCTOC1\n");
- fprintf (file, "\t.long ");
+ fputs ("X = .-.LCTOC1\n", file);
+ fputs ("\t.long ", file);
assemble_name (file, buf);
fputs ("\n\t.previous\n", file);
}
#endif
- else if (TARGET_NEW_MNEMONICS)
- {
- fprintf (file, "\taddis %s,%s,", reg_names[11], reg_names[11]);
- assemble_name (file, buf);
- fprintf (file, "@ha\n");
- fprintf (file, "\tstw %s,4(%s)\n", reg_names[0], reg_names[1]);
- fprintf (file, "\taddi %s,%s,", reg_names[0], reg_names[11]);
- assemble_name (file, buf);
- fputs ("@l\n", file);
- }
else
{
- fprintf (file, "\tcau %s,%s,", reg_names[11], reg_names[11]);
+ asm_fprintf (file, "\t{liu|lis} %s,", reg_names[12]);
assemble_name (file, buf);
- fprintf (file, "@ha\n");
- fprintf (file, "\tst %s,4(%s)\n", reg_names[0], reg_names[1]);
- fprintf (file, "\tcal %s,", reg_names[11]);
+ fputs ("@ha\n", file);
+ asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", reg_names[0], reg_names[1]);
+ asm_fprintf (file, "\t{cal|la} %s,", reg_names[0]);
assemble_name (file, buf);
- fprintf (file, "@l(%s)\n", reg_names[11]);
+ asm_fprintf (file, "@l(%s)\n", reg_names[12]);
}
fprintf (file, "\tbl %s\n", RS6000_MCOUNT);
@@ -4544,7 +5047,7 @@ output_function_profiler (file, labelno)
ASM_OUTPUT_INTERNAL_LABEL (file, "LPC", labelno);
if (TARGET_MINIMAL_TOC)
{
- fputs ("\t.long ", file);
+ fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", file);
assemble_name (file, buf);
putc ('\n', file);
}
@@ -4576,9 +5079,11 @@ output_function_profiler (file, labelno)
/* Load location address into r3, and call mcount. */
ASM_GENERATE_INTERNAL_LABEL (buf, "LPC", labelno);
- asm_fprintf (file, "\t{l|lwz} %s,", reg_names[3]);
+ asm_fprintf (file, TARGET_32BIT ? "\t{l|lwz} %s," : "\tld %s,",
+ reg_names[3]);
assemble_name (file, buf);
- asm_fprintf (file, "(%s)\n\tbl %s\n", reg_names[2], RS6000_MCOUNT);
+ asm_fprintf (file, "(%s)\n\tbl %s\n\t%s\n",
+ reg_names[2], RS6000_MCOUNT, RS6000_CALL_GLUE);
/* Restore parameter registers. */
@@ -4595,7 +5100,7 @@ int
rs6000_adjust_cost (insn, link, dep_insn, cost)
rtx insn;
rtx link;
- rtx dep_insn;
+ rtx dep_insn ATTRIBUTE_UNUSED;
int cost;
{
if (! recog_memoized (insn))
@@ -4757,8 +5262,8 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
abort ();
/* Macros to shorten the code expansions below. */
-#define MEM_DEREF(addr) gen_rtx (MEM, pmode, memory_address (pmode, addr))
-#define MEM_PLUS(addr,offset) gen_rtx (MEM, pmode, memory_address (pmode, plus_constant (addr, offset)))
+#define MEM_DEREF(addr) gen_rtx_MEM (pmode, memory_address (pmode, addr))
+#define MEM_PLUS(addr,offset) gen_rtx_MEM (pmode, memory_address (pmode, plus_constant (addr, offset)))
/* Under AIX, just build the 3 word function descriptor */
case ABI_AIX:
@@ -4777,7 +5282,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
case ABI_V4:
case ABI_SOLARIS:
case ABI_AIX_NODESC:
- emit_library_call (gen_rtx (SYMBOL_REF, SImode, "__trampoline_setup"),
+ emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"),
FALSE, VOIDmode, 4,
addr, pmode,
GEN_INT (rs6000_trampoline_size ()), SImode,
@@ -4794,7 +5299,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
rtx fn_reg = gen_reg_rtx (pmode);
rtx toc_reg = gen_reg_rtx (pmode);
- emit_move_insn (tramp_reg, gen_rtx (SYMBOL_REF, pmode, "..LTRAMP1..0"));
+ emit_move_insn (tramp_reg, gen_rtx_SYMBOL_REF (pmode, "..LTRAMP1..0"));
addr = force_reg (pmode, addr);
emit_move_insn (fn_reg, MEM_DEREF (fnaddr));
emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize));
@@ -4802,7 +5307,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
emit_move_insn (MEM_PLUS (addr, regsize), addr);
emit_move_insn (MEM_PLUS (addr, 2*regsize), fn_reg);
emit_move_insn (MEM_PLUS (addr, 3*regsize), ctx_reg);
- emit_move_insn (MEM_PLUS (addr, 4*regsize), gen_rtx (REG, pmode, 2));
+ emit_move_insn (MEM_PLUS (addr, 4*regsize), gen_rtx_REG (pmode, 2));
}
break;
}
@@ -4817,10 +5322,10 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
int
rs6000_valid_decl_attribute_p (decl, attributes, identifier, args)
- tree decl;
- tree attributes;
- tree identifier;
- tree args;
+ tree decl ATTRIBUTE_UNUSED;
+ tree attributes ATTRIBUTE_UNUSED;
+ tree identifier ATTRIBUTE_UNUSED;
+ tree args ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -4832,7 +5337,7 @@ rs6000_valid_decl_attribute_p (decl, attributes, identifier, args)
int
rs6000_valid_type_attribute_p (type, attributes, identifier, args)
tree type;
- tree attributes;
+ tree attributes ATTRIBUTE_UNUSED;
tree identifier;
tree args;
{
@@ -4901,8 +5406,8 @@ rs6000_valid_type_attribute_p (type, attributes, identifier, args)
int
rs6000_comp_type_attributes (type1, type2)
- tree type1;
- tree type2;
+ tree type1 ATTRIBUTE_UNUSED;
+ tree type2 ATTRIBUTE_UNUSED;
{
return 1;
}
@@ -4912,7 +5417,7 @@ rs6000_comp_type_attributes (type1, type2)
void
rs6000_set_default_type_attributes (type)
- tree type;
+ tree type ATTRIBUTE_UNUSED;
{
}
@@ -4939,8 +5444,8 @@ rs6000_dll_import_ref (call_ref)
strcat (p, call_name);
node = get_identifier (p);
- reg1 = force_reg (Pmode, gen_rtx (SYMBOL_REF, VOIDmode, IDENTIFIER_POINTER (node)));
- emit_move_insn (reg2, gen_rtx (MEM, Pmode, reg1));
+ reg1 = force_reg (Pmode, gen_rtx_SYMBOL_REF (VOIDmode, IDENTIFIER_POINTER (node)));
+ emit_move_insn (reg2, gen_rtx_MEM (Pmode, reg1));
return reg2;
}
@@ -4964,7 +5469,7 @@ rs6000_longcall_ref (call_ref)
call_name++;
node = get_identifier (call_name);
- call_ref = gen_rtx (SYMBOL_REF, VOIDmode, IDENTIFIER_POINTER (node));
+ call_ref = gen_rtx_SYMBOL_REF (VOIDmode, IDENTIFIER_POINTER (node));
}
return force_reg (Pmode, call_ref);
@@ -5051,7 +5556,7 @@ rs6000_select_section (decl, reloc)
call. For real AIX and NT calling sequences, we also replace the
function name with the real name (1 or 2 leading .'s), rather than
the function descriptor name. This saves a lot of overriding code
- to readd the prefixes. */
+ to read the prefixes. */
void
rs6000_encode_section_info (decl)
@@ -5112,3 +5617,10 @@ rs6000_encode_section_info (decl)
}
#endif /* USING_SVR4_H */
+
+void
+rs6000_fatal_bad_address (op)
+ rtx op;
+{
+ fatal_insn ("bad address", op);
+}
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 7ac3cf60c9c..bbdcebb73b7 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
- Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93-7, 1998 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
/* Names to predefine in the preprocessor for this target machine. */
-#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 \
+#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_LONG_LONG \
-Asystem(unix) -Asystem(aix) -Acpu(rs6000) -Amachine(rs6000)"
/* Print subsidiary information on the compiler version in use. */
@@ -70,15 +70,19 @@ Boston, MA 02111-1307, USA. */
%{mcpu=rios2: -D_ARCH_PWR2} \
%{mcpu=rsc: -D_ARCH_PWR} \
%{mcpu=rsc1: -D_ARCH_PWR} \
+%{mcpu=401: -D_ARCH_PPC} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=505: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=602: -D_ARCH_PPC} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=603e: -D_ARCH_PPC} \
+%{mcpu=ec603e: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC} \
+%{mcpu=604e: -D_ARCH_PPC} \
%{mcpu=620: -D_ARCH_PPC} \
%{mcpu=821: -D_ARCH_PPC} \
+%{mcpu=823: -D_ARCH_PPC} \
%{mcpu=860: -D_ARCH_PPC}"
#ifndef CPP_DEFAULT_SPEC
@@ -119,15 +123,19 @@ Boston, MA 02111-1307, USA. */
%{mcpu=rios2: -mpwrx} \
%{mcpu=rsc: -mpwr} \
%{mcpu=rsc1: -mpwr} \
+%{mcpu=401: -mppc} \
%{mcpu=403: -mppc} \
%{mcpu=505: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=602: -mppc} \
%{mcpu=603: -mppc} \
%{mcpu=603e: -mppc} \
+%{mcpu=ec603e: -mppc} \
%{mcpu=604: -mppc} \
+%{mcpu=604e: -mppc} \
%{mcpu=620: -mppc} \
%{mcpu=821: -mppc} \
+%{mcpu=823: -mppc} \
%{mcpu=860: -mppc}"
#ifndef ASM_DEFAULT_SPEC
@@ -351,6 +359,8 @@ extern int target_flags;
{"no-powerpc-gpopt", - MASK_PPC_GPOPT}, \
{"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT}, \
{"no-powerpc-gfxopt", - MASK_PPC_GFXOPT}, \
+ {"powerpc64", MASK_POWERPC64}, \
+ {"no-powerpc64", - MASK_POWERPC64}, \
{"new-mnemonics", MASK_NEW_MNEMONICS}, \
{"old-mnemonics", -MASK_NEW_MNEMONICS}, \
{"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \
@@ -379,7 +389,7 @@ extern int target_flags;
#define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING)
-/* Processor type. */
+/* Processor type. Order must match cpu attribute in MD file. */
enum processor_type
{PROCESSOR_RIOS1,
PROCESSOR_RIOS2,
@@ -388,6 +398,7 @@ enum processor_type
PROCESSOR_PPC601,
PROCESSOR_PPC603,
PROCESSOR_PPC604,
+ PROCESSOR_PPC604e,
PROCESSOR_PPC620};
extern enum processor_type rs6000_cpu;
@@ -463,10 +474,17 @@ extern int rs6000_debug_arg; /* debug argument handling */
defined, is executed once just after all the command options have
been parsed.
+ Don't use this macro to turn on various extra optimizations for
+ `-O'. That is what `OPTIMIZATION_OPTIONS' is for.
+
On the RS/6000 this is used to define the target cpu type. */
#define OVERRIDE_OPTIONS rs6000_override_options (TARGET_CPU_DEFAULT)
+/* Define this to change the optimizations performed by default. */
+#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
+
+
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
@@ -481,10 +499,19 @@ extern int rs6000_debug_arg; /* debug argument handling */
type, but kept valid in the wider mode. The signedness of the
extension may differ from that of the type. */
-#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
- if (GET_MODE_CLASS (MODE) == MODE_INT \
- && GET_MODE_SIZE (MODE) < 4) \
- (MODE) = SImode;
+#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
+ if (GET_MODE_CLASS (MODE) == MODE_INT \
+ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
+ (MODE) = (! TARGET_POWERPC64 ? SImode : DImode);
+
+/* Define this if function arguments should also be promoted using the above
+ procedure. */
+
+#define PROMOTE_FUNCTION_ARGS
+
+/* Likewise, if the function return value is promoted. */
+
+#define PROMOTE_FUNCTION_RETURN
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields. */
@@ -577,7 +604,7 @@ extern int rs6000_debug_arg; /* debug argument handling */
#define PARM_BOUNDARY (TARGET_32BIT ? 32 : 64)
/* Boundary (in *bits*) on which stack pointer should be aligned. */
-#define STACK_BOUNDARY 64
+#define STACK_BOUNDARY (TARGET_32BIT ? 64 : 128)
/* Allocation boundary (in *bits*) for the code of a function. */
#define FUNCTION_BOUNDARY 32
@@ -587,7 +614,10 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
- (DECL_MODE (FIELD) != DFmode ? (COMPUTED) : MIN ((COMPUTED), 32))
+ (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
+ ? get_inner_array_type (FIELD) \
+ : TREE_TYPE (FIELD)) == DFmode \
+ ? MIN ((COMPUTED), 32) : (COMPUTED))
/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 32
@@ -690,9 +720,10 @@ extern int rs6000_debug_arg; /* debug argument handling */
fp13 - fp2 (not saved; incoming fp arg registers)
fp1 (not saved; return value)
fp31 - fp14 (saved; order given to save least number)
- cr1, cr6, cr7 (not saved or special)
+ cr7, cr6 (not saved or special)
+ cr1 (not saved, but used for FP operations)
cr0 (not saved, but used for arithmetic operations)
- cr2, cr3, cr4 (saved)
+ cr4, cr3, cr2 (saved)
r0 (not saved; cannot be base reg)
r9 (not saved; best for TImode)
r11, r10, r8-r4 (not saved; highest used first to make less conflict)
@@ -702,7 +733,7 @@ extern int rs6000_debug_arg; /* debug argument handling */
mq (not saved; best to use it if we can)
ctr (not saved; when we have the choice ctr is better)
lr (saved)
- cr5, r1, r2, ap (fixed) */
+ cr5, r1, r2, ap, fpmem (fixed) */
#define REG_ALLOC_ORDER \
{32, \
@@ -710,7 +741,7 @@ extern int rs6000_debug_arg; /* debug argument handling */
33, \
63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \
50, 49, 48, 47, 46, \
- 69, 74, 75, 68, 70, 71, 72, \
+ 75, 74, 69, 68, 72, 71, 70, \
0, \
9, 11, 10, 8, 7, 6, 5, 4, \
3, \
@@ -737,8 +768,8 @@ extern int rs6000_debug_arg; /* debug argument handling */
This is ordinarily the length in words of a value of mode MODE
but can be less for certain modes in special long registers.
- On RS/6000, ordinary registers hold 32 bits worth;
- a single floating point register holds 64 bits worth. */
+ POWER and PowerPC GPRs hold 32 bits worth;
+ PowerPC64 GPRs and FPRs point register holds 64 bits worth. */
#define HARD_REGNO_NREGS(REGNO, MODE) \
(FP_REGNO_P (REGNO) || FPMEM_REGNO_P (REGNO) \
@@ -827,12 +858,15 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* Define this macro to change register usage conditional on target flags.
Set MQ register fixed (already call_used) if not POWER architecture
(RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated.
+ 64-bit AIX reserves GPR13 for thread-private data.
Conditionally disable FPRs. */
#define CONDITIONAL_REGISTER_USAGE \
{ \
if (! TARGET_POWER) \
fixed_regs[64] = 1; \
+ if (TARGET_64BIT) \
+ fixed_regs[13] = call_used_regs[13] = 1; \
if (TARGET_SOFT_FLOAT) \
for (i = 32; i < 64; i++) \
fixed_regs[i] = call_used_regs[i] = 1; \
@@ -1042,7 +1076,7 @@ enum reg_class
#define CONST_OK_FOR_LETTER_P(VALUE, C) \
( (C) == 'I' ? (unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000 \
: (C) == 'J' ? ((VALUE) & 0xffff) == 0 \
- : (C) == 'K' ? ((VALUE) & 0xffff0000) == 0 \
+ : (C) == 'K' ? ((VALUE) & (~ (HOST_WIDE_INT) 0xffff)) == 0 \
: (C) == 'L' ? mask_constant (VALUE) \
: (C) == 'M' ? (VALUE) > 31 \
: (C) == 'N' ? exact_log2 (VALUE) >= 0 \
@@ -1068,15 +1102,13 @@ enum reg_class
'Q' means that is a memory operand that is just an offset from a reg.
'R' is for AIX TOC entries.
- 'S' is for Windows NT SYMBOL_REFs
- 'T' is for Windows NT LABEL_REFs.
+ 'S' is a constant that can be placed into a 64-bit mask operand
'U' is for V.4 small data references. */
#define EXTRA_CONSTRAINT(OP, C) \
((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \
: (C) == 'R' ? LEGITIMATE_CONSTANT_POOL_ADDRESS_P (OP) \
- : (C) == 'S' ? (TARGET_WINDOWS_NT && DEFAULT_ABI == ABI_NT && GET_CODE (OP) == SYMBOL_REF)\
- : (C) == 'T' ? (TARGET_WINDOWS_NT && DEFAULT_ABI == ABI_NT && GET_CODE (OP) == LABEL_REF) \
+ : (C) == 'S' ? mask64_operand (OP, VOIDmode) \
: (C) == 'U' ? ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \
&& small_data_operand (OP, GET_MODE (OP))) \
: 0)
@@ -1201,7 +1233,7 @@ typedef struct rs6000_stack {
#define RS6000_SAVE_AREA (TARGET_32BIT ? 24 : 48)
/* Address to save the TOC register */
-#define RS6000_SAVE_TOC plus_constant (stack_pointer_rtx, 20)
+#define RS6000_SAVE_TOC plus_constant (stack_pointer_rtx, (TARGET_32BIT ? 20 : 40))
/* Offset & size for fpmem stack locations used for converting between
float and integral types. */
@@ -1300,15 +1332,19 @@ extern int rs6000_sysv_varargs_p;
On RS/6000 an integer value is in r3 and a floating-point value is in
fp1, unless -msoft-float. */
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx (REG, TYPE_MODE (VALTYPE), \
- TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 33 : 3)
+#define FUNCTION_VALUE(VALTYPE, FUNC) \
+ gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \
+ && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \
+ || POINTER_TYPE_P (VALTYPE) \
+ ? word_mode : TYPE_MODE (VALTYPE), \
+ TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 33 : 3)
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
#define LIBCALL_VALUE(MODE) \
- gen_rtx (REG, MODE, GET_MODE_CLASS (MODE) == MODE_FLOAT && TARGET_HARD_FLOAT ? 33 : 3)
+ gen_rtx_REG (MODE, \
+ GET_MODE_CLASS (MODE) == MODE_FLOAT && TARGET_HARD_FLOAT ? 33 : 3)
/* The definition of this macro implies that there are cases where
a scalar value cannot be returned in registers.
@@ -1320,6 +1356,14 @@ extern int rs6000_sysv_varargs_p;
(TYPE_MODE (TYPE) == BLKmode \
&& (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8))
+/* Mode of stack savearea.
+ FUNCTION is VOIDmode because calling convention maintains SP.
+ BLOCK needs Pmode for SP.
+ NONLOCAL needs twice Pmode to maintain both backchain and SP. */
+#define STACK_SAVEAREA_MODE(LEVEL) \
+ (LEVEL == SAVE_FUNCTION ? VOIDmode \
+ : LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode)
+
/* Minimum and maximum general purpose registers used to hold arguments. */
#define GP_ARG_MIN_REG 3
#define GP_ARG_MAX_REG 10
@@ -1544,6 +1588,40 @@ typedef struct rs6000_args
before returning. */
#define FUNCTION_EPILOGUE(FILE, SIZE) output_epilog (FILE, SIZE)
+
+/* A C compound statement that outputs the assembler code for a thunk function,
+ used to implement C++ virtual function calls with multiple inheritance. The
+ thunk acts as a wrapper around a virtual function, adjusting the implicit
+ object parameter before handing control off to the real function.
+
+ First, emit code to add the integer DELTA to the location that contains the
+ incoming first argument. Assume that this argument contains a pointer, and
+ is the one used to pass the `this' pointer in C++. This is the incoming
+ argument *before* the function prologue, e.g. `%o0' on a sparc. The
+ addition must preserve the values of all other incoming arguments.
+
+ After the addition, emit code to jump to FUNCTION, which is a
+ `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
+ the return address. Hence returning from FUNCTION will return to whoever
+ called the current `thunk'.
+
+ The effect must be as if FUNCTION had been called directly with the adjusted
+ first argument. This macro is responsible for emitting all of the code for
+ a thunk function; `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' are not
+ invoked.
+
+ The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
+ extracted from it.) It might possibly be useful on some targets, but
+ probably not.
+
+ If you do not define this macro, the target-independent code in the C++
+ frontend will generate a less efficient heavyweight thunk that calls
+ FUNCTION instead of jumping to it. The generic approach does not support
+ varargs. */
+#if TARGET_ELF
+#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
+ output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)
+#endif
/* TRAMPOLINE_TEMPLATE deleted */
@@ -1613,10 +1691,10 @@ typedef struct rs6000_args
frame pointer. */
#define RETURN_ADDR_RTX(count, frame) \
((count == -1) \
- ? gen_rtx (REG, Pmode, 65) \
- : gen_rtx (MEM, Pmode, \
+ ? gen_rtx_REG (Pmode, 65) \
+ : gen_rtx_MEM (Pmode, \
memory_address (Pmode, \
- plus_constant (copy_to_reg (gen_rtx (MEM, Pmode, \
+ plus_constant (copy_to_reg (gen_rtx_MEM (Pmode, \
memory_address (Pmode, frame))), \
RETURN_ADDRESS_OFFSET))))
@@ -1723,6 +1801,7 @@ typedef struct rs6000_args
#define LEGITIMATE_CONSTANT_P(X) \
(GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \
+ || (TARGET_POWERPC64 && GET_MODE (X) == DImode) \
|| easy_fp_constant (X, GET_MODE (X)))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
@@ -1770,14 +1849,19 @@ typedef struct rs6000_args
the sum of two registers, or a register indirect, possibly with an
auto-increment. For DFmode and DImode with an constant plus register,
we must ensure that both words are addressable or PowerPC64 with offset
- word aligned. */
+ word aligned.
+
+ For modes spanning multiple registers (DFmode in 32-bit GPRs,
+ 32-bit DImode, TImode), indexed addressing cannot be used because
+ adjacent memory cells are accessed by adding word-sized offsets
+ during assembly output. */
#define LEGITIMATE_CONSTANT_POOL_BASE_P(X) \
(TARGET_TOC && GET_CODE (X) == SYMBOL_REF \
&& CONSTANT_POOL_ADDRESS_P (X) \
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X)))
-/* TARGET_64BIT TOC64 guaranteed to have 64 bit alignment. */
+/* AIX64 guaranteed to have 64 bit TOC alignment. */
#define LEGITIMATE_CONSTANT_POOL_ADDRESS_P(X) \
(LEGITIMATE_CONSTANT_POOL_BASE_P (X) \
|| (TARGET_TOC \
@@ -1847,8 +1931,8 @@ typedef struct rs6000_args
if (LEGITIMATE_OFFSET_ADDRESS_P (MODE, X)) \
goto ADDR; \
if ((MODE) != TImode \
- && (TARGET_HARD_FLOAT || TARGET_64BIT || (MODE) != DFmode) \
- && (TARGET_64BIT || (MODE) != DImode) \
+ && (TARGET_HARD_FLOAT || TARGET_POWERPC64 || (MODE) != DFmode) \
+ && (TARGET_POWERPC64 || (MODE) != DImode) \
&& LEGITIMATE_INDEXED_ADDRESS_P (X)) \
goto ADDR; \
if (LEGITIMATE_LO_SUM_ADDRESS_P (MODE, X)) \
@@ -1888,18 +1972,18 @@ typedef struct rs6000_args
low_int = INTVAL (XEXP (X, 1)) & 0xffff; \
if (low_int & 0x8000) \
high_int += 0x10000, low_int |= ((HOST_WIDE_INT) -1) << 16; \
- sum = force_operand (gen_rtx (PLUS, Pmode, XEXP (X, 0), \
+ sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (X, 0), \
GEN_INT (high_int)), 0); \
- (X) = gen_rtx (PLUS, Pmode, sum, GEN_INT (low_int)); \
+ (X) = gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int)); \
goto WIN; \
} \
else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
&& GET_CODE (XEXP (X, 1)) != CONST_INT \
- && (TARGET_HARD_FLOAT || TARGET_64BIT || (MODE) != DFmode) \
- && (TARGET_64BIT || (MODE) != DImode) \
+ && (TARGET_HARD_FLOAT || TARGET_POWERPC64 || (MODE) != DFmode) \
+ && (TARGET_POWERPC64 || (MODE) != DImode) \
&& (MODE) != TImode) \
{ \
- (X) = gen_rtx (PLUS, Pmode, XEXP (X, 0), \
+ (X) = gen_rtx_PLUS (Pmode, XEXP (X, 0), \
force_reg (Pmode, force_operand (XEXP (X, 1), 0))); \
goto WIN; \
} \
@@ -1912,10 +1996,50 @@ typedef struct rs6000_args
{ \
rtx reg = gen_reg_rtx (Pmode); \
emit_insn (gen_elf_high (reg, (X))); \
- (X) = gen_rtx (LO_SUM, Pmode, reg, (X)); \
+ (X) = gen_rtx_LO_SUM (Pmode, reg, (X)); \
} \
}
+/* Try a machine-dependent way of reloading an illegitimate address
+ operand. If we find one, push the reload and jump to WIN. This
+ macro is used in only one place: `find_reloads_address' in reload.c.
+
+ For RS/6000, we wish to handle large displacements off a base
+ register by splitting the addend across an addiu/addis and the mem insn.
+ This cuts number of extra insns needed from 3 to 1. */
+
+#define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \
+do { \
+ if (GET_CODE (X) == PLUS \
+ && GET_CODE (XEXP (X, 0)) == REG \
+ && REGNO (XEXP (X, 0)) < FIRST_PSEUDO_REGISTER \
+ && REG_MODE_OK_FOR_BASE_P (XEXP (X, 0), MODE) \
+ && GET_CODE (XEXP (X, 1)) == CONST_INT) \
+ { \
+ HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
+ HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; \
+ HOST_WIDE_INT high \
+ = (((val - low) & 0xffffffff) ^ 0x80000000) - 0x80000000; \
+ \
+ /* Check for 32-bit overflow. */ \
+ if (high + low != val) \
+ break; \
+ \
+ /* Reload the high part into a base reg; leave the low part \
+ in the mem directly. */ \
+ \
+ X = gen_rtx_PLUS (GET_MODE (X), \
+ gen_rtx_PLUS (GET_MODE (X), XEXP (X, 0), \
+ GEN_INT (high)), \
+ GEN_INT (low)); \
+ \
+ push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL_PTR, \
+ BASE_REG_CLASS, GET_MODE (X), VOIDmode, 0, 0, \
+ OPNUM, TYPE); \
+ goto WIN; \
+ } \
+} while (0)
+
/* Go to LABEL if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for.
@@ -2053,10 +2177,9 @@ typedef struct rs6000_args
#define OBJECT_FORMAT_COFF
/* Define the magic numbers that we recognize as COFF.
- AIX 4.3 adds U803XTOCMAGIC (0757) for 64-bit executables, but collect2.c
- does not include these files in the right order to conditionally define
- the value in the macro. */
-
+ AIX 4.3 adds U803XTOCMAGIC (0757) for 64-bit objects, but collect2.c
+ does not include files in the correct order to conditionally define
+ the symbolic name in this macro. */
#define MY_ISCOFF(magic) \
((magic) == U802WRMAGIC || (magic) == U802ROMAGIC \
|| (magic) == U802TOCMAGIC || (magic) == 0757)
@@ -2069,12 +2192,10 @@ typedef struct rs6000_args
#define FASCIST_ASSEMBLER
-#ifndef ASM_OUTPUT_CONSTRUCTOR
-#define ASM_OUTPUT_CONSTRUCTOR(file, name)
-#endif
-#ifndef ASM_OUTPUT_DESTRUCTOR
-#define ASM_OUTPUT_DESTRUCTOR(file, name)
-#endif
+/* AIX does not have any init/fini or ctor/dtor sections, so create
+ static constructors and destructors as normal functions. */
+/* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */
+/* #define ASM_OUTPUT_DESTRUCTOR(file, name) */
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
@@ -2086,7 +2207,6 @@ typedef struct rs6000_args
#define Pmode (TARGET_32BIT ? SImode : DImode)
/* Mode of a function address in a call instruction (for indexing purposes).
-
Doesn't matter on RS/6000. */
#define FUNCTION_MODE (TARGET_32BIT ? SImode : DImode)
@@ -2131,17 +2251,17 @@ typedef struct rs6000_args
#define RTX_COSTS(X,CODE,OUTER_CODE) \
case PLUS: \
return ((GET_CODE (XEXP (X, 1)) == CONST_INT \
- && (unsigned HOST_WIDE_INT) ((INTVAL (XEXP (X, 1)) \
- + 0x8000) >= 0x10000)) \
+ && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (X, 1)) \
+ + 0x8000) >= 0x10000) \
+ && ((INTVAL (XEXP (X, 1)) & 0xffff) != 0)) \
? COSTS_N_INSNS (2) \
: COSTS_N_INSNS (1)); \
case AND: \
- return ((non_and_cint_operand (XEXP (X, 1), SImode)) \
- ? COSTS_N_INSNS (2) \
- : COSTS_N_INSNS (1)); \
case IOR: \
case XOR: \
- return ((non_logical_cint_operand (XEXP (X, 1), SImode)) \
+ return ((GET_CODE (XEXP (X, 1)) == CONST_INT \
+ && (INTVAL (XEXP (X, 1)) & (~ (HOST_WIDE_INT) 0xffff)) != 0 \
+ && ((INTVAL (XEXP (X, 1)) & 0xffff) != 0)) \
? COSTS_N_INSNS (2) \
: COSTS_N_INSNS (1)); \
case MULT: \
@@ -2307,6 +2427,8 @@ extern int rs6000_trunc_used;
main_input_filename, ".ro_"); \
\
output_file_directive (FILE, main_input_filename); \
+ if (TARGET_64BIT) \
+ fputs ("\t.machine\t\"ppc64\"\n", FILE); \
toc_section (); \
if (write_symbols != NO_DEBUG) \
private_data_section (); \
@@ -2375,7 +2497,7 @@ extern int rs6000_trunc_used;
/* Indicate that jump tables go in the text section. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Define the routines to implement these extra sections. */
@@ -2469,10 +2591,10 @@ extern int toc_initialized;
} \
fputs (".csect ", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fputs ("[DS]\n", FILE); \
+ fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (":\n", FILE); \
- fputs ((TARGET_32BIT) ? "\t.long ." : "\t.llong .", FILE); \
+ fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (", TOC[tc0], 0\n", FILE); \
fputs (".csect .text[PR]\n.", FILE); \
@@ -2498,8 +2620,11 @@ extern int toc_initialized;
|| GET_CODE (X) == LABEL_REF \
|| (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC) \
&& GET_CODE (X) == CONST_DOUBLE \
- && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
+ && (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
+ || (TARGET_POWERPC64 && GET_MODE (X) == DImode)))))
+#if 0
&& BITS_PER_WORD == HOST_BITS_PER_INT)))
+#endif
/* Select section for constant in constant pool.
@@ -2949,7 +3074,7 @@ do { \
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { char buf[100]; \
- fputs ((TARGET_32BIT) ? "\t.long " : "\t.llong ", FILE); \
+ fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
putc ('\n', FILE); \
@@ -2959,7 +3084,7 @@ do { \
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)\
do { char buf[100]; \
- fputs ((TARGET_32BIT) ? "\t.long " : "\t.llong ", FILE); \
+ fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
putc ('-', FILE); \
@@ -3041,15 +3166,15 @@ do { \
/* Define the codes that are matched by predicates in rs6000.c. */
#define PREDICATE_CODES \
- {"short_cint_operand", {CONST_INT}}, \
- {"u_short_cint_operand", {CONST_INT}}, \
+ {"short_cint_operand", {CONST_INT, CONSTANT_P_RTX}}, \
+ {"u_short_cint_operand", {CONST_INT, CONSTANT_P_RTX}}, \
{"non_short_cint_operand", {CONST_INT}}, \
{"gpc_reg_operand", {SUBREG, REG}}, \
{"cc_reg_operand", {SUBREG, REG}}, \
- {"reg_or_short_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_short_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
{"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}}, \
- {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \
- {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"reg_or_cint_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
{"got_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
{"got_no_const_operand", {SYMBOL_REF, LABEL_REF}}, \
{"easy_fp_constant", {CONST_DOUBLE}}, \
@@ -3058,25 +3183,29 @@ do { \
{"volatile_mem_operand", {MEM}}, \
{"offsettable_addr_operand", {REG, SUBREG, PLUS}}, \
{"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \
- {"add_operand", {SUBREG, REG, CONST_INT}}, \
+ {"add_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
{"non_add_cint_operand", {CONST_INT}}, \
- {"and_operand", {SUBREG, REG, CONST_INT}}, \
- {"non_and_cint_operand", {CONST_INT}}, \
- {"logical_operand", {SUBREG, REG, CONST_INT}}, \
+ {"and_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+ {"and64_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX, \
+ CONST_DOUBLE}}, \
+ {"logical_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
{"non_logical_cint_operand", {CONST_INT}}, \
{"mask_operand", {CONST_INT}}, \
+ {"mask64_operand", {CONST_INT, CONST_DOUBLE}}, \
{"count_register_operand", {REG}}, \
{"fpmem_operand", {REG}}, \
{"call_operand", {SYMBOL_REF, REG}}, \
{"current_file_function_operand", {SYMBOL_REF}}, \
- {"input_operand", {SUBREG, MEM, REG, CONST_INT, SYMBOL_REF}}, \
+ {"input_operand", {SUBREG, MEM, REG, CONST_INT, CONSTANT_P_RTX, \
+ CONST_DOUBLE, SYMBOL_REF}}, \
{"load_multiple_operation", {PARALLEL}}, \
{"store_multiple_operation", {PARALLEL}}, \
{"branch_comparison_operator", {EQ, NE, LE, LT, GE, \
GT, LEU, LTU, GEU, GTU}}, \
{"scc_comparison_operator", {EQ, NE, LE, LT, GE, \
- GT, LEU, LTU, GEU, GTU}},
-
+ GT, LEU, LTU, GEU, GTU}}, \
+ {"trap_comparison_operator", {EQ, NE, LE, LT, GE, \
+ GT, LEU, LTU, GEU, GTU}},
/* uncomment for disabling the corresponding default options */
/* #define MACHINE_no_sched_interblock */
@@ -3098,7 +3227,6 @@ extern void output_options ();
extern void rs6000_override_options ();
extern void rs6000_file_start ();
extern struct rtx_def *rs6000_float_const ();
-extern struct rtx_def *rs6000_immed_double_const ();
extern struct rtx_def *rs6000_got_register ();
extern int direct_return ();
extern int get_issue_rate ();
@@ -3123,13 +3251,13 @@ extern int add_operand ();
extern int non_add_cint_operand ();
extern int non_logical_cint_operand ();
extern int logical_operand ();
-extern int non_logical_operand ();
extern int mask_constant ();
extern int mask_operand ();
+extern int mask64_operand ();
+extern int and64_operand ();
extern int and_operand ();
extern int count_register_operand ();
extern int fpmem_operand ();
-extern int non_and_cint_operand ();
extern int reg_or_mem_operand ();
extern int lwa_operand ();
extern int call_operand ();
@@ -3150,6 +3278,7 @@ extern int load_multiple_operation ();
extern int store_multiple_operation ();
extern int branch_comparison_operator ();
extern int scc_comparison_operator ();
+extern int trap_comparison_operator ();
extern int includes_lshift_p ();
extern int includes_rshift_p ();
extern int registers_ok_for_quad_peep ();
@@ -3169,6 +3298,7 @@ extern int rs6000_makes_calls ();
extern rs6000_stack_t *rs6000_stack_info ();
extern void output_prolog ();
extern void output_epilog ();
+extern void output_mi_thunk ();
extern void output_toc ();
extern void output_ascii ();
extern void rs6000_gen_section_name ();
@@ -3185,6 +3315,9 @@ extern void rs6000_set_default_type_attributes ();
extern struct rtx_def *rs6000_dll_import_ref ();
extern struct rtx_def *rs6000_longcall_ref ();
extern int function_arg_padding ();
+extern void toc_section ();
+extern void private_data_section ();
+extern void rs6000_fatal_bad_address ();
/* See nonlocal_goto_receiver for when this must be set. */
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 678286cb868..7b7f989fddf 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1,5 +1,5 @@
;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler
-;; Copyright (C) 1990, 91-96, 1997, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 91-97, 1998 Free Software Foundation, Inc.
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
;; This file is part of GNU CC.
@@ -40,7 +40,7 @@
;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in rs6000.h.
-(define_attr "cpu" "rios1,rios2,mpccore,ppc403,ppc601,ppc603,ppc604,ppc620"
+(define_attr "cpu" "rios1,rios2,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620"
(const (symbol_ref "rs6000_cpu_attr")))
; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
@@ -50,12 +50,12 @@
; (POWER and 601 use Integer Unit)
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "load")
- (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620"))
2 1)
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "store,fpstore")
- (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620"))
1 1)
(define_function_unit "lsu" 1 0
@@ -65,7 +65,7 @@
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "fpload")
- (eq_attr "cpu" "ppc604,ppc620"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
3 1)
(define_function_unit "iu" 1 0
@@ -181,12 +181,12 @@
(eq_attr "cpu" "mpccore"))
6 6)
-; PPC604 has two units that perform integer operations
+; PPC604{,e} has two units that perform integer operations
; and one unit for divide/multiply operations (and move
; from/to spr).
(define_function_unit "iu2" 2 0
(and (eq_attr "type" "integer")
- (eq_attr "cpu" "ppc604,ppc620"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
1 1)
(define_function_unit "imuldiv" 1 0
@@ -195,8 +195,13 @@
4 2)
(define_function_unit "imuldiv" 1 0
+ (and (eq_attr "type" "imul")
+ (eq_attr "cpu" "ppc604e"))
+ 2 1)
+
+(define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "idiv")
- (eq_attr "cpu" "ppc604,ppc620"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
20 19)
; compare is done on integer unit, but feeds insns which
@@ -213,7 +218,7 @@
(define_function_unit "iu" 1 0
(and (eq_attr "type" "compare,delayed_compare")
- (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620"))
3 1)
(define_function_unit "iu2" 2 0
@@ -223,7 +228,7 @@
(define_function_unit "iu2" 2 0
(and (eq_attr "type" "compare,delayed_compare")
- (eq_attr "cpu" "ppc604,ppc620"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
1 1)
; fp compare uses fp unit
@@ -250,7 +255,7 @@
; fp compare uses fp unit
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "fpcompare")
- (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc604e,ppc620"))
5 1)
(define_function_unit "fpu" 1 0
@@ -265,7 +270,7 @@
(define_function_unit "bpu" 1 0
(and (eq_attr "type" "mtjmpr")
- (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620"))
4 1)
; all jumps/branches are executing on the bpu, in 1 cycle, for all machines.
@@ -295,7 +300,7 @@
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "fp")
- (eq_attr "cpu" "ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
3 1)
(define_function_unit "fpu" 1 0
@@ -316,7 +321,7 @@
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "dmul")
- (eq_attr "cpu" "ppc604,ppc620"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
3 1)
(define_function_unit "fpu" 1 0
@@ -336,7 +341,7 @@
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "sdiv")
- (eq_attr "cpu" "ppc603,ppc604,ppc620"))
+ (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
18 18)
(define_function_unit "fpu" 1 0
@@ -346,7 +351,7 @@
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "ddiv")
- (eq_attr "cpu" "ppc601,ppc604,ppc620"))
+ (eq_attr "cpu" "ppc601,ppc604,ppc604e,ppc620"))
31 31)
(define_function_unit "fpu" 1 0
@@ -1214,13 +1219,13 @@
(set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
"")
-(define_insn ""
+(define_insn "*nabs_power"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))))]
"TARGET_POWER"
"nabs %0,%1")
-(define_insn ""
+(define_insn "*nabs_no_power"
[(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
(clobber (match_scratch:SI 2 "=&r,&r"))]
@@ -1369,11 +1374,11 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_divss_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
- emit_move_insn (operands[3], gen_rtx (REG, SImode, 4));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+ emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
DONE;
}
}")
@@ -1397,10 +1402,10 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_quous_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
DONE;
}
else if (TARGET_POWER)
@@ -1454,10 +1459,10 @@
FAIL;
else
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_quoss_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
DONE;
}
}")
@@ -1605,11 +1610,11 @@
{
if (! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_divus_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
- emit_move_insn (operands[3], gen_rtx (REG, SImode, 4));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+ emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
DONE;
}
else
@@ -1761,8 +1766,9 @@
|| rtx_equal_p (operands[0], operands[1]))
? operands[0] : gen_reg_rtx (SImode));
- emit_insn (gen_iorsi3 (tmp, operands[1], GEN_INT (value & 0xffff0000)));
- emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0x0000ffff)));
+ emit_insn (gen_iorsi3 (tmp, operands[1],
+ GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+ emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
DONE;
}
}")
@@ -1799,6 +1805,22 @@
"or. %0,%1,%2"
[(set_attr "type" "compare")])
+;; Split an IOR that we can't do in one insn into two insns, each of which
+;; does one 16-bit part. This is used by combine.
+
+(define_split
+ [(set (match_operand:SI 0 "gpc_reg_operand" "")
+ (ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
+ (match_operand:SI 2 "non_logical_cint_operand" "")))]
+ ""
+ [(set (match_dup 0) (ior:SI (match_dup 1) (match_dup 3)))
+ (set (match_dup 0) (ior:SI (match_dup 0) (match_dup 4)))]
+"
+{
+ operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
+ operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
+}")
+
(define_expand "xorsi3"
[(set (match_operand:SI 0 "gpc_reg_operand" "")
(xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
@@ -1814,8 +1836,9 @@
|| rtx_equal_p (operands[0], operands[1]))
? operands[0] : gen_reg_rtx (SImode));
- emit_insn (gen_xorsi3 (tmp, operands[1], GEN_INT (value & 0xffff0000)));
- emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0x0000ffff)));
+ emit_insn (gen_xorsi3 (tmp, operands[1],
+ GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+ emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
DONE;
}
}")
@@ -1852,14 +1875,30 @@
"xor. %0,%1,%2"
[(set_attr "type" "compare")])
-(define_insn "*eqv_internal1"
+;; Split an XOR that we can't do in one insn into two insns, each of which
+;; does one 16-bit part. This is used by combine.
+
+(define_split
+ [(set (match_operand:SI 0 "gpc_reg_operand" "")
+ (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+ (match_operand:SI 2 "non_logical_cint_operand" "")))]
+ ""
+ [(set (match_dup 0) (xor:SI (match_dup 1) (match_dup 3)))
+ (set (match_dup 0) (xor:SI (match_dup 0) (match_dup 4)))]
+"
+{
+ operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
+ operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
+}")
+
+(define_insn "*eqvsi3_internal1"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
(match_operand:SI 2 "gpc_reg_operand" "r"))))]
""
"eqv %0,%1,%2")
-(define_insn "*eqv_internal2"
+(define_insn "*eqvsi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
(match_operand:SI 2 "gpc_reg_operand" "r")))
@@ -1869,7 +1908,7 @@
"eqv. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn "*eqv_internal3"
+(define_insn "*eqvsi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
(match_operand:SI 2 "gpc_reg_operand" "r")))
@@ -1880,14 +1919,14 @@
"eqv. %0,%1,%2"
[(set_attr "type" "compare")])
-(define_insn "*andc_internal1"
+(define_insn "*andcsi3_internal1"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
(match_operand:SI 2 "gpc_reg_operand" "r")))]
""
"andc %0,%2,%1")
-(define_insn "*andc_internal2"
+(define_insn "*andcsi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
(match_operand:SI 2 "gpc_reg_operand" "r"))
@@ -1897,7 +1936,7 @@
"andc. %3,%2,%1"
[(set_attr "type" "compare")])
-(define_insn "*andc_internal3"
+(define_insn "*andcsi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
(match_operand:SI 2 "gpc_reg_operand" "r"))
@@ -1908,14 +1947,14 @@
"andc. %0,%2,%1"
[(set_attr "type" "compare")])
-(define_insn "*iorc_internal1"
+(define_insn "*iorcsi3_internal1"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
(match_operand:SI 2 "gpc_reg_operand" "r")))]
""
"orc %0,%2,%1")
-(define_insn "*iorc_internal2"
+(define_insn "*iorcsi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
(match_operand:SI 2 "gpc_reg_operand" "r"))
@@ -1925,7 +1964,7 @@
"orc. %3,%2,%1"
[(set_attr "type" "compare")])
-(define_insn "*iorc_internal3"
+(define_insn "*iorcsi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
(match_operand:SI 2 "gpc_reg_operand" "r"))
@@ -1936,14 +1975,14 @@
"orc. %0,%2,%1"
[(set_attr "type" "compare")])
-(define_insn "*nand_internal1"
+(define_insn "*nandsi3_internal1"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
""
"nand %0,%1,%2")
-(define_insn "*nand_internal2"
+(define_insn "*nandsi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r")))
@@ -1953,7 +1992,7 @@
"nand. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn "*nand_internal3"
+(define_insn "*nandsi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r")))
@@ -1964,14 +2003,14 @@
"nand. %0,%1,%2"
[(set_attr "type" "compare")])
-(define_insn "*nor_internal1"
+(define_insn "*norsi3_internal1"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
""
"nor %0,%1,%2")
-(define_insn "*nor_internal2"
+(define_insn "*norsi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r")))
@@ -1981,7 +2020,7 @@
"nor. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn "*nor_internal3"
+(define_insn "*norsi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r")))
@@ -2384,7 +2423,7 @@
""
"{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffffffff")
-(define_insn ""
+(define_insn "*rotlsi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "reg_or_cint_operand" "ri"))
@@ -2394,7 +2433,7 @@
"{rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffffffff"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "reg_or_cint_operand" "ri"))
@@ -2405,7 +2444,7 @@
"{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffffffff"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal4"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(and:SI (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "reg_or_cint_operand" "ri"))
@@ -2413,7 +2452,7 @@
""
"{rl%I2nm|rlw%I2nm} %0,%1,%h2,%m3,%M3")
-(define_insn ""
+(define_insn "*rotlsi3_internal5"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (and:SI
(rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
@@ -2425,7 +2464,7 @@
"{rl%I2nm.|rlw%I2nm.} %4,%1,%h2,%m3,%M3"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal6"
[(set (match_operand:CC 4 "cc_reg_operand" "=x")
(compare:CC (and:SI
(rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
@@ -2438,7 +2477,7 @@
"{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,%m3,%M3"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal7"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(zero_extend:SI
(subreg:QI
@@ -2447,7 +2486,7 @@
""
"{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xff")
-(define_insn ""
+(define_insn "*rotlsi3_internal8"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (zero_extend:SI
(subreg:QI
@@ -2459,7 +2498,7 @@
"{rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xff"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal9"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (zero_extend:SI
(subreg:QI
@@ -2472,7 +2511,7 @@
"{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xff"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal10"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(zero_extend:SI
(subreg:HI
@@ -2481,7 +2520,7 @@
""
"{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffff")
-(define_insn ""
+(define_insn "*rotlsi3_internal11"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (zero_extend:SI
(subreg:HI
@@ -2493,7 +2532,7 @@
"{rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffff"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotlsi3_internal12"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (zero_extend:SI
(subreg:HI
@@ -3278,7 +3317,7 @@
emit_insn (gen_negdf2 (temp, temp));
emit_insn (gen_fseldfsf4 (operands[0], temp, operands[0], operands[3]));
}
- if (code == NE)
+ else if (code == NE)
{
emit_insn (gen_negdf2 (temp, temp));
emit_insn (gen_fseldfsf4 (operands[0], temp, operands[3], operands[0]));
@@ -3294,7 +3333,7 @@
emit_insn (gen_negsf2 (temp, temp));
emit_insn (gen_fselsfsf4 (operands[0], temp, operands[0], operands[3]));
}
- if (code == NE)
+ else if (code == NE)
{
emit_insn (gen_negsf2 (temp, temp));
emit_insn (gen_fselsfsf4 (operands[0], temp, operands[3], operands[0]));
@@ -3525,7 +3564,7 @@
emit_insn (gen_negdf2 (temp, temp));
emit_insn (gen_fseldfdf4 (operands[0], temp, operands[0], operands[3]));
}
- if (code == NE)
+ else if (code == NE)
{
emit_insn (gen_negdf2 (temp, temp));
emit_insn (gen_fseldfdf4 (operands[0], temp, operands[3], operands[0]));
@@ -3541,7 +3580,7 @@
emit_insn (gen_negsf2 (temp, temp));
emit_insn (gen_fselsfdf4 (operands[0], temp, operands[0], operands[3]));
}
- if (code == NE)
+ else if (code == NE)
{
emit_insn (gen_negsf2 (temp, temp));
emit_insn (gen_fselsfdf4 (operands[0], temp, operands[3], operands[0]));
@@ -3580,7 +3619,7 @@
(clobber (match_dup 4))
(clobber (match_dup 5))
(clobber (reg:DF 76))])]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
"
{
operands[2] = force_reg (SImode, GEN_INT (0x43300000));
@@ -3595,9 +3634,9 @@
(use (match_operand:SI 2 "gpc_reg_operand" "r"))
(use (match_operand:DF 3 "gpc_reg_operand" "f"))
(clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
- (clobber (match_operand:SI 5 "gpc_reg_operand" "=b"))
+ (clobber (match_operand 5 "gpc_reg_operand" "=b"))
(clobber (reg:DF 76))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
"#"
[(set_attr "length" "24")])
@@ -3607,9 +3646,9 @@
(use (match_operand:SI 2 "gpc_reg_operand" ""))
(use (match_operand:DF 3 "gpc_reg_operand" ""))
(clobber (match_operand:SI 4 "gpc_reg_operand" ""))
- (clobber (match_operand:SI 5 "gpc_reg_operand" ""))
+ (clobber (match_operand 5 "gpc_reg_operand" ""))
(clobber (reg:DF 76))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
[(set (match_dup 4)
(xor:SI (match_dup 1)
(match_dup 6)))
@@ -3631,7 +3670,7 @@
"
{
operands[6] = GEN_INT (0x80000000);
- operands[7] = gen_rtx (REG, DFmode, FPMEM_REGNUM);
+ operands[7] = gen_rtx_REG (DFmode, FPMEM_REGNUM);
}")
(define_expand "floatunssidf2"
@@ -3641,7 +3680,7 @@
(use (match_dup 3))
(clobber (match_dup 4))
(clobber (reg:DF 76))])]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
"
{
operands[2] = force_reg (SImode, GEN_INT (0x43300000));
@@ -3654,9 +3693,9 @@
(unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
(use (match_operand:SI 2 "gpc_reg_operand" "r"))
(use (match_operand:DF 3 "gpc_reg_operand" "f"))
- (clobber (match_operand:SI 4 "gpc_reg_operand" "=b"))
+ (clobber (match_operand 4 "gpc_reg_operand" "=b"))
(clobber (reg:DF 76))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
"#"
[(set_attr "length" "20")])
@@ -3665,9 +3704,9 @@
(unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
(use (match_operand:SI 2 "gpc_reg_operand" ""))
(use (match_operand:DF 3 "gpc_reg_operand" ""))
- (clobber (match_operand:SI 4 "gpc_reg_operand" "=b"))
+ (clobber (match_operand 4 "gpc_reg_operand" "=b"))
(clobber (reg:DF 76))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
[(set (match_dup 4)
(unspec [(const_int 0)] 11))
(set (match_dup 5)
@@ -3683,11 +3722,11 @@
(set (match_dup 0)
(minus:DF (match_dup 0)
(match_dup 3)))]
- "operands[5] = gen_rtx (REG, DFmode, FPMEM_REGNUM);")
+ "operands[5] = gen_rtx_REG (DFmode, FPMEM_REGNUM);")
;; Load up scratch register with base address + offset if needed
(define_insn "*floatsidf2_loadaddr"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
+ [(set (match_operand 0 "gpc_reg_operand" "=b")
(unspec [(const_int 0)] 11))]
"TARGET_HARD_FLOAT"
"*
@@ -3709,8 +3748,8 @@
(define_insn "*floatsidf2_store1"
[(set (reg:DF 76)
(unspec [(match_operand:SI 0 "gpc_reg_operand" "r")
- (match_operand:SI 1 "gpc_reg_operand" "r")] 12))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ (match_operand 1 "gpc_reg_operand" "b")] 12))]
+ "TARGET_HARD_FLOAT"
"*
{
rtx indx;
@@ -3722,8 +3761,8 @@
else
indx = stack_pointer_rtx;
- operands[2] = gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode,
+ operands[2] = gen_rtx_MEM (SImode,
+ gen_rtx_PLUS (Pmode,
indx,
GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000)
+ ((WORDS_BIG_ENDIAN != 0) * 4))));
@@ -3735,9 +3774,9 @@
(define_insn "*floatsidf2_store2"
[(set (reg:DF 76)
(unspec [(match_operand:SI 0 "gpc_reg_operand" "r")
- (match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand 1 "gpc_reg_operand" "b")
(reg:DF 76)] 13))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT"
"*
{
rtx indx;
@@ -3749,8 +3788,8 @@
else
indx = stack_pointer_rtx;
- operands[2] = gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode,
+ operands[2] = gen_rtx_MEM (SImode,
+ gen_rtx_PLUS (Pmode,
indx,
GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000)
+ ((WORDS_BIG_ENDIAN == 0) * 4))));
@@ -3762,8 +3801,8 @@
(define_insn "*floatsidf2_load"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(unspec [(reg:DF 76)
- (match_operand:SI 1 "gpc_reg_operand" "b")] 14))]
- "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+ (match_operand 1 "gpc_reg_operand" "b")] 14))]
+ "TARGET_HARD_FLOAT"
"*
{
rtx indx;
@@ -3779,8 +3818,8 @@
else
indx = stack_pointer_rtx;
- operands[2] = gen_rtx (MEM, SImode,
- gen_rtx (PLUS, Pmode, indx, GEN_INT (offset)));
+ operands[2] = gen_rtx_MEM (SImode,
+ gen_rtx_PLUS (Pmode, indx, GEN_INT (offset)));
return \"lfd %0,%2\";
}"
@@ -3798,20 +3837,20 @@
if (!TARGET_POWER2 && !TARGET_POWERPC)
{
emit_insn (gen_trunc_call (operands[0], operands[1],
- gen_rtx (SYMBOL_REF, Pmode, RS6000_ITRUNC)));
+ gen_rtx_SYMBOL_REF (Pmode, RS6000_ITRUNC)));
DONE;
}
operands[2] = gen_reg_rtx (DImode);
operands[3] = gen_reg_rtx (Pmode);
- operands[4] = gen_rtx (REG, DImode, FPMEM_REGNUM);
+ operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);
}")
(define_insn "*fix_truncdfsi2_internal"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
- (clobber (match_operand:SI 3 "gpc_reg_operand" "=b"))
+ (clobber (match_operand 3 "gpc_reg_operand" "=b"))
(clobber (reg:DI 76))]
"TARGET_HARD_FLOAT"
"#"
@@ -3821,7 +3860,7 @@
[(set (match_operand:SI 0 "gpc_reg_operand" "")
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" ""))
- (clobber (match_operand:SI 3 "gpc_reg_operand" ""))
+ (clobber (match_operand 3 "gpc_reg_operand" ""))
(clobber (reg:DI 76))]
"TARGET_HARD_FLOAT"
[(set (match_dup 2)
@@ -3834,19 +3873,12 @@
(set (match_operand:SI 0 "gpc_reg_operand" "")
(unspec [(match_dup 4)
(match_dup 3)] 16))]
- "operands[4] = gen_rtx (REG, DImode, FPMEM_REGNUM);")
-
-(define_insn "*fctiwz"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=f")
- (sign_extend:DI (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))))]
- "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
- "{fcirz|fctiwz} %0,%1"
- [(set_attr "type" "fp")])
+ "operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);")
(define_insn "*fix_truncdfsi2_store"
[(set (reg:DI 76)
(unspec [(match_operand:DI 0 "gpc_reg_operand" "f")
- (match_operand:SI 1 "gpc_reg_operand" "b")] 15))]
+ (match_operand 1 "gpc_reg_operand" "b")] 15))]
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
"*
{
@@ -3859,20 +3891,20 @@
else
indx = stack_pointer_rtx;
- operands[2] = gen_rtx (MEM, DFmode,
- gen_rtx (PLUS, Pmode,
+ operands[2] = gen_rtx_MEM (DFmode,
+ gen_rtx_PLUS (Pmode,
indx,
GEN_INT ((((rs6000_fpmem_offset & 0xffff)
^ 0x8000) - 0x8000))));
- return \"stfd %0,%w2\";
+ return \"stfd %0,%2\";
}"
[(set_attr "type" "fpstore")])
(define_insn "*fix_truncdfsi2_load"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(unspec [(reg:DI 76)
- (match_operand:SI 1 "gpc_reg_operand" "b")] 16))]
+ (match_operand 1 "gpc_reg_operand" "b")] 16))]
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
"*
{
@@ -3885,8 +3917,8 @@
else
indx = stack_pointer_rtx;
- operands[2] = gen_rtx (MEM, DFmode,
- gen_rtx (PLUS, Pmode,
+ operands[2] = gen_rtx_MEM (DFmode,
+ gen_rtx_PLUS (Pmode,
indx,
GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000)
+ ((WORDS_BIG_ENDIAN) ? 4 : 0))));
@@ -3902,7 +3934,7 @@
"
{
emit_insn (gen_trunc_call (operands[0], operands[1],
- gen_rtx (SYMBOL_REF, Pmode, RS6000_UITRUNC)));
+ gen_rtx_SYMBOL_REF (Pmode, RS6000_UITRUNC)));
DONE;
}")
@@ -3917,9 +3949,9 @@
rtx first = XVECEXP (insns, 0, 0);
rtx last = XVECEXP (insns, 0, XVECLEN (insns, 0) - 1);
- REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
+ REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
REG_NOTES (first));
- REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
+ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
emit_insn (insns);
DONE;
@@ -3940,6 +3972,13 @@
rs6000_trunc_used = 1;
}")
+(define_insn "*fctiwz"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=f")
+ (sign_extend:DI (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))))]
+ "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
+ "{fcirz|fctiwz} %0,%1"
+ [(set_attr "type" "fp")])
+
(define_insn "floatdidf2"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(float:DF (match_operand:DI 1 "gpc_reg_operand" "f")))]
@@ -4012,22 +4051,22 @@
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
(sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
- ""
+ "! TARGET_POWERPC64"
"
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_mull_call ());
if (WORDS_BIG_ENDIAN)
- emit_move_insn (operands[0], gen_rtx (REG, DImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (DImode, 3));
else
{
emit_move_insn (operand_subword (operands[0], 0, 0, DImode),
- gen_rtx (REG, SImode, 3));
+ gen_rtx_REG (SImode, 3));
emit_move_insn (operand_subword (operands[0], 1, 0, DImode),
- gen_rtx (REG, SImode, 4));
+ gen_rtx_REG (SImode, 4));
}
DONE;
}
@@ -4158,10 +4197,10 @@
{
if (! TARGET_POWER && ! TARGET_POWERPC)
{
- emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
- emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
+ emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
emit_insn (gen_mulh_call ());
- emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
+ emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
DONE;
}
else if (TARGET_POWER)
@@ -4286,18 +4325,39 @@
(define_expand "adddi3"
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
- (match_operand:DI 2 "add_operand" "")))]
+ (match_operand:DI 2 "reg_or_cint_operand" "")))]
""
"
{
- if (! TARGET_POWERPC64 && non_short_cint_operand (operands[2], DImode))
- FAIL;
+ if (! TARGET_POWERPC64)
+ {
+ if (non_short_cint_operand (operands[2], DImode))
+ FAIL;
+ }
+ else
+ if (GET_CODE (operands[2]) == CONST_INT
+ && !add_operand (operands[2], DImode))
+ {
+ rtx tmp = ((reload_in_progress || reload_completed
+ || rtx_equal_p (operands[0], operands[1]))
+ ? operands[0] : gen_reg_rtx (DImode));
+
+ HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
+ HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+
+ if (low & 0x8000)
+ high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+
+ emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (high)));
+ emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
+ DONE;
+ }
}")
;; Discourage ai/addic because of carry but provide it in an alternative
;; allowing register zero as source.
-(define_insn ""
+(define_insn "*adddi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r")
(plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b")
(match_operand:DI 2 "add_operand" "r,I,I,J")))]
@@ -4308,7 +4368,7 @@
addic %0,%1,%2
addis %0,%1,%v2")
-(define_insn ""
+(define_insn "*adddi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
(compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r")
(match_operand:DI 2 "reg_or_short_operand" "r,I"))
@@ -4320,7 +4380,7 @@
addic. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*adddi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
(compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r")
(match_operand:DI 2 "reg_or_short_operand" "r,I"))
@@ -4431,7 +4491,7 @@
(abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
(clobber (match_scratch:DI 2 "=&r,&r"))]
"TARGET_POWERPC64"
- "sradi %2,%1,31\;xor %0,%2,%1\;subf %0,%2,%0"
+ "sradi %2,%1,63\;xor %0,%2,%1\;subf %0,%2,%0"
[(set_attr "length" "12")])
(define_split
@@ -4439,9 +4499,9 @@
(abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
(clobber (match_scratch:DI 2 "=&r,&r"))]
"TARGET_POWERPC64 && reload_completed"
- [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 31)))
+ [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
(set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
- (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))]
+ (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
"")
(define_insn ""
@@ -4449,7 +4509,7 @@
(neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
(clobber (match_scratch:DI 2 "=&r,&r"))]
"TARGET_POWERPC64"
- "sradi %2,%1,31\;xor %0,%2,%1\;subf %0,%0,%2"
+ "sradi %2,%1,63\;xor %0,%2,%1\;subf %0,%0,%2"
[(set_attr "length" "12")])
(define_split
@@ -4457,7 +4517,7 @@
(neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
(clobber (match_scratch:DI 2 "=&r,&r"))]
"TARGET_POWERPC64 && reload_completed"
- [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 31)))
+ [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
(set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
(set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
"")
@@ -4603,7 +4663,7 @@
(define_insn ""
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
- (match_operand:DI 2 "gpc_reg_operand" "r")))]
+ (match_operand:DI 2 "gpc_reg_operand" "r")))]
"TARGET_POWERPC64"
"divd %0,%1,%2"
[(set_attr "type" "idiv")])
@@ -4623,7 +4683,7 @@
"TARGET_POWERPC64"
"rld%I2cl %0,%1,%H2,0")
-(define_insn ""
+(define_insn "*rotldi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
(match_operand:DI 2 "reg_or_cint_operand" "ri"))
@@ -4633,7 +4693,7 @@
"rld%I2cl. %3,%1,%H2,0"
[(set_attr "type" "delayed_compare")])
-(define_insn ""
+(define_insn "*rotldi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
(match_operand:DI 2 "reg_or_cint_operand" "ri"))
@@ -4644,6 +4704,141 @@
"rld%I2cl. %0,%1,%H2,0"
[(set_attr "type" "delayed_compare")])
+(define_insn "*rotldi3_internal4"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (and:DI (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri"))
+ (match_operand:DI 3 "mask64_operand" "S")))]
+ "TARGET_POWERPC64"
+ "rld%I2c%B3 %0,%1,%H2,%S3")
+
+(define_insn "*rotldi3_internal5"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+ (compare:CC (and:DI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri"))
+ (match_operand:DI 3 "mask64_operand" "S"))
+ (const_int 0)))
+ (clobber (match_scratch:DI 4 "=r"))]
+ "TARGET_POWERPC64"
+ "rld%I2c%B3. %4,%1,%H2,%S3"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal6"
+ [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+ (compare:CC (and:DI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri"))
+ (match_operand:DI 3 "mask64_operand" "S"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+ "TARGET_POWERPC64"
+ "rld%I2c%B3. %0,%1,%H2,%S3"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal7"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (zero_extend:DI
+ (subreg:QI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
+ "TARGET_POWERPC64"
+ "rld%I2cl %0,%1,%H2,56")
+
+(define_insn "*rotldi3_internal8"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+ (compare:CC (zero_extend:DI
+ (subreg:QI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+ (const_int 0)))
+ (clobber (match_scratch:DI 3 "=r"))]
+ "TARGET_POWERPC64"
+ "rld%I2cl. %3,%1,%H2,56"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal9"
+ [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+ (compare:CC (zero_extend:DI
+ (subreg:QI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
+ "TARGET_POWERPC64"
+ "rld%I2cl. %0,%1,%H2,56"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal10"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (zero_extend:DI
+ (subreg:HI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
+ "TARGET_POWERPC64"
+ "rld%I2cl %0,%1,%H2,48")
+
+(define_insn "*rotldi3_internal11"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+ (compare:CC (zero_extend:DI
+ (subreg:HI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+ (const_int 0)))
+ (clobber (match_scratch:DI 3 "=r"))]
+ "TARGET_POWERPC64"
+ "rld%I2cl. %3,%1,%H2,48"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal12"
+ [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+ (compare:CC (zero_extend:DI
+ (subreg:HI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
+ "TARGET_POWERPC64"
+ "rld%I2cl. %0,%1,%H2,48"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal13"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (zero_extend:DI
+ (subreg:SI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
+ "TARGET_POWERPC64"
+ "rld%I2cl %0,%1,%H2,32")
+
+(define_insn "*rotldi3_internal14"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+ (compare:CC (zero_extend:DI
+ (subreg:SI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+ (const_int 0)))
+ (clobber (match_scratch:DI 3 "=r"))]
+ "TARGET_POWERPC64"
+ "rld%I2cl. %3,%1,%H2,32"
+ [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal15"
+ [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+ (compare:CC (zero_extend:DI
+ (subreg:SI
+ (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
+ "TARGET_POWERPC64"
+ "rld%I2cl. %0,%1,%H2,32"
+ [(set_attr "type" "delayed_compare")])
+
(define_expand "ashldi3"
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
@@ -4784,84 +4979,69 @@
[(set_attr "type" "delayed_compare")])
(define_insn "anddi3"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
- (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
- (match_operand:DI 2 "and_operand" "?r,K,J")))
- (clobber (match_scratch:CC 3 "=X,x,x"))]
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
+ (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
+ (match_operand:DI 2 "and64_operand" "?r,S,K,J")))
+ (clobber (match_scratch:CC 3 "=X,X,x,x"))]
"TARGET_POWERPC64"
"@
and %0,%1,%2
+ rldic%B2 %0,%1,0,%S2
andi. %0,%1,%b2
andis. %0,%1,%u2")
-(define_insn ""
- [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x")
- (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
- (match_operand:DI 2 "and_operand" "r,K,J"))
+(define_insn "*anddi3_internal2"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x")
+ (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
+ (match_operand:DI 2 "and64_operand" "r,K,J,S"))
(const_int 0)))
- (clobber (match_scratch:DI 3 "=r,r,r"))]
+ (clobber (match_scratch:DI 3 "=r,r,r,r"))]
"TARGET_POWERPC64"
"@
and. %3,%1,%2
andi. %3,%1,%b2
- andis. %3,%1,%u2"
- [(set_attr "type" "compare,compare,compare")])
+ andis. %3,%1,%u2
+ rldic%B2. %3,%1,0,%S2"
+ [(set_attr "type" "compare,compare,compare,delayed_compare")])
-(define_insn ""
- [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x")
- (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
- (match_operand:DI 2 "and_operand" "r,K,J"))
+(define_insn "*anddi3_internal3"
+ [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x")
+ (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
+ (match_operand:DI 2 "and64_operand" "r,K,J,S"))
(const_int 0)))
- (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
(and:DI (match_dup 1) (match_dup 2)))]
"TARGET_POWERPC64"
"@
and. %0,%1,%2
andi. %0,%1,%b2
- andis. %0,%1,%u2"
- [(set_attr "type" "compare,compare,compare")])
-
-;; Take a AND with a constant that cannot be done in a single insn and try to
-;; split it into two insns. This does not verify that the insns are valid
-;; since this need not be done as combine will do it.
+ andis. %0,%1,%u2
+ rldic%B2. %3,%1,0,%S2"
+ [(set_attr "type" "compare,compare,compare,delayed_compare")])
-(define_split
+(define_expand "iordi3"
[(set (match_operand:DI 0 "gpc_reg_operand" "")
- (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
- (match_operand:DI 2 "non_and_cint_operand" "")))]
+ (ior:DI (match_operand:DI 1 "gpc_reg_operand" "")
+ (match_operand:DI 2 "reg_or_cint_operand" "")))]
"TARGET_POWERPC64"
- [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 3)))
- (set (match_dup 0) (and:DI (match_dup 0) (match_dup 4)))]
"
{
- int maskval = INTVAL (operands[2]);
- int i, transitions, last_bit_value;
- int orig = maskval, first_c = maskval, second_c;
-
- /* We know that MASKVAL must have more than 2 bit-transitions. Start at
- the low-order bit and count for the third transition. When we get there,
- make a first mask that has everything to the left of that position
- a one. Then make the second mask to turn off whatever else is needed. */
-
- for (i = 1, transitions = 0, last_bit_value = maskval & 1; i < 32; i++)
+ if (GET_CODE (operands[2]) == CONST_INT
+ && !logical_operand (operands[2], DImode))
{
- if (((maskval >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
+ HOST_WIDE_INT value = INTVAL (operands[2]);
+ rtx tmp = ((reload_in_progress || reload_completed
+ || rtx_equal_p (operands[0], operands[1]))
+ ? operands[0] : gen_reg_rtx (DImode));
- if (transitions > 2)
- {
- first_c |= (~0) << i;
- break;
- }
+ emit_insn (gen_iordi3 (tmp, operands[1],
+ GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+ emit_insn (gen_iordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+ DONE;
}
-
- second_c = orig | ~ first_c;
-
- operands[3] = GEN_INT (first_c);
- operands[4] = GEN_INT (second_c);
}")
-(define_insn "iordi3"
+(define_insn "*iordi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
(ior:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
(match_operand:DI 2 "logical_operand" "r,K,J")))]
@@ -4871,7 +5051,7 @@
ori %0,%1,%b2
oris %0,%1,%u2")
-(define_insn ""
+(define_insn "*iordi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (ior:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -4881,7 +5061,7 @@
"or. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*iordi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (ior:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -4908,7 +5088,29 @@
operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
}")
-(define_insn "xordi3"
+(define_expand "xordi3"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "")
+ (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
+ (match_operand:DI 2 "reg_or_cint_operand" "")))]
+ "TARGET_POWERPC64"
+ "
+{
+ if (GET_CODE (operands[2]) == CONST_INT
+ && !logical_operand (operands[2], DImode))
+ {
+ HOST_WIDE_INT value = INTVAL (operands[2]);
+ rtx tmp = ((reload_in_progress || reload_completed
+ || rtx_equal_p (operands[0], operands[1]))
+ ? operands[0] : gen_reg_rtx (DImode));
+
+ emit_insn (gen_xordi3 (tmp, operands[1],
+ GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+ emit_insn (gen_xordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+ DONE;
+ }
+}")
+
+(define_insn "*xordi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
(xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
(match_operand:DI 2 "logical_operand" "r,K,J")))]
@@ -4918,7 +5120,7 @@
xori %0,%1,%b2
xoris %0,%1,%u2")
-(define_insn ""
+(define_insn "*xordi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -4928,7 +5130,7 @@
"xor. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*xordi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -4944,25 +5146,25 @@
(define_split
[(set (match_operand:DI 0 "gpc_reg_operand" "")
- (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
- (match_operand:DI 2 "non_logical_cint_operand" "")))]
+ (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
+ (match_operand:DI 2 "non_logical_cint_operand" "")))]
"TARGET_POWERPC64"
[(set (match_dup 0) (xor:DI (match_dup 1) (match_dup 3)))
(set (match_dup 0) (xor:DI (match_dup 0) (match_dup 4)))]
"
{
- operands[3] = GEN_INT (INTVAL (operands[2]) & 0xffff0000);
+ operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
}")
-(define_insn ""
+(define_insn "*eqvdi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(not:DI (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r"))))]
"TARGET_POWERPC64"
"eqv %0,%1,%2")
-(define_insn ""
+(define_insn "*eqvdi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (not:DI (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r")))
@@ -4972,7 +5174,7 @@
"eqv. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*eqvdi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (not:DI (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
(match_operand:DI 2 "gpc_reg_operand" "r")))
@@ -4983,14 +5185,14 @@
"eqv. %0,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*andcdi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
(match_operand:DI 2 "gpc_reg_operand" "r")))]
"TARGET_POWERPC64"
"andc %0,%2,%1")
-(define_insn ""
+(define_insn "*andcdi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -5000,7 +5202,7 @@
"andc. %3,%2,%1"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*andcdi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -5011,14 +5213,14 @@
"andc. %0,%2,%1"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*iorcdi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
(match_operand:DI 2 "gpc_reg_operand" "r")))]
"TARGET_POWERPC64"
"orc %0,%2,%1")
-(define_insn ""
+(define_insn "*iorcdi3_inernal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -5028,7 +5230,7 @@
"orc. %3,%2,%1"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*iorcdi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
(match_operand:DI 2 "gpc_reg_operand" "r"))
@@ -5039,14 +5241,14 @@
"orc. %0,%2,%1"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*nanddi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
(not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))))]
"TARGET_POWERPC64"
"nand %0,%1,%2")
-(define_insn ""
+(define_insn "*nanddi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
(not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
@@ -5056,7 +5258,7 @@
"nand. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*nanddi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
(not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
@@ -5067,14 +5269,14 @@
"nand. %0,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*nordi3_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
(not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))))]
"TARGET_POWERPC64"
"nor %0,%1,%2")
-(define_insn ""
+(define_insn "*nordi3_internal2"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
(not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
@@ -5084,7 +5286,7 @@
"nor. %3,%1,%2"
[(set_attr "type" "compare")])
-(define_insn ""
+(define_insn "*nordi3_internal3"
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
(not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
@@ -5105,14 +5307,14 @@
[(set (match_operand:SI 0 "register_operand" "=b")
(high:SI (match_operand 1 "" "")))]
"TARGET_ELF && !TARGET_64BIT"
- "{cau|addis} %0,0,%1@ha")
+ "{liu|lis} %0,%1@ha")
(define_insn "elf_low"
[(set (match_operand:SI 0 "register_operand" "=r")
(lo_sum:SI (match_operand:SI 1 "register_operand" "b")
(match_operand 2 "" "")))]
"TARGET_ELF && !TARGET_64BIT"
- "{cal %0,%a2@l(%1)|addi %0,%1,%2@l}")
+ "{cal|la} %0,%2@l(%1)")
;; Set up a register with a value from the GOT table
@@ -5203,7 +5405,7 @@
&& (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST)
&& small_data_operand (operands[1], SImode))
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
DONE;
}
@@ -5218,7 +5420,8 @@
&& !flag_pic
&& CONSTANT_P (operands[1])
&& GET_CODE (operands[1]) != HIGH
- && GET_CODE (operands[1]) != CONST_INT)
+ && GET_CODE (operands[1]) != CONST_INT
+ && GET_CODE (operands[1]) != CONSTANT_P_RTX)
{
rtx target = (reload_completed || reload_in_progress)
? operands[0] : gen_reg_rtx (SImode);
@@ -5233,7 +5436,7 @@
rtx new_ref;
while (*name == '.')
name++;
- new_ref = gen_rtx (SYMBOL_REF, Pmode, name);
+ new_ref = gen_rtx_SYMBOL_REF (Pmode, name);
CONSTANT_POOL_ADDRESS_P (new_ref) = CONSTANT_POOL_ADDRESS_P (operands[1]);
SYMBOL_REF_FLAG (new_ref) = SYMBOL_REF_FLAG (operands[1]);
SYMBOL_REF_USED (new_ref) = SYMBOL_REF_USED (operands[1]);
@@ -5266,12 +5469,13 @@
DONE;
}
else
- fatal_insn (\"bad address\", operands[1]);
+ rs6000_fatal_bad_address (operands[1]);
}
if ((!TARGET_WINDOWS_NT || DEFAULT_ABI != ABI_NT)
&& CONSTANT_P (operands[1])
&& GET_CODE (operands[1]) != CONST_INT
+ && GET_CODE (operands[1]) != CONSTANT_P_RTX
&& GET_CODE (operands[1]) != HIGH
&& ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1]))
{
@@ -5282,7 +5486,7 @@
This should not be done for operands that contain LABEL_REFs.
For now, we just handle the obvious case. */
if (GET_CODE (operands[1]) != LABEL_REF)
- emit_insn (gen_rtx (USE, VOIDmode, operands[1]));
+ emit_insn (gen_rtx_USE (VOIDmode, operands[1]));
/* If we are to limit the number of things we put in the TOC and
this is a symbol plus a constant we can add in one insn,
@@ -5312,14 +5516,12 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,r,m,r,r,r,r,r,*q,*c*l,*h")
- (match_operand:SI 1 "input_operand" "r,S,T,U,m,r,I,J,n,R,*h,r,r,0"))]
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h")
+ (match_operand:SI 1 "input_operand" "r,U,m,r,I,J,n,R,*h,r,r,0"))]
"gpc_reg_operand (operands[0], SImode)
|| gpc_reg_operand (operands[1], SImode)"
"@
mr %0,%1
- {l|lwz} %0,[toc]%1(2)
- {l|lwz} %0,[toc]%l1(2)
{cal|la} %0,%a1
{l%U1%X1|lwz%U1%X1} %0,%1
{st%U0%X0|stw%U0%X0} %1,%0
@@ -5331,8 +5533,8 @@
mt%0 %1
mt%0 %1
cror 0,0,0"
- [(set_attr "type" "*,load,load,*,load,store,*,*,*,*,*,*,mtjmpr,*")
- (set_attr "length" "4,4,4,4,4,4,4,4,8,4,4,4,4,4")])
+ [(set_attr "type" "*,*,load,store,*,*,*,*,*,*,mtjmpr,*")
+ (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4")])
;; Split a load of a large constant into the appropriate two-insn
;; sequence.
@@ -5371,7 +5573,9 @@
if (GET_CODE (operands[0]) != REG)
operands[1] = force_reg (HImode, operands[1]);
- if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT)
+ if (CONSTANT_P (operands[1])
+ && GET_CODE (operands[1]) != CONST_INT
+ && GET_CODE (operands[1]) != CONSTANT_P_RTX)
{
operands[1] = force_const_mem (HImode, operands[1]);
if (! memory_address_p (HImode, XEXP (operands[1], 0))
@@ -5406,7 +5610,9 @@
if (GET_CODE (operands[0]) != REG)
operands[1] = force_reg (QImode, operands[1]);
- if (CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != CONST_INT)
+ if (CONSTANT_P (operands[1])
+ && GET_CODE (operands[1]) != CONST_INT
+ && GET_CODE (operands[1]) != CONSTANT_P_RTX)
{
operands[1] = force_const_mem (QImode, operands[1]);
if (! memory_address_p (QImode, XEXP (operands[1], 0))
@@ -5485,7 +5691,8 @@
else if (TARGET_HARD_FLOAT)
{
- if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 32)
+ if (! TARGET_POWERPC64
+ && GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 32)
{
/* If this is a store to memory or another integer register do the
move directly. Otherwise store to a temporary stack slot and
@@ -5528,7 +5735,8 @@
operands[1] = force_reg (SFmode, operands[1]);
}
- if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) < 32)
+ if (! TARGET_POWERPC64
+ && GET_CODE (operands[0]) == REG && REGNO (operands[0]) < 32)
{
if (GET_CODE (operands[1]) == MEM
#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT && ! defined(REAL_IS_NOT_DOUBLE)
@@ -5567,7 +5775,7 @@
(define_split
[(set (match_operand:SF 0 "gpc_reg_operand" "")
(match_operand:SF 1 "const_double_operand" ""))]
- "TARGET_32BIT && reload_completed
+ "! TARGET_POWERPC64 && reload_completed
&& ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
|| (GET_CODE (operands[0]) == SUBREG
&& GET_CODE (SUBREG_REG (operands[0])) == REG
@@ -5585,6 +5793,27 @@
operands[3] = GEN_INT(l);
}")
+(define_split
+ [(set (match_operand:SF 0 "gpc_reg_operand" "")
+ (match_operand:SF 1 "const_double_operand" ""))]
+ "TARGET_POWERPC64 && reload_completed
+ && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) <= 31))"
+ [(set (match_dup 2) (match_dup 3))]
+ "
+{
+ long l;
+ REAL_VALUE_TYPE rv;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
+ REAL_VALUE_TO_TARGET_SINGLE (rv, l);
+
+ operands[2] = gen_lowpart (SImode, operands[0]);
+ operands[3] = GEN_INT(l);
+}")
+
(define_insn "*movsf_hardfloat"
[(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,!r,!r")
(match_operand:SF 1 "input_operand" "f,m,f,G,Fn"))]
@@ -5626,23 +5855,6 @@
if (GET_CODE (operands[0]) != REG)
operands[1] = force_reg (DFmode, operands[1]);
- /* Stores between FPR and any non-FPR registers must go through a
- temporary stack slot. */
-
- if (TARGET_POWERPC64
- && GET_CODE (operands[0]) == REG && GET_CODE (operands[1]) == REG
- && ((FP_REGNO_P (REGNO (operands[0]))
- && ! FP_REGNO_P (REGNO (operands[1])))
- || (FP_REGNO_P (REGNO (operands[1]))
- && ! FP_REGNO_P (REGNO (operands[0])))))
- {
- rtx stack_slot = assign_stack_temp (DFmode, 8, 0);
-
- emit_move_insn (stack_slot, operands[1]);
- emit_move_insn (operands[0], stack_slot);
- DONE;
- }
-
if (CONSTANT_P (operands[1]) && ! easy_fp_constant (operands[1], DFmode))
{
operands[1] = force_const_mem (DFmode, operands[1]);
@@ -5656,7 +5868,7 @@
(define_split
[(set (match_operand:DF 0 "gpc_reg_operand" "")
(match_operand:DF 1 "const_int_operand" ""))]
- "TARGET_32BIT && reload_completed
+ "! TARGET_POWERPC64 && reload_completed
&& ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
|| (GET_CODE (operands[0]) == SUBREG
&& GET_CODE (SUBREG_REG (operands[0])) == REG
@@ -5674,7 +5886,7 @@
(define_split
[(set (match_operand:DF 0 "gpc_reg_operand" "")
(match_operand:DF 1 "const_double_operand" ""))]
- "TARGET_32BIT && reload_completed
+ "! TARGET_POWERPC64 && reload_completed
&& ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
|| (GET_CODE (operands[0]) == SUBREG
&& GET_CODE (SUBREG_REG (operands[0])) == REG
@@ -5699,17 +5911,28 @@
(define_split
[(set (match_operand:DF 0 "gpc_reg_operand" "")
(match_operand:DF 1 "easy_fp_constant" ""))]
- "TARGET_64BIT && reload_completed
+ "TARGET_POWERPC64 && reload_completed
&& ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
|| (GET_CODE (operands[0]) == SUBREG
&& GET_CODE (SUBREG_REG (operands[0])) == REG
&& REGNO (SUBREG_REG (operands[0])) <= 31))"
- [(set (match_dup 2) (subreg:DI (match_dup 1) 0))]
+ [(set (match_dup 2) (match_dup 3))]
"
-{ operands[2] = gen_lowpart (DImode, operands[0]); }")
+{
+ int endian = (WORDS_BIG_ENDIAN == 0);
+ long l[2];
+ REAL_VALUE_TYPE rv;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
+ REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
+
+ operands[2] = gen_lowpart (DImode, operands[0]);
+ /* HIGHPART is lower memory address when WORDS_BIG_ENDIAN. */
+ operands[3] = immed_double_const (l[1 - endian], l[endian], DImode);
+}")
;; Don't have reload use general registers to load a constant. First,
-;; it might not work if the output operand has is the equivalent of
+;; it might not work if the output operand is the equivalent of
;; a non-offsettable memref, but also it is less efficient than loading
;; the constant into an FP register, since it will probably be used there.
;; The "??" is a kludge until we can figure out a more reasonable way
@@ -5724,6 +5947,8 @@
{
switch (which_alternative)
{
+ default:
+ abort ();
case 0:
/* We normally copy the low-numbered register first. However, if
the first register operand 0 is the same as the second register of
@@ -5760,8 +5985,8 @@
(set_attr "length" "8,8,8,8,12,16,*,*,*")])
(define_insn "*movdf_softfloat32"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,o,r,r,r")
- (match_operand:DF 1 "input_operand" "r,o,r,G,H,F"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
+ (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
"! TARGET_POWERPC64 && TARGET_SOFT_FLOAT
&& (register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode))"
@@ -5769,6 +5994,8 @@
{
switch (which_alternative)
{
+ default:
+ abort ();
case 0:
/* We normally copy the low-numbered register first. However, if
the first register operand 0 is the same as the second register of
@@ -5799,8 +6026,8 @@
(set_attr "length" "8,8,8,8,12,16")])
(define_insn "*movdf_hardfloat64"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,o,!r,!r,!r,f,f,m")
- (match_operand:DF 1 "input_operand" "r,o,r,G,H,F,f,m,f"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
+ (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
"TARGET_POWERPC64 && TARGET_HARD_FLOAT
&& (register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode))"
@@ -5818,8 +6045,8 @@
(set_attr "length" "4,4,4,8,12,16,4,4,4")])
(define_insn "*movdf_softfloat64"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,o,r,r,r")
- (match_operand:DF 1 "input_operand" "r,o,r,G,H,F"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
+ (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
"TARGET_POWERPC64 && TARGET_SOFT_FLOAT
&& (register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode))"
@@ -5844,77 +6071,75 @@
if (GET_CODE (operands[0]) != REG)
operands[1] = force_reg (DImode, operands[1]);
- if (TARGET_64BIT
- && (GET_CODE (operands[1]) == CONST_DOUBLE
- || GET_CODE (operands[1]) == CONST_INT))
- {
- HOST_WIDE_INT low;
- HOST_WIDE_INT high;
-
- if (GET_CODE (operands[1]) == CONST_DOUBLE)
- {
- low = CONST_DOUBLE_LOW (operands[1]);
- high = CONST_DOUBLE_HIGH (operands[1]);
- }
- else
+ /* Convert a move of a CONST_DOUBLE into a CONST_INT
+ only if sign-extended lower-half for 32-bit host. */
+ if (GET_CODE (operands[1]) == CONST_DOUBLE
#if HOST_BITS_PER_WIDE_INT == 32
- {
- low = INTVAL (operands[1]);
- high = (low < 0) ? ~0 : 0;
- }
-#else
- {
- low = INTVAL (operands[1]) & 0xffffffff;
- high = (HOST_WIDE_INT) INTVAL (operands[1]) >> 32;
- }
+ && ((CONST_DOUBLE_HIGH (operands[1]) == 0
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0)
+ || (CONST_DOUBLE_HIGH (operands[1]) == 0xffffffff
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0))
#endif
+ )
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
- if (high)
- {
- emit_move_insn (operands[0], GEN_INT (high));
- emit_insn (gen_ashldi3 (operands[0], operands[0], GEN_INT(32)));
- if (low)
- {
- HOST_WIDE_INT low_low = low & 0xffff;
- HOST_WIDE_INT low_high = low & (~ (HOST_WIDE_INT) 0xffff);
- if (low_high)
- emit_insn (gen_iordi3 (operands[0], operands[0],
- GEN_INT (low_high)));
- if (low_low)
- emit_insn (gen_iordi3 (operands[0], operands[0],
- GEN_INT (low_low)));
- }
- DONE;
- }
- }
+ if (TARGET_64BIT
+ && CONSTANT_P (operands[1])
+#if HOST_BITS_PER_WIDE_INT == 32
+ && GET_CODE (operands[1]) != CONST_INT
+ && GET_CODE (operands[1]) != CONSTANT_P_RTX
+#endif
+ && ! easy_fp_constant (operands[1], DImode)
+ && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1]))
+ {
+ /* Emit a USE operation so that the constant isn't deleted if
+ expensive optimizations are turned on because nobody
+ references it. This should only be done for operands that
+ contain SYMBOL_REFs with CONSTANT_POOL_ADDRESS_P set.
+ This should not be done for operands that contain LABEL_REFs.
+ For now, we just handle the obvious case. */
+ if (GET_CODE (operands[1]) != LABEL_REF)
+ emit_insn (gen_rtx_USE (VOIDmode, operands[1]));
- /* Stores between FPR and any non-FPR registers must go through a
- temporary stack slot. */
+ /* If we are to limit the number of things we put in the TOC and
+ this is a symbol plus a constant we can add in one insn,
+ just put the symbol in the TOC and add the constant. Don't do
+ this if reload is in progress. */
+ if (GET_CODE (operands[1]) == CONST
+ && TARGET_NO_SUM_IN_TOC && ! reload_in_progress
+ && GET_CODE (XEXP (operands[1], 0)) == PLUS
+ && add_operand (XEXP (XEXP (operands[1], 0), 1), DImode)
+ && (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF
+ || GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == SYMBOL_REF)
+ && ! side_effects_p (operands[0]))
+ {
+ rtx sym = force_const_mem (DImode, XEXP (XEXP (operands[1], 0), 0));
+ rtx other = XEXP (XEXP (operands[1], 0), 1);
- if (GET_CODE (operands[0]) == REG && GET_CODE (operands[1]) == REG
- && ((FP_REGNO_P (REGNO (operands[0]))
- && ! FP_REGNO_P (REGNO (operands[1])))
- || (FP_REGNO_P (REGNO (operands[1]))
- && ! FP_REGNO_P (REGNO (operands[0])))))
- {
- rtx stack_slot = assign_stack_temp (DImode, 8, 0);
+ emit_insn (gen_adddi3 (operands[0], force_reg (DImode, sym), other));
+ DONE;
+ }
- emit_move_insn (stack_slot, operands[1]);
- emit_move_insn (operands[0], stack_slot);
- DONE;
+ operands[1] = force_const_mem (DImode, operands[1]);
+ if (! memory_address_p (DImode, XEXP (operands[1], 0))
+ && ! reload_in_progress)
+ operands[1] = change_address (operands[1], DImode,
+ XEXP (operands[1], 0));
}
}")
(define_insn "*movdi_32"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
(match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
- "TARGET_32BIT
+ "! TARGET_POWERPC64
&& (gpc_reg_operand (operands[0], DImode)
|| gpc_reg_operand (operands[1], DImode))"
"*
{
switch (which_alternative)
{
+ default:
+ abort ();
case 0:
/* We normally copy the low-numbered register first. However, if
the first register operand 0 is the same as the second register of
@@ -5955,26 +6180,26 @@
(define_split
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(match_operand:DI 1 "const_int_operand" ""))]
- "TARGET_32BIT && reload_completed"
+ "! TARGET_POWERPC64 && reload_completed"
[(set (match_dup 2) (match_dup 4))
(set (match_dup 3) (match_dup 1))]
"
{
- operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
- operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+ operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+ operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
operands[4] = (INTVAL (operands[1]) & 0x80000000) ? constm1_rtx : const0_rtx;
}")
(define_split
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(match_operand:DI 1 "const_double_operand" ""))]
- "TARGET_32BIT && reload_completed"
+ "! TARGET_POWERPC64 && reload_completed"
[(set (match_dup 2) (match_dup 4))
(set (match_dup 3) (match_dup 5))]
"
{
- operands[2] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN == 0);
- operands[3] = gen_rtx (SUBREG, SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+ operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+ operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
}")
@@ -5982,7 +6207,7 @@
(define_insn "*movdi_64"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,f,f,m,r,*h,*h")
(match_operand:DI 1 "input_operand" "r,m,r,I,J,nF,R,f,m,f,*h,r,0"))]
- "TARGET_64BIT
+ "TARGET_POWERPC64
&& (gpc_reg_operand (operands[0], DImode)
|| gpc_reg_operand (operands[1], DImode))"
"@
@@ -6002,28 +6227,111 @@
[(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,*,mtjmpr,*")
(set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")])
-;; Split a load of a large constant into the appropriate five-instruction
-;; sequence. The expansion in movdi tries to perform the minimum number of
-;; steps, but here we have to handle anything in a constant number of insns.
+(define_insn ""
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (match_operand:DI 1 "const_double_operand" "F"))]
+ "TARGET_POWERPC64 && GET_CODE (operands[1]) == CONST_DOUBLE
+ && num_insns_constant (operands[1], DImode) == 1"
+ "*
+{
+ return ((unsigned HOST_WIDE_INT)
+ (CONST_DOUBLE_LOW (operands[1]) + 0x8000) < 0x10000)
+ ? \"li %0,%1\" : \"lis %0,%v1\";
+}")
+
+(define_split
+ [(set (match_operand:DI 0 "gpc_reg_operand" "")
+ (match_operand:DI 1 "const_int_operand" ""))]
+ "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+ && num_insns_constant (operands[1], DImode) > 1"
+ [(set (match_dup 0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (ior:DI (match_dup 0)
+ (match_dup 3)))]
+ "
+{
+ operands[2] = GEN_INT (INTVAL (operands[1]) & 0xffff0000);
+ operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
+}")
(define_split
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(match_operand:DI 1 "const_double_operand" ""))]
- "TARGET_64BIT && num_insns_constant (operands[1], DImode) > 1"
+ "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && ((CONST_DOUBLE_HIGH (operands[1]) == 0
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0)
+ || (CONST_DOUBLE_HIGH (operands[1]) == 0xffffffff
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0))"
[(set (match_dup 0)
(match_dup 2))
(set (match_dup 0)
(ior:DI (match_dup 0)
- (match_dup 3)))
+ (match_dup 3)))]
+ "
+{
+ operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xffff0000);
+ operands[3] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xffff);
+}")
+
+(define_split
+ [(set (match_operand:DI 0 "gpc_reg_operand" "")
+ (match_operand:DI 1 "const_double_operand" ""))]
+ "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && CONST_DOUBLE_HIGH (operands[1]) == 0
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0"
+ [(set (match_dup 0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (zero_extend:DI (subreg:SI (match_dup 0) 0)))]
+ "
+{ operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); }")
+
+(define_split
+ [(set (match_operand:DI 0 "gpc_reg_operand" "")
+ (match_operand:DI 1 "const_double_operand" ""))]
+ "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && CONST_DOUBLE_LOW (operands[1]) == 0"
+ [(set (match_dup 0)
+ (match_dup 2))
(set (match_dup 0)
(ashift:DI (match_dup 0)
- (const_int 32)))
+ (const_int 32)))]
+ "
+{ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); }")
+
+;; Generate all one-bits and clear left or right.
+;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
+(define_split
+ [(set (match_operand:DI 0 "gpc_reg_operand" "")
+ (match_operand:DI 1 "mask64_operand" ""))]
+ "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
+ [(set (match_dup 0) (const_int -1))
(set (match_dup 0)
- (ior:DI (match_dup 0)
- (match_dup 4)))
+ (and:DI (rotate:DI (match_dup 0)
+ (const_int 0))
+ (match_dup 1)))]
+ "")
+
+;; Split a load of a large constant into the appropriate five-instruction
+;; sequence. Handle anything in a constant number of insns.
+;; When non-easy constants can go in the TOC, this should use
+;; easy_fp_constant predicate.
+(define_split
+ [(set (match_operand:DI 0 "gpc_reg_operand" "")
+ (match_operand:DI 1 "const_double_operand" ""))]
+ "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
+ [(set (match_dup 0)
+ (match_dup 2))
+ (set (match_dup 0)
+ (ashift:DI (match_dup 0)
+ (const_int 32)))
(set (match_dup 0)
(ior:DI (match_dup 0)
- (match_dup 5)))]
+ (match_dup 3)))]
"
{
HOST_WIDE_INT low;
@@ -6047,14 +6355,8 @@
}
#endif
- if ((high + 0x8000) < 0x10000
- && ((low & 0xffff) == 0 || (low & (~ (HOST_WIDE_INT) 0xffff)) == 0))
- FAIL;
-
- operands[2] = GEN_INT (high & (~ (HOST_WIDE_INT) 0xffff));
- operands[3] = GEN_INT (high & 0xffff);
- operands[4] = GEN_INT (low & (~ (HOST_WIDE_INT) 0xffff));
- operands[5] = GEN_INT (low & 0xffff);
+ operands[2] = GEN_INT (high);
+ operands[3] = GEN_INT (low);
}")
(define_insn ""
@@ -6097,7 +6399,7 @@
;; while the 2nd alternative would not. We put memory cases first so they
;; are preferred. Otherwise, we'd try to reload the output instead of
;; giving the SCRATCH mq.
-(define_insn ""
+(define_insn "*movti_power"
[(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
(match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
(clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))]
@@ -6151,7 +6453,7 @@
[(set_attr "type" "store,store,*,load,load")
(set_attr "length" "*,16,16,*,16")])
-(define_insn ""
+(define_insn "*movti_string"
[(set (match_operand:TI 0 "reg_or_mem_operand" "=m,????r,????r")
(match_operand:TI 1 "reg_or_mem_operand" "r,r,m"))
(clobber (match_scratch:SI 2 "=X,X,X"))]
@@ -6196,7 +6498,7 @@
[(set_attr "type" "store,*,load")
(set_attr "length" "16,16,16")])
-(define_insn ""
+(define_insn "*movti_ppc64"
[(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m")
(match_operand:TI 1 "input_operand" "r,m,r"))]
"TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode)
@@ -6205,6 +6507,8 @@
{
switch (which_alternative)
{
+ default:
+ abort ();
case 0:
/* We normally copy the low-numbered register first. However, if
the first register operand 0 is the same as the second register of
@@ -6256,12 +6560,12 @@
count = INTVAL (operands[2]);
regno = REGNO (operands[0]);
- operands[3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count));
+ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
from = force_reg (SImode, XEXP (operands[1], 0));
for (i = 0; i < count; i++)
XVECEXP (operands[3], 0, i)
- = gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, regno + i),
+ = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
change_address (operands[1], SImode,
plus_constant (from, i * 4)));
}")
@@ -6297,7 +6601,7 @@
else if (i == 0)
{
xop[0] = operands[1];
- xop[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+ xop[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
xop[2] = GEN_INT (4 * (words-1));
output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop);
return \"\";
@@ -6307,7 +6611,7 @@
for (j = 0; j < words; j++)
if (j != i)
{
- xop[0] = gen_rtx (REG, SImode, REGNO (operands[1]) + j);
+ xop[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + j);
xop[1] = operands[2];
xop[2] = GEN_INT (j * 4);
output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop);
@@ -6352,21 +6656,21 @@
count = INTVAL (operands[2]);
regno = REGNO (operands[1]);
- operands[3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count + 1));
+ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
to = force_reg (SImode, XEXP (operands[0], 0));
XVECEXP (operands[3], 0, 0)
- = gen_rtx (SET, VOIDmode, change_address (operands[0], SImode, to),
+ = gen_rtx_SET (VOIDmode, change_address (operands[0], SImode, to),
operands[1]);
- XVECEXP (operands[3], 0, 1) = gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (SCRATCH, SImode));
+ XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_SCRATCH (SImode));
for (i = 1; i < count; i++)
XVECEXP (operands[3], 0, i + 1)
- = gen_rtx (SET, VOIDmode,
+ = gen_rtx_SET (VOIDmode,
change_address (operands[0], SImode,
plus_constant (to, i * 4)),
- gen_rtx (REG, SImode, regno + i));
+ gen_rtx_REG (SImode, regno + i));
}")
(define_insn ""
@@ -6919,14 +7223,14 @@
;; We move the back-chain and decrement the stack pointer.
(define_expand "allocate_stack"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (reg:SI 1) (match_operand:SI 1 "reg_or_short_operand" "")))
- (set (reg:SI 1)
- (minus:SI (reg:SI 1) (match_dup 1)))]
+ [(set (match_operand 0 "register_operand" "=r")
+ (minus (reg 1) (match_operand 1 "reg_or_short_operand" "")))
+ (set (reg 1)
+ (minus (reg 1) (match_dup 1)))]
""
"
{ rtx chain = gen_reg_rtx (Pmode);
- rtx stack_bot = gen_rtx (MEM, Pmode, stack_pointer_rtx);
+ rtx stack_bot = gen_rtx_MEM (Pmode, stack_pointer_rtx);
rtx neg_op0;
emit_move_insn (chain, stack_bot);
@@ -6937,9 +7241,9 @@
if (DEFAULT_ABI == ABI_NT
&& (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) > 4096))
{
- rtx tmp = gen_reg_rtx (SImode);
- emit_library_call_value (gen_rtx (SYMBOL_REF, Pmode, \"__allocate_stack\"),
- tmp, 0, SImode, 1, operands[1], Pmode);
+ rtx tmp = gen_reg_rtx (Pmode);
+ emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__allocate_stack\"),
+ tmp, 0, Pmode, 1, operands[1], Pmode);
emit_insn (gen_set_sp (tmp));
emit_move_insn (operands[0], tmp);
DONE;
@@ -6966,9 +7270,7 @@
{
emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3))
(stack_pointer_rtx, stack_pointer_rtx, neg_op0));
- emit_move_insn (gen_rtx (MEM, (TARGET_32BIT) ? SImode : DImode,
- stack_pointer_rtx),
- chain);
+ emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain);
}
emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
@@ -7005,40 +7307,48 @@
"")
(define_expand "restore_stack_block"
- [(set (match_dup 2) (mem:SI (match_operand:SI 0 "register_operand" "")))
- (set (match_dup 0) (match_operand:SI 1 "register_operand" ""))
- (set (mem:SI (match_dup 0)) (match_dup 2))]
+ [(use (match_operand 0 "register_operand" ""))
+ (set (match_dup 2) (match_dup 3))
+ (set (match_dup 0) (match_operand 1 "register_operand" ""))
+ (set (match_dup 3) (match_dup 2))]
""
"
-{ operands[2] = gen_reg_rtx (SImode); }")
+{
+ operands[2] = gen_reg_rtx (Pmode);
+ operands[3] = gen_rtx_MEM (Pmode, operands[0]);
+}")
(define_expand "save_stack_nonlocal"
- [(match_operand:DI 0 "memory_operand" "")
- (match_operand:SI 1 "register_operand" "")]
+ [(match_operand 0 "memory_operand" "")
+ (match_operand 1 "register_operand" "")]
""
"
{
- rtx temp = gen_reg_rtx (SImode);
+ rtx temp = gen_reg_rtx (Pmode);
/* Copy the backchain to the first word, sp to the second. */
- emit_move_insn (temp, gen_rtx (MEM, SImode, operands[1]));
- emit_move_insn (operand_subword (operands[0], 0, 0, DImode), temp);
- emit_move_insn (operand_subword (operands[0], 1, 0, DImode), operands[1]);
+ emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
+ emit_move_insn (operand_subword (operands[0], 0, 0, (TARGET_32BIT ? DImode : TImode)),
+ temp);
+ emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)),
+ operands[1]);
DONE;
}")
(define_expand "restore_stack_nonlocal"
- [(match_operand:SI 0 "register_operand" "")
- (match_operand:DI 1 "memory_operand" "")]
+ [(match_operand 0 "register_operand" "")
+ (match_operand 1 "memory_operand" "")]
""
"
{
- rtx temp = gen_reg_rtx (SImode);
+ rtx temp = gen_reg_rtx (Pmode);
/* Restore the backchain from the first word, sp from the second. */
- emit_move_insn (temp, operand_subword (operands[1], 0, 0, DImode));
- emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, DImode));
- emit_move_insn (gen_rtx (MEM, SImode, operands[0]), temp);
+ emit_move_insn (temp,
+ operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode)));
+ emit_move_insn (operands[0],
+ operand_subword (operands[1], 1, 0, (TARGET_32BIT ? DImode : TImode)));
+ emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
DONE;
}")
@@ -7070,7 +7380,7 @@
;; We do not break this into separate insns, so that the scheduler will not try
;; to move the load of the new TOC before any loads from the TOC.
-(define_insn "call_indirect_aix"
+(define_insn "call_indirect_aix32"
[(call (mem:SI (match_operand:SI 0 "register_operand" "b"))
(match_operand 1 "const_int_operand" "n"))
(use (match_operand 2 "const_int_operand" "n"))
@@ -7085,7 +7395,22 @@
[(set_attr "type" "load")
(set_attr "length" "28")])
-(define_insn "call_value_indirect_aix"
+(define_insn "call_indirect_aix64"
+ [(call (mem:SI (match_operand:DI 0 "register_operand" "b"))
+ (match_operand 1 "const_int_operand" "n"))
+ (use (match_operand 2 "const_int_operand" "n"))
+ (use (match_operand 3 "offsettable_addr_operand" "p"))
+ (use (match_operand 4 "register_operand" "r"))
+ (clobber (match_operand 5 "register_operand" "=r"))
+ (clobber (match_scratch:SI 6 "=&r"))
+ (clobber (match_scratch:SI 7 "=l"))]
+ "TARGET_64BIT && DEFAULT_ABI == ABI_AIX
+ && (INTVAL (operands[2]) == CALL_NORMAL || (INTVAL (operands[2]) & CALL_LONG) != 0)"
+ "std %4,%a3\;ld %6,0(%0)\;ld %4,8(%0)\;mt%7 %6\;ld %5,16(%0)\;blrl\;ld %4,%a3"
+ [(set_attr "type" "load")
+ (set_attr "length" "28")])
+
+(define_insn "call_value_indirect_aix32"
[(set (match_operand 0 "register_operand" "fg")
(call (mem:SI (match_operand:SI 1 "register_operand" "b"))
(match_operand 2 "const_int_operand" "n")))
@@ -7097,7 +7422,23 @@
(clobber (match_scratch:SI 8 "=l"))]
"DEFAULT_ABI == ABI_AIX
&& (INTVAL (operands[3]) == CALL_NORMAL || (INTVAL (operands[3]) & CALL_LONG) != 0)"
- "{st|stw} %5,%a4\;{l|lwz} %7,0(%1)\;{l|lwz} %5,4(%1);\;mt%8 %7\;{l|lwz} %6,8(%1)\;{brl|blrl}\;{l|lwz} %5,%a4"
+ "{st|stw} %5,%a4\;{l|lwz} %7,0(%1)\;{l|lwz} %5,4(%1)\;mt%8 %7\;{l|lwz} %6,8(%1)\;{brl|blrl}\;{l|lwz} %5,%a4"
+ [(set_attr "type" "load")
+ (set_attr "length" "28")])
+
+(define_insn "call_value_indirect_aix64"
+ [(set (match_operand 0 "register_operand" "fg")
+ (call (mem:SI (match_operand:DI 1 "register_operand" "b"))
+ (match_operand 2 "const_int_operand" "n")))
+ (use (match_operand 3 "const_int_operand" "n"))
+ (use (match_operand 4 "offsettable_addr_operand" "p"))
+ (use (match_operand 5 "register_operand" "r"))
+ (clobber (match_operand 6 "register_operand" "=r"))
+ (clobber (match_scratch:SI 7 "=&r"))
+ (clobber (match_scratch:SI 8 "=l"))]
+ "TARGET_64BIT && DEFAULT_ABI == ABI_AIX
+ && (INTVAL (operands[3]) == CALL_NORMAL || (INTVAL (operands[3]) & CALL_LONG) != 0)"
+ "std %5,%a4\;ld %7,0(%1)\;ld %5,8(%1)\;mt%8 %7\;ld %6,16(%1)\;blrl\;ld %5,%a4"
[(set_attr "type" "load")
(set_attr "length" "28")])
@@ -7190,7 +7531,7 @@
;; Now the definitions for the call and call_value insns
(define_expand "call"
- [(parallel [(call (mem:SI (match_operand:SI 0 "address_operand" ""))
+ [(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))
(clobber (scratch:SI))])]
@@ -7221,16 +7562,20 @@
operands[1], operands[2]));
else
{
- rtx toc_reg = gen_rtx (REG, Pmode, 2);
+ rtx toc_reg = gen_rtx_REG (Pmode, 2);
rtx toc_addr = RS6000_SAVE_TOC;
if (DEFAULT_ABI == ABI_AIX)
{
/* AIX function pointers are really pointers to a three word area */
- rtx static_chain = gen_rtx (REG, Pmode, STATIC_CHAIN_REGNUM);
- emit_call_insn (gen_call_indirect_aix (force_reg (Pmode, operands[0]),
- operands[1], operands[2],
- toc_addr, toc_reg, static_chain));
+ rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
+ emit_call_insn (TARGET_32BIT
+ ? gen_call_indirect_aix32 (force_reg (Pmode, operands[0]),
+ operands[1], operands[2],
+ toc_addr, toc_reg, static_chain)
+ : gen_call_indirect_aix64 (force_reg (Pmode, operands[0]),
+ operands[1], operands[2],
+ toc_addr, toc_reg, static_chain));
}
else if (DEFAULT_ABI == ABI_NT)
{
@@ -7248,7 +7593,7 @@
(define_expand "call_value"
[(parallel [(set (match_operand 0 "" "")
- (call (mem:SI (match_operand:SI 1 "address_operand" ""))
+ (call (mem:SI (match_operand 1 "address_operand" ""))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
(clobber (scratch:SI))])]
@@ -7279,17 +7624,22 @@
operands[2], operands[3]));
else
{
- rtx toc_reg = gen_rtx (REG, Pmode, 2);
+ rtx toc_reg = gen_rtx_REG (Pmode, 2);
rtx toc_addr = RS6000_SAVE_TOC;
if (DEFAULT_ABI == ABI_AIX)
{
/* AIX function pointers are really pointers to a three word area */
- rtx static_chain = gen_rtx (REG, Pmode, STATIC_CHAIN_REGNUM);
- emit_call_insn (gen_call_value_indirect_aix (operands[0],
- force_reg (Pmode, operands[1]),
- operands[2], operands[3],
- toc_addr, toc_reg, static_chain));
+ rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
+ emit_call_insn (TARGET_32BIT
+ ? gen_call_value_indirect_aix32 (operands[0],
+ force_reg (Pmode, operands[1]),
+ operands[2], operands[3],
+ toc_addr, toc_reg, static_chain)
+ : gen_call_value_indirect_aix64 (operands[0],
+ force_reg (Pmode, operands[1]),
+ operands[2], operands[3],
+ toc_addr, toc_reg, static_chain));
}
else if (DEFAULT_ABI == ABI_NT)
{
@@ -7312,7 +7662,7 @@
;; variable argument function. It is > 0 if FP registers were passed
;; and < 0 if they were not.
-(define_insn ""
+(define_insn "*call_local32"
[(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
@@ -7331,6 +7681,66 @@
[(set_attr "type" "branch")
(set_attr "length" "4,8")])
+(define_insn "*call_local64"
+ [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
+ (match_operand 1 "" "g,g"))
+ (use (match_operand:SI 2 "immediate_operand" "O,n"))
+ (clobber (match_scratch:SI 3 "=l,l"))]
+ "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
+ "*
+{
+ if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+ output_asm_insn (\"crxor 6,6,6\", operands);
+
+ else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+ output_asm_insn (\"creqv 6,6,6\", operands);
+
+ return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
+}"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4,8")])
+
+(define_insn "*ret_call_local32"
+ [(set (match_operand 0 "" "=fg,fg")
+ (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
+ (match_operand 2 "" "g,g")))
+ (use (match_operand:SI 3 "immediate_operand" "O,n"))
+ (clobber (match_scratch:SI 4 "=l,l"))]
+ "(INTVAL (operands[3]) & CALL_LONG) == 0"
+ "*
+{
+ if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+ output_asm_insn (\"crxor 6,6,6\", operands);
+
+ else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+ output_asm_insn (\"creqv 6,6,6\", operands);
+
+ return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
+}"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4,8")])
+
+
+(define_insn "*ret_call_local64"
+ [(set (match_operand 0 "" "=fg,fg")
+ (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
+ (match_operand 2 "" "g,g")))
+ (use (match_operand:SI 3 "immediate_operand" "O,n"))
+ (clobber (match_scratch:SI 4 "=l,l"))]
+ "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
+ "*
+{
+ if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+ output_asm_insn (\"crxor 6,6,6\", operands);
+
+ else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+ output_asm_insn (\"creqv 6,6,6\", operands);
+
+ return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
+}"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4,8")])
+
;; Call to function which may be in another module. Restore the TOC
;; pointer (r2) after the call unless this is System V.
;; Operand2 is non-zero if we are using the V.4 calling sequence and
@@ -7338,7 +7748,7 @@
;; variable argument function. It is > 0 if FP registers were passed
;; and < 0 if they were not.
-(define_insn ""
+(define_insn "*call_nonlocal_aix32"
[(call (mem:SI (match_operand:SI 0 "call_operand" "s,s"))
(match_operand 1 "" "fg,fg"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
@@ -7362,7 +7772,31 @@
[(set_attr "type" "branch")
(set_attr "length" "8,12")])
-(define_insn ""
+(define_insn "*call_nonlocal_aix64"
+ [(call (mem:SI (match_operand:DI 0 "call_operand" "s,s"))
+ (match_operand 1 "" "fg,fg"))
+ (use (match_operand:SI 2 "immediate_operand" "O,n"))
+ (clobber (match_scratch:SI 3 "=l,l"))]
+ "TARGET_64BIT && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+ && (INTVAL (operands[2]) & CALL_LONG) == 0"
+ "*
+{
+ /* Indirect calls should go through call_indirect */
+ if (GET_CODE (operands[0]) == REG)
+ abort ();
+
+ if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+ output_asm_insn (\"crxor 6,6,6\", operands);
+
+ else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+ output_asm_insn (\"creqv 6,6,6\", operands);
+
+ return (TARGET_WINDOWS_NT) ? \"bl %z0\;.znop %z0\" : \"bl %z0\;%.\";
+}"
+ [(set_attr "type" "branch")
+ (set_attr "length" "8,12")])
+
+(define_insn "*call_nonlocal_sysv"
[(call (mem:SI (match_operand:SI 0 "call_operand" "s,s"))
(match_operand 1 "" "fg,fg"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
@@ -7386,33 +7820,38 @@
[(set_attr "type" "branch")
(set_attr "length" "4,8")])
-(define_insn ""
+(define_insn "*ret_call_nonlocal_aix32"
[(set (match_operand 0 "" "=fg,fg")
- (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
- (match_operand 2 "" "g,g")))
+ (call (mem:SI (match_operand:SI 1 "call_operand" "s,s"))
+ (match_operand 2 "" "fg,fg")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 4 "=l,l"))]
- "(INTVAL (operands[3]) & CALL_LONG) == 0"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+ && (INTVAL (operands[3]) & CALL_LONG) == 0"
"*
{
+ /* This should be handled by call_value_indirect */
+ if (GET_CODE (operands[1]) == REG)
+ abort ();
+
if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
output_asm_insn (\"crxor 6,6,6\", operands);
else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn (\"creqv 6,6,6\", operands);
- return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
+ return (TARGET_WINDOWS_NT) ? \"bl %z1\;.znop %z1\" : \"bl %z1\;%.\";
}"
[(set_attr "type" "branch")
- (set_attr "length" "4,8")])
+ (set_attr "length" "8,12")])
-(define_insn ""
+(define_insn "*ret_call_nonlocal_aix64"
[(set (match_operand 0 "" "=fg,fg")
- (call (mem:SI (match_operand:SI 1 "call_operand" "s,s"))
+ (call (mem:SI (match_operand:DI 1 "call_operand" "s,s"))
(match_operand 2 "" "fg,fg")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 4 "=l,l"))]
- "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+ "TARGET_64BIT && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
&& (INTVAL (operands[3]) & CALL_LONG) == 0"
"*
{
@@ -7431,7 +7870,7 @@
[(set_attr "type" "branch")
(set_attr "length" "8,12")])
-(define_insn ""
+(define_insn "*ret_call_nonlocal_sysv"
[(set (match_operand 0 "" "=fg,fg")
(call (mem:SI (match_operand:SI 1 "call_operand" "s,s"))
(match_operand 2 "" "fg,fg")))
@@ -7581,7 +8020,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7596,7 +8035,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7611,7 +8050,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7626,7 +8065,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7641,7 +8080,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7656,7 +8095,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7670,7 +8109,7 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7684,7 +8123,7 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7698,7 +8137,7 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7712,7 +8151,7 @@
(pc)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7729,7 +8168,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7743,7 +8182,7 @@
{ if (! rs6000_compare_fp_p)
FAIL;
- operands[1] = gen_rtx (COMPARE, CCFPmode,
+ operands[1] = gen_rtx_COMPARE (CCFPmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCFPmode);
}")
@@ -7760,7 +8199,7 @@
if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
FAIL;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7777,7 +8216,7 @@
if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
FAIL;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7789,7 +8228,7 @@
""
"
{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7806,7 +8245,7 @@
if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
FAIL;
- operands[1] = gen_rtx (COMPARE, mode,
+ operands[1] = gen_rtx_COMPARE (mode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (mode);
}")
@@ -7817,7 +8256,7 @@
(gtu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7828,7 +8267,7 @@
(ltu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7839,7 +8278,7 @@
(geu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -7850,7 +8289,7 @@
(leu:SI (match_dup 2) (const_int 0)))]
""
"
-{ operands[1] = gen_rtx (COMPARE, CCUNSmode,
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
rs6000_compare_op0, rs6000_compare_op1);
operands[2] = gen_reg_rtx (CCUNSmode);
}")
@@ -8139,6 +8578,20 @@
[(set_attr "length" "12,8,12,12,12")])
(define_insn ""
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
+ (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
+ (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
+ (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
+ "TARGET_POWERPC64"
+ "@
+ xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0
+ subfic %3,%1,0\;adde %0,%3,%1
+ xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0
+ xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0
+ subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0"
+ [(set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
[(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x")
(compare:CC
(eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
@@ -8157,6 +8610,25 @@
[(set_attr "type" "compare")
(set_attr "length" "12,8,12,12,12")])
+(define_insn ""
+ [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x")
+ (compare:CC
+ (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
+ (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
+ (eq:DI (match_dup 1) (match_dup 2)))
+ (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
+ "TARGET_POWERPC64"
+ "@
+ xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
+ subfic %3,%1,0\;adde. %0,%3,%1
+ xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0
+ xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0
+ subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "12,8,12,12,12")])
+
;; We have insns of the form shown by the first define_insn below. If
;; there is something inside the comparison operation, we must split it.
(define_split
@@ -8242,8 +8714,8 @@
;; Simplify (ne X (const_int 0)) on the PowerPC. No need to on the Power,
;; since it nabs/sr is just as fast.
-(define_insn ""
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+(define_insn "*ne0"
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
(lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
(const_int 31)))
(clobber (match_scratch:SI 2 "=&r"))]
@@ -8251,6 +8723,15 @@
"{ai|addic} %2,%1,-1\;{sfe|subfe} %0,%2,%1"
[(set_attr "length" "8")])
+(define_insn ""
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+ (const_int 63)))
+ (clobber (match_scratch:DI 2 "=&r"))]
+ "TARGET_POWERPC64"
+ "addic %2,%1,-1\;subfe %0,%2,%1"
+ [(set_attr "length" "8")])
+
;; This is what (plus (ne X (const_int 0)) Y) looks like.
(define_insn ""
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
@@ -8264,6 +8745,17 @@
[(set_attr "length" "8")])
(define_insn ""
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (plus:DI (lshiftrt:DI
+ (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+ (const_int 63))
+ (match_operand:DI 2 "gpc_reg_operand" "r")))
+ (clobber (match_scratch:DI 3 "=&r"))]
+ "TARGET_POWERPC64"
+ "addic %3,%1,-1\;addze %0,%2"
+ [(set_attr "length" "8")])
+
+(define_insn ""
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(compare:CC
(plus:SI (lshiftrt:SI
@@ -8278,6 +8770,20 @@
(set_attr "length" "8")])
(define_insn ""
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+ (compare:CC
+ (plus:DI (lshiftrt:DI
+ (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+ (const_int 63))
+ (match_operand:DI 2 "gpc_reg_operand" "r"))
+ (const_int 0)))
+ (clobber (match_scratch:DI 3 "=&r"))]
+ "TARGET_POWERPC64"
+ "addic %3,%1,-1\;addze. %3,%2"
+ [(set_attr "type" "compare")
+ (set_attr "length" "8")])
+
+(define_insn ""
[(set (match_operand:CC 4 "cc_reg_operand" "=x")
(compare:CC
(plus:SI (lshiftrt:SI
@@ -8295,6 +8801,23 @@
(set_attr "length" "8")])
(define_insn ""
+ [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+ (compare:CC
+ (plus:DI (lshiftrt:DI
+ (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+ (const_int 63))
+ (match_operand:DI 2 "gpc_reg_operand" "r"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
+ (match_dup 2)))
+ (clobber (match_scratch:DI 3 "=&r"))]
+ "TARGET_POWERPC64"
+ "addic %3,%1,-1\;addze. %0,%2"
+ [(set_attr "type" "compare")
+ (set_attr "length" "8")])
+
+(define_insn ""
[(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
(match_operand:SI 2 "reg_or_short_operand" "r,O")))
@@ -9202,7 +9725,7 @@
""
"
{ operands[0] = force_reg (SImode, operands[0]);
- operands[2] = force_reg (SImode, gen_rtx (LABEL_REF, VOIDmode, operands[1]));
+ operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (VOIDmode, operands[1]));
operands[3] = gen_reg_rtx (SImode);
}")
@@ -9215,7 +9738,7 @@
""
"
{ operands[0] = force_reg (DImode, operands[0]);
- operands[2] = force_reg (DImode, gen_rtx (LABEL_REF, VOIDmode, operands[1]));
+ operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (VOIDmode, operands[1]));
operands[3] = gen_reg_rtx (DImode);
}")
@@ -9465,3 +9988,25 @@
"
{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
const0_rtx); }")
+
+(define_insn "trap"
+ [(trap_if (const_int 1) (const_int 0))]
+ ""
+ "{t 31,0,0|trap}")
+
+(define_expand "conditional_trap"
+ [(trap_if (match_operator 0 "trap_comparison_operator"
+ [(match_dup 2) (match_dup 3)])
+ (match_operand 1 "const_int_operand" ""))]
+ ""
+ "if (rs6000_compare_fp_p || operands[1] != const0_rtx) FAIL;
+ operands[2] = rs6000_compare_op0;
+ operands[3] = rs6000_compare_op1;")
+
+(define_insn ""
+ [(trap_if (match_operator 0 "trap_comparison_operator"
+ [(match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "reg_or_short_operand" "rI")])
+ (const_int 0))]
+ ""
+ "t%V0%I2 %1,%2")
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index 83073b072e7..bf14072f0d3 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -32,4 +32,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_MEM_FUNCTIONS
#endif
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "crt0.o%s"
+
/* end of rs6000/rtems.h */
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 9cbb597b8b5..2b7e1ed4b48 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -266,7 +266,17 @@ do { \
/* Default ABI to compile code for */
#define DEFAULT_ABI rs6000_current_abi
-#include "rs6000/powerpc.h"
+#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
+
+#define ASM_DEFAULT_SPEC "-mppc"
+
+#include "rs6000/rs6000.h"
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
+
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_PPC601
/* System V.4 uses register 13 as a pointer to the small data area,
so it is not available to the normal user. */
@@ -331,6 +341,7 @@ do { \
/* Put jump tables in read-only memory, rather than in .text. */
#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
/* Disable AIX-ism that disables turning -B into -L if the argument specifies a
relative file name. This breaks setting GCC_EXEC_PREFIX to D:\path under
@@ -409,21 +420,21 @@ do { \
/* Use ELF style section commands. */
#undef TEXT_SECTION_ASM_OP
-#define TEXT_SECTION_ASM_OP "\t.section \".text\""
+#define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
#undef DATA_SECTION_ASM_OP
-#define DATA_SECTION_ASM_OP "\t.section \".data\""
+#define DATA_SECTION_ASM_OP "\t.section\t\".data\""
#undef BSS_SECTION_ASM_OP
-#define BSS_SECTION_ASM_OP "\t.section \".bss\""
+#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
#undef INIT_SECTION_ASM_OP
-#define INIT_SECTION_ASM_OP "\t.section \".init\",\"ax\""
+#define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
#undef FINI_SECTION_ASM_OP
-#define FINI_SECTION_ASM_OP "\t.section \".fini\",\"ax\""
+#define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
-#define TOC_SECTION_ASM_OP "\t.section \".got\",\"aw\""
+#define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
/* Put PC relative got entries in .got2 */
#define MINIMAL_TOC_SECTION_ASM_OP \
@@ -435,10 +446,10 @@ do { \
((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
-#define SDATA_SECTION_ASM_OP "\t.section \".sdata\",\"aw\""
-#define SDATA2_SECTION_ASM_OP "\t.section \".sdata2\",\"a\""
+#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
+#define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
#define SBSS_SECTION_ASM_OP \
- ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section \".sbss\",\"aw\"" : "\t.section \".sbss\",\"aw\",@nobits")
+ ((DEFAULT_ABI == ABI_SOLARIS) ? "\t.section\t\".sbss\",\"aw\"" : "\t.section\t\".sbss\",\"aw\",@nobits")
/* Besides the usual ELF sections, we need a toc section. */
@@ -771,7 +782,7 @@ do { \
fprintf (FILE, "\t.long ("); \
output_addr_const (FILE, (VALUE)); \
fprintf (FILE, ")@fixup\n"); \
- fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \
+ fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \
ASM_OUTPUT_ALIGN (FILE, 2); \
fprintf (FILE, "\t.long\t%s\n", p); \
fprintf (FILE, "\t.previous\n"); \
@@ -892,14 +903,14 @@ do { \
s->type = type; \
s->next = sections; \
sections = s; \
- fprintf (FILE, ".section\t%s,\"%s\"\n", NAME, mode); \
+ fprintf (FILE, "\t.section\t\"%s\",\"%s\"\n", NAME, mode); \
} \
else \
{ \
if (DECL && s->type != type) \
error_with_decl (DECL, "%s causes a section type conflict"); \
\
- fprintf (FILE, ".section\t%s\n", NAME); \
+ fprintf (FILE, "\t.section\t\"%s\"\n", NAME); \
} \
} while (0)
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
index c6f9b6c7629..9ed1690f985 100644
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -25,7 +25,13 @@ tramp.S: $(srcdir)/config/rs6000/tramp.asm
cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
# Switch synonyms
-MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?403 msoft-float=mcpu?821 msoft-float=mcpu?860
+MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
+ msoft-float=mcpu?403 \
+ msoft-float=mcpu?ec603e \
+ msoft-float=mcpu?801 \
+ msoft-float=mcpu?821 \
+ msoft-float=mcpu?823 \
+ msoft-float=mcpu?860
MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian
MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi
diff --git a/gcc/config/rs6000/win-nt.h b/gcc/config/rs6000/win-nt.h
index 2fcf44647d2..742a5e8c5fc 100644
--- a/gcc/config/rs6000/win-nt.h
+++ b/gcc/config/rs6000/win-nt.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, for PowerPC
running Windows/NT.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GNU CC.
@@ -27,12 +27,21 @@ Boston, MA 02111-1307, USA. */
/* Default ABI to compile code for */
#define DEFAULT_ABI ABI_NT
-#include "rs6000/powerpc.h"
+#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
+
+#define ASM_DEFAULT_SPEC "-mppc"
/* Pseudo target that we can test in the md file. */
-#undef TARGET_WINDOWS_NT
#define TARGET_WINDOWS_NT 1
+#include "rs6000/rs6000.h"
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
+
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_POWERPC
+
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-DWIN32 -D_WIN32 \
-DWINNT -D__STDC__=0 -DALMOST_STDC \
@@ -71,9 +80,6 @@ Boston, MA 02111-1307, USA. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-#undef PROCESSOR_DEFAULT
-#define PROCESSOR_DEFAULT PROCESSOR_POWERPC
-
/* NT always runs little endian */
#undef BYTES_BIG_ENDIAN
#define BYTES_BIG_ENDIAN 0
@@ -113,9 +119,6 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC)
-#undef PROCESSOR_DEFAULT
-#define PROCESSOR_DEFAULT PROCESSOR_PPC601
-
/* Address to save the TOC register */
#undef RS6000_SAVE_TOC
#define RS6000_SAVE_TOC plus_constant (virtual_incoming_args_rtx, -RS6000_SAVE_AREA - 8)
diff --git a/gcc/config/rs6000/xm-rs6000.h b/gcc/config/rs6000/xm-rs6000.h
index a027e3a63cd..1ad9da9a6ee 100644
--- a/gcc/config/rs6000/xm-rs6000.h
+++ b/gcc/config/rs6000/xm-rs6000.h
@@ -1,5 +1,5 @@
-/* Configuration for GNU C-compiler for IBM RS/6000.
- Copyright (C) 1990, 1993, 1995 Free Software Foundation, Inc.
+/* Configuration for GNU C-compiler for IBM RS/6000 running AIX in 32-bit mode.
+ Copyright (C) 1990, 1993, 1995, 1998 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
This file is part of GNU CC.
@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_SHORT 16
#define HOST_BITS_PER_INT 32
#define HOST_BITS_PER_LONG 32
-#define HOST_BITS_PER_LONGLONG 64
+#define HOST_BITS_PER_LONGLONG 64
#define HOST_WORDS_BIG_ENDIAN
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index a56077e544e..40d4c77b204 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#undef ASM_OUTPUT_DESTRUCTOR
#undef ASM_DECLARE_FUNCTION_NAME
#undef PREFERRED_DEBUGGING_TYPE
+#undef MAX_OFILE_ALIGNMENT
/* Be ELF-like. */
#include "svr4.h"
diff --git a/gcc/config/sh/lib1funcs.asm b/gcc/config/sh/lib1funcs.asm
index 923fa38c9f5..5084e9830ef 100644
--- a/gcc/config/sh/lib1funcs.asm
+++ b/gcc/config/sh/lib1funcs.asm
@@ -967,3 +967,28 @@ ret: rts
mov r4,r0
#endif
+#ifdef L_set_fpscr
+#if defined (__SH3E__)
+ .global ___set_fpscr
+___set_fpscr:
+ lds r4,fpscr
+ mov.l ___set_fpscr_L1,r1
+ swap.w r4,r0
+ or #24,r0
+ xor #16,r0
+ swap.w r0,r2
+ mov.l r2,@r1
+ xor #8,r0
+ swap.w r0,r3
+ rts
+ mov.l r3,@(4,r1)
+ .align 2
+___set_fpscr_L1:
+ .long ___fpscr_values
+#ifdef __ELF__
+ .comm ___fpscr_values,8,4
+#else
+ .comm ___fpscr_values,8
+#endif /* ELF */
+#endif /* SH3E */
+#endif /* L_set_fpscr */
diff --git a/gcc/config/sh/rtems.h b/gcc/config/sh/rtems.h
index 1b2242bf0a4..3e3fc7b8ca2 100644
--- a/gcc/config/sh/rtems.h
+++ b/gcc/config/sh/rtems.h
@@ -1,4 +1,4 @@
-/* Definitions for rtems targeting a SH using elf.
+/* Definitions for rtems targeting a SH using COFF.
Copyright (C) 1997 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
@@ -24,10 +24,12 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Drtems -D__rtems__ \
+#define CPP_PREDEFINES "-D__sh__ -Drtems -D__rtems__ \
-Asystem(rtems) -Acpu(sh) -Amachine(sh)"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
#define TARGET_MEM_FUNCTIONS
#endif
+
+/* end of sh/rtems.h */
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index f9a3caa874e..12f1b74c317 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1335,13 +1335,13 @@ gen_shl_and (dest, left_rtx, mask_rtx, source)
}
case 4:
shift_gen_fun = gen_shifty_op;
- case 2:
case 3:
/* If the topmost bit that matters is set, set the topmost bits
that don't matter. This way, we might be able to get a shorter
signed constant. */
if (mask & ((HOST_WIDE_INT)1 << 31 - total_shift))
mask |= (HOST_WIDE_INT)~0 << (31 - total_shift);
+ case 2:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (rtx_equal_function_value_matters
@@ -1349,6 +1349,10 @@ gen_shl_and (dest, left_rtx, mask_rtx, source)
{
rtx operands[3];
+ /* Cases 3 and 4 should be handled by this split
+ only while combining */
+ if (kind > 2)
+ abort ();
if (right)
{
emit_insn (gen_lshrsi3 (dest, source, GEN_INT (right)));
@@ -1596,8 +1600,16 @@ gen_shl_sext (dest, left_rtx, size_rtx, source)
case 5:
{
int i = 16 - size;
- emit_insn (gen_shl_sext_ext (dest, source, GEN_INT (16 - insize),
- GEN_INT (16)));
+ if (! rtx_equal_function_value_matters
+ && ! reload_in_progress && ! reload_completed)
+ emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
+ else
+ {
+ operands[0] = dest;
+ operands[2] = GEN_INT (16 - insize);
+ gen_shifty_hi_op (ASHIFT, operands);
+ emit_insn (gen_extendhisi2 (dest, gen_lowpart (HImode, dest)));
+ }
/* Don't use gen_ashrsi3 because it generates new pseudos. */
while (--i >= 0)
gen_ashift (ASHIFTRT, 1, dest);
@@ -3696,17 +3708,13 @@ initial_elimination_offset (from, to)
compiler. */
int
-handle_pragma (file, t)
- FILE *file;
- tree t;
+sh_handle_pragma (p_getc, p_ungetc, pname)
+ int (* p_getc) PROTO((void));
+ void (* p_ungetc) PROTO((int));
+ char * pname;
{
int retval = 0;
- register char *pname;
-
- if (TREE_CODE (t) != IDENTIFIER_NODE)
- return 0;
- pname = IDENTIFIER_POINTER (t);
if (strcmp (pname, "interrupt") == 0)
pragma_interrupt = retval = 1;
else if (strcmp (pname, "trapa") == 0)
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index dce9acb1acd..ebffc4dd628 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -257,6 +257,10 @@ do { \
&& (ALIGN) < FASTEST_ALIGNMENT) \
? FASTEST_ALIGNMENT : (ALIGN))
+#ifndef MAX_OFILE_ALIGNMENT
+#define MAX_OFILE_ALIGNMENT 128
+#endif
+
/* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \
(TREE_CODE (TYPE) == ARRAY_TYPE \
@@ -1518,7 +1522,7 @@ dtors_section() \
/* Define this so that jump tables go in same section as the current function,
which could be text or it could be a user defined section. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* A C statement to output something to the assembler file to switch to section
NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
@@ -1815,12 +1819,10 @@ int barrier_align ();
#define TARGET_MEM_FUNCTIONS
/* Define this macro if you want to implement any pragmas. If defined, it
- is a C expression to be executed when #pragma is seen. The
- argument FILE is the stdio input stream from which the source
- text can be read. CH is the first character after the #pragma. The
- result of the expression is the terminating character found
- (newline or EOF). */
-#define HANDLE_PRAGMA(FILE, NODE) handle_pragma ((FILE), (NODE))
+ is a C expression whose value is 1 if the pragma was handled by the
+ macro, zero otherwise. */
+#define HANDLE_PRAGMA(GETC, UNGETC, NODE) sh_handle_pragma (GETC, UNGETC, NODE)
+extern int sh_handle_pragma ();
/* Set when processing a function with pragma interrupt turned on. */
@@ -1941,14 +1943,6 @@ do { \
cost = 2; \
} while (0) \
-/* Since the SH architecture lacks negative address offsets,
- the givs should be sorted smallest to largest so combine_givs
- has maximum opportunity to combine givs. */
-#define GIV_SORT_CRITERION(X, Y) \
- if (GET_CODE ((X)->add_val) == CONST_INT \
- && GET_CODE ((Y)->add_val) == CONST_INT) \
- return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val);
-
/* For the sake of libgcc2.c, indicate target supports atexit. */
#define HAVE_ATEXIT
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index e25f2b72c6a..3ca60b5d9ba 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -3103,7 +3103,7 @@
(define_insn "sqrtsf2"
[(set (match_operand:SF 0 "arith_reg_operand" "=f")
- (sqrt:DF (match_operand:SF 1 "arith_reg_operand" "0")))]
+ (sqrt:SF (match_operand:SF 1 "arith_reg_operand" "0")))]
"TARGET_SH3E"
"fsqrt %0"
[(set_attr "type" "fdiv")])
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
index 7f925529c4f..c6af7c1839b 100644
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -1,7 +1,7 @@
CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = sh/lib1funcs.asm
LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
- _mulsi3 _sdivsi3 _udivsi3
+ _mulsi3 _sdivsi3 _udivsi3 _set_fpscr
# These are really part of libgcc1, but this will cause them to be
# built correctly, so...
diff --git a/gcc/config/sparc/lb1spc.asm b/gcc/config/sparc/lb1spc.asm
index ec9532d3ec0..831f33a988f 100644
--- a/gcc/config/sparc/lb1spc.asm
+++ b/gcc/config/sparc/lb1spc.asm
@@ -80,407 +80,705 @@ mul_shortway:
#endif
#ifdef L_divsi3
-.text
- .align 4
- .global .udiv
- .proc 4
+/*
+ * Division and remainder, from Appendix E of the Sparc Version 8
+ * Architecture Manual, with fixes from Gordon Irlam.
+ */
+
+/*
+ * Input: dividend and divisor in %o0 and %o1 respectively.
+ *
+ * m4 parameters:
+ * .div name of function to generate
+ * div div=div => %o0 / %o1; div=rem => %o0 % %o1
+ * true true=true => signed; true=false => unsigned
+ *
+ * Algorithm parameters:
+ * N how many bits per iteration we try to get (4)
+ * WORDSIZE total number of bits (32)
+ *
+ * Derived constants:
+ * TOPBITS number of bits in the top decade of a number
+ *
+ * Important variables:
+ * Q the partial quotient under development (initially 0)
+ * R the remainder so far, initially the dividend
+ * ITER number of main division loop iterations required;
+ * equal to ceil(log2(quotient) / N). Note that this
+ * is the log base (2^N) of the quotient.
+ * V the current comparand, initially divisor*2^(ITER*N-1)
+ *
+ * Cost:
+ * Current estimate for non-large dividend is
+ * ceil(log2(quotient) / N) * (10 + 7N/2) + C
+ * A large dividend is one greater than 2^(31-TOPBITS) and takes a
+ * different path, as the upper bits of the quotient must be developed
+ * one bit at a time.
+ */
+ .global .udiv
+ .align 4
+ .proc 4
+ .text
.udiv:
- save %sp, -64, %sp
- b divide
- mov 0, %l2 ! result always positive
- .global .div
- .proc 4
+ b ready_to_divide
+ mov 0, %g3 ! result is always positive
+
+ .global .div
+ .align 4
+ .proc 4
+ .text
.div:
- save %sp, -64, %sp
- orcc %i1, %i0, %g0 ! is either operand negative
- bge divide ! if not, skip this junk
- xor %i1, %i0, %l2 ! record sign of result in sign of %l2
- tst %i1
- bge 2f
- tst %i0
- ! %i1 < 0
- bge divide
- neg %i1
-2: ! %i0 < 0
- neg %i0
- ! FALL THROUGH
-divide:
- ! Compute size of quotient, scale comparand.
- orcc %i1, %g0, %l1 ! movcc %i1, %l1
- te 2 ! if %i1 = 0
- mov %i0, %i3
- mov 0, %i2
- sethi %hi(1<<(32-4-1)), %l3
- cmp %i3, %l3
+ ! compute sign of result; if neither is negative, no problem
+ orcc %o1, %o0, %g0 ! either negative?
+ bge ready_to_divide ! no, go do the divide
+ xor %o1, %o0, %g3 ! compute sign in any case
+ tst %o1
+ bge 1f
+ tst %o0
+ ! %o1 is definitely negative; %o0 might also be negative
+ bge ready_to_divide ! if %o0 not negative...
+ sub %g0, %o1, %o1 ! in any case, make %o1 nonneg
+1: ! %o0 is negative, %o1 is nonnegative
+ sub %g0, %o0, %o0 ! make %o0 nonnegative
+
+
+ready_to_divide:
+
+ ! Ready to divide. Compute size of quotient; scale comparand.
+ orcc %o1, %g0, %o5
+ bne 1f
+ mov %o0, %o3
+
+ ! Divide by zero trap. If it returns, return 0 (about as
+ ! wrong as possible, but that is what SunOS does...).
+ ta 0x2 ! ST_DIV0
+ retl
+ clr %o0
+
+1:
+ cmp %o3, %o5 ! if %o1 exceeds %o0, done
+ blu got_result ! (and algorithm fails otherwise)
+ clr %o2
+ sethi %hi(1 << (32 - 4 - 1)), %g1
+ cmp %o3, %g1
blu not_really_big
- mov 0, %l0
- !
- ! Here, the %i0 is >= 2^(31-3) or so. We must be careful here,
- ! as our usual 3-at-a-shot divide step will cause overflow and havoc.
- ! The total number of bits in the result here is 3*%l0+%l4, where
- ! %l4 <= 3.
- ! Compute %l0 in an unorthodox manner: know we need to Shift %l1 into
- ! the top decade: so do not even bother to compare to %i3.
-1: cmp %l1, %l3
- bgeu 3f
- mov 1, %l4
- sll %l1, 3, %l1
- b 1b
- inc %l0
- !
- ! Now compute %l4
- !
-2: addcc %l1, %l1, %l1
- bcc not_too_big
- add %l4, 1, %l4
- !
- ! We are here if the %i1 overflowed when Shifting.
- ! This means that %i3 has the high-order bit set.
- ! Restore %l1 and subtract from %i3.
- sll %l3, 4, %l3
- srl %l1, 1, %l1
- add %l1, %l3, %l1
- b do_single_div
- dec %l4
-not_too_big:
-3: cmp %l1, %i3
- blu 2b
- nop
- be do_single_div
- nop
- ! %l1 > %i3: went too far: back up 1 step
- ! srl %l1, 1, %l1
- ! dec %l4
+ clr %o4
+
+ ! Here the dividend is >= 2**(31-N) or so. We must be careful here,
+ ! as our usual N-at-a-shot divide step will cause overflow and havoc.
+ ! The number of bits in the result here is N*ITER+SC, where SC <= N.
+ ! Compute ITER in an unorthodox manner: know we need to shift V into
+ ! the top decade: so do not even bother to compare to R.
+ 1:
+ cmp %o5, %g1
+ bgeu 3f
+ mov 1, %g2
+ sll %o5, 4, %o5
+ b 1b
+ add %o4, 1, %o4
+
+ ! Now compute %g2.
+ 2: addcc %o5, %o5, %o5
+ bcc not_too_big
+ add %g2, 1, %g2
+
+ ! We get here if the %o1 overflowed while shifting.
+ ! This means that %o3 has the high-order bit set.
+ ! Restore %o5 and subtract from %o3.
+ sll %g1, 4, %g1 ! high order bit
+ srl %o5, 1, %o5 ! rest of %o5
+ add %o5, %g1, %o5
+ b do_single_div
+ sub %g2, 1, %g2
+
+ not_too_big:
+ 3: cmp %o5, %o3
+ blu 2b
+ nop
+ be do_single_div
+ nop
+ /* NB: these are commented out in the V8-Sparc manual as well */
+ /* (I do not understand this) */
+ ! %o5 > %o3: went too far: back up 1 step
+ ! srl %o5, 1, %o5
+ ! dec %g2
! do single-bit divide steps
!
- ! We have to be careful here. We know that %i3 >= %l1, so we can do the
+ ! We have to be careful here. We know that %o3 >= %o5, so we can do the
! first divide step without thinking. BUT, the others are conditional,
- ! and are only done if %i3 >= 0. Because both %i3 and %l1 may have the
- ! high-order bit set in the first step, just falling into the regular
+ ! and are only done if %o3 >= 0. Because both %o3 and %o5 may have the high-
+ ! order bit set in the first step, just falling into the regular
! division loop will mess up the first time around.
! So we unroll slightly...
-do_single_div:
- deccc %l4
- bl end_regular_divide
- nop
- sub %i3, %l1, %i3
- mov 1, %i2
- b end_single_divloop
- nop
-single_divloop:
- sll %i2, 1, %i2
- bl 1f
- srl %l1, 1, %l1
- ! %i3 >= 0
- sub %i3, %l1, %i3
- b 2f
- inc %i2
-1: ! %i3 < 0
- add %i3, %l1, %i3
- dec %i2
-end_single_divloop:
-2: deccc %l4
- bge single_divloop
- tst %i3
- b end_regular_divide
- nop
+ do_single_div:
+ subcc %g2, 1, %g2
+ bl end_regular_divide
+ nop
+ sub %o3, %o5, %o3
+ mov 1, %o2
+ b end_single_divloop
+ nop
+ single_divloop:
+ sll %o2, 1, %o2
+ bl 1f
+ srl %o5, 1, %o5
+ ! %o3 >= 0
+ sub %o3, %o5, %o3
+ b 2f
+ add %o2, 1, %o2
+ 1: ! %o3 < 0
+ add %o3, %o5, %o3
+ sub %o2, 1, %o2
+ 2:
+ end_single_divloop:
+ subcc %g2, 1, %g2
+ bge single_divloop
+ tst %o3
+ b,a end_regular_divide
+
not_really_big:
-1: sll %l1, 3, %l1
- cmp %l1, %i3
+1:
+ sll %o5, 4, %o5
+ cmp %o5, %o3
bleu 1b
- inccc %l0
+ addcc %o4, 1, %o4
be got_result
- dec %l0
-do_regular_divide:
- ! Do the main division iteration
- tst %i3
- ! Fall through into divide loop
+ sub %o4, 1, %o4
+
+ tst %o3 ! set up for initial iteration
divloop:
- sll %i2, 3, %i2
+ sll %o2, 4, %o2
! depth 1, accumulated bits 0
- bl L.1.8
- srl %l1,1,%l1
+ bl L1.16
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
! depth 2, accumulated bits 1
- bl L.2.9
- srl %l1,1,%l1
+ bl L2.17
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
! depth 3, accumulated bits 3
- bl L.3.11
- srl %l1,1,%l1
+ bl L3.19
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 7
+ bl L4.23
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (7*2+1), %o2
+
+L4.23:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (3*2+1), %i2
-L.3.11: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (7*2-1), %o2
+
+
+L3.19:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 5
+ bl L4.21
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (3*2-1), %i2
-L.2.9: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (5*2+1), %o2
+
+L4.21:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (5*2-1), %o2
+
+L2.17:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
! depth 3, accumulated bits 1
- bl L.3.9
- srl %l1,1,%l1
+ bl L3.17
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 3
+ bl L4.19
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (3*2+1), %o2
+
+L4.19:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (1*2+1), %i2
-L.3.9: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (3*2-1), %o2
+
+L3.17:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 1
+ bl L4.17
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (1*2-1), %i2
-L.1.8: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (1*2+1), %o2
+
+L4.17:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (1*2-1), %o2
+
+L1.16:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
! depth 2, accumulated bits -1
- bl L.2.7
- srl %l1,1,%l1
+ bl L2.15
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
! depth 3, accumulated bits -1
- bl L.3.7
- srl %l1,1,%l1
+ bl L3.15
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -1
+ bl L4.15
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-1*2+1), %o2
+
+L4.15:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-1*2-1), %o2
+
+L3.15:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -3
+ bl L4.13
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (-1*2+1), %i2
-L.3.7: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (-3*2+1), %o2
+
+L4.13:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (-1*2-1), %i2
-L.2.7: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (-3*2-1), %o2
+
+L2.15:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
! depth 3, accumulated bits -3
- bl L.3.5
- srl %l1,1,%l1
+ bl L3.13
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -5
+ bl L4.11
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (-3*2+1), %i2
-L.3.5: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (-5*2+1), %o2
+
+L4.11:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (-3*2-1), %i2
+ add %o2, (-5*2-1), %o2
+
+L3.13:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -7
+ bl L4.9
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-7*2+1), %o2
+
+L4.9:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-7*2-1), %o2
+
+ 9:
end_regular_divide:
-9: deccc %l0
+ subcc %o4, 1, %o4
bge divloop
- tst %i3
- bge got_result
- nop
- ! non-restoring fixup here
- dec %i2
+ tst %o3
+ bl,a got_result
+ ! non-restoring fixup here (one instruction only!)
+ sub %o2, 1, %o2
+
+
got_result:
- tst %l2
- bge 1f
- restore
- ! answer < 0
- retl ! leaf-routine return
- neg %o2, %o0 ! quotient <- -%i2
-1: retl ! leaf-routine return
- mov %o2, %o0 ! quotient <- %i2
+ ! check to see if answer should be < 0
+ tst %g3
+ bl,a 1f
+ sub %g0, %o2, %o2
+1:
+ retl
+ mov %o2, %o0
#endif
#ifdef L_modsi3
+/* This implementation was taken from glibc:
+ *
+ * Input: dividend and divisor in %o0 and %o1 respectively.
+ *
+ * Algorithm parameters:
+ * N how many bits per iteration we try to get (4)
+ * WORDSIZE total number of bits (32)
+ *
+ * Derived constants:
+ * TOPBITS number of bits in the top decade of a number
+ *
+ * Important variables:
+ * Q the partial quotient under development (initially 0)
+ * R the remainder so far, initially the dividend
+ * ITER number of main division loop iterations required;
+ * equal to ceil(log2(quotient) / N). Note that this
+ * is the log base (2^N) of the quotient.
+ * V the current comparand, initially divisor*2^(ITER*N-1)
+ *
+ * Cost:
+ * Current estimate for non-large dividend is
+ * ceil(log2(quotient) / N) * (10 + 7N/2) + C
+ * A large dividend is one greater than 2^(31-TOPBITS) and takes a
+ * different path, as the upper bits of the quotient must be developed
+ * one bit at a time.
+ */
.text
.align 4
.global .urem
.proc 4
.urem:
- save %sp, -64, %sp
b divide
- mov 0, %l2 ! result always positive
+ mov 0, %g3 ! result always positive
+
+ .align 4
.global .rem
.proc 4
.rem:
- save %sp, -64, %sp
- orcc %i1, %i0, %g0 ! is either operand negative
- bge divide ! if not, skip this junk
- mov %i0, %l2 ! record sign of result in sign of %i2
- tst %i1
- bge 2f
- tst %i0
- ! %i1 < 0
- bge divide
- neg %i1
-2: ! %i0 < 0
- neg %i0
- ! FALL THROUGH
+ ! compute sign of result; if neither is negative, no problem
+ orcc %o1, %o0, %g0 ! either negative?
+ bge 2f ! no, go do the divide
+ mov %o0, %g3 ! sign of remainder matches %o0
+ tst %o1
+ bge 1f
+ tst %o0
+ ! %o1 is definitely negative; %o0 might also be negative
+ bge 2f ! if %o0 not negative...
+ sub %g0, %o1, %o1 ! in any case, make %o1 nonneg
+1: ! %o0 is negative, %o1 is nonnegative
+ sub %g0, %o0, %o0 ! make %o0 nonnegative
+2:
+
+ ! Ready to divide. Compute size of quotient; scale comparand.
divide:
- ! Compute size of quotient, scale comparand.
- orcc %i1, %g0, %l1 ! movcc %i1, %l1
- te 2 ! if %i1 = 0
- mov %i0, %i3
- mov 0, %i2
- sethi %hi(1<<(32-4-1)), %l3
- cmp %i3, %l3
+ orcc %o1, %g0, %o5
+ bne 1f
+ mov %o0, %o3
+
+ ! Divide by zero trap. If it returns, return 0 (about as
+ ! wrong as possible, but that is what SunOS does...).
+ ta 0x2 !ST_DIV0
+ retl
+ clr %o0
+
+1:
+ cmp %o3, %o5 ! if %o1 exceeds %o0, done
+ blu got_result ! (and algorithm fails otherwise)
+ clr %o2
+ sethi %hi(1 << (32 - 4 - 1)), %g1
+ cmp %o3, %g1
blu not_really_big
- mov 0, %l0
- !
- ! Here, the %i0 is >= 2^(31-3) or so. We must be careful here,
- ! as our usual 3-at-a-shot divide step will cause overflow and havoc.
- ! The total number of bits in the result here is 3*%l0+%l4, where
- ! %l4 <= 3.
- ! Compute %l0 in an unorthodox manner: know we need to Shift %l1 into
- ! the top decade: so do not even bother to compare to %i3.
-1: cmp %l1, %l3
- bgeu 3f
- mov 1, %l4
- sll %l1, 3, %l1
- b 1b
- inc %l0
- !
- ! Now compute %l4
- !
-2: addcc %l1, %l1, %l1
- bcc not_too_big
- add %l4, 1, %l4
- !
- ! We are here if the %i1 overflowed when Shifting.
- ! This means that %i3 has the high-order bit set.
- ! Restore %l1 and subtract from %i3.
- sll %l3, 4, %l3
- srl %l1, 1, %l1
- add %l1, %l3, %l1
- b do_single_div
- dec %l4
-not_too_big:
-3: cmp %l1, %i3
- blu 2b
- nop
- be do_single_div
- nop
- ! %l1 > %i3: went too far: back up 1 step
- ! srl %l1, 1, %l1
- ! dec %l4
+ clr %o4
+
+ ! Here the dividend is >= 2**(31-N) or so. We must be careful here,
+ ! as our usual N-at-a-shot divide step will cause overflow and havoc.
+ ! The number of bits in the result here is N*ITER+SC, where SC <= N.
+ ! Compute ITER in an unorthodox manner: know we need to shift V into
+ ! the top decade: so do not even bother to compare to R.
+ 1:
+ cmp %o5, %g1
+ bgeu 3f
+ mov 1, %g2
+ sll %o5, 4, %o5
+ b 1b
+ add %o4, 1, %o4
+
+ ! Now compute %g2.
+ 2: addcc %o5, %o5, %o5
+ bcc not_too_big
+ add %g2, 1, %g2
+
+ ! We get here if the %o1 overflowed while shifting.
+ ! This means that %o3 has the high-order bit set.
+ ! Restore %o5 and subtract from %o3.
+ sll %g1, 4, %g1 ! high order bit
+ srl %o5, 1, %o5 ! rest of %o5
+ add %o5, %g1, %o5
+ b do_single_div
+ sub %g2, 1, %g2
+
+ not_too_big:
+ 3: cmp %o5, %o3
+ blu 2b
+ nop
+ be do_single_div
+ nop
+ /* NB: these are commented out in the V8-Sparc manual as well */
+ /* (I do not understand this) */
+ ! %o5 > %o3: went too far: back up 1 step
+ ! srl %o5, 1, %o5
+ ! dec %g2
! do single-bit divide steps
!
- ! We have to be careful here. We know that %i3 >= %l1, so we can do the
+ ! We have to be careful here. We know that %o3 >= %o5, so we can do the
! first divide step without thinking. BUT, the others are conditional,
- ! and are only done if %i3 >= 0. Because both %i3 and %l1 may have the
- ! high-order bit set in the first step, just falling into the regular
+ ! and are only done if %o3 >= 0. Because both %o3 and %o5 may have the high-
+ ! order bit set in the first step, just falling into the regular
! division loop will mess up the first time around.
! So we unroll slightly...
-do_single_div:
- deccc %l4
- bl end_regular_divide
- nop
- sub %i3, %l1, %i3
- mov 1, %i2
- b end_single_divloop
- nop
-single_divloop:
- sll %i2, 1, %i2
- bl 1f
- srl %l1, 1, %l1
- ! %i3 >= 0
- sub %i3, %l1, %i3
- b 2f
- inc %i2
-1: ! %i3 < 0
- add %i3, %l1, %i3
- dec %i2
-end_single_divloop:
-2: deccc %l4
- bge single_divloop
- tst %i3
- b end_regular_divide
- nop
+ do_single_div:
+ subcc %g2, 1, %g2
+ bl end_regular_divide
+ nop
+ sub %o3, %o5, %o3
+ mov 1, %o2
+ b end_single_divloop
+ nop
+ single_divloop:
+ sll %o2, 1, %o2
+ bl 1f
+ srl %o5, 1, %o5
+ ! %o3 >= 0
+ sub %o3, %o5, %o3
+ b 2f
+ add %o2, 1, %o2
+ 1: ! %o3 < 0
+ add %o3, %o5, %o3
+ sub %o2, 1, %o2
+ 2:
+ end_single_divloop:
+ subcc %g2, 1, %g2
+ bge single_divloop
+ tst %o3
+ b,a end_regular_divide
+
not_really_big:
-1: sll %l1, 3, %l1
- cmp %l1, %i3
+1:
+ sll %o5, 4, %o5
+ cmp %o5, %o3
bleu 1b
- inccc %l0
+ addcc %o4, 1, %o4
be got_result
- dec %l0
-do_regular_divide:
- ! Do the main division iteration
- tst %i3
- ! Fall through into divide loop
+ sub %o4, 1, %o4
+
+ tst %o3 ! set up for initial iteration
divloop:
- sll %i2, 3, %i2
- ! depth 1, accumulated bits 0
- bl L.1.8
- srl %l1,1,%l1
+ sll %o2, 4, %o2
+ ! depth 1, accumulated bits 0
+ bl L1.16
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
! depth 2, accumulated bits 1
- bl L.2.9
- srl %l1,1,%l1
+ bl L2.17
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
! depth 3, accumulated bits 3
- bl L.3.11
- srl %l1,1,%l1
+ bl L3.19
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 7
+ bl L4.23
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (7*2+1), %o2
+L4.23:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (7*2-1), %o2
+
+L3.19:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 5
+ bl L4.21
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (3*2+1), %i2
-L.3.11: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (5*2+1), %o2
+
+L4.21:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (3*2-1), %i2
-L.2.9: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (5*2-1), %o2
+
+L2.17:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
! depth 3, accumulated bits 1
- bl L.3.9
- srl %l1,1,%l1
+ bl L3.17
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 3
+ bl L4.19
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (1*2+1), %i2
-L.3.9: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (3*2+1), %o2
+
+L4.19:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (1*2-1), %i2
-L.1.8: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (3*2-1), %o2
+
+L3.17:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits 1
+ bl L4.17
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (1*2+1), %o2
+
+L4.17:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (1*2-1), %o2
+
+L1.16:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
! depth 2, accumulated bits -1
- bl L.2.7
- srl %l1,1,%l1
+ bl L2.15
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
! depth 3, accumulated bits -1
- bl L.3.7
- srl %l1,1,%l1
+ bl L3.15
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -1
+ bl L4.15
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (-1*2+1), %i2
-L.3.7: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (-1*2+1), %o2
+
+L4.15:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-1*2-1), %o2
+
+L3.15:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -3
+ bl L4.13
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (-1*2-1), %i2
-L.2.7: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (-3*2+1), %o2
+
+L4.13:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-3*2-1), %o2
+
+L2.15:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
! depth 3, accumulated bits -3
- bl L.3.5
- srl %l1,1,%l1
+ bl L3.13
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -5
+ bl L4.11
+ srl %o5,1,%o5
+ ! remainder is positive
+ subcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-5*2+1), %o2
+
+L4.11:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ b 9f
+ add %o2, (-5*2-1), %o2
+
+L3.13:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
+ ! depth 4, accumulated bits -7
+ bl L4.9
+ srl %o5,1,%o5
! remainder is positive
- subcc %i3,%l1,%i3
+ subcc %o3,%o5,%o3
b 9f
- add %i2, (-3*2+1), %i2
-L.3.5: ! remainder is negative
- addcc %i3,%l1,%i3
+ add %o2, (-7*2+1), %o2
+
+L4.9:
+ ! remainder is negative
+ addcc %o3,%o5,%o3
b 9f
- add %i2, (-3*2-1), %i2
+ add %o2, (-7*2-1), %o2
+
+ 9:
end_regular_divide:
-9: deccc %l0
+ subcc %o4, 1, %o4
bge divloop
- tst %i3
- bge got_result
- nop
- ! non-restoring fixup here
- add %i3, %i1, %i3
+ tst %o3
+ bl,a got_result
+ ! non-restoring fixup here (one instruction only!)
+ add %o3, %o1, %o3
+
got_result:
- tst %l2
- bge 1f
- restore
- ! answer < 0
- retl ! leaf-routine return
- neg %o3, %o0 ! remainder <- -%i3
-1: retl ! leaf-routine return
- mov %o3, %o0 ! remainder <- %i3
-#endif
+ ! check to see if answer should be < 0
+ tst %g3
+ bl,a 1f
+ sub %g0, %o3, %o3
+1:
+ retl
+ mov %o3, %o0
+#endif
diff --git a/gcc/config/sparc/linux-aout.h b/gcc/config/sparc/linux-aout.h
index 7075b5fbe7c..76d7653eaae 100644
--- a/gcc/config/sparc/linux-aout.h
+++ b/gcc/config/sparc/linux-aout.h
@@ -109,3 +109,22 @@ Boston, MA 02111-1307, USA. */
long double yet. */
#define LONG_DOUBLE_TYPE_SIZE 128
#endif
+
+/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
+ traps available which can get and set the condition codes
+ reliably. */
+#undef MACHINE_STATE_SAVE
+#define MACHINE_STATE_SAVE(ID) \
+ unsigned long int ms_flags, ms_saveret; \
+ asm volatile("ta 0x20\n\t" \
+ "mov %%g1, %0\n\t" \
+ "mov %%g2, %1\n\t" \
+ : "=r" (ms_flags), "=r" (ms_saveret));
+
+#undef MACHINE_STATE_RESTORE
+#define MACHINE_STATE_RESTORE(ID) \
+ asm volatile("mov %0, %%g1\n\t" \
+ "mov %1, %%g2\n\t" \
+ "ta 0x21\n\t" \
+ : /* no outputs */ \
+ : "r" (ms_flags), "r" (ms_saveret));
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index a5807ecc632..fe6bf6a9934 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -238,3 +238,22 @@ do { \
long double yet. */
#define LONG_DOUBLE_TYPE_SIZE 128
#endif
+
+/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
+ traps available which can get and set the condition codes
+ reliably. */
+#undef MACHINE_STATE_SAVE
+#define MACHINE_STATE_SAVE(ID) \
+ unsigned long int ms_flags, ms_saveret; \
+ asm volatile("ta 0x20\n\t" \
+ "mov %%g1, %0\n\t" \
+ "mov %%g2, %1\n\t" \
+ : "=r" (ms_flags), "=r" (ms_saveret));
+
+#undef MACHINE_STATE_RESTORE
+#define MACHINE_STATE_RESTORE(ID) \
+ asm volatile("mov %0, %%g1\n\t" \
+ "mov %1, %%g2\n\t" \
+ "ta 0x21\n\t" \
+ : /* no outputs */ \
+ : "r" (ms_flags), "r" (ms_saveret));
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 3f359363b59..ed8c3ec3d55 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -19,9 +19,7 @@ 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. */
-/* ??? bi-architecture support will require changes to the linker
- related specs, among perhaps other things (multilibs). */
-/* #define SPARC_BI_ARCH */
+#define SPARC_BI_ARCH
#define LINUX_DEFAULT_ELF
@@ -36,6 +34,16 @@ Boston, MA 02111-1307, USA. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
+#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
+/* A 64 bit v9 compiler with stack-bias,
+ in a Medium/Low code model environment. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+ (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
+ + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
+#endif
+
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
#undef ASM_FILE_START
@@ -54,11 +62,37 @@ Boston, MA 02111-1307, USA. */
object constructed before entering `main'. */
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
+
+#define STARTFILE_SPEC32 \
"%{!shared: \
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+#define STARTFILE_SPEC64 \
+ "%{!shared: \
+ %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} %{!p:/usr/lib64/crt1.o%s}}}\
+ /usr/lib64/crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+#ifdef SPARC_BI_ARCH
+
+#if DEFAULT_ARCH32_P
+#define STARTFILE_SPEC "\
+%{m32:" STARTFILE_SPEC32 "} \
+%{m64:" STARTFILE_SPEC64 "} \
+%{!m32:%{!m64:" STARTFILE_SPEC32 "}}"
+#else
+#define STARTFILE_SPEC "\
+%{m32:" STARTFILE_SPEC32 "} \
+%{m64:" STARTFILE_SPEC64 "} \
+%{!m32:%{!m64:" STARTFILE_SPEC64 "}}"
+#endif
+
+#else
+
+#define STARTFILE_SPEC STARTFILE_SPEC64
+
+#endif
+
/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
the GNU/Linux magical crtend.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
@@ -66,23 +100,39 @@ Boston, MA 02111-1307, USA. */
GNU/Linux "finalizer" file, `crtn.o'. */
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
+
+#define ENDFILE_SPEC32 \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
+#define ENDFILE_SPEC64 \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s"
+
+#ifdef SPARC_BI_ARCH
-/* A 64 bit v9 compiler with stack-bias,
- in a Medium/Anywhere code model environment. */
+#if DEFAULT_ARCH32_P
+#define ENDFILE_SPEC "\
+%{m32:" ENDFILE_SPEC32 "} \
+%{m64:" ENDFILE_SPEC64 "} \
+%{!m32:%{!m64:" ENDFILE_SPEC32 "}}"
+#else
+#define ENDFILE_SPEC "\
+%{m32:" ENDFILE_SPEC32 "} \
+%{m64:" ENDFILE_SPEC64 "} \
+%{!m32:%{!m64:" ENDFILE_SPEC64 "}}"
+#endif
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT \
- (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
- + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
+#else
+
+#define ENDFILE_SPEC ENDFILE_SPEC64
+
+#endif
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
/* The default code model. */
#undef SPARC_DEFAULT_CMODEL
-#define SPARC_DEFAULT_CMODEL CM_MEDANY
+#define SPARC_DEFAULT_CMODEL CM_MEDLOW
#undef WCHAR_TYPE
#define WCHAR_TYPE "long int"
@@ -92,7 +142,7 @@ Boston, MA 02111-1307, USA. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
-
+
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -Dsparc -Dlinux -Asystem(unix) -Asystem(posix)"
@@ -126,17 +176,88 @@ Boston, MA 02111-1307, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
+#ifdef SPARC_BI_ARCH
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "link_arch32", LINK_ARCH32_SPEC }, \
+ { "link_arch64", LINK_ARCH64_SPEC }, \
+ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
+ { "link_arch", LINK_ARCH_SPEC },
+
+#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}}} \
+"
+
+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
+ %{static:-static}}} \
+"
+
+#define LINK_ARCH_SPEC "\
+%{m32:%(link_arch32)} \
+%{m64:%(link_arch64)} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+
+#define LINK_ARCH_DEFAULT_SPEC \
+(DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
+
#undef LINK_SPEC
-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
+#define LINK_SPEC "\
+%(link_arch) \
+%{mlittle-endian:-EL} \
+"
+
+#undef CC1_SPEC
+#if DEFAULT_ARCH32_P
+#define CC1_SPEC "\
+%{sun4:} %{target:} \
+%{mcypress:-mcpu=cypress} \
+%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
+%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
+%{m64:-mptr64 -mcpu=ultrasparc -mstack-bias} \
+"
+#else
+#define CC1_SPEC "\
+%{sun4:} %{target:} \
+%{mcypress:-mcpu=cypress} \
+%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
+%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
+%{m32:-mptr32 -mcpu=cypress -mno-stack-bias} \
+"
+#endif
+
+#if DEFAULT_ARCH32_P
+#define MULTILIB_DEFAULTS { "m32" }
+#else
+#define MULTILIB_DEFAULTS { "m64" }
+#endif
+
+#else /* !SPARC_BI_ARCH */
+
+#undef LINK_SPEC
+#define LINK_ARCH_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux64.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
%{static:-static}}} \
%{mlittle-endian:-EL} \
"
+#endif /* !SPARC_BI_ARCH */
+
/* 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
@@ -224,3 +345,22 @@ do { \
RELATIVE relocations. */
/* #define DWARF_OFFSET_SIZE PTR_SIZE */
+
+/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
+ traps available which can get and set the condition codes
+ reliably. */
+#undef MACHINE_STATE_SAVE
+#define MACHINE_STATE_SAVE(ID) \
+ unsigned long int ms_flags, ms_saveret; \
+ asm volatile("ta 0x20\n\t" \
+ "mov %%g1, %0\n\t" \
+ "mov %%g2, %1\n\t" \
+ : "=r" (ms_flags), "=r" (ms_saveret));
+
+#undef MACHINE_STATE_RESTORE
+#define MACHINE_STATE_RESTORE(ID) \
+ asm volatile("mov %0, %%g1\n\t" \
+ "mov %1, %%g2\n\t" \
+ "ta 0x21\n\t" \
+ : /* no outputs */ \
+ : "r" (ms_flags), "r" (ms_saveret));
diff --git a/gcc/config/sparc/netbsd.h b/gcc/config/sparc/netbsd.h
index 3fd6fe92020..a512f41e155 100644
--- a/gcc/config/sparc/netbsd.h
+++ b/gcc/config/sparc/netbsd.h
@@ -37,6 +37,7 @@
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions. */
+#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
/* Until they use ELF or something that handles dwarf2 unwinds
diff --git a/gcc/config/sparc/sol2-c1.asm b/gcc/config/sparc/sol2-c1.asm
index 618d698e900..894a8c34c08 100644
--- a/gcc/config/sparc/sol2-c1.asm
+++ b/gcc/config/sparc/sol2-c1.asm
@@ -1,4 +1,4 @@
-! crt1.s for solaris 2.0.
+! crt1.s for sparc & sparcv9 (SunOS 5)
! Copyright (C) 1992 Free Software Foundation, Inc.
! Written By David Vinayak Henkel-Wallace, June 1992
@@ -37,43 +37,67 @@
! in section 3 of the SVr4 ABI.
! This file is the first thing linked into any executable.
+#ifdef __sparcv9
+#define CPTRSIZE 8
+#define CPTRSHIFT 3
+#define STACK_BIAS 2047
+#define ldn ldx
+#define stn stx
+#define setn(s, scratch, dst) setx s, scratch, dst
+#else
+#define CPTRSIZE 4
+#define CPTRSHIFT 2
+#define STACK_BIAS 0
+#define ldn ld
+#define stn st
+#define setn(s, scratch, dst) set s, dst
+#endif
+
.section ".text"
.proc 022
.global _start
_start:
mov 0, %fp ! Mark bottom frame pointer
- ld [%sp + 64], %l0 ! argc
- add %sp, 68, %l1 ! argv
+ ldn [%sp + (16 * CPTRSIZE) + STACK_BIAS], %l0 ! argc
+ add %sp, (17 * CPTRSIZE) + STACK_BIAS, %l1 ! argv
! Leave some room for a call. Sun leaves 32 octets (to sit on
! a cache line?) so we do too.
+#ifdef __sparcv9
+ sub %sp, 48, %sp
+#else
sub %sp, 32, %sp
+#endif
! %g1 may contain a function to be registered w/atexit
orcc %g0, %g1, %g0
+#ifdef __sparcv9
+ be %xcc, .nope
+#else
be .nope
+#endif
mov %g1, %o0
call atexit
nop
.nope:
! Now make sure constructors and destructors are handled.
- set _fini, %o0
+ setn(_fini, %o1, %o0)
call atexit, 1
nop
call _init, 0
nop
- ! We ignore the auxiliary vector; there's no defined way to
+ ! We ignore the auxiliary vector; there is no defined way to
! access those data anyway. Instead, go straight to main:
mov %l0, %o0 ! argc
mov %l1, %o1 ! argv
! Skip argc words past argv, to env:
- sll %l0, 2, %o2
- add %o2, 4, %o2
+ sll %l0, CPTRSHIFT, %o2
+ add %o2, CPTRSIZE, %o2
add %l1, %o2, %o2 ! env
- set _environ, %o3
- st %o2, [%o3] ! *_environ
+ setn(_environ, %o4, %o3)
+ stn %o2, [%o3] ! *_environ
call main, 4
nop
call exit, 0
diff --git a/gcc/config/sparc/sol2-ci.asm b/gcc/config/sparc/sol2-ci.asm
index dd09a34e84e..3dc793c0c89 100644
--- a/gcc/config/sparc/sol2-ci.asm
+++ b/gcc/config/sparc/sol2-ci.asm
@@ -48,7 +48,11 @@
.type _init,#function
.align 4
_init:
+#ifdef __sparcv9
+ save %sp, -176, %sp
+#else
save %sp, -96, %sp
+#endif
.section ".fini"
@@ -57,4 +61,8 @@ _init:
.type _fini,#function
.align 4
_fini:
+#ifdef __sparcv9
+ save %sp, -176, %sp
+#else
save %sp, -96, %sp
+#endif
diff --git a/gcc/config/sparc/sol2-cn.asm b/gcc/config/sparc/sol2-cn.asm
index 3c5d508c743..49e070f34f4 100644
--- a/gcc/config/sparc/sol2-cn.asm
+++ b/gcc/config/sparc/sol2-cn.asm
@@ -51,4 +51,4 @@
ret
restore
-! Th-th-th-that's all folks!
+! Th-th-th-that is all folks!
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 2c8c5f3f97b..9274f9d9108 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -107,7 +107,7 @@ Boston, MA 02111-1307, USA. */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
+ sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
/* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
@@ -193,6 +193,17 @@ Boston, MA 02111-1307, USA. */
#define MODDI3_LIBCALL "__rem64"
#define UMODDI3_LIBCALL "__urem64"
+#undef INIT_SUBTARGET_OPTABS
+#define INIT_SUBTARGET_OPTABS \
+ fixsfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, \
+ TARGET_ARCH64 ? "__ftol" : "__ftoll"); \
+ fixunssfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, \
+ TARGET_ARCH64 ? "__ftoul" : "__ftoull"); \
+ fixdfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, \
+ TARGET_ARCH64 ? "__dtol" : "__dtoll"); \
+ fixunsdfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, \
+ TARGET_ARCH64 ? "__dtoul" : "__dtoull")
+
/* No weird SPARC variants on Solaris */
#undef TARGET_LIVE_G0
#define TARGET_LIVE_G0 0
@@ -203,4 +214,23 @@ Boston, MA 02111-1307, USA. */
sparc_override_options will disable V8+ if not generating V9 code. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_V8PLUS)
+
+/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
+ traps available which can get and set the condition codes
+ reliably. */
+#undef MACHINE_STATE_SAVE
+#define MACHINE_STATE_SAVE(ID) \
+ unsigned long int ms_flags, ms_saveret; \
+ asm volatile("ta 0x20\n\t" \
+ "mov %%g1, %0\n\t" \
+ "mov %%g2, %1\n\t" \
+ : "=r" (ms_flags), "=r" (ms_saveret));
+
+#undef MACHINE_STATE_RESTORE
+#define MACHINE_STATE_RESTORE(ID) \
+ asm volatile("mov %0, %%g1\n\t" \
+ "mov %1, %%g2\n\t" \
+ "ta 0x21\n\t" \
+ : /* no outputs */ \
+ : "r" (ms_flags), "r" (ms_saveret));
diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h
index a6f3e72c1df..a1e4ef0c252 100644
--- a/gcc/config/sparc/sp64-elf.h
+++ b/gcc/config/sparc/sp64-elf.h
@@ -102,9 +102,10 @@ crtbegin.o%s \
/* The medium/anywhere code model practically requires us to put jump tables
in the text section as gcc is unable to distinguish LABEL_REF's of jump
tables from other label refs (when we need to). */
-/* ??? Revisit this. */
+/* But we now defer the tables to the end of the function, so we make
+ this 0 to not confuse the branch shortening code. */
#undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
/* System V Release 4 uses DWARF debugging info.
GDB doesn't support 64 bit stabs yet and the desired debug format is DWARF
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 5da733b8e07..ae207027b0f 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "expr.h"
#include "recog.h"
+#include "toplev.h"
/* 1 if the caller has placed an "unimp" insn immediately after the call.
This is used in v8 code when calling a function that returns a structure.
@@ -101,7 +102,6 @@ static char *frame_base_name;
static int frame_base_offset;
static rtx pic_setup_code PROTO((void));
-static rtx find_addr_reg PROTO((rtx));
static void sparc_init_modes PROTO((void));
static int save_regs PROTO((FILE *, int, int, char *,
int, int, int));
@@ -110,6 +110,10 @@ static void build_big_number PROTO((FILE *, int, char *));
static int function_arg_slotno PROTO((const CUMULATIVE_ARGS *,
enum machine_mode, tree, int, int,
int *, int *));
+static void sparc_output_addr_vec PROTO((rtx));
+static void sparc_output_addr_diff_vec PROTO((rtx));
+static void sparc_output_deferred_case_vectors PROTO((void));
+
#ifdef DWARF2_DEBUGGING_INFO
extern char *dwarf2out_cfi_label ();
@@ -138,7 +142,7 @@ struct sparc_cpu_select sparc_select[] =
{ (char *)0, "default", 1, 1 },
{ (char *)0, "-mcpu=", 1, 1 },
{ (char *)0, "-mtune=", 1, 0 },
- { 0, 0 }
+ { 0, 0, 0, 0 }
};
/* CPU type. This is set from TARGET_CPU_DEFAULT and -m{cpu,tune}=xxx. */
@@ -175,7 +179,7 @@ sparc_override_options ()
{ TARGET_CPU_supersparc, "supersparc" },
{ TARGET_CPU_v9, "v9" },
{ TARGET_CPU_ultrasparc, "ultrasparc" },
- { 0 }
+ { 0, 0 }
};
struct cpu_default *def;
/* Table of values for -m{cpu,tune}=. */
@@ -201,12 +205,12 @@ sparc_override_options ()
{ "v9", PROCESSOR_V9, MASK_ISA, MASK_V9 },
/* TI ultrasparc */
{ "ultrasparc", PROCESSOR_ULTRASPARC, MASK_ISA, MASK_V9 },
- { 0 }
+ { 0, 0, 0, 0 }
};
struct cpu_table *cpu;
struct sparc_cpu_select *sel;
int fpu;
-
+
#ifndef SPARC_BI_ARCH
/* Check for unsupported architecture size. */
if (! TARGET_64BIT != DEFAULT_ARCH32_P)
@@ -216,8 +220,25 @@ sparc_override_options ()
}
#endif
+ /* At the moment we don't allow different pointer size and architecture */
+ if (! TARGET_64BIT != ! TARGET_PTR64)
+ {
+ error ("-mptr%d not allowed on -m%d",
+ TARGET_PTR64 ? 64 : 32, TARGET_64BIT ? 64 : 32);
+ if (TARGET_64BIT)
+ target_flags |= MASK_PTR64;
+ else
+ target_flags &= ~MASK_PTR64;
+ }
+
/* Code model selection. */
sparc_cmodel = SPARC_DEFAULT_CMODEL;
+
+#ifdef SPARC_BI_ARCH
+ if (TARGET_ARCH32)
+ sparc_cmodel = CM_32;
+#endif
+
if (sparc_cmodel_string != NULL)
{
if (TARGET_ARCH64)
@@ -276,13 +297,17 @@ sparc_override_options ()
if (TARGET_V9 && TARGET_ARCH32)
target_flags |= MASK_DEPRECATED_V8_INSNS;
- /* V8PLUS requires V9 */
- if (! TARGET_V9)
+ /* V8PLUS requires V9, makes no sense in 64 bit mode. */
+ if (! TARGET_V9 || TARGET_ARCH64)
target_flags &= ~MASK_V8PLUS;
/* Don't use stack biasing in 32 bit mode. */
if (TARGET_ARCH32)
target_flags &= ~MASK_STACK_BIAS;
+
+ /* Don't allow -mvis if FPU is disabled. */
+ if (! TARGET_FPU)
+ target_flags &= ~MASK_VIS;
/* Validate -malign-loops= value, or provide default. */
if (sparc_align_loops_string)
@@ -346,14 +371,6 @@ v9_regcmp_p (code)
|| code == LE || code == GT);
}
-/* 32 bit registers are zero extended so only zero/non-zero comparisons
- work. */
-int
-v8plus_regcmp_p (code)
- enum rtx_code code;
-{
- return (code == EQ || code == NE);
-}
/* Operand constraints. */
@@ -400,7 +417,7 @@ fp_zero_operand (op)
int
intreg_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (register_operand (op, SImode)
|| (TARGET_ARCH64 && register_operand (op, DImode)));
@@ -520,7 +537,7 @@ symbolic_operand (op, mode)
int
symbolic_memory_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
@@ -551,7 +568,7 @@ label_ref_operand (op, mode)
int
sp64_medium_pic_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
/* Check for (const (minus (symbol_ref:GOT)
(const (minus (label) (pc))))). */
@@ -578,7 +595,7 @@ sp64_medium_pic_operand (op, mode)
int
data_segment_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -600,7 +617,7 @@ data_segment_operand (op, mode)
int
text_segment_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@@ -636,57 +653,9 @@ reg_or_nonsymb_mem_operand (op, mode)
}
int
-sparc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
-{
- if (register_operand (op, mode))
- return 1;
- if (GET_CODE (op) == CONST_INT)
- return SMALL_INT (op);
- if (GET_MODE (op) != mode)
- return 0;
- if (GET_CODE (op) == SUBREG)
- op = SUBREG_REG (op);
- if (GET_CODE (op) != MEM)
- return 0;
-
- op = XEXP (op, 0);
- if (GET_CODE (op) == LO_SUM)
- return (GET_CODE (XEXP (op, 0)) == REG
- && symbolic_operand (XEXP (op, 1), Pmode));
- return memory_address_p (mode, op);
-}
-
-int
-move_operand (op, mode)
- rtx op;
- enum machine_mode mode;
-{
- if (mode == DImode && arith_double_operand (op, mode))
- return 1;
- if (register_operand (op, mode))
- return 1;
- if (GET_CODE (op) == CONST_INT)
- return SMALL_INT (op) || SPARC_SETHI_P (INTVAL (op));
-
- if (GET_MODE (op) != mode)
- return 0;
- if (GET_CODE (op) == SUBREG)
- op = SUBREG_REG (op);
- if (GET_CODE (op) != MEM)
- return 0;
- op = XEXP (op, 0);
- if (GET_CODE (op) == LO_SUM)
- return (register_operand (XEXP (op, 0), Pmode)
- && CONSTANT_P (XEXP (op, 1)));
- return memory_address_p (mode, op);
-}
-
-int
splittable_symbolic_memory_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != MEM)
return 0;
@@ -698,7 +667,7 @@ splittable_symbolic_memory_operand (op, mode)
int
splittable_immediate_memory_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != MEM)
return 0;
@@ -712,7 +681,7 @@ splittable_immediate_memory_operand (op, mode)
int
eq_or_neq (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == EQ || GET_CODE (op) == NE);
}
@@ -723,7 +692,7 @@ eq_or_neq (op, mode)
int
normal_comp_operator (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
enum rtx_code code = GET_CODE (op);
@@ -743,7 +712,7 @@ normal_comp_operator (op, mode)
int
noov_compare_op (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
enum rtx_code code = GET_CODE (op);
@@ -762,7 +731,7 @@ noov_compare_op (op, mode)
int
v9_regcmp_op (op, mode)
register rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
enum rtx_code code = GET_CODE (op);
@@ -772,22 +741,12 @@ v9_regcmp_op (op, mode)
return v9_regcmp_p (code);
}
-int
-v8plus_regcmp_op (op, mode)
- register rtx op;
- enum machine_mode mode;
-{
- enum rtx_code code = GET_CODE (op);
-
- return (code == EQ || code == NE);
-}
-
/* Return 1 if this is a SIGN_EXTEND or ZERO_EXTEND operation. */
int
extend_op (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND;
}
@@ -799,7 +758,7 @@ extend_op (op, mode)
int
cc_arithop (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == AND
|| GET_CODE (op) == IOR
@@ -815,7 +774,7 @@ cc_arithop (op, mode)
int
cc_arithopn (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
/* XOR is not here because combine canonicalizes (xor (not ...) ...)
and (xor ... (not ...)) to (not (xor ...)). */
@@ -833,7 +792,8 @@ arith_operand (op, mode)
enum machine_mode mode;
{
int val;
- if (register_operand (op, mode))
+ if (register_operand (op, mode)
+ || GET_CODE (op) == CONSTANT_P_RTX)
return 1;
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -841,6 +801,73 @@ arith_operand (op, mode)
return SPARC_SIMM13_P (val);
}
+/* Return true if OP is a constant 4096 */
+
+int
+arith_4096_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ int val;
+ if (GET_CODE (op) != CONST_INT)
+ return 0;
+ val = INTVAL (op) & 0xffffffff;
+ return val == 4096;
+}
+
+/* Return true if OP is suitable as second operand for add/sub */
+
+int
+arith_add_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ return arith_operand (op, mode) || arith_4096_operand (op, mode);
+}
+
+/* Return true if OP is a CONST_INT or a CONST_DOUBLE which can fit in the
+ immediate field of OR and XOR instructions. Used for 64-bit
+ constant formation patterns. */
+int
+const64_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return ((GET_CODE (op) == CONST_INT
+ && SPARC_SIMM13_P (INTVAL (op)))
+#if HOST_BITS_PER_WIDE_INT != 64
+ || (GET_CODE (op) == CONST_DOUBLE
+ && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op))
+ && (CONST_DOUBLE_HIGH (op) ==
+ ((CONST_DOUBLE_LOW (op) & 0x80000000) != 0 ?
+ (HOST_WIDE_INT)0xffffffff : 0)))
+#endif
+ || GET_CODE (op) == CONSTANT_P_RTX);
+}
+
+/* The same, but only for sethi instructions. */
+int
+const64_high_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return ((GET_CODE (op) == CONST_INT
+ && (INTVAL (op) & 0xfffffc00) != 0
+ && SPARC_SETHI_P (INTVAL (op))
+#if HOST_BITS_PER_WIDE_INT != 64
+ /* Must be positive on non-64bit host else the
+ optimizer is fooled into thinking that sethi
+ sign extends, even though it does not. */
+ && INTVAL (op) >= 0
+#endif
+ )
+ || (GET_CODE (op) == CONST_DOUBLE
+ && CONST_DOUBLE_HIGH (op) == 0
+ && (CONST_DOUBLE_LOW (op) & 0xfffffc00) != 0
+ && SPARC_SETHI_P (CONST_DOUBLE_LOW (op)))
+ || GET_CODE (op) == CONSTANT_P_RTX);
+}
+
/* Return true if OP is a register, or is a CONST_INT that can fit in a
signed 11 bit immediate field. This is an acceptable SImode operand for
the movcc instructions. */
@@ -851,6 +878,7 @@ arith11_operand (op, mode)
enum machine_mode mode;
{
return (register_operand (op, mode)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| (GET_CODE (op) == CONST_INT && SPARC_SIMM11_P (INTVAL (op))));
}
@@ -864,6 +892,7 @@ arith10_operand (op, mode)
enum machine_mode mode;
{
return (register_operand (op, mode)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| (GET_CODE (op) == CONST_INT && SPARC_SIMM10_P (INTVAL (op))));
}
@@ -880,6 +909,7 @@ arith_double_operand (op, mode)
enum machine_mode mode;
{
return (register_operand (op, mode)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| (GET_CODE (op) == CONST_INT && SMALL_INT (op))
|| (! TARGET_ARCH64
&& GET_CODE (op) == CONST_DOUBLE
@@ -894,6 +924,30 @@ arith_double_operand (op, mode)
&& (CONST_DOUBLE_LOW (op) & 0x1000) == 0))));
}
+/* Return true if OP is a constant 4096 for DImode on ARCH64 */
+
+int
+arith_double_4096_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return (TARGET_ARCH64 &&
+ ((GET_CODE (op) == CONST_INT && INTVAL (op) == 4096) ||
+ (GET_CODE (op) == CONST_DOUBLE &&
+ CONST_DOUBLE_LOW (op) == 4096 &&
+ CONST_DOUBLE_HIGH (op) == 0)));
+}
+
+/* Return true if OP is suitable as second operand for add/sub in DImode */
+
+int
+arith_double_add_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ return arith_double_operand (op, mode) || arith_double_4096_operand (op, mode);
+}
+
/* Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that
can fit in an 11 bit immediate field. This is an acceptable DImode
operand for the movcc instructions. */
@@ -905,6 +959,7 @@ arith11_double_operand (op, mode)
enum machine_mode mode;
{
return (register_operand (op, mode)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| (GET_CODE (op) == CONST_DOUBLE
&& (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
&& (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x400) < 0x800
@@ -928,6 +983,7 @@ arith10_double_operand (op, mode)
enum machine_mode mode;
{
return (register_operand (op, mode)
+ || GET_CODE (op) == CONSTANT_P_RTX
|| (GET_CODE (op) == CONST_DOUBLE
&& (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
&& (unsigned) (CONST_DOUBLE_LOW (op) + 0x200) < 0x400
@@ -947,9 +1003,22 @@ arith10_double_operand (op, mode)
int
small_int (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return ((GET_CODE (op) == CONST_INT && SMALL_INT (op))
+ || GET_CODE (op) == CONSTANT_P_RTX);
+}
+
+int
+small_int_or_double (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
- return (GET_CODE (op) == CONST_INT && SMALL_INT (op));
+ return ((GET_CODE (op) == CONST_INT && SMALL_INT (op))
+ || (GET_CODE (op) == CONST_DOUBLE
+ && CONST_DOUBLE_HIGH (op) == 0
+ && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)))
+ || GET_CODE (op) == CONSTANT_P_RTX);
}
/* Recognize operand values for the umul instruction. That instruction sign
@@ -959,18 +1028,21 @@ small_int (op, mode)
int
uns_small_int (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
#if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */
- return (GET_CODE (op) == CONST_INT
- && ((INTVAL (op) >= 0 && INTVAL (op) < 0x1000)
- || (INTVAL (op) >= 0xFFFFF000 && INTVAL (op) < 0x100000000L)));
+ return ((GET_CODE (op) == CONST_INT
+ && ((INTVAL (op) >= 0 && INTVAL (op) < 0x1000)
+ || (INTVAL (op) >= 0xFFFFF000
+ && INTVAL (op) < 0x100000000)))
+ || GET_CODE (op) == CONSTANT_P_RTX);
#else
- return ((GET_CODE (op) == CONST_INT && (unsigned) INTVAL (op) < 0x1000)
- || (GET_CODE (op) == CONST_DOUBLE
- && CONST_DOUBLE_HIGH (op) == 0
- && (unsigned) CONST_DOUBLE_LOW (op) - 0xFFFFF000 < 0x1000));
+ return (((GET_CODE (op) == CONST_INT && (unsigned) INTVAL (op) < 0x1000)
+ || (GET_CODE (op) == CONST_DOUBLE
+ && CONST_DOUBLE_HIGH (op) == 0
+ && (unsigned) CONST_DOUBLE_LOW (op) - 0xFFFFF000 < 0x1000))
+ || GET_CODE (op) == CONSTANT_P_RTX);
#endif
}
@@ -986,11 +1058,951 @@ uns_arith_operand (op, mode)
int
clobbered_register (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == REG && call_used_regs[REGNO (op)]);
}
+
+/* Return 1 if OP is const0_rtx, used for TARGET_LIVE_G0 insns. */
+
+int
+zero_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return (op == const0_rtx || GET_CODE (op) == CONSTANT_P_RTX);
+}
+
+/* Return 1 if OP is a valid operand for the source of a move insn. */
+
+int
+input_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ /* If both modes are non-void they must be the same. */
+ if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
+ return 0;
+
+ /* Allow any one instruction integer constant, and all CONST_INT
+ variants when we are working in DImode and !arch64. */
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && ((GET_CODE (op) == CONST_INT
+ && ((SPARC_SETHI_P (INTVAL (op))
+ && (! TARGET_ARCH64
+ || (INTVAL (op) >= 0)
+ || mode == SImode))
+ || SPARC_SIMM13_P (INTVAL (op))
+ || (mode == DImode
+ && ! TARGET_ARCH64)))
+ || (TARGET_ARCH64
+ && GET_CODE (op) == CONST_DOUBLE
+ && ((CONST_DOUBLE_HIGH (op) == 0
+ && SPARC_SETHI_P (CONST_DOUBLE_LOW (op)))
+ ||
+#if HOST_BITS_PER_WIDE_INT == 64
+ (CONST_DOUBLE_HIGH (op) == 0
+ && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)))
+#else
+ (SPARC_SIMM13_P (CONST_DOUBLE_LOW (op))
+ && (((CONST_DOUBLE_LOW (op) & 0x80000000) == 0
+ && CONST_DOUBLE_HIGH (op) == 0)
+ || (CONST_DOUBLE_HIGH (op) == -1)))
+#endif
+ ))))
+ return 1;
+
+ /* Always match this. */
+ if (GET_CODE (op) == CONSTANT_P_RTX)
+ return 1;
+
+ /* If !arch64 and this is a DImode const, allow it so that
+ the splits can be generated. */
+ if (! TARGET_ARCH64
+ && mode == DImode
+ && GET_CODE (op) == CONST_DOUBLE)
+ return 1;
+
+ if (register_operand (op, mode))
+ return 1;
+
+ /* If this is a SUBREG, look inside so that we handle
+ paradoxical ones. */
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ /* Check for valid MEM forms. */
+ if (GET_CODE (op) == MEM)
+ {
+ rtx inside = XEXP (op, 0);
+
+ if (GET_CODE (inside) == LO_SUM)
+ {
+ /* We can't allow these because all of the splits
+ (eventually as they trickle down into DFmode
+ splits) require offsettable memory references. */
+ if (! TARGET_V9
+ && GET_MODE (op) == TFmode)
+ return 0;
+
+ return (register_operand (XEXP (inside, 0), Pmode)
+ && CONSTANT_P (XEXP (inside, 1)));
+ }
+ return memory_address_p (mode, inside);
+ }
+
+ return 0;
+}
+
+
+/* We know it can't be done in one insn when we get here,
+ the movsi expander guarentees this. */
+void
+sparc_emit_set_const32 (op0, op1)
+ rtx op0;
+ rtx op1;
+{
+ enum machine_mode mode = GET_MODE (op0);
+ rtx temp;
+
+ if (GET_CODE (op1) == CONST_INT)
+ {
+ HOST_WIDE_INT value = INTVAL (op1);
+
+ if (SPARC_SETHI_P (value)
+ || SPARC_SIMM13_P (value))
+ abort ();
+ }
+
+ /* Full 2-insn decomposition is needed. */
+ if (reload_in_progress || reload_completed)
+ temp = op0;
+ else
+ temp = gen_reg_rtx (mode);
+
+ if (GET_CODE (op1) == CONST_INT)
+ {
+ /* Emit them as real moves instead of a HIGH/LO_SUM,
+ this way CSE can see everything and reuse intermediate
+ values if it wants. */
+ if (TARGET_ARCH64
+ && HOST_BITS_PER_WIDE_INT != 64
+ && (INTVAL (op1) & 0x80000000) != 0)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode,
+ temp,
+ gen_rtx_CONST_DOUBLE (VOIDmode, const0_rtx,
+ INTVAL (op1) & 0xfffffc00, 0)));
+ }
+ else
+ {
+ emit_insn (gen_rtx_SET (VOIDmode,
+ temp,
+ GEN_INT (INTVAL (op1) & 0xfffffc00)));
+ }
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_rtx_IOR (mode,
+ temp,
+ GEN_INT (INTVAL (op1) & 0x3ff))));
+ }
+ else
+ {
+ /* A symbol, emit in the traditional way. */
+ emit_insn (gen_rtx_SET (VOIDmode,
+ temp,
+ gen_rtx_HIGH (mode,
+ op1)));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_rtx_LO_SUM (mode,
+ temp,
+ op1)));
+
+ }
+}
+
+/* Sparc-v9 code-model support. */
+void
+sparc_emit_set_symbolic_const64 (op0, op1, temp1)
+ rtx op0;
+ rtx op1;
+ rtx temp1;
+{
+ switch (sparc_cmodel)
+ {
+ case CM_MEDLOW:
+ /* The range spanned by all instructions in the object is less
+ than 2^31 bytes (2GB) and the distance from any instruction
+ to the location of the label _GLOBAL_OFFSET_TABLE_ is less
+ than 2^31 bytes (2GB).
+
+ The executable must be in the low 4TB of the virtual address
+ space.
+
+ sethi %hi(symbol), %temp
+ or %temp, %lo(symbol), %reg */
+ emit_insn (gen_rtx_SET (VOIDmode, temp1, gen_rtx_HIGH (DImode, op1)));
+ emit_insn (gen_rtx_SET (VOIDmode, op0, gen_rtx_LO_SUM (DImode, temp1, op1)));
+ break;
+
+ case CM_MEDMID:
+ /* The range spanned by all instructions in the object is less
+ than 2^31 bytes (2GB) and the distance from any instruction
+ to the location of the label _GLOBAL_OFFSET_TABLE_ is less
+ than 2^31 bytes (2GB).
+
+ The executable must be in the low 16TB of the virtual address
+ space.
+
+ sethi %h44(symbol), %temp1
+ or %temp1, %m44(symbol), %temp2
+ sllx %temp2, 12, %temp3
+ or %temp3, %l44(symbol), %reg */
+ emit_insn (gen_seth44 (op0, op1));
+ emit_insn (gen_setm44 (op0, op0, op1));
+ emit_insn (gen_rtx_SET (VOIDmode, temp1,
+ gen_rtx_ASHIFT (DImode, op0, GEN_INT (12))));
+ emit_insn (gen_setl44 (op0, temp1, op1));
+ break;
+
+ case CM_MEDANY:
+ /* The range spanned by all instructions in the object is less
+ than 2^31 bytes (2GB) and the distance from any instruction
+ to the location of the label _GLOBAL_OFFSET_TABLE_ is less
+ than 2^31 bytes (2GB).
+
+ The executable can be placed anywhere in the virtual address
+ space.
+
+ sethi %hh(symbol), %temp1
+ sethi %lm(symbol), %temp2
+ or %temp1, %hm(symbol), %temp3
+ or %temp2, %lo(symbol), %temp4
+ sllx %temp3, 32, %temp5
+ or %temp4, %temp5, %reg */
+
+ /* Getting this right wrt. reloading is really tricky.
+ We _MUST_ have a seperate temporary at this point,
+ if we don't barf immediately instead of generating
+ incorrect code. */
+ if (temp1 == op0)
+ abort ();
+
+ emit_insn (gen_sethh (op0, op1));
+ emit_insn (gen_setlm (temp1, op1));
+ emit_insn (gen_sethm (op0, op0, op1));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_ASHIFT (DImode, op0, GEN_INT (32))));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_PLUS (DImode, op0, temp1)));
+ emit_insn (gen_setlo (op0, op0, op1));
+ break;
+
+ case CM_EMBMEDANY:
+ /* Old old old backwards compatibility kruft here.
+ Essentially it is MEDLOW with a fixed 64-bit
+ virtual base added to all data segment addresses.
+ Text-segment stuff is computed like MEDANY, we can't
+ reuse the code above because the relocation knobs
+ look different.
+
+ Data segment: sethi %hi(symbol), %temp1
+ or %temp1, %lo(symbol), %temp2
+ add %temp2, EMBMEDANY_BASE_REG, %reg
+
+ Text segment: sethi %uhi(symbol), %temp1
+ sethi %hi(symbol), %temp2
+ or %temp1, %ulo(symbol), %temp3
+ or %temp2, %lo(symbol), %temp4
+ sllx %temp3, 32, %temp5
+ or %temp4, %temp5, %reg */
+ if (data_segment_operand (op1, GET_MODE (op1)))
+ {
+ emit_insn (gen_embmedany_sethi (temp1, op1));
+ emit_insn (gen_embmedany_brsum (op0, temp1));
+ emit_insn (gen_embmedany_losum (op0, op0, op1));
+ }
+ else
+ {
+ /* Getting this right wrt. reloading is really tricky.
+ We _MUST_ have a seperate temporary at this point,
+ so we barf immediately instead of generating
+ incorrect code. */
+ if (temp1 == op0)
+ abort ();
+
+ emit_insn (gen_embmedany_textuhi (op0, op1));
+ emit_insn (gen_embmedany_texthi (temp1, op1));
+ emit_insn (gen_embmedany_textulo (op0, op0, op1));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_ASHIFT (DImode, op0, GEN_INT (32))));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_PLUS (DImode, op0, temp1)));
+ emit_insn (gen_embmedany_textlo (op0, op0, op1));
+ }
+ break;
+
+ default:
+ abort();
+ }
+}
+
+/* These avoid problems when cross compiling. If we do not
+ go through all this hair then the optimizer will see
+ invalid REG_EQUAL notes or in some cases none at all. */
+static void sparc_emit_set_safe_HIGH64 PROTO ((rtx, HOST_WIDE_INT));
+static rtx gen_safe_SET64 PROTO ((rtx, HOST_WIDE_INT));
+static rtx gen_safe_OR64 PROTO ((rtx, HOST_WIDE_INT));
+static rtx gen_safe_XOR64 PROTO ((rtx, HOST_WIDE_INT));
+
+#if HOST_BITS_PER_WIDE_INT == 64
+#define GEN_HIGHINT64(__x) GEN_INT ((__x) & 0xfffffc00)
+#define GEN_INT64(__x) GEN_INT (__x)
+#else
+#define GEN_HIGHINT64(__x) \
+ gen_rtx_CONST_DOUBLE (VOIDmode, const0_rtx, \
+ (__x) & 0xfffffc00, 0)
+#define GEN_INT64(__x) \
+ gen_rtx_CONST_DOUBLE (VOIDmode, const0_rtx, \
+ (__x) & 0xffffffff, \
+ ((__x) & 0x80000000 \
+ ? 0xffffffff : 0))
+#endif
+
+/* The optimizer is not to assume anything about exactly
+ which bits are set for a HIGH, they are unspecified.
+ Unfortunately this leads to many missed optimizations
+ during CSE. We mask out the non-HIGH bits, and matches
+ a plain movdi, to alleviate this problem. */
+static void
+sparc_emit_set_safe_HIGH64 (dest, val)
+ rtx dest;
+ HOST_WIDE_INT val;
+{
+ emit_insn (gen_rtx_SET (VOIDmode, dest, GEN_HIGHINT64 (val)));
+}
+
+static rtx
+gen_safe_SET64 (dest, val)
+ rtx dest;
+ HOST_WIDE_INT val;
+{
+ return gen_rtx_SET (VOIDmode, dest, GEN_INT64 (val));
+}
+
+static rtx
+gen_safe_OR64 (src, val)
+ rtx src;
+ HOST_WIDE_INT val;
+{
+ return gen_rtx_IOR (DImode, src, GEN_INT64 (val));
+}
+
+static rtx
+gen_safe_XOR64 (src, val)
+ rtx src;
+ HOST_WIDE_INT val;
+{
+ return gen_rtx_XOR (DImode, src, GEN_INT64 (val));
+}
+
+/* Worker routines for 64-bit constant formation on arch64.
+ One of the key things to be doing in these emissions is
+ to create as many temp REGs as possible. This makes it
+ possible for half-built constants to be used later when
+ such values are similar to something required later on.
+ Without doing this, the optimizer cannot see such
+ opportunities. */
+
+static void sparc_emit_set_const64_quick1
+ PROTO((rtx, rtx, unsigned HOST_WIDE_INT, int));
+
+static void
+sparc_emit_set_const64_quick1 (op0, temp, low_bits, is_neg)
+ rtx op0;
+ rtx temp;
+ unsigned HOST_WIDE_INT low_bits;
+ int is_neg;
+{
+ unsigned HOST_WIDE_INT high_bits;
+
+ if (is_neg)
+ high_bits = (~low_bits) & 0xffffffff;
+ else
+ high_bits = low_bits;
+
+ sparc_emit_set_safe_HIGH64 (temp, high_bits);
+ if (!is_neg)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_safe_OR64 (temp, (high_bits & 0x3ff))));
+ }
+ else
+ {
+ /* If we are XOR'ing with -1, then we should emit a one's complement
+ instead. This way the combiner will notice logical operations
+ such as ANDN later on and substitute. */
+ if ((low_bits & 0x3ff) == 0x3ff)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_NOT (DImode, temp)));
+ }
+ else
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_safe_XOR64 (temp,
+ (-0x400 | (low_bits & 0x3ff)))));
+ }
+ }
+}
+
+static void sparc_emit_set_const64_quick2
+ PROTO((rtx, rtx, unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT, int));
+
+static void
+sparc_emit_set_const64_quick2 (op0, temp, high_bits, low_immediate, shift_count)
+ rtx op0;
+ rtx temp;
+ unsigned HOST_WIDE_INT high_bits;
+ unsigned HOST_WIDE_INT low_immediate;
+ int shift_count;
+{
+ rtx temp2 = op0;
+
+ if ((high_bits & 0xfffffc00) != 0)
+ {
+ sparc_emit_set_safe_HIGH64 (temp, high_bits);
+ if ((high_bits & ~0xfffffc00) != 0)
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_safe_OR64 (temp, (high_bits & 0x3ff))));
+ else
+ temp2 = temp;
+ }
+ else
+ {
+ emit_insn (gen_safe_SET64 (temp, high_bits));
+ temp2 = temp;
+ }
+
+ /* Now shift it up into place. */
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_ASHIFT (DImode, temp2,
+ GEN_INT (shift_count))));
+
+ /* If there is a low immediate part piece, finish up by
+ putting that in as well. */
+ if (low_immediate != 0)
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_safe_OR64 (op0, low_immediate)));
+}
+
+static void sparc_emit_set_const64_longway
+ PROTO((rtx, rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT));
+
+/* Full 64-bit constant decomposition. Even though this is the
+ 'worst' case, we still optimize a few things away. */
+static void
+sparc_emit_set_const64_longway (op0, temp, high_bits, low_bits)
+ rtx op0;
+ rtx temp;
+ unsigned HOST_WIDE_INT high_bits;
+ unsigned HOST_WIDE_INT low_bits;
+{
+ rtx sub_temp;
+
+ if (reload_in_progress || reload_completed)
+ sub_temp = op0;
+ else
+ sub_temp = gen_reg_rtx (DImode);
+
+ if ((high_bits & 0xfffffc00) != 0)
+ {
+ sparc_emit_set_safe_HIGH64 (temp, high_bits);
+ if ((high_bits & ~0xfffffc00) != 0)
+ emit_insn (gen_rtx_SET (VOIDmode,
+ sub_temp,
+ gen_safe_OR64 (temp, (high_bits & 0x3ff))));
+ else
+ sub_temp = temp;
+ }
+ else
+ {
+ emit_insn (gen_safe_SET64 (temp, high_bits));
+ sub_temp = temp;
+ }
+
+ if (!reload_in_progress && !reload_completed)
+ {
+ rtx temp2 = gen_reg_rtx (DImode);
+ rtx temp3 = gen_reg_rtx (DImode);
+ rtx temp4 = gen_reg_rtx (DImode);
+
+ emit_insn (gen_rtx_SET (VOIDmode, temp4,
+ gen_rtx_ASHIFT (DImode, sub_temp,
+ GEN_INT (32))));
+
+ sparc_emit_set_safe_HIGH64 (temp2, low_bits);
+ if ((low_bits & ~0xfffffc00) != 0)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, temp3,
+ gen_safe_OR64 (temp2, (low_bits & 0x3ff))));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_PLUS (DImode, temp4, temp3)));
+ }
+ else
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_PLUS (DImode, temp4, temp2)));
+ }
+ }
+ else
+ {
+ rtx low1 = GEN_INT ((low_bits >> (32 - 12)) & 0xfff);
+ rtx low2 = GEN_INT ((low_bits >> (32 - 12 - 12)) & 0xfff);
+ rtx low3 = GEN_INT ((low_bits >> (32 - 12 - 12 - 8)) & 0x0ff);
+ int to_shift = 12;
+
+ /* We are in the middle of reload, so this is really
+ painful. However we do still make an attempt to
+ avoid emitting truly stupid code. */
+ if (low1 != const0_rtx)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_ASHIFT (DImode, sub_temp,
+ GEN_INT (to_shift))));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_IOR (DImode, op0, low1)));
+ sub_temp = op0;
+ to_shift = 12;
+ }
+ else
+ {
+ to_shift += 12;
+ }
+ if (low2 != const0_rtx)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_ASHIFT (DImode, sub_temp,
+ GEN_INT (to_shift))));
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_IOR (DImode, op0, low2)));
+ sub_temp = op0;
+ to_shift = 8;
+ }
+ else
+ {
+ to_shift += 8;
+ }
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_ASHIFT (DImode, sub_temp,
+ GEN_INT (to_shift))));
+ if (low3 != const0_rtx)
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_IOR (DImode, op0, low3)));
+ /* phew... */
+ }
+}
+
+/* Analyze a 64-bit constant for certain properties. */
+static void analyze_64bit_constant
+ PROTO((unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT,
+ int *, int *, int *));
+
+static void
+analyze_64bit_constant (high_bits, low_bits, hbsp, lbsp, abbasp)
+ unsigned HOST_WIDE_INT high_bits, low_bits;
+ int *hbsp, *lbsp, *abbasp;
+{
+ int lowest_bit_set, highest_bit_set, all_bits_between_are_set;
+ int i;
+
+ lowest_bit_set = highest_bit_set = -1;
+ i = 0;
+ do
+ {
+ if ((lowest_bit_set == -1)
+ && ((low_bits >> i) & 1))
+ lowest_bit_set = i;
+ if ((highest_bit_set == -1)
+ && ((high_bits >> (32 - i - 1)) & 1))
+ highest_bit_set = (64 - i - 1);
+ }
+ while (++i < 32
+ && ((highest_bit_set == -1)
+ || (lowest_bit_set == -1)));
+ if (i == 32)
+ {
+ i = 0;
+ do
+ {
+ if ((lowest_bit_set == -1)
+ && ((high_bits >> i) & 1))
+ lowest_bit_set = i + 32;
+ if ((highest_bit_set == -1)
+ && ((low_bits >> (32 - i - 1)) & 1))
+ highest_bit_set = 32 - i - 1;
+ }
+ while (++i < 32
+ && ((highest_bit_set == -1)
+ || (lowest_bit_set == -1)));
+ }
+ /* If there are no bits set this should have gone out
+ as one instruction! */
+ if (lowest_bit_set == -1
+ || highest_bit_set == -1)
+ abort ();
+ all_bits_between_are_set = 1;
+ for (i = lowest_bit_set; i <= highest_bit_set; i++)
+ {
+ if (i < 32)
+ {
+ if ((low_bits & (1 << i)) != 0)
+ continue;
+ }
+ else
+ {
+ if ((high_bits & (1 << (i - 32))) != 0)
+ continue;
+ }
+ all_bits_between_are_set = 0;
+ break;
+ }
+ *hbsp = highest_bit_set;
+ *lbsp = lowest_bit_set;
+ *abbasp = all_bits_between_are_set;
+}
+
+static int const64_is_2insns
+ PROTO((unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT));
+
+static int
+const64_is_2insns (high_bits, low_bits)
+ unsigned HOST_WIDE_INT high_bits, low_bits;
+{
+ int highest_bit_set, lowest_bit_set, all_bits_between_are_set;
+
+ if (high_bits == 0
+ || high_bits == 0xffffffff)
+ return 1;
+
+ analyze_64bit_constant (high_bits, low_bits,
+ &highest_bit_set, &lowest_bit_set,
+ &all_bits_between_are_set);
+
+ if ((highest_bit_set == 63
+ || lowest_bit_set == 0)
+ && all_bits_between_are_set != 0)
+ return 1;
+
+ if ((highest_bit_set - lowest_bit_set) < 21)
+ return 1;
+
+ return 0;
+}
+
+static unsigned HOST_WIDE_INT create_simple_focus_bits
+ PROTO((unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT,
+ int, int));
+
+static unsigned HOST_WIDE_INT
+create_simple_focus_bits (high_bits, low_bits, lowest_bit_set, shift)
+ unsigned HOST_WIDE_INT high_bits, low_bits;
+ int lowest_bit_set, shift;
+{
+ HOST_WIDE_INT hi, lo;
+
+ if (lowest_bit_set < 32)
+ {
+ lo = (low_bits >> lowest_bit_set) << shift;
+ hi = ((high_bits << (32 - lowest_bit_set)) << shift);
+ }
+ else
+ {
+ lo = 0;
+ hi = ((high_bits >> (lowest_bit_set - 32)) << shift);
+ }
+ if (hi & lo)
+ abort ();
+ return (hi | lo);
+}
+
+/* Here we are sure to be arch64 and this is an integer constant
+ being loaded into a register. Emit the most efficient
+ insn sequence possible. Detection of all the 1-insn cases
+ has been done already. */
+void
+sparc_emit_set_const64 (op0, op1)
+ rtx op0;
+ rtx op1;
+{
+ unsigned HOST_WIDE_INT high_bits, low_bits;
+ int lowest_bit_set, highest_bit_set;
+ int all_bits_between_are_set;
+ rtx temp;
+
+ /* Sanity check that we know what we are working with. */
+ if (! TARGET_ARCH64
+ || GET_CODE (op0) != REG
+ || (REGNO (op0) >= SPARC_FIRST_FP_REG
+ && REGNO (op0) <= SPARC_LAST_V9_FP_REG))
+ abort ();
+
+ if (reload_in_progress || reload_completed)
+ temp = op0;
+ else
+ temp = gen_reg_rtx (DImode);
+
+ if (GET_CODE (op1) != CONST_DOUBLE
+ && GET_CODE (op1) != CONST_INT)
+ {
+ sparc_emit_set_symbolic_const64 (op0, op1, temp);
+ return;
+ }
+
+ if (GET_CODE (op1) == CONST_DOUBLE)
+ {
+#if HOST_BITS_PER_WIDE_INT == 64
+ high_bits = (CONST_DOUBLE_LOW (op1) >> 32) & 0xffffffff;
+ low_bits = CONST_DOUBLE_LOW (op1) & 0xffffffff;
+#else
+ high_bits = CONST_DOUBLE_HIGH (op1);
+ low_bits = CONST_DOUBLE_LOW (op1);
+#endif
+ }
+ else
+ {
+#if HOST_BITS_PER_WIDE_INT == 64
+ high_bits = ((INTVAL (op1) >> 32) & 0xffffffff);
+ low_bits = (INTVAL (op1) & 0xffffffff);
+#else
+ high_bits = ((INTVAL (op1) < 0) ?
+ 0xffffffff :
+ 0x00000000);
+ low_bits = INTVAL (op1);
+#endif
+ }
+
+ /* low_bits bits 0 --> 31
+ high_bits bits 32 --> 63 */
+
+ analyze_64bit_constant (high_bits, low_bits,
+ &highest_bit_set, &lowest_bit_set,
+ &all_bits_between_are_set);
+
+ /* First try for a 2-insn sequence. */
+
+ /* These situations are preferred because the optimizer can
+ * do more things with them:
+ * 1) mov -1, %reg
+ * sllx %reg, shift, %reg
+ * 2) mov -1, %reg
+ * srlx %reg, shift, %reg
+ * 3) mov some_small_const, %reg
+ * sllx %reg, shift, %reg
+ */
+ if (((highest_bit_set == 63
+ || lowest_bit_set == 0)
+ && all_bits_between_are_set != 0)
+ || ((highest_bit_set - lowest_bit_set) < 12))
+ {
+ HOST_WIDE_INT the_const = -1;
+ int shift = lowest_bit_set;
+
+ if ((highest_bit_set != 63
+ && lowest_bit_set != 0)
+ || all_bits_between_are_set == 0)
+ {
+ the_const =
+ create_simple_focus_bits (high_bits, low_bits,
+ lowest_bit_set, 0);
+ }
+ else if (lowest_bit_set == 0)
+ shift = -(63 - highest_bit_set);
+
+ if (! SPARC_SIMM13_P (the_const))
+ abort ();
+
+ emit_insn (gen_safe_SET64 (temp, the_const));
+ if (shift > 0)
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_rtx_ASHIFT (DImode,
+ temp,
+ GEN_INT (shift))));
+ else if (shift < 0)
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_rtx_LSHIFTRT (DImode,
+ temp,
+ GEN_INT (-shift))));
+ else
+ abort ();
+ return;
+ }
+
+ /* Now a range of 22 or less bits set somewhere.
+ * 1) sethi %hi(focus_bits), %reg
+ * sllx %reg, shift, %reg
+ * 2) sethi %hi(focus_bits), %reg
+ * srlx %reg, shift, %reg
+ */
+ if ((highest_bit_set - lowest_bit_set) < 21)
+ {
+ unsigned HOST_WIDE_INT focus_bits =
+ create_simple_focus_bits (high_bits, low_bits,
+ lowest_bit_set, 10);
+
+ if (! SPARC_SETHI_P (focus_bits))
+ abort ();
+
+ sparc_emit_set_safe_HIGH64 (temp, focus_bits);
+
+ /* If lowest_bit_set == 10 then a sethi alone could have done it. */
+ if (lowest_bit_set < 10)
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_rtx_LSHIFTRT (DImode, temp,
+ GEN_INT (10 - lowest_bit_set))));
+ else if (lowest_bit_set > 10)
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_rtx_ASHIFT (DImode, temp,
+ GEN_INT (lowest_bit_set - 10))));
+ else
+ abort ();
+ return;
+ }
+
+ /* 1) sethi %hi(low_bits), %reg
+ * or %reg, %lo(low_bits), %reg
+ * 2) sethi %hi(~low_bits), %reg
+ * xor %reg, %lo(-0x400 | (low_bits & 0x3ff)), %reg
+ */
+ if (high_bits == 0
+ || high_bits == 0xffffffff)
+ {
+ sparc_emit_set_const64_quick1 (op0, temp, low_bits,
+ (high_bits == 0xffffffff));
+ return;
+ }
+
+ /* Now, try 3-insn sequences. */
+
+ /* 1) sethi %hi(high_bits), %reg
+ * or %reg, %lo(high_bits), %reg
+ * sllx %reg, 32, %reg
+ */
+ if (low_bits == 0)
+ {
+ sparc_emit_set_const64_quick2 (op0, temp, high_bits, 0, 32);
+ return;
+ }
+
+ /* We may be able to do something quick
+ when the constant is negated, so try that. */
+ if (const64_is_2insns ((~high_bits) & 0xffffffff,
+ (~low_bits) & 0xfffffc00))
+ {
+ /* NOTE: The trailing bits get XOR'd so we need the
+ non-negated bits, not the negated ones. */
+ unsigned HOST_WIDE_INT trailing_bits = low_bits & 0x3ff;
+
+ if ((((~high_bits) & 0xffffffff) == 0
+ && ((~low_bits) & 0x80000000) == 0)
+ || (((~high_bits) & 0xffffffff) == 0xffffffff
+ && ((~low_bits) & 0x80000000) != 0))
+ {
+ int fast_int = (~low_bits & 0xffffffff);
+
+ if ((SPARC_SETHI_P (fast_int)
+ && (~high_bits & 0xffffffff) == 0)
+ || SPARC_SIMM13_P (fast_int))
+ emit_insn (gen_safe_SET64 (temp, fast_int));
+ else
+ sparc_emit_set_const64 (temp, GEN_INT64 (fast_int));
+ }
+ else
+ {
+ rtx negated_const;
+#if HOST_BITS_PER_WIDE_INT == 64
+ negated_const = GEN_INT (((~low_bits) & 0xfffffc00) |
+ (((HOST_WIDE_INT)((~high_bits) & 0xffffffff))<<32));
+#else
+ negated_const = gen_rtx_CONST_DOUBLE (DImode, const0_rtx,
+ (~low_bits) & 0xfffffc00,
+ (~high_bits) & 0xffffffff);
+#endif
+ sparc_emit_set_const64 (temp, negated_const);
+ }
+
+ /* If we are XOR'ing with -1, then we should emit a one's complement
+ instead. This way the combiner will notice logical operations
+ such as ANDN later on and substitute. */
+ if (trailing_bits == 0x3ff)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, op0,
+ gen_rtx_NOT (DImode, temp)));
+ }
+ else
+ {
+ emit_insn (gen_rtx_SET (VOIDmode,
+ op0,
+ gen_safe_XOR64 (temp,
+ (-0x400 | trailing_bits))));
+ }
+ return;
+ }
+
+ /* 1) sethi %hi(xxx), %reg
+ * or %reg, %lo(xxx), %reg
+ * sllx %reg, yyy, %reg
+ *
+ * ??? This is just a generalized version of the low_bits==0
+ * thing above, FIXME...
+ */
+ if ((highest_bit_set - lowest_bit_set) < 32)
+ {
+ unsigned HOST_WIDE_INT focus_bits =
+ create_simple_focus_bits (high_bits, low_bits,
+ lowest_bit_set, 0);
+
+ /* We can't get here in this state. */
+ if (highest_bit_set < 32
+ || lowest_bit_set >= 32)
+ abort ();
+
+ /* So what we know is that the set bits straddle the
+ middle of the 64-bit word. */
+ sparc_emit_set_const64_quick2 (op0, temp,
+ focus_bits, 0,
+ lowest_bit_set);
+ return;
+ }
+
+ /* 1) sethi %hi(high_bits), %reg
+ * or %reg, %lo(high_bits), %reg
+ * sllx %reg, 32, %reg
+ * or %reg, low_bits, %reg
+ */
+ if (SPARC_SIMM13_P(low_bits)
+ && ((int)low_bits > 0))
+ {
+ sparc_emit_set_const64_quick2 (op0, temp, high_bits, low_bits, 32);
+ return;
+ }
+
+ /* The easiest way when all else fails, is full decomposition. */
+#if 0
+ printf ("sparc_emit_set_const64: Hard constant [%08lx%08lx] neg[%08lx%08lx]\n",
+ high_bits, low_bits, ~high_bits, ~low_bits);
+#endif
+ sparc_emit_set_const64_longway (op0, temp, high_bits, low_bits);
+}
+
/* X and Y are two things to compare using CODE. Emit the compare insn and
return the rtx for the cc reg in the proper mode. */
@@ -1038,25 +2050,18 @@ gen_compare_reg (code, x, y)
prev_args[reg][1] = y;
next_fcc_reg = (next_fcc_reg + 1) & 3;
}
- cc_reg = gen_rtx (REG, mode, reg + SPARC_FIRST_V9_FCC_REG);
+ cc_reg = gen_rtx_REG (mode, reg + SPARC_FIRST_V9_FCC_REG);
}
#else
cc_reg = gen_reg_rtx (mode);
#endif /* ! experiment */
else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
- cc_reg = gen_rtx (REG, mode, SPARC_FCC_REG);
+ cc_reg = gen_rtx_REG (mode, SPARC_FCC_REG);
else
- cc_reg = gen_rtx (REG, mode, SPARC_ICC_REG);
+ cc_reg = gen_rtx_REG (mode, SPARC_ICC_REG);
- if (TARGET_V8PLUS && mode == CCXmode)
- {
- emit_insn (gen_cmpdi_v8plus (x, y));
- }
- else
- {
- emit_insn (gen_rtx (SET, VOIDmode, cc_reg,
- gen_rtx (COMPARE, mode, x, y)));
- }
+ emit_insn (gen_rtx_SET (VOIDmode, cc_reg,
+ gen_rtx_COMPARE (mode, x, y)));
return cc_reg;
}
@@ -1122,17 +2127,17 @@ gen_v9_scc (compare_code, operands)
&& GET_MODE (operands[0]) == DImode
&& GET_MODE (op0) == DImode)
{
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], op0));
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (IF_THEN_ELSE, DImode,
- gen_rtx (compare_code, DImode,
- op0, const0_rtx),
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], op0));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_IF_THEN_ELSE (DImode,
+ gen_rtx_fmt_ee (compare_code, DImode,
+ op0, const0_rtx),
const1_rtx,
operands[0])));
return 1;
}
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx));
if (GET_MODE (op0) != DImode)
{
temp = gen_reg_rtx (DImode);
@@ -1140,10 +2145,10 @@ gen_v9_scc (compare_code, operands)
}
else
temp = op0;
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (IF_THEN_ELSE, GET_MODE (operands[0]),
- gen_rtx (compare_code, DImode,
- temp, const0_rtx),
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]),
+ gen_rtx_fmt_ee (compare_code, DImode,
+ temp, const0_rtx),
const1_rtx,
operands[0])));
return 1;
@@ -1162,12 +2167,12 @@ gen_v9_scc (compare_code, operands)
default :
abort ();
}
- emit_insn (gen_rtx (SET, VOIDmode, operands[0], const0_rtx));
- emit_insn (gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (IF_THEN_ELSE, GET_MODE (operands[0]),
- gen_rtx (compare_code,
- GET_MODE (operands[1]),
- operands[1], const0_rtx),
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]),
+ gen_rtx_fmt_ee (compare_code,
+ GET_MODE (operands[1]),
+ operands[1], const0_rtx),
const1_rtx, operands[0])));
return 1;
}
@@ -1182,12 +2187,12 @@ emit_v9_brxx_insn (code, op0, label)
enum rtx_code code;
rtx op0, label;
{
- emit_jump_insn (gen_rtx (SET, VOIDmode,
+ emit_jump_insn (gen_rtx_SET (VOIDmode,
pc_rtx,
- gen_rtx (IF_THEN_ELSE, VOIDmode,
- gen_rtx (code, GET_MODE (op0),
- op0, const0_rtx),
- gen_rtx (LABEL_REF, VOIDmode, label),
+ gen_rtx_IF_THEN_ELSE (VOIDmode,
+ gen_rtx_fmt_ee (code, GET_MODE (op0),
+ op0, const0_rtx),
+ gen_rtx_LABEL_REF (VOIDmode, label),
pc_rtx)));
}
@@ -1254,9 +2259,14 @@ eligible_for_epilogue_delay (trial, slot)
src = SET_SRC (pat);
- /* This matches "*return_[qhs]i". */
+ /* This matches "*return_[qhs]i" or even "*return_di" on TARGET_ARCH64. */
if (arith_operand (src, GET_MODE (src)))
- return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
+ {
+ if (TARGET_ARCH64)
+ return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode);
+ else
+ return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
+ }
/* This matches "*return_di". */
else if (arith_double_operand (src, GET_MODE (src)))
@@ -1433,7 +2443,7 @@ pic_address_needs_scratch (x)
rtx
legitimize_pic_address (orig, mode, reg)
rtx orig;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
rtx reg;
{
if (GET_CODE (orig) == SYMBOL_REF)
@@ -1461,23 +2471,30 @@ legitimize_pic_address (orig, mode, reg)
won't get confused into thinking that these two instructions
are loading in the true address of the symbol. If in the
future a PIC rtx exists, that should be used instead. */
- emit_insn (gen_pic_sethi_si (temp_reg, orig));
- emit_insn (gen_pic_lo_sum_si (temp_reg, temp_reg, orig));
-
+ if (Pmode == SImode)
+ {
+ emit_insn (gen_movsi_high_pic (temp_reg, orig));
+ emit_insn (gen_movsi_lo_sum_pic (temp_reg, temp_reg, orig));
+ }
+ else
+ {
+ emit_insn (gen_movdi_high_pic (temp_reg, orig));
+ emit_insn (gen_movdi_lo_sum_pic (temp_reg, temp_reg, orig));
+ }
address = temp_reg;
}
else
address = orig;
- pic_ref = gen_rtx (MEM, Pmode,
- gen_rtx (PLUS, Pmode,
+ pic_ref = gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, address));
current_function_uses_pic_offset_table = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
insn = emit_move_insn (reg, pic_ref);
/* Put a REG_EQUAL note on this insn, so that it can be optimized
by loop. */
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, orig,
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig,
REG_NOTES (insn));
return reg;
}
@@ -1516,23 +2533,17 @@ legitimize_pic_address (orig, mode, reg)
/* If we reach here, then something is seriously wrong. */
abort ();
}
- return gen_rtx (PLUS, Pmode, base, offset);
+ return gen_rtx_PLUS (Pmode, base, offset);
}
else if (GET_CODE (orig) == LABEL_REF)
/* ??? Why do we do this? */
+ /* Now movsi_pic_label_ref uses it, but we ought to be checking that
+ the register is live instead, in case it is eliminated. */
current_function_uses_pic_offset_table = 1;
return orig;
}
-/* Set up PIC-specific rtl. This should not cause any insns
- to be emitted. */
-
-void
-initialize_pic ()
-{
-}
-
/* Return the RTX for insns to set the PIC register. */
static rtx
@@ -1567,26 +2578,33 @@ finalize_pic ()
/* If we havn't emitted the special get_pc helper function, do so now. */
if (get_pc_symbol_name[0] == 0)
{
- ASM_GENERATE_INTERNAL_LABEL (get_pc_symbol_name, "LGETPC", 0);
+ int align;
+ ASM_GENERATE_INTERNAL_LABEL (get_pc_symbol_name, "LGETPC", 0);
text_section ();
- ASM_OUTPUT_ALIGN (asm_out_file, 3);
+
+ 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);
fputs ("\tretl\n\tadd %o7,%l7,%l7\n", asm_out_file);
}
/* Initialize every time through, since we can't easily
know this to be permanent. */
- global_offset_table = gen_rtx (SYMBOL_REF, Pmode, "_GLOBAL_OFFSET_TABLE_");
- get_pc_symbol = gen_rtx (SYMBOL_REF, Pmode, get_pc_symbol_name);
+ global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
+ get_pc_symbol = gen_rtx_SYMBOL_REF (Pmode, get_pc_symbol_name);
flag_pic = 0;
emit_insn_after (pic_setup_code (), get_insns ());
- /* Insert the code in each nonlocal goto receiver. */
+ /* Insert the code in each nonlocal goto receiver.
+ If you make changes here or to the nonlocal_goto_receiver
+ pattern, make sure the unspec_volatile numbers still
+ match. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
- && XINT (PATTERN (insn), 1) == 4)
+ && XINT (PATTERN (insn), 1) == 5)
emit_insn_after (pic_setup_code (), insn);
flag_pic = orig_flag_pic;
@@ -1595,296 +2613,39 @@ finalize_pic ()
since setjmp/longjmp can cause life info to screw up.
??? In the case where we don't obey regdecls, this is not sufficient
since we may not fall out the bottom. */
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
}
-/* Emit insns to move operands[1] into operands[0].
-
- Return 1 if we have written out everything that needs to be done to
- do the move. Otherwise, return 0 and the caller will emit the move
- normally. */
+/* Return 1 if RTX is a MEM which is known to be aligned to at
+ least an 8 byte boundary. */
int
-emit_move_sequence (operands, mode)
- rtx *operands;
- enum machine_mode mode;
+mem_min_alignment (mem, desired)
+ rtx mem;
+ int desired;
{
- register rtx operand0 = operands[0];
- register rtx operand1 = operands[1];
-
- if (CONSTANT_P (operand1) && flag_pic
- && pic_address_needs_scratch (operand1))
- operands[1] = operand1 = legitimize_pic_address (operand1, mode, 0);
-
- /* Handle most common case first: storing into a register. */
- if (register_operand (operand0, mode))
- {
- /* Integer constant to FP register. */
- if (GET_CODE (operand0) == REG
- && REGNO (operand0) >= 32
- && REGNO (operand0) < FIRST_PSEUDO_REGISTER
- && CONSTANT_P (operand1))
- {
- operand1 = validize_mem (force_const_mem (GET_MODE (operand0), operand1));
- }
-
- if (register_operand (operand1, mode)
- || (GET_CODE (operand1) == CONST_INT && SMALL_INT (operand1))
- || (GET_CODE (operand1) == CONST_DOUBLE
- && arith_double_operand (operand1, DImode))
- || (GET_CODE (operand1) == HIGH && GET_MODE (operand1) != DImode)
- /* Only `general_operands' can come here, so MEM is ok. */
- || GET_CODE (operand1) == MEM)
- {
- /* Run this case quickly. */
- emit_insn (gen_rtx (SET, VOIDmode, operand0, operand1));
- return 1;
- }
- }
- else if (GET_CODE (operand0) == MEM)
- {
- if (register_operand (operand1, mode)
- || (operand1 == const0_rtx && ! TARGET_LIVE_G0))
- {
- /* Run this case quickly. */
- emit_insn (gen_rtx (SET, VOIDmode, operand0, operand1));
- return 1;
- }
- if (! reload_in_progress)
- {
- operands[0] = validize_mem (operand0);
- operands[1] = operand1 = force_reg (mode, operand1);
- }
- }
-
- if (GET_CODE (operand1) == LABEL_REF
- && mode == SImode && flag_pic)
- {
- if (TARGET_ARCH64)
- abort ();
- emit_insn (gen_move_pic_label_si (operand0, operand1));
- return 1;
- }
- /* Non-pic LABEL_REF's in sparc64 are expensive to do the normal way,
- so always use special code. */
- else if (GET_CODE (operand1) == LABEL_REF
- && mode == DImode)
- {
- if (! TARGET_ARCH64)
- abort ();
- emit_insn (gen_move_label_di (operand0, operand1));
- return 1;
- }
- /* DImode HIGH values in sparc64 need a clobber added. */
- else if (TARGET_ARCH64
- && GET_CODE (operand1) == HIGH && GET_MODE (operand1) == DImode)
- {
- emit_insn (gen_sethi_di_sp64 (operand0, XEXP (operand1, 0)));
- return 1;
- }
- /* Simplify the source if we need to. */
- else if (GET_CODE (operand1) != HIGH && immediate_operand (operand1, mode))
- {
- if (flag_pic && symbolic_operand (operand1, mode))
- {
- rtx temp_reg = reload_in_progress ? operand0 : 0;
-
- operands[1] = legitimize_pic_address (operand1, mode, temp_reg);
- }
- else if (GET_CODE (operand1) == CONST_INT
- ? (! SMALL_INT (operand1)
- && INTVAL (operand1) != -4096
- && ! SPARC_SETHI_P (INTVAL (operand1)))
- : GET_CODE (operand1) == CONST_DOUBLE
- ? ! arith_double_operand (operand1, DImode)
- : 1)
- {
- /* For DImode values, temp must be operand0 because of the way
- HI and LO_SUM work. The LO_SUM operator only copies half of
- the LSW from the dest of the HI operator. If the LO_SUM dest is
- not the same as the HI dest, then the MSW of the LO_SUM dest will
- never be set.
-
- ??? The real problem here is that the ...(HI:DImode pattern emits
- multiple instructions, and the ...(LO_SUM:DImode pattern emits
- one instruction. This fails, because the compiler assumes that
- LO_SUM copies all bits of the first operand to its dest. Better
- would be to have the HI pattern emit one instruction and the
- LO_SUM pattern multiple instructions. Even better would be
- to use four rtl insns. */
- rtx temp = ((reload_in_progress || mode == DImode)
- ? operand0 : gen_reg_rtx (mode));
-
- if (mode == SImode)
- {
- if (GET_CODE (operand1) == CONST_INT)
- operand1 = GEN_INT (INTVAL (operand1) & 0xffffffff);
- else if (GET_CODE (operand1) == CONST_DOUBLE)
- operand1 = GEN_INT (CONST_DOUBLE_LOW (operand1) & 0xffffffff);
- }
-
- if (TARGET_ARCH64 && mode == DImode)
- emit_insn (gen_sethi_di_sp64 (temp, operand1));
- else
- emit_insn (gen_rtx (SET, VOIDmode, temp,
- gen_rtx (HIGH, mode, operand1)));
-
- operands[1] = gen_rtx (LO_SUM, mode, temp, operand1);
- }
- }
-
- /* Now have insn-emit do whatever it normally does. */
- return 0;
-}
-
-/* Return the best assembler insn template
- for moving operands[1] into operands[0] as a 4 byte quantity.
-
- This isn't intended to be very smart. It is up to the caller to
- choose the best way to do things.
-
- Note that OPERANDS may be modified to suit the returned string. */
-
-char *
-singlemove_string (operands)
- rtx *operands;
-{
- if (GET_CODE (operands[0]) == MEM)
- {
- if (GET_CODE (operands[1]) != MEM)
- return "st %r1,%0";
- else
- abort ();
- }
- else if (GET_CODE (operands[1]) == MEM)
- return "ld %1,%0";
- else if (GET_CODE (operands[1]) == CONST_DOUBLE)
- {
- REAL_VALUE_TYPE r;
- long i;
-
- /* Must be SFmode, otherwise this doesn't make sense. */
- if (GET_MODE (operands[1]) != SFmode)
- abort ();
-
- REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
- REAL_VALUE_TO_TARGET_SINGLE (r, i);
- operands[1] = GEN_INT (i);
-
- if (CONST_OK_FOR_LETTER_P (i, 'I'))
- return "mov %1,%0";
- else if ((i & 0x000003FF) != 0)
- return "sethi %%hi(%a1),%0\n\tor %0,%%lo(%a1),%0";
- else
- return "sethi %%hi(%a1),%0";
- }
- else if (GET_CODE (operands[1]) == CONST_INT)
- {
- /* Only consider the low 32 bits of the constant. */
- int i = INTVAL (operands[1]) & 0xffffffff;
-
- if (SPARC_SIMM13_P (i))
- return "mov %1,%0";
-
- if (i == 4096)
- return "sub %%g0,-4096,%0";
-
- /* If all low order 10 bits are clear, then we only need a single
- sethi insn to load the constant. */
- /* FIXME: Use SETHI_P. */
- if ((i & 0x000003FF) != 0)
- return "sethi %%hi(%a1),%0\n\tor %0,%%lo(%a1),%0";
- else
- return "sethi %%hi(%a1),%0";
- }
- /* Operand 1 must be a register, or a 'I' type CONST_INT. */
- return "mov %1,%0";
-}
-
-/* Return the best assembler insn template
- for moving operands[1] into operands[0] as an 8 byte quantity.
-
- This isn't intended to be very smart. It is up to the caller to
- choose the best way to do things.
-
- Note that OPERANDS may be modified to suit the returned string. */
-
-char *
-doublemove_string (operands)
- rtx *operands;
-{
- rtx op0 = operands[0], op1 = operands[1];
-
- if (GET_CODE (op0) == MEM)
- {
- if (GET_CODE (op1) == REG)
- {
- if (FP_REG_P (op1))
- return "std %1,%0";
- return TARGET_ARCH64 ? "stx %1,%0" : "std %1,%0";
- }
- if (TARGET_ARCH64
- && (op1 == const0_rtx
- || (GET_MODE (op1) != VOIDmode
- && op1 == CONST0_RTX (GET_MODE (op1)))))
- return "stx %r1,%0";
- abort ();
- }
- else if (GET_CODE (op1) == MEM)
- {
- if (GET_CODE (op0) != REG)
- abort ();
- if (FP_REG_P (op0))
- return "ldd %1,%0";
- return TARGET_ARCH64 ? "ldx %1,%0" : "ldd %1,%0";
- }
- else if (GET_CODE (operands[1]) == CONST_DOUBLE)
- {
- /* ??? Unfinished, and maybe not needed. */
- abort ();
- }
- else if (GET_CODE (operands[1]) == CONST_INT
- && ! CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'I'))
- {
- /* ??? Unfinished, and maybe not needed. */
- abort ();
- }
- /* Operand 1 must be a register, or a 'I' type CONST_INT. */
- return "mov %1,%0";
-}
-
-/* Return non-zero if it is OK to assume that the given memory operand is
- aligned at least to a 8-byte boundary. This should only be called
- for memory accesses whose size is 8 bytes or larger. */
-
-int
-mem_aligned_8 (mem)
- register rtx mem;
-{
- register rtx addr;
- register rtx base;
- register rtx offset;
+ rtx addr, base, offset;
+ /* If it's not a MEM we can't accept it. */
if (GET_CODE (mem) != MEM)
- return 0; /* It's gotta be a MEM! */
+ return 0;
addr = XEXP (mem, 0);
-
- /* Now that all misaligned double parms are copied on function entry,
- we can assume any 64-bit object is 64-bit aligned except those which
- are at unaligned offsets from the stack or frame pointer. If the
- TARGET_UNALIGNED_DOUBLES switch is given, we do not make this
- assumption. */
-
- /* See what register we use in the address. */
- base = 0;
+ base = offset = NULL_RTX;
if (GET_CODE (addr) == PLUS)
{
- if (GET_CODE (XEXP (addr, 0)) == REG
- && GET_CODE (XEXP (addr, 1)) == CONST_INT)
+ if (GET_CODE (XEXP (addr, 0)) == REG)
{
base = XEXP (addr, 0);
- offset = XEXP (addr, 1);
+
+ /* What we are saying here is that if the base
+ REG is aligned properly, the compiler will make
+ sure any REG based index upon it will be so
+ as well. */
+ if (GET_CODE (XEXP (addr, 1)) == CONST_INT)
+ offset = XEXP (addr, 1);
+ else
+ offset = const0_rtx;
}
}
else if (GET_CODE (addr) == REG)
@@ -1893,1231 +2654,42 @@ mem_aligned_8 (mem)
offset = const0_rtx;
}
- /* If it's the stack or frame pointer, check offset alignment.
- We can have improper alignment in the function entry code. */
- if (base
- && (REGNO (base) == FRAME_POINTER_REGNUM
- || REGNO (base) == STACK_POINTER_REGNUM))
- {
- if (((INTVAL (offset) - SPARC_STACK_BIAS) & 0x7) == 0)
- return 1;
- }
- /* Anything else we know is properly aligned unless TARGET_UNALIGNED_DOUBLES
- is true, in which case we can only assume that an access is aligned if
- it is to a constant address, or the address involves a LO_SUM.
-
- We used to assume an address was aligned if MEM_IN_STRUCT_P was true.
- That assumption was deleted so that gcc generated code can be used with
- memory allocators that only guarantee 4 byte alignment. */
- else if (! TARGET_UNALIGNED_DOUBLES || CONSTANT_P (addr)
- || GET_CODE (addr) == LO_SUM)
- return 1;
-
- /* An obviously unaligned address. */
- return 0;
-}
-
-enum optype { REGOP, OFFSOP, MEMOP, PUSHOP, POPOP, CNSTOP, RNDOP };
-
-/* Output assembler code to perform a doubleword move insn
- with operands OPERANDS. This is very similar to the following
- output_move_quad function. */
-
-char *
-output_move_double (operands)
- rtx *operands;
-{
- register rtx op0 = operands[0];
- register rtx op1 = operands[1];
- register enum optype optype0;
- register enum optype optype1;
- rtx latehalf[2];
- rtx addreg0 = 0;
- rtx addreg1 = 0;
- int highest_first = 0;
- int no_addreg1_decrement = 0;
-
- /* First classify both operands. */
-
- if (REG_P (op0))
- optype0 = REGOP;
- else if (offsettable_memref_p (op0))
- optype0 = OFFSOP;
- else if (GET_CODE (op0) == MEM)
- optype0 = MEMOP;
- else
- optype0 = RNDOP;
-
- if (REG_P (op1))
- optype1 = REGOP;
- else if (CONSTANT_P (op1))
- optype1 = CNSTOP;
- else if (offsettable_memref_p (op1))
- optype1 = OFFSOP;
- else if (GET_CODE (op1) == MEM)
- optype1 = MEMOP;
- else
- optype1 = RNDOP;
-
- /* Check for the cases that the operand constraints are not
- supposed to allow to happen. Abort if we get one,
- because generating code for these cases is painful. */
-
- if (optype0 == RNDOP || optype1 == RNDOP
- || (optype0 == MEM && optype1 == MEM))
- abort ();
-
- /* If an operand is an unoffsettable memory ref, find a register
- we can increment temporarily to make it refer to the second word. */
-
- if (optype0 == MEMOP)
- addreg0 = find_addr_reg (XEXP (op0, 0));
-
- if (optype1 == MEMOP)
- addreg1 = find_addr_reg (XEXP (op1, 0));
-
- /* Ok, we can do one word at a time.
- Set up in LATEHALF the operands to use for the
- high-numbered (least significant) word and in some cases alter the
- operands in OPERANDS to be suitable for the low-numbered word. */
-
- if (optype0 == REGOP)
- latehalf[0] = gen_rtx (REG, SImode, REGNO (op0) + 1);
- else if (optype0 == OFFSOP)
- latehalf[0] = adj_offsettable_operand (op0, 4);
- else
- latehalf[0] = op0;
-
- if (optype1 == REGOP)
- latehalf[1] = gen_rtx (REG, SImode, REGNO (op1) + 1);
- else if (optype1 == OFFSOP)
- latehalf[1] = adj_offsettable_operand (op1, 4);
- else if (optype1 == CNSTOP)
- {
- if (TARGET_ARCH64)
- {
- if (arith_double_operand (op1, DImode))
- {
- operands[1] = GEN_INT (CONST_DOUBLE_LOW (op1));
- return "mov %1,%0";
- }
- else
- {
- /* The only way to handle CONST_DOUBLEs or other 64 bit
- constants here is to use a temporary, such as is done
- for the V9 DImode sethi insn pattern. This is not
- a practical solution, so abort if we reach here.
- The md file should always force such constants to
- memory. */
- abort ();
- }
- }
- else
- split_double (op1, &operands[1], &latehalf[1]);
- }
- else
- latehalf[1] = op1;
-
- /* Easy case: try moving both words at once. Check for moving between
- an even/odd register pair and a memory location. */
- if ((optype0 == REGOP && optype1 != REGOP && optype1 != CNSTOP
- && (TARGET_ARCH64 || (REGNO (op0) & 1) == 0))
- || (optype0 != REGOP && optype0 != CNSTOP && optype1 == REGOP
- && (TARGET_ARCH64 || (REGNO (op1) & 1) == 0)))
+ if (base != NULL_RTX)
{
- register rtx mem,reg;
-
- if (optype0 == REGOP)
- mem = op1, reg = op0;
- else
- mem = op0, reg = op1;
-
- /* In v9, ldd can be used for word aligned addresses, so technically
- some of this logic is unneeded. We still avoid ldd if the address
- is obviously unaligned though.
-
- Integer ldd/std are deprecated in V9 and are slow on UltraSPARC.
- Use them only if the access is volatile or not offsettable. */
-
- if ((mem_aligned_8 (mem)
- && (REGNO (reg) >= 32
- || MEM_VOLATILE_P (mem)
- || ! ((optype0 == OFFSOP || optype1 == OFFSOP)
- && (sparc_cpu == PROCESSOR_ULTRASPARC
- || sparc_cpu == PROCESSOR_V9))))
- /* If this is a floating point register higher than %f31,
- then we *must* use an aligned load, since `ld' will not accept
- the register number. */
- || (TARGET_V9 && REGNO (reg) >= 64)
- /* Even if two instructions would otherwise be better than ldd/std,
- if this insn was put in a delay slot because reorg thought it
- was only one machine instruction, make sure it is only one
- instruction. */
- || dbr_sequence_length () != 0)
- {
- if (FP_REG_P (reg) || ! TARGET_ARCH64)
- return (mem == op1 ? "ldd %1,%0" : "std %1,%0");
- else
- return (mem == op1 ? "ldx %1,%0" : "stx %1,%0");
- }
- }
-
- if (TARGET_ARCH64)
- {
- if (optype0 == REGOP && optype1 == REGOP)
- {
- if (FP_REG_P (op0))
- return "fmovd %1,%0";
- else
- return "mov %1,%0";
- }
- }
-
- /* If the first move would clobber the source of the second one,
- do them in the other order. */
-
- /* Overlapping registers. */
- if (optype0 == REGOP && optype1 == REGOP
- && REGNO (op0) == REGNO (latehalf[1]))
- {
- /* Do that word. */
- output_asm_insn (singlemove_string (latehalf), latehalf);
- /* Do low-numbered word. */
- return singlemove_string (operands);
- }
- /* Loading into a register which overlaps a register used in the address. */
- else if (optype0 == REGOP && optype1 != REGOP
- && reg_overlap_mentioned_p (op0, op1))
- {
- /* If both halves of dest are used in the src memory address,
- add the two regs and put them in the low reg (op0).
- Then it works to load latehalf first. */
- if (reg_mentioned_p (op0, XEXP (op1, 0))
- && reg_mentioned_p (latehalf[0], XEXP (op1, 0)))
- {
- rtx xops[2];
- xops[0] = latehalf[0];
- xops[1] = op0;
- output_asm_insn ("add %1,%0,%1", xops);
- operands[1] = gen_rtx (MEM, DImode, op0);
- latehalf[1] = adj_offsettable_operand (operands[1], 4);
- addreg1 = 0;
- highest_first = 1;
- }
- /* Only one register in the dest is used in the src memory address,
- and this is the first register of the dest, so we want to do
- the late half first here also. */
- else if (! reg_mentioned_p (latehalf[0], XEXP (op1, 0)))
- highest_first = 1;
- /* Only one register in the dest is used in the src memory address,
- and this is the second register of the dest, so we want to do
- the late half last. If addreg1 is set, and addreg1 is the same
- register as latehalf, then we must suppress the trailing decrement,
- because it would clobber the value just loaded. */
- else if (addreg1 && reg_mentioned_p (addreg1, latehalf[0]))
- no_addreg1_decrement = 1;
- }
-
- /* Normal case: do the two words, low-numbered first.
- Overlap case (highest_first set): do high-numbered word first. */
-
- if (! highest_first)
- output_asm_insn (singlemove_string (operands), operands);
-
- /* Make any unoffsettable addresses point at high-numbered word. */
- if (addreg0)
- output_asm_insn ("add %0,0x4,%0", &addreg0);
- if (addreg1)
- output_asm_insn ("add %0,0x4,%0", &addreg1);
-
- /* Do that word. */
- output_asm_insn (singlemove_string (latehalf), latehalf);
-
- /* Undo the adds we just did. */
- if (addreg0)
- output_asm_insn ("add %0,-0x4,%0", &addreg0);
- if (addreg1 && ! no_addreg1_decrement)
- output_asm_insn ("add %0,-0x4,%0", &addreg1);
-
- if (highest_first)
- output_asm_insn (singlemove_string (operands), operands);
-
- return "";
-}
-
-/* Output assembler code to perform a quadword move insn
- with operands OPERANDS. This is very similar to the preceding
- output_move_double function. */
-
-char *
-output_move_quad (operands)
- rtx *operands;
-{
- register rtx op0 = operands[0];
- register rtx op1 = operands[1];
- register enum optype optype0;
- register enum optype optype1;
- rtx wordpart[4][2];
- rtx load_late[4];
- int load_late_half[2];
- rtx addreg0 = 0;
- rtx addreg1 = 0;
-
- load_late_half[0] = 0; load_late_half[1] = 0;
- load_late[0] = 0; load_late[1] = 0; load_late[2] = 0;
- load_late[3] = 0;
-
- wordpart[0][0] = NULL; wordpart[1][0] = NULL; wordpart[2][0] = NULL;
- wordpart[3][0] = NULL;
-
- /* First classify both operands. */
-
- if (REG_P (op0))
- optype0 = REGOP;
- else if (offsettable_memref_p (op0))
- optype0 = OFFSOP;
- else if (GET_CODE (op0) == MEM)
- optype0 = MEMOP;
- else
- optype0 = RNDOP;
-
- if (REG_P (op1))
- optype1 = REGOP;
- else if (CONSTANT_P (op1))
- optype1 = CNSTOP;
- else if (offsettable_memref_p (op1))
- optype1 = OFFSOP;
- else if (GET_CODE (op1) == MEM)
- optype1 = MEMOP;
- else
- optype1 = RNDOP;
-
- /* Check for the cases that the operand constraints are not
- supposed to allow to happen. Abort if we get one,
- because generating code for these cases is painful. */
-
- if (optype0 == RNDOP || optype1 == RNDOP
- || (optype0 == MEM && optype1 == MEM))
- abort ();
+ int regno = REGNO (base);
- if (optype0 == REGOP)
- {
- wordpart[0][0] = gen_rtx (REG, word_mode, REGNO (op0) + 0);
- if (TARGET_ARCH64 && FP_REG_P (op0)
- && REGNO (op0) < SPARC_FIRST_V9_FP_REG)
- wordpart[1][0] = gen_rtx (REG, word_mode, REGNO (op0) + 2);
- else
- wordpart[1][0] = gen_rtx (REG, word_mode, REGNO (op0) + 1);
-
- if (TARGET_ARCH32)
- {
- wordpart[2][0] = gen_rtx (REG, word_mode, REGNO (op0) + 2);
- wordpart[3][0] = gen_rtx (REG, word_mode, REGNO (op0) + 3);
- }
-
- /* Loading into a register which overlaps a register used in the
- address. */
- if (optype1 != REGOP && reg_overlap_mentioned_p (op0, op1))
- {
- int i;
- int count;
-
- count = 0;
-
- for (i = 0; i < 4 && wordpart[i][0] != NULL; i++)
- {
- if (reg_mentioned_p (wordpart[i][0], op1))
- {
- load_late[i] = wordpart[i][0];
- load_late_half[TARGET_ARCH64 ? i : i/2] = 1;
- count++;
- }
- }
- if (count > 2)
- {
- /* Not sure what to do here. Multiple adds? Can't happen. */
- abort ();
- }
- else if (count == 2)
- {
- /* We have a two-address source operand, and both registers
- overlap with the dest quad. Add them together and
- store the result into the last register of the quad being
- loaded, then generate an appropriate MEM insn. */
- rtx temp[3];
- int place = 0;
-
- for (i = 0; i < 4; i++)
- {
- if (load_late[i])
- {
- temp[place++] = load_late[i];
- load_late[i] = 0;
- }
- }
- temp[2] = wordpart[3][0];
- output_asm_insn ("add %0, %1, %2", temp);
- load_late_half[0] = 0;
- load_late_half[1] = 1;
- op1 = gen_rtx (MEM, TFmode, wordpart[3][0]);
- operands[1] = op1;
- optype1 = OFFSOP;
- }
- }
- }
-
- /* If an operand is an unoffsettable memory ref, find a register
- we can increment temporarily to make it refer to the later words. */
-
- if (optype0 == MEMOP)
- addreg0 = find_addr_reg (XEXP (op0, 0));
-
- if (optype1 == MEMOP)
- addreg1 = find_addr_reg (XEXP (op1, 0));
-
- /* Ok, we can do one word at a time.
- Set up in wordpart the operands to use for each word of the arguments. */
-
- if (optype0 == OFFSOP)
- {
- wordpart[0][0] = adj_offsettable_operand (op0, 0);
- if (TARGET_ARCH32)
- {
- wordpart[1][0] = adj_offsettable_operand (op0, 4);
- wordpart[2][0] = adj_offsettable_operand (op0, 8);
- wordpart[3][0] = adj_offsettable_operand (op0, 12);
- }
- else
- wordpart[1][0] = adj_offsettable_operand (op0, 8);
- }
- else if (optype0 != REGOP)
- {
- wordpart[0][0] = op0;
- wordpart[1][0] = op0;
- wordpart[2][0] = op0;
- wordpart[3][0] = op0;
- }
-
- if (optype1 == REGOP)
- {
- wordpart[0][1] = gen_rtx (REG, word_mode, REGNO (op1) + 0);
- if (TARGET_ARCH64 && FP_REG_P (op1)
- && REGNO (op1) < SPARC_FIRST_V9_FP_REG)
- wordpart[1][1] = gen_rtx (REG, word_mode, REGNO (op1) + 2);
- else
- wordpart[1][1] = gen_rtx (REG, word_mode, REGNO (op1) + 1);
-
- if (TARGET_ARCH32)
- {
- wordpart[2][1] = gen_rtx (REG, word_mode, REGNO (op1) + 2);
- wordpart[3][1] = gen_rtx (REG, word_mode, REGNO (op1) + 3);
- }
- }
- else if (optype1 == OFFSOP)
- {
- wordpart[0][1] = adj_offsettable_operand (op1, 0);
- if (TARGET_ARCH32)
+ if (regno != FRAME_POINTER_REGNUM
+ && regno != STACK_POINTER_REGNUM)
{
- wordpart[1][1] = adj_offsettable_operand (op1, 4);
- wordpart[2][1] = adj_offsettable_operand (op1, 8);
- wordpart[3][1] = adj_offsettable_operand (op1, 12);
+ /* Check if the compiler has recorded some information
+ about the alignment of the base REG. If reload has
+ completed, we already matched with proper alignments. */
+ if (((regno_pointer_align != NULL
+ && REGNO_POINTER_ALIGN (regno) >= desired)
+ || reload_completed)
+ && ((INTVAL (offset) & (desired - 1)) == 0))
+ return 1;
}
else
- wordpart[1][1] = adj_offsettable_operand (op1, 8);
- }
- else if (optype1 == CNSTOP)
- {
- REAL_VALUE_TYPE r;
- long l[4];
-
- /* This only works for TFmode floating point constants. */
- if (GET_CODE (op1) != CONST_DOUBLE || GET_MODE (op1) != TFmode)
- abort ();
-
- REAL_VALUE_FROM_CONST_DOUBLE (r, op1);
- REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l);
-
- wordpart[0][1] = GEN_INT (l[0]);
- wordpart[1][1] = GEN_INT (l[1]);
- wordpart[2][1] = GEN_INT (l[2]);
- wordpart[3][1] = GEN_INT (l[3]);
- }
- else
- {
- wordpart[0][1] = op1;
- wordpart[1][1] = op1;
- wordpart[2][1] = op1;
- wordpart[3][1] = op1;
- }
-
- /* Easy case: try moving the quad as two pairs. Check for moving between
- an even/odd register pair and a memory location.
- Also handle new v9 fp regs here. */
- /* ??? Should also handle the case of non-offsettable addresses here.
- We can at least do the first pair as a ldd/std, and then do the third
- and fourth words individually. */
- if ((optype0 == REGOP && optype1 == OFFSOP && (REGNO (op0) & 1) == 0)
- || (optype0 == OFFSOP && optype1 == REGOP && (REGNO (op1) & 1) == 0))
- {
- rtx mem, reg;
- int use_ldx;
-
- if (optype0 == REGOP)
- mem = op1, reg = op0;
- else
- mem = op0, reg = op1;
-
- if (mem_aligned_8 (mem)
- /* If this is a floating point register higher than %f31,
- then we *must* use an aligned load, since `ld' will not accept
- the register number. */
- || (TARGET_V9 && REGNO (reg) >= SPARC_FIRST_V9_FP_REG))
- {
- static char * const mov_by_64[2][2][2] = {
- { { "std %S1,%2;std %1,%0", "stx %R1,%2;stx %1,%0" },
- { "ldd %2,%S0;ldd %1,%0", "ldx %2,%R0;ldx %1,%0" } },
- { { "std %1,%0;std %S1,%2", "stx %1,%0;stx %R1,%2" },
- { "ldd %1,%0;ldd %2,%S0", "ldx %1,%0;ldx %2,%R0" } }
- };
-
- if (TARGET_V9 && FP_REG_P (reg) && TARGET_HARD_QUAD)
- {
- /* Only abort if the register # requires that we use ldq. */
- if ((REGNO (reg) & 3) == 0)
- {
- /* ??? Can `mem' have an inappropriate alignment here? */
- return (mem == op1 ? "ldq %1,%0" : "stq %1,%0");
- }
- else
- {
- if (REGNO (reg) >= SPARC_FIRST_V9_FP_REG)
- abort();
- }
- }
- operands[2] = adj_offsettable_operand (mem, 8);
-
- /* Do the loads in the right order; can't overwrite our address
- register. */
- use_ldx = TARGET_ARCH64 && !FP_REG_P (reg);
- return mov_by_64[!load_late_half[0]][mem == op1][use_ldx];
- }
- }
-
- /* If the first move would clobber the source of the second one,
- do them in the other order. */
-
- /* Overlapping registers? */
- if (TARGET_ARCH32)
- {
- if (optype0 == REGOP && optype1 == REGOP
- && (REGNO (op0) == REGNO (wordpart[1][3])
- || REGNO (op0) == REGNO (wordpart[1][2])
- || REGNO (op0) == REGNO (wordpart[1][1])))
- {
- /* Do fourth word. */
- output_asm_insn (singlemove_string (wordpart[3]), wordpart[3]);
- /* Do the third word. */
- output_asm_insn (singlemove_string (wordpart[2]), wordpart[2]);
- /* Do the second word. */
- output_asm_insn (singlemove_string (wordpart[1]), wordpart[1]);
- /* Do lowest-numbered word. */
- output_asm_insn (singlemove_string (wordpart[0]), wordpart[0]);
- return "";
- }
- }
- else /* TARGET_ARCH64 */
- {
- if (optype0 == REGOP && optype1 == REGOP
- && REGNO (op0) == REGNO (wordpart[1][1]))
- {
- output_asm_insn ("mov %1,%0", wordpart[1]);
- output_asm_insn ("mov %1,%0", wordpart[0]);
- return "";
- }
- }
-
- /* Normal case: move the words in lowest to highest address order.
- There may have an overlapping register; in that case, skip and go
- back. */
-
- if (TARGET_ARCH32)
- {
- int i;
- int offset = 0xc;
- rtx temp[2];
-
- for (i = 0; i < 4; i++)
- {
- if (! load_late[i])
- output_asm_insn (singlemove_string (wordpart[i]), wordpart[i]);
-
- if (i != 3)
- {
- /* Make any unoffsettable addresses point at the next word. */
- if (addreg0)
- output_asm_insn ("add %0,0x4,%0", &addreg0);
- if (addreg1)
- output_asm_insn ("add %0,0x4,%0", &addreg1);
- }
- }
- for (i = 0; i < 4; i++)
{
- if (load_late[i])
- {
- int fix = offset - i * 4;
-
- /* Back up to the appropriate place. */
- temp[1] = gen_rtx (CONST_INT, VOIDmode, -fix);
- if (addreg0)
- {
- temp[0] = addreg0;
- output_asm_insn ("add %0,%1,%0", temp);
- }
- if (addreg1)
- {
- temp[0] = addreg1;
- output_asm_insn ("add %0,%1,%0", temp);
- }
- output_asm_insn (singlemove_string (wordpart[i]),
- wordpart[i]);
- /* Don't modify the register that's the destination of the
- move. */
- temp[0] = gen_rtx (CONST_INT, VOIDmode, -(offset - fix));
- if (addreg0 && REGNO (addreg0) != REGNO (wordpart[i][0]))
- {
- temp[1] = addreg0;
- output_asm_insn("add %0,%1,%0", temp);
- }
- if (addreg1 && REGNO (addreg1) != REGNO (wordpart[i][0]))
- {
- temp[1] = addreg1;
- output_asm_insn("add %0,%1,%0",temp);
- }
- offset = 0;
- break;
- }
- }
- if (offset)
- {
- temp[1] = gen_rtx (CONST_INT, VOIDmode, -offset);
- /* Undo the adds we just did. */
- if (addreg0)
- {
- temp[0] = addreg0;
- output_asm_insn ("add %0,%1,%0", temp);
- }
- if (addreg1)
- {
- temp[0] = addreg1;
- output_asm_insn ("add %0,%1,%0", temp);
- }
+ if (((INTVAL (offset) - SPARC_STACK_BIAS) & (desired - 1)) == 0)
+ return 1;
}
}
- else /* TARGET_ARCH64 */
+ else if (! TARGET_UNALIGNED_DOUBLES
+ || CONSTANT_P (addr)
+ || GET_CODE (addr) == LO_SUM)
{
- if (load_late_half[0])
- {
- /* Load the second half first. */
- if (addreg0)
- output_asm_insn ("add %0,0x8,%0", &addreg0);
- if (addreg1)
- output_asm_insn ("add %0,0x8,%0", &addreg1);
-
- output_asm_insn (doublemove_string (wordpart[1]), wordpart[1]);
-
- /* Undo the adds we just did. */
- if (addreg0)
- output_asm_insn ("add %0,-0x8,%0", &addreg0);
- if (addreg1)
- output_asm_insn ("add %0,-0x8,%0", &addreg1);
-
- output_asm_insn (doublemove_string (wordpart[0]), wordpart[0]);
- }
- else
- {
- output_asm_insn (doublemove_string (wordpart[0]), wordpart[0]);
-
- if (addreg0)
- output_asm_insn ("add %0,0x8,%0", &addreg0);
- if (addreg1)
- output_asm_insn ("add %0,0x8,%0", &addreg1);
-
- /* Do the second word. */
- output_asm_insn (doublemove_string (wordpart[1]), wordpart[1]);
-
- /* Undo the adds we just did. But don't modify the dest of
- the move. */
- if (addreg0 && REGNO (addreg0) != REGNO (wordpart[1][0]))
- output_asm_insn ("add %0,-0x8,%0", &addreg0);
- if (addreg1 && REGNO (addreg1) != REGNO (wordpart[1][0]))
- output_asm_insn ("add %0,-0x8,%0", &addreg1);
- }
+ /* Anything else we know is properly aligned unless TARGET_UNALIGNED_DOUBLES
+ is true, in which case we can only assume that an access is aligned if
+ it is to a constant address, or the address involves a LO_SUM. */
+ return 1;
}
- return "";
-}
-
-/* Output assembler code to perform a doubleword move insn with operands
- OPERANDS, one of which must be a floating point register. */
-
-char *
-output_fp_move_double (operands)
- rtx *operands;
-{
- if (FP_REG_P (operands[0]))
- {
- if (FP_REG_P (operands[1]))
- {
- if (TARGET_V9)
- return "fmovd %1,%0";
- else
- return "fmovs %1,%0\n\tfmovs %R1,%R0";
- }
- else if (GET_CODE (operands[1]) == REG)
- abort ();
- else
- return output_move_double (operands);
- }
- else if (FP_REG_P (operands[1]))
- {
- if (GET_CODE (operands[0]) == REG)
- abort ();
- else
- return output_move_double (operands);
- }
- else abort ();
-}
-
-/* When doing a quad-register move, determine the drection in which
- the move needs to be performed. SRC and DST are the source and
- destination registers.
-
- A value of -1 indicates that the move needs to be done from the
- highest register to the lowest. */
-
-static int
-move_quad_direction (src, dst)
- rtx src, dst;
-{
- if ((REGNO (dst) > REGNO (src))
- && (REGNO (dst) < (REGNO (src) + 4)))
- return -1;
- else
- return 1;
-}
-
-/* Output assembler code to perform a quadword move insn with operands
- OPERANDS, one of which must be a floating point register. */
-
-char *
-output_fp_move_quad (operands)
- rtx *operands;
-{
- register rtx op0 = operands[0];
- register rtx op1 = operands[1];
-
- if (FP_REG_P (op0))
- {
- if (FP_REG_P (op1))
- {
- if (TARGET_V9 && TARGET_HARD_QUAD)
- return "fmovq %1,%0";
- else if (TARGET_V9)
- {
- int dir = move_quad_direction (op1, op0);
- if (dir > 0)
- return "fmovd %1,%0\n\tfmovd %S1,%S0";
- else
- return "fmovd %S1,%S0\n\tfmovd %1,%0";
- }
- else
- {
- int dir = move_quad_direction (op0, op1);
- if (dir > 0)
- return "fmovs %1,%0\n\tfmovs %R1,%R0\n\tfmovs %S1,%S0\n\tfmovs %T1,%T0";
- else
- return "fmovs %T1,%T0\n\tfmovs %S1,%S0\n\tfmovs %R1,%R0\n\tfmovs %1,%0";
- }
- }
- else if (GET_CODE (op1) == REG)
- abort ();
- else
- return output_move_quad (operands);
- }
- else if (FP_REG_P (op1))
- {
- if (GET_CODE (op0) == REG)
- abort ();
- else
- return output_move_quad (operands);
- }
- else
- abort ();
-}
-
-/* Return a REG that occurs in ADDR with coefficient 1.
- ADDR can be effectively incremented by incrementing REG. */
-
-static rtx
-find_addr_reg (addr)
- rtx addr;
-{
- while (GET_CODE (addr) == PLUS)
- {
- /* We absolutely can not fudge the frame pointer here, because the
- frame pointer must always be 8 byte aligned. It also confuses
- debuggers. */
- if (GET_CODE (XEXP (addr, 0)) == REG
- && REGNO (XEXP (addr, 0)) != FRAME_POINTER_REGNUM)
- addr = XEXP (addr, 0);
- else if (GET_CODE (XEXP (addr, 1)) == REG
- && REGNO (XEXP (addr, 1)) != FRAME_POINTER_REGNUM)
- addr = XEXP (addr, 1);
- else if (CONSTANT_P (XEXP (addr, 0)))
- addr = XEXP (addr, 1);
- else if (CONSTANT_P (XEXP (addr, 1)))
- addr = XEXP (addr, 0);
- else
- abort ();
- }
- if (GET_CODE (addr) == REG)
- return addr;
- abort ();
-}
-
-#if 0 /* not currently used */
-
-void
-output_sized_memop (opname, mode, signedp)
- char *opname;
- enum machine_mode mode;
- int signedp;
-{
- static char *ld_size_suffix_u[] = { "ub", "uh", "", "?", "d" };
- static char *ld_size_suffix_s[] = { "sb", "sh", "", "?", "d" };
- static char *st_size_suffix[] = { "b", "h", "", "?", "d" };
- char **opnametab, *modename;
-
- if (opname[0] == 'l')
- if (signedp)
- opnametab = ld_size_suffix_s;
- else
- opnametab = ld_size_suffix_u;
- else
- opnametab = st_size_suffix;
- modename = opnametab[GET_MODE_SIZE (mode) >> 1];
-
- fprintf (asm_out_file, "\t%s%s", opname, modename);
-}
-
-void
-output_move_with_extension (operands)
- rtx *operands;
-{
- if (GET_MODE (operands[2]) == HImode)
- output_asm_insn ("sll %2,0x10,%0", operands);
- else if (GET_MODE (operands[2]) == QImode)
- output_asm_insn ("sll %2,0x18,%0", operands);
- else
- abort ();
-}
-#endif /* not currently used */
-
-#if 0
-/* ??? These are only used by the movstrsi pattern, but we get better code
- in general without that, because emit_block_move can do just as good a
- job as this function does when alignment and size are known. When they
- aren't known, a call to strcpy may be faster anyways, because it is
- likely to be carefully crafted assembly language code, and below we just
- do a byte-wise copy.
-
- Also, emit_block_move expands into multiple read/write RTL insns, which
- can then be optimized, whereas our movstrsi pattern can not be optimized
- at all. */
-
-/* Load the address specified by OPERANDS[3] into the register
- specified by OPERANDS[0].
-
- OPERANDS[3] may be the result of a sum, hence it could either be:
-
- (1) CONST
- (2) REG
- (2) REG + CONST_INT
- (3) REG + REG + CONST_INT
- (4) REG + REG (special case of 3).
-
- Note that (3) is not a legitimate address.
- All cases are handled here. */
-
-void
-output_load_address (operands)
- rtx *operands;
-{
- rtx base, offset;
-
- if (CONSTANT_P (operands[3]))
- {
- output_asm_insn ("set %3,%0", operands);
- return;
- }
-
- if (REG_P (operands[3]))
- {
- if (REGNO (operands[0]) != REGNO (operands[3]))
- output_asm_insn ("mov %3,%0", operands);
- return;
- }
-
- if (GET_CODE (operands[3]) != PLUS)
- abort ();
-
- base = XEXP (operands[3], 0);
- offset = XEXP (operands[3], 1);
-
- if (GET_CODE (base) == CONST_INT)
- {
- rtx tmp = base;
- base = offset;
- offset = tmp;
- }
-
- if (GET_CODE (offset) != CONST_INT)
- {
- /* Operand is (PLUS (REG) (REG)). */
- base = operands[3];
- offset = const0_rtx;
- }
-
- if (REG_P (base))
- {
- operands[6] = base;
- operands[7] = offset;
- if (SMALL_INT (offset))
- output_asm_insn ("add %6,%7,%0", operands);
- else
- output_asm_insn ("set %7,%0\n\tadd %0,%6,%0", operands);
- }
- else if (GET_CODE (base) == PLUS)
- {
- operands[6] = XEXP (base, 0);
- operands[7] = XEXP (base, 1);
- operands[8] = offset;
-
- if (SMALL_INT (offset))
- output_asm_insn ("add %6,%7,%0\n\tadd %0,%8,%0", operands);
- else
- output_asm_insn ("set %8,%0\n\tadd %0,%6,%0\n\tadd %0,%7,%0", operands);
- }
- else
- abort ();
-}
-
-/* Output code to place a size count SIZE in register REG.
- ALIGN is the size of the unit of transfer.
-
- Because block moves are pipelined, we don't include the
- first element in the transfer of SIZE to REG. */
-
-static void
-output_size_for_block_move (size, reg, align)
- rtx size, reg;
- rtx align;
-{
- rtx xoperands[3];
-
- xoperands[0] = reg;
- xoperands[1] = size;
- xoperands[2] = align;
- if (GET_CODE (size) == REG)
- output_asm_insn ("sub %1,%2,%0", xoperands);
- else
- {
- xoperands[1]
- = GEN_INT (INTVAL (size) - INTVAL (align));
- output_asm_insn ("set %1,%0", xoperands);
- }
-}
-
-/* Emit code to perform a block move.
-
- OPERANDS[0] is the destination.
- OPERANDS[1] is the source.
- OPERANDS[2] is the size.
- OPERANDS[3] is the alignment safe to use.
- OPERANDS[4] is a register we can safely clobber as a temp. */
-
-char *
-output_block_move (operands)
- rtx *operands;
-{
- /* A vector for our computed operands. Note that load_output_address
- makes use of (and can clobber) up to the 8th element of this vector. */
- rtx xoperands[10];
- rtx zoperands[10];
- static int movstrsi_label = 0;
- int i;
- rtx temp1 = operands[4];
- rtx sizertx = operands[2];
- rtx alignrtx = operands[3];
- int align = INTVAL (alignrtx);
- char label3[30], label5[30];
-
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- xoperands[2] = temp1;
-
- /* We can't move more than this many bytes at a time because we have only
- one register, %g1, to move them through. */
- if (align > UNITS_PER_WORD)
- {
- align = UNITS_PER_WORD;
- alignrtx = GEN_INT (UNITS_PER_WORD);
- }
-
- /* We consider 8 ld/st pairs, for a total of 16 inline insns to be
- reasonable here. (Actually will emit a maximum of 18 inline insns for
- the case of size == 31 and align == 4). */
-
- if (GET_CODE (sizertx) == CONST_INT && (INTVAL (sizertx) / align) <= 8
- && memory_address_p (QImode, plus_constant_for_output (xoperands[0],
- INTVAL (sizertx)))
- && memory_address_p (QImode, plus_constant_for_output (xoperands[1],
- INTVAL (sizertx))))
- {
- int size = INTVAL (sizertx);
- int offset = 0;
-
- /* We will store different integers into this particular RTX. */
- xoperands[2] = rtx_alloc (CONST_INT);
- PUT_MODE (xoperands[2], VOIDmode);
-
- /* This case is currently not handled. Abort instead of generating
- bad code. */
- if (align > UNITS_PER_WORD)
- abort ();
-
- if (TARGET_ARCH64 && align >= 8)
- {
- for (i = (size >> 3) - 1; i >= 0; i--)
- {
- INTVAL (xoperands[2]) = (i << 3) + offset;
- output_asm_insn ("ldx [%a1+%2],%%g1\n\tstx %%g1,[%a0+%2]",
- xoperands);
- }
- offset += (size & ~0x7);
- size = size & 0x7;
- if (size == 0)
- return "";
- }
-
- if (align >= 4)
- {
- for (i = (size >> 2) - 1; i >= 0; i--)
- {
- INTVAL (xoperands[2]) = (i << 2) + offset;
- output_asm_insn ("ld [%a1+%2],%%g1\n\tst %%g1,[%a0+%2]",
- xoperands);
- }
- offset += (size & ~0x3);
- size = size & 0x3;
- if (size == 0)
- return "";
- }
-
- if (align >= 2)
- {
- for (i = (size >> 1) - 1; i >= 0; i--)
- {
- INTVAL (xoperands[2]) = (i << 1) + offset;
- output_asm_insn ("lduh [%a1+%2],%%g1\n\tsth %%g1,[%a0+%2]",
- xoperands);
- }
- offset += (size & ~0x1);
- size = size & 0x1;
- if (size == 0)
- return "";
- }
-
- if (align >= 1)
- {
- for (i = size - 1; i >= 0; i--)
- {
- INTVAL (xoperands[2]) = i + offset;
- output_asm_insn ("ldub [%a1+%2],%%g1\n\tstb %%g1,[%a0+%2]",
- xoperands);
- }
- return "";
- }
-
- /* We should never reach here. */
- abort ();
- }
-
- /* If the size isn't known to be a multiple of the alignment,
- we have to do it in smaller pieces. If we could determine that
- the size was a multiple of 2 (or whatever), we could be smarter
- about this. */
- if (GET_CODE (sizertx) != CONST_INT)
- align = 1;
- else
- {
- int size = INTVAL (sizertx);
- while (size % align)
- align >>= 1;
- }
-
- if (align != INTVAL (alignrtx))
- alignrtx = GEN_INT (align);
-
- xoperands[3] = GEN_INT (movstrsi_label++);
- xoperands[4] = GEN_INT (align);
- xoperands[5] = GEN_INT (movstrsi_label++);
-
- ASM_GENERATE_INTERNAL_LABEL (label3, "Lm", INTVAL (xoperands[3]));
- ASM_GENERATE_INTERNAL_LABEL (label5, "Lm", INTVAL (xoperands[5]));
-
- /* This is the size of the transfer. Emit code to decrement the size
- value by ALIGN, and store the result in the temp1 register. */
- output_size_for_block_move (sizertx, temp1, alignrtx);
-
- /* Must handle the case when the size is zero or negative, so the first thing
- we do is compare the size against zero, and only copy bytes if it is
- zero or greater. Note that we have already subtracted off the alignment
- once, so we must copy 1 alignment worth of bytes if the size is zero
- here.
-
- The SUN assembler complains about labels in branch delay slots, so we
- do this before outputting the load address, so that there will always
- be a harmless insn between the branch here and the next label emitted
- below. */
-
- {
- char pattern[100];
-
- sprintf (pattern, "cmp %%2,0\n\tbl %s", &label5[1]);
- output_asm_insn (pattern, xoperands);
- }
-
- zoperands[0] = operands[0];
- zoperands[3] = plus_constant_for_output (operands[0], align);
- output_load_address (zoperands);
-
- /* ??? This might be much faster if the loops below were preconditioned
- and unrolled.
-
- That is, at run time, copy enough bytes one at a time to ensure that the
- target and source addresses are aligned to the largest possible
- alignment. Then use a preconditioned unrolled loop to copy say 16
- bytes at a time. Then copy bytes one at a time until finish the rest. */
-
- /* Output the first label separately, so that it is spaced properly. */
-
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "Lm", INTVAL (xoperands[3]));
-
- {
- char pattern[200];
- register char *ld_suffix = ((align == 1) ? "ub" : (align == 2) ? "uh"
- : (align == 8 && TARGET_ARCH64) ? "x" : "");
- register char *st_suffix = ((align == 1) ? "b" : (align == 2) ? "h"
- : (align == 8 && TARGET_ARCH64) ? "x" : "");
-
- sprintf (pattern, "ld%s [%%1+%%2],%%%%g1\n\tsubcc %%2,%%4,%%2\n\tbge %s\n\tst%s %%%%g1,[%%0+%%2]\n%s:", ld_suffix, &label3[1], st_suffix, &label5[1]);
- output_asm_insn (pattern, xoperands);
- }
-
- return "";
+ /* An obviously unaligned address. */
+ return 0;
}
-#endif
-
-/* Output reasonable peephole for set-on-condition-code insns.
- Note that these insns assume a particular way of defining
- labels. Therefore, *both* sparc.h and this function must
- be changed if a new syntax is needed. */
-
-char *
-output_scc_insn (operands, insn)
- rtx operands[];
- rtx insn;
-{
- static char string[100];
- rtx label = 0, next = insn;
- int need_label = 0;
-
- /* Try doing a jump optimization which jump.c can't do for us
- because we did not expose that setcc works by using branches.
-
- If this scc insn is followed by an unconditional branch, then have
- the jump insn emitted here jump to that location, instead of to
- the end of the scc sequence as usual. */
-
- do
- {
- if (GET_CODE (next) == CODE_LABEL)
- label = next;
- next = NEXT_INSN (next);
- if (next == 0)
- break;
- }
- while (GET_CODE (next) == NOTE || GET_CODE (next) == CODE_LABEL);
-
- /* If we are in a sequence, and the following insn is a sequence also,
- then just following the current insn's next field will take us to the
- first insn of the next sequence, which is the wrong place. We don't
- want to optimize with a branch that has had its delay slot filled.
- Avoid this by verifying that NEXT_INSN (PREV_INSN (next)) == next
- which fails only if NEXT is such a branch. */
-
- if (next && GET_CODE (next) == JUMP_INSN && simplejump_p (next)
- && (! final_sequence || NEXT_INSN (PREV_INSN (next)) == next))
- label = JUMP_LABEL (next);
- /* If not optimizing, jump label fields are not set. To be safe, always
- check here to whether label is still zero. */
- if (label == 0)
- {
- label = gen_label_rtx ();
- need_label = 1;
- }
-
- LABEL_NUSES (label) += 1;
-
- /* operands[3] is an unused slot. */
- operands[3] = label;
-
- /* If we are in a delay slot, assume it is the delay slot of an fpcc
- insn since our type isn't allowed anywhere else. */
-
- /* ??? Fpcc instructions no longer have delay slots, so this code is
- probably obsolete. */
-
- /* The fastest way to emit code for this is an annulled branch followed
- by two move insns. This will take two cycles if the branch is taken,
- and three cycles if the branch is not taken.
- However, if we are in the delay slot of another branch, this won't work,
- because we can't put a branch in the delay slot of another branch.
- The above sequence would effectively take 3 or 4 cycles respectively
- since a no op would have be inserted between the two branches.
- In this case, we want to emit a move, annulled branch, and then the
- second move. This sequence always takes 3 cycles, and hence is faster
- when we are in a branch delay slot. */
-
- if (final_sequence)
- {
- strcpy (string, "mov 0,%0\n\t");
- strcat (string, output_cbranch (operands[2], 3, 0, 1, 0));
- strcat (string, "\n\tmov 1,%0");
- }
- else
- {
- strcpy (string, output_cbranch (operands[2], 3, 0, 1, 0));
- strcat (string, "\n\tmov 1,%0\n\tmov 0,%0");
- }
-
- if (need_label)
- strcat (string, "\n%l3:");
-
- return string;
-}
/* Vectors to keep interesting information about registers where it can easily
be got. We use to use the actual mode value as the bit number, but there
@@ -3329,7 +2901,7 @@ save_regs (file, low, high, base, offset, n_regs, real_offset)
{
if (regs_ever_live[i] && ! call_used_regs[i])
{
- fprintf (file, "\tstx %s,[%s+%d]\n",
+ fprintf (file, "\tstx\t%s, [%s+%d]\n",
reg_names[i], base, offset + 4 * n_regs);
if (dwarf2out_do_frame ())
dwarf2out_reg_save ("", i, real_offset + 4 * n_regs);
@@ -3345,7 +2917,7 @@ save_regs (file, low, high, base, offset, n_regs, real_offset)
{
if (regs_ever_live[i+1] && ! call_used_regs[i+1])
{
- fprintf (file, "\tstd %s,[%s+%d]\n",
+ fprintf (file, "\tstd\t%s, [%s+%d]\n",
reg_names[i], base, offset + 4 * n_regs);
if (dwarf2out_do_frame ())
{
@@ -3357,7 +2929,7 @@ save_regs (file, low, high, base, offset, n_regs, real_offset)
}
else
{
- fprintf (file, "\tst %s,[%s+%d]\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n",
reg_names[i], base, offset + 4 * n_regs);
if (dwarf2out_do_frame ())
dwarf2out_reg_save ("", i, real_offset + 4 * n_regs);
@@ -3368,7 +2940,7 @@ save_regs (file, low, high, base, offset, n_regs, real_offset)
{
if (regs_ever_live[i+1] && ! call_used_regs[i+1])
{
- fprintf (file, "\tst %s,[%s+%d]\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n",
reg_names[i+1], base, offset + 4 * n_regs + 4);
if (dwarf2out_do_frame ())
dwarf2out_reg_save ("", i + 1, real_offset + 4 * n_regs + 4);
@@ -3400,7 +2972,7 @@ restore_regs (file, low, high, base, offset, n_regs)
for (i = low; i < high; i++)
{
if (regs_ever_live[i] && ! call_used_regs[i])
- fprintf (file, "\tldx [%s+%d], %s\n",
+ fprintf (file, "\tldx\t[%s+%d], %s\n",
base, offset + 4 * n_regs, reg_names[i]),
n_regs += 2;
}
@@ -3411,15 +2983,15 @@ restore_regs (file, low, high, base, offset, n_regs)
{
if (regs_ever_live[i] && ! call_used_regs[i])
if (regs_ever_live[i+1] && ! call_used_regs[i+1])
- fprintf (file, "\tldd [%s+%d], %s\n",
+ fprintf (file, "\tldd\t[%s+%d], %s\n",
base, offset + 4 * n_regs, reg_names[i]),
n_regs += 2;
else
- fprintf (file, "\tld [%s+%d],%s\n",
+ fprintf (file, "\tld\t[%s+%d],%s\n",
base, offset + 4 * n_regs, reg_names[i]),
n_regs += 2;
else if (regs_ever_live[i+1] && ! call_used_regs[i+1])
- fprintf (file, "\tld [%s+%d],%s\n",
+ fprintf (file, "\tld\t[%s+%d],%s\n",
base, offset + 4 * n_regs + 4, reg_names[i+1]),
n_regs += 2;
}
@@ -3508,9 +3080,9 @@ build_big_number (file, num, reg)
{
if (num >= 0 || ! TARGET_ARCH64)
{
- fprintf (file, "\tsethi %%hi(%d),%s\n", num, reg);
+ fprintf (file, "\tsethi\t%%hi(%d), %s\n", num, reg);
if ((num & 0x3ff) != 0)
- fprintf (file, "\tor %s,%%lo(%d),%s\n", reg, num, reg);
+ fprintf (file, "\tor\t%s, %%lo(%d), %s\n", reg, num, reg);
}
else /* num < 0 && TARGET_ARCH64 */
{
@@ -3523,7 +3095,7 @@ build_big_number (file, num, reg)
int inv = ~asize;
int low = -0x400 + (asize & 0x3FF);
- fprintf (file, "\tsethi %%hi(%d),%s\n\txor %s,%d,%s\n",
+ fprintf (file, "\tsethi\t%%hi(%d), %s\n\txor\t%s, %d, %s\n",
inv, reg, reg, low, reg);
}
}
@@ -3559,16 +3131,16 @@ output_function_prologue (file, size, leaf_function)
else if (! leaf_function && ! TARGET_BROKEN_SAVERESTORE)
{
if (actual_fsize <= 4096)
- fprintf (file, "\tsave %%sp,-%d,%%sp\n", actual_fsize);
+ fprintf (file, "\tsave\t%%sp, -%d, %%sp\n", actual_fsize);
else if (actual_fsize <= 8192)
{
- fprintf (file, "\tsave %%sp,-4096,%%sp\n");
- fprintf (file, "\tadd %%sp,-%d,%%sp\n", actual_fsize - 4096);
+ fprintf (file, "\tsave\t%%sp, -4096, %%sp\n");
+ fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize - 4096);
}
else
{
build_big_number (file, -actual_fsize, "%g1");
- fprintf (file, "\tsave %%sp,%%g1,%%sp\n");
+ fprintf (file, "\tsave\t%%sp, %%g1, %%sp\n");
}
}
else if (! leaf_function && TARGET_BROKEN_SAVERESTORE)
@@ -3579,31 +3151,31 @@ output_function_prologue (file, size, leaf_function)
fprintf (file, "\tsave\n");
if (actual_fsize <= 4096)
- fprintf (file, "\tadd %%fp,-%d,%%sp\n", actual_fsize);
+ fprintf (file, "\tadd\t%%fp, -%d, %%sp\n", actual_fsize);
else if (actual_fsize <= 8192)
{
- fprintf (file, "\tadd %%fp,-4096,%%sp\n");
- fprintf (file, "\tadd %%fp,-%d,%%sp\n", actual_fsize - 4096);
+ fprintf (file, "\tadd\t%%fp, -4096, %%sp\n");
+ fprintf (file, "\tadd\t%%fp, -%d, %%sp\n", actual_fsize - 4096);
}
else
{
build_big_number (file, -actual_fsize, "%g1");
- fprintf (file, "\tadd %%fp,%%g1,%%sp\n");
+ fprintf (file, "\tadd\t%%fp, %%g1, %%sp\n");
}
}
else /* leaf function */
{
if (actual_fsize <= 4096)
- fprintf (file, "\tadd %%sp,-%d,%%sp\n", actual_fsize);
+ fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize);
else if (actual_fsize <= 8192)
{
- fprintf (file, "\tadd %%sp,-4096,%%sp\n");
- fprintf (file, "\tadd %%sp,-%d,%%sp\n", actual_fsize - 4096);
+ fprintf (file, "\tadd\t%%sp, -4096, %%sp\n");
+ fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize - 4096);
}
else
{
build_big_number (file, -actual_fsize, "%g1");
- fprintf (file, "\tadd %%sp,%%g1,%%sp\n");
+ fprintf (file, "\tadd\t%%sp, %%g1, %%sp\n");
}
}
@@ -3649,7 +3221,7 @@ output_function_prologue (file, size, leaf_function)
output_function_epilogue will lose (the result will get
clobbered). */
build_big_number (file, offset, "%g1");
- fprintf (file, "\tadd %s,%%g1,%%g1\n", frame_base_name);
+ fprintf (file, "\tadd\t%s, %%g1, %%g1\n", frame_base_name);
base = "%g1";
offset = 0;
}
@@ -3658,6 +3230,7 @@ output_function_prologue (file, size, leaf_function)
base = frame_base_name;
}
+ n_regs = 0;
if (TARGET_EPILOGUE && ! leaf_function)
/* ??? Originally saved regs 0-15 here. */
n_regs = save_regs (file, 0, 8, base, offset, 0, real_offset);
@@ -3683,7 +3256,7 @@ output_function_prologue (file, size, leaf_function)
void
output_function_epilogue (file, size, leaf_function)
FILE *file;
- int size;
+ int size ATTRIBUTE_UNUSED;
int leaf_function;
{
char *ret;
@@ -3703,12 +3276,13 @@ output_function_epilogue (file, size, leaf_function)
else if (current_function_epilogue_delay_list == 0)
{
- /* If code does not drop into the epilogue, do nothing. */
+ /* If code does not drop into the epilogue, we need
+ do nothing except output pending case vectors. */
rtx insn = get_last_insn ();
if (GET_CODE (insn) == NOTE)
insn = prev_nonnote_insn (insn);
if (insn && GET_CODE (insn) == BARRIER)
- return;
+ goto output_vectors;
}
/* Restore any call saved registers. */
@@ -3721,7 +3295,7 @@ output_function_epilogue (file, size, leaf_function)
if (offset < -4096 || offset + num_gfregs * 4 > 4096 - 8 /*double*/)
{
build_big_number (file, offset, "%g1");
- fprintf (file, "\tadd %s,%%g1,%%g1\n", frame_base_name);
+ fprintf (file, "\tadd\t%s, %%g1, %%g1\n", frame_base_name);
base = "%g1";
offset = 0;
}
@@ -3730,6 +3304,7 @@ output_function_epilogue (file, size, leaf_function)
base = frame_base_name;
}
+ n_regs = 0;
if (TARGET_EPILOGUE && ! leaf_function)
/* ??? Originally saved regs 0-15 here. */
n_regs = restore_regs (file, 0, 8, base, offset, 0);
@@ -3742,9 +3317,9 @@ output_function_epilogue (file, size, leaf_function)
/* Work out how to skip the caller's unimp instruction if required. */
if (leaf_function)
- ret = (SKIP_CALLERS_UNIMP_P ? "jmp %o7+12" : "retl");
+ ret = (SKIP_CALLERS_UNIMP_P ? "jmp\t%o7+12" : "retl");
else
- ret = (SKIP_CALLERS_UNIMP_P ? "jmp %i7+12" : "ret");
+ ret = (SKIP_CALLERS_UNIMP_P ? "jmp\t%i7+12" : "ret");
if (TARGET_EPILOGUE || leaf_label)
{
@@ -3756,16 +3331,16 @@ output_function_epilogue (file, size, leaf_function)
/* If we wound up with things in our delay slot, flush them here. */
if (current_function_epilogue_delay_list)
{
- rtx insn = emit_jump_insn_after (gen_rtx (RETURN, VOIDmode),
+ rtx insn = emit_jump_insn_after (gen_rtx_RETURN (VOIDmode),
get_last_insn ());
- PATTERN (insn) = gen_rtx (PARALLEL, VOIDmode,
+ PATTERN (insn) = gen_rtx_PARALLEL (VOIDmode,
gen_rtvec (2,
PATTERN (XEXP (current_function_epilogue_delay_list, 0)),
PATTERN (insn)));
final_scan_insn (insn, file, 1, 0, 1);
}
else if (TARGET_V9 && ! SKIP_CALLERS_UNIMP_P)
- fputs ("\treturn %i7+8\n\tnop\n", file);
+ fputs ("\treturn\t%i7+8\n\tnop\n", file);
else
fprintf (file, "\t%s\n\trestore\n", ret);
}
@@ -3787,18 +3362,21 @@ output_function_epilogue (file, size, leaf_function)
else if (actual_fsize == 0)
fprintf (file, "\t%s\n\tnop\n", ret);
else if (actual_fsize <= 4096)
- fprintf (file, "\t%s\n\tsub %%sp,-%d,%%sp\n", ret, actual_fsize);
+ fprintf (file, "\t%s\n\tsub\t%%sp, -%d, %%sp\n", ret, actual_fsize);
else if (actual_fsize <= 8192)
- fprintf (file, "\tsub %%sp,-4096,%%sp\n\t%s\n\tsub %%sp,-%d,%%sp\n",
+ fprintf (file, "\tsub\t%%sp, -4096, %%sp\n\t%s\n\tsub\t%%sp, -%d, %%sp\n",
ret, actual_fsize - 4096);
else if ((actual_fsize & 0x3ff) == 0)
- fprintf (file, "\tsethi %%hi(%d),%%g1\n\t%s\n\tadd %%sp,%%g1,%%sp\n",
+ fprintf (file, "\tsethi\t%%hi(%d), %%g1\n\t%s\n\tadd\t%%sp, %%g1, %%sp\n",
actual_fsize, ret);
else
- fprintf (file, "\tsethi %%hi(%d),%%g1\n\tor %%g1,%%lo(%d),%%g1\n\t%s\n\tadd %%sp,%%g1,%%sp\n",
+ fprintf (file, "\tsethi\t%%hi(%d), %%g1\n\tor\t%%g1, %%lo(%d), %%g1\n\t%s\n\tadd\t%%sp, %%g1, %%sp\n",
actual_fsize, actual_fsize, ret);
target_flags |= old_target_epilogue;
}
+
+ output_vectors:
+ sparc_output_deferred_case_vectors ();
}
/* Functions for handling argument passing.
@@ -3866,8 +3444,9 @@ output_function_epilogue (file, size, leaf_function)
void
init_cumulative_args (cum, fntype, libname, indirect)
CUMULATIVE_ARGS *cum;
- tree fntype, libname;
- int indirect;
+ tree fntype;
+ tree libname ATTRIBUTE_UNUSED;
+ int indirect ATTRIBUTE_UNUSED;
{
cum->words = 0;
cum->prototype_p = fntype && TYPE_ARG_TYPES (fntype);
@@ -4034,6 +3613,13 @@ struct function_arg_record_value_parms
int nregs, intoffset;
};
+static void function_arg_record_value_3
+ PROTO((int, struct function_arg_record_value_parms *));
+static void function_arg_record_value_2
+ PROTO((tree, int, struct function_arg_record_value_parms *));
+static rtx function_arg_record_value
+ PROTO((tree, enum machine_mode, int, int, int));
+
static void
function_arg_record_value_1 (type, startbitpos, parms)
tree type;
@@ -4147,9 +3733,9 @@ function_arg_record_value_3 (bitpos, parms)
do
{
regno = parms->regbase + this_slotno;
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
XVECEXP (parms->ret, 0, parms->nregs)
- = gen_rtx (EXPR_LIST, VOIDmode, reg, GEN_INT (intoffset));
+ = gen_rtx_EXPR_LIST (VOIDmode, reg, GEN_INT (intoffset));
this_slotno += 1;
intoffset = (intoffset | (UNITS_PER_WORD-1)) + 1;
@@ -4200,12 +3786,12 @@ function_arg_record_value_2 (type, startbitpos, parms)
function_arg_record_value_3 (bitpos, parms);
- reg = gen_rtx (REG, DECL_MODE (field),
+ reg = gen_rtx_REG (DECL_MODE (field),
(SPARC_FP_ARG_FIRST + this_slotno * 2
+ (DECL_MODE (field) == SFmode
&& (bitpos & 32) != 0)));
XVECEXP (parms->ret, 0, parms->nregs)
- = gen_rtx (EXPR_LIST, VOIDmode, reg,
+ = gen_rtx_EXPR_LIST (VOIDmode, reg,
GEN_INT (bitpos / BITS_PER_UNIT));
parms->nregs += 1;
}
@@ -4219,8 +3805,9 @@ function_arg_record_value_2 (type, startbitpos, parms)
}
static rtx
-function_arg_record_value (type, slotno, named, regbase)
+function_arg_record_value (type, mode, slotno, named, regbase)
tree type;
+ enum machine_mode mode;
int slotno, named, regbase;
{
HOST_WIDE_INT typesize = int_size_in_bytes (type);
@@ -4262,7 +3849,7 @@ function_arg_record_value (type, slotno, named, regbase)
anyway so the rest of gcc doesn't go nuts. Returning a PARALLEL
leads to breakage due to the fact that there are zero bytes to
load. */
- return gen_rtx (REG, DImode, regbase);
+ return gen_rtx_REG (mode, regbase);
}
else
{
@@ -4274,9 +3861,9 @@ function_arg_record_value (type, slotno, named, regbase)
nregs = SPARC_INT_ARG_MAX - slotno;
}
if (nregs == 0)
- abort();
+ abort ();
- parms.ret = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (nregs));
+ parms.ret = gen_rtx_PARALLEL (mode, rtvec_alloc (nregs));
/* Fill in the entries. */
parms.nregs = 0;
@@ -4327,7 +3914,7 @@ function_arg (cum, mode, type, named, incoming_p)
if (TARGET_ARCH32)
{
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
return reg;
}
@@ -4339,7 +3926,7 @@ function_arg (cum, mode, type, named, incoming_p)
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
&& SPARC_FP_REG_P (regno))
{
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
if (cum->prototype_p || cum->libcall_p)
{
/* "* 2" because fp reg numbers are recorded in 4 byte
@@ -4350,11 +3937,11 @@ function_arg (cum, mode, type, named, incoming_p)
value in the reg but reserve space on the stack. That's an
optimization, and is deferred [for a bit]. */
if ((regno - SPARC_FP_ARG_FIRST) >= SPARC_INT_ARG_MAX * 2)
- return gen_rtx (PARALLEL, mode,
+ return gen_rtx_PARALLEL (mode,
gen_rtvec (2,
- gen_rtx (EXPR_LIST, VOIDmode,
+ gen_rtx_EXPR_LIST (VOIDmode,
NULL_RTX, const0_rtx),
- gen_rtx (EXPR_LIST, VOIDmode,
+ gen_rtx_EXPR_LIST (VOIDmode,
reg, const0_rtx)));
else
#else
@@ -4408,7 +3995,7 @@ function_arg (cum, mode, type, named, incoming_p)
if (int_size_in_bytes (type) > 16)
abort (); /* shouldn't get here */
- return function_arg_record_value (type, slotno, named, regbase);
+ return function_arg_record_value (type, mode, slotno, named, regbase);
}
else if (type && TREE_CODE (type) == UNION_TYPE)
{
@@ -4419,12 +4006,12 @@ function_arg (cum, mode, type, named, incoming_p)
abort ();
mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0);
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
}
else
{
/* Scalar or complex int. */
- reg = gen_rtx (REG, mode, regno);
+ reg = gen_rtx_REG (mode, regno);
}
return reg;
@@ -4514,10 +4101,10 @@ function_arg_partial_nregs (cum, mode, type, named)
int
function_arg_pass_by_reference (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum;
+ const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
enum machine_mode mode;
tree type;
- int named;
+ int named ATTRIBUTE_UNUSED;
{
if (TARGET_ARCH32)
{
@@ -4638,7 +4225,7 @@ function_value (type, mode, incoming_p)
if (int_size_in_bytes (type) > 32)
abort (); /* shouldn't get here */
- return function_arg_record_value (type, 0, 1, regbase);
+ return function_arg_record_value (type, mode, 0, 1, regbase);
}
else if (TREE_CODE (type) == UNION_TYPE)
{
@@ -4650,13 +4237,19 @@ function_value (type, mode, incoming_p)
mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0);
}
}
+
+ if (TARGET_ARCH64
+ && GET_MODE_CLASS (mode) == MODE_INT
+ && GET_MODE_SIZE (mode) < UNITS_PER_WORD
+ && type && TREE_CODE (type) != UNION_TYPE)
+ mode = DImode;
if (incoming_p)
regno = BASE_RETURN_VALUE_REG (mode);
else
regno = BASE_OUTGOING_VALUE_REG (mode);
- return gen_rtx (REG, mode, regno);
+ return gen_rtx_REG (mode, regno);
}
/* Do what is necessary for `va_start'. The argument is ignored.
@@ -4666,26 +4259,22 @@ function_value (type, mode, incoming_p)
rtx
sparc_builtin_saveregs (arglist)
- tree arglist;
+ tree arglist ATTRIBUTE_UNUSED;
{
- tree fntype = TREE_TYPE (current_function_decl);
- int stdarg = (TYPE_ARG_TYPES (fntype) != 0
- && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
- != void_type_node));
int first_reg = current_function_args_info.words;
rtx address;
int regno;
for (regno = first_reg; regno < NPARM_REGS (word_mode); regno++)
- emit_move_insn (gen_rtx (MEM, word_mode,
- gen_rtx (PLUS, Pmode,
+ emit_move_insn (gen_rtx_MEM (word_mode,
+ gen_rtx_PLUS (Pmode,
frame_pointer_rtx,
GEN_INT (STACK_POINTER_OFFSET
+ UNITS_PER_WORD * regno))),
- gen_rtx (REG, word_mode,
+ gen_rtx_REG (word_mode,
BASE_INCOMING_ARG_REG (word_mode) + regno));
- address = gen_rtx (PLUS, Pmode,
+ address = gen_rtx_PLUS (Pmode,
frame_pointer_rtx,
GEN_INT (STACK_POINTER_OFFSET
+ UNITS_PER_WORD * first_reg));
@@ -4711,24 +4300,27 @@ sparc_builtin_saveregs (arglist)
ANNUL is non-zero if we should generate an annulling branch.
- NOOP is non-zero if we have to follow this branch by a noop. */
+ NOOP is non-zero if we have to follow this branch by a noop.
+
+ INSN, if set, is the insn. */
char *
-output_cbranch (op, label, reversed, annul, noop)
+output_cbranch (op, label, reversed, annul, noop, insn)
rtx op;
int label;
int reversed, annul, noop;
+ rtx insn;
{
- static char string[20];
+ static char string[32];
enum rtx_code code = GET_CODE (op);
rtx cc_reg = XEXP (op, 0);
enum machine_mode mode = GET_MODE (cc_reg);
- static char v8_labelno[] = " %lX";
- static char v9_icc_labelno[] = " %%icc,%lX";
- static char v9_xcc_labelno[] = " %%xcc,%lX";
- static char v9_fcc_labelno[] = " %%fccX,%lY";
+ static char v8_labelno[] = "%lX";
+ static char v9_icc_labelno[] = "%%icc, %lX";
+ static char v9_xcc_labelno[] = "%%xcc, %lX";
+ static char v9_fcc_labelno[] = "%%fccX, %lY";
char *labelno;
- int labeloff;
+ int labeloff, spaces = 8;
/* ??? !v9: FP branches cannot be preceded by another floating point insn.
Because there is currently no concept of pre-delay slots, we can fix
@@ -4749,16 +4341,28 @@ output_cbranch (op, label, reversed, annul, noop)
{
case NE:
if (mode == CCFPmode || mode == CCFPEmode)
- strcat (string, "fbne");
+ {
+ strcat (string, "fbne");
+ spaces -= 4;
+ }
else
- strcpy (string, "bne");
+ {
+ strcpy (string, "bne");
+ spaces -= 3;
+ }
break;
case EQ:
if (mode == CCFPmode || mode == CCFPEmode)
- strcat (string, "fbe");
+ {
+ strcat (string, "fbe");
+ spaces -= 3;
+ }
else
- strcpy (string, "be");
+ {
+ strcpy (string, "be");
+ spaces -= 2;
+ }
break;
case GE:
@@ -4768,23 +4372,39 @@ output_cbranch (op, label, reversed, annul, noop)
strcat (string, "fbul");
else
strcat (string, "fbge");
+ spaces -= 4;
}
else if (mode == CC_NOOVmode)
- strcpy (string, "bpos");
+ {
+ strcpy (string, "bpos");
+ spaces -= 4;
+ }
else
- strcpy (string, "bge");
+ {
+ strcpy (string, "bge");
+ spaces -= 3;
+ }
break;
case GT:
if (mode == CCFPmode || mode == CCFPEmode)
{
if (reversed)
- strcat (string, "fbule");
+ {
+ strcat (string, "fbule");
+ spaces -= 5;
+ }
else
- strcat (string, "fbg");
+ {
+ strcat (string, "fbg");
+ spaces -= 3;
+ }
}
else
- strcpy (string, "bg");
+ {
+ strcpy (string, "bg");
+ spaces -= 2;
+ }
break;
case LE:
@@ -4794,65 +4414,95 @@ output_cbranch (op, label, reversed, annul, noop)
strcat (string, "fbug");
else
strcat (string, "fble");
+ spaces -= 4;
}
else
- strcpy (string, "ble");
+ {
+ strcpy (string, "ble");
+ spaces -= 3;
+ }
break;
case LT:
if (mode == CCFPmode || mode == CCFPEmode)
{
if (reversed)
- strcat (string, "fbuge");
+ {
+ strcat (string, "fbuge");
+ spaces -= 5;
+ }
else
- strcat (string, "fbl");
+ {
+ strcat (string, "fbl");
+ spaces -= 3;
+ }
}
else if (mode == CC_NOOVmode)
- strcpy (string, "bneg");
+ {
+ strcpy (string, "bneg");
+ spaces -= 4;
+ }
else
- strcpy (string, "bl");
+ {
+ strcpy (string, "bl");
+ spaces -= 2;
+ }
break;
case GEU:
strcpy (string, "bgeu");
+ spaces -= 4;
break;
case GTU:
strcpy (string, "bgu");
+ spaces -= 3;
break;
case LEU:
strcpy (string, "bleu");
+ spaces -= 4;
break;
case LTU:
strcpy (string, "blu");
+ spaces -= 3;
break;
default:
- break;
+ abort ();
}
/* Now add the annulling, the label, and a possible noop. */
if (annul)
- strcat (string, ",a");
-
- /* ??? If v9, optional prediction bit ",pt" or ",pf" goes here. */
+ {
+ strcat (string, ",a");
+ spaces -= 2;
+ }
if (! TARGET_V9)
{
- labeloff = 3;
+ labeloff = 2;
labelno = v8_labelno;
}
else
{
+ rtx note;
+
+ if (insn && (note = find_reg_note (insn, REG_BR_PRED, NULL_RTX)))
+ {
+ strcat (string,
+ INTVAL (XEXP (note, 0)) & ATTR_FLAG_likely ? ",pt" : ",pn");
+ spaces -= 3;
+ }
+
labeloff = 9;
if (mode == CCFPmode || mode == CCFPEmode)
{
labeloff = 10;
labelno = v9_fcc_labelno;
/* Set the char indicating the number of the fcc reg to use. */
- labelno[6] = REGNO (cc_reg) - SPARC_FIRST_V9_FCC_REG + '0';
+ labelno[5] = REGNO (cc_reg) - SPARC_FIRST_V9_FCC_REG + '0';
}
else if (mode == CCXmode || mode == CCX_NOOVmode)
labelno = v9_xcc_labelno;
@@ -4862,6 +4512,10 @@ output_cbranch (op, label, reversed, annul, noop)
/* Set the char indicating the number of the operand containing the
label_ref. */
labelno[labeloff] = label + '0';
+ if (spaces > 0)
+ strcat (string, "\t");
+ else
+ strcat (string, " ");
strcat (string, labelno);
if (noop)
@@ -4882,15 +4536,18 @@ output_cbranch (op, label, reversed, annul, noop)
NOOP is non-zero if we have to follow this branch by a noop. */
char *
-output_v9branch (op, reg, label, reversed, annul, noop)
+output_v9branch (op, reg, label, reversed, annul, noop, insn)
rtx op;
int reg, label;
int reversed, annul, noop;
+ rtx insn;
{
static char string[20];
enum rtx_code code = GET_CODE (op);
enum machine_mode mode = GET_MODE (XEXP (op, 0));
- static char labelno[] = " %X,%lX";
+ static char labelno[] = "%X, %lX";
+ rtx note;
+ int spaces = 8;
/* If not floating-point or if EQ or NE, we can just reverse the code. */
if (reversed)
@@ -4906,26 +4563,32 @@ output_v9branch (op, reg, label, reversed, annul, noop)
{
case NE:
strcpy (string, "brnz");
+ spaces -= 4;
break;
case EQ:
strcpy (string, "brz");
+ spaces -= 3;
break;
case GE:
strcpy (string, "brgez");
+ spaces -= 5;
break;
case LT:
strcpy (string, "brlz");
+ spaces -= 4;
break;
case LE:
strcpy (string, "brlez");
+ spaces -= 5;
break;
case GT:
strcpy (string, "brgz");
+ spaces -= 4;
break;
default:
@@ -4934,12 +4597,24 @@ output_v9branch (op, reg, label, reversed, annul, noop)
/* Now add the annulling, reg, label, and nop. */
if (annul)
- strcat (string, ",a");
+ {
+ strcat (string, ",a");
+ spaces -= 2;
+ }
- /* ??? Optional prediction bit ",pt" or ",pf" goes here. */
+ if (insn && (note = find_reg_note (insn, REG_BR_PRED, NULL_RTX)))
+ {
+ strcat (string,
+ INTVAL (XEXP (note, 0)) & ATTR_FLAG_likely ? ",pt" : ",pn");
+ spaces -= 3;
+ }
- labelno[2] = reg + '0';
+ labelno[1] = reg + '0';
labelno[6] = label + '0';
+ if (spaces > 0)
+ strcat (string, "\t");
+ else
+ strcat (string, " ");
strcat (string, labelno);
if (noop)
@@ -4996,7 +4671,7 @@ epilogue_renumber (where)
default:
debug_rtx (*where);
- abort();
+ abort ();
}
}
@@ -5031,24 +4706,24 @@ output_return (operands)
if (actual_fsize <= 4096)
{
if (SKIP_CALLERS_UNIMP_P)
- return "jmp %%o7+12\n\tsub %%sp,-%0,%%sp";
+ return "jmp\t%%o7+12\n\tsub\t%%sp, -%0, %%sp";
else
- return "retl\n\tsub %%sp,-%0,%%sp";
+ return "retl\n\tsub\t%%sp, -%0, %%sp";
}
else if (actual_fsize <= 8192)
{
operands[0] = GEN_INT (actual_fsize - 4096);
if (SKIP_CALLERS_UNIMP_P)
- return "sub %%sp,-4096,%%sp\n\tjmp %%o7+12\n\tsub %%sp,-%0,%%sp";
+ return "sub\t%%sp, -4096, %%sp\n\tjmp\t%%o7+12\n\tsub\t%%sp, -%0, %%sp";
else
- return "sub %%sp,-4096,%%sp\n\tretl\n\tsub %%sp,-%0,%%sp";
+ return "sub\t%%sp, -4096, %%sp\n\tretl\n\tsub\t%%sp, -%0, %%sp";
}
else if (SKIP_CALLERS_UNIMP_P)
{
if ((actual_fsize & 0x3ff) != 0)
- return "sethi %%hi(%a0),%%g1\n\tor %%g1,%%lo(%a0),%%g1\n\tjmp %%o7+12\n\tadd %%sp,%%g1,%%sp";
+ return "sethi\t%%hi(%a0), %%g1\n\tor\t%%g1, %%lo(%a0), %%g1\n\tjmp\t%%o7+12\n\tadd\t%%sp, %%g1, %%sp";
else
- return "sethi %%hi(%a0),%%g1\n\tjmp %%o7+12\n\tadd %%sp,%%g1,%%sp";
+ return "sethi\t%%hi(%a0), %%g1\n\tjmp\t%%o7+12\n\tadd\t%%sp, %%g1, %%sp";
}
else
{
@@ -5066,16 +4741,16 @@ output_return (operands)
epilogue_renumber (&SET_SRC (PATTERN (delay)));
}
if (SKIP_CALLERS_UNIMP_P)
- return "return %%i7+12%#";
+ return "return\t%%i7+12%#";
else
- return "return %%i7+8%#";
+ return "return\t%%i7+8%#";
}
else
{
if (delay)
abort ();
if (SKIP_CALLERS_UNIMP_P)
- return "jmp %%i7+12\n\trestore";
+ return "jmp\t%%i7+12\n\trestore";
else
return "ret\n\trestore";
}
@@ -5106,6 +4781,53 @@ order_regs_for_local_alloc ()
}
}
+/* Return 1 if REG and MEM are legitimate enough to allow the various
+ mem<-->reg splits to be run. */
+
+int
+sparc_splitdi_legitimate (reg, mem)
+ rtx reg;
+ rtx mem;
+{
+ /* Punt if we are here by mistake. */
+ if (! reload_completed)
+ abort ();
+
+ /* We must have an offsettable memory reference. */
+ if (! offsettable_memref_p (mem))
+ return 0;
+
+ /* If we have legitimate args for ldd/std, we do not want
+ the split to happen. */
+ if ((REGNO (reg) % 2) == 0
+ && mem_min_alignment (mem, 8))
+ return 0;
+
+ /* Success. */
+ return 1;
+}
+
+/* Return 1 if x and y are some kind of REG and they refer to
+ different hard registers. This test is guarenteed to be
+ run after reload. */
+
+int
+sparc_absnegfloat_split_legitimate (x, y)
+ rtx x, y;
+{
+ if (GET_CODE (x) == SUBREG)
+ x = alter_subreg (x);
+ if (GET_CODE (x) != REG)
+ return 0;
+ if (GET_CODE (y) == SUBREG)
+ y = alter_subreg (y);
+ if (GET_CODE (y) != REG)
+ return 0;
+ if (REGNO (x) == REGNO (y))
+ return 0;
+ return 1;
+}
+
/* Return 1 if REGNO (reg1) is even and REGNO (reg1) == REGNO (reg2) - 1.
This makes them candidates for using ldd and std insns.
@@ -5236,7 +4958,7 @@ print_operand (file, x, code)
case '#':
/* Output a 'nop' if there's nothing for the delay slot. */
if (dbr_sequence_length () == 0)
- fputs ("\n\tnop", file);
+ fputs ("\n\t nop", file);
return;
case '*':
/* Output an annul flag if there's nothing for the delay slot and we
@@ -5254,7 +4976,7 @@ print_operand (file, x, code)
not optimizing. This is always used with '*' above. */
if (dbr_sequence_length () == 0
&& ! (optimize && (int)sparc_cpu < PROCESSOR_V9))
- fputs ("\n\tnop", file);
+ fputs ("\n\t nop", file);
return;
case '_':
/* Output the Embedded Medium/Anywhere code model base register. */
@@ -5456,7 +5178,10 @@ print_operand (file, x, code)
else if (GET_CODE (x) == LO_SUM)
{
print_operand (file, XEXP (x, 0), 0);
- fputs ("+%lo(", file);
+ if (TARGET_CM_MEDMID)
+ fputs ("+%l44(", file);
+ else
+ fputs ("+%lo(", file);
output_addr_const (file, XEXP (x, 1));
fputc (')', file);
}
@@ -5522,7 +5247,7 @@ output_double_int (file, value)
|| GET_CODE (value) == CODE_LABEL
|| GET_CODE (value) == MINUS)))
{
- if (!TARGET_V9 || TARGET_CM_MEDLOW)
+ if (! TARGET_V9)
{
ASM_OUTPUT_INT (file, const0_rtx);
ASM_OUTPUT_INT (file, value);
@@ -5703,34 +5428,53 @@ void
sparc_initialize_trampoline (tramp, fnaddr, cxt)
rtx tramp, fnaddr, cxt;
{
- rtx high_cxt = expand_shift (RSHIFT_EXPR, SImode, cxt,
- size_int (10), 0, 1);
- rtx high_fn = expand_shift (RSHIFT_EXPR, SImode, fnaddr,
- size_int (10), 0, 1);
- rtx low_cxt = expand_and (cxt, GEN_INT (0x3ff), 0);
- rtx low_fn = expand_and (fnaddr, GEN_INT (0x3ff), 0);
- rtx g1_sethi = gen_rtx (HIGH, SImode, GEN_INT (0x03000000));
- rtx g2_sethi = gen_rtx (HIGH, SImode, GEN_INT (0x05000000));
- rtx g1_ori = gen_rtx (HIGH, SImode, GEN_INT (0x82106000));
- rtx g2_ori = gen_rtx (HIGH, SImode, GEN_INT (0x8410A000));
- rtx tem = gen_reg_rtx (SImode);
- emit_move_insn (tem, g1_sethi);
- emit_insn (gen_iorsi3 (high_fn, high_fn, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 0)), high_fn);
- emit_move_insn (tem, g1_ori);
- emit_insn (gen_iorsi3 (low_fn, low_fn, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 4)), low_fn);
- emit_move_insn (tem, g2_sethi);
- emit_insn (gen_iorsi3 (high_cxt, high_cxt, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 8)), high_cxt);
- emit_move_insn (tem, g2_ori);
- emit_insn (gen_iorsi3 (low_cxt, low_cxt, tem));
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (tramp, 16)), low_cxt);
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, SImode, tramp))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, SImode,
- plus_constant (tramp, 8)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, SImode,
- plus_constant (tramp, 16)))));
+ /* SPARC 32 bit trampoline:
+
+ sethi %hi(fn), %g1
+ sethi %hi(static), %g2
+ jmp %g1+%lo(fn)
+ or %g2, %lo(static), %g2
+
+ SETHI i,r = 00rr rrr1 00ii iiii iiii iiii iiii iiii
+ JMPL r+i,d = 10dd ddd1 1100 0rrr rr1i iiii iiii iiii
+ */
+#ifdef TRANSFER_FROM_TRAMPOLINE
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
+ 0, VOIDmode, 1, tramp, Pmode);
+#endif
+
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 0)),
+ expand_binop (SImode, ior_optab,
+ expand_shift (RSHIFT_EXPR, SImode, fnaddr,
+ size_int (10), 0, 1),
+ GEN_INT (0x03000000),
+ NULL_RTX, 1, OPTAB_DIRECT));
+
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
+ expand_binop (SImode, ior_optab,
+ expand_shift (RSHIFT_EXPR, SImode, cxt,
+ size_int (10), 0, 1),
+ GEN_INT (0x05000000),
+ NULL_RTX, 1, OPTAB_DIRECT));
+
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
+ expand_binop (SImode, ior_optab,
+ expand_and (fnaddr, GEN_INT (0x3ff), NULL_RTX),
+ GEN_INT (0x81c06000),
+ NULL_RTX, 1, OPTAB_DIRECT));
+
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
+ expand_binop (SImode, ior_optab,
+ expand_and (cxt, GEN_INT (0x3ff), NULL_RTX),
+ GEN_INT (0x8410a000),
+ NULL_RTX, 1, OPTAB_DIRECT));
+
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp))));
+ /* On UltraSPARC a flush flushes an entire cache line. The trampoline is
+ aligned on a 16 byte boundary so one flush clears it all. */
+ if (sparc_cpu != PROCESSOR_ULTRASPARC)
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode,
+ plus_constant (tramp, 8)))));
}
/* The 64 bit version is simpler because it makes more sense to load the
@@ -5741,17 +5485,33 @@ void
sparc64_initialize_trampoline (tramp, fnaddr, cxt)
rtx tramp, fnaddr, cxt;
{
- emit_move_insn (gen_rtx (MEM, DImode, plus_constant (tramp, 24)), cxt);
- emit_move_insn (gen_rtx (MEM, DImode, plus_constant (tramp, 32)), fnaddr);
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode, tramp))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 8)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 16)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 24)))));
- emit_insn (gen_flush (validize_mem (gen_rtx (MEM, DImode,
- plus_constant (tramp, 32)))));
+#ifdef TRANSFER_FROM_TRAMPOLINE
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
+ 0, VOIDmode, 1, tramp, Pmode);
+#endif
+
+ /*
+ rd %pc, %g1
+ ldx [%g1+24], %g5
+ jmp %g5
+ ldx [%g1+16], %g5
+ +16 bytes data
+ */
+
+ emit_move_insn (gen_rtx_MEM (SImode, tramp),
+ GEN_INT (0x83414000));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
+ GEN_INT (0xca586018));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
+ GEN_INT (0x81c14000));
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
+ GEN_INT (0xca586010));
+ emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 16)), cxt);
+ emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 24)), fnaddr);
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (DImode, tramp))));
+
+ if (sparc_cpu != PROCESSOR_ULTRASPARC)
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8)))));
}
/* Subroutines to support a flat (single) register window calling
@@ -6001,7 +5761,7 @@ sparc_flat_save_restore (file, base_reg, offset, gmask, fmask, word_op,
if (word_op[0] == 's')
{
- fprintf (file, "\t%s %s,[%s+%d]\n",
+ fprintf (file, "\t%s\t%s, [%s+%d]\n",
doubleword_op, reg_names[regno],
base_reg, offset);
if (dwarf2out_do_frame ())
@@ -6013,7 +5773,7 @@ sparc_flat_save_restore (file, base_reg, offset, gmask, fmask, word_op,
}
}
else
- fprintf (file, "\t%s [%s+%d],%s\n",
+ fprintf (file, "\t%s\t[%s+%d], %s\n",
doubleword_op, base_reg, offset,
reg_names[regno]);
@@ -6024,14 +5784,14 @@ sparc_flat_save_restore (file, base_reg, offset, gmask, fmask, word_op,
{
if (word_op[0] == 's')
{
- fprintf (file, "\t%s %s,[%s+%d]\n",
+ fprintf (file, "\t%s\t%s, [%s+%d]\n",
word_op, reg_names[regno],
base_reg, offset);
if (dwarf2out_do_frame ())
dwarf2out_reg_save ("", regno, offset + base_offset);
}
else
- fprintf (file, "\t%s [%s+%d],%s\n",
+ fprintf (file, "\t%s\t[%s+%d], %s\n",
word_op, base_reg, offset, reg_names[regno]);
offset += UNITS_PER_WORD;
@@ -6048,14 +5808,14 @@ sparc_flat_save_restore (file, base_reg, offset, gmask, fmask, word_op,
{
if (word_op[0] == 's')
{
- fprintf (file, "\t%s %s,[%s+%d]\n",
+ fprintf (file, "\t%s\t%s, [%s+%d]\n",
word_op, reg_names[regno],
base_reg, offset);
if (dwarf2out_do_frame ())
dwarf2out_reg_save ("", regno, offset + base_offset);
}
else
- fprintf (file, "\t%s [%s+%d],%s\n",
+ fprintf (file, "\t%s\t[%s+%d], %s\n",
word_op, base_reg, offset, reg_names[regno]);
offset += UNITS_PER_WORD;
@@ -6127,26 +5887,26 @@ sparc_flat_output_function_prologue (file, size)
{
if (size <= 4096)
{
- fprintf (file, "\tadd %s,%d,%s\n",
+ fprintf (file, "\tadd\t%s, %d, %s\n",
sp_str, -size, sp_str);
if (gmask & FRAME_POINTER_MASK)
{
- fprintf (file, "\tst %s,[%s+%d]\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n",
fp_str, sp_str, reg_offset);
- fprintf (file, "\tsub %s,%d,%s\t%s# set up frame pointer\n",
+ fprintf (file, "\tsub\t%s, %d, %s\t%s# set up frame pointer\n",
sp_str, -size, fp_str, ASM_COMMENT_START);
reg_offset += 4;
}
}
else
{
- fprintf (file, "\tset %d,%s\n\tsub %s,%s,%s\n",
+ fprintf (file, "\tset\t%d, %s\n\tsub\t%s, %s, %s\n",
size, t1_str, sp_str, t1_str, sp_str);
if (gmask & FRAME_POINTER_MASK)
{
- fprintf (file, "\tst %s,[%s+%d]\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n",
fp_str, sp_str, reg_offset);
- fprintf (file, "\tadd %s,%s,%s\t%s# set up frame pointer\n",
+ fprintf (file, "\tadd\t%s, %s, %s\t%s# set up frame pointer\n",
sp_str, t1_str, fp_str, ASM_COMMENT_START);
reg_offset += 4;
}
@@ -6165,7 +5925,7 @@ sparc_flat_output_function_prologue (file, size)
}
if (gmask & RETURN_ADDR_MASK)
{
- fprintf (file, "\tst %s,[%s+%d]\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n",
reg_names[RETURN_ADDR_REGNUM], sp_str, reg_offset);
if (dwarf2out_do_frame ())
dwarf2out_return_save ("", reg_offset - size);
@@ -6187,11 +5947,11 @@ sparc_flat_output_function_prologue (file, size)
if (size1 <= 4096)
{
- fprintf (file, "\tadd %s,%d,%s\n",
+ fprintf (file, "\tadd\t%s, %d, %s\n",
sp_str, -size1, sp_str);
if (gmask & FRAME_POINTER_MASK)
{
- fprintf (file, "\tst %s,[%s+%d]\n\tsub %s,%d,%s\t%s# set up frame pointer\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n\tsub\t%s, %d, %s\t%s# set up frame pointer\n",
fp_str, sp_str, offset, sp_str, -size1, fp_str,
ASM_COMMENT_START);
offset += 4;
@@ -6199,11 +5959,11 @@ sparc_flat_output_function_prologue (file, size)
}
else
{
- fprintf (file, "\tset %d,%s\n\tsub %s,%s,%s\n",
+ fprintf (file, "\tset\t%d, %s\n\tsub\t%s, %s, %s\n",
size1, t1_str, sp_str, t1_str, sp_str);
if (gmask & FRAME_POINTER_MASK)
{
- fprintf (file, "\tst %s,[%s+%d]\n\tadd %s,%s,%s\t%s# set up frame pointer\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n\tadd\t%s, %s, %s\t%s# set up frame pointer\n",
fp_str, sp_str, offset, sp_str, t1_str, fp_str,
ASM_COMMENT_START);
offset += 4;
@@ -6223,7 +5983,7 @@ sparc_flat_output_function_prologue (file, size)
}
if (gmask & RETURN_ADDR_MASK)
{
- fprintf (file, "\tst %s,[%s+%d]\n",
+ fprintf (file, "\tst\t%s, [%s+%d]\n",
reg_names[RETURN_ADDR_REGNUM], sp_str, offset);
if (dwarf2out_do_frame ())
/* offset - size1 == reg_offset - size
@@ -6235,7 +5995,7 @@ sparc_flat_output_function_prologue (file, size)
gmask & ~(FRAME_POINTER_MASK | RETURN_ADDR_MASK),
current_frame_info.fmask,
"st", "std", -size1);
- fprintf (file, "\tset %d,%s\n\tsub %s,%s,%s\n",
+ fprintf (file, "\tset\t%d, %s\n\tsub\t%s, %s, %s\n",
size - size1, t1_str, sp_str, t1_str, sp_str);
if (dwarf2out_do_frame ())
if (! (gmask & FRAME_POINTER_MASK))
@@ -6295,15 +6055,15 @@ sparc_flat_output_function_epilogue (file, size)
delay slot if not otherwise filled by the reload sequence. */
if (size > 4095)
- fprintf (file, "\tset %d,%s\n", size, t1_str);
+ fprintf (file, "\tset\t%d, %s\n", size, t1_str);
if (frame_pointer_needed)
{
if (size > 4095)
- fprintf (file,"\tsub %s,%s,%s\t\t%s# sp not trusted here\n",
+ fprintf (file,"\tsub\t%s, %s, %s\t\t%s# sp not trusted here\n",
fp_str, t1_str, sp_str, ASM_COMMENT_START);
else
- fprintf (file,"\tsub %s,%d,%s\t\t%s# sp not trusted here\n",
+ fprintf (file,"\tsub\t%s, %d, %s\t\t%s# sp not trusted here\n",
fp_str, size, sp_str, ASM_COMMENT_START);
}
@@ -6321,7 +6081,7 @@ sparc_flat_output_function_epilogue (file, size)
/* Offset to register save area from %sp. */
reg_offset = size1 - reg_offset;
- fprintf (file, "\tset %d,%s\n\tadd %s,%s,%s\n",
+ fprintf (file, "\tset\t%d, %s\n\tadd\t%s, %s, %s\n",
size1, t1_str, sp_str, t1_str, sp_str);
}
@@ -6329,13 +6089,13 @@ sparc_flat_output_function_epilogue (file, size)
because they are treated specially by the prologue output code. */
if (current_frame_info.gmask & FRAME_POINTER_MASK)
{
- fprintf (file, "\tld [%s+%d],%s\n",
+ fprintf (file, "\tld\t[%s+%d], %s\n",
sp_str, reg_offset, fp_str);
reg_offset += 4;
}
if (current_frame_info.gmask & RETURN_ADDR_MASK)
{
- fprintf (file, "\tld [%s+%d],%s\n",
+ fprintf (file, "\tld\t[%s+%d], %s\n",
sp_str, reg_offset, reg_names[RETURN_ADDR_REGNUM]);
reg_offset += 4;
}
@@ -6352,12 +6112,12 @@ sparc_flat_output_function_epilogue (file, size)
{
size -= size1;
if (size > 4095)
- fprintf (file, "\tset %d,%s\n",
+ fprintf (file, "\tset\t%d, %s\n",
size, t1_str);
}
if (current_function_returns_struct)
- fprintf (file, "\tjmp %%o7+12\n");
+ fprintf (file, "\tjmp\t%%o7+12\n");
else
fprintf (file, "\tretl\n");
@@ -6374,10 +6134,10 @@ sparc_flat_output_function_epilogue (file, size)
}
else if (size > 4095)
- fprintf (file, "\tadd %s,%s,%s\n", sp_str, t1_str, sp_str);
+ fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str);
else if (size > 0)
- fprintf (file, "\tadd %s,%d,%s\n", sp_str, size, sp_str);
+ fprintf (file, "\tadd\t%s, %d, %s\n", sp_str, size, sp_str);
else
fprintf (file, "\tnop\n");
@@ -6385,6 +6145,8 @@ sparc_flat_output_function_epilogue (file, size)
/* Reset state info for each function. */
current_frame_info = zero_frame_info;
+
+ sparc_output_deferred_case_vectors ();
}
/* Define the number of delay slots needed for the function epilogue.
@@ -6411,7 +6173,7 @@ sparc_flat_epilogue_delay_slots ()
int
sparc_flat_eligible_for_epilogue_delay (trial, slot)
rtx trial;
- int slot;
+ int slot ATTRIBUTE_UNUSED;
{
rtx pat = PATTERN (trial);
@@ -6454,8 +6216,8 @@ supersparc_adjust_cost (insn, link, dep_insn, cost)
cycles later. */
/* if a load, then the dependence must be on the memory address;
- add an extra 'cycle'. Note that the cost could be two cycles
- if the reg was written late in an instruction group; we can't tell
+ add an extra "cycle". Note that the cost could be two cycles
+ if the reg was written late in an instruction group; we ca not tell
here. */
if (insn_type == TYPE_LOAD || insn_type == TYPE_FPLOAD)
return cost + 3;
@@ -6467,7 +6229,7 @@ supersparc_adjust_cost (insn, link, dep_insn, cost)
rtx dep_pat = PATTERN (dep_insn);
if (GET_CODE (pat) != SET || GET_CODE (dep_pat) != SET)
- return cost; /* This shouldn't happen! */
+ return cost; /* This should not happen! */
/* The dependency between the two instructions was on the data that
is being stored. Assume that this implies that the address of the
@@ -6499,67 +6261,811 @@ supersparc_adjust_cost (insn, link, dep_insn, cost)
return cost;
}
+/* This describes the state of the UltraSPARC pipeline during
+ instruction scheduling. */
+
+#define TMASK(__x) ((unsigned)1 << ((int)(__x)))
+#define UMASK(__x) ((unsigned)1 << ((int)(__x)))
+
+enum ultra_code { NONE=0, /* no insn at all */
+ IEU0, /* shifts and conditional moves */
+ IEU1, /* condition code setting insns, calls+jumps */
+ IEUN, /* all other single cycle ieu insns */
+ LSU, /* loads and stores */
+ CTI, /* branches */
+ FPM, /* FPU pipeline 1, multiplies and divides */
+ FPA, /* FPU pipeline 2, all other operations */
+ SINGLE, /* single issue instructions */
+ NUM_ULTRA_CODES };
+
+static char *ultra_code_names[NUM_ULTRA_CODES] = {
+ "NONE", "IEU0", "IEU1", "IEUN", "LSU", "CTI",
+ "FPM", "FPA", "SINGLE" };
+
+struct ultrasparc_pipeline_state {
+ /* The insns in this group. */
+ rtx group[4];
+
+ /* The code for each insn. */
+ enum ultra_code codes[4];
+
+ /* Which insns in this group have been committed by the
+ scheduler. This is how we determine how many more
+ can issue this cycle. */
+ char commit[4];
+
+ /* How many insns in this group. */
+ char group_size;
+
+ /* Mask of free slots still in this group. */
+ char free_slot_mask;
+
+ /* The slotter uses the following to determine what other
+ insn types can still make their way into this group. */
+ char contents [NUM_ULTRA_CODES];
+ char num_ieu_insns;
+};
+
+#define ULTRA_NUM_HIST 8
+static struct ultrasparc_pipeline_state ultra_pipe_hist[ULTRA_NUM_HIST];
+static int ultra_cur_hist;
+static int ultra_cycles_elapsed;
+
+#define ultra_pipe (ultra_pipe_hist[ultra_cur_hist])
+
+/* Given TYPE_MASK compute the ultra_code it has. */
+static enum ultra_code
+ultra_code_from_mask (type_mask)
+ int type_mask;
+{
+ if (type_mask & (TMASK (TYPE_SHIFT) | TMASK (TYPE_CMOVE)))
+ return IEU0;
+ else if (type_mask & (TMASK (TYPE_COMPARE) |
+ TMASK (TYPE_CALL) |
+ TMASK (TYPE_UNCOND_BRANCH)))
+ return IEU1;
+ else if (type_mask & (TMASK (TYPE_IALU) | TMASK (TYPE_BINARY) |
+ TMASK (TYPE_MOVE) | TMASK (TYPE_UNARY)))
+ return IEUN;
+ else if (type_mask & (TMASK (TYPE_LOAD) | TMASK (TYPE_SLOAD) |
+ TMASK (TYPE_STORE) | TMASK (TYPE_FPLOAD) |
+ TMASK (TYPE_FPSTORE)))
+ return LSU;
+ else if (type_mask & (TMASK (TYPE_FPMUL) | TMASK (TYPE_FPDIVS) |
+ TMASK (TYPE_FPDIVD) | TMASK (TYPE_FPSQRT)))
+ return FPM;
+ else if (type_mask & (TMASK (TYPE_FPMOVE) | TMASK (TYPE_FPCMOVE) |
+ TMASK (TYPE_FP) | TMASK (TYPE_FPCMP)))
+ return FPA;
+ else if (type_mask & TMASK (TYPE_BRANCH))
+ return CTI;
+
+ return SINGLE;
+}
+
+/* Check INSN (a conditional move) and make sure that it's
+ results are available at this cycle. Return 1 if the
+ results are in fact ready. */
+static int
+ultra_cmove_results_ready_p (insn)
+ rtx insn;
+{
+ struct ultrasparc_pipeline_state *up;
+ int entry, slot;
+
+ /* If this got dispatched in the previous
+ group, the results are not ready. */
+ entry = (ultra_cur_hist - 1) % (ULTRA_NUM_HIST - 1);
+ up = &ultra_pipe_hist[entry];
+ slot = 4;
+ while (--slot >= 0)
+ if (up->group[slot] == insn)
+ return 0;
+
+ return 1;
+}
+
+/* Walk backwards in pipeline history looking for FPU
+ operations which use a mode different than FPMODE and
+ will create a stall if an insn using FPMODE were to be
+ dispatched this cycle. */
+static int
+ultra_fpmode_conflict_exists (fpmode)
+ enum machine_mode fpmode;
+{
+ int hist_ent;
+ int hist_lim;
+
+ hist_ent = (ultra_cur_hist - 1) % (ULTRA_NUM_HIST - 1);
+ if (ultra_cycles_elapsed < 4)
+ hist_lim = ultra_cycles_elapsed;
+ else
+ hist_lim = 4;
+ while (hist_lim > 0)
+ {
+ struct ultrasparc_pipeline_state *up = &ultra_pipe_hist[hist_ent];
+ int slot = 4;
+
+ while (--slot >= 0)
+ {
+ rtx insn = up->group[slot];
+ enum machine_mode this_mode;
+ rtx pat;
+
+ if (! insn
+ || GET_CODE (insn) != INSN
+ || (pat = PATTERN (insn)) == 0
+ || GET_CODE (pat) != SET)
+ continue;
+
+ this_mode = GET_MODE (SET_DEST (pat));
+ if ((this_mode != SFmode
+ && this_mode != DFmode)
+ || this_mode == fpmode)
+ continue;
+
+ /* If it is not FMOV, FABS, FNEG, FDIV, or FSQRT then
+ we will get a stall. Loads and stores are independant
+ of these rules. */
+ if (GET_CODE (SET_SRC (pat)) != ABS
+ && GET_CODE (SET_SRC (pat)) != NEG
+ && ((TMASK (get_attr_type (insn)) &
+ (TMASK (TYPE_FPDIVS) | TMASK (TYPE_FPDIVD) |
+ TMASK (TYPE_FPMOVE) | TMASK (TYPE_FPSQRT) |
+ TMASK (TYPE_LOAD) | TMASK (TYPE_STORE))) == 0))
+ return 1;
+ }
+ hist_lim--;
+ hist_ent = (hist_ent - 1) % (ULTRA_NUM_HIST - 1);
+ }
+
+ /* No conflicts, safe to dispatch. */
+ return 0;
+}
+
+/* Find an instruction in LIST which has one of the
+ type attributes enumerated in TYPE_MASK. START
+ says where to begin the search.
+
+ NOTE: This scheme depends upon the fact that we
+ have less than 32 distinct type attributes. */
+
+static int ultra_types_avail;
+
+static rtx *
+ultra_find_type (type_mask, list, start)
+ int type_mask;
+ rtx *list;
+ int start;
+{
+ int i;
+
+ /* Short circuit if no such insn exists in the ready
+ at the moment. */
+ if ((type_mask & ultra_types_avail) == 0)
+ return 0;
+
+ for (i = start; i >= 0; i--)
+ {
+ rtx insn = list[i];
+
+ if (recog_memoized (insn) >= 0
+ && (TMASK(get_attr_type (insn)) & type_mask))
+ {
+ enum machine_mode fpmode = SFmode;
+ rtx pat = 0;
+ int slot;
+ int check_depend = 0;
+ int check_fpmode_conflict = 0;
+
+ if (GET_CODE (insn) == INSN
+ && (pat = PATTERN(insn)) != 0
+ && GET_CODE (pat) == SET
+ && !(type_mask & (TMASK (TYPE_STORE) |
+ TMASK (TYPE_FPSTORE))))
+ {
+ check_depend = 1;
+ if (GET_MODE (SET_DEST (pat)) == SFmode
+ || GET_MODE (SET_DEST (pat)) == DFmode)
+ {
+ fpmode = GET_MODE (SET_DEST (pat));
+ check_fpmode_conflict = 1;
+ }
+ }
+
+ slot = 4;
+ while(--slot >= 0)
+ {
+ rtx slot_insn = ultra_pipe.group[slot];
+ rtx slot_pat;
+
+ /* Already issued, bad dependency, or FPU
+ mode conflict. */
+ if (slot_insn != 0
+ && (slot_pat = PATTERN (slot_insn)) != 0
+ && ((insn == slot_insn)
+ || (check_depend == 1
+ && GET_CODE (slot_insn) == INSN
+ && GET_CODE (slot_pat) == SET
+ && ((GET_CODE (SET_DEST (slot_pat)) == REG
+ && GET_CODE (SET_SRC (pat)) == REG
+ && REGNO (SET_DEST (slot_pat)) ==
+ REGNO (SET_SRC (pat)))
+ || (GET_CODE (SET_DEST (slot_pat)) == SUBREG
+ && GET_CODE (SET_SRC (pat)) == SUBREG
+ && REGNO (SUBREG_REG (SET_DEST (slot_pat))) ==
+ REGNO (SUBREG_REG (SET_SRC (pat)))
+ && SUBREG_WORD (SET_DEST (slot_pat)) ==
+ SUBREG_WORD (SET_SRC (pat)))))
+ || (check_fpmode_conflict == 1
+ && GET_CODE (slot_insn) == INSN
+ && GET_CODE (slot_pat) == SET
+ && (GET_MODE (SET_DEST (slot_pat)) == SFmode
+ || GET_MODE (SET_DEST (slot_pat)) == DFmode)
+ && GET_MODE (SET_DEST (slot_pat)) != fpmode)))
+ goto next;
+ }
+
+ /* Check for peculiar result availability and dispatch
+ interference situations. */
+ if (pat != 0
+ && ultra_cycles_elapsed > 0)
+ {
+ rtx link;
+
+ for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
+ {
+ rtx link_insn = XEXP (link, 0);
+ if (GET_CODE (link_insn) == INSN
+ && recog_memoized (link_insn) >= 0
+ && (TMASK (get_attr_type (link_insn)) &
+ (TMASK (TYPE_CMOVE) | TMASK (TYPE_FPCMOVE)))
+ && ! ultra_cmove_results_ready_p (link_insn))
+ goto next;
+ }
+
+ if (check_fpmode_conflict
+ && ultra_fpmode_conflict_exists (fpmode))
+ goto next;
+ }
+
+ return &list[i];
+ }
+ next:
+ ;
+ }
+ return 0;
+}
+
+static void
+ultra_build_types_avail (ready, n_ready)
+ rtx *ready;
+ int n_ready;
+{
+ int i = n_ready - 1;
+
+ ultra_types_avail = 0;
+ while(i >= 0)
+ {
+ rtx insn = ready[i];
+
+ if (recog_memoized (insn) >= 0)
+ ultra_types_avail |= TMASK (get_attr_type (insn));
+
+ i -= 1;
+ }
+}
+
+/* Place insn pointed to my IP into the pipeline.
+ Make element THIS of READY be that insn if it
+ is not already. TYPE indicates the pipeline class
+ this insn falls into. */
+static void
+ultra_schedule_insn (ip, ready, this, type)
+ rtx *ip;
+ rtx *ready;
+ int this;
+ enum ultra_code type;
+{
+ int pipe_slot;
+ char mask = ultra_pipe.free_slot_mask;
+
+ /* Obtain free slot. */
+ for (pipe_slot = 0; pipe_slot < 4; pipe_slot++)
+ if ((mask & (1 << pipe_slot)) != 0)
+ break;
+ if (pipe_slot == 4)
+ abort ();
+
+ /* In it goes, and it hasn't been committed yet. */
+ ultra_pipe.group[pipe_slot] = *ip;
+ ultra_pipe.codes[pipe_slot] = type;
+ ultra_pipe.contents[type] = 1;
+ if (UMASK (type) &
+ (UMASK (IEUN) | UMASK (IEU0) | UMASK (IEU1)))
+ ultra_pipe.num_ieu_insns += 1;
+
+ ultra_pipe.free_slot_mask = (mask & ~(1 << pipe_slot));
+ ultra_pipe.group_size += 1;
+ ultra_pipe.commit[pipe_slot] = 0;
+
+ /* Update ready list. */
+ if (ip != &ready[this])
+ {
+ rtx temp = *ip;
+
+ *ip = ready[this];
+ ready[this] = temp;
+ }
+}
+
+/* Advance to the next pipeline group. */
+static void
+ultra_flush_pipeline ()
+{
+ ultra_cur_hist = (ultra_cur_hist + 1) % (ULTRA_NUM_HIST - 1);
+ ultra_cycles_elapsed += 1;
+ bzero ((char *) &ultra_pipe, sizeof ultra_pipe);
+ ultra_pipe.free_slot_mask = 0xf;
+}
+
+static int ultra_reorder_called_this_block;
+
+/* Init our data structures for this current block. */
+void
+ultrasparc_sched_init (dump, sched_verbose)
+ FILE *dump ATTRIBUTE_UNUSED;
+ int sched_verbose ATTRIBUTE_UNUSED;
+{
+ bzero ((char *) ultra_pipe_hist, sizeof ultra_pipe_hist);
+ ultra_cur_hist = 0;
+ ultra_cycles_elapsed = 0;
+ ultra_reorder_called_this_block = 0;
+ ultra_pipe.free_slot_mask = 0xf;
+}
+
+/* INSN has been scheduled, update pipeline commit state
+ and return how many instructions are still to be
+ scheduled in this group. */
+int
+ultrasparc_variable_issue (insn)
+ rtx insn;
+{
+ struct ultrasparc_pipeline_state *up = &ultra_pipe;
+ int i, left_to_fire;
+
+ left_to_fire = 0;
+ for (i = 0; i < 4; i++)
+ {
+ if (up->group[i] == 0)
+ continue;
+
+ if (up->group[i] == insn)
+ {
+ up->commit[i] = 1;
+ }
+ else if (! up->commit[i])
+ left_to_fire++;
+ }
+
+ return left_to_fire;
+}
+
+/* In actual_hazard_this_instance, we may have yanked some
+ instructions from the ready list due to conflict cost
+ adjustments. If so, and such an insn was in our pipeline
+ group, remove it and update state. */
+static void
+ultra_rescan_pipeline_state (ready, n_ready)
+ rtx *ready;
+ int n_ready;
+{
+ struct ultrasparc_pipeline_state *up = &ultra_pipe;
+ int i;
+
+ for (i = 0; i < 4; i++)
+ {
+ rtx insn = up->group[i];
+ int j;
+
+ if (! insn)
+ continue;
+
+ /* If it has been committed, then it was removed from
+ the ready list because it was actually scheduled,
+ and that is not the case we are searching for here. */
+ if (up->commit[i] != 0)
+ continue;
+
+ for (j = n_ready - 1; j >= 0; j--)
+ if (ready[j] == insn)
+ break;
+
+ /* If we didn't find it, toss it. */
+ if (j < 0)
+ {
+ enum ultra_code ucode = up->codes[i];
+
+ up->group[i] = 0;
+ up->codes[i] = NONE;
+ up->contents[ucode] = 0;
+ if (UMASK (ucode) &
+ (UMASK (IEUN) | UMASK (IEU0) | UMASK (IEU1)))
+ up->num_ieu_insns -= 1;
+
+ up->free_slot_mask |= (1 << i);
+ up->group_size -= 1;
+ up->commit[i] = 0;
+ }
+ }
+}
+
+void
+ultrasparc_sched_reorder (dump, sched_verbose, ready, n_ready)
+ FILE *dump;
+ int sched_verbose;
+ rtx *ready;
+ int n_ready;
+{
+ struct ultrasparc_pipeline_state *up = &ultra_pipe;
+ int i, this_insn;
+
+ /* We get called once unnecessarily per block of insns
+ scheduled. */
+ if (ultra_reorder_called_this_block == 0)
+ {
+ ultra_reorder_called_this_block = 1;
+ return;
+ }
+
+ if (sched_verbose)
+ {
+ int n;
+
+ fprintf (dump, "\n;;\tUltraSPARC Looking at [");
+ for (n = n_ready - 1; n >= 0; n--)
+ {
+ rtx insn = ready[n];
+ enum ultra_code ucode;
+
+ if (recog_memoized (insn) < 0)
+ continue;
+ ucode = ultra_code_from_mask (TMASK (get_attr_type (insn)));
+ if (n != 0)
+ fprintf (dump, "%s(%d) ",
+ ultra_code_names[ucode],
+ INSN_UID (insn));
+ else
+ fprintf (dump, "%s(%d)",
+ ultra_code_names[ucode],
+ INSN_UID (insn));
+ }
+ fprintf (dump, "]\n");
+ }
+
+ this_insn = n_ready - 1;
+
+ /* Skip over junk we don't understand. */
+ while ((this_insn >= 0)
+ && recog_memoized (ready[this_insn]) < 0)
+ this_insn--;
+
+ ultra_build_types_avail (ready, this_insn + 1);
+
+ while (this_insn >= 0) {
+ int old_group_size = up->group_size;
+
+ if (up->group_size != 0)
+ {
+ int num_committed;
+
+ num_committed = (up->commit[0] + up->commit[1] +
+ up->commit[2] + up->commit[3]);
+ /* If nothing has been commited from our group, or all of
+ them have. Clear out the (current cycle's) pipeline
+ state and start afresh. */
+ if (num_committed == 0
+ || num_committed == up->group_size)
+ {
+ ultra_flush_pipeline ();
+ up = &ultra_pipe;
+ old_group_size = 0;
+ }
+ else
+ {
+ /* OK, some ready list insns got requeued and thus removed
+ from the ready list. Account for this fact. */
+ ultra_rescan_pipeline_state (ready, n_ready);
+
+ /* Something "changed", make this look like a newly
+ formed group so the code at the end of the loop
+ knows that progress was in fact made. */
+ if (up->group_size != old_group_size)
+ old_group_size = 0;
+ }
+ }
+
+ if (up->group_size == 0)
+ {
+ /* If the pipeline is (still) empty and we have any single
+ group insns, get them out now as this is a good time. */
+ rtx *ip = ultra_find_type ((TMASK (TYPE_RETURN) | TMASK (TYPE_ADDRESS) |
+ TMASK (TYPE_IMUL) | TMASK (TYPE_CMOVE) |
+ TMASK (TYPE_MULTI) | TMASK (TYPE_MISC)),
+ ready, this_insn);
+ if (ip)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, SINGLE);
+ break;
+ }
+
+ /* If we are not in the process of emptying out the pipe, try to
+ obtain an instruction which must be the first in it's group. */
+ ip = ultra_find_type ((TMASK (TYPE_CALL) |
+ TMASK (TYPE_CALL_NO_DELAY_SLOT) |
+ TMASK (TYPE_UNCOND_BRANCH)),
+ ready, this_insn);
+ if (ip)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, IEU1);
+ this_insn--;
+ }
+ else if ((ip = ultra_find_type ((TMASK (TYPE_FPDIVS) |
+ TMASK (TYPE_FPDIVD) |
+ TMASK (TYPE_FPSQRT)),
+ ready, this_insn)) != 0)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, FPM);
+ this_insn--;
+ }
+ }
+
+ /* Try to fill the integer pipeline. First, look for an IEU0 specific
+ operation. We can't do more IEU operations if the first 3 slots are
+ all full or we have dispatched two IEU insns already. */
+ if ((up->free_slot_mask & 0x7) != 0
+ && up->num_ieu_insns < 2
+ && up->contents[IEU0] == 0
+ && up->contents[IEUN] == 0)
+ {
+ rtx *ip = ultra_find_type (TMASK(TYPE_SHIFT), ready, this_insn);
+ if (ip)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, IEU0);
+ this_insn--;
+ }
+ }
+
+ /* If we can, try to find an IEU1 specific or an unnamed
+ IEU instruction. */
+ if ((up->free_slot_mask & 0x7) != 0
+ && up->num_ieu_insns < 2)
+ {
+ rtx *ip = ultra_find_type ((TMASK (TYPE_IALU) | TMASK (TYPE_BINARY) |
+ TMASK (TYPE_MOVE) | TMASK (TYPE_UNARY) |
+ (up->contents[IEU1] == 0 ? TMASK (TYPE_COMPARE) : 0)),
+ ready, this_insn);
+ if (ip)
+ {
+ rtx insn = *ip;
+
+ ultra_schedule_insn (ip, ready, this_insn,
+ (!up->contents[IEU1]
+ && get_attr_type (insn) == TYPE_COMPARE)
+ ? IEU1 : IEUN);
+ this_insn--;
+ }
+ }
+
+ /* If only one IEU insn has been found, try to find another unnamed
+ IEU operation or an IEU1 specific one. */
+ if ((up->free_slot_mask & 0x7) != 0
+ && up->num_ieu_insns < 2)
+ {
+ rtx *ip;
+ int tmask = (TMASK (TYPE_IALU) | TMASK (TYPE_BINARY) |
+ TMASK (TYPE_MOVE) | TMASK (TYPE_UNARY));
+
+ if (!up->contents[IEU1])
+ tmask |= TMASK (TYPE_COMPARE);
+ ip = ultra_find_type (tmask, ready, this_insn);
+ if (ip)
+ {
+ rtx insn = *ip;
+
+ ultra_schedule_insn (ip, ready, this_insn,
+ (!up->contents[IEU1]
+ && get_attr_type (insn) == TYPE_COMPARE)
+ ? IEU1 : IEUN);
+ this_insn--;
+ }
+ }
+
+ /* Try for a load or store, but such an insn can only be issued
+ if it is within' one of the first 3 slots. */
+ if ((up->free_slot_mask & 0x7) != 0
+ && up->contents[LSU] == 0)
+ {
+ rtx *ip = ultra_find_type ((TMASK (TYPE_LOAD) | TMASK (TYPE_SLOAD) |
+ TMASK (TYPE_STORE) | TMASK (TYPE_FPLOAD) |
+ TMASK (TYPE_FPSTORE)), ready, this_insn);
+ if (ip)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, LSU);
+ this_insn--;
+ }
+ }
+
+ /* Now find FPU operations, first FPM class. But not divisions or
+ square-roots because those will break the group up. Unlike all
+ the previous types, these can go in any slot. */
+ if (up->free_slot_mask != 0
+ && up->contents[FPM] == 0)
+ {
+ rtx *ip = ultra_find_type (TMASK (TYPE_FPMUL), ready, this_insn);
+ if (ip)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, FPM);
+ this_insn--;
+ }
+ }
+
+ /* Continue on with FPA class if we have not filled the group already. */
+ if (up->free_slot_mask != 0
+ && up->contents[FPA] == 0)
+ {
+ rtx *ip = ultra_find_type ((TMASK (TYPE_FPMOVE) | TMASK (TYPE_FPCMOVE) |
+ TMASK (TYPE_FP) | TMASK (TYPE_FPCMP)),
+ ready, this_insn);
+ if (ip)
+ {
+ ultra_schedule_insn (ip, ready, this_insn, FPA);
+ this_insn--;
+ }
+ }
+
+ /* Finally, maybe stick a branch in here. */
+ if (up->free_slot_mask != 0
+ && up->contents[CTI] == 0)
+ {
+ rtx *ip = ultra_find_type (TMASK (TYPE_BRANCH), ready, this_insn);
+
+ /* Try to slip in a branch only if it is one of the
+ next 2 in the ready list. */
+ if (ip && ((&ready[this_insn] - ip) < 2))
+ {
+ ultra_schedule_insn (ip, ready, this_insn, CTI);
+ this_insn--;
+ }
+ }
+
+ up->group_size = 0;
+ for (i = 0; i < 4; i++)
+ if ((up->free_slot_mask & (1 << i)) == 0)
+ up->group_size++;
+
+ /* See if we made any progress... */
+ if (old_group_size != up->group_size)
+ break;
+
+ /* Clean out the (current cycle's) pipeline state
+ and try once more. If we placed no instructions
+ into the pipeline at all, it means a real hard
+ conflict exists with some earlier issued instruction
+ so we must advance to the next cycle to clear it up. */
+ if (up->group_size == 0)
+ {
+ ultra_flush_pipeline ();
+ up = &ultra_pipe;
+ }
+ else
+ {
+ bzero ((char *) &ultra_pipe, sizeof ultra_pipe);
+ ultra_pipe.free_slot_mask = 0xf;
+ }
+ }
+
+ if (sched_verbose)
+ {
+ int n, gsize;
+
+ fprintf (dump, ";;\tUltraSPARC Launched [");
+ gsize = up->group_size;
+ for (n = 0; n < 4; n++)
+ {
+ rtx insn = up->group[n];
+
+ if (! insn)
+ continue;
+
+ gsize -= 1;
+ if (gsize != 0)
+ fprintf (dump, "%s(%d) ",
+ ultra_code_names[up->codes[n]],
+ INSN_UID (insn));
+ else
+ fprintf (dump, "%s(%d)",
+ ultra_code_names[up->codes[n]],
+ INSN_UID (insn));
+ }
+ fprintf (dump, "]\n");
+ }
+}
+
int
ultrasparc_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn;
- int cost;
+ rtx insn;
+ rtx link;
+ rtx dep_insn;
+ int cost;
{
enum attr_type insn_type, dep_type;
- rtx pat = PATTERN(insn);
- rtx dep_pat = PATTERN (dep_insn);
+ rtx pat = PATTERN(insn);
+ rtx dep_pat = PATTERN (dep_insn);
- if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
- return cost;
+ if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
+ return cost;
+
+ insn_type = get_attr_type (insn);
+ dep_type = get_attr_type (dep_insn);
- insn_type = get_attr_type (insn);
- dep_type = get_attr_type (dep_insn);
+ /* Nothing issues in parallel with integer multiplies, so
+ mark as zero cost since the scheduler can not do anything
+ about it. */
+ if (insn_type == TYPE_IMUL)
+ return 0;
#define SLOW_FP(dep_type) \
(dep_type == TYPE_FPSQRT || dep_type == TYPE_FPDIVS || dep_type == TYPE_FPDIVD)
switch (REG_NOTE_KIND (link))
- {
- case 0:
+ {
+ case 0:
/* Data dependency; DEP_INSN writes a register that INSN reads some
- cycles later. */
+ cycles later. */
+
+ if (dep_type == TYPE_CMOVE)
+ {
+ /* Instructions that read the result of conditional moves cannot
+ be in the same group or the following group. */
+ return cost + 1;
+ }
switch (insn_type)
- {
- /* UltraSPARC can dual issue a store and an instruction setting
- the value stored, except for divide and square root. */
+ {
+ /* UltraSPARC can dual issue a store and an instruction setting
+ the value stored, except for divide and square root. */
case TYPE_FPSTORE:
- if (! SLOW_FP (dep_type))
- return 0;
+ if (! SLOW_FP (dep_type))
+ return 0;
return cost;
- case TYPE_STORE:
+ case TYPE_STORE:
if (GET_CODE (pat) != SET || GET_CODE (dep_pat) != SET)
- return cost;
+ return cost;
if (rtx_equal_p (SET_DEST (dep_pat), SET_SRC (pat)))
- /* The dependency between the two instructions is on the data
- that is being stored. Assume that the address of the store
- is not also dependent. */
- return 0;
- return cost;
-
- case TYPE_LOAD:
- case TYPE_SLOAD:
- case TYPE_FPLOAD:
- /* A load does not return data until at least 11 cycles after
+ /* The dependency between the two instructions is on the data
+ that is being stored. Assume that the address of the store
+ is not also dependent. */
+ return 0;
+ return cost;
+
+ case TYPE_LOAD:
+ case TYPE_SLOAD:
+ case TYPE_FPLOAD:
+ /* A load does not return data until at least 11 cycles after
a store to the same location. 3 cycles are accounted for
in the load latency; add the other 8 here. */
if (dep_type == TYPE_STORE || dep_type == TYPE_FPSTORE)
- {
+ {
/* If the addresses are not equal this may be a false
dependency because pointer aliasing could not be
determined. Add only 2 cycles in that case. 2 is
an arbitrary compromise between 8, which would cause
the scheduler to generate worse code elsewhere to
- compensate for a dependency which might not really
- exist, and 0. */
+ compensate for a dependency which might not really
+ exist, and 0. */
if (GET_CODE (pat) != SET || GET_CODE (dep_pat) != SET
|| GET_CODE (SET_SRC (pat)) != MEM
|| GET_CODE (SET_DEST (dep_pat)) != MEM
@@ -6567,72 +7073,73 @@ ultrasparc_adjust_cost (insn, link, dep_insn, cost)
XEXP (SET_DEST (dep_pat), 0)))
return cost + 2;
- return cost + 8;
- }
+ return cost + 8;
+ }
return cost;
- case TYPE_BRANCH:
+ case TYPE_BRANCH:
/* Compare to branch latency is 0. There is no benefit from
separating compare and branch. */
- if (dep_type == TYPE_COMPARE)
- return 0;
- /* Floating point compare to branch latency is less than
- compare to conditional move. */
- if (dep_type == TYPE_FPCMP)
- return cost - 1;
+ if (dep_type == TYPE_COMPARE)
+ return 0;
+ /* Floating point compare to branch latency is less than
+ compare to conditional move. */
+ if (dep_type == TYPE_FPCMP)
+ return cost - 1;
return cost;
- case TYPE_FPCMOVE:
+ case TYPE_FPCMOVE:
/* FMOVR class instructions can not issue in the same cycle
or the cycle after an instruction which writes any
integer register. Model this as cost 2 for dependent
- instructions. */
+ instructions. */
if ((dep_type == TYPE_IALU || dep_type == TYPE_UNARY
|| dep_type == TYPE_BINARY)
- && cost < 2)
+ && cost < 2)
return 2;
/* Otherwise check as for integer conditional moves. */
- case TYPE_CMOVE:
+ case TYPE_CMOVE:
/* Conditional moves involving integer registers wait until
3 cycles after loads return data. The interlock applies
to all loads, not just dependent loads, but that is hard
- to model. */
- if (dep_type == TYPE_LOAD || dep_type == TYPE_SLOAD)
- return cost + 3;
+ to model. */
+ if (dep_type == TYPE_LOAD || dep_type == TYPE_SLOAD)
+ return cost + 3;
return cost;
default:
break;
}
- break;
+ break;
- case REG_DEP_ANTI:
+ case REG_DEP_ANTI:
/* Divide and square root lock destination registers for full latency. */
- if (! SLOW_FP (dep_type))
- return 0;
- break;
+ if (! SLOW_FP (dep_type))
+ return 0;
+ break;
+
+ case REG_DEP_OUTPUT:
+ /* IEU and FPU instruction that have the same destination
+ register cannot be grouped together. */
+ return cost + 1;
default:
break;
}
- /* Other costs not accounted for:
- - Multiply should be modeled as having no latency because there is
- nothing the scheduler can do about it.
- - Single precision floating point loads lock the other half of
- the even/odd register pair.
+ /* Other costs not accounted for:
+ - Single precision floating point loads lock the other half of
+ the even/odd register pair.
- Several hazards associated with ldd/std are ignored because these
- instructions are rarely generated for V9.
- - A shift following an integer instruction which does not set the
- condition codes can not issue in the same cycle.
+ instructions are rarely generated for V9.
- The floating point pipeline can not have both a single and double
precision operation active at the same time. Format conversions
and graphics instructions are given honorary double precision status.
- call and jmpl are always the first instruction in a group. */
- return cost;
-}
+ return cost;
+}
int
sparc_issue_rate ()
@@ -6667,8 +7174,6 @@ set_extends(x, insn)
/* LO_SUM is used with sethi. sethi cleared the high
bits and the values used with lo_sum are positive */
case LO_SUM:
- /* UNSPEC is v8plus_clear_high */
- case UNSPEC:
/* Store flag stores 0 or 1 */
case LT: case LTU:
case GT: case GTU:
@@ -6705,6 +7210,110 @@ set_extends(x, insn)
}
}
+/* We _ought_ to have only one kind per function, but... */
+static rtx sparc_addr_diff_list;
+static rtx sparc_addr_list;
+
+void
+sparc_defer_case_vector (lab, vec, diff)
+ rtx lab, vec;
+ int diff;
+{
+ vec = gen_rtx_EXPR_LIST (VOIDmode, lab, vec);
+ if (diff)
+ sparc_addr_diff_list
+ = gen_rtx_EXPR_LIST (VOIDmode, vec, sparc_addr_diff_list);
+ else
+ sparc_addr_list = gen_rtx_EXPR_LIST (VOIDmode, vec, sparc_addr_list);
+}
+
+static void
+sparc_output_addr_vec (vec)
+ rtx vec;
+{
+ rtx lab = XEXP (vec, 0), body = XEXP (vec, 1);
+ int idx, vlen = XVECLEN (body, 0);
+
+#ifdef ASM_OUTPUT_ADDR_VEC_START
+ ASM_OUTPUT_ADDR_VEC_START (asm_out_file);
+#endif
+
+#ifdef ASM_OUTPUT_CASE_LABEL
+ 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));
+#endif
+
+ for (idx = 0; idx < vlen; idx++)
+ {
+ ASM_OUTPUT_ADDR_VEC_ELT
+ (asm_out_file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0)));
+ }
+
+#ifdef ASM_OUTPUT_ADDR_VEC_END
+ ASM_OUTPUT_ADDR_VEC_END (asm_out_file);
+#endif
+}
+
+static void
+sparc_output_addr_diff_vec (vec)
+ rtx vec;
+{
+ rtx lab = XEXP (vec, 0), body = XEXP (vec, 1);
+ rtx base = XEXP (XEXP (body, 0), 0);
+ int idx, vlen = XVECLEN (body, 1);
+
+#ifdef ASM_OUTPUT_ADDR_VEC_START
+ ASM_OUTPUT_ADDR_VEC_START (asm_out_file);
+#endif
+
+#ifdef ASM_OUTPUT_CASE_LABEL
+ 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));
+#endif
+
+ for (idx = 0; idx < vlen; idx++)
+ {
+ ASM_OUTPUT_ADDR_DIFF_ELT
+ (asm_out_file,
+ body,
+ CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)),
+ CODE_LABEL_NUMBER (base));
+ }
+
+#ifdef ASM_OUTPUT_ADDR_VEC_END
+ ASM_OUTPUT_ADDR_VEC_END (asm_out_file);
+#endif
+}
+
+static void
+sparc_output_deferred_case_vectors ()
+{
+ rtx t;
+ int align;
+
+ if (sparc_addr_list == NULL_RTX
+ && sparc_addr_diff_list == NULL_RTX)
+ return;
+
+ /* Align to cache line in the function's code section. */
+ function_section (current_function_decl);
+
+ align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
+ if (align > 0)
+ ASM_OUTPUT_ALIGN (asm_out_file, align);
+
+ for (t = sparc_addr_list; t ; t = XEXP (t, 1))
+ sparc_output_addr_vec (XEXP (t, 0));
+ for (t = sparc_addr_diff_list; t ; t = XEXP (t, 1))
+ sparc_output_addr_diff_vec (XEXP (t, 0));
+
+ sparc_addr_list = sparc_addr_diff_list = NULL_RTX;
+}
+
/* Return 0 if the high 32 bits of X (the low word of X, if DImode) are
unknown. Return 1 if the high bits are zero, -1 if the register is
sign extended. */
@@ -6724,12 +7333,14 @@ sparc_check_64 (x, insn)
set_once = 1;
if (insn == 0)
- if (set_once)
- insn = get_last_insn_anywhere ();
- else
- return 0;
+ {
+ if (set_once)
+ insn = get_last_insn_anywhere ();
+ else
+ return 0;
+ }
- while (insn = PREV_INSN (insn))
+ while ((insn = PREV_INSN (insn)))
{
switch (GET_CODE (insn))
{
@@ -6767,10 +7378,17 @@ sparc_v8plus_shift (operands, insn, opcode)
if (GET_CODE (operands[3]) == SCRATCH)
operands[3] = operands[0];
- output_asm_insn ("sllx %H1,32,%3", operands);
- if (sparc_check_64 (operands[1], insn) <= 0)
- output_asm_insn ("srl %L1,0,%L1", operands);
- output_asm_insn ("or %L1,%3,%3", operands);
+ if (GET_CODE (operands[1]) == CONST_INT)
+ {
+ output_asm_insn ("mov %1,%3", operands);
+ }
+ else
+ {
+ output_asm_insn ("sllx %H1,32,%3", operands);
+ if (sparc_check_64 (operands[1], insn) <= 0)
+ output_asm_insn ("srl %L1,0,%L1", operands);
+ output_asm_insn ("or %L1,%3,%3", operands);
+ }
strcpy(asm_code, opcode);
if (which_alternative != 2)
@@ -6795,30 +7413,3 @@ sparc_return_peephole_ok (dest, src)
return 0;
return IN_OR_GLOBAL_P (dest);
}
-
-int
-delay_operand (op, mode)
- rtx op;
- enum machine_mode mode;
-{
- switch (GET_CODE (op))
- {
- case CONST:
- case CONST_INT:
- case SYMBOL_REF:
- case LABEL_REF:
- return 1;
-
- case MEM:
- return delay_operand (XEXP (op, 0), Pmode);
-
- case REG:
- return IN_OR_GLOBAL_P (op);
-
- case PLUS:
- return delay_operand (XEXP (op, 0), Pmode) && delay_operand (XEXP (op, 1), Pmode);
-
- default:
- return 0;
- }
-}
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index c64240f8188..177c3327adb 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -34,10 +34,18 @@ Boston, MA 02111-1307, USA. */
architectures to compile for. We allow targets to choose compile time or
runtime selection. */
#ifdef SPARC_BI_ARCH
+#ifdef IN_LIBGCC2
+#if defined(__sparcv9) || defined(__sparcv_v9) || defined(__arch64__)
+#define TARGET_ARCH32 0
+#else
+#define TARGET_ARCH32 1
+#endif /* V9 sparc */
+#else
#define TARGET_ARCH32 (! TARGET_64BIT)
+#endif /* IN_LIBGCC2 */
#else
#define TARGET_ARCH32 (DEFAULT_ARCH32_P)
-#endif
+#endif /* SPARC_BI_ARCH */
#define TARGET_ARCH64 (! TARGET_ARCH32)
/* Code model selection.
@@ -55,7 +63,8 @@ Boston, MA 02111-1307, USA. */
TARGET_CM_MEDMID: 64 bit address space.
The executable must be in the low 16 TB of memory.
This corresponds to the low 44 bits, and the %[hml]44
- relocs are used.
+ relocs are used. The text segment has a maximum size
+ of 31 bits.
TARGET_CM_MEDANY: 64 bit address space.
The text and data segments have a maximum size of 31
@@ -104,37 +113,78 @@ extern enum cmodel sparc_cmodel;
#define TARGET_CPU_v8 3 /* generic v8 implementation */
#define TARGET_CPU_supersparc 4
#define TARGET_CPU_v9 5 /* generic v9 implementation */
+#define TARGET_CPU_sparcv9 5 /* alias */
#define TARGET_CPU_sparc64 5 /* alias */
#define TARGET_CPU_ultrasparc 6
-#if TARGET_CPU_DEFAULT == TARGET_CPU_sparc || TARGET_CPU_DEFAULT == TARGET_CPU_v8 || TARGET_CPU_DEFAULT == TARGET_CPU_supersparc
-#define CPP_CPU_DEFAULT_SPEC ""
-#define ASM_CPU_DEFAULT_SPEC ""
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclet
-#define CPP_CPU_DEFAULT_SPEC "-D__sparclet__"
-#define ASM_CPU_DEFAULT_SPEC "-Asparclet"
-#endif
-#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclite
-#define CPP_CPU_DEFAULT_SPEC "-D__sparclite__"
-#define ASM_CPU_DEFAULT_SPEC "-Asparclite"
-#endif
+#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
+
+#define CPP_CPU32_DEFAULT_SPEC ""
+#define ASM_CPU32_DEFAULT_SPEC ""
+
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
/* ??? What does Sun's CC pass? */
-#define CPP_CPU_DEFAULT_SPEC "-D__sparc_v9__"
+#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
/* ??? It's not clear how other assemblers will handle this, so by default
use GAS. Sun's Solaris assembler recognizes -xarch=v8plus, but this case
is handled in sol2.h. */
-#define ASM_CPU_DEFAULT_SPEC "-Av9"
+#define ASM_CPU64_DEFAULT_SPEC "-Av9"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
-#define CPP_CPU_DEFAULT_SPEC "-D__sparc_v9__"
-#define ASM_CPU_DEFAULT_SPEC "-Av9a"
+#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
+#define ASM_CPU64_DEFAULT_SPEC "-Av9a"
+#endif
+
+#else
+
+#define CPP_CPU64_DEFAULT_SPEC ""
+#define ASM_CPU64_DEFAULT_SPEC ""
+
+#if TARGET_CPU_DEFAULT == TARGET_CPU_sparc || TARGET_CPU_DEFAULT == TARGET_CPU_v8 || TARGET_CPU_DEFAULT == TARGET_CPU_supersparc
+#define CPP_CPU32_DEFAULT_SPEC ""
+#define ASM_CPU32_DEFAULT_SPEC ""
+#endif
+#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclet
+#define CPP_CPU32_DEFAULT_SPEC "-D__sparclet__"
+#define ASM_CPU32_DEFAULT_SPEC "-Asparclet"
+#endif
+#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclite
+#define CPP_CPU32_DEFAULT_SPEC "-D__sparclite__"
+#define ASM_CPU32_DEFAULT_SPEC "-Asparclite"
+#endif
+
#endif
-#ifndef CPP_CPU_DEFAULT_SPEC
+
+#if !defined(CPP_CPU32_DEFAULT_SPEC) || !defined(CPP_CPU64_DEFAULT_SPEC)
Unrecognized value in TARGET_CPU_DEFAULT.
#endif
+#ifdef SPARC_BI_ARCH
+
+#define CPP_CPU_DEFAULT_SPEC \
+(DEFAULT_ARCH32_P ? "\
+%{m64:" CPP_CPU64_DEFAULT_SPEC "} \
+%{!m64:" CPP_CPU32_DEFAULT_SPEC "} \
+" : "\
+%{m32:" CPP_CPU32_DEFAULT_SPEC "} \
+%{!m32:" CPP_CPU64_DEFAULT_SPEC "} \
+")
+#define ASM_CPU_DEFAULT_SPEC \
+(DEFAULT_ARCH32_P ? "\
+%{m64:" ASM_CPU64_DEFAULT_SPEC "} \
+%{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
+" : "\
+%{m32:" ASM_CPU32_DEFAULT_SPEC "} \
+%{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
+")
+
+#else /* !SPARC_BI_ARCH */
+
+#define CPP_CPU_DEFAULT_SPEC (DEFAULT_ARCH32_P ? CPP_CPU32_DEFAULT_SPEC : CPP_CPU64_DEFAULT_SPEC)
+#define ASM_CPU_DEFAULT_SPEC (DEFAULT_ARCH32_P ? ASM_CPU32_DEFAULT_SPEC : ASM_CPU64_DEFAULT_SPEC)
+
+#endif /* !SPARC_BI_ARCH */
+
/* Names to predefine in the preprocessor for this target machine.
??? It would be nice to not include any subtarget specific values here,
however there's no way to portably provide subtarget values to
@@ -169,8 +219,20 @@ Unrecognized value in TARGET_CPU_DEFAULT.
sparc64 in 32 bit environments, so for now we only use `sparc64' in
64 bit environments. */
+#ifdef SPARC_BI_ARCH
+
+#define CPP_ARCH32_SPEC "-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)"
+#define CPP_ARCH64_SPEC "-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
+-D__arch64__ -Acpu(sparc64) -Amachine(sparc64)"
+
+#else
+
#define CPP_ARCH32_SPEC "-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)"
#define CPP_ARCH64_SPEC "-D__arch64__ -Acpu(sparc64) -Amachine(sparc64)"
+
+#endif
+
#define CPP_ARCH_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? CPP_ARCH32_SPEC : CPP_ARCH64_SPEC)
@@ -411,8 +473,7 @@ extern int target_flags;
/* 0x2000, 0x4000 are unused */
/* Nonzero if pointers are 64 bits.
- This is not a user selectable option, though it may be one day -
- so it is used to determine pointer size instead of an architecture flag. */
+ At the moment it must follow architecture size flag. */
#define MASK_PTR64 0x8000
#define TARGET_PTR64 (target_flags & MASK_PTR64)
@@ -501,6 +562,7 @@ extern int target_flags;
{"v8plus", MASK_V8PLUS}, \
{"no-v8plus", -MASK_V8PLUS}, \
{"vis", MASK_VIS}, \
+ {"no-vis", -MASK_VIS}, \
/* ??? These are deprecated, coerced to -mcpu=. Delete in 2.9. */ \
{"cypress", 0}, \
{"sparclite", 0}, \
@@ -509,9 +571,8 @@ extern int target_flags;
{"v8", 0}, \
{"supersparc", 0}, \
/* End of deprecated options. */ \
- /* -mptrNN exists for *experimental* purposes. */ \
-/* {"ptr64", MASK_PTR64}, */ \
-/* {"ptr32", -MASK_PTR64}, */ \
+ {"ptr64", MASK_PTR64}, \
+ {"ptr32", -MASK_PTR64}, \
{"32", -MASK_64BIT}, \
{"64", MASK_64BIT}, \
{"stack-bias", MASK_STACK_BIAS}, \
@@ -833,7 +894,7 @@ if (TARGET_ARCH64 \
/* Argument passing regs. */
#define SPARC_OUTGOING_INT_ARG_FIRST 8
-#define SPARC_INCOMING_INT_ARG_FIRST 24
+#define SPARC_INCOMING_INT_ARG_FIRST (TARGET_FLAT ? 8 : 24)
#define SPARC_FP_ARG_FIRST 32
/* 1 for registers that have pervasive standard uses
@@ -916,10 +977,8 @@ do \
{ \
fixed_regs[5] = 1; \
} \
- else \
- { \
- fixed_regs[1] = 1; \
- } \
+ if (TARGET_LIVE_G0) \
+ fixed_regs[0] = 0; \
if (! TARGET_V9) \
{ \
int regno; \
@@ -982,9 +1041,18 @@ while (0)
/* A subreg in 64 bit mode will have the wrong offset for a floating point
register. The least significant part is at offset 1, compared to 0 for
- integer registers. */
+ integer registers. This only applies when FMODE is a larger mode.
+ We also need to handle a special case of TF-->DF conversions. */
#define ALTER_HARD_SUBREG(TMODE, WORD, FMODE, REGNO) \
- (TARGET_ARCH64 && (REGNO) >= 32 && (REGNO) < 96 && (TMODE) == SImode ? 1 : ((REGNO) + (WORD)))
+ (TARGET_ARCH64 \
+ && (REGNO) >= SPARC_FIRST_FP_REG \
+ && (REGNO) <= SPARC_LAST_V9_FP_REG \
+ && (TMODE) == SImode \
+ && !((FMODE) == QImode || (FMODE) == HImode) \
+ ? ((REGNO) + 1) \
+ : ((TMODE) == DFmode && (FMODE) == TFmode) \
+ ? ((REGNO) + ((WORD) * 2)) \
+ : ((REGNO) + (WORD)))
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
See sparc.c for how we initialize this. */
@@ -1075,7 +1143,6 @@ extern int sparc_mode_class[];
#define PIC_OFFSET_TABLE_REGNUM 23
-#define INITIALIZE_PIC initialize_pic ()
#define FINALIZE_PIC finalize_pic ()
/* Pick a default value we can notice from override_options:
@@ -1356,24 +1423,39 @@ extern char leaf_reg_remap[];
/* Return the register class of a scratch register needed to load IN into
a register of class CLASS in MODE.
- On the SPARC, when PIC, we need a temporary when loading some addresses
- into a register.
-
- Also, we need a temporary when loading/storing a HImode/QImode value
+ We need a temporary when loading/storing a HImode/QImode value
between memory and the FPU registers. This can happen when combine puts
a paradoxical subreg in a float/fix conversion insn. */
#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, IN) \
- ((FP_REG_CLASS_P (CLASS) && ((MODE) == HImode || (MODE) == QImode) \
+ ((FP_REG_CLASS_P (CLASS) \
+ && ((MODE) == HImode || (MODE) == QImode) \
&& (GET_CODE (IN) == MEM \
- || ((GET_CODE (IN) == REG || GET_CODE (IN) == SUBREG) \
- && true_regnum (IN) == -1))) ? GENERAL_REGS : NO_REGS)
+ || ((GET_CODE (IN) == REG || GET_CODE (IN) == SUBREG) \
+ && true_regnum (IN) == -1))) \
+ ? GENERAL_REGS \
+ : (((TARGET_CM_MEDANY \
+ && symbolic_operand ((IN), (MODE))) \
+ || (TARGET_CM_EMBMEDANY \
+ && text_segment_operand ((IN), (MODE)))) \
+ && !flag_pic) \
+ ? GENERAL_REGS \
+ : NO_REGS)
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, IN) \
- ((FP_REG_CLASS_P (CLASS) && ((MODE) == HImode || (MODE) == QImode) \
- && (GET_CODE (IN) == MEM \
- || ((GET_CODE (IN) == REG || GET_CODE (IN) == SUBREG) \
- && true_regnum (IN) == -1))) ? GENERAL_REGS : NO_REGS)
+ ((FP_REG_CLASS_P (CLASS) \
+ && ((MODE) == HImode || (MODE) == QImode) \
+ && (GET_CODE (IN) == MEM \
+ || ((GET_CODE (IN) == REG || GET_CODE (IN) == SUBREG) \
+ && true_regnum (IN) == -1))) \
+ ? GENERAL_REGS \
+ : (((TARGET_CM_MEDANY \
+ && symbolic_operand ((IN), (MODE))) \
+ || (TARGET_CM_EMBMEDANY \
+ && text_segment_operand ((IN), (MODE)))) \
+ && !flag_pic) \
+ ? GENERAL_REGS \
+ : NO_REGS)
/* On SPARC it is not possible to directly move data between
GENERAL_REGS and FP_REGS. */
@@ -1390,7 +1472,7 @@ extern char leaf_reg_remap[];
: gen_rtx_MEM (MODE, gen_rtx_PLUS (Pmode, frame_pointer_rtx, \
GEN_INT (STARTING_FRAME_OFFSET))))
-/* Get_secondary_mem widens it's argument to BITS_PER_WORD which loses on v9
+/* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on v9
because the movsi and movsf patterns don't handle r/f moves.
For v8 we copy the default definition. */
#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \
@@ -1454,6 +1536,10 @@ extern char leaf_reg_remap[];
(TARGET_ARCH64 ? (SPARC_STACK_BIAS + 16 * UNITS_PER_WORD) \
: (STRUCT_VALUE_OFFSET + UNITS_PER_WORD))
+/* Offset from the argument pointer register value to the CFA. */
+
+#define ARG_POINTER_CFA_OFFSET SPARC_STACK_BIAS
+
/* When a parameter is passed in a register, stack space is still
allocated for it.
!v9: All 6 possible integer registers have backing store allocated.
@@ -1683,7 +1769,7 @@ extern int gen_v9_scc ();
the assembler). */
#define ASM_DECLARE_RESULT(FILE, RESULT) \
- fprintf ((FILE), "\t.proc\t0%o\n", sparc_type_code (TREE_TYPE (RESULT)))
+ fprintf ((FILE), "\t.proc\t0%lo\n", sparc_type_code (TREE_TYPE (RESULT)))
/* Output the label for a function definition. */
@@ -2099,54 +2185,11 @@ extern union tree_node *current_function_decl;
#define EPILOGUE_USES(REGNO) \
(!TARGET_FLAT && REGNO == 31)
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts. */
-
-/* On 32 bit sparcs, the trampoline contains five instructions:
- sethi #TOP_OF_FUNCTION,%g1
- or #BOTTOM_OF_FUNCTION,%g1,%g1
- sethi #TOP_OF_STATIC,%g2
- jmp g1
- or #BOTTOM_OF_STATIC,%g2,%g2
-
- On 64 bit sparcs, the trampoline contains 4 insns and two pseudo-immediate
- constants (plus some padding):
- rd %pc,%g1
- ldx[%g1+20],%g5
- ldx[%g1+28],%g1
- jmp %g1
- nop
- nop
- .xword context
- .xword function */
-/* ??? Stack is execute-protected in v9. */
-
-#define TRAMPOLINE_TEMPLATE(FILE) \
-do { \
- if (TARGET_ARCH64) \
- { \
- fprintf (FILE, "\trd %%pc,%%g1\n"); \
- fprintf (FILE, "\tldx [%%g1+24],%%g5\n"); \
- fprintf (FILE, "\tldx [%%g1+32],%%g1\n"); \
- fprintf (FILE, "\tjmp %%g1\n"); \
- fprintf (FILE, "\tnop\n"); \
- fprintf (FILE, "\tnop\n"); \
- /* -mmedlow shouldn't generate .xwords, so don't use them at all */ \
- fprintf (FILE, "\t.word 0,0,0,0\n"); \
- } \
- else \
- { \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x81C04000)); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- } \
-} while (0)
-
/* Length in units of the trampoline for entering a nested function. */
-#define TRAMPOLINE_SIZE (TARGET_ARCH64 ? 40 : 20)
+#define TRAMPOLINE_SIZE (TARGET_ARCH64 ? 32 : 16)
+
+#define TRAMPOLINE_ALIGNMENT 128 /* 16 bytes */
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
@@ -2155,12 +2198,10 @@ do { \
void sparc_initialize_trampoline ();
void sparc64_initialize_trampoline ();
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- do { \
if (TARGET_ARCH64) \
sparc64_initialize_trampoline (TRAMP, FNADDR, CXT); \
else \
- sparc_initialize_trampoline (TRAMP, FNADDR, CXT); \
- } while (0)
+ sparc_initialize_trampoline (TRAMP, FNADDR, CXT)
/* Generate necessary RTL for __builtin_saveregs().
ARGLIST is the argument list; see expr.c. */
@@ -2245,16 +2286,16 @@ extern struct rtx_def *sparc_builtin_saveregs ();
has been allocated, which happens in local-alloc.c. */
#define REGNO_OK_FOR_INDEX_P(REGNO) \
-((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
+((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < (unsigned)32)
#define REGNO_OK_FOR_BASE_P(REGNO) \
-((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
+((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < (unsigned)32)
#define REGNO_OK_FOR_FP_P(REGNO) \
- (((unsigned) (REGNO) - 32 < (TARGET_V9 ? 64 : 32)) \
- || ((unsigned) reg_renumber[REGNO] - 32 < (TARGET_V9 ? 64 : 32)))
+ (((unsigned) (REGNO) - 32 < (TARGET_V9 ? (unsigned)64 : (unsigned)32)) \
+ || ((unsigned) reg_renumber[REGNO] - 32 < (TARGET_V9 ? (unsigned)64 : (unsigned)32)))
#define REGNO_OK_FOR_CCFP_P(REGNO) \
(TARGET_V9 \
- && (((unsigned) (REGNO) - 96 < 4) \
- || ((unsigned) reg_renumber[REGNO] - 96 < 4)))
+ && (((unsigned) (REGNO) - 96 < (unsigned)4) \
+ || ((unsigned) reg_renumber[REGNO] - 96 < (unsigned)4)))
/* Now macros that check whether X is a register and also,
strictly, whether it is in a specified class.
@@ -2290,10 +2331,13 @@ extern struct rtx_def *sparc_builtin_saveregs ();
#define LEGITIMATE_PIC_OPERAND_P(X) (! pic_address_needs_scratch (X))
/* Nonzero if the constant value X is a legitimate general operand.
- Anything can be made to work except floating point constants. */
+ Anything can be made to work except floating point constants.
+ If TARGET_VIS, 0.0 can be made to work as well. */
-#define LEGITIMATE_CONSTANT_P(X) \
- (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode)
+#define LEGITIMATE_CONSTANT_P(X) \
+ (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode || \
+ (TARGET_VIS && (GET_MODE (X) == SFmode || GET_MODE (X) == DFmode) && \
+ fp_zero_operand (X)))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
and check its validity for a certain class.
@@ -2308,15 +2352,13 @@ extern struct rtx_def *sparc_builtin_saveregs ();
After reload, it makes no difference, since pseudo regs have
been eliminated by then. */
-/* Optional extra constraints for this machine. Borrowed from romp.h.
+/* Optional extra constraints for this machine.
- For the SPARC, `Q' means that this is a memory operand but not a
- symbolic memory operand. Note that an unassigned pseudo register
- is such a memory operand. Needed because reload will generate
- these things in insns and then not re-recognize the insns, causing
- constrain_operands to fail.
+ 'T' handles memory addresses where the alignment is known to
+ be at least 8 bytes.
- `S' handles constraints for calls. ??? So where is it? */
+ `U' handles all pseudo registers or a hard even numbered
+ integer register, needed for ldd/std instructions. */
#ifndef REG_OK_STRICT
@@ -2332,17 +2374,11 @@ extern struct rtx_def *sparc_builtin_saveregs ();
/* 'T', 'U' are for aligned memory loads which aren't needed for v9. */
#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'Q' \
- ? ((GET_CODE (OP) == MEM \
- && memory_address_p (GET_MODE (OP), XEXP (OP, 0)) \
- && ! symbolic_memory_operand (OP, VOIDmode)) \
- || (reload_in_progress && GET_CODE (OP) == REG \
- && REGNO (OP) >= FIRST_PSEUDO_REGISTER)) \
- : (! TARGET_ARCH64 && (C) == 'T') \
- ? (mem_aligned_8 (OP)) \
- : (! TARGET_ARCH64 && (C) == 'U') \
- ? (register_ok_for_ldd (OP)) \
- : 0)
+ ((! TARGET_ARCH64 && (C) == 'T') \
+ ? (mem_min_alignment (OP, 8)) \
+ : ((! TARGET_ARCH64 && (C) == 'U') \
+ ? (register_ok_for_ldd (OP)) \
+ : 0))
#else
@@ -2352,19 +2388,14 @@ extern struct rtx_def *sparc_builtin_saveregs ();
#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'Q' \
- ? (GET_CODE (OP) == REG \
- ? (REGNO (OP) >= FIRST_PSEUDO_REGISTER \
- && reg_renumber[REGNO (OP)] < 0) \
- : GET_CODE (OP) == MEM) \
- : (! TARGET_ARCH64 && (C) == 'T') \
- ? mem_aligned_8 (OP) && strict_memory_address_p (Pmode, XEXP (OP, 0)) \
- : (! TARGET_ARCH64 && (C) == 'U') \
- ? (GET_CODE (OP) == REG \
- && (REGNO (OP) < FIRST_PSEUDO_REGISTER \
- || reg_renumber[REGNO (OP)] >= 0) \
- && register_ok_for_ldd (OP)) \
- : 0)
+ ((! TARGET_ARCH64 && (C) == 'T') \
+ ? mem_min_alignment (OP, 8) && strict_memory_address_p (Pmode, XEXP (OP, 0)) \
+ : ((! TARGET_ARCH64 && (C) == 'U') \
+ ? (GET_CODE (OP) == REG \
+ && (REGNO (OP) < FIRST_PSEUDO_REGISTER \
+ || reg_renumber[REGNO (OP)] >= 0) \
+ && register_ok_for_ldd (OP)) \
+ : 0))
#endif
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
@@ -2432,8 +2463,8 @@ extern struct rtx_def *sparc_builtin_saveregs ();
&& CONSTANT_P (op1) \
/* We can't allow TFmode, because an offset \
greater than or equal to the alignment (8) \
- may cause the LO_SUM to overflow. */ \
- && MODE != TFmode) \
+ may cause the LO_SUM to overflow if !v9. */\
+ && (MODE != TFmode || TARGET_V9)) \
goto ADDR; \
} \
else if (GET_CODE (X) == CONST_INT && SMALL_INT (X)) \
@@ -2480,8 +2511,7 @@ extern struct rtx_def *legitimize_pic_address ();
copy_to_mode_reg (Pmode, XEXP (X, 0))); \
else if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \
|| GET_CODE (X) == LABEL_REF) \
- (X) = gen_rtx_LO_SUM (Pmode, \
- copy_to_mode_reg (Pmode, gen_rtx_HIGH (Pmode, X)), X); \
+ (X) = copy_to_suggested_reg (X, NULL_RTX, Pmode); \
if (memory_address_p (MODE, X)) \
goto WIN; }
@@ -2503,7 +2533,17 @@ extern struct rtx_def *legitimize_pic_address ();
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
-#define CASE_VECTOR_MODE Pmode
+/* If we ever implement any of the full models (such as CM_FULLANY),
+ this has to be DImode in that case */
+#ifdef HAVE_GAS_SUBSECTION_ORDERING
+#define CASE_VECTOR_MODE \
+(! TARGET_PTR64 ? SImode : flag_pic ? SImode : TARGET_CM_MEDLOW ? SImode : DImode)
+#else
+/* If assembler does not have working .subsection -1, we use DImode for pic, as otherwise
+ we have to sign extend which slows things down. */
+#define CASE_VECTOR_MODE \
+(! TARGET_PTR64 ? SImode : flag_pic ? DImode : TARGET_CM_MEDLOW ? SImode : DImode)
+#endif
/* Define as C expression which evaluates to nonzero if the tablejump
instruction expects the table to contain offsets from the address of the
@@ -2637,25 +2677,26 @@ extern struct rtx_def *legitimize_pic_address ();
#define MULSI3_LIBCALL "*.umul"
/* Define library calls for quad FP operations. These are all part of the
- SPARC ABI. */
-#define ADDTF3_LIBCALL "_Q_add"
-#define SUBTF3_LIBCALL "_Q_sub"
-#define NEGTF2_LIBCALL "_Q_neg"
-#define MULTF3_LIBCALL "_Q_mul"
-#define DIVTF3_LIBCALL "_Q_div"
-#define FLOATSITF2_LIBCALL "_Q_itoq"
-#define FIX_TRUNCTFSI2_LIBCALL "_Q_qtoi"
-#define FIXUNS_TRUNCTFSI2_LIBCALL "_Q_qtou"
-#define EXTENDSFTF2_LIBCALL "_Q_stoq"
-#define TRUNCTFSF2_LIBCALL "_Q_qtos"
-#define EXTENDDFTF2_LIBCALL "_Q_dtoq"
-#define TRUNCTFDF2_LIBCALL "_Q_qtod"
-#define EQTF2_LIBCALL "_Q_feq"
-#define NETF2_LIBCALL "_Q_fne"
-#define GTTF2_LIBCALL "_Q_fgt"
-#define GETF2_LIBCALL "_Q_fge"
-#define LTTF2_LIBCALL "_Q_flt"
-#define LETF2_LIBCALL "_Q_fle"
+ SPARC ABI.
+ ??? ARCH64 still does not work as the _Qp_* routines take pointers. */
+#define ADDTF3_LIBCALL (TARGET_ARCH64 ? "_Qp_add" : "_Q_add")
+#define SUBTF3_LIBCALL (TARGET_ARCH64 ? "_Qp_sub" : "_Q_sub")
+#define NEGTF2_LIBCALL (TARGET_ARCH64 ? "_Qp_neg" : "_Q_neg")
+#define MULTF3_LIBCALL (TARGET_ARCH64 ? "_Qp_mul" : "_Q_mul")
+#define DIVTF3_LIBCALL (TARGET_ARCH64 ? "_Qp_div" : "_Q_div")
+#define FLOATSITF2_LIBCALL (TARGET_ARCH64 ? "_Qp_itoq" : "_Q_itoq")
+#define FIX_TRUNCTFSI2_LIBCALL (TARGET_ARCH64 ? "_Qp_qtoi" : "_Q_qtoi")
+#define FIXUNS_TRUNCTFSI2_LIBCALL (TARGET_ARCH64 ? "_Qp_qtoui" : "_Q_qtou")
+#define EXTENDSFTF2_LIBCALL (TARGET_ARCH64 ? "_Qp_stoq" : "_Q_stoq")
+#define TRUNCTFSF2_LIBCALL (TARGET_ARCH64 ? "_Qp_qtos" : "_Q_qtos")
+#define EXTENDDFTF2_LIBCALL (TARGET_ARCH64 ? "_Qp_dtoq" : "_Q_dtoq")
+#define TRUNCTFDF2_LIBCALL (TARGET_ARCH64 ? "_Qp_qtod" : "_Q_qtod")
+#define EQTF2_LIBCALL (TARGET_ARCH64 ? "_Qp_feq" : "_Q_feq")
+#define NETF2_LIBCALL (TARGET_ARCH64 ? "_Qp_fne" : "_Q_fne")
+#define GTTF2_LIBCALL (TARGET_ARCH64 ? "_Qp_fgt" : "_Q_fgt")
+#define GETF2_LIBCALL (TARGET_ARCH64 ? "_Qp_fge" : "_Q_fge")
+#define LTTF2_LIBCALL (TARGET_ARCH64 ? "_Qp_flt" : "_Q_flt")
+#define LETF2_LIBCALL (TARGET_ARCH64 ? "_Qp_fle" : "_Q_fle")
/* We can define the TFmode sqrt optab only if TARGET_FPU. This is because
with soft-float, the SFmode and DFmode sqrt instructions will be absent,
@@ -2721,9 +2762,6 @@ extern struct rtx_def *legitimize_pic_address ();
return 0; \
return 8;
-/* Compute the cost of an address. For the sparc, all valid addresses are
- the same cost. */
-
#define ADDRESS_COST(RTX) 1
/* Compute extra cost of moving data between one register class
@@ -2744,11 +2782,17 @@ extern struct rtx_def *legitimize_pic_address ();
#define RTX_COSTS(X,CODE,OUTER_CODE) \
case MULT: \
+ if (sparc_cpu == PROCESSOR_ULTRASPARC) \
+ return (GET_MODE (X) == DImode ? \
+ COSTS_N_INSNS (34) : COSTS_N_INSNS (19)); \
return TARGET_HARD_MUL ? COSTS_N_INSNS (5) : COSTS_N_INSNS (25); \
case DIV: \
case UDIV: \
case MOD: \
case UMOD: \
+ if (sparc_cpu == PROCESSOR_ULTRASPARC) \
+ return (GET_MODE (X) == DImode ? \
+ COSTS_N_INSNS (68) : COSTS_N_INSNS (37)); \
return COSTS_N_INSNS (25); \
/* Make FLOAT and FIX more expensive than CONST_DOUBLE,\
so that cse will favor the latter. */ \
@@ -2766,6 +2810,24 @@ extern struct rtx_def *legitimize_pic_address ();
(COST) = ultrasparc_adjust_cost (INSN, LINK, DEP, COST); \
else
+extern void ultrasparc_sched_reorder ();
+extern void ultrasparc_sched_init ();
+extern int ultrasparc_variable_issue ();
+
+#define MD_SCHED_INIT(DUMP, SCHED_VERBOSE) \
+ if (sparc_cpu == PROCESSOR_ULTRASPARC) \
+ ultrasparc_sched_init (DUMP, SCHED_VERBOSE)
+
+#define MD_SCHED_REORDER(DUMP, SCHED_VERBOSE, READY, N_READY) \
+ if (sparc_cpu == PROCESSOR_ULTRASPARC) \
+ ultrasparc_sched_reorder (DUMP, SCHED_VERBOSE, READY, N_READY)
+
+#define MD_SCHED_VARIABLE_ISSUE(DUMP, SCHED_VERBOSE, INSN, CAN_ISSUE_MORE) \
+ if (sparc_cpu == PROCESSOR_ULTRASPARC) \
+ (CAN_ISSUE_MORE) = ultrasparc_variable_issue (INSN); \
+ else \
+ (CAN_ISSUE_MORE)--
+
/* Conditional branches with empty delay slots have a length of two. */
#define ADJUST_INSN_LENGTH(INSN, LENGTH) \
if (GET_CODE (INSN) == CALL_INSN \
@@ -2888,7 +2950,7 @@ extern struct rtx_def *legitimize_pic_address ();
This is suitable for output with `assemble_name'. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf (LABEL, "*%s%d", PREFIX, NUM)
+ sprintf ((LABEL), "*%s%ld", (PREFIX), (long)(NUM))
/* This is how to output an assembler line defining a `float' constant.
We always have to use a .long pseudo-op to do this because the native
@@ -2965,20 +3027,27 @@ extern struct rtx_def *legitimize_pic_address ();
#define ASM_OUTPUT_BYTE(FILE,VALUE) \
fprintf (FILE, "\t%s\t0x%x\n", ASM_BYTE_OP, (VALUE))
+/* This is how we hook in and defer the case-vector until the end of
+ the function. */
+
+#define ASM_OUTPUT_ADDR_VEC(LAB,VEC) \
+ sparc_defer_case_vector ((LAB),(VEC), 0)
+
+#define ASM_OUTPUT_ADDR_DIFF_VEC(LAB,VEC) \
+ sparc_defer_case_vector ((LAB),(VEC), 1)
+
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { \
char label[30]; \
ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
- if (Pmode == SImode) \
+ if (CASE_VECTOR_MODE == SImode) \
fprintf (FILE, "\t.word\t"); \
- else if (TARGET_CM_MEDLOW) \
- fprintf (FILE, "\t.word\t0\n\t.word\t"); \
else \
fprintf (FILE, "\t.xword\t"); \
assemble_name (FILE, label); \
- fprintf (FILE, "\n"); \
+ fputc ('\n', FILE); \
} while (0)
/* This is how to output an element of a case-vector that is relative.
@@ -2987,17 +3056,32 @@ do { \
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do { \
char label[30]; \
- ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
- if (Pmode == SImode) \
+ ASM_GENERATE_INTERNAL_LABEL (label, "L", (VALUE)); \
+ if (CASE_VECTOR_MODE == SImode) \
fprintf (FILE, "\t.word\t"); \
- else if (TARGET_CM_MEDLOW) \
- fprintf (FILE, "\t.word\t0\n\t.word\t"); \
else \
fprintf (FILE, "\t.xword\t"); \
assemble_name (FILE, label); \
- fprintf (FILE, "-1b\n"); \
+ ASM_GENERATE_INTERNAL_LABEL (label, "L", (REL)); \
+ fputc ('-', FILE); \
+ assemble_name (FILE, label); \
+ fputc ('\n', FILE); \
} while (0)
+/* This is what to output before and after case-vector (both
+ relative and absolute). If .subsection -1 works, we put case-vectors
+ at the beginning of the current section. */
+
+#ifdef HAVE_GAS_SUBSECTION_ORDERING
+
+#define ASM_OUTPUT_ADDR_VEC_START(FILE) \
+ fprintf(FILE, "\t.subsection\t-1\n")
+
+#define ASM_OUTPUT_ADDR_VEC_END(FILE) \
+ fprintf(FILE, "\t.previous\n")
+
+#endif
+
/* This is how to output an assembler line
that says to advance the location counter
to a multiple of 2**LOG bytes. */
@@ -3075,25 +3159,21 @@ do { \
fprintf (FILE, "\tadd %%o0,%d,%%o0\n", DELTA); \
fprintf (FILE, "\tmov %%o7,%%g1\n"); \
fprintf (FILE, "\tcall "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, ",0\n"); \
} \
else if (TARGET_CM_EMBMEDANY) \
{ \
fprintf (FILE, "\tsetx "); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, ",%%g5,%%g1\n\tjmp %%g1\n"); \
} \
else \
{ \
fprintf (FILE, "\tsethi %%hi("); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "),%%g1\n\tjmp %%g1+%%lo("); \
- assemble_name \
- (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, ")\n"); \
} \
if (!TARGET_CM_EMBMEDANY || flag_pic) \
@@ -3165,7 +3245,10 @@ do { \
else if (GET_CODE (addr) == LO_SUM) \
{ \
output_operand (XEXP (addr, 0), 0); \
- fputs ("+%lo(", FILE); \
+ if (TARGET_CM_MEDMID) \
+ fputs ("+%l44(", FILE); \
+ else \
+ fputs ("+%lo(", FILE); \
output_address (XEXP (addr, 1)); \
fputc (')', FILE); \
} \
@@ -3190,6 +3273,53 @@ do { \
} \
}
+/* Define the codes that are matched by predicates in sparc.c. */
+
+#define PREDICATE_CODES \
+{"reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \
+{"fp_zero_operand", {CONST_DOUBLE}}, \
+{"intreg_operand", {SUBREG, REG}}, \
+{"fcc_reg_operand", {REG}}, \
+{"icc_or_fcc_reg_operand", {REG}}, \
+{"restore_operand", {REG}}, \
+{"call_operand", {MEM}}, \
+{"call_operand_address", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE, ADDRESSOF, \
+ SUBREG, REG, PLUS, LO_SUM, CONST_INT}}, \
+{"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE}}, \
+{"symbolic_memory_operand", {SUBREG, MEM}}, \
+{"label_ref_operand", {LABEL_REF}}, \
+{"sp64_medium_pic_operand", {CONST}}, \
+{"data_segment_operand", {SYMBOL_REF, PLUS, CONST}}, \
+{"text_segment_operand", {LABEL_REF, SYMBOL_REF, PLUS, CONST}}, \
+{"reg_or_nonsymb_mem_operand", {SUBREG, REG, MEM}}, \
+{"splittable_symbolic_memory_operand", {MEM}}, \
+{"splittable_immediate_memory_operand", {MEM}}, \
+{"eq_or_neq", {EQ, NE}}, \
+{"normal_comp_operator", {GE, GT, LE, LT, GTU, LEU}}, \
+{"noov_compare_op", {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU}}, \
+{"v9_regcmp_op", {EQ, NE, GE, LT, LE, GT}}, \
+{"extend_op", {SIGN_EXTEND, ZERO_EXTEND}}, \
+{"cc_arithop", {AND, IOR, XOR}}, \
+{"cc_arithopn", {AND, IOR}}, \
+{"arith_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT}}, \
+{"arith_add_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT}}, \
+{"arith11_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT}}, \
+{"arith10_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT}}, \
+{"arith_double_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, CONST_DOUBLE}}, \
+{"arith_double_add_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, CONST_DOUBLE}},\
+{"arith11_double_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, CONST_DOUBLE}}, \
+{"arith10_double_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, CONST_DOUBLE}}, \
+{"small_int", {CONST_INT, CONSTANT_P_RTX}}, \
+{"small_int_or_double", {CONST_INT, CONST_DOUBLE, CONSTANT_P_RTX}}, \
+{"uns_small_int", {CONST_INT, CONSTANT_P_RTX}}, \
+{"uns_arith_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \
+{"clobbered_register", {REG}}, \
+{"input_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, MEM}}, \
+{"zero_operand", {CONST_INT, CONSTANT_P_RTX}}, \
+{"const64_operand", {CONST_INT, CONST_DOUBLE, CONSTANT_P_RTX}}, \
+{"const64_high_operand", {CONST_INT, CONST_DOUBLE, CONSTANT_P_RTX}},
+
+
/* The number of Pmode words for the setjmp buffer. */
#define JMP_BUF_SIZE 12
@@ -3197,20 +3327,19 @@ do { \
/* Declare functions defined in sparc.c and used in templates. */
-extern char *doublemove_string ();
-extern char *output_block_move ();
+extern void sparc_emit_set_const32 ();
+extern void sparc_emit_set_const64 ();
+extern void sparc_emit_set_symbolic_const64 ();
+extern int sparc_splitdi_legitimate ();
+extern int sparc_absnegfloat_split_legitimate ();
+
extern char *output_cbranch ();
-extern char *output_fp_move_double ();
-extern char *output_fp_move_quad ();
-extern char *output_move_double ();
-extern char *output_move_quad ();
extern char *output_return ();
-extern char *output_scc_insn ();
extern char *output_v9branch ();
-extern char *singlemove_string ();
extern void emit_v9_brxx_insn ();
extern void finalize_pic ();
+extern void order_regs_for_local_alloc ();
extern void output_double_int ();
extern void output_function_epilogue ();
extern void output_function_prologue ();
@@ -3224,22 +3353,30 @@ extern int arith10_operand ();
extern int arith11_double_operand ();
extern int arith11_operand ();
extern int arith_double_operand ();
+extern int arith_double_4096_operand ();
+extern int arith_double_add_operand ();
extern int arith_operand ();
+extern int arith_4096_operand ();
+extern int arith_add_operand ();
extern int call_operand_address ();
+extern int input_operand ();
+extern int zero_operand ();
+extern int const64_operand ();
+extern int const64_high_operand ();
extern int cc_arithop ();
extern int cc_arithopn ();
extern int check_pic ();
extern int compute_frame_size ();
extern int data_segment_operand ();
extern int eligible_for_epilogue_delay ();
+extern int eligible_for_return_delay ();
extern int emit_move_sequence ();
extern int extend_op ();
extern int fcc_reg_operand ();
extern int fp_zero_operand ();
extern int icc_or_fcc_reg_operand ();
extern int label_ref_operand ();
-extern int mem_aligned_8 ();
-extern int move_operand ();
+extern int mem_min_alignment ();
extern int noov_compare_op ();
extern int pic_address_needs_scratch ();
extern int reg_or_0_operand ();
@@ -3250,10 +3387,11 @@ extern int registers_ok_for_ldd_peep ();
extern int restore_operand ();
extern int short_branch ();
extern int small_int ();
+extern int small_int_or_double ();
extern int sp64_medium_pic_operand ();
extern int sparc_flat_eligible_for_epilogue_delay ();
extern int sparc_flat_epilogue_delay_slots ();
-extern int sparc_operand ();
+extern int sparc_issue_rate ();
extern int splittable_immediate_memory_operand ();
extern int splittable_symbolic_memory_operand ();
extern int supersparc_adjust_cost ();
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index a86434c34f1..e7538a1ae65 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -23,6 +23,37 @@
;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
+;; Uses of UNSPEC and UNSPEC_VOLATILE in this file:
+;;
+;; UNSPEC: 0 movsi_{lo_sum,high}_pic
+;; pic_lo_sum_di
+;; pic_sethi_di
+;; 1 update_return
+;; 2 get_pc
+;; 5 movsi_{,lo_sum_,high_}pic_label_ref
+;; 6 seth44
+;; 7 setm44
+;; 8 setl44
+;; 9 sethh
+;; 10 setlm
+;; 11 embmedany_sethi, embmedany_brsum
+;; 12 movsf_const_high
+;; 13 embmedany_textuhi
+;; 14 embmedany_texthi
+;; 15 embmedany_textulo
+;; 16 embmedany_textlo
+;; 17 movsf_const_lo
+;; 18 sethm
+;; 19 setlo
+;;
+;; UNSPEC_VOLATILE: 0 blockage
+;; 1 flush_register_windows
+;; 2 goto_handler_and_restore
+;; 3 goto_handler_and_restore_v9*
+;; 4 flush
+;; 5 nonlocal_goto_receiver
+;;
+
;; The upper 32 fp regs on the v9 can't hold SFmode values. To deal with this
;; a second register class, EXTRA_FP_REGS, exists for the v9 chip. The name
;; is a bit of a misnomer as it covers all 64 fp regs. The corresponding
@@ -130,7 +161,6 @@
(define_attr "leaf_function" "false,true"
(const (symbol_ref "leaf_function")))
-
(define_attr "in_return_delay" "false,true"
(if_then_else (and (and (and (eq_attr "type" "move,load,sload,store,binary,ialu")
(eq_attr "length" "1"))
@@ -370,21 +400,31 @@
(eq_attr "type" "store,fpstore"))
1 1)
-(define_function_unit "ieu" 1 0
+(define_function_unit "ieuN" 2 0
(and (eq_attr "cpu" "ultrasparc")
- (eq_attr "type" "ialu,binary,shift,compare,cmove,call"))
+ (eq_attr "type" "ialu,binary,move,unary,shift,compare,call,call_no_delay_slot,uncond_branch"))
1 1)
-(define_function_unit "ieu_shift" 1 0
+(define_function_unit "ieu0" 1 0
(and (eq_attr "cpu" "ultrasparc")
(eq_attr "type" "shift"))
1 1)
-(define_function_unit "ieu_shift" 1 0
+(define_function_unit "ieu0" 1 0
(and (eq_attr "cpu" "ultrasparc")
(eq_attr "type" "cmove"))
2 1)
+(define_function_unit "ieu1" 1 0
+ (and (eq_attr "cpu" "ultrasparc")
+ (eq_attr "type" "compare,call,call_no_delay_slot,uncond_branch"))
+ 1 1)
+
+(define_function_unit "cti" 1 0
+ (and (eq_attr "cpu" "ultrasparc")
+ (eq_attr "type" "branch"))
+ 1 1)
+
;; Timings; throughput/latency
;; FMOV 1/1 fmov, fabs, fneg
;; FMOVcc 1/2
@@ -395,6 +435,11 @@
;; FSQRTs 12/12
;; FSQRTd 22/22
;; FCMP takes 1 cycle to branch, 2 cycles to conditional move.
+;;
+;; ??? This is really bogus because the timings really depend upon
+;; who uses the result. We should record who the user is with
+;; more descriptive 'type' attribute names and account for these
+;; issues in ultrasparc_adjust_cost.
(define_function_unit "fadd" 1 0
(and (eq_attr "cpu" "ultrasparc")
@@ -426,17 +471,17 @@
(eq_attr "type" "fpcmove"))
2 1)
-(define_function_unit "fadd" 1 0
+(define_function_unit "fmul" 1 0
(and (eq_attr "cpu" "ultrasparc")
(eq_attr "type" "fpdivs"))
12 12)
-(define_function_unit "fadd" 1 0
+(define_function_unit "fmul" 1 0
(and (eq_attr "cpu" "ultrasparc")
(eq_attr "type" "fpdivd"))
22 22)
-(define_function_unit "fadd" 1 0
+(define_function_unit "fmul" 1 0
(and (eq_attr "cpu" "ultrasparc")
(eq_attr "type" "fpsqrt"))
12 12)
@@ -475,7 +520,7 @@
[(set (reg:CCX 100)
(compare:CCX (match_operand:DI 0 "register_operand" "")
(match_operand:DI 1 "arith_double_operand" "")))]
- "TARGET_ARCH64 || TARGET_V8PLUS"
+ "TARGET_ARCH64"
"
{
sparc_compare_op0 = operands[0];
@@ -529,7 +574,7 @@
(compare:CC (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "arith_operand" "rI")))]
""
- "cmp %0,%1"
+ "cmp\\t%0, %1"
[(set_attr "type" "compare")])
(define_insn "*cmpdi_sp64"
@@ -537,40 +582,9 @@
(compare:CCX (match_operand:DI 0 "register_operand" "r")
(match_operand:DI 1 "arith_double_operand" "rHI")))]
"TARGET_ARCH64"
- "cmp %0,%1"
+ "cmp\\t%0, %1"
[(set_attr "type" "compare")])
-(define_insn "cmpdi_v8plus"
- [(set (reg:CCX 100)
- (compare:CCX (match_operand:DI 0 "register_operand" "r,r,r")
- (match_operand:DI 1 "arith_double_operand" "J,I,r")))
- (clobber (match_scratch:SI 2 "=&h,&h,&h"))
- (clobber (match_scratch:SI 3 "=X,X,&h"))]
- "TARGET_V8PLUS"
- "*
-{
- /* The srl can be omitted if the value in the %L0 or %L1 is already
- zero extended. */
-
- output_asm_insn (\"sllx %H0,32,%2\", operands);
-
- if (sparc_check_64 (operands[0], insn) <= 0)
- output_asm_insn (\"srl %L0,0,%L0\", operands);
-
- switch (which_alternative)
- {
- case 0:
- return \"orcc %L0,%2,%%g0\";
- case 1:
- return \"or %L0,%2,%2\;cmp %2,%1\";
- case 2:
- if (sparc_check_64 (operands[1], insn) <= 0)
- output_asm_insn (\"srl %L1,0,%L1\", operands);
- return \"sllx %H1,32,%3\;or %L0,%2,%2\;or %L1,%3,%3\;cmp %2,%3\";
- }
-}"
- [(set_attr "length" "3,4,7")])
-
(define_insn "*cmpsf_fpe"
[(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c")
(compare:CCFPE (match_operand:SF 1 "register_operand" "f")
@@ -579,8 +593,8 @@
"*
{
if (TARGET_V9)
- return \"fcmpes %0,%1,%2\";
- return \"fcmpes %1,%2\";
+ return \"fcmpes\\t%0, %1, %2\";
+ return \"fcmpes\\t%1, %2\";
}"
[(set_attr "type" "fpcmp")])
@@ -592,8 +606,8 @@
"*
{
if (TARGET_V9)
- return \"fcmped %0,%1,%2\";
- return \"fcmped %1,%2\";
+ return \"fcmped\\t%0, %1, %2\";
+ return \"fcmped\\t%1, %2\";
}"
[(set_attr "type" "fpcmp")])
@@ -605,8 +619,8 @@
"*
{
if (TARGET_V9)
- return \"fcmpeq %0,%1,%2\";
- return \"fcmpeq %1,%2\";
+ return \"fcmpeq\\t%0, %1, %2\";
+ return \"fcmpeq\\t%1, %2\";
}"
[(set_attr "type" "fpcmp")])
@@ -618,8 +632,8 @@
"*
{
if (TARGET_V9)
- return \"fcmps %0,%1,%2\";
- return \"fcmps %1,%2\";
+ return \"fcmps\\t%0, %1, %2\";
+ return \"fcmps\\t%1, %2\";
}"
[(set_attr "type" "fpcmp")])
@@ -631,8 +645,8 @@
"*
{
if (TARGET_V9)
- return \"fcmpd %0,%1,%2\";
- return \"fcmpd %1,%2\";
+ return \"fcmpd\\t%0, %1, %2\";
+ return \"fcmpd\\t%1, %2\";
}"
[(set_attr "type" "fpcmp")])
@@ -644,8 +658,8 @@
"*
{
if (TARGET_V9)
- return \"fcmpq %0,%1,%2\";
- return \"fcmpq %1,%2\";
+ return \"fcmpq\\t%0, %1, %2\";
+ return \"fcmpq\\t%1, %2\";
}"
[(set_attr "type" "fpcmp")])
@@ -702,7 +716,7 @@
(xor:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))
(set (match_operand:SI 0 "register_operand" "")
- (eq:DI (match_dup 3) (const_int 0)))]
+ (eq:SI (match_dup 3) (const_int 0)))]
"TARGET_ARCH64"
"{ operands[3] = gen_reg_rtx (DImode); }")
@@ -711,7 +725,7 @@
(xor:DI (match_operand:DI 1 "register_operand" "")
(match_operand:DI 2 "register_operand" "")))
(set (match_operand:SI 0 "register_operand" "")
- (ne:DI (match_dup 3) (const_int 0)))]
+ (ne:SI (match_dup 3) (const_int 0)))]
"TARGET_ARCH64"
"{ operands[3] = gen_reg_rtx (DImode); }")
@@ -720,7 +734,7 @@
(xor:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "register_operand" "")))
(parallel [(set (match_operand:DI 0 "register_operand" "")
- (eq:SI (match_dup 3) (const_int 0)))
+ (eq:DI (match_dup 3) (const_int 0)))
(clobber (reg:CC 100))])]
"TARGET_ARCH64"
"{ operands[3] = gen_reg_rtx (SImode); }")
@@ -730,7 +744,7 @@
(xor:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "register_operand" "")))
(parallel [(set (match_operand:DI 0 "register_operand" "")
- (ne:SI (match_dup 3) (const_int 0)))
+ (ne:DI (match_dup 3) (const_int 0)))
(clobber (reg:CC 100))])]
"TARGET_ARCH64"
"{ operands[3] = gen_reg_rtx (SImode); }")
@@ -785,7 +799,7 @@
DONE;
/* fall through */
}
- operands[1] = gen_compare_reg (EQ, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
;; ??? v9: Operand 0 needs a mode, so SImode was chosen.
@@ -838,7 +852,7 @@
DONE;
/* fall through */
}
- operands[1] = gen_compare_reg (NE, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
(define_expand "sgt"
@@ -859,7 +873,7 @@
DONE;
/* fall through */
}
- operands[1] = gen_compare_reg (GT, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
(define_expand "slt"
@@ -880,7 +894,7 @@
DONE;
/* fall through */
}
- operands[1] = gen_compare_reg (LT, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
(define_expand "sge"
@@ -901,7 +915,7 @@
DONE;
/* fall through */
}
- operands[1] = gen_compare_reg (GE, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
(define_expand "sle"
@@ -922,7 +936,7 @@
DONE;
/* fall through */
}
- operands[1] = gen_compare_reg (LE, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
(define_expand "sgtu"
@@ -933,7 +947,7 @@
{
if (! TARGET_V9)
{
- rtx tem;
+ rtx tem, pat;
/* We can do ltu easily, so if both operands are registers, swap them and
do a LTU. */
@@ -945,7 +959,10 @@
tem = sparc_compare_op0;
sparc_compare_op0 = sparc_compare_op1;
sparc_compare_op1 = tem;
- emit_insn (gen_sltu (operands[0]));
+ pat = gen_sltu (operands[0]);
+ if (pat == NULL_RTX)
+ FAIL;
+ emit_insn (pat);
DONE;
}
}
@@ -954,7 +971,7 @@
if (gen_v9_scc (GTU, operands))
DONE;
}
- operands[1] = gen_compare_reg (GTU, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
(define_expand "sltu"
@@ -993,7 +1010,7 @@
{
if (! TARGET_V9)
{
- rtx tem;
+ rtx tem, pat;
/* We can do geu easily, so if both operands are registers, swap them and
do a GEU. */
@@ -1005,7 +1022,10 @@
tem = sparc_compare_op0;
sparc_compare_op0 = sparc_compare_op1;
sparc_compare_op1 = tem;
- emit_insn (gen_sgeu (operands[0]));
+ pat = gen_sgeu (operands[0]);
+ if (pat == NULL_RTX)
+ FAIL;
+ emit_insn (pat);
DONE;
}
}
@@ -1014,13 +1034,15 @@
if (gen_v9_scc (LEU, operands))
DONE;
}
- operands[1] = gen_compare_reg (LEU, sparc_compare_op0, sparc_compare_op1);
+ FAIL;
}")
;; Now the DEFINE_INSNs for the scc cases.
;; The SEQ and SNE patterns are special because they can be done
-;; without any branching and do not involve a COMPARE.
+;; without any branching and do not involve a COMPARE. We want
+;; them to always use the splitz below so the results can be
+;; scheduled.
(define_insn "*snesi_zero"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -1028,9 +1050,19 @@
(const_int 0)))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;addx %%g0,0,%0"
- [(set_attr "type" "unary")
- (set_attr "length" "2")])
+ "#"
+ [(set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ne:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC 100))]
+ ""
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (ltu:SI (reg:CC 100) (const_int 0)))]
+ "")
(define_insn "*neg_snesi_zero"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -1038,56 +1070,126 @@
(const_int 0))))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;subx %%g0,0,%0"
- [(set_attr "type" "unary")
- (set_attr "length" "2")])
+ "#"
+ [(set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (neg:SI (ne:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0))))
+ (clobber (reg:CC 100))]
+ ""
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
+ "")
(define_insn "*snesi_zero_extend"
[(set (match_operand:DI 0 "register_operand" "=r")
- (ne:SI (match_operand:SI 1 "register_operand" "r")
+ (ne:DI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
(clobber (reg:CC 100))]
"TARGET_ARCH64"
- "subcc %%g0,%1,%%g0\;addx %%g0,0,%0"
+ "#"
[(set_attr "type" "unary")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (ne:DI (match_operand:SI 1 "register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC 100))]
+ "TARGET_ARCH64"
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (minus:SI (const_int 0) (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (zero_extend:DI (plus:SI (plus:SI (const_int 0)
+ (const_int 0))
+ (ltu:SI (reg:CC_NOOV 100)
+ (const_int 0)))))]
+ "")
+
(define_insn "*snedi_zero"
[(set (match_operand:DI 0 "register_operand" "=&r")
(ne:DI (match_operand:DI 1 "register_operand" "r")
(const_int 0)))]
"TARGET_ARCH64"
- "mov 0,%0\;movrnz %1,1,%0"
+ "#"
[(set_attr "type" "cmove")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (ne:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 0)))]
+ "TARGET_ARCH64"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0) (if_then_else:DI (ne:DI (match_dup 1)
+ (const_int 0))
+ (const_int 1)
+ (match_dup 0)))]
+ "")
+
(define_insn "*neg_snedi_zero"
[(set (match_operand:DI 0 "register_operand" "=&r")
(neg:DI (ne:DI (match_operand:DI 1 "register_operand" "r")
(const_int 0))))]
"TARGET_ARCH64"
- "mov 0,%0\;movrnz %1,-1,%0"
+ "#"
[(set_attr "type" "cmove")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (neg:DI (ne:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 0))))]
+ "TARGET_ARCH64"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0) (if_then_else:DI (ne:DI (match_dup 1)
+ (const_int 0))
+ (const_int -1)
+ (match_dup 0)))]
+ "")
+
(define_insn "*snedi_zero_trunc"
[(set (match_operand:SI 0 "register_operand" "=&r")
- (ne:DI (match_operand:DI 1 "register_operand" "r")
+ (ne:SI (match_operand:DI 1 "register_operand" "r")
(const_int 0)))]
"TARGET_ARCH64"
- "mov 0,%0\;movrnz %1,1,%0"
+ "#"
[(set_attr "type" "cmove")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ne:SI (match_operand:DI 1 "register_operand" "")
+ (const_int 0)))]
+ "TARGET_ARCH64"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0) (if_then_else:SI (ne:DI (match_dup 1)
+ (const_int 0))
+ (const_int 1)
+ (match_dup 0)))]
+ "")
+
(define_insn "*seqsi_zero"
[(set (match_operand:SI 0 "register_operand" "=r")
(eq:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;subx %%g0,-1,%0"
- [(set_attr "type" "unary")
- (set_attr "length" "2")])
+ "#"
+ [(set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (eq:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC 100))]
+ ""
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (geu:SI (reg:CC 100) (const_int 0)))]
+ "")
(define_insn "*neg_seqsi_zero"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -1095,47 +1197,107 @@
(const_int 0))))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;addx %%g0,-1,%0"
- [(set_attr "type" "unary")
- (set_attr "length" "2")])
+ "#"
+ [(set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (neg:SI (eq:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0))))
+ (clobber (reg:CC 100))]
+ ""
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (neg:SI (geu:SI (reg:CC 100) (const_int 0))))]
+ "")
(define_insn "*seqsi_zero_extend"
[(set (match_operand:DI 0 "register_operand" "=r")
- (eq:SI (match_operand:SI 1 "register_operand" "r")
+ (eq:DI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
(clobber (reg:CC 100))]
"TARGET_ARCH64"
- "subcc %%g0,%1,%%g0\;subx %%g0,-1,%0"
+ "#"
[(set_attr "type" "unary")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (eq:DI (match_operand:SI 1 "register_operand" "")
+ (const_int 0)))
+ (clobber (reg:CC 100))]
+ "TARGET_ARCH64"
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (minus:SI (const_int 0) (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (zero_extend:DI (minus:SI (minus:SI (const_int 0)
+ (const_int -1))
+ (ltu:SI (reg:CC_NOOV 100)
+ (const_int 0)))))]
+ "")
+
(define_insn "*seqdi_zero"
[(set (match_operand:DI 0 "register_operand" "=&r")
(eq:DI (match_operand:DI 1 "register_operand" "r")
(const_int 0)))]
"TARGET_ARCH64"
- "mov 0,%0\;movrz %1,1,%0"
+ "#"
[(set_attr "type" "cmove")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (eq:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 0)))]
+ "TARGET_ARCH64"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0) (if_then_else:DI (eq:DI (match_dup 1)
+ (const_int 0))
+ (const_int 1)
+ (match_dup 0)))]
+ "")
+
(define_insn "*neg_seqdi_zero"
[(set (match_operand:DI 0 "register_operand" "=&r")
(neg:DI (eq:DI (match_operand:DI 1 "register_operand" "r")
(const_int 0))))]
"TARGET_ARCH64"
- "mov 0,%0\;movrz %1,-1,%0"
+ "#"
[(set_attr "type" "cmove")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (neg:DI (eq:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 0))))]
+ "TARGET_ARCH64"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0) (if_then_else:DI (eq:DI (match_dup 1)
+ (const_int 0))
+ (const_int -1)
+ (match_dup 0)))]
+ "")
+
(define_insn "*seqdi_zero_trunc"
[(set (match_operand:SI 0 "register_operand" "=&r")
- (eq:DI (match_operand:DI 1 "register_operand" "r")
+ (eq:SI (match_operand:DI 1 "register_operand" "r")
(const_int 0)))]
"TARGET_ARCH64"
- "mov 0,%0\;movrz %1,1,%0"
+ "#"
[(set_attr "type" "cmove")
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (eq:SI (match_operand:DI 1 "register_operand" "")
+ (const_int 0)))]
+ "TARGET_ARCH64"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0) (if_then_else:SI (eq:DI (match_dup 1)
+ (const_int 0))
+ (const_int 1)
+ (match_dup 0)))]
+ "")
+
;; We can also do (x + (i == 0)) and related, so put them in.
;; ??? The addx/subx insns use the 32 bit carry flag so there are no DImode
;; versions for v9.
@@ -1147,9 +1309,22 @@
(match_operand:SI 2 "register_operand" "r")))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;addx %2,0,%0"
+ "#"
[(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (ne:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0))
+ (match_operand:SI 2 "register_operand" "")))
+ (clobber (reg:CC 100))]
+ "! TARGET_LIVE_G0"
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
+ (match_dup 2)))]
+ "")
+
(define_insn "*x_minus_i_ne_0"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 2 "register_operand" "r")
@@ -1157,9 +1332,22 @@
(const_int 0))))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;subx %2,0,%0"
+ "#"
[(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (minus:SI (match_operand:SI 2 "register_operand" "")
+ (ne:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0))))
+ (clobber (reg:CC 100))]
+ "! TARGET_LIVE_G0"
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (minus:SI (match_dup 2)
+ (ltu:SI (reg:CC 100) (const_int 0))))]
+ "")
+
(define_insn "*x_plus_i_eq_0"
[(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (eq:SI (match_operand:SI 1 "register_operand" "r")
@@ -1167,9 +1355,22 @@
(match_operand:SI 2 "register_operand" "r")))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;subx %2,-1,%0"
+ "#"
[(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (eq:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0))
+ (match_operand:SI 2 "register_operand" "")))
+ (clobber (reg:CC 100))]
+ "! TARGET_LIVE_G0"
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (plus:SI (geu:SI (reg:CC 100) (const_int 0))
+ (match_dup 2)))]
+ "")
+
(define_insn "*x_minus_i_eq_0"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 2 "register_operand" "r")
@@ -1177,9 +1378,22 @@
(const_int 0))))
(clobber (reg:CC 100))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%%g0\;addx %2,-1,%0"
+ "#"
[(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (minus:SI (match_operand:SI 2 "register_operand" "")
+ (eq:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 0))))
+ (clobber (reg:CC 100))]
+ "! TARGET_LIVE_G0"
+ [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 0) (minus:SI (match_dup 2)
+ (geu:SI (reg:CC 100) (const_int 0))))]
+ "")
+
;; We can also do GEU and LTU directly, but these operate after a compare.
;; ??? The addx/subx insns use the 32 bit carry flag so there are no DImode
;; versions for v9.
@@ -1188,15 +1402,17 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(ltu:SI (reg:CC 100) (const_int 0)))]
"! TARGET_LIVE_G0"
- "addx %%g0,0,%0"
- [(set_attr "type" "misc")])
+ "addx\\t%%g0, 0, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*neg_sltu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
"! TARGET_LIVE_G0"
- "subx %%g0,0,%0"
- [(set_attr "type" "misc")])
+ "subx\\t%%g0, 0, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
;; ??? Combine should canonicalize these next two to the same pattern.
(define_insn "*neg_sltu_minus_x"
@@ -1204,30 +1420,34 @@
(minus:SI (neg:SI (ltu:SI (reg:CC 100) (const_int 0)))
(match_operand:SI 1 "arith_operand" "rI")))]
"! TARGET_LIVE_G0"
- "subx %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "subx\\t%%g0, %1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*neg_sltu_plus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
(match_operand:SI 1 "arith_operand" "rI"))))]
"! TARGET_LIVE_G0"
- "subx %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "subx\\t%%g0, %1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*sgeu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(geu:SI (reg:CC 100) (const_int 0)))]
"! TARGET_LIVE_G0"
- "subx %%g0,-1,%0"
- [(set_attr "type" "misc")])
+ "subx\\t%%g0, -1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*neg_sgeu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (geu:SI (reg:CC 100) (const_int 0))))]
"! TARGET_LIVE_G0"
- "addx %%g0,-1,%0"
- [(set_attr "type" "misc")])
+ "addx\\t%%g0, -1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
;; We can also do (x + ((unsigned) i >= 0)) and related, so put them in.
;; ??? The addx/subx insns use the 32 bit carry flag so there are no DImode
@@ -1238,8 +1458,9 @@
(plus:SI (ltu:SI (reg:CC 100) (const_int 0))
(match_operand:SI 1 "arith_operand" "rI")))]
"! TARGET_LIVE_G0"
- "addx %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "addx\\t%%g0, %1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*sltu_plus_x_plus_y"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -1247,74 +1468,74 @@
(plus:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI"))))]
""
- "addx %1,%2,%0")
+ "addx\\t%1, %2, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*x_minus_sltu"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_operand" "r")
(ltu:SI (reg:CC 100) (const_int 0))))]
""
- "subx %1,0,%0"
- [(set_attr "type" "unary")])
+ "subx\\t%1, 0, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
;; ??? Combine should canonicalize these next two to the same pattern.
(define_insn "*x_minus_y_minus_sltu"
[(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
+ (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
(ltu:SI (reg:CC 100) (const_int 0))))]
""
- "subx %1,%2,%0")
+ "subx\\t%r1, %2, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*x_minus_sltu_plus_y"
[(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (match_operand:SI 1 "register_operand" "r")
+ (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
(plus:SI (ltu:SI (reg:CC 100) (const_int 0))
(match_operand:SI 2 "arith_operand" "rI"))))]
""
- "subx %1,%2,%0")
+ "subx\\t%r1, %2, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*sgeu_plus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (geu:SI (reg:CC 100) (const_int 0))
(match_operand:SI 1 "register_operand" "r")))]
""
- "subx %1,-1,%0"
- [(set_attr "type" "unary")])
+ "subx\\t%1, -1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "*x_minus_sgeu"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_operand" "r")
(geu:SI (reg:CC 100) (const_int 0))))]
""
- "addx %1,-1,%0"
- [(set_attr "type" "unary")])
-
-;; Now we have the generic scc insns.
-;; !v9: These will be done using a jump.
-;; v9: Use conditional moves which are defined elsewhere.
-;; We have to exclude the cases above, since we will not want combine to
-;; turn something that does not require a jump into something that does.
+ "addx\\t%1, -1, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
-(define_insn "*scc_si"
+(define_split
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operator:SI 2 "noov_compare_op"
[(match_operand 1 "icc_or_fcc_reg_operand" "")
(const_int 0)]))]
- ""
- "* return output_scc_insn (operands, insn); "
- [(set_attr "type" "multi")
- (set_attr "length" "3")])
+ ;; 32 bit LTU/GEU are better implemented using addx/subx
+ "TARGET_V9 && REGNO (operands[1]) == SPARC_ICC_REG
+ && (GET_MODE (operands[1]) == CCXmode
+ || (GET_CODE (operands[2]) != LTU && GET_CODE (operands[2]) != GEU))"
+ [(set (match_dup 0) (const_int 0))
+ (set (match_dup 0)
+ (if_then_else:SI (match_op_dup:SI 2 [(match_dup 1) (const_int 0)])
+ (const_int 1)
+ (match_dup 0)))]
+ "")
-(define_insn "*scc_di"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (match_operator:DI 2 "noov_compare_op"
- [(match_operand 1 "icc_or_fcc_reg_operand" "")
- (const_int 0)]))]
- "TARGET_ARCH64"
- "* return output_scc_insn (operands, insn); "
- [(set_attr "type" "multi")
- (set_attr "length" "3")])
;; These control RTL generation for conditional jump insns
@@ -1508,6 +1729,7 @@
;; Now match both normal and inverted jump.
+;; XXX fpcmp nop braindamage
(define_insn "*normal_branch"
[(set (pc)
(if_then_else (match_operator 0 "noov_compare_op"
@@ -1519,10 +1741,11 @@
{
return output_cbranch (operands[0], 1, 0,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
+;; XXX fpcmp nop braindamage
(define_insn "*inverted_branch"
[(set (pc)
(if_then_else (match_operator 0 "noov_compare_op"
@@ -1534,10 +1757,11 @@
{
return output_cbranch (operands[0], 1, 1,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
+;; XXX fpcmp nop braindamage
(define_insn "*normal_fp_branch"
[(set (pc)
(if_then_else (match_operator 1 "comparison_operator"
@@ -1550,10 +1774,11 @@
{
return output_cbranch (operands[1], 2, 0,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
+;; XXX fpcmp nop braindamage
(define_insn "*inverted_fp_branch"
[(set (pc)
(if_then_else (match_operator 1 "comparison_operator"
@@ -1566,10 +1791,11 @@
{
return output_cbranch (operands[1], 2, 1,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
+;; XXX fpcmp nop braindamage
(define_insn "*normal_fpe_branch"
[(set (pc)
(if_then_else (match_operator 1 "comparison_operator"
@@ -1582,10 +1808,11 @@
{
return output_cbranch (operands[1], 2, 0,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
+;; XXX fpcmp nop braindamage
(define_insn "*inverted_fpe_branch"
[(set (pc)
(if_then_else (match_operator 1 "comparison_operator"
@@ -1598,7 +1825,7 @@
{
return output_cbranch (operands[1], 2, 1,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
@@ -1607,6 +1834,7 @@
;; There are no 32 bit brreg insns.
+;; XXX
(define_insn "*normal_int_branch_sp64"
[(set (pc)
(if_then_else (match_operator 0 "v9_regcmp_op"
@@ -1619,10 +1847,11 @@
{
return output_v9branch (operands[0], 1, 2, 0,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
+;; XXX
(define_insn "*inverted_int_branch_sp64"
[(set (pc)
(if_then_else (match_operator 0 "v9_regcmp_op"
@@ -1635,762 +1864,972 @@
{
return output_v9branch (operands[0], 1, 2, 1,
final_sequence && INSN_ANNULLED_BRANCH_P (insn),
- ! final_sequence);
+ ! final_sequence, insn);
}"
[(set_attr "type" "branch")])
-;; Esoteric move insns (lo_sum, high, pic).
-
-(define_insn "*lo_sum_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "immediate_operand" "in")))]
- ""
- ;; V9 needs "add" because of the code models. We still use "or" for v8
- ;; so we can compare the old compiler with the new.
- "* return TARGET_ARCH64 ? \"add %1,%%lo(%a2),%0\" : \"or %1,%%lo(%a2),%0\";"
- ;; Need to set length for this arith insn because operand2
- ;; is not an "arith_operand".
- [(set_attr "length" "1")])
-
-;; For PIC, symbol_refs are put inside unspec so that the optimizer will not
-;; confuse them with real addresses.
-(define_insn "pic_lo_sum_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
- (unspec:SI [(match_operand:SI 2 "immediate_operand" "in")] 0)))]
- "flag_pic"
- ;; V9 needs "add" because of the code models. We still use "or" for v8
- ;; so we can compare the old compiler with the new.
- "* return TARGET_ARCH64 ? \"add %1,%%lo(%a2),%0\" : \"or %1,%%lo(%a2),%0\";"
- ;; Need to set length for this arith insn because operand2
- ;; is not an "arith_operand".
- [(set_attr "length" "1")])
-
-;; The PIC version of sethi must appear before the non-pic case so that
-;; the unspec will not be matched as part of the operand.
-;; For PIC, symbol_refs are put inside unspec so that the optimizer will not
-;; confuse them with real addresses.
-(define_insn "pic_sethi_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (high:SI (unspec:SI [(match_operand 1 "" "")] 0)))]
- "flag_pic && check_pic (1)"
- "sethi %%hi(%a1),%0"
- [(set_attr "type" "move")
- (set_attr "length" "1")])
-
-(define_insn "pic_lo_sum_di"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (lo_sum:SI (match_operand:DI 1 "register_operand" "r")
- (unspec:SI [(match_operand:DI 2 "immediate_operand" "in")] 0)))]
- "TARGET_ARCH64 && flag_pic"
- "add %1,%%lo(%a2),%0"
- [(set_attr "length" "1")])
-
-(define_insn "pic_sethi_di"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:SI (unspec:SI [(match_operand 1 "" "")] 0)))]
- "TARGET_ARCH64 && flag_pic && check_pic (1)"
- "sethi %%hi(%a1),%0"
- [(set_attr "type" "move")
- (set_attr "length" "1")])
+;; Load program counter insns.
(define_insn "get_pc"
[(clobber (reg:SI 15))
(set (match_operand 0 "register_operand" "=r")
(unspec [(match_operand 1 "" "") (match_operand 2 "" "")] 2))]
"flag_pic && REGNO (operands[0]) == 23"
- "sethi %%hi(%a1-4),%0\;call %a2\;add %0,%%lo(%a1+4),%0"
+ "sethi\\t%%hi(%a1-4), %0\\n\\tcall\\t%a2\\n\\tadd\\t%0, %%lo(%a1+4), %0"
[(set_attr "length" "3")])
-(define_insn "get_pc_via_rdpc"
- [(set (match_operand 0 "register_operand" "=r") (pc))]
- "TARGET_V9"
- "rd %%pc,%0"
- [(set_attr "type" "move")])
+;; Currently unused...
+;; (define_insn "get_pc_via_rdpc"
+;; [(set (match_operand 0 "register_operand" "=r") (pc))]
+;; "TARGET_V9"
+;; "rd\\t%%pc, %0"
+;; [(set_attr "type" "move")])
-;; Special pic pattern, for loading the address of a label into a register.
-;; It clobbers o7 because the call puts the return address (i.e. pc value)
-;; there. The pic tablejump pattern also uses this.
+
+;; Move instructions
-(define_insn "move_pic_label_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- ; This was previously (label_ref:SI (match_operand 1 "" "")) but that
- ; loses the volatil and other flags of the original label_ref.
- (match_operand:SI 1 "label_ref_operand" ""))
- (set (reg:SI 15) (pc))]
- "flag_pic"
- "*
+(define_expand "movqi"
+ [(set (match_operand:QI 0 "general_operand" "")
+ (match_operand:QI 1 "general_operand" ""))]
+ ""
+ "
{
- if (get_attr_length (insn) == 2)
- return \"\\n1:\;call 2f\;add %%o7,%%lo(%l1-1b),%0\\n2:\";
- else
- return \"\\n1:\;call 2f\;sethi %%hi(%l1-1b),%0\\n2:\\tor %0,%%lo(%l1-1b),%0\;add %0,%%o7,%0\";
-}"
- [(set_attr "type" "multi")
- ; 960 = 4096 bytes / 4 bytes/insn - 64 (for not always perfect length calcs)
- (set (attr "length") (if_then_else (ltu (minus (match_dup 1) (pc))
- (const_int 960))
- (const_int 2)
- (const_int 4)))])
-
-;; Special sparc64 pattern for loading the address of a label into a register.
-;; The pic and non-pic cases are the same since it's the most efficient way.
-;;
-;; ??? The non-pic case doesn't need to use %o7, we could use a scratch
-;; instead. But the pic case doesn't need to use %o7 either. We handle them
-;; both here so that when this is fixed, they can both be fixed together.
-;; Don't forget that the pic jump table stuff uses %o7 (that will need to be
-;; changed too).
+ /* Working with CONST_INTs is easier, so convert
+ a double if needed. */
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ {
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xff);
+ }
+ else if (GET_CODE (operands[1]) == CONST_INT)
+ {
+ /* And further, we know for all QI cases that only the
+ low byte is significant, which we can always process
+ in a single insn. So mask it now. */
+ operands[1] = GEN_INT (INTVAL (operands[1]) & 0xff);
+ }
-(define_insn "move_label_di"
- [(set (match_operand:DI 0 "register_operand" "=r")
- ; This was previously (label_ref:DI (match_operand 1 "" "")) but that
- ; loses the volatil and other flags of the original label_ref.
- (match_operand:DI 1 "label_ref_operand" ""))
- (set (reg:DI 15) (pc))]
- "TARGET_ARCH64"
- "*
-{
- if (get_attr_length (insn) == 2)
- return \"\\n1:\;rd %%pc,%%o7\;add %%o7,%l1-1b,%0\";
- else
- return \"\\n1:\;rd %%pc,%%o7\;sethi %%hi(%l1-1b),%0\;add %0,%%lo(%l1-1b),%0\;sra %0,0,%0\;add %0,%%o7,%0\";
-}"
- [(set_attr "type" "multi")
- ; 960 = 4096 bytes / 4 bytes/insn - 64 (for not always perfect length calcs)
- (set (attr "length") (if_then_else (ltu (minus (match_dup 1) (pc))
- (const_int 960))
- (const_int 2)
- (const_int 5)))])
+ /* Handle sets of MEM first. */
+ if (GET_CODE (operands[0]) == MEM)
+ {
+ /* This checks TARGET_LIVE_G0 for us. */
+ if (reg_or_0_operand (operands[1], QImode))
+ goto movqi_is_ok;
-(define_insn "*sethi_hi"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (high:HI (match_operand 1 "" "")))]
- "check_pic (1)"
- "sethi %%hi(%a1),%0"
- [(set_attr "type" "move")
- (set_attr "length" "1")])
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (QImode, operands[1]);
+ }
+ }
-;; This must appear after the PIC sethi so that the PIC unspec will not
-;; be matched as part of the operand.
-(define_insn "*sethi_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (high:SI (match_operand 1 "" "")))]
- "check_pic (1)"
- "sethi %%hi(%a1),%0"
- [(set_attr "type" "move")
- (set_attr "length" "1")])
+ /* Fixup PIC cases. */
+ if (flag_pic)
+ {
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], QImode, 0);
-(define_insn "*lo_sum_di_sp32"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (lo_sum:DI (match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "immediate_operand" "in")))]
- "! TARGET_ARCH64"
- "*
-{
- /* Don't output a 64 bit constant, since we can't trust the assembler to
- handle it correctly. */
- if (GET_CODE (operands[2]) == CONST_DOUBLE)
- operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
- else if (GET_CODE (operands[2]) == CONST_INT
- && HOST_BITS_PER_WIDE_INT > 32
- && INTVAL (operands[2]) > 0xffffffff)
- operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffffffff);
+ if (symbolic_operand (operands[1], QImode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ QImode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ goto movqi_is_ok;
+ }
+ }
- return \"or %L1,%%lo(%a2),%L0\";
-}"
- ;; Need to set length for this arith insn because operand2
- ;; is not an "arith_operand".
- [(set_attr "length" "1")])
+ /* All QI constants require only one insn, so proceed. */
-;; ??? Optimizer does not handle "or %o1,%lo(0),%o1". How about add?
+ movqi_is_ok:
+ ;
+}")
-(define_insn "*lo_sum_di_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (lo_sum:DI (match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "immediate_operand" "in")))]
- "TARGET_ARCH64"
- "*
-{
- /* Don't output a 64 bit constant, since we can't trust the assembler to
- handle it correctly. */
- if (GET_CODE (operands[2]) == CONST_DOUBLE)
- operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
- else if (GET_CODE (operands[2]) == CONST_INT
- && HOST_BITS_PER_WIDE_INT > 32
- && INTVAL (operands[2]) > 0xffffffff)
- operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffffffff);
-
- /* Note that we use add here. This is important because Medium/Anywhere
- code model support depends on it. */
- return \"add %1,%%lo(%a2),%0\";
-}"
- ;; Need to set length for this arith insn because operand2
- ;; is not an "arith_operand".
- [(set_attr "length" "1")])
+(define_insn "*movqi_insn"
+ [(set (match_operand:QI 0 "general_operand" "=r,r,m")
+ (match_operand:QI 1 "input_operand" "rI,m,rJ"))]
+ "(register_operand (operands[0], QImode)
+ || reg_or_0_operand (operands[1], QImode))"
+ "@
+ mov\\t%1, %0
+ ldub\\t%1, %0
+ stb\\t%r1, %0"
+ [(set_attr "type" "move,load,store")
+ (set_attr "length" "1")])
-(define_insn "*sethi_di_sp32"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "" "")))]
- "! TARGET_ARCH64 && check_pic (1)"
- "*
+(define_expand "movhi"
+ [(set (match_operand:HI 0 "general_operand" "")
+ (match_operand:HI 1 "general_operand" ""))]
+ ""
+ "
{
- rtx op0 = operands[0];
- rtx op1 = operands[1];
+ /* Working with CONST_INTs is easier, so convert
+ a double if needed. */
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
- if (GET_CODE (op1) == CONST_INT)
+ /* Handle sets of MEM first. */
+ if (GET_CODE (operands[0]) == MEM)
{
- operands[0] = operand_subword (op0, 1, 0, DImode);
- output_asm_insn (\"sethi %%hi(%a1),%0\", operands);
+ /* This checks TARGET_LIVE_G0 for us. */
+ if (reg_or_0_operand (operands[1], HImode))
+ goto movhi_is_ok;
- operands[0] = operand_subword (op0, 0, 0, DImode);
- if (INTVAL (op1) < 0)
- return \"mov -1,%0\";
- else
- return \"mov 0,%0\";
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (HImode, operands[1]);
+ }
}
- else if (GET_CODE (op1) == CONST_DOUBLE)
+
+ /* Fixup PIC cases. */
+ if (flag_pic)
{
- operands[0] = operand_subword (op0, 1, 0, DImode);
- operands[1] = GEN_INT (CONST_DOUBLE_LOW (op1));
- output_asm_insn (\"sethi %%hi(%a1),%0\", operands);
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], HImode, 0);
- operands[0] = operand_subword (op0, 0, 0, DImode);
- operands[1] = GEN_INT (CONST_DOUBLE_HIGH (op1));
- return singlemove_string (operands);
+ if (symbolic_operand (operands[1], HImode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ HImode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ goto movhi_is_ok;
+ }
}
- else
- abort ();
- return \"\";
-}"
- [(set_attr "type" "move")
- (set_attr "length" "2")])
-;;; ??? This pattern originally clobbered a scratch register. However, this
-;;; is invalid, the movdi pattern may not use a temp register because it
-;;; may be called from reload to reload a DImode value. In that case, we
-;;; end up with a scratch register that never gets allocated. To avoid this,
-;;; we use global register 1 which is never otherwise used by gcc as a temp.
-;;; The correct solution here might be to force DImode constants to memory,
-;;; e.g. by using a toc like the romp and rs6000 ports do for addresses, reg
-;;; 1 will then no longer need to be considered a fixed reg.
-
-(define_expand "sethi_di_sp64"
- [(parallel
- [(set (match_operand:DI 0 "register_operand" "")
- (high:DI (match_operand 1 "general_operand" "")))
- (clobber (reg:DI 1))])]
+ /* This makes sure we will not get rematched due to splittage. */
+ if (! CONSTANT_P (operands[1]) || input_operand (operands[1], HImode))
+ ;
+ else if (CONSTANT_P (operands[1])
+ && GET_CODE (operands[1]) != HIGH
+ && GET_CODE (operands[1]) != LO_SUM)
+ {
+ sparc_emit_set_const32 (operands[0], operands[1]);
+ DONE;
+ }
+ movhi_is_ok:
+ ;
+}")
+
+(define_insn "*movhi_const64_special"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (match_operand:HI 1 "const64_high_operand" ""))]
"TARGET_ARCH64"
- "")
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
-(define_insn "*sethi_di_sp64_const"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "const_double_operand" "")))
- (clobber (reg:DI 1))]
- "TARGET_ARCH64 && check_pic (1)"
- "*
+(define_insn "*movhi_insn"
+ [(set (match_operand:HI 0 "general_operand" "=r,r,r,m")
+ (match_operand:HI 1 "input_operand" "rI,K,m,rJ"))]
+ "(register_operand (operands[0], HImode)
+ || reg_or_0_operand (operands[1], HImode))"
+ "@
+ mov\\t%1, %0
+ sethi\\t%%hi(%a1), %0
+ lduh\\t%1, %0
+ sth\\t%r1, %0"
+ [(set_attr "type" "move,move,load,store")
+ (set_attr "length" "1")])
+
+;; We always work with constants here.
+(define_insn "*movhi_lo_sum"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (ior:HI (match_operand:HI 1 "arith_operand" "%r")
+ (match_operand:HI 2 "arith_operand" "I")))]
+ ""
+ "or\\t%1, %2, %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_expand "movsi"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (match_operand:SI 1 "general_operand" ""))]
+ ""
+ "
{
-#if HOST_BITS_PER_WIDE_INT == 32
- rtx high, low;
-
- split_double (operands[1], &high, &low);
+ /* Working with CONST_INTs is easier, so convert
+ a double if needed. */
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
- if (high == const0_rtx)
+ /* Handle sets of MEM first. */
+ if (GET_CODE (operands[0]) == MEM)
{
- operands[1] = low;
- output_asm_insn (\"sethi %%hi(%a1),%0\", operands);
- }
- else
- {
- operands[1] = high;
- output_asm_insn (singlemove_string (operands), operands);
+ /* This checks TARGET_LIVE_G0 for us. */
+ if (reg_or_0_operand (operands[1], SImode))
+ goto movsi_is_ok;
- operands[1] = low;
- output_asm_insn (\"sllx %0,32,%0\", operands);
- if (low != const0_rtx)
- output_asm_insn (\"sethi %%hi(%a1),%%g1; or %0,%%g1,%0\", operands);
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (SImode, operands[1]);
+ }
}
-#else
- rtx op = operands[1];
- if (! SPARC_SETHI_P (INTVAL(op)))
+ /* Fixup PIC cases. */
+ if (flag_pic)
{
- operands[1] = GEN_INT (INTVAL (op) >> 32);
- output_asm_insn (singlemove_string (operands), operands);
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], SImode, 0);
- output_asm_insn (\"sllx %0,32,%0\", operands);
- if (INTVAL (op) & 0xffffffff)
+ if (GET_CODE (operands[1]) == LABEL_REF)
{
- operands[1] = GEN_INT (INTVAL (op) & 0xffffffff);
- output_asm_insn (\"sethi %%hi(%a1),%%g1; or %0,%%g1,%0\", operands);
+ /* shit */
+ emit_insn (gen_movsi_pic_label_ref (operands[0], operands[1]));
+ DONE;
+ }
+
+ if (symbolic_operand (operands[1], SImode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ SImode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ goto movsi_is_ok;
}
}
- else
+
+ /* If we are trying to toss an integer constant into the
+ FPU registers, force it into memory. */
+ if (GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) >= SPARC_FIRST_FP_REG
+ && REGNO (operands[0]) <= SPARC_LAST_V9_FP_REG
+ && CONSTANT_P (operands[1]))
+ operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
+ operands[1]));
+
+ /* This makes sure we will not get rematched due to splittage. */
+ if (! CONSTANT_P (operands[1]) || input_operand (operands[1], SImode))
+ ;
+ else if (CONSTANT_P (operands[1])
+ && GET_CODE (operands[1]) != HIGH
+ && GET_CODE (operands[1]) != LO_SUM)
{
- output_asm_insn (\"sethi %%hi(%a1),%0\", operands);
+ sparc_emit_set_const32 (operands[0], operands[1]);
+ DONE;
}
-#endif
+ movsi_is_ok:
+ ;
+}")
- return \"\";
-}"
- [(set_attr "type" "move")
- (set_attr "length" "5")])
-
-;; Most of the required support for the various code models is here.
-;; We can do this because sparcs need the high insn to load the address. We
-;; just need to get high to do the right thing for each code model. Then each
-;; uses the same "%X+%lo(...)" in the load/store insn, though in the case of
-;; the medium/middle code model "%lo" is written "%l44".
-
-;; When TARGET_CM_MEDLOW, assume that the upper 32 bits of symbol addresses are
-;; always 0.
-;; When TARGET_CM_MEDMID, the executable must be in the low 16 TB of memory.
-;; This corresponds to the low 44 bits, and the %[hml]44 relocs are used.
-;; ??? Not implemented yet.
-;; When TARGET_CM_EMBMEDANY, the text and data segments have a maximum size of
-;; 31 bits and may be located anywhere. EMBMEDANY_BASE_REG contains the start
-;; address of the data segment, currently %g4.
-;; When TARGET_CM_MEDANY, the text and data segments have a maximum size of 31
-;; bits and may be located anywhere. The maximum offset from any instruction
-;; to the label _GLOBAL_OFFSET_TABLE_ is 31 bits.
+;; Special LIVE_G0 pattern to obtain zero in a register.
+(define_insn "*movsi_zero_liveg0"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (match_operand:SI 1 "zero_operand" "J"))]
+ "TARGET_LIVE_G0"
+ "and\\t%0, 0, %0"
+ [(set_attr "type" "binary")
+ (set_attr "length" "1")])
-(define_insn "*sethi_di_medlow"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "" "")))
- ;; The clobber is here because emit_move_sequence assumes the worst case.
- (clobber (reg:DI 1))]
- "TARGET_CM_MEDLOW && check_pic (1)"
- "sethi %%hi(%a1),%0"
+;; This is needed to show CSE exactly which bits are set
+;; in a 64-bit register by sethi instructions.
+(define_insn "*movsi_const64_special"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (match_operand:SI 1 "const64_high_operand" ""))]
+ "TARGET_ARCH64"
+ "sethi\\t%%hi(%a1), %0"
[(set_attr "type" "move")
(set_attr "length" "1")])
-(define_insn "*sethi_di_medium_pic"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "sp64_medium_pic_operand" "")))]
- "(TARGET_CM_MEDLOW || TARGET_CM_EMBMEDANY) && check_pic (1)"
- "sethi %%hi(%a1),%0"
+(define_insn "*movsi_insn"
+ [(set (match_operand:SI 0 "general_operand" "=r,f,r,r,r,f,m,m,d")
+ (match_operand:SI 1 "input_operand" "rI,!f,K,J,m,!m,rJ,!f,J"))]
+ "(register_operand (operands[0], SImode)
+ || reg_or_0_operand (operands[1], SImode))"
+ "@
+ mov\\t%1, %0
+ fmovs\\t%1, %0
+ sethi\\t%%hi(%a1), %0
+ clr\\t%0
+ ld\\t%1, %0
+ ld\\t%1, %0
+ st\\t%r1, %0
+ st\\t%1, %0
+ fzeros\\t%0"
+ [(set_attr "type" "move,fpmove,move,move,load,fpload,store,fpstore,fpmove")
+ (set_attr "length" "1")])
+
+(define_insn "*movsi_lo_sum"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "immediate_operand" "in")))]
+ ""
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "*movsi_high"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (match_operand:SI 1 "immediate_operand" "in")))]
+ ""
+ "sethi\\t%%hi(%a1), %0"
[(set_attr "type" "move")
(set_attr "length" "1")])
-;; WARNING: %0 gets %hi(%1)+%g4.
-;; You cannot OR in %lo(%1), it must be added in.
+;; The next two patterns must wrap the SYMBOL_REF in an UNSPEC
+;; so that CSE won't optimize the address computation away.
+(define_insn "movsi_lo_sum_pic"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:SI 2 "immediate_operand" "in")] 0)))]
+ "flag_pic"
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
-(define_insn "*sethi_di_embmedany_data"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "data_segment_operand" "")))
- ;; The clobber is here because emit_move_sequence assumes the worst case.
- (clobber (reg:DI 1))]
- "TARGET_CM_EMBMEDANY && check_pic (1)"
- "sethi %%hi(%a1),%0; add %0,%_,%0"
+(define_insn "movsi_high_pic"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(match_operand 1 "" "")] 0)))]
+ "flag_pic && check_pic (1)"
+ "sethi\\t%%hi(%a1), %0"
[(set_attr "type" "move")
- (set_attr "length" "2")])
+ (set_attr "length" "1")])
-(define_insn "*sethi_di_embmedany_text"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (high:DI (match_operand 1 "text_segment_operand" "")))
- ;; The clobber is here because emit_move_sequence assumes the worst case.
- (clobber (reg:DI 1))]
- "TARGET_CM_EMBMEDANY && check_pic (1)"
- "sethi %%uhi(%a1),%%g1; or %%g1,%%ulo(%a1),%%g1; sllx %%g1,32,%%g1; sethi %%hi(%a1),%0; or %0,%%g1,%0"
+(define_expand "movsi_pic_label_ref"
+ [(set (match_dup 3) (high:SI
+ (unspec:SI [(match_operand:SI 1 "label_ref_operand" "")
+ (match_dup 2)] 5)))
+ (set (match_dup 4) (lo_sum:SI (match_dup 3)
+ (unspec:SI [(match_dup 1) (match_dup 2)] 5)))
+ (set (match_operand:SI 0 "register_operand" "=r")
+ (minus:SI (match_dup 5) (match_dup 4)))]
+ "flag_pic"
+ "
+{
+ current_function_uses_pic_offset_table = 1;
+ operands[2] = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
+ operands[3] = gen_reg_rtx (SImode);
+ operands[4] = gen_reg_rtx (SImode);
+ operands[5] = pic_offset_table_rtx;
+}")
+
+(define_insn "*movsi_high_pic_label_ref"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI
+ (unspec:SI [(match_operand:SI 1 "label_ref_operand" "")
+ (match_operand:SI 2 "" "")] 5)))]
+ "flag_pic"
+ "sethi\\t%%hi(%a2-(%a1-.)), %0"
[(set_attr "type" "move")
- (set_attr "length" "5")])
-
-;; Move instructions
+ (set_attr "length" "1")])
-(define_expand "movqi"
- [(set (match_operand:QI 0 "general_operand" "")
- (match_operand:QI 1 "general_operand" ""))]
+(define_insn "*movsi_lo_sum_pic_label_ref"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:SI 2 "label_ref_operand" "")
+ (match_operand:SI 3 "" "")] 5)))]
+ "flag_pic"
+ "or\\t%1, %%lo(%a3-(%a2-.)), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_expand "movdi"
+ [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "")
+ (match_operand:DI 1 "general_operand" ""))]
""
"
{
- if (emit_move_sequence (operands, QImode))
- DONE;
+ /* Where possible, convert CONST_DOUBLE into a CONST_INT. */
+ if (GET_CODE (operands[1]) == CONST_DOUBLE
+#if HOST_BITS_PER_WIDE_INT != 64
+ && ((CONST_DOUBLE_HIGH (operands[1]) == 0
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0)
+ || (CONST_DOUBLE_HIGH (operands[1]) == 0xffffffff
+ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0))
+#endif
+ )
+ operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+
+ /* Handle MEM cases first. */
+ if (GET_CODE (operands[0]) == MEM)
+ {
+ /* If it's a REG, we can always do it.
+ The const zero case is more complex, on v9
+ we can always perform it. */
+ if (register_operand (operands[1], DImode)
+ || (TARGET_ARCH64
+ && (operands[1] == const0_rtx)))
+ goto movdi_is_ok;
+
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (DImode, operands[1]);
+ }
+ }
+
+ if (flag_pic)
+ {
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], DImode, 0);
+
+ if (GET_CODE (operands[1]) == LABEL_REF)
+ {
+ if (! TARGET_ARCH64)
+ abort ();
+ emit_insn (gen_movdi_pic_label_ref (operands[0], operands[1]));
+ DONE;
+ }
+
+ if (symbolic_operand (operands[1], DImode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ DImode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ goto movdi_is_ok;
+ }
+ }
+
+ /* If we are trying to toss an integer constant into the
+ FPU registers, force it into memory. */
+ if (GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) >= SPARC_FIRST_FP_REG
+ && REGNO (operands[0]) <= SPARC_LAST_V9_FP_REG
+ && CONSTANT_P (operands[1]))
+ operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
+ operands[1]));
+
+ /* This makes sure we will not get rematched due to splittage. */
+ if (! CONSTANT_P (operands[1]) || input_operand (operands[1], DImode))
+ ;
+ else if (TARGET_ARCH64
+ && CONSTANT_P (operands[1])
+ && GET_CODE (operands[1]) != HIGH
+ && GET_CODE (operands[1]) != LO_SUM)
+ {
+ sparc_emit_set_const64 (operands[0], operands[1]);
+ DONE;
+ }
+
+ movdi_is_ok:
+ ;
}")
-(define_insn "*movqi_insn"
- [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,Q")
- (match_operand:QI 1 "move_operand" "rI,K,Q,rJ"))]
- "! TARGET_LIVE_G0
- && (register_operand (operands[0], QImode)
- || register_operand (operands[1], QImode)
- || operands[1] == const0_rtx)"
+;; Be careful, fmovd does not exist when !arch64.
+;; We match MEM moves directly when we have correct even
+;; numbered registers, but fall into splits otherwise.
+;; The constraint ordering here is really important to
+;; avoid insane problems in reload, especially for patterns
+;; of the form:
+;;
+;; (set (mem:DI (plus:SI (reg:SI 30 %fp)
+;; (const_int -5016)))
+;; (reg:DI 2 %g2))
+;;
+(define_insn "*movdi_insn_sp32"
+ [(set (match_operand:DI 0 "general_operand" "=T,U,o,r,r,r,?T,?f,?f,?o,?f")
+ (match_operand:DI 1 "input_operand" "U,T,r,o,i,r,f,T,o,f,f"))]
+ "! TARGET_ARCH64 &&
+ (register_operand (operands[0], DImode)
+ || register_operand (operands[1], DImode))"
"@
- mov %1,%0
- sethi %%hi(%a1),%0
- ldub %1,%0
- stb %r1,%0"
- [(set_attr "type" "move,move,load,store")
+ std\\t%1, %0
+ ldd\\t%1, %0
+ #
+ #
+ #
+ #
+ std\\t%1, %0
+ ldd\\t%1, %0
+ #
+ #
+ #"
+ [(set_attr "type" "store,load,*,*,*,*,fpstore,fpload,*,*,*")
+ (set_attr "length" "1,1,2,2,2,2,1,1,2,2,2")])
+
+;; The following are generated by sparc_emit_set_const64
+(define_insn "*movdi_sp64_dbl"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (match_operand:DI 1 "const64_operand" ""))]
+ "(TARGET_ARCH64
+ && HOST_BITS_PER_WIDE_INT != 64)"
+ "mov\\t%1, %0"
+ [(set_attr "type" "move")
(set_attr "length" "1")])
-(define_insn "*movqi_insn_liveg0"
- [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q")
- (match_operand:QI 1 "move_operand" "r,J,I,K,Q,r"))]
- "TARGET_LIVE_G0
- && (register_operand (operands[0], QImode)
- || register_operand (operands[1], QImode))"
- "@
- mov %1,%0
- and %0,0,%0
- and %0,0,%0\;or %0,%1,%0
- sethi %%hi(%a1),%0
- ldub %1,%0
- stb %1,%0"
- [(set_attr "type" "move,move,move,move,load,store")
- (set_attr "length" "1,1,2,1,1,1")])
-
-(define_insn "*lo_sum_qi"
- [(set (match_operand:QI 0 "register_operand" "=r")
- (subreg:QI (lo_sum:SI (match_operand:QI 1 "register_operand" "r")
- (match_operand 2 "immediate_operand" "in")) 0))]
- ""
- "or %1,%%lo(%a2),%0"
- [(set_attr "length" "1")])
+;; This is needed to show CSE exactly which bits are set
+;; in a 64-bit register by sethi instructions.
+(define_insn "*movdi_const64_special"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (match_operand:DI 1 "const64_high_operand" ""))]
+ "TARGET_ARCH64"
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
-(define_insn "*store_qi"
- [(set (mem:QI (match_operand:SI 0 "symbolic_operand" ""))
- (match_operand:QI 1 "reg_or_0_operand" "rJ"))
- (clobber (match_scratch:SI 2 "=&r"))]
- "(reload_completed || reload_in_progress)
- && ! TARGET_PTR64"
- "sethi %%hi(%a0),%2\;stb %r1,[%2+%%lo(%a0)]"
- [(set_attr "type" "store")
- (set_attr "length" "2")])
+(define_insn "*movdi_insn_sp64"
+ [(set (match_operand:DI 0 "general_operand" "=r,r,r,r,m,?e,?e,?m,b")
+ (match_operand:DI 1 "input_operand" "rI,K,J,m,rJ,e,m,e,J"))]
+ "TARGET_ARCH64 &&
+ (register_operand (operands[0], DImode)
+ || reg_or_0_operand (operands[1], DImode))"
+ "@
+ mov\\t%1, %0
+ sethi\\t%%hi(%a1), %0
+ clr\\t%0
+ ldx\\t%1, %0
+ stx\\t%r1, %0
+ fmovd\\t%1, %0
+ ldd\\t%1, %0
+ std\\t%1, %0
+ fzero\\t%0"
+ [(set_attr "type" "move,move,move,load,store,fpmove,fpload,fpstore,fpmove")
+ (set_attr "length" "1")])
-(define_expand "movhi"
- [(set (match_operand:HI 0 "general_operand" "")
- (match_operand:HI 1 "general_operand" ""))]
- ""
+(define_expand "movdi_pic_label_ref"
+ [(set (match_dup 3) (high:DI
+ (unspec:DI [(match_operand:DI 1 "label_ref_operand" "")
+ (match_dup 2)] 5)))
+ (set (match_dup 4) (lo_sum:DI (match_dup 3)
+ (unspec:DI [(match_dup 1) (match_dup 2)] 5)))
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (minus:DI (match_dup 5) (match_dup 4)))]
+ "TARGET_ARCH64 && flag_pic"
"
{
- if (emit_move_sequence (operands, HImode))
- DONE;
+ current_function_uses_pic_offset_table = 1;
+ operands[2] = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
+ operands[3] = gen_reg_rtx (DImode);
+ operands[4] = gen_reg_rtx (DImode);
+ operands[5] = pic_offset_table_rtx;
}")
-(define_insn "*movhi_insn"
- [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,Q")
- (match_operand:HI 1 "move_operand" "rI,K,Q,rJ"))]
- "! TARGET_LIVE_G0
- && (register_operand (operands[0], HImode)
- || register_operand (operands[1], HImode)
- || operands[1] == const0_rtx)"
- "@
- mov %1,%0
- sethi %%hi(%a1),%0
- lduh %1,%0
- sth %r1,%0"
- [(set_attr "type" "move,move,load,store")
+(define_insn "*movdi_high_pic_label_ref"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI
+ (unspec:DI [(match_operand:DI 1 "label_ref_operand" "")
+ (match_operand:DI 2 "" "")] 5)))]
+ "TARGET_ARCH64 && flag_pic"
+ "sethi\\t%%hi(%a2-(%a1-.)), %0"
+ [(set_attr "type" "move")
(set_attr "length" "1")])
-(define_insn "*movhi_insn_liveg0"
- [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q")
- (match_operand:HI 1 "move_operand" "r,J,I,K,Q,r"))]
- "TARGET_LIVE_G0
- && (register_operand (operands[0], HImode)
- || register_operand (operands[1], HImode))"
- "@
- mov %1,%0
- and %0,0,%0
- and %0,0,%0\;or %0,%1,%0
- sethi %%hi(%a1),%0
- lduh %1,%0
- sth %1,%0"
- [(set_attr "type" "move,move,move,move,load,store")
- (set_attr "length" "1,1,2,1,1,1")])
-
-(define_insn "*lo_sum_hi"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (lo_sum:HI (match_operand:HI 1 "register_operand" "r")
- (match_operand 2 "immediate_operand" "in")))]
- ""
- "or %1,%%lo(%a2),%0"
+(define_insn "*movdi_lo_sum_pic_label_ref"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:DI 2 "label_ref_operand" "")
+ (match_operand:DI 3 "" "")] 5)))]
+ "TARGET_ARCH64 && flag_pic"
+ "or\\t%1, %%lo(%a3-(%a2-.)), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+;; Sparc-v9 code model support insns. See sparc_emit_set_symbolic_const64
+;; in sparc.c to see what is going on here... PIC stuff comes first.
+
+(define_insn "movdi_lo_sum_pic"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:DI 2 "immediate_operand" "in")] 0)))]
+ "TARGET_ARCH64 && flag_pic"
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "movdi_high_pic"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand 1 "" "")] 0)))]
+ "TARGET_ARCH64 && flag_pic && check_pic (1)"
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "*sethi_di_medlow_embmedany_pic"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (match_operand:DI 1 "sp64_medium_pic_operand" "")))]
+ "(TARGET_CM_MEDLOW || TARGET_CM_EMBMEDANY) && check_pic (1)"
+ "sethi\\t%%lo(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "*sethi_di_medlow"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (match_operand:DI 1 "symbolic_operand" "")))]
+ "TARGET_CM_MEDLOW && check_pic (1)"
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "*losum_di_medlow"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "symbolic_operand" "")))]
+ "TARGET_CM_MEDLOW"
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "seth44"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] 6)))]
+ "TARGET_CM_MEDMID"
+ "sethi\\t%%h44(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "setm44"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] 7)))]
+ "TARGET_CM_MEDMID"
+ "or\\t%1, %%m44(%a2), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "setl44"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "symbolic_operand" "")))]
+ "TARGET_CM_MEDMID"
+ "or\\t%1, %%l44(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "sethh"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] 9)))]
+ "TARGET_CM_MEDANY"
+ "sethi\\t%%hh(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "setlm"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] 10)))]
+ "TARGET_CM_MEDANY"
+ "sethi\\t%%lm(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "sethm"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] 18)))]
+ "TARGET_CM_MEDANY"
+ "or\\t%1, %%hm(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "setlo"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "symbolic_operand" "")))]
+ "TARGET_CM_MEDANY"
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "embmedany_sethi"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand:DI 1 "data_segment_operand" "")] 11)))]
+ "TARGET_CM_EMBMEDANY && check_pic (1)"
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "embmedany_losum"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "data_segment_operand" "")))]
+ "TARGET_CM_EMBMEDANY"
+ "add\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "embmedany_brsum"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec:DI [(match_operand:DI 1 "register_operand" "r")] 11))]
+ "TARGET_CM_EMBMEDANY"
+ "add\\t%1, %_, %0"
[(set_attr "length" "1")])
-(define_insn "*store_hi"
- [(set (mem:HI (match_operand:SI 0 "symbolic_operand" ""))
- (match_operand:HI 1 "reg_or_0_operand" "rJ"))
- (clobber (match_scratch:SI 2 "=&r"))]
- "(reload_completed || reload_in_progress)
- && ! TARGET_PTR64"
- "sethi %%hi(%a0),%2\;sth %r1,[%2+%%lo(%a0)]"
- [(set_attr "type" "store")
- (set_attr "length" "2")])
+(define_insn "embmedany_textuhi"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand:DI 1 "text_segment_operand" "")] 13)))]
+ "TARGET_CM_EMBMEDANY && check_pic (1)"
+ "sethi\\t%%uhi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
-(define_expand "movsi"
- [(set (match_operand:SI 0 "general_operand" "")
- (match_operand:SI 1 "general_operand" ""))]
- ""
+(define_insn "embmedany_texthi"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:DI (unspec:DI [(match_operand:DI 1 "text_segment_operand" "")] 14)))]
+ "TARGET_CM_EMBMEDANY && check_pic (1)"
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "embmedany_textulo"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (unspec:DI [(match_operand:DI 2 "text_segment_operand" "")] 15)))]
+ "TARGET_CM_EMBMEDANY"
+ "or\\t%1, %%ulo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+(define_insn "embmedany_textlo"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "text_segment_operand" "")))]
+ "TARGET_CM_EMBMEDANY"
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
+
+;; Now some patterns to help reload out a bit.
+(define_expand "reload_indi"
+ [(parallel [(match_operand:DI 0 "register_operand" "=r")
+ (match_operand:DI 1 "immediate_operand" "")
+ (match_operand:TI 2 "register_operand" "=&r")])]
+ "(TARGET_CM_MEDANY
+ || TARGET_CM_EMBMEDANY)
+ && ! flag_pic"
"
{
- if (emit_move_sequence (operands, SImode))
- DONE;
+ sparc_emit_set_symbolic_const64 (operands[0], operands[1],
+ gen_rtx_REG (DImode, REGNO (operands[2])));
+ DONE;
}")
-;; We must support both 'r' and 'f' registers here, because combine may
-;; convert SFmode hard registers to SImode hard registers when simplifying
-;; subreg sets.
-
-;; We cannot combine the similar 'r' and 'f' constraints, because it causes
-;; problems with register allocation. Reload might try to put an integer
-;; in an fp register, or an fp number is an integer register.
-
-(define_insn "*movsi_insn"
- [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand" "=r,f,r,r,f,Q,Q,d")
- (match_operand:SI 1 "move_operand" "rI,!f,K,Q,!Q,rJ,!f,J"))]
- "! TARGET_LIVE_G0
- && (register_operand (operands[0], SImode)
- || register_operand (operands[1], SImode)
- || operands[1] == const0_rtx)
- && (GET_CODE (operands[0]) != REG || ! CONSTANT_P (operands[1])
- || REGNO (operands[0]) < 32
- || REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)"
- "@
- mov %1,%0
- fmovs %1,%0
- sethi %%hi(%a1),%0
- ld %1,%0
- ld %1,%0
- st %r1,%0
- st %1,%0
- fzeros %0"
- [(set_attr "type" "move,fpmove,move,load,fpload,store,fpstore,fpmove")
- (set_attr "length" "1")])
-
-(define_insn "*movsi_insn_liveg0"
- [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,f,r,r,f,Q,Q")
- (match_operand:SI 1 "move_operand" "r,J,I,!f,K,Q,!Q,r,!f"))]
- "TARGET_LIVE_G0
- && (register_operand (operands[0], SImode)
- || register_operand (operands[1], SImode))"
- "@
- mov %1,%0
- and %0,0,%0
- and %0,0,%0\;or %0,%1,%0
- fmovs %1,%0
- sethi %%hi(%a1),%0
- ld %1,%0
- ld %1,%0
- st %1,%0
- st %1,%0"
- [(set_attr "type" "move,move,move,fpmove,move,load,fpload,store,fpstore")
- (set_attr "length" "1,1,2,1,1,1,1,1,1")])
-
-(define_insn "*store_si"
- [(set (mem:SI (match_operand:SI 0 "symbolic_operand" ""))
- (match_operand:SI 1 "reg_or_0_operand" "rJ"))
- (clobber (match_scratch:SI 2 "=&r"))]
- "(reload_completed || reload_in_progress)
- && ! TARGET_PTR64"
- "sethi %%hi(%a0),%2\;st %r1,[%2+%%lo(%a0)]"
- [(set_attr "type" "store")
- (set_attr "length" "2")])
+(define_expand "reload_outdi"
+ [(parallel [(match_operand:DI 0 "register_operand" "=r")
+ (match_operand:DI 1 "immediate_operand" "")
+ (match_operand:TI 2 "register_operand" "=&r")])]
+ "(TARGET_CM_MEDANY
+ || TARGET_CM_EMBMEDANY)
+ && ! flag_pic"
+ "
+{
+ sparc_emit_set_symbolic_const64 (operands[0], operands[1],
+ gen_rtx_REG (DImode, REGNO (operands[2])));
+ DONE;
+}")
-(define_expand "movdi"
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "")
- (match_operand:DI 1 "general_operand" ""))]
- ""
+;; Split up putting CONSTs and REGs into DI regs when !arch64
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (match_operand:DI 1 "const_int_operand" ""))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(clobber (const_int 0))]
"
{
- if (emit_move_sequence (operands, DImode))
- DONE;
+ emit_insn (gen_movsi (gen_highpart (SImode, operands[0]),
+ (INTVAL (operands[1]) < 0) ?
+ constm1_rtx :
+ const0_rtx));
+ emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]),
+ operands[1]));
+ DONE;
}")
-;; 32 bit V9 movdi is like regular 32 bit except: a 64 bit zero can be stored
-;; to aligned memory with a single instruction, the ldd/std instructions
-;; are not used, and constants can not be moved to floating point registers.
-
-(define_insn "*movdi_sp32_v9"
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "=r,T,Q,r,r,?e,?e,?Q,?b")
- (match_operand:DI 1 "general_operand" "r,J,r,Q,i,e,Q,e,J"))]
- "TARGET_V9 && ! TARGET_ARCH64
- && (register_operand (operands[0], DImode)
- || register_operand (operands[1], DImode)
- || operands[1] == const0_rtx)
- && (GET_CODE (operands[0]) != REG || ! CONSTANT_P (operands[1])
- || REGNO (operands[0]) < 32
- || REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)"
- "*
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (match_operand:DI 1 "const_double_operand" ""))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(clobber (const_int 0))]
+ "
{
- if (which_alternative == 1)
- return \"stx %%g0,%0\";
- if (which_alternative == 8)
- return \"fzero %0\";
- if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
- return output_fp_move_double (operands);
- return output_move_double (operands);
-}"
- [(set_attr "type" "move,store,store,load,multi,fp,fpload,fpstore,fpmove")
- (set_attr "length" "2,1,3,3,3,2,3,3,1")])
+ emit_insn (gen_movsi (gen_highpart (SImode, operands[0]),
+ GEN_INT (CONST_DOUBLE_HIGH (operands[1]))));
+
+ /* Slick... but this trick loses if this subreg constant part
+ can be done in one insn. */
+ if (CONST_DOUBLE_LOW (operands[1]) == CONST_DOUBLE_HIGH (operands[1])
+ && !(SPARC_SETHI_P (CONST_DOUBLE_HIGH (operands[1]))
+ || SPARC_SIMM13_P (CONST_DOUBLE_HIGH (operands[1]))))
+ {
+ emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]),
+ gen_highpart (SImode, operands[0])));
+ }
+ else
+ {
+ emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]),
+ GEN_INT (CONST_DOUBLE_LOW (operands[1]))));
+ }
+ DONE;
+}")
-;; SPARC V9 deprecates std. Split it here.
(define_split
- [(set (match_operand:DI 0 "memory_operand" "=m")
- (match_operand:DI 1 "register_operand" "r"))]
- "TARGET_V9 && ! TARGET_ARCH64 && reload_completed
- && REGNO (operands[1]) < 32 && ! MEM_VOLATILE_P (operands[0])
- && offsettable_memref_p (operands[0])"
- [(set (match_dup 2) (match_dup 3))
- (set (match_dup 4) (match_dup 5))]
- "operands[3] = gen_highpart (SImode, operands[1]);
- operands[5] = gen_lowpart (SImode, operands[1]);
- operands[4] = adj_offsettable_operand (operands[0], 4);
- PUT_MODE (operands[4], SImode);
- operands[2] = copy_rtx (operands[0]);
- PUT_MODE (operands[2], SImode);")
-
-(define_insn "*movdi_sp32"
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "=r,T,U,Q,r,r,?f,?f,?Q")
- (match_operand:DI 1 "general_operand" "r,U,T,r,Q,i,f,Q,f"))]
- "! TARGET_V9
- && (register_operand (operands[0], DImode)
- || register_operand (operands[1], DImode)
- || operands[1] == const0_rtx)"
- "*
+ [(set (match_operand:DI 0 "register_operand" "")
+ (match_operand:DI 1 "register_operand" ""))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(clobber (const_int 0))]
+ "
{
- if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
- return output_fp_move_double (operands);
- return output_move_double (operands);
-}"
- [(set_attr "type" "move,store,load,store,load,multi,fp,fpload,fpstore")
- (set_attr "length" "2,1,1,3,3,3,2,3,3")])
-
-;;; ??? The trick used below can be extended to load any negative 32 bit
-;;; constant in two instructions. Currently the compiler will use HIGH/LO_SUM
-;;; for anything not matching the HIK constraints, which results in 5
-;;; instructions. Positive 32 bit constants can be loaded in the obvious way
-;;; with sethi/ori. To extend the trick, in the xor instruction, use
-;;; xor %o0, ((op1 & 0x3ff) | -0x400), %o0
-;;; This needs the original value of operands[1], not the inverted value.
-
-(define_insn "*movdi_sp64_insn"
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,Q,?e,?e,?Q")
- (match_operand:DI 1 "move_operand" "rI,K,Q,rJ,e,Q,e"))]
- "TARGET_ARCH64
- && (register_operand (operands[0], DImode)
- || register_operand (operands[1], DImode)
- || operands[1] == const0_rtx)"
- "*
+ rtx set_dest = operands[0];
+ rtx set_src = operands[1];
+ rtx dest1, dest2;
+ rtx src1, src2;
+
+ if (GET_CODE (set_dest) == SUBREG)
+ set_dest = alter_subreg (set_dest);
+ if (GET_CODE (set_src) == SUBREG)
+ set_src = alter_subreg (set_src);
+
+ dest1 = gen_highpart (SImode, set_dest);
+ dest2 = gen_lowpart (SImode, set_dest);
+ src1 = gen_highpart (SImode, set_src);
+ src2 = gen_lowpart (SImode, set_src);
+
+ /* Now emit using the real source and destination we found, swapping
+ the order if we detect overlap. */
+ if (reg_overlap_mentioned_p (dest1, src2))
+ {
+ emit_insn (gen_movsi (dest2, src2));
+ emit_insn (gen_movsi (dest1, src1));
+ }
+ else
+ {
+ emit_insn (gen_movsi (dest1, src1));
+ emit_insn (gen_movsi (dest2, src2));
+ }
+ DONE;
+}")
+
+;; Now handle the cases of memory moves from/to non-even
+;; DI mode register pairs.
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (match_operand:DI 1 "memory_operand" ""))]
+ "(! TARGET_ARCH64
+ && reload_completed
+ && sparc_splitdi_legitimate (operands[0], operands[1]))"
+ [(clobber (const_int 0))]
+ "
{
- switch (which_alternative)
+ rtx word0 = change_address (operands[1], SImode, NULL_RTX);
+ rtx word1 = change_address (operands[1], SImode,
+ plus_constant_for_output (XEXP (word0, 0), 4));
+ rtx high_part = gen_highpart (SImode, operands[0]);
+ rtx low_part = gen_lowpart (SImode, operands[0]);
+
+ if (reg_overlap_mentioned_p (high_part, word1))
{
- case 0:
- return \"mov %1,%0\";
- case 1:
- /* Sethi does not sign extend, so we must use a little trickery
- to use it for negative numbers. Invert the constant before
- loading it in, then use a xor immediate to invert the loaded bits
- (along with the upper 32 bits) to the desired constant. This
- works because the sethi and immediate fields overlap. */
-
- if ((INTVAL (operands[1]) & 0x80000000) == 0)
- return \"sethi %%hi(%a1),%0\";
- else
- {
- operands[1] = GEN_INT (~INTVAL (operands[1]));
- output_asm_insn (\"sethi %%hi(%a1),%0\", operands);
- /* The low 10 bits are already zero, but invert the rest.
- Assemblers don't accept 0x1c00, so use -0x400 instead. */
- return \"xor %0,-0x400,%0\";
- }
- case 2:
- return \"ldx %1,%0\";
- case 3:
- return \"stx %r1,%0\";
- case 4:
- return \"fmovd %1,%0\";
- case 5:
- return \"ldd %1,%0\";
- case 6:
- return \"std %1,%0\";
- default:
- abort ();
+ emit_insn (gen_movsi (low_part, word1));
+ emit_insn (gen_movsi (high_part, word0));
}
-}"
- [(set_attr "type" "move,move,load,store,fp,fpload,fpstore")
- (set_attr "length" "1,2,1,1,1,1,1")])
+ else
+ {
+ emit_insn (gen_movsi (high_part, word0));
+ emit_insn (gen_movsi (low_part, word1));
+ }
+ DONE;
+}")
+
+(define_split
+ [(set (match_operand:DI 0 "memory_operand" "")
+ (match_operand:DI 1 "register_operand" ""))]
+ "(! TARGET_ARCH64
+ && reload_completed
+ && sparc_splitdi_legitimate (operands[1], operands[0]))"
+ [(clobber (const_int 0))]
+ "
+{
+ rtx word0 = change_address (operands[0], SImode, NULL_RTX);
+ rtx word1 = change_address (operands[0], SImode,
+ plus_constant_for_output (XEXP (word0, 0), 4));
+ rtx high_part = gen_highpart (SImode, operands[1]);
+ rtx low_part = gen_lowpart (SImode, operands[1]);
+
+ emit_insn (gen_movsi (word0, high_part));
+ emit_insn (gen_movsi (word1, low_part));
+ DONE;
+}")
-;; ??? There's no symbolic (set (mem:DI ...) ...).
-;; Experimentation with v9 suggested one isn't needed.
-
-;; Block move insns.
-
-;; ??? We get better code without it. See output_block_move in sparc.c.
-
-;; The definition of this insn does not really explain what it does,
-;; but it should suffice
-;; that anything generated as this insn will be recognized as one
-;; and that it will not successfully combine with anything.
-;(define_expand "movstrsi"
-; [(parallel [(set (mem:BLK (match_operand:BLK 0 "general_operand" ""))
-; (mem:BLK (match_operand:BLK 1 "general_operand" "")))
-; (use (match_operand:SI 2 "nonmemory_operand" ""))
-; (use (match_operand:SI 3 "immediate_operand" ""))
-; (clobber (match_dup 0))
-; (clobber (match_dup 1))
-; (clobber (match_scratch:SI 4 ""))
-; (clobber (reg:SI 100))
-; (clobber (reg:SI 1))])]
-; ""
-; "
-;{
-; /* If the size isn't known, don't emit inline code. output_block_move
-; would output code that's much slower than the library function.
-; Also don't output code for large blocks. */
-; if (GET_CODE (operands[2]) != CONST_INT
-; || GET_CODE (operands[3]) != CONST_INT
-; || INTVAL (operands[2]) / INTVAL (operands[3]) > 16)
-; FAIL;
-;
-; operands[0] = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
-; operands[1] = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
-; operands[2] = force_not_mem (operands[2]);
-;}")
-
-;(define_insn "*block_move_insn"
-; [(set (mem:BLK (match_operand:SI 0 "register_operand" "+r"))
-; (mem:BLK (match_operand:SI 1 "register_operand" "+r")))
-; (use (match_operand:SI 2 "nonmemory_operand" "rn"))
-; (use (match_operand:SI 3 "immediate_operand" "i"))
-; (clobber (match_dup 0))
-; (clobber (match_dup 1))
-; (clobber (match_scratch:SI 4 "=&r"))
-; (clobber (reg:SI 100))
-; (clobber (reg:SI 1))]
-; ""
-; "* return output_block_move (operands);"
-; [(set_attr "type" "multi")
-; (set_attr "length" "6")])
;; Floating point move insns
-;; This pattern forces (set (reg:SF ...) (const_double ...))
-;; to be reloaded by putting the constant into memory.
-;; It must come before the more general movsf pattern.
-(define_insn "*movsf_const_insn"
- [(set (match_operand:SF 0 "general_operand" "=f,d,m,?r")
- (match_operand:SF 1 "" "m,G,G,?F"))]
+(define_insn "*clear_sf"
+ [(set (match_operand:SF 0 "general_operand" "=f")
+ (match_operand:SF 1 "" ""))]
+ "TARGET_VIS
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && GET_CODE (operands[0]) == REG
+ && fp_zero_operand (operands[1])"
+ "fzeros\\t%0"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1")])
+
+(define_insn "*movsf_const_intreg"
+ [(set (match_operand:SF 0 "general_operand" "=f,r")
+ (match_operand:SF 1 "" "m,F"))]
"TARGET_FPU
&& GET_CODE (operands[1]) == CONST_DOUBLE
- && (GET_CODE (operands[0]) == REG
- || fp_zero_operand (operands[1]))"
+ && GET_CODE (operands[0]) == REG"
"*
{
- switch (which_alternative)
+ REAL_VALUE_TYPE r;
+ long i;
+
+ if (which_alternative == 0)
+ return \"ld\\t%1, %0\";
+
+ REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
+ REAL_VALUE_TO_TARGET_SINGLE (r, i);
+ if (SPARC_SIMM13_P (i) || SPARC_SETHI_P (i))
{
- case 0:
- return \"ld %1,%0\";
- case 1:
- return \"fzeros %0\";
- case 2:
- return \"st %%g0,%0\";
- case 3:
- return singlemove_string (operands);
- default:
- abort ();
+ operands[1] = GEN_INT (i);
+ if (SPARC_SIMM13_P (INTVAL (operands[1])))
+ return \"mov\\t%1, %0\";
+ else if (SPARC_SETHI_P (INTVAL (operands[1])))
+ return \"sethi\\t%%hi(%a1), %0\";
+ else
+ abort ();
}
+ else
+ return \"#\";
}"
- [(set_attr "type" "fpload,fpmove,store,load")
- (set_attr "length" "1,1,1,2")])
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+;; There isn't much I can do about this, if I change the
+;; mode then flow info gets really confused because the
+;; destination no longer looks the same. Ho hum...
+(define_insn "*movsf_const_high"
+ [(set (match_operand:SF 0 "register_operand" "=r")
+ (unspec:SF [(match_operand 1 "const_int_operand" "")] 12))]
+ ""
+ "sethi\\t%%hi(%a1), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "*movsf_const_lo"
+ [(set (match_operand:SF 0 "register_operand" "=r")
+ (unspec:SF [(match_operand 1 "register_operand" "r")
+ (match_operand 2 "const_int_operand" "")] 17))]
+ ""
+ "or\\t%1, %%lo(%a2), %0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "")
+ (match_operand:SF 1 "const_double_operand" ""))]
+ "TARGET_FPU
+ && (GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)"
+ [(set (match_dup 0) (unspec:SF [(match_dup 1)] 12))
+ (set (match_dup 0) (unspec:SF [(match_dup 0) (match_dup 1)] 17))]
+ "
+{
+ REAL_VALUE_TYPE r;
+ long i;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
+ REAL_VALUE_TO_TARGET_SINGLE (r, i);
+ operands[1] = GEN_INT (i);
+}")
(define_expand "movsf"
[(set (match_operand:SF 0 "general_operand" "")
@@ -2398,88 +2837,196 @@
""
"
{
- if (emit_move_sequence (operands, SFmode))
- DONE;
+ /* Force SFmode constants into memory. */
+ if (GET_CODE (operands[0]) == REG
+ && CONSTANT_P (operands[1]))
+ {
+ if (TARGET_VIS
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && fp_zero_operand (operands[1]))
+ goto movsf_is_ok;
+
+ /* emit_group_store will send such bogosity to us when it is
+ not storing directly into memory. So fix this up to avoid
+ crashes in output_constant_pool. */
+ if (operands [1] == const0_rtx)
+ operands[1] = CONST0_RTX (SFmode);
+ operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
+ operands[1]));
+ }
+
+ /* Handle sets of MEM first. */
+ if (GET_CODE (operands[0]) == MEM)
+ {
+ if (register_operand (operands[1], SFmode))
+ goto movsf_is_ok;
+
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (SFmode, operands[1]);
+ }
+ }
+
+ /* Fixup PIC cases. */
+ if (flag_pic)
+ {
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], SFmode, 0);
+
+ if (symbolic_operand (operands[1], SFmode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ SFmode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ }
+ }
+
+ movsf_is_ok:
+ ;
}")
(define_insn "*movsf_insn"
- [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand" "=f,f,Q,r,r,Q")
- (match_operand:SF 1 "reg_or_nonsymb_mem_operand" "f,Q,f,r,Q,r"))]
+ [(set (match_operand:SF 0 "general_operand" "=f,f,m,r,r,m")
+ (match_operand:SF 1 "input_operand" "f,m,f,r,m,r"))]
"TARGET_FPU
&& (register_operand (operands[0], SFmode)
|| register_operand (operands[1], SFmode))"
"@
- fmovs %1,%0
- ld %1,%0
- st %1,%0
- mov %1,%0
- ld %1,%0
- st %1,%0"
- [(set_attr "type" "fpmove,fpload,fpstore,move,load,store")])
+ fmovs\\t%1, %0
+ ld\\t%1, %0
+ st\\t%1, %0
+ mov\\t%1, %0
+ ld\\t%1, %0
+ st\\t%1, %0"
+ [(set_attr "type" "fpmove,fpload,fpstore,move,load,store")
+ (set_attr "length" "1")])
;; Exactly the same as above, except that all `f' cases are deleted.
;; This is necessary to prevent reload from ever trying to use a `f' reg
;; when -mno-fpu.
(define_insn "*movsf_no_f_insn"
- [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand" "=r,r,Q")
- (match_operand:SF 1 "reg_or_nonsymb_mem_operand" "r,Q,r"))]
+ [(set (match_operand:SF 0 "general_operand" "=r,r,m")
+ (match_operand:SF 1 "input_operand" "r,m,r"))]
"! TARGET_FPU
&& (register_operand (operands[0], SFmode)
|| register_operand (operands[1], SFmode))"
"@
- mov %1,%0
- ld %1,%0
- st %1,%0"
- [(set_attr "type" "move,load,store")])
-
-(define_insn "*store_sf"
- [(set (mem:SF (match_operand:SI 0 "symbolic_operand" "i"))
- (match_operand:SF 1 "reg_or_0_operand" "rfG"))
- (clobber (match_scratch:SI 2 "=&r"))]
- "(reload_completed || reload_in_progress)
- && ! TARGET_PTR64"
- "sethi %%hi(%a0),%2\;st %r1,[%2+%%lo(%a0)]"
- [(set_attr "type" "store")
- (set_attr "length" "2")])
+ mov\\t%1, %0
+ ld\\t%1, %0
+ st\\t%1, %0"
+ [(set_attr "type" "move,load,store")
+ (set_attr "length" "1")])
-;; This pattern forces (set (reg:DF ...) (const_double ...))
-;; to be reloaded by putting the constant into memory.
-;; It must come before the more general movdf pattern.
+(define_insn "*clear_df"
+ [(set (match_operand:DF 0 "general_operand" "=e")
+ (match_operand:DF 1 "" ""))]
+ "TARGET_VIS
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && GET_CODE (operands[0]) == REG
+ && fp_zero_operand (operands[1])"
+ "fzero\\t%0"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1")])
-(define_insn "*movdf_const_insn"
- [(set (match_operand:DF 0 "general_operand" "=?r,e,o,d")
- (match_operand:DF 1 "" "?F,m,G,G"))]
- "TARGET_FPU
+(define_insn "*movdf_const_intreg_sp32"
+ [(set (match_operand:DF 0 "general_operand" "=e,e,r")
+ (match_operand:DF 1 "" "T,o,F"))]
+ "TARGET_FPU && ! TARGET_ARCH64
&& GET_CODE (operands[1]) == CONST_DOUBLE
- && (GET_CODE (operands[0]) == REG
- || fp_zero_operand (operands[1]))"
+ && GET_CODE (operands[0]) == REG"
"*
{
- switch (which_alternative)
+ if (which_alternative == 0)
+ return \"ldd\\t%1, %0\";
+ else
+ return \"#\";
+}"
+ [(set_attr "type" "move")
+ (set_attr "length" "1,2,2")])
+
+;; ?? This and split disabled on sparc64... When I change the destination
+;; ?? reg to be DImode to emit the constant formation code, the instruction
+;; ?? scheduler does not want to believe that it is the same as the DFmode
+;; ?? subreg we started with... See the SFmode version of this above to
+;; ?? see how it can be handled.
+(define_insn "*movdf_const_intreg_sp64"
+ [(set (match_operand:DF 0 "general_operand" "=e,e,r")
+ (match_operand:DF 1 "" "m,o,F"))]
+ "0 && TARGET_FPU && TARGET_ARCH64
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && GET_CODE (operands[0]) == REG"
+ "*
+{
+ if (which_alternative == 0)
+ return \"ldd\\t%1, %0\";
+ else
+ return \"#\";
+}"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_split
+ [(set (match_operand:DF 0 "register_operand" "")
+ (match_operand:DF 1 "const_double_operand" ""))]
+ "! TARGET_ARCH64
+ && TARGET_FPU
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && (GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ && reload_completed"
+ [(clobber (const_int 0))]
+ "
+{
+ REAL_VALUE_TYPE r;
+ long l[2];
+
+ REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
+ REAL_VALUE_TO_TARGET_DOUBLE (r, l);
+ if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ operands[0] = gen_rtx_raw_REG (DImode, REGNO (operands[0]));
+
+ if (TARGET_ARCH64)
{
- case 0:
- return output_move_double (operands);
- case 1:
- return output_fp_move_double (operands);
- case 2:
- if (TARGET_ARCH64 || (TARGET_V9 && mem_aligned_8 (operands[0])))
- {
- return \"stx %%g0,%0\";
- }
+#if HOST_BITS_PER_WIDE_INT == 64
+ HOST_WIDE_INT val;
+
+ val = ((HOST_WIDE_INT)l[1] |
+ ((HOST_WIDE_INT)l[0] << 32));
+ emit_insn (gen_movdi (operands[0], GEN_INT (val)));
+#else
+ emit_insn (gen_movdi (operands[0],
+ gen_rtx_CONST_DOUBLE (VOIDmode, const0_rtx,
+ l[1], l[0])));
+#endif
+ }
+ else
+ {
+ emit_insn (gen_movsi (gen_highpart (SImode, operands[0]),
+ GEN_INT (l[0])));
+
+ /* Slick... but this trick loses if this subreg constant part
+ can be done in one insn. */
+ if (l[1] == l[0]
+ && !(SPARC_SETHI_P (l[0])
+ || SPARC_SIMM13_P (l[0])))
+ {
+ emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]),
+ gen_highpart (SImode, operands[0])));
+ }
else
- {
- operands[1] = adj_offsettable_operand (operands[0], 4);
- return \"st %%g0,%0\;st %%g0,%1\";
- }
- case 3:
- return \"fzero %0\";
- default:
- abort ();
+ {
+ emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]),
+ GEN_INT (l[1])));
+ }
}
-}"
- [(set_attr "type" "load,fpload,store,fpmove")
- (set_attr "length" "3,3,3,1")])
+ DONE;
+}")
(define_expand "movdf"
[(set (match_operand:DF 0 "general_operand" "")
@@ -2487,126 +3034,271 @@
""
"
{
- if (emit_move_sequence (operands, DFmode))
- DONE;
+ /* Force DFmode constants into memory. */
+ if (GET_CODE (operands[0]) == REG
+ && CONSTANT_P (operands[1]))
+ {
+ if (TARGET_VIS
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && fp_zero_operand (operands[1]))
+ goto movdf_is_ok;
+
+ /* emit_group_store will send such bogosity to us when it is
+ not storing directly into memory. So fix this up to avoid
+ crashes in output_constant_pool. */
+ if (operands [1] == const0_rtx)
+ operands[1] = CONST0_RTX (DFmode);
+ operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
+ operands[1]));
+ }
+
+ /* Handle MEM cases first. */
+ if (GET_CODE (operands[0]) == MEM)
+ {
+ if (register_operand (operands[1], DFmode))
+ goto movdf_is_ok;
+
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (DFmode, operands[1]);
+ }
+ }
+
+ /* Fixup PIC cases. */
+ if (flag_pic)
+ {
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], DFmode, 0);
+
+ if (symbolic_operand (operands[1], DFmode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ DFmode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ }
+ }
+
+ movdf_is_ok:
+ ;
}")
-(define_insn "*movdf_insn"
- [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" "=e,Q,e,T,U,r,Q,r")
- (match_operand:DF 1 "reg_or_nonsymb_mem_operand" "e,e,Q,U,T,r,r,Q"))]
+;; Be careful, fmovd does not exist when !v9.
+(define_insn "*movdf_insn_sp32"
+ [(set (match_operand:DF 0 "general_operand" "=e,T,U,T,e,r,r,o,e,o")
+ (match_operand:DF 1 "input_operand" "T,e,T,U,e,r,o,r,o,e"))]
"TARGET_FPU
+ && ! TARGET_V9
&& (register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode))"
- "*
-{
- if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
- return output_fp_move_double (operands);
- return output_move_double (operands);
-}"
- [(set_attr "type" "fpstore,fpload,fp,move,fpstore,store,fpload,load")
- (set_attr "length" "1,1,2,2,3,3,3,3")])
-
-;; Exactly the same as above, except that all `e' cases are deleted.
-;; This is necessary to prevent reload from ever trying to use a `e' reg
-;; when -mno-fpu.
-
-(define_insn "*movdf_no_e_insn"
- [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand" "=T,U,r,Q,&r")
- (match_operand:DF 1 "reg_or_nonsymb_mem_operand" "U,T,r,r,Q"))]
+ "@
+ ldd\\t%1, %0
+ std\\t%1, %0
+ ldd\\t%1, %0
+ std\\t%1, %0
+ #
+ #
+ #
+ #
+ #
+ #"
+ [(set_attr "type" "fpload,fpstore,load,store,*,*,*,*,*,*")
+ (set_attr "length" "1,1,1,1,2,2,2,2,2,2")])
+
+(define_insn "*movdf_no_e_insn_sp32"
+ [(set (match_operand:DF 0 "general_operand" "=U,T,r,r,o")
+ (match_operand:DF 1 "input_operand" "T,U,r,o,r"))]
"! TARGET_FPU
+ && ! TARGET_ARCH64
+ && (register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode))"
+ "@
+ ldd\\t%1, %0
+ std\\t%1, %0
+ #
+ #
+ #"
+ [(set_attr "type" "load,store,*,*,*")
+ (set_attr "length" "1,1,2,2,2")])
+
+;; We have available v9 double floats but not 64-bit
+;; integer registers.
+(define_insn "*movdf_insn_v9only"
+ [(set (match_operand:DF 0 "general_operand" "=e,e,m,U,T,r,r,o")
+ (match_operand:DF 1 "input_operand" "e,m,e,T,U,r,o,r"))]
+ "TARGET_FPU
+ && TARGET_V9
+ && ! TARGET_ARCH64
+ && (register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode))"
+ "@
+ fmovd\\t%1, %0
+ ldd\\t%1, %0
+ std\\t%1, %0
+ ldd\\t%1, %0
+ std\\t%1, %0
+ #
+ #
+ #"
+ [(set_attr "type" "fpmove,load,store,load,store,*,*,*")
+ (set_attr "length" "1,1,1,1,1,2,2,2")])
+
+;; We have available both v9 double floats and 64-bit
+;; integer registers.
+(define_insn "*movdf_insn_sp64"
+ [(set (match_operand:DF 0 "general_operand" "=e,e,m,r,r,m")
+ (match_operand:DF 1 "input_operand" "e,m,e,r,m,r"))]
+ "TARGET_FPU
+ && TARGET_V9
+ && TARGET_ARCH64
&& (register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode))"
- "* return output_move_double (operands);"
- [(set_attr "type" "store,load,move,store,load")
- (set_attr "length" "1,1,2,3,3")])
+ "@
+ fmovd\\t%1, %0
+ ldd\\t%1, %0
+ std\\t%1, %0
+ mov\\t%1, %0
+ ldx\\t%1, %0
+ stx\\t%1, %0"
+ [(set_attr "type" "fpmove,load,store,move,load,store")
+ (set_attr "length" "1")])
-;; Must handle overlapping registers here, since parameters can be unaligned
-;; in registers.
+(define_insn "*movdf_no_e_insn_sp64"
+ [(set (match_operand:DF 0 "general_operand" "=r,r,m")
+ (match_operand:DF 1 "input_operand" "r,m,r"))]
+ "! TARGET_FPU
+ && TARGET_ARCH64
+ && (register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode))"
+ "@
+ mov\\t%1, %0
+ ldx\\t%1, %0
+ stx\\t%1, %0"
+ [(set_attr "type" "move,load,store")
+ (set_attr "length" "1")])
+;; Ok, now the splits to handle all the multi insn and
+;; mis-aligned memory address cases.
+;; In these splits please take note that we must be
+;; careful when V9 but not ARCH64 because the integer
+;; register DFmode cases must be handled.
(define_split
[(set (match_operand:DF 0 "register_operand" "")
- (match_operand:DF 1 "register_operand" ""))]
- "! TARGET_ARCH64 && reload_completed
- && REGNO (operands[0]) < SPARC_FIRST_V9_FP_REG
- && REGNO (operands[1]) < SPARC_FIRST_V9_FP_REG"
- [(set (match_dup 2) (match_dup 3))
- (set (match_dup 4) (match_dup 5))]
+ (match_operand:DF 1 "register_operand" ""))]
+ "(! TARGET_V9
+ || (! TARGET_ARCH64
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))))
+ && reload_completed"
+ [(clobber (const_int 0))]
"
{
- rtx first_set = operand_subword (operands[0], 0, 0, DFmode);
- rtx second_use = operand_subword (operands[1], 1, 0, DFmode);
+ rtx set_dest = operands[0];
+ rtx set_src = operands[1];
+ rtx dest1, dest2;
+ rtx src1, src2;
- if (REGNO (first_set) == REGNO (second_use))
+ if (GET_CODE (set_dest) == SUBREG)
+ set_dest = alter_subreg (set_dest);
+ if (GET_CODE (set_src) == SUBREG)
+ set_src = alter_subreg (set_src);
+
+ dest1 = gen_highpart (SFmode, set_dest);
+ dest2 = gen_lowpart (SFmode, set_dest);
+ src1 = gen_highpart (SFmode, set_src);
+ src2 = gen_lowpart (SFmode, set_src);
+
+ /* Now emit using the real source and destination we found, swapping
+ the order if we detect overlap. */
+ if (reg_overlap_mentioned_p (dest1, src2))
{
- operands[2] = operand_subword (operands[0], 1, 0, DFmode);
- operands[3] = second_use;
- operands[4] = first_set;
- operands[5] = operand_subword (operands[1], 0, 0, DFmode);
+ emit_insn (gen_movsf (dest2, src2));
+ emit_insn (gen_movsf (dest1, src1));
}
else
{
- operands[2] = first_set;
- operands[3] = operand_subword (operands[1], 0, 0, DFmode);
- operands[4] = operand_subword (operands[0], 1, 0, DFmode);
- operands[5] = second_use;
+ emit_insn (gen_movsf (dest1, src1));
+ emit_insn (gen_movsf (dest2, src2));
}
+ DONE;
}")
-(define_insn "*store_df"
- [(set (mem:DF (match_operand:SI 0 "symbolic_operand" "i,i"))
- (match_operand:DF 1 "reg_or_0_operand" "re,G"))
- (clobber (match_scratch:SI 2 "=&r,&r"))]
- "(reload_completed || reload_in_progress)
- && ! TARGET_PTR64"
- "*
+(define_split
+ [(set (match_operand:DF 0 "register_operand" "")
+ (match_operand:DF 1 "memory_operand" ""))]
+ "((! TARGET_V9
+ || (! TARGET_ARCH64
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))))
+ && (reload_completed
+ && (((REGNO (operands[0])) % 2) != 0
+ || ! mem_min_alignment (operands[1], 8))
+ && offsettable_memref_p (operands[1])))"
+ [(clobber (const_int 0))]
+ "
{
- output_asm_insn (\"sethi %%hi(%a0),%2\", operands);
- if (which_alternative == 0)
- return \"std %1,[%2+%%lo(%a0)]\";
+ rtx word0 = change_address (operands[1], SFmode, NULL_RTX);
+ rtx word1 = change_address (operands[1], SFmode,
+ plus_constant_for_output (XEXP (word0, 0), 4));
+
+ if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+
+ if (reg_overlap_mentioned_p (gen_highpart (SFmode, operands[0]), word1))
+ {
+ emit_insn (gen_movsf (gen_lowpart (SFmode, operands[0]),
+ word1));
+ emit_insn (gen_movsf (gen_highpart (SFmode, operands[0]),
+ word0));
+ }
else
- return \"st %%g0,[%2+%%lo(%a0)]\;st %%g0,[%2+%%lo(%a0+4)]\";
-}"
- [(set_attr "type" "store")
- (set_attr "length" "3")])
-
-;; This pattern forces (set (reg:TF ...) (const_double ...))
-;; to be reloaded by putting the constant into memory.
-;; It must come before the more general movtf pattern.
-(define_insn "*movtf_const_insn"
- [(set (match_operand:TF 0 "general_operand" "=?r,e,o")
- (match_operand:TF 1 "" "?F,m,G"))]
- "TARGET_FPU
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && (GET_CODE (operands[0]) == REG
- || fp_zero_operand (operands[1]))"
- "*
-{
- switch (which_alternative)
{
- case 0:
- return output_move_quad (operands);
- case 1:
- return output_fp_move_quad (operands);
- case 2:
- if (TARGET_ARCH64 || (TARGET_V9 && mem_aligned_8 (operands[0])))
- {
- operands[1] = adj_offsettable_operand (operands[0], 8);
- return \"stx %%g0,%0\;stx %%g0,%1\";
- }
- else
- {
- /* ??? Do we run off the end of the array here? */
- operands[1] = adj_offsettable_operand (operands[0], 4);
- operands[2] = adj_offsettable_operand (operands[0], 8);
- operands[3] = adj_offsettable_operand (operands[0], 12);
- return \"st %%g0,%0\;st %%g0,%1\;st %%g0,%2\;st %%g0,%3\";
- }
- default:
- abort ();
+ emit_insn (gen_movsf (gen_highpart (SFmode, operands[0]),
+ word0));
+ emit_insn (gen_movsf (gen_lowpart (SFmode, operands[0]),
+ word1));
}
-}"
- [(set_attr "type" "load,fpload,store")
- (set_attr "length" "5,5,5")])
+ DONE;
+}")
+
+(define_split
+ [(set (match_operand:DF 0 "memory_operand" "")
+ (match_operand:DF 1 "register_operand" ""))]
+ "((! TARGET_V9
+ || (! TARGET_ARCH64
+ && ((GET_CODE (operands[1]) == REG
+ && REGNO (operands[1]) < 32)
+ || (GET_CODE (operands[1]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[1])) == REG
+ && REGNO (SUBREG_REG (operands[1])) < 32))))
+ && (reload_completed
+ && (((REGNO (operands[1])) % 2) != 0
+ || ! mem_min_alignment (operands[0], 8))
+ && offsettable_memref_p (operands[0])))"
+ [(clobber (const_int 0))]
+ "
+{
+ rtx word0 = change_address (operands[0], SFmode, NULL_RTX);
+ rtx word1 = change_address (operands[0], SFmode,
+ plus_constant_for_output (XEXP (word0, 0), 4));
+
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ emit_insn (gen_movsf (word0,
+ gen_highpart (SFmode, operands[1])));
+ emit_insn (gen_movsf (word1,
+ gen_lowpart (SFmode, operands[1])));
+ DONE;
+}")
(define_expand "movtf"
[(set (match_operand:TF 0 "general_operand" "")
@@ -2614,63 +3306,219 @@
""
"
{
- if (emit_move_sequence (operands, TFmode))
- DONE;
+ /* Force TFmode constants into memory. */
+ if (GET_CODE (operands[0]) == REG
+ && CONSTANT_P (operands[1]))
+ {
+ /* emit_group_store will send such bogosity to us when it is
+ not storing directly into memory. So fix this up to avoid
+ crashes in output_constant_pool. */
+ if (operands [1] == const0_rtx)
+ operands[1] = CONST0_RTX (TFmode);
+ operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
+ operands[1]));
+ }
+
+ /* Handle MEM cases first, note that only v9 guarentees
+ full 16-byte alignment for quads. */
+ if (GET_CODE (operands[0]) == MEM)
+ {
+ if (register_operand (operands[1], TFmode))
+ goto movtf_is_ok;
+
+ if (! reload_in_progress)
+ {
+ operands[0] = validize_mem (operands[0]);
+ operands[1] = force_reg (TFmode, operands[1]);
+ }
+ }
+
+ /* Fixup PIC cases. */
+ if (flag_pic)
+ {
+ if (CONSTANT_P (operands[1])
+ && pic_address_needs_scratch (operands[1]))
+ operands[1] = legitimize_pic_address (operands[1], TFmode, 0);
+
+ if (symbolic_operand (operands[1], TFmode))
+ {
+ operands[1] = legitimize_pic_address (operands[1],
+ TFmode,
+ (reload_in_progress ?
+ operands[0] :
+ NULL_RTX));
+ }
+ }
+
+ movtf_is_ok:
+ ;
}")
-(define_insn "*movtf_insn"
- [(set (match_operand:TF 0 "reg_or_nonsymb_mem_operand" "=e,Q,e,r,Q,r")
- (match_operand:TF 1 "reg_or_nonsymb_mem_operand" "e,e,Q,r,r,Q"))]
+;; Be careful, fmovq and {st,ld}{x,q} do not exist when !arch64 so
+;; we must split them all. :-(
+(define_insn "*movtf_insn_sp32"
+ [(set (match_operand:TF 0 "general_operand" "=e,o,U,o,e,r,r,o")
+ (match_operand:TF 1 "input_operand" "o,e,o,U,e,r,o,r"))]
"TARGET_FPU
+ && ! TARGET_ARCH64
&& (register_operand (operands[0], TFmode)
|| register_operand (operands[1], TFmode))"
- "*
-{
- if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
- return output_fp_move_quad (operands);
- return output_move_quad (operands);
-}"
- [(set_attr "type" "fp,move,fpstore,store,fpload,load")
- (set_attr "length" "4,4,5,5,5,5")])
+ "#"
+ [(set_attr "length" "4")])
;; Exactly the same as above, except that all `e' cases are deleted.
;; This is necessary to prevent reload from ever trying to use a `e' reg
;; when -mno-fpu.
-(define_insn "*movtf_no_e_insn"
- [(set (match_operand:TF 0 "reg_or_nonsymb_mem_operand" "=r,Q,&r")
- (match_operand:TF 1 "reg_or_nonsymb_mem_operand" "r,r,Q"))]
+(define_insn "*movtf_no_e_insn_sp32"
+ [(set (match_operand:TF 0 "general_operand" "=U,o,r,r,o")
+ (match_operand:TF 1 "input_operand" "o,U,r,o,r"))]
"! TARGET_FPU
+ && ! TARGET_ARCH64
&& (register_operand (operands[0], TFmode)
|| register_operand (operands[1], TFmode))"
- "*
+ "#"
+ [(set_attr "length" "4")])
+
+;; Now handle the float reg cases directly when arch64,
+;; hard_quad, and proper reg number alignment are all true.
+(define_insn "*movtf_insn_hq_sp64"
+ [(set (match_operand:TF 0 "general_operand" "=e,e,m,r,r,o")
+ (match_operand:TF 1 "input_operand" "e,m,e,r,o,r"))]
+ "TARGET_FPU
+ && TARGET_ARCH64
+ && TARGET_V9
+ && TARGET_HARD_QUAD
+ && (register_operand (operands[0], TFmode)
+ || register_operand (operands[1], TFmode))"
+ "@
+ fmovq\\t%1, %0
+ ldq\\t%1, %0
+ stq\\t%1, %0
+ #
+ #
+ #"
+ [(set_attr "type" "fpmove,fpload,fpstore,*,*,*")
+ (set_attr "length" "1,1,1,2,2,2")])
+
+;; Now we allow the integer register cases even when
+;; only arch64 is true.
+(define_insn "*movtf_insn_sp64"
+ [(set (match_operand:TF 0 "general_operand" "=e,o,r,o,e,r")
+ (match_operand:TF 1 "input_operand" "o,e,o,r,e,r"))]
+ "TARGET_FPU
+ && TARGET_ARCH64
+ && ! TARGET_HARD_QUAD
+ && (register_operand (operands[0], TFmode)
+ || register_operand (operands[1], TFmode))"
+ "#"
+ [(set_attr "length" "2")])
+
+(define_insn "*movtf_no_e_insn_sp64"
+ [(set (match_operand:TF 0 "general_operand" "=r,o,r")
+ (match_operand:TF 1 "input_operand" "o,r,r"))]
+ "! TARGET_FPU
+ && TARGET_ARCH64
+ && (register_operand (operands[0], TFmode)
+ || register_operand (operands[1], TFmode))"
+ "#"
+ [(set_attr "length" "2")])
+
+;; Now all the splits to handle multi-insn TF mode moves.
+(define_split
+ [(set (match_operand:TF 0 "register_operand" "")
+ (match_operand:TF 1 "register_operand" ""))]
+ "reload_completed
+ && (! TARGET_ARCH64
+ || (TARGET_FPU
+ && ! TARGET_HARD_QUAD))"
+ [(clobber (const_int 0))]
+ "
{
- if (FP_REG_P (operands[0]) || FP_REG_P (operands[1]))
- return output_fp_move_quad (operands);
- return output_move_quad (operands);
-}"
- [(set_attr "type" "move,store,load")
- (set_attr "length" "4,5,5")])
-
-;; This is disabled because it does not work. Long doubles have only 8
-;; byte alignment. Adding an offset of 8 or 12 to an 8 byte aligned %lo may
-;; cause it to overflow. See also GO_IF_LEGITIMATE_ADDRESS.
-(define_insn "*store_tf"
- [(set (mem:TF (match_operand:SI 0 "symbolic_operand" "i,i"))
- (match_operand:TF 1 "reg_or_0_operand" "re,G"))
- (clobber (match_scratch:SI 2 "=&r,&r"))]
- "0 && (reload_completed || reload_in_progress)
- && ! TARGET_PTR64"
- "*
+ rtx set_dest = operands[0];
+ rtx set_src = operands[1];
+ rtx dest1, dest2;
+ rtx src1, src2;
+
+ if (GET_CODE (set_dest) == SUBREG)
+ set_dest = alter_subreg (set_dest);
+ if (GET_CODE (set_src) == SUBREG)
+ set_src = alter_subreg (set_src);
+
+ /* Ugly, but gen_highpart will crap out here for 32-bit targets. */
+ dest1 = gen_rtx_SUBREG (DFmode, set_dest, WORDS_BIG_ENDIAN == 0);
+ dest2 = gen_rtx_SUBREG (DFmode, set_dest, WORDS_BIG_ENDIAN != 0);
+ src1 = gen_rtx_SUBREG (DFmode, set_src, WORDS_BIG_ENDIAN == 0);
+ src2 = gen_rtx_SUBREG (DFmode, set_src, WORDS_BIG_ENDIAN != 0);
+
+ /* Now emit using the real source and destination we found, swapping
+ the order if we detect overlap. */
+ if (reg_overlap_mentioned_p (dest1, src2))
+ {
+ emit_insn (gen_movdf (dest2, src2));
+ emit_insn (gen_movdf (dest1, src1));
+ }
+ else
+ {
+ emit_insn (gen_movdf (dest1, src1));
+ emit_insn (gen_movdf (dest2, src2));
+ }
+ DONE;
+}")
+
+(define_split
+ [(set (match_operand:TF 0 "register_operand" "")
+ (match_operand:TF 1 "memory_operand" ""))]
+ "(reload_completed
+ && offsettable_memref_p (operands[1]))"
+ [(clobber (const_int 0))]
+ "
{
- output_asm_insn (\"sethi %%hi(%a0),%2\", operands);
- if (which_alternative == 0)
- return \"std %1,[%2+%%lo(%a0)]\;std %S1,[%2+%%lo(%a0+8)]\";
+ rtx word0 = change_address (operands[1], DFmode, NULL_RTX);
+ rtx word1 = change_address (operands[1], DFmode,
+ plus_constant_for_output (XEXP (word0, 0), 8));
+ rtx dest1, dest2;
+
+ /* Ugly, but gen_highpart will crap out here for 32-bit targets. */
+ dest1 = gen_rtx_SUBREG (DFmode, operands[0], WORDS_BIG_ENDIAN == 0);
+ dest2 = gen_rtx_SUBREG (DFmode, operands[0], WORDS_BIG_ENDIAN != 0);
+
+ /* Now output, ordering such that we don't clobber any registers
+ mentioned in the address. */
+ if (reg_overlap_mentioned_p (dest1, word1))
+
+ {
+ emit_insn (gen_movdf (dest2, word1));
+ emit_insn (gen_movdf (dest1, word0));
+ }
else
- return \"st %%g0,[%2+%%lo(%a0)]\;st %%g0,[%2+%%lo(%a0+4)]\; st %%g0,[%2+%%lo(%a0+8)]\;st %%g0,[%2+%%lo(%a0+12)]\";
-}"
- [(set_attr "type" "store")
- (set_attr "length" "5")])
+ {
+ emit_insn (gen_movdf (dest1, word0));
+ emit_insn (gen_movdf (dest2, word1));
+ }
+ DONE;
+}")
+
+(define_split
+ [(set (match_operand:TF 0 "memory_operand" "")
+ (match_operand:TF 1 "register_operand" ""))]
+ "(reload_completed
+ && offsettable_memref_p (operands[0]))"
+ [(clobber (const_int 0))]
+ "
+{
+ rtx word0 = change_address (operands[0], DFmode, NULL_RTX);
+ rtx word1 = change_address (operands[0], DFmode,
+ plus_constant_for_output (XEXP (word0, 0), 8));
+ rtx src1, src2;
+
+ /* Ugly, but gen_highpart will crap out here for 32-bit targets. */
+ src1 = gen_rtx_SUBREG (DFmode, operands[1], WORDS_BIG_ENDIAN == 0);
+ src2 = gen_rtx_SUBREG (DFmode, operands[1], WORDS_BIG_ENDIAN != 0);
+ emit_insn (gen_movdf (word0, src1));
+ emit_insn (gen_movdf (word1, src2));
+ DONE;
+}")
;; Sparc V9 conditional move instructions.
@@ -2699,14 +3547,14 @@
&& GET_MODE (sparc_compare_op0) == DImode
&& v9_regcmp_p (code))
{
- operands[1] = gen_rtx (code, DImode,
+ operands[1] = gen_rtx_fmt_ee (code, DImode,
sparc_compare_op0, sparc_compare_op1);
}
else
{
rtx cc_reg = gen_compare_reg (code,
sparc_compare_op0, sparc_compare_op1);
- operands[1] = gen_rtx (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
+ operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
}
}")
@@ -2729,14 +3577,14 @@
&& GET_MODE (sparc_compare_op0) == DImode
&& v9_regcmp_p (code))
{
- operands[1] = gen_rtx (code, DImode,
+ operands[1] = gen_rtx_fmt_ee (code, DImode,
sparc_compare_op0, sparc_compare_op1);
}
else
{
rtx cc_reg = gen_compare_reg (code,
sparc_compare_op0, sparc_compare_op1);
- operands[1] = gen_rtx (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
+ operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
}
}")
@@ -2753,8 +3601,7 @@
if (sparc_compare_op1 == const0_rtx
&& GET_CODE (sparc_compare_op0) == REG
- && ((TARGET_ARCH64 && op0_mode == DImode && v9_regcmp_p (code))
- || (op0_mode == SImode && v8plus_regcmp_p (code))))
+ && (TARGET_ARCH64 && op0_mode == DImode && v9_regcmp_p (code)))
{
operands[1] = gen_rtx_fmt_ee (code, op0_mode,
sparc_compare_op0, sparc_compare_op1);
@@ -2814,14 +3661,14 @@
&& GET_MODE (sparc_compare_op0) == DImode
&& v9_regcmp_p (code))
{
- operands[1] = gen_rtx (code, DImode,
+ operands[1] = gen_rtx_fmt_ee (code, DImode,
sparc_compare_op0, sparc_compare_op1);
}
else
{
rtx cc_reg = gen_compare_reg (code,
sparc_compare_op0, sparc_compare_op1);
- operands[1] = gen_rtx (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
+ operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
}
}")
@@ -2844,14 +3691,14 @@
&& GET_MODE (sparc_compare_op0) == DImode
&& v9_regcmp_p (code))
{
- operands[1] = gen_rtx (code, DImode,
+ operands[1] = gen_rtx_fmt_ee (code, DImode,
sparc_compare_op0, sparc_compare_op1);
}
else
{
rtx cc_reg = gen_compare_reg (code,
sparc_compare_op0, sparc_compare_op1);
- operands[1] = gen_rtx (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
+ operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
}
}")
@@ -2874,14 +3721,14 @@
&& GET_MODE (sparc_compare_op0) == DImode
&& v9_regcmp_p (code))
{
- operands[1] = gen_rtx (code, DImode,
+ operands[1] = gen_rtx_fmt_ee (code, DImode,
sparc_compare_op0, sparc_compare_op1);
}
else
{
rtx cc_reg = gen_compare_reg (code,
sparc_compare_op0, sparc_compare_op1);
- operands[1] = gen_rtx (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
+ operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx);
}
}")
@@ -2892,39 +3739,42 @@
(if_then_else:QI (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:QI 3 "arith11_operand" "rL,0")
- (match_operand:QI 4 "arith11_operand" "0,rL")))]
+ (match_operand:QI 3 "arith11_operand" "rL,0")
+ (match_operand:QI 4 "arith11_operand" "0,rL")))]
"TARGET_V9"
"@
- mov%C1 %x2,%3,%0
- mov%c1 %x2,%4,%0"
- [(set_attr "type" "cmove")])
+ mov%C1\\t%x2, %3, %0
+ mov%c1\\t%x2, %4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
(define_insn "*movhi_cc_sp64"
[(set (match_operand:HI 0 "register_operand" "=r,r")
(if_then_else:HI (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:HI 3 "arith11_operand" "rL,0")
- (match_operand:HI 4 "arith11_operand" "0,rL")))]
+ (match_operand:HI 3 "arith11_operand" "rL,0")
+ (match_operand:HI 4 "arith11_operand" "0,rL")))]
"TARGET_V9"
"@
- mov%C1 %x2,%3,%0
- mov%c1 %x2,%4,%0"
- [(set_attr "type" "cmove")])
+ mov%C1\\t%x2, %3, %0
+ mov%c1\\t%x2, %4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
(define_insn "*movsi_cc_sp64"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(if_then_else:SI (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:SI 3 "arith11_operand" "rL,0")
- (match_operand:SI 4 "arith11_operand" "0,rL")))]
+ (match_operand:SI 3 "arith11_operand" "rL,0")
+ (match_operand:SI 4 "arith11_operand" "0,rL")))]
"TARGET_V9"
"@
- mov%C1 %x2,%3,%0
- mov%c1 %x2,%4,%0"
- [(set_attr "type" "cmove")])
+ mov%C1\\t%x2, %3, %0
+ mov%c1\\t%x2, %4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
;; ??? The constraints of operands 3,4 need work.
(define_insn "*movdi_cc_sp64"
@@ -2932,142 +3782,112 @@
(if_then_else:DI (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:DI 3 "arith11_double_operand" "rLH,0")
- (match_operand:DI 4 "arith11_double_operand" "0,rLH")))]
+ (match_operand:DI 3 "arith11_double_operand" "rLH,0")
+ (match_operand:DI 4 "arith11_double_operand" "0,rLH")))]
+ "TARGET_ARCH64"
+ "@
+ mov%C1\\t%x2, %3, %0
+ mov%c1\\t%x2, %4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
+
+(define_insn "*movdi_cc_sp64_trunc"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (if_then_else:SI (match_operator 1 "comparison_operator"
+ [(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
+ (const_int 0)])
+ (match_operand:SI 3 "arith11_double_operand" "rLH,0")
+ (match_operand:SI 4 "arith11_double_operand" "0,rLH")))]
"TARGET_ARCH64"
"@
- mov%C1 %x2,%3,%0
- mov%c1 %x2,%4,%0"
- [(set_attr "type" "cmove")])
+ mov%C1\\t%x2, %3, %0
+ mov%c1\\t%x2, %4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
(define_insn "*movsf_cc_sp64"
[(set (match_operand:SF 0 "register_operand" "=f,f")
(if_then_else:SF (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:SF 3 "register_operand" "f,0")
- (match_operand:SF 4 "register_operand" "0,f")))]
+ (match_operand:SF 3 "register_operand" "f,0")
+ (match_operand:SF 4 "register_operand" "0,f")))]
"TARGET_V9 && TARGET_FPU"
"@
- fmovs%C1 %x2,%3,%0
- fmovs%c1 %x2,%4,%0"
- [(set_attr "type" "fpcmove")])
+ fmovs%C1\\t%x2, %3, %0
+ fmovs%c1\\t%x2, %4, %0"
+ [(set_attr "type" "fpcmove")
+ (set_attr "length" "1")])
(define_insn "*movdf_cc_sp64"
[(set (match_operand:DF 0 "register_operand" "=e,e")
(if_then_else:DF (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:DF 3 "register_operand" "e,0")
- (match_operand:DF 4 "register_operand" "0,e")))]
+ (match_operand:DF 3 "register_operand" "e,0")
+ (match_operand:DF 4 "register_operand" "0,e")))]
"TARGET_V9 && TARGET_FPU"
"@
- fmovd%C1 %x2,%3,%0
- fmovd%c1 %x2,%4,%0"
- [(set_attr "type" "fpcmove")])
+ fmovd%C1\\t%x2, %3, %0
+ fmovd%c1\\t%x2, %4, %0"
+ [(set_attr "type" "fpcmove")
+ (set_attr "length" "1")])
(define_insn "*movtf_cc_sp64"
[(set (match_operand:TF 0 "register_operand" "=e,e")
(if_then_else:TF (match_operator 1 "comparison_operator"
[(match_operand 2 "icc_or_fcc_reg_operand" "X,X")
(const_int 0)])
- (match_operand:TF 3 "register_operand" "e,0")
- (match_operand:TF 4 "register_operand" "0,e")))]
+ (match_operand:TF 3 "register_operand" "e,0")
+ (match_operand:TF 4 "register_operand" "0,e")))]
"TARGET_V9 && TARGET_FPU && TARGET_HARD_QUAD"
"@
- fmovq%C1 %x2,%3,%0
- fmovq%c1 %x2,%4,%0"
- [(set_attr "type" "fpcmove")])
+ fmovq%C1\\t%x2, %3, %0
+ fmovq%c1\\t%x2, %4, %0"
+ [(set_attr "type" "fpcmove")
+ (set_attr "length" "1")])
(define_insn "*movqi_cc_reg_sp64"
[(set (match_operand:QI 0 "register_operand" "=r,r")
(if_then_else:QI (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:QI 3 "arith10_operand" "rM,0")
- (match_operand:QI 4 "arith10_operand" "0,rM")))]
+ (match_operand:QI 3 "arith10_operand" "rM,0")
+ (match_operand:QI 4 "arith10_operand" "0,rM")))]
"TARGET_ARCH64"
"@
- movr%D1 %2,%r3,%0
- movr%d1 %2,%r4,%0"
- [(set_attr "type" "cmove")])
+ movr%D1\\t%2, %r3, %0
+ movr%d1\\t%2, %r4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
(define_insn "*movhi_cc_reg_sp64"
[(set (match_operand:HI 0 "register_operand" "=r,r")
(if_then_else:HI (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:HI 3 "arith10_operand" "rM,0")
- (match_operand:HI 4 "arith10_operand" "0,rM")))]
+ (match_operand:HI 3 "arith10_operand" "rM,0")
+ (match_operand:HI 4 "arith10_operand" "0,rM")))]
"TARGET_ARCH64"
"@
- movr%D1 %2,%r3,%0
- movr%d1 %2,%r4,%0"
- [(set_attr "type" "cmove")])
+ movr%D1\\t%2, %r3, %0
+ movr%d1\\t%2, %r4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
(define_insn "*movsi_cc_reg_sp64"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(if_then_else:SI (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:SI 3 "arith10_operand" "rM,0")
- (match_operand:SI 4 "arith10_operand" "0,rM")))]
+ (match_operand:SI 3 "arith10_operand" "rM,0")
+ (match_operand:SI 4 "arith10_operand" "0,rM")))]
"TARGET_ARCH64"
"@
- movr%D1 %2,%r3,%0
- movr%d1 %2,%r4,%0"
- [(set_attr "type" "cmove")])
-
-;; On UltraSPARC this is slightly worse than cmp/mov %icc if the register
-;; needs to be zero extended but better on average.
-(define_insn "*movsi_cc_reg_v8plus"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (if_then_else:SI (match_operator 1 "v8plus_regcmp_op"
- [(match_operand:SI 2 "register_operand" "r,r")
- (const_int 0)])
- (match_operand:SI 3 "arith10_operand" "rM,0")
- (match_operand:SI 4 "arith10_operand" "0,rM")))]
- "TARGET_V9"
- "*
-{
- if (! sparc_check_64 (operands[2], insn))
- output_asm_insn (\"srl %2,0,%2\", operands);
- if (which_alternative == 0)
- return \"movr%D1 %2,%r3,%0\";
- return \"movr%d1 %2,%r4,%0\";
-}"
+ movr%D1\\t%2, %r3, %0
+ movr%d1\\t%2, %r4, %0"
[(set_attr "type" "cmove")
- (set_attr "length" "2")])
-
-;; To work well this needs to know the current insn, but that is not an
-;; argument to gen_split_*.
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (if_then_else:SI (match_operator 1 "v8plus_regcmp_op"
- [(match_operand:SI 2 "register_operand" "r,r")
- (const_int 0)])
- (match_operand:SI 3 "arith10_operand" "rM,0")
- (match_operand:SI 4 "arith10_operand" "0,rM")))]
- "reload_completed"
- [(set (match_dup 0)
- (unspec:SI [(match_dup 1) (match_dup 3) (match_dup 4)] 9))]
- "if (! sparc_check_64 (operands[2], NULL_RTX))
- emit_insn (gen_v8plus_clear_high (operands[2], operands[2]));")
-
-;; A conditional move with the condition argument known to be zero extended
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (unspec:SI [(match_operator 1 "v8plus_regcmp_op"
- [(match_operand:SI 2 "register_operand" "r,r")
- (const_int 0)])
- (match_operand:SI 3 "arith10_operand" "rM,0")
- (match_operand:SI 4 "arith10_operand" "0,rM")] 9))]
- "TARGET_V9"
- "@
- movr%D1 %2,%r3,%0
- movr%d1 %2,%r4,%0"
- [(set_attr "type" "cmove")])
+ (set_attr "length" "1")])
;; ??? The constraints of operands 3,4 need work.
(define_insn "*movdi_cc_reg_sp64"
@@ -3075,52 +3895,70 @@
(if_then_else:DI (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:DI 3 "arith10_double_operand" "rMH,0")
- (match_operand:DI 4 "arith10_double_operand" "0,rMH")))]
+ (match_operand:DI 3 "arith10_double_operand" "rMH,0")
+ (match_operand:DI 4 "arith10_double_operand" "0,rMH")))]
+ "TARGET_ARCH64"
+ "@
+ movr%D1\\t%2, %r3, %0
+ movr%d1\\t%2, %r4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
+
+(define_insn "*movdi_cc_reg_sp64_trunc"
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (if_then_else:SI (match_operator 1 "v9_regcmp_op"
+ [(match_operand:DI 2 "register_operand" "r,r")
+ (const_int 0)])
+ (match_operand:SI 3 "arith10_double_operand" "rMH,0")
+ (match_operand:SI 4 "arith10_double_operand" "0,rMH")))]
"TARGET_ARCH64"
"@
- movr%D1 %2,%r3,%0
- movr%d1 %2,%r4,%0"
- [(set_attr "type" "cmove")])
+ movr%D1\\t%2, %r3, %0
+ movr%d1\\t%2, %r4, %0"
+ [(set_attr "type" "cmove")
+ (set_attr "length" "1")])
(define_insn "*movsf_cc_reg_sp64"
[(set (match_operand:SF 0 "register_operand" "=f,f")
(if_then_else:SF (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:SF 3 "register_operand" "f,0")
- (match_operand:SF 4 "register_operand" "0,f")))]
+ (match_operand:SF 3 "register_operand" "f,0")
+ (match_operand:SF 4 "register_operand" "0,f")))]
"TARGET_ARCH64 && TARGET_FPU"
"@
- fmovrs%D1 %2,%3,%0
- fmovrs%d1 %2,%4,%0"
- [(set_attr "type" "fpcmove")])
+ fmovrs%D1\\t%2, %3, %0
+ fmovrs%d1\\t%2, %4, %0"
+ [(set_attr "type" "fpcmove")
+ (set_attr "length" "1")])
(define_insn "*movdf_cc_reg_sp64"
[(set (match_operand:DF 0 "register_operand" "=e,e")
(if_then_else:DF (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:DF 3 "register_operand" "e,0")
- (match_operand:DF 4 "register_operand" "0,e")))]
+ (match_operand:DF 3 "register_operand" "e,0")
+ (match_operand:DF 4 "register_operand" "0,e")))]
"TARGET_ARCH64 && TARGET_FPU"
"@
- fmovrd%D1 %2,%3,%0
- fmovrd%d1 %2,%4,%0"
- [(set_attr "type" "fpcmove")])
+ fmovrd%D1\\t%2, %3, %0
+ fmovrd%d1\\t%2, %4, %0"
+ [(set_attr "type" "fpcmove")
+ (set_attr "length" "1")])
(define_insn "*movtf_cc_reg_sp64"
[(set (match_operand:TF 0 "register_operand" "=e,e")
(if_then_else:TF (match_operator 1 "v9_regcmp_op"
[(match_operand:DI 2 "register_operand" "r,r")
(const_int 0)])
- (match_operand:TF 3 "register_operand" "e,0")
- (match_operand:TF 4 "register_operand" "0,e")))]
+ (match_operand:TF 3 "register_operand" "e,0")
+ (match_operand:TF 4 "register_operand" "0,e")))]
"TARGET_ARCH64 && TARGET_FPU"
"@
- fmovrq%D1 %2,%3,%0
- fmovrq%d1 %2,%4,%0"
- [(set_attr "type" "fpcmove")])
+ fmovrq%D1\\t%2, %3, %0
+ fmovrq%d1\\t%2, %4, %0"
+ [(set_attr "type" "fpcmove")
+ (set_attr "length" "1")])
;;- zero extension instructions
@@ -3144,7 +3982,7 @@
operand1 = XEXP (operand1, 0);
}
- emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1,
+ emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1,
op1_subword),
shift_16));
emit_insn (gen_lshrsi3 (operand0, temp, shift_16));
@@ -3155,8 +3993,9 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
""
- "lduh %1,%0"
- [(set_attr "type" "load")])
+ "lduh\\t%1, %0"
+ [(set_attr "type" "load")
+ (set_attr "length" "1")])
(define_expand "zero_extendqihi2"
[(set (match_operand:HI 0 "register_operand" "")
@@ -3166,11 +4005,11 @@
(define_insn "*zero_extendqihi2_insn"
[(set (match_operand:HI 0 "register_operand" "=r,r")
- (zero_extend:HI (match_operand:QI 1 "sparc_operand" "r,Q")))]
+ (zero_extend:HI (match_operand:QI 1 "input_operand" "r,m")))]
"GET_CODE (operands[1]) != CONST_INT"
"@
- and %1,0xff,%0
- ldub %1,%0"
+ and\\t%1, 0xff, %0
+ ldub\\t%1, %0"
[(set_attr "type" "unary,load")
(set_attr "length" "1")])
@@ -3182,11 +4021,11 @@
(define_insn "*zero_extendqisi2_insn"
[(set (match_operand:SI 0 "register_operand" "=r,r")
- (zero_extend:SI (match_operand:QI 1 "sparc_operand" "r,Q")))]
+ (zero_extend:SI (match_operand:QI 1 "input_operand" "r,m")))]
"GET_CODE (operands[1]) != CONST_INT"
"@
- and %1,0xff,%0
- ldub %1,%0"
+ and\\t%1, 0xff, %0
+ ldub\\t%1, %0"
[(set_attr "type" "unary,load")
(set_attr "length" "1")])
@@ -3198,11 +4037,11 @@
(define_insn "*zero_extendqidi2_insn"
[(set (match_operand:DI 0 "register_operand" "=r,r")
- (zero_extend:DI (match_operand:QI 1 "sparc_operand" "r,Q")))]
+ (zero_extend:DI (match_operand:QI 1 "input_operand" "r,m")))]
"TARGET_ARCH64 && GET_CODE (operands[1]) != CONST_INT"
"@
- and %1,0xff,%0
- ldub %1,%0"
+ and\\t%1, 0xff, %0
+ ldub\\t%1, %0"
[(set_attr "type" "unary,load")
(set_attr "length" "1")])
@@ -3222,8 +4061,8 @@
operand1 = XEXP (operand1, 0);
}
- emit_insn (gen_ashldi3 (temp, gen_rtx (SUBREG, DImode, operand1,
- op1_subword),
+ emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1,
+ op1_subword),
shift_48));
emit_insn (gen_lshrdi3 (operand0, temp, shift_48));
DONE;
@@ -3233,8 +4072,9 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
"TARGET_ARCH64"
- "lduh %1,%0"
- [(set_attr "type" "load")])
+ "lduh\\t%1, %0"
+ [(set_attr "type" "load")
+ (set_attr "length" "1")])
;; ??? Write truncdisi pattern using sra?
@@ -3242,32 +4082,59 @@
(define_expand "zero_extendsidi2"
[(set (match_operand:DI 0 "register_operand" "")
(zero_extend:DI (match_operand:SI 1 "register_operand" "")))]
- "TARGET_ARCH64"
+ ""
"")
-(define_insn "*zero_extendsidi2_insn"
+(define_insn "*zero_extendsidi2_insn_sp64"
[(set (match_operand:DI 0 "register_operand" "=r,r")
- (zero_extend:DI (match_operand:SI 1 "sparc_operand" "r,Q")))]
+ (zero_extend:DI (match_operand:SI 1 "input_operand" "r,m")))]
"TARGET_ARCH64 && GET_CODE (operands[1]) != CONST_INT"
"@
- srl %1,0,%0
- lduw %1,%0"
- [(set_attr "type" "unary,load")
+ srl\\t%1, 0, %0
+ lduw\\t%1, %0"
+ [(set_attr "type" "shift,load")
(set_attr "length" "1")])
-;; Zero extend a 32 bit value in a 64 bit register.
-(define_insn "v8plus_clear_high"
- [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand" "=r,Q")
- (unspec:SI [(match_operand:SI 1 "register_operand" "r,r")] 10))]
- "TARGET_V9"
- "*
-if (which_alternative == 1)
- return \"st %1,%0\";
-if (sparc_check_64 (operands[1], insn) > 0)
- return \"nop\";
-return \"srl %1,0,%0\";
-"
- [(set_attr "type" "shift,store")])
+(define_insn "*zero_extendsidi2_insn_sp32"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
+ "! TARGET_ARCH64"
+ "#"
+ [(set_attr "type" "unary")
+ (set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extend:DI (match_operand:SI 1 "register_operand" "")))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(set (match_dup 2) (match_dup 3))
+ (set (match_dup 4) (match_dup 5))]
+ "
+{
+ rtx dest1, dest2;
+
+ if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+
+ dest1 = gen_highpart (SImode, operands[0]);
+ dest2 = gen_lowpart (SImode, operands[0]);
+
+ /* Swap the order in case of overlap. */
+ if (REGNO (dest1) == REGNO (operands[1]))
+ {
+ operands[2] = dest2;
+ operands[3] = operands[1];
+ operands[4] = dest1;
+ operands[5] = const0_rtx;
+ }
+ else
+ {
+ operands[2] = dest1;
+ operands[3] = const0_rtx;
+ operands[4] = dest2;
+ operands[5] = operands[1];
+ }
+}")
;; Simplify comparisons of extended values.
@@ -3275,9 +4142,10 @@ return \"srl %1,0,%0\";
[(set (reg:CC 100)
(compare:CC (zero_extend:SI (match_operand:QI 0 "register_operand" "r"))
(const_int 0)))]
- ""
- "andcc %0,0xff,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "andcc\\t%0, 0xff, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_zero_extendqisi2_set"
[(set (reg:CC 100)
@@ -3286,28 +4154,71 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_dup 1)))]
""
- "andcc %1,0xff,%0"
- [(set_attr "type" "unary")])
+ "andcc\\t%1, 0xff, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
+
+(define_insn "*cmp_zero_extendqidi2"
+ [(set (reg:CCX 100)
+ (compare:CCX (zero_extend:DI (match_operand:QI 0 "register_operand" "r"))
+ (const_int 0)))]
+ "TARGET_ARCH64"
+ "andcc\\t%0, 0xff, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
-;; Similarly, handle SI->QI mode truncation followed by a compare.
+(define_insn "*cmp_zero_extendqidi2_set"
+ [(set (reg:CCX 100)
+ (compare:CCX (zero_extend:DI (match_operand:QI 1 "register_operand" "r"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (match_dup 1)))]
+ "TARGET_ARCH64"
+ "andcc\\t%1, 0xff, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
+
+;; Similarly, handle {SI,DI}->QI mode truncation followed by a compare.
(define_insn "*cmp_siqi_trunc"
[(set (reg:CC 100)
(compare:CC (subreg:QI (match_operand:SI 0 "register_operand" "r") 0)
(const_int 0)))]
- ""
- "andcc %0,0xff,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "andcc\\t%0, 0xff, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_siqi_trunc_set"
[(set (reg:CC 100)
(compare:CC (subreg:QI (match_operand:SI 1 "register_operand" "r") 0)
(const_int 0)))
(set (match_operand:QI 0 "register_operand" "=r")
- (match_dup 1))]
+ (subreg:QI (match_dup 1) 0))]
""
- "andcc %1,0xff,%0"
- [(set_attr "type" "unary")])
+ "andcc\\t%1, 0xff, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
+
+(define_insn "*cmp_diqi_trunc"
+ [(set (reg:CC 100)
+ (compare:CC (subreg:QI (match_operand:DI 0 "register_operand" "r") 0)
+ (const_int 0)))]
+ "TARGET_ARCH64"
+ "andcc\\t%0, 0xff, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
+
+(define_insn "*cmp_diqi_trunc_set"
+ [(set (reg:CC 100)
+ (compare:CC (subreg:QI (match_operand:DI 1 "register_operand" "r") 0)
+ (const_int 0)))
+ (set (match_operand:QI 0 "register_operand" "=r")
+ (subreg:QI (match_dup 1) 0))]
+ "TARGET_ARCH64"
+ "andcc\\t%1, 0xff, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
;;- sign extension instructions
@@ -3331,8 +4242,8 @@ return \"srl %1,0,%0\";
operand1 = XEXP (operand1, 0);
}
- emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1,
- op1_subword),
+ emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1,
+ op1_subword),
shift_16));
emit_insn (gen_ashrsi3 (operand0, temp, shift_16));
DONE;
@@ -3342,8 +4253,9 @@ return \"srl %1,0,%0\";
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
""
- "ldsh %1,%0"
- [(set_attr "type" "sload")])
+ "ldsh\\t%1, %0"
+ [(set_attr "type" "sload")
+ (set_attr "length" "1")])
(define_expand "extendqihi2"
[(set (match_operand:HI 0 "register_operand" "")
@@ -3366,11 +4278,11 @@ return \"srl %1,0,%0\";
op0_subword = SUBREG_WORD (operand0);
operand0 = XEXP (operand0, 0);
}
- emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1,
- op1_subword),
+ emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1,
+ op1_subword),
shift_24));
if (GET_MODE (operand0) != SImode)
- operand0 = gen_rtx (SUBREG, SImode, operand0, op0_subword);
+ operand0 = gen_rtx_SUBREG (SImode, operand0, op0_subword);
emit_insn (gen_ashrsi3 (operand0, temp, shift_24));
DONE;
}")
@@ -3379,8 +4291,9 @@ return \"srl %1,0,%0\";
[(set (match_operand:HI 0 "register_operand" "=r")
(sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
""
- "ldsb %1,%0"
- [(set_attr "type" "sload")])
+ "ldsb\\t%1, %0"
+ [(set_attr "type" "sload")
+ (set_attr "length" "1")])
(define_expand "extendqisi2"
[(set (match_operand:SI 0 "register_operand" "")
@@ -3398,8 +4311,8 @@ return \"srl %1,0,%0\";
operand1 = XEXP (operand1, 0);
}
- emit_insn (gen_ashlsi3 (temp, gen_rtx (SUBREG, SImode, operand1,
- op1_subword),
+ emit_insn (gen_ashlsi3 (temp, gen_rtx_SUBREG (SImode, operand1,
+ op1_subword),
shift_24));
emit_insn (gen_ashrsi3 (operand0, temp, shift_24));
DONE;
@@ -3409,8 +4322,9 @@ return \"srl %1,0,%0\";
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
""
- "ldsb %1,%0"
- [(set_attr "type" "sload")])
+ "ldsb\\t%1, %0"
+ [(set_attr "type" "sload")
+ (set_attr "length" "1")])
(define_expand "extendqidi2"
[(set (match_operand:DI 0 "register_operand" "")
@@ -3428,8 +4342,8 @@ return \"srl %1,0,%0\";
operand1 = XEXP (operand1, 0);
}
- emit_insn (gen_ashldi3 (temp, gen_rtx (SUBREG, DImode, operand1,
- op1_subword),
+ emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1,
+ op1_subword),
shift_56));
emit_insn (gen_ashrdi3 (operand0, temp, shift_56));
DONE;
@@ -3439,8 +4353,9 @@ return \"srl %1,0,%0\";
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
"TARGET_ARCH64"
- "ldsb %1,%0"
- [(set_attr "type" "sload")])
+ "ldsb\\t%1, %0"
+ [(set_attr "type" "sload")
+ (set_attr "length" "1")])
(define_expand "extendhidi2"
[(set (match_operand:DI 0 "register_operand" "")
@@ -3458,8 +4373,8 @@ return \"srl %1,0,%0\";
operand1 = XEXP (operand1, 0);
}
- emit_insn (gen_ashldi3 (temp, gen_rtx (SUBREG, DImode, operand1,
- op1_subword),
+ emit_insn (gen_ashldi3 (temp, gen_rtx_SUBREG (DImode, operand1,
+ op1_subword),
shift_48));
emit_insn (gen_ashrdi3 (operand0, temp, shift_48));
DONE;
@@ -3469,8 +4384,9 @@ return \"srl %1,0,%0\";
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
"TARGET_ARCH64"
- "ldsh %1,%0"
- [(set_attr "type" "load")])
+ "ldsh\\t%1, %0"
+ [(set_attr "type" "sload")
+ (set_attr "length" "1")])
(define_expand "extendsidi2"
[(set (match_operand:DI 0 "register_operand" "")
@@ -3480,12 +4396,12 @@ return \"srl %1,0,%0\";
(define_insn "*sign_extendsidi2_insn"
[(set (match_operand:DI 0 "register_operand" "=r,r")
- (sign_extend:DI (match_operand:SI 1 "sparc_operand" "r,Q")))]
+ (sign_extend:DI (match_operand:SI 1 "input_operand" "r,m")))]
"TARGET_ARCH64"
"@
- sra %1,0,%0
- ldsw %1,%0"
- [(set_attr "type" "unary,sload")
+ sra\\t%1, 0, %0
+ ldsw\\t%1, %0"
+ [(set_attr "type" "shift,sload")
(set_attr "length" "1")])
;; Special pattern for optimizing bit-field compares. This is needed
@@ -3495,37 +4411,59 @@ return \"srl %1,0,%0\";
[(set (reg:CC 100)
(compare:CC
(zero_extract:SI (match_operand:SI 0 "register_operand" "r")
- (match_operand:SI 1 "small_int" "n")
- (match_operand:SI 2 "small_int" "n"))
+ (match_operand:SI 1 "small_int_or_double" "n")
+ (match_operand:SI 2 "small_int_or_double" "n"))
(const_int 0)))]
- "INTVAL (operands[2]) > 19"
+ "! TARGET_LIVE_G0
+ && ((GET_CODE (operands[2]) == CONST_INT
+ && INTVAL (operands[2]) > 19)
+ || (GET_CODE (operands[2]) == CONST_DOUBLE
+ && CONST_DOUBLE_LOW (operands[2]) > 19))"
"*
{
- int len = INTVAL (operands[1]);
- int pos = 32 - INTVAL (operands[2]) - len;
- unsigned mask = ((1 << len) - 1) << pos;
+ int len = (GET_CODE (operands[1]) == CONST_INT
+ ? INTVAL (operands[1])
+ : CONST_DOUBLE_LOW (operands[1]));
+ int pos = 32 -
+ (GET_CODE (operands[2]) == CONST_INT
+ ? INTVAL (operands[2])
+ : CONST_DOUBLE_LOW (operands[2])) - len;
+ HOST_WIDE_INT mask = ((1 << len) - 1) << pos;
operands[1] = GEN_INT (mask);
- return \"andcc %0,%1,%%g0\";
-}")
+ return \"andcc\\t%0, %1, %%g0\";
+}"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_zero_extract_sp64"
[(set (reg:CCX 100)
(compare:CCX
(zero_extract:DI (match_operand:DI 0 "register_operand" "r")
- (match_operand:SI 1 "small_int" "n")
- (match_operand:SI 2 "small_int" "n"))
+ (match_operand:SI 1 "small_int_or_double" "n")
+ (match_operand:SI 2 "small_int_or_double" "n"))
(const_int 0)))]
- "TARGET_ARCH64 && INTVAL (operands[2]) > 51"
+ "TARGET_ARCH64
+ && ((GET_CODE (operands[2]) == CONST_INT
+ && INTVAL (operands[2]) > 51)
+ || (GET_CODE (operands[2]) == CONST_DOUBLE
+ && CONST_DOUBLE_LOW (operands[2]) > 51))"
"*
{
- int len = INTVAL (operands[1]);
- int pos = 64 - INTVAL (operands[2]) - len;
- unsigned HOST_WIDE_INT mask = (((unsigned HOST_WIDE_INT) 1 << len) - 1) << pos;
+ int len = (GET_CODE (operands[1]) == CONST_INT
+ ? INTVAL (operands[1])
+ : CONST_DOUBLE_LOW (operands[1]));
+ int pos = 64 -
+ (GET_CODE (operands[2]) == CONST_INT
+ ? INTVAL (operands[2])
+ : CONST_DOUBLE_LOW (operands[2])) - len;
+ HOST_WIDE_INT mask = (((unsigned HOST_WIDE_INT) 1 << len) - 1) << pos;
operands[1] = GEN_INT (mask);
- return \"andcc %0,%1,%%g0\";
-}")
+ return \"andcc\\t%0, %1, %%g0\";
+}"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
;; Conversions between float, double and long double.
@@ -3534,48 +4472,54 @@ return \"srl %1,0,%0\";
(float_extend:DF
(match_operand:SF 1 "register_operand" "f")))]
"TARGET_FPU"
- "fstod %1,%0"
- [(set_attr "type" "fp")])
+ "fstod\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "extendsftf2"
[(set (match_operand:TF 0 "register_operand" "=e")
(float_extend:TF
(match_operand:SF 1 "register_operand" "f")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fstoq %1,%0"
- [(set_attr "type" "fp")])
+ "fstoq\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "extenddftf2"
[(set (match_operand:TF 0 "register_operand" "=e")
(float_extend:TF
(match_operand:DF 1 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fdtoq %1,%0"
- [(set_attr "type" "fp")])
+ "fdtoq\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "truncdfsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(float_truncate:SF
(match_operand:DF 1 "register_operand" "e")))]
"TARGET_FPU"
- "fdtos %1,%0"
- [(set_attr "type" "fp")])
+ "fdtos\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "trunctfsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(float_truncate:SF
(match_operand:TF 1 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fqtos %1,%0"
- [(set_attr "type" "fp")])
+ "fqtos\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "trunctfdf2"
[(set (match_operand:DF 0 "register_operand" "=e")
(float_truncate:DF
(match_operand:TF 1 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fqtod %1,%0"
- [(set_attr "type" "fp")])
+ "fqtod\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
;; Conversion between fixed point and floating point.
@@ -3583,22 +4527,25 @@ return \"srl %1,0,%0\";
[(set (match_operand:SF 0 "register_operand" "=f")
(float:SF (match_operand:SI 1 "register_operand" "f")))]
"TARGET_FPU"
- "fitos %1,%0"
- [(set_attr "type" "fp")])
+ "fitos\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "floatsidf2"
[(set (match_operand:DF 0 "register_operand" "=e")
(float:DF (match_operand:SI 1 "register_operand" "f")))]
"TARGET_FPU"
- "fitod %1,%0"
- [(set_attr "type" "fp")])
+ "fitod\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "floatsitf2"
[(set (match_operand:TF 0 "register_operand" "=e")
(float:TF (match_operand:SI 1 "register_operand" "f")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fitoq %1,%0"
- [(set_attr "type" "fp")])
+ "fitoq\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
;; Now the same for 64 bit sources.
@@ -3606,22 +4553,25 @@ return \"srl %1,0,%0\";
[(set (match_operand:SF 0 "register_operand" "=f")
(float:SF (match_operand:DI 1 "register_operand" "e")))]
"TARGET_V9 && TARGET_FPU"
- "fxtos %1,%0"
- [(set_attr "type" "fp")])
+ "fxtos\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "floatdidf2"
[(set (match_operand:DF 0 "register_operand" "=e")
(float:DF (match_operand:DI 1 "register_operand" "e")))]
"TARGET_V9 && TARGET_FPU"
- "fxtod %1,%0"
- [(set_attr "type" "fp")])
+ "fxtod\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "floatditf2"
[(set (match_operand:TF 0 "register_operand" "=e")
(float:TF (match_operand:DI 1 "register_operand" "e")))]
"TARGET_V9 && TARGET_FPU && TARGET_HARD_QUAD"
- "fxtoq %1,%0"
- [(set_attr "type" "fp")])
+ "fxtoq\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
;; Convert a float to an actual integer.
;; Truncation is performed as part of the conversion.
@@ -3630,22 +4580,25 @@ return \"srl %1,0,%0\";
[(set (match_operand:SI 0 "register_operand" "=f")
(fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
"TARGET_FPU"
- "fstoi %1,%0"
- [(set_attr "type" "fp")])
+ "fstoi\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "fix_truncdfsi2"
[(set (match_operand:SI 0 "register_operand" "=f")
(fix:SI (fix:DF (match_operand:DF 1 "register_operand" "e"))))]
"TARGET_FPU"
- "fdtoi %1,%0"
- [(set_attr "type" "fp")])
+ "fdtoi\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "fix_trunctfsi2"
[(set (match_operand:SI 0 "register_operand" "=f")
(fix:SI (fix:TF (match_operand:TF 1 "register_operand" "e"))))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fqtoi %1,%0"
- [(set_attr "type" "fp")])
+ "fqtoi\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
;; Now the same, for V9 targets
@@ -3653,82 +4606,68 @@ return \"srl %1,0,%0\";
[(set (match_operand:DI 0 "register_operand" "=e")
(fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
"TARGET_V9 && TARGET_FPU"
- "fstox %1,%0"
- [(set_attr "type" "fp")])
+ "fstox\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "fix_truncdfdi2"
[(set (match_operand:DI 0 "register_operand" "=e")
(fix:DI (fix:DF (match_operand:DF 1 "register_operand" "e"))))]
"TARGET_V9 && TARGET_FPU"
- "fdtox %1,%0"
- [(set_attr "type" "fp")])
+ "fdtox\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "fix_trunctfdi2"
[(set (match_operand:DI 0 "register_operand" "=e")
(fix:DI (fix:TF (match_operand:TF 1 "register_operand" "e"))))]
"TARGET_V9 && TARGET_FPU && TARGET_HARD_QUAD"
- "fqtox %1,%0"
- [(set_attr "type" "fp")])
+ "fqtox\\t%1, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
;;- arithmetic instructions
(define_expand "adddi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_operand:DI 1 "arith_double_operand" "%r")
- (match_operand:DI 2 "arith_double_operand" "rHI")))]
+ (match_operand:DI 2 "arith_double_add_operand" "rHI")))]
""
"
{
if (! TARGET_ARCH64)
{
- emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (PLUS, DImode, operands[1],
- operands[2])),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, SImode, SPARC_ICC_REG)))));
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2,
+ gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_PLUS (DImode, operands[1],
+ operands[2])),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (CCmode, SPARC_ICC_REG)))));
+ DONE;
+ }
+ if (arith_double_4096_operand(operands[2], DImode))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_MINUS (DImode, operands[1],
+ GEN_INT(-4096))));
DONE;
}
}")
-(define_insn "*adddi3_sp32"
+(define_insn "adddi3_insn_sp32"
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_operand:DI 1 "arith_double_operand" "%r")
(match_operand:DI 2 "arith_double_operand" "rHI")))
- (clobber (reg:SI 100))]
+ (clobber (reg:CC 100))]
"! TARGET_ARCH64"
- "*
-{
- rtx op2 = operands[2];
-
- if (GET_CODE (op2) == CONST_INT
- || GET_CODE (op2) == CONST_DOUBLE)
- {
- rtx xoperands[4];
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- if (WORDS_BIG_ENDIAN)
- split_double (op2, &xoperands[2], &xoperands[3]);
- else
- split_double (op2, &xoperands[3], &xoperands[2]);
- if (xoperands[3] == const0_rtx && xoperands[0] == xoperands[1])
- output_asm_insn (\"add %H1,%2,%H0\", xoperands);
- else
- output_asm_insn (\"addcc %L1,%3,%L0\;addx %H1,%2,%H0\", xoperands);
- return \"\";
- }
- return \"addcc %L1,%L2,%L0\;addx %H1,%H2,%H0\";
-}"
+ "#"
[(set_attr "length" "2")])
-
-;; Split DImode arithmetic
-
(define_split
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_operand:DI 1 "arith_double_operand" "%r")
(match_operand:DI 2 "arith_double_operand" "rHI")))
- (clobber (reg:SI 100))]
+ (clobber (reg:CC 100))]
"! TARGET_ARCH64 && reload_completed"
[(parallel [(set (reg:CC_NOOV 100)
(compare:CC_NOOV (plus:SI (match_dup 4)
@@ -3740,21 +4679,29 @@ return \"srl %1,0,%0\";
(plus:SI (plus:SI (match_dup 7)
(match_dup 8))
(ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
- "operands[3] = gen_lowpart (SImode, operands[0]);
- operands[4] = gen_lowpart (SImode, operands[1]);
- operands[5] = gen_lowpart (SImode, operands[2]);
- operands[6] = gen_highpart (SImode, operands[0]);
- operands[7] = gen_highpart (SImode, operands[1]);
- if (GET_CODE (operands[2]) == CONST_INT)
- operands[8] = INTVAL (operands[2]) < 0 ? constm1_rtx : const0_rtx;
- else
- operands[8] = gen_highpart (SImode, operands[2]);")
+ "
+{
+ operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_lowpart (SImode, operands[1]);
+ operands[5] = gen_lowpart (SImode, operands[2]);
+ operands[6] = gen_highpart (SImode, operands[0]);
+ operands[7] = gen_highpart (SImode, operands[1]);
+ if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if (INTVAL (operands[2]) < 0)
+ operands[8] = constm1_rtx;
+ else
+ operands[8] = const0_rtx;
+ }
+ else
+ operands[8] = gen_highpart (SImode, operands[2]);
+}")
(define_split
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "arith_double_operand" "r")
(match_operand:DI 2 "arith_double_operand" "rHI")))
- (clobber (reg:SI 100))]
+ (clobber (reg:CC 100))]
"! TARGET_ARCH64 && reload_completed"
[(parallel [(set (reg:CC_NOOV 100)
(compare:CC_NOOV (minus:SI (match_dup 4)
@@ -3766,66 +4713,182 @@ return \"srl %1,0,%0\";
(minus:SI (minus:SI (match_dup 7)
(match_dup 8))
(ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
- "operands[3] = gen_lowpart (SImode, operands[0]);
- operands[4] = gen_lowpart (SImode, operands[1]);
- operands[5] = gen_lowpart (SImode, operands[2]);
- operands[6] = gen_highpart (SImode, operands[0]);
- operands[7] = gen_highpart (SImode, operands[1]);
- operands[8] = gen_highpart (SImode, operands[2]);")
+ "
+{
+ operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_lowpart (SImode, operands[1]);
+ operands[5] = gen_lowpart (SImode, operands[2]);
+ operands[6] = gen_highpart (SImode, operands[0]);
+ operands[7] = gen_highpart (SImode, operands[1]);
+ if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if (INTVAL (operands[2]) < 0)
+ operands[8] = constm1_rtx;
+ else
+ operands[8] = const0_rtx;
+ }
+ else
+ operands[8] = gen_highpart (SImode, operands[2]);
+}")
;; LTU here means "carry set"
-(define_insn "*addx"
+(define_insn "addx"
[(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (plus:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI"))
(ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
""
- "addx %1,%2,%0"
- [(set_attr "type" "unary")])
+ "addx\\t%1, %2, %0"
+ [(set_attr "type" "unary")
+ (set_attr "length" "1")])
+
+(define_insn "*addx_extend_sp32"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
+ (match_operand:SI 2 "arith_operand" "rI"))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ "! TARGET_ARCH64"
+ "#"
+ [(set_attr "type" "unary")
+ (set_attr "length" "2")])
-(define_insn "*subx"
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "")
+ (match_operand:SI 2 "arith_operand" ""))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(set (match_dup 3) (plus:SI (plus:SI (match_dup 1) (match_dup 2))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0))))
+ (set (match_dup 4) (const_int 0))]
+ "operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);")
+
+(define_insn "*addx_extend_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
+ (match_operand:SI 2 "arith_operand" "rI"))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ "TARGET_ARCH64"
+ "addx\\t%r1, %2, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
+(define_insn "subx"
[(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
+ (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
(ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
""
- "subx %1,%2,%0"
- [(set_attr "type" "unary")])
+ "subx\\t%r1, %2, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
+(define_insn "*subx_extend_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
+ (match_operand:SI 2 "arith_operand" "rI"))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ "TARGET_ARCH64"
+ "subx\\t%r1, %2, %0"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
+(define_insn "*subx_extend"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
+ (match_operand:SI 2 "arith_operand" "rI"))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ "! TARGET_ARCH64"
+ "#"
+ [(set_attr "type" "unary")
+ (set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
+ (match_operand:SI 2 "arith_operand" "rI"))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(set (match_dup 3) (minus:SI (minus:SI (match_dup 1) (match_dup 2))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0))))
+ (set (match_dup 4) (const_int 0))]
+ "operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[0]);")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
- (plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
- (match_operand:DI 2 "register_operand" "r")))
- (clobber (reg:SI 100))]
+ (plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
+ (match_operand:DI 2 "register_operand" "r")))
+ (clobber (reg:CC 100))]
"! TARGET_ARCH64"
- "addcc %L2,%1,%L0\;addx %H2,0,%H0"
- [(set_attr "type" "multi")])
+ "#"
+ [(set_attr "type" "multi")
+ (set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" ""))
+ (match_operand:DI 2 "register_operand" "")))
+ (clobber (reg:CC 100))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(parallel [(set (reg:CC_NOOV 100)
+ (compare:CC_NOOV (plus:SI (match_dup 3) (match_dup 1))
+ (const_int 0)))
+ (set (match_dup 5) (plus:SI (match_dup 3) (match_dup 1)))])
+ (set (match_dup 6)
+ (plus:SI (plus:SI (match_dup 4) (const_int 0))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ "operands[3] = gen_lowpart (SImode, operands[2]);
+ operands[4] = gen_highpart (SImode, operands[2]);
+ operands[5] = gen_lowpart (SImode, operands[0]);
+ operands[6] = gen_highpart (SImode, operands[0]);")
(define_insn "*adddi3_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_operand:DI 1 "arith_double_operand" "%r")
(match_operand:DI 2 "arith_double_operand" "rHI")))]
"TARGET_ARCH64"
- "add %1,%2,%0")
+ "add\\t%1, %2, %0"
+ [(set_attr "type" "binary")
+ (set_attr "length" "1")])
+
+(define_expand "addsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,d")
+ (plus:SI (match_operand:SI 1 "arith_operand" "%r,d")
+ (match_operand:SI 2 "arith_add_operand" "rI,d")))]
+ ""
+ "
+{
+ if (arith_4096_operand(operands[2], DImode))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_MINUS (SImode, operands[1],
+ GEN_INT(-4096))));
+ DONE;
+ }
+}")
-(define_insn "addsi3"
+(define_insn "*addsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d")
(plus:SI (match_operand:SI 1 "arith_operand" "%r,d")
(match_operand:SI 2 "arith_operand" "rI,d")))]
""
"@
- add %1,%2,%0
- fpadd32s %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ add\\t%1, %2, %0
+ fpadd32s\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_plus"
[(set (reg:CC_NOOV 100)
(compare:CC_NOOV (plus:SI (match_operand:SI 0 "arith_operand" "%r")
(match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))]
- ""
- "addcc %0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "addcc\\t%0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_plus"
[(set (reg:CCX_NOOV 100)
@@ -3833,8 +4896,9 @@ return \"srl %1,0,%0\";
(match_operand:DI 1 "arith_double_operand" "rHI"))
(const_int 0)))]
"TARGET_ARCH64"
- "addcc %0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "addcc\\t%0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_plus_set"
[(set (reg:CC_NOOV 100)
@@ -3844,7 +4908,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (match_dup 1) (match_dup 2)))]
""
- "addcc %1,%2,%0")
+ "addcc\\t%1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_plus_set"
[(set (reg:CCX_NOOV 100)
@@ -3854,23 +4920,32 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_dup 1) (match_dup 2)))]
"TARGET_ARCH64"
- "addcc %1,%2,%0")
+ "addcc\\t%1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_expand "subdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "r")
- (match_operand:DI 2 "arith_double_operand" "rHI")))]
+ (match_operand:DI 2 "arith_double_add_operand" "rHI")))]
""
"
{
if (! TARGET_ARCH64)
{
- emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (MINUS, DImode, operands[1],
- operands[2])),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, SImode, SPARC_ICC_REG)))));
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2,
+ gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_MINUS (DImode, operands[1],
+ operands[2])),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (CCmode, SPARC_ICC_REG)))));
+ DONE;
+ }
+ if (arith_double_4096_operand(operands[2], DImode))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_PLUS (DImode, operands[1],
+ GEN_INT(-4096))));
DONE;
}
}")
@@ -3879,66 +4954,140 @@ return \"srl %1,0,%0\";
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "arith_double_operand" "rHI")))
- (clobber (reg:SI 100))]
+ (clobber (reg:CC 100))]
"! TARGET_ARCH64"
- "*
+ "#"
+ [(set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (minus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "arith_double_operand" "")))
+ (clobber (reg:CC 100))]
+ "! TARGET_ARCH64
+ && reload_completed
+ && (GET_CODE (operands[2]) == CONST_INT
+ || GET_CODE (operands[2]) == CONST_DOUBLE)"
+ [(clobber (const_int 0))]
+ "
{
- rtx op2 = operands[2];
+ rtx highp, lowp;
- if (GET_CODE (op2) == CONST_INT
- || GET_CODE (op2) == CONST_DOUBLE)
+ highp = gen_highpart (SImode, operands[2]);
+ lowp = gen_lowpart (SImode, operands[2]);
+ if ((lowp == const0_rtx)
+ && (operands[0] == operands[1]))
{
- rtx xoperands[4];
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- if (WORDS_BIG_ENDIAN)
- split_double (op2, &xoperands[2], &xoperands[3]);
- else
- split_double (op2, &xoperands[3], &xoperands[2]);
- if (xoperands[3] == const0_rtx && xoperands[0] == xoperands[1])
- output_asm_insn (\"sub %H1,%2,%H0\", xoperands);
- else
- output_asm_insn (\"subcc %L1,%3,%L0\;subx %H1,%2,%H0\", xoperands);
- return \"\";
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_highpart (SImode, operands[0]),
+ gen_rtx_MINUS (SImode,
+ gen_highpart (SImode, operands[1]),
+ highp)));
}
- return \"subcc %L1,%L2,%L0\;subx %H1,%H2,%H0\";
-}"
- [(set_attr "length" "2")])
+ else
+ {
+ emit_insn (gen_cmp_minus_cc_set (gen_lowpart (SImode, operands[0]),
+ gen_lowpart (SImode, operands[1]),
+ lowp));
+ emit_insn (gen_subx (gen_highpart (SImode, operands[0]),
+ gen_highpart (SImode, operands[1]),
+ highp));
+ }
+ DONE;
+}")
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (minus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (clobber (reg:CC 100))]
+ "! TARGET_ARCH64
+ && reload_completed"
+ [(clobber (const_int 0))]
+ "
+{
+ emit_insn (gen_cmp_minus_cc_set (gen_lowpart (SImode, operands[0]),
+ gen_lowpart (SImode, operands[1]),
+ gen_lowpart (SImode, operands[2])));
+ emit_insn (gen_subx (gen_highpart (SImode, operands[0]),
+ gen_highpart (SImode, operands[1]),
+ gen_highpart (SImode, operands[2])));
+ DONE;
+}")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "r")
(zero_extend:DI (match_operand:SI 2 "register_operand" "r"))))
- (clobber (reg:SI 100))]
+ (clobber (reg:CC 100))]
"! TARGET_ARCH64"
- "subcc %L1,%2,%L0\;addx %H1,0,%H0"
- [(set_attr "type" "multi")])
+ "#"
+ [(set_attr "type" "multi")
+ (set_attr "length" "2")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (minus:DI (match_operand:DI 1 "register_operand" "")
+ (zero_extend:DI (match_operand:SI 2 "register_operand" ""))))
+ (clobber (reg:CC 100))]
+ "! TARGET_ARCH64 && reload_completed"
+ [(parallel [(set (reg:CC_NOOV 100)
+ (compare:CC_NOOV (minus:SI (match_dup 3) (match_dup 2))
+ (const_int 0)))
+ (set (match_dup 5) (minus:SI (match_dup 3) (match_dup 2)))])
+ (set (match_dup 6)
+ (minus:SI (minus:SI (match_dup 4) (const_int 0))
+ (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ "operands[3] = gen_lowpart (SImode, operands[1]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[5] = gen_lowpart (SImode, operands[0]);
+ operands[6] = gen_highpart (SImode, operands[0]);")
(define_insn "*subdi3_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "arith_double_operand" "rHI")))]
"TARGET_ARCH64"
- "sub %1,%2,%0")
+ "sub\\t%1, %2, %0"
+ [(set_attr "type" "binary")
+ (set_attr "length" "1")])
+
+(define_expand "subsi3"
+ [(set (match_operand:SI 0 "register_operand" "=r,d")
+ (minus:SI (match_operand:SI 1 "register_operand" "r,d")
+ (match_operand:SI 2 "arith_add_operand" "rI,d")))]
+ ""
+ "
+{
+ if (arith_4096_operand(operands[2], DImode))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_PLUS (SImode, operands[1],
+ GEN_INT(-4096))));
+ DONE;
+ }
+}")
-(define_insn "subsi3"
+(define_insn "*subsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d")
(minus:SI (match_operand:SI 1 "register_operand" "r,d")
(match_operand:SI 2 "arith_operand" "rI,d")))]
""
"@
- sub %1,%2,%0
- fpsub32s %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ sub\\t%1, %2, %0
+ fpsub32s\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1")])
(define_insn "*cmp_minus_cc"
[(set (reg:CC_NOOV 100)
- (compare:CC_NOOV (minus:SI (match_operand:SI 0 "register_operand" "r")
+ (compare:CC_NOOV (minus:SI (match_operand:SI 0 "reg_or_0_operand" "rJ")
(match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))]
- ""
- "subcc %0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "subcc\\t%r0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_minus_ccx"
[(set (reg:CCX_NOOV 100)
@@ -3946,18 +5095,21 @@ return \"srl %1,0,%0\";
(match_operand:DI 1 "arith_double_operand" "rHI"))
(const_int 0)))]
"TARGET_ARCH64"
- "subcc %0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "subcc\\t%0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
-(define_insn "*cmp_minus_cc_set"
+(define_insn "cmp_minus_cc_set"
[(set (reg:CC_NOOV 100)
- (compare:CC_NOOV (minus:SI (match_operand:SI 1 "register_operand" "r")
+ (compare:CC_NOOV (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_dup 1) (match_dup 2)))]
""
- "subcc %1,%2,%0")
+ "subcc\\t%r1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_minus_ccx_set"
[(set (reg:CCX_NOOV 100)
@@ -3967,7 +5119,9 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_dup 1) (match_dup 2)))]
"TARGET_ARCH64"
- "subcc %1,%2,%0")
+ "subcc\\t%1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
;; Integer Multiply/Divide.
@@ -3980,8 +5134,9 @@ return \"srl %1,0,%0\";
(mult:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI")))]
"TARGET_HARD_MUL"
- "smul %1,%2,%0"
- [(set_attr "type" "imul")])
+ "smul\\t%1, %2, %0"
+ [(set_attr "type" "imul")
+ (set_attr "length" "1")])
(define_expand "muldi3"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -4002,9 +5157,12 @@ return \"srl %1,0,%0\";
(mult:DI (match_operand:DI 1 "arith_double_operand" "%r")
(match_operand:DI 2 "arith_double_operand" "rHI")))]
"TARGET_ARCH64"
- "mulx %1,%2,%0")
+ "mulx\\t%1, %2, %0"
+ [(set_attr "type" "imul")
+ (set_attr "length" "1")])
;; V8plus wide multiply.
+;; XXX
(define_insn "muldi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=r,h")
(mult:DI (match_operand:DI 1 "arith_double_operand" "%r,0")
@@ -4015,15 +5173,15 @@ return \"srl %1,0,%0\";
"*
{
if (sparc_check_64 (operands[1], insn) <= 0)
- output_asm_insn (\"srl %L1,0,%L1\", operands);
+ output_asm_insn (\"srl\\t%L1, 0, %L1\", operands);
if (which_alternative == 1)
- output_asm_insn (\"sllx %H1,32,%H1\", operands);
+ output_asm_insn (\"sllx\\t%H1, 32, %H1\", operands);
if (sparc_check_64 (operands[2], insn) <= 0)
- output_asm_insn (\"srl %L2,0,%L2\", operands);
+ output_asm_insn (\"srl\\t%L2, 0, %L2\", operands);
if (which_alternative == 1)
- return \"or %L1,%H1,%H1\;sllx %H2,32,%L1\;or %L2,%L1,%L1\;mulx %H1,%L1,%L0\;srlx %L0,32,%H0\";
+ return \"or\\t%L1, %H1, %H1\\n\\tsllx\\t%H2, 32, %L1\\n\\tor\\t%L2, %L1, %L1\\n\\tmulx\\t%H1, %L1, %L0\;srlx\\t%L0, 32, %H0\";
else
- return \"sllx %H1,32,%3\;sllx %H2,32,%4\;or %L1,%3,%3\;or %L2,%4,%4\;mulx %3,%4,%3\;srlx %3,32,%H0\;mov %3,%L0\";
+ return \"sllx\\t%H1, 32, %3\\n\\tsllx\\t%H2, 32, %4\\n\\tor\\t%L1, %3, %3\\n\\tor\\t%L2, %4, %4\\n\\tmulx\\t%3, %4, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0\";
}"
[(set_attr "length" "9,8")])
@@ -4037,8 +5195,9 @@ return \"srl %1,0,%0\";
(compare:CC_NOOV (mult:SI (match_dup 1) (match_dup 2))
(const_int 0)))]
"TARGET_V8 || TARGET_SPARCLITE || TARGET_DEPRECATED_V8_INSNS"
- "smulcc %1,%2,%0"
- [(set_attr "type" "imul")])
+ "smulcc\\t%1, %2, %0"
+ [(set_attr "type" "imul")
+ (set_attr "length" "1")])
(define_expand "mulsidi3"
[(set (match_operand:DI 0 "register_operand" "")
@@ -4067,6 +5226,7 @@ return \"srl %1,0,%0\";
;; V9 puts the 64 bit product in a 64 bit register. Only out or global
;; registers can hold 64 bit values in the V8plus environment.
+;; XXX
(define_insn "mulsidi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=h,r")
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r"))
@@ -4074,10 +5234,11 @@ return \"srl %1,0,%0\";
(clobber (match_scratch:SI 3 "=X,&h"))]
"TARGET_V8PLUS"
"@
- smul %1,%2,%L0\;srlx %L0,32,%H0
- smul %1,%2,%3\;srlx %3,32,%H0\;mov %3,%L0"
+ smul\\t%1, %2, %L0\\n\\tsrlx\\t%L0, 32, %H0
+ smul\\t%1, %2, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0"
[(set_attr "length" "2,3")])
+;; XXX
(define_insn "const_mulsidi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=h,r")
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r"))
@@ -4085,10 +5246,11 @@ return \"srl %1,0,%0\";
(clobber (match_scratch:SI 3 "=X,&h"))]
"TARGET_V8PLUS"
"@
- smul %1,%2,%L0\;srlx %L0,32,%H0
- smul %1,%2,%3\;srlx %3,32,%H0\;mov %3,%L0"
+ smul\\t%1, %2, %L0\\n\\tsrlx\\t%L0, 32, %H0
+ smul\\t%1, %2, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0"
[(set_attr "length" "2,3")])
+;; XXX
(define_insn "*mulsidi3_sp32"
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
@@ -4096,7 +5258,7 @@ return \"srl %1,0,%0\";
"TARGET_HARD_MUL32"
"*
{
- return TARGET_SPARCLET ? \"smuld %1,%2,%L0\" : \"smul %1,%2,%L0\;rd %%y,%H0\";
+ return TARGET_SPARCLET ? \"smuld\\t%1, %2, %L0\" : \"smul\\t%1, %2, %L0\\n\\trd\\t%%y, %H0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "sparclet")
@@ -4104,6 +5266,7 @@ return \"srl %1,0,%0\";
;; Extra pattern, because sign_extend of a constant isn't valid.
+;; XXX
(define_insn "const_mulsidi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
@@ -4111,7 +5274,7 @@ return \"srl %1,0,%0\";
"TARGET_HARD_MUL"
"*
{
- return TARGET_SPARCLET ? \"smuld %1,%2,%L0\" : \"smul %1,%2,%L0\;rd %%y,%H0\";
+ return TARGET_SPARCLET ? \"smuld\\t%1, %2, %L0\" : \"smul\\t%1, %2, %L0\\n\\trd\\t%%y, %H0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "sparclet")
@@ -4147,6 +5310,7 @@ return \"srl %1,0,%0\";
}
}")
+;; XXX
(define_insn "smulsi3_highpart_v8plus"
[(set (match_operand:SI 0 "register_operand" "=h,r")
(truncate:SI
@@ -4160,37 +5324,59 @@ return \"srl %1,0,%0\";
smul %1,%2,%4\;srlx %4,%3,%0"
[(set_attr "length" "2")])
+;; The combiner changes TRUNCATE in the previous pattern to SUBREG.
+;; XXX
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=h,r")
+ (subreg:SI
+ (lshiftrt:DI
+ (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r"))
+ (sign_extend:DI (match_operand:SI 2 "register_operand" "r,r")))
+ (match_operand:SI 3 "const_int_operand" "i,i"))
+ 1))
+ (clobber (match_scratch:SI 4 "=X,&h"))]
+ "TARGET_V8PLUS"
+ "@
+ smul\\t%1, %2, %0\\n\\tsrlx\\t%0, %3, %0
+ smul\\t%1, %2, %4\\n\\tsrlx\\t%4, %3, %0"
+ [(set_attr "length" "2")])
+
+;; XXX
(define_insn "const_smulsi3_highpart_v8plus"
[(set (match_operand:SI 0 "register_operand" "=h,r")
(truncate:SI
(lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r"))
- (match_operand:SI 2 "register_operand" "r,r"))
+ (match_operand 2 "small_int" "i,i"))
(match_operand:SI 3 "const_int_operand" "i,i"))))
(clobber (match_scratch:SI 4 "=X,&h"))]
"TARGET_V8PLUS"
"@
- smul %1,%2,%0\;srlx %0,%3,%0
- smul %1,%2,%4\;srlx %4,%3,%0"
+ smul\\t%1, %2, %0\\n\\tsrlx\\t%0, %3, %0
+ smul\\t%1, %2, %4\\n\\tsrlx\\t%4, %3, %0"
[(set_attr "length" "2")])
+;; XXX
(define_insn "*smulsi3_highpart_sp32"
[(set (match_operand:SI 0 "register_operand" "=r")
(truncate:SI
(lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "r")))
(const_int 32))))]
- "TARGET_HARD_MUL32"
- "smul %1,%2,%%g0\;rd %%y,%0"
+ "TARGET_HARD_MUL32
+ && ! TARGET_LIVE_G0"
+ "smul\\t%1, %2, %%g0\\n\\trd\\t%%y, %0"
[(set_attr "length" "2")])
+;; XXX
(define_insn "const_smulsi3_highpart"
[(set (match_operand:SI 0 "register_operand" "=r")
(truncate:SI
(lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
(match_operand:SI 2 "register_operand" "r"))
(const_int 32))))]
- "TARGET_HARD_MUL32"
- "smul %1,%2,%%g0\;rd %%y,%0"
+ "TARGET_HARD_MUL32
+ && ! TARGET_LIVE_G0"
+ "smul\\t%1, %2, %%g0\\n\\trd\\t%%y, %0"
[(set_attr "length" "2")])
(define_expand "umulsidi3"
@@ -4218,6 +5404,7 @@ return \"srl %1,0,%0\";
}
}")
+;; XXX
(define_insn "umulsidi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=h,r")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r"))
@@ -4225,10 +5412,11 @@ return \"srl %1,0,%0\";
(clobber (match_scratch:SI 3 "=X,&h"))]
"TARGET_V8PLUS"
"@
- umul %1,%2,%L0\;srlx %L0,32,%H0
- umul %1,%2,%3\;srlx %3,32,%H0\;mov %3,%L0"
+ umul\\t%1, %2, %L0\\n\\tsrlx\\t%L0, 32, %H0
+ umul\\t%1, %2, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0"
[(set_attr "length" "2,3")])
+;; XXX
(define_insn "*umulsidi3_sp32"
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
@@ -4236,7 +5424,7 @@ return \"srl %1,0,%0\";
"TARGET_HARD_MUL32"
"*
{
- return TARGET_SPARCLET ? \"umuld %1,%2,%L0\" : \"umul %1,%2,%L0\;rd %%y,%H0\";
+ return TARGET_SPARCLET ? \"umuld\\t%1, %2, %L0\" : \"umul\\t%1, %2, %L0\\n\\trd\\t%%y, %H0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "sparclet")
@@ -4244,6 +5432,7 @@ return \"srl %1,0,%0\";
;; Extra pattern, because sign_extend of a constant isn't valid.
+;; XXX
(define_insn "const_umulsidi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
@@ -4251,12 +5440,13 @@ return \"srl %1,0,%0\";
"TARGET_HARD_MUL32"
"*
{
- return TARGET_SPARCLET ? \"umuld %1,%2,%L0\" : \"umul %1,%2,%L0\;rd %%y,%H0\";
+ return TARGET_SPARCLET ? \"umuld\\t%1, %2, %L0\" : \"umul\\t%1, %2, %L0\\n\\trd\\t%%y, %H0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "sparclet")
(const_int 1) (const_int 2)))])
+;; XXX
(define_insn "const_umulsidi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=h,r")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r"))
@@ -4264,8 +5454,8 @@ return \"srl %1,0,%0\";
(clobber (match_scratch:SI 3 "=X,h"))]
"TARGET_V8PLUS"
"@
- umul %1,%2,%L0\;srlx %L0,32,%H0
- umul %1,%2,%3\;srlx %3,32,%H0\;mov %3,%L0"
+ umul\\t%1, %2, %L0\\n\\tsrlx\\t%L0, 32, %H0
+ umul\\t%1, %2, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0"
[(set_attr "length" "2,3")])
(define_expand "umulsi3_highpart"
@@ -4298,6 +5488,7 @@ return \"srl %1,0,%0\";
}
}")
+;; XXX
(define_insn "umulsi3_highpart_v8plus"
[(set (match_operand:SI 0 "register_operand" "=h,r")
(truncate:SI
@@ -4307,10 +5498,11 @@ return \"srl %1,0,%0\";
(clobber (match_scratch:SI 4 "=X,h"))]
"TARGET_V8PLUS"
"@
- umul %1,%2,%0\;srlx %0,%3,%0
- umul %1,%2,%4\;srlx %4,%3,%0"
+ umul\\t%1, %2, %0\\n\\tsrlx\\t%0, %3, %0
+ umul\\t%1, %2, %4\\n\\tsrlx\\t%4, %3, %0"
[(set_attr "length" "2")])
+;; XXX
(define_insn "const_umulsi3_highpart_v8plus"
[(set (match_operand:SI 0 "register_operand" "=h,r")
(truncate:SI
@@ -4320,51 +5512,58 @@ return \"srl %1,0,%0\";
(clobber (match_scratch:SI 4 "=X,h"))]
"TARGET_V8PLUS"
"@
- umul %1,%2,%0\;srlx %0,%3,%0
- umul %1,%2,%4\;srlx %4,%3,%0"
+ umul\\t%1, %2, %0\\n\\tsrlx\\t%0, %3, %0
+ umul\\t%1, %2, %4\\n\\tsrlx\\t%4, %3, %0"
[(set_attr "length" "2")])
+;; XXX
(define_insn "*umulsi3_highpart_sp32"
[(set (match_operand:SI 0 "register_operand" "=r")
(truncate:SI
(lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "r")))
(const_int 32))))]
- "TARGET_HARD_MUL32"
- "umul %1,%2,%%g0\;rd %%y,%0"
+ "TARGET_HARD_MUL32
+ && ! TARGET_LIVE_G0"
+ "umul\\t%1, %2, %%g0\\n\\trd\\t%%y, %0"
[(set_attr "length" "2")])
+;; XXX
(define_insn "const_umulsi3_highpart"
[(set (match_operand:SI 0 "register_operand" "=r")
(truncate:SI
(lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
(match_operand:SI 2 "uns_small_int" ""))
(const_int 32))))]
- "TARGET_HARD_MUL32"
- "umul %1,%2,%%g0\;rd %%y,%0"
+ "TARGET_HARD_MUL32
+ && ! TARGET_LIVE_G0"
+ "umul\\t%1, %2, %%g0\\n\\trd\\t%%y, %0"
[(set_attr "length" "2")])
;; The v8 architecture specifies that there must be 3 instructions between
;; a y register write and a use of it for correct results.
+;; XXX SHEESH
(define_insn "divsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(div:SI (match_operand:SI 1 "register_operand" "r,r")
- (match_operand:SI 2 "move_operand" "rI,m")))
+ (match_operand:SI 2 "input_operand" "rI,m")))
(clobber (match_scratch:SI 3 "=&r,&r"))]
- "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS"
+ "(TARGET_V8
+ || TARGET_DEPRECATED_V8_INSNS)
+ && ! TARGET_LIVE_G0"
"*
{
if (which_alternative == 0)
if (TARGET_V9)
- return \"sra %1,31,%3\;wr %%g0,%3,%%y\;sdiv %1,%2,%0\";
+ return \"sra\\t%1, 31, %3\\n\\twr\\t%%g0, %3, %%y\\n\\tsdiv\\t%1, %2, %0\";
else
- return \"sra %1,31,%3\;wr %%g0,%3,%%y\;nop\;nop\;nop\;sdiv %1,%2,%0\";
+ return \"sra\\t%1, 31, %3\\n\\twr\\t%%g0, %3, %%y\\n\\tnop\\n\\tnop\\n\\tnop\\n\\tsdiv\\t%1, %2, %0\";
else
if (TARGET_V9)
- return \"sra %1,31,%3\;wr %%g0,%3,%%y\;ld %2,%3\;sdiv %1,%3,%0\";
+ return \"sra\\t%1, 31, %3\\n\\twr\\t%%g0, %3, %%y\\n\\tld\\t%2, %3\\n\\tsdiv\\t%1, %3, %0\";
else
- return \"sra %1,31,%3\;wr %%g0,%3,%%y\;ld %2,%3\;nop\;nop\;sdiv %1,%3,%0\";
+ return \"sra\\t%1, 31, %3\\n\\twr\\t%%g0, %3, %%y\\n\\tld\\t%2, %3\\n\\tnop\\n\\tnop\\n\\tsdiv\\t%1, %3, %0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "v9")
@@ -4375,10 +5574,11 @@ return \"srl %1,0,%0\";
(div:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "arith_double_operand" "rHI")))]
"TARGET_ARCH64"
- "sdivx %1,%2,%0")
+ "sdivx\\t%1, %2, %0")
;; It is not known whether this will match.
+;; XXX I hope it doesn't fucking match...
(define_insn "*cmp_sdiv_cc_set"
[(set (match_operand:SI 0 "register_operand" "=r")
(div:SI (match_operand:SI 1 "register_operand" "r")
@@ -4387,36 +5587,41 @@ return \"srl %1,0,%0\";
(compare:CC (div:SI (match_dup 1) (match_dup 2))
(const_int 0)))
(clobber (match_scratch:SI 3 "=&r"))]
- "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS"
+ "(TARGET_V8
+ || TARGET_DEPRECATED_V8_INSNS)
+ && ! TARGET_LIVE_G0"
"*
{
if (TARGET_V9)
- return \"sra %1,31,%3\;wr %%g0,%3,%%y\;sdivcc %1,%2,%0\";
+ return \"sra\\t%1, 31, %3\\n\\twr\\t%%g0, %3, %%y\\n\\tsdivcc\\t%1, %2, %0\";
else
- return \"sra %1,31,%3\;wr %%g0,%3,%%y\;nop\;nop\;nop\;sdivcc %1,%2,%0\";
+ return \"sra\\t%1, 31, %3\\n\\twr\\t%%g0, %3, %%y\\n\\tnop\\n\\tnop\\n\\tnop\\n\\tsdivcc\\t%1, %2, %0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "v9")
(const_int 3) (const_int 6)))])
+;; XXX
(define_insn "udivsi3"
[(set (match_operand:SI 0 "register_operand" "=r,&r,&r")
(udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "r,r,m")
- (match_operand:SI 2 "move_operand" "rI,m,r")))]
- "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS"
+ (match_operand:SI 2 "input_operand" "rI,m,r")))]
+ "(TARGET_V8
+ || TARGET_DEPRECATED_V8_INSNS)
+ && ! TARGET_LIVE_G0"
"*
{
- output_asm_insn (\"wr %%g0,%%g0,%%y\", operands);
+ output_asm_insn (\"wr\\t%%g0, %%g0, %%y\", operands);
switch (which_alternative)
{
default:
if (TARGET_V9)
- return \"udiv %1,%2,%0\";
- return \"nop\;nop\;nop\;udiv %1,%2,%0\";
+ return \"udiv\\t%1, %2, %0\";
+ return \"nop\\n\\tnop\\n\\tnop\\n\\tudiv\\t%1, %2, %0\";
case 1:
- return \"ld %2,%0\;nop\;nop\;udiv %1,%0,%0\";
+ return \"ld\\t%2, %0\\n\\tnop\\n\\tnop\\n\\tudiv\\t%1, %0, %0\";
case 2:
- return \"ld %1,%0\;nop\;nop\;udiv %0,%2,%0\";
+ return \"ld\\t%1, %0\\n\\tnop\\n\\tnop\\n\\tudiv\\t%0, %2, %0\";
}
}"
[(set (attr "length")
@@ -4429,10 +5634,11 @@ return \"srl %1,0,%0\";
(udiv:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "arith_double_operand" "rHI")))]
"TARGET_ARCH64"
- "udivx %1,%2,%0")
+ "udivx\\t%1, %2, %0")
;; It is not known whether this will match.
+;; XXX I hope it doesn't fucking match...
(define_insn "*cmp_udiv_cc_set"
[(set (match_operand:SI 0 "register_operand" "=r")
(udiv:SI (match_operand:SI 1 "register_operand" "r")
@@ -4440,13 +5646,15 @@ return \"srl %1,0,%0\";
(set (reg:CC 100)
(compare:CC (udiv:SI (match_dup 1) (match_dup 2))
(const_int 0)))]
- "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS"
+ "(TARGET_V8
+ || TARGET_DEPRECATED_V8_INSNS)
+ && ! TARGET_LIVE_G0"
"*
{
if (TARGET_V9)
- return \"wr %%g0,%%g0,%%y\;udivcc %1,%2,%0\";
+ return \"wr\\t%%g0, %%g0, %%y\\n\\tudivcc\\t%1, %2, %0\";
else
- return \"wr %%g0,%%g0,%%y\;nop\;nop\;nop\;udivcc %1,%2,%0\";
+ return \"wr\\t%%g0, %%g0, %%y\\n\\tnop\\n\\tnop\\n\\tnop\\n\\tudivcc\\t%1, %2, %0\";
}"
[(set (attr "length")
(if_then_else (eq_attr "isa" "v9")
@@ -4460,8 +5668,9 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "arith_operand" "rI"))
(match_operand:SI 3 "register_operand" "0")))]
"TARGET_SPARCLET"
- "smac %1,%2,%0"
- [(set_attr "type" "imul")])
+ "smac\\t%1, %2, %0"
+ [(set_attr "type" "imul")
+ (set_attr "length" "1")])
(define_insn "*smacdi"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -4471,8 +5680,9 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "register_operand" "r")))
(match_operand:DI 3 "register_operand" "0")))]
"TARGET_SPARCLET"
- "smacd %1,%2,%L0"
- [(set_attr "type" "imul")])
+ "smacd\\t%1, %2, %L0"
+ [(set_attr "type" "imul")
+ (set_attr "length" "1")])
(define_insn "*umacdi"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -4482,8 +5692,9 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "register_operand" "r")))
(match_operand:DI 3 "register_operand" "0")))]
"TARGET_SPARCLET"
- "umacd %1,%2,%L0"
- [(set_attr "type" "imul")])
+ "umacd\\t%1, %2, %L0"
+ [(set_attr "type" "imul")
+ (set_attr "length" "1")])
;;- Boolean instructions
;; We define DImode `and' so with DImode `not' we can get
@@ -4501,36 +5712,22 @@ return \"srl %1,0,%0\";
(and:DI (match_operand:DI 1 "arith_double_operand" "%r,b")
(match_operand:DI 2 "arith_double_operand" "rHI,b")))]
"! TARGET_ARCH64"
- "*
-{
- rtx op2 = operands[2];
-
- if (which_alternative == 1)
- return \"fand %1,%2,%0\";
-
- if (GET_CODE (op2) == CONST_INT
- || GET_CODE (op2) == CONST_DOUBLE)
- {
- rtx xoperands[4];
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- if (WORDS_BIG_ENDIAN)
- split_double (op2, &xoperands[2], &xoperands[3]);
- else
- split_double (op2, &xoperands[3], &xoperands[2]);
- output_asm_insn (\"and %L1,%3,%L0\;and %H1,%2,%H0\", xoperands);
- return \"\";
- }
- return \"and %1,%2,%0\;and %R1,%R2,%R0\";
-}"
- [(set_attr "length" "2,1")])
+ "@
+ #
+ fand\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "2,1")])
(define_insn "*anddi3_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (and:DI (match_operand:DI 1 "arith_double_operand" "%r")
- (match_operand:DI 2 "arith_double_operand" "rHI")))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (and:DI (match_operand:DI 1 "arith_double_operand" "%r,b")
+ (match_operand:DI 2 "arith_double_operand" "rHI,b")))]
"TARGET_ARCH64"
- "and %1,%2,%0")
+ "@
+ and\\t%1, %2, %0
+ fand\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_insn "andsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d")
@@ -4538,9 +5735,10 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "arith_operand" "rI,d")))]
""
"@
- and %1,%2,%0
- fands %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ and\\t%1, %2, %0
+ fands\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_split
[(set (match_operand:SI 0 "register_operand" "")
@@ -4557,22 +5755,84 @@ return \"srl %1,0,%0\";
operands[4] = GEN_INT (~INTVAL (operands[2]) & 0xffffffff);
}")
+;; Split DImode logical operations requiring two instructions.
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (match_operator:DI 1 "cc_arithop" ; AND, IOR, XOR
+ [(match_operand:DI 2 "register_operand" "")
+ (match_operand:DI 3 "arith_double_operand" "")]))]
+ "! TARGET_ARCH64
+ && reload_completed
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))"
+ [(set (match_dup 4) (match_op_dup:SI 1 [(match_dup 6) (match_dup 8)]))
+ (set (match_dup 5) (match_op_dup:SI 1 [(match_dup 7) (match_dup 9)]))]
+ "
+{
+ if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ operands[4] = gen_highpart (SImode, operands[0]);
+ operands[5] = gen_lowpart (SImode, operands[0]);
+ operands[6] = gen_highpart (SImode, operands[2]);
+ operands[7] = gen_lowpart (SImode, operands[2]);
+ if (GET_CODE (operands[3]) == CONST_INT)
+ {
+ if (INTVAL (operands[3]) < 0)
+ operands[8] = constm1_rtx;
+ else
+ operands[8] = const0_rtx;
+ }
+ else
+ operands[8] = gen_highpart (SImode, operands[3]);
+ operands[9] = gen_lowpart (SImode, operands[3]);
+}")
+
(define_insn "*and_not_di_sp32"
[(set (match_operand:DI 0 "register_operand" "=r,b")
(and:DI (not:DI (match_operand:DI 1 "register_operand" "r,b"))
(match_operand:DI 2 "register_operand" "r,b")))]
"! TARGET_ARCH64"
"@
- andn %2,%1,%0\;andn %R2,%R1,%R0
- fandnot1 %1,%2,%0"
- [(set_attr "length" "2,1")])
+ #
+ fandnot1\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "2,1")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (and:DI (not:DI (match_operand:DI 1 "register_operand" ""))
+ (match_operand:DI 2 "register_operand" "")))]
+ "! TARGET_ARCH64
+ && reload_completed
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))"
+ [(set (match_dup 3) (and:SI (not:SI (match_dup 4)) (match_dup 5)))
+ (set (match_dup 6) (and:SI (not:SI (match_dup 7)) (match_dup 8)))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[5] = gen_highpart (SImode, operands[2]);
+ operands[6] = gen_lowpart (SImode, operands[0]);
+ operands[7] = gen_lowpart (SImode, operands[1]);
+ operands[8] = gen_lowpart (SImode, operands[2]);")
(define_insn "*and_not_di_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (and:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
- (match_operand:DI 2 "register_operand" "r")))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (and:DI (not:DI (match_operand:DI 1 "register_operand" "r,b"))
+ (match_operand:DI 2 "register_operand" "r,b")))]
"TARGET_ARCH64"
- "andn %2,%1,%0")
+ "@
+ andn\\t%2, %1, %0
+ fandnot1\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_insn "*and_not_si"
[(set (match_operand:SI 0 "register_operand" "=r,d")
@@ -4580,9 +5840,10 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "register_operand" "r,d")))]
""
"@
- andn %2,%1,%0
- fandnot1s %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ andn\\t%2, %1, %0
+ fandnot1s\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_expand "iordi3"
[(set (match_operand:DI 0 "register_operand" "")
@@ -4596,36 +5857,22 @@ return \"srl %1,0,%0\";
(ior:DI (match_operand:DI 1 "arith_double_operand" "%r,b")
(match_operand:DI 2 "arith_double_operand" "rHI,b")))]
"! TARGET_ARCH64"
- "*
-{
- rtx op2 = operands[2];
-
- if (which_alternative == 1)
- return \"for %1,%2,%0\";
-
- if (GET_CODE (op2) == CONST_INT
- || GET_CODE (op2) == CONST_DOUBLE)
- {
- rtx xoperands[4];
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- if (WORDS_BIG_ENDIAN)
- split_double (op2, &xoperands[2], &xoperands[3]);
- else
- split_double (op2, &xoperands[3], &xoperands[2]);
- output_asm_insn (\"or %L1,%3,%L0\;or %H1,%2,%H0\", xoperands);
- return \"\";
- }
- return \"or %1,%2,%0\;or %R1,%R2,%R0\";
-}"
- [(set_attr "length" "2,1")])
+ "@
+ #
+ for\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "2,1")])
(define_insn "*iordi3_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (ior:DI (match_operand:DI 1 "arith_double_operand" "%r")
- (match_operand:DI 2 "arith_double_operand" "rHI")))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (ior:DI (match_operand:DI 1 "arith_double_operand" "%r,b")
+ (match_operand:DI 2 "arith_double_operand" "rHI,b")))]
"TARGET_ARCH64"
- "or %1,%2,%0")
+ "@
+ or\\t%1, %2, %0
+ for\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_insn "iorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d")
@@ -4633,9 +5880,10 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "arith_operand" "rI,d")))]
""
"@
- or %1,%2,%0
- fors %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ or\\t%1, %2, %0
+ fors\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_split
[(set (match_operand:SI 0 "register_operand" "")
@@ -4658,16 +5906,43 @@ return \"srl %1,0,%0\";
(match_operand:DI 2 "register_operand" "r,b")))]
"! TARGET_ARCH64"
"@
- orn %2,%1,%0\;orn %R2,%R1,%R0
- fornot1 %1,%2,%0"
- [(set_attr "length" "2,1")])
+ #
+ fornot1\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "2,1")])
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (ior:DI (not:DI (match_operand:DI 1 "register_operand" ""))
+ (match_operand:DI 2 "register_operand" "")))]
+ "! TARGET_ARCH64
+ && reload_completed
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))"
+ [(set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))
+ (set (match_dup 6) (ior:SI (not:SI (match_dup 7)) (match_dup 8)))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[5] = gen_highpart (SImode, operands[2]);
+ operands[6] = gen_lowpart (SImode, operands[0]);
+ operands[7] = gen_lowpart (SImode, operands[1]);
+ operands[8] = gen_lowpart (SImode, operands[2]);")
(define_insn "*or_not_di_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (ior:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
- (match_operand:DI 2 "register_operand" "r")))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (ior:DI (not:DI (match_operand:DI 1 "register_operand" "r,b"))
+ (match_operand:DI 2 "register_operand" "r,b")))]
"TARGET_ARCH64"
- "orn %2,%1,%0")
+ "@
+ orn\\t%2, %1, %0
+ fornot1\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_insn "*or_not_si"
[(set (match_operand:SI 0 "register_operand" "=r,d")
@@ -4675,9 +5950,10 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "register_operand" "r,d")))]
""
"@
- orn %2,%1,%0
- fornot1s %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ orn\\t%2, %1, %0
+ fornot1s\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_expand "xordi3"
[(set (match_operand:DI 0 "register_operand" "")
@@ -4691,37 +5967,32 @@ return \"srl %1,0,%0\";
(xor:DI (match_operand:DI 1 "arith_double_operand" "%r,b")
(match_operand:DI 2 "arith_double_operand" "rHI,b")))]
"! TARGET_ARCH64"
- "*
-{
- rtx op2 = operands[2];
-
- if (which_alternative == 1)
- return \"fxor %1,%2,%0\";
-
- if (GET_CODE (op2) == CONST_INT
- || GET_CODE (op2) == CONST_DOUBLE)
- {
- rtx xoperands[4];
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- if (WORDS_BIG_ENDIAN)
- split_double (op2, &xoperands[2], &xoperands[3]);
- else
- split_double (op2, &xoperands[3], &xoperands[2]);
- output_asm_insn (\"xor %L1,%3,%L0\;xor %H1,%2,%H0\", xoperands);
- return \"\";
- }
- return \"xor %1,%2,%0\;xor %R1,%R2,%R0\";
-}"
+ "@
+ #
+ fxor\\t%1, %2, %0"
[(set_attr "length" "2,1")
(set_attr "type" "ialu,fp")])
(define_insn "*xordi3_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (xor:DI (match_operand:DI 1 "arith_double_operand" "%rJ")
- (match_operand:DI 2 "arith_double_operand" "rHI")))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (xor:DI (match_operand:DI 1 "arith_double_operand" "%rJ,b")
+ (match_operand:DI 2 "arith_double_operand" "rHI,b")))]
"TARGET_ARCH64"
- "xor %r1,%2,%0")
+ "@
+ xor\\t%r1, %2, %0
+ fxor\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
+
+(define_insn "*xordi3_sp64_dbl"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (xor:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "const64_operand" "")))]
+ "(TARGET_ARCH64
+ && HOST_BITS_PER_WIDE_INT != 64)"
+ "xor\\t%1, %2, %0"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
(define_insn "xorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d")
@@ -4729,9 +6000,10 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "arith_operand" "rI,d")))]
""
"@
- xor %r1,%2,%0
- fxors %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ xor\\t%r1, %2, %0
+ fxors\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_split
[(set (match_operand:SI 0 "register_operand" "")
@@ -4771,18 +6043,43 @@ return \"srl %1,0,%0\";
(match_operand:DI 2 "register_operand" "r,b"))))]
"! TARGET_ARCH64"
"@
- xnor %1,%2,%0\;xnor %R1,%R2,%R0
- fxnor %1,%2,%0"
+ #
+ fxnor\\t%1, %2, %0"
[(set_attr "length" "2,1")
(set_attr "type" "ialu,fp")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (not:DI (xor:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" ""))))]
+ "! TARGET_ARCH64
+ && reload_completed
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))"
+ [(set (match_dup 3) (not:SI (xor:SI (match_dup 4) (match_dup 5))))
+ (set (match_dup 6) (not:SI (xor:SI (match_dup 7) (match_dup 8))))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ operands[3] = gen_highpart (SImode, operands[0]);
+ operands[4] = gen_highpart (SImode, operands[1]);
+ operands[5] = gen_highpart (SImode, operands[2]);
+ operands[6] = gen_lowpart (SImode, operands[0]);
+ operands[7] = gen_lowpart (SImode, operands[1]);
+ operands[8] = gen_lowpart (SImode, operands[2]);")
+
(define_insn "*xor_not_di_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (not:DI (xor:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
- (match_operand:DI 2 "arith_double_operand" "rHI"))))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (not:DI (xor:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,b")
+ (match_operand:DI 2 "arith_double_operand" "rHI,b"))))]
"TARGET_ARCH64"
- "xnor %r1,%2,%0"
- [(set_attr "type" "ialu")])
+ "@
+ xnor\\t%r1, %2, %0
+ fxnor\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
(define_insn "*xor_not_si"
[(set (match_operand:SI 0 "register_operand" "=r,d")
@@ -4790,9 +6087,10 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "arith_operand" "rI,d"))))]
""
"@
- xnor %r1,%2,%0
- fxnors %1,%2,%0"
- [(set_attr "type" "ialu,fp")])
+ xnor\\t%r1, %2, %0
+ fxnors\\t%1, %2, %0"
+ [(set_attr "type" "ialu,fp")
+ (set_attr "length" "1,1")])
;; These correspond to the above in the case where we also (or only)
;; want to set the condition code.
@@ -4804,9 +6102,10 @@ return \"srl %1,0,%0\";
[(match_operand:SI 0 "arith_operand" "%r")
(match_operand:SI 1 "arith_operand" "rI")])
(const_int 0)))]
- ""
- "%A2cc %0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "%A2cc\\t%0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_arith_op"
[(set (reg:CCX 100)
@@ -4816,8 +6115,9 @@ return \"srl %1,0,%0\";
(match_operand:DI 1 "arith_double_operand" "rHI")])
(const_int 0)))]
"TARGET_ARCH64"
- "%A2cc %0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "%A2cc\\t%0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_arith_op_set"
[(set (reg:CC 100)
@@ -4829,7 +6129,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(match_dup 3))]
""
- "%A3cc %1,%2,%0")
+ "%A3cc\\t%1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_arith_op_set"
[(set (reg:CCX 100)
@@ -4841,7 +6143,9 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(match_dup 3))]
"TARGET_ARCH64"
- "%A3cc %1,%2,%0")
+ "%A3cc\\t%1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_xor_not"
[(set (reg:CC 100)
@@ -4849,9 +6153,10 @@ return \"srl %1,0,%0\";
(not:SI (xor:SI (match_operand:SI 0 "reg_or_0_operand" "%rJ")
(match_operand:SI 1 "arith_operand" "rI")))
(const_int 0)))]
- ""
- "xnorcc %r0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "xnorcc\\t%r0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_xor_not"
[(set (reg:CCX 100)
@@ -4860,8 +6165,9 @@ return \"srl %1,0,%0\";
(match_operand:DI 1 "arith_double_operand" "rHI")))
(const_int 0)))]
"TARGET_ARCH64"
- "xnorcc %r0,%1,%%g0"
- [(set_attr "type" "compare")])
+ "xnorcc\\t%r0, %1, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_xor_not_set"
[(set (reg:CC 100)
@@ -4872,7 +6178,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(not:SI (xor:SI (match_dup 1) (match_dup 2))))]
""
- "xnorcc %r1,%2,%0")
+ "xnorcc\\t%r1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_xor_not_set"
[(set (reg:CCX 100)
@@ -4883,7 +6191,9 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(not:DI (xor:DI (match_dup 1) (match_dup 2))))]
"TARGET_ARCH64"
- "xnorcc %r1,%2,%0")
+ "xnorcc\\t%r1, %2, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_arith_op_not"
[(set (reg:CC 100)
@@ -4892,9 +6202,10 @@ return \"srl %1,0,%0\";
[(not:SI (match_operand:SI 0 "arith_operand" "rI"))
(match_operand:SI 1 "reg_or_0_operand" "rJ")])
(const_int 0)))]
- ""
- "%B2cc %r1,%0,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "%B2cc\\t%r1, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_arith_op_not"
[(set (reg:CCX 100)
@@ -4904,8 +6215,9 @@ return \"srl %1,0,%0\";
(match_operand:DI 1 "reg_or_0_operand" "rJ")])
(const_int 0)))]
"TARGET_ARCH64"
- "%B2cc %r1,%0,%%g0"
- [(set_attr "type" "compare")])
+ "%B2cc\\t%r1, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_arith_op_not_set"
[(set (reg:CC 100)
@@ -4917,7 +6229,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(match_dup 3))]
""
- "%B3cc %r2,%1,%0")
+ "%B3cc\\t%r2, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_arith_op_not_set"
[(set (reg:CCX 100)
@@ -4929,7 +6243,9 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(match_dup 3))]
"TARGET_ARCH64"
- "%B3cc %r2,%1,%0")
+ "%B3cc\\t%r2, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
;; We cannot use the "neg" pseudo insn because the Sun assembler
;; does not know how to make it work for constants.
@@ -4942,11 +6258,11 @@ return \"srl %1,0,%0\";
{
if (! TARGET_ARCH64)
{
- emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operand0,
- gen_rtx (NEG, DImode, operand1)),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, SImode, SPARC_ICC_REG)))));
+ emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2,
+ gen_rtx_SET (VOIDmode, operand0,
+ gen_rtx_NEG (DImode, operand1)),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (CCmode, SPARC_ICC_REG)))));
DONE;
}
}")
@@ -4954,55 +6270,82 @@ return \"srl %1,0,%0\";
(define_insn "*negdi2_sp32"
[(set (match_operand:DI 0 "register_operand" "=r")
(neg:DI (match_operand:DI 1 "register_operand" "r")))
- (clobber (reg:SI 100))]
- "! TARGET_ARCH64"
- "*
-{
- if (TARGET_LIVE_G0)
- output_asm_insn (\"and %%g0,0,%%g0\", operands);
- return \"subcc %%g0,%L1,%L0\;subx %%g0,%H1,%H0\";
-}"
+ (clobber (reg:CC 100))]
+ "! TARGET_ARCH64
+ && ! TARGET_LIVE_G0"
+ "#"
[(set_attr "type" "unary")
- ;; ??? This is wrong for TARGET_LIVE_G0 but it's not critical.
(set_attr "length" "2")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (neg:DI (match_operand:DI 1 "register_operand" "")))
+ (clobber (reg:CC 100))]
+ "! TARGET_ARCH64
+ && ! TARGET_LIVE_G0
+ && reload_completed"
+ [(parallel [(set (reg:CC_NOOV 100)
+ (compare:CC_NOOV (minus:SI (const_int 0) (match_dup 5))
+ (const_int 0)))
+ (set (match_dup 4) (minus:SI (const_int 0) (match_dup 5)))])
+ (set (match_dup 2) (minus:SI (minus:SI (const_int 0) (match_dup 3))
+ (ltu:SI (reg:CC 100) (const_int 0))))]
+ "operands[2] = gen_highpart (SImode, operands[0]);
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[4] = gen_lowpart (SImode, operands[0]);
+ operands[5] = gen_lowpart (SImode, operands[1]);")
+
(define_insn "*negdi2_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
(neg:DI (match_operand:DI 1 "register_operand" "r")))]
"TARGET_ARCH64"
- "sub %%g0,%1,%0"
+ "sub\\t%%g0, %1, %0"
[(set_attr "type" "unary")
(set_attr "length" "1")])
-(define_insn "negsi2"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (neg:SI (match_operand:SI 1 "arith_operand" "rI")))]
+(define_expand "negsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (neg:SI (match_operand:SI 1 "arith_operand" "")))]
""
- "*
+ "
{
if (TARGET_LIVE_G0)
- return \"and %%g0,0,%%g0\;sub %%g0,%1,%0\";
- return \"sub %%g0,%1,%0\";
-}"
+ {
+ rtx zero_reg = gen_reg_rtx (SImode);
+
+ emit_insn (gen_rtx_SET (VOIDmode, zero_reg, const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_MINUS (SImode, zero_reg,
+ operands[1])));
+ DONE;
+ }
+}")
+
+(define_insn "*negsi2_not_liveg0"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (neg:SI (match_operand:SI 1 "arith_operand" "rI")))]
+ "! TARGET_LIVE_G0"
+ "sub\\t%%g0, %1, %0"
[(set_attr "type" "unary")
- (set (attr "length")
- (if_then_else (eq_attr "live_g0" "yes") (const_int 2) (const_int 1)))])
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_neg"
[(set (reg:CC_NOOV 100)
(compare:CC_NOOV (neg:SI (match_operand:SI 0 "arith_operand" "rI"))
(const_int 0)))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%0,%%g0"
- [(set_attr "type" "compare")])
+ "subcc\\t%%g0, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_neg"
[(set (reg:CCX_NOOV 100)
(compare:CCX_NOOV (neg:DI (match_operand:DI 0 "arith_double_operand" "rHI"))
(const_int 0)))]
"TARGET_ARCH64"
- "subcc %%g0,%0,%%g0"
- [(set_attr "type" "compare")])
+ "subcc\\t%%g0, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_set_neg"
[(set (reg:CC_NOOV 100)
@@ -5011,8 +6354,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (match_dup 1)))]
"! TARGET_LIVE_G0"
- "subcc %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "subcc\\t%%g0, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_set_neg"
[(set (reg:CCX_NOOV 100)
@@ -5021,8 +6365,9 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(neg:DI (match_dup 1)))]
"TARGET_ARCH64"
- "subcc %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "subcc\\t%%g0, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
;; We cannot use the "not" pseudo insn because the Sun assembler
;; does not know how to make it work for constants.
@@ -5037,53 +6382,99 @@ return \"srl %1,0,%0\";
(not:DI (match_operand:DI 1 "register_operand" "r,b")))]
"! TARGET_ARCH64"
"@
- xnor %1,0,%0\;xnor %R1,0,%R0
- fnot1 %1,%0"
+ #
+ fnot1\\t%1, %0"
[(set_attr "type" "unary,fp")
(set_attr "length" "2,1")])
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (not:DI (match_operand:DI 1 "register_operand" "")))]
+ "! TARGET_ARCH64
+ && reload_completed
+ && ((GET_CODE (operands[0]) == REG
+ && REGNO (operands[0]) < 32)
+ || (GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) < 32))"
+ [(set (match_dup 2) (not:SI (xor:SI (match_dup 3) (const_int 0))))
+ (set (match_dup 4) (not:SI (xor:SI (match_dup 5) (const_int 0))))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ operands[2] = gen_highpart (SImode, operands[0]);
+ operands[3] = gen_highpart (SImode, operands[1]);
+ operands[4] = gen_lowpart (SImode, operands[0]);
+ operands[5] = gen_lowpart (SImode, operands[1]);")
+
(define_insn "*one_cmpldi2_sp64"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (not:DI (match_operand:DI 1 "arith_double_operand" "rHI")))]
+ [(set (match_operand:DI 0 "register_operand" "=r,b")
+ (not:DI (match_operand:DI 1 "arith_double_operand" "rHI,b")))]
"TARGET_ARCH64"
- "xnor %1,0,%0"
- [(set_attr "type" "unary")])
+ "@
+ xnor\\t%%g0, %1, %0
+ fnot1\\t%1, %0"
+ [(set_attr "type" "unary,fp")
+ (set_attr "length" "1")])
-(define_insn "one_cmplsi2"
- [(set (match_operand:SI 0 "register_operand" "=r,r,d")
- (not:SI (match_operand:SI 1 "arith_operand" "r,I,d")))]
+(define_expand "one_cmplsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (not:SI (match_operand:SI 1 "arith_operand" "")))]
""
- "*
+ "
{
- if (which_alternative == 0)
- return \"xnor %1,0,%0\";
- if (which_alternative == 2)
- return \"fnot1s %1,%0\";
- if (TARGET_LIVE_G0)
- output_asm_insn (\"and %%g0,0,%%g0\", operands);
- return \"xnor %%g0,%1,%0\";
-}"
- [(set_attr "type" "unary,unary,fp")
- (set_attr_alternative "length"
- [(const_int 1)
- (if_then_else (eq_attr "live_g0" "yes") (const_int 2) (const_int 1))
- (const_int 1)])])
+ if (TARGET_LIVE_G0
+ && GET_CODE (operands[1]) == CONST_INT)
+ {
+ rtx zero_reg = gen_reg_rtx (SImode);
+
+ emit_insn (gen_rtx_SET (VOIDmode, zero_reg, const0_rtx));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ operands[0],
+ gen_rtx_NOT (SImode,
+ gen_rtx_XOR (SImode,
+ zero_reg,
+ operands[1]))));
+ DONE;
+ }
+}")
+
+(define_insn "*one_cmplsi2_not_liveg0"
+ [(set (match_operand:SI 0 "register_operand" "=r,d")
+ (not:SI (match_operand:SI 1 "arith_operand" "rI,d")))]
+ "! TARGET_LIVE_G0"
+ "@
+ xnor\\t%%g0, %1, %0
+ fnot1s\\t%1, %0"
+ [(set_attr "type" "unary,fp")
+ (set_attr "length" "1,1")])
+
+(define_insn "*one_cmplsi2_liveg0"
+ [(set (match_operand:SI 0 "register_operand" "=r,d")
+ (not:SI (match_operand:SI 1 "arith_operand" "r,d")))]
+ "TARGET_LIVE_G0"
+ "@
+ xnor\\t%1, 0, %0
+ fnot1s\\t%1, %0"
+ [(set_attr "type" "unary,fp")
+ (set_attr "length" "1,1")])
(define_insn "*cmp_cc_not"
[(set (reg:CC 100)
(compare:CC (not:SI (match_operand:SI 0 "arith_operand" "rI"))
(const_int 0)))]
"! TARGET_LIVE_G0"
- "xnorcc %%g0,%0,%%g0"
- [(set_attr "type" "compare")])
+ "xnorcc\\t%%g0, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_not"
[(set (reg:CCX 100)
(compare:CCX (not:DI (match_operand:DI 0 "arith_double_operand" "rHI"))
(const_int 0)))]
"TARGET_ARCH64"
- "xnorcc %%g0,%0,%%g0"
- [(set_attr "type" "compare")])
+ "xnorcc\\t%%g0, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_set_not"
[(set (reg:CC 100)
@@ -5092,8 +6483,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(not:SI (match_dup 1)))]
"! TARGET_LIVE_G0"
- "xnorcc %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "xnorcc\\t%%g0, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_ccx_set_not"
[(set (reg:CCX 100)
@@ -5102,8 +6494,9 @@ return \"srl %1,0,%0\";
(set (match_operand:DI 0 "register_operand" "=r")
(not:DI (match_dup 1)))]
"TARGET_ARCH64"
- "xnorcc %%g0,%1,%0"
- [(set_attr "type" "unary")])
+ "xnorcc\\t%%g0, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
;; Floating point arithmetic instructions.
@@ -5112,88 +6505,99 @@ return \"srl %1,0,%0\";
(plus:TF (match_operand:TF 1 "register_operand" "e")
(match_operand:TF 2 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "faddq %1,%2,%0"
- [(set_attr "type" "fp")])
+ "faddq\\t%1, %2, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "adddf3"
[(set (match_operand:DF 0 "register_operand" "=e")
(plus:DF (match_operand:DF 1 "register_operand" "e")
(match_operand:DF 2 "register_operand" "e")))]
"TARGET_FPU"
- "faddd %1,%2,%0"
- [(set_attr "type" "fp")])
+ "faddd\\t%1, %2, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "addsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(plus:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_FPU"
- "fadds %1,%2,%0"
- [(set_attr "type" "fp")])
+ "fadds\\t%1, %2, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "subtf3"
[(set (match_operand:TF 0 "register_operand" "=e")
(minus:TF (match_operand:TF 1 "register_operand" "e")
(match_operand:TF 2 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fsubq %1,%2,%0"
- [(set_attr "type" "fp")])
+ "fsubq\\t%1, %2, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "subdf3"
[(set (match_operand:DF 0 "register_operand" "=e")
(minus:DF (match_operand:DF 1 "register_operand" "e")
(match_operand:DF 2 "register_operand" "e")))]
"TARGET_FPU"
- "fsubd %1,%2,%0"
- [(set_attr "type" "fp")])
+ "fsubd\\t%1, %2, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "subsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(minus:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_FPU"
- "fsubs %1,%2,%0"
- [(set_attr "type" "fp")])
+ "fsubs\\t%1, %2, %0"
+ [(set_attr "type" "fp")
+ (set_attr "length" "1")])
(define_insn "multf3"
[(set (match_operand:TF 0 "register_operand" "=e")
(mult:TF (match_operand:TF 1 "register_operand" "e")
(match_operand:TF 2 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fmulq %1,%2,%0"
- [(set_attr "type" "fpmul")])
+ "fmulq\\t%1, %2, %0"
+ [(set_attr "type" "fpmul")
+ (set_attr "length" "1")])
(define_insn "muldf3"
[(set (match_operand:DF 0 "register_operand" "=e")
(mult:DF (match_operand:DF 1 "register_operand" "e")
(match_operand:DF 2 "register_operand" "e")))]
"TARGET_FPU"
- "fmuld %1,%2,%0"
- [(set_attr "type" "fpmul")])
+ "fmuld\\t%1, %2, %0"
+ [(set_attr "type" "fpmul")
+ (set_attr "length" "1")])
(define_insn "mulsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_FPU"
- "fmuls %1,%2,%0"
- [(set_attr "type" "fpmul")])
+ "fmuls\\t%1, %2, %0"
+ [(set_attr "type" "fpmul")
+ (set_attr "length" "1")])
(define_insn "*muldf3_extend"
[(set (match_operand:DF 0 "register_operand" "=e")
(mult:DF (float_extend:DF (match_operand:SF 1 "register_operand" "f"))
(float_extend:DF (match_operand:SF 2 "register_operand" "f"))))]
"(TARGET_V8 || TARGET_V9) && TARGET_FPU"
- "fsmuld %1,%2,%0"
- [(set_attr "type" "fpmul")])
+ "fsmuld\\t%1, %2, %0"
+ [(set_attr "type" "fpmul")
+ (set_attr "length" "1")])
(define_insn "*multf3_extend"
[(set (match_operand:TF 0 "register_operand" "=e")
(mult:TF (float_extend:TF (match_operand:DF 1 "register_operand" "e"))
(float_extend:TF (match_operand:DF 2 "register_operand" "e"))))]
"(TARGET_V8 || TARGET_V9) && TARGET_FPU && TARGET_HARD_QUAD"
- "fdmulq %1,%2,%0"
- [(set_attr "type" "fpmul")])
+ "fdmulq\\t%1, %2, %0"
+ [(set_attr "type" "fpmul")
+ (set_attr "length" "1")])
;; don't have timing for quad-prec. divide.
(define_insn "divtf3"
@@ -5201,133 +6605,286 @@ return \"srl %1,0,%0\";
(div:TF (match_operand:TF 1 "register_operand" "e")
(match_operand:TF 2 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fdivq %1,%2,%0"
- [(set_attr "type" "fpdivd")])
+ "fdivq\\t%1, %2, %0"
+ [(set_attr "type" "fpdivd")
+ (set_attr "length" "1")])
(define_insn "divdf3"
[(set (match_operand:DF 0 "register_operand" "=e")
(div:DF (match_operand:DF 1 "register_operand" "e")
(match_operand:DF 2 "register_operand" "e")))]
"TARGET_FPU"
- "fdivd %1,%2,%0"
- [(set_attr "type" "fpdivd")])
+ "fdivd\\t%1, %2, %0"
+ [(set_attr "type" "fpdivd")
+ (set_attr "length" "1")])
(define_insn "divsf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(div:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
"TARGET_FPU"
- "fdivs %1,%2,%0"
- [(set_attr "type" "fpdivs")])
+ "fdivs\\t%1, %2, %0"
+ [(set_attr "type" "fpdivs")
+ (set_attr "length" "1")])
-(define_insn "negtf2"
+(define_expand "negtf2"
[(set (match_operand:TF 0 "register_operand" "=e,e")
(neg:TF (match_operand:TF 1 "register_operand" "0,e")))]
- ; We don't use quad float insns here so we don't need TARGET_HARD_QUAD.
"TARGET_FPU"
- "*
-{
- /* v9: can't use fnegs, won't work with upper regs. */
- if (which_alternative == 0)
- return TARGET_V9 ? \"fnegd %0,%0\" : \"fnegs %0,%0\";
- else
- return TARGET_V9 ? \"fnegd %1,%0\;fmovd %S1,%S0\"
- : \"fnegs %1,%0\;fmovs %R1,%R0\;fmovs %S1,%S0\;fmovs %T1,%T0\";
-}"
+ "")
+
+(define_insn "*negtf2_notv9"
+ [(set (match_operand:TF 0 "register_operand" "=e,e")
+ (neg:TF (match_operand:TF 1 "register_operand" "0,e")))]
+ ; We don't use quad float insns here so we don't need TARGET_HARD_QUAD.
+ "TARGET_FPU
+ && ! TARGET_V9"
+ "@
+ fnegs\\t%0, %0
+ #"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1,2")])
+
+(define_split
+ [(set (match_operand:TF 0 "register_operand" "")
+ (neg:TF (match_operand:TF 1 "register_operand" "")))]
+ "TARGET_FPU
+ && ! TARGET_V9
+ && reload_completed
+ && sparc_absnegfloat_split_legitimate (operands[0], operands[1])"
+ [(set (match_dup 2) (neg:SF (match_dup 3)))
+ (set (match_dup 4) (match_dup 5))
+ (set (match_dup 6) (match_dup 7))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ operands[2] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]));
+ operands[3] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]));
+ operands[4] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]) + 1);
+ operands[5] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]) + 1);
+ operands[6] = gen_rtx_raw_REG (DFmode, REGNO (operands[0]) + 2);
+ operands[7] = gen_rtx_raw_REG (DFmode, REGNO (operands[1]) + 2);")
+
+(define_insn "*negtf2_v9"
+ [(set (match_operand:TF 0 "register_operand" "=e,e")
+ (neg:TF (match_operand:TF 1 "register_operand" "0,e")))]
+ ; We don't use quad float insns here so we don't need TARGET_HARD_QUAD.
+ "TARGET_FPU && TARGET_V9"
+ "@
+ fnegd\\t%0, %0
+ #"
[(set_attr "type" "fpmove")
- (set_attr_alternative "length"
- [(const_int 1)
- (if_then_else (eq_attr "isa" "v9") (const_int 2) (const_int 4))])])
+ (set_attr "length" "1,2")])
-(define_insn "negdf2"
+(define_split
+ [(set (match_operand:TF 0 "register_operand" "")
+ (neg:TF (match_operand:TF 1 "register_operand" "")))]
+ "TARGET_FPU
+ && TARGET_V9
+ && reload_completed
+ && sparc_absnegfloat_split_legitimate (operands[0], operands[1])"
+ [(set (match_dup 2) (neg:DF (match_dup 3)))
+ (set (match_dup 4) (match_dup 5))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ operands[2] = gen_rtx_raw_REG (DFmode, REGNO (operands[0]));
+ operands[3] = gen_rtx_raw_REG (DFmode, REGNO (operands[1]));
+ operands[4] = gen_rtx_raw_REG (DFmode, REGNO (operands[0]) + 2);
+ operands[5] = gen_rtx_raw_REG (DFmode, REGNO (operands[1]) + 2);")
+
+(define_expand "negdf2"
+ [(set (match_operand:DF 0 "register_operand" "")
+ (neg:DF (match_operand:DF 1 "register_operand" "")))]
+ "TARGET_FPU"
+ "")
+
+(define_insn "*negdf2_notv9"
[(set (match_operand:DF 0 "register_operand" "=e,e")
(neg:DF (match_operand:DF 1 "register_operand" "0,e")))]
- "TARGET_FPU"
- "*
-{
- if (TARGET_V9)
- return \"fnegd %1,%0\";
- else if (which_alternative == 0)
- return \"fnegs %0,%0\";
- else
- return \"fnegs %1,%0\;fmovs %R1,%R0\";
-}"
+ "TARGET_FPU && ! TARGET_V9"
+ "@
+ fnegs\\t%0, %0
+ #"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1,2")])
+
+(define_split
+ [(set (match_operand:DF 0 "register_operand" "")
+ (neg:DF (match_operand:DF 1 "register_operand" "")))]
+ "TARGET_FPU
+ && ! TARGET_V9
+ && reload_completed
+ && sparc_absnegfloat_split_legitimate (operands[0], operands[1])"
+ [(set (match_dup 2) (neg:SF (match_dup 3)))
+ (set (match_dup 4) (match_dup 5))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ operands[2] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]));
+ operands[3] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]));
+ operands[4] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]) + 1);
+ operands[5] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]) + 1);")
+
+(define_insn "*negdf2_v9"
+ [(set (match_operand:DF 0 "register_operand" "=e")
+ (neg:DF (match_operand:DF 1 "register_operand" "e")))]
+ "TARGET_FPU && TARGET_V9"
+ "fnegd\\t%1, %0"
[(set_attr "type" "fpmove")
- (set_attr_alternative "length"
- [(const_int 1)
- (if_then_else (eq_attr "isa" "v9") (const_int 1) (const_int 2))])])
+ (set_attr "length" "1")])
(define_insn "negsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(neg:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_FPU"
- "fnegs %1,%0"
- [(set_attr "type" "fpmove")])
+ "fnegs\\t%1, %0"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1")])
(define_insn "abstf2"
+ [(set (match_operand:TF 0 "register_operand" "")
+ (abs:TF (match_operand:TF 1 "register_operand" "")))]
+ "TARGET_FPU"
+ "")
+
+(define_insn "*abstf2_notv9"
+ [(set (match_operand:TF 0 "register_operand" "=e,e")
+ (abs:TF (match_operand:TF 1 "register_operand" "0,e")))]
+ ; We don't use quad float insns here so we don't need TARGET_HARD_QUAD.
+ "TARGET_FPU && ! TARGET_V9"
+ "@
+ fabss\\t%0, %0
+ #"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1,2")])
+
+(define_split
+ [(set (match_operand:TF 0 "register_operand" "=e,e")
+ (abs:TF (match_operand:TF 1 "register_operand" "0,e")))]
+ "TARGET_FPU
+ && ! TARGET_V9
+ && reload_completed
+ && sparc_absnegfloat_split_legitimate (operands[0], operands[1])"
+ [(set (match_dup 2) (abs:SF (match_dup 3)))
+ (set (match_dup 4) (match_dup 5))
+ (set (match_dup 6) (match_dup 7))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ operands[2] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]));
+ operands[3] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]));
+ operands[4] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]) + 1);
+ operands[5] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]) + 1);
+ operands[6] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]) + 2);
+ operands[7] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]) + 2);")
+
+(define_insn "*abstf2_v9"
[(set (match_operand:TF 0 "register_operand" "=e,e")
(abs:TF (match_operand:TF 1 "register_operand" "0,e")))]
; We don't use quad float insns here so we don't need TARGET_HARD_QUAD.
+ "TARGET_FPU && TARGET_V9"
+ "@
+ fabsd\\t%0, %0
+ #"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1,2")])
+
+(define_split
+ [(set (match_operand:TF 0 "register_operand" "=e,e")
+ (abs:TF (match_operand:TF 1 "register_operand" "0,e")))]
+ "TARGET_FPU
+ && TARGET_V9
+ && reload_completed
+ && sparc_absnegfloat_split_legitimate (operands[0], operands[1])"
+ [(set (match_dup 2) (abs:DF (match_dup 3)))
+ (set (match_dup 4) (match_dup 5))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ operands[2] = gen_rtx_raw_REG (DFmode, REGNO (operands[0]));
+ operands[3] = gen_rtx_raw_REG (DFmode, REGNO (operands[1]));
+ operands[4] = gen_rtx_raw_REG (DFmode, REGNO (operands[0]) + 2);
+ operands[5] = gen_rtx_raw_REG (DFmode, REGNO (operands[1]) + 2);")
+
+(define_expand "absdf2"
+ [(set (match_operand:DF 0 "register_operand" "")
+ (abs:DF (match_operand:DF 1 "register_operand" "")))]
"TARGET_FPU"
- "*
-{
- /* v9: can't use fabss, won't work with upper regs. */
- if (which_alternative == 0)
- return TARGET_V9 ? \"fabsd %0,%0\" : \"fabss %0,%0\";
- else
- return TARGET_V9 ? \"fabsd %1,%0\;fmovd %S1,%S0\"
- : \"fabss %1,%0\;fmovs %R1,%R0\;fmovs %S1,%S0\;fmovs %T1,%T0\";
-}"
+ "")
+
+(define_insn "*absdf2_notv9"
+ [(set (match_operand:DF 0 "register_operand" "=e,e")
+ (abs:DF (match_operand:DF 1 "register_operand" "0,e")))]
+ "TARGET_FPU && ! TARGET_V9"
+ "@
+ fabss\\t%0, %0
+ #"
[(set_attr "type" "fpmove")
- (set_attr_alternative "length"
- [(const_int 1)
- (if_then_else (eq_attr "isa" "v9") (const_int 2) (const_int 4))])])
+ (set_attr "length" "1,2")])
-(define_insn "absdf2"
+(define_split
[(set (match_operand:DF 0 "register_operand" "=e,e")
(abs:DF (match_operand:DF 1 "register_operand" "0,e")))]
- "TARGET_FPU"
- "*
-{
- if (TARGET_V9)
- return \"fabsd %1,%0\";
- else if (which_alternative == 0)
- return \"fabss %0,%0\";
- else
- return \"fabss %1,%0\;fmovs %R1,%R0\";
-}"
+ "TARGET_FPU
+ && ! TARGET_V9
+ && reload_completed
+ && sparc_absnegfloat_split_legitimate (operands[0], operands[1])"
+ [(set (match_dup 2) (abs:SF (match_dup 3)))
+ (set (match_dup 4) (match_dup 5))]
+ "if (GET_CODE (operands[0]) == SUBREG)
+ operands[0] = alter_subreg (operands[0]);
+ if (GET_CODE (operands[1]) == SUBREG)
+ operands[1] = alter_subreg (operands[1]);
+ operands[2] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]));
+ operands[3] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]));
+ operands[4] = gen_rtx_raw_REG (SFmode, REGNO (operands[0]) + 1);
+ operands[5] = gen_rtx_raw_REG (SFmode, REGNO (operands[1]) + 1);")
+
+(define_insn "*absdf2_v9"
+ [(set (match_operand:DF 0 "register_operand" "=e")
+ (abs:DF (match_operand:DF 1 "register_operand" "e")))]
+ "TARGET_FPU && TARGET_V9"
+ "fabsd\\t%0, %0"
[(set_attr "type" "fpmove")
- (set_attr_alternative "length"
- [(const_int 1)
- (if_then_else (eq_attr "isa" "v9") (const_int 1) (const_int 2))])])
+ (set_attr "length" "1")])
(define_insn "abssf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(abs:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_FPU"
- "fabss %1,%0"
- [(set_attr "type" "fpmove")])
+ "fabss\\t%1, %0"
+ [(set_attr "type" "fpmove")
+ (set_attr "length" "1")])
(define_insn "sqrttf2"
[(set (match_operand:TF 0 "register_operand" "=e")
(sqrt:TF (match_operand:TF 1 "register_operand" "e")))]
"TARGET_FPU && TARGET_HARD_QUAD"
- "fsqrtq %1,%0"
- [(set_attr "type" "fpsqrt")])
+ "fsqrtq\\t%1, %0"
+ [(set_attr "type" "fpsqrt")
+ (set_attr "length" "1")])
(define_insn "sqrtdf2"
[(set (match_operand:DF 0 "register_operand" "=e")
(sqrt:DF (match_operand:DF 1 "register_operand" "e")))]
"TARGET_FPU"
- "fsqrtd %1,%0"
- [(set_attr "type" "fpsqrt")])
+ "fsqrtd\\t%1, %0"
+ [(set_attr "type" "fpsqrt")
+ (set_attr "length" "1")])
(define_insn "sqrtsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
(sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
"TARGET_FPU"
- "fsqrts %1,%0"
- [(set_attr "type" "fpsqrt")])
+ "fsqrts\\t%1, %0"
+ [(set_attr "type" "fpsqrt")
+ (set_attr "length" "1")])
;;- arithmetic shift instructions
@@ -5342,9 +6899,21 @@ return \"srl %1,0,%0\";
&& (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sll %1,%2,%0\";
+ return \"sll\\t%1, %2, %0\";
}"
- [(set_attr "type" "shift")])
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+
+;; We special case multiplication by two, as add can be done
+;; in both ALUs, while shift only in IEU0 on UltraSPARC.
+(define_insn "*ashlsi3_const1"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (ashift:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 1)))]
+ ""
+ "add\\t%1, %1, %0"
+ [(set_attr "type" "binary")
+ (set_attr "length" "1")])
(define_expand "ashldi3"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -5362,7 +6931,18 @@ return \"srl %1,0,%0\";
}
}")
-(define_insn ""
+;; We special case multiplication by two, as add can be done
+;; in both ALUs, while shift only in IEU0 on UltraSPARC.
+(define_insn "*ashldi3_const1"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (ashift:DI (match_operand:DI 1 "register_operand" "r")
+ (const_int 1)))]
+ "TARGET_ARCH64"
+ "add\\t%1, %1, %0"
+ [(set_attr "type" "binary")
+ (set_attr "length" "1")])
+
+(define_insn "*ashldi3_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
(ashift:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI")))]
@@ -5370,29 +6950,50 @@ return \"srl %1,0,%0\";
"*
{
if (GET_CODE (operands[2]) == CONST_INT
- && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 31)
+ && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 63)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"sllx %1,%2,%0\";
-}")
+ return \"sllx\\t%1, %2, %0\";
+}"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+;; XXX UGH!
(define_insn "ashldi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=&h,&h,r")
- (ashift:DI (match_operand:DI 1 "register_operand" "r,0,r")
+ (ashift:DI (match_operand:DI 1 "arith_operand" "rI,0,rI")
(match_operand:SI 2 "arith_operand" "rI,rI,rI")))
(clobber (match_scratch:SI 3 "=X,X,&h"))]
"TARGET_V8PLUS"
"*return sparc_v8plus_shift (operands, insn, \"sllx\");"
[(set_attr "length" "5,5,6")])
+;; Optimize (1LL<<x)-1
+;; XXX this also needs to be fixed to handle equal subregs
+;; XXX first before we could re-enable it.
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=h")
+ (plus:DI (ashift:DI (const_int 1)
+ (match_operand:SI 2 "arith_operand" "rI"))
+ (const_int -1)))]
+ "0 && TARGET_V8PLUS"
+ "*
+{
+ if (GET_CODE (operands[2]) == REG && REGNO (operands[2]) == REGNO (operands[0]))
+ return \"mov 1,%L0\;sllx %L0,%2,%L0\;sub %L0,1,%L0\;srlx %L0,32,%H0\";
+ return \"mov 1,%H0\;sllx %H0,%2,%L0\;sub %L0,1,%L0\;srlx %L0,32,%H0\";
+}"
+ [(set_attr "length" "4")])
+
(define_insn "*cmp_cc_ashift_1"
[(set (reg:CC_NOOV 100)
(compare:CC_NOOV (ashift:SI (match_operand:SI 0 "register_operand" "r")
(const_int 1))
(const_int 0)))]
- ""
- "addcc %0,%0,%%g0"
- [(set_attr "type" "compare")])
+ "! TARGET_LIVE_G0"
+ "addcc\\t%0, %0, %%g0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "*cmp_cc_set_ashift_1"
[(set (reg:CC_NOOV 100)
@@ -5402,7 +7003,9 @@ return \"srl %1,0,%0\";
(set (match_operand:SI 0 "register_operand" "=r")
(ashift:SI (match_dup 1) (const_int 1)))]
""
- "addcc %1,%1,%0")
+ "addcc\\t%1, %1, %0"
+ [(set_attr "type" "compare")
+ (set_attr "length" "1")])
(define_insn "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -5415,9 +7018,42 @@ return \"srl %1,0,%0\";
&& (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"sra %1,%2,%0\";
+ return \"sra\\t%1, %2, %0\";
}"
- [(set_attr "type" "shift")])
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+
+(define_insn "*ashrsi3_extend"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (sign_extend:DI (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "arith_operand" "r"))))]
+ "TARGET_ARCH64"
+ "sra\\t%1, %2, %0"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+
+;; This handles the case as above, but with constant shift instead of
+;; register. Combiner "simplifies" it for us a little bit though.
+(define_insn "*ashrsi3_extend2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 1 "register_operand" "r") 0)
+ (const_int 32))
+ (match_operand:SI 2 "small_int_or_double" "n")))]
+ "TARGET_ARCH64
+ && ((GET_CODE (operands[2]) == CONST_INT
+ && INTVAL (operands[2]) >= 32 && INTVAL (operands[2]) < 64)
+ || (GET_CODE (operands[2]) == CONST_DOUBLE
+ && !CONST_DOUBLE_HIGH (operands[2])
+ && CONST_DOUBLE_LOW (operands[2]) >= 32
+ && CONST_DOUBLE_LOW (operands[2]) < 64))"
+ "*
+{
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
+
+ return \"sra\\t%1, %2, %0\";
+}"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
(define_expand "ashrdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -5425,13 +7061,15 @@ return \"srl %1,0,%0\";
(match_operand:SI 2 "arith_operand" "rI")))]
"TARGET_ARCH64 || TARGET_V8PLUS"
"
-if (! TARGET_ARCH64)
- {
- if (GET_CODE (operands[2]) == CONST_INT)
- FAIL; /* prefer generic code in this case */
- emit_insn (gen_ashrdi3_v8plus (operands[0], operands[1], operands[2]));
- DONE;
- }")
+{
+ if (! TARGET_ARCH64)
+ {
+ if (GET_CODE (operands[2]) == CONST_INT)
+ FAIL; /* prefer generic code in this case */
+ emit_insn (gen_ashrdi3_v8plus (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+}")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -5444,12 +7082,15 @@ if (! TARGET_ARCH64)
&& (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 63)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"srax %1,%2,%0\";
-}")
+ return \"srax\\t%1, %2, %0\";
+}"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+;; XXX
(define_insn "ashrdi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=&h,&h,r")
- (ashiftrt:DI (match_operand:DI 1 "register_operand" "r,0,r")
+ (ashiftrt:DI (match_operand:DI 1 "arith_operand" "rI,0,rI")
(match_operand:SI 2 "arith_operand" "rI,rI,rI")))
(clobber (match_scratch:SI 3 "=X,X,&h"))]
"TARGET_V8PLUS"
@@ -5467,9 +7108,54 @@ if (! TARGET_ARCH64)
&& (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return \"srl %1,%2,%0\";
+ return \"srl\\t%1, %2, %0\";
+}"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+
+;; This handles the case where
+;; (zero_extend:DI (lshiftrt:SI (match_operand:SI) (match_operand:SI))),
+;; but combiner "simplifies" it for us.
+(define_insn "*lshrsi3_extend"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (and:DI (subreg:DI (lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "arith_operand" "r")) 0)
+ (match_operand 3 "" "")))]
+ "TARGET_ARCH64
+ && ((GET_CODE (operands[3]) == CONST_DOUBLE
+ && CONST_DOUBLE_HIGH (operands[3]) == 0
+ && CONST_DOUBLE_LOW (operands[3]) == 0xffffffff)
+#if HOST_BITS_PER_WIDE_INT >= 64
+ || (GET_CODE (operands[3]) == CONST_INT
+ && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) == 0xffffffff)
+#endif
+ )"
+ "srl\\t%1, %2, %0"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+
+;; This handles the case where
+;; (lshiftrt:DI (zero_extend:DI (match_operand:SI)) (const_int >=0 < 32))
+;; but combiner "simplifies" it for us.
+(define_insn "*lshrsi3_extend2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extract:DI (subreg:DI (match_operand:SI 1 "register_operand" "r") 0)
+ (match_operand 2 "small_int_or_double" "n")
+ (const_int 32)))]
+ "TARGET_ARCH64
+ && ((GET_CODE (operands[2]) == CONST_INT
+ && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32)
+ || (GET_CODE (operands[2]) == CONST_DOUBLE
+ && CONST_DOUBLE_HIGH (operands[2]) == 0
+ && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))"
+ "*
+{
+ operands[2] = GEN_INT (32 - INTVAL (operands[2]));
+
+ return \"srl\\t%1, %2, %0\";
}"
- [(set_attr "type" "shift")])
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
(define_expand "lshrdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -5477,13 +7163,15 @@ if (! TARGET_ARCH64)
(match_operand:SI 2 "arith_operand" "rI")))]
"TARGET_ARCH64 || TARGET_V8PLUS"
"
-if (! TARGET_ARCH64)
- {
- if (GET_CODE (operands[2]) == CONST_INT)
- FAIL;
- emit_insn (gen_lshrdi3_v8plus (operands[0], operands[1], operands[2]));
- DONE;
- }")
+{
+ if (! TARGET_ARCH64)
+ {
+ if (GET_CODE (operands[2]) == CONST_INT)
+ FAIL;
+ emit_insn (gen_lshrdi3_v8plus (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+}")
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -5496,12 +7184,15 @@ if (! TARGET_ARCH64)
&& (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 63)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
- return \"srlx %1,%2,%0\";
-}")
+ return \"srlx\\t%1, %2, %0\";
+}"
+ [(set_attr "type" "shift")
+ (set_attr "length" "1")])
+;; XXX
(define_insn "lshrdi3_v8plus"
[(set (match_operand:DI 0 "register_operand" "=&h,&h,r")
- (lshiftrt:DI (match_operand:DI 1 "register_operand" "r,0,r")
+ (lshiftrt:DI (match_operand:DI 1 "arith_operand" "rI,0,rI")
(match_operand:SI 2 "arith_operand" "rI,rI,rI")))
(clobber (match_scratch:SI 3 "=X,X,&h"))]
"TARGET_V8PLUS"
@@ -5517,19 +7208,19 @@ if (! TARGET_ARCH64)
""
"*
{
- /* Some implementations (e.g. TurboSparc) are reported to have problems
+ /* TurboSparc is reported to have problems with
with
foo: b,a foo
i.e. an empty loop with the annul bit set. The workaround is to use
foo: b foo; nop
instead. */
- if (flag_delayed_branch
+ if (! TARGET_V9 && flag_delayed_branch
&& (insn_addresses[INSN_UID (operands[0])]
== insn_addresses[INSN_UID (insn)]))
- return \"b %l0%#\";
+ return \"b\\t%l0%#\";
else
- return \"b%* %l0%(\";
+ return TARGET_V9 ? \"ba,pt%*\\t%%xcc, %l0%(\" : \"b%*\\t%l0%(\";
}"
[(set_attr "type" "uncond_branch")])
@@ -5539,49 +7230,36 @@ if (! TARGET_ARCH64)
""
"
{
- if (GET_MODE (operands[0]) != Pmode)
+ if (GET_MODE (operands[0]) != CASE_VECTOR_MODE)
abort ();
- /* We need to use the PC value in %o7 that was set up when the address
- of the label was loaded into a register, so we need different RTL. */
+ /* In pic mode, our address differences are against the base of the
+ table. Add that base value back in; CSE ought to be able to combine
+ the two address loads. */
if (flag_pic)
{
- if (!TARGET_PTR64)
- emit_jump_insn (gen_pic_tablejump_32 (operands[0], operands[1]));
- else
- emit_jump_insn (gen_pic_tablejump_64 (operands[0], operands[1]));
- DONE;
+ rtx tmp, tmp2;
+ tmp = gen_rtx_LABEL_REF (Pmode, operands[1]);
+ tmp2 = operands[0];
+ if (CASE_VECTOR_MODE != Pmode)
+ tmp2 = gen_rtx_SIGN_EXTEND (Pmode, tmp2);
+ tmp = gen_rtx_PLUS (Pmode, tmp2, tmp);
+ operands[0] = memory_address (Pmode, tmp);
}
}")
-(define_insn "pic_tablejump_32"
- [(set (pc) (match_operand:SI 0 "register_operand" "r"))
- (use (label_ref (match_operand 1 "" "")))
- (use (reg:SI 15))]
- "! TARGET_PTR64"
- "jmp %%o7+%0%#"
- [(set_attr "type" "uncond_branch")])
-
-(define_insn "pic_tablejump_64"
- [(set (pc) (match_operand:DI 0 "register_operand" "r"))
- (use (label_ref (match_operand 1 "" "")))
- (use (reg:DI 15))]
- "TARGET_PTR64"
- "jmp %%o7+%0%#"
- [(set_attr "type" "uncond_branch")])
-
(define_insn "*tablejump_sp32"
[(set (pc) (match_operand:SI 0 "address_operand" "p"))
(use (label_ref (match_operand 1 "" "")))]
"! TARGET_PTR64"
- "jmp %a0%#"
+ "jmp\\t%a0%#"
[(set_attr "type" "uncond_branch")])
(define_insn "*tablejump_sp64"
[(set (pc) (match_operand:DI 0 "address_operand" "p"))
(use (label_ref (match_operand 1 "" "")))]
"TARGET_PTR64"
- "jmp %a0%#"
+ "jmp\\t%a0%#"
[(set_attr "type" "uncond_branch")])
;; This pattern recognizes the "instruction" that appears in
@@ -5590,7 +7268,7 @@ if (! TARGET_ARCH64)
;(define_insn "*unimp_insn"
; [(match_operand:SI 0 "immediate_operand" "")]
; "GET_CODE (operands[0]) == CONST_INT && INTVAL (operands[0]) > 0"
-; "unimp %0"
+; "unimp\\t%0"
; [(set_attr "type" "marker")])
;;- jump to subroutine
@@ -5612,7 +7290,7 @@ if (! TARGET_ARCH64)
if (GET_CODE (XEXP (operands[0], 0)) == LABEL_REF)
{
/* This is really a PIC sequence. We want to represent
- it as a funny jump so it's delay slots can be filled.
+ it as a funny jump so its delay slots can be filled.
??? But if this really *is* a CALL, will not it clobber the
call-clobbered registers? We lose this if it is a JUMP_INSN.
@@ -5620,21 +7298,21 @@ if (! TARGET_ARCH64)
if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0)
emit_jump_insn
- (gen_rtx (PARALLEL, VOIDmode,
+ (gen_rtx_PARALLEL (VOIDmode,
gen_rtvec (3,
- gen_rtx (SET, VOIDmode, pc_rtx,
+ gen_rtx_SET (VOIDmode, pc_rtx,
XEXP (operands[0], 0)),
GEN_INT (INTVAL (operands[3]) & 0xfff),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, Pmode, 15)))));
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (Pmode, 15)))));
else
emit_jump_insn
- (gen_rtx (PARALLEL, VOIDmode,
+ (gen_rtx_PARALLEL (VOIDmode,
gen_rtvec (2,
- gen_rtx (SET, VOIDmode, pc_rtx,
+ gen_rtx_SET (VOIDmode, pc_rtx,
XEXP (operands[0], 0)),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, Pmode, 15)))));
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (Pmode, 15)))));
goto finish_call;
}
@@ -5654,17 +7332,17 @@ if (! TARGET_ARCH64)
if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0)
emit_call_insn
- (gen_rtx (PARALLEL, VOIDmode,
- gen_rtvec (3, gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx),
+ (gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx),
GEN_INT (INTVAL (operands[3]) & 0xfff),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, Pmode, 15)))));
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (Pmode, 15)))));
else
emit_call_insn
- (gen_rtx (PARALLEL, VOIDmode,
- gen_rtvec (2, gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx),
- gen_rtx (CLOBBER, VOIDmode,
- gen_rtx (REG, Pmode, 15)))));
+ (gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (Pmode, 15)))));
finish_call:
#if 0
@@ -5689,7 +7367,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 1 for most machines.
"! TARGET_PTR64"
- "call %a0,%1%#"
+ "call\\t%a0, %1%#"
[(set_attr "type" "call")])
(define_insn "*call_symbolic_sp32"
@@ -5698,7 +7376,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 1 for most machines.
"! TARGET_PTR64"
- "call %a0,%1%#"
+ "call\\t%a0, %1%#"
[(set_attr "type" "call")])
(define_insn "*call_address_sp64"
@@ -5707,7 +7385,7 @@ if (! TARGET_ARCH64)
(clobber (reg:DI 15))]
;;- Do not use operand 1 for most machines.
"TARGET_PTR64"
- "call %a0,%1%#"
+ "call\\t%a0, %1%#"
[(set_attr "type" "call")])
(define_insn "*call_symbolic_sp64"
@@ -5716,7 +7394,7 @@ if (! TARGET_ARCH64)
(clobber (reg:DI 15))]
;;- Do not use operand 1 for most machines.
"TARGET_PTR64"
- "call %a0,%1%#"
+ "call\\t%a0, %1%#"
[(set_attr "type" "call")])
;; This is a call that wants a structure value.
@@ -5728,7 +7406,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 0"
- "call %a0,%1\;nop\;unimp %2"
+ "call\\t%a0, %1\\n\\tnop\\n\\tunimp\\t%2"
[(set_attr "type" "call_no_delay_slot")])
;; This is a call that wants a structure value.
@@ -5740,7 +7418,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 0"
- "call %a0,%1\;nop\;unimp %2"
+ "call\\t%a0, %1\\n\\tnop\\n\\tunimp\\t%2"
[(set_attr "type" "call_no_delay_slot")])
;; This is a call that may want a structure value. This is used for
@@ -5752,7 +7430,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0"
- "call %a0,%1\;nop\;nop"
+ "call\\t%a0, %1\\n\\tnop\\n\\tnop"
[(set_attr "type" "call_no_delay_slot")])
;; This is a call that wants a structure value.
@@ -5763,7 +7441,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0"
- "call %a0,%1\;nop\;nop"
+ "call\\t%a0, %1\\n\\tnop\\n\\tnop"
[(set_attr "type" "call_no_delay_slot")])
(define_expand "call_value"
@@ -5795,11 +7473,11 @@ if (! TARGET_ARCH64)
#endif
vec = gen_rtvec (2,
- gen_rtx (SET, VOIDmode, operands[0],
- gen_rtx (CALL, VOIDmode, fn_rtx, nregs_rtx)),
- gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, Pmode, 15)));
+ gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)));
- emit_call_insn (gen_rtx (PARALLEL, VOIDmode, vec));
+ emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec));
DONE;
}")
@@ -5811,7 +7489,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 2 for most machines.
"! TARGET_PTR64"
- "call %a1,%2%#"
+ "call\\t%a1, %2%#"
[(set_attr "type" "call")])
(define_insn "*call_value_symbolic_sp32"
@@ -5821,7 +7499,7 @@ if (! TARGET_ARCH64)
(clobber (reg:SI 15))]
;;- Do not use operand 2 for most machines.
"! TARGET_PTR64"
- "call %a1,%2%#"
+ "call\\t%a1, %2%#"
[(set_attr "type" "call")])
(define_insn "*call_value_address_sp64"
@@ -5831,7 +7509,7 @@ if (! TARGET_ARCH64)
(clobber (reg:DI 15))]
;;- Do not use operand 2 for most machines.
"TARGET_PTR64"
- "call %a1,%2%#"
+ "call\\t%a1, %2%#"
[(set_attr "type" "call")])
(define_insn "*call_value_symbolic_sp64"
@@ -5841,7 +7519,7 @@ if (! TARGET_ARCH64)
(clobber (reg:DI 15))]
;;- Do not use operand 2 for most machines.
"TARGET_PTR64"
- "call %a1,%2%#"
+ "call\\t%a1, %2%#"
[(set_attr "type" "call")])
(define_expand "untyped_call"
@@ -5889,20 +7567,20 @@ if (! TARGET_ARCH64)
""
"
{
- rtx valreg1 = gen_rtx (REG, DImode, 24);
- rtx valreg2 = gen_rtx (REG, TARGET_ARCH64 ? TFmode : DFmode, 32);
+ rtx valreg1 = gen_rtx_REG (DImode, 24);
+ rtx valreg2 = gen_rtx_REG (TARGET_ARCH64 ? TFmode : DFmode, 32);
rtx result = operands[0];
if (! TARGET_ARCH64)
{
- rtx rtnreg = gen_rtx (REG, SImode, (leaf_function ? 15 : 31));
+ rtx rtnreg = gen_rtx_REG (SImode, (leaf_function ? 15 : 31));
rtx value = gen_reg_rtx (SImode);
/* Fetch the instruction where we will return to and see if it's an unimp
instruction (the most significant 10 bits will be zero). If so,
update the return address to skip the unimp instruction. */
emit_move_insn (value,
- gen_rtx (MEM, SImode, plus_constant (rtnreg, 8)));
+ gen_rtx_MEM (SImode, plus_constant (rtnreg, 8)));
emit_insn (gen_lshrsi3 (value, value, GEN_INT (22)));
emit_insn (gen_update_return (rtnreg, value));
}
@@ -5914,8 +7592,8 @@ if (! TARGET_ARCH64)
plus_constant (XEXP (result, 0), 8)));
/* Put USE insns before the return. */
- emit_insn (gen_rtx (USE, VOIDmode, valreg1));
- emit_insn (gen_rtx (USE, VOIDmode, valreg2));
+ emit_insn (gen_rtx_USE (VOIDmode, valreg1));
+ emit_insn (gen_rtx_USE (VOIDmode, valreg2));
/* Construct the return. */
expand_null_return ();
@@ -5946,12 +7624,14 @@ if (! TARGET_ARCH64)
(parallel [(return)
(use (reg:SI 31))])]
"sparc_return_peephole_ok (operands[0], operands[1])"
- "return %%i7+8\;mov %Y1,%Y0")
+ "return\\t%%i7+8\\n\\tmov\\t%Y1, %Y0")
(define_insn "nop"
[(const_int 0)]
""
- "nop")
+ "nop"
+ [(set_attr "type" "ialu")
+ (set_attr "length" "1")])
(define_expand "indirect_jump"
[(set (pc) (match_operand 0 "address_operand" "p"))]
@@ -5961,13 +7641,13 @@ if (! TARGET_ARCH64)
(define_insn "*branch_sp32"
[(set (pc) (match_operand:SI 0 "address_operand" "p"))]
"! TARGET_PTR64"
- "jmp %a0%#"
+ "jmp\\t%a0%#"
[(set_attr "type" "uncond_branch")])
(define_insn "*branch_sp64"
[(set (pc) (match_operand:DI 0 "address_operand" "p"))]
"TARGET_PTR64"
- "jmp %a0%#"
+ "jmp\\t%a0%#"
[(set_attr "type" "uncond_branch")])
;; ??? Doesn't work with -mflat.
@@ -5997,7 +7677,7 @@ if (! TARGET_ARCH64)
/* Find the containing function's current nonlocal goto handler,
which will do any cleanups and then jump to the label. */
- labreg = gen_rtx (REG, Pmode, 8);
+ labreg = gen_rtx_REG (Pmode, 8);
emit_move_insn (labreg, lab);
/* Restore %fp from stack pointer value for containing function.
@@ -6007,8 +7687,8 @@ if (! TARGET_ARCH64)
/* USE of frame_pointer_rtx added for consistency; not clear if
really needed. */
- /*emit_insn (gen_rtx (USE, VOIDmode, frame_pointer_rtx));*/
- emit_insn (gen_rtx (USE, VOIDmode, stack_pointer_rtx));
+ /*emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx));*/
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
/* Return, restoring reg window and jumping to goto handler. */
if (TARGET_V9 && GET_CODE (chain) == CONST_INT
&& ! (INTVAL (chain) & ~(HOST_WIDE_INT)0xffffffff))
@@ -6020,7 +7700,7 @@ if (! TARGET_ARCH64)
}
/* Put in the static chain register the nonlocal label address. */
emit_move_insn (static_chain_rtx, chain);
- emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
emit_insn (gen_goto_handler_and_restore (labreg));
emit_barrier ();
DONE;
@@ -6030,13 +7710,14 @@ if (! TARGET_ARCH64)
(define_insn "flush_register_windows"
[(unspec_volatile [(const_int 0)] 1)]
""
- "* return TARGET_V9 ? \"flushw\" : \"ta 3\";"
- [(set_attr "type" "misc")])
+ "* return TARGET_V9 ? \"flushw\" : \"ta\\t3\";"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
(define_insn "goto_handler_and_restore"
- [(unspec_volatile [(match_operand:SI 0 "register_operand" "=r")] 2)]
+ [(unspec_volatile [(match_operand 0 "register_operand" "=r")] 2)]
""
- "jmp %0+0\;restore"
+ "jmp\\t%0+0\\n\\trestore"
[(set_attr "type" "misc")
(set_attr "length" "2")])
@@ -6046,8 +7727,8 @@ if (! TARGET_ARCH64)
(match_operand:SI 2 "const_int_operand" "I,n")] 3)]
"TARGET_V9 && ! TARGET_ARCH64"
"@
- return %0+0\;mov %2,%Y1
- sethi %%hi(%2),%1\;return %0+0\;or %Y1,%%lo(%2),%Y1"
+ return\\t%0+0\\n\\tmov\\t%2, %Y1
+ sethi\\t%%hi(%2), %1\\n\\treturn\\t%0+0\\n\\tor\\t%Y1, %%lo(%2), %Y1"
[(set_attr "type" "misc")
(set_attr "length" "2,3")])
@@ -6057,8 +7738,8 @@ if (! TARGET_ARCH64)
(match_operand:SI 2 "const_int_operand" "I,n")] 3)]
"TARGET_V9 && TARGET_ARCH64"
"@
- return %0+0\;mov %2,%Y1
- sethi %%hi(%2),%1\;return %0+0\;or %Y1,%%lo(%2),%Y1"
+ return\\t%0+0\\n\\tmov\\t%2, %Y1
+ sethi\\t%%hi(%2), %1\\n\\treturn\\t%0+0\\n\\tor\\t%Y1, %%lo(%2), %Y1"
[(set_attr "type" "misc")
(set_attr "length" "2,3")])
@@ -6094,10 +7775,11 @@ if (! TARGET_ARCH64)
;; Special pattern for the FLUSH instruction.
(define_insn "flush"
- [(unspec_volatile [(match_operand 0 "memory_operand" "m")] 3)]
+ [(unspec_volatile [(match_operand 0 "memory_operand" "m")] 4)]
""
- "* return TARGET_V9 ? \"flush %f0\" : \"iflush %f0\";"
- [(set_attr "type" "misc")])
+ "* return TARGET_V9 ? \"flush\\t%f0\" : \"iflush\\t%f0\";"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
;; find first set.
@@ -6106,6 +7788,7 @@ if (! TARGET_ARCH64)
;; zero also differ. It takes at least 7 instructions to get the proper
;; result. Here is an obvious 8 instruction sequence.
+;; XXX
(define_insn "ffssi2"
[(set (match_operand:SI 0 "register_operand" "=&r")
(ffs:SI (match_operand:SI 1 "register_operand" "r")))
@@ -6123,213 +7806,18 @@ if (! TARGET_ARCH64)
;; ??? This should be a define expand, so that the extra instruction have
;; a chance of being optimized away.
-(define_insn "ffsdi2"
- [(set (match_operand:DI 0 "register_operand" "=&r")
- (ffs:DI (match_operand:DI 1 "register_operand" "r")))
- (clobber (match_scratch:DI 2 "=&r"))]
- "TARGET_ARCH64"
- "neg %1,%2\;not %2,%2\;xor %1,%2,%2\;popc %2,%0\;movrz %1,0,%0"
- [(set_attr "type" "multi")
- (set_attr "length" "5")])
-
-;; Split up troublesome insns for better scheduling. */
-
-;; The following patterns are straightforward. They can be applied
-;; either before or after register allocation.
-
-(define_split
- [(set (match_operand 0 "splittable_symbolic_memory_operand" "")
- (match_operand 1 "reg_or_0_operand" ""))
- (clobber (match_operand:SI 2 "register_operand" ""))]
- "! flag_pic"
- [(set (match_dup 2) (high:SI (match_dup 3)))
- (set (match_dup 4) (match_dup 1))]
- "
-{
- operands[3] = XEXP (operands[0], 0);
- operands[4] = gen_rtx (MEM, GET_MODE (operands[0]),
- gen_rtx (LO_SUM, SImode, operands[2], operands[3]));
- MEM_IN_STRUCT_P (operands[4]) = MEM_IN_STRUCT_P (operands[0]);
- MEM_VOLATILE_P (operands[4]) = MEM_VOLATILE_P (operands[0]);
- RTX_UNCHANGING_P (operands[4]) = RTX_UNCHANGING_P (operands[0]);
-}")
-
-(define_split
- [(set (match_operand 0 "splittable_immediate_memory_operand" "")
- (match_operand 1 "general_operand" ""))
- (clobber (match_operand:SI 2 "register_operand" ""))]
- "flag_pic"
- [(set (match_dup 3) (match_dup 1))]
- "
-{
- rtx addr = legitimize_pic_address (XEXP (operands[0], 0),
- GET_MODE (operands[0]),
- operands[2]);
- operands[3] = gen_rtx (MEM, GET_MODE (operands[0]), addr);
- MEM_IN_STRUCT_P (operands[3]) = MEM_IN_STRUCT_P (operands[0]);
- MEM_VOLATILE_P (operands[3]) = MEM_VOLATILE_P (operands[0]);
- RTX_UNCHANGING_P (operands[3]) = RTX_UNCHANGING_P (operands[0]);
-}")
-
-(define_split
- [(set (match_operand 0 "register_operand" "")
- (match_operand 1 "splittable_immediate_memory_operand" ""))]
- "flag_pic"
- [(set (match_dup 0) (match_dup 2))]
- "
-{
- rtx addr = legitimize_pic_address (XEXP (operands[1], 0),
- GET_MODE (operands[1]),
- operands[0]);
- operands[2] = gen_rtx (MEM, GET_MODE (operands[1]), addr);
- MEM_IN_STRUCT_P (operands[2]) = MEM_IN_STRUCT_P (operands[1]);
- MEM_VOLATILE_P (operands[2]) = MEM_VOLATILE_P (operands[1]);
- RTX_UNCHANGING_P (operands[2]) = RTX_UNCHANGING_P (operands[1]);
-}")
-
-;; Sign- and Zero-extend operations can have symbolic memory operands.
-
-(define_split
- [(set (match_operand 0 "register_operand" "")
- (match_operator 1 "extend_op" [(match_operand 2 "splittable_immediate_memory_operand" "")]))]
- "flag_pic"
- [(set (match_dup 0) (match_op_dup 1 [(match_dup 3)]))]
- "
-{
- rtx addr = legitimize_pic_address (XEXP (operands[2], 0),
- GET_MODE (operands[2]),
- operands[0]);
- operands[3] = gen_rtx (MEM, GET_MODE (operands[2]), addr);
- MEM_IN_STRUCT_P (operands[3]) = MEM_IN_STRUCT_P (operands[2]);
- MEM_VOLATILE_P (operands[3]) = MEM_VOLATILE_P (operands[2]);
- RTX_UNCHANGING_P (operands[3]) = RTX_UNCHANGING_P (operands[2]);
-}")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (match_operand:SI 1 "immediate_operand" ""))]
- "! flag_pic && (GET_CODE (operands[1]) == SYMBOL_REF
- || GET_CODE (operands[1]) == CONST
- || GET_CODE (operands[1]) == LABEL_REF)"
- [(set (match_dup 0) (high:SI (match_dup 1)))
- (set (match_dup 0)
- (lo_sum:SI (match_dup 0) (match_dup 1)))]
- "")
-
-;; LABEL_REFs are not modified by `legitimize_pic_address'
-;; so do not recurse infinitely in the PIC case.
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (match_operand:SI 1 "immediate_operand" ""))]
- "flag_pic && (GET_CODE (operands[1]) == SYMBOL_REF
- || GET_CODE (operands[1]) == CONST)"
- [(set (match_dup 0) (match_dup 1))]
- "
-{
- operands[1] = legitimize_pic_address (operands[1], Pmode, operands[0]);
-}")
-
-;; These split sne/seq insns. The forms of the resulting insns are
-;; somewhat bogus, but they avoid extra patterns and show data dependency.
-;; Nothing will look at these in detail after splitting has occurred.
-
-;; ??? v9 DImode versions are missing because addc and subc use %icc.
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (ne:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0)))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (ltu:SI (reg:CC 100) (const_int 0)))]
- "")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (neg:SI (ne:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0))))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
- "")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (eq:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0)))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (geu:SI (reg:CC 100) (const_int 0)))]
- "")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (neg:SI (eq:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0))))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (neg:SI (geu:SI (reg:CC 100) (const_int 0))))]
- "")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (plus:SI (ne:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0))
- (match_operand:SI 2 "register_operand" "")))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
- (match_dup 2)))]
- "")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (minus:SI (match_operand:SI 2 "register_operand" "")
- (ne:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0))))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (minus:SI (match_dup 2)
- (ltu:SI (reg:CC 100) (const_int 0))))]
- "")
-
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (plus:SI (eq:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0))
- (match_operand:SI 2 "register_operand" "")))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (plus:SI (geu:SI (reg:CC 100) (const_int 0))
- (match_dup 2)))]
- "")
+;; Disabled because none of the UltraSparcs implement popc. The HAL R1
+;; does, but no one uses that and we don't have a switch for it.
+;
+;(define_insn "ffsdi2"
+; [(set (match_operand:DI 0 "register_operand" "=&r")
+; (ffs:DI (match_operand:DI 1 "register_operand" "r")))
+; (clobber (match_scratch:DI 2 "=&r"))]
+; "TARGET_ARCH64"
+; "neg %1,%2\;xnor %1,%2,%2\;popc %2,%0\;movzr %1,0,%0"
+; [(set_attr "type" "multi")
+; (set_attr "length" "4")])
-(define_split
- [(set (match_operand:SI 0 "register_operand" "")
- (minus:SI (match_operand:SI 2 "register_operand" "")
- (eq:SI (match_operand:SI 1 "register_operand" "")
- (const_int 0))))
- (clobber (reg:CC 100))]
- ""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
- (const_int 0)))
- (set (match_dup 0) (minus:SI (match_dup 2)
- (geu:SI (reg:CC 100) (const_int 0))))]
- "")
;; Peepholes go at the end.
@@ -6343,9 +7831,10 @@ if (! TARGET_ARCH64)
(set (match_operand:SI 1 "memory_operand" "")
(const_int 0))]
"TARGET_V9
- && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[1])
+ && ! MEM_VOLATILE_P (operands[0])
+ && ! MEM_VOLATILE_P (operands[1])
&& addrs_ok_for_ldd_peep (XEXP (operands[0], 0), XEXP (operands[1], 0))"
- "stx %%g0,%0")
+ "stx\\t%%g0, %0")
(define_peephole
[(set (match_operand:SI 0 "memory_operand" "")
@@ -6353,89 +7842,98 @@ if (! TARGET_ARCH64)
(set (match_operand:SI 1 "memory_operand" "")
(const_int 0))]
"TARGET_V9
- && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[1])
+ && ! MEM_VOLATILE_P (operands[0])
+ && ! MEM_VOLATILE_P (operands[1])
&& addrs_ok_for_ldd_peep (XEXP (operands[1], 0), XEXP (operands[0], 0))"
- "stx %%g0,%1")
+ "stx\\t%%g0, %1")
(define_peephole
[(set (match_operand:SI 0 "register_operand" "=rf")
(match_operand:SI 1 "memory_operand" ""))
(set (match_operand:SI 2 "register_operand" "=rf")
(match_operand:SI 3 "memory_operand" ""))]
- "registers_ok_for_ldd_peep (operands[0], operands[2])
- && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3])
+ "registers_ok_for_ldd_peep (operands[0], operands[2])
+ && ! MEM_VOLATILE_P (operands[1])
+ && ! MEM_VOLATILE_P (operands[3])
&& addrs_ok_for_ldd_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))"
- "ldd %1,%0")
+ "ldd\\t%1, %0")
(define_peephole
[(set (match_operand:SI 0 "memory_operand" "")
(match_operand:SI 1 "register_operand" "rf"))
(set (match_operand:SI 2 "memory_operand" "")
(match_operand:SI 3 "register_operand" "rf"))]
- "registers_ok_for_ldd_peep (operands[1], operands[3])
- && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2])
+ "registers_ok_for_ldd_peep (operands[1], operands[3])
+ && ! MEM_VOLATILE_P (operands[0])
+ && ! MEM_VOLATILE_P (operands[2])
&& addrs_ok_for_ldd_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
- "std %1,%0")
+ "std\\t%1, %0")
(define_peephole
[(set (match_operand:SF 0 "register_operand" "=fr")
(match_operand:SF 1 "memory_operand" ""))
(set (match_operand:SF 2 "register_operand" "=fr")
(match_operand:SF 3 "memory_operand" ""))]
- "registers_ok_for_ldd_peep (operands[0], operands[2])
- && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3])
+ "registers_ok_for_ldd_peep (operands[0], operands[2])
+ && ! MEM_VOLATILE_P (operands[1])
+ && ! MEM_VOLATILE_P (operands[3])
&& addrs_ok_for_ldd_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))"
- "ldd %1,%0")
+ "ldd\\t%1, %0")
(define_peephole
[(set (match_operand:SF 0 "memory_operand" "")
(match_operand:SF 1 "register_operand" "fr"))
(set (match_operand:SF 2 "memory_operand" "")
(match_operand:SF 3 "register_operand" "fr"))]
- "registers_ok_for_ldd_peep (operands[1], operands[3])
- && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2])
- && addrs_ok_for_ldd_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
- "std %1,%0")
+ "registers_ok_for_ldd_peep (operands[1], operands[3])
+ && ! MEM_VOLATILE_P (operands[0])
+ && ! MEM_VOLATILE_P (operands[2])
+ && addrs_ok_for_ldd_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
+ "std\\t%1, %0")
(define_peephole
[(set (match_operand:SI 0 "register_operand" "=rf")
(match_operand:SI 1 "memory_operand" ""))
(set (match_operand:SI 2 "register_operand" "=rf")
(match_operand:SI 3 "memory_operand" ""))]
- "registers_ok_for_ldd_peep (operands[2], operands[0])
- && ! MEM_VOLATILE_P (operands[3]) && ! MEM_VOLATILE_P (operands[1])
- && addrs_ok_for_ldd_peep (XEXP (operands[3], 0), XEXP (operands[1], 0))"
- "ldd %3,%2")
+ "registers_ok_for_ldd_peep (operands[2], operands[0])
+ && ! MEM_VOLATILE_P (operands[3])
+ && ! MEM_VOLATILE_P (operands[1])
+ && addrs_ok_for_ldd_peep (XEXP (operands[3], 0), XEXP (operands[1], 0))"
+ "ldd\\t%3, %2")
(define_peephole
[(set (match_operand:SI 0 "memory_operand" "")
(match_operand:SI 1 "register_operand" "rf"))
(set (match_operand:SI 2 "memory_operand" "")
(match_operand:SI 3 "register_operand" "rf"))]
- "registers_ok_for_ldd_peep (operands[3], operands[1])
- && ! MEM_VOLATILE_P (operands[2]) && ! MEM_VOLATILE_P (operands[0])
- && addrs_ok_for_ldd_peep (XEXP (operands[2], 0), XEXP (operands[0], 0))"
- "std %3,%2")
+ "registers_ok_for_ldd_peep (operands[3], operands[1])
+ && ! MEM_VOLATILE_P (operands[2])
+ && ! MEM_VOLATILE_P (operands[0])
+ && addrs_ok_for_ldd_peep (XEXP (operands[2], 0), XEXP (operands[0], 0))"
+ "std\\t%3, %2")
(define_peephole
[(set (match_operand:SF 0 "register_operand" "=fr")
(match_operand:SF 1 "memory_operand" ""))
(set (match_operand:SF 2 "register_operand" "=fr")
(match_operand:SF 3 "memory_operand" ""))]
- "registers_ok_for_ldd_peep (operands[2], operands[0])
- && ! MEM_VOLATILE_P (operands[3]) && ! MEM_VOLATILE_P (operands[1])
- && addrs_ok_for_ldd_peep (XEXP (operands[3], 0), XEXP (operands[1], 0))"
- "ldd %3,%2")
+ "registers_ok_for_ldd_peep (operands[2], operands[0])
+ && ! MEM_VOLATILE_P (operands[3])
+ && ! MEM_VOLATILE_P (operands[1])
+ && addrs_ok_for_ldd_peep (XEXP (operands[3], 0), XEXP (operands[1], 0))"
+ "ldd\\t%3, %2")
(define_peephole
[(set (match_operand:SF 0 "memory_operand" "")
(match_operand:SF 1 "register_operand" "fr"))
(set (match_operand:SF 2 "memory_operand" "")
(match_operand:SF 3 "register_operand" "fr"))]
- "registers_ok_for_ldd_peep (operands[3], operands[1])
- && ! MEM_VOLATILE_P (operands[2]) && ! MEM_VOLATILE_P (operands[0])
- && addrs_ok_for_ldd_peep (XEXP (operands[2], 0), XEXP (operands[0], 0))"
- "std %3,%2")
+ "registers_ok_for_ldd_peep (operands[3], operands[1])
+ && ! MEM_VOLATILE_P (operands[2])
+ && ! MEM_VOLATILE_P (operands[0])
+ && addrs_ok_for_ldd_peep (XEXP (operands[2], 0), XEXP (operands[0], 0))"
+ "std\\t%3, %2")
;; Optimize the case of following a reg-reg move with a test
;; of reg just moved. Don't allow floating point regs for operand 0 or 1.
@@ -6449,8 +7947,9 @@ if (! TARGET_ARCH64)
(const_int 0)))]
"(rtx_equal_p (operands[2], operands[0])
|| rtx_equal_p (operands[2], operands[1]))
- && ! FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])"
- "orcc %1,0,%0")
+ && ! FP_REG_P (operands[0])
+ && ! FP_REG_P (operands[1])"
+ "orcc\\t%1, 0, %0")
(define_peephole
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -6461,37 +7960,9 @@ if (! TARGET_ARCH64)
"TARGET_ARCH64
&& (rtx_equal_p (operands[2], operands[0])
|| rtx_equal_p (operands[2], operands[1]))
- && ! FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])"
- "orcc %1,0,%0")
-
-;; Floating-point move peepholes
-;; ??? v9: Do we want similar ones?
-
-(define_peephole
- [(set (match_operand:SI 0 "register_operand" "=r")
- (lo_sum:SI (match_dup 0)
- (match_operand:SI 1 "immediate_operand" "i")))
- (set (match_operand:DF 2 "register_operand" "=er")
- (mem:DF (match_dup 0)))]
- "RTX_UNCHANGING_P (operands[1]) && reg_unused_after (operands[0], insn)"
- "*
-{
- /* Go by way of output_move_double in case the register in operand 2
- is not properly aligned for ldd. */
- operands[1] = gen_rtx (MEM, DFmode,
- gen_rtx (LO_SUM, SImode, operands[0], operands[1]));
- operands[0] = operands[2];
- return output_move_double (operands);
-}")
-
-(define_peephole
- [(set (match_operand:SI 0 "register_operand" "=r")
- (lo_sum:SI (match_dup 0)
- (match_operand:SI 1 "immediate_operand" "i")))
- (set (match_operand:SF 2 "register_operand" "=fr")
- (mem:SF (match_dup 0)))]
- "RTX_UNCHANGING_P (operands[1]) && reg_unused_after (operands[0], insn)"
- "ld [%0+%%lo(%a1)],%2")
+ && ! FP_REG_P (operands[0])
+ && ! FP_REG_P (operands[1])"
+ "orcc\\t%1, 0, %0")
;; Return peepholes. First the "normal" ones.
;; These are necessary to catch insns ending up in the epilogue delay list.
@@ -6504,12 +7975,12 @@ if (! TARGET_ARCH64)
"*
{
if (! TARGET_ARCH64 && current_function_returns_struct)
- return \"jmp %%i7+12\;restore %%g0,%1,%Y0\";
+ return \"jmp\\t%%i7+12\\n\\trestore %%g0, %1, %Y0\";
else if (TARGET_V9 && (GET_CODE (operands[1]) == CONST_INT
|| IN_OR_GLOBAL_P (operands[1])))
- return \"return %%i7+8\;mov %Y1,%Y0\";
+ return \"return\\t%%i7+8\\n\\tmov\\t%Y1, %Y0\";
else
- return \"ret\;restore %%g0,%1,%Y0\";
+ return \"ret\\n\\trestore %%g0, %1, %Y0\";
}"
[(set_attr "type" "multi")])
@@ -6521,12 +7992,12 @@ if (! TARGET_ARCH64)
"*
{
if (! TARGET_ARCH64 && current_function_returns_struct)
- return \"jmp %%i7+12\;restore %%g0,%1,%Y0\";
+ return \"jmp\\t%%i7+12\\n\\trestore %%g0, %1, %Y0\";
else if (TARGET_V9 && (GET_CODE (operands[1]) == CONST_INT
|| IN_OR_GLOBAL_P (operands[1])))
- return \"return %%i7+8\;mov %Y1,%Y0\";
+ return \"return\\t%%i7+8\\n\\tmov\\t%Y1, %Y0\";
else
- return \"ret\;restore %%g0,%1,%Y0\";
+ return \"ret\;restore %%g0, %1, %Y0\";
}"
[(set_attr "type" "multi")])
@@ -6538,31 +8009,32 @@ if (! TARGET_ARCH64)
"*
{
if (! TARGET_ARCH64 && current_function_returns_struct)
- return \"jmp %%i7+12\;restore %%g0,%1,%Y0\";
+ return \"jmp\\t%%i7+12\\n\\trestore %%g0, %1, %Y0\";
else if (TARGET_V9 && (GET_CODE (operands[1]) == CONST_INT
|| IN_OR_GLOBAL_P (operands[1])))
- return \"return %%i7+8\;mov %Y1,%Y0\";
+ return \"return\\t%%i7+8\\n\\tmov\\t%Y1, %Y0\";
else
- return \"ret\;restore %%g0,%1,%Y0\";
+ return \"ret\;restore %%g0, %1, %Y0\";
}"
[(set_attr "type" "multi")])
;; The following pattern is only generated by delayed-branch scheduling,
-;; when the insn winds up in the epilogue. This can only happen when
-;; ! TARGET_FPU because otherwise fp return values are in %f0.
+;; when the insn winds up in the epilogue. This can happen not only when
+;; ! TARGET_FPU because we move complex types around by parts using
+;; SF mode SUBREGs.
(define_insn "*return_sf_no_fpu"
[(set (match_operand:SF 0 "restore_operand" "r")
(match_operand:SF 1 "register_operand" "r"))
(return)]
- "! TARGET_FPU && ! TARGET_EPILOGUE && ! TARGET_LIVE_G0"
+ "! TARGET_EPILOGUE && ! TARGET_LIVE_G0"
"*
{
if (! TARGET_ARCH64 && current_function_returns_struct)
- return \"jmp %%i7+12\;restore %%g0,%1,%Y0\";
+ return \"jmp\\t%%i7+12\\n\\trestore %%g0, %1, %Y0\";
else if (TARGET_V9 && IN_OR_GLOBAL_P (operands[1]))
- return \"return %%i7+8\;mov %Y1,%Y0\";
+ return \"return\\t%%i7+8\\n\\tmov\\t%Y1, %Y0\";
else
- return \"ret\;restore %%g0,%1,%Y0\";
+ return \"ret\;restore %%g0, %1, %Y0\";
}"
[(set_attr "type" "multi")])
@@ -6575,14 +8047,14 @@ if (! TARGET_ARCH64)
"*
{
if (! TARGET_ARCH64 && current_function_returns_struct)
- return \"jmp %%i7+12\;restore %r1,%2,%Y0\";
+ return \"jmp\\t%%i7+12\\n\\trestore %r1, %2, %Y0\";
/* If operands are global or in registers, can use return */
else if (TARGET_V9 && IN_OR_GLOBAL_P (operands[1])
&& (GET_CODE (operands[2]) == CONST_INT
|| IN_OR_GLOBAL_P (operands[2])))
- return \"return %%i7+8\;add %Y1,%Y2,%Y0\";
+ return \"return\\t%%i7+8\\n\\tadd\\t%Y1, %Y2, %Y0\";
else
- return \"ret\;restore %r1,%2,%Y0\";
+ return \"ret\;restore %r1, %2, %Y0\";
}"
[(set_attr "type" "multi")])
@@ -6591,7 +8063,7 @@ if (! TARGET_ARCH64)
(match_operand:DI 1 "arith_double_operand" "rHI"))
(return)]
"TARGET_ARCH64 && ! TARGET_EPILOGUE"
- "ret\;restore %%g0,%1,%Y0"
+ "ret\;restore %%g0, %1, %Y0"
[(set_attr "type" "multi")])
(define_insn "*return_adddi"
@@ -6600,7 +8072,7 @@ if (! TARGET_ARCH64)
(match_operand:DI 2 "arith_double_operand" "rHI")))
(return)]
"TARGET_ARCH64 && ! TARGET_EPILOGUE"
- "ret\;restore %r1,%2,%Y0"
+ "ret\;restore %r1, %2, %Y0"
[(set_attr "type" "multi")])
;; The following pattern is only generated by delayed-branch scheduling,
@@ -6610,7 +8082,7 @@ if (! TARGET_ARCH64)
(match_operand:SF 0 "register_operand" "f"))
(return)]
"! TARGET_EPILOGUE"
- "ret\;fmovs %0,%%f0"
+ "ret\;fmovs\\t%0, %%f0"
[(set_attr "type" "multi")])
;; Now peepholes to do a call followed by a jump.
@@ -6621,16 +8093,20 @@ if (! TARGET_ARCH64)
(match_operand 2 "" "")))
(clobber (reg:SI 15))])
(set (pc) (label_ref (match_operand 3 "" "")))]
- "short_branch (INSN_UID (insn), INSN_UID (operands[3])) && in_same_eh_region (insn, operands[3]) && in_same_eh_region (insn, ins1)"
- "call %a1,%2\;add %%o7,(%l3-.-4),%%o7")
+ "short_branch (INSN_UID (insn), INSN_UID (operands[3]))
+ && in_same_eh_region (insn, operands[3])
+ && in_same_eh_region (insn, ins1)"
+ "call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
(define_peephole
[(parallel [(call (mem:SI (match_operand:SI 0 "call_operand_address" "ps"))
(match_operand 1 "" ""))
(clobber (reg:SI 15))])
(set (pc) (label_ref (match_operand 2 "" "")))]
- "short_branch (INSN_UID (insn), INSN_UID (operands[2])) && in_same_eh_region (insn, operands[2]) && in_same_eh_region (insn, ins1)"
- "call %a0,%1\;add %%o7,(%l2-.-4),%%o7")
+ "short_branch (INSN_UID (insn), INSN_UID (operands[2]))
+ && in_same_eh_region (insn, operands[2])
+ && in_same_eh_region (insn, ins1)"
+ "call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
(define_peephole
[(parallel [(set (match_operand 0 "" "")
@@ -6638,34 +8114,62 @@ if (! TARGET_ARCH64)
(match_operand 2 "" "")))
(clobber (reg:DI 15))])
(set (pc) (label_ref (match_operand 3 "" "")))]
- "TARGET_ARCH64 && short_branch (INSN_UID (insn), INSN_UID (operands[3])) && in_same_eh_region (insn, operands[3]) && in_same_eh_region (insn, ins1)"
- "call %a1,%2\;add %%o7,(%l3-.-4),%%o7")
+ "TARGET_ARCH64
+ && short_branch (INSN_UID (insn), INSN_UID (operands[3]))
+ && in_same_eh_region (insn, operands[3])
+ && in_same_eh_region (insn, ins1)"
+ "call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
(define_peephole
[(parallel [(call (mem:SI (match_operand:DI 0 "call_operand_address" "ps"))
(match_operand 1 "" ""))
(clobber (reg:DI 15))])
(set (pc) (label_ref (match_operand 2 "" "")))]
- "TARGET_ARCH64 && short_branch (INSN_UID (insn), INSN_UID (operands[2])) && in_same_eh_region (insn, operands[2]) && in_same_eh_region (insn, ins1)"
- "call %a0,%1\;add %%o7,(%l2-.-4),%%o7")
-
-;; Other miscellaneous peepholes.
-
-;; (reg:SI 100) is created by the {add,neg,sub}di patterns.
-(define_peephole
- [(parallel [(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
- (reg:SI 100)))
- (clobber (reg:CC 100))])
- (set (reg:CC 100) (compare (match_dup 0) (const_int 0)))]
- ""
- "subxcc %r1,0,%0")
+ "TARGET_ARCH64
+ && short_branch (INSN_UID (insn), INSN_UID (operands[2]))
+ && in_same_eh_region (insn, operands[2])
+ && in_same_eh_region (insn, ins1)"
+ "call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
;; After a nonlocal goto, we need to restore the PIC register, but only
;; if we need it. So do nothing much here, but we'll check for this in
;; finalize_pic.
+;; Make sure this unspec_volatile number agrees with finalize_pic.
(define_insn "nonlocal_goto_receiver"
- [(unspec_volatile [(const_int 0)] 4)]
+ [(unspec_volatile [(const_int 0)] 5)]
"flag_pic"
"")
+
+(define_insn "trap"
+ [(trap_if (const_int 1) (const_int 5))]
+ ""
+ "ta\\t5"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
+(define_expand "conditional_trap"
+ [(trap_if (match_operator 0 "noov_compare_op"
+ [(match_dup 2) (match_dup 3)])
+ (match_operand:SI 1 "arith_operand" ""))]
+ ""
+ "operands[2] = gen_compare_reg (GET_CODE (operands[0]),
+ sparc_compare_op0, sparc_compare_op1);
+ operands[3] = const0_rtx;")
+
+(define_insn ""
+ [(trap_if (match_operator 0 "noov_compare_op" [(reg:CC 100) (const_int 0)])
+ (match_operand:SI 1 "arith_operand" "rM"))]
+ ""
+ "t%C0\\t%1"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
+(define_insn ""
+ [(trap_if (match_operator 0 "noov_compare_op" [(reg:CCX 100) (const_int 0)])
+ (match_operand:SI 1 "arith_operand" "rM"))]
+ "TARGET_V9"
+ "t%C0\\t%%xcc, %1"
+ [(set_attr "type" "misc")
+ (set_attr "length" "1")])
+
diff --git a/gcc/config/sparc/sun4o3.h b/gcc/config/sparc/sun4o3.h
index 68ddc632794..10c73916b60 100644
--- a/gcc/config/sparc/sun4o3.h
+++ b/gcc/config/sparc/sun4o3.h
@@ -8,3 +8,22 @@
/* LINK_SPEC is needed only for SunOS 4. */
#undef LINK_SPEC
+
+/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
+ traps available which can get and set the condition codes
+ reliably. */
+#undef MACHINE_STATE_SAVE
+#define MACHINE_STATE_SAVE(ID) \
+ unsigned long int ms_flags, ms_saveret; \
+ asm volatile("ta 0x20\n\t" \
+ "mov %%g1, %0\n\t" \
+ "mov %%g2, %1\n\t" \
+ : "=r" (ms_flags), "=r" (ms_saveret));
+
+#undef MACHINE_STATE_RESTORE
+#define MACHINE_STATE_RESTORE(ID) \
+ asm volatile("mov %0, %%g1\n\t" \
+ "mov %1, %%g2\n\t" \
+ "ta 0x21\n\t" \
+ : /* no outputs */ \
+ : "r" (ms_flags), "r" (ms_saveret));
diff --git a/gcc/config/sparc/sunos4.h b/gcc/config/sparc/sunos4.h
index 070f41aa3b5..14c7a437d67 100644
--- a/gcc/config/sparc/sunos4.h
+++ b/gcc/config/sparc/sunos4.h
@@ -28,3 +28,22 @@ Boston, MA 02111-1307, USA. */
/* The Sun as doesn't like unaligned data. */
#define DWARF2_UNWIND_INFO 0
+
+/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
+ traps available which can get and set the condition codes
+ reliably. */
+#undef MACHINE_STATE_SAVE
+#define MACHINE_STATE_SAVE(ID) \
+ unsigned long int ms_flags, ms_saveret; \
+ asm volatile("ta 0x20\n\t" \
+ "mov %%g1, %0\n\t" \
+ "mov %%g2, %1\n\t" \
+ : "=r" (ms_flags), "=r" (ms_saveret));
+
+#undef MACHINE_STATE_RESTORE
+#define MACHINE_STATE_RESTORE(ID) \
+ asm volatile("mov %0, %%g1\n\t" \
+ "mov %1, %%g2\n\t" \
+ "ta 0x21\n\t" \
+ : /* no outputs */ \
+ : "r" (ms_flags), "r" (ms_saveret));
diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h
index 7e90bdd4036..572b9dcde73 100644
--- a/gcc/config/sparc/sysv4.h
+++ b/gcc/config/sparc/sysv4.h
@@ -66,7 +66,9 @@ Boston, MA 02111-1307, USA. */
/* The native assembler can't compute differences between symbols in different
sections when generating pic code, so we must put jump tables in the
text section. */
-#define JUMP_TABLES_IN_TEXT_SECTION 1
+/* But we now defer the tables to the end of the function, so we make
+ this 0 to not confuse the branch shortening code. */
+#define JUMP_TABLES_IN_TEXT_SECTION 0
/* Pass -K to the assembler when PIC. */
#undef ASM_SPEC
@@ -191,8 +193,8 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
do { \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
- fprintf (FILE, ".section\t\"%s%s\",#alloc,#execinstr\n", \
- flag_function_sections ? ".text%" : "", (NAME)); \
+ fprintf (FILE, ".section\t\"%s\",#alloc,#execinstr\n", \
+ (NAME)); \
else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
fprintf (FILE, ".section\t\"%s\",#alloc\n", (NAME)); \
else \
diff --git a/gcc/config/sparc/t-sol2 b/gcc/config/sparc/t-sol2
index d41254adb44..a9b6ee14793 100644
--- a/gcc/config/sparc/t-sol2
+++ b/gcc/config/sparc/t-sol2
@@ -6,19 +6,19 @@ CROSS_LIBGCC1 =
LIBGCC1_TEST =
# gmon build rule:
-gmon.o: $(srcdir)/config/sparc/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) stmp-int-hdrs
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/config/sparc/gmon-sol2.c -o gmon.o
+$(T)gmon.o: $(srcdir)/config/sparc/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) stmp-int-hdrs
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
+ -c $(srcdir)/config/sparc/gmon-sol2.c -o $(T)gmon.o
# Assemble startup files.
-crt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crt1.o -x assembler $(srcdir)/config/sparc/sol2-c1.asm
-crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crti.o -x assembler $(srcdir)/config/sparc/sol2-ci.asm
-crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crtn.o -x assembler $(srcdir)/config/sparc/sol2-cn.asm
-gcrt1.o: $(srcdir)/config/sparc/sol2-g1.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o gcrt1.o -x assembler $(srcdir)/config/sparc/sol2-g1.asm
+$(T)crt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-c1.asm
+$(T)crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm
+$(T)crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm
+$(T)gcrt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -DGCRT1 -o $(T)gcrt1.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-c1.asm
# We need to use -fPIC when we are using gcc to compile the routines in
# crtstuff.c. This is only really needed when we are going to use gcc/g++
diff --git a/gcc/config/sparc/xm-netbsd.h b/gcc/config/sparc/xm-netbsd.h
deleted file mode 100644
index 5f11b8d2f48..00000000000
--- a/gcc/config/sparc/xm-netbsd.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Sun SPARC running NetBSD as host. */
-
-#include <sparc/xm-sparc.h>
-#include <xm-netbsd.h>
diff --git a/gcc/config/sparc/xm-sp64.h b/gcc/config/sparc/xm-sp64.h
index 5954affa3b5..b673161282f 100644
--- a/gcc/config/sparc/xm-sp64.h
+++ b/gcc/config/sparc/xm-sp64.h
@@ -21,5 +21,7 @@ Boston, MA 02111-1307, USA. */
#include <sparc/xm-sparc.h>
/* This describes the machine the compiler is hosted on. */
+#if defined(__arch64__) || defined(__sparc_v9__) || defined(__sparcv9)
#undef HOST_BITS_PER_LONG
#define HOST_BITS_PER_LONG 64
+#endif
diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h
index 104b1bbd668..ef7a1d9df84 100644
--- a/gcc/config/svr4.h
+++ b/gcc/config/svr4.h
@@ -414,7 +414,7 @@ do { \
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
do { \
- sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
+ sprintf (LABEL, "*.%s%d", PREFIX, (unsigned) (NUM)); \
} while (0)
/* Output the label which precedes a jumptable. Note that for all svr4
@@ -655,7 +655,15 @@ do { \
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
\
if (! DECL_ONE_ONLY (DECL)) \
- prefix = "."; \
+ { \
+ prefix = "."; \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".text."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".rodata."; \
+ else \
+ prefix = ".data."; \
+ } \
else if (TREE_CODE (DECL) == FUNCTION_DECL) \
prefix = ".gnu.linkonce.t."; \
else if (DECL_READONLY_SECTION (DECL, RELOC)) \
@@ -669,7 +677,6 @@ do { \
\
DECL_SECTION_NAME (DECL) = build_string (len, string); \
} while (0)
-
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
diff --git a/gcc/config/t-netbsd b/gcc/config/t-netbsd
index a3d9e22eaf0..85d6057feb0 100644
--- a/gcc/config/t-netbsd
+++ b/gcc/config/t-netbsd
@@ -1,5 +1,6 @@
LIBGCC1=libgcc1.null
CROSS_LIBGCC1=libgcc1.null
+LIBGCC1_TEST=
# Don't run fixproto
STMP_FIXPROTO =
diff --git a/gcc/config/v850/lib1funcs.asm b/gcc/config/v850/lib1funcs.asm
index 100d901d136..2787e97519a 100644
--- a/gcc/config/v850/lib1funcs.asm
+++ b/gcc/config/v850/lib1funcs.asm
@@ -89,10 +89,11 @@ ___mulsi3:
ble .L5
jmp [r31] /* return */
- .size __mulsi3,.-__mulsi3
+ .size ___mulsi3,.-___mulsi3
#endif
#ifdef L_udivsi3
+ .text
.global ___udivsi3
___udivsi3:
mov 1,r12
@@ -126,7 +127,7 @@ ___udivsi3:
bne .L9
.L8:
jmp [r31]
- .size __udivsi3,.-__udivsi3
+ .size ___udivsi3,.-___udivsi3
#endif
#ifdef L_divsi3
@@ -157,7 +158,7 @@ ___divsi3:
ld.w 4[sp],r31
add 8,sp
jmp [r31]
- .size __divsi3,.-__divsi3
+ .size ___divsi3,.-___divsi3
#endif
#ifdef L_umodsi3
@@ -178,7 +179,7 @@ ___umodsi3:
ld.w 8[sp],r31
add 12,sp
jmp [r31]
- .size __umodsi3,.-__umodsi3
+ .size ___umodsi3,.-___umodsi3
#endif /* L_umodsi3 */
#ifdef L_modsi3
@@ -199,7 +200,7 @@ ___modsi3:
ld.w 8[sp],r31
add 12,sp
jmp [r31]
- .size __modsi3,.-__modsi3
+ .size ___modsi3,.-___modsi3
#endif /* L_modsi3 */
#ifdef L_save_2
@@ -1181,7 +1182,7 @@ __return_interrupt:
ld.w 4[sp],gp
ld.w 8[sp],r1
ld.w 12[sp],r10
- add 16,sp
+ addi 16,sp,sp
reti
.size __return_interrupt,.-__return_interrupt
#endif /* L_save_interrupt */
diff --git a/gcc/config/v850/t-v850 b/gcc/config/v850/t-v850
index d1d9b16f1b6..12af46b5037 100644
--- a/gcc/config/v850/t-v850
+++ b/gcc/config/v850/t-v850
@@ -50,3 +50,5 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
echo '#endif' >> fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+TCFLAGS = -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 0962c779145..8d9981c810c 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -1,5 +1,5 @@
/* Subroutines for insn-output.c for NEC V850 series
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GNU CC.
@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <ctype.h>
#include "config.h"
+#include "tree.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -34,8 +35,64 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "recog.h"
#include "expr.h"
-#include "tree.h"
#include "obstack.h"
+#include "toplev.h"
+
+#ifndef streq
+#define streq(a,b) (strcmp (a, b) == 0)
+#endif
+
+/* Function prototypes that cannot exist in v850.h due to dependency
+ compilcations. */
+extern rtx function_arg
+ PROTO ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
+extern int function_arg_partial_nregs
+ PROTO ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
+extern void asm_file_start PROTO ((FILE *));
+extern void print_operand PROTO ((FILE *, rtx, int ));
+extern void print_operand_address PROTO ((FILE *, rtx));
+extern void v850_output_aligned_bss
+ PROTO ((FILE *, tree, char *, int, int));
+extern void v850_output_common
+ PROTO ((FILE *, tree, char *, int, int));
+extern void v850_output_local
+ PROTO ((FILE *, tree, char *, int, int));
+extern int const_costs PROTO ((rtx, enum rtx_code));
+extern char * output_move_double PROTO ((rtx *));
+extern char * output_move_single PROTO ((rtx *));
+extern int ep_memory_operand
+ PROTO ((rtx, enum machine_mode, int));
+extern int reg_or_0_operand PROTO ((rtx, enum machine_mode));
+extern int reg_or_int5_operand PROTO ((rtx, enum machine_mode));
+extern int call_address_operand PROTO ((rtx, enum machine_mode));
+extern int movsi_source_operand PROTO ((rtx, enum machine_mode));
+extern int power_of_two_operand PROTO ((rtx, enum machine_mode));
+extern int not_power_of_two_operand PROTO ((rtx, enum machine_mode));
+extern int special_symbolref_operand PROTO ((rtx, enum machine_mode));
+extern void v850_reorg PROTO ((rtx));
+extern void notice_update_cc PROTO ((rtx, rtx));
+extern int v850_valid_machine_decl_attribute
+ PROTO ((tree, tree, tree));
+extern int v850_interrupt_function_p PROTO ((tree));
+extern int pattern_is_ok_for_prologue PROTO ((rtx, enum machine_mode));
+extern int pattern_is_ok_for_epilogue PROTO ((rtx, enum machine_mode));
+extern int register_is_ok_for_epilogue PROTO ((rtx, enum machine_mode));
+extern char * construct_save_jarl PROTO ((rtx));
+extern char * construct_restore_jr PROTO ((rtx));
+extern void v850_encode_data_area PROTO ((tree));
+extern void v850_set_default_decl_attr PROTO ((tree));
+
+/* Function prototypes for stupid compilers: */
+static void const_double_split
+ PROTO ((rtx, HOST_WIDE_INT *, HOST_WIDE_INT *));
+static int const_costs_int PROTO ((HOST_WIDE_INT, int));
+static void substitute_ep_register PROTO ((rtx, rtx, int, int, rtx *, rtx *));
+static int push_data_area PROTO ((v850_data_area));
+static int pop_data_area PROTO ((v850_data_area));
+static int parse_ghs_pragma_token PROTO ((char *));
+static int ep_memory_offset PROTO ((enum machine_mode, int));
+static int mark_current_function_as_interrupt PROTO ((void));
+static void v850_set_data_area PROTO ((tree, v850_data_area));
/* True if the current function has anonymous arguments. */
int current_function_anonymous_args;
@@ -70,7 +127,7 @@ void
override_options ()
{
int i;
- extern int atoi ();
+ extern int atoi PROTO ((const char *));
/* Parse -m{s,t,z}da=nnn switches */
for (i = 0; i < (int)SMALL_MEMORY_max; i++)
@@ -235,6 +292,9 @@ const_double_split (x, p_high, p_low)
*p_high = CONST_DOUBLE_HIGH (x);
*p_low = CONST_DOUBLE_LOW (x);
return;
+
+ default:
+ break;
}
}
@@ -437,13 +497,16 @@ print_operand (file, x, code)
case 'R': /* 2nd word of a double. */
switch (GET_CODE (x))
{
- case REG:
- fprintf (file, reg_names[REGNO (x) + 1]);
- break;
- case MEM:
- print_operand_address (file,
- XEXP (adj_offsettable_operand (x, 4), 0));
- break;
+ case REG:
+ fprintf (file, reg_names[REGNO (x) + 1]);
+ break;
+ case MEM:
+ print_operand_address (file,
+ XEXP (adj_offsettable_operand (x, 4), 0));
+ break;
+
+ default:
+ break;
}
break;
case 'S':
@@ -724,7 +787,8 @@ output_move_single (operands)
}
-/* Return appropriate code to load up an 8 byte integer or floating point value */
+/* Return appropriate code to load up an 8 byte integer or
+ floating point value */
char *
output_move_double (operands)
@@ -805,10 +869,10 @@ output_move_double (operands)
/* Return maximum offset supported for a short EP memory reference of mode
MODE and signedness UNSIGNEDP. */
-int
+static int
ep_memory_offset (mode, unsignedp)
enum machine_mode mode;
- int unsignedp;
+ int ATTRIBUTE_UNUSED unsignedp;
{
int max_offset = 0;
@@ -826,6 +890,9 @@ ep_memory_offset (mode, unsignedp)
case SFmode:
max_offset = (1 << 8);
break;
+
+ default:
+ break;
}
return max_offset;
@@ -920,7 +987,7 @@ reg_or_int5_operand (op, mode)
int
call_address_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode ATTRIBUTE_UNUSED mode;
{
/* Only registers are valid call operands if TARGET_LONG_CALLS. */
if (TARGET_LONG_CALLS)
@@ -931,7 +998,7 @@ call_address_operand (op, mode)
int
special_symbolref_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode ATTRIBUTE_UNUSED mode;
{
if (GET_CODE (op) == SYMBOL_REF)
return ENCODED_NAME_P (XSTR (op, 0));
@@ -955,6 +1022,7 @@ movsi_source_operand (op, mode)
must be done with HIGH & LO_SUM patterns. */
if (CONSTANT_P (op)
&& GET_CODE (op) != HIGH
+ && GET_CODE (op) != CONSTANT_P_RTX
&& !(GET_CODE (op) == CONST_INT
&& (CONST_OK_FOR_J (INTVAL (op))
|| CONST_OK_FOR_K (INTVAL (op))
@@ -967,7 +1035,7 @@ movsi_source_operand (op, mode)
int
power_of_two_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode ATTRIBUTE_UNUSED mode;
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -1016,7 +1084,6 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep)
{
rtx reg = gen_rtx (REG, Pmode, regno);
rtx insn;
- int i;
if (!*p_r1)
{
@@ -1026,7 +1093,8 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep)
}
if (TARGET_DEBUG)
- fprintf (stderr, "Saved %d bytes (%d uses of register %s) in function %s, starting as insn %d, ending at %d\n",
+ fprintf (stderr, "\
+Saved %d bytes (%d uses of register %s) in function %s, starting as insn %d, ending at %d\n",
2 * (uses - 3), uses, reg_names[regno],
IDENTIFIER_POINTER (DECL_NAME (current_function_decl)),
INSN_UID (first_insn), INSN_UID (last_insn));
@@ -1072,7 +1140,7 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep)
&& GET_CODE (XEXP (addr, 0)) == REG
&& REGNO (XEXP (addr, 0)) == regno
&& GET_CODE (XEXP (addr, 1)) == CONST_INT
- && (((unsigned)INTVAL (XEXP (addr, 1)))
+ && ((INTVAL (XEXP (addr, 1)))
< ep_memory_offset (GET_MODE (*p_mem),
unsignedp)))
*p_mem = change_address (*p_mem, VOIDmode,
@@ -1109,11 +1177,13 @@ substitute_ep_register (first_insn, last_insn, uses, regno, p_r1, p_ep)
void v850_reorg (start_insn)
rtx start_insn;
{
- struct {
+ struct
+ {
int uses;
rtx first_insn;
rtx last_insn;
- } regs[FIRST_PSEUDO_REGISTER];
+ }
+ regs[FIRST_PSEUDO_REGISTER];
int i;
int use_ep = FALSE;
@@ -1214,7 +1284,7 @@ void v850_reorg (start_insn)
else if (GET_CODE (addr) == PLUS
&& GET_CODE (XEXP (addr, 0)) == REG
&& GET_CODE (XEXP (addr, 1)) == CONST_INT
- && (((unsigned)INTVAL (XEXP (addr, 1)))
+ && ((INTVAL (XEXP (addr, 1)))
< ep_memory_offset (GET_MODE (mem), unsignedp)))
{
short_p = TRUE;
@@ -1273,7 +1343,8 @@ void v850_reorg (start_insn)
{
substitute_ep_register (regs[max_regno].first_insn,
regs[max_regno].last_insn,
- max_uses, max_regno, &r1, &ep);
+ max_uses, max_regno, &r1,
+ &ep);
/* Since we made a substitution, zap all remembered
registers. */
@@ -1396,8 +1467,8 @@ expand_prologue ()
unsigned int init_stack_alloc = 0;
rtx save_regs[32];
rtx save_all;
- int num_save;
- int default_stack;
+ unsigned int num_save;
+ unsigned int default_stack;
int code;
int interrupt_handler = v850_interrupt_function_p (current_function_decl);
long reg_saved = 0;
@@ -1475,7 +1546,8 @@ expand_prologue ()
stack space is allocated. */
if (save_func_len < save_normal_len)
{
- save_all = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (num_save + (TARGET_V850 ? 2 : 1)));
+ save_all = gen_rtx (PARALLEL, VOIDmode,
+ rtvec_alloc (num_save + (TARGET_V850 ? 2 : 1)));
XVECEXP (save_all, 0, 0) = gen_rtx (SET, VOIDmode,
stack_pointer_rtx,
gen_rtx (PLUS, Pmode,
@@ -1507,7 +1579,8 @@ expand_prologue ()
actual_fsize -= alloc_stack;
if (TARGET_DEBUG)
- fprintf (stderr, "Saved %d bytes via prologue function (%d vs. %d) for function %s\n",
+ fprintf (stderr, "\
+Saved %d bytes via prologue function (%d vs. %d) for function %s\n",
save_normal_len - save_func_len,
save_normal_len, save_func_len,
IDENTIFIER_POINTER (DECL_NAME (current_function_decl)));
@@ -1517,8 +1590,8 @@ expand_prologue ()
}
}
- /* If no prolog save function is available, store the registers the old fashioned
- way (one by one). */
+ /* If no prolog save function is available, store the registers the old
+ fashioned way (one by one). */
if (!save_all)
{
/* Special case interrupt functions that save all registers for a call. */
@@ -1599,8 +1672,8 @@ expand_epilogue ()
unsigned int init_stack_free = 0;
rtx restore_regs[32];
rtx restore_all;
- int num_restore;
- int default_stack;
+ unsigned int num_restore;
+ unsigned int default_stack;
int code;
int interrupt_handler = v850_interrupt_function_p (current_function_decl);
@@ -1636,7 +1709,8 @@ expand_epilogue ()
/* See if we have an insn that restores the particular registers we
want to. */
restore_all = NULL_RTX;
- if (TARGET_PROLOG_FUNCTION && num_restore > 0 && actual_fsize >= default_stack
+ if (TARGET_PROLOG_FUNCTION && num_restore > 0
+ && actual_fsize >= default_stack
&& !interrupt_handler)
{
int alloc_stack = (4 * num_restore) + default_stack;
@@ -1674,7 +1748,8 @@ expand_epilogue ()
= gen_rtx (SET, VOIDmode,
restore_regs[i],
gen_rtx (MEM, Pmode,
- plus_constant (stack_pointer_rtx, offset)));
+ plus_constant
+ (stack_pointer_rtx, offset)));
offset -= 4;
}
@@ -1704,7 +1779,8 @@ expand_epilogue ()
INSN_CODE (insn) = code;
if (TARGET_DEBUG)
- fprintf (stderr, "Saved %d bytes via epilogue function (%d vs. %d) in function %s\n",
+ fprintf (stderr, "\
+Saved %d bytes via epilogue function (%d vs. %d) in function %s\n",
restore_normal_len - restore_func_len,
restore_normal_len, restore_func_len,
IDENTIFIER_POINTER (DECL_NAME (current_function_decl)));
@@ -1726,9 +1802,13 @@ expand_epilogue ()
/* Deallocate the rest of the stack if it is > 32K or if extra stack
was allocated for an interrupt handler that makes a call. */
- if (actual_fsize > init_stack_free || (interrupt_handler && actual_fsize))
+ if (actual_fsize > init_stack_free
+ || (interrupt_handler && actual_fsize))
{
- int diff = actual_fsize - ((interrupt_handler) ? 0 : init_stack_free);
+ int diff;
+
+ diff = actual_fsize - ((interrupt_handler) ? 0 : init_stack_free);
+
if (CONST_OK_FOR_K (diff))
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
@@ -1842,24 +1922,59 @@ notice_update_cc (body, insn)
break;
}
}
-
-/* Return nonzero if ATTR is a valid attribute for DECL.
- ATTRIBUTES are any existing attributes and ARGS are the arguments
- supplied with ATTR.
+/* Retrieve the data area that has been chosen for the given decl. */
- Supported attributes:
+v850_data_area
+v850_get_data_area (decl)
+ tree decl;
+{
+ if (lookup_attribute ("sda", DECL_MACHINE_ATTRIBUTES (decl)) != NULL_TREE)
+ return DATA_AREA_SDA;
+
+ if (lookup_attribute ("tda", DECL_MACHINE_ATTRIBUTES (decl)) != NULL_TREE)
+ return DATA_AREA_TDA;
+
+ if (lookup_attribute ("zda", DECL_MACHINE_ATTRIBUTES (decl)) != NULL_TREE)
+ return DATA_AREA_ZDA;
+
+ return DATA_AREA_NORMAL;
+}
- interrupt_handler or interrupt: output a prologue and epilogue suitable
- for an interrupt handler. */
+/* Store the indicated data area in the decl's attributes. */
+
+static void
+v850_set_data_area (decl, data_area)
+ tree decl;
+ v850_data_area data_area;
+{
+ tree name;
+
+ switch (data_area)
+ {
+ case DATA_AREA_SDA: name = get_identifier ("sda"); break;
+ case DATA_AREA_TDA: name = get_identifier ("tda"); break;
+ case DATA_AREA_ZDA: name = get_identifier ("zda"); break;
+ default:
+ return;
+ }
+
+ DECL_MACHINE_ATTRIBUTES (decl) = tree_cons
+ (name, NULL, DECL_MACHINE_ATTRIBUTES (decl));
+}
+
+/* Return nonzero if ATTR is a valid attribute for DECL.
+ ARGS are the arguments supplied with ATTR. */
int
-v850_valid_machine_decl_attribute (decl, attributes, attr, args)
+v850_valid_machine_decl_attribute (decl, attr, args)
tree decl;
- tree attributes;
tree attr;
tree args;
{
+ v850_data_area data_area;
+ v850_data_area area;
+
if (args != NULL_TREE)
return 0;
@@ -1867,6 +1982,37 @@ v850_valid_machine_decl_attribute (decl, attributes, attr, args)
|| is_attribute_p ("interrupt", attr))
return TREE_CODE (decl) == FUNCTION_DECL;
+ /* Implement data area attribute. */
+ if (is_attribute_p ("sda", attr))
+ data_area = DATA_AREA_SDA;
+ else if (is_attribute_p ("tda", attr))
+ data_area = DATA_AREA_TDA;
+ else if (is_attribute_p ("zda", attr))
+ data_area = DATA_AREA_ZDA;
+ else
+ return 0;
+
+ switch (TREE_CODE (decl))
+ {
+ case VAR_DECL:
+ if (current_function_decl != NULL_TREE)
+ error_with_decl (decl, "\
+a data area attribute cannot be specified for local variables");
+
+ /* Drop through. */
+
+ case FUNCTION_DECL:
+ area = v850_get_data_area (decl);
+ if (area != DATA_AREA_NORMAL && data_area != area)
+ error_with_decl (decl, "\
+data area of '%s' conflicts with previous declaration");
+
+ return 1;
+
+ default:
+ break;
+ }
+
return 0;
}
@@ -1906,18 +2052,67 @@ v850_interrupt_function_p (func)
}
-extern struct obstack *saveable_obstack;
+extern struct obstack * saveable_obstack;
+void
v850_encode_data_area (decl)
tree decl;
{
- char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
- int len = strlen (str);
- char *newstr;
+ char * str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ int len = strlen (str);
+ char * newstr;
+
+ /* Map explict sections into the appropriate attribute */
+ if (v850_get_data_area (decl) == DATA_AREA_NORMAL)
+ {
+ if (DECL_SECTION_NAME (decl))
+ {
+ char * name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+
+ if (streq (name, ".zdata") || streq (name, ".zbss"))
+ v850_set_data_area (decl, DATA_AREA_ZDA);
+
+ else if (streq (name, ".sdata") || streq (name, ".sbss"))
+ v850_set_data_area (decl, DATA_AREA_SDA);
+
+ else if (streq (name, ".tdata"))
+ v850_set_data_area (decl, DATA_AREA_TDA);
+ }
+
+ /* If no attribute, support -m{zda,sda,tda}=n */
+ else
+ {
+ int size = int_size_in_bytes (TREE_TYPE (decl));
+ if (size <= 0)
+ ;
+
+ else if (size <= small_memory [(int) SMALL_MEMORY_TDA].max)
+ v850_set_data_area (decl, DATA_AREA_TDA);
+
+ else if (size <= small_memory [(int) SMALL_MEMORY_SDA].max)
+ v850_set_data_area (decl, DATA_AREA_SDA);
+
+ else if (size <= small_memory [(int) SMALL_MEMORY_ZDA].max)
+ v850_set_data_area (decl, DATA_AREA_ZDA);
+ }
+
+ if (v850_get_data_area (decl) == DATA_AREA_NORMAL)
+ return;
+ }
+
+ newstr = obstack_alloc (saveable_obstack, len + 2);
- /* In the Cygnus sources we actually do something; this is just
- here to make merges easier. */
- return;
+ strcpy (newstr + 1, str);
+
+ switch (v850_get_data_area (decl))
+ {
+ case DATA_AREA_ZDA: *newstr = ZDA_NAME_FLAG_CHAR; break;
+ case DATA_AREA_TDA: *newstr = TDA_NAME_FLAG_CHAR; break;
+ case DATA_AREA_SDA: *newstr = SDA_NAME_FLAG_CHAR; break;
+ default: abort ();
+ }
+
+ XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
}
/* Return true if the given RTX is a register which can be restored
@@ -1925,7 +2120,7 @@ v850_encode_data_area (decl)
int
register_is_ok_for_epilogue (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode ATTRIBUTE_UNUSED mode;
{
/* The save/restore routines can only cope with registers 2, and 20 - 31 */
return (GET_CODE (op) == REG)
@@ -1938,7 +2133,7 @@ register_is_ok_for_epilogue (op, mode)
int
pattern_is_ok_for_epilogue (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode ATTRIBUTE_UNUSED mode;
{
int count = XVECLEN (op, 0);
int i;
@@ -2084,7 +2279,7 @@ construct_restore_jr (op)
/* Note, it is possible to have gaps in the register mask.
We ignore this here, and generate a JR anyway. We will
- be popping more registers thatn is strictly necessary, but
+ be popping more registers than is strictly necessary, but
it does save code space. */
if (first == last)
@@ -2101,7 +2296,7 @@ construct_restore_jr (op)
int
pattern_is_ok_for_prologue (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode ATTRIBUTE_UNUSED mode;
{
int count = XVECLEN (op, 0);
int i;
@@ -2270,7 +2465,7 @@ construct_save_jarl (op)
/* Note, it is possible to have gaps in the register mask.
We ignore this here, and generate a JARL anyway. We will
- be pushing more registers thatn is strictly necessary, but
+ be pushing more registers than is strictly necessary, but
it does save code space. */
if (first == last)
@@ -2282,3 +2477,577 @@ construct_save_jarl (op)
return buff;
}
+extern tree last_assemble_variable_decl;
+extern int size_directive_output;
+
+/* A version of asm_output_aligned_bss() that copes with the special
+ data areas of the v850. */
+void
+v850_output_aligned_bss (file, decl, name, size, align)
+ FILE * file;
+ tree decl;
+ char * name;
+ int size;
+ int align;
+{
+ ASM_GLOBALIZE_LABEL (file, name);
+
+ switch (v850_get_data_area (decl))
+ {
+ case DATA_AREA_ZDA:
+ zbss_section ();
+ break;
+
+ case DATA_AREA_SDA:
+ sbss_section ();
+ break;
+
+ case DATA_AREA_TDA:
+ tdata_section ();
+
+ default:
+ bss_section ();
+ break;
+ }
+
+ ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
+#ifdef ASM_DECLARE_OBJECT_NAME
+ last_assemble_variable_decl = decl;
+ ASM_DECLARE_OBJECT_NAME (file, name, decl);
+#else
+ /* Standard thing is just output label for the object. */
+ ASM_OUTPUT_LABEL (file, name);
+#endif /* ASM_DECLARE_OBJECT_NAME */
+ ASM_OUTPUT_SKIP (file, size ? size : 1);
+}
+
+/* Called via the macro ASM_OUTPUT_DECL_COMMON */
+void
+v850_output_common (file, decl, name, size, align)
+ FILE * file;
+ tree decl;
+ char * name;
+ int size;
+ int align;
+{
+ if (decl == NULL_TREE)
+ {
+ fprintf (file, "\t%s\t", COMMON_ASM_OP);
+ }
+ else
+ {
+ switch (v850_get_data_area (decl))
+ {
+ case DATA_AREA_ZDA:
+ fprintf (file, "\t%s\t", ZCOMMON_ASM_OP);
+ break;
+
+ case DATA_AREA_SDA:
+ fprintf (file, "\t%s\t", SCOMMON_ASM_OP);
+ break;
+
+ case DATA_AREA_TDA:
+ fprintf (file, "\t%s\t", TCOMMON_ASM_OP);
+ break;
+
+ default:
+ fprintf (file, "\t%s\t", COMMON_ASM_OP);
+ break;
+ }
+ }
+
+ assemble_name (file, name);
+ fprintf (file, ",%u,%u\n", size, align / BITS_PER_UNIT);
+}
+
+/* Called via the macro ASM_OUTPUT_DECL_LOCAL */
+void
+v850_output_local (file, decl, name, size, align)
+ FILE * file;
+ tree decl;
+ char * name;
+ int size;
+ int align;
+{
+ fprintf (file, "\t%s\t", LOCAL_ASM_OP);
+ assemble_name (file, name);
+ fprintf (file, "\n");
+
+ ASM_OUTPUT_ALIGNED_DECL_COMMON (file, decl, name, size, align);
+}
+
+/* The following code is for handling pragmas supported by the
+ v850 compiler produced by Green Hills Software. This is at
+ the specific request of a customer. */
+
+/* Track the current data area set by the data area pragma (which
+ can be nested). Tested by check_default_data_area. */
+
+typedef struct data_area_stack_element
+{
+ struct data_area_stack_element * prev;
+ v850_data_area data_area; /* current default data area. */
+} data_area_stack_element;
+
+static data_area_stack_element * data_area_stack = NULL;
+
+/* Names of the various data areas used on the v850. */
+static tree GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS];
+static tree GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS];
+
+/* Push a data area onto the stack. */
+static int
+push_data_area (data_area)
+ v850_data_area data_area;
+{
+ data_area_stack_element * elem;
+
+ elem = (data_area_stack_element *) xmalloc (sizeof (* elem));
+
+ if (elem == NULL)
+ return 0;
+
+ elem->prev = data_area_stack;
+ elem->data_area = data_area;
+
+ data_area_stack = elem;
+
+ return 1;
+}
+
+/* Remove a data area from the stack. */
+static int
+pop_data_area (data_area)
+ v850_data_area data_area;
+{
+ if (data_area_stack == NULL)
+ warning ("#pragma GHS endXXXX found without previous startXXX");
+ else if (data_area != data_area_stack->data_area)
+ warning ("#pragma GHS endXXX does not match previous startXXX");
+ else
+ {
+ data_area_stack_element * elem;
+
+ elem = data_area_stack;
+ data_area_stack = data_area_stack->prev;
+
+ free (elem);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Set the machine specific 'interrupt' attribute on the current function. */
+static int
+mark_current_function_as_interrupt ()
+{
+ tree name;
+
+ if (current_function_decl == NULL_TREE)
+ {
+ warning ("Cannot set interrupt attribute: no current function");
+ return 0;
+ }
+
+ name = get_identifier ("interrupt");
+
+ if (name == NULL_TREE || TREE_CODE (name) != IDENTIFIER_NODE)
+ {
+ warning ("Cannot set interrupt attribute: no such identifier");
+ return 0;
+ }
+
+ return valid_machine_attribute
+ (name, NULL_TREE, current_function_decl, NULL_TREE);
+}
+
+/* Parse STRING as part of a GHS pragma.
+ Returns 0 if the pragma has been parsed and there was a problem,
+ non-zero in all other cases. */
+static int
+parse_ghs_pragma_token (string)
+ char * string;
+{
+ static enum v850_pragma_state state = V850_PS_START;
+ static enum v850_pragma_type type = V850_PT_UNKNOWN;
+ static v850_data_area data_area = DATA_AREA_NORMAL;
+ static char * data_area_name;
+ static enum GHS_section_kind GHS_section_kind = GHS_SECTION_KIND_DEFAULT;
+
+ /* If the string is NULL then we have reached the end of the
+ #pragma construct. Make sure that we are in an end state, and
+ then implement the pragma's directive. */
+ if (string == NULL)
+ {
+ int ret_val = 1;
+
+ if (state != V850_PS_SHOULD_BE_DONE
+ && state != V850_PS_MAYBE_COMMA
+ && state != V850_PS_MAYBE_SECTION_NAME)
+ {
+ if (state != V850_PS_BAD)
+ warning ("Incomplete #pragma ghs");
+
+ ret_val = 0;
+ }
+ else switch (type)
+ {
+ case V850_PT_UNKNOWN:
+ warning ("Nothing follows #pragma ghs");
+ ret_val = 0;
+ break;
+
+ case V850_PT_INTERRUPT:
+ ret_val = mark_current_function_as_interrupt ();
+ break;
+
+ case V850_PT_SECTION:
+ /* If a section kind has not been specified, then reset
+ all section names back to their defaults. */
+ if (GHS_section_kind == GHS_SECTION_KIND_DEFAULT)
+ {
+ int i;
+
+ for (i = COUNT_OF_GHS_SECTION_KINDS; i--;)
+ GHS_current_section_names [i] = NULL;
+ }
+ /* If a section has been specified, then this will be handled
+ by check_default_section_name (). */
+ break;
+
+ case V850_PT_START_SECTION:
+ ret_val = push_data_area (data_area);
+ break;
+
+ case V850_PT_END_SECTION:
+ ret_val = pop_data_area (data_area);
+ break;
+ }
+
+ state = V850_PS_START;
+ type = V850_PT_UNKNOWN;
+
+ return ret_val;
+ }
+
+ switch (state)
+ {
+ case V850_PS_START:
+ data_area = DATA_AREA_NORMAL;
+ data_area_name = NULL;
+
+ if (streq (string, "interrupt"))
+ {
+ type = V850_PT_INTERRUPT;
+ state = V850_PS_SHOULD_BE_DONE;
+ }
+ else if (streq (string, "section"))
+ {
+ type = V850_PT_SECTION;
+ state = V850_PS_MAYBE_SECTION_NAME;
+ GHS_section_kind = GHS_SECTION_KIND_DEFAULT;
+ }
+ else if (streq (string, "starttda"))
+ {
+ type = V850_PT_START_SECTION;
+ state = V850_PS_SHOULD_BE_DONE;
+ data_area = DATA_AREA_TDA;
+ }
+ else if (streq (string, "endtda"))
+ {
+ type = V850_PT_END_SECTION;
+ state = V850_PS_SHOULD_BE_DONE;
+ data_area = DATA_AREA_TDA;
+ }
+ else if (streq (string, "startsda"))
+ {
+ type = V850_PT_START_SECTION;
+ state = V850_PS_SHOULD_BE_DONE;
+ data_area = DATA_AREA_SDA;
+ }
+ else if (streq (string, "endsda"))
+ {
+ type = V850_PT_END_SECTION;
+ state = V850_PS_SHOULD_BE_DONE;
+ data_area = DATA_AREA_SDA;
+ }
+ else if (streq (string, "startzda"))
+ {
+ type = V850_PT_START_SECTION;
+ state = V850_PS_SHOULD_BE_DONE;
+ data_area = DATA_AREA_ZDA;
+ }
+ else if (streq (string, "endzda"))
+ {
+ type = V850_PT_END_SECTION;
+ state = V850_PS_SHOULD_BE_DONE;
+ data_area = DATA_AREA_ZDA;
+ }
+ else
+ {
+ warning ("Unrecognised GHS pragma: '%s'\n", string);
+ state = V850_PS_BAD;
+ }
+ break;
+
+ case V850_PS_SHOULD_BE_DONE:
+ warning ("Extra text after valid #pragma: '%s'", string);
+ state = V850_PS_BAD;
+ break;
+
+ case V850_PS_BAD:
+ /* Ignore tokens in a pragma that has been diagnosed as being corrupt. */
+ break;
+
+ case V850_PS_MAYBE_SECTION_NAME:
+ state = V850_PS_EXPECTING_EQUALS;
+
+ if (streq (string, "data")) GHS_section_kind = GHS_SECTION_KIND_DATA;
+ else if (streq (string, "text")) GHS_section_kind = GHS_SECTION_KIND_TEXT;
+ else if (streq (string, "rodata")) GHS_section_kind = GHS_SECTION_KIND_RODATA;
+ else if (streq (string, "const")) GHS_section_kind = GHS_SECTION_KIND_RODATA;
+ else if (streq (string, "rosdata")) GHS_section_kind = GHS_SECTION_KIND_ROSDATA;
+ else if (streq (string, "rozdata")) GHS_section_kind = GHS_SECTION_KIND_ROZDATA;
+ else if (streq (string, "sdata")) GHS_section_kind = GHS_SECTION_KIND_SDATA;
+ else if (streq (string, "tdata")) GHS_section_kind = GHS_SECTION_KIND_TDATA;
+ else if (streq (string, "zdata")) GHS_section_kind = GHS_SECTION_KIND_ZDATA;
+ /* According to GHS beta documentation, the following should not be allowed! */
+ else if (streq (string, "bss")) GHS_section_kind = GHS_SECTION_KIND_BSS;
+ else if (streq (string, "zbss")) GHS_section_kind = GHS_SECTION_KIND_ZDATA;
+ else
+ {
+ warning ("Unrecognised section name '%s' in GHS section pragma",
+ string);
+ state = V850_PS_BAD;
+ }
+ break;
+
+ case V850_PS_EXPECTING_EQUALS:
+ if (streq (string, "="))
+ state = V850_PS_EXPECTING_SECTION_ALIAS;
+ else
+ {
+ warning ("Missing '=' in GHS section pragma");
+ state = V850_PS_BAD;
+ }
+ break;
+
+ case V850_PS_EXPECTING_SECTION_ALIAS:
+ if (streq (string, "default"))
+ GHS_current_section_names [GHS_section_kind] = NULL;
+ else
+ GHS_current_section_names [GHS_section_kind] =
+ build_string (strlen (string) + 1, string);
+
+ state = V850_PS_MAYBE_COMMA;
+ break;
+
+ case V850_PS_MAYBE_COMMA:
+ if (streq (string, ","))
+ state = V850_PS_MAYBE_SECTION_NAME;
+ else
+ {
+ warning
+ ("Malformed GHS section pragma: found '%s' instead of a comma",
+ string);
+ state = V850_PS_BAD;
+ }
+ break;
+ }
+
+ return 1;
+}
+
+/* Handle the parsing of an entire GHS pragma. */
+int
+v850_handle_pragma (p_getc, p_ungetc, name)
+ int (* p_getc) PROTO ((void));
+ void (* p_ungetc) PROTO ((int));
+ char * name;
+{
+ /* Parse characters in the input stream until:
+
+ * end of line
+ * end of file
+ * a complete GHS pragma has been parsed
+ * a corrupted GHS pragma has been parsed
+ * an unknown pragma is encountered.
+
+ If an unknown pragma is encountered, we must return with
+ the input stream in the same state as upon entry to this function.
+
+ The first token in the input stream has already been parsed
+ for us, and is passed as 'name'. */
+
+ if (! streq (name, "ghs"))
+ return 0;
+
+ /* We now know that we are parsing a GHS pragma, so we do
+ not need to preserve the original input stream state. */
+ for (;;)
+ {
+ static char buffer [128];
+ int c;
+ char * buff;
+
+ /* Skip white space. */
+ do
+ c = p_getc ();
+ while (c == ' ' || c == '\t');
+
+ p_ungetc (c);
+
+ if (c == '\n' || c == EOF || c == '\r')
+ return parse_ghs_pragma_token (NULL);
+
+ /* Read next word. We have to do the parsing ourselves, rather
+ than calling yylex() because we can be built with front ends
+ that do not provide such functions. */
+ buff = buffer;
+ * buff ++ = (c = p_getc ());
+
+ switch (c)
+ {
+ case ',':
+ case '=':
+ * buff ++ = (c = p_getc ());
+ break;
+
+ case '"':
+ /* Skip opening double parenthesis. */
+ -- buff;
+
+ /* Read string. */
+ do
+ * buff ++ = (c = p_getc ());
+ while (c != EOF && isascii (c)
+ && (isalnum (c) || c == '_' || c == '.' || c == ' ')
+ && (buff < buffer + 126));
+
+ if (c != '"')
+ warning ("Missing trailing \" in #pragma ghs");
+ else
+ c = p_getc ();
+ break;
+
+ default:
+ while (c != EOF && isascii (c)
+ && (isalnum (c) || c == '_' || c == '.')
+ && (buff < buffer + 126))
+ * buff ++ = (c = p_getc ());
+ break;
+ }
+
+ p_ungetc (c);
+
+ /* If nothing was read then terminate the parsing. */
+ if (buff == buffer + 1)
+ return parse_ghs_pragma_token (NULL);
+
+ /* Parse and continue. */
+ * -- buff = 0;
+
+ parse_ghs_pragma_token (buffer);
+ }
+}
+
+/* Add data area to the given declaration if a ghs data area pragma is
+ currently in effect (#pragma ghs startXXX/endXXX). */
+void
+v850_set_default_decl_attr (decl)
+ tree decl;
+{
+ if (data_area_stack
+ && data_area_stack->data_area
+ && current_function_decl == NULL_TREE
+ && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == CONST_DECL)
+ && v850_get_data_area (decl) == DATA_AREA_NORMAL)
+ v850_set_data_area (decl, data_area_stack->data_area);
+
+ /* Initialise the default names of the v850 specific sections,
+ if this has not been done before. */
+
+ if (GHS_default_section_names [(int) GHS_SECTION_KIND_SDATA] == NULL)
+ {
+ GHS_default_section_names [(int) GHS_SECTION_KIND_SDATA]
+ = build_string (sizeof (".sdata")-1, ".sdata");
+
+ GHS_default_section_names [(int) GHS_SECTION_KIND_ROSDATA]
+ = build_string (sizeof (".rosdata")-1, ".rosdata");
+
+ GHS_default_section_names [(int) GHS_SECTION_KIND_TDATA]
+ = build_string (sizeof (".tdata")-1, ".tdata");
+
+ GHS_default_section_names [(int) GHS_SECTION_KIND_ZDATA]
+ = build_string (sizeof (".zdata")-1, ".zdata");
+
+ GHS_default_section_names [(int) GHS_SECTION_KIND_ROZDATA]
+ = build_string (sizeof (".rozdata")-1, ".rozdata");
+ }
+
+ if (current_function_decl == NULL_TREE
+ && (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == CONST_DECL
+ || TREE_CODE (decl) == FUNCTION_DECL)
+ && (!DECL_EXTERNAL (decl) || DECL_INITIAL (decl))
+ && !DECL_SECTION_NAME (decl))
+ {
+ enum GHS_section_kind kind = GHS_SECTION_KIND_DEFAULT;
+ tree chosen_section;
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ kind = GHS_SECTION_KIND_TEXT;
+ else
+ {
+ /* First choose a section kind based on the data area of the decl. */
+ switch (v850_get_data_area (decl))
+ {
+ default:
+ abort ();
+
+ case DATA_AREA_SDA:
+ kind = ((TREE_READONLY (decl))
+ ? GHS_SECTION_KIND_ROSDATA
+ : GHS_SECTION_KIND_SDATA);
+ break;
+
+ case DATA_AREA_TDA:
+ kind = GHS_SECTION_KIND_TDATA;
+ break;
+
+ case DATA_AREA_ZDA:
+ kind = ((TREE_READONLY (decl))
+ ? GHS_SECTION_KIND_ROZDATA
+ : GHS_SECTION_KIND_ZDATA);
+ break;
+
+ case DATA_AREA_NORMAL: /* default data area */
+ if (TREE_READONLY (decl))
+ kind = GHS_SECTION_KIND_RODATA;
+ else if (DECL_INITIAL (decl))
+ kind = GHS_SECTION_KIND_DATA;
+ else
+ kind = GHS_SECTION_KIND_BSS;
+ }
+ }
+
+ /* Now, if the section kind has been explicitly renamed,
+ then attach a section attribute. */
+ chosen_section = GHS_current_section_names [(int) kind];
+
+ /* Otherwise, if this kind of section needs an explicit section
+ attribute, then also attach one. */
+ if (chosen_section == NULL)
+ chosen_section = GHS_default_section_names [(int) kind];
+
+ if (chosen_section)
+ {
+ /* Only set the section name if specified by a pragma, because
+ otherwise it will force those variables to get allocated storage
+ in this module, rather than by the linker. */
+ DECL_SECTION_NAME (decl) = chosen_section;
+ }
+ }
+}
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 0161379f409..8a417f079fc 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -20,6 +20,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "svr4.h" /* Automatically does #undef CPP_PREDEFINES */
+#include "gansidecl.h" /* For the PROTO macro */
#undef ASM_SPEC
#define ASM_SPEC "%{mv*:-mv%*}"
@@ -78,7 +79,7 @@ extern int target_flags;
* Doubles are normally 4 byte aligned, except in argument
lists where they are 8 byte aligned. Is the alignment
in the argument list based on the first parameter,
- first stack parameter, etc., etc.
+ first stack parameter, etc etc.
* Passing/returning of large structures probably isn't the same
as GHS. We don't have enough documentation on their conventions
@@ -112,21 +113,27 @@ extern int target_flags;
An empty string NAME is used to identify the default VALUE. */
#define TARGET_SWITCHES \
- {{ "ghs", MASK_GHS }, \
- { "no-ghs", -MASK_GHS }, \
- { "long-calls", MASK_LONG_CALLS }, \
- { "no-long-calls", -MASK_LONG_CALLS }, \
- { "ep", MASK_EP }, \
- { "no-ep", -MASK_EP }, \
- { "prolog-function", MASK_PROLOG_FUNCTION }, \
- { "no-prolog-function", -MASK_PROLOG_FUNCTION }, \
- { "space", MASK_EP | MASK_PROLOG_FUNCTION }, \
- { "debug", MASK_DEBUG }, \
- { "v850", MASK_V850 }, \
- { "v850", -(MASK_V850 ^ MASK_CPU) }, \
- { "big-switch", MASK_BIG_SWITCH }, \
+ {{ "ghs", MASK_GHS, "Support Green Hills ABI" }, \
+ { "no-ghs", -MASK_GHS, "" }, \
+ { "long-calls", MASK_LONG_CALLS, \
+ "Prohibit PC relative function calls" },\
+ { "no-long-calls", -MASK_LONG_CALLS, "" }, \
+ { "ep", MASK_EP, \
+ "Reuse r30 on a per function basis" }, \
+ { "no-ep", -MASK_EP, "" }, \
+ { "prolog-function", MASK_PROLOG_FUNCTION, \
+ "Use stubs for function prologues" }, \
+ { "no-prolog-function", -MASK_PROLOG_FUNCTION, "" }, \
+ { "space", MASK_EP | MASK_PROLOG_FUNCTION, \
+ "Same as: -mep -mprolog-function" }, \
+ { "debug", MASK_DEBUG, "Enable backend debugging" }, \
+ { "v850", MASK_V850, \
+ "Compile for the v850 processor" }, \
+ { "v850", -(MASK_V850 ^ MASK_CPU), "" }, \
+ { "big-switch", MASK_BIG_SWITCH, \
+ "Use 4 byte entries in switch tables" },\
EXTRA_SWITCHES \
- { "", TARGET_DEFAULT}}
+ { "", TARGET_DEFAULT, ""}}
#ifndef EXTRA_SWITCHES
#define EXTRA_SWITCHES
@@ -176,12 +183,15 @@ extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max];
#define TARGET_OPTIONS \
{ \
- { "tda=", &small_memory[ (int)SMALL_MEMORY_TDA ].value }, \
- { "tda-", &small_memory[ (int)SMALL_MEMORY_TDA ].value }, \
- { "sda=", &small_memory[ (int)SMALL_MEMORY_SDA ].value }, \
- { "sda-", &small_memory[ (int)SMALL_MEMORY_SDA ].value }, \
- { "zda=", &small_memory[ (int)SMALL_MEMORY_ZDA ].value }, \
- { "zda-", &small_memory[ (int)SMALL_MEMORY_ZDA ].value }, \
+ { "tda=", &small_memory[ (int)SMALL_MEMORY_TDA ].value, \
+ "Set the max size of data eligible for the TDA area" }, \
+ { "tda-", &small_memory[ (int)SMALL_MEMORY_TDA ].value, "" }, \
+ { "sda=", &small_memory[ (int)SMALL_MEMORY_SDA ].value, \
+ "Set the max size of data eligible for the SDA area" }, \
+ { "sda-", &small_memory[ (int)SMALL_MEMORY_SDA ].value, "" }, \
+ { "zda=", &small_memory[ (int)SMALL_MEMORY_ZDA ].value, \
+ "Set the max size of data eligible for the ZDA area" }, \
+ { "zda-", &small_memory[ (int)SMALL_MEMORY_ZDA ].value, "" }, \
}
/* Sometimes certain combinations of command options do not make
@@ -405,7 +415,8 @@ extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max];
For any two classes, it is very desirable that there be another
class that represents their union. */
-enum reg_class {
+enum reg_class
+{
NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
};
@@ -581,13 +592,14 @@ enum reg_class {
Do not define this macro if it would be the same as
`FRAME_POINTER_REGNUM'. */
+#undef HARD_FRAME_POINTER_REGNUM
#define HARD_FRAME_POINTER_REGNUM 29
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM 33
/* Register in which static-chain is passed to a function. */
-#define STATIC_CHAIN_REGNUM 5
+#define STATIC_CHAIN_REGNUM 20
/* Value should be nonzero if functions must have frame pointers.
Zero means the frame pointer need not be set up (and parms
@@ -690,7 +702,6 @@ struct cum_arg { int nbytes; };
NAMED is nonzero if this argument is a named parameter
(otherwise it is an extra parameter matching an ellipsis). */
-struct rtx_def *function_arg();
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
@@ -1035,17 +1046,29 @@ do { \
into an indirect call. */
#define NO_FUNCTION_CSE
+/* The four different data regions on the v850. */
+typedef enum
+{
+ DATA_AREA_NORMAL,
+ DATA_AREA_SDA,
+ DATA_AREA_TDA,
+ DATA_AREA_ZDA
+} v850_data_area;
+
/* A list of names for sections other than the standard two, which are
`in_text' and `in_data'. You need not define this macro on a
system with no other sections (that GCC needs to use). */
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_tdata, in_sdata, in_zdata, in_const, in_ctors, in_dtors
+#define EXTRA_SECTIONS in_tdata, in_sdata, in_zdata, in_const, in_ctors, \
+in_dtors, in_rozdata, in_rosdata, in_sbss, in_zbss, in_zcommon, in_scommon
/* One or more functions to be defined in `varasm.c'. These
functions should do jobs analogous to those of `text_section' and
`data_section', for your additional sections. Do not define this
macro if you do not define `EXTRA_SECTIONS'. */
#undef EXTRA_SECTION_FUNCTIONS
+
+/* This could be done a lot more cleanly using ANSI C ... */
#define EXTRA_SECTION_FUNCTIONS \
CONST_SECTION_FUNCTION \
CTORS_SECTION_FUNCTION \
@@ -1062,6 +1085,26 @@ sdata_section () \
} \
\
void \
+rosdata_section () \
+{ \
+ if (in_section != in_rosdata) \
+ { \
+ fprintf (asm_out_file, "%s\n", ROSDATA_SECTION_ASM_OP); \
+ in_section = in_sdata; \
+ } \
+} \
+ \
+void \
+sbss_section () \
+{ \
+ if (in_section != in_sbss) \
+ { \
+ fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \
+ in_section = in_sbss; \
+ } \
+} \
+ \
+void \
tdata_section () \
{ \
if (in_section != in_tdata) \
@@ -1079,16 +1122,42 @@ zdata_section () \
fprintf (asm_out_file, "%s\n", ZDATA_SECTION_ASM_OP); \
in_section = in_zdata; \
} \
+} \
+ \
+void \
+rozdata_section () \
+{ \
+ if (in_section != in_rozdata) \
+ { \
+ fprintf (asm_out_file, "%s\n", ROZDATA_SECTION_ASM_OP); \
+ in_section = in_rozdata; \
+ } \
+} \
+ \
+void \
+zbss_section () \
+{ \
+ if (in_section != in_zbss) \
+ { \
+ fprintf (asm_out_file, "%s\n", ZBSS_SECTION_ASM_OP); \
+ in_section = in_zbss; \
+ } \
}
-#define TEXT_SECTION_ASM_OP "\t.section .text"
-#define DATA_SECTION_ASM_OP "\t.section .data"
-#define BSS_SECTION_ASM_OP "\t.section .bss"
+#define TEXT_SECTION_ASM_OP "\t.section .text"
+#define DATA_SECTION_ASM_OP "\t.section .data"
+#define BSS_SECTION_ASM_OP "\t.section .bss"
#define SDATA_SECTION_ASM_OP "\t.section .sdata,\"aw\""
-#define SBSS_SECTION_ASM_OP "\t.section .sbss,\"aw\""
+#define SBSS_SECTION_ASM_OP "\t.section .sbss,\"aw\""
#define ZDATA_SECTION_ASM_OP "\t.section .zdata,\"aw\""
-#define ZBSS_SECTION_ASM_OP "\t.section .zbss,\"aw\""
+#define ZBSS_SECTION_ASM_OP "\t.section .zbss,\"aw\""
#define TDATA_SECTION_ASM_OP "\t.section .tdata,\"aw\""
+#define ROSDATA_SECTION_ASM_OP "\t.section .rosdata,\"a\""
+#define ROZDATA_SECTION_ASM_OP "\t.section .rozdata,\"a\""
+
+#define SCOMMON_ASM_OP ".scomm"
+#define ZCOMMON_ASM_OP ".zcomm"
+#define TCOMMON_ASM_OP ".tcomm"
/* A C statement or statements to switch to the appropriate section
for output of EXP. You can assume that EXP is either a `VAR_DECL'
@@ -1099,18 +1168,48 @@ zdata_section () \
Do not define this macro if you put all read-only variables and
constants in the read-only data section (usually the text section). */
-#undef SELECT_SECTION
+#undef SELECT_SECTION
#define SELECT_SECTION(EXP, RELOC) \
do { \
if (TREE_CODE (EXP) == VAR_DECL) \
{ \
- if (!TREE_READONLY (EXP) || TREE_SIDE_EFFECTS (EXP) \
+ int is_const; \
+ if (!TREE_READONLY (EXP) \
+ || TREE_SIDE_EFFECTS (EXP) \
|| !DECL_INITIAL (EXP) \
|| (DECL_INITIAL (EXP) != error_mark_node \
&& !TREE_CONSTANT (DECL_INITIAL (EXP)))) \
- data_section (); \
+ is_const = FALSE; \
else \
- const_section (); \
+ is_const = TRUE; \
+ \
+ switch (v850_get_data_area (EXP)) \
+ { \
+ case DATA_AREA_ZDA: \
+ if (is_const) \
+ rozdata_section (); \
+ else \
+ zdata_section (); \
+ break; \
+ \
+ case DATA_AREA_TDA: \
+ tdata_section (); \
+ break; \
+ \
+ case DATA_AREA_SDA: \
+ if (is_const) \
+ rosdata_section (); \
+ else \
+ sdata_section (); \
+ break; \
+ \
+ default: \
+ if (is_const) \
+ const_section (); \
+ else \
+ data_section (); \
+ break; \
+ } \
} \
else if (TREE_CODE (EXP) == STRING_CST) \
{ \
@@ -1203,6 +1302,24 @@ do { char dstr[30]; \
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
+#undef ASM_OUTPUT_ALIGNED_BSS
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+ v850_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* This says how to output the assembler to define a global
+ uninitialized, common symbol. */
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#undef ASM_OUTPUT_COMMON
+#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
+ v850_output_common (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* This says how to output the assembler to define a local
+ uninitialized symbol. */
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#undef ASM_OUTPUT_LOCAL
+#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
+ v850_output_local (FILE, DECL, NAME, SIZE, ALIGN)
+
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
@@ -1266,7 +1383,7 @@ do { char dstr[30]; \
/* Print an instruction operand X on file FILE.
look in v850.c for details */
-#define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE,X,CODE)
+#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '.')
@@ -1326,7 +1443,7 @@ do { char dstr[30]; \
/* The switch instruction requires that the jump table immediately follow
it. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
/* svr4.h defines this assuming that 4 byte alignment is required. */
#undef ASM_OUTPUT_BEFORE_CASE_LABEL
@@ -1377,15 +1494,69 @@ do { char dstr[30]; \
is a valid machine specific attribute for DECL.
The attributes in ATTRIBUTES have previously been assigned to DECL. */
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-v850_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
+ v850_valid_machine_decl_attribute (DECL, IDENTIFIER, ARGS)
-/* Tell compiler we have {ZDA,TDA,SDA} small data regions */
-#define HAVE_ZDA 1
-#define HAVE_SDA 1
-#define HAVE_TDA 1
+/* A C statement that assigns default attributes to a newly created DECL. */
+#define SET_DEFAULT_DECL_ATTRIBUTES(decl, attr) \
+ v850_set_default_decl_attr (decl)
/* Tell compiler we want to support GHS pragmas */
-#define HANDLE_GHS_PRAGMA
+#define HANDLE_PRAGMA(get, unget, name) v850_handle_pragma (get, unget, name)
+
+enum v850_pragma_state
+{
+ V850_PS_START,
+ V850_PS_SHOULD_BE_DONE,
+ V850_PS_BAD,
+ V850_PS_MAYBE_SECTION_NAME,
+ V850_PS_EXPECTING_EQUALS,
+ V850_PS_EXPECTING_SECTION_ALIAS,
+ V850_PS_MAYBE_COMMA
+};
+
+enum v850_pragma_type
+{
+ V850_PT_UNKNOWN,
+ V850_PT_INTERRUPT,
+ V850_PT_SECTION,
+ V850_PT_START_SECTION,
+ V850_PT_END_SECTION
+};
+
+/* enum GHS_SECTION_KIND is an enumeration of the kinds of sections that
+ can appear in the "ghs section" pragma. These names are used to index
+ into the GHS_default_section_names[] and GHS_current_section_names[]
+ that are defined in v850.c, and so the ordering of each must remain
+ consistant.
+
+ These arrays give the default and current names for each kind of
+ section defined by the GHS pragmas. The current names can be changed
+ by the "ghs section" pragma. If the current names are null, use
+ the default names. Note that the two arrays have different types.
+
+ For the *normal* section kinds (like .data, .text, etc.) we do not
+ want to explicitly force the name of these sections, but would rather
+ let the linker (or at least the back end) choose the name of the
+ section, UNLESS the user has force a specific name for these section
+ kinds. To accomplish this set the name in ghs_default_section_names
+ to null. */
+
+enum GHS_section_kind
+{
+ GHS_SECTION_KIND_DEFAULT,
+
+ GHS_SECTION_KIND_TEXT,
+ GHS_SECTION_KIND_DATA,
+ GHS_SECTION_KIND_RODATA,
+ GHS_SECTION_KIND_BSS,
+ GHS_SECTION_KIND_SDATA,
+ GHS_SECTION_KIND_ROSDATA,
+ GHS_SECTION_KIND_TDATA,
+ GHS_SECTION_KIND_ZDATA,
+ GHS_SECTION_KIND_ROZDATA,
+
+ COUNT_OF_GHS_SECTION_KINDS /* must be last */
+};
/* The assembler op to start the file. */
@@ -1444,34 +1615,52 @@ do { \
{ "register_is_ok_for_epilogue",{ REG }}, \
{ "not_power_of_two_operand", { CONST_INT }},
-extern void override_options ();
-extern void asm_file_start ();
-extern int function_arg_partial_nregs ();
-extern int const_costs ();
-extern void print_operand ();
-extern void print_operand_address ();
-extern char *output_move_double ();
-extern char *output_move_single ();
-extern int ep_operand ();
-extern int reg_or_0_operand ();
-extern int reg_or_int5_operand ();
-extern int call_address_operand ();
-extern int movsi_source_operand ();
-extern int power_of_two_operand ();
-extern int not_power_of_two_operand ();
-extern void v850_reorg ();
-extern int compute_register_save_size ();
-extern int compute_frame_size ();
-extern void expand_prologue ();
-extern void expand_epilogue ();
-extern void notice_update_cc ();
-extern int v850_valid_machine_decl_attribute ();
-extern int v850_interrupt_function_p ();
-
-extern int pattern_is_ok_for_prologue();
-extern int pattern_is_ok_for_epilogue();
-extern int register_is_ok_for_epilogue ();
-extern char *construct_save_jarl ();
-extern char *construct_restore_jr ();
-
-
+ /* Note, due to dependency and search path conflicts, prototypes
+ involving the FILE, rtx or tree types cannot be included here.
+ They are included at the start of v850.c */
+
+extern void asm_file_start ();
+extern void print_operand ();
+extern void print_operand_address ();
+extern int function_arg_partial_nregs ();
+extern int const_costs ();
+extern char * output_move_double ();
+extern char * output_move_single ();
+extern int ep_memory_operand ();
+extern int reg_or_0_operand ();
+extern int reg_or_int5_operand ();
+extern int call_address_operand ();
+extern int movsi_source_operand ();
+extern int power_of_two_operand ();
+extern int not_power_of_two_operand ();
+extern int special_symbolref_operand ();
+extern void v850_reorg ();
+extern void notice_update_cc ();
+extern int v850_valid_machine_decl_attribute ();
+extern int v850_interrupt_function_p ();
+extern int pattern_is_ok_for_prologue ();
+extern int pattern_is_ok_for_epilogue ();
+extern int register_is_ok_for_epilogue ();
+extern char * construct_save_jarl ();
+extern char * construct_restore_jr ();
+
+extern void override_options PROTO ((void));
+extern int compute_register_save_size PROTO ((long *));
+extern int compute_frame_size PROTO ((int, long *));
+extern void expand_prologue PROTO ((void));
+extern void expand_epilogue PROTO ((void));
+
+extern void v850_output_aligned_bss ();
+extern void v850_output_common ();
+extern void v850_output_local ();
+extern void sdata_section PROTO ((void));
+extern void rosdata_section PROTO ((void));
+extern void sbss_section PROTO ((void));
+extern void tdata_section PROTO ((void));
+extern void zdata_section PROTO ((void));
+extern void rozdata_section PROTO ((void));
+extern void zbss_section PROTO ((void));
+extern int v850_handle_pragma PROTO ((int (*)(void), void (*)(int), char *));
+extern void v850_encode_data_area ();
+extern void v850_set_default_decl_attr ();
+extern v850_data_area v850_get_data_area ();
diff --git a/gcc/config/vax/netbsd.h b/gcc/config/vax/netbsd.h
index dba70237d47..23f3ff5e8ac 100644
--- a/gcc/config/vax/netbsd.h
+++ b/gcc/config/vax/netbsd.h
@@ -20,5 +20,5 @@
/* Until they use ELF or something that handles dwarf2 unwinds
and initialization stuff better. */
-#define DWARF2_UNWIND_INFO 0
+#undef DWARF2_UNWIND_INFO
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 1c96e1e7397..3b4c54999cc 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -1225,7 +1225,7 @@ do { \
fprintf (FILE, "\t.word 0x0ffc\n"); \
fprintf (FILE, "\taddl2 $%d,4(ap)\n", DELTA); \
fprintf (FILE, "\tjmp "); \
- assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "+2\n"); \
} while (0)
diff --git a/gcc/config/winnt/win-nt.h b/gcc/config/winnt/win-nt.h
index 14f3f87bcdb..f123b0497fc 100644
--- a/gcc/config/winnt/win-nt.h
+++ b/gcc/config/winnt/win-nt.h
@@ -56,3 +56,6 @@ Boston, MA 02111-1307, USA. */
#undef STDC_VALUE
#define STDC_VALUE 0
+
+/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
+#define HANDLE_PRAGMA_PACK_PUSH_POP 1
diff --git a/gcc/config/xm-linux.h b/gcc/config/xm-linux.h
index 9a3838b7d7f..2cffdb7fab6 100644
--- a/gcc/config/xm-linux.h
+++ b/gcc/config/xm-linux.h
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
/* We do have one, but I'd like to use the one come with gcc since
we have been doing that for a long time with USG defined. H.J. */
-#define NO_STAB_H
+#undef HAVE_STAB_H
#undef BSTRING
#define BSTRING
diff --git a/gcc/config/xm-netbsd.h b/gcc/config/xm-netbsd.h
deleted file mode 100644
index 099a9234ffa..00000000000
--- a/gcc/config/xm-netbsd.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Configuration for GNU C-compiler for hosts running NetBSD.
- Copyright (C) 1995 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 defines machine-independent things specific to a host
- running NetBSD. This file should not be specified as $xm_file itself;
- instead $xm_file should be CPU/xm-netbsd.h, which should include both
- CPU/xm-CPU.h and this file xm-netbsd.h. */
-
-#define HAVE_VPRINTF
diff --git a/gcc/configure b/gcc/configure
index 5d8b74f97a4..492edaa1791 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1
+# Generated automatically using autoconf version 2.12
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -14,8 +14,12 @@ ac_default_prefix=/usr/local
ac_help="$ac_help
--with-gnu-ld arrange to work with GNU ld."
ac_help="$ac_help
+ --with-ld arrange to use the specified ld (full pathname)."
+ac_help="$ac_help
--with-gnu-as arrange to work with GNU as."
ac_help="$ac_help
+ --with-as arrange to use the specified as (full pathname)."
+ac_help="$ac_help
--with-stabs arrange to use stabs instead of host debug format."
ac_help="$ac_help
--with-elf arrange to use ELF instead of host debug format."
@@ -25,16 +29,31 @@ ac_help="$ac_help
--with-gxx-include-dir=DIR
specifies directory to put g++ header files."
ac_help="$ac_help
- --enable-c-cpplib Use cpplib for C."
+ --enable-checking enable expensive run-time checks."
+ac_help="$ac_help
+ --enable-cpplib use cpplib for the C preprocessor."
ac_help="$ac_help
- --enable-haifa Use the experimental scheduler.
- --disable-haifa Don't use the experimental scheduler for the
+ --enable-c-cpplib link cpplib directly into C and C++ compilers
+ (implies --enable-cpplib)."
+ac_help="$ac_help
+ --enable-c-mbchar enable multibyte characters for C and C++."
+ac_help="$ac_help
+ --enable-haifa use the experimental scheduler.
+ --disable-haifa don't use the experimental scheduler for the
targets which normally enable it."
ac_help="$ac_help
- --with-fast-fixincludes Use a faster fixinclude program. Experimental"
+ --with-fast-fixincludes use a faster fixinclude program (experimental)"
+ac_help="$ac_help
+ --enable-init-priority use attributes to assign initialization order
+ for static objects.
+ --disable-init-priority conform to ISO C++ rules for ordering static objects
+ (i.e. initialized in order of declaration). "
ac_help="$ac_help
--enable-threads enable thread usage for target GCC.
--enable-threads=LIB use LIB thread package for target GCC."
+ac_help="$ac_help
+ --enable-objc-gc enable the use of Boehm's garbage collector with
+ the GNU Objective-C runtime."
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -73,7 +92,6 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -357,7 +375,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12.1"
+ echo "configure generated by autoconf version 2.12"
exit 0 ;;
-with-* | --with-*)
@@ -550,6 +568,57 @@ hard_link=ln
symbolic_link='ln -s'
copy=cp
+# Check for bogus environment variables.
+# Test if LIBRARY_PATH contains the notation for the current directory
+# since this would lead to problems installing/building glibc.
+# LIBRARY_PATH contains the current directory if one of the following
+# is true:
+# - one of the terminals (":" and ";") is the first or last sign
+# - 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:581: checking LIBRARY_PATH variable" >&5
+case ${LIBRARY_PATH} in
+ [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
+ library_path_setting="contains current directory"
+ ;;
+ *)
+ library_path_setting="ok"
+ ;;
+esac
+echo "$ac_t""$library_path_setting" 1>&6
+if test "$library_path_setting" != "ok"; then
+{ echo "configure: error:
+*** LIBRARY_PATH shouldn't contain the current directory when
+*** building egcs. Please change the environment variable
+*** and run configure again." 1>&2; exit 1; }
+fi
+
+# Test if GCC_EXEC_PREFIX contains the notation for the current directory
+# since this would lead to problems installing/building glibc.
+# GCC_EXEC_PREFIX contains the current directory if one of the following
+# is true:
+# - one of the terminals (":" and ";") is the first or last sign
+# - 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:606: checking GCC_EXEC_PREFIX variable" >&5
+case ${GCC_EXEC_PREFIX} in
+ [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
+ gcc_exec_prefix_setting="contains current directory"
+ ;;
+ *)
+ gcc_exec_prefix_setting="ok"
+ ;;
+esac
+echo "$ac_t""$gcc_exec_prefix_setting" 1>&6
+if test "$gcc_exec_prefix_setting" != "ok"; then
+{ echo "configure: error:
+*** GCC_EXEC_PREFIX shouldn't contain the current directory when
+*** building egcs. Please change the environment variable
+*** and run configure again." 1>&2; exit 1; }
+fi
+
# Check for additional parameters
# With GNU ld
@@ -562,6 +631,25 @@ else
fi
+# With pre-defined ld
+# Check whether --with-ld or --without-ld was given.
+if test "${with_ld+set}" = set; then
+ withval="$with_ld"
+ LD="$with_ld"
+fi
+
+if test x"${LD+set}" = x"set"; then
+ if test ! -x "$LD"; then
+ echo "configure: warning: cannot execute: $LD: check --with-ld or env. var. LD" 1>&2
+ elif test "GNU" = `$LD -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
+ gnu_ld_flag=yes
+ fi
+ cat >> confdefs.h <<EOF
+#define DEFAULT_LINKER "$LD"
+EOF
+
+fi
+
# With GNU as
# Check whether --with-gnu-as or --without-gnu-as was given.
if test "${with_gnu_as+set}" = set; then
@@ -572,6 +660,24 @@ else
fi
+# Check whether --with-as or --without-as was given.
+if test "${with_as+set}" = set; then
+ withval="$with_as"
+ AS="$with_as"
+fi
+
+if test x"${AS+set}" = x"set"; then
+ if test ! -x "$AS"; then
+ echo "configure: warning: cannot execute: $AS: check --with-as or env. var. AS" 1>&2
+ elif test "GNU" = `$AS -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
+ gas_flag=yes
+ fi
+ cat >> confdefs.h <<EOF
+#define DEFAULT_ASSEMBLER "$AS"
+EOF
+
+fi
+
# With stabs
# Check whether --with-stabs or --without-stabs was given.
if test "${with_stabs+set}" = set; then
@@ -593,42 +699,91 @@ fi
# Specify the local prefix
+local_prefix=
# Check whether --with-local-prefix or --without-local-prefix was given.
if test "${with_local_prefix+set}" = set; then
withval="$with_local_prefix"
- local_prefix=$with_local_prefix
-else
- local_prefix=/usr/local
+ case "${withval}" in
+yes) { echo "configure: error: bad value ${withval} given for local include directory prefix" 1>&2; exit 1; } ;;
+no) ;;
+*) local_prefix=$with_local_prefix ;;
+esac
fi
# Default local prefix if it is empty
-if [ x$local_prefix = x ]; then
+if test x$local_prefix = x; then
local_prefix=/usr/local
fi
+gxx_include_dir=
# Specify the g++ header file directory
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
if test "${with_gxx_include_dir+set}" = set; then
withval="$with_gxx_include_dir"
- gxx_include_dir=$with_gxx_include_dir
-else
- gxx_include_dir='${prefix}/include/g++'
+ case "${withval}" in
+yes) { echo "configure: error: bad value ${withval} given for g++ include directory" 1>&2; exit 1; } ;;
+no) ;;
+*) gxx_include_dir=$with_gxx_include_dir ;;
+esac
+fi
+
+
+if test x${gxx_include_dir} = x; then
+ if test x${enable_version_specific_runtime_libs} = xyes; then
+ gxx_include_dir='${libsubdir}/include/g++'
+ else
+ topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
+ gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
+ fi
+fi
+
+# Enable expensive internal checks
+# Check whether --enable-checking or --disable-checking was given.
+if test "${enable_checking+set}" = set; then
+ enableval="$enable_checking"
+ case "${enableval}" in
+yes) cat >> confdefs.h <<\EOF
+#define ENABLE_CHECKING 1
+EOF
+ ;;
+no) ;;
+*) { echo "configure: error: bad value ${enableval} given for checking option" 1>&2; exit 1; } ;;
+esac
fi
-# Default g++ header file directory if it is empty
-if [ x$gxx_include_dir = x ]; then
- gxx_include_dir='${prefix}/include/g++'
+# Use cpplib+cppmain for the preprocessor, but don't link it with the compiler.
+cpp_main=cccp
+# Check whether --enable-cpplib or --disable-cpplib was given.
+if test "${enable_cpplib+set}" = set; then
+ enableval="$enable_cpplib"
+ if test x$enable_cpplib != xno; then
+ cpp_main=cppmain
+fi
fi
-# Enable use of cpplib for C.
+
+# Link cpplib into the compiler proper, for C/C++/ObjC.
# Check whether --enable-c-cpplib or --disable-c-cpplib was given.
if test "${enable_c_cpplib+set}" = set; then
enableval="$enable_c_cpplib"
- if [ x$enable_c_cpplib != xno ]; then
+ if test x$enable_c_cpplib != xno; then
extra_c_objs="${extra_c_objs} cpplib.o cppexp.o cpphash.o cpperror.o"
+ extra_c_objs="${extra_c_objs} prefix.o"
+ extra_cxx_objs="${extra_cxx_objs} ../cpplib.o ../cppexp.o ../cpphash.o ../cpperror.o ../prefix.o"
extra_c_flags=-DUSE_CPPLIB=1
+ cpp_main=cppmain
+fi
+fi
+
+
+# Enable Multibyte Characters for C/C++
+# Check whether --enable-c-mbchar or --disable-c-mbchar was given.
+if test "${enable_c_mbchar+set}" = set; then
+ enableval="$enable_c_mbchar"
+ if test x$enable_c_mbchar != xno; then
+ extra_c_flags=-DMULTIBYTE_CHARS=1
fi
fi
@@ -652,13 +807,23 @@ else
fi
+# Enable init_priority.
+# Check whether --enable-init-priority or --disable-init-priority was given.
+if test "${enable_init_priority+set}" = set; then
+ enableval="$enable_init_priority"
+ if test x$enable_init_priority != xno; then
+ extra_c_flags=-DUSE_INIT_PRIORITY
+fi
+fi
+
+
# Enable threads
# Pass with no value to take the default
# Pass with a value to specify a thread package
# Check whether --enable-threads or --disable-threads was given.
if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
- if [ x$enable_threads = xno ]; then
+ if test x$enable_threads = xno; then
enable_threads=''
fi
else
@@ -687,6 +852,19 @@ case x${enable_threads_flag} in
;;
esac
+# Check whether --enable-objc-gc or --disable-objc-gc was given.
+if test "${enable_objc_gc+set}" = set; then
+ enableval="$enable_objc_gc"
+ if [ x$enable_objc_gc = xno ]; then
+ objc_boehm_gc=''
+else
+ objc_boehm_gc=1
+fi
+else
+ objc_boehm_gc=''
+fi
+
+
# Determine the host, build, and target systems
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
@@ -730,33 +908,33 @@ esac
# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+if $ac_config_sub sun4 >/dev/null 2>&1; then :
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:739: checking host system type" >&5
+echo "configure:917: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ if host_alias=`$ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host=`$ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
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:760: checking target system type" >&5
+echo "configure:938: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -767,14 +945,14 @@ NONE)
esac ;;
esac
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target=`$ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
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:778: checking build system type" >&5
+echo "configure:956: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -785,7 +963,7 @@ NONE)
esac ;;
esac
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build=`$ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -801,7 +979,7 @@ test "$host_alias" != "$target_alias" &&
# 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:805: checking for $ac_word" >&5
+echo "configure:983: 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
@@ -830,7 +1008,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:834: checking for $ac_word" >&5
+echo "configure:1012: 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
@@ -878,7 +1056,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:882: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1060: 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.
@@ -888,11 +1066,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 892 "configure"
+#line 1070 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
@@ -912,12 +1090,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:916: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1094: 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:921: checking whether we are using GNU C" >&5
+echo "configure:1099: 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
@@ -926,7 +1104,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:930: \"$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:1108: \"$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
@@ -941,7 +1119,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:945: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1123: 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
@@ -968,8 +1146,19 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
+
+# If the native compiler is GCC, we can enable warnings even in stage1.
+# That's useful for people building cross-compilers, or just running a
+# quick `make'.
+if test "x$GCC" = "xyes"; then
+ stage1_warn_cflags='$(WARN_CFLAGS)'
+else
+ stage1_warn_cflags=""
+fi
+
+
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:973: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1162: 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
@@ -996,13 +1185,37 @@ else
fi
+echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
+echo "configure:1190: checking whether a default assembler was specified" >&5
+if test x"${AS+set}" = x"set"; then
+ if test x"$with_gas" = x"no"; then
+ echo "$ac_t""yes ($AS)" 1>&6
+ else
+ echo "$ac_t""yes ($AS - GNU as)" 1>&6
+ fi
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
+echo "configure:1202: checking whether a default linker was specified" >&5
+if test x"${LD+set}" = x"set"; then
+ if test x"$with_gnu_ld" = x"no"; then
+ echo "$ac_t""yes ($LD)" 1>&6
+ else
+ echo "$ac_t""yes ($LD - GNU ld)" 1>&6
+ fi
+else
+ echo "$ac_t""no" 1>&6
+fi
+
# Find some useful tools
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:1006: checking for $ac_word" >&5
+echo "configure:1219: 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
@@ -1033,7 +1246,7 @@ done
# 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:1037: checking for $ac_word" >&5
+echo "configure:1250: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1066,7 +1279,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1070: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1283: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1074,7 +1287,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1078 "configure"
+#line 1291 "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
@@ -1085,7 +1298,7 @@ int main() {
yywrap()
; return 0; }
EOF
-if { (eval echo configure:1089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1108,7 +1321,7 @@ fi
fi
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:1112: checking whether ln works" >&5
+echo "configure:1325: 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
@@ -1140,7 +1353,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1144: checking whether ln -s works" >&5
+echo "configure:1357: 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
@@ -1171,10 +1384,43 @@ else
fi
fi
+echo $ac_n "checking for volatile""... $ac_c" 1>&6
+echo "configure:1389: 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 1394 "configure"
+#include "confdefs.h"
+
+int main() {
+volatile int foo;
+; return 0; }
+EOF
+if { (eval echo configure:1401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gcc_cv_c_volatile=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gcc_cv_c_volatile=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gcc_cv_c_volatile" 1>&6
+if test $gcc_cv_c_volatile = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_VOLATILE 1
+EOF
+
+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:1178: checking for $ac_word" >&5
+echo "configure:1424: 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
@@ -1205,7 +1451,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:1209: checking for $ac_word" >&5
+echo "configure:1455: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1245,7 +1491,7 @@ test -n "$YACC" || YACC="yacc"
# 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:1249: checking for a BSD compatible install" >&5
+echo "configure:1495: 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
@@ -1296,7 +1542,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1300: checking how to run the C preprocessor" >&5
+echo "configure:1546: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1311,13 +1557,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 1315 "configure"
+#line 1561 "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:1321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1328,13 +1574,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1332 "configure"
+#line 1578 "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:1338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1357,12 +1603,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1361: checking for ANSI C header files" >&5
+echo "configure:1607: 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 1366 "configure"
+#line 1612 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1370,7 +1616,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1387,7 +1633,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 1391 "configure"
+#line 1637 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1405,7 +1651,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 1409 "configure"
+#line 1655 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1426,7 +1672,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1430 "configure"
+#line 1676 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1437,7 +1683,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1461,12 +1707,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1465: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1711: 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 1470 "configure"
+#line 1716 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1475,7 +1721,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -1495,21 +1741,55 @@ EOF
fi
+echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
+echo "configure:1746: 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 1751 "configure"
+#include "confdefs.h"
+#include <string.h>
+#include <strings.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gcc_cv_header_string=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gcc_cv_header_string=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gcc_cv_header_string" 1>&6
+if test $gcc_cv_header_string = yes; then
+ cat >> confdefs.h <<\EOF
+#define STRING_WITH_STRINGS 1
+EOF
+
+fi
+
for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h wait.h sys/wait.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1503: checking for $ac_hdr" >&5
+echo "configure:1783: 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 1508 "configure"
+#line 1788 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1539,17 +1819,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:1543: checking for thread.h" >&5
+echo "configure:1823: 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 1548 "configure"
+#line 1828 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1573,17 +1853,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:1577: checking for pthread.h" >&5
+echo "configure:1857: 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 1582 "configure"
+#line 1862 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1606,15 +1886,46 @@ have_pthread_h=
fi
+# See if GNAT has been installed
+# 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:1894: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnat'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$gnat"; then
+ ac_cv_prog_gnat="$gnat" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_gnat="yes"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_gnat" && ac_cv_prog_gnat="no"
+fi
+fi
+gnat="$ac_cv_prog_gnat"
+if test -n "$gnat"; then
+ echo "$ac_t""$gnat" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
# See if the system preprocessor understands the ANSI C preprocessor
# stringification operator.
echo $ac_n "checking whether cpp understands the stringify operator""... $ac_c" 1>&6
-echo "configure:1613: checking whether cpp understands the stringify operator" >&5
+echo "configure:1924: checking whether cpp understands the stringify operator" >&5
if eval "test \"`echo '$''{'gcc_cv_c_have_stringify'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1618 "configure"
+#line 1929 "configure"
#include "confdefs.h"
int main() {
@@ -1622,7 +1933,7 @@ int main() {
char *test = S(foo);
; return 0; }
EOF
-if { (eval echo configure:1626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_have_stringify=yes
else
@@ -1645,12 +1956,12 @@ fi
# 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:1649: checking for inttypes.h" >&5
+echo "configure:1960: 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 1654 "configure"
+#line 1965 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -1658,7 +1969,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<EOF
#define HAVE_INTTYPES_H 1
@@ -1678,15 +1989,15 @@ echo "$ac_t""$gcc_cv_header_inttypes_h" 1>&6
for ac_func in strtoul bsearch strerror putenv popen bcopy bzero bcmp \
index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \
- sysconf isascii
+ sysconf isascii gettimeofday strsignal
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1685: checking for $ac_func" >&5
+echo "configure:1996: 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 1690 "configure"
+#line 2001 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1709,7 +2020,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1734,13 +2045,16 @@ fi
done
+# Make sure wchar_t is available
+#AC_CHECK_TYPE(wchar_t, unsigned int)
+
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:1739: checking for vprintf" >&5
+echo "configure:2053: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1744 "configure"
+#line 2058 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -1763,7 +2077,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:1767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -1787,12 +2101,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:1791: checking for _doprnt" >&5
+echo "configure:2105: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1796 "configure"
+#line 2110 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -1815,7 +2129,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:1819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -1851,7 +2165,7 @@ fi
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:1855: checking whether the printf functions support %p" >&5
+echo "configure:2169: 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
@@ -1859,7 +2173,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 1863 "configure"
+#line 2177 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1872,7 +2186,7 @@ main()
exit (p != q);
}
EOF
-if { (eval echo configure:1876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
gcc_cv_func_printf_ptr=yes
else
@@ -1890,31 +2204,104 @@ fi
echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
if test $gcc_cv_func_printf_ptr = yes ; then
cat >> confdefs.h <<\EOF
-#define HOST_PTR_PRINTF "%p"
+#define HAVE_PRINTF_PTR 1
EOF
fi
for ac_func in malloc realloc calloc free bcopy bzero bcmp \
- index rindex getenv atol sbrk abort atof
+ index rindex getenv atol sbrk abort atof strerror getcwd getwd \
+ strsignal
do
echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
-echo "configure:1904: checking whether $ac_func must be declared" >&5
+echo "configure:2219: checking whether $ac_func must be declared" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1909 "configure"
+#line 2224 "configure"
#include "confdefs.h"
#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+# endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifndef HAVE_RINDEX
+#define rindex strrchr
#endif
+#ifndef HAVE_INDEX
+#define index strchr
+#endif
+
+int main() {
+char *(*pfn) = (char *(*)) $ac_func
+; return 0; }
+EOF
+if { (eval echo configure:2257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "gcc_cv_decl_needed_$ac_func=no"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "gcc_cv_decl_needed_$ac_func=yes"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$gcc_cv_decl_needed_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ gcc_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $gcc_tr_decl 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+done
+
+
+for ac_func in getrlimit setrlimit
+do
+echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
+echo "configure:2286: checking whether $ac_func must be declared" >&5
+if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2291 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
+#else
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+# endif
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -1928,11 +2315,16 @@ else
#ifndef HAVE_INDEX
#define index strchr
#endif
+#include <sys/types.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
int main() {
char *(*pfn) = (char *(*)) $ac_func
; return 0; }
EOF
-if { (eval echo configure:1936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_decl_needed_$ac_func=no"
else
@@ -1959,12 +2351,12 @@ done
echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:1963: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:2355: checking for sys_siglist declaration in signal.h or unistd.h" >&5
if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1968 "configure"
+#line 2360 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1976,7 +2368,7 @@ int main() {
char *msg = *(sys_siglist + 1);
; return 0; }
EOF
-if { (eval echo configure:1980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_sys_siglist=yes
else
@@ -2036,7 +2428,7 @@ for machine in $build $host $target; do
# Set this to override the default target model.
target_cpu_default=
# Set this to control which fixincludes program to use.
- if [ x$fast_fixinc != xyes ] ; then
+ if test x$fast_fixinc != xyes; then
fixincludes=fixincludes
else fixincludes=fixinc.sh ; fi
# Set this to control how the header file directory is installed.
@@ -2101,7 +2493,7 @@ for machine in $build $host $target; do
# Set the default macros to define for GNU/Linux systems.
case $machine in
*-*-linux-gnu*)
- xm_defines="HAVE_ATEXIT POSIX NO_STAB_H BSTRING"
+ xm_defines="HAVE_ATEXIT POSIX BSTRING"
;;
esac
@@ -2112,11 +2504,11 @@ for machine in $build $host $target; do
rest=`echo $machine | sed -e "s/$cpu_type-//"`
xm_file=${cpu_type}/xm-$rest.h
tm_file=${cpu_type}/$rest.h
- if [ -f $srcdir/config/${cpu_type}/x-$rest ] ; \
+ if test -f $srcdir/config/${cpu_type}/x-$rest; \
then xmake_file=${cpu_type}/x-$rest; \
else true; \
fi
- if [ -f $srcdir/config/${cpu_type}/t-$rest ] ; \
+ if test -f $srcdir/config/${cpu_type}/t-$rest; \
then tmake_file=${cpu_type}/t-$rest; \
else true; \
fi
@@ -2144,43 +2536,51 @@ for machine in $build $host $target; do
;;
alpha*-*-linux-gnuecoff*)
tm_file="${tm_file} alpha/linux-ecoff.h alpha/linux.h"
- xm_defines=USE_BFD
target_cpu_default="MASK_GAS"
gas=no
xmake_file=none
gas=yes gnu_ld=yes
;;
alpha*-*-linux-gnulibc1*)
- tm_file="${tm_file} alpha/elf.h alpha/linux-elf.h alpha/linux.h"
- xm_defines=USE_BFD
+ tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe"
extra_parts="crtbegin.o crtend.o"
+ fixincludes=fixinc.wrap
xmake_file=none
gas=yes gnu_ld=yes
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
alpha*-*-linux-gnu*)
- tm_file="${tm_file} alpha/linux.h alpha/elf.h"
- xm_defines=USE_BFD
+ tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="t-linux alpha/t-linux alpha/t-crtbe"
extra_parts="crtbegin.o crtend.o"
xmake_file=none
fixincludes=Makefile.in
gas=yes gnu_ld=yes
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
+ alpha*-*-netbsd*)
+ tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsdl-elf.h"
+ target_cpu_default="MASK_GAS"
+ tmake_file="alpha/t-crtbe"
+ extra_parts="crtbegin.o crtend.o"
+ xmake_file=none
+ fixincludes=fixinc.wrap
+ gas=yes gnu_ld=yes
+ ;;
+
alpha*-dec-osf*)
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
- if [ x$gas != xyes ]
+ if test x$gas != xyes
then
extra_passes="mips-tfile mips-tdump"
fi
@@ -2205,6 +2605,14 @@ for machine in $build $host $target; do
;;
esac
;;
+ alpha*-*-vxworks*)
+ tm_file="${tm_file} dbx.h alpha/vxworks.h"
+ if x$gas != xyes
+ then
+ extra_passes="mips-tfile mips-tdump"
+ fi
+ use_collect2=yes
+ ;;
alpha*-*-winnt*)
tm_file="${tm_file} alpha/win-nt.h"
xm_file="${xm_file} config/winnt/xm-winnt.h alpha/xm-winnt.h"
@@ -2213,11 +2621,11 @@ for machine in $build $host $target; do
extra_host_objs=oldnames.o
extra_gcc_objs="spawnv.o oldnames.o"
fixincludes=fixinc.winnt
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
extra_programs=ld.exe
fi
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
;;
@@ -2239,7 +2647,7 @@ for machine in $build $host $target; do
use_collect2=yes
;;
arm-*-riscix*) # Acorn RISC machine
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=arm/rix-gas.h
else
@@ -2259,12 +2667,12 @@ for machine in $build $host $target; do
tmake_file=arm/t-semiaof
fixincludes=Makefile.in # There is nothing to fix
;;
- arm-*-netbsd*)
+ arm*-*-netbsd*)
tm_file=arm/netbsd.h
- xm_file="xm-siglist.h ${xm_file}"
+ xm_file="arm/xm-netbsd.h ${xm_file}"
tmake_file="t-netbsd arm/t-netbsd"
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
;;
arm-*-linux-gnuaout*) # ARM GNU/Linux
cpu_type=arm
@@ -2303,6 +2711,10 @@ for machine in $build $host $target; do
use_collect2=yes
fixincludes=Makefile.in
;;
+ c4x-*)
+ cpu_type=c4x
+ tmake_file=c4x/t-c4x
+ ;;
clipper-intergraph-clix*)
tm_file="${tm_file} svr3.h clipper/clix.h"
xm_file=clipper/xm-clix.h
@@ -2356,7 +2768,7 @@ for machine in $build $host $target; do
tm_file="pa/pa-oldas.h ${tm_file} pa/pa-hpux7.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/gas.h"
fi
@@ -2367,7 +2779,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
else
@@ -2381,7 +2793,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
else
@@ -2395,7 +2807,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -2406,7 +2818,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -2419,14 +2831,14 @@ for machine in $build $host $target; do
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
- if [ x$enable_threads = x ]; then
+ if test x$enable_threads = x; then
enable_threads=$have_pthread_h
fi
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='dce'
tmake_file="${tmake_file} pa/t-dce-thr"
fi
@@ -2437,14 +2849,14 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
- if [ x$enable_threads = x ]; then
+ if test x$enable_threads = x; then
enable_threads=$have_pthread_h
fi
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='dce'
tmake_file="${tmake_file} pa/t-dce-thr"
fi
@@ -2456,7 +2868,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -2467,7 +2879,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -2479,7 +2891,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -2490,7 +2902,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -2505,7 +2917,7 @@ for machine in $build $host $target; do
i370-*-mvs*)
;;
i[34567]86-ibm-aix*) # IBM PS/2 running AIX
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=i386/aix386.h
extra_parts="crtbegin.o crtend.o"
@@ -2518,11 +2930,11 @@ for machine in $build $host $target; do
xm_defines=USG
xmake_file=i386/x-aix
;;
- i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
+ i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
xmake_file=i386/x-ncr3000
- if [ x$stabs = xyes -a x$gas = xyes ]
+ if test x$stabs = xyes -a x$gas = xyes
then
tm_file=i386/sysv4gdb.h
else
@@ -2537,13 +2949,14 @@ for machine in $build $host $target; do
tmake_file=i386/t-next
xmake_file=i386/x-next
extra_objs=nextstep.o
- if [ x$enable_threads = xyes ]; then
+ extra_parts="crtbegin.o crtend.o"
+ if test x$enable_threads = xyes; then
thread_file='mach'
fi
;;
i[34567]86-sequent-bsd*) # 80386 from Sequent
use_collect2=yes
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=i386/seq-gas.h
else
@@ -2604,7 +3017,7 @@ for machine in $build $host $target; do
i[34567]86-*-freebsdelf*)
tm_file="i386/i386.h i386/att.h linux.h i386/freebsd-elf.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=i386/t-freebsd
gas=yes
gnu_ld=yes
@@ -2613,13 +3026,15 @@ for machine in $build $host $target; do
i[34567]86-*-freebsd*)
tm_file=i386/freebsd.h
# On FreeBSD, the headers are already ok, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=i386/t-freebsd
;;
- i[34567]86-*-netbsd*)
+ # We are hoping OpenBSD is still close enough to NetBSD that we can
+ # share the configurations.
+ i[34567]86-*-netbsd* | i[34567]86-*-openbsd*)
tm_file=i386/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
i[34567]86-*-coff*)
@@ -2637,7 +3052,7 @@ for machine in $build $host $target; do
xmake_file=i386/x-isc
;;
esac
- if [ x$gas = xyes -a x$stabs = xyes ]
+ if test x$gas = xyes -a x$stabs = xyes
then
tm_file=i386/iscdbx.h
tmake_file=i386/t-svr3dbx
@@ -2650,24 +3065,23 @@ for machine in $build $host $target; do
install_headers_dir=install-headers-cpio
;;
i[34567]86-*-linux-gnuoldld*) # Intel 80386's running GNU/Linux
- # with a.out format using
# pre BFD linkers
xmake_file=x-linux-aout
tmake_file="t-linux-aout i386/t-crtstuff"
tm_file=i386/linux-oldld.h
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
+ float_format=i386
;;
i[34567]86-*-linux-gnuaout*) # Intel 80386's running GNU/Linux
- # with a.out format
xmake_file=x-linux-aout
tmake_file="t-linux-aout i386/t-crtstuff"
tm_file=i386/linux-aout.h
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
+ float_format=i386
;;
i[34567]86-*-linux-gnulibc1) # Intel 80386's running GNU/Linux
- # with ELF format using the
# GNU/Linux C library 5
xmake_file=x-linux
tm_file=i386/linux.h
@@ -2675,12 +3089,12 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
- if [ x$enable_threads = xyes ]; then
+ float_format=i386
+ if test x$enable_threads = xyes; then
thread_file='single'
fi
;;
i[34567]86-*-linux-gnu*) # Intel 80386's running GNU/Linux
- # with ELF format using glibc 2
# aka GNU/Linux C library 6
xmake_file=x-linux
tm_file=i386/linux.h
@@ -2688,7 +3102,8 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
- if [ x$enable_threads = xyes ]; then
+ float_format=i386
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -2714,7 +3129,7 @@ for machine in $build $host $target; do
gas=yes
;;
i[34567]86-*-lynxos*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=i386/lynx.h
else
@@ -2730,7 +3145,7 @@ for machine in $build $host $target; do
use_collect2=yes
;;
i[34567]86-*-osfrose*) # 386 using OSF/rose
- if [ x$elf = xyes ]
+ if test x$elf = xyes
then
tm_file=i386/osfelf.h
use_collect2=
@@ -2766,7 +3181,13 @@ for machine in $build $host $target; do
fixincludes=fixinc.sco
install_headers_dir=install-headers-cpio
tm_file=i386/sco5.h
- tmake_file=i386/t-sco5
+ if test x$gas = xyes
+ then
+ tm_file="i386/sco5gas.h ${tm_file}"
+ tmake_file=i386/t-sco5gas
+ else
+ tmake_file=i386/t-sco5
+ fi
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
;;
i[34567]86-*-sco3.2v4*) # 80386 running SCO 3.2v4 system
@@ -2775,7 +3196,7 @@ for machine in $build $host $target; do
xmake_file=i386/x-sco4
fixincludes=fixinc.sco
install_headers_dir=install-headers-cpio
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=i386/sco4dbx.h
tmake_file=i386/t-svr3dbx
@@ -2791,7 +3212,7 @@ for machine in $build $host $target; do
xm_file=i386/xm-sco.h
xmake_file=i386/x-sco
install_headers_dir=install-headers-cpio
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=i386/scodbx.h
tmake_file=i386/t-svr3dbx
@@ -2806,7 +3227,7 @@ for machine in $build $host $target; do
i[34567]86-*-solaris2*)
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=i386/sol2dbg.h
else
@@ -2819,9 +3240,9 @@ for machine in $build $host $target; do
*-*-solaris2.[0-4])
fixincludes=fixinc.svr4;;
*)
- fixincludes=fixinc.math;;
+ fixincludes=fixinc.wrap;;
esac
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='solaris'
fi
;;
@@ -2829,20 +3250,20 @@ for machine in $build $host $target; do
xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
xm_defines="USG POSIX"
tm_file=i386/sysv4.h
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
tmake_file=i386/t-crtpic
xmake_file=x-svr4
extra_parts="crtbegin.o crtend.o"
- fixincludes=Makefile.in # The headers are just fine, thank you.
+ fixincludes=fixinc.svr4
;;
i[34567]86-*-sysv4*) # Intel 80386's running system V.4
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
tm_file=i386/sysv4.h
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -2850,12 +3271,21 @@ for machine in $build $host $target; do
xmake_file=x-svr4
extra_parts="crtbegin.o crtend.o"
;;
+ i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
+ xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
+ xm_defines="USG POSIX"
+ tm_file=i386/udk.h
+ tmake_file="i386/t-crtpic i386/t-udk"
+ xmake_file=x-svr4
+ extra_parts="crtbegin.o crtend.o"
+ fixincludes="fixinc.svr4"
+ ;;
i[34567]86-*-osf1*) # Intel 80386's running OSF/1 1.3+
cpu_type=i386
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h i386/xm-osf1elf.h"
xm_defines="USE_C_ALLOCA SMALL_ARG_MAX"
fixincludes=Makefile.in #Don't do it on OSF/1
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=i386/osf1elfgdb.h
else
@@ -2868,9 +3298,9 @@ for machine in $build $host $target; do
i[34567]86-*-sysv*) # Intel 80386's running system V
xm_defines="USG SVR3"
xmake_file=i386/x-sysv3
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=i386/svr3dbx.h
tmake_file=i386/t-svr3dbx
@@ -2892,6 +3322,18 @@ for machine in $build $host $target; do
tmake_file=i386/t-vsta
xmake_file=i386/x-vsta
;;
+ i[34567]86-*-win32)
+ xm_file="${xm_file} i386/xm-cygwin32.h"
+ tmake_file=i386/t-cygwin32
+ tm_file=i386/win32.h
+ xmake_file=i386/x-cygwin32
+ extra_objs=winnt.o
+ fixincludes=Makefile.in
+ if test x$enable_threads = xyes; then
+ thread_file='win32'
+ fi
+ exeext=.exe
+ ;;
i[34567]86-*-pe | i[34567]86-*-cygwin32)
xm_file="${xm_file} i386/xm-cygwin32.h"
tmake_file=i386/t-cygwin32
@@ -2899,7 +3341,7 @@ for machine in $build $host $target; do
xmake_file=i386/x-cygwin32
extra_objs=winnt.o
fixincludes=Makefile.in
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
@@ -2907,11 +3349,11 @@ for machine in $build $host $target; do
i[34567]86-*-mingw32*)
tm_file=i386/mingw32.h
xm_file="${xm_file} i386/xm-mingw32.h"
- tmake_file=i386/t-cygwin32
+ tmake_file="i386/t-cygwin32 i386/t-mingw32"
extra_objs=winnt.o
xmake_file=i386/x-cygwin32
fixincludes=Makefile.in
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
@@ -2932,11 +3374,11 @@ for machine in $build $host $target; do
extra_host_objs="winnt.o oldnames.o"
extra_gcc_objs="spawnv.o oldnames.o"
fixincludes=fixinc.winnt
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
extra_programs=ld.exe
fi
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
;;
@@ -2959,7 +3401,7 @@ for machine in $build $host $target; do
;;
i860-*-bsd*)
tm_file="${tm_file} i860/bsd.h"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="${tm_file} i860/bsd-gas.h"
fi
@@ -3037,7 +3479,7 @@ for machine in $build $host $target; do
m68000-hp-hpux*) # HP 9000 series 300
xm_file="xm_alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
xmake_file=m68k/x-hp320g
tm_file=m68k/hp310g.h
@@ -3062,7 +3504,7 @@ for machine in $build $host $target; do
m68000-att-sysv*)
xm_file="m68k/xm-3b1.h ${xm_file}"
xm_defines=USG
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=m68k/3b1g.h
else
@@ -3078,28 +3520,30 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
extra_parts="crt1.o mcrt1.o maccrt1.o crt2.o crtn.o"
tm_file=
- if [ "$gnu_ld" = yes ]
+ if test "$gnu_ld" = yes
then
tm_file="${tm_file} m68k/auxgld.h"
else
tm_file="${tm_file} m68k/auxld.h"
fi
- if [ "$gas" = yes ]
+ if test "$gas" = yes
then
tm_file="${tm_file} m68k/auxgas.h"
else
tm_file="${tm_file} m68k/auxas.h"
fi
tm_file="${tm_file} m68k/a-ux.h"
+ float_format=m68k
;;
m68k-apollo-*)
tm_file=m68k/apollo68.h
xmake_file=m68k/x-apollo68
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-altos-sysv*) # Altos 3068
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=m68k/altos3068.h
xm_defines=USG
@@ -3110,9 +3554,9 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
;;
m68k-bull-sysv*) # Bull DPX/2
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=m68k/dpx2cdbx.h
else
@@ -3134,15 +3578,16 @@ for machine in $build $host $target; do
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-motorola-sysv*)
tm_file=m68k/mot3300.h
xm_file="xm-alloca.h m68k/xm-mot3300.h ${xm_file}"
xm_defines=NO_SYS_SIGLIST
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
xmake_file=m68k/x-mot3300-gas
- if [ x$gnu_ld = xyes ]
+ if test x$gnu_ld = xyes
then
tmake_file=m68k/t-mot3300-gald
else
@@ -3151,7 +3596,7 @@ for machine in $build $host $target; do
fi
else
xmake_file=m68k/x-mot3300
- if [ x$gnu_ld = xyes ]
+ if test x$gnu_ld = xyes
then
tmake_file=m68k/t-mot3300-gld
else
@@ -3162,6 +3607,7 @@ for machine in $build $host $target; do
gdb_needs_out_file_path=yes
extra_parts="crt0.o mcrt0.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-ncr-sysv*) # NCR Tower 32 SVR3
tm_file=m68k/tower-as.h
@@ -3199,30 +3645,35 @@ for machine in $build $host $target; do
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-ccur-rtu)
tm_file=m68k/ccur-GAS.h
xmake_file=m68k/x-ccur
extra_headers=math-68881.h
use_collect2=yes
+ float_format=m68k
;;
m68k-hp-bsd4.4*) # HP 9000/3xx running 4.4bsd
tm_file=m68k/hp3bsd44.h
xmake_file=m68k/x-hp3bsd44
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-hp-bsd*) # HP 9000/3xx running Berkeley Unix
tm_file=m68k/hp3bsd.h
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-isi-bsd*)
- if [ x$with_fp = xno ]
+ if test x$with_fp = xno
then
tm_file=m68k/isi-nfp.h
else
tm_file=m68k/isi.h
+ float_format=m68k
fi
use_collect2=yes
extra_headers=math-68881.h
@@ -3230,7 +3681,7 @@ for machine in $build $host $target; do
m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
xm_file="xm_alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
xmake_file=m68k/x-hp320g
tm_file=m68k/hp320g.h
@@ -3241,11 +3692,12 @@ for machine in $build $host $target; do
install_headers_dir=install-headers-cpio
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-hp-hpux*) # HP 9000 series 300
xm_file="xm_alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
xmake_file=m68k/x-hp320g
tm_file=m68k/hp320g.h
@@ -3256,14 +3708,16 @@ for machine in $build $host $target; do
install_headers_dir=install-headers-cpio
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-sun-mach*)
tm_file=m68k/sun3mach.h
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-sony-newsos3*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=m68k/news3gas.h
else
@@ -3271,9 +3725,10 @@ for machine in $build $host $target; do
fi
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-sony-bsd* | m68k-sony-newsos*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=m68k/newsgas.h
else
@@ -3281,6 +3736,7 @@ for machine in $build $host $target; do
fi
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-next-nextstep2*)
tm_file=m68k/next21.h
@@ -3290,6 +3746,7 @@ for machine in $build $host $target; do
extra_objs=nextstep.o
extra_headers=math-68881.h
use_collect2=yes
+ float_format=m68k
;;
m68k-next-nextstep3*)
tm_file=m68k/next.h
@@ -3297,27 +3754,31 @@ for machine in $build $host $target; do
tmake_file=m68k/t-next
xmake_file=m68k/x-next
extra_objs=nextstep.o
+ extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
- if [ x$enable_threads = xyes ]; then
+ float_format=m68k
+ if test x$enable_threads = xyes; then
thread_file='mach'
fi
;;
m68k-sun-sunos3*)
- if [ x$with_fp = xno ]
+ if test x$with_fp = xno
then
tm_file=m68k/sun3n3.h
else
tm_file=m68k/sun3o3.h
+ float_format=m68k
fi
use_collect2=yes
extra_headers=math-68881.h
;;
m68k-sun-sunos*) # For SunOS 4 (the default).
- if [ x$with_fp = xno ]
+ if test x$with_fp = xno
then
tm_file=m68k/sun3n.h
else
tm_file=m68k/sun3.h
+ float_format=m68k
fi
use_collect2=yes
extra_headers=math-68881.h
@@ -3327,19 +3788,22 @@ for machine in $build $host $target; do
tmake_file=m68k/t-vxworks68
extra_headers=math-68881.h
thread_file='vxworks'
+ float_format=m68k
;;
m68k-*-aout*)
tmake_file=m68k/t-m68kbare
tm_file="m68k/m68k-aout.h libgloss.h"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-coff*)
tmake_file=m68k/t-m68kbare
tm_file="m68k/m68k-coff.h dbx.h libgloss.h"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-lynxos*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=m68k/lynx.h
else
@@ -3349,12 +3813,14 @@ for machine in $build $host $target; do
xmake_file=x-lynx
tmake_file=m68k/t-lynx
extra_headers=math-68881.h
+ float_format=m68k
;;
- m68k-*-netbsd*)
+ m68k*-*-netbsd*)
tm_file=m68k/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
+ float_format=m68k
;;
m68k-*-sysv3*) # Motorola m68k's running system V.3
xm_file="xm-alloca.h ${xm_file}"
@@ -3362,6 +3828,7 @@ for machine in $build $host $target; do
xmake_file=m68k/x-m68kv
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-sysv4*) # Motorola m68k's running system V.4
tm_file=m68k/m68kv4.h
@@ -3370,6 +3837,7 @@ for machine in $build $host $target; do
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-linux-gnuaout*) # Motorola m68k's running GNU/Linux
# with a.out format
@@ -3378,6 +3846,7 @@ for machine in $build $host $target; do
tmake_file="t-linux-aout m68k/t-linux-aout"
fixincludes=Makefile.in # The headers are ok already.
extra_headers=math-68881.h
+ float_format=m68k
gnu_ld=yes
;;
m68k-*-linux-gnulibc1) # Motorola m68k's running GNU/Linux
@@ -3389,6 +3858,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in # The headers are ok already.
extra_headers=math-68881.h
+ float_format=m68k
gnu_ld=yes
;;
m68k-*-linux-gnu*) # Motorola m68k's running GNU/Linux
@@ -3400,8 +3870,9 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in # The headers are ok already.
extra_headers=math-68881.h
+ float_format=m68k
gnu_ld=yes
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -3409,11 +3880,13 @@ for machine in $build $host $target; do
tmake_file=m68k/t-m68kbare
tm_file=m68k/m68k-psos.h
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-rtems*)
tmake_file="m68k/t-m68kbare t-rtems"
tm_file=m68k/rtems.h
extra_headers=math-68881.h
+ float_format=m68k
;;
m88k-dg-dgux*)
@@ -3429,7 +3902,7 @@ for machine in $build $host $target; do
esac
extra_parts="crtbegin.o bcscrtbegin.o crtend.o m88kdgux.ld"
xmake_file=m88k/x-dgux
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=m88k/t-dgux-gas
fi
@@ -3440,7 +3913,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
xm_file="m88k/xm-sysv3.h ${xm_file}"
xmake_file=m88k/x-dolph
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
fi
@@ -3450,7 +3923,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
xm_file="m88k/xm-sysv3.h ${xm_file}"
xmake_file=m88k/x-tekXD88
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
fi
@@ -3465,7 +3938,7 @@ for machine in $build $host $target; do
m88k-*-luna*)
tm_file=m88k/luna.h
extra_parts="crtbegin.o crtend.o"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=m88k/t-luna-gas
else
@@ -3477,7 +3950,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
xm_file="m88k/xm-sysv3.h ${xm_file}"
xmake_file=m88k/x-sysv3
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
fi
@@ -3494,9 +3967,9 @@ for machine in $build $host $target; do
fixincludes=fixinc.irix
xmake_file=mips/x-iris6
tmake_file=mips/t-iris6
- if [ x$enable_threads = xyes ]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-wrs-vxworks)
tm_file="mips/elf.h libgloss.h"
@@ -3508,20 +3981,21 @@ for machine in $build $host $target; do
;;
mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
tm_file="mips/iris6.h mips/cross64.h"
- xm_defines="USG HAVE_INTTYPES_H"
+ xm_defines=USG
+ xm_file="mips/xm-iris5.h"
fixincludes=Makefile.in
xmake_file=mips/x-iris
tmake_file=mips/t-cross64
# See comment in mips/iris[56].h files.
use_collect2=yes
- if [ x$enable_threads = xyes ]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sni-sysv4)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file=mips/iris5gdb.h
else
@@ -3533,89 +4007,90 @@ for machine in $build $host $target; do
xm_defines=USG
xmake_file=mips/x-sni-svr4
tmake_file=mips/t-mips-gas
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-sgi-irix5*) # SGI System V.4., IRIX 5
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file="mips/iris5.h mips/iris5gas.h"
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
else
tm_file=mips/iris5.h
fi
- xm_defines="USG HAVE_INTTYPES_H"
+ xm_defines=USG
+ xm_file="mips/xm-iris5.h"
fixincludes=fixinc.irix
xmake_file=mips/x-iris
# mips-tfile doesn't work yet
tmake_file=mips/t-mips-gas
# See comment in mips/iris5.h file.
use_collect2=yes
- if [ x$enable_threads = xyes ]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sgi-irix4loser*) # Mostly like a MIPS.
tm_file="mips/iris4loser.h mips/iris3.h ${tm_file} mips/iris4.h"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-iris
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
- if [ x$enable_threads = xyes ]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sgi-irix4*) # Mostly like a MIPS.
tm_file="mips/iris3.h ${tm_file} mips/iris4.h"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-iris
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
- if [ x$enable_threads = xyes ]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sgi-*) # Mostly like a MIPS.
tm_file="mips/iris3.h ${tm_file}"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-iris3
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -3629,18 +4104,18 @@ for machine in $build $host $target; do
;;
mips-dec-osf*) # Decstation running OSF/1 as shipped by DIGITAL
tm_file=mips/dec-osf1.h
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xmake_file=mips/x-dec-osf1
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
tmake_file=mips/t-ultrix
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -3648,36 +4123,36 @@ for machine in $build $host $target; do
mips-dec-bsd*) # Decstation running 4.4 BSD
tm_file=mips/dec-bsd.h
fixincludes=
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
tmake_file=mips/t-ultrix
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-dec-netbsd*) # Decstation running NetBSD
+ mipsel-*-netbsd* | mips-dec-netbsd*) # Decstation running NetBSD
tm_file=mips/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
mips-sony-bsd* | mips-sony-newsos*) # Sony NEWS 3600 or risc/news.
tm_file="mips/news4.h ${tm_file}"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -3687,31 +4162,31 @@ for machine in $build $host $target; do
# That is based on svr4.
# t-svr4 is not right because this system doesn't use ELF.
tm_file="mips/news5.h ${tm_file}"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_file="xm-siglist.h ${xm_file}"
xm_defines=USG
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-tandem-sysv4*) # Tandem S2 running NonStop UX
tm_file="mips/svr4-5.h mips/svr4-t.h"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_file="xm-siglist.h ${xm_file}"
xm_defines=USG
xmake_file=mips/x-sysv
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
extra_parts="crtbegin.o crtend.o"
@@ -3719,151 +4194,151 @@ for machine in $build $host $target; do
tmake_file=mips/t-mips
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-ultrix* | mips-dec-mach3) # Decstation.
tm_file="mips/ultrix.h ${tm_file}"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xmake_file=mips/x-ultrix
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
tmake_file=mips/t-ultrix
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-riscos[56789]bsd*)
tm_file=mips/bsd-5.h # MIPS BSD 4.3, RISC-OS 5.0
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-bsd-gas
else
tmake_file=mips/t-bsd
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[1234]bsd*)
tm_file="mips/bsd-4.h ${tm_file}" # MIPS BSD 4.3, RISC-OS 4.0
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-bsd-gas
else
tmake_file=mips/t-bsd
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-riscos[56789]sysv4*)
tm_file=mips/svr4-5.h # MIPS System V.4., RISC-OS 5.0
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_file="xm-siglist.h ${xm_file}"
xmake_file=mips/x-sysv
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr4-gas
else
tmake_file=mips/t-svr4
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-sysv4* | mips-*-riscos[1234]sysv4* | mips-*-riscossysv4*)
tm_file="mips/svr4-4.h ${tm_file}"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-sysv
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr4-gas
else
tmake_file=mips/t-svr4
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-riscos[56789]sysv*)
tm_file=mips/svr3-5.h # MIPS System V.3, RISC-OS 5.0
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-sysv
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr3-gas
else
tmake_file=mips/t-svr3
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-sysv* | mips-*-riscos*sysv*)
tm_file="mips/svr3-4.h ${tm_file}"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-sysv
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr3-gas
else
tmake_file=mips/t-svr3
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-riscos[56789]*) # Default MIPS RISC-OS 5.0.
tm_file=mips/mips-5.h
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -3872,14 +4347,14 @@ for machine in $build $host $target; do
;;
mipsel-*-ecoff*)
tm_file=mips/ecoffl.h
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
tmake_file=mips/t-ecoff
;;
mips-*-ecoff*)
tm_file="gofast.h mips/ecoff.h"
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
tmake_file=mips/t-ecoff
@@ -3909,7 +4384,7 @@ for machine in $build $host $target; do
tmake_file=mips/t-ecoff
;;
mips64orion-*-rtems*)
- tm_file="mips/elforion.h mips/elfl64.h mips/rtems64.h"
+ tm_file="mips/elforion.h mips/elf64.h mips/rtems64.h"
tmake_file="mips/t-ecoff t-rtems"
;;
mipstx39el-*-elf*)
@@ -3919,18 +4394,20 @@ for machine in $build $host $target; do
mipstx39-*-elf*)
tm_file="mips/r3900.h mips/elf.h mips/abi64.h libgloss.h"
tmake_file=mips/t-r3900
+ # FIXME mips-elf should be fixed to use crtstuff.
+ use_collect2=yes
;;
mips-*-*) # Default MIPS RISC-OS 4.0.
- if [ x$stabs = xyes ]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [ x$gnu_ld != xyes ]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -3938,7 +4415,7 @@ for machine in $build $host $target; do
mn10200-*-*)
cpu_type=mn10200
tm_file="mn10200/mn10200.h"
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -3947,7 +4424,7 @@ for machine in $build $host $target; do
mn10300-*-*)
cpu_type=mn10300
tm_file="mn10300/mn10300.h"
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -3990,10 +4467,11 @@ for machine in $build $host $target; do
xm_defines=USG
use_collect2=yes
;;
- ns32k-pc532-netbsd*)
+ ns32k-*-netbsd*)
tm_file=ns32k/netbsd.h
+ xm_file="ns32k/xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
pdp11-*-bsd)
@@ -4025,7 +4503,7 @@ for machine in $build $host $target; do
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG POSIX"
extra_headers=ppc-asm.h
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
else
@@ -4047,7 +4525,7 @@ for machine in $build $host $target; do
;;
powerpc-*-eabi*)
tm_file=rs6000/eabi.h
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
else
@@ -4058,7 +4536,7 @@ for machine in $build $host $target; do
;;
powerpc-*-rtems*)
tm_file=rs6000/rtems.h
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm"
else
@@ -4071,7 +4549,7 @@ for machine in $build $host $target; do
tm_file=rs6000/linux.h
xm_file=rs6000/xm-sysv4.h
out_file=rs6000/rs6000.c
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
else
@@ -4081,7 +4559,7 @@ for machine in $build $host $target; do
fixincludes=Makefile.in
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_headers=ppc-asm.h
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -4090,7 +4568,7 @@ for machine in $build $host $target; do
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG ${xm_defines}"
out_file=rs6000/rs6000.c
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos t-linux rs6000/t-ppccomm"
else
@@ -4100,7 +4578,7 @@ for machine in $build $host $target; do
fixincludes=Makefile.in
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_headers=ppc-asm.h
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -4117,7 +4595,7 @@ for machine in $build $host $target; do
tm_file=rs6000/sysv4le.h
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG POSIX"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
else
@@ -4134,7 +4612,7 @@ for machine in $build $host $target; do
;;
powerpcle-*-eabi*)
tm_file=rs6000/eabile.h
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
else
@@ -4148,7 +4626,7 @@ for machine in $build $host $target; do
tmake_file=rs6000/t-winnt
# extra_objs=pe.o
fixincludes=Makefile.in
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
extra_headers=ppc-asm.h
@@ -4156,12 +4634,11 @@ for machine in $build $host $target; do
powerpcle-*-pe | powerpcle-*-cygwin32)
tm_file=rs6000/cygwin32.h
xm_file="rs6000/xm-cygwin32.h ${xm_file}"
- xm_defines=NO_STAB_H
tmake_file=rs6000/t-winnt
xmake_file=rs6000/x-cygwin32
# extra_objs=pe.o
fixincludes=Makefile.in
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
@@ -4171,7 +4648,7 @@ for machine in $build $host $target; do
tm_file=rs6000/sol2.h
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG POSIX"
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
else
@@ -4182,7 +4659,7 @@ for machine in $build $host $target; do
*-*-solaris2.[0-4])
fixincludes=fixinc.svr4;;
*)
- fixincludes=fixinc.math;;
+ fixincludes=fixinc.wrap;;
esac
extra_headers=ppc-asm.h
;;
@@ -4193,7 +4670,7 @@ for machine in $build $host $target; do
;;
rs6000-ibm-aix3.2.[456789]* | powerpc-ibm-aix3.2.[456789]*)
tm_file=rs6000/aix3newas.h
- if [ x$host != x$target ]
+ if test x$host != x$target
then
tmake_file=rs6000/t-xnewas
else
@@ -4201,15 +4678,37 @@ for machine in $build $host $target; do
fi
use_collect2=yes
;;
- rs6000-ibm-aix[456789].* | powerpc-ibm-aix[456789].*)
+ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
tm_file=rs6000/aix41.h
- if [ x$host != x$target ]
+ if test x$host != x$target
then
tmake_file=rs6000/t-xnewas
else
tmake_file=rs6000/t-newas
fi
- xmake_file=rs6000/x-aix31
+ xmake_file=rs6000/x-aix41
+ use_collect2=yes
+ ;;
+ rs6000-ibm-aix4.[3456789].* | powerpc-ibm-aix4.[3456789].*)
+ tm_file=rs6000/aix43.h
+ if test x$host != x$target
+ then
+ tmake_file=rs6000/t-xaix43
+ else
+ tmake_file=rs6000/t-aix43
+ fi
+ xmake_file=rs6000/x-aix43
+ use_collect2=yes
+ ;;
+ rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+ tm_file=rs6000/aix43.h
+ if test x$host != x$target
+ then
+ tmake_file=rs6000/t-xaix43
+ else
+ tmake_file=rs6000/t-aix43
+ fi
+ xmake_file=rs6000/x-aix43
use_collect2=yes
;;
rs6000-ibm-aix*)
@@ -4235,6 +4734,11 @@ for machine in $build $host $target; do
tm_file=sh/elf.h
float_format=sh
;;
+ sh-*-rtemself*)
+ tmake_file="sh/t-sh t-rtems"
+ tm_file=sh/rtemself.h
+ float_format=sh
+ ;;
sh-*-rtems*)
tmake_file="sh/t-sh t-rtems"
tm_file=sh/rtems.h
@@ -4261,7 +4765,7 @@ for machine in $build $host $target; do
sparc-*-netbsd*)
tm_file=sparc/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
sparc-*-bsd*)
@@ -4298,12 +4802,12 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
- if [ x$enable_threads = xyes ]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
sparc-*-lynxos*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
tm_file=sparc/lynx.h
else
@@ -4317,8 +4821,31 @@ for machine in $build $host $target; do
tmake_file="sparc/t-sparcbare t-rtems"
tm_file=sparc/rtems.h
;;
+ sparcv9-*-solaris2*)
+ tm_file=sparc/sol2-sld-64.h
+ xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
+ xm_defines="USG POSIX"
+ tmake_file="sparc/t-sol2 sparc/t-sol2-64"
+ xmake_file=sparc/x-sysv4
+ extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
+ fixincludes=fixinc.wrap
+ float_format=i128
+ if test x${enable_threads} = x ; then
+ enable_threads=$have_pthread_h
+ if test x${enable_threads} = x ; then
+ enable_threads=$have_thread_h
+ fi
+ fi
+ if test x${enable_threads} = xyes ; then
+ if test x${have_pthread_h} = xyes ; then
+ thread_file='posix'
+ else
+ thread_file='solaris'
+ fi
+ fi
+ ;;
sparc-*-solaris2*)
- if [ x$gnu_ld = xyes ]
+ if test x$gnu_ld = xyes
then
tm_file=sparc/sol2.h
else
@@ -4333,17 +4860,17 @@ for machine in $build $host $target; do
*-*-solaris2.[0-4])
fixincludes=fixinc.svr4;;
*)
- fixincludes=fixinc.math;;
+ fixincludes=fixinc.wrap;;
esac
float_format=i128
- if [ x${enable_threads} = x ]; then
+ if test x${enable_threads} = x; then
enable_threads=$have_pthread_h
- if [ x${enable_threads} = x ]; then
+ if test x${enable_threads} = x; then
enable_threads=$have_thread_h
fi
fi
- if [ x${enable_threads} = xyes ]; then
- if [ x${have_pthread_h} = xyes ]; then
+ if test x${enable_threads} = xyes; then
+ if test x${have_pthread_h} = xyes; then
thread_file='posix'
else
thread_file='solaris'
@@ -4359,7 +4886,7 @@ for machine in $build $host $target; do
tm_file=sparc/sunos4.h
tmake_file=sparc/t-sunos41
use_collect2=yes
- if [ x$gas = xyes ]; then
+ if test x$gas = xyes; then
tm_file="${tm_file} sparc/sun4gas.h"
fi
;;
@@ -4404,11 +4931,12 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
- tmake_file=sparc/t-sp64
+ tmake_file="t-linux sparc/t-linux64"
xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
fixincludes=Makefile.in # The headers are ok already.
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
;;
# This hasn't been upgraded to GCC 2.
@@ -4423,6 +4951,7 @@ for machine in $build $host $target; do
xm_file=arm/xm-thumb.h
md_file=arm/thumb.md
tmake_file=arm/t-thumb
+ fixincludes=Makefile.in # There is nothing to fix
;;
# This hasn't been upgraded to GCC 2.
# tron-*-*)
@@ -4434,7 +4963,7 @@ for machine in $build $host $target; do
tm_file="v850/v850.h"
xm_file="v850/xm-v850.h"
tmake_file=v850/t-v850
- if [ x$stabs = xyes ]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -4452,7 +4981,7 @@ for machine in $build $host $target; do
vax-*-netbsd*)
tm_file="${tm_file} netbsd.h vax/netbsd.h"
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
float_format=vax
;;
@@ -4539,9 +5068,9 @@ for machine in $build $host $target; do
;;
esac
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
- if [ "$target_cpu_default2" = "" ]
+ if test "$target_cpu_default2" = ""
then
target_cpu_default2="MASK_GAS"
else
@@ -4571,7 +5100,7 @@ for machine in $build $host $target; do
;;
*)
- if [ x$pass2done = xyes ]
+ if test x$pass2done = xyes
then
echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
exit 1
@@ -4581,9 +5110,9 @@ for machine in $build $host $target; do
;;
mips*-*-ecoff* | mips*-*-elf*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
- if [ x$gnu_ld = xyes ]
+ if test x$gnu_ld = xyes
then
target_cpu_default2=20
else
@@ -4592,7 +5121,7 @@ for machine in $build $host $target; do
fi
;;
mips*-*-*)
- if [ x$gas = xyes ]
+ if test x$gas = xyes
then
target_cpu_default2=16
fi
@@ -4615,7 +5144,7 @@ for machine in $build $host $target; do
;;
*)
- if [ x$pass2done = xyes ]
+ if test x$pass2done = xyes
then
echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
exit 1
@@ -4632,7 +5161,7 @@ for machine in $build $host $target; do
target_cpu_default2="TARGET_CPU_$with_cpu"
;;
*)
- if [ x$pass2done = xyes ]
+ if test x$pass2done = xyes
then
echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
exit 1
@@ -4642,9 +5171,9 @@ for machine in $build $host $target; do
;;
esac
- if [ "$target_cpu_default2" != "" ]
+ if test "$target_cpu_default2" != ""
then
- if [ "$target_cpu_default" != "" ]
+ if test "$target_cpu_default" != ""
then
target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
else
@@ -4653,17 +5182,19 @@ for machine in $build $host $target; do
fi
# No need for collect2 if we have the GNU linker.
- case x$gnu_ld in
- xyes)
- use_collect2=
- ;;
- esac
+ # Actually, there is now; GNU ld doesn't handle the EH info or
+ # collecting for shared libraries.
+ #case x$gnu_ld in
+ #xyes)
+ # use_collect2=
+ # ;;
+ #esac
# Save data on machine being used to compile GCC in build_xm_file.
# Save data on host machine in vars host_xm_file and host_xmake_file.
- if [ x$pass1done = x ]
+ if test x$pass1done = x
then
- if [ x"$xm_file" = x ]
+ if test x"$xm_file" = x
then build_xm_file=$cpu_type/xm-$cpu_type.h
else build_xm_file=$xm_file
fi
@@ -4672,14 +5203,14 @@ for machine in $build $host $target; do
build_exeext=$exeext
pass1done=yes
else
- if [ x$pass2done = x ]
+ if test x$pass2done = x
then
- if [ x"$xm_file" = x ]
+ if test x"$xm_file" = x
then host_xm_file=$cpu_type/xm-$cpu_type.h
else host_xm_file=$xm_file
fi
host_xm_defines=$xm_defines
- if [ x"$xmake_file" = x ]
+ if test x"$xmake_file" = x
then xmake_file=$cpu_type/x-$cpu_type
fi
host_xmake_file="$xmake_file"
@@ -4695,33 +5226,33 @@ done
extra_objs="${host_extra_objs} ${extra_objs}"
# Default the target-machine variables that were not explicitly set.
-if [ x"$tm_file" = x ]
+if test x"$tm_file" = x
then tm_file=$cpu_type/$cpu_type.h; fi
-if [ x$extra_headers = x ]
+if test x$extra_headers = x
then extra_headers=; fi
-if [ x"$xm_file" = x ]
+if test x"$xm_file" = x
then xm_file=$cpu_type/xm-$cpu_type.h; fi
-if [ x$md_file = x ]
+if test x$md_file = x
then md_file=$cpu_type/$cpu_type.md; fi
-if [ x$out_file = x ]
+if test x$out_file = x
then out_file=$cpu_type/$cpu_type.c; fi
-if [ x"$tmake_file" = x ]
+if test x"$tmake_file" = x
then tmake_file=$cpu_type/t-$cpu_type
fi
-if [ x$float_format = x ]
+if test x$float_format = x
then float_format=i64
fi
-if [ x$enable_haifa = x ]
+if test x$enable_haifa = x
then
case $target in
- alpha*-* | hppa1.?-* | powerpc*-* | rs6000-* | *sparc-* | m32r*-*)
+ alpha*-* | hppa1.?-* | powerpc*-* | rs6000-* | *sparc*-* | m32r*-*)
enable_haifa=yes;;
esac
fi
@@ -4734,7 +5265,7 @@ count=a
for f in $tm_file; do
count=${count}x
done
-if [ $count = ax ]; then
+if test $count = ax; then
echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
else
echo "Using the following target machine macro files:"
@@ -4747,7 +5278,7 @@ count=a
for f in $host_xm_file; do
count=${count}x
done
-if [ $count = ax ]; then
+if test $count = ax; then
echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
else
echo "Using the following host machine macro files:"
@@ -4756,12 +5287,12 @@ else
done
fi
-if [ "$host_xm_file" != "$build_xm_file" ]; then
+if test "$host_xm_file" != "$build_xm_file"; then
count=a
for f in $build_xm_file; do
count=${count}x
done
- if [ $count = ax ]; then
+ if test $count = ax; then
echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
else
echo "Using the following build machine macro files:"
@@ -4771,8 +5302,8 @@ if [ "$host_xm_file" != "$build_xm_file" ]; then
fi
fi
-if [ x$thread_file = x ]; then
- if [ x$target_thread_file != x ]; then
+if test x$thread_file = x; then
+ if test x$target_thread_file != x; then
thread_file=$target_thread_file
else
thread_file='single'
@@ -4790,7 +5321,7 @@ host_xm_file="auto-host.h ${host_xm_file}"
# If host=build, it is correct to have hconfig 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 [ x$host = x$build ]
+if test x$host = x$build
then
build_xm_file="auto-host.h ${build_xm_file}"
else
@@ -4822,10 +5353,10 @@ links="config.h tm.h tconfig.h hconfig.h"
defines="host_xm_defines null_defines xm_defines build_xm_defines"
rm -f config.bak
-if [ -f config.status ]; then mv -f config.status config.bak; fi
+if test -f config.status; then mv -f config.status config.bak; fi
# Make the links.
-while [ -n "$vars" ]
+while test -n "$vars"
do
set $vars; var=$1; shift; vars=$*
set $links; link=$1; shift; links=$*
@@ -4835,7 +5366,7 @@ do
# Define TARGET_CPU_DEFAULT if the system wants one.
# This substitutes for lots of *.h files.
- if [ "$target_cpu_default" != "" -a $link = tm.h ]
+ if test "$target_cpu_default" != "" -a $link = tm.h
then
echo "#define TARGET_CPU_DEFAULT ($target_cpu_default)" >>$link
fi
@@ -4852,12 +5383,17 @@ do
done
# Truncate the target if necessary
-if [ x$host_truncate_target != x ]; then
+if test x$host_truncate_target != x; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
fi
-# Get the version number from the toplevel
-version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${srcdir}/version.c`
+# Get the version trigger filename from the toplevel
+if test "${with_gcc_version_trigger+set}" = set; then
+ gcc_version_trigger=$with_gcc_version_trigger
+else
+ gcc_version_trigger=${srcdir}/version.c
+fi
+gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}`
# Get an absolute path to the GCC top-level source directory
holddir=`pwd`
@@ -4872,7 +5408,7 @@ host_overrides=Make-host
dep_host_xmake_file=
for f in .. ${host_xmake_file}
do
- if [ -f ${srcdir}/config/$f ]
+ if test -f ${srcdir}/config/$f
then
dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
fi
@@ -4885,7 +5421,7 @@ target_overrides=Make-target
dep_tmake_file=
for f in .. ${tmake_file}
do
- if [ -f ${srcdir}/config/$f ]
+ if test -f ${srcdir}/config/$f
then
dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
fi
@@ -4946,7 +5482,7 @@ done
# Also use all.cross instead of all.internal
# and add cross-make to Makefile.
cross_overrides="/dev/null"
-if [ x$host != x$target ]
+if test x$host != x$target
then
cross_defines="CROSS=-DCROSS_COMPILE"
cross_overrides="${topdir}/cross-make"
@@ -4956,7 +5492,7 @@ fi
# This must come after cross-make as we want all.build to override
# all.cross.
build_overrides="/dev/null"
-if [ x$build != x$host ]
+if test x$build != x$host
then
build_overrides="${topdir}/build-make"
fi
@@ -4964,7 +5500,7 @@ fi
# Expand extra_headers to include complete path.
# This substitutes for lots of t-* files.
extra_headers_list=
-if [ "x$extra_headers" = x ]
+if test "x$extra_headers" = x
then true
else
# Prepend ${srcdir}/ginclude/ to every entry in extra_headers.
@@ -4974,10 +5510,14 @@ else
done
fi
+if test x$use_collect2 = xno; then
+ use_collect2=
+fi
+
# Add a definition of USE_COLLECT2 if system wants one.
# Also tell toplev.c what to do.
# This substitutes for lots of t-* files.
-if [ x$use_collect2 = x ]
+if test x$use_collect2 = x
then
will_use_collect2=
maybe_use_collect2=
@@ -4993,7 +5533,7 @@ fi
# building gcc with a cross compiler, use the cross compiler just
# built. Otherwise, we can use the cpp just built.
md_file_sub=
-if [ "x$md_cppflags" = x ]
+if test "x$md_cppflags" = x
then
md_file_sub=$srcdir/config/$md_file
else
@@ -5001,19 +5541,136 @@ else
fi
# If we have gas in the build tree, make a link to it.
-if [ -f ../gas/Makefile ]; then
+if test -f ../gas/Makefile; then
rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
fi
+# If we have nm in the build tree, make a link to it.
+if test -f ../binutils/Makefile; then
+ rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
+fi
+
# If we have ld in the build tree, make a link to it.
-if [ -f ../ld/Makefile ]; then
-# if [[ x$use_collect2 = x ]]; then
+if test -f ../ld/Makefile; then
+# if test x$use_collect2 = x; then
# rm -f ld; $symbolic_link ../ld/ld-new$host_exeext ld$host_exeext 2>/dev/null
# else
rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
# fi
fi
+# Figure out what assembler alignment features are present.
+echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
+echo "configure:5565: checking assembler alignment features" >&5
+gcc_cv_as=
+gcc_cv_as_alignment_features=
+gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+if test -x "$AS"; then
+ gcc_cv_as=$AS
+elif test -x as$host_exeext; then
+ # Build using assembler in the current directory.
+ gcc_cv_as=./as$host_exeext
+elif test -f $gcc_cv_as_gas_srcdir/configure.in; then
+ # Single tree build which includes gas.
+ for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
+ do
+ gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
+ if test x$gcc_cv_gas_version != x; then
+ break
+ fi
+ done
+ gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
+ gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
+ 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.
+ # bytes to skip when using .p2align.
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
+ gcc_cv_as_alignment_features=".balign and .p2align"
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
+EOF
+
+ fi
+ # Gas version 2.8 and later support specifying the maximum
+ # bytes to skip when using .p2align.
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
+ gcc_cv_as_alignment_features=".p2align including maximum skip"
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
+EOF
+
+ fi
+ fi
+elif test x$host = x$target; then
+ # Native build.
+ gcc_cv_as=as$host_exeext
+fi
+if test x$gcc_cv_as != x; then
+ # Check if we have .balign and .p2align
+ echo ".balign 4" > conftest.s
+ echo ".p2align 2" >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_alignment_features=".balign and .p2align"
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
+EOF
+
+ fi
+ rm -f conftest.s conftest.o
+ # Check if specifying the maximum bytes to skip when
+ # using .p2align is supported.
+ echo ".p2align 4,,7" > conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_alignment_features=".p2align including maximum skip"
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
+EOF
+
+ fi
+ rm -f conftest.s conftest.o
+fi
+echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
+
+echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
+echo "configure:5636: checking assembler subsection support" >&5
+gcc_cv_as_subsections=
+if test x$gcc_cv_as != x; then
+ # Check if we have .subsection
+ echo ".subsection 1" > conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_subsections=".subsection"
+ if test -x nm$host_exeext; then
+ gcc_cv_nm=./nm$host_exeext
+ elif test x$host = x$target; then
+ # Native build.
+ gcc_cv_nm=nm$host_exeext
+ fi
+ if test x$gcc_cv_nm != x; then
+ cat > conftest.s <<EOF
+conftest_label1: .word 0
+.subsection -1
+conftest_label2: .word 0
+.previous
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
+ $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
+ if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
+ :
+ else
+ gcc_cv_as_subsections="working .subsection -1"
+ cat >> confdefs.h <<\EOF
+#define HAVE_GAS_SUBSECTION_ORDERING 1
+EOF
+
+ fi
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+fi
+echo "$ac_t""$gcc_cv_as_subsections" 1>&6
+
# Figure out what language subdirectories are present.
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
@@ -5022,6 +5679,11 @@ do
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
+ ${srcdir}/ada/config-lang.in)
+ if test x$gnat = xyes ; then
+ subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
+ fi
+ ;;
${srcdir}/[*]/config-lang.in) ;;
*) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" ;;
esac
@@ -5029,7 +5691,7 @@ done
# Make gthr-default.h if we have a thread file.
gthread_flags=
-if [ $thread_file != single ]; then
+if test $thread_file != single; then
rm -f gthr-default.h
echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
gthread_flags=-DHAVE_GTHR_DEFAULT
@@ -5041,18 +5703,23 @@ fi
lang_specs_files=
lang_options_files=
-rm -f specs.h options.h
-touch specs.h options.h
+lang_tree_files=
+rm -f specs.h options.h gencheck.h
+touch specs.h options.h gencheck.h
for subdir in . $subdirs
do
- if [ -f $srcdir/$subdir/lang-specs.h ]; then
+ if test -f $srcdir/$subdir/lang-specs.h; then
echo "#include \"$subdir/lang-specs.h\"" >>specs.h
lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
fi
- if [ -f $srcdir/$subdir/lang-options.h ]; then
+ if test -f $srcdir/$subdir/lang-options.h; then
echo "#include \"$subdir/lang-options.h\"" >>options.h
lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
fi
+ if test -f $srcdir/$subdir/$subdir-tree.def; then
+ echo "#include \"$subdir/$subdir-tree.def\"" >>gencheck.h
+ lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
+ fi
done
# These (without "all_") are set in each config-lang.in.
@@ -5081,7 +5748,7 @@ oldstyle_subdirs=
for s in .. $subdirs
do
- if [ $s != ".." ]
+ if test $s != ".."
then
language=
boot_language=
@@ -5092,14 +5759,14 @@ do
outputs=
lib2funcs=
. ${srcdir}/$s/config-lang.in
- if [ "x$language" = x ]
+ if test "x$language" = x
then
echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
exit 1
fi
all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in ${srcdir}/$s/Makefile.in"
all_languages="$all_languages $language"
- if [ "x$boot_language" = xyes ]
+ if test "x$boot_language" = xyes
then
all_boot_languages="$all_boot_languages $language"
fi
@@ -5108,7 +5775,7 @@ do
all_diff_excludes="$all_diff_excludes $diff_excludes"
all_headers="$all_headers $headers"
all_outputs="$all_outputs $outputs"
- if [ x$outputs = x ]
+ if test x$outputs = x
then
oldstyle_subdirs="$oldstyle_subdirs $s"
fi
@@ -5132,7 +5799,7 @@ do
x=
for l in .. $all_languages
do
- if [ $l != ".." ]; then
+ if test $l != ".."; then
x="$x $l.$t"
fi
done
@@ -5141,14 +5808,14 @@ done
# If we're not building in srcdir, create .gdbinit.
-if [ ! -f Makefile.in ]; then
+if test ! -f Makefile.in; then
echo "dir ." > .gdbinit
echo "dir ${srcdir}" >> .gdbinit
- if [ x$gdb_needs_out_file_path = xyes ]
+ if test x$gdb_needs_out_file_path = xyes
then
echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
fi
- if [ "x$subdirs" != x ]; then
+ if test "x$subdirs" != x; then
for s in $subdirs
do
echo "dir ${srcdir}/$s" >> .gdbinit
@@ -5157,12 +5824,24 @@ if [ ! -f Makefile.in ]; then
echo "source ${srcdir}/.gdbinit" >> .gdbinit
fi
+# Define variables host_canonical and build_canonical
+# because some Cygnus local changes in the Makefile depend on them.
+build_canonical=${build}
+host_canonical=${host}
+target_subdir=
+if test "${host}" != "${target}" ; then
+ target_subdir=${target}/
+fi
+
+
+
+
# If this is using newlib, then define inhibit_libc in
# LIBGCC2_CFLAGS. This will cause __eprintf to be left out of
# libgcc.a, but that's OK because newib should have its own version of
# assert.h.
inhibit_libc=
-if [ x$with_newlib = xyes ]; then
+if test x$with_newlib = xyes; then
inhibit_libc=-Dinhibit_libc
fi
@@ -5170,23 +5849,35 @@ fi
# Override SCHED_OBJ and SCHED_CFLAGS to enable the Haifa scheduler.
sched_prefix=
sched_cflags=
-if [ x$enable_haifa = xyes ]; then
+if test x$enable_haifa = xyes; then
echo "Using the Haifa scheduler."
sched_prefix=haifa-
sched_cflags=-DHAIFA
fi
-if [ x$enable_haifa != x ]; then
+if test x$enable_haifa != x; then
# Explicitly remove files that need to be recompiled for the Haifa scheduler.
for x in genattrtab.o toplev.o loop.o unroll.o *sched.o; do
- if [ -f $x ]; then
+ if test -f $x; then
echo "Removing $x"
rm -f $x
fi
done
fi
+# Warn if using init_priority.
+echo $ac_n "checking whether to enable init_priority by default""... $ac_c" 1>&6
+echo "configure:5872: checking whether to enable init_priority by default" >&5
+if test x$enable_init_priority != xyes; then
+ enable_init_priority=no
+fi
+echo "$ac_t""$enable_init_priority" 1>&6
+
+# Nothing to do for FLOAT_H, float_format already handled.
+objdir=`pwd`
+
+
# Process the language and host/target makefile fragments.
${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
@@ -5242,8 +5933,14 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
+
+
+
+
+
+
# Echo that links are built
-if [ x$host = x$target ]
+if test x$host = x$target
then
str1="native "
else
@@ -5251,25 +5948,25 @@ else
str2=" from $host"
fi
-if [ x$host != x$build ]
+if test x$host != x$build
then
str3=" on a $build system"
fi
-if [ "x$str2" != x ] || [ "x$str3" != x ]
+if test "x$str2" != x || test "x$str3" != x
then
str4=
fi
echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
-if [ "x$str2" != x ] || [ "x$str3" != x ]
+if test "x$str2" != x || test "x$str3" != x
then
echo " ${str2}${str3}." 1>&2
fi
# Truncate the target if necessary
-if [ x$host_truncate_target != x ]; then
+if test x$host_truncate_target != x; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
fi
@@ -5301,7 +5998,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ case `(ac_space=' '; set) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -5368,7 +6065,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ echo "$CONFIG_STATUS generated by autoconf version 2.12"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -5387,7 +6084,6 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
-s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
@@ -5425,6 +6121,7 @@ s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@CC@%$CC%g
+s%@stage1_warn_cflags@%$stage1_warn_cflags%g
s%@SET_MAKE@%$SET_MAKE%g
s%@AWK@%$AWK%g
s%@LEX@%$LEX%g
@@ -5437,14 +6134,19 @@ s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
+s%@gnat@%$gnat%g
s%@vfprintf@%$vfprintf%g
s%@doprint@%$doprint%g
s%@manext@%$manext%g
s%@objext@%$objext%g
s%@gthread_flags@%$gthread_flags%g
+s%@build_canonical@%$build_canonical%g
+s%@host_canonical@%$host_canonical%g
+s%@target_subdir@%$target_subdir%g
s%@inhibit_libc@%$inhibit_libc%g
s%@sched_prefix@%$sched_prefix%g
s%@sched_cflags@%$sched_cflags%g
+s%@objdir@%$objdir%g
s%@subdirs@%$subdirs%g
s%@all_languages@%$all_languages%g
s%@all_boot_languages@%$all_boot_languages%g
@@ -5454,10 +6156,13 @@ s%@all_stagestuff@%$all_stagestuff%g
s%@all_diff_excludes@%$all_diff_excludes%g
s%@all_lib2funcs@%$all_lib2funcs%g
s%@all_headers@%$all_headers%g
+s%@cpp_main@%$cpp_main%g
s%@extra_passes@%$extra_passes%g
s%@extra_programs@%$extra_programs%g
s%@extra_parts@%$extra_parts%g
s%@extra_c_objs@%$extra_c_objs%g
+s%@extra_cxx_objs@%$extra_cxx_objs%g
+s%@extra_cpp_objs@%$extra_cpp_objs%g
s%@extra_c_flags@%$extra_c_flags%g
s%@extra_objs@%$extra_objs%g
s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
@@ -5472,8 +6177,11 @@ s%@build_xm_file_list@%$build_xm_file_list%g
s%@host_xm_file_list@%$host_xm_file_list%g
s%@lang_specs_files@%$lang_specs_files%g
s%@lang_options_files@%$lang_options_files%g
+s%@lang_tree_files@%$lang_tree_files%g
s%@thread_file@%$thread_file%g
-s%@version@%$version%g
+s%@objc_boehm_gc@%$objc_boehm_gc%g
+s%@gcc_version@%$gcc_version%g
+s%@gcc_version_trigger@%$gcc_version_trigger%g
s%@local_prefix@%$local_prefix%g
s%@gxx_include_dir@%$gxx_include_dir%g
s%@fixincludes@%$fixincludes%g
@@ -5720,7 +6428,8 @@ host_xmake_file='${host_xmake_file}'
dep_tmake_file='${dep_tmake_file}'
tmake_file='${tmake_file}'
thread_file='${thread_file}'
-version='${version}'
+gcc_version='${gcc_version}'
+gcc_version_trigger='${gcc_version_trigger}'
local_prefix='${local_prefix}'
build_install_headers_dir='${build_install_headers_dir}'
build_exeext='${build_exeext}'
@@ -5749,9 +6458,9 @@ esac
# FLAGS_TO_PASS has been modified to solve the problem there.
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
-if [ "$symbolic_link" = "ln -s" ]; then
+if test "$symbolic_link" = "ln -s"; then
for d in .. ${subdirs} ; do
- if [ $d != .. ]; then
+ if test $d != ..; then
STARTDIR=`pwd`
cd $d
for t in stage1 stage2 stage3 stage4 include
diff --git a/gcc/configure.in b/gcc/configure.in
index b403cdd63cd..ceab2a8e7d9 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -29,6 +29,59 @@ hard_link=ln
symbolic_link='ln -s'
copy=cp
+# Check for bogus environment variables.
+# Test if LIBRARY_PATH contains the notation for the current directory
+# since this would lead to problems installing/building glibc.
+# LIBRARY_PATH contains the current directory if one of the following
+# is true:
+# - one of the terminals (":" and ";") is the first or last sign
+# - two terminals occur directly after each other
+# - the path contains an element with a dot in it
+AC_MSG_CHECKING(LIBRARY_PATH variable)
+changequote(,)dnl
+case ${LIBRARY_PATH} in
+ [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
+ library_path_setting="contains current directory"
+ ;;
+ *)
+ library_path_setting="ok"
+ ;;
+esac
+changequote([,])dnl
+AC_MSG_RESULT($library_path_setting)
+if test "$library_path_setting" != "ok"; then
+AC_MSG_ERROR([
+*** LIBRARY_PATH shouldn't contain the current directory when
+*** building egcs. Please change the environment variable
+*** and run configure again.])
+fi
+
+# Test if GCC_EXEC_PREFIX contains the notation for the current directory
+# since this would lead to problems installing/building glibc.
+# GCC_EXEC_PREFIX contains the current directory if one of the following
+# is true:
+# - one of the terminals (":" and ";") is the first or last sign
+# - two terminals occur directly after each other
+# - the path contains an element with a dot in it
+AC_MSG_CHECKING(GCC_EXEC_PREFIX variable)
+changequote(,)dnl
+case ${GCC_EXEC_PREFIX} in
+ [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
+ gcc_exec_prefix_setting="contains current directory"
+ ;;
+ *)
+ gcc_exec_prefix_setting="ok"
+ ;;
+esac
+changequote([,])dnl
+AC_MSG_RESULT($gcc_exec_prefix_setting)
+if test "$gcc_exec_prefix_setting" != "ok"; then
+AC_MSG_ERROR([
+*** GCC_EXEC_PREFIX shouldn't contain the current directory when
+*** building egcs. Please change the environment variable
+*** and run configure again.])
+fi
+
# Check for additional parameters
# With GNU ld
@@ -37,12 +90,37 @@ AC_ARG_WITH(gnu-ld,
gnu_ld_flag="$with_gnu_ld",
gnu_ld_flag=no)
+# With pre-defined ld
+AC_ARG_WITH(ld,
+[ --with-ld arrange to use the specified ld (full pathname).],
+LD="$with_ld")
+if test x"${LD+set}" = x"set"; then
+ if test ! -x "$LD"; then
+ AC_MSG_WARN([cannot execute: $LD: check --with-ld or env. var. LD])
+ elif test "GNU" = `$LD -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
+ gnu_ld_flag=yes
+ fi
+ AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$LD")
+fi
+
# With GNU as
AC_ARG_WITH(gnu-as,
[ --with-gnu-as arrange to work with GNU as.],
gas_flag="$with_gnu_as",
gas_flag=no)
+AC_ARG_WITH(as,
+[ --with-as arrange to use the specified as (full pathname).],
+AS="$with_as")
+if test x"${AS+set}" = x"set"; then
+ if test ! -x "$AS"; then
+ AC_MSG_WARN([cannot execute: $AS: check --with-as or env. var. AS])
+ elif test "GNU" = `$AS -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
+ gas_flag=yes
+ fi
+ AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$AS")
+fi
+
# With stabs
AC_ARG_WITH(stabs,
[ --with-stabs arrange to use stabs instead of host debug format.],
@@ -56,56 +134,106 @@ elf="$with_elf",
elf=no)
# Specify the local prefix
+local_prefix=
AC_ARG_WITH(local-prefix,
[ --with-local-prefix=DIR specifies directory to put local include.],
-local_prefix=$with_local_prefix,
-local_prefix=/usr/local)
+[case "${withval}" in
+yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
+no) ;;
+*) local_prefix=$with_local_prefix ;;
+esac])
# Default local prefix if it is empty
-if [[ x$local_prefix = x ]]; then
+if test x$local_prefix = x; then
local_prefix=/usr/local
fi
+gxx_include_dir=
# Specify the g++ header file directory
AC_ARG_WITH(gxx-include-dir,
[ --with-gxx-include-dir=DIR
specifies directory to put g++ header files.],
-gxx_include_dir=$with_gxx_include_dir,
-gxx_include_dir='${prefix}/include/g++')
+[case "${withval}" in
+yes) AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;;
+no) ;;
+*) gxx_include_dir=$with_gxx_include_dir ;;
+esac])
-# Default g++ header file directory if it is empty
-if [[ x$gxx_include_dir = x ]]; then
- gxx_include_dir='${prefix}/include/g++'
+if test x${gxx_include_dir} = x; then
+ if test x${enable_version_specific_runtime_libs} = xyes; then
+ gxx_include_dir='${libsubdir}/include/g++'
+ else
+ topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
+ gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
+ fi
fi
-# Enable use of cpplib for C.
+# Enable expensive internal checks
+AC_ARG_ENABLE(checking,
+[ --enable-checking enable expensive run-time checks.],
+[case "${enableval}" in
+yes) AC_DEFINE(ENABLE_CHECKING) ;;
+no) ;;
+*) AC_MSG_ERROR(bad value ${enableval} given for checking option) ;;
+esac])
+
+# Use cpplib+cppmain for the preprocessor, but don't link it with the compiler.
+cpp_main=cccp
+AC_ARG_ENABLE(cpplib,
+[ --enable-cpplib use cpplib for the C preprocessor.],
+if test x$enable_cpplib != xno; then
+ cpp_main=cppmain
+fi)
+
+# Link cpplib into the compiler proper, for C/C++/ObjC.
AC_ARG_ENABLE(c-cpplib,
-[ --enable-c-cpplib Use cpplib for C.],
-if [[[ x$enable_c_cpplib != xno ]]]; then
+[ --enable-c-cpplib link cpplib directly into C and C++ compilers
+ (implies --enable-cpplib).],
+if test x$enable_c_cpplib != xno; then
extra_c_objs="${extra_c_objs} cpplib.o cppexp.o cpphash.o cpperror.o"
+ extra_c_objs="${extra_c_objs} prefix.o"
+ extra_cxx_objs="${extra_cxx_objs} ../cpplib.o ../cppexp.o ../cpphash.o ../cpperror.o ../prefix.o"
extra_c_flags=-DUSE_CPPLIB=1
+ cpp_main=cppmain
+fi)
+
+# Enable Multibyte Characters for C/C++
+AC_ARG_ENABLE(c-mbchar,
+[ --enable-c-mbchar enable multibyte characters for C and C++.],
+if test x$enable_c_mbchar != xno; then
+ extra_c_flags=-DMULTIBYTE_CHARS=1
fi)
# Enable Haifa scheduler.
AC_ARG_ENABLE(haifa,
-[ --enable-haifa Use the experimental scheduler.
- --disable-haifa Don't use the experimental scheduler for the
+[ --enable-haifa use the experimental scheduler.
+ --disable-haifa don't use the experimental scheduler for the
targets which normally enable it.])
# Fast fixincludes
#
# This is a work in progress...
AC_ARG_WITH(fast-fixincludes,
-[ --with-fast-fixincludes Use a faster fixinclude program. Experimental],
+[ --with-fast-fixincludes use a faster fixinclude program (experimental)],
fast_fixinc="$with_fast_fixincludes",
fast_fixinc=no)
+# Enable init_priority.
+AC_ARG_ENABLE(init-priority,
+[ --enable-init-priority use attributes to assign initialization order
+ for static objects.
+ --disable-init-priority conform to ISO C++ rules for ordering static objects
+ (i.e. initialized in order of declaration). ],
+if test x$enable_init_priority != xno; then
+ extra_c_flags=-DUSE_INIT_PRIORITY
+fi)
+
# Enable threads
# Pass with no value to take the default
# Pass with a value to specify a thread package
AC_ARG_ENABLE(threads,
[ --enable-threads enable thread usage for target GCC.
--enable-threads=LIB use LIB thread package for target GCC.],
-if [[[ x$enable_threads = xno ]]]; then
+if test x$enable_threads = xno; then
enable_threads=''
fi,
enable_threads='')
@@ -131,30 +259,78 @@ case x${enable_threads_flag} in
;;
esac
+AC_ARG_ENABLE(objc-gc,
+[ --enable-objc-gc enable the use of Boehm's garbage collector with
+ the GNU Objective-C runtime.],
+if [[[ x$enable_objc_gc = xno ]]]; then
+ objc_boehm_gc=''
+else
+ objc_boehm_gc=1
+fi,
+objc_boehm_gc='')
+
# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM
# Find the native compiler
AC_PROG_CC
+
+# If the native compiler is GCC, we can enable warnings even in stage1.
+# That's useful for people building cross-compilers, or just running a
+# quick `make'.
+if test "x$GCC" = "xyes"; then
+ stage1_warn_cflags='$(WARN_CFLAGS)'
+else
+ stage1_warn_cflags=""
+fi
+AC_SUBST(stage1_warn_cflags)
+
AC_PROG_MAKE_SET
+AC_MSG_CHECKING([whether a default assembler was specified])
+if test x"${AS+set}" = x"set"; then
+ if test x"$with_gas" = x"no"; then
+ AC_MSG_RESULT([yes ($AS)])
+ else
+ AC_MSG_RESULT([yes ($AS - GNU as)])
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
+AC_MSG_CHECKING([whether a default linker was specified])
+if test x"${LD+set}" = x"set"; then
+ if test x"$with_gnu_ld" = x"no"; then
+ AC_MSG_RESULT([yes ($LD)])
+ else
+ AC_MSG_RESULT([yes ($LD - GNU ld)])
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
# Find some useful tools
AC_PROG_AWK
AC_PROG_LEX
GCC_PROG_LN
GCC_PROG_LN_S
+GCC_C_VOLATILE
AC_PROG_RANLIB
AC_PROG_YACC
EGCS_PROG_INSTALL
AC_HEADER_STDC
AC_HEADER_TIME
+GCC_HEADER_STRING
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h wait.h sys/wait.h)
# Check for thread headers.
AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
+# See if GNAT has been installed
+AC_CHECK_PROG(gnat, gnatbind, yes, no)
+
# See if the system preprocessor understands the ANSI C preprocessor
# stringification operator.
AC_MSG_CHECKING(whether cpp understands the stringify operator)
@@ -183,13 +359,24 @@ AC_MSG_RESULT($gcc_cv_header_inttypes_h)
AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \
index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \
- sysconf isascii)
+ sysconf isascii gettimeofday strsignal)
+
+# Make sure wchar_t is available
+#AC_CHECK_TYPE(wchar_t, unsigned int)
GCC_FUNC_VFPRINTF_DOPRNT
GCC_FUNC_PRINTF_PTR
GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
- index rindex getenv atol sbrk abort atof)
+ index rindex getenv atol sbrk abort atof strerror getcwd getwd \
+ strsignal)
+
+GCC_NEED_DECLARATIONS(getrlimit setrlimit, [
+#include <sys/types.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+])
AC_DECL_SYS_SIGLIST
@@ -232,7 +419,7 @@ for machine in $build $host $target; do
# Set this to override the default target model.
target_cpu_default=
# Set this to control which fixincludes program to use.
- if [[ x$fast_fixinc != xyes ]] ; then
+ if test x$fast_fixinc != xyes; then
fixincludes=fixincludes
else fixincludes=fixinc.sh ; fi
# Set this to control how the header file directory is installed.
@@ -268,7 +455,9 @@ for machine in $build $host $target; do
c*-convex-*)
cpu_type=convex
;;
- i[[34567]]86-*-*)
+changequote(,)dnl
+ i[34567]86-*-*)
+changequote([,])dnl
cpu_type=i386
;;
hppa*-*-*)
@@ -297,7 +486,7 @@ for machine in $build $host $target; do
# Set the default macros to define for GNU/Linux systems.
case $machine in
*-*-linux-gnu*)
- xm_defines="HAVE_ATEXIT POSIX NO_STAB_H BSTRING"
+ xm_defines="HAVE_ATEXIT POSIX BSTRING"
;;
esac
@@ -308,11 +497,11 @@ for machine in $build $host $target; do
rest=`echo $machine | sed -e "s/$cpu_type-//"`
xm_file=${cpu_type}/xm-$rest.h
tm_file=${cpu_type}/$rest.h
- if [[ -f $srcdir/config/${cpu_type}/x-$rest ]] ; \
+ if test -f $srcdir/config/${cpu_type}/x-$rest; \
then xmake_file=${cpu_type}/x-$rest; \
else true; \
fi
- if [[ -f $srcdir/config/${cpu_type}/t-$rest ]] ; \
+ if test -f $srcdir/config/${cpu_type}/t-$rest; \
then tmake_file=${cpu_type}/t-$rest; \
else true; \
fi
@@ -340,43 +529,51 @@ for machine in $build $host $target; do
;;
alpha*-*-linux-gnuecoff*)
tm_file="${tm_file} alpha/linux-ecoff.h alpha/linux.h"
- xm_defines=USE_BFD
target_cpu_default="MASK_GAS"
gas=no
xmake_file=none
gas=yes gnu_ld=yes
;;
alpha*-*-linux-gnulibc1*)
- tm_file="${tm_file} alpha/elf.h alpha/linux-elf.h alpha/linux.h"
- xm_defines=USE_BFD
+ tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe"
extra_parts="crtbegin.o crtend.o"
+ fixincludes=fixinc.wrap
xmake_file=none
gas=yes gnu_ld=yes
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
alpha*-*-linux-gnu*)
- tm_file="${tm_file} alpha/linux.h alpha/elf.h"
- xm_defines=USE_BFD
+ tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="t-linux alpha/t-linux alpha/t-crtbe"
extra_parts="crtbegin.o crtend.o"
xmake_file=none
fixincludes=Makefile.in
gas=yes gnu_ld=yes
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
+ alpha*-*-netbsd*)
+ tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsdl-elf.h"
+ target_cpu_default="MASK_GAS"
+ tmake_file="alpha/t-crtbe"
+ extra_parts="crtbegin.o crtend.o"
+ xmake_file=none
+ fixincludes=fixinc.wrap
+ gas=yes gnu_ld=yes
+ ;;
+
alpha*-dec-osf*)
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
- if [[ x$gas != xyes ]]
+ if test x$gas != xyes
then
extra_passes="mips-tfile mips-tdump"
fi
@@ -385,7 +582,9 @@ for machine in $build $host $target; do
*-*-osf1*)
tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h"
;;
- *-*-osf[[23]]*)
+changequote(,)dnl
+ *-*-osf[23]*)
+changequote([,])dnl
tm_file="${tm_file} alpha/osf.h alpha/osf2or3.h"
;;
*-*-osf4*)
@@ -396,11 +595,21 @@ for machine in $build $host $target; do
;;
esac
case $machine in
- *-*-osf4.0[[b-z]] | *-*-osf4.[[1-9]]*)
+changequote(,)dnl
+ *-*-osf4.0[b-z] | *-*-osf4.[1-9]*)
+changequote([,])dnl
target_cpu_default=MASK_SUPPORT_ARCH
;;
esac
;;
+ alpha*-*-vxworks*)
+ tm_file="${tm_file} dbx.h alpha/vxworks.h"
+ if [ x$gas != xyes ]
+ then
+ extra_passes="mips-tfile mips-tdump"
+ fi
+ use_collect2=yes
+ ;;
alpha*-*-winnt*)
tm_file="${tm_file} alpha/win-nt.h"
xm_file="${xm_file} config/winnt/xm-winnt.h alpha/xm-winnt.h"
@@ -409,11 +618,11 @@ for machine in $build $host $target; do
extra_host_objs=oldnames.o
extra_gcc_objs="spawnv.o oldnames.o"
fixincludes=fixinc.winnt
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
extra_programs=ld.exe
fi
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
;;
@@ -430,12 +639,14 @@ for machine in $build $host $target; do
tm_file=arm/coff.h
tmake_file=arm/t-bare
;;
- arm-*-riscix1.[[01]]*) # Acorn RISC machine (early versions)
+changequote(,)dnl
+ arm-*-riscix1.[01]*) # Acorn RISC machine (early versions)
+changequote([,])dnl
tm_file=arm/riscix1-1.h
use_collect2=yes
;;
arm-*-riscix*) # Acorn RISC machine
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=arm/rix-gas.h
else
@@ -455,12 +666,12 @@ for machine in $build $host $target; do
tmake_file=arm/t-semiaof
fixincludes=Makefile.in # There is nothing to fix
;;
- arm-*-netbsd*)
+ arm*-*-netbsd*)
tm_file=arm/netbsd.h
- xm_file="xm-siglist.h ${xm_file}"
+ xm_file="arm/xm-netbsd.h ${xm_file}"
tmake_file="t-netbsd arm/t-netbsd"
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
;;
arm-*-linux-gnuaout*) # ARM GNU/Linux
cpu_type=arm
@@ -499,6 +710,10 @@ for machine in $build $host $target; do
use_collect2=yes
fixincludes=Makefile.in
;;
+ c4x-*)
+ cpu_type=c4x
+ tmake_file=c4x/t-c4x
+ ;;
clipper-intergraph-clix*)
tm_file="${tm_file} svr3.h clipper/clix.h"
xm_file=clipper/xm-clix.h
@@ -552,18 +767,20 @@ for machine in $build $host $target; do
tm_file="pa/pa-oldas.h ${tm_file} pa/pa-hpux7.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/gas.h"
fi
install_headers_dir=install-headers-cpio
use_collect2=yes
;;
- hppa1.0-*-hpux8.0[[0-2]]*)
+changequote(,)dnl
+ hppa1.0-*-hpux8.0[0-2]*)
+changequote([,])dnl
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
else
@@ -572,12 +789,14 @@ for machine in $build $host $target; do
install_headers_dir=install-headers-cpio
use_collect2=yes
;;
- hppa1.1-*-hpux8.0[[0-2]]*)
+changequote(,)dnl
+ hppa1.1-*-hpux8.0[0-2]*)
+changequote([,])dnl
target_cpu_default=1
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
else
@@ -591,7 +810,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -602,7 +821,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -615,14 +834,14 @@ for machine in $build $host $target; do
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
- if [[ x$enable_threads = x ]]; then
+ if test x$enable_threads = x; then
enable_threads=$have_pthread_h
fi
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='dce'
tmake_file="${tmake_file} pa/t-dce-thr"
fi
@@ -633,14 +852,14 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
- if [[ x$enable_threads = x ]]; then
+ if test x$enable_threads = x; then
enable_threads=$have_pthread_h
fi
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='dce'
tmake_file="${tmake_file} pa/t-dce-thr"
fi
@@ -652,7 +871,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -663,7 +882,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -675,7 +894,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -686,7 +905,7 @@ for machine in $build $host $target; do
tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} pa/pa-gas.h"
fi
@@ -700,8 +919,10 @@ for machine in $build $host $target; do
;;
i370-*-mvs*)
;;
- i[[34567]]86-ibm-aix*) # IBM PS/2 running AIX
- if [[ x$gas = xyes ]]
+changequote(,)dnl
+ i[34567]86-ibm-aix*) # IBM PS/2 running AIX
+changequote([,])dnl
+ if test x$gas = xyes
then
tm_file=i386/aix386.h
extra_parts="crtbegin.o crtend.o"
@@ -714,11 +935,13 @@ for machine in $build $host $target; do
xm_defines=USG
xmake_file=i386/x-aix
;;
- i[[34567]]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
+changequote(,)dnl
+ i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
+changequote([,])dnl
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
xmake_file=i386/x-ncr3000
- if [[ x$stabs = xyes -a x$gas = xyes ]]
+ if test x$stabs = xyes -a x$gas = xyes
then
tm_file=i386/sysv4gdb.h
else
@@ -727,26 +950,33 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
tmake_file=i386/t-crtpic
;;
- i[[34567]]86-next-*)
+changequote(,)dnl
+ i[34567]86-next-*)
+changequote([,])dnl
tm_file=i386/next.h
xm_file=i386/xm-next.h
tmake_file=i386/t-next
xmake_file=i386/x-next
extra_objs=nextstep.o
- if [[ x$enable_threads = xyes ]]; then
+ extra_parts="crtbegin.o crtend.o"
+ if test x$enable_threads = xyes; then
thread_file='mach'
fi
;;
- i[[34567]]86-sequent-bsd*) # 80386 from Sequent
+changequote(,)dnl
+ i[34567]86-sequent-bsd*) # 80386 from Sequent
+changequote([,])dnl
use_collect2=yes
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=i386/seq-gas.h
else
tm_file=i386/sequent.h
fi
;;
- i[[34567]]86-sequent-ptx1*)
+changequote(,)dnl
+ i[34567]86-sequent-ptx1*)
+changequote([,])dnl
xm_defines="USG SVR3"
xmake_file=i386/x-sysv3
tm_file=i386/seq-sysv3.h
@@ -755,7 +985,9 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
install_headers_dir=install-headers-cpio
;;
- i[[34567]]86-sequent-ptx2* | i[[34567]]86-sequent-sysv3*)
+changequote(,)dnl
+ i[34567]86-sequent-ptx2* | i[34567]86-sequent-sysv3*)
+changequote([,])dnl
xm_defines="USG SVR3"
xmake_file=i386/x-sysv3
tm_file=i386/seq2-sysv3.h
@@ -764,7 +996,9 @@ for machine in $build $host $target; do
fixincludes=fixinc.ptx
install_headers_dir=install-headers-cpio
;;
- i[[34567]]86-sequent-ptx4* | i[[34567]]86-sequent-sysv4*)
+changequote(,)dnl
+ i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
+changequote([,])dnl
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
xmake_file=x-svr4
@@ -779,61 +1013,83 @@ for machine in $build $host $target; do
tm_file=i386/sun.h
use_collect2=yes
;;
- i[[34567]]86-wrs-vxworks*)
+changequote(,)dnl
+ i[34567]86-wrs-vxworks*)
+changequote([,])dnl
tm_file=i386/vxi386.h
tmake_file=i386/t-i386bare
;;
- i[[34567]]86-*-aout*)
+changequote(,)dnl
+ i[34567]86-*-aout*)
+changequote([,])dnl
tm_file=i386/i386-aout.h
tmake_file=i386/t-i386bare
;;
- i[[34567]]86-*-bsdi* | i[[34567]]86-*-bsd386*)
+changequote(,)dnl
+ i[34567]86-*-bsdi* | i[34567]86-*-bsd386*)
+changequote([,])dnl
tm_file=i386/bsd386.h
# tmake_file=t-libc-ok
;;
- i[[34567]]86-*-bsd*)
+changequote(,)dnl
+ i[34567]86-*-bsd*)
+changequote([,])dnl
tm_file=i386/386bsd.h
# tmake_file=t-libc-ok
# Next line turned off because both 386BSD and BSD/386 use GNU ld.
# use_collect2=yes
;;
- i[[34567]]86-*-freebsdelf*)
+changequote(,)dnl
+ i[34567]86-*-freebsdelf*)
+changequote([,])dnl
tm_file="i386/i386.h i386/att.h linux.h i386/freebsd-elf.h i386/perform.h"
# On FreeBSD, the headers are already ok, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=i386/t-freebsd
gas=yes
gnu_ld=yes
stabs=yes
;;
- i[[34567]]86-*-freebsd*)
+changequote(,)dnl
+ i[34567]86-*-freebsd*)
+changequote([,])dnl
tm_file=i386/freebsd.h
# On FreeBSD, the headers are already ok, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=i386/t-freebsd
;;
- i[[34567]]86-*-netbsd*)
+ # We are hoping OpenBSD is still close enough to NetBSD that we can
+ # share the configurations.
+changequote(,)dnl
+ i[34567]86-*-netbsd* | i[34567]86-*-openbsd*)
+changequote([,])dnl
tm_file=i386/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
- i[[34567]]86-*-coff*)
+changequote(,)dnl
+ i[34567]86-*-coff*)
+changequote([,])dnl
tm_file=i386/i386-coff.h
tmake_file=i386/t-i386bare
;;
- i[[34567]]86-*-isc*) # 80386 running ISC system
+changequote(,)dnl
+ i[34567]86-*-isc*) # 80386 running ISC system
+changequote([,])dnl
xm_file="${xm_file} i386/xm-isc.h"
xm_defines="USG SVR3"
case $machine in
- i[[34567]]86-*-isc[[34]]*)
+changequote(,)dnl
+ i[34567]86-*-isc[34]*)
+changequote([,])dnl
xmake_file=i386/x-isc3
;;
*)
xmake_file=i386/x-isc
;;
esac
- if [[ x$gas = xyes -a x$stabs = xyes ]]
+ if test x$gas = xyes -a x$stabs = xyes
then
tm_file=i386/iscdbx.h
tmake_file=i386/t-svr3dbx
@@ -845,25 +1101,30 @@ for machine in $build $host $target; do
fi
install_headers_dir=install-headers-cpio
;;
- i[[34567]]86-*-linux-gnuoldld*) # Intel 80386's running GNU/Linux
- # with a.out format using
+changequote(,)dnl
+ i[34567]86-*-linux-gnuoldld*) # Intel 80386's running GNU/Linux
+changequote([,])dnl # with a.out format using
# pre BFD linkers
xmake_file=x-linux-aout
tmake_file="t-linux-aout i386/t-crtstuff"
tm_file=i386/linux-oldld.h
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
+ float_format=i386
;;
- i[[34567]]86-*-linux-gnuaout*) # Intel 80386's running GNU/Linux
- # with a.out format
+changequote(,)dnl
+ i[34567]86-*-linux-gnuaout*) # Intel 80386's running GNU/Linux
+changequote([,])dnl # with a.out format
xmake_file=x-linux-aout
tmake_file="t-linux-aout i386/t-crtstuff"
tm_file=i386/linux-aout.h
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
+ float_format=i386
;;
- i[[34567]]86-*-linux-gnulibc1) # Intel 80386's running GNU/Linux
- # with ELF format using the
+changequote(,)dnl
+ i[34567]86-*-linux-gnulibc1) # Intel 80386's running GNU/Linux
+changequote([,])dnl # with ELF format using the
# GNU/Linux C library 5
xmake_file=x-linux
tm_file=i386/linux.h
@@ -871,12 +1132,14 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
- if [[ x$enable_threads = xyes ]]; then
+ float_format=i386
+ if test x$enable_threads = xyes; then
thread_file='single'
fi
;;
- i[[34567]]86-*-linux-gnu*) # Intel 80386's running GNU/Linux
- # with ELF format using glibc 2
+changequote(,)dnl
+ i[34567]86-*-linux-gnu*) # Intel 80386's running GNU/Linux
+changequote([,])dnl # with ELF format using glibc 2
# aka GNU/Linux C library 6
xmake_file=x-linux
tm_file=i386/linux.h
@@ -884,33 +1147,46 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
- if [[ x$enable_threads = xyes ]]; then
+ float_format=i386
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
i[[34567]]86-*-gnu*)
;;
- i[[34567]]86-go32-msdos | i[[34567]]86-*-go32*)
+changequote(,)dnl
+ i[34567]86-*-gnu*)
+changequote([,])dnl
+ ;;
+changequote(,)dnl
+ i[34567]86-go32-msdos | i[34567]86-*-go32*)
+changequote([,])dnl
xm_file=i386/xm-go32.h
tm_file=i386/go32.h
tmake_file=i386/t-go32
;;
- i[[34567]]86-pc-msdosdjgpp*)
+changequote(,)dnl
+ i[34567]86-pc-msdosdjgpp*)
+changequote([,])dnl
xm_file=i386/xm-go32.h
tm_file=i386/go32.h
tmake_file=i386/t-go32
gnu_ld=yes
gas=yes
;;
- i[[34567]]86-moss-msdos* | i[[34567]]86-*-moss*)
+changequote(,)dnl
+ i[34567]86-moss-msdos* | i[34567]86-*-moss*)
+changequote([,])dnl
tm_file=i386/moss.h
tmake_file=t-libc-ok
fixincludes=Makefile.in
gnu_ld=yes
gas=yes
;;
- i[[34567]]86-*-lynxos*)
- if [[ x$gas = xyes ]]
+changequote(,)dnl
+ i[34567]86-*-lynxos*)
+changequote([,])dnl
+ if test x$gas = xyes
then
tm_file=i386/lynx.h
else
@@ -920,13 +1196,17 @@ for machine in $build $host $target; do
tmake_file=i386/t-i386bare
xmake_file=x-lynx
;;
- i[[34567]]86-*-mach*)
+changequote(,)dnl
+ i[34567]86-*-mach*)
+changequote([,])dnl
tm_file=i386/mach.h
# tmake_file=t-libc-ok
use_collect2=yes
;;
- i[[34567]]86-*-osfrose*) # 386 using OSF/rose
- if [[ x$elf = xyes ]]
+changequote(,)dnl
+ i[34567]86-*-osfrose*) # 386 using OSF/rose
+changequote([,])dnl
+ if test x$elf = xyes
then
tm_file=i386/osfelf.h
use_collect2=
@@ -939,39 +1219,55 @@ for machine in $build $host $target; do
tmake_file=i386/t-osf
extra_objs=halfpic.o
;;
- i[[34567]]86-go32-rtems*)
+changequote(,)dnl
+ i[34567]86-go32-rtems*)
+changequote([,])dnl
cpu_type=i386
xm_file=i386/xm-go32.h
tm_file=i386/go32-rtems.h
tmake_file="i386/t-go32 t-rtems"
;;
- i[[34567]]86-*-rtemself*)
+changequote(,)dnl
+ i[34567]86-*-rtemself*)
+changequote([,])dnl
cpu_type=i386
tm_file=i386/rtemself.h
tmake_file="i386/t-i386bare t-rtems"
;;
- i[[34567]]86-*-rtems*)
+changequote(,)dnl
+ i[34567]86-*-rtems*)
+changequote([,])dnl
cpu_type=i386
tm_file=i386/rtems.h
tmake_file="i386/t-i386bare t-rtems"
;;
- i[[34567]]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
+changequote(,)dnl
+ i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
+changequote([,])dnl
xm_file="xm-siglist.h xm-alloca.h ${xm_file} i386/xm-sco5.h"
xm_defines="USG SVR3"
xmake_file=i386/x-sco5
fixincludes=fixinc.sco
install_headers_dir=install-headers-cpio
tm_file=i386/sco5.h
- tmake_file=i386/t-sco5
+ if test x$gas = xyes
+ then
+ tm_file="i386/sco5gas.h ${tm_file}"
+ tmake_file=i386/t-sco5gas
+ else
+ tmake_file=i386/t-sco5
+ fi
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
;;
- i[[34567]]86-*-sco3.2v4*) # 80386 running SCO 3.2v4 system
+changequote(,)dnl
+ i[34567]86-*-sco3.2v4*) # 80386 running SCO 3.2v4 system
+changequote([,])dnl
xm_file="${xm_file} i386/xm-sco.h"
xm_defines="USG SVR3 BROKEN_LDEXP SMALL_ARG_MAX NO_SYS_SIGLIST"
xmake_file=i386/x-sco4
fixincludes=fixinc.sco
install_headers_dir=install-headers-cpio
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=i386/sco4dbx.h
tmake_file=i386/t-svr3dbx
@@ -983,11 +1279,13 @@ for machine in $build $host $target; do
fi
truncate_target=yes
;;
- i[[34567]]86-*-sco*) # 80386 running SCO system
+changequote(,)dnl
+ i[34567]86-*-sco*) # 80386 running SCO system
+changequote([,])dnl
xm_file=i386/xm-sco.h
xmake_file=i386/x-sco
install_headers_dir=install-headers-cpio
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=i386/scodbx.h
tmake_file=i386/t-svr3dbx
@@ -999,10 +1297,12 @@ for machine in $build $host $target; do
fi
truncate_target=yes
;;
- i[[34567]]86-*-solaris2*)
+changequote(,)dnl
+ i[34567]86-*-solaris2*)
+changequote([,])dnl
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=i386/sol2dbg.h
else
@@ -1012,33 +1312,39 @@ for machine in $build $host $target; do
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
xmake_file=x-svr4
case $machine in
- *-*-solaris2.[[0-4]])
+changequote(,)dnl
+ *-*-solaris2.[0-4])
+changequote([,])dnl
fixincludes=fixinc.svr4;;
*)
- fixincludes=fixinc.math;;
+ fixincludes=fixinc.wrap;;
esac
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='solaris'
fi
;;
- i[[34567]]86-*-sysv5*) # Intel x86 on System V Release 5
+changequote(,)dnl
+ i[34567]86-*-sysv5*) # Intel x86 on System V Release 5
+changequote([,])dnl
xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
xm_defines="USG POSIX"
tm_file=i386/sysv4.h
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
tmake_file=i386/t-crtpic
xmake_file=x-svr4
extra_parts="crtbegin.o crtend.o"
- fixincludes=Makefile.in # The headers are just fine, thank you.
+ fixincludes=fixinc.svr4
;;
- i[[34567]]86-*-sysv4*) # Intel 80386's running system V.4
+changequote(,)dnl
+ i[34567]86-*-sysv4*) # Intel 80386's running system V.4
+changequote([,])dnl
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
tm_file=i386/sysv4.h
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -1046,12 +1352,25 @@ for machine in $build $host $target; do
xmake_file=x-svr4
extra_parts="crtbegin.o crtend.o"
;;
- i[[34567]]86-*-osf1*) # Intel 80386's running OSF/1 1.3+
+changequote(,)dnl
+ i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
+changequote([,])dnl
+ xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
+ xm_defines="USG POSIX"
+ tm_file=i386/udk.h
+ tmake_file="i386/t-crtpic i386/t-udk"
+ xmake_file=x-svr4
+ extra_parts="crtbegin.o crtend.o"
+ fixincludes="fixinc.svr4"
+ ;;
+changequote(,)dnl
+ i[34567]86-*-osf1*) # Intel 80386's running OSF/1 1.3+
+changequote([,])dnl
cpu_type=i386
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h i386/xm-osf1elf.h"
xm_defines="USE_C_ALLOCA SMALL_ARG_MAX"
fixincludes=Makefile.in #Don't do it on OSF/1
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=i386/osf1elfgdb.h
else
@@ -1061,12 +1380,14 @@ for machine in $build $host $target; do
xmake_file=i386/x-osf1elf
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
;;
- i[[34567]]86-*-sysv*) # Intel 80386's running system V
+changequote(,)dnl
+ i[34567]86-*-sysv*) # Intel 80386's running system V
+changequote([,])dnl
xm_defines="USG SVR3"
xmake_file=i386/x-sysv3
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=i386/svr3dbx.h
tmake_file=i386/t-svr3dbx
@@ -1088,26 +1409,44 @@ for machine in $build $host $target; do
tmake_file=i386/t-vsta
xmake_file=i386/x-vsta
;;
- i[[34567]]86-*-pe | i[[34567]]86-*-cygwin32)
+changequote(,)dnl
+ i[34567]86-*-win32)
+changequote([,])dnl
+ xm_file="${xm_file} i386/xm-cygwin32.h"
+ tmake_file=i386/t-cygwin32
+ tm_file=i386/win32.h
+ xmake_file=i386/x-cygwin32
+ extra_objs=winnt.o
+ fixincludes=Makefile.in
+ if test x$enable_threads = xyes; then
+ thread_file='win32'
+ fi
+ exeext=.exe
+ ;;
+changequote(,)dnl
+ i[34567]86-*-pe | i[34567]86-*-cygwin32)
+changequote([,])dnl
xm_file="${xm_file} i386/xm-cygwin32.h"
tmake_file=i386/t-cygwin32
tm_file=i386/cygwin32.h
xmake_file=i386/x-cygwin32
extra_objs=winnt.o
fixincludes=Makefile.in
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
;;
- i[[34567]]86-*-mingw32*)
+changequote(,)dnl
+ i[34567]86-*-mingw32*)
+changequote([,])dnl
tm_file=i386/mingw32.h
xm_file="${xm_file} i386/xm-mingw32.h"
- tmake_file=i386/t-cygwin32
+ tmake_file="i386/t-cygwin32 i386/t-mingw32"
extra_objs=winnt.o
xmake_file=i386/x-cygwin32
fixincludes=Makefile.in
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
@@ -1119,7 +1458,9 @@ for machine in $build $host $target; do
;;
esac
;;
- i[[34567]]86-*-winnt3*)
+changequote(,)dnl
+ i[34567]86-*-winnt3*)
+changequote([,])dnl
tm_file=i386/win-nt.h
out_file=i386/i386.c
xm_file="xm-winnt.h ${xm_file}"
@@ -1128,15 +1469,17 @@ for machine in $build $host $target; do
extra_host_objs="winnt.o oldnames.o"
extra_gcc_objs="spawnv.o oldnames.o"
fixincludes=fixinc.winnt
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
extra_programs=ld.exe
fi
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
;;
- i[[34567]]86-dg-dgux*)
+changequote(,)dnl
+ i[34567]86-dg-dgux*)
+changequote([,])dnl
xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
xm_defines="USG POSIX"
out_file=i386/dgux.c
@@ -1155,7 +1498,7 @@ for machine in $build $host $target; do
;;
i860-*-bsd*)
tm_file="${tm_file} i860/bsd.h"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="${tm_file} i860/bsd-gas.h"
fi
@@ -1233,7 +1576,7 @@ for machine in $build $host $target; do
m68000-hp-hpux*) # HP 9000 series 300
xm_file="xm_alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
xmake_file=m68k/x-hp320g
tm_file=m68k/hp310g.h
@@ -1258,7 +1601,7 @@ for machine in $build $host $target; do
m68000-att-sysv*)
xm_file="m68k/xm-3b1.h ${xm_file}"
xm_defines=USG
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=m68k/3b1g.h
else
@@ -1274,28 +1617,30 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
extra_parts="crt1.o mcrt1.o maccrt1.o crt2.o crtn.o"
tm_file=
- if [[ "$gnu_ld" = yes ]]
+ if test "$gnu_ld" = yes
then
tm_file="${tm_file} m68k/auxgld.h"
else
tm_file="${tm_file} m68k/auxld.h"
fi
- if [[ "$gas" = yes ]]
+ if test "$gas" = yes
then
tm_file="${tm_file} m68k/auxgas.h"
else
tm_file="${tm_file} m68k/auxas.h"
fi
tm_file="${tm_file} m68k/a-ux.h"
+ float_format=m68k
;;
m68k-apollo-*)
tm_file=m68k/apollo68.h
xmake_file=m68k/x-apollo68
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-altos-sysv*) # Altos 3068
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=m68k/altos3068.h
xm_defines=USG
@@ -1306,9 +1651,9 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
;;
m68k-bull-sysv*) # Bull DPX/2
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=m68k/dpx2cdbx.h
else
@@ -1330,15 +1675,16 @@ for machine in $build $host $target; do
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-motorola-sysv*)
tm_file=m68k/mot3300.h
xm_file="xm-alloca.h m68k/xm-mot3300.h ${xm_file}"
xm_defines=NO_SYS_SIGLIST
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
xmake_file=m68k/x-mot3300-gas
- if [[ x$gnu_ld = xyes ]]
+ if test x$gnu_ld = xyes
then
tmake_file=m68k/t-mot3300-gald
else
@@ -1347,7 +1693,7 @@ for machine in $build $host $target; do
fi
else
xmake_file=m68k/x-mot3300
- if [[ x$gnu_ld = xyes ]]
+ if test x$gnu_ld = xyes
then
tmake_file=m68k/t-mot3300-gld
else
@@ -1358,6 +1704,7 @@ for machine in $build $host $target; do
gdb_needs_out_file_path=yes
extra_parts="crt0.o mcrt0.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-ncr-sysv*) # NCR Tower 32 SVR3
tm_file=m68k/tower-as.h
@@ -1395,30 +1742,35 @@ for machine in $build $host $target; do
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-ccur-rtu)
tm_file=m68k/ccur-GAS.h
xmake_file=m68k/x-ccur
extra_headers=math-68881.h
use_collect2=yes
+ float_format=m68k
;;
m68k-hp-bsd4.4*) # HP 9000/3xx running 4.4bsd
tm_file=m68k/hp3bsd44.h
xmake_file=m68k/x-hp3bsd44
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-hp-bsd*) # HP 9000/3xx running Berkeley Unix
tm_file=m68k/hp3bsd.h
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-isi-bsd*)
- if [[ x$with_fp = xno ]]
+ if test x$with_fp = xno
then
tm_file=m68k/isi-nfp.h
else
tm_file=m68k/isi.h
+ float_format=m68k
fi
use_collect2=yes
extra_headers=math-68881.h
@@ -1426,7 +1778,7 @@ for machine in $build $host $target; do
m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
xm_file="xm_alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
xmake_file=m68k/x-hp320g
tm_file=m68k/hp320g.h
@@ -1437,11 +1789,12 @@ for machine in $build $host $target; do
install_headers_dir=install-headers-cpio
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-hp-hpux*) # HP 9000 series 300
xm_file="xm_alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
xmake_file=m68k/x-hp320g
tm_file=m68k/hp320g.h
@@ -1452,14 +1805,16 @@ for machine in $build $host $target; do
install_headers_dir=install-headers-cpio
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-sun-mach*)
tm_file=m68k/sun3mach.h
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-sony-newsos3*)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=m68k/news3gas.h
else
@@ -1467,9 +1822,10 @@ for machine in $build $host $target; do
fi
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-sony-bsd* | m68k-sony-newsos*)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=m68k/newsgas.h
else
@@ -1477,6 +1833,7 @@ for machine in $build $host $target; do
fi
use_collect2=yes
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-next-nextstep2*)
tm_file=m68k/next21.h
@@ -1486,6 +1843,7 @@ for machine in $build $host $target; do
extra_objs=nextstep.o
extra_headers=math-68881.h
use_collect2=yes
+ float_format=m68k
;;
m68k-next-nextstep3*)
tm_file=m68k/next.h
@@ -1493,27 +1851,31 @@ for machine in $build $host $target; do
tmake_file=m68k/t-next
xmake_file=m68k/x-next
extra_objs=nextstep.o
+ extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
- if [[ x$enable_threads = xyes ]]; then
+ float_format=m68k
+ if test x$enable_threads = xyes; then
thread_file='mach'
fi
;;
m68k-sun-sunos3*)
- if [[ x$with_fp = xno ]]
+ if test x$with_fp = xno
then
tm_file=m68k/sun3n3.h
else
tm_file=m68k/sun3o3.h
+ float_format=m68k
fi
use_collect2=yes
extra_headers=math-68881.h
;;
m68k-sun-sunos*) # For SunOS 4 (the default).
- if [[ x$with_fp = xno ]]
+ if test x$with_fp = xno
then
tm_file=m68k/sun3n.h
else
tm_file=m68k/sun3.h
+ float_format=m68k
fi
use_collect2=yes
extra_headers=math-68881.h
@@ -1523,19 +1885,22 @@ for machine in $build $host $target; do
tmake_file=m68k/t-vxworks68
extra_headers=math-68881.h
thread_file='vxworks'
+ float_format=m68k
;;
m68k-*-aout*)
tmake_file=m68k/t-m68kbare
tm_file="m68k/m68k-aout.h libgloss.h"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-coff*)
tmake_file=m68k/t-m68kbare
tm_file="m68k/m68k-coff.h dbx.h libgloss.h"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-lynxos*)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=m68k/lynx.h
else
@@ -1545,12 +1910,14 @@ for machine in $build $host $target; do
xmake_file=x-lynx
tmake_file=m68k/t-lynx
extra_headers=math-68881.h
+ float_format=m68k
;;
- m68k-*-netbsd*)
+ m68k*-*-netbsd*)
tm_file=m68k/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
+ float_format=m68k
;;
m68k-*-sysv3*) # Motorola m68k's running system V.3
xm_file="xm-alloca.h ${xm_file}"
@@ -1558,6 +1925,7 @@ for machine in $build $host $target; do
xmake_file=m68k/x-m68kv
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-sysv4*) # Motorola m68k's running system V.4
tm_file=m68k/m68kv4.h
@@ -1566,6 +1934,7 @@ for machine in $build $host $target; do
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-linux-gnuaout*) # Motorola m68k's running GNU/Linux
# with a.out format
@@ -1574,6 +1943,7 @@ for machine in $build $host $target; do
tmake_file="t-linux-aout m68k/t-linux-aout"
fixincludes=Makefile.in # The headers are ok already.
extra_headers=math-68881.h
+ float_format=m68k
gnu_ld=yes
;;
m68k-*-linux-gnulibc1) # Motorola m68k's running GNU/Linux
@@ -1585,6 +1955,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in # The headers are ok already.
extra_headers=math-68881.h
+ float_format=m68k
gnu_ld=yes
;;
m68k-*-linux-gnu*) # Motorola m68k's running GNU/Linux
@@ -1596,8 +1967,9 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in # The headers are ok already.
extra_headers=math-68881.h
+ float_format=m68k
gnu_ld=yes
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -1605,11 +1977,13 @@ for machine in $build $host $target; do
tmake_file=m68k/t-m68kbare
tm_file=m68k/m68k-psos.h
extra_headers=math-68881.h
+ float_format=m68k
;;
m68k-*-rtems*)
tmake_file="m68k/t-m68kbare t-rtems"
tm_file=m68k/rtems.h
extra_headers=math-68881.h
+ float_format=m68k
;;
m88k-dg-dgux*)
@@ -1625,7 +1999,7 @@ for machine in $build $host $target; do
esac
extra_parts="crtbegin.o bcscrtbegin.o crtend.o m88kdgux.ld"
xmake_file=m88k/x-dgux
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=m88k/t-dgux-gas
fi
@@ -1636,7 +2010,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
xm_file="m88k/xm-sysv3.h ${xm_file}"
xmake_file=m88k/x-dolph
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
fi
@@ -1646,7 +2020,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
xm_file="m88k/xm-sysv3.h ${xm_file}"
xmake_file=m88k/x-tekXD88
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
fi
@@ -1661,7 +2035,7 @@ for machine in $build $host $target; do
m88k-*-luna*)
tm_file=m88k/luna.h
extra_parts="crtbegin.o crtend.o"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=m88k/t-luna-gas
else
@@ -1673,7 +2047,7 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
xm_file="m88k/xm-sysv3.h ${xm_file}"
xmake_file=m88k/x-sysv3
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
fi
@@ -1690,9 +2064,9 @@ for machine in $build $host $target; do
fixincludes=fixinc.irix
xmake_file=mips/x-iris6
tmake_file=mips/t-iris6
- if [[ x$enable_threads = xyes ]]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-wrs-vxworks)
tm_file="mips/elf.h libgloss.h"
@@ -1704,20 +2078,21 @@ for machine in $build $host $target; do
;;
mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
tm_file="mips/iris6.h mips/cross64.h"
- xm_defines="USG HAVE_INTTYPES_H"
+ xm_defines=USG
+ xm_file="mips/xm-iris5.h"
fixincludes=Makefile.in
xmake_file=mips/x-iris
tmake_file=mips/t-cross64
# See comment in mips/iris[56].h files.
use_collect2=yes
- if [[ x$enable_threads = xyes ]]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sni-sysv4)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file=mips/iris5gdb.h
else
@@ -1729,89 +2104,93 @@ for machine in $build $host $target; do
xm_defines=USG
xmake_file=mips/x-sni-svr4
tmake_file=mips/t-mips-gas
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-sgi-irix5*) # SGI System V.4., IRIX 5
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file="mips/iris5.h mips/iris5gas.h"
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
else
tm_file=mips/iris5.h
fi
- xm_defines="USG HAVE_INTTYPES_H"
+ xm_defines=USG
+ xm_file="mips/xm-iris5.h"
fixincludes=fixinc.irix
xmake_file=mips/x-iris
# mips-tfile doesn't work yet
tmake_file=mips/t-mips-gas
# See comment in mips/iris5.h file.
use_collect2=yes
- if [[ x$enable_threads = xyes ]]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sgi-irix4loser*) # Mostly like a MIPS.
tm_file="mips/iris4loser.h mips/iris3.h ${tm_file} mips/iris4.h"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-iris
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
- if [[ x$enable_threads = xyes ]]; then
- thread_file='irix'
- fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sgi-irix4*) # Mostly like a MIPS.
tm_file="mips/iris3.h ${tm_file} mips/iris4.h"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-iris
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
if [[ x$enable_threads = xyes ]]; then
thread_file='irix'
fi
+# if test x$enable_threads = xyes; then
+# thread_file='irix'
+# fi
;;
mips-sgi-*) # Mostly like a MIPS.
tm_file="mips/iris3.h ${tm_file}"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-iris3
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -1825,18 +2204,18 @@ for machine in $build $host $target; do
;;
mips-dec-osf*) # Decstation running OSF/1 as shipped by DIGITAL
tm_file=mips/dec-osf1.h
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xmake_file=mips/x-dec-osf1
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
tmake_file=mips/t-ultrix
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -1844,36 +2223,36 @@ for machine in $build $host $target; do
mips-dec-bsd*) # Decstation running 4.4 BSD
tm_file=mips/dec-bsd.h
fixincludes=
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
tmake_file=mips/t-ultrix
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-dec-netbsd*) # Decstation running NetBSD
+ mipsel-*-netbsd* | mips-dec-netbsd*) # Decstation running NetBSD
tm_file=mips/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
mips-sony-bsd* | mips-sony-newsos*) # Sony NEWS 3600 or risc/news.
tm_file="mips/news4.h ${tm_file}"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -1883,31 +2262,31 @@ for machine in $build $host $target; do
# That is based on svr4.
# t-svr4 is not right because this system doesn't use ELF.
tm_file="mips/news5.h ${tm_file}"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_file="xm-siglist.h ${xm_file}"
xm_defines=USG
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-tandem-sysv4*) # Tandem S2 running NonStop UX
tm_file="mips/svr4-5.h mips/svr4-t.h"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_file="xm-siglist.h ${xm_file}"
xm_defines=USG
xmake_file=mips/x-sysv
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
extra_parts="crtbegin.o crtend.o"
@@ -1915,151 +2294,163 @@ for machine in $build $host $target; do
tmake_file=mips/t-mips
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-ultrix* | mips-dec-mach3) # Decstation.
tm_file="mips/ultrix.h ${tm_file}"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xmake_file=mips/x-ultrix
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
tmake_file=mips/t-ultrix
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-*-riscos[[56789]]bsd*)
+changequote(,)dnl
+ mips-*-riscos[56789]bsd*)
+changequote([,])dnl
tm_file=mips/bsd-5.h # MIPS BSD 4.3, RISC-OS 5.0
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-bsd-gas
else
tmake_file=mips/t-bsd
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[[1234]]bsd*)
+changequote(,)dnl
+ mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[1234]bsd*)
+changequote([,])dnl
tm_file="mips/bsd-4.h ${tm_file}" # MIPS BSD 4.3, RISC-OS 4.0
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-bsd-gas
else
tmake_file=mips/t-bsd
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-*-riscos[[56789]]sysv4*)
+changequote(,)dnl
+ mips-*-riscos[56789]sysv4*)
+changequote([,])dnl
tm_file=mips/svr4-5.h # MIPS System V.4., RISC-OS 5.0
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_file="xm-siglist.h ${xm_file}"
xmake_file=mips/x-sysv
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr4-gas
else
tmake_file=mips/t-svr4
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-*-sysv4* | mips-*-riscos[[1234]]sysv4* | mips-*-riscossysv4*)
+changequote(,)dnl
+ mips-*-sysv4* | mips-*-riscos[1234]sysv4* | mips-*-riscossysv4*)
+changequote([,])dnl
tm_file="mips/svr4-4.h ${tm_file}"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-sysv
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr4-gas
else
tmake_file=mips/t-svr4
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-*-riscos[[56789]]sysv*)
+changequote(,)dnl
+ mips-*-riscos[56789]sysv*)
+changequote([,])dnl
tm_file=mips/svr3-5.h # MIPS System V.3, RISC-OS 5.0
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-sysv
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr3-gas
else
tmake_file=mips/t-svr3
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
mips-*-sysv* | mips-*-riscos*sysv*)
tm_file="mips/svr3-4.h ${tm_file}"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
xm_defines=USG
xmake_file=mips/x-sysv
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-svr3-gas
else
tmake_file=mips/t-svr3
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
;;
- mips-*-riscos[[56789]]*) # Default MIPS RISC-OS 5.0.
+changequote(,)dnl
+ mips-*-riscos[56789]*) # Default MIPS RISC-OS 5.0.
+changequote([,])dnl
tm_file=mips/mips-5.h
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -2068,14 +2459,14 @@ for machine in $build $host $target; do
;;
mipsel-*-ecoff*)
tm_file=mips/ecoffl.h
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
tmake_file=mips/t-ecoff
;;
mips-*-ecoff*)
tm_file="gofast.h mips/ecoff.h"
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
tmake_file=mips/t-ecoff
@@ -2105,7 +2496,7 @@ for machine in $build $host $target; do
tmake_file=mips/t-ecoff
;;
mips64orion-*-rtems*)
- tm_file="mips/elforion.h mips/elfl64.h mips/rtems64.h"
+ tm_file="mips/elforion.h mips/elf64.h mips/rtems64.h"
tmake_file="mips/t-ecoff t-rtems"
;;
mipstx39el-*-elf*)
@@ -2115,18 +2506,20 @@ for machine in $build $host $target; do
mipstx39-*-elf*)
tm_file="mips/r3900.h mips/elf.h mips/abi64.h libgloss.h"
tmake_file=mips/t-r3900
+ # FIXME mips-elf should be fixed to use crtstuff.
+ use_collect2=yes
;;
mips-*-*) # Default MIPS RISC-OS 4.0.
- if [[ x$stabs = xyes ]]; then
+ if test x$stabs = xyes; then
tm_file="${tm_file} dbx.h"
fi
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file=mips/t-mips-gas
else
extra_passes="mips-tfile mips-tdump"
fi
- if [[ x$gnu_ld != xyes ]]
+ if test x$gnu_ld != xyes
then
use_collect2=yes
fi
@@ -2134,7 +2527,7 @@ for machine in $build $host $target; do
mn10200-*-*)
cpu_type=mn10200
tm_file="mn10200/mn10200.h"
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -2143,7 +2536,7 @@ for machine in $build $host $target; do
mn10300-*-*)
cpu_type=mn10300
tm_file="mn10300/mn10300.h"
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -2186,10 +2579,11 @@ for machine in $build $host $target; do
xm_defines=USG
use_collect2=yes
;;
- ns32k-pc532-netbsd*)
+ ns32k-*-netbsd*)
tm_file=ns32k/netbsd.h
+ xm_file="ns32k/xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
pdp11-*-bsd)
@@ -2221,7 +2615,7 @@ for machine in $build $host $target; do
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG POSIX"
extra_headers=ppc-asm.h
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
else
@@ -2243,7 +2637,7 @@ for machine in $build $host $target; do
;;
powerpc-*-eabi*)
tm_file=rs6000/eabi.h
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
else
@@ -2254,7 +2648,7 @@ for machine in $build $host $target; do
;;
powerpc-*-rtems*)
tm_file=rs6000/rtems.h
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm"
else
@@ -2267,7 +2661,7 @@ for machine in $build $host $target; do
tm_file=rs6000/linux.h
xm_file=rs6000/xm-sysv4.h
out_file=rs6000/rs6000.c
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
else
@@ -2277,7 +2671,7 @@ for machine in $build $host $target; do
fixincludes=Makefile.in
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_headers=ppc-asm.h
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -2286,7 +2680,7 @@ for machine in $build $host $target; do
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG ${xm_defines}"
out_file=rs6000/rs6000.c
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos t-linux rs6000/t-ppccomm"
else
@@ -2296,7 +2690,7 @@ for machine in $build $host $target; do
fixincludes=Makefile.in
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_headers=ppc-asm.h
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
@@ -2313,7 +2707,7 @@ for machine in $build $host $target; do
tm_file=rs6000/sysv4le.h
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG POSIX"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
else
@@ -2330,7 +2724,7 @@ for machine in $build $host $target; do
;;
powerpcle-*-eabi*)
tm_file=rs6000/eabile.h
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
else
@@ -2344,7 +2738,7 @@ for machine in $build $host $target; do
tmake_file=rs6000/t-winnt
# extra_objs=pe.o
fixincludes=Makefile.in
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
extra_headers=ppc-asm.h
@@ -2352,12 +2746,11 @@ for machine in $build $host $target; do
powerpcle-*-pe | powerpcle-*-cygwin32)
tm_file=rs6000/cygwin32.h
xm_file="rs6000/xm-cygwin32.h ${xm_file}"
- xm_defines=NO_STAB_H
tmake_file=rs6000/t-winnt
xmake_file=rs6000/x-cygwin32
# extra_objs=pe.o
fixincludes=Makefile.in
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
@@ -2367,7 +2760,7 @@ for machine in $build $host $target; do
tm_file=rs6000/sol2.h
xm_file="xm-siglist.h rs6000/xm-sysv4.h"
xm_defines="USG POSIX"
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
else
@@ -2375,21 +2768,27 @@ for machine in $build $host $target; do
fi
xmake_file=rs6000/x-sysv4
case $machine in
- *-*-solaris2.[[0-4]])
+changequote(,)dnl
+ *-*-solaris2.[0-4])
+changequote([,])dnl
fixincludes=fixinc.svr4;;
*)
- fixincludes=fixinc.math;;
+ fixincludes=fixinc.wrap;;
esac
extra_headers=ppc-asm.h
;;
- rs6000-ibm-aix3.[[01]]*)
+changequote(,)dnl
+ rs6000-ibm-aix3.[01]*)
+changequote([,])dnl
tm_file=rs6000/aix31.h
xmake_file=rs6000/x-aix31
use_collect2=yes
;;
- rs6000-ibm-aix3.2.[[456789]]* | powerpc-ibm-aix3.2.[[456789]]*)
+changequote(,)dnl
+ rs6000-ibm-aix3.2.[456789]* | powerpc-ibm-aix3.2.[456789]*)
+changequote([,])dnl
tm_file=rs6000/aix3newas.h
- if [[ x$host != x$target ]]
+ if test x$host != x$target
then
tmake_file=rs6000/t-xnewas
else
@@ -2397,15 +2796,43 @@ for machine in $build $host $target; do
fi
use_collect2=yes
;;
- rs6000-ibm-aix[[456789]].* | powerpc-ibm-aix[[456789]].*)
+changequote(,)dnl
+ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
+changequote([,])dnl
tm_file=rs6000/aix41.h
- if [[ x$host != x$target ]]
+ if test x$host != x$target
then
tmake_file=rs6000/t-xnewas
else
tmake_file=rs6000/t-newas
fi
- xmake_file=rs6000/x-aix31
+ xmake_file=rs6000/x-aix41
+ use_collect2=yes
+ ;;
+changequote(,)dnl
+ rs6000-ibm-aix4.[3456789].* | powerpc-ibm-aix4.[3456789].*)
+changequote([,])dnl
+ tm_file=rs6000/aix43.h
+ if test x$host != x$target
+ then
+ tmake_file=rs6000/t-xaix43
+ else
+ tmake_file=rs6000/t-aix43
+ fi
+ xmake_file=rs6000/x-aix43
+ use_collect2=yes
+ ;;
+changequote(,)dnl
+ rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+changequote([,])dnl
+ tm_file=rs6000/aix43.h
+ if test x$host != x$target
+ then
+ tmake_file=rs6000/t-xaix43
+ else
+ tmake_file=rs6000/t-aix43
+ fi
+ xmake_file=rs6000/x-aix43
use_collect2=yes
;;
rs6000-ibm-aix*)
@@ -2431,6 +2858,11 @@ for machine in $build $host $target; do
tm_file=sh/elf.h
float_format=sh
;;
+ sh-*-rtemself*)
+ tmake_file="sh/t-sh t-rtems"
+ tm_file=sh/rtemself.h
+ float_format=sh
+ ;;
sh-*-rtems*)
tmake_file="sh/t-sh t-rtems"
tm_file=sh/rtems.h
@@ -2457,7 +2889,7 @@ for machine in $build $host $target; do
sparc-*-netbsd*)
tm_file=sparc/netbsd.h
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
sparc-*-bsd*)
@@ -2494,12 +2926,12 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
fixincludes=Makefile.in #On Linux, the headers are ok already.
gnu_ld=yes
- if [[ x$enable_threads = xyes ]]; then
+ if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
sparc-*-lynxos*)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
tm_file=sparc/lynx.h
else
@@ -2513,8 +2945,31 @@ for machine in $build $host $target; do
tmake_file="sparc/t-sparcbare t-rtems"
tm_file=sparc/rtems.h
;;
+ sparcv9-*-solaris2*)
+ tm_file=sparc/sol2-sld-64.h
+ xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
+ xm_defines="USG POSIX"
+ tmake_file="sparc/t-sol2 sparc/t-sol2-64"
+ xmake_file=sparc/x-sysv4
+ extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
+ fixincludes=fixinc.wrap
+ float_format=i128
+ if test x${enable_threads} = x ; then
+ enable_threads=$have_pthread_h
+ if test x${enable_threads} = x ; then
+ enable_threads=$have_thread_h
+ fi
+ fi
+ if test x${enable_threads} = xyes ; then
+ if test x${have_pthread_h} = xyes ; then
+ thread_file='posix'
+ else
+ thread_file='solaris'
+ fi
+ fi
+ ;;
sparc-*-solaris2*)
- if [[ x$gnu_ld = xyes ]]
+ if test x$gnu_ld = xyes
then
tm_file=sparc/sol2.h
else
@@ -2526,20 +2981,22 @@ for machine in $build $host $target; do
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
case $machine in
- *-*-solaris2.[[0-4]])
+changequote(,)dnl
+ *-*-solaris2.[0-4])
+changequote([,])dnl
fixincludes=fixinc.svr4;;
*)
- fixincludes=fixinc.math;;
+ fixincludes=fixinc.wrap;;
esac
float_format=i128
- if [[ x${enable_threads} = x ]]; then
+ if test x${enable_threads} = x; then
enable_threads=$have_pthread_h
- if [[ x${enable_threads} = x ]]; then
+ if test x${enable_threads} = x; then
enable_threads=$have_thread_h
fi
fi
- if [[ x${enable_threads} = xyes ]]; then
- if [[ x${have_pthread_h} = xyes ]]; then
+ if test x${enable_threads} = xyes; then
+ if test x${have_pthread_h} = xyes; then
thread_file='posix'
else
thread_file='solaris'
@@ -2555,7 +3012,7 @@ for machine in $build $host $target; do
tm_file=sparc/sunos4.h
tmake_file=sparc/t-sunos41
use_collect2=yes
- if [[ x$gas = xyes ]]; then
+ if test x$gas = xyes; then
tm_file="${tm_file} sparc/sun4gas.h"
fi
;;
@@ -2600,11 +3057,12 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtend.o"
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
- tmake_file=sparc/t-sp64
+ tmake_file="t-linux sparc/t-linux64"
xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
fixincludes=Makefile.in # The headers are ok already.
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
;;
# This hasn't been upgraded to GCC 2.
@@ -2619,6 +3077,7 @@ for machine in $build $host $target; do
xm_file=arm/xm-thumb.h
md_file=arm/thumb.md
tmake_file=arm/t-thumb
+ fixincludes=Makefile.in # There is nothing to fix
;;
# This hasn't been upgraded to GCC 2.
# tron-*-*)
@@ -2630,7 +3089,7 @@ for machine in $build $host $target; do
tm_file="v850/v850.h"
xm_file="v850/xm-v850.h"
tmake_file=v850/t-v850
- if [[ x$stabs = xyes ]]
+ if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h"
fi
@@ -2648,7 +3107,7 @@ for machine in $build $host $target; do
vax-*-netbsd*)
tm_file="${tm_file} netbsd.h vax/netbsd.h"
# On NetBSD, the headers are already okay, except for math.h.
- fixincludes=fixinc.math
+ fixincludes=fixinc.wrap
tmake_file=t-netbsd
float_format=vax
;;
@@ -2735,9 +3194,9 @@ for machine in $build $host $target; do
;;
esac
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
- if [[ "$target_cpu_default2" = "" ]]
+ if test "$target_cpu_default2" = ""
then
target_cpu_default2="MASK_GAS"
else
@@ -2767,7 +3226,7 @@ for machine in $build $host $target; do
;;
*)
- if [[ x$pass2done = xyes ]]
+ if test x$pass2done = xyes
then
echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
exit 1
@@ -2777,9 +3236,9 @@ for machine in $build $host $target; do
;;
mips*-*-ecoff* | mips*-*-elf*)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
- if [[ x$gnu_ld = xyes ]]
+ if test x$gnu_ld = xyes
then
target_cpu_default2=20
else
@@ -2788,7 +3247,7 @@ for machine in $build $host $target; do
fi
;;
mips*-*-*)
- if [[ x$gas = xyes ]]
+ if test x$gas = xyes
then
target_cpu_default2=16
fi
@@ -2811,7 +3270,7 @@ for machine in $build $host $target; do
;;
*)
- if [[ x$pass2done = xyes ]]
+ if test x$pass2done = xyes
then
echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
exit 1
@@ -2828,7 +3287,7 @@ for machine in $build $host $target; do
target_cpu_default2="TARGET_CPU_$with_cpu"
;;
*)
- if [[ x$pass2done = xyes ]]
+ if test x$pass2done = xyes
then
echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
exit 1
@@ -2838,9 +3297,9 @@ for machine in $build $host $target; do
;;
esac
- if [[ "$target_cpu_default2" != "" ]]
+ if test "$target_cpu_default2" != ""
then
- if [[ "$target_cpu_default" != "" ]]
+ if test "$target_cpu_default" != ""
then
target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
else
@@ -2849,17 +3308,19 @@ for machine in $build $host $target; do
fi
# No need for collect2 if we have the GNU linker.
- case x$gnu_ld in
- xyes)
- use_collect2=
- ;;
- esac
+ # Actually, there is now; GNU ld doesn't handle the EH info or
+ # collecting for shared libraries.
+ #case x$gnu_ld in
+ #xyes)
+ # use_collect2=
+ # ;;
+ #esac
# Save data on machine being used to compile GCC in build_xm_file.
# Save data on host machine in vars host_xm_file and host_xmake_file.
- if [[ x$pass1done = x ]]
+ if test x$pass1done = x
then
- if [[ x"$xm_file" = x ]]
+ if test x"$xm_file" = x
then build_xm_file=$cpu_type/xm-$cpu_type.h
else build_xm_file=$xm_file
fi
@@ -2868,14 +3329,14 @@ for machine in $build $host $target; do
build_exeext=$exeext
pass1done=yes
else
- if [[ x$pass2done = x ]]
+ if test x$pass2done = x
then
- if [[ x"$xm_file" = x ]]
+ if test x"$xm_file" = x
then host_xm_file=$cpu_type/xm-$cpu_type.h
else host_xm_file=$xm_file
fi
host_xm_defines=$xm_defines
- if [[ x"$xmake_file" = x ]]
+ if test x"$xmake_file" = x
then xmake_file=$cpu_type/x-$cpu_type
fi
host_xmake_file="$xmake_file"
@@ -2891,33 +3352,33 @@ done
extra_objs="${host_extra_objs} ${extra_objs}"
# Default the target-machine variables that were not explicitly set.
-if [[ x"$tm_file" = x ]]
+if test x"$tm_file" = x
then tm_file=$cpu_type/$cpu_type.h; fi
-if [[ x$extra_headers = x ]]
+if test x$extra_headers = x
then extra_headers=; fi
-if [[ x"$xm_file" = x ]]
+if test x"$xm_file" = x
then xm_file=$cpu_type/xm-$cpu_type.h; fi
-if [[ x$md_file = x ]]
+if test x$md_file = x
then md_file=$cpu_type/$cpu_type.md; fi
-if [[ x$out_file = x ]]
+if test x$out_file = x
then out_file=$cpu_type/$cpu_type.c; fi
-if [[ x"$tmake_file" = x ]]
+if test x"$tmake_file" = x
then tmake_file=$cpu_type/t-$cpu_type
fi
-if [[ x$float_format = x ]]
+if test x$float_format = x
then float_format=i64
fi
-if [[ x$enable_haifa = x ]]
+if test x$enable_haifa = x
then
case $target in
- alpha*-* | hppa1.?-* | powerpc*-* | rs6000-* | *sparc-* | m32r*-*)
+ alpha*-* | hppa1.?-* | powerpc*-* | rs6000-* | *sparc*-* | m32r*-*)
enable_haifa=yes;;
esac
fi
@@ -2930,7 +3391,7 @@ count=a
for f in $tm_file; do
count=${count}x
done
-if [[ $count = ax ]]; then
+if test $count = ax; then
echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
else
echo "Using the following target machine macro files:"
@@ -2943,7 +3404,7 @@ count=a
for f in $host_xm_file; do
count=${count}x
done
-if [[ $count = ax ]]; then
+if test $count = ax; then
echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
else
echo "Using the following host machine macro files:"
@@ -2952,12 +3413,12 @@ else
done
fi
-if [[ "$host_xm_file" != "$build_xm_file" ]]; then
+if test "$host_xm_file" != "$build_xm_file"; then
count=a
for f in $build_xm_file; do
count=${count}x
done
- if [[ $count = ax ]]; then
+ if test $count = ax; then
echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
else
echo "Using the following build machine macro files:"
@@ -2967,8 +3428,8 @@ if [[ "$host_xm_file" != "$build_xm_file" ]]; then
fi
fi
-if [[ x$thread_file = x ]]; then
- if [[ x$target_thread_file != x ]]; then
+if test x$thread_file = x; then
+ if test x$target_thread_file != x; then
thread_file=$target_thread_file
else
thread_file='single'
@@ -2986,7 +3447,7 @@ host_xm_file="auto-host.h ${host_xm_file}"
# If host=build, it is correct to have hconfig 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 [[ x$host = x$build ]]
+if test x$host = x$build
then
build_xm_file="auto-host.h ${build_xm_file}"
else
@@ -3018,10 +3479,10 @@ links="config.h tm.h tconfig.h hconfig.h"
defines="host_xm_defines null_defines xm_defines build_xm_defines"
rm -f config.bak
-if [[ -f config.status ]]; then mv -f config.status config.bak; fi
+if test -f config.status; then mv -f config.status config.bak; fi
# Make the links.
-while [[ -n "$vars" ]]
+while test -n "$vars"
do
set $vars; var=$1; shift; vars=$*
set $links; link=$1; shift; links=$*
@@ -3031,7 +3492,7 @@ do
# Define TARGET_CPU_DEFAULT if the system wants one.
# This substitutes for lots of *.h files.
- if [[ "$target_cpu_default" != "" -a $link = tm.h ]]
+ if test "$target_cpu_default" != "" -a $link = tm.h
then
echo "#define TARGET_CPU_DEFAULT ($target_cpu_default)" >>$link
fi
@@ -3048,12 +3509,19 @@ do
done
# Truncate the target if necessary
-if [[ x$host_truncate_target != x ]]; then
+if test x$host_truncate_target != x; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
fi
-# Get the version number from the toplevel
-version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${srcdir}/version.c`
+# Get the version trigger filename from the toplevel
+if test "${with_gcc_version_trigger+set}" = set; then
+ gcc_version_trigger=$with_gcc_version_trigger
+else
+ gcc_version_trigger=${srcdir}/version.c
+fi
+changequote(,)dnl
+gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}`
+changequote([,])dnl
# Get an absolute path to the GCC top-level source directory
holddir=`pwd`
@@ -3068,7 +3536,7 @@ host_overrides=Make-host
dep_host_xmake_file=
for f in .. ${host_xmake_file}
do
- if [[ -f ${srcdir}/config/$f ]]
+ if test -f ${srcdir}/config/$f
then
dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
fi
@@ -3081,7 +3549,7 @@ target_overrides=Make-target
dep_tmake_file=
for f in .. ${tmake_file}
do
- if [[ -f ${srcdir}/config/$f ]]
+ if test -f ${srcdir}/config/$f
then
dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
fi
@@ -3142,7 +3610,7 @@ done
# Also use all.cross instead of all.internal
# and add cross-make to Makefile.
cross_overrides="/dev/null"
-if [[ x$host != x$target ]]
+if test x$host != x$target
then
cross_defines="CROSS=-DCROSS_COMPILE"
cross_overrides="${topdir}/cross-make"
@@ -3152,7 +3620,7 @@ fi
# This must come after cross-make as we want all.build to override
# all.cross.
build_overrides="/dev/null"
-if [[ x$build != x$host ]]
+if test x$build != x$host
then
build_overrides="${topdir}/build-make"
fi
@@ -3160,7 +3628,7 @@ fi
# Expand extra_headers to include complete path.
# This substitutes for lots of t-* files.
extra_headers_list=
-if [[ "x$extra_headers" = x ]]
+if test "x$extra_headers" = x
then true
else
# Prepend ${srcdir}/ginclude/ to every entry in extra_headers.
@@ -3170,10 +3638,14 @@ else
done
fi
+if test x$use_collect2 = xno; then
+ use_collect2=
+fi
+
# Add a definition of USE_COLLECT2 if system wants one.
# Also tell toplev.c what to do.
# This substitutes for lots of t-* files.
-if [[ x$use_collect2 = x ]]
+if test x$use_collect2 = x
then
will_use_collect2=
maybe_use_collect2=
@@ -3189,7 +3661,7 @@ fi
# building gcc with a cross compiler, use the cross compiler just
# built. Otherwise, we can use the cpp just built.
md_file_sub=
-if [[ "x$md_cppflags" = x ]]
+if test "x$md_cppflags" = x
then
md_file_sub=$srcdir/config/$md_file
else
@@ -3197,19 +3669,123 @@ else
fi
# If we have gas in the build tree, make a link to it.
-if [[ -f ../gas/Makefile ]]; then
+if test -f ../gas/Makefile; then
rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
fi
+# If we have nm in the build tree, make a link to it.
+if test -f ../binutils/Makefile; then
+ rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
+fi
+
# If we have ld in the build tree, make a link to it.
-if [[ -f ../ld/Makefile ]]; then
-# if [[ x$use_collect2 = x ]]; then
+if test -f ../ld/Makefile; then
+# if test x$use_collect2 = x; then
# rm -f ld; $symbolic_link ../ld/ld-new$host_exeext ld$host_exeext 2>/dev/null
# else
rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
# fi
fi
+# Figure out what assembler alignment features are present.
+AC_MSG_CHECKING(assembler alignment features)
+gcc_cv_as=
+gcc_cv_as_alignment_features=
+gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+if test -x "$AS"; then
+ gcc_cv_as=$AS
+elif test -x as$host_exeext; then
+ # Build using assembler in the current directory.
+ gcc_cv_as=./as$host_exeext
+elif test -f $gcc_cv_as_gas_srcdir/configure.in; then
+ # Single tree build which includes gas.
+ for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
+ do
+changequote(,)dnl
+ gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
+changequote([,])dnl
+ if test x$gcc_cv_gas_version != x; then
+ break
+ fi
+ done
+changequote(,)dnl
+ gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
+ gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
+changequote([,])dnl
+ 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.
+ # bytes to skip when using .p2align.
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
+ gcc_cv_as_alignment_features=".balign and .p2align"
+ AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
+ fi
+ # Gas version 2.8 and later support specifying the maximum
+ # bytes to skip when using .p2align.
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
+ gcc_cv_as_alignment_features=".p2align including maximum skip"
+ AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
+ fi
+ fi
+elif test x$host = x$target; then
+ # Native build.
+ gcc_cv_as=as$host_exeext
+fi
+if test x$gcc_cv_as != x; then
+ # Check if we have .balign and .p2align
+ echo ".balign 4" > conftest.s
+ echo ".p2align 2" >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_alignment_features=".balign and .p2align"
+ AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
+ fi
+ rm -f conftest.s conftest.o
+ # Check if specifying the maximum bytes to skip when
+ # using .p2align is supported.
+ echo ".p2align 4,,7" > conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_alignment_features=".p2align including maximum skip"
+ AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
+ fi
+ rm -f conftest.s conftest.o
+fi
+AC_MSG_RESULT($gcc_cv_as_alignment_features)
+
+AC_MSG_CHECKING(assembler subsection support)
+gcc_cv_as_subsections=
+if test x$gcc_cv_as != x; then
+ # Check if we have .subsection
+ echo ".subsection 1" > conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_subsections=".subsection"
+ if test -x nm$host_exeext; then
+ gcc_cv_nm=./nm$host_exeext
+ elif test x$host = x$target; then
+ # Native build.
+ gcc_cv_nm=nm$host_exeext
+ fi
+ if test x$gcc_cv_nm != x; then
+ cat > conftest.s <<EOF
+conftest_label1: .word 0
+.subsection -1
+conftest_label2: .word 0
+.previous
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
+ $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
+ if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
+ :
+ else
+ gcc_cv_as_subsections="working .subsection -1"
+ AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING)
+ fi
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+fi
+AC_MSG_RESULT($gcc_cv_as_subsections)
+
# Figure out what language subdirectories are present.
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
@@ -3218,14 +3794,21 @@ do
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
- ${srcdir}/[[*]]/config-lang.in) ;;
- *) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`" ;;
+changequote(,)dnl
+ ${srcdir}/ada/config-lang.in)
+ if test x$gnat = xyes ; then
+ subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
+ fi
+ ;;
+ ${srcdir}/[*]/config-lang.in) ;;
+ *) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" ;;
+changequote([,])dnl
esac
done
# Make gthr-default.h if we have a thread file.
gthread_flags=
-if [[ $thread_file != single ]]; then
+if test $thread_file != single; then
rm -f gthr-default.h
echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
gthread_flags=-DHAVE_GTHR_DEFAULT
@@ -3237,18 +3820,23 @@ AC_SUBST(gthread_flags)
lang_specs_files=
lang_options_files=
-rm -f specs.h options.h
-touch specs.h options.h
+lang_tree_files=
+rm -f specs.h options.h gencheck.h
+touch specs.h options.h gencheck.h
for subdir in . $subdirs
do
- if [[ -f $srcdir/$subdir/lang-specs.h ]]; then
+ if test -f $srcdir/$subdir/lang-specs.h; then
echo "#include \"$subdir/lang-specs.h\"" >>specs.h
lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
fi
- if [[ -f $srcdir/$subdir/lang-options.h ]]; then
+ if test -f $srcdir/$subdir/lang-options.h; then
echo "#include \"$subdir/lang-options.h\"" >>options.h
lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
fi
+ if test -f $srcdir/$subdir/$subdir-tree.def; then
+ echo "#include \"$subdir/$subdir-tree.def\"" >>gencheck.h
+ lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
+ fi
done
# These (without "all_") are set in each config-lang.in.
@@ -3277,7 +3865,7 @@ oldstyle_subdirs=
for s in .. $subdirs
do
- if [[ $s != ".." ]]
+ if test $s != ".."
then
language=
boot_language=
@@ -3288,14 +3876,14 @@ do
outputs=
lib2funcs=
. ${srcdir}/$s/config-lang.in
- if [[ "x$language" = x ]]
+ if test "x$language" = x
then
echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
exit 1
fi
all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in ${srcdir}/$s/Makefile.in"
all_languages="$all_languages $language"
- if [[ "x$boot_language" = xyes ]]
+ if test "x$boot_language" = xyes
then
all_boot_languages="$all_boot_languages $language"
fi
@@ -3304,7 +3892,7 @@ do
all_diff_excludes="$all_diff_excludes $diff_excludes"
all_headers="$all_headers $headers"
all_outputs="$all_outputs $outputs"
- if [[ x$outputs = x ]]
+ if test x$outputs = x
then
oldstyle_subdirs="$oldstyle_subdirs $s"
fi
@@ -3328,7 +3916,7 @@ do
x=
for l in .. $all_languages
do
- if [[ $l != ".." ]]; then
+ if test $l != ".."; then
x="$x $l.$t"
fi
done
@@ -3337,14 +3925,14 @@ done
# If we're not building in srcdir, create .gdbinit.
-if [[ ! -f Makefile.in ]]; then
+if test ! -f Makefile.in; then
echo "dir ." > .gdbinit
echo "dir ${srcdir}" >> .gdbinit
- if [[ x$gdb_needs_out_file_path = xyes ]]
+ if test x$gdb_needs_out_file_path = xyes
then
echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
fi
- if [[ "x$subdirs" != x ]]; then
+ if test "x$subdirs" != x; then
for s in $subdirs
do
echo "dir ${srcdir}/$s" >> .gdbinit
@@ -3353,12 +3941,24 @@ if [[ ! -f Makefile.in ]]; then
echo "source ${srcdir}/.gdbinit" >> .gdbinit
fi
+# Define variables host_canonical and build_canonical
+# because some Cygnus local changes in the Makefile depend on them.
+build_canonical=${build}
+host_canonical=${host}
+target_subdir=
+if test "${host}" != "${target}" ; then
+ target_subdir=${target}/
+fi
+AC_SUBST(build_canonical)
+AC_SUBST(host_canonical)
+AC_SUBST(target_subdir)
+
# If this is using newlib, then define inhibit_libc in
# LIBGCC2_CFLAGS. This will cause __eprintf to be left out of
# libgcc.a, but that's OK because newib should have its own version of
# assert.h.
inhibit_libc=
-if [[ x$with_newlib = xyes ]]; then
+if test x$with_newlib = xyes; then
inhibit_libc=-Dinhibit_libc
fi
AC_SUBST(inhibit_libc)
@@ -3366,23 +3966,34 @@ AC_SUBST(inhibit_libc)
# Override SCHED_OBJ and SCHED_CFLAGS to enable the Haifa scheduler.
sched_prefix=
sched_cflags=
-if [[ x$enable_haifa = xyes ]]; then
+if test x$enable_haifa = xyes; then
echo "Using the Haifa scheduler."
sched_prefix=haifa-
sched_cflags=-DHAIFA
fi
AC_SUBST(sched_prefix)
AC_SUBST(sched_cflags)
-if [[ x$enable_haifa != x ]]; then
+if test x$enable_haifa != x; then
# Explicitly remove files that need to be recompiled for the Haifa scheduler.
for x in genattrtab.o toplev.o loop.o unroll.o *sched.o; do
- if [[ -f $x ]]; then
+ if test -f $x; then
echo "Removing $x"
rm -f $x
fi
done
fi
+# Warn if using init_priority.
+AC_MSG_CHECKING(whether to enable init_priority by default)
+if test x$enable_init_priority != xyes; then
+ enable_init_priority=no
+fi
+AC_MSG_RESULT($enable_init_priority)
+
+# Nothing to do for FLOAT_H, float_format already handled.
+objdir=`pwd`
+AC_SUBST(objdir)
+
# Process the language and host/target makefile fragments.
${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
@@ -3396,10 +4007,13 @@ AC_SUBST(all_stagestuff)
AC_SUBST(all_diff_excludes)
AC_SUBST(all_lib2funcs)
AC_SUBST(all_headers)
+AC_SUBST(cpp_main)
AC_SUBST(extra_passes)
AC_SUBST(extra_programs)
AC_SUBST(extra_parts)
AC_SUBST(extra_c_objs)
+AC_SUBST(extra_cxx_objs)
+AC_SUBST(extra_cpp_objs)
AC_SUBST(extra_c_flags)
AC_SUBST(extra_objs)
AC_SUBST(host_extra_gcc_objs)
@@ -3414,8 +4028,11 @@ AC_SUBST(build_xm_file_list)
AC_SUBST(host_xm_file_list)
AC_SUBST(lang_specs_files)
AC_SUBST(lang_options_files)
+AC_SUBST(lang_tree_files)
AC_SUBST(thread_file)
-AC_SUBST(version)
+AC_SUBST(objc_boehm_gc)
+AC_SUBST(gcc_version)
+AC_SUBST(gcc_version_trigger)
AC_SUBST(local_prefix)
AC_SUBST(gxx_include_dir)
AC_SUBST(fixincludes)
@@ -3439,7 +4056,7 @@ AC_SUBST_FILE(language_fragments)
AC_SUBST_FILE(language_hooks)
# Echo that links are built
-if [[ x$host = x$target ]]
+if test x$host = x$target
then
str1="native "
else
@@ -3447,25 +4064,25 @@ else
str2=" from $host"
fi
-if [[ x$host != x$build ]]
+if test x$host != x$build
then
str3=" on a $build system"
fi
-if [[ "x$str2" != x ]] || [[ "x$str3" != x ]]
+if test "x$str2" != x || test "x$str3" != x
then
str4=
fi
echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
-if [[ "x$str2" != x ]] || [[ "x$str3" != x ]]
+if test "x$str2" != x || test "x$str3" != x
then
echo " ${str2}${str3}." 1>&2
fi
# Truncate the target if necessary
-if [[ x$host_truncate_target != x ]]; then
+if test x$host_truncate_target != x; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
fi
@@ -3487,9 +4104,9 @@ esac
# FLAGS_TO_PASS has been modified to solve the problem there.
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
-if [[ "$symbolic_link" = "ln -s" ]]; then
+if test "$symbolic_link" = "ln -s"; then
for d in .. ${subdirs} ; do
- if [[ $d != .. ]]; then
+ if test $d != ..; then
STARTDIR=`pwd`
cd $d
for t in stage1 stage2 stage3 stage4 include
@@ -3518,7 +4135,8 @@ host_xmake_file='${host_xmake_file}'
dep_tmake_file='${dep_tmake_file}'
tmake_file='${tmake_file}'
thread_file='${thread_file}'
-version='${version}'
+gcc_version='${gcc_version}'
+gcc_version_trigger='${gcc_version_trigger}'
local_prefix='${local_prefix}'
build_install_headers_dir='${build_install_headers_dir}'
build_exeext='${build_exeext}'
diff --git a/gcc/configure.lang b/gcc/configure.lang
index 6932f8fa4f6..d96b6d8d531 100644
--- a/gcc/configure.lang
+++ b/gcc/configure.lang
@@ -3,7 +3,7 @@
# subdirectories which conform to the old GCC configure mechanism
# for such subdirectories.
-# Copyright (C) 1997 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
#This file is part of GNU CC.
@@ -180,7 +180,7 @@ $program_transform_name/" \
rm Makefile.sed
echo 's| ||' > Makefile.sed
echo "s|^target=.*$|target=${target}|" >> Makefile.sed
- echo "s|^target_alias=.*$|target=${target_alias}|" >> Makefile.sed
+ echo "s|^target_alias=.*$|target_alias=${target_alias}|" >> Makefile.sed
echo "s|^xmake_file=.*$|xmake_file=${dep_host_xmake_file}|" >> Makefile.sed
echo "s|^tmake_file=.*$|tmake_file=${dep_tmake_file}|" >> Makefile.sed
echo "s|^version=.*$|version=${version}|" >> Makefile.sed
diff --git a/gcc/convert.c b/gcc/convert.c
index e03d39b7f32..bfcb5db4470 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -121,6 +121,14 @@ convert_to_integer (type, expr)
int inprec = TYPE_PRECISION (intype);
int outprec = TYPE_PRECISION (type);
+ /* An INTEGER_TYPE cannot be incomplete, but an ENUMERAL_TYPE can
+ be. Consider `enum E = { a, b = (enum E) 3 };'. */
+ if (!TYPE_SIZE (type))
+ {
+ error ("conversion to incomplete type");
+ return error_mark_node;
+ }
+
switch (TREE_CODE (intype))
{
case POINTER_TYPE:
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c5699e629af..c7b1ed806dd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,3372 @@
+Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
+ (gxx.gperf): Update comments describing invocation flags.
+ (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
+
+1998-10-07 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (finish_struct_1): Add commentary on prevous change.
+
+ * cp-tree.h (vtbl_ptr_type_node): New variable.
+ * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
+ already of the right type.
+ (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
+ Simplify code to grow vtable.
+ * decl.c (vtbl_ptr_type_node): Define.
+ (init_decl_processing): Initialize it.
+
+1998-10-06 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.def (PTRMEM_CST): New tree node.
+ * cp-tree.h (ptrmem_cst): New type.
+ (lang_type): Remove local_typedecls.
+ (dummy): Increase to 12 bits from 11.
+ (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
+ (PTRMEM_CST_CLASS): New macro.
+ (PTRMEM_CST_MEMBER): Likewise.
+ (current_access_specifier): New variable.
+ (current_class_type): Remove duplicate declaration.
+ (finish_struct): Change prototype.
+ (unreverse_member_declarations): New function.
+ (pushdecl_class_level): Change prototype.
+ (grok_enum_decls): Remove.
+ (fixup_anonymous_union): New function.
+ (grok_x_components): Change prototype.
+ (tsubst_chain): Remove.
+ (finish_member_template_decl): Likewise.
+ (check_explicit_specialization): Fix indentation.
+ (finish_class_definition): Change prototype.
+ (finish_member_class_template): Likewise.
+ (finish_member_declaration): New function.
+ (check_multiple_declarators): Likewise.
+ * class.c (class_stack_node_t): New type.
+ (current_class_base): Remove.
+ (current_class_stack): Change type.
+ (current_access_specifier): New variable.
+ (grow_method): Remove.
+ (check_member_decl_is_same_in_complete_scope): Break out from
+ finish_struct.
+ (make_method_vec): New function.
+ (free_method_vec): Likewise.
+ (add_implicitly_declared_members): Break out from finish_struct_1.
+ (free_method_vecs): New variable.
+ (add_method): Rework for direct use from parser.
+ (handle_using_decl): Watch for NULL_TREE while iterating through
+ CLASSTYPE_METHOD_VEC.
+ (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
+ just do some error-checking.
+ (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
+ (finish_struct_1): Simplify. Use add_implicitly_declared_members.
+ (finish_struct): Change prototype. Simplify; fields and methods
+ are already set up at this point.
+ (init_class_processing): Set up current_class_stack.
+ (pushclass): Save current_access_specifier.
+ (popclass): Restore it.
+ (currently_open_class): Simplify.
+ (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
+ * decl.c (saved_scope): Add access_specifier.
+ (maybe_push_to_top_level): Save it.
+ (pop_from_top_level): Restore it.
+ (maybe_process_template_type_declaration): Use
+ finish_member_declaration.
+ (pushtag): Likewise.
+ (pushdecl_class_level): Don't return a value.
+ (fixup_anonymous_union): Break out from grok_x_components.
+ (shadow_tag): Use it.
+ (xref_tag): Complain about using an elaborated type specifier to
+ reference a template type parameter or typedef name.
+ (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
+ (current_local_enum): Remove.
+ (build_enumerator): Call finish_member_declaration.
+ (grok_enum_decls): Remove.
+ * decl2.c (grok_x_components): Simplify.
+ (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
+ (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
+ (merge_functions): Add to comment.
+ (arg_assoc_type): Prototype.
+ (arg_assoc): Pass as many arguments as there are parameters.
+ * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of
+ OFFSET_REF.
+ * expr.c (cpls_expand_expr): Remove dead code. Handle
+ PTRMEM_CST.
+ * friend.c (do_friend): Lookup friends when in nested classes.
+ Change comments.
+ * init.c (build_offset_ref): Do lookup even for classes that are
+ only partially defined.
+ (decl_constant_value): Remove dead code.
+ * method.c (build_overload_value): Remove hack where by TYPE was
+ not a TYPE. Handle PTRMEM_CST.
+ (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
+ should go.
+ * parse.y (components, notype_components, component_decl,
+ component_decl_1, component_declarator, component_declarator0):
+ Now all are itype rather than ttype. Rework to add members to
+ classes on the fly.
+ (typesqpecqual_reserved): Use check_multiple_declarators.
+ (structsp): Update class to finish_class_definition.
+ (do_xref_defn): Unsplit into named_class_head.
+ (access_specifier): Set current_access_specifier.
+ * pt.c (set_current_access_from_decl): New function.
+ (finish_member_template_decl): Don't take the parameters.
+ (comp_template_args): Make more robust.
+ (lookup_template_class): Don't use current_local_enum.
+ (for_each_template_parm): Handle PTRMEM_CST.
+ (instantiate_class_template): Use set_current_access_from_decl,
+ finish_member_declaration and unreverse_member_declarations. Set
+ lineno/input_filename before generating implicit member functions.
+ (type_unification_real): Don't assume back-unification happens
+ only for the last argument.
+ (regenerate_decl_from_template): Call pushclass a bit earlier.
+ (tsubst_chain): Remove.
+ (tsubst_enum): Use set_current_access_from_decl.
+ (set_mangled_name_for_template_decl): Fix indentation.
+ * search.c (lookup_fnfields_1): Change iteration through
+ CLASSTYPE_METHOD_VEC.
+ (dfs_pushdecls): Likewise.
+ (dfs_compress_decls): Likewise.
+ (add_conversions): Likewise.
+ * semantics.c (finish_class_definition): Don't take components.
+ Change call to finish_struct.
+ (finish_member_declaration): New function.
+ (finish_member_class_template): Don't take template parameters.
+ Change call to grok_x_components. Call finish_member_template_decl.
+ (check_multiple_declarators): New function.
+ * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
+ a passed in fieldlist.
+ * tree.c (search_tree): Handle PTRMEM_CST.
+ (mapcar): Likewise.
+ * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
+ INTEGER_CSTs, for pointer-to-data members.
+
+ * call.c (resolve_args): Resolve template specializations, if
+ possible.
+
+Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (spew.o): Depend on toplev.h.
+
+ * call.c (compare_ics): Initialize variables `deref_from_type2',
+ `deref_to_type1' and `deref_to_type2'.
+
+ * except.c (get_eh_type): Hide prototype and definition.
+ (process_start_catch_block_old): Remove unused static prototype.
+
+ * pt.c (tsubst_decl): Initialize variable `argvec'.
+
+ * spew.c: Include toplev.h.
+
+1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (instantiate_decl): Do save and restore file position.
+
+1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * method.c (build_decl_overload_real): Clear
+ numeric_output_need_bar after __.
+
+1998-10-05 Nathan Sidwell <nathan@acm.org>
+
+ * call.c (build_new_method_call): Issue 'incomplete type' error,
+ if class is not defined.
+
+1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (build_object_call): Move declaration of variable
+ `fn' into the scope where it is used. Don't access variable
+ `fn' when it is uninitialized, instead use `fns'.
+
+1998-10-04 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * errfn.c (cp_thing): Print buf as a string not as a printf format
+ to avoid problems with the operator%. Consequently, `%%' sequences
+ in format are copied as `%' in buf.
+
+1998-10-04 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (pop_tinst_level): Call extract_interface_info.
+ (instantiate_decl): Don't save and restore file position.
+
+ * decl.c (cp_finish_decl): Make statics in extern inlines and
+ templates common, if possible and the target doesn't support weak
+ symbols.
+
+ * decl.c (grokdeclarator): Remove redundant calls to
+ build_type_variant and some duplicated code.
+ * sig.c (build_signature_reference_type): Only take the type parm.
+ (build_signature_pointer_type): Likewise.
+ * tree.c (build_cplus_method_type): Adjust.
+ * cp-tree.h: Update.
+
+1998-10-04 Mark Mitchell <mark@markmitchell.com>
+
+ * call.c (build_over_call): Make pedwarns about dropped qualifiers
+ into full-fledged errors.
+ * cvt.c (convert_to_reference): Likewise.
+ * typeck.c (convert_for_assignment): Likewise.
+
+ * search.c (expand_upcast_vtables): In addition to unsetting
+ TREE_READONLY, remove top-level const type qualifier.
+
+1998-10-03 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (current_class_ptr, current_class_ref): Clarify
+ documentation.
+ * cvt.c (ocp_convert): Don't expect fold to remove all trivial
+ NOP type conversions.
+ * decl.c (decls_match): Use comptypes directly; ignore
+ qualifiers on the DECL.
+ (duplicate_decls): Remove qualifier checks on DECL.
+ (grokdeclarator): Make the type built up include top-level
+ qualifiers.
+ * decl2.c (do_dtors): Fix spelling error.
+ * error.c (dump_simple_decl): Don't look at qualifiers on the decl
+ when printing type information.
+ * init.c (build_new_1): Add documentation. Deal with the fact
+ that type of allocated memory now contains qualifiers.
+ * lex.c (is_global): Improve error-recovery.
+ * sig.c (build_member_function_pointer): Don't cast away const
+ on fields of sigtable_entry_type.
+ * tree.c (lvalue_type): Don't look at top-level qualifiers on
+ expressions.
+ * typeck.c (decay_conversion): Likewise.
+ (build_component_ref): Make sure the type of the COMPONENT_REF
+ contains top-level qualifiers, as appropriate. Improve
+ error-handling.
+ (build_indirect_ref): Simplify. Don't strip top-level qualifiers.
+ (build_array_ref): Likewise.
+ (build_unary_op): Improve error-recovery.
+ (unary_complex_lvalue): Make taking the address a bound member
+ function an error, not a sorry.
+ (build_conditional_expr): Look at the type qualifiers, not the
+ qualifiers on the expression itself.
+
+1998-10-03 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (merge_functions): Remove duplicates.
+
+ * decl2.c: Add -f{no-,}implicit-inline-templates.
+ (lang_decode_option): Unset it if -frepo.
+ (import_export_decl): Check it.
+
+ * decl.c (lookup_name_real): Template parms also take precedence
+ over implicit typename. Only warn if yylex.
+
+ * typeck.c (build_conditional_expr): Only fold if ifexp is an
+ INTEGER_CST.
+
+ * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
+ instead of linkage.
+
+1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.h (FORMAT_VBASE_NAME): New macro.
+ * class.c (build_vbase_pointer): Use it.
+ * rtti.c (expand_class_desc): Likewise.
+ * tree.c (build_vbase_pointer_fields): Likewise.
+
+Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
+
+ * decl.c (start_decl): Add invocation of
+ SET_DEFAULT_DECL_ATTRIBUTES, if defined.
+ (start_function): Add invocation of
+ SET_DEFAULT_DECL_ATTRIBUTES, if defined.
+
+ * lex.c: Replace occurances of HANDLE_SYSV_PRAGMA with
+ HANDLE_GENERIC_PRAGMAS.
+
+1998-09-28 Anthony Green <green@cygnus.com>
+
+ * semantics.c (finish_asm_stmt): Always permit volatile asms.
+
+1998-09-28 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (grokdeclarator): Tighten checks for invalid
+ destructors. Improve error-messages and error-recovery.
+ * decl2.c (check_classfn): Don't assume that mangled destructor
+ names contain type information.
+
+1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (get_base_distance): Remove assert.
+
+ * decl2.c (build_anon_union_vars): Don't process a field with no
+ name.
+ (finish_anon_union): Also complain about local anon unions with no
+ members.
+
+1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (lookup_namespace_name): If the name is a namespace,
+ return it immediately.
+
+Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cp-tree.h (define_case_label): Remove unused parameter.
+ (check_java_method): Likewise.
+ (grokclassfn): Likewise.
+ (expand_aggr_init): Likewise.
+ (build_x_delete): Likewise.
+ (maybe_end_member_template_processing): Likewise.
+ (unshare_base_binfos): Add prototype.
+ (string_conv_p): Likewise.
+ (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
+
+ * cvt.c (build_up_reference): Remove unused parameter
+ `checkconst', all callers changed.
+ (build_type_conversion): Mark parameter `code' with
+ ATTRIBUTE_UNUSED.
+ (build_expr_type_conversion): Initialize variable `conv'.
+
+ * decl.c (push_namespace): Initialize variable `d'.
+ (define_case_label): Remove unused parameter `decl', all callers
+ changed.
+
+ * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
+ `argc' with ATTRIBUTE_UNUSED.
+ (grokclassfn): Remove unused parameter `cname', all callers
+ changed.
+ (check_java_method): Likewise for parameter `ctype'.
+ (copy_assignment_arg_p): Mark parameter `virtualp' with
+ ATTRIBUTE_UNUSED.
+ (finish_prevtable_vardecl): Likewise for parameter `prev'.
+
+ * expr.c (extract_init): Likewise for parameters `decl' and `init'.
+
+ * init.c (expand_aggr_init_1): Remove unused parameter
+ `alias_this', all callers changed.
+ (expand_aggr_init): Likewise.
+ (expand_default_init): Likewise.
+ (build_new_1): Initialize variable `susp'.
+ (build_x_delete): Remove unused parameter `type', all callers
+ changed.
+
+ * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
+ ATTRIBUTE_UNUSED.
+ (readescape): Use (unsigned) value in shift.
+ (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when
+ comparing to a signed quantity.
+
+ * pt.c (maybe_end_member_template_processing): Remove unused
+ parameter `decl', all callers changed.
+ (check_explicit_specialization): Add braces around empty body in
+ an else-statement.
+ (current_template_args): Initialize variable `args'.
+ (lookup_template_class): Likewise for variable `prev_local_enum'.
+ (tsubst_decl): Likewise for variable `r'.
+ (set_mangled_name_for_template_decl): Initialize variable
+ `context'.
+
+ * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
+ Likewise for variable `i'.
+ (yylex): Initialize variable `trrr'.
+
+ * typeck.c (compparms): Mark variable `strict' with
+ ATTRIBUTE_UNUSED.
+
+ * xref.c (simplify_type): Cast argument of ctype function to
+ `unsigned char'.
+
+1998-09-24 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (language_lvalue_valid): Remove.
+ * decl.c (grokdeclarator): Don't disallow references to functions.
+ * tree.c (lvalue_p_1): New function, combining duplicated
+ code from ...
+ (lvalue_p): Use it.
+ (real_lvalue_p): Likewise.
+ * typeck.c (language_lvalue_valid): Remove.
+ (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
+ they don't have TREE_READONLY set.
+ * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
+
+1998-09-24 Benjamin Kosnik <bkoz@loony.cygnus.com>
+
+ * spew.c (yylex): Give diagnostic.
+ * hash.h (is_reserved_word): Add export.
+ * gxx.gperf: Ditto.
+ * lex.h (rid): Add RID_EXPORT.
+ * lex.c (init_parse): Ditto.
+
+Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * friend.c (do_friend): Make warning a full sentence.
+
+1998-09-22 Mark Mitchell <mark@markmitchell.com>
+
+ * parse.y (component_decl_list): Improve error-recovery.
+
+1998-09-22 Benjamin Kosnik <bkoz@loony.cygnus.com>
+
+ * decl.c (make_typename_type): Move error to point where name
+ variable can be used by dump_type.
+
+1998-09-22 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (grokfndecl): Improve error-recovery.
+ * decl2.c (grokfield): Likewise.
+ * pt.c (finish_member_template_decl): Likewise.
+
+1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * method.c (hack_identifier): Finding multiple members is always
+ an error.
+
+1998-09-21 Per Bothner <bothner@cygnus.com>
+
+ * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o.
+
+Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
+
+ * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
+
+1998-09-20 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (maybe_warn_about_overly_private_class): Reformat.
+
+1998-09-17 Andrew MacLeod <amacleod@cygnus.com>
+
+ * exception.cc (__cplus_type_matcher): realign some code.
+
+1998-09-16 Mark Mitchell <mark@markmitchell.com>
+
+ * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
+ (tinfo2.o): Likewise.
+ (exception.o): Likewise.
+ (new.o): Likewise.
+ (opnew.o): Likewise.
+ (opnewnt.o): Likewise.
+ (opvnew.o): Likewise.
+ (opvnewnt.o): Likewise.
+ (opdel.o): Likewise.
+ (opdelnt.o): Likewise.
+ (opvdel.o): Likewise.
+ (opvdelnt.o): Likewise.
+
+1998-09-16 Richard Henderson <rth@cygnus.com>
+
+ * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
+
+1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * call.c (build_field_call): handle static data members too
+
+ * typeck.c (comptypes): when comparing pointer types, check
+ whether referred types match even in strictest modes
+
+1998-09-15 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h: Revert previous change.
+ (finish_struct_methods): Remove declaration.
+ * class.c: Revert previous change.
+ (maybe_warn_about_overly_private_class): New function.
+ (finish_struct_methods): Declare here, and make static. Remove
+ unnecessary parameters. Tidy slightly. Use
+ maybe_warn_about_overly_private_class.
+ (finish_struct_1): Adjust. Remove check for private constructors,
+ now done elsewhere.
+ (finish_struct): Adjust.
+
+1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
+
+ * except.c (expand_start_catch_block): No need to check for new
+ exception model.
+ (process_start_catch_block_old): Deleted.
+ (process_start_catch_block): Add call to start_decl_1().
+ (expand_end_catch_block): Add call to end_catch_handler().
+ * exception.cc (__cplus_type_matcher): Only check the exception
+ language if there is an exception table.
+
+1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
+
+ * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
+ as used to prevent conflicts with virtual function tables.
+
+1998-09-14 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
+ (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
+ * class.c (maybe_class_too_private_p): New function.
+ (finish_struct_methods): Use it.
+ (finish_struct_1): Likewise.
+ (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
+ appropriate.
+
+ * pt.c (check_specialization_scope): Fix spelling error.
+ (check_explicit_specialization): Remove code to handle explicit
+ specializations in class scope; they are now correctly diagnosed
+ as errors.
+
+1998-09-10 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (pushdecl): Don't copy types if the
+ DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
+ type.
+
+1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
+
+ * class.c (get_enclosing_class): New function.
+ (is_base_of_enclosing_class): Likewise.
+ * cp-tree.h (get_enclosing_class): Declare.
+ (is_base_of_enclosing_class): Likewise.
+ * pt.c (coerce_template_parms): Use them.
+
+1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
+
+ * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
+ null to decide whether to use it.
+
+ * error.c (dump_type_real): Handle NAMESPACE_DECL.
+ * parse.y (base_class.1): Avoid crash on error.
+
+1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (make_typename_type): If context is a namespace, the code
+ is in error.
+
+1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * parse.y (nomods_initdcl0): Set up the parser stack correctly.
+
+1998-09-08 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (anonymous_namespace_name): Declare.
+ * decl.c: Define it.
+ (push_namespace): Use anonymous_namespace_name, rather than local
+ static anon_name.
+ * error.c (dump_decl): If a namespace is named
+ anonymous_namespace_name, call it {anonymous}.
+
+ * decl.c (grokparms): Distinguish between references and pointers
+ in error message.
+
+1998-09-08 Richard Henderson <rth@cygnus.com>
+ Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (process_partial_specialization): Consistantly allocate
+ and zero tpd.parms based on ntparms. Use tpd2.parms, not
+ tpd.parms, where appropriate.
+
+Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (INCLUDES): Update after recent toplevel gcc
+ reorganizations.
+
+1998-09-05 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
+ * class.c (finish_struct): Remove hackery to deal with explicit
+ specializations in class scope.
+ * decl.c (grokfndecl): Improve error-recovery.
+ * decl2.c (grokfield): Likewise.
+ * pt.c (check_specialization_scope): New function.
+ (begin_specialization): Call it.
+ (process_partial_specialization): New function, split out from
+ push_template_decl. Check partial specializations more
+ stringently.
+ (push_template_decl): Call it.
+ (check_explicit_specialization): Don't attempt to handle explicit
+ specializations in class scope.
+ (template_parm_data): Document. Add current_arg and
+ arg_uses_template_parms.
+ (mark_template_parm): Set it.
+ (tsubst_arg_types): Remove unused variable.
+ * semantics.c (begin_class_definition): Tweak.
+
+1998-09-04 Mark Mitchell <mark@markmitchell.com>
+
+ * inc/typeinfo (type_info::type_info(const char*)): Make
+ `explicit'.
+
+ * cp-tree.h (hash_tree_cons_simple): New macro.
+ * pt.c (tsubst_arg_types): New function. Use hash_tree_cons.
+ (coerce_template_parms): Use make_temp_vec, instead of
+ make_tree_vec. Document this behavior.
+ (lookup_template_class): Likewise.
+ (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
+ Remove dead code (and add ssertion to check its deadness). Fix
+ bug w.r.t. exception specifications.
+
+1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (import_export_vtable): Always make artificials comdat.
+ (import_export_decl): Likewise.
+ * pt.c (mark_decl_instantiated): Likewise.
+
+1998-09-03 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (finish_globally_qualified_member_call_expr):
+ Rename to ...
+ (finish_qualified_call_expr).
+ * semantics.c: Likewise.
+ * parse.y (primary): Use it.
+ * method.c (hack_identifier): Remove redundant code.
+
+ * init.c (resolve_offset_ref): Call convert_from_reference to
+ handle members of reference type. Improve error recovery.
+
+1998-09-03 Benjamin Kosnik <bkoz@cygnus.com>
+
+ * cp-tree.h: Declare warn_nontemplate_friend.
+ * decl2.c (lang_decode_option): Set.
+ * lang-options.h: Add -Wnon-template-friend.
+ * friend.c (do_friend): Use to toggle non-template function warning.
+
+1998-09-03 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (finish_enum): Don't resolve CONST_DECLs to their
+ corresponding INTEGER_CSTs when processing_template_decl.
+ * pt.c (tsubst_enum): Tweak accordingly.
+
+1998-09-03 Benjamin Kosnik <bkoz@rhino.cygnus.com>
+
+ * decl.c (pushdecl_class_level): Add warning here.
+ (pushdecl): Tweak.
+
+1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cvt.c (convert_pointer_to_real): Tidy.
+ * search.c (get_base_distance_recursive): Simplify.
+ (get_base_distance): Likewise.
+
+ * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
+ parms.
+
+Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lex.c (check_newline): Call HANDLE_PRAGMA before
+ HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
+ if unknown pragmas are encountered.
+ (handle_sysv_pragma): Interpret return code from
+ handle_pragma_token (). Return success/failure indication rather
+ than next unprocessed character.
+ (pragma_getc): New function: retrieves characters from the
+ input stream. Defined when HANDLE_PRAGMA is defined.
+ (pragma_ungetc): New function: replaces characters back into the
+ input stream. Defined when HANDLE_PRAGMA is defined.
+
+1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
+ * class.c (build_vtable_entry_ref): Likewise.
+
+1998-09-01 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
+ * decl2.c (import_export_decl): Likewise.
+ * pt.c (instantiate_decl): Use it.
+
+1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (lookup_name_real): Also do implicit typename thing for
+ artificial TYPE_DECLs.
+ * search.c (lookup_field): Likewise.
+ (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
+ * semantics.c (begin_constructor_declarator): Use enter_scope_of.
+ (enter_scope_of): Extract type from implicit typename.
+ (begin_class_definition): Likewise.
+ * lex.c (identifier_type): Handle implicit typename when checking
+ for SELFNAME.
+
+ * cp-tree.h: Declare flag_strict_prototype.
+ * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
+ -fstrict-prototype.
+ * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
+ specified, set it to the value of pedantic.
+
+1998-09-01 Mark Mitchell <mark@markmitchell.com>
+
+ * decl2.c (arg_assoc): Handle template-id expressions as arguments.
+
+1998-08-31 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (finish_enum): Handle member enums of classes declared in
+ template functions.
+
+ * decl2.c (grok_x_components): Strip attributres before calling
+ groktypename.
+
+1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.h, decl2.c: Remove support for -fall-virtual,
+ -fenum-int-equivalence and -fno-nonnull-objects.
+ * class.c (check_for_override): Remove support for -fall-virtual.
+ (finish_struct_1): Likewise.
+ * call.c (build_new_op): Remove support for -fenum-int-equivalence.
+ * typeck.c (build_binary_op_nodefault): Likewise.
+ * cvt.c (ocp_convert): Likewise.
+ * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
+ * class.c (build_vbase_path): Likewise.
+
+Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
+
+ * Makefile.in (INTERFACE): New, set to 1.
+
+1998-08-30 Mark Mitchell <mark@markmitchell.com>
+
+ * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
+ comparing with global_namespace.
+ (dump_aggr_type): Likewise.
+
+ * decl.c (grokfndecl): Issue error on declaration of friend
+ templates with explicit template arguments.
+
+ * pt.c (convert_template_argument): New function, split out
+ from...
+ (coerce_template_parms): Here.
+ (tsubst): Attempt better error-recovery.
+
+1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com>
+
+ * pt.c (decl_template_parm_p): Add checks for
+ TEMPLATE_TEMPLATE_PARM.
+
+1998-08-28 Mark Mitchell <mark@markmitchell.com>
+
+ * lex.c (do_identifier): Fix thinko in previous change.
+
+1998-08-28 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
+ * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
+
+1998-08-28 Richard Henderson <rth@cygnus.com>
+
+ Add support for discarding unused virtual functions.
+ * lang-options.h: Add -fvtable-gc.
+ * cp-tree.h: Add flag_vtable_gc.
+ * decl2.c (output_vtable_inherit): New fn.
+ (finish_vtable_vardecl): Call it.
+ * class.c (build_vtable_entry_ref): New fn.
+ (build_vtbl_ref): Call it.
+
+1998-08-28 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (build_enumerator): Take the enumeration type as a
+ paramter.
+ * decl.c (finish_enum): Don't set the TREE_TYPE for the
+ enumeration constant values if we're processing_template_decls.
+ Don't set the type for the CONST_DECLs either; that's done in
+ build_enumerator.
+ (build_enumerator): Take the enumeration type as a
+ parameter.
+ * lex.c (do_identifier): Don't resolve enumeration constants while
+ processing template declarations, even if they happen to be
+ TEMPLATE_PARM_INDEXs.
+
+ * parse.y (current_enum_type): New variable.
+ (primary): Don't allow statement-expression in local classes just
+ as we don't in global classes.
+ (structsp): Use current_enum_type.
+ (enum_list): Likewise.
+ * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
+ finish_enum; they no longer occur.
+
+ * cp-tree.h (finish_base_specifier): New function.
+ * parse.y (base_class): Use it.
+ * semantics.c (finish_base_specifier): Define it.
+
+ * parse.y (structsp): Warn on use of typename outside of template
+ declarations.
+
+1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
+
+ * lex.c (handle_cp_pragma): Remove #pragma vtable.
+ * lang-options.h: Remove +e options.
+ * decl2.c (lang_decode_option): Likewise.
+ (import_export_vtable): Don't check write_virtuals.
+ (finish_vtable_vardecl, finish_file): Likewise.
+ * search.c (dfs_debug_mark): Likewise.
+ * semantics.c (begin_class_definition): Likewise.
+ * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
+
+ * call.c (build_over_call): Check flag_elide_constructors.
+ * decl2.c: flag_elide_constructors defaults to 1.
+ * typeck.c (convert_arguments): Remove return_loc parm.
+ (build_function_call_real): Adjust.
+
+ * search.c: Tear out all mi_matrix and memoize code.
+ (lookup_field, lookup_fnfields): Use scratch_tree_cons.
+ * lang-options.h: Remove documentation for -fhandle-exceptions,
+ -fmemoize-lookups and -fsave-memoized.
+ * cp-tree.h: Lose mi_matrix and memoize support.
+ * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
+ * class.c: Lose struct class_level.
+ (pushclass, popclass): Lose memoize support.
+ * init.c (build_offset_ref): Likewise.
+
+ Never change BINFO_INHERITANCE_CHAIN.
+ * init.c (emit_base_init): Change modification of
+ BINFO_INHERITANCE_CHAIN to an assert.
+ * search.c (get_base_distance_recursive): Likewise.
+ (get_base_distance): Likewise.
+ (lookup_member): Likewise.
+ (convert_pointer_to_single_level): Likewise.
+ (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs.
+ (lookup_fnfields): Likewise.
+ * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
+ (unshare_base_binfos): Don't call propagate_binfo_offsets.
+ (layout_basetypes): Call propagate_binfo_offsets instead of
+ unshare_base_binfos.
+ * decl.c (xref_basetypes): Call unshare_base_binfos.
+ * pt.c (instantiate_class_template): Likewise.
+ * tree.c (reverse_path): Remove 'copy' parm; always make a
+ temporary copy.
+ * class.c (build_vbase_path): Just call it.
+ * search.c (compute_access): Likewise. Don't re-reverse.
+
+1998-08-27 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (build_vbase_path): Use reverse_path.
+ (finish_base_struct): Move warnings for inaccessible bases to
+ layout_basetypes.
+ (modify_one_vtable): Remove check of TREE_USED (binfo).
+ (fixup_vtable_deltas1): Likewise.
+ * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
+ (xref_tag): Remove binfos parameter.
+ (make_binfo): Remove chain parameter.
+ (reverse_path): Add copy parameter.
+ * decl.c (init_decl_processing): Change calls to xref_tag.
+ (xref_tag): Remove binfos parameter.
+ (xref_basetypes): Change calls to make_binfo.
+ * decl2.c (grok_x_components): Change calls to xref_tag.
+ (handle_class_head): Likewise.
+ * friend.c (do_friend): Likewise.
+ * lex.c (make_lang_type): Change calls to make_binfo.
+ * parse.y (structsp): Change calls to xref_tag.
+ (named_complex_class_head_sans_basetype): Likewise.
+ (named_class_head): Likewise.
+ * rtti.c (init_rtti_processing): Likewise.
+ * search.c (compute_access): Change calls to reverse_path.
+ (dfs_get_vbase_types): Change calls to make_binfo.
+ (get_vbase_types): Remove dead code.
+ * tree.c (unshare_base_binfos): Change calls to make_binfo.
+ (layout_basetypes): Warn here about inaccessible bases.
+ (make_binfo): Remove chain parameter.
+ (reverse_path): Add copy parameter.
+
+1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c: #if 0 complete_type_p.
+ * init.c (build_java_class_ref, build_new_1): Remove unused locals.
+ * method.c (process_overload_item): Likewise.
+ * typeck.c (comp_target_types): Likewise.
+
+ Stop sharing binfos for indirect virtual bases.
+ * tree.c (propagate_binfo_offsets): Unshare vbases, too.
+ (layout_basetypes): Likewise.
+ (unshare_base_binfos): Copy vbases, too.
+ * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
+ BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
+ (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
+ CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
+ * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
+ reference to BINFO_VIA_PUBLIC.
+ (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
+ (push_class_decls): Use them.
+ (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
+ (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
+
+1998-08-27 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (build_enumerator): Set DECL_CONTEXT for the
+ CONST_DECLs.
+
+1998-08-26 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (finish_enum): Change prototype.
+ * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
+ VALUES parameter. Don't try to compute mins/maxs if
+ processing_template_decl.
+ * parse.y (structsp): Use new calling sequence for finish_enum.
+ * pt.c (tsubst_enum): Likewise. Take the new type as input.
+ (lookup_template_class): Remove unused variables. Tweak.
+ Register enums on instantiation list before substituting
+ enumeration constants.
+ (tsubst_decl): Remove unused variables.
+ (regenerate_decl_from_template): Likewise.
+
+ * decl.c (duplicate_decls): Don't obliterate the
+ DECL_TEMPLATE_INFO for a template if we're not replacing it with
+ anything.
+
+ * lex.c (do_identifier): Fix typo in comment.
+
+Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * errfn.c: Remove stdarg.h/varargs.h.
+ * tree.c: Likewise.
+
+1998-08-25 Brendan Kehoe <brendan@cygnus.com>
+
+ * pt.c (tsubst_copy): Only do typename overloading on an
+ IDENTIFIER_NODE that happens to look like a typename if it actually
+ has a type for us to use.
+
+1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck.c (comp_cv_target_types): Split out...
+ (comp_target_types): From here. Don't allow cv-qual changes under
+ a pointer if nptrs == 0. Fix OFFSET_TYPE handling.
+ (build_ptrmemfunc): Pass 1 to nptrs.
+ * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
+
+1998-08-25 Mark Mitchell <mark@markmitchell.com>
+
+ * search.c (dependent_base_p): Don't compare a binfo to
+ current_class_type; use the TREE_TYPE of the binfo instead.
+
+ * cp-tree.h (CLASS_TYPE_P): Revise definition.
+
+1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (duplicate_decls): Don't complain about different
+ exceptions from an internal decl even if pedantic.
+
+ * typeck.c (convert_for_assignment): Converting from pm of vbase
+ to derived is an error, not a sorry.
+
+ * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
+ * class.c (fixed_type_or_null): Rename from
+ resolves_to_fixed_type_p. Return the dynamic type of the
+ expression, if fixed, or null.
+ (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type
+ does not match the static type.
+ (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use
+ resolves_to_fixed_type_p again.
+
+1998-08-24 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (tsubst_decl): Move special case code for dealing with
+ tricky friend templates here from ...
+ (regenerate_decl_from_template): Here.
+
+1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (start_decl): Remove redundant linkage check.
+
+1998-08-24 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * typeck.c (c_expand_return): Handle the case that valtype
+ is wider than the functions return type.
+
+1998-08-24 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (CLASS_TYPE_P): New macro.
+ * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
+ * pt.c (process_template_parm): Undo previous change.
+
+1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
+
+ * cp-tree.h: Declare.
+ * pt.c (decl_template_parm_p): New function.
+ * decl.c (pushdecl): Check decls for redeclaring template parms.
+ (xref_tag): Make redeclaration an error, print decl.
+ * decl2.c (grokfield): Check field_decls for redeclaration as well.
+
+1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * parse.y (primary): Fix up the type of string constants.
+
+1998-08-24 Mark Mitchell <mark@markmitchell.com>
+
+ * typeck.c (convert_for_initialization): Move check for odd uses
+ of NULL to avoid duplicate warnings.
+
+1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (lvalue_type): Fix for arrays.
+ * typeck.c (string_conv_p): New fn.
+ (convert_for_assignment): Use it.
+ (build_unary_op): Use lvalue_type.
+ * call.c (standard_conversion, convert_like): Use string_conv_p.
+ (add_function_candidate): Use lvalue_type.
+ * cvt.c (convert_to_reference): Likewise.
+ * decl2.c (lang_decode_option): Ignore -traditional.
+ * decl.c (init_decl_processing): flag_writable_strings inhibits
+ flag_const_strings.
+
+1998-08-24 Andrew MacLeod <amacleod@cygnus.com>
+
+ * lang-options.h (lang_options): Add fconst-strings to the list
+ of valid options.
+ * decl2.c (lang_f_options, lang_decode_option): Likewise.
+
+1998-08-24 Nathan Sidwell <nathan@acm.org>
+
+ * lex.c (real_yylex): Don't warn about long long constants if
+ we're allowing long long.
+
+1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
+ accessing bindings directly.
+
+ * search.c (my_tree_cons): Reimplement.
+
+ * lang-specs.h: Remove __HONOR_STD.
+ * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
+
+1998-08-23 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (grokdeclarator): Complain about in-class initialization
+ of aggregates and/or references.
+ * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
+ TEMPLATE_TYPE_PARMs.
+
+ * decl2.c (grok_array_decl): Add comment.
+ (mark_used): Don't instantiate an explicit instantiation.
+ * friend.c (make_friend_class): Remove bogus comment. Fix check
+ for partial specializations.
+ * pt.c (check_explicit_specialization): Don't
+ SET_DECL_EXPLICIT_INSTANTIATION here.
+ (mark_decl_instantiated): Or here.
+ (do_decl_instantiation): Do it here, instead. Add checks for
+ duplicate explicit instantiations, etc. Tidy.
+ (do_type_instantiation): Likewise.
+ (instantiate_decl): Improve comments. Complain about explicit
+ instantiations where no definition is available.
+
+ * cp-tree.h (ansi_null_node): Remove.
+ * call.c (build_over_call): Warn about converting NULL to an
+ arithmetic type.
+ * cvt.c (build_expr_type_conversion): Likewise. Use
+ null_ptr_cst_p instead of expanding it inline.
+ * decl.c (ansi_null_node): Remove.
+ (init_decl_processing): Make null_node always have integral type.
+ * except.c (build_throw): Warn about converting NULL to an
+ arithmetic type.
+ * lex.c (init_parse): Remove handling of ansi_null_node.
+ * pt.c (type_unification_real): Don't convert NULL to void* type.
+ * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
+ (convert_for_assignment): Warn about converting NULL to an
+ arithmetic type.
+ (convert_for_initialization): Likewise.
+
+1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
+ * pt.c (coerce_template_parms): Use no_linkage_check.
+ * decl.c (grokvardecl): Likewise.
+ (grokfndecl): Likewise. Members of anonymous types have no linkage.
+
+ * method.c (process_overload_item): Remove useless code.
+
+1998-08-20 Per Bothner <bothner@cygnus.com>
+
+ Handle new'ing of Java classes.
+ * init.c (build_class_classref): New function.
+ (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject;
+ constructor does not return this; don't need to exception-protect.
+
+ * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag.
+ * decl2.c (acceptable_java_type): Handle template-derived types.
+
+1998-08-20 Per Bothner <bothner@cygnus.com>
+
+ * decl2.c (import_export_vtable): Suppress vtables for Java classes.
+
+1998-08-20 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (duplicate_decls): Always merge the old and new patterns
+ for templates, regardless of whether or not the new one has
+ DECL_INITIAL. Don't throw away specializations. Merge
+ DECL_SAVED_TREE.
+ * pt.c (tsubst_decl): Use the right pattern when calculating the
+ complete args for a new template instance.
+ (do_decl_instantiation): Fix typo in comment.
+ (regenerate_decl_from_template): Deal with tricky friend template
+ case.
+ (instantiate_decl): Likewise.
+
+Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com)
+
+ * init.c (build_builtin_delete_call): Add missing assemble_external
+ call.
+
+1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
+
+ * parse.y (notype_unqualified_id): Also accept ~A<int>.
+
+1998-08-19 Mark Mitchell <mark@markmitchell.com>
+
+ * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
+ arithmetic.
+ * except.c (build_throw): Warn when NULL is thrown, even with
+ -ansi. Use ansi_null_node, rather than integer_zero_node, in the
+ thrown expression.
+
+ * cp-tree.h (ansi_null_node): New variable.
+ * decl.c (ansi_null_node): New variable.
+ (init_decl_processing): Initialize its type.
+ * lex.c (init_parse): Initialize its value. Use ansi_null_node
+ for null_node in non-ANSI mode.
+ * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
+ place of null_node to avoid spurious errors.
+
+1998-08-17 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (enter_scope_of): New function.
+ * parse.y (complex_direct_notype_declarator): Use it.
+ * semantics.c (enter_scope_of): New function.
+
+1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (grokparms): No, here.
+
+ * decl.c (grokdeclarator): Catch parm with pointer to array of
+ unknown bound here...
+ * method.c (process_overload_item): ...not here.
+
+ * gxxint.texi: Remove obsolete documentation of overloading code.
+
+ * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
+ * class.c (finish_struct_bits): Likewise.
+
+ * tree.c (lvalue_type): Fix for arrays.
+ * typeck.c (build_unary_op): Use lvalue_type.
+ * call.c (add_function_candidate): Likewise.
+ * cvt.c (convert_to_reference): Likewise.
+
+ * decl2.c (lang_decode_option): Ignore -traditional.
+
+ * init.c (build_offset_ref): Don't mess with error_mark_node.
+ * lex.c (do_scoped_id): Use cp_error.
+
+ * rtti.c (get_tinfo_fn): Don't mess with the context for now.
+
+1998-08-17 Benjamin Kosnik <bkoz@loony.cygnus.com>
+
+ * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
+
+Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com)
+
+ * cp-tree.h (set_identifier_local_value): Provide prototype.
+
+ * decl2.c (do_namespace_alias): Remove unused variables `binding'
+ and `old'.
+
+Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com>
+
+ * Makefile.in: Rename BBISON to BISON so that it can be properly
+ inherited from the parent makefile.
+
+1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
+
+ * lang-options.h: Add -finit-priority.
+ * decl2.c: Likewise. Check flag_init_priority instead of
+ USE_INIT_PRIORITY.
+
+ * decl2.c (setup_initp): New fn.
+ (start_objects, finish_objects, do_ctors): Handle init_priority.
+ (do_dtors, finish_file): Likewise.
+
+1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (tsubst_copy): Hush warning.
+
+ * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
+
+1998-08-12 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (print_template_context): Don't abort when instantiating a
+ synthesized method.
+
+ * decl.c (grokdeclarator): Issue errors on namespace qualified
+ declarators in parameter lists or in class scope.
+
+1998-08-09 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (check_explicit_specialization): Don't abort on bogus
+ explicit instantiations.
+
+1998-08-07 Mark Mitchell <mark@markmitchell.com>
+
+ * typeck.c (require_complete_type): Use complete_type_or_else.
+ (complete_type_or_else): Always return NULL_TREE on failure, as
+ documented.
+
+ * pt.c (tsubst_aggr_type): Prototype.
+ (tsubst_decl): New function, split out from tsubst. Set
+ input_filename and lineno as appropriate.
+ (pop_tinst_level): Restore the file and line number saved in
+ push_tinst_level.
+ (instantiate_class_template): Set input_filename and lineno as
+ appropriate.
+ (tsubst): Move _DECL processing to tsubst_decl. Make sure the
+ context for a TYPENAME_TYPE is complete.
+
+ * decl2.c (grokbitfield): Issue errors on bitfields declared with
+ function type.
+ (do_dtors): As in do_ctors, pretend to be a member of the same
+ class as a static data member while generating a call to its
+ destructor.
+
+ * cvt.c (cp_convert_to_pointer): Handle NULL pointer
+ conversions, even in complex virtual base class hierarchies.
+
+1998-08-06 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
+ (TYPE_TEMPLATE_INFO): Likewise.
+ (SET_TYPE_TEMPLATE_INFO): Likewise.
+ (ENUM_TI_TEMPLATE): Likewise.
+ (ENUM_TI_ARGS): Likewise.
+ (lookup_nested_type_by_name): Remove.
+ * decl.c (maybe_process_template_type_declaration): Handle enums.
+ (start_enum): Don't check for primary-template enum declarations
+ here.
+ (finish_enum): Clean up, document. Make sure template enum
+ constants get the correct type.
+ (build_enumerator): Copy initializers for template enumerations,
+ too.
+ (grok_enum_decls): Document.
+ * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
+ better. Build LOOKUP_EXPRs for local variables, even if they are
+ TREE_PERMANENT.
+ * pt.c (tsubst_enum): Remove field_chain parameter.
+ (template_class_depth): Include the depth of surrounding function
+ contexts.
+ (push_template_decl): Check for primary-template enum declarations
+ here. Deal with enumeration templates.
+ (lookup_template_class): Likewise.
+ (for_each_template_parm): Likewise.
+ (instantiate_class_template): Don't call tsubst_enum directly,
+ call tsubst instead, to instantiate enums. Deal with all
+ field_chain issues here, not in tsubst_enum.
+ (lookup_nested_type_by_name): Remove.
+ (tsubst_aggr_type): Revise handling of enumeration types.
+ (tsubst): Likewise.
+ (tsubst_copy): Likewise.
+ (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
+
+1998-08-04 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
+ uses template parameters.
+ * method.c (build_template_parm_names): Use the full set of
+ template arguments for tsubst'ing.
+ (build_overload_identifier): Pass the full set of template
+ arguments to build_template_parm_names, not just the
+ innermost_args.
+ * pt.c (TMPL_ARGS_DEPTH): Define using
+ TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
+ (NUM_TMPL_ARGS): New macro.
+ (add_outermost_template_args): Deal with the case where the outer
+ args will be completely discarded.
+ (coerce_template_parms): Use the full set of template arguments
+ for tsubst'ing. Simplify. Add some asserts. Improve
+ error messages.
+ (lookup_template_class): Pass the full set of template arguments
+ to coerce_template_parms.
+ (tsubst): Add assertion.
+ (do_type_instantiation): Don't instantiate member template
+ classes.
+
+ * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
+ name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
+
+1998-08-03 Jason Merrill <jason@yorick.cygnus.com>
+
+ * method.c (set_mangled_name_for_decl): Change return type to void.
+
+ * decl.c (lookup_name_real): A namespace-level decl takes priority
+ over implicit typename. Avoid doing the same lookup twice.
+
+ * search.c (dependent_base_p): New fn.
+ (dfs_pushdecls, dfs_compress_decls): Use it.
+
+ * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
+ virtual functions if the type doesn't have any.
+
+1998-08-03 Mark Mitchell <mark@markmitchell.com>
+
+ * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
+ uses template parameters.
+
+1998-08-02 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument.
+ * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
+ * lex.c (do_identifier): Don't use a second argument, or a type,
+ when building LOOKUP_EXPRs.
+ (do_identifier): Likewise.
+ (do_scoped_id): Likewise.
+ * method.c (hack_identifier): Improve error message.
+ * pt.c (lookup_template_function): Don't needlessly call
+ copy_to_permanent or build_min.
+ (tsubst_copy): Remove #if 0'd code. Tsubst into LOOKUP_EXPRs if
+ necessary.
+ (do_decl_instantiation): Improve error message.
+ * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
+ (build_min): Copy the type to the permanent obstack, too.
+
+1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
+
+ * init.c (init_init_processing): Remove BI* handling.
+ (build_builtin_call): Remove.
+ (build_builtin_delete_call): New fn.
+ (build_delete): Use it.
+
+1998-07-31 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
+ (maybe_check_template_type): New function.
+ * decl.c (maybe_process_template_type_declaration): New function,
+ split out from pushtag Call maybe_check_template_type.
+ (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P.
+ (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
+ * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
+ * pt.c (template_class_depth_real): Generalization of ...
+ (template_class_depth): Use it.
+ (register_specialization): Use duplicate_decls for duplicate
+ declarations of specializations.
+ (maybe_check_template_type): New function.
+ (push_template_decl_real): Fix comment.
+ (convert_nontype_argument): Likewise.
+ (lookup_template_class): Likewise. Avoid an infinite loop on
+ erroneous code.
+ (tsubst_friend_function): Fix comment.
+ (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
+ an IDENTIFIER_NODE.
+ * semantics.c (begin_function_definition): Use
+ reset_specialization to note that template headers don't apply
+ directly to declarations after the opening curly for a function.
+
+1998-07-29 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (push_overloaded_decl): Use current_namespace instead of
+ DECL_CONTEXT (decl) to determine where we go.
+
+ * decl.c (lookup_name_real): Fix typo.
+
+1998-07-28 Mark Mitchell <mark@markmitchell.com>
+
+ * friend.c (is_friend): Be lenient with member functions to deal
+ with nested friends.
+
+1998-07-28 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (finish_struct_1): Convert integer_zero_node to
+ ssizetype before passing it to set_rtti_entry.
+ * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
+ of any size to a pointer.
+
+1998-07-27 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
+ (build_template_decl_overload): Remove.
+ (set_mangled_name_for_decl): New function.
+ (innermost_args): Remove is_spec parameter.
+ (most_specialized, most_specialized_class): Remove declarations.
+ (lookup_template_class): Add entering_scope parameter.
+ (maybe_process_partial_specialization): New function.
+ (finish_template_decl): Likewise.
+ (finish_template_type): Likewise.
+ * class.c (finish_struct): Clean up processing of member template
+ specializations.
+ * decl.c (pushtag): Fix formatting.
+ (lookup_tag): Improve handling of pseudo-global levels.
+ (make_typename_type): Adjust call to lookup_template_class.
+ (shadow_tag): Use maybe_process_partial_specialization.
+ (xref_tag): Improve handling of member friends.
+ (start_function): Call push_nested_class before
+ push_template_decl. Don't call push_template_decl for
+ specializations.
+ * decl2.c (grok_x_components): Don't call xref_tag for
+ template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
+ (grokclassfn): Use set_mangled_name_for_decl.
+ (arg_assoc_class): Adjust call to innermost_args.
+ (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
+ * error.c (dump_function_name): Improve printing of template
+ function names.
+ * friend.c (is_friend): Don't compare types of decls to determine
+ friendship, unless flag_guiding_decls.
+ (make_friend_class): Partial specializations cannot be friends.
+ (do_friend): Use set_mangled_name_for_decl. Call
+ push_template_decl_real instead of push_template_decl.
+ * method.c (build_decl_overload_real): Remove prototype. Give it
+ external linkage.
+ (build_overload_identififer): Adjust call to innermost_args.
+ (build_template_decl_overload): Remove.
+ (set_mangled_name_for_decl): New function.
+ * parse.y (.finish_template_type): New non-terminal.
+ (template_def): Use finish_template_decl. Use template_extdef
+ instead of extdef.
+ (template_extdef, template_datadef): New non-terminals, containing
+ only those rules for things which can be templates.
+ (datadef): Tidy.
+ (template_type, self_template_type): Use .finish_template_type.
+ (named_class_head): Use maybe_process_partial_specialization.
+ * pt.c (mangle_class_name_for_template): Remove context parameter.
+ (get_class_bindings): Remove outer_args parameter.
+ (complete_template_args): Remove.
+ (add_outermost_template_args): New function.
+ (register_specialization): Return the specialization.
+ (unregister_specialization): New function.
+ (tsubst_template_parms): Likewise.
+ (most_specialized, most_specialized_class): Prototype here as
+ static.
+ (original_template): Rename to most_general_template.
+ (tsubst_template_parms): New function.
+ (set_mangled_name_for_template_decl): Likewise.
+ (TMPL_ARGS_DEPTH): New macro.
+ (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
+ (TMPL_ARGS_LEVEL): New macro.
+ (SET_TMPL_ARGS_LEVEL): Likewise.
+ (TMPL_ARG): Likewise.
+ (SET_TMPL_ARG): Likewise.
+ (TMPL_ARGS_DEPTH): Likewise.
+ (finish_member_template_decl): Use finish_template_decl.
+ (maybe_process_partial_specialization): New function, split out
+ from tsubst.
+ (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
+ (maybe_begin_member_template_processing): Use new macros.
+ (is_member_template): Likewise.
+ (is_member_template_class): Likewise.
+ (add_to_template_args): Likewise. Deal with multiple levels of
+ args.
+ (maybe_process_partial_specialization): New function.
+ (retrieve_specialization): Add consistency check.
+ (determine_specialization): Return full argument list.
+ (check_explicit_specialization): Tweak friend handling. Use full
+ argument lists. Simplify.
+ (current_template_args): Use new macros.
+ (push_template_decl_real): Change ill-named mainargs to specargs.
+ Check that a partial specialization actually specializes at least
+ one parameter. Improve friend handling. Modify for full
+ template arguments.
+ (classtype_mangled_name): Don't mangle the names of
+ specializations.
+ (lookup_template_class): Add entering_scope parameter. Use it to
+ avoid finding a template type when an instantiation is required.
+ Simplify. Use full template arguments.
+ (tsubst_friend_function): Use unregister_specialization. Use new
+ macros. Use full template arguments.
+ (tsubst_friend_class): Substitute, using tsubst_template_parms,
+ into the template parameters before passing them to
+ redeclare_class_template.
+ (instantiate_class_template): Simplify. Use full template
+ arguments. Adjust calls to get_class_bindings. Use
+ SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
+ (innermost_args): Use new macros.
+ (tsubst_aggr_type): New function, split out from tsubst.
+ (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
+ conventions for lookup_tmeplate_class. Refine handling of partial
+ instantiations. Remove calls to complete_template_args.
+ Simplify. Add consistency checks. Use set_mangled_name_for_decl
+ and set_mangled_name_for_template_decl.
+ (tsubst_copy): Use tsubst_aggr_type.
+ (instantiate_template): Use full template arguments.
+ (more_specialized): Improve formatting.
+ (more_specialized_class): Adjust calls to get_class_bindings.
+ (get_bindings_real): Don't call complete_template_args.
+ (most_specialized): Don't overwrite input; create a new list.
+ (most_specialized_class): Use most_general_template.
+ (regenerate_decl_from_template): Use unregister_specialization.
+ Use full template arguments.
+ (instantiate_decl): Use full template arguments.
+ (set_mangled_name_for_template_decl): New function.
+ * semantics.c (begin_class_definition): Use
+ maybe_process_partial_specialization.
+ (finish_member_class_template): New function.
+ (finish_template_decl): Likewise.
+ (finish_template_type): Likewise.
+ (typeck.c): Don't crash after issuing a compiler_error.
+ * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
+
+1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck2.c (build_functional_cast): Handle default-initialization.
+
+ * call.c (build_over_call): Pass 1 to popclass.
+
+ * parse.y (direct_notype_declarator): Add precedence declaration
+ to notype_unqualified_id case.
+ * Makefile.in (EXPECT): Adjust.
+
+ * tree.c (ovl_member): Fix for single function in OVL.
+
+1998-07-27 Dave Brolley <brolley@cygnus.com>
+
+ * c-lex.c (yylex): Fix boundary conditions in character literal and
+ string literal loops.
+
+1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (lookup_name_real): OK, do return the from_obj value
+ unless got_object depends on template parms.
+
+ * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
+
+ * pt.c (coerce_template_parms): Also complain about local enums.
+
+ * cp-tree.h: Add prototype for set_identifier_local_value.
+ * decl.c (set_identifier_local_value_with_scope): Make static,
+ prototype.
+ * search.c (covariant_return_p): Likewise.
+ * except.c (build_terminate_handler, alloc_eh_object): Likewise.
+
+ * call.c (build_method_call): Only pull out the type of a destructor
+ if it's a template type parm.
+ * decl.c (lookup_name_real): Never return the from_obj value.
+
+1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
+
+ * except.c (process_start_catch_block_old): Call start_decl_1 for
+ catch parm.
+ * decl.c (start_decl_1): Avoid duplicate error.
+
+ * init.c (expand_default_init): Only perform the initialization if
+ it will do something.
+
+1998-07-23 H.J. Lu (hjl@gnu.org)
+
+ * parse.y (base_class): Check for invalid base class.
+
+1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (import_export_template): Fold in...
+ (import_export_class): ...to here. Handle dllimport/export.
+
+ * class.c (build_vtable): Pass at_eof to import_export_vtable.
+ (prepare_fresh_vtable): Likewise.
+ * decl2.c (import_export_class): Split out...
+ (finish_prevtable_vardecl): From here.
+ * class.c (finish_struct_1): Call import_export_class if at_eof.
+
+ * decl.c (start_function): #if 0 mysterious code I wrote and have
+ forgotten why.
+ * rtti.c (get_tinfo_fn): If this is for a class type, set
+ DECL_CONTEXT.
+
+1998-07-22 Jason Merrill <jason@yorick.cygnus.com>
+
+ * inc/exception: Change terminate and unexpected to ().
+
+ * parse.y (named_class_head_sans_basetype_defn): A
+ named_class_head_sans_basetype followed by '{' or ':' is a defn.
+
+1998-07-21 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (canonical_type_variant): New fn to handle arrays.
+ * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
+ * pt.c (unify, default case): Also fold arg. Fix array bounds case.
+ * method.c (process_overload_item): Use build_overload_value for
+ arrays.
+
+1998-07-20 Dave Brolley <brolley@cygnus.com>
+
+ * lex.c (mbchar.h): #include it.
+ (GET_ENVIRONMENT): New macro.
+ (init_parse): Set character set based on LANG environment variable.
+ (real_yylex): Handle multibyte characters in character literals.
+ (real_yylex): Handle multibyte characters in string literals.
+
+1998-07-19 Jason Merrill <jason@yorick.cygnus.com>
+
+ * lex.c (do_identifier): Look for class value even if we don't
+ have a global value. Do implicit declaration if parsing is 2.
+ * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
+ lookup.
+
+1998-07-19 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (pushtag): Revert previous change.
+ * pt.c (lookup_template_class): Don't put out debugging
+ information for types that use template parameters.
+
+ * decl.c (pushtag): Don't put out debugging information for
+ compiler-generated typedefs.
+
+ * error.c (dump_type_real): Don't crash when presented with
+ intQI_type_node or the like.
+
+ * semantics.c (finish_translation_unit): Fix spelling error in
+ comment.
+
+1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (lookup_name_real): Pull out single function here.
+ (select_decl): Not here.
+ (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
+
+ * decl.c (qualify_lookup): Tweak again.
+
+ * pt.c (lookup_template_class): Don't mess with the context of the
+ instantiation.
+ * decl2.c (current_decl_namespace): Remove special handling for
+ templates.
+
+ * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
+ a member template specialization.
+
+ * tree.c (ovl_member): Use decls_match to compare functions.
+ * decl.c (decls_match): Check the context of a function.
+
+ * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
+ in Koenig lookup support rules.
+ * semantics.c (finish_call_expr): Handle the new cases.
+
+ * typeck.c (build_x_function_call): Handle overloaded methods.
+
+ * decl.c (grokvardecl): Don't call build_static_name for extern "C".
+
+1998-07-16 Mark Mitchell <mark@markmitchell.com>
+
+ * semantics.c (finish_object_call_expr): Revert previous change.
+ * call.c (build_new_method_call): Likewise. Instead, convert
+ TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
+
+1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (qualify_lookup): Handle templates.
+
+ * decl2.c (do_using_directive): Don't pass ancestor.
+ * decl.c (push_using_directive): Calculate ancestor.
+
+ * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
+ * decl.c (pushdecl): Move type shadowing handling from here...
+ (duplicate_decls): ...to here.
+ * decl.c (set_identifier_local_value_with_scope): New fn.
+ (pushdecl): Use it.
+ (set_identifier_local_value, lookup_type_current_level): New fns.
+ * decl2.c (do_local_using_decl): Handle types and binding level
+ stuff properly.
+
+ * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
+ * decl.c (select_decl): Extract a lone function from an OVERLOAD.
+ (lookup_namespace_name): Likewise.
+ * typeck.c (build_unary_op): Not here anymore.
+
+ * decl2.c (do_class_using_decl): Make sure we get an identifier.
+ * class.c (handle_using_decl): Ignore TYPE_DECLs.
+
+ * decl.c (qualify_lookup): New fn.
+ (lookup_name_real): Use it.
+
+1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de>
+
+ * decl2.c (add_using_namespace): When directly using a namespace
+ that was indirect before, promote it.
+
+ * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
+ LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
+ LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
+ * decl.c (select_decl): Replace two flag parameters by one.
+ (unqualified_namespace_lookup): Likewise, pass flag.
+ (lookup_flags): New function.
+ (lookup_name_real): Compute flags, pass them.
+ (lookup_namespace_name): Call with zero-flag.
+ * decl2.c (ambiguous_decl): Add flag parameter, complain only
+ according to flags.
+ (lookup_using_namespace, qualified_lookup_using_namespace):
+ Add flag parameter, pass them through.
+ * lex.c (do_scoped_id): Call with zero-flag.
+
+1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck.c (convert_for_assignment): Use comptypes.
+
+1998-07-16 Mark Mitchell <mark@markmitchell.com>
+
+ * semantics.c (finish_object_call_expr): Move test for the
+ function called being a TYPE_DECL to ...
+ * call.c (build_new_method_call): Here.
+
+1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (arg_assoc_class): Also look at template arguments, if any.
+ (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
+
+ * lex.c (looking_for_typename): Don't initialize.
+
+ * decl2.c (ambiguous_decl): Clarify error message.
+
+ * decl.c (push_using_directive): Iterate over namespaces used
+ indirectly.
+
+1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl2.c (add_using_namespace): Iterate over namespaces used
+ indirectly.
+
+ * decl.c (lookup_name_real): Accept namespace aliases as locals.
+ (cat_namespace_levels): Ignore aliases.
+ (duplicate_decls): Ignore duplicate aliases.
+ * decl2.c (do_namespace_alias): Process block level namespace
+ aliases. Store alias with pushdecl. Remove odr errors.
+ * parse.y (namespace_alias): New non-terminal.
+ (extdef): Use it.
+
+1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
+ Handle TEMPLATE_TYPE_PARM.
+ (arg_assoc): Rewrite.
+
+ * pt.c (complete_template_args): Don't look at the context unless
+ we have to.
+
+ * method.c (build_decl_overload_real): Fix namespace handling.
+
+ * typeck.c (build_unary_op): Extract a lone function from an
+ OVERLOAD.
+
+ * call.c (build_scoped_method_call): Handle getting a namespace
+ for basetype in a destructor call.
+ (check_dtor_name): Handle enums.
+
+ * parse.y (using_directive): New nonterminal.
+ (extdef, simple_stmt): Use it.
+
+1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl2.c (add_function): Move error message ...
+ (arg_assoc_namespace): ... from here.
+
+1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
+
+ * parse.y (namespace_qualifier): Fix multiple level handling.
+ * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
+ (arg_assoc): Don't skip the first argument of a function.
+
+Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com)
+
+ * search.c (my_tree_cons): Clean up.
+
+1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (joust): Don't warn about "confusing" conversions to the
+ same type.
+
+1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * class.c (push_nested_class): Complain about namespaces.
+ * decl.c (start_decl): Enter the object's namespace.
+ (cp_finish_decl): Leave it.
+ (grokdeclarator): Likewise.
+ * decl2.c (check_decl_namespace): New function.
+ (finish_file): Call it.
+ * parse.y (complex_direct_notype_declarator): Set complexity
+ of namespace-qualified ids to -1, enter the namespace.
+
+ * method.c (build_template_decl_overload): Expect _DECL as first
+ parameter. Put context temporarily into current_namespace.
+ * pt.c (check_explicit_specialization): Change caller.
+ (tsubst): Likewise.
+
+ * init.c (build_offset_ref): Call mark_used and
+ convert_from_reference for namespace members.
+
+Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * search.c (my_tree_cons): The bitfield is at index 2.
+
+Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lang-options.h: Format changed to work with new --help support
+ in gcc/toplev.c
+
+1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl2.c (build_expr_from_tree): Change calls of do_identifier.
+ Do Koenig lookup in CALL_EXPR.
+ (arg_assoc): Handle error_mark.
+ * lex.c (is_global): New function.
+ (do_identifier): Expect arguments for Koenig lookup.
+ * parse.y (primary): Add rules for calls of unqualified function calls.
+ (do_id): Change call of do_identifier.
+ * pt.c (finish_stmt_expr): Likewise.
+ * semantics.c (finish_id_expr): Likewise.
+ (finish_call_expr): Add integer parameter to indicate
+ argument-dependent lookup.
+
+ * decl.c (struct binding_level): New field using_directives.
+ (push_using_decl): Not sorry anymore.
+ (push_using_directive): New function.
+ (lookup_tag): Use CP_DECL_CONTEXT to iterate.
+ (unqualified_namespace_lookup): New function, code from ...
+ (lookup_name_real): ... here.
+ * decl2.c (lookup_using_namespace): Pass using list instead of
+ initial scope.
+ (validate_nonmember_using_decl): New function.
+ (do_nonmember_using_decl): New function.
+ (do_toplevel_using_decl): Use them.
+ (do_local_using_decl): New function.
+ (do_using_directive): Support block-level directives.
+ * parse.y (simple_stmt): Support using declarations and
+ directives.
+ (namespace_qualifier, namespace_using_decl): New non-terminals.
+
+ * xref.c (classname): New function.
+ (GNU_xref_hier): Change class and base parameters to tree.
+ * decl.c (xref_baseypes): Change caller.
+ * friend.c (make_friend_class): Likewise.
+
+1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
+
+ * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
+ comparison.
+
+ * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
+ template template parameter, record its use.
+ (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
+ its template arguments if exists.
+
+ * pt.c (coerce_template_template_parms): New function equivalent
+ to coerce_template_parms when IS_TMPL_PARM is true.
+ (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter,
+ all callers changed.
+
+ (coerce_template_parms): Access ARGLIST properly when creating a
+ new vector. Only accept implicit TYPE_DECL as valid argument for
+ a template template parameter when it is a base class of
+ current_class_type. Don't display error message when COMPLAIN is
+ false.
+
+1998-07-12 Klaus Kaempf (kkaempf@progis.de)
+
+ * repo.c (get_base_filename): Use file_name_nondirectory.
+ (open_repo_file): Ditto.
+ * cp-tree.h (file_name_nondirectory): Add prototype.
+
+1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
+
+ * friend.c (do_friend): Pull the identifier out of declarator.
+ Use cp_error and friends.
+ * decl2.c (qualified_lookup_using_namespace): Fix call to
+ purpose_member.
+ * decl.c (lookup_name_real): Don't call complete_type on a namespace.
+ (grokvardecl): Use DECL_CLASS_SCOPE_P.
+ * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
+ * class.c (warn_hidden): Fix for OVERLOAD.
+ From grahams@rcp.co.uk:
+ * cp-tree.h (DEFARG_NODE_CHECK): New macro.
+ (DEFARG_LENGTH, DEFARG_POINTER): Use it.
+
+Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com)
+
+ * g++.1 (-traditional): Remove duplicated documentation.
+
+1998-07-11 Mark Mitchell <mark@markmitchell.com>
+
+ * method.c (flush_repeats): Add nrepeats parameter.
+ (issue_nrepeats): Likewise.
+ (is_back_referenceable_type): New function. Don't back-reference
+ TEMPLATE_TYPE_PARMs as well as simple types like integers.
+ (build_mangled_name_for_type): Likewise.
+ (build_mangled_name_for_type_with_Gcode): Likewise.
+ (lasttype): Remove.
+ (nrepeats): Likewise.
+ (Nrepeats): Likewise.
+ (start_squangling): Don't clear the variables removed above.
+ (end_squangling): Likewise.
+ (flush_repeats): Tidy. Use nrepeats parameter rather than
+ Nrepeats global.
+ (issue_nrepeats): Likewise, but with nrepeats global. Use
+ is_backreferenceable_type.
+ (build_overload_nested_name): Tidy. Add comment. Use
+ build_mangled_name_for_type.
+ (build_underscore_int): Comment.
+ (build_overload_scope_ref): Use build_mangled_name_for_type.
+ (build_overload_int): Likewise.
+ (build_template_template_parm_names): Tidy.
+ (build_template_parm_names): Use build_mangled_name_for_type.
+ (build_overload_identifier): Add comments.
+ (build_mangled_name_for_type_with_Gcode): Split out from
+ build_mangled_name.
+ (build_mangled_name_for_type): Use it.
+ (build_mangled_name): Rework to use build_mangled_name_for_type
+ and to not use global nrepeats/Nrepeats. Tidy.
+ (process_modifiers): Tidy.
+ (check_btype): Use is_backreferenceable_type. Add comment.
+ Rename `node' to `type'.
+ (process_overload_item): Set numeric_output_need_bar here.
+ Use build_mangled_name_for_type. Tidy.
+ (build_decl_overload_real): Tidy. Don't use Nrepeats. Use
+ build_mangled_name_for_type.
+
+ * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
+ for TYPE_DECLs.
+
+1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com>
+
+ * cp-tree.h (warn_long_long): Define.
+ * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
+ warning "ANSI C++ does not support `long long'".
+ * decl2.c (warn_long_long): Define.
+ (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
+
+1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (xref_tag): Handle attributes between 'class' and name.
+ * parse.y (aggr): Likewise.
+ * semantics.c (finish_class_definition): Likewise.
+ * Makefile.in (EXPECTED): Adjust.
+
+ * cp-tree.h: Declare flag_optional_diags and warn_multichar.
+ * decl2.c: Define them.
+ (lang_decode_option): Handle them.
+ * lang-options.h: Add -foptional-diags.
+ * class.c (finish_struct): Don't complain about multiple meanings of
+ name if -fno-optional-diags.
+ * decl.c (pushdecl_class_level): Likewise.
+ * lex.c (real_yylex): Check warn_multichar.
+
+1998-07-06 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
+
+ * tree.c (make_binfo): Fix length.
+
+1998-06-30 Benjamin Kosnik <bkoz@bliss.nabi.net>
+
+ * decl2.c (lang_decode_option): Remove warn_template_debugging.
+ * lang-options.h: Ditto.
+
+Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
+ (process_start_catch_block): Likewise for variables
+ `false_label_rtx', `call_rtx' and `return_value_rtx'.
+
+1998-06-29 Brendan Kehoe <brendan@cygnus.com>
+
+ * tree.c (build_srcloc): Make sure we allocate this node on the
+ permanent obstack.
+
+Sat Jun 27 23:34:18 1998 Fred Fish <fnf@ninemoons.com>
+
+ * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
+ (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
+ (lang_specific_driver): Only add -lm automatically if need_math is
+ nonzero.
+
+Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o
+
+Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (EXPR_H): New dependency variable.
+ (decl2.o): Depend on $(EXPR_H).
+ (typeck.o): Likewise.
+ (init.o): Likewise.
+ (expr.o): Likewise.
+
+1998-06-25 Benjamin Kosnik <bkoz@lisa.cygnus.com>
+
+ * decl.c (start_enum): Put local enums on permanent_obstack.
+
+1998-06-25 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (c_get_alias_set): Declare.
+ * decl.c (init_decl_processing): Set lang_get_alias_set.
+
+1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
+
+ * cp-tree.h (mark_all_runtime_matches): Add function prototype.
+ * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
+ flag for all function decls which are in the exception table.
+ * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
+ * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
+ code is emitted for any referenced rtti function.
+
+1998-06-25 Dave Brolley <brolley@cygnus.com>
+
+ * lang-specs.h: Use new | syntax to eliminate
+ string concatenation.
+
+1998-06-25 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.h (CP_DECL_CONTEXT): New macro.
+ * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
+ * method.c (build_overload_nested_name): Likewise.
+ * sig.c (build_signature_pointer_or_reference_type): Don't set
+ DECL_CONTEXT.
+
+1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+ Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
+ * cp-tree.h (FROB_CONTEXT): New macro.
+ (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
+ * decl.c (namespace_binding): Replace NULL_TREE with
+ global_namespace.
+ (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
+ * decl2.c (is_namespace_ancestor, lookup_using_namespace):
+ Likewise.
+ * decl.c (pushtag): Use FROB_CONTEXT.
+ (pushdecl, make_typename_type, define_function, grokdeclarator):
+ Likewise.
+ * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
+ * pt.c (push_template_decl_real, lookup_template_class, tsubst):
+ Likewise.
+ * decl2.c (decl_namespace): Return global_namespace if no context.
+ * method.c (build_overload_nested_name): Expect null as context.
+ * pt.c (mangle_class_name_for_template): Do nothing for null
+ contexts.
+ (lookup_template_class): Allow for null id_context.
+
+1998-06-25 Richard Henderson <rth@cygnus.com>
+
+ * method.c (emit_thunk): Set current_function_is_thunk for the
+ ASM_OUTPUT_MI_THUNK case as well.
+
+1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
+
+ * exception.cc (__cplus_type_matcher): Get a match_info pointer
+ instead of an exception table entry as a parameter.
+
+1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
+
+ * parse.y (function_try_block): Don't call start_catch_handler.
+ * except.c (call_eh_info): Remove coerced field from declaration.
+ (build_eh_type_type_ref): New function to create an address of a
+ rtti function for the new style exception tables.
+ (expand_start_catch_block): Split function, this contains the
+ common part.
+ (process_start_catch_block_old): New function to perform the rest
+ of expand_start_catch_block under old style exceptions.
+ (process_start_catch_block_old): New function to perform the rest
+ of expand_start_catch_block under new style exceptions.
+ (expand_end_catch_block): Only pop the false label off the stack under
+ the old style of exceptions.
+ * semantics.c (finish_try_block): Don't call start_catch_handler.
+ * exception.cc (struct cp_eh_info): Add original_value field.
+ (__cplus_type_matcher): Perform type matching on the original exception
+ value, and if we have a match, set the current value.
+ (__cp_push_exception): Set the original expcetion value.
+
+1998-06-23 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (joust): Fix confusing conversion warning.
+
+ * call.c (build_op_delete_call): Add placement parm. Check
+ LOOKUP_SPECULATIVELY.
+ * cp-tree.h, decl2.c, init.c: Adjust.
+ * decl.c (finish_function): Use it.
+
+ * pt.c (tsubst): Diagnose creating void fields or variables.
+
+Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (build_scoped_method_call): Remove unused variable `tmp'.
+
+ * cp-tree.h (check_dtor_name): Add prototype.
+
+ * init.c (expand_member_init): Remove unused variables
+ `ptr_type_node', `parm' and `rval'.
+
+ * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
+ in call to fprintf.
+ (lang_print_xnode): Likewise.
+
+ * typeck2.c (enum_name_string): Cast argument to sprintf to long
+ and use %ld specifier.
+
+ * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
+ specifier in call to fprintf.
+ (GNU_xref_member): Cast argument to sprintf to int.
+
+Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * typeck2.c (pop_init_level): Warn about implicit zero initialization
+ of struct members.
+
+Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cp-tree.h: Prototype function `check_java_method'.
+
+1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (finish_struct): Make conflicting use of id a pedwarn.
+ * decl.c (pushdecl_class_level): Likewise.
+
+1998-06-17 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (convert_nontype_argument): Issue an error when presented
+ with an integer (real) constant that cannot be simplified to an
+ INT_CST (REAL_CST).
+
+ * cp-tree.h (c_get_alias_set): Remove declaration added in
+ 1998-06-13 change that should never have been checked in.
+
+1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck.c (build_binary_op_nodefault): Change % in format strings
+ to %%.
+
+ * decl.c (grokvardecl): Don't build_static_name for decls that
+ aren't at namespace scope.
+
+ * init.c (perform_member_init): Catch default-initialization of
+ references.
+
+1998-06-17 Mark Mitchell <mark@markmitchell.com>
+
+ * errfn.c (cp_thing): Handle the `%%' formatting sequence.
+
+1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
+
+ * method.c (hack_identifier): Complain about getting a namespace
+ or class template.
+ * typeck.c (decay_conversion): Remove check for namespaces.
+ * typeck2.c (incomplete_type_error): Likewise.
+ * parse.y (template_arg): Add PTYPENAME expansion.
+
+1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
+
+ * decl.c (grokvardecl): Don't build external assembler names for
+ TYPENAMEs in other namespaces as there is no declarator.
+ * error.c (cp_file_of, cp_line_of): Don't extract file or line number
+ info from DECL_CONTEXT if it is NULL.
+
+1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (check_dtor_name): Split out.
+ (build_scoped_method_call): Use it.
+ (build_method_call): Use it.
+ * init.c (build_offset_ref): Use it.
+
+ * typeck.c (build_static_cast): Fix handling of pointers to members.
+
+ * decl.c (finish_function): Just return nothing from a constructor.
+ * typeck.c (c_expand_return): Complain about returning a void
+ expression from a destructor.
+
+1998-06-13 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (alter_access): Accept a BINFO explaining how to get
+ from the entity whose accessed is being altered to the type doing
+ the altering.
+ (handle_using_decl): New function containing code split out from ...
+ (finish_struct_1): Here.
+
+ * cp-tree.h (complete_type_or_else): Declare.
+ * init.c (build_new_1, build_delete): Use it.
+ * typeck.c (require_complete_type): Use complete_type, rather than
+ expanding it inline.
+ (complete_type_or_else): New function.
+ (build_component_ref): Use it.
+ (pointer_int_sum): Make sure the type pointed to is complete.
+ (pointer_diff): Likewise.
+
+ * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
+ types.
+
+ * search.c (get_matching_virtual): Note that member templates
+ cannot override virtual functions.
+
+1998-06-12 Brendan Kehoe <brendan@cygnus.com>
+
+ * pt.c (check_explicit_specialization): If DECLARATOR turned into
+ an error_mark_node from lookup_template_function, return the same.
+ (determine_specialization): Also make sure TEMPLATE_ID isn't an
+ error_mark_node, before we try to read its operands.
+ * decl.c (grokdeclarator): If we got an error_mark_node from
+ check_explicit_specialization, just return it right back.
+
+1998-06-12 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (instantiate_type): Don't treat template-ids that don't
+ specify any template arguments as equivalent to ordinary
+ identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to
+ pointer-to-members for member templates. Tidy slightly.
+ * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
+ * init.c (build_offset_ref): Handle template-ids like ordinary
+ identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
+ offset part of the OFFSET_REF.
+ * typeck.c (build_unary_op): Change check for unknown types to
+ look for OFFSET_REFs, not SCOPE_REFs.
+
+1998-06-11 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (is_member_template_class): New function.
+ (push_template_decl_real): Use it.
+
+1998-06-11 Benjamin Kosnik <bkoz@elmo.cygnus.com>
+
+ * friend.c (do_friend): Add support for nested classes using
+ member functions of the enclosing class as friends.
+
+1998-06-10 Mark Mitchell <mark@markmitchell.com>
+
+ * call.c (convert_default_arg): Make global, not static.
+ (convert_arg_for_ellipsis): Split out from ...
+ (build_over_call): Here.
+ * cp-tree.h (convert_default_arg); Declare.
+ (convert_arg_to_ellipsis): Likewise.
+ (do_member_init): Remove.
+ * init.c (do_member_init): Remove; this code is dead.
+ (expand_member_init): Remove much of this code; it is dead.
+ * typeck.c (convert_arguments): Use convert_default_arg and
+ convert_arg_for_ellipsis, rather than duplicating here.
+
+ * call.c (convert_like): Don't fail silently if
+ build_user_type_conversion fails. Always return error_mark_node
+ for failure.
+
+1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (covariant_return_p): Complain about ambiguous base.
+
+ * typeck.c (build_component_ref): Diagnose ref to nested type.
+
+1998-06-10 Brendan Kehoe <brendan@cygnus.com>
+
+ * decl.c (grokparms): Check that INIT isn't an error_mark_node
+ before giving error about invalid type for default arg.
+
+1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_method_call): Fix thinko.
+
+1998-06-10 Dave Brolley <brolley@cygnus.com>
+
+ * decl2.c (lang_decode_option): New argc/argv interface.
+ * cp-tree.h (lang_decode_option): New argc/argv interface.
+ * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
+ specified for cpplib-enabled compilers.
+ * lex.c (lang_init): Don't check_newline for cpplib.
+ (init_parse): Don't initialize cpplib here.
+
+1998-06-10 Brendan Kehoe <brendan@cygnus.com>
+
+ * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
+ piece before checking DECL_MUTABLE_P.
+
+1998-06-10 John Carr <jfc@mit.edu>
+
+ * tree.c (debug_binfo): Make printf format match arguments.
+
+ * error.c (OB_PUTI): Make printf format match arguments.
+
+1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
+
+ * init.c (perform_member_init): Handle default-initialization.
+
+ * except.c (build_throw): Handle throwing NULL.
+
+ * typeck.c (build_x_function_call): Use resolve_offset_ref.
+
+ * search.c (compute_access): Only strip an anonymous union
+ for a FIELD_DECL.
+
+ * call.c (add_builtin_candidates): Tweak.
+
+ * cvt.c (build_expr_type_conversion): Restore code for conversion
+ from class types.
+ * decl2.c (delete_sanity): Use it. Clean up.
+
+ * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
+
+1998-06-10 Branko Cibej <branko.cibej@hermes.si>
+
+ * typeck.c (c_expand_return): Don't warn about void expressions on
+ return statements in functions returning void.
+
+1998-06-09 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (fn_type_unification): Revise documentation. Tidy.
+ (type_unification): Likewise.
+
+1998-06-09 Andrew MacLeod <amacleod@cygnus.com>
+
+ * semantics.c (finish_try_block): Rename expand_start_catch, and delete
+ expand_end_catch.
+ * parse.y (function_try_block): Rename expand_start_catch, and delete
+ expand_end_catch.
+ * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
+ expand_end_catch.
+
+1998-06-09 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (lookup_member): New fn.
+ * class.c (finish_struct_1): Use it.
+ * decl.c (lookup_name_real): Use it.
+
+Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
+
+ * cp-tree.h: Add prototype for `maybe_print_template_context' and
+ `maybe_make_one_only'.
+
+ * decl.c (auto_function): Remove unused variable `decl'.
+
+ * decl2.c: Include dwarf2out.h and dwarfout.h.
+
+ * lex.c: Remove redundant declarations of `set_float_handler' and
+ `asm_out_file'.
+
+1998-06-08 Andrew MacLeod <amacleod@cygnus.com>
+
+ * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
+ time flag. Call __cp_eh_info instead of __cp_exception_info.
+ * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
+ (__cp_exception_info): Return offset into cp_eh_info structure to
+ match what use to be the start of this structure.
+ (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
+ (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
+ compile time flag.
+ (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
+ __cp_eh_info instead of __cp_exception_info.
+
+1998-06-08 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (cp_finish_decl): Disable inlining of extern inlines
+ with static variables.
+
+1998-06-08 Mark Mitchell <mark@markmitchell.com>
+
+ * init.c (build_offset_ref): Correct previous change to use build,
+ not build_min.
+
+1998-06-07 Mark Mitchell <mark@markmitchell.com>
+
+ * class.c (instantiate_type): Handle pointer-to-members where the
+ member is a template.
+ * init.c (build_offset_ref): Likewise.
+ * typeck.c (build_unary_op): Likewise.
+
+1998-06-07 Richard Henderson <rth@cygnus.com>
+
+ * lex.c (lang_init_options): New function.
+ (lang_init): Remove flag_exceptions == 2 hack.
+
+1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (envelope_add_decl): Tweak for implicit typename.
+
+ * call.c (joust): Also warn about confusing conversion op/constructor
+ overload resolution.
+
+ * spew.c (yylex): Also return the TYPE_DECL if got_object.
+ Don't clear got_object after '~'.
+ * call.c (build_scoped_method_call): Tweak destructor handling.
+ (build_method_call): Likewise.
+ * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
+ TYPE_MAIN_VARIANT for destructors.
+ * semantics.c (finish_object_call_expr): Complain about calling a
+ TYPE_DECL.
+
+1998-06-05 Per Bothner <bothner@cygnus.com>
+
+ * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
+ Define - update needed by gcc.c change.
+
+1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
+
+ * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
+
+1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de>
+
+ * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
+ * decl.c (lookup_name_real): Add namespaces_only parameter.
+ If set, return only NAMESPACE_DECLs.
+ (select_decl): Likewise.
+ (identifier_type_value): Give additional parameter.
+ (lookup_name_nonclass): Likewise.
+ (lookup_name): Likewise.
+ (find_binding): Skip namespace aliases.
+ (binding_for_name): Likewise.
+ (push_namespace): Check for namespace aliases.
+ (lookup_name_namespace_only): New function.
+ (begin_only_namespace_names, end_only_namespace_names): New functions.
+ * decl2.c (set_decl_namespace): Skip namespace aliases.
+ (do_using_directive): Likewise.
+ (do_namespace_alias): Produce namespace aliases, fix alias
+ redeclaration.
+ * error.c (dump_decl): Support SCOPE_REF.
+ * parse.y (extdef): Wrap lookup with namespace_only for namespace
+ aliases and using declarations.
+
+1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
+
+ * error.c (dump_expr): Clean up NEW_EXPR case.
+
+1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ Suggested by Brendan Kehoe
+ * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
+ treat it as using ::decl.
+
+ * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
+
+ * tree.c (mapcar): Support NEW_EXPR.
+
+ * error.c (dump_expr): Support NEW_EXPR.
+
+1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
+
+ * method.c (make_thunk): Use overload machinery to make name.
+ * search.c (covariant_return_p): New fn.
+ (get_matching_virtual): Use it.
+
+ * init.c (build_new_1): Fix check for void.
+
+1998-06-01 Per Bothner <bothner@cygnus.com>
+
+ * cp-tree.h (TYPE_FOR_JAVA): New macro.
+ * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
+ java_int_type_node, java_long_type_node, java_float_type_node,
+ java_double_type_node, java_char_type_node, java_boolean_type_node):
+ New "primitive" types, with predefined names __java_byte etc.
+ (record_builtin_java_type): New function.
+ (init_decl_processing): Make Java types with record_builtin_java_type.
+ (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
+ (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
+ (grokfndecl): Call check_java_method for Java classes.
+ * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
+ (process_overload_item): Match types against specific
+ java_XX_type_node types, rather than using is_java_type.
+ * class.c (finish_struct_1): Don't add default copy constructor
+ or operator= if TYPE_FOR_JAVA.
+ (pop_lang_conext): Restore strict_prototyp proper if Java.
+ * decl2.c (acceptable_java_type, check_java_method): New functions.
+ * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
+ (tsubst): Move common statement after if statement.
+ * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
+
+1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (for_each_template_parm): Use first_rtl_op.
+
+ * tree.c (build_cplus_array_type_1): Also check index_type for
+ template parms.
+
+1998-05-31 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (tsubst): Always copy BINFO_BASETYPES.
+
+1998-05-29 scott snyder <snyder@d0sgif.fnal.gov>
+
+ * tree.c (layout_basetypes): If we change TYPE_SIZE, change
+ TYPE_SIZE_UNIT too.
+
+1998-05-29 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (grokdeclarator): Don't complain about in-class
+ initialization of static consts if we don't really know the type
+ of the variable.
+
+1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
+ * method.c (build_destructor_name): New fn.
+ * decl2.c (maybe_retrofit_in_chrg): Split out...
+ (grokclassfn): From here. Reorganize.
+ * decl.c (grok_ctor_properties): Make sure ctors for types with
+ vbases have the in_chrg parm.
+ * pt.c (instantiate_class_template): Update
+ TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call
+ grok_*_properties.
+ (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
+
+1998-05-28 Mark Mitchell <mark@markmitchell.com>
+
+ * pt.c (instantiate_decl): Make test for whether or not static
+ variables should be instantiated early match its comment.
+
+1998-05-28 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (start_decl): Always pedwarn about vacuously redeclaring
+ a member.
+ (start_function): Call check_default_args.
+ * decl2.c (grokfield): Don't call check_default_args.
+ (check_default_args): Use cp_error_at.
+ * lex.c (do_pending_defargs): Call check_default_args.
+
+1998-05-27 Brendan Kehoe <brendan@cygnus.com>
+
+ * call.c (build_method_call): Make sure get_type_value returns
+ something before we try to use its TYPE_MAIN_VARIANT.
+ (build_scoped_method_call): Likewise.
+
+1998-05-27 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck2.c (digest_init): Complain about getting a TREE_LIST to
+ initialize an array.
+
+ * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
+ DECL_VIRTUAL_P.
+
+ * friend.c (do_friend): Clarify template warning.
+
+1998-05-27 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (shadow_label): Don't treat decls as identifiers.
+ (maybe_push_to_top_level): Clear shadowed_labels.
+
+ * pt.c (instantiate_decl): Reset lineno and filename after calling
+ regenerate_decl_from_template.
+
+ * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
+ error_mark_node.
+
+1998-05-27 Kevin Buhr <buhr@stat.wisc.edu>
+
+ * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
+
+1998-05-26 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
+
+ * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
+ (convert_nontype_argument): Handle cases when nontype template
+ parameters become classes after substitution.
+
+1998-05-26 Mark Mitchell <mark@markmitchell.com>
+
+ * friend.c (is_friend): Use comptypes, rather than == to compare
+ types. Modify for new representation of template friends.
+ (make_friend_class): Likewise.
+ * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak.
+ (instantiate_class_template): Deal with template friends.
+
+ * decl.c (store_parm_decls): Remove redundant call to
+ expand_main_function.
+
+1998-05-26 Benjamin Kosnik <bkoz@loony.cygnus.com>
+
+ * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
+ DECL_USE_TEMPLATE.
+
+1998-05-26 Per Bothner <bothner@cygnus.com>
+
+ * language_as_string: Handle lang_java.
+
+1998-05-26 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (pushdecl): Don't copy the type_decl.
+
+1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+ * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
+ current_class_type.
+ * decl.c (grokdeclarator): Put typedefs on the type's obstack.
+
+ * parse.y (complex_direct_notype_declarator): Use $1 to access
+ scope of notype_qualified_id.
+
+1998-05-26 Dave Brolley <brolley@cygnus.com>
+
+ * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
+ (init_parse): Initialize cpplib interface.
+
+ * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
+ empty continuation.
+
+1998-05-26 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (pushtag): Avoid crashing on erroneous input.
+
+1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (push_namespace): Only produce one unique name for
+ anonymous namespaces.
+ (get_unique_name): Remove.
+
+1998-05-25 Mark Mitchell <mark@markmitchell.com>
+
+ * call.c (tourney): Don't do any extra comparisons.
+
+ * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
+
+ * cp-tree.h (processing_template_parmlist): Declare.
+ * decl.c (pushtag): Don't call push_template_decl when we
+ shouldn't.
+ * pt.c (processing_template_parmlist): New variable.
+ (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
+ (complete_template_args): Use it.
+ (add_to_template_args): Likewise.
+ (innermost_args): Likewise.
+ (tsubst): Likewise.
+ (begin_template_parm_list): Use processing_template_parmlist.
+ (end_template_parm_list): Likewise.
+
+ * cp-tree.h (ANON_UNION_TYPE_P): New macro.
+ * decl.c (grokdeclarator): Use it.
+ * decl2.c (grok_x_components): Likewise.
+ * init.c (initializing_context): Likewise.
+ * method.c (do_build_copy_constructor): Likewise.
+ (do_build_assign_ref): Likewise.
+ * search.c (compute_access): Likewise.
+ * typeck.c (build_component_ref): Likewise.
+
+ * decl.c (grokdeclarator): Don't give a cv-qualified version of an
+ unnamed type a typedef name "for linkage purposes".
+
+ * pt.c (lookup_template_class): Don't look at
+ IDENTIFIER_CLASS_VALUE when there's no current_class_type.
+
+ * method.c (build_overload_int): Handle error cases gracefully.
+
+ * pt.c (instantiate_decl): Handle static member variables
+ correctly.
+
+ * pt.c (tsubst): Use the tsubst'd type when producing new
+ TEMPLATE_PARM_INDEX nodes.
+
+1998-05-24 Mark Mitchell <mark@markmitchell.com>
+
+ * tree.c (cp_tree_equal): Handle pointers to member functions.
+
+ * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make
+ sure the type of the REF_BIND is a reference type.
+ (maybe_handle_ref_bind, compare_ics): Rename reference_type to
+ target_type for clarity.
+
+ * parse.y (xcond): Move call to condition_conversion ...
+ * semantics.c (finish_for_cond): Here.
+ * parse.c: Regenerated.
+
+1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (push_namespace): Namespaces have type void.
+ * typeck2.c (incomplete_type_error): Complain about namespace
+ used as expression.
+ * typeck.c (decay_conversion): Likewise.
+
+1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * error.c (dump_expr): Support namespaces.
+
+1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.def: Add SRCLOC.
+ * cp-tree.h: Add struct tree_srcloc and accessor macros.
+ * tree.c (build_srcloc, build_srcloc_here): New fns.
+ * pt.c (add_pending_template): Use build_srcloc_here.
+ (push_tinst_level): Update last_template_error_tick before erroring.
+ (instantiate_decl): Restore lineno and input_filename before
+ calling add_pending_template.
+ * decl2.c (finish_file): Set up lineno and input_filename for
+ pending templates.
+
+1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (lang_print_error_function): New fn.
+ (init_decl_processing): Set print_error_function to use it.
+ * errfn.c (cp_thing): Don't call maybe_print_template_context here.
+
+ * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
+ ICS_BAD_FLAG.
+
+ * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
+ copy-initialization.
+
+ * class.c (build_vtable_entry): Use int_fits_type_p.
+ (build_vtable): Pass a signed offset to build_vtable_entry.
+ (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
+ set_rtti_entry): Likewise.
+
+1998-05-22 Per Bothner <bothner@cygnus.com>
+
+ * cp-tree.h: Add comments documenting which LANG_FLAGS are used.
+ (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used.
+
+1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (print_template_context): Use fprintf instead of cp_error.
+
+ * pt.c (determine_specialization): Just return an error_mark_node.
+ Also print the decl we want in error messages. If we complain,
+ return error_mark_node.
+ (tsubst_friend_function): Set lineno and input_filename so
+ error messages will be useful.
+ (instantiate_template): Just return an error_mark_node.
+ (check_explicit_specialization): Don't mess with a returned
+ error_mark_node.
+
+ * pt.c (print_template_context): Add new argument.
+ (maybe_print_template_context): New fn.
+ (push_tinst_level): Increment tinst_level_tick.
+ (pop_tinst_level): Likewise.
+ * errfn.c (cp_thing): Call maybe_print_template_context. Use
+ xrealloc instead of xmalloc.
+
+ * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
+
+1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (tsubst_friend_class): Don't call redeclare_class_template
+ if the template we looked up is the same as the one we already
+ have.
+
+Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
+
+ * lex.c: (handle_sysv_pragma): FILE* parameter not used.
+ (cpp_reader,parse_in): Add for cpplib.
+ (check_newline): Call handle_sysv_pragma with new interface.
+ (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
+
+ * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
+ (sub_getch): Call GETC for cpplib.
+
+ * cp-tree.h: (get_directive_line): Different prototype for cpplib.
+ (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
+
+ * Makefile.in (CXX_OBJS): add @extra_cxx_objs@ for cpplib.
+
+1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (maybe_make_one_only): New fn.
+ (import_export_vtable): Use it.
+ (import_export_decl): Likewise.
+ * pt.c (mark_decl_instantiated): Likewise.
+
+1998-05-21 Mark Mitchell <mmitchell@usa.net>
+
+ * decl2.c (find_representative_member): Rename to ...
+ (build_anon_union_vars): New function.
+ (finish_anon_union): Fix stupidity of previous change.
+
+1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (grokfndecl): Handle definition of specialization in
+ friend declaration.
+
+ * error.c (dump_decl): Fix LOOKUP_EXPR handling.
+
+1998-05-20 Mark Mitchell <mmitchell@usa.net>
+
+ * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
+ to look for type declarations.
+ (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
+ * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
+ (finish_member_class_template): Declare.
+ * decl.c (pushtag): Put member class templates on the
+ CLASSTYPE_TAGS list, just as for ordinary member classes.
+ (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
+ (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
+ IDENTIFIER_NAMESPACE_VALUEs.
+ * parse.y (component_decl): Move code to ...
+ * semantics.c (finish_member_class_template): New function.
+ Don't put member class templates on the list of components for a
+ class.
+ * parse.c: Regenerated.
+ * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
+ In fact, don't use DECL_CONTEXT at all here.
+
+1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (record_unknown_type): New function.
+ (init_decl_processing): Call it for the unknown and global type
+ nodes.
+
+1998-05-20 Mark Mitchell <mmitchell@usa.net>
+
+ * decl2.c (find_representative_member): New function.
+ (finish_anon_union): Use it.
+
+ * cp-tree.h (MAIN_NAME_P): New macro.
+ (DECL_MAIN_P): Likwise.
+ * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
+ (grokfndecl): Use the new macros.
+ (grokdeclarator): Likewise.
+ (start_function): Likewise.
+ (store_parm_decls): Likewise.
+ (finsh_function): Likewise.
+ * friend.c (do_friend): Likewise.
+ * typeck.c (build_function_call_real): Likewise.
+ (build_unary_op): Likewise.
+
+Wed May 20 02:16:01 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (start_objects, finish_objects, do_dtors,
+ do_ctors): Split out from...
+ (finish_file): ...here.
+
+Tue May 19 20:36:23 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tree.c (is_overloaded_fn): Don't abort on placeholders from
+ push_class_decls.
+
+Tue May 19 15:16:22 1998 Brendan Kehoe <brendan@cygnus.com>
+
+ * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
+
+ * error.c (dump_expr): Handle an ARROW_EXPR.
+
+Tue May 19 15:13:39 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * decl.c (saveable_obstack): Declare.
+ (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
+ declare, if necessary.
+
+Tue May 19 14:50:27 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * call.c (compare_qual): Remove.
+ (is_subseq): Tweak.
+ (is_properly_derived_from): New function.
+ (maybe_handle_ref_bind): Likewise.
+ (maybe_handle_implicit_object): Likewise.
+ (compare_ics): Modify substantially to bring into conformance with
+ the standard.
+ * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
+ (comp_cv_qualification): Declare.
+ (comp_cv_qual_signature): Likewise.
+ * typeck.c (comp_cv_qualification): Likewise.
+ (comp_cv_qual_signature): Likewise.
+
+Tue May 19 10:05:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (parse.o): Depend on toplev.h.
+
+ * class.c (typecode_p): Remove prototype and definition.
+
+ * cp-tree.h (currently_open_class, is_empty_class, member_p):
+ Add prototype.
+
+ * decl.c (push_overloaded_decl_top_level): Remove prototype and
+ definition.
+
+ * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
+ in call to `cp_thing'.
+ (cp_warning): Likewise for function pointer `warning'.
+
+ * except.c (do_function_call): Remove prototype and definition.
+ (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
+
+ * method.c (is_java_type): Add prototype and make it static.
+
+ * parse.y: Include toplev.h.
+
+ * pt.c (type_unification): Remove unused variable `arg'.
+ (instantiate_decl): likewise for `save_ti'.
+
+ * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
+
+Tue May 19 02:43:25 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * init.c (build_member_call): Handle template_ids.
+ * parse.y (primary): Add global_scope template_id.
+
+Mon May 18 23:22:52 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (get_sentry): Use end_temporary_allocation.
+ Don't declare permanent_obstack.
+
+Mon May 18 12:28:44 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * parse.y (.finish_new_placement): New non-terminal.
+ (unary_expr, new_type_id): Use it.
+ * parse.c: Regenerated.
+
+Mon May 18 12:20:27 1998 Brendan Kehoe <brendan@cygnus.com>
+
+ * pt.c (redeclare_class_template): Say where the original definition
+ of the template-parameter's default argument appeared.
+
+Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_over_call): Tweak empty class handling.
+
+ * decl.c (make_typename_type): Use currently_open_class.
+
+ * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
+
+Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
+ for a type unless it is one.
+
+ * class.c (finish_struct_1): Use OVL_CURRENT in error message.
+
+Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (program_transform_name, objdir): Define.
+
+ * Makefile.in (BISON): Use bison from the build tree if it exists.
+ (FLEX): Similarly.
+
+Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
+
+ * typeck.c (type_unknown_p): Return true for TREE_LIST also.
+
+ * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
+
+Sun May 17 14:51:41 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_scoped_method_call): Likewise.
+
+Sun May 17 13:53:48 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * init.c (build_new_1): Call suspend_momentary around the creation
+ of values that must be saved for exception handling.
+ * parse.y (.build_new_placement): New non-terminal.
+ (unary_expr, new_placement): Use it.
+ * parse.c: Regenerated.
+
+Sun May 17 12:32:08 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
+ old and new types.
+
+ * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
+ canonical type.
+
+ * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
+
+Fri May 15 20:28:00 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (start_decl): Revert problem change.
+
+ * Makefile.in (CONFLICTS): Fix.
+
+Fri May 15 15:34:02 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
+
+ * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
+
+Fri May 15 00:46:05 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (finish_struct_1): Use BINFO_SIZE.
+
+ * decl.c (start_decl): Use 'tem'.
+
+Thu May 14 16:30:47 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
+
+ * exception.cc: Include eh-common.h.
+ (struct cp_eh_info): add eh_info struct with NEW_EH_MODEL.
+ (__cplus_type_matcher): First stab at new C++ runtime type matcher.
+ (__cp_push_exception): Initialize eh_info struct as well.
+ * except.c: Remove local structs and include eh-common.h.
+ (init_exception_processing): Set language and version codes.
+ (call_eh_info): add presence of eh_info to runtime description of
+ struct cp_eh_info.
+ (expand_end_eh_spec): call start_catch_block() and end_catch_block().
+ * semantics.c (finish_try_block): call start_catch_block() and
+ end_catch_block().
+ * parse.y (function_try_block): call start_catch_block() and
+ end_catch_block().
+
+Thu May 14 12:27:34 1998 Brendan Kehoe <brendan@cygnus.com>
+
+ * typeck.c (original_type): New function.
+ (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
+ to see if they're actually the same.
+ * cp-tree.h (original_type): Declare.
+
+Wed May 13 12:54:30 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (lex.o): Depend on output.h.
+
+ * call.c (add_function_candidate): Remove unused variable `cand'.
+ (add_conv_candidate): Likewise.
+ (build_builtin_candidate): Likewise.
+
+ * cp-tree.h: Add prototype for `types_overlap_p'.
+
+ * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
+
+ * decl2.c (merge_functions): Remove unused variables `tmp' and
+ `tempn'.
+
+ * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
+ (code_as_string): Likewise.
+ (language_as_string): Likewise.
+ (parm_as_string): Likewise.
+ (op_as_string): Likewise.
+ (assop_as_string): Likewise.
+ (cv_as_string): Likewise.
+
+ * lex.c: Include output.h.
+
+ * pt.c (type_unification): Cast first argument of `bzero' to a char*.
+
+ * search.c (dfs_no_overlap_yet): Mark parameter `t' with
+ ATTRIBUTE_UNUSED.
+
+ * tinfo.cc (__class_type_info::dcast): Change the type of variable
+ `i' from int to size_t.
+
+ * typeck.c (language_lvalue_valid): Mark parameter `exp' with
+ ATTRIBUTE_UNUSED.
+
+Tue May 12 21:37:49 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
+ DECL_NAMESPACE_SCOPE_P.
+ (lang_decl_name): Likewise.
+ * pt.c (tsubst_friend_function, tsubst): Likewise.
+ * decl.c (pushdecl, redeclaration_error_message, start_decl,
+ cp_finish_decl, start_function): Likewise.
+ * class.c (finish_struct_1): Likewise.
+ * call.c (build_over_call): Likewise.
+ (compare_ics): Use DERIVED_FROM_P.
+
+Tue May 12 07:24:18 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
+ * method.c (build_mangled_name): Use it.
+ (build_decl_overload_real): Likewise.
+
+ * error.c (dump_simple_decl): New function, broken out from ...
+ (dump_decl): Use it.
+
+Mon May 11 11:38:07 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * ptree.c (lang_print_xnode): Add missing `break'.
+
+ * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
+
+ * call.c (add_template_candidate): Adjust for changes to
+ fn_type_unification.
+ (add_template_candidate_real): Likewise.
+ (add_template_conv_candidate): Likewise.
+ (build_user_type_conversion_1): Likewise.
+ (build_new_function_call): Likewise.
+ (build_object_call): Likewise.
+ (build_new_op): Likewise.
+ (build_new_method_call): Likewise.
+ * class.c (instantiate_type): Likewise.
+ * cp-tree.h (unification_kind_t): New type.
+ (fn_type_unification): Adjust prototype.
+ (type_unificaiton): Likewise.
+ * pt.c (UNIFY_ALLOW_NONE): New macro.
+ (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
+ (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
+ (UNIFY_ALLOW_DERIVED): Likewise.
+ (unify): Change prototype.
+ (maybe_adjust_types_for_deduction): New function.
+ (check_cv_quals_for_unify): Likewise.
+ (determine_specialization): Adjust.
+ (fn_type_unification): Likewise.
+ (type_unification): Likewise.
+ (type_unification_real): Likewise. Use
+ maybe_adjust_types_for_deduction. Fix mishandling of
+ back-unification of template functions passed as arguments. Pass
+ appropriate combination of UNIFY_ALLOW_* to unify.
+ (unify): Remove unused NTPARMS parameter. Use
+ check_cv_quals_for_unify. Remove bogus code that allowed
+ too-generous unification in order to adhere more closely to standard.
+ (get_bindings_real): Adjust.
+ (get_class_bindings): Likewise.
+
+ * method.c (build_overload_identifier): Only use the innermost
+ template arguments when mangling.
+ * pt.c (tsubst_template_argument_vector): New function.
+ (complete_template_args): Deal with the situation where the
+ extra_args contain more than one level of arguments.
+ (lookup_template_class): Deal with member template classes, which
+ may have more than one level of arguments.
+ (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
+ Improve handling of member template classes. Use
+ DECL_PRIMARY_TEMPLATE instead of inline expansion. Use
+ tsubst_template_argument_vector where appropriate.
+ (regenerate_decl_from_template): Break out from ...
+ (instantiate_decl): Here.
+
+ * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
+ * parse.h: Regenerated.
+ * parse.c: Really regenerated.
+
+ * cp-tree.h (finish_unary_op_expr): New function.
+ (finish_id_expr): Likewise.
+ (begin_new_placement): Likewise.
+ (finish_new_placement): Likewise.
+ (finish_declarator): Likewise.
+ (finish_translation_unit): Likewise.
+ (finish_parmlist): Likewise.
+ (begin_class_definition): Likewise.
+ (finish_class_definition): Likewise.
+ (finish_default_args): Likewise.
+ (finish_inline_definitions): Likewise.
+ * parse.y (GCC_ASM_KEYWORD): Remove.
+ (TYPENAME_ELLIPSIS): Likewise.
+ * parse.c: Regenerated.
+ Use new functions in semantics.c in the actions for many rules.
+ * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
+ * hash.h: Regenerated.
+ * semantics.c (finish_expr_stmt): Allow NULL expr.
+ (finish_unary_op_expr): New function, containing
+ code previously in parse.y.
+ (finish_id_expr): Likewise.
+ (begin_new_placement): Likewise.
+ (finish_new_placement): Likewise.
+ (finish_declarator): Likewise.
+ (finish_translation_unit): Likewise.
+ (finish_parmlist): Likewise.
+ (begin_class_definition): Likewise.
+ (finish_class_definition): Likewise.
+ (finish_default_args): Likewise.
+ (finish_inline_definitions): Likewise.
+
+Sun May 10 23:43:13 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * typeck.c (build_c_cast): Don't decay arrays and functions to
+ pointer type when converting to a class type.
+
+Sun May 10 22:53:56 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
+ (DECL_CLASS_SCOPE_P): Likewise.
+
+Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org)
+
+ * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
+ * decl2.c (constructor_name_full): Likewise.
+
+Sun May 10 22:48:12 1998 Mike Stump <mrs@wrs.com>
+
+ * tree.c (mapcar): Add OVERLOAD support.
+
+ * init.c (resolve_offset_ref): We must use basetype_path before we
+ destroy it with a call to convert_pointer_to.
+
+Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (currently_open_class): New fn.
+ * decl.c (lookup_name_real): Use it.
+ * search.c (lookup_field): Likewise.
+
+Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
+
+ * cp-tree.def (OVERLOAD): New node.
+ * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
+ SET_IDENTIFIER_NAMESPACE_VALUE): Define.
+ (NAMESPACE_BINDING): Remove.
+ (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
+ namespace_binding.
+ (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
+ Define.
+ (tree_overload): New struct.
+ (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
+ (REAL_IDENTIFIER_TYPE_VALUE): Define.
+ (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
+ (lang_decl_flags): Remove in_namespace.
+ (lang_decl): Remove chain.
+ (DECL_CHAIN, DECL_NAMESPACE): Remove.
+ (flag_honor_std): Declare extern.
+ (identifier_type_value, pushdecl_namespace_level, push_using_decl,
+ namespace_binding, set_namespace_binding,
+ lookup_function_nonclass, cat_namespace_levels,
+ set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
+ scratch_ovl_cons, ovl_member, build_overload): Declare.
+ (decl_list_length, get_namespace_id, current_namespace_id,
+ overloaded_globals_p): Remove.
+ (lookup_using_namespace, qualified_lookup_using_namespace): Change
+ return type.
+ (push_scratch_obstack): New macro.
+ * call.c (add_function_candidate): Special-case type of OVERLOAD node.
+ (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
+ convs, fns.
+ (build_new_function_call): Iterate using OVL_CHAIN.
+ Print DECL_NAME in when reporting ambiguities.
+ (build_object_call): Iterate using OVL_NEXT for fns, convs.
+ (build_new_op): Call lookup_function_nonclass.
+ Iterate using OVL_NEXT.
+ (build_op_delete_call): Change detection of members.
+ Do not wrap TREE_LIST around fields and single global functions.
+ (build_over_call): Don't push a class level if the context is a
+ namespace.
+ (build_new_method_call): Iterate using OVL_NEXT.
+ * class.c (add_method): Chain overloaded members using
+ build_overload. Remove copying of method.
+ (grow_method): When iterating through the obstack, expect OVERLOAD
+ nodes. Chain overload members.
+ (finish_struct_methods): Chain overload members. Unpack OVERLOAD
+ nodes in call to get_baselinks.
+ (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
+ (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle
+ fdecls that are OVERLOAD nodes.
+ (validate_lhs): New function.
+ (instantiate_type): Do not copy OVERLOAD nodes. Remove dead
+ code. Use DECL_NAME in error messages. Split code between global
+ and member function processing.
+ * decl.c (global_type_node): New static variable.
+ (in_std): New global.
+ (struct binding_level): New field usings.
+ (resume_binding_level): Assert that we are not in a class.
+ (toplevel_bindings_p): Just check for namespace_p or
+ pseudo_global.
+ (resume_level): Remove.
+ (find_binding): New function.
+ (binding_for_name): Call it.
+ (namespace_binding, set_namespace_binding): New functions.
+ (push_namespace): Associate binding level with new namespace,
+ resume_binding_level for existing namespace. Remove old code.
+ Fake std by counting.
+ (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
+ (maybe_push_to_top_level): Save current namespace.
+ (pop_from_top_level): Restore saved namespace.
+ (pop_namespace): Call suspend_binding_level. Remove old code.
+ (cat_namespace_levels): New function.
+ (set_identifier_type_value_with_scope): For namespace bindings,
+ set BINDING_TYPE, and use global_type_node.
+ Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
+ (identifier_type_value): New function.
+ (pushtag): If no context, use current_namespace.
+ (duplicate_decls): Don't process DECL_CHAIN.
+ (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
+ already set. Never reset it to NULL_TREE. Lookup global variables
+ in their namespace. Push overloaded templates if they are on
+ namespace level.
+ (pushdecl_namespace_level): New function.
+ (pushdecl_top_level): Implement using pushdecl_namespace_level.
+ (pushdecl_using_decl): New function.
+ (overloaded_globals_p): Remove.
+ (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
+ them. Use namespace_binding and set_namespace_value.
+ (redeclaration_error_message): Complain if the declarations come
+ from different namespaces.
+ (lookup_tag): On namespace level, look in the BINDING_TYPE.
+ (lookup_namespace_name): Pass tree_bindings from stack. Remove
+ old code.
+ (select_decl): New function.
+ (lookup_name_real): Call it for qualified and unqualified lookup.
+ Pass tree_bindings from the stack.
+ If prefer_type is 1, also accept namespaces.
+ (lookup_function_nonclass): New function.
+ (init_decl_processing): Set the binding level of the global
+ namespace to global_binding_level.
+ Build a proper type list for __builtin_apply.
+ Initialize std_node to "fake std" if flag_honor_std is set.
+ Initialize global_type_node.
+ Allocated bad_alloc in namespace std if flag_honor_std.
+ (define_function): Set the DECL_CONTEXT to the current_namespace.
+ (start_decl): A namespace is not considered as a context here. If
+ the DECL_CONTEXT is a namespace, push the decl.
+ (cp_finish_decl): Check for namespaces used as initializers.
+ (grokfndecl): Add namespace parameter. Remove processing of
+ DECL_CHAIN.
+ (grokvardecl): Add namespace parameter.
+ (grokdeclarator): Process SCOPEs that are namespaces. For
+ mangling, temporarily set the DECL_CONTEXT on anonymous structs.
+ (start_function): Check for contexts that are namespaces.
+ Set context for declarations that have not been pushed.
+ (store_parm_decls): Check for ::main only.
+ (finish_function): Likewise.
+ (start_method): Check for contexts that are namespaces.
+ (start_method): Remove DECL_CHAIN processing.
+ * decl2.c (flag_honor_std): Declare.
+ (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
+ (decl_namespace_list): New static global.
+ (grok_x_components): Ignore namespaces as type contexts.
+ (check_classfn): Expect OVERLOAD nodes.
+ (grokfield): Remove DECL_CHAIN processing.
+ (finish_file): Call cat_namespace_levels.
+ (merge_functions): New function.
+ (ambiguous_decl): Rewrite.
+ (lookup_using_namespace): Produce tree_bindings.
+ (qualified_lookup_using_namespace): Likewise.
+ (set_decl_namespace, decl_namespace, current_decl_namespace,
+ push_decl_namespace, pop_decl_namespace): New functions.
+ (arg_lookup): New struct.
+ (add_function, arg_assoc_namespace, arg_assoc_class,
+ arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
+ New functions.
+ (get_namespace_id, current_namespace_id): Remove.
+ (do_toplevel_using_decl): Rewrite.
+ (do_class_using_decl): Complain about namespace qualifiers.
+ (do_using_directive): Sorry if not on namespace level. Complain
+ about unknown namespaces.
+ * error.c (dump_aggr_type): Check for namespace contexts.
+ * except.c (init_exception_processing): Push terminate into std.
+ * friend.c (is_friend): A namespace is not a context, here.
+ * init.c (expand_member_init): Remove DECL_CHAIN processing.
+ (build_offset_ref): Process OVERLOAD nodes.
+ * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
+ * lex.c (identifier_type): Loop using OVL_CHAIN.
+ (see_typename): Set looking_for_typename to 2.
+ (real_yylex): Likewise.
+ (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
+ (do_scoped_id): Expect OVERLOAD nodes.
+ Change calling convention for qualified_lookup_using_namespace.
+ (build_lang_decl): Don't set in_namespace anymore.
+ * method.c (typevec_size): New global.
+ (build_overload_nested_name): Return if global_namespace.
+ Otherwise, always expect a declaration context.
+ (build_qualified_name): Likewise.
+ Make sure we don't write beyond typevec_size.
+ (build_decl_overload_real): Likewise.
+ Allocate one extra slot for the namespace.
+ (hack_identifier): Mark code dead.
+ Process OVERLOAD and NAMESPACE_DECL nodes.
+ * parse.y (program): Pop namespaces until in global namespace.
+ (extdef): In a using-declaration, don't discard the identifier if
+ there is no declaration.
+ (left_curly): Ignore type contexts which are namespaces.
+ (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
+ used as scope.
+ * pt.c (template_class_depth): Expect types to be namespaces.
+ (determine_specialization): Simplify by expecting OVERLOAD nodes.
+ (push_template_decl): Push into namespace level.
+ Reset ctx if it is a namespace.
+ Set DECL_CONTEXT to current_namespace if not set already.
+ Ignore real contexts that are namespaces.
+ (mangle_class_name_for_template): Skip global_namespace.
+ Mangle other namepaces as declarations.
+ (lookup_template_function): Set type of OVERLOAD nodes to unknown.
+ (lookup_template_class): Push into namespace of context.
+ If the context is a namespace, set it to global_namespace.
+ Use id_context for mangling.
+ (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
+ (tsubst_friend_function): Ignore namespace contexts.
+ Push into namespace level.
+ (tsubst): Handle NAMESPACE_DECL nodes.
+ Remove DECL_CHAIN processing.
+ (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
+ * ptree.c (print_lang_identifier): Print bindings.
+ (lang_print_xnode): Print OVERLOAD nodes.
+ * rtti.c (init_rtti_processing): Push type_info into std.
+ * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
+ (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
+ dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
+ lookup_fnfields_here): Likewise.
+ Process all nodes, instead of going through TREE_CHAIN.
+ * sig.c (build_signature_pointer_or_reference_type): Set context
+ to global_namespace.
+ (build_signature_table_constructor): Expect OVERLOAD nodes.
+ * spew.c (yylex): Save old setting of looking_for_typename.
+ * tree.c (decl_list_length): Remove.
+ (binding_init): New function.
+ (count_functions): Rewrite.
+ (is_overloaded_fn): Expect OVERLOAD nodes.
+ (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
+ (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
+ ovl_member): New functions.
+ * typeck.c (require_complete_type): Expect OVERLOAD nodes.
+ (type_unknown_p): Likewise.
+ (require_instantiated_type): Likewise.
+ (build_component_ref): Declare code dead.
+ (build_x_function_call): Create and expect OVERLOAD nodes.
+ (build_function_call_real): Check for ::main only.
+ (build_unary_op): Likewise. Expect OVERLOAD nodes.
+ (convert_for_assignment): Check for TREE_LIST before accessing
+ TREE_VALUE.
+ * decl.c (duplicate_decls): Check for namespace bindings instead
+ of global bindings.
+ (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
+ lookup_name_current_level, start_decl, xref_tag,
+ finish_enum): Likewise.
+ * init.c (build_offset_ref): Likewise.
+ * search.c (lookup_field): Likewise.
+ (lookup_fnfields): Likewise.
+ (dfs_debug_mark): Likewise.
+ * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
+ (poplevel_class, pop_from_top_level): Likewise.
+ * decl2.c (finish_method): Likewise.
+ * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
+ * decl.c (record_builtin_type): Likewise.
+ (init_decl_processing, grokfndecl): Likewise.
+ * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
+ (make_lang_type): Likewise.
+ * parse.y (make_thunk): Likewise.
+ * pt.c (tsubst): Likewise.
+ * tree.c (debug_binfo): Likewise.
+ * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
+ tinfo2.cc, inc/new.h: Add std qualifications.
+ * inc/new: Wrap with namespace std if __HONOR_STD.
+ * inc/typeinfo: Likewise.
+
+Fri May 8 00:43:50 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_user_type_conversion_1): Handle second_conv
+ properly for templates.
+
Thu May 7 17:09:25 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
* method.c (build_decl_overload_real): Set TREE_USED flag to
@@ -9018,10 +12387,3 @@ Wed Oct 11 16:30:34 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
* parse.y (fn.def1): Call split_specs_attrs in
declmods notype_declarator case.
-
-Use a consistent time stamp format in ChangeLog entries.
-Not everyone has Emacs 20 yet, so stick with Emacs 19 format for now.
-
-Local Variables:
-add-log-time-format: current-time-string
-End:
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index d91fd362774..320ffc3e7f2 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -94,24 +94,24 @@ g++.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g++.c \
-c g++.c
# Create the compiler driver for g++.
-g++$(exeext): g++.o g++spec.o version.o choose-temp.o pexecute.o prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+g++$(exeext): g++.o g++spec.o version.o choose-temp.o pexecute.o prefix.o mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g++.o g++spec.o prefix.o \
- version.o choose-temp.o pexecute.o $(EXTRA_GCC_OBJS) $(LIBS)
+ version.o choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
# Create a version of the g++ driver which calls the cross-compiler.
g++-cross$(exeext): g++$(exeext)
-rm -f g++-cross$(exeext)
cp g++$(exeext) g++-cross$(exeext)
-cxxmain.o: cplus-dem.c demangle.h
+cxxmain.o: $(srcdir)/../libiberty/cplus-dem.c demangle.h
rm -f cxxmain.c
- $(LN_S) $(srcdir)/cplus-dem.c cxxmain.c
+ $(LN_S) $(srcdir)/../libiberty/cplus-dem.c cxxmain.c
$(CC) -c -DMAIN $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DVERSION=\"$(version)\" cxxmain.c
$(DEMANGLER_PROG): cxxmain.o underscore.o getopt.o getopt1.o $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(LIBS) -o $@ \
- cxxmain.o underscore.o getopt.o getopt1.o
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ cxxmain.o underscore.o getopt.o getopt1.o $(LIBS)
CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
$(srcdir)/cp/except.c $(srcdir)/cp/input.c $(srcdir)/cp/pt.c \
@@ -140,40 +140,40 @@ c++.dvi:
# C++ language-support library pieces for libgcc.
tinfo.o: cc1plus$(exeext) $(srcdir)/cp/tinfo.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/tinfo.cc
tinfo2.o: cc1plus$(exeext) $(srcdir)/cp/tinfo2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/tinfo2.cc
exception.o: cc1plus$(exeext) $(srcdir)/cp/exception.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c -fexceptions $(srcdir)/cp/exception.cc
new.o: cc1plus$(exeext) $(srcdir)/cp/new.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new.cc
opnew.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new1.cc -DL_op_new -o opnew.o
opnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new1.cc -DL_op_newnt -o opnewnt.o
opvnew.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vnew -o opvnew.o
opvnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vnewnt -o opvnewnt.o
opdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_delete -o opdel.o
opdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_delnt -o opdelnt.o
opvdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vdel -o opvdel.o
opvdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) \
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
-c $(srcdir)/cp/new2.cc -DL_op_vdelnt -o opvdelnt.o
# We want to update cplib2.txt if any of the source files change...
diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in
index c917e601cb8..d9e32402d39 100644
--- a/gcc/cp/Makefile.in
+++ b/gcc/cp/Makefile.in
@@ -34,6 +34,10 @@
# Suppress smart makes who think they know how to automake Yacc files
.y.c:
+# It defines the c++ interface name. It should be changed when the
+# c++ interface is changed.
+INTERFACE = 1
+
# Variables that exist for you to override.
# See below for how to change them for certain systems.
@@ -55,9 +59,9 @@ X_CPPFLAGS =
T_CPPFLAGS =
CC = @CC@
-BISON = bison
+BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
BISONFLAGS =
-LEX = flex
+LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
LEXFLAGS =
AR = ar
AR_FLAGS = rc
@@ -83,6 +87,12 @@ GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
+# We don't use cross-make. Instead we use the tools
+# from the build tree, if they are available.
+# program_transform_name and objdir are set by configure.in.
+program_transform_name =
+objdir = .
+
target=@target@
xmake_file=@dep_host_xmake_file@
tmake_file=@dep_tmake_file@
@@ -150,7 +160,7 @@ LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
-INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
+INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
# Always use -I$(srcdir)/config when compiling.
.c.o:
@@ -170,7 +180,8 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
- except.o friend.o init.o method.o search.o semantics.o tree.o xref.o repo.o
+ except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
+ repo.o @extra_cxx_objs@
# Language-independent object files.
OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
@@ -200,13 +211,15 @@ TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
PARSE_H = $(srcdir)/parse.h
PARSE_C = $(srcdir)/parse.c
+EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
- $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h
+ $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
-CONFLICTS = expect 21 shift/reduce conflicts and 49 reduce/reduce conflicts.
+CONFLICTS = expect 25 shift/reduce conflicts and 42 reduce/reduce conflicts.
$(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS)
@@ -227,26 +240,26 @@ $(PARSE_C) : $(srcdir)/parse.y
# if gxx.gpref got touched, say.
# Thus you have to remove hash.h to force it to be re-made.
$(srcdir)/hash.h:
- gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
- $(srcdir)/gxx.gperf >$(srcdir)/hash.h
+ gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
+ '-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h
-spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
- $(PARSE_H) $(srcdir)/../flags.h lex.h $(srcdir)/../system.h
+spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
+ lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
$(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
- $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h
+ $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
+ $(srcdir)/../output.h $(srcdir)/../mbchar.h
decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
- lex.h decl.h $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../except.h \
+ lex.h decl.h $(EXPR_H) $(srcdir)/../except.h \
$(srcdir)/../output.h $(srcdir)/../except.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
+ $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h
typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
+ $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
class.o : class.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
@@ -254,8 +267,7 @@ call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
friend.o : friend.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(srcdir)/../system.h $(srcdir)/../toplev.h
init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
+ $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
method.o : method.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
@@ -269,8 +281,7 @@ rtti.o : rtti.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
+ $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS
index ebfe3140075..9cb7d5b2c26 100644
--- a/gcc/cp/NEWS
+++ b/gcc/cp/NEWS
@@ -1,4 +1,8 @@
-*** Changes since EGCS 1.0:
+*** Changes in EGCS 1.1:
+
+* Namespaces are fully supported. The library has not yet been converted
+ to use namespace std, however, and the old std-faking code is still on by
+ default. To turn it off, you can use -fhonor-std.
* Massive template improvements:
+ member template classes are supported.
@@ -9,8 +13,9 @@
* operator new now throws bad_alloc where appropriate.
-* Exception handling is now thread safe, and supports nested
- exceptions and placement delete.
+* Exception handling is now thread safe, and supports nested exceptions and
+ placement delete. Exception handling overhead on x86 is much lower with
+ GNU as 2.9.
* protected virtual inheritance is now supported.
@@ -20,6 +25,17 @@
* For class D derived from B which has a member 'int i', &D::i is now of
type 'int B::*' instead of 'int D::*'.
+* An _experimental_ new ABI for g++ can be turned on with -fnew-abi. The
+ current features of this are more efficient allocation of base classes
+ (including the empty base optimization), and more compact mangling of C++
+ symbol names (which can be turned on separately with -fsquangle). This
+ ABI is subject to change without notice, so don't use it for anything
+ that you don't want to rebuild with every release of the compiler.
+
+ As with all ABI-changing flags, this flag is for experts only, as all
+ code (including the library code in libgcc and libstdc++) must be
+ compiled with the same ABI.
+
*** Changes in EGCS 1.0:
* A public review copy of the December 1996 Draft of the ISO/ANSI C++
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index c7eaed4ae7f..f01aacb09c0 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -45,10 +45,8 @@ static tree build_field_call PROTO((tree, tree, tree, tree));
static tree find_scoped_type PROTO((tree, tree, tree));
static struct z_candidate * tourney PROTO((struct z_candidate *));
static int joust PROTO((struct z_candidate *, struct z_candidate *, int));
-static int compare_qual PROTO((tree, tree));
static int compare_ics PROTO((tree, tree));
static tree build_over_call PROTO((struct z_candidate *, tree, int));
-static tree convert_default_arg PROTO((tree, tree));
static tree convert_like PROTO((tree, tree));
static void op_error PROTO((enum tree_code, enum tree_code, tree, tree,
tree, char *));
@@ -61,9 +59,11 @@ static tree build_this PROTO((tree));
static struct z_candidate * splice_viable PROTO((struct z_candidate *));
static int any_viable PROTO((struct z_candidate *));
static struct z_candidate * add_template_candidate
- PROTO((struct z_candidate *, tree, tree, tree, tree, int));
+ PROTO((struct z_candidate *, tree, tree, tree, tree, int,
+ unification_kind_t));
static struct z_candidate * add_template_candidate_real
- PROTO((struct z_candidate *, tree, tree, tree, tree, int, tree));
+ PROTO((struct z_candidate *, tree, tree, tree, tree, int,
+ tree, unification_kind_t));
static struct z_candidate * add_template_conv_candidate
PROTO((struct z_candidate *, tree, tree, tree, tree));
static struct z_candidate * add_builtin_candidates
@@ -87,19 +87,19 @@ static tree strip_top_quals PROTO((tree));
static tree non_reference PROTO((tree));
static tree build_conv PROTO((enum tree_code, tree, tree));
static int is_subseq PROTO((tree, tree));
+static int is_properly_derived_from PROTO((tree, tree));
+static int maybe_handle_ref_bind PROTO((tree*, tree*));
+static void maybe_handle_implicit_object PROTO((tree*));
tree
build_vfield_ref (datum, type)
tree datum, type;
{
tree rval;
- int old_assume_nonnull_objects = flag_assume_nonnull_objects;
if (datum == error_mark_node)
return error_mark_node;
- /* Vtable references are always made from non-null objects. */
- flag_assume_nonnull_objects = 1;
if (TREE_CODE (TREE_TYPE (datum)) == REFERENCE_TYPE)
datum = convert_from_reference (datum);
@@ -108,7 +108,6 @@ build_vfield_ref (datum, type)
datum, CLASSTYPE_VFIELD (type));
else
rval = build_component_ref (datum, DECL_NAME (CLASSTYPE_VFIELD (type)), NULL_TREE, 0);
- flag_assume_nonnull_objects = old_assume_nonnull_objects;
return rval;
}
@@ -137,7 +136,7 @@ build_field_call (basetype_path, instance_ptr, name, parms)
return error_mark_node;
}
- if (TREE_CODE (field) == FIELD_DECL)
+ if (TREE_CODE (field) == FIELD_DECL || TREE_CODE (field) == VAR_DECL)
{
/* If it's a field, try overloading operator (),
or calling if the field is a pointer-to-function. */
@@ -168,7 +167,8 @@ build_field_call (basetype_path, instance_ptr, name, parms)
if (field == error_mark_node)
return error_mark_node;
- if (field && TREE_CODE (field) == FIELD_DECL)
+ if (field && (TREE_CODE (field) == FIELD_DECL ||
+ TREE_CODE (field) == VAR_DECL))
{
tree basetype;
tree ftype = TREE_TYPE (field);
@@ -337,6 +337,37 @@ resolve_scope_to_name (outer_type, inner_stuff)
return tmp;
}
+/* Returns nonzero iff the destructor name specified in NAME
+ (a BIT_NOT_EXPR) matches BASETYPE. The operand of NAME can take many
+ forms... */
+
+int
+check_dtor_name (basetype, name)
+ tree basetype, name;
+{
+ name = TREE_OPERAND (name, 0);
+
+ if (TREE_CODE (name) == TYPE_DECL)
+ name = TREE_TYPE (name);
+ else if (TREE_CODE_CLASS (TREE_CODE (name)) == 't')
+ /* OK */;
+ else if (TREE_CODE (name) == IDENTIFIER_NODE)
+ {
+ if ((IS_AGGR_TYPE (basetype) && name == constructor_name (basetype))
+ || (TREE_CODE (basetype) == ENUMERAL_TYPE
+ && name == TYPE_IDENTIFIER (basetype)))
+ name = basetype;
+ else
+ name = get_type_value (name);
+ }
+ else
+ my_friendly_abort (980605);
+
+ if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name))
+ return 1;
+ return 0;
+}
+
/* Build a method call of the form `EXP->SCOPES::NAME (PARMS)'.
This is how virtual function calls are avoided. */
@@ -359,7 +390,8 @@ build_scoped_method_call (exp, basetype, name, parms)
if (processing_template_decl)
{
- if (TREE_CODE (name) == BIT_NOT_EXPR)
+ if (TREE_CODE (name) == BIT_NOT_EXPR
+ && TREE_CODE (TREE_OPERAND (name, 0)) == IDENTIFIER_NODE)
{
tree type = get_aggr_from_typedef (TREE_OPERAND (name, 0), 0);
if (type)
@@ -380,20 +412,30 @@ build_scoped_method_call (exp, basetype, name, parms)
else
binfo = NULL_TREE;
- /* Destructors can be "called" for simple types; see 5.2.4 and 12.4 Note
- that explicit ~int is caught in the parser; this deals with typedefs
- and template parms. */
- if (TREE_CODE (name) == BIT_NOT_EXPR && ! IS_AGGR_TYPE (basetype))
+ /* Check the destructor call syntax. */
+ if (TREE_CODE (name) == BIT_NOT_EXPR)
{
- if (TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (basetype))
- cp_error ("type of `%E' does not match destructor type `%T' (type was `%T')",
- exp, basetype, type);
- name = TREE_OPERAND (name, 0);
- if (TYPE_MAIN_VARIANT (basetype) != name
- && basetype != get_type_value (name))
+ /* We can get here if someone writes their destructor call like
+ `obj.NS::~T()'; this isn't really a scoped method call, so hand
+ it off. */
+ if (TREE_CODE (basetype) == NAMESPACE_DECL)
+ return build_method_call (exp, name, parms, NULL_TREE, LOOKUP_NORMAL);
+
+ if (! check_dtor_name (basetype, name))
cp_error ("qualified type `%T' does not match destructor name `~%T'",
- basetype, name);
- return cp_convert (void_type_node, exp);
+ basetype, TREE_OPERAND (name, 0));
+
+ /* Destructors can be "called" for simple types; see 5.2.4 and 12.4 Note
+ that explicit ~int is caught in the parser; this deals with typedefs
+ and template parms. */
+ if (! IS_AGGR_TYPE (basetype))
+ {
+ if (TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (basetype))
+ cp_error ("type of `%E' does not match destructor type `%T' (type was `%T')",
+ exp, basetype, type);
+
+ return cp_convert (void_type_node, exp);
+ }
}
if (! is_aggr_type (basetype, 1))
@@ -427,17 +469,6 @@ build_scoped_method_call (exp, basetype, name, parms)
/* Call to a destructor. */
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
- /* Explicit call to destructor. */
- name = TREE_OPERAND (name, 0);
- if (! (name == TYPE_MAIN_VARIANT (TREE_TYPE (decl))
- || name == constructor_name (TREE_TYPE (decl))
- || TREE_TYPE (decl) == get_type_value (name)))
- {
- cp_error
- ("qualified type `%T' does not match destructor name `~%T'",
- TREE_TYPE (decl), name);
- return error_mark_node;
- }
if (! TYPE_HAS_DESTRUCTOR (TREE_TYPE (decl)))
return cp_convert (void_type_node, exp);
@@ -592,10 +623,13 @@ build_method_call (instance, name, parms, basetype_path, flags)
if (processing_template_decl)
{
- if (TREE_CODE (name) == BIT_NOT_EXPR)
+ /* We need to process template parm names here so that tsubst catches
+ them properly. Other type names can wait. */
+ if (TREE_CODE (name) == BIT_NOT_EXPR
+ && TREE_CODE (TREE_OPERAND (name, 0)) == IDENTIFIER_NODE)
{
tree type = get_aggr_from_typedef (TREE_OPERAND (name, 0), 0);
- if (type)
+ if (type && TREE_CODE (type) == TEMPLATE_TYPE_PARM)
name = build_min_nt (BIT_NOT_EXPR, type);
}
@@ -627,22 +661,16 @@ build_method_call (instance, name, parms, basetype_path, flags)
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
- flags |= LOOKUP_DESTRUCTOR;
- name = TREE_OPERAND (name, 0);
if (parms)
error ("destructors take no parameters");
basetype = TREE_TYPE (instance);
if (TREE_CODE (basetype) == REFERENCE_TYPE)
basetype = TREE_TYPE (basetype);
- if (! (name == TYPE_MAIN_VARIANT (basetype)
- || (IS_AGGR_TYPE (basetype)
- && name == constructor_name (basetype))
- || basetype == get_type_value (name)))
- {
- cp_error ("destructor name `~%D' does not match type `%T' of expression",
- name, basetype);
- return cp_convert (void_type_node, instance);
- }
+
+ if (! check_dtor_name (basetype, name))
+ cp_error
+ ("destructor name `~%T' does not match type `%T' of expression",
+ TREE_OPERAND (name, 0), basetype);
if (! TYPE_HAS_DESTRUCTOR (complete_type (basetype)))
return cp_convert (void_type_node, instance);
@@ -852,6 +880,9 @@ standard_conversion (to, from, expr)
/* OK */;
else if (comp_ptr_ttypes (TREE_TYPE (to), TREE_TYPE (from)))
conv = build_conv (QUAL_CONV, to, conv);
+ else if (expr && string_conv_p (to, expr, 0))
+ /* converting from string constant to char *. */
+ conv = build_conv (QUAL_CONV, to, conv);
else if (ptr_reasonably_similar (TREE_TYPE (to), TREE_TYPE (from)))
{
conv = build_conv (PTR_CONV, to, conv);
@@ -1093,7 +1124,6 @@ add_function_candidate (candidates, fn, arglist, flags)
tree parmnode = parmlist;
tree argnode = arglist;
int viable = 1;
- struct z_candidate *cand;
/* The `this' and `in_chrg' arguments to constructors are not considered
in overload resolution. */
@@ -1114,12 +1144,9 @@ add_function_candidate (candidates, fn, arglist, flags)
for (i = 0; i < len; ++i)
{
tree arg = TREE_VALUE (argnode);
- tree argtype = TREE_TYPE (arg);
+ tree argtype = lvalue_type (arg);
tree t;
- argtype = cp_build_type_variant
- (argtype, TREE_READONLY (arg), TREE_THIS_VOLATILE (arg));
-
if (parmnode == void_list_node)
break;
else if (parmnode)
@@ -1178,7 +1205,6 @@ add_conv_candidate (candidates, fn, obj, arglist)
tree parmnode = parmlist;
tree argnode = arglist;
int viable = 1;
- struct z_candidate *cand;
int flags = LOOKUP_NORMAL;
for (i = 0; i < len; ++i)
@@ -1238,7 +1264,6 @@ build_builtin_candidate (candidates, fnname, type1, type2,
{
tree t, convs;
int viable = 1, i;
- struct z_candidate *cand;
tree types[2];
types[0] = type1;
@@ -1774,6 +1799,11 @@ add_builtin_candidates (candidates, code, code2, fnname, args, flags)
{
tree convs = lookup_conversions (argtypes[i]);
+ if (i == 0 && code == MODIFY_EXPR && code2 == NOP_EXPR)
+ return candidates;
+
+ convs = lookup_conversions (argtypes[i]);
+
if (code == COND_EXPR)
{
if (real_lvalue_p (args[i]))
@@ -1783,9 +1813,8 @@ add_builtin_candidates (candidates, code, code2, fnname, args, flags)
types[i] = scratch_tree_cons
(NULL_TREE, TYPE_MAIN_VARIANT (argtypes[i]), types[i]);
}
-
- else if (! convs || (i == 0 && code == MODIFY_EXPR
- && code2 == NOP_EXPR))
+
+ else if (! convs)
return candidates;
for (; convs; convs = TREE_CHAIN (convs))
@@ -1862,11 +1891,12 @@ add_builtin_candidates (candidates, code, code2, fnname, args, flags)
static struct z_candidate*
add_template_candidate_real (candidates, tmpl, explicit_targs,
arglist, return_type, flags,
- obj)
+ obj, strict)
struct z_candidate *candidates;
tree tmpl, explicit_targs, arglist, return_type;
int flags;
tree obj;
+ unification_kind_t strict;
{
int ntparms = DECL_NTPARMS (tmpl);
tree targs = make_scratch_vec (ntparms);
@@ -1875,7 +1905,7 @@ add_template_candidate_real (candidates, tmpl, explicit_targs,
tree fn;
i = fn_type_unification (tmpl, explicit_targs, targs, arglist,
- return_type, 0, NULL_TREE);
+ return_type, strict, NULL_TREE);
if (i != 0)
return candidates;
@@ -1917,14 +1947,16 @@ add_template_candidate_real (candidates, tmpl, explicit_targs,
static struct z_candidate *
add_template_candidate (candidates, tmpl, explicit_targs,
- arglist, return_type, flags)
+ arglist, return_type, flags, strict)
struct z_candidate *candidates;
tree tmpl, explicit_targs, arglist, return_type;
int flags;
+ unification_kind_t strict;
{
return
add_template_candidate_real (candidates, tmpl, explicit_targs,
- arglist, return_type, flags, NULL_TREE);
+ arglist, return_type, flags,
+ NULL_TREE, strict);
}
@@ -1935,7 +1967,7 @@ add_template_conv_candidate (candidates, tmpl, obj, arglist, return_type)
{
return
add_template_candidate_real (candidates, tmpl, NULL_TREE, arglist,
- return_type, 0, obj);
+ return_type, 0, obj, DEDUCE_CONV);
}
@@ -2044,20 +2076,22 @@ build_user_type_conversion_1 (totype, expr, flags)
ctors = TREE_VALUE (ctors);
}
- for (; ctors; ctors = DECL_CHAIN (ctors))
+ for (; ctors; ctors = OVL_NEXT (ctors))
{
- if (DECL_NONCONVERTING_P (ctors))
+ tree ctor = OVL_CURRENT (ctors);
+ if (DECL_NONCONVERTING_P (ctor))
continue;
- if (TREE_CODE (ctors) == TEMPLATE_DECL)
+ if (TREE_CODE (ctor) == TEMPLATE_DECL)
{
- templates = scratch_tree_cons (NULL_TREE, ctors, templates);
+ templates = scratch_tree_cons (NULL_TREE, ctor, templates);
candidates =
- add_template_candidate (candidates, ctors,
- NULL_TREE, args, NULL_TREE, flags);
+ add_template_candidate (candidates, ctor,
+ NULL_TREE, args, NULL_TREE, flags,
+ DEDUCE_CALL);
}
else
- candidates = add_function_candidate (candidates, ctors,
+ candidates = add_function_candidate (candidates, ctor,
args, flags);
if (candidates)
@@ -2072,7 +2106,7 @@ build_user_type_conversion_1 (totype, expr, flags)
for (; convs; convs = TREE_CHAIN (convs))
{
- tree fn = TREE_VALUE (convs);
+ tree fns = TREE_VALUE (convs);
int convflags = LOOKUP_NO_CONVERSION;
tree ics;
@@ -2083,39 +2117,46 @@ build_user_type_conversion_1 (totype, expr, flags)
if (TREE_CODE (totype) == REFERENCE_TYPE)
convflags |= LOOKUP_NO_TEMP_BIND;
- if (TREE_CODE (fn) != TEMPLATE_DECL)
+ if (TREE_CODE (fns) != TEMPLATE_DECL)
ics = implicit_conversion
- (totype, TREE_TYPE (TREE_TYPE (fn)), 0, convflags);
+ (totype, TREE_TYPE (TREE_TYPE (OVL_CURRENT (fns))), 0, convflags);
else
- /* Here, the template conversion operator result must
- precisely match the TOTYPE. (FIXME: Actually, we're
- supposed to do some simple conversions here; see
- [temp.deduct.conv].). If the result of the conversion
- operator is not actually TOTYPE, then
- add_template_candidate will fail below. */
- ics = implicit_conversion (totype, totype, 0, convflags);
+ /* We can't compute this yet. */
+ ics = error_mark_node;
if (TREE_CODE (totype) == REFERENCE_TYPE && ics && ICS_BAD_FLAG (ics))
/* ignore the near match. */;
else if (ics)
- for (; fn; fn = DECL_CHAIN (fn))
+ for (; fns; fns = OVL_NEXT (fns))
{
+ tree fn = OVL_CURRENT (fns);
+ struct z_candidate *old_candidates = candidates;
+
if (TREE_CODE (fn) == TEMPLATE_DECL)
{
templates = scratch_tree_cons (NULL_TREE, fn, templates);
candidates =
add_template_candidate (candidates, fn, NULL_TREE,
- args, totype, flags);
+ args, totype, flags,
+ DEDUCE_CONV);
}
else
candidates = add_function_candidate (candidates, fn,
args, flags);
- if (candidates)
+ if (candidates != old_candidates)
{
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
+ ics = implicit_conversion
+ (totype, TREE_TYPE (TREE_TYPE (candidates->fn)),
+ 0, convflags);
+
candidates->second_conv = ics;
candidates->basetype_path = TREE_PURPOSE (convs);
- if (candidates->viable == 1 && ICS_BAD_FLAG (ics))
+
+ if (ics == NULL_TREE)
+ candidates->viable = 0;
+ else if (candidates->viable == 1 && ICS_BAD_FLAG (ics))
candidates->viable = -1;
}
}
@@ -2214,6 +2255,26 @@ resolve_args (args)
}
else if (TREE_CODE (TREE_VALUE (t)) == OFFSET_REF)
TREE_VALUE (t) = resolve_offset_ref (TREE_VALUE (t));
+ else if (TREE_CODE (TREE_VALUE (t)) == TEMPLATE_ID_EXPR)
+ {
+ tree targs;
+ tree r;
+
+ r = determine_specialization (TREE_VALUE (t), NULL_TREE,
+ &targs,
+ /*need_member_template=*/0,
+ /*complain=*/0);
+
+ /* If we figured out what was being specialized, use it.
+ Otherwise, the function being called may resolve the
+ choice of specialization, so we don't issue any error
+ messages here. */
+ if (r)
+ {
+ r = instantiate_template (r, targs);
+ TREE_VALUE (t) = r;
+ }
+ }
}
return args;
}
@@ -2235,7 +2296,7 @@ build_new_function_call (fn, args)
if (really_overloaded_fn (fn))
{
- tree t;
+ tree t1;
tree templates = NULL_TREE;
args = resolve_args (args);
@@ -2243,14 +2304,15 @@ build_new_function_call (fn, args)
if (args == error_mark_node)
return error_mark_node;
- for (t = TREE_VALUE (fn); t; t = DECL_CHAIN (t))
+ for (t1 = fn; t1; t1 = OVL_CHAIN (t1))
{
+ tree t = OVL_FUNCTION (t1);
if (TREE_CODE (t) == TEMPLATE_DECL)
{
templates = scratch_tree_cons (NULL_TREE, t, templates);
candidates = add_template_candidate
(candidates, t, explicit_targs, args, NULL_TREE,
- LOOKUP_NORMAL);
+ LOOKUP_NORMAL, DEDUCE_CALL);
}
else if (! template_only)
candidates = add_function_candidate
@@ -2262,7 +2324,7 @@ build_new_function_call (fn, args)
if (candidates && ! candidates->next)
return build_function_call (candidates->fn, args);
cp_error ("no matching function for call to `%D (%A)'",
- TREE_PURPOSE (fn), args);
+ DECL_NAME (OVL_FUNCTION (fn)), args);
if (candidates)
print_z_candidates (candidates);
return error_mark_node;
@@ -2273,7 +2335,7 @@ build_new_function_call (fn, args)
if (cand == 0)
{
cp_error ("call of overloaded `%D (%A)' is ambiguous",
- TREE_PURPOSE (fn), args);
+ DECL_NAME (OVL_FUNCTION (fn)), args);
print_z_candidates (candidates);
return error_mark_node;
}
@@ -2288,6 +2350,9 @@ build_new_function_call (fn, args)
return build_over_call (cand, args, LOOKUP_NORMAL);
}
+ /* This is not really overloaded. */
+ fn = OVL_CURRENT (fn);
+
return build_function_call (fn, args);
}
@@ -2320,25 +2385,26 @@ build_object_call (obj, args)
if (fns)
{
- tree fn = TREE_VALUE (fns);
+ tree base = TREE_PURPOSE (fns);
mem_args = scratch_tree_cons (NULL_TREE, build_this (obj), args);
- for (; fn; fn = DECL_CHAIN (fn))
+ for (fns = TREE_VALUE (fns); fns; fns = OVL_NEXT (fns))
{
+ tree fn = OVL_CURRENT (fns);
if (TREE_CODE (fn) == TEMPLATE_DECL)
{
templates = scratch_tree_cons (NULL_TREE, fn, templates);
candidates
= add_template_candidate (candidates, fn, NULL_TREE,
mem_args, NULL_TREE,
- LOOKUP_NORMAL);
+ LOOKUP_NORMAL, DEDUCE_CALL);
}
else
candidates = add_function_candidate
(candidates, fn, mem_args, LOOKUP_NORMAL);
if (candidates)
- candidates->basetype_path = TREE_PURPOSE (fns);
+ candidates->basetype_path = base;
}
}
@@ -2346,13 +2412,14 @@ build_object_call (obj, args)
for (; convs; convs = TREE_CHAIN (convs))
{
- tree fn = TREE_VALUE (convs);
- tree totype = TREE_TYPE (TREE_TYPE (fn));
+ tree fns = TREE_VALUE (convs);
+ tree totype = TREE_TYPE (TREE_TYPE (OVL_CURRENT (fns)));
if (TREE_CODE (totype) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (totype)) == FUNCTION_TYPE)
- for (; fn; fn = DECL_CHAIN (fn))
+ for (; fns; fns = OVL_NEXT (fns))
{
+ tree fn = OVL_CURRENT (fns);
if (TREE_CODE (fn) == TEMPLATE_DECL)
{
templates = scratch_tree_cons (NULL_TREE, fn, templates);
@@ -2472,7 +2539,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
arglist = scratch_tree_cons (NULL_TREE, arg2, arg3);
if (flags & LOOKUP_GLOBAL)
return build_new_function_call
- (lookup_name_nonclass (fnname), arglist);
+ (lookup_function_nonclass (fnname, arglist), arglist);
/* FIXME */
rval = build_method_call
@@ -2494,9 +2561,11 @@ build_new_op (code, flags, arg1, arg2, arg3)
tree rval;
if (flags & LOOKUP_GLOBAL)
- return build_new_function_call
- (lookup_name_nonclass (fnname),
- build_scratch_list (NULL_TREE, arg1));
+ {
+ arglist = build_scratch_list (NULL_TREE, arg1);
+ return build_new_function_call
+ (lookup_function_nonclass (fnname, arglist), arglist);
+ }
arglist = scratch_tree_cons (NULL_TREE, arg1, build_scratch_list (NULL_TREE, arg2));
@@ -2571,23 +2640,23 @@ build_new_op (code, flags, arg1, arg2, arg3)
else
arglist = build_scratch_list (NULL_TREE, arg1);
- fns = lookup_name_nonclass (fnname);
- /* + Koenig lookup */
+ fns = lookup_function_nonclass (fnname, arglist);
if (fns && TREE_CODE (fns) == TREE_LIST)
fns = TREE_VALUE (fns);
- for (; fns; fns = DECL_CHAIN (fns))
+ for (; fns; fns = OVL_NEXT (fns))
{
- if (TREE_CODE (fns) == TEMPLATE_DECL)
+ tree fn = OVL_CURRENT (fns);
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
{
- templates = scratch_tree_cons (NULL_TREE, fns, templates);
+ templates = scratch_tree_cons (NULL_TREE, fn, templates);
candidates
- = add_template_candidate (candidates, fns, NULL_TREE,
+ = add_template_candidate (candidates, fn, NULL_TREE,
arglist, TREE_TYPE (fnname),
- flags);
+ flags, DEDUCE_CALL);
}
else
- candidates = add_function_candidate (candidates, fns, arglist, flags);
+ candidates = add_function_candidate (candidates, fn, arglist, flags);
}
if (IS_AGGR_TYPE (TREE_TYPE (arg1)))
@@ -2601,10 +2670,11 @@ build_new_op (code, flags, arg1, arg2, arg3)
if (fns)
{
- tree fn = TREE_VALUE (fns);
+ tree basetype = TREE_PURPOSE (fns);
mem_arglist = scratch_tree_cons (NULL_TREE, build_this (arg1), TREE_CHAIN (arglist));
- for (; fn; fn = DECL_CHAIN (fn))
+ for (fns = TREE_VALUE (fns); fns; fns = OVL_NEXT (fns))
{
+ tree fn = OVL_CURRENT (fns);
tree this_arglist;
if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
@@ -2619,14 +2689,14 @@ build_new_op (code, flags, arg1, arg2, arg3)
candidates
= add_template_candidate (candidates, fn, NULL_TREE,
this_arglist, TREE_TYPE (fnname),
- flags);
+ flags, DEDUCE_CALL);
}
else
candidates = add_function_candidate
(candidates, fn, this_arglist, flags);
if (candidates)
- candidates->basetype_path = TREE_PURPOSE (fns);
+ candidates->basetype_path = basetype;
}
}
@@ -2741,8 +2811,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
case LE_EXPR:
case EQ_EXPR:
case NE_EXPR:
- if (flag_int_enum_equivalence == 0
- && TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE
+ if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE
&& TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE
&& (TYPE_MAIN_VARIANT (TREE_TYPE (arg1))
!= TYPE_MAIN_VARIANT (TREE_TYPE (arg2))))
@@ -2855,7 +2924,8 @@ build_op_new_call (code, type, args, flags)
return build_method_call (dummy, fnname, args, NULL_TREE, flags);
}
else
- return build_new_function_call (lookup_name_nonclass (fnname), args);
+ return build_new_function_call
+ (lookup_function_nonclass (fnname, args), args);
}
/* Build a call to operator delete. This has to be handled very specially,
@@ -2868,16 +2938,16 @@ build_op_new_call (code, type, args, flags)
ADDR is the pointer to be deleted. For placement delete, it is also
used to determine what the corresponding new looked like.
SIZE is the size of the memory block to be deleted.
- FLAGS are the usual overloading flags. */
+ FLAGS are the usual overloading flags.
+ PLACEMENT is the corresponding placement new call, or 0. */
tree
-build_op_delete_call (code, addr, size, flags)
+build_op_delete_call (code, addr, size, flags, placement)
enum tree_code code;
- tree addr, size;
+ tree addr, size, placement;
int flags;
{
tree fn, fns, fnname, fntype, argtypes, args, type;
- int placement;
if (addr == error_mark_node)
return error_mark_node;
@@ -2901,39 +2971,20 @@ build_op_delete_call (code, addr, size, flags)
else
fns = NULL_TREE;
- if (fns)
- {
- /* Build this up like build_offset_ref does. */
- fns = build_tree_list (error_mark_node, fns);
- TREE_TYPE (fns) = build_offset_type (type, unknown_type_node);
- }
- else
+ if (fns == NULL_TREE)
fns = lookup_name_nonclass (fnname);
- /* We can recognize a placement delete because of LOOKUP_SPECULATIVELY;
- if we are doing placement delete we do nothing if we don't find a
- matching op delete. */
- placement = !!(flags & LOOKUP_SPECULATIVELY);
if (placement)
{
- /* If placement, we are coming from build_new, and we know that addr
- is the allocation expression, so extract the info we need from it.
- Obviously, if the build_new process changes this may have to
- change as well. */
-
- /* The NOP_EXPR. */
- tree t = TREE_OPERAND (addr, 1);
- /* The CALL_EXPR. */
- t = TREE_OPERAND (t, 0);
- /* The function. */
- argtypes = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
- /* The second parm type. */
+ /* placement is a CALL_EXPR around an ADDR_EXPR around a function. */
+
+ /* Extract the function. */
+ argtypes = TREE_OPERAND (TREE_OPERAND (placement, 0), 0);
+ /* Then the second parm type. */
argtypes = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (argtypes)));
- /* The second argument. */
- args = TREE_CHAIN (TREE_OPERAND (t, 1));
- /* Pull the dummy var out of the TARGET_EXPR for use in our call. */
- addr = TREE_OPERAND (addr, 0);
+ /* Also the second argument. */
+ args = TREE_CHAIN (TREE_OPERAND (placement, 1));
}
else
{
@@ -2952,18 +3003,20 @@ build_op_delete_call (code, addr, size, flags)
/* instantiate_type will always return a plain function; pretend it's
overloaded. */
if (TREE_CODE (fns) == FUNCTION_DECL)
- fns = scratch_tree_cons (NULL_TREE, fns, NULL_TREE);
+ fns = scratch_ovl_cons (fns, NULL_TREE);
fn = instantiate_type (fntype, fns, 0);
if (fn != error_mark_node)
{
- if (TREE_CODE (TREE_VALUE (fns)) == TREE_LIST)
+ if (TREE_CODE (fns) == TREE_LIST)
/* Member functions. */
- enforce_access (TREE_PURPOSE (TREE_VALUE (fns)), fn);
+ enforce_access (TREE_PURPOSE (fns), fn);
return build_function_call (fn, expr_tree_cons (NULL_TREE, addr, args));
}
+ /* If we are doing placement delete we do nothing if we don't find a
+ matching op delete. */
if (placement)
return NULL_TREE;
@@ -2975,9 +3028,20 @@ build_op_delete_call (code, addr, size, flags)
fn = instantiate_type (fntype, fns, 0);
if (fn != error_mark_node)
- return build_function_call
- (fn, expr_tree_cons (NULL_TREE, addr,
- build_expr_list (NULL_TREE, size)));
+ {
+ if (TREE_CODE (fns) == TREE_LIST)
+ /* Member functions. */
+ enforce_access (TREE_PURPOSE (fns), fn);
+ return build_function_call
+ (fn, expr_tree_cons (NULL_TREE, addr,
+ build_expr_list (NULL_TREE, size)));
+ }
+
+ /* finish_function passes LOOKUP_SPECULATIVELY if we're in a
+ destructor, in which case the error should be deferred
+ until someone actually tries to delete one of these. */
+ if (flags & LOOKUP_SPECULATIVELY)
+ return NULL_TREE;
cp_error ("no suitable operator delete for `%T'", type);
return error_mark_node;
@@ -3092,8 +3156,32 @@ convert_like (convs, expr)
return expr;
/* else fall through */
case BASE_CONV:
- return build_user_type_conversion
- (TREE_TYPE (convs), expr, LOOKUP_NORMAL);
+ {
+ tree cvt_expr = build_user_type_conversion
+ (TREE_TYPE (convs), expr, LOOKUP_NORMAL);
+ if (!cvt_expr)
+ {
+ /* This can occur if, for example, the EXPR has incomplete
+ type. We can't check for that before attempting the
+ conversion because the type might be an incomplete
+ array type, which is OK if some constructor for the
+ destination type takes a pointer argument. */
+ if (TYPE_SIZE (TREE_TYPE (expr)) == 0)
+ {
+ if (comptypes (TREE_TYPE (expr), TREE_TYPE (convs), 1))
+ incomplete_type_error (expr, TREE_TYPE (expr));
+ else
+ cp_error ("could not convert `%E' (with incomplete type `%T') to `%T'",
+ expr, TREE_TYPE (expr), TREE_TYPE (convs));
+ }
+ else
+ cp_error ("could not convert `%E' to `%T'",
+ expr, TREE_TYPE (convs));
+ return error_mark_node;
+ }
+ return cvt_expr;
+ }
+
case REF_BIND:
return convert_to_reference
(TREE_TYPE (convs), expr,
@@ -3102,6 +3190,11 @@ convert_like (convs, expr)
case LVALUE_CONV:
return decay_conversion (expr);
+ case QUAL_CONV:
+ /* Warn about deprecated conversion if appropriate. */
+ string_conv_p (TREE_TYPE (convs), expr, 1);
+ break;
+
default:
break;
}
@@ -3109,7 +3202,34 @@ convert_like (convs, expr)
LOOKUP_NORMAL|LOOKUP_NO_CONVERSION);
}
-static tree
+/* ARG is being passed to a varargs function. Perform any conversions
+ required. Return the converted value. */
+
+tree
+convert_arg_to_ellipsis (arg)
+ tree arg;
+{
+ if (TREE_CODE (TREE_TYPE (arg)) == REAL_TYPE
+ && (TYPE_PRECISION (TREE_TYPE (arg))
+ < TYPE_PRECISION (double_type_node)))
+ /* Convert `float' to `double'. */
+ arg = cp_convert (double_type_node, arg);
+ else if (IS_AGGR_TYPE (TREE_TYPE (arg))
+ && ! TYPE_HAS_TRIVIAL_INIT_REF (TREE_TYPE (arg)))
+ cp_warning ("cannot pass objects of type `%T' through `...'",
+ TREE_TYPE (arg));
+ else
+ /* Convert `short' and `char' to full-size `int'. */
+ arg = default_conversion (arg);
+
+ return arg;
+}
+
+/* ARG is a default argument expression being passed to a parameter of
+ the indicated TYPE. Do any required conversions. Return the
+ converted value. */
+
+tree
convert_default_arg (type, arg)
tree type, arg;
{
@@ -3186,6 +3306,7 @@ build_over_call (cand, args, flags)
{
tree parmtype = TREE_VALUE (parm);
tree argtype = TREE_TYPE (TREE_VALUE (arg));
+ tree t;
if (ICS_BAD_FLAG (TREE_VEC_ELT (convs, i)))
{
int dv = (TYPE_VOLATILE (TREE_TYPE (parmtype))
@@ -3195,12 +3316,21 @@ build_over_call (cand, args, flags)
char *p = (dv && dc ? "const and volatile"
: dc ? "const" : dv ? "volatile" : "");
- cp_pedwarn ("passing `%T' as `this' argument of `%#D' discards %s",
- TREE_TYPE (argtype), fn, p);
+ cp_error ("passing `%T' as `this' argument of `%#D' discards %s",
+ TREE_TYPE (argtype), fn, p);
}
- converted_args = expr_tree_cons
- (NULL_TREE, convert_force (TREE_VALUE (parm), TREE_VALUE (arg), CONV_C_CAST),
- converted_args);
+ /* [class.mfct.nonstatic]: If a nonstatic member function of a class
+ X is called for an object that is not of type X, or of a type
+ derived from X, the behavior is undefined.
+
+ So we can assume that anything passed as 'this' is non-null, and
+ optimize accordingly. */
+ if (TREE_CODE (parmtype) == POINTER_TYPE)
+ t = convert_pointer_to_real (TREE_TYPE (parmtype), TREE_VALUE (arg));
+ else
+ /* This happens with signatures. */
+ t = convert_force (parmtype, TREE_VALUE (arg), CONV_C_CAST);
+ converted_args = expr_tree_cons (NULL_TREE, t, converted_args);
parm = TREE_CHAIN (parm);
arg = TREE_CHAIN (arg);
++i;
@@ -3234,7 +3364,14 @@ build_over_call (cand, args, flags)
"argument passing", fn, i - is_method);
}
else
- val = convert_like (conv, TREE_VALUE (arg));
+ {
+ /* Issue warnings about peculiar, but legal, uses of NULL. */
+ if (ARITHMETIC_TYPE_P (TREE_VALUE (parm))
+ && TREE_VALUE (arg) == null_node)
+ cp_warning ("converting NULL to non-pointer type");
+
+ val = convert_like (conv, TREE_VALUE (arg));
+ }
#ifdef PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE
@@ -3263,13 +3400,13 @@ build_over_call (cand, args, flags)
we must be careful to do name lookup in the scope of
S<T>, rather than in the current class. */
- if (DECL_REAL_CONTEXT (fn))
+ if (DECL_CLASS_SCOPE_P (fn))
pushclass (DECL_REAL_CONTEXT (fn), 2);
arg = tsubst_expr (arg, DECL_TI_ARGS (fn), NULL_TREE);
- if (DECL_REAL_CONTEXT (fn))
- popclass (0);
+ if (DECL_CLASS_SCOPE_P (fn))
+ popclass (1);
}
converted_args = expr_tree_cons
(NULL_TREE, convert_default_arg (TREE_VALUE (parm), arg),
@@ -3278,31 +3415,20 @@ build_over_call (cand, args, flags)
/* Ellipsis */
for (; arg; arg = TREE_CHAIN (arg))
- {
- val = TREE_VALUE (arg);
-
- if (TREE_CODE (TREE_TYPE (val)) == REAL_TYPE
- && (TYPE_PRECISION (TREE_TYPE (val))
- < TYPE_PRECISION (double_type_node)))
- /* Convert `float' to `double'. */
- val = cp_convert (double_type_node, val);
- else if (IS_AGGR_TYPE (TREE_TYPE (val))
- && ! TYPE_HAS_TRIVIAL_INIT_REF (TREE_TYPE (val)))
- cp_warning ("cannot pass objects of type `%T' through `...'",
- TREE_TYPE (val));
- else
- /* Convert `short' and `char' to full-size `int'. */
- val = default_conversion (val);
-
- converted_args = expr_tree_cons (NULL_TREE, val, converted_args);
- }
+ converted_args
+ = expr_tree_cons (NULL_TREE,
+ convert_arg_to_ellipsis (TREE_VALUE (arg)),
+ converted_args);
converted_args = nreverse (converted_args);
/* Avoid actually calling copy constructors and copy assignment operators,
if possible. */
- if (DECL_CONSTRUCTOR_P (fn)
- && TREE_VEC_LENGTH (convs) == 1
+
+ if (! flag_elide_constructors)
+ /* Do things the hard way. */;
+ else if (DECL_CONSTRUCTOR_P (fn)
+ && TREE_VEC_LENGTH (convs) == 1
&& copy_args_p (fn))
{
tree targ;
@@ -3364,8 +3490,10 @@ build_over_call (cand, args, flags)
/* Don't copy the padding byte; it might not have been allocated
if to is a base subobject. */
if (is_empty_class (DECL_CLASS_CONTEXT (fn)))
- return build (COMPOUND_EXPR, TREE_TYPE (to),
- cp_convert (void_type_node, arg), to);
+ return build_unary_op
+ (ADDR_EXPR, build (COMPOUND_EXPR, TREE_TYPE (to),
+ cp_convert (void_type_node, arg), to),
+ 0);
val = build (INIT_EXPR, DECL_CONTEXT (fn), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
@@ -3394,7 +3522,7 @@ build_over_call (cand, args, flags)
mark_used (fn);
- if (DECL_CONTEXT (fn) && IS_SIGNATURE (DECL_CONTEXT (fn)))
+ if (DECL_CLASS_SCOPE_P (fn) && IS_SIGNATURE (DECL_CONTEXT (fn)))
return build_signature_method_call (fn, converted_args);
else if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0)
{
@@ -3535,7 +3663,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
return error_mark_node;
if (fns)
{
- tree t = TREE_VALUE (fns);
+ tree fn = TREE_VALUE (fns);
if (name == ctor_identifier && TYPE_USES_VIRTUAL_BASECLASSES (basetype)
&& ! (flags & LOOKUP_HAS_IN_CHARGE))
{
@@ -3543,8 +3671,9 @@ build_new_method_call (instance, name, args, basetype_path, flags)
args = scratch_tree_cons (NULL_TREE, integer_one_node, args);
}
mem_args = scratch_tree_cons (NULL_TREE, instance_ptr, args);
- for (; t; t = DECL_CHAIN (t))
+ for (; fn; fn = OVL_NEXT (fn))
{
+ tree t = OVL_CURRENT (fn);
tree this_arglist;
/* We can end up here for copy-init of same or base class. */
@@ -3564,7 +3693,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
candidates =
add_template_candidate (candidates, t, explicit_targs,
this_arglist,
- TREE_TYPE (name), flags);
+ TREE_TYPE (name), flags, DEDUCE_CALL);
}
else if (! template_only)
candidates = add_function_candidate (candidates, t,
@@ -3580,8 +3709,12 @@ build_new_method_call (instance, name, args, basetype_path, flags)
/* XXX will LOOKUP_SPECULATIVELY be needed when this is done? */
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
- cp_error ("no matching function for call to `%T::%D (%A)%V'", basetype,
- pretty_name, user_args, TREE_TYPE (TREE_TYPE (instance_ptr)));
+ if (TYPE_SIZE (basetype) == 0)
+ incomplete_type_error (instance_ptr, basetype);
+ else
+ cp_error ("no matching function for call to `%T::%D (%A)%V'",
+ basetype, pretty_name, user_args,
+ TREE_TYPE (TREE_TYPE (instance_ptr)));
print_z_candidates (candidates);
return error_mark_node;
}
@@ -3625,119 +3758,200 @@ build_new_method_call (instance, name, args, basetype_path, flags)
flags);
}
-/* Compare two implicit conversion sequences that differ only in their
- qualification conversion. Subroutine of compare_ics. */
+/* Returns non-zero iff standard conversion sequence ICS1 is a proper
+ subsequence of ICS2. */
static int
-compare_qual (ics1, ics2)
+is_subseq (ics1, ics2)
tree ics1, ics2;
{
- tree to1 = TREE_TYPE (ics1);
- tree to2 = TREE_TYPE (ics2);
-
- if (TYPE_PTRMEMFUNC_P (to1))
- to1 = TYPE_PTRMEMFUNC_FN_TYPE (to1);
- if (TYPE_PTRMEMFUNC_P (to2))
- to2 = TYPE_PTRMEMFUNC_FN_TYPE (to2);
+ /* We can assume that a conversion of the same code
+ between the same types indicates a subsequence since we only get
+ here if the types we are converting from are the same. */
- to1 = TREE_TYPE (to1);
- to2 = TREE_TYPE (to2);
+ while (TREE_CODE (ics1) == RVALUE_CONV
+ || TREE_CODE (ics1) == LVALUE_CONV)
+ ics1 = TREE_OPERAND (ics1, 0);
- if (TREE_CODE (to1) == OFFSET_TYPE)
+ while (1)
{
- to1 = TREE_TYPE (to1);
- to2 = TREE_TYPE (to2);
- }
-
- if (TYPE_READONLY (to1) >= TYPE_READONLY (to2)
- && TYPE_VOLATILE (to1) > TYPE_VOLATILE (to2))
- return -1;
- else if (TYPE_READONLY (to1) > TYPE_READONLY (to2)
- && TYPE_VOLATILE (to1) == TYPE_VOLATILE (to2))
- return -1;
- else if (TYPE_READONLY (to1) <= TYPE_READONLY (to2)
- && TYPE_VOLATILE (to1) < TYPE_VOLATILE (to2))
- return 1;
- else if (TYPE_READONLY (to1) < TYPE_READONLY (to2)
- && TYPE_VOLATILE (to1) == TYPE_VOLATILE (to2))
- return 1;
- return 0;
-}
+ while (TREE_CODE (ics2) == RVALUE_CONV
+ || TREE_CODE (ics2) == LVALUE_CONV)
+ ics2 = TREE_OPERAND (ics2, 0);
-/* Determine whether standard conversion sequence ICS1 is a proper
- subsequence of ICS2. We assume that a conversion of the same code
- between the same types indicates a subsequence. */
+ if (TREE_CODE (ics2) == USER_CONV
+ || TREE_CODE (ics2) == AMBIG_CONV
+ || TREE_CODE (ics2) == IDENTITY_CONV)
+ /* At this point, ICS1 cannot be a proper subsequence of
+ ICS2. We can get a USER_CONV when we are comparing the
+ second standard conversion sequence of two user conversion
+ sequences. */
+ return 0;
-static int
-is_subseq (ics1, ics2)
- tree ics1, ics2;
-{
- /* Do not consider lvalue transformations here. */
- if (TREE_CODE (ics2) == RVALUE_CONV
- || TREE_CODE (ics2) == LVALUE_CONV)
- return 0;
+ ics2 = TREE_OPERAND (ics2, 0);
- for (;; ics2 = TREE_OPERAND (ics2, 0))
- {
if (TREE_CODE (ics2) == TREE_CODE (ics1)
&& comptypes (TREE_TYPE (ics2), TREE_TYPE (ics1), 1)
&& comptypes (TREE_TYPE (TREE_OPERAND (ics2, 0)),
TREE_TYPE (TREE_OPERAND (ics1, 0)), 1))
return 1;
-
- if (TREE_CODE (ics2) == USER_CONV
- || TREE_CODE (ics2) == AMBIG_CONV
- || TREE_CODE (ics2) == IDENTITY_CONV)
- return 0;
}
}
-/* Compare two implicit conversion sequences according to the rules set out in
- [over.ics.rank]. Return values:
-
- 1: ics1 is better than ics2
- -1: ics2 is better than ics1
- 0: ics1 and ics2 are indistinguishable */
+/* Returns non-zero iff DERIVED is derived from BASE. The inputs may
+ be any _TYPE nodes. */
static int
-compare_ics (ics1, ics2)
- tree ics1, ics2;
+is_properly_derived_from (derived, base)
+ tree derived;
+ tree base;
{
- tree main1, main2;
+ if (!IS_AGGR_TYPE_CODE (TREE_CODE (derived))
+ || !IS_AGGR_TYPE_CODE (TREE_CODE (base)))
+ return 0;
- if (TREE_CODE (ics1) == QUAL_CONV)
- main1 = TREE_OPERAND (ics1, 0);
- else
- main1 = ics1;
+ /* We only allow proper derivation here. The DERIVED_FROM_P macro
+ considers every class derived from itself. */
+ return (!comptypes (TYPE_MAIN_VARIANT (derived),
+ TYPE_MAIN_VARIANT (base), 1)
+ && DERIVED_FROM_P (base, derived));
+}
- if (TREE_CODE (ics2) == QUAL_CONV)
- main2 = TREE_OPERAND (ics2, 0);
- else
- main2 = ics2;
+/* We build the ICS for an implicit object parameter as a pointer
+ conversion sequence. However, such a sequence should be compared
+ as if it were a reference conversion sequence. If ICS is the
+ implicit conversion sequence for an implicit object parameter,
+ modify it accordingly. */
- /* Conversions for `this' are PTR_CONVs, but we compare them as though
- they were REF_BINDs. */
- if (ICS_THIS_FLAG (ics1))
+static void
+maybe_handle_implicit_object (ics)
+ tree* ics;
+{
+ if (ICS_THIS_FLAG (*ics))
{
- tree t = main1;
+ /* [over.match.funcs]
+
+ For non-static member functions, the type of the
+ implicit object parameter is "reference to cv X"
+ where X is the class of which the function is a
+ member and cv is the cv-qualification on the member
+ function declaration. */
+ tree t = *ics;
+ if (TREE_CODE (t) == QUAL_CONV)
+ t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == PTR_CONV)
t = TREE_OPERAND (t, 0);
t = build1 (IDENTITY_CONV, TREE_TYPE (TREE_TYPE (t)), NULL_TREE);
- t = build_conv (REF_BIND, TREE_TYPE (ics1), t);
- ICS_STD_RANK (t) = ICS_STD_RANK (main1);
- main1 = ics1 = t;
+ t = build_conv (REF_BIND,
+ build_reference_type (TREE_TYPE (TREE_TYPE (*ics))),
+ t);
+ ICS_STD_RANK (t) = ICS_STD_RANK (*ics);
+ *ics = t;
}
- if (ICS_THIS_FLAG (ics2))
+}
+
+/* If ICS is a REF_BIND, modify it appropriately, set TARGET_TYPE
+ to the type the reference originally referred to, and return 1.
+ Otherwise, return 0. */
+
+static int
+maybe_handle_ref_bind (ics, target_type)
+ tree* ics;
+ tree* target_type;
+{
+ if (TREE_CODE (*ics) == REF_BIND)
{
- tree t = main2;
- if (TREE_CODE (t) == PTR_CONV)
- t = TREE_OPERAND (t, 0);
- t = build1 (IDENTITY_CONV, TREE_TYPE (TREE_TYPE (t)), NULL_TREE);
- t = build_conv (REF_BIND, TREE_TYPE (ics2), t);
- ICS_STD_RANK (t) = ICS_STD_RANK (main2);
- main2 = ics2 = t;
+ /* [over.ics.rank]
+
+ When a parameter of reference type binds directly
+ (_dcl.init.ref_) to an argument expression, the implicit
+ conversion sequence is the identity conversion, unless the
+ argument expression has a type that is a derived class of the
+ parameter type, in which case the implicit conversion
+ sequence is a derived-to-base Conversion.
+
+ If the parameter binds directly to the result of applying a
+ conversion function to the argument expression, the implicit
+ conversion sequence is a user-defined conversion sequence
+ (_over.ics.user_), with the second standard conversion
+ sequence either an identity conversion or, if the conversion
+ function returns an entity of a type that is a derived class
+ of the parameter type, a derived-to-base Conversion.
+
+ When a parameter of reference type is not bound directly to
+ an argument expression, the conversion sequence is the one
+ required to convert the argument expression to the underlying
+ type of the reference according to _over.best.ics_.
+ Conceptually, this conversion sequence corresponds to
+ copy-initializing a temporary of the underlying type with the
+ argument expression. Any difference in top-level
+ cv-qualification is subsumed by the initialization itself and
+ does not constitute a conversion. */
+
+ tree old_ics = *ics;
+
+ *target_type = TREE_TYPE (TREE_TYPE (*ics));
+ *ics = TREE_OPERAND (*ics, 0);
+ if (TREE_CODE (*ics) == IDENTITY_CONV
+ && is_properly_derived_from (TREE_TYPE (*ics), *target_type))
+ *ics = build_conv (BASE_CONV, *target_type, *ics);
+ ICS_USER_FLAG (*ics) = ICS_USER_FLAG (old_ics);
+ ICS_BAD_FLAG (*ics) = ICS_BAD_FLAG (old_ics);
+
+ return 1;
}
+
+ return 0;
+}
+
+/* Compare two implicit conversion sequences according to the rules set out in
+ [over.ics.rank]. Return values:
+
+ 1: ics1 is better than ics2
+ -1: ics2 is better than ics1
+ 0: ics1 and ics2 are indistinguishable */
+static int
+compare_ics (ics1, ics2)
+ tree ics1, ics2;
+{
+ tree from_type1;
+ tree from_type2;
+ tree to_type1;
+ tree to_type2;
+ tree deref_from_type1 = NULL_TREE;
+ tree deref_from_type2 = NULL_TREE;
+ tree deref_to_type1 = NULL_TREE;
+ tree deref_to_type2 = NULL_TREE;
+
+ /* REF_BINDING is non-zero if the result of the conversion sequence
+ is a reference type. In that case TARGET_TYPE is the
+ type referred to by the reference. */
+ int ref_binding1;
+ int ref_binding2;
+ tree target_type1;
+ tree target_type2;
+
+ /* Handle implicit object parameters. */
+ maybe_handle_implicit_object (&ics1);
+ maybe_handle_implicit_object (&ics2);
+
+ /* Handle reference parameters. */
+ ref_binding1 = maybe_handle_ref_bind (&ics1, &target_type1);
+ ref_binding2 = maybe_handle_ref_bind (&ics2, &target_type2);
+
+ /* [over.ics.rank]
+
+ When comparing the basic forms of implicit conversion sequences (as
+ defined in _over.best.ics_)
+
+ --a standard conversion sequence (_over.ics.scs_) is a better
+ conversion sequence than a user-defined conversion sequence
+ or an ellipsis conversion sequence, and
+
+ --a user-defined conversion sequence (_over.ics.user_) is a
+ better conversion sequence than an ellipsis conversion sequence
+ (_over.ics.ellipsis_). */
if (ICS_RANK (ics1) > ICS_RANK (ics2))
return -1;
else if (ICS_RANK (ics1) < ICS_RANK (ics2))
@@ -3745,6 +3959,8 @@ compare_ics (ics1, ics2)
if (ICS_RANK (ics1) == BAD_RANK)
{
+ /* Both ICS are bad. We try to make a decision based on what
+ would have happenned if they'd been good. */
if (ICS_USER_FLAG (ics1) > ICS_USER_FLAG (ics2)
|| ICS_STD_RANK (ics1) > ICS_STD_RANK (ics2))
return -1;
@@ -3752,9 +3968,13 @@ compare_ics (ics1, ics2)
|| ICS_STD_RANK (ics1) < ICS_STD_RANK (ics2))
return 1;
- /* else fall through */
+ /* We couldn't make up our minds; try to figure it out below. */
}
+ if (ICS_ELLIPSIS_FLAG (ics1))
+ /* Both conversions are ellipsis conversions. */
+ return 0;
+
/* User-defined conversion sequence U1 is a better conversion sequence
than another user-defined conversion sequence U2 if they contain the
same user-defined conversion operator or constructor and if the sec-
@@ -3774,175 +3994,249 @@ compare_ics (ics1, ics2)
if (USER_CONV_FN (t1) != USER_CONV_FN (t2))
return 0;
- else if (ICS_STD_RANK (ics1) > ICS_STD_RANK (ics2))
- return -1;
- else if (ICS_STD_RANK (ics1) < ICS_STD_RANK (ics2))
- return 1;
- /* else fall through */
+ /* We can just fall through here, after setting up
+ FROM_TYPE1 and FROM_TYPE2. */
+ from_type1 = TREE_TYPE (t1);
+ from_type2 = TREE_TYPE (t2);
}
+ else
+ {
+ /* We're dealing with two standard conversion sequences.
-#if 0 /* Handled by ranking */
- /* A conversion that is not a conversion of a pointer, or pointer to
- member, to bool is better than another conversion that is such a
- conversion. */
-#endif
+ [over.ics.rank]
+
+ Standard conversion sequence S1 is a better conversion
+ sequence than standard conversion sequence S2 if
+
+ --S1 is a proper subsequence of S2 (comparing the conversion
+ sequences in the canonical form defined by _over.ics.scs_,
+ excluding any Lvalue Transformation; the identity
+ conversion sequence is considered to be a subsequence of
+ any non-identity conversion sequence */
+
+ from_type1 = ics1;
+ while (TREE_CODE (from_type1) != IDENTITY_CONV)
+ from_type1 = TREE_OPERAND (from_type1, 0);
+ from_type1 = TREE_TYPE (from_type1);
+
+ from_type2 = ics2;
+ while (TREE_CODE (from_type2) != IDENTITY_CONV)
+ from_type2 = TREE_OPERAND (from_type2, 0);
+ from_type2 = TREE_TYPE (from_type2);
+ }
- if (TREE_CODE (main1) != TREE_CODE (main2))
+ if (comptypes (from_type1, from_type2, 1))
{
- /* ...if S1 is a proper subsequence of S2 */
- if (is_subseq (main1, main2))
+ if (is_subseq (ics1, ics2))
return 1;
- if (is_subseq (main2, main1))
+ if (is_subseq (ics2, ics1))
return -1;
- return 0;
}
+ /* Otherwise, one sequence cannot be a subsequence of the other; they
+ don't start with the same type. This can happen when comparing the
+ second standard conversion sequence in two user-defined conversion
+ sequences. */
- if (TREE_CODE (main1) == PTR_CONV || TREE_CODE (main1) == PMEM_CONV
- || TREE_CODE (main1) == REF_BIND || TREE_CODE (main1) == BASE_CONV)
- {
- tree to1 = TREE_TYPE (main1);
- tree from1 = TREE_TYPE (TREE_OPERAND (main1, 0));
- tree to2 = TREE_TYPE (main2);
- tree from2 = TREE_TYPE (TREE_OPERAND (main2, 0));
- int distf, distt;
-
- /* Standard conversion sequence S1 is a better conversion sequence than
- standard conversion sequence S2 if...
-
- S1 and S2 differ only in their qualification conversion and they
- yield types identical except for cv-qualifiers and S2 adds all the
- qualifiers that S1 adds (and in the same places) and S2 adds yet
- more cv-qualifiers than S1, or the similar case with reference
- binding15). */
- if (TREE_CODE (main1) == REF_BIND)
- {
- if (TYPE_MAIN_VARIANT (TREE_TYPE (to1))
- == TYPE_MAIN_VARIANT (TREE_TYPE (to2)))
- return compare_qual (ics1, ics2);
- }
- else if (TREE_CODE (main1) != BASE_CONV && from1 == from2 && to1 == to2)
- return compare_qual (ics1, ics2);
-
- if (TYPE_PTRMEMFUNC_P (to1))
- {
- to1 = TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (to1)));
- from1 = TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (from1)));
- }
- else if (TREE_CODE (main1) != BASE_CONV)
- {
- to1 = TREE_TYPE (to1);
- if (TREE_CODE (main1) != REF_BIND)
- from1 = TREE_TYPE (from1);
+ /* [over.ics.rank]
- if (TREE_CODE (to1) == OFFSET_TYPE)
- {
- to1 = TYPE_OFFSET_BASETYPE (to1);
- from1 = TYPE_OFFSET_BASETYPE (from1);
- }
- }
+ Or, if not that,
- if (TYPE_PTRMEMFUNC_P (to2))
- {
- to2 = TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (to2)));
- from2 = TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (from2)));
- }
- else if (TREE_CODE (main1) != BASE_CONV)
- {
- to2 = TREE_TYPE (to2);
- if (TREE_CODE (main1) != REF_BIND)
- from2 = TREE_TYPE (from2);
+ --the rank of S1 is better than the rank of S2 (by the rules
+ defined below):
- if (TREE_CODE (to2) == OFFSET_TYPE)
- {
- to2 = TYPE_OFFSET_BASETYPE (to2);
- from2 = TYPE_OFFSET_BASETYPE (from2);
- }
- }
+ Standard conversion sequences are ordered by their ranks: an Exact
+ Match is a better conversion than a Promotion, which is a better
+ conversion than a Conversion.
- if (! (IS_AGGR_TYPE (from1) && IS_AGGR_TYPE (from2)))
- return 0;
+ Two conversion sequences with the same rank are indistinguishable
+ unless one of the following rules applies:
- /* The sense of pmem conversions is reversed from that of the other
- conversions. */
- if (TREE_CODE (main1) == PMEM_CONV)
- {
- tree t = from1; from1 = from2; from2 = t;
- t = to1; to1 = to2; to2 = t;
- }
+ --A conversion that is not a conversion of a pointer, or pointer
+ to member, to bool is better than another conversion that is such
+ a conversion.
- distf = get_base_distance (from1, from2, 0, 0);
- if (distf == -1)
- {
- distf = -get_base_distance (from2, from1, 0, 0);
- if (distf == 1)
- return 0;
- }
+ The ICS_STD_RANK automatically handles the pointer-to-bool rule,
+ so that we do not have to check it explicitly. */
+ if (ICS_STD_RANK (ics1) < ICS_STD_RANK (ics2))
+ return 1;
+ else if (ICS_STD_RANK (ics2) < ICS_STD_RANK (ics1))
+ return -1;
+
+ to_type1 = TREE_TYPE (ics1);
+ to_type2 = TREE_TYPE (ics2);
- /* If class B is derived directly or indirectly from class A,
- conver- sion of B* to A* is better than conversion of B* to
- void*, and conversion of A* to void* is better than
- conversion of B* to void*. */
+ if (TYPE_PTR_P (from_type1)
+ && TYPE_PTR_P (from_type2)
+ && TYPE_PTR_P (to_type1)
+ && TYPE_PTR_P (to_type2))
+ {
+ deref_from_type1 = TREE_TYPE (from_type1);
+ deref_from_type2 = TREE_TYPE (from_type2);
+ deref_to_type1 = TREE_TYPE (to_type1);
+ deref_to_type2 = TREE_TYPE (to_type2);
+ }
+ /* The rules for pointers to members A::* are just like the rules
+ for pointers A*, except opposite: if B is derived from A then
+ A::* converts to B::*, not vice versa. For that reason, we
+ switch the from_ and to_ variables here. */
+ else if (TYPE_PTRMEM_P (from_type1)
+ && TYPE_PTRMEM_P (from_type2)
+ && TYPE_PTRMEM_P (to_type1)
+ && TYPE_PTRMEM_P (to_type2))
+ {
+ deref_to_type1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (from_type1));
+ deref_to_type2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (from_type2));
+ deref_from_type1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (to_type1));
+ deref_from_type2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (to_type2));
+ }
+ else if (TYPE_PTRMEMFUNC_P (from_type1)
+ && TYPE_PTRMEMFUNC_P (from_type2)
+ && TYPE_PTRMEMFUNC_P (to_type1)
+ && TYPE_PTRMEMFUNC_P (to_type2))
+ {
+ deref_to_type1 = TYPE_PTRMEMFUNC_OBJECT_TYPE (from_type1);
+ deref_to_type2 = TYPE_PTRMEMFUNC_OBJECT_TYPE (from_type2);
+ deref_from_type1 = TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type1);
+ deref_from_type2 = TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type2);
+ }
- if (TREE_CODE (to1) == VOID_TYPE && TREE_CODE (to2) == VOID_TYPE)
+ if (deref_from_type1 != NULL_TREE
+ && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type1))
+ && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type2)))
+ {
+ /* This was one of the pointer or pointer-like conversions.
+
+ [over.ics.rank]
+
+ --If class B is derived directly or indirectly from class A,
+ conversion of B* to A* is better than conversion of B* to
+ void*, and conversion of A* to void* is better than
+ conversion of B* to void*. */
+ if (TREE_CODE (deref_to_type1) == VOID_TYPE
+ && TREE_CODE (deref_to_type2) == VOID_TYPE)
{
- if (distf > 0)
- return 1;
- else if (distf < 0)
+ if (is_properly_derived_from (deref_from_type1,
+ deref_from_type2))
return -1;
+ else if (is_properly_derived_from (deref_from_type2,
+ deref_from_type1))
+ return 1;
}
- else if (TREE_CODE (to2) == VOID_TYPE && IS_AGGR_TYPE (to1)
- && get_base_distance (to1, from1, 0, 0) != -1)
- return 1;
- else if (TREE_CODE (to1) == VOID_TYPE && IS_AGGR_TYPE (to2)
- && get_base_distance (to2, from2, 0, 0) != -1)
- return -1;
-
- if (! (IS_AGGR_TYPE (to1) && IS_AGGR_TYPE (to2)))
- return 0;
-
- /* If class B is derived directly or indirectly from class A and class
- C is derived directly or indirectly from B */
-
- distt = get_base_distance (to1, to2, 0, 0);
- if (distt == -1)
+ else if (TREE_CODE (deref_to_type1) == VOID_TYPE
+ || TREE_CODE (deref_to_type2) == VOID_TYPE)
{
- distt = -get_base_distance (to2, to1, 0, 0);
- if (distt == 1)
- return 0;
+ if (comptypes (deref_from_type1, deref_from_type2, 1))
+ {
+ if (TREE_CODE (deref_to_type2) == VOID_TYPE)
+ {
+ if (is_properly_derived_from (deref_from_type1,
+ deref_to_type1))
+ return 1;
+ }
+ /* We know that DEREF_TO_TYPE1 is `void' here. */
+ else if (is_properly_derived_from (deref_from_type1,
+ deref_to_type2))
+ return -1;
+ }
}
-
- /* --conversion of C* to B* is better than conversion of C* to A*, */
- if (distf == 0)
+ else if (IS_AGGR_TYPE_CODE (TREE_CODE (deref_to_type1))
+ && IS_AGGR_TYPE_CODE (TREE_CODE (deref_to_type2)))
{
- if (distt > 0)
- return -1;
- else if (distt < 0)
- return 1;
+ /* [over.ics.rank]
+
+ --If class B is derived directly or indirectly from class A
+ and class C is derived directly or indirectly from B,
+
+ --conversion of C* to B* is better than conversion of C* to
+ A*,
+
+ --conversion of B* to A* is better than conversion of C* to
+ A* */
+ if (comptypes (deref_from_type1, deref_from_type2, 1))
+ {
+ if (is_properly_derived_from (deref_to_type1,
+ deref_to_type2))
+ return 1;
+ else if (is_properly_derived_from (deref_to_type2,
+ deref_to_type1))
+ return -1;
+ }
+ else if (comptypes (deref_to_type1, deref_to_type2, 1))
+ {
+ if (is_properly_derived_from (deref_from_type2,
+ deref_from_type1))
+ return 1;
+ else if (is_properly_derived_from (deref_from_type1,
+ deref_from_type2))
+ return -1;
+ }
}
- /* --conversion of B* to A* is better than conversion of C* to A*, */
- else if (distt == 0)
+ }
+ else if (IS_AGGR_TYPE_CODE (TREE_CODE (from_type1))
+ && comptypes (from_type1, from_type2, 1))
+ {
+ /* [over.ics.rank]
+
+ --binding of an expression of type C to a reference of type
+ B& is better than binding an expression of type C to a
+ reference of type A&
+
+ --conversion of C to B is better than conversion of C to A, */
+ if (is_properly_derived_from (from_type1, to_type1)
+ && is_properly_derived_from (from_type1, to_type2))
{
- if (distf > 0)
+ if (is_properly_derived_from (to_type1, to_type2))
return 1;
- else if (distf < 0)
+ else if (is_properly_derived_from (to_type2, to_type1))
return -1;
}
}
- else if (TREE_CODE (TREE_TYPE (main1)) == POINTER_TYPE
- || TYPE_PTRMEMFUNC_P (TREE_TYPE (main1)))
+ else if (IS_AGGR_TYPE_CODE (TREE_CODE (to_type1))
+ && comptypes (to_type1, to_type2, 1))
{
- if (TREE_TYPE (main1) == TREE_TYPE (main2))
- return compare_qual (ics1, ics2);
-
-#if 0 /* This is now handled by making identity better than anything else. */
- /* existing practice, not WP-endorsed: const char * -> const char *
- is better than char * -> const char *. (jason 6/29/96) */
- if (TREE_TYPE (ics1) == TREE_TYPE (ics2))
- return -compare_qual (main1, main2);
-#endif
+ /* [over.ics.rank]
+
+ --binding of an expression of type B to a reference of type
+ A& is better than binding an expression of type C to a
+ reference of type A&,
+
+ --onversion of B to A is better than conversion of C to A */
+ if (is_properly_derived_from (from_type1, to_type1)
+ && is_properly_derived_from (from_type2, to_type1))
+ {
+ if (is_properly_derived_from (from_type2, from_type1))
+ return 1;
+ else if (is_properly_derived_from (from_type1, from_type2))
+ return -1;
+ }
}
+ /* [over.ics.rank]
+
+ --S1 and S2 differ only in their qualification conversion and yield
+ similar types T1 and T2 (_conv.qual_), respectively, and the cv-
+ qualification signature of type T1 is a proper subset of the cv-
+ qualification signature of type T2 */
+ if (TREE_CODE (ics1) == QUAL_CONV
+ && TREE_CODE (ics2) == QUAL_CONV
+ && comptypes (from_type1, from_type2, 1))
+ return comp_cv_qual_signature (to_type1, to_type2);
+
+ /* [over.ics.rank]
+
+ --S1 and S2 are reference bindings (_dcl.init.ref_), and the
+ types to which the references refer are the same type except for
+ top-level cv-qualifiers, and the type to which the reference
+ initialized by S2 refers is more cv-qualified than the type to
+ which the reference initialized by S1 refers */
+
+ if (ref_binding1 && ref_binding2
+ && comptypes (TYPE_MAIN_VARIANT (to_type1),
+ TYPE_MAIN_VARIANT (to_type2), 1))
+ return comp_cv_qualification (target_type2, target_type1);
+
+ /* Neither conversion sequence is better than the other. */
return 0;
}
@@ -4074,13 +4368,19 @@ joust (cand1, cand2, warn)
}
}
- /* warn about confusing overload resolution */
+ /* warn about confusing overload resolution for user-defined conversions,
+ either between a constructor and a conversion op, or between two
+ conversion ops. */
if (winner && cand1->second_conv
- && ! DECL_CONSTRUCTOR_P (cand1->fn)
- && ! DECL_CONSTRUCTOR_P (cand2->fn))
+ && ((DECL_CONSTRUCTOR_P (cand1->fn)
+ != DECL_CONSTRUCTOR_P (cand2->fn))
+ /* Don't warn if the two conv ops convert to the same type... */
+ || (! DECL_CONSTRUCTOR_P (cand1->fn)
+ && ! comptypes (TREE_TYPE (cand1->second_conv),
+ TREE_TYPE (cand2->second_conv), 1))))
{
int comp = compare_ics (cand1->second_conv, cand2->second_conv);
- if (comp && comp != winner)
+ if (comp != winner)
{
struct z_candidate *w, *l;
if (winner == 1)
@@ -4089,11 +4389,13 @@ joust (cand1, cand2, warn)
w = cand2, l = cand1;
if (warn)
{
+ tree source = source_type (TREE_VEC_ELT (w->convs, 0));
+ if (! DECL_CONSTRUCTOR_P (w->fn))
+ source = TREE_TYPE (source);
cp_warning ("choosing `%D' over `%D'", w->fn, l->fn);
cp_warning (" for conversion from `%T' to `%T'",
- TREE_TYPE (source_type (TREE_VEC_ELT (w->convs, 0))),
- TREE_TYPE (w->second_conv));
- cp_warning (" because conversion sequence for `this' argument is better");
+ source, TREE_TYPE (w->second_conv));
+ cp_warning (" because conversion sequence for the argument is better");
}
else
add_warning (w, l);
@@ -4193,6 +4495,7 @@ tourney (candidates)
{
struct z_candidate *champ = candidates, *challenger;
int fate;
+ int champ_compared_to_predecessor = 0;
/* Walk through the list once, comparing each current champ to the next
candidate, knocking out a candidate or two with each comparison. */
@@ -4209,19 +4512,24 @@ tourney (candidates)
champ = challenger->next;
if (champ == 0)
return 0;
+ champ_compared_to_predecessor = 0;
}
else
- champ = challenger;
+ {
+ champ = challenger;
+ champ_compared_to_predecessor = 1;
+ }
challenger = champ->next;
}
}
/* Make sure the champ is better than all the candidates it hasn't yet
- been compared to. This may do one more comparison than necessary. Oh
- well. */
+ been compared to. */
- for (challenger = candidates; challenger != champ;
+ for (challenger = candidates;
+ challenger != champ
+ && !(champ_compared_to_predecessor && challenger->next == champ);
challenger = challenger->next)
{
fate = joust (champ, challenger, 0);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 5f054f0d1c1..cd16b59c97e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -43,45 +43,43 @@ extern struct obstack permanent_obstack;
extern void set_class_shadows PROTO ((tree));
-/* Way of stacking class types. */
-static tree *current_class_base, *current_class_stack;
-static int current_class_stacksize;
+/* The number of nested classes being processed. If we are not in the
+ scope of any class, this is zero. */
+
int current_class_depth;
-struct class_level
-{
- /* The previous class level. */
- struct class_level *level_chain;
-
- /* The class instance variable, as a PARM_DECL. */
- tree decl;
- /* The class instance variable, as an object. */
- tree object;
- /* The virtual function table pointer
- for the class instance variable. */
- tree vtable_decl;
-
- /* Name of the current class. */
+/* In order to deal with nested classes, we keep a stack of classes.
+ The topmost entry is the innermost class, and is the entry at index
+ CURRENT_CLASS_DEPTH */
+
+typedef struct class_stack_node {
+ /* The name of the class. */
tree name;
- /* Type of the current class. */
+
+ /* The _TYPE node for the class. */
tree type;
- /* Flags for this class level. */
- int this_is_variable;
- int memoized_lookups;
- int save_memoized;
- int unused;
-};
+ /* The access specifier pending for new declarations in the scope of
+ this class. */
+ tree access;
+}* class_stack_node_t;
+
+/* The stack itself. This is an dynamically resized array. The
+ number of elements allocated is CURRENT_CLASS_STACK_SIZE. */
+static int current_class_stack_size;
+static class_stack_node_t current_class_stack;
-/* The current_class_ptr is the pointer to the current class.
- current_class_ref is the actual current class. */
+/* When we're processing a member function, current_class_ptr is the
+ PARM_DECL for the `this' pointer. The current_class_ref is an
+ expression for `*this'. */
tree current_class_ptr, current_class_ref;
/* The following two can be derived from the previous one */
tree current_class_name; /* IDENTIFIER_NODE: name of current class */
tree current_class_type; /* _TYPE: the type of the current class */
+tree current_access_specifier;
tree previous_class_type; /* _TYPE: the previous type that was a class */
-tree previous_class_values; /* TREE_LIST: copy of the class_shadowed list
+tree previous_class_values; /* TREE_LIST: copy of the class_shadowed list
when leaving an outermost class scope. */
struct base_info;
@@ -89,8 +87,6 @@ struct base_info;
static tree get_vfield_name PROTO((tree));
static void finish_struct_anon PROTO((tree));
static tree build_vbase_pointer PROTO((tree, tree));
-static int complete_type_p PROTO((tree));
-static int typecode_p PROTO((tree, enum tree_code));
static tree build_vtable_entry PROTO((tree, tree));
static tree get_vtable_name PROTO((tree));
static tree get_derived_offset PROTO((tree, tree));
@@ -100,7 +96,6 @@ static tree build_vtable PROTO((tree, tree));
static void prepare_fresh_vtable PROTO((tree, tree));
static void fixup_vtable_deltas1 PROTO((tree, tree));
static void fixup_vtable_deltas PROTO((tree, int, tree));
-static void grow_method PROTO((tree, tree *));
static void finish_vtbls PROTO((tree, int, tree));
static void modify_vtable_entry PROTO((tree, tree, tree));
static tree get_vtable_entry_n PROTO((tree, unsigned HOST_WIDE_INT));
@@ -108,7 +103,8 @@ static void add_virtual_function PROTO((tree *, tree *, int *, tree, tree));
static tree delete_duplicate_fields_1 PROTO((tree, tree));
static void delete_duplicate_fields PROTO((tree));
static void finish_struct_bits PROTO((tree, int));
-static int alter_access PROTO((tree, tree, tree));
+static int alter_access PROTO((tree, tree, tree, tree));
+static void handle_using_decl PROTO((tree, tree, tree, tree));
static int overrides PROTO((tree, tree));
static int strictly_overrides PROTO((tree, tree));
static void merge_overrides PROTO((tree, tree, int, tree));
@@ -126,6 +122,12 @@ static void modify_all_indirect_vtables PROTO((tree, int, int, tree,
tree, tree));
static void build_class_init_list PROTO((tree));
static int finish_base_struct PROTO((tree, struct base_info *));
+static void finish_struct_methods PROTO((tree));
+static void maybe_warn_about_overly_private_class PROTO ((tree));
+static void check_member_decl_is_same_in_complete_scope PROTO((tree, tree));
+static tree make_method_vec PROTO((int));
+static void free_method_vec PROTO((tree));
+static tree add_implicitly_declared_members PROTO((tree, int, int, int));
/* Way of stacking language names. */
tree *current_lang_base, *current_lang_stack;
@@ -170,12 +172,12 @@ build_vbase_pointer (exp, type)
tree exp, type;
{
char *name;
+ FORMAT_VBASE_NAME (name, type);
- name = (char *) alloca (TYPE_NAME_LENGTH (type) + sizeof (VBASE_NAME) + 1);
- sprintf (name, VBASE_NAME_FORMAT, TYPE_NAME_STRING (type));
return build_component_ref (exp, get_identifier (name), NULL_TREE, 0);
}
+#if 0
/* Is the type of the EXPR, the complete type of the object?
If we are going to be wrong, we must be conservative, and return 0. */
@@ -221,6 +223,7 @@ complete_type_p (expr)
}
return 0;
}
+#endif
/* Build multi-level access to EXPR using hierarchy path PATH.
CODE is PLUS_EXPR if we are going with the grain,
@@ -229,17 +232,17 @@ complete_type_p (expr)
TYPE is the type we want this path to have on exit.
- ALIAS_THIS is non-zero if EXPR in an expression involving `this'. */
+ NONNULL is non-zero if we know (for any reason) that EXPR is
+ not, in fact, zero. */
tree
-build_vbase_path (code, type, expr, path, alias_this)
+build_vbase_path (code, type, expr, path, nonnull)
enum tree_code code;
tree type, expr, path;
- int alias_this;
+ int nonnull;
{
register int changed = 0;
tree last = NULL_TREE, last_virtual = NULL_TREE;
- int nonnull = 0;
int fixed_type_p;
tree null_expr = 0, nonnull_expr;
tree basetype;
@@ -248,40 +251,23 @@ build_vbase_path (code, type, expr, path, alias_this)
if (BINFO_INHERITANCE_CHAIN (path) == NULL_TREE)
return build1 (NOP_EXPR, type, expr);
- if (nonnull == 0 && (alias_this && flag_this_is_variable <= 0))
- nonnull = 1;
+ /* If -fthis-is-variable, we might have set nonnull incorrectly. We
+ don't care enough to get this right, so just clear it. */
+ if (flag_this_is_variable > 0)
+ nonnull = 0;
-#if 0
- /* We need additional logic to convert back to the unconverted type
- (the static type of the complete object), and then convert back
- to the type we want. Until that is done, or until we can
- recognize when that is, we cannot do the short cut logic. (mrs) */
+ /* We could do better if we had additional logic to convert back to the
+ unconverted type (the static type of the complete object), and then
+ convert back to the type we want. Until that is done, we only optimize
+ if the complete type is the same type as expr has. */
fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
-#else
- /* Do this, until we can undo any previous conversions. See net35.C
- for a testcase. */
- fixed_type_p = complete_type_p (expr);
-#endif
if (!fixed_type_p && TREE_SIDE_EFFECTS (expr))
expr = save_expr (expr);
nonnull_expr = expr;
if (BINFO_INHERITANCE_CHAIN (path))
- {
- tree reverse_path = NULL_TREE;
-
- push_expression_obstack ();
- while (path)
- {
- tree r = copy_node (path);
- BINFO_INHERITANCE_CHAIN (r) = reverse_path;
- reverse_path = r;
- path = BINFO_INHERITANCE_CHAIN (path);
- }
- path = reverse_path;
- pop_obstacks ();
- }
+ path = reverse_path (path);
basetype = BINFO_TYPE (path);
@@ -308,8 +294,7 @@ build_vbase_path (code, type, expr, path, alias_this)
ind = build_indirect_ref (nonnull_expr, NULL_PTR);
nonnull_expr = build_vbase_pointer (ind, last_virtual);
if (nonnull == 0
- && (TREE_CODE (type) == POINTER_TYPE
- || !flag_assume_nonnull_objects)
+ && TREE_CODE (type) == POINTER_TYPE
&& null_expr == NULL_TREE)
{
null_expr = build1 (NOP_EXPR, build_pointer_type (last_virtual), integer_zero_node);
@@ -382,12 +367,7 @@ build_vbase_path (code, type, expr, path, alias_this)
expr = build1 (NOP_EXPR, type, expr);
#endif
- /* For multiple inheritance: if `this' can be set by any
- function, then it could be 0 on entry to any function.
- Preserve such zeroness here. Otherwise, only in the
- case of constructors need we worry, and in those cases,
- it will be zero, or initialized to some valid value to
- which we may add. */
+ /* If expr might be 0, we need to preserve that zeroness. */
if (nonnull == 0)
{
if (null_expr)
@@ -451,15 +431,11 @@ build_vtable_entry (delta, pfn)
build_expr_list (NULL_TREE, pfn)));
tree entry = build (CONSTRUCTOR, vtable_entry_type, NULL_TREE, elems);
- /* DELTA is constructed by `size_int', which means it may be an
- unsigned quantity on some platforms. Therefore, we cannot use
- `int_fits_type_p', because when DELTA is really negative,
- `force_fit_type' will make it look like a very large number. */
+ /* DELTA used to be constructed by `size_int' and/or size_binop,
+ which caused overflow problems when it was negative. That should
+ be fixed now. */
- if ((TREE_INT_CST_LOW (TYPE_MAX_VALUE (delta_type_node))
- < TREE_INT_CST_LOW (delta))
- || (TREE_INT_CST_LOW (delta)
- < TREE_INT_CST_LOW (TYPE_MIN_VALUE (delta_type_node))))
+ if (! int_fits_type_p (delta, delta_type_node))
{
if (flag_huge_objects)
sorry ("object size exceeds built-in limit for virtual function table implementation");
@@ -479,6 +455,36 @@ build_vtable_entry (delta, pfn)
}
}
+/* We want to give the assembler the vtable identifier as well as
+ the offset to the function pointer. So we generate
+
+ __asm__ __volatile__ (".vtable_entry %c0, %c1"
+ : : "s"(&class_vtable),
+ "i"((long)&vtbl[idx].pfn - (long)&vtbl[0])); */
+
+static void
+build_vtable_entry_ref (basetype, vtbl, idx)
+ tree basetype, vtbl, idx;
+{
+ static char asm_stmt[] = ".vtable_entry %c0, %c1";
+ tree s, i, i2;
+
+ s = build_unary_op (ADDR_EXPR, TYPE_BINFO_VTABLE (basetype), 0);
+ s = build_tree_list (build_string (1, "s"), s);
+
+ i = build_array_ref (vtbl, idx);
+ if (!flag_vtable_thunks)
+ i = build_component_ref (i, pfn_identifier, vtable_entry_type, 0);
+ i = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i, 0));
+ i2 = build_array_ref (vtbl, build_int_2(0,0));
+ i2 = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i2, 0));
+ i = build_binary_op (MINUS_EXPR, i, i2, 0);
+ i = build_tree_list (build_string (1, "i"), i);
+
+ expand_asm_operands (build_string (sizeof(asm_stmt)-1, asm_stmt),
+ NULL_TREE, chainon (s, i), NULL_TREE, 1, NULL, 0);
+}
+
/* Given an object INSTANCE, return an expression which yields the
virtual function vtable element corresponding to INDEX. There are
many special cases for INSTANCE which we take care of here, mainly
@@ -495,8 +501,7 @@ build_vtbl_ref (instance, idx)
basetype = TREE_TYPE (basetype);
if (instance == current_class_ref)
- vtbl = build_indirect_ref (build_vfield_ref (instance, basetype),
- NULL_PTR);
+ vtbl = build_vfield_ref (instance, basetype);
else
{
if (optimize)
@@ -536,10 +541,14 @@ build_vtbl_ref (instance, idx)
|| TREE_CODE (instance) == VAR_DECL))
vtbl = TYPE_BINFO_VTABLE (basetype);
else
- vtbl = build_indirect_ref (build_vfield_ref (instance, basetype),
- NULL_PTR);
+ vtbl = build_vfield_ref (instance, basetype);
}
+
assemble_external (vtbl);
+
+ if (flag_vtable_gc)
+ build_vtable_entry_ref (basetype, vtbl, idx);
+
aref = build_array_ref (vtbl, idx);
return aref;
@@ -664,11 +673,11 @@ set_rtti_entry (virtuals, offset, type)
tree voff = build1 (NOP_EXPR, vfunc_ptr_type_node, offset);
TREE_CONSTANT (voff) = 1;
- TREE_VALUE (virtuals) = build_vtable_entry (size_zero_node, voff);
+ TREE_VALUE (virtuals) = build_vtable_entry (integer_zero_node, voff);
/* The second slot is for the tdesc pointer when thunks are used. */
TREE_VALUE (TREE_CHAIN (virtuals))
- = build_vtable_entry (size_zero_node, vfn);
+ = build_vtable_entry (integer_zero_node, vfn);
}
}
@@ -693,7 +702,7 @@ build_vtable (binfo, type)
/* Now do rtti stuff. */
offset = get_derived_offset (TYPE_BINFO (type), NULL_TREE);
- offset = size_binop (MINUS_EXPR, size_zero_node, offset);
+ offset = ssize_binop (MINUS_EXPR, integer_zero_node, offset);
set_rtti_entry (virtuals, offset, type);
}
else
@@ -708,9 +717,10 @@ build_vtable (binfo, type)
#endif
/* Set TREE_PUBLIC and TREE_EXTERN as appropriate. */
- import_export_vtable (decl, type, 0);
+ import_export_vtable (decl, type, at_eof);
- IDENTIFIER_GLOBAL_VALUE (name) = decl = pushdecl_top_level (decl);
+ decl = pushdecl_top_level (decl);
+ SET_IDENTIFIER_GLOBAL_VALUE (name, decl);
/* Initialize the association list for this type, based
on our first approximation. */
TYPE_BINFO_VTABLE (type) = decl;
@@ -727,9 +737,7 @@ build_vtable (binfo, type)
DECL_ALIGN (decl) = MAX (TYPE_ALIGN (double_type_node),
DECL_ALIGN (decl));
- /* Why is this conditional? (mrs) */
- if (binfo && write_virtuals >= 0)
- DECL_VIRTUAL_P (decl) = 1;
+ DECL_VIRTUAL_P (decl) = 1;
DECL_CONTEXT (decl) = type;
binfo = TYPE_BINFO (type);
@@ -884,7 +892,7 @@ prepare_fresh_vtable (binfo, for_type)
offset = BINFO_OFFSET (binfo);
set_rtti_entry (BINFO_VIRTUALS (binfo),
- size_binop (MINUS_EXPR, signed_size_zero_node, offset),
+ ssize_binop (MINUS_EXPR, integer_zero_node, offset),
for_type);
#ifdef GATHER_STATISTICS
@@ -893,7 +901,7 @@ prepare_fresh_vtable (binfo, for_type)
#endif
/* Set TREE_PUBLIC and TREE_EXTERN as appropriate. */
- import_export_vtable (new_decl, for_type, 0);
+ import_export_vtable (new_decl, for_type, at_eof);
if (TREE_VIA_VIRTUAL (binfo))
my_friendly_assert (binfo == binfo_member (BINFO_TYPE (binfo),
@@ -1061,6 +1069,46 @@ add_virtual_function (pv, phv, has_virtual, fndecl, t)
struct obstack class_obstack;
extern struct obstack *current_obstack;
+/* These are method vectors that were too small for the number of
+ methods in some class, and so were abandoned. */
+static tree free_method_vecs;
+
+/* Returns a method vector with enough room for N methods. N should
+ be a power of two. */
+
+static tree
+make_method_vec (n)
+ int n;
+{
+ tree new_vec;
+ tree* t;
+
+ for (t = &free_method_vecs; *t; t = &(TREE_CHAIN (*t)))
+ /* Note that we don't use >= n here because we don't want to
+ allocate a very large vector where it isn't needed. */
+ if (TREE_VEC_LENGTH (*t) == n)
+ {
+ new_vec = *t;
+ *t = TREE_CHAIN (new_vec);
+ TREE_CHAIN (new_vec) = NULL_TREE;
+ bzero (&TREE_VEC_ELT (new_vec, 0), n * sizeof (tree));
+ return new_vec;
+ }
+
+ new_vec = make_tree_vec (n);
+ return new_vec;
+}
+
+/* Free the method vector VEC. */
+
+static void
+free_method_vec (vec)
+ tree vec;
+{
+ TREE_CHAIN (vec) = free_method_vecs;
+ free_method_vecs = vec;
+}
+
/* Add method METHOD to class TYPE. This is used when a method
has been defined which did not initially appear in the class definition,
and helps cut down on spurious error messages.
@@ -1072,131 +1120,129 @@ void
add_method (type, fields, method)
tree type, *fields, method;
{
- /* We must make a copy of METHOD here, since we must be sure that
- we have exclusive title to this method's DECL_CHAIN. */
- tree decl;
-
push_obstacks (&permanent_obstack, &permanent_obstack);
- {
- decl = copy_node (method);
- if (DECL_RTL (decl) == 0
- && (!processing_template_decl
- || !uses_template_parms (decl)))
- {
- make_function_rtl (decl);
- DECL_RTL (method) = DECL_RTL (decl);
- }
- }
+ /* Setting the DECL_CONTEXT and DECL_CLASS_CONTEXT here is probably
+ redundant. */
+ DECL_CONTEXT (method) = type;
+ DECL_CLASS_CONTEXT (method) = type;
+
if (fields && *fields)
- {
- /* Take care not to hide destructor. */
- DECL_CHAIN (decl) = DECL_CHAIN (*fields);
- DECL_CHAIN (*fields) = decl;
- }
- else if (CLASSTYPE_METHOD_VEC (type) == 0)
- {
- tree method_vec = make_node (TREE_VEC);
- if (TYPE_IDENTIFIER (type) == DECL_NAME (decl))
+ *fields = build_overload (method, *fields);
+ else
+ {
+ int len;
+ tree method_vec;
+
+ if (!CLASSTYPE_METHOD_VEC (type))
+ /* Make a new method vector. We start with 8 entries. We must
+ allocate at least two (for constructors and destructors), and
+ we're going to end up with an assignment operator at some
+ point as well.
+
+ We could use a TREE_LIST for now, and convert it to a
+ TREE_VEC in finish_struct, but we would probably waste more
+ memory making the links in the list than we would by
+ over-allocating the size of the vector here. Furthermore,
+ we would complicate all the code that expects this to be a
+ vector. We keep a free list of vectors that we outgrew so
+ that we don't really waste any memory. */
+ CLASSTYPE_METHOD_VEC (type) = make_method_vec (8);
+
+ method_vec = CLASSTYPE_METHOD_VEC (type);
+ len = TREE_VEC_LENGTH (method_vec);
+
+ if (DECL_NAME (method) == constructor_name (type))
{
- /* ??? Is it possible for there to have been enough room in the
- current chunk for the tree_vec structure but not a tree_vec
- plus a tree*? Will this work in that case? */
- obstack_free (current_obstack, method_vec);
- obstack_blank (current_obstack, sizeof (struct tree_vec) + sizeof (tree *));
- if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl)))
- TREE_VEC_ELT (method_vec, 1) = decl;
- else
- TREE_VEC_ELT (method_vec, 0) = decl;
- TREE_VEC_LENGTH (method_vec) = 2;
- }
- else
- {
- /* ??? Is it possible for there to have been enough room in the
- current chunk for the tree_vec structure but not a tree_vec
- plus a tree*? Will this work in that case? */
- obstack_free (current_obstack, method_vec);
- obstack_blank (current_obstack, sizeof (struct tree_vec) + 2*sizeof (tree *));
- TREE_VEC_ELT (method_vec, 2) = decl;
- TREE_VEC_LENGTH (method_vec) = 3;
- obstack_finish (current_obstack);
- }
- CLASSTYPE_METHOD_VEC (type) = method_vec;
- }
- else
- {
- tree method_vec = CLASSTYPE_METHOD_VEC (type);
- int len = TREE_VEC_LENGTH (method_vec);
+ /* A new constructor or destructor. Constructors go in
+ slot 0; destructors go in slot 1. */
+ int slot
+ = DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (method)) ? 1 : 0;
- /* Adding a new ctor or dtor. This is easy because our
- METHOD_VEC always has a slot for such entries. */
- if (TYPE_IDENTIFIER (type) == DECL_NAME (decl))
- {
- int idx = !!DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (decl));
- /* TREE_VEC_ELT (method_vec, idx) = decl; */
- if (decl != TREE_VEC_ELT (method_vec, idx))
- {
- DECL_CHAIN (decl) = TREE_VEC_ELT (method_vec, idx);
- TREE_VEC_ELT (method_vec, idx) = decl;
- }
+ TREE_VEC_ELT (method_vec, slot)
+ = build_overload (method, TREE_VEC_ELT (method_vec, slot));
}
else
{
- /* This is trickier. We try to extend the TREE_VEC in-place,
- but if that does not work, we copy all its data to a new
- TREE_VEC that's large enough. */
- struct obstack *ob = &class_obstack;
- tree *end = (tree *)obstack_next_free (ob);
+ int i;
- if (end != TREE_VEC_END (method_vec))
+ /* See if we already have an entry with this name. */
+ for (i = 2; i < len; ++i)
+ if (!TREE_VEC_ELT (method_vec, i)
+ || (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
+ == DECL_NAME (method)))
+ break;
+
+ if (i == len)
{
- ob = current_obstack;
- TREE_VEC_LENGTH (method_vec) += 1;
- TREE_VEC_ELT (method_vec, len) = NULL_TREE;
- method_vec = copy_node (method_vec);
- TREE_VEC_LENGTH (method_vec) -= 1;
+ /* We need a bigger method vector. */
+ tree new_vec = make_method_vec (2 * len);
+ bcopy (&TREE_VEC_ELT (method_vec, 0),
+ &TREE_VEC_ELT (new_vec, 0),
+ len * sizeof (tree));
+ free_method_vec (method_vec);
+ len = 2 * len;
+ method_vec = CLASSTYPE_METHOD_VEC (type) = new_vec;
}
- else
+
+ if (IDENTIFIER_TYPENAME_P (DECL_NAME (method)))
{
- tree tmp_vec = (tree) obstack_base (ob);
- if (obstack_room (ob) < sizeof (tree))
+ /* Type conversion operators have to come before
+ ordinary methods; add_conversions depends on this to
+ speed up looking for conversion operators. So, if
+ necessary, we slide some of the vector elements up.
+ In theory, this makes this algorithm O(N^2) but we
+ don't expect many conversion operators. */
+ for (i = 2; i < len; ++i)
{
- obstack_blank (ob, sizeof (struct tree_common)
- + tree_code_length[(int) TREE_VEC]
- * sizeof (char *)
- + len * sizeof (tree));
- tmp_vec = (tree) obstack_base (ob);
- bcopy ((char *) method_vec, (char *) tmp_vec,
- (sizeof (struct tree_common)
- + tree_code_length[(int) TREE_VEC] * sizeof (char *)
- + (len-1) * sizeof (tree)));
- method_vec = tmp_vec;
+ tree fn = TREE_VEC_ELT (method_vec, i);
+ tree name;
+
+ if (!fn)
+ /* There are no more entries in the vector, so we
+ can insert the new conversion operator here. */
+ break;
+
+ name = DECL_NAME (OVL_CURRENT (fn));
+ if (!IDENTIFIER_TYPENAME_P (name))
+ /* We can insert the new function right at the Ith
+ position. */
+ break;
}
+
+ if (!TREE_VEC_ELT (method_vec, i))
+ /* There is nothing in the Ith slot, so we can avoid
+ moving anything. */
+ ;
else
- obstack_blank (ob, sizeof (tree));
+ {
+ /* We know the last slot in the vector is empty
+ because we know that at this point there's room for
+ a new function. */
+ bcopy (&TREE_VEC_ELT (method_vec, i),
+ &TREE_VEC_ELT (method_vec, i + 1),
+ (len - i - 1) * sizeof (tree));
+ TREE_VEC_ELT (method_vec, i) = NULL_TREE;
+ }
}
- obstack_finish (ob);
- TREE_VEC_ELT (method_vec, len) = decl;
- TREE_VEC_LENGTH (method_vec) = len + 1;
- CLASSTYPE_METHOD_VEC (type) = method_vec;
-
- if (TYPE_BINFO_BASETYPES (type) && CLASSTYPE_BASELINK_VEC (type))
- {
- /* ??? May be better to know whether these can be extended? */
- tree baselink_vec = CLASSTYPE_BASELINK_VEC (type);
-
- TREE_VEC_LENGTH (baselink_vec) += 1;
- CLASSTYPE_BASELINK_VEC (type) = copy_node (baselink_vec);
- TREE_VEC_LENGTH (baselink_vec) -= 1;
-
- TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), len) = 0;
- }
+ /* Actually insert the new method. */
+ TREE_VEC_ELT (method_vec, i)
+ = build_overload (method, TREE_VEC_ELT (method_vec, i));
+ }
+
+ if (TYPE_BINFO_BASETYPES (type) && CLASSTYPE_BASELINK_VEC (type))
+ {
+ /* ??? May be better to know whether these can be extended? */
+ tree baselink_vec = CLASSTYPE_BASELINK_VEC (type);
+
+ TREE_VEC_LENGTH (baselink_vec) += 1;
+ CLASSTYPE_BASELINK_VEC (type) = copy_node (baselink_vec);
+ TREE_VEC_LENGTH (baselink_vec) -= 1;
+
+ TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), len) = 0;
}
}
- DECL_CONTEXT (decl) = type;
- DECL_CLASS_CONTEXT (decl) = type;
-
pop_obstacks ();
}
@@ -1260,15 +1306,15 @@ delete_duplicate_fields_1 (field, fields)
|| TREE_CODE (x) == CONST_DECL)
cp_error_at ("duplicate field `%D' (as enum and non-enum)",
x);
- else if (TREE_CODE (field) == TYPE_DECL
- && TREE_CODE (x) == TYPE_DECL)
+ else if (DECL_DECLARES_TYPE_P (field)
+ && DECL_DECLARES_TYPE_P (x))
{
- if (TREE_TYPE (field) == TREE_TYPE (x))
+ if (comptypes (TREE_TYPE (field), TREE_TYPE (x), 1))
continue;
cp_error_at ("duplicate nested type `%D'", x);
}
- else if (TREE_CODE (field) == TYPE_DECL
- || TREE_CODE (x) == TYPE_DECL)
+ else if (DECL_DECLARES_TYPE_P (field)
+ || DECL_DECLARES_TYPE_P (x))
{
/* Hide tag decls. */
if ((TREE_CODE (field) == TYPE_DECL
@@ -1301,12 +1347,14 @@ delete_duplicate_fields (fields)
TREE_CHAIN (x) = delete_duplicate_fields_1 (x, TREE_CHAIN (x));
}
-/* Change the access of FDECL to ACCESS in T.
- Return 1 if change was legit, otherwise return 0. */
+/* Change the access of FDECL to ACCESS in T. The access to FDECL is
+ along the path given by BINFO. Return 1 if change was legit,
+ otherwise return 0. */
static int
-alter_access (t, fdecl, access)
+alter_access (t, binfo, fdecl, access)
tree t;
+ tree binfo;
tree fdecl;
tree access;
{
@@ -1330,7 +1378,7 @@ alter_access (t, fdecl, access)
}
else
{
- enforce_access (TYPE_BINFO (t), fdecl);
+ enforce_access (binfo, fdecl);
DECL_ACCESS (fdecl) = tree_cons (t, access, DECL_ACCESS (fdecl));
return 1;
@@ -1338,6 +1386,98 @@ alter_access (t, fdecl, access)
return 0;
}
+/* Process the USING_DECL, which is a member of T. The METHOD_VEC, if
+ non-NULL, is the methods of T. The FIELDS are the fields of T.
+ Returns 1 if the USING_DECL was valid, 0 otherwise. */
+
+void
+handle_using_decl (using_decl, t, method_vec, fields)
+ tree using_decl;
+ tree t;
+ tree method_vec;
+ tree fields;
+{
+ tree ctype = DECL_INITIAL (using_decl);
+ tree name = DECL_NAME (using_decl);
+ tree access
+ = TREE_PRIVATE (using_decl) ? access_private_node
+ : TREE_PROTECTED (using_decl) ? access_protected_node
+ : access_public_node;
+ tree fdecl, binfo;
+ tree flist = NULL_TREE;
+ tree tmp;
+ int i;
+ int n_methods;
+
+ binfo = binfo_or_else (ctype, t);
+ if (! binfo)
+ return;
+
+ if (name == constructor_name (ctype)
+ || name == constructor_name_full (ctype))
+ cp_error_at ("using-declaration for constructor", using_decl);
+
+ fdecl = lookup_member (binfo, name, 0, 0);
+
+ if (!fdecl)
+ {
+ cp_error_at ("no members matching `%D' in `%#T'", using_decl, ctype);
+ return;
+ }
+
+ /* Functions are represented as TREE_LIST, with the purpose
+ being the type and the value the functions. Other members
+ come as themselves. */
+ if (TREE_CODE (fdecl) == TREE_LIST)
+ /* Ignore base type this came from. */
+ fdecl = TREE_VALUE (fdecl);
+
+ if (TREE_CODE (fdecl) == OVERLOAD)
+ {
+ /* We later iterate over all functions. */
+ flist = fdecl;
+ fdecl = OVL_FUNCTION (flist);
+ }
+
+ name = DECL_NAME (fdecl);
+ n_methods = method_vec ? TREE_VEC_LENGTH (method_vec) : 0;
+ for (i = 2; i < n_methods && TREE_VEC_ELT (method_vec, i); i++)
+ if (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
+ == name)
+ {
+ cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
+ cp_error_at (" because of local method `%#D' with same name",
+ OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
+ return;
+ }
+
+ if (! DECL_LANG_SPECIFIC (fdecl))
+ /* We don't currently handle DECL_ACCESS for TYPE_DECLs; just return. */
+ return;
+
+ for (tmp = fields; tmp; tmp = TREE_CHAIN (tmp))
+ if (DECL_NAME (tmp) == name)
+ {
+ cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
+ cp_error_at (" because of local field `%#D' with same name", tmp);
+ return;
+ }
+
+ /* Make type T see field decl FDECL with access ACCESS.*/
+ if (flist)
+ {
+ while (flist)
+ {
+ if (alter_access (t, binfo, OVL_FUNCTION (flist),
+ access) == 0)
+ return;
+ flist = OVL_CHAIN (flist);
+ }
+ }
+ else
+ alter_access (t, binfo, fdecl, access);
+}
+
/* If FOR_TYPE needs to reinitialize virtual function table pointers
for TYPE's sub-objects, add such reinitializations to BASE_INIT_LIST.
Returns BASE_INIT_LIST appropriately modified. */
@@ -1695,35 +1835,6 @@ finish_base_struct (t, b)
}
}
- /* This comment said "Must come after offsets are fixed for all bases."
- Well, now this happens before the offsets are fixed, but it seems to
- work fine. Guess we'll see... */
- for (i = 0; i < n_baseclasses; i++)
- {
- tree base_binfo = TREE_VEC_ELT (binfos, i);
- tree basetype = BINFO_TYPE (base_binfo);
-
- if (get_base_distance (basetype, t, 0, (tree*)0) == -2)
- {
- cp_warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
- basetype, t);
- }
- }
- {
- tree v = get_vbase_types (t);
-
- for (; v; v = TREE_CHAIN (v))
- {
- tree basetype = BINFO_TYPE (v);
- if (get_base_distance (basetype, t, 0, (tree*)0) == -2)
- {
- if (extra_warnings)
- cp_warning ("virtual base `%T' inaccessible in `%T' due to ambiguity",
- basetype, t);
- }
- }
- }
-
{
tree vfields;
/* Find the base class with the largest number of virtual functions. */
@@ -1747,16 +1858,6 @@ finish_base_struct (t, b)
return first_vfn_base_index;
}
-
-static int
-typecode_p (type, code)
- tree type;
- enum tree_code code;
-{
- return (TREE_CODE (type) == code
- || (TREE_CODE (type) == REFERENCE_TYPE
- && TREE_CODE (TREE_TYPE (type)) == code));
-}
/* Set memoizing fields and bits of T (and its variants) for later use.
MAX_HAS_VIRTUAL is the largest size of any T's virtual function tables. */
@@ -1787,6 +1888,7 @@ finish_struct_bits (t, max_has_virtual)
TYPE_MAX_VALUE (variants) = TYPE_MAX_VALUE (t);
TYPE_FIELDS (variants) = TYPE_FIELDS (t);
TYPE_SIZE (variants) = TYPE_SIZE (t);
+ TYPE_SIZE_UNIT (variants) = TYPE_SIZE_UNIT (t);
variants = TYPE_NEXT_VARIANT (variants);
}
@@ -1851,44 +1953,151 @@ finish_struct_bits (t, max_has_virtual)
}
}
-/* Add FNDECL to the method_vec growing on the class_obstack. Used by
- finish_struct_methods. Note, FNDECL cannot be a constructor or
- destructor, those cases are handled by the caller. */
+/* Issue warnings about T having private constructors, but no friends,
+ and so forth.
+
+ HAS_NONPRIVATE_METHOD is nonzero if T has any non-private methods or
+ static members. HAS_NONPRIVATE_STATIC_FN is nonzero if T has any
+ non-private static member functions. */
static void
-grow_method (fndecl, method_vec_ptr)
- tree fndecl;
- tree *method_vec_ptr;
+maybe_warn_about_overly_private_class (t)
+ tree t;
{
- tree method_vec = (tree)obstack_base (&class_obstack);
-
- /* Start off past the constructors and destructor. */
- tree *testp = &TREE_VEC_ELT (method_vec, 2);
+ int has_member_fn = 0;
+ int has_nonprivate_method = 0;
+ tree fn;
+
+ if (!warn_ctor_dtor_privacy
+ /* If the class has friends, those entities might create and
+ access instances, so we should not warn. */
+ || (CLASSTYPE_FRIEND_CLASSES (t)
+ || DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))
+ /* We will have warned when the template was declared; there's
+ no need to warn on every instantiation. */
+ || CLASSTYPE_TEMPLATE_INSTANTIATION (t))
+ /* There's no reason to even consider warning about this
+ class. */
+ return;
+
+ /* We only issue one warning, if more than one applies, because
+ otherwise, on code like:
+
+ class A {
+ // Oops - forgot `public:'
+ A();
+ A(const A&);
+ ~A();
+ };
+
+ we warn several times about essentially the same problem. */
+
+ /* Check to see if all (non-constructor, non-destructor) member
+ functions are private. (Since there are no friends or
+ non-private statics, we can't ever call any of the private member
+ functions.) */
+ for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
+ /* We're not interested in compiler-generated methods; they don't
+ provide any way to call private members. */
+ if (!DECL_ARTIFICIAL (fn))
+ {
+ if (!TREE_PRIVATE (fn))
+ {
+ if (DECL_STATIC_FUNCTION_P (fn))
+ /* A non-private static member function is just like a
+ friend; it can create and invoke private member
+ functions, and be accessed without a class
+ instance. */
+ return;
+
+ has_nonprivate_method = 1;
+ break;
+ }
+ else
+ has_member_fn = 1;
+ }
- while (testp < (tree *) obstack_next_free (&class_obstack)
- && (*testp == NULL_TREE || DECL_NAME (*testp) != DECL_NAME (fndecl)))
- testp++;
+ if (!has_nonprivate_method && has_member_fn)
+ {
+ int i;
+ tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
+ for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); i++)
+ if (TREE_VIA_PUBLIC (TREE_VEC_ELT (binfos, i))
+ || TREE_VIA_PROTECTED (TREE_VEC_ELT (binfos, i)))
+ {
+ has_nonprivate_method = 1;
+ break;
+ }
+ if (!has_nonprivate_method)
+ {
+ cp_warning ("all member functions in class `%T' are private", t);
+ return;
+ }
+ }
- if (testp < (tree *) obstack_next_free (&class_obstack))
+ /* Even if some of the member functions are non-private, the class
+ won't be useful for much if all the constructors or destructors
+ are private: such an object can never be created or destroyed. */
+ if (TYPE_HAS_DESTRUCTOR (t))
{
- tree *p;
- for (p = testp; *p; )
- p = &DECL_CHAIN (*p);
- *p = fndecl;
+ tree dtor = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1);
+
+ if (TREE_PRIVATE (dtor))
+ {
+ cp_warning ("`%#T' only defines a private destructor and has no friends",
+ t);
+ return;
+ }
}
- else
+
+ if (TYPE_HAS_CONSTRUCTOR (t))
{
- obstack_ptr_grow (&class_obstack, fndecl);
- *method_vec_ptr = (tree)obstack_base (&class_obstack);
+ int nonprivate_ctor = 0;
+
+ /* If a non-template class does not define a copy
+ constructor, one is defined for it, enabling it to avoid
+ this warning. For a template class, this does not
+ happen, and so we would normally get a warning on:
+
+ template <class T> class C { private: C(); };
+
+ To avoid this asymmetry, we check TYPE_HAS_INIT_REF. All
+ complete non-template or fully instantiated classes have this
+ flag set. */
+ if (!TYPE_HAS_INIT_REF (t))
+ nonprivate_ctor = 1;
+ else
+ for (fn = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 0);
+ fn;
+ fn = OVL_NEXT (fn))
+ {
+ tree ctor = OVL_CURRENT (fn);
+ /* Ideally, we wouldn't count copy constructors (or, in
+ fact, any constructor that takes an argument of the
+ class type as a parameter) because such things cannot
+ be used to construct an instance of the class unless
+ you already have one. But, for now at least, we're
+ more generous. */
+ if (! TREE_PRIVATE (ctor))
+ {
+ nonprivate_ctor = 1;
+ break;
+ }
+ }
+
+ if (nonprivate_ctor == 0)
+ {
+ cp_warning ("`%#T' only defines private constructors and has no friends",
+ t);
+ return;
+ }
}
}
+
/* Warn about duplicate methods in fn_fields. Also compact method
lists so that lookup can be made faster.
- Algorithm: Outer loop builds lists by method name. Inner loop
- checks for redundant method names within a list.
-
Data Structure: List of method lists. The outer list is a
TREE_LIST, whose TREE_PURPOSE field is the field name and the
TREE_VALUE is the DECL_CHAIN of the FUNCTION_DECLs. TREE_CHAIN
@@ -1904,35 +2113,21 @@ grow_method (fndecl, method_vec_ptr)
We also link each field which has shares a name with its baseclass
to the head of the list of fields for that base class. This allows
us to reduce search time in places like `build_method_call' to
- consider only reasonably likely functions. */
+ consider only reasonably likely functions. */
-tree
-finish_struct_methods (t, fn_fields, nonprivate_method)
+static void
+finish_struct_methods (t)
tree t;
- tree fn_fields;
- int nonprivate_method;
{
- tree method_vec;
- tree save_fn_fields = fn_fields;
+ tree fn_fields;
+ tree method_vec = CLASSTYPE_METHOD_VEC (t);
tree ctor_name = constructor_name (t);
int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
- /* Now prepare to gather fn_fields into vector. */
- struct obstack *ambient_obstack = current_obstack;
- current_obstack = &class_obstack;
- method_vec = make_tree_vec (2);
- current_obstack = ambient_obstack;
-
- /* Now make this a live vector. */
- obstack_free (&class_obstack, method_vec);
-
- /* Save room for constructors and destructors. */
- obstack_blank (&class_obstack, sizeof (struct tree_vec) + sizeof (struct tree *));
-
/* First fill in entry 0 with the constructors, entry 1 with destructors,
and the next few with type conversion operators (if any). */
-
- for (; fn_fields; fn_fields = TREE_CHAIN (fn_fields))
+ for (fn_fields = TYPE_METHODS (t); fn_fields;
+ fn_fields = TREE_CHAIN (fn_fields))
{
tree fn_name = DECL_NAME (fn_fields);
@@ -1963,32 +2158,8 @@ finish_struct_methods (t, fn_fields, nonprivate_method)
TYPE_HAS_NONPUBLIC_CTOR (t) = 2;
}
}
- if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (fn_fields)))
- {
- /* Destructors go in slot 1. */
- DECL_CHAIN (fn_fields) = TREE_VEC_ELT (method_vec, 1);
- TREE_VEC_ELT (method_vec, 1) = fn_fields;
- }
- else
- {
- /* Constructors go in slot 0. */
- DECL_CHAIN (fn_fields) = TREE_VEC_ELT (method_vec, 0);
- TREE_VEC_ELT (method_vec, 0) = fn_fields;
- }
- }
- else if (IDENTIFIER_TYPENAME_P (fn_name))
- grow_method (fn_fields, &method_vec);
- }
-
- fn_fields = save_fn_fields;
- for (; fn_fields; fn_fields = TREE_CHAIN (fn_fields))
- {
- tree fn_name = DECL_NAME (fn_fields);
-
- if (fn_name == ctor_name || IDENTIFIER_TYPENAME_P (fn_name))
- continue;
-
- if (fn_name == ansi_opname[(int) MODIFY_EXPR])
+ }
+ else if (fn_name == ansi_opname[(int) MODIFY_EXPR])
{
tree parmtype = TREE_VALUE (FUNCTION_ARG_CHAIN (fn_fields));
@@ -2000,53 +2171,22 @@ finish_struct_methods (t, fn_fields, nonprivate_method)
TYPE_HAS_NONPUBLIC_ASSIGN_REF (t) = 2;
}
}
-
- grow_method (fn_fields, &method_vec);
- }
-
- TREE_VEC_LENGTH (method_vec) = (tree *)obstack_next_free (&class_obstack)
- - (&TREE_VEC_ELT (method_vec, 0));
- obstack_finish (&class_obstack);
- CLASSTYPE_METHOD_VEC (t) = method_vec;
-
- if (nonprivate_method == 0
- && CLASSTYPE_FRIEND_CLASSES (t) == NULL_TREE
- && DECL_FRIENDLIST (TYPE_MAIN_DECL (t)) == NULL_TREE)
- {
- tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
- for (i = 0; i < n_baseclasses; i++)
- if (TREE_VIA_PUBLIC (TREE_VEC_ELT (binfos, i))
- || TREE_VIA_PROTECTED (TREE_VEC_ELT (binfos, i)))
- {
- nonprivate_method = 1;
- break;
- }
- if (nonprivate_method == 0
- && warn_ctor_dtor_privacy)
- cp_warning ("all member functions in class `%T' are private", t);
}
- /* Warn if all destructors are private (in which case this class is
- effectively unusable. */
- if (TYPE_HAS_DESTRUCTOR (t))
- {
- tree dtor = TREE_VEC_ELT (method_vec, 1);
-
- /* Wild parse errors can cause this to happen. */
- if (dtor == NULL_TREE)
- TYPE_HAS_DESTRUCTOR (t) = 0;
- else if (TREE_PRIVATE (dtor)
- && CLASSTYPE_FRIEND_CLASSES (t) == NULL_TREE
- && DECL_FRIENDLIST (TYPE_MAIN_DECL (t)) == NULL_TREE
- && warn_ctor_dtor_privacy)
- cp_warning ("`%#T' only defines a private destructor and has no friends",
- t);
- }
+ if (TYPE_HAS_DESTRUCTOR (t) && !TREE_VEC_ELT (method_vec, 1))
+ /* We thought there was a destructor, but there wasn't. Some
+ parse errors cause this anomalous situation. */
+ TYPE_HAS_DESTRUCTOR (t) = 0;
+
+ /* Issue warnings about private constructors and such. If there are
+ no methods, then some public defaults are generated. */
+ maybe_warn_about_overly_private_class (t);
/* Now for each member function (except for constructors and
destructors), compute where member functions of the same
name reside in base classes. */
if (n_baseclasses != 0
+ && method_vec
&& TREE_VEC_LENGTH (method_vec) > 2)
{
int len = TREE_VEC_LENGTH (method_vec);
@@ -2054,10 +2194,13 @@ finish_struct_methods (t, fn_fields, nonprivate_method)
int any_links = 0;
tree baselink_binfo = build_tree_list (NULL_TREE, TYPE_BINFO (t));
- for (i = 2; i < len; i++)
+ for (i = 2; i < len && TREE_VEC_ELT (method_vec, i); i++)
{
+ tree ovl = TREE_VEC_ELT (method_vec, i);
+
TREE_VEC_ELT (baselink_vec, i)
- = get_baselinks (baselink_binfo, t, DECL_NAME (TREE_VEC_ELT (method_vec, i)));
+ = get_baselinks (baselink_binfo, t,
+ DECL_NAME (OVL_CURRENT (ovl)));
if (TREE_VEC_ELT (baselink_vec, i) != 0)
any_links = 1;
}
@@ -2066,8 +2209,6 @@ finish_struct_methods (t, fn_fields, nonprivate_method)
else
obstack_free (current_obstack, baselink_vec);
}
-
- return method_vec;
}
/* Emit error when a duplicate definition of a type is seen. Patch up. */
@@ -2098,8 +2239,8 @@ duplicate_tag_error (t)
tree unchain = TREE_VEC_ELT (method_vec, i);
while (unchain != NULL_TREE)
{
- TREE_CHAIN (unchain) = NULL_TREE;
- unchain = DECL_CHAIN (unchain);
+ TREE_CHAIN (OVL_CURRENT (unchain)) = NULL_TREE;
+ unchain = OVL_NEXT (unchain);
}
}
}
@@ -2151,8 +2292,7 @@ finish_vtbls (binfo, do_self, t)
decl = BINFO_VTABLE (binfo);
context = DECL_CONTEXT (decl);
DECL_CONTEXT (decl) = 0;
- if (write_virtuals >= 0
- && DECL_INITIAL (decl) != BINFO_VIRTUALS (binfo))
+ if (DECL_INITIAL (decl) != BINFO_VIRTUALS (binfo))
DECL_INITIAL (decl) = build_nt (CONSTRUCTOR, NULL_TREE,
BINFO_VIRTUALS (binfo));
cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0, 0);
@@ -2361,11 +2501,7 @@ modify_one_vtable (binfo, t, fndecl, pfn)
base_offset = size_binop (PLUS_EXPR,
get_derived_offset (binfo, DECL_CONTEXT (current_fndecl)),
BINFO_OFFSET (binfo));
- this_offset = size_binop (MINUS_EXPR, offset, base_offset);
-
- /* Make sure we can modify the derived association with immunity. */
- if (TREE_USED (binfo))
- my_friendly_assert (0, 999);
+ this_offset = ssize_binop (MINUS_EXPR, offset, base_offset);
if (binfo == TYPE_BINFO (t))
{
@@ -2458,16 +2594,14 @@ fixup_vtable_deltas1 (binfo, t)
Also, we want just the delta between the most base class
that we derived this vfield from and us. */
base_offset = size_binop (PLUS_EXPR,
- get_derived_offset (binfo, DECL_CONTEXT (fndecl)),
+ get_derived_offset (binfo,
+ DECL_CONTEXT (fndecl)),
BINFO_OFFSET (binfo));
- this_offset = size_binop (MINUS_EXPR, offset, base_offset);
+ this_offset = ssize_binop (MINUS_EXPR, offset, base_offset);
if (! tree_int_cst_equal (this_offset, delta))
{
/* Make sure we can modify the derived association with immunity. */
- if (TREE_USED (binfo))
- my_friendly_assert (0, 999);
-
if (binfo == TYPE_BINFO (t))
{
/* In this case, it is *type*'s vtable we are modifying.
@@ -2803,8 +2937,7 @@ check_for_override (decl, ctype)
for (i = 0; i < n_baselinks; i++)
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
- if (TYPE_VIRTUAL_P (BINFO_TYPE (base_binfo))
- || flag_all_virtual == 1)
+ if (TYPE_VIRTUAL_P (BINFO_TYPE (base_binfo)))
{
tree tmp = get_matching_virtual
(base_binfo, decl,
@@ -2873,14 +3006,16 @@ warn_hidden (t)
int i;
/* We go through each separately named virtual function. */
- for (i = 2; i < n_methods; ++i)
+ for (i = 2; i < n_methods && TREE_VEC_ELT (method_vec, i); ++i)
{
- tree fndecl = TREE_VEC_ELT (method_vec, i);
+ tree fns = TREE_VEC_ELT (method_vec, i);
+ tree fndecl;
tree base_fndecls = NULL_TREE;
tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
+ fndecl = OVL_CURRENT (fns);
if (DECL_VINDEX (fndecl) == NULL_TREE)
continue;
@@ -2895,11 +3030,11 @@ warn_hidden (t)
base_fndecls);
}
- if (TREE_CHAIN (fndecl)
- && DECL_NAME (TREE_CHAIN (fndecl)) == DECL_NAME (fndecl))
- fndecl = TREE_CHAIN (fndecl);
- else
- fndecl = NULL_TREE;
+ fns = OVL_NEXT (fns);
+ if (fns)
+ fndecl = OVL_CURRENT (fns);
+ else
+ fndecl = NULL_TREE;
/* ...then mark up all the base functions with overriders, preferring
overriders to hiders. */
@@ -2908,9 +3043,9 @@ warn_hidden (t)
{
mark_overriders (fndecl, base_fndecls);
- if (TREE_CHAIN (fndecl)
- && DECL_NAME (TREE_CHAIN (fndecl)) == DECL_NAME (fndecl))
- fndecl = TREE_CHAIN (fndecl);
+ fns = OVL_NEXT (fns);
+ if (fns)
+ fndecl = OVL_CURRENT (fns);
else
fndecl = NULL_TREE;
}
@@ -2972,6 +3107,90 @@ finish_struct_anon (t)
extern int interface_only, interface_unknown;
+/* Create default constructors, assignment operators, and so forth for
+ the type indicated by T, if they are needed.
+ CANT_HAVE_DEFAULT_CTOR, CANT_HAVE_CONST_CTOR, and
+ CANT_HAVE_ASSIGNMENT are nonzero if, for whatever reason, the class
+ cannot have a default constructor, copy constructor taking a const
+ reference argument, or an assignment operator, respectively. If a
+ virtual destructor is created, its DECL is returned; otherwise the
+ return value is NULL_TREE. */
+
+static tree
+add_implicitly_declared_members (t, cant_have_default_ctor,
+ cant_have_const_cctor,
+ cant_have_assignment)
+ tree t;
+ int cant_have_default_ctor;
+ int cant_have_const_cctor;
+ int cant_have_assignment;
+{
+ tree default_fn;
+ tree implicit_fns = NULL_TREE;
+ tree name = TYPE_IDENTIFIER (t);
+ tree virtual_dtor = NULL_TREE;
+ tree *f;
+
+ /* Destructor. */
+ if (TYPE_NEEDS_DESTRUCTOR (t) && !TYPE_HAS_DESTRUCTOR (t)
+ && !IS_SIGNATURE (t))
+ {
+ default_fn = cons_up_default_function (t, name, 0);
+ check_for_override (default_fn, t);
+
+ /* If we couldn't make it work, then pretend we didn't need it. */
+ if (default_fn == void_type_node)
+ TYPE_NEEDS_DESTRUCTOR (t) = 0;
+ else
+ {
+ TREE_CHAIN (default_fn) = implicit_fns;
+ implicit_fns = default_fn;
+
+ if (DECL_VINDEX (default_fn))
+ virtual_dtor = default_fn;
+ }
+ }
+ TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_HAS_DESTRUCTOR (t);
+
+ /* Default constructor. */
+ if (! TYPE_HAS_CONSTRUCTOR (t) && ! cant_have_default_ctor
+ && ! IS_SIGNATURE (t))
+ {
+ default_fn = cons_up_default_function (t, name, 2);
+ TREE_CHAIN (default_fn) = implicit_fns;
+ implicit_fns = default_fn;
+ }
+
+ /* Copy constructor. */
+ if (! TYPE_HAS_INIT_REF (t) && ! IS_SIGNATURE (t) && ! TYPE_FOR_JAVA (t))
+ {
+ /* ARM 12.18: You get either X(X&) or X(const X&), but
+ not both. --Chip */
+ default_fn = cons_up_default_function (t, name,
+ 3 + cant_have_const_cctor);
+ TREE_CHAIN (default_fn) = implicit_fns;
+ implicit_fns = default_fn;
+ }
+
+ /* Assignment operator. */
+ if (! TYPE_HAS_ASSIGN_REF (t) && ! IS_SIGNATURE (t) && ! TYPE_FOR_JAVA (t))
+ {
+ default_fn = cons_up_default_function (t, name,
+ 5 + cant_have_assignment);
+ TREE_CHAIN (default_fn) = implicit_fns;
+ implicit_fns = default_fn;
+ }
+
+ /* Now, hook all of the new functions on to TYPE_METHODS,
+ and add them to the CLASSTYPE_METHOD_VEC. */
+ for (f = &implicit_fns; *f; f = &TREE_CHAIN (*f))
+ add_method (t, 0, *f);
+ *f = TYPE_METHODS (t);
+ TYPE_METHODS (t) = implicit_fns;
+
+ return virtual_dtor;
+}
+
/* Create a RECORD_TYPE or UNION_TYPE node for a C struct or union declaration
(or C++ class declaration).
@@ -2997,41 +3216,7 @@ extern int interface_only, interface_unknown;
inheritance. Additional virtual function tables have different
DELTAs, which tell how to adjust `this' to point to the right thing.
- LIST_OF_FIELDLISTS is just that. The elements of the list are
- TREE_LIST elements, whose TREE_PURPOSE field tells what access
- the list has, and the TREE_VALUE slot gives the actual fields.
-
- ATTRIBUTES is the set of decl attributes to be applied, if any.
-
- If flag_all_virtual == 1, then we lay all functions into
- the virtual function table, as though they were declared
- virtual. Constructors do not lay down in the virtual function table.
-
- If flag_all_virtual == 2, then we lay all functions into
- the virtual function table, such that virtual functions
- occupy a space by themselves, and then all functions
- of the class occupy a space by themselves. This is illustrated
- in the following diagram:
-
- class A; class B : A;
-
- Class A's vtbl: Class B's vtbl:
- --------------------------------------------------------------------
- | A's virtual functions| | B's virtual functions |
- | | | (may inherit some from A). |
- --------------------------------------------------------------------
- | All of A's functions | | All of A's functions |
- | (such as a->A::f). | | (such as b->A::f) |
- --------------------------------------------------------------------
- | B's new virtual functions |
- | (not defined in A.) |
- -------------------------------
- | All of B's functions |
- | (such as b->B::f) |
- -------------------------------
-
- this allows the program to make references to any function, virtual
- or otherwise in a type-consistent manner. */
+ ATTRIBUTES is the set of decl attributes to be applied, if any. */
tree
finish_struct_1 (t, warn_anon)
@@ -3039,12 +3224,9 @@ finish_struct_1 (t, warn_anon)
int warn_anon;
{
int old;
- tree name = TYPE_IDENTIFIER (t);
enum tree_code code = TREE_CODE (t);
tree fields = TYPE_FIELDS (t);
- tree fn_fields = TYPE_METHODS (t);
tree x, last_x, method_vec;
- int all_virtual;
int has_virtual;
int max_has_virtual;
tree pending_virtuals = NULL_TREE;
@@ -3052,6 +3234,7 @@ finish_struct_1 (t, warn_anon)
tree abstract_virtuals = NULL_TREE;
tree vfield;
tree vfields;
+ tree virtual_dtor;
int cant_have_default_ctor;
int cant_have_const_ctor;
int no_const_asn_ref;
@@ -3064,7 +3247,6 @@ finish_struct_1 (t, warn_anon)
int any_default_members = 0;
int const_sans_init = 0;
int ref_sans_init = 0;
- int nonprivate_method = 0;
tree access_decls = NULL_TREE;
int aggregate = 1;
int empty = 1;
@@ -3162,25 +3344,14 @@ finish_struct_1 (t, warn_anon)
CLASSTYPE_VFIELDS (t) = vfields;
CLASSTYPE_VFIELD (t) = vfield;
- if (IS_SIGNATURE (t))
- all_virtual = 0;
- else if (flag_all_virtual == 1)
- all_virtual = 1;
- else
- all_virtual = 0;
-
for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
{
GNU_xref_member (current_class_name, x);
- nonprivate_method |= ! TREE_PRIVATE (x);
-
/* If this was an evil function, don't keep it in class. */
if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (x)))
continue;
- DECL_CLASS_CONTEXT (x) = t;
-
/* Do both of these, even though they're in the same union;
if the insn `r' member and the size `i' member are
different sizes, as on the alpha, the larger of the two
@@ -3194,8 +3365,7 @@ finish_struct_1 (t, warn_anon)
/* The name of the field is the original field name
Save this in auxiliary field for later overloading. */
- if (DECL_VINDEX (x)
- || (all_virtual == 1 && ! DECL_CONSTRUCTOR_P (x)))
+ if (DECL_VINDEX (x))
{
add_virtual_function (&pending_virtuals, &pending_hard_virtuals,
&has_virtual, x, t);
@@ -3223,38 +3393,15 @@ finish_struct_1 (t, warn_anon)
empty = 0;
}
- /* Handle access declarations. */
if (TREE_CODE (x) == USING_DECL)
{
- tree ctype = DECL_INITIAL (x);
- tree sname = DECL_NAME (x);
- tree access
- = TREE_PRIVATE (x) ? access_private_node
- : TREE_PROTECTED (x) ? access_protected_node
- : access_public_node;
- tree fdecl, binfo;
-
+ /* Save access declarations for later. */
if (last_x)
TREE_CHAIN (last_x) = TREE_CHAIN (x);
else
fields = TREE_CHAIN (x);
-
- binfo = binfo_or_else (ctype, t);
- if (! binfo)
- continue;
-
- if (sname == constructor_name (ctype)
- || sname == constructor_name_full (ctype))
- cp_error_at ("using-declaration for constructor", x);
-
- fdecl = lookup_field (binfo, sname, 0, 0);
- if (! fdecl)
- fdecl = lookup_fnfields (binfo, sname, 0);
-
- if (fdecl)
- access_decls = scratch_tree_cons (access, fdecl, access_decls);
- else
- cp_error_at ("no members matching `%D' in `%#T'", x, ctype);
+
+ access_decls = scratch_tree_cons (NULL_TREE, x, access_decls);
continue;
}
@@ -3567,36 +3714,6 @@ finish_struct_1 (t, warn_anon)
CLASSTYPE_REF_FIELDS_NEED_INIT (t) = ref_sans_init;
CLASSTYPE_ABSTRACT_VIRTUALS (t) = abstract_virtuals;
- /* Synthesize any needed methods. Note that methods will be synthesized
- for anonymous unions; grok_x_components undoes that. */
-
- if (! fn_fields)
- nonprivate_method = 1;
-
- if (TYPE_NEEDS_DESTRUCTOR (t) && !TYPE_HAS_DESTRUCTOR (t)
- && !IS_SIGNATURE (t))
- {
- /* Here we must cons up a destructor on the fly. */
- tree dtor = cons_up_default_function (t, name, 0);
- check_for_override (dtor, t);
-
- /* If we couldn't make it work, then pretend we didn't need it. */
- if (dtor == void_type_node)
- TYPE_NEEDS_DESTRUCTOR (t) = 0;
- else
- {
- /* Link dtor onto end of fn_fields. */
-
- TREE_CHAIN (dtor) = fn_fields;
- fn_fields = dtor;
-
- if (DECL_VINDEX (dtor))
- add_virtual_function (&pending_virtuals, &pending_hard_virtuals,
- &has_virtual, dtor, t);
- nonprivate_method = 1;
- }
- }
-
/* Effective C++ rule 11. */
if (has_pointers && warn_ecpp && TYPE_HAS_CONSTRUCTOR (t)
&& ! (TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
@@ -3612,9 +3729,9 @@ finish_struct_1 (t, warn_anon)
else if (! TYPE_HAS_ASSIGN_REF (t))
cp_warning (" but does not override `operator=(const %T&)'", t);
}
-
- TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_HAS_DESTRUCTOR (t);
-
+
+ /* Do some bookkeeping that will guide the generation of implicitly
+ declared member functions. */
TYPE_HAS_COMPLEX_INIT_REF (t)
|= (TYPE_HAS_INIT_REF (t) || TYPE_USES_VIRTUAL_BASECLASSES (t)
|| has_virtual || any_default_members);
@@ -3624,68 +3741,25 @@ finish_struct_1 (t, warn_anon)
if (! IS_SIGNATURE (t))
CLASSTYPE_NON_AGGREGATE (t)
= ! aggregate || has_virtual || TYPE_HAS_CONSTRUCTOR (t);
-
- /* ARM $12.1: A default constructor will be generated for a class X
- only if no constructor has been declared for class X. So we
- check TYPE_HAS_CONSTRUCTOR also, to make sure we don't generate
- one if they declared a constructor in this class. */
- if (! TYPE_HAS_CONSTRUCTOR (t) && ! cant_have_default_ctor
- && ! IS_SIGNATURE (t))
- {
- tree default_fn = cons_up_default_function (t, name, 2);
- TREE_CHAIN (default_fn) = fn_fields;
- fn_fields = default_fn;
- }
-
- /* Create default copy constructor, if needed. */
- if (! TYPE_HAS_INIT_REF (t) && ! IS_SIGNATURE (t))
- {
- /* ARM 12.18: You get either X(X&) or X(const X&), but
- not both. --Chip */
- tree default_fn = cons_up_default_function (t, name,
- 3 + cant_have_const_ctor);
- TREE_CHAIN (default_fn) = fn_fields;
- fn_fields = default_fn;
- }
-
TYPE_HAS_REAL_ASSIGNMENT (t) |= TYPE_HAS_ASSIGNMENT (t);
TYPE_HAS_REAL_ASSIGN_REF (t) |= TYPE_HAS_ASSIGN_REF (t);
TYPE_HAS_COMPLEX_ASSIGN_REF (t)
|= TYPE_HAS_ASSIGN_REF (t) || TYPE_USES_VIRTUAL_BASECLASSES (t);
- if (! TYPE_HAS_ASSIGN_REF (t) && ! IS_SIGNATURE (t))
- {
- tree default_fn = cons_up_default_function (t, name,
- 5 + no_const_asn_ref);
- TREE_CHAIN (default_fn) = fn_fields;
- fn_fields = default_fn;
- }
-
- if (fn_fields)
- {
- TYPE_METHODS (t) = fn_fields;
- method_vec = finish_struct_methods (t, fn_fields, nonprivate_method);
-
- if (TYPE_HAS_CONSTRUCTOR (t)
- && CLASSTYPE_FRIEND_CLASSES (t) == NULL_TREE
- && DECL_FRIENDLIST (TYPE_MAIN_DECL (t)) == NULL_TREE)
- {
- int nonprivate_ctor = 0;
- tree ctor;
-
- for (ctor = TREE_VEC_ELT (method_vec, 0);
- ctor;
- ctor = DECL_CHAIN (ctor))
- if (! TREE_PRIVATE (ctor))
- {
- nonprivate_ctor = 1;
- break;
- }
-
- if (nonprivate_ctor == 0 && warn_ctor_dtor_privacy)
- cp_warning ("`%#T' only defines private constructors and has no friends",
- t);
- }
+ /* Synthesize any needed methods. Note that methods will be synthesized
+ for anonymous unions; grok_x_components undoes that. */
+ virtual_dtor
+ = add_implicitly_declared_members (t, cant_have_default_ctor,
+ cant_have_const_ctor,
+ no_const_asn_ref);
+ if (virtual_dtor)
+ add_virtual_function (&pending_virtuals, &pending_hard_virtuals,
+ &has_virtual, virtual_dtor, t);
+
+ if (TYPE_METHODS (t))
+ {
+ finish_struct_methods (t);
+ method_vec = CLASSTYPE_METHOD_VEC (t);
}
else
{
@@ -3697,75 +3771,33 @@ finish_struct_1 (t, warn_anon)
TYPE_HAS_DESTRUCTOR (t) = 0;
}
- {
- int n_methods = method_vec ? TREE_VEC_LENGTH (method_vec) : 0;
-
- for (access_decls = nreverse (access_decls); access_decls;
- access_decls = TREE_CHAIN (access_decls))
- {
- tree fdecl = TREE_VALUE (access_decls);
- tree flist = NULL_TREE;
- tree name;
- tree access = TREE_PURPOSE (access_decls);
- int i = 2;
- tree tmp;
-
- if (TREE_CODE (fdecl) == TREE_LIST)
- {
- flist = fdecl;
- fdecl = TREE_VALUE (flist);
- }
-
- name = DECL_NAME (fdecl);
-
- for (; i < n_methods; i++)
- if (DECL_NAME (TREE_VEC_ELT (method_vec, i)) == name)
- {
- cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
- cp_error_at (" because of local method `%#D' with same name",
- TREE_VEC_ELT (method_vec, i));
- fdecl = NULL_TREE;
- break;
- }
-
- if (! fdecl)
- continue;
-
- for (tmp = fields; tmp; tmp = TREE_CHAIN (tmp))
- if (DECL_NAME (tmp) == name)
- {
- cp_error ("cannot adjust access to `%#D' in `%#T'", fdecl, t);
- cp_error_at (" because of local field `%#D' with same name", tmp);
- fdecl = NULL_TREE;
- break;
- }
-
- if (!fdecl)
- continue;
-
- /* Make type T see field decl FDECL with access ACCESS.*/
- if (flist)
- {
- fdecl = TREE_VALUE (flist);
- while (fdecl)
- {
- if (alter_access (t, fdecl, access) == 0)
- break;
- fdecl = DECL_CHAIN (fdecl);
- }
- }
- else
- alter_access (t, fdecl, access);
- }
-
- }
+ for (access_decls = nreverse (access_decls); access_decls;
+ access_decls = TREE_CHAIN (access_decls))
+ handle_using_decl (TREE_VALUE (access_decls), t, method_vec, fields);
if (vfield == NULL_TREE && has_virtual)
{
- /* We build this decl with ptr_type_node, and
- change the type when we know what it should be. */
+ /* We build this decl with vtbl_ptr_type_node, which is a
+ `vtable_entry_type*'. It might seem more precise to use
+ `vtable_entry_type (*)[N]' where N is the number of firtual
+ functions. However, that would require the vtable pointer in
+ base classes to have a different type than the vtable pointer
+ in derived classes. We could make that happen, but that
+ still wouldn't solve all the problems. In particular, the
+ type-based alias analysis code would decide that assignments
+ to the base class vtable pointer can't alias assignments to
+ the derived class vtable pointer, since they have different
+ types. Thus, in an derived class destructor, where the base
+ class constructor was inlined, we could generate bad code for
+ setting up the vtable pointer.
+
+ Therefore, we use one type for all vtable pointers. We still
+ use a type-correct type; it's just doesn't indicate the array
+ bounds. That's better than using `void*' or some such; it's
+ cleaner, and it let's the alias analysis code know that these
+ stores cannot alias stores to void*! */
vfield = build_lang_field_decl (FIELD_DECL, get_vfield_name (t),
- ptr_type_node);
+ vtbl_ptr_type_node);
/* If you change any of the below, take a look at all the
other VFIELD_BASEs and VTABLE_BASEs in the code, and change
them too. */
@@ -3830,17 +3862,18 @@ finish_struct_1 (t, warn_anon)
for (x = fields; x; x = TREE_CHAIN (x))
{
tree name = DECL_NAME (x);
- int i = 2;
+ int i;
if (TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x))
continue;
- for (; i < n_methods; ++i)
- if (DECL_NAME (TREE_VEC_ELT (method_vec, i)) == name)
+ for (i = 2; i < n_methods && TREE_VEC_ELT (method_vec, i); ++i)
+ if (DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)))
+ == name)
{
cp_error_at ("data member `%#D' conflicts with", x);
cp_error_at ("function member `%#D'",
- TREE_VEC_ELT (method_vec, i));
+ OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
break;
}
}
@@ -3877,6 +3910,9 @@ finish_struct_1 (t, warn_anon)
the virtual bases. */
if (empty && flag_new_abi)
CLASSTYPE_SIZE (t) = integer_zero_node;
+ else if (flag_new_abi && TYPE_HAS_COMPLEX_INIT_REF (t)
+ && TYPE_HAS_COMPLEX_ASSIGN_REF (t))
+ CLASSTYPE_SIZE (t) = TYPE_BINFO_SIZE (t);
else
CLASSTYPE_SIZE (t) = TYPE_SIZE (t);
CLASSTYPE_ALIGN (t) = TYPE_ALIGN (t);
@@ -3961,6 +3997,11 @@ finish_struct_1 (t, warn_anon)
if (max_has_virtual > 0)
TYPE_VIRTUAL_P (t) = 1;
+ /* Do this here before we start messing with vtables so that we are ready
+ for import_export_vtable. */
+ if (at_eof)
+ import_export_class (t);
+
if (flag_rtti && TYPE_VIRTUAL_P (t) && !pending_hard_virtuals)
modify_all_vtables (t, NULL_TREE, NULL_TREE);
@@ -4007,7 +4048,8 @@ finish_struct_1 (t, warn_anon)
/* The first slot is for the rtti offset. */
pending_virtuals = tree_cons (NULL_TREE, NULL_TREE, pending_virtuals);
- set_rtti_entry (pending_virtuals, size_zero_node, t);
+ set_rtti_entry (pending_virtuals,
+ convert (ssizetype, integer_zero_node), t);
build_vtable (NULL_TREE, t);
}
else
@@ -4056,46 +4098,22 @@ finish_struct_1 (t, warn_anon)
else if (has_virtual)
{
TYPE_BINFO_VIRTUALS (t) = pending_virtuals;
- if (write_virtuals >= 0)
- DECL_VIRTUAL_P (TYPE_BINFO_VTABLE (t)) = 1;
+ DECL_VIRTUAL_P (TYPE_BINFO_VTABLE (t)) = 1;
}
}
/* Now lay out the virtual function table. */
if (has_virtual)
{
- tree atype, itype;
+ /* Use size_int so values are memoized in common cases. */
+ tree itype = build_index_type (size_int (has_virtual));
+ tree atype = build_array_type (vtable_entry_type, itype);
- if (TREE_TYPE (vfield) == ptr_type_node)
- {
- /* We must create a pointer to this table because
- the one inherited from base class does not exist.
- We will fill in the type when we know what it
- should really be. Use `size_int' so values are memoized
- in common cases. */
- itype = build_index_type (size_int (has_virtual));
- atype = build_array_type (vtable_entry_type, itype);
- layout_type (atype);
- TREE_TYPE (vfield) = build_pointer_type (atype);
- }
- else
- {
- atype = TREE_TYPE (TREE_TYPE (vfield));
-
- if (has_virtual != TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (atype))))
- {
- /* We must extend (or create) the boundaries on this array,
- because we picked up virtual functions from multiple
- base classes. */
- itype = build_index_type (size_int (has_virtual));
- atype = build_array_type (vtable_entry_type, itype);
- layout_type (atype);
- vfield = copy_node (vfield);
- TREE_TYPE (vfield) = build_pointer_type (atype);
- }
- }
+ layout_type (atype);
CLASSTYPE_VFIELD (t) = vfield;
+
+ /* We may have to grow the vtable. */
if (TREE_TYPE (TYPE_BINFO_VTABLE (t)) != atype)
{
TREE_TYPE (TYPE_BINFO_VTABLE (t)) = atype;
@@ -4204,8 +4222,7 @@ finish_struct_1 (t, warn_anon)
{
/* Be smarter about nested classes here. If a type is nested,
only output it if we would output the enclosing type. */
- if (DECL_CONTEXT (TYPE_MAIN_DECL (t))
- && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (TYPE_MAIN_DECL (t)))) == 't')
+ if (DECL_CLASS_SCOPE_P (TYPE_MAIN_DECL (t)))
DECL_IGNORED_P (TYPE_MAIN_DECL (t)) = TREE_ASM_WRITTEN (TYPE_MAIN_DECL (t));
}
#endif
@@ -4224,14 +4241,9 @@ finish_struct_1 (t, warn_anon)
references between translation units. */
if (CLASSTYPE_METHOD_VEC (t))
{
- extern tree pending_vtables;
-
/* Don't output full info about any type
which does not have its implementation defined here. */
- if (TYPE_VIRTUAL_P (t) && write_virtuals == 2)
- TYPE_DECL_SUPPRESS_DEBUG (TYPE_MAIN_DECL (t))
- = (value_member (TYPE_IDENTIFIER (t), pending_vtables) == 0);
- else if (CLASSTYPE_INTERFACE_ONLY (t))
+ if (CLASSTYPE_INTERFACE_ONLY (t))
TYPE_DECL_SUPPRESS_DEBUG (TYPE_MAIN_DECL (t)) = 1;
#if 0
/* XXX do something about this. */
@@ -4250,20 +4262,94 @@ finish_struct_1 (t, warn_anon)
return t;
}
+/* In [basic.scope.class] we have:
+
+ A name N used in a class S shall refer to the same declaration in
+ its context and when re-evaluated in the completed scope of S.
+
+ This function checks this condition for X, which is a member of
+ T. */
+
+static void
+check_member_decl_is_same_in_complete_scope (t, x)
+ tree t;
+ tree x;
+{
+ /* A name N used in a class S shall refer to the same declaration in
+ its context and when re-evaluated in the completed scope of S.
+
+ Enums, types and static vars have already been checked. */
+ if (TREE_CODE (x) != USING_DECL
+ && TREE_CODE (x) != TYPE_DECL && !DECL_CLASS_TEMPLATE_P (x)
+ && TREE_CODE (x) != CONST_DECL && TREE_CODE (x) != VAR_DECL)
+ {
+ tree name = DECL_NAME (x);
+ tree icv;
+
+ /* Don't get confused by access decls. */
+ if (name && TREE_CODE (name) == IDENTIFIER_NODE)
+ icv = IDENTIFIER_CLASS_VALUE (name);
+ else
+ icv = NULL_TREE;
+
+ if (icv
+ /* Don't complain about constructors. */
+ && name != constructor_name (current_class_type)
+ /* Or inherited names. */
+ && id_in_current_class (name)
+ /* Or shadowed tags. */
+ && !(TREE_CODE (icv) == TYPE_DECL && DECL_CONTEXT (icv) == t))
+ {
+ cp_pedwarn_at ("declaration of identifier `%D' as `%+#D'",
+ name, x);
+ cp_pedwarn_at ("conflicts with other use in class as `%#D'",
+ icv);
+ }
+ }
+}
+
+/* When T was built up, the member declarations were added in reverse
+ order. Rearrange them to declaration order. */
+
+void
+unreverse_member_declarations (t)
+ tree t;
+{
+ tree next;
+ tree prev;
+ tree x;
+
+ /* The TYPE_FIELDS, TYPE_METHODS, and CLASSTYPE_TAGS are all in
+ reverse order. Put them in declaration order now. */
+ TYPE_METHODS (t) = nreverse (TYPE_METHODS (t));
+ CLASSTYPE_TAGS (t) = nreverse (CLASSTYPE_TAGS (t));
+
+ /* Actually, for the TYPE_FIELDS, only the non TYPE_DECLs are in
+ reverse order, so we can't just use nreverse. */
+ prev = NULL_TREE;
+ for (x = TYPE_FIELDS (t);
+ x && TREE_CODE (x) != TYPE_DECL;
+ x = next)
+ {
+ next = TREE_CHAIN (x);
+ TREE_CHAIN (x) = prev;
+ prev = x;
+ }
+ if (prev)
+ {
+ TREE_CHAIN (TYPE_FIELDS (t)) = x;
+ if (prev)
+ TYPE_FIELDS (t) = prev;
+ }
+}
+
tree
-finish_struct (t, list_of_fieldlists, attributes, warn_anon)
- tree t, list_of_fieldlists, attributes;
+finish_struct (t, attributes, warn_anon)
+ tree t, attributes;
int warn_anon;
{
- tree fields = NULL_TREE;
- tree *tail = &TYPE_METHODS (t);
- tree specializations = NULL_TREE;
- tree *specialization_tail = &specializations;
tree name = TYPE_NAME (t);
- tree x, last_x = NULL_TREE;
- tree access;
- tree dummy = NULL_TREE;
- tree next_x = NULL_TREE;
+ tree x;
if (TREE_CODE (name) == TYPE_DECL)
{
@@ -4283,152 +4369,23 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon)
/* Append the fields we need for constructing signature tables. */
if (IS_SIGNATURE (t))
- append_signature_fields (list_of_fieldlists);
+ append_signature_fields (t);
- /* Move our self-reference declaration to the end of the field list so
- any real field with the same name takes precedence. */
- if (list_of_fieldlists
- && TREE_VALUE (list_of_fieldlists)
- && DECL_ARTIFICIAL (TREE_VALUE (list_of_fieldlists)))
- {
- dummy = TREE_VALUE (list_of_fieldlists);
- list_of_fieldlists = TREE_CHAIN (list_of_fieldlists);
- }
+ /* Now that we've got all the field declarations, reverse everything
+ as necessary. */
+ unreverse_member_declarations (t);
- if (last_x && list_of_fieldlists)
- TREE_CHAIN (last_x) = TREE_VALUE (list_of_fieldlists);
-
- while (list_of_fieldlists)
+ if (flag_optional_diags)
{
- access = TREE_PURPOSE (list_of_fieldlists);
-
- /* For signatures, we made all methods `public' in the parser and
- reported an error if a access specifier was used. */
- if (access == access_default_node)
- {
- if (CLASSTYPE_DECLARED_CLASS (t) == 0)
- access = access_public_node;
- else
- access = access_private_node;
- }
-
- for (x = TREE_VALUE (list_of_fieldlists); x; x = next_x)
- {
- next_x = TREE_CHAIN (x);
-
- TREE_PRIVATE (x) = access == access_private_node;
- TREE_PROTECTED (x) = access == access_protected_node;
-
- if (TREE_CODE (x) == TEMPLATE_DECL)
- {
- TREE_PRIVATE (DECL_RESULT (x)) = TREE_PRIVATE (x);
- TREE_PROTECTED (DECL_RESULT (x)) = TREE_PROTECTED (x);
- }
-
- /* Check for inconsistent use of this name in the class body.
- Enums, types and static vars have already been checked. */
- if (TREE_CODE (x) != TYPE_DECL && TREE_CODE (x) != USING_DECL
- && ! (TREE_CODE (x) == TEMPLATE_DECL
- && TREE_CODE (DECL_RESULT (x)) == TYPE_DECL)
- && TREE_CODE (x) != CONST_DECL && TREE_CODE (x) != VAR_DECL)
- {
- tree name = DECL_NAME (x);
- tree icv;
-
- /* Don't get confused by access decls. */
- if (name && TREE_CODE (name) == IDENTIFIER_NODE)
- icv = IDENTIFIER_CLASS_VALUE (name);
- else
- icv = NULL_TREE;
-
- if (icv
- /* Don't complain about constructors. */
- && name != constructor_name (current_class_type)
- /* Or inherited names. */
- && id_in_current_class (name)
- /* Or shadowed tags. */
- && !(TREE_CODE (icv) == TYPE_DECL
- && DECL_CONTEXT (icv) == t))
- {
- cp_error_at ("declaration of identifier `%D' as `%+#D'",
- name, x);
- cp_error_at ("conflicts with other use in class as `%#D'",
- icv);
- }
- }
-
- if (TREE_CODE (x) == FUNCTION_DECL
- || DECL_FUNCTION_TEMPLATE_P (x))
- {
- DECL_CLASS_CONTEXT (x) = t;
-
- if (last_x)
- TREE_CHAIN (last_x) = next_x;
-
- if (DECL_TEMPLATE_SPECIALIZATION (x))
- /* We don't enter the specialization into the class
- method vector since specializations don't affect
- overloading. Instead we keep track of the
- specializations, and process them after the method
- vector is complete. */
- {
- *specialization_tail = x;
- specialization_tail = &TREE_CHAIN (x);
- TREE_CHAIN (x) = NULL_TREE;
- continue;
- }
-
- /* Link x onto end of TYPE_METHODS. */
- *tail = x;
- tail = &TREE_CHAIN (x);
- continue;
- }
-
- if (TREE_CODE (x) != TYPE_DECL)
- DECL_FIELD_CONTEXT (x) = t;
-
- if (! fields)
- fields = x;
- last_x = x;
- }
- list_of_fieldlists = TREE_CHAIN (list_of_fieldlists);
- /* link the tail while we have it! */
- if (last_x)
- {
- TREE_CHAIN (last_x) = NULL_TREE;
-
- if (list_of_fieldlists
- && TREE_VALUE (list_of_fieldlists)
- && TREE_CODE (TREE_VALUE (list_of_fieldlists)) != FUNCTION_DECL)
- TREE_CHAIN (last_x) = TREE_VALUE (list_of_fieldlists);
- }
- }
-
- /* Now add the tags, if any, to the list of TYPE_DECLs
- defined for this type. */
- if (CLASSTYPE_TAGS (t) || dummy)
- {
- /* The list of tags was built up in pushtag in reverse order; we need
- to fix that so that enumerators will be processed in forward order
- in template instantiation. */
- CLASSTYPE_TAGS (t) = x = nreverse (CLASSTYPE_TAGS (t));
- while (x)
- {
- tree tag = TYPE_MAIN_DECL (TREE_VALUE (x));
-
- TREE_NONLOCAL_FLAG (TREE_VALUE (x)) = 0;
- x = TREE_CHAIN (x);
- last_x = chainon (last_x, tag);
- }
- if (dummy)
- last_x = chainon (last_x, dummy);
- if (fields == NULL_TREE)
- fields = last_x;
- CLASSTYPE_LOCAL_TYPEDECLS (t) = 1;
+ for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
+ check_member_decl_is_same_in_complete_scope (t, x);
+ for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x))
+ check_member_decl_is_same_in_complete_scope (t, x);
}
- *tail = NULL_TREE;
- TYPE_FIELDS (t) = fields;
+ /* Mark all the tags in the class as class-local. */
+ for (x = CLASSTYPE_TAGS (t); x; x = TREE_CHAIN (x))
+ TREE_NONLOCAL_FLAG (TREE_VALUE (x)) = 0;
cplus_decl_attributes (t, attributes, NULL_TREE);
@@ -4452,63 +4409,13 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon)
= tree_cons (NULL_TREE, d,
DECL_TEMPLATE_INJECT (CLASSTYPE_TI_TEMPLATE (t)));
}
- CLASSTYPE_METHOD_VEC (t)
- = finish_struct_methods (t, TYPE_METHODS (t), 1);
+ finish_struct_methods (t);
TYPE_SIZE (t) = integer_zero_node;
}
else
t = finish_struct_1 (t, warn_anon);
TYPE_BEING_DEFINED (t) = 0;
-
- /* Now, figure out which member templates we're specializing. */
- for (x = specializations; x != NULL_TREE; x = TREE_CHAIN (x))
- {
- tree spec_args;
- tree fn;
- int pending_specialization;
-
- if (uses_template_parms (t))
- /* If t is a template class, and x is a specialization, then x
- is itself really a template. Due to the vagaries of the
- parser, however, we will have a handle to a function
- declaration, rather than the template declaration, at this
- point. */
- {
- my_friendly_assert (DECL_TEMPLATE_INFO (x) != NULL_TREE, 0);
- my_friendly_assert (DECL_TI_TEMPLATE (x) != NULL_TREE, 0);
- fn = DECL_TI_TEMPLATE (x);
- }
- else
- fn = x;
-
- /* We want the specialization arguments, which will be the
- innermost ones. */
- if (DECL_TI_ARGS (fn) && TREE_CODE (DECL_TI_ARGS (fn)) == TREE_VEC)
- spec_args
- = TREE_VEC_ELT (DECL_TI_ARGS (fn), 0);
- else
- spec_args = DECL_TI_ARGS (fn);
-
- pending_specialization
- = TI_PENDING_SPECIALIZATION_FLAG (DECL_TEMPLATE_INFO (fn));
- check_explicit_specialization
- (lookup_template_function (DECL_NAME (fn), spec_args),
- fn, 0, 1 | (8 * pending_specialization));
- TI_PENDING_SPECIALIZATION_FLAG (DECL_TEMPLATE_INFO (fn)) = 0;
-
- /* Now, the assembler name will be correct for fn, so we
- make its RTL. */
- DECL_RTL (fn) = 0;
- make_decl_rtl (fn, NULL_PTR, 1);
-
- if (x != fn)
- {
- DECL_RTL (x) = 0;
- make_decl_rtl (x, NULL_PTR, 1);
- }
- }
-
if (current_class_type)
popclass (0);
else
@@ -4517,15 +4424,15 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon)
return t;
}
-/* Return non-zero if the effective type of INSTANCE is static.
+/* Return the dynamic type of INSTANCE, if known.
Used to determine whether the virtual function table is needed
or not.
*NONNULL is set iff INSTANCE can be known to be nonnull, regardless
of our knowledge of its type. */
-int
-resolves_to_fixed_type_p (instance, nonnull)
+tree
+fixed_type_or_null (instance, nonnull)
tree instance;
int *nonnull;
{
@@ -4543,9 +4450,9 @@ resolves_to_fixed_type_p (instance, nonnull)
{
if (nonnull)
*nonnull = 1;
- return 1;
+ return TREE_TYPE (instance);
}
- return 0;
+ return NULL_TREE;
case SAVE_EXPR:
/* This is a call to a constructor, hence it's never zero. */
@@ -4553,33 +4460,33 @@ resolves_to_fixed_type_p (instance, nonnull)
{
if (nonnull)
*nonnull = 1;
- return 1;
+ return TREE_TYPE (instance);
}
- return resolves_to_fixed_type_p (TREE_OPERAND (instance, 0), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
case RTL_EXPR:
- return 0;
+ return NULL_TREE;
case PLUS_EXPR:
case MINUS_EXPR:
if (TREE_CODE (TREE_OPERAND (instance, 1)) == INTEGER_CST)
/* Propagate nonnull. */
- resolves_to_fixed_type_p (TREE_OPERAND (instance, 0), nonnull);
+ fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
if (TREE_CODE (TREE_OPERAND (instance, 0)) == ADDR_EXPR)
- return resolves_to_fixed_type_p (TREE_OPERAND (instance, 0), nonnull);
- return 0;
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
+ return NULL_TREE;
case NOP_EXPR:
case CONVERT_EXPR:
- return resolves_to_fixed_type_p (TREE_OPERAND (instance, 0), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
case ADDR_EXPR:
if (nonnull)
*nonnull = 1;
- return resolves_to_fixed_type_p (TREE_OPERAND (instance, 0), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
case COMPONENT_REF:
- return resolves_to_fixed_type_p (TREE_OPERAND (instance, 1), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 1), nonnull);
case VAR_DECL:
case FIELD_DECL:
@@ -4588,7 +4495,7 @@ resolves_to_fixed_type_p (instance, nonnull)
{
if (nonnull)
*nonnull = 1;
- return 1;
+ return TREE_TYPE (TREE_TYPE (instance));
}
/* fall through... */
case TARGET_EXPR:
@@ -4597,37 +4504,65 @@ resolves_to_fixed_type_p (instance, nonnull)
{
if (nonnull)
*nonnull = 1;
- return 1;
+ return TREE_TYPE (instance);
}
else if (nonnull)
{
if (instance == current_class_ptr
&& flag_this_is_variable <= 0)
{
- /* Some people still use `this = 0' inside destructors. */
- *nonnull = ! DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (current_function_decl));
- /* In a constructor, we know our type. */
+ /* Normally, 'this' must be non-null. */
+ if (flag_this_is_variable == 0)
+ *nonnull = 1;
+
+ /* <0 means we're in a constructor and we know our type. */
if (flag_this_is_variable < 0)
- return 1;
+ return TREE_TYPE (TREE_TYPE (instance));
}
else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE)
/* Reference variables should be references to objects. */
*nonnull = 1;
}
- return 0;
+ return NULL_TREE;
default:
- return 0;
+ return NULL_TREE;
}
}
+
+/* Return non-zero if the dynamic type of INSTANCE is known, and equivalent
+ to the static type. We also handle the case where INSTANCE is really
+ a pointer.
+
+ Used to determine whether the virtual function table is needed
+ or not.
+
+ *NONNULL is set iff INSTANCE can be known to be nonnull, regardless
+ of our knowledge of its type. */
+
+int
+resolves_to_fixed_type_p (instance, nonnull)
+ tree instance;
+ int *nonnull;
+{
+ tree t = TREE_TYPE (instance);
+ tree fixed = fixed_type_or_null (instance, nonnull);
+ if (fixed == NULL_TREE)
+ return 0;
+ if (POINTER_TYPE_P (t))
+ t = TREE_TYPE (t);
+ return comptypes (TYPE_MAIN_VARIANT (t), TYPE_MAIN_VARIANT (fixed), 1);
+}
+
void
init_class_processing ()
{
current_class_depth = 0;
- current_class_stacksize = 10;
- current_class_base = (tree *)xmalloc(current_class_stacksize * sizeof (tree));
- current_class_stack = current_class_base;
+ current_class_stack_size = 10;
+ current_class_stack
+ = (class_stack_node_t) xmalloc (current_class_stack_size
+ * sizeof (struct class_stack_node));
current_lang_stacksize = 10;
current_lang_base = (tree *)xmalloc(current_lang_stacksize * sizeof (tree));
@@ -4688,25 +4623,36 @@ pushclass (type, modify)
tree type;
int modify;
{
- push_memoized_context (type, modify);
+ type = TYPE_MAIN_VARIANT (type);
- current_class_depth++;
- *current_class_stack++ = current_class_name;
- *current_class_stack++ = current_class_type;
- if (current_class_stack >= current_class_base + current_class_stacksize)
- {
- current_class_base
- = (tree *)xrealloc (current_class_base,
- sizeof (tree) * (current_class_stacksize + 10));
- current_class_stack = current_class_base + current_class_stacksize;
- current_class_stacksize += 10;
+ /* Make sure there is enough room for the new entry on the stack. */
+ if (current_class_depth + 1 >= current_class_stack_size)
+ {
+ current_class_stack_size *= 2;
+ current_class_stack
+ = (class_stack_node_t) xrealloc (current_class_stack,
+ current_class_stack_size
+ * sizeof (struct class_stack_node));
}
+ /* Insert a new entry on the class stack. */
+ current_class_stack[current_class_depth].name = current_class_name;
+ current_class_stack[current_class_depth].type = current_class_type;
+ current_class_stack[current_class_depth].access = current_access_specifier;
+ current_class_depth++;
+
+ /* Now set up the new type. */
current_class_name = TYPE_NAME (type);
if (TREE_CODE (current_class_name) == TYPE_DECL)
current_class_name = DECL_NAME (current_class_name);
current_class_type = type;
+ /* By default, things in classes are private, while things in
+ structures or unions are public. */
+ current_access_specifier = (CLASSTYPE_DECLARED_CLASS (type)
+ ? access_private_node
+ : access_public_node);
+
if (previous_class_type != NULL_TREE
&& (type != previous_class_type || TYPE_SIZE (previous_class_type) == NULL_TREE)
&& current_class_depth == 1)
@@ -4766,10 +4712,16 @@ pushclass (type, modify)
for (tags = CLASSTYPE_TAGS (type); tags; tags = TREE_CHAIN (tags))
{
- TREE_NONLOCAL_FLAG (TREE_VALUE (tags)) = 1;
+ tree tag_type = TREE_VALUE (tags);
+
+ TREE_NONLOCAL_FLAG (tag_type) = 1;
if (! TREE_PURPOSE (tags))
continue;
- pushtag (TREE_PURPOSE (tags), TREE_VALUE (tags), 0);
+ if (! (IS_AGGR_TYPE_CODE (TREE_CODE (tag_type))
+ && CLASSTYPE_IS_TEMPLATE (tag_type)))
+ pushtag (TREE_PURPOSE (tags), tag_type, 0);
+ else
+ pushdecl_class_level (CLASSTYPE_TI_TEMPLATE (tag_type));
}
current_function_decl = this_fndecl;
@@ -4828,15 +4780,29 @@ popclass (modify)
pop_class_decls ();
current_class_depth--;
- current_class_type = *--current_class_stack;
- current_class_name = *--current_class_stack;
-
- pop_memoized_context (modify);
+ current_class_name = current_class_stack[current_class_depth].name;
+ current_class_type = current_class_stack[current_class_depth].type;
+ current_access_specifier = current_class_stack[current_class_depth].access;
ret:
;
}
+/* Returns 1 if current_class_type is either T or a nested type of T. */
+
+int
+currently_open_class (t)
+ tree t;
+{
+ int i;
+ if (t == current_class_type)
+ return 1;
+ for (i = 0; i < current_class_depth; ++i)
+ if (current_class_stack [i].type == t)
+ return 1;
+ return 0;
+}
+
/* When entering a class scope, all enclosing class scopes' names with
static meaning (static variables, static functions, types and enumerators)
have to be visible. This recursive function calls pushclass for all
@@ -4851,6 +4817,8 @@ push_nested_class (type, modify)
{
tree context;
+ my_friendly_assert (!type || TREE_CODE (type) != NAMESPACE_DECL, 980711);
+
if (type == NULL_TREE || type == error_mark_node || ! IS_AGGR_TYPE (type)
|| TREE_CODE (type) == TEMPLATE_TYPE_PARM
|| TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM)
@@ -4913,7 +4881,8 @@ void
pop_lang_context ()
{
current_lang_name = *--current_lang_stack;
- if (current_lang_name == lang_name_cplusplus)
+ if (current_lang_name == lang_name_cplusplus
+ || current_lang_name == lang_name_java)
strict_prototype = strict_prototypes_lang_cplusplus;
else if (current_lang_name == lang_name_c)
strict_prototype = strict_prototypes_lang_c;
@@ -4921,6 +4890,29 @@ pop_lang_context ()
/* Type instantiation routines. */
+static tree
+validate_lhs (lhstype, complain)
+ tree lhstype;
+ int complain;
+{
+ if (TYPE_PTRMEMFUNC_P (lhstype))
+ lhstype = TYPE_PTRMEMFUNC_FN_TYPE (lhstype);
+
+ if (TREE_CODE (lhstype) == POINTER_TYPE)
+ {
+ if (TREE_CODE (TREE_TYPE (lhstype)) == FUNCTION_TYPE
+ || TREE_CODE (TREE_TYPE (lhstype)) == METHOD_TYPE)
+ lhstype = TREE_TYPE (lhstype);
+ else
+ {
+ if (complain)
+ error ("invalid type combination for overload");
+ return error_mark_node;
+ }
+ }
+ return lhstype;
+}
+
/* This function will instantiate the type of the expression given in
RHS to match the type of LHSTYPE. If errors exist, then return
error_mark_node. If only complain is COMPLAIN is set. If we are
@@ -4937,6 +4929,7 @@ instantiate_type (lhstype, rhs, complain)
int complain;
{
tree explicit_targs = NULL_TREE;
+ int template_only = 0;
if (TREE_CODE (lhstype) == UNKNOWN_TYPE)
{
@@ -4955,7 +4948,10 @@ instantiate_type (lhstype, rhs, complain)
return error_mark_node;
}
- rhs = copy_node (rhs);
+ /* We don't overwrite rhs if it is an overloaded function.
+ Copying it would destroy the tree link. */
+ if (TREE_CODE (rhs) != OVERLOAD)
+ rhs = copy_node (rhs);
/* This should really only be used when attempting to distinguish
what sort of a pointer to function we have. For now, any
@@ -5016,6 +5012,9 @@ instantiate_type (lhstype, rhs, complain)
return function;
}
+ /* I could not trigger this code. MvL */
+ my_friendly_abort (980326);
+#if 0
my_friendly_assert (TREE_CODE (field) == FIELD_DECL, 178);
my_friendly_assert (!(TREE_CODE (TREE_TYPE (field)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (field)) == METHOD_TYPE),
@@ -5056,172 +5055,194 @@ instantiate_type (lhstype, rhs, complain)
error ("no appropriate overload exists for COMPONENT_REF");
return error_mark_node;
}
+#endif
return rhs;
}
+ case OFFSET_REF:
+ /* This can happen if we are forming a pointer-to-member for a
+ member template. */
+ rhs = TREE_OPERAND (rhs, 1);
+ my_friendly_assert (TREE_CODE (rhs) == TEMPLATE_ID_EXPR, 0);
+
+ /* Fall through. */
+
case TEMPLATE_ID_EXPR:
{
explicit_targs = TREE_OPERAND (rhs, 1);
+ template_only = 1;
rhs = TREE_OPERAND (rhs, 0);
}
- /* fall through */
+ /* fall through */
+ my_friendly_assert (TREE_CODE (rhs) == OVERLOAD, 980401);
- case TREE_LIST:
+ case OVERLOAD:
{
- tree elem, baselink, name = NULL_TREE;
- int globals = overloaded_globals_p (rhs);
-
- /* First look for an exact match. Search either overloaded
- functions or member functions. May have to undo what
- `default_conversion' might do to lhstype. */
+ tree elem, elems;
- if (TYPE_PTRMEMFUNC_P (lhstype))
- lhstype = TYPE_PTRMEMFUNC_FN_TYPE (lhstype);
-
- if (TREE_CODE (lhstype) == POINTER_TYPE)
- {
- if (TREE_CODE (TREE_TYPE (lhstype)) == FUNCTION_TYPE
- || TREE_CODE (TREE_TYPE (lhstype)) == METHOD_TYPE)
- lhstype = TREE_TYPE (lhstype);
- else
- {
- if (complain)
- error ("invalid type combination for overload");
- return error_mark_node;
- }
- }
+ /* Check that the LHSTYPE and the RHS are reasonable. */
+ lhstype = validate_lhs (lhstype, complain);
+ if (lhstype == error_mark_node)
+ return lhstype;
- if (TREE_CODE (lhstype) != FUNCTION_TYPE && globals > 0)
+ if (TREE_CODE (lhstype) != FUNCTION_TYPE
+ && TREE_CODE (lhstype) != METHOD_TYPE)
{
if (complain)
- cp_error ("cannot resolve overloaded function `%D' based on non-function type",
- TREE_PURPOSE (rhs));
+ cp_error("cannot resolve overloaded function `%D' "
+ "based on non-function type",
+ DECL_NAME (OVL_FUNCTION (rhs)));
return error_mark_node;
}
-
- if (globals > 0)
+
+ /* Look for an exact match, by searching through the
+ overloaded functions. */
+ if (template_only)
+ /* If we're processing a template-id, only a template
+ function can match, so we don't look through the
+ overloaded functions. */
+ ;
+ else for (elems = rhs; elems; elems = OVL_CHAIN (elems))
{
- elem = get_first_fn (rhs);
- /* If there are explicit_targs, only a template function
- can match. */
- if (explicit_targs == NULL_TREE)
- while (elem)
- {
- if (! comptypes (lhstype, TREE_TYPE (elem), 1))
- elem = DECL_CHAIN (elem);
- else
- {
- mark_used (elem);
- return elem;
- }
- }
+ elem = OVL_FUNCTION (elems);
+ if (comptypes (lhstype, TREE_TYPE (elem), 1))
+ {
+ mark_used (elem);
+ return elem;
+ }
+ }
- /* No exact match found, look for a compatible template. */
- {
- tree save_elem = 0;
- for (elem = get_first_fn (rhs); elem; elem = DECL_CHAIN (elem))
- if (TREE_CODE (elem) == TEMPLATE_DECL)
+ /* No overloaded function was an exact match. See if we can
+ instantiate some template to match. */
+ {
+ tree save_elem = 0;
+ elems = rhs;
+ if (TREE_CODE (elems) == TREE_LIST)
+ elems = TREE_VALUE (rhs);
+ for (; elems; elems = OVL_NEXT (elems))
+ if (TREE_CODE (elem = OVL_CURRENT (elems)) == TEMPLATE_DECL)
+ {
+ int n = DECL_NTPARMS (elem);
+ tree t = make_scratch_vec (n);
+ int i;
+ i = type_unification
+ (DECL_INNERMOST_TEMPLATE_PARMS (elem), t,
+ TYPE_ARG_TYPES (TREE_TYPE (elem)),
+ TYPE_ARG_TYPES (lhstype), explicit_targs, DEDUCE_EXACT, 1);
+ if (i == 0)
{
- int n = DECL_NTPARMS (elem);
- tree t = make_scratch_vec (n);
- int i;
- i = type_unification
- (DECL_INNERMOST_TEMPLATE_PARMS (elem), t,
- TYPE_ARG_TYPES (TREE_TYPE (elem)),
- TYPE_ARG_TYPES (lhstype), explicit_targs, 1, 1);
- if (i == 0)
+ if (save_elem)
{
- if (save_elem)
- {
- cp_error ("ambiguous template instantiation converting to `%#T'", lhstype);
- return error_mark_node;
- }
- save_elem = instantiate_template (elem, t);
- /* Check the return type. */
- if (! comptypes (TREE_TYPE (lhstype),
- TREE_TYPE (TREE_TYPE (save_elem)), 1))
- save_elem = 0;
+ cp_error ("ambiguous template instantiation converting to `%#T'", lhstype);
+ return error_mark_node;
}
+ save_elem = instantiate_template (elem, t);
+ /* Check the return type. */
+ if (! comptypes (TREE_TYPE (lhstype),
+ TREE_TYPE (TREE_TYPE (save_elem)), 1))
+ save_elem = 0;
}
- if (save_elem)
- {
- mark_used (save_elem);
- return save_elem;
- }
+ }
+ if (save_elem)
+ {
+ mark_used (save_elem);
+ return save_elem;
}
+ }
- /* If there are explicit_targs, only a template function
- can match. */
- if (explicit_targs == NULL_TREE)
+ /* There's no exact match, and no templates can be
+ instantiated to match. The last thing we try is to see if
+ some ordinary overloaded function is close enough. If
+ we're only looking for template functions, we don't do
+ this. */
+ if (!template_only)
+ {
+ for (elems = rhs; elems; elems = OVL_NEXT (elems))
{
- /* No match found, look for a compatible function. */
- elem = get_first_fn (rhs);
- while (elem && comp_target_types (lhstype,
- TREE_TYPE (elem), 1) <= 0)
- elem = DECL_CHAIN (elem);
- if (elem)
+ elem = OVL_CURRENT (elems);
+ if (comp_target_types (lhstype, TREE_TYPE (elem), 1) > 0)
+ break;
+ }
+ if (elems)
+ {
+ tree save_elem = elem;
+ for (elems = OVL_CHAIN (elems); elems;
+ elems = OVL_CHAIN (elems))
+ {
+ elem = OVL_FUNCTION (elems);
+ if (comp_target_types (lhstype, TREE_TYPE (elem), 0) > 0)
+ break;
+ }
+ if (elems)
{
- tree save_elem = elem;
- elem = DECL_CHAIN (elem);
- while (elem
- && comp_target_types (lhstype,
- TREE_TYPE (elem), 0) <= 0)
- elem = DECL_CHAIN (elem);
- if (elem)
+ if (complain)
{
- if (complain)
- {
- cp_error
- ("cannot resolve overload to target type `%#T'",
- lhstype);
- cp_error_at (" ambiguity between `%#D'",
- save_elem);
- cp_error_at (" and `%#D', at least", elem);
- }
- return error_mark_node;
+ cp_error
+ ("cannot resolve overload to target type `%#T'",
+ lhstype);
+ cp_error_at (" ambiguity between `%#D'", save_elem);
+ cp_error_at (" and `%#D', at least", elem);
}
- mark_used (save_elem);
- return save_elem;
+ return error_mark_node;
}
+ mark_used (save_elem);
+ return save_elem;
}
- if (complain)
- {
- cp_error ("cannot resolve overload to target type `%#T'",
- lhstype);
- cp_error
- (" because no suitable overload of function `%D' exists",
- TREE_PURPOSE (rhs));
- }
- return error_mark_node;
}
- if (TREE_NONLOCAL_FLAG (rhs))
+ /* We failed to find a match. */
+ if (complain)
{
- /* Got to get it as a baselink. */
- rhs = lookup_fnfields (TYPE_BINFO (current_class_type),
- TREE_PURPOSE (rhs), 0);
+ cp_error ("cannot resolve overload to target type `%#T'", lhstype);
+ cp_error
+ (" because no suitable overload of function `%D' exists",
+ DECL_NAME (OVL_FUNCTION (rhs)));
}
- else
+ return error_mark_node;
+ }
+
+ case TREE_LIST:
+ {
+ tree elem, baselink, name = NULL_TREE;
+
+ if (TREE_PURPOSE (rhs) == error_mark_node)
{
- my_friendly_assert (TREE_CHAIN (rhs) == NULL_TREE, 181);
- if (TREE_CODE (TREE_VALUE (rhs)) == TREE_LIST)
- rhs = TREE_VALUE (rhs);
- my_friendly_assert (TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL,
- 182);
+ /* Make sure we don't drop the non-local flag, as the old code
+ would rely on it. */
+ int nl = TREE_NONLOCAL_FLAG (rhs);
+ /* We don't need the type of this node. */
+ rhs = TREE_VALUE (rhs);
+ my_friendly_assert (TREE_NONLOCAL_FLAG (rhs) == nl, 980331);
}
+ /* Now we should have a baselink. */
+ my_friendly_assert (TREE_CODE (TREE_PURPOSE (rhs)) == TREE_VEC,
+ 980331);
+ /* First look for an exact match. Search member functions.
+ May have to undo what `default_conversion' might do to
+ lhstype. */
+
+ lhstype = validate_lhs (lhstype, complain);
+ if (lhstype == error_mark_node)
+ return lhstype;
+
+ my_friendly_assert (TREE_CHAIN (rhs) == NULL_TREE, 181);
+ my_friendly_assert (TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL
+ || TREE_CODE (TREE_VALUE (rhs)) == OVERLOAD,
+ 182);
+
for (baselink = rhs; baselink;
baselink = next_baselink (baselink))
{
elem = TREE_VALUE (baselink);
while (elem)
- if (comptypes (lhstype, TREE_TYPE (elem), 1))
+ if (comptypes (lhstype, TREE_TYPE (OVL_CURRENT (elem)), 1))
{
- mark_used (elem);
- return elem;
+ mark_used (OVL_CURRENT (elem));
+ return OVL_CURRENT (elem);
}
else
- elem = DECL_CHAIN (elem);
+ elem = OVL_NEXT (elem);
}
/* No exact match found, look for a compatible method. */
@@ -5229,16 +5250,17 @@ instantiate_type (lhstype, rhs, complain)
baselink = next_baselink (baselink))
{
elem = TREE_VALUE (baselink);
- while (elem && comp_target_types (lhstype,
- TREE_TYPE (elem), 1) <= 0)
- elem = DECL_CHAIN (elem);
+ for (; elem; elem = OVL_NEXT (elem))
+ if (comp_target_types (lhstype,
+ TREE_TYPE (OVL_CURRENT (elem)), 1) > 0)
+ break;
if (elem)
{
- tree save_elem = elem;
- elem = DECL_CHAIN (elem);
- while (elem && comp_target_types (lhstype,
- TREE_TYPE (elem), 0) <= 0)
- elem = DECL_CHAIN (elem);
+ tree save_elem = OVL_CURRENT (elem);
+ for (elem = OVL_NEXT (elem); elem; elem = OVL_NEXT (elem))
+ if (comp_target_types (lhstype,
+ TREE_TYPE (OVL_CURRENT (elem)), 0) > 0)
+ break;
if (elem)
{
if (complain)
@@ -5248,7 +5270,10 @@ instantiate_type (lhstype, rhs, complain)
mark_used (save_elem);
return save_elem;
}
- name = DECL_NAME (TREE_VALUE (rhs));
+ name = rhs;
+ while (TREE_CODE (name) == TREE_LIST)
+ name = TREE_VALUE (name);
+ name = DECL_NAME (OVL_CURRENT (name));
#if 0
if (TREE_CODE (lhstype) == FUNCTION_TYPE && globals < 0)
{
@@ -5478,7 +5503,6 @@ build_self_reference ()
DECL_NONLOCAL (value) = 1;
DECL_CONTEXT (value) = current_class_type;
DECL_CLASS_CONTEXT (value) = current_class_type;
- CLASSTYPE_LOCAL_TYPEDECLS (current_class_type) = 1;
DECL_ARTIFICIAL (value) = 1;
pushdecl_class_level (value);
@@ -5493,6 +5517,9 @@ is_empty_class (type)
{
tree t;
+ if (type == error_mark_node)
+ return 0;
+
if (! IS_AGGR_TYPE (type))
return 0;
@@ -5506,3 +5533,49 @@ is_empty_class (type)
t = TREE_CHAIN (t);
return (t == NULL_TREE);
}
+
+/* Find the enclosing class of the given NODE. NODE can be a *_DECL or
+ a *_TYPE node. NODE can also be a local class. */
+
+tree
+get_enclosing_class (type)
+ tree type;
+{
+ tree node = type;
+
+ while (node && TREE_CODE (node) != NAMESPACE_DECL)
+ {
+ switch (TREE_CODE_CLASS (TREE_CODE (node)))
+ {
+ case 'd':
+ node = DECL_CONTEXT (node);
+ break;
+
+ case 't':
+ if (node != type)
+ return node;
+ node = TYPE_CONTEXT (node);
+ break;
+
+ default:
+ my_friendly_abort (0);
+ }
+ }
+ return NULL_TREE;
+}
+
+/* Return 1 if TYPE or one of its enclosing classes is derived from BASE. */
+
+int
+is_base_of_enclosing_class (base, type)
+ tree base, type;
+{
+ while (type)
+ {
+ if (get_binfo (base, type, 0))
+ return 1;
+
+ type = get_enclosing_class (type);
+ }
+ return 0;
+}
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 2f7f938b239..20a0117c160 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -29,6 +29,11 @@ Boston, MA 02111-1307, USA. */
just won't work for us. */
DEFTREECODE (OFFSET_REF, "offset_ref", 'r', 2)
+/* A pointer-to-member constant. For a pointer-to-member constant
+ `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the
+ PTRMEM_CST_MEMBER is the _DECL for `Y'. */
+DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 1)
+
/* For NEW_EXPR, operand 0 is the placement list.
Operand 1 is the new-declarator.
Operand 2 is the initializer. */
@@ -163,20 +168,33 @@ DEFTREECODE (DEFAULT_ARG, "default_arg", 'c', 2)
template will be a FUNCTION_DECL, TEMPLATE_DECL, or a list of
overloaded functions and templates if the template-id refers to
a global template. If the template-id refers to a member template,
- the template will be an IDENTIFIER_NODE. */
+ the template may be an IDENTIFIER_NODE. */
DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", 'e', 2)
-/* has two fields: scope and value */
-/* XXX: could recycle some of the common fields */
+/* An association between namespace and entity. Parameters are the
+ scope and the (non-type) value.
+ TREE_TYPE indicates the type bound to the name. */
DEFTREECODE (CPLUS_BINDING, "binding", 'x', 2)
+/* A list-like node for chaining overloading candidates. TREE_TYPE is
+ the original name, and the parameter is the FUNCTION_DECL. */
+DEFTREECODE (OVERLOAD, "overload", 'x', 1)
+
/* A generic wrapper for something not tree that we want to include in
tree structure. */
DEFTREECODE (WRAPPER, "wrapper", 'x', 1)
+/* A node to remember a source position. */
+DEFTREECODE (SRCLOC, "srcloc", 'x', 2)
+
+/* Used to represent deferred name lookup for dependent names while
+ parsing a template declaration. The first argument is an
+ IDENTIFIER_NODE for the name in question. The TREE_TYPE is
+ unused. */
+DEFTREECODE (LOOKUP_EXPR, "lookup_expr", 'e', 1)
+
/* A whole bunch of tree codes for the initial, superficial parsing of
templates. */
-DEFTREECODE (LOOKUP_EXPR, "lookup_expr", 'e', 2)
DEFTREECODE (MODOP_EXPR, "modop_expr", 'e', 3)
DEFTREECODE (CAST_EXPR, "cast_expr", '1', 1)
DEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", '1', 1)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 562ce84e68a..14298ff6b00 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -24,6 +24,57 @@ Boston, MA 02111-1307, USA. */
#include "gansidecl.h"
+/* Usage of TREE_LANG_FLAG_?:
+ 0: TREE_NONLOCAL_FLAG (in TREE_LIST or _TYPE).
+ BINFO_MARKED (BINFO nodes).
+ COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
+ NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
+ DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
+ LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
+ TREE_NEGATED_INT (in INTEGER_CST).
+ (TREE_MANGLED) (in IDENTIFIER_NODE) (commented-out).
+ 1: IDENTIFIER_VIRTUAL_P.
+ TI_PENDING_TEMPLATE_FLAG.
+ TEMPLATE_PARMS_FOR_INLINE.
+ DELETE_EXPR_USE_VEC (in DELETE_EXPR).
+ (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
+ TYPE_USES_COMPLEX_INHERITANCE (in _TYPE).
+ C_DECLARED_LABEL_FLAG.
+ 2: IDENTIFIER_OPNAME_P.
+ BINFO_VBASE_MARKED.
+ BINFO_FIELDS_MARKED.
+ TYPE_VIRTUAL_P.
+ PARM_DECL_EXPR (in SAVE_EXPR).
+ 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
+ BINFO_VTABLE_PATH_MARKED.
+ BINFO_PUSHDECLS_MARKED.
+ (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
+ 4: BINFO_NEW_VTABLE_MARKED.
+ TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
+ or FIELD_DECL).
+ 5: Not used.
+ 6: Not used.
+
+ Usage of TYPE_LANG_FLAG_?:
+ 0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
+ 1: TYPE_HAS_CONSTRUCTOR.
+ 2: TYPE_HAS_DESTRUCTOR.
+ 3: TYPE_FOR_JAVA.
+ 4: TYPE_NEEDS_DESTRUCTOR.
+ 5: IS_AGGR_TYPE.
+ 6: TYPE_BUILT_IN.
+
+ Usage of DECL_LANG_FLAG_?:
+ 0: DECL_ERROR_REPORTED (in VAR_DECL).
+ 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
+ 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
+ 3: DECL_IN_AGGR_P.
+ 4: DECL_MAYBE_TEMPLATE.
+ 5: DECL_INTERFACE_KNOWN.
+ 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
+ 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
+*/
+
/* Language-dependent contents of an identifier. */
struct lang_identifier
@@ -58,13 +109,29 @@ typedef struct
tree decl;
} template_parm_index;
-#define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope)
-#define BINDING_VALUE(NODE) (((struct tree_binding*)NODE)->value)
-#define NAMESPACE_BINDING(ID,NS) BINDING_VALUE (binding_for_name (ID, NS))
+typedef struct ptrmem_cst
+{
+ char common[sizeof (struct tree_common)];
+ tree member;
+}* ptrmem_cst_t;
+
+/* For a binding between a name and an entity, defines the scope
+ where the binding is declared. Currently always points to a
+ namespace declaration. */
+#define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope)
+/* This is the declaration bound to the name. Possible values:
+ variable, overloaded function, namespace, template, enumerator. */
+#define BINDING_VALUE(NODE) (((struct tree_binding*)NODE)->value)
+/* If name is bound to a type, this is the type (struct, union, enum). */
+#define BINDING_TYPE(NODE) TREE_TYPE(NODE)
#define IDENTIFIER_GLOBAL_VALUE(NODE) \
- NAMESPACE_BINDING (NODE, global_namespace)
+ namespace_binding (NODE, global_namespace)
+#define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
+ set_namespace_binding (NODE, global_namespace, VAL)
#define IDENTIFIER_NAMESPACE_VALUE(NODE) \
- NAMESPACE_BINDING (NODE, current_namespace)
+ namespace_binding (NODE, current_namespace)
+#define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
+ set_namespace_binding (NODE, current_namespace, VAL)
struct tree_binding
{
@@ -73,6 +140,25 @@ struct tree_binding
tree value;
};
+/* The overloaded FUNCTION_DECL. */
+#define OVL_FUNCTION(NODE) (((struct tree_overload*)NODE)->function)
+#define OVL_CHAIN(NODE) TREE_CHAIN(NODE)
+/* Polymorphic access to FUNCTION and CHAIN. */
+#define OVL_CURRENT(NODE) \
+ ((TREE_CODE(NODE)==OVERLOAD) ? OVL_FUNCTION(NODE) : NODE)
+#define OVL_NEXT(NODE) \
+ ((TREE_CODE(NODE)==OVERLOAD) ? TREE_CHAIN(NODE) : NULL_TREE)
+/* If set, this was imported in a using declaration.
+ This is not to confuse with being used somewhere, which
+ is not important for this node. */
+#define OVL_USED(NODE) TREE_USED(NODE)
+
+struct tree_overload
+{
+ char common[sizeof (struct tree_common)];
+ tree function;
+};
+
#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)NODE)->u.ptr)
#define WRAPPER_INT(NODE) (((struct tree_wrapper*)NODE)->u.i)
@@ -85,6 +171,15 @@ struct tree_wrapper
} u;
};
+#define SRCLOC_FILE(NODE) (((struct tree_srcloc*)NODE)->filename)
+#define SRCLOC_LINE(NODE) (((struct tree_srcloc*)NODE)->linenum)
+struct tree_srcloc
+{
+ char common[sizeof (struct tree_common)];
+ char *filename;
+ int linenum;
+};
+
/* To identify to the debug emitters if it should pay attention to the
flag `-Wtemplate-debugging'. */
#define HAVE_TEMPLATES 1
@@ -100,9 +195,14 @@ struct tree_wrapper
#define IDENTIFIER_TEMPLATE(NODE) \
(((struct lang_identifier *)(NODE))->class_template_info)
-#define IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
+/* TREE_TYPE only indicates on local and class scope the current
+ type. For namespace scope, the presence of a type in any namespace
+ is indicated with global_type_node, and the real type behind must
+ be found through lookup. */
+#define IDENTIFIER_TYPE_VALUE(NODE) (identifier_type_value(NODE))
+#define REAL_IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))
#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)
-#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (TREE_TYPE (NODE) ? 1 : 0)
+#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
#define LANG_ID_FIELD(NAME,NODE) \
(((struct lang_identifier *)(NODE))->x \
@@ -185,6 +285,15 @@ extern tree intSI_type_node, unsigned_intSI_type_node;
extern tree intDI_type_node, unsigned_intDI_type_node;
extern tree intTI_type_node, unsigned_intTI_type_node;
+extern tree java_byte_type_node;
+extern tree java_short_type_node;
+extern tree java_int_type_node;
+extern tree java_long_type_node;
+extern tree java_float_type_node;
+extern tree java_double_type_node;
+extern tree java_char_type_node;
+extern tree java_boolean_type_node;
+
extern int current_function_returns_value;
extern int current_function_returns_null;
extern tree current_function_return_value;
@@ -225,6 +334,10 @@ extern int flag_no_ident;
extern int warn_implicit;
+/* Nonzero means warn about usage of long long when `-pedantic'. */
+
+extern int warn_long_long;
+
/* Nonzero means warn when all ctors or dtors are private, and the class
has no friends. */
@@ -235,9 +348,13 @@ extern int warn_ctor_dtor_privacy;
extern int warn_return_type;
-/* Nonzero means give string constants the type `const char *'
- to get extra warnings from them. These warnings will be too numerous
- to be useful, except in thoroughly ANSIfied programs. */
+/* Nonzero means give string constants the type `const char *', as mandated
+ by the standard. */
+
+extern int flag_const_strings;
+
+/* Nonzero means warn about deprecated conversion from string constant to
+ `char *'. */
extern int warn_write_strings;
@@ -361,6 +478,17 @@ extern int flag_guiding_decls;
and class qualifiers. */
extern int flag_do_squangling;
+/* Nonzero if we want to issue diagnostics that the standard says are not
+ required. */
+extern int flag_optional_diags;
+
+/* Nonzero means do not consider empty argument prototype to mean function
+ takes no arguments. */
+
+extern int flag_strict_prototype;
+
+/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
+extern int flag_vtable_gc;
/* C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
@@ -384,7 +512,17 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* The _DECL for this _TYPE. */
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
+/* Nonzero if T is a class (or struct or union) type. Also nonzero
+ for template type parameters and typename types. Despite its name,
+ this macro has nothing to do with the definition of aggregate given
+ in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
#define IS_AGGR_TYPE(t) (TYPE_LANG_FLAG_5 (t))
+
+/* Nonzero if T is a class type. Zero for template type parameters,
+ typename types, and so forth. */
+#define CLASS_TYPE_P(t) \
+ (IS_AGGR_TYPE (t) && IS_AGGR_TYPE_CODE (TREE_CODE (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) \
@@ -395,6 +533,9 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* In a *_TYPE, nonzero means a built-in type. */
#define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
+/* True if this a "Java" type, defined in 'extern "Java"'. */
+#define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3(NODE)
+
#define DELTA_FROM_VTABLE_ENTRY(ENTRY) \
(!flag_vtable_thunks ? \
TREE_VALUE (CONSTRUCTOR_ELTS (ENTRY)) \
@@ -451,7 +592,6 @@ struct lang_type
unsigned has_call_overloaded : 1;
unsigned has_array_ref_overloaded : 1;
unsigned has_arrow_overloaded : 1;
- unsigned local_typedecls : 1;
unsigned interface_only : 1;
unsigned interface_unknown : 1;
@@ -490,12 +630,9 @@ struct lang_type
/* The MIPS compiler gets it wrong if this struct also
does not fill out to a multiple of 4 bytes. Add a
member `dummy' with new bits if you go over the edge. */
- unsigned dummy : 11;
+ unsigned dummy : 12;
} type_flags;
-#ifdef MI_MATRIX
- int cid;
-#endif
int n_ancestors;
int n_vancestors;
int vsize;
@@ -507,7 +644,6 @@ struct lang_type
union tree_node *vbases;
union tree_node *tags;
- char *memoized_table_entry;
union tree_node *search_slot;
@@ -523,10 +659,6 @@ struct lang_type
union tree_node *binfo_as_list;
union tree_node *friend_classes;
-#ifdef MI_MATRIX
- char *mi_matrix;
-#endif
-
union tree_node *rtti;
union tree_node *methods;
@@ -659,7 +791,12 @@ struct lang_type
hierarchy, then we can use more efficient search techniques. */
#define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE))
-/* List of lists of member functions defined in this class. */
+/* Vector member functions defined in this class. Each element is
+ either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. The first
+ two elements are for constructors, and destructors, respectively.
+ Any user-defined conversion operators follow these. These are
+ followed by ordinary member functions. There may be empty entries
+ at the end of the vector. */
#define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods)
/* The first type conversion operator in the class (the others can be
@@ -695,6 +832,10 @@ struct lang_type
#define SET_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 1)
#define CLEAR_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 0)
+/* A list of the nested tag-types (class, struct, union, or enum)
+ found within this class. The TREE_PURPOSE of each node is the name
+ of the type; the TREE_VALUE is the type itself. This list includes
+ nested member class templates. */
#define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags)
/* If this class has any bases, this is the number of the base class from
@@ -720,7 +861,7 @@ struct lang_type
#define CLASSTYPE_N_BASECLASSES(NODE) \
(TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
-/* Memoize the number of super classes (base classes) tha this node
+/* Memoize the number of super classes (base classes) that this node
has. That way we can know immediately (albeit conservatively how
large a multiple-inheritance matrix we need to build to find
derivation information. */
@@ -735,11 +876,6 @@ struct lang_type
which uses this must define what exactly this slot is used for. */
#define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
-/* Entry for keeping memoization tables for this type to
- hopefully speed up search routines. Since it is a pointer,
- it can mean almost anything. */
-#define CLASSTYPE_MTABLE_ENTRY(NODE) (TYPE_LANG_SPECIFIC(NODE)->memoized_table_entry)
-
/* These are the size, mode and alignment of the type without its
virtual base classes, for when we use this type as a base itself. */
#define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
@@ -774,9 +910,6 @@ struct lang_type
the virtual function table will be written out. */
#define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing)
-/* Nonzero means that this type defines its own local type declarations. */
-#define CLASSTYPE_LOCAL_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.local_typedecls)
-
/* Nonzero means that this type has an X() constructor. */
#define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor)
@@ -798,15 +931,11 @@ struct lang_type
/* Same, but cache a list whose value is the binfo of this type. */
#define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list)
-/* A list of class types with which this type is a friend. */
+/* A list of class types with which this type is a friend. The
+ TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
+ case of a template friend. */
#define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes)
-#ifdef MI_MATRIX
-/* Keep an inheritance lattice around so we can quickly tell whether
- a type is derived from another or not. */
-#define CLASSTYPE_MI_MATRIX(NODE) (TYPE_LANG_SPECIFIC(NODE)->mi_matrix)
-#endif
-
/* Say whether this node was declared as a "class" or a "struct". */
#define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class)
@@ -832,17 +961,15 @@ struct lang_type
/* Additional macros for inheritance information. */
-/* When following an binfo-specific chain, this is the cumulative
- via-public flag. */
-#define BINFO_VIA_PUBLIC(NODE) TREE_LANG_FLAG_5 (NODE)
+/* The BINFO_INHERITANCE_CHAIN is used opposite to the description in
+ gcc/tree.h. In particular if D is derived from B then the BINFO
+ for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
+ D. In tree.h, this pointer is described as pointing in other
+ direction.
-#ifdef MI_MATRIX
-/* When building a matrix to determine by a single lookup
- whether one class is derived from another or not,
- this field is the index of the class in the table. */
-#define CLASSTYPE_CID(NODE) (TYPE_LANG_SPECIFIC(NODE)->cid)
-#define BINFO_CID(NODE) CLASSTYPE_CID(BINFO_TYPE(NODE))
-#endif
+ After a call to get_vbase_types, the vbases are chained together in
+ depth-first order via TREE_CHAIN. Other than that, TREE_CHAIN is
+ unused. */
/* Nonzero means marked by DFS or BFS search, including searches
by `get_binfo' and `get_base_distance'. */
@@ -852,12 +979,6 @@ struct lang_type
#define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1))
#define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0))
-/* Nonzero means marked in building initialization list. */
-#define BINFO_BASEINIT_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
-/* Modifier macros */
-#define SET_BINFO_BASEINIT_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
-#define CLEAR_BINFO_BASEINIT_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
-
/* Nonzero means marked in search through virtual inheritance hierarchy. */
#define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE))
/* Modifier macros */
@@ -882,11 +1003,10 @@ struct lang_type
#define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1))
#define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0))
-/* Nonzero means this class has initialized its virtual baseclasses. */
-#define BINFO_VBASE_INIT_MARKED(NODE) \
- (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):TREE_LANG_FLAG_5(NODE))
-#define SET_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=1))
-#define CLEAR_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=0))
+/* Nonzero means this class has done dfs_pushdecls. */
+#define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
+#define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE)
+#define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE)
/* Accessor macros for the vfield slots in structures. */
@@ -950,7 +1070,6 @@ struct lang_decl_flags
tree memfunc_pointer_to;
tree template_info;
struct binding_level *level;
- tree in_namespace;
};
struct lang_decl
@@ -959,7 +1078,6 @@ struct lang_decl
tree main_decl_variant;
struct pending_inline *pending_inline_info;
- tree chain;
};
/* Non-zero if NODE is a _DECL with TREE_READONLY set. */
@@ -980,6 +1098,8 @@ struct lang_decl
/* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
#define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
+#define DECL_DESTRUCTOR_P(NODE) (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME(NODE)))
+
/* For FUNCTION_DECLs: nonzero means that this function is a constructor
for an object with virtual baseclasses. */
#define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
@@ -1063,25 +1183,38 @@ struct lang_decl
#define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context)
#define DECL_REAL_CONTEXT(NODE) \
((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \
- ? DECL_CLASS_CONTEXT (NODE) : DECL_CONTEXT (NODE))
+ ? DECL_CLASS_CONTEXT (NODE) : CP_DECL_CONTEXT (NODE))
+
+/* NULL_TREE in DECL_CONTEXT represents the global namespace. */
+#define CP_DECL_CONTEXT(NODE) \
+ (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
+#define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE))
+
+/* 1 iff NODE has namespace scope, including the global namespace. */
+#define DECL_NAMESPACE_SCOPE_P(NODE) \
+ (DECL_CONTEXT (NODE) == NULL_TREE \
+ || TREE_CODE (DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
-/* For a FUNCTION_DECL: the chain through which the next method
- with the same name is found. We now use TREE_CHAIN to
- walk through the methods in order of declaration.
- For a NAMESPACE_DECL: the list of using namespace directives
+/* 1 iff NODE is a class member. */
+#define DECL_CLASS_SCOPE_P(NODE) \
+ (DECL_CONTEXT (NODE) \
+ && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (NODE))) == 't')
+
+/* For a NAMESPACE_DECL: the list of using namespace directives
The PURPOSE is the used namespace, the value is the namespace
- that is the common ancestor */
-#if 1
-#define DECL_CHAIN(NODE) (DECL_LANG_SPECIFIC(NODE)->chain)
-#else
-#define DECL_CHAIN(NODE) (TREE_CHAIN (NODE))
-#endif
-#define DECL_NAMESPACE_USING(NODE) (DECL_LANG_SPECIFIC(NODE)->chain)
+ that is the common ancestor. */
+#define DECL_NAMESPACE_USING(NODE) DECL_VINDEX(NODE)
/* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
- of a namespace, to record the transitive closure of using namespace */
+ of a namespace, to record the transitive closure of using namespace. */
#define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NODE)
+/* In a NAMESPACE_DECL, points to the original namespace if this is
+ a namespace alias. */
+#define DECL_NAMESPACE_ALIAS(NODE) DECL_ABSTRACT_ORIGIN (NODE)
+#define ORIGINAL_NAMESPACE(NODE) \
+ (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
+
/* In a TREE_LIST concatenating using directives, indicate indirekt
directives */
#define TREE_INDIRECT_USING(NODE) ((NODE)->common.lang_flag_0)
@@ -1113,21 +1246,75 @@ struct lang_decl
/* For a VAR_DECL or FUNCTION_DECL: template-specific information. */
#define DECL_TEMPLATE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.template_info)
+
+/* Template information for a RECORD_TYPE or UNION_TYPE. */
#define CLASSTYPE_TEMPLATE_INFO(NODE) (TYPE_LANG_SPECIFIC(NODE)->template_info)
+
+/* Template information for an ENUMERAL_TYPE. Although an enumeration may
+ not be a primary template, it may be declared within the scope of a
+ primary template and the enumeration constants may depend on
+ non-type template parameters. */
+#define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE))
+
+/* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */
+#define TYPE_TEMPLATE_INFO(NODE) \
+ (TREE_CODE (NODE) == ENUMERAL_TYPE \
+ ? ENUM_TEMPLATE_INFO (NODE) : CLASSTYPE_TEMPLATE_INFO (NODE))
+
+/* Set the template information for an ENUMERAL_, RECORD_, or
+ UNION_TYPE to VAL. */
+#define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
+ (TREE_CODE (NODE) == ENUMERAL_TYPE \
+ ? (ENUM_TEMPLATE_INFO (NODE) = VAL) \
+ : (CLASSTYPE_TEMPLATE_INFO (NODE) = VAL))
+
#define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
#define TI_ARGS(NODE) (TREE_VALUE (NODE))
#define TI_SPEC_INFO(NODE) (TREE_CHAIN (NODE))
-#define TI_USES_TEMPLATE_PARMS(NODE) TREE_LANG_FLAG_0 (NODE)
#define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
-/* TI_PENDING_SPECIALIZATION_FLAG on a template-info node indicates
- that the template is a specialization of a member template, but
- that we don't yet know which one. */
-#define TI_PENDING_SPECIALIZATION_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
+
+/* The TEMPLATE_DECL instantiated or specialized by NODE. This
+ TEMPLATE_DECL will be the immediate parent, not the most general
+ template. For example, in:
+
+ template <class T> struct S { template <class U> void f(U); }
+
+ the FUNCTION_DECL for S<int>::f<double> will have, as its
+ DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
+
+ As a special case, for a member friend template of a template
+ class, this value will not be a TEMPLATE_DECL, but rather a
+ LOOKUP_EXPR or IDENTIFIER_NODE indicating the name of the template
+ and any explicit template arguments provided. For example, in:
+
+ template <class T> struct S { friend void f<int>(int, double); }
+
+ the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
+ DECL_TI_ARGS will be {int}. */
#define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
+
+/* The template arguments used to obtain this decl from the most
+ general form of DECL_TI_TEMPLATE. For the example given for
+ DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These
+ are always the full set of arguments required to instantiate this
+ declaration from the most general template specialized here. */
#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE))
#define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
#define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
#define CLASSTYPE_TI_SPEC_INFO(NODE) TI_SPEC_INFO (CLASSTYPE_TEMPLATE_INFO (NODE))
+#define ENUM_TI_TEMPLATE(NODE) \
+ TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
+#define ENUM_TI_ARGS(NODE) \
+ TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
+
+/* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
+#define TYPE_TI_TEMPLATE(NODE) \
+ (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE)))
+
+/* Like DECL_TI_ARGS, , but for an ENUMERAL_, RECORD_, or UNION_TYPE. */
+#define TYPE_TI_ARGS(NODE) \
+ (TI_ARGS (TYPE_TEMPLATE_INFO (NODE)))
+
#define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE(NODE)
#define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
@@ -1150,7 +1337,7 @@ struct lang_decl
#define TYPENAME_TYPE_FULLNAME(NODE) CLASSTYPE_SIZE (NODE)
-/* Nonzero in INT_CST means that this int is negative by dint of
+/* Nonzero in INTEGER_CST means that this int is negative by dint of
using a twos-complement negated operand. */
#define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))
@@ -1224,11 +1411,6 @@ extern int flag_new_for_scope;
These may be shadowed, and may be referenced from nested functions. */
#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
-/* Record whether a type or decl was written with nonconstant size.
- Note that TYPE_SIZE may have simplified to a constant. */
-#define C_TYPE_VARIABLE_SIZE(type) TREE_LANG_FLAG_4 (type)
-#define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_8 (type)
-
/* Nonzero for _TYPE means that the _TYPE defines
at least one constructor. */
#define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
@@ -1266,7 +1448,7 @@ extern int flag_new_for_scope;
/* Nonzero for _TYPE node means that creating an object of this type
will involve a call to a constructor. This can apply to objects
of ARRAY_TYPE if the type of the elements needs a constructor. */
-#define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_LANG_FLAG_3(NODE))
+#define TYPE_NEEDS_CONSTRUCTING(NODE) ... defined in ../tree.h ...
#endif
/* Nonzero means that an object of this type can not be initialized using
@@ -1320,6 +1502,11 @@ extern int flag_new_for_scope;
pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
before using this macro. */
#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE)))))))
+
+/* Returns `A' for a type like `int (A::*)(double)' */
+#define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
+ TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
+
/* These are use to manipulate the canonical RECORD_TYPE from the
hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
#define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
@@ -1328,6 +1515,17 @@ extern int flag_new_for_scope;
#define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), delta2_identifier, NULL_TREE, 0))
#define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, NULL_TREE, 0), pfn_identifier, NULL_TREE, 0))
+/* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
+ `X'. */
+#define PTRMEM_CST_CLASS(NODE) \
+ (TYPE_PTRMEM_P (TREE_TYPE (NODE)) \
+ ? TYPE_OFFSET_BASETYPE (TREE_TYPE (NODE)) \
+ : TYPE_PTRMEMFUNC_OBJECT_TYPE (TREE_TYPE (NODE)))
+
+/* For a pointer-to-member constant `X::Y' this is the _DECL for
+ `Y'. */
+#define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t) NODE)->member)
+
/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
specified in its declaration. */
#define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE))
@@ -1345,6 +1543,11 @@ extern int flag_new_for_scope;
#define ANON_UNION_P(NODE) (DECL_NAME (NODE) == 0)
+/* Nonzero if TYPE is an anonymous union type. */
+#define ANON_UNION_TYPE_P(TYPE) \
+ (TREE_CODE (TYPE) == UNION_TYPE \
+ && ANON_AGGRNAME_P (TYPE_IDENTIFIER (TYPE)))
+
#define UNKNOWN_TYPE LANG_TYPE
/* Define fields and accessors for nodes representing declared names. */
@@ -1390,25 +1593,80 @@ extern int flag_new_for_scope;
/* Accessor macros for C++ template decl nodes. */
/* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node
- indicates the level of the template parameters, with 1 being the
- outermost set of template parameters. The TREE_VALUE is a vector,
- whose elements are the template parameters at each level. Each
- element in the vector is a TREE_LIST, whose TREE_VALUE is a
- PARM_DECL (if the parameter is a non-type parameter), or a
- TYPE_DECL (if the parameter is a type parameter). The TREE_PURPOSE
- is the default value, if any. The TEMPLATE_PARM_INDEX for the
- parameter is avilable as the DECL_INITIAL (for a PARM_DECL) or as
- the TREE_TYPE (for a TYPE_DECL). */
+ is a INT_CST whose TREE_INT_CST_HIGH indicates the level of the
+ template parameters, with 1 being the outermost set of template
+ parameters. The TREE_VALUE is a vector, whose elements are the
+ template parameters at each level. Each element in the vector is a
+ TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
+ non-type parameter), or a TYPE_DECL (if the parameter is a type
+ parameter). The TREE_PURPOSE is the default value, if any. The
+ TEMPLATE_PARM_INDEX for the parameter is avilable as the
+ DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
+ TYPE_DECL). */
#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
#define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
#define DECL_NTPARMS(NODE) \
TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
-/* For class templates. */
-#define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
/* For function, method, class-data templates. */
#define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
+/* For a static member variable template, the
+ DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
+ implicitly generated instantiations of the variable. There are no
+ partial instantiations of static member variables, so all of these
+ will be full instantiations.
+
+ For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds
+ all instantiations and specializations of the class type, including
+ partial instantiations and partial specializations.
+
+ In both cases, the TREE_PURPOSE of each node contains the arguments
+ used; the TREE_VALUE contains the generated variable. The template
+ arguments are always complete. For example, given:
+
+ template <class T> struct S1 {
+ template <class U> struct S2 {};
+ template <class U> struct S2<U*> {};
+ };
+
+ the record for the partial specialization will contain, as its
+ argument list, { {T}, {U*} }, and will be on the
+ DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template
+ <class U> struct S1<T>::S2'.
+
+ This list is not used for function templates. */
#define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
+/* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists
+ contains all instantiations and specializations of the function,
+ including partial instantiations. For a partial instantiation
+ which is a specialization, this list holds only full
+ specializations of the template that are instantiations of the
+ partial instantiation. For example, given:
+
+ template <class T> struct S {
+ template <class U> void f(U);
+ template <> void f(T);
+ };
+
+ the `S<int>::f<int>(int)' function will appear on the
+ DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T>
+ template <class U> void S<T>::f(U)' and `template <class T> void
+ S<int>::f(T)'. In the latter case, however, it will have only the
+ innermost set of arguments (T, in this case). The DECL_TI_TEMPLATE
+ for the function declaration will point at the specialization, not
+ the fully general template.
+
+ For a class template, this list contains the partial
+ specializations of this template. (Full specializations are not
+ recorded on this list.) The TREE_PURPOSE holds the innermost
+ arguments used in the partial specialization (e.g., for `template
+ <class T> struct S<T*, int>' this will be `T*'.) The TREE_VALUE
+ holds the innermost template parameters for the specialization
+ (e.g., `T' in the example above.) The TREE_TYPE is the _TYPE node
+ for the partial specialization.
+
+ This list is not used for static variable templates. */
+#define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
#define DECL_TEMPLATE_INJECT(NODE) DECL_INITIAL(NODE)
/* Nonzero for TEMPLATE_DECL nodes that represents template template
@@ -1427,6 +1685,10 @@ extern int flag_new_for_scope;
&& TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
&& !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
+/* Nonzero if NODE which declares a type. */
+#define DECL_DECLARES_TYPE_P(NODE) \
+ (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
+
/* A `primary' template is one that has its own template header. A
member function of a class template is a template, but not primary.
A member template is primary. Friend templates are primary, too. */
@@ -1474,6 +1736,22 @@ extern int flag_new_for_scope;
#define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
(CLASSTYPE_USE_TEMPLATE(NODE) = 3)
+/* Non-zero if DECL is a friend function which is an instantiation
+ from the point of view of the compiler, but not from the point of
+ view of the language. For example given:
+ template <class T> struct S { friend void f(T) {}; };
+ the declaration of `void f(int)' generated when S<int> is
+ instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
+ a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */
+#define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
+ (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
+
+/* Non-zero iff we are currently processing a declaration for an
+ entity with its own template parameter list, and which is not a
+ full specialization. */
+#define PROCESSING_REAL_TEMPLATE_DECL_P() \
+ (processing_template_decl > template_class_depth (current_class_type))
+
/* This function may be a guiding decl for a template. */
#define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
/* We know what we're doing with this decl now. */
@@ -1494,12 +1772,6 @@ extern int flag_new_for_scope;
#define DECL_REALLY_EXTERN(NODE) \
(DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
-/* Records the namespace we are in */
-#define DECL_NAMESPACE(NODE) \
- (DECL_LANG_SPECIFIC (NODE) ? DECL_LANG_SPECIFIC (NODE)->decl_flags.in_namespace : 0)
-#define SET_DECL_NAMESPACE(NODE, val) \
- DECL_LANG_SPECIFIC (NODE)->decl_flags.in_namespace = val
-
/* Used to tell cp_finish_decl that it should approximate comdat linkage
as best it can for this decl. */
#define DECL_COMDAT(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.comdat)
@@ -1511,8 +1783,9 @@ extern int flag_new_for_scope;
#define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE))
/* An un-parsed default argument looks like an identifier. */
-#define DEFARG_LENGTH(NODE) IDENTIFIER_LENGTH(NODE)
-#define DEFARG_POINTER(NODE) IDENTIFIER_POINTER(NODE)
+#define DEFARG_NODE_CHECK(t) TREE_CHECK(t, DEFAULT_ARG)
+#define DEFARG_LENGTH(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.length)
+#define DEFARG_POINTER(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.pointer)
#define builtin_function(NAME, TYPE, CODE, LIBNAME) \
define_function (NAME, TYPE, CODE, (void (*) PROTO((tree)))pushdecl, LIBNAME)
@@ -1570,6 +1843,14 @@ extern int flag_detailed_statistics;
type signature of any virtual function in the base class. */
extern int warn_overloaded_virtual;
+/* Nonzero means warn about use of multicharacter literals. */
+extern int warn_multichar;
+
+/* Non-zero means warn if a non-templatized friend function is
+ declared in a templatized class. This behavior is warned about with
+ flag_guiding_decls in do_friend. */
+extern int warn_nontemplate_friend;
+
/* in c-common.c */
extern void declare_function_name PROTO((void));
extern void decl_attributes PROTO((tree, tree, tree));
@@ -1580,6 +1861,7 @@ extern void check_function_format PROTO((tree, tree, tree));
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PROTO((enum tree_code));
extern tree cp_build_type_variant PROTO((tree, int, int));
+extern tree canonical_type_variant PROTO((tree));
extern void c_expand_expr_stmt PROTO((tree));
/* Validate the expression after `case' and apply default promotions. */
extern tree check_case_value PROTO((tree));
@@ -1589,8 +1871,15 @@ extern void constant_expression_warning PROTO((tree));
extern tree convert_and_check PROTO((tree, tree));
extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree));
+
/* Read the rest of the current #-directive line. */
+#if USE_CPPLIB
+extern char *get_directive_line PROTO((void));
+#define GET_DIRECTIVE_LINE() get_directive_line ()
+#else
extern char *get_directive_line PROTO((FILE *));
+#define GET_DIRECTIVE_LINE() get_directive_line (finput)
+#endif
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
@@ -1600,6 +1889,7 @@ extern tree shorten_compare PROTO((tree *, tree *, tree *, e
extern tree truthvalue_conversion PROTO((tree));
extern tree type_for_mode PROTO((enum machine_mode, int));
extern tree type_for_size PROTO((unsigned, int));
+extern int c_get_alias_set PROTO((tree));
/* in decl{2}.c */
extern tree void_list_node;
@@ -1641,8 +1931,10 @@ extern tree opaque_type_node, signature_type_node;
#define vfunc_ptr_type_node \
(flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
-/* Array type `(void *)[]' */
+/* The type of a vtbl, i.e., an array of vtable entries. */
extern tree vtbl_type_node;
+/* The type of a class vtbl pointer, i.e., a pointer to a vtable entry. */
+extern tree vtbl_ptr_type_node;
extern tree delta_type_node;
extern tree std_node;
@@ -1653,8 +1945,20 @@ extern tree boolean_type_node, boolean_true_node, boolean_false_node;
extern tree null_node;
+extern tree anonymous_namespace_name;
+
/* in pt.c */
+/* These values are used for the `STRICT' parameter to type_unfication and
+ fn_type_unification. Their meanings are described with the
+ documentation for fn_type_unification. */
+
+typedef enum unification_kind_t {
+ DEDUCE_CALL,
+ DEDUCE_CONV,
+ DEDUCE_EXACT
+} unification_kind_t;
+
extern tree current_template_parms;
extern HOST_WIDE_INT processing_template_decl;
extern tree last_tree;
@@ -1671,7 +1975,16 @@ struct tinst_level
extern int minimal_parse_mode;
+extern void maybe_print_template_context PROTO ((void));
+
/* in class.c */
+
+/* When parsing a class definition, the access specifier most recently
+ given by the user, or, if no access specifier was given, the
+ default value appropriate for the kind of class (i.e., struct,
+ class, or union). */
+extern tree current_access_specifier;
+
extern tree current_class_name;
extern tree current_class_type;
extern tree current_class_ptr;
@@ -1855,6 +2168,13 @@ extern int current_function_parms_stored;
&& IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
&& IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
+/* Store the vbase pointer field name for type TYPE into pointer BUF. */
+#define FORMAT_VBASE_NAME(BUF,TYPE) do { \
+ BUF = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \
+ + sizeof (VBASE_NAME) + 1); \
+ sprintf (BUF, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
+} while (0)
+
#define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
#define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
@@ -1867,6 +2187,20 @@ extern int current_function_parms_stored;
#define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \
&& IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
#endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
+
+/* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
+ `main'. */
+#define MAIN_NAME_P(ID_NODE) \
+ (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0)
+
+/* Returns non-zero iff NODE is a declaration for the global function
+ `main'. */
+#define DECL_MAIN_P(NODE) \
+ (TREE_CODE (NODE) == FUNCTION_DECL \
+ && DECL_CONTEXT (NODE) == NULL_TREE \
+ && DECL_NAME (NODE) != NULL_TREE \
+ && MAIN_NAME_P (DECL_NAME (NODE)))
+
/* Define the sets of attributes that member functions and baseclasses
can have. These are sensible combinations of {public,private,protected}
@@ -1903,24 +2237,11 @@ struct pending_inline
/* in method.c */
extern struct pending_inline *pending_inlines;
-/* 1 for -fall-virtual: make every member function (except
- constructors) lay down in the virtual function table.
- Calls can then either go through the virtual function table or not,
- depending on whether we know what function will actually be called. */
-
-extern int flag_all_virtual;
-
/* Positive values means that we cannot make optimizing assumptions about
`this'. Negative values means we know `this' to be of static type. */
extern int flag_this_is_variable;
-/* Controls whether enums and ints freely convert.
- 1 means with complete freedom.
- 0 means enums can convert to ints, but not vice-versa. */
-
-extern int flag_int_enum_equivalence;
-
/* Nonzero means generate 'rtti' that give run-time type information. */
extern int flag_rtti;
@@ -1952,6 +2273,10 @@ extern int flag_weak;
extern int flag_new_abi;
+/* Nonzero to not ignore namespace std. */
+
+extern int flag_honor_std;
+
/* Nonzero if we're done parsing and into end-of-file activities. */
extern int at_eof;
@@ -1960,7 +2285,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
/* The following two can be derived from the previous one */
extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */
-extern tree current_class_type; /* _TYPE: the type of the current class */
/* Some macros for char-based bitfields. */
#define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
@@ -1989,7 +2313,16 @@ extern tree current_class_type; /* _TYPE: the type of the current class */
LOOKUP_NO_CONVERSION means that user-defined conversions are not
permitted. Built-in conversions are permitted.
LOOKUP_DESTRUCTOR means explicit call to destructor.
- LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references. */
+ LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references.
+
+ These are used in global lookup to support elaborated types and
+ qualifiers.
+
+ LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
+ LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
+ LOOKUP_PREFER_BOTH means class-or-namespace-name.
+ LOOKUP_TEMPLATES_EXPECTED means that class templates also count
+ as types. */
#define LOOKUP_PROTECT (1)
#define LOOKUP_COMPLAIN (2)
@@ -2004,6 +2337,17 @@ extern tree current_class_type; /* _TYPE: the type of the current class */
#define LOOKUP_NO_CONVERSION (512)
#define LOOKUP_DESTRUCTOR (512)
#define LOOKUP_NO_TEMP_BIND (1024)
+#define LOOKUP_PREFER_TYPES (2048)
+#define LOOKUP_PREFER_NAMESPACES (4096)
+#define LOOKUP_PREFER_BOTH (6144)
+#define LOOKUP_TEMPLATES_EXPECTED (8192)
+
+#define LOOKUP_NAMESPACES_ONLY(f) \
+ (((f) & LOOKUP_PREFER_NAMESPACES) && !((f) & LOOKUP_PREFER_TYPES))
+#define LOOKUP_TYPES_ONLY(f) \
+ (!((f) & LOOKUP_PREFER_NAMESPACES) && ((f) & LOOKUP_PREFER_TYPES))
+#define LOOKUP_QUALIFIERS_ONLY(f) ((f) & LOOKUP_PREFER_BOTH)
+
/* These flags are used by the conversion code.
CONV_IMPLICIT : Perform implicit conversions (standard and user-defined).
@@ -2067,6 +2411,7 @@ extern tree current_class_type; /* _TYPE: the type of the current class */
extern char **opname_tab, **assignop_tab;
/* in call.c */
+extern int check_dtor_name PROTO((tree, tree));
extern int get_arglist_len_in_bytes PROTO((tree));
extern tree build_vfield_ref PROTO((tree, tree));
@@ -2081,23 +2426,26 @@ extern tree build_user_type_conversion PROTO((tree, tree, int));
extern tree build_new_function_call PROTO((tree, tree));
extern tree build_new_op PROTO((enum tree_code, int, tree, tree, tree));
extern tree build_op_new_call PROTO((enum tree_code, tree, tree, int));
-extern tree build_op_delete_call PROTO((enum tree_code, tree, tree, int));
+extern tree build_op_delete_call PROTO((enum tree_code, tree, tree, int, tree));
extern int can_convert PROTO((tree, tree));
extern int can_convert_arg PROTO((tree, tree, tree));
extern void enforce_access PROTO((tree, tree));
+extern tree convert_default_arg PROTO((tree, tree));
+extern tree convert_arg_to_ellipsis PROTO((tree));
/* in class.c */
extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
extern tree build_vtbl_ref PROTO((tree, tree));
extern tree build_vfn_ref PROTO((tree *, tree, tree));
extern void add_method PROTO((tree, tree *, tree));
+extern int currently_open_class PROTO((tree));
extern tree get_vfield_offset PROTO((tree));
extern void duplicate_tag_error PROTO((tree));
-extern tree finish_struct PROTO((tree, tree, tree, int));
+extern tree finish_struct PROTO((tree, tree, int));
extern tree finish_struct_1 PROTO((tree, int));
-extern tree finish_struct_methods PROTO((tree, tree, int));
extern int resolves_to_fixed_type_p PROTO((tree, int *));
extern void init_class_processing PROTO((void));
+extern int is_empty_class PROTO((tree));
extern void pushclass PROTO((tree, int));
extern void popclass PROTO((int));
extern void push_nested_class PROTO((tree, int));
@@ -2110,6 +2458,9 @@ extern void maybe_push_cache_obstack PROTO((void));
extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *));
extern tree build_self_reference PROTO((void));
extern void warn_hidden PROTO((tree));
+extern tree get_enclosing_class PROTO((tree));
+int is_base_of_enclosing_class PROTO((tree, tree));
+extern void unreverse_member_declarations PROTO((tree));
/* in cvt.c */
extern tree convert_to_reference PROTO((tree, tree, int, int, tree));
@@ -2127,6 +2478,7 @@ extern tree perform_qualification_conversions PROTO((tree, tree));
/* decl.c */
/* resume_binding_level */
+extern void set_identifier_local_value PROTO((tree, tree));
extern int global_bindings_p PROTO((void));
extern int toplevel_bindings_p PROTO((void));
extern void keep_next_level PROTO((void));
@@ -2153,7 +2505,9 @@ extern void pop_namespace PROTO((void));
extern void maybe_push_to_top_level PROTO((int));
extern void push_to_top_level PROTO((void));
extern void pop_from_top_level PROTO((void));
+extern tree identifier_type_value PROTO((tree));
extern void set_identifier_type_value PROTO((tree, tree));
+extern void set_identifier_local_value PROTO((tree, tree));
extern void pop_everything PROTO((void));
extern void pushtag PROTO((tree, tree, int));
extern tree make_anon_name PROTO((void));
@@ -2162,32 +2516,43 @@ extern int decls_match PROTO((tree, tree));
extern int duplicate_decls PROTO((tree, tree));
extern tree pushdecl PROTO((tree));
extern tree pushdecl_top_level PROTO((tree));
-extern tree pushdecl_class_level PROTO((tree));
+extern void pushdecl_class_level PROTO((tree));
#if 0
extern void pushdecl_nonclass_level PROTO((tree));
#endif
+extern tree pushdecl_namespace_level PROTO((tree));
+extern tree push_using_decl PROTO((tree, tree));
+extern tree push_using_directive PROTO((tree));
extern void push_class_level_binding PROTO((tree, tree));
-extern int overloaded_globals_p PROTO((tree));
+extern tree push_using_decl PROTO((tree, tree));
extern tree implicitly_declare PROTO((tree));
extern tree lookup_label PROTO((tree));
extern tree shadow_label PROTO((tree));
extern tree define_label PROTO((char *, int, tree));
extern void push_switch PROTO((void));
extern void pop_switch PROTO((void));
-extern void define_case_label PROTO((tree));
+extern void define_case_label PROTO((void));
extern tree getdecls PROTO((void));
extern tree gettags PROTO((void));
#if 0
extern void set_current_level_tags_transparency PROTO((int));
#endif
extern tree binding_for_name PROTO((tree, tree));
+extern tree namespace_binding PROTO((tree, tree));
+extern void set_namespace_binding PROTO((tree, tree, tree));
extern tree lookup_namespace_name PROTO((tree, tree));
extern tree make_typename_type PROTO((tree, tree));
extern tree lookup_name_nonclass PROTO((tree));
+extern tree lookup_function_nonclass PROTO((tree, tree));
extern tree lookup_name PROTO((tree, int));
extern tree lookup_name_current_level PROTO((tree));
-extern tree lookup_using_namespace PROTO((tree,tree,tree,tree));
-extern tree qualified_lookup_using_namespace PROTO((tree,tree));
+extern tree lookup_type_current_level PROTO((tree));
+extern tree lookup_name_namespace_only PROTO((tree));
+extern void begin_only_namespace_names PROTO((void));
+extern void end_only_namespace_names PROTO((void));
+extern tree namespace_ancestor PROTO((tree, tree));
+extern int lookup_using_namespace PROTO((tree,tree,tree,tree,int));
+extern int qualified_lookup_using_namespace PROTO((tree,tree,tree,int));
extern tree auto_function PROTO((tree, tree, enum built_in_function));
extern void init_decl_processing PROTO((void));
extern int init_type_desc PROTO((void));
@@ -2208,13 +2573,12 @@ extern int parmlist_is_exprlist PROTO((tree));
extern int copy_args_p PROTO((tree));
extern int grok_ctor_properties PROTO((tree, tree));
extern void grok_op_properties PROTO((tree, int, int));
-extern tree xref_tag PROTO((tree, tree, tree, int));
+extern tree xref_tag PROTO((tree, tree, int));
extern tree xref_tag_from_type PROTO((tree, tree, int));
extern void xref_basetypes PROTO((tree, tree, tree, tree));
extern tree start_enum PROTO((tree));
-extern tree finish_enum PROTO((tree, tree));
-extern tree build_enumerator PROTO((tree, tree));
-extern tree grok_enum_decls PROTO((tree));
+extern tree finish_enum PROTO((tree));
+extern tree build_enumerator PROTO((tree, tree, tree));
extern int start_function PROTO((tree, tree, tree, int));
extern void expand_start_early_try_stmts PROTO((void));
extern void store_parm_decls PROTO((void));
@@ -2234,14 +2598,18 @@ extern int in_function_p PROTO((void));
extern void replace_defarg PROTO((tree, tree));
extern void print_other_binding_stack PROTO((struct binding_level *));
extern void revert_static_member_fn PROTO((tree*, tree*, tree*));
+extern void cat_namespace_levels PROTO((void));
+extern void fixup_anonymous_union PROTO((tree));
/* in decl2.c */
-extern int flag_assume_nonnull_objects;
-extern int lang_decode_option PROTO((char *));
+extern int check_java_method PROTO((tree));
+extern int lang_decode_option PROTO((int, char **));
extern tree grok_method_quals PROTO((tree, tree, tree));
extern void warn_if_unknown_interface PROTO((tree));
-extern tree grok_x_components PROTO((tree, tree));
-extern void grokclassfn PROTO((tree, tree, tree, enum overload_flags, tree));
+extern void grok_x_components PROTO((tree));
+extern void maybe_retrofit_in_chrg PROTO((tree));
+extern void maybe_make_one_only PROTO((tree));
+extern void grokclassfn PROTO((tree, tree, enum overload_flags, tree));
extern tree grok_alignof PROTO((tree));
extern tree grok_array_decl PROTO((tree, tree));
extern tree delete_sanity PROTO((tree, tree, int, int));
@@ -2266,6 +2634,7 @@ extern void finish_builtin_type PROTO((tree, char *, tree *, int, tree));
extern tree coerce_new_type PROTO((tree));
extern tree coerce_delete_type PROTO((tree));
extern void comdat_linkage PROTO((tree));
+extern void import_export_class PROTO((tree));
extern void import_export_vtable PROTO((tree, tree, int));
extern int finish_prevtable_vardecl PROTO((tree, tree));
extern int walk_vtables PROTO((void (*)(tree, tree),
@@ -2281,15 +2650,19 @@ extern tree build_expr_from_tree PROTO((tree));
extern tree reparse_decl_as_expr PROTO((tree, tree));
extern tree finish_decl_parsing PROTO((tree));
extern tree check_cp_case_value PROTO((tree));
-extern tree get_namespace_id PROTO((void));
-extern tree current_namespace_id PROTO((tree));
+extern void set_decl_namespace PROTO((tree, tree));
+extern tree current_decl_namespace PROTO((void));
+extern void push_decl_namespace PROTO((tree));
+extern void pop_decl_namespace PROTO((void));
extern void do_namespace_alias PROTO((tree, tree));
extern void do_toplevel_using_decl PROTO((tree));
+extern void do_local_using_decl PROTO((tree));
extern tree do_class_using_decl PROTO((tree));
extern void do_using_directive PROTO((tree));
extern void check_default_args PROTO((tree));
extern void mark_used PROTO((tree));
extern tree handle_class_head PROTO((tree, tree, tree));
+extern tree lookup_arg_dependent PROTO((tree, tree, tree));
/* in errfn.c */
extern void cp_error ();
@@ -2330,6 +2703,7 @@ extern tree start_anon_func PROTO((void));
extern void end_anon_func PROTO((void));
extern void expand_throw PROTO((tree));
extern tree build_throw PROTO((tree));
+extern void mark_all_runtime_matches PROTO((void));
/* in expr.c */
extern void init_cplus_expand PROTO((void));
@@ -2347,9 +2721,8 @@ extern void init_init_processing PROTO((void));
extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree));
extern void emit_base_init PROTO((tree, int));
extern void check_base_init PROTO((tree));
-extern void do_member_init PROTO((tree, tree, tree));
extern void expand_member_init PROTO((tree, tree, tree));
-extern void expand_aggr_init PROTO((tree, tree, int, int));
+extern void expand_aggr_init PROTO((tree, tree, int));
extern int is_aggr_typedef PROTO((tree, int));
extern int is_aggr_type PROTO((tree, int));
extern tree get_aggr_from_typedef PROTO((tree, int));
@@ -2361,7 +2734,7 @@ extern tree decl_constant_value PROTO((tree));
extern tree build_new PROTO((tree, tree, tree, int));
extern tree build_new_1 PROTO((tree));
extern tree expand_vec_init PROTO((tree, tree, tree, tree, int));
-extern tree build_x_delete PROTO((tree, tree, int, tree));
+extern tree build_x_delete PROTO((tree, int, tree));
extern tree build_delete PROTO((tree, tree, tree, int, int));
extern tree build_vbase_delete PROTO((tree, tree));
extern tree build_vec_delete PROTO((tree, tree, tree, tree, int));
@@ -2369,6 +2742,7 @@ extern tree build_vec_delete PROTO((tree, tree, tree, tree, int));
/* in input.c */
/* in lex.c */
+extern char *file_name_nondirectory PROTO((char *));
extern tree make_pointer_declarator PROTO((tree, tree));
extern tree make_reference_declarator PROTO((tree, tree));
extern tree make_call_declarator PROTO((tree, tree, tree, tree));
@@ -2397,7 +2771,7 @@ extern void note_list_got_semicolon PROTO((tree));
extern void do_pending_lang_change PROTO((void));
extern int identifier_type PROTO((tree));
extern void see_typename PROTO((void));
-extern tree do_identifier PROTO((tree, int));
+extern tree do_identifier PROTO((tree, int, tree));
extern tree do_scoped_id PROTO((tree, int));
extern tree identifier_typedecl_value PROTO((tree));
extern int real_yylex PROTO((void));
@@ -2423,9 +2797,12 @@ extern void do_inline_function_hair PROTO((tree, tree));
extern char *build_overload_name PROTO((tree, int, int));
extern tree build_static_name PROTO((tree, tree));
extern tree build_decl_overload PROTO((tree, tree, int));
-extern tree build_template_decl_overload PROTO((tree, tree, tree, tree, tree, int));
+extern tree build_decl_overload_real PROTO((tree, tree, tree, tree,
+ tree, int));
+extern void set_mangled_name_for_decl PROTO((tree));
extern tree build_typename_overload PROTO((tree));
extern tree build_overload_with_type PROTO((tree, tree));
+extern tree build_destructor_name PROTO((tree));
extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree));
extern tree hack_identifier PROTO((tree, tree));
extern tree make_thunk PROTO((tree, int));
@@ -2434,14 +2811,13 @@ extern void synthesize_method PROTO((tree));
extern tree get_id_2 PROTO((char *, tree));
/* in pt.c */
-extern tree innermost_args PROTO ((tree, int));
+extern tree innermost_args PROTO ((tree));
extern tree tsubst PROTO ((tree, tree, tree));
extern tree tsubst_expr PROTO ((tree, tree, tree));
extern tree tsubst_copy PROTO ((tree, tree, tree));
-extern tree tsubst_chain PROTO((tree, tree));
extern void maybe_begin_member_template_processing PROTO((tree));
-extern void maybe_end_member_template_processing PROTO((tree));
-extern tree finish_member_template_decl PROTO((tree, tree));
+extern void maybe_end_member_template_processing PROTO((void));
+extern tree finish_member_template_decl PROTO((tree));
extern void begin_template_parm_list PROTO((void));
extern void begin_specialization PROTO((void));
extern void reset_specialization PROTO((void));
@@ -2449,7 +2825,7 @@ extern void end_specialization PROTO((void));
extern void begin_explicit_instantiation PROTO((void));
extern void end_explicit_instantiation PROTO((void));
extern tree determine_specialization PROTO((tree, tree, tree *, int, int));
-extern tree check_explicit_specialization PROTO((tree, tree, int, int));
+extern tree check_explicit_specialization PROTO((tree, tree, int, int));
extern tree process_template_parm PROTO((tree, tree));
extern tree end_template_parm_list PROTO((tree));
extern void end_template_decl PROTO((void));
@@ -2457,14 +2833,14 @@ extern tree current_template_args PROTO((void));
extern tree push_template_decl PROTO((tree));
extern tree push_template_decl_real PROTO((tree, int));
extern void redeclare_class_template PROTO((tree, tree));
-extern tree lookup_template_class PROTO((tree, tree, tree, tree));
+extern tree lookup_template_class PROTO((tree, tree, tree, tree, int));
extern tree lookup_template_function PROTO((tree, tree));
extern int uses_template_parms PROTO((tree));
extern tree instantiate_class_template PROTO((tree));
extern tree instantiate_template PROTO((tree, tree));
extern void overload_template_name PROTO((tree));
-extern int fn_type_unification PROTO((tree, tree, tree, tree, tree, int, tree));
-extern int type_unification PROTO((tree, tree, tree, tree, tree, int, int));
+extern int fn_type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t, tree));
+extern int type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t, int));
struct tinst_level *tinst_for_decl PROTO((void));
extern void mark_decl_instantiated PROTO((tree, int));
extern int more_specialized PROTO((tree, tree, tree));
@@ -2472,7 +2848,6 @@ extern void mark_class_instantiated PROTO((tree, int));
extern void do_decl_instantiation PROTO((tree, tree, tree));
extern void do_type_instantiation PROTO((tree, tree));
extern tree instantiate_decl PROTO((tree));
-extern tree lookup_nested_type_by_name PROTO((tree, tree));
extern tree do_poplevel PROTO((void));
extern tree get_bindings PROTO((tree, tree, tree));
/* CONT ... */
@@ -2481,18 +2856,20 @@ extern void begin_tree PROTO((void));
extern void end_tree PROTO((void));
extern void add_maybe_template PROTO((tree, tree));
extern void pop_tinst_level PROTO((void));
-extern tree most_specialized PROTO((tree, tree, tree));
-extern tree most_specialized_class PROTO((tree, tree, tree));
extern int more_specialized_class PROTO((tree, tree));
extern void do_pushlevel PROTO((void));
extern int is_member_template PROTO((tree));
extern int comp_template_parms PROTO((tree, tree));
+extern int decl_template_parm_p PROTO((tree));
extern int template_class_depth PROTO((tree));
extern int is_specialization_of PROTO((tree, tree));
extern int comp_template_args PROTO((tree, tree));
+extern void maybe_process_partial_specialization PROTO((tree));
+extern void maybe_check_template_type PROTO((tree));
extern int processing_specialization;
extern int processing_explicit_instantiation;
+extern int processing_template_parmlist;
/* in repo.c */
extern void repo_template_used PROTO((tree));
@@ -2511,8 +2888,7 @@ extern tree build_dynamic_cast PROTO((tree, tree));
extern void synthesize_tinfo_fn PROTO((tree));
/* in search.c */
-extern void push_memoized_context PROTO((tree, int));
-extern void pop_memoized_context PROTO((int));
+extern int types_overlap_p PROTO((tree, tree));
extern tree get_vbase PROTO((tree, tree));
extern tree get_binfo PROTO((tree, tree, int));
extern int get_base_distance PROTO((tree, tree, int, tree *));
@@ -2520,6 +2896,7 @@ extern tree compute_access PROTO((tree, tree));
extern tree lookup_field PROTO((tree, tree, int, int));
extern tree lookup_nested_field PROTO((tree, int));
extern tree lookup_fnfields PROTO((tree, tree, int));
+extern tree lookup_member PROTO((tree, tree, int, int));
extern tree lookup_nested_tag PROTO((tree, tree));
extern tree get_matching_virtual PROTO((tree, tree, int));
extern tree get_abstract_virtuals PROTO((tree));
@@ -2529,22 +2906,17 @@ extern tree init_vbase_pointers PROTO((tree, tree));
extern void expand_indirect_vtbls_init PROTO((tree, tree, tree));
extern void clear_search_slots PROTO((tree));
extern tree get_vbase_types PROTO((tree));
-extern void build_mi_matrix PROTO((tree));
-extern void free_mi_matrix PROTO((void));
-extern void build_mi_virtuals PROTO((int, int));
-extern void add_mi_virtuals PROTO((int, tree));
-extern void report_ambiguous_mi_virtuals PROTO((int, tree));
extern void note_debug_info_needed PROTO((tree));
extern void push_class_decls PROTO((tree));
extern void pop_class_decls PROTO((void));
extern void unuse_fields PROTO((tree));
-extern void unmark_finished_struct PROTO((tree));
extern void print_search_statistics PROTO((void));
extern void init_search_processing PROTO((void));
extern void reinit_search_statistics PROTO((void));
extern tree current_scope PROTO((void));
extern tree lookup_conversions PROTO((tree));
extern tree get_template_base PROTO((tree, tree));
+extern tree binfo_for_vtable PROTO((tree));
/* in semantics.c */
extern void finish_expr_stmt PROTO((tree));
@@ -2585,22 +2957,40 @@ extern void finish_asm_stmt PROTO((tree, tree, tree, tree, t
extern tree finish_parenthesized_expr PROTO((tree));
extern tree begin_stmt_expr PROTO((void));
extern tree finish_stmt_expr PROTO((tree, tree));
-extern tree finish_call_expr PROTO((tree, tree));
+extern tree finish_call_expr PROTO((tree, tree, int));
extern tree finish_increment_expr PROTO((tree, enum tree_code));
extern tree finish_this_expr PROTO((void));
extern tree finish_object_call_expr PROTO((tree, tree, tree));
extern tree finish_qualified_object_call_expr PROTO((tree, tree, tree));
extern tree finish_pseudo_destructor_call_expr PROTO((tree, tree, tree));
-extern tree finish_globally_qualified_member_call_expr PROTO ((tree, tree));
+extern tree finish_qualified_call_expr PROTO ((tree, tree));
extern tree finish_label_address_expr PROTO((tree));
+extern tree finish_unary_op_expr PROTO((enum tree_code, tree));
+extern tree finish_id_expr PROTO((tree));
+extern int begin_new_placement PROTO((void));
+extern tree finish_new_placement PROTO((tree, int));
extern int begin_function_definition PROTO((tree, tree));
extern tree begin_constructor_declarator PROTO((tree, tree));
+extern tree finish_declarator PROTO((tree, tree, tree, tree, int));
+extern void finish_translation_unit PROTO((void));
extern tree finish_template_type_parm PROTO((tree, tree));
extern tree finish_template_template_parm PROTO((tree, tree));
+extern tree finish_parmlist PROTO((tree, int));
+extern tree begin_class_definition PROTO((tree));
+extern tree finish_class_definition PROTO((tree, tree, int));
+extern void finish_default_args PROTO((void));
+extern void begin_inline_definitions PROTO((void));
+extern tree finish_member_class_template PROTO((tree));
+extern void finish_template_decl PROTO((tree));
+extern tree finish_template_type PROTO((tree, tree, int));
+extern void enter_scope_of PROTO((tree));
+extern tree finish_base_specifier PROTO((tree, tree, int));
+extern void finish_member_declaration PROTO((tree));
+extern void check_multiple_declarators PROTO((void));
/* in sig.c */
-extern tree build_signature_pointer_type PROTO((tree, int, int));
-extern tree build_signature_reference_type PROTO((tree, int, int));
+extern tree build_signature_pointer_type PROTO((tree));
+extern tree build_signature_reference_type PROTO((tree));
extern tree build_signature_pointer_constructor PROTO((tree, tree));
extern tree build_signature_method_call PROTO((tree, tree));
extern tree build_optr_ref PROTO((tree));
@@ -2613,6 +3003,8 @@ extern int yylex PROTO((void));
extern tree arbitrate_lookup PROTO((tree, tree, tree));
/* in tree.c */
+extern void unshare_base_binfos PROTO((tree));
+extern int member_p PROTO((tree));
extern int real_lvalue_p PROTO((tree));
extern tree build_min PVPROTO((enum tree_code, tree, ...));
extern tree build_min_nt PVPROTO((enum tree_code, ...));
@@ -2633,13 +3025,17 @@ extern tree hash_tree_cons PROTO((int, int, int, tree, tree, tree));
extern tree hash_tree_chain PROTO((tree, tree));
extern tree hash_chainon PROTO((tree, tree));
extern tree get_decl_list PROTO((tree));
-extern tree make_binfo PROTO((tree, tree, tree, tree, tree));
+extern tree make_binfo PROTO((tree, tree, tree, tree));
extern tree binfo_value PROTO((tree, tree));
extern tree reverse_path PROTO((tree));
-extern int decl_list_length PROTO((tree));
extern int count_functions PROTO((tree));
extern int is_overloaded_fn PROTO((tree));
extern tree get_first_fn PROTO((tree));
+extern tree binding_init PROTO((struct tree_binding*));
+extern tree ovl_cons PROTO((tree, tree));
+extern tree scratch_ovl_cons PROTO((tree, tree));
+extern int ovl_member PROTO((tree, tree));
+extern tree build_overload PROTO((tree, tree));
extern tree fnaddr_from_vtable_entry PROTO((tree));
extern tree function_arg_chain PROTO((tree));
extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
@@ -2663,33 +3059,44 @@ extern tree make_temp_vec PROTO((int));
extern tree build_ptr_wrapper PROTO((void *));
extern tree build_expr_ptr_wrapper PROTO((void *));
extern tree build_int_wrapper PROTO((int));
+extern tree build_srcloc PROTO((char *, int));
+extern tree build_srcloc_here PROTO((void));
extern int varargs_function_p PROTO((tree));
extern int really_overloaded_fn PROTO((tree));
extern int cp_tree_equal PROTO((tree, tree));
extern int can_free PROTO((struct obstack *, tree));
extern tree mapcar PROTO((tree, tree (*) (tree)));
+extern tree no_linkage_check PROTO((tree));
extern void debug_binfo PROTO((tree));
extern void push_expression_obstack PROTO((void));
#define scratchalloc expralloc
#define scratch_tree_cons expr_tree_cons
#define build_scratch_list build_expr_list
#define make_scratch_vec make_temp_vec
+#define push_scratch_obstack push_expression_obstack
+#define hash_tree_cons_simple(PURPOSE, VALUE, CHAIN) \
+ hash_tree_cons (0, 0, 0, (PURPOSE), (VALUE), (CHAIN))
/* in typeck.c */
+extern int string_conv_p PROTO((tree, tree, int));
extern tree condition_conversion PROTO((tree));
extern tree target_type PROTO((tree));
extern tree require_complete_type PROTO((tree));
extern tree complete_type PROTO((tree));
+extern tree complete_type_or_else PROTO((tree));
extern int type_unknown_p PROTO((tree));
extern int fntype_p PROTO((tree));
extern tree require_instantiated_type PROTO((tree, tree, tree));
extern tree commonparms PROTO((tree, tree));
+extern tree original_type PROTO((tree));
extern tree common_type PROTO((tree, tree));
extern int compexcepttypes PROTO((tree, tree));
extern int comptypes PROTO((tree, tree, int));
extern int comp_target_types PROTO((tree, tree, int));
extern int compparms PROTO((tree, tree, int));
extern int comp_target_types PROTO((tree, tree, int));
+extern int comp_cv_qualification PROTO((tree, tree));
+extern int comp_cv_qual_signature PROTO((tree, tree));
extern int self_promoting_args_p PROTO((tree));
extern tree unsigned_type PROTO((tree));
extern tree signed_type PROTO((tree));
@@ -2713,7 +3120,7 @@ extern tree get_member_function_from_ptrfunc PROTO((tree *, tree));
extern tree build_function_call_real PROTO((tree, tree, int, int));
extern tree build_function_call PROTO((tree, tree));
extern tree build_function_call_maybe PROTO((tree, tree));
-extern tree convert_arguments PROTO((tree, tree, tree, tree, int));
+extern tree convert_arguments PROTO((tree, tree, tree, int));
extern tree build_x_binary_op PROTO((enum tree_code, tree, tree));
extern tree build_binary_op PROTO((enum tree_code, tree, tree, int));
extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code));
@@ -2732,7 +3139,6 @@ extern tree build_const_cast PROTO((tree, tree));
extern tree build_c_cast PROTO((tree, tree));
extern tree build_x_modify_expr PROTO((tree, enum tree_code, tree));
extern tree build_modify_expr PROTO((tree, enum tree_code, tree));
-extern int language_lvalue_valid PROTO((tree));
extern void warn_for_assignment PROTO((char *, char *, char *, tree, int, int));
extern tree convert_for_initialization PROTO((tree, tree, tree, int, char *, tree, int));
extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
@@ -2749,7 +3155,8 @@ extern void readonly_error PROTO((tree, char *, int));
extern void abstract_virtuals_error PROTO((tree, tree));
extern void signature_error PROTO((tree, tree));
extern void incomplete_type_error PROTO((tree, tree));
-extern void my_friendly_abort PROTO((int));
+extern void my_friendly_abort PROTO((int))
+ ATTRIBUTE_NORETURN;
extern void my_friendly_assert PROTO((int, int));
extern tree store_init_value PROTO((tree, tree));
extern tree digest_init PROTO((tree, tree, tree *));
@@ -2773,7 +3180,7 @@ extern void GNU_xref_decl PROTO((tree, tree));
extern void GNU_xref_call PROTO((tree, char *));
extern void GNU_xref_function PROTO((tree, tree));
extern void GNU_xref_assign PROTO((tree));
-extern void GNU_xref_hier PROTO((char *, char *, int, int, int));
+extern void GNU_xref_hier PROTO((tree, tree, int, int, int));
extern void GNU_xref_member PROTO((tree, tree));
/* -- end of C++ */
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 836b8ad7258..f2b41d80b14 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -36,7 +36,7 @@ extern tree static_aggregates;
static tree cp_convert_to_pointer PROTO((tree, tree));
static tree convert_to_pointer_force PROTO((tree, tree));
-static tree build_up_reference PROTO((tree, tree, int, int));
+static tree build_up_reference PROTO((tree, tree, int));
/* Change of width--truncation and extension of integers or reals--
is represented with NOP_EXPR. Proper functioning of many things
@@ -154,7 +154,15 @@ cp_convert_to_pointer (type, expr)
&& TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
&& IS_AGGR_TYPE (TREE_TYPE (type))
&& IS_AGGR_TYPE (TREE_TYPE (intype))
- && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE)
+ && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE
+ /* If EXPR is NULL, then we don't need to do any arithmetic
+ to convert it:
+
+ [conv.ptr]
+
+ The null pointer value is converted to the null pointer
+ value of the destination type. */
+ && !integer_zerop (expr))
{
enum tree_code code = PLUS_EXPR;
tree binfo = get_binfo (TREE_TYPE (type), TREE_TYPE (intype), 1);
@@ -335,9 +343,9 @@ convert_to_pointer_force (type, expr)
DIRECT_BIND in FLAGS controls how any temporaries are generated. */
static tree
-build_up_reference (type, arg, flags, checkconst)
+build_up_reference (type, arg, flags)
tree type, arg;
- int flags, checkconst;
+ int flags;
{
tree rval;
tree argtype = TREE_TYPE (arg);
@@ -440,37 +448,40 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
if (flags & LOOKUP_COMPLAIN)
{
tree ttl = TREE_TYPE (reftype);
- tree ttr;
-
- {
- int r = TREE_READONLY (expr);
- int v = TREE_THIS_VOLATILE (expr);
- ttr = cp_build_type_variant (TREE_TYPE (expr), r, v);
- }
+ tree ttr = lvalue_type (expr);
- if (! real_lvalue_p (expr) && ! TYPE_READONLY (ttl))
+ /* [dcl.init.ref] says that if an rvalue is used to
+ initialize a reference, then the reference must be to a
+ non-volatile const type. */
+ if (! real_lvalue_p (expr)
+ && (!TYPE_READONLY (ttl) || TYPE_VOLATILE (ttl)))
{
- if (decl)
- /* Ensure semantics of [dcl.init.ref] */
- cp_pedwarn ("initialization of non-const reference `%#T' from rvalue `%T'",
- reftype, intype);
+ char* msg;
+
+ if (TYPE_VOLATILE (ttl) && decl)
+ msg = "initialization of volatile reference type `%#T'";
+ else if (TYPE_VOLATILE (ttl))
+ msg = "conversion to volatile reference type `%#T'";
+ else if (decl)
+ msg = "initialization of non-const reference type `%#T'";
else
- cp_pedwarn ("conversion to non-const `%T' from rvalue `%T'",
- reftype, intype);
+ msg = "conversion to non-const reference type `%#T'";
+
+ cp_error (msg, reftype);
+ cp_error ("from rvalue of type `%T'", intype);
}
else if (! (convtype & CONV_CONST))
{
if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
- cp_pedwarn ("conversion from `%T' to `%T' discards const",
- ttr, reftype);
+ cp_error ("conversion from `%T' to `%T' discards const",
+ ttr, reftype);
else if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
- cp_pedwarn ("conversion from `%T' to `%T' discards volatile",
- ttr, reftype);
+ cp_error ("conversion from `%T' to `%T' discards volatile",
+ ttr, reftype);
}
}
- return build_up_reference (reftype, expr, flags,
- ! (convtype & CONV_CONST));
+ return build_up_reference (reftype, expr, flags);
}
else if ((convtype & CONV_REINTERPRET) && lvalue_p (expr))
{
@@ -499,7 +510,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
"converting", 0, 0);
if (rval == error_mark_node)
return error_mark_node;
- rval = build_up_reference (reftype, rval, flags, 1);
+ rval = build_up_reference (reftype, rval, flags);
if (rval && ! TYPE_READONLY (TREE_TYPE (reftype)))
cp_pedwarn ("initializing non-const `%T' with `%T' will use a temporary",
@@ -554,6 +565,9 @@ convert_pointer_to_real (binfo, expr)
tree ptr_type;
tree type, rval;
+ if (intype == error_mark_node)
+ return error_mark_node;
+
if (TREE_CODE (binfo) == TREE_VEC)
type = BINFO_TYPE (binfo);
else if (IS_AGGR_TYPE (binfo))
@@ -572,26 +586,23 @@ convert_pointer_to_real (binfo, expr)
if (ptr_type == TYPE_MAIN_VARIANT (intype))
return expr;
- if (intype == error_mark_node)
- return error_mark_node;
-
my_friendly_assert (!integer_zerop (expr), 191);
+ intype = TYPE_MAIN_VARIANT (TREE_TYPE (intype));
if (TREE_CODE (type) == RECORD_TYPE
- && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE
- && type != TYPE_MAIN_VARIANT (TREE_TYPE (intype)))
+ && TREE_CODE (intype) == RECORD_TYPE
+ && type != intype)
{
tree path;
int distance
- = get_base_distance (binfo, TYPE_MAIN_VARIANT (TREE_TYPE (intype)),
- 0, &path);
+ = get_base_distance (binfo, intype, 0, &path);
/* This function shouldn't be called with unqualified arguments
but if it is, give them an error message that they can read. */
if (distance < 0)
{
cp_error ("cannot convert a pointer of type `%T' to a pointer of type `%T'",
- TREE_TYPE (intype), type);
+ intype, type);
if (distance == -2)
cp_error ("because `%T' is an ambiguous base class", type);
@@ -663,9 +674,19 @@ ocp_convert (type, expr, convtype, flags)
&& TYPE_HAS_CONSTRUCTOR (type))
/* We need a new temporary; don't take this shortcut. */;
else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (e)))
- /* Trivial conversion: cv-qualifiers do not matter on rvalues. */
- return fold (build1 (NOP_EXPR, type, e));
-
+ {
+ if (comptypes (type, TREE_TYPE (e), 1))
+ /* The call to fold will not always remove the NOP_EXPR as
+ might be expected, since if one of the types is a typedef;
+ the comparsion in fold is just equality of pointers, not a
+ call to comptypes. */
+ ;
+ else
+ e = build1 (NOP_EXPR, type, e);
+
+ return fold (e);
+ }
+
if (code == VOID_TYPE && (convtype & CONV_STATIC))
return build1 (CONVERT_EXPR, type, e);
@@ -698,8 +719,7 @@ ocp_convert (type, expr, convtype, flags)
tree intype = TREE_TYPE (e);
/* enum = enum, enum = int, enum = float, (enum)pointer are all
errors. */
- if (flag_int_enum_equivalence == 0
- && TREE_CODE (type) == ENUMERAL_TYPE
+ if (TREE_CODE (type) == ENUMERAL_TYPE
&& ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC))
|| (TREE_CODE (intype) == POINTER_TYPE)))
{
@@ -796,10 +816,10 @@ ocp_convert (type, expr, convtype, flags)
if ((flags & LOOKUP_ONLYCONVERTING)
&& ! (IS_AGGR_TYPE (dtype) && DERIVED_FROM_P (type, dtype)))
- {
- ctor = build_user_type_conversion (type, ctor, flags);
- flags |= LOOKUP_NO_CONVERSION;
- }
+ /* For copy-initialization, first we create a temp of the proper type
+ with a user-defined conversion sequence, then we direct-initialize
+ the target with the temp (see [dcl.init]). */
+ ctor = build_user_type_conversion (type, ctor, flags);
if (ctor)
ctor = build_method_call (NULL_TREE, ctor_identifier,
build_expr_list (NULL_TREE, ctor),
@@ -919,7 +939,7 @@ convert_force (type, expr, convtype)
tree
build_type_conversion (code, xtype, expr, for_sure)
- enum tree_code code;
+ enum tree_code code ATTRIBUTE_UNUSED;
tree xtype, expr;
int for_sure;
{
@@ -941,36 +961,103 @@ build_expr_type_conversion (desires, expr, complain)
int complain;
{
tree basetype = TREE_TYPE (expr);
-
+ tree conv = NULL_TREE;
+ tree winner = NULL_TREE;
+
+ if (expr == null_node
+ && (desires & WANT_INT)
+ && !(desires & WANT_NULL))
+ cp_warning ("converting NULL to non-pointer type");
+
if (TREE_CODE (basetype) == OFFSET_TYPE)
expr = resolve_offset_ref (expr);
expr = convert_from_reference (expr);
basetype = TREE_TYPE (expr);
- switch (TREE_CODE (basetype))
- {
- case INTEGER_TYPE:
- if ((desires & WANT_NULL) && TREE_CODE (expr) == INTEGER_CST
- && integer_zerop (expr))
- return expr;
- /* else fall through... */
-
- case BOOLEAN_TYPE:
- return (desires & WANT_INT) ? expr : NULL_TREE;
- case ENUMERAL_TYPE:
- return (desires & WANT_ENUM) ? expr : NULL_TREE;
- case REAL_TYPE:
- return (desires & WANT_FLOAT) ? expr : NULL_TREE;
- case POINTER_TYPE:
- return (desires & WANT_POINTER) ? expr : NULL_TREE;
+ if (! IS_AGGR_TYPE (basetype))
+ switch (TREE_CODE (basetype))
+ {
+ case INTEGER_TYPE:
+ if ((desires & WANT_NULL) && null_ptr_cst_p (expr))
+ return expr;
+ /* else fall through... */
+
+ case BOOLEAN_TYPE:
+ return (desires & WANT_INT) ? expr : NULL_TREE;
+ case ENUMERAL_TYPE:
+ return (desires & WANT_ENUM) ? expr : NULL_TREE;
+ case REAL_TYPE:
+ return (desires & WANT_FLOAT) ? expr : NULL_TREE;
+ case POINTER_TYPE:
+ return (desires & WANT_POINTER) ? expr : NULL_TREE;
- case FUNCTION_TYPE:
- case ARRAY_TYPE:
- return ((desires & WANT_POINTER) ? default_conversion (expr)
- : NULL_TREE);
+ case FUNCTION_TYPE:
+ case ARRAY_TYPE:
+ return (desires & WANT_POINTER) ? default_conversion (expr)
+ : NULL_TREE;
+ default:
+ return NULL_TREE;
+ }
+
+ /* The code for conversions from class type is currently only used for
+ delete expressions. Other expressions are handled by build_new_op. */
+
+ if (! TYPE_HAS_CONVERSION (basetype))
+ return NULL_TREE;
+
+ for (conv = lookup_conversions (basetype); conv; conv = TREE_CHAIN (conv))
+ {
+ int win = 0;
+ tree candidate;
+ tree cand = TREE_VALUE (conv);
- default:
- break;
+ if (winner && winner == cand)
+ continue;
+
+ candidate = TREE_TYPE (TREE_TYPE (cand));
+ if (TREE_CODE (candidate) == REFERENCE_TYPE)
+ candidate = TREE_TYPE (candidate);
+
+ switch (TREE_CODE (candidate))
+ {
+ case BOOLEAN_TYPE:
+ case INTEGER_TYPE:
+ win = (desires & WANT_INT); break;
+ case ENUMERAL_TYPE:
+ win = (desires & WANT_ENUM); break;
+ case REAL_TYPE:
+ win = (desires & WANT_FLOAT); break;
+ case POINTER_TYPE:
+ win = (desires & WANT_POINTER); break;
+
+ default:
+ break;
+ }
+
+ if (win)
+ {
+ if (winner)
+ {
+ if (complain)
+ {
+ cp_error ("ambiguous default type conversion from `%T'",
+ basetype);
+ cp_error (" candidate conversions include `%D' and `%D'",
+ winner, cand);
+ }
+ return error_mark_node;
+ }
+ else
+ winner = cand;
+ }
+ }
+
+ if (winner)
+ {
+ tree type = TREE_TYPE (TREE_TYPE (winner));
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ type = TREE_TYPE (type);
+ return build_user_type_conversion (type, expr, LOOKUP_NORMAL);
}
return NULL_TREE;
@@ -1025,7 +1112,6 @@ type_promotes_to (type)
return cp_build_type_variant (type, constp, volatilep);
}
-
/* The routines below this point are carefully written to conform to
the standard. They use the same terminology, and follow the rules
closely. Although they are used only in pt.c at the moment, they
@@ -1040,7 +1126,9 @@ perform_qualification_conversions (type, expr)
tree type;
tree expr;
{
- if (comp_target_types (type, TREE_TYPE (expr), 0) == 1)
+ if (TREE_CODE (type) == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE
+ && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (TREE_TYPE (expr))))
return build1 (NOP_EXPR, type, expr);
else
return error_mark_node;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e3a79ae1c3b..e11db1c16dc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */
extern tree builtin_return_address_fndecl;
extern struct obstack permanent_obstack;
+extern struct obstack* saveable_obstack;
extern int current_class_depth;
@@ -58,6 +59,8 @@ extern int static_labelno;
extern tree current_namespace;
extern tree global_namespace;
+extern void (*print_error_function) PROTO((char *));
+
/* Stack of places to restore the search obstack back to. */
/* Obstack used for remembering local class declarations (like
@@ -132,7 +135,6 @@ static tree grokparms PROTO((tree, int));
static tree lookup_nested_type PROTO((tree, tree));
static char *redeclaration_error_message PROTO((tree, tree));
static tree push_overloaded_decl PROTO((tree, int));
-static void push_overloaded_decl_top_level PROTO((tree, int));
static struct stack_level *push_decl_level PROTO((struct stack_level *,
struct obstack *));
@@ -144,7 +146,6 @@ static void resume_binding_level PROTO((struct binding_level *));
static struct binding_level *make_binding_level PROTO((void));
static int namespace_bindings_p PROTO((void));
static void declare_namespace_level PROTO((void));
-static tree get_unique_name PROTO((void));
static void signal_catch PROTO((int));
static void storedecls PROTO((tree));
static void storetags PROTO((tree));
@@ -156,27 +157,32 @@ static tree store_bindings PROTO((tree, tree));
static tree lookup_tag_reverse PROTO((tree, tree));
static tree obscure_complex_init PROTO((tree, tree));
static tree maybe_build_cleanup_1 PROTO((tree, tree));
-static tree lookup_name_real PROTO((tree, int, int));
+static tree lookup_name_real PROTO((tree, int, int, int));
static void warn_extern_redeclared_static PROTO((tree, tree));
static void grok_reference_init PROTO((tree, tree, tree));
static tree grokfndecl PROTO((tree, tree, tree, tree, int,
- enum overload_flags,
- tree, tree, tree, int, int, int, int, int, int));
-static tree grokvardecl PROTO((tree, tree, RID_BIT_TYPE *, int, int));
+ enum overload_flags, tree,
+ tree, tree, int, int, int, int, int, int, tree));
+static tree grokvardecl PROTO((tree, tree, RID_BIT_TYPE *, int, int, tree));
static tree lookup_tag PROTO((enum tree_code, tree,
struct binding_level *, int));
static void set_identifier_type_value_with_scope
PROTO((tree, tree, struct binding_level *));
+static void set_identifier_local_value_with_scope
+ PROTO((tree, tree, struct binding_level *));
static void record_builtin_type PROTO((enum rid, char *, tree));
+static void record_unknown_type PROTO((tree, char *));
static int member_function_or_else PROTO((tree, tree, char *));
static void bad_specifiers PROTO((tree, char *, int, int, int, int,
int));
+static void lang_print_error_function PROTO((char *));
+static tree maybe_process_template_type_declaration PROTO((tree, int, struct binding_level*));
#if defined (DEBUG_CP_BINDING_LEVELS)
static void indent PROTO((void));
#endif
-/* a node which has tree code ERROR_MARK, and whose type is itself.
+/* A node which has tree code ERROR_MARK, and whose type is itself.
All erroneous expressions are replaced with this node. All functions
that accept nodes as arguments should avoid generating error messages
if this node is one of the arguments, since it is undesirable to get
@@ -231,7 +237,16 @@ tree unsigned_intSI_type_node;
tree unsigned_intDI_type_node;
tree unsigned_intTI_type_node;
-/* a VOID_TYPE node, and the same, packaged in a TREE_LIST. */
+tree java_byte_type_node;
+tree java_short_type_node;
+tree java_int_type_node;
+tree java_long_type_node;
+tree java_float_type_node;
+tree java_double_type_node;
+tree java_char_type_node;
+tree java_boolean_type_node;
+
+/* A VOID_TYPE node, and the same, packaged in a TREE_LIST. */
tree void_type_node, void_list_node;
tree void_zero_node;
@@ -263,11 +278,11 @@ tree wchar_array_type_node;
/* The bool data type, and constants */
tree boolean_type_node, boolean_true_node, boolean_false_node;
-/* type `int ()' -- used for implicit declaration of functions. */
+/* Type `int ()' -- used for implicit declaration of functions. */
tree default_function_type;
-/* function types `double (double)' and `double (double, double)', etc. */
+/* Function types `double (double)' and `double (double, double)', etc. */
static tree double_ftype_double, double_ftype_double_double;
static tree int_ftype_int, long_ftype_long;
@@ -301,6 +316,11 @@ tree __ptr_desc_array_type, __attr_dec_array_type, __func_desc_array_type;
tree __ptmf_desc_array_type, __ptmd_desc_array_type;
#endif
+/* Indicates that there is a type value in some namespace, although
+ that is not necessarily in scope at the moment. */
+
+static tree global_type_node;
+
tree class_star_type_node;
tree class_type_node, record_type_node, union_type_node, enum_type_node;
tree unknown_type_node;
@@ -309,9 +329,14 @@ tree sigtable_entry_type;
/* Array type `vtable_entry_type[]' */
tree vtbl_type_node;
+tree vtbl_ptr_type_node;
/* namespace std */
tree std_node;
+int in_std = 0;
+
+/* Expect only namespace names now. */
+static int only_namespace_names;
/* In a destructor, the point at which all derived class destroying
has been done, just before any base class destroying will be done. */
@@ -405,9 +430,8 @@ tree static_aggregates;
tree integer_zero_node;
tree null_pointer_node;
-/* The value for __null (NULL), either of type `void *' or, with -ansi,
- an integer type of the same size. */
-
+/* The value for __null (NULL), namely, a zero of an integer type with
+ the same number of bits as a pointer. */
tree null_node;
/* A node for the integer constants 1, 2, and 3. */
@@ -536,6 +560,10 @@ extern tree previous_class_values;
node, but signed. */
tree signed_size_zero_node;
+/* The name of the anonymous namespace, throughout this translation
+ unit. */
+tree anonymous_namespace_name;
+
/* Allocate a level of searching. */
@@ -589,6 +617,13 @@ struct binding_level
component_bindings. */
tree tags;
+ /* A list of USING_DECL nodes. */
+ tree usings;
+
+ /* A list of used namespaces. PURPOSE is the namespace,
+ VALUE the common ancestor with this binding_level's namespace. */
+ tree using_directives;
+
/* For each level, a list of shadowed outer-level local definitions
to be restored when this level is popped.
Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and
@@ -747,7 +782,7 @@ pop_binding_level ()
if (global_binding_level)
{
- /* cannot pop a level, if there are none left to pop. */
+ /* Cannot pop a level, if there are none left to pop. */
if (current_binding_level == global_binding_level)
my_friendly_abort (123);
}
@@ -791,7 +826,7 @@ suspend_binding_level ()
if (global_binding_level)
{
- /* cannot suspend a level, if there are none left to suspend. */
+ /* Cannot suspend a level, if there are none left to suspend. */
if (current_binding_level == global_binding_level)
my_friendly_abort (123);
}
@@ -823,29 +858,11 @@ static void
resume_binding_level (b)
struct binding_level *b;
{
- if (class_binding_level)
- {
-#if 1
- /* These are here because we cannot deal with shadows yet. */
- sorry ("cannot resume a namespace inside class");
- return;
-#else
- b->level_chain = class_binding_level;
- class_binding_level = (struct binding_level *)0;
-#endif
- }
- else
- {
-#if 1
- /* These are here because we cannot deal with shadows yet. */
- if (b->level_chain != current_binding_level)
- {
- sorry ("cannot resume a namespace inside a different namespace");
- return;
- }
-#endif
- b->level_chain = current_binding_level;
- }
+ /* Resuming binding levels is meant only for namespaces,
+ and those cannot nest into classes. */
+ my_friendly_assert(!class_binding_level, 386);
+ /* Also, resuming a non-directly nested namespace is a no-no. */
+ my_friendly_assert(b->level_chain == current_binding_level, 386);
current_binding_level = b;
#if defined(DEBUG_CP_BINDING_LEVELS)
b->binding_depth = binding_depth;
@@ -877,23 +894,15 @@ global_bindings_p ()
/* Nonzero if we are currently in a toplevel binding level. This
means either the global binding level or a namespace in a toplevel
- binding level. */
+ binding level.
+ Since there are no non-toplevel namespace levels, this really
+ means any namespace or pseudo-global level. */
int
toplevel_bindings_p ()
{
- struct binding_level *b = current_binding_level;
-
- while (1)
- {
- if (b == global_binding_level)
- return 1;
- if (b->pseudo_global)
- return 1;
- if (! b->namespace_p)
- return 0;
- b=b->level_chain;
- }
+ return current_binding_level->namespace_p
+ || current_binding_level->pseudo_global;
}
/* Nonzero if this is a namespace scope. */
@@ -1229,7 +1238,7 @@ poplevel (keep, reverse, functionbody)
IDENTIFIER_CLASS_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
for (link = current_binding_level->type_shadowed;
link; link = TREE_CHAIN (link))
- IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
+ SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link), TREE_VALUE (link));
}
/* If the level being exited is the top level of a function,
@@ -1333,35 +1342,6 @@ poplevel (keep, reverse, functionbody)
return block;
}
-/* Resume a binding level for a namespace. */
-
-void
-resume_level (b)
- struct binding_level *b;
-{
- tree decls, link;
-
- resume_binding_level (b);
-
- /* Resume the variable caches. */
- decls = current_binding_level->names;
-
- /* Restore the meanings of the local variables of this level. */
-
- for (link = decls; link; link = TREE_CHAIN (link))
- {
- /* If it doesn't have a name, there is nothing left to do with it. */
- if (DECL_NAME (link) == NULL_TREE)
- continue;
-
- IDENTIFIER_LOCAL_VALUE (DECL_NAME (link)) = link;
-
- /* If this is a TYPE_DECL, push it into the type value slot. */
- if (TREE_CODE (link) == TYPE_DECL)
- SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (link), TREE_TYPE (link));
- }
-}
-
/* Delete the node BLOCK from the current binding level.
This is used for the block inside a stmt expr ({...})
so that the block can be reinserted where appropriate. */
@@ -1486,7 +1466,7 @@ poplevel_class (force)
for (shadowed = level->type_shadowed;
shadowed;
shadowed = TREE_CHAIN (shadowed))
- IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (shadowed)) = TREE_VALUE (shadowed);
+ SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (shadowed), TREE_VALUE (shadowed));
GNU_xref_end_scope ((HOST_WIDE_INT) class_binding_level,
(HOST_WIDE_INT) class_binding_level->level_chain,
@@ -1665,76 +1645,126 @@ print_binding_stack ()
print_binding_level (global_binding_level);
}
-/* Return the tree_binding for the name in the given scope
- If there are no bindings for the name in the scope, make a new
- bindings node. This bindings list of this node will be empty, though. */
+/* Namespace binding access routines: The namespace_bindings field of
+ the identifier is polymorphic, with three possible values:
+ NULL_TREE, a list of CPLUS_BINDINGS, or any other tree_node
+ indicating the BINDING_VALUE of global_namespace. */
-tree
-binding_for_name (name, scope)
+/* Check whether the a binding for the name to scope is known.
+ Assumes that the bindings of the name are already a list
+ of bindings. Returns the binding found, or NULL_TREE. */
+
+static tree
+find_binding (name, scope)
tree name;
tree scope;
{
- tree iter;
+ tree iter, prev = NULL_TREE;
+
+ scope = ORIGINAL_NAMESPACE (scope);
+
for (iter = IDENTIFIER_NAMESPACE_BINDINGS (name); iter;
iter = TREE_CHAIN (iter))
{
my_friendly_assert (TREE_CODE (iter) == CPLUS_BINDING, 374);
if (BINDING_SCOPE (iter) == scope)
- return iter;
+ {
+ /* Move binding found to the fron of the list, so
+ subsequent lookups will find it faster. */
+ if (prev)
+ {
+ TREE_CHAIN (prev) = TREE_CHAIN (iter);
+ TREE_CHAIN (iter) = IDENTIFIER_NAMESPACE_BINDINGS (name);
+ IDENTIFIER_NAMESPACE_BINDINGS (name) = iter;
+ }
+ return iter;
+ }
+ prev = iter;
}
- /* not found, make a new permanent one */
- push_obstacks (&permanent_obstack, &permanent_obstack);
- iter = make_node (CPLUS_BINDING);
- TREE_CHAIN (iter) = IDENTIFIER_NAMESPACE_BINDINGS (name);
- IDENTIFIER_NAMESPACE_BINDINGS (name) = iter;
- BINDING_SCOPE (iter) = scope;
- BINDING_VALUE (iter) = NULL_TREE;
- pop_obstacks ();
- return iter;
+ return NULL_TREE;
}
-extern char * first_global_object_name;
-
-/* Get a unique name for each call to this routine for unnamed namespaces.
- Mostly copied from get_file_function_name. */
+/* Always returns a binding for name in scope. If the
+ namespace_bindings is not a list, convert it to one first.
+ If no binding is found, make a new one. */
-static tree
-get_unique_name ()
+tree
+binding_for_name (name, scope)
+ tree name;
+ tree scope;
{
- static int temp_name_counter = 0;
- char *buf;
- register char *p;
+ tree b = IDENTIFIER_NAMESPACE_BINDINGS (name);
+ tree result;
- if (first_global_object_name)
- p = first_global_object_name;
- else if (main_input_filename)
- p = main_input_filename;
- else
- p = input_filename;
+ scope = ORIGINAL_NAMESPACE (scope);
+
+ if (b && TREE_CODE (b) != CPLUS_BINDING)
+ {
+ /* Get rid of optimization for global scope. */
+ IDENTIFIER_NAMESPACE_BINDINGS (name) = NULL_TREE;
+ BINDING_VALUE (binding_for_name (name, global_namespace)) = b;
+ b = IDENTIFIER_NAMESPACE_BINDINGS (name);
+ }
+ if (b && (result = find_binding (name, scope)))
+ return result;
+ /* Not found, make a new permanent one. */
+ push_obstacks (&permanent_obstack, &permanent_obstack);
+ result = make_node (CPLUS_BINDING);
+ TREE_CHAIN (result) = b;
+ IDENTIFIER_NAMESPACE_BINDINGS (name) = result;
+ BINDING_SCOPE (result) = scope;
+ BINDING_TYPE (result) = NULL_TREE;
+ BINDING_VALUE (result) = NULL_TREE;
+ pop_obstacks ();
+ return result;
+}
-#define UNNAMED_NAMESPACE_FORMAT "__%s_%d"
+/* Return the binding value for name in scope, considering that
+ namespace_binding may or may not be a list of CPLUS_BINDINGS. */
- buf = (char *) alloca (sizeof (UNNAMED_NAMESPACE_FORMAT) + strlen (p));
+tree
+namespace_binding (name, scope)
+ tree name;
+ tree scope;
+{
+ tree b = IDENTIFIER_NAMESPACE_BINDINGS (name);
+ if (b == NULL_TREE)
+ return NULL_TREE;
+ if (scope == NULL_TREE)
+ scope = global_namespace;
+ if (TREE_CODE (b) != CPLUS_BINDING)
+ return (scope == global_namespace) ? b : NULL_TREE;
+ name = find_binding (name,scope);
+ if (name == NULL_TREE)
+ return name;
+ return BINDING_VALUE (name);
+}
- sprintf (buf, UNNAMED_NAMESPACE_FORMAT, p, temp_name_counter++);
+/* Set the binding value for name in scope. If modifying the binding
+ of global_namespace is attempted, try to optimize it. */
- /* Don't need to pull weird characters out of global names. */
- if (p != first_global_object_name)
+void
+set_namespace_binding (name, scope, val)
+ tree name;
+ tree scope;
+ tree val;
+{
+ tree b;
+
+ if (scope == NULL_TREE)
+ scope = global_namespace;
+
+ if (scope == global_namespace)
{
- for (p = buf+2; *p; p++)
- if (! ((*p >= '0' && *p <= '9')
-#ifndef NO_DOLLAR_IN_LABEL /* this for `$'; unlikely, but... -- kr */
- || *p == '$'
-#endif
-#ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */
- || *p == '.'
-#endif
- || (*p >= 'A' && *p <= 'Z')
- || (*p >= 'a' && *p <= 'z')))
- *p = '_';
+ b = IDENTIFIER_NAMESPACE_BINDINGS (name);
+ if (b == NULL_TREE || TREE_CODE (b) != CPLUS_BINDING)
+ {
+ IDENTIFIER_NAMESPACE_BINDINGS (name) = val;
+ return;
+ }
}
-
- return get_identifier (buf);
+ b = binding_for_name (name, scope);
+ BINDING_VALUE (b) = val;
}
/* Push into the scope of the NAME namespace. If NAME is NULL_TREE, then we
@@ -1744,79 +1774,72 @@ void
push_namespace (name)
tree name;
{
-#if 1
- tree d;
+ tree d = NULL_TREE;
int need_new = 1;
int implicit_use = 0;
- int nodecl = 0;
+ int global = 0;
if (!global_namespace)
{
- /* this must be :: */
+ /* This must be ::. */
my_friendly_assert (name == get_identifier ("::"), 377);
- nodecl = 1;
+ global = 1;
}
else if (!name)
{
- name = get_unique_name ();
+ /* The name of anonymous namespace is unique for the translation
+ unit. */
+ if (!anonymous_namespace_name)
+ anonymous_namespace_name = get_file_function_name ('N');
+ name = anonymous_namespace_name;
+ d = IDENTIFIER_NAMESPACE_VALUE (name);
+ if (d)
+ /* Reopening anonymous namespace. */
+ need_new = 0;
implicit_use = 1;
- }
+ }
+ else if (current_namespace == global_namespace
+ && name == DECL_NAME (std_node))
+ {
+ in_std++;
+ return;
+ }
else
{
- /* check whether this is an extended namespace definition */
+ /* Check whether this is an extended namespace definition. */
d = IDENTIFIER_NAMESPACE_VALUE (name);
if (d != NULL_TREE && TREE_CODE (d) == NAMESPACE_DECL)
- need_new = 0;
+ {
+ need_new = 0;
+ if (DECL_NAMESPACE_ALIAS (d))
+ {
+ cp_error ("namespace alias `%D' not allowed here, assuming `%D'",
+ d, DECL_NAMESPACE_ALIAS (d));
+ d = DECL_NAMESPACE_ALIAS (d);
+ }
+ }
}
if (need_new)
{
- /* make a new namespace, binding the name to it */
+ /* Make a new namespace, binding the name to it. */
d = build_lang_decl (NAMESPACE_DECL, name, void_type_node);
- if (!nodecl)
- d = pushdecl (d);
+ /* The global namespace is not pushed, and the global binding
+ level is set elsewhere. */
+ if (!global)
+ {
+ d = pushdecl (d);
+ pushlevel (0);
+ declare_namespace_level ();
+ NAMESPACE_LEVEL (d) = current_binding_level;
+ }
}
+ else
+ resume_binding_level (NAMESPACE_LEVEL (d));
+
if (implicit_use)
do_using_directive (d);
- /* enter the name space */
+ /* Enter the name space. */
current_namespace = d;
-
-#else
- tree old_id = get_namespace_id ();
- char *buf;
- tree d;
-
- if (! name)
- {
- /* Create a truly ugly name! */
- name = get_unique_name ();
- }
-
- d = build_lang_decl (NAMESPACE_DECL, name, void_type_node);
-
- /* Mark them as external, so redeclaration_error_message doesn't think
- they are duplicates. */
-
- DECL_EXTERNAL (d) = 1;
- d = pushdecl (d);
-
- if (NAMESPACE_LEVEL (d) == 0)
- {
- /* This is new for this compilation unit. */
- pushlevel (0);
- declare_namespace_level ();
- NAMESPACE_LEVEL (d) = current_binding_level;
- }
- else
- resume_level (NAMESPACE_LEVEL (d));
-
- /* This code is just is bit old now... */
- current_namespace = tree_cons (NULL_TREE, name, current_namespace);
- buf = (char *) alloca (4 + (old_id ? IDENTIFIER_LENGTH (old_id) : 0)
- + IDENTIFIER_LENGTH (name));
- sprintf (buf, "%s%s", old_id ? IDENTIFIER_POINTER (old_id) : "",
- IDENTIFIER_POINTER (name));
- TREE_PURPOSE (current_namespace) = get_identifier (buf);
-#endif
}
/* Pop from the scope of the current namespace. */
@@ -1824,52 +1847,44 @@ push_namespace (name)
void
pop_namespace ()
{
-#if 1
- current_namespace = DECL_NAMESPACE (current_namespace);
-#else
- tree decls, link;
- current_namespace = TREE_CHAIN (current_namespace);
-
- /* Just in case we get out of sync. */
- if (! namespace_bindings_p ())
- poplevel (0, 0, 0);
+ if (current_namespace == global_namespace)
+ {
+ my_friendly_assert (in_std>0, 980421);
+ in_std--;
+ return;
+ }
+ current_namespace = CP_DECL_CONTEXT (current_namespace);
+ /* The binding level is not popped, as it might be re-opened later. */
+ suspend_binding_level ();
+}
- decls = current_binding_level->names;
+/* Concatenate the binding levels of all namespaces. */
- /* Clear out the meanings of the local variables of this level. */
+void
+cat_namespace_levels()
+{
+ tree current;
+ tree last;
+ struct binding_level *b;
- for (link = decls; link; link = TREE_CHAIN (link))
+ last = NAMESPACE_LEVEL (global_namespace) -> names;
+ /* The nested namespaces appear in the names list of their ancestors. */
+ for (current = last; current; current = TREE_CHAIN (current))
{
- if (DECL_NAME (link) != NULL_TREE)
+ if (TREE_CODE (current) != NAMESPACE_DECL
+ || DECL_NAMESPACE_ALIAS (current))
+ continue;
+ if (!DECL_LANG_SPECIFIC (current))
{
- /* If the ident. was used or addressed via a local extern decl,
- don't forget that fact. */
- if (DECL_EXTERNAL (link))
- {
- if (TREE_USED (link))
- TREE_USED (DECL_ASSEMBLER_NAME (link)) = 1;
- if (TREE_ADDRESSABLE (link))
- TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (link)) = 1;
- }
- IDENTIFIER_LOCAL_VALUE (DECL_NAME (link)) = NULL_TREE;
+ /* Hmm. std. */
+ my_friendly_assert (current == std_node, 393);
+ continue;
}
+ b = NAMESPACE_LEVEL (current);
+ while (TREE_CHAIN (last))
+ last = TREE_CHAIN (last);
+ TREE_CHAIN (last) = NAMESPACE_LEVEL (current) -> names;
}
-
- /* Restore all name-meanings of the outer levels
- that were shadowed by this level. */
-
- for (link = current_binding_level->shadowed; link; link = TREE_CHAIN (link))
- IDENTIFIER_LOCAL_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
- for (link = current_binding_level->class_shadowed;
- link; link = TREE_CHAIN (link))
- IDENTIFIER_CLASS_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
- for (link = current_binding_level->type_shadowed;
- link; link = TREE_CHAIN (link))
- IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
-
- /* suspend a level. */
- suspend_binding_level ();
-#endif
}
/* Subroutines for reverting temporarily to top-level for instantiation
@@ -1880,8 +1895,11 @@ pop_namespace ()
struct saved_scope {
struct binding_level *old_binding_level;
tree old_bindings;
+ tree old_namespace;
struct saved_scope *prev;
- tree class_name, class_type, function_decl;
+ tree class_name, class_type;
+ tree access_specifier;
+ tree function_decl;
struct binding_level *class_bindings;
tree *lang_base, *lang_stack, lang_name;
int lang_stacksize;
@@ -1935,7 +1953,7 @@ store_bindings (names, old_bindings)
{
my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 135);
TREE_VEC_ELT (binding, 0) = id;
- TREE_VEC_ELT (binding, 1) = IDENTIFIER_TYPE_VALUE (id);
+ TREE_VEC_ELT (binding, 1) = REAL_IDENTIFIER_TYPE_VALUE (id);
TREE_VEC_ELT (binding, 2) = IDENTIFIER_LOCAL_VALUE (id);
TREE_VEC_ELT (binding, 3) = IDENTIFIER_CLASS_VALUE (id);
IDENTIFIER_LOCAL_VALUE (id) = NULL_TREE;
@@ -1971,6 +1989,10 @@ maybe_push_to_top_level (pseudo)
{
tree t;
+ /* Template IDs are inserted into the global level. If they were
+ inserted into namespace level, finish_file wouldn't find them
+ when doing pending instantiations. Therefore, don't stop at
+ namespace level, but continue until :: . */
if (b == global_binding_level || (pseudo && b->pseudo_global))
break;
@@ -1988,8 +2010,10 @@ maybe_push_to_top_level (pseudo)
s->old_binding_level = current_binding_level;
current_binding_level = b;
+ s->old_namespace = current_namespace;
s->class_name = current_class_name;
s->class_type = current_class_type;
+ s->access_specifier = current_access_specifier;
s->function_decl = current_function_decl;
s->class_bindings = class_binding_level;
s->lang_stack = current_lang_stack;
@@ -2014,12 +2038,14 @@ maybe_push_to_top_level (pseudo)
current_lang_name = lang_name_cplusplus;
strict_prototype = strict_prototypes_lang_cplusplus;
named_labels = NULL_TREE;
+ shadowed_labels = NULL_TREE;
minimal_parse_mode = 0;
previous_class_type = previous_class_values = NULL_TREE;
processing_specialization = 0;
processing_explicit_instantiation = 0;
current_template_parms = NULL_TREE;
processing_template_decl = 0;
+ current_namespace = global_namespace;
s->prev = current_saved_scope;
s->old_bindings = old_bindings;
@@ -2058,7 +2084,7 @@ pop_from_top_level ()
tree id = TREE_VEC_ELT (t, 0);
if (id)
{
- IDENTIFIER_TYPE_VALUE (id) = TREE_VEC_ELT (t, 1);
+ SET_IDENTIFIER_TYPE_VALUE (id, TREE_VEC_ELT (t, 1));
IDENTIFIER_LOCAL_VALUE (id) = TREE_VEC_ELT (t, 2);
IDENTIFIER_CLASS_VALUE (id) = TREE_VEC_ELT (t, 3);
}
@@ -2066,8 +2092,10 @@ pop_from_top_level ()
TREE_CHAIN (save) = free_binding_vecs;
free_binding_vecs = save;
}
+ current_namespace = s->old_namespace;
current_class_name = s->class_name;
current_class_type = s->class_type;
+ current_access_specifier = s->access_specifier;
current_function_decl = s->function_decl;
class_binding_level = s->class_bindings;
free (current_lang_base);
@@ -2113,12 +2141,21 @@ set_identifier_type_value_with_scope (id, type, b)
tree type;
struct binding_level *b;
{
- if (b != global_binding_level)
+ if (!b->namespace_p)
{
- tree old_type_value = IDENTIFIER_TYPE_VALUE (id);
+ /* Shadow the marker, not the real thing, so that the marker
+ gets restored later. */
+ tree old_type_value = REAL_IDENTIFIER_TYPE_VALUE (id);
b->type_shadowed
= tree_cons (id, old_type_value, b->type_shadowed);
}
+ else
+ {
+ tree binding = binding_for_name (id, current_namespace);
+ BINDING_TYPE (binding) = type;
+ /* Store marker instead of real type. */
+ type = global_type_node;
+ }
SET_IDENTIFIER_TYPE_VALUE (id, type);
}
@@ -2132,6 +2169,46 @@ set_identifier_type_value (id, type)
set_identifier_type_value_with_scope (id, type, inner_binding_level);
}
+static void
+set_identifier_local_value_with_scope (id, val, b)
+ tree id, val;
+ struct binding_level *b;
+{
+ tree oldlocal;
+ my_friendly_assert (! b->namespace_p, 980716);
+
+ oldlocal = IDENTIFIER_LOCAL_VALUE (id);
+ b->shadowed = tree_cons (id, oldlocal, b->shadowed);
+ IDENTIFIER_LOCAL_VALUE (id) = val;
+}
+
+void
+set_identifier_local_value (id, val)
+ tree id, val;
+{
+ set_identifier_local_value_with_scope (id, val, current_binding_level);
+}
+
+/* Return the type associated with id. */
+
+tree
+identifier_type_value (id)
+ tree id;
+{
+ /* There is no type with that name, anywhere. */
+ if (REAL_IDENTIFIER_TYPE_VALUE (id) == NULL_TREE)
+ return NULL_TREE;
+ /* This is not the type marker, but the real thing. */
+ if (REAL_IDENTIFIER_TYPE_VALUE (id) != global_type_node)
+ return REAL_IDENTIFIER_TYPE_VALUE (id);
+ /* Have to search for it. It must be on the global level, now.
+ Ask lookup_name not to return non-types. */
+ id = lookup_name_real (id, 2, 1, 0);
+ if (id)
+ return TREE_TYPE (id);
+ return NULL_TREE;
+}
+
/* Pop off extraneous binding levels left over due to syntax errors.
We don't pop past namespaces, as they might be valid. */
@@ -2154,6 +2231,93 @@ pop_everything ()
#endif
}
+/* The type TYPE is being declared. If it is a class template, or a
+ specialization of a class template, do any processing required and
+ perform error-checking. If IS_FRIEND is non-zero, this TYPE is
+ being declared a friend. B is the binding level at which this TYPE
+ should be bound.
+
+ Returns the TYPE_DECL for TYPE, which may have been altered by this
+ processing. */
+
+static tree
+maybe_process_template_type_declaration (type, globalize, b)
+ tree type;
+ int globalize;
+ struct binding_level* b;
+{
+ tree decl = TYPE_NAME (type);
+
+ if (processing_template_parmlist)
+ /* You can't declare a new template type in a template parameter
+ list. But, you can declare a non-template type:
+
+ template <class A*> struct S;
+
+ is a forward-declaration of `A'. */
+ ;
+ else
+ {
+ maybe_check_template_type (type);
+
+ my_friendly_assert (IS_AGGR_TYPE (type)
+ || TREE_CODE (type) == ENUMERAL_TYPE, 0);
+
+
+ if (/* If !GLOBALIZE then we are looking at a definition.
+ It may not be a primary template. (For example, in:
+
+ template <class T>
+ struct S1 { class S2 {}; }
+
+ we have to push_template_decl for S2.) */
+ (processing_template_decl && !globalize)
+ /* If we are declaring a friend template class, we will
+ have GLOBALIZE set, since something like:
+
+ template <class T>
+ struct S1 {
+ template <class U>
+ friend class S2;
+ };
+
+ declares S2 to be at global scope. */
+ || PROCESSING_REAL_TEMPLATE_DECL_P ())
+ {
+ /* This may change after the call to
+ push_template_decl_real, but we want the original value. */
+ tree name = DECL_NAME (decl);
+
+ decl = push_template_decl_real (decl, globalize);
+ /* If the current binding level is the binding level for the
+ template parameters (see the comment in
+ begin_template_parm_list) and the enclosing level is a class
+ scope, and we're not looking at a friend, push the
+ declaration of the member class into the class scope. In the
+ friend case, push_template_decl will already have put the
+ friend into global scope, if appropriate. */
+ if (TREE_CODE (type) != ENUMERAL_TYPE
+ && !globalize && b->pseudo_global
+ && b->level_chain->parm_flag == 2)
+ {
+ pushdecl_with_scope (CLASSTYPE_TI_TEMPLATE (type),
+ b->level_chain);
+ finish_member_declaration (CLASSTYPE_TI_TEMPLATE (type));
+ /* Put this tag on the list of tags for the class, since
+ that won't happen below because B is not the class
+ binding level, but is instead the pseudo-global level. */
+ b->level_chain->tags =
+ saveable_tree_cons (name, type, b->level_chain->tags);
+ TREE_NONLOCAL_FLAG (type) = 1;
+ if (TYPE_SIZE (current_class_type) == NULL_TREE)
+ CLASSTYPE_TAGS (current_class_type) = b->level_chain->tags;
+ }
+ }
+ }
+
+ return decl;
+}
+
/* Push a tag name NAME for struct/class/union/enum type TYPE.
Normally put it into the inner-most non-tag-transparent scope,
but if GLOBALIZE is true, put it in the inner-most non-class scope.
@@ -2198,6 +2362,9 @@ pushtag (name, type, globalize)
c_decl = TREE_CODE (context) == FUNCTION_DECL
? context : TYPE_MAIN_DECL (context);
+ if (!context)
+ context = current_namespace;
+
/* Do C++ gratuitous typedefing. */
if (IDENTIFIER_TYPE_VALUE (name) != type)
{
@@ -2214,6 +2381,8 @@ pushtag (name, type, globalize)
{
newdecl = 1;
d = build_decl (TYPE_DECL, name, type);
+ if (current_lang_name == lang_name_java)
+ TYPE_FOR_JAVA (type) = 1;
SET_DECL_ARTIFICIAL (d);
if (! in_class)
set_identifier_type_value_with_scope (name, type, b);
@@ -2222,48 +2391,21 @@ pushtag (name, type, globalize)
d = TYPE_MAIN_DECL (d);
TYPE_NAME (type) = d;
- DECL_CONTEXT (d) = context;
-
- if (IS_AGGR_TYPE (type)
- && (/* If !GLOBALIZE then we are looking at a
- definition. It may not be a primary template.
- (For example, in:
-
- template <class T>
- struct S1 { class S2 {}; }
-
- we have to push_template_decl for S2.) */
- (processing_template_decl && !globalize)
- /* If we are declaring a friend template class, we
- will have GLOBALIZE set, since something like:
-
- template <class T>
- struct S1 {
- template <class U>
- friend class S2;
- };
+ DECL_CONTEXT (d) = FROB_CONTEXT (context);
- declares S2 to be at global scope. */
- || (processing_template_decl >
- template_class_depth (current_class_type))))
- {
- d = push_template_decl_real (d, globalize);
- /* If the current binding level is the binding level for
- the template parameters (see the comment in
- begin_template_parm_list) and the enclosing level is
- a class scope, and we're not looking at a friend,
- push the declaration of the member class into the
- class scope. In the friend case, push_template_decl
- will already have put the friend into global scope,
- if appropriate. */
- if (!globalize && b->pseudo_global &&
- b->level_chain->parm_flag == 2)
- pushdecl_with_scope (CLASSTYPE_TI_TEMPLATE (type),
- b->level_chain);
- }
+ d = maybe_process_template_type_declaration (type,
+ globalize, b);
if (b->parm_flag == 2)
- d = pushdecl_class_level (d);
+ {
+ pushdecl_class_level (d);
+ if (newdecl && !PROCESSING_REAL_TEMPLATE_DECL_P ())
+ /* Put this TYPE_DECL on the TYPE_FIELDS list for the
+ class. But if it's a member template class, we
+ want the TEMPLATE_DECL, not the TYPE_DECL, so this
+ is done later. */
+ finish_member_declaration (d);
+ }
else
d = pushdecl_with_scope (d, b);
@@ -2274,8 +2416,9 @@ pushtag (name, type, globalize)
TYPE_CONTEXT (type) = DECL_CONTEXT (d);
DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
- DECL_ASSEMBLER_NAME (d)
- = get_identifier (build_overload_name (type, 1, 1));
+ if (!uses_template_parms (type))
+ DECL_ASSEMBLER_NAME (d)
+ = get_identifier (build_overload_name (type, 1, 1));
}
}
if (b->parm_flag == 2)
@@ -2372,6 +2515,11 @@ decls_match (newdecl, olddecl)
tree p1 = TYPE_ARG_TYPES (f1);
tree p2 = TYPE_ARG_TYPES (f2);
+ if (DECL_REAL_CONTEXT (newdecl) != DECL_REAL_CONTEXT (olddecl)
+ && ! (DECL_LANGUAGE (newdecl) == lang_c
+ && DECL_LANGUAGE (olddecl) == lang_c))
+ return 0;
+
/* When we parse a static member function definition,
we put together a FUNCTION_DECL which thinks its type
is METHOD_TYPE. Change that to FUNCTION_TYPE, and
@@ -2437,20 +2585,9 @@ decls_match (newdecl, olddecl)
types_match = TREE_TYPE (newdecl) == NULL_TREE;
else if (TREE_TYPE (newdecl) == NULL_TREE)
types_match = 0;
- /* Qualifiers must match, and they may be present on either, the type
- or the decl. */
- else if ((TREE_READONLY (newdecl)
- || TYPE_READONLY (TREE_TYPE (newdecl)))
- == (TREE_READONLY (olddecl)
- || TYPE_READONLY (TREE_TYPE (olddecl)))
- && (TREE_THIS_VOLATILE (newdecl)
- || TYPE_VOLATILE (TREE_TYPE (newdecl)))
- == (TREE_THIS_VOLATILE (olddecl)
- || TYPE_VOLATILE (TREE_TYPE (olddecl))))
- types_match = comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (newdecl)),
- TYPE_MAIN_VARIANT (TREE_TYPE (olddecl)), 1);
else
- types_match = 0;
+ types_match = comptypes (TREE_TYPE (newdecl),
+ TREE_TYPE (olddecl), 1);
}
return types_match;
@@ -2514,29 +2651,23 @@ duplicate_decls (newdecl, olddecl)
extern struct obstack permanent_obstack;
unsigned olddecl_uid = DECL_UID (olddecl);
int olddecl_friend = 0, types_match = 0;
- int new_defines_function;
+ int new_defines_function = 0;
if (newdecl == olddecl)
return 1;
- if (TREE_CODE_CLASS (TREE_CODE (olddecl)) == 'd')
- DECL_MACHINE_ATTRIBUTES (newdecl)
- = merge_machine_decl_attributes (olddecl, newdecl);
-
types_match = decls_match (newdecl, olddecl);
- if (TREE_CODE (olddecl) != TREE_LIST)
- olddecl_friend = DECL_LANG_SPECIFIC (olddecl) && DECL_FRIEND_P (olddecl);
-
/* If either the type of the new decl or the type of the old decl is an
error_mark_node, then that implies that we have already issued an
error (earlier) for some bogus type specification, and in that case,
it is rather pointless to harass the user with yet more error message
- about the same declaration, so well just pretent the types match here. */
+ about the same declaration, so just pretend the types match here. */
if (TREE_TYPE (newdecl) == error_mark_node
|| TREE_TYPE (olddecl) == error_mark_node)
types_match = 1;
-
+
+ /* Check for redeclaration and other discrepancies. */
if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_ARTIFICIAL (olddecl)
&& (DECL_BUILT_IN (olddecl) || DECL_BUILT_IN_NONANSI (olddecl)))
@@ -2580,12 +2711,30 @@ duplicate_decls (newdecl, olddecl)
}
else if (TREE_CODE (olddecl) != TREE_CODE (newdecl))
{
+ if ((TREE_CODE (olddecl) == TYPE_DECL && DECL_ARTIFICIAL (olddecl)
+ && TREE_CODE (newdecl) != TYPE_DECL
+ && ! (TREE_CODE (newdecl) == TEMPLATE_DECL
+ && TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL))
+ || (TREE_CODE (newdecl) == TYPE_DECL && DECL_ARTIFICIAL (newdecl)
+ && TREE_CODE (olddecl) != TYPE_DECL
+ && ! (TREE_CODE (olddecl) == TEMPLATE_DECL
+ && (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl))
+ == TYPE_DECL))))
+ {
+ /* We do nothing special here, because C++ does such nasty
+ things with TYPE_DECLs. Instead, just let the TYPE_DECL
+ get shadowed, and know that if we need to find a TYPE_DECL
+ for a given name, we can look in the IDENTIFIER_TYPE_VALUE
+ slot of the identifier. */
+ return 0;
+ }
+
if ((TREE_CODE (newdecl) == FUNCTION_DECL
&& DECL_FUNCTION_TEMPLATE_P (olddecl))
|| (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_FUNCTION_TEMPLATE_P (newdecl)))
return 0;
-
+
cp_error ("`%#D' redeclared as different kind of symbol", newdecl);
if (TREE_CODE (olddecl) == TREE_LIST)
olddecl = TREE_VALUE (olddecl);
@@ -2675,6 +2824,11 @@ duplicate_decls (newdecl, olddecl)
/* One of the declarations is a template instantiation, and the
other is not a template at all. That's OK. */
return 0;
+ else if (TREE_CODE (newdecl) == NAMESPACE_DECL
+ && DECL_NAMESPACE_ALIAS (newdecl)
+ && DECL_NAMESPACE_ALIAS (newdecl) == DECL_NAMESPACE_ALIAS (olddecl))
+ /* Redeclaration of namespace alias, ignore it. */
+ return 1;
else
{
char *errmsg = redeclaration_error_message (newdecl, olddecl);
@@ -2683,7 +2837,7 @@ duplicate_decls (newdecl, olddecl)
cp_error (errmsg, newdecl);
if (DECL_NAME (olddecl) != NULL_TREE)
cp_error_at ((DECL_INITIAL (olddecl)
- && current_binding_level == global_binding_level)
+ && namespace_bindings_p ())
? "`%#D' previously defined here"
: "`%#D' previously declared here", olddecl);
}
@@ -2757,13 +2911,6 @@ duplicate_decls (newdecl, olddecl)
olddecl);
}
}
- /* These bits are logically part of the type for non-functions. */
- else if (TREE_READONLY (newdecl) != TREE_READONLY (olddecl)
- || TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl))
- {
- cp_pedwarn ("type qualifiers for `%#D'", newdecl);
- cp_pedwarn_at ("conflict with previous decl `%#D'", olddecl);
- }
}
/* If new decl is `static' and an `extern' was seen previously,
@@ -2783,8 +2930,6 @@ duplicate_decls (newdecl, olddecl)
DECL_CONTEXT (newdecl) = DECL_CONTEXT (olddecl);
if (DECL_CLASS_CONTEXT (olddecl))
DECL_CLASS_CONTEXT (newdecl) = DECL_CLASS_CONTEXT (olddecl);
- if (DECL_CHAIN (newdecl) == NULL_TREE)
- DECL_CHAIN (newdecl) = DECL_CHAIN (olddecl);
if (DECL_PENDING_INLINE_INFO (newdecl) == (struct pending_inline *)0)
DECL_PENDING_INLINE_INFO (newdecl) = DECL_PENDING_INLINE_INFO (olddecl);
DECL_STATIC_CONSTRUCTOR (newdecl) |= DECL_STATIC_CONSTRUCTOR (olddecl);
@@ -2792,6 +2937,21 @@ duplicate_decls (newdecl, olddecl)
DECL_ABSTRACT_VIRTUAL_P (newdecl) |= DECL_ABSTRACT_VIRTUAL_P (olddecl);
DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl);
DECL_NEEDS_FINAL_OVERRIDER_P (newdecl) |= DECL_NEEDS_FINAL_OVERRIDER_P (olddecl);
+ new_defines_function = DECL_INITIAL (newdecl) != NULL_TREE;
+
+ /* Optionally warn about more than one declaration for the same
+ name, but don't warn about a function declaration followed by a
+ definition. */
+ if (warn_redundant_decls && ! DECL_ARTIFICIAL (olddecl)
+ && !(new_defines_function && DECL_INITIAL (olddecl) == NULL_TREE)
+ /* Don't warn about extern decl followed by definition. */
+ && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
+ /* Don't warn about friends, let add_friend take care of it. */
+ && ! DECL_FRIEND_P (newdecl))
+ {
+ cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
+ cp_warning_at ("previous declaration of `%D'", olddecl);
+ }
}
/* Deal with C++: must preserve virtual function table size. */
@@ -2809,41 +2969,27 @@ duplicate_decls (newdecl, olddecl)
}
}
- /* Special handling ensues if new decl is a function definition. */
- new_defines_function = (TREE_CODE (newdecl) == FUNCTION_DECL
- && DECL_INITIAL (newdecl) != NULL_TREE);
-
- /* Optionally warn about more than one declaration for the same name,
- but don't warn about a function declaration followed by a definition. */
- if (warn_redundant_decls
- && ! DECL_ARTIFICIAL (olddecl)
- && !(new_defines_function && DECL_INITIAL (olddecl) == NULL_TREE)
- /* Don't warn about extern decl followed by (tentative) definition. */
- && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
- /* Don't warn about friends, let add_friend take care of it. */
- && (TREE_CODE (newdecl) == FUNCTION_DECL && ! DECL_FRIEND_P (newdecl)))
- {
- cp_warning ("redundant redeclaration of `%D' in same scope", newdecl);
- cp_warning_at ("previous declaration of `%D'", olddecl);
- }
-
/* Copy all the DECL_... slots specified in the new decl
except for any that we copy here from the old type. */
+ DECL_MACHINE_ATTRIBUTES (newdecl)
+ = merge_machine_decl_attributes (olddecl, newdecl);
if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{
- if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE)
- {
- if (! duplicate_decls (DECL_TEMPLATE_RESULT (newdecl),
- DECL_TEMPLATE_RESULT (olddecl)))
- cp_error ("invalid redeclaration of %D", newdecl);
- TREE_TYPE (olddecl) = TREE_TYPE (DECL_TEMPLATE_RESULT (olddecl));
- DECL_TEMPLATE_PARMS (olddecl) = DECL_TEMPLATE_PARMS (newdecl);
- DECL_TEMPLATE_INFO (olddecl) = DECL_TEMPLATE_INFO (newdecl);
- }
+ if (! duplicate_decls (DECL_TEMPLATE_RESULT (newdecl),
+ DECL_TEMPLATE_RESULT (olddecl)))
+ cp_error ("invalid redeclaration of %D", newdecl);
+ TREE_TYPE (olddecl) = TREE_TYPE (DECL_TEMPLATE_RESULT (olddecl));
+ DECL_TEMPLATE_PARMS (olddecl) = DECL_TEMPLATE_PARMS (newdecl);
+ if (DECL_TEMPLATE_INFO (newdecl))
+ DECL_TEMPLATE_INFO (olddecl) = DECL_TEMPLATE_INFO (newdecl);
+ DECL_TEMPLATE_SPECIALIZATIONS (olddecl)
+ = chainon (DECL_TEMPLATE_SPECIALIZATIONS (olddecl),
+ DECL_TEMPLATE_SPECIALIZATIONS (newdecl));
+
return 1;
}
-
+
if (types_match)
{
/* Automatically handles default parameters. */
@@ -2875,8 +3021,8 @@ duplicate_decls (newdecl, olddecl)
TREE_TYPE (olddecl) = build_exception_variant (newtype,
TYPE_RAISES_EXCEPTIONS (oldtype));
- if ((pedantic || (! DECL_IN_SYSTEM_HEADER (olddecl)
- && DECL_SOURCE_LINE (olddecl) != 0))
+ if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl))
+ && DECL_SOURCE_LINE (olddecl) != 0
&& flag_exceptions
&& ! compexcepttypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl)))
{
@@ -2888,7 +3034,7 @@ duplicate_decls (newdecl, olddecl)
TREE_TYPE (newdecl) = TREE_TYPE (olddecl) = newtype;
/* Lay the type out, unless already done. */
- if (oldtype != TREE_TYPE (newdecl)
+ if (newtype != canonical_type_variant (oldtype)
&& TREE_TYPE (newdecl) != error_mark_node
&& !(processing_template_decl && uses_template_parms (newdecl)))
layout_type (TREE_TYPE (newdecl));
@@ -2914,6 +3060,9 @@ duplicate_decls (newdecl, olddecl)
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl);
DECL_SOURCE_LINE (newdecl) = DECL_SOURCE_LINE (olddecl);
+ if (DECL_LANG_SPECIFIC (newdecl)
+ && DECL_LANG_SPECIFIC (olddecl))
+ DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
}
/* Merge the section attribute.
@@ -2954,12 +3103,23 @@ duplicate_decls (newdecl, olddecl)
TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl);
if (! DECL_EXTERNAL (olddecl))
DECL_EXTERNAL (newdecl) = 0;
-
- if (DECL_LANG_SPECIFIC (newdecl))
+
+ if (DECL_LANG_SPECIFIC (newdecl) && DECL_LANG_SPECIFIC (olddecl))
{
DECL_INTERFACE_KNOWN (newdecl) |= DECL_INTERFACE_KNOWN (olddecl);
DECL_NOT_REALLY_EXTERN (newdecl) |= DECL_NOT_REALLY_EXTERN (olddecl);
DECL_COMDAT (newdecl) |= DECL_COMDAT (olddecl);
+ /* Don't really know how much of the language-specific
+ values we should copy from old to new. */
+ DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl);
+ DECL_ACCESS (newdecl) = DECL_ACCESS (olddecl);
+ DECL_NONCONVERTING_P (newdecl) = DECL_NONCONVERTING_P (olddecl);
+ if (DECL_TEMPLATE_INFO (newdecl) == NULL_TREE)
+ {
+ DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl);
+ DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl);
+ }
+ olddecl_friend = DECL_FRIEND_P (olddecl);
}
if (TREE_CODE (newdecl) == FUNCTION_DECL)
@@ -3044,34 +3204,12 @@ duplicate_decls (newdecl, olddecl)
NAMESPACE_LEVEL (newdecl) = NAMESPACE_LEVEL (olddecl);
}
- if (TREE_CODE (newdecl) == TEMPLATE_DECL)
- {
- DECL_TEMPLATE_SPECIALIZATIONS (newdecl)
- = DECL_TEMPLATE_SPECIALIZATIONS (olddecl);
- if (DECL_CHAIN (newdecl) == NULL_TREE)
- DECL_CHAIN (newdecl) = DECL_CHAIN (olddecl);
- }
-
/* Now preserve various other info from the definition. */
TREE_ADDRESSABLE (newdecl) = TREE_ADDRESSABLE (olddecl);
TREE_ASM_WRITTEN (newdecl) = TREE_ASM_WRITTEN (olddecl);
DECL_COMMON (newdecl) = DECL_COMMON (olddecl);
DECL_ASSEMBLER_NAME (newdecl) = DECL_ASSEMBLER_NAME (olddecl);
- /* Don't really know how much of the language-specific
- values we should copy from old to new. */
- if (DECL_LANG_SPECIFIC (olddecl))
- {
- DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl);
- DECL_ACCESS (newdecl) = DECL_ACCESS (olddecl);
- DECL_NONCONVERTING_P (newdecl) = DECL_NONCONVERTING_P (olddecl);
- if (DECL_TEMPLATE_INFO (newdecl) == NULL_TREE)
- {
- DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl);
- DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl);
- }
- }
-
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
int function_size;
@@ -3189,14 +3327,15 @@ pushdecl (x)
register tree name = DECL_ASSEMBLER_NAME (x);
register struct binding_level *b = current_binding_level;
- if (x != current_function_decl
+ if (current_function_decl && x != current_function_decl
+ /* A local declaration for a function doesn't constitute nesting. */
+ && (TREE_CODE (x) != FUNCTION_DECL || DECL_INITIAL (x))
/* Don't change DECL_CONTEXT of virtual methods. */
&& (TREE_CODE (x) != FUNCTION_DECL || !DECL_VIRTUAL_P (x))
&& ! DECL_CONTEXT (x))
DECL_CONTEXT (x) = current_function_decl;
- /* A local declaration for a function doesn't constitute nesting. */
- if (TREE_CODE (x) == FUNCTION_DECL && DECL_INITIAL (x) == 0)
- DECL_CONTEXT (x) = 0;
+ if (!DECL_CONTEXT (x))
+ DECL_CONTEXT (x) = FROB_CONTEXT (current_namespace);
/* Type are looked up using the DECL_NAME, as that is what the rest of the
compiler wants to use. */
@@ -3215,7 +3354,11 @@ pushdecl (x)
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
name = TREE_OPERAND (name, 0);
- t = lookup_name_current_level (name);
+ /* Namespace-scoped variables are not found in the current level. */
+ if (TREE_CODE (x) == VAR_DECL && DECL_NAMESPACE_SCOPE_P (x))
+ t = namespace_binding (name, DECL_CONTEXT (x));
+ else
+ t = lookup_name_current_level (name);
if (t == error_mark_node)
{
/* error_mark_node is 0 for a while during initialization! */
@@ -3243,7 +3386,7 @@ pushdecl (x)
else if (((TREE_CODE (x) == FUNCTION_DECL && DECL_LANGUAGE (x) == lang_c)
|| DECL_FUNCTION_TEMPLATE_P (x))
&& is_overloaded_fn (t))
- /* don't do anything just yet */;
+ /* Don't do anything just yet. */;
else if (t == wchar_decl_node)
{
if (pedantic && ! DECL_IN_SYSTEM_HEADER (x))
@@ -3254,24 +3397,7 @@ pushdecl (x)
}
else if (TREE_CODE (t) != TREE_CODE (x))
{
- if ((TREE_CODE (t) == TYPE_DECL && DECL_ARTIFICIAL (t)
- && TREE_CODE (x) != TYPE_DECL
- && ! (TREE_CODE (x) == TEMPLATE_DECL
- && TREE_CODE (DECL_TEMPLATE_RESULT (x)) == TYPE_DECL))
- || (TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)
- && TREE_CODE (t) != TYPE_DECL
- && ! (TREE_CODE (t) == TEMPLATE_DECL
- && (TREE_CODE (DECL_TEMPLATE_RESULT (t))
- == TYPE_DECL))))
- {
- /* We do nothing special here, because C++ does such nasty
- things with TYPE_DECLs. Instead, just let the TYPE_DECL
- get shadowed, and know that if we need to find a TYPE_DECL
- for a given name, we can look in the IDENTIFIER_TYPE_VALUE
- slot of the identifier. */
- ;
- }
- else if (duplicate_decls (x, t))
+ if (duplicate_decls (x, t))
return t;
}
else if (duplicate_decls (x, t))
@@ -3313,6 +3439,20 @@ pushdecl (x)
return t;
}
+ else if (DECL_MAIN_P (x))
+ {
+ /* A redeclaration of main, but not a duplicate of the
+ previous one.
+
+ [basic.start.main]
+
+ This function shall not be overloaded. */
+ cp_error_at ("invalid redeclaration of `%D'", t);
+ cp_error ("as `%D'", x);
+ /* We don't try to push this declaration since that
+ causes a crash. */
+ return x;
+ }
}
if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_FUNCTION_MEMBER_P (x))
@@ -3321,7 +3461,7 @@ pushdecl (x)
if (t != x || DECL_LANGUAGE (x) == lang_c)
return t;
}
- else if (DECL_FUNCTION_TEMPLATE_P (x) && DECL_CONTEXT (x) == NULL_TREE)
+ else if (DECL_FUNCTION_TEMPLATE_P (x) && DECL_NAMESPACE_SCOPE_P (x))
return push_overloaded_decl (x, 0);
/* If declaring a type as a typedef, copy the type (unless we're
@@ -3335,13 +3475,22 @@ pushdecl (x)
if (TYPE_NAME (type) == 0)
TYPE_NAME (type) = x;
}
- else if (type != error_mark_node && TYPE_NAME (type) != x)
+ else if (type != error_mark_node && TYPE_NAME (type) != x
+ /* We don't want to copy the type when all we're
+ doing is making a TYPE_DECL for the purposes of
+ inlining. */
+ && (!TYPE_NAME (type)
+ || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x)))
{
+ push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
+
DECL_ORIGINAL_TYPE (x) = type;
type = build_type_copy (type);
TYPE_STUB_DECL (type) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x));
TYPE_NAME (type) = x;
TREE_TYPE (x) = type;
+
+ pop_obstacks ();
}
if (type != error_mark_node
@@ -3359,12 +3508,11 @@ pushdecl (x)
if (TREE_PUBLIC (x) && TREE_CODE (x) != FUNCTION_DECL)
{
tree decl;
- tree bindings = binding_for_name (name, current_namespace);
- if (BINDING_VALUE (bindings) != NULL_TREE
- && (DECL_EXTERNAL (BINDING_VALUE (bindings))
- || TREE_PUBLIC (BINDING_VALUE (bindings))))
- decl = BINDING_VALUE (bindings);
+ if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE
+ && (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name))
+ || TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name))))
+ decl = IDENTIFIER_NAMESPACE_VALUE (name);
else
decl = NULL_TREE;
@@ -3380,14 +3528,13 @@ pushdecl (x)
/* This name is new in its binding level.
Install the new declaration and return it. */
- if (b == global_binding_level)
+ if (namespace_bindings_p ())
{
/* Install a global value. */
- tree bindings = binding_for_name (name, current_namespace);
/* If the first global decl has external linkage,
warn if we later see static one. */
- if (BINDING_VALUE (bindings) == NULL_TREE && TREE_PUBLIC (x))
+ if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x))
TREE_PUBLIC (name) = 1;
/* Don't install an artificial TYPE_DECL if we already have
@@ -3397,9 +3544,10 @@ pushdecl (x)
|| ! DECL_ARTIFICIAL (x))
{
if (TREE_CODE (x) == FUNCTION_DECL)
- my_friendly_assert ((BINDING_VALUE (bindings) == NULL_TREE)
- || BINDING_VALUE (bindings) == x, 378);
- BINDING_VALUE (bindings) = x;
+ my_friendly_assert
+ ((IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE)
+ || (IDENTIFIER_GLOBAL_VALUE (name) == x), 378);
+ SET_IDENTIFIER_NAMESPACE_VALUE (name, x);
}
/* Don't forget if the function was used via an implicit decl. */
@@ -3429,17 +3577,14 @@ pushdecl (x)
{
/* Here to install a non-global value. */
tree oldlocal = IDENTIFIER_LOCAL_VALUE (name);
- tree oldglobal = binding_for_name (name, current_namespace);
+ tree oldglobal = IDENTIFIER_NAMESPACE_VALUE (name);
/* Don't install an artificial TYPE_DECL if we already have
another _DECL with that name. */
if (TREE_CODE (x) != TYPE_DECL
|| t == NULL_TREE
|| ! DECL_ARTIFICIAL (x))
- {
- b->shadowed = tree_cons (name, oldlocal, b->shadowed);
- IDENTIFIER_LOCAL_VALUE (name) = x;
- }
+ set_identifier_local_value_with_scope (name, x, b);
/* If this is a TYPE_DECL, push it into the type value slot. */
if (TREE_CODE (x) == TYPE_DECL)
@@ -3455,24 +3600,24 @@ pushdecl (x)
have a global definition or declaration for the function. */
if (oldlocal == NULL_TREE
&& DECL_EXTERNAL (x)
- && BINDING_VALUE (oldglobal) != NULL_TREE
+ && oldglobal != NULL_TREE
&& TREE_CODE (x) == FUNCTION_DECL
- && TREE_CODE (BINDING_VALUE (oldglobal)) == FUNCTION_DECL)
+ && TREE_CODE (oldglobal) == FUNCTION_DECL)
{
/* We have one. Their types must agree. */
- if (decls_match (x, BINDING_VALUE (oldglobal)))
+ if (decls_match (x, oldglobal))
/* OK */;
else
{
cp_warning ("extern declaration of `%#D' doesn't match", x);
- cp_warning_at ("global declaration `%#D'", BINDING_VALUE (oldglobal));
+ cp_warning_at ("global declaration `%#D'", oldglobal);
}
}
/* If we have a local external declaration,
and no file-scope declaration has yet been seen,
then if we later have a file-scope decl it must not be static. */
if (oldlocal == NULL_TREE
- && BINDING_VALUE (oldglobal) == NULL_TREE
+ && oldglobal == NULL_TREE
&& DECL_EXTERNAL (x)
&& TREE_PUBLIC (x))
{
@@ -3522,13 +3667,23 @@ pushdecl (x)
warnstring = "declaration of `%s' shadows a member of `this'";
else if (oldlocal != NULL_TREE)
warnstring = "declaration of `%s' shadows previous local";
- else if (BINDING_VALUE (oldglobal) != NULL_TREE)
+ else if (oldglobal != NULL_TREE)
/* XXX shadow warnings in outer-more namespaces */
warnstring = "declaration of `%s' shadows global declaration";
if (warnstring)
warning (warnstring, IDENTIFIER_POINTER (name));
}
+ /* Check to see if decl redeclares a template parameter. */
+ if (oldlocal && (current_class_type || current_function_decl)
+ && current_template_parms)
+ {
+ if (decl_template_parm_p (oldlocal))
+ {
+ cp_error ("re-using name of template parameter `%T' in this scope", name);
+ cp_error_at (" previously declared here `%#D'", oldlocal);
+ }
+ }
}
if (TREE_CODE (x) == FUNCTION_DECL)
@@ -3585,15 +3740,17 @@ pushdecl_with_scope (x, level)
return x;
}
-/* Like pushdecl, only it places X in GLOBAL_BINDING_LEVEL,
+/* Like pushdecl, only it places X in the current namespace,
if appropriate. */
tree
-pushdecl_top_level (x)
+pushdecl_namespace_level (x)
tree x;
{
register struct binding_level *b = inner_binding_level;
- register tree t = pushdecl_with_scope (x, global_binding_level);
+ register tree t;
+
+ t = pushdecl_with_scope (x, NAMESPACE_LEVEL (current_namespace));
/* Now, the type_shadowed stack may screw us. Munge it so it does
what we want. */
@@ -3629,24 +3786,23 @@ pushdecl_top_level (x)
return t;
}
-/* Like push_overloaded_decl, only it places X in GLOBAL_BINDING_LEVEL,
+/* Like pushdecl, only it places X in GLOBAL_BINDING_LEVEL,
if appropriate. */
-static void
-push_overloaded_decl_top_level (x, forget)
+tree
+pushdecl_top_level (x)
tree x;
- int forget;
{
- struct binding_level *b = current_binding_level;
-
- current_binding_level = global_binding_level;
- push_overloaded_decl (x, forget);
- current_binding_level = b;
+ tree cur_namespace = current_namespace;
+ current_namespace = global_namespace;
+ x = pushdecl_namespace_level (x);
+ current_namespace = cur_namespace;
+ return x;
}
/* Make the declaration of X appear in CLASS scope. */
-tree
+void
pushdecl_class_level (x)
tree x;
{
@@ -3658,21 +3814,36 @@ pushdecl_class_level (x)
{
if (TYPE_BEING_DEFINED (current_class_type))
{
- /* Check for inconsistent use of this name in the class body.
+ /* A name N used in a class S shall refer to the same declaration
+ in its context and when re-evaluated in the completed scope of S.
Types, enums, and static vars are checked here; other
members are checked in finish_struct. */
tree icv = IDENTIFIER_CLASS_VALUE (name);
+ tree ilv = IDENTIFIER_LOCAL_VALUE (name);
if (icv && icv != x
+ && flag_optional_diags
/* Don't complain about inherited names. */
&& id_in_current_class (name)
/* Or shadowed tags. */
- && !(TREE_CODE (icv) == TYPE_DECL
+ && !(DECL_DECLARES_TYPE_P (icv)
&& DECL_CONTEXT (icv) == current_class_type))
{
- cp_error ("declaration of identifier `%D' as `%#D'", name, x);
- cp_error_at ("conflicts with previous use in class as `%#D'",
- icv);
+ cp_pedwarn ("declaration of identifier `%D' as `%#D'", name, x);
+ cp_pedwarn_at ("conflicts with previous use in class as `%#D'",
+ icv);
+ }
+
+ /* Check to see if decl redeclares a template parameter. */
+ if (ilv && ! decls_match (ilv, x)
+ && (current_class_type || current_function_decl)
+ && current_template_parms)
+ {
+ if (decl_template_parm_p (ilv))
+ {
+ cp_error ("re-using name of template parameter `%T' in this scope", name);
+ cp_error_at (" previously declared here `%#D'", ilv);
+ }
}
}
@@ -3682,7 +3853,6 @@ pushdecl_class_level (x)
set_identifier_type_value (name, TREE_TYPE (x));
}
}
- return x;
}
#if 0
@@ -3734,23 +3904,55 @@ push_class_level_binding (name, x)
obstack_ptr_grow (&decl_obstack, x);
}
-/* Tell caller how to interpret a TREE_LIST which contains
- chains of FUNCTION_DECLS. */
+/* Insert another USING_DECL into the current binding level,
+ returning this declaration. If this is a redeclaration,
+ do nothing and return NULL_TREE. */
-int
-overloaded_globals_p (list)
- tree list;
+tree
+push_using_decl (scope, name)
+ tree scope;
+ tree name;
{
- my_friendly_assert (TREE_CODE (list) == TREE_LIST, 142);
+ tree decl;
+
+ my_friendly_assert (TREE_CODE (scope) == NAMESPACE_DECL, 383);
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 384);
+ for (decl = current_binding_level->usings; decl; decl = TREE_CHAIN (decl))
+ if (DECL_INITIAL (decl) == scope && DECL_NAME (decl) == name)
+ break;
+ if (decl)
+ return NULL_TREE;
+ decl = build_lang_decl (USING_DECL, name, void_type_node);
+ DECL_INITIAL (decl) = scope;
+ TREE_CHAIN (decl) = current_binding_level->usings;
+ current_binding_level->usings = decl;
+ return decl;
+}
- /* Don't commit caller to seeing them as globals. */
- if (TREE_NONLOCAL_FLAG (list))
- return -1;
- /* Do commit caller to not seeing them as globals. */
- if (TREE_CODE (TREE_VALUE (list)) == TREE_LIST)
- return 0;
- /* Do commit caller to seeing them as globals. */
- return 1;
+/* Add namespace to using_directives. Return NULL_TREE if nothing was
+ changed (i.e. there was already a directive), or the fresh
+ TREE_LIST otherwise. */
+
+tree
+push_using_directive (used)
+ tree used;
+{
+ tree ud = current_binding_level->using_directives;
+ tree iter, ancestor;
+
+ /* Check if we already have this. */
+ if (purpose_member (used, ud) != NULL_TREE)
+ return NULL_TREE;
+
+ /* Recursively add all namespaces used. */
+ for (iter = DECL_NAMESPACE_USING (used); iter; iter = TREE_CHAIN (iter))
+ push_using_directive (TREE_PURPOSE (iter));
+
+ ancestor = namespace_ancestor (current_decl_namespace (), used);
+ ud = current_binding_level->using_directives;
+ ud = perm_tree_cons (used, ancestor, ud);
+ current_binding_level->using_directives = ud;
+ return ud;
}
/* DECL is a FUNCTION_DECL which may have other definitions already in
@@ -3773,11 +3975,11 @@ push_overloaded_decl (decl, forgettable)
{
tree orig_name = DECL_NAME (decl);
tree old;
- int doing_global = (global_bindings_p () || ! forgettable);
+ int doing_global = (namespace_bindings_p () || ! forgettable);
if (doing_global)
{
- old = IDENTIFIER_NAMESPACE_VALUE (orig_name);
+ old = namespace_binding (orig_name, DECL_CONTEXT (decl));
if (old && TREE_CODE (old) == FUNCTION_DECL
&& DECL_ARTIFICIAL (old)
&& (DECL_BUILT_IN (old) || DECL_BUILT_IN_NONANSI (old)))
@@ -3814,9 +4016,10 @@ push_overloaded_decl (decl, forgettable)
{
tree tmp;
- for (tmp = get_first_fn (old); tmp; tmp = DECL_CHAIN (tmp))
- if (decl == tmp || duplicate_decls (decl, tmp))
- return tmp;
+ for (tmp = old; tmp; tmp = OVL_NEXT (tmp))
+ if (decl == OVL_CURRENT (tmp)
+ || duplicate_decls (decl, OVL_CURRENT (tmp)))
+ return OVL_CURRENT (tmp);
}
else
{
@@ -3828,19 +4031,16 @@ push_overloaded_decl (decl, forgettable)
if (old || TREE_CODE (decl) == TEMPLATE_DECL)
{
- if (old && is_overloaded_fn (old))
- DECL_CHAIN (decl) = get_first_fn (old);
- else
- DECL_CHAIN (decl) = NULL_TREE;
- old = tree_cons (orig_name, decl, NULL_TREE);
- TREE_TYPE (old) = unknown_type_node;
+ if (old && TREE_CODE (old) != OVERLOAD)
+ old = ovl_cons (old, NULL_TREE);
+ old = ovl_cons (decl, old);
}
else
/* orig_name is not ambiguous. */
old = decl;
if (doing_global)
- IDENTIFIER_NAMESPACE_VALUE (orig_name) = old;
+ set_namespace_binding (orig_name, current_namespace, old);
else
IDENTIFIER_LOCAL_VALUE (orig_name) = old;
@@ -3920,10 +4120,16 @@ redeclaration_error_message (newdecl, olddecl)
if (DECL_LANG_SPECIFIC (olddecl) && DECL_ABSTRACT_VIRTUAL_P (olddecl))
return 0;
+ /* If both functions come from different namespaces, this is not
+ a redeclaration - this is a conflict with a used function. */
+ if (DECL_NAMESPACE_SCOPE_P (olddecl)
+ && DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl))
+ return "`%D' conflicts with used function";
+
/* We'll complain about linkage mismatches in
warn_extern_redeclared_static. */
- /* defining the same name twice is no good. */
+ /* Defining the same name twice is no good. */
if (DECL_INITIAL (olddecl) != NULL_TREE
&& DECL_INITIAL (newdecl) != NULL_TREE)
{
@@ -4051,7 +4257,6 @@ shadow_label (name)
{
shadowed_labels = tree_cons (NULL_TREE, decl, shadowed_labels);
SET_IDENTIFIER_LABEL_VALUE (name, NULL_TREE);
- SET_IDENTIFIER_LABEL_VALUE (decl, NULL_TREE);
}
return lookup_label (name);
@@ -4199,8 +4404,7 @@ pop_switch ()
/* XXX Note decl is never actually used. (bpk) */
void
-define_case_label (decl)
- tree decl;
+define_case_label ()
{
tree cleanup = last_cleanup_this_contour ();
struct binding_level *b = current_binding_level;
@@ -4308,6 +4512,9 @@ lookup_tag (form, name, binding_level, thislevel_only)
int thislevel_only;
{
register struct binding_level *level;
+ /* Non-zero if, we should look past a pseudo-global level, even if
+ THISLEVEL_ONLY. */
+ int allow_pseudo_global = 1;
for (level = binding_level; level; level = level->level_chain)
{
@@ -4320,6 +4527,38 @@ lookup_tag (form, name, binding_level, thislevel_only)
if (TYPE_IDENTIFIER (TREE_VALUE (tail)) == name)
return TREE_VALUE (tail);
}
+ else if (level->namespace_p)
+ /* Do namespace lookup. */
+ for (tail = current_namespace; 1; tail = CP_DECL_CONTEXT (tail))
+ {
+ tree old = binding_for_name (name, tail);
+
+ /* If we just skipped past a pseudo global level, even
+ though THISLEVEL_ONLY, and we find a template class
+ declaration, then we use the _TYPE node for the
+ template. See the example below. */
+ if (thislevel_only && !allow_pseudo_global
+ && old && BINDING_VALUE (old)
+ && DECL_CLASS_TEMPLATE_P (BINDING_VALUE (old)))
+ old = TREE_TYPE (BINDING_VALUE (old));
+ else
+ old = BINDING_TYPE (old);
+
+ /* If it has an original type, it is a typedef, and we
+ should not return it. */
+ if (old && DECL_ORIGINAL_TYPE (TYPE_NAME (old)))
+ old = NULL_TREE;
+ if (old && TREE_CODE (old) != form
+ && !(form != ENUMERAL_TYPE && TREE_CODE (old) == TEMPLATE_DECL))
+ {
+ cp_error ("`%#D' redeclared as %C", old, form);
+ return NULL_TREE;
+ }
+ if (old)
+ return old;
+ if (thislevel_only || tail == global_namespace)
+ return NULL_TREE;
+ }
else
for (tail = level->tags; tail; tail = TREE_CHAIN (tail))
{
@@ -4341,17 +4580,26 @@ lookup_tag (form, name, binding_level, thislevel_only)
}
if (thislevel_only && ! level->tag_transparent)
{
- if (level->pseudo_global)
- {
- /* XXX MvL */
- tree t = IDENTIFIER_NAMESPACE_VALUE (name);
- if (t && TREE_CODE (t) == TEMPLATE_DECL
- && TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL)
- return TREE_TYPE (t);
+ if (level->pseudo_global && allow_pseudo_global)
+ {
+ /* We must deal with cases like this:
+
+ template <class T> struct S;
+ template <class T> struct S {};
+
+ When looking up `S', for the second declaration, we
+ would like to find the first declaration. But, we
+ are in the pseudo-global level created for the
+ template parameters, rather than the (surrounding)
+ namespace level. Thus, we keep going one more level,
+ even though THISLEVEL_ONLY is non-zero. */
+ allow_pseudo_global = 0;
+ continue;
}
- return NULL_TREE;
+ else
+ return NULL_TREE;
}
- if (current_class_type && level->level_chain == global_binding_level)
+ if (current_class_type && level->level_chain->namespace_p)
{
/* Try looking in this class's tags before heading into
global binding level. */
@@ -4495,38 +4743,33 @@ tree
lookup_namespace_name (namespace, name)
tree namespace, name;
{
-#if 1
+ struct tree_binding _b;
tree val;
+
my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 370);
+
+ /* This happens for A::B<int> when B is a namespace. */
+ if (TREE_CODE (name) == NAMESPACE_DECL)
+ return name;
+
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 373);
- val = qualified_lookup_using_namespace (name, namespace);
- if (val)
- return val;
- cp_error ("`%D' undeclared in namespace `%D'", name, namespace);
- return error_mark_node;
-#else
- struct binding_level *b = (struct binding_level *)NAMESPACE_LEVEL (namespace);
- tree x = NULL_TREE;
-#if 1
- /* This searches just one level. */
- if (b)
- {
- for (x = b->names; x; x = TREE_CHAIN (x))
- if (DECL_NAME (x) == name || DECL_ASSEMBLER_NAME (x) == name)
- break;
- }
-#else
- /* This searches all levels. */
- for (; b && !x; b = b->level_chain)
+ val = binding_init (&_b);
+ if (!qualified_lookup_using_namespace (name, namespace, val, 0))
+ return error_mark_node;
+
+ if (BINDING_VALUE (val))
{
- for (x = b->names; x; x = TREE_CHAIN (x))
- if (DECL_NAME (x) == name || DECL_ASSEMBLER_NAME (x) == name)
- break;
+ val = BINDING_VALUE (val);
+
+ /* If we have a single function from a using decl, pull it out. */
+ if (TREE_CODE (val) == OVERLOAD && ! really_overloaded_fn (val))
+ val = OVL_FUNCTION (val);
+ return val;
}
-#endif
- return x;
-#endif
+
+ cp_error ("`%D' undeclared in namespace `%D'", name, namespace);
+ return error_mark_node;
}
tree
@@ -4552,8 +4795,17 @@ make_typename_type (context, name)
if (TREE_CODE (name) != IDENTIFIER_NODE)
my_friendly_abort (2000);
+ if (TREE_CODE (context) == NAMESPACE_DECL)
+ {
+ /* We can get here from typename_sub0 in the explicit_template_type
+ expansion. Just fail. */
+ cp_error ("no class template named `%#T' in `%#T'",
+ name, context);
+ return error_mark_node;
+ }
+
if (! uses_template_parms (context)
- || context == current_class_type)
+ || currently_open_class (context))
{
if (TREE_CODE (fullname) == TEMPLATE_ID_EXPR)
{
@@ -4571,7 +4823,8 @@ make_typename_type (context, name)
}
return lookup_template_class (t, TREE_OPERAND (fullname, 1),
- NULL_TREE, context);
+ NULL_TREE, context,
+ /*entering_scope=*/0);
}
else
{
@@ -4598,22 +4851,145 @@ make_typename_type (context, name)
if (processing_template_decl)
pop_obstacks ();
- TYPE_CONTEXT (t) = context;
+ TYPE_CONTEXT (t) = FROB_CONTEXT (context);
TYPE_NAME (TREE_TYPE (d)) = d;
TYPE_STUB_DECL (TREE_TYPE (d)) = d;
- DECL_CONTEXT (d) = context;
+ DECL_CONTEXT (d) = FROB_CONTEXT (context);
CLASSTYPE_GOT_SEMICOLON (t) = 1;
return t;
}
+/* Select the right _DECL from multiple choices. */
+
+static tree
+select_decl (binding, flags)
+ tree binding;
+ int flags;
+{
+ tree val;
+ val = BINDING_VALUE (binding);
+ if (LOOKUP_NAMESPACES_ONLY (flags))
+ {
+ /* We are not interested in types. */
+ if (val && TREE_CODE (val) == NAMESPACE_DECL)
+ return val;
+ return NULL_TREE;
+ }
+
+ /* If we could have a type and
+ we have nothing or we need a type and have none. */
+ if (BINDING_TYPE (binding)
+ && (!val || ((flags & LOOKUP_PREFER_TYPES)
+ && TREE_CODE (val) != TYPE_DECL)))
+ val = TYPE_STUB_DECL (BINDING_TYPE (binding));
+ /* Don't return non-types if we really prefer types. */
+ else if (val && LOOKUP_TYPES_ONLY (flags) && TREE_CODE (val) != TYPE_DECL
+ && (!looking_for_template || TREE_CODE (val) != TEMPLATE_DECL))
+ val = NULL_TREE;
+
+ return val;
+}
+
+/* Unscoped lookup of a global, iterate over namespaces, considering
+ using namespace statements. */
+
+static tree
+unqualified_namespace_lookup (name, flags)
+ tree name;
+ int flags;
+{
+ struct tree_binding _binding;
+ tree b = binding_init (&_binding);
+ tree initial = current_decl_namespace();
+ tree scope = initial;
+ tree siter;
+ struct binding_level *level;
+ tree val = NULL_TREE;
+
+ while (!val)
+ {
+ val = binding_for_name (name, scope);
+
+ /* Initialize binding for this context. */
+ BINDING_VALUE (b) = BINDING_VALUE (val);
+ BINDING_TYPE (b) = BINDING_TYPE (val);
+
+ /* Add all _DECLs seen through local using-directives. */
+ for (level = current_binding_level;
+ !level->namespace_p;
+ level = level->level_chain)
+ if (!lookup_using_namespace (name, b, level->using_directives,
+ scope, flags))
+ /* Give up because of error. */
+ return NULL_TREE;
+
+ /* Add all _DECLs seen through global using-directives. */
+ /* XXX local and global using lists should work equally. */
+ siter = initial;
+ while (1)
+ {
+ if (!lookup_using_namespace (name, b, DECL_NAMESPACE_USING (siter),
+ scope, flags))
+ /* Give up because of error. */
+ return NULL_TREE;
+ if (siter == scope) break;
+ siter = CP_DECL_CONTEXT (siter);
+ }
+
+ val = select_decl (b, flags);
+ if (scope == global_namespace)
+ break;
+ scope = CP_DECL_CONTEXT (scope);
+ }
+ return val;
+}
+
+/* Combine prefer_type and namespaces_only into flags. */
+
+static int
+lookup_flags (prefer_type, namespaces_only)
+ int prefer_type, namespaces_only;
+{
+ if (namespaces_only)
+ return LOOKUP_PREFER_NAMESPACES;
+ if (prefer_type > 1)
+ return LOOKUP_PREFER_TYPES;
+ if (prefer_type > 0)
+ return LOOKUP_PREFER_BOTH;
+ return 0;
+}
+
+/* Given a lookup that returned VAL, use FLAGS to decide if we want to
+ ignore it or not. Subroutine of lookup_name_real. */
+
+static tree
+qualify_lookup (val, flags)
+ tree val;
+ int flags;
+{
+ if (val == NULL_TREE)
+ return val;
+ if ((flags & LOOKUP_PREFER_NAMESPACES) && TREE_CODE (val) == NAMESPACE_DECL)
+ return val;
+ if ((flags & LOOKUP_PREFER_TYPES)
+ && (TREE_CODE (val) == TYPE_DECL
+ || ((flags & LOOKUP_TEMPLATES_EXPECTED)
+ && DECL_CLASS_TEMPLATE_P (val))))
+ return val;
+ if (flags & (LOOKUP_PREFER_NAMESPACES | LOOKUP_PREFER_TYPES))
+ return NULL_TREE;
+ return val;
+}
+
/* Look up NAME in the current binding level and its superiors in the
namespace of variables, functions and typedefs. Return a ..._DECL
node of some kind representing its definition if there is only one
such declaration, or return a TREE_LIST with all the overloaded
definitions if there are many, or return 0 if it is undefined.
- If PREFER_TYPE is > 0, we prefer TYPE_DECLs.
+ If PREFER_TYPE is > 0, we prefer TYPE_DECLs or namespaces.
+ If PREFER_TYPE is > 1, we reject non-type decls (e.g. namespaces).
If PREFER_TYPE is -2, we're being called from yylex(). (UGLY)
Otherwise we prefer non-TYPE_DECLs.
@@ -4621,14 +4997,19 @@ make_typename_type (context, name)
using IDENTIFIER_CLASS_VALUE. */
static tree
-lookup_name_real (name, prefer_type, nonclass)
+lookup_name_real (name, prefer_type, nonclass, namespaces_only)
tree name;
- int prefer_type, nonclass;
+ int prefer_type, nonclass, namespaces_only;
{
register tree val;
int yylex = 0;
tree from_obj = NULL_TREE;
tree locval, classval;
+ int flags;
+
+ /* Hack: copy flag set by parser, if set. */
+ if (only_namespace_names)
+ namespaces_only = 1;
if (prefer_type == -2)
{
@@ -4638,6 +5019,13 @@ lookup_name_real (name, prefer_type, nonclass)
yylex = 1;
prefer_type = looking_for_typename;
+ flags = lookup_flags (prefer_type, namespaces_only);
+ /* During parsing, we need to complain. */
+ flags |= LOOKUP_COMPLAIN;
+ /* If the next thing is '<', class templates are types. */
+ if (looking_for_template)
+ flags |= LOOKUP_TEMPLATES_EXPECTED;
+
/* std:: becomes :: for now. */
if (got_scope == std_node)
got_scope = void_type_node;
@@ -4654,13 +5042,18 @@ lookup_name_real (name, prefer_type, nonclass)
if (TREE_CODE (type) == TYPENAME_TYPE && TREE_TYPE (type))
type = TREE_TYPE (type);
- type = complete_type (type);
+ if (TYPE_P (type))
+ type = complete_type (type);
if (TREE_CODE (type) == VOID_TYPE)
- val = IDENTIFIER_GLOBAL_VALUE (name);
- else if (TREE_CODE (type) == NAMESPACE_DECL)
+ type = global_namespace;
+ if (TREE_CODE (type) == NAMESPACE_DECL)
{
- val = NAMESPACE_BINDING (name, type);
+ struct tree_binding b;
+ val = binding_init (&b);
+ if (!qualified_lookup_using_namespace (name, type, val, flags))
+ return NULL_TREE;
+ val = select_decl (val, flags);
}
else if (! IS_AGGR_TYPE (type)
|| TREE_CODE (type) == TEMPLATE_TYPE_PARM
@@ -4691,7 +5084,7 @@ lookup_name_real (name, prefer_type, nonclass)
else if (type == current_class_type)
val = IDENTIFIER_CLASS_VALUE (name);
else
- val = lookup_field (type, name, 0, prefer_type);
+ val = lookup_member (type, name, 0, prefer_type);
}
else
val = NULL_TREE;
@@ -4701,12 +5094,13 @@ lookup_name_real (name, prefer_type, nonclass)
else if (got_object && val)
from_obj = val;
}
+ else
+ flags = lookup_flags (prefer_type, namespaces_only);
locval = classval = NULL_TREE;
- if (current_binding_level != global_binding_level
- && IDENTIFIER_LOCAL_VALUE (name))
- locval = IDENTIFIER_LOCAL_VALUE (name);
+ if (! namespace_bindings_p ())
+ locval = qualify_lookup (IDENTIFIER_LOCAL_VALUE (name), flags);
/* In C++ class fields are between local and global scope,
just before the global scope. */
@@ -4719,20 +5113,22 @@ lookup_name_real (name, prefer_type, nonclass)
TYPE_DECLs. */
classval = lookup_field (current_class_type, name, 0, 1);
+ /* Add implicit 'typename' to types from template bases. lookup_field
+ will do this for us. If classval is actually from an enclosing
+ scope, lookup_nested_field will get it for us. */
+ else if (processing_template_decl
+ && classval && TREE_CODE (classval) == TYPE_DECL
+ && ! currently_open_class (DECL_CONTEXT (classval))
+ && uses_template_parms (current_class_type))
+ classval = lookup_field (current_class_type, name, 0, 1);
+
/* yylex() calls this with -2, since we should never start digging for
the nested name at the point where we haven't even, for example,
created the COMPONENT_REF or anything like that. */
if (classval == NULL_TREE)
classval = lookup_nested_field (name, ! yylex);
- /* Add implicit 'typename' to types from template bases. lookup_field
- will do this for us. */
- if (processing_template_decl
- && classval && TREE_CODE (classval) == TYPE_DECL
- && DECL_CONTEXT (classval) != current_class_type
- && uses_template_parms (current_class_type)
- && ! DECL_ARTIFICIAL (classval))
- classval = lookup_field (current_class_type, name, 0, 1);
+ classval = qualify_lookup (classval, flags);
}
if (locval && classval)
@@ -4764,21 +5160,46 @@ lookup_name_real (name, prefer_type, nonclass)
else if (classval)
val = classval;
else
+ val = unqualified_namespace_lookup (name, flags);
+
+ /* Any other name takes precedence over an implicit typename. Warn the
+ user about this potentially confusing lookup. */
+ if (classval && TREE_CODE (val) == TYPE_DECL
+ && TREE_CODE (TREE_TYPE (val)) == TYPENAME_TYPE
+ && TREE_TYPE (TREE_TYPE (val)))
{
- /* unscoped lookup of a global, iterate over namespaces,
- considering using namespace statements */
- tree binding;
- tree scope = current_namespace;
- do
+ if (locval == NULL_TREE)
+ locval = unqualified_namespace_lookup (name, flags);
+
+ if (locval && val != locval)
{
- binding = binding_for_name (name, scope);
- val = BINDING_VALUE (binding);
- val = lookup_using_namespace (name, val, current_namespace, scope);
- if (scope == global_namespace)
- break;
- scope = DECL_NAMESPACE (scope);
+ tree subtype;
+
+ val = locval;
+
+ /* To avoid redundant warnings, only warn when lexing, and the
+ decls are significantly different. */
+ subtype = TREE_TYPE (TREE_TYPE (classval));
+ if (yylex
+ && ! (TREE_CODE (locval) == TEMPLATE_DECL
+ && CLASSTYPE_TEMPLATE_INFO (subtype)
+ && CLASSTYPE_TI_TEMPLATE (subtype) == locval)
+ && ! (TREE_CODE (locval) == TYPE_DECL
+ && comptypes (TREE_TYPE (locval), subtype, 1)))
+ {
+ static int explained;
+
+ cp_warning ("lookup of `%D' finds `%#D'", name, locval);
+ cp_warning
+ (" instead of `%D' from dependent base class", classval);
+ if (! explained)
+ {
+ explained = 1;
+ cp_warning (" (use `typename %D' if that's what you meant)",
+ classval);
+ }
+ }
}
- while (!val);
}
done:
@@ -4797,16 +5218,27 @@ lookup_name_real (name, prefer_type, nonclass)
TREE_TYPE (val));
}
- val = from_obj;
+ /* We don't change val to from_obj if got_object depends on
+ template parms because that breaks implicit typename for
+ destructor calls. */
+ if (! uses_template_parms (got_object))
+ val = from_obj;
}
if ((TREE_CODE (val) == TEMPLATE_DECL && looking_for_template)
|| TREE_CODE (val) == TYPE_DECL || prefer_type <= 0)
;
+ /* Caller wants a class-or-namespace-name. */
+ else if (prefer_type == 1 && TREE_CODE (val) == NAMESPACE_DECL)
+ ;
else if (IDENTIFIER_HAS_TYPE_VALUE (name))
val = TYPE_MAIN_DECL (IDENTIFIER_TYPE_VALUE (name));
else if (TREE_TYPE (val) == error_mark_node)
val = error_mark_node;
+
+ /* If we have a single function from a using decl, pull it out. */
+ if (TREE_CODE (val) == OVERLOAD && ! really_overloaded_fn (val))
+ val = OVL_FUNCTION (val);
}
else if (from_obj)
val = from_obj;
@@ -4818,7 +5250,23 @@ tree
lookup_name_nonclass (name)
tree name;
{
- return lookup_name_real (name, 0, 1);
+ return lookup_name_real (name, 0, 1, 0);
+}
+
+tree
+lookup_function_nonclass (name, args)
+ tree name;
+ tree args;
+{
+ return lookup_arg_dependent (name, lookup_name_nonclass (name), args);
+}
+
+tree
+lookup_name_namespace_only (name)
+ tree name;
+{
+ /* type-or-namespace, nonclass, namespace_only */
+ return lookup_name_real (name, 1, 1, 1);
}
tree
@@ -4826,7 +5274,7 @@ lookup_name (name, prefer_type)
tree name;
int prefer_type;
{
- return lookup_name_real (name, prefer_type, 0);
+ return lookup_name_real (name, prefer_type, 0, 0);
}
/* Similar to `lookup_name' but look only at current binding level. */
@@ -4837,7 +5285,7 @@ lookup_name_current_level (name)
{
register tree t = NULL_TREE;
- if (current_binding_level == global_binding_level)
+ if (current_binding_level->namespace_p)
{
t = IDENTIFIER_NAMESPACE_VALUE (name);
@@ -4850,20 +5298,57 @@ lookup_name_current_level (name)
struct binding_level *b = current_binding_level;
while (1)
{
- for (t = b->names; t; t = TREE_CHAIN (t))
- if (DECL_NAME (t) == name || DECL_ASSEMBLER_NAME (t) == name)
- goto out;
+ if (purpose_member (name, b->shadowed))
+ return IDENTIFIER_LOCAL_VALUE (name);
if (b->keep == 2)
b = b->level_chain;
else
break;
}
- out:
- ;
}
return t;
}
+
+/* Like lookup_name_current_level, but for types. */
+
+tree
+lookup_type_current_level (name)
+ tree name;
+{
+ register tree t = NULL_TREE;
+
+ my_friendly_assert (! current_binding_level->namespace_p, 980716);
+
+ if (REAL_IDENTIFIER_TYPE_VALUE (name) != NULL_TREE
+ && REAL_IDENTIFIER_TYPE_VALUE (name) != global_type_node)
+ {
+ struct binding_level *b = current_binding_level;
+ while (1)
+ {
+ if (purpose_member (name, b->type_shadowed))
+ return REAL_IDENTIFIER_TYPE_VALUE (name);
+ if (b->keep == 2)
+ b = b->level_chain;
+ else
+ break;
+ }
+ }
+
+ return t;
+}
+
+void
+begin_only_namespace_names ()
+{
+ only_namespace_names = 1;
+}
+
+void
+end_only_namespace_names ()
+{
+ only_namespace_names = 0;
+}
/* Arrange for the user to get a source line number, even when the
compiler is going down in flames, so that she at least has a
@@ -4874,7 +5359,7 @@ lookup_name_current_level (name)
static void
signal_catch (sig)
- int sig;
+ int sig ATTRIBUTE_UNUSED;
{
signal (SIGSEGV, SIG_DFL);
#ifdef SIGIOT
@@ -4926,15 +5411,15 @@ record_builtin_type (rid_index, name, type)
tdecl = pushdecl (build_decl (TYPE_DECL, tname, type));
set_identifier_type_value (tname, NULL_TREE);
if ((int) rid_index < (int) RID_MAX)
- /* builtin types live in the global namespace */
- IDENTIFIER_GLOBAL_VALUE (tname) = tdecl;
+ /* Built-in types live in the global namespace. */
+ SET_IDENTIFIER_GLOBAL_VALUE (tname, tdecl);
}
if (rname != NULL_TREE)
{
if (tname != NULL_TREE)
{
set_identifier_type_value (rname, NULL_TREE);
- IDENTIFIER_GLOBAL_VALUE (rname) = tdecl;
+ SET_IDENTIFIER_GLOBAL_VALUE (rname, tdecl);
}
else
{
@@ -4944,6 +5429,53 @@ record_builtin_type (rid_index, name, type)
}
}
+/* Record one of the standard Java types.
+ * Declare it as having the given NAME.
+ * If SIZE > 0, it is the size of one of the integral types;
+ * otherwise it is the negative of the size of one of the other types. */
+
+static tree
+record_builtin_java_type (name, size)
+ char *name;
+ int size;
+{
+ tree type, decl;
+ if (size > 0)
+ type = make_signed_type (size);
+ else if (size > -32)
+ { /* "__java_char" or ""__java_boolean". */
+ type = make_unsigned_type (-size);
+ /*if (size == -1) TREE_SET_CODE (type, BOOLEAN_TYPE);*/
+ }
+ else
+ { /* "__java_float" or ""__java_double". */
+ type = make_node (REAL_TYPE);
+ TYPE_PRECISION (type) = - size;
+ layout_type (type);
+ }
+ record_builtin_type (RID_MAX, name, type);
+ decl = TYPE_NAME (type);
+ DECL_IGNORED_P (decl) = 1;
+ TYPE_FOR_JAVA (type) = 1;
+ return type;
+}
+
+/* Push a type into the namespace so that the back-ends ignore it. */
+
+static void
+record_unknown_type (type, name)
+ tree type;
+ char *name;
+{
+ tree decl = pushdecl (build_decl (TYPE_DECL, get_identifier (name), type));
+ /* Make sure the "unknown type" typedecl gets ignored for debug info. */
+ DECL_IGNORED_P (decl) = 1;
+ TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
+ TYPE_SIZE (type) = TYPE_SIZE (void_type_node);
+ TYPE_ALIGN (type) = 1;
+ TYPE_MODE (type) = TYPE_MODE (void_type_node);
+}
+
/* Push overloaded decl, in global scope, with one argument so it
can be used as a callback from define_function. */
@@ -4976,7 +5508,6 @@ auto_function (name, type, code)
void
init_decl_processing ()
{
- tree decl;
register tree endlink, int_endlink, double_endlink, unsigned_endlink;
tree fields[20];
/* Data type of memcpy. */
@@ -4984,20 +5515,19 @@ init_decl_processing ()
int wchar_type_size;
tree temp;
tree array_domain_type;
- extern int flag_strict_prototype;
tree vb_off_identifier = NULL_TREE;
/* Function type `char *(char *, char *)' and similar ones */
tree string_ftype_ptr_ptr, int_ftype_string_string;
tree sizetype_endlink;
tree ptr_ftype, ptr_ftype_unsigned, ptr_ftype_sizetype;
- tree void_ftype, void_ftype_int, void_ftype_ptr, ptr_ftype_void;
+ tree void_ftype, void_ftype_int, void_ftype_ptr;
/* Have to make these distinct before we try using them. */
lang_name_cplusplus = get_identifier ("C++");
lang_name_c = get_identifier ("C");
lang_name_java = get_identifier ("Java");
- /* enter the global namespace */
+ /* Enter the global namespace. */
my_friendly_assert (global_namespace == NULL_TREE, 375);
my_friendly_assert (current_lang_name == NULL_TREE, 375);
current_lang_name = lang_name_cplusplus;
@@ -5006,12 +5536,9 @@ init_decl_processing ()
current_lang_name = NULL_TREE;
if (flag_strict_prototype == 2)
- {
- if (pedantic)
- strict_prototypes_lang_c = strict_prototypes_lang_cplusplus;
- }
- else
- strict_prototypes_lang_c = flag_strict_prototype;
+ flag_strict_prototype = pedantic;
+
+ strict_prototypes_lang_c = flag_strict_prototype;
/* Initially, C. */
current_lang_name = lang_name_c;
@@ -5064,6 +5591,9 @@ init_decl_processing ()
/* Make the binding_level structure for global names. */
pushlevel (0);
global_binding_level = current_binding_level;
+ /* The global level is the namespace level of ::. */
+ NAMESPACE_LEVEL (global_namespace) = global_binding_level;
+ declare_namespace_level ();
this_identifier = get_identifier (THIS_NAME);
in_charge_identifier = get_identifier (IN_CHARGE_NAME);
@@ -5199,6 +5729,15 @@ init_decl_processing ()
TREE_TYPE (complex_long_double_type_node) = long_double_type_node;
layout_type (complex_long_double_type_node);
+ java_byte_type_node = record_builtin_java_type ("__java_byte", 8);
+ java_short_type_node = record_builtin_java_type ("__java_short", 16);
+ java_int_type_node = record_builtin_java_type ("__java_int", 32);
+ java_long_type_node = record_builtin_java_type ("__java_long", 64);
+ java_float_type_node = record_builtin_java_type ("__java_float", -32);
+ java_double_type_node = record_builtin_java_type ("__java_double", -64);
+ java_char_type_node = record_builtin_java_type ("__java_char", -16);
+ java_boolean_type_node = record_builtin_java_type ("__java_boolean", -1);
+
integer_zero_node = build_int_2 (0, 0);
TREE_TYPE (integer_zero_node) = integer_type_node;
integer_one_node = build_int_2 (1, 0);
@@ -5254,7 +5793,7 @@ init_decl_processing ()
initializations of __FUNCTION__ and __PRETTY_FUNCTION__. */
array_domain_type = build_index_type (build_int_2 (200, 0));
- /* make a type for arrays of characters.
+ /* Make a type for arrays of characters.
With luck nothing will ever really depend on the length of this
array type. */
char_array_type_node
@@ -5369,10 +5908,6 @@ init_decl_processing ()
builtin_function ("__builtin_frame_address", ptr_ftype_unsigned,
BUILT_IN_FRAME_ADDRESS, NULL_PTR);
- ptr_ftype_void = build_function_type (ptr_type_node, endlink);
- builtin_function ("__builtin_fp", ptr_ftype_void, BUILT_IN_FP, NULL_PTR);
- builtin_function ("__builtin_sp", ptr_ftype_void, BUILT_IN_SP, NULL_PTR);
-
builtin_function ("__builtin_alloca", ptr_ftype_sizetype,
BUILT_IN_ALLOCA, "alloca");
builtin_function ("__builtin_ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR);
@@ -5432,7 +5967,7 @@ init_decl_processing ()
temp = tree_cons (NULL_TREE,
build_pointer_type (build_function_type (void_type_node,
NULL_TREE)),
- ptr_ftype_sizetype);
+ tree_cons (NULL_TREE, ptr_ftype_sizetype, NULL_TREE));
builtin_function ("__builtin_apply",
build_function_type (ptr_type_node, temp),
BUILT_IN_APPLY, NULL_PTR);
@@ -5536,21 +6071,12 @@ init_decl_processing ()
/* C++ extensions */
unknown_type_node = make_node (UNKNOWN_TYPE);
- decl = pushdecl (build_decl (TYPE_DECL, get_identifier ("unknown type"),
- unknown_type_node));
- /* Make sure the "unknown type" typedecl gets ignored for debug info. */
- DECL_IGNORED_P (decl) = 1;
- TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
- TYPE_SIZE (unknown_type_node) = TYPE_SIZE (void_type_node);
- TYPE_ALIGN (unknown_type_node) = 1;
- TYPE_MODE (unknown_type_node) = TYPE_MODE (void_type_node);
+ record_unknown_type (unknown_type_node, "unknown type");
+
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
TREE_TYPE (unknown_type_node) = unknown_type_node;
- if (flag_ansi)
- TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
- else
- TREE_TYPE (null_node) = build_pointer_type (unknown_type_node);
+ TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
/* Looking up TYPE_POINTER_TO and TYPE_REFERENCE_TO yield the same
result. */
@@ -5623,6 +6149,9 @@ init_decl_processing ()
layout_type (vtbl_type_node);
vtbl_type_node = cp_build_type_variant (vtbl_type_node, 1, 0);
record_builtin_type (RID_MAX, NULL_PTR, vtbl_type_node);
+ vtbl_ptr_type_node = build_pointer_type (vtable_entry_type);
+ layout_type (vtbl_ptr_type_node);
+ record_builtin_type (RID_MAX, NULL_PTR, vtbl_ptr_type_node);
/* Simplify life by making a "sigtable_entry_type". Give its
fields names so that the debugger can use them. */
@@ -5661,19 +6190,28 @@ init_decl_processing ()
record_builtin_type (RID_MAX, SIGTABLE_PTR_TYPE, sigtable_entry_type);
}
- std_node = build_decl (NAMESPACE_DECL, get_identifier ("std"),
+ std_node = build_decl (NAMESPACE_DECL,
+ get_identifier (flag_honor_std ? "fake std":"std"),
void_type_node);
pushdecl (std_node);
+ global_type_node = make_node (LANG_TYPE);
+ record_unknown_type (global_type_node, "global type");
+
/* Now, C++. */
current_lang_name = lang_name_cplusplus;
{
- tree bad_alloc_type_node = xref_tag
- (class_type_node, get_identifier ("bad_alloc"), NULL_TREE, 1);
- tree newtype = build_exception_variant
+ tree bad_alloc_type_node, newtype, deltype;
+ if (flag_honor_std)
+ push_namespace (get_identifier ("std"));
+ bad_alloc_type_node = xref_tag
+ (class_type_node, get_identifier ("bad_alloc"), 1);
+ if (flag_honor_std)
+ pop_namespace ();
+ newtype = build_exception_variant
(ptr_ftype_sizetype, build_tree_list (NULL_TREE, bad_alloc_type_node));
- tree deltype = build_exception_variant
+ deltype = build_exception_variant
(void_ftype_ptr, build_tree_list (NULL_TREE, NULL_TREE));
auto_function (ansi_opname[(int) NEW_EXPR], newtype, NOT_BUILT_IN);
auto_function (ansi_opname[(int) VEC_NEW_EXPR], newtype, NOT_BUILT_IN);
@@ -5710,6 +6248,24 @@ init_decl_processing ()
/* Show we use EH for cleanups. */
using_eh_for_cleanups ();
+
+ print_error_function = lang_print_error_function;
+ lang_get_alias_set = &c_get_alias_set;
+
+ /* Maintain consistency. Perhaps we should just complain if they
+ say -fwritable-strings? */
+ if (flag_writable_strings)
+ flag_const_strings = 0;
+}
+
+/* Function to print any language-specific context for an error message. */
+
+static void
+lang_print_error_function (file)
+ char *file;
+{
+ default_print_error_function (file);
+ maybe_print_template_context ();
}
/* Make a definition for a builtin function named NAME and whose data type
@@ -5733,6 +6289,9 @@ define_function (name, type, function_code, pfn, library_name)
TREE_PUBLIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
+ my_friendly_assert (DECL_CONTEXT (decl) == NULL_TREE, 392);
+ DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
+
/* Since `pushdecl' relies on DECL_ASSEMBLER_NAME instead of DECL_NAME,
we cannot change DECL_ASSEMBLER_NAME until we have installed this
function in the namespace. */
@@ -5748,6 +6307,48 @@ define_function (name, type, function_code, pfn, library_name)
return decl;
}
+/* When we call finish_struct for an anonymous union, we create
+ default copy constructors and such. But, an anonymous union
+ shouldn't have such things; this function undoes the damage to the
+ anonymous union type T.
+
+ (The reason that we create the synthesized methods is that we don't
+ distinguish `union { int i; }' from `typedef union { int i; } U'.
+ The first is an anonymous union; the second is just an ordinary
+ union type.) */
+
+void
+fixup_anonymous_union (t)
+ tree t;
+{
+ tree *q;
+
+ /* Wipe out memory of synthesized methods */
+ TYPE_HAS_CONSTRUCTOR (t) = 0;
+ TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0;
+ TYPE_HAS_INIT_REF (t) = 0;
+ TYPE_HAS_CONST_INIT_REF (t) = 0;
+ TYPE_HAS_ASSIGN_REF (t) = 0;
+ TYPE_HAS_ASSIGNMENT (t) = 0;
+ TYPE_HAS_CONST_ASSIGN_REF (t) = 0;
+
+ /* Splice the implicitly generated functions out of the TYPE_METHODS
+ list. */
+ q = &TYPE_METHODS (t);
+ while (*q)
+ {
+ if (DECL_ARTIFICIAL (*q))
+ *q = TREE_CHAIN (*q);
+ else
+ q = &TREE_CHAIN (*q);
+ }
+
+ /* ANSI C++ June 5 1992 WP 9.5.3. Anonymous unions may not have
+ function members. */
+ if (TYPE_METHODS (t))
+ error ("an anonymous union cannot have function members");
+}
+
/* Called when a declaration is seen that contains no names to declare.
If its type is a reference to a structure, union or enum inherited
from a containing scope, shadow that tag name for the current scope
@@ -5778,18 +6379,7 @@ shadow_tag (declspecs)
{
my_friendly_assert (TYPE_MAIN_DECL (value) != NULL_TREE, 261);
- if (IS_AGGR_TYPE (value) && CLASSTYPE_USE_TEMPLATE (value))
- {
- if (CLASSTYPE_IMPLICIT_INSTANTIATION (value)
- && TYPE_SIZE (value) == NULL_TREE)
- {
- SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (value);
- if (processing_template_decl)
- push_template_decl (TYPE_MAIN_DECL (value));
- }
- else if (CLASSTYPE_TEMPLATE_INSTANTIATION (value))
- cp_error ("specialization after instantiation of `%T'", value);
- }
+ maybe_process_partial_specialization (value);
t = value;
ok_code = code;
@@ -5817,31 +6407,7 @@ shadow_tag (declspecs)
|| (TREE_CODE (TYPE_NAME (t)) == TYPE_DECL
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))))
{
- /* See also grok_x_components. */
- tree *q;
-
- /* Wipe out memory of synthesized methods */
- TYPE_HAS_CONSTRUCTOR (t) = 0;
- TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0;
- TYPE_HAS_INIT_REF (t) = 0;
- TYPE_HAS_CONST_INIT_REF (t) = 0;
- TYPE_HAS_ASSIGN_REF (t) = 0;
- TYPE_HAS_ASSIGNMENT (t) = 0;
- TYPE_HAS_CONST_ASSIGN_REF (t) = 0;
-
- q = &TYPE_METHODS (t);
- while (*q)
- {
- if (DECL_ARTIFICIAL (*q))
- *q = TREE_CHAIN (*q);
- else
- q = &TREE_CHAIN (*q);
- }
-
- /* ANSI C++ June 5 1992 WP 9.5.3. Anonymous unions may not have
- function members. */
- if (TYPE_METHODS (t))
- error ("an anonymous union cannot have function members");
+ fixup_anonymous_union (t);
if (TYPE_FIELDS (t))
{
@@ -5964,6 +6530,18 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
? DECL_CLASS_CONTEXT (decl)
: DECL_CONTEXT (decl);
+ if (initialized && context && TREE_CODE (context) == NAMESPACE_DECL
+ && context != current_namespace && TREE_CODE (decl) == VAR_DECL)
+ {
+ /* When parsing the initializer, lookup should use the object's
+ namespace. */
+ push_decl_namespace (context);
+ }
+
+ /* We are only interested in class contexts, later. */
+ if (context && TREE_CODE (context) == NAMESPACE_DECL)
+ context = NULL_TREE;
+
if (initialized)
/* Is it valid for this decl to have an initializer at all?
If not, set INITIALIZED to zero, which will indirectly
@@ -6062,20 +6640,22 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
}
/* cp_finish_decl sets DECL_EXTERNAL if DECL_IN_AGGR_P is set. */
- if (DECL_LANG_SPECIFIC (decl))
- DECL_IN_AGGR_P (decl) = 0;
- if (DECL_USE_TEMPLATE (decl) || CLASSTYPE_USE_TEMPLATE (context))
+ DECL_IN_AGGR_P (decl) = 0;
+ if ((DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl))
+ || CLASSTYPE_USE_TEMPLATE (context))
SET_DECL_TEMPLATE_SPECIALIZATION (decl);
- /* Stupid stupid stupid stupid (jason 7/21/95) */
- if (pedantic && DECL_EXTERNAL (decl)
- && ! DECL_TEMPLATE_SPECIALIZATION (decl))
+ if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl))
cp_pedwarn ("declaration of `%#D' outside of class is not definition",
decl);
pushclass (context, 2);
}
+#ifdef SET_DEFAULT_DECL_ATTRIBUTES
+ SET_DEFAULT_DECL_ATTRIBUTES (decl, attributes);
+#endif
+
/* Set attributes here so if duplicate decl, will have proper attributes. */
cplus_decl_attributes (decl, attributes, prefix_attributes);
@@ -6083,8 +6663,11 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
comes from another scope, e.g. a static member variable.
TEM may equal DECL or it may be a previous decl of the same name. */
- if ((TREE_CODE (decl) != PARM_DECL && DECL_CONTEXT (decl) != NULL_TREE)
- || (TREE_CODE (decl) == TEMPLATE_DECL && !global_bindings_p ())
+ if ((TREE_CODE (decl) != PARM_DECL && DECL_CONTEXT (decl) != NULL_TREE
+ /* Definitions of namespace members outside their namespace are
+ possible. */
+ && TREE_CODE (DECL_CONTEXT (decl)) != NAMESPACE_DECL)
+ || (TREE_CODE (decl) == TEMPLATE_DECL && !namespace_bindings_p ())
|| TREE_CODE (type) == LANG_TYPE
/* The declaration of template specializations does not affect
the functions available for overload resolution, so we do not
@@ -6100,7 +6683,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (! current_function_decl)
tem = push_template_decl (tem);
else if (minimal_parse_mode)
- DECL_VINDEX (decl)
+ DECL_VINDEX (tem)
= build_min_nt (DECL_STMT, copy_to_permanent (declarator),
copy_to_permanent (declspecs),
NULL_TREE);
@@ -6115,7 +6698,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
data segment. */
DECL_COMMON (tem) = flag_conserve_space || ! TREE_PUBLIC (tem);
#endif
-
+
if (! processing_template_decl)
start_decl_1 (tem);
@@ -6181,6 +6764,7 @@ start_decl_1 (decl)
cp_error ("variable `%#D' has initializer but incomplete type",
decl);
initialized = 0;
+ type = TREE_TYPE (decl) = error_mark_node;
}
else if (TYPE_SIZE (complete_type (TREE_TYPE (type))) == NULL_TREE)
{
@@ -6203,8 +6787,7 @@ start_decl_1 (decl)
decl);
/* Change the type so that assemble_variable will give
DECL an rtl we can live with: (mem (const_int 0)). */
- TREE_TYPE (decl) = error_mark_node;
- type = error_mark_node;
+ type = TREE_TYPE (decl) = error_mark_node;
}
else
{
@@ -6407,6 +6990,23 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);
+ if (init && TREE_CODE (init) == NAMESPACE_DECL)
+ {
+ cp_error ("Cannot initialize `%D' to namespace `%D'",
+ decl, init);
+ init = NULL_TREE;
+ }
+
+ if (TREE_CODE (decl) == VAR_DECL
+ && DECL_CONTEXT (decl)
+ && TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL
+ && DECL_CONTEXT (decl) != current_namespace
+ && init)
+ {
+ /* Leave the namespace of the object. */
+ pop_decl_namespace ();
+ }
+
/* If the type of the thing we are declaring either has
a constructor, or has a virtual function table pointer,
AND its initialization was accepted by `start_decl',
@@ -6682,8 +7282,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
/* Let debugger know it should output info for this type. */
note_debug_info_needed (ttype);
- if (TREE_STATIC (decl) && DECL_CONTEXT (decl)
- && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (decl))) == 't')
+ if (TREE_STATIC (decl) && DECL_CLASS_SCOPE_P (decl))
note_debug_info_needed (DECL_CONTEXT (decl));
if ((DECL_EXTERNAL (decl) || TREE_STATIC (decl))
@@ -6733,35 +7332,52 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
if (was_temp)
end_temporary_allocation ();
- /* Extern inline function static data has external linkage. */
+ /* Static data in a function with comdat linkage also has comdat
+ linkage. */
if (TREE_CODE (decl) == VAR_DECL
&& TREE_STATIC (decl)
+ /* Don't mess with __FUNCTION__. */
+ && ! TREE_ASM_WRITTEN (decl)
&& current_function_decl
&& DECL_CONTEXT (decl) == current_function_decl
- && DECL_THIS_INLINE (current_function_decl)
+ && (DECL_THIS_INLINE (current_function_decl)
+ || DECL_TEMPLATE_INSTANTIATION (current_function_decl))
&& TREE_PUBLIC (current_function_decl))
{
- if (DECL_INTERFACE_KNOWN (current_function_decl))
- {
- TREE_PUBLIC (decl) = 1;
- DECL_EXTERNAL (decl) = DECL_EXTERNAL (current_function_decl);
- }
- /* We can only do this if we can use common or weak, and we
- can't if it has been initialized and we don't support weak. */
- else if (DECL_INITIAL (decl) == NULL_TREE
- || DECL_INITIAL (decl) == error_mark_node)
+ /* Rather than try to get this right with inlining, we suppress
+ inlining of such functions. */
+ current_function_cannot_inline
+ = "function with static variable cannot be inline";
+
+ /* If flag_weak, we don't need to mess with this, as we can just
+ make the function weak, and let it refer to its unique local
+ copy. This works because we don't allow the function to be
+ inlined. */
+ if (! flag_weak)
{
- TREE_PUBLIC (decl) = 1;
- DECL_COMMON (decl) = 1;
- }
- else if (flag_weak)
- make_decl_one_only (decl);
+ if (DECL_INTERFACE_KNOWN (current_function_decl))
+ {
+ TREE_PUBLIC (decl) = 1;
+ DECL_EXTERNAL (decl) = DECL_EXTERNAL (current_function_decl);
+ }
+ else if (DECL_INITIAL (decl) == NULL_TREE
+ || DECL_INITIAL (decl) == error_mark_node)
+ {
+ TREE_PUBLIC (decl) = 1;
+ DECL_COMMON (decl) = 1;
+ }
+ /* else we lose. We can only do this if we can use common,
+ which we can't if it has been initialized. */
- if (TREE_PUBLIC (decl))
- DECL_ASSEMBLER_NAME (decl)
- = build_static_name (current_function_decl, DECL_NAME (decl));
- else if (! DECL_ARTIFICIAL (decl))
- cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl);
+ if (TREE_PUBLIC (decl))
+ DECL_ASSEMBLER_NAME (decl)
+ = build_static_name (current_function_decl, DECL_NAME (decl));
+ else if (! DECL_ARTIFICIAL (decl))
+ {
+ cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl);
+ cp_warning_at (" you can work around this by removing the initializer"), decl;
+ }
+ }
}
else if (TREE_CODE (decl) == VAR_DECL
@@ -6785,7 +7401,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
make_decl_one_only (decl);
else
{
- /* we can't do anything useful; leave vars for explicit
+ /* We can't do anything useful; leave vars for explicit
instantiation. */
DECL_EXTERNAL (decl) = 1;
DECL_NOT_REALLY_EXTERN (decl) = 0;
@@ -6995,7 +7611,7 @@ cp_finish_decl (decl, init, asmspec_tree, need_pop, flags)
{
emit_line_note (DECL_SOURCE_FILE (decl),
DECL_SOURCE_LINE (decl));
- expand_aggr_init (decl, init, 0, flags);
+ expand_aggr_init (decl, init, flags);
}
/* Set this to 0 so we can tell whether an aggregate which
@@ -7126,7 +7742,7 @@ expand_static_init (decl, init)
if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))
|| (init && TREE_CODE (init) == TREE_LIST))
{
- expand_aggr_init (decl, init, 0, 0);
+ expand_aggr_init (decl, init, 0);
do_pending_stack_adjust ();
}
else if (init)
@@ -7324,12 +7940,15 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
or `volatile'.
RAISES is a list of exceptions that this function can raise.
CHECK is 1 if we must find this method in CTYPE, 0 if we should
- not look, and -1 if we should not call `grokclassfn' at all. */
+ not look, and -1 if we should not call `grokclassfn' at all.
+
+ Returns `error_mark_node' if something goes wrong, after issuing
+ applicable error messages. */
static tree
grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
raises, attrlist, check, friendp, publicp, inlinep, funcdef_flag,
- template_count)
+ template_count, in_namespace)
tree ctype, type;
tree declarator;
tree orig_declarator;
@@ -7337,6 +7956,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
enum overload_flags flags;
tree quals, raises, attrlist;
int check, friendp, publicp, inlinep, funcdef_flag, template_count;
+ tree in_namespace;
{
tree cname, decl;
int staticp = ctype && TREE_CODE (type) == FUNCTION_TYPE;
@@ -7354,10 +7974,14 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
}
decl = build_lang_decl (FUNCTION_DECL, declarator, type);
- /* propagate volatile out from type to decl */
+ /* Propagate volatile out from type to decl. */
if (TYPE_VOLATILE (type))
TREE_THIS_VOLATILE (decl) = 1;
+ /* This decl is not from the current namespace. */
+ if (in_namespace)
+ set_decl_namespace (decl, in_namespace);
+
/* Should probably propagate const out from type to decl I bet (mrs). */
if (staticp)
{
@@ -7368,7 +7992,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (ctype)
DECL_CLASS_CONTEXT (decl) = ctype;
- if (ctype == NULL_TREE && ! strcmp (IDENTIFIER_POINTER (declarator), "main"))
+ if (ctype == NULL_TREE && MAIN_NAME_P (declarator))
{
if (inlinep)
error ("cannot declare `main' to be inline");
@@ -7377,7 +8001,29 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
inlinep = 0;
publicp = 1;
}
-
+
+ /* Members of anonymous types have no linkage; make them internal. */
+ if (ctype && ANON_AGGRNAME_P (TYPE_IDENTIFIER (ctype)))
+ publicp = 0;
+
+ if (publicp)
+ {
+ /* [basic.link]: A name with no linkage (notably, the name of a class
+ or enumeration declared in a local scope) shall not be used to
+ declare an entity with linkage.
+
+ Only check this for public decls for now. */
+ t = no_linkage_check (TREE_TYPE (decl));
+ if (t)
+ {
+ if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ cp_pedwarn ("non-local function `%#D' uses anonymous type", decl);
+ else
+ cp_pedwarn ("non-local function `%#D' uses local type `%T'",
+ decl, t);
+ }
+ }
+
TREE_PUBLIC (decl) = publicp;
if (! publicp)
{
@@ -7410,16 +8056,31 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
break;
}
- if (friendp &&
- TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
+ if (friendp
+ && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
{
- /* A friend declaration of the form friend void f<>(). Record
- the information in the TEMPLATE_ID_EXPR. */
- SET_DECL_IMPLICIT_INSTANTIATION (decl);
- DECL_TEMPLATE_INFO (decl)
- = perm_tree_cons (TREE_OPERAND (orig_declarator, 0),
- TREE_OPERAND (orig_declarator, 1),
- NULL_TREE);
+ if (funcdef_flag)
+ cp_error
+ ("defining explicit specialization `%D' in friend declaration",
+ orig_declarator);
+ else
+ {
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ {
+ /* Something like `template <class T> friend void f<T>()'. */
+ cp_error ("template-id `%D' in declaration of primary template",
+ orig_declarator);
+ return error_mark_node;
+ }
+
+ /* A friend declaration of the form friend void f<>(). Record
+ the information in the TEMPLATE_ID_EXPR. */
+ SET_DECL_IMPLICIT_INSTANTIATION (decl);
+ DECL_TEMPLATE_INFO (decl)
+ = perm_tree_cons (TREE_OPERAND (orig_declarator, 0),
+ TREE_OPERAND (orig_declarator, 1),
+ NULL_TREE);
+ }
}
/* Caller will do the rest of this. */
@@ -7439,14 +8100,17 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
the following calls is supposed to do. */
DECL_CONSTRUCTOR_P (decl) = 1;
- grokclassfn (ctype, declarator, decl, flags, quals);
+ grokclassfn (ctype, decl, flags, quals);
decl = check_explicit_specialization (orig_declarator, decl,
template_count,
2 * (funcdef_flag != 0) +
4 * (friendp != 0));
+ if (decl == error_mark_node)
+ return error_mark_node;
- if (check)
+ if ((! TYPE_FOR_JAVA (ctype) || check_java_method (decl))
+ && check)
{
tmp = check_classfn (ctype, decl);
@@ -7459,22 +8123,20 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
return tmp;
}
if (! grok_ctor_properties (ctype, decl))
- return NULL_TREE;
+ return error_mark_node;
if (check == 0 && ! current_function_decl)
{
- /* assembler names live in the global namespace */
+ /* Assembler names live in the global namespace. */
tmp = IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl));
if (tmp == NULL_TREE)
- IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl)) = decl;
+ SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl), decl);
else if (TREE_CODE (tmp) != TREE_CODE (decl))
cp_error ("inconsistent declarations for `%D'", decl);
else
{
duplicate_decls (decl, tmp);
decl = tmp;
- /* avoid creating circularities. */
- DECL_CHAIN (decl) = NULL_TREE;
}
make_decl_rtl (decl, NULL_PTR, 1);
}
@@ -7487,14 +8149,18 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
This call may change the type of the function (because
of default parameters)! */
if (ctype != NULL_TREE)
- grokclassfn (ctype, cname, decl, flags, quals);
+ grokclassfn (ctype, decl, flags, quals);
decl = check_explicit_specialization (orig_declarator, decl,
template_count,
2 * (funcdef_flag != 0) +
4 * (friendp != 0));
+ if (decl == error_mark_node)
+ return error_mark_node;
- if (ctype != NULL_TREE && check)
+ if (ctype != NULL_TREE
+ && (! TYPE_FOR_JAVA (ctype) || check_java_method (decl))
+ && check)
{
tmp = check_classfn (ctype, decl);
@@ -7538,15 +8204,13 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
IDENTIFIER_GLOBAL_VALUE. */
tmp = lookup_name (DECL_ASSEMBLER_NAME (decl), 0);
if (tmp == NULL_TREE)
- IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl)) = decl;
+ SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (decl), decl);
else if (TREE_CODE (tmp) != TREE_CODE (decl))
cp_error ("inconsistent declarations for `%D'", decl);
else
{
duplicate_decls (decl, tmp);
decl = tmp;
- /* avoid creating circularities. */
- DECL_CHAIN (decl) = NULL_TREE;
}
}
@@ -7567,12 +8231,13 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
}
static tree
-grokvardecl (type, declarator, specbits_in, initialized, constp)
+grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
tree type;
tree declarator;
RID_BIT_TYPE *specbits_in;
int initialized;
int constp;
+ tree in_namespace;
{
tree decl;
RID_BIT_TYPE specbits;
@@ -7592,12 +8257,17 @@ grokvardecl (type, declarator, specbits_in, initialized, constp)
}
else
{
+ tree context = in_namespace ? in_namespace : current_namespace;
decl = build_decl (VAR_DECL, declarator, complete_type (type));
- if (current_namespace != global_namespace)
- DECL_ASSEMBLER_NAME (decl) = build_static_name (current_namespace,
+ if (context != global_namespace && namespace_bindings_p ()
+ && current_lang_name != lang_name_c)
+ DECL_ASSEMBLER_NAME (decl) = build_static_name (context,
declarator);
}
+ if (in_namespace)
+ set_decl_namespace (decl, in_namespace);
+
if (RIDBIT_SETP (RID_EXTERN, specbits))
{
DECL_THIS_EXTERN (decl) = 1;
@@ -7606,8 +8276,7 @@ grokvardecl (type, declarator, specbits_in, initialized, constp)
/* In class context, static means one per class,
public access, and static storage. */
- if (DECL_FIELD_CONTEXT (decl) != NULL_TREE
- && IS_AGGR_TYPE (DECL_FIELD_CONTEXT (decl)))
+ if (DECL_CLASS_SCOPE_P (decl))
{
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
@@ -7627,6 +8296,25 @@ grokvardecl (type, declarator, specbits_in, initialized, constp)
TREE_STATIC (decl) = !! RIDBIT_SETP (RID_STATIC, specbits);
TREE_PUBLIC (decl) = DECL_EXTERNAL (decl);
}
+
+ if (TREE_PUBLIC (decl))
+ {
+ /* [basic.link]: A name with no linkage (notably, the name of a class
+ or enumeration declared in a local scope) shall not be used to
+ declare an entity with linkage.
+
+ Only check this for public decls for now. */
+ tree t = no_linkage_check (TREE_TYPE (decl));
+ if (t)
+ {
+ if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ /* Ignore for now; `enum { foo } e' is pretty common. */;
+ else
+ cp_pedwarn ("non-local variable `%#D' uses local type `%T'",
+ decl, t);
+ }
+ }
+
return decl;
}
@@ -7659,9 +8347,9 @@ build_ptrmemfunc_type (type)
t = make_lang_type (RECORD_TYPE);
- /* Let the front-end know this is a pointer to member function. */
+ /* Let the front-end know this is a pointer to member function... */
TYPE_PTRMEMFUNC_FLAG (t) = 1;
- /* and not really an aggregate. */
+ /* ... and not really an aggregate. */
IS_AGGR_TYPE (t) = 0;
fields[0] = build_lang_field_decl (FIELD_DECL, delta_identifier,
@@ -7788,6 +8476,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
tree quals = NULL_TREE;
tree raises = NULL_TREE;
int template_count = 0;
+ tree in_namespace = NULL_TREE;
RIDBIT_RESET_ALL (specbits);
if (decl_context == FUNCDEF)
@@ -7814,7 +8503,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
next = &TREE_OPERAND (decl, 0);
break;
- case BIT_NOT_EXPR: /* for C++ destructors! */
+ case BIT_NOT_EXPR: /* For C++ destructors! */
{
tree name = TREE_OPERAND (decl, 0);
tree rename = NULL_TREE;
@@ -7857,7 +8546,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
break;
case ADDR_EXPR: /* C++ reference declaration */
- /* fall through */
+ /* Fall through. */
case ARRAY_REF:
case INDIRECT_REF:
ctype = NULL_TREE;
@@ -7919,7 +8608,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else
my_friendly_abort (0);
}
- /* fall through */
+ /* Fall through. */
case IDENTIFIER_NODE:
if (TREE_CODE (decl) == IDENTIFIER_NODE)
@@ -7957,6 +8646,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
tree cname = TREE_OPERAND (decl, 0);
if (cname == NULL_TREE)
ctype = NULL_TREE;
+ else if (TREE_CODE (cname) == NAMESPACE_DECL)
+ {
+ ctype = NULL_TREE;
+ in_namespace = TREE_OPERAND (decl, 0);
+ TREE_OPERAND (decl, 0) = NULL_TREE;
+ }
else if (! is_aggr_type (cname, 1))
TREE_OPERAND (decl, 0) = NULL_TREE;
/* Must test TREE_OPERAND (decl, 1), in case user gives
@@ -8159,7 +8854,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (i == (int) RID_LONG && RIDBIT_SETP (i, specbits))
{
- if (pedantic && ! in_system_header)
+ if (pedantic && ! in_system_header && warn_long_long)
pedwarn ("ANSI C++ does not support `long long'");
if (longlong)
error ("`long long long' is too long for GCC");
@@ -8437,7 +9132,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
constp = !! RIDBIT_SETP (RID_CONST, specbits) + TYPE_READONLY (type);
volatilep = !! RIDBIT_SETP (RID_VOLATILE, specbits) + TYPE_VOLATILE (type);
- type = build_type_variant (type, 0, 0);
+ type = cp_build_type_variant (type, constp, volatilep);
staticp = 0;
inlinep = !! RIDBIT_SETP (RID_INLINE, specbits);
virtualp = RIDBIT_SETP (RID_VIRTUAL, specbits);
@@ -8505,8 +9200,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* Static anonymous unions are dealt with here. */
if (staticp && decl_context == TYPENAME
&& TREE_CODE (declspecs) == TREE_LIST
- && TREE_CODE (TREE_VALUE (declspecs)) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (TREE_VALUE (declspecs))))
+ && ANON_UNION_TYPE_P (TREE_VALUE (declspecs)))
decl_context = FIELD;
/* Give error if `const,' `volatile,' `inline,' `friend,' or `virtual'
@@ -8747,7 +9441,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
the function; then build_vec_delete will need this
value. */
int yes = suspend_momentary ();
- /* might be a cast */
+ /* Might be a cast. */
if (TREE_CODE (size) == NOP_EXPR
&& TREE_TYPE (size) == TREE_TYPE (TREE_OPERAND (size, 0)))
size = TREE_OPERAND (size, 0);
@@ -8832,15 +9526,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
resume_momentary (yes);
}
- /* Build the array type itself, then merge any constancy or
- volatility into the target type. We must do it in this order
- to ensure that the TYPE_MAIN_VARIANT field of the array type
- is set correctly. */
-
type = build_cplus_array_type (type, itype);
- if (constp || volatilep)
- type = cp_build_type_variant (type, constp, volatilep);
-
ctype = NULL_TREE;
}
break;
@@ -8854,23 +9540,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* Declaring a function type.
Make sure we have a valid type for the function to return. */
-#if 0
- /* Is this an error? Should they be merged into TYPE here? */
- if (pedantic && (constp || volatilep))
- pedwarn ("function declared to return const or volatile result");
-#else
- /* Merge any constancy or volatility into the function return
- type. */
- if (constp || volatilep)
- {
- type = cp_build_type_variant (type, constp, volatilep);
- if (IS_AGGR_TYPE (type))
- build_pointer_type (type);
- constp = 0;
- volatilep = 0;
- }
-#endif
+ /* We now know that constp and volatilep don't apply to the
+ decl, but to its return type. */
+ constp = volatilep = 0;
/* Warn about some types functions can't return. */
@@ -8929,8 +9602,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
error ("destructor cannot be static member function");
if (quals)
{
- error ("destructors cannot be declared `const' or `volatile'");
- return void_type_node;
+ cp_error ("destructors may not be `%s'",
+ IDENTIFIER_POINTER (TREE_VALUE (quals)));
+ quals = NULL_TREE;
}
if (decl_context == FIELD)
{
@@ -8939,7 +9613,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
return void_type_node;
}
}
- else /* it's a constructor. */
+ else /* It's a constructor. */
{
if (explicitp == 1)
explicitp = 2;
@@ -8955,8 +9629,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
}
if (quals)
{
- error ("constructors cannot be declared `const' or `volatile'");
- return void_type_node;
+ cp_error ("constructors may not be `%s'",
+ IDENTIFIER_POINTER (TREE_VALUE (quals)));
+ quals = NULL_TREE;
}
{
RID_BIT_TYPE tmp_bits;
@@ -9014,24 +9689,22 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
arg_types = grokparms (inner_parms, funcdecl_p ? funcdef_flag : 0);
- if (declarator)
+ if (declarator && flags == DTOR_FLAG)
{
- /* Get past destructors, etc.
- We know we have one because FLAGS will be non-zero.
-
- Complain about improper parameter lists here. */
+ /* A destructor declared in the body of a class will
+ be represented as a BIT_NOT_EXPR. But, we just
+ want the underlying IDENTIFIER. */
if (TREE_CODE (declarator) == BIT_NOT_EXPR)
+ declarator = TREE_OPERAND (declarator, 0);
+
+ if (strict_prototype == 0 && arg_types == NULL_TREE)
+ arg_types = void_list_node;
+ else if (arg_types == NULL_TREE
+ || arg_types != void_list_node)
{
- declarator = TREE_OPERAND (declarator, 0);
-
- if (strict_prototype == 0 && arg_types == NULL_TREE)
- arg_types = void_list_node;
- else if (arg_types == NULL_TREE
- || arg_types != void_list_node)
- {
- error ("destructors cannot be specified with parameters");
- arg_types = void_list_node;
- }
+ cp_error ("destructors may not have parameters");
+ arg_types = void_list_node;
+ last_function_parms = NULL_TREE;
}
}
@@ -9078,21 +9751,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* Merge any constancy or volatility into the target type
for the pointer. */
- if (constp || volatilep)
- {
- /* A const or volatile signature pointer/reference is
- pointing to a const or volatile object, i.e., the
- `optr' is const or volatile, respectively, not the
- signature pointer/reference itself. */
- if (! IS_SIGNATURE (type))
- {
- type = cp_build_type_variant (type, constp, volatilep);
- if (IS_AGGR_TYPE (type))
- build_pointer_type (type);
- constp = 0;
- volatilep = 0;
- }
- }
+ /* We now know that constp and volatilep don't apply to the
+ decl, but to the target of the pointer. */
+ constp = volatilep = 0;
if (IS_SIGNATURE (type))
{
@@ -9103,8 +9764,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
cp_warning ("empty signature `%T' used in signature reference declaration",
type);
#if 0
- type = build_signature_reference_type (type,
- constp, volatilep);
+ type = build_signature_reference_type (type);
#else
sorry ("signature reference");
return NULL_TREE;
@@ -9116,26 +9776,17 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& TYPE_SIZE (type))
cp_warning ("empty signature `%T' used in signature pointer declaration",
type);
- type = build_signature_pointer_type (type,
- constp, volatilep);
+ type = build_signature_pointer_type (type);
}
constp = 0;
volatilep = 0;
}
else if (TREE_CODE (declarator) == ADDR_EXPR)
{
- if (TREE_CODE (type) == FUNCTION_TYPE)
- {
- error ("cannot declare references to functions; use pointer to function instead");
- type = build_pointer_type (type);
- }
+ if (TREE_CODE (type) == VOID_TYPE)
+ error ("invalid type: `void &'");
else
- {
- if (TREE_CODE (type) == VOID_TYPE)
- error ("invalid type: `void &'");
- else
- type = build_reference_type (type);
- }
+ type = build_reference_type (type);
}
else if (TREE_CODE (type) == METHOD_TYPE)
{
@@ -9179,6 +9830,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
pedwarn ("discarding `volatile' applied to a reference");
constp = volatilep = 0;
}
+ type = cp_build_type_variant (type, constp, volatilep);
}
declarator = TREE_OPERAND (declarator, 0);
ctype = NULL_TREE;
@@ -9202,8 +9854,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_COMPLEXITY (declarator) == 0)
/* This needs to be here, in case we are called
multiple times. */ ;
+ else if (TREE_COMPLEXITY (declarator) == -1)
+ /* Namespace member. */
+ pop_decl_namespace ();
else if (friendp && (TREE_COMPLEXITY (declarator) < 2))
- /* don't fall out into global scope. Hides real bug? --eichin */ ;
+ /* Don't fall out into global scope. Hides real bug? --eichin */ ;
else if (! IS_AGGR_TYPE_CODE
(TREE_CODE (TREE_OPERAND (declarator, 0))))
;
@@ -9280,8 +9935,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (current_class_type == NULL_TREE
|| friendp)
- type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep),
- TREE_TYPE (type), TYPE_ARG_TYPES (type));
+ type = build_cplus_method_type (ctype, TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
else
{
cp_error ("cannot declare member function `%T::%s' within `%T'",
@@ -9292,7 +9947,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (RIDBIT_SETP (RID_TYPEDEF, specbits)
|| TYPE_SIZE (complete_type (ctype)) != NULL_TREE)
{
- /* have to move this code elsewhere in this function.
+ /* Have to move this code elsewhere in this function.
this code is used for i.e., typedef int A::M; M *pm;
It is? How? jason 10/2/94 */
@@ -9309,10 +9964,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (TREE_CODE (type) == FUNCTION_TYPE)
type
- = build_cplus_method_type (build_type_variant (ctype,
- constp,
- volatilep),
- TREE_TYPE (type),
+ = build_cplus_method_type (ctype, TREE_TYPE (type),
TYPE_ARG_TYPES (type));
}
else
@@ -9335,7 +9987,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else
{
if (TREE_CODE (type) == FUNCTION_TYPE)
- type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep), TREE_TYPE (type), TYPE_ARG_TYPES (type));
+ type = build_cplus_method_type (ctype, TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
else
type = build_offset_type (ctype, type);
}
@@ -9392,8 +10045,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* Note that the grammar rejects storage classes
in typenames, fields or parameters. */
- if (constp || volatilep)
- type = cp_build_type_variant (type, constp, volatilep);
+ if (current_lang_name == lang_name_java)
+ TYPE_FOR_JAVA (type) = 1;
if (decl_context == FIELD)
{
@@ -9404,10 +10057,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (IS_SIGNATURE (current_class_type) && opaque_typedef)
SIGNATURE_HAS_OPAQUE_TYPEDECLS (current_class_type) = 1;
}
- else if (current_lang_name == lang_name_java)
- decl = build_lang_decl (TYPE_DECL, declarator, type);
else
- decl = build_decl (TYPE_DECL, declarator, type);
+ {
+ /* Make sure this typedef lives as long as its type,
+ since it might be used as a template parameter. */
+ if (type != error_mark_node)
+ push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
+ decl = build_decl (TYPE_DECL, declarator, type);
+ if (type != error_mark_node)
+ pop_obstacks ();
+ }
/* If the user declares "struct {...} foo" then `foo' will have
an anonymous name. Fill that name in now. Nothing can
@@ -9418,16 +10077,38 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (type)))
{
- /* replace the anonymous name with the real name everywhere. */
+ /* FIXME: This is bogus; we should not be doing this for
+ cv-qualified types. */
+
+ /* For anonymous structs that are cv-qualified, need to use
+ TYPE_MAIN_VARIANT so that name will mangle correctly. As
+ type not referenced after this block, don't bother
+ resetting type to original type, ie. TREE_TYPE (decl). */
+ type = TYPE_MAIN_VARIANT (type);
+
+ /* Replace the anonymous name with the real name everywhere. */
lookup_tag_reverse (type, declarator);
TYPE_NAME (type) = decl;
if (TYPE_LANG_SPECIFIC (type))
TYPE_WAS_ANONYMOUS (type) = 1;
+ /* XXX Temporarily set the scope.
+ When returning, start_decl expects it as NULL_TREE,
+ and will then then set it using pushdecl. */
+ my_friendly_assert (DECL_CONTEXT (decl) == NULL_TREE, 980404);
+ if (current_class_type)
+ DECL_CONTEXT (decl) = current_class_type;
+ else
+ DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
+
DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
DECL_ASSEMBLER_NAME (decl)
= get_identifier (build_overload_name (type, 1, 1));
+ DECL_CONTEXT (decl) = NULL_TREE;
+
+ /* FIXME remangle member functions; member functions of a
+ type with external linkage have external linkage. */
}
if (TREE_CODE (type) == OFFSET_TYPE || TREE_CODE (type) == METHOD_TYPE)
@@ -9453,9 +10134,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
if (RIDBIT_SETP (RID_MUTABLE, specbits))
- {
- error ("non-object member `%s' cannot be declared mutable", name);
- }
+ error ("non-object member `%s' cannot be declared mutable", name);
bad_specifiers (decl, "type", virtualp, quals != NULL_TREE,
inlinep, friendp, raises != NULL_TREE);
@@ -9489,8 +10168,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
if (IS_SIGNATURE (type))
error ("`const' or `volatile' specified with signature type");
- else
- type = cp_build_type_variant (type, constp, volatilep);
}
/* Special case: "friend class foo" looks like a TYPENAME context. */
@@ -9566,35 +10243,37 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* Now create the decl, which may be a VAR_DECL, a PARM_DECL
or a FUNCTION_DECL, depending on DECL_CONTEXT and TYPE. */
+ if (decl_context == PARM || decl_context == CATCHPARM)
+ {
+ if (ctype || in_namespace)
+ error ("cannot use `::' in parameter declaration");
+
+ /* A parameter declared as an array of T is really a pointer to T.
+ One declared as a function is really a pointer to a function.
+ One declared as a member is really a pointer to member. */
+
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ {
+ /* Transfer const-ness of array into that of type pointed to. */
+ type = build_pointer_type (TREE_TYPE (type));
+ volatilep = constp = 0;
+ }
+ else if (TREE_CODE (type) == FUNCTION_TYPE)
+ type = build_pointer_type (type);
+ else if (TREE_CODE (type) == OFFSET_TYPE)
+ type = build_pointer_type (type);
+ else if (TREE_CODE (type) == VOID_TYPE && declarator)
+ {
+ error ("declaration of `%s' as void", name);
+ return NULL_TREE;
+ }
+ }
+
{
register tree decl;
if (decl_context == PARM)
{
- if (ctype)
- error ("cannot use `::' in parameter declaration");
-
- /* A parameter declared as an array of T is really a pointer to T.
- One declared as a function is really a pointer to a function.
- One declared as a member is really a pointer to member. */
-
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- /* Transfer const-ness of array into that of type pointed to. */
- type = build_pointer_type
- (cp_build_type_variant (TREE_TYPE (type), constp, volatilep));
- volatilep = constp = 0;
- }
- else if (TREE_CODE (type) == FUNCTION_TYPE)
- type = build_pointer_type (type);
- else if (TREE_CODE (type) == OFFSET_TYPE)
- type = build_pointer_type (type);
- else if (TREE_CODE (type) == VOID_TYPE && declarator)
- {
- error ("declaration of `%s' as void", name);
- return NULL_TREE;
- }
-
decl = build_decl (PARM_DECL, declarator, complete_type (type));
bad_specifiers (decl, "parameter", virtualp, quals != NULL_TREE,
@@ -9625,6 +10304,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
are error_mark_node, for example. */
decl = NULL_TREE;
}
+ else if (in_namespace)
+ {
+ /* Something like struct S { int N::j; }; */
+ cp_error ("invalid use of `::'");
+ decl = NULL_TREE;
+ }
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
int publicp = 0;
@@ -9673,8 +10358,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
}
}
else if (staticp < 2)
- type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep),
- TREE_TYPE (type), TYPE_ARG_TYPES (type));
+ type = build_cplus_method_type (ctype, TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
}
/* Tell grokfndecl if it needs to set TREE_PUBLIC on the node. */
@@ -9688,9 +10373,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
declarator,
virtualp, flags, quals, raises, attrlist,
friendp ? -1 : 0, friendp, publicp, inlinep,
- funcdef_flag, template_count);
- if (decl == NULL_TREE)
- return NULL_TREE;
+ funcdef_flag, template_count, in_namespace);
+ if (decl == NULL_TREE || decl == error_mark_node)
+ return decl;
#if 0
/* This clobbers the attrs stored in `decl' from `attrlist'. */
/* The decl and setting of decl_machine_attr is also turned off. */
@@ -9709,7 +10394,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
decl = grokfndecl (ctype, type, declarator, declarator,
virtualp, flags, quals, raises, attrlist,
friendp ? -1 : 0, friendp, 1, 0, funcdef_flag,
- template_count);
+ template_count, in_namespace);
if (decl == NULL_TREE)
return NULL_TREE;
}
@@ -9755,9 +10440,21 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
tree t = NULL_TREE;
if (decl && DECL_NAME (decl))
- t = do_friend (ctype, declarator, decl,
- last_function_parms, flags, quals,
- funcdef_flag);
+ {
+ if (template_class_depth (current_class_type) == 0)
+ {
+ decl
+ = check_explicit_specialization
+ (declarator, decl,
+ template_count, 2 * (funcdef_flag != 0) + 4);
+ if (decl == error_mark_node)
+ return error_mark_node;
+ }
+
+ t = do_friend (ctype, declarator, decl,
+ last_function_parms, flags, quals,
+ funcdef_flag);
+ }
if (t && funcdef_flag)
return t;
@@ -9799,14 +10496,23 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
but not both. If it appears in the class, the member is
a member constant. The file-scope definition is always
required. */
- if (! constp)
- /* According to Mike Stump, we generate bad code for
- this case, so we might as well always make it an
- error. */
+ if (CLASS_TYPE_P (type)
+ || TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ cp_error ("in-class initialization of static data member of non-integral type `%T'",
+ type);
+ /* If we just return the declaration, crashes will
+ sometimes occur. We therefore return
+ void_type_node, as if this was a friend
+ declaration, to cause callers to completely
+ ignore this declaration. */
+ return void_type_node;
+ }
+ else if (!constp)
cp_error ("ANSI C++ forbids in-class initialization of non-const static member `%D'",
declarator);
-
- if (pedantic && ! INTEGRAL_TYPE_P (type))
+ else if (pedantic && ! INTEGRAL_TYPE_P (type)
+ && !uses_template_parms (type))
cp_pedwarn ("ANSI C++ forbids initialization of member constant `%D' of non-integral type `%T'", declarator, type);
}
@@ -9819,7 +10525,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* C++ allows static class members.
All other work for this is done by grokfield.
- This VAR_DECL is built by build_lang_field_decl.
+ This VAR_DCL is built by build_lang_field_decl.
All other VAR_DECLs are built by build_decl. */
decl = build_lang_field_decl (VAR_DECL, declarator, type);
TREE_STATIC (decl) = 1;
@@ -9882,9 +10588,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (current_lang_name == lang_name_cplusplus
&& ! processing_template_decl
- && ! (IDENTIFIER_LENGTH (original_name) == 4
- && IDENTIFIER_POINTER (original_name)[0] == 'm'
- && strcmp (IDENTIFIER_POINTER (original_name), "main") == 0)
+ && ! MAIN_NAME_P (original_name)
&& ! (IDENTIFIER_LENGTH (original_name) > 10
&& IDENTIFIER_POINTER (original_name)[0] == '_'
&& IDENTIFIER_POINTER (original_name)[1] == '_'
@@ -9895,8 +10599,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
declarator = build_decl_overload (dname, TYPE_ARG_TYPES (type), 0);
}
else if (TREE_CODE (type) == FUNCTION_TYPE && staticp < 2)
- type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep),
- TREE_TYPE (type), TYPE_ARG_TYPES (type));
+ type = build_cplus_method_type (ctype, TREE_TYPE (type),
+ TYPE_ARG_TYPES (type));
/* Record presence of `static'. */
publicp = (ctype != NULL_TREE
@@ -9907,19 +10611,19 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
virtualp, flags, quals, raises, attrlist,
1, friendp,
publicp, inlinep, funcdef_flag,
- template_count);
+ template_count, in_namespace);
if (decl == NULL_TREE)
return NULL_TREE;
+ /* Among other times, could occur from check_explicit_specialization
+ returning an error_mark_node. */
+ if (decl == error_mark_node)
+ return error_mark_node;
+
if (ctype == NULL_TREE && DECL_LANGUAGE (decl) != lang_c
&& (! DECL_USE_TEMPLATE (decl) ||
name_mangling_version < 1))
-#if 0
- /* XXX is support for the old __ns_ mangling really needed? MvL */
- DECL_ASSEMBLER_NAME (decl) = current_namespace_id (declarator);
-#else
DECL_ASSEMBLER_NAME (decl) = declarator;
-#endif
if (staticp == 1)
{
@@ -9950,34 +10654,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{
/* It's a variable. */
- if (decl_context == CATCHPARM)
- {
- if (ctype)
- {
- ctype = NULL_TREE;
- error ("cannot use `::' in parameter declaration");
- }
-
- /* A parameter declared as an array of T is really a pointer to T.
- One declared as a function is really a pointer to a function.
- One declared as a member is really a pointer to member. */
-
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- /* Transfer const-ness of array into that of type
- pointed to. */
- type = build_pointer_type
- (cp_build_type_variant (TREE_TYPE (type), constp, volatilep));
- volatilep = constp = 0;
- }
- else if (TREE_CODE (type) == FUNCTION_TYPE)
- type = build_pointer_type (type);
- else if (TREE_CODE (type) == OFFSET_TYPE)
- type = build_pointer_type (type);
- }
-
/* An uninitialized decl with `extern' is a reference. */
- decl = grokvardecl (type, declarator, &specbits, initialized, constp);
+ decl = grokvardecl (type, declarator, &specbits,
+ initialized, constp, in_namespace);
bad_specifiers (decl, "variable", virtualp, quals != NULL_TREE,
inlinep, friendp, raises != NULL_TREE);
@@ -10209,7 +10888,11 @@ grokparms (first_parm, funcdef_flag)
NULL_TREE);
if (! decl)
continue;
- type = TREE_TYPE (decl);
+
+ /* Top-level qualifiers on the parameters are
+ ignored for function types. */
+ type = TYPE_MAIN_VARIANT (TREE_TYPE (decl));
+
if (TREE_CODE (type) == VOID_TYPE)
decl = void_type_node;
else if (TREE_CODE (type) == METHOD_TYPE)
@@ -10239,15 +10922,27 @@ grokparms (first_parm, funcdef_flag)
&& CLASSTYPE_ABSTRACT_VIRTUALS (type))
{
abstract_virtuals_error (decl, type);
- any_error = 1; /* seems like a good idea */
+ any_error = 1; /* Seems like a good idea. */
}
else if (TREE_CODE (type) == RECORD_TYPE
&& TYPE_LANG_SPECIFIC (type)
&& IS_SIGNATURE (type))
{
signature_error (decl, type);
- any_error = 1; /* seems like a good idea */
+ any_error = 1; /* Seems like a good idea. */
}
+ else if (POINTER_TYPE_P (type))
+ {
+ tree t = type;
+ while (POINTER_TYPE_P (t)
+ || (TREE_CODE (t) == ARRAY_TYPE
+ && TYPE_DOMAIN (t) != NULL_TREE))
+ t = TREE_TYPE (t);
+ if (TREE_CODE (t) == ARRAY_TYPE)
+ cp_error ("parameter type `%T' includes %s to array of unknown bound",
+ type,
+ TYPE_PTR_P (type) ? "pointer" : "reference");
+ }
}
if (TREE_CODE (decl) == VOID_TYPE)
@@ -10307,6 +11002,7 @@ grokparms (first_parm, funcdef_flag)
else
init = require_instantiated_type (type, init, integer_zero_node);
if (! processing_template_decl
+ && init != error_mark_node
&& TREE_CODE (init) != DEFAULT_ARG
&& ! can_convert_arg (type, TREE_TYPE (init), init))
cp_pedwarn ("invalid type `%T' for default argument to `%#D'",
@@ -10415,10 +11111,11 @@ grok_ctor_properties (ctype, decl)
added to any ctor so we can tell if the class has been initialized
yet. This could screw things up in this function, so we deliberately
ignore the leading int if we're in that situation. */
- if (parmtypes
- && TREE_VALUE (parmtypes) == integer_type_node
- && TYPE_USES_VIRTUAL_BASECLASSES (ctype))
+ if (TYPE_USES_VIRTUAL_BASECLASSES (ctype))
{
+ my_friendly_assert (parmtypes
+ && TREE_VALUE (parmtypes) == integer_type_node,
+ 980529);
parmtypes = TREE_CHAIN (parmtypes);
parmtype = TREE_VALUE (parmtypes);
}
@@ -10591,7 +11288,7 @@ grok_op_properties (decl, virtualp, friendp)
}
if (name == ansi_opname[(int) CALL_EXPR])
- return; /* no restrictions on args */
+ return; /* No restrictions on args. */
if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl))
{
@@ -10767,9 +11464,9 @@ grok_op_properties (decl, virtualp, friendp)
scope.) */
tree
-xref_tag (code_type_node, name, binfo, globalize)
+xref_tag (code_type_node, name, globalize)
tree code_type_node;
- tree name, binfo;
+ tree name;
int globalize;
{
enum tag_types tag_code;
@@ -10778,6 +11475,17 @@ xref_tag (code_type_node, name, binfo, globalize)
register tree ref, t;
struct binding_level *b = inner_binding_level;
int got_type = 0;
+ tree attributes = NULL_TREE;
+
+ /* If we are called from the parser, code_type_node will sometimes be a
+ TREE_LIST. This indicates that the user wrote
+ "class __attribute__ ((foo)) bar". Extract the attributes so we can
+ use them later. */
+ if (TREE_CODE (code_type_node) == TREE_LIST)
+ {
+ attributes = TREE_PURPOSE (code_type_node);
+ code_type_node = TREE_VALUE (code_type_node);
+ }
tag_code = (enum tag_types) TREE_INT_CST_LOW (code_type_node);
switch (tag_code)
@@ -10807,52 +11515,82 @@ xref_tag (code_type_node, name, binfo, globalize)
}
else
t = IDENTIFIER_TYPE_VALUE (name);
+
if (t && TREE_CODE (t) != code && TREE_CODE (t) != TEMPLATE_TYPE_PARM
&& TREE_CODE (t) != TEMPLATE_TEMPLATE_PARM)
t = NULL_TREE;
if (! globalize)
{
- if (pedantic && t && (TREE_CODE (t) == TEMPLATE_TYPE_PARM
+ if (t && (TREE_CODE (t) == TEMPLATE_TYPE_PARM
|| TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM))
{
- cp_pedwarn ("redeclaration of template type-parameter `%T'", name);
- cp_pedwarn_at (" previously declared here", t);
+ cp_error ("redeclaration of template type-parameter `%T'", name);
+ cp_error_at (" previously declared here `%#D'",
+ TEMPLATE_TYPE_DECL (t));
}
if (t && TYPE_CONTEXT (t) && got_type)
ref = t;
else
- {
- /* If we know we are defining this tag, only look it up in
- this scope and don't try to find it as a type. */
- ref = lookup_tag (code, name, b, 1);
- }
+ /* If we know we are defining this tag, only look it up in
+ this scope and don't try to find it as a type. */
+ ref = lookup_tag (code, name, b, 1);
}
else
{
- if (t)
- ref = t;
- else
- ref = lookup_tag (code, name, b, 0);
-
- if (! ref)
- {
- /* Try finding it as a type declaration. If that wins, use it. */
- ref = lookup_name (name, 1);
+ if (current_class_type
+ && template_class_depth (current_class_type)
+ && PROCESSING_REAL_TEMPLATE_DECL_P ())
+ /* Since GLOBALIZE is non-zero, we are not looking at a
+ definition of this tag. Since, in addition, we are currently
+ processing a (member) template declaration of a template
+ class, we don't want to do any lookup at all; consider:
+
+ template <class X>
+ struct S1
+
+ template <class U>
+ struct S2
+ { template <class V>
+ friend struct S1; };
+
+ Here, the S2::S1 declaration should not be confused with the
+ outer declaration. In particular, the inner version should
+ have a template parameter of level 2, not level 1. This
+ would be particularly important if the member declaration
+ were instead:
+
+ template <class V = U> friend struct S1;
+
+ say, when we should tsubst into `U' when instantiating S2. */
+ ref = NULL_TREE;
+ else
+ {
+ if (t)
+ ref = t;
+ else
+ ref = lookup_tag (code, name, b, 0);
+
+ if (! ref)
+ {
+ /* Try finding it as a type declaration. If that wins,
+ use it. */
+ ref = lookup_name (name, 1);
- if (ref != NULL_TREE
- && processing_template_decl
- && DECL_CLASS_TEMPLATE_P (ref)
- && template_class_depth (current_class_type) == 0)
- /* Since GLOBALIZE is true, we're declaring a global
+ if (ref != NULL_TREE
+ && processing_template_decl
+ && DECL_CLASS_TEMPLATE_P (ref)
+ && template_class_depth (current_class_type) == 0)
+ /* Since GLOBALIZE is true, we're declaring a global
template, so we want this type. */
- ref = DECL_RESULT (ref);
+ ref = DECL_RESULT (ref);
- if (ref && TREE_CODE (ref) == TYPE_DECL
- && TREE_CODE (TREE_TYPE (ref)) == code)
- ref = TREE_TYPE (ref);
- else
- ref = NULL_TREE;
+ if (ref && TREE_CODE (ref) == TYPE_DECL
+ && TREE_CODE (TREE_TYPE (ref)) == code)
+ ref = TREE_TYPE (ref);
+ else
+ ref = NULL_TREE;
+ }
}
}
@@ -10924,22 +11662,17 @@ xref_tag (code_type_node, name, binfo, globalize)
/* If it no longer looks like a nested type, make sure it's
in global scope.
If it is not an IDENTIFIER, this is not a declaration */
- if (b == global_binding_level && !class_binding_level
+ if (b->namespace_p && !class_binding_level
&& TREE_CODE (name) == IDENTIFIER_NODE)
{
- tree binding;
- binding = binding_for_name (name, current_namespace);
- if (BINDING_VALUE (binding) == NULL_TREE)
- BINDING_VALUE (binding) = TYPE_NAME (ref);
+ if (IDENTIFIER_NAMESPACE_VALUE (name) == NULL_TREE)
+ SET_IDENTIFIER_NAMESPACE_VALUE (name, TYPE_NAME (ref));
}
if (!globalize && processing_template_decl && IS_AGGR_TYPE (ref))
redeclare_class_template (ref, current_template_parms);
}
- if (binfo)
- xref_basetypes (code_type_node, name, ref, binfo);
-
/* Until the type is defined, tentatively accept whatever
structure tag the user hands us. */
if (TYPE_SIZE (ref) == NULL_TREE
@@ -10955,6 +11688,21 @@ xref_tag (code_type_node, name, binfo, globalize)
pop_obstacks ();
+ TREE_TYPE (ref) = attributes;
+
+ if (ref && TYPE_P (ref))
+ {
+ /* [dcl.type.elab]
+
+ If the identifier resolves to a typedef-name or a template
+ type-parameter, the elaborated-type-specifier is
+ ill-formed. */
+ if (TYPE_LANG_SPECIFIC (ref) && TYPE_WAS_ANONYMOUS (ref))
+ cp_error ("`%T' is a typedef name", ref);
+ else if (TREE_CODE (ref) == TEMPLATE_TYPE_PARM)
+ cp_error ("`%T' is a template type paramter", ref);
+ }
+
return ref;
}
@@ -10974,7 +11722,7 @@ xref_tag_from_type (old, id, globalize)
if (id == NULL_TREE)
id = TYPE_IDENTIFIER (old);
- return xref_tag (code_type_node, id, NULL_TREE, globalize);
+ return xref_tag (code_type_node, id, globalize);
}
void
@@ -11021,10 +11769,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
tree basetype = TREE_VALUE (binfo);
tree base_binfo;
- GNU_xref_hier (IDENTIFIER_POINTER (name),
- IDENTIFIER_POINTER (TREE_VALUE (binfo)),
- via_public, via_virtual, 0);
-
if (basetype && TREE_CODE (basetype) == TYPE_DECL)
basetype = TREE_TYPE (basetype);
if (!basetype
@@ -11037,11 +11781,14 @@ xref_basetypes (code_type_node, name, ref, binfo)
TREE_VALUE (binfo));
continue;
}
+
+ GNU_xref_hier (name, basetype, via_public, via_virtual, 0);
+
#if 1
/* This code replaces similar code in layout_basetypes.
We put the complete_type first for implicit `typename'. */
- else if (TYPE_SIZE (complete_type (basetype)) == NULL_TREE
- && ! (current_template_parms && uses_template_parms (basetype)))
+ if (TYPE_SIZE (complete_type (basetype)) == NULL_TREE
+ && ! (current_template_parms && uses_template_parms (basetype)))
{
cp_error ("base class `%T' has incomplete type", basetype);
continue;
@@ -11058,6 +11805,10 @@ xref_basetypes (code_type_node, name, ref, binfo)
continue;
}
+ if (TYPE_FOR_JAVA (basetype)
+ && current_lang_stack == current_lang_base)
+ TYPE_FOR_JAVA (ref) = 1;
+
/* Note that the BINFO records which describe individual
inheritances are *not* shared in the lattice! They
cannot be shared because a given baseclass may be
@@ -11068,7 +11819,7 @@ xref_basetypes (code_type_node, name, ref, binfo)
base_binfo = make_binfo (integer_zero_node, basetype,
TYPE_BINFO_VTABLE (basetype),
- TYPE_BINFO_VIRTUALS (basetype), NULL_TREE);
+ TYPE_BINFO_VIRTUALS (basetype));
TREE_VEC_ELT (binfos, i) = base_binfo;
TREE_VIA_PUBLIC (base_binfo) = via_public;
@@ -11076,6 +11827,10 @@ xref_basetypes (code_type_node, name, ref, binfo)
TREE_VIA_VIRTUAL (base_binfo) = via_virtual;
BINFO_INHERITANCE_CHAIN (base_binfo) = TYPE_BINFO (ref);
+ /* We need to unshare the binfos now so that lookups during class
+ definition work. */
+ unshare_base_binfos (base_binfo);
+
SET_CLASSTYPE_MARKED (basetype);
/* We are free to modify these bits because they are meaningless
@@ -11088,7 +11843,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
TYPE_GETS_NEW (ref) |= TYPE_GETS_NEW (basetype);
TYPE_GETS_DELETE (ref) |= TYPE_GETS_DELETE (basetype);
- CLASSTYPE_LOCAL_TYPEDECLS (ref) |= CLASSTYPE_LOCAL_TYPEDECLS (basetype);
i += 1;
}
}
@@ -11114,8 +11868,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
}
-tree current_local_enum = NULL_TREE;
-
/* Begin compiling the definition of an enumeration type.
NAME is its name (or null if anonymous).
Returns the type object, as yet incomplete.
@@ -11129,8 +11881,13 @@ start_enum (name)
register tree enumtype = NULL_TREE;
struct binding_level *b = inner_binding_level;
+ /* We are wasting space here and putting these on the permanent_obstack so
+ that typeid(local enum) will work correctly. */
+#if 0
if (processing_template_decl && current_function_decl)
- end_temporary_allocation ();
+#endif
+
+ end_temporary_allocation ();
/* If this is the real definition for a previous forward reference,
fill in the contents in the same object that used to be the
@@ -11147,14 +11904,9 @@ start_enum (name)
pushtag (name, enumtype, 0);
}
- if (b->pseudo_global)
- cp_error ("template declaration of `%#T'", enumtype);
-
if (current_class_type)
TREE_ADDRESSABLE (b->tags) = 1;
- current_local_enum = NULL_TREE;
-
/* We don't copy this value because build_enumerator needs to do it. */
enum_next_value = integer_zero_node;
enum_overflow = 0;
@@ -11169,39 +11921,63 @@ start_enum (name)
Returns ENUMTYPE. */
tree
-finish_enum (enumtype, values)
- register tree enumtype, values;
+finish_enum (enumtype)
+ tree enumtype;
{
register tree minnode = NULL_TREE, maxnode = NULL_TREE;
/* Calculate the maximum value of any enumerator in this type. */
+ tree values = TYPE_VALUES (enumtype);
if (values)
{
- register tree pair;
- register tree value = DECL_INITIAL (TREE_VALUE (values));
+ tree pair;
- if (! processing_template_decl)
- {
- /* Speed up the main loop by performing some precalculations */
- TREE_TYPE (TREE_VALUE (values)) = enumtype;
- TREE_TYPE (value) = enumtype;
- minnode = maxnode = value;
- }
- TREE_VALUE (values) = value;
-
- for (pair = TREE_CHAIN (values); pair; pair = TREE_CHAIN (pair))
+ for (pair = values; pair; pair = TREE_CHAIN (pair))
{
- value = DECL_INITIAL (TREE_VALUE (pair));
- if (! processing_template_decl)
- {
- TREE_TYPE (TREE_VALUE (pair)) = enumtype;
+ tree decl;
+ tree value;
+
+ /* The TREE_VALUE is a CONST_DECL for this enumeration
+ constant. */
+ decl = TREE_VALUE (pair);
+
+ /* The DECL_INITIAL will be NULL if we are processing a
+ template declaration and this enumeration constant had no
+ explicit initializer. */
+ value = DECL_INITIAL (decl);
+ if (value && !processing_template_decl)
+ {
+ /* Set the TREE_TYPE for the VALUE as well. That's so
+ that when we call decl_constant_value we get an
+ entity of the right type (but with the constant
+ value). Since we shouldn't ever call
+ decl_constant_value on a template type, there's no
+ reason to do that when processing_template_decl.
+ And, if the expression is something like a
+ TEMPLATE_PARM_INDEX or a CAST_EXPR doing so will
+ wreak havoc on the intended type of the expression.
+
+ Of course, there's also no point in trying to compute
+ minimum or maximum values if we're in a template. */
TREE_TYPE (value) = enumtype;
- if (tree_int_cst_lt (maxnode, value))
+
+ if (!minnode)
+ minnode = maxnode = value;
+ else if (tree_int_cst_lt (maxnode, value))
maxnode = value;
else if (tree_int_cst_lt (value, minnode))
minnode = value;
}
- TREE_VALUE (pair) = value;
+
+ if (processing_template_decl)
+ /* If this is just a template, leave the CONST_DECL
+ alone. That way tsubst_copy will find CONST_DECLs for
+ CONST_DECLs, and not INTEGER_CSTs. */
+ ;
+ else
+ /* In the list we're building up, we want the enumeration
+ values, not the CONST_DECLs. */
+ TREE_VALUE (pair) = value;
}
}
else
@@ -11211,7 +11987,8 @@ finish_enum (enumtype, values)
if (processing_template_decl)
{
- if (current_function_decl)
+ tree scope = current_scope ();
+ if (scope && TREE_CODE (scope) == FUNCTION_DECL)
{
add_tree (build_min (TAG_DEFN, enumtype));
resume_temporary_allocation ();
@@ -11257,6 +12034,7 @@ finish_enum (enumtype, values)
TYPE_MIN_VALUE (tem) = TYPE_MIN_VALUE (enumtype);
TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
+ TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
TYPE_MODE (tem) = TYPE_MODE (enumtype);
TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
@@ -11265,21 +12043,23 @@ finish_enum (enumtype, values)
}
/* Finish debugging output for this type. */
- rest_of_type_compilation (enumtype, global_bindings_p ());
+ rest_of_type_compilation (enumtype, namespace_bindings_p ());
return enumtype;
}
-/* Build and install a CONST_DECL for one value of the
- current enumeration type (one that was begun with start_enum).
- Return a tree-list containing the name and its value.
+/* Build and install a CONST_DECL for an enumeration constant of the
+ enumeration type TYPE whose NAME and VALUE (if any) are provided.
Assignment of sequential values by default is handled here. */
tree
-build_enumerator (name, value)
- tree name, value;
+build_enumerator (name, value, type)
+ tree name;
+ tree value;
+ tree type;
{
tree decl, result;
+ tree context;
/* Remove no-op casts from the value. */
if (value)
@@ -11316,41 +12096,46 @@ build_enumerator (name, value)
/* Remove no-op casts from the value. */
if (value)
STRIP_TYPE_NOPS (value);
-
- /* We have to always copy here; not all INTEGER_CSTs are unshared,
- and there's no wedding ring. Look at size_int()...*/
- value = copy_node (value);
#if 0
/* To fix MAX_VAL enum consts. (bkoz) */
TREE_TYPE (value) = integer_type_node;
#endif
}
- /* C++ associates enums with global, function, or class declarations. */
-
- decl = current_scope ();
- if (decl && decl == current_class_type)
- {
- /* This enum declaration is local to the class, so we must put
- it in that class's list of decls. */
- decl = build_lang_field_decl (CONST_DECL, name, integer_type_node);
- DECL_INITIAL (decl) = value;
- TREE_READONLY (decl) = 1;
- pushdecl_class_level (decl);
- TREE_CHAIN (decl) = current_local_enum;
- current_local_enum = decl;
- }
- else
- {
- /* It's a global enum, or it's local to a function. (Note local to
- a function could mean local to a class method. */
- decl = build_decl (CONST_DECL, name, integer_type_node);
- DECL_INITIAL (decl) = value;
- TREE_READONLY (decl) = 1;
+ /* We always have to copy here; not all INTEGER_CSTs are unshared.
+ Even in other cases, we will later (in finish_enum) be setting the
+ type of VALUE. */
+ if (value != NULL_TREE)
+ value = copy_node (value);
- pushdecl (decl);
- GNU_xref_decl (current_function_decl, decl);
- }
+ /* C++ associates enums with global, function, or class declarations. */
+
+ context = current_scope ();
+ if (context && context == current_class_type)
+ /* This enum declaration is local to the class. */
+ decl = build_lang_field_decl (CONST_DECL, name, type);
+ else
+ /* It's a global enum, or it's local to a function. (Note local to
+ a function could mean local to a class method. */
+ decl = build_decl (CONST_DECL, name, type);
+
+ DECL_CONTEXT (decl) = FROB_CONTEXT (context);
+ DECL_INITIAL (decl) = value;
+ TREE_READONLY (decl) = 1;
+
+ if (context && context == current_class_type)
+ {
+ pushdecl_class_level (decl);
+ /* In something like `struct S { enum E { i = 7 }; };' we put `i'
+ on the TYPE_FIELDS list for `S'. (That's so that you can say
+ things like `S::i' later.) */
+ finish_member_declaration (decl);
+ }
+ else
+ {
+ pushdecl (decl);
+ GNU_xref_decl (current_function_decl, decl);
+ }
if (! processing_template_decl)
{
@@ -11364,30 +12149,6 @@ build_enumerator (name, value)
return result;
}
-tree
-grok_enum_decls (decl)
- tree decl;
-{
- tree d = current_local_enum;
-
- if (d == NULL_TREE)
- return decl;
-
- while (1)
- {
- if (TREE_CHAIN (d) == NULL_TREE)
- {
- TREE_CHAIN (d) = decl;
- break;
- }
- d = TREE_CHAIN (d);
- }
-
- decl = current_local_enum;
- current_local_enum = NULL_TREE;
-
- return decl;
-}
static int function_depth;
@@ -11458,9 +12219,12 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
{
decl1 = declarator;
+#if 0
+ /* What was this testing for, exactly? */
if (! DECL_ARGUMENTS (decl1)
&& !DECL_STATIC_FUNCTION_P (decl1)
- && DECL_CONTEXT (decl1)
+ && !DECL_ARTIFICIAL (decl1)
+ && DECL_CLASS_SCOPE_P (decl1)
&& TYPE_IDENTIFIER (DECL_CONTEXT (decl1))
&& IDENTIFIER_TEMPLATE (TYPE_IDENTIFIER (DECL_CONTEXT (decl1))))
{
@@ -11472,6 +12236,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
else if (BINDING_VALUE (binding))
cp_error_at ("previous declaration here", BINDING_VALUE (binding));
}
+#endif
fntype = TREE_TYPE (decl1);
if (TREE_CODE (fntype) == METHOD_TYPE)
@@ -11535,9 +12300,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
if (TREE_CODE (fntype) == METHOD_TYPE)
ctype = TYPE_METHOD_BASETYPE (fntype);
- else if (IDENTIFIER_LENGTH (DECL_NAME (decl1)) == 4
- && ! strcmp (IDENTIFIER_POINTER (DECL_NAME (decl1)), "main")
- && DECL_CONTEXT (decl1) == NULL_TREE)
+ else if (DECL_MAIN_P (decl1))
{
/* If this doesn't return integer_type, complain. */
if (TREE_TYPE (TREE_TYPE (decl1)) != integer_type_node)
@@ -11608,23 +12371,46 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
error_mark_node is replaced below (in poplevel) with the BLOCK. */
DECL_INITIAL (decl1) = error_mark_node;
+#ifdef SET_DEFAULT_DECL_ATTRIBUTES
+ SET_DEFAULT_DECL_ATTRIBUTES (decl1, attributes);
+#endif
+
/* This function exists in static storage.
(This does not mean `static' in the C sense!) */
TREE_STATIC (decl1) = 1;
+ /* Set up current_class_type, and enter the scope of the class, if
+ appropriate. */
+ if (ctype)
+ push_nested_class (ctype, 1);
+ else if (DECL_STATIC_FUNCTION_P (decl1))
+ push_nested_class (DECL_CONTEXT (decl1), 2);
+
+ /* We must call push_template_decl after current_class_type is set
+ up. (If we are processing inline definitions after exiting a
+ class scope, current_class_type will be NULL_TREE until set above
+ by push_nested_class.) */
+ if (processing_template_decl)
+ decl1 = push_template_decl (decl1);
+
/* Record the decl so that the function name is defined.
If we already have a decl for this name, and it is a FUNCTION_DECL,
use the old decl. */
-
- if (processing_template_decl)
- decl1 = push_template_decl (decl1);
- else if (pre_parsed_p == 0)
+ if (!processing_template_decl && pre_parsed_p == 0)
{
/* A specialization is not used to guide overload resolution. */
if ((flag_guiding_decls
|| !DECL_TEMPLATE_SPECIALIZATION (decl1))
&& ! DECL_FUNCTION_MEMBER_P (decl1))
decl1 = pushdecl (decl1);
+ else
+ {
+ /* We need to set the DECL_CONTEXT. */
+ if (!DECL_CONTEXT (decl1) && DECL_TEMPLATE_INFO (decl1))
+ DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1));
+ /* And make sure we have enough default args. */
+ check_default_args (decl1);
+ }
DECL_MAIN_VARIANT (decl1) = decl1;
fntype = TREE_TYPE (decl1);
}
@@ -11690,8 +12476,6 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
if (ctype)
{
- push_nested_class (ctype, 1);
-
/* If we're compiling a friend function, neither of the variables
current_class_ptr nor current_class_type will have values. */
if (! doing_friend)
@@ -11724,10 +12508,6 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
}
else
{
- if (DECL_STATIC_FUNCTION_P (decl1))
- push_nested_class (DECL_CONTEXT (decl1), 2);
- else
- push_memoized_context (0, 1);
current_class_ptr = current_class_ref = NULL_TREE;
}
@@ -11738,6 +12518,7 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
if (attrs)
cplus_decl_attributes (decl1, NULL_TREE, attrs);
+
make_function_rtl (decl1);
/* Promote the value to int before returning it. */
@@ -11928,13 +12709,8 @@ store_parm_decls ()
/* If this function is `main', emit a call to `__main'
to run global initializers, etc. */
- if (DECL_NAME (fndecl)
- && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 4
- && strcmp (IDENTIFIER_POINTER (DECL_NAME (fndecl)), "main") == 0
- && DECL_CONTEXT (fndecl) == NULL_TREE)
- {
- expand_main_function ();
- }
+ if (DECL_MAIN_P (fndecl))
+ expand_main_function ();
/* Now that we have initialized the parms, we can start their
cleanups. We cannot do this before, since expand_decl_cleanup
@@ -12217,20 +12993,22 @@ finish_function (lineno, call_poplevel, nested)
virtual_size = c_sizeof (current_class_type);
/* At the end, call delete if that's what's requested. */
- if (TYPE_GETS_REG_DELETE (current_class_type))
- /* This NOP_EXPR means we are in a static call context. */
- exprstmt
- = build_method_call (build_indirect_ref (build1 (NOP_EXPR,
- build_pointer_type (current_class_type),
- error_mark_node),
- NULL_PTR),
- ansi_opname[(int) DELETE_EXPR],
- expr_tree_cons (NULL_TREE, current_class_ptr,
- build_expr_list (NULL_TREE, virtual_size)),
- NULL_TREE, LOOKUP_NORMAL);
- else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
- exprstmt = build_x_delete (ptr_type_node, current_class_ptr, 0,
- virtual_size);
+
+ /* FDIS sez: At the point of definition of a virtual destructor
+ (including an implicit definition), non-placement operator
+ delete shall be looked up in the scope of the destructor's
+ class and if found shall be accessible and unambiguous.
+
+ This is somewhat unclear, but I take it to mean that if the
+ class only defines placement deletes we don't do anything here.
+ So we pass LOOKUP_SPECULATIVELY; delete_sanity will complain
+ for us if they ever try to delete one of these. */
+
+ if (TYPE_GETS_REG_DELETE (current_class_type)
+ || TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
+ exprstmt = build_op_delete_call
+ (DELETE_EXPR, current_class_ptr, virtual_size,
+ LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE);
else
exprstmt = NULL_TREE;
@@ -12311,7 +13089,8 @@ finish_function (lineno, call_poplevel, nested)
expand_end_bindings (decls, decls != NULL_TREE, 0);
poplevel (decls != NULL_TREE, 0, 0);
}
- c_expand_return (current_class_ptr);
+ /* c_expand_return knows to return 'this' from a constructor. */
+ c_expand_return (NULL_TREE);
}
else if (TREE_CODE (TREE_TYPE (DECL_RESULT (current_function_decl))) != VOID_TYPE
&& return_label != NULL_RTX)
@@ -12378,14 +13157,13 @@ finish_function (lineno, call_poplevel, nested)
poplevel (decls != NULL_TREE, 1, 0);
}
- c_expand_return (current_class_ptr);
+ /* c_expand_return knows to return 'this' from a constructor. */
+ c_expand_return (NULL_TREE);
current_function_assigns_this = 0;
current_function_just_assigned_this = 0;
}
- else if (IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 4
- && ! strcmp (IDENTIFIER_POINTER (DECL_NAME (fndecl)), "main")
- && DECL_CONTEXT (fndecl) == NULL_TREE)
+ else if (DECL_MAIN_P (fndecl))
{
/* Make it so that `main' always returns 0 by default. */
#ifdef VMS
@@ -12430,7 +13208,7 @@ finish_function (lineno, call_poplevel, nested)
if (cleanup_label)
{
- /* remove the binding contour which is used
+ /* Remove the binding contour which is used
to catch cleanup-generated temporaries. */
expand_end_bindings (0, 0, 0);
poplevel (0, 0, 0);
@@ -12466,7 +13244,7 @@ finish_function (lineno, call_poplevel, nested)
my_friendly_abort (122);
poplevel (1, 0, 1);
- /* reset scope for C++: if we were in the scope of a class,
+ /* Reset scope for C++: if we were in the scope of a class,
then when we finish this function, we are not longer so.
This cannot be done until we know for sure that no more
class members will ever be referenced in this function
@@ -12476,8 +13254,6 @@ finish_function (lineno, call_poplevel, nested)
ctype = current_class_type;
pop_nested_class (1);
}
- else
- pop_memoized_context (1);
/* Must mark the RESULT_DECL as being in this function. */
DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
@@ -12658,7 +13434,8 @@ start_method (declspecs, declarator)
{
if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (fndecl)) != current_class_type)
{
- if (DECL_CONTEXT (fndecl))
+ if (DECL_CONTEXT (fndecl)
+ && TREE_CODE( DECL_CONTEXT (fndecl)) != NAMESPACE_DECL)
cp_error ("`%D' is already defined in class %s", fndecl,
TYPE_NAME_STRING (DECL_CONTEXT (fndecl)));
}
@@ -12670,7 +13447,8 @@ start_method (declspecs, declarator)
if (flag_default_inline)
DECL_INLINE (fndecl) = 1;
- if (processing_template_decl)
+ /* We process method specializations in finish_struct_1. */
+ if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl))
fndecl = push_template_decl (fndecl);
/* We read in the parameters on the maybepermanent_obstack,
@@ -12681,14 +13459,6 @@ start_method (declspecs, declarator)
if (! DECL_FRIEND_P (fndecl))
{
- if (DECL_CHAIN (fndecl) != NULL_TREE)
- {
- /* Need a fresh node here so that we don't get circularity
- when we link these together. If FNDECL was a friend, then
- `pushdecl' does the right thing, which is nothing wrt its
- current value of DECL_CHAIN. */
- fndecl = copy_node (fndecl);
- }
if (TREE_CHAIN (fndecl))
{
fndecl = copy_node (fndecl);
@@ -12768,7 +13538,7 @@ finish_method (decl)
IDENTIFIER_CLASS_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
for (link = current_binding_level->type_shadowed;
link; link = TREE_CHAIN (link))
- IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
+ SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (link), TREE_VALUE (link));
GNU_xref_end_scope ((HOST_WIDE_INT) current_binding_level,
(HOST_WIDE_INT) current_binding_level->level_chain,
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index e945a72f2a8..f70867a9e5a 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -40,18 +40,27 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "defaults.h"
#include "toplev.h"
+#include "dwarf2out.h"
+#include "dwarfout.h"
+
+#if USE_CPPLIB
+#include "cpplib.h"
+extern cpp_reader parse_in;
+extern cpp_options parse_options;
+static int cpp_initialized;
+#endif
static tree get_sentry PROTO((tree));
static void mark_vtable_entries PROTO((tree));
-static void import_export_template PROTO((tree));
static void grok_function_init PROTO((tree, tree));
static int finish_vtable_vardecl PROTO((tree, tree));
static int prune_vtable_vardecl PROTO((tree, tree));
static void finish_sigtable_vardecl PROTO((tree, tree));
static int is_namespace_ancestor PROTO((tree, tree));
-static tree namespace_ancestor PROTO((tree, tree));
static void add_using_namespace PROTO((tree, tree, int));
-static tree ambiguous_decl PROTO((tree, tree, tree));
+static tree ambiguous_decl PROTO((tree, tree, tree,int));
+static tree build_anon_union_vars PROTO((tree, tree*, int, int));
+static void check_decl_namespace PROTO((void));
extern int current_class_depth;
@@ -88,11 +97,15 @@ int at_eof;
tree static_ctors, static_dtors;
-/* The current open namespace, and :: */
+/* The current open namespace, and ::. */
tree current_namespace;
tree global_namespace;
+/* The stack for namespaces of current declarations. */
+
+static tree decl_namespace_list;
+
/* C (and C++) language-specific option variables. */
@@ -160,10 +173,28 @@ int flag_alt_external_templates;
int flag_implicit_templates = 1;
+/* Nonzero means that implicit instantiations of inline templates will be
+ emitted if needed, even if instantiations of non-inline templates
+ aren't. */
+
+int flag_implicit_inline_templates = 1;
+
+/* Nonzero means allow numerical priorities on constructors. */
+
+#ifdef USE_INIT_PRIORITY
+int flag_init_priority = 1;
+#else
+int flag_init_priority;
+#endif
+
/* Nonzero means warn about implicit declarations. */
int warn_implicit = 1;
+/* Nonzero means warn about usage of long long when `-pedantic'. */
+
+int warn_long_long = 1;
+
/* Nonzero means warn when all ctors or dtors are private, and the class
has no friends. */
@@ -181,9 +212,18 @@ int flag_vtable_thunks = DEFAULT_VTABLE_THUNKS;
int flag_use_repository;
-/* Nonzero means give string constants the type `const char *'
- to get extra warnings from them. These warnings will be too numerous
- to be useful, except in thoroughly ANSIfied programs. */
+/* Nonzero if we want to issue diagnostics that the standard says are not
+ required. */
+
+int flag_optional_diags = 1;
+
+/* Nonzero means give string constants the type `const char *', as mandated
+ by the standard. */
+
+int flag_const_strings = 1;
+
+/* Nonzero means warn about deprecated conversion from string constant to
+ `char *'. */
int warn_write_strings;
@@ -192,11 +232,6 @@ int warn_write_strings;
int warn_cast_qual;
-/* Nonzero means warn that dbx info for template class methods isn't fully
- supported yet. */
-
-int warn_template_debugging;
-
/* Nonzero means warn about sizeof(function) or addition/subtraction
of function pointers. */
@@ -272,7 +307,16 @@ int warn_old_style_cast;
/* Warn about #pragma directives that are not recognised. */
-int warn_unknown_pragmas = 0; /* Tri state variable. */
+int warn_unknown_pragmas; /* Tri state variable. */
+
+/* Nonzero means warn about use of multicharacter literals. */
+
+int warn_multichar = 1;
+
+/* Nonzero means warn when non-templatized friend functions are
+ declared within a template */
+
+int warn_nontemplate_friend = 1;
/* Nonzero means `$' can be in an identifier. */
@@ -297,40 +341,22 @@ int flag_labels_ok;
int flag_detailed_statistics;
/* C++ specific flags. */
-/* Nonzero for -fall-virtual: make every member function (except
- constructors) lay down in the virtual function table. Calls
- can then either go through the virtual function table or not,
- depending. */
-
-int flag_all_virtual;
-
/* Zero means that `this' is a *const. This gives nice behavior in the
2.0 world. 1 gives 1.2-compatible behavior. 2 gives Spring behavior.
-2 means we're constructing an object and it has fixed type. */
int flag_this_is_variable;
-/* Nonzero means memoize our member lookups. */
-
-int flag_memoize_lookups; int flag_save_memoized_contexts;
-
/* 3 means write out only virtuals function tables `defined'
in this implementation file.
- 2 means write out only specific virtual function tables
- and give them (C) public access.
- 1 means write out virtual function tables and give them
- (C) public access.
0 means write out virtual function tables and give them
- (C) static access (default).
- -1 means declare virtual function tables extern. */
+ (C) static access (default). */
int write_virtuals;
-/* Nonzero means we should attempt to elide constructors when possible.
- FIXME: This flag is obsolete, and should be torn out along with the
- old overloading code. */
+/* Nonzero means we should attempt to elide constructors when possible. */
-int flag_elide_constructors;
+int flag_elide_constructors = 1;
/* Nonzero means recognize and handle signature language constructs. */
@@ -341,11 +367,6 @@ int flag_handle_signatures;
int flag_default_inline = 1;
-/* Controls whether enums and ints freely convert.
- 1 means with complete freedom.
- 0 means enums can convert to ints, but not vice-versa. */
-int flag_int_enum_equivalence;
-
/* Controls whether compiler generates 'type descriptor' that give
run-time type information. */
int flag_rtti = 1;
@@ -354,18 +375,6 @@ int flag_rtti = 1;
for the GNU class browser. */
extern int flag_gnu_xref;
-/* Nonzero if compiler can make `reasonable' assumptions about
- references and objects. For example, the compiler must be
- conservative about the following and not assume that `a' is nonnull:
-
- obj &a = g ();
- a.f (2);
-
- In general, it is `reasonable' to assume that for many programs,
- and better code can be generated in that case. */
-
-int flag_assume_nonnull_objects = 1;
-
/* Nonzero if we want to support huge (> 2^(sizeof(short)*8-1) bytes)
objects. */
@@ -410,6 +419,10 @@ int flag_weak = 1;
int flag_new_abi;
+/* Nonzero to not ignore namespace std. */
+
+int flag_honor_std;
+
/* Maximum template instantiation depth. Must be at least 17 for ANSI
compliance. */
@@ -428,6 +441,9 @@ int flag_guiding_decls;
and class qualifiers. */
int flag_do_squangling;
+/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
+
+int flag_vtable_gc;
/* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable.
@@ -449,30 +465,32 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"builtin", &flag_no_builtin, 0},
{"ident", &flag_no_ident, 0},
{"labels-ok", &flag_labels_ok, 1},
+ {"const-strings", &flag_const_strings, 1},
{"stats", &flag_detailed_statistics, 1},
{"this-is-variable", &flag_this_is_variable, 1},
{"strict-prototype", &flag_strict_prototype, 1},
- {"all-virtual", &flag_all_virtual, 1},
- {"memoize-lookups", &flag_memoize_lookups, 1},
{"elide-constructors", &flag_elide_constructors, 1},
{"handle-exceptions", &flag_exceptions, 1},
{"handle-signatures", &flag_handle_signatures, 1},
{"default-inline", &flag_default_inline, 1},
{"dollars-in-identifiers", &dollars_in_ident, 1},
- {"enum-int-equiv", &flag_int_enum_equivalence, 1},
+ {"honor-std", &flag_honor_std, 1},
{"rtti", &flag_rtti, 1},
{"xref", &flag_gnu_xref, 1},
- {"nonnull-objects", &flag_assume_nonnull_objects, 1},
{"implement-inlines", &flag_implement_inlines, 1},
{"external-templates", &flag_external_templates, 1},
{"implicit-templates", &flag_implicit_templates, 1},
+ {"implicit-inline-templates", &flag_implicit_inline_templates, 1},
+ {"init-priority", &flag_init_priority, 1},
{"huge-objects", &flag_huge_objects, 1},
{"conserve-space", &flag_conserve_space, 1},
+ {"vtable-gc", &flag_vtable_gc, 1},
{"vtable-thunks", &flag_vtable_thunks, 1},
{"access-control", &flag_access_control, 1},
{"nonansi-builtins", &flag_no_nonansi_builtin, 0},
{"gnu-keywords", &flag_no_gnu_keywords, 0},
{"operator-names", &flag_operator_names, 1},
+ {"optional-diags", &flag_optional_diags, 1},
{"check-new", &flag_check_new, 1},
{"repo", &flag_use_repository, 1},
{"for-scope", &flag_new_for_scope, 2},
@@ -480,32 +498,36 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
};
/* Decode the string P as a language-specific option.
- Return 1 if it is recognized (and handle it);
- return 0 if not recognized. */
+ Return the number of strings consumed for a valid option.
+ Otherwise return 0. */
int
-lang_decode_option (p)
- char *p;
+lang_decode_option (argc, argv)
+ int argc
+#if !USE_CPPLIB
+ ATTRIBUTE_UNUSED
+#endif
+ ;
+ char **argv;
+
{
- if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
- flag_writable_strings = 1,
- flag_this_is_variable = 1, flag_new_for_scope = 0;
- /* The +e options are for cfront compatibility. They come in as
- `-+eN', to kludge around gcc.c's argument handling. */
- else if (p[0] == '-' && p[1] == '+' && p[2] == 'e')
- {
- int old_write_virtuals = write_virtuals;
- if (p[3] == '1')
- write_virtuals = 1;
- else if (p[3] == '0')
- write_virtuals = -1;
- else if (p[3] == '2')
- write_virtuals = 2;
- else error ("invalid +e option");
- if (old_write_virtuals != 0
- && write_virtuals != old_write_virtuals)
- error ("conflicting +e options given");
+ int strings_processed;
+ char *p = argv[0];
+#if USE_CPPLIB
+ if (! cpp_initialized)
+ {
+ cpp_reader_init (&parse_in);
+ parse_in.data = &parse_options;
+ cpp_options_init (&parse_options);
+ cpp_initialized = 1;
}
+ strings_processed = cpp_handle_option (&parse_in, argc, argv);
+#else
+ strings_processed = 0;
+#endif /* ! USE_CPPLIB */
+
+ if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
+ /* ignore */;
else if (p[0] == '-' && p[1] == 'f')
{
/* Some kind of -f option.
@@ -521,16 +543,24 @@ lang_decode_option (p)
|| !strcmp (p, "no-handle-exceptions"))
warning ("-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)");
- if (!strcmp (p, "save-memoized"))
+ if (!strcmp (p, "memoize-lookups")
+ || !strcmp (p, "no-memoize-lookups")
+ || !strcmp (p, "save-memoized")
+ || !strcmp (p, "no-save-memoized")
+ || !strcmp (p, "no-all-virtual")
+ || !strcmp (p, "no-enum-int-equiv")
+ || !strcmp (p, "nonnull-objects")
+ || !strcmp (p, "ansi-overloading"))
{
- flag_memoize_lookups = 1;
- flag_save_memoized_contexts = 1;
+ /* ignore */
found = 1;
}
- else if (!strcmp (p, "no-save-memoized"))
+ else if (!strcmp (p, "all-virtual")
+ || !strcmp (p, "enum-int-equiv")
+ || !strcmp (p, "no-nonnull-objects")
+ || !strcmp (p, "no-ansi-overloading"))
{
- flag_memoize_lookups = 0;
- flag_save_memoized_contexts = 0;
+ warning ("-f%s is no longer supported", p);
found = 1;
}
else if (! strcmp (p, "alt-external-templates"))
@@ -561,23 +591,18 @@ lang_decode_option (p)
flag_guiding_decls = 0;
found = 1;
}
- else if (!strcmp (p, "ansi-overloading"))
- found = 1;
- else if (!strcmp (p, "no-ansi-overloading"))
- {
- error ("-fno-ansi-overloading is no longer supported");
- found = 1;
- }
else if (!strcmp (p, "new-abi"))
{
flag_new_abi = 1;
flag_do_squangling = 1;
+ flag_honor_std = 1;
flag_vtable_thunks = 1;
}
else if (!strcmp (p, "no-new-abi"))
{
flag_new_abi = 0;
flag_do_squangling = 0;
+ flag_honor_std = 0;
}
else if (!strncmp (p, "template-depth-", 15))
{
@@ -643,6 +668,8 @@ lang_decode_option (p)
if (!strcmp (p, "implicit"))
warn_implicit = setting;
+ else if (!strcmp (p, "long-long"))
+ warn_long_long = setting;
else if (!strcmp (p, "return-type"))
warn_return_type = setting;
else if (!strcmp (p, "ctor-dtor-privacy"))
@@ -685,10 +712,16 @@ lang_decode_option (p)
warn_sign_promo = setting;
else if (!strcmp (p, "old-style-cast"))
warn_old_style_cast = setting;
+ else if (!strcmp (p, "overloaded-virtual"))
+ warn_overloaded_virtual = setting;
+ else if (!strcmp (p, "multichar"))
+ warn_multichar = setting;
else if (!strcmp (p, "unknown-pragmas"))
/* Set to greater than 1, so that even unknown pragmas in
system headers will be warned about. */
warn_unknown_pragmas = setting * 2;
+ else if (!strcmp (p, "non-template-friend"))
+ warn_nontemplate_friend = setting;
else if (!strcmp (p, "comment"))
; /* cpp handles this one. */
else if (!strcmp (p, "comments"))
@@ -710,22 +743,20 @@ lang_decode_option (p)
warn_sign_compare = setting;
warn_extern_inline = setting;
warn_nonvdtor = setting;
+ warn_multichar = setting;
/* We save the value of warn_uninitialized, since if they put
-Wuninitialized on the command line, we need to generate a
warning about not using it without also specifying -O. */
if (warn_uninitialized != 1)
warn_uninitialized = (setting ? 2 : 0);
- warn_template_debugging = setting;
warn_reorder = setting;
warn_sign_promo = setting;
/* Only warn about unknown pragmas that are not in system
headers. */
- warn_unknown_pragmas = 1;
+ warn_unknown_pragmas = 1;
+ warn_nontemplate_friend = setting;
}
-
- else if (!strcmp (p, "overloaded-virtual"))
- warn_overloaded_virtual = setting;
- else return 0;
+ else return strings_processed;
}
else if (!strcmp (p, "-ansi"))
flag_no_nonansi_builtin = 1, flag_ansi = 1,
@@ -738,7 +769,7 @@ lang_decode_option (p)
spew_debug = 1;
#endif
else
- return 0;
+ return strings_processed;
return 1;
}
@@ -829,123 +860,88 @@ warn_if_unknown_interface (decl)
/* A subroutine of the parser, to handle a component list. */
-tree
-grok_x_components (specs, components)
- tree specs, components;
+void
+grok_x_components (specs)
+ tree specs;
{
- register tree t, x, tcode;
-
- /* We just got some friends. They have been recorded elsewhere. */
- if (components == void_type_node)
- return NULL_TREE;
+ struct pending_inline **p;
+ tree t;
- if (components == NULL_TREE)
+ t = groktypename (build_decl_list (strip_attrs (specs), NULL_TREE));
+
+ if (t == NULL_TREE)
{
- t = groktypename (build_decl_list (specs, NULL_TREE));
-
- if (t == NULL_TREE)
- {
- error ("error in component specification");
- return NULL_TREE;
- }
-
- switch (TREE_CODE (t))
- {
- case VAR_DECL:
- /* Static anonymous unions come out as VAR_DECLs. */
- if (TREE_CODE (TREE_TYPE (t)) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (TREE_TYPE (t))))
- return t;
-
- /* We return SPECS here, because in the parser it was ending
- up with not doing anything to $$, which is what SPECS
- represents. */
- return specs;
- break;
+ cp_error ("invalid member declaration");
+ return;
+ }
- case RECORD_TYPE:
- /* This code may be needed for UNION_TYPEs as
- well. */
- tcode = record_type_node;
- if (CLASSTYPE_DECLARED_CLASS (t))
- tcode = class_type_node;
- else if (IS_SIGNATURE (t))
- tcode = signature_type_node;
-
- if (CLASSTYPE_IS_TEMPLATE (t))
- /* In this case, the TYPE_IDENTIFIER will be something
- like S<T>, rather than S, so to get the correct name we
- look at the template. */
- x = DECL_NAME (CLASSTYPE_TI_TEMPLATE (t));
- else
- x = TYPE_IDENTIFIER (t);
+ /* The only case where we need to do anything additional here is an
+ anonymous union field, e.g.: `struct S { union { int i; }; };'. */
+ if (!ANON_UNION_TYPE_P (t))
+ return;
- t = xref_tag (tcode, x, NULL_TREE, 0);
- return NULL_TREE;
- break;
+ fixup_anonymous_union (t);
+ finish_member_declaration (build_lang_field_decl (FIELD_DECL,
+ NULL_TREE,
+ t));
- case UNION_TYPE:
- case ENUMERAL_TYPE:
- if (TREE_CODE (t) == UNION_TYPE)
- tcode = union_type_node;
- else
- tcode = enum_type_node;
+ /* Ignore any inline function definitions in the anonymous union
+ since an anonymous union may not have function members. */
+ p = &pending_inlines;
+ for (; *p; *p = (*p)->next)
+ if (DECL_CONTEXT ((*p)->fndecl) != t)
+ break;
+}
- t = xref_tag (tcode, TYPE_IDENTIFIER (t), NULL_TREE, 0);
- if (TREE_CODE (t) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
- {
- /* See also shadow_tag. */
-
- struct pending_inline **p;
- tree *q;
- x = build_lang_field_decl (FIELD_DECL, NULL_TREE, t);
-
- /* Wipe out memory of synthesized methods */
- TYPE_HAS_CONSTRUCTOR (t) = 0;
- TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0;
- TYPE_HAS_INIT_REF (t) = 0;
- TYPE_HAS_CONST_INIT_REF (t) = 0;
- TYPE_HAS_ASSIGN_REF (t) = 0;
- TYPE_HAS_ASSIGNMENT (t) = 0;
- TYPE_HAS_CONST_ASSIGN_REF (t) = 0;
-
- q = &TYPE_METHODS (t);
- while (*q)
- {
- if (DECL_ARTIFICIAL (*q))
- *q = TREE_CHAIN (*q);
- else
- q = &TREE_CHAIN (*q);
- }
- if (TYPE_METHODS (t))
- error ("an anonymous union cannot have function members");
+/* Constructors for types with virtual baseclasses need an "in-charge" flag
+ saying whether this constructor is responsible for initialization of
+ virtual baseclasses or not. All destructors also need this "in-charge"
+ flag, which additionally determines whether or not the destructor should
+ free the memory for the object.
- p = &pending_inlines;
- for (; *p; *p = (*p)->next)
- if (DECL_CONTEXT ((*p)->fndecl) != t)
- break;
- }
- else if (TREE_CODE (t) == ENUMERAL_TYPE)
- x = grok_enum_decls (NULL_TREE);
- else
- x = NULL_TREE;
- return x;
- break;
+ This function adds the "in-charge" flag to member function FN if
+ appropriate. It is called from grokclassfn and tsubst.
+ FN must be either a constructor or destructor. */
- default:
- if (t != void_type_node)
- error ("empty component declaration");
- return NULL_TREE;
- }
- }
+void
+maybe_retrofit_in_chrg (fn)
+ tree fn;
+{
+ tree basetype, arg_types, parms, parm, fntype;
+
+ if (DECL_CONSTRUCTOR_P (fn)
+ && TYPE_USES_VIRTUAL_BASECLASSES (DECL_CLASS_CONTEXT (fn))
+ && ! DECL_CONSTRUCTOR_FOR_VBASE_P (fn))
+ /* OK */;
+ else if (! DECL_CONSTRUCTOR_P (fn)
+ && TREE_CHAIN (DECL_ARGUMENTS (fn)) == NULL_TREE)
+ /* OK */;
else
- /* There may or may not be any enum decls to grok, but
- grok_enum_decls will just return components, if there aren't
- any. We used to try to figure out whether or not there were
- any enum decls based on the type of components, but that's too
- hard; it might be something like `enum { a } *p;'. */
- return grok_enum_decls (components);
+ return;
+
+ if (DECL_CONSTRUCTOR_P (fn))
+ DECL_CONSTRUCTOR_FOR_VBASE_P (fn) = 1;
+
+ /* First add it to DECL_ARGUMENTS... */
+ parm = build_decl (PARM_DECL, in_charge_identifier, integer_type_node);
+ /* Mark the artificial `__in_chrg' parameter as "artificial". */
+ SET_DECL_ARTIFICIAL (parm);
+ DECL_ARG_TYPE (parm) = integer_type_node;
+ TREE_READONLY (parm) = 1;
+ parms = DECL_ARGUMENTS (fn);
+ TREE_CHAIN (parm) = TREE_CHAIN (parms);
+ TREE_CHAIN (parms) = parm;
+
+ /* ...and then to TYPE_ARG_TYPES. */
+ arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn));
+ basetype = TREE_TYPE (TREE_VALUE (arg_types));
+ arg_types = hash_tree_chain (integer_type_node, TREE_CHAIN (arg_types));
+ fntype = build_cplus_method_type (basetype, TREE_TYPE (TREE_TYPE (fn)),
+ arg_types);
+ if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
+ fntype = build_exception_variant (fntype,
+ TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)));
+ TREE_TYPE (fn) = fntype;
}
/* Classes overload their constituent function names automatically.
@@ -969,8 +965,8 @@ grok_x_components (specs, components)
QUALS are the qualifiers for the this pointer. */
void
-grokclassfn (ctype, cname, function, flags, quals)
- tree ctype, cname, function;
+grokclassfn (ctype, function, flags, quals)
+ tree ctype, function;
enum overload_flags flags;
tree quals;
{
@@ -978,8 +974,6 @@ grokclassfn (ctype, cname, function, flags, quals)
tree arg_types;
tree parm;
tree qualtype;
- tree fntype = TREE_TYPE (function);
- tree raises = TYPE_RAISES_EXCEPTIONS (fntype);
if (fn_name == NULL_TREE)
{
@@ -1006,24 +1000,6 @@ grokclassfn (ctype, cname, function, flags, quals)
&& (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function)))
constp = 0;
- if (DECL_CONSTRUCTOR_P (function))
- {
- if (TYPE_USES_VIRTUAL_BASECLASSES (ctype))
- {
- DECL_CONSTRUCTOR_FOR_VBASE_P (function) = 1;
- /* In this case we need "in-charge" flag saying whether
- this constructor is responsible for initialization
- of virtual baseclasses or not. */
- parm = build_decl (PARM_DECL, in_charge_identifier, integer_type_node);
- /* Mark the artificial `__in_chrg' parameter as "artificial". */
- SET_DECL_ARTIFICIAL (parm);
- DECL_ARG_TYPE (parm) = integer_type_node;
- TREE_READONLY (parm) = 1;
- TREE_CHAIN (parm) = last_function_parms;
- last_function_parms = parm;
- }
- }
-
parm = build_decl (PARM_DECL, this_identifier, type);
/* Mark the artificial `this' parameter as "artificial". */
SET_DECL_ARTIFICIAL (parm);
@@ -1037,81 +1013,24 @@ grokclassfn (ctype, cname, function, flags, quals)
last_function_parms = parm;
}
- if (flags == DTOR_FLAG)
+ DECL_ARGUMENTS (function) = last_function_parms;
+ /* First approximations. */
+ DECL_CONTEXT (function) = ctype;
+ DECL_CLASS_CONTEXT (function) = ctype;
+
+ if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function))
{
- char *buf, *dbuf;
- int len = sizeof (DESTRUCTOR_DECL_PREFIX)-1;
-
- arg_types = hash_tree_chain (integer_type_node, void_list_node);
- TREE_SIDE_EFFECTS (arg_types) = 1;
- /* Build the overload name. It will look like `7Example'. */
- if (IDENTIFIER_TYPE_VALUE (cname))
- dbuf = build_overload_name (IDENTIFIER_TYPE_VALUE (cname), 1, 1);
- else if (IDENTIFIER_LOCAL_VALUE (cname))
- dbuf = build_overload_name (TREE_TYPE (IDENTIFIER_LOCAL_VALUE (cname)),
- 1, 1);
- else
- /* Using ctype fixes the `X::Y::~Y()' crash. The cname has no type when
- it's defined out of the class definition, since poplevel_class wipes
- it out. This used to be internal error 346. */
- dbuf = build_overload_name (ctype, 1, 1);
- buf = (char *) alloca (strlen (dbuf) + sizeof (DESTRUCTOR_DECL_PREFIX));
- bcopy (DESTRUCTOR_DECL_PREFIX, buf, len);
- buf[len] = '\0';
- strcat (buf, dbuf);
- DECL_ASSEMBLER_NAME (function) = get_identifier (buf);
- parm = build_decl (PARM_DECL, in_charge_identifier, integer_type_node);
- /* Mark the artificial `__in_chrg' parameter as "artificial". */
- SET_DECL_ARTIFICIAL (parm);
- TREE_READONLY (parm) = 1;
- DECL_ARG_TYPE (parm) = integer_type_node;
- /* This is the same chain as DECL_ARGUMENTS (...). */
- TREE_CHAIN (last_function_parms) = parm;
+ maybe_retrofit_in_chrg (function);
+ arg_types = TYPE_ARG_TYPES (TREE_TYPE (function));
+ }
- fntype = build_cplus_method_type (qualtype, void_type_node,
- arg_types);
- if (raises)
- {
- fntype = build_exception_variant (fntype, raises);
- }
- TREE_TYPE (function) = fntype;
+ if (flags == DTOR_FLAG)
+ {
+ DECL_ASSEMBLER_NAME (function) = build_destructor_name (ctype);
TYPE_HAS_DESTRUCTOR (ctype) = 1;
}
else
- {
- tree these_arg_types;
-
- if (DECL_CONSTRUCTOR_FOR_VBASE_P (function))
- {
- arg_types = hash_tree_chain (integer_type_node,
- TREE_CHAIN (arg_types));
- fntype = build_cplus_method_type (qualtype,
- TREE_TYPE (TREE_TYPE (function)),
- arg_types);
- if (raises)
- {
- fntype = build_exception_variant (fntype, raises);
- }
- TREE_TYPE (function) = fntype;
- arg_types = TYPE_ARG_TYPES (TREE_TYPE (function));
- }
-
- these_arg_types = arg_types;
-
- if (TREE_CODE (TREE_TYPE (function)) == FUNCTION_TYPE)
- /* Only true for static member functions. */
- these_arg_types = hash_tree_chain (build_pointer_type (qualtype),
- arg_types);
-
- DECL_ASSEMBLER_NAME (function)
- = build_decl_overload (fn_name, these_arg_types,
- 1 + DECL_CONSTRUCTOR_P (function));
- }
-
- DECL_ARGUMENTS (function) = last_function_parms;
- /* First approximations. */
- DECL_CONTEXT (function) = ctype;
- DECL_CLASS_CONTEXT (function) = ctype;
+ set_mangled_name_for_decl (function);
}
/* Work on the expr used by alignof (this is only called by the parser). */
@@ -1193,7 +1112,9 @@ grok_array_decl (array_expr, index_exp)
return build_opfncall (ARRAY_REF, LOOKUP_NORMAL,
array_expr, index_exp, NULL_TREE);
- /* Otherwise, create an ARRAY_REF for a pointer or array type. */
+ /* Otherwise, create an ARRAY_REF for a pointer or array type. It
+ is a little-known fact that, if `a' is an array and `i' is an
+ int, you can write `i[a]', which means the same thing as `a[i]'. */
if (TREE_CODE (type) == ARRAY_TYPE)
p1 = array_expr;
@@ -1241,9 +1162,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
tree exp, size;
int doing_vec, use_global_delete;
{
- tree t;
- tree type;
- enum tree_code code;
+ tree t, type;
/* For a regular vector delete (aka, no size argument) we will pass
this down as a NULL_TREE into build_vec_delete. */
tree maxindex = NULL_TREE;
@@ -1259,65 +1178,45 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
return t;
}
- t = exp;
- if (TREE_CODE (t) == OFFSET_REF)
- t = resolve_offset_ref (t);
- t = stabilize_reference (convert_from_reference (t));
- type = TREE_TYPE (t);
- code = TREE_CODE (type);
+ if (TREE_CODE (exp) == OFFSET_REF)
+ exp = resolve_offset_ref (exp);
+ exp = convert_from_reference (exp);
+ t = stabilize_reference (exp);
+ t = build_expr_type_conversion (WANT_POINTER, t, 1);
- switch (doing_vec)
+ if (t == NULL_TREE || t == error_mark_node)
{
- case 2:
- maxindex = build_binary_op (MINUS_EXPR, size, integer_one_node, 1);
- pedwarn ("anachronistic use of array size in vector delete");
- /* Fall through. */
- case 1:
- break;
- default:
- if (code != POINTER_TYPE)
- {
- cp_error ("type `%#T' argument given to `delete', expected pointer",
- type);
- return error_mark_node;
- }
-
- /* Deleting a pointer with the value zero is valid and has no effect. */
- if (integer_zerop (t))
- return build1 (NOP_EXPR, void_type_node, t);
+ cp_error ("type `%#T' argument given to `delete', expected pointer",
+ TREE_TYPE (exp));
+ return error_mark_node;
}
- if (code == POINTER_TYPE)
+ if (doing_vec == 2)
{
-#if 0
- /* As of Valley Forge, you can delete a pointer to const. */
- if (TREE_READONLY (TREE_TYPE (type)))
- {
- error ("`const *' cannot be deleted");
- return error_mark_node;
- }
-#endif
- /* You can't delete functions. */
- if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
- {
- error ("cannot delete a function");
- return error_mark_node;
- }
+ maxindex = build_binary_op (MINUS_EXPR, size, integer_one_node, 1);
+ pedwarn ("anachronistic use of array size in vector delete");
}
-#if 0
- /* If the type has no destructor, then we should build a regular
- delete, instead of a vector delete. Otherwise, we would end
- up passing a bogus offset into __builtin_delete, which is
- not expecting it. */
- if (doing_vec
- && TREE_CODE (type) == POINTER_TYPE
- && !TYPE_HAS_DESTRUCTOR (TREE_TYPE (type)))
+ type = TREE_TYPE (t);
+
+ /* As of Valley Forge, you can delete a pointer to const. */
+
+ /* You can't delete functions. */
+ if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
{
- doing_vec = 0;
- use_global_delete = 1;
+ error ("cannot delete a function");
+ return error_mark_node;
}
-#endif
+
+ /* An array can't have been allocated by new, so complain. */
+ if (TREE_CODE (t) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (t, 0)) == VAR_DECL
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == ARRAY_TYPE)
+ cp_warning ("deleting array `%#D'", TREE_OPERAND (t, 0));
+
+ /* Deleting a pointer with the value zero is valid and has no effect. */
+ if (integer_zerop (t))
+ return build1 (NOP_EXPR, void_type_node, t);
if (doing_vec)
return build_vec_delete (t, maxindex, integer_one_node,
@@ -1329,8 +1228,8 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
{
/* Only do access checking here; we'll be calling op delete
from the destructor. */
- tree tmp = build_op_delete_call (DELETE_EXPR, t,
- size_zero_node, LOOKUP_NORMAL);
+ tree tmp = build_op_delete_call (DELETE_EXPR, t, size_zero_node,
+ LOOKUP_NORMAL, NULL_TREE);
if (tmp == error_mark_node)
return error_mark_node;
}
@@ -1382,6 +1281,70 @@ check_member_template (tmpl)
cp_error ("template declaration of `%#D'", decl);
}
+/* Return true iff TYPE is a valid Java parameter or return type. */
+
+int
+acceptable_java_type (type)
+ tree type;
+{
+ if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type))
+ return 1;
+ if (TREE_CODE (type) == POINTER_TYPE)
+ {
+ type = TREE_TYPE (type);
+ if (TREE_CODE (type) == RECORD_TYPE)
+ {
+ tree args; int i;
+ if (! TYPE_FOR_JAVA (type))
+ return 0;
+ if (! CLASSTYPE_TEMPLATE_INFO (type))
+ return 1;
+ args = CLASSTYPE_TI_ARGS (type);
+ i = TREE_VEC_LENGTH (args);
+ while (--i >= 0)
+ {
+ type = TREE_VEC_ELT (args, i);
+ if (TREE_CODE (type) == POINTER_TYPE)
+ type = TREE_TYPE (type);
+ if (! TYPE_FOR_JAVA (type))
+ return 0;
+ }
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* For a METHOD in a Java class CTYPE, return 1 if
+ the parameter and return types are valid Java types.
+ Otherwise, print appropriate error messages, and return 0. */
+
+int
+check_java_method (method)
+ tree method;
+{
+ int jerr = 0;
+ tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
+ tree ret_type = TREE_TYPE (TREE_TYPE (method));
+ if (! acceptable_java_type (ret_type))
+ {
+ cp_error ("Java method '%D' has non-Java return type `%T'",
+ method, ret_type);
+ jerr++;
+ }
+ for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
+ {
+ tree type = TREE_VALUE (arg_types);
+ if (! acceptable_java_type (type))
+ {
+ cp_error ("Java method '%D' has non-Java parameter type `%T'",
+ method, type);
+ jerr++;
+ }
+ }
+ return jerr ? 0 : 1;
+}
+
/* Sanity check: report error if this function FUNCTION is not
really a member of the class (CTYPE) it is supposed to belong to.
CNAME is the same here as it is for grokclassfn above. */
@@ -1391,7 +1354,7 @@ check_classfn (ctype, function)
tree ctype, function;
{
tree fn_name = DECL_NAME (function);
- tree fndecl;
+ tree fndecl, fndecls;
tree method_vec = CLASSTYPE_METHOD_VEC (complete_type (ctype));
tree *methods = 0;
tree *end = 0;
@@ -1403,27 +1366,31 @@ check_classfn (ctype, function)
end = TREE_VEC_END (method_vec);
/* First suss out ctors and dtors. */
- if (*methods && fn_name == DECL_NAME (*methods)
+ if (*methods && fn_name == DECL_NAME (OVL_CURRENT (*methods))
&& DECL_CONSTRUCTOR_P (function))
goto got_it;
- if (*++methods && fn_name == DECL_NAME (*methods)
+ if (*++methods && fn_name == DECL_NAME (OVL_CURRENT (*methods))
&& DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (function)))
goto got_it;
- while (++methods != end)
+ while (++methods != end && *methods)
{
fndecl = *methods;
- if (fn_name == DECL_NAME (*methods))
+ if (fn_name == DECL_NAME (OVL_CURRENT (*methods)))
{
got_it:
- for (fndecl = *methods; fndecl != NULL_TREE;
- fndecl = DECL_CHAIN (fndecl))
+ for (fndecls = *methods; fndecls != NULL_TREE;
+ fndecls = OVL_NEXT (fndecls))
{
+ fndecl = OVL_CURRENT (fndecls);
/* The DECL_ASSEMBLER_NAME for a TEMPLATE_DECL is
not mangled, so the check below does not work
- correctly in that case. */
+ correctly in that case. Since mangled destructor names
+ do not include the type of the arguments, we
+ can't use this short-cut for them, either. */
if (TREE_CODE (function) != TEMPLATE_DECL
&& TREE_CODE (fndecl) != TEMPLATE_DECL
+ && !DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (function))
&& (DECL_ASSEMBLER_NAME (function)
== DECL_ASSEMBLER_NAME (fndecl)))
return fndecl;
@@ -1477,22 +1444,20 @@ check_classfn (ctype, function)
if (templates)
/* This function might be an instantiation or a specialization.
- We should verify that this is possible. If it is, we must
- somehow add the new declaration to the method vector for the
- class. Perhaps we should use add_method? For now, we simply
- return NULL_TREE, which lets the caller know that this
- function is new, but we don't print an error message. */
+ We should verify that this is possible. For now, we simply
+ return NULL_TREE, which lets the caller know that this function
+ is new, but we don't print an error message. */
return NULL_TREE;
- if (methods != end)
+ if (methods != end && *methods)
{
tree fndecl = *methods;
cp_error ("prototype for `%#D' does not match any in class `%T'",
function, ctype);
- cp_error_at ("candidate%s: %+#D", DECL_CHAIN (fndecl) ? "s are" : " is",
- fndecl);
- while (fndecl = DECL_CHAIN (fndecl), fndecl)
- cp_error_at (" %#D", fndecl);
+ cp_error_at ("candidate%s: %+#D", OVL_NEXT (fndecl) ? "s are" : " is",
+ OVL_CURRENT (fndecl));
+ while (fndecl = OVL_NEXT (fndecl), fndecl)
+ cp_error_at (" %#D", OVL_CURRENT(fndecl));
}
else
{
@@ -1567,8 +1532,9 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
init = NULL_TREE;
value = grokdeclarator (declarator, declspecs, FIELD, init != 0, NULL_TREE);
- if (! value)
- return value; /* friend or constructor went bad. */
+ if (! value || value == error_mark_node)
+ /* friend or constructor went bad. */
+ return value;
/* Pass friendly classes back. */
if (TREE_CODE (value) == VOID_TYPE)
@@ -1586,13 +1552,13 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
DECL_NONLOCAL (value) = 1;
DECL_CONTEXT (value) = current_class_type;
DECL_CLASS_CONTEXT (value) = current_class_type;
- CLASSTYPE_LOCAL_TYPEDECLS (current_class_type) = 1;
/* Now that we've updated the context, we need to remangle the
name for this TYPE_DECL. */
DECL_ASSEMBLER_NAME (value) = DECL_NAME (value);
- DECL_ASSEMBLER_NAME (value) =
- get_identifier (build_overload_name (TREE_TYPE (value), 1, 1));
+ if (!uses_template_parms (value))
+ DECL_ASSEMBLER_NAME (value) =
+ get_identifier (build_overload_name (TREE_TYPE (value), 1, 1));
pushdecl_class_level (value);
return value;
@@ -1680,6 +1646,19 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
&& (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == FUNCTION_DECL))
value = push_template_decl (value);
+ /* Check to see if a field redeclares a template parameter. */
+ if (current_template_parms
+ && TREE_CODE (declarator) == IDENTIFIER_NODE
+ && IDENTIFIER_LOCAL_VALUE (declarator))
+ {
+ tree olddecl = IDENTIFIER_LOCAL_VALUE (declarator);
+ if (decl_template_parm_p (olddecl))
+ {
+ cp_error ("redeclaration of template parameter `%T'", declarator);
+ cp_error_at (" previously declared here `%#D'", olddecl);
+ }
+ }
+
if (attrlist)
cplus_decl_attributes (value, TREE_PURPOSE (attrlist),
TREE_VALUE (attrlist));
@@ -1744,15 +1723,6 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
}
if (TREE_CODE (value) == FUNCTION_DECL)
{
- check_default_args (value);
- if (DECL_CHAIN (value) != NULL_TREE)
- {
- /* Need a fresh node here so that we don't get circularity
- when we link these together. */
- value = copy_node (value);
- /* When does this happen? */
- my_friendly_assert (init == NULL_TREE, 193);
- }
if (asmspec)
{
/* This must override the asm specifier which was placed
@@ -1802,6 +1772,17 @@ grokbitfield (declarator, declspecs, width)
return NULL_TREE;
}
+ /* Usually, finish_struct_1 catches bitifields with invalid types.
+ But, in the case of bitfields with function type, we confuse
+ ourselves into thinking they are member functions, so we must
+ check here. */
+ if (TREE_CODE (value) == FUNCTION_DECL)
+ {
+ cp_error ("cannot declare bitfield `%D' with funcion type",
+ DECL_NAME (value));
+ return NULL_TREE;
+ }
+
if (IS_SIGNATURE (current_class_type))
{
error ("field declaration not allowed in signature");
@@ -1881,7 +1862,7 @@ grokoptypename (declspecs, declarator)
int
copy_assignment_arg_p (parmtype, virtualp)
tree parmtype;
- int virtualp;
+ int virtualp ATTRIBUTE_UNUSED;
{
if (current_class_type == NULL_TREE)
return 0;
@@ -1978,7 +1959,7 @@ constructor_name_full (thing)
else if (IS_AGGR_TYPE_CODE (TREE_CODE (thing)))
{
if (TYPE_WAS_ANONYMOUS (thing) && TYPE_HAS_CONSTRUCTOR (thing))
- thing = DECL_NAME (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (thing), 0));
+ thing = DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (thing), 0)));
else
thing = TYPE_NAME (thing);
}
@@ -2140,6 +2121,82 @@ get_temp_regvar (type, init)
return decl;
}
+/* Hunts through the global anonymous union ANON_DECL, building
+ appropriate VAR_DECLs. Stores cleanups on the list of ELEMS, and
+ returns a VAR_DECL whose size is the same as the size of the
+ ANON_DECL, if one is available. */
+
+tree
+build_anon_union_vars (anon_decl, elems, static_p, external_p)
+ tree anon_decl;
+ tree* elems;
+ int static_p;
+ int external_p;
+{
+ tree type = TREE_TYPE (anon_decl);
+ tree main_decl = NULL_TREE;
+ tree field;
+
+ for (field = TYPE_FIELDS (type);
+ field != NULL_TREE;
+ field = TREE_CHAIN (field))
+ {
+ tree decl;
+ if (TREE_CODE (field) != FIELD_DECL)
+ continue;
+
+ if (TREE_PRIVATE (field))
+ cp_pedwarn_at ("private member `%#D' in anonymous union", field);
+ else if (TREE_PROTECTED (field))
+ cp_pedwarn_at ("protected member `%#D' in anonymous union", field);
+
+ if (DECL_NAME (field) == NULL_TREE
+ && TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
+ {
+ decl = build_anon_union_vars (field, elems, static_p, external_p);
+ if (!decl)
+ continue;
+ }
+ else if (DECL_NAME (field) == NULL_TREE)
+ continue;
+ else
+ {
+ decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
+ /* tell `pushdecl' that this is not tentative. */
+ DECL_INITIAL (decl) = error_mark_node;
+ TREE_PUBLIC (decl) = 0;
+ TREE_STATIC (decl) = static_p;
+ DECL_EXTERNAL (decl) = external_p;
+ decl = pushdecl (decl);
+ DECL_INITIAL (decl) = NULL_TREE;
+ }
+
+ /* Only write out one anon union element--choose the one that
+ can hold them all. */
+ if (main_decl == NULL_TREE
+ && simple_cst_equal (DECL_SIZE (decl),
+ DECL_SIZE (anon_decl)) == 1)
+ main_decl = decl;
+ else
+ /* ??? This causes there to be no debug info written out
+ about this decl. */
+ TREE_ASM_WRITTEN (decl) = 1;
+
+ if (DECL_NAME (field) == NULL_TREE
+ && TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
+ /* The remainder of the processing was already done in the
+ recursive call. */
+ continue;
+
+ /* If there's a cleanup to do, it belongs in the
+ TREE_PURPOSE of the following TREE_LIST. */
+ *elems = scratch_tree_cons (NULL_TREE, decl, *elems);
+ TREE_TYPE (*elems) = type;
+ }
+
+ return main_decl;
+}
+
/* Finish off the processing of a UNION_TYPE structure.
If there are static members, then all members are
static, and must be laid out together. If the
@@ -2152,13 +2209,13 @@ finish_anon_union (anon_union_decl)
tree anon_union_decl;
{
tree type = TREE_TYPE (anon_union_decl);
- tree field, main_decl = NULL_TREE;
tree elems = NULL_TREE;
+ tree main_decl;
int public_p = TREE_PUBLIC (anon_union_decl);
int static_p = TREE_STATIC (anon_union_decl);
int external_p = DECL_EXTERNAL (anon_union_decl);
- if ((field = TYPE_FIELDS (type)) == NULL_TREE)
+ if (TYPE_FIELDS (type) == NULL_TREE)
return;
if (public_p)
@@ -2167,58 +2224,19 @@ finish_anon_union (anon_union_decl)
return;
}
- for (; field; field = TREE_CHAIN (field))
- {
- tree decl;
- if (TREE_CODE (field) != FIELD_DECL)
- continue;
-
- if (TREE_PRIVATE (field))
- cp_pedwarn_at ("private member `%#D' in anonymous union", field);
- else if (TREE_PROTECTED (field))
- cp_pedwarn_at ("protected member `%#D' in anonymous union", field);
-
- decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
- /* tell `pushdecl' that this is not tentative. */
- DECL_INITIAL (decl) = error_mark_node;
- TREE_PUBLIC (decl) = public_p;
- TREE_STATIC (decl) = static_p;
- DECL_EXTERNAL (decl) = external_p;
- decl = pushdecl (decl);
-
- /* Only write out one anon union element--choose the one that
- can hold them all. */
- if (main_decl == NULL_TREE
- && 1 == simple_cst_equal (DECL_SIZE (decl),
- DECL_SIZE (anon_union_decl)))
- {
- main_decl = decl;
- }
- else
- {
- /* ??? This causes there to be no debug info written out
- about this decl. */
- TREE_ASM_WRITTEN (decl) = 1;
- }
+ main_decl = build_anon_union_vars (anon_union_decl, &elems,
+ static_p, external_p);
- DECL_INITIAL (decl) = NULL_TREE;
- /* If there's a cleanup to do, it belongs in the
- TREE_PURPOSE of the following TREE_LIST. */
- elems = scratch_tree_cons (NULL_TREE, decl, elems);
- TREE_TYPE (elems) = type;
+ if (main_decl == NULL_TREE)
+ {
+ warning ("anonymous union with no members");
+ return;
}
+
if (static_p)
{
- if (main_decl)
- {
- make_decl_rtl (main_decl, 0, toplevel_bindings_p ());
- DECL_RTL (anon_union_decl) = DECL_RTL (main_decl);
- }
- else
- {
- warning ("anonymous union with no members");
- return;
- }
+ make_decl_rtl (main_decl, 0, toplevel_bindings_p ());
+ DECL_RTL (anon_union_decl) = DECL_RTL (main_decl);
}
/* The following call assumes that there are never any cleanups
@@ -2413,6 +2431,30 @@ comdat_linkage (decl)
DECL_COMDAT (decl) = 1;
}
+/* For win32 we also want to put explicit instantiations in
+ linkonce sections, so that they will be merged with implicit
+ instantiations; otherwise we get duplicate symbol errors. */
+
+void
+maybe_make_one_only (decl)
+ tree decl;
+{
+ /* This is not necessary on targets that support weak symbols, because
+ the implicit instantiations will defer to the explicit one. */
+ if (! supports_one_only () || SUPPORTS_WEAK)
+ return;
+
+ /* We can't set DECL_COMDAT on functions, or finish_file will think
+ we can get away with not emitting them if they aren't used.
+ We can't use make_decl_one_only for variables, because their
+ DECL_INITIAL may not have been set properly yet. */
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ make_decl_one_only (decl);
+ else
+ comdat_linkage (decl);
+}
+
/* Set TREE_PUBLIC and/or DECL_EXTERN on the vtable DECL,
based on TYPE and other static flags.
@@ -2427,12 +2469,10 @@ import_export_vtable (decl, type, final)
if (DECL_INTERFACE_KNOWN (decl))
return;
- /* +e0 or +e1 */
- if (write_virtuals < 2 && write_virtuals != 0)
+ if (TYPE_FOR_JAVA (type))
{
TREE_PUBLIC (decl) = 1;
- if (write_virtuals < 0)
- DECL_EXTERNAL (decl) = 1;
+ DECL_EXTERNAL (decl) = 1;
DECL_INTERFACE_KNOWN (decl) = 1;
}
else if (CLASSTYPE_INTERFACE_KNOWN (type))
@@ -2441,11 +2481,9 @@ import_export_vtable (decl, type, final)
DECL_EXTERNAL (decl) = ! CLASSTYPE_VTABLE_NEEDS_WRITING (type);
DECL_INTERFACE_KNOWN (decl) = 1;
- /* For WIN32 we also want to put explicit instantiations in
- linkonce sections. */
- if (CLASSTYPE_EXPLICIT_INSTANTIATION (type)
- && supports_one_only () && ! SUPPORTS_WEAK)
- make_decl_one_only (decl);
+ /* Always make vtables weak. */
+ if (flag_weak)
+ comdat_linkage (decl);
}
else
{
@@ -2483,29 +2521,39 @@ import_export_vtable (decl, type, final)
}
}
-static void
-import_export_template (type)
- tree type;
-{
- if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)
- && ! flag_implicit_templates
- && CLASSTYPE_INTERFACE_UNKNOWN (type))
- {
- SET_CLASSTYPE_INTERFACE_KNOWN (type);
- CLASSTYPE_INTERFACE_ONLY (type) = 1;
- CLASSTYPE_VTABLE_NEEDS_WRITING (type) = 0;
- }
-}
-
-int
-finish_prevtable_vardecl (prev, vars)
- tree prev, vars;
+/* Determine whether or not we want to specifically import or export CTYPE,
+ using various heuristics. */
+
+void
+import_export_class (ctype)
+ tree ctype;
{
- tree ctype = DECL_CONTEXT (vars);
- import_export_template (ctype);
+ /* -1 for imported, 1 for exported. */
+ int import_export = 0;
+
+ if (CLASSTYPE_INTERFACE_KNOWN (ctype))
+ return;
+
+#ifdef VALID_MACHINE_TYPE_ATTRIBUTE
+ /* FIXME this should really use some sort of target-independent macro. */
+ if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)))
+ import_export = -1;
+ else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)))
+ import_export = 1;
+#endif
+
+ /* If we got -fno-implicit-templates, we import template classes that
+ weren't explicitly instantiated. */
+ if (import_export == 0
+ && CLASSTYPE_IMPLICIT_INSTANTIATION (ctype)
+ && ! flag_implicit_templates)
+ import_export = -1;
#ifndef MULTIPLE_SYMBOL_SPACES
- if (CLASSTYPE_INTERFACE_UNKNOWN (ctype) && TYPE_VIRTUAL_P (ctype)
+ /* Base our import/export status on that of the first non-inline,
+ non-abstract virtual function, if any. */
+ if (import_export == 0
+ && TYPE_VIRTUAL_P (ctype)
&& ! CLASSTYPE_TEMPLATE_INSTANTIATION (ctype))
{
tree method;
@@ -2516,28 +2564,64 @@ finish_prevtable_vardecl (prev, vars)
&& !DECL_THIS_INLINE (method)
&& !DECL_ABSTRACT_VIRTUAL_P (method))
{
- SET_CLASSTYPE_INTERFACE_KNOWN (ctype);
- CLASSTYPE_VTABLE_NEEDS_WRITING (ctype)
- = ! DECL_REALLY_EXTERN (method);
- CLASSTYPE_INTERFACE_ONLY (ctype) = DECL_REALLY_EXTERN (method);
+ import_export = (DECL_REALLY_EXTERN (method) ? -1 : 1);
break;
}
}
}
#endif
+ if (import_export)
+ {
+ SET_CLASSTYPE_INTERFACE_KNOWN (ctype);
+ CLASSTYPE_VTABLE_NEEDS_WRITING (ctype) = (import_export > 0);
+ CLASSTYPE_INTERFACE_ONLY (ctype) = (import_export < 0);
+ }
+}
+
+int
+finish_prevtable_vardecl (prev, vars)
+ tree prev ATTRIBUTE_UNUSED, vars;
+{
+ tree ctype = DECL_CONTEXT (vars);
+ import_export_class (ctype);
import_export_vtable (vars, ctype, 1);
return 1;
}
-
+
+/* We need to describe to the assembler the relationship between
+ a vtable and the vtable of the parent class. */
+
+static void
+output_vtable_inherit (vars)
+ tree vars;
+{
+ tree parent;
+ rtx op[2];
+
+ op[0] = XEXP (DECL_RTL (vars), 0); /* strip the mem ref */
+
+ parent = binfo_for_vtable (vars);
+
+ if (parent == TYPE_BINFO (DECL_CONTEXT (vars)))
+ op[1] = const0_rtx;
+ else if (parent)
+ {
+ parent = TYPE_BINFO_VTABLE (BINFO_TYPE (parent));
+ op[1] = XEXP (DECL_RTL (parent), 0); /* strip the mem ref */
+ }
+ else
+ my_friendly_abort (980826);
+
+ output_asm_insn (".vtable_inherit %c0, %c1", op);
+}
+
static int
finish_vtable_vardecl (prev, vars)
tree prev, vars;
{
- if (write_virtuals >= 0
- && ! DECL_EXTERNAL (vars)
- && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars))
- || CLASSTYPE_EXPLICIT_INSTANTIATION (DECL_CONTEXT (vars))
+ if (! DECL_EXTERNAL (vars)
+ && (DECL_INTERFACE_KNOWN (vars)
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))
|| (hack_decl_function_context (vars) && TREE_USED (vars)))
&& ! TREE_ASM_WRITTEN (vars))
@@ -2574,6 +2658,10 @@ finish_vtable_vardecl (prev, vars)
}
rest_of_decl_compilation (vars, NULL_PTR, 1, 1);
+
+ if (flag_vtable_gc)
+ output_vtable_inherit (vars);
+
return 1;
}
else if (! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars)))
@@ -2680,11 +2768,14 @@ import_export_decl (decl)
if (DECL_INTERFACE_KNOWN (decl))
return;
- if (DECL_TEMPLATE_INSTANTIATION (decl))
+ if (DECL_TEMPLATE_INSTANTIATION (decl)
+ || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
{
DECL_NOT_REALLY_EXTERN (decl) = 1;
- if (DECL_IMPLICIT_INSTANTIATION (decl)
- && (flag_implicit_templates || DECL_THIS_INLINE (decl)))
+ if ((DECL_IMPLICIT_INSTANTIATION (decl)
+ || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
+ && (flag_implicit_templates
+ || (flag_implicit_inline_templates && DECL_THIS_INLINE (decl))))
{
if (!TREE_PUBLIC (decl))
/* Templates are allowed to have internal linkage. See
@@ -2707,6 +2798,10 @@ import_export_decl (decl)
DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines));
+
+ /* Always make artificials weak. */
+ if (DECL_ARTIFICIAL (decl) && flag_weak)
+ comdat_linkage (decl);
}
else
comdat_linkage (decl);
@@ -2716,24 +2811,21 @@ import_export_decl (decl)
{
tree ctype = TREE_TYPE (DECL_NAME (decl));
if (IS_AGGR_TYPE (ctype) && CLASSTYPE_INTERFACE_KNOWN (ctype)
- && TYPE_VIRTUAL_P (ctype))
- {
+ && TYPE_VIRTUAL_P (ctype)
/* If the type is a cv-qualified variant of a type, then we
must emit the tinfo function in this translation unit
since it will not be emitted when the vtable for the type
is output (which is when the unqualified version is
generated). */
+ && ctype == TYPE_MAIN_VARIANT (ctype))
+ {
DECL_NOT_REALLY_EXTERN (decl)
- = TYPE_READONLY (ctype)
- || TYPE_VOLATILE (ctype)
- || ! (CLASSTYPE_INTERFACE_ONLY (ctype)
- || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines));
+ = ! (CLASSTYPE_INTERFACE_ONLY (ctype)
+ || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines));
- /* For WIN32 we also want to put explicit instantiations in
- linkonce sections. */
- if (CLASSTYPE_EXPLICIT_INSTANTIATION (ctype)
- && supports_one_only () && ! SUPPORTS_WEAK)
- make_decl_one_only (decl);
+ /* Always make artificials weak. */
+ if (flag_weak)
+ comdat_linkage (decl);
}
else if (TYPE_BUILT_IN (ctype) && ctype == TYPE_MAIN_VARIANT (ctype))
DECL_NOT_REALLY_EXTERN (decl) = 0;
@@ -2770,20 +2862,19 @@ extern int parse_time, varconst_time;
extern tree pending_templates;
extern tree maybe_templates;
-extern struct obstack permanent_obstack;
-
static tree
get_sentry (base)
tree base;
{
tree sname = get_id_2 ("__sn", base);
- /* for struct X foo __attribute__((weak)), there is a counter
+ /* For struct X foo __attribute__((weak)), there is a counter
__snfoo. Since base is already an assembler name, sname should
be globally unique */
tree sentry = IDENTIFIER_GLOBAL_VALUE (sname);
if (! sentry)
{
- push_obstacks (&permanent_obstack, &permanent_obstack);
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
sentry = build_decl (VAR_DECL, sname, integer_type_node);
TREE_PUBLIC (sentry) = 1;
DECL_ARTIFICIAL (sentry) = 1;
@@ -2797,6 +2888,368 @@ get_sentry (base)
return sentry;
}
+/* A list of objects which have constructors or destructors
+ which reside in the global scope. The decl is stored in
+ the TREE_VALUE slot and the initializer is stored
+ in the TREE_PURPOSE slot. */
+extern tree static_aggregates_initp;
+
+/* Set up the static_aggregates* lists for processing. Subroutine of
+ finish_file. Note that this function changes the format of
+ static_aggregates_initp, from (priority . decl) to
+ (priority . ((initializer . decl) ...)). */
+
+static void
+setup_initp ()
+{
+ tree t, *p, next_t;
+
+ if (! flag_init_priority)
+ {
+ for (t = static_aggregates_initp; t; t = TREE_CHAIN (t))
+ cp_warning ("init_priority for `%#D' ignored without -finit-priority",
+ TREE_VALUE (t));
+ return;
+ }
+
+ /* First, remove any entries from static_aggregates that are also in
+ static_aggregates_initp, and update the entries in _initp to
+ include the initializer. */
+ p = &static_aggregates;
+ for (; *p; )
+ {
+ t = value_member (TREE_VALUE (*p), static_aggregates_initp);
+
+ if (t)
+ {
+ TREE_VALUE (t) = *p;
+ *p = TREE_CHAIN (*p);
+ TREE_CHAIN (TREE_VALUE (t)) = NULL_TREE;
+ }
+ else
+ p = &TREE_CHAIN (*p);
+ }
+
+ /* Then, group static_aggregates_initp. After this step, there will only
+ be one entry for each priority, with a chain coming off it. */
+ t = static_aggregates_initp;
+ static_aggregates_initp = NULL_TREE;
+
+ for (; t; t = next_t)
+ {
+ next_t = TREE_CHAIN (t);
+
+ for (p = &static_aggregates_initp; ; p = &TREE_CHAIN (*p))
+ {
+ if (*p == NULL_TREE
+ || tree_int_cst_lt (TREE_PURPOSE (*p), TREE_PURPOSE (t)))
+ {
+ TREE_CHAIN (t) = *p;
+ *p = t;
+ break;
+ }
+ else if (tree_int_cst_equal (TREE_PURPOSE (*p), TREE_PURPOSE (t)))
+ {
+ TREE_CHAIN (TREE_VALUE (t)) = TREE_VALUE (*p);
+ TREE_VALUE (*p) = TREE_VALUE (t);
+ break;
+ }
+ }
+ }
+
+ /* Reverse each list to preserve the order (currently reverse declaration
+ order, for destructors). */
+ for (t = static_aggregates_initp; t; t = TREE_CHAIN (t))
+ TREE_VALUE (t) = nreverse (TREE_VALUE (t));
+}
+
+/* Start the process of running a particular set of global constructors
+ or destructors. Subroutine of do_[cd]tors. */
+
+static void
+start_objects (method_type, initp)
+ int method_type, initp;
+{
+ tree fnname;
+ char type[10];
+
+ /* Make ctor or dtor function. METHOD_TYPE may be 'I' or 'D'. */
+
+ if (flag_init_priority)
+ {
+ if (initp == 0)
+ initp = DEFAULT_INIT_PRIORITY;
+
+ sprintf (type, "%c%c%.5u", method_type, JOINER, initp);
+ }
+ else
+ sprintf (type, "%c", method_type);
+
+ fnname = get_file_function_name_long (type);
+
+ start_function (void_list_node,
+ make_call_declarator (fnname, void_list_node, NULL_TREE,
+ NULL_TREE),
+ NULL_TREE, 0);
+
+ store_parm_decls ();
+ pushlevel (0);
+ clear_last_expr ();
+ push_momentary ();
+ expand_start_bindings (0);
+}
+
+/* Finish the process of running a particular set of global constructors
+ or destructors. Subroutine of do_[cd]tors. */
+
+static void
+finish_objects (method_type, initp)
+ int method_type, initp;
+{
+ char *fnname;
+
+ if (! initp)
+ {
+ tree list = (method_type == 'I' ? static_ctors : static_dtors);
+
+ if (! current_function_decl && list)
+ start_objects (method_type, initp);
+
+ for (; list; list = TREE_CHAIN (list))
+ expand_expr_stmt (build_function_call (TREE_VALUE (list), NULL_TREE));
+ }
+
+ if (! current_function_decl)
+ return;
+
+ fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
+
+ /* Finish up. */
+ expand_end_bindings (getdecls (), 1, 0);
+ poplevel (1, 0, 0);
+ pop_momentary ();
+ finish_function (lineno, 0, 0);
+
+ if (! flag_init_priority)
+ {
+ if (method_type == 'I')
+ assemble_constructor (fnname);
+ else
+ assemble_destructor (fnname);
+ }
+
+#ifdef ASM_OUTPUT_SECTION_NAME
+ /* If we're using init priority we can't use assemble_*tor, but on ELF
+ targets we can stick the references into named sections for GNU ld
+ to collect. */
+ if (flag_init_priority)
+ {
+ char buf[15];
+ if (initp == 0)
+ initp = DEFAULT_INIT_PRIORITY;
+ sprintf (buf, ".%ctors.%.5u", method_type == 'I' ? 'c' : 'd',
+ /* invert the numbering so the linker puts us in the proper
+ order; constructors are run from right to left, and the
+ linker sorts in increasing order. */
+ MAX_INIT_PRIORITY - initp);
+ named_section (NULL_TREE, buf, 0);
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, fnname),
+ POINTER_SIZE / BITS_PER_UNIT, 1);
+ }
+#endif
+}
+
+/* Generate a function to run a set of global destructors. START is either
+ NULL_TREE or a node indicating a set of destructors with the same
+ init priority. Subroutine of finish_file. */
+
+static void
+do_dtors (start)
+ tree start;
+{
+ tree vars;
+ int initp;
+
+ if (start)
+ {
+ initp = TREE_INT_CST_LOW (TREE_PURPOSE (start));
+ vars = TREE_VALUE (start);
+ }
+ else
+ {
+ initp = 0;
+ vars = static_aggregates;
+ }
+
+ for (; vars; vars = TREE_CHAIN (vars))
+ {
+ tree decl = TREE_VALUE (vars);
+ tree type = TREE_TYPE (decl);
+ tree temp;
+
+ if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars)
+ && ! DECL_EXTERNAL (decl))
+ {
+ int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
+ || DECL_ONE_ONLY (decl)
+ || DECL_WEAK (decl)));
+
+ if (! current_function_decl)
+ start_objects ('D', initp);
+
+ /* Because of:
+
+ [class.access.spec]
+
+ Access control for implicit calls to the constructors,
+ the conversion functions, or the destructor called to
+ create and destroy a static data member is performed as
+ if these calls appeared in the scope of the member's
+ class.
+
+ we must convince enforce_access to let us access the
+ DECL. */
+ if (member_p (decl))
+ {
+ DECL_CLASS_CONTEXT (current_function_decl)
+ = DECL_CONTEXT (decl);
+ DECL_STATIC_FUNCTION_P (current_function_decl) = 1;
+ }
+
+ temp = build_cleanup (decl);
+
+ if (protect)
+ {
+ tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
+ sentry = build_unary_op (PREDECREMENT_EXPR, sentry, 0);
+ sentry = build_binary_op (EQ_EXPR, sentry, integer_zero_node, 1);
+ expand_start_cond (sentry, 0);
+ }
+
+ expand_expr_stmt (temp);
+
+ if (protect)
+ expand_end_cond ();
+
+ /* Now that we're done with DECL we don't need to pretend to
+ be a member of its class any longer. */
+ DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE;
+ DECL_STATIC_FUNCTION_P (current_function_decl) = 0;
+ }
+ }
+
+ finish_objects ('D', initp);
+}
+
+/* Generate a function to run a set of global constructors. START is
+ either NULL_TREE or a node indicating a set of constructors with the
+ same init priority. Subroutine of finish_file. */
+
+static void
+do_ctors (start)
+ tree start;
+{
+ tree vars;
+ int initp;
+
+ if (start)
+ {
+ initp = TREE_INT_CST_LOW (TREE_PURPOSE (start));
+ vars = TREE_VALUE (start);
+ }
+ else
+ {
+ initp = 0;
+ vars = static_aggregates;
+ }
+
+ /* Reverse the list so it's in the right order for ctors. */
+ vars = nreverse (vars);
+
+ for (; vars; vars = TREE_CHAIN (vars))
+ {
+ tree decl = TREE_VALUE (vars);
+ tree init = TREE_PURPOSE (vars);
+
+ /* If this was a static attribute within some function's scope,
+ then don't initialize it here. Also, don't bother
+ with initializers that contain errors. */
+ if (TREE_STATIC (vars)
+ || DECL_EXTERNAL (decl)
+ || (init && TREE_CODE (init) == TREE_LIST
+ && value_member (error_mark_node, init)))
+ continue;
+
+ if (TREE_CODE (decl) == VAR_DECL)
+ {
+ int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
+ || DECL_ONE_ONLY (decl)
+ || DECL_WEAK (decl)));
+
+ if (! current_function_decl)
+ start_objects ('I', initp);
+
+ /* Set these global variables so that GDB at least puts
+ us near the declaration which required the initialization. */
+ input_filename = DECL_SOURCE_FILE (decl);
+ lineno = DECL_SOURCE_LINE (decl);
+ emit_note (input_filename, lineno);
+
+ /* 9.5p5: The initializer of a static member of a class has
+ the same access rights as a member function. */
+ if (member_p (decl))
+ {
+ DECL_CLASS_CONTEXT (current_function_decl)
+ = DECL_CONTEXT (decl);
+ DECL_STATIC_FUNCTION_P (current_function_decl) = 1;
+ }
+
+ if (protect)
+ {
+ tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
+ sentry = build_unary_op (PREINCREMENT_EXPR, sentry, 0);
+ sentry = build_binary_op
+ (EQ_EXPR, sentry, integer_one_node, 1);
+ expand_start_cond (sentry, 0);
+ }
+
+ expand_start_target_temps ();
+
+ if (IS_AGGR_TYPE (TREE_TYPE (decl))
+ || TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
+ expand_aggr_init (decl, init, 0);
+ else if (TREE_CODE (init) == TREE_VEC)
+ {
+ expand_expr (expand_vec_init (decl, TREE_VEC_ELT (init, 0),
+ TREE_VEC_ELT (init, 1),
+ TREE_VEC_ELT (init, 2), 0),
+ const0_rtx, VOIDmode, EXPAND_NORMAL);
+ }
+ else
+ expand_assignment (decl, init, 0, 0);
+
+ /* The expression might have involved increments and
+ decrements. */
+ emit_queue ();
+
+ /* Cleanup any temporaries needed for the initial value. */
+ expand_end_target_temps ();
+
+ if (protect)
+ expand_end_cond ();
+
+ DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE;
+ DECL_STATIC_FUNCTION_P (current_function_decl) = 0;
+ }
+ else if (decl == error_mark_node)
+ /* OK */;
+ else
+ my_friendly_abort (22);
+ }
+
+ finish_objects ('I', initp);
+}
+
/* This routine is called from the last rule in yyparse ().
Its job is to create all the code needed to initialize and
destroy the global aggregates. We do the destruction
@@ -2818,6 +3271,8 @@ finish_file ()
if (! global_bindings_p () || current_class_type)
return;
+ check_decl_namespace ();
+
start_time = get_run_time ();
/* Otherwise, GDB can get confused, because in only knows
@@ -2829,7 +3284,12 @@ finish_file ()
for (fnname = pending_templates; fnname; fnname = TREE_CHAIN (fnname))
{
+ tree srcloc = TREE_PURPOSE (fnname);
tree decl = TREE_VALUE (fnname);
+
+ input_filename = SRCLOC_FILE (srcloc);
+ lineno = SRCLOC_LINE (srcloc);
+
if (TREE_CODE_CLASS (TREE_CODE (decl)) == 't')
{
instantiate_class_template (decl);
@@ -2855,6 +3315,8 @@ finish_file ()
instantiate_decl (fn);
}
+ cat_namespace_levels();
+
/* Push into C language context, because that's all
we'll need here. */
push_lang_context (lang_name_c);
@@ -2896,194 +3358,31 @@ finish_file ()
if (static_ctors || vars)
needs_messing_up = 1;
- if (static_dtors)
+ if (static_dtors || vars)
needs_cleaning = 1;
- /* See if we really need the hassle. */
- while (vars && needs_cleaning == 0)
- {
- tree decl = TREE_VALUE (vars);
- tree type = TREE_TYPE (decl);
- if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars))
- {
- needs_cleaning = 1;
- break;
- }
-
- vars = TREE_CHAIN (vars);
- }
-
- if (needs_cleaning == 0)
- goto mess_up;
+ setup_initp ();
- fnname = get_file_function_name ('D');
- start_function (void_list_node,
- make_call_declarator (fnname, void_list_node, NULL_TREE,
- NULL_TREE),
- NULL_TREE, 0);
- fnname = DECL_ASSEMBLER_NAME (current_function_decl);
- store_parm_decls ();
-
- pushlevel (0);
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (0);
-
- /* These must be done in backward order to destroy,
- in which they happen to be! */
- for (vars = static_aggregates; vars; vars = TREE_CHAIN (vars))
+ /* After setup_initp, the aggregates are listed in reverse declaration
+ order, for cleaning. */
+ if (needs_cleaning)
{
- tree decl = TREE_VALUE (vars);
- tree type = TREE_TYPE (decl);
- tree temp = TREE_PURPOSE (vars);
+ do_dtors (NULL_TREE);
- if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars)
- && ! DECL_EXTERNAL (decl))
- {
- int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
- || DECL_ONE_ONLY (decl)
- || DECL_WEAK (decl)));
-
- temp = build_cleanup (decl);
-
- if (protect)
- {
- tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
- sentry = build_unary_op (PREDECREMENT_EXPR, sentry, 0);
- sentry = build_binary_op (EQ_EXPR, sentry, integer_zero_node, 1);
- expand_start_cond (sentry, 0);
- }
-
- expand_expr_stmt (temp);
-
- if (protect)
- expand_end_cond ();
- }
+ if (flag_init_priority)
+ for (vars = static_aggregates_initp; vars; vars = TREE_CHAIN (vars))
+ do_dtors (vars);
}
- for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors))
- expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors),
- NULL_TREE));
-
- expand_end_bindings (getdecls (), 1, 0);
- poplevel (1, 0, 0);
- pop_momentary ();
-
- finish_function (lineno, 0, 0);
-
- assemble_destructor (IDENTIFIER_POINTER (fnname));
-
- /* if it needed cleaning, then it will need messing up: drop through */
-
- mess_up:
- /* Must do this while we think we are at the top level. */
- vars = nreverse (static_aggregates);
+ /* do_ctors will reverse the lists for messing up. */
if (needs_messing_up)
{
- fnname = get_file_function_name ('I');
- start_function (void_list_node,
- make_call_declarator (fnname, void_list_node, NULL_TREE,
- NULL_TREE),
- NULL_TREE, 0);
- fnname = DECL_ASSEMBLER_NAME (current_function_decl);
- store_parm_decls ();
-
- pushlevel (0);
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (0);
-
- while (vars)
- {
- tree decl = TREE_VALUE (vars);
- tree init = TREE_PURPOSE (vars);
-
- /* If this was a static attribute within some function's scope,
- then don't initialize it here. Also, don't bother
- with initializers that contain errors. */
- if (TREE_STATIC (vars)
- || DECL_EXTERNAL (decl)
- || (init && TREE_CODE (init) == TREE_LIST
- && value_member (error_mark_node, init)))
- goto next_mess;
-
- if (TREE_CODE (decl) == VAR_DECL)
- {
- int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
- || DECL_ONE_ONLY (decl)
- || DECL_WEAK (decl)));
-
- /* Set these global variables so that GDB at least puts
- us near the declaration which required the initialization. */
- input_filename = DECL_SOURCE_FILE (decl);
- lineno = DECL_SOURCE_LINE (decl);
- emit_note (input_filename, lineno);
-
- /* 9.5p5: The initializer of a static member of a class has
- the same access rights as a member function. */
- if (member_p (decl))
- {
- DECL_CLASS_CONTEXT (current_function_decl)
- = DECL_CONTEXT (decl);
- DECL_STATIC_FUNCTION_P (current_function_decl) = 1;
- }
-
- if (protect)
- {
- tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
- sentry = build_unary_op (PREINCREMENT_EXPR, sentry, 0);
- sentry = build_binary_op
- (EQ_EXPR, sentry, integer_one_node, 1);
- expand_start_cond (sentry, 0);
- }
-
- expand_start_target_temps ();
+ do_ctors (NULL_TREE);
- if (IS_AGGR_TYPE (TREE_TYPE (decl))
- || TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
- expand_aggr_init (decl, init, 0, 0);
- else if (TREE_CODE (init) == TREE_VEC)
- {
- expand_expr (expand_vec_init (decl, TREE_VEC_ELT (init, 0),
- TREE_VEC_ELT (init, 1),
- TREE_VEC_ELT (init, 2), 0),
- const0_rtx, VOIDmode, EXPAND_NORMAL);
- }
- else
- expand_assignment (decl, init, 0, 0);
-
- /* The expression might have involved increments and
- decrements. */
- emit_queue ();
-
- /* Cleanup any temporaries needed for the initial value. */
- expand_end_target_temps ();
-
- if (protect)
- expand_end_cond ();
-
- DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE;
- DECL_STATIC_FUNCTION_P (current_function_decl) = 0;
- }
- else if (decl == error_mark_node)
- ;
- else my_friendly_abort (22);
-
- next_mess:
- vars = TREE_CHAIN (vars);
- }
-
- for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors))
- expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors),
- NULL_TREE));
-
- expand_end_bindings (getdecls (), 1, 0);
- poplevel (1, 0, 0);
- pop_momentary ();
-
- finish_function (lineno, 0, 0);
- assemble_constructor (IDENTIFIER_POINTER (fnname));
- }
+ if (flag_init_priority)
+ for (vars = static_aggregates_initp; vars; vars = TREE_CHAIN (vars))
+ do_ctors (vars);
+ }
permanent_allocation (1);
@@ -3129,6 +3428,8 @@ finish_file ()
import_export_decl (decl);
}
+ mark_all_runtime_matches ();
+
/* Now write out inline functions which had their addresses taken and
which were not declared virtual and which were not declared `extern
inline'. */
@@ -3224,19 +3525,6 @@ finish_file ()
walk_vtables ((void (*) PROTO((tree, tree))) 0,
prune_vtable_vardecl);
- if (write_virtuals == 2)
- {
- /* Now complain about an virtual function tables promised
- but not delivered. */
- while (pending_vtables)
- {
- if (TREE_PURPOSE (pending_vtables) == NULL_TREE)
- error ("virtual function table for `%s' not defined",
- IDENTIFIER_POINTER (TREE_VALUE (pending_vtables)));
- pending_vtables = TREE_CHAIN (pending_vtables);
- }
- }
-
finish_repo ();
this_time = get_run_time ();
@@ -3338,13 +3626,13 @@ build_expr_from_tree (t)
switch (TREE_CODE (t))
{
case IDENTIFIER_NODE:
- return do_identifier (t, 0);
+ return do_identifier (t, 0, NULL_TREE);
case LOOKUP_EXPR:
if (LOOKUP_EXPR_GLOBAL (t))
return do_scoped_id (TREE_OPERAND (t, 0), 0);
else
- return do_identifier (TREE_OPERAND (t, 0), 0);
+ return do_identifier (TREE_OPERAND (t, 0), 0, NULL_TREE);
case TEMPLATE_ID_EXPR:
return (lookup_template_function
@@ -3509,12 +3797,21 @@ build_expr_from_tree (t)
else
{
tree name = TREE_OPERAND (t, 0);
- if (TREE_CODE (name) == TEMPLATE_ID_EXPR
+ tree id;
+ tree args = build_expr_from_tree (TREE_OPERAND (t, 1));
+ if (args != NULL_TREE && TREE_CODE (name) == LOOKUP_EXPR
+ && !LOOKUP_EXPR_GLOBAL (name)
+ && TREE_CODE ((id = TREE_OPERAND (name, 0))) == IDENTIFIER_NODE
+ && (!current_class_type
+ || !lookup_member (current_class_type, id, 0, 0)))
+ {
+ /* Do Koenig lookup if there are no class members. */
+ name = do_identifier (id, 0, args);
+ }
+ else if (TREE_CODE (name) == TEMPLATE_ID_EXPR
|| ! really_overloaded_fn (name))
name = build_expr_from_tree (name);
- return build_x_function_call
- (name, build_expr_from_tree (TREE_OPERAND (t, 1)),
- current_class_ref);
+ return build_x_function_call (name, args, current_class_ref);
}
case COND_EXPR:
@@ -3666,7 +3963,8 @@ check_cp_case_value (value)
return value;
}
-/* return 1 if root encloses child */
+/* Return 1 if root encloses child. */
+
static int
is_namespace_ancestor (root, child)
tree root, child;
@@ -3677,19 +3975,20 @@ is_namespace_ancestor (root, child)
return 1;
if (child == global_namespace)
return 0;
- return is_namespace_ancestor (root, DECL_NAMESPACE (child));
+ return is_namespace_ancestor (root, CP_DECL_CONTEXT (child));
}
-/* return the namespace that is the common ancestor
- of two given namespaces */
-static tree
+/* Return the namespace that is the common ancestor
+ of two given namespaces. */
+
+tree
namespace_ancestor (ns1, ns2)
tree ns1, ns2;
{
if (is_namespace_ancestor (ns1, ns2))
return ns1;
- return namespace_ancestor (DECL_NAMESPACE (ns1), ns2);
+ return namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2);
}
/* Insert used into the using list of user. Set indirect_flag if this
@@ -3701,130 +4000,200 @@ add_using_namespace (user, used, indirect)
tree used;
int indirect;
{
- tree iter;
- /* using oneself is a no-op */
+ tree t;
+ /* Using oneself is a no-op. */
if (user == used)
return;
my_friendly_assert (TREE_CODE (user) == NAMESPACE_DECL, 380);
my_friendly_assert (TREE_CODE (used) == NAMESPACE_DECL, 380);
- /* check if we already have this */
- if (purpose_member (used, DECL_NAMESPACE_USING (user)) != NULL_TREE)
- return;
+ /* Check if we already have this. */
+ t = purpose_member (used, DECL_NAMESPACE_USING (user));
+ if (t != NULL_TREE)
+ {
+ if (!indirect)
+ /* Promote to direct usage. */
+ TREE_INDIRECT_USING (t) = 0;
+ return;
+ }
- /* add used to the user's using list */
+ /* Add used to the user's using list. */
DECL_NAMESPACE_USING (user)
= perm_tree_cons (used, namespace_ancestor (user, used),
DECL_NAMESPACE_USING (user));
TREE_INDIRECT_USING (DECL_NAMESPACE_USING (user)) = indirect;
- /* add user to the used's users list */
+ /* Add user to the used's users list. */
DECL_NAMESPACE_USERS (used)
= perm_tree_cons (user, 0, DECL_NAMESPACE_USERS (used));
-
- for (iter = DECL_NAMESPACE_USERS (user); iter; iter = TREE_CHAIN (iter))
+
+ /* Recursively add all namespaces used. */
+ for (t = DECL_NAMESPACE_USING (used); t; t = TREE_CHAIN (t))
/* indirect usage */
- add_using_namespace (TREE_PURPOSE (iter), used, 1);
+ add_using_namespace (user, TREE_PURPOSE (t), 1);
+
+ /* Tell everyone using us about the new used namespaces. */
+ for (t = DECL_NAMESPACE_USERS (user); t; t = TREE_CHAIN (t))
+ add_using_namespace (TREE_PURPOSE (t), used, 1);
+}
+
+/* Combines two sets of overloaded functions into an OVERLOAD chain, removing
+ duplicates. The first list becomes the tail of the result.
+
+ The algorithm is O(n^2). We could get this down to O(n log n) by
+ doing a sort on the addresses of the functions, if that becomes
+ necessary. */
+
+static tree
+merge_functions (s1, s2)
+ tree s1;
+ tree s2;
+{
+ for (; s2; s2 = OVL_NEXT (s2))
+ {
+ tree fn = OVL_CURRENT (s2);
+ if (! ovl_member (fn, s1))
+ s1 = build_overload (fn, s1);
+ }
+ return s1;
}
/* This should return an error not all definitions define functions.
It is not an error if we find two functions with exactly the
same signature, only if these are selected in overload resolution.
+ old is the current set of bindings, new the freshly-found binding.
XXX Do we want to give *all* candidates in case of ambiguity?
XXX In what way should I treat extern declarations?
XXX I don't want to repeat the entire duplicate_decls here */
+
static tree
-ambiguous_decl (name, val1, val2)
- tree name, val1, val2;
+ambiguous_decl (name, old, new, flags)
+ tree name;
+ tree old;
+ tree new;
+ int flags;
{
- my_friendly_assert (val1 != val2, 376);
- if (is_overloaded_fn (val1) && is_overloaded_fn (val1))
+ tree val, type;
+ my_friendly_assert (old != NULL_TREE, 393);
+ /* Copy the value. */
+ val = BINDING_VALUE (new);
+ if (val)
+ switch (TREE_CODE (val))
+ {
+ case TEMPLATE_DECL:
+ /* If we expect types or namespaces, and not templates,
+ or this is not a template class. */
+ if (LOOKUP_QUALIFIERS_ONLY (flags)
+ && (!(flags & LOOKUP_TEMPLATES_EXPECTED)
+ || !DECL_CLASS_TEMPLATE_P (val)))
+ val = NULL_TREE;
+ break;
+ case TYPE_DECL:
+ if (LOOKUP_NAMESPACES_ONLY (flags))
+ val = NULL_TREE;
+ break;
+ case NAMESPACE_DECL:
+ if (LOOKUP_TYPES_ONLY (flags))
+ val = NULL_TREE;
+ break;
+ default:
+ if (LOOKUP_QUALIFIERS_ONLY (flags))
+ val = NULL_TREE;
+ }
+
+ if (!BINDING_VALUE (old))
+ BINDING_VALUE (old) = val;
+ else if (val && val != BINDING_VALUE (old))
+ {
+ if (is_overloaded_fn (BINDING_VALUE (old))
+ && is_overloaded_fn (val))
+ {
+ BINDING_VALUE (old) = merge_functions (BINDING_VALUE (old),
+ val);
+ }
+ else
+ {
+ /* Some declarations are functions, some are not. */
+ if (flags & LOOKUP_COMPLAIN)
+ {
+ cp_error ("use of `%D' is ambiguous", name);
+ cp_error_at (" first declared as `%#D' here",
+ BINDING_VALUE (old));
+ cp_error_at (" also declared as `%#D' here", val);
+ }
+ return error_mark_node;
+ }
+ }
+ /* ... and copy the type. */
+ type = BINDING_TYPE (new);
+ if (LOOKUP_NAMESPACES_ONLY (flags))
+ type = NULL_TREE;
+ if (!BINDING_TYPE (old))
+ BINDING_TYPE (old) = type;
+ else if (type && BINDING_TYPE (old) != type)
{
- /* now built a joint list of all overloaded declarations */
- /* XXX if I chain'em together, they will be always considered
- as overloaded */
- sorry ("overloaded functions used from different namespaces");
+ if (flags & LOOKUP_COMPLAIN)
+ {
+ cp_error ("`%D' denotes an ambiguous type",name);
+ cp_error_at (" first type here", BINDING_TYPE (old));
+ cp_error_at (" other type here", type);
+ }
}
- cp_error ("ambiguous definition `%D' used", name);
- cp_error_at ("first definition here", val1);
- cp_error_at ("other definition here", val2);
- return error_mark_node;
+ return old;
}
-/* add the bindings of name in used namespaces to val
- the using list is defined by current, and the lookup goes to scope */
-tree
-lookup_using_namespace (name, val, current, scope)
- tree name, val, current, scope;
+/* Add the bindings of name in used namespaces to val.
+ The using list is defined by usings, and the lookup goes to scope.
+ Returns zero on errors. */
+
+int
+lookup_using_namespace (name, val, usings, scope, flags)
+ tree name, val, usings, scope;
+ int flags;
{
tree iter;
tree val1;
- /* iterate over all namespaces from current to scope */
- while (1)
- {
- /* iterate over all used namespaces in current, searching for
- using directives of scope */
- for (iter = DECL_NAMESPACE_USING (current);
- iter; iter = TREE_CHAIN (iter))
- if (TREE_VALUE (iter) == scope)
- {
- val1 = NAMESPACE_BINDING (name, TREE_PURPOSE (iter));
- /* name not found in this space */
- if (!val1)
- continue;
- /* first definition ever */
- if (!val)
- {
- val = val1;
- continue;
- }
- /* Hmmm. Ambiguity. As long as both are overloaded functions,
- this is fine */
- val = ambiguous_decl (name, val, val1);
- if (val == error_mark_node)
- break;
- }
- if (current == scope)
- break;
- current = DECL_NAMESPACE (current);
- }
- return val;
+ /* Iterate over all used namespaces in current, searching for using
+ directives of scope. */
+ for (iter = usings; iter; iter = TREE_CHAIN (iter))
+ if (TREE_VALUE (iter) == scope)
+ {
+ val1 = binding_for_name (name, TREE_PURPOSE (iter));
+ /* Resolve ambiguities. */
+ val = ambiguous_decl (name, val, val1, flags);
+ }
+ return val != error_mark_node;
}
-/* [namespace.qual] */
-tree
-qualified_lookup_using_namespace (name, scope)
+/* [namespace.qual]
+ Excepts the name to lookup and its qualifying scope.
+ Returns the name/type pair found into the CPLUS_BINDING result,
+ or 0 on error. */
+
+int
+qualified_lookup_using_namespace (name, scope, result, flags)
tree name;
tree scope;
+ tree result;
+ int flags;
{
- tree val = NULL_TREE;
- tree val1;
- /* maintain a list of namespaces visited */
+ /* Maintain a list of namespaces visited... */
tree seen = NULL_TREE;
- /* and a list of namespace yet to see */
+ /* ... and a list of namespace yet to see. */
tree todo = NULL_TREE;
tree usings;
- while (scope)
+ while (scope && (result != error_mark_node))
{
seen = temp_tree_cons (scope, NULL_TREE, seen);
- val1 = NAMESPACE_BINDING (name, scope);
- if (val1)
- {
- if (val)
- {
- val = ambiguous_decl (name, val, val1);
- break;
- }
- else
- val = val1;
- }
- else
- /* consider using directives */
+ result = ambiguous_decl (name, result,
+ binding_for_name (name, scope), flags);
+ if (!BINDING_VALUE (result) && !BINDING_TYPE (result))
+ /* Consider using directives. */
for (usings = DECL_NAMESPACE_USING (scope); usings;
usings = TREE_CHAIN (usings))
- /* if this was a real directive, and we have not seen it */
+ /* If this was a real directive, and we have not seen it. */
if (!TREE_INDIRECT_USING (usings)
- && !purpose_member (seen, TREE_PURPOSE (usings)))
+ && !purpose_member (TREE_PURPOSE (usings), seen))
todo = temp_tree_cons (TREE_PURPOSE (usings), NULL_TREE, todo);
if (todo)
{
@@ -3832,103 +4201,593 @@ qualified_lookup_using_namespace (name, scope)
todo = TREE_CHAIN (todo);
}
else
- scope = NULL_TREE; /* if there never was a todo list */
+ scope = NULL_TREE; /* If there never was a todo list. */
}
- return val;
+ return result != error_mark_node;
}
-#if 0
-/* this is broken and should not be called anymore */
-/* Get the inner part of a namespace id. It doesn't have any prefix, nor
- postfix. Returns 0 if in global namespace. */
+/* [namespace.memdef]/2 */
+
+/* Set the context of a declaration to scope. Complain if we are not
+ outside scope. */
+
+void
+set_decl_namespace (decl, scope)
+ tree decl;
+ tree scope;
+{
+ tree old;
+ if (scope == std_node)
+ scope = global_namespace;
+ /* Get rid of namespace aliases. */
+ scope = ORIGINAL_NAMESPACE (scope);
+
+ if (!is_namespace_ancestor (current_namespace, scope))
+ cp_error ("declaration of `%D' not in a namespace surrounding `%D'",
+ decl, scope);
+ DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
+ if (scope != current_namespace)
+ {
+ /* See whether this has been declared in the namespace. */
+ old = namespace_binding (DECL_NAME (decl), scope);
+ if (!old)
+ /* No old declaration at all. */
+ goto complain;
+ if (!is_overloaded_fn (decl))
+ /* Don't compare non-function decls with decls_match here,
+ since it can't check for the correct constness at this
+ point. pushdecl will find those errors later. */
+ return;
+ /* Since decl is a function, old should contain a function decl. */
+ if (!is_overloaded_fn (old))
+ goto complain;
+ for (; old; old = OVL_NEXT (old))
+ if (decls_match (decl, OVL_CURRENT (old)))
+ return;
+ }
+ else
+ return;
+ complain:
+ cp_error ("`%D' should have been declared inside `%D'",
+ decl, scope);
+}
+
+/* Compute the namespace where a declaration is defined. */
tree
-get_namespace_id ()
+decl_namespace (decl)
+ tree decl;
{
- tree x = current_namespace;
- if (x)
- x = TREE_PURPOSE (x);
- return x;
+ while (DECL_CONTEXT (decl))
+ {
+ decl = DECL_CONTEXT (decl);
+ if (TREE_CODE (decl) == NAMESPACE_DECL)
+ return decl;
+ if (TREE_CODE_CLASS (TREE_CODE (decl)) == 't')
+ decl = TYPE_STUB_DECL (decl);
+ my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd', 390);
+ }
+
+ return global_namespace;
}
-/* Build up a DECL_ASSEMBLER_NAME for NAME in the current namespace. */
+/* Return the namespace where the current declaration is declared. */
tree
-current_namespace_id (name)
- tree name;
+current_decl_namespace ()
{
- tree old_id = get_namespace_id ();
- char *buf;
+ tree result;
+ /* If we have been pushed into a different namespace, use it. */
+ if (decl_namespace_list)
+ return TREE_PURPOSE (decl_namespace_list);
+
+ if (current_class_type)
+ result = decl_namespace (TYPE_STUB_DECL (current_class_type));
+ else if (current_function_decl)
+ result = decl_namespace (current_function_decl);
+ else
+ result = current_namespace;
+ return result;
+}
- /* Global names retain old encoding. */
- if (! old_id)
- return name;
+/* Temporarily set the namespace for the current declaration. */
- buf = (char *) alloca (8 + IDENTIFIER_LENGTH (old_id)
- + IDENTIFIER_LENGTH (name));
- sprintf (buf, "__ns_%s_%s", IDENTIFIER_POINTER (old_id),
- IDENTIFIER_POINTER (name));
- return get_identifier (buf);
+void
+push_decl_namespace (decl)
+ tree decl;
+{
+ if (TREE_CODE (decl) != NAMESPACE_DECL)
+ decl = decl_namespace (decl);
+ decl_namespace_list = tree_cons (decl, NULL_TREE, decl_namespace_list);
}
-#endif
+
+void
+pop_decl_namespace ()
+{
+ decl_namespace_list = TREE_CHAIN (decl_namespace_list);
+}
+
+static void
+check_decl_namespace ()
+{
+ my_friendly_assert (decl_namespace_list == NULL_TREE, 980711);
+}
+
+/* [basic.lookup.koenig] */
+/* A non-zero return value in the functions below indicates an error.
+ All nodes allocated in the procedure are on the scratch obstack. */
+
+struct arg_lookup
+{
+ tree name;
+ tree namespaces;
+ tree classes;
+ tree functions;
+};
+
+static int arg_assoc PROTO((struct arg_lookup*, tree));
+static int arg_assoc_args PROTO((struct arg_lookup*, tree));
+static int arg_assoc_type PROTO((struct arg_lookup*, tree));
+
+/* Add a function to the lookup structure.
+ Returns 1 on error. */
+
+static int
+add_function (k, fn)
+ struct arg_lookup *k;
+ tree fn;
+{
+ if (ovl_member (fn, k->functions))
+ return 0;
+ /* We must find only functions, or exactly one non-function. */
+ if (k->functions && is_overloaded_fn (k->functions)
+ && is_overloaded_fn (fn))
+ k->functions = build_overload (fn, k->functions);
+ else
+ if(k->functions)
+ {
+ tree f1 = OVL_CURRENT (k->functions);
+ tree f2 = fn;
+ if (is_overloaded_fn (f1))
+ {
+ fn = f1; f1 = f2; f2 = fn;
+ }
+ cp_error_at ("`%D' is not a function,", f1);
+ cp_error_at (" conflict with `%D'", f2);
+ cp_error (" in call to `%D'", k->name);
+ return 1;
+ }
+ else
+ k->functions = fn;
+ return 0;
+}
+
+/* Add functions of a namespace to the lookup structure.
+ Returns 1 on error. */
+
+static int
+arg_assoc_namespace (k, scope)
+ struct arg_lookup *k;
+ tree scope;
+{
+ tree value;
+
+ if (purpose_member (scope, k->namespaces))
+ return 0;
+ k->namespaces = tree_cons (scope, NULL_TREE, k->namespaces);
+
+ value = namespace_binding (k->name, scope);
+ if (!value)
+ return 0;
+
+ for (; value; value = OVL_NEXT (value))
+ if (add_function (k, OVL_CURRENT (value)))
+ return 1;
+
+ return 0;
+}
+
+/* Adds everything associated with class to the lookup structure.
+ Returns 1 on error. */
+
+static int
+arg_assoc_class (k, type)
+ struct arg_lookup* k;
+ tree type;
+{
+ tree list, friends, context;
+ int i;
+
+ if (purpose_member (type, k->classes))
+ return 0;
+ k->classes = tree_cons (type, NULL_TREE, k->classes);
+
+ context = decl_namespace (TYPE_MAIN_DECL (type));
+ if (arg_assoc_namespace (k, context))
+ return 1;
+
+ /* Process baseclasses. */
+ for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); i++)
+ if (arg_assoc_class (k, TYPE_BINFO_BASETYPE (type, i)))
+ return 1;
+
+ /* Process friends. */
+ for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list;
+ list = TREE_CHAIN (list))
+ if (k->name == TREE_PURPOSE (list))
+ for (friends = TREE_VALUE (list); friends;
+ friends = TREE_CHAIN (friends))
+ /* Only interested in global functions with potentially hidden
+ (i.e. unqualified) declarations. */
+ if (TREE_PURPOSE (list) == error_mark_node && TREE_VALUE (list)
+ && decl_namespace (TREE_VALUE (list)) == context)
+ if (add_function (k, TREE_VALUE (list)))
+ return 1;
+
+ /* Process template arguments. */
+ if (CLASSTYPE_TEMPLATE_INFO (type))
+ {
+ list = innermost_args (CLASSTYPE_TI_ARGS (type));
+ for (i = 0; i < TREE_VEC_LENGTH (list); ++i)
+ arg_assoc (k, TREE_VEC_ELT (list, i));
+ }
+
+ return 0;
+}
+
+/* Adds everything associated with a given type.
+ Returns 1 on error. */
+
+static int
+arg_assoc_type (k, type)
+ struct arg_lookup *k;
+ tree type;
+{
+ switch (TREE_CODE (type))
+ {
+ case VOID_TYPE:
+ case INTEGER_TYPE:
+ case REAL_TYPE:
+ case COMPLEX_TYPE:
+ case CHAR_TYPE:
+ case BOOLEAN_TYPE:
+ return 0;
+ case RECORD_TYPE:
+ if (TYPE_PTRMEMFUNC_P (type))
+ return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type));
+ return arg_assoc_class (k, type);
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
+ case ARRAY_TYPE:
+ return arg_assoc_type (k, TREE_TYPE (type));
+ case UNION_TYPE:
+ case ENUMERAL_TYPE:
+ return arg_assoc_namespace (k, decl_namespace (TYPE_MAIN_DECL (type)));
+ case OFFSET_TYPE:
+ /* Pointer to member: associate class type and value type. */
+ if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type)))
+ return 1;
+ return arg_assoc_type (k, TREE_TYPE (type));
+ case METHOD_TYPE:
+ /* The basetype is referenced in the first arg type, so just
+ fall through. */
+ case FUNCTION_TYPE:
+ /* Associate the parameter types. */
+ if (arg_assoc_args (k, TYPE_ARG_TYPES (type)))
+ return 1;
+ /* Associate the return type. */
+ return arg_assoc_type (k, TREE_TYPE (type));
+ case TEMPLATE_TYPE_PARM:
+ return 0;
+ case LANG_TYPE:
+ if (type == unknown_type_node)
+ return 0;
+ /* else fall through */
+ default:
+ my_friendly_abort (390);
+ }
+ return 0;
+}
+
+/* Adds everything associated with arguments. Returns 1 on error. */
+
+static int
+arg_assoc_args (k, args)
+ struct arg_lookup* k;
+ tree args;
+{
+ for (; args; args = TREE_CHAIN (args))
+ if (arg_assoc (k, TREE_VALUE (args)))
+ return 1;
+ return 0;
+}
+
+/* Adds everything associated with a given tree_node. Returns 1 on error. */
+
+static int
+arg_assoc (k, n)
+ struct arg_lookup* k;
+ tree n;
+{
+ if (n == error_mark_node)
+ return 0;
+
+ if (TREE_CODE_CLASS (TREE_CODE (n)) == 't')
+ return arg_assoc_type (k, n);
+
+ if (! type_unknown_p (n))
+ return arg_assoc_type (k, TREE_TYPE (n));
+
+ if (TREE_CODE (n) == ADDR_EXPR)
+ n = TREE_OPERAND (n, 0);
+ while (TREE_CODE (n) == TREE_LIST)
+ n = TREE_VALUE (n);
+
+ if (TREE_CODE (n) == TEMPLATE_ID_EXPR)
+ {
+ /* [basic.lookup.koenig]
+
+ If T is a template-id, its associated namespaces and classes
+ are the namespace in which the template is defined; for
+ member templates, the member template's class; the namespaces
+ and classes associated with the types of the template
+ arguments provided for template type parameters (excluding
+ template template parameters); the namespaces in which any
+ template template arguments are defined; and the classes in
+ which any member templates used as template template
+ arguments are defined. [Note: non-type template arguments do
+ not contribute to the set of associated namespaces. ] */
+ tree template = TREE_OPERAND (n, 0);
+ tree args = TREE_OPERAND (n, 1);
+ tree ctx;
+ tree arg;
+
+ /* First, the template. There may actually be more than one if
+ this is an overloaded function template. But, in that case,
+ we only need the first; all the functions will be in the same
+ namespace. */
+ template = OVL_CURRENT (template);
+
+ ctx = CP_DECL_CONTEXT (template);
+
+ if (TREE_CODE (ctx) == NAMESPACE_DECL)
+ {
+ if (arg_assoc_namespace (k, ctx) == 1)
+ return 1;
+ }
+ /* It must be a member template. */
+ else if (arg_assoc_class (k, ctx) == 1)
+ return 1;
+
+ /* Now the arguments. */
+ for (arg = args; arg != NULL_TREE; arg = TREE_CHAIN (arg))
+ {
+ tree t = TREE_VALUE (arg);
+
+ if (TREE_CODE (t) == TEMPLATE_DECL)
+ {
+ ctx = CP_DECL_CONTEXT (t);
+ if (TREE_CODE (ctx) == NAMESPACE_DECL)
+ {
+ if (arg_assoc_namespace (k, ctx) == 1)
+ return 1;
+ }
+ else if (arg_assoc_class (k, ctx) == 1)
+ return 1;
+ }
+ else if (TREE_CODE_CLASS (TREE_CODE (t)) == 't'
+ && arg_assoc_type (k, t) == 1)
+ return 1;
+ }
+ }
+ else
+ {
+ my_friendly_assert (TREE_CODE (n) == OVERLOAD, 980715);
+
+ for (; n; n = OVL_CHAIN (n))
+ if (arg_assoc (k, OVL_FUNCTION (n)))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Performs Koenig lookup depending on arguments, where fns
+ are the functions found in normal lookup. */
+
+tree
+lookup_arg_dependent (name, fns, args)
+ tree name;
+ tree fns;
+ tree args;
+{
+ struct arg_lookup k;
+ k.name = name;
+ k.functions = fns;
+ k.namespaces = NULL_TREE;
+ k.classes = NULL_TREE;
+
+ push_scratch_obstack ();
+ arg_assoc_args (&k, args);
+ pop_obstacks ();
+ return k.functions;
+}
+
+/* Process a namespace-alias declaration. */
void
do_namespace_alias (alias, namespace)
tree alias, namespace;
{
- tree binding;
- tree ns;
- if (TREE_CODE (namespace) == IDENTIFIER_NODE)
- ns = lookup_name (namespace, 1);
- else
- ns = namespace;
- if (TREE_CODE (ns) != NAMESPACE_DECL)
+ if (TREE_CODE (namespace) != NAMESPACE_DECL)
{
- cp_error ("`%D' is not a namespace", namespace);
+ /* The parser did not find it, so it's not there. */
+ cp_error ("unknown namespace `%D'", namespace);
return;
}
- binding = binding_for_name (alias, current_namespace);
- if (BINDING_VALUE (binding) && BINDING_VALUE (binding) != namespace)
+
+ namespace = ORIGINAL_NAMESPACE (namespace);
+
+ /* Build the alias. */
+ alias = build_lang_decl (NAMESPACE_DECL, alias, void_type_node);
+ DECL_NAMESPACE_ALIAS (alias) = namespace;
+ pushdecl (alias);
+}
+
+/* Check a non-member using-declaration. Return the name and scope
+ being used, and the USING_DECL, or NULL_TREE on failure. */
+
+static tree
+validate_nonmember_using_decl (decl, scope, name)
+ tree decl;
+ tree *scope;
+ tree *name;
+{
+ if (TREE_CODE (decl) == SCOPE_REF
+ && TREE_OPERAND (decl, 0) == std_node)
+ return NULL_TREE;
+ if (TREE_CODE (decl) == SCOPE_REF)
+ {
+ *scope = TREE_OPERAND (decl, 0);
+ *name = TREE_OPERAND (decl, 1);
+ }
+ else if (TREE_CODE (decl) == IDENTIFIER_NODE
+ || TREE_CODE (decl) == TYPE_DECL)
{
- cp_error ("invalid namespace alias `%D'", alias);
- cp_error_at ("`%D' previously declared here", alias);
+ *scope = global_namespace;
+ *name = decl;
}
else
+ my_friendly_abort (382);
+ if (TREE_CODE_CLASS (TREE_CODE (*name)) == 'd')
+ *name = DECL_NAME (*name);
+ /* Make a USING_DECL. */
+ return push_using_decl (*scope, *name);
+}
+
+/* Process local and global using-declarations. */
+
+static void
+do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
+ tree scope, name;
+ tree oldval, oldtype;
+ tree *newval, *newtype;
+{
+ tree decls;
+ struct tree_binding _decls;
+
+ *newval = *newtype = NULL_TREE;
+ decls = binding_init (&_decls);
+ if (!qualified_lookup_using_namespace (name, scope, decls, 0))
+ /* Lookup error */
+ return;
+
+ if (!BINDING_VALUE (decls) && !BINDING_TYPE (decls))
+ {
+ cp_error ("`%D' not declared", name);
+ return;
+ }
+
+ /* Check for using functions. */
+ if (BINDING_VALUE (decls) && is_overloaded_fn (BINDING_VALUE (decls)))
{
- /* XXX the alias is not exactly identical to the name space,
- it must not be used in a using directive or namespace alias */
- BINDING_VALUE (binding) = ns;
+ tree tmp, tmp1;
+
+ if (oldval && !is_overloaded_fn (oldval))
+ {
+ duplicate_decls (OVL_CURRENT (BINDING_VALUE (decls)), oldval);
+ oldval = NULL_TREE;
+ }
+
+ *newval = oldval;
+ for (tmp = BINDING_VALUE (decls); tmp; tmp = OVL_NEXT (tmp))
+ {
+ /* Compare each new function with each old one.
+ If the old function was also used, there is no conflict. */
+ for (tmp1 = oldval; tmp1; tmp1 = OVL_NEXT (tmp1))
+ if (OVL_CURRENT (tmp) == OVL_CURRENT (tmp1))
+ break;
+ else if (OVL_USED (tmp1))
+ continue;
+ else if (duplicate_decls (OVL_CURRENT (tmp), OVL_CURRENT (tmp1)))
+ return;
+
+ /* Duplicate use, ignore */
+ if (tmp1)
+ continue;
+
+ *newval = build_overload (OVL_CURRENT (tmp), *newval);
+ if (TREE_CODE (*newval) != OVERLOAD)
+ *newval = ovl_cons (*newval, NULL_TREE);
+ OVL_USED (*newval) = 1;
+ }
+ }
+ else
+ {
+ *newval = BINDING_VALUE (decls);
+ if (oldval)
+ duplicate_decls (*newval, oldval);
+ }
+
+ *newtype = BINDING_TYPE (decls);
+ if (oldtype && *newtype && oldtype != *newtype)
+ {
+ cp_error ("using directive `%D' introduced ambiguous type `%T'",
+ name, oldtype);
+ return;
}
}
+/* Process a using-declaration not appearing in class or local scope. */
+
void
do_toplevel_using_decl (decl)
tree decl;
{
-#if 1
- if (TREE_CODE (decl) == SCOPE_REF
- && TREE_OPERAND (decl, 0) == std_node)
+ tree scope, name, binding;
+ tree oldval, oldtype, newval, newtype;
+
+ decl = validate_nonmember_using_decl (decl, &scope, &name);
+ if (decl == NULL_TREE)
return;
- sorry ("using-declaration");
-#else
- if (decl == NULL_TREE || decl == error_mark_node)
+
+ binding = binding_for_name (name, current_namespace);
+
+ oldval = BINDING_VALUE (binding);
+ oldtype = BINDING_TYPE (binding);
+
+ do_nonmember_using_decl (scope, name, oldval, oldtype, &newval, &newtype);
+
+ /* Copy declarations found. */
+ if (newval)
+ BINDING_VALUE (binding) = newval;
+ if (newtype)
+ BINDING_TYPE (binding) = newtype;
+ return;
+}
+
+/* Process a using-declaration at function scope. */
+
+void
+do_local_using_decl (decl)
+ tree decl;
+{
+ tree scope, name;
+ tree oldval, oldtype, newval, newtype;
+
+ decl = validate_nonmember_using_decl (decl, &scope, &name);
+ if (decl == NULL_TREE)
return;
- if (TREE_CODE (decl) == SCOPE_REF)
- decl = resolve_scope_to_name (NULL_TREE, decl);
+ oldval = lookup_name_current_level (name);
+ oldtype = lookup_type_current_level (name);
- /* Is this the right way to do an id list? */
- if (TREE_CODE (decl) != TREE_LIST)
- {
- pushdecl (decl);
- }
- else
- while (decl)
- {
- pushdecl (TREE_VALUE (decl));
- decl = TREE_CHAIN (decl);
- }
-#endif
+ do_nonmember_using_decl (scope, name, oldval, oldtype, &newval, &newtype);
+
+ if (newval)
+ set_identifier_local_value (name, newval);
+ if (newtype)
+ set_identifier_type_value (name, newtype);
}
tree
@@ -3937,7 +4796,8 @@ do_class_using_decl (decl)
{
tree name, value;
- if (TREE_CODE (decl) != SCOPE_REF)
+ if (TREE_CODE (decl) != SCOPE_REF
+ || TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (decl, 0))) != 't')
{
cp_error ("using-declaration for non-member at class scope");
return NULL_TREE;
@@ -3948,23 +4808,44 @@ do_class_using_decl (decl)
cp_error ("using-declaration for destructor");
return NULL_TREE;
}
+ if (TREE_CODE (name) == TYPE_DECL)
+ name = DECL_NAME (name);
+
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716);
value = build_lang_field_decl (USING_DECL, name, void_type_node);
DECL_INITIAL (value) = TREE_OPERAND (decl, 0);
return value;
}
+/* Process a using-directive. */
+
void
do_using_directive (namespace)
tree namespace;
{
if (namespace == std_node)
return;
- /* using A::B::C; */
+ /* using namespace A::B::C; */
if (TREE_CODE (namespace) == SCOPE_REF)
namespace = TREE_OPERAND (namespace, 1);
- /* direct usage */
- add_using_namespace (current_namespace, namespace, 0);
+ if (TREE_CODE (namespace) == IDENTIFIER_NODE)
+ {
+ /* Lookup in lexer did not find a namespace. */
+ cp_error ("namespace `%T' undeclared", namespace);
+ return;
+ }
+ if (TREE_CODE (namespace) != NAMESPACE_DECL)
+ {
+ cp_error ("`%T' is not a namespace", namespace);
+ return;
+ }
+ namespace = ORIGINAL_NAMESPACE (namespace);
+ if (!toplevel_bindings_p ())
+ push_using_directive (namespace);
+ else
+ /* direct usage */
+ add_using_namespace (current_namespace, namespace, 0);
}
void
@@ -3979,8 +4860,8 @@ check_default_args (x)
saw_def = 1;
else if (saw_def)
{
- cp_error ("default argument missing for parameter %P of `%#D'",
- i, x);
+ cp_error_at ("default argument missing for parameter %P of `%+#D'",
+ i, x);
break;
}
}
@@ -3994,13 +4875,23 @@ mark_used (decl)
if (processing_template_decl)
return;
assemble_external (decl);
+
/* Is it a synthesized method that needs to be synthesized? */
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_CLASS_CONTEXT (decl)
&& DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl)
/* Kludge: don't synthesize for default args. */
&& current_function_decl)
synthesize_method (decl);
- if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl))
+
+ /* If this is a function or variable that is an instance of some
+ template, we now know that we will need to actually do the
+ instantiation. A TEMPLATE_DECL may also have DECL_TEMPLATE_INFO,
+ if it's a partial instantiation, but there's no need to
+ instantiate such a thing. We check that DECL is not an explicit
+ instantiation because that is not checked in instantiate_decl. */
+ if (TREE_CODE (decl) != TEMPLATE_DECL
+ && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
+ && !DECL_EXPLICIT_INSTANTIATION (decl))
instantiate_decl (decl);
}
@@ -4019,6 +4910,6 @@ handle_class_head (aggr, scope, id)
cp_error ("no file-scope type named `%D'", id);
id = xref_tag
- (aggr, make_anon_name (), NULL_TREE, 1);
+ (aggr, make_anon_name (), 1);
return TYPE_MAIN_DECL (id);
}
diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c
index 4546e1954cb..a43bcf3f0e1 100644
--- a/gcc/cp/errfn.c
+++ b/gcc/cp/errfn.c
@@ -24,12 +24,6 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "toplev.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
/* cp_printer is the type of a function which converts an argument into
a string for digestion by printf. The cp_printer function should deal
with all memory management; the functions in this file will not free
@@ -50,7 +44,8 @@ extern int cp_line_of PROTO((tree));
#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
-/* This function supports only `%s', `%d', and the C++ print codes. */
+/* This function supports only `%s', `%d', `%%', and the C++ print
+ codes. */
#ifdef __STDC__
static void
@@ -76,7 +71,7 @@ cp_thing (errfn, atarg1, format, ap)
if (len > buflen)
{
buflen = len;
- buf = xmalloc (buflen);
+ buf = xrealloc (buf, buflen);
}
offset = 0;
@@ -152,6 +147,18 @@ cp_thing (errfn, atarg1, format, ap)
strcpy (buf + offset, p);
offset += plen;
}
+ else if (*f == '%')
+ {
+ /* A `%%' has occurred in the input string. Replace it with
+ a `%' in the formatted message buf. */
+
+ if (++len > buflen)
+ {
+ buflen = len;
+ buf = xrealloc (buf, len);
+ }
+ buf[offset++] = '%';
+ }
else
{
if (*f != 'd')
@@ -180,10 +187,10 @@ cp_thing (errfn, atarg1, format, ap)
{
char *file = cp_file_of (atarg);
int line = cp_line_of (atarg);
- (*errfn) (file, line, buf);
+ (*errfn) (file, line, "%s", buf);
}
else
- (*errfn) (buf);
+ (*errfn) ("%s", buf);
}
@@ -200,7 +207,7 @@ DECLARE (cp_error)
va_list ap;
INIT;
if (! cp_silent)
- cp_thing (error, 0, format, ap);
+ cp_thing ((errorfn *) error, 0, format, ap);
va_end (ap);
}
@@ -209,7 +216,7 @@ DECLARE (cp_warning)
va_list ap;
INIT;
if (! cp_silent)
- cp_thing (warning, 0, format, ap);
+ cp_thing ((errorfn *) warning, 0, format, ap);
va_end (ap);
}
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 39f7dd9a748..52c519d692a 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -39,18 +39,18 @@ typedef char* cp_printer ();
#define T type_as_string
#define V cv_as_string
-#define _ (cp_printer *) 0
+#define o (cp_printer *) 0
cp_printer * cp_printers[256] =
-{
+{
/*0 1 2 3 4 5 6 7 8 9 A B C D E F */
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x00 */
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x10 */
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x20 */
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x30 */
- _, A, _, C, D, E, _, _, _, _, _, _, L, _, _, O, /* 0x40 */
- P, Q, _, _, T, _, V, _, _, _, _, _, _, _, _, _, /* 0x50 */
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x60 */
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* 0x70 */
+ o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, /* 0x00 */
+ o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, /* 0x10 */
+ o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, /* 0x20 */
+ o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, /* 0x30 */
+ o, A, o, C, D, E, o, o, o, o, o, o, L, o, o, O, /* 0x40 */
+ P, Q, o, o, T, o, V, o, o, o, o, o, o, o, o, o, /* 0x50 */
+ o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, /* 0x60 */
+ o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, /* 0x70 */
};
#undef C
#undef D
@@ -61,7 +61,7 @@ cp_printer * cp_printers[256] =
#undef Q
#undef T
#undef V
-#undef _
+#undef o
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -80,7 +80,7 @@ static char *scratch_firstobj;
IDENTIFIER_LENGTH (ID)))
# define OB_PUTCP(S) (obstack_grow (&scratch_obstack, (S), strlen (S)))
# define OB_FINISH() (obstack_1grow (&scratch_obstack, '\0'))
-# define OB_PUTI(CST) do { sprintf (digit_buffer, "%d", (CST)); \
+# define OB_PUTI(CST) do { sprintf (digit_buffer, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(CST)); \
OB_PUTCP (digit_buffer); } while (0)
# define OB_UNPUT(N) obstack_blank (&scratch_obstack, - (N));
@@ -90,6 +90,7 @@ enum pad { none, before, after };
static void dump_type PROTO((tree, int));
static void dump_type_real PROTO((tree, int, int));
+static void dump_simple_decl PROTO((tree, tree, int));
static void dump_decl PROTO((tree, int));
static void dump_function_decl PROTO((tree, int));
static void dump_expr PROTO((tree, int));
@@ -210,6 +211,7 @@ dump_type_real (t, v, canonical_name)
case TYPE_DECL:
case TEMPLATE_DECL:
+ case NAMESPACE_DECL:
dump_decl (t, v);
break;
@@ -228,8 +230,18 @@ dump_type_real (t, v, canonical_name)
case REAL_TYPE:
case VOID_TYPE:
case BOOLEAN_TYPE:
- dump_readonly_or_volatile (t, after);
- OB_PUTID (TYPE_IDENTIFIER (canonical_name ? TYPE_MAIN_VARIANT (t) : t));
+ {
+ tree type;
+ dump_readonly_or_volatile (t, after);
+ type = canonical_name ? TYPE_MAIN_VARIANT (t) : t;
+ if (TYPE_NAME (type) && TYPE_IDENTIFIER (type))
+ OB_PUTID (TYPE_IDENTIFIER (type));
+ else
+ /* Types like intQI_type_node and friends have no names.
+ These don't come up in user error messages, but it's nice
+ to be able to print them from the debugger. */
+ OB_PUTS ("{anonymous}");
+ }
break;
case TEMPLATE_TEMPLATE_PARM:
@@ -341,7 +353,7 @@ dump_aggr_type (t, v, canonical_name)
name = TYPE_NAME (canonical_name ? TYPE_MAIN_VARIANT (t) : t);
- if (name && DECL_CONTEXT (name))
+ if (name && CP_DECL_CONTEXT (name) != global_namespace)
{
/* FUNCTION_DECL or RECORD_TYPE */
dump_decl (DECL_CONTEXT (name), 0);
@@ -646,6 +658,30 @@ dump_global_iord (t)
}
static void
+dump_simple_decl (t, type, v)
+ tree t;
+ tree type;
+ int v;
+{
+ if (v > 0)
+ {
+ dump_type_prefix (type, v, 0);
+ OB_PUTC (' ');
+ }
+ if (DECL_CLASS_SCOPE_P (t))
+ {
+ dump_type (DECL_CONTEXT (t), 0);
+ OB_PUTC2 (':', ':');
+ }
+ if (DECL_NAME (t))
+ dump_decl (DECL_NAME (t), v);
+ else
+ OB_PUTS ("{anon}");
+ if (v > 0)
+ dump_type_suffix (type, v, 0);
+}
+
+static void
dump_decl (t, v)
tree t;
int v; /* verbosity */
@@ -674,7 +710,8 @@ dump_decl (t, v)
}
if (v > 0)
OB_PUTS ("typedef ");
- goto general;
+ dump_simple_decl (t, DECL_ORIGINAL_TYPE (t)
+ ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), v);
break;
case VAR_DECL:
@@ -687,37 +724,27 @@ dump_decl (t, v)
/* else fall through */
case FIELD_DECL:
case PARM_DECL:
- general:
- if (v > 0)
- {
- dump_type_prefix (TREE_TYPE (t), v, 0);
- OB_PUTC (' ');
- dump_readonly_or_volatile (t, after);
- }
- /* DECL_CLASS_CONTEXT isn't being set in some cases. Hmm... */
- if (DECL_CONTEXT (t)
- && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (t))) == 't')
- {
- dump_type (DECL_CONTEXT (t), 0);
- OB_PUTC2 (':', ':');
- }
- if (DECL_NAME (t))
- dump_decl (DECL_NAME (t), v);
- else
- OB_PUTS ("{anon}");
- if (v > 0)
- dump_type_suffix (TREE_TYPE (t), v, 0);
+ dump_simple_decl (t, TREE_TYPE (t), v);
break;
case NAMESPACE_DECL:
- if (DECL_NAMESPACE (t) != global_namespace)
+ if (CP_DECL_CONTEXT (t) != global_namespace)
{
- dump_decl (DECL_NAMESPACE (t), v);
+ dump_decl (DECL_CONTEXT (t), v);
OB_PUTC2 (':',':');
}
- OB_PUTID (DECL_NAME (t));
+ if (DECL_NAME (t) == anonymous_namespace_name)
+ OB_PUTS ("{anonymous}");
+ else
+ OB_PUTID (DECL_NAME (t));
break;
+ case SCOPE_REF:
+ dump_decl (TREE_OPERAND (t, 0), 0);
+ OB_PUTS ("::");
+ dump_decl (TREE_OPERAND (t, 1), 0);
+ break;
+
case ARRAY_REF:
dump_decl (TREE_OPERAND (t, 0), v);
OB_PUTC ('[');
@@ -864,7 +891,7 @@ dump_decl (t, v)
break;
case LOOKUP_EXPR:
- OB_PUTID (TREE_OPERAND (t, 0));
+ dump_decl (TREE_OPERAND (t, 0), v);
break;
case LABEL_DECL:
@@ -875,7 +902,7 @@ dump_decl (t, v)
if ((TREE_TYPE (t) != NULL_TREE && NEXT_CODE (t) == ENUMERAL_TYPE)
|| (DECL_INITIAL (t) &&
TREE_CODE (DECL_INITIAL (t)) == TEMPLATE_PARM_INDEX))
- goto general;
+ dump_simple_decl (t, TREE_TYPE (t), v);
else if (DECL_NAME (t))
dump_decl (DECL_NAME (t), v);
else if (DECL_INITIAL (t))
@@ -1018,91 +1045,75 @@ dump_function_name (t)
else
dump_decl (name, 0);
- if (DECL_LANG_SPECIFIC (t) && DECL_USE_TEMPLATE (t))
+ if (DECL_LANG_SPECIFIC (t) && DECL_USE_TEMPLATE (t)
+ && DECL_TEMPLATE_INFO (t)
+ && (DECL_TEMPLATE_SPECIALIZATION (t)
+ || TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL
+ || DECL_TEMPLATE_SPECIALIZATION (DECL_TI_TEMPLATE (t))
+ || PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))))
{
tree args = DECL_TEMPLATE_INFO (t) ? DECL_TI_ARGS (t) : NULL_TREE;
+ OB_PUTC ('<');
- if (args != NULL_TREE
- && DECL_CONTEXT (t) != NULL_TREE
- && uses_template_parms (DECL_CONTEXT (t))
- /* This next clause checks that there is only one level of
- template arguments. In that case, they are the
- arguments for the class context. */
- && (TREE_CODE (args) == TREE_LIST
- || (TREE_CODE (args) == TREE_VEC
- && TREE_VEC_ELT (args, 0) != NULL_TREE
- && TREE_CODE (TREE_VEC_ELT (args, 0)) != TREE_VEC)))
- /* We have something like this:
-
- template <class T> struct S { void f(); };
-
- and we are printing S<int>::f(). This is a template
- instantiation, but we don't print anything after the f. */
- ;
- else
+ /* Be careful only to print things when we have them, so as not
+ to crash producing error messages. */
+ if (args)
{
- OB_PUTC ('<');
-
- /* Be careful only to print things when we have them, so as not
- to crash producing error messages. */
- if (args)
+ if (TREE_CODE (args) == TREE_LIST)
{
- if (TREE_CODE (args) == TREE_LIST)
+ tree arg;
+ int need_comma = 0;
+
+ for (arg = args; arg; arg = TREE_CHAIN (arg))
{
- tree arg;
- int need_comma = 0;
-
- for (arg = args; arg; arg = TREE_CHAIN (arg))
- {
- tree a = TREE_VALUE (arg);
-
- if (need_comma)
- OB_PUTS (", ");
-
- if (a)
- {
- if (TREE_CODE_CLASS (TREE_CODE (a)) == 't'
- || TREE_CODE (a) == TEMPLATE_DECL)
- dump_type (a, 0);
- else
- dump_expr (a, 0);
- }
+ tree a = TREE_VALUE (arg);
+
+ if (need_comma)
+ OB_PUTS (", ");
- need_comma = 1;
+ if (a)
+ {
+ if (TREE_CODE_CLASS (TREE_CODE (a)) == 't'
+ || TREE_CODE (a) == TEMPLATE_DECL)
+ dump_type (a, 0);
+ else
+ dump_expr (a, 0);
}
+
+ need_comma = 1;
}
- else if (TREE_CODE (args) == TREE_VEC)
+ }
+ else if (TREE_CODE (args) == TREE_VEC)
+ {
+ int i;
+ int need_comma = 0;
+
+ if (TREE_VEC_LENGTH (args) > 0
+ && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
+ args = TREE_VEC_ELT (args,
+ TREE_VEC_LENGTH (args) - 1);
+
+ for (i = 0; i < TREE_VEC_LENGTH (args); i++)
{
- int i;
- int need_comma = 0;
-
- if (TREE_VEC_LENGTH (args) > 0
- && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
- args = TREE_VEC_ELT (args,
- TREE_VEC_LENGTH (args) - 1);
-
- for (i = 0; i < TREE_VEC_LENGTH (args); i++)
- {
- tree a = TREE_VEC_ELT (args, i);
-
- if (need_comma)
- OB_PUTS (", ");
-
- if (a)
- {
- if (TREE_CODE_CLASS (TREE_CODE (a)) == 't'
- || TREE_CODE (a) == TEMPLATE_DECL)
- dump_type (a, 0);
- else
- dump_expr (a, 0);
- }
+ tree a = TREE_VEC_ELT (args, i);
+
+ if (need_comma)
+ OB_PUTS (", ");
- need_comma = 1;
+ if (a)
+ {
+ if (TREE_CODE_CLASS (TREE_CODE (a)) == 't'
+ || TREE_CODE (a) == TEMPLATE_DECL)
+ dump_type (a, 0);
+ else
+ dump_expr (a, 0);
}
+
+ need_comma = 1;
}
}
- OB_PUTC ('>');
}
+ OB_PUTC ('>');
}
}
@@ -1183,6 +1194,7 @@ dump_expr (t, nop)
case CONST_DECL:
case FUNCTION_DECL:
case TEMPLATE_DECL:
+ case NAMESPACE_DECL:
dump_decl (t, -1);
break;
@@ -1253,6 +1265,13 @@ dump_expr (t, nop)
OB_PUTCP (digit_buffer);
break;
+ case PTRMEM_CST:
+ OB_PUTC ('&');
+ dump_type (PTRMEM_CST_CLASS (t), 0);
+ OB_PUTS ("::");
+ OB_PUTID (DECL_NAME (PTRMEM_CST_MEMBER (t)));
+ break;
+
case STRING_CST:
{
char *p = TREE_STRING_POINTER (t);
@@ -1332,6 +1351,33 @@ dump_expr (t, nop)
}
break;
+ case NEW_EXPR:
+ {
+ tree type = TREE_OPERAND (t, 1);
+ if (NEW_EXPR_USE_GLOBAL (t))
+ OB_PUTS ("::");
+ OB_PUTS ("new ");
+ if (TREE_OPERAND (t, 0))
+ {
+ OB_PUTC ('(');
+ dump_expr_list (TREE_OPERAND (t, 0));
+ OB_PUTS (") ");
+ }
+ if (TREE_CODE (type) == ARRAY_REF)
+ type = build_cplus_array_type
+ (TREE_OPERAND (type, 0),
+ build_index_type (size_binop (MINUS_EXPR, TREE_OPERAND (type, 1),
+ integer_one_node)));
+ dump_type (type, 0);
+ if (TREE_OPERAND (t, 2))
+ {
+ OB_PUTC ('(');
+ dump_expr_list (TREE_OPERAND (t, 2));
+ OB_PUTC (')');
+ }
+ }
+ break;
+
case TARGET_EXPR:
/* Note that this only works for G++ target exprs. If somebody
builds a general TARGET_EXPR, there's no way to represent that
@@ -1532,10 +1578,14 @@ dump_expr (t, nop)
{
tree ob = TREE_OPERAND (t, 0);
if (TREE_CODE (ob) == NOP_EXPR
- && TREE_OPERAND (ob, 0) == error_mark_node
- && TREE_CODE (TREE_OPERAND (t, 1)) == FUNCTION_DECL)
- /* A::f */
- dump_expr (TREE_OPERAND (t, 1), 0);
+ && TREE_OPERAND (ob, 0) == error_mark_node)
+ {
+ if (TREE_CODE (TREE_OPERAND (t, 1)) == FUNCTION_DECL)
+ /* A::f */
+ dump_expr (TREE_OPERAND (t, 1), 0);
+ else
+ dump_decl (TREE_OPERAND (t, 1), 0);
+ }
else
{
dump_expr (TREE_OPERAND (t, 0), 0);
@@ -1583,6 +1633,11 @@ dump_expr (t, nop)
OB_PUTID (TREE_OPERAND (t, 0));
break;
+ case ARROW_EXPR:
+ dump_expr (TREE_OPERAND (t, 0), nop);
+ OB_PUTS ("->");
+ break;
+
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
if (TREE_CODE (t) == SIZEOF_EXPR)
@@ -1698,7 +1753,7 @@ type_as_string (typ, v)
char *
expr_as_string (decl, v)
tree decl;
- int v;
+ int v ATTRIBUTE_UNUSED;
{
OB_INIT ();
@@ -1738,8 +1793,7 @@ lang_decl_name (decl, v)
OB_INIT ();
- if (v == 1 && DECL_CONTEXT (decl)
- && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (decl))) == 't')
+ if (v == 1 && DECL_CLASS_SCOPE_P (decl))
{
tree cname;
if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -1765,7 +1819,7 @@ char *
cp_file_of (t)
tree t;
{
- if (TREE_CODE (t) == PARM_DECL)
+ if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
return DECL_SOURCE_FILE (DECL_CONTEXT (t));
else if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
return DECL_SOURCE_FILE (TYPE_MAIN_DECL (t));
@@ -1778,7 +1832,7 @@ cp_line_of (t)
tree t;
{
int line = 0;
- if (TREE_CODE (t) == PARM_DECL)
+ if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
line = DECL_SOURCE_LINE (DECL_CONTEXT (t));
if (TREE_CODE (t) == TYPE_DECL && DECL_ARTIFICIAL (t))
t = TREE_TYPE (t);
@@ -1797,7 +1851,7 @@ cp_line_of (t)
char *
code_as_string (c, v)
enum tree_code c;
- int v;
+ int v ATTRIBUTE_UNUSED;
{
return tree_code_name [c];
}
@@ -1805,7 +1859,7 @@ code_as_string (c, v)
char *
language_as_string (c, v)
enum languages c;
- int v;
+ int v ATTRIBUTE_UNUSED;
{
switch (c)
{
@@ -1815,6 +1869,9 @@ language_as_string (c, v)
case lang_cplusplus:
return "C++";
+ case lang_java:
+ return "Java";
+
default:
my_friendly_abort (355);
return 0;
@@ -1825,7 +1882,8 @@ language_as_string (c, v)
char *
parm_as_string (p, v)
- int p, v;
+ int p;
+ int v ATTRIBUTE_UNUSED;
{
if (p < 0)
return "`this'";
@@ -1837,7 +1895,7 @@ parm_as_string (p, v)
char *
op_as_string (p, v)
enum tree_code p;
- int v;
+ int v ATTRIBUTE_UNUSED;
{
static char buf[] = "operator ";
@@ -1851,7 +1909,7 @@ op_as_string (p, v)
char *
assop_as_string (p, v)
enum tree_code p;
- int v;
+ int v ATTRIBUTE_UNUSED;
{
static char buf[] = "operator ";
@@ -1890,7 +1948,7 @@ args_as_string (p, v)
char *
cv_as_string (p, v)
tree p;
- int v;
+ int v ATTRIBUTE_UNUSED;
{
OB_INIT ();
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index d3e9c433244..c21ac240eff 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "defaults.h"
#include "toplev.h"
+#include "eh-common.h"
rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
@@ -44,7 +45,6 @@ tree builtin_return_address_fndecl;
/* A couple of backend routines from m88k.c */
static void push_eh_cleanup PROTO((void));
-static rtx do_function_call PROTO((tree, tree, tree));
static tree build_eh_type_type PROTO((tree));
static tree build_eh_type PROTO((tree));
static void expand_end_eh_spec PROTO((tree));
@@ -52,10 +52,16 @@ static tree call_eh_info PROTO((void));
static void push_eh_info PROTO((void));
static tree get_eh_info PROTO((void));
static tree get_eh_value PROTO((void));
+#if 0
static tree get_eh_type PROTO((void));
+#endif
static tree get_eh_caught PROTO((void));
static tree get_eh_handlers PROTO((void));
static tree do_pop_exception PROTO((void));
+static void process_start_catch_block PROTO((tree, tree));
+static tree build_eh_type_type_ref PROTO((tree));
+static tree build_terminate_handler PROTO((void));
+static tree alloc_eh_object PROTO((tree));
#if 0
/* This is the startup, and finish stuff per exception table. */
@@ -66,14 +72,6 @@ static tree do_pop_exception PROTO((void));
#endif
#ifdef EXCEPT_SECTION_ASM_OP
-typedef struct {
- void *start_region;
- void *end_region;
- void *exception_handler;
- } exception_table;
-#endif /* EXCEPT_SECTION_ASM_OP */
-
-#ifdef EXCEPT_SECTION_ASM_OP
/* on machines which support it, the exception table lives in another section,
but it needs a label so we can reference it... This sets up that
@@ -189,22 +187,6 @@ extern tree const_ptr_type_node;
/* ========================================================================= */
-/* Cheesyness to save some typing. Returns the return value rtx. */
-
-static rtx
-do_function_call (func, params, return_type)
- tree func, params, return_type;
-{
- tree func_call;
- func_call = build_function_call (func, params);
- expand_call (func_call, NULL_RTX, 0);
- if (return_type != NULL_TREE)
- return hard_function_value (return_type, func_call);
- return NULL_RTX;
-}
-
-/* ========================================================================= */
-
/* sets up all the global eh stuff that needs to be initialized at the
start of compilation.
@@ -217,12 +199,19 @@ init_exception_processing ()
/* void vtype () */
tree vtype = build_function_type (void_type_node, void_list_node);
+ if (flag_honor_std)
+ push_namespace (get_identifier ("std"));
Terminate = auto_function (get_identifier ("terminate"),
vtype, NOT_BUILT_IN);
TREE_THIS_VOLATILE (Terminate) = 1;
+ if (flag_honor_std)
+ pop_namespace ();
push_lang_context (lang_name_c);
+ set_exception_lang_code (EH_LANG_C_plus_plus);
+ set_exception_version_code (1);
+
CatchMatch
= builtin_function (flag_rtti
? "__throw_type_match_rtti"
@@ -260,39 +249,63 @@ call_eh_info ()
{
tree fn;
- fn = get_identifier ("__cp_exception_info");
+ fn = get_identifier ("__cp_eh_info");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
- tree t, fields[6];
+ tree t1, t, fields[7];
- /* Declare cp_eh_info * __cp_exception_info (void),
+ /* Declare cp_eh_info * __cp_eh_info (void),
as defined in exception.cc. */
push_obstacks_nochange ();
end_temporary_allocation ();
/* struct cp_eh_info. This must match exception.cc. Note that this
type is not pushed anywhere. */
+ t1= make_lang_type (RECORD_TYPE);
+ fields[0] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("handler_label"), ptr_type_node);
+ fields[1] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("dynamic_handler_chain"), ptr_type_node);
+ fields[2] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("info"), ptr_type_node);
+ /* N.B.: The fourth field LEN is expected to be
+ the number of fields - 1, not the total number of fields. */
+ finish_builtin_type (t1, "eh_context", fields, 2, ptr_type_node);
+ t1 = build_pointer_type (t1);
+
+ t1= make_lang_type (RECORD_TYPE);
+ fields[0] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("match_function"), ptr_type_node);
+ fields[1] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("language"), short_integer_type_node);
+ fields[2] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("version"), short_integer_type_node);
+ /* N.B.: The fourth field LEN is expected to be
+ the number of fields - 1, not the total number of fields. */
+ finish_builtin_type (t1, "__eh_info", fields, 2, ptr_type_node);
t = make_lang_type (RECORD_TYPE);
- fields[0] = build_lang_field_decl (FIELD_DECL, get_identifier ("value"),
+ fields[0] = build_lang_field_decl (FIELD_DECL,
+ get_identifier ("eh_info"), t1);
+ fields[1] = build_lang_field_decl (FIELD_DECL, get_identifier ("value"),
ptr_type_node);
- fields[1] = build_lang_field_decl (FIELD_DECL, get_identifier ("type"),
+ fields[2] = build_lang_field_decl (FIELD_DECL, get_identifier ("type"),
ptr_type_node);
- fields[2] = build_lang_field_decl
+ fields[3] = build_lang_field_decl
(FIELD_DECL, get_identifier ("cleanup"),
build_pointer_type (build_function_type
(ptr_type_node, tree_cons
(NULL_TREE, ptr_type_node, void_list_node))));
- fields[3] = build_lang_field_decl (FIELD_DECL, get_identifier ("caught"),
+ fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("caught"),
boolean_type_node);
- fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("next"),
+ fields[5] = build_lang_field_decl (FIELD_DECL, get_identifier ("next"),
build_pointer_type (t));
- fields[5] = build_lang_field_decl
+ fields[6] = build_lang_field_decl
(FIELD_DECL, get_identifier ("handlers"), long_integer_type_node);
/* N.B.: The fourth field LEN is expected to be
the number of fields - 1, not the total number of fields. */
- finish_builtin_type (t, "cp_eh_info", fields, 5, ptr_type_node);
+ finish_builtin_type (t, "cp_eh_info", fields, 6, ptr_type_node);
t = build_pointer_type (t);
/* And now the function. */
@@ -348,12 +361,14 @@ get_eh_value ()
/* Returns a reference to the current exception type. */
+#if 0
static tree
get_eh_type ()
{
return build_component_ref (get_eh_info (), get_identifier ("type"),
NULL_TREE, 0);
}
+#endif
/* Returns a reference to whether or not the current exception
has been caught. */
@@ -405,6 +420,47 @@ build_eh_type_type (type)
return build1 (ADDR_EXPR, ptr_type_node, exp);
}
+/* Build the address of a runtime type for use in the runtime matching
+ field of the new exception model */
+
+static tree
+build_eh_type_type_ref (type)
+ tree type;
+{
+ char *typestring;
+ tree exp;
+
+ if (type == error_mark_node)
+ return error_mark_node;
+
+ /* peel back references, so they match. */
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ type = TREE_TYPE (type);
+
+ /* Peel off cv qualifiers. */
+ type = TYPE_MAIN_VARIANT (type);
+
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+
+ if (flag_rtti)
+ {
+ exp = get_tinfo_fn (type);
+ TREE_USED (exp) = 1;
+ mark_inline_for_output (exp);
+ exp = build1 (ADDR_EXPR, ptr_type_node, exp);
+ }
+ else
+ {
+ typestring = build_overload_name (type, 1, 1);
+ exp = combine_strings (build_string (strlen (typestring)+1, typestring));
+ exp = build1 (ADDR_EXPR, ptr_type_node, exp);
+ }
+ pop_obstacks ();
+ return (exp);
+}
+
+
/* Build a type value for use at runtime for a exp that is thrown or
matched against by the exception handling system. */
@@ -420,6 +476,34 @@ build_eh_type (exp)
return build_eh_type_type (TREE_TYPE (exp));
}
+/* This routine is called to mark all the symbols representing runtime
+ type functions in the exception table as haveing been referenced.
+ This will make sure code is emitted for them. Called from finish_file. */
+void
+mark_all_runtime_matches ()
+{
+ int x,num;
+ void **ptr;
+ tree exp;
+
+ num = find_all_handler_type_matches (&ptr);
+ if (num == 0 || ptr == NULL)
+ return;
+
+ for (x=0; x <num; x++)
+ {
+ exp = (tree) ptr[x];
+ if (TREE_CODE (exp) == ADDR_EXPR)
+ {
+ exp = TREE_OPERAND (exp, 0);
+ if (TREE_CODE (exp) == FUNCTION_DECL)
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (exp)) = 1;
+ }
+ }
+
+ free (ptr);
+}
+
/* Build up a call to __cp_pop_exception, to destroy the exception object
for the current catch block. HANDLER is either true or false, telling
the library whether or not it is being called from an exception handler;
@@ -477,7 +561,7 @@ push_eh_cleanup ()
/* Build up a call to terminate on the function obstack, for use as an
exception handler. */
-tree
+static tree
build_terminate_handler ()
{
int yes = suspend_momentary ();
@@ -486,7 +570,7 @@ build_terminate_handler ()
return term;
}
-/* call this to start a catch block. Typename is the typename, and identifier
+/* Call this to start a catch block. Typename is the typename, and identifier
is the variable to place the object in or NULL if the variable doesn't
matter. If typename is NULL, that means its a "catch (...)" or catch
everything. In that case we don't need to do any type checking.
@@ -496,9 +580,7 @@ void
expand_start_catch_block (declspecs, declarator)
tree declspecs, declarator;
{
- rtx false_label_rtx;
- tree decl = NULL_TREE;
- tree init;
+ tree decl;
if (processing_template_decl)
{
@@ -518,17 +600,27 @@ expand_start_catch_block (declspecs, declarator)
if (! doing_eh (1))
return;
+ process_start_catch_block (declspecs, declarator);
+}
+
+
+/* This function performs the expand_start_catch_block functionality for
+ exceptions implemented in the new style. __throw determines whether
+ a handler needs to be called or not, so the handler itself has to do
+ nothing additional. */
+
+static void
+process_start_catch_block (declspecs, declarator)
+ tree declspecs, declarator;
+{
+ tree decl = NULL_TREE;
+ tree init;
+
/* Create a binding level for the eh_info and the exception object
cleanup. */
pushlevel (0);
expand_start_bindings (0);
- false_label_rtx = gen_label_rtx ();
- push_label_entry (&false_label_stack, false_label_rtx, NULL_TREE);
-
- emit_line_note (input_filename, lineno);
-
- push_eh_info ();
if (declspecs)
{
@@ -539,9 +631,17 @@ expand_start_catch_block (declspecs, declarator)
}
if (decl)
+ start_catch_handler (build_eh_type_type_ref (TREE_TYPE (decl)));
+ else
+ start_catch_handler (CATCH_ALL_TYPE);
+
+ emit_line_note (input_filename, lineno);
+
+ push_eh_info ();
+
+ if (decl)
{
tree exp;
- rtx call_rtx, return_value_rtx;
tree init_type;
/* Make sure we mark the catch param as used, otherwise we'll get
@@ -562,22 +662,7 @@ expand_start_catch_block (declspecs, declarator)
&& TREE_CODE (TREE_TYPE (init_type)) == POINTER_TYPE)
exp = build_unary_op (ADDR_EXPR, exp, 1);
- exp = expr_tree_cons (NULL_TREE,
- build_eh_type_type (TREE_TYPE (decl)),
- expr_tree_cons (NULL_TREE,
- get_eh_type (),
- expr_tree_cons (NULL_TREE, exp, NULL_TREE)));
- exp = build_function_call (CatchMatch, exp);
- call_rtx = expand_call (exp, NULL_RTX, 0);
-
- return_value_rtx = hard_function_value (ptr_type_node, exp);
-
- /* did the throw type match function return TRUE? */
- emit_cmp_insn (return_value_rtx, const0_rtx, EQ, NULL_RTX,
- GET_MODE (return_value_rtx), 0, 0);
-
- /* if it returned FALSE, jump over the catch block, else fall into it */
- emit_jump_insn (gen_beq (false_label_rtx));
+ exp = ocp_convert (init_type , exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0);
push_eh_cleanup ();
@@ -585,7 +670,7 @@ expand_start_catch_block (declspecs, declarator)
pushlevel (0);
expand_start_bindings (0);
- init = convert_from_reference (make_tree (init_type, call_rtx));
+ init = convert_from_reference (exp);
/* If the constructor for the catch parm exits via an exception, we
must call terminate. See eh23.C. */
@@ -603,6 +688,7 @@ expand_start_catch_block (declspecs, declarator)
DECL_INITIAL (decl) = init;
decl = pushdecl (decl);
+ start_decl_1 (decl);
cp_finish_decl (decl, init, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
}
else
@@ -623,7 +709,6 @@ expand_start_catch_block (declspecs, declarator)
}
-
/* Call this to end a catch block. Its responsible for emitting the
code to handle jumping back to the correct place, and for emitting
the label to jump to if this catch block didn't match. */
@@ -647,9 +732,7 @@ expand_end_catch_block ()
documentation. */
expand_goto (top_label_entry (&caught_return_label_stack));
- /* label we emit to jump to if this catch block didn't match. */
- /* This the closing } in the `if (eq) {' of the documentation. */
- emit_label (pop_label_entry (&false_label_stack));
+ end_catch_handler ();
}
/* An exception spec is implemented more or less like:
@@ -838,7 +921,7 @@ end_anon_func ()
/* Return a pointer to a buffer for an exception object of type TYPE. */
-tree
+static tree
alloc_eh_object (type)
tree type;
{
@@ -1067,13 +1150,18 @@ tree
build_throw (e)
tree e;
{
- if (e != error_mark_node)
- {
- if (processing_template_decl)
- return build_min (THROW_EXPR, void_type_node, e);
- e = build1 (THROW_EXPR, void_type_node, e);
- TREE_SIDE_EFFECTS (e) = 1;
- TREE_USED (e) = 1;
- }
+ if (e == error_mark_node)
+ return e;
+
+ if (processing_template_decl)
+ return build_min (THROW_EXPR, void_type_node, e);
+
+ if (e == null_node)
+ cp_warning ("throwing NULL, which has integral, not pointer type");
+
+ e = build1 (THROW_EXPR, void_type_node, e);
+ TREE_SIDE_EFFECTS (e) = 1;
+ TREE_USED (e) = 1;
+
return e;
}
diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc
index 8072e5c4549..05b431521cc 100644
--- a/gcc/cp/exception.cc
+++ b/gcc/cp/exception.cc
@@ -30,14 +30,16 @@
#include "typeinfo"
#include "exception"
#include <stddef.h>
+#include "eh-common.h"
/* Define terminate, unexpected, set_terminate, set_unexpected as
well as the default terminate func and default unexpected func. */
-extern terminate_handler __terminate_func __attribute__((__noreturn__));
+extern std::terminate_handler __terminate_func __attribute__((__noreturn__));
+using std::terminate;
void
-terminate ()
+std::terminate ()
{
__terminate_func ();
}
@@ -48,29 +50,29 @@ __default_unexpected ()
terminate ();
}
-static unexpected_handler __unexpected_func __attribute__((__noreturn__))
+static std::unexpected_handler __unexpected_func __attribute__((__noreturn__))
= __default_unexpected;
-terminate_handler
-set_terminate (terminate_handler func)
+std::terminate_handler
+std::set_terminate (std::terminate_handler func)
{
- terminate_handler old = __terminate_func;
+ std::terminate_handler old = __terminate_func;
__terminate_func = func;
return old;
}
-unexpected_handler
-set_unexpected (unexpected_handler func)
+std::unexpected_handler
+std::set_unexpected (std::unexpected_handler func)
{
- unexpected_handler old = __unexpected_func;
+ std::unexpected_handler old = __unexpected_func;
__unexpected_func = func;
return old;
}
void
-unexpected ()
+std::unexpected ()
{
__unexpected_func ();
}
@@ -84,12 +86,14 @@ unexpected ()
struct cp_eh_info
{
+ __eh_info eh_info;
void *value;
void *type;
void (*cleanup)(void *, int);
bool caught;
cp_eh_info *next;
long handlers;
+ void *original_value;
};
/* Language-specific EH info pointer, defined in libgcc2. */
@@ -100,11 +104,23 @@ extern "C" cp_eh_info **__get_eh_info (); // actually void **
extern bool __is_pointer (void *);
+
+/* OLD Compiler hook to return a pointer to the info for the current exception.
+ Used by get_eh_info (). This fudges the actualy returned value to
+ point to the beginning of what USE to be the cp_eh_info structure.
+ THis is so that old code that dereferences this pointer will find
+ things where it expects it to be.*/
+extern "C" void *
+__cp_exception_info (void)
+{
+ return &((*__get_eh_info ())->value);
+}
+
/* Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). */
extern "C" cp_eh_info *
-__cp_exception_info (void)
+__cp_eh_info (void)
{
return *__get_eh_info ();
}
@@ -132,6 +148,34 @@ __eh_free (void *p)
free (p);
}
+
+typedef void * (* rtimetype) (void);
+
+extern "C" void *
+__cplus_type_matcher (cp_eh_info *info, rtimetype match_info,
+ exception_descriptor *exception_table)
+{
+ void *ret;
+
+ /* No exception table implies the old style mechanism, so don't check. */
+ if (exception_table != NULL
+ && exception_table->lang.language != EH_LANG_C_plus_plus)
+ return NULL;
+
+ if (match_info == CATCH_ALL_TYPE)
+ return info->value;
+
+ /* we don't worry about version info yet, there is only one version! */
+
+ void *match_type = match_info ();
+ ret = __throw_type_match_rtti (match_type, info->type, info->original_value);
+ /* change value of exception */
+ if (ret)
+ info->value = ret;
+ return ret;
+}
+
+
/* Compiler hook to push a new exception onto the stack.
Used by expand_throw(). */
@@ -145,6 +189,11 @@ __cp_push_exception (void *value, void *type, void (*cleanup)(void *, int))
p->cleanup = cleanup;
p->handlers = 0;
p->caught = false;
+ p->original_value = value;
+
+ p->eh_info.match_function = __cplus_type_matcher;
+ p->eh_info.language = EH_LANG_C_plus_plus;
+ p->eh_info.version = 1;
cp_eh_info **q = __get_eh_info ();
@@ -192,7 +241,7 @@ __cp_pop_exception (cp_eh_info *p)
extern "C" void
__uncatch_exception (void)
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
if (p == 0)
terminate ();
p->caught = false;
@@ -213,7 +262,7 @@ __uncatch_exception (void)
extern "C" void
__check_eh_spec (int n, const void **spec)
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
for (int i = 0; i < n; ++i)
{
@@ -223,7 +272,7 @@ __check_eh_spec (int n, const void **spec)
try
{
- unexpected ();
+ std::unexpected ();
}
catch (...)
{
@@ -238,11 +287,11 @@ __check_eh_spec (int n, const void **spec)
}
}
- const type_info &bad_exc = typeid (bad_exception);
+ const std::type_info &bad_exc = typeid (std::bad_exception);
for (int i = 0; i < n; ++i)
{
if (__throw_type_match_rtti (spec[i], &bad_exc, p->value))
- throw bad_exception ();
+ throw std::bad_exception ();
}
terminate ();
@@ -252,25 +301,25 @@ __check_eh_spec (int n, const void **spec)
extern "C" void
__throw_bad_cast (void)
{
- throw bad_cast ();
+ throw std::bad_cast ();
}
extern "C" void
__throw_bad_typeid (void)
{
- throw bad_typeid ();
+ throw std::bad_typeid ();
}
/* Has the current exception been caught? */
bool
-uncaught_exception ()
+std::uncaught_exception ()
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
return p && ! p->caught;
}
-const char * exception::
+const char * std::exception::
what () const
{
return typeid (*this).name ();
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 4c3d8b602ce..056f4d1f16a 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -148,7 +148,7 @@ cplus_expand_expr (exp, target, tmode, modifier)
init = convert_from_reference (init);
flag_access_control = 0;
- expand_aggr_init (slot, init, 0, LOOKUP_ONLYCONVERTING);
+ expand_aggr_init (slot, init, LOOKUP_ONLYCONVERTING);
flag_access_control = old_ac;
if (TYPE_NEEDS_DESTRUCTOR (type))
@@ -162,19 +162,43 @@ cplus_expand_expr (exp, target, tmode, modifier)
return DECL_RTL (slot);
}
+ case PTRMEM_CST:
+ {
+ tree member;
+ tree offset;
+
+ /* Find the member. */
+ member = PTRMEM_CST_MEMBER (exp);
+
+ if (TREE_CODE (member) == FIELD_DECL)
+ {
+ /* Find the offset for the field. */
+ offset = convert (sizetype,
+ size_binop (EASY_DIV_EXPR,
+ DECL_FIELD_BITPOS (member),
+ size_int (BITS_PER_UNIT)));
+
+ /* We offset all pointer to data members by 1 so that we
+ can distinguish between a null pointer to data member
+ and the first data member of a structure. */
+ offset = size_binop (PLUS_EXPR, offset, size_int (1));
+
+ return expand_expr (cp_convert (type, offset), target, tmode,
+ modifier);
+ }
+ else
+ {
+ /* We don't yet handle pointer-to-member functions this
+ way. */
+ my_friendly_abort (0);
+ return 0;
+ }
+ }
+
case OFFSET_REF:
{
-#if 1
return expand_expr (default_conversion (resolve_offset_ref (exp)),
target, tmode, EXPAND_NORMAL);
-#else
- /* This is old crusty code, and does not handle all that the
- resolve_offset_ref function does. (mrs) */
- tree base = build_unary_op (ADDR_EXPR, TREE_OPERAND (exp, 0), 0);
- tree offset = build_unary_op (ADDR_EXPR, TREE_OPERAND (exp, 1), 0);
- return expand_expr (build (PLUS_EXPR, TREE_TYPE (exp), base, offset),
- target, tmode, EXPAND_NORMAL);
-#endif
}
case THUNK_DECL:
@@ -304,7 +328,7 @@ extract_scalar_init (decl, init)
int
extract_init (decl, init)
- tree decl, init;
+ tree decl ATTRIBUTE_UNUSED, init ATTRIBUTE_UNUSED;
{
return 0;
@@ -405,8 +429,5 @@ do_case (start, end)
cp_error ("case label `%E' within scope of cleanup or variable array", start);
}
}
- if (start)
- define_case_label (label);
- else
- define_case_label (NULL_TREE);
+ define_case_label ();
}
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 8538ba362fe..acb9657d666 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -64,27 +64,35 @@ is_friend (type, supplicant)
tree friends = TREE_VALUE (list);
for (; friends ; friends = TREE_CHAIN (friends))
{
- if (ctype == TREE_PURPOSE (friends))
+ if (comptypes (ctype, TREE_PURPOSE (friends), 1))
return 1;
if (TREE_VALUE (friends) == NULL_TREE)
continue;
- if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL)
- {
- if (is_specialization_of (supplicant,
- TREE_VALUE (friends)))
- return 1;
-
- continue;
- }
-
- /* FIXME: The use of comptypes here is bogus, since
- two specializations of a template with non-type
- parameters may have the same type, but be
- different. */
- if (comptypes (TREE_TYPE (supplicant),
- TREE_TYPE (TREE_VALUE (friends)), 1))
+ if (supplicant == TREE_VALUE (friends))
+ return 1;
+
+ /* With -fguiding-decls we are more lenient about
+ friendship. This is bogus in general since two
+ specializations of a template with non-type
+ template parameters may have the same type, but
+ be different.
+
+ Temporarily, we are also more lenient to deal
+ with nested friend functions, for which there can
+ be more than one FUNCTION_DECL, despite being the
+ same function. When that's fixed, the
+ FUNCTION_MEMBER_P bit can go. */
+ if ((flag_guiding_decls
+ || DECL_FUNCTION_MEMBER_P (supplicant))
+ && comptypes (TREE_TYPE (supplicant),
+ TREE_TYPE (TREE_VALUE (friends)), 1))
+ return 1;
+
+ if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL
+ && is_specialization_of (supplicant,
+ TREE_VALUE (friends)))
return 1;
}
break;
@@ -102,10 +110,9 @@ is_friend (type, supplicant)
{
tree t = TREE_VALUE (list);
- if (supplicant == t
- || (CLASSTYPE_IS_TEMPLATE (t)
- && is_specialization_of (TYPE_MAIN_DECL (supplicant),
- CLASSTYPE_TI_TEMPLATE (t))))
+ if (TREE_CODE (t) == TEMPLATE_DECL ?
+ is_specialization_of (TYPE_MAIN_DECL (supplicant), t) :
+ comptypes (supplicant, t, 1))
return 1;
}
}
@@ -118,6 +125,10 @@ is_friend (type, supplicant)
else
context = NULL_TREE;
+ /* A namespace is not friend to anybody. */
+ if (context && TREE_CODE (context) == NAMESPACE_DECL)
+ context = NULL_TREE;
+
if (context)
return is_friend (type, context);
@@ -237,6 +248,7 @@ make_friend_class (type, friend_type)
tree type, friend_type;
{
tree classes;
+ int is_template_friend;
if (IS_SIGNATURE (type))
{
@@ -249,25 +261,48 @@ make_friend_class (type, friend_type)
IDENTIFIER_POINTER (TYPE_IDENTIFIER (friend_type)));
return;
}
- /* If the TYPE is a template then it makes sense for it to be
- friends with itself; this means that each instantiation is
- friends with all other instantiations. */
- if (type == friend_type && !CLASSTYPE_IS_TEMPLATE (type))
+
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type)
+ && uses_template_parms (friend_type))
+ {
+ /* [temp.friend]
+
+ Friend declarations shall not declare partial
+ specializations. */
+ cp_error ("partial specialization `%T' declared `friend'",
+ friend_type);
+ return;
+ }
+
+ if (processing_template_decl > template_class_depth (type))
+ /* If the TYPE is a template then it makes sense for it to be
+ friends with itself; this means that each instantiation is
+ friends with all other instantiations. */
+ is_template_friend = 1;
+ else if (comptypes (type, friend_type, 1))
{
pedwarn ("class `%s' is implicitly friends with itself",
TYPE_NAME_STRING (type));
return;
}
+ else
+ is_template_friend = 0;
+
+ GNU_xref_hier (type, friend_type, 0, 0, 1);
- GNU_xref_hier (TYPE_NAME_STRING (type),
- TYPE_NAME_STRING (friend_type), 0, 0, 1);
+ if (is_template_friend)
+ friend_type = CLASSTYPE_TI_TEMPLATE (friend_type);
classes = CLASSTYPE_FRIEND_CLASSES (type);
- while (classes && TREE_VALUE (classes) != friend_type)
+ while (classes
+ /* Stop if we find the same type on the list. */
+ && !(TREE_CODE (TREE_VALUE (classes)) == TEMPLATE_DECL ?
+ friend_type == TREE_VALUE (classes) :
+ comptypes (TREE_VALUE (classes), friend_type, 1)))
classes = TREE_CHAIN (classes);
- if (classes)
- warning ("class `%s' is already friends with class `%s'",
- TYPE_NAME_STRING (TREE_VALUE (classes)), TYPE_NAME_STRING (type));
+ if (classes)
+ cp_warning ("`%T' is already a friend of `%T'",
+ TREE_VALUE (classes), type);
else
{
CLASSTYPE_FRIEND_CLASSES (type)
@@ -307,9 +342,17 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
/* Every decl that gets here is a friend of something. */
DECL_FRIEND_P (decl) = 1;
+ if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR)
+ {
+ declarator = TREE_OPERAND (declarator, 0);
+ if (TREE_CODE (declarator) == LOOKUP_EXPR)
+ declarator = TREE_OPERAND (declarator, 0);
+ if (is_overloaded_fn (declarator))
+ declarator = DECL_NAME (get_first_fn (declarator));
+ }
+
if (TREE_CODE (decl) == FUNCTION_DECL)
- is_friend_template = processing_template_decl >
- template_class_depth (current_class_type);
+ is_friend_template = PROCESSING_REAL_TEMPLATE_DECL_P ();
if (ctype)
{
@@ -324,23 +367,27 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
DECL_CONSTRUCTOR_P (decl) = 1;
/* This will set up DECL_ARGUMENTS for us. */
- grokclassfn (ctype, cname, decl, flags, quals);
+ grokclassfn (ctype, decl, flags, quals);
if (is_friend_template)
decl = DECL_TI_TEMPLATE (push_template_decl (decl));
- if (TYPE_SIZE (ctype) != 0
- && template_class_depth (ctype) == 0)
- decl = check_classfn (ctype, decl);
-
- if (TREE_TYPE (decl) != error_mark_node)
+ /* A nested class may declare a member of an enclosing class
+ to be a friend, so we do lookup here even if CTYPE is in
+ the process of being defined. */
+ if (TYPE_SIZE (ctype) != 0 || TYPE_BEING_DEFINED (ctype))
{
- if (TYPE_SIZE (ctype) || template_class_depth (ctype) > 0)
+ /* But, we defer looup in template specializations until
+ they are fully specialized. */
+ if (template_class_depth (ctype) == 0)
+ decl = check_classfn (ctype, decl);
+
+ if (decl)
add_friend (current_class_type, decl);
- else
- cp_error ("member `%D' declared as friend before type `%T' defined",
- decl, ctype);
}
+ else
+ cp_error ("member `%D' declared as friend before type `%T' defined",
+ decl, ctype);
}
else
{
@@ -353,16 +400,13 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
if (fields)
add_friends (current_class_type, declarator, ctype);
else
- error ("method `%s' is not a member of class `%s'",
- IDENTIFIER_POINTER (declarator),
- IDENTIFIER_POINTER (cname));
+ cp_error ("method `%D' is not a member of class `%T'",
+ declarator, ctype);
decl = void_type_node;
}
}
else if (TREE_CODE (decl) == FUNCTION_DECL
- && ((IDENTIFIER_LENGTH (declarator) == 4
- && IDENTIFIER_POINTER (declarator)[0] == 'm'
- && ! strcmp (IDENTIFIER_POINTER (declarator), "main"))
+ && (MAIN_NAME_P (declarator)
|| (IDENTIFIER_LENGTH (declarator) > 10
&& IDENTIFIER_POINTER (declarator)[0] == '_'
&& IDENTIFIER_POINTER (declarator)[1] == '_'
@@ -384,9 +428,7 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
Note that because classes all wind up being top-level
in their scope, their friend wind up in top-level scope as well. */
- DECL_ASSEMBLER_NAME (decl)
- = build_decl_overload (declarator, TYPE_ARG_TYPES (TREE_TYPE (decl)),
- TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE);
+ set_mangled_name_for_decl (decl);
DECL_ARGUMENTS (decl) = parmdecls;
if (funcdef_flag)
DECL_CLASS_CONTEXT (decl) = current_class_type;
@@ -394,22 +436,20 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
if (! DECL_USE_TEMPLATE (decl))
{
/* We can call pushdecl here, because the TREE_CHAIN of this
- FUNCTION_DECL is not needed for other purposes. Don't do this
- for a template instantiation. */
- if (!is_friend_template)
- {
- /* However, we don't call pushdecl() for a friend
- function of a template class, since in general,
- such a declaration depends on template
- parameters. Instead, we call pushdecl when the
- class is instantiated. */
- if (template_class_depth (current_class_type) == 0)
- decl = pushdecl (decl);
- }
+ FUNCTION_DECL is not needed for other purposes. Don't do
+ this for a template instantiation. However, we don't
+ call pushdecl() for a friend function of a template
+ class, since in general, such a declaration depends on
+ template parameters. Instead, we call pushdecl when the
+ class is instantiated. */
+ if (!is_friend_template
+ && template_class_depth (current_class_type) == 0)
+ decl = pushdecl (decl);
else
- decl = push_template_decl (decl);
+ decl = push_template_decl_real (decl, /*is_friend=*/1);
- if (! funcdef_flag && ! flag_guiding_decls && ! is_friend_template
+ if (warn_nontemplate_friend
+ && ! funcdef_flag && ! flag_guiding_decls && ! is_friend_template
&& current_template_parms && uses_template_parms (decl))
{
static int explained;
@@ -417,8 +457,10 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
warning (" declares a non-template function");
if (! explained)
{
- warning (" unless you compile with -fguiding-decls");
- warning (" or add <> after the function name");
+ warning (" (if this is not what you intended, make sure");
+ warning (" the function template has already been declared,");
+ warning (" and add <> after the function name here)");
+ warning (" -Wno-non-template-friend disables this warning.");
explained = 1;
}
}
@@ -436,9 +478,8 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
tree decl = lookup_name_nonclass (declarator);
if (decl == NULL_TREE)
{
- warning ("implicitly declaring `%s' as struct",
- IDENTIFIER_POINTER (declarator));
- decl = xref_tag (record_type_node, declarator, NULL_TREE, 1);
+ cp_warning ("implicitly declaring `%T' as struct", declarator);
+ decl = xref_tag (record_type_node, declarator, 1);
decl = TYPE_MAIN_DECL (decl);
}
@@ -446,9 +487,8 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag)
but not if those functions are really class names. */
if (TREE_CODE (decl) == TREE_LIST && TREE_TYPE (TREE_PURPOSE (decl)))
{
- warning ("`friend %s' archaic, use `friend class %s' instead",
- IDENTIFIER_POINTER (declarator),
- IDENTIFIER_POINTER (declarator));
+ cp_warning ("`friend %T' archaic, use `friend class %T' instead",
+ declarator, declarator);
decl = TREE_TYPE (TREE_PURPOSE (decl));
}
diff --git a/gcc/cp/g++.1 b/gcc/cp/g++.1
index ae016fad082..5101d5fc1f6 100644
--- a/gcc/cp/g++.1
+++ b/gcc/cp/g++.1
@@ -430,38 +430,6 @@ differently depending on whether `\|\c
testing both of these predefined macros you can distinguish four
situations: GNU C, traditional GNU C, other ANSI C compilers, and
other old C compilers.
-.TP
-\ \ \ \(bu
-In the preprocessor, comments convert to nothing at all, rather than
-to a space. This allows traditional token concatenation.
-.TP
-\ \ \ \(bu
-In the preprocessor, macro arguments are recognized within string
-constants in a macro definition (and their values are stringified,
-though without additional quote marks, when they appear in such a
-context). The preprocessor always considers a string constant to end
-at a newline.
-.TP
-\ \ \ \(bu
-The preprocessor does not predefine the macro \c
-.B __STDC__\c
-\& when you use
-`\|\c
-.B \-traditional\c
-\&\|', but still predefines\c
-.B __GNUC__\c
-\& (since the GNU extensions indicated by
-.B __GNUC__\c
-\& are not affected by
-`\|\c
-.B \-traditional\c
-\&\|'). If you need to write header files that work
-differently depending on whether `\|\c
-.B \-traditional\c
-\&\|' is in use, by
-testing both of these predefined macros you can distinguish four
-situations: GNU C, traditional GNU C, other ANSI C compilers, and
-other old C compilers.
.PP
.TP
\ \ \ \(bu
diff --git a/gcc/cp/g++FAQ.texi b/gcc/cp/g++FAQ.texi
index df1838a6bb8..3cbec50459c 100644
--- a/gcc/cp/g++FAQ.texi
+++ b/gcc/cp/g++FAQ.texi
@@ -3,7 +3,7 @@
@setfilename g++FAQ.info
@settitle Frequently asked questions about the GNU C++ compiler
@setchapternewpage off
-@c version: @(#)g++FAQ.texi 1.60 01/31/98
+@c version: %W% %G%
@c %**end of header
@iftex
@@ -12,7 +12,7 @@
@titlepage
@title G++ FAQ
@subtitle Frequently asked questions about the GNU C++ compiler
-@subtitle January 31, 1998
+@subtitle June 8, 1998
@sp 1
@author Joe Buck
@page
@@ -35,10 +35,6 @@ all those who sent suggestions for improvements. Thanks to Marcus Speh
for doing the index. A hypertext version is available on the World Wide
Web at @file{http://www.cygnus.com/misc/g++FAQ_toc.html}.
-@strong{News flash}: gcc 2.8.0 has finally been released!
-This FAQ still has much material that refers to older releases; it will
-take some time before it is completely "modernized".
-
Please send updates and corrections to the FAQ to
@code{jbuck@@synopsys.com}. Please do @emph{not} use me as a resource
to get your questions answered; that's what @file{gnu.g++.help} is for and I
@@ -63,91 +59,92 @@ You can find this FAQ at
or in HTML form at @file{http://www.cerfnet.com/~mpcline/On-Line-C++-FAQs/}.
@menu
-* basics:: What is g++? How do I get it?
-* egcs and 2.8.0:: The next generation(s) of g++
-* installation:: How to install, installation problems
-* evolution:: The Evolution of g++
-* User Problems:: Commonly reported problems and bugs
-* legalities:: Lawyer stuff, GPL, LGPL, etc.
-* index:: Index of terms
+* basics:: What is g++? How do I get it?
+* egcs and 2.8.x:: The next generation(s) of g++
+* installation:: How to install, installation problems
+* evolution:: The Evolution of g++
+* User Problems:: Commonly reported problems and bugs
+* legalities:: Lawyer stuff, GPL, LGPL, etc.
+* index:: Index of terms
--- The Detailed Node Listing ---
The basics: what is g++?
-* latest versions::
-* g++ for Unix::
-* g++ for HP::
-* g++ for Solaris 2.x::
-* g++ for other platforms::
-* 1.x vs 2.x versions::
+* latest versions:: What are the latest versions of g++ and libraries?
+* g++ for Unix:: How do I get g++ for Unix?
+* getting-egcs:: How do I get egcs?
+* g++ for HP::
+* g++ for Solaris 2.x::
+* g++ for other platforms::
+* 1.x vs 2.x versions::
The Next Generation(s) of g++
-* new-in-2.8.0:: What's new in gcc 2.8.0?
-* egcs-intro:: What is egcs?
-* egcs-whats-new:: What's new in egcs vs 2.7.2?
-* egcs-bug-fixes:: What was fixed in egcs-1.0.1?
-* egcs-linux:: If I install on Linux, will it overwrite my libraries?
-* egcs-run-both:: How can I run both egcs and an FSF release?
-* egcs-vs-2.8.0:: How will egcs affect 2.8.0?
-* egcs-robustness:: How robust is egcs?
+* new-in-2.8.x:: What's new in gcc 2.8.x?
+* egcs-intro:: What is egcs?
+* egcs-whats-new:: What's new in egcs vs 2.7.2?
+* egcs-bug-fixes:: What was fixed in the latest egcs releases?
+* egcs-linux:: If I install on Linux, will it overwrite my libraries?
+* egcs-run-both:: How can I run both egcs and an FSF release?
+* egcs-vs-2.8.x:: How will egcs affect 2.8.x?
+* egcs-robustness:: How robust is egcs?
Installation Issues and Problems
-* gcc-2 + g++-1::
-* what else do I need?::
-* use GNU linker?::
-* Use GNU assembler?::
-* shared libraries::
-* repository::
-* repo bugs::
-* Use GNU C library?::
+* gcc-2 + g++-1::
+* what else do I need?::
+* use GNU linker?::
+* Use GNU assembler?::
+* shared libraries::
+* repository::
+* repo bugs::
+* Use GNU C library?::
* Global constructor problems::
-* Strange assembler errors::
+* Strange assembler errors::
* Other problems building libg++::
-* More size_t problems::
-* Rebuild libg++?::
-* co-existing versions::
-* Installing on Linux::
-* Linux Slackware 3.0::
+* More size_t problems::
+* Rebuild libg++?::
+* co-existing versions::
+* Installing on Linux::
+* Linux Slackware 3.0::
The Evolution of g++
-* version 2.7.x:: What's changed in 2.7.x from earlier versions
-* libstdc++::
+* version 2.7.x:: What's changed in 2.7.x from earlier versions
+* libstdc++::
User Problems
-* missing virtual table::
-* for scope::
-* const constructor::
-* unused parameter warnings::
+* missing virtual table::
+* for scope::
+* const constructor::
+* unused parameter warnings::
* jump crosses initialization::
-* Demangler::
-* static data members::
-* internal compiler error::
-* bug reports::
-* porting to g++::
-* name mangling::
+* Demangler::
+* static data members::
+* internal compiler error::
+* bug reports::
+* porting to g++::
+* name mangling::
* problems linking with other libraries::
-* documentation::
-* templates::
-* undefined templates::
-* redundant templates::
-* Standard Template Library::
-* STL and string::
-* exceptions::
-* namespaces::
-* agreement with standards::
+* documentation::
+* templates::
+* undefined templates::
+* redundant templates::
+* Standard Template Library::
+* STL and string::
+* exceptions::
+* namespaces::
+* agreement with standards::
* compiling standard libraries::
-* debugging on SVR4 systems::
+* debugging on SVR4 systems::
* debugging problems on Solaris::
-* X11 conflicts with libg++::
-* assignment to streams::
+* X11 conflicts with libg++::
+* assignment to streams::
@end menu
-@node basics, egcs and 2.8.0, Top, Top
+@node basics, egcs and 2.8.x, Top, Top
@chapter The basics: what is g++?
@cindex Free Software Foundation
@@ -165,12 +162,13 @@ it is not public domain, but is protected by the GNU Public License,
or GPL (@pxref{legalities}).
@menu
-* latest versions::
-* g++ for Unix::
-* g++ for HP::
-* g++ for Solaris 2.x::
-* g++ for other platforms::
-* 1.x vs 2.x versions::
+* latest versions:: What is the latest version of gcc/g++/libg++?
+* g++ for Unix:: How do I get a copy of g++ for Unix?
+* getting-egcs:: How do I get egcs?
+* g++ for HP:: Getting g++ for the HP precision architecture
+* g++ for Solaris 2.x:: Getting g++ for Solaris
+* g++ for other platforms::
+* 1.x vs 2.x versions::
@end menu
@node latest versions, g++ for Unix, basics, basics
@@ -178,37 +176,41 @@ or GPL (@pxref{legalities}).
@cindex egcs release
-The egcs project (on the Web: @file{http://www.cygnus.com/egcs/}) has
-released a bug-fix version, egcs-1.0.1, on January 6, 1998. Folks
-using egcs-1.0 should upgrade, as it has some important bug fixes.
+The newest release from the egcs project (on the Web:
+@file{http://www.cygnus.com/egcs/}) is egcs-1.0.3, released May 15,
+1998.
@cindex gcc/g++, version date
-The current version of gcc/g++ is 2.8.0 (!), released January 14, 1998.
-It is a huge improvement over the 2.7.x releases, and thanks to
-extensive testing in the egcs framework, is perhaps the least buggy .0
-gcc release anyone can remember (though there are definitely a few).
+The current version of gcc/g++ is 2.8.1, released March 4, 1998.
+This release fixes some bugs in the 2.8.x release from January.
+It is a huge improvement over the 2.7.x releases.
-The current version of libg++ is 2.8.0, released January 19, 1998.
-However, libg++ is being deprecated; libstdc++-2.8.0 contains just the
-standard C++ classes and is a subset of libg++ 2.8.0. The libstdc++
-library is identical to the one included in egcs-1.0.1.
+libg++ has now been deprecated (that is, it is no longer really
+supported), so gcc2.8.1 users need to grab libstdc++-2.8.1 from
+their favorite GNU site (egcs users don't need to get this separately
+as it is bundled with egcs). However, there is an 'add-on' libg++ 2.8.1
+mini-release. If you want to use it, you need to combine it with
+libstdc++ 2.8.1.
I would strongly recommend that anyone using a g++ version earlier
than 2.7.2 should upgrade if at all possible (@pxref{version 2.7.x}).
-Folks who need modern C++ features should upgrade to 2.8.0 or egcs.
+Folks who need modern C++ features should upgrade to 2.8.1 or egcs.
For some non-Unix platforms, the latest port of gcc may be an earlier
-version (2.6.3, say). You'll need to use a version of libg++ that
+version (2.7.2, say). You'll need to use a version of libg++ that
has the same first two digits as the compiler version, e.g. use libg++
-2.6.x (for the latest x you can find) with gcc version 2.6.3.
+2.7.x (for the latest x you can find) with gcc version 2.7.2.1.
+
+From version 2.8.0 on, you don't need libg++, you only need libstdc++
+(again, the latest version with the same two leading digits as the
+version of g++ you use).
The latest "1.x" version of gcc is 1.42, and the latest "1.x" version of
g++ is 1.42.0.
-While gcc 1.42 is quite usable for C programs,
-I recommend against using g++ 1.x except in special circumstances
-(and I can't think of any such circumstances).
+While gcc 1.42 is quite usable for C programs, g++ 1.x is only of
+historical interest (since the C++ language has changed so much).
-@node g++ for Unix, g++ for HP, latest versions, basics
+@node g++ for Unix, getting-egcs, latest versions, basics
@section How do I get a copy of g++ for Unix?
First, you may already have it if you have gcc for your platform;
@@ -282,10 +284,57 @@ Most GNU utilities are compressed with ``gzip'', the GNU compression
utility. All GNU archive sites should have a copy of this program,
which you will need to uncompress the distributions.
-@cindex libg++
-Don't forget to retrieve libg++ as well!
+@cindex libstdc++
+Don't forget to retrieve libstdc++ as well!
+
+@node getting-egcs, g++ for HP, g++ for Unix, basics
+@section How do I get egcs?
+
+See @xref{egcs-intro} to find out what egcs is.
+
+You can obtain egcs either by FTP or with a Web browser. To do the
+latter, start from @file{http://egcs.cygnus.com/}. The master
+FTP site is @file{ftp://ftp.cygnus.com/pub/egcs/releases}, however
+you'll probably get a faster download if you use a mirror site.
+Mirror sites also have egcs snapshots unless otherwise noted.
+@itemize @bullet
+@item
+US (west coast): @file{ftp://go.cygnus.com/pub/ftp.cygnus.com/egcs/}
+@item
+US (east coast): @file{ftp://ftp.goof.com/pub/pcg/egcs/}
+or (for releases only): @file{ftp://cambridge.cygnus.com/pub/egcs/}
+@item
+US (Arizona): @file{ftp://ftp.ninemoons.com/pub/mirrors/egcs/}
+@item
+UK: @file{ftp://sunsite.doc.ic.ac.uk/Mirrors/egcs.cygnus.com/pub/egcs/}
+@item
+Austria: @file{ftp://gd.tuwien.ac.at/gnu/egcs}
+@item
+France: @file{ftp://ftp.ilog.fr/pub/mirrors/egcs/} or
+@file{ftp://ftp.lip6.fr/pub/egcs}
+@item
+Czech Republic: @file{ftp://sunsite.mff.cuni.cz/pub/GNU/egcs/}
+@item
+Denmark: @file{ftp://sunsite.auc.dk/pub/egcs/}
+@item
+Germany @file{ftp://ftp.fu-berlin.de/unix/languages/egcs/} or
+@file{ftp://ftp.gwdg.de/pub/cygnus/egcs/}
+@item
+Poland: @file{ftp://sunsite.icm.edu.pl/pub/programming/egcs/}
+@item
+Sweden: @file{ftp://ftp.sunet.se/pub/gnu/egcs/}
+@item
+Brasil (releases only, no snapshots):
+@file{ftp://ftp.unicamp.br/pub/gnu/=EXTRA=/cygnus/egcs/}
+@item
+Portugal: @file{ftp://ftp.lca.uevora.pt/pub/egcs/}
+@item
+Romania: @file{ftp://ftp.lbi.ro/pub/egcs/}
+@item
+Australia/NZ (release only): @file{ftp://moshpit.cygnus.com/pub/egcs/}
+@end itemize
-@node g++ for HP, g++ for Solaris 2.x, g++ for Unix, basics
+@node g++ for HP, g++ for Solaris 2.x, getting-egcs, basics
@section Getting gcc/g++ for the HP Precision Architecture
@cindex HP Precision Architecture
@@ -319,19 +368,19 @@ binaries may be discontinued.
@cindex Solaris
@cindex gcc/g++ binaries for Solaris
-You'll need to get prebuilt binaries from someone.
+You can obtain and install prebuilt binaries of gcc.
-It used to be that you could get GCC binaries from prep.ai.mit.edu;
-these are no longer there.
@cindex Solaris pkgadd utility
-The WWW site @file{http://smc.vnet.net/solaris_2.5.html}
+The WWW site @file{http://smc.vnet.net/}
contains various
-GNU and freeware programs for Solaris2.5 running on the sparc. These are
+GNU and freeware programs for Solaris 2.5 or 2.6, for either the Sparc
+or Intel platforms. These are
packaged to enable easy installation using the Solaris ``pkgadd'' utility.
-These include GNU emacs, gcc, gdb, perl, and others. These versions
-are more recent than the binaries at ``prep'' (gcc 2.7.2 and libg++
-2.7.1 are there).
+These include GNU emacs, gcc, gdb, perl, and others.
+
+You can find also find prebuilt binaries of many GNU tools, including the
+compiler, at @file{http://sunsite.unc.edu/pub/solaris/}.
@node g++ for other platforms, 1.x vs 2.x versions, g++ for Solaris 2.x, basics
@section How do I get a copy of g++ for (some other platform)?
@@ -439,9 +488,9 @@ him directly (shebs@@cygnus.com) for more information.
@node 1.x vs 2.x versions, , g++ for other platforms, basics
@section But I can only find g++-1.42!
-``I keep hearing people talking about g++ 2.8.0 (or some other number
-starting with 2), but the latest version I can find is g++ 1.42.
-Where is it?''
+``I keep hearing people talking about g++ 2.8.1 (or some other number
+starting with 2), but the latest version I can find is g++ 1.42. Where
+is it?''
@cindex Objective-C
@cindex g++, version number
@@ -453,67 +502,75 @@ install the C++ compiler as well.
One could argue that we shouldn't even refer to "g++-2.x.y" but it's a
convention. It means ``the C++ compiler included with gcc-2.x.y.''
-@node egcs and 2.8.0, installation, basics, Top
+@node egcs and 2.8.x, installation, basics, Top
@chapter The Next Generation(s) of g++
@menu
-* new-in-2.8.0:: What's new in gcc 2.8.0?
-* egcs-intro:: What is egcs?
-* egcs-whats-new:: What's new in egcs vs 2.7.2?
-* egcs-bug-fixes:: What was fixed in egcs-1.0.1?
-* egcs-linux:: If I install on Linux, will it overwrite my libraries?
-* egcs-run-both:: How can I run both egcs and an FSF release?
-* egcs-vs-2.8.0:: How will egcs affect 2.8.0?
-* egcs-robustness:: How robust is egcs?
+* new-in-2.8.x:: What's new in gcc 2.8.x?
+* egcs-intro:: What is egcs?
+* egcs-whats-new:: What's new in egcs vs 2.7.2?
+* egcs-bug-fixes:: What was fixed in the latest egcs releases?
+* egcs-linux:: If I install on Linux, will it overwrite my libraries?
+* egcs-run-both:: How can I run both egcs and an FSF release?
+* egcs-vs-2.8.x:: How will egcs affect 2.8.x?
+* egcs-robustness:: How robust is egcs?
@end menu
-@node new-in-2.8.0, egcs-intro, egcs and 2.8.0, egcs and 2.8.0
-@section What's new in gcc/g++ 2.8.0?
+@node new-in-2.8.x, egcs-intro, egcs and 2.8.x, egcs and 2.8.x
+@section What's new in gcc/g++ 2.8.x?
After a two-year wait, gcc 2.8.0 was released in January 1998, along
-with libstdc++-2.8.0 and libg++-2.8.0. Note that the latter (libg++)
-contains the former (libstdc++) so there is no reason to install both
-library packages, but libstdc++ is required.
+with libstdc++-2.8.0 and libg++-2.8.0. This has been followed up in
+March by the 2.8.1 release of all three packages, though libg++-2.8.1
+is an "add-on" (it does not contain libstdc++ anymore). Note that
+libstdc++ is required.
For those familiar with egcs, the most obvious difference between
-gcc-2.8.0 and egcs-1.0 or 1.0.1 is the packaging: egcs is bundled with
-libstdc++, and gcc-2.8.0 does not contain the class library. Otherwise,
+gcc-2.8.x and egcs is the packaging: egcs is bundled with
+libstdc++, and gcc-2.8.x does not contain the class library. Otherwise,
except for the lack of the @code{-frepo} option and some bug fixes
-that have not yet made it into gcc-2.8.0, C++ users will find the
-two compilers to be almost the same at this stage, other than that 2.8.0
+that have not yet made it into gcc-2.8.x, C++ users will find the
+two compilers to be almost the same at this stage, other than that 2.8.x
users may get more bogus warnings with -Wall and optimization because
some fixes to flow analysis in the presence of exceptions that egcs made
-are not yet present in gcc 2.8.0.
+are not yet present in gcc 2.8.x (as of 2.8.1).
+
+The flow analysis problem in 2.8.1 produces bad code in some cases, not
+just spurious errors. It only affects code that actually throws an
+exception, and only the path corresponding to a thrown exception gets
+misoptimized. If this happens, you can try reducing the level of
+optimization.
Because the new feature lists for egcs and gcc 2.8 are almost the same,
please see @xref{egcs-whats-new} for a list of new features. It is a
fairly long list.
-@node egcs-intro, egcs-whats-new, new-in-2.8.0, egcs and 2.8.0
+@node egcs-intro, egcs-whats-new, new-in-2.8.x, egcs and 2.8.x
@section What is egcs?
-egcs is the Experimental GNU compiler system (see
+egcs is the experimental GNU compiler system (see
@file{http://www.cygnus.com/egcs} on the Web). It is an effort to
accelerate development of new gcc features by providing a more open
development model than gcc has traditionally used.
The first egcs release, egcs-1.0, came out on December 3, 1997.
-The current release is egcs-1.0.1, released January 6, 1998.
+The current release is egcs-1.0.3, released May 15, 1998.
+
Questions not addressed here may be answered in the egcs FAQ
(@file{http://www.cygnus.com/egcs/faq.html}).
-@node egcs-whats-new, egcs-bug-fixes, egcs-intro, egcs and 2.8.0
+@node egcs-whats-new, egcs-bug-fixes, egcs-intro, egcs and 2.8.x
@section What new C++ features are in egcs?
@strong{Note}: unless indicated otherwise, these features are also
-present in g++ 2.8.0.
+present in g++ 2.8.x.
@itemize @bullet
@item
@cindex integrated libstdc++
The standard C++ classes are integrated with the egcs release (but
-@strong{not} for gcc-2.8.0, which does not include the class libraries).
+@strong{not} for gcc-2.8.x, which does not include the class libraries).
libg++ is not being
supported, though an add-on version that will work with egcs can be found at
@file{ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.0b6.6.tar.gz},
@@ -530,7 +587,7 @@ supported. An instantiation method resembling that used in Borland C++
(instantiating functions possibly in multiple .o files and using weak
symbols to link correctly) is provided, in addition to other
options. The SGI version of STL is shipped verbatim with libstdc++
-(libstdc++ is included with egcs, separate with gcc-2.8.0).
+(libstdc++ is included with egcs, separate with gcc-2.8.x).
@item
@cindex redundant template elimination
@@ -542,7 +599,7 @@ at link time.
@item
@cindex repository
@cindex -frepo
-The @code{-frepo} flag is supported in egcs (it is not in 2.8.0).
+The @code{-frepo} flag is supported in egcs (it is not in 2.8.x).
However, because of the previous item, I don't recommend its use on ELF
systems, as the default method is better.
@@ -570,16 +627,18 @@ There are many more changes: see @file{http://www.cygnus.com/egcs/c++features.ht
@end itemize
Features that are still missing include namespaces and templates as
-template arguments.
+template arguments, though there is support for the latter feature
+in the egcs snapshots (which has not yet made it into a release).
-@node egcs-bug-fixes, egcs-linux, egcs-whats-new, egcs and 2.8.0
-@section What was fixed in egcs-1.0.1?
+@node egcs-bug-fixes, egcs-linux, egcs-whats-new, egcs and 2.8.x
+@section What was fixed in the latest egcs releases?
@itemize @bullet
@item
Add support for Red Hat 5.0 Linux and better support for Linux
-systems using glibc2.
+systems using glibc2. (1.0.3 was specifically done to fix some
+remaining problems detected when building Red Hat 5.1).
@item
Compatibility with both egcs-1.0 and gcc-2.8 libgcc exception handling
@@ -602,12 +661,12 @@ Fix build problems on x86-solaris systems.
To avoid future compatibility problems, we strongly urge anyone who is
planning on distributing shared libraries that contain C++ code to
-upgrade to egcs-1.0.1 first. See
+upgrade to at least egcs-1.0.1 first (and preferably to 1.0.3). See
@file{http://www.cygnus.com/egcs/egcs-1.0.1.html} for details about the
compatibility issues as well as additional information about the
bugfixes since the egcs-1.0 release.
-@node egcs-linux, egcs-run-both, egcs-bug-fixes, egcs and 2.8.0
+@node egcs-linux, egcs-run-both, egcs-bug-fixes, egcs and 2.8.x
@section If I install egcs on Linux, will it overwrite my libraries?
No. If you build from sources, by default, egcs installs executables in
@@ -619,7 +678,7 @@ to put egcs in @code{/usr/bin} and @code{/usr/lib}, then yes, you are
replacing your system compiler and C++ library (I don't know if anyone
has provided such packages yet -- proceed with caution).
-@node egcs-run-both, egcs-vs-2.8.0, egcs-linux, egcs and 2.8.0
+@node egcs-run-both, egcs-vs-2.8.x, egcs-linux, egcs and 2.8.x
@section How can I run both egcs and an FSF release of g++ on the same machine?
The recommended approach is to provide a different argument to the
@@ -633,48 +692,47 @@ ln -s /usr/local/egcs/bin/gcc /usr/local/bin/egcc
ln -s /usr/local/egcs/bin/g++ /usr/local/bin/eg++
@end example
-@node egcs-vs-2.8.0, egcs-robustness, egcs-run-both, egcs and 2.8.0
-@section What about 2.8.0? How does egcs affect the 2.8.x development?
+@node egcs-vs-2.8.x, egcs-robustness, egcs-run-both, egcs and 2.8.x
+@section What about 2.8.x? How does egcs affect the 2.8.x development?
-2.8.0 has now been released, with essentially the same C++ front end as
-egcs.
+2.8.0 has now been released (followed up by 2.8.1), with essentially the
+same C++ front end as egcs.
Bug fixes generated in egcs will be passed to the 2.8.x releases for
inclusion; the reverse is also taking place, though a bug fix may
-appear in one before it does in the other. egcs development is expected
-to proceed more quickly.
+appear in one before it does in the other. egcs development is currently
+proceeding much more quickly than gcc 2.8.x development. However, there
+is essentially only one C++ front end, which is shared by the two
+distinct compiler back ends (however, since egcs-1.0.3 is newer than
+gcc 2.8.1, it has more bug fixes).
-@node egcs-robustness, , egcs-vs-2.8.0, egcs and 2.8.0
+@node egcs-robustness, , egcs-vs-2.8.x, egcs and 2.8.x
@section How robust is egcs?
While the 'e' stands for 'experimental', egcs has been tested thoroughly
-and should be of high quality. A few glitches in the initial release
-were fixed in 1.0.1. egcs-1.0 users should upgrade.
-
-Some memory bloat problems with deeply nested templates were fixed in
-1.0.1 (though it appears that there are still a few cases where
-excessive memory requirements occur).
+and should be of high quality. The author considers egcs 1.0.3 the
+most robust GNU C++ compiler ever produced.
-@node installation, evolution, egcs and 2.8.0, Top
+@node installation, evolution, egcs and 2.8.x, Top
@chapter Installation Issues and Problems
@menu
-* gcc-2 + g++-1::
-* what else do I need?::
-* use GNU linker?::
-* Use GNU assembler?::
-* shared libraries::
-* repository::
-* repo bugs::
-* Use GNU C library?::
+* gcc-2 + g++-1::
+* what else do I need?::
+* use GNU linker?::
+* Use GNU assembler?::
+* shared libraries::
+* repository::
+* repo bugs::
+* Use GNU C library?::
* Global constructor problems::
-* Strange assembler errors::
+* Strange assembler errors::
* Other problems building libg++::
-* More size_t problems::
-* Rebuild libg++?::
-* co-existing versions::
-* Installing on Linux::
-* Linux Slackware 3.0::
+* More size_t problems::
+* Rebuild libg++?::
+* co-existing versions::
+* Installing on Linux::
+* Linux Slackware 3.0::
@end menu
@node gcc-2 + g++-1, what else do I need?, installation, installation
@@ -712,7 +770,7 @@ or the GNU linker (see next question).
@cindex GNU gdb
Finally, while it is not required, you'll almost certainly want the GNU
debugger, gdb. The latest version is
-4.16, released April 22, 1996.
+4.17, released April 27, 1997.
Other debuggers (like dbx, for example) will normally not be able to
understand at least some of the debug information produced by g++.
@@ -742,8 +800,11 @@ there by programs named "patch" or "munch". With GNU C++, it is performed
either by the GNU linker or by a program known as "collect". The collect
program is part of the gcc-2.x distribution; you can obtain the GNU linker
separately as part of the "binutils" package. The latest version of
-binutils is 2.7, released July 10, 1996; 2.6 is in common use and works
-well.
+binutils is 2.9.1, released May 1, 1998.
+
+Note that if you want to use exceptions on Intel-like platforms and use
+gas (e.g. you run Linux), you need binutils version 2.8.1 or newer for
+exceptions to work correctly!
(To be technical, it's "collect2"; there were originally several
alternative versions of collect, and this is the one that survived).
@@ -773,7 +834,7 @@ debug format (e.g. Suns running SunOS 4.x), the GNU linker compresses
the debug symbol table considerably. The 2.7 version adds some symbol
table compression for ELF and Solaris targets.
-Users of egcs or 2.8.0 on ELF systems should definitely
+Users of egcs or 2.8.x on ELF systems should definitely
use GNU ld (2.8 or later), as it will automatically remove duplicate
instantiations of templates, virtual function tables, or ``outlined''
copies of inline functions.
@@ -1174,14 +1235,14 @@ This chapter discusses the evolution of g++ and describes what can be expected
in the future.
@menu
-* version 2.7.x:: What's changed in 2.7.x from earlier versions
-* libstdc++::
+* version 2.7.x:: What's changed in 2.7.x from earlier versions
+* libstdc++::
@end menu
@node version 2.7.x, libstdc++, evolution, evolution
@section What's new in version 2.7.x of gcc/g++
-[ This section is old now, since 2.8.0/egcs is the new stuff ] The
+[ This section is old now, since 2.8.x/egcs is the new stuff ] The
latest 2.7.x version was 2.7.2.2, released February 10, 1997. The only
change between 2.7.2.1 and 2.7.2.2 is that support was added for using
the GNU C library, version 2, on Linux; users not interested in that
@@ -1315,7 +1376,7 @@ The GNU Standard C++ Library (also called the ``GNU ANSI C++ Library''
in places in the code) is not libg++, though it is included in the
libg++ distribution. Rather, it contains classes and functions
required by the ANSI/ISO standard. The copyright conditions are the
-same as those for the iostreams classes; the LGPL is not used
+same as those for for the iostreams classes; the LGPL is not used
(@pxref{legalities}).
This library, libstdc++, is in the libg++ distribution in versions 2.6.2
@@ -1338,32 +1399,32 @@ will always be available, enhancements to it should not be expected.
@chapter User Problems
@menu
-* missing virtual table::
-* for scope::
-* const constructor::
-* unused parameter warnings::
+* missing virtual table::
+* for scope::
+* const constructor::
+* unused parameter warnings::
* jump crosses initialization::
-* Demangler::
-* static data members::
-* internal compiler error::
-* bug reports::
-* porting to g++::
-* name mangling::
+* Demangler::
+* static data members::
+* internal compiler error::
+* bug reports::
+* porting to g++::
+* name mangling::
* problems linking with other libraries::
-* documentation::
-* templates::
-* undefined templates::
-* redundant templates::
-* Standard Template Library::
-* STL and string::
-* exceptions::
-* namespaces::
-* agreement with standards::
+* documentation::
+* templates::
+* undefined templates::
+* redundant templates::
+* Standard Template Library::
+* STL and string::
+* exceptions::
+* namespaces::
+* agreement with standards::
* compiling standard libraries::
-* debugging on SVR4 systems::
+* debugging on SVR4 systems::
* debugging problems on Solaris::
-* X11 conflicts with libg++::
-* assignment to streams::
+* X11 conflicts with libg++::
+* assignment to streams::
@end menu
@node missing virtual table, for scope, User Problems, User Problems
@@ -1614,7 +1675,7 @@ An older
standard reference is "The Annotated C++ Reference Manual", by Ellis and
Stroustrup (copyright 1990, ISBN #0-201-51459-1). This is what they're
talking about on the net when they refer to ``the ARM''. But you should
-know that changes have been made to the language since then.
+know that vast changes have been made to the language since then.
The ANSI/ISO C++ standards committee have adopted some changes to the
C++ language since the publication of the original ARM, and newer
@@ -1784,7 +1845,7 @@ While there is no libg++-specific document describing the STL
implementation, SGI's web site, at
@file{http://www.sgi.com/Technology/STL/}, is an excellent resource.
Note that the SGI version of STL is the one that is included with the
-egcs and 2.8.0 releases of g++/libstdc++.
+egcs and 2.8.x releases of g++/libstdc++.
@end itemize
@@ -1805,6 +1866,17 @@ in which it is used.
can be added to 2.7.0 or later does implement a separate pass, but there
is still no searching of files that the compiler never saw).
+As of 2.8.x and egcs-1.0.x, the template implementation has most
+of the features specified in the draft standard. Still missing are
+template arguments that are themselves templates; however, template
+class member functions work, and most of the limitations of the older
+g++ versions are fixed.
+
+I think that given this new implementation, it should not be necessary
+for users to mess around with switches like @code{-fno-implicit-templates}
+and @code{#pragma} directives; most of the time, the default behavior
+will work OK. Users of older versions might want to read on.
+
@cindex -fno-implicit-templates
For version 2.6.0, however, a new switch @code{-fno-implicit-templates}
was added; with this switch, templates are expanded only under user
@@ -1822,11 +1894,12 @@ template ostream& operator << (ostream&, const A<int>&);
As of version 2.7.2, there are still a few limitations in the template
implementation besides the above (thanks to Jason Merrill for this info):
-@strong{Note}: these problems are eliminated in egcs and in gcc-2.8.0.
+@strong{Note}: these problems are eliminated in egcs and in gcc-2.8.x.
@enumerate 1
@item
-Static data member templates are not supported. You can work around
+Static data member templates are not supported in compiler versions older
+than 2.8.0. You can work around
this by explicitly declaring the static variable for each template
specialization:
@@ -1839,8 +1912,6 @@ template <class T> T A<T>::t = 0; // gets bogus error
int A<int>::t = 0; // OK (workaround)
@end example
-(still a limitation in 2.7.2)
-
@item
Template member names are not available when defining member function
templates.
@@ -1857,7 +1928,7 @@ template <class T> void A<T>::f (foo) @{ @} // gets bogus error
@item
Templates are instantiated using the parser. This results in two
-problems:
+problems (again, these problems are fixed in 2.8.0 and egcs):
a) Class templates are instantiated in some situations where such
instantiation should not occur.
@@ -1892,7 +1963,7 @@ before @code{f()}; this will force it to be instantiated (though not
emitted).
@strong{Note:} this kind of ``guiding declaration'' is not standard and
-isn't supported by egcs or gcc-2.8.0, as the standard says that this
+isn't supported by egcs or gcc-2.8.x, as the standard says that this
declares a ``normal'' @code{min} function which has no relation to
the template function @code{min<int>(int,int)}. But then the new
compilers have no problem inlining template functions.
@@ -1982,7 +2053,7 @@ This bug is fixed in 2.7.0.
@section Does g++ support the Standard Template Library?
If you want to use the Standard Template Library, do not pass go,
-upgrade immediately to gcc-2.8.0 or to egcs. The new C++ front end
+upgrade immediately to gcc-2.8.x or to egcs. The new C++ front end
handles STL very well, and the high-quality implementation of STL
from SGI is included verbatim as part of the libstdc++ class library.
@@ -2027,13 +2098,24 @@ solution, I'm afraid, is to wait for the new release.
@node exceptions, namespaces, STL and string, User Problems
@section Problems and limitations with exceptions
-Recent g++ versions provide limited support for exceptions. You must
+The first really usable exceptions implementations are in 2.8.x and
+egcs. With these versions, exceptions are enabled by default; use
+-fno-exceptions to disable exceptions.
+
+However, 2.8.1 still has not integrated egcs work that computes an
+accurate control flow graph in the presence of exceptions. For this
+reason, you will sometimes get bogus warnings when compiling with 2.8.1,
+-O, and -Wall, about uninitialized variables and the like.
+
+2.7.2.x has very limited and partially broken support for exceptions.
+With that compiler, you must
provide the @code{-fhandle-exceptions} flag to enable exception
-handling. As of version 2.7.2, exceptions may not work properly
+handling. In version 2.7.2 and older, exceptions may not work properly
(and you may get odd error messages when compiling) if you turn
-on optimization (the @code{-O} flag).
+on optimization (the @code{-O} flag). If you care about exceptions,
+please upgrade to a newer compiler!
-You must give the @code{-frtti} switch to enable catching
+In 2.7.2, you must give the @code{-frtti} switch to enable catching
of derived exception objects with handlers for the base exception class;
if @code{-frtti} is not given, only exact type matching works.
@@ -2043,20 +2125,30 @@ for the Alpha, and ``m68k is rumored to work on some platforms''
and ``VAX may also work'' (according to Mike Stump).
@emph{It still doesn't work on HP-PA or MIPS platforms.}
+Exception handling adds space overhead (the size of the executable
+grows); the problem is worse on the ix86 (Intel-like) architecture
+than on RISC architectures. The extra exceptions code is generated
+in a separate program section and is only paged in if an exception
+is thrown, so the cost is in disk, not in RAM or CPU.
+
+Exception overhead is much lower on ix86 if you use binutils 2.9 or
+later, as gas (the GNU assembler) can now compress the information.
+
@node namespaces, agreement with standards, exceptions, User Problems
@section Does g++ support namespaces?
As of version 2.7.2, g++ recognizes the keywords @code{namespace} and
@code{using}, and there is some rudimentary code present, but almost
nothing connected with namespaces works yet.
-The new versions (2.8.0/egcs) still lack namespace support, but to help
+The new versions (2.8.x/egcs) still lack namespace support, but to help
compile standard programs they make
@example
using namespace std;
@end example
-a no-op.
+a no-op. There is namespace implementation work going on in the egcs
+snapshots (but it hasn't been released yet).
@node agreement with standards, compiling standard libraries, namespaces, User Problems
@section What are the differences between g++ and the ARM specification of C++?
@@ -2065,7 +2157,7 @@ a no-op.
@cindex exceptions
Up until recently, there was no really usable exception support. If you
-need exceptions, you want gcc-2.8.0 or egcs. The implementation works
+need exceptions, you want gcc-2.8.x or egcs. The implementation works
fairly well. The 2.7.x version was strictly alpha quality and quite
fragile.
@@ -2075,7 +2167,7 @@ that don't appear in the ARM are supported, notably the @code{mutable}
keyword, in version 2.5.x. 2.6.x added support for the built-in boolean
type @code{bool}, with constants @code{true} and @code{false}. Run-time
type identification was rudimentary in 2.7.x but is fully supported in
-2.8.0, so there are
+2.8.x, so there are
more reserved words: @code{typeid}, @code{static_cast},
@code{reinterpret_cast}, @code{const_cast}, and @code{dynamic_cast}.
@@ -2083,7 +2175,7 @@ more reserved words: @code{typeid}, @code{static_cast},
As with any beta-test compiler, there are bugs. You can help improve
the compiler by submitting detailed bug reports.
-[ This paragraph obsoleted by 2.8.0/egcs: ]
+[ This paragraph obsoleted by 2.8.x/egcs: ]
One of the weakest areas of g++ other than templates is the resolution
of overloaded functions and operators in complex cases. The usual
symptom is that in a case where the ARM says that it is ambiguous which
@@ -2091,11 +2183,11 @@ function should be chosen, g++ chooses one (often the first one
declared). This is usually not a problem when porting C++ code from
other compilers to g++, but shows up as errors when code developed under
g++ is ported to other compilers. (I believe this is no longer a
-significant problem in 2.7.0).
+significant problem in 2.7.0 or later).
-[A full bug list would be very long indeed, so I won't put one here.
-I may add a list of frequently-reported bugs and "non-bugs" like the
-static class members issue mentioned above].
+[A full bug list would be very long indeed, so I won't put one here;
+the sheer complexity of the C++ language means that every compiler I've
+tried has some problems. 2.8.x and egcs are a big improvement]
@node compiling standard libraries, debugging on SVR4 systems, agreement with standards, User Problems
@section Will g++ compile InterViews? The NIH class library? Rogue Wave?
@@ -2137,23 +2229,25 @@ fixed their code to comply with the new standard yet.
@cindex DWARF debug format
Most systems based on System V Release 4 (except Solaris) encode symbolic
-debugging information in a format known as `DWARF'.
+debugging information in a format known as `DWARF'. There are two forms
+of DWARF, DWARF 1 and DWARF 2. The default is often DWARF 1, which is
+not really expressive enough to do C++ correctly.
-Although the GNU C compiler already knows how to write out symbolic debugging
-information in the DWARF format, the GNU C++ compiler does not yet have this
-feature yet. However, work is in progress for DWARF 2 debug support for
-gcc and g++ and it works fairly well in 2.8.0 and egcs, though we'll
-have to wait for gdb 4.17 to be released to take full advantage.
+Now that we have gdb 4.17, DWARF debugging is finally supported (if
+you use gcc 2.8.1 or egcs-1.0.x or newer).
@cindex stabs
@cindex --with-stabs
-In the meantime, you @emph{can} get g++ debugging under SVR4 systems by
+For users of older versions of the tools, you @emph{can} get g++ debugging under SVR4 systems by
configuring gcc with the @code{--with-stabs} option. This causes gcc to
use an alternate debugging format, one more like that used under SunOS4.
You won't need to do anything special to GDB; it will always understand
the ``stabs'' format.
+To specify DWARF 2 output on Unixware, you can give the @code{-ggdb}
+switch; alternatively, @code{-gstabs} produces ``stabs'' format.
+
@node debugging problems on Solaris, X11 conflicts with libg++, debugging on SVR4 systems, User Problems
@section debugging problems on Solaris
@@ -2309,9 +2403,11 @@ all the standard classes are in @file{-lstdc++}; you can do the link
step with @code{c++} instead of @code{g++} to search only the
@file{-lstdc++} library and avoid the LGPL'ed code in @file{-lg++}.
-Note that in egcs and in gcc-2.8.0, if you do not
+Note that in egcs and in gcc-2.8.x, if you do not
specify any libraries the @code{g++} command will only link in
-@file{-lstdc++}, so your executable will not be affected by the LGPL.
+@file{-lstdc++}, so your executable will not be affected by the LGPL
+(unless you link in some other LGPLed library: the GNU C library used
+on GNU/Linux systems is one such library).
If you wish to discuss legal issues connected with GNU software on the
net, please use @file{gnu.misc.discuss}, not the technical newsgroups.
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 0d1b7c054a8..22060cd222d 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -80,8 +80,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
LANGSPEC, MATHLIB, or WITHLIBC. */
int *args;
- /* By default, we throw on the math library. */
- int need_math = 1;
+ /* By default, we throw on the math library if we have one. */
+ int need_math = (MATH_LIBRARY[0] != '\0');
/* The total number of arguments with the new stuff. */
int argc;
@@ -125,6 +125,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
}
else if (strcmp (argv[i], "-lm") == 0
|| strcmp (argv[i], "-lmath") == 0
+ || strcmp (argv[i], MATH_LIBRARY) == 0
#ifdef ALT_LIBM
|| strcmp (argv[i], ALT_LIBM) == 0
#endif
@@ -241,7 +242,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
}
if (saw_math)
arglist[j++] = saw_math;
- else if (library)
+ else if (library && need_math)
{
arglist[j++] = MATH_LIBRARY;
added_libraries++;
@@ -255,3 +256,12 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
*in_argv = arglist;
*in_added_libraries = added_libraries;
}
+
+/* Called before linking. Returns 0 on success and -1 on failure. */
+int lang_specific_pre_link () /* Not used for C++. */
+{
+ return 0;
+}
+
+/* Number of extra output files that lang_specific_pre_link may generate. */
+int lang_specific_extra_outfiles = 0; /* Not used for C++. */
diff --git a/gcc/cp/gxx.gperf b/gcc/cp/gxx.gperf
index d9cad4a6255..868dfc426f0 100644
--- a/gcc/cp/gxx.gperf
+++ b/gcc/cp/gxx.gperf
@@ -1,12 +1,12 @@
%{
-/* Command-line: gperf -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
+/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
%}
struct resword { char *name; short token; enum rid rid;};
%%
__alignof, ALIGNOF, NORID
__alignof__, ALIGNOF, NORID
-__asm, GCC_ASM_KEYWORD, NORID
-__asm__, GCC_ASM_KEYWORD, NORID
+__asm, ASM_KEYWORD, NORID
+__asm__, ASM_KEYWORD, NORID
__attribute, ATTRIBUTE, NORID
__attribute__, ATTRIBUTE, NORID
__complex, TYPESPEC, RID_COMPLEX
@@ -55,6 +55,7 @@ dynamic_cast, DYNAMIC_CAST, NORID,
else, ELSE, NORID,
enum, ENUM, NORID,
explicit, SCSPEC, RID_EXPLICIT,
+export, SCSPEC, RID_EXPORT,
extern, SCSPEC, RID_EXTERN,
false, CXX_FALSE, NORID,
float, TYPESPEC, RID_FLOAT,
diff --git a/gcc/cp/gxxint.texi b/gcc/cp/gxxint.texi
index 7cb57f2665c..c8f312ebfca 100644
--- a/gcc/cp/gxxint.texi
+++ b/gcc/cp/gxxint.texi
@@ -167,77 +167,6 @@ class foo @{ public: int b; int a; foo (); @};
Thus, @samp{b} will be initialized with 2 first, then @samp{a} will be
initialized with 1, regardless of how they're listed in the mem-initializer.
-@item Argument Matching
-
-In early 1993, the argument matching scheme in @sc{gnu} C++ changed
-significantly. The original code was completely replaced with a new
-method that will, hopefully, be easier to understand and make fixing
-specific cases much easier.
-
-The @samp{-fansi-overloading} option is used to enable the new code; at
-some point in the future, it will become the default behavior of the
-compiler.
-
-The file @file{cp-call.c} contains all of the new work, in the functions
-@code{rank_for_overload}, @code{compute_harshness},
-@code{compute_conversion_costs}, and @code{ideal_candidate}.
-
-Instead of using obscure numerical values, the quality of an argument
-match is now represented by clear, individual codes. The new data
-structure @code{struct harshness} (it used to be an @code{unsigned}
-number) contains:
-
-@enumerate a
-@item the @samp{code} field, to signify what was involved in matching two
-arguments;
-@item the @samp{distance} field, used in situations where inheritance
-decides which function should be called (one is ``closer'' than
-another);
-@item and the @samp{int_penalty} field, used by some codes as a tie-breaker.
-@end enumerate
-
-The @samp{code} field is a number with a given bit set for each type of
-code, OR'd together. The new codes are:
-
-@itemize @bullet
-@item @code{EVIL_CODE}
-The argument was not a permissible match.
-
-@item @code{CONST_CODE}
-Currently, this is only used by @code{compute_conversion_costs}, to
-distinguish when a non-@code{const} member function is called from a
-@code{const} member function.
-
-@item @code{ELLIPSIS_CODE}
-A match against an ellipsis @samp{...} is considered worse than all others.
-
-@item @code{USER_CODE}
-Used for a match involving a user-defined conversion.
-
-@item @code{STD_CODE}
-A match involving a standard conversion.
-
-@item @code{PROMO_CODE}
-A match involving an integral promotion. For these, the
-@code{int_penalty} field is used to handle the ARM's rule (XXX cite)
-that a smaller @code{unsigned} type should promote to a @code{int}, not
-to an @code{unsigned int}.
-
-@item @code{QUAL_CODE}
-Used to mark use of qualifiers like @code{const} and @code{volatile}.
-
-@item @code{TRIVIAL_CODE}
-Used for trivial conversions. The @samp{int_penalty} field is used by
-@code{convert_harshness} to communicate further penalty information back
-to @code{build_overload_call_real} when deciding which function should
-be call.
-@end itemize
-
-The functions @code{convert_to_aggr} and @code{build_method_call} use
-@code{compute_conversion_costs} to rate each argument's suitability for
-a given candidate function (that's how we get the list of candidates for
-@code{ideal_candidate}).
-
@item The Explicit Keyword
The use of @code{explicit} on a constructor is used by @code{grokdeclarator}
diff --git a/gcc/cp/hash.h b/gcc/cp/hash.h
index 720890fd4c8..21ebdd7901e 100644
--- a/gcc/cp/hash.h
+++ b/gcc/cp/hash.h
@@ -1,37 +1,51 @@
-/* C code produced by gperf version 2.5 (GNU C++ version) */
-/* Command-line: gperf -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gxx.gperf */
+/* KR-C code produced by gperf version 2.7.1 (19981006 egcs) */
+/* Command-line: gperf -L KR-C -F , 0, 0 -p -j1 -g -o -t -N is_reserved_word -k1,4,7,$ ./gxx.gperf */
+/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
struct resword { char *name; short token; enum rid rid;};
-#define TOTAL_KEYWORDS 103
+#define TOTAL_KEYWORDS 104
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 16
#define MIN_HASH_VALUE 4
-#define MAX_HASH_VALUE 195
-/* maximum key range = 192, duplicates = 0 */
+#define MAX_HASH_VALUE 261
+/* maximum key range = 258, duplicates = 0 */
#ifdef __GNUC__
-inline
+__inline
#endif
static unsigned int
hash (str, len)
register char *str;
- register int unsigned len;
+ register unsigned int len;
{
- static unsigned char asso_values[] =
+ static unsigned short asso_values[] =
{
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 0, 196, 80, 26, 28,
- 44, 0, 49, 38, 6, 81, 196, 2, 0, 41,
- 16, 47, 4, 31, 32, 5, 6, 62, 20, 96,
- 17, 25, 196, 196, 196, 196, 196, 196,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 0, 262, 87, 25, 96,
+ 60, 0, 55, 7, 4, 41, 262, 2, 15, 49,
+ 14, 63, 32, 29, 3, 23, 6, 8, 2, 2,
+ 0, 7, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262
};
register int hval = len;
@@ -39,22 +53,22 @@ hash (str, len)
{
default:
case 7:
- hval += asso_values[str[6]];
+ hval += asso_values[(unsigned char)str[6]];
case 6:
case 5:
case 4:
- hval += asso_values[str[3]];
+ hval += asso_values[(unsigned char)str[3]];
case 3:
case 2:
case 1:
- hval += asso_values[str[0]];
+ hval += asso_values[(unsigned char)str[0]];
break;
}
- return hval + asso_values[str[len - 1]];
+ return hval + asso_values[(unsigned char)str[len - 1]];
}
#ifdef __GNUC__
-inline
+__inline
#endif
struct resword *
is_reserved_word (str, len)
@@ -63,150 +77,158 @@ is_reserved_word (str, len)
{
static struct resword wordlist[] =
{
- {"",}, {"",}, {"",}, {"",},
- {"else", ELSE, NORID,},
- {"",},
- {"__real", REALPART, NORID},
- {"",},
- {"__real__", REALPART, NORID},
- {"",},
- {"true", CXX_TRUE, NORID,},
- {"",},
- {"__asm__", GCC_ASM_KEYWORD, NORID},
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"this", THIS, NORID,},
- {"",},
- {"extern", SCSPEC, RID_EXTERN,},
- {"switch", SWITCH, NORID,},
- {"template", TEMPLATE, RID_TEMPLATE,},
- {"not", '!', NORID,},
- {"",},
- {"__alignof__", ALIGNOF, NORID},
- {"static_cast", STATIC_CAST, NORID,},
- {"",},
- {"bool", TYPESPEC, RID_BOOL,},
- {"private", VISSPEC, RID_PRIVATE,},
- {"case", CASE, NORID,},
- {"virtual", SCSPEC, RID_VIRTUAL,},
- {"try", TRY, NORID,},
- {"",}, {"",},
- {"compl", '~', NORID,},
- {"public", VISSPEC, RID_PUBLIC,},
- {"",},
- {"__inline", SCSPEC, RID_INLINE},
- {"",},
- {"__inline__", SCSPEC, RID_INLINE},
- {"class", AGGR, RID_CLASS,},
- {"const", CV_QUALIFIER, RID_CONST,},
- {"static", SCSPEC, RID_STATIC,},
- {"__extension__", EXTENSION, NORID},
- {"",},
- {"short", TYPESPEC, RID_SHORT,},
- {"__imag__", IMAGPART, NORID},
- {"delete", DELETE, NORID,},
- {"__asm", GCC_ASM_KEYWORD, NORID},
- {"xor", '^', NORID,},
- {"not_eq", EQCOMPARE, NORID,},
- {"xor_eq", ASSIGN, NORID,},
- {"typename", TYPENAME_KEYWORD, NORID,},
- {"typeid", TYPEID, NORID,},
- {"",},
- {"__complex__", TYPESPEC, RID_COMPLEX},
- {"false", CXX_FALSE, NORID,},
- {"sizeof", SIZEOF, NORID,},
- {"typeof", TYPEOF, NORID,},
- {"__const__", CV_QUALIFIER, RID_CONST},
- {"__volatile", CV_QUALIFIER, RID_VOLATILE},
- {"",},
- {"__volatile__", CV_QUALIFIER, RID_VOLATILE},
- {"__const", CV_QUALIFIER, RID_CONST},
- {"catch", CATCH, NORID,},
- {"__null", CONSTANT, RID_NULL},
- {"protected", VISSPEC, RID_PROTECTED,},
- {"",},
- {"signed", TYPESPEC, RID_SIGNED,},
- {"",},
- {"__complex", TYPESPEC, RID_COMPLEX},
- {"__alignof", ALIGNOF, NORID},
- {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,},
- {"double", TYPESPEC, RID_DOUBLE,},
- {"const_cast", CONST_CAST, NORID,},
- {"",},
- {"struct", AGGR, RID_RECORD,},
- {"long", TYPESPEC, RID_LONG,},
- {"or", OROR, NORID,},
- {"__typeof__", TYPEOF, NORID},
- {"or_eq", ASSIGN, NORID,},
- {"for", FOR, NORID,},
- {"__imag", IMAGPART, NORID},
- {"enum", ENUM, NORID,},
- {"",}, {"",},
- {"__label__", LABEL, NORID},
- {"int", TYPESPEC, RID_INT,},
- {"__signed__", TYPESPEC, RID_SIGNED},
- {"signature", AGGR, RID_SIGNATURE /* Extension */,},
- {"do", DO, NORID,},
- {"",},
- {"explicit", SCSPEC, RID_EXPLICIT,},
- {"char", TYPESPEC, RID_CHAR,},
- {"",},
- {"__attribute", ATTRIBUTE, NORID},
- {"friend", SCSPEC, RID_FRIEND,},
- {"__attribute__", ATTRIBUTE, NORID},
- {"while", WHILE, NORID,},
- {"reinterpret_cast", REINTERPRET_CAST, NORID,},
- {"",},
- {"continue", CONTINUE, NORID,},
- {"namespace", NAMESPACE, NORID,},
- {"sigof", SIGOF, NORID /* Extension */,},
- {"",},
- {"volatile", CV_QUALIFIER, RID_VOLATILE,},
- {"",},
- {"bitor", '|', NORID,},
- {"typedef", SCSPEC, RID_TYPEDEF,},
- {"void", TYPESPEC, RID_VOID,},
- {"break", BREAK, NORID,},
- {"",},
- {"new", NEW, NORID,},
- {"return", RETURN, NORID,},
- {"and_eq", ASSIGN, NORID,},
- {"",}, {"",}, {"",},
- {"using", USING, NORID,},
- {"",}, {"",},
- {"asm", ASM_KEYWORD, NORID,},
- {"",}, {"",},
- {"and", ANDAND, NORID,},
- {"mutable", SCSPEC, RID_MUTABLE,},
- {"__typeof", TYPEOF, NORID},
- {"union", AGGR, RID_UNION,},
- {"",},
- {"if", IF, NORID,},
- {"__signed", TYPESPEC, RID_SIGNED},
- {"",}, {"",},
- {"goto", GOTO, NORID,},
- {"",}, {"",},
- {"__sigof__", SIGOF, NORID /* Extension */,},
- {"float", TYPESPEC, RID_FLOAT,},
- {"",}, {"",},
- {"default", DEFAULT, NORID,},
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"register", SCSPEC, RID_REGISTER,},
- {"throw", THROW, NORID,},
- {"",},
- {"bitand", '&', NORID,},
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"operator", OPERATOR, NORID,},
- {"",},
- {"inline", SCSPEC, RID_INLINE,},
- {"",},
- {"dynamic_cast", DYNAMIC_CAST, NORID,},
- {"",}, {"",}, {"",},
- {"__signature__", AGGR, RID_SIGNATURE /* Extension */,},
- {"",}, {"",}, {"",},
- {"auto", SCSPEC, RID_AUTO,},
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
- {"unsigned", TYPESPEC, RID_UNSIGNED,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"else", ELSE, NORID,},
+ {"", 0, 0},
+ {"xor", '^', NORID,},
+ {"", 0, 0},
+ {"__real__", REALPART, NORID},
+ {"", 0, 0},
+ {"true", CXX_TRUE, NORID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"try", TRY, NORID,},
+ {"", 0, 0}, {"", 0, 0},
+ {"new", NEW, NORID,},
+ {"extern", SCSPEC, RID_EXTERN,},
+ {"__real", REALPART, NORID},
+ {"while", WHILE, NORID,},
+ {"not", '!', NORID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"__extension__", EXTENSION, NORID},
+ {"", 0, 0},
+ {"__null", CONSTANT, RID_NULL},
+ {"__asm__", ASM_KEYWORD, NORID},
+ {"return", RETURN, NORID,},
+ {"", 0, 0},
+ {"long", TYPESPEC, RID_LONG,},
+ {"using", USING, NORID,},
+ {"xor_eq", ASSIGN, NORID,},
+ {"__inline", SCSPEC, RID_INLINE},
+ {"short", TYPESPEC, RID_SHORT,},
+ {"__inline__", SCSPEC, RID_INLINE},
+ {"switch", SWITCH, NORID,},
+ {"__alignof__", ALIGNOF, NORID},
+ {"private", VISSPEC, RID_PRIVATE,},
+ {"reinterpret_cast", REINTERPRET_CAST, NORID,},
+ {"struct", AGGR, RID_RECORD,},
+ {"", 0, 0},
+ {"virtual", SCSPEC, RID_VIRTUAL,},
+ {"static_cast", STATIC_CAST, NORID,},
+ {"", 0, 0}, {"", 0, 0},
+ {"not_eq", EQCOMPARE, NORID,},
+ {"int", TYPESPEC, RID_INT,},
+ {"__signed__", TYPESPEC, RID_SIGNED},
+ {"template", TEMPLATE, RID_TEMPLATE,},
+ {"", 0, 0},
+ {"signature", AGGR, RID_SIGNATURE /* Extension */,},
+ {"register", SCSPEC, RID_REGISTER,},
+ {"this", THIS, NORID,},
+ {"__imag__", IMAGPART, NORID},
+ {"__attribute", ATTRIBUTE, NORID},
+ {"bool", TYPESPEC, RID_BOOL,},
+ {"__attribute__", ATTRIBUTE, NORID},
+ {"for", FOR, NORID,},
+ {"__imag", IMAGPART, NORID},
+ {"typename", TYPENAME_KEYWORD, NORID,},
+ {"", 0, 0}, {"", 0, 0},
+ {"delete", DELETE, NORID,},
+ {"typeof", TYPEOF, NORID,},
+ {"or", OROR, NORID,},
+ {"", 0, 0},
+ {"explicit", SCSPEC, RID_EXPLICIT,},
+ {"", 0, 0},
+ {"typeid", TYPEID, NORID,},
+ {"", 0, 0}, {"", 0, 0},
+ {"export", SCSPEC, RID_EXPORT,},
+ {"throw", THROW, NORID,},
+ {"__asm", ASM_KEYWORD, NORID},
+ {"__const__", CV_QUALIFIER, RID_CONST},
+ {"__volatile", CV_QUALIFIER, RID_VOLATILE},
+ {"__typeof__", TYPEOF, NORID},
+ {"__volatile__", CV_QUALIFIER, RID_VOLATILE},
+ {"__const", CV_QUALIFIER, RID_CONST},
+ {"false", CXX_FALSE, NORID,},
+ {"sizeof", SIZEOF, NORID,},
+ {"", 0, 0}, {"", 0, 0},
+ {"__complex", TYPESPEC, RID_COMPLEX},
+ {"inline", SCSPEC, RID_INLINE,},
+ {"__complex__", TYPESPEC, RID_COMPLEX},
+ {"union", AGGR, RID_UNION,},
+ {"double", TYPESPEC, RID_DOUBLE,},
+ {"", 0, 0},
+ {"__alignof", ALIGNOF, NORID},
+ {"", 0, 0}, {"", 0, 0},
+ {"bitor", '|', NORID,},
+ {"or_eq", ASSIGN, NORID,},
+ {"if", IF, NORID,},
+ {"", 0, 0},
+ {"case", CASE, NORID,},
+ {"", 0, 0},
+ {"enum", ENUM, NORID,},
+ {"signed", TYPESPEC, RID_SIGNED,},
+ {"", 0, 0},
+ {"__sigof__", SIGOF, NORID /* Extension */,},
+ {"char", TYPESPEC, RID_CHAR,},
+ {"", 0, 0}, {"", 0, 0},
+ {"__signed", TYPESPEC, RID_SIGNED},
+ {"namespace", NAMESPACE, NORID,},
+ {"__label__", LABEL, NORID},
+ {"volatile", CV_QUALIFIER, RID_VOLATILE,},
+ {"protected", VISSPEC, RID_PROTECTED,},
+ {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,},
+ {"", 0, 0}, {"", 0, 0},
+ {"unsigned", TYPESPEC, RID_UNSIGNED,},
+ {"continue", CONTINUE, NORID,},
+ {"break", BREAK, NORID,},
+ {"", 0, 0},
+ {"friend", SCSPEC, RID_FRIEND,},
+ {"and_eq", ASSIGN, NORID,},
+ {"typedef", SCSPEC, RID_TYPEDEF,},
+ {"", 0, 0},
+ {"do", DO, NORID,},
+ {"void", TYPESPEC, RID_VOID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"const", CV_QUALIFIER, RID_CONST,},
+ {"static", SCSPEC, RID_STATIC,},
+ {"", 0, 0},
+ {"__typeof", TYPEOF, NORID},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"goto", GOTO, NORID,},
+ {"", 0, 0},
+ {"asm", ASM_KEYWORD, NORID,},
+ {"operator", OPERATOR, NORID,},
+ {"__signature__", AGGR, RID_SIGNATURE /* Extension */,},
+ {"", 0, 0},
+ {"mutable", SCSPEC, RID_MUTABLE,},
+ {"", 0, 0}, {"", 0, 0},
+ {"sigof", SIGOF, NORID /* Extension */,},
+ {"class", AGGR, RID_CLASS,},
+ {"compl", '~', NORID,},
+ {"public", VISSPEC, RID_PUBLIC,},
+ {"and", ANDAND, NORID,},
+ {"", 0, 0}, {"", 0, 0},
+ {"float", TYPESPEC, RID_FLOAT,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"default", DEFAULT, NORID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0},
+ {"bitand", '&', NORID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"catch", CATCH, NORID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"auto", SCSPEC, RID_AUTO,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"const_cast", CONST_CAST, NORID,},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
+ {"", 0, 0}, {"", 0, 0},
+ {"dynamic_cast", DYNAMIC_CAST, NORID,}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -217,7 +239,7 @@ is_reserved_word (str, len)
{
register char *s = wordlist[key].name;
- if (*s == *str && !strcmp (str + 1, s + 1))
+ if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
diff --git a/gcc/cp/inc/exception b/gcc/cp/inc/exception
index 1c4fda284b0..b7aa1f42d40 100644
--- a/gcc/cp/inc/exception
+++ b/gcc/cp/inc/exception
@@ -8,9 +8,7 @@
extern "C++" {
-#if 0
namespace std {
-#endif
class exception {
public:
@@ -29,14 +27,12 @@ typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate (terminate_handler);
-void terminate (void) __attribute__ ((__noreturn__));
+void terminate () __attribute__ ((__noreturn__));
unexpected_handler set_unexpected (unexpected_handler);
-void unexpected (void) __attribute__ ((__noreturn__));
+void unexpected () __attribute__ ((__noreturn__));
bool uncaught_exception ();
-#if 0
} // namespace std
-#endif
} // extern "C++"
diff --git a/gcc/cp/inc/new b/gcc/cp/inc/new
index 23fe6eb9e6b..93a3231ab69 100644
--- a/gcc/cp/inc/new
+++ b/gcc/cp/inc/new
@@ -10,9 +10,7 @@
extern "C++" {
-#if 0
namespace std {
-#endif
class bad_alloc : public exception {
public:
@@ -24,19 +22,17 @@ namespace std {
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
-#if 0
} // namespace std
-#endif
// replaceable signatures
void *operator new (size_t) throw (std::bad_alloc);
void *operator new[] (size_t) throw (std::bad_alloc);
void operator delete (void *) throw();
void operator delete[] (void *) throw();
-void *operator new (size_t, const nothrow_t&) throw();
-void *operator new[] (size_t, const nothrow_t&) throw();
-void operator delete (void *, const nothrow_t&) throw();
-void operator delete[] (void *, const nothrow_t&) throw();
+void *operator new (size_t, const std::nothrow_t&) throw();
+void *operator new[] (size_t, const std::nothrow_t&) throw();
+void operator delete (void *, const std::nothrow_t&) throw();
+void operator delete[] (void *, const std::nothrow_t&) throw();
// default placement versions of operator new
inline void *operator new(size_t, void *place) throw() { return place; }
diff --git a/gcc/cp/inc/new.h b/gcc/cp/inc/new.h
index eed0910b668..006be7efb07 100644
--- a/gcc/cp/inc/new.h
+++ b/gcc/cp/inc/new.h
@@ -5,9 +5,7 @@
#include <new>
-#if 0
using std::new_handler;
using std::set_new_handler;
-#endif
#endif // __NEW_H__
diff --git a/gcc/cp/inc/typeinfo b/gcc/cp/inc/typeinfo
index 26526594db5..cf3b521af5e 100644
--- a/gcc/cp/inc/typeinfo
+++ b/gcc/cp/inc/typeinfo
@@ -8,9 +8,7 @@
extern "C++" {
-#if 0
namespace std {
-#endif
class type_info {
private:
@@ -19,7 +17,7 @@ private:
type_info (const type_info&);
protected:
- type_info (const char *n): _name (n) { }
+ explicit type_info (const char *n): _name (n) { }
const char *_name;
@@ -63,9 +61,7 @@ class bad_typeid : public exception {
virtual ~bad_typeid () { }
};
-#if 0
} // namespace std
-#endif
} // extern "C++"
#endif
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 13472c4ef68..2386215ba4f 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -47,15 +47,13 @@ tree current_base_init_list, current_member_init_list;
static void expand_aggr_vbase_init_1 PROTO((tree, tree, tree, tree));
static void expand_aggr_vbase_init PROTO((tree, tree, tree, tree));
-static void expand_aggr_init_1 PROTO((tree, tree, tree, tree, int,
- int));
-static void expand_default_init PROTO((tree, tree, tree, tree, int,
- int));
+static void expand_aggr_init_1 PROTO((tree, tree, tree, tree, int));
+static void expand_default_init PROTO((tree, tree, tree, tree, int));
static tree build_vec_delete_1 PROTO((tree, tree, tree, tree, tree,
int));
static void perform_member_init PROTO((tree, tree, tree, int));
static void sort_base_init PROTO((tree, tree *, tree *));
-static tree build_builtin_call PROTO((tree, tree, tree));
+static tree build_builtin_delete_call PROTO((tree));
static tree build_array_eh_cleanup PROTO((tree, tree, tree));
static int member_init_ok_or_else PROTO((tree, tree, char *));
static void expand_virtual_init PROTO((tree, tree));
@@ -63,9 +61,6 @@ static tree sort_member_init PROTO((tree));
static tree build_partial_cleanup_for PROTO((tree));
static tree initializing_context PROTO((tree));
-/* Cache _builtin_new and _builtin_delete exprs. */
-static tree BIN, BID, BIVN, BIVD;
-
/* Cache the identifier nodes for the magic field of a new cookie. */
static tree nc_nelts_field_id;
@@ -80,15 +75,6 @@ void init_init_processing ()
{
tree fields[1];
- /* Define implicit `operator new' and `operator delete' functions. */
- BIN = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) NEW_EXPR])));
- TREE_USED (TREE_OPERAND (BIN, 0)) = 0;
- BID = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) DELETE_EXPR])));
- TREE_USED (TREE_OPERAND (BID, 0)) = 0;
- BIVN = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) VEC_NEW_EXPR])));
- TREE_USED (TREE_OPERAND (BIVN, 0)) = 0;
- BIVD = default_conversion (get_first_fn (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) VEC_DELETE_EXPR])));
- TREE_USED (TREE_OPERAND (BIVD, 0)) = 0;
minus_one = build_int_2 (-1, -1);
/* Define the structure that holds header information for
@@ -189,7 +175,7 @@ perform_member_init (member, name, init, explicit)
array_type_nelts (type), TREE_VALUE (init), 1);
}
else
- expand_aggr_init (decl, init, 0, 0);
+ expand_aggr_init (decl, init, 0);
}
else
{
@@ -197,9 +183,17 @@ perform_member_init (member, name, init, explicit)
{
if (explicit)
{
- cp_error ("incomplete initializer for member `%D' of class `%T' which has no constructor",
- member, current_class_type);
- init = error_mark_node;
+ /* default-initialization. */
+ if (AGGREGATE_TYPE_P (type))
+ init = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ else if (TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ cp_error ("default-initialization of `%#D', which has reference type",
+ member);
+ init = error_mark_node;
+ }
+ else
+ init = integer_zero_node;
}
/* member traversal: note it leaves init NULL */
else if (TREE_CODE (TREE_TYPE (member)) == REFERENCE_TYPE)
@@ -222,7 +216,8 @@ perform_member_init (member, name, init, explicit)
current_member_init_list. */
if (init || explicit)
{
- decl = build_component_ref (current_class_ref, name, NULL_TREE, explicit);
+ decl = build_component_ref (current_class_ref, name, NULL_TREE,
+ explicit);
expand_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
}
}
@@ -238,7 +233,8 @@ perform_member_init (member, name, init, explicit)
push_obstacks_nochange ();
resume_temporary_allocation ();
- expr = build_component_ref (current_class_ref, name, NULL_TREE, explicit);
+ expr = build_component_ref (current_class_ref, name, NULL_TREE,
+ explicit);
expr = build_delete (type, expr, integer_zero_node,
LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0);
@@ -571,11 +567,8 @@ emit_base_init (t, immediately)
if (TREE_VIA_VIRTUAL (base_binfo))
continue;
-#if 0 /* Once unsharing happens soon enough. */
- my_friendly_assert (BINFO_INHERITANCE_CHAIN (base_binfo) == t_binfo, 999);
-#else
- BINFO_INHERITANCE_CHAIN (base_binfo) = t_binfo;
-#endif
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (base_binfo) == t_binfo,
+ 999);
if (TREE_PURPOSE (rbase_init_list))
init = TREE_VALUE (rbase_init_list);
@@ -594,7 +587,7 @@ emit_base_init (t, immediately)
member = convert_pointer_to_real (base_binfo, current_class_ptr);
expand_aggr_init_1 (base_binfo, NULL_TREE,
build_indirect_ref (member, NULL_PTR), init,
- BINFO_OFFSET_ZEROP (base_binfo), LOOKUP_NORMAL);
+ LOOKUP_NORMAL);
expand_end_target_temps ();
free_temp_slots ();
@@ -789,7 +782,7 @@ expand_aggr_vbase_init_1 (binfo, exp, addr, init_list)
if (init)
init = TREE_VALUE (init);
/* Call constructors, but don't set up vtables. */
- expand_aggr_init_1 (binfo, exp, ref, init, 0, LOOKUP_COMPLAIN);
+ expand_aggr_init_1 (binfo, exp, ref, init, LOOKUP_COMPLAIN);
expand_end_target_temps ();
free_temp_slots ();
@@ -828,34 +821,6 @@ expand_aggr_vbase_init (binfo, exp, addr, init_list)
}
}
-/* Subroutine to perform parser actions for member initialization.
- S_ID is the scoped identifier.
- NAME is the name of the member.
- INIT is the initializer, or `void_type_node' if none. */
-
-void
-do_member_init (s_id, name, init)
- tree s_id, name, init;
-{
- tree binfo, base;
-
- if (current_class_type == NULL_TREE
- || ! is_aggr_typedef (s_id, 1))
- return;
- binfo = get_binfo (IDENTIFIER_TYPE_VALUE (s_id),
- current_class_type, 1);
- if (binfo == error_mark_node)
- return;
- if (binfo == 0)
- {
- error_not_base_type (IDENTIFIER_TYPE_VALUE (s_id), current_class_type);
- return;
- }
-
- base = convert_pointer_to (binfo, current_class_ptr);
- expand_member_init (build_indirect_ref (base, NULL_PTR), name, init);
-}
-
/* Find the context in which this FIELD can be initialized. */
static tree
@@ -866,7 +831,7 @@ initializing_context (field)
/* Anonymous union members can be initialized in the first enclosing
non-anonymous union context. */
- while (t && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ while (t && ANON_UNION_TYPE_P (t))
t = TYPE_CONTEXT (t);
return t;
}
@@ -922,11 +887,8 @@ void
expand_member_init (exp, name, init)
tree exp, name, init;
{
- extern tree ptr_type_node; /* should be in tree.h */
-
tree basetype = NULL_TREE, field;
- tree parm;
- tree rval = NULL_TREE, type;
+ tree type;
if (exp == NULL_TREE)
return; /* complain about this later */
@@ -954,165 +916,84 @@ expand_member_init (exp, name, init)
return;
}
- if (init)
- {
- /* The grammar should not allow fields which have names
- that are TYPENAMEs. Therefore, if the field has
- a non-NULL TREE_TYPE, we may assume that this is an
- attempt to initialize a base class member of the current
- type. Otherwise, it is an attempt to initialize a
- member field. */
+ my_friendly_assert (init != NULL_TREE, 0);
- if (init == void_type_node)
- init = NULL_TREE;
+ /* The grammar should not allow fields which have names that are
+ TYPENAMEs. Therefore, if the field has a non-NULL TREE_TYPE, we
+ may assume that this is an attempt to initialize a base class
+ member of the current type. Otherwise, it is an attempt to
+ initialize a member field. */
- if (name == NULL_TREE || basetype)
- {
- tree base_init;
-
- if (name == NULL_TREE)
- {
-#if 0
- if (basetype)
- name = TYPE_IDENTIFIER (basetype);
- else
- {
- error ("no base class to initialize");
- return;
- }
-#endif
- }
- else if (basetype != type
- && ! current_template_parms
- && ! vec_binfo_member (basetype,
- TYPE_BINFO_BASETYPES (type))
- && ! binfo_member (basetype, CLASSTYPE_VBASECLASSES (type)))
- {
- if (IDENTIFIER_CLASS_VALUE (name))
- goto try_member;
- if (TYPE_USES_VIRTUAL_BASECLASSES (type))
- cp_error ("type `%T' is not an immediate or virtual basetype for `%T'",
- basetype, type);
- else
- cp_error ("type `%T' is not an immediate basetype for `%T'",
- basetype, type);
- return;
- }
-
- if (purpose_member (basetype, current_base_init_list))
- {
- cp_error ("base class `%T' already initialized", basetype);
- return;
- }
+ if (init == void_type_node)
+ init = NULL_TREE;
- if (warn_reorder && current_member_init_list)
- {
- cp_warning ("base initializer for `%T'", basetype);
- warning (" will be re-ordered to precede member initializations");
- }
+ if (name == NULL_TREE || basetype)
+ {
+ tree base_init;
- base_init = build_tree_list (basetype, init);
- current_base_init_list = chainon (current_base_init_list, base_init);
- }
- else
+ if (name == NULL_TREE)
{
- tree member_init;
-
- try_member:
- field = lookup_field (type, name, 1, 0);
-
- if (! member_init_ok_or_else (field, type, IDENTIFIER_POINTER (name)))
- return;
-
- if (purpose_member (name, current_member_init_list))
+#if 0
+ if (basetype)
+ name = TYPE_IDENTIFIER (basetype);
+ else
{
- cp_error ("field `%D' already initialized", field);
+ error ("no base class to initialize");
return;
}
-
- member_init = build_tree_list (name, init);
- current_member_init_list = chainon (current_member_init_list, member_init);
+#endif
}
- return;
- }
- else if (name == NULL_TREE)
- {
- compiler_error ("expand_member_init: name == NULL_TREE");
- return;
- }
-
- basetype = type;
- field = lookup_field (basetype, name, 0, 0);
-
- if (! member_init_ok_or_else (field, basetype, IDENTIFIER_POINTER (name)))
- return;
-
- /* now see if there is a constructor for this type
- which will take these args. */
-
- if (TYPE_HAS_CONSTRUCTOR (TREE_TYPE (field)))
- {
- tree parmtypes, fndecl;
-
- if (TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == PARM_DECL)
- {
- /* just know that we've seen something for this node */
- DECL_INITIAL (exp) = error_mark_node;
- TREE_USED (exp) = 1;
+ else if (basetype != type
+ && ! current_template_parms
+ && ! vec_binfo_member (basetype,
+ TYPE_BINFO_BASETYPES (type))
+ && ! binfo_member (basetype, CLASSTYPE_VBASECLASSES (type)))
+ {
+ if (IDENTIFIER_CLASS_VALUE (name))
+ goto try_member;
+ if (TYPE_USES_VIRTUAL_BASECLASSES (type))
+ cp_error ("type `%T' is not an immediate or virtual basetype for `%T'",
+ basetype, type);
+ else
+ cp_error ("type `%T' is not an immediate basetype for `%T'",
+ basetype, type);
+ return;
}
- type = TYPE_MAIN_VARIANT (TREE_TYPE (field));
- parm = build_component_ref (exp, name, NULL_TREE, 0);
- /* Now get to the constructors. */
- fndecl = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), 0);
-
- if (fndecl)
- my_friendly_assert (TREE_CODE (fndecl) == FUNCTION_DECL, 209);
-
- /* If the field is unique, we can use the parameter
- types to guide possible type instantiation. */
- if (DECL_CHAIN (fndecl) == NULL_TREE)
+ if (purpose_member (basetype, current_base_init_list))
{
- /* There was a confusion here between
- FIELD and FNDECL. The following code
- should be correct, but abort is here
- to make sure. */
- my_friendly_abort (48);
- parmtypes = FUNCTION_ARG_CHAIN (fndecl);
+ cp_error ("base class `%T' already initialized", basetype);
+ return;
}
- else
+
+ if (warn_reorder && current_member_init_list)
{
- parmtypes = NULL_TREE;
- fndecl = NULL_TREE;
+ cp_warning ("base initializer for `%T'", basetype);
+ warning (" will be re-ordered to precede member initializations");
}
- init = convert_arguments (parm, parmtypes, NULL_TREE, fndecl, LOOKUP_NORMAL);
- if (init == NULL_TREE || TREE_TYPE (init) != error_mark_node)
- rval = build_method_call (NULL_TREE, ctor_identifier, init,
- TYPE_BINFO (type), LOOKUP_NORMAL);
- else
+ base_init = build_tree_list (basetype, init);
+ current_base_init_list = chainon (current_base_init_list, base_init);
+ }
+ else
+ {
+ tree member_init;
+
+ try_member:
+ field = lookup_field (type, name, 1, 0);
+
+ if (! member_init_ok_or_else (field, type, IDENTIFIER_POINTER (name)))
return;
- if (rval != error_mark_node)
+ if (purpose_member (name, current_member_init_list))
{
- /* Now, fill in the first parm with our guy */
- TREE_VALUE (TREE_OPERAND (rval, 1))
- = build_unary_op (ADDR_EXPR, parm, 0);
- TREE_TYPE (rval) = ptr_type_node;
- TREE_SIDE_EFFECTS (rval) = 1;
+ cp_error ("field `%D' already initialized", field);
+ return;
}
- }
- else if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (field)))
- {
- parm = build_component_ref (exp, name, NULL_TREE, 0);
- expand_aggr_init (parm, NULL_TREE, 0, 0);
- rval = error_mark_node;
- }
- /* Now initialize the member. It does not have to
- be of aggregate type to receive initialization. */
- if (rval != error_mark_node)
- expand_expr_stmt (rval);
+ member_init = build_tree_list (name, init);
+ current_member_init_list = chainon (current_member_init_list, member_init);
+ }
}
/* This is like `expand_member_init', only it stores one aggregate
@@ -1154,9 +1035,8 @@ expand_member_init (exp, name, init)
perform the initialization, but not both, as it would be ambiguous. */
void
-expand_aggr_init (exp, init, alias_this, flags)
+expand_aggr_init (exp, init, flags)
tree exp, init;
- int alias_this;
int flags;
{
tree type = TREE_TYPE (exp);
@@ -1225,18 +1105,17 @@ expand_aggr_init (exp, init, alias_this, flags)
TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type);
expand_aggr_init_1 (TYPE_BINFO (type), exp, exp,
- init, alias_this, LOOKUP_NORMAL|flags);
+ init, LOOKUP_NORMAL|flags);
TREE_TYPE (exp) = type;
TREE_READONLY (exp) = was_const;
TREE_THIS_VOLATILE (exp) = was_volatile;
}
static void
-expand_default_init (binfo, true_exp, exp, init, alias_this, flags)
+expand_default_init (binfo, true_exp, exp, init, flags)
tree binfo;
tree true_exp, exp;
tree init;
- int alias_this;
int flags;
{
tree type = TREE_TYPE (exp);
@@ -1302,7 +1181,8 @@ expand_default_init (binfo, true_exp, exp, init, alias_this, flags)
rval = build_method_call (exp, ctor_identifier,
parms, binfo, flags);
- expand_expr_stmt (rval);
+ if (TREE_SIDE_EFFECTS (rval))
+ expand_expr_stmt (rval);
}
/* This function is responsible for initializing EXP with INIT
@@ -1328,11 +1208,10 @@ expand_default_init (binfo, true_exp, exp, init, alias_this, flags)
its description. */
static void
-expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
+expand_aggr_init_1 (binfo, true_exp, exp, init, flags)
tree binfo;
tree true_exp, exp;
tree init;
- int alias_this;
int flags;
{
tree type = TREE_TYPE (exp);
@@ -1363,7 +1242,7 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
/* We know that expand_default_init can handle everything we want
at this point. */
- expand_default_init (binfo, true_exp, exp, init, alias_this, flags);
+ expand_default_init (binfo, true_exp, exp, init, flags);
}
/* Report an error if NAME is not the name of a user-defined,
@@ -1483,6 +1362,15 @@ build_member_call (type, name, parmlist)
int dont_use_this = 0;
tree basetype_path, decl;
+ if (TREE_CODE (name) == TEMPLATE_ID_EXPR
+ && TREE_CODE (type) == NAMESPACE_DECL)
+ {
+ /* 'name' already refers to the decls from the namespace, since we
+ hit do_identifier for template_ids. */
+ my_friendly_assert (is_overloaded_fn (TREE_OPERAND (name, 0)), 980519);
+ return build_x_function_call (name, parmlist, current_class_ref);
+ }
+
if (type == std_node)
return build_x_function_call (do_scoped_id (name, 0), parmlist,
current_class_ref);
@@ -1617,10 +1505,10 @@ build_offset_ref (type, name)
{
tree decl, fnfields, fields, t = error_mark_node;
tree basebinfo = NULL_TREE;
- int dtor = 0;
+ tree orig_name = name;
/* class templates can come in as TEMPLATE_DECLs here. */
- if (TREE_CODE (name) != IDENTIFIER_NODE)
+ if (TREE_CODE (name) == TEMPLATE_DECL)
return name;
if (type == std_node)
@@ -1631,44 +1519,53 @@ build_offset_ref (type, name)
/* Handle namespace names fully here. */
if (TREE_CODE (type) == NAMESPACE_DECL)
- return lookup_namespace_name (type, name);
+ {
+ t = lookup_namespace_name (type, name);
+ if (t != error_mark_node && ! type_unknown_p (t))
+ {
+ mark_used (t);
+ t = convert_from_reference (t);
+ }
+ return t;
+ }
if (type == NULL_TREE || ! is_aggr_type (type, 1))
return error_mark_node;
- if (TREE_CODE (name) == BIT_NOT_EXPR)
+ if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
- dtor = 1;
- name = TREE_OPERAND (name, 0);
+ /* If the NAME is a TEMPLATE_ID_EXPR, we are looking at
+ something like `a.template f<int>' or the like. For the most
+ part, we treat this just like a.f. We do remember, however,
+ the template-id that was used. */
+ name = TREE_OPERAND (orig_name, 0);
+
+ if (TREE_CODE (name) == LOOKUP_EXPR)
+ /* This can happen during tsubst'ing. */
+ name = TREE_OPERAND (name, 0);
+
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
}
- if (name == constructor_name_full (type))
- name = constructor_name (type);
+ if (TREE_CODE (name) == BIT_NOT_EXPR)
+ {
+ if (! check_dtor_name (type, name))
+ cp_error ("qualified type `%T' does not match destructor name `~%T'",
+ type, TREE_OPERAND (name, 0));
+ name = dtor_identifier;
+ }
+#if 0
+ /* I think this is wrong, but the draft is unclear. --jason 6/15/98 */
+ else if (name == constructor_name_full (type)
+ || name == constructor_name (type))
+ name = ctor_identifier;
+#endif
- if (TYPE_SIZE (complete_type (type)) == 0)
+ if (TYPE_SIZE (complete_type (type)) == 0
+ && !TYPE_BEING_DEFINED (type))
{
- if (type == current_class_type)
- t = IDENTIFIER_CLASS_VALUE (name);
- else
- t = NULL_TREE;
- if (t == 0)
- {
- cp_error ("incomplete type `%T' does not have member `%D'", type,
- name);
- return error_mark_node;
- }
- if (TREE_CODE (t) == TYPE_DECL || TREE_CODE (t) == VAR_DECL
- || TREE_CODE (t) == CONST_DECL)
- {
- mark_used (t);
- return t;
- }
- if (TREE_CODE (t) == FIELD_DECL)
- sorry ("use of member in incomplete aggregate type");
- else if (TREE_CODE (t) == FUNCTION_DECL)
- sorry ("use of member function in incomplete aggregate type");
- else
- my_friendly_abort (52);
+ cp_error ("incomplete type `%T' does not have member `%D'", type,
+ name);
return error_mark_node;
}
@@ -1683,18 +1580,6 @@ build_offset_ref (type, name)
else
decl = current_class_ref;
- if (constructor_name (BINFO_TYPE (basebinfo)) == name)
- {
- if (dtor)
- name = dtor_identifier;
- else
- name = ctor_identifier;
- }
- else
- if (dtor)
- my_friendly_abort (999);
-
-
fnfields = lookup_fnfields (basebinfo, name, 1);
fields = lookup_field (basebinfo, name, 0, 0);
@@ -1705,17 +1590,41 @@ build_offset_ref (type, name)
lookup_fnfield. */
if (fnfields)
{
- extern int flag_save_memoized_contexts;
- basebinfo = TREE_PURPOSE (fnfields);
-
/* Go from the TREE_BASELINK to the member function info. */
t = TREE_VALUE (fnfields);
- if (DECL_CHAIN (t) == NULL_TREE)
+ if (TREE_CODE (orig_name) == TEMPLATE_ID_EXPR)
+ {
+ /* The FNFIELDS are going to contain functions that aren't
+ necessarily templates, and templates that don't
+ necessarily match the explicit template parameters. We
+ save all the functions, and the explicit parameters, and
+ then figure out exactly what to instantiate with what
+ arguments in instantiate_type. */
+
+ if (TREE_CODE (t) != OVERLOAD)
+ /* The code in instantiate_type which will process this
+ expects to encounter OVERLOADs, not raw functions. */
+ t = ovl_cons (t, NULL_TREE);
+
+ return build (OFFSET_REF,
+ build_offset_type (type, unknown_type_node),
+ decl,
+ build (TEMPLATE_ID_EXPR,
+ TREE_TYPE (t),
+ t,
+ TREE_OPERAND (orig_name, 1)));
+ }
+
+ if (!really_overloaded_fn (t))
{
tree access;
+ /* Get rid of a potential OVERLOAD around it */
+ t = OVL_CURRENT (t);
+
/* unique functions are handled easily. */
+ basebinfo = TREE_PURPOSE (fnfields);
access = compute_access (basebinfo, t);
if (access == access_protected_node)
{
@@ -1735,15 +1644,13 @@ build_offset_ref (type, name)
/* FNFIELDS is most likely allocated on the search_obstack,
which will go away after this class scope. If we need
- to save this value for later (either for memoization
- or for use as an initializer for a static variable), then
- do so here.
+ to save this value for later (i.e. for use as an initializer
+ for a static variable), then do so here.
??? The smart thing to do for the case of saving initializers
is to resolve them before we're done with this scope. */
if (!TREE_PERMANENT (fnfields)
- && ((flag_save_memoized_contexts && global_bindings_p ())
- || ! allocation_temporary_p ()))
+ && ! allocation_temporary_p ())
fnfields = copy_list (fnfields);
t = build_tree_list (error_mark_node, fnfields);
@@ -1867,7 +1774,9 @@ resolve_offset_ref (exp)
|| (TREE_CODE (base) == NOP_EXPR
&& TREE_OPERAND (base, 0) == error_mark_node)))
{
- tree basetype_path, access;
+ tree basetype_path;
+ tree access;
+ tree expr;
if (TREE_CODE (exp) == OFFSET_REF && TREE_CODE (type) == OFFSET_TYPE)
basetype = TYPE_OFFSET_BASETYPE (type);
@@ -1881,24 +1790,27 @@ resolve_offset_ref (exp)
error_not_base_type (basetype, TREE_TYPE (TREE_TYPE (base)));
return error_mark_node;
}
- addr = convert_pointer_to (basetype, base);
+ /* Kludge: we need to use basetype_path now, because
+ convert_pointer_to will bash it. */
access = compute_access (basetype_path, member);
- if (access == access_public_node)
- return build (COMPONENT_REF, TREE_TYPE (member),
- build_indirect_ref (addr, NULL_PTR), member);
- if (access == access_protected_node)
- {
- cp_error_at ("member `%D' is protected", member);
- error ("in this context");
- return error_mark_node;
- }
- if (access == access_private_node)
+ addr = convert_pointer_to (basetype, base);
+
+ /* Issue errors if there was an access violation. */
+ if (access != access_public_node)
{
- cp_error_at ("member `%D' is private", member);
- error ("in this context");
- return error_mark_node;
- }
- my_friendly_abort (55);
+ cp_error_at ("member `%D' is %s",
+ access == access_private_node
+ ? "private" : "protected",
+ member);
+ cp_error ("in this context");
+ }
+
+ /* Even in the case of illegal access, we form the
+ COMPONENT_REF; that will allow better error recovery than
+ just feeding back error_mark_node. */
+ expr = build (COMPONENT_REF, TREE_TYPE (member),
+ build_indirect_ref (addr, NULL_PTR), member);
+ return convert_from_reference (expr);
}
/* Ensure that we have an object. */
@@ -1906,13 +1818,11 @@ resolve_offset_ref (exp)
&& TREE_OPERAND (base, 0) == error_mark_node)
addr = error_mark_node;
else
- {
- /* If this is a reference to a member function, then return the
- address of the member function (which may involve going
- through the object's vtable), otherwise, return an expression
- for the dereferenced pointer-to-member construct. */
- addr = build_unary_op (ADDR_EXPR, base, 0);
- }
+ /* If this is a reference to a member function, then return the
+ address of the member function (which may involve going
+ through the object's vtable), otherwise, return an expression
+ for the dereferenced pointer-to-member construct. */
+ addr = build_unary_op (ADDR_EXPR, base, 0);
if (TREE_CODE (TREE_TYPE (member)) == OFFSET_TYPE)
{
@@ -1954,48 +1864,31 @@ decl_constant_value (decl)
tree decl;
{
if (! TREE_THIS_VOLATILE (decl)
-#if 0
- /* These may be necessary for C, but they break C++. */
- ! TREE_PUBLIC (decl)
- /* Don't change a variable array bound or initial value to a constant
- in a place where a variable is invalid. */
- && ! pedantic
-#endif /* 0 */
- && DECL_INITIAL (decl) != 0
+ && DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node
/* This is invalid if initial value is not constant.
If it has either a function call, a memory reference,
or a variable, then re-evaluating it could give different results. */
&& TREE_CONSTANT (DECL_INITIAL (decl))
/* Check for cases where this is sub-optimal, even though valid. */
- && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR
-#if 0
- /* We must allow this to work outside of functions so that
- static constants can be used for array sizes. */
- && current_function_decl != 0
- && DECL_MODE (decl) != BLKmode
-#endif
- )
+ && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR)
return DECL_INITIAL (decl);
return decl;
}
/* Common subroutines of build_new and build_vec_delete. */
-/* Common interface for calling "builtin" functions that are not
- really builtin. */
+/* Call the global __builtin_delete to delete ADDR. */
static tree
-build_builtin_call (type, node, arglist)
- tree type;
- tree node;
- tree arglist;
+build_builtin_delete_call (addr)
+ tree addr;
{
- tree rval = build (CALL_EXPR, type, node, arglist, NULL_TREE);
- TREE_SIDE_EFFECTS (rval) = 1;
- assemble_external (TREE_OPERAND (node, 0));
- TREE_USED (TREE_OPERAND (node, 0)) = 1;
- return rval;
+ tree BID = get_first_fn
+ (IDENTIFIER_GLOBAL_VALUE (ansi_opname[(int) DELETE_EXPR]));
+
+ assemble_external (BID);
+ return build_call (BID, void_type_node, build_expr_list (NULL_TREE, addr));
}
/* Generate a C++ "new" expression. DECL is either a TREE_LIST
@@ -2208,6 +2101,46 @@ build_new (placement, decl, init, use_global_new)
return rval;
}
+/* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
+
+static tree jclass_node = NULL_TREE;
+
+/* Given a Java class, return a decl for the corresponding java.lang.Class. */
+
+tree
+build_java_class_ref (type)
+ tree type;
+{
+ tree name, class_decl;
+ static tree CL_prefix = NULL_TREE;
+ if (CL_prefix == NULL_TREE)
+ CL_prefix = get_identifier("_CL_");
+ if (jclass_node == NULL_TREE)
+ {
+ jclass_node = IDENTIFIER_GLOBAL_VALUE (get_identifier("jclass"));
+ if (jclass_node == NULL_TREE)
+ fatal("call to Java constructor, while `jclass' undefined");
+ jclass_node = TREE_TYPE (jclass_node);
+ }
+ name = build_overload_with_type (CL_prefix, type);
+ class_decl = IDENTIFIER_GLOBAL_VALUE (name);
+ if (class_decl == NULL_TREE)
+ {
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+ class_decl = build_decl (VAR_DECL, name, TREE_TYPE (jclass_node));
+ TREE_STATIC (class_decl) = 1;
+ DECL_EXTERNAL (class_decl) = 1;
+ TREE_PUBLIC (class_decl) = 1;
+ DECL_ARTIFICIAL (class_decl) = 1;
+ DECL_IGNORED_P (class_decl) = 1;
+ pushdecl_top_level (class_decl);
+ make_decl_rtl (class_decl, NULL_PTR, 1);
+ pop_obstacks ();
+ }
+ return class_decl;
+}
+
/* Called from cplus_expand_expr when expanding a NEW_EXPR. The return
value is immediately handed to expand_expr. */
@@ -2223,6 +2156,7 @@ build_new_1 (exp)
enum tree_code code = NEW_EXPR;
int use_cookie, nothrow, check_new;
int use_global_new;
+ int use_java_new = 0;
placement = TREE_OPERAND (exp, 0);
type = TREE_OPERAND (exp, 1);
@@ -2249,11 +2183,8 @@ build_new_1 (exp)
true_type = TREE_TYPE (true_type);
}
- if (TYPE_SIZE (complete_type (true_type)) == 0)
- {
- incomplete_type_error (0, true_type);
- return error_mark_node;
- }
+ if (!complete_type_or_else (true_type))
+ return error_mark_node;
if (has_array)
size = fold (build_binary_op (MULT_EXPR, size_in_bytes (true_type),
@@ -2261,7 +2192,7 @@ build_new_1 (exp)
else
size = size_in_bytes (type);
- if (true_type == void_type_node)
+ if (TREE_CODE (true_type) == VOID_TYPE)
{
error ("invalid type `void' for new");
return error_mark_node;
@@ -2323,12 +2254,39 @@ build_new_1 (exp)
return error_mark_node;
}
}
+ else if (! placement && TYPE_FOR_JAVA (true_type))
+ {
+ tree class_addr, alloc_decl;
+ tree class_decl = build_java_class_ref (true_type);
+ tree class_size = size_in_bytes (true_type);
+ static char alloc_name[] = "_Jv_AllocObject";
+ use_java_new = 1;
+ alloc_decl = IDENTIFIER_GLOBAL_VALUE (get_identifier (alloc_name));
+ if (alloc_decl == NULL_TREE)
+ fatal("call to Java constructor, while `%s' undefined", alloc_name);
+ class_addr = build1 (ADDR_EXPR, jclass_node, class_decl);
+ rval = build_function_call (alloc_decl,
+ tree_cons (NULL_TREE, class_addr,
+ build_tree_list (NULL_TREE,
+ class_size)));
+ rval = cp_convert (build_pointer_type (true_type), rval);
+ }
else
{
+ int susp = 0;
+
+ if (flag_exceptions)
+ /* We will use RVAL when generating an exception handler for
+ this new-expression, so we must save it. */
+ susp = suspend_momentary ();
+
rval = build_op_new_call
(code, true_type, expr_tree_cons (NULL_TREE, size, placement),
LOOKUP_NORMAL | (use_global_new * LOOKUP_GLOBAL));
rval = cp_convert (build_pointer_type (true_type), rval);
+
+ if (flag_exceptions)
+ resume_momentary (susp);
}
/* unless an allocation function is declared with an empty excep-
@@ -2353,7 +2311,7 @@ build_new_1 (exp)
if (t && TREE_VALUE (t) == NULL_TREE)
nothrow = 1;
}
- check_new = flag_check_new || nothrow;
+ check_new = (flag_check_new || nothrow) && ! use_java_new;
if ((check_new || flag_exceptions) && rval)
{
@@ -2400,12 +2358,26 @@ build_new_1 (exp)
if (! TYPE_NEEDS_CONSTRUCTING (type)
&& ! IS_AGGR_TYPE (type) && ! has_array)
{
- /* New 2.0 interpretation: `new int (10)' means
- allocate an int, and initialize it with 10. */
+ /* We are processing something like `new int (10)', which
+ means allocate an int, and initialize it with 10. */
tree deref;
+ tree deref_type;
+ /* At present RVAL is a temporary variable, created to hold
+ the value from the call to `operator new'. We transform
+ it to (*RVAL = INIT, RVAL). */
rval = save_expr (rval);
deref = build_indirect_ref (rval, NULL_PTR);
+
+ /* Even for something like `new const int (10)' we must
+ allow the expression to be non-const while we do the
+ initialization. */
+ deref_type = TREE_TYPE (deref);
+ if (TYPE_READONLY (deref_type))
+ TREE_TYPE (deref)
+ = cp_build_type_variant (deref_type,
+ /*constp=*/0,
+ TYPE_VOLATILE (deref_type));
TREE_READONLY (deref) = 0;
if (TREE_CHAIN (init) != NULL_TREE)
@@ -2439,6 +2411,8 @@ build_new_1 (exp)
flags |= LOOKUP_HAS_IN_CHARGE;
}
+ if (use_java_new)
+ rval = save_expr (rval);
newrval = rval;
if (newrval && TREE_CODE (TREE_TYPE (newrval)) == POINTER_TYPE)
@@ -2450,6 +2424,10 @@ build_new_1 (exp)
if (newrval == NULL_TREE || newrval == error_mark_node)
return error_mark_node;
+ /* Java constructors compiled by jc1 do not return this. */
+ if (use_java_new)
+ newrval = build (COMPOUND_EXPR, TREE_TYPE (newrval),
+ newrval, rval);
rval = newrval;
TREE_HAS_CONSTRUCTOR (rval) = 1;
}
@@ -2461,25 +2439,29 @@ build_new_1 (exp)
an exception and the new-expression does not contain a
new-placement, then the deallocation function is called to free
the memory in which the object was being constructed. */
- if (flag_exceptions && alloc_expr)
+ if (flag_exceptions && alloc_expr && ! use_java_new)
{
enum tree_code dcode = has_array ? VEC_DELETE_EXPR : DELETE_EXPR;
- tree cleanup;
+ tree cleanup, fn = NULL_TREE;
int flags = LOOKUP_NORMAL | (use_global_new * LOOKUP_GLOBAL);
/* All cleanups must last longer than normal. */
int yes = suspend_momentary ();
if (placement)
- flags |= LOOKUP_SPECULATIVELY;
+ {
+ flags |= LOOKUP_SPECULATIVELY;
+
+ /* We expect alloc_expr to look like a TARGET_EXPR around
+ a NOP_EXPR around the CALL_EXPR we want. */
+ fn = TREE_OPERAND (alloc_expr, 1);
+ fn = TREE_OPERAND (fn, 0);
+ }
/* Copy size to the saveable obstack. */
size = copy_node (size);
- /* If we have a new-placement, we need to pass the alloc TARGET_EXPR
- to build_op_delete_call so it can extract the args. */
- cleanup = build_op_delete_call
- (dcode, placement ? alloc_expr : alloc_node, size, flags);
+ cleanup = build_op_delete_call (dcode, alloc_node, size, flags, fn);
resume_momentary (yes);
@@ -2616,7 +2598,7 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete,
/* This is the real size */
virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size);
body = build_expr_list (NULL_TREE,
- build_x_delete (ptype, base_tbd,
+ build_x_delete (base_tbd,
2 | use_global_delete,
virtual_size));
body = build (COND_EXPR, void_type_node,
@@ -2673,7 +2655,7 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete,
/* True size with header. */
virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size);
}
- deallocate_expr = build_x_delete (ptype, base_tbd,
+ deallocate_expr = build_x_delete (base_tbd,
2 | use_global_delete,
virtual_size);
if (auto_delete_vec != integer_one_node)
@@ -2787,7 +2769,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
while (elts)
{
host_i -= 1;
- expand_aggr_init (baseref, TREE_VALUE (elts), 0, 0);
+ expand_aggr_init (baseref, TREE_VALUE (elts), 0);
expand_assignment (base, baseinc, 0, 0);
elts = TREE_CHAIN (elts);
@@ -2877,7 +2859,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
if (from_array == 2)
expand_expr_stmt (build_modify_expr (to, NOP_EXPR, from));
else if (TYPE_NEEDS_CONSTRUCTING (type))
- expand_aggr_init (to, from, 0, 0);
+ expand_aggr_init (to, from, 0);
else if (from)
expand_assignment (to, from, 0, 0);
else
@@ -2891,7 +2873,7 @@ expand_vec_init (decl, base, maxindex, init, from_array)
array_type_nelts (type), 0, 0);
}
else
- expand_aggr_init (build1 (INDIRECT_REF, type, base), init, 0, 0);
+ expand_aggr_init (build1 (INDIRECT_REF, type, base), init, 0);
expand_assignment (base,
build (PLUS_EXPR, build_pointer_type (type), base, size),
@@ -2969,8 +2951,8 @@ expand_vec_init (decl, base, maxindex, init, from_array)
This does not call any destructors. */
tree
-build_x_delete (type, addr, which_delete, virtual_size)
- tree type, addr;
+build_x_delete (addr, which_delete, virtual_size)
+ tree addr;
int which_delete;
tree virtual_size;
{
@@ -2979,7 +2961,7 @@ build_x_delete (type, addr, which_delete, virtual_size)
enum tree_code code = use_vec_delete ? VEC_DELETE_EXPR : DELETE_EXPR;
int flags = LOOKUP_NORMAL | (use_global_delete * LOOKUP_GLOBAL);
- return build_op_delete_call (code, addr, virtual_size, flags);
+ return build_op_delete_call (code, addr, virtual_size, flags, NULL_TREE);
}
/* Generate a call to a destructor. TYPE is the type to cast ADDR to.
@@ -3018,18 +3000,14 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
if (TREE_CODE (type) == POINTER_TYPE)
{
type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
- if (TYPE_SIZE (complete_type (type)) == 0)
- {
- incomplete_type_error (0, type);
- return error_mark_node;
- }
+ if (!complete_type_or_else (type))
+ return error_mark_node;
if (TREE_CODE (type) == ARRAY_TYPE)
goto handle_array;
if (! IS_AGGR_TYPE (type))
{
/* Call the builtin operator delete. */
- return build_builtin_call (void_type_node, BID,
- build_expr_list (NULL_TREE, addr));
+ return build_builtin_delete_call (addr);
}
if (TREE_SIDE_EFFECTS (addr))
addr = save_expr (addr);
@@ -3078,7 +3056,8 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
return build_op_delete_call
(DELETE_EXPR, addr, c_sizeof_nowarn (type),
- LOOKUP_NORMAL | (use_global_delete * LOOKUP_GLOBAL));
+ LOOKUP_NORMAL | (use_global_delete * LOOKUP_GLOBAL),
+ NULL_TREE);
}
/* Below, we will reverse the order in which these calls are made.
@@ -3094,8 +3073,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
{
tree cond = fold (build (BIT_AND_EXPR, integer_type_node,
auto_delete, integer_one_node));
- tree call = build_builtin_call
- (void_type_node, BID, build_expr_list (NULL_TREE, addr));
+ tree call = build_builtin_delete_call (addr);
cond = fold (build (COND_EXPR, void_type_node, cond,
call, void_zero_node));
@@ -3147,8 +3125,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
{
cond = build (COND_EXPR, void_type_node,
build (BIT_AND_EXPR, integer_type_node, auto_delete, integer_one_node),
- build_builtin_call (void_type_node, BID,
- build_expr_list (NULL_TREE, addr)),
+ build_builtin_delete_call (addr),
void_zero_node);
}
else
diff --git a/gcc/cp/input.c b/gcc/cp/input.c
index 5e4fd5fca55..5a73fea8bd0 100644
--- a/gcc/cp/input.c
+++ b/gcc/cp/input.c
@@ -59,6 +59,14 @@ extern int lineno;
#define inline
#endif
+#if USE_CPPLIB
+extern unsigned char *yy_cur, *yy_lim;
+extern int yy_get_token ();
+#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
+#else
+#define GETC() getc (finput)
+#endif
+
extern void feed_input PROTO((char *, int));
extern void put_input PROTO((int));
extern void put_back PROTO((int));
@@ -168,7 +176,7 @@ sub_getch ()
}
return (unsigned char)input->str[input->offset++];
}
- return getc (finput);
+ return GETC ();
}
inline
diff --git a/gcc/cp/lang-options.h b/gcc/cp/lang-options.h
index f4f262dc062..32f5ff90509 100644
--- a/gcc/cp/lang-options.h
+++ b/gcc/cp/lang-options.h
@@ -1,5 +1,5 @@
/* Definitions for switches for C++.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,102 +18,112 @@ 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_LANG_NAME ("C++")
+
/* This is the contribution to the `lang_options' array in gcc.c for
g++. */
- "-+e0", /* gcc.c tacks the `-' on the front. */
- "-+e1",
- "-+e2",
- "-faccess-control",
- "-fno-access-control",
- "-fall-virtual",
- "-fno-all-virtual",
- "-falt-external-templates",
- "-fno-alt-external-templates",
- "-fansi-overloading",
- "-fno-ansi-overloading",
- "-fcheck-new",
- "-fno-check-new",
- "-fconserve-space",
- "-fno-conserve-space",
- "-fdefault-inline",
- "-fno-default-inline",
- "-frtti",
- "-fno-rtti",
- "-felide-constructors",
- "-fno-elide-constructors",
- "-fenum-int-equiv",
- "-fno-enum-int-equiv",
- "-fexternal-templates",
- "-fno-external-templates",
- "-ffor-scope",
- "-fno-for-scope",
- "-fguiding-decls",
- "-fno-guiding-decls",
- "-fgnu-keywords",
- "-fno-gnu-keywords",
- "-fhandle-exceptions",
- "-fno-handle-exceptions",
- "-fhandle-signatures",
- "-fno-handle-signatures",
- "-fhuge-objects",
- "-fno-huge-objects",
- "-fimplement-inlines",
- "-fno-implement-inlines",
- "-fimplicit-templates",
- "-fno-implicit-templates",
- "-flabels-ok",
- "-fno-labels-ok",
- "-fmemoize-lookups",
- "-fno-memoize-lookups",
- "-fname-mangling-version-",
- "-fnew-abi",
- "-fno-new-abi",
- "-fnonnull-objects",
- "-fno-nonnull-objects",
- "-foperator-names",
- "-fno-operator-names",
- "-frepo",
- "-fno-repo",
- "-fsave-memoized",
- "-fno-save-memoized",
- "-fsquangle",
- "-fno-squangle",
- "-fstats",
- "-fno-stats",
- "-fstrict-prototype",
- "-fno-strict-prototype",
- "-ftemplate-depth-",
- "-fthis-is-variable",
- "-fno-this-is-variable",
- "-fvtable-thunks",
- "-fno-vtable-thunks",
- "-fweak",
- "-fno-weak",
- "-fxref",
- "-fno-xref",
+ { "-faccess-control", "" },
+ { "-fno-access-control", "Do not obey access control semantics" },
+ { "-fall-virtual", "Make all member functions virtual" },
+ { "-fno-all-virtual", "" },
+ { "-falt-external-templates", "Change when template instances are emitted" },
+ { "-fno-alt-external-templates", "" },
+ { "-fansi-overloading", "" },
+ { "-fno-ansi-overloading", "" },
+ { "-fcheck-new", "Check the return value of new" },
+ { "-fno-check-new", "" },
+ { "-fconserve-space", "Reduce size of object files" },
+ { "-fno-conserve-space", "" },
+ { "-fconst-strings", "" },
+ { "-fno-const-strings", "Make string literals `char[]' instead of `const char[]'" },
+ { "-fdefault-inline", "" },
+ { "-fno-default-inline", "Do not inline member functions by default"},
+ { "-frtti", "" },
+ { "-fno-rtti", "Do not generate run time type descriptor information" },
+ { "-felide-constructors", "" },
+ { "-fno-elide-constructors", "" },
+ { "-fenum-int-equiv", "" },
+ { "-fno-enum-int-equiv", "" },
+ { "-fexternal-templates", "" },
+ { "-fno-external-templates", "" },
+ { "-ffor-scope", "" },
+ { "-fno-for-scope", "Scope of for-init-statement vars extends outside" },
+ { "-fguiding-decls", "Implement guiding declarations" },
+ { "-fno-guiding-decls", "" },
+ { "-fgnu-keywords", "" },
+ { "-fno-gnu-keywords", "Do not recognise GNU defined keywords" },
+ { "-fhandle-exceptions", "" },
+ { "-fno-handle-exceptions", "" },
+ { "-fhandle-signatures", "Handle signature language constructs" },
+ { "-fno-handle-signatures", "" },
+ { "-fhonor-std", "Treat the namespace `std' as a normal namespace" },
+ { "-fno-honor-std", "" },
+ { "-fhuge-objects", "Enable support for huge objects" },
+ { "-fno-huge-objects", "" },
+ { "-fimplement-inlines", "" },
+ { "-fno-implement-inlines", "Export functions even if they can be inlined" },
+ { "-fimplicit-templates", "Emit implicit template instatiations when used" },
+ { "-fno-implicit-templates", "" },
+ { "-finit-priority", "Handle the init_priority attribute" },
+ { "-fno-init-priority", "" },
+ { "-flabels-ok", "Labels can be used as first class objects" },
+ { "-fno-labels-ok", "" },
+ { "-fmemoize-lookups", "" },
+ { "-fno-memoize-lookups", "" },
+ { "-fname-mangling-version-", "" },
+ { "-fnew-abi", "Enable experimental ABI changes" },
+ { "-fno-new-abi", "" },
+ { "-fnonnull-objects", "" },
+ { "-fno-nonnull-objects", "Do not assume that a reference is always valid" },
+ { "-foperator-names", "Recognise and/bitand/bitor/compl/not/or/xor" },
+ { "-fno-operator-names", "" },
+ { "-foptional-diags", "" },
+ { "-fno-optional-diags", "Disable optional diagnostics" },
+ { "-frepo", "Enable automatic template instantiation" },
+ { "-fno-repo", "" },
+ { "-fsave-memoized", "" },
+ { "-fno-save-memoized", "" },
+ { "-fsquangle", "Enable squashed name mangling" },
+ { "-fno-squangle", "" },
+ { "-fstats", "Display statistics accumulated during compilation" },
+ { "-fno-stats", "" },
+ { "-fstrict-prototype", "" },
+ { "-fno-strict-prototype", "Do not assume that empty prototype means no args" },
+ { "-ftemplate-depth-", "Specify maximum template instantiation depth"},
+ { "-fthis-is-variable", "Make 'this' not be type '* const'" },
+ { "-fno-this-is-variable", "" },
+ { "-fvtable-gc", "Discard unused virtual functions" },
+ { "-fno-vtable-gc", "" },
+ { "-fvtable-thunks", "Implement vtables using thunks" },
+ { "-fno-vtable-thunks", "" },
+ { "-fweak", "Emit common-like symbols as weak symbols" },
+ { "-fno-weak", "" },
+ { "-fxref", "Emit cross referencing information" },
+ { "-fno-xref", "" },
+
+ { "-Wreturn-type", "Warn about inconsistent return types" },
+ { "-Wno-return-type", "" },
+ { "-Woverloaded-virtual", "Warn about overloaded virtual function names" },
+ { "-Wno-overloaded-virtual", "" },
+ { "-Wctor-dtor-privacy", "" },
+ { "-Wno-ctor-dtor-privacy", "Don't warn when all ctors/dtors are private" },
+ { "-Wnon-virtual-dtor", "Warn about non virtual destructors" },
+ { "-Wno-non-virtual-dtor", "" },
+ { "-Wextern-inline", "Warn when a function is declared extern, then inline" },
+ { "-Wno-extern-inline", "" },
+ { "-Wreorder", "Warn when the compiler reorders code" },
+ { "-Wno-reorder", "" },
+ { "-Wsynth", "Warn when synthesis behaviour differs from Cfront" },
+ { "-Wno-synth", "" },
+ { "-Wpmf-conversions", "" },
+ { "-Wno-pmf-conversions", "Don't warn when type converting pointers to member functions" },
+ { "-Weffc++", "Warn about violations of Effective C++ style rules" },
+ { "-Wno-effc++", "" },
+ { "-Wsign-promo", "Warn when overload promotes from unsigned to signed" },
+ { "-Wno-sign-promo", "" },
+ { "-Wold-style-cast", "Warn if a C style cast is used in a program" },
+ { "-Wno-old-style-cast", "" },
+ { "-Wnon-template-friend", "" },
+ { "-Wno-non-template-friend", "Don't warn when non-templatized friend functions are declared within a template" },
- "-Wreturn-type",
- "-Wno-return-type",
- "-Woverloaded-virtual",
- "-Wno-overloaded-virtual",
- "-Wtemplate-debugging",
- "-Wno-template-debugging",
- "-Wctor-dtor-privacy",
- "-Wno-ctor-dtor-privacy",
- "-Wnon-virtual-dtor",
- "-Wno-non-virtual-dtor",
- "-Wextern-inline",
- "-Wno-extern-inline",
- "-Wreorder",
- "-Wno-reorder",
- "-Wsynth",
- "-Wno-synth",
- "-Wpmf-conversions",
- "-Wno-pmf-conversions",
- "-Weffc++",
- "-Wno-effc++",
- "-Wsign-promo",
- "-Wno-sign-promo",
- "-Wold-style-cast",
- "-Wno-old-style-cast",
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index 55ff1fcc87b..8daebbc308a 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -28,6 +28,36 @@ Boston, MA 02111-1307, USA. */
{".c++", {"@c++"}},
{".C", {"@c++"}},
{"@c++",
+#if USE_CPPLIB
+ {
+ "%{E|M|MM:cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ %{C:%{!E:%eGNU C++ does not support -C without using -E}}\
+ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
+ -undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus -D__GNUC_MINOR__=%v2\
+ %{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
+ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+ %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
+ %{!E:%{!M:%{!MM:cc1plus %i %1 %2\
+ -lang-c++ %{nostdinc*} %{C} %{A*} %{I*} %{P} %I\
+ -undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus\
+ -D__GNUC_MINOR__=%v2\
+ %{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ %{trigraphs}\
+ %{!Q:-quiet} -dumpbase %b.cc %{d*} %{m*} %{a}\
+ %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\
+ %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+ %{v:-version} %{pg:-p} %{p}\
+ %{f*} %{+e*} %{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\
+ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
+ %{!pipe:%g.s} %A\n }}}}"}},
+#else /* ! USE_CPPLIB */
{"cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
@@ -47,6 +77,7 @@ Boston, MA 02111-1307, USA. */
%{!S:as %a %Y\
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},
+#endif /* ! USE_CPPLIB */
{".ii", {"@c++-cpp-output"}},
{"@c++-cpp-output",
{"%{!M:%{!MM:%{!E:cc1plus %i %1 %2 %{!Q:-quiet} %{d*} %{m*} %{a}\
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 97200fec716..d69dc6ea452 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -37,15 +37,10 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "c-pragma.h"
#include "toplev.h"
-
-/* MULTIBYTE_CHARS support only works for native compilers.
- ??? Ideally what we want is to model widechar support after
- the current floating point support. */
-#ifdef CROSS_COMPILE
-#undef MULTIBYTE_CHARS
-#endif
+#include "output.h"
#ifdef MULTIBYTE_CHARS
+#include "mbchar.h"
#include <locale.h>
#endif
@@ -60,7 +55,6 @@ extern struct obstack permanent_obstack;
extern struct obstack *current_obstack, *saveable_obstack;
extern void yyprint PROTO((FILE *, int, YYSTYPE));
-extern void set_float_handler PROTO((jmp_buf));
extern void compiler_error PROTO((char *, HOST_WIDE_INT,
HOST_WIDE_INT));
@@ -81,8 +75,8 @@ static void store_pending_inline PROTO((tree, struct pending_inline *));
static void reinit_parse_for_expr PROTO((struct obstack *));
static int *init_cpp_parse PROTO((void));
static int handle_cp_pragma PROTO((char *));
-#ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((FILE *, int));
+#ifdef HANDLE_GENERIC_PRAGMAS
+static int handle_generic_pragma PROTO((int));
#endif
#ifdef GATHER_STATISTICS
#ifdef REDUCE_LENGTH
@@ -111,7 +105,12 @@ file_name_nondirectory (x)
struct obstack inline_text_obstack;
char *inline_text_firstobj;
-#if !USE_CPPLIB
+#if USE_CPPLIB
+#include "cpplib.h"
+extern cpp_reader parse_in;
+extern cpp_options parse_options;
+extern unsigned char *yy_cur, *yy_lim;
+#else
FILE *finput;
#endif
int end_of_file;
@@ -291,9 +290,6 @@ int interface_unknown; /* whether or not we know this class
/* lexical analyzer */
-/* File used for outputting assembler code. */
-extern FILE *asm_out_file;
-
#ifndef WCHAR_TYPE_SIZE
#ifdef INT_TYPE_SIZE
#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
@@ -332,7 +328,7 @@ get_time_identifier (name)
end_temporary_allocation ();
IDENTIFIER_LOCAL_VALUE (time_identifier) = build_int_2 (0, 0);
IDENTIFIER_CLASS_VALUE (time_identifier) = build_int_2 (0, 1);
- IDENTIFIER_GLOBAL_VALUE (time_identifier) = filename_times;
+ SET_IDENTIFIER_GLOBAL_VALUE (time_identifier, filename_times);
filename_times = time_identifier;
pop_obstacks ();
}
@@ -390,18 +386,23 @@ char *cplus_tree_code_name[] = {
/* toplev.c needs to call these. */
void
+lang_init_options ()
+{
+ /* Default exceptions on. */
+ flag_exceptions = 1;
+}
+
+void
lang_init ()
{
+#if ! USE_CPPLIB
/* the beginning of the file is a new line; check for # */
/* With luck, we discover the real source file's name from that
and put it in input_filename. */
put_back (check_newline ());
+#endif
if (flag_gnu_xref) GNU_xref_begin (input_filename);
init_repo (input_filename);
-
- /* See comments in toplev.c before the call to lang_init. */
- if (flag_exceptions == 2)
- flag_exceptions = 1;
}
void
@@ -467,7 +468,20 @@ init_parse (filename)
int i;
-#if !USE_CPPLIB
+#ifdef MULTIBYTE_CHARS
+ /* Change to the native locale for multibyte conversions. */
+ setlocale (LC_CTYPE, "");
+ literal_codeset = getenv ("LANG");
+#endif
+
+#if USE_CPPLIB
+ yy_cur = "\n";
+ yy_lim = yy_cur + 1;
+
+ parse_in.show_column = 1;
+ if (! cpp_start_read (&parse_in, filename))
+ abort ();
+#else
/* Open input file. */
if (filename == 0 || !strcmp (filename, "-"))
{
@@ -733,6 +747,9 @@ init_parse (filename)
ridpointers[(int) RID_EXPLICIT] = get_identifier ("explicit");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXPLICIT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_EXPLICIT]));
+ ridpointers[(int) RID_EXPORT] = get_identifier ("export");
+ SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXPORT],
+ build_tree_list (NULL_TREE, ridpointers[(int) RID_EXPORT]));
ridpointers[(int) RID_FRIEND] = get_identifier ("friend");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_FRIEND],
build_tree_list (NULL_TREE, ridpointers[(int) RID_FRIEND]));
@@ -759,6 +776,10 @@ init_parse (filename)
TREE_TYPE (signature_type_node) = signature_type_node;
ridpointers[(int) RID_SIGNATURE] = signature_type_node;
+ /* Create the built-in __null node. Note that we can't yet call for
+ type_for_size here because integer_type_node and so forth are not
+ set up. Therefore, we don't set the type of these nodes until
+ init_decl_processing. */
null_node = build_int_2 (0, 0);
ridpointers[RID_NULL] = null_node;
@@ -933,7 +954,6 @@ yyprint (file, yychar, yylval)
case IDENTIFIER_DEFN:
case TYPENAME_DEFN:
case PTYPENAME_DEFN:
- case TYPENAME_ELLIPSIS:
case SCSPEC:
case PRE_PARSED_CLASS_DECL:
t = yylval.ttype;
@@ -1158,7 +1178,7 @@ interface_strcmp (s)
static void
set_typedecl_interface_info (prev, vars)
- tree prev, vars;
+ tree prev ATTRIBUTE_UNUSED, vars;
{
tree id = get_time_identifier (DECL_SOURCE_FILE (vars));
tree fileinfo = IDENTIFIER_CLASS_VALUE (id);
@@ -1264,7 +1284,7 @@ process_next_inline (t)
tree context;
struct pending_inline *i = (struct pending_inline *) TREE_PURPOSE (t);
context = hack_decl_function_context (i->fndecl);
- maybe_end_member_template_processing (i->fndecl);
+ maybe_end_member_template_processing ();
if (context)
pop_cp_function_context (context);
i = i->next;
@@ -1914,7 +1934,11 @@ do_pending_defargs ()
}
if (TREE_CODE (defarg_fn) == FUNCTION_DECL)
- maybe_end_member_template_processing (defarg_fn);
+ {
+ maybe_end_member_template_processing ();
+ check_default_args (defarg_fn);
+ }
+
poplevel (0, 0, 0);
pop_nested_class (1);
}
@@ -2191,6 +2215,32 @@ get_last_nonwhite_on_line ()
return c;
}
+#if defined HANDLE_PRAGMA
+/* Local versions of these macros, that can be passed as function pointers. */
+static int
+pragma_getc ()
+{
+ int c;
+
+ if (nextchar != EOF)
+ {
+ c = nextchar;
+ nextchar = EOF;
+ }
+ else
+ c = getch ();
+
+ return c;
+}
+
+static void
+pragma_ungetc (arg)
+ int arg;
+{
+ yyungetc (arg, 0);
+}
+#endif /* HANDLE_PRAGMA */
+
/* At the beginning of a line, increment the line number
and process any #-directive on this line.
If the line is a #-directive, read the entire line and return a newline.
@@ -2198,9 +2248,6 @@ get_last_nonwhite_on_line ()
int linemode;
-#ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((FILE *, int));
-#endif
static int handle_cp_pragma PROTO((char *));
static int
@@ -2260,16 +2307,29 @@ check_newline ()
else if (token == END_OF_LINE)
goto skipline;
-#ifdef HANDLE_SYSV_PRAGMA
- if (handle_sysv_pragma (finput, token))
- goto skipline;
-#else
#ifdef HANDLE_PRAGMA
- if (HANDLE_PRAGMA (finput, yylval.ttype))
+ /* We invoke HANDLE_PRAGMA before HANDLE_GENERIC_PRAGMAS
+ (if both are defined), in order to give the back
+ end a chance to override the interpretation of
+ SYSV style pragmas. */
+ if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc,
+ IDENTIFIER_POINTER (yylval.ttype)))
goto skipline;
-#endif
-#endif
+#endif /* HANDLE_PRAGMA */
+
+#ifdef HANDLE_GENERIC_PRAGMAS
+ if (handle_generic_pragma (token))
+ goto skipline;
+#endif /* HANDLE_GENERIC_PRAGMAS */
+
+ /* Issue a warning message if we have been asked to do so.
+ Ignoring unknown pragmas in system header file unless
+ an explcit -Wunknown-pragmas has been given. */
+ if (warn_unknown_pragmas > 1
+ || (warn_unknown_pragmas && ! in_system_header))
+ warning ("ignoring pragma: %s", token_buffer);
}
+
goto skipline;
}
else if (c == 'd')
@@ -2281,7 +2341,7 @@ check_newline ()
&& getch () == 'e'
&& ((c = getch ()) == ' ' || c == '\t'))
{
- debug_define (lineno, get_directive_line (finput));
+ debug_define (lineno, GET_DIRECTIVE_LINE ());
goto skipline;
}
}
@@ -2293,7 +2353,7 @@ check_newline ()
&& getch () == 'f'
&& ((c = getch ()) == ' ' || c == '\t'))
{
- debug_undef (lineno, get_directive_line (finput));
+ debug_undef (lineno, GET_DIRECTIVE_LINE ());
goto skipline;
}
}
@@ -2313,9 +2373,6 @@ check_newline ()
&& getch () == 't'
&& ((c = getch ()) == ' ' || c == '\t'))
{
-#ifdef ASM_OUTPUT_IDENT
- extern FILE *asm_out_file;
-#endif
/* #ident. The pedantic warning is now in cccp.c. */
/* Here we have just seen `#ident '.
@@ -2646,7 +2703,8 @@ readescape (ignore_ptr)
;
else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node)
|| (count > 1
- && ((1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4))
+ && (((unsigned)1 <<
+ (TYPE_PRECISION (integer_type_node) - (count - 1) * 4))
<= firstdig)))
pedwarn ("hex escape out of range");
return code;
@@ -2721,7 +2779,7 @@ readescape (ignore_ptr)
/* Value is 1 (or 2) if we should try to make the next identifier look like
a typename (when it may be a local variable or a class variable).
Value is 0 if we treat this name in a default fashion. */
-int looking_for_typename = 0;
+int looking_for_typename;
#ifdef __GNUC__
__inline
@@ -2730,6 +2788,7 @@ int
identifier_type (decl)
tree decl;
{
+ tree t;
if (TREE_CODE (decl) == TEMPLATE_DECL)
{
if (TREE_CODE (DECL_RESULT (decl)) == TYPE_DECL)
@@ -2739,26 +2798,36 @@ identifier_type (decl)
}
if (looking_for_template && really_overloaded_fn (decl))
{
- tree t;
- for (t = TREE_VALUE (decl); t != NULL_TREE; t = DECL_CHAIN (t))
- if (DECL_FUNCTION_TEMPLATE_P (t))
+ for (t = decl; t != NULL_TREE; t = OVL_CHAIN (t))
+ if (DECL_FUNCTION_TEMPLATE_P (OVL_FUNCTION (t)))
return PFUNCNAME;
}
if (TREE_CODE (decl) == NAMESPACE_DECL)
return NSNAME;
if (TREE_CODE (decl) != TYPE_DECL)
return IDENTIFIER;
- if (((got_scope && TREE_TYPE (decl) == got_scope)
- || TREE_TYPE (decl) == current_class_type)
- && DECL_ARTIFICIAL (decl))
+ if (DECL_ARTIFICIAL (decl) && TREE_TYPE (decl) == current_class_type)
+ return SELFNAME;
+
+ /* A constructor declarator for a template type will get here as an
+ implicit typename, a TYPENAME_TYPE with a type. */
+ t = got_scope;
+ if (t && TREE_CODE (t) == TYPENAME_TYPE)
+ t = TREE_TYPE (t);
+ decl = TREE_TYPE (decl);
+ if (TREE_CODE (decl) == TYPENAME_TYPE)
+ decl = TREE_TYPE (decl);
+ if (t && t == decl)
return SELFNAME;
+
return TYPENAME;
}
void
see_typename ()
{
- looking_for_typename = 1;
+ /* Only types expected, not even namespaces. */
+ looking_for_typename = 2;
if (yychar < 0)
if ((yychar = yylex ()) < 0) yychar = 0;
looking_for_typename = 0;
@@ -2775,23 +2844,45 @@ see_typename ()
}
}
+/* Return true if d is in a global scope. */
+
+static int
+is_global (d)
+ tree d;
+{
+ while (1)
+ switch (TREE_CODE (d))
+ {
+ case ERROR_MARK:
+ return 1;
+
+ case OVERLOAD: d = OVL_FUNCTION (d); continue;
+ case TREE_LIST: d = TREE_VALUE (d); continue;
+ default:
+ my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (d)) == 'd', 980629);
+ d = CP_DECL_CONTEXT (d);
+ return TREE_CODE (d) == NAMESPACE_DECL;
+ }
+}
+
tree
-do_identifier (token, parsing)
+do_identifier (token, parsing, args)
register tree token;
int parsing;
+ tree args;
{
register tree id;
+ int lexing = (parsing == 1);
+ int in_call = (parsing == 2);
- if (! parsing || IDENTIFIER_OPNAME_P (token))
+ if (! lexing || IDENTIFIER_OPNAME_P (token))
id = lookup_name (token, 0);
else
id = lastiddecl;
- if (parsing && yychar == YYEMPTY)
- yychar = yylex ();
/* Scope class declarations before global
declarations. */
- if (id == IDENTIFIER_NAMESPACE_VALUE (token)
+ if ((!id || is_global (id))
&& current_class_type != 0
&& TYPE_SIZE (current_class_type) == 0)
{
@@ -2818,6 +2909,15 @@ do_identifier (token, parsing)
}
}
+ /* Do Koenig lookup if appropriate (inside templates we build lookup
+ expressions instead). */
+ if (args && !current_template_parms && (!id || is_global (id)))
+ {
+ /* If we have arguments and we only found global names,
+ do Koenig lookup. */
+ id = lookup_arg_dependent (token, id, args);
+ }
+
/* Remember that this name has been used in the class definition, as per
[class.scope0] */
if (id && current_class_type && parsing
@@ -2827,7 +2927,7 @@ do_identifier (token, parsing)
refers to an overloaded method. Eventually this will not be
necessary, since default arguments shouldn't be parsed until
after the class is complete. (jason 3/12/97) */
- && TREE_CODE (id) != TREE_LIST)
+ && TREE_CODE (id) != OVERLOAD)
pushdecl_class_level (id);
if (!id || id == error_mark_node)
@@ -2842,14 +2942,14 @@ do_identifier (token, parsing)
}
if (current_template_parms)
- return build_min_nt (LOOKUP_EXPR, token, NULL_TREE);
+ return build_min_nt (LOOKUP_EXPR, token);
else if (IDENTIFIER_OPNAME_P (token))
{
if (token != ansi_opname[ERROR_MARK])
cp_error ("`%D' not defined", token);
id = error_mark_node;
}
- else if (parsing && (yychar == '(' || yychar == LEFT_RIGHT))
+ else if (in_call && ! flag_strict_prototype)
{
id = implicitly_declare (token);
}
@@ -2876,7 +2976,7 @@ do_identifier (token, parsing)
}
id = error_mark_node;
/* Prevent repeated error messages. */
- IDENTIFIER_NAMESPACE_VALUE (token) = error_mark_node;
+ SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
SET_IDENTIFIER_ERROR_LOCUS (token, current_function_decl);
}
}
@@ -2931,29 +3031,44 @@ do_identifier (token, parsing)
cp_error ("enum `%D' is private", id);
/* protected is OK, since it's an enum of `this'. */
}
- if (! processing_template_decl
- || (DECL_INITIAL (id)
+ if (!processing_template_decl
+ /* Really, if we're processing a template, we just want to
+ resolve template parameters, and not enumeration
+ constants. But, they're hard to tell apart. (Note that
+ a non-type template parameter may have enumeration type.)
+ Fortunately, there's no harm in resolving *global*
+ enumeration constants, since they can't depend on
+ template parameters. */
+ || (TREE_CODE (CP_DECL_CONTEXT (id)) == NAMESPACE_DECL
&& TREE_CODE (DECL_INITIAL (id)) == TEMPLATE_PARM_INDEX))
id = DECL_INITIAL (id);
}
else
id = hack_identifier (id, token);
- if (current_template_parms)
- {
- if (is_overloaded_fn (id))
- {
- tree t = build_min (LOOKUP_EXPR, unknown_type_node,
- token, get_first_fn (id));
- if (id != IDENTIFIER_NAMESPACE_VALUE (token))
- TREE_OPERAND (t, 1) = error_mark_node;
- id = t;
- }
- else if (! TREE_PERMANENT (id) || TREE_CODE (id) == PARM_DECL
- || TREE_CODE (id) == USING_DECL)
- id = build_min (LOOKUP_EXPR, TREE_TYPE (id), token, error_mark_node);
- /* else just use the decl */
- }
+ /* We must look up dependent names when the template is
+ instantiated, not while parsing it. For now, we don't
+ distinguish between dependent and independent names. So, for
+ example, we look up all overloaded functions at
+ instantiation-time, even though in some cases we should just use
+ the DECL we have here. We also use LOOKUP_EXPRs to find things
+ like local variables, rather than creating TEMPLATE_DECLs for the
+ local variables and then finding matching instantiations. */
+ if (current_template_parms
+ && (is_overloaded_fn (id)
+ /* If it's not going to be around at instantiation time, we
+ look it up then. This is a hack, and should go when we
+ really get dependent/independent name lookup right. */
+ || !TREE_PERMANENT (id)
+ /* Some local VAR_DECLs (such as those for local variables
+ in member functions of local classes) are built on the
+ permanent obstack. */
+ || (TREE_CODE (id) == VAR_DECL
+ && CP_DECL_CONTEXT (id)
+ && TREE_CODE (CP_DECL_CONTEXT (id)) == FUNCTION_DECL)
+ || TREE_CODE (id) == PARM_DECL
+ || TREE_CODE (id) == USING_DECL))
+ id = build_min_nt (LOOKUP_EXPR, token);
return id;
}
@@ -2966,7 +3081,14 @@ do_scoped_id (token, parsing)
tree id;
/* during parsing, this is ::name. Otherwise, it is black magic. */
if (parsing)
- id = qualified_lookup_using_namespace (token, global_namespace);
+ {
+ struct tree_binding _b;
+ id = binding_init (&_b);
+ if (!qualified_lookup_using_namespace (token, global_namespace, id, 0))
+ id = NULL_TREE;
+ else
+ id = BINDING_VALUE (id);
+ }
else
id = IDENTIFIER_GLOBAL_VALUE (token);
if (parsing && yychar == YYEMPTY)
@@ -2975,27 +3097,27 @@ do_scoped_id (token, parsing)
{
if (processing_template_decl)
{
- id = build_min_nt (LOOKUP_EXPR, token, NULL_TREE);
+ id = build_min_nt (LOOKUP_EXPR, token);
LOOKUP_EXPR_GLOBAL (id) = 1;
return id;
}
- if (parsing && (yychar == '(' || yychar == LEFT_RIGHT))
+ if (parsing && (yychar == '(' || yychar == LEFT_RIGHT)
+ && ! flag_strict_prototype)
id = implicitly_declare (token);
else
{
if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node)
- error ("undeclared variable `%s' (first use here)",
- IDENTIFIER_POINTER (token));
+ cp_error ("`::%D' undeclared (first use here)", token);
id = error_mark_node;
/* Prevent repeated error messages. */
- IDENTIFIER_NAMESPACE_VALUE (token) = error_mark_node;
+ SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
}
}
else
{
if (TREE_CODE (id) == ADDR_EXPR)
mark_used (TREE_OPERAND (id, 0));
- else if (TREE_CODE (id) != TREE_LIST)
+ else if (TREE_CODE (id) != OVERLOAD)
mark_used (id);
}
if (TREE_CODE (id) == CONST_DECL && ! processing_template_decl)
@@ -3012,9 +3134,9 @@ do_scoped_id (token, parsing)
{
if (is_overloaded_fn (id))
{
- id = build_min (LOOKUP_EXPR, unknown_type_node,
- token, get_first_fn (id));
+ id = build_min_nt (LOOKUP_EXPR, token);
LOOKUP_EXPR_GLOBAL (id) = 1;
+ return id;
}
/* else just use the decl */
}
@@ -3232,7 +3354,7 @@ real_yylex ()
&& TREE_CODE (IDENTIFIER_GLOBAL_VALUE (old_ttype)) == TYPE_DECL)
looking_for_typename = 0;
else if (ptr->token == AGGR || ptr->token == ENUM)
- looking_for_typename = 1;
+ looking_for_typename = 2;
/* Check if this is a language-type declaration.
Just glimpse the next non-white character. */
@@ -3756,7 +3878,7 @@ real_yylex ()
{
if (spec_long_long)
error ("three `l's in integer constant");
- else if (pedantic)
+ else if (pedantic && ! in_system_header && warn_long_long)
pedwarn ("ANSI C++ forbids long long integer constants");
spec_long_long = 1;
}
@@ -3870,30 +3992,27 @@ real_yylex ()
{
register int result = 0;
register int num_chars = 0;
+ int chars_seen = 0;
unsigned width = TYPE_PRECISION (char_type_node);
int max_chars;
-
- if (wide_flag)
- {
- width = WCHAR_TYPE_SIZE;
#ifdef MULTIBYTE_CHARS
- max_chars = MB_CUR_MAX;
-#else
- max_chars = 1;
+ int longest_char = local_mb_cur_max ();
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
#endif
- }
- else
- max_chars = TYPE_PRECISION (integer_type_node) / width;
+
+ max_chars = TYPE_PRECISION (integer_type_node) / width;
+ if (wide_flag)
+ width = WCHAR_TYPE_SIZE;
while (1)
{
tryagain:
-
c = getch ();
if (c == '\'' || c == EOF)
break;
+ ++chars_seen;
if (c == '\\')
{
int ignore = 0;
@@ -3901,8 +4020,8 @@ real_yylex ()
if (ignore)
goto tryagain;
if (width < HOST_BITS_PER_INT
- && (unsigned) c >= (1 << width))
- warning ("escape sequence out of range for character");
+ && (unsigned) c >= ((unsigned)1 << width))
+ pedwarn ("escape sequence out of range for character");
#ifdef MAP_CHARACTER
if (ISPRINT (c))
c = MAP_CHARACTER (c);
@@ -3911,21 +4030,79 @@ real_yylex ()
else if (c == '\n')
{
if (pedantic)
- pedwarn ("ANSI C++ forbids newline in character constant");
+ pedwarn ("ANSI C forbids newline in character constant");
lineno++;
}
-#ifdef MAP_CHARACTER
else
- c = MAP_CHARACTER (c);
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 1; i <= longest_char; ++i)
+ {
+ if (i > maxtoken - 4)
+ extend_token_buffer (token_buffer);
+
+ token_buffer[i] = c;
+ char_len = local_mbtowc (& wc,
+ token_buffer + 1,
+ i);
+ if (char_len != -1)
+ break;
+ c = getch ();
+ }
+ if (char_len > 1)
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len < i)
+ put_back (c);
+ if (! wide_flag)
+ {
+ /* Merge character into result; ignore excess chars. */
+ for (i = 1; i <= char_len; ++i)
+ {
+ if (i > max_chars)
+ break;
+ if (width < HOST_BITS_PER_INT)
+ result = (result << width)
+ | (token_buffer[i]
+ & ((1 << width) - 1));
+ else
+ result = token_buffer[i];
+ }
+ num_chars += char_len;
+ goto tryagain;
+ }
+ c = wc;
+ }
+ else
+ {
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ if (wide_flag)
+ c = wc;
+#ifdef MAP_CHARACTER
+ else
+ c = MAP_CHARACTER (c);
#endif
+ }
+#else /* ! MULTIBYTE_CHARS */
+#ifdef MAP_CHARACTER
+ c = MAP_CHARACTER (c);
+#endif
+#endif /* ! MULTIBYTE_CHARS */
+ }
- num_chars++;
- if (num_chars > maxtoken - 4)
- extend_token_buffer (token_buffer);
-
- token_buffer[num_chars] = c;
+ if (wide_flag)
+ {
+ if (chars_seen == 1) /* only keep the first one */
+ result = c;
+ goto tryagain;
+ }
/* Merge character into result; ignore excess chars. */
+ num_chars++;
if (num_chars < max_chars + 1)
{
if (width < HOST_BITS_PER_INT)
@@ -3935,19 +4112,16 @@ real_yylex ()
}
}
- token_buffer[num_chars + 1] = '\'';
- token_buffer[num_chars + 2] = 0;
-
if (c != '\'')
error ("malformatted character constant");
- else if (num_chars == 0)
+ else if (chars_seen == 0)
error ("empty character constant");
else if (num_chars > max_chars)
{
num_chars = max_chars;
error ("character constant too long");
}
- else if (num_chars != 1)
+ else if (chars_seen != 1 && warn_multichar)
warning ("multi-character character constant");
/* If char type is signed, sign-extend the constant. */
@@ -3960,37 +4134,21 @@ real_yylex ()
else if (TREE_UNSIGNED (char_type_node)
|| ((result >> (num_bits - 1)) & 1) == 0)
yylval.ttype
- = build_int_2 (result & ((unsigned HOST_WIDE_INT) ~0
+ = build_int_2 (result & (~(unsigned HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)),
0);
else
yylval.ttype
- = build_int_2 (result | ~((unsigned HOST_WIDE_INT) ~0
+ = build_int_2 (result | ~(~(unsigned HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)),
-1);
- if (num_chars<=1)
+ if (chars_seen <= 1)
TREE_TYPE (yylval.ttype) = char_type_node;
else
TREE_TYPE (yylval.ttype) = integer_type_node;
}
else
{
-#ifdef MULTIBYTE_CHARS
- /* Set the initial shift state and convert the next sequence. */
- result = 0;
- /* In all locales L'\0' is zero and mbtowc will return zero,
- so don't use it. */
- if (num_chars > 1
- || (num_chars == 1 && token_buffer[1] != '\0'))
- {
- wchar_t wc;
- (void) mbtowc (NULL, NULL, 0);
- if (mbtowc (& wc, token_buffer + 1, num_chars) == num_chars)
- result = wc;
- else
- warning ("Ignoring invalid multibyte character");
- }
-#endif
yylval.ttype = build_int_2 (result, 0);
TREE_TYPE (yylval.ttype) = wchar_type_node;
}
@@ -4003,6 +4161,12 @@ real_yylex ()
string_constant:
{
register char *p;
+ unsigned width = wide_flag ? WCHAR_TYPE_SIZE
+ : TYPE_PRECISION (char_type_node);
+#ifdef MULTIBYTE_CHARS
+ int longest_char = local_mb_cur_max ();
+ (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
+#endif
c = getch ();
p = token_buffer + 1;
@@ -4016,9 +4180,8 @@ real_yylex ()
c = readescape (&ignore);
if (ignore)
goto skipnewline;
- if (!wide_flag
- && TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT
- && c >= ((unsigned) 1 << TYPE_PRECISION (char_type_node)))
+ if (width < HOST_BITS_PER_INT
+ && (unsigned) c >= ((unsigned)1 << width))
warning ("escape sequence out of range for character");
}
else if (c == '\n')
@@ -4027,10 +4190,74 @@ real_yylex ()
pedwarn ("ANSI C++ forbids newline in string constant");
lineno++;
}
+ else
+ {
+#ifdef MULTIBYTE_CHARS
+ wchar_t wc;
+ int i;
+ int char_len = -1;
+ for (i = 0; i < longest_char; ++i)
+ {
+ if (p + i >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ p[i] = c;
- if (p == token_buffer + maxtoken)
- p = extend_token_buffer (p);
- *p++ = c;
+ char_len = local_mbtowc (& wc, p, i + 1);
+ if (char_len != -1)
+ break;
+ c = getch ();
+ }
+ if (char_len == -1)
+ warning ("Ignoring invalid multibyte character");
+ else
+ {
+ /* mbtowc sometimes needs an extra char before accepting */
+ if (char_len <= i)
+ put_back (c);
+ if (wide_flag)
+ {
+ *(wchar_t *)p = wc;
+ p += sizeof (wc);
+ }
+ else
+ p += (i + 1);
+ c = getch ();
+ continue;
+ }
+#endif /* MULTIBYTE_CHARS */
+ }
+
+ /* Add this single character into the buffer either as a wchar_t
+ or as a single byte. */
+ if (wide_flag)
+ {
+ unsigned width = TYPE_PRECISION (char_type_node);
+ unsigned bytemask = (1 << width) - 1;
+ int byte;
+
+ if (p + WCHAR_BYTES > token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+
+ for (byte = 0; byte < WCHAR_BYTES; ++byte)
+ {
+ int value;
+ if (byte >= (int) sizeof(c))
+ value = 0;
+ else
+ value = (c >> (byte * width)) & bytemask;
+ if (BYTES_BIG_ENDIAN)
+ p[WCHAR_BYTES - byte - 1] = value;
+ else
+ p[byte] = value;
+ }
+ p += WCHAR_BYTES;
+ }
+ else
+ {
+ if (p >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ *p++ = c;
+ }
skipnewline:
c = getch ();
@@ -4039,56 +4266,36 @@ real_yylex ()
break;
}
}
- *p = 0;
-
- /* We have read the entire constant.
- Construct a STRING_CST for the result. */
+ /* Terminate the string value, either with a single byte zero
+ or with a wide zero. */
if (wide_flag)
{
- /* If this is a L"..." wide-string, convert the multibyte string
- to a wide character string. */
- char *widep = (char *) alloca ((p - token_buffer) * WCHAR_BYTES);
- int len;
-
-#ifdef MULTIBYTE_CHARS
- len = mbstowcs ((wchar_t *) widep, token_buffer + 1, p - token_buffer);
- if (len < 0 || len >= (p - token_buffer))
- {
- warning ("Ignoring invalid multibyte string");
- len = 0;
- }
- bzero (widep + (len * WCHAR_BYTES), WCHAR_BYTES);
-#else
- {
- char *wp, *cp;
-
- wp = widep + (BYTES_BIG_ENDIAN ? WCHAR_BYTES - 1 : 0);
- bzero (widep, (p - token_buffer) * WCHAR_BYTES);
- for (cp = token_buffer + 1; cp < p; cp++)
- *wp = *cp, wp += WCHAR_BYTES;
- len = p - token_buffer - 1;
- }
-#endif
- if (processing_template_decl)
- push_obstacks (&permanent_obstack, &permanent_obstack);
- yylval.ttype = build_string ((len + 1) * WCHAR_BYTES, widep);
- if (processing_template_decl)
- pop_obstacks ();
- TREE_TYPE (yylval.ttype) = wchar_array_type_node;
+ if (p + WCHAR_BYTES > token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ bzero (p, WCHAR_BYTES);
+ p += WCHAR_BYTES;
}
else
{
- if (processing_template_decl)
- push_obstacks (&permanent_obstack, &permanent_obstack);
- yylval.ttype = build_string (p - token_buffer, token_buffer + 1);
- if (processing_template_decl)
- pop_obstacks ();
- TREE_TYPE (yylval.ttype) = char_array_type_node;
+ if (p >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+ *p++ = 0;
}
- *p++ = '"';
- *p = 0;
+ /* We have read the entire constant.
+ Construct a STRING_CST for the result. */
+
+ if (processing_template_decl)
+ push_obstacks (&permanent_obstack, &permanent_obstack);
+ yylval.ttype = build_string (p - (token_buffer + 1), token_buffer + 1);
+ if (processing_template_decl)
+ pop_obstacks ();
+
+ if (wide_flag)
+ TREE_TYPE (yylval.ttype) = wchar_array_type_node;
+ else
+ TREE_TYPE (yylval.ttype) = char_array_type_node;
value = STRING; break;
}
@@ -4375,8 +4582,6 @@ build_lang_decl (code, name, type)
DECL_LANGUAGE (t) = lang_java;
else my_friendly_abort (64);
- SET_DECL_NAMESPACE (t, current_namespace);
-
#if 0 /* not yet, should get fixed properly later */
if (code == TYPE_DECL)
{
@@ -4473,8 +4678,7 @@ make_lang_type (code)
CLASSTYPE_AS_LIST (t) = build_expr_list (NULL_TREE, t);
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE,
- NULL_TREE);
+ TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
CLASSTYPE_BINFO_AS_LIST (t) = build_tree_list (NULL_TREE, TYPE_BINFO (t));
/* Make sure this is laid out, for ease of use later.
@@ -4508,7 +4712,7 @@ dump_time_statistics ()
for (decl = filename_times; decl; decl = next)
{
next = IDENTIFIER_GLOBAL_VALUE (decl);
- IDENTIFIER_GLOBAL_VALUE (decl) = prev;
+ SET_IDENTIFIER_GLOBAL_VALUE (decl, prev);
prev = decl;
}
@@ -4733,18 +4937,17 @@ handle_cp_pragma (pname)
return 0;
}
-#ifdef HANDLE_SYSV_PRAGMA
+#ifdef HANDLE_GENERIC_PRAGMAS
-/* Handle a #pragma directive. INPUT is the current input stream,
- and C is a character to reread. Processes the entire input line
- and returns a character for the caller to reread: either \n or EOF. */
+/* Handle a #pragma directive. TOKEN is the type of the word following
+ the #pragma directive on the line. Process the entire input line and
+ return non-zero iff the directive successfully parsed. */
/* This function has to be in this file, in order to get at
the token types. */
static int
-handle_sysv_pragma (finput, token)
- FILE *finput;
+handle_generic_pragma (token)
register int token;
{
for (;;)
@@ -4755,7 +4958,7 @@ handle_sysv_pragma (finput, token)
case TYPENAME:
case STRING:
case CONSTANT:
- handle_pragma_token ("ignored", yylval.ttype);
+ handle_pragma_token (IDENTIFIER_POINTER(yylval.ttype), yylval.ttype);
break;
case '(':
handle_pragma_token ("(", NULL_TREE);
@@ -4775,10 +4978,10 @@ handle_sysv_pragma (finput, token)
break;
case END_OF_LINE:
default:
- handle_pragma_token (NULL_PTR, NULL_TREE);
- return 1;
+ return handle_pragma_token (NULL_PTR, NULL_TREE);
}
+
token = real_yylex ();
}
}
-#endif /* HANDLE_SYSV_PRAGMA */
+#endif /* HANDLE_GENERIC_PRAGMAS */
diff --git a/gcc/cp/lex.h b/gcc/cp/lex.h
index 8df6b76a270..98add36ff17 100644
--- a/gcc/cp/lex.h
+++ b/gcc/cp/lex.h
@@ -59,6 +59,7 @@ enum rid
RID_FRIEND,
RID_VIRTUAL,
RID_EXPLICIT,
+ RID_EXPORT,
RID_SIGNED,
RID_AUTO,
RID_MUTABLE,
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index e97c6264101..82a886c2377 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -57,22 +57,20 @@ static char *scratch_firstobj;
static void icat PROTO((HOST_WIDE_INT));
static void dicat PROTO((HOST_WIDE_INT, HOST_WIDE_INT));
-static void flush_repeats PROTO((tree));
+static void flush_repeats PROTO((int, tree));
static void build_overload_identifier PROTO((tree));
static void build_overload_nested_name PROTO((tree));
static void build_overload_int PROTO((tree, int));
static void build_overload_identifier PROTO((tree));
static void build_qualified_name PROTO((tree));
static void build_overload_value PROTO((tree, tree, int));
-static void issue_nrepeats PROTO((tree));
+static void issue_nrepeats PROTO((int, tree));
static char *build_mangled_name PROTO((tree,int,int));
static void process_modifiers PROTO((tree));
static void process_overload_item PROTO((tree,int));
static void do_build_assign_ref PROTO((tree));
static void do_build_copy_constructor PROTO((tree));
static tree largest_union_member PROTO((tree));
-static tree build_decl_overload_real PROTO((tree, tree, tree, tree,
- tree, int));
static void build_template_template_parm_names PROTO((tree));
static void build_template_parm_names PROTO((tree, tree));
static void build_underscore_int PROTO((int));
@@ -82,7 +80,10 @@ static int check_ktype PROTO((tree, int));
static int issue_ktype PROTO((tree));
static void build_overload_scope_ref PROTO((tree));
static void build_mangled_template_parm_index PROTO((char *, tree));
+static int is_back_referenceable_type PROTO((tree));
static int check_btype PROTO((tree));
+static void build_mangled_name_for_type PROTO((tree));
+static void build_mangled_name_for_type_with_Gcode PROTO((tree, int));
# define OB_INIT() (scratch_firstobj ? (obstack_free (&scratch_obstack, scratch_firstobj), 0) : 0)
# define OB_PUTC(C) (obstack_1grow (&scratch_obstack, (C)))
@@ -173,7 +174,6 @@ do_inline_function_hair (type, friend_list)
/* type tables for K and B type compression */
static tree *btypelist = NULL;
static tree *ktypelist = NULL;
-static tree lasttype = NULL;
static int maxbsize = 0;
static int maxksize = 0;
@@ -181,19 +181,14 @@ static int maxksize = 0;
static int maxbtype = 0;
static int maxktype = 0;
-/* Number of occurrences of last b type seen. */
-static int nrepeats = 0;
-
/* Array of types seen so far in top-level call to `build_mangled_name'.
Allocated and deallocated by caller. */
static tree *typevec = NULL;
+static int typevec_size;
/* Number of types interned by `build_mangled_name' so far. */
static int maxtype = 0;
-/* Number of occurrences of last type seen. */
-static int Nrepeats = 0;
-
/* Nonzero if we should not try folding parameter types. */
static int nofold;
@@ -206,9 +201,7 @@ start_squangling ()
{
if (flag_do_squangling)
{
- lasttype = NULL;
nofold = 0;
- nrepeats = 0;
maxbtype = 0;
maxktype = 0;
maxbsize = 50;
@@ -223,7 +216,6 @@ end_squangling ()
{
if (flag_do_squangling)
{
- lasttype = NULL;
if (ktypelist)
free (ktypelist);
if (btypelist)
@@ -305,7 +297,8 @@ dicat (lo, hi)
}
static __inline void
-flush_repeats (type)
+flush_repeats (nrepeats, type)
+ int nrepeats;
tree type;
{
int tindex = 0;
@@ -313,50 +306,73 @@ flush_repeats (type)
while (typevec[tindex] != type)
tindex++;
- if (Nrepeats > 1)
+ if (nrepeats > 1)
{
OB_PUTC ('N');
- icat (Nrepeats);
- if (Nrepeats > 9)
+ icat (nrepeats);
+ if (nrepeats > 9)
OB_PUTC ('_');
}
else
OB_PUTC ('T');
- Nrepeats = 0;
icat (tindex);
if (tindex > 9)
OB_PUTC ('_');
}
+/* Returns nonzero iff this is a type to which we will want to make
+ back-references (using the `B' code). */
-/* issue squangling type repeating */
-static void
-issue_nrepeats (lasttype)
- tree lasttype;
+int
+is_back_referenceable_type (type)
+ tree type;
{
- if (nrepeats == 1)
+ if (btypelist == NULL)
+ /* We're not generating any back-references. */
+ return 0;
+
+ switch (TREE_CODE (type))
{
- switch (TREE_CODE (lasttype))
- {
- case INTEGER_TYPE:
- case REAL_TYPE:
- case VOID_TYPE:
- case BOOLEAN_TYPE:
- process_overload_item (lasttype, FALSE);
- nrepeats = 0;
- return;
-
- default:
- break;
- }
+ case INTEGER_TYPE:
+ case REAL_TYPE:
+ case VOID_TYPE:
+ case BOOLEAN_TYPE:
+ /* These types have single-character manglings, so there's no
+ point in generating back-references. */
+ return 0;
+
+ case TEMPLATE_TYPE_PARM:
+ /* It would be a bit complex to demangle signatures correctly if
+ we generated back-references to these, and the manglings of
+ type parameters are short. */
+ return 0;
+
+ default:
+ return 1;
}
- OB_PUTC ('n');
- icat (nrepeats);
- if (nrepeats > 9)
- OB_PUTC ('_');
- nrepeats = 0;
}
+/* Issue the squangling code indicating NREPEATS repetitions of TYPE,
+ which was the last parameter type output. */
+
+static void
+issue_nrepeats (nrepeats, type)
+ int nrepeats;
+ tree type;
+{
+ if (nrepeats == 1 && !is_back_referenceable_type (type))
+ /* For types whose manglings are short, don't bother using the
+ repetition code if there's only one repetition, since the
+ repetition code will be about as long as the ordinary mangling. */
+ build_mangled_name_for_type (type);
+ else
+ {
+ OB_PUTC ('n');
+ icat (nrepeats);
+ if (nrepeats > 9)
+ OB_PUTC ('_');
+ }
+}
/* Check to see if a tree node has been entered into the Kcode typelist */
/* if not, add it. Return -1 if it isn't found, otherwise return the index */
@@ -409,43 +425,41 @@ issue_ktype (decl)
}
return FALSE;
}
+
+/* Build a representation for DECL, which may be an entity not at
+ global scope. If so, a marker indicating that the name is
+ qualified has already been output, but the qualifying context has
+ not. */
static void
build_overload_nested_name (decl)
tree decl;
{
+ tree context;
if (ktypelist && issue_ktype (decl))
return;
- if (DECL_CONTEXT (decl))
- {
- tree context = DECL_CONTEXT (decl);
+ if (decl == global_namespace)
+ return;
- /* try to issue a K type, and if we can't continue the normal path */
- if (!(ktypelist && issue_ktype (context)))
- {
- /* For a template type parameter, we want to output an 'Xn'
- rather than 'T' or some such. */
- if (TREE_CODE (context) == TEMPLATE_TYPE_PARM
- || TREE_CODE (context) == TEMPLATE_TEMPLATE_PARM)
- build_mangled_name (context, 0, 0);
- else
- {
- if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
- context = TYPE_NAME (context);
- build_overload_nested_name (context);
- }
- }
+ context = CP_DECL_CONTEXT (decl);
+
+ /* try to issue a K type, and if we can't continue the normal path */
+ if (!(ktypelist && issue_ktype (context)))
+ {
+ /* For a template type parameter, we want to output an 'Xn'
+ rather than 'T' or some such. */
+ if (TREE_CODE (context) == TEMPLATE_TYPE_PARM
+ || TREE_CODE (context) == TEMPLATE_TEMPLATE_PARM)
+ build_mangled_name_for_type (context);
+ else
+ {
+ if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
+ context = TYPE_NAME (context);
+ build_overload_nested_name (context);
}
- else if (decl == global_namespace)
- return;
- else if (DECL_NAMESPACE (decl))
- build_overload_nested_name (DECL_NAMESPACE (decl));
- else
- /* XXX the above does not work for non-namespaces */
- if (current_namespace && TREE_CODE (decl) != NAMESPACE_DECL)
- build_overload_nested_name (current_namespace);
+ }
if (TREE_CODE (decl) == FUNCTION_DECL)
{
@@ -467,6 +481,9 @@ build_overload_nested_name (decl)
build_overload_identifier (decl);
}
+/* Output the decimal representation of I. If I > 9, the decimal
+ representation is preceeded and followed by an underscore. */
+
static void
build_underscore_int (i)
int i;
@@ -484,7 +501,7 @@ build_overload_scope_ref (value)
{
OB_PUTC2 ('Q', '2');
numeric_output_need_bar = 0;
- build_mangled_name (TREE_OPERAND (value, 0), 0, 0);
+ build_mangled_name_for_type (TREE_OPERAND (value, 0));
build_overload_identifier (TREE_OPERAND (value, 1));
}
@@ -516,7 +533,13 @@ build_overload_int (value, in_template)
id = ansi_opname [(int) TREE_CODE (value)];
my_friendly_assert (id != NULL_TREE, 0);
name = IDENTIFIER_POINTER (id);
- my_friendly_assert (name[0] == '_' && name[1] == '_', 0);
+ if (name[0] != '_' || name[1] != '_')
+ /* On some erroneous inputs, we can get here with VALUE a
+ LOOKUP_EXPR. In that case, the NAME will be the
+ identifier for "<invalid operator>". We must survive
+ this routine in order to issue a sensible error
+ message, so we fall through to the case below. */
+ goto bad_value;
for (i = 0; i < operands; ++i)
{
@@ -538,7 +561,7 @@ build_overload_int (value, in_template)
/* We can get here with sizeof, e.g.:
template <class T> void f(A<sizeof(T)>); */
- process_overload_item (operand, 0);
+ build_mangled_name_for_type (operand);
else if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (tc)))
build_overload_int (operand, in_template);
else
@@ -554,6 +577,7 @@ build_overload_int (value, in_template)
This should cause assembler errors we'll notice. */
static int n;
+ bad_value:
sprintf (digit_buffer, " *%d", n++);
OB_PUTCP (digit_buffer);
}
@@ -604,15 +628,12 @@ build_overload_value (type, value, in_template)
tree type, value;
int in_template;
{
+ my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (type)) == 't', 0);
+
while (TREE_CODE (value) == NON_LVALUE_EXPR
|| TREE_CODE (value) == NOP_EXPR)
value = TREE_OPERAND (value, 0);
- if (TREE_CODE (type) == PARM_DECL)
- type = TREE_TYPE (type);
-
- my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (type)) == 't', 0);
-
if (numeric_output_need_bar)
{
OB_PUTC ('_');
@@ -625,17 +646,20 @@ build_overload_value (type, value, in_template)
return;
}
- if (TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (type)) == OFFSET_TYPE)
+ if (TYPE_PTRMEM_P (type))
{
- /* Handle a pointer to data member as a template instantiation
- parameter, boy, what fun! */
- type = integer_type_node;
- if (TREE_CODE (value) != INTEGER_CST)
- {
- sorry ("unknown pointer to member constant");
- return;
- }
+ if (TREE_CODE (value) != PTRMEM_CST)
+ /* We should have already rejected this pointer to member,
+ since it is not a constant. */
+ my_friendly_abort (0);
+
+ /* Get the actual FIELD_DECL. */
+ value = PTRMEM_CST_MEMBER (value);
+ my_friendly_assert (TREE_CODE (value) == FIELD_DECL, 0);
+
+ /* Output the name of the field. */
+ build_overload_identifier (DECL_NAME (value));
+ return;
}
if (TYPE_PTRMEMFUNC_P (type))
@@ -823,10 +847,8 @@ build_template_template_parm_names (parmlist)
build_template_template_parm_names (DECL_INNERMOST_TEMPLATE_PARMS (parm));
}
else
- {
- /* It's a PARM_DECL. */
- build_mangled_name (TREE_TYPE (parm), 0, 0);
- }
+ /* It's a PARM_DECL. */
+ build_mangled_name_for_type (TREE_TYPE (parm));
}
}
@@ -840,25 +862,26 @@ build_template_parm_names (parmlist, arglist)
tree arglist;
{
int i, nparms;
-
+ tree inner_args = innermost_args (arglist);
+
nparms = TREE_VEC_LENGTH (parmlist);
icat (nparms);
for (i = 0; i < nparms; i++)
{
tree parm = TREE_VALUE (TREE_VEC_ELT (parmlist, i));
- tree arg = TREE_VEC_ELT (arglist, i);
+ tree arg = TREE_VEC_ELT (inner_args, i);
if (TREE_CODE (parm) == TYPE_DECL)
{
/* This parameter is a type. */
OB_PUTC ('Z');
- build_mangled_name (arg, 0, 0);
+ build_mangled_name_for_type (arg);
}
else if (TREE_CODE (parm) == TEMPLATE_DECL)
{
/* This parameter is a template. */
if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
/* Output parameter declaration, argument index and level */
- build_mangled_name (arg, 0, 0);
+ build_mangled_name_for_type (arg);
else
{
/* A TEMPLATE_DECL node, output the parameter declaration
@@ -874,12 +897,15 @@ build_template_parm_names (parmlist, arglist)
{
parm = tsubst (parm, arglist, NULL_TREE);
/* It's a PARM_DECL. */
- build_mangled_name (TREE_TYPE (parm), 0, 0);
- build_overload_value (parm, arg, uses_template_parms (arglist));
+ build_mangled_name_for_type (TREE_TYPE (parm));
+ build_overload_value (TREE_TYPE (parm), arg,
+ uses_template_parms (arglist));
}
}
}
+/* Output the representation for NAME, which is either a TYPE_DECL or
+ an IDENTIFIER. */
static void
build_overload_identifier (name)
@@ -893,10 +919,10 @@ build_overload_identifier (name)
(TREE_TYPE (name))))
== FUNCTION_DECL)))
{
+ /* NAME is the TYPE_DECL for a template specialization. */
tree template, parmlist, arglist, tname;
- template = CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (name));
- arglist = TREE_VALUE (template);
- template = TREE_PURPOSE (template);
+ template = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (name));
+ arglist = CLASSTYPE_TI_ARGS (TREE_TYPE (name));
tname = DECL_NAME (template);
parmlist = DECL_INNERMOST_TEMPLATE_PARMS (template);
OB_PUTC ('t');
@@ -946,8 +972,8 @@ build_qualified_name (decl)
/* if we can't find a Ktype, do it the hard way */
if (check_ktype (context, FALSE) == -1)
{
- /* count type scopes */
- while (DECL_CONTEXT (context))
+ /* count type and namespace scopes */
+ while (DECL_CONTEXT (context) && DECL_CONTEXT (context) != global_namespace)
{
i += 1;
context = DECL_CONTEXT (context);
@@ -956,25 +982,6 @@ build_qualified_name (decl)
if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
context = TYPE_NAME (context);
}
- /* now count namespace scopes */
- if (TREE_CODE (decl) == NAMESPACE_DECL)
- {
- i = 0; /* we have nothing done, yet: reset */
- context = decl;
- }
- else
- /* decl must be a type, which we have to scope with the
- namespace */
- {
- /* XXX MvL somehow, types have no lang_decl, so no namespace */
- context = current_namespace;
- }
- }
-
- while (context != global_namespace)
- {
- i += 1;
- context = DECL_NAMESPACE (context);
}
if (i > 1)
@@ -986,6 +993,32 @@ build_qualified_name (decl)
build_overload_nested_name (decl);
}
+/* Output the mangled representation for TYPE. If EXTRA_GCODE is
+ non-zero, mangled names for structure/union types are intentionally
+ mangled differently from the method described in the ARM. */
+
+void
+build_mangled_name_for_type_with_Gcode (type, extra_Gcode)
+ tree type;
+ int extra_Gcode;
+{
+ if (TYPE_PTRMEMFUNC_P (type))
+ type = TYPE_PTRMEMFUNC_FN_TYPE (type);
+ type = canonical_type_variant (type);
+ process_modifiers (type);
+ process_overload_item (type, extra_Gcode);
+}
+
+/* Like build_mangled_name_for_type_with_Gcode, but never outputs the
+ `G'. */
+
+void
+build_mangled_name_for_type (type)
+ tree type;
+{
+ build_mangled_name_for_type_with_Gcode (type, 0);
+}
+
/* Given a list of parameters in PARMTYPES, create an unambiguous
overload string. Should distinguish any type that C (or C++) can
distinguish. I.e., pointers to functions are treated correctly.
@@ -1010,107 +1043,116 @@ build_overload_name (parmtypes, begin, end)
return ret ;
}
+/* Output the mangled representation for PARMTYPES. If PARMTYPES is a
+ TREE_LIST, then it is a list of parameter types. Otherwise,
+ PARMTYPES must be a single type. */
+
static char *
build_mangled_name (parmtypes, begin, end)
tree parmtypes;
int begin, end;
{
- tree parmtype;
-
if (begin)
OB_INIT ();
- numeric_output_need_bar = 0;
- if (TREE_CODE (parmtypes) != TREE_LIST) /* just one item */
+ if (TREE_CODE (parmtypes) != TREE_LIST)
+ /* There is only one type. */
+ build_mangled_name_for_type (parmtypes);
+ else
{
- if (TYPE_PTRMEMFUNC_P (parmtypes))
- parmtypes = TYPE_PTRMEMFUNC_FN_TYPE (parmtypes);
- process_modifiers (parmtypes);
- process_overload_item (parmtypes, FALSE);
- }
- else {
- for ( ; parmtypes!=NULL; parmtypes = TREE_CHAIN (parmtypes))
- {
- parmtype = TREE_VALUE (parmtypes);
- parmtype = build_type_variant (TYPE_MAIN_VARIANT (parmtype),
- TYPE_READONLY (parmtype), TYPE_VOLATILE (parmtype));
- if (flag_do_squangling) /* squangling style repeats */
- {
- if (parmtype == lasttype)
- {
- nrepeats++;
- continue;
- }
- else
- if (nrepeats != 0)
- {
- issue_nrepeats (lasttype);
- }
- lasttype = parmtype;
- }
- else
- if (!nofold && typevec)
- {
- /* Every argument gets counted. */
- typevec[maxtype++] = parmtype;
+ /* There are several types in a parameter list. */
+ int nrepeats = 0;
+ int old_style_repeats = !flag_do_squangling && !nofold && typevec;
+ tree last_type = NULL_TREE;
- if (TREE_USED (parmtype) && parmtype == typevec[maxtype-2]
- && ! is_java_type (parmtype))
- {
- Nrepeats++;
- continue;
- }
+ for (; parmtypes && parmtypes != void_list_node;
+ parmtypes = TREE_CHAIN (parmtypes))
+ {
+ tree parmtype = canonical_type_variant (TREE_VALUE (parmtypes));
+
+ if (old_style_repeats)
+ {
+ /* Every argument gets counted. */
+ my_friendly_assert (maxtype < typevec_size, 387);
+ typevec[maxtype++] = parmtype;
+ }
+
+ if (parmtype == last_type)
+ {
+ if (flag_do_squangling
+ || (old_style_repeats && TREE_USED (parmtype)
+ && !TYPE_FOR_JAVA (parmtype)))
+ {
+ /* The next type is the same as this one. Keep
+ track of the repetition, and output the repeat
+ count later. */
+ nrepeats++;
+ continue;
+ }
+ }
+ else if (nrepeats != 0)
+ {
+ /* Indicate how many times the previous parameter was
+ repeated. */
+ if (old_style_repeats)
+ flush_repeats (nrepeats, last_type);
+ else
+ issue_nrepeats (nrepeats, last_type);
+ nrepeats = 0;
+ }
+
+ last_type = parmtype;
- if (Nrepeats)
- flush_repeats (typevec[maxtype-2]);
+ if (old_style_repeats)
+ {
+ if (nrepeats)
+ {
+ flush_repeats (nrepeats, last_type);
+ nrepeats = 0;
+ }
- if (TREE_USED (parmtype))
- {
+ if (TREE_USED (parmtype))
+ {
#if 0
- /* We can turn this on at some point when we want
- improved symbol mangling. */
- Nrepeats++;
+ /* We can turn this on at some point when we want
+ improved symbol mangling. */
+ nrepeats++;
#else
- /* This is bug compatible with 2.7.x */
- flush_repeats (parmtype);
+ /* This is bug compatible with 2.7.x */
+ flush_repeats (nrepeats, parmtype);
#endif
- continue;
- }
-
- /* Only cache types which take more than one character. */
- if ((parmtype != TYPE_MAIN_VARIANT (parmtype)
+ nrepeats = 0;
+ continue;
+ }
+
+ /* Only cache types which take more than one character. */
+ if ((parmtype != TYPE_MAIN_VARIANT (parmtype)
|| (TREE_CODE (parmtype) != INTEGER_TYPE
&& TREE_CODE (parmtype) != REAL_TYPE))
- && ! is_java_type (parmtype))
- TREE_USED (parmtype) = 1;
- }
- if (TYPE_PTRMEMFUNC_P (parmtype))
- parmtype = TYPE_PTRMEMFUNC_FN_TYPE (parmtype);
- process_modifiers (parmtype);
- if (TREE_CODE(parmtype)==VOID_TYPE)
- {
-#if 0
- extern tree void_list_node;
+ && ! TYPE_FOR_JAVA (parmtype))
+ TREE_USED (parmtype) = 1;
+ }
+
+ /* Output the PARMTYPE. */
+ build_mangled_name_for_type_with_Gcode (parmtype, 1);
+ }
+
+ /* Output the repeat count for the last parameter, if
+ necessary. */
+ if (nrepeats != 0)
+ {
+ if (old_style_repeats)
+ flush_repeats (nrepeats, last_type);
+ else
+ issue_nrepeats (nrepeats, last_type);
+ nrepeats = 0;
+ }
+
+ if (!parmtypes)
+ /* The parameter list ends in an ellipsis. */
+ OB_PUTC ('e');
+ }
- /* See if anybody is wasting memory. */
- my_friendly_assert (parmtypes == void_list_node, 247);
-#endif
- /* This is the end of a parameter list. */
- if (end)
- OB_FINISH ();
- return (char *)obstack_base (&scratch_obstack);
- }
- process_overload_item (parmtype, TRUE);
- }
- if (flag_do_squangling && nrepeats != 0)
- issue_nrepeats (lasttype);
- else
- if (Nrepeats && typevec)
- flush_repeats (typevec[maxtype-1]);
-
- /* To get here, parms must end with `...'. */
- OB_PUTC ('e');
- }
if (end)
OB_FINISH ();
return (char *)obstack_base (&scratch_obstack);
@@ -1121,80 +1163,57 @@ void
process_modifiers (parmtype)
tree parmtype;
{
-
-
if (TREE_READONLY (parmtype))
OB_PUTC ('C');
if (TREE_CODE (parmtype) == INTEGER_TYPE
&& (TYPE_MAIN_VARIANT (parmtype)
== unsigned_type (TYPE_MAIN_VARIANT (parmtype)))
- && ! is_java_type (parmtype))
- {
- OB_PUTC ('U');
- }
+ && ! TYPE_FOR_JAVA (parmtype))
+ OB_PUTC ('U');
if (TYPE_VOLATILE (parmtype))
OB_PUTC ('V');
}
-/* True iff TYPE was declared as a "Java" type (inside extern "Java"). */
+/* Check to see if TYPE has been entered into the Bcode typelist. If
+ so, return 1 and emit a backreference to TYPE. Otherwise, add TYPE
+ to the list of back-referenceable types and return 0. */
-int
-is_java_type (type)
+int
+check_btype (type)
tree type;
{
- if (TYPE_NAME (type) != NULL_TREE)
- {
- tree decl = TYPE_NAME (type);
- if (TREE_CODE (decl) == TYPE_DECL
- && DECL_LANG_SPECIFIC (decl) != NULL
- && DECL_LANGUAGE (decl) == lang_java)
- return 1;
- }
- return 0;
-}
-
-/* Check to see if a tree node has been entered into the Bcode typelist
- if not, add it. Otherwise emit the code and return TRUE */
-static int
-check_btype (node)
- tree node;
-{
int x;
if (btypelist == NULL)
return 0;
- switch (TREE_CODE (node))
- {
- case INTEGER_TYPE:
- case REAL_TYPE:
- case VOID_TYPE:
- case BOOLEAN_TYPE:
- return 0; /* don't compress single char basic types */
+ if (!is_back_referenceable_type (type))
+ return 0;
- default:
- break;
- }
+ /* We assume that our caller has put out any necessary
+ qualifiers. */
+ type = TYPE_MAIN_VARIANT (type);
- node = TYPE_MAIN_VARIANT (node);
for (x = 0; x < maxbtype; x++)
- {
- if (node == btypelist[x])
- {
- OB_PUTC ('B');
- icat (x);
- if (x > 9)
- OB_PUTC ('_');
- return 1 ;
- }
- }
- /* didn't find it, so add it here */
+ if (type == btypelist[x])
+ {
+ OB_PUTC ('B');
+ icat (x);
+ if (x > 9)
+ OB_PUTC ('_');
+ return 1 ;
+ }
+
if (maxbsize <= maxbtype)
{
+ /* Enlarge the table. */
maxbsize = maxbsize * 3 / 2;
btypelist = (tree *)xrealloc (btypelist, sizeof (tree) * maxbsize);
}
- btypelist[maxbtype++] = node;
+
+ /* Register the TYPE. */
+ btypelist[maxbtype++] = type;
+
return 0;
}
@@ -1204,6 +1223,7 @@ process_overload_item (parmtype, extra_Gcode)
tree parmtype;
int extra_Gcode;
{
+ numeric_output_need_bar = 0;
/* These tree types are considered modifiers for B code squangling , */
/* and therefore should not get entries in the Btypelist */
@@ -1218,18 +1238,22 @@ process_overload_item (parmtype, extra_Gcode)
case ARRAY_TYPE:
#if PARM_CAN_BE_ARRAY_TYPE
{
- tree length;
-
OB_PUTC ('A');
if (TYPE_DOMAIN (parmtype) == NULL_TREE)
- error("pointer/reference to array of unknown bound in parm type");
+ OB_PUTC ('_');
else
- {
- length = array_type_nelts (parmtype);
- if (TREE_CODE (length) == INTEGER_CST)
- icat (TREE_INT_CST_LOW (length) + 1);
- }
- OB_PUTC ('_');
+ {
+ tree length = array_type_nelts (parmtype);
+ if (TREE_CODE (length) != INTEGER_CST || flag_do_squangling)
+ {
+ length = fold (build (PLUS_EXPR, TREE_TYPE (length),
+ length, integer_one_node));
+ STRIP_NOPS (length);
+ }
+ build_overload_value (sizetype, length, 1);
+ }
+ if (numeric_output_need_bar && ! flag_do_squangling)
+ OB_PUTC ('_');
goto more;
}
#else
@@ -1240,7 +1264,7 @@ process_overload_item (parmtype, extra_Gcode)
case POINTER_TYPE:
OB_PUTC ('P');
more:
- build_mangled_name (TREE_TYPE (parmtype), 0, 0);
+ build_mangled_name_for_type (TREE_TYPE (parmtype));
return;
break;
@@ -1248,115 +1272,73 @@ process_overload_item (parmtype, extra_Gcode)
break;
}
- /* check if type is already in the typelist. If not, add it now */
-
- if (flag_do_squangling && btypelist != NULL) {
- if (check_btype (parmtype)) /* emits the code if it finds it */
- return;
- }
+ if (flag_do_squangling && check_btype (parmtype))
+ /* If PARMTYPE is already in the list of back-referenceable types,
+ then check_btype will output the appropriate reference, and
+ there's nothing more to do. */
+ return;
switch (TREE_CODE (parmtype))
{
case OFFSET_TYPE:
OB_PUTC ('O');
- build_mangled_name (TYPE_OFFSET_BASETYPE (parmtype), 0, 0);
+ build_mangled_name_for_type (TYPE_OFFSET_BASETYPE (parmtype));
OB_PUTC ('_');
- build_mangled_name (TREE_TYPE (parmtype), 0, 0);
+ build_mangled_name_for_type (TREE_TYPE (parmtype));
break;
case FUNCTION_TYPE:
case METHOD_TYPE:
{
- tree firstarg = TYPE_ARG_TYPES (parmtype);
- /* Otherwise have to implement reentrant typevecs,
- unmark and remark types, etc. */
- int old_nofold = nofold;
- if (!flag_do_squangling) {
- nofold = 1;
- if (Nrepeats)
- flush_repeats (typevec[maxtype-1]);
- }
- else
- if (nrepeats != 0)
- issue_nrepeats (lasttype);
-
- /* @@ It may be possible to pass a function type in
- which is not preceded by a 'P'. */
- if (TREE_CODE (parmtype) == FUNCTION_TYPE)
- {
- OB_PUTC ('F');
- if (firstarg == NULL_TREE)
- OB_PUTC ('e');
- else if (firstarg == void_list_node)
- OB_PUTC ('v');
- else
- build_mangled_name (firstarg, 0, 0);
- }
- else
- {
- int constp = TYPE_READONLY (TREE_TYPE (TREE_VALUE (firstarg)));
- int volatilep = TYPE_VOLATILE (TREE_TYPE (TREE_VALUE (firstarg)));
+ tree parms = TYPE_ARG_TYPES (parmtype);
+
+ /* Rather than implementing a reentrant TYPEVEC, we turn off
+ repeat codes here, unless we're squangling. Squangling
+ doesn't make use of the TYPEVEC, so there's no reentrancy
+ problem. */
+ int old_nofold = nofold;
+ if (!flag_do_squangling)
+ nofold = 1;
+
+ if (TREE_CODE (parmtype) == METHOD_TYPE)
+ {
+ /* Mark this as a method. */
OB_PUTC ('M');
- firstarg = TREE_CHAIN (firstarg);
-
- build_mangled_name (TYPE_METHOD_BASETYPE (parmtype), 0, 0);
- if (constp)
- OB_PUTC ('C');
- if (volatilep)
- OB_PUTC ('V');
-
- /* For cfront 2.0 compatibility. */
- OB_PUTC ('F');
-
- if (firstarg == NULL_TREE)
- OB_PUTC ('e');
- else if (firstarg == void_list_node)
- OB_PUTC ('v');
- else
- build_mangled_name (firstarg, 0, 0);
- }
-
- /* Separate args from return type. */
+ /* Output the class of which this method is a member. */
+ build_mangled_name_for_type (TYPE_METHOD_BASETYPE (parmtype));
+ /* Output any qualifiers for the `this' parameter. */
+ process_modifiers (TREE_TYPE (TREE_VALUE (parms)));
+ }
+
+ /* Output the parameter types. */
+ OB_PUTC ('F');
+ if (parms == NULL_TREE)
+ OB_PUTC ('e');
+ else if (parms == void_list_node)
+ OB_PUTC ('v');
+ else
+ build_mangled_name (parms, 0, 0);
+
+ /* Output the return type. */
OB_PUTC ('_');
- build_mangled_name (TREE_TYPE (parmtype), 0, 0);
+ build_mangled_name_for_type (TREE_TYPE (parmtype));
+
nofold = old_nofold;
break;
}
case INTEGER_TYPE:
- /* "Java" integer types should mangle the same on all platforms,
- and only depend on precision, not target 'int' size. */
- if (is_java_type (parmtype))
- {
- if (TREE_UNSIGNED (parmtype))
- {
- switch (TYPE_PRECISION (parmtype))
- {
- case 8: OB_PUTC ('b'); return;
- case 16: OB_PUTC ('w'); return;
- }
- }
- else
- {
- switch (TYPE_PRECISION (parmtype))
- {
- case 8: OB_PUTC ('c'); return;
- case 16: OB_PUTC ('s'); return;
- case 32: OB_PUTC ('i'); return;
- case 64: OB_PUTC ('x'); return;
- }
- }
- }
-
parmtype = TYPE_MAIN_VARIANT (parmtype);
if (parmtype == integer_type_node
- || parmtype == unsigned_type_node)
+ || parmtype == unsigned_type_node
+ || parmtype == java_int_type_node)
OB_PUTC ('i');
else if (parmtype == long_integer_type_node
|| parmtype == long_unsigned_type_node)
OB_PUTC ('l');
else if (parmtype == short_integer_type_node
- || parmtype == short_unsigned_type_node)
+ || parmtype == short_unsigned_type_node
+ || parmtype == java_short_type_node)
OB_PUTC ('s');
else if (parmtype == signed_char_type_node)
{
@@ -1364,12 +1346,15 @@ process_overload_item (parmtype, extra_Gcode)
OB_PUTC ('c');
}
else if (parmtype == char_type_node
- || parmtype == unsigned_char_type_node)
+ || parmtype == unsigned_char_type_node
+ || parmtype == java_byte_type_node)
OB_PUTC ('c');
- else if (parmtype == wchar_type_node)
+ else if (parmtype == wchar_type_node
+ || parmtype == java_char_type_node)
OB_PUTC ('w');
else if (parmtype == long_long_integer_type_node
- || parmtype == long_long_unsigned_type_node)
+ || parmtype == long_long_unsigned_type_node
+ || parmtype == java_long_type_node)
OB_PUTC ('x');
#if 0
/* it would seem there is no way to enter these in source code,
@@ -1378,6 +1363,8 @@ process_overload_item (parmtype, extra_Gcode)
|| parmtype == long_long_long_unsigned_type_node)
OB_PUTC ('q');
#endif
+ else if (parmtype == java_boolean_type_node)
+ OB_PUTC ('b');
else
my_friendly_abort (73);
break;
@@ -1390,16 +1377,18 @@ process_overload_item (parmtype, extra_Gcode)
parmtype = TYPE_MAIN_VARIANT (parmtype);
if (parmtype == long_double_type_node)
OB_PUTC ('r');
- else if (parmtype == double_type_node)
+ else if (parmtype == double_type_node
+ || parmtype == java_double_type_node)
OB_PUTC ('d');
- else if (parmtype == float_type_node)
+ else if (parmtype == float_type_node
+ || parmtype == java_float_type_node)
OB_PUTC ('f');
else my_friendly_abort (74);
break;
case COMPLEX_TYPE:
OB_PUTC ('J');
- build_mangled_name (TREE_TYPE (parmtype), 0, 0);
+ build_mangled_name_for_type (TREE_TYPE (parmtype));
break;
case VOID_TYPE:
@@ -1421,11 +1410,6 @@ process_overload_item (parmtype, extra_Gcode)
{
tree name = TYPE_NAME (parmtype);
- if (TREE_CODE (name) == IDENTIFIER_NODE)
- {
- build_overload_identifier (TYPE_NAME (parmtype));
- break;
- }
my_friendly_assert (TREE_CODE (name) == TYPE_DECL, 248);
build_qualified_name (name);
@@ -1507,7 +1491,10 @@ build_static_name (context, name)
return get_identifier ((char *)obstack_base (&scratch_obstack));
}
-static tree
+/* FOR_METHOD should be 1 if the declaration in question is for a member
+ of a class (including a static member) and 2 if the declaration is
+ for a constructor. */
+tree
build_decl_overload_real (dname, parms, ret_type, tparms, targs,
for_method)
tree dname;
@@ -1541,41 +1528,22 @@ build_decl_overload_real (dname, parms, ret_type, tparms, targs,
and figure out its name without any extra encoding. */
OB_PUTC2 ('_', '_');
- if (for_method)
- {
-#if 0
- /* We can get away without doing this. */
- OB_PUTC ('M');
-#endif
- if (tparms != NULL_TREE)
- OB_PUTC ('H');
- {
- tree this_type = TREE_VALUE (parms);
-
- if (TREE_CODE (this_type) == RECORD_TYPE) /* a signature pointer */
- parms = temp_tree_cons (NULL_TREE, SIGNATURE_TYPE (this_type),
- TREE_CHAIN (parms));
- else
- parms = temp_tree_cons (NULL_TREE, TREE_TYPE (this_type),
- TREE_CHAIN (parms));
- }
- }
- else if (tparms)
- OB_PUTC ('H');
- /* XXX this works only if we call this in the same namespace
- as the declaration. Unfortunately, we don't have the _DECL,
- only its name */
- else if (current_namespace == global_namespace)
- OB_PUTC ('F');
+ numeric_output_need_bar = 0;
if (tparms)
{
+ OB_PUTC ('H');
build_template_parm_names (tparms, targs);
OB_PUTC ('_');
}
+ else if (!for_method && current_namespace == global_namespace)
+ /* XXX this works only if we call this in the same namespace
+ as the declaration. Unfortunately, we don't have the _DECL,
+ only its name */
+ OB_PUTC ('F');
- /* qualify with namespace */
if (!for_method && current_namespace != global_namespace)
+ /* qualify with namespace */
build_qualified_name (current_namespace);
if (parms == NULL_TREE)
@@ -1587,18 +1555,36 @@ build_decl_overload_real (dname, parms, ret_type, tparms, targs,
if (!flag_do_squangling) /* Allocate typevec array. */
{
maxtype = 0;
- Nrepeats = 0;
- typevec = (tree *)alloca (list_length (parms) * sizeof (tree));
+ typevec_size = list_length (parms);
+ if (!for_method && current_namespace != global_namespace)
+ /* the namespace of a global function needs one slot */
+ typevec_size++;
+ typevec = (tree *)alloca (typevec_size * sizeof (tree));
}
nofold = 0;
+
if (for_method)
{
- build_mangled_name (TREE_VALUE (parms), 0, 0);
+ tree this_type = TREE_VALUE (parms);
+
+ if (TREE_CODE (this_type) == RECORD_TYPE) /* a signature pointer */
+ this_type = SIGNATURE_TYPE (this_type);
+ else
+ this_type = TREE_TYPE (this_type);
- if (!flag_do_squangling) {
- typevec[maxtype++] = TREE_VALUE (parms);
- TREE_USED (TREE_VALUE (parms)) = 1;
- }
+ build_mangled_name_for_type (this_type);
+
+ if (!flag_do_squangling)
+ {
+ my_friendly_assert (maxtype < typevec_size, 387);
+ typevec[maxtype++] = this_type;
+ TREE_USED (this_type) = 1;
+
+ /* By setting up PARMS in this way, the loop below will
+ automatically clear TREE_USED on THIS_TYPE. */
+ parms = temp_tree_cons (NULL_TREE, this_type,
+ TREE_CHAIN (parms));
+ }
if (TREE_CHAIN (parms))
build_mangled_name (TREE_CHAIN (parms), 0, 0);
@@ -1611,7 +1597,10 @@ build_decl_overload_real (dname, parms, ret_type, tparms, targs,
will count as type */
if (current_namespace != global_namespace
&& !flag_do_squangling)
- typevec[maxtype++] = current_namespace;
+ {
+ my_friendly_assert (maxtype < typevec_size, 387);
+ typevec[maxtype++] = current_namespace;
+ }
build_mangled_name (parms, 0, 0);
}
@@ -1624,8 +1613,7 @@ build_decl_overload_real (dname, parms, ret_type, tparms, targs,
tree temp = TREE_VALUE (t);
TREE_USED (temp) = 0;
/* clear out the type variant in case we used it */
- temp = build_type_variant (TYPE_MAIN_VARIANT (temp),
- TYPE_READONLY (temp), TYPE_VOLATILE (temp));
+ temp = canonical_type_variant (temp);
TREE_USED (temp) = 0;
t = TREE_CHAIN (t);
}
@@ -1636,7 +1624,7 @@ build_decl_overload_real (dname, parms, ret_type, tparms, targs,
{
/* Add the return type. */
OB_PUTC ('_');
- build_mangled_name (ret_type, 0, 0);
+ build_mangled_name_for_type (ret_type);
}
OB_FINISH ();
@@ -1668,23 +1656,31 @@ build_decl_overload (dname, parms, for_method)
NULL_TREE, for_method);
}
+/* Set the mangled name (DECL_ASSEMBLER_NAME) for DECL. */
-/* Like build_decl_overload, but for template functions. */
-
-tree
-build_template_decl_overload (dname, parms, ret_type, tparms, targs,
- for_method)
- tree dname;
- tree parms;
- tree ret_type;
- tree tparms;
- tree targs;
- int for_method;
+void
+set_mangled_name_for_decl (decl)
+ tree decl;
{
- return build_decl_overload_real (dname, parms, ret_type, tparms, targs,
- for_method);
-}
+ tree parm_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
+ if (DECL_STATIC_FUNCTION_P (decl))
+ parm_types =
+ hash_tree_chain (build_pointer_type (DECL_CLASS_CONTEXT (decl)),
+ parm_types);
+ else
+ /* The only member functions whose type is a FUNCTION_TYPE, rather
+ than a METHOD_TYPE, should be static members. */
+ my_friendly_assert (!DECL_CONTEXT (decl)
+ || !IS_AGGR_TYPE_CODE (TREE_CODE (DECL_CONTEXT (decl)))
+ || TREE_CODE (TREE_TYPE (decl)) != FUNCTION_TYPE,
+ 0);
+
+ DECL_ASSEMBLER_NAME (decl)
+ = build_decl_overload (DECL_NAME (decl), parm_types,
+ DECL_FUNCTION_MEMBER_P (decl)
+ + DECL_CONSTRUCTOR_P (decl));
+}
/* Build an overload name for the type expression TYPE. */
@@ -1734,6 +1730,16 @@ get_id_2 (name, name2)
OB_FINISH ();
return get_identifier (obstack_base (&scratch_obstack));
}
+
+/* Returns a DECL_ASSEMBLER_NAME for the destructor of type TYPE. */
+
+tree
+build_destructor_name (type)
+ tree type;
+{
+ return build_overload_with_type (get_identifier (DESTRUCTOR_DECL_PREFIX),
+ type);
+}
/* Given a tree_code CODE, and some arguments (at least one),
attempt to use an overloaded operator on the arguments.
@@ -1805,6 +1811,9 @@ hack_identifier (value, name)
fndecl = TREE_VALUE (fields);
my_friendly_assert (TREE_CODE (fndecl) == FUNCTION_DECL, 251);
+ /* I could not trigger this code. MvL */
+ my_friendly_abort (980325);
+#ifdef DEAD
if (DECL_CHAIN (fndecl) == NULL_TREE)
{
warning ("methods cannot be converted to function pointers");
@@ -1816,6 +1825,7 @@ hack_identifier (value, name)
IDENTIFIER_POINTER (name));
return error_mark_node;
}
+#endif
}
}
if (flag_labels_ok && IDENTIFIER_LABEL_VALUE (name))
@@ -1830,8 +1840,16 @@ hack_identifier (value, name)
{
if (current_class_ptr == NULL_TREE)
{
- error ("request for member `%s' in static member function",
- IDENTIFIER_POINTER (DECL_NAME (value)));
+ if (current_function_decl
+ && DECL_STATIC_FUNCTION_P (current_function_decl))
+ cp_error ("invalid use of member `%D' in static member function",
+ value);
+ else
+ /* We can get here when processing a bad default
+ argument, like:
+ struct S { int a; void f(int i = a); } */
+ cp_error ("invalid use of member `%D'", value);
+
return error_mark_node;
}
TREE_USED (current_class_ptr) = 1;
@@ -1856,6 +1874,9 @@ hack_identifier (value, name)
}
#endif
}
+ else if (TREE_CODE (value) == OVERLOAD)
+ /* not really overloaded function */
+ mark_used (OVL_FUNCTION (value));
else if (TREE_CODE (value) == TREE_LIST)
{
/* Ambiguous reference to base members, possibly other cases?. */
@@ -1866,6 +1887,16 @@ hack_identifier (value, name)
t = TREE_CHAIN (t);
}
}
+ else if (TREE_CODE (value) == NAMESPACE_DECL)
+ {
+ cp_error ("use of namespace `%D' as expression", value);
+ return error_mark_node;
+ }
+ else if (DECL_CLASS_TEMPLATE_P (value))
+ {
+ cp_error ("use of class template `%T' as expression", value);
+ return error_mark_node;
+ }
else
mark_used (value);
@@ -1915,17 +1946,12 @@ hack_identifier (value, name)
}
else if (TREE_CODE (value) == TREE_LIST && TREE_NONLOCAL_FLAG (value))
{
- if (type == 0)
- {
- error ("request for member `%s' is ambiguous in multiple inheritance lattice",
- IDENTIFIER_POINTER (name));
- return error_mark_node;
- }
-
- return value;
+ error ("request for member `%s' is ambiguous in multiple inheritance lattice",
+ IDENTIFIER_POINTER (name));
+ return error_mark_node;
}
- if (TREE_CODE (type) == REFERENCE_TYPE && ! processing_template_decl)
+ if (! processing_template_decl)
value = convert_from_reference (value);
return value;
}
@@ -1936,28 +1962,36 @@ make_thunk (function, delta)
tree function;
int delta;
{
- char *buffer;
tree thunk_id;
tree thunk;
- char *func_name;
tree func_decl;
+
if (TREE_CODE (function) != ADDR_EXPR)
abort ();
func_decl = TREE_OPERAND (function, 0);
if (TREE_CODE (func_decl) != FUNCTION_DECL)
abort ();
- func_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (func_decl));
- buffer = (char *)alloca (strlen (func_name) + 32);
- if (delta<=0)
- sprintf (buffer, "__thunk_%d_%s", -delta, func_name);
+
+ OB_INIT ();
+ OB_PUTS ("__thunk_");
+ if (delta > 0)
+ {
+ OB_PUTC ('n');
+ icat (delta);
+ }
else
- sprintf (buffer, "__thunk_n%d_%s", delta, func_name);
- thunk_id = get_identifier (buffer);
+ icat (-delta);
+ OB_PUTC ('_');
+ OB_PUTID (DECL_ASSEMBLER_NAME (func_decl));
+ OB_FINISH ();
+ thunk_id = get_identifier (obstack_base (&scratch_obstack));
+
thunk = IDENTIFIER_GLOBAL_VALUE (thunk_id);
if (thunk && TREE_CODE (thunk) != THUNK_DECL)
{
cp_error ("implementation-reserved name `%D' used", thunk_id);
- IDENTIFIER_GLOBAL_VALUE (thunk_id) = thunk = NULL_TREE;
+ thunk = NULL_TREE;
+ SET_IDENTIFIER_GLOBAL_VALUE (thunk_id, thunk);
}
if (thunk == NULL_TREE)
{
@@ -2010,6 +2044,7 @@ emit_thunk (thunk_fndecl)
= build_decl (RESULT_DECL, 0, integer_type_node);
fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
init_function_start (thunk_fndecl, input_filename, lineno);
+ current_function_is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
assemble_end_function (thunk_fndecl, fnname);
@@ -2182,8 +2217,7 @@ do_build_copy_constructor (fndecl)
continue;
}
else if ((t = TREE_TYPE (field)) != NULL_TREE
- && TREE_CODE (t) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
+ && ANON_UNION_TYPE_P (t)
&& TYPE_FIELDS (t) != NULL_TREE)
{
do
@@ -2192,8 +2226,7 @@ do_build_copy_constructor (fndecl)
field = largest_union_member (t);
}
while ((t = TREE_TYPE (field)) != NULL_TREE
- && TREE_CODE (t) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
+ && ANON_UNION_TYPE_P (t)
&& TYPE_FIELDS (t) != NULL_TREE);
}
else
@@ -2292,8 +2325,7 @@ do_build_assign_ref (fndecl)
continue;
}
else if ((t = TREE_TYPE (field)) != NULL_TREE
- && TREE_CODE (t) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
+ && ANON_UNION_TYPE_P (t)
&& TYPE_FIELDS (t) != NULL_TREE)
{
do
@@ -2303,8 +2335,7 @@ do_build_assign_ref (fndecl)
field = largest_union_member (t);
}
while ((t = TREE_TYPE (field)) != NULL_TREE
- && TREE_CODE (t) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
+ && ANON_UNION_TYPE_P (t)
&& TYPE_FIELDS (t) != NULL_TREE);
}
else
diff --git a/gcc/cp/new.cc b/gcc/cp/new.cc
index 33cf190108c..28187a43884 100644
--- a/gcc/cp/new.cc
+++ b/gcc/cp/new.cc
@@ -28,8 +28,9 @@
#pragma implementation "new"
#include "new"
-const nothrow_t nothrow = { };
+const std::nothrow_t std::nothrow = { };
+using std::new_handler;
new_handler __new_handler;
new_handler
diff --git a/gcc/cp/new1.cc b/gcc/cp/new1.cc
index 98c2a4a955e..5bb85c94f15 100644
--- a/gcc/cp/new1.cc
+++ b/gcc/cp/new1.cc
@@ -26,6 +26,8 @@
// the executable file might be covered by the GNU General Public License.
#include "new"
+using std::new_handler;
+using std::bad_alloc;
extern "C" void *malloc (size_t);
extern new_handler __new_handler;
@@ -35,7 +37,7 @@ extern new_handler __new_handler;
x
#ifdef L_op_newnt
-WEAK (void * operator new (size_t sz, const nothrow_t&) throw())
+WEAK (void * operator new (size_t sz, const std::nothrow_t&) throw())
{
void *p;
diff --git a/gcc/cp/new2.cc b/gcc/cp/new2.cc
index d5320f99502..0be1c0d8c7f 100644
--- a/gcc/cp/new2.cc
+++ b/gcc/cp/new2.cc
@@ -41,7 +41,7 @@ WEAK(void * operator new[] (size_t sz) throw (std::bad_alloc))
#endif
#ifdef L_op_vnewnt
-WEAK(void *operator new[] (size_t sz, const nothrow_t& nothrow) throw())
+WEAK(void *operator new[] (size_t sz, const std::nothrow_t& nothrow) throw())
{
return ::operator new(sz, nothrow);
}
diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c
index dd68890e6a3..9ac44964ab0 100644
--- a/gcc/cp/parse.c
+++ b/gcc/cp/parse.c
@@ -30,68 +30,66 @@
#define RETURN 280
#define GOTO 281
#define ASM_KEYWORD 282
-#define GCC_ASM_KEYWORD 283
-#define TYPEOF 284
-#define ALIGNOF 285
-#define SIGOF 286
-#define ATTRIBUTE 287
-#define EXTENSION 288
-#define LABEL 289
-#define REALPART 290
-#define IMAGPART 291
-#define AGGR 292
-#define VISSPEC 293
-#define DELETE 294
-#define NEW 295
-#define THIS 296
-#define OPERATOR 297
-#define CXX_TRUE 298
-#define CXX_FALSE 299
-#define NAMESPACE 300
-#define TYPENAME_KEYWORD 301
-#define USING 302
-#define LEFT_RIGHT 303
-#define TEMPLATE 304
-#define TYPEID 305
-#define DYNAMIC_CAST 306
-#define STATIC_CAST 307
-#define REINTERPRET_CAST 308
-#define CONST_CAST 309
-#define SCOPE 310
-#define EMPTY 311
-#define PTYPENAME 312
-#define NSNAME 313
-#define THROW 314
-#define ASSIGN 315
-#define OROR 316
-#define ANDAND 317
-#define MIN_MAX 318
-#define EQCOMPARE 319
-#define ARITHCOMPARE 320
-#define LSHIFT 321
-#define RSHIFT 322
-#define POINTSAT_STAR 323
-#define DOT_STAR 324
-#define UNARY 325
-#define PLUSPLUS 326
-#define MINUSMINUS 327
-#define HYPERUNARY 328
-#define PAREN_STAR_PAREN 329
-#define POINTSAT 330
-#define TRY 331
-#define CATCH 332
-#define TYPENAME_ELLIPSIS 333
-#define PRE_PARSED_FUNCTION_DECL 334
-#define EXTERN_LANG_STRING 335
-#define ALL 336
-#define PRE_PARSED_CLASS_DECL 337
-#define DEFARG 338
-#define DEFARG_MARKER 339
-#define TYPENAME_DEFN 340
-#define IDENTIFIER_DEFN 341
-#define PTYPENAME_DEFN 342
-#define END_OF_LINE 343
-#define END_OF_SAVED_INPUT 344
+#define TYPEOF 283
+#define ALIGNOF 284
+#define SIGOF 285
+#define ATTRIBUTE 286
+#define EXTENSION 287
+#define LABEL 288
+#define REALPART 289
+#define IMAGPART 290
+#define AGGR 291
+#define VISSPEC 292
+#define DELETE 293
+#define NEW 294
+#define THIS 295
+#define OPERATOR 296
+#define CXX_TRUE 297
+#define CXX_FALSE 298
+#define NAMESPACE 299
+#define TYPENAME_KEYWORD 300
+#define USING 301
+#define LEFT_RIGHT 302
+#define TEMPLATE 303
+#define TYPEID 304
+#define DYNAMIC_CAST 305
+#define STATIC_CAST 306
+#define REINTERPRET_CAST 307
+#define CONST_CAST 308
+#define SCOPE 309
+#define EMPTY 310
+#define PTYPENAME 311
+#define NSNAME 312
+#define THROW 313
+#define ASSIGN 314
+#define OROR 315
+#define ANDAND 316
+#define MIN_MAX 317
+#define EQCOMPARE 318
+#define ARITHCOMPARE 319
+#define LSHIFT 320
+#define RSHIFT 321
+#define POINTSAT_STAR 322
+#define DOT_STAR 323
+#define UNARY 324
+#define PLUSPLUS 325
+#define MINUSMINUS 326
+#define HYPERUNARY 327
+#define PAREN_STAR_PAREN 328
+#define POINTSAT 329
+#define TRY 330
+#define CATCH 331
+#define PRE_PARSED_FUNCTION_DECL 332
+#define EXTERN_LANG_STRING 333
+#define ALL 334
+#define PRE_PARSED_CLASS_DECL 335
+#define DEFARG 336
+#define DEFARG_MARKER 337
+#define TYPENAME_DEFN 338
+#define IDENTIFIER_DEFN 339
+#define PTYPENAME_DEFN 340
+#define END_OF_LINE 341
+#define END_OF_SAVED_INPUT 342
#line 29 "parse.y"
@@ -109,6 +107,7 @@
#include "cp-tree.h"
#include "output.h"
#include "except.h"
+#include "toplev.h"
/* Since parsers are distinct for each language, put the language string
definition here. (fnf) */
@@ -153,22 +152,27 @@ empty_parms ()
}
-#line 91 "parse.y"
+#line 92 "parse.y"
typedef union {long itype; tree ttype; char *strtype; enum tree_code code; flagged_type_tree ftype; } YYSTYPE;
-#line 280 "parse.y"
+#line 281 "parse.y"
/* List of types and structure classes of the current declaration. */
-static tree current_declspecs = NULL_TREE;
+static tree current_declspecs;
+
/* List of prefix attributes in effect.
Prefix attributes are parsed by the reserved_declspecs and declmods
rules. They create a list that contains *both* declspecs and attrs. */
/* ??? It is not clear yet that all cases where an attribute can now appear in
a declspec list have been updated. */
-static tree prefix_attributes = NULL_TREE;
+static tree prefix_attributes;
-/* When defining an aggregate, this is the most recent one being defined. */
+/* When defining an aggregate, this is the kind of the most recent one
+ being defined. (For example, this might be class_type_node.) */
static tree current_aggr;
+/* When defining an enumeration, this is the type of the enumeration. */
+static tree current_enum_type;
+
/* Tell yyparse how to print a token's value, if yydebug is set. */
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
@@ -211,26 +215,26 @@ parse_decl(declarator, specs_attrs, attributes, initialized, decl)
-#define YYFINAL 1549
+#define YYFINAL 1609
#define YYFLAG -32768
-#define YYNTBASE 114
+#define YYNTBASE 112
-#define YYTRANSLATE(x) ((unsigned)(x) <= 344 ? yytranslate[x] : 386)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 342 ? yytranslate[x] : 396)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 112, 2, 2, 2, 83, 71, 2, 94,
- 110, 81, 79, 60, 80, 93, 82, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 63, 61, 75,
- 65, 76, 66, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 110, 2, 2, 2, 82, 70, 2, 93,
+ 108, 80, 78, 59, 79, 92, 81, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 62, 60, 74,
+ 64, 75, 65, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 95, 2, 113, 70, 2, 2, 2, 2, 2, 2,
+ 94, 2, 111, 69, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 59, 69, 111, 89, 2, 2, 2, 2,
+ 2, 2, 58, 68, 109, 88, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -249,466 +253,482 @@ static const char yytranslate[] = { 0,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 62, 64, 67, 68, 72, 73, 74,
- 77, 78, 84, 85, 86, 87, 88, 90, 91, 92,
+ 56, 57, 61, 63, 66, 67, 71, 72, 73, 76,
+ 77, 83, 84, 85, 86, 87, 89, 90, 91, 95,
96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109
+ 106, 107
};
#if YYDEBUG != 0
static const short yyprhs[] = { 0,
0, 1, 3, 4, 7, 10, 12, 13, 14, 15,
- 17, 19, 21, 22, 25, 28, 30, 32, 38, 43,
- 49, 54, 55, 62, 63, 69, 75, 78, 83, 86,
- 89, 93, 97, 99, 101, 104, 107, 109, 112, 113,
- 119, 123, 125, 129, 131, 132, 135, 138, 142, 144,
- 148, 150, 154, 156, 160, 163, 166, 169, 173, 177,
- 180, 183, 186, 189, 192, 194, 196, 198, 199, 201,
- 204, 205, 207, 212, 216, 220, 221, 230, 236, 237,
- 247, 254, 255, 264, 270, 271, 281, 288, 291, 294,
- 296, 299, 301, 308, 313, 320, 325, 328, 330, 333,
- 336, 338, 341, 343, 346, 349, 354, 357, 361, 362,
- 363, 365, 369, 372, 376, 378, 383, 386, 391, 394,
- 399, 402, 404, 406, 408, 410, 412, 414, 416, 418,
- 420, 422, 424, 425, 432, 433, 440, 441, 447, 448,
- 454, 455, 463, 464, 472, 473, 480, 481, 488, 489,
- 490, 495, 500, 502, 507, 509, 511, 512, 514, 516,
- 520, 522, 524, 526, 528, 530, 532, 534, 536, 538,
- 540, 544, 546, 550, 551, 553, 555, 556, 564, 566,
- 568, 572, 577, 581, 582, 586, 588, 592, 596, 600,
- 604, 606, 608, 610, 613, 616, 619, 622, 625, 628,
- 631, 636, 639, 644, 647, 651, 655, 660, 665, 671,
- 677, 684, 687, 692, 698, 701, 704, 708, 712, 716,
- 718, 722, 725, 729, 734, 736, 739, 745, 747, 751,
- 755, 759, 763, 767, 771, 775, 779, 783, 787, 791,
- 795, 799, 803, 807, 811, 815, 819, 823, 829, 833,
- 837, 839, 842, 846, 848, 850, 852, 854, 856, 857,
- 863, 869, 875, 881, 887, 889, 891, 893, 895, 898,
- 901, 905, 910, 915, 917, 919, 921, 925, 927, 929,
- 931, 933, 937, 941, 945, 946, 951, 956, 959, 964,
- 967, 970, 972, 977, 979, 987, 995, 1003, 1011, 1016,
- 1021, 1024, 1027, 1029, 1034, 1037, 1040, 1046, 1050, 1053,
- 1056, 1062, 1066, 1072, 1076, 1081, 1088, 1091, 1093, 1096,
- 1098, 1101, 1103, 1105, 1107, 1110, 1111, 1114, 1117, 1121,
- 1125, 1129, 1132, 1135, 1138, 1140, 1142, 1144, 1147, 1150,
- 1153, 1156, 1158, 1160, 1162, 1164, 1167, 1170, 1174, 1178,
- 1182, 1187, 1189, 1192, 1195, 1198, 1200, 1202, 1204, 1207,
- 1210, 1213, 1215, 1217, 1220, 1223, 1227, 1229, 1232, 1234,
- 1236, 1238, 1243, 1248, 1253, 1258, 1260, 1262, 1264, 1266,
- 1270, 1272, 1276, 1278, 1282, 1283, 1288, 1289, 1296, 1300,
- 1301, 1306, 1308, 1312, 1316, 1317, 1322, 1326, 1327, 1329,
- 1331, 1334, 1341, 1343, 1347, 1348, 1350, 1355, 1362, 1367,
- 1369, 1371, 1373, 1375, 1377, 1381, 1382, 1385, 1387, 1390,
- 1394, 1399, 1401, 1403, 1407, 1412, 1416, 1422, 1424, 1429,
- 1433, 1437, 1438, 1442, 1446, 1450, 1451, 1454, 1457, 1458,
- 1466, 1471, 1472, 1479, 1483, 1486, 1489, 1492, 1493, 1494,
- 1504, 1506, 1507, 1509, 1510, 1512, 1514, 1517, 1520, 1523,
- 1526, 1529, 1532, 1536, 1541, 1545, 1548, 1552, 1553, 1555,
- 1559, 1562, 1565, 1567, 1569, 1570, 1573, 1577, 1579, 1584,
- 1586, 1590, 1592, 1594, 1599, 1604, 1607, 1610, 1614, 1618,
- 1620, 1621, 1623, 1626, 1631, 1635, 1637, 1640, 1643, 1646,
- 1649, 1652, 1655, 1658, 1660, 1663, 1666, 1670, 1673, 1676,
- 1681, 1686, 1689, 1691, 1697, 1702, 1704, 1705, 1707, 1711,
- 1712, 1714, 1718, 1720, 1722, 1724, 1726, 1731, 1736, 1741,
- 1746, 1751, 1755, 1760, 1765, 1770, 1775, 1779, 1781, 1785,
- 1787, 1791, 1794, 1796, 1803, 1804, 1807, 1809, 1812, 1813,
- 1816, 1821, 1826, 1829, 1834, 1838, 1842, 1845, 1848, 1852,
- 1854, 1856, 1859, 1861, 1863, 1866, 1869, 1874, 1879, 1883,
- 1887, 1890, 1892, 1896, 1900, 1903, 1906, 1910, 1912, 1916,
- 1920, 1923, 1926, 1930, 1932, 1937, 1941, 1946, 1950, 1952,
- 1955, 1958, 1961, 1964, 1967, 1969, 1972, 1977, 1982, 1985,
- 1987, 1989, 1991, 1993, 1996, 2001, 2004, 2007, 2010, 2013,
- 2015, 2018, 2021, 2024, 2027, 2031, 2033, 2036, 2040, 2045,
- 2048, 2051, 2054, 2057, 2060, 2063, 2068, 2071, 2073, 2076,
- 2079, 2083, 2085, 2089, 2092, 2096, 2099, 2102, 2106, 2108,
- 2112, 2117, 2121, 2124, 2127, 2129, 2133, 2136, 2139, 2141,
- 2144, 2148, 2150, 2154, 2156, 2163, 2168, 2173, 2177, 2183,
- 2187, 2191, 2195, 2198, 2200, 2202, 2205, 2208, 2211, 2212,
- 2214, 2216, 2219, 2223, 2225, 2228, 2229, 2233, 2234, 2235,
- 2241, 2243, 2244, 2247, 2249, 2251, 2253, 2256, 2257, 2262,
- 2264, 2265, 2266, 2272, 2273, 2274, 2282, 2283, 2284, 2285,
- 2286, 2299, 2300, 2301, 2309, 2310, 2316, 2317, 2325, 2326,
- 2331, 2334, 2337, 2340, 2344, 2351, 2360, 2371, 2384, 2389,
- 2393, 2396, 2399, 2401, 2403, 2404, 2405, 2412, 2413, 2414,
- 2420, 2422, 2425, 2426, 2427, 2433, 2435, 2437, 2441, 2445,
- 2448, 2451, 2454, 2457, 2460, 2462, 2465, 2466, 2468, 2469,
- 2471, 2473, 2474, 2476, 2478, 2482, 2487, 2489, 2493, 2494,
- 2496, 2498, 2500, 2503, 2506, 2509, 2511, 2513, 2516, 2519,
- 2522, 2525, 2526, 2530, 2532, 2534, 2536, 2539, 2542, 2545,
- 2550, 2553, 2556, 2559, 2562, 2565, 2568, 2570, 2573, 2575,
- 2578, 2580, 2582, 2583, 2584, 2586, 2587, 2592, 2595, 2597,
- 2599, 2603, 2604, 2608, 2612, 2616, 2618, 2621, 2624, 2627,
- 2630, 2633, 2636, 2639, 2642, 2645, 2648, 2651, 2654, 2657,
- 2660, 2663, 2666, 2669, 2672, 2675, 2678, 2681, 2684, 2687,
- 2691, 2694, 2697, 2700, 2703, 2707, 2710, 2713, 2718, 2723,
- 2727
+ 17, 19, 20, 23, 26, 28, 30, 36, 41, 47,
+ 52, 53, 60, 61, 67, 69, 72, 74, 77, 78,
+ 85, 88, 92, 96, 100, 104, 109, 110, 116, 119,
+ 123, 125, 127, 130, 133, 135, 138, 139, 145, 149,
+ 151, 155, 157, 158, 161, 164, 168, 170, 174, 176,
+ 180, 182, 186, 189, 192, 195, 197, 199, 205, 210,
+ 213, 216, 220, 224, 227, 230, 234, 238, 241, 244,
+ 247, 250, 253, 255, 257, 259, 260, 262, 265, 266,
+ 268, 273, 277, 281, 282, 291, 297, 298, 308, 315,
+ 316, 325, 331, 332, 342, 349, 352, 355, 357, 360,
+ 362, 369, 374, 381, 386, 389, 391, 394, 397, 399,
+ 402, 404, 407, 410, 415, 418, 422, 423, 424, 426,
+ 430, 433, 437, 439, 444, 447, 452, 455, 460, 463,
+ 465, 467, 469, 471, 473, 475, 477, 479, 481, 483,
+ 485, 486, 493, 494, 501, 502, 508, 509, 515, 516,
+ 524, 525, 533, 534, 541, 542, 549, 550, 551, 557,
+ 563, 565, 571, 572, 574, 576, 577, 579, 581, 585,
+ 587, 589, 591, 593, 595, 597, 599, 601, 603, 605,
+ 607, 611, 613, 617, 618, 620, 622, 623, 631, 633,
+ 635, 639, 644, 648, 649, 653, 655, 659, 663, 667,
+ 671, 673, 675, 677, 680, 683, 686, 689, 692, 695,
+ 698, 703, 706, 711, 714, 718, 722, 727, 733, 740,
+ 747, 755, 758, 763, 769, 772, 775, 777, 778, 783,
+ 788, 792, 794, 798, 801, 805, 810, 812, 815, 821,
+ 823, 827, 831, 835, 839, 843, 847, 851, 855, 859,
+ 863, 867, 871, 875, 879, 883, 887, 891, 895, 899,
+ 905, 909, 913, 915, 918, 922, 926, 928, 930, 932,
+ 934, 936, 937, 943, 949, 955, 961, 967, 969, 971,
+ 973, 975, 978, 981, 985, 990, 995, 997, 999, 1001,
+ 1005, 1007, 1009, 1011, 1013, 1017, 1021, 1025, 1026, 1031,
+ 1036, 1039, 1044, 1047, 1052, 1055, 1058, 1060, 1065, 1067,
+ 1075, 1083, 1091, 1099, 1104, 1109, 1112, 1115, 1118, 1120,
+ 1125, 1128, 1131, 1137, 1141, 1144, 1147, 1153, 1157, 1163,
+ 1167, 1172, 1179, 1182, 1184, 1187, 1189, 1192, 1194, 1196,
+ 1198, 1201, 1202, 1205, 1208, 1212, 1216, 1220, 1223, 1226,
+ 1229, 1231, 1233, 1235, 1238, 1241, 1244, 1247, 1249, 1251,
+ 1253, 1255, 1258, 1261, 1265, 1269, 1273, 1278, 1280, 1283,
+ 1286, 1289, 1291, 1293, 1295, 1298, 1301, 1304, 1306, 1308,
+ 1311, 1314, 1318, 1320, 1323, 1325, 1327, 1329, 1334, 1339,
+ 1344, 1349, 1351, 1353, 1355, 1357, 1361, 1363, 1367, 1369,
+ 1373, 1374, 1379, 1380, 1387, 1391, 1392, 1397, 1399, 1403,
+ 1407, 1408, 1413, 1417, 1418, 1420, 1422, 1425, 1432, 1434,
+ 1438, 1439, 1441, 1446, 1453, 1458, 1460, 1462, 1464, 1466,
+ 1468, 1472, 1473, 1476, 1478, 1481, 1485, 1490, 1492, 1494,
+ 1498, 1503, 1507, 1513, 1515, 1520, 1524, 1528, 1529, 1533,
+ 1537, 1541, 1542, 1545, 1548, 1549, 1557, 1562, 1563, 1570,
+ 1574, 1577, 1580, 1583, 1584, 1585, 1595, 1597, 1598, 1600,
+ 1601, 1603, 1605, 1608, 1611, 1614, 1617, 1620, 1623, 1626,
+ 1629, 1632, 1636, 1641, 1645, 1648, 1652, 1654, 1655, 1659,
+ 1662, 1665, 1667, 1669, 1670, 1673, 1677, 1679, 1684, 1686,
+ 1690, 1692, 1694, 1699, 1704, 1707, 1710, 1714, 1718, 1720,
+ 1721, 1723, 1726, 1730, 1733, 1736, 1738, 1741, 1744, 1747,
+ 1750, 1753, 1756, 1759, 1761, 1764, 1767, 1771, 1774, 1777,
+ 1782, 1787, 1790, 1792, 1798, 1803, 1805, 1806, 1808, 1812,
+ 1813, 1815, 1819, 1821, 1823, 1825, 1827, 1832, 1837, 1842,
+ 1847, 1852, 1856, 1861, 1866, 1871, 1876, 1880, 1882, 1886,
+ 1888, 1892, 1895, 1897, 1905, 1906, 1909, 1911, 1914, 1915,
+ 1918, 1923, 1928, 1931, 1936, 1940, 1944, 1947, 1950, 1954,
+ 1956, 1958, 1961, 1963, 1965, 1968, 1971, 1976, 1981, 1985,
+ 1989, 1992, 1994, 1998, 2002, 2005, 2008, 2012, 2014, 2018,
+ 2022, 2025, 2028, 2032, 2034, 2039, 2043, 2048, 2052, 2054,
+ 2057, 2060, 2063, 2066, 2069, 2071, 2074, 2079, 2084, 2087,
+ 2089, 2091, 2093, 2095, 2098, 2103, 2106, 2109, 2112, 2115,
+ 2117, 2120, 2123, 2126, 2129, 2133, 2135, 2138, 2142, 2147,
+ 2150, 2153, 2156, 2159, 2162, 2165, 2170, 2173, 2175, 2178,
+ 2181, 2185, 2187, 2191, 2194, 2198, 2201, 2204, 2208, 2210,
+ 2214, 2219, 2223, 2226, 2229, 2231, 2235, 2238, 2241, 2243,
+ 2246, 2250, 2252, 2256, 2258, 2265, 2270, 2275, 2279, 2285,
+ 2289, 2293, 2297, 2300, 2302, 2304, 2307, 2310, 2313, 2314,
+ 2316, 2318, 2321, 2325, 2327, 2330, 2331, 2335, 2336, 2337,
+ 2343, 2345, 2346, 2349, 2351, 2353, 2355, 2358, 2359, 2364,
+ 2366, 2367, 2368, 2374, 2375, 2376, 2384, 2385, 2386, 2387,
+ 2388, 2401, 2402, 2403, 2411, 2412, 2418, 2419, 2427, 2428,
+ 2433, 2436, 2439, 2442, 2446, 2453, 2462, 2473, 2486, 2491,
+ 2495, 2498, 2501, 2503, 2505, 2507, 2509, 2511, 2512, 2513,
+ 2520, 2521, 2522, 2528, 2530, 2533, 2534, 2535, 2541, 2543,
+ 2545, 2549, 2553, 2556, 2559, 2562, 2565, 2568, 2570, 2573,
+ 2574, 2576, 2577, 2579, 2581, 2582, 2584, 2586, 2590, 2595,
+ 2597, 2601, 2602, 2604, 2606, 2608, 2611, 2614, 2617, 2619,
+ 2622, 2625, 2626, 2630, 2632, 2634, 2636, 2639, 2642, 2645,
+ 2650, 2653, 2656, 2659, 2662, 2665, 2668, 2670, 2673, 2675,
+ 2678, 2680, 2682, 2683, 2684, 2686, 2687, 2692, 2695, 2697,
+ 2699, 2703, 2704, 2708, 2712, 2716, 2718, 2721, 2724, 2727,
+ 2730, 2733, 2736, 2739, 2742, 2745, 2748, 2751, 2754, 2757,
+ 2760, 2763, 2766, 2769, 2772, 2775, 2778, 2781, 2784, 2787,
+ 2791, 2794, 2797, 2800, 2803, 2807, 2810, 2813, 2818, 2823,
+ 2827
};
static const short yyrhs[] = { -1,
- 115, 0, 0, 116, 122, 0, 115, 122, 0, 115,
- 0, 0, 0, 0, 33, 0, 27, 0, 28, 0,
- 0, 123, 124, 0, 142, 141, 0, 138, 0, 137,
- 0, 121, 94, 208, 110, 61, 0, 129, 59, 117,
- 111, 0, 129, 118, 142, 119, 141, 0, 129, 118,
- 138, 119, 0, 0, 45, 157, 59, 125, 117, 111,
- 0, 0, 45, 59, 126, 117, 111, 0, 45, 157,
- 65, 128, 61, 0, 127, 61, 0, 47, 45, 128,
- 61, 0, 120, 124, 0, 47, 300, 0, 47, 314,
- 300, 0, 47, 314, 199, 0, 199, 0, 300, 0,
- 314, 300, 0, 314, 199, 0, 100, 0, 129, 100,
- 0, 0, 49, 75, 131, 132, 76, 0, 49, 75,
- 76, 0, 136, 0, 132, 60, 136, 0, 157, 0,
- 0, 257, 133, 0, 46, 133, 0, 130, 257, 133,
- 0, 134, 0, 134, 65, 214, 0, 377, 0, 377,
- 65, 194, 0, 135, 0, 135, 65, 176, 0, 130,
- 124, 0, 130, 1, 0, 225, 61, 0, 218, 224,
- 61, 0, 215, 223, 61, 0, 218, 61, 0, 160,
- 61, 0, 215, 61, 0, 1, 61, 0, 1, 111,
- 0, 61, 0, 209, 0, 153, 0, 0, 152, 0,
- 152, 61, 0, 0, 109, 0, 148, 140, 139, 324,
- 0, 148, 140, 348, 0, 148, 140, 1, 0, 0,
- 305, 5, 94, 144, 368, 110, 287, 380, 0, 305,
- 5, 48, 287, 380, 0, 0, 314, 305, 5, 94,
- 145, 368, 110, 287, 380, 0, 314, 305, 5, 48,
- 287, 380, 0, 0, 305, 172, 94, 146, 368, 110,
- 287, 380, 0, 305, 172, 48, 287, 380, 0, 0,
- 314, 305, 172, 94, 147, 368, 110, 287, 380, 0,
- 314, 305, 172, 48, 287, 380, 0, 215, 212, 0,
- 218, 297, 0, 297, 0, 218, 143, 0, 143, 0,
- 5, 94, 368, 110, 287, 380, 0, 5, 48, 287,
- 380, 0, 172, 94, 368, 110, 287, 380, 0, 172,
- 48, 287, 380, 0, 218, 149, 0, 149, 0, 215,
- 212, 0, 218, 297, 0, 297, 0, 218, 143, 0,
- 143, 0, 25, 3, 0, 151, 242, 0, 151, 94,
- 188, 110, 0, 151, 48, 0, 63, 154, 155, 0,
- 0, 0, 156, 0, 155, 60, 156, 0, 155, 1,
- 0, 94, 188, 110, 0, 48, 0, 158, 94, 188,
- 110, 0, 158, 48, 0, 293, 94, 188, 110, 0,
- 293, 48, 0, 307, 94, 188, 110, 0, 307, 48,
- 0, 3, 0, 4, 0, 5, 0, 57, 0, 58,
- 0, 3, 0, 57, 0, 58, 0, 106, 0, 105,
- 0, 107, 0, 0, 49, 169, 221, 61, 161, 170,
- 0, 0, 49, 169, 215, 212, 162, 170, 0, 0,
- 49, 169, 297, 163, 170, 0, 0, 49, 169, 143,
- 164, 170, 0, 0, 7, 49, 169, 221, 61, 165,
- 170, 0, 0, 7, 49, 169, 215, 212, 166, 170,
- 0, 0, 7, 49, 169, 297, 167, 170, 0, 0,
- 7, 49, 169, 143, 168, 170, 0, 0, 0, 57,
- 75, 174, 173, 0, 4, 75, 174, 173, 0, 172,
- 0, 5, 75, 174, 173, 0, 76, 0, 78, 0,
- 0, 175, 0, 176, 0, 175, 60, 176, 0, 214,
- 0, 194, 0, 80, 0, 79, 0, 87, 0, 88,
- 0, 112, 0, 187, 0, 194, 0, 48, 0, 94,
- 178, 110, 0, 48, 0, 94, 182, 110, 0, 0,
- 182, 0, 1, 0, 0, 358, 212, 226, 235, 65,
- 183, 243, 0, 178, 0, 111, 0, 321, 319, 111,
- 0, 321, 319, 1, 111, 0, 321, 1, 111, 0,
- 0, 59, 186, 184, 0, 333, 0, 194, 60, 194,
- 0, 194, 60, 1, 0, 187, 60, 194, 0, 187,
- 60, 1, 0, 194, 0, 187, 0, 203, 0, 120,
- 193, 0, 81, 193, 0, 71, 193, 0, 89, 193,
- 0, 177, 193, 0, 68, 157, 0, 13, 189, 0,
- 13, 94, 214, 110, 0, 30, 189, 0, 30, 94,
- 214, 110, 0, 205, 286, 0, 205, 286, 191, 0,
- 205, 190, 286, 0, 205, 190, 286, 191, 0, 205,
- 94, 214, 110, 0, 205, 94, 214, 110, 191, 0,
- 205, 190, 94, 214, 110, 0, 205, 190, 94, 214,
- 110, 191, 0, 206, 193, 0, 206, 95, 113, 193,
- 0, 206, 95, 178, 113, 193, 0, 35, 193, 0,
- 36, 193, 0, 94, 188, 110, 0, 59, 188, 111,
- 0, 94, 188, 110, 0, 48, 0, 94, 221, 110,
- 0, 65, 243, 0, 94, 214, 110, 0, 192, 94,
- 214, 110, 0, 189, 0, 192, 189, 0, 192, 59,
- 244, 255, 111, 0, 193, 0, 194, 84, 194, 0,
- 194, 85, 194, 0, 194, 79, 194, 0, 194, 80,
- 194, 0, 194, 81, 194, 0, 194, 82, 194, 0,
- 194, 83, 194, 0, 194, 77, 194, 0, 194, 78,
- 194, 0, 194, 74, 194, 0, 194, 75, 194, 0,
- 194, 76, 194, 0, 194, 73, 194, 0, 194, 72,
- 194, 0, 194, 71, 194, 0, 194, 69, 194, 0,
- 194, 70, 194, 0, 194, 68, 194, 0, 194, 67,
- 194, 0, 194, 66, 363, 63, 194, 0, 194, 65,
- 194, 0, 194, 64, 194, 0, 62, 0, 62, 194,
- 0, 89, 378, 157, 0, 197, 0, 385, 0, 3,
- 0, 57, 0, 58, 0, 0, 6, 75, 196, 174,
- 173, 0, 385, 75, 196, 174, 173, 0, 49, 157,
- 75, 174, 173, 0, 49, 6, 75, 174, 173, 0,
- 49, 385, 75, 174, 173, 0, 195, 0, 4, 0,
- 5, 0, 195, 0, 81, 200, 0, 71, 200, 0,
- 94, 200, 110, 0, 3, 75, 174, 173, 0, 58,
- 75, 175, 173, 0, 299, 0, 195, 0, 201, 0,
- 94, 200, 110, 0, 195, 0, 10, 0, 207, 0,
- 208, 0, 94, 178, 110, 0, 94, 200, 110, 0,
- 94, 1, 110, 0, 0, 94, 204, 325, 110, 0,
- 203, 94, 188, 110, 0, 203, 48, 0, 203, 95,
- 178, 113, 0, 203, 87, 0, 203, 88, 0, 41,
- 0, 9, 94, 188, 110, 0, 303, 0, 51, 75,
- 214, 76, 94, 178, 110, 0, 52, 75, 214, 76,
- 94, 178, 110, 0, 53, 75, 214, 76, 94, 178,
- 110, 0, 54, 75, 214, 76, 94, 178, 110, 0,
- 50, 94, 178, 110, 0, 50, 94, 214, 110, 0,
- 314, 3, 0, 314, 385, 0, 302, 0, 302, 94,
- 188, 110, 0, 302, 48, 0, 210, 198, 0, 210,
- 198, 94, 188, 110, 0, 210, 198, 48, 0, 210,
- 199, 0, 210, 302, 0, 210, 199, 94, 188, 110,
- 0, 210, 199, 48, 0, 210, 302, 94, 188, 110,
- 0, 210, 302, 48, 0, 210, 89, 8, 48, 0,
- 210, 8, 55, 89, 8, 48, 0, 210, 1, 0,
- 40, 0, 314, 40, 0, 39, 0, 314, 206, 0,
- 43, 0, 44, 0, 11, 0, 208, 11, 0, 0,
- 203, 93, 0, 203, 92, 0, 221, 223, 61, 0,
- 215, 223, 61, 0, 218, 224, 61, 0, 215, 61,
- 0, 218, 61, 0, 120, 211, 0, 292, 0, 297,
- 0, 48, 0, 213, 48, 0, 219, 317, 0, 288,
- 317, 0, 221, 317, 0, 219, 0, 288, 0, 219,
- 0, 216, 0, 218, 221, 0, 221, 217, 0, 221,
- 220, 217, 0, 218, 221, 217, 0, 218, 221, 220,
- 0, 218, 221, 220, 217, 0, 7, 0, 217, 222,
- 0, 217, 7, 0, 217, 236, 0, 236, 0, 288,
- 0, 7, 0, 218, 9, 0, 218, 7, 0, 218,
- 236, 0, 236, 0, 221, 0, 288, 221, 0, 221,
- 220, 0, 288, 221, 220, 0, 222, 0, 220, 222,
- 0, 250, 0, 8, 0, 294, 0, 29, 94, 178,
- 110, 0, 29, 94, 214, 110, 0, 31, 94, 178,
- 110, 0, 31, 94, 214, 110, 0, 8, 0, 9,
- 0, 250, 0, 231, 0, 223, 60, 227, 0, 232,
- 0, 224, 60, 227, 0, 233, 0, 225, 60, 227,
- 0, 0, 121, 94, 208, 110, 0, 0, 212, 226,
- 235, 65, 228, 243, 0, 212, 226, 235, 0, 0,
- 235, 65, 230, 243, 0, 235, 0, 212, 226, 229,
- 0, 297, 226, 229, 0, 0, 297, 226, 234, 229,
- 0, 143, 226, 235, 0, 0, 236, 0, 237, 0,
- 236, 237, 0, 32, 94, 94, 238, 110, 110, 0,
- 239, 0, 238, 60, 239, 0, 0, 240, 0, 240,
- 94, 3, 110, 0, 240, 94, 3, 60, 188, 110,
- 0, 240, 94, 188, 110, 0, 157, 0, 7, 0,
- 8, 0, 9, 0, 157, 0, 241, 60, 157, 0,
- 0, 65, 243, 0, 194, 0, 59, 111, 0, 59,
- 244, 111, 0, 59, 244, 60, 111, 0, 1, 0,
- 243, 0, 244, 60, 243, 0, 95, 194, 113, 243,
- 0, 157, 63, 243, 0, 244, 60, 157, 63, 243,
- 0, 99, 0, 245, 140, 139, 324, 0, 245, 140,
- 348, 0, 245, 140, 1, 0, 0, 247, 246, 141,
- 0, 104, 194, 109, 0, 104, 1, 109, 0, 0,
- 249, 248, 0, 249, 1, 0, 0, 14, 157, 59,
- 251, 284, 256, 111, 0, 14, 157, 59, 111, 0,
- 0, 14, 59, 252, 284, 256, 111, 0, 14, 59,
- 111, 0, 14, 157, 0, 14, 312, 0, 46, 307,
- 0, 0, 0, 264, 270, 272, 111, 235, 253, 249,
- 254, 247, 0, 264, 0, 0, 60, 0, 0, 60,
- 0, 37, 0, 257, 7, 0, 257, 8, 0, 257,
- 9, 0, 257, 37, 0, 257, 157, 0, 257, 159,
- 0, 257, 305, 157, 0, 257, 314, 305, 157, 0,
- 257, 314, 157, 0, 257, 171, 0, 257, 305, 171,
- 0, 0, 258, 0, 259, 261, 265, 0, 260, 265,
- 0, 257, 59, 0, 263, 0, 262, 0, 0, 63,
- 378, 0, 63, 378, 266, 0, 267, 0, 266, 60,
- 378, 267, 0, 268, 0, 269, 378, 268, 0, 307,
- 0, 293, 0, 31, 94, 178, 110, 0, 31, 94,
- 214, 110, 0, 38, 378, 0, 7, 378, 0, 269,
- 38, 378, 0, 269, 7, 378, 0, 59, 0, 0,
- 271, 0, 271, 273, 0, 272, 38, 63, 273, 0,
- 272, 38, 63, 0, 274, 0, 273, 274, 0, 275,
- 61, 0, 275, 111, 0, 150, 63, 0, 150, 96,
- 0, 150, 25, 0, 150, 59, 0, 61, 0, 120,
- 274, 0, 130, 274, 0, 130, 215, 61, 0, 215,
- 276, 0, 218, 277, 0, 297, 226, 235, 242, 0,
- 143, 226, 235, 242, 0, 63, 194, 0, 1, 0,
- 218, 149, 226, 235, 242, 0, 149, 226, 235, 242,
- 0, 127, 0, 0, 278, 0, 276, 60, 279, 0,
- 0, 281, 0, 277, 60, 283, 0, 280, 0, 281,
- 0, 282, 0, 283, 0, 292, 226, 235, 242, 0,
- 4, 63, 194, 235, 0, 297, 226, 235, 242, 0,
- 143, 226, 235, 242, 0, 3, 63, 194, 235, 0,
- 63, 194, 235, 0, 292, 226, 235, 242, 0, 4,
- 63, 194, 235, 0, 297, 226, 235, 242, 0, 3,
- 63, 194, 235, 0, 63, 194, 235, 0, 285, 0,
- 284, 60, 285, 0, 157, 0, 157, 65, 194, 0,
- 358, 315, 0, 358, 0, 94, 214, 110, 95, 178,
- 113, 0, 0, 287, 9, 0, 9, 0, 288, 9,
- 0, 0, 289, 178, 0, 289, 94, 188, 110, 0,
- 289, 94, 368, 110, 0, 289, 48, 0, 289, 94,
- 1, 110, 0, 81, 288, 292, 0, 71, 288, 292,
- 0, 81, 292, 0, 71, 292, 0, 313, 287, 292,
- 0, 296, 0, 304, 0, 314, 304, 0, 293, 0,
- 295, 0, 314, 295, 0, 305, 304, 0, 296, 291,
- 287, 380, 0, 296, 95, 290, 113, 0, 296, 95,
- 113, 0, 94, 292, 110, 0, 305, 304, 0, 304,
- 0, 81, 288, 297, 0, 71, 288, 297, 0, 81,
- 297, 0, 71, 297, 0, 313, 287, 297, 0, 202,
- 0, 81, 288, 297, 0, 71, 288, 297, 0, 81,
- 298, 0, 71, 298, 0, 313, 287, 297, 0, 299,
- 0, 202, 291, 287, 380, 0, 94, 298, 110, 0,
- 202, 95, 290, 113, 0, 202, 95, 113, 0, 301,
- 0, 305, 201, 0, 305, 199, 0, 305, 198, 0,
- 305, 195, 0, 305, 198, 0, 301, 0, 314, 301,
- 0, 221, 94, 188, 110, 0, 221, 94, 200, 110,
- 0, 221, 213, 0, 4, 0, 5, 0, 171, 0,
- 306, 0, 305, 306, 0, 305, 49, 311, 55, 0,
- 4, 55, 0, 5, 55, 0, 58, 55, 0, 171,
- 55, 0, 308, 0, 314, 308, 0, 309, 157, 0,
- 309, 171, 0, 309, 311, 0, 309, 49, 311, 0,
- 310, 0, 309, 310, 0, 309, 311, 55, 0, 309,
- 49, 311, 55, 0, 4, 55, 0, 5, 55, 0,
- 171, 55, 0, 57, 55, 0, 3, 55, 0, 58,
- 55, 0, 157, 75, 174, 173, 0, 314, 304, 0,
- 295, 0, 314, 295, 0, 305, 81, 0, 314, 305,
- 81, 0, 55, 0, 81, 287, 315, 0, 81, 287,
- 0, 71, 287, 315, 0, 71, 287, 0, 313, 287,
- 0, 313, 287, 315, 0, 316, 0, 95, 178, 113,
- 0, 316, 95, 290, 113, 0, 81, 288, 317, 0,
- 81, 317, 0, 81, 288, 0, 81, 0, 71, 288,
- 317, 0, 71, 317, 0, 71, 288, 0, 71, 0,
- 313, 287, 0, 313, 287, 317, 0, 318, 0, 94,
- 317, 110, 0, 91, 0, 318, 94, 368, 110, 287,
- 380, 0, 318, 48, 287, 380, 0, 318, 95, 290,
- 113, 0, 318, 95, 113, 0, 94, 369, 110, 287,
- 380, 0, 192, 287, 380, 0, 213, 287, 380, 0,
- 95, 290, 113, 0, 95, 113, 0, 332, 0, 320,
- 0, 319, 332, 0, 319, 320, 0, 1, 61, 0,
- 0, 322, 0, 323, 0, 322, 323, 0, 34, 241,
- 61, 0, 325, 0, 1, 325, 0, 0, 59, 326,
- 184, 0, 0, 0, 15, 328, 180, 329, 330, 0,
- 325, 0, 0, 331, 333, 0, 325, 0, 333, 0,
- 211, 0, 178, 61, 0, 0, 327, 16, 334, 330,
- 0, 327, 0, 0, 0, 17, 335, 180, 336, 185,
- 0, 0, 0, 18, 337, 330, 17, 338, 179, 61,
- 0, 0, 0, 0, 0, 19, 339, 94, 361, 340,
- 181, 61, 341, 363, 110, 342, 185, 0, 0, 0,
- 20, 343, 94, 182, 110, 344, 330, 0, 0, 21,
- 194, 63, 345, 332, 0, 0, 21, 194, 12, 194,
- 63, 346, 332, 0, 0, 22, 63, 347, 332, 0,
- 23, 61, 0, 24, 61, 0, 25, 61, 0, 25,
- 178, 61, 0, 121, 362, 94, 208, 110, 61, 0,
- 121, 362, 94, 208, 63, 364, 110, 61, 0, 121,
- 362, 94, 208, 63, 364, 63, 364, 110, 61, 0,
- 121, 362, 94, 208, 63, 364, 63, 364, 63, 367,
- 110, 61, 0, 26, 81, 178, 61, 0, 26, 157,
- 61, 0, 360, 332, 0, 360, 111, 0, 61, 0,
- 351, 0, 0, 0, 96, 349, 139, 325, 350, 354,
- 0, 0, 0, 96, 352, 325, 353, 354, 0, 355,
- 0, 354, 355, 0, 0, 0, 97, 356, 359, 357,
- 325, 0, 219, 0, 288, 0, 94, 12, 110, 0,
- 94, 377, 110, 0, 3, 63, 0, 57, 63, 0,
- 4, 63, 0, 5, 63, 0, 363, 61, 0, 211,
- 0, 59, 184, 0, 0, 9, 0, 0, 178, 0,
- 1, 0, 0, 365, 0, 366, 0, 365, 60, 366,
- 0, 11, 94, 178, 110, 0, 11, 0, 367, 60,
- 11, 0, 0, 369, 0, 214, 0, 373, 0, 374,
- 12, 0, 373, 12, 0, 214, 12, 0, 12, 0,
- 98, 0, 373, 98, 0, 214, 98, 0, 373, 63,
- 0, 214, 63, 0, 0, 65, 371, 372, 0, 103,
- 0, 243, 0, 375, 0, 377, 370, 0, 374, 376,
- 0, 374, 379, 0, 374, 379, 65, 243, 0, 373,
- 60, 0, 214, 60, 0, 216, 212, 0, 219, 212,
- 0, 221, 212, 0, 216, 317, 0, 216, 0, 218,
- 297, 0, 377, 0, 377, 370, 0, 375, 0, 214,
- 0, 0, 0, 297, 0, 0, 62, 94, 382, 110,
- 0, 62, 48, 0, 214, 0, 381, 0, 382, 60,
- 381, 0, 0, 81, 287, 383, 0, 71, 287, 383,
- 0, 313, 287, 383, 0, 42, 0, 384, 81, 0,
- 384, 82, 0, 384, 83, 0, 384, 79, 0, 384,
- 80, 0, 384, 71, 0, 384, 69, 0, 384, 70,
- 0, 384, 89, 0, 384, 60, 0, 384, 74, 0,
- 384, 75, 0, 384, 76, 0, 384, 73, 0, 384,
- 64, 0, 384, 65, 0, 384, 77, 0, 384, 78,
- 0, 384, 87, 0, 384, 88, 0, 384, 68, 0,
- 384, 67, 0, 384, 112, 0, 384, 66, 63, 0,
- 384, 72, 0, 384, 92, 0, 384, 84, 0, 384,
- 48, 0, 384, 95, 113, 0, 384, 40, 0, 384,
- 39, 0, 384, 40, 95, 113, 0, 384, 39, 95,
- 113, 0, 384, 358, 383, 0, 384, 1, 0
+ 113, 0, 0, 114, 120, 0, 113, 120, 0, 113,
+ 0, 0, 0, 0, 32, 0, 27, 0, 0, 121,
+ 122, 0, 148, 147, 0, 144, 0, 141, 0, 119,
+ 93, 217, 108, 60, 0, 133, 58, 115, 109, 0,
+ 133, 116, 148, 117, 147, 0, 133, 116, 144, 117,
+ 0, 0, 44, 163, 58, 123, 115, 109, 0, 0,
+ 44, 58, 124, 115, 109, 0, 125, 0, 127, 60,
+ 0, 129, 0, 118, 122, 0, 0, 44, 163, 64,
+ 126, 132, 60, 0, 46, 310, 0, 46, 324, 310,
+ 0, 46, 324, 208, 0, 46, 131, 163, 0, 46,
+ 324, 163, 0, 46, 324, 131, 163, 0, 0, 46,
+ 44, 130, 132, 60, 0, 57, 54, 0, 131, 57,
+ 54, 0, 208, 0, 310, 0, 324, 310, 0, 324,
+ 208, 0, 98, 0, 133, 98, 0, 0, 48, 74,
+ 135, 136, 75, 0, 48, 74, 75, 0, 140, 0,
+ 136, 59, 140, 0, 163, 0, 0, 266, 137, 0,
+ 45, 137, 0, 134, 266, 137, 0, 138, 0, 138,
+ 64, 223, 0, 387, 0, 387, 64, 203, 0, 139,
+ 0, 139, 64, 183, 0, 134, 142, 0, 134, 1,
+ 0, 148, 147, 0, 143, 0, 141, 0, 133, 116,
+ 148, 117, 147, 0, 133, 116, 143, 117, 0, 118,
+ 142, 0, 234, 60, 0, 227, 233, 60, 0, 224,
+ 232, 60, 0, 259, 60, 0, 234, 60, 0, 227,
+ 233, 60, 0, 224, 232, 60, 0, 227, 60, 0,
+ 166, 60, 0, 224, 60, 0, 1, 60, 0, 1,
+ 109, 0, 60, 0, 218, 0, 159, 0, 0, 158,
+ 0, 158, 60, 0, 0, 107, 0, 154, 146, 145,
+ 334, 0, 154, 146, 358, 0, 154, 146, 1, 0,
+ 0, 315, 5, 93, 150, 378, 108, 297, 390, 0,
+ 315, 5, 47, 297, 390, 0, 0, 324, 315, 5,
+ 93, 151, 378, 108, 297, 390, 0, 324, 315, 5,
+ 47, 297, 390, 0, 0, 315, 178, 93, 152, 378,
+ 108, 297, 390, 0, 315, 178, 47, 297, 390, 0,
+ 0, 324, 315, 178, 93, 153, 378, 108, 297, 390,
+ 0, 324, 315, 178, 47, 297, 390, 0, 224, 221,
+ 0, 227, 307, 0, 307, 0, 227, 149, 0, 149,
+ 0, 5, 93, 378, 108, 297, 390, 0, 5, 47,
+ 297, 390, 0, 178, 93, 378, 108, 297, 390, 0,
+ 178, 47, 297, 390, 0, 227, 155, 0, 155, 0,
+ 224, 221, 0, 227, 307, 0, 307, 0, 227, 149,
+ 0, 149, 0, 25, 3, 0, 157, 251, 0, 157,
+ 93, 195, 108, 0, 157, 47, 0, 62, 160, 161,
+ 0, 0, 0, 162, 0, 161, 59, 162, 0, 161,
+ 1, 0, 93, 195, 108, 0, 47, 0, 164, 93,
+ 195, 108, 0, 164, 47, 0, 303, 93, 195, 108,
+ 0, 303, 47, 0, 317, 93, 195, 108, 0, 317,
+ 47, 0, 3, 0, 4, 0, 5, 0, 56, 0,
+ 57, 0, 3, 0, 56, 0, 57, 0, 104, 0,
+ 103, 0, 105, 0, 0, 48, 175, 230, 60, 167,
+ 176, 0, 0, 48, 175, 224, 221, 168, 176, 0,
+ 0, 48, 175, 307, 169, 176, 0, 0, 48, 175,
+ 149, 170, 176, 0, 0, 7, 48, 175, 230, 60,
+ 171, 176, 0, 0, 7, 48, 175, 224, 221, 172,
+ 176, 0, 0, 7, 48, 175, 307, 173, 176, 0,
+ 0, 7, 48, 175, 149, 174, 176, 0, 0, 0,
+ 56, 74, 181, 180, 179, 0, 4, 74, 181, 180,
+ 179, 0, 178, 0, 5, 74, 181, 180, 179, 0,
+ 0, 75, 0, 77, 0, 0, 182, 0, 183, 0,
+ 182, 59, 183, 0, 223, 0, 56, 0, 203, 0,
+ 79, 0, 78, 0, 86, 0, 87, 0, 110, 0,
+ 194, 0, 203, 0, 47, 0, 93, 185, 108, 0,
+ 47, 0, 93, 189, 108, 0, 0, 189, 0, 1,
+ 0, 0, 368, 221, 235, 244, 64, 190, 252, 0,
+ 185, 0, 109, 0, 331, 329, 109, 0, 331, 329,
+ 1, 109, 0, 331, 1, 109, 0, 0, 58, 193,
+ 191, 0, 343, 0, 203, 59, 203, 0, 203, 59,
+ 1, 0, 194, 59, 203, 0, 194, 59, 1, 0,
+ 203, 0, 194, 0, 212, 0, 118, 202, 0, 80,
+ 202, 0, 70, 202, 0, 88, 202, 0, 184, 202,
+ 0, 67, 163, 0, 13, 196, 0, 13, 93, 223,
+ 108, 0, 29, 196, 0, 29, 93, 223, 108, 0,
+ 214, 296, 0, 214, 296, 200, 0, 214, 199, 296,
+ 0, 214, 199, 296, 200, 0, 214, 93, 198, 223,
+ 197, 0, 214, 93, 198, 223, 197, 200, 0, 214,
+ 199, 93, 198, 223, 197, 0, 214, 199, 93, 198,
+ 223, 197, 200, 0, 215, 202, 0, 215, 94, 111,
+ 202, 0, 215, 94, 185, 111, 202, 0, 34, 202,
+ 0, 35, 202, 0, 108, 0, 0, 93, 198, 195,
+ 108, 0, 58, 198, 195, 109, 0, 93, 195, 108,
+ 0, 47, 0, 93, 230, 108, 0, 64, 252, 0,
+ 93, 223, 108, 0, 201, 93, 223, 108, 0, 196,
+ 0, 201, 196, 0, 201, 58, 253, 264, 109, 0,
+ 202, 0, 203, 83, 203, 0, 203, 84, 203, 0,
+ 203, 78, 203, 0, 203, 79, 203, 0, 203, 80,
+ 203, 0, 203, 81, 203, 0, 203, 82, 203, 0,
+ 203, 76, 203, 0, 203, 77, 203, 0, 203, 73,
+ 203, 0, 203, 74, 203, 0, 203, 75, 203, 0,
+ 203, 72, 203, 0, 203, 71, 203, 0, 203, 70,
+ 203, 0, 203, 68, 203, 0, 203, 69, 203, 0,
+ 203, 67, 203, 0, 203, 66, 203, 0, 203, 65,
+ 373, 62, 203, 0, 203, 64, 203, 0, 203, 63,
+ 203, 0, 61, 0, 61, 203, 0, 88, 388, 163,
+ 0, 88, 388, 177, 0, 206, 0, 395, 0, 3,
+ 0, 56, 0, 57, 0, 0, 6, 74, 205, 181,
+ 180, 0, 395, 74, 205, 181, 180, 0, 48, 163,
+ 74, 181, 180, 0, 48, 6, 74, 181, 180, 0,
+ 48, 395, 74, 181, 180, 0, 204, 0, 4, 0,
+ 5, 0, 204, 0, 80, 209, 0, 70, 209, 0,
+ 93, 209, 108, 0, 3, 74, 181, 180, 0, 57,
+ 74, 182, 180, 0, 309, 0, 204, 0, 210, 0,
+ 93, 209, 108, 0, 204, 0, 10, 0, 216, 0,
+ 217, 0, 93, 185, 108, 0, 93, 209, 108, 0,
+ 93, 1, 108, 0, 0, 93, 213, 335, 108, 0,
+ 204, 93, 195, 108, 0, 204, 47, 0, 212, 93,
+ 195, 108, 0, 212, 47, 0, 212, 94, 185, 111,
+ 0, 212, 86, 0, 212, 87, 0, 40, 0, 9,
+ 93, 195, 108, 0, 313, 0, 50, 74, 223, 75,
+ 93, 185, 108, 0, 51, 74, 223, 75, 93, 185,
+ 108, 0, 52, 74, 223, 75, 93, 185, 108, 0,
+ 53, 74, 223, 75, 93, 185, 108, 0, 49, 93,
+ 185, 108, 0, 49, 93, 223, 108, 0, 324, 3,
+ 0, 324, 206, 0, 324, 395, 0, 312, 0, 312,
+ 93, 195, 108, 0, 312, 47, 0, 219, 207, 0,
+ 219, 207, 93, 195, 108, 0, 219, 207, 47, 0,
+ 219, 208, 0, 219, 312, 0, 219, 208, 93, 195,
+ 108, 0, 219, 208, 47, 0, 219, 312, 93, 195,
+ 108, 0, 219, 312, 47, 0, 219, 88, 8, 47,
+ 0, 219, 8, 54, 88, 8, 47, 0, 219, 1,
+ 0, 39, 0, 324, 39, 0, 38, 0, 324, 215,
+ 0, 42, 0, 43, 0, 11, 0, 217, 11, 0,
+ 0, 212, 92, 0, 212, 91, 0, 230, 232, 60,
+ 0, 224, 232, 60, 0, 227, 233, 60, 0, 224,
+ 60, 0, 227, 60, 0, 118, 220, 0, 302, 0,
+ 307, 0, 47, 0, 222, 47, 0, 228, 327, 0,
+ 298, 327, 0, 230, 327, 0, 228, 0, 298, 0,
+ 228, 0, 225, 0, 227, 230, 0, 230, 226, 0,
+ 230, 229, 226, 0, 227, 230, 226, 0, 227, 230,
+ 229, 0, 227, 230, 229, 226, 0, 7, 0, 226,
+ 231, 0, 226, 7, 0, 226, 245, 0, 245, 0,
+ 298, 0, 7, 0, 227, 9, 0, 227, 7, 0,
+ 227, 245, 0, 245, 0, 230, 0, 298, 230, 0,
+ 230, 229, 0, 298, 230, 229, 0, 231, 0, 229,
+ 231, 0, 259, 0, 8, 0, 304, 0, 28, 93,
+ 185, 108, 0, 28, 93, 223, 108, 0, 30, 93,
+ 185, 108, 0, 30, 93, 223, 108, 0, 8, 0,
+ 9, 0, 259, 0, 240, 0, 232, 59, 236, 0,
+ 241, 0, 233, 59, 236, 0, 242, 0, 234, 59,
+ 236, 0, 0, 119, 93, 217, 108, 0, 0, 221,
+ 235, 244, 64, 237, 252, 0, 221, 235, 244, 0,
+ 0, 244, 64, 239, 252, 0, 244, 0, 221, 235,
+ 238, 0, 307, 235, 238, 0, 0, 307, 235, 243,
+ 238, 0, 149, 235, 244, 0, 0, 245, 0, 246,
+ 0, 245, 246, 0, 31, 93, 93, 247, 108, 108,
+ 0, 248, 0, 247, 59, 248, 0, 0, 249, 0,
+ 249, 93, 3, 108, 0, 249, 93, 3, 59, 195,
+ 108, 0, 249, 93, 195, 108, 0, 163, 0, 7,
+ 0, 8, 0, 9, 0, 163, 0, 250, 59, 163,
+ 0, 0, 64, 252, 0, 203, 0, 58, 109, 0,
+ 58, 253, 109, 0, 58, 253, 59, 109, 0, 1,
+ 0, 252, 0, 253, 59, 252, 0, 94, 203, 111,
+ 252, 0, 163, 62, 252, 0, 253, 59, 163, 62,
+ 252, 0, 97, 0, 254, 146, 145, 334, 0, 254,
+ 146, 358, 0, 254, 146, 1, 0, 0, 256, 255,
+ 147, 0, 102, 203, 107, 0, 102, 1, 107, 0,
+ 0, 258, 257, 0, 258, 1, 0, 0, 14, 163,
+ 58, 260, 294, 265, 109, 0, 14, 163, 58, 109,
+ 0, 0, 14, 58, 261, 294, 265, 109, 0, 14,
+ 58, 109, 0, 14, 163, 0, 14, 322, 0, 45,
+ 317, 0, 0, 0, 273, 279, 281, 109, 244, 262,
+ 258, 263, 256, 0, 273, 0, 0, 59, 0, 0,
+ 59, 0, 36, 0, 266, 7, 0, 266, 8, 0,
+ 266, 9, 0, 266, 36, 0, 266, 245, 0, 266,
+ 163, 0, 266, 165, 0, 267, 58, 0, 267, 62,
+ 0, 266, 315, 163, 0, 266, 324, 315, 163, 0,
+ 266, 324, 163, 0, 266, 177, 0, 266, 315, 177,
+ 0, 267, 0, 0, 268, 271, 274, 0, 269, 274,
+ 0, 266, 58, 0, 272, 0, 270, 0, 0, 62,
+ 388, 0, 62, 388, 275, 0, 276, 0, 275, 59,
+ 388, 276, 0, 277, 0, 278, 388, 277, 0, 317,
+ 0, 303, 0, 30, 93, 185, 108, 0, 30, 93,
+ 223, 108, 0, 37, 388, 0, 7, 388, 0, 278,
+ 37, 388, 0, 278, 7, 388, 0, 58, 0, 0,
+ 280, 0, 280, 283, 0, 281, 282, 283, 0, 281,
+ 282, 0, 37, 62, 0, 284, 0, 283, 284, 0,
+ 285, 60, 0, 285, 109, 0, 156, 62, 0, 156,
+ 95, 0, 156, 25, 0, 156, 58, 0, 60, 0,
+ 118, 284, 0, 134, 284, 0, 134, 224, 60, 0,
+ 224, 286, 0, 227, 287, 0, 307, 235, 244, 251,
+ 0, 149, 235, 244, 251, 0, 62, 203, 0, 1,
+ 0, 227, 155, 235, 244, 251, 0, 155, 235, 244,
+ 251, 0, 127, 0, 0, 288, 0, 286, 59, 289,
+ 0, 0, 291, 0, 287, 59, 293, 0, 290, 0,
+ 291, 0, 292, 0, 293, 0, 302, 235, 244, 251,
+ 0, 4, 62, 203, 244, 0, 307, 235, 244, 251,
+ 0, 149, 235, 244, 251, 0, 3, 62, 203, 244,
+ 0, 62, 203, 244, 0, 302, 235, 244, 251, 0,
+ 4, 62, 203, 244, 0, 307, 235, 244, 251, 0,
+ 3, 62, 203, 244, 0, 62, 203, 244, 0, 295,
+ 0, 294, 59, 295, 0, 163, 0, 163, 64, 203,
+ 0, 368, 325, 0, 368, 0, 93, 198, 223, 197,
+ 94, 185, 111, 0, 0, 297, 9, 0, 9, 0,
+ 298, 9, 0, 0, 299, 185, 0, 299, 93, 195,
+ 108, 0, 299, 93, 378, 108, 0, 299, 47, 0,
+ 299, 93, 1, 108, 0, 80, 298, 302, 0, 70,
+ 298, 302, 0, 80, 302, 0, 70, 302, 0, 323,
+ 297, 302, 0, 306, 0, 314, 0, 324, 314, 0,
+ 303, 0, 305, 0, 324, 305, 0, 315, 314, 0,
+ 306, 301, 297, 390, 0, 306, 94, 300, 111, 0,
+ 306, 94, 111, 0, 93, 302, 108, 0, 315, 314,
+ 0, 314, 0, 80, 298, 307, 0, 70, 298, 307,
+ 0, 80, 307, 0, 70, 307, 0, 323, 297, 307,
+ 0, 211, 0, 80, 298, 307, 0, 70, 298, 307,
+ 0, 80, 308, 0, 70, 308, 0, 323, 297, 307,
+ 0, 309, 0, 211, 301, 297, 390, 0, 93, 308,
+ 108, 0, 211, 94, 300, 111, 0, 211, 94, 111,
+ 0, 311, 0, 315, 210, 0, 315, 208, 0, 315,
+ 207, 0, 315, 204, 0, 315, 207, 0, 311, 0,
+ 324, 311, 0, 230, 93, 195, 108, 0, 230, 93,
+ 209, 108, 0, 230, 222, 0, 4, 0, 5, 0,
+ 177, 0, 316, 0, 315, 316, 0, 315, 48, 321,
+ 54, 0, 4, 54, 0, 5, 54, 0, 57, 54,
+ 0, 177, 54, 0, 318, 0, 324, 318, 0, 319,
+ 163, 0, 319, 177, 0, 319, 321, 0, 319, 48,
+ 321, 0, 320, 0, 319, 320, 0, 319, 321, 54,
+ 0, 319, 48, 321, 54, 0, 4, 54, 0, 5,
+ 54, 0, 177, 54, 0, 56, 54, 0, 3, 54,
+ 0, 57, 54, 0, 163, 74, 181, 180, 0, 324,
+ 314, 0, 305, 0, 324, 305, 0, 315, 80, 0,
+ 324, 315, 80, 0, 54, 0, 80, 297, 325, 0,
+ 80, 297, 0, 70, 297, 325, 0, 70, 297, 0,
+ 323, 297, 0, 323, 297, 325, 0, 326, 0, 94,
+ 185, 111, 0, 326, 94, 300, 111, 0, 80, 298,
+ 327, 0, 80, 327, 0, 80, 298, 0, 80, 0,
+ 70, 298, 327, 0, 70, 327, 0, 70, 298, 0,
+ 70, 0, 323, 297, 0, 323, 297, 327, 0, 328,
+ 0, 93, 327, 108, 0, 90, 0, 328, 93, 378,
+ 108, 297, 390, 0, 328, 47, 297, 390, 0, 328,
+ 94, 300, 111, 0, 328, 94, 111, 0, 93, 379,
+ 108, 297, 390, 0, 201, 297, 390, 0, 222, 297,
+ 390, 0, 94, 300, 111, 0, 94, 111, 0, 342,
+ 0, 330, 0, 329, 342, 0, 329, 330, 0, 1,
+ 60, 0, 0, 332, 0, 333, 0, 332, 333, 0,
+ 33, 250, 60, 0, 335, 0, 1, 335, 0, 0,
+ 58, 336, 191, 0, 0, 0, 15, 338, 187, 339,
+ 340, 0, 335, 0, 0, 341, 343, 0, 335, 0,
+ 343, 0, 220, 0, 185, 60, 0, 0, 337, 16,
+ 344, 340, 0, 337, 0, 0, 0, 17, 345, 187,
+ 346, 192, 0, 0, 0, 18, 347, 340, 17, 348,
+ 186, 60, 0, 0, 0, 0, 0, 19, 349, 93,
+ 371, 350, 188, 60, 351, 373, 108, 352, 192, 0,
+ 0, 0, 20, 353, 93, 189, 108, 354, 340, 0,
+ 0, 21, 203, 62, 355, 342, 0, 0, 21, 203,
+ 12, 203, 62, 356, 342, 0, 0, 22, 62, 357,
+ 342, 0, 23, 60, 0, 24, 60, 0, 25, 60,
+ 0, 25, 185, 60, 0, 119, 372, 93, 217, 108,
+ 60, 0, 119, 372, 93, 217, 62, 374, 108, 60,
+ 0, 119, 372, 93, 217, 62, 374, 62, 374, 108,
+ 60, 0, 119, 372, 93, 217, 62, 374, 62, 374,
+ 62, 377, 108, 60, 0, 26, 80, 185, 60, 0,
+ 26, 163, 60, 0, 370, 342, 0, 370, 109, 0,
+ 60, 0, 361, 0, 129, 0, 128, 0, 125, 0,
+ 0, 0, 95, 359, 145, 335, 360, 364, 0, 0,
+ 0, 95, 362, 335, 363, 364, 0, 365, 0, 364,
+ 365, 0, 0, 0, 96, 366, 369, 367, 335, 0,
+ 228, 0, 298, 0, 93, 12, 108, 0, 93, 387,
+ 108, 0, 3, 62, 0, 56, 62, 0, 4, 62,
+ 0, 5, 62, 0, 373, 60, 0, 220, 0, 58,
+ 191, 0, 0, 9, 0, 0, 185, 0, 1, 0,
+ 0, 375, 0, 376, 0, 375, 59, 376, 0, 11,
+ 93, 185, 108, 0, 11, 0, 377, 59, 11, 0,
+ 0, 379, 0, 223, 0, 383, 0, 384, 12, 0,
+ 383, 12, 0, 223, 12, 0, 12, 0, 383, 62,
+ 0, 223, 62, 0, 0, 64, 381, 382, 0, 101,
+ 0, 252, 0, 385, 0, 387, 380, 0, 384, 386,
+ 0, 384, 389, 0, 384, 389, 64, 252, 0, 383,
+ 59, 0, 223, 59, 0, 225, 221, 0, 228, 221,
+ 0, 230, 221, 0, 225, 327, 0, 225, 0, 227,
+ 307, 0, 387, 0, 387, 380, 0, 385, 0, 223,
+ 0, 0, 0, 307, 0, 0, 61, 93, 392, 108,
+ 0, 61, 47, 0, 223, 0, 391, 0, 392, 59,
+ 391, 0, 0, 80, 297, 393, 0, 70, 297, 393,
+ 0, 323, 297, 393, 0, 41, 0, 394, 80, 0,
+ 394, 81, 0, 394, 82, 0, 394, 78, 0, 394,
+ 79, 0, 394, 70, 0, 394, 68, 0, 394, 69,
+ 0, 394, 88, 0, 394, 59, 0, 394, 73, 0,
+ 394, 74, 0, 394, 75, 0, 394, 72, 0, 394,
+ 63, 0, 394, 64, 0, 394, 76, 0, 394, 77,
+ 0, 394, 86, 0, 394, 87, 0, 394, 67, 0,
+ 394, 66, 0, 394, 110, 0, 394, 65, 62, 0,
+ 394, 71, 0, 394, 91, 0, 394, 83, 0, 394,
+ 47, 0, 394, 94, 111, 0, 394, 39, 0, 394,
+ 38, 0, 394, 39, 94, 111, 0, 394, 38, 94,
+ 111, 0, 394, 368, 393, 0, 394, 1, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 328, 330, 344, 347, 348, 352, 354, 357, 362, 366,
- 372, 374, 377, 380, 384, 387, 389, 391, 394, 396,
- 399, 402, 404, 406, 408, 410, 412, 414, 420, 424,
- 427, 429, 433, 435, 436, 438, 442, 445, 451, 454,
- 456, 461, 464, 468, 471, 474, 477, 481, 486, 496,
- 498, 500, 502, 504, 517, 526, 536, 538, 540, 544,
- 546, 547, 554, 555, 556, 559, 562, 566, 568, 569,
- 572, 574, 577, 580, 582, 586, 589, 591, 595, 597,
- 599, 603, 605, 607, 611, 613, 615, 621, 625, 628,
- 631, 634, 639, 642, 644, 646, 652, 662, 664, 667,
- 670, 672, 675, 679, 688, 691, 693, 697, 710, 730,
- 733, 735, 736, 739, 746, 752, 754, 756, 758, 760,
- 763, 768, 770, 771, 772, 773, 776, 778, 779, 782,
- 784, 785, 788, 793, 793, 797, 797, 800, 800, 803,
- 803, 807, 807, 812, 812, 815, 815, 818, 820, 823,
- 830, 837, 843, 846, 855, 857, 865, 868, 871, 874,
- 878, 881, 884, 887, 889, 891, 893, 897, 900, 903,
- 908, 912, 917, 921, 924, 926, 930, 949, 956, 959,
- 961, 962, 963, 966, 970, 971, 975, 979, 982, 984,
- 988, 991, 994, 998, 1001, 1003, 1005, 1007, 1014, 1018,
- 1020, 1022, 1024, 1030, 1033, 1036, 1039, 1042, 1046, 1049,
- 1052, 1056, 1058, 1062, 1066, 1068, 1072, 1075, 1082, 1085,
- 1087, 1095, 1108, 1114, 1121, 1123, 1125, 1138, 1141, 1143,
- 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1159, 1161, 1163,
- 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1185,
- 1187, 1189, 1206, 1209, 1210, 1211, 1212, 1213, 1216, 1219,
- 1222, 1226, 1229, 1231, 1236, 1238, 1239, 1242, 1244, 1246,
- 1248, 1252, 1255, 1259, 1261, 1262, 1263, 1267, 1275, 1276,
- 1277, 1285, 1287, 1290, 1292, 1302, 1304, 1306, 1308, 1310,
- 1312, 1315, 1317, 1361, 1362, 1366, 1370, 1374, 1378, 1380,
- 1384, 1386, 1394, 1396, 1398, 1400, 1404, 1406, 1408, 1410,
- 1415, 1417, 1419, 1421, 1424, 1426, 1428, 1472, 1475, 1479,
- 1482, 1486, 1489, 1494, 1496, 1500, 1513, 1516, 1523, 1530,
- 1535, 1537, 1542, 1544, 1551, 1553, 1557, 1561, 1567, 1571,
- 1574, 1577, 1580, 1590, 1592, 1595, 1599, 1602, 1605, 1608,
- 1611, 1617, 1623, 1625, 1630, 1632, 1641, 1644, 1646, 1649,
- 1655, 1657, 1667, 1671, 1674, 1677, 1682, 1685, 1693, 1695,
- 1697, 1699, 1702, 1705, 1720, 1739, 1742, 1744, 1747, 1749,
- 1752, 1754, 1757, 1759, 1762, 1765, 1769, 1775, 1776, 1788,
- 1795, 1798, 1804, 1808, 1813, 1819, 1820, 1828, 1831, 1835,
- 1838, 1842, 1847, 1850, 1854, 1857, 1859, 1861, 1863, 1870,
- 1872, 1873, 1874, 1878, 1881, 1885, 1888, 1894, 1896, 1899,
- 1902, 1905, 1911, 1914, 1917, 1919, 1921, 1925, 1931, 1939,
- 1941, 1945, 1947, 1952, 1955, 1958, 1960, 1962, 1966, 1970,
- 1975, 1979, 1982, 1987, 1991, 1994, 1997, 2001, 2036, 2042,
- 2051, 2071, 2073, 2076, 2078, 2083, 2085, 2087, 2089, 2091,
- 2095, 2100, 2105, 2111, 2116, 2121, 2123, 2127, 2132, 2135,
- 2142, 2170, 2176, 2178, 2181, 2184, 2186, 2190, 2192, 2196,
- 2222, 2251, 2254, 2255, 2276, 2299, 2301, 2305, 2316, 2330,
- 2419, 2426, 2429, 2437, 2448, 2457, 2461, 2476, 2479, 2484,
- 2486, 2488, 2490, 2492, 2494, 2497, 2499, 2511, 2517, 2519,
- 2522, 2525, 2527, 2538, 2543, 2546, 2551, 2554, 2555, 2566,
- 2569, 2570, 2581, 2583, 2586, 2588, 2591, 2598, 2606, 2613,
- 2619, 2625, 2633, 2637, 2642, 2646, 2649, 2658, 2660, 2664,
- 2667, 2672, 2676, 2681, 2691, 2694, 2698, 2702, 2710, 2715,
- 2721, 2724, 2726, 2728, 2734, 2737, 2739, 2741, 2743, 2747,
- 2750, 2768, 2778, 2780, 2781, 2785, 2790, 2793, 2795, 2797,
- 2799, 2803, 2809, 2812, 2814, 2816, 2818, 2822, 2825, 2828,
- 2830, 2832, 2834, 2838, 2841, 2844, 2846, 2848, 2850, 2857,
- 2868, 2872, 2877, 2881, 2886, 2888, 2892, 2895, 2897, 2901,
- 2903, 2904, 2907, 2909, 2911, 2917, 2932, 2938, 2944, 2958,
- 2960, 2964, 2978, 2980, 2982, 2986, 2992, 3005, 3007, 3011,
- 3022, 3028, 3030, 3031, 3032, 3040, 3045, 3054, 3055, 3059,
- 3062, 3068, 3074, 3077, 3079, 3081, 3083, 3087, 3091, 3095,
- 3098, 3103, 3106, 3108, 3110, 3112, 3114, 3116, 3118, 3120,
- 3124, 3128, 3132, 3136, 3137, 3139, 3141, 3143, 3145, 3147,
- 3149, 3151, 3153, 3161, 3163, 3164, 3165, 3168, 3174, 3176,
- 3181, 3183, 3186, 3200, 3203, 3206, 3210, 3213, 3220, 3222,
- 3225, 3227, 3229, 3232, 3235, 3238, 3241, 3243, 3246, 3250,
- 3252, 3258, 3260, 3261, 3263, 3268, 3270, 3272, 3274, 3276,
- 3279, 3280, 3282, 3285, 3286, 3289, 3289, 3292, 3292, 3295,
- 3295, 3297, 3299, 3301, 3303, 3309, 3315, 3318, 3321, 3327,
- 3329, 3331, 3335, 3337, 3340, 3347, 3350, 3358, 3362, 3364,
- 3367, 3369, 3372, 3376, 3378, 3381, 3383, 3386, 3403, 3409,
- 3417, 3419, 3421, 3425, 3428, 3429, 3437, 3441, 3445, 3448,
- 3449, 3455, 3458, 3461, 3463, 3467, 3472, 3475, 3485, 3490,
- 3491, 3499, 3505, 3510, 3514, 3519, 3523, 3527, 3531, 3536,
- 3547, 3561, 3565, 3568, 3570, 3574, 3578, 3581, 3584, 3586,
- 3590, 3592, 3599, 3606, 3609, 3612, 3616, 3620, 3626, 3630,
- 3635, 3637, 3640, 3645, 3651, 3662, 3665, 3667, 3671, 3676,
- 3678, 3685, 3688, 3690, 3692, 3698, 3703, 3706, 3708, 3710,
- 3712, 3714, 3716, 3718, 3720, 3722, 3724, 3726, 3728, 3730,
- 3732, 3734, 3736, 3738, 3740, 3742, 3744, 3746, 3748, 3750,
- 3752, 3754, 3756, 3758, 3760, 3762, 3764, 3766, 3768, 3771,
- 3773
+ 334, 336, 344, 347, 348, 352, 354, 357, 362, 366,
+ 372, 376, 379, 383, 386, 388, 390, 393, 395, 398,
+ 401, 403, 405, 407, 409, 410, 412, 413, 417, 420,
+ 429, 432, 434, 438, 441, 443, 447, 450, 462, 469,
+ 477, 479, 480, 482, 486, 489, 495, 498, 500, 505,
+ 508, 512, 515, 518, 521, 525, 530, 540, 542, 544,
+ 546, 548, 561, 564, 568, 571, 573, 575, 578, 581,
+ 585, 587, 589, 591, 596, 598, 600, 602, 604, 605,
+ 612, 613, 614, 617, 620, 624, 626, 627, 630, 632,
+ 635, 638, 640, 644, 647, 649, 653, 655, 657, 661,
+ 663, 665, 669, 671, 673, 679, 683, 686, 689, 692,
+ 697, 700, 702, 704, 710, 720, 722, 725, 728, 730,
+ 733, 737, 746, 749, 751, 755, 768, 788, 791, 793,
+ 794, 797, 804, 810, 812, 814, 816, 818, 821, 826,
+ 828, 829, 830, 831, 834, 836, 837, 840, 842, 843,
+ 846, 851, 851, 855, 855, 858, 858, 861, 861, 865,
+ 865, 870, 870, 873, 873, 876, 878, 881, 888, 892,
+ 895, 898, 904, 913, 915, 923, 926, 929, 932, 936,
+ 939, 941, 944, 947, 949, 951, 953, 957, 960, 963,
+ 968, 972, 977, 981, 984, 985, 989, 1008, 1015, 1018,
+ 1020, 1021, 1022, 1025, 1029, 1030, 1034, 1038, 1041, 1043,
+ 1047, 1050, 1053, 1057, 1060, 1062, 1064, 1066, 1069, 1073,
+ 1075, 1077, 1079, 1085, 1088, 1091, 1094, 1106, 1111, 1115,
+ 1119, 1124, 1126, 1130, 1134, 1136, 1145, 1149, 1152, 1155,
+ 1160, 1163, 1165, 1173, 1186, 1191, 1197, 1199, 1201, 1214,
+ 1217, 1219, 1221, 1223, 1225, 1227, 1229, 1231, 1233, 1235,
+ 1237, 1239, 1241, 1243, 1245, 1247, 1249, 1251, 1253, 1255,
+ 1257, 1261, 1263, 1265, 1282, 1285, 1287, 1288, 1289, 1290,
+ 1291, 1294, 1297, 1300, 1304, 1307, 1309, 1314, 1316, 1317,
+ 1320, 1322, 1324, 1326, 1330, 1333, 1337, 1341, 1342, 1343,
+ 1347, 1355, 1356, 1357, 1371, 1373, 1376, 1378, 1389, 1394,
+ 1396, 1398, 1400, 1402, 1404, 1406, 1409, 1411, 1455, 1456,
+ 1460, 1464, 1468, 1472, 1474, 1478, 1480, 1482, 1490, 1492,
+ 1494, 1496, 1500, 1502, 1504, 1506, 1511, 1513, 1515, 1517,
+ 1520, 1522, 1524, 1568, 1571, 1575, 1578, 1582, 1585, 1590,
+ 1592, 1596, 1609, 1612, 1619, 1626, 1631, 1633, 1638, 1640,
+ 1647, 1649, 1653, 1657, 1663, 1667, 1670, 1673, 1676, 1686,
+ 1688, 1691, 1695, 1698, 1701, 1704, 1707, 1713, 1719, 1721,
+ 1726, 1728, 1737, 1740, 1742, 1745, 1751, 1753, 1763, 1767,
+ 1770, 1773, 1778, 1781, 1789, 1791, 1793, 1795, 1798, 1801,
+ 1816, 1835, 1838, 1840, 1843, 1845, 1849, 1851, 1855, 1857,
+ 1861, 1864, 1868, 1874, 1875, 1887, 1894, 1897, 1903, 1907,
+ 1912, 1918, 1919, 1927, 1930, 1934, 1937, 1941, 1946, 1949,
+ 1953, 1956, 1958, 1960, 1962, 1969, 1971, 1972, 1973, 1977,
+ 1980, 1984, 1987, 1993, 1995, 1998, 2001, 2004, 2010, 2013,
+ 2016, 2018, 2020, 2024, 2030, 2038, 2040, 2044, 2046, 2051,
+ 2054, 2057, 2059, 2061, 2065, 2070, 2077, 2081, 2085, 2092,
+ 2096, 2099, 2102, 2108, 2120, 2122, 2125, 2145, 2147, 2150,
+ 2152, 2157, 2159, 2161, 2163, 2165, 2167, 2171, 2179, 2182,
+ 2184, 2188, 2194, 2199, 2204, 2206, 2210, 2213, 2215, 2221,
+ 2238, 2244, 2246, 2249, 2252, 2254, 2258, 2260, 2264, 2269,
+ 2275, 2278, 2279, 2300, 2323, 2325, 2329, 2340, 2354, 2359,
+ 2366, 2368, 2369, 2370, 2373, 2388, 2393, 2399, 2401, 2406,
+ 2408, 2410, 2412, 2414, 2416, 2419, 2429, 2436, 2461, 2467,
+ 2470, 2473, 2475, 2486, 2491, 2494, 2499, 2502, 2509, 2519,
+ 2522, 2529, 2539, 2541, 2544, 2546, 2549, 2556, 2564, 2571,
+ 2577, 2583, 2591, 2595, 2600, 2604, 2607, 2616, 2618, 2622,
+ 2625, 2630, 2634, 2640, 2651, 2654, 2658, 2662, 2670, 2675,
+ 2681, 2684, 2686, 2688, 2694, 2697, 2699, 2701, 2703, 2707,
+ 2710, 2728, 2738, 2740, 2741, 2745, 2750, 2753, 2755, 2757,
+ 2759, 2763, 2769, 2772, 2774, 2776, 2778, 2782, 2785, 2788,
+ 2790, 2792, 2794, 2798, 2801, 2804, 2806, 2808, 2810, 2812,
+ 2819, 2823, 2828, 2832, 2837, 2839, 2843, 2846, 2848, 2851,
+ 2853, 2854, 2857, 2859, 2861, 2867, 2882, 2888, 2894, 2908,
+ 2910, 2914, 2928, 2930, 2932, 2936, 2942, 2955, 2957, 2961,
+ 2974, 2980, 2982, 2983, 2984, 2992, 2997, 3006, 3007, 3011,
+ 3014, 3020, 3026, 3029, 3031, 3033, 3035, 3039, 3043, 3047,
+ 3050, 3055, 3058, 3060, 3062, 3064, 3066, 3068, 3070, 3072,
+ 3076, 3080, 3084, 3088, 3089, 3091, 3093, 3095, 3097, 3099,
+ 3101, 3103, 3105, 3113, 3115, 3116, 3117, 3120, 3126, 3128,
+ 3133, 3135, 3138, 3152, 3155, 3158, 3162, 3165, 3172, 3174,
+ 3177, 3179, 3181, 3184, 3187, 3190, 3193, 3195, 3198, 3202,
+ 3204, 3210, 3212, 3213, 3215, 3220, 3222, 3224, 3226, 3228,
+ 3231, 3232, 3234, 3237, 3238, 3241, 3241, 3244, 3244, 3247,
+ 3247, 3249, 3251, 3253, 3255, 3261, 3267, 3270, 3273, 3279,
+ 3281, 3283, 3287, 3289, 3290, 3291, 3293, 3296, 3303, 3308,
+ 3316, 3320, 3322, 3325, 3327, 3330, 3334, 3336, 3339, 3341,
+ 3344, 3361, 3367, 3375, 3377, 3379, 3383, 3386, 3387, 3395,
+ 3399, 3403, 3406, 3407, 3413, 3416, 3419, 3421, 3425, 3430,
+ 3433, 3443, 3448, 3449, 3456, 3459, 3462, 3464, 3467, 3469,
+ 3479, 3493, 3497, 3500, 3502, 3506, 3510, 3513, 3516, 3518,
+ 3522, 3524, 3531, 3538, 3541, 3544, 3548, 3552, 3558, 3562,
+ 3567, 3569, 3572, 3577, 3583, 3594, 3597, 3599, 3603, 3608,
+ 3610, 3617, 3620, 3622, 3624, 3630, 3635, 3638, 3640, 3642,
+ 3644, 3646, 3648, 3650, 3652, 3654, 3656, 3658, 3660, 3662,
+ 3664, 3666, 3668, 3670, 3672, 3674, 3676, 3678, 3680, 3682,
+ 3684, 3686, 3688, 3690, 3692, 3694, 3696, 3698, 3700, 3703,
+ 3705
};
#endif
@@ -718,47 +738,49 @@ static const short yyrline[] = { 0,
static const char * const yytname[] = { "$","error","$undefined.","IDENTIFIER",
"TYPENAME","SELFNAME","PFUNCNAME","SCSPEC","TYPESPEC","CV_QUALIFIER","CONSTANT",
"STRING","ELLIPSIS","SIZEOF","ENUM","IF","ELSE","WHILE","DO","FOR","SWITCH",
-"CASE","DEFAULT","BREAK","CONTINUE","RETURN","GOTO","ASM_KEYWORD","GCC_ASM_KEYWORD",
-"TYPEOF","ALIGNOF","SIGOF","ATTRIBUTE","EXTENSION","LABEL","REALPART","IMAGPART",
-"AGGR","VISSPEC","DELETE","NEW","THIS","OPERATOR","CXX_TRUE","CXX_FALSE","NAMESPACE",
-"TYPENAME_KEYWORD","USING","LEFT_RIGHT","TEMPLATE","TYPEID","DYNAMIC_CAST","STATIC_CAST",
-"REINTERPRET_CAST","CONST_CAST","SCOPE","EMPTY","PTYPENAME","NSNAME","'{'","','",
-"';'","THROW","':'","ASSIGN","'='","'?'","OROR","ANDAND","'|'","'^'","'&'","MIN_MAX",
-"EQCOMPARE","ARITHCOMPARE","'<'","'>'","LSHIFT","RSHIFT","'+'","'-'","'*'","'/'",
-"'%'","POINTSAT_STAR","DOT_STAR","UNARY","PLUSPLUS","MINUSMINUS","'~'","HYPERUNARY",
-"PAREN_STAR_PAREN","POINTSAT","'.'","'('","'['","TRY","CATCH","TYPENAME_ELLIPSIS",
-"PRE_PARSED_FUNCTION_DECL","EXTERN_LANG_STRING","ALL","PRE_PARSED_CLASS_DECL",
-"DEFARG","DEFARG_MARKER","TYPENAME_DEFN","IDENTIFIER_DEFN","PTYPENAME_DEFN",
-"END_OF_LINE","END_OF_SAVED_INPUT","')'","'}'","'!'","']'","program","extdefs",
-"@1","extdefs_opt",".hush_warning",".warning_ok","extension","asm_keyword","lang_extdef",
-"@2","extdef","@3","@4","using_decl","any_id","extern_lang_string","template_header",
-"@5","template_parm_list","maybe_identifier","template_type_parm","template_template_parm",
-"template_parm","template_def","datadef","ctor_initializer_opt","maybe_return_init",
-"eat_saved_input","fndef","constructor_declarator","@6","@7","@8","@9","fn.def1",
+"CASE","DEFAULT","BREAK","CONTINUE","RETURN","GOTO","ASM_KEYWORD","TYPEOF","ALIGNOF",
+"SIGOF","ATTRIBUTE","EXTENSION","LABEL","REALPART","IMAGPART","AGGR","VISSPEC",
+"DELETE","NEW","THIS","OPERATOR","CXX_TRUE","CXX_FALSE","NAMESPACE","TYPENAME_KEYWORD",
+"USING","LEFT_RIGHT","TEMPLATE","TYPEID","DYNAMIC_CAST","STATIC_CAST","REINTERPRET_CAST",
+"CONST_CAST","SCOPE","EMPTY","PTYPENAME","NSNAME","'{'","','","';'","THROW",
+"':'","ASSIGN","'='","'?'","OROR","ANDAND","'|'","'^'","'&'","MIN_MAX","EQCOMPARE",
+"ARITHCOMPARE","'<'","'>'","LSHIFT","RSHIFT","'+'","'-'","'*'","'/'","'%'","POINTSAT_STAR",
+"DOT_STAR","UNARY","PLUSPLUS","MINUSMINUS","'~'","HYPERUNARY","PAREN_STAR_PAREN",
+"POINTSAT","'.'","'('","'['","TRY","CATCH","PRE_PARSED_FUNCTION_DECL","EXTERN_LANG_STRING",
+"ALL","PRE_PARSED_CLASS_DECL","DEFARG","DEFARG_MARKER","TYPENAME_DEFN","IDENTIFIER_DEFN",
+"PTYPENAME_DEFN","END_OF_LINE","END_OF_SAVED_INPUT","')'","'}'","'!'","']'",
+"program","extdefs","@1","extdefs_opt",".hush_warning",".warning_ok","extension",
+"asm_keyword","lang_extdef","@2","extdef","@3","@4","namespace_alias","@5","using_decl",
+"namespace_using_decl","using_directive","@6","namespace_qualifier","any_id",
+"extern_lang_string","template_header","@7","template_parm_list","maybe_identifier",
+"template_type_parm","template_template_parm","template_parm","template_def",
+"template_extdef","template_datadef","datadef","ctor_initializer_opt","maybe_return_init",
+"eat_saved_input","fndef","constructor_declarator","@8","@9","@10","@11","fn.def1",
"component_constructor_declarator","fn.def2","return_id","return_init","base_init",
".set_base_init","member_init_list","member_init","identifier","notype_identifier",
-"identifier_defn","explicit_instantiation","@10","@11","@12","@13","@14","@15",
-"@16","@17","begin_explicit_instantiation","end_explicit_instantiation","template_type",
-"self_template_type","template_close_bracket","template_arg_list_opt","template_arg_list",
-"template_arg","unop","expr","paren_expr_or_null","paren_cond_or_null","xcond",
-"condition","@18","compstmtend","already_scoped_stmt","@19","nontrivial_exprlist",
-"nonnull_exprlist","unary_expr","new_placement","new_initializer","regcast_or_absdcl",
-"cast_expr","expr_no_commas","notype_unqualified_id","do_id","template_id","object_template_id",
-"unqualified_id","expr_or_declarator","notype_template_declarator","direct_notype_declarator",
-"primary","@20","new","delete","boolean.literal","string","nodecls","object",
+"identifier_defn","explicit_instantiation","@12","@13","@14","@15","@16","@17",
+"@18","@19","begin_explicit_instantiation","end_explicit_instantiation","template_type",
+"self_template_type",".finish_template_type","template_close_bracket","template_arg_list_opt",
+"template_arg_list","template_arg","unop","expr","paren_expr_or_null","paren_cond_or_null",
+"xcond","condition","@20","compstmtend","already_scoped_stmt","@21","nontrivial_exprlist",
+"nonnull_exprlist","unary_expr",".finish_new_placement",".begin_new_placement",
+"new_placement","new_initializer","regcast_or_absdcl","cast_expr","expr_no_commas",
+"notype_unqualified_id","do_id","template_id","object_template_id","unqualified_id",
+"expr_or_declarator","notype_template_declarator","direct_notype_declarator",
+"primary","@22","new","delete","boolean.literal","string","nodecls","object",
"decl","declarator","fcast_or_absdcl","type_id","typed_declspecs","typed_declspecs1",
"reserved_declspecs","declmods","typed_typespecs","reserved_typespecquals","typespec",
"typespecqual_reserved","initdecls","notype_initdecls","nomods_initdecls","maybeasm",
-"initdcl","@21","initdcl0_innards","@22","initdcl0","notype_initdcl0","nomods_initdcl0",
-"@23","maybe_attribute","attributes","attribute","attribute_list","attrib","any_word",
+"initdcl","@23","initdcl0_innards","@24","initdcl0","notype_initdcl0","nomods_initdcl0",
+"@25","maybe_attribute","attributes","attribute","attribute_list","attrib","any_word",
"identifiers_or_typenames","maybe_init","init","initlist","fn.defpen","pending_inline",
-"pending_inlines","defarg_again","pending_defargs","structsp","@24","@25","@26",
-"@27","maybecomma","maybecomma_warn","aggr","named_class_head_sans_basetype",
+"pending_inlines","defarg_again","pending_defargs","structsp","@26","@27","@28",
+"@29","maybecomma","maybecomma_warn","aggr","named_class_head_sans_basetype",
"named_class_head_sans_basetype_defn","named_complex_class_head_sans_basetype",
-"do_xref_defn","named_class_head","unnamed_class_head","class_head","maybe_base_class_list",
+"named_class_head","@30","unnamed_class_head","class_head","maybe_base_class_list",
"base_class_list","base_class","base_class.1","base_class_access_list","left_curly",
-"self_reference","opt.component_decl_list","component_decl_list","component_decl",
-"component_decl_1","components","notype_components","component_declarator0",
+"self_reference","opt.component_decl_list","access_specifier","component_decl_list",
+"component_decl","component_decl_1","components","notype_components","component_declarator0",
"component_declarator","after_type_component_declarator0","notype_component_declarator0",
"after_type_component_declarator","notype_component_declarator","enumlist","enumerator",
"new_type_id","cv_qualifiers","nonempty_cv_qualifiers","suspend_mom","nonmomentary_expr",
@@ -769,162 +791,168 @@ static const char * const yytname[] = { "$","error","$undefined.","IDENTIFIER"
"typename_sub","typename_sub0","typename_sub1","typename_sub2","explicit_template_type",
"complex_type_name","ptr_to_mem","global_scope","new_declarator","direct_new_declarator",
"absdcl","direct_abstract_declarator","stmts","errstmt","maybe_label_decls",
-"label_decls","label_decl","compstmt_or_error","compstmt","@28","simple_if",
-"@29","@30","implicitly_scoped_stmt","@31","stmt","simple_stmt","@32","@33",
-"@34","@35","@36","@37","@38","@39","@40","@41","@42","@43","@44","@45","function_try_block",
-"@46","@47","try_block","@48","@49","handler_seq","handler","@50","@51","type_specifier_seq",
+"label_decls","label_decl","compstmt_or_error","compstmt","@31","simple_if",
+"@32","@33","implicitly_scoped_stmt","@34","stmt","simple_stmt","@35","@36",
+"@37","@38","@39","@40","@41","@42","@43","@44","@45","@46","@47","@48","function_try_block",
+"@49","@50","try_block","@51","@52","handler_seq","handler","@53","@54","type_specifier_seq",
"handler_args","label_colon","for.init.statement","maybe_cv_qualifier","xexpr",
"asm_operands","nonnull_asm_operands","asm_operand","asm_clobbers","parmlist",
-"complex_parmlist","defarg","@52","defarg1","parms","parms_comma","named_parm",
+"complex_parmlist","defarg","@55","defarg1","parms","parms_comma","named_parm",
"full_parm","parm","see_typename","bad_parm","exception_specification_opt","ansi_raise_identifier",
"ansi_raise_identifiers","conversion_declarator","operator","operator_name", NULL
};
#endif
static const short yyr1[] = { 0,
- 114, 114, 116, 115, 115, 117, 117, 118, 119, 120,
- 121, 121, 123, 122, 124, 124, 124, 124, 124, 124,
- 124, 125, 124, 126, 124, 124, 124, 124, 124, 127,
- 127, 127, 128, 128, 128, 128, 129, 129, 131, 130,
- 130, 132, 132, 133, 133, 134, 134, 135, 136, 136,
- 136, 136, 136, 136, 137, 137, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 139, 139, 140, 140, 140,
- 141, 141, 142, 142, 142, 144, 143, 143, 145, 143,
- 143, 146, 143, 143, 147, 143, 143, 148, 148, 148,
- 148, 148, 149, 149, 149, 149, 150, 150, 150, 150,
- 150, 150, 150, 151, 152, 152, 152, 153, 154, 155,
- 155, 155, 155, 156, 156, 156, 156, 156, 156, 156,
- 156, 157, 157, 157, 157, 157, 158, 158, 158, 159,
- 159, 159, 161, 160, 162, 160, 163, 160, 164, 160,
- 165, 160, 166, 160, 167, 160, 168, 160, 169, 170,
- 171, 171, 171, 172, 173, 173, 174, 174, 175, 175,
- 176, 176, 177, 177, 177, 177, 177, 178, 178, 179,
- 179, 180, 180, 181, 181, 181, 183, 182, 182, 184,
- 184, 184, 184, 186, 185, 185, 187, 187, 187, 187,
- 188, 188, 189, 189, 189, 189, 189, 189, 189, 189,
- 189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
- 189, 189, 189, 189, 189, 189, 190, 190, 191, 191,
- 191, 191, 192, 192, 193, 193, 193, 194, 194, 194,
- 194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
- 194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
- 194, 194, 195, 195, 195, 195, 195, 195, 196, 197,
- 197, 198, 198, 198, 199, 199, 199, 200, 200, 200,
- 200, 201, 201, 202, 202, 202, 202, 203, 203, 203,
- 203, 203, 203, 203, 204, 203, 203, 203, 203, 203,
+ 112, 112, 114, 113, 113, 115, 115, 116, 117, 118,
+ 119, 121, 120, 122, 122, 122, 122, 122, 122, 122,
+ 123, 122, 124, 122, 122, 122, 122, 122, 126, 125,
+ 127, 127, 127, 128, 128, 128, 130, 129, 131, 131,
+ 132, 132, 132, 132, 133, 133, 135, 134, 134, 136,
+ 136, 137, 137, 138, 138, 139, 140, 140, 140, 140,
+ 140, 140, 141, 141, 142, 142, 142, 142, 142, 142,
+ 143, 143, 143, 143, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 145, 145, 146, 146, 146, 147, 147,
+ 148, 148, 148, 150, 149, 149, 151, 149, 149, 152,
+ 149, 149, 153, 149, 149, 154, 154, 154, 154, 154,
+ 155, 155, 155, 155, 156, 156, 156, 156, 156, 156,
+ 156, 157, 158, 158, 158, 159, 160, 161, 161, 161,
+ 161, 162, 162, 162, 162, 162, 162, 162, 162, 163,
+ 163, 163, 163, 163, 164, 164, 164, 165, 165, 165,
+ 167, 166, 168, 166, 169, 166, 170, 166, 171, 166,
+ 172, 166, 173, 166, 174, 166, 175, 176, 177, 177,
+ 177, 178, 179, 180, 180, 181, 181, 182, 182, 183,
+ 183, 183, 184, 184, 184, 184, 184, 185, 185, 186,
+ 186, 187, 187, 188, 188, 188, 190, 189, 189, 191,
+ 191, 191, 191, 193, 192, 192, 194, 194, 194, 194,
+ 195, 195, 196, 196, 196, 196, 196, 196, 196, 196,
+ 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
+ 196, 196, 196, 196, 196, 196, 197, 198, 199, 199,
+ 200, 200, 200, 200, 201, 201, 202, 202, 202, 203,
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 203, 203, 203, 203, 205, 205, 206,
- 206, 207, 207, 208, 208, 209, 210, 210, 211, 211,
- 211, 211, 211, 211, 212, 212, 213, 213, 214, 214,
- 214, 214, 214, 215, 215, 216, 216, 216, 216, 216,
- 216, 217, 217, 217, 217, 217, 218, 218, 218, 218,
- 218, 218, 219, 219, 219, 219, 220, 220, 221, 221,
- 221, 221, 221, 221, 221, 222, 222, 222, 223, 223,
- 224, 224, 225, 225, 226, 226, 228, 227, 227, 230,
- 229, 229, 231, 232, 234, 233, 233, 235, 235, 236,
- 236, 237, 238, 238, 239, 239, 239, 239, 239, 240,
- 240, 240, 240, 241, 241, 242, 242, 243, 243, 243,
- 243, 243, 244, 244, 244, 244, 244, 245, 246, 246,
- 246, 247, 247, 248, 248, 249, 249, 249, 251, 250,
- 250, 252, 250, 250, 250, 250, 250, 253, 254, 250,
- 250, 255, 255, 256, 256, 257, 257, 257, 257, 257,
- 258, 259, 260, 260, 260, 260, 260, 261, 262, 262,
- 262, 263, 264, 264, 265, 265, 265, 266, 266, 267,
- 267, 268, 268, 268, 268, 269, 269, 269, 269, 270,
- 271, 272, 272, 272, 272, 273, 273, 274, 274, 274,
- 274, 274, 274, 274, 274, 274, 274, 275, 275, 275,
- 275, 275, 275, 275, 275, 275, 276, 276, 276, 277,
- 277, 277, 278, 278, 279, 279, 280, 280, 281, 281,
- 281, 281, 282, 282, 283, 283, 283, 284, 284, 285,
- 285, 286, 286, 286, 287, 287, 288, 288, 289, 290,
- 291, 291, 291, 291, 292, 292, 292, 292, 292, 292,
- 293, 293, 294, 294, 294, 295, 296, 296, 296, 296,
- 296, 296, 297, 297, 297, 297, 297, 297, 298, 298,
- 298, 298, 298, 298, 299, 299, 299, 299, 299, 299,
- 300, 300, 301, 301, 302, 302, 303, 303, 303, 304,
- 304, 304, 305, 305, 305, 306, 306, 306, 306, 307,
- 307, 308, 308, 308, 308, 309, 309, 309, 309, 310,
- 310, 310, 310, 310, 310, 311, 312, 312, 312, 313,
- 313, 314, 315, 315, 315, 315, 315, 315, 315, 316,
- 316, 317, 317, 317, 317, 317, 317, 317, 317, 317,
- 317, 317, 318, 318, 318, 318, 318, 318, 318, 318,
- 318, 318, 318, 319, 319, 319, 319, 320, 321, 321,
- 322, 322, 323, 324, 324, 326, 325, 328, 329, 327,
- 330, 331, 330, 332, 332, 333, 333, 334, 333, 333,
- 335, 336, 333, 337, 338, 333, 339, 340, 341, 342,
- 333, 343, 344, 333, 345, 333, 346, 333, 347, 333,
- 333, 333, 333, 333, 333, 333, 333, 333, 333, 333,
- 333, 333, 333, 333, 349, 350, 348, 352, 353, 351,
- 354, 354, 356, 357, 355, 358, 358, 359, 359, 360,
- 360, 360, 360, 361, 361, 361, 362, 362, 363, 363,
- 363, 364, 364, 365, 365, 366, 367, 367, 368, 368,
- 368, 369, 369, 369, 369, 369, 369, 369, 369, 369,
- 369, 371, 370, 372, 372, 373, 373, 373, 373, 373,
- 374, 374, 375, 375, 375, 375, 375, 375, 376, 376,
- 377, 377, 378, 379, 379, 380, 380, 380, 381, 382,
- 382, 383, 383, 383, 383, 384, 385, 385, 385, 385,
- 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
- 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
- 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
- 385
+ 203, 203, 203, 203, 204, 204, 204, 204, 204, 204,
+ 204, 205, 206, 206, 207, 207, 207, 208, 208, 208,
+ 209, 209, 209, 209, 210, 210, 211, 211, 211, 211,
+ 212, 212, 212, 212, 212, 212, 212, 213, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
+ 212, 212, 212, 214, 214, 215, 215, 216, 216, 217,
+ 217, 218, 219, 219, 220, 220, 220, 220, 220, 220,
+ 221, 221, 222, 222, 223, 223, 223, 223, 223, 224,
+ 224, 225, 225, 225, 225, 225, 225, 226, 226, 226,
+ 226, 226, 227, 227, 227, 227, 227, 227, 228, 228,
+ 228, 228, 229, 229, 230, 230, 230, 230, 230, 230,
+ 230, 231, 231, 231, 232, 232, 233, 233, 234, 234,
+ 235, 235, 237, 236, 236, 239, 238, 238, 240, 241,
+ 243, 242, 242, 244, 244, 245, 245, 246, 247, 247,
+ 248, 248, 248, 248, 248, 249, 249, 249, 249, 250,
+ 250, 251, 251, 252, 252, 252, 252, 252, 253, 253,
+ 253, 253, 253, 254, 255, 255, 255, 256, 256, 257,
+ 257, 258, 258, 258, 260, 259, 259, 261, 259, 259,
+ 259, 259, 259, 262, 263, 259, 259, 264, 264, 265,
+ 265, 266, 266, 266, 266, 266, 266, 267, 268, 268,
+ 268, 269, 269, 269, 269, 269, 270, 271, 270, 270,
+ 272, 273, 273, 274, 274, 274, 275, 275, 276, 276,
+ 277, 277, 277, 277, 278, 278, 278, 278, 279, 280,
+ 281, 281, 281, 281, 282, 283, 283, 284, 284, 284,
+ 284, 284, 284, 284, 284, 284, 284, 285, 285, 285,
+ 285, 285, 285, 285, 285, 285, 286, 286, 286, 287,
+ 287, 287, 288, 288, 289, 289, 290, 290, 291, 291,
+ 291, 291, 292, 292, 293, 293, 293, 294, 294, 295,
+ 295, 296, 296, 296, 297, 297, 298, 298, 299, 300,
+ 301, 301, 301, 301, 302, 302, 302, 302, 302, 302,
+ 303, 303, 304, 304, 304, 305, 306, 306, 306, 306,
+ 306, 306, 307, 307, 307, 307, 307, 307, 308, 308,
+ 308, 308, 308, 308, 309, 309, 309, 309, 309, 309,
+ 310, 310, 311, 311, 312, 312, 313, 313, 313, 314,
+ 314, 314, 315, 315, 315, 316, 316, 316, 316, 317,
+ 317, 318, 318, 318, 318, 319, 319, 319, 319, 320,
+ 320, 320, 320, 320, 320, 321, 322, 322, 322, 323,
+ 323, 324, 325, 325, 325, 325, 325, 325, 325, 326,
+ 326, 327, 327, 327, 327, 327, 327, 327, 327, 327,
+ 327, 327, 328, 328, 328, 328, 328, 328, 328, 328,
+ 328, 328, 328, 329, 329, 329, 329, 330, 331, 331,
+ 332, 332, 333, 334, 334, 336, 335, 338, 339, 337,
+ 340, 341, 340, 342, 342, 343, 343, 344, 343, 343,
+ 345, 346, 343, 347, 348, 343, 349, 350, 351, 352,
+ 343, 353, 354, 343, 355, 343, 356, 343, 357, 343,
+ 343, 343, 343, 343, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 343, 343, 343, 343, 359, 360, 358,
+ 362, 363, 361, 364, 364, 366, 367, 365, 368, 368,
+ 369, 369, 370, 370, 370, 370, 371, 371, 371, 372,
+ 372, 373, 373, 373, 374, 374, 375, 375, 376, 377,
+ 377, 378, 378, 378, 379, 379, 379, 379, 379, 379,
+ 379, 381, 380, 382, 382, 383, 383, 383, 383, 383,
+ 384, 384, 385, 385, 385, 385, 385, 385, 386, 386,
+ 387, 387, 388, 389, 389, 390, 390, 390, 391, 392,
+ 392, 393, 393, 393, 393, 394, 395, 395, 395, 395,
+ 395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
+ 395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
+ 395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
+ 395
};
static const short yyr2[] = { 0,
0, 1, 0, 2, 2, 1, 0, 0, 0, 1,
- 1, 1, 0, 2, 2, 1, 1, 5, 4, 5,
- 4, 0, 6, 0, 5, 5, 2, 4, 2, 2,
- 3, 3, 1, 1, 2, 2, 1, 2, 0, 5,
- 3, 1, 3, 1, 0, 2, 2, 3, 1, 3,
- 1, 3, 1, 3, 2, 2, 2, 3, 3, 2,
- 2, 2, 2, 2, 1, 1, 1, 0, 1, 2,
- 0, 1, 4, 3, 3, 0, 8, 5, 0, 9,
- 6, 0, 8, 5, 0, 9, 6, 2, 2, 1,
- 2, 1, 6, 4, 6, 4, 2, 1, 2, 2,
- 1, 2, 1, 2, 2, 4, 2, 3, 0, 0,
- 1, 3, 2, 3, 1, 4, 2, 4, 2, 4,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 0, 6, 0, 6, 0, 5, 0, 5,
- 0, 7, 0, 7, 0, 6, 0, 6, 0, 0,
- 4, 4, 1, 4, 1, 1, 0, 1, 1, 3,
+ 1, 0, 2, 2, 1, 1, 5, 4, 5, 4,
+ 0, 6, 0, 5, 1, 2, 1, 2, 0, 6,
+ 2, 3, 3, 3, 3, 4, 0, 5, 2, 3,
+ 1, 1, 2, 2, 1, 2, 0, 5, 3, 1,
+ 3, 1, 0, 2, 2, 3, 1, 3, 1, 3,
+ 1, 3, 2, 2, 2, 1, 1, 5, 4, 2,
+ 2, 3, 3, 2, 2, 3, 3, 2, 2, 2,
+ 2, 2, 1, 1, 1, 0, 1, 2, 0, 1,
+ 4, 3, 3, 0, 8, 5, 0, 9, 6, 0,
+ 8, 5, 0, 9, 6, 2, 2, 1, 2, 1,
+ 6, 4, 6, 4, 2, 1, 2, 2, 1, 2,
+ 1, 2, 2, 4, 2, 3, 0, 0, 1, 3,
+ 2, 3, 1, 4, 2, 4, 2, 4, 2, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 6, 0, 6, 0, 5, 0, 5, 0, 7,
+ 0, 7, 0, 6, 0, 6, 0, 0, 5, 5,
+ 1, 5, 0, 1, 1, 0, 1, 1, 3, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3, 1, 3, 0, 1, 1, 0, 7, 1, 1,
3, 4, 3, 0, 3, 1, 3, 3, 3, 3,
1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
- 4, 2, 4, 2, 3, 3, 4, 4, 5, 5,
- 6, 2, 4, 5, 2, 2, 3, 3, 3, 1,
- 3, 2, 3, 4, 1, 2, 5, 1, 3, 3,
+ 4, 2, 4, 2, 3, 3, 4, 5, 6, 6,
+ 7, 2, 4, 5, 2, 2, 1, 0, 4, 4,
+ 3, 1, 3, 2, 3, 4, 1, 2, 5, 1,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 5, 3, 3,
- 1, 2, 3, 1, 1, 1, 1, 1, 0, 5,
- 5, 5, 5, 5, 1, 1, 1, 1, 2, 2,
- 3, 4, 4, 1, 1, 1, 3, 1, 1, 1,
- 1, 3, 3, 3, 0, 4, 4, 2, 4, 2,
- 2, 1, 4, 1, 7, 7, 7, 7, 4, 4,
- 2, 2, 1, 4, 2, 2, 5, 3, 2, 2,
- 5, 3, 5, 3, 4, 6, 2, 1, 2, 1,
- 2, 1, 1, 1, 2, 0, 2, 2, 3, 3,
- 3, 2, 2, 2, 1, 1, 1, 2, 2, 2,
- 2, 1, 1, 1, 1, 2, 2, 3, 3, 3,
- 4, 1, 2, 2, 2, 1, 1, 1, 2, 2,
- 2, 1, 1, 2, 2, 3, 1, 2, 1, 1,
- 1, 4, 4, 4, 4, 1, 1, 1, 1, 3,
- 1, 3, 1, 3, 0, 4, 0, 6, 3, 0,
- 4, 1, 3, 3, 0, 4, 3, 0, 1, 1,
- 2, 6, 1, 3, 0, 1, 4, 6, 4, 1,
- 1, 1, 1, 1, 3, 0, 2, 1, 2, 3,
- 4, 1, 1, 3, 4, 3, 5, 1, 4, 3,
- 3, 0, 3, 3, 3, 0, 2, 2, 0, 7,
- 4, 0, 6, 3, 2, 2, 2, 0, 0, 9,
- 1, 0, 1, 0, 1, 1, 2, 2, 2, 2,
- 2, 2, 3, 4, 3, 2, 3, 0, 1, 3,
- 2, 2, 1, 1, 0, 2, 3, 1, 4, 1,
- 3, 1, 1, 4, 4, 2, 2, 3, 3, 1,
- 0, 1, 2, 4, 3, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 5,
+ 3, 3, 1, 2, 3, 3, 1, 1, 1, 1,
+ 1, 0, 5, 5, 5, 5, 5, 1, 1, 1,
+ 1, 2, 2, 3, 4, 4, 1, 1, 1, 3,
+ 1, 1, 1, 1, 3, 3, 3, 0, 4, 4,
+ 2, 4, 2, 4, 2, 2, 1, 4, 1, 7,
+ 7, 7, 7, 4, 4, 2, 2, 2, 1, 4,
+ 2, 2, 5, 3, 2, 2, 5, 3, 5, 3,
+ 4, 6, 2, 1, 2, 1, 2, 1, 1, 1,
+ 2, 0, 2, 2, 3, 3, 3, 2, 2, 2,
+ 1, 1, 1, 2, 2, 2, 2, 1, 1, 1,
+ 1, 2, 2, 3, 3, 3, 4, 1, 2, 2,
+ 2, 1, 1, 1, 2, 2, 2, 1, 1, 2,
+ 2, 3, 1, 2, 1, 1, 1, 4, 4, 4,
+ 4, 1, 1, 1, 1, 3, 1, 3, 1, 3,
+ 0, 4, 0, 6, 3, 0, 4, 1, 3, 3,
+ 0, 4, 3, 0, 1, 1, 2, 6, 1, 3,
+ 0, 1, 4, 6, 4, 1, 1, 1, 1, 1,
+ 3, 0, 2, 1, 2, 3, 4, 1, 1, 3,
+ 4, 3, 5, 1, 4, 3, 3, 0, 3, 3,
+ 3, 0, 2, 2, 0, 7, 4, 0, 6, 3,
+ 2, 2, 2, 0, 0, 9, 1, 0, 1, 0,
+ 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 3, 4, 3, 2, 3, 1, 0, 3, 2,
+ 2, 1, 1, 0, 2, 3, 1, 4, 1, 3,
+ 1, 1, 4, 4, 2, 2, 3, 3, 1, 0,
+ 1, 2, 3, 2, 2, 1, 2, 2, 2, 2,
2, 2, 2, 1, 2, 2, 3, 2, 2, 4,
4, 2, 1, 5, 4, 1, 0, 1, 3, 0,
1, 3, 1, 1, 1, 1, 4, 4, 4, 4,
4, 3, 4, 4, 4, 4, 3, 1, 3, 1,
- 3, 2, 1, 6, 0, 2, 1, 2, 0, 2,
+ 3, 2, 1, 7, 0, 2, 1, 2, 0, 2,
4, 4, 2, 4, 3, 3, 2, 2, 3, 1,
1, 2, 1, 1, 2, 2, 4, 4, 3, 3,
2, 1, 3, 3, 2, 2, 3, 1, 3, 3,
@@ -942,11 +970,11 @@ static const short yyr2[] = { 0,
0, 0, 5, 0, 0, 7, 0, 0, 0, 0,
12, 0, 0, 7, 0, 5, 0, 7, 0, 4,
2, 2, 2, 3, 6, 8, 10, 12, 4, 3,
- 2, 2, 1, 1, 0, 0, 6, 0, 0, 5,
- 1, 2, 0, 0, 5, 1, 1, 3, 3, 2,
- 2, 2, 2, 2, 1, 2, 0, 1, 0, 1,
- 1, 0, 1, 1, 3, 4, 1, 3, 0, 1,
- 1, 1, 2, 2, 2, 1, 1, 2, 2, 2,
+ 2, 2, 1, 1, 1, 1, 1, 0, 0, 6,
+ 0, 0, 5, 1, 2, 0, 0, 5, 1, 1,
+ 3, 3, 2, 2, 2, 2, 2, 1, 2, 0,
+ 1, 0, 1, 1, 0, 1, 1, 3, 4, 1,
+ 3, 0, 1, 1, 1, 2, 2, 2, 1, 2,
2, 0, 3, 1, 1, 1, 2, 2, 2, 4,
2, 2, 2, 2, 2, 2, 1, 2, 1, 2,
1, 1, 0, 0, 1, 0, 4, 2, 1, 1,
@@ -958,2537 +986,2619 @@ static const short yyr2[] = { 0,
};
static const short yydefact[] = { 3,
- 13, 13, 5, 0, 4, 0, 256, 600, 601, 0,
- 358, 370, 547, 0, 11, 12, 0, 0, 0, 10,
- 456, 806, 0, 0, 0, 149, 632, 257, 258, 65,
- 0, 0, 793, 0, 37, 0, 0, 14, 0, 8,
- 0, 17, 16, 71, 92, 68, 0, 602, 153, 275,
- 254, 276, 578, 0, 345, 0, 344, 363, 0, 383,
- 362, 400, 369, 0, 469, 468, 475, 474, 473, 451,
- 357, 563, 371, 564, 90, 274, 589, 561, 0, 603,
- 545, 0, 0, 255, 63, 64, 157, 606, 157, 607,
- 157, 259, 149, 122, 123, 124, 125, 126, 442, 445,
- 0, 628, 0, 446, 0, 0, 0, 0, 123, 124,
- 125, 126, 24, 0, 0, 0, 0, 0, 0, 0,
- 447, 610, 0, 616, 0, 0, 0, 0, 0, 0,
- 30, 0, 0, 39, 0, 157, 608, 0, 0, 576,
- 0, 0, 0, 575, 0, 0, 0, 0, 275, 0,
- 549, 0, 274, 545, 29, 0, 27, 3, 38, 0,
- 56, 55, 72, 15, 0, 398, 0, 0, 416, 69,
- 61, 609, 549, 0, 545, 62, 0, 0, 0, 88,
- 0, 379, 335, 560, 336, 572, 0, 545, 360, 359,
- 60, 91, 346, 0, 381, 361, 89, 352, 376, 377,
- 347, 365, 367, 356, 378, 0, 57, 401, 457, 458,
- 459, 460, 472, 131, 130, 132, 461, 462, 466, 0,
- 0, 475, 793, 471, 490, 491, 548, 364, 0, 395,
- 601, 0, 630, 153, 593, 594, 590, 566, 604, 0,
- 565, 562, 0, 841, 837, 836, 834, 816, 821, 822,
- 0, 828, 827, 813, 814, 812, 831, 820, 817, 818,
- 819, 823, 824, 810, 811, 807, 808, 809, 833, 825,
- 826, 815, 832, 0, 829, 736, 363, 737, 802, 259,
- 256, 547, 279, 324, 0, 0, 0, 0, 320, 318,
- 292, 322, 323, 0, 0, 0, 0, 0, 258, 251,
- 0, 0, 164, 163, 0, 165, 166, 0, 0, 167,
- 0, 0, 158, 159, 0, 225, 0, 228, 162, 278,
- 193, 0, 0, 280, 281, 0, 161, 342, 363, 343,
- 595, 303, 294, 0, 0, 0, 0, 157, 0, 444,
- 0, 439, 0, 629, 627, 0, 168, 169, 0, 0,
- 0, 405, 3, 22, 0, 624, 620, 621, 623, 625,
- 622, 122, 123, 124, 0, 125, 126, 612, 613, 617,
- 614, 611, 266, 267, 0, 265, 33, 34, 0, 592,
- 591, 32, 31, 41, 0, 358, 139, 0, 0, 363,
- 137, 0, 0, 574, 0, 573, 253, 270, 0, 582,
- 269, 0, 581, 0, 277, 586, 0, 0, 13, 0,
- 149, 9, 9, 0, 397, 399, 104, 75, 109, 725,
- 0, 67, 66, 74, 107, 0, 0, 105, 70, 588,
- 0, 0, 553, 0, 796, 0, 558, 0, 557, 0,
- 0, 0, 0, 545, 398, 0, 59, 549, 545, 571,
- 0, 349, 350, 0, 58, 398, 354, 353, 355, 348,
- 368, 385, 384, 463, 467, 465, 0, 470, 476, 0,
- 0, 366, 398, 545, 76, 0, 0, 0, 0, 545,
- 82, 546, 577, 601, 631, 153, 0, 0, 830, 835,
- 365, 545, 545, 0, 545, 840, 157, 0, 0, 0,
- 200, 0, 0, 202, 215, 216, 0, 0, 0, 0,
- 0, 252, 199, 196, 195, 197, 0, 0, 0, 0,
- 0, 278, 0, 0, 0, 194, 155, 156, 272, 0,
- 198, 0, 0, 226, 0, 0, 0, 0, 0, 0,
+ 12, 12, 5, 0, 4, 0, 279, 630, 631, 0,
+ 384, 396, 577, 0, 11, 0, 0, 0, 10, 482,
+ 836, 0, 0, 0, 167, 662, 280, 281, 83, 0,
+ 0, 823, 0, 45, 0, 0, 13, 25, 0, 27,
+ 8, 0, 16, 15, 89, 110, 86, 0, 632, 171,
+ 298, 277, 299, 608, 0, 371, 0, 370, 389, 0,
+ 409, 388, 426, 395, 0, 497, 498, 504, 503, 502,
+ 477, 383, 593, 397, 594, 108, 297, 619, 591, 0,
+ 633, 575, 0, 0, 278, 81, 82, 176, 636, 176,
+ 637, 176, 282, 167, 140, 141, 142, 143, 144, 468,
+ 471, 0, 658, 0, 472, 0, 0, 0, 0, 141,
+ 142, 143, 144, 23, 0, 0, 0, 0, 0, 0,
+ 0, 473, 640, 0, 646, 0, 0, 0, 37, 0,
+ 0, 31, 0, 0, 47, 0, 176, 638, 0, 0,
+ 606, 0, 0, 0, 605, 0, 0, 0, 0, 298,
+ 0, 579, 0, 297, 575, 28, 0, 26, 3, 46,
+ 0, 64, 384, 0, 0, 8, 67, 63, 66, 89,
+ 0, 0, 0, 395, 90, 14, 0, 424, 0, 0,
+ 442, 87, 79, 639, 579, 0, 575, 80, 0, 0,
+ 0, 106, 0, 405, 361, 590, 362, 602, 0, 575,
+ 386, 385, 78, 109, 372, 0, 407, 387, 107, 378,
+ 402, 403, 373, 391, 393, 382, 404, 0, 75, 427,
+ 483, 484, 485, 486, 501, 149, 148, 150, 488, 489,
+ 495, 487, 0, 0, 490, 491, 504, 823, 500, 519,
+ 520, 578, 390, 0, 421, 631, 0, 660, 171, 623,
+ 624, 620, 596, 634, 0, 595, 592, 0, 871, 867,
+ 866, 864, 846, 851, 852, 0, 858, 857, 843, 844,
+ 842, 861, 850, 847, 848, 849, 853, 854, 840, 841,
+ 837, 838, 839, 863, 855, 856, 845, 862, 0, 859,
+ 769, 389, 770, 832, 282, 279, 577, 302, 350, 0,
+ 0, 0, 0, 346, 344, 317, 348, 349, 0, 0,
+ 0, 0, 0, 280, 281, 273, 0, 0, 184, 183,
+ 0, 185, 186, 0, 0, 187, 0, 0, 177, 178,
+ 0, 247, 0, 250, 182, 301, 213, 0, 0, 303,
+ 304, 0, 180, 368, 389, 369, 625, 329, 319, 0,
+ 0, 0, 0, 176, 0, 470, 0, 465, 0, 659,
+ 657, 0, 188, 189, 0, 0, 0, 431, 3, 21,
+ 29, 654, 650, 651, 653, 655, 652, 140, 141, 142,
+ 0, 143, 144, 642, 643, 647, 644, 641, 0, 289,
+ 290, 288, 622, 621, 33, 32, 49, 0, 157, 0,
+ 0, 389, 155, 0, 0, 604, 0, 603, 141, 142,
+ 275, 276, 293, 0, 612, 292, 0, 611, 0, 300,
+ 616, 0, 0, 12, 0, 167, 9, 9, 70, 0,
+ 65, 0, 0, 71, 74, 0, 423, 425, 122, 93,
+ 127, 758, 0, 85, 84, 92, 125, 0, 0, 123,
+ 88, 618, 0, 0, 583, 0, 826, 0, 588, 0,
+ 587, 0, 0, 0, 0, 575, 424, 0, 77, 579,
+ 575, 601, 0, 375, 376, 0, 76, 424, 380, 379,
+ 381, 374, 394, 411, 410, 492, 496, 494, 0, 499,
+ 505, 0, 0, 392, 424, 575, 94, 0, 0, 0,
+ 0, 575, 100, 576, 607, 631, 661, 171, 0, 0,
+ 860, 865, 391, 575, 575, 0, 575, 870, 176, 0,
+ 0, 0, 220, 0, 0, 222, 235, 236, 0, 0,
+ 0, 0, 0, 274, 219, 216, 215, 217, 0, 0,
+ 0, 0, 0, 301, 0, 0, 0, 214, 174, 175,
+ 295, 0, 218, 0, 0, 248, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 288, 290, 291, 328,
- 327, 0, 0, 0, 0, 0, 204, 543, 0, 212,
- 325, 317, 0, 0, 793, 306, 309, 310, 0, 0,
- 337, 649, 645, 654, 0, 549, 545, 545, 545, 339,
- 652, 0, 599, 341, 0, 0, 340, 305, 0, 301,
- 319, 321, 596, 0, 302, 152, 154, 0, 147, 0,
- 363, 145, 540, 454, 538, 441, 0, 0, 372, 0,
- 0, 373, 374, 375, 411, 412, 413, 410, 0, 403,
- 406, 0, 3, 0, 615, 157, 618, 28, 36, 35,
- 45, 0, 0, 0, 49, 53, 42, 792, 787, 0,
- 342, 363, 45, 343, 791, 51, 150, 135, 133, 150,
- 151, 273, 580, 579, 277, 583, 0, 19, 21, 71,
- 0, 110, 326, 0, 676, 73, 674, 422, 0, 418,
- 417, 192, 0, 191, 550, 587, 0, 766, 767, 0,
- 761, 363, 0, 760, 762, 794, 776, 0, 0, 585,
- 556, 555, 0, 0, 570, 0, 393, 392, 380, 569,
- 0, 796, 559, 351, 382, 394, 398, 464, 600, 601,
- 793, 0, 793, 602, 477, 478, 480, 793, 483, 482,
- 0, 513, 601, 0, 504, 0, 0, 516, 0, 103,
- 98, 0, 153, 517, 520, 0, 496, 0, 101, 0,
- 398, 396, 796, 759, 157, 157, 605, 157, 796, 759,
- 545, 79, 545, 85, 839, 838, 802, 802, 802, 0,
- 0, 0, 0, 599, 0, 0, 0, 0, 363, 0,
- 0, 0, 284, 0, 282, 283, 0, 223, 160, 256,
- 600, 601, 257, 258, 0, 0, 423, 452, 0, 250,
- 249, 751, 750, 0, 247, 246, 244, 245, 243, 242,
- 241, 238, 239, 240, 236, 237, 231, 232, 233, 234,
- 235, 229, 230, 0, 0, 0, 0, 0, 0, 206,
- 220, 0, 0, 205, 545, 545, 0, 545, 542, 639,
- 0, 0, 0, 0, 0, 308, 0, 312, 0, 314,
- 0, 648, 647, 644, 643, 792, 0, 0, 663, 0,
- 0, 796, 338, 796, 650, 545, 759, 549, 649, 645,
- 0, 0, 545, 0, 0, 0, 0, 0, 260, 150,
- 143, 141, 150, 0, 455, 0, 454, 190, 189, 188,
- 187, 405, 0, 0, 25, 0, 26, 619, 0, 47,
- 44, 45, 0, 40, 0, 0, 649, 645, 0, 783,
- 545, 786, 788, 0, 784, 785, 46, 461, 0, 140,
- 150, 150, 138, 18, 20, 386, 127, 115, 128, 129,
- 0, 108, 111, 0, 0, 0, 0, 675, 669, 419,
- 0, 106, 554, 551, 765, 782, 771, 769, 0, 552,
- 764, 781, 770, 768, 763, 795, 778, 789, 779, 772,
- 777, 798, 0, 390, 568, 567, 389, 487, 0, 486,
- 793, 793, 793, 0, 545, 759, 512, 505, 517, 506,
- 398, 398, 502, 503, 500, 501, 545, 759, 256, 600,
- 0, 385, 99, 508, 518, 523, 524, 385, 385, 0,
- 0, 385, 97, 509, 521, 385, 497, 498, 499, 398,
- 0, 448, 78, 0, 0, 0, 0, 84, 0, 796,
- 759, 796, 759, 804, 803, 805, 261, 293, 201, 203,
- 299, 300, 0, 0, 0, 0, 283, 286, 0, 0,
- 0, 0, 224, 0, 287, 289, 218, 217, 208, 0,
- 207, 222, 0, 0, 636, 634, 0, 637, 549, 213,
- 0, 0, 157, 315, 0, 0, 0, 646, 642, 653,
- 545, 662, 660, 661, 651, 796, 0, 658, 0, 597,
- 598, 0, 304, 148, 150, 150, 146, 541, 539, 443,
- 0, 404, 402, 256, 0, 23, 626, 48, 43, 50,
- 54, 648, 644, 649, 645, 0, 561, 0, 545, 650,
- 52, 136, 134, 0, 113, 0, 117, 0, 119, 0,
- 121, 0, 726, 0, 180, 677, 0, 670, 671, 0,
- 420, 649, 645, 0, 278, 0, 595, 790, 0, 0,
- 799, 800, 0, 0, 387, 0, 0, 0, 489, 488,
- 481, 796, 0, 507, 416, 416, 796, 0, 0, 0,
- 398, 398, 0, 398, 398, 0, 398, 0, 416, 0,
- 436, 545, 263, 262, 264, 545, 81, 0, 87, 0,
- 0, 0, 0, 0, 0, 426, 0, 424, 227, 248,
- 0, 209, 210, 219, 221, 635, 633, 640, 638, 0,
- 214, 0, 0, 307, 311, 313, 796, 656, 545, 657,
- 144, 142, 440, 0, 407, 409, 648, 644, 566, 650,
- 114, 112, 0, 0, 0, 0, 414, 0, 0, 256,
- 600, 601, 678, 691, 694, 697, 702, 0, 0, 0,
- 0, 0, 0, 257, 723, 728, 0, 747, 0, 686,
- 0, 0, 363, 0, 665, 684, 690, 664, 685, 724,
- 0, 672, 421, 0, 598, 780, 774, 775, 773, 0,
- 797, 391, 0, 484, 485, 479, 94, 545, 511, 515,
- 96, 545, 398, 398, 532, 416, 256, 600, 0, 519,
- 525, 526, 385, 385, 416, 416, 0, 416, 522, 510,
- 0, 796, 796, 545, 545, 0, 0, 0, 0, 425,
- 0, 0, 211, 641, 316, 262, 659, 796, 0, 116,
- 118, 120, 733, 727, 731, 0, 673, 668, 183, 740,
- 742, 743, 0, 0, 682, 0, 0, 0, 709, 711,
- 712, 713, 0, 0, 0, 741, 0, 334, 748, 0,
- 687, 332, 385, 0, 333, 0, 385, 0, 0, 0,
- 181, 667, 666, 688, 722, 721, 283, 801, 388, 796,
- 796, 531, 528, 530, 0, 0, 398, 398, 398, 527,
- 529, 514, 438, 0, 437, 432, 77, 83, 796, 796,
- 295, 296, 297, 298, 427, 544, 655, 408, 0, 732,
- 415, 172, 0, 679, 692, 681, 0, 0, 0, 0,
- 0, 705, 0, 714, 0, 720, 729, 0, 330, 331,
- 0, 0, 0, 329, 182, 682, 93, 95, 398, 398,
- 537, 416, 416, 0, 0, 450, 80, 86, 0, 734,
- 179, 0, 363, 0, 682, 0, 695, 683, 669, 745,
- 698, 0, 0, 0, 0, 710, 719, 0, 0, 689,
- 536, 534, 533, 535, 435, 434, 428, 68, 71, 0,
- 0, 0, 173, 385, 680, 184, 693, 186, 0, 746,
- 0, 744, 703, 707, 706, 730, 752, 0, 0, 433,
- 738, 739, 735, 398, 669, 170, 0, 0, 176, 0,
- 175, 682, 0, 0, 0, 753, 754, 715, 431, 0,
- 430, 0, 185, 0, 696, 699, 704, 708, 0, 752,
- 0, 0, 429, 177, 171, 0, 0, 0, 716, 755,
- 0, 0, 756, 0, 0, 178, 700, 757, 0, 717,
- 0, 0, 0, 701, 758, 718, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 311, 0,
+ 313, 315, 316, 354, 353, 0, 0, 238, 238, 0,
+ 224, 573, 0, 232, 351, 343, 0, 0, 823, 332,
+ 335, 336, 0, 0, 363, 679, 675, 684, 0, 579,
+ 575, 575, 575, 365, 682, 0, 629, 367, 0, 0,
+ 366, 331, 0, 326, 345, 327, 347, 626, 0, 328,
+ 173, 173, 0, 165, 0, 389, 163, 570, 480, 568,
+ 467, 0, 0, 398, 0, 0, 399, 400, 401, 437,
+ 438, 439, 436, 0, 429, 432, 0, 3, 0, 645,
+ 176, 648, 0, 41, 42, 0, 53, 0, 0, 57,
+ 61, 50, 822, 817, 0, 368, 389, 53, 369, 821,
+ 59, 168, 153, 151, 168, 173, 296, 610, 609, 300,
+ 613, 0, 18, 20, 89, 9, 9, 73, 72, 0,
+ 128, 352, 0, 706, 91, 704, 448, 0, 444, 443,
+ 212, 0, 211, 580, 617, 0, 799, 0, 794, 389,
+ 0, 793, 795, 824, 806, 0, 0, 615, 586, 585,
+ 0, 0, 600, 0, 419, 418, 406, 599, 0, 826,
+ 589, 377, 408, 420, 424, 493, 630, 631, 823, 0,
+ 823, 632, 506, 507, 509, 823, 512, 511, 0, 543,
+ 631, 0, 534, 0, 0, 546, 0, 121, 116, 0,
+ 171, 547, 550, 0, 526, 0, 119, 0, 424, 0,
+ 422, 826, 792, 176, 176, 635, 176, 826, 792, 575,
+ 97, 575, 103, 869, 868, 832, 832, 832, 0, 0,
+ 0, 0, 629, 0, 0, 0, 0, 389, 0, 0,
+ 0, 307, 0, 305, 306, 0, 245, 179, 279, 630,
+ 631, 280, 281, 0, 0, 449, 478, 0, 272, 271,
+ 784, 783, 0, 269, 268, 266, 267, 265, 264, 263,
+ 260, 261, 262, 258, 259, 253, 254, 255, 256, 257,
+ 251, 252, 0, 0, 0, 0, 0, 238, 226, 242,
+ 0, 0, 225, 575, 575, 0, 575, 572, 669, 0,
+ 0, 0, 0, 0, 334, 0, 338, 0, 340, 0,
+ 678, 677, 674, 673, 822, 0, 0, 693, 0, 0,
+ 826, 364, 826, 680, 575, 792, 579, 679, 675, 0,
+ 0, 575, 0, 0, 0, 0, 0, 170, 172, 283,
+ 168, 161, 159, 168, 0, 481, 0, 480, 210, 209,
+ 208, 207, 431, 0, 0, 24, 0, 0, 649, 0,
+ 38, 44, 43, 55, 52, 53, 0, 48, 0, 0,
+ 679, 675, 0, 813, 575, 816, 818, 0, 814, 815,
+ 54, 488, 0, 158, 168, 168, 156, 169, 17, 19,
+ 69, 89, 412, 145, 133, 146, 147, 0, 126, 129,
+ 0, 0, 0, 0, 705, 699, 445, 0, 124, 584,
+ 581, 798, 812, 801, 0, 582, 797, 811, 800, 796,
+ 825, 808, 819, 809, 802, 807, 828, 0, 416, 598,
+ 597, 415, 516, 0, 515, 823, 823, 823, 0, 575,
+ 792, 542, 535, 547, 536, 424, 424, 532, 533, 530,
+ 531, 575, 792, 279, 630, 0, 411, 117, 538, 548,
+ 553, 554, 411, 411, 0, 0, 411, 115, 539, 551,
+ 411, 527, 528, 529, 424, 525, 474, 0, 96, 0,
+ 0, 0, 0, 102, 0, 826, 792, 826, 792, 834,
+ 833, 835, 284, 318, 221, 223, 324, 325, 0, 0,
+ 0, 0, 306, 309, 0, 0, 0, 0, 246, 0,
+ 310, 312, 314, 0, 0, 0, 0, 227, 244, 0,
+ 0, 666, 664, 0, 667, 579, 233, 0, 0, 176,
+ 341, 0, 0, 0, 676, 672, 683, 575, 692, 690,
+ 691, 681, 826, 0, 688, 0, 627, 628, 0, 330,
+ 166, 168, 168, 164, 571, 569, 469, 0, 430, 428,
+ 279, 0, 22, 30, 656, 56, 51, 58, 62, 678,
+ 674, 679, 675, 0, 591, 0, 575, 680, 60, 154,
+ 152, 68, 0, 131, 0, 135, 0, 137, 0, 139,
+ 0, 759, 0, 200, 707, 0, 700, 701, 0, 446,
+ 679, 675, 0, 301, 0, 625, 820, 0, 0, 829,
+ 830, 0, 0, 413, 0, 0, 0, 518, 517, 510,
+ 826, 0, 537, 442, 442, 826, 0, 0, 0, 424,
+ 424, 0, 424, 424, 0, 424, 0, 442, 462, 575,
+ 286, 285, 287, 575, 99, 0, 105, 0, 0, 0,
+ 0, 0, 0, 452, 0, 450, 249, 270, 240, 239,
+ 237, 228, 0, 241, 243, 665, 663, 670, 668, 0,
+ 234, 0, 0, 333, 337, 339, 826, 686, 575, 687,
+ 162, 160, 466, 0, 433, 435, 678, 674, 596, 680,
+ 132, 130, 0, 0, 0, 0, 440, 0, 0, 279,
+ 630, 631, 708, 721, 724, 727, 732, 0, 0, 0,
+ 0, 0, 0, 0, 0, 280, 753, 761, 0, 780,
+ 757, 756, 755, 0, 716, 0, 0, 389, 0, 695,
+ 714, 720, 694, 715, 754, 0, 702, 447, 0, 628,
+ 810, 804, 805, 803, 0, 827, 417, 0, 513, 514,
+ 508, 112, 575, 541, 545, 114, 575, 424, 424, 562,
+ 442, 279, 630, 0, 549, 555, 556, 411, 411, 442,
+ 442, 0, 442, 552, 540, 0, 826, 826, 575, 575,
+ 0, 0, 0, 0, 451, 0, 0, 229, 230, 671,
+ 342, 285, 689, 826, 0, 134, 136, 138, 766, 760,
+ 764, 0, 703, 698, 203, 773, 775, 776, 0, 0,
+ 712, 0, 0, 0, 739, 741, 742, 743, 0, 0,
+ 0, 0, 0, 0, 0, 774, 0, 360, 781, 0,
+ 717, 358, 411, 0, 359, 0, 411, 0, 0, 0,
+ 201, 697, 696, 718, 752, 751, 306, 831, 414, 826,
+ 826, 561, 558, 560, 0, 0, 424, 424, 424, 557,
+ 559, 544, 464, 0, 463, 458, 95, 101, 826, 826,
+ 320, 321, 322, 323, 453, 0, 231, 685, 434, 0,
+ 765, 441, 192, 0, 709, 722, 711, 0, 0, 0,
+ 0, 0, 735, 0, 744, 0, 750, 39, 144, 34,
+ 144, 0, 35, 762, 0, 356, 357, 0, 0, 0,
+ 355, 202, 712, 111, 113, 424, 424, 567, 442, 442,
+ 0, 0, 476, 98, 104, 574, 0, 767, 199, 0,
+ 389, 0, 712, 0, 725, 713, 699, 778, 728, 0,
+ 0, 0, 0, 740, 749, 40, 36, 0, 0, 719,
+ 566, 564, 563, 565, 461, 460, 454, 86, 89, 0,
+ 0, 0, 193, 411, 710, 204, 723, 206, 0, 779,
+ 0, 777, 733, 737, 736, 763, 785, 0, 0, 459,
+ 771, 772, 768, 424, 699, 190, 0, 0, 196, 0,
+ 195, 712, 0, 0, 0, 786, 787, 745, 457, 0,
+ 456, 0, 205, 0, 726, 729, 734, 738, 0, 785,
+ 0, 0, 455, 197, 191, 0, 0, 0, 746, 788,
+ 0, 0, 789, 0, 0, 198, 730, 790, 0, 747,
+ 0, 0, 0, 731, 791, 748, 0, 0, 0
};
-static const short yydefgoto[] = { 1547,
- 409, 2, 410, 160, 669, 311, 165, 3, 4, 38,
- 633, 353, 738, 375, 40, 739, 385, 644, 900, 645,
- 646, 647, 42, 43, 421, 168, 164, 44, 740, 754,
- 1021, 760, 1023, 46, 741, 742, 169, 170, 422, 672,
- 932, 933, 613, 934, 218, 47, 922, 921, 660, 657,
- 1086, 1085, 883, 880, 135, 920, 48, 49, 529, 312,
- 313, 314, 315, 1249, 1498, 1404, 1500, 1442, 1531, 1126,
- 1477, 1495, 347, 872, 316, 566, 834, 317, 318, 348,
- 320, 338, 51, 236, 377, 398, 52, 53, 321, 524,
- 322, 323, 324, 325, 423, 326, 1250, 462, 588, 327,
- 1251, 55, 201, 650, 328, 202, 502, 203, 181, 194,
- 59, 445, 463, 1273, 707, 1144, 182, 195, 60, 473,
- 708, 61, 62, 629, 630, 631, 1228, 428, 797, 798,
- 1468, 1469, 1436, 1385, 1301, 63, 617, 341, 1171, 1386,
- 1042, 886, 64, 65, 66, 67, 222, 68, 69, 70,
- 224, 725, 726, 727, 728, 226, 470, 471, 746, 747,
- 748, 994, 1004, 995, 1290, 996, 997, 1291, 1292, 614,
- 615, 567, 862, 330, 431, 432, 175, 183, 72, 73,
- 74, 184, 185, 152, 76, 131, 331, 332, 333, 78,
- 334, 80, 730, 122, 123, 124, 478, 104, 81, 335,
- 839, 840, 857, 591, 1254, 1255, 1127, 1128, 1129, 676,
- 1256, 939, 1257, 1333, 1445, 1407, 1408, 1258, 1259, 1426,
- 1334, 1446, 1335, 1479, 1336, 1481, 1526, 1541, 1337, 1502,
- 1455, 1503, 1413, 424, 673, 1226, 1260, 1347, 1458, 1324,
- 1325, 1399, 1472, 1444, 1440, 1261, 1451, 1350, 804, 1505,
- 1506, 1507, 1539, 693, 694, 961, 1140, 1269, 695, 696,
- 697, 957, 698, 145, 959, 700, 1142, 1143, 496, 83,
- 84
+static const short yydefgoto[] = { 1607,
+ 424, 2, 425, 161, 694, 327, 177, 3, 4, 37,
+ 658, 369, 1291, 659, 766, 1292, 1293, 389, 1394, 663,
+ 41, 767, 398, 669, 934, 670, 671, 672, 43, 168,
+ 169, 44, 443, 180, 176, 45, 46, 783, 1057, 789,
+ 1059, 47, 769, 770, 181, 182, 444, 701, 969, 970,
+ 638, 971, 230, 48, 956, 955, 685, 682, 1123, 1122,
+ 914, 911, 136, 954, 49, 50, 908, 551, 328, 329,
+ 330, 331, 1294, 1558, 1455, 1560, 1500, 1591, 1165, 1537,
+ 1555, 363, 901, 332, 1232, 856, 590, 863, 333, 334,
+ 364, 336, 354, 52, 251, 664, 413, 53, 54, 337,
+ 546, 338, 339, 340, 341, 445, 342, 1295, 484, 612,
+ 343, 1296, 56, 213, 675, 344, 214, 524, 215, 193,
+ 206, 60, 467, 485, 1318, 735, 1183, 194, 207, 61,
+ 495, 736, 62, 63, 654, 655, 656, 1268, 450, 826,
+ 827, 1528, 1529, 1493, 1435, 1346, 64, 642, 357, 1209,
+ 1436, 1078, 917, 65, 66, 67, 68, 69, 237, 70,
+ 71, 239, 753, 754, 755, 756, 241, 492, 493, 780,
+ 774, 775, 776, 1029, 1039, 1030, 1335, 1031, 1032, 1336,
+ 1337, 639, 640, 591, 891, 346, 453, 454, 187, 195,
+ 73, 74, 75, 196, 197, 153, 77, 132, 347, 348,
+ 349, 79, 350, 81, 758, 123, 124, 125, 500, 105,
+ 82, 351, 868, 869, 886, 615, 1299, 1300, 1166, 1167,
+ 1168, 705, 1301, 976, 1302, 1379, 1503, 1458, 1459, 1303,
+ 1304, 1483, 1380, 1504, 1381, 1539, 1382, 1541, 1586, 1601,
+ 1383, 1562, 1513, 1563, 1464, 446, 702, 1266, 1305, 1397,
+ 1518, 1370, 1371, 1450, 1532, 1502, 1498, 1306, 1509, 1400,
+ 833, 1565, 1566, 1567, 1599, 721, 722, 996, 1179, 1314,
+ 723, 724, 725, 992, 726, 146, 994, 728, 1181, 1182,
+ 518, 84, 85
};
-static const short yypact[] = { 125,
- 130,-32768,-32768, 3240,-32768, 195, 72, 188, 284, 151,
- 102,-32768,-32768, 1117,-32768,-32768, 136, 176, 198,-32768,
--32768,-32768, 1085, 1187, 1489, 256,-32768, 304, 367,-32768,
- 2407, 2407,-32768, 4859,-32768, 3240, 294,-32768, 352, 91,
- 5970,-32768,-32768, 208, 1265, 379, 356, 372,-32768,-32768,
--32768,-32768, 330, 2553,-32768, 10199,-32768, 1350, 498,-32768,
- 423,-32768,-32768, 1046,-32768,-32768, 399,-32768,-32768, 417,
- 4154,-32768,-32768,-32768, 784,-32768,-32768,-32768, 849,-32768,
--32768, 508, 5609, 408,-32768,-32768, 9052,-32768, 9052,-32768,
- 9052,-32768,-32768,-32768, 188, 284, 304, 445, 453, 492,
- 372,-32768, 1409,-32768, 508, 9052, 9052, 480,-32768,-32768,
--32768,-32768,-32768, 64, 528, 368, 383, 478, 538, 553,
--32768,-32768, 564,-32768, 572, 188, 284, 1112, 304, 445,
--32768, 855, 467, 509, 10350, 9052,-32768, 9052, 2926,-32768,
- 1285, 543, 2926,-32768, 1090, 3033, 3033, 4859, 524, 547,
- 517, 552, 555,-32768,-32768, 627,-32768, 556,-32768, 10084,
- 195,-32768,-32768,-32768, 582, 423, 691, 145, 179, 624,
--32768,-32768, 592, 250,-32768,-32768, 3416, 3416, 4989, 784,
- 591,-32768,-32768, 387,-32768,-32768, 2806,-32768,-32768,-32768,
--32768,-32768, 1350, 641,-32768, 423, 784,-32768,-32768,-32768,
- 1578, 1350,-32768, 423,-32768, 5186,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 372, 988,
- 1434, 399,-32768,-32768,-32768,-32768,-32768, 682, 508,-32768,
- 497, 963,-32768, 271,-32768,-32768,-32768,-32768,-32768, 3988,
--32768,-32768, 590,-32768, 617, 620,-32768,-32768,-32768,-32768,
- 658,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+static const short yypact[] = { 129,
+ 148,-32768,-32768, 10535,-32768, 92, 171, 272, 418, 199,
+ 124,-32768,-32768, 917,-32768, 270, 355, 360,-32768,-32768,
+-32768, 1076, 1285, 1017, 216,-32768, 409, 499,-32768, 1618,
+ 1618,-32768, 4295,-32768, 10535, 415,-32768,-32768, 457,-32768,
+ 56, 4736,-32768,-32768, 412, 903, 509, 492, 505,-32768,
+-32768,-32768,-32768, 404, 1979,-32768, 4015,-32768, 2281, 329,
+-32768, 560,-32768,-32768, 798, 328,-32768, 548,-32768,-32768,
+ 567, 3285,-32768,-32768,-32768, 580,-32768,-32768,-32768, 1021,
+-32768,-32768, 274, 7834, 555,-32768,-32768, 9429,-32768, 9429,
+-32768, 9429,-32768,-32768,-32768, 272, 418, 409, 578, 563,
+ 600, 505,-32768, 760,-32768, 274, 9515, 9515, 607,-32768,
+-32768,-32768,-32768,-32768, 601, 648, 549, 665, 680, 663,
+ 670,-32768,-32768, 1357,-32768, 1247, 272, 418,-32768, 409,
+ 578,-32768, 690, 1972, 657, 5887, 9429,-32768, 9429, 2223,
+-32768, 2434, 402, 2223,-32768, 1599, 2316, 2316, 4295, 641,
+ 654, 649, 658, 679,-32768,-32768, 781,-32768, 685,-32768,
+ 3410,-32768,-32768, 216, 3278, 722,-32768,-32768,-32768, 412,
+ 4520, 10740, 737, 749,-32768,-32768, 735, 560, 843, 98,
+ 689, 791,-32768,-32768, 736, 66,-32768,-32768, 2840, 2840,
+ 4591, 580, 855,-32768,-32768, 540,-32768,-32768, 2691,-32768,
+-32768,-32768,-32768,-32768, 2281, 878,-32768, 560, 580,-32768,
+-32768,-32768, 2369, 2281,-32768, 560,-32768, 4520,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ 505, 560, 1485, 1636,-32768,-32768, 548,-32768,-32768,-32768,
+-32768,-32768, 1027, 274,-32768, 217, 1224,-32768, 94,-32768,
+-32768,-32768,-32768,-32768, 2883,-32768,-32768, 229,-32768, 765,
+ 769,-32768,-32768,-32768,-32768, 811,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768, 616,-32768,-32768, 682, 4154, 1158,-32768,
--32768, 646,-32768,-32768, 9667, 9754, 9841, 9841,-32768,-32768,
--32768,-32768,-32768, 668, 701, 711, 721, 732, 445, 9139,
- 1090, 9841,-32768,-32768, 9841,-32768,-32768, 9841, 7165,-32768,
- 9841, 223, 683,-32768, 9841,-32768, 9226,-32768, 10446,-32768,
- 1514, 1785, 9313,-32768, 799, 2426,-32768, 953, 3686, 4007,
--32768, 307,-32768, 1524, 1858, 223, 223, 9052, 10350,-32768,
- 1090, 703, 1090,-32768,-32768, 708, 768, 10596, 724, 733,
- 738, 945, 556,-32768, 1112,-32768,-32768,-32768,-32768,-32768,
--32768, 528, 368, 383, 1090, 478, 538, 793, 553,-32768,
- 776,-32768, 188, 284, 814,-32768,-32768,-32768, 467,-32768,
--32768,-32768,-32768,-32768, 4967,-32768,-32768, 5186, 5373, 1679,
--32768, 223, 809,-32768, 775,-32768,-32768,-32768, 2926,-32768,
--32768, 2926,-32768, 760,-32768,-32768, 3988, 87, 761, 777,
--32768,-32768,-32768, 627,-32768, 423,-32768,-32768,-32768,-32768,
- 148,-32768,-32768,-32768,-32768, 7257, 9139,-32768,-32768,-32768,
- 9139, 779,-32768, 6493, 100, 4306,-32768, 4306,-32768, 4584,
- 4584, 4989, 790,-32768, 423, 5186,-32768, 783,-32768,-32768,
- 4619, 1578, 1350, 5186,-32768, 423,-32768,-32768, 423, 1578,
--32768, 811,-32768,-32768, 372,-32768, 988,-32768, 1220, 1675,
- 57, 682, 423,-32768,-32768, 836, 852, 876, 858,-32768,
--32768,-32768,-32768, 532,-32768, 338, 821, 826,-32768,-32768,
- 682,-32768,-32768, 822,-32768,-32768, 9052, 9139, 646, 7165,
--32768, 437, 7165,-32768,-32768,-32768, 9052, 5977, 5977, 5977,
- 5977, 10641,-32768,-32768,-32768,-32768, 832, 9928, 9928, 7165,
- 851, 524, 863, 887, 867,-32768,-32768,-32768,-32768, 9052,
--32768, 6790, 7165,-32768, 9139, 9139, 7349, 9139, 9139, 9139,
- 9139, 9139, 9139, 9139, 9139, 9139, 9139, 9139, 9139, 9139,
- 9139, 9139, 9139, 9139, 9139, 9139,-32768,-32768,-32768,-32768,
--32768, 9139, 9139, 9139, 9052, 2857, 366, 440, 7988,-32768,
--32768,-32768, 880, 963, 972, 444, 523, 530, 2780, 543,
--32768, 1687, 1687,-32768, 4837, 868, 877, 948,-32768,-32768,
- 502, 8495, 725,-32768, 860, 508,-32768,-32768, 9139,-32768,
--32768,-32768,-32768, 249,-32768,-32768,-32768, 223,-32768, 5186,
- 1998,-32768, 933, 939,-32768,-32768, 1090, 793,-32768, 7717,
- 7809,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 79,-32768,
- 906, 895, 556, 951, 961, 9052,-32768,-32768,-32768,-32768,
- 1386, 256, 990, 206, 970, 971,-32768,-32768, 2152, 10406,
- 2152, 4432, 1046, 10143,-32768, 973,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 929,-32768, 979,-32768,-32768, 208,
- 89, 460, 993, 887,-32768,-32768,-32768,-32768, 6695, 10641,
--32768, 768, 947, 10596,-32768,-32768, 952,-32768,-32768, 967,
- 160, 5318, 969,-32768, 169, 5796, 996, 1015, 561,-32768,
--32768,-32768, 4306, 4306,-32768, 4619,-32768, 1016,-32768,-32768,
- 995, 100,-32768, 1578,-32768,-32768, 423,-32768, 368, 383,
--32768, 964,-32768, 553, 1022,-32768,-32768, 120,-32768,-32768,
- 1492,-32768, 589, 669,-32768, 9139, 5517,-32768, 5517, 335,
- 335, 217, 585, 2595, 10244, 2284,-32768, 225, 335, 1043,
- 423,-32768, 100, 2575, 9052, 9052,-32768, 9052, 100, 2575,
--32768,-32768,-32768,-32768,-32768,-32768, 649, 649, 649, 223,
- 975, 1000, 9406, 948, 1004, 1014, 1019, 1059, 4066, 1060,
- 1074, 1079,-32768, 1058,-32768,-32768, 1068,-32768,-32768, 1118,
- 787, 900, 65, 431, 9139, 1120,-32768, 1124, 1070, 10641,
- 10641,-32768,-32768, 1123, 5412, 5667, 3513, 5693, 4244, 3542,
- 3712, 1983, 1983, 1983, 1691, 1691, 1237, 1237, 756, 756,
- 756,-32768,-32768, 1084, 1082, 1086, 1095, 1097, 5977, 366,
--32768, 7257, 9139,-32768,-32768,-32768, 9139,-32768,-32768, 1105,
- 9841, 1099, 1119, 1136, 1166,-32768, 9139,-32768, 9139,-32768,
- 9139, 2683,-32768, 2683,-32768, 140, 1109, 1110,-32768, 1113,
- 5977, 100,-32768, 100, 4679,-32768, 2575, 1125, 8687, 8687,
- 6301, 1121, 9226, 1122, 3050, 1858, 984, 1130,-32768,-32768,
--32768,-32768,-32768, 9139, 1090, 1138, 939,-32768, 10641,-32768,
- 10641, 945, 1137, 9493,-32768, 1141,-32768,-32768, 223,-32768,
--32768, 1364, 4967,-32768, 5977, 9052, 2037, 2037, 3864,-32768,
--32768,-32768,-32768, 2806,-32768,-32768,-32768, 61, 9139,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, 528,-32768, 478, 538,
- 9139, 1170,-32768, 587, 601, 622, 887,-32768, 71,-32768,
- 55,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 8591,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, 1015, 1168,-32768,
--32768,-32768, 5977,-32768,-32768,-32768, 1190,-32768, 9052,-32768,
--32768,-32768,-32768, 1345,-32768, 2575, 10641,-32768, 1904,-32768,
- 423, 423,-32768,-32768,-32768,-32768,-32768, 2575, 232, 915,
- 9139, 811,-32768, 1196,-32768,-32768,-32768, 343, 391, 849,
- 543, 686, 335, 1199,-32768, 901,-32768,-32768,-32768, 423,
- 4219,-32768,-32768, 1154, 223, 223, 223,-32768, 1157, 100,
- 2575, 100, 2575,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, 1175, 1176, 1177, 1179, 929,-32768, 10528, 7257,
- 6885, 1163,-32768, 9139,-32768,-32768,-32768,-32768, 825, 1172,
--32768,-32768, 1173, 66, 285, 285, 1167, 285,-32768,-32768,
- 9841, 1268, 9052,-32768, 1185, 1186, 1188,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768, 100, 1191,-32768, 1192,-32768,
--32768, 3120,-32768,-32768,-32768,-32768,-32768, 10641,-32768,-32768,
- 1189,-32768,-32768, 227, 1197,-32768,-32768,-32768,-32768,-32768,
--32768, 2938, 2938, 3140, 3140, 3864,-32768, 2806,-32768, 3487,
- 10446,-32768,-32768, 1200,-32768, 460,-32768, 9139,-32768, 9139,
--32768, 9139,-32768, 1090,-32768,-32768, 6207, 1275,-32768, 6977,
--32768, 8780, 8780, 6397, 183, 1205, 254,-32768, 7257, 7069,
--32768,-32768, 240, 7257,-32768, 1214, 1218, 1220,-32768,-32768,
--32768, 100, 1219,-32768, 1266, 1266, 100, 1222, 9139, 9139,
- 10506, 423, 3309, 423, 423, 1160, 423, 4478, 1266, 5125,
--32768,-32768,-32768, 1278,-32768,-32768,-32768, 1225,-32768, 1226,
- 9139, 9139, 9139, 9139, 7257,-32768, 1276,-32768,-32768, 10641,
- 9139,-32768, 825,-32768,-32768,-32768,-32768,-32768,-32768, 1228,
--32768, 1290, 223,-32768,-32768,-32768, 100,-32768,-32768,-32768,
--32768,-32768,-32768, 9139,-32768,-32768, 2938, 2938,-32768, 3487,
--32768,-32768, 1234, 1236, 1244, 1250,-32768, 786, 242, 1297,
- 1021, 1023,-32768,-32768,-32768,-32768,-32768, 9139, 1300, 1304,
- 1309, 8873, 257, 415,-32768,-32768, 8965, 1366, 1316,-32768,
- 4706, 10305, 10451, 6095,-32768,-32768, 1362,-32768,-32768,-32768,
- 8099,-32768,-32768, 1273, 1916,-32768,-32768,-32768,-32768, 5977,
--32768,-32768, 7257,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, 10506, 10506,-32768, 1266, 695, 1083, 9139,-32768,
--32768,-32768, 811, 811, 1266, 1266, 532, 1266,-32768,-32768,
- 5854, 100, 100,-32768,-32768, 1282, 1284, 1298, 1308,-32768,
- 7257, 1310,-32768,-32768,-32768,-32768,-32768, 100, 1314,-32768,
--32768,-32768,-32768, 1250,-32768, 1090,-32768,-32768,-32768,-32768,
--32768,-32768, 629, 629, 887, 1292, 1294, 10484,-32768,-32768,
--32768,-32768, 1334, 9139, 1369,-32768, 887,-32768,-32768, 1338,
--32768,-32768, 811, 823,-32768, 861, 811, 9580, 864, 266,
--32768,-32768,-32768,-32768,-32768,-32768, 339,-32768,-32768, 100,
- 100,-32768,-32768,-32768, 9139, 9139, 10506, 423, 423,-32768,
--32768,-32768,-32768, 7901,-32768,-32768,-32768,-32768, 100, 100,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1339,-32768,
--32768,-32768, 9052,-32768,-32768,-32768, 1435, 8401, 6603, 9052,
- 9139,-32768, 8209,-32768, 1394,-32768,-32768, 627,-32768,-32768,
- 10015, 10015, 7441,-32768,-32768, 887,-32768,-32768, 10506, 10506,
--32768, 1266, 1266, 1347, 10550, 1358,-32768,-32768, 5257,-32768,
--32768, 1349, 443, 5186, 887, 8305,-32768,-32768, 71,-32768,
--32768, 1402, 1359, 10619, 8209,-32768,-32768, 1250, 78,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, 379, 208, 1360,
- 1361, 887,-32768, 811,-32768,-32768,-32768,-32768, 638,-32768,
- 7533,-32768,-32768,-32768,-32768, 1250, 1457, 1411, 156,-32768,
--32768,-32768,-32768, 423, 71,-32768, 9139, 1413,-32768, 1414,
--32768, 887, 8209, 1382, 53, 1418,-32768,-32768,-32768, 148,
--32768, 1415,-32768, 1371,-32768,-32768,-32768,-32768, 9139, 1457,
- 1421, 1457,-32768,-32768,-32768, 7625, 1373, 158,-32768,-32768,
- 7257, 1377,-32768, 1479, 1439,-32768,-32768,-32768, 301,-32768,
- 8305, 1490, 1442,-32768,-32768,-32768, 1508, 1509,-32768
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 764,-32768,
+-32768, 1027, 3285, 814,-32768,-32768, 790,-32768,-32768, 10123,
+ 10209, 10295, 10295,-32768,-32768,-32768,-32768,-32768, 800, 825,
+ 834, 853, 870, 1090, 578, 9601, 1697, 10295,-32768,-32768,
+ 10295,-32768,-32768, 10295, 7312,-32768, 10295, 181, 894,-32768,
+ 10295,-32768, 9687,-32768, 10982, 370, 1912, 4227, 9773,-32768,
+ 948, 2212,-32768, 1316, 3488, 3177,-32768, 380,-32768, 1589,
+ 1575, 181, 181, 9429, 5887,-32768, 1697, 857, 1697,-32768,
+-32768, 871, 934, 10915, 889, 902, 908, 1438, 685,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, 648, 549, 665,
+ 1697, 680, 663, 932, 670,-32768, 969,-32768, 3160, 272,
+ 418,-32768,-32768,-32768,-32768,-32768,-32768, 4962,-32768, 4520,
+ 5717, 557,-32768, 181, 865,-32768, 366,-32768, 977, 985,
+-32768,-32768,-32768, 2223,-32768,-32768, 2223,-32768, 935,-32768,
+-32768, 2883, 96, 951, 957,-32768,-32768,-32768,-32768, 5887,
+-32768, 890, 897,-32768,-32768, 781,-32768, 560,-32768,-32768,
+-32768,-32768, 145,-32768,-32768,-32768,-32768, 7403, 9601,-32768,
+-32768,-32768, 9601, 973,-32768, 6666, 131, 3139,-32768, 3139,
+-32768, 3732, 3732, 4591, 978,-32768, 560, 4520,-32768, 974,
+-32768,-32768, 3884, 2369, 2281, 4520,-32768, 560,-32768,-32768,
+ 560, 2369,-32768, 1061,-32768,-32768, 505,-32768, 1485,-32768,
+ 1755, 5946, 61, 1027, 560,-32768,-32768, 991, 1015, 1037,
+ 1019,-32768,-32768,-32768,-32768, 387,-32768, 392, 983, 986,
+-32768,-32768, 1027,-32768,-32768, 466,-32768,-32768, 9429, 9601,
+ 790, 7312,-32768, 400, 7312,-32768,-32768,-32768, 9515, 3739,
+ 3739, 3739, 3739, 10960,-32768,-32768,-32768,-32768, 990, 10381,
+ 10381, 7312, 995, 50, 999, 1050, 1003,-32768,-32768,-32768,
+-32768, 9429,-32768, 6942, 7312,-32768, 9601, 9601, 7494, 9601,
+ 9601, 9601, 9601, 9601, 9601, 9601, 9601, 9601, 9601, 9601,
+ 9601, 9601, 9601, 9601, 9601, 9601, 9601, 9601,-32768, 9601,
+-32768,-32768,-32768,-32768,-32768, 9601, 9601,-32768,-32768, 4867,
+ 796, 610, 8194,-32768,-32768,-32768, 1065, 1224, 1112, 448,
+ 502, 520, 1832, 402,-32768, 1177, 1177,-32768, 2598, 1012,
+ 1031, 1080,-32768,-32768, 575, 8884, 956,-32768, 711, 274,
+-32768,-32768, 9601,-32768,-32768,-32768,-32768,-32768, 562, 555,
+-32768,-32768, 181,-32768, 4520, 2080,-32768, 1067, 1070,-32768,
+-32768, 1697, 932,-32768, 7926, 8017,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768, 141,-32768, 1049, 1039, 685, 3160, 1093,
+ 9429,-32768, 1091,-32768,-32768, 1972, 1328, 1116, 481, 1092,
+ 1096,-32768,-32768, 2423, 10740, 2423, 2100, 798, 4579,-32768,
+ 1102,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1046,
+-32768, 1097,-32768,-32768, 412,-32768,-32768,-32768,-32768, 97,
+ 362, 1106, 1050,-32768,-32768,-32768,-32768, 6848, 10960,-32768,
+ 934, 1062, 10915,-32768,-32768, 1063,-32768, 1066, 624, 2989,
+ 1072,-32768, 154, 5663, 1109, 1111, 577,-32768,-32768,-32768,
+ 3139, 3139,-32768, 3884,-32768, 1119,-32768,-32768, 1073, 131,
+-32768, 2369,-32768,-32768, 560,-32768, 549, 665,-32768, 1095,
+-32768, 670, 1133,-32768,-32768, 376,-32768,-32768, 1770,-32768,
+ 635, 785,-32768, 9601, 10613,-32768, 10613, 365, 365, 343,
+ 630, 3533, 5783, 8262,-32768, 191, 365, 1131, 560, 8332,
+-32768, 131, 4646, 9429, 9429,-32768, 9429, 131, 4646,-32768,
+-32768,-32768,-32768,-32768,-32768, 526, 526, 526, 181, 1086,
+ 1089, 9865, 1080, 1098, 1099, 1100, 1125, 3672, 1134, 1142,
+ 1146,-32768, 1114,-32768,-32768, 1115,-32768,-32768, 1163, 422,
+ 547, 325, 85, 9601, 1164,-32768, 1173, 1127, 10960, 10960,
+-32768,-32768, 1175, 4072, 3326, 5005, 3563, 5041, 4438, 2541,
+ 3040, 3040, 3040, 2262, 2262, 1391, 1391, 146, 146, 146,
+-32768,-32768, 1136, 1137, 1130, 9601, 9515,-32768, 796,-32768,
+ 7403, 9601,-32768,-32768,-32768, 9601,-32768,-32768, 1148, 10295,
+ 1143, 1178, 1198, 1226,-32768, 9601,-32768, 9601,-32768, 9601,
+ 1792,-32768, 1792,-32768, 103, 1166, 1168,-32768, 1171, 3739,
+ 131,-32768, 131, 2092,-32768, 4646, 1172, 9068, 9068, 6252,
+ 1176, 9687, 1183, 2753, 1575, 861, 1186,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768, 9601, 1697, 1197, 1070,-32768, 10960,
+-32768, 10960, 1438, 1202, 9951,-32768, 1204, 1255,-32768, 181,
+-32768,-32768,-32768,-32768,-32768, 1207, 4962,-32768, 3739, 9429,
+ 1346, 1346, 4301,-32768,-32768,-32768,-32768, 2691,-32768,-32768,
+-32768, 993, 9601,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 412,-32768, 648,-32768, 680, 663, 9601, 1227,-32768,
+ 637, 644, 667, 1050,-32768, 93,-32768, 117,-32768,-32768,
+-32768,-32768,-32768,-32768, 8976,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 1111, 1252,-32768,-32768,-32768, 3739,-32768,-32768,
+-32768, 1253,-32768, 9515,-32768,-32768,-32768,-32768, 875,-32768,
+ 4646, 10960,-32768, 1199,-32768, 560, 560,-32768,-32768,-32768,
+-32768,-32768, 4646, 523, 898, 9601, 1061,-32768, 1263,-32768,
+-32768,-32768, 197, 225, 1021, 402, 333, 365, 1267,-32768,
+ 462,-32768,-32768,-32768, 560,-32768,-32768, 8402,-32768, 1222,
+ 181, 181, 181,-32768, 1229, 131, 4646, 131, 4646,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1241, 1242,
+ 1245, 1250, 1046,-32768, 10848, 7403, 7036, 1231,-32768, 9601,
+-32768,-32768,-32768, 1239, 1246, 1248, 3739,-32768,-32768, 1249,
+ 361, 768, 768, 1257, 768,-32768,-32768, 10295, 1350, 9429,
+-32768, 1266, 1280, 1281,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 131, 1282,-32768, 1260,-32768,-32768, 2901,-32768,
+-32768,-32768,-32768,-32768, 10960,-32768,-32768, 1283,-32768,-32768,
+ 210, 1286,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1374,
+ 1374, 1710, 1710, 4301,-32768, 2691,-32768, 1851, 10982,-32768,
+-32768,-32768, 1287,-32768, 362,-32768, 9601,-32768, 9601,-32768,
+ 9601,-32768, 1697,-32768,-32768, 6460, 1342,-32768, 7127,-32768,
+ 9160, 9160, 6572, 285, 1289, 373,-32768, 7403, 7218,-32768,
+-32768, 268, 7403,-32768, 1290, 1291, 1755,-32768,-32768,-32768,
+ 131, 1296,-32768, 1343, 1343, 131, 1304, 9601, 9601, 10826,
+ 560, 3996, 560, 560, 921, 560, 4123, 1343,-32768,-32768,
+-32768, 1365,-32768,-32768,-32768, 1312,-32768, 1317, 9601, 9601,
+ 9601, 9601, 7403,-32768, 1367,-32768,-32768, 10960,-32768,-32768,
+-32768, 496, 1248,-32768,-32768,-32768,-32768,-32768,-32768, 1321,
+-32768, 1380, 181,-32768,-32768,-32768, 131,-32768,-32768,-32768,
+-32768,-32768,-32768, 9601,-32768,-32768, 1374, 1374,-32768, 1851,
+-32768,-32768, 1325, 1327, 1330, 1352,-32768, 923, 275, 1387,
+ 980, 1038,-32768,-32768,-32768,-32768,-32768, 9601, 1396, 1399,
+ 1401, 9252, 237, 1697, 421, 636,-32768,-32768, 9343, 1454,
+-32768,-32768,-32768, 1409,-32768, 4396, 10681, 10795, 6350,-32768,
+-32768, 1461,-32768,-32768,-32768, 8495,-32768,-32768, 1372, 614,
+-32768,-32768,-32768,-32768, 3739,-32768,-32768, 7403,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, 10826, 10826,-32768,
+ 1343, 651, 1048, 9601,-32768,-32768,-32768, 1061, 1061, 1343,
+ 1343, 387, 1343,-32768,-32768, 6089, 131, 131,-32768,-32768,
+ 1376, 1377, 1379, 1383,-32768, 7403, 9601,-32768, 496,-32768,
+-32768,-32768,-32768, 131, 1388,-32768,-32768,-32768,-32768, 1352,
+-32768, 1697,-32768,-32768,-32768,-32768,-32768,-32768, 682, 682,
+ 1050, 1404, 1410, 5995,-32768,-32768,-32768,-32768, 1442, 9601,
+ 1444, 1441, 1458, 1840, 1872,-32768, 1050,-32768,-32768, 1422,
+-32768,-32768, 1061, 927,-32768, 954, 1061, 10037, 987, 289,
+-32768,-32768,-32768,-32768,-32768,-32768, 397,-32768,-32768, 131,
+ 131,-32768,-32768,-32768, 9601, 9601, 10826, 560, 560,-32768,
+-32768,-32768,-32768, 8108,-32768,-32768,-32768,-32768, 131, 131,
+-32768,-32768,-32768,-32768,-32768, 1405,-32768,-32768,-32768, 1424,
+-32768,-32768,-32768, 9515,-32768,-32768,-32768, 1501, 8791, 6757,
+ 9515, 9601,-32768, 8603,-32768, 1460,-32768,-32768, 1467,-32768,
+ 1458, 1840,-32768,-32768, 781,-32768,-32768, 10467, 10467, 7585,
+-32768,-32768, 1050,-32768,-32768, 10826, 10826,-32768, 1343, 1343,
+ 1415, 10870, 1430,-32768,-32768,-32768, 5586,-32768,-32768, 1420,
+ 252, 4520, 1050, 8697,-32768,-32768, 93,-32768,-32768, 1471,
+ 1427, 10938, 8603,-32768,-32768,-32768,-32768, 1352, 89,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, 509, 412, 1431,
+ 1432, 1050,-32768, 1061,-32768,-32768,-32768,-32768, 705,-32768,
+ 7676,-32768,-32768,-32768,-32768, 1352, 1527, 1486, 170,-32768,
+-32768,-32768,-32768, 560, 93,-32768, 9601, 1487,-32768, 1488,
+-32768, 1050, 8603, 1452, 753, 1493,-32768,-32768,-32768, 145,
+-32768, 1489,-32768, 1446,-32768,-32768,-32768,-32768, 9601, 1527,
+ 1495, 1527,-32768,-32768,-32768, 7767, 1457, 787,-32768,-32768,
+ 7403, 1459,-32768, 1557, 1511,-32768,-32768,-32768, 295,-32768,
+ 8697, 1561, 1513,-32768,-32768,-32768, 1576, 1577,-32768
};
static const short yypgoto[] = {-32768,
- 1511,-32768, -303,-32768, 1101, 18, -1, 1515,-32768, 192,
--32768,-32768, 519, 1161,-32768, 5,-32768,-32768, -623,-32768,
--32768, 615,-32768, 1363, -668, 83, -664, 1392, 30,-32768,
--32768,-32768,-32768,-32768, 774,-32768,-32768,-32768,-32768,-32768,
--32768, 404, 661,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 1440, -611, 5315, 32, -317, 44,
- 1416, -503,-32768, 103,-32768, 222,-32768, -1302,-32768, -756,
- 17,-32768, 1320, 1586, -262,-32768, -794, 1774, -110, 1098,
- 3500, 1281,-32768, -87, -55, 1580, -77, 27,-32768,-32768,
--32768, -319,-32768, -155,-32768,-32768, -1156, -47, -316, 2413,
- 58, -240, -120, 52, 76, -181, -4, -144, -610, 312,
--32768, 68, 73,-32768, -337,-32768,-32768,-32768,-32768,-32768,
- 374, 1115, 20,-32768, 673,-32768,-32768, -1049, -422, 890,
--32768,-32768,-32768,-32768,-32768, -32,-32768,-32768,-32768,-32768,
--32768, 685, -360,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- 1348,-32768, 426, 602,-32768,-32768,-32768,-32768, 566, -686,
--32768,-32768,-32768,-32768,-32768,-32768, 833,-32768, 412, 966,
- 704, 1024, 3968, 7, 51, -431, 1407, 3322, -438,-32768,
- 19,-32768, 3079, -118, 247, -59, 3948, 1271,-32768, 4653,
- 1794, 1660, -16, -115,-32768, 1471, -81,-32768, 4369, 2696,
- -290,-32768, 2504,-32768,-32768, 344,-32768,-32768, 471, 93,
- -353,-32768,-32768,-32768,-32768, -1262,-32768, -1191, -1324,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768, 115,-32768,-32768,-32768,-32768,-32768, 153,
- -1232,-32768,-32768, -65,-32768,-32768,-32768,-32768, -1312, 92,
--32768, 94,-32768, -616, -520, 660,-32768,-32768,-32768,-32768,
- -371,-32768, -364, -179,-32768, 681, 349,-32768, -394,-32768,
- -217
+ 1586,-32768, -336, 1421, -382, 70, 6, 1573,-32768, 1554,
+-32768,-32768, 266,-32768, 277,-32768, 396,-32768, 195, 937,
+ 52, 14,-32768,-32768, -628,-32768,-32768, 661, 53, 1426,
+ 1179, 1439, -685, 77, -162, 13, 139,-32768,-32768,-32768,
+-32768,-32768, 835,-32768,-32768,-32768,-32768,-32768,-32768, 456,
+ 1536,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 1518, -616, 5440, -68, -498, -295, 26, 1478,
+ -508,-32768, -43,-32768, 245,-32768, -1359,-32768, -1380, 27,
+-32768, 1476, 1201, -274, 405, -542,-32768, -817, 4764, 1360,
+ 1170, 3522, 1349, -326, -85, -94, 105, -71, -27,-32768,
+-32768,-32768, -327,-32768, -156,-32768,-32768, -1216, 68, -343,
+ 4423, 107, 1101, -118, 19, 102, -200, -4, -138, -160,
+ -169, 20, -42, -245,-32768, -342,-32768,-32768,-32768,-32768,
+-32768, -5, 1809, -17,-32768, 724,-32768,-32768, -988, -428,
+ 941,-32768,-32768,-32768,-32768,-32768, 168,-32768,-32768,-32768,
+-32768,-32768, 733, -362,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 1416,-32768, 465, 645,-32768,-32768,-32768,-32768,-32768,
+ 881, -684,-32768,-32768,-32768,-32768,-32768,-32768, 885,-32768,
+ 460, 1022, 752, 1083, 4670, 47, 25, -441, 1474, 2689,
+ -454,-32768, 18,-32768, 5069, -134, 156, -82, 4079, 1334,
+-32768, 4154, 1775, 1562, -16, -107,-32768, 1555, -58,-32768,
+ 4257, 2711, -195,-32768, 2673,-32768,-32768, 381,-32768,-32768,
+ 516, 115, -427,-32768,-32768,-32768,-32768, -1353,-32768, -1239,
+ -1387,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 137,-32768,-32768,-32768,-32768,
+-32768, 176, -1300,-32768,-32768, -54,-32768,-32768,-32768,-32768,
+ -1367, 116,-32768, 123,-32768, -698, -581, 704,-32768,-32768,
+-32768,-32768, -383,-32768, -376, -175,-32768, 1675, 393,-32768,
+ 232,-32768, -226
};
-#define YYLAST 10726
-
-
-static const short yytable[] = { 58,
- 408, 237, 37, 681, 937, 925, 180, 121, 41, 372,
- 71, 453, 593, 655, 479, 602, 711, 279, 606, 607,
- 656, 36, 501, 504, 653, 205, 789, 400, 403, 917,
- 729, 58, 102, 45, 37, 1051, 58, 139, 143, 37,
- 41, 371, 71, 469, 380, 41, 472, 71, 923, 632,
- 978, 193, 980, 36, 534, 56, 458, 461, 36, 1007,
- 151, 54, 1363, 237, 858, 45, 228, 677, 378, 1366,
- 45, 858, 452, 383, 661, 662, 381, 382, 277, 57,
- 208, 460, 329, 1448, 329, 192, 329, 56, 571, 278,
- 1348, 1400, 56, 54, 750, 491, 1452, 571, 54, 571,
- 241, 329, 329, 174, 1124, 1279, 1280, 1453, 482, 237,
- 234, 57, 166, 581, 1130, 1520, 57, 605, 716, 1300,
- -44, 1478, 354, 344, -1, -44, 972, -125, 355, -2,
- 390, 329, 336, 329, 337, 752, -44, 1014, 892, 136,
- 1487, 71, 230, 1019, 649, 418, 87, 491, 674, 158,
- 93, 945, 399, 402, 860, 58, 1509, 973, 276, 773,
- 205, 699, 1521, 1460, 387, 1131, 71, 751, 205, 205,
- 787, 945, 151, 151, 151, 1195, 505, 506, 1501, 392,
- 951, 1125, 1475, 436, 438, 774, 389, 1488, 893, 45,
- 159, 514, 388, 649, 515, 205, 667, 516, 926, 946,
- 526, 174, 947, -326, 531, 151, 675, 419, 346, 350,
- 57, 56, 570, 1532, -326, 208, 1478, 54, 419, 946,
- 1534, 1456, 947, 208, -792, 92, 425, 155, 952, 106,
- -275, 953, 162, 935, 174, 57, 1374, 948, 576, 1517,
- 420, 983, 88, 426, 205, 1380, 1381, 241, 1382, 788,
- 1077, 420, 1450, 1400, 1192, 85, 568, 948, 671, 94,
- 109, 110, 89, 1485, 456, 903, 954, 1535, 1084, 107,
- 577, 1087, 427, 228, 486, 984, -275, -275, 1098, 985,
- 153, 904, 902, 635, 602, 1008, 1214, 289, 126, 127,
- 879, 108, -268, 482, 1159, 378, 205, 433, 527, 1270,
- 528, -589, 1328, 27, 329, 86, 87, 458, 461, 1112,
- 1113, 1518, 986, 111, 112, 458, 163, 277, 480, 640,
- 938, 400, 403, 639, 655, 228, 1328, 461, 278, 896,
- 134, 958, 714, 329, 611, 1009, 1215, 1344, 90, 27,
- 658, 129, 130, 434, 649, 71, 461, -589, -589, 1271,
- 858, 649, 1329, 241, 598, 835, 479, 205, 91, 1153,
- 1542, 15, 16, -589, 481, 836, -385, -335, 609, 15,
- 16, 1158, 1024, 1025, 1026, 593, 1425, -549, 136, 837,
- 652, 608, 1463, 1464, 193, 763, -277, 156, 858, 643,
- 389, 654, 153, 153, 153, -385, 610, 276, 1313, -385,
- 599, -335, 1101, 167, 1178, -335, 1180, 514, 515, 1052,
- 1543, 521, 157, 831, 57, -336, 171, 15, 16, 205,
- 205, 137, 357, -549, 173, 153, 172, 205, 858, 692,
- 832, 764, -277, -277, -549, 208, 1079, 358, -335, 205,
- 654, 138, 89, 126, 127, -385, 703, 704, -271, -336,
- 199, 200, 1027, -336, 19, 649, 14, 91, 205, 833,
- 651, 223, 927, 719, 720, 58, 151, 151, 151, 281,
- 373, 374, 10, 1211, 1212, 225, 71, 1346, 208, 21,
- -549, 448, 280, 1007, 581, 137, -336, 737, 24, 136,
- 581, 846, 329, -126, 27, 329, 129, 130, 329, 137,
- 568, 743, 329, 779, 779, 779, 779, 928, 22, 651,
- 835, 8, 9, 649, 27, 329, 929, 930, 709, 649,
- 836, 745, 39, 28, 299, 329, 715, 744, 329, 717,
- 773, 655, 359, 685, 837, 729, 773, 847, 656, 415,
- 770, 968, 653, 970, 474, 57, 126, 127, 974, 866,
- 342, 90, 136, 931, 39, 33, 602, 206, 207, 39,
- 329, 277, 881, 340, 129, 130, 362, 363, 364, 458,
- 848, 91, 278, 352, 115, 116, 117, 850, 205, 761,
- 652, 1097, 356, 1123, 384, 858, 90, 692, 852, 854,
- 475, 654, 360, 8, 484, 867, 868, 491, 654, 129,
- 130, 910, 521, 915, 916, 521, 91, 361, 962, 776,
- 534, 173, 365, 858, 241, 372, 849, 1186, 1188, 205,
- 366, 367, 521, 851, 121, 762, 649, 1200, 118, 119,
- 649, 329, 987, -268, 1117, 521, 975, 284, 343, 803,
- 1354, 276, 1359, 90, 916, 193, 129, 130, 1119, 228,
- 446, 447, 126, 127, 963, 936, 405, 482, 605, 205,
- 651, 406, 649, 91, -584, 825, -7, 651, 649, 1121,
- 485, 842, 126, 127, 100, 414, 1402, 935, 988, 899,
- 1118, 205, 976, 114, 429, 1496, 153, 153, 153, 199,
- 200, 652, 1480, 417, 1120, 14, 993, 1173, 1174, 1175,
- 454, 455, 654, 27, 430, 129, 130, 1188, 649, 729,
- -102, 487, 15, 16, 488, 1122, 1266, 1268, 21, 492,
- 489, 1272, 1403, 27, 217, 129, 130, 24, 490, 493,
- 1060, 1497, 58, -545, 58, 649, -545, 774, 1513, 498,
- 193, 58, 530, 71, -102, 71, 205, 649, -102, 652,
- 329, 329, 71, 329, 737, 652, 737, 1375, 514, 515,
- 654, 507, 1310, 737, 1196, 1197, 654, 1199, 743, 87,
- 743, 651, 863, 992, 1002, 508, 743, 743, 126, 127,
- 649, -102, 649, 368, -545, 509, -545, -545, 745, -545,
- 745, 1148, 1149, 1150, 744, 510, 979, 745, 1015, 1016,
- -545, 1017, -545, 744, 1490, 397, 511, 981, 982, 571,
- 15, 16, 57, 616, 57, -385, 1010, 619, -545, -545,
- 1510, 57, -545, 343, 779, 126, 127, 620, 1054, 651,
- 637, 129, 130, 622, -545, 651, 237, 15, 16, 555,
- 556, 88, 623, -385, -385, 1326, 1327, 624, -385, -123,
- 1369, 7, 8, 231, 10, 485, 779, 281, 373, 374,
- 10, 89, 652, 8, 9, 649, 692, 636, 530, 665,
- 343, -6, 831, 654, 638, 852, 854, 654, 129, 130,
- 464, 466, 446, 1419, 527, 1316, 528, 668, 1395, 832,
- 22, 686, 477, 649, 241, 710, 22, 232, 652, 705,
- 779, 329, 233, 232, 652, 28, 29, 643, 343, 654,
- 755, 28, 299, 1102, 1103, 654, 129, 130, 833, 1191,
- 454, 1420, 237, 446, 1424, -100, 756, 15, 16, 233,
- 757, 993, 758, 765, 843, 151, 774, 33, 766, 1057,
- 233, 783, 651, 33, 692, 675, 651, 94, 109, 110,
- 1201, 625, 626, 627, 90, 654, 126, 127, 779, -100,
- 785, 513, -124, -100, 329, 94, 109, 110, 476, 88,
- 861, 652, 786, 521, 91, 151, 788, 1160, 651, 845,
- 859, 1406, 654, 652, 651, 400, 403, 8, 9, 89,
- 94, 95, 96, 1417, 654, 863, -100, 884, 885, 894,
- 581, 111, 112, 618, 22, 895, 58, 27, 992, 129,
- 130, 897, 628, 400, 403, 898, 652, 71, 652, 111,
- 112, 514, 515, 582, 651, 618, 21, 654, 737, 654,
- 237, 234, 343, 583, 905, 906, 343, 919, -271, 924,
- 129, 130, 743, 584, 97, 98, 585, 586, 94, 95,
- 96, 651, 209, 210, 211, 419, 942, 969, 329, 1162,
- -791, 943, 745, 651, 485, 1164, 1165, 655, 744, 1162,
- 1167, 1146, 1406, 1165, 1471, 88, 944, 90, 950, 960,
- 964, 971, 212, 1331, 1028, 1332, 57, 94, 109, 110,
- 967, 1406, 94, 109, 110, 89, 651, 91, 651, 936,
- 27, 652, 97, 98, 213, 1011, 1203, 965, 1536, 1029,
- 1217, 1218, 654, 1030, 281, 373, 374, 10, 1493, 94,
- 95, 96, 1253, 1031, 1012, 1248, 774, 718, 1032, 692,
- 151, 151, 151, 71, 1033, 1034, 526, 88, 1217, 1218,
- 654, 111, 112, 113, 1247, 1376, 111, 112, 1406, 1035,
- 214, 215, 216, 22, 1036, 153, 677, 89, 151, 151,
- 151, 126, 127, 126, 1297, 58, 27, 1037, 28, 299,
- 196, 27, 204, 97, 98, 99, 71, 1038, 1252, 1043,
- -122, 651, 1040, 1041, 319, 1044, 319, 737, 319, 115,
- 116, 117, 796, 1045, 1046, 153, 1047, 486, 649, 1059,
- 33, 743, 57, 1353, 1048, 1353, 1049, 1062, 343, 651,
- 1063, 1061, 27, 1064, 129, 130, 129, 130, 1070, 1071,
- 205, 745, 115, 719, 720, 1072, 721, 744, 492, 1116,
- 1080, 1081, 1139, 319, 844, 319, 521, 1078, 493, 1083,
- 485, 27, 1253, 118, 119, 57, 1093, 193, 1090, 1253,
- 722, 1096, 1248, 71, 1145, 1163, 1253, 723, 1168, 1248,
- 71, 491, 1459, 1172, 1247, 779, 1176, 71, 1181, 1182,
- 1183, 1247, 1184, 1189, 27, 1202, 118, 119, 1247, 1198,
- 416, 1193, 1194, 1306, 1307, 1308, 1309, 7, 126, 127,
- 10, 15, 16, 1312, 1204, 1205, -385, 1206, 1252, 1213,
- 1209, 901, 400, 403, 1210, 1252, 1216, 204, 1124, 1221,
- 514, 515, 1252, 918, 1265, 459, 204, 552, 553, 554,
- 555, 556, 57, 1274, -385, -385, 22, 1275, 1278, 57,
- 426, 1282, -626, 232, 1304, 1305, 57, 1315, 1311, 796,
- 1314, 28, 29, 1320, 1343, 1321, 1323, 115, 719, 720,
- 153, 153, 153, 1322, 1155, 1156, 198, 199, 200, 1330,
- 1378, 1379, 1339, 14, 1340, 233, 94, 109, 110, 1341,
- 209, 210, 211, 33, 1349, 722, 1351, 1364, 153, 153,
- 153, 19, 1367, 1169, 151, 1409, 21, 1410, 362, 363,
- 364, 1391, 966, 1392, 1414, 24, 1474, 512, 1443, 27,
- 212, 118, 119, 1253, 1253, 1443, 1248, 1393, 1253, 278,
- 205, 1248, 8, 9, 71, 71, 278, 1394, 329, 71,
- 111, 112, 1396, 1398, 456, 1247, 1247, 703, 704, 1416,
- 1247, 1418, 1439, 1013, 652, 319, 94, 95, 96, 1018,
- 27, 1253, 366, 367, 1248, 654, 1415, 151, 151, 151,
- 1253, 1447, 71, 1248, 1457, 1465, 1467, 343, 1473, 1252,
- 1252, 71, 1482, 1247, 1252, 129, 130, 1504, 1483, 1491,
- 1492, 1508, 1247, 1515, 1516, 1519, 1443, 1522, 276, 1524,
- 1525, 1529, 1533, 57, 57, 276, 1537, 278, 57, 1538,
- 97, 98, 126, 127, 115, 719, 720, 1252, 1253, 1540,
- 1545, 1248, 1546, 196, 204, 1441, 1252, 1548, 1549, 71,
- 1, 803, 1441, 670, 651, 634, 5, 1099, 1003, 1222,
- 1247, 57, 412, 680, 684, 521, 281, 8, 9, 10,
- 57, 684, 339, 128, 1285, 1286, 1253, 1295, 1296, 1248,
- 1298, 1494, 1073, 27, 1074, 129, 130, 71, 118, 119,
- 1489, 413, 628, 393, 1252, 1405, 276, 1544, 1247, 416,
- 497, 557, 901, 1356, 1092, 22, 459, 204, 941, 468,
- 416, 1091, 232, 1276, 459, 1151, 1170, 1005, 57, 1299,
- 28, 299, 887, 1441, 457, 199, 200, 416, 1089, 830,
- 449, 14, 1252, 370, 319, 684, 578, 1362, 1262, 1514,
- 558, 559, 1523, 1511, 153, 560, 561, 562, 563, 19,
- 1486, 1528, 33, 150, 21, 1530, 57, 1138, 1368, 0,
- 0, 1527, 0, 24, 0, 0, 0, 319, 803, 680,
- 0, 0, 800, 801, 0, 805, 806, 807, 808, 809,
- 810, 811, 812, 813, 814, 815, 816, 817, 818, 819,
- 820, 821, 822, 823, 0, 0, 1372, 1373, 0, 684,
- 0, 684, 684, 0, 0, 0, 0, 153, 153, 153,
- 0, 0, 0, 0, 0, 732, 0, 7, 8, 733,
- 10, 386, 12, 13, 0, 198, 199, 200, 14, 684,
- 126, 127, 14, 0, 0, 13, 684, 0, 0, 0,
- 1177, 1187, 1179, 17, 0, 18, 19, 20, 0, 0,
- 19, 21, -492, 0, 0, 21, 22, 889, 891, 0,
- 24, 734, 0, 642, 24, 204, 401, 404, 0, 27,
- 0, 28, 29, 319, 581, 735, 0, 736, 239, 659,
- 0, 27, 0, 129, 130, 31, 682, 0, 0, 0,
- 1431, 1432, 1433, 682, 0, 32, 1208, 582, 150, 0,
- 0, 0, 239, 33, 196, 0, 204, 583, 34, 550,
- 551, 552, 553, 554, 555, 556, 680, 584, 0, 0,
- 585, 586, 0, 0, 1227, -492, 0, 0, 8, 9,
- 1187, 239, 12, 13, 0, 0, 0, 79, 14, 0,
- 239, 0, 1461, 1462, 0, 0, 204, 103, 0, 0,
- 0, 0, 0, 17, 0, 18, 0, 682, 132, 0,
- 0, 21, 0, 0, 141, 141, 0, 141, 459, 79,
- 24, 416, 1277, 977, 79, 0, 0, 1281, 0, 27,
- 0, 129, 130, 564, 0, 0, 239, 187, 0, 79,
- 0, 0, 319, 319, 0, 319, 0, 220, 0, 196,
- 600, 8, 9, 0, 103, 416, 0, 1512, 0, 0,
- 684, 0, 0, 0, 0, 243, 103, 0, 565, 239,
- 0, 682, 0, 682, 682, 0, 0, 1317, 523, 0,
- 0, 0, 1039, 0, 0, 0, 289, 601, 103, 22,
- 0, 0, 239, 1345, 0, 0, 989, 990, 9, 10,
- 0, 682, 27, 0, 129, 130, 0, 0, 682, 0,
- 0, 132, 0, 0, 0, 0, 132, -277, 79, 680,
- 684, 0, 141, 0, 0, 395, 141, 0, 0, 141,
- 141, 141, -277, -277, 684, 22, 684, -277, 684, 0,
- 0, 0, 0, 79, 0, 0, 0, 0, 27, 0,
- 28, 29, 0, -277, 1154, 0, 991, 0, 0, 0,
- 187, 187, 187, 0, 177, -277, -277, 0, -277, 0,
- -277, 1088, 1387, 1388, 178, 0, 1401, 0, 0, 0,
- 0, 684, 33, 239, 0, 0, 0, 179, 1397, 187,
- 0, 0, 0, 319, 198, 199, 200, 0, 0, -277,
- -277, 14, 683, -277, 467, 0, 1111, 0, 0, 690,
- 401, 404, 103, 0, 0, -277, 0, 0, 684, 19,
- 0, 0, 0, 141, 21, 0, 0, 0, 0, 7,
- 8, 9, 10, 24, 0, 13, 684, 0, 0, 0,
- 1427, 1428, 0, 0, 239, 0, 0, 0, 882, 548,
- 549, 550, 551, 552, 553, 554, 555, 556, 0, 1437,
- 1438, 103, 494, 0, 0, 0, 0, 0, 22, 523,
- 0, 0, 523, 771, 581, 0, 0, 0, 1161, 0,
- 0, 27, 682, 28, 29, 416, 416, 0, 401, 784,
- 0, 587, 587, 587, 0, 0, 0, 907, 0, 0,
- 0, 0, 523, 0, 0, 103, 0, 908, 0, 579,
- 0, 494, 494, 595, 416, 33, 239, 584, 0, 0,
- 909, 586, 79, 0, 0, 0, 0, 680, 680, 0,
- 0, 1190, 0, 0, 0, 0, 0, 824, 132, 826,
- 827, 0, 682, 239, 7, 8, 9, 10, 0, 0,
- 319, 0, 0, 0, 0, 0, 682, 0, 682, 0,
- 682, 874, 132, 0, 0, 0, 0, 0, 103, 0,
- 0, 187, 103, 0, 878, 0, 0, 0, 0, 0,
- 0, 0, 141, 22, 0, 141, 0, 0, 0, 581,
- 141, 0, 0, 0, 0, 0, 27, 0, 28, 29,
- 0, 0, 0, 682, 0, 684, 0, 684, 0, 684,
- 0, 0, 907, 0, 0, 0, 0, 680, 0, 187,
- 0, 187, 908, 187, 187, 187, 680, 680, 239, 187,
- 33, 680, 584, 0, 187, 909, 586, 187, 0, 0,
- 682, 0, 0, 0, 239, 0, 1283, 1284, 0, 0,
- 0, 0, 0, 79, 0, 0, 0, 0, 682, 0,
- 0, 0, 0, 0, 0, 416, 416, 0, 416, 416,
- 0, 416, 680, 0, 732, 0, 7, 8, 733, 10,
- 386, 12, 13, 0, 0, 0, 0, 14, 0, 0,
- 0, 103, 103, 103, 103, 0, 0, 0, 0, 0,
- 0, 684, 17, 0, 18, 19, 20, 0, 0, 0,
- 21, -493, 0, 0, 0, 22, 0, 0, 0, 24,
- 734, 0, 642, 0, 0, 1338, 0, 0, 27, 0,
- 28, 29, 0, 0, 735, 0, 736, 0, 0, 0,
- 0, 0, 874, 0, 31, 587, 587, 0, 587, 103,
- 0, 494, 0, 0, 32, 873, 196, 204, 0, 0,
- 680, 0, 33, 579, 0, 494, 494, 34, 595, 0,
- 0, 0, 0, 0, 0, 875, 1377, 0, 0, 877,
- 0, 0, 0, 0, -493, 0, 0, 416, 416, 0,
- 0, 0, 0, 187, 0, 0, 0, 0, 680, 7,
- 126, 127, 10, 0, 0, 13, 0, 0, 1053, 0,
- 0, 0, 587, 0, 587, 587, 572, 587, 281, 373,
- 374, 10, 1065, 573, 1066, 0, 1067, 682, 0, 682,
- 0, 682, 187, 914, 187, 187, 220, 595, 22, 401,
- 784, 0, 0, 0, 0, 684, 0, 0, 0, 0,
- 0, 27, 0, 28, 29, 587, 0, 22, 0, 0,
- 0, 0, 1429, 1430, 574, 0, 0, 31, 0, 1095,
- 27, 1435, 28, 299, 0, 187, 0, 32, 150, 914,
- 0, 416, 416, 416, 0, 33, 187, 187, 0, 187,
- 34, 0, 0, 0, 0, 0, 0, 0, 1454, 0,
- 0, 0, 0, 0, 575, 0, 1114, 0, 349, 351,
- 0, 0, 0, 0, 0, 0, 0, 132, 1136, 0,
- 79, 0, 79, 682, 239, 0, 239, 1000, 79, 79,
- 0, 0, 0, 416, 416, 0, 0, 103, 0, 0,
- 0, 0, 587, 103, 0, 7, 8, 9, 10, 0,
- 494, 494, 494, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 494, 239, 0, 0, 0, 0, 8, 9,
- 0, 386, 12, 13, 0, 0, 688, 0, 14, 0,
- 0, 0, 0, 0, 22, 0, 0, 989, 990, 9,
- 10, 0, 0, 17, 0, 18, 19, 27, 416, 28,
- 29, 21, 0, 176, 0, 0, 0, 0, 0, 0,
- 24, 0, 103, 177, 0, 587, 0, 587, 680, 27,
- 0, 129, 130, 178, 0, 0, 22, 0, 587, 0,
- 0, 33, 873, 873, 873, 494, 179, 494, 0, 27,
- 0, 28, 29, 0, 103, 0, 0, 991, 494, 239,
- 103, 0, 875, 875, 875, 177, 0, 0, 0, 1082,
- 0, 0, 689, 0, 0, 178, 0, 682, 0, 0,
- 587, 587, 587, 33, 401, 404, 126, 127, 179, 0,
- 0, 227, 0, 0, 0, 0, 103, 0, 103, 82,
- 187, 187, 1108, 1223, 0, 1224, 0, 1225, 0, 105,
- 0, 0, 401, 1264, 0, 0, 0, 0, 0, 125,
- 133, 525, 873, 0, 0, 0, 142, 142, 0, 142,
- 581, 82, 0, 0, 0, 0, 82, 27, 0, 129,
- 130, 239, 1108, 0, 0, 0, 0, 0, 0, 142,
- 0, 82, 0, 582, 0, 0, 103, 0, 0, 221,
- 0, 0, 0, 583, 0, 0, 229, 239, 0, 103,
- 0, 0, 1000, 584, 0, 0, 585, 586, 229, 0,
- 0, 103, 281, 126, 127, 10, 0, 0, 0, 0,
- 0, 0, 0, 0, 1166, 0, 0, 648, 0, 1319,
- 0, 0, 0, 0, 79, 0, 0, 0, 7, 8,
- 9, 10, 0, 0, 103, 0, 103, 0, 0, 0,
- 0, 22, 0, 379, 0, 239, 0, 0, 232, 0,
- 82, 590, 594, 597, 142, 0, 28, 299, 142, 0,
- 0, 142, 142, 142, 0, 0, 691, 22, 494, 494,
- 0, 494, 0, 0, 232, 82, 0, 0, 0, 0,
- 8, 9, 28, 29, 12, 13, 0, 0, 33, 0,
- 14, 0, 142, 142, 142, 587, 587, 587, 587, 587,
- 0, 0, 0, 587, 0, 17, 233, 18, 0, 0,
- 0, 0, 0, 21, 33, 187, 187, 187, 187, 1108,
- 0, 142, 24, 187, 0, 873, 873, 873, 0, 0,
- 0, 27, 772, 129, 130, 775, 0, 0, 0, 777,
- 778, 780, 781, 782, 0, 1108, 1108, 1108, 7, 126,
- 127, 10, 525, 0, 227, 142, 0, 1136, 0, 0,
- 7, 8, 9, 10, 0, 799, 227, 0, 0, 0,
- 829, 0, 0, 0, 0, 0, 187, 0, 0, 0,
- 0, 141, 0, 79, 0, 0, 0, 22, 0, 0,
- 0, 0, 0, 229, 142, 0, 0, 828, 0, 22,
- 27, 0, 28, 29, 0, 581, 0, 0, 0, 0,
- 587, 587, 27, 587, 28, 29, 31, 856, 0, 0,
- 0, 401, 1264, 0, 856, 0, 32, 0, 907, 0,
- 187, 187, 0, 187, 33, 0, 0, 229, 908, 34,
- 0, 580, 0, 142, 142, 596, 33, 0, 584, 0,
- 604, 909, 586, 0, 82, 7, 126, 127, 10, 0,
- 0, 13, 0, 0, 187, 914, 187, 0, 0, 0,
- 379, 0, 281, 8, 9, 10, 0, 0, 0, 0,
- 0, 0, 0, 103, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 22, 0, 0, 0, 0, 0,
- 229, 0, 75, 142, 229, 853, 855, 27, 0, 28,
- 29, 22, 0, 0, 142, 0, 0, 142, 232, 0,
- 0, 0, 142, 146, 0, 0, 28, 299, 648, 140,
- 144, 0, 0, 147, 75, 0, 0, 0, 0, 75,
- 0, 33, 281, 8, 9, 10, 148, 0, 0, 0,
- 233, 142, 0, 142, 197, 142, 142, 142, 33, 0,
- 0, 142, 7, 8, 9, 10, 142, 0, 13, 142,
- 0, 1108, 912, 0, 590, 594, 0, 597, 0, 0,
- 0, 22, 0, 0, 731, 82, 691, 0, 232, 0,
- 0, 0, 691, 0, 0, 0, 28, 299, 0, 0,
- 0, 22, 0, 0, 0, 0, 0, 581, 0, 0,
- 0, 0, 0, 0, 27, 594, 28, 29, 0, 0,
- 485, 0, 0, 229, 229, 229, 229, 0, 33, 0,
- 1104, 0, 0, 391, 1108, 1108, 1108, 394, 0, 0,
- 1105, 396, 0, 0, 0, 0, 0, 0, 33, 0,
- 584, 0, 103, 1106, 586, 0, 0, 187, 75, 0,
- 6, 1050, 7, 8, 9, 10, 11, 12, 13, 0,
- 0, 0, 0, 14, 0, 140, 144, 0, 0, 0,
- 0, 229, 0, 142, 0, 0, 15, 16, 17, 0,
- 18, 19, 20, 799, 0, 0, 21, 142, 142, 691,
- 596, 22, 594, 856, 23, 24, 25, 876, 26, 0,
- 0, 0, 0, 0, 27, 0, 28, 29, 0, 604,
- 30, 0, 0, 0, 0, 142, 0, 0, 0, 0,
- 31, 1287, 1288, 9, 10, 648, 0, 1100, 483, 0,
- 32, 856, 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 34, 0, 0, 125, 0, 0, 35,
- 0, 0, 0, 0, 142, 596, 142, 142, 221, 596,
- 22, 0, 0, 0, 0, 1068, 0, 1069, 0, 0,
- 0, 856, 0, 27, 0, 28, 29, 731, 1075, 0,
- 0, 1289, 853, 855, 0, 1141, 0, 0, 0, 177,
- 0, 1147, 0, 0, 0, 0, 0, 142, 691, 178,
- 0, 596, 0, 0, 0, 0, 0, 33, 142, 142,
- 691, 142, 179, 0, 0, 0, 0, 0, 0, 0,
- 853, 855, 0, 0, 0, 0, 0, 612, 7, 8,
- 9, 10, 0, 0, 13, 0, 0, 0, 0, 133,
- 0, 0, 82, 691, 82, 691, 0, 0, 0, 1001,
- 82, 82, 0, 0, 0, 0, 0, 0, 0, 229,
- 0, 0, 0, 0, 0, 229, 0, 22, 0, 0,
- 0, 0, 142, 142, 142, 0, 0, 0, 0, 0,
- 27, 0, 28, 29, 142, 0, 0, 663, 0, 0,
- 664, 0, 0, 0, 0, 666, 177, 0, 0, 7,
- 8, 9, 10, 0, 0, 482, 178, 0, 437, 439,
- 443, 0, 0, 50, 33, 0, 0, 0, 0, 179,
- 0, 0, 0, 0, 394, 0, 396, 0, 856, 0,
- 0, 0, 0, 0, 229, 0, 0, 0, 22, 483,
- 50, 50, 0, 149, 581, 50, 0, 0, 0, 0,
- 50, 27, 0, 28, 29, 0, 856, 142, 749, 142,
- 0, 0, 0, 50, 0, 50, 229, 907, 0, 0,
- 142, 0, 229, 0, 876, 876, 876, 908, 0, 0,
- 0, 604, 0, 0, 0, 33, 0, 584, 235, 0,
- 909, 586, 541, 542, 543, 544, 545, 546, 547, 548,
- 549, 550, 551, 552, 553, 554, 555, 556, 229, 0,
- 229, 0, 142, 142, 596, 1068, 1069, 853, 855, 0,
- 0, 0, 0, 1075, 544, 545, 546, 547, 548, 549,
- 550, 551, 552, 553, 554, 555, 556, 376, 0, 0,
- 0, 376, 376, 0, 50, 853, 855, 0, 50, 0,
- 235, 0, 50, 0, 876, 149, 149, 149, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 229, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 731,
- 0, 229, 0, 0, 1001, 0, 50, 50, 149, 0,
- 0, 0, 1141, 229, 0, 0, 235, 0, 0, 126,
- 127, 0, 0, 199, 200, 0, 0, 0, 0, 14,
- 0, 0, 0, 0, 0, 50, 82, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 229, 0, 229, 0,
- 1068, 1069, 21, 1075, 0, 0, 0, 0, 913, 0,
- 0, 24, 0, 581, 0, 0, 0, 0, 0, 50,
- 27, 0, 129, 130, 0, 0, 0, 0, 0, 0,
- 142, 142, 0, 142, 0, 0, 582, 701, 0, 702,
- 0, 437, 439, 443, 0, 0, 583, 0, 0, 0,
- 0, 0, 713, 0, 956, 0, 584, 0, 0, 592,
- 586, 663, 664, 0, 666, 545, 546, 547, 548, 549,
- 550, 551, 552, 553, 554, 555, 556, 142, 142, 142,
- 142, 596, 0, 0, 0, 142, 0, 0, 522, 0,
- 0, 731, 0, 0, 0, 749, 0, 749, 0, 0,
- 0, 0, 999, 1006, 749, 376, 0, 876, 876, 876,
- 0, 0, 0, 235, 0, 525, 0, 0, 50, 0,
- 0, 0, 0, 731, 0, 0, 0, 0, 0, 0,
- 0, 648, 0, 0, 376, 0, 0, 0, 142, 0,
- 0, 0, 0, 142, 0, 82, 7, 8, 9, 10,
- 386, 12, 13, 0, 0, 688, 0, 14, 376, 0,
- 0, 0, 0, 0, 0, 0, 0, 50, 0, 0,
- 0, 0, 17, 0, 18, 19, 0, 0, 50, 0,
- 21, 50, 0, 0, 0, 22, 50, 0, 0, 24,
- 0, 581, 142, 142, 0, 142, 0, 0, 27, 0,
- 28, 29, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1104, 50, 0, 50, 0, 149,
- 149, 149, 0, 0, 1105, 50, 142, 596, 142, 0,
- 50, 77, 33, 50, 584, 0, 0, 1106, 586, 0,
- 0, 689, 0, 0, 0, 229, 0, 0, 0, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 77,
- 0, 77, 0, 77, 0, 140, 144, 0, 77, 0,
- 7, 126, 127, 10, 0, 0, 482, 0, 0, 522,
- 0, 77, 522, 77, 0, 0, 0, 0, 0, 0,
- 8, 9, 0, 0, 12, 227, 0, 522, 522, 522,
- 14, 0, 0, 0, 701, 702, 0, 713, 0, 22,
- 0, 0, 522, 0, 0, 17, 0, 18, 0, 0,
- 0, 0, 27, 21, 28, 29, 0, 0, 240, 0,
- 0, 0, 24, 876, 581, 0, 0, 999, 31, 0,
- 0, 27, 0, 129, 130, 998, 0, 0, 32, 126,
- 127, 0, 0, 199, 200, 0, 33, 582, 235, 14,
- 0, 34, 77, 0, 0, 0, 77, 583, 0, 749,
- 77, 522, 0, 77, 77, 77, 0, 584, 0, 0,
- 585, 586, 21, 0, 0, 0, 0, 77, 0, 50,
- 0, 24, 0, 581, 0, 0, 876, 876, 876, 0,
- 27, 407, 129, 130, 77, 77, 77, 0, 0, 0,
- 0, 0, 0, 0, 229, 0, 582, 0, 0, 142,
- 0, 0, 435, 0, 0, 0, 583, 0, 50, 50,
- 50, 50, 0, 77, 0, 451, 584, 8, 9, 585,
- 586, 12, 227, 0, 0, 0, 0, 14, 0, 0,
+#define YYLAST 11066
+
+
+static const short yytable[] = { 59,
+ 423, 617, 433, 178, 475, 152, 122, 431, 252, 36,
+ 432, 249, 415, 418, 680, 706, 974, 42, 388, 710,
+ 501, 681, 57, 627, 626, 523, 526, 887, 739, 294,
+ 59, 103, 657, 245, 887, 678, 757, 59, 394, 395,
+ 36, 1088, 494, 818, 220, 695, 857, 393, 42, 951,
+ 72, 396, 205, 57, 170, 42, 631, 632, 556, 1413,
+ 172, 173, 491, 362, 366, 387, 1416, 243, 957, 1451,
+ 252, 1506, 1398, 35, 480, 483, 140, 144, 186, 292,
+ 1013, 72, 1015, 345, 1050, 345, 474, 345, 72, 1042,
+ 1055, 513, 1510, 166, 167, 482, 579, 778, 440, 595,
+ 256, 1511, 345, 345, 35, 58, 595, 595, 686, 687,
+ 55, 165, 455, 159, 982, 352, 1538, 353, 816, 152,
+ 152, 152, 192, 360, 630, 1163, 1540, 252, -1, 1520,
+ 293, 402, 345, 909, 345, 744, 58, 151, 138, 504,
+ 502, 55, 580, 58, 513, 703, -144, -2, 171, 1535,
+ 1547, 86, 781, 160, 401, -352, 59, -291, 456, 441,
+ 59, 983, 404, 152, 984, 987, 478, 205, 889, 779,
+ 1569, 94, 437, 428, 1573, 1169, 186, 170, 42, 57,
+ 803, 1561, 72, 172, 173, 291, 503, 958, 154, 508,
+ 220, 727, 442, 414, 417, 204, 1548, 1114, 220, 923,
+ 87, 1164, 704, 692, 963, 1324, 1325, 72, 1577, 174,
+ 817, 72, 988, 1538, 220, 989, 166, 167, 1592, 1345,
+ 186, -361, 737, 15, 1514, 1170, 217, -352, 577, 578,
+ 743, 441, 8, 506, 165, 458, 460, 58, 192, 95,
+ 110, 111, 400, 1508, 88, 1451, 972, 601, 924, -362,
+ 1043, 15, 416, 419, -361, 549, 600, 550, -361, 211,
+ 212, 256, 58, 496, 442, 14, 58, 55, 1254, 38,
+ 91, 171, 93, 1545, 399, 975, 359, 8, 9, 700,
+ 39, 543, -362, 592, 130, 131, -362, 20, 243, 135,
+ 92, -361, 112, 113, 1121, 151, 23, 1124, 605, 1044,
+ 38, 627, 154, 154, 154, 936, 665, 1136, 507, 497,
+ 204, 39, 1192, 961, 962, 1087, 1390, 1255, 887, -362,
+ 345, 927, 660, 1578, 1197, 89, 1315, 415, 418, 130,
+ 131, -298, 174, 292, 1374, 480, 483, 910, 1150, 1151,
+ 680, 243, 1424, 480, 802, 90, 154, 993, 1374, 345,
+ 636, 1430, 1431, 1602, 1432, 483, 742, -120, 1216, 15,
+ 1218, 887, 107, 1042, 964, 747, 748, 1018, 256, 127,
+ 128, 501, 217, 401, 483, 1316, 617, -298, -298, 633,
+ 217, 217, 1007, 1375, 293, 235, -143, 218, 219, 236,
+ -120, 15, -291, 677, -120, -411, 205, 1482, 137, 40,
+ 1019, 72, 1603, 887, 1020, 127, 128, 605, 965, 714,
+ 217, 668, 1008, 359, 1358, 26, 579, 966, 967, -619,
+ 220, 130, 131, 771, -411, 59, 622, -120, -411, 545,
+ 40, 1139, 1089, 790, 152, 152, 152, 1021, 792, 291,
+ 91, 745, 697, -300, 679, 507, 605, 108, 172, 173,
+ -579, 720, 109, 802, 968, 1116, 58, 130, 131, 217,
+ 92, 635, 580, 220, 129, -619, -619, 683, 1235, 127,
+ 128, 91, 623, -411, 26, 89, 72, 1393, 543, 791,
+ -619, 543, 137, -141, 793, 805, -118, 59, 15, -300,
+ -300, 92, 802, 634, 875, 90, -579, 185, 543, 676,
+ 1523, 1524, 679, 1063, -294, 1251, 1252, 157, 731, 732,
+ 773, 543, 217, 359, 345, 832, 158, 345, 175, -118,
+ 345, 130, 131, -118, 345, 808, 808, 808, 808, 127,
+ 128, 58, 960, 179, 504, 592, 171, 345, 72, 937,
+ 876, 1447, 860, 855, 799, 248, 1162, 345, 877, 871,
+ 345, 183, 138, 680, 757, 938, -118, 676, 184, 861,
+ 681, 765, 887, 210, 211, 212, 879, 416, 419, 217,
+ 14, 932, 139, 1003, 678, 1005, 665, 627, 626, 26,
+ 1009, 130, 131, 933, 1198, 292, -579, 18, 862, 1357,
+ 18, 887, 20, 58, 878, 514, 88, 174, 772, 304,
+ 91, 23, 373, 480, 677, 515, 15, 513, -142, 238,
+ -411, 720, 880, 127, 128, 26, 684, 154, 154, 154,
+ 92, 895, 90, 997, 240, -300, 545, 556, 295, 545,
+ 768, 138, -579, 470, 1135, 982, 293, 256, -411, -411,
+ -300, 217, 217, -411, -300, 416, 813, 1224, 1226, 217,
+ 122, 388, 881, 883, 1240, 679, 345, 358, 370, 545,
+ -300, 217, 679, 26, 371, 130, 131, 896, 897, 998,
+ 205, 356, -300, -300, 243, -300, 1022, -300, 630, 864,
+ 217, 1010, 983, 1156, 973, 984, 930, -822, 91, 865,
+ 1158, 291, 296, 390, 391, 10, 771, 1396, 771, 368,
+ 972, 372, 912, 866, 771, 771, -300, -300, 92, 137,
+ 676, 771, 1425, 1160, 8, 9, 376, 676, 374, 677,
+ 903, -300, 1023, 377, 88, 1016, 1017, 1011, 1453, 1157,
+ 21, 397, 757, 375, 1045, 447, 1159, 247, 92, 1002,
+ 1226, 944, 185, 949, 950, 27, 315, 803, -291, 1311,
+ 1313, 1556, 448, 137, 1317, 1211, 1212, 1213, 359, 1161,
+ 59, 420, 59, 8, 9, 421, 130, 131, 205, 59,
+ 679, 127, 128, 1047, 1454, 59, 504, 32, 677, 345,
+ 345, 449, 345, 773, 677, 773, -614, 950, 127, 128,
+ 248, 299, 773, -7, 1355, 218, 434, 1557, 773, 1152,
+ 95, 96, 97, 217, 221, 222, 223, 359, 435, 1051,
+ 1052, 72, 1053, 72, 1580, 130, 131, 127, 128, 160,
+ 72, 26, 1094, 130, 131, 676, 72, 436, 18, 679,
+ 1187, 1188, 1189, 224, 765, 679, 765, 864, 26, 1028,
+ 130, 131, 860, 765, 217, 439, 452, 865, 1594, 765,
+ 451, 26, 345, 98, 99, 225, 543, 1091, 509, 861,
+ 1581, 866, 510, 1570, 8, 9, 58, 26, 58, 130,
+ 131, 772, 511, 1014, 512, 58, 252, 116, 747, 748,
+ 772, 58, 520, 514, 676, 808, 772, 217, 862, 1419,
+ 676, 677, 529, 515, 1595, 720, 1236, 1237, 530, 1239,
+ 226, 227, 228, 768, 750, 768, 903, 531, 359, 217,
+ 1027, 1037, 768, 468, 469, 152, 130, 131, 768, 95,
+ 96, 97, 256, 552, 127, 1342, 532, 1445, 26, 15,
+ 119, 120, 677, -411, 808, 345, 476, 477, 677, 549,
+ 507, 550, 679, 533, 881, 883, 679, 1362, 468, 698,
+ 668, 89, 552, 1457, 803, 476, 699, 152, 595, 1199,
+ 1185, -411, -411, 252, -575, 641, 249, -575, 359, 1474,
+ 26, 90, 98, 99, 100, 217, 130, 131, 644, 771,
+ 720, 1372, 1373, 679, 1201, 468, 1476, 1140, 1141, 679,
+ 1203, 1204, 645, 808, 1201, 1206, 647, 676, 1204, 345,
+ 507, 676, 892, 416, 813, 661, 677, 415, 418, 648,
+ 1194, 1195, 476, 1477, -575, 649, -575, -575, 677, -575,
+ 127, 128, 662, 7, 8, 246, 10, 1060, 1061, 1062,
+ -575, 679, -575, 89, 211, 212, 415, 418, 676, 1208,
+ 14, 1377, 690, 59, 676, 468, 1481, 151, -575, -575,
+ 90, -52, 677, 90, 677, 1457, -52, 679, 92, -6,
+ 129, 21, 20, -575, 784, 693, 773, -52, 247, 679,
+ 26, 23, 130, 131, 252, 1457, 27, 28, 95, 110,
+ 111, 1028, 808, 715, 738, 733, 676, 15, 785, 1175,
+ 786, 91, 787, 794, 72, 345, 795, 812, 154, 1378,
+ 248, 89, 814, 679, 1553, 679, 815, 704, 32, 1426,
+ 817, 92, 676, 680, 152, 152, 152, 765, 872, 874,
+ 1531, 90, 888, 890, 676, 1243, 892, 1406, 916, 543,
+ 915, 112, 113, 114, 1457, 1404, 508, 1409, 973, 677,
+ 154, 925, 706, 152, 152, 152, 929, 926, -181, 58,
+ 931, 20, 1027, -294, 772, 939, 959, 803, 676, 940,
+ 676, 1298, 1596, 137, -181, 953, -181, 441, 720, 979,
+ 980, 1290, -821, 981, 995, 1351, 1352, 1353, 1354, 986,
+ 127, 128, 999, 1000, 1297, 13, 768, 1004, 1257, 1258,
+ 679, 1006, 1046, 1064, 1330, 1331, 1065, 1340, 1341, 1069,
+ 1343, 1024, 1025, 9, 10, 1066, 1067, 1068, 1070, 95,
+ 110, 111, 72, 221, 222, 223, 1071, 1257, 1258, 679,
+ 1072, 1073, 1074, 605, -140, 1076, 95, 110, 111, 498,
+ 26, 1077, 130, 131, 1079, 1289, 1080, 18, 1389, 21,
+ 1083, 1096, 224, 1081, 1082, 676, 606, 416, 419, 116,
+ 117, 118, 26, 1098, 27, 28, 607, 335, 1193, 335,
+ 1026, 335, 112, 113, 21, 1099, 608, 58, 189, 609,
+ 610, 1100, 1101, 1107, 676, 1108, 416, 1309, 190, 112,
+ 113, 1109, 1115, 1117, 1298, 1155, 32, 116, 117, 118,
+ 1118, 191, 205, 1120, 1298, 1428, 1429, 154, 154, 154,
+ 513, 1298, 119, 120, 1290, 1127, 335, 1297, 335, 1130,
+ 808, 1290, 1133, 1446, 1134, 1178, 1184, 1297, 1519, 127,
+ 128, 1202, 1422, 1423, 1297, 1207, 154, 154, 154, 1210,
+ 378, 379, 380, 1219, 1220, 72, 1214, 1221, 26, 1227,
+ 119, 120, 1222, 415, 418, 72, 1466, 1229, 7, 8,
+ 9, 10, 72, 1230, 13, 1231, 1234, 1242, 1289, 378,
+ 379, 380, 605, 1403, 478, 1403, 1550, 1238, 1289, 26,
+ 1250, 130, 131, 1244, 1163, 1289, 7, 8, 9, 10,
+ 152, 26, 242, 382, 383, 606, 21, 1245, 1246, 1249,
+ 58, 1253, 605, 1256, 1261, 607, 1310, 1319, 1320, 26,
+ 58, 27, 28, 1323, 381, 608, 448, 58, 609, 610,
+ 1499, 1327, 382, 383, 21, 941, 832, 1499, -656, 1349,
+ 605, 1488, 1489, 1490, 1350, 942, 1361, 26, 1356, 27,
+ 28, 1360, 1366, 32, 1367, 608, 543, 1368, 943, 610,
+ 95, 110, 111, 941, 650, 651, 652, 1369, 1376, 1501,
+ 152, 152, 152, 942, 1298, 1298, 1501, 1385, 1386, 1298,
+ 1387, 32, 1399, 608, 1290, 217, 943, 610, 1401, 1290,
+ 574, 575, 576, 577, 578, 345, 1414, 1297, 1297, 1417,
+ 1521, 1522, 1297, 1441, 1442, 534, 1443, 95, 96, 97,
+ 1444, 1554, 677, 112, 113, 1449, 1460, 1499, 674, 1298,
+ 293, 1465, 1461, 1467, 371, 72, 72, 293, 1298, 1290,
+ 72, 1468, 1175, 1574, 1475, 1496, 1497, 1505, 1290, 1515,
+ 1516, 1525, 1297, 335, 731, 732, 1527, 1533, 1289, 1289,
+ 1542, 1297, 359, 1289, 1543, 1587, 1501, 1564, 1551, 1552,
+ 98, 99, 832, 679, 1579, 1568, 1575, 1576, 1572, 101,
+ 72, 1582, 1584, 1585, 1589, 291, 674, 115, 1298, 72,
+ 58, 58, 291, 154, 1593, 58, 1597, 1598, 1290, 1534,
+ 1600, 1605, 1606, 1289, 5, 1608, 1609, 624, 8, 9,
+ 10, 1297, 1289, 416, 1309, 1, 430, 293, 156, 1472,
+ 429, 296, 8, 9, 10, 928, 1298, 1137, 676, 427,
+ 229, 95, 409, 410, 1549, 58, 1290, 1038, 696, 72,
+ 1262, 355, 304, 625, 58, 21, 405, 709, 713, 1297,
+ 7, 127, 128, 10, 1456, 713, 13, 1604, 26, 21,
+ 130, 131, 1289, 154, 154, 154, 247, 1359, 95, 96,
+ 97, 254, 291, 519, 27, 315, 1129, 72, 978, 712,
+ 1128, 1321, 490, 1190, 98, 113, 718, 1040, 21, 384,
+ 1048, 527, 528, 918, 58, 254, 1344, 1126, 217, 471,
+ 1289, 26, 859, 27, 28, 602, 32, 536, 386, 1412,
+ 537, 411, 1307, 538, 1583, 1571, 548, 30, 335, 713,
+ 553, 98, 99, 1546, 254, 1588, 1177, 31, 594, 95,
+ 110, 111, 58, 254, 1590, 32, 0, 1418, 0, 674,
+ 33, 0, 7, 8, 9, 10, 674, 0, 13, 0,
+ 800, 335, 0, 709, 0, 0, 829, 830, 0, 834,
+ 835, 836, 837, 838, 839, 840, 841, 842, 843, 844,
+ 845, 846, 847, 848, 849, 850, 851, 852, 0, 713,
+ 21, 0, 112, 113, 0, 713, 605, 116, 747, 748,
+ 254, 749, 0, 26, 0, 27, 28, 0, 486, 488,
+ 0, 0, 116, 747, 748, 0, 0, 0, 80, 1142,
+ 853, 0, 499, 0, 750, 713, 854, 0, 104, 1143,
+ 0, 751, 713, 0, 254, 127, 128, 32, 133, 608,
+ 242, 0, 1144, 610, 142, 142, 0, 142, 26, 80,
+ 119, 120, 0, 0, 920, 922, 80, 0, 0, 254,
+ 0, 0, 0, 907, 674, 119, 120, 0, 0, 199,
+ 335, 80, 0, 0, 296, 127, 128, 10, 605, 233,
+ 0, 0, 95, 110, 111, 26, 104, 130, 131, 0,
+ 0, 0, 535, 7, 8, 9, 10, 258, 104, 504,
+ 0, 606, 0, 0, 0, 208, 0, 216, 0, 0,
+ 0, 607, 21, 232, 95, 110, 111, 709, 0, 247,
+ 104, 608, 0, 674, 609, 610, 0, 27, 315, 674,
+ 0, 21, 0, 0, 643, 112, 1469, 605, 0, 536,
+ 537, 0, 0, 653, 26, 0, 27, 28, 133, 0,
+ 80, 254, 0, 0, 142, 0, 643, 407, 142, 32,
+ 941, 142, 142, 142, 711, 0, 0, 112, 1471, 0,
+ 942, 711, 0, 1012, 0, 80, 0, 0, 32, 80,
+ 608, 0, 0, 943, 610, 199, 80, 0, 0, 0,
+ 0, 0, 0, 335, 335, 0, 335, 0, 581, 0,
+ 0, 0, 0, 199, 199, 199, 0, 0, 254, 0,
+ 0, 713, 0, 0, 296, 390, 391, 10, 0, 0,
+ 208, 7, 8, 9, 10, 0, 438, 0, 0, 0,
+ 0, 0, 199, 1075, 0, 711, 674, 582, 583, 0,
+ 674, 0, 584, 585, 586, 587, 0, 0, 489, 0,
+ 0, 0, 21, 216, 0, 0, 0, 0, 104, 21,
+ 0, 481, 216, 0, 746, 713, 713, 27, 315, 142,
+ 709, 713, 26, 0, 27, 28, 0, 674, 188, 0,
+ 0, 0, 0, 674, 0, 713, 0, 713, 189, 713,
+ 254, 0, 0, 0, 0, 711, 1084, 1085, 190, 32,
+ 0, 711, 1090, 0, 0, 0, 32, 104, 516, 0,
+ 0, 191, 0, 0, 0, 0, 1102, 254, 1103, 0,
+ 1104, 0, 0, 0, 1125, 674, 210, 211, 212, 825,
+ 0, 711, 0, 14, 713, 127, 128, 0, 711, 0,
+ 504, 0, 7, 8, 9, 10, 210, 211, 212, 335,
+ 18, 674, 104, 14, 0, 20, 603, 0, 516, 516,
+ 619, 0, 1149, 674, 23, 1132, 0, 0, 0, 80,
+ 18, 0, 0, 873, 0, 20, 0, 713, 605, 913,
+ 21, 0, 0, 0, 23, 26, 605, 130, 131, 0,
+ 0, 0, 0, 26, 713, 27, 28, 674, 0, 674,
+ 0, 606, 0, 133, 254, 0, 0, 0, 1153, 941,
+ 0, 607, 104, 0, 199, 104, 0, 0, 0, 942,
+ 254, 608, 0, 0, 609, 610, 0, 32, 142, 608,
+ 0, 142, 943, 610, 0, 1200, 142, 0, 0, 0,
+ 0, 0, 935, 0, 80, 0, 0, 0, 0, 208,
+ 216, 0, 596, 952, 296, 390, 391, 10, 0, 597,
+ 0, 0, 0, 0, 0, 7, 127, 128, 10, 1097,
+ 0, 242, 199, 0, 199, 0, 199, 199, 199, 0,
+ 0, 0, 199, 825, 674, 709, 709, 199, 0, 1228,
+ 199, 0, 21, 0, 0, 0, 0, 536, 537, 598,
+ 0, 0, 0, 21, 0, 26, 80, 27, 315, 335,
+ 0, 0, 0, 674, 0, 438, 26, 711, 27, 28,
+ 0, 0, 481, 216, 0, 0, 438, 210, 211, 212,
+ 481, 0, 30, 0, 14, 0, 0, 0, 0, 599,
+ 0, 0, 31, 438, 104, 104, 104, 104, 0, 0,
+ 32, 18, 0, 0, 0, 33, 20, 0, 7, 127,
+ 128, 10, 0, 0, 13, 23, 713, 0, 713, 0,
+ 713, 711, 711, 0, 0, 0, 0, 711, 709, 572,
+ 573, 574, 575, 576, 577, 578, 0, 709, 709, 0,
+ 0, 711, 709, 711, 0, 711, 21, 1263, 0, 1264,
+ 0, 1265, 0, 0, 104, 0, 516, 1328, 1329, 26,
+ 0, 27, 28, 0, 0, 479, 211, 212, 603, 0,
+ 516, 516, 14, 619, 0, 147, 0, 0, 0, 0,
+ 904, 0, 709, 0, 906, 148, 0, 0, 0, 18,
+ 711, 0, 0, 32, 20, 0, 0, 0, 149, 199,
+ 0, 0, 0, 23, 1001, 0, 0, 0, 0, 0,
+ 0, 0, 0, 713, 0, 7, 8, 9, 10, 0,
+ 0, 0, 0, 133, 0, 0, 7, 127, 128, 10,
+ 133, 0, 0, 711, 216, 0, 0, 1384, 199, 948,
+ 199, 199, 233, 619, 1365, 0, 1049, 1241, 653, 0,
+ 711, 0, 1054, 21, 0, 254, 0, 254, 0, 605,
+ 0, 935, 0, 0, 21, 0, 26, 0, 27, 28,
+ 0, 247, 0, 208, 0, 216, 232, 709, 0, 27,
+ 28, 0, 941, 0, 199, 0, 0, 0, 948, 0,
+ 0, 0, 942, 1427, 0, 199, 199, 0, 199, 254,
+ 32, 0, 608, 248, 0, 943, 610, 0, 0, 0,
+ 0, 32, 0, 0, 0, 709, 0, 0, 216, 0,
+ 536, 537, 0, 0, 0, 0, 133, 0, 0, 80,
+ 0, 80, 0, 0, 0, 0, 1035, 80, 80, 0,
+ 481, 0, 0, 438, 80, 0, 0, 104, 0, 0,
+ 0, 0, 0, 104, 0, 1110, 0, 1111, 0, 0,
+ 516, 516, 516, 0, 0, 0, 0, 713, 0, 0,
+ 0, 208, 516, 0, 0, 0, 0, 438, 0, 0,
+ 0, 0, 0, 0, 1486, 1487, 254, 674, 0, 0,
+ 0, 8, 9, 1492, 163, 12, 13, 0, 0, 717,
+ 0, 14, 1225, 567, 568, 569, 570, 571, 572, 573,
+ 574, 575, 576, 577, 578, 16, 0, 17, 18, 0,
+ 0, 1512, 711, 20, 711, 0, 711, 0, 0, 0,
+ 0, 0, 23, 0, 605, 0, 0, 0, 548, 0,
+ 0, 26, 0, 130, 131, 516, 0, 516, 0, 0,
+ 0, 0, 0, 0, 104, 0, 0, 606, 516, 0,
+ 104, 0, 904, 904, 904, 0, 0, 607, 0, 1119,
+ 254, 0, 0, 0, 0, 0, 0, 608, 0, 0,
+ 609, 610, 0, 7, 8, 9, 10, 0, 1267, 0,
+ 0, 0, 0, 0, 1225, 0, 0, 254, 0, 0,
+ 0, 104, 0, 104, 83, 199, 199, 1146, 0, 0,
+ 0, 0, 0, 0, 106, 0, 0, 0, 0, 711,
+ 1215, 21, 1217, 126, 134, 0, 0, 0, 247, 0,
+ 143, 143, 0, 143, 232, 83, 27, 28, 0, 0,
+ 0, 0, 83, 0, 0, 296, 8, 9, 10, 1146,
+ 709, 0, 0, 0, 0, 143, 254, 83, 0, 0,
+ 248, 0, 104, 0, 0, 234, 0, 0, 32, 0,
+ 0, 0, 244, 0, 0, 104, 0, 1248, 1035, 0,
+ 0, 0, 0, 21, 244, 0, 0, 104, 0, 0,
+ 247, 0, 0, 0, 0, 0, 0, 0, 27, 315,
+ 1205, 0, 0, 0, 0, 0, 0, 0, 1391, 1392,
+ 0, 0, 80, 0, 438, 438, 0, 0, 0, 0,
+ 0, 104, 248, 104, 0, 0, 0, 536, 537, 0,
+ 32, 0, 7, 8, 9, 10, 83, 0, 13, 0,
+ 143, 0, 0, 438, 143, 0, 0, 143, 143, 143,
+ 0, 104, 0, 0, 0, 1322, 516, 516, 0, 516,
+ 1326, 83, 0, 0, 0, 83, 0, 459, 461, 465,
+ 21, 143, 83, 711, 0, 7, 127, 128, 10, 0,
+ 0, 504, 0, 26, 0, 27, 28, 0, 0, 143,
+ 143, 143, 0, 296, 8, 9, 10, 1452, 0, 189,
+ 0, 0, 0, 0, 199, 199, 199, 199, 1146, 190,
+ 0, 1363, 199, 21, 0, 0, 0, 32, 143, 1470,
+ 1473, 0, 191, 0, 0, 0, 26, 0, 27, 28,
+ 0, 21, 0, 0, 0, 1146, 1146, 1146, 247, 0,
+ 0, 0, 30, 0, 0, 0, 27, 315, 0, 0,
+ 0, 0, 31, 0, 0, 143, 0, 0, 0, 0,
+ 32, 0, 0, 0, 0, 33, 199, 0, 0, 0,
+ 507, 142, 0, 0, 0, 0, 0, 0, 32, 0,
+ 0, 7, 8, 9, 10, 210, 211, 212, 0, 0,
+ 0, 0, 14, 244, 143, 0, 0, 1517, 438, 438,
+ 0, 438, 438, 0, 438, 0, 614, 618, 621, 18,
+ 0, 1437, 1438, 0, 20, 0, 0, 0, 0, 21,
+ 0, 199, 199, 23, 199, 605, 0, 0, 1448, 0,
+ 0, 0, 26, 0, 27, 28, 0, 0, 244, 0,
+ 0, 0, 604, 0, 143, 143, 620, 0, 941, 0,
+ 0, 629, 0, 0, 0, 83, 0, 0, 942, 0,
+ 199, 948, 199, 0, 0, 0, 32, 0, 608, 0,
+ 0, 985, 610, 0, 0, 0, 0, 0, 0, 104,
+ 0, 0, 0, 0, 1484, 1485, 0, 0, 0, 666,
+ 0, 0, 0, 0, 0, 208, 216, 0, 244, 0,
+ 143, 244, 0, 1494, 1495, 570, 571, 572, 573, 574,
+ 575, 576, 577, 578, 143, 0, 0, 143, 0, 0,
+ 0, 0, 143, 0, 0, 0, 438, 438, 0, 0,
+ 83, 7, 8, 9, 10, 0, 729, 242, 730, 0,
+ 459, 461, 465, 0, 0, 0, 0, 0, 0, 0,
+ 0, 741, 296, 390, 391, 10, 0, 0, 143, 0,
+ 143, 0, 143, 143, 143, 0, 0, 0, 143, 21,
+ 8, 9, 1146, 143, 12, 242, 143, 0, 0, 0,
+ 14, 0, 26, 0, 27, 28, 0, 0, 0, 0,
+ 21, 759, 83, 0, 16, 0, 17, 0, 189, 0,
+ 0, 0, 20, 26, 0, 27, 315, 0, 190, 0,
+ 0, 23, 0, 605, 0, 0, 32, 0, 0, 0,
+ 26, 191, 130, 131, 0, 438, 438, 438, 0, 0,
+ 244, 244, 244, 244, 0, 0, 606, 32, 0, 0,
+ 0, 0, 1146, 1146, 1146, 0, 607, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 608, 0, 0, 609,
+ 610, 104, 0, 0, 0, 0, 199, 0, 882, 884,
+ 7, 8, 9, 10, 163, 12, 13, 0, 8, 9,
+ 0, 14, 12, 242, 438, 438, 0, 0, 14, 0,
+ 244, 0, 143, 0, 0, 16, 0, 17, 18, 19,
+ 0, 0, 16, 20, 17, 0, 143, 143, 21, 620,
+ 20, 0, 23, 0, 0, 164, 905, 0, 0, 23,
+ 0, 26, 0, 27, 28, 0, 0, 0, 26, 629,
+ 130, 131, 0, 0, 0, 143, 946, 30, 614, 618,
+ 0, 621, 0, 0, 0, 0, 0, 31, 0, 0,
+ 0, 0, 438, 0, 0, 32, 0, 0, 0, 666,
+ 33, 0, 0, 0, 0, 34, 0, 126, 0, 0,
+ 0, 0, 0, 0, 143, 620, 143, 143, 234, 620,
+ 0, 0, 618, 562, 563, 564, 565, 566, 567, 568,
+ 569, 570, 571, 572, 573, 574, 575, 576, 577, 578,
+ 6, 759, 7, 8, 9, 10, 11, 12, 13, 729,
+ 730, 0, 741, 14, 0, 0, 0, 0, 0, 0,
+ 143, 0, 0, 0, 620, 0, 0, 16, 0, 17,
+ 18, 143, 143, 0, 143, 20, 0, 0, 0, 0,
+ 21, 0, 0, 0, 23, 0, 0, 426, 0, 0,
+ 1033, 0, 0, 26, 0, 27, 28, 0, 0, 29,
+ 0, 0, 134, 0, 0, 83, 0, 83, 0, 30,
+ 618, 0, 1036, 83, 83, 0, 0, 0, 0, 31,
+ 83, 127, 128, 244, 0, 211, 212, 32, 0, 244,
+ 0, 14, 33, 0, 0, 0, 143, 143, 143, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 143, 0,
+ 0, 0, 0, 20, 0, 51, 0, 0, 0, 0,
+ 0, 0, 23, 0, 605, 1024, 1025, 9, 10, 0,
+ 0, 26, 0, 130, 131, 0, 0, 0, 0, 0,
+ 0, 51, 51, 1105, 150, 1106, 51, 606, 0, 0,
+ 0, 0, 0, 51, 0, 0, 1112, 607, 0, 0,
+ 882, 884, 0, 21, 0, 0, 51, 608, 51, 0,
+ 616, 610, 0, 0, 0, 0, 26, 0, 27, 28,
+ 0, 143, 0, 143, 1026, 0, 0, 0, 0, 0,
+ 244, 250, 189, 0, 143, 0, 244, 0, 905, 905,
+ 905, 0, 190, 882, 884, 629, 0, 0, 0, 0,
+ 32, 0, 0, 0, 0, 191, 0, 0, 0, 459,
+ 461, 465, 564, 565, 566, 567, 568, 569, 570, 571,
+ 572, 573, 574, 575, 576, 577, 578, 244, 0, 244,
+ 0, 143, 143, 620, 392, 392, 0, 51, 0, 0,
+ 0, 51, 0, 250, 0, 51, 0, 0, 150, 150,
+ 150, 0, 0, 465, 0, 127, 128, 0, 0, 211,
+ 212, 0, 51, 0, 0, 14, 51, 0, 0, 0,
+ 0, 0, 51, 51, 0, 905, 0, 0, 0, 0,
+ 0, 0, 1033, 0, 0, 0, 0, 20, 244, 0,
+ 51, 51, 150, 0, 0, 0, 23, 0, 605, 759,
+ 250, 244, 0, 0, 1036, 26, 0, 130, 131, 0,
+ 0, 0, 0, 244, 7, 8, 9, 10, 0, 51,
+ 13, 606, 8, 9, 0, 0, 12, 13, 0, 0,
+ 0, 607, 14, 0, 0, 0, 0, 0, 83, 0,
+ 0, 608, 0, 0, 609, 610, 16, 244, 17, 244,
+ 0, 0, 21, 0, 20, 0, 51, 0, 0, 0,
+ 0, 0, 0, 23, 0, 26, 0, 27, 28, 0,
+ 0, 0, 26, 0, 130, 131, 0, 244, 0, 0,
+ 0, 462, 143, 143, 0, 143, 0, 0, 0, 0,
+ 0, 463, 1105, 1106, 882, 884, 0, 0, 0, 32,
+ 1112, 0, 0, 0, 464, 0, 0, 0, 729, 730,
+ 459, 461, 465, 0, 0, 0, 741, 0, 0, 0,
+ 0, 0, 0, 882, 884, 0, 544, 0, 0, 0,
+ 143, 143, 143, 143, 620, 0, 0, 0, 143, 459,
+ 461, 465, 0, 392, 0, 759, 0, 0, 0, 0,
+ 0, 250, 0, 0, 0, 0, 51, 0, 0, 0,
+ 0, 905, 905, 905, 0, 0, 7, 8, 9, 10,
+ 1338, 0, 504, 0, 0, 0, 0, 759, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 392, 0, 143, 0, 0, 0, 0, 143, 0, 0,
+ 0, 51, 0, 0, 21, 0, 0, 0, 0, 1105,
+ 1106, 0, 1112, 0, 0, 51, 0, 26, 51, 27,
+ 28, 0, 0, 51, 0, 729, 730, 0, 741, 0,
+ 0, 51, 0, 189, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 190, 0, 0, 0, 143, 143, 0,
+ 143, 32, 0, 0, 0, 0, 191, 0, 0, 51,
+ 0, 51, 0, 150, 150, 150, 0, 0, 0, 51,
+ 0, 0, 0, 0, 51, 1395, 0, 51, 1332, 1333,
+ 9, 10, 0, 0, 0, 0, 143, 620, 143, 0,
+ 0, 0, 0, 51, 0, 0, 0, 7, 8, 9,
+ 10, 201, 12, 202, 0, 244, 0, 0, 14, 0,
+ 0, 0, 0, 0, 0, 0, 21, 0, 0, 0,
+ 0, 0, 16, 544, 17, 18, 544, 0, 0, 26,
+ 20, 27, 28, 0, 0, 21, 0, 1334, 0, 23,
+ 0, 544, 544, 544, 0, 189, 0, 0, 26, 0,
+ 27, 28, 0, 0, 203, 190, 544, 0, 0, 0,
+ 0, 0, 78, 32, 30, 0, 0, 0, 191, 0,
+ 0, 0, 0, 0, 31, 0, 465, 0, 0, 0,
+ 0, 0, 32, 0, 0, 0, 0, 33, 78, 78,
+ 0, 78, 0, 78, 0, 0, 0, 0, 905, 0,
+ 78, 0, 0, 0, 250, 1332, 127, 128, 10, 0,
+ 0, 0, 0, 78, 0, 78, 0, 544, 561, 562,
+ 563, 564, 565, 566, 567, 568, 569, 570, 571, 572,
+ 573, 574, 575, 576, 577, 578, 51, 0, 0, 0,
+ 0, 0, 0, 21, 0, 0, 459, 461, 465, 0,
+ 0, 0, 0, 0, 0, 0, 26, 0, 27, 28,
+ 392, 0, 0, 0, 1334, 0, 0, 392, 905, 905,
+ 905, 0, 30, 0, 0, 51, 51, 51, 51, 0,
+ 0, 0, 31, 0, 0, 0, 0, 244, 198, 0,
+ 32, 0, 143, 0, 78, 33, 0, 0, 78, 0,
+ 0, 0, 78, 0, 0, 78, 78, 78, 0, 0,
+ 8, 9, 0, 253, 12, 13, 257, 0, 0, 78,
+ 14, 51, 0, 78, 0, 51, 0, 0, 0, 78,
+ 78, 0, 51, 51, 16, 51, 17, 253, 0, 361,
+ 0, 0, 20, 0, 0, 0, 0, 78, 78, 78,
+ 0, 23, 0, 0, 0, 0, 0, 0, 0, 0,
+ 26, 0, 130, 131, 588, 0, 51, 0, 51, 155,
+ 0, 0, 0, 51, 51, 51, 78, 7, 127, 128,
+ 10, 51, 0, 7, 8, 9, 10, 163, 12, 13,
+ 0, 200, 717, 0, 14, 0, 0, 0, 0, 589,
+ 0, 0, 0, 544, 198, 0, 0, 0, 16, 0,
+ 17, 18, 0, 78, 0, 21, 20, 0, 0, 0,
+ 0, 21, 198, 198, 198, 23, 0, 605, 26, 0,
+ 27, 28, 472, 0, 26, 0, 27, 28, 0, 0,
+ 0, 0, 0, 0, 147, 0, 0, 0, 0, 0,
+ 1142, 198, 0, 0, 148, 0, 0, 0, 0, 0,
+ 1143, 0, 32, 0, 0, 0, 0, 149, 32, 0,
+ 608, 0, 0, 1144, 610, 0, 0, 257, 7, 8,
+ 9, 10, 0, 155, 155, 155, 0, 0, 0, 0,
+ 0, 253, 0, 0, 0, 0, 0, 0, 0, 544,
+ 544, 544, 0, 0, 0, 250, 0, 200, 0, 628,
+ 0, 0, 0, 78, 0, 0, 21, 0, 0, 0,
+ 0, 0, 0, 0, 0, 200, 200, 466, 0, 26,
+ 0, 27, 28, 0, 0, 1402, 0, 0, 0, 0,
+ 0, 0, 51, 51, 150, 189, 0, 0, 0, 250,
+ 0, 0, 0, 0, 200, 190, 0, 0, 78, 0,
+ 0, 0, 0, 32, 0, 0, 0, 0, 191, 0,
+ 0, 0, 78, 0, 0, 78, 0, 0, 0, 0,
+ 78, 0, 0, 253, 257, 0, 1174, 0, 78, 566,
+ 567, 568, 569, 570, 571, 572, 573, 574, 575, 576,
+ 577, 578, 7, 8, 9, 10, 0, 0, 0, 365,
+ 367, 0, 0, 0, 0, 51, 78, 0, 78, 0,
+ 78, 78, 78, 0, 0, 0, 78, 0, 0, 0,
+ 517, 78, 0, 198, 78, 0, 250, 0, 0, 0,
+ 21, 0, 0, 0, 0, 0, 0, 0, 0, 51,
+ 78, 0, 0, 26, 0, 27, 28, 0, 0, 0,
+ 0, -383, 8, 9, -383, -383, 12, 242, 0, 189,
+ 0, 0, 14, 7, 8, 9, 10, 0, 0, 190,
+ 613, 613, 613, 0, 0, 0, 16, 32, 17, -383,
+ 0, 198, 191, 198, 20, 198, 198, 198, 0, -383,
+ 0, 198, 0, 23, 0, 605, 198, 0, 0, 198,
+ 0, 21, 26, 0, 130, 131, 0, 0, 0, 0,
+ 250, 0, 0, 0, 26, 0, 27, 28, 606, 8,
+ 9, 0, 163, 12, 13, 0, 200, 717, 607, 14,
+ 462, 51, 51, 150, 150, 150, -383, 250, 608, 51,
+ 463, 609, 610, 16, 0, 17, 18, 0, 32, 0,
+ 0, 20, 628, 464, 0, 0, 0, 0, 0, 0,
+ 23, 0, 1174, 1174, 1174, 0, 0, 0, 0, 26,
+ 0, 130, 131, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 200, 0, 200, 0, 466, 466,
+ 466, 0, 0, 51, 200, 0, 0, 0, 51, 200,
+ 0, 0, 200, 0, 0, 0, 162, 0, 7, 8,
+ 9, 10, 163, 12, 13, 0, 0, 547, 0, 14,
+ 0, 255, 78, 78, 78, 78, 0, 0, 0, 0,
+ 0, 0, 0, 16, 0, 17, 18, 19, 0, 0,
+ 0, 20, 253, 257, 0, 0, 21, 0, 51, 51,
+ 23, 51, 0, 164, 0, 0, 0, 0, 198, 26,
+ 0, 27, 28, 0, 0, 0, 0, 0, 78, 0,
+ 0, 0, 78, 0, 0, 30, 0, 0, 0, 78,
+ 78, 0, 78, 0, 0, 31, 0, 51, 51, 51,
+ 673, 0, 0, 32, 422, 0, 0, 198, 33, 198,
+ 198, 0, 0, 34, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 0, 78, 0, 0, 867, 0,
+ 78, 78, 78, 0, 0, 0, 457, 0, 78, 0,
+ 0, 0, 613, 613, 0, 613, 0, 0, 0, 473,
+ 8, 9, 613, 198, 12, 13, 0, 0, 719, 0,
+ 14, 0, 0, 0, 198, 198, 0, 198, 0, 0,
+ 0, 200, 0, 0, 16, 0, 17, 0, 0, 0,
+ 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
+ 0, 23, 257, 0, 0, 0, 0, 0, 0, 0,
+ 26, 0, 130, 131, 0, 198, 0, 0, 0, 1174,
+ 945, 0, 945, 945, 0, 613, 0, 0, 0, 0,
+ 0, 0, 0, 0, 801, 0, 0, 804, 0, 0,
+ 0, 806, 807, 809, 810, 811, 0, 0, 0, 858,
+ 0, 0, 0, 0, 547, 8, 9, 0, 163, 12,
+ 13, 0, 0, 0, 0, 14, 945, 828, 0, 0,
+ 0, 0, 0, 628, 0, 0, 0, 200, 200, 16,
+ 200, 17, 18, 0, 0, 0, 0, 20, 0, 1174,
+ 1174, 1174, 0, 0, 0, 0, 667, 0, 0, 164,
+ 0, 0, 0, 0, 0, 26, 0, 130, 131, 78,
+ 78, 78, 0, 51, 0, 0, 0, 0, 200, 0,
+ 0, 885, 0, 0, 0, 0, 0, 0, 885, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 517, 517, 517, 0, 0, 253, 257, 253,
+ 0, 0, 0, 1176, 613, 0, 0, 0, 0, 0,
+ 0, 0, 76, 563, 564, 565, 566, 567, 568, 569,
+ 570, 571, 572, 573, 574, 575, 576, 577, 578, 0,
+ 0, 0, 78, 0, 198, 198, 1145, 0, 141, 145,
+ 0, 253, 0, 76, 0, 0, 0, 611, 611, 611,
+ 76, 565, 566, 567, 568, 569, 570, 571, 572, 573,
+ 574, 575, 576, 577, 578, 209, 78, 0, 0, 0,
+ 0, 0, 0, 0, 0, 734, 0, 613, 1145, 613,
+ 740, 0, 0, 0, 0, 0, 673, 0, 0, 0,
+ 613, 0, 0, 0, 613, 613, 613, 0, 0, 0,
+ 0, 0, 0, 0, 0, 782, 0, 198, 0, 0,
+ 0, 788, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 796, 797, 0, 798, 0, 472, 0,
+ 0, 0, 0, 0, 0, 0, 0, 945, 945, 1147,
+ 0, 0, 0, 0, 403, 719, 0, 0, 406, 0,
+ 0, 719, 408, 0, 0, 0, 0, 0, 78, 78,
+ 78, 78, 78, 0, 0, 0, 78, 0, 0, 76,
+ 0, 0, 0, 76, 0, 0, 0, 0, 0, 0,
+ 209, 1147, 0, 0, 0, 0, 0, 0, 0, 1176,
+ 1176, 1176, 0, 0, 0, 0, 0, 141, 145, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 394, 396, 17, 0, 18, 0, 0, 77, 483, 0,
- 21, 50, 0, 0, 0, 50, 0, 0, 0, 24,
- 0, 0, 50, 50, 0, 50, 0, 0, 27, 0,
- 129, 130, 0, 0, 0, 0, 0, 0, 0, 732,
- 0, 7, 8, 733, 10, 386, 12, 13, 437, 439,
- 443, 0, 14, 0, 0, 0, 50, 0, 50, 0,
- 0, 1294, 0, 50, 50, 50, 1294, 17, 749, 18,
- 19, 20, 0, 0, 0, 21, -495, 0, 0, 0,
- 22, 0, 0, 0, 24, 734, 0, 642, 0, 0,
- 443, 0, 522, 27, 0, 28, 29, 0, 0, 735,
- 0, 736, 603, 0, 0, 0, 77, 0, 0, 31,
- 0, 0, 0, 0, 0, 663, 664, 0, 666, 32,
- 998, 0, 0, 0, 0, 0, 0, 33, 7, 8,
- 9, 10, 34, 0, 227, 543, 544, 545, 546, 547,
- 548, 549, 550, 551, 552, 553, 554, 555, 556, -495,
- 1357, 0, 0, 0, 0, 77, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 77, 22, 0, 77,
- 0, 0, 0, 0, 77, 0, 0, 0, 0, 0,
- 27, 0, 28, 29, 0, 0, 0, 0, 522, 522,
- 522, 0, 0, 0, 235, 0, 177, 0, 0, 0,
- 0, 0, 0, 77, 0, 77, 178, 77, 77, 77,
- 0, 0, 0, 77, 33, 0, 0, 0, 77, 179,
- 0, 77, 154, 0, 0, 0, 50, 50, 149, 0,
- 0, 706, 0, 235, 0, 0, 712, 77, 0, 0,
- 0, 0, 188, 701, 702, 437, 439, 443, 0, 0,
- 0, 713, 0, 0, 7, 8, 9, 10, 198, 199,
- 200, 753, 0, 0, 0, 14, 0, 759, 1135, 0,
- 0, 0, 0, 437, 439, 443, 0, 0, 0, 767,
- 768, 0, 769, 19, 0, 0, 0, 0, 21, 0,
- 0, 0, 0, 22, 0, 0, 0, 24, 50, 581,
- 1287, 126, 127, 10, 1293, 0, 27, 0, 28, 29,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 235,
- 0, 0, 907, 0, 0, 0, 0, 0, 0, 0,
- 50, 0, 908, 0, 154, 154, 154, 0, 0, 22,
- 33, 0, 584, 0, 0, 909, 586, 603, 0, 0,
- 0, 0, 27, 0, 28, 29, 0, 0, 701, 702,
- 1289, 713, 0, 0, 0, 188, 188, 444, 31, 0,
- 0, 0, 0, 0, 0, 864, 865, 77, 32, 0,
- 864, 0, 0, 0, 0, 0, 33, 0, 0, 0,
- 0, 34, 0, 0, 188, 0, 0, 0, 0, 0,
- 0, 235, 0, 0, 0, 0, 7, 8, 9, 10,
- 0, 0, 13, 0, 0, 0, 77, 77, 77, 77,
- 0, 50, 50, 149, 149, 149, 0, 235, 0, 50,
+ 200, 0, 253, 0, 0, 0, 0, 0, 0, 1086,
+ 78, 893, 894, 0, 0, 78, 893, 0, 0, 0,
+ 0, 0, 0, 198, 198, 198, 198, 1145, 0, 1259,
+ 0, 198, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 828, 0, 0, 0, 0, 0, 719, 0,
+ 0, 0, 885, 505, 1145, 1145, 1145, 0, 0, 0,
+ 0, 0, 0, 0, 0, 78, 78, 0, 78, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 867, 867,
+ 0, 867, 0, 0, 0, 198, 0, 0, 0, 673,
+ 0, 1138, 0, 0, 0, 885, 0, 0, 0, 611,
+ 611, 0, 611, 0, 78, 78, 78, 0, 0, 902,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 8, 9, 10, 22, 0, 482, 0, 0,
- 0, 1135, 1135, 1135, 0, 0, 0, 0, 27, 77,
- 28, 29, 0, 77, 0, 0, 0, 495, 0, 0,
- 77, 77, 0, 77, 440, 0, 0, 0, 0, 0,
- 22, 0, 50, 0, 441, 0, 0, 50, 0, 50,
- 0, 0, 33, 27, 0, 28, 29, 442, 0, 443,
- 0, 0, 126, 127, 77, 0, 77, 482, 0, 177,
- 0, 77, 77, 77, 0, 0, 589, 589, 589, 178,
- 0, 0, 0, 0, 0, 0, 186, 33, 7, 8,
- 9, 10, 179, 0, 0, 0, 50, 50, 0, 50,
- 0, 0, 0, 0, 0, 0, 581, 0, 1020, 0,
- 1022, 238, 0, 27, 242, 129, 130, 0, 0, 0,
- 0, 0, 437, 439, 443, 0, 0, 22, 0, 582,
- 50, 50, 50, 0, 0, 238, 188, 345, 0, 583,
- 27, 0, 28, 29, 0, 0, 1352, 0, 0, 584,
- 0, 0, 585, 586, 0, 0, 177, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 178, 0, 0, 0,
- 0, 0, 0, 0, 33, 0, 0, 0, 0, 179,
- 0, 0, 1055, 1056, 188, 1058, 188, 0, 444, 444,
- 444, 0, 0, 0, 188, 0, 0, 0, 0, 188,
- 0, 0, 188, 603, 0, 0, 0, 0, 0, 186,
- 186, 186, 0, 1076, 0, 0, 0, 0, 0, 450,
- 8, 9, 0, 386, 12, 13, 0, 0, 688, 0,
- 14, 0, 0, 0, 77, 77, 77, 1135, 186, 0,
- 0, 7, 126, 127, 10, 17, 0, 18, 19, 0,
- 0, 0, 0, 21, 0, 0, 0, 0, 1110, 0,
- 0, 242, 24, 0, 581, 0, 0, 0, 0, 0,
- 0, 27, 0, 129, 130, 238, 1137, 0, 0, 0,
- 22, 0, 0, 0, 0, 0, 0, 582, 0, 0,
- 0, 0, 0, 27, 0, 28, 29, 583, 0, 0,
- 1135, 1135, 1135, 0, 0, 0, 77, 584, 0, 146,
- 585, 586, 0, 0, 689, 0, 838, 0, 0, 147,
- 0, 0, 1152, 50, 0, 0, 0, 33, 0, 0,
- 589, 589, 148, 589, 1157, 0, 0, 0, 77, 0,
- 589, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8, 9, 0, 386, 12, 13, 0, 0, 188, 0,
- 14, 0, 0, 0, 0, 0, 238, 242, 0, 0,
- 0, 7, 8, 9, 10, 17, 0, 18, 19, 0,
- 0, 0, 0, 21, 0, 0, 0, 0, 0, 0,
- 0, 0, 641, 0, 0, 642, 0, 911, 0, 911,
- 911, 27, 589, 129, 130, 0, 0, 0, 0, 0,
- 22, 0, 0, 0, 0, 0, 0, 0, 1207, 0,
- 186, 0, 0, 27, 0, 28, 29, 0, 0, 77,
- 77, 77, 77, 77, 0, 0, 0, 77, 0, 440,
- 911, 0, 0, 0, 0, 0, 0, 0, 0, 441,
- 0, 188, 188, 0, 188, 0, 1220, 33, 0, 1137,
- 1137, 1137, 442, 0, 0, 0, 0, 0, 186, 0,
- 186, 0, 186, 186, 186, 0, 0, 0, 186, 0,
- 0, 0, 0, 186, 0, 0, 186, 0, 0, 0,
- 77, 0, 188, 0, 0, 77, 0, 77, 0, 0,
- 0, 0, 0, 0, 0, 732, 0, 7, 8, 733,
- 10, 386, 12, 13, 0, 495, 495, 495, 14, 1302,
- 0, 0, 0, 1303, 0, 0, 0, 589, 0, 0,
- 0, 0, 0, 17, 0, 18, 19, 20, 0, 0,
- 0, 21, -494, 0, 77, 77, 22, 77, 0, 0,
- 24, 734, 0, 642, 0, 0, 1318, 0, 0, 27,
- 0, 28, 29, 0, 0, 735, 0, 736, 7, 8,
- 9, 10, 0, 0, 0, 31, 0, 0, 77, 77,
- 77, 0, 0, 0, 0, 32, 0, 0, 0, 0,
- 0, 0, 0, 33, 0, 0, 0, 0, 34, 0,
- 589, 0, 589, 0, 0, 0, 0, 22, 0, 0,
- 0, 0, 0, 589, 0, -494, 0, 589, 589, 589,
- 27, 0, 28, 29, 0, 1370, 0, 238, 242, 1371,
- 0, 0, 0, 0, 0, 0, 177, 0, 0, 0,
- 8, 9, 186, 386, 12, 13, 178, 0, 1470, 0,
- 14, 1389, 1390, 0, 33, 911, 911, 1109, 0, 179,
- 0, 0, 0, 0, 0, 17, 0, 18, 19, 0,
- 0, 0, 0, 21, 0, 0, 0, 0, 0, 0,
- 0, 186, 24, 186, 186, 1137, 0, 0, 0, 0,
- 0, 27, 0, 129, 130, 0, 0, 1109, 0, 0,
- 7, 8, 9, 10, 198, 199, 200, 0, 101, 0,
- 0, 14, 0, 0, 0, 0, 0, 0, 120, 101,
- 0, 0, 0, 0, 186, 101, 101, 188, 101, 19,
- 0, 0, 0, 0, 21, 186, 186, 0, 186, 22,
- 0, 0, 0, 24, 0, 581, 0, 0, 1137, 1137,
- 1137, 0, 27, 0, 28, 29, 8, 9, 219, 189,
- 12, 190, 0, 242, 0, 0, 14, 0, 907, 0,
- 0, 77, 0, 0, 0, 0, 186, 0, 908, 0,
- 0, 17, 0, 18, 19, 0, 33, 0, 584, 21,
- 0, 949, 586, 0, 0, 0, 0, 0, 24, 0,
- 0, 0, 0, 838, 838, 0, 838, 27, 0, 129,
- 130, 0, 0, 0, 0, 0, 0, 369, 0, 120,
- 0, 0, 101, 0, 0, 0, 101, 101, 0, 0,
- 0, 0, 0, 101, 0, 101, 101, 101, 0, 0,
- 101, 101, 101, 0, 0, 0, 0, 0, 0, 0,
- 911, 911, 1109, 1109, 1109, 0, 0, 0, 911, 539,
- 540, 541, 542, 543, 544, 545, 546, 547, 548, 549,
- 550, 551, 552, 553, 554, 555, 556, 0, 0, 0,
- 1109, 1109, 1109, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 732, 0, 7,
- 8, 733, 10, 386, 12, 13, 0, 238, 242, 238,
- 14, 188, 0, 0, 465, 101, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 18, 19, 20,
- 0, 0, 0, 21, 101, 0, 0, 0, 22, 186,
- 186, 1107, 24, 734, 0, 642, 238, 0, 0, 0,
- 0, 27, 0, 28, 29, 0, 0, 735, 0, 736,
- 0, 0, 0, 0, 0, 911, 911, 31, 911, 0,
- 0, 0, 0, 101, 0, 0, 0, 32, 0, 0,
- 0, 1107, 0, 0, 0, 33, 0, 0, 0, 244,
- 34, 0, 8, 9, 0, 0, 12, 13, 0, 188,
- 0, 188, 14, 0, 0, 0, 0, 0, 0, 0,
- 0, 186, 0, 0, 0, 0, 0, 17, 0, 18,
- 101, 0, 101, 101, 0, 21, 0, 245, 246, 0,
- 0, 0, 450, 0, 24, 0, 247, 0, 0, 0,
- 0, 0, 0, 27, 0, 129, 130, 0, 248, 101,
- 0, 0, 249, 250, 251, 252, 253, 254, 255, 256,
- 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 101, 0, 270, 271, 272, 0, 0,
- 273, 0, 0, 274, 0, 0, 0, 0, 0, 101,
- 0, 0, 0, 101, 0, 0, 101, 0, 0, 0,
- 275, 101, 0, 0, 0, 0, 444, 0, 0, 0,
- 0, 0, 0, 0, 238, 540, 541, 542, 543, 544,
- 545, 546, 547, 548, 549, 550, 551, 552, 553, 554,
- 555, 556, 0, 0, 186, 186, 186, 186, 1107, 0,
- 1219, 0, 186, 542, 543, 544, 545, 546, 547, 548,
- 549, 550, 551, 552, 553, 554, 555, 556, 0, 0,
- 0, 101, 0, 724, 1107, 1107, 1107, 0, 0, 444,
- 444, 444, 0, 0, 0, 0, 0, 0, 7, 8,
- 9, 10, 386, 12, 13, 0, 0, 955, 101, 14,
- 0, 0, 188, 0, 0, 186, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 0, 18, 19, 0, 0,
- 0, 0, 21, 0, 0, 0, 0, 22, 0, 0,
- 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
- 27, 0, 28, 29, 1383, 0, -449, -449, -449, -449,
- -449, -449, -449, 0, 0, -449, 31, -449, 0, 186,
- 186, 0, 186, 0, 0, 0, 32, 0, -449, 0,
- -449, -449, 101, 0, 33, -449, 0, 0, 0, 34,
- -449, 0, 0, 101, 101, -449, 101, 101, 0, -449,
- 0, -449, 0, 186, 0, 186, 0, 0, -449, 0,
- -449, -449, -449, -449, -449, 0, -449, -449, -449, -449,
- -449, -449, -449, -449, -449, -449, -449, -449, -449, -449,
- -449, -449, -449, -449, -449, -449, -449, -449, -449, 0,
- -449, -449, -449, 0, -449, -449, -449, -449, -449, -449,
- 0, -449, -449, 0, 0, 120, 0, 1384, 0, 0,
- 0, 0, -449, -449, -449, 0, -449, 219, 0, 0,
- 161, 0, 7, 8, 9, 10, 11, 12, 13, 0,
- 8, 9, 0, 14, 12, 13, 724, 0, 0, 0,
- 14, 0, 0, 0, 0, 0, 15, 16, 17, 0,
- 18, 19, 20, 0, 0, 17, 21, 18, 0, 0,
- 1107, 22, 0, 21, 23, 24, 25, 0, 26, 0,
- 0, 0, 24, 0, 27, 0, 28, 29, 0, 0,
- 30, 27, 0, 129, 130, 0, 0, 0, 0, 0,
- 31, 0, 0, 0, 0, 724, 0, 0, 101, 0,
- 32, 0, 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 35,
- 0, 0, 0, 1107, 1107, 1107, 0, 0, 0, 0,
- 0, 101, 101, 101, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 101, 0, 1360, 186, 1230, 1231, 1232,
- 10, 386, 12, 282, 283, 284, 0, 285, 14, 1233,
- 0, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242,
- 1243, 15, 16, 17, 286, 18, 19, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 1244, 299, 675, 0, 1245, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 302, 101, 0, 101, 0,
- 0, 0, 0, 303, 304, 305, 0, 0, 0, 101,
- 0, 306, 307, 308, 0, 0, 0, 0, 309, 0,
- 1246, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1361, 310, 1229, 0, 1230,
- 1231, 1232, 10, 386, 12, 282, 283, 284, 0, 285,
- 14, 1233, 0, 1234, 1235, 1236, 1237, 1238, 1239, 1240,
- 1241, 1242, 1243, 15, 16, 17, 286, 18, 19, 20,
- 0, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 0, 0, 294, 295, 296, 297,
- 298, 27, 0, 1244, 299, 675, 0, 1245, 300, 0,
- 0, 0, 0, 0, 301, 0, 0, 302, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 305, 724, 0,
- 0, 0, 0, 306, 307, 308, 0, 0, 0, 0,
- 309, 517, 1246, 281, 8, 9, 10, 386, 12, 282,
- 283, 284, 688, 285, 14, 101, 0, 0, 310, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
- 286, 18, 19, 20, 0, 287, 288, 21, 0, 289,
- 290, 291, 22, 292, 293, 0, 24, 0, 581, 0,
- 294, 295, 296, 297, 298, 27, 0, 28, 299, -285,
- 0, 0, 300, 0, 0, 0, 0, 0, 301, 101,
- 101, 869, 101, 0, 0, 0, 0, 0, 0, 303,
- 304, 870, 0, 0, 0, 0, 0, 306, 307, 308,
- 0, 584, 0, 0, 871, 586, 0, 517, 689, 7,
- 8, 9, 10, 386, 12, 282, 283, 284, 688, 285,
- 14, 0, 310, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 286, 18, 19, 20,
- 724, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 581, 0, 294, 295, 296, 297,
- 298, 27, 0, 28, 29, -285, 0, 0, 300, 0,
- 0, 0, 724, 0, 301, 0, 0, 1132, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 1133, 0, 0,
- 101, 0, 101, 306, 307, 308, 0, 584, 0, 0,
- 1134, 586, 0, 687, 689, 281, 8, 9, 10, 386,
- 12, 282, 283, 284, 688, 285, 14, 0, 310, 0,
+ 0, 0, 0, 0, 0, 0, 945, 945, 1147, 1147,
+ 1147, 0, 0, 0, 945, 0, 0, 885, 0, 0,
+ 198, 198, 0, 198, 0, 0, 0, 0, 0, 0,
+ 1180, 0, 0, 637, 0, 0, 1186, 1147, 1147, 1147,
+ 0, 0, 0, 719, 0, 0, 0, 611, 0, 611,
+ 611, 0, 611, 0, 0, 719, 0, 0, 0, 198,
+ 0, 198, 0, 102, 0, 0, 0, 0, 200, 1056,
+ 0, 1058, 121, 102, 0, 0, 0, 0, 0, 102,
+ 102, 0, 102, 0, 0, 0, 0, 0, 0, 719,
+ 0, 719, 688, 611, 0, 689, 1176, 0, 0, 0,
+ 691, 0, 0, 0, 0, 0, 0, 0, 76, 0,
+ 0, 0, 0, 0, 231, 0, 0, 0, 0, 1233,
+ 0, 0, 0, 945, 945, 0, 945, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 406, 0, 408, 0,
+ 0, 0, 0, 1092, 1093, 0, 1095, 0, 0, 0,
+ 0, 505, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 200, 0, 200, 0, 1176, 1176, 1176, 0,
+ 777, 1145, 0, 385, 1113, 121, 885, 0, 0, 0,
+ 0, 611, 102, 102, 0, 0, 0, 0, 0, 102,
+ 78, 102, 102, 102, 0, 412, 102, 102, 102, 8,
+ 9, 0, 163, 12, 13, 885, 0, 1530, 0, 14,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 286, 18, 19, 20, 0, 287, 288, 21,
- 0, 289, 290, 291, 22, 292, 293, 0, 24, 0,
- 0, 0, 294, 295, 296, 297, 298, 27, 0, 28,
- 299, 0, 0, 0, 300, 0, 0, 0, 0, 0,
- 301, 0, 0, 302, 0, 0, 0, 0, 0, 0,
- 0, 303, 304, 305, 0, 0, 0, 0, 0, 306,
- 307, 308, 0, 0, 0, 0, 309, 0, 0, 0,
- 689, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, -759, 802, 310, 281, 8, 9, 10, 386,
- 12, 282, 283, 284, 0, 285, 14, 0, 0, 0,
+ 0, 0, 0, 16, 1148, 17, 18, 0, 0, 0,
+ 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
+ 23, 1145, 1145, 1145, 0, 0, 0, 0, 0, 26,
+ 0, 130, 131, 0, 611, 0, 611, 0, 0, 0,
+ 0, 0, 0, 0, 0, 198, 0, 611, 0, 0,
+ 0, 902, 902, 902, 466, 7, 8, 9, 10, 163,
+ 12, 13, 487, 102, 990, 0, 14, 0, 0, 1191,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 286, 18, 19, 20, 0, 287, 288, 21,
- 0, 289, 290, 291, 22, 292, 293, 0, 24, 0,
- 0, 0, 294, 295, 296, 297, 298, 27, 0, 28,
- 299, 1449, 0, -749, 300, 0, 0, 0, 0, 0,
- 301, 0, 0, 302, 0, 0, 0, 0, 0, 0,
- 0, 303, 304, 305, 0, 0, 0, 0, 0, 306,
- 307, 308, 0, 0, 0, 678, 309, 790, 791, 792,
- 10, 0, 12, 499, 283, 284, 0, 285, 14, 0,
- 0, 0, 0, 0, 310, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 286, 18, 0, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 793, 794, 679, 0, 0, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 302, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 305, 0, 0, 0, 0,
- 0, 306, 307, 308, 0, 0, 0, 0, 309, 795,
- 678, 0, 790, 791, 792, 10, 0, 12, 499, 283,
- 284, 0, 285, 14, 0, 940, 310, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 17, 286,
- 18, 0, 20, 0, 287, 288, 21, 0, 289, 290,
- 291, 22, 292, 293, 0, 24, 0, 0, 0, 294,
- 295, 296, 297, 298, 27, 0, 793, 794, 679, 0,
- 0, 300, 0, 0, 0, 0, 0, 301, 0, 0,
- 302, 0, 0, 0, 0, 0, 0, 0, 303, 304,
- 305, 0, 0, 0, 0, 0, 306, 307, 308, 0,
- 0, 0, 0, 309, 795, 678, 0, 790, 791, 792,
- 10, 0, 12, 499, 283, 284, 0, 285, 14, 0,
- 0, 310, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 286, 18, 0, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 793, 794, 679, 0, 0, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 302, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 305, 0, 0, 0, 0,
- 0, 306, 307, 308, 0, 0, 0, 678, 309, 790,
- 791, 792, 10, 0, 12, 499, 283, 284, 0, 285,
- 14, 0, 0, 0, 0, -453, 310, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 286, 18, 0, 20,
- 0, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 0, 0, 294, 295, 296, 297,
- 298, 27, 0, 793, 794, 679, 0, 0, 300, 0,
- 0, 0, 0, 0, 301, 0, 0, 302, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 305, 0, 0,
- 0, 0, 0, 306, 307, 308, 0, 0, 0, 678,
- 309, 281, 8, 9, 10, 0, 12, 499, 283, 284,
- 0, 285, 14, 0, 0, 0, 0, 1263, 310, 0,
- 0, 0, 0, 0, 0, 0, 0, 17, 286, 18,
- 0, 20, 0, 287, 288, 21, 0, 289, 290, 291,
- 22, 292, 293, 0, 24, 0, 0, 0, 294, 295,
- 296, 297, 298, 27, 0, 28, 299, 679, 0, 0,
- 300, 0, 0, 0, 0, 0, 301, 0, 0, 302,
- 0, 0, 0, 0, 0, 0, 0, 303, 304, 305,
- 0, 0, 0, 0, 0, 306, 307, 308, 0, 0,
- 0, 0, 309, 0, 0, 517, 0, 281, 8, 9,
- 10, 1267, 12, 282, 283, 284, 0, 285, 14, 0,
- 310, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 286, 18, 0, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 28, 299, -285, 0, 0, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 518, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 519, 0, 0, 0, 0,
- 0, 306, 307, 308, 0, 0, 0, 678, 520, 281,
- 8, 9, 10, 0, 12, 499, 283, 284, 0, 285,
- 14, 0, 0, 0, 0, 0, 310, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 286, 18, 0, 20,
- 0, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 0, 0, 294, 295, 296, 297,
- 298, 27, 0, 28, 299, 679, 0, 0, 300, 0,
- 0, 0, 0, 0, 301, 0, 0, 302, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 305, 0, 0,
- 0, 0, 0, 306, 307, 308, 0, 0, 0, 802,
- 309, 281, 8, 9, 10, 0, 12, 499, 283, 284,
- 0, 285, 14, 0, 0, 0, 0, 0, 310, 0,
- 0, 0, 0, 0, 0, 0, 0, 17, 286, 18,
- 0, 20, 0, 287, 288, 21, 0, 289, 290, 291,
- 22, 292, 293, 0, 24, 0, 0, 0, 294, 295,
- 296, 297, 298, 27, 0, 28, 299, 0, 0, 0,
- 300, -749, 0, 0, 0, 0, 301, 0, 0, 302,
- 0, 0, 0, 0, 0, 0, 0, 303, 304, 305,
- 0, 0, 0, 0, 0, 306, 307, 308, 0, 0,
- 0, 517, 309, 7, 8, 9, 10, 0, 12, 282,
- 283, 284, 0, 285, 14, 0, 0, 0, 0, 0,
- 310, 0, 0, 0, 0, 0, 0, 0, 0, 17,
- 286, 18, 0, 20, 0, 287, 288, 21, 0, 289,
- 290, 291, 22, 292, 293, 0, 24, 0, 0, 0,
- 294, 295, 296, 297, 298, 27, 0, 28, 29, -285,
- 0, 0, 300, 0, 0, 0, 0, 0, 301, 0,
- 0, 1421, 0, 0, 0, 0, 0, 0, 0, 303,
- 304, 1422, 0, 0, 0, 0, 0, 306, 307, 308,
- 0, 0, 0, 1499, 1423, 281, 8, 9, 10, 0,
- 12, 282, 283, 284, 0, 285, 14, 0, 0, 0,
- 0, 0, 310, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 286, 18, 0, 20, 0, 287, 288, 21,
- 0, 289, 290, 291, 22, 292, 293, 0, 24, 0,
- 0, 0, 294, 295, 296, 297, 298, 27, 0, 28,
- 299, 0, 0, -174, 300, 0, 0, 0, 0, 0,
- 301, 0, 0, 302, 0, 0, 0, 0, 0, 0,
- 0, 303, 304, 305, 0, 0, 0, 0, 0, 306,
- 307, 308, 0, 0, 0, 802, 309, 281, 8, 9,
- 10, 0, 12, 499, 283, 284, 0, 285, 14, 0,
- 0, 0, 0, 0, 310, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 286, 18, 0, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 28, 299, 0, 0, 0, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 302, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 305, 0, 0, 0, 0,
- 0, 306, 307, 308, 0, 0, 0, 888, 309, 281,
- 8, 9, 10, 0, 12, 499, 283, 284, 0, 285,
- 14, 0, 0, 0, -749, 0, 310, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 286, 18, 0, 20,
- 0, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 0, 0, 294, 295, 296, 297,
- 298, 27, 0, 28, 299, 0, 0, 0, 300, 0,
- 0, 0, 0, 0, 301, 0, 0, 302, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 305, 0, 0,
- 0, 0, 0, 306, 307, 308, 0, 0, 0, 890,
- 309, 281, 8, 9, 10, 0, 12, 499, 283, 284,
- 0, 285, 14, 0, 0, 0, 0, 0, 310, 0,
- 0, 0, 0, 0, 0, 0, 0, 17, 286, 18,
- 0, 20, 0, 287, 288, 21, 0, 289, 290, 291,
- 22, 292, 293, 0, 24, 0, 0, 0, 294, 295,
- 296, 297, 298, 27, 0, 28, 299, 0, 0, 0,
- 300, 0, 0, 0, 0, 0, 301, 0, 0, 302,
- 0, 0, 0, 0, 0, 0, 0, 303, 304, 305,
- 0, 0, 0, 0, 0, 306, 307, 308, 0, 0,
- 0, 1434, 309, 281, 8, 9, 10, 0, 12, 499,
- 283, 284, 0, 285, 14, 0, 0, 0, 0, 0,
- 310, 0, 0, 0, 0, 0, 0, 0, 0, 17,
- 286, 18, 0, 20, 0, 287, 288, 21, 0, 289,
- 290, 291, 22, 292, 293, 0, 24, 0, 0, 0,
- 294, 295, 296, 297, 298, 27, 0, 28, 299, 0,
- 0, 0, 300, 0, 0, 0, 0, 0, 301, 0,
- 0, 302, 0, 0, 0, 0, 0, 0, 0, 303,
- 304, 305, 0, 0, 0, 0, 0, 306, 307, 308,
- 281, 8, 9, 10, 309, 12, 499, 283, 284, 0,
- 285, 14, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 310, 0, 0, 0, 17, 286, 18, 0,
- 20, 0, 287, 288, 21, 0, 289, 290, 291, 22,
- 292, 293, 0, 24, 0, 0, 0, 294, 295, 296,
- 297, 298, 27, 0, 28, 299, 0, 0, 0, 300,
- 0, 0, 0, 0, 0, 301, 0, 0, 302, 0,
- 0, 0, 0, 0, 0, 0, 303, 304, 305, 0,
- 0, 0, 0, 0, 306, 307, 308, 0, 0, 0,
- 0, 309, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 310,
- 841, 1230, 1231, 1232, 10, 386, 12, 282, 283, 284,
- 0, 285, 14, 1233, 0, 1234, 1235, 1236, 1237, 1238,
- 1239, 1240, 1241, 1242, 1243, 15, 16, 17, 286, 18,
- 19, 20, 0, 287, 288, 21, 0, 289, 290, 291,
- 22, 292, 293, 0, 24, 0, 0, 0, 294, 295,
- 296, 297, 298, 27, 0, 1244, 299, 675, 0, 1245,
- 300, 0, 0, 0, 0, 0, 301, 0, 0, 302,
- 0, 0, 0, 0, 0, 0, 0, 303, 304, 305,
- 0, 0, 0, 0, 0, 306, 307, 308, 0, 0,
- 0, 0, 309, 0, 1246, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1365,
- 310, 1230, 1231, 1232, 10, 386, 12, 282, 283, 284,
- 0, 285, 14, 1233, 0, 1234, 1235, 1236, 1237, 1238,
- 1239, 1240, 1241, 1242, 1243, 15, 16, 17, 286, 18,
- 19, 20, 0, 287, 288, 21, 0, 289, 290, 291,
- 22, 292, 293, 0, 24, 0, 0, 0, 294, 295,
- 296, 297, 298, 27, 0, 1244, 299, 675, 0, 1245,
- 300, 0, 0, 0, 0, 0, 301, 0, 0, 302,
- 0, 0, 0, 0, 0, 0, 0, 303, 304, 305,
- 0, 0, 0, 0, 0, 306, 307, 308, 0, 0,
- 0, 0, 309, 0, 1246, 0, 0, 1230, 1231, 1232,
- 10, 386, 12, 282, 283, 284, 0, 285, 14, 1233,
- 310, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242,
- 1243, 15, 16, 17, 286, 18, 19, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 1244, 299, 1476, 0, 1245, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 302, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 305, 0, 0, 0, 0,
- 0, 306, 307, 308, 0, 0, 0, 0, 309, 0,
- 1246, 0, 0, 1230, 1231, 1232, 10, 386, 12, 282,
- 283, 284, 0, 285, 14, 1233, 310, 1234, 1235, 1236,
- 1237, 1238, 1239, 1240, 1241, 1242, 1243, 15, 16, 17,
- 286, 18, 19, 20, 0, 287, 288, 21, 0, 289,
- 290, 291, 22, 292, 293, 0, 24, 0, 0, 0,
- 294, 295, 296, 297, 298, 27, 0, 1244, 299, 0,
- 0, 1245, 300, 0, 0, 0, 0, 0, 301, 0,
- 0, 302, 0, 0, 0, 0, 0, 0, 0, 303,
- 304, 305, 0, 0, 0, 0, 0, 306, 307, 308,
- 0, 0, 0, 0, 309, 0, 1246, 281, 8, 9,
- 10, 386, 12, 282, 283, 284, 688, 285, 14, 0,
- 0, 0, 310, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 286, 18, 19, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 581, 0, 294, 295, 296, 297, 298, 27,
- 0, 28, 299, 0, 0, 0, 300, 0, 0, 0,
- 0, 0, 301, 0, 0, 869, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 870, 0, 0, 0, 0,
- 0, 306, 307, 308, 0, 584, 0, 0, 871, 586,
- 0, 0, 689, 7, 8, 9, 10, 386, 12, 282,
- 283, 284, 688, 285, 14, 0, 310, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
- 286, 18, 19, 20, 0, 287, 288, 21, 0, 289,
- 290, 291, 22, 292, 293, 0, 24, 0, 581, 0,
- 294, 295, 296, 297, 298, 27, 0, 28, 29, 0,
- 0, 0, 300, 0, 0, 0, 0, 0, 301, 0,
- 0, 1132, 0, 0, 0, 0, 0, 0, 0, 303,
- 304, 1133, 0, 0, 0, 0, 0, 306, 307, 308,
- 0, 584, 0, 0, 1134, 586, 0, 0, 689, 281,
- 8, 9, 10, 0, 12, 282, 283, 284, 0, 285,
- 14, 0, 310, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 286, 18, 0, 20,
- 0, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 581, 0, 294, 295, 296, 297,
- 298, 27, 0, 28, 299, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 301, 0, 0, 869, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 870, 0, 0,
- 0, 0, 0, 306, 307, 308, 0, 584, 0, 0,
- 871, 586, 7, 8, 9, 10, 0, 12, 282, 283,
- 284, 0, 285, 14, 0, 0, 0, 0, 310, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 17, 286,
- 18, 0, 20, 0, 287, 288, 21, 0, 289, 290,
- 291, 22, 292, 293, 0, 24, 0, 581, 0, 294,
- 295, 296, 297, 298, 27, 0, 28, 29, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 301, 0, 0,
- 1132, 0, 0, 0, 0, 0, 0, 0, 303, 304,
- 1133, 0, 0, 0, 0, 0, 306, 307, 308, 0,
- 584, 0, 0, 1134, 586, 281, 8, 9, 10, 0,
- 12, 499, 283, 284, 0, 285, 14, 0, 0, 0,
- 0, 310, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 286, 18, 0, 20, 0, 287, 288, 21,
- 0, 289, 290, 291, 22, 292, 293, 0, 24, 0,
- 0, 0, 294, 295, 296, 297, 298, 27, 0, 28,
- 299, 0, 0, 1342, 300, 0, 0, 0, 0, 0,
- 301, 0, 0, 302, 0, 0, 0, 0, 0, 0,
- 0, 303, 304, 305, 0, 0, 0, 0, 0, 306,
- 307, 308, 0, 0, 0, 0, 309, 281, 8, 9,
- 10, 386, 12, 282, 283, 284, 0, 285, 14, 0,
- 0, 0, 0, 0, 310, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 286, 18, 19, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 28, 299, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 301, 0, 0, 302, 0, 0, 0, 0,
- 0, 0, 0, 303, 304, 305, 0, 0, 0, 0,
- 0, 306, 307, 308, 281, 8, 9, 10, 309, 12,
- 282, 283, 284, 0, 285, 14, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 310, 0, 0, 0,
- 17, 286, 18, 0, 20, 0, 287, 288, 21, 0,
- 289, 290, 291, 22, 292, 293, 0, 24, 0, 0,
- 0, 294, 295, 296, 297, 298, 27, 0, 28, 299,
- 0, 0, 0, 300, 0, 0, 0, 0, 0, 301,
- 0, 0, 302, 0, 0, 0, 0, 0, 0, 0,
- 303, 304, 305, 0, 0, 0, 0, 0, 306, 307,
- 308, 281, 8, 9, 10, 309, 12, 499, 283, 284,
- 0, 285, 14, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 310, 0, 0, 0, 17, 286, 18,
- 0, 20, 0, 287, 288, 21, 0, 289, 290, 291,
- 22, 292, 293, 0, 24, 0, 0, 0, 294, 295,
- 296, 297, 298, 27, 0, 28, 299, 0, 0, 0,
- 300, 0, 0, 0, 0, 0, 301, 0, 0, 302,
- 0, 0, 0, 0, 0, 0, 0, 303, 304, 305,
- 0, 0, 0, 0, 0, 306, 307, 308, 281, 8,
- 9, 10, 309, 12, 499, 283, 284, 0, 285, 14,
+ 16, 1196, 17, 18, 102, 0, 0, 0, 20, 0,
+ 0, 0, 0, 21, 611, 611, 611, 23, 0, 0,
+ 0, 0, 0, 0, 0, 0, 26, 0, 27, 28,
+ 8, 9, 0, 201, 12, 202, 0, 0, 0, 0,
+ 14, 0, 30, 102, 466, 466, 466, 1180, 0, 0,
+ 0, 0, 31, 947, 16, 0, 17, 18, 902, 0,
+ 32, 0, 20, 0, 0, 33, 0, 0, 200, 0,
+ 0, 23, 0, 0, 0, 0, 0, 0, 0, 0,
+ 26, 0, 130, 131, 0, 0, 0, 1247, 0, 0,
+ 0, 102, 0, 102, 102, 1024, 8, 761, 10, 201,
+ 12, 202, 991, 0, 0, 0, 14, 0, 0, 688,
+ 689, 0, 691, 0, 0, 0, 0, 0, 0, 0,
+ 16, 0, 17, 18, 0, 0, 1260, 0, 20, 0,
+ 0, 0, 0, 21, 0, 0, 0, 23, 102, 0,
+ 0, 0, 0, 777, 0, 777, 26, 0, 27, 28,
+ 1034, 1041, 777, 0, 1026, 0, 102, 0, 777, 0,
+ 0, 0, 30, 102, 0, 0, 102, 0, 0, 0,
+ 0, 102, 31, 0, 0, 0, 0, 0, 0, 0,
+ 32, 0, 0, 0, 0, 33, 0, 0, 0, 1347,
+ 0, 0, 0, 1348, 0, 0, 0, 0, 0, 7,
+ 8, 9, 10, 163, 12, 13, 0, 0, 0, 0,
+ 14, 0, 547, 611, 611, 611, 611, 611, 0, 0,
+ 0, 611, 0, 0, 16, 0, 17, 18, 1364, 673,
+ 0, 0, 20, 0, 0, 0, 0, 21, 102, 0,
+ 752, 23, 0, 0, 902, 902, 902, 0, 0, 0,
+ 26, 0, 27, 28, 0, 0, 760, 0, 7, 8,
+ 761, 10, 163, 12, 13, 102, 30, 0, 0, 14,
+ 0, 0, 0, 0, 0, 0, 31, 0, 0, 0,
+ 0, 0, 0, 16, 32, 17, 18, 19, 0, 33,
+ 0, 20, -521, 0, 0, 0, 21, 0, 0, 0,
+ 23, 762, 1420, 164, 0, 0, 1421, 0, 0, 26,
+ 0, 27, 28, 0, 0, 763, 1462, 764, 0, 141,
+ 145, 0, 0, 0, 0, 30, 0, 0, 1439, 1440,
+ 611, 611, 0, 611, 0, 31, 0, 0, 0, 0,
+ 0, 102, 0, 32, 0, 0, 0, 0, 33, 0,
+ 0, 0, 102, 102, 0, 102, 102, 0, 0, 0,
+ 0, 0, 0, 0, -521, 0, 1463, 557, 558, 559,
+ 560, 561, 562, 563, 564, 565, 566, 567, 568, 569,
+ 570, 571, 572, 573, 574, 575, 576, 577, 578, 0,
+ 0, 0, 1034, 0, 0, 0, 0, 0, 0, 1433,
+ 0, -475, -475, -475, -475, -475, -475, -475, 102, 0,
+ -475, 0, -475, 0, 0, 102, 121, 0, 0, 0,
+ 0, 0, 0, -475, 0, -475, 777, 231, 0, -475,
+ 0, 0, 0, 0, -475, 0, 0, 0, 0, -475,
+ 0, 0, 0, -475, 0, -475, 0, 0, 0, 0,
+ 752, 0, -475, 0, -475, -475, -475, -475, -475, 0,
+ -475, -475, -475, -475, -475, -475, -475, -475, -475, -475,
+ -475, -475, -475, -475, -475, -475, -475, -475, -475, -475,
+ -475, -475, -475, 0, -475, -475, -475, 0, -475, -475,
+ -475, -475, -475, -475, 0, -475, 0, 0, 0, 0,
+ 1434, 0, 0, 0, 0, -475, -475, -475, 752, -475,
+ 0, 102, 0, 0, 0, 0, 0, 0, 406, 408,
+ 0, 0, 0, 0, 0, 0, 505, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 102, 102, 102, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 102, 0, 0,
+ 0, 0, 539, 0, 296, 8, 9, 10, 163, 12,
+ 297, 298, 299, 717, 300, 14, 0, 0, 0, 0,
+ 1339, 0, 0, 0, 0, 1339, 0, 0, 0, 16,
+ 301, 17, 18, 19, 0, 302, 303, 20, 0, 304,
+ 305, 306, 21, 307, 308, 0, 23, 0, 605, 0,
+ 309, 310, 311, 312, 313, 26, 0, 27, 315, -308,
+ 0, 0, 316, 0, 0, 0, 0, 0, 317, 0,
+ 102, 898, 102, 0, 0, 688, 689, 0, 691, 319,
+ 320, 899, 0, 102, 0, 0, 0, 322, 323, 324,
+ 0, 608, 0, 0, 900, 610, 0, 0, 0, 0,
+ 1410, 0, 1270, 1271, 1272, 10, 163, 12, 297, 298,
+ 299, 326, 300, 14, 1273, 1407, 1274, 1275, 1276, 1277,
+ 1278, 1279, 1280, 1281, 1282, 1283, 15, 16, 301, 17,
+ 18, 19, 0, 302, 303, 20, 0, 304, 305, 306,
+ 21, 307, 308, 1284, 23, 1285, 0, 0, 309, 310,
+ 311, 312, 313, 26, 0, 1286, 315, 704, 0, 1287,
+ 316, 0, 0, 0, 0, 0, 317, 0, 0, 318,
+ 0, 0, 0, 0, 0, 0, 0, 319, 320, 321,
+ 0, 0, 0, 0, 0, 322, 323, 324, 0, 0,
+ 0, 0, 325, 0, 1288, 0, 0, 0, 752, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1411, 326,
+ 1269, 0, 1270, 1271, 1272, 10, 163, 12, 297, 298,
+ 299, 0, 300, 14, 1273, 102, 1274, 1275, 1276, 1277,
+ 1278, 1279, 1280, 1281, 1282, 1283, 15, 16, 301, 17,
+ 18, 19, 0, 302, 303, 20, 0, 304, 305, 306,
+ 21, 307, 308, 1284, 23, 1285, 0, 0, 309, 310,
+ 311, 312, 313, 26, 0, 1286, 315, 704, 0, 1287,
+ 316, 0, 0, 0, 0, 0, 317, 0, 0, 318,
+ 0, 102, 102, 0, 102, 0, 0, 319, 320, 321,
+ 0, 0, 0, 0, 0, 322, 323, 324, 0, 0,
+ 0, 0, 325, 0, 1288, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 326,
+ 0, 0, 539, 0, 7, 8, 9, 10, 163, 12,
+ 297, 298, 299, 717, 300, 14, 0, 0, 0, 0,
+ 0, 0, 0, 0, 752, 0, 0, 0, 0, 16,
+ 301, 17, 18, 19, 0, 302, 303, 20, 0, 304,
+ 305, 306, 21, 307, 308, 0, 23, 0, 605, 0,
+ 309, 310, 311, 312, 313, 26, 752, 27, 28, -308,
+ 0, 0, 316, 0, 0, 0, 0, 0, 317, 0,
+ 0, 1171, 0, 0, 102, 0, 102, 0, 0, 319,
+ 320, 1172, 0, 0, 0, 0, 0, 322, 323, 324,
+ 0, 608, 0, 0, 1173, 610, 716, 0, 296, 8,
+ 9, 10, 163, 12, 297, 298, 299, 717, 300, 14,
+ 0, 326, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 301, 17, 18, 19, 0, 302,
+ 303, 20, 0, 304, 305, 306, 21, 307, 308, 0,
+ 23, 0, 0, 0, 309, 310, 311, 312, 313, 26,
+ 0, 27, 315, 0, 0, 0, 316, 0, 0, 0,
+ 0, 0, 317, 0, 0, 318, 0, 0, 0, 0,
+ 0, 0, 0, 319, 320, 321, 0, 0, 0, 0,
+ 0, 322, 323, 324, 0, 0, 0, 831, 325, 296,
+ 8, 9, 10, 163, 12, 297, 298, 299, 0, 300,
+ 14, 0, 0, -792, 0, 326, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 301, 17, 18, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 27, 315, 1507, 0, -782, 316, 0, 0,
+ 0, 0, 0, 317, 0, 0, 318, 0, 0, 0,
+ 0, 0, 0, 0, 319, 320, 321, 0, 0, 0,
+ 0, 0, 322, 323, 324, 0, 0, 0, 707, 325,
+ 819, 820, 821, 10, 0, 12, 521, 298, 299, 0,
+ 300, 14, 0, 0, 0, 0, 326, 0, 0, 0,
+ 0, 0, 0, 0, 0, 16, 301, 17, 0, 19,
+ 0, 302, 303, 20, 0, 304, 305, 306, 21, 307,
+ 308, 0, 23, 0, 0, 0, 309, 310, 311, 312,
+ 313, 26, 0, 822, 823, 708, 0, 0, 316, 0,
+ 0, 0, 0, 0, 317, 0, 0, 318, 0, 0,
+ 0, 0, 0, 0, 0, 319, 320, 321, 0, 0,
+ 0, 0, 0, 322, 323, 324, 0, 0, 0, 0,
+ 325, 824, 707, 0, 819, 820, 821, 10, 0, 12,
+ 521, 298, 299, 0, 300, 14, 977, 326, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
+ 301, 17, 0, 19, 0, 302, 303, 20, 0, 304,
+ 305, 306, 21, 307, 308, 0, 23, 0, 0, 0,
+ 309, 310, 311, 312, 313, 26, 0, 822, 823, 708,
+ 0, 0, 316, 0, 0, 0, 0, 0, 317, 0,
+ 0, 318, 0, 0, 0, 0, 0, 0, 0, 319,
+ 320, 321, 0, 0, 0, 0, 0, 322, 323, 324,
+ 0, 0, 0, 0, 325, 824, 707, 0, 819, 820,
+ 821, 10, 0, 12, 521, 298, 299, 0, 300, 14,
+ 0, 326, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 301, 17, 0, 19, 0, 302,
+ 303, 20, 0, 304, 305, 306, 21, 307, 308, 0,
+ 23, 0, 0, 0, 309, 310, 311, 312, 313, 26,
+ 0, 822, 823, 708, 0, 0, 316, 0, 0, 0,
+ 0, 0, 317, 0, 0, 318, 0, 0, 0, 0,
+ 0, 0, 0, 319, 320, 321, 0, 0, 0, 0,
+ 0, 322, 323, 324, 0, 0, 0, 707, 325, 819,
+ 820, 821, 10, 0, 12, 521, 298, 299, 0, 300,
+ 14, 0, 0, 0, -479, 326, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 301, 17, 0, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 822, 823, 708, 0, 0, 316, 0, 0,
+ 0, 0, 0, 317, 0, 0, 318, 0, 0, 0,
+ 0, 0, 0, 0, 319, 320, 321, 0, 0, 0,
+ 0, 0, 322, 323, 324, 0, 0, 0, 707, 325,
+ 296, 8, 9, 10, 0, 12, 521, 298, 299, 0,
+ 300, 14, 0, 0, 0, 1308, 326, 0, 0, 0,
+ 0, 0, 0, 0, 0, 16, 301, 17, 0, 19,
+ 0, 302, 303, 20, 0, 304, 305, 306, 21, 307,
+ 308, 0, 23, 0, 0, 0, 309, 310, 311, 312,
+ 313, 26, 0, 27, 315, 708, 0, 0, 316, 0,
+ 0, 0, 0, 0, 317, 0, 0, 318, 0, 0,
+ 0, 0, 0, 0, 0, 319, 320, 321, 0, 0,
+ 0, 0, 0, 322, 323, 324, 0, 0, 0, 0,
+ 325, 0, 539, 0, 296, 8, 9, 10, 1312, 12,
+ 297, 298, 299, 0, 300, 14, 0, 326, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
+ 301, 17, 0, 19, 0, 302, 303, 20, 0, 304,
+ 305, 306, 21, 307, 308, 0, 23, 0, 0, 0,
+ 309, 310, 311, 312, 313, 26, 0, 27, 315, -308,
+ 0, 0, 316, 0, 0, 0, 0, 0, 317, 0,
+ 0, 540, 0, 0, 0, 0, 0, 0, 0, 319,
+ 320, 541, 0, 0, 0, 0, 0, 322, 323, 324,
+ 0, 0, 0, 707, 542, 296, 8, 9, 10, 0,
+ 12, 521, 298, 299, 0, 300, 14, 0, 0, 0,
+ 0, 326, 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 301, 17, 0, 19, 0, 302, 303, 20, 0,
+ 304, 305, 306, 21, 307, 308, 0, 23, 0, 0,
+ 0, 309, 310, 311, 312, 313, 26, 0, 27, 315,
+ 708, 0, 0, 316, 0, 0, 0, 0, 0, 317,
+ 0, 0, 318, 0, 0, 0, 0, 0, 0, 0,
+ 319, 320, 321, 0, 0, 0, 0, 0, 322, 323,
+ 324, 0, 0, 0, 831, 325, 296, 8, 9, 10,
+ 0, 12, 521, 298, 299, 0, 300, 14, 0, 0,
+ 0, 0, 326, 0, 0, 0, 0, 0, 0, 0,
+ 0, 16, 301, 17, 0, 19, 0, 302, 303, 20,
+ 0, 304, 305, 306, 21, 307, 308, 0, 23, 0,
+ 0, 0, 309, 310, 311, 312, 313, 26, 0, 27,
+ 315, 0, 0, 0, 316, -782, 0, 0, 0, 0,
+ 317, 0, 0, 318, 0, 0, 0, 0, 0, 0,
+ 0, 319, 320, 321, 0, 0, 0, 0, 0, 322,
+ 323, 324, 0, 0, 0, 539, 325, 7, 8, 9,
+ 10, 0, 12, 297, 298, 299, 0, 300, 14, 0,
+ 0, 0, 0, 326, 0, 0, 0, 0, 0, 0,
+ 0, 0, 16, 301, 17, 0, 19, 0, 302, 303,
+ 20, 0, 304, 305, 306, 21, 307, 308, 0, 23,
+ 0, 0, 0, 309, 310, 311, 312, 313, 26, 0,
+ 27, 28, -308, 0, 0, 316, 0, 0, 0, 0,
+ 0, 317, 0, 0, 1478, 0, 0, 0, 0, 0,
+ 0, 0, 319, 320, 1479, 0, 0, 0, 0, 0,
+ 322, 323, 324, 0, 0, 0, 1559, 1480, 296, 8,
+ 9, 10, 0, 12, 297, 298, 299, 0, 300, 14,
+ 0, 0, 0, 0, 326, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 301, 17, 0, 19, 0, 302,
+ 303, 20, 0, 304, 305, 306, 21, 307, 308, 0,
+ 23, 0, 0, 0, 309, 310, 311, 312, 313, 26,
+ 0, 27, 315, 0, 0, -194, 316, 0, 0, 0,
+ 0, 0, 317, 0, 0, 318, 0, 0, 0, 0,
+ 0, 0, 0, 319, 320, 321, 0, 0, 0, 0,
+ 0, 322, 323, 324, 0, 0, 0, 831, 325, 296,
+ 8, 9, 10, 0, 12, 521, 298, 299, 0, 300,
+ 14, 0, 0, 0, 0, 326, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 301, 17, 0, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 27, 315, 0, 0, 0, 316, 0, 0,
+ 0, 0, 0, 317, 259, 0, 318, 8, 9, 0,
+ 0, 12, 13, 0, 319, 320, 321, 14, 0, 0,
+ 0, 0, 322, 323, 324, 0, 0, 0, 0, 325,
+ 0, 16, 0, 17, 0, 0, 0, 0, 0, 20,
+ 0, 260, 261, 0, -782, 0, 326, 0, 23, 0,
+ 262, 0, 0, 0, 0, 0, 0, 26, 0, 130,
+ 131, 0, 263, 0, 0, 0, 264, 265, 266, 267,
+ 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
+ 278, 279, 280, 281, 282, 283, 284, 0, 0, 285,
+ 286, 287, 0, 0, 288, 0, 919, 289, 296, 8,
+ 9, 10, 0, 12, 521, 298, 299, 0, 300, 14,
+ 0, 0, 0, 290, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 301, 17, 0, 19, 0, 302,
+ 303, 20, 0, 304, 305, 306, 21, 307, 308, 0,
+ 23, 0, 0, 0, 309, 310, 311, 312, 313, 26,
+ 0, 27, 315, 0, 0, 0, 316, 0, 0, 0,
+ 0, 0, 317, 0, 0, 318, 0, 0, 0, 0,
+ 0, 0, 0, 319, 320, 321, 0, 0, 0, 0,
+ 0, 322, 323, 324, 0, 0, 0, 921, 325, 296,
+ 8, 9, 10, 0, 12, 521, 298, 299, 0, 300,
+ 14, 0, 0, 0, 0, 326, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 301, 17, 0, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 27, 315, 0, 0, 0, 316, 0, 0,
+ 0, 0, 0, 317, 0, 0, 318, 0, 0, 0,
+ 0, 0, 0, 0, 319, 320, 321, 0, 0, 0,
+ 0, 0, 322, 323, 324, 0, 0, 0, 1491, 325,
+ 296, 8, 9, 10, 0, 12, 521, 298, 299, 0,
+ 300, 14, 0, 0, 0, 0, 326, 0, 0, 0,
+ 0, 0, 0, 0, 0, 16, 301, 17, 0, 19,
+ 0, 302, 303, 20, 0, 304, 305, 306, 21, 307,
+ 308, 0, 23, 0, 0, 0, 309, 310, 311, 312,
+ 313, 26, 0, 27, 315, 0, 0, 0, 316, 0,
+ 0, 0, 0, 0, 317, 0, 0, 318, 0, 0,
+ 0, 0, 0, 0, 0, 319, 320, 321, 0, 0,
+ 0, 0, 0, 322, 323, 324, 296, 8, 9, 10,
+ 325, 12, 521, 298, 299, 0, 300, 14, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 326, 0, 0,
+ 0, 16, 301, 17, 0, 19, 0, 302, 303, 20,
+ 0, 304, 305, 306, 21, 307, 308, 0, 23, 0,
+ 0, 0, 309, 310, 311, 312, 313, 26, 0, 27,
+ 315, 0, 0, 0, 316, 0, 0, 0, 0, 0,
+ 317, 0, 760, 318, 7, 8, 761, 10, 163, 12,
+ 13, 319, 320, 321, 0, 14, 0, 0, 0, 322,
+ 323, 324, 0, 0, 0, 0, 325, 0, 0, 16,
+ 0, 17, 18, 19, 0, 0, 0, 20, -522, 0,
+ 0, 0, 21, 326, 870, 0, 23, 762, 0, 164,
+ 0, 0, 0, 0, 0, 26, 0, 27, 28, 0,
+ 0, 763, 0, 764, 0, 0, 0, 0, 0, 0,
+ 0, 30, 760, 0, 7, 8, 761, 10, 163, 12,
+ 13, 31, 0, 0, 0, 14, 0, 0, 0, 32,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 16,
+ 0, 17, 18, 19, 0, 0, 0, 20, -524, 0,
+ -522, 0, 21, 0, 0, 0, 23, 762, 0, 164,
+ 0, 0, 0, 0, 0, 26, 0, 27, 28, 0,
+ 0, 763, 0, 764, 0, 0, 0, 0, 0, 0,
+ 0, 30, 760, 0, 7, 8, 761, 10, 163, 12,
+ 13, 31, 0, 0, 0, 14, 0, 0, 0, 32,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 16,
+ 0, 17, 18, 19, 0, 0, 0, 20, -523, 0,
+ -524, 0, 21, 0, 0, 0, 23, 762, 0, 164,
+ 0, 0, 0, 0, 0, 26, 0, 27, 28, 0,
+ 0, 763, 0, 764, 0, 0, 0, 0, 0, 0,
+ 0, 30, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 31, 0, 0, 0, 0, 0, 0, 0, 32,
+ 0, 0, 0, 0, 33, 0, 0, 1270, 1271, 1272,
+ 10, 163, 12, 297, 298, 299, 0, 300, 14, 1273,
+ -523, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282,
+ 1283, 15, 16, 301, 17, 18, 19, 0, 302, 303,
+ 20, 0, 304, 305, 306, 21, 307, 308, 1284, 23,
+ 1285, 0, 0, 309, 310, 311, 312, 313, 26, 0,
+ 1286, 315, 704, 0, 1287, 316, 0, 0, 0, 0,
+ 0, 317, 0, 0, 318, 0, 0, 0, 0, 0,
+ 0, 0, 319, 320, 321, 0, 0, 0, 0, 0,
+ 322, 323, 324, 0, 0, 0, 0, 325, 0, 1288,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 310, 0, 0, 0, 17, 286, 18, 0, 20, 0,
- 287, 288, 21, 0, 289, 290, 291, 22, 292, 293,
- 0, 24, 0, 0, 0, 294, 295, 296, 297, 298,
- 27, 0, 28, 299, 532, 0, 0, 0, 0, 0,
- 0, 0, 0, 301, 0, 0, 302, 0, 0, 0,
- 0, 0, 0, 0, 303, 304, 305, 0, 0, 0,
- 0, 0, 306, 307, 308, 281, 8, 9, 10, 533,
- 12, 499, 283, 284, 0, 285, 14, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 310, 0, 0,
- 0, 17, 286, 18, 0, 20, 0, 287, 288, 21,
- 0, 289, 290, 291, 22, 292, 293, 0, 24, 0,
- 0, 0, 294, 295, 296, 297, 298, 27, 0, 28,
- 299, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 301, 0, 0, 302, 0, 0, 0, 0, 0, 0,
- 0, 303, 304, 305, 0, 0, 0, 0, 0, 306,
- 307, 308, 0, 0, 0, 0, 309, 569, 281, 8,
- 9, 10, 0, 12, 499, 283, 284, 0, 285, 14,
- 0, 0, 0, 0, 310, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 286, 18, 0, 20, 0,
- 287, 288, 21, 0, 289, 290, 291, 22, 292, 293,
- 0, 24, 0, 0, 0, 294, 295, 296, 297, 298,
- 27, 0, 28, 299, 0, 0, 0, 300, 0, 0,
- 0, 0, 0, 301, 0, 0, 518, 0, 0, 0,
- 0, 0, 0, 0, 303, 304, 519, 0, 0, 0,
- 0, 0, 306, 307, 308, 1094, 8, 9, 10, 520,
- 12, 499, 283, 284, 0, 285, 14, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 310, 0, 0,
- 0, 17, 286, 18, 0, 20, 0, 287, 288, 21,
- 0, 289, 290, 291, 22, 292, 293, 0, 24, 0,
- 0, 0, 294, 295, 296, 297, 298, 27, 0, 28,
- 299, 0, 0, 0, 300, 0, 0, 0, 0, 0,
- 301, 0, 0, 302, 0, 0, 0, 0, 0, 0,
- 0, 303, 304, 305, 0, 0, 0, 0, 0, 306,
- 307, 308, 7, 8, 9, 10, 309, 12, 499, 283,
- 284, 0, 285, 14, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 310, 0, 0, 0, 17, 286,
- 18, 0, 20, 0, 287, 288, 21, 0, 289, 290,
- 291, 22, 292, 293, 0, 24, 0, 0, 0, 294,
- 295, 296, 297, 298, 27, 0, 28, 29, 0, 0,
- 0, 300, 0, 0, 0, 0, 0, 301, 0, 0,
- 1421, 0, 0, 0, 0, 0, 0, 0, 303, 304,
- 1422, 0, 0, 0, 0, 0, 306, 307, 308, 281,
- 8, 9, 10, 1423, 12, 499, 283, 284, 0, 285,
+ 0, 0, 0, 1415, 326, 1270, 1271, 1272, 10, 163,
+ 12, 297, 298, 299, 0, 300, 14, 1273, 0, 1274,
+ 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 15,
+ 16, 301, 17, 18, 19, 0, 302, 303, 20, 0,
+ 304, 305, 306, 21, 307, 308, 1284, 23, 1285, 0,
+ 0, 309, 310, 311, 312, 313, 26, 0, 1286, 315,
+ 704, 0, 1287, 316, 0, 0, 0, 0, 0, 317,
+ 0, 0, 318, 0, 0, 0, 0, 0, 0, 0,
+ 319, 320, 321, 0, 0, 0, 0, 0, 322, 323,
+ 324, 0, 0, 0, 0, 325, 0, 1288, 0, 1270,
+ 1271, 1272, 10, 163, 12, 297, 298, 299, 0, 300,
+ 14, 1273, 326, 1274, 1275, 1276, 1277, 1278, 1279, 1280,
+ 1281, 1282, 1283, 15, 16, 301, 17, 18, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 1284, 23, 1285, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 1286, 315, 1536, 0, 1287, 316, 0, 0,
+ 0, 0, 0, 317, 0, 0, 318, 0, 0, 0,
+ 0, 0, 0, 0, 319, 320, 321, 0, 0, 0,
+ 0, 0, 322, 323, 324, 0, 0, 0, 0, 325,
+ 0, 1288, 0, 1270, 1271, 1272, 10, 163, 12, 297,
+ 298, 299, 0, 300, 14, 1273, 326, 1274, 1275, 1276,
+ 1277, 1278, 1279, 1280, 1281, 1282, 1283, 15, 16, 301,
+ 17, 18, 19, 0, 302, 303, 20, 0, 304, 305,
+ 306, 21, 307, 308, 1284, 23, 1285, 0, 0, 309,
+ 310, 311, 312, 313, 26, 0, 1286, 315, 0, 0,
+ 1287, 316, 0, 0, 0, 0, 0, 317, 0, 0,
+ 318, 0, 0, 0, 0, 0, 0, 0, 319, 320,
+ 321, 0, 0, 0, 0, 0, 322, 323, 324, 0,
+ 0, 0, 0, 325, 0, 1288, 296, 8, 9, 10,
+ 163, 12, 297, 298, 299, 717, 300, 14, 0, 0,
+ 326, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 16, 301, 17, 18, 19, 0, 302, 303, 20,
+ 0, 304, 305, 306, 21, 307, 308, 0, 23, 0,
+ 605, 0, 309, 310, 311, 312, 313, 26, 0, 27,
+ 315, 0, 0, 0, 316, 0, 0, 0, 0, 0,
+ 317, 0, 0, 898, 0, 0, 0, 0, 0, 0,
+ 0, 319, 320, 899, 0, 0, 0, 0, 0, 322,
+ 323, 324, 0, 608, 0, 0, 900, 610, 7, 8,
+ 9, 10, 163, 12, 297, 298, 299, 717, 300, 14,
+ 0, 0, 0, 326, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 301, 17, 18, 19, 0, 302,
+ 303, 20, 0, 304, 305, 306, 21, 307, 308, 0,
+ 23, 0, 605, 0, 309, 310, 311, 312, 313, 26,
+ 0, 27, 28, 0, 0, 0, 316, 0, 0, 0,
+ 0, 0, 317, 0, 0, 1171, 0, 0, 0, 0,
+ 0, 0, 0, 319, 320, 1172, 0, 0, 0, 0,
+ 0, 322, 323, 324, 0, 608, 0, 0, 1173, 610,
+ 296, 8, 9, 10, 0, 12, 297, 298, 299, 0,
+ 300, 14, 0, 0, 0, 326, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 16, 301, 17, 0, 19,
+ 0, 302, 303, 20, 0, 304, 305, 306, 21, 307,
+ 308, 0, 23, 0, 605, 0, 309, 310, 311, 312,
+ 313, 26, 0, 27, 315, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 317, 0, 0, 898, 0, 0,
+ 0, 0, 0, 0, 0, 319, 320, 899, 0, 0,
+ 0, 0, 0, 322, 323, 324, 0, 608, 0, 0,
+ 900, 610, 7, 8, 9, 10, 0, 12, 297, 298,
+ 299, 0, 300, 14, 0, 0, 0, 326, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 16, 301, 17,
+ 0, 19, 0, 302, 303, 20, 0, 304, 305, 306,
+ 21, 307, 308, 0, 23, 0, 605, 0, 309, 310,
+ 311, 312, 313, 26, 0, 27, 28, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 317, 0, 0, 1171,
+ 0, 0, 0, 0, 0, 0, 0, 319, 320, 1172,
+ 0, 0, 0, 0, 0, 322, 323, 324, 0, 608,
+ 0, 0, 1173, 610, 296, 8, 9, 10, 0, 12,
+ 521, 298, 299, 0, 300, 14, 0, 0, 0, 326,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
+ 301, 17, 0, 19, 0, 302, 303, 20, 0, 304,
+ 305, 306, 21, 307, 308, 0, 23, 0, 0, 0,
+ 309, 310, 311, 312, 313, 26, 0, 27, 315, 0,
+ 0, 1388, 316, 0, 0, 0, 0, 0, 317, 0,
+ 0, 318, 0, 0, 0, 0, 0, 0, 0, 319,
+ 320, 321, 0, 0, 0, 0, 0, 322, 323, 324,
+ 0, 0, 0, 0, 325, 296, 8, 9, 10, 163,
+ 12, 297, 298, 299, 0, 300, 14, 0, 0, 0,
+ 0, 326, 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 301, 17, 18, 19, 0, 302, 303, 20, 0,
+ 304, 305, 306, 21, 307, 308, 0, 23, 0, 0,
+ 0, 309, 310, 311, 312, 313, 26, 0, 27, 315,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 317,
+ 0, 0, 318, 0, 0, 0, 0, 0, 0, 0,
+ 319, 320, 321, 0, 0, 0, 0, 0, 322, 323,
+ 324, 296, 8, 9, 10, 325, 12, 297, 298, 299,
+ 0, 300, 14, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 326, 0, 0, 0, 16, 301, 17, 0,
+ 19, 0, 302, 303, 20, 0, 304, 305, 306, 21,
+ 307, 308, 0, 23, 0, 0, 0, 309, 310, 311,
+ 312, 313, 26, 0, 314, 315, 0, 0, 0, 316,
+ 0, 0, 0, 0, 0, 317, 0, 0, 318, 0,
+ 0, 0, 0, 0, 0, 0, 319, 320, 321, 0,
+ 0, 0, 0, 0, 322, 323, 324, 296, 8, 9,
+ 10, 325, 12, 297, 298, 299, 0, 300, 14, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 326, 0,
+ 0, 0, 16, 301, 17, 0, 19, 0, 302, 303,
+ 20, 0, 304, 305, 306, 21, 307, 308, 0, 23,
+ 0, 0, 0, 309, 310, 311, 312, 313, 26, 0,
+ 27, 315, 0, 0, 0, 316, 0, 0, 0, 0,
+ 0, 317, 0, 0, 318, 0, 0, 0, 0, 0,
+ 0, 0, 319, 320, 321, 0, 0, 0, 0, 0,
+ 322, 323, 324, 296, 8, 9, 10, 325, 12, 521,
+ 298, 299, 0, 300, 14, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 326, 0, 0, 0, 16, 301,
+ 17, 0, 19, 0, 302, 303, 20, 0, 304, 305,
+ 306, 21, 307, 308, 0, 23, 0, 0, 0, 309,
+ 310, 311, 312, 313, 26, 0, 27, 315, 0, 0,
+ 0, 316, 0, 0, 0, 0, 0, 317, 0, 0,
+ 318, 0, 0, 0, 0, 0, 0, 0, 319, 320,
+ 321, 0, 0, 0, 0, 0, 322, 323, 324, 296,
+ 8, 9, 10, 325, 12, 521, 298, 299, 0, 300,
+ 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 326, 0, 0, 0, 16, 301, 17, 0, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 27, 315, 554, 0, 0, 0, 0, 0,
+ 0, 0, 0, 317, 0, 0, 318, 0, 0, 0,
+ 0, 0, 0, 0, 319, 320, 321, 0, 0, 0,
+ 0, 0, 322, 323, 324, 296, 8, 9, 10, 555,
+ 12, 521, 298, 299, 0, 300, 14, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 326, 0, 0, 0,
+ 16, 301, 17, 0, 19, 0, 302, 303, 20, 0,
+ 304, 305, 306, 21, 307, 308, 0, 23, 0, 0,
+ 0, 309, 310, 311, 312, 313, 26, 0, 27, 315,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 317,
+ 0, 0, 318, 0, 0, 0, 0, 0, 0, 0,
+ 319, 320, 321, 0, 0, 0, 0, 0, 322, 323,
+ 324, 0, 0, 0, 0, 325, 593, 296, 8, 9,
+ 10, 0, 12, 521, 298, 299, 0, 300, 14, 0,
+ 0, 0, 326, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 16, 301, 17, 0, 19, 0, 302, 303,
+ 20, 0, 304, 305, 306, 21, 307, 308, 0, 23,
+ 0, 0, 0, 309, 310, 311, 312, 313, 26, 0,
+ 27, 315, 0, 0, 0, 316, 0, 0, 0, 0,
+ 0, 317, 0, 0, 540, 0, 0, 0, 0, 0,
+ 0, 0, 319, 320, 541, 0, 0, 0, 0, 0,
+ 322, 323, 324, 1131, 8, 9, 10, 542, 12, 521,
+ 298, 299, 0, 300, 14, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 326, 0, 0, 0, 16, 301,
+ 17, 0, 19, 0, 302, 303, 20, 0, 304, 305,
+ 306, 21, 307, 308, 0, 23, 0, 0, 0, 309,
+ 310, 311, 312, 313, 26, 0, 27, 315, 0, 0,
+ 0, 316, 0, 0, 0, 0, 0, 317, 0, 0,
+ 318, 0, 0, 0, 0, 0, 0, 0, 319, 320,
+ 321, 0, 0, 0, 0, 0, 322, 323, 324, 7,
+ 8, 9, 10, 325, 12, 521, 298, 299, 0, 300,
+ 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 326, 0, 0, 0, 16, 301, 17, 0, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 27, 28, 0, 0, 0, 316, 0, 0,
+ 0, 0, 0, 317, 0, 0, 1478, 0, 0, 0,
+ 0, 0, 0, 0, 319, 320, 1479, 0, 0, 0,
+ 0, 0, 322, 323, 324, 296, 8, 9, 10, 1480,
+ 12, 521, 298, 299, 0, 300, 14, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 326, 0, 0, 0,
+ 16, 301, 17, 0, 19, 0, 302, 303, 20, 0,
+ 304, 305, 306, 21, 307, 308, 0, 23, 0, 0,
+ 0, 309, 310, 311, 312, 313, 26, 0, 27, 315,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 317,
+ 0, 0, 318, 0, 0, 0, 0, 0, 0, 0,
+ 319, 320, 321, 0, 0, 0, 0, 0, 322, 323,
+ 324, 296, 8, 9, 10, 522, 12, 521, 298, 299,
+ 0, 300, 14, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 326, 0, 0, 0, 16, 301, 17, 0,
+ 19, 0, 302, 303, 20, 0, 304, 305, 306, 21,
+ 307, 308, 0, 23, 0, 0, 0, 309, 310, 311,
+ 312, 313, 26, 0, 27, 315, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 317, 0, 0, 318, 0,
+ 0, 0, 0, 0, 0, 0, 319, 320, 321, 0,
+ 0, 0, 0, 0, 322, 323, 324, 296, 8, 9,
+ 10, 525, 12, 521, 298, 299, 0, 300, 14, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 326, 0,
+ 0, 0, 16, 301, 17, 0, 19, 0, 302, 303,
+ 20, 0, 304, 305, 306, 21, 307, 308, 0, 23,
+ 0, 0, 0, 309, 310, 311, 312, 313, 26, 0,
+ 27, 315, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 317, 0, 0, 318, 0, 0, 0, 0, 0,
+ 0, 0, 319, 320, 321, 0, 0, 0, 0, 0,
+ 322, 323, 324, 296, 8, 9, 10, 325, 12, 521,
+ 298, 299, 0, 300, 14, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 326, 0, 0, 0, 16, 301,
+ 17, 0, 19, 0, 302, 303, 20, 0, 304, 305,
+ 306, 21, 307, 308, 0, 23, 0, 0, 0, 309,
+ 310, 311, 312, 313, 26, 0, 27, 315, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 317, 0, 0,
+ 540, 0, 0, 0, 0, 0, 0, 0, 319, 320,
+ 541, 0, 0, 0, 0, 0, 322, 323, 324, 7,
+ 8, 9, 10, 542, 12, 297, 298, 299, 0, 300,
14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 310, 0, 0, 0, 17, 286, 18, 0, 20,
- 0, 287, 288, 21, 0, 289, 290, 291, 22, 292,
- 293, 0, 24, 0, 0, 0, 294, 295, 296, 297,
- 298, 27, 0, 28, 299, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 301, 0, 0, 302, 0, 0,
- 0, 0, 0, 0, 0, 303, 304, 305, 0, 0,
- 0, 0, 0, 306, 307, 308, 281, 8, 9, 10,
- 500, 12, 499, 283, 284, 0, 285, 14, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 310, 0,
- 0, 0, 17, 286, 18, 0, 20, 0, 287, 288,
- 21, 0, 289, 290, 291, 22, 292, 293, 0, 24,
- 0, 0, 0, 294, 295, 296, 297, 298, 27, 0,
- 28, 299, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 301, 0, 0, 302, 0, 0, 0, 0, 0,
- 0, 0, 303, 304, 305, 0, 0, 0, 0, 0,
- 306, 307, 308, 281, 8, 9, 10, 503, 12, 499,
- 283, 284, 0, 285, 14, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 310, 0, 0, 0, 17,
- 286, 18, 0, 20, 0, 287, 288, 21, 0, 289,
- 290, 291, 22, 292, 293, 0, 24, 0, 0, 0,
- 294, 295, 296, 297, 298, 27, 0, 28, 299, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 301, 0,
- 0, 302, 0, 0, 0, 0, 0, 0, 0, 303,
- 304, 305, 0, 0, 0, 0, 0, 306, 307, 308,
- 281, 8, 9, 10, 309, 12, 499, 283, 284, 0,
- 285, 14, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 310, 0, 0, 0, 17, 286, 18, 0,
- 20, 0, 287, 288, 21, 0, 289, 290, 291, 22,
- 292, 293, 0, 24, 0, 0, 0, 294, 295, 296,
- 297, 298, 27, 0, 28, 299, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 301, 0, 0, 518, 0,
- 0, 0, 0, 0, 0, 0, 303, 304, 519, 0,
- 0, 0, 0, 0, 306, 307, 308, 7, 8, 9,
- 10, 520, 12, 282, 283, 284, 0, 285, 14, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 310,
- 0, 0, 0, 17, 286, 18, 0, 20, 0, 287,
- 288, 21, 0, 289, 290, 291, 22, 292, 293, 0,
- 24, 0, 0, 0, 294, 295, 296, 297, 298, 27,
- 0, 28, 29, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 301, 0, 6, 1421, 7, 8, 9, 10,
- 11, 12, 13, 303, 304, 1422, 0, 14, 0, 0,
- 0, 306, 307, 308, 0, 0, 0, 0, 1423, 0,
- 0, 0, 17, 0, 18, 19, 0, 0, 0, 0,
- 21, 0, 0, 0, 0, 22, 310, 0, 0, 24,
- 0, 0, 411, 0, 0, 0, 0, 0, 27, 0,
- 28, 29, 0, 0, 30, -357, 8, 9, -357, -357,
- 12, 227, 0, 0, 31, 0, 14, 0, 0, 0,
- 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
- 0, 17, 33, 18, -357, 0, 0, 34, 0, 21,
- 0, 0, 0, 0, -357, 0, 0, 0, 24, 0,
- 581, 0, 0, 0, 0, 0, 0, 27, 0, 129,
- 130, 7, 8, 9, 10, 189, 12, 190, 0, 0,
- 0, 0, 14, 582, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 583, 0, 0, 0, 17, 0, 18,
- 19, -357, 0, 584, 0, 21, 585, 586, 0, 0,
- 22, 0, 0, 0, 24, 0, 989, 8, 733, 10,
- 189, 12, 190, 27, 0, 28, 29, 14, 0, 191,
+ 326, 0, 0, 0, 16, 301, 17, 0, 19, 0,
+ 302, 303, 20, 0, 304, 305, 306, 21, 307, 308,
+ 0, 23, 0, 0, 0, 309, 310, 311, 312, 313,
+ 26, 0, 27, 28, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 317, 0, 6, 1478, 7, 8, 9,
+ 10, 11, 12, 13, 319, 320, 1479, 0, 14, 0,
+ 0, 0, 322, 323, 324, 0, 0, 0, 0, 1480,
+ 0, 15, 16, 0, 17, 18, 19, 0, 0, 0,
+ 20, 0, 0, 0, 0, 21, 326, 0, 22, 23,
+ 24, 0, 25, 0, 0, 0, 0, 0, 26, 0,
+ 27, 28, 0, 0, 29, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 30, 0, 0, 0, 0, 0,
+ 0, 0, 0, 760, 31, 7, 8, 761, 10, 163,
+ 12, 13, 32, 0, 0, 0, 14, 33, 0, 0,
+ 0, 0, 34, 0, 0, 0, 0, 0, 0, 0,
+ 16, 0, 17, 18, 19, 0, 0, 0, 20, 0,
+ 0, 0, 0, 21, 0, 0, 0, 23, 762, 0,
+ 164, 0, 0, 0, 0, 0, 26, 0, 27, 28,
+ 0, 0, 763, 0, 764, 0, 0, 0, 0, 0,
+ 0, 0, 30, 7, 8, 9, 10, 201, 12, 202,
+ 0, 0, 31, 0, 14, 0, 0, 0, 0, 0,
+ 32, 0, 0, 0, 0, 33, 0, 0, 16, 0,
+ 17, 18, 0, 0, 0, 0, 20, 0, 0, 0,
+ 0, 21, 0, 0, 0, 23, 0, 0, 0, 0,
+ 0, 0, 0, 0, 26, 0, 27, 28, 0, 0,
+ 1405, 0, 7, 8, 9, 10, 201, 12, 202, 0,
+ 30, 0, 0, 14, 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 0, 0, 0, 0, 16, 32, 17,
+ 18, 0, 0, 33, 0, 20, 0, 0, 0, 0,
+ 21, 0, 0, 0, 23, 0, 0, 0, 0, 0,
+ 0, 0, 0, 26, 0, 27, 28, 7, 8, 9,
+ 10, 210, 211, 212, 0, 0, 0, 0, 14, 30,
0, 0, 0, 0, 0, 0, 0, 0, 0, 31,
- 0, 0, 17, 0, 18, 19, 0, 0, 0, 32,
- 21, 0, 0, 0, 0, 22, 0, 33, 0, 24,
- 0, 0, 34, 0, 0, 0, 0, 0, 27, 0,
- 28, 29, 0, 0, 0, 0, 991, 7, 8, 9,
- 10, 189, 12, 190, 31, 0, 0, 0, 14, 0,
- 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
- 0, 0, 33, 17, 0, 18, 19, 34, 0, 0,
- 0, 21, 0, 0, 0, 0, 22, 0, 0, 0,
- 24, 0, 7, 8, 9, 10, 386, 12, 13, 27,
- 0, 28, 29, 14, 0, 1355, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 31, 0, 0, 17, 0,
- 18, 19, 0, 0, 0, 32, 21, 0, 0, 0,
- 0, 22, 0, 33, 0, 24, 0, 0, 34, 0,
- 0, 0, 0, 0, 27, 0, 28, 29, 7, 8,
- 9, 10, 189, 12, 190, 0, 0, 0, 0, 14,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 32, 0, 0, 0, 17, 0, 18, 19, 33, 0,
- 0, 0, 21, 34, 0, 0, 0, 22, 0, 0,
- 0, 24, 0, 7, 8, 9, 10, 198, 199, 200,
- 27, 0, 28, 29, 14, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 31, 0, 0, 0,
- 0, 0, 19, 0, 0, 0, 32, 21, 0, 0,
- 0, 0, 22, 0, 33, 1411, 24, 0, 581, 34,
- 0, 0, 0, 0, 0, 27, 0, 28, 29, 535,
- 536, 537, 538, 539, 540, 541, 542, 543, 544, 545,
- 546, 177, 548, 549, 550, 551, 552, 553, 554, 555,
- 556, 178, 0, 0, 0, 0, 0, 19, 0, 33,
- 0, 0, 0, 0, 1358, 0, 1412, 535, 536, 537,
- 538, 539, 540, 541, 542, 543, 544, 545, 546, 547,
- 548, 549, 550, 551, 552, 553, 554, 555, 556, 535,
- 536, 537, 538, 539, 540, 541, 542, 543, 544, 545,
- 546, 547, 548, 549, 550, 551, 552, 553, 554, 555,
- 556, 535, 536, 537, 538, 539, 540, 541, 542, 543,
- 544, 545, 546, 547, 548, 549, 550, 551, 552, 553,
- 554, 555, 556, 535, 536, 537, 538, 539, 540, 541,
- 542, 543, 544, 545, 546, 547, 548, 549, 550, 551,
- 552, 553, 554, 555, 556, 0, 0, 0, 0, 0,
- 1185, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 621, 0, 0, 1466, 535,
- 536, 537, 538, 539, 540, 541, 542, 543, 544, 545,
- 546, 547, 548, 549, 550, 551, 552, 553, 554, 555,
- 556, 1484, 535, 536, 537, 538, 539, 540, 541, 542,
- 543, 544, 545, 546, 547, 548, 549, 550, 551, 552,
- 553, 554, 555, 556, 535, 536, 537, 538, 539, 540,
- 541, 542, 543, 544, 545, 546, 547, 548, 549, 550,
- 551, 552, 553, 554, 555, 556
+ 0, 0, 0, 0, 0, 18, 0, 32, 0, 0,
+ 20, 0, 33, 0, 0, 21, 0, 0, 0, 23,
+ 0, 605, 0, 0, 0, 0, 0, 0, 26, 0,
+ 27, 28, 0, 0, 0, 0, 18, 0, 0, 0,
+ 0, 0, 0, 0, 189, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 190, 0, 0, 0, 0, 0,
+ 0, 0, 32, 0, 0, 0, 0, 1408, 557, 558,
+ 559, 560, 561, 562, 563, 564, 565, 566, 567, 568,
+ 569, 570, 571, 572, 573, 574, 575, 576, 577, 578,
+ 557, 558, 559, 560, 561, 562, 563, 564, 565, 566,
+ 567, 568, 569, 570, 571, 572, 573, 574, 575, 576,
+ 577, 578, 557, 558, 559, 560, 561, 562, 563, 564,
+ 565, 566, 567, 568, 569, 570, 571, 572, 573, 574,
+ 575, 576, 577, 578, 0, 0, 0, 0, 1223, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 646, 0, 0, 1526, 557, 558, 559,
+ 560, 561, 562, 563, 564, 565, 566, 567, 568, 569,
+ 570, 571, 572, 573, 574, 575, 576, 577, 578, 1544,
+ 557, 558, 559, 560, 561, 562, 563, 564, 565, 566,
+ 567, 568, 569, 570, 571, 572, 573, 574, 575, 576,
+ 577, 578, 557, 558, 559, 560, 561, 562, 563, 564,
+ 565, 566, 567, 568, 569, 570, 571, 572, 573, 574,
+ 575, 576, 577, 578, 557, 558, 559, 560, 561, 562,
+ 563, 564, 565, 566, 567, 568, 0, 570, 571, 572,
+ 573, 574, 575, 576, 577, 578
};
static const short yycheck[] = { 4,
- 156, 79, 4, 426, 673, 670, 54, 24, 4, 125,
- 4, 193, 329, 385, 232, 335, 448, 83, 336, 337,
- 385, 4, 285, 286, 385, 58, 530, 146, 147, 653,
- 469, 36, 14, 4, 36, 830, 41, 31, 32, 41,
- 36, 123, 36, 223, 132, 41, 228, 41, 660, 353,
- 737, 56, 739, 36, 317, 4, 201, 202, 41, 746,
- 34, 4, 1254, 141, 585, 36, 71, 421, 128, 1261,
- 41, 592, 193, 133, 392, 393, 132, 133, 83, 4,
- 61, 202, 87, 1408, 89, 56, 91, 36, 11, 83,
- 1247, 1324, 41, 36, 38, 277, 1409, 11, 41, 11,
- 82, 106, 107, 53, 34, 1155, 1156, 1410, 9, 187,
- 79, 36, 45, 48, 60, 63, 41, 335, 456, 1169,
- 60, 1446, 59, 105, 0, 65, 7, 63, 65, 0,
- 135, 136, 89, 138, 91, 473, 76, 754, 60, 75,
- 63, 135, 75, 760, 385, 1, 75, 329, 1, 59,
- 49, 12, 146, 147, 586, 160, 1, 38, 83, 94,
- 193, 62, 110, 1426, 135, 111, 160, 111, 201, 202,
- 524, 12, 146, 147, 148, 110, 287, 288, 1481, 136,
- 12, 111, 1445, 177, 178, 502, 135, 110, 110, 160,
- 100, 302, 135, 434, 305, 228, 110, 308, 110, 60,
- 311, 151, 63, 59, 315, 179, 59, 63, 106, 107,
- 135, 160, 323, 1526, 59, 196, 1541, 160, 63, 60,
- 63, 1413, 63, 204, 65, 75, 48, 36, 60, 94,
- 48, 63, 41, 672, 184, 160, 1286, 98, 326, 1502,
- 96, 25, 55, 65, 277, 1295, 1296, 229, 1298, 110,
- 867, 96, 1409, 1486, 1049, 61, 322, 98, 414, 3,
- 4, 5, 75, 1455, 197, 60, 98, 110, 880, 94,
- 326, 883, 94, 278, 243, 59, 94, 95, 902, 63,
- 34, 76, 643, 365, 604, 61, 60, 39, 4, 5,
- 608, 94, 110, 9, 63, 355, 329, 48, 76, 60,
- 78, 48, 61, 55, 309, 111, 75, 452, 453, 921,
- 922, 1503, 96, 57, 58, 460, 109, 322, 48, 379,
- 674, 440, 441, 379, 696, 330, 61, 472, 322, 633,
- 75, 696, 453, 338, 339, 111, 110, 81, 55, 55,
- 388, 57, 58, 94, 585, 339, 491, 94, 95, 110,
- 871, 592, 111, 335, 48, 71, 574, 390, 75, 976,
- 60, 27, 28, 110, 94, 81, 32, 25, 339, 27,
- 28, 988, 767, 768, 769, 692, 111, 48, 75, 95,
- 385, 338, 1432, 1433, 389, 48, 48, 94, 909, 385,
- 339, 385, 146, 147, 148, 61, 339, 322, 1193, 65,
- 94, 59, 906, 25, 1021, 63, 1023, 518, 519, 832,
- 110, 309, 61, 48, 339, 25, 61, 27, 28, 452,
- 453, 55, 55, 94, 95, 179, 55, 460, 949, 434,
- 65, 94, 94, 95, 48, 416, 868, 55, 96, 472,
- 434, 75, 75, 4, 5, 111, 440, 441, 110, 59,
- 8, 9, 770, 63, 32, 696, 14, 75, 491, 94,
- 385, 63, 3, 4, 5, 470, 440, 441, 442, 3,
- 4, 5, 6, 1085, 1086, 59, 470, 63, 459, 37,
- 94, 95, 75, 1170, 48, 55, 96, 470, 46, 75,
- 48, 48, 497, 63, 55, 500, 57, 58, 503, 55,
- 566, 470, 507, 508, 509, 510, 511, 48, 42, 434,
- 71, 4, 5, 754, 55, 520, 57, 58, 446, 760,
- 81, 470, 4, 57, 58, 530, 454, 470, 533, 462,
- 94, 903, 55, 431, 95, 974, 94, 94, 903, 166,
- 497, 721, 903, 723, 48, 470, 4, 5, 728, 48,
- 59, 55, 75, 94, 36, 89, 876, 60, 61, 41,
- 565, 566, 610, 111, 57, 58, 3, 4, 5, 714,
- 48, 75, 566, 94, 3, 4, 5, 48, 611, 48,
- 585, 899, 55, 937, 76, 1106, 55, 592, 582, 583,
- 94, 585, 55, 4, 5, 94, 95, 779, 592, 57,
- 58, 649, 500, 651, 652, 503, 75, 55, 48, 507,
- 873, 95, 49, 1134, 596, 731, 94, 1040, 1041, 652,
- 57, 58, 520, 94, 641, 94, 867, 1059, 57, 58,
- 871, 636, 48, 110, 48, 533, 48, 11, 49, 537,
- 1251, 566, 1253, 55, 692, 650, 57, 58, 48, 654,
- 60, 61, 4, 5, 94, 672, 110, 9, 876, 692,
- 585, 110, 903, 75, 110, 563, 111, 592, 909, 48,
- 81, 569, 4, 5, 14, 94, 48, 1116, 94, 636,
- 94, 714, 94, 23, 61, 48, 440, 441, 442, 8,
- 9, 696, 1449, 3, 94, 14, 744, 1015, 1016, 1017,
- 60, 61, 696, 55, 113, 57, 58, 1130, 949, 1148,
- 25, 95, 27, 28, 95, 94, 1139, 1140, 37, 71,
- 63, 1144, 94, 55, 64, 57, 58, 46, 113, 81,
- 841, 94, 737, 9, 739, 976, 12, 1054, 1495, 94,
- 745, 746, 60, 737, 59, 739, 779, 988, 63, 754,
- 755, 756, 746, 758, 737, 760, 739, 63, 869, 870,
- 754, 94, 1185, 746, 1055, 1056, 760, 1058, 737, 75,
- 739, 696, 48, 744, 745, 75, 745, 746, 4, 5,
- 1021, 96, 1023, 123, 60, 75, 62, 63, 737, 65,
- 739, 971, 972, 973, 737, 75, 739, 746, 755, 756,
- 76, 758, 78, 746, 1469, 145, 75, 740, 741, 11,
- 27, 28, 737, 111, 739, 32, 749, 110, 94, 95,
- 1489, 746, 98, 49, 829, 4, 5, 60, 833, 754,
- 55, 57, 58, 110, 110, 760, 914, 27, 28, 84,
- 85, 55, 110, 60, 61, 60, 61, 110, 65, 63,
- 1273, 3, 4, 5, 6, 81, 861, 3, 4, 5,
- 6, 75, 867, 4, 5, 1106, 871, 75, 60, 110,
- 49, 111, 48, 867, 61, 869, 870, 871, 57, 58,
- 220, 221, 60, 61, 76, 1203, 78, 111, 1311, 65,
- 42, 113, 232, 1134, 876, 113, 42, 49, 903, 110,
- 905, 906, 81, 49, 909, 57, 58, 903, 49, 903,
- 75, 57, 58, 907, 908, 909, 57, 58, 94, 95,
- 60, 61, 1000, 60, 61, 25, 75, 27, 28, 81,
- 55, 979, 75, 113, 55, 909, 1253, 89, 113, 837,
- 81, 110, 867, 89, 949, 59, 871, 3, 4, 5,
- 1061, 7, 8, 9, 55, 949, 4, 5, 963, 59,
- 110, 301, 63, 63, 969, 3, 4, 5, 6, 55,
- 94, 976, 110, 871, 75, 949, 110, 63, 903, 8,
- 113, 1335, 976, 988, 909, 1104, 1105, 4, 5, 75,
- 3, 4, 5, 1347, 988, 48, 96, 65, 60, 94,
- 48, 57, 58, 343, 42, 111, 1011, 55, 979, 57,
- 58, 61, 352, 1132, 1133, 55, 1021, 1011, 1023, 57,
- 58, 1132, 1133, 71, 949, 365, 37, 1021, 1011, 1023,
- 1108, 1000, 49, 81, 65, 65, 49, 65, 110, 61,
- 57, 58, 1011, 91, 57, 58, 94, 95, 3, 4,
- 5, 976, 7, 8, 9, 63, 110, 94, 1063, 992,
- 65, 110, 1011, 988, 81, 998, 999, 1439, 1011, 1002,
- 1003, 969, 1426, 1006, 1439, 55, 110, 55, 110, 65,
- 65, 60, 37, 63, 110, 63, 1011, 3, 4, 5,
- 717, 1445, 3, 4, 5, 75, 1021, 75, 1023, 1116,
- 55, 1106, 57, 58, 59, 63, 1063, 113, 1531, 110,
- 1104, 1105, 1106, 110, 3, 4, 5, 6, 1472, 3,
- 4, 5, 1127, 110, 751, 1127, 1443, 467, 110, 1134,
- 1104, 1105, 1106, 1127, 76, 76, 1247, 55, 1132, 1133,
- 1134, 57, 58, 59, 1127, 63, 57, 58, 1502, 76,
- 105, 106, 107, 42, 76, 909, 1510, 75, 1132, 1133,
- 1134, 4, 5, 4, 5, 1170, 55, 110, 57, 58,
- 56, 55, 58, 57, 58, 59, 1170, 110, 1127, 110,
- 63, 1106, 63, 60, 87, 63, 89, 1170, 91, 3,
- 4, 5, 532, 110, 113, 949, 111, 1166, 1439, 95,
- 89, 1170, 1127, 1251, 110, 1253, 110, 89, 49, 1134,
- 75, 113, 55, 48, 57, 58, 57, 58, 110, 110,
- 1253, 1170, 3, 4, 5, 113, 7, 1170, 71, 60,
- 110, 110, 65, 136, 574, 138, 1134, 113, 81, 110,
- 81, 55, 1247, 57, 58, 1170, 110, 1252, 111, 1254,
- 31, 111, 1254, 1247, 65, 60, 1261, 38, 60, 1261,
- 1254, 1443, 1418, 110, 1247, 1270, 110, 1261, 94, 94,
- 94, 1254, 94, 111, 55, 8, 57, 58, 1261, 113,
- 166, 110, 110, 1181, 1182, 1183, 1184, 3, 4, 5,
- 6, 27, 28, 1191, 110, 110, 32, 110, 1247, 111,
- 110, 641, 1421, 1422, 113, 1254, 110, 193, 34, 110,
- 1421, 1422, 1261, 653, 110, 201, 202, 81, 82, 83,
- 84, 85, 1247, 110, 60, 61, 42, 110, 110, 1254,
- 65, 110, 55, 49, 110, 110, 1261, 48, 63, 679,
- 113, 57, 58, 110, 1242, 110, 97, 3, 4, 5,
- 1104, 1105, 1106, 110, 981, 982, 7, 8, 9, 63,
- 1293, 1294, 63, 14, 61, 81, 3, 4, 5, 61,
- 7, 8, 9, 89, 9, 31, 61, 16, 1132, 1133,
- 1134, 32, 110, 1010, 1358, 94, 37, 94, 3, 4,
- 5, 110, 712, 110, 61, 46, 1444, 300, 1403, 55,
- 37, 57, 58, 1408, 1409, 1410, 1408, 110, 1413, 1403,
- 1443, 1413, 4, 5, 1408, 1409, 1410, 110, 1423, 1413,
- 57, 58, 113, 110, 1357, 1408, 1409, 1421, 1422, 61,
- 1413, 94, 94, 753, 1439, 338, 3, 4, 5, 759,
- 55, 1446, 57, 58, 1446, 1439, 1344, 1421, 1422, 1423,
- 1455, 17, 1446, 1455, 61, 109, 99, 49, 110, 1408,
- 1409, 1455, 61, 1446, 1413, 57, 58, 11, 110, 110,
- 110, 61, 1455, 61, 61, 94, 1481, 60, 1403, 65,
- 110, 61, 110, 1408, 1409, 1410, 110, 1481, 1413, 11,
- 57, 58, 4, 5, 3, 4, 5, 1446, 1503, 61,
- 11, 1503, 61, 389, 390, 1403, 1455, 0, 0, 1503,
- 0, 1409, 1410, 413, 1439, 355, 2, 903, 745, 1116,
- 1503, 1446, 160, 426, 427, 1423, 3, 4, 5, 6,
- 1455, 434, 93, 45, 1161, 1162, 1541, 1164, 1165, 1541,
- 1167, 1474, 862, 55, 864, 57, 58, 1541, 57, 58,
- 1468, 160, 892, 138, 1503, 1334, 1481, 1541, 1541, 445,
- 280, 48, 902, 1252, 892, 42, 452, 453, 679, 222,
- 456, 887, 49, 1148, 460, 974, 1011, 745, 1503, 1168,
- 57, 58, 617, 1481, 7, 8, 9, 473, 885, 566,
- 184, 14, 1541, 123, 497, 498, 326, 1254, 1128, 1497,
- 87, 88, 1510, 1489, 1358, 92, 93, 94, 95, 32,
- 1458, 1520, 89, 34, 37, 1522, 1541, 958, 1270, -1,
- -1, 1519, -1, 46, -1, -1, -1, 530, 1526, 532,
- -1, -1, 535, 536, -1, 538, 539, 540, 541, 542,
- 543, 544, 545, 546, 547, 548, 549, 550, 551, 552,
- 553, 554, 555, 556, -1, -1, 1283, 1284, -1, 562,
- -1, 564, 565, -1, -1, -1, -1, 1421, 1422, 1423,
- -1, -1, -1, -1, -1, 1, -1, 3, 4, 5,
- 6, 7, 8, 9, -1, 7, 8, 9, 14, 592,
- 4, 5, 14, -1, -1, 9, 599, -1, -1, -1,
- 1020, 1041, 1022, 29, -1, 31, 32, 33, -1, -1,
- 32, 37, 38, -1, -1, 37, 42, 620, 621, -1,
- 46, 47, -1, 49, 46, 611, 147, 148, -1, 55,
- -1, 57, 58, 636, 48, 61, -1, 63, 79, 61,
- -1, 55, -1, 57, 58, 71, 427, -1, -1, -1,
- 1377, 1378, 1379, 434, -1, 81, 1076, 71, 179, -1,
- -1, -1, 103, 89, 650, -1, 652, 81, 94, 79,
- 80, 81, 82, 83, 84, 85, 679, 91, -1, -1,
- 94, 95, -1, -1, 1124, 111, -1, -1, 4, 5,
- 1130, 132, 8, 9, -1, -1, -1, 4, 14, -1,
- 141, -1, 1429, 1430, -1, -1, 692, 14, -1, -1,
- -1, -1, -1, 29, -1, 31, -1, 498, 25, -1,
- -1, 37, -1, -1, 31, 32, -1, 34, 714, 36,
- 46, 717, 1152, 736, 41, -1, -1, 1157, -1, 55,
- -1, 57, 58, 59, -1, -1, 187, 54, -1, 56,
- -1, -1, 755, 756, -1, 758, -1, 64, -1, 745,
- 3, 4, 5, -1, 71, 751, -1, 1494, -1, -1,
- 773, -1, -1, -1, -1, 82, 83, -1, 94, 220,
- -1, 562, -1, 564, 565, -1, -1, 1207, 309, -1,
- -1, -1, 795, -1, -1, -1, 39, 40, 105, 42,
- -1, -1, 243, 1243, -1, -1, 3, 4, 5, 6,
- -1, 592, 55, -1, 57, 58, -1, -1, 599, -1,
- -1, 128, -1, -1, -1, -1, 133, 12, 135, 832,
- 833, -1, 139, -1, -1, 142, 143, -1, -1, 146,
- 147, 148, 27, 28, 847, 42, 849, 32, 851, -1,
- -1, -1, -1, 160, -1, -1, -1, -1, 55, -1,
- 57, 58, -1, 48, 61, -1, 63, -1, -1, -1,
- 177, 178, 179, -1, 71, 60, 61, -1, 63, -1,
- 65, 884, 1302, 1303, 81, -1, 1326, -1, -1, -1,
- -1, 894, 89, 334, -1, -1, -1, 94, 1318, 206,
- -1, -1, -1, 906, 7, 8, 9, -1, -1, 94,
- 95, 14, 427, 98, 221, -1, 919, -1, -1, 434,
- 441, 442, 229, -1, -1, 110, -1, -1, 931, 32,
- -1, -1, -1, 240, 37, -1, -1, -1, -1, 3,
- 4, 5, 6, 46, -1, 9, 949, -1, -1, -1,
- 1370, 1371, -1, -1, 395, -1, -1, -1, 61, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, -1, 1389,
- 1390, 278, 279, -1, -1, -1, -1, -1, 42, 500,
- -1, -1, 503, 498, 48, -1, -1, -1, 991, -1,
- -1, 55, 773, 57, 58, 981, 982, -1, 519, 520,
- -1, 328, 329, 330, -1, -1, -1, 71, -1, -1,
- -1, -1, 533, -1, -1, 322, -1, 81, -1, 326,
- -1, 328, 329, 330, 1010, 89, 467, 91, -1, -1,
- 94, 95, 339, -1, -1, -1, -1, 1040, 1041, -1,
- -1, 1044, -1, -1, -1, -1, -1, 562, 355, 564,
- 565, -1, 833, 494, 3, 4, 5, 6, -1, -1,
- 1063, -1, -1, -1, -1, -1, 847, -1, 849, -1,
- 851, 592, 379, -1, -1, -1, -1, -1, 385, -1,
- -1, 388, 389, -1, 599, -1, -1, -1, -1, -1,
- -1, -1, 399, 42, -1, 402, -1, -1, -1, 48,
- 407, -1, -1, -1, -1, -1, 55, -1, 57, 58,
- -1, -1, -1, 894, -1, 1118, -1, 1120, -1, 1122,
- -1, -1, 71, -1, -1, -1, -1, 1130, -1, 436,
- -1, 438, 81, 440, 441, 442, 1139, 1140, 579, 446,
- 89, 1144, 91, -1, 451, 94, 95, 454, -1, -1,
- 931, -1, -1, -1, 595, -1, 1159, 1160, -1, -1,
- -1, -1, -1, 470, -1, -1, -1, -1, 949, -1,
- -1, -1, -1, -1, -1, 1161, 1162, -1, 1164, 1165,
- -1, 1167, 1185, -1, 1, -1, 3, 4, 5, 6,
- 7, 8, 9, -1, -1, -1, -1, 14, -1, -1,
- -1, 508, 509, 510, 511, -1, -1, -1, -1, -1,
- -1, 1214, 29, -1, 31, 32, 33, -1, -1, -1,
- 37, 38, -1, -1, -1, 42, -1, -1, -1, 46,
- 47, -1, 49, -1, -1, 1238, -1, -1, 55, -1,
- 57, 58, -1, -1, 61, -1, 63, -1, -1, -1,
- -1, -1, 773, -1, 71, 582, 583, -1, 585, 566,
- -1, 568, -1, -1, 81, 592, 1252, 1253, -1, -1,
- 1273, -1, 89, 580, -1, 582, 583, 94, 585, -1,
- -1, -1, -1, -1, -1, 592, 1289, -1, -1, 596,
- -1, -1, -1, -1, 111, -1, -1, 1283, 1284, -1,
- -1, -1, -1, 610, -1, -1, -1, -1, 1311, 3,
- 4, 5, 6, -1, -1, 9, -1, -1, 833, -1,
- -1, -1, 649, -1, 651, 652, 1, 654, 3, 4,
- 5, 6, 847, 8, 849, -1, 851, 1118, -1, 1120,
- -1, 1122, 649, 650, 651, 652, 653, 654, 42, 870,
- 871, -1, -1, -1, -1, 1358, -1, -1, -1, -1,
- -1, 55, -1, 57, 58, 692, -1, 42, -1, -1,
- -1, -1, 1375, 1376, 49, -1, -1, 71, -1, 894,
- 55, 1384, 57, 58, -1, 692, -1, 81, 909, 696,
- -1, 1377, 1378, 1379, -1, 89, 703, 704, -1, 706,
- 94, -1, -1, -1, -1, -1, -1, -1, 1411, -1,
- -1, -1, -1, -1, 89, -1, 931, -1, 106, 107,
- -1, -1, -1, -1, -1, -1, -1, 734, 949, -1,
- 737, -1, 739, 1214, 875, -1, 877, 744, 745, 746,
- -1, -1, -1, 1429, 1430, -1, -1, 754, -1, -1,
- -1, -1, 779, 760, -1, 3, 4, 5, 6, -1,
- 767, 768, 769, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 779, 914, -1, -1, -1, -1, 4, 5,
- -1, 7, 8, 9, -1, -1, 12, -1, 14, -1,
- -1, -1, -1, -1, 42, -1, -1, 3, 4, 5,
- 6, -1, -1, 29, -1, 31, 32, 55, 1494, 57,
- 58, 37, -1, 61, -1, -1, -1, -1, -1, -1,
- 46, -1, 829, 71, -1, 852, -1, 854, 1531, 55,
- -1, 57, 58, 81, -1, -1, 42, -1, 865, -1,
- -1, 89, 869, 870, 871, 852, 94, 854, -1, 55,
- -1, 57, 58, -1, 861, -1, -1, 63, 865, 1000,
- 867, -1, 869, 870, 871, 71, -1, -1, -1, 876,
- -1, -1, 98, -1, -1, 81, -1, 1358, -1, -1,
- 907, 908, 909, 89, 1105, 1106, 4, 5, 94, -1,
- -1, 9, -1, -1, -1, -1, 903, -1, 905, 4,
- 907, 908, 909, 1118, -1, 1120, -1, 1122, -1, 14,
- -1, -1, 1133, 1134, -1, -1, -1, -1, -1, 24,
- 25, 309, 949, -1, -1, -1, 31, 32, -1, 34,
- 48, 36, -1, -1, -1, -1, 41, 55, -1, 57,
- 58, 1082, 949, -1, -1, -1, -1, -1, -1, 54,
- -1, 56, -1, 71, -1, -1, 963, -1, -1, 64,
- -1, -1, -1, 81, -1, -1, 71, 1108, -1, 976,
- -1, -1, 979, 91, -1, -1, 94, 95, 83, -1,
- -1, 988, 3, 4, 5, 6, -1, -1, -1, -1,
- -1, -1, -1, -1, 1001, -1, -1, 385, -1, 1214,
- -1, -1, -1, -1, 1011, -1, -1, -1, 3, 4,
- 5, 6, -1, -1, 1021, -1, 1023, -1, -1, -1,
- -1, 42, -1, 128, -1, 1166, -1, -1, 49, -1,
- 135, 328, 329, 330, 139, -1, 57, 58, 143, -1,
- -1, 146, 147, 148, -1, -1, 434, 42, 1055, 1056,
- -1, 1058, -1, -1, 49, 160, -1, -1, -1, -1,
- 4, 5, 57, 58, 8, 9, -1, -1, 89, -1,
- 14, -1, 177, 178, 179, 1102, 1103, 1104, 1105, 1106,
- -1, -1, -1, 1110, -1, 29, 81, 31, -1, -1,
- -1, -1, -1, 37, 89, 1102, 1103, 1104, 1105, 1106,
- -1, 206, 46, 1110, -1, 1132, 1133, 1134, -1, -1,
- -1, 55, 500, 57, 58, 503, -1, -1, -1, 507,
- 508, 509, 510, 511, -1, 1132, 1133, 1134, 3, 4,
- 5, 6, 520, -1, 9, 240, -1, 1358, -1, -1,
- 3, 4, 5, 6, -1, 533, 9, -1, -1, -1,
- 94, -1, -1, -1, -1, -1, 1163, -1, -1, -1,
- -1, 1168, -1, 1170, -1, -1, -1, 42, -1, -1,
- -1, -1, -1, 278, 279, -1, -1, 565, -1, 42,
- 55, -1, 57, 58, -1, 48, -1, -1, -1, -1,
- 1217, 1218, 55, 1220, 57, 58, 71, 585, -1, -1,
- -1, 1422, 1423, -1, 592, -1, 81, -1, 71, -1,
- 1217, 1218, -1, 1220, 89, -1, -1, 322, 81, 94,
- -1, 326, -1, 328, 329, 330, 89, -1, 91, -1,
- 335, 94, 95, -1, 339, 3, 4, 5, 6, -1,
- -1, 9, -1, -1, 1251, 1252, 1253, -1, -1, -1,
- 355, -1, 3, 4, 5, 6, -1, -1, -1, -1,
- -1, -1, -1, 1270, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 42, -1, -1, -1, -1, -1,
- 385, -1, 4, 388, 389, 582, 583, 55, -1, 57,
- 58, 42, -1, -1, 399, -1, -1, 402, 49, -1,
- -1, -1, 407, 71, -1, -1, 57, 58, 696, 31,
- 32, -1, -1, 81, 36, -1, -1, -1, -1, 41,
- -1, 89, 3, 4, 5, 6, 94, -1, -1, -1,
- 81, 436, -1, 438, 56, 440, 441, 442, 89, -1,
- -1, 446, 3, 4, 5, 6, 451, -1, 9, 454,
- -1, 1358, 649, -1, 651, 652, -1, 654, -1, -1,
- -1, 42, -1, -1, 469, 470, 754, -1, 49, -1,
- -1, -1, 760, -1, -1, -1, 57, 58, -1, -1,
- -1, 42, -1, -1, -1, -1, -1, 48, -1, -1,
- -1, -1, -1, -1, 55, 692, 57, 58, -1, -1,
- 81, -1, -1, 508, 509, 510, 511, -1, 89, -1,
- 71, -1, -1, 135, 1421, 1422, 1423, 139, -1, -1,
- 81, 143, -1, -1, -1, -1, -1, -1, 89, -1,
- 91, -1, 1439, 94, 95, -1, -1, 1444, 160, -1,
- 1, 829, 3, 4, 5, 6, 7, 8, 9, -1,
- -1, -1, -1, 14, -1, 177, 178, -1, -1, -1,
- -1, 566, -1, 568, -1, -1, 27, 28, 29, -1,
- 31, 32, 33, 861, -1, -1, 37, 582, 583, 867,
- 585, 42, 779, 871, 45, 46, 47, 592, 49, -1,
- -1, -1, -1, -1, 55, -1, 57, 58, -1, 604,
- 61, -1, -1, -1, -1, 610, -1, -1, -1, -1,
- 71, 3, 4, 5, 6, 903, -1, 905, 240, -1,
- 81, 909, -1, -1, -1, -1, -1, -1, 89, -1,
- -1, -1, -1, 94, -1, -1, 641, -1, -1, 100,
- -1, -1, -1, -1, 649, 650, 651, 652, 653, 654,
- 42, -1, -1, -1, -1, 852, -1, 854, -1, -1,
- -1, 949, -1, 55, -1, 57, 58, 672, 865, -1,
- -1, 63, 869, 870, -1, 963, -1, -1, -1, 71,
- -1, 969, -1, -1, -1, -1, -1, 692, 976, 81,
- -1, 696, -1, -1, -1, -1, -1, 89, 703, 704,
- 988, 706, 94, -1, -1, -1, -1, -1, -1, -1,
- 907, 908, -1, -1, -1, -1, -1, 339, 3, 4,
- 5, 6, -1, -1, 9, -1, -1, -1, -1, 734,
- -1, -1, 737, 1021, 739, 1023, -1, -1, -1, 744,
- 745, 746, -1, -1, -1, -1, -1, -1, -1, 754,
- -1, -1, -1, -1, -1, 760, -1, 42, -1, -1,
- -1, -1, 767, 768, 769, -1, -1, -1, -1, -1,
- 55, -1, 57, 58, 779, -1, -1, 399, -1, -1,
- 402, -1, -1, -1, -1, 407, 71, -1, -1, 3,
- 4, 5, 6, -1, -1, 9, 81, -1, 177, 178,
- 179, -1, -1, 4, 89, -1, -1, -1, -1, 94,
- -1, -1, -1, -1, 436, -1, 438, -1, 1106, -1,
- -1, -1, -1, -1, 829, -1, -1, -1, 42, 451,
- 31, 32, -1, 34, 48, 36, -1, -1, -1, -1,
- 41, 55, -1, 57, 58, -1, 1134, 852, 470, 854,
- -1, -1, -1, 54, -1, 56, 861, 71, -1, -1,
- 865, -1, 867, -1, 869, 870, 871, 81, -1, -1,
- -1, 876, -1, -1, -1, 89, -1, 91, 79, -1,
- 94, 95, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 903, -1,
- 905, -1, 907, 908, 909, 1102, 1103, 1104, 1105, -1,
- -1, -1, -1, 1110, 73, 74, 75, 76, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, 128, -1, -1,
- -1, 132, 133, -1, 135, 1132, 1133, -1, 139, -1,
- 141, -1, 143, -1, 949, 146, 147, 148, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 963, 160,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 974,
- -1, 976, -1, -1, 979, -1, 177, 178, 179, -1,
- -1, -1, 1270, 988, -1, -1, 187, -1, -1, 4,
- 5, -1, -1, 8, 9, -1, -1, -1, -1, 14,
- -1, -1, -1, -1, -1, 206, 1011, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 1021, -1, 1023, -1,
- 1217, 1218, 37, 1220, -1, -1, -1, -1, 650, -1,
- -1, 46, -1, 48, -1, -1, -1, -1, -1, 240,
- 55, -1, 57, 58, -1, -1, -1, -1, -1, -1,
- 1055, 1056, -1, 1058, -1, -1, 71, 436, -1, 438,
- -1, 440, 441, 442, -1, -1, 81, -1, -1, -1,
- -1, -1, 451, -1, 696, -1, 91, -1, -1, 94,
- 95, 703, 704, -1, 706, 74, 75, 76, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, 1102, 1103, 1104,
- 1105, 1106, -1, -1, -1, 1110, -1, -1, 309, -1,
- -1, 1116, -1, -1, -1, 737, -1, 739, -1, -1,
- -1, -1, 744, 745, 746, 326, -1, 1132, 1133, 1134,
- -1, -1, -1, 334, -1, 1423, -1, -1, 339, -1,
- -1, -1, -1, 1148, -1, -1, -1, -1, -1, -1,
- -1, 1439, -1, -1, 355, -1, -1, -1, 1163, -1,
- -1, -1, -1, 1168, -1, 1170, 3, 4, 5, 6,
- 7, 8, 9, -1, -1, 12, -1, 14, 379, -1,
- -1, -1, -1, -1, -1, -1, -1, 388, -1, -1,
- -1, -1, 29, -1, 31, 32, -1, -1, 399, -1,
- 37, 402, -1, -1, -1, 42, 407, -1, -1, 46,
- -1, 48, 1217, 1218, -1, 1220, -1, -1, 55, -1,
- 57, 58, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 71, 436, -1, 438, -1, 440,
- 441, 442, -1, -1, 81, 446, 1251, 1252, 1253, -1,
- 451, 4, 89, 454, 91, -1, -1, 94, 95, -1,
- -1, 98, -1, -1, -1, 1270, -1, -1, -1, 470,
- -1, -1, -1, -1, -1, -1, -1, -1, 31, 32,
- -1, 34, -1, 36, -1, 907, 908, -1, 41, -1,
- 3, 4, 5, 6, -1, -1, 9, -1, -1, 500,
- -1, 54, 503, 56, -1, -1, -1, -1, -1, -1,
- 4, 5, -1, -1, 8, 9, -1, 518, 519, 520,
- 14, -1, -1, -1, 703, 704, -1, 706, -1, 42,
- -1, -1, 533, -1, -1, 29, -1, 31, -1, -1,
- -1, -1, 55, 37, 57, 58, -1, -1, 81, -1,
- -1, -1, 46, 1358, 48, -1, -1, 979, 71, -1,
- -1, 55, -1, 57, 58, 744, -1, -1, 81, 4,
- 5, -1, -1, 8, 9, -1, 89, 71, 579, 14,
- -1, 94, 135, -1, -1, -1, 139, 81, -1, 1011,
- 143, 592, -1, 146, 147, 148, -1, 91, -1, -1,
- 94, 95, 37, -1, -1, -1, -1, 160, -1, 610,
- -1, 46, -1, 48, -1, -1, 1421, 1422, 1423, -1,
- 55, 154, 57, 58, 177, 178, 179, -1, -1, -1,
- -1, -1, -1, -1, 1439, -1, 71, -1, -1, 1444,
- -1, -1, 175, -1, -1, -1, 81, -1, 649, 650,
- 651, 652, -1, 206, -1, 188, 91, 4, 5, 94,
- 95, 8, 9, -1, -1, -1, -1, 14, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 1102, 1103, 29, -1, 31, -1, -1, 240, 1110, -1,
- 37, 692, -1, -1, -1, 696, -1, -1, -1, 46,
- -1, -1, 703, 704, -1, 706, -1, -1, 55, -1,
- 57, 58, -1, -1, -1, -1, -1, -1, -1, 1,
- -1, 3, 4, 5, 6, 7, 8, 9, 907, 908,
- 909, -1, 14, -1, -1, -1, 737, -1, 739, -1,
- -1, 1163, -1, 744, 745, 746, 1168, 29, 1170, 31,
- 32, 33, -1, -1, -1, 37, 38, -1, -1, -1,
- 42, -1, -1, -1, 46, 47, -1, 49, -1, -1,
- 949, -1, 773, 55, -1, 57, 58, -1, -1, 61,
- -1, 63, 335, -1, -1, -1, 339, -1, -1, 71,
- -1, -1, -1, -1, -1, 1217, 1218, -1, 1220, 81,
- 979, -1, -1, -1, -1, -1, -1, 89, 3, 4,
- 5, 6, 94, -1, 9, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 111,
- 1252, -1, -1, -1, -1, 388, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 399, 42, -1, 402,
- -1, -1, -1, -1, 407, -1, -1, -1, -1, -1,
- 55, -1, 57, 58, -1, -1, -1, -1, 869, 870,
- 871, -1, -1, -1, 875, -1, 71, -1, -1, -1,
- -1, -1, -1, 436, -1, 438, 81, 440, 441, 442,
- -1, -1, -1, 446, 89, -1, -1, -1, 451, 94,
- -1, 454, 34, -1, -1, -1, 907, 908, 909, -1,
- -1, 444, -1, 914, -1, -1, 449, 470, -1, -1,
- -1, -1, 54, 1102, 1103, 1104, 1105, 1106, -1, -1,
- -1, 1110, -1, -1, 3, 4, 5, 6, 7, 8,
- 9, 474, -1, -1, -1, 14, -1, 480, 949, -1,
- -1, -1, -1, 1132, 1133, 1134, -1, -1, -1, 492,
- 493, -1, 495, 32, -1, -1, -1, -1, 37, -1,
- -1, -1, -1, 42, -1, -1, -1, 46, 979, 48,
- 3, 4, 5, 6, 1163, -1, 55, -1, 57, 58,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000,
- -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
- 1011, -1, 81, -1, 146, 147, 148, -1, -1, 42,
- 89, -1, 91, -1, -1, 94, 95, 580, -1, -1,
- -1, -1, 55, -1, 57, 58, -1, -1, 1217, 1218,
- 63, 1220, -1, -1, -1, 177, 178, 179, 71, -1,
- -1, -1, -1, -1, -1, 588, 589, 610, 81, -1,
- 593, -1, -1, -1, -1, -1, 89, -1, -1, -1,
- -1, 94, -1, -1, 206, -1, -1, -1, -1, -1,
- -1, 1082, -1, -1, -1, -1, 3, 4, 5, 6,
- -1, -1, 9, -1, -1, -1, 649, 650, 651, 652,
- -1, 1102, 1103, 1104, 1105, 1106, -1, 1108, -1, 1110,
+ 157, 345, 172, 46, 205, 33, 23, 170, 80, 4,
+ 171, 80, 147, 148, 398, 443, 702, 4, 126, 448,
+ 247, 398, 4, 351, 351, 300, 301, 609, 470, 84,
+ 35, 14, 369, 76, 616, 398, 491, 42, 133, 134,
+ 35, 859, 243, 552, 62, 428, 589, 133, 35, 678,
+ 4, 134, 57, 35, 42, 42, 352, 353, 333, 1299,
+ 42, 42, 238, 107, 108, 124, 1306, 72, 685, 1370,
+ 142, 1459, 1289, 4, 213, 214, 30, 31, 54, 84,
+ 765, 35, 767, 88, 783, 90, 205, 92, 42, 774,
+ 789, 292, 1460, 42, 42, 214, 47, 37, 1, 11,
+ 83, 1461, 107, 108, 35, 4, 11, 11, 404, 405,
+ 4, 42, 47, 58, 12, 90, 1504, 92, 546, 147,
+ 148, 149, 55, 106, 351, 33, 1507, 199, 0, 1483,
+ 84, 136, 137, 632, 139, 478, 35, 33, 54, 9,
+ 47, 35, 93, 42, 345, 1, 62, 0, 42, 1503,
+ 62, 60, 495, 98, 136, 58, 161, 108, 93, 62,
+ 165, 59, 137, 191, 62, 12, 209, 172, 610, 109,
+ 1, 48, 178, 161, 1555, 59, 152, 165, 165, 161,
+ 524, 1541, 136, 165, 165, 84, 93, 686, 33, 258,
+ 208, 61, 95, 147, 148, 57, 108, 896, 216, 59,
+ 109, 109, 58, 108, 108, 1194, 1195, 161, 1562, 42,
+ 108, 165, 59, 1601, 232, 62, 165, 165, 1586, 1208,
+ 196, 25, 468, 27, 1464, 109, 59, 58, 83, 84,
+ 476, 62, 4, 5, 165, 189, 190, 136, 171, 3,
+ 4, 5, 136, 1460, 74, 1546, 701, 342, 108, 25,
+ 60, 27, 148, 149, 58, 75, 342, 77, 62, 8,
+ 9, 244, 161, 47, 95, 14, 165, 161, 59, 4,
+ 54, 165, 74, 1513, 136, 703, 48, 4, 5, 436,
+ 4, 325, 58, 338, 56, 57, 62, 36, 293, 74,
+ 74, 95, 56, 57, 911, 191, 45, 914, 47, 109,
+ 35, 629, 147, 148, 149, 668, 389, 936, 80, 93,
+ 172, 35, 1011, 696, 697, 858, 80, 108, 900, 95,
+ 325, 658, 381, 1563, 1023, 54, 59, 462, 463, 56,
+ 57, 47, 165, 338, 60, 474, 475, 633, 955, 956,
+ 724, 346, 1331, 482, 93, 74, 191, 724, 60, 354,
+ 355, 1340, 1341, 59, 1343, 494, 475, 25, 1057, 27,
+ 1059, 943, 93, 1048, 3, 4, 5, 25, 351, 4,
+ 5, 598, 205, 355, 513, 108, 720, 93, 94, 354,
+ 213, 214, 7, 109, 338, 58, 62, 59, 60, 62,
+ 58, 27, 108, 398, 62, 31, 401, 109, 74, 4,
+ 58, 355, 108, 985, 62, 4, 5, 47, 47, 453,
+ 243, 398, 37, 48, 1232, 54, 47, 56, 57, 47,
+ 438, 56, 57, 492, 60, 430, 47, 95, 64, 325,
+ 35, 940, 861, 47, 462, 463, 464, 95, 47, 338,
+ 54, 484, 430, 47, 398, 80, 47, 93, 430, 430,
+ 47, 456, 93, 93, 93, 897, 355, 56, 57, 292,
+ 74, 355, 93, 481, 44, 93, 94, 400, 108, 4,
+ 5, 54, 93, 109, 54, 54, 430, 57, 522, 93,
+ 108, 525, 74, 62, 93, 529, 25, 492, 27, 93,
+ 94, 74, 93, 355, 47, 74, 93, 94, 542, 398,
+ 1489, 1490, 456, 799, 108, 1122, 1123, 93, 462, 463,
+ 492, 555, 345, 48, 519, 559, 60, 522, 107, 58,
+ 525, 56, 57, 62, 529, 530, 531, 532, 533, 4,
+ 5, 430, 695, 25, 9, 590, 430, 542, 492, 59,
+ 93, 1359, 47, 587, 519, 80, 974, 552, 47, 593,
+ 555, 60, 54, 937, 1009, 75, 95, 456, 54, 64,
+ 937, 492, 1144, 7, 8, 9, 47, 463, 464, 402,
+ 14, 666, 74, 749, 937, 751, 659, 905, 905, 54,
+ 756, 56, 57, 666, 62, 590, 47, 31, 93, 94,
+ 31, 1173, 36, 492, 93, 70, 74, 430, 492, 38,
+ 54, 45, 54, 742, 609, 80, 27, 808, 62, 62,
+ 31, 616, 93, 4, 5, 54, 60, 462, 463, 464,
+ 74, 47, 74, 47, 58, 12, 522, 902, 74, 525,
+ 492, 54, 93, 94, 930, 12, 590, 620, 59, 60,
+ 27, 474, 475, 64, 31, 541, 542, 1076, 1077, 482,
+ 667, 759, 606, 607, 1096, 609, 661, 58, 58, 555,
+ 47, 494, 616, 54, 64, 56, 57, 93, 94, 93,
+ 675, 109, 59, 60, 679, 62, 47, 64, 905, 70,
+ 513, 47, 59, 47, 701, 62, 661, 64, 54, 80,
+ 47, 590, 3, 4, 5, 6, 765, 62, 767, 93,
+ 1155, 54, 635, 94, 773, 774, 93, 94, 74, 74,
+ 609, 780, 62, 47, 4, 5, 54, 616, 54, 724,
+ 616, 108, 93, 54, 74, 768, 769, 93, 47, 93,
+ 41, 75, 1187, 54, 777, 47, 93, 48, 74, 745,
+ 1169, 674, 94, 676, 677, 56, 57, 1091, 108, 1178,
+ 1179, 47, 64, 74, 1183, 1051, 1052, 1053, 48, 93,
+ 765, 108, 767, 4, 5, 108, 56, 57, 773, 774,
+ 724, 4, 5, 779, 93, 780, 9, 88, 783, 784,
+ 785, 93, 787, 765, 789, 767, 108, 720, 4, 5,
+ 80, 11, 774, 109, 1223, 59, 60, 93, 780, 962,
+ 3, 4, 5, 636, 7, 8, 9, 48, 60, 784,
+ 785, 765, 787, 767, 62, 56, 57, 4, 5, 98,
+ 774, 54, 866, 56, 57, 724, 780, 93, 31, 783,
+ 1006, 1007, 1008, 36, 765, 789, 767, 70, 54, 772,
+ 56, 57, 47, 774, 677, 3, 111, 80, 62, 780,
+ 60, 54, 857, 56, 57, 58, 900, 862, 94, 64,
+ 108, 94, 94, 1549, 4, 5, 765, 54, 767, 56,
+ 57, 765, 62, 767, 111, 774, 948, 3, 4, 5,
+ 774, 780, 93, 70, 783, 890, 780, 720, 93, 1318,
+ 789, 896, 93, 80, 108, 900, 1092, 1093, 74, 1095,
+ 103, 104, 105, 765, 30, 767, 802, 74, 48, 742,
+ 772, 773, 774, 59, 60, 943, 56, 57, 780, 3,
+ 4, 5, 905, 59, 4, 5, 74, 1356, 54, 27,
+ 56, 57, 937, 31, 939, 940, 59, 60, 943, 75,
+ 80, 77, 896, 74, 898, 899, 900, 1243, 59, 60,
+ 937, 54, 59, 1381, 1298, 59, 60, 985, 11, 62,
+ 1004, 59, 60, 1035, 9, 109, 1035, 12, 48, 1397,
+ 54, 74, 56, 57, 58, 808, 56, 57, 108, 1048,
+ 985, 59, 60, 937, 1027, 59, 60, 941, 942, 943,
+ 1033, 1034, 59, 998, 1037, 1038, 108, 896, 1041, 1004,
+ 80, 900, 47, 899, 900, 74, 1011, 1142, 1143, 108,
+ 1016, 1017, 59, 60, 59, 108, 61, 62, 1023, 64,
+ 4, 5, 54, 3, 4, 5, 6, 796, 797, 798,
+ 75, 985, 77, 54, 8, 9, 1171, 1172, 937, 1045,
+ 14, 62, 108, 1048, 943, 59, 60, 943, 93, 94,
+ 74, 59, 1057, 74, 1059, 1483, 64, 1011, 74, 109,
+ 44, 41, 36, 108, 74, 109, 1048, 75, 48, 1023,
+ 54, 45, 56, 57, 1146, 1503, 56, 57, 3, 4,
+ 5, 1014, 1087, 111, 111, 108, 985, 27, 74, 985,
+ 54, 54, 74, 111, 1048, 1100, 111, 108, 943, 62,
+ 80, 54, 108, 1057, 1532, 1059, 108, 58, 88, 62,
+ 108, 74, 1011, 1497, 1142, 1143, 1144, 1048, 54, 8,
+ 1497, 74, 111, 93, 1023, 1100, 47, 1297, 59, 1173,
+ 64, 56, 57, 58, 1562, 1296, 1205, 1298, 1155, 1144,
+ 985, 93, 1570, 1171, 1172, 1173, 54, 109, 59, 1048,
+ 60, 36, 1014, 108, 1048, 64, 60, 1501, 1057, 64,
+ 1059, 1166, 1591, 74, 75, 64, 77, 62, 1173, 108,
+ 108, 1166, 64, 108, 64, 1219, 1220, 1221, 1222, 108,
+ 4, 5, 64, 111, 1166, 9, 1048, 93, 1142, 1143,
+ 1144, 59, 62, 108, 1200, 1201, 108, 1203, 1204, 75,
+ 1206, 3, 4, 5, 6, 108, 108, 108, 75, 3,
+ 4, 5, 1166, 7, 8, 9, 75, 1171, 1172, 1173,
+ 75, 108, 108, 47, 62, 62, 3, 4, 5, 6,
+ 54, 59, 56, 57, 108, 1166, 62, 31, 1282, 41,
+ 111, 94, 36, 108, 108, 1144, 70, 1143, 1144, 3,
+ 4, 5, 54, 111, 56, 57, 80, 88, 60, 90,
+ 62, 92, 56, 57, 41, 88, 90, 1166, 70, 93,
+ 94, 74, 47, 108, 1173, 108, 1172, 1173, 80, 56,
+ 57, 111, 111, 108, 1289, 59, 88, 3, 4, 5,
+ 108, 93, 1297, 108, 1299, 1338, 1339, 1142, 1143, 1144,
+ 1501, 1306, 56, 57, 1299, 109, 137, 1289, 139, 108,
+ 1315, 1306, 109, 1357, 60, 64, 64, 1299, 1475, 4,
+ 5, 59, 1328, 1329, 1306, 59, 1171, 1172, 1173, 108,
+ 3, 4, 5, 93, 93, 1289, 108, 93, 54, 109,
+ 56, 57, 93, 1478, 1479, 1299, 1390, 109, 3, 4,
+ 5, 6, 1306, 108, 9, 108, 108, 8, 1289, 3,
+ 4, 5, 47, 1296, 1407, 1298, 1529, 111, 1299, 54,
+ 111, 56, 57, 108, 33, 1306, 3, 4, 5, 6,
+ 1408, 54, 9, 56, 57, 70, 41, 108, 108, 108,
+ 1289, 109, 47, 108, 108, 80, 108, 108, 108, 54,
+ 1299, 56, 57, 108, 48, 90, 64, 1306, 93, 94,
+ 1454, 108, 56, 57, 41, 70, 1460, 1461, 54, 108,
+ 47, 1427, 1428, 1429, 108, 80, 47, 54, 62, 56,
+ 57, 111, 108, 88, 108, 90, 1480, 108, 93, 94,
+ 3, 4, 5, 70, 7, 8, 9, 96, 62, 1454,
+ 1478, 1479, 1480, 80, 1459, 1460, 1461, 62, 60, 1464,
+ 60, 88, 9, 90, 1459, 1298, 93, 94, 60, 1464,
+ 80, 81, 82, 83, 84, 1480, 16, 1459, 1460, 108,
+ 1486, 1487, 1464, 108, 108, 316, 108, 3, 4, 5,
+ 108, 1534, 1497, 56, 57, 108, 93, 1541, 398, 1504,
+ 1454, 60, 93, 60, 64, 1459, 1460, 1461, 1513, 1504,
+ 1464, 54, 1408, 1557, 93, 111, 93, 17, 1513, 60,
+ 54, 107, 1504, 354, 1478, 1479, 97, 108, 1459, 1460,
+ 60, 1513, 48, 1464, 108, 1579, 1541, 11, 108, 108,
+ 56, 57, 1586, 1497, 93, 60, 60, 60, 1554, 14,
+ 1504, 59, 64, 108, 60, 1454, 456, 22, 1563, 1513,
+ 1459, 1460, 1461, 1408, 108, 1464, 108, 11, 1563, 1502,
+ 60, 11, 60, 1504, 2, 0, 0, 3, 4, 5,
+ 6, 1563, 1513, 1479, 1480, 0, 166, 1541, 35, 1395,
+ 165, 3, 4, 5, 6, 659, 1601, 937, 1497, 161,
+ 65, 3, 4, 5, 1528, 1504, 1601, 773, 430, 1563,
+ 1155, 94, 38, 39, 1513, 41, 139, 448, 449, 1601,
+ 3, 4, 5, 6, 1380, 456, 9, 1601, 54, 41,
+ 56, 57, 1563, 1478, 1479, 1480, 48, 1233, 3, 4,
+ 5, 80, 1541, 295, 56, 57, 923, 1601, 708, 449,
+ 918, 1187, 237, 1009, 56, 57, 456, 773, 41, 124,
+ 780, 302, 303, 642, 1563, 104, 1207, 916, 1501, 196,
+ 1601, 54, 590, 56, 57, 342, 88, 318, 124, 1299,
+ 321, 146, 1167, 324, 1570, 1549, 327, 70, 519, 520,
+ 331, 56, 57, 1518, 133, 1580, 993, 80, 339, 3,
+ 4, 5, 1601, 142, 1582, 88, -1, 1315, -1, 609,
+ 93, -1, 3, 4, 5, 6, 616, -1, 9, -1,
+ 520, 552, -1, 554, -1, -1, 557, 558, -1, 560,
+ 561, 562, 563, 564, 565, 566, 567, 568, 569, 570,
+ 571, 572, 573, 574, 575, 576, 577, 578, -1, 580,
+ 41, -1, 56, 57, -1, 586, 47, 3, 4, 5,
+ 199, 7, -1, 54, -1, 56, 57, -1, 233, 234,
+ -1, -1, 3, 4, 5, -1, -1, -1, 4, 70,
+ 580, -1, 247, -1, 30, 616, 586, -1, 14, 80,
+ -1, 37, 623, -1, 233, 4, 5, 88, 24, 90,
+ 9, -1, 93, 94, 30, 31, -1, 33, 54, 35,
+ 56, 57, -1, -1, 645, 646, 42, -1, -1, 258,
+ -1, -1, -1, 623, 724, 56, 57, -1, -1, 55,
+ 661, 57, -1, -1, 3, 4, 5, 6, 47, 65,
+ -1, -1, 3, 4, 5, 54, 72, 56, 57, -1,
+ -1, -1, 317, 3, 4, 5, 6, 83, 84, 9,
+ -1, 70, -1, -1, -1, 57, -1, 59, -1, -1,
+ -1, 80, 41, 65, 3, 4, 5, 708, -1, 48,
+ 106, 90, -1, 783, 93, 94, -1, 56, 57, 789,
+ -1, 41, -1, -1, 359, 56, 57, 47, -1, 540,
+ 541, -1, -1, 368, 54, -1, 56, 57, 134, -1,
+ 136, 350, -1, -1, 140, -1, 381, 143, 144, 88,
+ 70, 147, 148, 149, 449, -1, -1, 56, 57, -1,
+ 80, 456, -1, 764, -1, 161, -1, -1, 88, 165,
+ 90, -1, -1, 93, 94, 171, 172, -1, -1, -1,
+ -1, -1, -1, 784, 785, -1, 787, -1, 47, -1,
+ -1, -1, -1, 189, 190, 191, -1, -1, 407, -1,
+ -1, 802, -1, -1, 3, 4, 5, 6, -1, -1,
+ 172, 3, 4, 5, 6, -1, 178, -1, -1, -1,
+ -1, -1, 218, 824, -1, 520, 896, 86, 87, -1,
+ 900, -1, 91, 92, 93, 94, -1, -1, 234, -1,
+ -1, -1, 41, 205, -1, -1, -1, -1, 244, 41,
+ -1, 213, 214, -1, 489, 856, 857, 56, 57, 255,
+ 861, 862, 54, -1, 56, 57, -1, 937, 60, -1,
+ -1, -1, -1, 943, -1, 876, -1, 878, 70, 880,
+ 489, -1, -1, -1, -1, 580, 856, 857, 80, 88,
+ -1, 586, 862, -1, -1, -1, 88, 293, 294, -1,
+ -1, 93, -1, -1, -1, -1, 876, 516, 878, -1,
+ 880, -1, -1, -1, 915, 985, 7, 8, 9, 554,
+ -1, 616, -1, 14, 925, 4, 5, -1, 623, -1,
+ 9, -1, 3, 4, 5, 6, 7, 8, 9, 940,
+ 31, 1011, 338, 14, -1, 36, 342, -1, 344, 345,
+ 346, -1, 953, 1023, 45, 925, -1, -1, -1, 355,
+ 31, -1, -1, 598, -1, 36, -1, 968, 47, 60,
+ 41, -1, -1, -1, 45, 54, 47, 56, 57, -1,
+ -1, -1, -1, 54, 985, 56, 57, 1057, -1, 1059,
+ -1, 70, -1, 389, 603, -1, -1, -1, 968, 70,
+ -1, 80, 398, -1, 400, 401, -1, -1, -1, 80,
+ 619, 90, -1, -1, 93, 94, -1, 88, 414, 90,
+ -1, 417, 93, 94, -1, 1026, 422, -1, -1, -1,
+ -1, -1, 667, -1, 430, -1, -1, -1, -1, 401,
+ 402, -1, 1, 678, 3, 4, 5, 6, -1, 8,
+ -1, -1, -1, -1, -1, 3, 4, 5, 6, 870,
+ -1, 9, 458, -1, 460, -1, 462, 463, 464, -1,
+ -1, -1, 468, 708, 1144, 1076, 1077, 473, -1, 1080,
+ 476, -1, 41, -1, -1, -1, -1, 898, 899, 48,
+ -1, -1, -1, 41, -1, 54, 492, 56, 57, 1100,
+ -1, -1, -1, 1173, -1, 467, 54, 802, 56, 57,
+ -1, -1, 474, 475, -1, -1, 478, 7, 8, 9,
+ 482, -1, 70, -1, 14, -1, -1, -1, -1, 88,
+ -1, -1, 80, 495, 530, 531, 532, 533, -1, -1,
+ 88, 31, -1, -1, -1, 93, 36, -1, 3, 4,
+ 5, 6, -1, -1, 9, 45, 1157, -1, 1159, -1,
+ 1161, 856, 857, -1, -1, -1, -1, 862, 1169, 78,
+ 79, 80, 81, 82, 83, 84, -1, 1178, 1179, -1,
+ -1, 876, 1183, 878, -1, 880, 41, 1157, -1, 1159,
+ -1, 1161, -1, -1, 590, -1, 592, 1198, 1199, 54,
+ -1, 56, 57, -1, -1, 7, 8, 9, 604, -1,
+ 606, 607, 14, 609, -1, 70, -1, -1, -1, -1,
+ 616, -1, 1223, -1, 620, 80, -1, -1, -1, 31,
+ 925, -1, -1, 88, 36, -1, -1, -1, 93, 635,
+ -1, -1, -1, 45, 740, -1, -1, -1, -1, -1,
+ -1, -1, -1, 1254, -1, 3, 4, 5, 6, -1,
+ -1, -1, -1, 659, -1, -1, 3, 4, 5, 6,
+ 666, -1, -1, 968, 636, -1, -1, 1278, 674, 675,
+ 676, 677, 678, 679, 1254, -1, 782, 1098, 923, -1,
+ 985, -1, 788, 41, -1, 904, -1, 906, -1, 47,
+ -1, 936, -1, -1, 41, -1, 54, -1, 56, 57,
+ -1, 48, -1, 675, -1, 677, 678, 1318, -1, 56,
+ 57, -1, 70, -1, 720, -1, -1, -1, 724, -1,
+ -1, -1, 80, 1334, -1, 731, 732, -1, 734, 948,
+ 88, -1, 90, 80, -1, 93, 94, -1, -1, -1,
+ -1, 88, -1, -1, -1, 1356, -1, -1, 720, -1,
+ 1171, 1172, -1, -1, -1, -1, 762, -1, -1, 765,
+ -1, 767, -1, -1, -1, -1, 772, 773, 774, -1,
+ 742, -1, -1, 745, 780, -1, -1, 783, -1, -1,
+ -1, -1, -1, 789, -1, 891, -1, 893, -1, -1,
+ 796, 797, 798, -1, -1, -1, -1, 1408, -1, -1,
+ -1, 773, 808, -1, -1, -1, -1, 779, -1, -1,
+ -1, -1, -1, -1, 1425, 1426, 1035, 1497, -1, -1,
+ -1, 4, 5, 1434, 7, 8, 9, -1, -1, 12,
+ -1, 14, 1077, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 28, -1, 30, 31, -1,
+ -1, 1462, 1157, 36, 1159, -1, 1161, -1, -1, -1,
+ -1, -1, 45, -1, 47, -1, -1, -1, 1289, -1,
+ -1, 54, -1, 56, 57, 881, -1, 883, -1, -1,
+ -1, -1, -1, -1, 890, -1, -1, 70, 894, -1,
+ 896, -1, 898, 899, 900, -1, -1, 80, -1, 905,
+ 1119, -1, -1, -1, -1, -1, -1, 90, -1, -1,
+ 93, 94, -1, 3, 4, 5, 6, -1, 1163, -1,
+ -1, -1, -1, -1, 1169, -1, -1, 1146, -1, -1,
+ -1, 937, -1, 939, 4, 941, 942, 943, -1, -1,
+ -1, -1, -1, -1, 14, -1, -1, -1, -1, 1254,
+ 1056, 41, 1058, 23, 24, -1, -1, -1, 48, -1,
+ 30, 31, -1, 33, 936, 35, 56, 57, -1, -1,
+ -1, -1, 42, -1, -1, 3, 4, 5, 6, 985,
+ 1591, -1, -1, -1, -1, 55, 1205, 57, -1, -1,
+ 80, -1, 998, -1, -1, 65, -1, -1, 88, -1,
+ -1, -1, 72, -1, -1, 1011, -1, 1113, 1014, -1,
+ -1, -1, -1, 41, 84, -1, -1, 1023, -1, -1,
+ 48, -1, -1, -1, -1, -1, -1, -1, 56, 57,
+ 1036, -1, -1, -1, -1, -1, -1, -1, 1283, 1284,
+ -1, -1, 1048, -1, 1016, 1017, -1, -1, -1, -1,
+ -1, 1057, 80, 1059, -1, -1, -1, 1478, 1479, -1,
+ 88, -1, 3, 4, 5, 6, 136, -1, 9, -1,
+ 140, -1, -1, 1045, 144, -1, -1, 147, 148, 149,
+ -1, 1087, -1, -1, -1, 1191, 1092, 1093, -1, 1095,
+ 1196, 161, -1, -1, -1, 165, -1, 189, 190, 191,
+ 41, 171, 172, 1408, -1, 3, 4, 5, 6, -1,
+ -1, 9, -1, 54, -1, 56, 57, -1, -1, 189,
+ 190, 191, -1, 3, 4, 5, 6, 1372, -1, 70,
+ -1, -1, -1, -1, 1140, 1141, 1142, 1143, 1144, 80,
+ -1, 1247, 1148, 41, -1, -1, -1, 88, 218, 1394,
+ 1395, -1, 93, -1, -1, -1, 54, -1, 56, 57,
+ -1, 41, -1, -1, -1, 1171, 1172, 1173, 48, -1,
+ -1, -1, 70, -1, -1, -1, 56, 57, -1, -1,
+ -1, -1, 80, -1, -1, 255, -1, -1, -1, -1,
+ 88, -1, -1, -1, -1, 93, 1202, -1, -1, -1,
+ 80, 1207, -1, -1, -1, -1, -1, -1, 88, -1,
+ -1, 3, 4, 5, 6, 7, 8, 9, -1, -1,
+ -1, -1, 14, 293, 294, -1, -1, 1472, 1200, 1201,
+ -1, 1203, 1204, -1, 1206, -1, 344, 345, 346, 31,
+ -1, 1347, 1348, -1, 36, -1, -1, -1, -1, 41,
+ -1, 1257, 1258, 45, 1260, 47, -1, -1, 1364, -1,
+ -1, -1, 54, -1, 56, 57, -1, -1, 338, -1,
+ -1, -1, 342, -1, 344, 345, 346, -1, 70, -1,
+ -1, 351, -1, -1, -1, 355, -1, -1, 80, -1,
+ 1296, 1297, 1298, -1, -1, -1, 88, -1, 90, -1,
+ -1, 93, 94, -1, -1, -1, -1, -1, -1, 1315,
+ -1, -1, -1, -1, 1420, 1421, -1, -1, -1, 389,
+ -1, -1, -1, -1, -1, 1297, 1298, -1, 398, -1,
+ 400, 401, -1, 1439, 1440, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 414, -1, -1, 417, -1, -1,
+ -1, -1, 422, -1, -1, -1, 1328, 1329, -1, -1,
+ 430, 3, 4, 5, 6, -1, 458, 9, 460, -1,
+ 462, 463, 464, -1, -1, -1, -1, -1, -1, -1,
+ -1, 473, 3, 4, 5, 6, -1, -1, 458, -1,
+ 460, -1, 462, 463, 464, -1, -1, -1, 468, 41,
+ 4, 5, 1408, 473, 8, 9, 476, -1, -1, -1,
+ 14, -1, 54, -1, 56, 57, -1, -1, -1, -1,
+ 41, 491, 492, -1, 28, -1, 30, -1, 70, -1,
+ -1, -1, 36, 54, -1, 56, 57, -1, 80, -1,
+ -1, 45, -1, 47, -1, -1, 88, -1, -1, -1,
+ 54, 93, 56, 57, -1, 1427, 1428, 1429, -1, -1,
+ 530, 531, 532, 533, -1, -1, 70, 88, -1, -1,
+ -1, -1, 1478, 1479, 1480, -1, 80, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 90, -1, -1, 93,
+ 94, 1497, -1, -1, -1, -1, 1502, -1, 606, 607,
+ 3, 4, 5, 6, 7, 8, 9, -1, 4, 5,
+ -1, 14, 8, 9, 1486, 1487, -1, -1, 14, -1,
+ 590, -1, 592, -1, -1, 28, -1, 30, 31, 32,
+ -1, -1, 28, 36, 30, -1, 606, 607, 41, 609,
+ 36, -1, 45, -1, -1, 48, 616, -1, -1, 45,
+ -1, 54, -1, 56, 57, -1, -1, -1, 54, 629,
+ 56, 57, -1, -1, -1, 635, 674, 70, 676, 677,
+ -1, 679, -1, -1, -1, -1, -1, 80, -1, -1,
+ -1, -1, 1554, -1, -1, 88, -1, -1, -1, 659,
+ 93, -1, -1, -1, -1, 98, -1, 667, -1, -1,
+ -1, -1, -1, -1, 674, 675, 676, 677, 678, 679,
+ -1, -1, 720, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 1, 701, 3, 4, 5, 6, 7, 8, 9, 731,
+ 732, -1, 734, 14, -1, -1, -1, -1, -1, -1,
+ 720, -1, -1, -1, 724, -1, -1, 28, -1, 30,
+ 31, 731, 732, -1, 734, 36, -1, -1, -1, -1,
+ 41, -1, -1, -1, 45, -1, -1, 48, -1, -1,
+ 772, -1, -1, 54, -1, 56, 57, -1, -1, 60,
+ -1, -1, 762, -1, -1, 765, -1, 767, -1, 70,
+ 808, -1, 772, 773, 774, -1, -1, -1, -1, 80,
+ 780, 4, 5, 783, -1, 8, 9, 88, -1, 789,
+ -1, 14, 93, -1, -1, -1, 796, 797, 798, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 808, -1,
+ -1, -1, -1, 36, -1, 4, -1, -1, -1, -1,
+ -1, -1, 45, -1, 47, 3, 4, 5, 6, -1,
+ -1, 54, -1, 56, 57, -1, -1, -1, -1, -1,
+ -1, 30, 31, 881, 33, 883, 35, 70, -1, -1,
+ -1, -1, -1, 42, -1, -1, 894, 80, -1, -1,
+ 898, 899, -1, 41, -1, -1, 55, 90, 57, -1,
+ 93, 94, -1, -1, -1, -1, 54, -1, 56, 57,
+ -1, 881, -1, 883, 62, -1, -1, -1, -1, -1,
+ 890, 80, 70, -1, 894, -1, 896, -1, 898, 899,
+ 900, -1, 80, 941, 942, 905, -1, -1, -1, -1,
+ 88, -1, -1, -1, -1, 93, -1, -1, -1, 941,
+ 942, 943, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, 80, 81, 82, 83, 84, 937, -1, 939,
+ -1, 941, 942, 943, 133, 134, -1, 136, -1, -1,
+ -1, 140, -1, 142, -1, 144, -1, -1, 147, 148,
+ 149, -1, -1, 985, -1, 4, 5, -1, -1, 8,
+ 9, -1, 161, -1, -1, 14, 165, -1, -1, -1,
+ -1, -1, 171, 172, -1, 985, -1, -1, -1, -1,
+ -1, -1, 1014, -1, -1, -1, -1, 36, 998, -1,
+ 189, 190, 191, -1, -1, -1, 45, -1, 47, 1009,
+ 199, 1011, -1, -1, 1014, 54, -1, 56, 57, -1,
+ -1, -1, -1, 1023, 3, 4, 5, 6, -1, 218,
+ 9, 70, 4, 5, -1, -1, 8, 9, -1, -1,
+ -1, 80, 14, -1, -1, -1, -1, -1, 1048, -1,
+ -1, 90, -1, -1, 93, 94, 28, 1057, 30, 1059,
+ -1, -1, 41, -1, 36, -1, 255, -1, -1, -1,
+ -1, -1, -1, 45, -1, 54, -1, 56, 57, -1,
+ -1, -1, 54, -1, 56, 57, -1, 1087, -1, -1,
+ -1, 70, 1092, 1093, -1, 1095, -1, -1, -1, -1,
+ -1, 80, 1140, 1141, 1142, 1143, -1, -1, -1, 88,
+ 1148, -1, -1, -1, 93, -1, -1, -1, 1140, 1141,
+ 1142, 1143, 1144, -1, -1, -1, 1148, -1, -1, -1,
+ -1, -1, -1, 1171, 1172, -1, 325, -1, -1, -1,
+ 1140, 1141, 1142, 1143, 1144, -1, -1, -1, 1148, 1171,
+ 1172, 1173, -1, 342, -1, 1155, -1, -1, -1, -1,
+ -1, 350, -1, -1, -1, -1, 355, -1, -1, -1,
+ -1, 1171, 1172, 1173, -1, -1, 3, 4, 5, 6,
+ 1202, -1, 9, -1, -1, -1, -1, 1187, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 3, 4, 5, 6, 42, -1, 9, -1, -1,
- -1, 1132, 1133, 1134, -1, -1, -1, -1, 55, 692,
- 57, 58, -1, 696, -1, -1, -1, 279, -1, -1,
- 703, 704, -1, 706, 71, -1, -1, -1, -1, -1,
- 42, -1, 1163, -1, 81, -1, -1, 1168, -1, 1170,
- -1, -1, 89, 55, -1, 57, 58, 94, -1, 1358,
- -1, -1, 4, 5, 737, -1, 739, 9, -1, 71,
- -1, 744, 745, 746, -1, -1, 328, 329, 330, 81,
- -1, -1, -1, -1, -1, -1, 54, 89, 3, 4,
- 5, 6, 94, -1, -1, -1, 1217, 1218, -1, 1220,
- -1, -1, -1, -1, -1, -1, 48, -1, 761, -1,
- 763, 79, -1, 55, 82, 57, 58, -1, -1, -1,
- -1, -1, 1421, 1422, 1423, -1, -1, 42, -1, 71,
- 1251, 1252, 1253, -1, -1, 103, 388, 105, -1, 81,
- 55, -1, 57, 58, -1, -1, 61, -1, -1, 91,
- -1, -1, 94, 95, -1, -1, 71, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 81, -1, -1, -1,
- -1, -1, -1, -1, 89, -1, -1, -1, -1, 94,
- -1, -1, 835, 836, 436, 838, 438, -1, 440, 441,
- 442, -1, -1, -1, 446, -1, -1, -1, -1, 451,
- -1, -1, 454, 876, -1, -1, -1, -1, -1, 177,
- 178, 179, -1, 866, -1, -1, -1, -1, -1, 187,
- 4, 5, -1, 7, 8, 9, -1, -1, 12, -1,
- 14, -1, -1, -1, 907, 908, 909, 1358, 206, -1,
- -1, 3, 4, 5, 6, 29, -1, 31, 32, -1,
- -1, -1, -1, 37, -1, -1, -1, -1, 911, -1,
- -1, 229, 46, -1, 48, -1, -1, -1, -1, -1,
- -1, 55, -1, 57, 58, 243, 949, -1, -1, -1,
- 42, -1, -1, -1, -1, -1, -1, 71, -1, -1,
- -1, -1, -1, 55, -1, 57, 58, 81, -1, -1,
- 1421, 1422, 1423, -1, -1, -1, 979, 91, -1, 71,
- 94, 95, -1, -1, 98, -1, 568, -1, -1, 81,
- -1, -1, 975, 1444, -1, -1, -1, 89, -1, -1,
- 582, 583, 94, 585, 987, -1, -1, -1, 1011, -1,
- 592, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 4, 5, -1, 7, 8, 9, -1, -1, 610, -1,
- 14, -1, -1, -1, -1, -1, 334, 335, -1, -1,
- -1, 3, 4, 5, 6, 29, -1, 31, 32, -1,
- -1, -1, -1, 37, -1, -1, -1, -1, -1, -1,
- -1, -1, 46, -1, -1, 49, -1, 649, -1, 651,
- 652, 55, 654, 57, 58, -1, -1, -1, -1, -1,
- 42, -1, -1, -1, -1, -1, -1, -1, 1071, -1,
- 388, -1, -1, 55, -1, 57, 58, -1, -1, 1102,
- 1103, 1104, 1105, 1106, -1, -1, -1, 1110, -1, 71,
- 692, -1, -1, -1, -1, -1, -1, -1, -1, 81,
- -1, 703, 704, -1, 706, -1, 1109, 89, -1, 1132,
- 1133, 1134, 94, -1, -1, -1, -1, -1, 436, -1,
- 438, -1, 440, 441, 442, -1, -1, -1, 446, -1,
- -1, -1, -1, 451, -1, -1, 454, -1, -1, -1,
- 1163, -1, 744, -1, -1, 1168, -1, 1170, -1, -1,
- -1, -1, -1, -1, -1, 1, -1, 3, 4, 5,
- 6, 7, 8, 9, -1, 767, 768, 769, 14, 1172,
- -1, -1, -1, 1176, -1, -1, -1, 779, -1, -1,
- -1, -1, -1, 29, -1, 31, 32, 33, -1, -1,
- -1, 37, 38, -1, 1217, 1218, 42, 1220, -1, -1,
- 46, 47, -1, 49, -1, -1, 1209, -1, -1, 55,
- -1, 57, 58, -1, -1, 61, -1, 63, 3, 4,
- 5, 6, -1, -1, -1, 71, -1, -1, 1251, 1252,
- 1253, -1, -1, -1, -1, 81, -1, -1, -1, -1,
- -1, -1, -1, 89, -1, -1, -1, -1, 94, -1,
- 852, -1, 854, -1, -1, -1, -1, 42, -1, -1,
- -1, -1, -1, 865, -1, 111, -1, 869, 870, 871,
- 55, -1, 57, 58, -1, 1278, -1, 595, 596, 1282,
- -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
- 4, 5, 610, 7, 8, 9, 81, -1, 12, -1,
- 14, 1304, 1305, -1, 89, 907, 908, 909, -1, 94,
- -1, -1, -1, -1, -1, 29, -1, 31, 32, -1,
- -1, -1, -1, 37, -1, -1, -1, -1, -1, -1,
- -1, 649, 46, 651, 652, 1358, -1, -1, -1, -1,
- -1, 55, -1, 57, 58, -1, -1, 949, -1, -1,
- 3, 4, 5, 6, 7, 8, 9, -1, 14, -1,
- -1, 14, -1, -1, -1, -1, -1, -1, 24, 25,
- -1, -1, -1, -1, 692, 31, 32, 979, 34, 32,
- -1, -1, -1, -1, 37, 703, 704, -1, 706, 42,
- -1, -1, -1, 46, -1, 48, -1, -1, 1421, 1422,
- 1423, -1, 55, -1, 57, 58, 4, 5, 64, 7,
- 8, 9, -1, 731, -1, -1, 14, -1, 71, -1,
- -1, 1444, -1, -1, -1, -1, 744, -1, 81, -1,
- -1, 29, -1, 31, 32, -1, 89, -1, 91, 37,
- -1, 94, 95, -1, -1, -1, -1, -1, 46, -1,
- -1, -1, -1, 1055, 1056, -1, 1058, 55, -1, 57,
- 58, -1, -1, -1, -1, -1, -1, 123, -1, 125,
- -1, -1, 128, -1, -1, -1, 132, 133, -1, -1,
- -1, -1, -1, 139, -1, 141, 142, 143, -1, -1,
- 146, 147, 148, -1, -1, -1, -1, -1, -1, -1,
- 1102, 1103, 1104, 1105, 1106, -1, -1, -1, 1110, 68,
+ 389, -1, 1202, -1, -1, -1, -1, 1207, -1, -1,
+ -1, 400, -1, -1, 41, -1, -1, -1, -1, 1257,
+ 1258, -1, 1260, -1, -1, 414, -1, 54, 417, 56,
+ 57, -1, -1, 422, -1, 1257, 1258, -1, 1260, -1,
+ -1, 430, -1, 70, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 80, -1, -1, -1, 1257, 1258, -1,
+ 1260, 88, -1, -1, -1, -1, 93, -1, -1, 458,
+ -1, 460, -1, 462, 463, 464, -1, -1, -1, 468,
+ -1, -1, -1, -1, 473, 1285, -1, 476, 3, 4,
+ 5, 6, -1, -1, -1, -1, 1296, 1297, 1298, -1,
+ -1, -1, -1, 492, -1, -1, -1, 3, 4, 5,
+ 6, 7, 8, 9, -1, 1315, -1, -1, 14, -1,
+ -1, -1, -1, -1, -1, -1, 41, -1, -1, -1,
+ -1, -1, 28, 522, 30, 31, 525, -1, -1, 54,
+ 36, 56, 57, -1, -1, 41, -1, 62, -1, 45,
+ -1, 540, 541, 542, -1, 70, -1, -1, 54, -1,
+ 56, 57, -1, -1, 60, 80, 555, -1, -1, -1,
+ -1, -1, 4, 88, 70, -1, -1, -1, 93, -1,
+ -1, -1, -1, -1, 80, -1, 1408, -1, -1, -1,
+ -1, -1, 88, -1, -1, -1, -1, 93, 30, 31,
+ -1, 33, -1, 35, -1, -1, -1, -1, 1408, -1,
+ 42, -1, -1, -1, 603, 3, 4, 5, 6, -1,
+ -1, -1, -1, 55, -1, 57, -1, 616, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, -1, -1, -1,
- 1132, 1133, 1134, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 1, -1, 3,
- 4, 5, 6, 7, 8, 9, -1, 875, 876, 877,
- 14, 1163, -1, -1, 220, 221, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 29, -1, 31, 32, 33,
- -1, -1, -1, 37, 240, -1, -1, -1, 42, 907,
- 908, 909, 46, 47, -1, 49, 914, -1, -1, -1,
- -1, 55, -1, 57, 58, -1, -1, 61, -1, 63,
- -1, -1, -1, -1, -1, 1217, 1218, 71, 1220, -1,
- -1, -1, -1, 279, -1, -1, -1, 81, -1, -1,
- -1, 949, -1, -1, -1, 89, -1, -1, -1, 1,
- 94, -1, 4, 5, -1, -1, 8, 9, -1, 1251,
- -1, 1253, 14, -1, -1, -1, -1, -1, -1, -1,
- -1, 979, -1, -1, -1, -1, -1, 29, -1, 31,
- 326, -1, 328, 329, -1, 37, -1, 39, 40, -1,
- -1, -1, 1000, -1, 46, -1, 48, -1, -1, -1,
- -1, -1, -1, 55, -1, 57, 58, -1, 60, 355,
- -1, -1, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 379, -1, 87, 88, 89, -1, -1,
- 92, -1, -1, 95, -1, -1, -1, -1, -1, 395,
- -1, -1, -1, 399, -1, -1, 402, -1, -1, -1,
- 112, 407, -1, -1, -1, -1, 1358, -1, -1, -1,
- -1, -1, -1, -1, 1082, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
- 84, 85, -1, -1, 1102, 1103, 1104, 1105, 1106, -1,
- 1108, -1, 1110, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, -1, -1,
- -1, 467, -1, 469, 1132, 1133, 1134, -1, -1, 1421,
- 1422, 1423, -1, -1, -1, -1, -1, -1, 3, 4,
- 5, 6, 7, 8, 9, -1, -1, 12, 494, 14,
- -1, -1, 1444, -1, -1, 1163, -1, -1, -1, -1,
- -1, -1, -1, -1, 29, -1, 31, 32, -1, -1,
- -1, -1, 37, -1, -1, -1, -1, 42, -1, -1,
- -1, 46, -1, -1, -1, -1, -1, -1, -1, -1,
- 55, -1, 57, 58, 1, -1, 3, 4, 5, 6,
- 7, 8, 9, -1, -1, 12, 71, 14, -1, 1217,
- 1218, -1, 1220, -1, -1, -1, 81, -1, 25, -1,
- 27, 28, 568, -1, 89, 32, -1, -1, -1, 94,
- 37, -1, -1, 579, 580, 42, 582, 583, -1, 46,
- -1, 48, -1, 1251, -1, 1253, -1, -1, 55, -1,
- 57, 58, 59, 60, 61, -1, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, -1,
- 87, 88, 89, -1, 91, 92, 93, 94, 95, 96,
- -1, 98, 99, -1, -1, 641, -1, 104, -1, -1,
- -1, -1, 109, 110, 111, -1, 113, 653, -1, -1,
- 1, -1, 3, 4, 5, 6, 7, 8, 9, -1,
- 4, 5, -1, 14, 8, 9, 672, -1, -1, -1,
- 14, -1, -1, -1, -1, -1, 27, 28, 29, -1,
- 31, 32, 33, -1, -1, 29, 37, 31, -1, -1,
- 1358, 42, -1, 37, 45, 46, 47, -1, 49, -1,
- -1, -1, 46, -1, 55, -1, 57, 58, -1, -1,
- 61, 55, -1, 57, 58, -1, -1, -1, -1, -1,
- 71, -1, -1, -1, -1, 731, -1, -1, 734, -1,
- 81, -1, -1, -1, -1, -1, -1, -1, 89, -1,
- -1, -1, -1, 94, -1, -1, -1, -1, -1, 100,
- -1, -1, -1, 1421, 1422, 1423, -1, -1, -1, -1,
- -1, 767, 768, 769, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 779, -1, 1, 1444, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
- -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, 59, -1, 61, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, 852, -1, 854, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, 865,
- -1, 87, 88, 89, -1, -1, -1, -1, 94, -1,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 111, 112, 1, -1, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, -1, 13,
- 14, 15, -1, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, -1, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, 59, -1, 61, 62, -1,
- -1, -1, -1, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, 974, -1,
- -1, -1, -1, 87, 88, 89, -1, -1, -1, -1,
- 94, 1, 96, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 1001, -1, -1, 112, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, 32, 33, -1, 35, 36, 37, -1, 39,
- 40, 41, 42, 43, 44, -1, 46, -1, 48, -1,
- 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
- -1, -1, 62, -1, -1, -1, -1, -1, 68, 1055,
- 1056, 71, 1058, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, -1, -1, -1, -1, -1, 87, 88, 89,
- -1, 91, -1, -1, 94, 95, -1, 1, 98, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, -1, 112, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, 32, 33,
- 1116, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, 48, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, 59, -1, -1, 62, -1,
- -1, -1, 1148, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, -1, -1,
- 1166, -1, 1168, 87, 88, 89, -1, 91, -1, -1,
- 94, 95, -1, 1, 98, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, -1, 112, -1,
+ 79, 80, 81, 82, 83, 84, 635, -1, -1, -1,
+ -1, -1, -1, 41, -1, -1, 1478, 1479, 1480, -1,
+ -1, -1, -1, -1, -1, -1, 54, -1, 56, 57,
+ 659, -1, -1, -1, 62, -1, -1, 666, 1478, 1479,
+ 1480, -1, 70, -1, -1, 674, 675, 676, 677, -1,
+ -1, -1, 80, -1, -1, -1, -1, 1497, 55, -1,
+ 88, -1, 1502, -1, 136, 93, -1, -1, 140, -1,
+ -1, -1, 144, -1, -1, 147, 148, 149, -1, -1,
+ 4, 5, -1, 80, 8, 9, 83, -1, -1, 161,
+ 14, 720, -1, 165, -1, 724, -1, -1, -1, 171,
+ 172, -1, 731, 732, 28, 734, 30, 104, -1, 106,
+ -1, -1, 36, -1, -1, -1, -1, 189, 190, 191,
+ -1, 45, -1, -1, -1, -1, -1, -1, -1, -1,
+ 54, -1, 56, 57, 58, -1, 765, -1, 767, 33,
+ -1, -1, -1, 772, 773, 774, 218, 3, 4, 5,
+ 6, 780, -1, 3, 4, 5, 6, 7, 8, 9,
+ -1, 55, 12, -1, 14, -1, -1, -1, -1, 93,
+ -1, -1, -1, 802, 171, -1, -1, -1, 28, -1,
+ 30, 31, -1, 255, -1, 41, 36, -1, -1, -1,
+ -1, 41, 189, 190, 191, 45, -1, 47, 54, -1,
+ 56, 57, 199, -1, 54, -1, 56, 57, -1, -1,
+ -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
+ 70, 218, -1, -1, 80, -1, -1, -1, -1, -1,
+ 80, -1, 88, -1, -1, -1, -1, 93, 88, -1,
+ 90, -1, -1, 93, 94, -1, -1, 244, 3, 4,
+ 5, 6, -1, 147, 148, 149, -1, -1, -1, -1,
+ -1, 258, -1, -1, -1, -1, -1, -1, -1, 898,
+ 899, 900, -1, -1, -1, 904, -1, 171, -1, 351,
+ -1, -1, -1, 355, -1, -1, 41, -1, -1, -1,
+ -1, -1, -1, -1, -1, 189, 190, 191, -1, 54,
+ -1, 56, 57, -1, -1, 60, -1, -1, -1, -1,
+ -1, -1, 941, 942, 943, 70, -1, -1, -1, 948,
+ -1, -1, -1, -1, 218, 80, -1, -1, 400, -1,
+ -1, -1, -1, 88, -1, -1, -1, -1, 93, -1,
+ -1, -1, 414, -1, -1, 417, -1, -1, -1, -1,
+ 422, -1, -1, 350, 351, -1, 985, -1, 430, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 3, 4, 5, 6, -1, -1, -1, 107,
+ 108, -1, -1, -1, -1, 1014, 458, -1, 460, -1,
+ 462, 463, 464, -1, -1, -1, 468, -1, -1, -1,
+ 294, 473, -1, 400, 476, -1, 1035, -1, -1, -1,
+ 41, -1, -1, -1, -1, -1, -1, -1, -1, 1048,
+ 492, -1, -1, 54, -1, 56, 57, -1, -1, -1,
+ -1, 3, 4, 5, 6, 7, 8, 9, -1, 70,
+ -1, -1, 14, 3, 4, 5, 6, -1, -1, 80,
+ 344, 345, 346, -1, -1, -1, 28, 88, 30, 31,
+ -1, 458, 93, 460, 36, 462, 463, 464, -1, 41,
+ -1, 468, -1, 45, -1, 47, 473, -1, -1, 476,
+ -1, 41, 54, -1, 56, 57, -1, -1, -1, -1,
+ 1119, -1, -1, -1, 54, -1, 56, 57, 70, 4,
+ 5, -1, 7, 8, 9, -1, 400, 12, 80, 14,
+ 70, 1140, 1141, 1142, 1143, 1144, 88, 1146, 90, 1148,
+ 80, 93, 94, 28, -1, 30, 31, -1, 88, -1,
+ -1, 36, 604, 93, -1, -1, -1, -1, -1, -1,
+ 45, -1, 1171, 1172, 1173, -1, -1, -1, -1, 54,
+ -1, 56, 57, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 635, 458, -1, 460, -1, 462, 463,
+ 464, -1, -1, 1202, 468, -1, -1, -1, 1207, 473,
+ -1, -1, 476, -1, -1, -1, 1, -1, 3, 4,
+ 5, 6, 7, 8, 9, -1, -1, 325, -1, 14,
+ -1, 82, 674, 675, 676, 677, -1, -1, -1, -1,
+ -1, -1, -1, 28, -1, 30, 31, 32, -1, -1,
+ -1, 36, 619, 620, -1, -1, 41, -1, 1257, 1258,
+ 45, 1260, -1, 48, -1, -1, -1, -1, 635, 54,
+ -1, 56, 57, -1, -1, -1, -1, -1, 720, -1,
+ -1, -1, 724, -1, -1, 70, -1, -1, -1, 731,
+ 732, -1, 734, -1, -1, 80, -1, 1296, 1297, 1298,
+ 398, -1, -1, 88, 155, -1, -1, 674, 93, 676,
+ 677, -1, -1, 98, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 765, -1, 767, -1, -1, 592, -1,
+ 772, 773, 774, -1, -1, -1, 187, -1, 780, -1,
+ -1, -1, 606, 607, -1, 609, -1, -1, -1, 200,
+ 4, 5, 616, 720, 8, 9, -1, -1, 456, -1,
+ 14, -1, -1, -1, 731, 732, -1, 734, -1, -1,
+ -1, 635, -1, -1, 28, -1, 30, -1, -1, -1,
+ -1, -1, 36, -1, -1, -1, -1, -1, -1, -1,
+ -1, 45, 759, -1, -1, -1, -1, -1, -1, -1,
+ 54, -1, 56, 57, -1, 772, -1, -1, -1, 1408,
+ 674, -1, 676, 677, -1, 679, -1, -1, -1, -1,
+ -1, -1, -1, -1, 522, -1, -1, 525, -1, -1,
+ -1, 529, 530, 531, 532, 533, -1, -1, -1, 93,
+ -1, -1, -1, -1, 542, 4, 5, -1, 7, 8,
+ 9, -1, -1, -1, -1, 14, 720, 555, -1, -1,
+ -1, -1, -1, 905, -1, -1, -1, 731, 732, 28,
+ 734, 30, 31, -1, -1, -1, -1, 36, -1, 1478,
+ 1479, 1480, -1, -1, -1, -1, 45, -1, -1, 48,
+ -1, -1, -1, -1, -1, 54, -1, 56, 57, 941,
+ 942, 943, -1, 1502, -1, -1, -1, -1, 772, -1,
+ -1, 609, -1, -1, -1, -1, -1, -1, 616, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, 32, 33, -1, 35, 36, 37,
- -1, 39, 40, 41, 42, 43, 44, -1, 46, -1,
- -1, -1, 50, 51, 52, 53, 54, 55, -1, 57,
- 58, -1, -1, -1, 62, -1, -1, -1, -1, -1,
- 68, -1, -1, 71, -1, -1, -1, -1, -1, -1,
- -1, 79, 80, 81, -1, -1, -1, -1, -1, 87,
- 88, 89, -1, -1, -1, -1, 94, -1, -1, -1,
- 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 110, 1, 112, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, -1, 13, 14, -1, -1, -1,
+ -1, -1, 796, 797, 798, -1, -1, 904, 905, 906,
+ -1, -1, -1, 985, 808, -1, -1, -1, -1, -1,
+ -1, -1, 4, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
+ -1, -1, 1014, -1, 941, 942, 943, -1, 30, 31,
+ -1, 948, -1, 35, -1, -1, -1, 344, 345, 346,
+ 42, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 57, 1048, -1, -1, -1,
+ -1, -1, -1, -1, -1, 466, -1, 881, 985, 883,
+ 471, -1, -1, -1, -1, -1, 724, -1, -1, -1,
+ 894, -1, -1, -1, 898, 899, 900, -1, -1, -1,
+ -1, -1, -1, -1, -1, 496, -1, 1014, -1, -1,
+ -1, 502, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 514, 515, -1, 517, -1, 1035, -1,
+ -1, -1, -1, -1, -1, -1, -1, 941, 942, 943,
+ -1, -1, -1, -1, 136, 783, -1, -1, 140, -1,
+ -1, 789, 144, -1, -1, -1, -1, -1, 1140, 1141,
+ 1142, 1143, 1144, -1, -1, -1, 1148, -1, -1, 161,
+ -1, -1, -1, 165, -1, -1, -1, -1, -1, -1,
+ 172, 985, -1, -1, -1, -1, -1, -1, -1, 1171,
+ 1172, 1173, -1, -1, -1, -1, -1, 189, 190, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, 32, 33, -1, 35, 36, 37,
- -1, 39, 40, 41, 42, 43, 44, -1, 46, -1,
- -1, -1, 50, 51, 52, 53, 54, 55, -1, 57,
- 58, 59, -1, 61, 62, -1, -1, -1, -1, -1,
- 68, -1, -1, 71, -1, -1, -1, -1, -1, -1,
- -1, 79, 80, 81, -1, -1, -1, -1, -1, 87,
- 88, 89, -1, -1, -1, 1, 94, 3, 4, 5,
- 6, -1, 8, 9, 10, 11, -1, 13, 14, -1,
- -1, -1, -1, -1, 112, -1, -1, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, -1, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, 59, -1, -1, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, -1, -1, -1, -1, 94, 95,
- 1, -1, 3, 4, 5, 6, -1, 8, 9, 10,
- 11, -1, 13, 14, -1, 111, 112, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 29, 30,
- 31, -1, 33, -1, 35, 36, 37, -1, 39, 40,
- 41, 42, 43, 44, -1, 46, -1, -1, -1, 50,
- 51, 52, 53, 54, 55, -1, 57, 58, 59, -1,
- -1, 62, -1, -1, -1, -1, -1, 68, -1, -1,
- 71, -1, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, -1, -1, -1, -1, -1, 87, 88, 89, -1,
- -1, -1, -1, 94, 95, 1, -1, 3, 4, 5,
- 6, -1, 8, 9, 10, 11, -1, 13, 14, -1,
- -1, 112, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, -1, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, 59, -1, -1, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, -1, -1, -1, 1, 94, 3,
- 4, 5, 6, -1, 8, 9, 10, 11, -1, 13,
- 14, -1, -1, -1, -1, 111, 112, -1, -1, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, -1, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, 59, -1, -1, 62, -1,
- -1, -1, -1, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, -1, -1,
- -1, -1, -1, 87, 88, 89, -1, -1, -1, 1,
- 94, 3, 4, 5, 6, -1, 8, 9, 10, 11,
- -1, 13, 14, -1, -1, -1, -1, 111, 112, -1,
- -1, -1, -1, -1, -1, -1, -1, 29, 30, 31,
- -1, 33, -1, 35, 36, 37, -1, 39, 40, 41,
- 42, 43, 44, -1, 46, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, -1, 57, 58, 59, -1, -1,
- 62, -1, -1, -1, -1, -1, 68, -1, -1, 71,
- -1, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- -1, -1, -1, -1, -1, 87, 88, 89, -1, -1,
- -1, -1, 94, -1, -1, 1, -1, 3, 4, 5,
- 6, 103, 8, 9, 10, 11, -1, 13, 14, -1,
- 112, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, -1, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, 59, -1, -1, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, -1, -1, -1, 1, 94, 3,
+ 1014, -1, 1119, -1, -1, -1, -1, -1, -1, 857,
+ 1202, 612, 613, -1, -1, 1207, 617, -1, -1, -1,
+ -1, -1, -1, 1140, 1141, 1142, 1143, 1144, -1, 1146,
+ -1, 1148, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 890, -1, -1, -1, -1, -1, 896, -1,
+ -1, -1, 900, 255, 1171, 1172, 1173, -1, -1, -1,
+ -1, -1, -1, -1, -1, 1257, 1258, -1, 1260, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 1092, 1093,
+ -1, 1095, -1, -1, -1, 1202, -1, -1, -1, 937,
+ -1, 939, -1, -1, -1, 943, -1, -1, -1, 606,
+ 607, -1, 609, -1, 1296, 1297, 1298, -1, -1, 616,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 1140, 1141, 1142, 1143,
+ 1144, -1, -1, -1, 1148, -1, -1, 985, -1, -1,
+ 1257, 1258, -1, 1260, -1, -1, -1, -1, -1, -1,
+ 998, -1, -1, 355, -1, -1, 1004, 1171, 1172, 1173,
+ -1, -1, -1, 1011, -1, -1, -1, 674, -1, 676,
+ 677, -1, 679, -1, -1, 1023, -1, -1, -1, 1296,
+ -1, 1298, -1, 14, -1, -1, -1, -1, 1202, 790,
+ -1, 792, 23, 24, -1, -1, -1, -1, -1, 30,
+ 31, -1, 33, -1, -1, -1, -1, -1, -1, 1057,
+ -1, 1059, 414, 720, -1, 417, 1408, -1, -1, -1,
+ 422, -1, -1, -1, -1, -1, -1, -1, 430, -1,
+ -1, -1, -1, -1, 65, -1, -1, -1, -1, 1087,
+ -1, -1, -1, 1257, 1258, -1, 1260, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 458, -1, 460, -1,
+ -1, -1, -1, 864, 865, -1, 867, -1, -1, -1,
+ -1, 473, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 1296, -1, 1298, -1, 1478, 1479, 1480, -1,
+ 492, 1408, -1, 124, 895, 126, 1144, -1, -1, -1,
+ -1, 808, 133, 134, -1, -1, -1, -1, -1, 140,
+ 1502, 142, 143, 144, -1, 146, 147, 148, 149, 4,
+ 5, -1, 7, 8, 9, 1173, -1, 12, -1, 14,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 945, 30, 31, -1, -1, -1,
+ -1, 36, -1, -1, -1, -1, -1, -1, -1, -1,
+ 45, 1478, 1479, 1480, -1, -1, -1, -1, -1, 54,
+ -1, 56, 57, -1, 881, -1, 883, -1, -1, -1,
+ -1, -1, -1, -1, -1, 1502, -1, 894, -1, -1,
+ -1, 898, 899, 900, 1408, 3, 4, 5, 6, 7,
+ 8, 9, 233, 234, 12, -1, 14, -1, -1, 1010,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 28, 1022, 30, 31, 255, -1, -1, -1, 36, -1,
+ -1, -1, -1, 41, 941, 942, 943, 45, -1, -1,
+ -1, -1, -1, -1, -1, -1, 54, -1, 56, 57,
+ 4, 5, -1, 7, 8, 9, -1, -1, -1, -1,
+ 14, -1, 70, 294, 1478, 1479, 1480, 1315, -1, -1,
+ -1, -1, 80, 675, 28, -1, 30, 31, 985, -1,
+ 88, -1, 36, -1, -1, 93, -1, -1, 1502, -1,
+ -1, 45, -1, -1, -1, -1, -1, -1, -1, -1,
+ 54, -1, 56, 57, -1, -1, -1, 1108, -1, -1,
+ -1, 342, -1, 344, 345, 3, 4, 5, 6, 7,
+ 8, 9, 724, -1, -1, -1, 14, -1, -1, 731,
+ 732, -1, 734, -1, -1, -1, -1, -1, -1, -1,
+ 28, -1, 30, 31, -1, -1, 1147, -1, 36, -1,
+ -1, -1, -1, 41, -1, -1, -1, 45, 389, -1,
+ -1, -1, -1, 765, -1, 767, 54, -1, 56, 57,
+ 772, 773, 774, -1, 62, -1, 407, -1, 780, -1,
+ -1, -1, 70, 414, -1, -1, 417, -1, -1, -1,
+ -1, 422, 80, -1, -1, -1, -1, -1, -1, -1,
+ 88, -1, -1, -1, -1, 93, -1, -1, -1, 1210,
+ -1, -1, -1, 1214, -1, -1, -1, -1, -1, 3,
+ 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
+ 14, -1, 1480, 1140, 1141, 1142, 1143, 1144, -1, -1,
+ -1, 1148, -1, -1, 28, -1, 30, 31, 1249, 1497,
+ -1, -1, 36, -1, -1, -1, -1, 41, 489, -1,
+ 491, 45, -1, -1, 1171, 1172, 1173, -1, -1, -1,
+ 54, -1, 56, 57, -1, -1, 1, -1, 3, 4,
+ 5, 6, 7, 8, 9, 516, 70, -1, -1, 14,
+ -1, -1, -1, -1, -1, -1, 80, -1, -1, -1,
+ -1, -1, -1, 28, 88, 30, 31, 32, -1, 93,
+ -1, 36, 37, -1, -1, -1, 41, -1, -1, -1,
+ 45, 46, 1323, 48, -1, -1, 1327, -1, -1, 54,
+ -1, 56, 57, -1, -1, 60, 12, 62, -1, 941,
+ 942, -1, -1, -1, -1, 70, -1, -1, 1349, 1350,
+ 1257, 1258, -1, 1260, -1, 80, -1, -1, -1, -1,
+ -1, 592, -1, 88, -1, -1, -1, -1, 93, -1,
+ -1, -1, 603, 604, -1, 606, 607, -1, -1, -1,
+ -1, -1, -1, -1, 109, -1, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
+ -1, -1, 1014, -1, -1, -1, -1, -1, -1, 1,
+ -1, 3, 4, 5, 6, 7, 8, 9, 659, -1,
+ 12, -1, 14, -1, -1, 666, 667, -1, -1, -1,
+ -1, -1, -1, 25, -1, 27, 1048, 678, -1, 31,
+ -1, -1, -1, -1, 36, -1, -1, -1, -1, 41,
+ -1, -1, -1, 45, -1, 47, -1, -1, -1, -1,
+ 701, -1, 54, -1, 56, 57, 58, 59, 60, -1,
+ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 84, -1, 86, 87, 88, -1, 90, 91,
+ 92, 93, 94, 95, -1, 97, -1, -1, -1, -1,
+ 102, -1, -1, -1, -1, 107, 108, 109, 759, 111,
+ -1, 762, -1, -1, -1, -1, -1, -1, 1140, 1141,
+ -1, -1, -1, -1, -1, -1, 1148, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 796, 797, 798, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 808, -1, -1,
+ -1, -1, 1, -1, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, -1, -1, -1, -1,
+ 1202, -1, -1, -1, -1, 1207, -1, -1, -1, 28,
+ 29, 30, 31, 32, -1, 34, 35, 36, -1, 38,
+ 39, 40, 41, 42, 43, -1, 45, -1, 47, -1,
+ 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
+ -1, -1, 61, -1, -1, -1, -1, -1, 67, -1,
+ 881, 70, 883, -1, -1, 1257, 1258, -1, 1260, 78,
+ 79, 80, -1, 894, -1, -1, -1, 86, 87, 88,
+ -1, 90, -1, -1, 93, 94, -1, -1, -1, -1,
+ 1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 110, 13, 14, 15, 1297, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, -1, 34, 35, 36, -1, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, -1, -1, 49, 50,
+ 51, 52, 53, 54, -1, 56, 57, 58, -1, 60,
+ 61, -1, -1, -1, -1, -1, 67, -1, -1, 70,
+ -1, -1, -1, -1, -1, -1, -1, 78, 79, 80,
+ -1, -1, -1, -1, -1, 86, 87, 88, -1, -1,
+ -1, -1, 93, -1, 95, -1, -1, -1, 1009, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 109, 110,
+ 1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, -1, 13, 14, 15, 1036, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, -1, 34, 35, 36, -1, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, -1, -1, 49, 50,
+ 51, 52, 53, 54, -1, 56, 57, 58, -1, 60,
+ 61, -1, -1, -1, -1, -1, 67, -1, -1, 70,
+ -1, 1092, 1093, -1, 1095, -1, -1, 78, 79, 80,
+ -1, -1, -1, -1, -1, 86, 87, 88, -1, -1,
+ -1, -1, 93, -1, 95, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 110,
+ -1, -1, 1, -1, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, -1, -1, -1, -1,
+ -1, -1, -1, -1, 1155, -1, -1, -1, -1, 28,
+ 29, 30, 31, 32, -1, 34, 35, 36, -1, 38,
+ 39, 40, 41, 42, 43, -1, 45, -1, 47, -1,
+ 49, 50, 51, 52, 53, 54, 1187, 56, 57, 58,
+ -1, -1, 61, -1, -1, -1, -1, -1, 67, -1,
+ -1, 70, -1, -1, 1205, -1, 1207, -1, -1, 78,
+ 79, 80, -1, -1, -1, -1, -1, 86, 87, 88,
+ -1, 90, -1, -1, 93, 94, 1, -1, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ -1, 110, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 29, 30, 31, 32, -1, 34,
+ 35, 36, -1, 38, 39, 40, 41, 42, 43, -1,
+ 45, -1, -1, -1, 49, 50, 51, 52, 53, 54,
+ -1, 56, 57, -1, -1, -1, 61, -1, -1, -1,
+ -1, -1, 67, -1, -1, 70, -1, -1, -1, -1,
+ -1, -1, -1, 78, 79, 80, -1, -1, -1, -1,
+ -1, 86, 87, 88, -1, -1, -1, 1, 93, 3,
+ 4, 5, 6, 7, 8, 9, 10, 11, -1, 13,
+ 14, -1, -1, 108, -1, 110, -1, -1, -1, -1,
+ -1, -1, -1, -1, 28, 29, 30, 31, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, 58, -1, 60, 61, -1, -1,
+ -1, -1, -1, 67, -1, -1, 70, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, 80, -1, -1, -1,
+ -1, -1, 86, 87, 88, -1, -1, -1, 1, 93,
+ 3, 4, 5, 6, -1, 8, 9, 10, 11, -1,
+ 13, 14, -1, -1, -1, -1, 110, -1, -1, -1,
+ -1, -1, -1, -1, -1, 28, 29, 30, -1, 32,
+ -1, 34, 35, 36, -1, 38, 39, 40, 41, 42,
+ 43, -1, 45, -1, -1, -1, 49, 50, 51, 52,
+ 53, 54, -1, 56, 57, 58, -1, -1, 61, -1,
+ -1, -1, -1, -1, 67, -1, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
+ -1, -1, -1, 86, 87, 88, -1, -1, -1, -1,
+ 93, 94, 1, -1, 3, 4, 5, 6, -1, 8,
+ 9, 10, 11, -1, 13, 14, 109, 110, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 28,
+ 29, 30, -1, 32, -1, 34, 35, 36, -1, 38,
+ 39, 40, 41, 42, 43, -1, 45, -1, -1, -1,
+ 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
+ -1, -1, 61, -1, -1, -1, -1, -1, 67, -1,
+ -1, 70, -1, -1, -1, -1, -1, -1, -1, 78,
+ 79, 80, -1, -1, -1, -1, -1, 86, 87, 88,
+ -1, -1, -1, -1, 93, 94, 1, -1, 3, 4,
+ 5, 6, -1, 8, 9, 10, 11, -1, 13, 14,
+ -1, 110, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 29, 30, -1, 32, -1, 34,
+ 35, 36, -1, 38, 39, 40, 41, 42, 43, -1,
+ 45, -1, -1, -1, 49, 50, 51, 52, 53, 54,
+ -1, 56, 57, 58, -1, -1, 61, -1, -1, -1,
+ -1, -1, 67, -1, -1, 70, -1, -1, -1, -1,
+ -1, -1, -1, 78, 79, 80, -1, -1, -1, -1,
+ -1, 86, 87, 88, -1, -1, -1, 1, 93, 3,
4, 5, 6, -1, 8, 9, 10, 11, -1, 13,
- 14, -1, -1, -1, -1, -1, 112, -1, -1, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, -1, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, 59, -1, -1, 62, -1,
- -1, -1, -1, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, -1, -1,
- -1, -1, -1, 87, 88, 89, -1, -1, -1, 1,
- 94, 3, 4, 5, 6, -1, 8, 9, 10, 11,
- -1, 13, 14, -1, -1, -1, -1, -1, 112, -1,
- -1, -1, -1, -1, -1, -1, -1, 29, 30, 31,
- -1, 33, -1, 35, 36, 37, -1, 39, 40, 41,
- 42, 43, 44, -1, 46, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, -1, 57, 58, -1, -1, -1,
- 62, 63, -1, -1, -1, -1, 68, -1, -1, 71,
- -1, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- -1, -1, -1, -1, -1, 87, 88, 89, -1, -1,
- -1, 1, 94, 3, 4, 5, 6, -1, 8, 9,
- 10, 11, -1, 13, 14, -1, -1, -1, -1, -1,
- 112, -1, -1, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, -1, 33, -1, 35, 36, 37, -1, 39,
- 40, 41, 42, 43, 44, -1, 46, -1, -1, -1,
- 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
- -1, -1, 62, -1, -1, -1, -1, -1, 68, -1,
- -1, 71, -1, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, -1, -1, -1, -1, -1, 87, 88, 89,
- -1, -1, -1, 1, 94, 3, 4, 5, 6, -1,
+ 14, -1, -1, -1, 109, 110, -1, -1, -1, -1,
+ -1, -1, -1, -1, 28, 29, 30, -1, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, 58, -1, -1, 61, -1, -1,
+ -1, -1, -1, 67, -1, -1, 70, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, 80, -1, -1, -1,
+ -1, -1, 86, 87, 88, -1, -1, -1, 1, 93,
+ 3, 4, 5, 6, -1, 8, 9, 10, 11, -1,
+ 13, 14, -1, -1, -1, 109, 110, -1, -1, -1,
+ -1, -1, -1, -1, -1, 28, 29, 30, -1, 32,
+ -1, 34, 35, 36, -1, 38, 39, 40, 41, 42,
+ 43, -1, 45, -1, -1, -1, 49, 50, 51, 52,
+ 53, 54, -1, 56, 57, 58, -1, -1, 61, -1,
+ -1, -1, -1, -1, 67, -1, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
+ -1, -1, -1, 86, 87, 88, -1, -1, -1, -1,
+ 93, -1, 1, -1, 3, 4, 5, 6, 101, 8,
+ 9, 10, 11, -1, 13, 14, -1, 110, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 28,
+ 29, 30, -1, 32, -1, 34, 35, 36, -1, 38,
+ 39, 40, 41, 42, 43, -1, 45, -1, -1, -1,
+ 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
+ -1, -1, 61, -1, -1, -1, -1, -1, 67, -1,
+ -1, 70, -1, -1, -1, -1, -1, -1, -1, 78,
+ 79, 80, -1, -1, -1, -1, -1, 86, 87, 88,
+ -1, -1, -1, 1, 93, 3, 4, 5, 6, -1,
8, 9, 10, 11, -1, 13, 14, -1, -1, -1,
- -1, -1, 112, -1, -1, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, -1, 33, -1, 35, 36, 37,
- -1, 39, 40, 41, 42, 43, 44, -1, 46, -1,
- -1, -1, 50, 51, 52, 53, 54, 55, -1, 57,
- 58, -1, -1, 61, 62, -1, -1, -1, -1, -1,
- 68, -1, -1, 71, -1, -1, -1, -1, -1, -1,
- -1, 79, 80, 81, -1, -1, -1, -1, -1, 87,
- 88, 89, -1, -1, -1, 1, 94, 3, 4, 5,
+ -1, 110, -1, -1, -1, -1, -1, -1, -1, -1,
+ 28, 29, 30, -1, 32, -1, 34, 35, 36, -1,
+ 38, 39, 40, 41, 42, 43, -1, 45, -1, -1,
+ -1, 49, 50, 51, 52, 53, 54, -1, 56, 57,
+ 58, -1, -1, 61, -1, -1, -1, -1, -1, 67,
+ -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
+ 88, -1, -1, -1, 1, 93, 3, 4, 5, 6,
+ -1, 8, 9, 10, 11, -1, 13, 14, -1, -1,
+ -1, -1, 110, -1, -1, -1, -1, -1, -1, -1,
+ -1, 28, 29, 30, -1, 32, -1, 34, 35, 36,
+ -1, 38, 39, 40, 41, 42, 43, -1, 45, -1,
+ -1, -1, 49, 50, 51, 52, 53, 54, -1, 56,
+ 57, -1, -1, -1, 61, 62, -1, -1, -1, -1,
+ 67, -1, -1, 70, -1, -1, -1, -1, -1, -1,
+ -1, 78, 79, 80, -1, -1, -1, -1, -1, 86,
+ 87, 88, -1, -1, -1, 1, 93, 3, 4, 5,
6, -1, 8, 9, 10, 11, -1, 13, 14, -1,
- -1, -1, -1, -1, 112, -1, -1, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, -1, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, -1, -1, -1, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, -1, -1, -1, 1, 94, 3,
+ -1, -1, -1, 110, -1, -1, -1, -1, -1, -1,
+ -1, -1, 28, 29, 30, -1, 32, -1, 34, 35,
+ 36, -1, 38, 39, 40, 41, 42, 43, -1, 45,
+ -1, -1, -1, 49, 50, 51, 52, 53, 54, -1,
+ 56, 57, 58, -1, -1, 61, -1, -1, -1, -1,
+ -1, 67, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, 78, 79, 80, -1, -1, -1, -1, -1,
+ 86, 87, 88, -1, -1, -1, 1, 93, 3, 4,
+ 5, 6, -1, 8, 9, 10, 11, -1, 13, 14,
+ -1, -1, -1, -1, 110, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 29, 30, -1, 32, -1, 34,
+ 35, 36, -1, 38, 39, 40, 41, 42, 43, -1,
+ 45, -1, -1, -1, 49, 50, 51, 52, 53, 54,
+ -1, 56, 57, -1, -1, 60, 61, -1, -1, -1,
+ -1, -1, 67, -1, -1, 70, -1, -1, -1, -1,
+ -1, -1, -1, 78, 79, 80, -1, -1, -1, -1,
+ -1, 86, 87, 88, -1, -1, -1, 1, 93, 3,
4, 5, 6, -1, 8, 9, 10, 11, -1, 13,
- 14, -1, -1, -1, 110, -1, 112, -1, -1, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, -1, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, -1, -1, -1, 62, -1,
- -1, -1, -1, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, -1, -1,
- -1, -1, -1, 87, 88, 89, -1, -1, -1, 1,
- 94, 3, 4, 5, 6, -1, 8, 9, 10, 11,
- -1, 13, 14, -1, -1, -1, -1, -1, 112, -1,
- -1, -1, -1, -1, -1, -1, -1, 29, 30, 31,
- -1, 33, -1, 35, 36, 37, -1, 39, 40, 41,
- 42, 43, 44, -1, 46, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, -1, 57, 58, -1, -1, -1,
- 62, -1, -1, -1, -1, -1, 68, -1, -1, 71,
- -1, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- -1, -1, -1, -1, -1, 87, 88, 89, -1, -1,
- -1, 1, 94, 3, 4, 5, 6, -1, 8, 9,
- 10, 11, -1, 13, 14, -1, -1, -1, -1, -1,
- 112, -1, -1, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, -1, 33, -1, 35, 36, 37, -1, 39,
- 40, 41, 42, 43, 44, -1, 46, -1, -1, -1,
- 50, 51, 52, 53, 54, 55, -1, 57, 58, -1,
- -1, -1, 62, -1, -1, -1, -1, -1, 68, -1,
- -1, 71, -1, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, -1, -1, -1, -1, -1, 87, 88, 89,
- 3, 4, 5, 6, 94, 8, 9, 10, 11, -1,
- 13, 14, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 112, -1, -1, -1, 29, 30, 31, -1,
- 33, -1, 35, 36, 37, -1, 39, 40, 41, 42,
- 43, 44, -1, 46, -1, -1, -1, 50, 51, 52,
- 53, 54, 55, -1, 57, 58, -1, -1, -1, 62,
- -1, -1, -1, -1, -1, 68, -1, -1, 71, -1,
- -1, -1, -1, -1, -1, -1, 79, 80, 81, -1,
- -1, -1, -1, -1, 87, 88, 89, -1, -1, -1,
- -1, 94, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
- 113, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- -1, 13, 14, 15, -1, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, -1, 35, 36, 37, -1, 39, 40, 41,
- 42, 43, 44, -1, 46, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, -1, 57, 58, 59, -1, 61,
- 62, -1, -1, -1, -1, -1, 68, -1, -1, 71,
- -1, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- -1, -1, -1, -1, -1, 87, 88, 89, -1, -1,
- -1, -1, 94, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
- 112, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- -1, 13, 14, 15, -1, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, -1, 35, 36, 37, -1, 39, 40, 41,
- 42, 43, 44, -1, 46, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, -1, 57, 58, 59, -1, 61,
- 62, -1, -1, -1, -1, -1, 68, -1, -1, 71,
- -1, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- -1, -1, -1, -1, -1, 87, 88, 89, -1, -1,
- -1, -1, 94, -1, 96, -1, -1, 3, 4, 5,
+ 14, -1, -1, -1, -1, 110, -1, -1, -1, -1,
+ -1, -1, -1, -1, 28, 29, 30, -1, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, -1, -1, -1, 61, -1, -1,
+ -1, -1, -1, 67, 1, -1, 70, 4, 5, -1,
+ -1, 8, 9, -1, 78, 79, 80, 14, -1, -1,
+ -1, -1, 86, 87, 88, -1, -1, -1, -1, 93,
+ -1, 28, -1, 30, -1, -1, -1, -1, -1, 36,
+ -1, 38, 39, -1, 108, -1, 110, -1, 45, -1,
+ 47, -1, -1, -1, -1, -1, -1, 54, -1, 56,
+ 57, -1, 59, -1, -1, -1, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, -1, -1, 86,
+ 87, 88, -1, -1, 91, -1, 1, 94, 3, 4,
+ 5, 6, -1, 8, 9, 10, 11, -1, 13, 14,
+ -1, -1, -1, 110, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 29, 30, -1, 32, -1, 34,
+ 35, 36, -1, 38, 39, 40, 41, 42, 43, -1,
+ 45, -1, -1, -1, 49, 50, 51, 52, 53, 54,
+ -1, 56, 57, -1, -1, -1, 61, -1, -1, -1,
+ -1, -1, 67, -1, -1, 70, -1, -1, -1, -1,
+ -1, -1, -1, 78, 79, 80, -1, -1, -1, -1,
+ -1, 86, 87, 88, -1, -1, -1, 1, 93, 3,
+ 4, 5, 6, -1, 8, 9, 10, 11, -1, 13,
+ 14, -1, -1, -1, -1, 110, -1, -1, -1, -1,
+ -1, -1, -1, -1, 28, 29, 30, -1, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, -1, -1, -1, 61, -1, -1,
+ -1, -1, -1, 67, -1, -1, 70, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, 80, -1, -1, -1,
+ -1, -1, 86, 87, 88, -1, -1, -1, 1, 93,
+ 3, 4, 5, 6, -1, 8, 9, 10, 11, -1,
+ 13, 14, -1, -1, -1, -1, 110, -1, -1, -1,
+ -1, -1, -1, -1, -1, 28, 29, 30, -1, 32,
+ -1, 34, 35, 36, -1, 38, 39, 40, 41, 42,
+ 43, -1, 45, -1, -1, -1, 49, 50, 51, 52,
+ 53, 54, -1, 56, 57, -1, -1, -1, 61, -1,
+ -1, -1, -1, -1, 67, -1, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
+ -1, -1, -1, 86, 87, 88, 3, 4, 5, 6,
+ 93, 8, 9, 10, 11, -1, 13, 14, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 110, -1, -1,
+ -1, 28, 29, 30, -1, 32, -1, 34, 35, 36,
+ -1, 38, 39, 40, 41, 42, 43, -1, 45, -1,
+ -1, -1, 49, 50, 51, 52, 53, 54, -1, 56,
+ 57, -1, -1, -1, 61, -1, -1, -1, -1, -1,
+ 67, -1, 1, 70, 3, 4, 5, 6, 7, 8,
+ 9, 78, 79, 80, -1, 14, -1, -1, -1, 86,
+ 87, 88, -1, -1, -1, -1, 93, -1, -1, 28,
+ -1, 30, 31, 32, -1, -1, -1, 36, 37, -1,
+ -1, -1, 41, 110, 111, -1, 45, 46, -1, 48,
+ -1, -1, -1, -1, -1, 54, -1, 56, 57, -1,
+ -1, 60, -1, 62, -1, -1, -1, -1, -1, -1,
+ -1, 70, 1, -1, 3, 4, 5, 6, 7, 8,
+ 9, 80, -1, -1, -1, 14, -1, -1, -1, 88,
+ -1, -1, -1, -1, 93, -1, -1, -1, -1, 28,
+ -1, 30, 31, 32, -1, -1, -1, 36, 37, -1,
+ 109, -1, 41, -1, -1, -1, 45, 46, -1, 48,
+ -1, -1, -1, -1, -1, 54, -1, 56, 57, -1,
+ -1, 60, -1, 62, -1, -1, -1, -1, -1, -1,
+ -1, 70, 1, -1, 3, 4, 5, 6, 7, 8,
+ 9, 80, -1, -1, -1, 14, -1, -1, -1, 88,
+ -1, -1, -1, -1, 93, -1, -1, -1, -1, 28,
+ -1, 30, 31, 32, -1, -1, -1, 36, 37, -1,
+ 109, -1, 41, -1, -1, -1, 45, 46, -1, 48,
+ -1, -1, -1, -1, -1, 54, -1, 56, 57, -1,
+ -1, 60, -1, 62, -1, -1, -1, -1, -1, -1,
+ -1, 70, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 80, -1, -1, -1, -1, -1, -1, -1, 88,
+ -1, -1, -1, -1, 93, -1, -1, 3, 4, 5,
6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
- 112, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, 59, -1, 61, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, -1, -1, -1, -1, 94, -1,
- 96, -1, -1, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, -1, 13, 14, 15, 112, 17, 18, 19,
+ 109, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, -1, 34, 35,
+ 36, -1, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, -1, -1, 49, 50, 51, 52, 53, 54, -1,
+ 56, 57, 58, -1, 60, 61, -1, -1, -1, -1,
+ -1, 67, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, 78, 79, 80, -1, -1, -1, -1, -1,
+ 86, 87, 88, -1, -1, -1, -1, 93, -1, 95,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 109, 110, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, -1, 13, 14, 15, -1, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, -1, 34, 35, 36, -1,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, -1,
+ -1, 49, 50, 51, 52, 53, 54, -1, 56, 57,
+ 58, -1, 60, 61, -1, -1, -1, -1, -1, 67,
+ -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
+ 88, -1, -1, -1, -1, 93, -1, 95, -1, 3,
+ 4, 5, 6, 7, 8, 9, 10, 11, -1, 13,
+ 14, 15, 110, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, 58, -1, 60, 61, -1, -1,
+ -1, -1, -1, 67, -1, -1, 70, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, 80, -1, -1, -1,
+ -1, -1, 86, 87, 88, -1, -1, -1, -1, 93,
+ -1, 95, -1, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, -1, 13, 14, 15, 110, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, -1, 35, 36, 37, -1, 39,
- 40, 41, 42, 43, 44, -1, 46, -1, -1, -1,
- 50, 51, 52, 53, 54, 55, -1, 57, 58, -1,
- -1, 61, 62, -1, -1, -1, -1, -1, 68, -1,
- -1, 71, -1, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, -1, -1, -1, -1, -1, 87, 88, 89,
- -1, -1, -1, -1, 94, -1, 96, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, -1,
- -1, -1, 112, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, 32, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, 48, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, -1, -1, -1, 62, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, -1, 91, -1, -1, 94, 95,
- -1, -1, 98, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, -1, 112, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, 32, 33, -1, 35, 36, 37, -1, 39,
- 40, 41, 42, 43, 44, -1, 46, -1, 48, -1,
- 50, 51, 52, 53, 54, 55, -1, 57, 58, -1,
- -1, -1, 62, -1, -1, -1, -1, -1, 68, -1,
- -1, 71, -1, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, -1, -1, -1, -1, -1, 87, 88, 89,
- -1, 91, -1, -1, 94, 95, -1, -1, 98, 3,
- 4, 5, 6, -1, 8, 9, 10, 11, -1, 13,
- 14, -1, 112, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, 48, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, -1, -1,
- -1, -1, -1, 87, 88, 89, -1, 91, -1, -1,
- 94, 95, 3, 4, 5, 6, -1, 8, 9, 10,
- 11, -1, 13, 14, -1, -1, -1, -1, 112, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 29, 30,
- 31, -1, 33, -1, 35, 36, 37, -1, 39, 40,
- 41, 42, 43, 44, -1, 46, -1, 48, -1, 50,
- 51, 52, 53, 54, 55, -1, 57, 58, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 68, -1, -1,
- 71, -1, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, -1, -1, -1, -1, -1, 87, 88, 89, -1,
- 91, -1, -1, 94, 95, 3, 4, 5, 6, -1,
+ 30, 31, 32, -1, 34, 35, 36, -1, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, -1, -1, 49,
+ 50, 51, 52, 53, 54, -1, 56, 57, -1, -1,
+ 60, 61, -1, -1, -1, -1, -1, 67, -1, -1,
+ 70, -1, -1, -1, -1, -1, -1, -1, 78, 79,
+ 80, -1, -1, -1, -1, -1, 86, 87, 88, -1,
+ -1, -1, -1, 93, -1, 95, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, -1, -1,
+ 110, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 28, 29, 30, 31, 32, -1, 34, 35, 36,
+ -1, 38, 39, 40, 41, 42, 43, -1, 45, -1,
+ 47, -1, 49, 50, 51, 52, 53, 54, -1, 56,
+ 57, -1, -1, -1, 61, -1, -1, -1, -1, -1,
+ 67, -1, -1, 70, -1, -1, -1, -1, -1, -1,
+ -1, 78, 79, 80, -1, -1, -1, -1, -1, 86,
+ 87, 88, -1, 90, -1, -1, 93, 94, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ -1, -1, -1, 110, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 29, 30, 31, 32, -1, 34,
+ 35, 36, -1, 38, 39, 40, 41, 42, 43, -1,
+ 45, -1, 47, -1, 49, 50, 51, 52, 53, 54,
+ -1, 56, 57, -1, -1, -1, 61, -1, -1, -1,
+ -1, -1, 67, -1, -1, 70, -1, -1, -1, -1,
+ -1, -1, -1, 78, 79, 80, -1, -1, -1, -1,
+ -1, 86, 87, 88, -1, 90, -1, -1, 93, 94,
+ 3, 4, 5, 6, -1, 8, 9, 10, 11, -1,
+ 13, 14, -1, -1, -1, 110, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 28, 29, 30, -1, 32,
+ -1, 34, 35, 36, -1, 38, 39, 40, 41, 42,
+ 43, -1, 45, -1, 47, -1, 49, 50, 51, 52,
+ 53, 54, -1, 56, 57, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 67, -1, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
+ -1, -1, -1, 86, 87, 88, -1, 90, -1, -1,
+ 93, 94, 3, 4, 5, 6, -1, 8, 9, 10,
+ 11, -1, 13, 14, -1, -1, -1, 110, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 28, 29, 30,
+ -1, 32, -1, 34, 35, 36, -1, 38, 39, 40,
+ 41, 42, 43, -1, 45, -1, 47, -1, 49, 50,
+ 51, 52, 53, 54, -1, 56, 57, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 67, -1, -1, 70,
+ -1, -1, -1, -1, -1, -1, -1, 78, 79, 80,
+ -1, -1, -1, -1, -1, 86, 87, 88, -1, 90,
+ -1, -1, 93, 94, 3, 4, 5, 6, -1, 8,
+ 9, 10, 11, -1, 13, 14, -1, -1, -1, 110,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 28,
+ 29, 30, -1, 32, -1, 34, 35, 36, -1, 38,
+ 39, 40, 41, 42, 43, -1, 45, -1, -1, -1,
+ 49, 50, 51, 52, 53, 54, -1, 56, 57, -1,
+ -1, 60, 61, -1, -1, -1, -1, -1, 67, -1,
+ -1, 70, -1, -1, -1, -1, -1, -1, -1, 78,
+ 79, 80, -1, -1, -1, -1, -1, 86, 87, 88,
+ -1, -1, -1, -1, 93, 3, 4, 5, 6, 7,
8, 9, 10, 11, -1, 13, 14, -1, -1, -1,
- -1, 112, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, -1, 33, -1, 35, 36, 37,
- -1, 39, 40, 41, 42, 43, 44, -1, 46, -1,
- -1, -1, 50, 51, 52, 53, 54, 55, -1, 57,
- 58, -1, -1, 61, 62, -1, -1, -1, -1, -1,
- 68, -1, -1, 71, -1, -1, -1, -1, -1, -1,
- -1, 79, 80, 81, -1, -1, -1, -1, -1, 87,
- 88, 89, -1, -1, -1, -1, 94, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, -1, 13, 14, -1,
- -1, -1, -1, -1, 112, -1, -1, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, 32, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 68, -1, -1, 71, -1, -1, -1, -1,
- -1, -1, -1, 79, 80, 81, -1, -1, -1, -1,
- -1, 87, 88, 89, 3, 4, 5, 6, 94, 8,
- 9, 10, 11, -1, 13, 14, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
- 29, 30, 31, -1, 33, -1, 35, 36, 37, -1,
- 39, 40, 41, 42, 43, 44, -1, 46, -1, -1,
- -1, 50, 51, 52, 53, 54, 55, -1, 57, 58,
- -1, -1, -1, 62, -1, -1, -1, -1, -1, 68,
- -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
- 79, 80, 81, -1, -1, -1, -1, -1, 87, 88,
- 89, 3, 4, 5, 6, 94, 8, 9, 10, 11,
+ -1, 110, -1, -1, -1, -1, -1, -1, -1, -1,
+ 28, 29, 30, 31, 32, -1, 34, 35, 36, -1,
+ 38, 39, 40, 41, 42, 43, -1, 45, -1, -1,
+ -1, 49, 50, 51, 52, 53, 54, -1, 56, 57,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 67,
+ -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
+ 88, 3, 4, 5, 6, 93, 8, 9, 10, 11,
-1, 13, 14, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 112, -1, -1, -1, 29, 30, 31,
- -1, 33, -1, 35, 36, 37, -1, 39, 40, 41,
- 42, 43, 44, -1, 46, -1, -1, -1, 50, 51,
- 52, 53, 54, 55, -1, 57, 58, -1, -1, -1,
- 62, -1, -1, -1, -1, -1, 68, -1, -1, 71,
- -1, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- -1, -1, -1, -1, -1, 87, 88, 89, 3, 4,
- 5, 6, 94, 8, 9, 10, 11, -1, 13, 14,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 112, -1, -1, -1, 29, 30, 31, -1, 33, -1,
- 35, 36, 37, -1, 39, 40, 41, 42, 43, 44,
- -1, 46, -1, -1, -1, 50, 51, 52, 53, 54,
- 55, -1, 57, 58, 59, -1, -1, -1, -1, -1,
- -1, -1, -1, 68, -1, -1, 71, -1, -1, -1,
- -1, -1, -1, -1, 79, 80, 81, -1, -1, -1,
- -1, -1, 87, 88, 89, 3, 4, 5, 6, 94,
- 8, 9, 10, 11, -1, 13, 14, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 112, -1, -1,
- -1, 29, 30, 31, -1, 33, -1, 35, 36, 37,
- -1, 39, 40, 41, 42, 43, 44, -1, 46, -1,
- -1, -1, 50, 51, 52, 53, 54, 55, -1, 57,
- 58, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 68, -1, -1, 71, -1, -1, -1, -1, -1, -1,
- -1, 79, 80, 81, -1, -1, -1, -1, -1, 87,
- 88, 89, -1, -1, -1, -1, 94, 95, 3, 4,
- 5, 6, -1, 8, 9, 10, 11, -1, 13, 14,
- -1, -1, -1, -1, 112, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 29, 30, 31, -1, 33, -1,
- 35, 36, 37, -1, 39, 40, 41, 42, 43, 44,
- -1, 46, -1, -1, -1, 50, 51, 52, 53, 54,
- 55, -1, 57, 58, -1, -1, -1, 62, -1, -1,
- -1, -1, -1, 68, -1, -1, 71, -1, -1, -1,
- -1, -1, -1, -1, 79, 80, 81, -1, -1, -1,
- -1, -1, 87, 88, 89, 3, 4, 5, 6, 94,
+ -1, -1, 110, -1, -1, -1, 28, 29, 30, -1,
+ 32, -1, 34, 35, 36, -1, 38, 39, 40, 41,
+ 42, 43, -1, 45, -1, -1, -1, 49, 50, 51,
+ 52, 53, 54, -1, 56, 57, -1, -1, -1, 61,
+ -1, -1, -1, -1, -1, 67, -1, -1, 70, -1,
+ -1, -1, -1, -1, -1, -1, 78, 79, 80, -1,
+ -1, -1, -1, -1, 86, 87, 88, 3, 4, 5,
+ 6, 93, 8, 9, 10, 11, -1, 13, 14, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 110, -1,
+ -1, -1, 28, 29, 30, -1, 32, -1, 34, 35,
+ 36, -1, 38, 39, 40, 41, 42, 43, -1, 45,
+ -1, -1, -1, 49, 50, 51, 52, 53, 54, -1,
+ 56, 57, -1, -1, -1, 61, -1, -1, -1, -1,
+ -1, 67, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, 78, 79, 80, -1, -1, -1, -1, -1,
+ 86, 87, 88, 3, 4, 5, 6, 93, 8, 9,
+ 10, 11, -1, 13, 14, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 110, -1, -1, -1, 28, 29,
+ 30, -1, 32, -1, 34, 35, 36, -1, 38, 39,
+ 40, 41, 42, 43, -1, 45, -1, -1, -1, 49,
+ 50, 51, 52, 53, 54, -1, 56, 57, -1, -1,
+ -1, 61, -1, -1, -1, -1, -1, 67, -1, -1,
+ 70, -1, -1, -1, -1, -1, -1, -1, 78, 79,
+ 80, -1, -1, -1, -1, -1, 86, 87, 88, 3,
+ 4, 5, 6, 93, 8, 9, 10, 11, -1, 13,
+ 14, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 110, -1, -1, -1, 28, 29, 30, -1, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, 58, -1, -1, -1, -1, -1,
+ -1, -1, -1, 67, -1, -1, 70, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, 80, -1, -1, -1,
+ -1, -1, 86, 87, 88, 3, 4, 5, 6, 93,
8, 9, 10, 11, -1, 13, 14, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 112, -1, -1,
- -1, 29, 30, 31, -1, 33, -1, 35, 36, 37,
- -1, 39, 40, 41, 42, 43, 44, -1, 46, -1,
- -1, -1, 50, 51, 52, 53, 54, 55, -1, 57,
- 58, -1, -1, -1, 62, -1, -1, -1, -1, -1,
- 68, -1, -1, 71, -1, -1, -1, -1, -1, -1,
- -1, 79, 80, 81, -1, -1, -1, -1, -1, 87,
- 88, 89, 3, 4, 5, 6, 94, 8, 9, 10,
- 11, -1, 13, 14, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 112, -1, -1, -1, 29, 30,
- 31, -1, 33, -1, 35, 36, 37, -1, 39, 40,
- 41, 42, 43, 44, -1, 46, -1, -1, -1, 50,
- 51, 52, 53, 54, 55, -1, 57, 58, -1, -1,
- -1, 62, -1, -1, -1, -1, -1, 68, -1, -1,
- 71, -1, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, -1, -1, -1, -1, -1, 87, 88, 89, 3,
- 4, 5, 6, 94, 8, 9, 10, 11, -1, 13,
+ -1, -1, -1, -1, -1, -1, 110, -1, -1, -1,
+ 28, 29, 30, -1, 32, -1, 34, 35, 36, -1,
+ 38, 39, 40, 41, 42, 43, -1, 45, -1, -1,
+ -1, 49, 50, 51, 52, 53, 54, -1, 56, 57,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 67,
+ -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
+ 88, -1, -1, -1, -1, 93, 94, 3, 4, 5,
+ 6, -1, 8, 9, 10, 11, -1, 13, 14, -1,
+ -1, -1, 110, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 28, 29, 30, -1, 32, -1, 34, 35,
+ 36, -1, 38, 39, 40, 41, 42, 43, -1, 45,
+ -1, -1, -1, 49, 50, 51, 52, 53, 54, -1,
+ 56, 57, -1, -1, -1, 61, -1, -1, -1, -1,
+ -1, 67, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, 78, 79, 80, -1, -1, -1, -1, -1,
+ 86, 87, 88, 3, 4, 5, 6, 93, 8, 9,
+ 10, 11, -1, 13, 14, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 110, -1, -1, -1, 28, 29,
+ 30, -1, 32, -1, 34, 35, 36, -1, 38, 39,
+ 40, 41, 42, 43, -1, 45, -1, -1, -1, 49,
+ 50, 51, 52, 53, 54, -1, 56, 57, -1, -1,
+ -1, 61, -1, -1, -1, -1, -1, 67, -1, -1,
+ 70, -1, -1, -1, -1, -1, -1, -1, 78, 79,
+ 80, -1, -1, -1, -1, -1, 86, 87, 88, 3,
+ 4, 5, 6, 93, 8, 9, 10, 11, -1, 13,
14, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 112, -1, -1, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
- 44, -1, 46, -1, -1, -1, 50, 51, 52, 53,
- 54, 55, -1, 57, 58, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 68, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, -1, -1,
- -1, -1, -1, 87, 88, 89, 3, 4, 5, 6,
- 94, 8, 9, 10, 11, -1, 13, 14, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 112, -1,
- -1, -1, 29, 30, 31, -1, 33, -1, 35, 36,
- 37, -1, 39, 40, 41, 42, 43, 44, -1, 46,
- -1, -1, -1, 50, 51, 52, 53, 54, 55, -1,
- 57, 58, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 68, -1, -1, 71, -1, -1, -1, -1, -1,
- -1, -1, 79, 80, 81, -1, -1, -1, -1, -1,
- 87, 88, 89, 3, 4, 5, 6, 94, 8, 9,
+ 110, -1, -1, -1, 28, 29, 30, -1, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, -1, -1, -1, 61, -1, -1,
+ -1, -1, -1, 67, -1, -1, 70, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, 80, -1, -1, -1,
+ -1, -1, 86, 87, 88, 3, 4, 5, 6, 93,
+ 8, 9, 10, 11, -1, 13, 14, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 110, -1, -1, -1,
+ 28, 29, 30, -1, 32, -1, 34, 35, 36, -1,
+ 38, 39, 40, 41, 42, 43, -1, 45, -1, -1,
+ -1, 49, 50, 51, 52, 53, 54, -1, 56, 57,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 67,
+ -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, 80, -1, -1, -1, -1, -1, 86, 87,
+ 88, 3, 4, 5, 6, 93, 8, 9, 10, 11,
+ -1, 13, 14, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 110, -1, -1, -1, 28, 29, 30, -1,
+ 32, -1, 34, 35, 36, -1, 38, 39, 40, 41,
+ 42, 43, -1, 45, -1, -1, -1, 49, 50, 51,
+ 52, 53, 54, -1, 56, 57, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 67, -1, -1, 70, -1,
+ -1, -1, -1, -1, -1, -1, 78, 79, 80, -1,
+ -1, -1, -1, -1, 86, 87, 88, 3, 4, 5,
+ 6, 93, 8, 9, 10, 11, -1, 13, 14, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 110, -1,
+ -1, -1, 28, 29, 30, -1, 32, -1, 34, 35,
+ 36, -1, 38, 39, 40, 41, 42, 43, -1, 45,
+ -1, -1, -1, 49, 50, 51, 52, 53, 54, -1,
+ 56, 57, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 67, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, 78, 79, 80, -1, -1, -1, -1, -1,
+ 86, 87, 88, 3, 4, 5, 6, 93, 8, 9,
10, 11, -1, 13, 14, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 112, -1, -1, -1, 29,
- 30, 31, -1, 33, -1, 35, 36, 37, -1, 39,
- 40, 41, 42, 43, 44, -1, 46, -1, -1, -1,
- 50, 51, 52, 53, 54, 55, -1, 57, 58, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 68, -1,
- -1, 71, -1, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, -1, -1, -1, -1, -1, 87, 88, 89,
- 3, 4, 5, 6, 94, 8, 9, 10, 11, -1,
- 13, 14, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 112, -1, -1, -1, 29, 30, 31, -1,
- 33, -1, 35, 36, 37, -1, 39, 40, 41, 42,
- 43, 44, -1, 46, -1, -1, -1, 50, 51, 52,
- 53, 54, 55, -1, 57, 58, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 68, -1, -1, 71, -1,
- -1, -1, -1, -1, -1, -1, 79, 80, 81, -1,
- -1, -1, -1, -1, 87, 88, 89, 3, 4, 5,
- 6, 94, 8, 9, 10, 11, -1, 13, 14, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
- -1, -1, -1, 29, 30, 31, -1, 33, -1, 35,
- 36, 37, -1, 39, 40, 41, 42, 43, 44, -1,
- 46, -1, -1, -1, 50, 51, 52, 53, 54, 55,
- -1, 57, 58, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 68, -1, 1, 71, 3, 4, 5, 6,
- 7, 8, 9, 79, 80, 81, -1, 14, -1, -1,
- -1, 87, 88, 89, -1, -1, -1, -1, 94, -1,
- -1, -1, 29, -1, 31, 32, -1, -1, -1, -1,
- 37, -1, -1, -1, -1, 42, 112, -1, -1, 46,
- -1, -1, 49, -1, -1, -1, -1, -1, 55, -1,
- 57, 58, -1, -1, 61, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, 71, -1, 14, -1, -1, -1,
- -1, -1, -1, -1, 81, -1, -1, -1, -1, -1,
- -1, 29, 89, 31, 32, -1, -1, 94, -1, 37,
- -1, -1, -1, -1, 42, -1, -1, -1, 46, -1,
- 48, -1, -1, -1, -1, -1, -1, 55, -1, 57,
- 58, 3, 4, 5, 6, 7, 8, 9, -1, -1,
- -1, -1, 14, 71, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 81, -1, -1, -1, 29, -1, 31,
- 32, 89, -1, 91, -1, 37, 94, 95, -1, -1,
- 42, -1, -1, -1, 46, -1, 3, 4, 5, 6,
- 7, 8, 9, 55, -1, 57, 58, 14, -1, 61,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 71,
- -1, -1, 29, -1, 31, 32, -1, -1, -1, 81,
- 37, -1, -1, -1, -1, 42, -1, 89, -1, 46,
- -1, -1, 94, -1, -1, -1, -1, -1, 55, -1,
- 57, 58, -1, -1, -1, -1, 63, 3, 4, 5,
- 6, 7, 8, 9, 71, -1, -1, -1, 14, -1,
- -1, -1, -1, -1, 81, -1, -1, -1, -1, -1,
- -1, -1, 89, 29, -1, 31, 32, 94, -1, -1,
- -1, 37, -1, -1, -1, -1, 42, -1, -1, -1,
- 46, -1, 3, 4, 5, 6, 7, 8, 9, 55,
- -1, 57, 58, 14, -1, 61, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 71, -1, -1, 29, -1,
- 31, 32, -1, -1, -1, 81, 37, -1, -1, -1,
- -1, 42, -1, 89, -1, 46, -1, -1, 94, -1,
- -1, -1, -1, -1, 55, -1, 57, 58, 3, 4,
- 5, 6, 7, 8, 9, -1, -1, -1, -1, 14,
- 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 81, -1, -1, -1, 29, -1, 31, 32, 89, -1,
- -1, -1, 37, 94, -1, -1, -1, 42, -1, -1,
- -1, 46, -1, 3, 4, 5, 6, 7, 8, 9,
- 55, -1, 57, 58, 14, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
- -1, -1, 32, -1, -1, -1, 81, 37, -1, -1,
- -1, -1, 42, -1, 89, 12, 46, -1, 48, 94,
- -1, -1, -1, -1, -1, 55, -1, 57, 58, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 71, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 81, -1, -1, -1, -1, -1, 32, -1, 89,
- -1, -1, -1, -1, 94, -1, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 64,
+ -1, -1, -1, -1, 110, -1, -1, -1, 28, 29,
+ 30, -1, 32, -1, 34, 35, 36, -1, 38, 39,
+ 40, 41, 42, 43, -1, 45, -1, -1, -1, 49,
+ 50, 51, 52, 53, 54, -1, 56, 57, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 67, -1, -1,
+ 70, -1, -1, -1, -1, -1, -1, -1, 78, 79,
+ 80, -1, -1, -1, -1, -1, 86, 87, 88, 3,
+ 4, 5, 6, 93, 8, 9, 10, 11, -1, 13,
+ 14, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 110, -1, -1, -1, 28, 29, 30, -1, 32, -1,
+ 34, 35, 36, -1, 38, 39, 40, 41, 42, 43,
+ -1, 45, -1, -1, -1, 49, 50, 51, 52, 53,
+ 54, -1, 56, 57, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 67, -1, 1, 70, 3, 4, 5,
+ 6, 7, 8, 9, 78, 79, 80, -1, 14, -1,
+ -1, -1, 86, 87, 88, -1, -1, -1, -1, 93,
+ -1, 27, 28, -1, 30, 31, 32, -1, -1, -1,
+ 36, -1, -1, -1, -1, 41, 110, -1, 44, 45,
+ 46, -1, 48, -1, -1, -1, -1, -1, 54, -1,
+ 56, 57, -1, -1, 60, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, -1, 1, 80, 3, 4, 5, 6, 7,
+ 8, 9, 88, -1, -1, -1, 14, 93, -1, -1,
+ -1, -1, 98, -1, -1, -1, -1, -1, -1, -1,
+ 28, -1, 30, 31, 32, -1, -1, -1, 36, -1,
+ -1, -1, -1, 41, -1, -1, -1, 45, 46, -1,
+ 48, -1, -1, -1, -1, -1, 54, -1, 56, 57,
+ -1, -1, 60, -1, 62, -1, -1, -1, -1, -1,
+ -1, -1, 70, 3, 4, 5, 6, 7, 8, 9,
+ -1, -1, 80, -1, 14, -1, -1, -1, -1, -1,
+ 88, -1, -1, -1, -1, 93, -1, -1, 28, -1,
+ 30, 31, -1, -1, -1, -1, 36, -1, -1, -1,
+ -1, 41, -1, -1, -1, 45, -1, -1, -1, -1,
+ -1, -1, -1, -1, 54, -1, 56, 57, -1, -1,
+ 60, -1, 3, 4, 5, 6, 7, 8, 9, -1,
+ 70, -1, -1, 14, -1, -1, -1, -1, -1, -1,
+ 80, -1, -1, -1, -1, -1, -1, 28, 88, 30,
+ 31, -1, -1, 93, -1, 36, -1, -1, -1, -1,
+ 41, -1, -1, -1, 45, -1, -1, -1, -1, -1,
+ -1, -1, -1, 54, -1, 56, 57, 3, 4, 5,
+ 6, 7, 8, 9, -1, -1, -1, -1, 14, 70,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 80,
+ -1, -1, -1, -1, -1, 31, -1, 88, -1, -1,
+ 36, -1, 93, -1, -1, 41, -1, -1, -1, 45,
+ -1, 47, -1, -1, -1, -1, -1, -1, 54, -1,
+ 56, 57, -1, -1, -1, -1, 31, -1, -1, -1,
+ -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 80, -1, -1, -1, -1, -1,
+ -1, -1, 88, -1, -1, -1, -1, 93, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
- 83, 84, 85, 64, 65, 66, 67, 68, 69, 70,
+ 83, 84, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 82, 83, 84, 85, -1, -1, -1, -1, -1,
- 113, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 60, -1, -1, 109, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85
+ 81, 82, 83, 84, -1, -1, -1, -1, 111, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 59, -1, -1, 107, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 62,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 73, 74, -1, 76, 77, 78,
+ 79, 80, 81, 82, 83, 84
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/lib/bison.simple"
@@ -3989,14 +4099,8 @@ yyreduce:
switch (yyn) {
case 2:
-#line 331 "parse.y"
-{
- /* In case there were missing closebraces,
- get us back to the global binding level. */
- while (! global_bindings_p ())
- poplevel (0, 0, 0);
- finish_file ();
- ;
+#line 337 "parse.y"
+{ finish_translation_unit (); ;
break;}
case 3:
#line 345 "parse.y"
@@ -4025,175 +4129,221 @@ case 10:
{ yyval.itype = pedantic;
pedantic = 0; ;
break;}
-case 13:
-#line 378 "parse.y"
+case 12:
+#line 377 "parse.y"
{ if (pending_lang_change) do_pending_lang_change(); ;
break;}
-case 14:
-#line 380 "parse.y"
+case 13:
+#line 379 "parse.y"
{ if (! toplevel_bindings_p () && ! pseudo_global_level_p())
pop_everything (); ;
break;}
+case 14:
+#line 385 "parse.y"
+{ if (pending_inlines) do_pending_inlines (); ;
+ break;}
case 15:
-#line 386 "parse.y"
+#line 387 "parse.y"
{ if (pending_inlines) do_pending_inlines (); ;
break;}
case 16:
-#line 388 "parse.y"
+#line 389 "parse.y"
{ if (pending_inlines) do_pending_inlines (); ;
break;}
case 17:
-#line 390 "parse.y"
-{ if (pending_inlines) do_pending_inlines (); ;
- break;}
-case 18:
-#line 392 "parse.y"
+#line 391 "parse.y"
{ if (TREE_CHAIN (yyvsp[-2].ttype)) yyvsp[-2].ttype = combine_strings (yyvsp[-2].ttype);
assemble_asm (yyvsp[-2].ttype); ;
break;}
-case 19:
-#line 395 "parse.y"
+case 18:
+#line 394 "parse.y"
{ pop_lang_context (); ;
break;}
-case 20:
-#line 397 "parse.y"
+case 19:
+#line 396 "parse.y"
{ if (pending_inlines) do_pending_inlines ();
pop_lang_context (); ;
break;}
-case 21:
-#line 400 "parse.y"
+case 20:
+#line 399 "parse.y"
{ if (pending_inlines) do_pending_inlines ();
pop_lang_context (); ;
break;}
-case 22:
-#line 403 "parse.y"
+case 21:
+#line 402 "parse.y"
{ push_namespace (yyvsp[-1].ttype); ;
break;}
-case 23:
-#line 405 "parse.y"
+case 22:
+#line 404 "parse.y"
{ pop_namespace (); ;
break;}
-case 24:
-#line 407 "parse.y"
+case 23:
+#line 406 "parse.y"
{ push_namespace (NULL_TREE); ;
break;}
-case 25:
-#line 409 "parse.y"
+case 24:
+#line 408 "parse.y"
{ pop_namespace (); ;
break;}
case 26:
#line 411 "parse.y"
-{ do_namespace_alias (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
- break;}
-case 27:
-#line 413 "parse.y"
{ do_toplevel_using_decl (yyvsp[-1].ttype); ;
break;}
case 28:
-#line 415 "parse.y"
-{
- if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
- yyvsp[-1].ttype = lastiddecl;
- do_using_directive (yyvsp[-1].ttype);
- ;
+#line 414 "parse.y"
+{ pedantic = yyvsp[-1].itype; ;
break;}
case 29:
-#line 421 "parse.y"
-{ pedantic = yyvsp[-1].itype; ;
+#line 419 "parse.y"
+{ begin_only_namespace_names (); ;
break;}
case 30:
-#line 426 "parse.y"
-{ yyval.ttype = yyvsp[0].ttype; ;
+#line 421 "parse.y"
+{
+ end_only_namespace_names ();
+ if (lastiddecl)
+ yyvsp[-1].ttype = lastiddecl;
+ do_namespace_alias (yyvsp[-4].ttype, yyvsp[-1].ttype);
+ ;
break;}
case 31:
-#line 428 "parse.y"
+#line 431 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 32:
-#line 430 "parse.y"
+#line 433 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 35:
-#line 437 "parse.y"
+case 33:
+#line 435 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
+case 34:
+#line 440 "parse.y"
+{ yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
+ break;}
+case 35:
+#line 442 "parse.y"
+{ yyval.ttype = build_parse_node (SCOPE_REF, global_namespace, yyvsp[0].ttype); ;
+ break;}
case 36:
-#line 439 "parse.y"
-{ yyval.ttype = yyvsp[0].ttype; ;
+#line 444 "parse.y"
+{ yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 37:
-#line 444 "parse.y"
-{ push_lang_context (yyvsp[0].ttype); ;
+#line 449 "parse.y"
+{ begin_only_namespace_names (); ;
break;}
case 38:
-#line 446 "parse.y"
+#line 451 "parse.y"
+{
+ end_only_namespace_names ();
+ /* If no declaration was found, the using-directive is
+ invalid. Since that was not reported, we need the
+ identifier for the error message. */
+ if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE && lastiddecl)
+ yyvsp[-1].ttype = lastiddecl;
+ do_using_directive (yyvsp[-1].ttype);
+ ;
+ break;}
+case 39:
+#line 464 "parse.y"
+{
+ if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
+ yyval.ttype = lastiddecl;
+ got_scope = yyval.ttype;
+ ;
+ break;}
+case 40:
+#line 470 "parse.y"
+{
+ yyval.ttype = yyvsp[-1].ttype;
+ if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
+ yyval.ttype = lastiddecl;
+ got_scope = yyval.ttype;
+ ;
+ break;}
+case 43:
+#line 481 "parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
+ break;}
+case 44:
+#line 483 "parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
+ break;}
+case 45:
+#line 488 "parse.y"
+{ push_lang_context (yyvsp[0].ttype); ;
+ break;}
+case 46:
+#line 490 "parse.y"
{ if (current_lang_name != yyvsp[0].ttype)
cp_error ("use of linkage spec `%D' is different from previous spec `%D'", yyvsp[0].ttype, current_lang_name);
pop_lang_context (); push_lang_context (yyvsp[0].ttype); ;
break;}
-case 39:
-#line 453 "parse.y"
+case 47:
+#line 497 "parse.y"
{ begin_template_parm_list (); ;
break;}
-case 40:
-#line 455 "parse.y"
+case 48:
+#line 499 "parse.y"
{ yyval.ttype = end_template_parm_list (yyvsp[-1].ttype); ;
break;}
-case 41:
-#line 457 "parse.y"
+case 49:
+#line 501 "parse.y"
{ begin_specialization();
yyval.ttype = NULL_TREE; ;
break;}
-case 42:
-#line 463 "parse.y"
+case 50:
+#line 507 "parse.y"
{ yyval.ttype = process_template_parm (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 43:
-#line 465 "parse.y"
+case 51:
+#line 509 "parse.y"
{ yyval.ttype = process_template_parm (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 44:
-#line 470 "parse.y"
+case 52:
+#line 514 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 45:
-#line 472 "parse.y"
+case 53:
+#line 516 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 46:
-#line 476 "parse.y"
+case 54:
+#line 520 "parse.y"
{ yyval.ttype = finish_template_type_parm (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 47:
-#line 478 "parse.y"
+case 55:
+#line 522 "parse.y"
{ yyval.ttype = finish_template_type_parm (class_type_node, yyvsp[0].ttype); ;
break;}
-case 48:
-#line 483 "parse.y"
+case 56:
+#line 527 "parse.y"
{ yyval.ttype = finish_template_template_parm (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 49:
-#line 495 "parse.y"
+case 57:
+#line 539 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 50:
-#line 497 "parse.y"
+case 58:
+#line 541 "parse.y"
{ yyval.ttype = build_tree_list (groktypename (yyvsp[0].ftype.t), yyvsp[-2].ttype); ;
break;}
-case 51:
-#line 499 "parse.y"
+case 59:
+#line 543 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
-case 52:
-#line 501 "parse.y"
+case 60:
+#line 545 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-2].ftype.t); ;
break;}
-case 53:
-#line 503 "parse.y"
+case 61:
+#line 547 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 54:
-#line 505 "parse.y"
+case 62:
+#line 549 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) != TEMPLATE_DECL
&& TREE_CODE (yyvsp[0].ttype) != TEMPLATE_TEMPLATE_PARM
@@ -4205,40 +4355,67 @@ case 54:
yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype);
;
break;}
-case 55:
-#line 520 "parse.y"
-{
- if (yyvsp[-1].ttype)
- end_template_decl ();
- else
- end_specialization ();
- ;
+case 63:
+#line 563 "parse.y"
+{ finish_template_decl (yyvsp[-1].ttype); ;
break;}
-case 56:
-#line 528 "parse.y"
-{
- if (yyvsp[-1].ttype)
- end_template_decl ();
- else
- end_specialization ();
- ;
+case 64:
+#line 565 "parse.y"
+{ finish_template_decl (yyvsp[-1].ttype); ;
break;}
-case 58:
-#line 539 "parse.y"
+case 65:
+#line 570 "parse.y"
+{ if (pending_inlines) do_pending_inlines (); ;
+ break;}
+case 66:
+#line 572 "parse.y"
+{ if (pending_inlines) do_pending_inlines (); ;
+ break;}
+case 67:
+#line 574 "parse.y"
+{ if (pending_inlines) do_pending_inlines (); ;
+ break;}
+case 68:
+#line 576 "parse.y"
+{ if (pending_inlines) do_pending_inlines ();
+ pop_lang_context (); ;
+ break;}
+case 69:
+#line 579 "parse.y"
+{ if (pending_inlines) do_pending_inlines ();
+ pop_lang_context (); ;
+ break;}
+case 70:
+#line 582 "parse.y"
+{ pedantic = yyvsp[-1].itype; ;
+ break;}
+case 72:
+#line 588 "parse.y"
{;
break;}
-case 59:
-#line 541 "parse.y"
-{
- note_list_got_semicolon (yyvsp[-2].ftype.t);
- ;
+case 73:
+#line 590 "parse.y"
+{ note_list_got_semicolon (yyvsp[-2].ftype.t); ;
break;}
-case 60:
-#line 545 "parse.y"
+case 74:
+#line 592 "parse.y"
+{ maybe_process_partial_specialization (yyvsp[-1].ftype.t);
+ note_got_semicolon (yyvsp[-1].ftype.t); ;
+ break;}
+case 76:
+#line 599 "parse.y"
+{;
+ break;}
+case 77:
+#line 601 "parse.y"
+{ note_list_got_semicolon (yyvsp[-2].ftype.t); ;
+ break;}
+case 78:
+#line 603 "parse.y"
{ pedwarn ("empty declaration"); ;
break;}
-case 62:
-#line 548 "parse.y"
+case 80:
+#line 606 "parse.y"
{
tree t, attrs;
split_specs_attrs (yyvsp[-1].ftype.t, &t, &attrs);
@@ -4246,125 +4423,125 @@ case 62:
note_list_got_semicolon (yyvsp[-1].ftype.t);
;
break;}
-case 66:
-#line 561 "parse.y"
+case 84:
+#line 619 "parse.y"
{ yyval.itype = 0; ;
break;}
-case 67:
-#line 563 "parse.y"
+case 85:
+#line 621 "parse.y"
{ yyval.itype = 1; ;
break;}
-case 73:
-#line 579 "parse.y"
+case 91:
+#line 637 "parse.y"
{ finish_function (lineno, (int)yyvsp[-1].itype, 0); ;
break;}
-case 74:
-#line 581 "parse.y"
+case 92:
+#line 639 "parse.y"
{ ;
break;}
-case 75:
-#line 583 "parse.y"
+case 93:
+#line 641 "parse.y"
{ ;
break;}
-case 76:
-#line 588 "parse.y"
+case 94:
+#line 646 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 77:
-#line 590 "parse.y"
+case 95:
+#line 648 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 78:
-#line 592 "parse.y"
+case 96:
+#line 650 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 79:
-#line 596 "parse.y"
+case 97:
+#line 654 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 80:
-#line 598 "parse.y"
+case 98:
+#line 656 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 81:
-#line 600 "parse.y"
+case 99:
+#line 658 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 82:
-#line 604 "parse.y"
+case 100:
+#line 662 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 83:
-#line 606 "parse.y"
+case 101:
+#line 664 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 84:
-#line 608 "parse.y"
+case 102:
+#line 666 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 85:
-#line 612 "parse.y"
+case 103:
+#line 670 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 86:
-#line 614 "parse.y"
+case 104:
+#line 672 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 87:
-#line 616 "parse.y"
+case 105:
+#line 674 "parse.y"
{ yyval.ttype = begin_constructor_declarator (yyvsp[-4].ttype, yyvsp[-3].ttype);
yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 88:
-#line 623 "parse.y"
+case 106:
+#line 681 "parse.y"
{ if (!begin_function_definition (yyvsp[-1].ftype.t, yyvsp[0].ttype))
YYERROR1; ;
break;}
-case 89:
-#line 626 "parse.y"
+case 107:
+#line 684 "parse.y"
{ if (!begin_function_definition (yyvsp[-1].ttype, yyvsp[0].ttype))
YYERROR1; ;
break;}
-case 90:
-#line 629 "parse.y"
+case 108:
+#line 687 "parse.y"
{ if (!begin_function_definition (NULL_TREE, yyvsp[0].ttype))
YYERROR1; ;
break;}
-case 91:
-#line 632 "parse.y"
+case 109:
+#line 690 "parse.y"
{ if (!begin_function_definition (yyvsp[-1].ttype, yyvsp[0].ttype))
YYERROR1; ;
break;}
-case 92:
-#line 635 "parse.y"
+case 110:
+#line 693 "parse.y"
{ if (!begin_function_definition (NULL_TREE, yyvsp[0].ttype))
YYERROR1; ;
break;}
-case 93:
-#line 641 "parse.y"
+case 111:
+#line 699 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-5].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 94:
-#line 643 "parse.y"
+case 112:
+#line 701 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-3].ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 95:
-#line 645 "parse.y"
+case 113:
+#line 703 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-5].ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 96:
-#line 647 "parse.y"
+case 114:
+#line 705 "parse.y"
{ yyval.ttype = make_call_declarator (yyvsp[-3].ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 97:
-#line 654 "parse.y"
+case 115:
+#line 712 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ttype = start_method (specs, yyvsp[0].ttype);
rest_of_mdef:
@@ -4374,55 +4551,55 @@ case 97:
yychar = YYLEX;
reinit_parse_for_method (yychar, yyval.ttype); ;
break;}
-case 98:
-#line 663 "parse.y"
+case 116:
+#line 721 "parse.y"
{ yyval.ttype = start_method (NULL_TREE, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
-case 99:
-#line 665 "parse.y"
+case 117:
+#line 723 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ttype = start_method (specs, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
-case 100:
-#line 668 "parse.y"
+case 118:
+#line 726 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ttype = start_method (specs, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
-case 101:
-#line 671 "parse.y"
+case 119:
+#line 729 "parse.y"
{ yyval.ttype = start_method (NULL_TREE, yyval.ttype); goto rest_of_mdef; ;
break;}
-case 102:
-#line 673 "parse.y"
+case 120:
+#line 731 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ttype = start_method (specs, yyvsp[0].ttype); goto rest_of_mdef; ;
break;}
-case 103:
-#line 676 "parse.y"
+case 121:
+#line 734 "parse.y"
{ yyval.ttype = start_method (NULL_TREE, yyval.ttype); goto rest_of_mdef; ;
break;}
-case 104:
-#line 681 "parse.y"
+case 122:
+#line 739 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
yyval.ttype = yyvsp[0].ttype;
;
break;}
-case 105:
-#line 690 "parse.y"
+case 123:
+#line 748 "parse.y"
{ store_return_init (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 106:
-#line 692 "parse.y"
+case 124:
+#line 750 "parse.y"
{ store_return_init (yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 107:
-#line 694 "parse.y"
+case 125:
+#line 752 "parse.y"
{ store_return_init (yyval.ttype, NULL_TREE); ;
break;}
-case 108:
-#line 699 "parse.y"
+case 126:
+#line 757 "parse.y"
{
if (yyvsp[0].itype == 0)
error ("no base initializers given following ':'");
@@ -4433,8 +4610,8 @@ case 108:
keep_next_level ();
;
break;}
-case 109:
-#line 712 "parse.y"
+case 127:
+#line 770 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -4452,206 +4629,204 @@ case 109:
error ("only constructors take base initializers");
;
break;}
-case 110:
-#line 732 "parse.y"
+case 128:
+#line 790 "parse.y"
{ yyval.itype = 0; ;
break;}
-case 111:
-#line 734 "parse.y"
+case 129:
+#line 792 "parse.y"
{ yyval.itype = 1; ;
break;}
-case 114:
-#line 741 "parse.y"
+case 132:
+#line 799 "parse.y"
{
if (current_class_name)
pedwarn ("anachronistic old style base class initializer");
expand_member_init (current_class_ref, NULL_TREE, yyvsp[-1].ttype);
;
break;}
-case 115:
-#line 747 "parse.y"
+case 133:
+#line 805 "parse.y"
{
if (current_class_name)
pedwarn ("anachronistic old style base class initializer");
expand_member_init (current_class_ref, NULL_TREE, void_type_node);
;
break;}
-case 116:
-#line 753 "parse.y"
+case 134:
+#line 811 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 117:
-#line 755 "parse.y"
+case 135:
+#line 813 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-1].ttype, void_type_node); ;
break;}
-case 118:
-#line 757 "parse.y"
+case 136:
+#line 815 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 119:
-#line 759 "parse.y"
+case 137:
+#line 817 "parse.y"
{ expand_member_init (current_class_ref, yyvsp[-1].ttype, void_type_node); ;
break;}
-case 120:
-#line 761 "parse.y"
+case 138:
+#line 819 "parse.y"
{ expand_member_init (current_class_ref, TYPE_MAIN_DECL (yyvsp[-3].ttype),
yyvsp[-1].ttype); ;
break;}
-case 121:
-#line 764 "parse.y"
+case 139:
+#line 822 "parse.y"
{ expand_member_init (current_class_ref, TYPE_MAIN_DECL (yyvsp[-1].ttype),
void_type_node); ;
break;}
-case 133:
-#line 790 "parse.y"
+case 151:
+#line 848 "parse.y"
{ do_type_instantiation (yyvsp[-1].ftype.t, NULL_TREE);
yyungetc (';', 1); ;
break;}
-case 135:
-#line 794 "parse.y"
+case 153:
+#line 852 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
do_decl_instantiation (specs, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 137:
-#line 798 "parse.y"
+case 155:
+#line 856 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 139:
-#line 801 "parse.y"
+case 157:
+#line 859 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 141:
-#line 804 "parse.y"
+case 159:
+#line 862 "parse.y"
{ do_type_instantiation (yyvsp[-1].ftype.t, yyvsp[-4].ttype);
yyungetc (';', 1); ;
break;}
-case 143:
-#line 809 "parse.y"
+case 161:
+#line 867 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
do_decl_instantiation (specs, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
-case 145:
-#line 813 "parse.y"
+case 163:
+#line 871 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, yyvsp[-3].ttype); ;
break;}
-case 147:
-#line 816 "parse.y"
+case 165:
+#line 874 "parse.y"
{ do_decl_instantiation (NULL_TREE, yyvsp[0].ttype, yyvsp[-3].ttype); ;
break;}
-case 149:
-#line 821 "parse.y"
+case 167:
+#line 879 "parse.y"
{ begin_explicit_instantiation(); ;
break;}
-case 150:
-#line 824 "parse.y"
+case 168:
+#line 882 "parse.y"
{ end_explicit_instantiation(); ;
break;}
-case 151:
-#line 832 "parse.y"
-{
- yyval.ttype = lookup_template_class (yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE, NULL_TREE);
- if (yyval.ttype != error_mark_node)
- yyval.ttype = TYPE_STUB_DECL (yyval.ttype);
- ;
+case 169:
+#line 891 "parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 152:
-#line 838 "parse.y"
-{
- yyval.ttype = lookup_template_class (yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE, NULL_TREE);
- if (yyval.ttype != error_mark_node)
- yyval.ttype = TYPE_STUB_DECL (yyval.ttype);
- ;
+case 170:
+#line 894 "parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 154:
-#line 848 "parse.y"
-{
- yyval.ttype = lookup_template_class (yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE, NULL_TREE);
- if (yyval.ttype != error_mark_node)
- yyval.ttype = TYPE_STUB_DECL (yyval.ttype);
+case 172:
+#line 901 "parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
+ break;}
+case 173:
+#line 905 "parse.y"
+{
+ if (yychar == YYEMPTY)
+ yychar = YYLEX;
+
+ yyval.ttype = finish_template_type (yyvsp[-3].ttype, yyvsp[-1].ttype,
+ yychar == SCOPE);
;
break;}
-case 156:
-#line 858 "parse.y"
+case 175:
+#line 916 "parse.y"
{
/* Handle `Class<Class<Type>>' without space in the `>>' */
pedwarn ("`>>' should be `> >' in template class name");
yyungetc ('>', 1);
;
break;}
-case 157:
-#line 867 "parse.y"
+case 176:
+#line 925 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 159:
-#line 873 "parse.y"
+case 178:
+#line 931 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyval.ttype); ;
break;}
-case 160:
-#line 875 "parse.y"
+case 179:
+#line 933 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 161:
-#line 880 "parse.y"
+case 180:
+#line 938 "parse.y"
{ yyval.ttype = groktypename (yyvsp[0].ftype.t); ;
break;}
-case 163:
-#line 886 "parse.y"
+case 181:
+#line 940 "parse.y"
+{ yyval.ttype = lastiddecl; ;
+ break;}
+case 183:
+#line 946 "parse.y"
{ yyval.code = NEGATE_EXPR; ;
break;}
-case 164:
-#line 888 "parse.y"
+case 184:
+#line 948 "parse.y"
{ yyval.code = CONVERT_EXPR; ;
break;}
-case 165:
-#line 890 "parse.y"
+case 185:
+#line 950 "parse.y"
{ yyval.code = PREINCREMENT_EXPR; ;
break;}
-case 166:
-#line 892 "parse.y"
+case 186:
+#line 952 "parse.y"
{ yyval.code = PREDECREMENT_EXPR; ;
break;}
-case 167:
-#line 894 "parse.y"
+case 187:
+#line 954 "parse.y"
{ yyval.code = TRUTH_NOT_EXPR; ;
break;}
-case 168:
-#line 899 "parse.y"
+case 188:
+#line 959 "parse.y"
{ yyval.ttype = build_x_compound_expr (yyval.ttype); ;
break;}
-case 170:
-#line 905 "parse.y"
+case 190:
+#line 965 "parse.y"
{ error ("ANSI C++ forbids an empty condition for `%s'",
cond_stmt_keyword);
yyval.ttype = integer_zero_node; ;
break;}
-case 171:
-#line 909 "parse.y"
+case 191:
+#line 969 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 172:
-#line 914 "parse.y"
+case 192:
+#line 974 "parse.y"
{ error ("ANSI C++ forbids an empty condition for `%s'",
cond_stmt_keyword);
yyval.ttype = integer_zero_node; ;
break;}
-case 173:
-#line 918 "parse.y"
+case 193:
+#line 978 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 174:
-#line 923 "parse.y"
+case 194:
+#line 983 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 175:
-#line 925 "parse.y"
-{ yyval.ttype = condition_conversion (yyval.ttype); ;
- break;}
-case 176:
-#line 927 "parse.y"
+case 196:
+#line 986 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 177:
-#line 932 "parse.y"
+case 197:
+#line 991 "parse.y"
{ {
tree d;
for (d = getdecls (); d; d = TREE_CHAIN (d))
@@ -4669,8 +4844,8 @@ case 177:
yyvsp[-1].ttype, /*prefix_attributes*/ NULL_TREE);
;
break;}
-case 178:
-#line 949 "parse.y"
+case 198:
+#line 1008 "parse.y"
{
cp_finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-3].ttype, 1, LOOKUP_ONLYCONVERTING);
resume_momentary (yyvsp[-2].itype);
@@ -4679,181 +4854,183 @@ case 178:
cp_error ("definition of array `%#D' in condition", yyval.ttype);
;
break;}
-case 184:
-#line 968 "parse.y"
+case 204:
+#line 1027 "parse.y"
{ yyval.ttype = begin_compound_stmt (1); ;
break;}
-case 185:
-#line 970 "parse.y"
+case 205:
+#line 1029 "parse.y"
{ finish_compound_stmt (1, yyvsp[-1].ttype); ;
break;}
-case 187:
-#line 977 "parse.y"
+case 207:
+#line 1036 "parse.y"
{ yyval.ttype = expr_tree_cons (NULL_TREE, yyval.ttype,
build_expr_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 188:
-#line 980 "parse.y"
+case 208:
+#line 1039 "parse.y"
{ yyval.ttype = expr_tree_cons (NULL_TREE, yyval.ttype,
build_expr_list (NULL_TREE, error_mark_node)); ;
break;}
-case 189:
-#line 983 "parse.y"
+case 209:
+#line 1042 "parse.y"
{ chainon (yyval.ttype, build_expr_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 190:
-#line 985 "parse.y"
+case 210:
+#line 1044 "parse.y"
{ chainon (yyval.ttype, build_expr_list (NULL_TREE, error_mark_node)); ;
break;}
-case 191:
-#line 990 "parse.y"
+case 211:
+#line 1049 "parse.y"
{ yyval.ttype = build_expr_list (NULL_TREE, yyval.ttype); ;
break;}
-case 193:
-#line 996 "parse.y"
+case 213:
+#line 1055 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 194:
-#line 999 "parse.y"
+case 214:
+#line 1058 "parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
-case 195:
-#line 1002 "parse.y"
+case 215:
+#line 1061 "parse.y"
{ yyval.ttype = build_x_indirect_ref (yyvsp[0].ttype, "unary *"); ;
break;}
-case 196:
-#line 1004 "parse.y"
+case 216:
+#line 1063 "parse.y"
{ yyval.ttype = build_x_unary_op (ADDR_EXPR, yyvsp[0].ttype); ;
break;}
-case 197:
-#line 1006 "parse.y"
+case 217:
+#line 1065 "parse.y"
{ yyval.ttype = build_x_unary_op (BIT_NOT_EXPR, yyvsp[0].ttype); ;
break;}
-case 198:
-#line 1008 "parse.y"
-{ yyval.ttype = build_x_unary_op (yyvsp[-1].code, yyvsp[0].ttype);
- if (yyvsp[-1].code == NEGATE_EXPR && TREE_CODE (yyvsp[0].ttype) == INTEGER_CST)
- TREE_NEGATED_INT (yyval.ttype) = 1;
- overflow_warning (yyval.ttype);
- ;
+case 218:
+#line 1067 "parse.y"
+{ yyval.ttype = finish_unary_op_expr (yyvsp[-1].code, yyvsp[0].ttype); ;
break;}
-case 199:
-#line 1015 "parse.y"
+case 219:
+#line 1070 "parse.y"
{ if (pedantic)
pedwarn ("ANSI C++ forbids `&&'");
yyval.ttype = finish_label_address_expr (yyvsp[0].ttype); ;
break;}
-case 200:
-#line 1019 "parse.y"
+case 220:
+#line 1074 "parse.y"
{ yyval.ttype = expr_sizeof (yyvsp[0].ttype); ;
break;}
-case 201:
-#line 1021 "parse.y"
+case 221:
+#line 1076 "parse.y"
{ yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ftype.t)); ;
break;}
-case 202:
-#line 1023 "parse.y"
+case 222:
+#line 1078 "parse.y"
{ yyval.ttype = grok_alignof (yyvsp[0].ttype); ;
break;}
-case 203:
-#line 1025 "parse.y"
+case 223:
+#line 1080 "parse.y"
{ yyval.ttype = c_alignof (groktypename (yyvsp[-1].ftype.t));
check_for_new_type ("alignof", yyvsp[-1].ftype); ;
break;}
-case 204:
-#line 1031 "parse.y"
+case 224:
+#line 1086 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, yyvsp[0].ftype.t, NULL_TREE, yyvsp[-1].itype);
check_for_new_type ("new", yyvsp[0].ftype); ;
break;}
-case 205:
-#line 1034 "parse.y"
+case 225:
+#line 1089 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, yyvsp[-1].ftype.t, yyvsp[0].ttype, yyvsp[-2].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
-case 206:
-#line 1037 "parse.y"
+case 226:
+#line 1092 "parse.y"
{ yyval.ttype = build_new (yyvsp[-1].ttype, yyvsp[0].ftype.t, NULL_TREE, yyvsp[-2].itype);
check_for_new_type ("new", yyvsp[0].ftype); ;
break;}
-case 207:
-#line 1040 "parse.y"
+case 227:
+#line 1095 "parse.y"
{ yyval.ttype = build_new (yyvsp[-2].ttype, yyvsp[-1].ftype.t, yyvsp[0].ttype, yyvsp[-3].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
-case 208:
-#line 1043 "parse.y"
+case 228:
+#line 1108 "parse.y"
{ yyval.ttype = build_new (NULL_TREE, groktypename(yyvsp[-1].ftype.t),
- NULL_TREE, yyvsp[-3].itype);
+ NULL_TREE, yyvsp[-4].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
-case 209:
-#line 1047 "parse.y"
-{ yyval.ttype = build_new (NULL_TREE, groktypename(yyvsp[-2].ftype.t), yyvsp[0].ttype, yyvsp[-4].itype);
+case 229:
+#line 1113 "parse.y"
+{ yyval.ttype = build_new (NULL_TREE, groktypename(yyvsp[-2].ftype.t), yyvsp[0].ttype, yyvsp[-5].itype);
check_for_new_type ("new", yyvsp[-2].ftype); ;
break;}
-case 210:
-#line 1050 "parse.y"
-{ yyval.ttype = build_new (yyvsp[-3].ttype, groktypename(yyvsp[-1].ftype.t), NULL_TREE, yyvsp[-4].itype);
+case 230:
+#line 1117 "parse.y"
+{ yyval.ttype = build_new (yyvsp[-4].ttype, groktypename(yyvsp[-1].ftype.t), NULL_TREE, yyvsp[-5].itype);
check_for_new_type ("new", yyvsp[-1].ftype); ;
break;}
-case 211:
-#line 1053 "parse.y"
-{ yyval.ttype = build_new (yyvsp[-4].ttype, groktypename(yyvsp[-2].ftype.t), yyvsp[0].ttype, yyvsp[-5].itype);
+case 231:
+#line 1121 "parse.y"
+{ yyval.ttype = build_new (yyvsp[-5].ttype, groktypename(yyvsp[-2].ftype.t), yyvsp[0].ttype, yyvsp[-6].itype);
check_for_new_type ("new", yyvsp[-2].ftype); ;
break;}
-case 212:
-#line 1057 "parse.y"
+case 232:
+#line 1125 "parse.y"
{ yyval.ttype = delete_sanity (yyvsp[0].ttype, NULL_TREE, 0, yyvsp[-1].itype); ;
break;}
-case 213:
-#line 1059 "parse.y"
+case 233:
+#line 1127 "parse.y"
{ yyval.ttype = delete_sanity (yyvsp[0].ttype, NULL_TREE, 1, yyvsp[-3].itype);
if (yychar == YYEMPTY)
yychar = YYLEX; ;
break;}
-case 214:
-#line 1063 "parse.y"
+case 234:
+#line 1131 "parse.y"
{ yyval.ttype = delete_sanity (yyvsp[0].ttype, yyvsp[-2].ttype, 2, yyvsp[-4].itype);
if (yychar == YYEMPTY)
yychar = YYLEX; ;
break;}
-case 215:
-#line 1067 "parse.y"
+case 235:
+#line 1135 "parse.y"
{ yyval.ttype = build_x_unary_op (REALPART_EXPR, yyvsp[0].ttype); ;
break;}
-case 216:
-#line 1069 "parse.y"
+case 236:
+#line 1137 "parse.y"
{ yyval.ttype = build_x_unary_op (IMAGPART_EXPR, yyvsp[0].ttype); ;
break;}
-case 217:
-#line 1074 "parse.y"
-{ yyval.ttype = yyvsp[-1].ttype; ;
+case 237:
+#line 1147 "parse.y"
+{ finish_new_placement (NULL_TREE, yyvsp[-2].itype); ;
break;}
-case 218:
-#line 1076 "parse.y"
-{
- yyval.ttype = yyvsp[-1].ttype;
- pedwarn ("old style placement syntax, use () instead");
- ;
+case 238:
+#line 1150 "parse.y"
+{ yyval.itype = begin_new_placement (); ;
break;}
-case 219:
-#line 1084 "parse.y"
+case 239:
+#line 1154 "parse.y"
+{ yyval.ttype = finish_new_placement (yyvsp[-1].ttype, yyvsp[-2].itype); ;
+ break;}
+case 240:
+#line 1156 "parse.y"
+{ cp_pedwarn ("old style placement syntax, use () instead");
+ yyval.ttype = finish_new_placement (yyvsp[-1].ttype, yyvsp[-2].itype); ;
+ break;}
+case 241:
+#line 1162 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 220:
-#line 1086 "parse.y"
+case 242:
+#line 1164 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 221:
-#line 1088 "parse.y"
+case 243:
+#line 1166 "parse.y"
{
cp_error ("`%T' is not a valid expression", yyvsp[-1].ftype.t);
yyval.ttype = error_mark_node;
;
break;}
-case 222:
-#line 1096 "parse.y"
+case 244:
+#line 1174 "parse.y"
{
if (pedantic)
pedwarn ("ANSI C++ forbids initialization of new expression with `='");
@@ -4864,26 +5041,24 @@ case 222:
yyval.ttype = yyvsp[0].ttype;
;
break;}
-case 223:
-#line 1110 "parse.y"
-{ yyvsp[-1].ftype.t = tree_cons (NULL_TREE, yyvsp[-1].ftype.t, void_list_node);
- TREE_PARMLIST (yyvsp[-1].ftype.t) = 1;
+case 245:
+#line 1188 "parse.y"
+{ yyvsp[-1].ftype.t = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[-1].ftype.t), 0);
yyval.ttype = make_call_declarator (NULL_TREE, yyvsp[-1].ftype.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", yyvsp[-1].ftype); ;
break;}
-case 224:
-#line 1115 "parse.y"
-{ yyvsp[-1].ftype.t = tree_cons (NULL_TREE, yyvsp[-1].ftype.t, void_list_node);
- TREE_PARMLIST (yyvsp[-1].ftype.t) = 1;
+case 246:
+#line 1192 "parse.y"
+{ yyvsp[-1].ftype.t = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[-1].ftype.t), 0);
yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-1].ftype.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", yyvsp[-1].ftype); ;
break;}
-case 226:
-#line 1124 "parse.y"
+case 248:
+#line 1200 "parse.y"
{ yyval.ttype = reparse_absdcl_as_casts (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 227:
-#line 1126 "parse.y"
+case 249:
+#line 1202 "parse.y"
{
tree init = build_nt (CONSTRUCTOR, NULL_TREE,
nreverse (yyvsp[-2].ttype));
@@ -4895,191 +5070,202 @@ case 227:
yyval.ttype = reparse_absdcl_as_casts (yyval.ttype, init);
;
break;}
-case 229:
-#line 1142 "parse.y"
+case 251:
+#line 1218 "parse.y"
{ yyval.ttype = build_x_binary_op (MEMBER_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 230:
-#line 1144 "parse.y"
+case 252:
+#line 1220 "parse.y"
{ yyval.ttype = build_m_component_ref (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 231:
-#line 1146 "parse.y"
+case 253:
+#line 1222 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 232:
-#line 1148 "parse.y"
+case 254:
+#line 1224 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 233:
-#line 1150 "parse.y"
+case 255:
+#line 1226 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 234:
-#line 1152 "parse.y"
+case 256:
+#line 1228 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 235:
-#line 1154 "parse.y"
+case 257:
+#line 1230 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 236:
-#line 1156 "parse.y"
+case 258:
+#line 1232 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 237:
-#line 1158 "parse.y"
+case 259:
+#line 1234 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 238:
-#line 1160 "parse.y"
+case 260:
+#line 1236 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 239:
-#line 1162 "parse.y"
+case 261:
+#line 1238 "parse.y"
{ yyval.ttype = build_x_binary_op (LT_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 240:
-#line 1164 "parse.y"
+case 262:
+#line 1240 "parse.y"
{ yyval.ttype = build_x_binary_op (GT_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 241:
-#line 1166 "parse.y"
+case 263:
+#line 1242 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 242:
-#line 1168 "parse.y"
+case 264:
+#line 1244 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 243:
-#line 1170 "parse.y"
+case 265:
+#line 1246 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 244:
-#line 1172 "parse.y"
+case 266:
+#line 1248 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 245:
-#line 1174 "parse.y"
+case 267:
+#line 1250 "parse.y"
{ yyval.ttype = build_x_binary_op (yyvsp[-1].code, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 246:
-#line 1176 "parse.y"
+case 268:
+#line 1252 "parse.y"
{ yyval.ttype = build_x_binary_op (TRUTH_ANDIF_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 247:
-#line 1178 "parse.y"
+case 269:
+#line 1254 "parse.y"
{ yyval.ttype = build_x_binary_op (TRUTH_ORIF_EXPR, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 248:
-#line 1180 "parse.y"
+case 270:
+#line 1256 "parse.y"
{ yyval.ttype = build_x_conditional_expr (yyval.ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 249:
-#line 1182 "parse.y"
+case 271:
+#line 1258 "parse.y"
{ yyval.ttype = build_x_modify_expr (yyval.ttype, NOP_EXPR, yyvsp[0].ttype);
if (yyval.ttype != error_mark_node)
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, MODIFY_EXPR); ;
break;}
-case 250:
-#line 1186 "parse.y"
+case 272:
+#line 1262 "parse.y"
{ yyval.ttype = build_x_modify_expr (yyval.ttype, yyvsp[-1].code, yyvsp[0].ttype); ;
break;}
-case 251:
-#line 1188 "parse.y"
+case 273:
+#line 1264 "parse.y"
{ yyval.ttype = build_throw (NULL_TREE); ;
break;}
-case 252:
-#line 1190 "parse.y"
+case 274:
+#line 1266 "parse.y"
{ yyval.ttype = build_throw (yyvsp[0].ttype); ;
break;}
-case 253:
-#line 1208 "parse.y"
+case 275:
+#line 1284 "parse.y"
{ yyval.ttype = build_parse_node (BIT_NOT_EXPR, yyvsp[0].ttype); ;
break;}
-case 259:
-#line 1217 "parse.y"
-{ yyval.ttype = do_identifier (yyvsp[-1].ttype, 1); ;
+case 276:
+#line 1286 "parse.y"
+{ yyval.ttype = build_parse_node (BIT_NOT_EXPR, yyvsp[0].ttype); ;
break;}
-case 260:
-#line 1221 "parse.y"
+case 282:
+#line 1295 "parse.y"
+{ yyval.ttype = do_identifier (yyvsp[-1].ttype, 1, NULL_TREE); ;
+ break;}
+case 283:
+#line 1299 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 261:
-#line 1223 "parse.y"
+case 284:
+#line 1301 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 262:
-#line 1228 "parse.y"
+case 285:
+#line 1306 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 263:
-#line 1230 "parse.y"
+case 286:
+#line 1308 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 264:
-#line 1233 "parse.y"
+case 287:
+#line 1311 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 269:
-#line 1245 "parse.y"
+case 292:
+#line 1323 "parse.y"
{ yyval.ttype = build_parse_node (INDIRECT_REF, yyvsp[0].ttype); ;
break;}
-case 270:
-#line 1247 "parse.y"
+case 293:
+#line 1325 "parse.y"
{ yyval.ttype = build_parse_node (ADDR_EXPR, yyvsp[0].ttype); ;
break;}
-case 271:
-#line 1249 "parse.y"
+case 294:
+#line 1327 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 272:
-#line 1254 "parse.y"
+case 295:
+#line 1332 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 273:
-#line 1256 "parse.y"
+case 296:
+#line 1334 "parse.y"
{ yyval.ttype = lookup_template_function (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 277:
-#line 1264 "parse.y"
+case 300:
+#line 1344 "parse.y"
{ yyval.ttype = finish_decl_parsing (yyvsp[-1].ttype); ;
break;}
-case 278:
-#line 1269 "parse.y"
+case 301:
+#line 1349 "parse.y"
{
- if (TREE_CODE (yyval.ttype) == BIT_NOT_EXPR)
- yyval.ttype = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (yyval.ttype, 0));
- else if (TREE_CODE (yyval.ttype) != TEMPLATE_ID_EXPR)
- yyval.ttype = do_identifier (yyval.ttype, 1);
+ if (TREE_CODE (yyvsp[0].ttype) == BIT_NOT_EXPR)
+ yyval.ttype = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (yyvsp[0].ttype, 0));
+ else
+ yyval.ttype = finish_id_expr (yyvsp[0].ttype);
;
break;}
-case 281:
-#line 1278 "parse.y"
+case 304:
+#line 1358 "parse.y"
{
if (processing_template_decl)
push_obstacks (&permanent_obstack, &permanent_obstack);
yyval.ttype = combine_strings (yyval.ttype);
+ /* combine_strings doesn't set up TYPE_MAIN_VARIANT of
+ a const array the way we want, so fix it. */
+ if (flag_const_strings)
+ TREE_TYPE (yyval.ttype) = build_cplus_array_type
+ (TREE_TYPE (TREE_TYPE (yyval.ttype)),
+ TYPE_DOMAIN (TREE_TYPE (yyval.ttype)));
if (processing_template_decl)
pop_obstacks ();
;
break;}
-case 282:
-#line 1286 "parse.y"
+case 305:
+#line 1372 "parse.y"
{ yyval.ttype = finish_parenthesized_expr (yyvsp[-1].ttype); ;
break;}
-case 283:
-#line 1288 "parse.y"
+case 306:
+#line 1374 "parse.y"
{ yyvsp[-1].ttype = reparse_decl_as_expr (NULL_TREE, yyvsp[-1].ttype);
yyval.ttype = finish_parenthesized_expr (yyvsp[-1].ttype); ;
break;}
-case 284:
-#line 1291 "parse.y"
+case 307:
+#line 1377 "parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
-case 285:
-#line 1293 "parse.y"
-{ if (current_function_decl == 0)
+case 308:
+#line 1379 "parse.y"
+{ tree scope = current_scope ();
+ if (!scope || TREE_CODE (scope) != FUNCTION_DECL)
{
error ("braced-group within expression allowed only inside a function");
YYERROR;
@@ -5089,36 +5275,44 @@ case 285:
yyval.ttype = begin_stmt_expr ();
;
break;}
-case 286:
-#line 1303 "parse.y"
+case 309:
+#line 1390 "parse.y"
{ yyval.ttype = finish_stmt_expr (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 287:
-#line 1305 "parse.y"
-{ yyval.ttype = finish_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
+case 310:
+#line 1395 "parse.y"
+{ yyval.ttype = finish_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype, 1); ;
break;}
-case 288:
-#line 1307 "parse.y"
-{ yyval.ttype = finish_call_expr (yyvsp[-1].ttype, NULL_TREE); ;
+case 311:
+#line 1397 "parse.y"
+{ yyval.ttype = finish_call_expr (yyvsp[-1].ttype, NULL_TREE, 1); ;
+ break;}
+case 312:
+#line 1399 "parse.y"
+{ yyval.ttype = finish_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype, 0); ;
break;}
-case 289:
-#line 1309 "parse.y"
+case 313:
+#line 1401 "parse.y"
+{ yyval.ttype = finish_call_expr (yyvsp[-1].ttype, NULL_TREE, 0); ;
+ break;}
+case 314:
+#line 1403 "parse.y"
{ yyval.ttype = grok_array_decl (yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 290:
-#line 1311 "parse.y"
+case 315:
+#line 1405 "parse.y"
{ yyval.ttype = finish_increment_expr (yyvsp[-1].ttype, POSTINCREMENT_EXPR); ;
break;}
-case 291:
-#line 1313 "parse.y"
+case 316:
+#line 1407 "parse.y"
{ yyval.ttype = finish_increment_expr (yyvsp[-1].ttype, POSTDECREMENT_EXPR); ;
break;}
-case 292:
-#line 1316 "parse.y"
+case 317:
+#line 1410 "parse.y"
{ yyval.ttype = finish_this_expr (); ;
break;}
-case 293:
-#line 1318 "parse.y"
+case 318:
+#line 1412 "parse.y"
{
tree type = NULL_TREE;
tree id = yyval.ttype;
@@ -5163,46 +5357,50 @@ case 293:
}
;
break;}
-case 295:
-#line 1363 "parse.y"
+case 320:
+#line 1457 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("dynamic_cast", yyvsp[-4].ftype);
yyval.ttype = build_dynamic_cast (type, yyvsp[-1].ttype); ;
break;}
-case 296:
-#line 1367 "parse.y"
+case 321:
+#line 1461 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("static_cast", yyvsp[-4].ftype);
yyval.ttype = build_static_cast (type, yyvsp[-1].ttype); ;
break;}
-case 297:
-#line 1371 "parse.y"
+case 322:
+#line 1465 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("reinterpret_cast", yyvsp[-4].ftype);
yyval.ttype = build_reinterpret_cast (type, yyvsp[-1].ttype); ;
break;}
-case 298:
-#line 1375 "parse.y"
+case 323:
+#line 1469 "parse.y"
{ tree type = groktypename (yyvsp[-4].ftype.t);
check_for_new_type ("const_cast", yyvsp[-4].ftype);
yyval.ttype = build_const_cast (type, yyvsp[-1].ttype); ;
break;}
-case 299:
-#line 1379 "parse.y"
+case 324:
+#line 1473 "parse.y"
{ yyval.ttype = build_x_typeid (yyvsp[-1].ttype); ;
break;}
-case 300:
-#line 1381 "parse.y"
+case 325:
+#line 1475 "parse.y"
{ tree type = groktypename (yyvsp[-1].ftype.t);
check_for_new_type ("typeid", yyvsp[-1].ftype);
yyval.ttype = get_typeid (TYPE_MAIN_VARIANT (type)); ;
break;}
-case 301:
-#line 1385 "parse.y"
+case 326:
+#line 1479 "parse.y"
{ yyval.ttype = do_scoped_id (yyvsp[0].ttype, 1); ;
break;}
-case 302:
-#line 1387 "parse.y"
+case 327:
+#line 1481 "parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
+ break;}
+case 328:
+#line 1483 "parse.y"
{
got_scope = NULL_TREE;
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
@@ -5211,103 +5409,103 @@ case 302:
yyval.ttype = yyvsp[0].ttype;
;
break;}
-case 303:
-#line 1395 "parse.y"
+case 329:
+#line 1491 "parse.y"
{ yyval.ttype = build_offset_ref (OP0 (yyval.ttype), OP1 (yyval.ttype)); ;
break;}
-case 304:
-#line 1397 "parse.y"
-{ yyval.ttype = finish_globally_qualified_member_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
+case 330:
+#line 1493 "parse.y"
+{ yyval.ttype = finish_qualified_call_expr (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 305:
-#line 1399 "parse.y"
-{ yyval.ttype = finish_globally_qualified_member_call_expr (yyvsp[-1].ttype, NULL_TREE); ;
+case 331:
+#line 1495 "parse.y"
+{ yyval.ttype = finish_qualified_call_expr (yyvsp[-1].ttype, NULL_TREE); ;
break;}
-case 306:
-#line 1401 "parse.y"
+case 332:
+#line 1497 "parse.y"
{
yyval.ttype = build_x_component_ref (yyval.ttype, yyvsp[0].ttype, NULL_TREE, 1);
;
break;}
-case 307:
-#line 1405 "parse.y"
+case 333:
+#line 1501 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-3].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
-case 308:
-#line 1407 "parse.y"
+case 334:
+#line 1503 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-1].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
-case 309:
-#line 1409 "parse.y"
+case 335:
+#line 1505 "parse.y"
{ yyval.ttype = build_x_component_ref (yyval.ttype, yyvsp[0].ttype, NULL_TREE, 1); ;
break;}
-case 310:
-#line 1411 "parse.y"
+case 336:
+#line 1507 "parse.y"
{ if (processing_template_decl)
yyval.ttype = build_min_nt (COMPONENT_REF, yyvsp[-1].ttype, copy_to_permanent (yyvsp[0].ttype));
else
yyval.ttype = build_object_ref (yyval.ttype, OP0 (yyvsp[0].ttype), OP1 (yyvsp[0].ttype)); ;
break;}
-case 311:
-#line 1416 "parse.y"
+case 337:
+#line 1512 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-3].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
-case 312:
-#line 1418 "parse.y"
+case 338:
+#line 1514 "parse.y"
{ yyval.ttype = finish_object_call_expr (yyvsp[-1].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
-case 313:
-#line 1420 "parse.y"
+case 339:
+#line 1516 "parse.y"
{ yyval.ttype = finish_qualified_object_call_expr (yyvsp[-3].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
-case 314:
-#line 1422 "parse.y"
+case 340:
+#line 1518 "parse.y"
{ yyval.ttype = finish_qualified_object_call_expr (yyvsp[-1].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
-case 315:
-#line 1425 "parse.y"
+case 341:
+#line 1521 "parse.y"
{ yyval.ttype = finish_pseudo_destructor_call_expr (yyvsp[-3].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 316:
-#line 1427 "parse.y"
+case 342:
+#line 1523 "parse.y"
{ yyval.ttype = finish_pseudo_destructor_call_expr (yyvsp[-5].ttype, yyvsp[-4].ttype, yyvsp[-1].ttype); ;
break;}
-case 317:
-#line 1429 "parse.y"
+case 343:
+#line 1525 "parse.y"
{
yyval.ttype = error_mark_node;
;
break;}
-case 318:
-#line 1474 "parse.y"
+case 344:
+#line 1570 "parse.y"
{ yyval.itype = 0; ;
break;}
-case 319:
-#line 1476 "parse.y"
+case 345:
+#line 1572 "parse.y"
{ got_scope = NULL_TREE; yyval.itype = 1; ;
break;}
-case 320:
-#line 1481 "parse.y"
+case 346:
+#line 1577 "parse.y"
{ yyval.itype = 0; ;
break;}
-case 321:
-#line 1483 "parse.y"
+case 347:
+#line 1579 "parse.y"
{ got_scope = NULL_TREE; yyval.itype = 1; ;
break;}
-case 322:
-#line 1488 "parse.y"
+case 348:
+#line 1584 "parse.y"
{ yyval.ttype = boolean_true_node; ;
break;}
-case 323:
-#line 1490 "parse.y"
+case 349:
+#line 1586 "parse.y"
{ yyval.ttype = boolean_false_node; ;
break;}
-case 325:
-#line 1497 "parse.y"
+case 351:
+#line 1593 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 326:
-#line 1502 "parse.y"
+case 352:
+#line 1598 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -5318,220 +5516,220 @@ case 326:
keep_next_level ();
;
break;}
-case 327:
-#line 1515 "parse.y"
+case 353:
+#line 1611 "parse.y"
{ got_object = TREE_TYPE (yyval.ttype); ;
break;}
-case 328:
-#line 1517 "parse.y"
+case 354:
+#line 1613 "parse.y"
{
yyval.ttype = build_x_arrow (yyval.ttype);
got_object = TREE_TYPE (yyval.ttype);
;
break;}
-case 329:
-#line 1525 "parse.y"
+case 355:
+#line 1621 "parse.y"
{
resume_momentary (yyvsp[-1].itype);
if (yyvsp[-2].ftype.t && IS_AGGR_TYPE_CODE (TREE_CODE (yyvsp[-2].ftype.t)))
note_got_semicolon (yyvsp[-2].ftype.t);
;
break;}
-case 330:
-#line 1531 "parse.y"
+case 356:
+#line 1627 "parse.y"
{
resume_momentary (yyvsp[-1].itype);
note_list_got_semicolon (yyvsp[-2].ftype.t);
;
break;}
-case 331:
-#line 1536 "parse.y"
+case 357:
+#line 1632 "parse.y"
{ resume_momentary (yyvsp[-1].itype); ;
break;}
-case 332:
-#line 1538 "parse.y"
+case 358:
+#line 1634 "parse.y"
{
shadow_tag (yyvsp[-1].ftype.t);
note_list_got_semicolon (yyvsp[-1].ftype.t);
;
break;}
-case 333:
-#line 1543 "parse.y"
+case 359:
+#line 1639 "parse.y"
{ warning ("empty declaration"); ;
break;}
-case 334:
-#line 1545 "parse.y"
+case 360:
+#line 1641 "parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
-case 337:
-#line 1559 "parse.y"
+case 363:
+#line 1655 "parse.y"
{ yyval.ttype = make_call_declarator (NULL_TREE, empty_parms (),
NULL_TREE, NULL_TREE); ;
break;}
-case 338:
-#line 1562 "parse.y"
+case 364:
+#line 1658 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), NULL_TREE,
NULL_TREE); ;
break;}
-case 339:
-#line 1569 "parse.y"
+case 365:
+#line 1665 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 340:
-#line 1572 "parse.y"
+case 366:
+#line 1668 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 341:
-#line 1575 "parse.y"
+case 367:
+#line 1671 "parse.y"
{ yyval.ftype.t = build_decl_list (get_decl_list (yyvsp[-1].ftype.t), yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 342:
-#line 1578 "parse.y"
+case 368:
+#line 1674 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 343:
-#line 1581 "parse.y"
+case 369:
+#line 1677 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 346:
-#line 1597 "parse.y"
+case 372:
+#line 1693 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyvsp[-1].ttype);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 347:
-#line 1600 "parse.y"
+case 373:
+#line 1696 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 348:
-#line 1603 "parse.y"
+case 374:
+#line 1699 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-2].ftype.t, chainon (yyvsp[-1].ttype, yyvsp[0].ttype));
yyval.ftype.new_type_flag = yyvsp[-2].ftype.new_type_flag; ;
break;}
-case 349:
-#line 1606 "parse.y"
+case 375:
+#line 1702 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, chainon (yyvsp[0].ttype, yyvsp[-2].ttype));
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 350:
-#line 1609 "parse.y"
+case 376:
+#line 1705 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, chainon (yyvsp[0].ttype, yyvsp[-2].ttype));
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 351:
-#line 1612 "parse.y"
+case 377:
+#line 1708 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-2].ftype.t,
chainon (yyvsp[-1].ttype, chainon (yyvsp[0].ttype, yyvsp[-3].ttype)));
yyval.ftype.new_type_flag = yyvsp[-2].ftype.new_type_flag; ;
break;}
-case 352:
-#line 1619 "parse.y"
+case 378:
+#line 1715 "parse.y"
{ if (extra_warnings)
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyval.ttype));
yyval.ttype = build_decl_list (NULL_TREE, yyval.ttype); ;
break;}
-case 353:
-#line 1624 "parse.y"
+case 379:
+#line 1720 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyval.ttype); ;
break;}
-case 354:
-#line 1626 "parse.y"
+case 380:
+#line 1722 "parse.y"
{ if (extra_warnings)
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
-case 355:
-#line 1631 "parse.y"
+case 381:
+#line 1727 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 356:
-#line 1633 "parse.y"
+case 382:
+#line 1729 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
-case 357:
-#line 1643 "parse.y"
+case 383:
+#line 1739 "parse.y"
{ yyval.ttype = yyvsp[0].ftype.t; TREE_STATIC (yyval.ttype) = 1; ;
break;}
-case 358:
-#line 1645 "parse.y"
+case 384:
+#line 1741 "parse.y"
{ yyval.ttype = IDENTIFIER_AS_LIST (yyval.ttype); ;
break;}
-case 359:
-#line 1647 "parse.y"
+case 385:
+#line 1743 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
-case 360:
-#line 1650 "parse.y"
+case 386:
+#line 1746 "parse.y"
{ if (extra_warnings && TREE_STATIC (yyval.ttype))
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype);
TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ;
break;}
-case 361:
-#line 1656 "parse.y"
+case 387:
+#line 1752 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 362:
-#line 1658 "parse.y"
+case 388:
+#line 1754 "parse.y"
{ yyval.ttype = decl_tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
-case 363:
-#line 1669 "parse.y"
+case 389:
+#line 1765 "parse.y"
{ yyval.ftype.t = get_decl_list (yyvsp[0].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 364:
-#line 1672 "parse.y"
+case 390:
+#line 1768 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 365:
-#line 1675 "parse.y"
+case 391:
+#line 1771 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 366:
-#line 1678 "parse.y"
+case 392:
+#line 1774 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[-1].ftype.t, chainon (yyvsp[0].ttype, yyvsp[-2].ftype.t));
yyval.ftype.new_type_flag = yyvsp[-2].ftype.new_type_flag; ;
break;}
-case 367:
-#line 1684 "parse.y"
+case 393:
+#line 1780 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
-case 368:
-#line 1686 "parse.y"
+case 394:
+#line 1782 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ftype.t, yyvsp[-1].ttype); ;
break;}
-case 370:
-#line 1696 "parse.y"
+case 396:
+#line 1792 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
-case 371:
-#line 1698 "parse.y"
+case 397:
+#line 1794 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
-case 372:
-#line 1700 "parse.y"
+case 398:
+#line 1796 "parse.y"
{ yyval.ftype.t = TREE_TYPE (yyvsp[-1].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
-case 373:
-#line 1703 "parse.y"
+case 399:
+#line 1799 "parse.y"
{ yyval.ftype.t = groktypename (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = 0; ;
break;}
-case 374:
-#line 1706 "parse.y"
+case 400:
+#line 1802 "parse.y"
{ tree type = TREE_TYPE (yyvsp[-1].ttype);
yyval.ftype.new_type_flag = 0;
@@ -5547,8 +5745,8 @@ case 374:
}
;
break;}
-case 375:
-#line 1721 "parse.y"
+case 401:
+#line 1817 "parse.y"
{ tree type = groktypename (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = 0;
@@ -5564,189 +5762,201 @@ case 375:
}
;
break;}
-case 376:
-#line 1741 "parse.y"
+case 402:
+#line 1837 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
-case 377:
-#line 1743 "parse.y"
+case 403:
+#line 1839 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype; yyval.ftype.new_type_flag = 0; ;
break;}
-case 385:
-#line 1764 "parse.y"
+case 406:
+#line 1846 "parse.y"
+{ check_multiple_declarators (); ;
+ break;}
+case 408:
+#line 1852 "parse.y"
+{ check_multiple_declarators (); ;
+ break;}
+case 410:
+#line 1858 "parse.y"
+{ check_multiple_declarators (); ;
+ break;}
+case 411:
+#line 1863 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 386:
-#line 1766 "parse.y"
+case 412:
+#line 1865 "parse.y"
{ if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 387:
-#line 1771 "parse.y"
+case 413:
+#line 1870 "parse.y"
{ yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1,
yyvsp[-1].ttype, prefix_attributes); ;
break;}
-case 388:
-#line 1775 "parse.y"
+case 414:
+#line 1874 "parse.y"
{ cp_finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype, 1, LOOKUP_ONLYCONVERTING); ;
break;}
-case 389:
-#line 1777 "parse.y"
+case 415:
+#line 1876 "parse.y"
{ yyval.ttype = start_decl (yyvsp[-2].ttype, current_declspecs, 0,
yyvsp[0].ttype, prefix_attributes);
cp_finish_decl (yyval.ttype, NULL_TREE, yyvsp[-1].ttype, 1, 0); ;
break;}
-case 390:
-#line 1790 "parse.y"
+case 416:
+#line 1889 "parse.y"
{ yyvsp[0].itype = parse_decl (yyvsp[-3].ttype, yyvsp[-4].ttype,
yyvsp[-1].ttype, 1, &yyval.ttype); ;
break;}
-case 391:
-#line 1795 "parse.y"
+case 417:
+#line 1894 "parse.y"
{ cp_finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype, 1,
LOOKUP_ONLYCONVERTING);
yyval.itype = yyvsp[-2].itype; ;
break;}
-case 392:
-#line 1799 "parse.y"
+case 418:
+#line 1898 "parse.y"
{ tree d;
yyval.itype = parse_decl (yyvsp[-2].ttype, yyvsp[-3].ttype, yyvsp[0].ttype, 0, &d);
cp_finish_decl (d, NULL_TREE, yyvsp[-1].ttype, 1, 0); ;
break;}
-case 393:
-#line 1806 "parse.y"
+case 419:
+#line 1905 "parse.y"
{ yyval.itype = yyvsp[0].itype; ;
break;}
-case 394:
-#line 1810 "parse.y"
+case 420:
+#line 1909 "parse.y"
{ yyval.itype = yyvsp[0].itype; ;
break;}
-case 395:
-#line 1815 "parse.y"
+case 421:
+#line 1914 "parse.y"
{ /* Set things up as initdcl0_innards expects. */
- yyval.ttype = yyvsp[-1].ttype;
+ yyvsp[0].ttype = yyvsp[-1].ttype;
yyvsp[-1].ttype = NULL_TREE; ;
break;}
-case 396:
-#line 1819 "parse.y"
+case 422:
+#line 1918 "parse.y"
{;
break;}
-case 397:
-#line 1821 "parse.y"
+case 423:
+#line 1920 "parse.y"
{ tree d;
parse_decl(yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype, 0, &d);
cp_finish_decl (d, NULL_TREE, yyvsp[-1].ttype, 1, 0); ;
break;}
-case 398:
-#line 1830 "parse.y"
+case 424:
+#line 1929 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 399:
-#line 1832 "parse.y"
+case 425:
+#line 1931 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 400:
-#line 1837 "parse.y"
+case 426:
+#line 1936 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 401:
-#line 1839 "parse.y"
+case 427:
+#line 1938 "parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 402:
-#line 1844 "parse.y"
+case 428:
+#line 1943 "parse.y"
{ yyval.ttype = yyvsp[-2].ttype; ;
break;}
-case 403:
-#line 1849 "parse.y"
+case 429:
+#line 1948 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 404:
-#line 1851 "parse.y"
+case 430:
+#line 1950 "parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 405:
-#line 1856 "parse.y"
+case 431:
+#line 1955 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 406:
-#line 1858 "parse.y"
+case 432:
+#line 1957 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 407:
-#line 1860 "parse.y"
+case 433:
+#line 1959 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ;
break;}
-case 408:
-#line 1862 "parse.y"
+case 434:
+#line 1961 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ;
break;}
-case 409:
-#line 1864 "parse.y"
+case 435:
+#line 1963 "parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 414:
-#line 1880 "parse.y"
+case 440:
+#line 1979 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 415:
-#line 1882 "parse.y"
+case 441:
+#line 1981 "parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 416:
-#line 1887 "parse.y"
+case 442:
+#line 1986 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 417:
-#line 1889 "parse.y"
+case 443:
+#line 1988 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 419:
-#line 1897 "parse.y"
+case 445:
+#line 1996 "parse.y"
{ yyval.ttype = build_nt (CONSTRUCTOR, NULL_TREE, NULL_TREE);
TREE_HAS_CONSTRUCTOR (yyval.ttype) = 1; ;
break;}
-case 420:
-#line 1900 "parse.y"
+case 446:
+#line 1999 "parse.y"
{ yyval.ttype = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (yyvsp[-1].ttype));
TREE_HAS_CONSTRUCTOR (yyval.ttype) = 1; ;
break;}
-case 421:
-#line 1903 "parse.y"
+case 447:
+#line 2002 "parse.y"
{ yyval.ttype = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (yyvsp[-2].ttype));
TREE_HAS_CONSTRUCTOR (yyval.ttype) = 1; ;
break;}
-case 422:
-#line 1906 "parse.y"
+case 448:
+#line 2005 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 423:
-#line 1913 "parse.y"
+case 449:
+#line 2012 "parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyval.ttype); ;
break;}
-case 424:
-#line 1915 "parse.y"
+case 450:
+#line 2014 "parse.y"
{ yyval.ttype = expr_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
-case 425:
-#line 1918 "parse.y"
+case 451:
+#line 2017 "parse.y"
{ yyval.ttype = build_expr_list (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 426:
-#line 1920 "parse.y"
+case 452:
+#line 2019 "parse.y"
{ yyval.ttype = build_expr_list (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 427:
-#line 1922 "parse.y"
+case 453:
+#line 2021 "parse.y"
{ yyval.ttype = expr_tree_cons (yyvsp[-2].ttype, yyvsp[0].ttype, yyval.ttype); ;
break;}
-case 428:
-#line 1927 "parse.y"
+case 454:
+#line 2026 "parse.y"
{ start_function (NULL_TREE, TREE_VALUE (yyvsp[0].ttype),
NULL_TREE, 1);
reinit_parse_for_function (); ;
break;}
-case 429:
-#line 1933 "parse.y"
+case 455:
+#line 2032 "parse.y"
{
int nested = (hack_decl_function_context
(current_function_decl) != NULL_TREE);
@@ -5754,138 +5964,113 @@ case 429:
process_next_inline (yyvsp[-3].ttype);
;
break;}
-case 430:
-#line 1940 "parse.y"
+case 456:
+#line 2039 "parse.y"
{ process_next_inline (yyvsp[-2].ttype); ;
break;}
-case 431:
-#line 1942 "parse.y"
+case 457:
+#line 2041 "parse.y"
{ process_next_inline (yyvsp[-2].ttype); ;
break;}
-case 434:
-#line 1954 "parse.y"
+case 460:
+#line 2053 "parse.y"
{ replace_defarg (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 435:
-#line 1956 "parse.y"
+case 461:
+#line 2055 "parse.y"
{ replace_defarg (yyvsp[-2].ttype, error_mark_node); ;
break;}
-case 437:
-#line 1961 "parse.y"
+case 463:
+#line 2060 "parse.y"
{ do_pending_defargs (); ;
break;}
-case 438:
-#line 1963 "parse.y"
+case 464:
+#line 2062 "parse.y"
{ do_pending_defargs (); ;
break;}
-case 439:
-#line 1968 "parse.y"
+case 465:
+#line 2067 "parse.y"
{ yyvsp[0].itype = suspend_momentary ();
- yyval.ttype = start_enum (yyvsp[-1].ttype); ;
+ yyval.ttype = current_enum_type;
+ current_enum_type = start_enum (yyvsp[-1].ttype); ;
break;}
-case 440:
-#line 1971 "parse.y"
-{ yyval.ftype.t = finish_enum (yyvsp[-3].ttype, yyvsp[-2].ttype);
+case 466:
+#line 2071 "parse.y"
+{ TYPE_VALUES (current_enum_type) = yyvsp[-2].ttype;
+ yyval.ftype.t = finish_enum (current_enum_type);
yyval.ftype.new_type_flag = 1;
+ current_enum_type = yyvsp[-3].ttype;
resume_momentary ((int) yyvsp[-4].itype);
- check_for_missing_semicolon (yyvsp[-3].ttype); ;
+ check_for_missing_semicolon (yyval.ftype.t); ;
break;}
-case 441:
-#line 1976 "parse.y"
-{ yyval.ftype.t = finish_enum (start_enum (yyvsp[-2].ttype), NULL_TREE);
+case 467:
+#line 2078 "parse.y"
+{ yyval.ftype.t = finish_enum (start_enum (yyvsp[-2].ttype));
yyval.ftype.new_type_flag = 1;
check_for_missing_semicolon (yyval.ftype.t); ;
break;}
-case 442:
-#line 1980 "parse.y"
+case 468:
+#line 2082 "parse.y"
{ yyvsp[0].itype = suspend_momentary ();
- yyval.ttype = start_enum (make_anon_name ()); ;
+ yyval.ttype = current_enum_type;
+ current_enum_type = start_enum (make_anon_name ()); ;
break;}
-case 443:
-#line 1983 "parse.y"
-{ yyval.ftype.t = finish_enum (yyvsp[-3].ttype, yyvsp[-2].ttype);
+case 469:
+#line 2086 "parse.y"
+{ TYPE_VALUES (current_enum_type) = yyvsp[-2].ttype;
+ yyval.ftype.t = finish_enum (current_enum_type);
+ yyval.ftype.new_type_flag = 1;
+ current_enum_type = yyvsp[-2].ttype;
resume_momentary ((int) yyvsp[-5].itype);
- check_for_missing_semicolon (yyvsp[-3].ttype);
- yyval.ftype.new_type_flag = 1; ;
+ check_for_missing_semicolon (yyval.ftype.t); ;
break;}
-case 444:
-#line 1988 "parse.y"
-{ yyval.ftype.t = finish_enum (start_enum (make_anon_name()), NULL_TREE);
+case 470:
+#line 2093 "parse.y"
+{ yyval.ftype.t = finish_enum (start_enum (make_anon_name()));
yyval.ftype.new_type_flag = 1;
check_for_missing_semicolon (yyval.ftype.t); ;
break;}
-case 445:
-#line 1992 "parse.y"
-{ yyval.ftype.t = xref_tag (enum_type_node, yyvsp[0].ttype, NULL_TREE, 1);
+case 471:
+#line 2097 "parse.y"
+{ yyval.ftype.t = xref_tag (enum_type_node, yyvsp[0].ttype, 1);
yyval.ftype.new_type_flag = 0; ;
break;}
-case 446:
-#line 1995 "parse.y"
-{ yyval.ftype.t = xref_tag (enum_type_node, yyvsp[0].ttype, NULL_TREE, 1);
+case 472:
+#line 2100 "parse.y"
+{ yyval.ftype.t = xref_tag (enum_type_node, yyvsp[0].ttype, 1);
yyval.ftype.new_type_flag = 0; ;
break;}
-case 447:
-#line 1998 "parse.y"
+case 473:
+#line 2103 "parse.y"
{ yyval.ftype.t = yyvsp[0].ttype;
- yyval.ftype.new_type_flag = 0; ;
+ yyval.ftype.new_type_flag = 0;
+ if (!processing_template_decl)
+ cp_pedwarn ("using `typename' outside of template"); ;
break;}
-case 448:
-#line 2003 "parse.y"
-{
+case 474:
+#line 2110 "parse.y"
+{
int semi;
- yyval.ttype = yyvsp[-4].ttype;
-#if 0
- /* Need to rework class nesting in the
- presence of nested classes, etc. */
- shadow_tag (CLASSTYPE_AS_LIST (yyvsp[-4].ttype)); */
-#endif
if (yychar == YYEMPTY)
yychar = YYLEX;
semi = yychar == ';';
- /* finish_struct nukes this anyway; if
- finish_exception does too, then it can go. */
- if (semi)
- note_got_semicolon (yyvsp[-4].ttype);
-
- if (TREE_CODE (yyvsp[-4].ttype) == ENUMERAL_TYPE)
- ;
- else
- {
- yyval.ttype = finish_struct (yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[0].ttype, semi);
- if (semi) note_got_semicolon (yyval.ttype);
- }
- pop_obstacks ();
-
- if (! semi)
- check_for_missing_semicolon (yyvsp[-4].ttype);
- if (current_scope () == current_function_decl)
- do_pending_defargs ();
+ yyval.ttype = finish_class_definition (yyvsp[-4].ttype, yyvsp[0].ttype, semi);
;
break;}
-case 449:
-#line 2036 "parse.y"
-{
- if (pending_inlines
- && current_scope () == current_function_decl)
- do_pending_inlines ();
- ;
+case 475:
+#line 2120 "parse.y"
+{ finish_default_args (); ;
break;}
-case 450:
-#line 2042 "parse.y"
-{
- yyval.ftype.t = yyvsp[-3].ttype;
+case 476:
+#line 2122 "parse.y"
+{ yyval.ftype.t = yyvsp[-3].ttype;
yyval.ftype.new_type_flag = 1;
- if (current_class_type == NULL_TREE)
- clear_inline_text_obstack ();
-
- /* Undo the begin_tree in left_curly. */
- end_tree ();
- ;
+ begin_inline_definitions (); ;
break;}
-case 451:
-#line 2052 "parse.y"
+case 477:
+#line 2126 "parse.y"
{
yyval.ftype.new_type_flag = 0;
if (TYPE_BINFO (yyvsp[0].ttype) == NULL_TREE)
@@ -5904,82 +6089,97 @@ case 451:
}
;
break;}
-case 455:
-#line 2079 "parse.y"
+case 481:
+#line 2153 "parse.y"
{ if (pedantic && !in_system_header)
pedwarn ("comma at end of enumerator list"); ;
break;}
-case 457:
-#line 2086 "parse.y"
+case 483:
+#line 2160 "parse.y"
{ error ("storage class specifier `%s' not allowed after struct or class", IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
break;}
-case 458:
-#line 2088 "parse.y"
+case 484:
+#line 2162 "parse.y"
{ error ("type specifier `%s' not allowed after struct or class", IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
break;}
-case 459:
-#line 2090 "parse.y"
+case 485:
+#line 2164 "parse.y"
{ error ("type qualifier `%s' not allowed after struct or class", IDENTIFIER_POINTER (yyvsp[0].ttype)); ;
break;}
-case 460:
-#line 2092 "parse.y"
+case 486:
+#line 2166 "parse.y"
{ error ("no body nor ';' separates two class, struct or union declarations"); ;
break;}
-case 461:
-#line 2097 "parse.y"
-{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
+case 487:
+#line 2168 "parse.y"
+{ yyval.ttype = build_decl_list (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 462:
-#line 2102 "parse.y"
+case 488:
+#line 2173 "parse.y"
+{
+ current_aggr = yyvsp[-1].ttype;
+ yyval.ttype = yyvsp[0].ttype;
+ ;
+ break;}
+case 489:
+#line 2181 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 463:
-#line 2107 "parse.y"
+case 490:
+#line 2183 "parse.y"
+{ yyungetc ('{', 1); ;
+ break;}
+case 491:
+#line 2185 "parse.y"
+{ yyungetc (':', 1); ;
+ break;}
+case 492:
+#line 2190 "parse.y"
{
current_aggr = yyvsp[-2].ttype;
yyval.ttype = handle_class_head (yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 464:
-#line 2112 "parse.y"
+case 493:
+#line 2195 "parse.y"
{
current_aggr = yyvsp[-3].ttype;
yyval.ttype = handle_class_head (yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 465:
-#line 2117 "parse.y"
+case 494:
+#line 2200 "parse.y"
{
current_aggr = yyvsp[-2].ttype;
yyval.ttype = handle_class_head (yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype);
;
break;}
-case 466:
-#line 2122 "parse.y"
+case 495:
+#line 2205 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 467:
-#line 2124 "parse.y"
+case 496:
+#line 2207 "parse.y"
{ current_aggr = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 468:
-#line 2129 "parse.y"
-{ yyval.ttype = xref_tag (current_aggr, yyvsp[0].ttype, NULL_TREE, 0); ;
+case 497:
+#line 2212 "parse.y"
+{ yyval.ttype = xref_tag (current_aggr, yyvsp[0].ttype, 1); ;
break;}
-case 469:
-#line 2134 "parse.y"
-{ yyval.ttype = xref_tag (current_aggr, yyvsp[0].ttype, NULL_TREE, 1); ;
+case 498:
+#line 2214 "parse.y"
+{ yyval.ttype = xref_tag (current_aggr, yyvsp[0].ttype, 0); ;
break;}
-case 470:
-#line 2137 "parse.y"
+case 499:
+#line 2216 "parse.y"
{
yyval.ttype = yyvsp[-1].ttype;
if (yyvsp[0].ttype)
xref_basetypes (current_aggr, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 471:
-#line 2143 "parse.y"
+case 500:
+#line 2222 "parse.y"
{
yyval.ttype = TREE_TYPE (yyvsp[-1].ttype);
if (TREE_INT_CST_LOW (current_aggr) == union_type
@@ -5990,105 +6190,50 @@ case 471:
cp_pedwarn ("non-`union' tag used in declaring `%#T'", yyval.ttype);
if (yyvsp[0].ttype)
{
- if (IS_AGGR_TYPE (yyval.ttype) && CLASSTYPE_USE_TEMPLATE (yyval.ttype))
- {
- if (CLASSTYPE_IMPLICIT_INSTANTIATION (yyval.ttype)
- && TYPE_SIZE (yyval.ttype) == NULL_TREE)
- {
- SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (yyval.ttype);
- if (processing_template_decl)
- push_template_decl (TYPE_MAIN_DECL (yyval.ttype));
- }
- else if (CLASSTYPE_TEMPLATE_INSTANTIATION (yyval.ttype))
- cp_error ("specialization after instantiation of `%T'", yyval.ttype);
- }
+ maybe_process_partial_specialization (yyval.ttype);
xref_basetypes (current_aggr, yyvsp[-1].ttype, yyval.ttype, yyvsp[0].ttype);
}
;
break;}
-case 472:
-#line 2172 "parse.y"
-{ yyval.ttype = xref_tag (yyval.ttype, make_anon_name (), NULL_TREE, 0);
+case 501:
+#line 2240 "parse.y"
+{ yyval.ttype = xref_tag (yyval.ttype, make_anon_name (), 0);
yyungetc ('{', 1); ;
break;}
-case 475:
-#line 2183 "parse.y"
+case 504:
+#line 2251 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 476:
-#line 2185 "parse.y"
+case 505:
+#line 2253 "parse.y"
{ yyungetc(':', 1); yyval.ttype = NULL_TREE; ;
break;}
-case 477:
-#line 2187 "parse.y"
+case 506:
+#line 2255 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 479:
-#line 2193 "parse.y"
+case 508:
+#line 2261 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 480:
-#line 2198 "parse.y"
-{
- tree type = TREE_TYPE (yyvsp[0].ttype);
- if (! is_aggr_type (type, 1))
- yyval.ttype = NULL_TREE;
- else if (current_aggr == signature_type_node
- && (! type) && (! IS_SIGNATURE (type)))
- {
- error ("class name not allowed as base signature");
- yyval.ttype = NULL_TREE;
- }
- else if (current_aggr == signature_type_node)
- {
- sorry ("signature inheritance, base type `%s' ignored",
- IDENTIFIER_POINTER (yyval.ttype));
- yyval.ttype = build_tree_list (access_public_node, type);
- }
- else if (type && IS_SIGNATURE (type))
- {
- error ("signature name not allowed as base class");
- yyval.ttype = NULL_TREE;
- }
- else
- yyval.ttype = build_tree_list (access_default_node, type);
- ;
+case 509:
+#line 2266 "parse.y"
+{ yyval.ttype = finish_base_specifier (access_default_node, yyvsp[0].ttype,
+ current_aggr
+ == signature_type_node); ;
break;}
-case 481:
-#line 2223 "parse.y"
-{
- tree type = TREE_TYPE (yyvsp[0].ttype);
- if (current_aggr == signature_type_node)
- error ("access and source specifiers not allowed in signature");
- if (! IS_AGGR_TYPE (type))
- yyval.ttype = NULL_TREE;
- else if (current_aggr == signature_type_node
- && (! type) && (! IS_SIGNATURE (type)))
- {
- error ("class name not allowed as base signature");
- yyval.ttype = NULL_TREE;
- }
- else if (current_aggr == signature_type_node)
- {
- sorry ("signature inheritance, base type `%s' ignored",
- IDENTIFIER_POINTER (yyval.ttype));
- yyval.ttype = build_tree_list (access_public_node, type);
- }
- else if (type && IS_SIGNATURE (type))
- {
- error ("signature name not allowed as base class");
- yyval.ttype = NULL_TREE;
- }
- else
- yyval.ttype = build_tree_list (yyval.ttype, type);
- ;
+case 510:
+#line 2270 "parse.y"
+{ yyval.ttype = finish_base_specifier (yyvsp[-2].ttype, yyvsp[0].ttype,
+ current_aggr
+ == signature_type_node); ;
break;}
-case 482:
-#line 2253 "parse.y"
-{ yyval.ttype = TYPE_MAIN_DECL (yyvsp[0].ttype); ;
+case 511:
+#line 2277 "parse.y"
+{ if (yyval.ttype != error_mark_node) yyval.ttype = TYPE_MAIN_DECL (yyvsp[0].ttype); ;
break;}
-case 484:
-#line 2256 "parse.y"
+case 513:
+#line 2280 "parse.y"
{
if (current_aggr == signature_type_node)
{
@@ -6110,8 +6255,8 @@ case 484:
}
;
break;}
-case 485:
-#line 2277 "parse.y"
+case 514:
+#line 2301 "parse.y"
{
if (current_aggr == signature_type_node)
{
@@ -6133,14 +6278,14 @@ case 485:
}
;
break;}
-case 487:
-#line 2302 "parse.y"
+case 516:
+#line 2326 "parse.y"
{ if (yyvsp[-1].ttype != ridpointers[(int)RID_VIRTUAL])
cp_error ("`%D' access", yyvsp[-1].ttype);
yyval.ttype = access_default_virtual_node; ;
break;}
-case 488:
-#line 2306 "parse.y"
+case 517:
+#line 2330 "parse.y"
{
if (yyvsp[-2].ttype != access_default_virtual_node)
error ("multiple access specifiers");
@@ -6152,8 +6297,8 @@ case 488:
yyval.ttype = access_private_virtual_node;
;
break;}
-case 489:
-#line 2317 "parse.y"
+case 518:
+#line 2341 "parse.y"
{ if (yyvsp[-1].ttype != ridpointers[(int)RID_VIRTUAL])
cp_error ("`%D' access", yyvsp[-1].ttype);
else if (yyval.ttype == access_public_node)
@@ -6166,373 +6311,297 @@ case 489:
error ("multiple `virtual' specifiers");
;
break;}
-case 490:
-#line 2332 "parse.y"
-{ tree t = yyvsp[-1].ttype;
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
- if (t == error_mark_node
- || ! IS_AGGR_TYPE (t))
- {
- t = yyvsp[-1].ttype = make_lang_type (RECORD_TYPE);
- pushtag (make_anon_name (), t, 0);
- }
- if (TYPE_SIZE (t))
- duplicate_tag_error (t);
- if (TYPE_SIZE (t) || TYPE_BEING_DEFINED (t))
- {
- t = make_lang_type (TREE_CODE (t));
- pushtag (TYPE_IDENTIFIER (yyvsp[-1].ttype), t, 0);
- yyvsp[-1].ttype = t;
- }
- if (processing_template_decl && TYPE_CONTEXT (t)
- && ! current_class_type)
- push_template_decl (TYPE_STUB_DECL (t));
- pushclass (t, 0);
- TYPE_BEING_DEFINED (t) = 1;
- if (IS_AGGR_TYPE (t) && CLASSTYPE_USE_TEMPLATE (t))
- {
- if (CLASSTYPE_IMPLICIT_INSTANTIATION (t)
- && TYPE_SIZE (t) == NULL_TREE)
- {
- SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (t);
- if (processing_template_decl)
- push_template_decl (TYPE_MAIN_DECL (t));
- }
- else if (CLASSTYPE_TEMPLATE_INSTANTIATION (t))
- cp_error ("specialization after instantiation of `%T'", t);
- }
- /* Reset the interface data, at the earliest possible
- moment, as it might have been set via a class foo;
- before. */
- /* Don't change signatures. */
- if (! IS_SIGNATURE (t))
- {
- extern tree pending_vtables;
- int needs_writing;
- tree name = TYPE_IDENTIFIER (t);
-
- if (! ANON_AGGRNAME_P (name))
- {
- CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X
- (t, interface_unknown);
- }
-
- /* Record how to set the access of this class's
- virtual functions. If write_virtuals == 2 or 3, then
- inline virtuals are ``extern inline''. */
- switch (write_virtuals)
- {
- case 0:
- case 1:
- needs_writing = 1;
- break;
- case 2:
- needs_writing = !! value_member (name, pending_vtables);
- break;
- case 3:
- needs_writing = ! CLASSTYPE_INTERFACE_ONLY (t)
- && CLASSTYPE_INTERFACE_KNOWN (t);
- break;
- default:
- needs_writing = 0;
- }
- CLASSTYPE_VTABLE_NEEDS_WRITING (t) = needs_writing;
- }
-#if 0
- t = TYPE_IDENTIFIER (yyvsp[-1].ttype);
- if (t && IDENTIFIER_TEMPLATE (t))
- overload_template_name (t, 1);
-#endif
- reset_specialization();
-
- /* In case this is a local class within a template
- function, we save the current tree structure so
- that we can get it back later. */
- begin_tree ();
- ;
- break;}
-case 491:
-#line 2421 "parse.y"
-{
- yyval.ttype = build_self_reference ();
- ;
- break;}
-case 492:
-#line 2428 "parse.y"
-{ if (yyval.ttype) yyval.ttype = build_tree_list (access_public_node, yyval.ttype); ;
+case 519:
+#line 2356 "parse.y"
+{ yyvsp[-1].ttype = begin_class_definition (yyvsp[-1].ttype); ;
break;}
-case 493:
-#line 2430 "parse.y"
+case 520:
+#line 2361 "parse.y"
{
- if (current_aggr == signature_type_node)
- yyval.ttype = build_tree_list (access_public_node, yyvsp[0].ttype);
- else
- yyval.ttype = build_tree_list (access_default_node, yyvsp[0].ttype);
- if (yyvsp[-1].ttype) yyval.ttype = tree_cons (access_public_node, yyvsp[-1].ttype, yyval.ttype);
+ finish_member_declaration (build_self_reference ());
;
break;}
-case 494:
-#line 2438 "parse.y"
+case 525:
+#line 2375 "parse.y"
{
- tree visspec = yyvsp[-2].ttype;
-
if (current_aggr == signature_type_node)
{
error ("access specifier not allowed in signature");
- visspec = access_public_node;
+ yyvsp[-1].ttype = access_public_node;
}
- yyval.ttype = chainon (yyval.ttype, build_tree_list (visspec, yyvsp[0].ttype));
- ;
- break;}
-case 495:
-#line 2449 "parse.y"
-{
- if (current_aggr == signature_type_node)
- error ("access specifier not allowed in signature");
- ;
+
+ current_access_specifier = yyvsp[-1].ttype;
+ ;
break;}
-case 496:
-#line 2459 "parse.y"
-{ if (yyval.ttype == void_type_node) yyval.ttype = NULL_TREE;
+case 526:
+#line 2390 "parse.y"
+{
+ finish_member_declaration (yyvsp[0].ttype);
;
break;}
-case 497:
-#line 2462 "parse.y"
-{ /* In pushdecl, we created a reverse list of names
- in this binding level. Make sure that the chain
- of what we're trying to add isn't the item itself
- (which can happen with what pushdecl's doing). */
- if (yyvsp[0].ttype != NULL_TREE && yyvsp[0].ttype != void_type_node)
- {
- if (TREE_CHAIN (yyvsp[0].ttype) != yyval.ttype)
- yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype);
- else
- yyval.ttype = yyvsp[0].ttype;
- }
+case 527:
+#line 2394 "parse.y"
+{
+ finish_member_declaration (yyvsp[0].ttype);
;
break;}
-case 498:
-#line 2478 "parse.y"
-{ ;
- break;}
-case 499:
-#line 2480 "parse.y"
+case 529:
+#line 2402 "parse.y"
{ error ("missing ';' before right brace");
yyungetc ('}', 0); ;
break;}
-case 500:
-#line 2485 "parse.y"
+case 530:
+#line 2407 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
-case 501:
-#line 2487 "parse.y"
+case 531:
+#line 2409 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
-case 502:
-#line 2489 "parse.y"
+case 532:
+#line 2411 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
-case 503:
-#line 2491 "parse.y"
+case 533:
+#line 2413 "parse.y"
{ yyval.ttype = finish_method (yyval.ttype); ;
break;}
-case 504:
-#line 2493 "parse.y"
+case 534:
+#line 2415 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 505:
-#line 2495 "parse.y"
+case 535:
+#line 2417 "parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
-case 506:
-#line 2498 "parse.y"
-{ yyval.ttype = finish_member_template_decl (yyvsp[-1].ttype, yyvsp[0].ttype); ;
+case 536:
+#line 2420 "parse.y"
+{
+ if (yyvsp[0].ttype)
+ yyval.ttype = finish_member_template_decl (yyvsp[0].ttype);
+ else
+ /* The component was already processed. */
+ yyval.ttype = NULL_TREE;
+
+ finish_template_decl (yyvsp[-1].ttype);
+ ;
break;}
-case 507:
-#line 2500 "parse.y"
-{
- note_list_got_semicolon (yyvsp[-1].ftype.t);
- grok_x_components (yyvsp[-1].ftype.t, NULL_TREE);
- if (TYPE_CONTEXT (TREE_VALUE (yyvsp[-1].ftype.t)) != current_class_type)
- /* The component was in fact a friend
- declaration. */
- yyvsp[-1].ftype.t = NULL_TREE;
- yyval.ttype = finish_member_template_decl (yyvsp[-2].ttype, yyvsp[-1].ftype.t);
+case 537:
+#line 2430 "parse.y"
+{
+ yyval.ttype = finish_member_class_template (yyvsp[-1].ftype.t);
+ finish_template_decl (yyvsp[-2].ttype);
;
break;}
-case 508:
-#line 2516 "parse.y"
-{ yyval.ttype = grok_x_components (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
+case 538:
+#line 2441 "parse.y"
+{
+ /* Most of the productions for component_decl only
+ allow the creation of one new member, so we call
+ finish_member_declaration in component_decl_list.
+ For this rule and the next, however, there can be
+ more than one member, e.g.:
+
+ int i, j;
+
+ and we need the first member to be fully
+ registered before the second is processed.
+ Therefore, the rules for components take care of
+ this processing. To avoid registering the
+ components more than once, we send NULL_TREE up
+ here; that lets finish_member_declaration now
+ that there is nothing to do. */
+ if (!yyvsp[0].itype)
+ grok_x_components (yyvsp[-1].ftype.t);
+ yyval.ttype = NULL_TREE;
+ ;
break;}
-case 509:
-#line 2518 "parse.y"
-{ yyval.ttype = grok_x_components (yyvsp[-1].ttype, yyvsp[0].ttype); ;
+case 539:
+#line 2462 "parse.y"
+{
+ if (!yyvsp[0].itype)
+ grok_x_components (yyvsp[-1].ttype);
+ yyval.ttype = NULL_TREE;
+ ;
break;}
-case 510:
-#line 2520 "parse.y"
+case 540:
+#line 2468 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
-case 511:
-#line 2523 "parse.y"
+case 541:
+#line 2471 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
-case 512:
-#line 2526 "parse.y"
+case 542:
+#line 2474 "parse.y"
{ yyval.ttype = grokbitfield (NULL_TREE, NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 513:
-#line 2528 "parse.y"
+case 543:
+#line 2476 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 514:
-#line 2539 "parse.y"
+case 544:
+#line 2487 "parse.y"
{ tree specs, attrs;
split_specs_attrs (yyvsp[-4].ttype, &specs, &attrs);
yyval.ttype = grokfield (yyvsp[-3].ttype, specs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, attrs)); ;
break;}
-case 515:
-#line 2544 "parse.y"
+case 545:
+#line 2492 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
-case 516:
-#line 2547 "parse.y"
+case 546:
+#line 2495 "parse.y"
{ yyval.ttype = do_class_using_decl (yyvsp[0].ttype); ;
break;}
-case 517:
-#line 2553 "parse.y"
-{ yyval.ttype = NULL_TREE; ;
+case 547:
+#line 2501 "parse.y"
+{ yyval.itype = 0; ;
break;}
-case 519:
-#line 2556 "parse.y"
-{
- /* In this context, void_type_node encodes
- friends. They have been recorded elsewhere. */
- if (yyval.ttype == void_type_node)
- yyval.ttype = yyvsp[0].ttype;
- else
- yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype);
+case 548:
+#line 2503 "parse.y"
+{
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ yyvsp[0].ttype = finish_member_template_decl (yyvsp[0].ttype);
+ finish_member_declaration (yyvsp[0].ttype);
+ yyval.itype = 1;
;
break;}
-case 520:
-#line 2568 "parse.y"
-{ yyval.ttype = NULL_TREE; ;
+case 549:
+#line 2510 "parse.y"
+{
+ check_multiple_declarators ();
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ yyvsp[0].ttype = finish_member_template_decl (yyvsp[0].ttype);
+ finish_member_declaration (yyvsp[0].ttype);
+ yyval.itype = 2;
+ ;
break;}
-case 522:
-#line 2571 "parse.y"
-{
- /* In this context, void_type_node encodes
- friends. They have been recorded elsewhere. */
- if (yyval.ttype == void_type_node)
- yyval.ttype = yyvsp[0].ttype;
- else
- yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype);
+case 550:
+#line 2521 "parse.y"
+{ yyval.itype = 0; ;
+ break;}
+case 551:
+#line 2523 "parse.y"
+{
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ yyvsp[0].ttype = finish_member_template_decl (yyvsp[0].ttype);
+ finish_member_declaration (yyvsp[0].ttype);
+ yyval.itype = 1;
;
break;}
-case 527:
-#line 2593 "parse.y"
+case 552:
+#line 2530 "parse.y"
+{
+ check_multiple_declarators ();
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ yyvsp[0].ttype = finish_member_template_decl (yyvsp[0].ttype);
+ finish_member_declaration (yyvsp[0].ttype);
+ yyval.itype = 2;
+ ;
+ break;}
+case 557:
+#line 2551 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
-case 528:
-#line 2599 "parse.y"
+case 558:
+#line 2557 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 529:
-#line 2608 "parse.y"
+case 559:
+#line 2566 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
-case 530:
-#line 2614 "parse.y"
+case 560:
+#line 2572 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
-case 531:
-#line 2620 "parse.y"
+case 561:
+#line 2578 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 532:
-#line 2626 "parse.y"
+case 562:
+#line 2584 "parse.y"
{ split_specs_attrs (yyvsp[-3].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-3].ttype = current_declspecs;
yyval.ttype = grokbitfield (NULL_TREE, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 533:
-#line 2635 "parse.y"
+case 563:
+#line 2593 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
-case 534:
-#line 2638 "parse.y"
+case 564:
+#line 2596 "parse.y"
{ yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 535:
-#line 2644 "parse.y"
+case 565:
+#line 2602 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
-case 536:
-#line 2647 "parse.y"
+case 566:
+#line 2605 "parse.y"
{ yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 537:
-#line 2650 "parse.y"
+case 567:
+#line 2608 "parse.y"
{ yyval.ttype = grokbitfield (NULL_TREE, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 539:
-#line 2661 "parse.y"
+case 569:
+#line 2619 "parse.y"
{ TREE_CHAIN (yyvsp[0].ttype) = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 540:
-#line 2666 "parse.y"
-{ yyval.ttype = build_enumerator (yyval.ttype, NULL_TREE); ;
+case 570:
+#line 2624 "parse.y"
+{ yyval.ttype = build_enumerator (yyval.ttype, NULL_TREE, current_enum_type); ;
break;}
-case 541:
-#line 2668 "parse.y"
-{ yyval.ttype = build_enumerator (yyval.ttype, yyvsp[0].ttype); ;
+case 571:
+#line 2626 "parse.y"
+{ yyval.ttype = build_enumerator (yyval.ttype, yyvsp[0].ttype, current_enum_type); ;
break;}
-case 542:
-#line 2674 "parse.y"
+case 572:
+#line 2632 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 543:
-#line 2677 "parse.y"
+case 573:
+#line 2635 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 544:
-#line 2682 "parse.y"
+case 574:
+#line 2642 "parse.y"
{
if (pedantic)
pedwarn ("ANSI C++ forbids array dimensions with parenthesized type in new");
@@ -6541,72 +6610,72 @@ case 544:
yyval.ftype.new_type_flag = yyvsp[-4].ftype.new_type_flag;
;
break;}
-case 545:
-#line 2693 "parse.y"
+case 575:
+#line 2653 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 546:
-#line 2695 "parse.y"
+case 576:
+#line 2655 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
-case 547:
-#line 2700 "parse.y"
+case 577:
+#line 2660 "parse.y"
{ yyval.ftype.t = IDENTIFIER_AS_LIST (yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
-case 548:
-#line 2703 "parse.y"
+case 578:
+#line 2663 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 549:
-#line 2712 "parse.y"
+case 579:
+#line 2672 "parse.y"
{ yyval.itype = suspend_momentary (); ;
break;}
-case 550:
-#line 2717 "parse.y"
+case 580:
+#line 2677 "parse.y"
{ resume_momentary ((int) yyvsp[-1].itype); yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 551:
-#line 2723 "parse.y"
+case 581:
+#line 2683 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 552:
-#line 2725 "parse.y"
+case 582:
+#line 2685 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 553:
-#line 2727 "parse.y"
+case 583:
+#line 2687 "parse.y"
{ resume_momentary ((int) yyvsp[-1].itype); yyval.ttype = empty_parms (); ;
break;}
-case 554:
-#line 2729 "parse.y"
+case 584:
+#line 2689 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = NULL_TREE; ;
break;}
-case 555:
-#line 2736 "parse.y"
+case 585:
+#line 2696 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 556:
-#line 2738 "parse.y"
+case 586:
+#line 2698 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 557:
-#line 2740 "parse.y"
+case 587:
+#line 2700 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 558:
-#line 2742 "parse.y"
+case 588:
+#line 2702 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 559:
-#line 2744 "parse.y"
+case 589:
+#line 2704 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
-case 561:
-#line 2752 "parse.y"
+case 591:
+#line 2712 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
{
@@ -6624,8 +6693,8 @@ case 561:
yyval.ttype = yyvsp[0].ttype;
;
break;}
-case 562:
-#line 2769 "parse.y"
+case 592:
+#line 2729 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
yyval.ttype = IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype);
@@ -6634,162 +6703,153 @@ case 562:
got_scope = NULL_TREE;
;
break;}
-case 565:
-#line 2782 "parse.y"
+case 595:
+#line 2742 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 566:
-#line 2787 "parse.y"
+case 596:
+#line 2747 "parse.y"
{ yyval.ttype = get_type_decl (yyvsp[0].ttype); ;
break;}
-case 567:
-#line 2792 "parse.y"
+case 597:
+#line 2752 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 568:
-#line 2794 "parse.y"
+case 598:
+#line 2754 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 569:
-#line 2796 "parse.y"
+case 599:
+#line 2756 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
-case 570:
-#line 2798 "parse.y"
+case 600:
+#line 2758 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 571:
-#line 2800 "parse.y"
+case 601:
+#line 2760 "parse.y"
{ push_nested_class (yyvsp[-1].ttype, 3);
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype);
TREE_COMPLEXITY (yyval.ttype) = current_class_depth; ;
break;}
-case 573:
-#line 2811 "parse.y"
+case 603:
+#line 2771 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 574:
-#line 2813 "parse.y"
+case 604:
+#line 2773 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 575:
-#line 2815 "parse.y"
+case 605:
+#line 2775 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 576:
-#line 2817 "parse.y"
+case 606:
+#line 2777 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 577:
-#line 2819 "parse.y"
+case 607:
+#line 2779 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
-case 579:
-#line 2827 "parse.y"
+case 609:
+#line 2787 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 580:
-#line 2829 "parse.y"
+case 610:
+#line 2789 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 581:
-#line 2831 "parse.y"
+case 611:
+#line 2791 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 582:
-#line 2833 "parse.y"
+case 612:
+#line 2793 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 583:
-#line 2835 "parse.y"
+case 613:
+#line 2795 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
-case 585:
-#line 2843 "parse.y"
+case 615:
+#line 2803 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 586:
-#line 2845 "parse.y"
+case 616:
+#line 2805 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 587:
-#line 2847 "parse.y"
+case 617:
+#line 2807 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 588:
-#line 2849 "parse.y"
+case 618:
+#line 2809 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
-case 589:
-#line 2851 "parse.y"
-{ if (OP0 (yyval.ttype) != current_class_type)
- {
- push_nested_class (OP0 (yyval.ttype), 3);
- TREE_COMPLEXITY (yyval.ttype) = current_class_depth;
- }
- ;
+case 619:
+#line 2811 "parse.y"
+{ enter_scope_of (yyvsp[0].ttype); ;
break;}
-case 590:
-#line 2858 "parse.y"
+case 620:
+#line 2813 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype);
- if (yyvsp[-1].ttype != current_class_type)
- {
- push_nested_class (yyvsp[-1].ttype, 3);
- TREE_COMPLEXITY (yyval.ttype) = current_class_depth;
- }
+ enter_scope_of (yyval.ttype);
;
break;}
-case 591:
-#line 2870 "parse.y"
+case 621:
+#line 2821 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 592:
-#line 2873 "parse.y"
+case 622:
+#line 2824 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 593:
-#line 2879 "parse.y"
+case 623:
+#line 2830 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 594:
-#line 2882 "parse.y"
+case 624:
+#line 2833 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 596:
-#line 2889 "parse.y"
+case 626:
+#line 2840 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 597:
-#line 2894 "parse.y"
+case 627:
+#line 2845 "parse.y"
{ yyval.ttype = build_functional_cast (yyvsp[-3].ftype.t, yyvsp[-1].ttype); ;
break;}
-case 598:
-#line 2896 "parse.y"
+case 628:
+#line 2847 "parse.y"
{ yyval.ttype = reparse_decl_as_expr (yyvsp[-3].ftype.t, yyvsp[-1].ttype); ;
break;}
-case 599:
-#line 2898 "parse.y"
+case 629:
+#line 2849 "parse.y"
{ yyval.ttype = reparse_absdcl_as_expr (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 604:
-#line 2910 "parse.y"
+case 634:
+#line 2860 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 605:
-#line 2912 "parse.y"
+case 635:
+#line 2862 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 606:
-#line 2919 "parse.y"
+case 636:
+#line 2869 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
{
@@ -6801,35 +6861,35 @@ case 606:
&& ! IDENTIFIER_CLASS_VALUE (yyvsp[-1].ttype))
pushdecl_class_level (yyval.ttype);
}
- got_scope = yyval.ttype = TREE_TYPE (yyval.ttype);
+ got_scope = yyval.ttype = TYPE_MAIN_VARIANT (TREE_TYPE (yyval.ttype));
;
break;}
-case 607:
-#line 2933 "parse.y"
+case 637:
+#line 2883 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
got_scope = yyval.ttype = TREE_TYPE (yyval.ttype);
;
break;}
-case 608:
-#line 2939 "parse.y"
+case 638:
+#line 2889 "parse.y"
{
if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
got_scope = yyval.ttype;
;
break;}
-case 609:
-#line 2945 "parse.y"
+case 639:
+#line 2895 "parse.y"
{ got_scope = yyval.ttype = complete_type (TREE_TYPE (yyvsp[-1].ttype)); ;
break;}
-case 611:
-#line 2961 "parse.y"
+case 641:
+#line 2911 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 612:
-#line 2966 "parse.y"
+case 642:
+#line 2916 "parse.y"
{
if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype);
@@ -6843,27 +6903,27 @@ case 612:
}
;
break;}
-case 613:
-#line 2979 "parse.y"
+case 643:
+#line 2929 "parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[0].ttype); ;
break;}
-case 614:
-#line 2981 "parse.y"
+case 644:
+#line 2931 "parse.y"
{ yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 615:
-#line 2983 "parse.y"
+case 645:
+#line 2933 "parse.y"
{ yyval.ttype = make_typename_type (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 616:
-#line 2988 "parse.y"
+case 646:
+#line 2938 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
;
break;}
-case 617:
-#line 2993 "parse.y"
+case 647:
+#line 2943 "parse.y"
{
if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype);
@@ -6877,52 +6937,54 @@ case 617:
}
;
break;}
-case 618:
-#line 3006 "parse.y"
+case 648:
+#line 2956 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 619:
-#line 3008 "parse.y"
+case 649:
+#line 2958 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 620:
-#line 3013 "parse.y"
+case 650:
+#line 2963 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) != IDENTIFIER_NODE)
yyvsp[-1].ttype = lastiddecl;
- got_scope = yyval.ttype = complete_type (TREE_TYPE (yyvsp[-1].ttype));
+ /* Retrieve the type for the identifier, which might involve
+ some computation. */
+ got_scope = yyval.ttype = complete_type (IDENTIFIER_TYPE_VALUE (yyvsp[-1].ttype));
if (yyval.ttype == error_mark_node)
cp_error ("`%T' is not a class or namespace", yyvsp[-1].ttype);
;
break;}
-case 621:
-#line 3023 "parse.y"
+case 651:
+#line 2975 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) != IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
got_scope = yyval.ttype = complete_type (TREE_TYPE (yyval.ttype));
;
break;}
-case 622:
-#line 3029 "parse.y"
+case 652:
+#line 2981 "parse.y"
{ got_scope = yyval.ttype = complete_type (TREE_TYPE (yyval.ttype)); ;
break;}
-case 625:
-#line 3033 "parse.y"
+case 655:
+#line 2985 "parse.y"
{
if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
got_scope = yyval.ttype;
;
break;}
-case 626:
-#line 3042 "parse.y"
+case 656:
+#line 2994 "parse.y"
{ yyval.ttype = build_min_nt (TEMPLATE_ID_EXPR, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 627:
-#line 3047 "parse.y"
+case 657:
+#line 2999 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
yyval.ttype = IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype);
@@ -6931,149 +6993,149 @@ case 627:
got_scope = NULL_TREE;
;
break;}
-case 629:
-#line 3056 "parse.y"
+case 659:
+#line 3008 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 630:
-#line 3061 "parse.y"
+case 660:
+#line 3013 "parse.y"
{ got_scope = NULL_TREE; ;
break;}
-case 631:
-#line 3063 "parse.y"
+case 661:
+#line 3015 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; got_scope = NULL_TREE; ;
break;}
-case 632:
-#line 3070 "parse.y"
+case 662:
+#line 3022 "parse.y"
{ got_scope = void_type_node; ;
break;}
-case 633:
-#line 3076 "parse.y"
+case 663:
+#line 3028 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 634:
-#line 3078 "parse.y"
+case 664:
+#line 3030 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 635:
-#line 3080 "parse.y"
+case 665:
+#line 3032 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 636:
-#line 3082 "parse.y"
+case 666:
+#line 3034 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 637:
-#line 3084 "parse.y"
+case 667:
+#line 3036 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, arg);
;
break;}
-case 638:
-#line 3088 "parse.y"
+case 668:
+#line 3040 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
-case 640:
-#line 3097 "parse.y"
+case 670:
+#line 3049 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 641:
-#line 3099 "parse.y"
+case 671:
+#line 3051 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 642:
-#line 3105 "parse.y"
+case 672:
+#line 3057 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 643:
-#line 3107 "parse.y"
+case 673:
+#line 3059 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 644:
-#line 3109 "parse.y"
+case 674:
+#line 3061 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ftype.t, NULL_TREE); ;
break;}
-case 645:
-#line 3111 "parse.y"
+case 675:
+#line 3063 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, NULL_TREE); ;
break;}
-case 646:
-#line 3113 "parse.y"
+case 676:
+#line 3065 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 647:
-#line 3115 "parse.y"
+case 677:
+#line 3067 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 648:
-#line 3117 "parse.y"
+case 678:
+#line 3069 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[0].ftype.t, NULL_TREE); ;
break;}
-case 649:
-#line 3119 "parse.y"
+case 679:
+#line 3071 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, NULL_TREE); ;
break;}
-case 650:
-#line 3121 "parse.y"
+case 680:
+#line 3073 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, arg);
;
break;}
-case 651:
-#line 3125 "parse.y"
+case 681:
+#line 3077 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
-case 653:
-#line 3134 "parse.y"
+case 683:
+#line 3086 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 655:
-#line 3138 "parse.y"
+case 685:
+#line 3090 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 656:
-#line 3140 "parse.y"
+case 686:
+#line 3092 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 657:
-#line 3142 "parse.y"
+case 687:
+#line 3094 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 658:
-#line 3144 "parse.y"
+case 688:
+#line 3096 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
-case 659:
-#line 3146 "parse.y"
+case 689:
+#line 3098 "parse.y"
{ yyval.ttype = make_call_declarator (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 660:
-#line 3148 "parse.y"
+case 690:
+#line 3100 "parse.y"
{ set_quals_and_spec (yyval.ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 661:
-#line 3150 "parse.y"
+case 691:
+#line 3102 "parse.y"
{ set_quals_and_spec (yyval.ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 662:
-#line 3152 "parse.y"
+case 692:
+#line 3104 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 663:
-#line 3154 "parse.y"
+case 693:
+#line 3106 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
-case 670:
-#line 3177 "parse.y"
+case 700:
+#line 3129 "parse.y"
{ if (pedantic)
pedwarn ("ANSI C++ forbids label declarations"); ;
break;}
-case 673:
-#line 3188 "parse.y"
+case 703:
+#line 3140 "parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -7083,220 +7145,226 @@ case 673:
}
;
break;}
-case 674:
-#line 3202 "parse.y"
+case 704:
+#line 3154 "parse.y"
{;
break;}
-case 676:
-#line 3208 "parse.y"
+case 706:
+#line 3160 "parse.y"
{ yyval.ttype = begin_compound_stmt (0); ;
break;}
-case 677:
-#line 3210 "parse.y"
+case 707:
+#line 3162 "parse.y"
{ yyval.ttype = finish_compound_stmt (0, yyvsp[-1].ttype); ;
break;}
-case 678:
-#line 3215 "parse.y"
+case 708:
+#line 3167 "parse.y"
{
yyval.ttype = begin_if_stmt ();
cond_stmt_keyword = "if";
;
break;}
-case 679:
-#line 3220 "parse.y"
+case 709:
+#line 3172 "parse.y"
{ finish_if_stmt_cond (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 680:
-#line 3222 "parse.y"
+case 710:
+#line 3174 "parse.y"
{ yyval.ttype = finish_then_clause (yyvsp[-3].ttype); ;
break;}
-case 682:
-#line 3227 "parse.y"
+case 712:
+#line 3179 "parse.y"
{ yyval.ttype = begin_compound_stmt (0); ;
break;}
-case 683:
-#line 3229 "parse.y"
+case 713:
+#line 3181 "parse.y"
{ yyval.ttype = finish_compound_stmt (0, yyvsp[-1].ttype); ;
break;}
-case 684:
-#line 3234 "parse.y"
+case 714:
+#line 3186 "parse.y"
{;
break;}
-case 686:
-#line 3240 "parse.y"
+case 716:
+#line 3192 "parse.y"
{ finish_stmt (); ;
break;}
-case 687:
-#line 3242 "parse.y"
+case 717:
+#line 3194 "parse.y"
{ finish_expr_stmt (yyvsp[-1].ttype); ;
break;}
-case 688:
-#line 3244 "parse.y"
+case 718:
+#line 3196 "parse.y"
{ begin_else_clause (); ;
break;}
-case 689:
-#line 3246 "parse.y"
+case 719:
+#line 3198 "parse.y"
{
finish_else_clause (yyvsp[-3].ttype);
finish_if_stmt ();
;
break;}
-case 690:
-#line 3251 "parse.y"
+case 720:
+#line 3203 "parse.y"
{ finish_if_stmt (); ;
break;}
-case 691:
-#line 3253 "parse.y"
+case 721:
+#line 3205 "parse.y"
{
yyval.ttype = begin_while_stmt ();
cond_stmt_keyword = "while";
;
break;}
-case 692:
-#line 3258 "parse.y"
+case 722:
+#line 3210 "parse.y"
{ finish_while_stmt_cond (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 693:
-#line 3260 "parse.y"
+case 723:
+#line 3212 "parse.y"
{ finish_while_stmt (yyvsp[-3].ttype); ;
break;}
-case 694:
-#line 3262 "parse.y"
+case 724:
+#line 3214 "parse.y"
{ yyval.ttype = begin_do_stmt (); ;
break;}
-case 695:
-#line 3264 "parse.y"
+case 725:
+#line 3216 "parse.y"
{
finish_do_body (yyvsp[-2].ttype);
cond_stmt_keyword = "do";
;
break;}
-case 696:
-#line 3269 "parse.y"
+case 726:
+#line 3221 "parse.y"
{ finish_do_stmt (yyvsp[-1].ttype, yyvsp[-5].ttype); ;
break;}
-case 697:
-#line 3271 "parse.y"
+case 727:
+#line 3223 "parse.y"
{ yyval.ttype = begin_for_stmt (); ;
break;}
-case 698:
-#line 3273 "parse.y"
+case 728:
+#line 3225 "parse.y"
{ finish_for_init_stmt (yyvsp[-2].ttype); ;
break;}
-case 699:
-#line 3275 "parse.y"
+case 729:
+#line 3227 "parse.y"
{ finish_for_cond (yyvsp[-1].ttype, yyvsp[-5].ttype); ;
break;}
-case 700:
-#line 3277 "parse.y"
+case 730:
+#line 3229 "parse.y"
{ finish_for_expr (yyvsp[-1].ttype, yyvsp[-8].ttype); ;
break;}
-case 701:
-#line 3279 "parse.y"
+case 731:
+#line 3231 "parse.y"
{ finish_for_stmt (yyvsp[-3].ttype, yyvsp[-10].ttype); ;
break;}
-case 702:
-#line 3281 "parse.y"
+case 732:
+#line 3233 "parse.y"
{ begin_switch_stmt (); ;
break;}
-case 703:
-#line 3283 "parse.y"
+case 733:
+#line 3235 "parse.y"
{ yyval.ttype = finish_switch_cond (yyvsp[-1].ttype); ;
break;}
-case 704:
-#line 3285 "parse.y"
+case 734:
+#line 3237 "parse.y"
{ finish_switch_stmt (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 705:
-#line 3287 "parse.y"
+case 735:
+#line 3239 "parse.y"
{ finish_case_label (yyvsp[-1].ttype, NULL_TREE); ;
break;}
-case 707:
-#line 3290 "parse.y"
+case 737:
+#line 3242 "parse.y"
{ finish_case_label (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 709:
-#line 3293 "parse.y"
+case 739:
+#line 3245 "parse.y"
{ finish_case_label (NULL_TREE, NULL_TREE); ;
break;}
-case 711:
-#line 3296 "parse.y"
+case 741:
+#line 3248 "parse.y"
{ finish_break_stmt (); ;
break;}
-case 712:
-#line 3298 "parse.y"
+case 742:
+#line 3250 "parse.y"
{ finish_continue_stmt (); ;
break;}
-case 713:
-#line 3300 "parse.y"
+case 743:
+#line 3252 "parse.y"
{ finish_return_stmt (NULL_TREE); ;
break;}
-case 714:
-#line 3302 "parse.y"
+case 744:
+#line 3254 "parse.y"
{ finish_return_stmt (yyvsp[-1].ttype); ;
break;}
-case 715:
-#line 3304 "parse.y"
+case 745:
+#line 3256 "parse.y"
{
finish_asm_stmt (yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, NULL_TREE,
NULL_TREE);
;
break;}
-case 716:
-#line 3310 "parse.y"
+case 746:
+#line 3262 "parse.y"
{
finish_asm_stmt (yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE,
NULL_TREE);
;
break;}
-case 717:
-#line 3316 "parse.y"
+case 747:
+#line 3268 "parse.y"
{ finish_asm_stmt (yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
-case 718:
-#line 3320 "parse.y"
+case 748:
+#line 3272 "parse.y"
{ finish_asm_stmt (yyvsp[-10].ttype, yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype); ;
break;}
-case 719:
-#line 3322 "parse.y"
+case 749:
+#line 3274 "parse.y"
{
if (pedantic)
pedwarn ("ANSI C++ forbids computed gotos");
finish_goto_stmt (yyvsp[-1].ttype);
;
break;}
-case 720:
-#line 3328 "parse.y"
+case 750:
+#line 3280 "parse.y"
{ finish_goto_stmt (yyvsp[-1].ttype); ;
break;}
-case 721:
-#line 3330 "parse.y"
+case 751:
+#line 3282 "parse.y"
{ finish_stmt (); ;
break;}
-case 722:
-#line 3332 "parse.y"
+case 752:
+#line 3284 "parse.y"
{ error ("label must be followed by statement");
yyungetc ('}', 0);
finish_stmt (); ;
break;}
-case 723:
-#line 3336 "parse.y"
+case 753:
+#line 3288 "parse.y"
{ finish_stmt (); ;
break;}
-case 725:
-#line 3342 "parse.y"
+case 756:
+#line 3292 "parse.y"
+{ do_local_using_decl (yyvsp[0].ttype); ;
+ break;}
+case 758:
+#line 3298 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
expand_start_early_try_stmts ();
;
break;}
-case 726:
-#line 3348 "parse.y"
-{ expand_start_all_catch (); ;
+case 759:
+#line 3304 "parse.y"
+{
+ expand_start_all_catch ();
+ ;
break;}
-case 727:
-#line 3350 "parse.y"
+case 760:
+#line 3308 "parse.y"
{
int nested = (hack_decl_function_context
(current_function_decl) != NULL_TREE);
@@ -7304,42 +7372,42 @@ case 727:
finish_function (lineno, (int)yyvsp[-3].itype, nested);
;
break;}
-case 728:
-#line 3360 "parse.y"
+case 761:
+#line 3318 "parse.y"
{ yyval.ttype = begin_try_block (); ;
break;}
-case 729:
-#line 3362 "parse.y"
+case 762:
+#line 3320 "parse.y"
{ finish_try_block (yyvsp[-1].ttype); ;
break;}
-case 730:
-#line 3364 "parse.y"
+case 763:
+#line 3322 "parse.y"
{ finish_handler_sequence (yyvsp[-3].ttype); ;
break;}
-case 733:
-#line 3374 "parse.y"
+case 766:
+#line 3332 "parse.y"
{ yyval.ttype = begin_handler(); ;
break;}
-case 734:
-#line 3376 "parse.y"
+case 767:
+#line 3334 "parse.y"
{ finish_handler_parms (yyvsp[-1].ttype); ;
break;}
-case 735:
-#line 3378 "parse.y"
+case 768:
+#line 3336 "parse.y"
{ finish_handler (yyvsp[-3].ttype); ;
break;}
-case 738:
-#line 3388 "parse.y"
+case 771:
+#line 3346 "parse.y"
{ expand_start_catch_block (NULL_TREE, NULL_TREE); ;
break;}
-case 739:
-#line 3404 "parse.y"
+case 772:
+#line 3362 "parse.y"
{ check_for_new_type ("inside exception declarations", yyvsp[-1].ftype);
expand_start_catch_block (TREE_PURPOSE (yyvsp[-1].ftype.t),
TREE_VALUE (yyvsp[-1].ftype.t)); ;
break;}
-case 740:
-#line 3411 "parse.y"
+case 773:
+#line 3369 "parse.y"
{ tree label;
do_label:
label = define_label (input_filename, lineno, yyvsp[-1].ttype);
@@ -7347,247 +7415,215 @@ case 740:
expand_label (label);
;
break;}
-case 741:
-#line 3418 "parse.y"
+case 774:
+#line 3376 "parse.y"
{ goto do_label; ;
break;}
-case 742:
-#line 3420 "parse.y"
+case 775:
+#line 3378 "parse.y"
{ goto do_label; ;
break;}
-case 743:
-#line 3422 "parse.y"
+case 776:
+#line 3380 "parse.y"
{ goto do_label; ;
break;}
-case 744:
-#line 3427 "parse.y"
+case 777:
+#line 3385 "parse.y"
{ if (yyvsp[-1].ttype) cplus_expand_expr_stmt (yyvsp[-1].ttype); ;
break;}
-case 746:
-#line 3430 "parse.y"
+case 779:
+#line 3388 "parse.y"
{ if (pedantic)
pedwarn ("ANSI C++ forbids compound statements inside for initializations");
;
break;}
-case 747:
-#line 3439 "parse.y"
+case 780:
+#line 3397 "parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
-case 748:
-#line 3442 "parse.y"
+case 781:
+#line 3400 "parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
-case 749:
-#line 3447 "parse.y"
+case 782:
+#line 3405 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 751:
-#line 3450 "parse.y"
+case 784:
+#line 3408 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 752:
-#line 3457 "parse.y"
+case 785:
+#line 3415 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 755:
-#line 3464 "parse.y"
+case 788:
+#line 3422 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
-case 756:
-#line 3469 "parse.y"
+case 789:
+#line 3427 "parse.y"
{ yyval.ttype = build_tree_list (yyval.ttype, yyvsp[-1].ttype); ;
break;}
-case 757:
-#line 3474 "parse.y"
+case 790:
+#line 3432 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyval.ttype, NULL_TREE); ;
break;}
-case 758:
-#line 3476 "parse.y"
+case 791:
+#line 3434 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
-case 759:
-#line 3487 "parse.y"
+case 792:
+#line 3445 "parse.y"
{
yyval.ttype = empty_parms();
;
break;}
-case 761:
-#line 3492 "parse.y"
-{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ftype.t, void_list_node);
- TREE_PARMLIST (yyval.ttype) = 1;
+case 794:
+#line 3450 "parse.y"
+{ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE, yyvsp[0].ftype.t), 0);
check_for_new_type ("inside parameter list", yyvsp[0].ftype); ;
break;}
-case 762:
-#line 3501 "parse.y"
-{
- yyval.ttype = chainon (yyval.ttype, void_list_node);
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
- break;}
-case 763:
-#line 3506 "parse.y"
-{
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
- break;}
-case 764:
-#line 3511 "parse.y"
-{
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
- break;}
-case 765:
-#line 3515 "parse.y"
-{
- yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t);
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
+case 795:
+#line 3458 "parse.y"
+{ yyval.ttype = finish_parmlist (yyval.ttype, 0); ;
break;}
-case 766:
-#line 3520 "parse.y"
-{
- yyval.ttype = NULL_TREE;
- ;
+case 796:
+#line 3460 "parse.y"
+{ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ;
break;}
-case 767:
-#line 3524 "parse.y"
-{
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
+case 797:
+#line 3463 "parse.y"
+{ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 1); ;
break;}
-case 768:
-#line 3528 "parse.y"
-{
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
+case 798:
+#line 3465 "parse.y"
+{ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE,
+ yyvsp[-1].ftype.t), 1); ;
break;}
-case 769:
-#line 3532 "parse.y"
-{
- yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t);
- TREE_PARMLIST (yyval.ttype) = 1;
- ;
+case 799:
+#line 3468 "parse.y"
+{ yyval.ttype = finish_parmlist (NULL_TREE, 1); ;
break;}
-case 770:
-#line 3537 "parse.y"
+case 800:
+#line 3470 "parse.y"
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
parenthesis. */
yyerror ("possibly missing ')'");
- yyval.ttype = chainon (yyval.ttype, void_list_node);
- TREE_PARMLIST (yyval.ttype) = 1;
+ yyval.ttype = finish_parmlist (yyvsp[-1].ttype, 0);
yyungetc (':', 0);
yychar = ')';
;
break;}
-case 771:
-#line 3548 "parse.y"
+case 801:
+#line 3480 "parse.y"
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
parenthesis. */
yyerror ("possibly missing ')'");
- yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ftype.t, void_list_node);
- TREE_PARMLIST (yyval.ttype) = 1;
+ yyval.ttype = finish_parmlist (build_tree_list (NULL_TREE,
+ yyvsp[-1].ftype.t), 0);
yyungetc (':', 0);
yychar = ')';
;
break;}
-case 772:
-#line 3563 "parse.y"
+case 802:
+#line 3495 "parse.y"
{ maybe_snarf_defarg (); ;
break;}
-case 773:
-#line 3565 "parse.y"
+case 803:
+#line 3497 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 776:
-#line 3576 "parse.y"
+case 806:
+#line 3508 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
-case 777:
-#line 3579 "parse.y"
+case 807:
+#line 3511 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t); ;
break;}
-case 778:
-#line 3582 "parse.y"
+case 808:
+#line 3514 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = chainon (yyval.ttype, yyvsp[0].ftype.t); ;
break;}
-case 779:
-#line 3585 "parse.y"
+case 809:
+#line 3517 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 780:
-#line 3587 "parse.y"
+case 810:
+#line 3519 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype)); ;
break;}
-case 782:
-#line 3593 "parse.y"
+case 812:
+#line 3525 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t); ;
break;}
-case 783:
-#line 3603 "parse.y"
+case 813:
+#line 3535 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag;
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); ;
break;}
-case 784:
-#line 3607 "parse.y"
+case 814:
+#line 3539 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 785:
-#line 3610 "parse.y"
+case 815:
+#line 3542 "parse.y"
{ yyval.ftype.t = build_tree_list (get_decl_list (yyvsp[-1].ftype.t), yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 786:
-#line 3613 "parse.y"
+case 816:
+#line 3545 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 787:
-#line 3617 "parse.y"
+case 817:
+#line 3549 "parse.y"
{ tree specs = strip_attrs (yyvsp[0].ftype.t);
yyval.ftype.t = build_tree_list (specs, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 788:
-#line 3621 "parse.y"
+case 818:
+#line 3553 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
-case 789:
-#line 3628 "parse.y"
+case 819:
+#line 3560 "parse.y"
{ yyval.ftype.t = build_tree_list (NULL_TREE, yyvsp[0].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
-case 790:
-#line 3631 "parse.y"
+case 820:
+#line 3563 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
-case 793:
-#line 3642 "parse.y"
+case 823:
+#line 3574 "parse.y"
{ see_typename (); ;
break;}
-case 794:
-#line 3647 "parse.y"
+case 824:
+#line 3579 "parse.y"
{
error ("type specifier omitted for parameter");
yyval.ttype = build_tree_list (integer_type_node, NULL_TREE);
;
break;}
-case 795:
-#line 3652 "parse.y"
+case 825:
+#line 3584 "parse.y"
{
error ("type specifier omitted for parameter");
if (TREE_CODE (yyval.ttype) == SCOPE_REF
@@ -7597,189 +7633,189 @@ case 795:
yyval.ttype = build_tree_list (integer_type_node, yyval.ttype);
;
break;}
-case 796:
-#line 3664 "parse.y"
+case 826:
+#line 3596 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 797:
-#line 3666 "parse.y"
+case 827:
+#line 3598 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 798:
-#line 3668 "parse.y"
+case 828:
+#line 3600 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, NULL_TREE); ;
break;}
-case 799:
-#line 3673 "parse.y"
+case 829:
+#line 3605 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, groktypename(yyvsp[0].ftype.t)); ;
break;}
-case 801:
-#line 3679 "parse.y"
+case 831:
+#line 3611 "parse.y"
{
TREE_CHAIN (yyvsp[0].ttype) = yyval.ttype;
yyval.ttype = yyvsp[0].ttype;
;
break;}
-case 802:
-#line 3687 "parse.y"
+case 832:
+#line 3619 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 803:
-#line 3689 "parse.y"
+case 833:
+#line 3621 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 804:
-#line 3691 "parse.y"
+case 834:
+#line 3623 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 805:
-#line 3693 "parse.y"
+case 835:
+#line 3625 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
-case 806:
-#line 3700 "parse.y"
+case 836:
+#line 3632 "parse.y"
{ got_scope = NULL_TREE; ;
break;}
-case 807:
-#line 3705 "parse.y"
+case 837:
+#line 3637 "parse.y"
{ yyval.ttype = ansi_opname[MULT_EXPR]; ;
break;}
-case 808:
-#line 3707 "parse.y"
+case 838:
+#line 3639 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_DIV_EXPR]; ;
break;}
-case 809:
-#line 3709 "parse.y"
+case 839:
+#line 3641 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_MOD_EXPR]; ;
break;}
-case 810:
-#line 3711 "parse.y"
+case 840:
+#line 3643 "parse.y"
{ yyval.ttype = ansi_opname[PLUS_EXPR]; ;
break;}
-case 811:
-#line 3713 "parse.y"
+case 841:
+#line 3645 "parse.y"
{ yyval.ttype = ansi_opname[MINUS_EXPR]; ;
break;}
-case 812:
-#line 3715 "parse.y"
+case 842:
+#line 3647 "parse.y"
{ yyval.ttype = ansi_opname[BIT_AND_EXPR]; ;
break;}
-case 813:
-#line 3717 "parse.y"
+case 843:
+#line 3649 "parse.y"
{ yyval.ttype = ansi_opname[BIT_IOR_EXPR]; ;
break;}
-case 814:
-#line 3719 "parse.y"
+case 844:
+#line 3651 "parse.y"
{ yyval.ttype = ansi_opname[BIT_XOR_EXPR]; ;
break;}
-case 815:
-#line 3721 "parse.y"
+case 845:
+#line 3653 "parse.y"
{ yyval.ttype = ansi_opname[BIT_NOT_EXPR]; ;
break;}
-case 816:
-#line 3723 "parse.y"
+case 846:
+#line 3655 "parse.y"
{ yyval.ttype = ansi_opname[COMPOUND_EXPR]; ;
break;}
-case 817:
-#line 3725 "parse.y"
+case 847:
+#line 3657 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
-case 818:
-#line 3727 "parse.y"
+case 848:
+#line 3659 "parse.y"
{ yyval.ttype = ansi_opname[LT_EXPR]; ;
break;}
-case 819:
-#line 3729 "parse.y"
+case 849:
+#line 3661 "parse.y"
{ yyval.ttype = ansi_opname[GT_EXPR]; ;
break;}
-case 820:
-#line 3731 "parse.y"
+case 850:
+#line 3663 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
-case 821:
-#line 3733 "parse.y"
+case 851:
+#line 3665 "parse.y"
{ yyval.ttype = ansi_assopname[yyvsp[0].code]; ;
break;}
-case 822:
-#line 3735 "parse.y"
+case 852:
+#line 3667 "parse.y"
{ yyval.ttype = ansi_opname [MODIFY_EXPR]; ;
break;}
-case 823:
-#line 3737 "parse.y"
+case 853:
+#line 3669 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
-case 824:
-#line 3739 "parse.y"
+case 854:
+#line 3671 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
-case 825:
-#line 3741 "parse.y"
+case 855:
+#line 3673 "parse.y"
{ yyval.ttype = ansi_opname[POSTINCREMENT_EXPR]; ;
break;}
-case 826:
-#line 3743 "parse.y"
+case 856:
+#line 3675 "parse.y"
{ yyval.ttype = ansi_opname[PREDECREMENT_EXPR]; ;
break;}
-case 827:
-#line 3745 "parse.y"
+case 857:
+#line 3677 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ANDIF_EXPR]; ;
break;}
-case 828:
-#line 3747 "parse.y"
+case 858:
+#line 3679 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ORIF_EXPR]; ;
break;}
-case 829:
-#line 3749 "parse.y"
+case 859:
+#line 3681 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_NOT_EXPR]; ;
break;}
-case 830:
-#line 3751 "parse.y"
+case 860:
+#line 3683 "parse.y"
{ yyval.ttype = ansi_opname[COND_EXPR]; ;
break;}
-case 831:
-#line 3753 "parse.y"
+case 861:
+#line 3685 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
-case 832:
-#line 3755 "parse.y"
+case 862:
+#line 3687 "parse.y"
{ yyval.ttype = ansi_opname[COMPONENT_REF]; ;
break;}
-case 833:
-#line 3757 "parse.y"
+case 863:
+#line 3689 "parse.y"
{ yyval.ttype = ansi_opname[MEMBER_REF]; ;
break;}
-case 834:
-#line 3759 "parse.y"
+case 864:
+#line 3691 "parse.y"
{ yyval.ttype = ansi_opname[CALL_EXPR]; ;
break;}
-case 835:
-#line 3761 "parse.y"
+case 865:
+#line 3693 "parse.y"
{ yyval.ttype = ansi_opname[ARRAY_REF]; ;
break;}
-case 836:
-#line 3763 "parse.y"
+case 866:
+#line 3695 "parse.y"
{ yyval.ttype = ansi_opname[NEW_EXPR]; ;
break;}
-case 837:
-#line 3765 "parse.y"
+case 867:
+#line 3697 "parse.y"
{ yyval.ttype = ansi_opname[DELETE_EXPR]; ;
break;}
-case 838:
-#line 3767 "parse.y"
+case 868:
+#line 3699 "parse.y"
{ yyval.ttype = ansi_opname[VEC_NEW_EXPR]; ;
break;}
-case 839:
-#line 3769 "parse.y"
+case 869:
+#line 3701 "parse.y"
{ yyval.ttype = ansi_opname[VEC_DELETE_EXPR]; ;
break;}
-case 840:
-#line 3772 "parse.y"
+case 870:
+#line 3704 "parse.y"
{ yyval.ttype = grokoptypename (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
-case 841:
-#line 3774 "parse.y"
+case 871:
+#line 3706 "parse.y"
{ yyval.ttype = ansi_opname[ERROR_MARK]; ;
break;}
}
@@ -7980,7 +8016,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 3777 "parse.y"
+#line 3709 "parse.y"
#ifdef SPEW_DEBUG
diff --git a/gcc/cp/parse.h b/gcc/cp/parse.h
index f45eb6f8604..5f21a767bc3 100644
--- a/gcc/cp/parse.h
+++ b/gcc/cp/parse.h
@@ -24,68 +24,66 @@ typedef union {long itype; tree ttype; char *strtype; enum tree_code code; flagg
#define RETURN 280
#define GOTO 281
#define ASM_KEYWORD 282
-#define GCC_ASM_KEYWORD 283
-#define TYPEOF 284
-#define ALIGNOF 285
-#define SIGOF 286
-#define ATTRIBUTE 287
-#define EXTENSION 288
-#define LABEL 289
-#define REALPART 290
-#define IMAGPART 291
-#define AGGR 292
-#define VISSPEC 293
-#define DELETE 294
-#define NEW 295
-#define THIS 296
-#define OPERATOR 297
-#define CXX_TRUE 298
-#define CXX_FALSE 299
-#define NAMESPACE 300
-#define TYPENAME_KEYWORD 301
-#define USING 302
-#define LEFT_RIGHT 303
-#define TEMPLATE 304
-#define TYPEID 305
-#define DYNAMIC_CAST 306
-#define STATIC_CAST 307
-#define REINTERPRET_CAST 308
-#define CONST_CAST 309
-#define SCOPE 310
-#define EMPTY 311
-#define PTYPENAME 312
-#define NSNAME 313
-#define THROW 314
-#define ASSIGN 315
-#define OROR 316
-#define ANDAND 317
-#define MIN_MAX 318
-#define EQCOMPARE 319
-#define ARITHCOMPARE 320
-#define LSHIFT 321
-#define RSHIFT 322
-#define POINTSAT_STAR 323
-#define DOT_STAR 324
-#define UNARY 325
-#define PLUSPLUS 326
-#define MINUSMINUS 327
-#define HYPERUNARY 328
-#define PAREN_STAR_PAREN 329
-#define POINTSAT 330
-#define TRY 331
-#define CATCH 332
-#define TYPENAME_ELLIPSIS 333
-#define PRE_PARSED_FUNCTION_DECL 334
-#define EXTERN_LANG_STRING 335
-#define ALL 336
-#define PRE_PARSED_CLASS_DECL 337
-#define DEFARG 338
-#define DEFARG_MARKER 339
-#define TYPENAME_DEFN 340
-#define IDENTIFIER_DEFN 341
-#define PTYPENAME_DEFN 342
-#define END_OF_LINE 343
-#define END_OF_SAVED_INPUT 344
+#define TYPEOF 283
+#define ALIGNOF 284
+#define SIGOF 285
+#define ATTRIBUTE 286
+#define EXTENSION 287
+#define LABEL 288
+#define REALPART 289
+#define IMAGPART 290
+#define AGGR 291
+#define VISSPEC 292
+#define DELETE 293
+#define NEW 294
+#define THIS 295
+#define OPERATOR 296
+#define CXX_TRUE 297
+#define CXX_FALSE 298
+#define NAMESPACE 299
+#define TYPENAME_KEYWORD 300
+#define USING 301
+#define LEFT_RIGHT 302
+#define TEMPLATE 303
+#define TYPEID 304
+#define DYNAMIC_CAST 305
+#define STATIC_CAST 306
+#define REINTERPRET_CAST 307
+#define CONST_CAST 308
+#define SCOPE 309
+#define EMPTY 310
+#define PTYPENAME 311
+#define NSNAME 312
+#define THROW 313
+#define ASSIGN 314
+#define OROR 315
+#define ANDAND 316
+#define MIN_MAX 317
+#define EQCOMPARE 318
+#define ARITHCOMPARE 319
+#define LSHIFT 320
+#define RSHIFT 321
+#define POINTSAT_STAR 322
+#define DOT_STAR 323
+#define UNARY 324
+#define PLUSPLUS 325
+#define MINUSMINUS 326
+#define HYPERUNARY 327
+#define PAREN_STAR_PAREN 328
+#define POINTSAT 329
+#define TRY 330
+#define CATCH 331
+#define PRE_PARSED_FUNCTION_DECL 332
+#define EXTERN_LANG_STRING 333
+#define ALL 334
+#define PRE_PARSED_CLASS_DECL 335
+#define DEFARG 336
+#define DEFARG_MARKER 337
+#define TYPENAME_DEFN 338
+#define IDENTIFIER_DEFN 339
+#define PTYPENAME_DEFN 340
+#define END_OF_LINE 341
+#define END_OF_SAVED_INPUT 342
extern YYSTYPE yylval;
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 12b59b10036..42af7829516 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */
#include "cp-tree.h"
#include "output.h"
#include "except.h"
+#include "toplev.h"
/* Since parsers are distinct for each language, put the language string
definition here. (fnf) */
@@ -129,7 +130,7 @@ empty_parms ()
/* the reserved words */
/* SCO include files test "ASM", so use something else. */
%token SIZEOF ENUM /* STRUCT UNION */ IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
-%token BREAK CONTINUE RETURN GOTO ASM_KEYWORD GCC_ASM_KEYWORD TYPEOF ALIGNOF
+%token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF
%token SIGOF
%token ATTRIBUTE EXTENSION LABEL
%token REALPART IMAGPART
@@ -203,10 +204,9 @@ empty_parms ()
%type <ttype> declarator notype_declarator after_type_declarator
%type <ttype> direct_notype_declarator direct_after_type_declarator
-
-%type <ttype> opt.component_decl_list component_decl_list
-%type <ttype> component_decl component_decl_1 components notype_components
-%type <ttype> component_declarator component_declarator0 self_reference
+%type <itype> components notype_components
+%type <ttype> component_decl component_decl_1
+%type <ttype> component_declarator component_declarator0
%type <ttype> notype_component_declarator notype_component_declarator0
%type <ttype> after_type_component_declarator after_type_component_declarator0
%type <ttype> enumlist enumerator
@@ -221,14 +221,15 @@ empty_parms ()
%type <ttype> template_id do_id object_template_id notype_template_declarator
%type <ttype> overqualified_id notype_qualified_id any_id
%type <ttype> complex_direct_notype_declarator functional_cast
-%type <ttype> complex_parmlist parms_comma
+%type <ttype> complex_parmlist parms_comma
+%type <ttype> namespace_qualifier namespace_using_decl
%type <ftype> type_id new_type_id typed_typespecs typespec typed_declspecs
%type <ftype> typed_declspecs1 type_specifier_seq nonempty_cv_qualifiers
%type <ftype> structsp typespecqual_reserved parm named_parm full_parm
/* C++ extensions */
-%token <ttype> TYPENAME_ELLIPSIS PTYPENAME
+%token <ttype> PTYPENAME
%token <ttype> PRE_PARSED_FUNCTION_DECL EXTERN_LANG_STRING ALL
%token <ttype> PRE_PARSED_CLASS_DECL DEFARG DEFARG_MARKER
%type <ttype> component_constructor_declarator
@@ -243,7 +244,7 @@ empty_parms ()
%type <ttype> exception_specification_opt ansi_raise_identifier ansi_raise_identifiers
%type <ttype> operator_name
%type <ttype> object aggr
-%type <itype> new delete
+%type <itype> new delete .begin_new_placement
/* %type <ttype> primary_no_id */
%type <ttype> nonmomentary_expr maybe_parmlist
%type <itype> initdcl0 notype_initdcl0 member_init_list initdcl0_innards
@@ -265,7 +266,7 @@ empty_parms ()
%type <ttype> named_class_head_sans_basetype_defn
%type <ttype> identifier_defn IDENTIFIER_DEFN TYPENAME_DEFN PTYPENAME_DEFN
-%type <ttype> self_template_type
+%type <ttype> self_template_type .finish_template_type
%token NSNAME
%type <ttype> NSNAME
@@ -279,17 +280,22 @@ empty_parms ()
%{
/* List of types and structure classes of the current declaration. */
-static tree current_declspecs = NULL_TREE;
+static tree current_declspecs;
+
/* List of prefix attributes in effect.
Prefix attributes are parsed by the reserved_declspecs and declmods
rules. They create a list that contains *both* declspecs and attrs. */
/* ??? It is not clear yet that all cases where an attribute can now appear in
a declspec list have been updated. */
-static tree prefix_attributes = NULL_TREE;
+static tree prefix_attributes;
-/* When defining an aggregate, this is the most recent one being defined. */
+/* When defining an aggregate, this is the kind of the most recent one
+ being defined. (For example, this might be class_type_node.) */
static tree current_aggr;
+/* When defining an enumeration, this is the type of the enumeration. */
+static tree current_enum_type;
+
/* Tell yyparse how to print a token's value, if yydebug is set. */
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
@@ -328,13 +334,7 @@ parse_decl(declarator, specs_attrs, attributes, initialized, decl)
program:
/* empty */
| extdefs
- {
- /* In case there were missing closebraces,
- get us back to the global binding level. */
- while (! global_bindings_p ())
- poplevel (0, 0, 0);
- finish_file ();
- }
+ { finish_translation_unit (); }
;
/* the reason for the strange actions in this rule
@@ -371,7 +371,6 @@ extension:
asm_keyword:
ASM_KEYWORD
- | GCC_ASM_KEYWORD
;
lang_extdef:
@@ -407,20 +406,26 @@ extdef:
{ push_namespace (NULL_TREE); }
extdefs_opt '}'
{ pop_namespace (); }
- | NAMESPACE identifier '=' any_id ';'
- { do_namespace_alias ($2, $4); }
+ | namespace_alias
| using_decl ';'
{ do_toplevel_using_decl ($1); }
- | USING NAMESPACE any_id ';'
- {
- if (TREE_CODE ($3) == IDENTIFIER_NODE)
- $3 = lastiddecl;
- do_using_directive ($3);
- }
+ | using_directive
| extension extdef
{ pedantic = $<itype>1; }
;
+namespace_alias:
+ NAMESPACE identifier '='
+ { begin_only_namespace_names (); }
+ any_id ';'
+ {
+ end_only_namespace_names ();
+ if (lastiddecl)
+ $5 = lastiddecl;
+ do_namespace_alias ($2, $5);
+ }
+ ;
+
using_decl:
USING qualified_id
{ $$ = $2; }
@@ -430,6 +435,45 @@ using_decl:
{ $$ = $3; }
;
+namespace_using_decl:
+ USING namespace_qualifier identifier
+ { $$ = build_parse_node (SCOPE_REF, $2, $3); }
+ | USING global_scope identifier
+ { $$ = build_parse_node (SCOPE_REF, global_namespace, $3); }
+ | USING global_scope namespace_qualifier identifier
+ { $$ = build_parse_node (SCOPE_REF, $3, $4); }
+ ;
+
+using_directive:
+ USING NAMESPACE
+ { begin_only_namespace_names (); }
+ any_id ';'
+ {
+ end_only_namespace_names ();
+ /* If no declaration was found, the using-directive is
+ invalid. Since that was not reported, we need the
+ identifier for the error message. */
+ if (TREE_CODE ($4) == IDENTIFIER_NODE && lastiddecl)
+ $4 = lastiddecl;
+ do_using_directive ($4);
+ }
+ ;
+
+namespace_qualifier:
+ NSNAME SCOPE
+ {
+ if (TREE_CODE ($$) == IDENTIFIER_NODE)
+ $$ = lastiddecl;
+ got_scope = $$;
+ }
+ | namespace_qualifier NSNAME SCOPE
+ {
+ $$ = $2;
+ if (TREE_CODE ($$) == IDENTIFIER_NODE)
+ $$ = lastiddecl;
+ got_scope = $$;
+ }
+
any_id:
unqualified_id
| qualified_id
@@ -515,22 +559,38 @@ template_parm:
;
template_def:
- template_header
- extdef
- {
- if ($1)
- end_template_decl ();
- else
- end_specialization ();
- }
- | template_header
- error %prec EMPTY
- {
- if ($1)
- end_template_decl ();
- else
- end_specialization ();
- }
+ template_header template_extdef
+ { finish_template_decl ($1); }
+ | template_header error %prec EMPTY
+ { finish_template_decl ($1); }
+ ;
+
+template_extdef:
+ fndef eat_saved_input
+ { if (pending_inlines) do_pending_inlines (); }
+ | template_datadef
+ { if (pending_inlines) do_pending_inlines (); }
+ | template_def
+ { if (pending_inlines) do_pending_inlines (); }
+ | extern_lang_string .hush_warning fndef .warning_ok eat_saved_input
+ { if (pending_inlines) do_pending_inlines ();
+ pop_lang_context (); }
+ | extern_lang_string .hush_warning template_datadef .warning_ok
+ { if (pending_inlines) do_pending_inlines ();
+ pop_lang_context (); }
+ | extension template_extdef
+ { pedantic = $<itype>1; }
+ ;
+
+template_datadef:
+ nomods_initdecls ';'
+ | declmods notype_initdecls ';'
+ {}
+ | typed_declspecs initdecls ';'
+ { note_list_got_semicolon ($1.t); }
+ | structsp ';'
+ { maybe_process_partial_specialization ($1.t);
+ note_got_semicolon ($1.t); }
;
datadef:
@@ -538,9 +598,7 @@ datadef:
| declmods notype_initdecls ';'
{}
| typed_declspecs initdecls ';'
- {
- note_list_got_semicolon ($1.t);
- }
+ { note_list_got_semicolon ($1.t); }
| declmods ';'
{ pedwarn ("empty declaration"); }
| explicit_instantiation ';'
@@ -829,29 +887,29 @@ end_explicit_instantiation:
template_type:
PTYPENAME '<' template_arg_list_opt template_close_bracket
- {
- $$ = lookup_template_class ($1, $3, NULL_TREE, NULL_TREE);
- if ($$ != error_mark_node)
- $$ = TYPE_STUB_DECL ($$);
- }
+ .finish_template_type
+ { $$ = $5; }
| TYPENAME '<' template_arg_list_opt template_close_bracket
- {
- $$ = lookup_template_class ($1, $3, NULL_TREE, NULL_TREE);
- if ($$ != error_mark_node)
- $$ = TYPE_STUB_DECL ($$);
- }
+ .finish_template_type
+ { $$ = $5; }
| self_template_type
;
self_template_type:
SELFNAME '<' template_arg_list_opt template_close_bracket
- {
- $$ = lookup_template_class ($1, $3, NULL_TREE, NULL_TREE);
- if ($$ != error_mark_node)
- $$ = TYPE_STUB_DECL ($$);
- }
+ .finish_template_type
+ { $$ = $5; }
;
+.finish_template_type:
+ {
+ if (yychar == YYEMPTY)
+ yychar = YYLEX;
+
+ $$ = finish_template_type ($<ttype>-3, $<ttype>-1,
+ yychar == SCOPE);
+ }
+
template_close_bracket:
'>'
| RSHIFT
@@ -878,6 +936,8 @@ template_arg_list:
template_arg:
type_id
{ $$ = groktypename ($1.t); }
+ | PTYPENAME
+ { $$ = lastiddecl; }
| expr_no_commas %prec ARITHCOMPARE
;
@@ -922,7 +982,6 @@ xcond:
/* empty */
{ $$ = NULL_TREE; }
| condition
- { $$ = condition_conversion ($$); }
| error
{ $$ = NULL_TREE; }
;
@@ -1005,11 +1064,7 @@ unary_expr:
| '~' cast_expr
{ $$ = build_x_unary_op (BIT_NOT_EXPR, $2); }
| unop cast_expr %prec UNARY
- { $$ = build_x_unary_op ($1, $2);
- if ($1 == NEGATE_EXPR && TREE_CODE ($2) == INTEGER_CST)
- TREE_NEGATED_INT ($$) = 1;
- overflow_warning ($$);
- }
+ { $$ = finish_unary_op_expr ($1, $2); }
/* Refer to the address of a label as a pointer. */
| ANDAND identifier
{ if (pedantic)
@@ -1039,19 +1094,32 @@ unary_expr:
| new new_placement new_type_id new_initializer
{ $$ = build_new ($2, $3.t, $4, $1);
check_for_new_type ("new", $3); }
- | new '(' type_id ')' %prec EMPTY
- { $$ = build_new (NULL_TREE, groktypename($3.t),
+ /* The .begin_new_placement in the following rules is
+ necessary to avoid shift/reduce conflicts that lead to
+ mis-parsing some expressions. Of course, these constructs
+ are not really new-placement and it is bogus to call
+ begin_new_placement. But, the parser cannot always tell at this
+ point whether the next thing is an expression or a type-id,
+ so there is nothing we can do. Fortunately,
+ begin_new_placement does nothing harmful. When we rewrite
+ the parser, this lossage should be removed, of course. */
+ | new '(' .begin_new_placement type_id .finish_new_placement
+ %prec EMPTY
+ { $$ = build_new (NULL_TREE, groktypename($4.t),
NULL_TREE, $1);
- check_for_new_type ("new", $3); }
- | new '(' type_id ')' new_initializer
- { $$ = build_new (NULL_TREE, groktypename($3.t), $5, $1);
- check_for_new_type ("new", $3); }
- | new new_placement '(' type_id ')' %prec EMPTY
- { $$ = build_new ($2, groktypename($4.t), NULL_TREE, $1);
check_for_new_type ("new", $4); }
- | new new_placement '(' type_id ')' new_initializer
- { $$ = build_new ($2, groktypename($4.t), $6, $1);
+ | new '(' .begin_new_placement type_id .finish_new_placement
+ new_initializer
+ { $$ = build_new (NULL_TREE, groktypename($4.t), $6, $1);
check_for_new_type ("new", $4); }
+ | new new_placement '(' .begin_new_placement type_id
+ .finish_new_placement %prec EMPTY
+ { $$ = build_new ($2, groktypename($5.t), NULL_TREE, $1);
+ check_for_new_type ("new", $5); }
+ | new new_placement '(' .begin_new_placement type_id
+ .finish_new_placement new_initializer
+ { $$ = build_new ($2, groktypename($5.t), $7, $1);
+ check_for_new_type ("new", $5); }
| delete cast_expr %prec UNARY
{ $$ = delete_sanity ($2, NULL_TREE, 0, $1); }
@@ -1069,14 +1137,24 @@ unary_expr:
{ $$ = build_x_unary_op (IMAGPART_EXPR, $2); }
;
+ /* Note this rule is not suitable for use in new_placement
+ since it uses NULL_TREE as the argument to
+ finish_new_placement. This rule serves only to avoid
+ reduce/reduce conflicts in unary_expr. See the comments
+ there on the use of begin/finish_new_placement. */
+.finish_new_placement:
+ ')'
+ { finish_new_placement (NULL_TREE, $<itype>-1); }
+
+.begin_new_placement:
+ { $$ = begin_new_placement (); }
+
new_placement:
- '(' nonnull_exprlist ')'
- { $$ = $2; }
- | '{' nonnull_exprlist '}'
- {
- $$ = $2;
- pedwarn ("old style placement syntax, use () instead");
- }
+ '(' .begin_new_placement nonnull_exprlist ')'
+ { $$ = finish_new_placement ($3, $2); }
+ | '{' .begin_new_placement nonnull_exprlist '}'
+ { cp_pedwarn ("old style placement syntax, use () instead");
+ $$ = finish_new_placement ($3, $2); }
;
new_initializer:
@@ -1107,13 +1185,11 @@ new_initializer:
/* This is necessary to postpone reduction of `int ((int)(int)(int))'. */
regcast_or_absdcl:
'(' type_id ')' %prec EMPTY
- { $2.t = tree_cons (NULL_TREE, $2.t, void_list_node);
- TREE_PARMLIST ($2.t) = 1;
+ { $2.t = finish_parmlist (build_tree_list (NULL_TREE, $2.t), 0);
$$ = make_call_declarator (NULL_TREE, $2.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", $2); }
| regcast_or_absdcl '(' type_id ')' %prec EMPTY
- { $3.t = tree_cons (NULL_TREE, $3.t, void_list_node);
- TREE_PARMLIST ($3.t) = 1;
+ { $3.t = finish_parmlist (build_tree_list (NULL_TREE, $3.t), 0);
$$ = make_call_declarator ($$, $3.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", $3); }
;
@@ -1206,6 +1282,8 @@ expr_no_commas:
notype_unqualified_id:
'~' see_typename identifier
{ $$ = build_parse_node (BIT_NOT_EXPR, $3); }
+ | '~' see_typename template_type
+ { $$ = build_parse_node (BIT_NOT_EXPR, $3); }
| template_id
| operator_name
| IDENTIFIER
@@ -1214,7 +1292,7 @@ notype_unqualified_id:
;
do_id:
- { $$ = do_identifier ($<ttype>-1, 1); }
+ { $$ = do_identifier ($<ttype>-1, 1, NULL_TREE); }
template_id:
PFUNCNAME '<' do_id template_arg_list_opt template_close_bracket
@@ -1258,7 +1336,9 @@ notype_template_declarator:
direct_notype_declarator:
complex_direct_notype_declarator
- | notype_unqualified_id
+ /* This precedence declaration is to prefer this reduce
+ to the Koenig lookup shift in primary, below. I hate yacc. */
+ | notype_unqualified_id %prec '('
| notype_template_declarator
| '(' expr_or_declarator ')'
{ $$ = finish_decl_parsing ($2); }
@@ -1267,10 +1347,10 @@ direct_notype_declarator:
primary:
notype_unqualified_id
{
- if (TREE_CODE ($$) == BIT_NOT_EXPR)
- $$ = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND ($$, 0));
- else if (TREE_CODE ($$) != TEMPLATE_ID_EXPR)
- $$ = do_identifier ($$, 1);
+ if (TREE_CODE ($1) == BIT_NOT_EXPR)
+ $$ = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND ($1, 0));
+ else
+ $$ = finish_id_expr ($1);
}
| CONSTANT
| boolean.literal
@@ -1279,6 +1359,12 @@ primary:
if (processing_template_decl)
push_obstacks (&permanent_obstack, &permanent_obstack);
$$ = combine_strings ($$);
+ /* combine_strings doesn't set up TYPE_MAIN_VARIANT of
+ a const array the way we want, so fix it. */
+ if (flag_const_strings)
+ TREE_TYPE ($$) = build_cplus_array_type
+ (TREE_TYPE (TREE_TYPE ($$)),
+ TYPE_DOMAIN (TREE_TYPE ($$)));
if (processing_template_decl)
pop_obstacks ();
}
@@ -1290,7 +1376,8 @@ primary:
| '(' error ')'
{ $$ = error_mark_node; }
| '('
- { if (current_function_decl == 0)
+ { tree scope = current_scope ();
+ if (!scope || TREE_CODE (scope) != FUNCTION_DECL)
{
error ("braced-group within expression allowed only inside a function");
YYERROR;
@@ -1301,10 +1388,17 @@ primary:
}
compstmt ')'
{ $$ = finish_stmt_expr ($<ttype>2, $3); }
+ /* Koenig lookup support
+ We could store lastiddecl in $1 to avoid another lookup,
+ but that would result in many additional reduce/reduce conflicts. */
+ | notype_unqualified_id '(' nonnull_exprlist ')'
+ { $$ = finish_call_expr ($1, $3, 1); }
+ | notype_unqualified_id LEFT_RIGHT
+ { $$ = finish_call_expr ($1, NULL_TREE, 1); }
| primary '(' nonnull_exprlist ')'
- { $$ = finish_call_expr ($1, $3); }
+ { $$ = finish_call_expr ($1, $3, 0); }
| primary LEFT_RIGHT
- { $$ = finish_call_expr ($1, NULL_TREE); }
+ { $$ = finish_call_expr ($1, NULL_TREE, 0); }
| primary '[' expr ']'
{ $$ = grok_array_decl ($$, $3); }
| primary PLUSPLUS
@@ -1383,6 +1477,8 @@ primary:
$$ = get_typeid (TYPE_MAIN_VARIANT (type)); }
| global_scope IDENTIFIER
{ $$ = do_scoped_id ($2, 1); }
+ | global_scope template_id
+ { $$ = $2; }
| global_scope operator_name
{
got_scope = NULL_TREE;
@@ -1394,9 +1490,9 @@ primary:
| overqualified_id %prec HYPERUNARY
{ $$ = build_offset_ref (OP0 ($$), OP1 ($$)); }
| overqualified_id '(' nonnull_exprlist ')'
- { $$ = finish_globally_qualified_member_call_expr ($1, $3); }
+ { $$ = finish_qualified_call_expr ($1, $3); }
| overqualified_id LEFT_RIGHT
- { $$ = finish_globally_qualified_member_call_expr ($1, NULL_TREE); }
+ { $$ = finish_qualified_call_expr ($1, NULL_TREE); }
| object object_template_id %prec UNARY
{
$$ = build_x_component_ref ($$, $2, NULL_TREE, 1);
@@ -1747,16 +1843,19 @@ typespecqual_reserved:
initdecls:
initdcl0
| initdecls ',' initdcl
+ { check_multiple_declarators (); }
;
notype_initdecls:
notype_initdcl0
| notype_initdecls ',' initdcl
+ { check_multiple_declarators (); }
;
nomods_initdecls:
nomods_initdcl0
| nomods_initdecls ',' initdcl
+ { check_multiple_declarators (); }
;
maybeasm:
@@ -1813,7 +1912,7 @@ notype_initdcl0:
nomods_initdcl0:
notype_declarator maybeasm
{ /* Set things up as initdcl0_innards expects. */
- $<ttype>$ = $1;
+ $<ttype>2 = $1;
$1 = NULL_TREE; }
initdcl0_innards
{}
@@ -1966,88 +2065,63 @@ pending_defargs:
structsp:
ENUM identifier '{'
{ $<itype>3 = suspend_momentary ();
- $<ttype>$ = start_enum ($2); }
+ $<ttype>$ = current_enum_type;
+ current_enum_type = start_enum ($2); }
enumlist maybecomma_warn '}'
- { $$.t = finish_enum ($<ttype>4, $5);
+ { TYPE_VALUES (current_enum_type) = $5;
+ $$.t = finish_enum (current_enum_type);
$$.new_type_flag = 1;
+ current_enum_type = $<ttype>4;
resume_momentary ((int) $<itype>3);
- check_for_missing_semicolon ($<ttype>4); }
+ check_for_missing_semicolon ($$.t); }
| ENUM identifier '{' '}'
- { $$.t = finish_enum (start_enum ($2), NULL_TREE);
+ { $$.t = finish_enum (start_enum ($2));
$$.new_type_flag = 1;
check_for_missing_semicolon ($$.t); }
| ENUM '{'
{ $<itype>2 = suspend_momentary ();
- $<ttype>$ = start_enum (make_anon_name ()); }
+ $<ttype>$ = current_enum_type;
+ current_enum_type = start_enum (make_anon_name ()); }
enumlist maybecomma_warn '}'
- { $$.t = finish_enum ($<ttype>3, $4);
+ { TYPE_VALUES (current_enum_type) = $4;
+ $$.t = finish_enum (current_enum_type);
+ $$.new_type_flag = 1;
+ current_enum_type = $<ttype>4;
resume_momentary ((int) $<itype>1);
- check_for_missing_semicolon ($<ttype>3);
- $$.new_type_flag = 1; }
+ check_for_missing_semicolon ($$.t); }
| ENUM '{' '}'
- { $$.t = finish_enum (start_enum (make_anon_name()), NULL_TREE);
+ { $$.t = finish_enum (start_enum (make_anon_name()));
$$.new_type_flag = 1;
check_for_missing_semicolon ($$.t); }
| ENUM identifier
- { $$.t = xref_tag (enum_type_node, $2, NULL_TREE, 1);
+ { $$.t = xref_tag (enum_type_node, $2, 1);
$$.new_type_flag = 0; }
| ENUM complex_type_name
- { $$.t = xref_tag (enum_type_node, $2, NULL_TREE, 1);
+ { $$.t = xref_tag (enum_type_node, $2, 1);
$$.new_type_flag = 0; }
| TYPENAME_KEYWORD typename_sub
{ $$.t = $2;
- $$.new_type_flag = 0; }
+ $$.new_type_flag = 0;
+ if (!processing_template_decl)
+ cp_pedwarn ("using `typename' outside of template"); }
/* C++ extensions, merged with C to avoid shift/reduce conflicts */
| class_head left_curly
opt.component_decl_list '}' maybe_attribute
- {
+ {
int semi;
- $<ttype>$ = $1;
-#if 0
- /* Need to rework class nesting in the
- presence of nested classes, etc. */
- shadow_tag (CLASSTYPE_AS_LIST ($1)); */
-#endif
if (yychar == YYEMPTY)
yychar = YYLEX;
semi = yychar == ';';
- /* finish_struct nukes this anyway; if
- finish_exception does too, then it can go. */
- if (semi)
- note_got_semicolon ($1);
-
- if (TREE_CODE ($1) == ENUMERAL_TYPE)
- ;
- else
- {
- $<ttype>$ = finish_struct ($1, $3, $5, semi);
- if (semi) note_got_semicolon ($<ttype>$);
- }
- pop_obstacks ();
-
- if (! semi)
- check_for_missing_semicolon ($1);
- if (current_scope () == current_function_decl)
- do_pending_defargs ();
+ $<ttype>$ = finish_class_definition ($1, $5, semi);
}
pending_defargs
- {
- if (pending_inlines
- && current_scope () == current_function_decl)
- do_pending_inlines ();
- }
+ { finish_default_args (); }
pending_inlines
- {
- $$.t = $<ttype>6;
+ { $$.t = $<ttype>6;
$$.new_type_flag = 1;
- if (current_class_type == NULL_TREE)
- clear_inline_text_obstack ();
-
- /* Undo the begin_tree in left_curly. */
- end_tree ();
- }
+ begin_inline_definitions (); }
| class_head %prec EMPTY
{
$$.new_type_flag = 0;
@@ -2090,16 +2164,25 @@ aggr:
{ error ("type qualifier `%s' not allowed after struct or class", IDENTIFIER_POINTER ($2)); }
| aggr AGGR
{ error ("no body nor ';' separates two class, struct or union declarations"); }
+ | aggr attributes
+ { $$ = build_decl_list ($2, $1); }
;
named_class_head_sans_basetype:
aggr identifier
- { current_aggr = $$; $$ = $2; }
+ {
+ current_aggr = $1;
+ $$ = $2;
+ }
;
named_class_head_sans_basetype_defn:
aggr identifier_defn %prec EMPTY
{ current_aggr = $$; $$ = $2; }
+ | named_class_head_sans_basetype '{'
+ { yyungetc ('{', 1); }
+ | named_class_head_sans_basetype ':'
+ { yyungetc (':', 1); }
;
named_complex_class_head_sans_basetype:
@@ -2124,15 +2207,11 @@ named_complex_class_head_sans_basetype:
{ current_aggr = $$; $$ = $3; }
;
-do_xref_defn:
- /* empty */ %prec EMPTY
- { $<ttype>$ = xref_tag (current_aggr, $<ttype>0, NULL_TREE, 0); }
- ;
-
named_class_head:
named_class_head_sans_basetype %prec EMPTY
- { $$ = xref_tag (current_aggr, $1, NULL_TREE, 1); }
- | named_class_head_sans_basetype_defn do_xref_defn
+ { $$ = xref_tag (current_aggr, $1, 1); }
+ | named_class_head_sans_basetype_defn
+ { $<ttype>$ = xref_tag (current_aggr, $1, 0); }
maybe_base_class_list %prec EMPTY
{
$$ = $<ttype>2;
@@ -2150,18 +2229,7 @@ named_class_head:
cp_pedwarn ("non-`union' tag used in declaring `%#T'", $$);
if ($2)
{
- if (IS_AGGR_TYPE ($$) && CLASSTYPE_USE_TEMPLATE ($$))
- {
- if (CLASSTYPE_IMPLICIT_INSTANTIATION ($$)
- && TYPE_SIZE ($$) == NULL_TREE)
- {
- SET_CLASSTYPE_TEMPLATE_SPECIALIZATION ($$);
- if (processing_template_decl)
- push_template_decl (TYPE_MAIN_DECL ($$));
- }
- else if (CLASSTYPE_TEMPLATE_INSTANTIATION ($$))
- cp_error ("specialization after instantiation of `%T'", $$);
- }
+ maybe_process_partial_specialization ($$);
xref_basetypes (current_aggr, $1, $$, $2);
}
}
@@ -2169,7 +2237,7 @@ named_class_head:
unnamed_class_head:
aggr '{'
- { $$ = xref_tag ($$, make_anon_name (), NULL_TREE, 0);
+ { $$ = xref_tag ($$, make_anon_name (), 0);
yyungetc ('{', 1); }
;
@@ -2195,62 +2263,18 @@ base_class_list:
base_class:
base_class.1
- {
- tree type = TREE_TYPE ($1);
- if (! is_aggr_type (type, 1))
- $$ = NULL_TREE;
- else if (current_aggr == signature_type_node
- && (! type) && (! IS_SIGNATURE (type)))
- {
- error ("class name not allowed as base signature");
- $$ = NULL_TREE;
- }
- else if (current_aggr == signature_type_node)
- {
- sorry ("signature inheritance, base type `%s' ignored",
- IDENTIFIER_POINTER ($$));
- $$ = build_tree_list (access_public_node, type);
- }
- else if (type && IS_SIGNATURE (type))
- {
- error ("signature name not allowed as base class");
- $$ = NULL_TREE;
- }
- else
- $$ = build_tree_list (access_default_node, type);
- }
+ { $$ = finish_base_specifier (access_default_node, $1,
+ current_aggr
+ == signature_type_node); }
| base_class_access_list see_typename base_class.1
- {
- tree type = TREE_TYPE ($3);
- if (current_aggr == signature_type_node)
- error ("access and source specifiers not allowed in signature");
- if (! IS_AGGR_TYPE (type))
- $$ = NULL_TREE;
- else if (current_aggr == signature_type_node
- && (! type) && (! IS_SIGNATURE (type)))
- {
- error ("class name not allowed as base signature");
- $$ = NULL_TREE;
- }
- else if (current_aggr == signature_type_node)
- {
- sorry ("signature inheritance, base type `%s' ignored",
- IDENTIFIER_POINTER ($$));
- $$ = build_tree_list (access_public_node, type);
- }
- else if (type && IS_SIGNATURE (type))
- {
- error ("signature name not allowed as base class");
- $$ = NULL_TREE;
- }
- else
- $$ = build_tree_list ($$, type);
- }
+ { $$ = finish_base_specifier ($1, $3,
+ current_aggr
+ == signature_type_node); }
;
base_class.1:
typename_sub
- { $$ = TYPE_MAIN_DECL ($1); }
+ { if ($$ != error_mark_node) $$ = TYPE_MAIN_DECL ($1); }
| nonnested_type
| SIGOF '(' expr ')'
{
@@ -2329,153 +2353,51 @@ base_class_access_list:
left_curly:
'{'
- { tree t = $<ttype>0;
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
- if (t == error_mark_node
- || ! IS_AGGR_TYPE (t))
- {
- t = $<ttype>0 = make_lang_type (RECORD_TYPE);
- pushtag (make_anon_name (), t, 0);
- }
- if (TYPE_SIZE (t))
- duplicate_tag_error (t);
- if (TYPE_SIZE (t) || TYPE_BEING_DEFINED (t))
- {
- t = make_lang_type (TREE_CODE (t));
- pushtag (TYPE_IDENTIFIER ($<ttype>0), t, 0);
- $<ttype>0 = t;
- }
- if (processing_template_decl && TYPE_CONTEXT (t)
- && ! current_class_type)
- push_template_decl (TYPE_STUB_DECL (t));
- pushclass (t, 0);
- TYPE_BEING_DEFINED (t) = 1;
- if (IS_AGGR_TYPE (t) && CLASSTYPE_USE_TEMPLATE (t))
- {
- if (CLASSTYPE_IMPLICIT_INSTANTIATION (t)
- && TYPE_SIZE (t) == NULL_TREE)
- {
- SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (t);
- if (processing_template_decl)
- push_template_decl (TYPE_MAIN_DECL (t));
- }
- else if (CLASSTYPE_TEMPLATE_INSTANTIATION (t))
- cp_error ("specialization after instantiation of `%T'", t);
- }
- /* Reset the interface data, at the earliest possible
- moment, as it might have been set via a class foo;
- before. */
- /* Don't change signatures. */
- if (! IS_SIGNATURE (t))
- {
- extern tree pending_vtables;
- int needs_writing;
- tree name = TYPE_IDENTIFIER (t);
-
- if (! ANON_AGGRNAME_P (name))
- {
- CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X
- (t, interface_unknown);
- }
-
- /* Record how to set the access of this class's
- virtual functions. If write_virtuals == 2 or 3, then
- inline virtuals are ``extern inline''. */
- switch (write_virtuals)
- {
- case 0:
- case 1:
- needs_writing = 1;
- break;
- case 2:
- needs_writing = !! value_member (name, pending_vtables);
- break;
- case 3:
- needs_writing = ! CLASSTYPE_INTERFACE_ONLY (t)
- && CLASSTYPE_INTERFACE_KNOWN (t);
- break;
- default:
- needs_writing = 0;
- }
- CLASSTYPE_VTABLE_NEEDS_WRITING (t) = needs_writing;
- }
-#if 0
- t = TYPE_IDENTIFIER ($<ttype>0);
- if (t && IDENTIFIER_TEMPLATE (t))
- overload_template_name (t, 1);
-#endif
- reset_specialization();
-
- /* In case this is a local class within a template
- function, we save the current tree structure so
- that we can get it back later. */
- begin_tree ();
- }
+ { $<ttype>0 = begin_class_definition ($<ttype>0); }
;
self_reference:
/* empty */
{
- $$ = build_self_reference ();
+ finish_member_declaration (build_self_reference ());
}
;
opt.component_decl_list:
self_reference
- { if ($$) $$ = build_tree_list (access_public_node, $$); }
| self_reference component_decl_list
- {
- if (current_aggr == signature_type_node)
- $$ = build_tree_list (access_public_node, $2);
- else
- $$ = build_tree_list (access_default_node, $2);
- if ($1) $$ = tree_cons (access_public_node, $1, $$);
- }
- | opt.component_decl_list VISSPEC ':' component_decl_list
- {
- tree visspec = $2;
+ | opt.component_decl_list access_specifier component_decl_list
+ | opt.component_decl_list access_specifier
+ ;
+access_specifier:
+ VISSPEC ':'
+ {
if (current_aggr == signature_type_node)
{
error ("access specifier not allowed in signature");
- visspec = access_public_node;
+ $1 = access_public_node;
}
- $$ = chainon ($$, build_tree_list (visspec, $4));
- }
- | opt.component_decl_list VISSPEC ':'
- {
- if (current_aggr == signature_type_node)
- error ("access specifier not allowed in signature");
- }
+
+ current_access_specifier = $1;
+ }
;
/* Note: we no longer warn about the semicolon after a component_decl_list.
ARM $9.2 says that the semicolon is optional, and therefore allowed. */
component_decl_list:
component_decl
- { if ($$ == void_type_node) $$ = NULL_TREE;
+ {
+ finish_member_declaration ($1);
}
| component_decl_list component_decl
- { /* In pushdecl, we created a reverse list of names
- in this binding level. Make sure that the chain
- of what we're trying to add isn't the item itself
- (which can happen with what pushdecl's doing). */
- if ($2 != NULL_TREE && $2 != void_type_node)
- {
- if (TREE_CHAIN ($2) != $$)
- $$ = chainon ($$, $2);
- else
- $$ = $2;
- }
+ {
+ finish_member_declaration ($2);
}
;
component_decl:
component_decl_1 ';'
- { }
| component_decl_1 '}'
{ error ("missing ';' before right brace");
yyungetc ('}', 0); }
@@ -2495,16 +2417,19 @@ component_decl:
{ $$ = $2;
pedantic = $<itype>1; }
| template_header component_decl
- { $$ = finish_member_template_decl ($1, $2); }
+ {
+ if ($2)
+ $$ = finish_member_template_decl ($2);
+ else
+ /* The component was already processed. */
+ $$ = NULL_TREE;
+
+ finish_template_decl ($1);
+ }
| template_header typed_declspecs ';'
- {
- note_list_got_semicolon ($2.t);
- grok_x_components ($2.t, NULL_TREE);
- if (TYPE_CONTEXT (TREE_VALUE ($2.t)) != current_class_type)
- /* The component was in fact a friend
- declaration. */
- $2.t = NULL_TREE;
- $$ = finish_member_template_decl ($1, $2.t);
+ {
+ $$ = finish_member_class_template ($2.t);
+ finish_template_decl ($1);
}
;
@@ -2513,9 +2438,32 @@ component_decl_1:
speed; we need to call grok_x_components for enums, so the
speedup would be insignificant. */
typed_declspecs components
- { $$ = grok_x_components ($1.t, $2); }
+ {
+ /* Most of the productions for component_decl only
+ allow the creation of one new member, so we call
+ finish_member_declaration in component_decl_list.
+ For this rule and the next, however, there can be
+ more than one member, e.g.:
+
+ int i, j;
+
+ and we need the first member to be fully
+ registered before the second is processed.
+ Therefore, the rules for components take care of
+ this processing. To avoid registering the
+ components more than once, we send NULL_TREE up
+ here; that lets finish_member_declaration now
+ that there is nothing to do. */
+ if (!$2)
+ grok_x_components ($1.t);
+ $$ = NULL_TREE;
+ }
| declmods notype_components
- { $$ = grok_x_components ($1, $2); }
+ {
+ if (!$2)
+ grok_x_components ($1);
+ $$ = NULL_TREE;
+ }
| notype_declarator maybeasm maybe_attribute maybe_init
{ $$ = grokfield ($$, NULL_TREE, $4, $2,
build_tree_list ($3, NULL_TREE)); }
@@ -2550,31 +2498,41 @@ component_decl_1:
/* ??? Huh? ^^^ */
components:
/* empty: possibly anonymous */
- { $$ = NULL_TREE; }
+ { $$ = 0; }
| component_declarator0
+ {
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ $1 = finish_member_template_decl ($1);
+ finish_member_declaration ($1);
+ $$ = 1;
+ }
| components ',' component_declarator
- {
- /* In this context, void_type_node encodes
- friends. They have been recorded elsewhere. */
- if ($$ == void_type_node)
- $$ = $3;
- else
- $$ = chainon ($$, $3);
+ {
+ check_multiple_declarators ();
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ $3 = finish_member_template_decl ($3);
+ finish_member_declaration ($3);
+ $$ = 2;
}
;
notype_components:
/* empty: possibly anonymous */
- { $$ = NULL_TREE; }
+ { $$ = 0; }
| notype_component_declarator0
+ {
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ $1 = finish_member_template_decl ($1);
+ finish_member_declaration ($1);
+ $$ = 1;
+ }
| notype_components ',' notype_component_declarator
- {
- /* In this context, void_type_node encodes
- friends. They have been recorded elsewhere. */
- if ($$ == void_type_node)
- $$ = $3;
- else
- $$ = chainon ($$, $3);
+ {
+ check_multiple_declarators ();
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ())
+ $3 = finish_member_template_decl ($3);
+ finish_member_declaration ($3);
+ $$ = 2;
}
;
@@ -2663,9 +2621,9 @@ enumlist:
enumerator:
identifier
- { $$ = build_enumerator ($$, NULL_TREE); }
+ { $$ = build_enumerator ($$, NULL_TREE, current_enum_type); }
| identifier '=' expr_no_commas
- { $$ = build_enumerator ($$, $3); }
+ { $$ = build_enumerator ($$, $3, current_enum_type); }
;
/* ANSI new-type-id (5.3.4) */
@@ -2677,14 +2635,16 @@ new_type_id:
{ $$.t = build_decl_list ($1.t, NULL_TREE);
$$.new_type_flag = $1.new_type_flag; }
/* GNU extension to allow arrays of arbitrary types with
- non-constant dimension. */
- | '(' type_id ')' '[' expr ']'
+ non-constant dimension. For the use of begin_new_placement
+ here, see the comments in unary_expr above. */
+ | '(' .begin_new_placement type_id .finish_new_placement
+ '[' expr ']'
{
if (pedantic)
pedwarn ("ANSI C++ forbids array dimensions with parenthesized type in new");
- $$.t = build_parse_node (ARRAY_REF, TREE_VALUE ($2.t), $5);
- $$.t = build_decl_list (TREE_PURPOSE ($2.t), $$.t);
- $$.new_type_flag = $2.new_type_flag;
+ $$.t = build_parse_node (ARRAY_REF, TREE_VALUE ($3.t), $6);
+ $$.t = build_decl_list (TREE_PURPOSE ($3.t), $$.t);
+ $$.new_type_flag = $3.new_type_flag;
}
;
@@ -2848,20 +2808,11 @@ complex_direct_notype_declarator:
| direct_notype_declarator '[' ']'
{ $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); }
| notype_qualified_id
- { if (OP0 ($$) != current_class_type)
- {
- push_nested_class (OP0 ($$), 3);
- TREE_COMPLEXITY ($$) = current_class_depth;
- }
- }
+ { enter_scope_of ($1); }
| nested_name_specifier notype_template_declarator
{ got_scope = NULL_TREE;
$$ = build_parse_node (SCOPE_REF, $1, $2);
- if ($1 != current_class_type)
- {
- push_nested_class ($1, 3);
- TREE_COMPLEXITY ($$) = current_class_depth;
- }
+ enter_scope_of ($$);
}
;
@@ -2897,7 +2848,6 @@ functional_cast:
| typespec fcast_or_absdcl %prec EMPTY
{ $$ = reparse_absdcl_as_expr ($1.t, $2); }
;
-
type_name:
TYPENAME
| SELFNAME
@@ -2927,7 +2877,7 @@ nested_name_specifier_1:
&& ! IDENTIFIER_CLASS_VALUE ($1))
pushdecl_class_level ($$);
}
- got_scope = $$ = TREE_TYPE ($$);
+ got_scope = $$ = TYPE_MAIN_VARIANT (TREE_TYPE ($$));
}
| SELFNAME SCOPE
{
@@ -3014,7 +2964,9 @@ typename_sub2:
if (TREE_CODE ($1) != IDENTIFIER_NODE)
$1 = lastiddecl;
- got_scope = $$ = complete_type (TREE_TYPE ($1));
+ /* Retrieve the type for the identifier, which might involve
+ some computation. */
+ got_scope = $$ = complete_type (IDENTIFIER_TYPE_VALUE ($1));
if ($$ == error_mark_node)
cp_error ("`%T' is not a class or namespace", $1);
@@ -3335,6 +3287,10 @@ simple_stmt:
| ';'
{ finish_stmt (); }
| try_block
+ | using_directive
+ | namespace_using_decl
+ { do_local_using_decl ($1); }
+ | namespace_alias
;
function_try_block:
@@ -3345,7 +3301,9 @@ function_try_block:
expand_start_early_try_stmts ();
}
ctor_initializer_opt compstmt
- { expand_start_all_catch (); }
+ {
+ expand_start_all_catch ();
+ }
handler_seq
{
int nested = (hack_decl_function_context
@@ -3489,8 +3447,7 @@ parmlist:
}
| complex_parmlist
| type_id
- { $$ = tree_cons (NULL_TREE, $1.t, void_list_node);
- TREE_PARMLIST ($$) = 1;
+ { $$ = finish_parmlist (build_tree_list (NULL_TREE, $1.t), 0);
check_for_new_type ("inside parameter list", $1); }
;
@@ -3498,49 +3455,24 @@ parmlist:
as it is ambiguous and must be disambiguated elsewhere. */
complex_parmlist:
parms
- {
- $$ = chainon ($$, void_list_node);
- TREE_PARMLIST ($$) = 1;
- }
+ { $$ = finish_parmlist ($$, 0); }
| parms_comma ELLIPSIS
- {
- TREE_PARMLIST ($$) = 1;
- }
+ { $$ = finish_parmlist ($1, 1); }
/* C++ allows an ellipsis without a separating ',' */
| parms ELLIPSIS
- {
- TREE_PARMLIST ($$) = 1;
- }
+ { $$ = finish_parmlist ($1, 1); }
| type_id ELLIPSIS
- {
- $$ = build_tree_list (NULL_TREE, $1.t);
- TREE_PARMLIST ($$) = 1;
- }
+ { $$ = finish_parmlist (build_tree_list (NULL_TREE,
+ $1.t), 1); }
| ELLIPSIS
- {
- $$ = NULL_TREE;
- }
- | TYPENAME_ELLIPSIS
- {
- TREE_PARMLIST ($$) = 1;
- }
- | parms TYPENAME_ELLIPSIS
- {
- TREE_PARMLIST ($$) = 1;
- }
- | type_id TYPENAME_ELLIPSIS
- {
- $$ = build_tree_list (NULL_TREE, $1.t);
- TREE_PARMLIST ($$) = 1;
- }
+ { $$ = finish_parmlist (NULL_TREE, 1); }
| parms ':'
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
parenthesis. */
yyerror ("possibly missing ')'");
- $$ = chainon ($$, void_list_node);
- TREE_PARMLIST ($$) = 1;
+ $$ = finish_parmlist ($1, 0);
yyungetc (':', 0);
yychar = ')';
}
@@ -3550,8 +3482,8 @@ complex_parmlist:
parse errors, for example, a missing right
parenthesis. */
yyerror ("possibly missing ')'");
- $$ = tree_cons (NULL_TREE, $1.t, void_list_node);
- TREE_PARMLIST ($$) = 1;
+ $$ = finish_parmlist (build_tree_list (NULL_TREE,
+ $1.t), 0);
yyungetc (':', 0);
yychar = ')';
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 209e23e22c3..c493bea4f5f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -63,6 +63,7 @@ int minimal_parse_mode;
int processing_specialization;
int processing_explicit_instantiation;
+int processing_template_parmlist;
static int template_header_count;
static tree saved_trees;
@@ -70,31 +71,40 @@ static tree saved_trees;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-static int unify PROTO((tree, tree, int, tree, tree, int, int*));
+#define UNIFY_ALLOW_NONE 0
+#define UNIFY_ALLOW_MORE_CV_QUAL 1
+#define UNIFY_ALLOW_LESS_CV_QUAL 2
+#define UNIFY_ALLOW_DERIVED 4
+
+static int unify PROTO((tree, tree, tree, tree, int, int*));
static void add_pending_template PROTO((tree));
static int push_tinst_level PROTO((tree));
static tree classtype_mangled_name PROTO((tree));
-static char *mangle_class_name_for_template PROTO((char *, tree, tree, tree));
+static char *mangle_class_name_for_template PROTO((char *, tree, tree));
static tree tsubst_expr_values PROTO((tree, tree));
static int list_eq PROTO((tree, tree));
-static tree get_class_bindings PROTO((tree, tree, tree, tree));
-static tree coerce_template_parms PROTO((tree, tree, tree, int, int, int));
-static tree tsubst_enum PROTO((tree, tree, tree *));
+static tree get_class_bindings PROTO((tree, tree, tree));
+static tree coerce_template_parms PROTO((tree, tree, tree, int, int));
+static void tsubst_enum PROTO((tree, tree, tree));
static tree add_to_template_args PROTO((tree, tree));
+static tree add_outermost_template_args PROTO((tree, tree));
+static void maybe_adjust_types_for_deduction PROTO((unification_kind_t, tree*,
+ tree*));
static int type_unification_real PROTO((tree, tree, tree, tree,
- int, int, int, int*));
-static tree complete_template_args PROTO((tree, tree, int));
+ int, unification_kind_t, int, int*));
static void note_template_header PROTO((int));
static tree maybe_fold_nontype_arg PROTO((tree));
static tree convert_nontype_argument PROTO((tree, tree));
+static tree convert_template_argument PROTO ((tree, tree, tree, int,
+ int , tree));
static tree get_bindings_overload PROTO((tree, tree, tree));
static int for_each_template_parm PROTO((tree, tree_fn_t, void*));
static tree build_template_parm_index PROTO((int, int, int, tree, tree));
-static tree original_template PROTO((tree));
static int inline_needs_template_parms PROTO((tree));
static void push_inline_template_parms_recursive PROTO((tree, int));
static tree retrieve_specialization PROTO((tree, tree));
-static void register_specialization PROTO((tree, tree, tree));
+static tree register_specialization PROTO((tree, tree, tree));
+static int unregister_specialization PROTO((tree, tree));
static void print_candidates PROTO((tree));
static tree reduce_template_parm_level PROTO((tree, tree, int));
static tree build_template_decl PROTO((tree, tree));
@@ -104,6 +114,82 @@ static tree tsubst_friend_class PROTO((tree, tree));
static tree get_bindings_real PROTO((tree, tree, tree, int));
static int template_decl_level PROTO((tree));
static tree maybe_get_template_decl_from_type_decl PROTO((tree));
+static int check_cv_quals_for_unify PROTO((int, tree, tree));
+static tree tsubst_template_arg_vector PROTO((tree, tree));
+static tree tsubst_template_parms PROTO((tree, tree));
+static void regenerate_decl_from_template PROTO((tree, tree));
+static int is_member_template_class PROTO((tree));
+static tree most_specialized PROTO((tree, tree, tree));
+static tree most_specialized_class PROTO((tree, tree));
+static tree most_general_template PROTO((tree));
+static void set_mangled_name_for_template_decl PROTO((tree));
+static int template_class_depth_real PROTO((tree, int));
+static tree tsubst_aggr_type PROTO((tree, tree, tree, int));
+static tree tsubst_decl PROTO((tree, tree, tree, tree));
+static tree tsubst_arg_types PROTO((tree, tree, tree));
+static void check_specialization_scope PROTO((void));
+static tree process_partial_specialization PROTO((tree));
+static void set_current_access_from_decl PROTO((tree));
+
+/* We use TREE_VECs to hold template arguments. If there is only one
+ level of template arguments, then the TREE_VEC contains the
+ arguments directly. If there is more than one level of template
+ arguments, then each entry in the TREE_VEC is itself a TREE_VEC,
+ containing the template arguments for a single level. The first
+ entry in the outer TREE_VEC is the outermost level of template
+ parameters; the last is the innermost.
+
+ It is incorrect to ever form a template argument vector containing
+ only one level of arguments, but which is a TREE_VEC containing as
+ its only entry the TREE_VEC for that level. */
+
+/* Non-zero if the template arguments is actually a vector of vectors,
+ rather than just a vector. */
+#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
+ (NODE != NULL_TREE \
+ && TREE_CODE (NODE) == TREE_VEC \
+ && TREE_VEC_LENGTH (NODE) > 0 \
+ && TREE_VEC_ELT (NODE, 0) != NULL_TREE \
+ && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC)
+
+/* The depth of a template argument vector. When called directly by
+ the parser, we use a TREE_LIST rather than a TREE_VEC to represent
+ template arguments. In fact, we may even see NULL_TREE if there
+ are no template arguments. In both of those cases, there is only
+ one level of template arguments. */
+#define TMPL_ARGS_DEPTH(NODE) \
+ (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (NODE) ? TREE_VEC_LENGTH (NODE) : 1)
+
+/* The LEVELth level of the template ARGS. Note that template
+ parameter levels are indexed from 1, not from 0. */
+#define TMPL_ARGS_LEVEL(ARGS, LEVEL) \
+ (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS) \
+ ? TREE_VEC_ELT ((ARGS), (LEVEL) - 1) : ARGS)
+
+/* Set the LEVELth level of the template ARGS to VAL. This macro does
+ not work with single-level argument vectors. */
+#define SET_TMPL_ARGS_LEVEL(ARGS, LEVEL, VAL) \
+ (TREE_VEC_ELT ((ARGS), (LEVEL) - 1) = (VAL))
+
+/* Accesses the IDXth parameter in the LEVELth level of the ARGS. */
+#define TMPL_ARG(ARGS, LEVEL, IDX) \
+ (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX))
+
+/* Set the IDXth element in the LEVELth level of ARGS to VAL. This
+ macro does not work with single-level argument vectors. */
+#define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL) \
+ (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL))
+
+/* Given a single level of template arguments in NODE, return the
+ number of arguments. */
+#define NUM_TMPL_ARGS(NODE) \
+ ((NODE) == NULL_TREE ? 0 \
+ : (TREE_CODE (NODE) == TREE_VEC \
+ ? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
+
+/* The number of levels of template parameters given by NODE. */
+#define TMPL_PARMS_DEPTH(NODE) \
+ (TREE_INT_CST_HIGH (TREE_PURPOSE (NODE)))
/* Do any processing required when DECL (a member template declaration
using TEMPLATE_PARAMETERS as its innermost parameter list) is
@@ -111,17 +197,15 @@ static tree maybe_get_template_decl_from_type_decl PROTO((tree));
it is a specialization, in which case the DECL itself is returned. */
tree
-finish_member_template_decl (template_parameters, decl)
- tree template_parameters;
+finish_member_template_decl (decl)
tree decl;
{
- if (template_parameters)
- end_template_decl ();
- else
- end_specialization ();
-
if (decl == NULL_TREE || decl == void_type_node)
return NULL_TREE;
+ else if (decl == error_mark_node)
+ /* By returning NULL_TREE, the parser will just ignore this
+ declaration. We have already issued the error. */
+ return NULL_TREE;
else if (TREE_CODE (decl) == TREE_LIST)
{
/* Assume that the class is the only declspec. */
@@ -147,7 +231,6 @@ finish_member_template_decl (template_parameters, decl)
}
else
cp_error ("invalid member template declaration `%D'", decl);
-
return error_mark_node;
}
@@ -162,35 +245,59 @@ finish_member_template_decl (template_parameters, decl)
struct B {};
};
- A<T>::B<U> has depth two, while A<T> has depth one. Also,
- both A<T>::B<int> and A<int>::B<U> have depth one. */
+ A<T>::B<U> has depth two, while A<T> has depth one.
+ Both A<T>::B<int> and A<int>::B<U> have depth one, if
+ COUNT_SPECIALIZATIONS is 0 or if they are instantiations, not
+ specializations.
+
+ This function is guaranteed to return 0 if passed NULL_TREE so
+ that, for example, `template_class_depth (current_class_type)' is
+ always safe. */
int
-template_class_depth (type)
+template_class_depth_real (type, count_specializations)
tree type;
+ int count_specializations;
{
int depth;
- for (depth = 0; type && TREE_CODE (type) != FUNCTION_DECL;
- type = TYPE_CONTEXT (type))
- if (CLASSTYPE_TEMPLATE_INFO (type)
- && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
- && uses_template_parms (CLASSTYPE_TI_ARGS (type)))
- ++depth;
+ for (depth = 0;
+ type && TREE_CODE (type) != NAMESPACE_DECL;
+ type = (TREE_CODE (type) == FUNCTION_DECL)
+ ? DECL_REAL_CONTEXT (type) : TYPE_CONTEXT (type))
+ {
+ if (TREE_CODE (type) != FUNCTION_DECL)
+ {
+ if (CLASSTYPE_TEMPLATE_INFO (type)
+ && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
+ && ((count_specializations
+ && CLASSTYPE_TEMPLATE_SPECIALIZATION (type))
+ || uses_template_parms (CLASSTYPE_TI_ARGS (type))))
+ ++depth;
+ }
+ else
+ {
+ if (DECL_TEMPLATE_INFO (type)
+ && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (type))
+ && ((count_specializations
+ && DECL_TEMPLATE_SPECIALIZATION (type))
+ || uses_template_parms (DECL_TI_ARGS (type))))
+ ++depth;
+ }
+ }
return depth;
}
-/* Return the original template for this decl, disregarding any
- specializations. */
+/* Returns the template nesting level of the indicated class TYPE.
+ Like template_class_depth_real, but instantiations do not count in
+ the depth. */
-static tree
-original_template (decl)
- tree decl;
+int
+template_class_depth (type)
+ tree type;
{
- while (DECL_TEMPLATE_INFO (decl))
- decl = DECL_TI_TEMPLATE (decl);
- return decl;
+ return template_class_depth_real (type, /*count_specializations=*/0);
}
/* Returns 1 if processing DECL as part of do_pending_inlines
@@ -203,7 +310,7 @@ inline_needs_template_parms (decl)
if (! DECL_TEMPLATE_INFO (decl))
return 0;
- return (list_length (DECL_TEMPLATE_PARMS (original_template (decl)))
+ return (TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (most_general_template (decl)))
> (processing_template_decl + DECL_TEMPLATE_SPECIALIZATION (decl)));
}
@@ -271,9 +378,9 @@ maybe_begin_member_template_processing (decl)
if (! inline_needs_template_parms (decl))
return;
- parms = DECL_TEMPLATE_PARMS (original_template (decl));
+ parms = DECL_TEMPLATE_PARMS (most_general_template (decl));
- levels = list_length (parms) - processing_template_decl;
+ levels = TMPL_PARMS_DEPTH (parms) - processing_template_decl;
if (DECL_TEMPLATE_SPECIALIZATION (decl))
{
@@ -287,8 +394,7 @@ maybe_begin_member_template_processing (decl)
/* Undo the effects of begin_member_template_processing. */
void
-maybe_end_member_template_processing (decl)
- tree decl;
+maybe_end_member_template_processing ()
{
if (! processing_template_decl)
return;
@@ -349,7 +455,7 @@ is_member_template (t)
/* If there are more levels of template parameters than
there are template classes surrounding the declaration,
then we have a member template. */
- && (list_length (DECL_TEMPLATE_PARMS (tmpl)) >
+ && (TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)) >
template_class_depth (DECL_CLASS_CONTEXT (t))))
return 1;
}
@@ -357,129 +463,89 @@ is_member_template (t)
return 0;
}
-/* Return a new template argument vector which contains all of ARGS
- for all outer templates TYPE is contained in, but has as its
- innermost set of arguments the EXTRA_ARGS. If UNBOUND_ONLY, we
- are only interested in unbound template arguments, not arguments from
- enclosing templates that have been instantiated already. */
+/* Returns non-zero iff T is a member template class. See
+ is_member_template for a description of what precisely constitutes
+ a member template. */
-static tree
-complete_template_args (tmpl, extra_args, unbound_only)
- tree tmpl, extra_args;
- int unbound_only;
+int
+is_member_template_class (t)
+ tree t;
{
- /* depth is the number of levels of enclosing args we're adding. */
- int depth, i;
- tree args, new_args, spec_args = NULL_TREE;
-
- my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
- my_friendly_assert (TREE_CODE (extra_args) == TREE_VEC, 0);
-
- if (DECL_TEMPLATE_INFO (tmpl) && !unbound_only)
- {
- /* A specialization of a member template of a template class shows up
- as a TEMPLATE_DECL with DECL_TEMPLATE_SPECIALIZATION set.
- DECL_TI_ARGS is the specialization args, and DECL_TI_TEMPLATE
- is the template being specialized. */
- if (DECL_TEMPLATE_SPECIALIZATION (tmpl))
- {
- spec_args = DECL_TI_ARGS (tmpl);
- tmpl = DECL_TI_TEMPLATE (tmpl);
- }
-
- if (DECL_TEMPLATE_INFO (tmpl))
- {
- /* A partial instantiation of a member template shows up as a
- TEMPLATE_DECL with DECL_TEMPLATE_INFO. DECL_TI_ARGS is
- all the bound template arguments. */
- args = DECL_TI_ARGS (tmpl);
- if (TREE_CODE (TREE_VEC_ELT (args, 0)) != TREE_VEC)
- depth = 1;
- else
- depth = TREE_VEC_LENGTH (args);
- }
- else
- /* If we are a specialization, we might have no previously bound
- template args. */
- depth = 0;
-
- new_args = make_tree_vec (depth + 1 + (!!spec_args));
-
- if (depth == 1)
- TREE_VEC_ELT (new_args, 0) = args;
- else
- for (i = 0; i < depth; ++i)
- TREE_VEC_ELT (new_args, i) = TREE_VEC_ELT (args, i);
- }
- else
- {
- tree type;
- int skip;
-
- /* For unbound args, we have to do more work. We are getting bindings
- for the innermost args from extra_args, so we start from our
- context and work out until we've seen all the args. We need to
- do it this way to handle partial specialization. */
+ if (!DECL_CLASS_TEMPLATE_P (t))
+ /* Anything that isn't a class template, is certainly not a member
+ template. */
+ return 0;
- depth = list_length (DECL_TEMPLATE_PARMS (tmpl)) - 1;
- if (depth == 0)
- return extra_args;
+ if (!DECL_CLASS_SCOPE_P (t))
+ /* Anything whose context isn't a class type is surely not a
+ member template. */
+ return 0;
- new_args = make_tree_vec (depth + 1);
+ /* If there are more levels of template parameters than there are
+ template classes surrounding the declaration, then we have a
+ member template. */
+ return (TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (t)) >
+ template_class_depth (DECL_CONTEXT (t)));
+}
- /* If this isn't a member template, extra_args is for the innermost
- template class, so skip over it. */
- skip = (! is_member_template (tmpl));
+/* Return a new template argument vector which contains all of ARGS,
+ but has as its innermost set of arguments the EXTRA_ARGS. The
+ resulting vector will be built on a temporary obstack, and so must
+ be explicitly copied to the permanent obstack, if required. */
- type = DECL_REAL_CONTEXT (tmpl);
- for (i = depth; i; type = TYPE_CONTEXT (type))
- if (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)))
- {
- if (skip)
- skip = 0;
- else
- {
- --i;
- TREE_VEC_ELT (new_args, i) = CLASSTYPE_TI_ARGS (type);
- }
- }
- }
+static tree
+add_to_template_args (args, extra_args)
+ tree args;
+ tree extra_args;
+{
+ tree new_args;
+ int extra_depth;
+ int i;
+ int j;
- TREE_VEC_ELT (new_args, depth) = extra_args;
+ extra_depth = TMPL_ARGS_DEPTH (extra_args);
+ new_args = make_temp_vec (TMPL_ARGS_DEPTH (args) + extra_depth);
- if (spec_args)
- TREE_VEC_ELT (new_args, depth + 1) = spec_args;
+ for (i = 1; i <= TMPL_ARGS_DEPTH (args); ++i)
+ SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (args, i));
+ for (j = 1; j <= extra_depth; ++j, ++i)
+ SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (extra_args, j));
+
return new_args;
}
-/* Return a new template argument vector which contains all of ARGS,
- but has as its innermost set of arguments the EXTRA_ARGS. */
+/* Like add_to_template_args, but only the outermost ARGS are added to
+ the EXTRA_ARGS. In particular, all but TMPL_ARGS_DEPTH
+ (EXTRA_ARGS) levels are added. This function is used to combine
+ the template arguments from a partial instantiation with the
+ template arguments used to attain the full instantiation from the
+ partial instantiation. */
static tree
-add_to_template_args (args, extra_args)
+add_outermost_template_args (args, extra_args)
tree args;
tree extra_args;
{
tree new_args;
- if (TREE_CODE (TREE_VEC_ELT (args, 0)) != TREE_VEC)
- {
- new_args = make_tree_vec (2);
- TREE_VEC_ELT (new_args, 0) = args;
- }
- else
- {
- int i;
+ /* If there are more levels of EXTRA_ARGS than there are ARGS,
+ something very fishy is going on. */
+ my_friendly_assert (TMPL_ARGS_DEPTH (args) >= TMPL_ARGS_DEPTH (extra_args),
+ 0);
- new_args = make_tree_vec (TREE_VEC_LENGTH (args) + 1);
+ /* If *all* the new arguments will be the EXTRA_ARGS, just return
+ them. */
+ if (TMPL_ARGS_DEPTH (args) == TMPL_ARGS_DEPTH (extra_args))
+ return extra_args;
- for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
- TREE_VEC_ELT (new_args, i) = TREE_VEC_ELT (args, i);
- }
-
- TREE_VEC_ELT (new_args,
- TREE_VEC_LENGTH (new_args) - 1) = extra_args;
+ /* For the moment, we make ARGS look like it contains fewer levels. */
+ TREE_VEC_LENGTH (args) -= TMPL_ARGS_DEPTH (extra_args);
+
+ new_args = add_to_template_args (args, extra_args);
+
+ /* Now, we restore ARGS to its full dimensions. */
+ TREE_VEC_LENGTH (args) += TMPL_ARGS_DEPTH (extra_args);
return new_args;
}
@@ -507,15 +573,50 @@ begin_template_parm_list ()
pushlevel (0);
declare_pseudo_global_level ();
++processing_template_decl;
+ ++processing_template_parmlist;
note_template_header (0);
}
+/* This routine is called when a specialization is declared. If it is
+ illegal to declare a specialization here, an error is reported. */
+
+void
+check_specialization_scope ()
+{
+ tree scope = current_scope ();
+
+ /* [temp.expl.spec]
+
+ An explicit specialization shall be declared in the namespace of
+ which the template is a member, or, for member templates, in the
+ namespace of which the enclosing class or enclosing class
+ template is a member. An explicit specialization of a member
+ function, member class or static data member of a class template
+ shall be declared in the namespace of which the class template
+ is a member. */
+ if (scope && TREE_CODE (scope) != NAMESPACE_DECL)
+ cp_error ("explicit specialization in non-namespace scope `%D'",
+ scope);
+
+ /* [temp.expl.spec]
+
+ In an explicit specialization declaration for a member of a class
+ template or a member template that appears in namespace scope,
+ the member template and some of its enclosing class templates may
+ remain unspecialized, except that the declaration shall not
+ explicitly specialize a class member template if its enclosing
+ class templates are not explicitly specialized as well. */
+ if (current_template_parms)
+ cp_error ("enclosing class templates are not explicitly specialized");
+}
+
/* We've just seen template <>. */
void
begin_specialization ()
{
note_template_header (1);
+ check_specialization_scope ();
}
/* Called at then end of processing a declaration preceeded by
@@ -564,6 +665,27 @@ end_explicit_instantiation ()
--processing_explicit_instantiation;
}
+/* The TYPE is being declared. If it is a template type, that means it
+ is a partial specialization. Do appropriate error-checking. */
+
+void
+maybe_process_partial_specialization (type)
+ tree type;
+{
+ if (IS_AGGR_TYPE (type) && CLASSTYPE_USE_TEMPLATE (type))
+ {
+ if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)
+ && TYPE_SIZE (type) == NULL_TREE)
+ {
+ SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type);
+ if (processing_template_decl)
+ push_template_decl (TYPE_MAIN_DECL (type));
+ }
+ else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
+ cp_error ("specialization of `%T' after instantiation", type);
+ }
+}
+
/* Retrieve the specialization (in the sense of [temp.spec] - a
specialization is either an instantiation or an explicit
specialization) of TMPL for the given template ARGS. If there is
@@ -580,6 +702,12 @@ retrieve_specialization (tmpl, args)
my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
+ /* There should be as many levels of arguments as there are
+ levels of parameters. */
+ my_friendly_assert (TMPL_ARGS_DEPTH (args)
+ == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)),
+ 0);
+
for (s = DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
s != NULL_TREE;
s = TREE_CHAIN (s))
@@ -623,9 +751,10 @@ is_specialization_of (decl, tmpl)
}
/* Register the specialization SPEC as a specialization of TMPL with
- the indicated ARGS. */
+ the indicated ARGS. Returns SPEC, or an equivalent prior
+ declaration, if available. */
-static void
+static tree
register_specialization (spec, tmpl, args)
tree spec;
tree tmpl;
@@ -635,14 +764,27 @@ register_specialization (spec, tmpl, args)
my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
- if (TREE_CODE (spec) != TEMPLATE_DECL
- && list_length (DECL_TEMPLATE_PARMS (tmpl)) > 1)
- /* Avoid registering function declarations as
- specializations of member templates, as would otherwise
- happen with out-of-class specializations of member
- templates. */
- return;
+ if (TREE_CODE (spec) == FUNCTION_DECL
+ && uses_template_parms (DECL_TI_ARGS (spec)))
+ /* This is the FUNCTION_DECL for a partial instantiation. Don't
+ register it; we want the corresponding TEMPLATE_DECL instead.
+ We use `uses_template_parms (DECL_TI_ARGS (spec))' rather than
+ the more obvious `uses_template_parms (spec)' to avoid problems
+ with default function arguments. In particular, given
+ something like this:
+
+ template <class T> void f(T t1, T t = T())
+
+ the default argument expression is not substituted for in an
+ instantiation unless and until it is actually needed. */
+ return spec;
+ /* There should be as many levels of arguments as there are
+ levels of parameters. */
+ my_friendly_assert (TMPL_ARGS_DEPTH (args)
+ == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)),
+ 0);
+
for (s = DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
s != NULL_TREE;
s = TREE_CHAIN (s))
@@ -659,7 +801,7 @@ register_specialization (spec, tmpl, args)
{
cp_error ("specialization of %D after instantiation",
fn);
- return;
+ return spec;
}
else
{
@@ -668,25 +810,59 @@ register_specialization (spec, tmpl, args)
the second is an explicit specialization, and
the implicit instantiation has not yet been
used. That situation can occur if we have
- implicitly instantiated a member function of
- class type, and then specialized it later. */
- TREE_VALUE (s) = spec;
- return;
+ implicitly instantiated a member function and
+ then specialized it later.
+
+ We can also wind up here if a friend
+ declaration that looked like an instantiation
+ turns out to be a specialization:
+
+ template <class T> void foo(T);
+ class S { friend void foo<>(int) };
+ template <> void foo(int);
+
+ We transform the existing DECL in place so that
+ any pointers to it become pointers to the
+ updated declaration. */
+ duplicate_decls (spec, TREE_VALUE (s));
+ return TREE_VALUE (s);
}
}
else if (DECL_TEMPLATE_SPECIALIZATION (fn))
{
- if (DECL_INITIAL (fn))
- cp_error ("duplicate specialization of %D", fn);
-
- TREE_VALUE (s) = spec;
- return;
+ duplicate_decls (spec, TREE_VALUE (s));
+ return TREE_VALUE (s);
}
}
}
DECL_TEMPLATE_SPECIALIZATIONS (tmpl)
= perm_tree_cons (args, spec, DECL_TEMPLATE_SPECIALIZATIONS (tmpl));
+
+ return spec;
+}
+
+/* Unregister the specialization SPEC as a specialization of TMPL.
+ Returns nonzero if the SPEC was listed as a specialization of
+ TMPL. */
+
+static int
+unregister_specialization (spec, tmpl)
+ tree spec;
+ tree tmpl;
+{
+ tree* s;
+
+ for (s = &DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
+ *s != NULL_TREE;
+ s = &TREE_CHAIN (*s))
+ if (TREE_VALUE (*s) == spec)
+ {
+ *s = TREE_CHAIN (*s);
+ return 1;
+ }
+
+ return 0;
}
/* Print the list of candidate FNS in an error message. */
@@ -726,26 +902,31 @@ determine_specialization (template_id, decl, targs_out,
int need_member_template;
int complain;
{
- tree fns = TREE_OPERAND (template_id, 0);
- tree targs_in = TREE_OPERAND (template_id, 1);
+ tree fns, targs_in;
tree templates = NULL_TREE;
tree fn;
- int overloaded;
int i;
*targs_out = NULL_TREE;
- if (is_overloaded_fn (fns))
- fn = get_first_fn (fns);
- else
- fn = NULL_TREE;
+ if (template_id == error_mark_node)
+ return error_mark_node;
+
+ fns = TREE_OPERAND (template_id, 0);
+ targs_in = TREE_OPERAND (template_id, 1);
- overloaded = really_overloaded_fn (fns);
- for (; fn != NULL_TREE;
- fn = overloaded ? DECL_CHAIN (fn) : NULL_TREE)
+ if (fns == error_mark_node)
+ return error_mark_node;
+
+ /* Check for baselinks. */
+ if (TREE_CODE (fns) == TREE_LIST)
+ fns = TREE_VALUE (fns);
+
+ for (; fns; fns = OVL_NEXT (fns))
{
tree tmpl;
+ fn = OVL_CURRENT (fns);
if (!need_member_template
&& TREE_CODE (fn) == FUNCTION_DECL
&& DECL_FUNCTION_MEMBER_P (fn)
@@ -777,7 +958,7 @@ determine_specialization (template_id, decl, targs_out,
NULL_TREE,
NULL_TREE,
targs_in,
- 1, 1);
+ DEDUCE_EXACT, 1);
if (i == 0)
/* Unification was successful. */
@@ -790,13 +971,26 @@ determine_specialization (template_id, decl, targs_out,
if (decl != NULL_TREE)
{
tree tmpl = most_specialized (templates, decl, targs_in);
+ tree inner_args;
+ tree tmpl_args;
if (tmpl == error_mark_node)
goto ambiguous;
else if (tmpl == NULL_TREE)
goto no_match;
- *targs_out = get_bindings (tmpl, decl, targs_in);
+ inner_args = get_bindings (tmpl, decl, targs_in);
+ tmpl_args = DECL_TI_ARGS (DECL_RESULT (tmpl));
+ if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (tmpl_args))
+ {
+ *targs_out = copy_node (tmpl_args);
+ SET_TMPL_ARGS_LEVEL (*targs_out,
+ TMPL_ARGS_DEPTH (*targs_out),
+ inner_args);
+ }
+ else
+ *targs_out = inner_args;
+
return tmpl;
}
@@ -804,9 +998,11 @@ determine_specialization (template_id, decl, targs_out,
{
no_match:
if (complain)
- cp_error ("`%D' does not match any template declaration",
- template_id);
-
+ {
+ cp_error_at ("template-id `%D' for `%+D' does not match any template declaration",
+ template_id, decl);
+ return error_mark_node;
+ }
return NULL_TREE;
}
else if (TREE_CHAIN (templates) != NULL_TREE)
@@ -814,9 +1010,10 @@ determine_specialization (template_id, decl, targs_out,
ambiguous:
if (complain)
{
- cp_error ("ambiguous template specialization `%D'",
- template_id);
+ cp_error_at ("ambiguous template specialization `%D' for `%+D'",
+ template_id, decl);
print_candidates (templates);
+ return error_mark_node;
}
return NULL_TREE;
}
@@ -836,15 +1033,8 @@ determine_specialization (template_id, decl, targs_out,
FLAGS is a bitmask consisting of the following flags:
- 1: We are being called by finish_struct. (We are unable to
- determine what template is specialized by an in-class
- declaration until the class definition is complete, so
- finish_struct_methods calls this function again later to finish
- the job.)
2: The function has a definition.
4: The function is a friend.
- 8: The function is known to be a specialization of a member
- template.
The TEMPLATE_COUNT is the number of references to qualifying
template classes that appeared in the name of the function. For
@@ -858,8 +1048,7 @@ determine_specialization (template_id, decl, targs_out,
template <class T> struct S {};
template <> struct S<int> { void f(); }
- template <>
- void S<int>::f();
+ template <> void S<int>::f();
the TEMPLATE_COUNT would be 0. (Note that this declaration is
illegal; there should be no template <>.)
@@ -876,113 +1065,118 @@ check_explicit_specialization (declarator, decl, template_count, flags)
int template_count;
int flags;
{
- int finish_member = flags & 1;
int have_def = flags & 2;
int is_friend = flags & 4;
int specialization = 0;
int explicit_instantiation = 0;
- int member_specialization = flags & 8;
+ int member_specialization = 0;
tree ctype = DECL_CLASS_CONTEXT (decl);
tree dname = DECL_NAME (decl);
- if (!finish_member)
+ if (processing_specialization)
{
- if (processing_specialization)
- {
- /* The last template header was of the form template <>. */
+ /* The last template header was of the form template <>. */
- if (template_header_count > template_count)
- {
- /* There were more template headers than qualifying template
- classes. */
- if (template_header_count - template_count > 1)
- /* There shouldn't be that many template parameter
+ if (template_header_count > template_count)
+ {
+ /* There were more template headers than qualifying template
+ classes. */
+ if (template_header_count - template_count > 1)
+ /* There shouldn't be that many template parameter
lists. There can be at most one parameter list for
every qualifying class, plus one for the function
itself. */
- cp_error ("too many template parameter lists in declaration of `%D'", decl);
+ cp_error ("too many template parameter lists in declaration of `%D'", decl);
- SET_DECL_TEMPLATE_SPECIALIZATION (decl);
- if (ctype)
- member_specialization = 1;
- else
- specialization = 1;
- }
- else if (template_header_count == template_count)
- {
- /* The counts are equal. So, this might be a
- specialization, but it is not a specialization of a
- member template. It might be something like
+ SET_DECL_TEMPLATE_SPECIALIZATION (decl);
+ if (ctype)
+ member_specialization = 1;
+ else
+ specialization = 1;
+ }
+ else if (template_header_count == template_count)
+ {
+ /* The counts are equal. So, this might be a
+ specialization, but it is not a specialization of a
+ member template. It might be something like
- template <class T> struct S {
- void f(int i);
- };
- template <>
- void S<int>::f(int i) {} */
- specialization = 1;
- SET_DECL_TEMPLATE_SPECIALIZATION (decl);
- }
- else
- {
- /* This cannot be an explicit specialization. There are not
- enough headers for all of the qualifying classes. For
- example, we might have:
-
- template <>
- void S<int>::T<char>::f();
-
- But, we're missing another template <>. */
- cp_error("too few template parameter lists in declaration of `%D'", decl);
- return decl;
- }
+ template <class T> struct S {
+ void f(int i);
+ };
+ template <>
+ void S<int>::f(int i) {} */
+ specialization = 1;
+ SET_DECL_TEMPLATE_SPECIALIZATION (decl);
}
- else if (processing_explicit_instantiation)
+ else
{
- if (template_header_count)
- cp_error ("template parameter list used in explicit instantiation");
+ /* This cannot be an explicit specialization. There are not
+ enough headers for all of the qualifying classes. For
+ example, we might have:
+
+ template <>
+ void S<int>::T<char>::f();
+
+ But, we're missing another template <>. */
+ cp_error("too few template parameter lists in declaration of `%D'", decl);
+ return decl;
+ }
+ }
+ else if (processing_explicit_instantiation)
+ {
+ if (template_header_count)
+ cp_error ("template parameter list used in explicit instantiation");
- if (have_def)
- cp_error ("definition provided for explicit instantiation");
+ if (have_def)
+ cp_error ("definition provided for explicit instantiation");
- explicit_instantiation = 1;
- }
- else if (ctype != NULL_TREE
- && !TYPE_BEING_DEFINED (ctype)
- && CLASSTYPE_TEMPLATE_INSTANTIATION (ctype))
- {
- /* This case catches outdated code that looks like this:
+ explicit_instantiation = 1;
+ }
+ else if (ctype != NULL_TREE
+ && !TYPE_BEING_DEFINED (ctype)
+ && CLASSTYPE_TEMPLATE_INSTANTIATION (ctype)
+ && !is_friend)
+ {
+ /* This case catches outdated code that looks like this:
- template <class T> struct S { void f(); };
- void S<int>::f() {} // Missing template <>
+ template <class T> struct S { void f(); };
+ void S<int>::f() {} // Missing template <>
- We disable this check when the type is being defined to
- avoid complaining about default compiler-generated
- constructors, destructors, and assignment operators.
- Since the type is an instantiation, not a specialization,
- these are the only functions that can be defined before
- the class is complete. */
+ We disable this check when the type is being defined to
+ avoid complaining about default compiler-generated
+ constructors, destructors, and assignment operators.
+ Since the type is an instantiation, not a specialization,
+ these are the only functions that can be defined before
+ the class is complete. */
/* If they said
template <class T> void S<int>::f() {}
that's bogus. */
- if (template_header_count)
- {
- cp_error ("template parameters specified in specialization");
- return decl;
- }
-
- if (pedantic)
- cp_pedwarn
- ("explicit specialization not preceded by `template <>'");
- specialization = 1;
- SET_DECL_TEMPLATE_SPECIALIZATION (decl);
+ if (template_header_count)
+ {
+ cp_error ("template parameters specified in specialization");
+ return decl;
}
- else if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR)
+
+ if (pedantic)
+ cp_pedwarn
+ ("explicit specialization not preceded by `template <>'");
+ specialization = 1;
+ SET_DECL_TEMPLATE_SPECIALIZATION (decl);
+ }
+ else if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR)
+ {
+ if (is_friend)
+ /* This could be something like:
+
+ template <class T> void f(T);
+ class S { friend void f<>(int); } */
+ specialization = 1;
+ else
{
- /* This case handles bogus declarations like
- template <> template <class T>
- void f<int>(); */
+ /* This case handles bogus declarations like template <>
+ template <class T> void f<int>(); */
cp_error ("template-id `%D' in declaration of primary template",
declarator);
@@ -1004,6 +1198,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
if (specialization || member_specialization || explicit_instantiation)
{
+ tree gen_tmpl;
tree tmpl = NULL_TREE;
tree targs = NULL_TREE;
@@ -1023,7 +1218,10 @@ check_explicit_specialization (declarator, decl, template_count, flags)
lookup_template_function (fns, NULL_TREE);
}
- if (TREE_CODE (TREE_OPERAND (declarator, 0)) == LOOKUP_EXPR)
+ if (declarator == error_mark_node)
+ return error_mark_node;
+
+ if (TREE_CODE (TREE_OPERAND (declarator, 0)) == LOOKUP_EXPR)
{
/* A friend declaration. We can't do much, because we don't
know what this resolves to, yet. */
@@ -1035,19 +1233,28 @@ check_explicit_specialization (declarator, decl, template_count, flags)
if (ctype != NULL_TREE && TYPE_BEING_DEFINED (ctype))
{
- /* Since finish_struct_1 has not been called yet, we
- can't call lookup_fnfields. We note that this
- template is a specialization, and proceed, letting
- finish_struct fix this up later. */
- tree ti = perm_tree_cons (NULL_TREE,
- TREE_OPERAND (declarator, 1),
- NULL_TREE);
- TI_PENDING_SPECIALIZATION_FLAG (ti) = 1;
- DECL_TEMPLATE_INFO (decl) = ti;
- /* This should not be an instantiation; explicit
- instantiation directives can only occur at the top
- level. */
- my_friendly_assert (!explicit_instantiation, 0);
+ if (!explicit_instantiation)
+ /* A specialization in class scope. This is illegal,
+ but the error will already have been flagged by
+ check_specialization_scope. */
+ return error_mark_node;
+ else
+ {
+ /* It's not legal to write an explicit instantiation in
+ class scope, e.g.:
+
+ class C { template void f(); }
+
+ This case is caught by the parser. However, on
+ something like:
+
+ template class C { void f(); };
+
+ (which is illegal) we can get here. The error will be
+ issued later. */
+ ;
+ }
+
return decl;
}
else if (ctype != NULL_TREE
@@ -1100,96 +1307,69 @@ check_explicit_specialization (declarator, decl, template_count, flags)
Note that for an explicit instantiation, even one for a
member function, we cannot tell apriori whether the
instantiation is for a member template, or just a member
- function of a template class. In particular, even in if the
- instantiation is for a member template, the template
- arguments could be deduced from the declaration. */
+ function of a template class. Even if a member template is
+ being instantiated, the member template arguments may be
+ elided if they can be deduced from the rest of the
+ declaration. */
tmpl = determine_specialization (declarator, decl,
&targs,
member_specialization,
1);
- if (tmpl)
+ if (tmpl && tmpl != error_mark_node)
{
+ gen_tmpl = most_general_template (tmpl);
+
if (explicit_instantiation)
{
- decl = instantiate_template (tmpl, targs);
- if (!DECL_TEMPLATE_SPECIALIZATION (decl))
- /* There doesn't seem to be anything in the draft to
- prevent a specialization from being explicitly
- instantiated. We're careful not to destroy the
- information indicating that this is a
- specialization here. */
- SET_DECL_EXPLICIT_INSTANTIATION (decl);
+ /* We don't set DECL_EXPLICIT_INSTANTIATION here; that
+ is done by do_decl_instantiation later. */
+ decl = instantiate_template (tmpl, innermost_args (targs));
return decl;
}
- else if (DECL_STATIC_FUNCTION_P (tmpl)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+
+ /* If we though that the DECL was a member function, but it
+ turns out to be specializing a static member function,
+ make DECL a static member function as well. */
+ if (DECL_STATIC_FUNCTION_P (tmpl)
+ && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
{
revert_static_member_fn (&decl, 0, 0);
last_function_parms = TREE_CHAIN (last_function_parms);
}
+ /* Set up the DECL_TEMPLATE_INFO for DECL. */
+ DECL_TEMPLATE_INFO (decl)
+ = perm_tree_cons (tmpl, targs, NULL_TREE);
+
/* Mangle the function name appropriately. Note that we do
not mangle specializations of non-template member
functions of template classes, e.g. with
+
template <class T> struct S { void f(); }
+
and given the specialization
+
template <> void S<int>::f() {}
+
we do not mangle S<int>::f() here. That's because it's
just an ordinary member function and doesn't need special
- treatment. */
+ treatment. We do this here so that the ordinary,
+ non-template, name-mangling algorith will not be used
+ later. */
if ((is_member_template (tmpl) || ctype == NULL_TREE)
&& name_mangling_version >= 1)
- {
- tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (tmpl));
-
- if (ctype
- && TREE_CODE (TREE_TYPE (tmpl)) == FUNCTION_TYPE)
- arg_types =
- hash_tree_chain (build_pointer_type (ctype),
- arg_types);
-
- DECL_ASSEMBLER_NAME (decl)
- = build_template_decl_overload
- (DECL_NAME (decl),
- arg_types,
- TREE_TYPE (TREE_TYPE (tmpl)),
- DECL_INNERMOST_TEMPLATE_PARMS (tmpl),
- targs, ctype != NULL_TREE);
- }
+ set_mangled_name_for_template_decl (decl);
if (is_friend && !have_def)
- {
- /* This is not really a declaration of a specialization.
- It's just the name of an instantiation. But, it's not
- a request for an instantiation, either. */
+ /* This is not really a declaration of a specialization.
+ It's just the name of an instantiation. But, it's not
+ a request for an instantiation, either. */
SET_DECL_IMPLICIT_INSTANTIATION (decl);
- DECL_TEMPLATE_INFO (decl)
- = perm_tree_cons (tmpl, targs, NULL_TREE);
- return decl;
- }
- /* If DECL_TI_TEMPLATE (decl), the decl is an
- instantiation of a specialization of a member template.
- (In other words, there was a member template, in a
- class template. That member template was specialized.
- We then instantiated the class, so there is now an
- instance of that specialization.)
-
- According to the CD2,
-
- 14.7.3.13 [tmpl.expl.spec]
-
- A specialization of a member function template or
- member class template of a non-specialized class
- template is itself a template.
-
- So, we just leave the template info alone in this case. */
- if (!(DECL_TEMPLATE_INFO (decl) && DECL_TI_TEMPLATE (decl)))
- DECL_TEMPLATE_INFO (decl)
- = perm_tree_cons (tmpl, targs, NULL_TREE);
-
- register_specialization (decl, tmpl, targs);
+ /* Register this specialization so that we can find it
+ again. */
+ decl = register_specialization (decl, gen_tmpl, targs);
return decl;
}
@@ -1198,6 +1378,50 @@ check_explicit_specialization (declarator, decl, template_count, flags)
return decl;
}
+/* TYPE is being declared. Verify that the use of template headers
+ and such is reasonable. Issue error messages if not. */
+
+void
+maybe_check_template_type (type)
+ tree type;
+{
+ if (template_header_count)
+ {
+ /* We are in the scope of some `template <...>' header. */
+
+ int context_depth
+ = template_class_depth_real (TYPE_CONTEXT (type),
+ /*count_specializations=*/1);
+
+ if (template_header_count <= context_depth)
+ /* This is OK; the template headers are for the context. We
+ are actually too lenient here; like
+ check_explicit_specialization we should consider the number
+ of template types included in the actual declaration. For
+ example,
+
+ template <class T> struct S {
+ template <class U> template <class V>
+ struct I {};
+ };
+
+ is illegal, but:
+
+ template <class T> struct S {
+ template <class U> struct I;
+ };
+
+ template <class T> template <class U.
+ struct S<T>::I {};
+
+ is not. */
+ ;
+ else if (template_header_count > context_depth + 1)
+ /* There are two many template parameter lists. */
+ cp_error ("too many template parameter lists in declaration of `%T'", type);
+ }
+}
+
/* Returns 1 iff PARMS1 and PARMS2 are identical sets of template
parameters. These are represented in the same format used for
DECL_TEMPLATE_PARMS. */
@@ -1250,7 +1474,36 @@ int comp_template_parms (parms1, parms2)
return 1;
}
-/* Return a new TEMPLATE_PARM_INDEX with the indicated INDEX, LEVEL,
+
+/* Returns 1 iff old_id is a template parameter. OLD_DECL is the decl
+ from IDENTIFIER_LOCAL_VALUE (new identifier). */
+
+int decl_template_parm_p (old_decl)
+ tree old_decl;
+{
+ /* For template template parms. */
+ if (TREE_CODE (old_decl) == TEMPLATE_DECL
+ && TREE_TYPE (old_decl)
+ && TREE_CODE (TREE_TYPE (old_decl)) == TEMPLATE_TEMPLATE_PARM)
+ return 1;
+
+ /* For template type parms. */
+ if (TREE_CODE (old_decl) == TYPE_DECL
+ && TREE_TYPE (old_decl)
+ && TREE_CODE (TREE_TYPE (old_decl)) == TEMPLATE_TYPE_PARM)
+ return 1;
+
+ /* For template non-type parms. */
+ if (TREE_CODE (old_decl) == CONST_DECL
+ && DECL_INITIAL (old_decl)
+ && TREE_CODE (DECL_INITIAL (old_decl)) == TEMPLATE_PARM_INDEX)
+ return 1;
+
+ return 0;
+}
+
+
+ /* Return a new TEMPLATE_PARM_INDEX with the indicated INDEX, LEVEL,
ORIG_LEVEL, DECL, and TYPE. */
static tree
@@ -1347,7 +1600,8 @@ process_template_parm (list, next)
/* A template parameter is not modifiable. */
TREE_READONLY (parm) = 1;
if (IS_AGGR_TYPE (TREE_TYPE (parm))
- && TREE_CODE (TREE_TYPE (parm)) != TEMPLATE_TYPE_PARM)
+ && TREE_CODE (TREE_TYPE (parm)) != TEMPLATE_TYPE_PARM
+ && TREE_CODE (TREE_TYPE (parm)) != TYPENAME_TYPE)
{
cp_error ("`%#T' is not a valid type for a template constant parameter",
TREE_TYPE (parm));
@@ -1427,6 +1681,8 @@ end_template_parm_list (parms)
for (parm = parms, nparms = 0; parm; parm = TREE_CHAIN (parm), nparms++)
TREE_VEC_ELT (saved_parmlist, nparms) = parm;
+ --processing_template_parmlist;
+
return saved_parmlist;
}
@@ -1448,26 +1704,34 @@ end_template_decl ()
(void) get_pending_sizes (); /* Why? */
}
-/* Generate a valid set of template args from current_template_parms. */
+/* Given a template argument vector containing the template PARMS.
+ The innermost PARMS are given first. */
tree
current_template_args ()
{
- tree header = current_template_parms;
- int length = list_length (header);
- tree args = make_tree_vec (length);
+ tree header;
+ tree args = NULL_TREE;
+ int length = TMPL_PARMS_DEPTH (current_template_parms);
int l = length;
- while (header)
+ /* If there is only one level of template parameters, we do not
+ create a TREE_VEC of TREE_VECs. Instead, we return a single
+ TREE_VEC containing the arguments. */
+ if (length > 1)
+ args = make_tree_vec (length);
+
+ for (header = current_template_parms; header; header = TREE_CHAIN (header))
{
tree a = copy_node (TREE_VALUE (header));
- int i = TREE_VEC_LENGTH (a);
+ int i;
+
TREE_TYPE (a) = NULL_TREE;
- while (i--)
+ for (i = TREE_VEC_LENGTH (a) - 1; i >= 0; --i)
{
tree t = TREE_VEC_ELT (a, i);
- /* t will be a list if we are called from within a
+ /* T will be a list if we are called from within a
begin/end_template_parm_list pair, but a vector directly
if within a begin/end_member_template_processing pair. */
if (TREE_CODE (t) == TREE_LIST)
@@ -1479,18 +1743,19 @@ current_template_args ()
t = TREE_TYPE (t);
else
t = DECL_INITIAL (t);
+ TREE_VEC_ELT (a, i) = t;
}
-
- TREE_VEC_ELT (a, i) = t;
}
- TREE_VEC_ELT (args, --l) = a;
- header = TREE_CHAIN (header);
+
+ if (length > 1)
+ TREE_VEC_ELT (args, --l) = a;
+ else
+ args = a;
}
return args;
}
-
/* Return a TEMPLATE_DECL corresponding to DECL, using the indicated
template PARMS. Used by push_template_decl below. */
@@ -1514,8 +1779,23 @@ build_template_decl (decl, parms)
struct template_parm_data
{
+ /* The level of the template parameters we are currently
+ processing. */
int level;
+
+ /* The index of the specialization argument we are currently
+ processing. */
+ int current_arg;
+
+ /* An array whose size is the number of template parameters. The
+ elements are non-zero if the parameter has been used in any one
+ of the arguments processed so far. */
int* parms;
+
+ /* An array whose size is the number of template arguments. The
+ elements are non-zero if the argument makes use of template
+ parameters of this level. */
+ int* arg_uses_template_parms;
};
/* Subroutine of push_template_decl used to see if each template
@@ -1545,13 +1825,208 @@ mark_template_parm (t, data)
}
if (level == tpd->level)
- tpd->parms[idx] = 1;
+ {
+ tpd->parms[idx] = 1;
+ tpd->arg_uses_template_parms[tpd->current_arg] = 1;
+ }
/* Return zero so that for_each_template_parm will continue the
traversal of the tree; we want to mark *every* template parm. */
return 0;
}
+/* Process the partial specialization DECL. */
+
+tree
+process_partial_specialization (decl)
+ tree decl;
+{
+ tree type = TREE_TYPE (decl);
+ tree maintmpl = CLASSTYPE_TI_TEMPLATE (type);
+ tree specargs = CLASSTYPE_TI_ARGS (type);
+ tree inner_args = innermost_args (specargs);
+ tree inner_parms = INNERMOST_TEMPLATE_PARMS (current_template_parms);
+ tree main_inner_parms = DECL_INNERMOST_TEMPLATE_PARMS (maintmpl);
+ int nargs = TREE_VEC_LENGTH (inner_args);
+ int ntparms = TREE_VEC_LENGTH (inner_parms);
+ int i;
+ int did_error_intro = 0;
+ int issued_default_arg_message = 0;
+ struct template_parm_data tpd;
+ struct template_parm_data tpd2;
+
+ /* [temp.class.spec]
+
+ The template parameter list of a specialization shall not
+ contain default template argument values. */
+ for (i = 0; i < ntparms; ++i)
+ {
+ if (TREE_PURPOSE (TREE_VEC_ELT (inner_parms, i)))
+ {
+ if (!issued_default_arg_message)
+ {
+ cp_error ("default argument in partial specialization `%T'",
+ type);
+ issued_default_arg_message = 1;
+ }
+ TREE_PURPOSE (TREE_VEC_ELT (inner_parms, i)) = NULL_TREE;
+ }
+ }
+
+ /* We check that each of the template parameters given in the
+ partial specialization is used in the argument list to the
+ specialization. For example:
+
+ template <class T> struct S;
+ template <class T> struct S<T*>;
+
+ The second declaration is OK because `T*' uses the template
+ parameter T, whereas
+
+ template <class T> struct S<int>;
+
+ is no good. Even trickier is:
+
+ template <class T>
+ struct S1
+ {
+ template <class U>
+ struct S2;
+ template <class U>
+ struct S2<T>;
+ };
+
+ The S2<T> declaration is actually illegal; it is a
+ full-specialization. Of course,
+
+ template <class U>
+ struct S2<T (*)(U)>;
+
+ or some such would have been OK. */
+ tpd.level = TMPL_PARMS_DEPTH (current_template_parms);
+ tpd.parms = alloca (sizeof (int) * ntparms);
+ bzero (tpd.parms, sizeof (int) * ntparms);
+
+ tpd.arg_uses_template_parms = alloca (sizeof (int) * nargs);
+ bzero (tpd.arg_uses_template_parms, sizeof (int) * nargs);
+ for (i = 0; i < nargs; ++i)
+ {
+ tpd.current_arg = i;
+ for_each_template_parm (TREE_VEC_ELT (inner_args, i),
+ &mark_template_parm,
+ &tpd);
+ }
+ for (i = 0; i < ntparms; ++i)
+ if (tpd.parms[i] == 0)
+ {
+ /* One of the template parms was not used in the
+ specialization. */
+ if (!did_error_intro)
+ {
+ cp_error ("template parameters not used in partial specialization:");
+ did_error_intro = 1;
+ }
+
+ cp_error (" `%D'",
+ TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
+ }
+
+ /* [temp.class.spec]
+
+ The argument list of the specialization shall not be identical to
+ the implicit argument list of the primary template. */
+ if (comp_template_args (inner_args,
+ innermost_args (CLASSTYPE_TI_ARGS (TREE_TYPE
+ (maintmpl)))))
+ cp_error ("partial specialization `%T' does not specialize any template arguments", type);
+
+ /* [temp.class.spec]
+
+ A partially specialized non-type argument expression shall not
+ involve template parameters of the partial specialization except
+ when the argument expression is a simple identifier.
+
+ The type of a template parameter corresponding to a specialized
+ non-type argument shall not be dependent on a parameter of the
+ specialization. */
+ my_friendly_assert (nargs == DECL_NTPARMS (maintmpl), 0);
+ tpd2.parms = 0;
+ for (i = 0; i < nargs; ++i)
+ {
+ tree arg = TREE_VEC_ELT (inner_args, i);
+ if (/* These first two lines are the `non-type' bit. */
+ TREE_CODE_CLASS (TREE_CODE (arg)) != 't'
+ && TREE_CODE (arg) != TEMPLATE_DECL
+ /* This next line is the `argument expression is not just a
+ simple identifier' condition and also the `specialized
+ non-type argument' bit. */
+ && TREE_CODE (arg) != TEMPLATE_PARM_INDEX)
+ {
+ if (tpd.arg_uses_template_parms[i])
+ cp_error ("template argument `%E' involves template parameter(s)", arg);
+ else
+ {
+ /* Look at the corresponding template parameter,
+ marking which template parameters its type depends
+ upon. */
+ tree type =
+ TREE_TYPE (TREE_VALUE (TREE_VEC_ELT (main_inner_parms,
+ i)));
+
+ if (!tpd2.parms)
+ {
+ /* We haven't yet initialized TPD2. Do so now. */
+ tpd2.arg_uses_template_parms
+ = (int*) alloca (sizeof (int) * nargs);
+ /* The number of paramters here is the number in the
+ main template, which, as checked in the assertion
+ above, is NARGS. */
+ tpd2.parms = (int*) alloca (sizeof (int) * nargs);
+ tpd2.level =
+ TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl));
+ }
+
+ /* Mark the template paramters. But this time, we're
+ looking for the template parameters of the main
+ template, not in the specialization. */
+ tpd2.current_arg = i;
+ tpd2.arg_uses_template_parms[i] = 0;
+ bzero (tpd2.parms, sizeof (int) * nargs);
+ for_each_template_parm (type,
+ &mark_template_parm,
+ &tpd2);
+
+ if (tpd2.arg_uses_template_parms [i])
+ {
+ /* The type depended on some template parameters.
+ If they are fully specialized in the
+ specialization, that's OK. */
+ int j;
+ for (j = 0; j < nargs; ++j)
+ if (tpd2.parms[j] != 0
+ && tpd.arg_uses_template_parms [j])
+ {
+ cp_error ("type `%T' of template argument `%E' depends on template paramter(s)",
+ type,
+ arg);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (retrieve_specialization (maintmpl, specargs))
+ /* We've already got this specialization. */
+ return decl;
+
+ DECL_TEMPLATE_SPECIALIZATIONS (maintmpl) = CLASSTYPE_TI_SPEC_INFO (type)
+ = perm_tree_cons (inner_args, inner_parms,
+ DECL_TEMPLATE_SPECIALIZATIONS (maintmpl));
+ TREE_TYPE (DECL_TEMPLATE_SPECIALIZATIONS (maintmpl)) = type;
+ return decl;
+}
+
/* Creates a TEMPLATE_DECL for the indicated DECL using the template
parameters given by current_template_args, or reuses a
previously existing one, if appropriate. Returns the DECL, or an
@@ -1576,7 +2051,8 @@ push_template_decl_real (decl, is_friend)
/* For a friend, we want the context of the friend function, not
the type of which it is a friend. */
ctx = DECL_CONTEXT (decl);
- else if (DECL_REAL_CONTEXT (decl))
+ else if (DECL_REAL_CONTEXT (decl)
+ && TREE_CODE (DECL_REAL_CONTEXT (decl)) != NAMESPACE_DECL)
/* In the case of a virtual function, we want the class in which
it is defined. */
ctx = DECL_REAL_CONTEXT (decl);
@@ -1585,12 +2061,16 @@ push_template_decl_real (decl, is_friend)
is assumed to be a member of the class. */
ctx = current_class_type;
+ if (ctx && TREE_CODE (ctx) == NAMESPACE_DECL)
+ ctx = NULL_TREE;
+
+ if (!DECL_CONTEXT (decl))
+ DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
+
/* For determining whether this is a primary template or not, we're really
interested in the lexical context, not the true context. */
if (is_friend)
- /* For a TYPE_DECL, there is no DECL_CLASS_CONTEXT. */
- info = TREE_CODE (decl) == FUNCTION_DECL
- ? DECL_CLASS_CONTEXT (decl) : current_class_type;
+ info = current_class_type;
else
info = ctx;
@@ -1609,91 +2089,16 @@ push_template_decl_real (decl, is_friend)
cp_error ("template with C linkage");
if (TREE_CODE (decl) == TYPE_DECL && ANON_AGGRNAME_P (DECL_NAME (decl)))
cp_error ("template class without a name");
+ if (TREE_CODE (decl) == TYPE_DECL
+ && TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE)
+ cp_error ("template declaration of `%#T'", TREE_TYPE (decl));
}
/* Partial specialization. */
if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)
+ && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
- {
- tree type = TREE_TYPE (decl);
- tree maintmpl = CLASSTYPE_TI_TEMPLATE (type);
- tree mainargs = CLASSTYPE_TI_ARGS (type);
- tree spec = DECL_TEMPLATE_SPECIALIZATIONS (maintmpl);
-
- /* We check that each of the template parameters given in the
- partial specialization is used in the argument list to the
- specialization. For example:
-
- template <class T> struct S;
- template <class T> struct S<T*>;
-
- The second declaration is OK because `T*' uses the template
- parameter T, whereas
-
- template <class T> struct S<int>;
-
- is no good. Even trickier is:
-
- template <class T>
- struct S1
- {
- template <class U>
- struct S2;
- template <class U>
- struct S2<T>;
- };
-
- The S2<T> declaration is actually illegal; it is a
- full-specialization. Of course,
-
- template <class U>
- struct S2<T (*)(U)>;
-
- or some such would have been OK. */
- int i;
- struct template_parm_data tpd;
- int ntparms = TREE_VEC_LENGTH (TREE_VALUE (current_template_parms));
- int did_error_intro = 0;
-
- tpd.level = TREE_INT_CST_HIGH (TREE_PURPOSE (current_template_parms));
- tpd.parms = alloca (sizeof (int) * ntparms);
- for (i = 0; i < ntparms; ++i)
- tpd.parms[i] = 0;
- for (i = 0; i < TREE_VEC_LENGTH (mainargs); ++i)
- for_each_template_parm (TREE_VEC_ELT (mainargs, i),
- &mark_template_parm,
- &tpd);
- for (i = 0; i < ntparms; ++i)
- if (tpd.parms[i] == 0)
- {
- /* One of the template parms was not used in the
- specialization. */
- if (!did_error_intro)
- {
- cp_error ("template parameters not used in partial specialization:");
- did_error_intro = 1;
- }
-
- cp_error (" `%D'",
- TREE_VALUE (TREE_VEC_ELT
- (TREE_VALUE (current_template_parms),
- i)));
- }
-
- for (; spec; spec = TREE_CHAIN (spec))
- {
- /* purpose: args to main template
- value: spec template */
- if (comp_template_args (TREE_PURPOSE (spec), mainargs))
- return decl;
- }
-
- DECL_TEMPLATE_SPECIALIZATIONS (maintmpl) = CLASSTYPE_TI_SPEC_INFO (type)
- = perm_tree_cons (mainargs, TREE_VALUE (current_template_parms),
- DECL_TEMPLATE_SPECIALIZATIONS (maintmpl));
- TREE_TYPE (DECL_TEMPLATE_SPECIALIZATIONS (maintmpl)) = type;
- return decl;
- }
+ return process_partial_specialization (decl);
args = current_template_args ();
@@ -1729,8 +2134,19 @@ push_template_decl_real (decl, is_friend)
if (CLASSTYPE_TEMPLATE_INSTANTIATION (ctx))
cp_error ("must specialize `%#T' before defining member `%#D'",
ctx, decl);
- if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl))
- tmpl = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (decl));
+ if (TREE_CODE (decl) == TYPE_DECL)
+ {
+ if ((IS_AGGR_TYPE_CODE (TREE_CODE (TREE_TYPE (decl)))
+ || TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE)
+ && TYPE_TEMPLATE_INFO (TREE_TYPE (decl))
+ && TYPE_TI_TEMPLATE (TREE_TYPE (decl)))
+ tmpl = TYPE_TI_TEMPLATE (TREE_TYPE (decl));
+ else
+ {
+ cp_error ("`%D' does not declare a template type", decl);
+ return decl;
+ }
+ }
else if (! DECL_TEMPLATE_INFO (decl))
{
cp_error ("template definition of non-template `%#D'", decl);
@@ -1739,9 +2155,10 @@ push_template_decl_real (decl, is_friend)
else
tmpl = DECL_TI_TEMPLATE (decl);
- if (is_member_template (tmpl))
+ if (is_member_template (tmpl) || is_member_template_class (tmpl))
{
- if (DECL_TEMPLATE_INFO (decl) && DECL_TI_ARGS (decl)
+ if (DECL_FUNCTION_TEMPLATE_P (tmpl)
+ && DECL_TEMPLATE_INFO (decl) && DECL_TI_ARGS (decl)
&& DECL_TEMPLATE_SPECIALIZATION (decl))
{
tree new_tmpl;
@@ -1766,23 +2183,23 @@ push_template_decl_real (decl, is_friend)
return decl;
}
- a = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
- t = DECL_INNERMOST_TEMPLATE_PARMS (DECL_TI_TEMPLATE (decl));
+ a = innermost_args (args);
+ t = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
if (TREE_VEC_LENGTH (t) != TREE_VEC_LENGTH (a))
{
cp_error ("got %d template parameters for `%#D'",
TREE_VEC_LENGTH (a), decl);
cp_error (" but %d required", TREE_VEC_LENGTH (t));
}
- if (TREE_VEC_LENGTH (args) > 1)
+ if (TMPL_ARGS_DEPTH (args) > 1)
/* Get the template parameters for the enclosing template
class. */
- a = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 2);
+ a = TMPL_ARGS_LEVEL (args, TMPL_ARGS_DEPTH (args) - 1);
else
a = NULL_TREE;
}
else
- a = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
+ a = innermost_args (args);
t = NULL_TREE;
@@ -1808,17 +2225,17 @@ push_template_decl_real (decl, is_friend)
cp_error (" but `%#T' has %d", ctx, TREE_VEC_LENGTH (t));
}
}
- /* Get the innermost set of template arguments. */
- args = innermost_args (args, 0);
DECL_TEMPLATE_RESULT (tmpl) = decl;
TREE_TYPE (tmpl) = TREE_TYPE (decl);
- if (! ctx && !(is_friend && template_class_depth (info) > 0))
- /* Note that we do not try to push a global template friend
- declared in a template class; such a thing may well depend on
- the template parameters of the class. */
- tmpl = pushdecl_top_level (tmpl);
+ /* Push template declarations for global functions and types. Note
+ that we do not try to push a global template friend declared in a
+ template class; such a thing may well depend on the template
+ parameters of the class. */
+ if (! ctx
+ && !(is_friend && template_class_depth (current_class_type) > 0))
+ tmpl = pushdecl_namespace_level (tmpl);
if (primary)
DECL_PRIMARY_TEMPLATE (tmpl) = tmpl;
@@ -1827,8 +2244,9 @@ push_template_decl_real (decl, is_friend)
if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl))
{
- CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (tmpl)) = info;
- if (!ctx || TREE_CODE (ctx) != FUNCTION_DECL)
+ SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);
+ if ((!ctx || TREE_CODE (ctx) != FUNCTION_DECL)
+ && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE)
DECL_NAME (decl) = classtype_mangled_name (TREE_TYPE (decl));
}
else if (! DECL_LANG_SPECIFIC (decl))
@@ -1901,6 +2319,7 @@ redeclare_class_template (type, parms)
A template-parameter may not be given default arguments
by two different declarations in the same scope. */
cp_error ("redefinition of default argument for `%#D'", parm);
+ cp_error_at (" original definition appeared here", tmpl_parm);
return;
}
@@ -1968,6 +2387,7 @@ convert_nontype_argument (type, expr)
{
if (! TREE_CONSTANT (expr))
{
+ non_constant:
cp_error ("non-constant `%E' cannot be used as template argument",
expr);
return NULL_TREE;
@@ -2040,15 +2460,28 @@ convert_nontype_argument (type, expr)
/* It's safe to call digest_init in this case; we know we're
just converting one integral constant expression to another. */
- return digest_init (type, expr, (tree*) 0);
+ expr = digest_init (type, expr, (tree*) 0);
+ if (TREE_CODE (expr) != INTEGER_CST)
+ /* Curiously, some TREE_CONSTNAT integral expressions do not
+ simplify to integer constants. For example, `3 % 0',
+ remains a TRUNC_MOD_EXPR. */
+ goto non_constant;
+
+ return expr;
+
case REAL_TYPE:
case COMPLEX_TYPE:
/* These are g++ extensions. */
if (TREE_CODE (expr_type) != TREE_CODE (type))
return error_mark_node;
- return digest_init (type, expr, (tree*) 0);
+ expr = digest_init (type, expr, (tree*) 0);
+
+ if (TREE_CODE (expr) != REAL_CST)
+ goto non_constant;
+
+ return expr;
case POINTER_TYPE:
{
@@ -2125,10 +2558,10 @@ convert_nontype_argument (type, expr)
if (TREE_CODE (type_referred_to) == FUNCTION_TYPE)
{
/* For a non-type template-parameter of type reference to
- function, no conversions apply. If the
- template-argument represents a set of overloaded
- functions, the matching function is selected from the
- set (_over.over_). */
+ function, no conversions apply. If the
+ template-argument represents a set of overloaded
+ functions, the matching function is selected from the
+ set (_over.over_). */
tree fns = expr;
tree fn;
@@ -2180,7 +2613,13 @@ convert_nontype_argument (type, expr)
tree fns;
tree fn;
- my_friendly_assert (TYPE_PTRMEMFUNC_P (type), 0);
+ if (!TYPE_PTRMEMFUNC_P (type))
+ /* This handles templates like
+ template<class T, T t> void f();
+ when T is substituted with any class. The second template
+ parameter becomes invalid and the template candidate is
+ rejected. */
+ return error_mark_node;
/* For a non-type template-parameter of type pointer to member
function, no conversions apply. If the template-argument
@@ -2229,246 +2668,199 @@ convert_nontype_argument (type, expr)
return error_mark_node;
}
-/* Convert all template arguments to their appropriate types, and return
- a vector containing the resulting values. If any error occurs, return
- error_mark_node, and, if COMPLAIN is non-zero, issue an error message.
- Some error messages are issued even if COMPLAIN is zero; for
- instance, if a template argument is composed from a local class.
-
- If REQUIRE_ALL_ARGUMENTS is non-zero, all arguments must be
- provided in ARGLIST, or else trailing parameters must have default
- values. If REQUIRE_ALL_ARGUMENTS is zero, we will attempt argument
- deduction for any unspecified trailing arguments.
+/* Return 1 if PARM_PARMS and ARG_PARMS matches using rule for
+ template template parameters. Both PARM_PARMS and ARG_PARMS are
+ vectors of TREE_LIST nodes containing TYPE_DECL, TEMPLATE_DECL
+ or PARM_DECL.
- If IS_TMPL_PARM is non-zero, we will coercing parameters of template
- template arguments. In this case, ARGLIST is a chain of TREE_LIST
- nodes containing TYPE_DECL, TEMPLATE_DECL or PARM_DECL. */
+ ARG_PARMS may contain more parameters than PARM_PARMS. If this is
+ the case, then extra parameters must have default arguments.
-static tree
-coerce_template_parms (parms, arglist, in_decl,
- complain,
- require_all_arguments,
- is_tmpl_parm)
- tree parms, arglist;
- tree in_decl;
- int complain;
- int require_all_arguments;
- int is_tmpl_parm;
-{
- int nparms, nargs, i, lost = 0;
- tree vec = NULL_TREE;
+ Consider the example:
+ template <class T, class Allocator = allocator> class vector;
+ template<template <class U> class TT> class C;
- if (arglist == NULL_TREE)
- nargs = 0;
- else if (TREE_CODE (arglist) == TREE_VEC)
- nargs = TREE_VEC_LENGTH (arglist);
- else
- nargs = list_length (arglist);
+ C<vector> is a valid instantiation. PARM_PARMS for the above code
+ contains a TYPE_DECL (for U), ARG_PARMS contains two TYPE_DECLs (for
+ T and Allocator) and OUTER_ARGS contains the argument that is used to
+ substitute the TT parameter. */
- nparms = TREE_VEC_LENGTH (parms);
-
- if (nargs > nparms
- || (nargs < nparms
- && require_all_arguments
- && TREE_PURPOSE (TREE_VEC_ELT (parms, nargs)) == NULL_TREE))
- {
- if (complain)
- {
- error ("incorrect number of parameters (%d, should be %d)",
- nargs, nparms);
-
- if (in_decl)
- cp_error_at ("in template expansion for decl `%D'",
- in_decl);
- }
-
- return error_mark_node;
- }
-
- if (arglist && TREE_CODE (arglist) == TREE_VEC && nargs == nparms)
- vec = copy_node (arglist);
- else
- {
- vec = make_tree_vec (nparms);
+static int
+coerce_template_template_parms (parm_parms, arg_parms, in_decl, outer_args)
+ tree parm_parms, arg_parms, in_decl, outer_args;
+{
+ int nparms, nargs, i;
+ tree parm, arg;
- for (i = 0; i < nparms; i++)
- {
- tree arg;
- tree parm = TREE_VEC_ELT (parms, i);
+ my_friendly_assert (TREE_CODE (parm_parms) == TREE_VEC, 0);
+ my_friendly_assert (TREE_CODE (arg_parms) == TREE_VEC, 0);
- if (arglist)
- {
- arg = arglist;
- arglist = TREE_CHAIN (arglist);
+ nparms = TREE_VEC_LENGTH (parm_parms);
+ nargs = TREE_VEC_LENGTH (arg_parms);
- if (arg == error_mark_node)
- lost++;
- else
- arg = TREE_VALUE (arg);
- }
- else if (is_tmpl_parm && i < nargs)
- {
- arg = TREE_VEC_ELT (arglist, i);
- if (arg == error_mark_node)
- lost++;
- }
- else if (TREE_PURPOSE (parm) == NULL_TREE)
- {
- my_friendly_assert (!require_all_arguments, 0);
- break;
- }
- else if (TREE_CODE (TREE_VALUE (parm)) == TYPE_DECL)
- arg = tsubst (TREE_PURPOSE (parm), vec, in_decl);
- else
- arg = tsubst_expr (TREE_PURPOSE (parm), vec, in_decl);
+ /* The rule here is opposite of coerce_template_parms. */
+ if (nargs < nparms
+ || (nargs > nparms
+ && TREE_PURPOSE (TREE_VEC_ELT (arg_parms, nparms)) == NULL_TREE))
+ return 0;
- TREE_VEC_ELT (vec, i) = arg;
- }
- }
- for (i = 0; i < nparms; i++)
+ for (i = 0; i < nparms; ++i)
{
- tree arg = TREE_VEC_ELT (vec, i);
- tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
- tree val = 0;
- int is_type, requires_type, is_tmpl_type, requires_tmpl_type;
+ parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, i));
+ arg = TREE_VALUE (TREE_VEC_ELT (arg_parms, i));
- if (is_tmpl_parm && i < nargs)
- {
- /* In case we are checking arguments inside a template template
- parameter, ARG that does not come from default argument is
- also a TREE_LIST node. Note that ARG can also be a TREE_LIST
- in other cases such as overloaded functions. */
- if (arg != NULL_TREE && arg != error_mark_node)
- arg = TREE_VALUE (arg);
- }
+ if (arg == NULL_TREE || arg == error_mark_node
+ || parm == NULL_TREE || parm == error_mark_node)
+ return 0;
- if (arg == NULL_TREE)
- /* We're out of arguments. */
+ if (TREE_CODE (arg) != TREE_CODE (parm))
+ return 0;
+
+ switch (TREE_CODE (parm))
{
- my_friendly_assert (!require_all_arguments, 0);
+ case TYPE_DECL:
break;
- }
- if (arg == error_mark_node)
- {
- cp_error ("template argument %d is invalid", i + 1);
- lost++;
- continue;
- }
+ case TEMPLATE_DECL:
+ /* We encounter instantiations of templates like
+ template <template <template <class> class> class TT>
+ class C; */
+ sorry ("nested template template parameter");
+ return 0;
- if (TREE_CODE (arg) == TREE_LIST
- && TREE_TYPE (arg) != NULL_TREE
- && TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE)
- {
- /* The template argument was the name of some
- member function. That's usually
- illegal, but static members are OK. In any
- case, grab the underlying fields/functions
- and issue an error later if required. */
- arg = TREE_VALUE (arg);
- TREE_TYPE (arg) = unknown_type_node;
+ case PARM_DECL:
+ /* The tsubst call is used to handle cases such as
+ template <class T, template <T> class TT> class D;
+ i.e. the parameter list of TT depends on earlier parameters. */
+ if (!comptypes (tsubst (TREE_TYPE (parm), outer_args, in_decl),
+ TREE_TYPE (arg), 1))
+ return 0;
+ break;
+
+ default:
+ my_friendly_abort (0);
}
+ }
+ return 1;
+}
- requires_tmpl_type = TREE_CODE (parm) == TEMPLATE_DECL;
- requires_type = TREE_CODE (parm) == TYPE_DECL
- || requires_tmpl_type;
-
- /* Check if it is a class template. If REQUIRES_TMPL_TYPE is true,
- we also accept implicitly created TYPE_DECL as a valid argument. */
- is_tmpl_type = (TREE_CODE (arg) == TEMPLATE_DECL
- && TREE_CODE (DECL_TEMPLATE_RESULT (arg)) == TYPE_DECL)
- || (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
- && !CLASSTYPE_TEMPLATE_INFO (arg))
- || (TREE_CODE (arg) == RECORD_TYPE
- && CLASSTYPE_TEMPLATE_INFO (arg)
- && TREE_CODE (TYPE_NAME (arg)) == TYPE_DECL
- && DECL_ARTIFICIAL (TYPE_NAME (arg))
- && requires_tmpl_type);
- if (is_tmpl_type && TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
- arg = TYPE_STUB_DECL (arg);
- else if (is_tmpl_type && TREE_CODE (arg) == RECORD_TYPE)
- arg = CLASSTYPE_TI_TEMPLATE (arg);
-
- if (is_tmpl_parm && i < nargs)
- is_type = TREE_CODE (arg) == TYPE_DECL || is_tmpl_type;
- else
- is_type = TREE_CODE_CLASS (TREE_CODE (arg)) == 't' || is_tmpl_type;
+/* Convert the indicated template ARG as necessary to match the
+ indicated template PARM. Returns the converted ARG, or
+ error_mark_node if the conversion was unsuccessful. Error messages
+ are issued if COMPLAIN is non-zero. This conversion is for the Ith
+ parameter in the parameter list. ARGS is the full set of template
+ arguments deduced so far. */
- if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
- && TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
- {
- cp_pedwarn ("to refer to a type member of a template parameter,");
- cp_pedwarn (" use `typename %E'", arg);
+static tree
+convert_template_argument (parm, arg, args, complain, i, in_decl)
+ tree parm;
+ tree arg;
+ tree args;
+ int complain;
+ int i;
+ tree in_decl;
+{
+ tree val;
+ tree inner_args;
+ int is_type, requires_type, is_tmpl_type, requires_tmpl_type;
+
+ inner_args = innermost_args (args);
+
+ if (TREE_CODE (arg) == TREE_LIST
+ && TREE_TYPE (arg) != NULL_TREE
+ && TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE)
+ {
+ /* The template argument was the name of some
+ member function. That's usually
+ illegal, but static members are OK. In any
+ case, grab the underlying fields/functions
+ and issue an error later if required. */
+ arg = TREE_VALUE (arg);
+ TREE_TYPE (arg) = unknown_type_node;
+ }
- arg = make_typename_type (TREE_OPERAND (arg, 0),
- TREE_OPERAND (arg, 1));
- is_type = 1;
- }
- if (is_type != requires_type)
- {
- if (in_decl)
- {
- if (complain)
- {
- cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
- i + 1, in_decl);
- if (is_type)
- cp_error (" expected a constant of type `%T', got `%T'",
- TREE_TYPE (parm),
- (is_tmpl_type ? DECL_NAME (arg) : arg));
- else
- cp_error (" expected a type, got `%E'", arg);
- }
- }
- lost++;
- TREE_VEC_ELT (vec, i) = error_mark_node;
- continue;
- }
- if (is_tmpl_type ^ requires_tmpl_type)
+ requires_tmpl_type = TREE_CODE (parm) == TEMPLATE_DECL;
+ requires_type = (TREE_CODE (parm) == TYPE_DECL
+ || requires_tmpl_type);
+
+ /* Check if it is a class template. If REQUIRES_TMPL_TYPE is true,
+ we also accept implicitly created TYPE_DECL as a valid argument.
+ This is necessary to handle the case where we pass a template name
+ to a template template parameter in a scope where we've derived from
+ in instantiation of that template, so the template name refers to that
+ instantiation. We really ought to handle this better. */
+ is_tmpl_type
+ = ((TREE_CODE (arg) == TEMPLATE_DECL
+ && TREE_CODE (DECL_TEMPLATE_RESULT (arg)) == TYPE_DECL)
+ || (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
+ && !CLASSTYPE_TEMPLATE_INFO (arg))
+ || (TREE_CODE (arg) == RECORD_TYPE
+ && CLASSTYPE_TEMPLATE_INFO (arg)
+ && TREE_CODE (TYPE_NAME (arg)) == TYPE_DECL
+ && DECL_ARTIFICIAL (TYPE_NAME (arg))
+ && requires_tmpl_type
+ && is_base_of_enclosing_class (arg, current_class_type)));
+ if (is_tmpl_type && TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
+ arg = TYPE_STUB_DECL (arg);
+ else if (is_tmpl_type && TREE_CODE (arg) == RECORD_TYPE)
+ arg = CLASSTYPE_TI_TEMPLATE (arg);
+
+ is_type = TREE_CODE_CLASS (TREE_CODE (arg)) == 't' || is_tmpl_type;
+
+ if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
+ && TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
+ {
+ cp_pedwarn ("to refer to a type member of a template parameter,");
+ cp_pedwarn (" use `typename %E'", arg);
+
+ arg = make_typename_type (TREE_OPERAND (arg, 0),
+ TREE_OPERAND (arg, 1));
+ is_type = 1;
+ }
+ if (is_type != requires_type)
+ {
+ if (in_decl)
{
- if (in_decl)
+ if (complain)
{
cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
i + 1, in_decl);
- if (is_tmpl_type)
- cp_error (" expected a type, got `%T'", DECL_NAME (arg));
+ if (is_type)
+ cp_error (" expected a constant of type `%T', got `%T'",
+ TREE_TYPE (parm),
+ (is_tmpl_type ? DECL_NAME (arg) : arg));
else
- cp_error (" expected a class template, got `%T'", arg);
+ cp_error (" expected a type, got `%E'", arg);
}
- lost++;
- TREE_VEC_ELT (vec, i) = error_mark_node;
- continue;
}
- if (is_tmpl_parm)
+ return error_mark_node;
+ }
+ if (is_tmpl_type ^ requires_tmpl_type)
+ {
+ if (in_decl && complain)
{
- if (requires_tmpl_type)
- {
- cp_error ("nested template template parameter not implemented");
- lost++;
- TREE_VEC_ELT (vec, i) = error_mark_node;
- }
- continue;
+ cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
+ i + 1, in_decl);
+ if (is_tmpl_type)
+ cp_error (" expected a type, got `%T'", DECL_NAME (arg));
+ else
+ cp_error (" expected a class template, got `%T'", arg);
}
-
- if (is_type)
+ return error_mark_node;
+ }
+
+ if (is_type)
+ {
+ if (requires_tmpl_type)
{
- if (requires_tmpl_type)
- {
- tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
- tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
+ tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
+ tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
- /* The parameter and argument roles have to be switched
- here in order to handle default arguments properly.
- For example,
- template<template <class> class TT> void f(TT<int>)
- should be able to accept vector<int> which comes from
- template <class T, class Allcator = allocator>
- class vector. */
-
- val = coerce_template_parms (argparm, parmparm, in_decl, 1, 1, 1);
- if (val != error_mark_node)
- val = arg;
-
+ if (coerce_template_template_parms (parmparm, argparm,
+ in_decl, inner_args))
+ {
+ val = arg;
+
/* TEMPLATE_TEMPLATE_PARM node is preferred over
TEMPLATE_DECL. */
if (val != error_mark_node
@@ -2477,58 +2869,180 @@ coerce_template_parms (parms, arglist, in_decl,
}
else
{
- val = groktypename (arg);
- if (! processing_template_decl)
+ if (in_decl && complain)
{
- tree t = target_type (val);
- if (TREE_CODE (t) != TYPENAME_TYPE
- && IS_AGGR_TYPE (t)
- && decl_function_context (TYPE_MAIN_DECL (t)))
- {
- cp_error ("type `%T' composed from a local class is not a valid template-argument",
- val);
- return error_mark_node;
- }
+ cp_error ("type/value mismatch at argument %d in template parameter list for `%D'",
+ i + 1, in_decl);
+ cp_error (" expected a template of type `%D', got `%D'", parm, arg);
}
+
+ val = error_mark_node;
}
}
else
{
- tree t = tsubst (TREE_TYPE (parm), vec, in_decl);
+ val = groktypename (arg);
+ if (! processing_template_decl)
+ {
+ /* [basic.link]: A name with no linkage (notably, the
+ name of a class or enumeration declared in a local
+ scope) shall not be used to declare an entity with
+ linkage. This implies that names with no linkage
+ cannot be used as template arguments. */
+ tree t = no_linkage_check (val);
+ if (t)
+ {
+ if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ cp_pedwarn
+ ("template-argument `%T' uses anonymous type", val);
+ else
+ cp_error
+ ("template-argument `%T' uses local type `%T'",
+ val, t);
+ return error_mark_node;
+ }
+ }
+ }
+ }
+ else
+ {
+ tree t = tsubst (TREE_TYPE (parm), args, in_decl);
+
+ if (processing_template_decl)
+ arg = maybe_fold_nontype_arg (arg);
+
+ if (!uses_template_parms (arg) && !uses_template_parms (t))
+ /* We used to call digest_init here. However, digest_init
+ will report errors, which we don't want when complain
+ is zero. More importantly, digest_init will try too
+ hard to convert things: for example, `0' should not be
+ converted to pointer type at this point according to
+ the standard. Accepting this is not merely an
+ extension, since deciding whether or not these
+ conversions can occur is part of determining which
+ function template to call, or whether a given epxlicit
+ argument specification is legal. */
+ val = convert_nontype_argument (t, arg);
+ else
+ val = arg;
- if (processing_template_decl)
- arg = maybe_fold_nontype_arg (arg);
-
- if (!uses_template_parms (arg) && !uses_template_parms (t))
- /* We used to call digest_init here. However, digest_init
- will report errors, which we don't want when complain
- is zero. More importantly, digest_init will try too
- hard to convert things: for example, `0' should not be
- converted to pointer type at this point according to
- the standard. Accepting this is not merely an
- extension, since deciding whether or not these
- conversions can occur is part of determining which
- function template to call, or whether a given epxlicit
- argument specification is legal. */
- val = convert_nontype_argument (t, arg);
- else
- val = arg;
+ if (val == NULL_TREE)
+ val = error_mark_node;
+ else if (val == error_mark_node && complain)
+ cp_error ("could not convert template argument `%E' to `%T'",
+ arg, t);
+ }
- if (val == NULL_TREE)
- val = error_mark_node;
- else if (val == error_mark_node && complain)
- cp_error ("could not convert template argument `%E' to `%T'",
- arg, t);
+ return val;
+}
+
+/* Convert all template arguments to their appropriate types, and
+ return a vector containing the innermost resulting template
+ arguments. If any error occurs, return error_mark_node, and, if
+ COMPLAIN is non-zero, issue an error message. Some error messages
+ are issued even if COMPLAIN is zero; for instance, if a template
+ argument is composed from a local class.
+
+ If REQUIRE_ALL_ARGUMENTS is non-zero, all arguments must be
+ provided in ARGLIST, or else trailing parameters must have default
+ values. If REQUIRE_ALL_ARGUMENTS is zero, we will attempt argument
+ deduction for any unspecified trailing arguments.
+
+ The resulting TREE_VEC is allocated on a temporary obstack, and
+ must be explicitly copied if it will be permanent. */
+
+static tree
+coerce_template_parms (parms, args, in_decl,
+ complain,
+ require_all_arguments)
+ tree parms, args;
+ tree in_decl;
+ int complain;
+ int require_all_arguments;
+{
+ int nparms, nargs, i, lost = 0;
+ tree inner_args;
+ tree new_args;
+ tree new_inner_args;
+
+ inner_args = innermost_args (args);
+ nargs = NUM_TMPL_ARGS (inner_args);
+ nparms = TREE_VEC_LENGTH (parms);
+
+ if (nargs > nparms
+ || (nargs < nparms
+ && require_all_arguments
+ && TREE_PURPOSE (TREE_VEC_ELT (parms, nargs)) == NULL_TREE))
+ {
+ if (complain)
+ {
+ cp_error ("wrong number of template arguments (%d, should be %d)",
+ nargs, nparms);
+
+ if (in_decl)
+ cp_error_at ("provided for `%D'", in_decl);
}
- if (val == error_mark_node)
- lost++;
+ return error_mark_node;
+ }
+
+ new_inner_args = make_temp_vec (nparms);
+ new_args = add_outermost_template_args (args, new_inner_args);
+ for (i = 0; i < nparms; i++)
+ {
+ tree arg;
+ tree parm;
- TREE_VEC_ELT (vec, i) = val;
+ /* Get the Ith template parameter. */
+ parm = TREE_VEC_ELT (parms, i);
+
+ /* Calculate the Ith argument. */
+ if (inner_args && TREE_CODE (inner_args) == TREE_LIST)
+ {
+ arg = TREE_VALUE (inner_args);
+ inner_args = TREE_CHAIN (inner_args);
+ }
+ else if (i < nargs)
+ arg = TREE_VEC_ELT (inner_args, i);
+ /* If no template argument was supplied, look for a default
+ value. */
+ else if (TREE_PURPOSE (parm) == NULL_TREE)
+ {
+ /* There was no default value. */
+ my_friendly_assert (!require_all_arguments, 0);
+ break;
+ }
+ else if (TREE_CODE (TREE_VALUE (parm)) == TYPE_DECL)
+ arg = tsubst (TREE_PURPOSE (parm), new_args, in_decl);
+ else
+ arg = tsubst_expr (TREE_PURPOSE (parm), new_args, in_decl);
+
+ /* Now, convert the Ith argument, as necessary. */
+ if (arg == NULL_TREE)
+ /* We're out of arguments. */
+ {
+ my_friendly_assert (!require_all_arguments, 0);
+ break;
+ }
+ else if (arg == error_mark_node)
+ {
+ cp_error ("template argument %d is invalid", i + 1);
+ arg = error_mark_node;
+ }
+ else
+ arg = convert_template_argument (TREE_VALUE (parm),
+ arg, new_args, complain, i,
+ in_decl);
+
+ if (arg == error_mark_node)
+ lost++;
+ TREE_VEC_ELT (new_inner_args, i) = arg;
}
+
if (lost)
return error_mark_node;
- return vec;
+
+ return new_inner_args;
}
/* Renturns 1 iff the OLDARGS and NEWARGS are in fact identical sets
@@ -2550,12 +3064,14 @@ comp_template_args (oldargs, newargs)
if (nt == ot)
continue;
- if (TREE_CODE (nt) != TREE_CODE (ot))
+ else if (!nt || !ot)
return 0;
- if (TREE_CODE (nt) == TREE_VEC)
+ else if (TREE_CODE (nt) != TREE_CODE (ot))
+ return 0;
+ else if (TREE_CODE (nt) == TREE_VEC)
{
/* For member templates */
- if (comp_template_args (nt, ot))
+ if (comp_template_args (ot, nt))
continue;
}
else if (TREE_CODE_CLASS (TREE_CODE (ot)) == 't')
@@ -2574,10 +3090,9 @@ comp_template_args (oldargs, newargs)
for the instantiation. */
static char *
-mangle_class_name_for_template (name, parms, arglist, ctx)
+mangle_class_name_for_template (name, parms, arglist)
char *name;
tree parms, arglist;
- tree ctx;
{
static struct obstack scratch_obstack;
static char *scratch_firstobj;
@@ -2589,35 +3104,13 @@ mangle_class_name_for_template (name, parms, arglist, ctx)
obstack_free (&scratch_obstack, scratch_firstobj);
scratch_firstobj = obstack_alloc (&scratch_obstack, 1);
-#if 0
-#define buflen sizeof(buf)
-#define check if (bufp >= buf+buflen-1) goto too_long
-#define ccat(c) *bufp++=(c); check
-#define advance bufp+=strlen(bufp); check
-#define cat(s) strncpy(bufp, s, buf+buflen-bufp-1); advance
-#else
-#define check
#define ccat(c) obstack_1grow (&scratch_obstack, (c));
-#define advance
#define cat(s) obstack_grow (&scratch_obstack, (s), strlen (s))
-#endif
-
- if (ctx)
- {
- char* s;
- if (TREE_CODE (ctx) == FUNCTION_DECL)
- s = fndecl_as_string (ctx, 0);
- else if (TREE_CODE_CLASS (TREE_CODE (ctx)) == 't')
- s = type_as_string_real (ctx, 0, 1);
- else
- my_friendly_abort (0);
- cat (s);
- cat ("::");
- }
cat (name);
ccat ('<');
nparms = TREE_VEC_LENGTH (parms);
+ arglist = innermost_args (arglist);
my_friendly_assert (nparms == TREE_VEC_LENGTH (arglist), 268);
for (i = 0; i < nparms; i++)
{
@@ -2635,9 +3128,18 @@ mangle_class_name_for_template (name, parms, arglist, ctx)
else if (TREE_CODE (parm) == TEMPLATE_DECL)
{
if (TREE_CODE (arg) == TEMPLATE_DECL)
- /* Already substituted with real template. Just output
- the template name here */
- cat (IDENTIFIER_POINTER (DECL_NAME (arg)));
+ {
+ /* Already substituted with real template. Just output
+ the template name here */
+ tree context = DECL_CONTEXT (arg);
+ if (context)
+ {
+ my_friendly_assert (TREE_CODE (context) == NAMESPACE_DECL, 980422);
+ cat(decl_as_string (DECL_CONTEXT (arg), 0));
+ cat("::");
+ }
+ cat (IDENTIFIER_POINTER (DECL_NAME (arg)));
+ }
else
/* Output the parameter declaration */
cat (type_as_string_real (arg, 0, 1));
@@ -2671,13 +3173,6 @@ mangle_class_name_for_template (name, parms, arglist, ctx)
ccat ('>');
ccat ('\0');
return (char *) obstack_base (&scratch_obstack);
-
-#if 0
- too_long:
-#endif
- fatal ("out of (preallocated) string space creating template instantiation name");
- /* NOTREACHED */
- return NULL;
}
static tree
@@ -2685,13 +3180,18 @@ classtype_mangled_name (t)
tree t;
{
if (CLASSTYPE_TEMPLATE_INFO (t)
+ /* Specializations have already had their names set up in
+ lookup_template_class. */
+ && !CLASSTYPE_TEMPLATE_SPECIALIZATION (t)
+ /* For non-primary templates, the template parameters are
+ implicit from their surrounding context. */
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t)))
{
tree name = DECL_NAME (CLASSTYPE_TI_TEMPLATE (t));
char *mangled_name = mangle_class_name_for_template
(IDENTIFIER_POINTER (name),
DECL_INNERMOST_TEMPLATE_PARMS (CLASSTYPE_TI_TEMPLATE (t)),
- CLASSTYPE_TI_ARGS (t), DECL_CONTEXT (t));
+ CLASSTYPE_TI_ARGS (t));
tree id = get_identifier (mangled_name);
IDENTIFIER_TEMPLATE (id) = name;
return id;
@@ -2715,7 +3215,7 @@ add_pending_template (d)
return;
*template_tail = perm_tree_cons
- (current_function_decl, d, NULL_TREE);
+ (build_srcloc_here (), d, NULL_TREE);
template_tail = &TREE_CHAIN (*template_tail);
TI_PENDING_TEMPLATE_FLAG (ti) = 1;
}
@@ -2729,7 +3229,7 @@ tree
lookup_template_function (fns, arglist)
tree fns, arglist;
{
- tree t;
+ tree type;
if (fns == NULL_TREE)
{
@@ -2737,13 +3237,14 @@ lookup_template_function (fns, arglist)
return error_mark_node;
}
- if (arglist != NULL_TREE && !TREE_PERMANENT (arglist))
- copy_to_permanent (arglist);
+ type = TREE_TYPE (fns);
+ if (TREE_CODE (fns) == OVERLOAD || !type)
+ type = unknown_type_node;
- return build_min (TEMPLATE_ID_EXPR,
- TREE_TYPE (fns)
- ? TREE_TYPE (fns) : unknown_type_node,
- fns, arglist);
+ if (processing_template_decl)
+ return build_min (TEMPLATE_ID_EXPR, type, fns, arglist);
+ else
+ return build (TEMPLATE_ID_EXPR, type, fns, arglist);
}
/* Within the scope of a template class S<T>, the name S gets bound
@@ -2768,25 +3269,31 @@ maybe_get_template_decl_from_type_decl (decl)
parameters, find the desired type.
D1 is the PTYPENAME terminal, and ARGLIST is the list of arguments.
- Since ARGLIST is build on the decl_obstack, we must copy it here
- to keep it from being reclaimed when the decl storage is reclaimed.
+ (Actually ARGLIST may be either a TREE_LIST or a TREE_VEC. It will
+ be a TREE_LIST if called directly from the parser, and a TREE_VEC
+ otherwise.) Since ARGLIST is build on the decl_obstack, we must
+ copy it here to keep it from being reclaimed when the decl storage
+ is reclaimed.
IN_DECL, if non-NULL, is the template declaration we are trying to
instantiate.
+ If ENTERING_SCOPE is non-zero, we are about to enter the scope of
+ the class we are looking up.
+
If the template class is really a local class in a template
function, then the FUNCTION_CONTEXT is the function in which it is
being instantiated. */
tree
-lookup_template_class (d1, arglist, in_decl, context)
+lookup_template_class (d1, arglist, in_decl, context, entering_scope)
tree d1, arglist;
tree in_decl;
tree context;
+ int entering_scope;
{
tree template = NULL_TREE, parmlist;
- char *mangled_name;
- tree id, t;
+ tree t;
if (TREE_CODE (d1) == IDENTIFIER_NODE)
{
@@ -2795,11 +3302,16 @@ lookup_template_class (d1, arglist, in_decl, context)
template = IDENTIFIER_LOCAL_VALUE (d1);
else
{
- template =
- maybe_get_template_decl_from_type_decl
- (IDENTIFIER_CLASS_VALUE (d1));
+ if (context)
+ push_decl_namespace (context);
+ if (current_class_type != NULL_TREE)
+ template =
+ maybe_get_template_decl_from_type_decl
+ (IDENTIFIER_CLASS_VALUE (d1));
if (template == NULL_TREE)
- template = IDENTIFIER_NAMESPACE_VALUE (d1);
+ template = lookup_name_nonclass (d1);
+ if (context)
+ pop_decl_namespace ();
}
if (template)
context = DECL_CONTEXT (template);
@@ -2811,9 +3323,11 @@ lookup_template_class (d1, arglist, in_decl, context)
template = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (d1));
d1 = DECL_NAME (template);
}
- else if (TREE_CODE_CLASS (TREE_CODE (d1)) == 't' && IS_AGGR_TYPE (d1))
+ else if (TREE_CODE (d1) == ENUMERAL_TYPE
+ || (TREE_CODE_CLASS (TREE_CODE (d1)) == 't'
+ && IS_AGGR_TYPE (d1)))
{
- template = CLASSTYPE_TI_TEMPLATE (d1);
+ template = TYPE_TI_TEMPLATE (d1);
d1 = DECL_NAME (template);
}
else if (TREE_CODE (d1) == TEMPLATE_DECL
@@ -2832,6 +3346,10 @@ lookup_template_class (d1, arglist, in_decl, context)
let's give them some syntax errors to chew on instead of a crash. */
if (! template)
return error_mark_node;
+
+ if (context == NULL_TREE)
+ context = global_namespace;
+
if (TREE_CODE (template) != TEMPLATE_DECL)
{
cp_error ("non-template type `%T' used as a template", d1);
@@ -2852,7 +3370,7 @@ lookup_template_class (d1, arglist, in_decl, context)
CLASSTYPE_GOT_SEMICOLON (parm) = 1;
parmlist = DECL_INNERMOST_TEMPLATE_PARMS (template);
- arglist2 = coerce_template_parms (parmlist, arglist, template, 1, 1, 0);
+ arglist2 = coerce_template_parms (parmlist, arglist, template, 1, 1);
if (arglist2 == error_mark_node)
return error_mark_node;
@@ -2862,126 +3380,261 @@ lookup_template_class (d1, arglist, in_decl, context)
TYPE_SIZE (parm) = 0;
return parm;
}
- else if (PRIMARY_TEMPLATE_P (template)
- || (TREE_CODE (TYPE_CONTEXT (TREE_TYPE (template)))
- == FUNCTION_DECL))
+ else
{
- parmlist = DECL_INNERMOST_TEMPLATE_PARMS (template);
-
- arglist = coerce_template_parms (parmlist, arglist, template,
- 1, 1, 0);
- if (arglist == error_mark_node)
- return error_mark_node;
- if (uses_template_parms (arglist))
+ tree template_type = TREE_TYPE (template);
+ tree type_decl;
+ tree found = NULL_TREE;
+ int arg_depth;
+ int parm_depth;
+ int is_partial_instantiation;
+
+ template = most_general_template (template);
+ parmlist = DECL_TEMPLATE_PARMS (template);
+ parm_depth = TMPL_PARMS_DEPTH (parmlist);
+ arg_depth = TMPL_ARGS_DEPTH (arglist);
+
+ if (arg_depth == 1 && parm_depth > 1)
{
- tree found;
- if (comp_template_args
- (CLASSTYPE_TI_ARGS (TREE_TYPE (template)), arglist))
- found = TREE_TYPE (template);
- else
+ /* We've been given an incomplete set of template arguments.
+ For example, given:
+
+ template <class T> struct S1 {
+ template <class U> struct S2 {};
+ template <class U> struct S2<U*> {};
+ };
+
+ we will be called with an ARGLIST of `U*', but the
+ TEMPLATE will be `template <class T> template
+ <class U> struct S1<T>::S2'. We must fill in the missing
+ arguments. */
+ my_friendly_assert (context != NULL_TREE, 0);
+ while (!IS_AGGR_TYPE_CODE (TREE_CODE (context))
+ && context != global_namespace)
+ context = DECL_REAL_CONTEXT (context);
+
+ if (context == global_namespace)
+ /* This is bad. We cannot get enough arguments, even from
+ the surrounding context, to resolve this class. One
+ case where this might happen is (illegal) code like:
+
+ template <class U>
+ template <class T>
+ struct S {
+ A(const A<T>& a) {}
+ };
+
+ We should catch this error sooner (at the opening curly
+ for `S', but it is better to be safe than sorry here. */
{
- for (found = DECL_TEMPLATE_INSTANTIATIONS (template);
- found; found = TREE_CHAIN (found))
- {
- if (TI_USES_TEMPLATE_PARMS (found)
- && comp_template_args (TREE_PURPOSE (found), arglist))
- break;
- }
- if (found)
- found = TREE_VALUE (found);
+ cp_error ("invalid use of `%D'", template);
+ return error_mark_node;
}
- if (found)
+ arglist = add_to_template_args (TYPE_TI_ARGS (context),
+ arglist);
+ arg_depth = TMPL_ARGS_DEPTH (arglist);
+ }
+
+ my_friendly_assert (parm_depth == arg_depth, 0);
+
+ /* Calculate the BOUND_ARGS. These will be the args that are
+ actually tsubst'd into the definition to create the
+ instantiation. */
+ if (parm_depth > 1)
+ {
+ /* We have multiple levels of arguments to coerce, at once. */
+ int i;
+ int saved_depth = TMPL_ARGS_DEPTH (arglist);
+
+ tree bound_args = make_temp_vec (parm_depth);
+
+ for (i = saved_depth,
+ t = DECL_TEMPLATE_PARMS (template);
+ i > 0 && t != NULL_TREE;
+ --i, t = TREE_CHAIN (t))
{
- if (can_free (&permanent_obstack, arglist))
- obstack_free (&permanent_obstack, arglist);
- return found;
+ tree a = coerce_template_parms (TREE_VALUE (t),
+ arglist, template, 1, 1);
+ SET_TMPL_ARGS_LEVEL (bound_args, i, a);
+
+ /* We temporarily reduce the length of the ARGLIST so
+ that coerce_template_parms will see only the arguments
+ corresponding to the template parameters it is
+ examining. */
+ TREE_VEC_LENGTH (arglist)--;
}
+
+ /* Restore the ARGLIST to its full size. */
+ TREE_VEC_LENGTH (arglist) = saved_depth;
+
+ arglist = bound_args;
}
+ else
+ arglist
+ = coerce_template_parms (INNERMOST_TEMPLATE_PARMS (parmlist),
+ innermost_args (arglist),
+ template, 1, 1);
- /* FIXME avoid duplication. */
- mangled_name = mangle_class_name_for_template (IDENTIFIER_POINTER (d1),
- parmlist,
- arglist,
- context);
- id = get_identifier (mangled_name);
- IDENTIFIER_TEMPLATE (id) = d1;
+ if (arglist == error_mark_node)
+ /* We were unable to bind the arguments. */
+ return error_mark_node;
- maybe_push_to_top_level (uses_template_parms (arglist));
- t = xref_tag_from_type (TREE_TYPE (template), id, 1);
+ /* In the scope of a template class, explicit references to the
+ template class refer to the type of the template, not any
+ instantiation of it. For example, in:
+
+ template <class T> class C { void f(C<T>); }
+
+ the `C<T>' is just the same as `C'. Outside of the
+ class, however, such a reference is an instantiation. */
+ if (comp_template_args (TYPE_TI_ARGS (template_type),
+ arglist))
+ {
+ found = template_type;
+
+ if (!entering_scope && PRIMARY_TEMPLATE_P (template))
+ {
+ tree ctx;
+
+ /* Note that we use DECL_CONTEXT, rather than
+ CP_DECL_CONTEXT, so that the termination test is
+ always just `ctx'. We're not interested in namepace
+ scopes. */
+ for (ctx = current_class_type;
+ ctx;
+ ctx = (TREE_CODE_CLASS (TREE_CODE (ctx)) == 't')
+ ? TYPE_CONTEXT (ctx) : DECL_CONTEXT (ctx))
+ if (comptypes (ctx, template_type, 1))
+ break;
+
+ if (!ctx)
+ /* We're not in the scope of the class, so the
+ TEMPLATE_TYPE is not the type we want after
+ all. */
+ found = NULL_TREE;
+ }
+ }
+
+ if (!found)
+ {
+ for (found = DECL_TEMPLATE_INSTANTIATIONS (template);
+ found; found = TREE_CHAIN (found))
+ if (comp_template_args (TREE_PURPOSE (found), arglist))
+ break;
- if (context != NULL_TREE)
+ if (found)
+ found = TREE_VALUE (found);
+ }
+
+ if (found)
{
- /* Set up the context for the type_decl correctly. Note
- that we must clear DECL_ASSEMBLER_NAME to fool
- build_overload_name into creating a new name. */
- tree type_decl = TYPE_STUB_DECL (t);
-
- TYPE_CONTEXT (t) = context;
- DECL_CONTEXT (type_decl) = context;
- DECL_ASSEMBLER_NAME (type_decl) = DECL_NAME (type_decl);
- DECL_ASSEMBLER_NAME (type_decl) =
- get_identifier (build_overload_name (t, 1, 1));
+ if (can_free (&permanent_obstack, arglist))
+ obstack_free (&permanent_obstack, arglist);
+ return found;
}
- pop_from_top_level ();
- }
- else
- {
- tree type_ctx = TYPE_CONTEXT (TREE_TYPE (template));
- tree args = tsubst (CLASSTYPE_TI_ARGS (type_ctx), arglist, in_decl);
- tree ctx = lookup_template_class (type_ctx, args,
- in_decl, NULL_TREE);
- id = d1;
- arglist = CLASSTYPE_TI_ARGS (ctx);
+ /* Since we didn't find the type, we'll have to create it.
+ Since we'll be saving this type on the
+ DECL_TEMPLATE_INSTANTIATIONS list, it must be permanent. */
+ push_obstacks (&permanent_obstack, &permanent_obstack);
+
+ /* This type is a "partial instantiation" if any of the template
+ arguments still inolve template parameters. */
+ is_partial_instantiation = uses_template_parms (arglist);
- if (TYPE_BEING_DEFINED (ctx) && ctx == current_class_type)
+ /* Create the type. */
+ if (TREE_CODE (template_type) == ENUMERAL_TYPE)
{
- int save_temp = processing_template_decl;
- processing_template_decl = 0;
- t = xref_tag_from_type (TREE_TYPE (template), id, 0);
- processing_template_decl = save_temp;
+ if (!is_partial_instantiation)
+ t = start_enum (TYPE_IDENTIFIER (template_type));
+ else
+ /* We don't want to call start_enum for this type, since
+ the values for the enumeration constants may involve
+ template parameters. And, no one should be interested
+ in the enumeration constants for such a type. */
+ t = make_node (ENUMERAL_TYPE);
}
else
{
- t = lookup_nested_type_by_name (ctx, id);
- my_friendly_assert (t != NULL_TREE, 42);
+ t = make_lang_type (TREE_CODE (template_type));
+ CLASSTYPE_DECLARED_CLASS (t)
+ = CLASSTYPE_DECLARED_CLASS (template_type);
+ CLASSTYPE_GOT_SEMICOLON (t) = 1;
+ SET_CLASSTYPE_IMPLICIT_INSTANTIATION (t);
+ TYPE_FOR_JAVA (t) = TYPE_FOR_JAVA (template_type);
}
- }
- /* Seems to be wanted. */
- CLASSTYPE_GOT_SEMICOLON (t) = 1;
+ /* If we called start_enum above, this information will already
+ be set up. */
+ if (!TYPE_NAME (t))
+ {
+ TYPE_CONTEXT (t) = FROB_CONTEXT (context);
+
+ /* Create a stub TYPE_DECL for it. */
+ type_decl = build_decl (TYPE_DECL, DECL_NAME (template), t);
+ SET_DECL_ARTIFICIAL (type_decl);
+ DECL_CONTEXT (type_decl) = TYPE_CONTEXT (t);
+ DECL_SOURCE_FILE (type_decl)
+ = DECL_SOURCE_FILE (TYPE_STUB_DECL (template_type));
+ DECL_SOURCE_LINE (type_decl)
+ = DECL_SOURCE_LINE (TYPE_STUB_DECL (template_type));
+ TYPE_STUB_DECL (t) = TYPE_NAME (t) = type_decl;
+ }
+ else
+ type_decl = TYPE_NAME (t);
- if (! CLASSTYPE_TEMPLATE_INFO (t))
- {
+ /* Set up the template information. */
arglist = copy_to_permanent (arglist);
- CLASSTYPE_TEMPLATE_INFO (t)
- = perm_tree_cons (template, arglist, NULL_TREE);
- DECL_TEMPLATE_INSTANTIATIONS (template) = perm_tree_cons
- (arglist, t, DECL_TEMPLATE_INSTANTIATIONS (template));
- TI_USES_TEMPLATE_PARMS (DECL_TEMPLATE_INSTANTIATIONS (template))
- = uses_template_parms (arglist);
-
- SET_CLASSTYPE_IMPLICIT_INSTANTIATION (t);
-
- /* We need to set this again after CLASSTYPE_TEMPLATE_INFO is set up. */
- DECL_ASSEMBLER_NAME (TYPE_MAIN_DECL (t)) = id;
- if (! uses_template_parms (arglist))
- DECL_ASSEMBLER_NAME (TYPE_MAIN_DECL (t))
- = get_identifier (build_overload_name (t, 1, 1));
+ SET_TYPE_TEMPLATE_INFO (t,
+ tree_cons (template, arglist, NULL_TREE));
+ DECL_TEMPLATE_INSTANTIATIONS (template)
+ = tree_cons (arglist, t,
+ DECL_TEMPLATE_INSTANTIATIONS (template));
+
+ if (TREE_CODE (t) == ENUMERAL_TYPE
+ && !is_partial_instantiation)
+ /* Now that the type has been registered on the instantiations
+ list, we set up the enumerators. Because the enumeration
+ constants may involve the enumeration type itself, we make
+ sure to register the type first, and then create the
+ constants. That way, doing tsubst_expr for the enumeration
+ constants won't result in recursive calls here; we'll find
+ the instantiation and exit above. */
+ tsubst_enum (template_type, t, arglist);
+
+ /* We're done with the permanent obstack, now. */
+ pop_obstacks ();
+
+ /* Reset the name of the type, now that CLASSTYPE_TEMPLATE_INFO
+ is set up. */
+ if (TREE_CODE (t) != ENUMERAL_TYPE)
+ DECL_NAME (type_decl) = classtype_mangled_name (t);
+ DECL_ASSEMBLER_NAME (type_decl) = DECL_NAME (type_decl);
+ if (!is_partial_instantiation)
+ {
+ DECL_ASSEMBLER_NAME (type_decl)
+ = get_identifier (build_overload_name (t, 1, 1));
+
+ /* For backwards compatibility; code that uses
+ -fexternal-templates expects looking up a template to
+ instantiate it. I think DDD still relies on this.
+ (jason 8/20/1998) */
+ if (TREE_CODE (t) != ENUMERAL_TYPE
+ && flag_external_templates
+ && CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template))
+ && ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template)))
+ add_pending_template (t);
+ }
+ else
+ /* If the type makes use of template parameters, the
+ code that generates debugging information will crash. */
+ DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
- if (flag_external_templates && ! uses_template_parms (arglist)
- && CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template))
- && ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template)))
- add_pending_template (t);
+ return t;
}
-
- return t;
}
-/* Should be defined in parse.h. */
-extern int yychar;
-
/* For each TEMPLATE_TYPE_PARM, TEMPLATE_TEMPLATE_PARM, or
TEMPLATE_PARM_INDEX in T, call FN with the parameter and the DATA.
If FN returns non-zero, the iteration is terminated, and
@@ -2998,6 +3651,11 @@ for_each_template_parm (t, fn, data)
{
if (!t)
return 0;
+
+ if (TREE_CODE_CLASS (TREE_CODE (t)) == 't'
+ && for_each_template_parm (TYPE_CONTEXT (t), fn, data))
+ return 1;
+
switch (TREE_CODE (t))
{
case INDIRECT_REF:
@@ -3027,19 +3685,28 @@ for_each_template_parm (t, fn, data)
return 1;
return for_each_template_parm (TREE_CHAIN (t), fn, data);
+ case OVERLOAD:
+ if (for_each_template_parm (OVL_FUNCTION (t), fn, data))
+ return 1;
+ return for_each_template_parm (OVL_CHAIN (t), fn, data);
+
/* constructed type nodes */
case POINTER_TYPE:
case REFERENCE_TYPE:
return for_each_template_parm (TREE_TYPE (t), fn, data);
+
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_FLAG (t))
return for_each_template_parm (TYPE_PTRMEMFUNC_FN_TYPE (t),
fn, data);
+ /* Fall through. */
+
case UNION_TYPE:
- if (! CLASSTYPE_TEMPLATE_INFO (t))
+ case ENUMERAL_TYPE:
+ if (! TYPE_TEMPLATE_INFO (t))
return 0;
return for_each_template_parm (TREE_VALUE
- (CLASSTYPE_TEMPLATE_INFO (t)),
+ (TYPE_TEMPLATE_INFO (t)),
fn, data);
case FUNCTION_TYPE:
if (for_each_template_parm (TYPE_ARG_TYPES (t), fn, data))
@@ -3067,10 +3734,8 @@ for_each_template_parm (t, fn, data)
case TEMPLATE_DECL:
/* A template template parameter is encountered */
if (DECL_TEMPLATE_TEMPLATE_PARM_P (t))
- /* We are parsing a template declaration */
- return 1;
- /* We are instantiating templates with template template
- parameter */
+ return for_each_template_parm (TREE_TYPE (t), fn, data);
+ /* Already substituted template template parameter */
return 0;
case CONST_DECL:
@@ -3100,8 +3765,12 @@ for_each_template_parm (t, fn, data)
return for_each_template_parm (TREE_OPERAND (t, 0), fn, data);
/* template parm nodes */
- case TEMPLATE_TYPE_PARM:
case TEMPLATE_TEMPLATE_PARM:
+ /* Record template parameters such as `T' inside `TT<T>'. */
+ if (CLASSTYPE_TEMPLATE_INFO (t)
+ && for_each_template_parm (CLASSTYPE_TI_ARGS (t), fn, data))
+ return 1;
+ case TEMPLATE_TYPE_PARM:
case TEMPLATE_PARM_INDEX:
if (fn)
return (*fn)(t, data);
@@ -3118,16 +3787,7 @@ for_each_template_parm (t, fn, data)
case COMPLEX_TYPE:
case VOID_TYPE:
case BOOLEAN_TYPE:
- return 0;
-
- case ENUMERAL_TYPE:
- {
- tree v;
-
- for (v = TYPE_VALUES (t); v != NULL_TREE; v = TREE_CHAIN (v))
- if (for_each_template_parm (TREE_VALUE (v), fn, data))
- return 1;
- }
+ case NAMESPACE_DECL:
return 0;
/* constants */
@@ -3146,6 +3806,9 @@ for_each_template_parm (t, fn, data)
case TYPENAME_TYPE:
return 1;
+ case PTRMEM_CST:
+ return for_each_template_parm (TREE_TYPE (t), fn, data);
+
case SCOPE_REF:
return for_each_template_parm (TREE_OPERAND (t, 0), fn, data);
@@ -3179,7 +3842,7 @@ for_each_template_parm (t, fn, data)
case '<':
{
int i;
- for (i = tree_code_length[(int) TREE_CODE (t)]; --i >= 0;)
+ for (i = first_rtl_op (TREE_CODE (t)); --i >= 0;)
if (for_each_template_parm (TREE_OPERAND (t, i), fn, data))
return 1;
return 0;
@@ -3202,34 +3865,71 @@ uses_template_parms (t)
return for_each_template_parm (t, 0, 0);
}
-static struct tinst_level *current_tinst_level = 0;
-static struct tinst_level *free_tinst_level = 0;
-static int tinst_depth = 0;
+static struct tinst_level *current_tinst_level;
+static struct tinst_level *free_tinst_level;
+static int tinst_depth;
extern int max_tinst_depth;
#ifdef GATHER_STATISTICS
-int depth_reached = 0;
+int depth_reached;
#endif
+int tinst_level_tick;
+int last_template_error_tick;
/* Print out all the template instantiations that we are currently
- working on. */
+ working on. If ERR, we are being called from cp_thing, so do
+ the right thing for an error message. */
-void
-print_template_context ()
+static void
+print_template_context (err)
+ int err;
{
struct tinst_level *p = current_tinst_level;
int line = lineno;
char *file = input_filename;
+ if (err && p)
+ {
+ if (current_function_decl != p->decl
+ && current_function_decl != NULL_TREE)
+ /* We can get here during the processing of some synthesized
+ method. Then, p->decl will be the function that's causing
+ the synthesis. */
+ ;
+ else
+ {
+ if (current_function_decl == p->decl)
+ /* Avoid redundancy with the the "In function" line. */;
+ else
+ fprintf (stderr, "%s: In instantiation of `%s':\n",
+ file, decl_as_string (p->decl, 0));
+
+ line = p->line;
+ file = p->file;
+ p = p->next;
+ }
+ }
+
for (; p; p = p->next)
{
- cp_error (" instantiated from `%D'", p->decl);
- lineno = p->line;
- input_filename = p->file;
+ fprintf (stderr, "%s:%d: instantiated from `%s'\n", file, line,
+ decl_as_string (p->decl, 0));
+ line = p->line;
+ file = p->file;
}
- error (" instantiated from here");
+ fprintf (stderr, "%s:%d: instantiated from here\n", file, line);
+}
- lineno = line;
- input_filename = file;
+/* Called from cp_thing to print the template context for an error. */
+
+void
+maybe_print_template_context ()
+{
+ if (last_template_error_tick == tinst_level_tick
+ || current_tinst_level == 0)
+ return;
+
+ last_template_error_tick = tinst_level_tick;
+ print_template_context (1);
}
static int
@@ -3246,12 +3946,13 @@ push_tinst_level (d)
if (uses_template_parms (d))
return 0;
+ last_template_error_tick = tinst_level_tick;
error ("template instantiation depth exceeds maximum of %d",
max_tinst_depth);
error (" (use -ftemplate-depth-NN to increase the maximum)");
cp_error (" instantiating `%D'", d);
- print_template_context ();
+ print_template_context (0);
return 0;
}
@@ -3276,6 +3977,7 @@ push_tinst_level (d)
depth_reached = tinst_depth;
#endif
+ ++tinst_level_tick;
return 1;
}
@@ -3284,10 +3986,17 @@ pop_tinst_level ()
{
struct tinst_level *old = current_tinst_level;
+ /* Restore the filename and line number stashed away when we started
+ this instantiation. */
+ lineno = old->line;
+ input_filename = old->file;
+ extract_interface_info ();
+
current_tinst_level = old->next;
old->next = free_tinst_level;
free_tinst_level = old;
--tinst_depth;
+ ++tinst_level_tick;
}
struct tinst_level *
@@ -3312,7 +4021,12 @@ tsubst_friend_function (decl, args)
tree args;
{
tree new_friend;
-
+ int line = lineno;
+ char *file = input_filename;
+
+ lineno = DECL_SOURCE_LINE (decl);
+ input_filename = DECL_SOURCE_FILE (decl);
+
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_TEMPLATE_INSTANTIATION (decl)
&& TREE_CODE (DECL_TI_TEMPLATE (decl)) != TEMPLATE_DECL)
@@ -3328,31 +4042,26 @@ tsubst_friend_function (decl, args)
tree template_id;
tree new_args;
tree tmpl;
- tree tinfo;
template_id
= lookup_template_function (tsubst_expr (DECL_TI_TEMPLATE (decl),
args, NULL_TREE),
tsubst (DECL_TI_ARGS (decl),
args, NULL_TREE));
-
- /* Temporarily remove the DECL_TEMPLATE_INFO so as not to
- confuse tsubst. */
- tinfo = DECL_TEMPLATE_INFO (decl);
- DECL_TEMPLATE_INFO (decl) = NULL_TREE;
+ /* FIXME: The decl we create via the next tsubst could be
+ created on a temporary obstack. */
new_friend = tsubst (decl, args, NULL_TREE);
- DECL_TEMPLATE_INFO (decl) = tinfo;
-
- tmpl = determine_specialization (template_id,
- new_friend,
- &new_args,
- 0, 1);
- return instantiate_template (tmpl, new_args);
+ tmpl = determine_specialization (template_id, new_friend,
+ &new_args,
+ /*need_member_template=*/0,
+ /*complain=*/1);
+ new_friend = instantiate_template (tmpl, new_args);
+ goto done;
}
- else
- new_friend = tsubst (decl, args, NULL_TREE);
+
+ new_friend = tsubst (decl, args, NULL_TREE);
- /* The new_friend will look like an instantiation, to the
+ /* The NEW_FRIEND will look like an instantiation, to the
compiler, but is not an instantiation from the point of view of
the language. For example, we might have had:
@@ -3365,15 +4074,110 @@ tsubst_friend_function (decl, args)
DECL_USE_TEMPLATE (new_friend) = 0;
if (TREE_CODE (decl) == TEMPLATE_DECL)
DECL_USE_TEMPLATE (DECL_TEMPLATE_RESULT (new_friend)) = 0;
-
- if (DECL_CONTEXT (new_friend) == NULL_TREE)
+
+ /* The mangled name for the NEW_FRIEND is incorrect. The call to
+ tsubst will have resulted in a call to
+ set_mangled_name_for_template_decl. But, the function is not a
+ template instantiation and should not be mangled like one.
+ Therefore, we remangle the function name. We don't have to do
+ this if the NEW_FRIEND is a template since
+ set_mangled_name_for_template_decl doesn't do anything if the
+ function declaration still uses template arguments. */
+ if (TREE_CODE (new_friend) != TEMPLATE_DECL)
+ {
+ set_mangled_name_for_decl (new_friend);
+ DECL_RTL (new_friend) = 0;
+ make_decl_rtl (new_friend, NULL_PTR, 1);
+ }
+
+ if (DECL_NAMESPACE_SCOPE_P (new_friend))
{
+ tree old_decl;
+ tree new_friend_args;
+
if (TREE_CODE (new_friend) == TEMPLATE_DECL)
/* This declaration is a `primary' template. */
- TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (new_friend))
- = new_friend;
+ DECL_PRIMARY_TEMPLATE (new_friend) = new_friend;
+
+ /* We must save the DECL_TI_ARGS for NEW_FRIEND here because
+ pushdecl may call duplicate_decls which will free NEW_FRIEND
+ if possible. */
+ new_friend_args = DECL_TI_ARGS (new_friend);
+ old_decl = pushdecl_namespace_level (new_friend);
+
+ if (old_decl != new_friend)
+ {
+ /* This new friend declaration matched an existing
+ declaration. For example, given:
+
+ template <class T> void f(T);
+ template <class U> class C {
+ template <class T> friend void f(T) {}
+ };
+
+ the friend declaration actually provides the definition
+ of `f', once C has been instantiated for some type. So,
+ old_decl will be the out-of-class template declaration,
+ while new_friend is the in-class definition.
+
+ But, if `f' was called before this point, the
+ instantiation of `f' will have DECL_TI_ARGS corresponding
+ to `T' but not to `U', references to which might appear
+ in the definition of `f'. Previously, the most general
+ template for an instantiation of `f' was the out-of-class
+ version; now it is the in-class version. Therefore, we
+ run through all specialization of `f', adding to their
+ DECL_TI_ARGS appropriately. In particular, they need a
+ new set of outer arguments, corresponding to the
+ arguments for this class instantiation.
+
+ The same situation can arise with something like this:
+
+ friend void f(int);
+ template <class T> class C {
+ friend void f(T) {}
+ };
+
+ when `C<int>' is instantiated. Now, `f(int)' is defined
+ in the class. */
+
+ if (TREE_CODE (old_decl) != TEMPLATE_DECL)
+ /* duplicate_decls will take care of this case. */
+ ;
+ else
+ {
+ tree t;
- new_friend = pushdecl_top_level (new_friend);
+ for (t = DECL_TEMPLATE_SPECIALIZATIONS (old_decl);
+ t != NULL_TREE;
+ t = TREE_CHAIN (t))
+ {
+ tree spec = TREE_VALUE (t);
+
+ DECL_TI_ARGS (spec)
+ = add_outermost_template_args (new_friend_args,
+ DECL_TI_ARGS (spec));
+ DECL_TI_ARGS (spec)
+ = copy_to_permanent (DECL_TI_ARGS (spec));
+ }
+
+ /* Now, since specializations are always supposed to
+ hang off of the most general template, we must move
+ them. */
+ t = most_general_template (old_decl);
+ if (t != old_decl)
+ {
+ DECL_TEMPLATE_SPECIALIZATIONS (t)
+ = chainon (DECL_TEMPLATE_SPECIALIZATIONS (t),
+ DECL_TEMPLATE_SPECIALIZATIONS (old_decl));
+ DECL_TEMPLATE_SPECIALIZATIONS (old_decl) = NULL_TREE;
+ }
+ }
+
+ /* The information from NEW_FRIEND has been merged into OLD_DECL
+ by duplicate_decls. */
+ new_friend = old_decl;
+ }
}
else if (TYPE_SIZE (DECL_CONTEXT (new_friend)))
{
@@ -3386,31 +4190,39 @@ tsubst_friend_function (decl, args)
new_friend = fn;
}
+ done:
+ lineno = line;
+ input_filename = file;
return new_friend;
}
-/* FRIEND_TYPE is a friend RECORD_TYPE or UNION_TYPE. ARGS is the
- vector of template arguments, as for tsubst.
+/* FRIEND_TMPL is a friend TEMPLATE_DECL. ARGS is the vector of
+ template arguments, as for tsubst.
Returns an appropriate tsbust'd friend type. */
static tree
-tsubst_friend_class (friend_type, args)
- tree friend_type;
+tsubst_friend_class (friend_tmpl, args)
+ tree friend_tmpl;
tree args;
{
- tree tmpl =
- lookup_name (DECL_NAME (CLASSTYPE_TI_TEMPLATE (friend_type)), 1);
+ tree friend_type;
+ tree tmpl = lookup_name (DECL_NAME (friend_tmpl), 1);
tmpl = maybe_get_template_decl_from_type_decl (tmpl);
if (tmpl != NULL_TREE && DECL_CLASS_TEMPLATE_P (tmpl))
{
/* The friend template has already been declared. Just
- check to see that the declarations match. */
- redeclare_class_template (TREE_TYPE (tmpl),
- DECL_TEMPLATE_PARMS (CLASSTYPE_TI_TEMPLATE
- (friend_type)));
+ check to see that the declarations match, and install any new
+ default parameters. We must tsubst the default parameters,
+ of course. We only need the innermost template parameters
+ because that is all that redeclare_class_template will look
+ at. */
+ tree parms
+ = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_tmpl),
+ args);
+ redeclare_class_template (TREE_TYPE (tmpl), parms);
friend_type = TREE_TYPE (tmpl);
}
else
@@ -3418,7 +4230,7 @@ tsubst_friend_class (friend_type, args)
/* The friend template has not already been declared. In this
case, the instantiation of the template class will cause the
injection of this template into the global scope. */
- tmpl = tsubst (CLASSTYPE_TI_TEMPLATE (friend_type), args, NULL_TREE);
+ tmpl = tsubst (friend_tmpl, args, NULL_TREE);
/* The new TMPL is not an instantiation of anything, so we
forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for
@@ -3439,32 +4251,19 @@ tree
instantiate_class_template (type)
tree type;
{
- tree template, template_info, args, pattern, t, *field_chain;
- tree typedecl, outer_args;
+ tree template, args, pattern, t;
+ tree typedecl;
if (type == error_mark_node)
return error_mark_node;
- template_info = CLASSTYPE_TEMPLATE_INFO (type);
-
if (TYPE_BEING_DEFINED (type) || TYPE_SIZE (type))
return type;
- template = TI_TEMPLATE (template_info);
+ template = most_general_template (CLASSTYPE_TI_TEMPLATE (type));
+ args = CLASSTYPE_TI_ARGS (type);
my_friendly_assert (TREE_CODE (template) == TEMPLATE_DECL, 279);
- args = TI_ARGS (template_info);
-
- if (DECL_TEMPLATE_INFO (template))
- {
- outer_args = DECL_TI_ARGS (template);
- while (DECL_TEMPLATE_INFO (template))
- template = DECL_TI_TEMPLATE (template);
- }
- else
- outer_args = NULL_TREE;
-
- t = most_specialized_class
- (DECL_TEMPLATE_SPECIALIZATIONS (template), args, outer_args);
+ t = most_specialized_class (template, args);
if (t == error_mark_node)
{
@@ -3473,7 +4272,7 @@ instantiate_class_template (type)
for (t = DECL_TEMPLATE_SPECIALIZATIONS (template); t; t = TREE_CHAIN (t))
{
if (get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
- args, outer_args))
+ args))
{
cp_error_at ("%s %+#T", str, TREE_TYPE (t));
str = " ";
@@ -3491,20 +4290,44 @@ instantiate_class_template (type)
return type;
if (t)
- args = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
- args, outer_args);
+ {
+ /* This TYPE is actually a instantiation of of a partial
+ specialization. We replace the innermost set of ARGS with
+ the arguments appropriate for substitution. For example,
+ given:
- if (pedantic && uses_template_parms (args))
- /* If there are still template parameters amongst the args, then
- we can't instantiate the type; there's no telling whether or not one
- of the template parameters might eventually be instantiated to some
- value that results in a specialization being used. */
- return type;
+ template <class T> struct S {};
+ template <class T> struct S<T*> {};
+
+ and supposing that we are instantiating S<int*>, ARGS will
+ present be {int*} but we need {int}. */
+ tree inner_args
+ = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
+ args);
+
+ /* If there were multiple levels in ARGS, replacing the
+ innermost level would alter CLASSTYPE_TI_ARGS, which we don't
+ want, so we make a copy first. */
+ if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args))
+ {
+ args = copy_node (args);
+ SET_TMPL_ARGS_LEVEL (args, TMPL_ARGS_DEPTH (args), inner_args);
+ }
+ else
+ args = inner_args;
+ }
- /* We must copy the arguments to the permanent obstack since
- during the tsubst'ing below they may wind up in the
- DECL_TI_ARGS of some instantiated member template. */
- args = copy_to_permanent (args);
+ if (pedantic && uses_template_parms (args))
+ {
+ /* If there are still template parameters amongst the args, then
+ we can't instantiate the type; there's no telling whether or not one
+ of the template parameters might eventually be instantiated to some
+ value that results in a specialization being used. We do the
+ type as complete so that, for example, declaring one of its
+ members to be a friend will not be rejected. */
+ TYPE_SIZE (type) = integer_zero_node;
+ return type;
+ }
TYPE_BEING_DEFINED (type) = 1;
@@ -3514,8 +4337,10 @@ instantiate_class_template (type)
maybe_push_to_top_level (uses_template_parms (type));
pushclass (type, 0);
- if (outer_args)
- args = add_to_template_args (outer_args, args);
+ /* We must copy the arguments to the permanent obstack since
+ during the tsubst'ing below they may wind up in the
+ DECL_TI_ARGS of some instantiated member template. */
+ args = copy_to_permanent (args);
if (flag_external_templates)
{
@@ -3567,8 +4392,7 @@ instantiate_class_template (type)
= TYPE_USES_VIRTUAL_BASECLASSES (pattern);
TYPE_PACKED (type) = TYPE_PACKED (pattern);
TYPE_ALIGN (type) = TYPE_ALIGN (pattern);
-
- CLASSTYPE_LOCAL_TYPEDECLS (type) = CLASSTYPE_LOCAL_TYPEDECLS (pattern);
+ TYPE_FOR_JAVA (type) = TYPE_FOR_JAVA (pattern); /* For libjava's JArray<T> */
/* If this is a partial instantiation, don't tsubst anything. We will
only use this type for implicit typename, so the actual contents don't
@@ -3595,19 +4419,34 @@ instantiate_class_template (type)
bases = make_tree_vec (len);
for (i = 0; i < len; ++i)
{
- tree elt;
+ tree elt, basetype;
TREE_VEC_ELT (bases, i) = elt
= tsubst (TREE_VEC_ELT (pbases, i), args, NULL_TREE);
BINFO_INHERITANCE_CHAIN (elt) = binfo;
- if (! IS_AGGR_TYPE (TREE_TYPE (elt)))
+ basetype = TREE_TYPE (elt);
+
+ if (! IS_AGGR_TYPE (basetype))
cp_error
("base type `%T' of `%T' fails to be a struct or class type",
- TREE_TYPE (elt), type);
- else if (TYPE_SIZE (complete_type (TREE_TYPE (elt))) == NULL_TREE)
+ basetype, type);
+ else if (TYPE_SIZE (complete_type (basetype)) == NULL_TREE)
cp_error ("base class `%T' of `%T' has incomplete type",
- TREE_TYPE (elt), type);
+ basetype, type);
+
+ /* These are set up in xref_basetypes for normal classes, so
+ we have to handle them here for template bases. */
+
+ unshare_base_binfos (elt);
+
+ if (TYPE_USES_VIRTUAL_BASECLASSES (basetype))
+ {
+ TYPE_USES_VIRTUAL_BASECLASSES (type) = 1;
+ TYPE_USES_COMPLEX_INHERITANCE (type) = 1;
+ }
+ TYPE_GETS_NEW (type) |= TYPE_GETS_NEW (basetype);
+ TYPE_GETS_DELETE (type) |= TYPE_GETS_DELETE (basetype);
}
/* Don't initialize this until the vector is filled out, or
lookups will crash. */
@@ -3615,31 +4454,39 @@ instantiate_class_template (type)
}
}
- field_chain = &TYPE_FIELDS (type);
-
for (t = CLASSTYPE_TAGS (pattern); t; t = TREE_CHAIN (t))
{
tree tag = TREE_VALUE (t);
+ tree name = TYPE_IDENTIFIER (tag);
+ tree newtag;
- /* These will add themselves to CLASSTYPE_TAGS for the new type. */
- if (TREE_CODE (tag) == ENUMERAL_TYPE)
+ newtag = tsubst (tag, args, NULL_TREE);
+ if (TREE_CODE (newtag) != ENUMERAL_TYPE)
{
- (void) tsubst_enum (tag, args, field_chain);
- while (*field_chain)
- {
- DECL_FIELD_CONTEXT (*field_chain) = type;
- field_chain = &TREE_CHAIN (*field_chain);
- }
+ /* Now, we call pushtag to put this NEWTAG into the scope of
+ TYPE. We first set up the IDENTIFIER_TYPE_VALUE to avoid
+ pushtag calling push_template_decl. We don't have to do
+ this for enums because it will already have been done in
+ tsubst_enum. */
+ if (name)
+ SET_IDENTIFIER_TYPE_VALUE (name, newtag);
+ pushtag (name, newtag, /*globalize=*/0);
}
- else
- tsubst (tag, args, NULL_TREE);
}
/* Don't replace enum constants here. */
for (t = TYPE_FIELDS (pattern); t; t = TREE_CHAIN (t))
if (TREE_CODE (t) != CONST_DECL)
{
- tree r = tsubst (t, args, NULL_TREE);
+ tree r;
+
+ /* The the file and line for this declaration, to assist in
+ error message reporting. Since we called push_tinst_level
+ above, we don't need to restore these. */
+ lineno = DECL_SOURCE_LINE (t);
+ input_filename = DECL_SOURCE_FILE (t);
+
+ r = tsubst (t, args, NULL_TREE);
if (TREE_CODE (r) == VAR_DECL)
{
pending_statics = perm_tree_cons (NULL_TREE, r, pending_statics);
@@ -3649,18 +4496,26 @@ instantiate_class_template (type)
DECL_EXTERNAL (r) = 1;
cp_finish_decl (r, DECL_INITIAL (r), NULL_TREE, 0, 0);
}
-
- *field_chain = r;
- field_chain = &TREE_CHAIN (r);
+
+ /* R will have a TREE_CHAIN if and only if it has already been
+ processed by finish_member_declaration. This can happen
+ if, for example, it is a TYPE_DECL for a class-scoped
+ ENUMERAL_TYPE; such a thing will already have been added to
+ the field list by tsubst_enum above. */
+ if (!TREE_CHAIN (r))
+ {
+ set_current_access_from_decl (r);
+ finish_member_declaration (r);
+ }
}
- TYPE_METHODS (type) = tsubst_chain (TYPE_METHODS (pattern), args);
- for (t = TYPE_METHODS (type); t; t = TREE_CHAIN (t))
+ /* Set up the list (TYPE_METHODS) and vector (CLASSTYPE_METHOD_VEC)
+ for this instantiation. */
+ for (t = TYPE_METHODS (pattern); t; t = TREE_CHAIN (t))
{
- if (DECL_CONSTRUCTOR_P (t))
- grok_ctor_properties (type, t);
- else if (IDENTIFIER_OPNAME_P (DECL_NAME (t)))
- grok_op_properties (t, DECL_VIRTUAL_P (t), 0);
+ tree r = tsubst (t, args, NULL_TREE);
+ set_current_access_from_decl (r);
+ finish_member_declaration (r);
}
/* Construct the DECL_FRIENDLIST for the new class type. */
@@ -3703,19 +4558,31 @@ instantiate_class_template (type)
t = TREE_CHAIN (t))
{
tree friend_type = TREE_VALUE (t);
+ tree new_friend_type;
- if (!CLASSTYPE_IS_TEMPLATE (friend_type))
+ if (TREE_CODE (friend_type) == TEMPLATE_DECL)
+ new_friend_type = tsubst_friend_class (friend_type, args);
+ else if (uses_template_parms (friend_type))
+ new_friend_type = tsubst (friend_type, args, NULL_TREE);
+ else
/* The call to xref_tag_from_type does injection for friend
classes. */
- friend_type =
- xref_tag_from_type (tsubst (friend_type, args, NULL_TREE),
- NULL_TREE, 1);
- else
- friend_type = tsubst_friend_class (friend_type, args);
+ new_friend_type =
+ xref_tag_from_type (friend_type, NULL_TREE, 1);
- CLASSTYPE_FRIEND_CLASSES (type) =
- tree_cons (NULL_TREE, friend_type,
- CLASSTYPE_FRIEND_CLASSES (type));
+
+ if (TREE_CODE (friend_type) == TEMPLATE_DECL)
+ /* Trick make_friend_class into realizing that the friend
+ we're adding is a template, not an ordinary class. It's
+ important that we use make_friend_class since it will
+ perform some error-checking and output cross-reference
+ information. */
+ ++processing_template_decl;
+
+ make_friend_class (type, new_friend_type);
+
+ if (TREE_CODE (friend_type) == TEMPLATE_DECL)
+ --processing_template_decl;
}
/* This does injection for friend functions. */
@@ -3741,6 +4608,14 @@ instantiate_class_template (type)
require_complete_type (t);
}
+ /* Set the file and line number information to whatever is given for
+ the class itself. This puts error messages involving generated
+ implicit functions at a predictable point, and the same point
+ that would be used for non-template classes. */
+ lineno = DECL_SOURCE_LINE (typedecl);
+ input_filename = DECL_SOURCE_FILE (typedecl);
+
+ unreverse_member_declarations (type);
type = finish_struct_1 (type, 0);
CLASSTYPE_GOT_SEMICOLON (type) = 1;
@@ -3774,24 +4649,6 @@ list_eq (t1, t2)
return list_eq (TREE_CHAIN (t1), TREE_CHAIN (t2));
}
-tree
-lookup_nested_type_by_name (ctype, name)
- tree ctype, name;
-{
- tree t;
-
- complete_type (ctype);
-
- for (t = CLASSTYPE_TAGS (ctype); t; t = TREE_CHAIN (t))
- {
- if (name == TREE_PURPOSE (t)
- /* this catches typedef enum { foo } bar; */
- || name == TYPE_IDENTIFIER (TREE_VALUE (t)))
- return TREE_VALUE (t);
- }
- return NULL_TREE;
-}
-
/* If arg is a non-type template parameter that does not depend on template
arguments, fold it like we weren't in the body of a template. */
@@ -3819,50 +4676,112 @@ maybe_fold_nontype_arg (arg)
}
/* Return the TREE_VEC with the arguments for the innermost template header,
- where ARGS is either that or the VEC of VECs for all the arguments.
-
- If is_spec, then we are dealing with a specialization of a member
- template, and want the second-innermost args, the innermost ones that
- are instantiated. */
+ where ARGS is either that or the VEC of VECs for all the
+ arguments. */
tree
-innermost_args (args, is_spec)
+innermost_args (args)
tree args;
- int is_spec;
{
- if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
- return TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1 - is_spec);
- return args;
+ return TMPL_ARGS_LEVEL (args, TMPL_ARGS_DEPTH (args));
}
-/* Take the tree structure T and replace template parameters used therein
- with the argument vector ARGS. IN_DECL is an associated decl for
- diagnostics.
+/* Substitute ARGS into the vector of template arguments T. */
- tsubst is used for dealing with types, decls and the like; for
- expressions, use tsubst_expr or tsubst_copy. */
+tree
+tsubst_template_arg_vector (t, args)
+ tree t;
+ tree args;
+{
+ int len = TREE_VEC_LENGTH (t), need_new = 0, i;
+ tree *elts = (tree *) alloca (len * sizeof (tree));
+
+ bzero ((char *) elts, len * sizeof (tree));
+
+ for (i = 0; i < len; i++)
+ {
+ if (TREE_VEC_ELT (t, i) != NULL_TREE
+ && TREE_CODE (TREE_VEC_ELT (t, i)) == TREE_VEC)
+ elts[i] = tsubst_template_arg_vector (TREE_VEC_ELT (t, i), args);
+ else
+ elts[i] = maybe_fold_nontype_arg
+ (tsubst_expr (TREE_VEC_ELT (t, i), args, NULL_TREE));
+
+ if (elts[i] != TREE_VEC_ELT (t, i))
+ need_new = 1;
+ }
+
+ if (!need_new)
+ return t;
+
+ t = make_tree_vec (len);
+ for (i = 0; i < len; i++)
+ TREE_VEC_ELT (t, i) = elts[i];
+
+ return t;
+}
+
+/* Return the result of substituting ARGS into the template parameters
+ given by PARMS. If there are m levels of ARGS and m + n levels of
+ PARMS, then the result will contain n levels of PARMS. For
+ example, if PARMS is `template <class T> template <class U>
+ template <T*, U, class V>' and ARGS is {{int}, {double}} then the
+ result will be `template <int*, double, class V>'. */
tree
-tsubst (t, args, in_decl)
- tree t, args;
- tree in_decl;
+tsubst_template_parms (parms, args)
+ tree parms;
+ tree args;
{
- tree type;
+ tree r;
+ tree* new_parms = &r;
- if (t == NULL_TREE || t == error_mark_node
- || t == integer_type_node
- || t == void_type_node
- || t == char_type_node)
- return t;
+ for (new_parms = &r;
+ TMPL_PARMS_DEPTH (parms) > TMPL_ARGS_DEPTH (args);
+ new_parms = &(TREE_CHAIN (*new_parms)),
+ parms = TREE_CHAIN (parms))
+ {
+ tree new_vec =
+ make_tree_vec (TREE_VEC_LENGTH (TREE_VALUE (parms)));
+ int i;
+
+ for (i = 0; i < TREE_VEC_LENGTH (new_vec); ++i)
+ {
+ tree default_value =
+ TREE_PURPOSE (TREE_VEC_ELT (TREE_VALUE (parms), i));
+ tree parm_decl =
+ TREE_VALUE (TREE_VEC_ELT (TREE_VALUE (parms), i));
+
+ TREE_VEC_ELT (new_vec, i)
+ = build_tree_list (tsubst (default_value, args, NULL_TREE),
+ tsubst (parm_decl, args, NULL_TREE));
+
+ }
+
+ *new_parms =
+ tree_cons (build_int_2 (0, (TMPL_PARMS_DEPTH (parms)
+ - TMPL_ARGS_DEPTH (args))),
+ new_vec, NULL_TREE);
+ }
- type = TREE_TYPE (t);
- if (type == unknown_type_node)
- my_friendly_abort (42);
- if (type && TREE_CODE (t) != FUNCTION_DECL
- && TREE_CODE (t) != TYPENAME_TYPE
- && TREE_CODE (t) != TEMPLATE_DECL
- && TREE_CODE (t) != IDENTIFIER_NODE)
- type = tsubst (type, args, in_decl);
+ return r;
+}
+
+/* Substitute the ARGS into the indicated aggregate (or enumeration)
+ type T. If T is not an aggregate or enumeration type, it is
+ handled as if by tsubst. IN_DECL is as for tsubst. If
+ ENTERING_SCOPE is non-zero, T is the context for a template which
+ we are presently tsubst'ing. Return the subsituted value. */
+
+tree
+tsubst_aggr_type (t, args, in_decl, entering_scope)
+ tree t;
+ tree args;
+ tree in_decl;
+ int entering_scope;
+{
+ if (t == NULL_TREE)
+ return NULL_TREE;
switch (TREE_CODE (t))
{
@@ -3876,209 +4795,102 @@ tsubst (t, args, in_decl)
}
/* else fall through */
+ case ENUMERAL_TYPE:
case UNION_TYPE:
if (uses_template_parms (t))
{
- tree argvec = tsubst (CLASSTYPE_TI_ARGS (t), args, in_decl);
+ tree argvec;
tree context;
tree r;
- context =
- TYPE_CONTEXT (t)
- ? tsubst (TYPE_CONTEXT (t), args, in_decl) : NULL_TREE;
+ /* First, determine the context for the type we are looking
+ up. */
+ if (TYPE_CONTEXT (t) != NULL_TREE)
+ context = tsubst_aggr_type (TYPE_CONTEXT (t), args,
+ in_decl, /*entering_scope=*/1);
+ else
+ context = NULL_TREE;
- r = lookup_template_class (t, argvec, in_decl, context);
+ /* Then, figure out what arguments are appropriate for the
+ type we are trying to find. For example, given:
- return cp_build_type_variant (r, TYPE_READONLY (t),
- TYPE_VOLATILE (t));
- }
+ template <class T> struct S;
+ template <class T, class U> void f(T, U) { S<U> su; }
- /* else fall through */
- case ERROR_MARK:
- case IDENTIFIER_NODE:
- case OP_IDENTIFIER:
- case VOID_TYPE:
- case REAL_TYPE:
- case COMPLEX_TYPE:
- case BOOLEAN_TYPE:
- case INTEGER_CST:
- case REAL_CST:
- case STRING_CST:
- return t;
-
- case ENUMERAL_TYPE:
- {
- tree ctx = tsubst (TYPE_CONTEXT (t), args, in_decl);
- if (ctx == NULL_TREE)
- return t;
- else if (ctx == current_function_decl)
- return lookup_name (TYPE_IDENTIFIER (t), 1);
- else
- return lookup_nested_type_by_name (ctx, TYPE_IDENTIFIER (t));
- }
+ and supposing that we are instantiating f<int, double>,
+ then our ARGS will be {int, double}, but, when looking up
+ S we only want {double}. */
+ argvec = tsubst (TYPE_TI_ARGS (t), args, in_decl);
- case INTEGER_TYPE:
- if (t == integer_type_node)
- return t;
+ r = lookup_template_class (t, argvec, in_decl, context,
+ entering_scope);
- if (TREE_CODE (TYPE_MIN_VALUE (t)) == INTEGER_CST
- && TREE_CODE (TYPE_MAX_VALUE (t)) == INTEGER_CST)
+ return cp_build_type_variant (r, TYPE_READONLY (t),
+ TYPE_VOLATILE (t));
+ }
+ else
+ /* This is not a template type, so there's nothing to do. */
return t;
- {
- tree max = TREE_OPERAND (TYPE_MAX_VALUE (t), 0);
- max = tsubst_expr (max, args, in_decl);
- if (processing_template_decl)
- {
- tree itype = make_node (INTEGER_TYPE);
- TYPE_MIN_VALUE (itype) = size_zero_node;
- TYPE_MAX_VALUE (itype) = build_min (MINUS_EXPR, sizetype, max,
- integer_one_node);
- return itype;
- }
-
- max = fold (build_binary_op (MINUS_EXPR, max, integer_one_node, 1));
- return build_index_2_type (size_zero_node, max);
- }
-
- case TEMPLATE_TYPE_PARM:
- case TEMPLATE_TEMPLATE_PARM:
- case TEMPLATE_PARM_INDEX:
- {
- int idx;
- int level;
- int levels;
- tree r = NULL_TREE;
-
- if (TREE_CODE (t) == TEMPLATE_TYPE_PARM
- || TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM)
- {
- idx = TEMPLATE_TYPE_IDX (t);
- level = TEMPLATE_TYPE_LEVEL (t);
- }
- else
- {
- idx = TEMPLATE_PARM_IDX (t);
- level = TEMPLATE_PARM_LEVEL (t);
- }
-
- if (TREE_VEC_LENGTH (args) > 0)
- {
- tree arg = NULL_TREE;
-
- if (TREE_VEC_ELT (args, 0) != NULL_TREE
- && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
- {
- levels = TREE_VEC_LENGTH (args);
- if (level <= levels)
- arg = TREE_VEC_ELT
- (TREE_VEC_ELT (args, level - 1), idx);
- }
- else
- {
- levels = 1;
- if (level == 1)
- arg = TREE_VEC_ELT (args, idx);
- }
-
- if (arg != NULL_TREE)
- {
- if (TREE_CODE (t) == TEMPLATE_TYPE_PARM)
- return cp_build_type_variant
- (arg, TYPE_READONLY (arg) || TYPE_READONLY (t),
- TYPE_VOLATILE (arg) || TYPE_VOLATILE (t));
- else if (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM)
- {
- if (CLASSTYPE_TEMPLATE_INFO (t))
- {
- /* We are processing a type constructed from
- a template template parameter */
- tree argvec = tsubst (CLASSTYPE_TI_ARGS (t),
- args, in_decl);
- tree r;
-
- /* We can get a TEMPLATE_TEMPLATE_PARM here when
- we are resolving nested-types in the signature of
- a member function templates.
- Otherwise ARG is a TEMPLATE_DECL and is the real
- template to be instantiated. */
- if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
- arg = TYPE_NAME (arg);
-
- r = lookup_template_class (DECL_NAME (arg),
- argvec, in_decl,
- DECL_CONTEXT (arg));
- return cp_build_type_variant (r, TYPE_READONLY (t),
- TYPE_VOLATILE (t));
- }
- else
- /* We are processing a template argument list. */
- return arg;
- }
- else
- return arg;
- }
- }
-
- if (level == 1)
- /* This can happen during the attempted tsubst'ing in
- unify. This means that we don't yet have any information
- about the template parameter in question. */
- return t;
-
- /* If we get here, we must have been looking at a parm for a
- more deeply nested template. Make a new version of this
- template parameter, but with a lower level. */
- switch (TREE_CODE (t))
- {
- case TEMPLATE_TYPE_PARM:
- case TEMPLATE_TEMPLATE_PARM:
- r = copy_node (t);
- TEMPLATE_TYPE_PARM_INDEX (r)
- = reduce_template_parm_level (TEMPLATE_TYPE_PARM_INDEX (t),
- r, levels);
- TYPE_STUB_DECL (r) = TYPE_NAME (r) = TEMPLATE_TYPE_DECL (r);
- TYPE_MAIN_VARIANT (r) = r;
- TYPE_POINTER_TO (r) = NULL_TREE;
- TYPE_REFERENCE_TO (r) = NULL_TREE;
+ default:
+ return tsubst (t, args, in_decl);
+ }
+}
- if (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM
- && CLASSTYPE_TEMPLATE_INFO (t))
- {
- tree argvec = tsubst (CLASSTYPE_TI_ARGS (t), args, in_decl);
- CLASSTYPE_TEMPLATE_INFO (r)
- = perm_tree_cons (TYPE_NAME (t), argvec, NULL_TREE);
- }
- break;
+/* Substitute the ARGS into the T, which is a _DECL. TYPE is the
+ (already computed) substitution of ARGS into TREE_TYPE (T), if
+ appropriate. Return the result of the substitution. IN_DECL is as
+ for tsubst. */
- case TEMPLATE_PARM_INDEX:
- r = reduce_template_parm_level (t, TREE_TYPE (t), levels);
- break;
-
- default:
- my_friendly_abort (0);
- }
+tree
+tsubst_decl (t, args, type, in_decl)
+ tree t;
+ tree args;
+ tree type;
+ tree in_decl;
+{
+ int saved_lineno;
+ char* saved_filename;
+ tree r = NULL_TREE;
- return r;
- }
+ /* Set the filename and linenumber to improve error-reporting. */
+ saved_lineno = lineno;
+ saved_filename = input_filename;
+ lineno = DECL_SOURCE_LINE (t);
+ input_filename = DECL_SOURCE_FILE (t);
+ switch (TREE_CODE (t))
+ {
case TEMPLATE_DECL:
{
/* We can get here when processing a member template function
of a template class. */
- tree tmpl;
tree decl = DECL_TEMPLATE_RESULT (t);
- tree parms;
- tree* new_parms;
tree spec;
int is_template_template_parm = DECL_TEMPLATE_TEMPLATE_PARM_P (t);
if (!is_template_template_parm)
{
- /* We might already have an instance of this template. */
- spec = retrieve_specialization (t, args);
+ /* We might already have an instance of this template.
+ The ARGS are for the surrounding class type, so the
+ full args contain the tsubst'd args for the context,
+ plus the innermost args from the template decl. */
+ tree tmpl_args = DECL_CLASS_TEMPLATE_P (t)
+ ? CLASSTYPE_TI_ARGS (TREE_TYPE (t))
+ : DECL_TI_ARGS (DECL_RESULT (t));
+ tree full_args = tsubst (tmpl_args, args, in_decl);
+
+ /* tsubst_template_arg_vector doesn't copy the vector if
+ nothing changed. But, *something* should have
+ changed. */
+ my_friendly_assert (full_args != tmpl_args, 0);
+
+ spec = retrieve_specialization (t, full_args);
if (spec != NULL_TREE)
- return spec;
+ {
+ r = spec;
+ break;
+ }
}
/* Make a new template decl. It will be similar to the
@@ -4086,91 +4898,61 @@ tsubst (t, args, in_decl)
We also create a new function declaration, which is just
like the old one, but points to this new template, rather
than the old one. */
- tmpl = copy_node (t);
- copy_lang_decl (tmpl);
- my_friendly_assert (DECL_LANG_SPECIFIC (tmpl) != 0, 0);
- DECL_CHAIN (tmpl) = NULL_TREE;
- TREE_CHAIN (tmpl) = NULL_TREE;
+ r = copy_node (t);
+ copy_lang_decl (r);
+ my_friendly_assert (DECL_LANG_SPECIFIC (r) != 0, 0);
+ TREE_CHAIN (r) = NULL_TREE;
if (is_template_template_parm)
{
tree new_decl = tsubst (decl, args, in_decl);
- DECL_RESULT (tmpl) = new_decl;
- TREE_TYPE (tmpl) = TREE_TYPE (new_decl);
- return tmpl;
+ DECL_RESULT (r) = new_decl;
+ TREE_TYPE (r) = TREE_TYPE (new_decl);
+ break;
}
- DECL_CONTEXT (tmpl) = tsubst (DECL_CONTEXT (t),
- args, in_decl);
- DECL_CLASS_CONTEXT (tmpl) = tsubst (DECL_CLASS_CONTEXT (t),
- args, in_decl);
- DECL_TEMPLATE_INFO (tmpl) = build_tree_list (t, args);
+ DECL_CONTEXT (r)
+ = tsubst_aggr_type (DECL_CONTEXT (t), args, in_decl,
+ /*entering_scope=*/1);
+ DECL_CLASS_CONTEXT (r)
+ = tsubst_aggr_type (DECL_CLASS_CONTEXT (t), args, in_decl,
+ /*entering_scope=*/1);
+ DECL_TEMPLATE_INFO (r) = build_tree_list (t, args);
if (TREE_CODE (decl) == TYPE_DECL)
{
tree new_type = tsubst (TREE_TYPE (t), args, in_decl);
- TREE_TYPE (tmpl) = new_type;
- CLASSTYPE_TI_TEMPLATE (new_type) = tmpl;
- DECL_RESULT (tmpl) = TYPE_MAIN_DECL (new_type);
+ TREE_TYPE (r) = new_type;
+ CLASSTYPE_TI_TEMPLATE (new_type) = r;
+ DECL_RESULT (r) = TYPE_MAIN_DECL (new_type);
+ DECL_TI_ARGS (r) = CLASSTYPE_TI_ARGS (new_type);
}
else
{
tree new_decl = tsubst (decl, args, in_decl);
- DECL_RESULT (tmpl) = new_decl;
- DECL_TI_TEMPLATE (new_decl) = tmpl;
- TREE_TYPE (tmpl) = TREE_TYPE (new_decl);
+ DECL_RESULT (r) = new_decl;
+ DECL_TI_TEMPLATE (new_decl) = r;
+ TREE_TYPE (r) = TREE_TYPE (new_decl);
+ DECL_TI_ARGS (r) = DECL_TI_ARGS (new_decl);
}
- DECL_TEMPLATE_INSTANTIATIONS (tmpl) = NULL_TREE;
- SET_DECL_IMPLICIT_INSTANTIATION (tmpl);
+ SET_DECL_IMPLICIT_INSTANTIATION (r);
+ DECL_TEMPLATE_INSTANTIATIONS (r) = NULL_TREE;
+ DECL_TEMPLATE_SPECIALIZATIONS (r) = NULL_TREE;
/* The template parameters for this new template are all the
template parameters for the old template, except the
outermost level of parameters. */
- for (new_parms = &DECL_TEMPLATE_PARMS (tmpl),
- parms = DECL_TEMPLATE_PARMS (t);
- TREE_CHAIN (parms) != NULL_TREE;
- new_parms = &(TREE_CHAIN (*new_parms)),
- parms = TREE_CHAIN (parms))
- {
- tree new_vec =
- make_tree_vec (TREE_VEC_LENGTH (TREE_VALUE (parms)));
- int i;
-
- for (i = 0; i < TREE_VEC_LENGTH (new_vec); ++i)
- {
- tree default_value =
- TREE_PURPOSE (TREE_VEC_ELT (TREE_VALUE (parms), i));
- tree parm_decl =
- TREE_VALUE (TREE_VEC_ELT (TREE_VALUE (parms), i));
-
- TREE_VEC_ELT (new_vec, i)
- = build_tree_list (tsubst (default_value, args, in_decl),
- tsubst (parm_decl, args, in_decl));
-
- }
-
- *new_parms =
- tree_cons (build_int_2 (0,
- TREE_INT_CST_HIGH
- (TREE_PURPOSE (parms)) - 1),
- new_vec,
- NULL_TREE);
- }
+ DECL_TEMPLATE_PARMS (r)
+ = tsubst_template_parms (DECL_TEMPLATE_PARMS (t), args);
if (PRIMARY_TEMPLATE_P (t))
- TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (tmpl)) = tmpl;
+ DECL_PRIMARY_TEMPLATE (r) = r;
/* We don't partially instantiate partial specializations. */
if (TREE_CODE (decl) == TYPE_DECL)
- return tmpl;
+ break;
- /* What should we do with the specializations of this member
- template? Are they specializations of this new template,
- or instantiations of the templates they previously were?
- this new template? And where should their
- DECL_TI_TEMPLATES point? */
- DECL_TEMPLATE_SPECIALIZATIONS (tmpl) = NULL_TREE;
for (spec = DECL_TEMPLATE_SPECIALIZATIONS (t);
spec != NULL_TREE;
spec = TREE_CHAIN (spec))
@@ -4211,64 +4993,133 @@ tsubst (t, args, in_decl)
no concern to us. */
continue;
- spec_args = tsubst (DECL_TI_ARGS (fn), args,
- in_decl);
- new_fn = tsubst (DECL_RESULT (fn), args,
- in_decl);
- DECL_TEMPLATE_SPECIALIZATIONS (tmpl) =
- perm_tree_cons (spec_args, new_fn,
- DECL_TEMPLATE_SPECIALIZATIONS (tmpl));
+ if (TREE_CODE (fn) != TEMPLATE_DECL)
+ /* A full specialization. There's no need to record
+ that here. */
+ continue;
+
+ spec_args = tsubst (DECL_TI_ARGS (fn), args, in_decl);
+ new_fn = tsubst (DECL_RESULT (most_general_template (fn)),
+ spec_args, in_decl);
+ DECL_TI_TEMPLATE (new_fn) = fn;
+ register_specialization (new_fn, r,
+ innermost_args (spec_args));
}
/* Record this partial instantiation. */
- register_specialization (tmpl, t, args);
+ register_specialization (r, t,
+ DECL_TI_ARGS (DECL_RESULT (r)));
- return tmpl;
}
+ break;
case FUNCTION_DECL:
{
- tree r = NULL_TREE;
tree ctx;
- tree argvec;
- tree tmpl = NULL_TREE;
+ tree argvec = NULL_TREE;
+ tree gen_tmpl;
int member;
+ int args_depth;
+ int parms_depth;
- if (DECL_CONTEXT (t) != NULL_TREE
- && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (t))) == 't')
+ /* Nobody should be tsubst'ing into non-template functions. */
+ my_friendly_assert (DECL_TEMPLATE_INFO (t) != NULL_TREE, 0);
+
+ if (TREE_CODE (DECL_TI_TEMPLATE (t)) == TEMPLATE_DECL)
+ {
+ tree spec;
+
+ /* Calculate the most general template of which R is a
+ specialization, and the complete set of arguments used to
+ specialize R. */
+ gen_tmpl = most_general_template (DECL_TI_TEMPLATE (t));
+ argvec = tsubst (DECL_TI_ARGS (DECL_TEMPLATE_RESULT (gen_tmpl)),
+ args, in_decl);
+
+ /* Check to see if we already have this specialization. */
+ spec = retrieve_specialization (gen_tmpl, argvec);
+ if (spec)
+ {
+ r = spec;
+ break;
+ }
+
+ /* Here, we deal with the peculiar case:
+
+ template <class T> struct S {
+ template <class U> friend void f();
+ };
+ template <class U> friend void f() {}
+ template S<int>;
+ template void f<double>();
+
+ Here, the ARGS for the instantiation of will be {int,
+ double}. But, we only need as many ARGS as there are
+ levels of template parameters in CODE_PATTERN. We are
+ careful not to get fooled into reducing the ARGS in
+ situations like:
+
+ template <class T> struct S { template <class U> void f(U); }
+ template <class T> template <> void S<T>::f(int) {}
+
+ which we can spot because the pattern will be a
+ specialization in this case. */
+ args_depth = TMPL_ARGS_DEPTH (args);
+ parms_depth =
+ TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (t)));
+ if (args_depth > parms_depth
+ && !DECL_TEMPLATE_SPECIALIZATION (t))
+ {
+ my_friendly_assert (DECL_FRIEND_P (t), 0);
+
+ if (parms_depth > 1)
+ {
+ int i;
+
+ args = make_temp_vec (parms_depth);
+ for (i = 0; i < parms_depth; ++i)
+ TREE_VEC_ELT (args, i) =
+ TREE_VEC_ELT (args, i + (args_depth - parms_depth));
+ }
+ else
+ args = TREE_VEC_ELT (args, args_depth - parms_depth);
+ }
+ }
+ else
+ {
+ /* This special case arises when we have something like this:
+
+ template <class T> struct S {
+ friend void f<int>(int, double);
+ };
+
+ Here, the DECL_TI_TEMPLATE for the friend declaration
+ will be a LOOKUP_EXPR or an IDENTIFIER_NODE. We are
+ being called from tsubst_friend_function, and we want
+ only to create a new decl (R) with appropriate types so
+ that we can call determine_specialization. */
+ my_friendly_assert ((TREE_CODE (DECL_TI_TEMPLATE (t))
+ == LOOKUP_EXPR)
+ || (TREE_CODE (DECL_TI_TEMPLATE (t))
+ == IDENTIFIER_NODE), 0);
+ gen_tmpl = NULL_TREE;
+ }
+
+ if (DECL_CLASS_SCOPE_P (t))
{
if (DECL_NAME (t) == constructor_name (DECL_CONTEXT (t)))
member = 2;
else
member = 1;
- ctx = tsubst (DECL_CLASS_CONTEXT (t), args, t);
- type = tsubst (type, args, in_decl);
+ ctx = tsubst_aggr_type (DECL_CLASS_CONTEXT (t), args, t,
+ /*entering_scope=*/1);
}
else
{
member = 0;
ctx = NULL_TREE;
- type = tsubst (type, args, in_decl);
- }
-
- /* If we are instantiating a specialization, get the other args. */
- if (DECL_TEMPLATE_INFO (t) != NULL_TREE)
- {
- tree spec;
-
- tmpl = DECL_TI_TEMPLATE (t);
-
- /* Start by getting the innermost args. */
- argvec = tsubst (DECL_TI_ARGS (t), args, in_decl);
-
- if (DECL_TEMPLATE_INFO (tmpl))
- argvec = complete_template_args (tmpl, argvec, 0);
-
- /* Do we already have this instantiation? */
- spec = retrieve_specialization (tmpl, argvec);
- if (spec)
- return spec;
}
+ type = tsubst (type, args, in_decl);
/* We do NOT check for matching decls pushed separately at this
point, as they may not represent instantiations of this
@@ -4281,7 +5132,7 @@ tsubst (t, args, in_decl)
TREE_TYPE (r) = type;
DECL_CONTEXT (r)
- = tsubst (DECL_CONTEXT (t), args, t);
+ = tsubst_aggr_type (DECL_CONTEXT (t), args, t, /*entering_scope=*/1);
DECL_CLASS_CONTEXT (r) = ctx;
if (member && !strncmp (OPERATOR_TYPENAME_FORMAT,
@@ -4293,109 +5144,6 @@ tsubst (t, args, in_decl)
DECL_NAME (r) = build_typename_overload (TREE_TYPE (type));
}
- if (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (t)))
- {
- char *buf, *dbuf = build_overload_name (ctx, 1, 1);
- int len = sizeof (DESTRUCTOR_DECL_PREFIX) - 1;
- buf = (char *) alloca (strlen (dbuf)
- + sizeof (DESTRUCTOR_DECL_PREFIX));
- bcopy (DESTRUCTOR_DECL_PREFIX, buf, len);
- buf[len] = '\0';
- strcat (buf, dbuf);
- DECL_ASSEMBLER_NAME (r) = get_identifier (buf);
- }
- else
- {
- /* Instantiations of template functions must be mangled
- specially, in order to conform to 14.5.5.1
- [temp.over.link]. We use in_decl below rather than
- DECL_TI_TEMPLATE (r) because the latter is set to
- NULL_TREE in instantiate_decl. */
- tree tmpl;
- tree arg_types;
-
- if (DECL_TEMPLATE_INFO (r))
- tmpl = DECL_TI_TEMPLATE (r);
- else
- tmpl = in_decl;
-
- /* tmpl will be NULL if this is a specialization of a
- member function of a template class. */
- if (name_mangling_version < 1
- || tmpl == NULL_TREE
- || (member && !is_member_template (tmpl)
- && !DECL_TEMPLATE_INFO (tmpl)))
- {
- arg_types = TYPE_ARG_TYPES (type);
- if (member && TREE_CODE (type) == FUNCTION_TYPE)
- arg_types = hash_tree_chain
- (build_pointer_type (DECL_CONTEXT (r)),
- arg_types);
-
- DECL_ASSEMBLER_NAME (r)
- = build_decl_overload (DECL_NAME (r), arg_types,
- member);
- }
- else
- {
- tree tparms;
- tree targs;
-
- if (!DECL_TEMPLATE_SPECIALIZATION (tmpl))
- {
- /* We pass the outermost template parameters to
- build_template_decl_overload, since the innermost
- template parameters are still just template
- parameters; there are no corresponding subsitution
- arguments. Levels of parms that have been bound
- before are not represented in DECL_TEMPLATE_PARMS. */
- tparms = DECL_TEMPLATE_PARMS (tmpl);
- while (tparms && TREE_CHAIN (tparms) != NULL_TREE)
- tparms = TREE_CHAIN (tparms);
-
- targs = innermost_args (args, 0);
- }
- else
- {
- /* If the template is a specialization, then it is
- a member template specialization. We have
- something like:
-
- template <class T> struct S {
- template <int i> void f();
- template <> void f<7>();
- };
-
- and now we are forming S<double>::f<7>.
- Therefore, the template parameters of interest
- are those that are specialized by the template
- (i.e., the int), not those we are using to
- instantiate the template, i.e. the double. */
- tparms = DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (tmpl));
- targs = DECL_TI_ARGS (tmpl);
- }
-
- my_friendly_assert (tparms != NULL_TREE
- && TREE_CODE (tparms) == TREE_LIST,
- 0);
- tparms = TREE_VALUE (tparms);
-
- arg_types = TYPE_ARG_TYPES (TREE_TYPE (tmpl));
- if (member && TREE_CODE (type) == FUNCTION_TYPE)
- arg_types = hash_tree_chain
- (build_pointer_type (DECL_CONTEXT (r)),
- arg_types);
-
- DECL_ASSEMBLER_NAME (r)
- = build_template_decl_overload
- (DECL_NAME (r), arg_types,
- TREE_TYPE (TREE_TYPE (tmpl)),
- tparms, targs, member);
- }
- }
- DECL_RTL (r) = 0;
- make_decl_rtl (r, NULL_PTR, 1);
-
DECL_ARGUMENTS (r) = tsubst (DECL_ARGUMENTS (t), args, t);
DECL_MAIN_VARIANT (r) = r;
DECL_RESULT (r) = NULL_TREE;
@@ -4407,43 +5155,65 @@ tsubst (t, args, in_decl)
DECL_INTERFACE_KNOWN (r) = 0;
DECL_DEFER_OUTPUT (r) = 0;
TREE_CHAIN (r) = NULL_TREE;
- DECL_CHAIN (r) = NULL_TREE;
DECL_PENDING_INLINE_INFO (r) = 0;
TREE_USED (r) = 0;
+ if (DECL_CONSTRUCTOR_P (r))
+ {
+ maybe_retrofit_in_chrg (r);
+ grok_ctor_properties (ctx, r);
+ }
if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));
- if (DECL_TEMPLATE_INFO (t) != NULL_TREE)
+ /* Set up the DECL_TEMPLATE_INFO for R and compute its mangled
+ name. There's no need to do this in the special friend
+ case mentioned above where GEN_TMPL is NULL. */
+ if (gen_tmpl)
{
- DECL_TEMPLATE_INFO (r) = perm_tree_cons (tmpl, argvec, NULL_TREE);
-
- /* If we're not using ANSI overloading, then we might have
- called duplicate_decls above, and gotten back an
- preexisting version of this function. We treat such a
- function as a specialization. Otherwise, we cleared
- both TREE_STATIC and DECL_TEMPLATE_SPECIALIZATION, so
- this condition will be false. */
- if (TREE_STATIC (r) || DECL_TEMPLATE_SPECIALIZATION (r))
- SET_DECL_TEMPLATE_SPECIALIZATION (r);
- else
- SET_DECL_IMPLICIT_INSTANTIATION (r);
+ DECL_TEMPLATE_INFO (r)
+ = perm_tree_cons (gen_tmpl, argvec, NULL_TREE);
+ SET_DECL_IMPLICIT_INSTANTIATION (r);
+ register_specialization (r, gen_tmpl, argvec);
- register_specialization (r, tmpl, argvec);
+ /* Set the mangled name for R. */
+ if (DECL_DESTRUCTOR_P (t))
+ DECL_ASSEMBLER_NAME (r) = build_destructor_name (ctx);
+ else
+ {
+ /* Instantiations of template functions must be mangled
+ specially, in order to conform to 14.5.5.1
+ [temp.over.link]. */
+ tree tmpl = DECL_TI_TEMPLATE (t);
+
+ /* TMPL will be NULL if this is a specialization of a
+ member function of a template class. */
+ if (name_mangling_version < 1
+ || tmpl == NULL_TREE
+ || (member && !is_member_template (tmpl)
+ && !DECL_TEMPLATE_INFO (tmpl)))
+ set_mangled_name_for_decl (r);
+ else
+ set_mangled_name_for_template_decl (r);
+ }
+
+ DECL_RTL (r) = 0;
+ make_decl_rtl (r, NULL_PTR, 1);
+
+ /* Like grokfndecl. If we don't do this, pushdecl will
+ mess up our TREE_CHAIN because it doesn't find a
+ previous decl. Sigh. */
+ if (member
+ && (IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r))
+ == NULL_TREE))
+ SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r), r);
}
-
- /* Like grokfndecl. If we don't do this, pushdecl will mess up our
- TREE_CHAIN because it doesn't find a previous decl. Sigh. */
- if (member
- && IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r)) == NULL_TREE)
- IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r)) = r;
-
- return r;
}
+ break;
case PARM_DECL:
{
- tree r = copy_node (t);
+ r = copy_node (t);
TREE_TYPE (r) = type;
if (TREE_CODE (DECL_INITIAL (r)) != TEMPLATE_PARM_INDEX)
DECL_INITIAL (r) = TREE_TYPE (r);
@@ -4459,12 +5229,12 @@ tsubst (t, args, in_decl)
#endif
if (TREE_CHAIN (t))
TREE_CHAIN (r) = tsubst (TREE_CHAIN (t), args, TREE_CHAIN (t));
- return r;
}
+ break;
case FIELD_DECL:
{
- tree r = copy_node (t);
+ r = copy_node (t);
TREE_TYPE (r) = type;
copy_lang_decl (r);
#if 0
@@ -4472,32 +5242,43 @@ tsubst (t, args, in_decl)
#endif
DECL_INITIAL (r) = tsubst_expr (DECL_INITIAL (t), args, in_decl);
TREE_CHAIN (r) = NULL_TREE;
- return r;
+ if (TREE_CODE (type) == VOID_TYPE)
+ cp_error_at ("instantiation of `%D' as type void", r);
}
+ break;
case USING_DECL:
{
- tree r = copy_node (t);
+ r = copy_node (t);
DECL_INITIAL (r)
= tsubst_copy (DECL_INITIAL (t), args, in_decl);
TREE_CHAIN (r) = NULL_TREE;
- return r;
}
+ break;
case VAR_DECL:
{
- tree r;
- tree ctx = tsubst_copy (DECL_CONTEXT (t), args, in_decl);
+ tree argvec;
+ tree gen_tmpl;
+ tree spec;
+ tree tmpl;
+ tree ctx = tsubst_aggr_type (DECL_CONTEXT (t), args, in_decl,
+ /*entering_scope=*/1);
+
+ /* Nobody should be tsubst'ing into non-template variables. */
+ my_friendly_assert (DECL_LANG_SPECIFIC (t)
+ && DECL_TEMPLATE_INFO (t) != NULL_TREE, 0);
- /* Do we already have this instantiation? */
- if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t))
+ /* Check to see if we already have this specialization. */
+ tmpl = DECL_TI_TEMPLATE (t);
+ gen_tmpl = most_general_template (tmpl);
+ argvec = tsubst (DECL_TI_ARGS (t), args, in_decl);
+ spec = retrieve_specialization (gen_tmpl, argvec);
+
+ if (spec)
{
- tree tmpl = DECL_TI_TEMPLATE (t);
- tree decls = DECL_TEMPLATE_INSTANTIATIONS (tmpl);
-
- for (; decls; decls = TREE_CHAIN (decls))
- if (DECL_CONTEXT (TREE_VALUE (decls)) == ctx)
- return TREE_VALUE (decls);
+ r = spec;
+ break;
}
r = copy_node (t);
@@ -4510,41 +5291,271 @@ tsubst (t, args, in_decl)
/* Don't try to expand the initializer until someone tries to use
this variable; otherwise we run into circular dependencies. */
DECL_INITIAL (r) = NULL_TREE;
-
DECL_RTL (r) = 0;
DECL_SIZE (r) = 0;
+ copy_lang_decl (r);
+ DECL_CLASS_CONTEXT (r) = DECL_CONTEXT (r);
- if (DECL_LANG_SPECIFIC (r))
- {
- copy_lang_decl (r);
- DECL_CLASS_CONTEXT (r) = DECL_CONTEXT (r);
- }
-
- if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t))
- {
- tree tmpl = DECL_TI_TEMPLATE (t);
- tree *declsp = &DECL_TEMPLATE_INSTANTIATIONS (tmpl);
- tree argvec = tsubst (DECL_TI_ARGS (t), args, in_decl);
+ DECL_TEMPLATE_INFO (r) = perm_tree_cons (tmpl, argvec, NULL_TREE);
+ SET_DECL_IMPLICIT_INSTANTIATION (r);
+ register_specialization (r, gen_tmpl, argvec);
- DECL_TEMPLATE_INFO (r) = perm_tree_cons (tmpl, argvec, NULL_TREE);
- *declsp = perm_tree_cons (argvec, r, *declsp);
- SET_DECL_IMPLICIT_INSTANTIATION (r);
- }
TREE_CHAIN (r) = NULL_TREE;
- return r;
+ if (TREE_CODE (type) == VOID_TYPE)
+ cp_error_at ("instantiation of `%D' as type void", r);
}
+ break;
case TYPE_DECL:
if (t == TYPE_NAME (TREE_TYPE (t)))
- return TYPE_NAME (type);
+ r = TYPE_NAME (type);
+ else
+ {
+ r = copy_node (t);
+ TREE_TYPE (r) = type;
+ DECL_CONTEXT (r) = current_class_type;
+ TREE_CHAIN (r) = NULL_TREE;
+ }
+ break;
+
+ default:
+ my_friendly_abort (0);
+ }
+
+ /* Restore the file and line information. */
+ lineno = saved_lineno;
+ input_filename = saved_filename;
+
+ return r;
+}
+
+/* Substitue into the ARG_TYPES of a function type. */
+
+tree
+tsubst_arg_types (arg_types, args, in_decl)
+ tree arg_types;
+ tree args;
+ tree in_decl;
+{
+ tree remaining_arg_types;
+ tree type;
+
+ if (!arg_types || arg_types == void_list_node)
+ return arg_types;
+
+ remaining_arg_types = tsubst_arg_types (TREE_CHAIN (arg_types),
+ args, in_decl);
+
+ /* We use TYPE_MAIN_VARIANT is because top-level qualifiers don't
+ matter on function types. */
+ type = TYPE_MAIN_VARIANT (type_decays_to
+ (tsubst (TREE_VALUE (arg_types),
+ args, in_decl)));
+
+ /* Note that we do not substitute into default arguments here. The
+ standard mandates that they be instantiated only when needed,
+ which is done in build_over_call. */
+ return hash_tree_cons_simple (TREE_PURPOSE (arg_types), type,
+ remaining_arg_types);
+
+}
+
+/* Take the tree structure T and replace template parameters used therein
+ with the argument vector ARGS. IN_DECL is an associated decl for
+ diagnostics.
+
+ tsubst is used for dealing with types, decls and the like; for
+ expressions, use tsubst_expr or tsubst_copy. */
+
+tree
+tsubst (t, args, in_decl)
+ tree t, args;
+ tree in_decl;
+{
+ tree type;
+
+ if (t == NULL_TREE || t == error_mark_node
+ || t == integer_type_node
+ || t == void_type_node
+ || t == char_type_node
+ || TREE_CODE (t) == NAMESPACE_DECL)
+ return t;
+
+ if (TREE_CODE (t) == IDENTIFIER_NODE)
+ type = IDENTIFIER_TYPE_VALUE (t);
+ else
+ type = TREE_TYPE (t);
+ if (type == unknown_type_node)
+ my_friendly_abort (42);
+
+ if (type && TREE_CODE (t) != FUNCTION_DECL
+ && TREE_CODE (t) != TYPENAME_TYPE
+ && TREE_CODE (t) != TEMPLATE_DECL
+ && TREE_CODE (t) != IDENTIFIER_NODE)
+ type = tsubst (type, args, in_decl);
+
+ if (TREE_CODE_CLASS (TREE_CODE (t)) == 'd')
+ return tsubst_decl (t, args, type, in_decl);
+
+ switch (TREE_CODE (t))
+ {
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case ENUMERAL_TYPE:
+ return tsubst_aggr_type (t, args, in_decl, /*entering_scope=*/0);
+
+ case ERROR_MARK:
+ case IDENTIFIER_NODE:
+ case OP_IDENTIFIER:
+ case VOID_TYPE:
+ case REAL_TYPE:
+ case COMPLEX_TYPE:
+ case BOOLEAN_TYPE:
+ case INTEGER_CST:
+ case REAL_CST:
+ case STRING_CST:
+ return t;
+
+ case INTEGER_TYPE:
+ if (t == integer_type_node)
+ return t;
+
+ if (TREE_CODE (TYPE_MIN_VALUE (t)) == INTEGER_CST
+ && TREE_CODE (TYPE_MAX_VALUE (t)) == INTEGER_CST)
+ return t;
{
- tree r = copy_node (t);
- TREE_TYPE (r) = type;
- DECL_CONTEXT (r) = current_class_type;
- TREE_CHAIN (r) = NULL_TREE;
+ tree max = TREE_OPERAND (TYPE_MAX_VALUE (t), 0);
+ max = tsubst_expr (max, args, in_decl);
+ if (processing_template_decl)
+ {
+ tree itype = make_node (INTEGER_TYPE);
+ TYPE_MIN_VALUE (itype) = size_zero_node;
+ TYPE_MAX_VALUE (itype) = build_min (MINUS_EXPR, sizetype, max,
+ integer_one_node);
+ return itype;
+ }
+
+ max = fold (build_binary_op (MINUS_EXPR, max, integer_one_node, 1));
+ return build_index_2_type (size_zero_node, max);
+ }
+
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_TEMPLATE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ {
+ int idx;
+ int level;
+ int levels;
+ tree r = NULL_TREE;
+
+ if (TREE_CODE (t) == TEMPLATE_TYPE_PARM
+ || TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM)
+ {
+ idx = TEMPLATE_TYPE_IDX (t);
+ level = TEMPLATE_TYPE_LEVEL (t);
+ }
+ else
+ {
+ idx = TEMPLATE_PARM_IDX (t);
+ level = TEMPLATE_PARM_LEVEL (t);
+ }
+
+ if (TREE_VEC_LENGTH (args) > 0)
+ {
+ tree arg = NULL_TREE;
+
+ levels = TMPL_ARGS_DEPTH (args);
+ if (level <= levels)
+ arg = TMPL_ARG (args, level, idx);
+
+ if (arg == error_mark_node)
+ return error_mark_node;
+ else if (arg != NULL_TREE)
+ {
+ if (TREE_CODE (t) == TEMPLATE_TYPE_PARM)
+ {
+ my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (arg))
+ == 't', 0);
+ return cp_build_type_variant
+ (arg, TYPE_READONLY (arg) || TYPE_READONLY (t),
+ TYPE_VOLATILE (arg) || TYPE_VOLATILE (t));
+ }
+ else if (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM)
+ {
+ if (CLASSTYPE_TEMPLATE_INFO (t))
+ {
+ /* We are processing a type constructed from
+ a template template parameter */
+ tree argvec = tsubst (CLASSTYPE_TI_ARGS (t),
+ args, in_decl);
+ tree r;
+
+ /* We can get a TEMPLATE_TEMPLATE_PARM here when
+ we are resolving nested-types in the signature of
+ a member function templates.
+ Otherwise ARG is a TEMPLATE_DECL and is the real
+ template to be instantiated. */
+ if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
+ arg = TYPE_NAME (arg);
+
+ r = lookup_template_class (DECL_NAME (arg),
+ argvec, in_decl,
+ DECL_CONTEXT (arg),
+ /*entering_scope=*/0);
+ return cp_build_type_variant (r, TYPE_READONLY (t),
+ TYPE_VOLATILE (t));
+ }
+ else
+ /* We are processing a template argument list. */
+ return arg;
+ }
+ else
+ return arg;
+ }
+ }
+
+ if (level == 1)
+ /* This can happen during the attempted tsubst'ing in
+ unify. This means that we don't yet have any information
+ about the template parameter in question. */
+ return t;
+
+ /* If we get here, we must have been looking at a parm for a
+ more deeply nested template. Make a new version of this
+ template parameter, but with a lower level. */
+ switch (TREE_CODE (t))
+ {
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_TEMPLATE_PARM:
+ r = copy_node (t);
+ TEMPLATE_TYPE_PARM_INDEX (r)
+ = reduce_template_parm_level (TEMPLATE_TYPE_PARM_INDEX (t),
+ r, levels);
+ TYPE_STUB_DECL (r) = TYPE_NAME (r) = TEMPLATE_TYPE_DECL (r);
+ TYPE_MAIN_VARIANT (r) = r;
+ TYPE_POINTER_TO (r) = NULL_TREE;
+ TYPE_REFERENCE_TO (r) = NULL_TREE;
+
+ if (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM
+ && CLASSTYPE_TEMPLATE_INFO (t))
+ {
+ tree argvec = tsubst (CLASSTYPE_TI_ARGS (t), args, in_decl);
+ CLASSTYPE_TEMPLATE_INFO (r)
+ = perm_tree_cons (TYPE_NAME (t), argvec, NULL_TREE);
+ }
+ break;
+
+ case TEMPLATE_PARM_INDEX:
+ r = reduce_template_parm_level (t, type, levels);
+ break;
+
+ default:
+ my_friendly_abort (0);
+ }
+
return r;
- }
+ }
case TREE_LIST:
{
@@ -4579,12 +5590,13 @@ tsubst (t, args, in_decl)
case TREE_VEC:
if (type != NULL_TREE)
{
- /* A binfo node. */
+ /* A binfo node. We always need to make a copy, of the node
+ itself and of its BINFO_BASETYPES. */
t = copy_node (t);
- if (type == TREE_TYPE (t))
- return t;
+ /* Make sure type isn't a typedef copy. */
+ type = BINFO_TYPE (TYPE_BINFO (type));
TREE_TYPE (t) = complete_type (type);
if (IS_AGGR_TYPE (type))
@@ -4598,30 +5610,8 @@ tsubst (t, args, in_decl)
}
/* Otherwise, a vector of template arguments. */
- {
- int len = TREE_VEC_LENGTH (t), need_new = 0, i;
- tree *elts = (tree *) alloca (len * sizeof (tree));
+ return tsubst_template_arg_vector (t, args);
- bzero ((char *) elts, len * sizeof (tree));
-
- for (i = 0; i < len; i++)
- {
- elts[i] = maybe_fold_nontype_arg
- (tsubst_expr (TREE_VEC_ELT (t, i), args, in_decl));
-
- if (elts[i] != TREE_VEC_ELT (t, i))
- need_new = 1;
- }
-
- if (!need_new)
- return t;
-
- t = make_tree_vec (len);
- for (i = 0; i < len; i++)
- TREE_VEC_ELT (t, i) = elts[i];
-
- return t;
- }
case POINTER_TYPE:
case REFERENCE_TYPE:
{
@@ -4674,83 +5664,31 @@ tsubst (t, args, in_decl)
case FUNCTION_TYPE:
case METHOD_TYPE:
{
- tree values = TYPE_ARG_TYPES (t);
- tree context = TYPE_CONTEXT (t);
- tree raises = TYPE_RAISES_EXCEPTIONS (t);
+ tree arg_types;
+ tree raises;
tree fntype;
- /* Don't bother recursing if we know it won't change anything. */
- if (values != void_list_node)
- {
- /* This should probably be rewritten to use hash_tree_cons for
- the memory savings. */
- tree first = NULL_TREE;
- tree last = NULL_TREE;
-
- for (; values && values != void_list_node;
- values = TREE_CHAIN (values))
- {
- tree value = TYPE_MAIN_VARIANT (type_decays_to
- (tsubst (TREE_VALUE (values), args, in_decl)));
- /* Don't instantiate default args unless they are used.
- Handle it in build_over_call instead. */
- tree purpose = TREE_PURPOSE (values);
- tree x = build_tree_list (purpose, value);
-
- if (first)
- TREE_CHAIN (last) = x;
- else
- first = x;
- last = x;
- }
-
- if (values == void_list_node)
- TREE_CHAIN (last) = void_list_node;
-
- values = first;
- }
- if (context)
- context = tsubst (context, args, in_decl);
- /* Could also optimize cases where return value and
- values have common elements (e.g., T min(const &T, const T&). */
-
- /* If the above parameters haven't changed, just return the type. */
- if (type == TREE_TYPE (t)
- && values == TYPE_VALUES (t)
- && context == TYPE_CONTEXT (t))
- return t;
+ /* The TYPE_CONTEXT is not used for function/method types. */
+ my_friendly_assert (TYPE_CONTEXT (t) == NULL_TREE, 0);
+
+ /* Substitue the argument types. */
+ arg_types = tsubst_arg_types (TYPE_ARG_TYPES (t), args, in_decl);
/* Construct a new type node and return it. */
- if (TREE_CODE (t) == FUNCTION_TYPE
- && context == NULL_TREE)
- {
- fntype = build_function_type (type, values);
- }
- else if (context == NULL_TREE)
- {
- tree base = tsubst (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t))),
- args, in_decl);
- fntype = build_cplus_method_type (base, type,
- TREE_CHAIN (values));
- }
- else
- {
- fntype = make_node (TREE_CODE (t));
- TREE_TYPE (fntype) = type;
- TYPE_CONTEXT (fntype) = context;
- TYPE_VALUES (fntype) = values;
- TYPE_SIZE (fntype) = TYPE_SIZE (t);
- TYPE_ALIGN (fntype) = TYPE_ALIGN (t);
- TYPE_MODE (fntype) = TYPE_MODE (t);
- if (TYPE_METHOD_BASETYPE (t))
- TYPE_METHOD_BASETYPE (fntype) = tsubst (TYPE_METHOD_BASETYPE (t),
- args, in_decl);
- /* Need to generate hash value. */
- my_friendly_abort (84);
- }
+ if (TREE_CODE (t) == FUNCTION_TYPE)
+ fntype = build_function_type (type, arg_types);
+ else
+ fntype
+ = build_cplus_method_type (TREE_TYPE (TREE_VALUE (arg_types)),
+ type,
+ TREE_CHAIN (arg_types));
+
fntype = build_type_variant (fntype,
TYPE_READONLY (t),
TYPE_VOLATILE (t));
+
+ /* Substitue the exception specification. */
+ raises = TYPE_RAISES_EXCEPTIONS (t);
if (raises)
{
raises = tsubst (raises, args, in_decl);
@@ -4781,8 +5719,22 @@ tsubst (t, args, in_decl)
case TYPENAME_TYPE:
{
- tree ctx = tsubst (TYPE_CONTEXT (t), args, in_decl);
+ tree ctx = tsubst_aggr_type (TYPE_CONTEXT (t), args, in_decl,
+ /*entering_scope=*/1);
tree f = tsubst_copy (TYPENAME_TYPE_FULLNAME (t), args, in_decl);
+
+ /* Normally, make_typename_type does not require that the CTX
+ have complete type in order to allow things like:
+
+ template <class T> struct S { typename S<T>::X Y; };
+
+ But, such constructs have already been resolved by this
+ point, so here CTX really should have complete type, unless
+ it's a partial instantiation. */
+ if (!uses_template_parms (ctx)
+ && !complete_type_or_else (ctx))
+ return error_mark_node;
+
f = make_typename_type (ctx, f);
return cp_build_type_variant
(f, TYPE_READONLY (f) || TYPE_READONLY (t),
@@ -4869,17 +5821,51 @@ tsubst_copy (t, args, in_decl)
switch (code)
{
case PARM_DECL:
- return do_identifier (DECL_NAME (t), 0);
+ return do_identifier (DECL_NAME (t), 0, NULL_TREE);
case CONST_DECL:
+ {
+ tree enum_type;
+ tree v;
+
+ if (!DECL_CONTEXT (t))
+ /* This is a global enumeration constant. */
+ return t;
+
+ /* Unfortunately, we cannot just call lookup_name here.
+ Consider:
+
+ template <int I> int f() {
+ enum E { a = I };
+ struct S { void g() { E e = a; } };
+ };
+
+ When we instantiate f<7>::S::g(), say, lookup_name is not
+ clever enough to find f<7>::a. */
+ enum_type
+ = tsubst_aggr_type (TREE_TYPE (t), args, in_decl,
+ /*entering_scope=*/0);
+
+ for (v = TYPE_VALUES (enum_type);
+ v != NULL_TREE;
+ v = TREE_CHAIN (v))
+ if (TREE_PURPOSE (v) == DECL_NAME (t))
+ return TREE_VALUE (v);
+
+ /* We didn't find the name. That should never happen; if
+ name-lookup found it during preliminary parsing, we
+ should find it again here during instantiation. */
+ my_friendly_abort (0);
+ }
+ return t;
+
case FIELD_DECL:
if (DECL_CONTEXT (t))
{
tree ctx;
- if (TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
- return lookup_name (DECL_NAME (t), 0);
- ctx = tsubst (DECL_CONTEXT (t), args, in_decl);
+ ctx = tsubst_aggr_type (DECL_CONTEXT (t), args, in_decl,
+ /*entering_scope=*/1);
if (ctx != DECL_CONTEXT (t))
return lookup_field (ctx, DECL_NAME (t), 0, 0);
}
@@ -4898,11 +5884,25 @@ tsubst_copy (t, args, in_decl)
else
return t;
-#if 0
- case IDENTIFIER_NODE:
- return do_identifier (t, 0);
-#endif
-
+ case LOOKUP_EXPR:
+ {
+ /* We must tsbust into a LOOKUP_EXPR in case the names to
+ which it refers is a conversion operator; in that case the
+ name will change. We avoid making unnecessary copies,
+ however. */
+
+ tree id = tsubst_copy (TREE_OPERAND (t, 0), args, in_decl);
+
+ if (id != TREE_OPERAND (t, 0))
+ {
+ tree r = build_nt (LOOKUP_EXPR, id);
+ LOOKUP_EXPR_GLOBAL (r) = LOOKUP_EXPR_GLOBAL (t);
+ t = r;
+ }
+
+ return t;
+ }
+
case CAST_EXPR:
case REINTERPRET_CAST_EXPR:
case CONST_CAST_EXPR:
@@ -4990,8 +5990,6 @@ tsubst_copy (t, args, in_decl)
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
name = tsubst_copy (TREE_OPERAND (name, 0), args, in_decl);
- if (TREE_CODE (name) != IDENTIFIER_NODE)
- name = TYPE_MAIN_VARIANT (name);
name = build1 (BIT_NOT_EXPR, NULL_TREE, name);
}
else if (TREE_CODE (name) == SCOPE_REF
@@ -5000,8 +5998,6 @@ tsubst_copy (t, args, in_decl)
tree base = tsubst_copy (TREE_OPERAND (name, 0), args, in_decl);
name = TREE_OPERAND (name, 1);
name = tsubst_copy (TREE_OPERAND (name, 0), args, in_decl);
- if (TREE_CODE (name) != IDENTIFIER_NODE)
- name = TYPE_MAIN_VARIANT (name);
name = build1 (BIT_NOT_EXPR, NULL_TREE, name);
name = build_nt (SCOPE_REF, base, name);
}
@@ -5111,7 +6107,10 @@ tsubst_copy (t, args, in_decl)
return tsubst (t, args, in_decl);
case IDENTIFIER_NODE:
- if (IDENTIFIER_TYPENAME_P (t))
+ if (IDENTIFIER_TYPENAME_P (t)
+ /* Make sure it's not just a variable named `__opr', for instance,
+ which can occur in some existing code. */
+ && TREE_TYPE (t))
return build_typename_overload
(tsubst (TREE_TYPE (t), args, in_decl));
else
@@ -5349,7 +6348,7 @@ tsubst_expr (t, args, in_decl)
lineno = TREE_COMPLEXITY (t);
t = TREE_TYPE (t);
if (TREE_CODE (t) == ENUMERAL_TYPE)
- tsubst_enum (t, args, NULL);
+ tsubst (t, args, NULL_TREE);
break;
default:
@@ -5358,55 +6357,77 @@ tsubst_expr (t, args, in_decl)
return NULL_TREE;
}
+/* Instantiate the indicated variable of function template TMPL with
+ the template arguments in TARG_PTR. */
+
tree
instantiate_template (tmpl, targ_ptr)
tree tmpl, targ_ptr;
{
tree fndecl;
+ tree gen_tmpl;
+ tree spec;
int i, len;
struct obstack *old_fmp_obstack;
extern struct obstack *function_maybepermanent_obstack;
+ tree inner_args;
+
+ if (tmpl == error_mark_node)
+ return error_mark_node;
my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 283);
- /* FIXME this won't work with member templates; we only have one level
- of args here. */
- if (DECL_FUNCTION_TEMPLATE_P (tmpl))
+ /* Check to see if we already have this specialization. */
+ spec = retrieve_specialization (tmpl, targ_ptr);
+ if (spec != NULL_TREE)
+ return spec;
+
+ if (DECL_TEMPLATE_INFO (tmpl))
{
+ /* The TMPL is a partial instantiation. To get a full set of
+ arguments we must add the arguments used to perform the
+ partial instantiation. */
+ targ_ptr = add_outermost_template_args (DECL_TI_ARGS (tmpl),
+ targ_ptr);
+ gen_tmpl = most_general_template (tmpl);
+
/* Check to see if we already have this specialization. */
- tree spec = retrieve_specialization (tmpl, targ_ptr);
-
+ spec = retrieve_specialization (gen_tmpl, targ_ptr);
if (spec != NULL_TREE)
return spec;
}
+ else
+ gen_tmpl = tmpl;
push_obstacks (&permanent_obstack, &permanent_obstack);
old_fmp_obstack = function_maybepermanent_obstack;
function_maybepermanent_obstack = &permanent_obstack;
- len = DECL_NTPARMS (tmpl);
-
+ len = DECL_NTPARMS (gen_tmpl);
+ inner_args = innermost_args (targ_ptr);
i = len;
while (i--)
{
- tree t = TREE_VEC_ELT (targ_ptr, i);
+ tree t = TREE_VEC_ELT (inner_args, i);
if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
{
tree nt = target_type (t);
if (IS_AGGR_TYPE (nt) && decl_function_context (TYPE_MAIN_DECL (nt)))
{
cp_error ("type `%T' composed from a local class is not a valid template-argument", t);
- cp_error (" trying to instantiate `%D'", tmpl);
+ cp_error (" trying to instantiate `%D'", gen_tmpl);
fndecl = error_mark_node;
goto out;
}
}
- TREE_VEC_ELT (targ_ptr, i) = copy_to_permanent (t);
}
targ_ptr = copy_to_permanent (targ_ptr);
/* substitute template parameters */
- fndecl = tsubst (DECL_RESULT (tmpl), targ_ptr, tmpl);
+ fndecl = tsubst (DECL_RESULT (gen_tmpl), targ_ptr, gen_tmpl);
+ /* The DECL_TI_TEMPLATE should always be the immediate parent
+ template, not the most general template. */
+ DECL_TI_TEMPLATE (fndecl) = tmpl;
if (flag_external_templates)
add_pending_template (fndecl);
@@ -5436,52 +6457,56 @@ overload_template_name (type)
pushdecl_class_level (decl);
}
-
/* Like type_unification but designed specially to handle conversion
- operators. The EXTRA_FN_ARG, if any, is the type of an additional
- parameter to be added to the beginning of FN's parameter list. */
+ operators.
+
+ The FN is a TEMPLATE_DECL for a function. The ARGS are the
+ arguments that are being used when calling it.
+
+ If FN is a conversion operator, RETURN_TYPE is the type desired as
+ the result of the conversion operator.
+
+ The EXTRA_FN_ARG, if any, is the type of an additional
+ parameter to be added to the beginning of FN's parameter list.
+
+ The other arguments are as for type_unification. */
int
fn_type_unification (fn, explicit_targs, targs, args, return_type,
strict, extra_fn_arg)
tree fn, explicit_targs, targs, args, return_type;
- int strict;
+ unification_kind_t strict;
tree extra_fn_arg;
{
- int i;
- tree fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn));
- tree decl_arg_types = args;
+ tree parms;
my_friendly_assert (TREE_CODE (fn) == TEMPLATE_DECL, 0);
+ parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
+
if (IDENTIFIER_TYPENAME_P (DECL_NAME (fn)))
{
/* This is a template conversion operator. Use the return types
as well as the argument types. */
- fn_arg_types = scratch_tree_cons (NULL_TREE,
- TREE_TYPE (TREE_TYPE (fn)),
- fn_arg_types);
- decl_arg_types = scratch_tree_cons (NULL_TREE,
- return_type,
- decl_arg_types);
+ parms = scratch_tree_cons (NULL_TREE,
+ TREE_TYPE (TREE_TYPE (fn)),
+ parms);
+ args = scratch_tree_cons (NULL_TREE, return_type, args);
}
if (extra_fn_arg != NULL_TREE)
- fn_arg_types = scratch_tree_cons (NULL_TREE, extra_fn_arg,
- fn_arg_types);
+ parms = scratch_tree_cons (NULL_TREE, extra_fn_arg, parms);
/* We allow incomplete unification without an error message here
because the standard doesn't seem to explicitly prohibit it. Our
callers must be ready to deal with unification failures in any
event. */
- i = type_unification (DECL_INNERMOST_TEMPLATE_PARMS (fn),
- targs,
- fn_arg_types,
- decl_arg_types,
- explicit_targs,
- strict, 1);
-
- return i;
+ return type_unification (DECL_INNERMOST_TEMPLATE_PARMS (fn),
+ targs,
+ parms,
+ args,
+ explicit_targs,
+ strict, 1);
}
@@ -5496,44 +6521,59 @@ fn_type_unification (fn, explicit_targs, targs, args, return_type,
all the types, and 1 for complete failure. An error message will be
printed only for an incomplete match.
- TPARMS[NTPARMS] is an array of template parameter types;
- TARGS[NTPARMS] is the array of template parameter values. PARMS is
- the function template's signature (using TEMPLATE_PARM_IDX nodes),
- and ARGS is the argument list we're trying to match against it.
+ TPARMS[NTPARMS] is an array of template parameter types.
+
+ TARGS[NTPARMS] is the array into which the deduced template
+ parameter values are placed. PARMS is the function template's
+ signature (using TEMPLATE_PARM_IDX nodes), and ARGS is the argument
+ list we're trying to match against it.
+
+ The EXPLICIT_TARGS are explicit template arguments provided via a
+ template-id.
- If SUBR is 1, we're being called recursively (to unify the arguments of
- a function or method parameter of a function template), so don't zero
- out targs and don't fail on an incomplete match.
+ The parameter STRICT is one of:
- If STRICT is 1, the match must be exact (for casts of overloaded
- addresses, explicit instantiation, and more_specialized). */
+ DEDUCE_CALL:
+ We are deducing arguments for a function call, as in
+ [temp.deduct.call].
+
+ DEDUCE_CONV:
+ We are deducing arguments for a conversion function, as in
+ [temp.deduct.conv].
+
+ DEDUCE_EXACT:
+ We are deducing arguments when calculating the partial
+ ordering between specializations of function or class
+ templates, as in [temp.func.order] and [temp.class.order],
+ when doing an explicit instantiation as in [temp.explicit],
+ when determining an explicit specialization as in
+ [temp.expl.spec], or when taking the address of a function
+ template, as in [temp.deduct.funcaddr]. */
int
-type_unification (tparms, targs, parms, args, targs_in,
+type_unification (tparms, targs, parms, args, explicit_targs,
strict, allow_incomplete)
- tree tparms, targs, parms, args, targs_in;
- int strict, allow_incomplete;
+ tree tparms, targs, parms, args, explicit_targs;
+ unification_kind_t strict;
+ int allow_incomplete;
{
- int ntparms = TREE_VEC_LENGTH (tparms);
- tree arg;
int* explicit_mask;
int i;
- int r;
- for (i = 0; i < ntparms; i++)
+ for (i = 0; i < TREE_VEC_LENGTH (tparms); i++)
TREE_VEC_ELT (targs, i) = NULL_TREE;
- if (targs_in != NULL_TREE)
+ if (explicit_targs != NULL_TREE)
{
tree arg_vec;
- arg_vec = coerce_template_parms (tparms, targs_in, NULL_TREE, 0,
- 0, 0);
+ arg_vec = coerce_template_parms (tparms, explicit_targs, NULL_TREE, 0,
+ 0);
if (arg_vec == error_mark_node)
return 1;
explicit_mask = alloca (sizeof (int) * TREE_VEC_LENGTH (targs));
- bzero (explicit_mask, sizeof(int) * TREE_VEC_LENGTH (targs));
+ bzero ((char *) explicit_mask, sizeof(int) * TREE_VEC_LENGTH (targs));
for (i = 0;
i < TREE_VEC_LENGTH (arg_vec)
@@ -5548,26 +6588,107 @@ type_unification (tparms, targs, parms, args, targs_in,
else
explicit_mask = 0;
- r = type_unification_real (tparms, targs, parms, args, 0,
- strict, allow_incomplete, explicit_mask);
+ return
+ type_unification_real (tparms, targs, parms, args, 0,
+ strict, allow_incomplete, explicit_mask);
+}
- return r;
+/* Adjust types before performing type deduction, as described in
+ [temp.deduct.call] and [temp.deduct.conv]. The rules in these two
+ sections are symmetric. PARM is the type of a function parameter
+ or the return type of the conversion function. ARG is the type of
+ the argument passed to the call, or the type of the value
+ intialized with the result of the conversion function. */
+
+void
+maybe_adjust_types_for_deduction (strict, parm, arg)
+ unification_kind_t strict;
+ tree* parm;
+ tree* arg;
+{
+ switch (strict)
+ {
+ case DEDUCE_CALL:
+ break;
+
+ case DEDUCE_CONV:
+ {
+ /* Swap PARM and ARG throughout the remainder of this
+ function; the handling is precisely symmetric since PARM
+ will initialize ARG rather than vice versa. */
+ tree* temp = parm;
+ parm = arg;
+ arg = temp;
+ break;
+ }
+
+ case DEDUCE_EXACT:
+ /* There is nothing to do in this case. */
+ return;
+
+ default:
+ my_friendly_abort (0);
+ }
+
+ if (TREE_CODE (*parm) != REFERENCE_TYPE)
+ {
+ /* [temp.deduct.call]
+
+ If P is not a reference type:
+
+ --If A is an array type, the pointer type produced by the
+ array-to-pointer standard conversion (_conv.array_) is
+ used in place of A for type deduction; otherwise,
+
+ --If A is a function type, the pointer type produced by
+ the function-to-pointer standard conversion
+ (_conv.func_) is used in place of A for type deduction;
+ otherwise,
+
+ --If A is a cv-qualified type, the top level
+ cv-qualifiers of A's type are ignored for type
+ deduction. */
+ if (TREE_CODE (*arg) == ARRAY_TYPE)
+ *arg = build_pointer_type (TREE_TYPE (*arg));
+ else if (TREE_CODE (*arg) == FUNCTION_TYPE
+ || TREE_CODE (*arg) == METHOD_TYPE)
+ *arg = build_pointer_type (*arg);
+ else
+ *arg = TYPE_MAIN_VARIANT (*arg);
+ }
+
+ /* [temp.deduct.call]
+
+ If P is a cv-qualified type, the top level cv-qualifiers
+ of P's type are ignored for type deduction. If P is a
+ reference type, the type referred to by P is used for
+ type deduction. */
+ *parm = TYPE_MAIN_VARIANT (*parm);
+ if (TREE_CODE (*parm) == REFERENCE_TYPE)
+ *parm = TREE_TYPE (*parm);
}
/* Like type_unfication. EXPLICIT_MASK, if non-NULL, is an array of
integers, with ones in positions corresponding to arguments in
- targs that were provided explicitly, and zeros elsewhere. */
+ targs that were provided explicitly, and zeros elsewhere.
+
+ If SUBR is 1, we're being called recursively (to unify the
+ arguments of a function or method parameter of a function
+ template). */
static int
type_unification_real (tparms, targs, parms, args, subr,
strict, allow_incomplete, explicit_mask)
tree tparms, targs, parms, args;
- int subr, strict, allow_incomplete;
+ int subr;
+ unification_kind_t strict;
+ int allow_incomplete;
int* explicit_mask;
{
tree parm, arg;
int i;
int ntparms = TREE_VEC_LENGTH (tparms);
+ int sub_strict;
my_friendly_assert (TREE_CODE (tparms) == TREE_VEC, 289);
my_friendly_assert (parms == NULL_TREE
@@ -5578,6 +6699,24 @@ type_unification_real (tparms, targs, parms, args, subr,
my_friendly_assert (TREE_CODE (args) == TREE_LIST, 291);
my_friendly_assert (ntparms > 0, 292);
+ switch (strict)
+ {
+ case DEDUCE_CALL:
+ sub_strict = UNIFY_ALLOW_MORE_CV_QUAL | UNIFY_ALLOW_DERIVED;
+ break;
+
+ case DEDUCE_CONV:
+ sub_strict = UNIFY_ALLOW_LESS_CV_QUAL;
+ break;
+
+ case DEDUCE_EXACT:
+ sub_strict = UNIFY_ALLOW_NONE;
+ break;
+
+ default:
+ my_friendly_abort (0);
+ }
+
while (parms
&& parms != void_list_node
&& args
@@ -5609,7 +6748,7 @@ type_unification_real (tparms, targs, parms, args, subr,
arg = NULL_TREE;
}
- if (strict)
+ if (strict == DEDUCE_EXACT)
{
if (comptypes (parm, type, 1))
continue;
@@ -5632,49 +6771,36 @@ type_unification_real (tparms, targs, parms, args, subr,
if (TREE_CODE_CLASS (TREE_CODE (arg)) != 't')
{
my_friendly_assert (TREE_TYPE (arg) != NULL_TREE, 293);
- if (TREE_CODE (arg) == TREE_LIST
- && TREE_TYPE (arg) == unknown_type_node
- && TREE_CODE (TREE_VALUE (arg)) == TEMPLATE_DECL)
+ if (TREE_CODE (arg) == OVERLOAD
+ && TREE_CODE (OVL_FUNCTION (arg)) == TEMPLATE_DECL)
{
- int ntparms;
tree targs;
+ tree arg_type;
+ int r;
/* Have to back unify here */
- arg = TREE_VALUE (arg);
- ntparms = DECL_NTPARMS (arg);
- targs = make_scratch_vec (ntparms);
+ arg = OVL_FUNCTION (arg);
+ targs = make_scratch_vec (DECL_NTPARMS (arg));
+ arg_type = TREE_TYPE (arg);
+ maybe_adjust_types_for_deduction (strict, &parm, &arg_type);
parm = expr_tree_cons (NULL_TREE, parm, NULL_TREE);
- return
- type_unification (DECL_INNERMOST_TEMPLATE_PARMS (arg),
- targs,
- TYPE_ARG_TYPES (TREE_TYPE (arg)),
- parm, NULL_TREE, strict,
- allow_incomplete);
+ arg_type = scratch_tree_cons (NULL_TREE, arg_type, NULL_TREE);
+ r = type_unification (DECL_INNERMOST_TEMPLATE_PARMS (arg),
+ targs, arg_type, parm, NULL_TREE,
+ DEDUCE_EXACT, allow_incomplete);
+ if (r)
+ /* If the back-unification failed, just bail out. */
+ return r;
+ else
+ continue;
}
arg = TREE_TYPE (arg);
}
#endif
- if (! flag_ansi && arg == TREE_TYPE (null_node))
- {
- warning ("using type void* for NULL");
- arg = ptr_type_node;
- }
+ if (!subr)
+ maybe_adjust_types_for_deduction (strict, &parm, &arg);
- if (! subr && TREE_CODE (arg) == REFERENCE_TYPE)
- arg = TREE_TYPE (arg);
-
- if (! subr && TREE_CODE (parm) != REFERENCE_TYPE)
- {
- if (TREE_CODE (arg) == FUNCTION_TYPE
- || TREE_CODE (arg) == METHOD_TYPE)
- arg = build_pointer_type (arg);
- else if (TREE_CODE (arg) == ARRAY_TYPE)
- arg = build_pointer_type (TREE_TYPE (arg));
- else
- arg = TYPE_MAIN_VARIANT (arg);
- }
-
- switch (unify (tparms, targs, ntparms, parm, arg, strict,
+ switch (unify (tparms, targs, parm, arg, sub_strict,
explicit_mask))
{
case 0:
@@ -5724,12 +6850,43 @@ template_decl_level (decl)
}
}
-/* Tail recursion is your friend. */
+/* Decide whether ARG can be unified with PARM, considering only the
+ cv-qualifiers of each type, given STRICT as documented for unify.
+ Returns non-zero iff the unification is OK on that basis.*/
-static int
-unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
+int
+check_cv_quals_for_unify (strict, arg, parm)
+ int strict;
+ tree arg;
+ tree parm;
+{
+ return !((!(strict & UNIFY_ALLOW_MORE_CV_QUAL)
+ && (TYPE_READONLY (arg) < TYPE_READONLY (parm)
+ || TYPE_VOLATILE (arg) < TYPE_VOLATILE (parm)))
+ || (!(strict & UNIFY_ALLOW_LESS_CV_QUAL)
+ && (TYPE_READONLY (arg) > TYPE_READONLY (parm)
+ || TYPE_VOLATILE (arg) > TYPE_VOLATILE (parm))));
+}
+
+/* Takes parameters as for type_unification. Returns 0 if the
+ type deduction suceeds, 1 otherwise. The parameter STRICT is a
+ bitwise or of the following flags:
+
+ UNIFY_ALLOW_NONE:
+ Require an exact match between PARM and ARG.
+ UNIFY_ALLOW_MORE_CV_QUAL:
+ Allow the deduced ARG to be more cv-qualified than ARG.
+ UNIFY_ALLOW_LESS_CV_QUAL:
+ Allow the deduced ARG to be less cv-qualified than ARG.
+ UNIFY_ALLOW_DERIVED:
+ Allow the deduced ARG to be a template base class of ARG,
+ or a pointer to a template base class of the type pointed to by
+ ARG. */
+
+int
+unify (tparms, targs, parm, arg, strict, explicit_mask)
tree tparms, targs, parm, arg;
- int ntparms, strict;
+ int strict;
int* explicit_mask;
{
int idx;
@@ -5754,11 +6911,16 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
if (arg == parm && !uses_template_parms (parm))
return 0;
- /* We can't remove cv-quals when strict. */
- if (strict && TREE_CODE (arg) == TREE_CODE (parm)
+ /* Immediately reject some pairs that won't unify because of
+ cv-qualification mismatches. */
+ if (TREE_CODE (arg) == TREE_CODE (parm)
&& TREE_CODE_CLASS (TREE_CODE (arg)) == 't'
- && (TYPE_READONLY (arg) < TYPE_READONLY (parm)
- || TYPE_VOLATILE (arg) < TYPE_VOLATILE (parm)))
+ /* We check the cv-qualifiers when unifying with template type
+ parameters below. We want to allow ARG `const T' to unify with
+ PARM `T' for example, when computing which of two templates
+ is more specialized, for example. */
+ && TREE_CODE (arg) != TEMPLATE_TYPE_PARM
+ && !check_cv_quals_for_unify (strict, arg, parm))
return 1;
switch (TREE_CODE (parm))
@@ -5820,10 +6982,10 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
in order to handle default arguments properly. For example,
template<template <class> class TT> void f(TT<int>)
should be able to accept vector<int> which comes from
- template <class T, class Allcator = allocator>
+ template <class T, class Allocator = allocator>
class vector. */
- if (coerce_template_parms (argtmplvec, parmvec, parmtmpl, 1, 1, 0)
+ if (coerce_template_parms (argtmplvec, parmvec, parmtmpl, 1, 1)
== error_mark_node)
return 1;
@@ -5838,8 +7000,9 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
/* This argument can be deduced. */
- if (unify (tparms, targs, ntparms, t,
- TREE_VEC_ELT (argvec, i), strict, explicit_mask))
+ if (unify (tparms, targs, t,
+ TREE_VEC_ELT (argvec, i),
+ UNIFY_ALLOW_NONE, explicit_mask))
return 1;
}
}
@@ -5848,25 +7011,20 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
}
else
{
- if (strict && (TYPE_READONLY (arg) < TYPE_READONLY (parm)
- || TYPE_VOLATILE (arg) < TYPE_VOLATILE (parm)))
+ /* If PARM is `const T' and ARG is only `int', we don't have
+ a match unless we are allowing additional qualification.
+ If ARG is `const int' and PARM is just `T' that's OK;
+ that binds `const int' to `T'. */
+ if (!check_cv_quals_for_unify (strict | UNIFY_ALLOW_LESS_CV_QUAL,
+ arg, parm))
return 1;
-#if 0
- /* Template type parameters cannot contain cv-quals; i.e.
- template <class T> void f (T& a, T& b) will not generate
- void f (const int& a, const int& b). */
- if (TYPE_READONLY (arg) > TYPE_READONLY (parm)
- || TYPE_VOLATILE (arg) > TYPE_VOLATILE (parm))
- return 1;
- arg = TYPE_MAIN_VARIANT (arg);
-#else
- {
- int constp = TYPE_READONLY (arg) > TYPE_READONLY (parm);
- int volatilep = TYPE_VOLATILE (arg) > TYPE_VOLATILE (parm);
- arg = cp_build_type_variant (arg, constp, volatilep);
- }
-#endif
+ /* Consider the case where ARG is `const volatile int' and
+ PARM is `const T'. Then, T should be `volatile int'. */
+ arg =
+ cp_build_type_variant (arg,
+ TYPE_READONLY (arg) > TYPE_READONLY (parm),
+ TYPE_VOLATILE (arg) > TYPE_VOLATILE (parm));
}
/* Simple cases: Value already set, does match or doesn't. */
@@ -5887,14 +7045,14 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
/* The PARM is not one we're trying to unify. Just check
to see if it matches ARG. */
return (TREE_CODE (arg) == TREE_CODE (parm)
- && cp_tree_equal (parm, arg)) ? 0 : 1;
+ && cp_tree_equal (parm, arg) > 0) ? 0 : 1;
idx = TEMPLATE_PARM_IDX (parm);
targ = TREE_VEC_ELT (targs, idx);
if (targ)
{
- int i = cp_tree_equal (targ, arg);
+ int i = (cp_tree_equal (targ, arg) > 0);
if (i == 1)
return 0;
else if (i == 0)
@@ -5907,20 +7065,48 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
return 0;
case POINTER_TYPE:
- if (TREE_CODE (arg) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (arg))
- return unify (tparms, targs, ntparms, parm,
- TYPE_PTRMEMFUNC_FN_TYPE (arg), strict, explicit_mask);
+ {
+ int sub_strict;
- if (TREE_CODE (arg) != POINTER_TYPE)
- return 1;
- return unify (tparms, targs, ntparms, TREE_TYPE (parm), TREE_TYPE (arg),
- strict, explicit_mask);
+ if (TREE_CODE (arg) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (arg))
+ return (unify (tparms, targs, parm,
+ TYPE_PTRMEMFUNC_FN_TYPE (arg), strict,
+ explicit_mask));
+
+ if (TREE_CODE (arg) != POINTER_TYPE)
+ return 1;
+
+ /* [temp.deduct.call]
+
+ A can be another pointer or pointer to member type that can
+ be converted to the deduced A via a qualification
+ conversion (_conv.qual_).
+
+ We pass down STRICT here rather than UNIFY_ALLOW_NONE.
+ This will allow for additional cv-qualification of the
+ pointed-to types if appropriate. In general, this is a bit
+ too generous; we are only supposed to allow qualification
+ conversions and this method will allow an ARG of char** and
+ a deduced ARG of const char**. However, overload
+ resolution will subsequently invalidate the candidate, so
+ this is probably OK. */
+ sub_strict = strict;
+
+ if (TREE_CODE (TREE_TYPE (arg)) != RECORD_TYPE
+ || TYPE_PTRMEMFUNC_FLAG (TREE_TYPE (arg)))
+ /* The derived-to-base conversion only persists through one
+ level of pointers. */
+ sub_strict &= ~UNIFY_ALLOW_DERIVED;
+
+ return unify (tparms, targs, TREE_TYPE (parm), TREE_TYPE
+ (arg), sub_strict, explicit_mask);
+ }
case REFERENCE_TYPE:
- if (TREE_CODE (arg) == REFERENCE_TYPE)
- arg = TREE_TYPE (arg);
- return unify (tparms, targs, ntparms, TREE_TYPE (parm), arg,
- strict, explicit_mask);
+ if (TREE_CODE (arg) != REFERENCE_TYPE)
+ return 1;
+ return unify (tparms, targs, TREE_TYPE (parm), TREE_TYPE (arg),
+ UNIFY_ALLOW_NONE, explicit_mask);
case ARRAY_TYPE:
if (TREE_CODE (arg) != ARRAY_TYPE)
@@ -5929,11 +7115,11 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
!= (TYPE_DOMAIN (arg) == NULL_TREE))
return 1;
if (TYPE_DOMAIN (parm) != NULL_TREE
- && unify (tparms, targs, ntparms, TYPE_DOMAIN (parm),
- TYPE_DOMAIN (arg), strict, explicit_mask) != 0)
+ && unify (tparms, targs, TYPE_DOMAIN (parm),
+ TYPE_DOMAIN (arg), UNIFY_ALLOW_NONE, explicit_mask) != 0)
return 1;
- return unify (tparms, targs, ntparms, TREE_TYPE (parm), TREE_TYPE (arg),
- strict, explicit_mask);
+ return unify (tparms, targs, TREE_TYPE (parm), TREE_TYPE (arg),
+ UNIFY_ALLOW_NONE, explicit_mask);
case REAL_TYPE:
case COMPLEX_TYPE:
@@ -5943,19 +7129,23 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
if (TREE_CODE (arg) != TREE_CODE (parm))
return 1;
- if (TREE_CODE (parm) == INTEGER_TYPE)
+ if (TREE_CODE (parm) == INTEGER_TYPE
+ && TREE_CODE (TYPE_MAX_VALUE (parm)) != INTEGER_CST)
{
if (TYPE_MIN_VALUE (parm) && TYPE_MIN_VALUE (arg)
- && unify (tparms, targs, ntparms, TYPE_MIN_VALUE (parm),
- TYPE_MIN_VALUE (arg), strict, explicit_mask))
+ && unify (tparms, targs, TYPE_MIN_VALUE (parm),
+ TYPE_MIN_VALUE (arg), UNIFY_ALLOW_NONE, explicit_mask))
return 1;
if (TYPE_MAX_VALUE (parm) && TYPE_MAX_VALUE (arg)
- && unify (tparms, targs, ntparms, TYPE_MAX_VALUE (parm),
- TYPE_MAX_VALUE (arg), strict, explicit_mask))
+ && unify (tparms, targs, TYPE_MAX_VALUE (parm),
+ TYPE_MAX_VALUE (arg), UNIFY_ALLOW_NONE, explicit_mask))
return 1;
}
- else if (TREE_CODE (parm) == REAL_TYPE
- && TYPE_MAIN_VARIANT (arg) != TYPE_MAIN_VARIANT (parm))
+ /* We use the TYPE_MAIN_VARIANT since we have already
+ checked cv-qualification at the top of the
+ function. */
+ else if (!comptypes (TYPE_MAIN_VARIANT (arg),
+ TYPE_MAIN_VARIANT (parm), 1))
return 1;
/* As far as unification is concerned, this wins. Later checks
@@ -5980,28 +7170,32 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
if (TREE_VEC_LENGTH (parm) != TREE_VEC_LENGTH (arg))
return 1;
for (i = TREE_VEC_LENGTH (parm) - 1; i >= 0; i--)
- if (unify (tparms, targs, ntparms,
+ if (unify (tparms, targs,
TREE_VEC_ELT (parm, i), TREE_VEC_ELT (arg, i),
- strict, explicit_mask))
+ UNIFY_ALLOW_NONE, explicit_mask))
return 1;
return 0;
}
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_FLAG (parm))
- return unify (tparms, targs, ntparms, TYPE_PTRMEMFUNC_FN_TYPE (parm),
+ return unify (tparms, targs, TYPE_PTRMEMFUNC_FN_TYPE (parm),
arg, strict, explicit_mask);
- /* Allow trivial conversions. */
- if (TREE_CODE (arg) != RECORD_TYPE
- || TYPE_READONLY (parm) < TYPE_READONLY (arg)
- || TYPE_VOLATILE (parm) < TYPE_VOLATILE (arg))
+ if (TREE_CODE (arg) != RECORD_TYPE)
return 1;
-
+
if (CLASSTYPE_TEMPLATE_INFO (parm) && uses_template_parms (parm))
{
tree t = NULL_TREE;
- if (! strict)
+ if (strict & UNIFY_ALLOW_DERIVED)
+ /* [temp.deduct.call]
+
+ If P is a class, and P has the form template-id, then A
+ can be a derived class of the deduced A. Likewise, if
+ P is a pointer to a class of the form template-id, A
+ can be a pointer to a derived class pointed to by the
+ deduced A. */
t = get_template_base (CLASSTYPE_TI_TEMPLATE (parm), arg);
else if
(CLASSTYPE_TEMPLATE_INFO (arg)
@@ -6010,40 +7204,38 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
if (! t || t == error_mark_node)
return 1;
- return unify (tparms, targs, ntparms, CLASSTYPE_TI_ARGS (parm),
- CLASSTYPE_TI_ARGS (t), strict, explicit_mask);
+ return unify (tparms, targs, CLASSTYPE_TI_ARGS (parm),
+ CLASSTYPE_TI_ARGS (t), UNIFY_ALLOW_NONE,
+ explicit_mask);
}
- else if (TYPE_MAIN_VARIANT (parm) != TYPE_MAIN_VARIANT (arg))
+ else if (!comptypes (TYPE_MAIN_VARIANT (parm),
+ TYPE_MAIN_VARIANT (arg), 1))
return 1;
return 0;
case METHOD_TYPE:
- if (TREE_CODE (arg) != METHOD_TYPE)
- return 1;
- goto check_args;
-
case FUNCTION_TYPE:
- if (TREE_CODE (arg) != FUNCTION_TYPE)
+ if (TREE_CODE (arg) != TREE_CODE (parm))
return 1;
- check_args:
- if (unify (tparms, targs, ntparms, TREE_TYPE (parm),
- TREE_TYPE (arg), strict, explicit_mask))
+
+ if (unify (tparms, targs, TREE_TYPE (parm),
+ TREE_TYPE (arg), UNIFY_ALLOW_NONE, explicit_mask))
return 1;
return type_unification_real (tparms, targs, TYPE_ARG_TYPES (parm),
TYPE_ARG_TYPES (arg), 1,
- strict, 0, explicit_mask);
+ DEDUCE_EXACT, 0, explicit_mask);
case OFFSET_TYPE:
if (TREE_CODE (arg) != OFFSET_TYPE)
return 1;
- if (unify (tparms, targs, ntparms, TYPE_OFFSET_BASETYPE (parm),
- TYPE_OFFSET_BASETYPE (arg), strict, explicit_mask))
+ if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm),
+ TYPE_OFFSET_BASETYPE (arg), UNIFY_ALLOW_NONE, explicit_mask))
return 1;
- return unify (tparms, targs, ntparms, TREE_TYPE (parm),
- TREE_TYPE (arg), strict, explicit_mask);
+ return unify (tparms, targs, TREE_TYPE (parm), TREE_TYPE (arg),
+ UNIFY_ALLOW_NONE, explicit_mask);
case CONST_DECL:
- if (arg != decl_constant_value (parm))
+ if (arg != decl_constant_value (parm))
return 1;
return 0;
@@ -6051,6 +7243,30 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
/* Matched cases are handled by the ARG == PARM test above. */
return 1;
+ case MINUS_EXPR:
+ if (TREE_CODE (TREE_OPERAND (parm, 1)) == INTEGER_CST)
+ {
+ /* We handle this case specially, since it comes up with
+ arrays. In particular, something like:
+
+ template <int N> void f(int (&x)[N]);
+
+ Here, we are trying to unify the range type, which
+ looks like [0 ... (N - 1)]. */
+ tree t, t1, t2;
+ t1 = TREE_OPERAND (parm, 0);
+ t2 = TREE_OPERAND (parm, 1);
+
+ /* Should this be a regular fold? */
+ t = maybe_fold_nontype_arg (build (PLUS_EXPR,
+ integer_type_node,
+ arg, t2));
+
+ return unify (tparms, targs, t1, t, UNIFY_ALLOW_NONE,
+ explicit_mask);
+ }
+ /* else fall through */
+
default:
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (parm))))
{
@@ -6070,34 +7286,11 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
figuring it out. */
tree t =
maybe_fold_nontype_arg (tsubst_expr (parm, targs, NULL_TREE));
- enum tree_code tc = TREE_CODE (t);
-
- if (tc == MINUS_EXPR
- && TREE_CODE (TREE_OPERAND (t, 0)) == TEMPLATE_PARM_INDEX
- && TREE_CODE (TREE_OPERAND (t, 1)) == INTEGER_CST)
- {
- /* We handle this case specially, since it comes up with
- arrays. In particular, something like:
-
- template <int N> void f(int (&x)[N]);
+ tree a = maybe_fold_nontype_arg (arg);
- Here, we are trying to unify the range type, which
- looks like [0 ... (N - 1)]. */
- tree t1, t2;
- t1 = TREE_OPERAND (parm, 0);
- t2 = TREE_OPERAND (parm, 1);
-
- t = maybe_fold_nontype_arg (build (PLUS_EXPR,
- integer_type_node,
- arg, t2));
-
- return unify (tparms, targs, ntparms, t1, t,
- strict, explicit_mask);
- }
-
- if (!IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (tc)))
+ if (!IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (t))))
/* Good, we mangaged to simplify the exression. */
- return unify (tparms, targs, ntparms, t, arg, strict,
+ return unify (tparms, targs, t, a, UNIFY_ALLOW_NONE,
explicit_mask);
else
/* Bad, we couldn't simplify this. Assume it doesn't
@@ -6112,14 +7305,15 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
}
}
+/* Called if RESULT is explicitly instantiated, or is a member of an
+ explicitly instantiated class, or if using -frepo and the
+ instantiation of RESULT has been assigned to this file. */
+
void
mark_decl_instantiated (result, extern_p)
tree result;
int extern_p;
{
- if (DECL_TEMPLATE_INSTANTIATION (result))
- SET_DECL_EXPLICIT_INSTANTIATION (result);
-
if (TREE_CODE (result) != FUNCTION_DECL)
/* The TREE_PUBLIC flag for function declarations will have been
set correctly by tsubst. */
@@ -6130,10 +7324,13 @@ mark_decl_instantiated (result, extern_p)
DECL_INTERFACE_KNOWN (result) = 1;
DECL_NOT_REALLY_EXTERN (result) = 1;
+ /* Always make artificials weak. */
+ if (DECL_ARTIFICIAL (result) && flag_weak)
+ comdat_linkage (result);
/* For WIN32 we also want to put explicit instantiations in
linkonce sections. */
- if (supports_one_only () && ! SUPPORTS_WEAK && TREE_PUBLIC (result))
- make_decl_one_only (result);
+ else if (TREE_PUBLIC (result))
+ maybe_make_one_only (result);
}
else if (TREE_CODE (result) == FUNCTION_DECL)
mark_inline_for_output (result);
@@ -6155,15 +7352,11 @@ more_specialized (pat1, pat2, explicit_args)
targs = get_bindings_overload (pat1, pat2, explicit_args);
if (targs)
- {
- --winner;
- }
+ --winner;
targs = get_bindings_overload (pat2, pat1, explicit_args);
if (targs)
- {
- ++winner;
- }
+ ++winner;
return winner;
}
@@ -6181,15 +7374,13 @@ more_specialized_class (pat1, pat2)
tree targs;
int winner = 0;
- targs = get_class_bindings
- (TREE_VALUE (pat1), TREE_PURPOSE (pat1),
- TREE_PURPOSE (pat2), NULL_TREE);
+ targs = get_class_bindings (TREE_VALUE (pat1), TREE_PURPOSE (pat1),
+ TREE_PURPOSE (pat2));
if (targs)
--winner;
- targs = get_class_bindings
- (TREE_VALUE (pat2), TREE_PURPOSE (pat2),
- TREE_PURPOSE (pat1), NULL_TREE);
+ targs = get_class_bindings (TREE_VALUE (pat2), TREE_PURPOSE (pat2),
+ TREE_PURPOSE (pat1));
if (targs)
++winner;
@@ -6235,7 +7426,7 @@ get_bindings_real (fn, decl, explicit_args, check_rettype)
i = fn_type_unification (fn, explicit_args, targs,
decl_arg_types,
TREE_TYPE (TREE_TYPE (decl)),
- 1,
+ DEDUCE_EXACT,
extra_fn_arg);
if (i != 0)
@@ -6244,8 +7435,7 @@ get_bindings_real (fn, decl, explicit_args, check_rettype)
if (check_rettype)
{
/* Check to see that the resulting return type is also OK. */
- tree t = tsubst (TREE_TYPE (TREE_TYPE (fn)),
- complete_template_args (fn, targs, 1),
+ tree t = tsubst (TREE_TYPE (TREE_TYPE (fn)), targs,
NULL_TREE);
if (!comptypes (t, TREE_TYPE (TREE_TYPE (decl)), 1))
@@ -6273,24 +7463,35 @@ get_bindings_overload (fn, decl, explicit_args)
return get_bindings_real (fn, decl, explicit_args, 0);
}
+/* Return the innermost template arguments that, when applied to a
+ template specialization whose innermost template parameters are
+ TPARMS, and whose specialization arguments are ARGS, yield the
+ ARGS.
+
+ For example, suppose we have:
+
+ template <class T, class U> struct S {};
+ template <class T> struct S<T*, int> {};
+
+ Then, suppose we want to get `S<double*, int>'. The TPARMS will be
+ {T}, the PARMS will be {T*, int} and the ARGS will be {double*,
+ int}. The resulting vector will be {double}, indicating that `T'
+ is bound to `double'. */
+
static tree
-get_class_bindings (tparms, parms, args, outer_args)
- tree tparms, parms, args, outer_args;
+get_class_bindings (tparms, parms, args)
+ tree tparms, parms, args;
{
int i, ntparms = TREE_VEC_LENGTH (tparms);
tree vec = make_temp_vec (ntparms);
- if (outer_args)
- {
- tparms = tsubst (tparms, outer_args, NULL_TREE);
- parms = tsubst (parms, outer_args, NULL_TREE);
- }
+ args = innermost_args (args);
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{
- switch (unify (tparms, vec, ntparms,
+ switch (unify (tparms, vec,
TREE_VEC_ELT (parms, i), TREE_VEC_ELT (args, i),
- 1, 0))
+ UNIFY_ALLOW_NONE, 0))
{
case 0:
break;
@@ -6314,27 +7515,25 @@ tree
most_specialized (fns, decl, explicit_args)
tree fns, decl, explicit_args;
{
- tree fn, champ, args, *p;
+ tree candidates = NULL_TREE;
+ tree fn, champ, args;
int fate;
- for (p = &fns; *p; )
+ for (fn = fns; fn; fn = TREE_CHAIN (fn))
{
- args = get_bindings (TREE_VALUE (*p), decl, explicit_args);
+ tree candidate = TREE_VALUE (fn);
+
+ args = get_bindings (candidate, decl, explicit_args);
if (args)
- {
- p = &TREE_CHAIN (*p);
- }
- else
- *p = TREE_CHAIN (*p);
+ candidates = scratch_tree_cons (NULL_TREE, candidate,
+ candidates);
}
- if (! fns)
+ if (!candidates)
return NULL_TREE;
- fn = fns;
- champ = TREE_VALUE (fn);
- fn = TREE_CHAIN (fn);
- for (; fn; fn = TREE_CHAIN (fn))
+ champ = TREE_VALUE (candidates);
+ for (fn = TREE_CHAIN (candidates); fn; fn = TREE_CHAIN (fn))
{
fate = more_specialized (champ, TREE_VALUE (fn), explicit_args);
if (fate == 1)
@@ -6351,7 +7550,7 @@ most_specialized (fns, decl, explicit_args)
}
}
- for (fn = fns; fn && TREE_VALUE (fn) != champ; fn = TREE_CHAIN (fn))
+ for (fn = candidates; fn && TREE_VALUE (fn) != champ; fn = TREE_CHAIN (fn))
{
fate = more_specialized (champ, TREE_VALUE (fn), explicit_args);
if (fate != 1)
@@ -6361,21 +7560,50 @@ most_specialized (fns, decl, explicit_args)
return champ;
}
-/* Return the most specialized of the class template specializations in
- SPECS that can produce an instantiation matching ARGS. */
+/* If DECL is a specialization of some template, return the most
+ general such template. For example, given:
+
+ template <class T> struct S { template <class U> void f(U); };
+
+ if TMPL is `template <class U> void S<int>::f(U)' this will return
+ the full template. This function will not trace past partial
+ specializations, however. For example, given in addition:
+
+ template <class T> struct S<T*> { template <class U> void f(U); };
+
+ if TMPL is `template <class U> void S<int*>::f(U)' this will return
+ `template <class T> template <class U> S<T*>::f(U)'. */
tree
-most_specialized_class (specs, mainargs, outer_args)
- tree specs, mainargs, outer_args;
+most_general_template (decl)
+ tree decl;
{
- tree list = NULL_TREE, t, args, champ;
+ while (DECL_TEMPLATE_INFO (decl))
+ decl = DECL_TI_TEMPLATE (decl);
+
+ return decl;
+}
+
+/* Return the most specialized of the class template specializations
+ of TMPL which can produce an instantiation matching ARGS, or
+ error_mark_node if the choice is ambiguous. */
+
+tree
+most_specialized_class (tmpl, args)
+ tree tmpl;
+ tree args;
+{
+ tree list = NULL_TREE;
+ tree t;
+ tree champ;
int fate;
- for (t = specs; t; t = TREE_CHAIN (t))
+ tmpl = most_general_template (tmpl);
+ for (t = DECL_TEMPLATE_SPECIALIZATIONS (tmpl); t; t = TREE_CHAIN (t))
{
- args = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
- mainargs, outer_args);
- if (args)
+ tree spec_args
+ = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t), args);
+ if (spec_args)
{
list = decl_tree_cons (TREE_PURPOSE (t), TREE_VALUE (t), list);
TREE_TYPE (list) = TREE_TYPE (t);
@@ -6430,29 +7658,69 @@ do_decl_instantiation (declspecs, declarator, storage)
cp_error ("explicit instantiation of non-template `%#D'", decl);
return;
}
-
- /* If we've already seen this template instance, use it. */
- if (TREE_CODE (decl) == VAR_DECL)
+ else if (TREE_CODE (decl) == VAR_DECL)
{
+ /* There is an asymmetry here in the way VAR_DECLs and
+ FUNCTION_DECLs are handled by grokdeclarator. In the case of
+ the latter, the DECL we get back will be marked as a
+ template instantiation, and the appropriate
+ DECL_TEMPLATE_INFO will be set up. This does not happen for
+ VAR_DECLs so we do the lookup here. Probably, grokdeclarator
+ should handle VAR_DECLs as it currently handles
+ FUNCTION_DECLs. */
result = lookup_field (DECL_CONTEXT (decl), DECL_NAME (decl), 0, 0);
if (result && TREE_CODE (result) != VAR_DECL)
- result = NULL_TREE;
+ {
+ cp_error ("no matching template for `%D' found", result);
+ return;
+ }
}
else if (TREE_CODE (decl) != FUNCTION_DECL)
{
cp_error ("explicit instantiation of `%#D'", decl);
return;
}
- else if (DECL_TEMPLATE_INSTANTIATION (decl))
+ else
result = decl;
- if (! result)
+ /* Check for various error cases. Note that if the explicit
+ instantiation is legal the RESULT will currently be marked as an
+ *implicit* instantiation; DECL_EXPLICIT_INSTANTIATION is not set
+ until we get here. */
+
+ if (DECL_TEMPLATE_SPECIALIZATION (result))
{
- cp_error ("no matching template for `%D' found", decl);
+ /* [temp.spec]
+
+ No program shall both explicitly instantiate and explicitly
+ specialize a template. */
+ cp_error ("explicit instantiation of `%#D' after", result);
+ cp_error_at ("explicit specialization here", result);
return;
}
+ else if (DECL_EXPLICIT_INSTANTIATION (result))
+ {
+ /* [temp.spec]
+
+ No program shall explicitly instantiate any template more
+ than once.
- if (! DECL_TEMPLATE_INFO (result))
+ We check DECL_INTERFACE_KNOWN so as not to complain when the
+ first instantiation was `extern' and the second is not, and
+ EXTERN_P for the opposite case. */
+ if (DECL_INTERFACE_KNOWN (result) && !extern_p)
+ cp_error ("duplicate explicit instantiation of `%#D'", result);
+
+ /* If we've already instantiated the template, just return now. */
+ if (DECL_INTERFACE_KNOWN (result))
+ return;
+ }
+ else if (!DECL_IMPLICIT_INSTANTIATION (result))
+ {
+ cp_error ("no matching template for `%D' found", result);
+ return;
+ }
+ else if (!DECL_TEMPLATE_INFO (result))
{
cp_pedwarn ("explicit instantiation of non-template `%#D'", result);
return;
@@ -6464,11 +7732,16 @@ do_decl_instantiation (declspecs, declarator, storage)
if (storage == NULL_TREE)
;
else if (storage == ridpointers[(int) RID_EXTERN])
- extern_p = 1;
+ {
+ if (pedantic)
+ cp_pedwarn ("ANSI C++ forbids the use of `extern' on explicit instantiations");
+ extern_p = 1;
+ }
else
cp_error ("storage class `%D' applied to template instantiation",
storage);
+ SET_DECL_EXPLICIT_INSTANTIATION (result);
mark_decl_instantiated (result, extern_p);
repo_template_instantiated (result, extern_p);
if (! extern_p)
@@ -6523,38 +7796,82 @@ do_type_instantiation (t, storage)
return;
}
- if (storage == NULL_TREE)
- /* OK */;
- else if (storage == ridpointers[(int) RID_INLINE])
- nomem_p = 1;
- else if (storage == ridpointers[(int) RID_EXTERN])
- extern_p = 1;
- else if (storage == ridpointers[(int) RID_STATIC])
- static_p = 1;
- else
+ if (storage != NULL_TREE)
{
- cp_error ("storage class `%D' applied to template instantiation",
- storage);
- extern_p = 0;
+ if (pedantic)
+ cp_pedwarn("ANSI C++ forbids the use of `%s' on explicit instantiations",
+ IDENTIFIER_POINTER (storage));
+
+ if (storage == ridpointers[(int) RID_INLINE])
+ nomem_p = 1;
+ else if (storage == ridpointers[(int) RID_EXTERN])
+ extern_p = 1;
+ else if (storage == ridpointers[(int) RID_STATIC])
+ static_p = 1;
+ else
+ {
+ cp_error ("storage class `%D' applied to template instantiation",
+ storage);
+ extern_p = 0;
+ }
}
- /* We've already instantiated this. */
- if (CLASSTYPE_EXPLICIT_INSTANTIATION (t) && ! CLASSTYPE_INTERFACE_ONLY (t)
- && extern_p)
- return;
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (t))
+ {
+ /* [temp.spec]
- if (! CLASSTYPE_TEMPLATE_SPECIALIZATION (t))
+ No program shall both explicitly instantiate and explicitly
+ specialize a template. */
+ cp_error ("explicit instantiation of `%#T' after", t);
+ cp_error_at ("explicit specialization here", t);
+ return;
+ }
+ else if (CLASSTYPE_EXPLICIT_INSTANTIATION (t))
{
- mark_class_instantiated (t, extern_p);
- repo_template_instantiated (t, extern_p);
+ /* [temp.spec]
+
+ No program shall explicitly instantiate any template more
+ than once.
+
+ If CLASSTYPE_INTERFACE_ONLY, then the first explicit
+ instantiation was `extern', and if EXTERN_P then the second
+ is. Both cases are OK. */
+ if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p)
+ cp_error ("duplicate explicit instantiation of `%#T'", t);
+
+ /* If we've already instantiated the template, just return now. */
+ if (!CLASSTYPE_INTERFACE_ONLY (t))
+ return;
}
+ mark_class_instantiated (t, extern_p);
+ repo_template_instantiated (t, extern_p);
+
if (nomem_p)
return;
{
tree tmp;
+ /* In contrast to implicit instantiation, where only the
+ declarations, and not the definitions, of members are
+ instantiated, we have here:
+
+ [temp.explicit]
+
+ The explicit instantiation of a class template specialization
+ implies the instantiation of all of its members not
+ previously explicitly specialized in the translation unit
+ containing the explicit instantiation.
+
+ Of course, we can't instantiate member template classes, since
+ we don't have any arguments for them. Note that the standard
+ is unclear on whether the instatiation of the members are
+ *explicit* instantiations or not. We choose to be generous,
+ and not set DECL_EXPLICIT_INSTANTIATION. Therefore, we allow
+ the explicit instantiation of a class where some of the members
+ have no definition in the current translation unit. */
+
if (! static_p)
for (tmp = TYPE_METHODS (t); tmp; tmp = TREE_CHAIN (tmp))
if (TREE_CODE (tmp) == FUNCTION_DECL
@@ -6576,88 +7893,214 @@ do_type_instantiation (t, storage)
}
for (tmp = CLASSTYPE_TAGS (t); tmp; tmp = TREE_CHAIN (tmp))
- if (IS_AGGR_TYPE (TREE_VALUE (tmp)))
+ if (IS_AGGR_TYPE (TREE_VALUE (tmp))
+ && !uses_template_parms (CLASSTYPE_TI_ARGS (TREE_VALUE (tmp))))
do_type_instantiation (TYPE_MAIN_DECL (TREE_VALUE (tmp)), storage);
}
}
+/* Given a function DECL, which is a specialization of TMPL, modify
+ DECL to be a re-instantiation of TMPL with the same template
+ arguments. TMPL should be the template into which tsubst'ing
+ should occur for DECL, not the most general template.
+
+ One reason for doing this is a scenario like this:
+
+ template <class T>
+ void f(const T&, int i);
+
+ void g() { f(3, 7); }
+
+ template <class T>
+ void f(const T& t, const int i) { }
+
+ Note that when the template is first instantiated, with
+ instantiate_template, the resulting DECL will have no name for the
+ first parameter, and the wrong type for the second. So, when we go
+ to instantiate the DECL, we regenerate it. */
+
+void
+regenerate_decl_from_template (decl, tmpl)
+ tree decl;
+ tree tmpl;
+{
+ tree args;
+ tree code_pattern;
+ tree new_decl;
+ tree gen_tmpl;
+ int unregistered;
+
+ args = DECL_TI_ARGS (decl);
+ code_pattern = DECL_TEMPLATE_RESULT (tmpl);
+
+ /* Unregister the specialization so that when we tsubst we will not
+ just return DECL. We don't have to unregister DECL from TMPL
+ because if would only be registered there if it were a partial
+ instantiation of a specialization, which it isn't: it's a full
+ instantiation. */
+ gen_tmpl = most_general_template (tmpl);
+ unregistered = unregister_specialization (decl, gen_tmpl);
+
+ /* If the DECL was not unregistered then something peculiar is
+ happening: we created a specialization but did not call
+ register_specialization for it. */
+ my_friendly_assert (unregistered, 0);
+
+ if (TREE_CODE (decl) == VAR_DECL)
+ /* Make sure that we can see identifiers, and compute access
+ correctly, for the class members used in the declaration of
+ this static variable. */
+ pushclass (DECL_CONTEXT (decl), 2);
+
+ /* Do the substitution to get the new declaration. */
+ new_decl = tsubst (code_pattern, args, NULL_TREE);
+
+ if (TREE_CODE (decl) == VAR_DECL)
+ {
+ /* Set up DECL_INITIAL, since tsubst doesn't. */
+ DECL_INITIAL (new_decl) =
+ tsubst_expr (DECL_INITIAL (code_pattern), args,
+ DECL_TI_TEMPLATE (decl));
+ /* Pop the class context we pushed above. */
+ popclass (1);
+ }
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ /* Convince duplicate_decls to use the DECL_ARGUMENTS from the
+ new decl. */
+ DECL_INITIAL (new_decl) = error_mark_node;
+
+ /* The immediate parent of the new template is still whatever it was
+ before, even though tsubst sets DECL_TI_TEMPLATE up as the most
+ general template. We also reset the DECL_ASSEMBLER_NAME since
+ tsubst always calculates the name as if the function in question
+ were really a template instance, and sometimes, with friend
+ functions, this is not so. See tsubst_friend_function for
+ details. */
+ DECL_TI_TEMPLATE (new_decl) = DECL_TI_TEMPLATE (decl);
+ DECL_ASSEMBLER_NAME (new_decl) = DECL_ASSEMBLER_NAME (decl);
+ DECL_RTL (new_decl) = DECL_RTL (decl);
+
+ /* Call duplicate decls to merge the old and new declarations. */
+ duplicate_decls (new_decl, decl);
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ DECL_INITIAL (new_decl) = NULL_TREE;
+
+ /* Now, re-register the specialization. */
+ register_specialization (decl, gen_tmpl, args);
+}
+
/* Produce the definition of D, a _DECL generated from a template. */
tree
instantiate_decl (d)
tree d;
{
- tree ti = DECL_TEMPLATE_INFO (d);
- tree tmpl = TI_TEMPLATE (ti);
- tree args = TI_ARGS (ti);
- tree td, temp;
- tree decl_pattern, code_pattern;
- tree save_ti;
+ tree tmpl = DECL_TI_TEMPLATE (d);
+ tree args = DECL_TI_ARGS (d);
+ tree td;
+ tree code_pattern;
+ tree spec;
+ tree gen_tmpl;
int nested = in_function_p ();
- int d_defined;
int pattern_defined;
int line = lineno;
char *file = input_filename;
- for (td = tmpl;
- DECL_TEMPLATE_INSTANTIATION (td)
- /* This next clause handles friend templates defined inside
- class templates. The friend templates are not really
- instantiations from the point of view of the language, but
- they are instantiations from the point of view of the
- compiler. */
- || (DECL_TEMPLATE_INFO (td) && !DECL_TEMPLATE_SPECIALIZATION (td));
- )
- td = DECL_TI_TEMPLATE (td);
+ /* This function should only be used to instantiate templates for
+ functions and static member variables. */
+ my_friendly_assert (TREE_CODE (d) == FUNCTION_DECL
+ || TREE_CODE (d) == VAR_DECL, 0);
+
+ if ((TREE_CODE (d) == FUNCTION_DECL && DECL_INITIAL (d))
+ || (TREE_CODE (d) == VAR_DECL && !DECL_IN_AGGR_P (d)))
+ /* D has already been instantiated. It might seem reasonable to
+ check whether or not D is an explict instantiation, and, if so,
+ stop here. But when an explicit instantiation is deferred
+ until the end of the compilation, DECL_EXPLICIT_INSTANTIATION
+ is set, even though we still need to do the instantiation. */
+ return d;
- /* In the case of a member template, decl_pattern is the partially
- instantiated declaration (in the instantiated class), and code_pattern
- is the original template definition. */
- decl_pattern = DECL_TEMPLATE_RESULT (tmpl);
- code_pattern = DECL_TEMPLATE_RESULT (td);
+ /* If we already have a specialization of this declaration, then
+ there's no reason to instantiate it. Note that
+ retrieve_specialization gives us both instantiations and
+ specializations, so we must explicitly check
+ DECL_TEMPLATE_SPECIALIZATION. */
+ gen_tmpl = most_general_template (tmpl);
+ spec = retrieve_specialization (gen_tmpl, args);
+ if (spec != NULL_TREE && DECL_TEMPLATE_SPECIALIZATION (spec))
+ return spec;
- if (TREE_CODE (d) == FUNCTION_DECL)
- {
- d_defined = (DECL_INITIAL (d) != NULL_TREE);
- pattern_defined = (DECL_INITIAL (code_pattern) != NULL_TREE);
- }
- else
- {
- d_defined = ! DECL_IN_AGGR_P (d);
- pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
- }
-
- if (d_defined)
+ /* This needs to happen before any tsubsting. */
+ if (! push_tinst_level (d))
return d;
- if (TREE_CODE (d) == FUNCTION_DECL)
+ /* Set TD to the template whose DECL_TEMPLATE_RESULT is the pattern
+ for the instantiation. This is not always the most general
+ template. Consider, for example:
+
+ template <class T>
+ struct S { template <class U> void f();
+ template <> void f<int>(); };
+
+ and an instantiation of S<double>::f<int>. We want TD to be the
+ specialization S<T>::f<int>, not the more general S<T>::f<U>. */
+ td = tmpl;
+ for (td = tmpl;
+ /* An instantiation cannot have a definition, so we need a
+ more general template. */
+ DECL_TEMPLATE_INSTANTIATION (td)
+ /* We must also deal with friend templates. Given:
+
+ template <class T> struct S {
+ template <class U> friend void f() {};
+ };
+
+ S<int>::f<U> say, is not an instantiation of S<T>::f<U>,
+ so far as the language is concerned, but that's still
+ where we get the pattern for the instantiation from. On
+ ther hand, if the definition comes outside the class, say:
+
+ template <class T> struct S {
+ template <class U> friend void f();
+ };
+ template <class U> friend void f() {}
+
+ we don't need to look any further. That's what the check for
+ DECL_INITIAL is for. */
+ || (TREE_CODE (d) == FUNCTION_DECL
+ && DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (td)
+ && !DECL_INITIAL (DECL_TEMPLATE_RESULT (td)));
+ )
{
- tree spec = retrieve_specialization (tmpl, args);
+ /* The present template, TD, should not be a definition. If it
+ were a definition, we should be using it! Note that we
+ cannot restructure the loop to just keep going until we find
+ a template with a definition, since that might go too far if
+ a specialization was declared, but not defined. */
+ my_friendly_assert (!(TREE_CODE (d) == FUNCTION_DECL
+ && DECL_INITIAL (DECL_TEMPLATE_RESULT (td))),
+ 0);
+ my_friendly_assert (!(TREE_CODE (d) == VAR_DECL
+ && !DECL_IN_AGGR_P (DECL_TEMPLATE_RESULT (td))),
+ 0);
- if (spec != NULL_TREE
- && DECL_TEMPLATE_SPECIALIZATION (spec))
- return spec;
+ /* Fetch the more general template. */
+ td = DECL_TI_TEMPLATE (td);
}
- /* This needs to happen before any tsubsting. */
- if (! push_tinst_level (d))
- return d;
+ code_pattern = DECL_TEMPLATE_RESULT (td);
+
+ if (TREE_CODE (d) == FUNCTION_DECL)
+ pattern_defined = (DECL_INITIAL (code_pattern) != NULL_TREE);
+ else
+ pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
push_to_top_level ();
lineno = DECL_SOURCE_LINE (d);
input_filename = DECL_SOURCE_FILE (d);
- /* We need to set up DECL_INITIAL regardless of pattern_defined if the
- variable is a static const initialized in the class body. */
- if (TREE_CODE (d) == VAR_DECL
- && ! DECL_INITIAL (d) && DECL_INITIAL (code_pattern))
- {
- pushclass (DECL_CONTEXT (d), 2);
- DECL_INITIAL (d) = tsubst_expr (DECL_INITIAL (code_pattern), args,
- tmpl);
- cp_finish_decl (d, DECL_INITIAL (d), NULL_TREE, 0, LOOKUP_NORMAL);
- }
-
if (pattern_defined)
{
repo_template_used (d);
@@ -6688,51 +8131,45 @@ instantiate_decl (d)
&& ! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d)))
goto out;
- /* Defer all templates except inline functions used in another function. */
- if (! pattern_defined
- || (! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d) && nested)
- && ! at_eof))
+ if (TREE_CODE (d) == VAR_DECL
+ && TREE_READONLY (d)
+ && DECL_INITIAL (d) == NULL_TREE
+ && DECL_INITIAL (code_pattern) != NULL_TREE)
+ /* We need to set up DECL_INITIAL regardless of pattern_defined if
+ the variable is a static const initialized in the class body. */;
+ else if (! pattern_defined
+ || (! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d) && nested)
+ && ! at_eof))
{
+ /* Defer all templates except inline functions used in another
+ function. We restore the source position here because it's used
+ by add_pending_template. */
+ lineno = line;
+ input_filename = file;
+
+ if (at_eof && !pattern_defined
+ && DECL_EXPLICIT_INSTANTIATION (d))
+ /* [temp.explicit]
+
+ The definition of a non-exported function template, a
+ non-exported member function template, or a non-exported
+ member function or static data member of a class template
+ shall be present in every translation unit in which it is
+ explicitly instantiated. */
+ cp_error ("explicit instantiation of `%D' but no definition available",
+ d);
+
add_pending_template (d);
goto out;
}
+ regenerate_decl_from_template (d, td);
+
+ /* We already set the file and line above. Reset them now in case
+ they changed as a result of calling regenerate_decl_from_template. */
lineno = DECL_SOURCE_LINE (d);
input_filename = DECL_SOURCE_FILE (d);
- /* Trick tsubst into giving us a new decl in case the template changed. */
- save_ti = DECL_TEMPLATE_INFO (decl_pattern);
- DECL_TEMPLATE_INFO (decl_pattern) = NULL_TREE;
- /* decl_pattern has all but one level of template parms bound. Only pass
- in that one level of args. */
- temp = innermost_args (args, DECL_TEMPLATE_SPECIALIZATION (decl_pattern));
- td = tsubst (decl_pattern, temp, tmpl);
- SET_DECL_IMPLICIT_INSTANTIATION (td);
- DECL_TEMPLATE_INFO (decl_pattern) = save_ti;
-
- /* And set up DECL_INITIAL, since tsubst doesn't. */
- if (TREE_CODE (td) == VAR_DECL)
- {
- pushclass (DECL_CONTEXT (d), 2);
- DECL_INITIAL (td) = tsubst_expr (DECL_INITIAL (code_pattern), args,
- tmpl);
- popclass (1);
- }
-
- if (TREE_CODE (d) == FUNCTION_DECL)
- {
- /* Convince duplicate_decls to use the DECL_ARGUMENTS from the
- new decl. */
- DECL_INITIAL (td) = error_mark_node;
-
- if (DECL_TEMPLATE_SPECIALIZATION (td) && !DECL_TEMPLATE_INFO (td))
- /* Set up the information about what is being specialized. */
- DECL_TEMPLATE_INFO (td) = DECL_TEMPLATE_INFO (d);
- }
- duplicate_decls (td, d);
- if (TREE_CODE (d) == FUNCTION_DECL)
- DECL_INITIAL (td) = 0;
-
if (TREE_CODE (d) == VAR_DECL)
{
DECL_IN_AGGR_P (d) = 0;
@@ -6791,27 +8228,6 @@ out:
return d;
}
-tree
-tsubst_chain (t, argvec)
- tree t, argvec;
-{
- if (t)
- {
- tree first = tsubst (t, argvec, NULL_TREE);
- tree last = first;
-
- for (t = TREE_CHAIN (t); t; t = TREE_CHAIN (t))
- {
- tree x = tsubst (t, argvec, NULL_TREE);
- TREE_CHAIN (last) = x;
- last = x;
- }
-
- return first;
- }
- return NULL_TREE;
-}
-
static tree
tsubst_expr_values (t, argvec)
tree t, argvec;
@@ -6884,35 +8300,201 @@ add_maybe_template (d, fns)
DECL_MAYBE_TEMPLATE (d) = 1;
}
-/* Instantiate an enumerated type. Used by instantiate_class_template and
- tsubst_expr. */
+/* Set CURRENT_ACCESS_SPECIFIER based on the protection of DECL. */
-static tree
-tsubst_enum (tag, args, field_chain)
- tree tag, args;
- tree * field_chain;
+static void
+set_current_access_from_decl (decl)
+ tree decl;
{
- extern tree current_local_enum;
- tree prev_local_enum = current_local_enum;
+ if (TREE_PRIVATE (decl))
+ current_access_specifier = access_private_node;
+ else if (TREE_PROTECTED (decl))
+ current_access_specifier = access_protected_node;
+ else
+ current_access_specifier = access_public_node;
+}
+
+/* Instantiate an enumerated type. TAG is the template type, NEWTAG
+ is the instantiation (which should have been created with
+ start_enum) and ARGS are the template arguments to use. */
- tree newtag = start_enum (TYPE_IDENTIFIER (tag));
- tree e, values = NULL_TREE;
+static void
+tsubst_enum (tag, newtag, args)
+ tree tag;
+ tree newtag;
+ tree args;
+{
+ tree e;
for (e = TYPE_VALUES (tag); e; e = TREE_CHAIN (e))
{
- tree elt = build_enumerator (TREE_PURPOSE (e),
- tsubst_expr (TREE_VALUE (e), args,
- NULL_TREE));
- TREE_CHAIN (elt) = values;
- values = elt;
+ tree value;
+ tree elt;
+
+ /* Note that in a template enum, the TREE_VALUE is the
+ CONST_DECL, not the corresponding INTEGER_CST. */
+ value = tsubst_expr (DECL_INITIAL (TREE_VALUE (e)),
+ args,
+ NULL_TREE);
+
+ /* Give this enumeration constant the correct access. */
+ set_current_access_from_decl (TREE_VALUE (e));
+
+ /* Actually build the enumerator itself. */
+ elt = build_enumerator (TREE_PURPOSE (e), value, newtag);
+
+ /* We save the enumerators we have built so far in the
+ TYPE_VALUES so that if the enumeration constants for
+ subsequent enumerators involve those for previous ones,
+ tsubst_copy will be able to find them. */
+ TREE_CHAIN (elt) = TYPE_VALUES (newtag);
+ TYPE_VALUES (newtag) = elt;
}
- finish_enum (newtag, values);
+ finish_enum (newtag);
+}
- if (NULL != field_chain)
- *field_chain = grok_enum_decls (NULL_TREE);
+/* Set the DECL_ASSEMBLER_NAME for DECL, which is a FUNCTION_DECL that
+ is either an instantiation or specialization of a template
+ function. */
- current_local_enum = prev_local_enum;
+static void
+set_mangled_name_for_template_decl (decl)
+ tree decl;
+{
+ tree saved_namespace;
+ tree context = NULL_TREE;
+ tree fn_type;
+ tree ret_type;
+ tree parm_types;
+ tree tparms;
+ tree targs;
+ tree tmpl;
+ int parm_depth;
+
+ my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL, 0);
+ my_friendly_assert (DECL_TEMPLATE_INFO (decl) != NULL_TREE, 0);
+
+ /* The names of template functions must be mangled so as to indicate
+ what template is being specialized with what template arguments.
+ For example, each of the following three functions must get
+ different mangled names:
+
+ void f(int);
+ template <> void f<7>(int);
+ template <> void f<8>(int); */
+
+ targs = DECL_TI_ARGS (decl);
+ if (uses_template_parms (targs))
+ /* This DECL is for a partial instantiation. There's no need to
+ mangle the name of such an entity. */
+ return;
+
+ tmpl = most_general_template (DECL_TI_TEMPLATE (decl));
+ tparms = DECL_TEMPLATE_PARMS (tmpl);
+ parm_depth = TMPL_PARMS_DEPTH (tparms);
+
+ /* There should be as many levels of arguments as there are levels
+ of parameters. */
+ my_friendly_assert (parm_depth == TMPL_ARGS_DEPTH (targs), 0);
+
+ /* We now compute the PARMS and RET_TYPE to give to
+ build_decl_overload_real. The PARMS and RET_TYPE are the
+ parameter and return types of the template, after all but the
+ innermost template arguments have been substituted, not the
+ parameter and return types of the function DECL. For example,
+ given:
- return newtag;
+ template <class T> T f(T);
+
+ both PARMS and RET_TYPE should be `T' even if DECL is `int f(int)'.
+ A more subtle example is:
+
+ template <class T> struct S { template <class U> void f(T, U); }
+
+ Here, if DECL is `void S<int>::f(int, double)', PARMS should be
+ {int, U}. Thus, the args that we want to subsitute into the
+ return and parameter type for the function are those in TARGS,
+ with the innermost level omitted. */
+ fn_type = TREE_TYPE (tmpl);
+ if (DECL_STATIC_FUNCTION_P (decl))
+ context = DECL_CLASS_CONTEXT (decl);
+
+ if (parm_depth == 1)
+ /* No substitution is necessary. */
+ ;
+ else
+ {
+ int i;
+ tree partial_args;
+
+ /* Replace the innermost level of the TARGS with NULL_TREEs to
+ let tsubst know not to subsitute for those parameters. */
+ partial_args = make_temp_vec (TREE_VEC_LENGTH (targs));
+ for (i = 1; i < TMPL_ARGS_DEPTH (targs); ++i)
+ SET_TMPL_ARGS_LEVEL (partial_args, i,
+ TMPL_ARGS_LEVEL (targs, i));
+ SET_TMPL_ARGS_LEVEL (partial_args,
+ TMPL_ARGS_DEPTH (targs),
+ make_temp_vec (DECL_NTPARMS (tmpl)));
+
+ /* Now, do the (partial) substitution to figure out the
+ appropriate function type. */
+ fn_type = tsubst (fn_type, partial_args, NULL_TREE);
+ if (DECL_STATIC_FUNCTION_P (decl))
+ context = tsubst (context, partial_args, NULL_TREE);
+
+ /* Substitute into the template parameters to obtain the real
+ innermost set of parameters. This step is important if the
+ innermost set of template parameters contains value
+ parameters whose types depend on outer template parameters. */
+ TREE_VEC_LENGTH (partial_args)--;
+ tparms = tsubst_template_parms (tparms, partial_args);
+ }
+
+ /* Now, get the innermost parameters and arguments, and figure out
+ the parameter and return types. */
+ tparms = INNERMOST_TEMPLATE_PARMS (tparms);
+ targs = innermost_args (targs);
+ ret_type = TREE_TYPE (fn_type);
+ parm_types = TYPE_ARG_TYPES (fn_type);
+
+ /* For a static member function, we generate a fake `this' pointer,
+ for the purposes of mangling. This indicates of which class the
+ function is a member. Because of:
+
+ [class.static]
+
+ There shall not be a static and a nonstatic member function
+ with the same name and the same parameter types
+
+ we don't have to worry that this will result in a clash with a
+ non-static member function. */
+ if (DECL_STATIC_FUNCTION_P (decl))
+ parm_types = hash_tree_chain (build_pointer_type (context), parm_types);
+
+ /* There should be the same number of template parameters as
+ template arguments. */
+ my_friendly_assert (TREE_VEC_LENGTH (tparms) == TREE_VEC_LENGTH (targs),
+ 0);
+
+ /* If the template is in a namespace, we need to put that into the
+ mangled name. Unfortunately, build_decl_overload_real does not
+ get the decl to mangle, so it relies on the current
+ namespace. Therefore, we set that here temporarily. */
+ my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd', 980702);
+ saved_namespace = current_namespace;
+ current_namespace = CP_DECL_CONTEXT (decl);
+
+ /* Actually set the DCL_ASSEMBLER_NAME. */
+ DECL_ASSEMBLER_NAME (decl)
+ = build_decl_overload_real (DECL_NAME (decl), parm_types, ret_type,
+ tparms, targs,
+ DECL_FUNCTION_MEMBER_P (decl)
+ + DECL_CONSTRUCTOR_P (decl));
+
+ /* Restore the previously active namespace. */
+ current_namespace = saved_namespace;
}
+
+
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index fffcdddbf77..aa3066cbb44 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -70,9 +70,12 @@ print_lang_type (file, node, indent)
|| TREE_CODE (node) == TEMPLATE_TEMPLATE_PARM)
{
indent_to (file, indent + 3);
- fprintf (file, "index %d level %d orig_level %d",
- TEMPLATE_TYPE_IDX (node), TEMPLATE_TYPE_LEVEL (node),
- TEMPLATE_TYPE_ORIG_LEVEL (node));
+ fputs ("index ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_IDX (node));
+ fputs (" level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_LEVEL (node));
+ fputs (" orig_level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_ORIG_LEVEL (node));
return;
}
@@ -147,7 +150,7 @@ print_lang_identifier (file, node, indent)
tree node;
int indent;
{
- print_node (file, "global", IDENTIFIER_GLOBAL_VALUE (node), indent + 4);
+ print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4);
print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
print_node (file, "local", IDENTIFIER_LOCAL_VALUE (node), indent + 4);
print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4);
@@ -169,11 +172,18 @@ lang_print_xnode (file, node, indent)
print_node (file, "value", BINDING_VALUE (node), indent+4);
print_node (file, "chain", TREE_CHAIN (node), indent+4);
break;
+ case OVERLOAD:
+ print_node (file, "function", OVL_FUNCTION (node), indent+4);
+ print_node (file, "chain", TREE_CHAIN (node), indent+4);
+ break;
case TEMPLATE_PARM_INDEX:
indent_to (file, indent + 3);
- fprintf (file, "index %d level %d orig_level %d",
- TEMPLATE_PARM_IDX (node), TEMPLATE_PARM_LEVEL (node),
- TEMPLATE_PARM_ORIG_LEVEL (node));
+ fputs ("index ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_IDX (node));
+ fputs (" level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_LEVEL (node));
+ fputs (" orig_level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_ORIG_LEVEL (node));
break;
default:
break;
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index a1ac79ccef9..742250dc632 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -259,11 +259,7 @@ get_base_filename (filename)
return NULL;
}
- p = rindex (filename, '/');
- if (p)
- return p+1;
- else
- return filename;
+ return file_name_nondirectory (filename);
}
static void
@@ -276,9 +272,7 @@ open_repo_file (filename)
if (s == NULL)
return;
- p = rindex (s, '/');
- if (! p)
- p = s;
+ p = file_name_nondirectory (s);
p = rindex (p, '.');
if (! p)
p = s + strlen (s);
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 4dc02ee878a..63a734db399 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -57,8 +57,12 @@ tree tinfo_fn_type;
void
init_rtti_processing ()
{
+ if (flag_honor_std)
+ push_namespace (get_identifier ("std"));
type_info_type_node = xref_tag
- (class_type_node, get_identifier ("type_info"), NULL_TREE, 1);
+ (class_type_node, get_identifier ("type_info"), 1);
+ if (flag_honor_std)
+ pop_namespace ();
tinfo_fn_id = get_identifier ("__tf");
tinfo_fn_type = build_function_type
(build_reference_type (build_type_variant (type_info_type_node, 1, 0)),
@@ -364,6 +368,7 @@ get_tinfo_fn (type)
DECL_NOT_REALLY_EXTERN (d) = 1;
DECL_MUTABLE_P (d) = 1;
TREE_TYPE (name) = copy_to_permanent (type);
+
pushdecl_top_level (d);
make_function_rtl (d);
assemble_external (d);
@@ -796,8 +801,7 @@ expand_class_desc (tdecl, type)
char *name;
tree field;
- name = (char *) alloca (TYPE_NAME_LENGTH (t)+sizeof (VBASE_NAME)+1);
- sprintf (name, VBASE_NAME_FORMAT, TYPE_NAME_STRING (t));
+ FORMAT_VBASE_NAME (name, t);
field = lookup_field (type, get_identifier (name), 0, 0);
offset = size_binop (FLOOR_DIV_EXPR,
DECL_FIELD_BITPOS (field), size_int (BITS_PER_UNIT));
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 9faa0ee50c5..5f157029eca 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -76,8 +76,6 @@ pop_stack_level (stack)
#define search_level stack_level
static struct search_level *search_stack;
-static void clear_memoized_cache PROTO((void));
-static tree make_memoized_table_entry PROTO((tree, tree, int));
static tree get_abstract_virtuals_1 PROTO((tree, int, tree));
static tree get_vbase_1 PROTO((tree, tree, unsigned int *));
static tree convert_pointer_to_vbase PROTO((tree, tree));
@@ -95,7 +93,7 @@ static void dfs_check_overlap PROTO((tree));
static int dfs_no_overlap_yet PROTO((tree));
static void envelope_add_decl PROTO((tree, tree, tree *));
static int get_base_distance_recursive
- PROTO((tree, int, int, int, int *, tree *, tree, tree *,
+ PROTO((tree, int, int, int, int *, tree *, tree,
int, int *, int, int));
static void expand_upcast_fixups
PROTO((tree, tree, tree, tree, tree, tree, tree *));
@@ -104,20 +102,11 @@ static void fixup_virtual_upcast_offsets
tree *));
static int markedp PROTO((tree));
static int unmarkedp PROTO((tree));
-#ifdef MI_MATRIX
-static int numberedp PROTO((tree));
-static int unnumberedp PROTO((tree));
-#endif
static int marked_vtable_pathp PROTO((tree));
static int unmarked_vtable_pathp PROTO((tree));
static int marked_new_vtablep PROTO((tree));
static int unmarked_new_vtablep PROTO((tree));
static int dfs_debug_unmarkedp PROTO((tree));
-#ifdef MI_MATRIX
-static void dfs_number PROTO((tree));
-static void dfs_unnumber PROTO((tree));
-static void dfs_record_inheritance PROTO((tree));
-#endif
static void dfs_debug_mark PROTO((tree));
static void dfs_find_vbases PROTO((tree));
static void dfs_clear_vbase_slots PROTO((tree));
@@ -131,18 +120,11 @@ static void add_conversions PROTO((tree));
static tree get_virtuals_named_this PROTO((tree));
static tree get_virtual_destructor PROTO((tree, int));
static int tree_has_any_destructor_p PROTO((tree, int));
+static int covariant_return_p PROTO((tree, tree));
static struct search_level *push_search_level
PROTO((struct stack_level *, struct obstack *));
static struct search_level *pop_search_level
PROTO((struct stack_level *));
-static struct type_level *push_type_level
- PROTO((struct stack_level *, struct obstack *));
-static struct type_level *pop_type_level
- PROTO((struct type_level *));
-static tree my_tree_cons PROTO((tree, tree, tree));
-static tree my_build_string PROTO((char *));
-static struct memoized_entry * my_new_memoized_entry
- PROTO((struct memoized_entry *));
static HOST_WIDE_INT breadth_first_search
PROTO((tree, int (*) (tree, int), int (*) (tree, int)));
@@ -174,39 +156,9 @@ pop_search_level (obstack)
return stack;
}
-/* Search memoization. */
-
-struct type_level
-{
- struct stack_level base;
-
- /* First object allocated in obstack of entries. */
- char *entries;
-
- /* Number of types memoized in this context. */
- int len;
-
- /* Type being memoized; save this if we are saving
- memoized contexts. */
- tree type;
-};
-
-/* Obstack used for memoizing member and member function lookup. */
-
-static struct obstack type_obstack, type_obstack_entries;
-static struct type_level *type_stack;
static tree _vptr_name;
-/* Make things that look like tree nodes, but allocate them
- on type_obstack_entries. */
-static int my_tree_node_counter;
-
-extern int flag_memoize_lookups, flag_save_memoized_contexts;
-
/* Variables for gathering statistics. */
-static int my_memoized_entry_counter;
-static int memoized_fast_finds[2], memoized_adds[2], memoized_fast_rejects[2];
-static int memoized_fields_searched[2];
#ifdef GATHER_STATISTICS
static int n_fields_searched;
static int n_calls_lookup_field, n_calls_lookup_field_1;
@@ -216,269 +168,17 @@ static int n_outer_fields_searched;
static int n_contexts_saved;
#endif /* GATHER_STATISTICS */
-/* Local variables to help save memoization contexts. */
-static tree prev_type_memoized;
-static struct type_level *prev_type_stack;
-
/* This list is used by push_class_decls to know what decls need to
be pushed into class scope. */
static tree closed_envelopes = NULL_TREE;
-
-/* Allocate a level of type memoization context. */
-
-static struct type_level *
-push_type_level (stack, obstack)
- struct stack_level *stack;
- struct obstack *obstack;
-{
- struct type_level tem;
-
- tem.base.prev = stack;
-
- obstack_finish (&type_obstack_entries);
- tem.entries = (char *) obstack_base (&type_obstack_entries);
- tem.len = 0;
- tem.type = NULL_TREE;
-
- return (struct type_level *)push_stack_level (obstack, (char *)&tem, sizeof (tem));
-}
-
-/* Discard a level of type memoization context. */
-
-static struct type_level *
-pop_type_level (stack)
- struct type_level *stack;
-{
- obstack_free (&type_obstack_entries, stack->entries);
- return (struct type_level *)pop_stack_level ((struct stack_level *)stack);
-}
-
-/* Make something that looks like a TREE_LIST, but
- do it on the type_obstack_entries obstack. */
-
-static tree
-my_tree_cons (purpose, value, chain)
- tree purpose, value, chain;
-{
- tree p = (tree)obstack_alloc (&type_obstack_entries, sizeof (struct tree_list));
- ++my_tree_node_counter;
- TREE_TYPE (p) = NULL_TREE;
- /* The type of the last on the LHS of this statement must be a pointer
- to the same type as the bitfields in struct tree_common. Otherwise
- we may write beyond our intended area. */
- ((unsigned *)p)[3] = 0;
- TREE_SET_CODE (p, TREE_LIST);
- TREE_PURPOSE (p) = purpose;
- TREE_VALUE (p) = value;
- TREE_CHAIN (p) = chain;
- return p;
-}
-
-static tree
-my_build_string (str)
- char *str;
-{
- tree p = (tree)obstack_alloc (&type_obstack_entries, sizeof (struct tree_string));
- ++my_tree_node_counter;
- TREE_TYPE (p) = 0;
- ((int *)p)[3] = 0;
- TREE_SET_CODE (p, STRING_CST);
- TREE_STRING_POINTER (p) = str;
- TREE_STRING_LENGTH (p) = strlen (str);
- return p;
-}
-
-/* Memoizing machinery to make searches for multiple inheritance
- reasonably efficient. */
-
-#define MEMOIZE_HASHSIZE 8
-typedef struct memoized_entry
-{
- struct memoized_entry *chain;
- int uid;
- tree data_members[MEMOIZE_HASHSIZE];
- tree function_members[MEMOIZE_HASHSIZE];
-} *ME;
-
-#define MEMOIZED_CHAIN(ENTRY) (((ME)ENTRY)->chain)
-#define MEMOIZED_UID(ENTRY) (((ME)ENTRY)->uid)
-#define MEMOIZED_FIELDS(ENTRY,INDEX) (((ME)ENTRY)->data_members[INDEX])
-#define MEMOIZED_FNFIELDS(ENTRY,INDEX) (((ME)ENTRY)->function_members[INDEX])
-/* The following is probably a lousy hash function. */
-#define MEMOIZED_HASH_FN(NODE) (((long)(NODE)>>4)&(MEMOIZE_HASHSIZE - 1))
-
-static struct memoized_entry *
-my_new_memoized_entry (chain)
- struct memoized_entry *chain;
-{
- struct memoized_entry *p
- = (struct memoized_entry *)obstack_alloc (&type_obstack_entries,
- sizeof (struct memoized_entry));
- bzero ((char *) p, sizeof (struct memoized_entry));
- MEMOIZED_CHAIN (p) = chain;
- MEMOIZED_UID (p) = ++my_memoized_entry_counter;
- return p;
-}
-
-/* Clears the deferred pop from pop_memoized_context, if any. */
-
-static void
-clear_memoized_cache ()
-{
- if (prev_type_stack)
- {
- type_stack = pop_type_level (prev_type_stack);
- prev_type_memoized = 0;
- prev_type_stack = 0;
- }
-}
-
-/* Make an entry in the memoized table for type TYPE
- that the entry for NAME is FIELD. */
-
-static tree
-make_memoized_table_entry (type, name, function_p)
- tree type, name;
- int function_p;
-{
- int idx = MEMOIZED_HASH_FN (name);
- tree entry, *prev_entry;
-
- /* Since we allocate from the type_obstack, we must pop any deferred
- levels. */
- clear_memoized_cache ();
-
- memoized_adds[function_p] += 1;
- if (CLASSTYPE_MTABLE_ENTRY (type) == 0)
- {
- obstack_ptr_grow (&type_obstack, type);
- obstack_blank (&type_obstack, sizeof (struct memoized_entry *));
- CLASSTYPE_MTABLE_ENTRY (type) = (char *)my_new_memoized_entry ((struct memoized_entry *)0);
- type_stack->len++;
- if (type_stack->len * 2 >= type_stack->base.limit)
- my_friendly_abort (88);
- }
- if (function_p)
- prev_entry = &MEMOIZED_FNFIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
- else
- prev_entry = &MEMOIZED_FIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
-
- entry = my_tree_cons (name, NULL_TREE, *prev_entry);
- *prev_entry = entry;
-
- /* Don't know the error message to give yet. */
- TREE_TYPE (entry) = error_mark_node;
-
- return entry;
-}
-
-/* When a new function or class context is entered, we build
- a table of types which have been searched for members.
- The table is an array (obstack) of types. When a type is
- entered into the obstack, its CLASSTYPE_MTABLE_ENTRY
- field is set to point to a new record, of type struct memoized_entry.
-
- A non-NULL TREE_TYPE of the entry contains an access control error message.
-
- The slots for the data members are arrays of tree nodes.
- These tree nodes are lists, with the TREE_PURPOSE
- of this list the known member name, and the TREE_VALUE
- as the FIELD_DECL for the member.
-
- For member functions, the TREE_PURPOSE is again the
- name of the member functions for that class,
- and the TREE_VALUE of the list is a pairs
- whose TREE_PURPOSE is a member functions of this name,
- and whose TREE_VALUE is a list of known argument lists this
- member function has been called with. The TREE_TYPE of the pair,
- if non-NULL, is an error message to print. */
-
-/* Tell search machinery that we are entering a new context, and
- to update tables appropriately.
-
- TYPE is the type of the context we are entering, which can
- be NULL_TREE if we are not in a class's scope.
-
- USE_OLD, if nonzero tries to use previous context. */
-
-void
-push_memoized_context (type, use_old)
- tree type;
- int use_old;
-{
- int len;
- tree *tem;
-
- if (prev_type_stack)
- {
- if (use_old && prev_type_memoized == type)
- {
-#ifdef GATHER_STATISTICS
- n_contexts_saved++;
-#endif /* GATHER_STATISTICS */
- type_stack = prev_type_stack;
- prev_type_stack = 0;
-
- tem = &type_stack->base.first[0];
- len = type_stack->len;
- while (len--)
- CLASSTYPE_MTABLE_ENTRY (tem[len*2]) = (char *)tem[len*2+1];
- return;
- }
- /* Otherwise, need to pop old stack here. */
- clear_memoized_cache ();
- }
-
- type_stack = push_type_level ((struct stack_level *)type_stack,
- &type_obstack);
- type_stack->type = type;
-}
-
-/* Tell search machinery that we have left a context.
- We do not currently save these contexts for later use.
- If we wanted to, we could not use pop_search_level, since
- poping that level allows the data we have collected to
- be clobbered; a stack of obstacks would be needed. */
-
-void
-pop_memoized_context (use_old)
- int use_old;
-{
- int len;
- tree *tem = &type_stack->base.first[0];
-
- if (! flag_save_memoized_contexts)
- use_old = 0;
- else if (use_old)
- {
- len = type_stack->len;
- while (len--)
- tem[len*2+1] = (tree)CLASSTYPE_MTABLE_ENTRY (tem[len*2]);
-
- /* If there was a deferred pop, we need to pop it now. */
- clear_memoized_cache ();
-
- prev_type_stack = type_stack;
- prev_type_memoized = type_stack->type;
- }
-
- if (flag_memoize_lookups)
- {
- len = type_stack->len;
- while (len--)
- CLASSTYPE_MTABLE_ENTRY (tem[len*2])
- = (char *)MEMOIZED_CHAIN (CLASSTYPE_MTABLE_ENTRY (tem[len*2]));
- }
- if (! use_old)
- type_stack = pop_type_level (type_stack);
- else
- type_stack = (struct type_level *)type_stack->base.prev;
-}
/* Get a virtual binfo that is found inside BINFO's hierarchy that is
the same type as the type given in PARENT. To be optimal, we want
the first one that is found by going through the least number of
- virtual bases. */
+ virtual bases.
+
+ This uses a clever algorithm that updates *depth when we find the vbase,
+ and cuts off other paths of search when they reach that depth. */
static tree
get_vbase_1 (parent, binfo, depth)
@@ -517,6 +217,9 @@ get_vbase_1 (parent, binfo, depth)
return rval;
}
+/* Return the shortest path to vbase PARENT within BINFO, ignoring
+ access and ambiguity. */
+
tree
get_vbase (parent, binfo)
tree parent;
@@ -593,13 +296,13 @@ get_binfo (parent, binfo, protect)
static int
get_base_distance_recursive (binfo, depth, is_private, rval,
- rval_private_ptr, new_binfo_ptr, parent, path_ptr,
+ rval_private_ptr, new_binfo_ptr, parent,
protect, via_virtual_ptr, via_virtual,
current_scope_in_chain)
tree binfo;
int depth, is_private, rval;
int *rval_private_ptr;
- tree *new_binfo_ptr, parent, *path_ptr;
+ tree *new_binfo_ptr, parent;
int protect, *via_virtual_ptr, via_virtual;
int current_scope_in_chain;
{
@@ -613,38 +316,42 @@ get_base_distance_recursive (binfo, depth, is_private, rval,
if (BINFO_TYPE (binfo) == parent || binfo == parent)
{
+ int better = 0;
+
if (rval == -1)
+ /* This is the first time we've found parent. */
+ better = 1;
+ else if (tree_int_cst_equal (BINFO_OFFSET (*new_binfo_ptr),
+ BINFO_OFFSET (binfo))
+ && *via_virtual_ptr && via_virtual)
+ {
+ /* A new path to the same vbase. If this one has better
+ access or is shorter, take it. */
+
+ if (protect)
+ better = *rval_private_ptr - is_private;
+ if (better == 0)
+ better = rval - depth;
+ }
+ else
+ {
+ /* Ambiguous base class. */
+ rval = depth = -2;
+
+ /* If we get an ambiguity between virtual and non-virtual base
+ class, return the non-virtual in case we are ignoring
+ ambiguity. */
+ better = *via_virtual_ptr - via_virtual;
+ }
+
+ if (better > 0)
{
rval = depth;
*rval_private_ptr = is_private;
*new_binfo_ptr = binfo;
*via_virtual_ptr = via_virtual;
}
- else
- {
- int same_object = (tree_int_cst_equal (BINFO_OFFSET (*new_binfo_ptr),
- BINFO_OFFSET (binfo))
- && *via_virtual_ptr && via_virtual);
-
- if (*via_virtual_ptr && via_virtual==0)
- {
- *rval_private_ptr = is_private;
- *new_binfo_ptr = binfo;
- *via_virtual_ptr = via_virtual;
- }
- else if (same_object)
- {
- if (*rval_private_ptr && ! is_private)
- {
- *rval_private_ptr = is_private;
- *new_binfo_ptr = binfo;
- *via_virtual_ptr = via_virtual;
- }
- return rval;
- }
- rval = -2;
- }
return rval;
}
@@ -657,43 +364,26 @@ get_base_distance_recursive (binfo, depth, is_private, rval,
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
- /* Find any specific instance of a virtual base, when searching with
- a binfo... */
- if (BINFO_MARKED (base_binfo) == 0 || TREE_CODE (parent) == TREE_VEC)
- {
- int via_private
- = (protect
- && (is_private
- || (!TREE_VIA_PUBLIC (base_binfo)
- && !(TREE_VIA_PROTECTED (base_binfo)
- && current_scope_in_chain)
- && !is_friend (BINFO_TYPE (binfo), current_scope ()))));
- int this_virtual = via_virtual || TREE_VIA_VIRTUAL (base_binfo);
- int was;
-
- /* When searching for a non-virtual, we cannot mark
- virtually found binfos. */
- if (! this_virtual)
- SET_BINFO_MARKED (base_binfo);
+ int via_private
+ = (protect
+ && (is_private
+ || (!TREE_VIA_PUBLIC (base_binfo)
+ && !(TREE_VIA_PROTECTED (base_binfo)
+ && current_scope_in_chain)
+ && !is_friend (BINFO_TYPE (binfo), current_scope ()))));
+ int this_virtual = via_virtual || TREE_VIA_VIRTUAL (base_binfo);
-#define WATCH_VALUES(rval, via_private) (rval == -1 ? 3 : via_private)
-
- was = WATCH_VALUES (rval, *via_virtual_ptr);
- rval = get_base_distance_recursive (base_binfo, depth, via_private,
- rval, rval_private_ptr,
- new_binfo_ptr, parent, path_ptr,
- protect, via_virtual_ptr,
- this_virtual,
- current_scope_in_chain);
- /* watch for updates; only update if path is good. */
- if (path_ptr && WATCH_VALUES (rval, *via_virtual_ptr) != was)
- BINFO_INHERITANCE_CHAIN (base_binfo) = binfo;
- if (rval == -2 && *via_virtual_ptr == 0)
- return rval;
-
-#undef WATCH_VALUES
+ rval = get_base_distance_recursive (base_binfo, depth, via_private,
+ rval, rval_private_ptr,
+ new_binfo_ptr, parent,
+ protect, via_virtual_ptr,
+ this_virtual,
+ current_scope_in_chain);
- }
+ /* If we've found a non-virtual, ambiguous base class, we don't need
+ to keep searching. */
+ if (rval == -2 && *via_virtual_ptr == 0)
+ return rval;
}
return rval;
@@ -702,7 +392,7 @@ get_base_distance_recursive (binfo, depth, is_private, rval,
/* Return the number of levels between type PARENT and the type given
in BINFO, following the leftmost path to PARENT not found along a
virtual path, if there are no real PARENTs (all come from virtual
- base classes), then follow the leftmost path to PARENT.
+ base classes), then follow the shortest public path to PARENT.
Return -1 if TYPE is not derived from PARENT.
Return -2 if PARENT is an ambiguous base class of TYPE, and PROTECT is
@@ -745,7 +435,8 @@ get_base_distance (parent, binfo, protect, path_ptr)
binfo = TYPE_BINFO (type);
if (path_ptr)
- BINFO_INHERITANCE_CHAIN (binfo) = NULL_TREE;
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (binfo) == NULL_TREE,
+ 980827);
}
else
my_friendly_abort (92);
@@ -764,11 +455,9 @@ get_base_distance (parent, binfo, protect, path_ptr)
rval = get_base_distance_recursive (binfo, 0, 0, -1,
&rval_private, &new_binfo, parent,
- path_ptr, watch_access, &via_virtual, 0,
+ watch_access, &via_virtual, 0,
0);
- dfs_walk (binfo, dfs_unmark, markedp);
-
/* Access restrictions don't count if we found an ambiguous basetype. */
if (rval == -2 && protect >= 0)
rval_private = 0;
@@ -776,12 +465,14 @@ get_base_distance (parent, binfo, protect, path_ptr)
if (rval && protect && rval_private)
return -3;
- /* find real virtual base classes. */
+ /* If they gave us the real vbase binfo, which isn't in the main binfo
+ tree, deal with it. This happens when we are called from
+ expand_upcast_fixups. */
if (rval == -1 && TREE_CODE (parent) == TREE_VEC
&& parent == binfo_member (BINFO_TYPE (parent),
CLASSTYPE_VBASECLASSES (type)))
{
- BINFO_INHERITANCE_CHAIN (parent) = binfo;
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (parent) == binfo, 980827);
new_binfo = parent;
rval = 1;
}
@@ -961,16 +652,14 @@ compute_access (basetype_path, field)
return access_public_node;
previous_scope = current_scope ();
-
- context = DECL_CLASS_CONTEXT (field);
- if (context == NULL_TREE)
- context = DECL_CONTEXT (field);
+
+ context = DECL_REAL_CONTEXT (field);
/* Fields coming from nested anonymous unions have their DECL_CLASS_CONTEXT
slot set to the union type rather than the record type containing
the anonymous union. */
- if (context && TREE_CODE (context) == UNION_TYPE
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (context)))
+ if (context && ANON_UNION_TYPE_P (context)
+ && TREE_CODE (field) == FIELD_DECL)
context = TYPE_CONTEXT (context);
/* Virtual function tables are never private. But we should know that
@@ -1055,7 +744,6 @@ compute_access (basetype_path, field)
else
break;
}
- reverse_path (basetype_path);
/* No special visibilities apply. Use normal rules. */
@@ -1152,10 +840,10 @@ lookup_fnfields_here (type, name)
fndecls = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
while (fndecls)
{
- if (TYPE_MAIN_VARIANT (DECL_CLASS_CONTEXT (fndecls))
+ if (TYPE_MAIN_VARIANT (DECL_CLASS_CONTEXT (OVL_CURRENT (fndecls)))
== TYPE_MAIN_VARIANT (type))
return idx;
- fndecls = TREE_CHAIN (fndecls);
+ fndecls = OVL_CHAIN (fndecls);
}
return -1;
}
@@ -1198,10 +886,6 @@ lookup_field (xbasetype, name, protect, want_type)
char *errstr = 0;
- /* Set this to nonzero if we don't know how to compute
- accurate error messages for access control. */
- int idx = MEMOIZED_HASH_FN (name);
-
#if 0
/* We cannot search for constructor/destructor names like this. */
/* This can't go here, but where should it go? */
@@ -1229,55 +913,22 @@ lookup_field (xbasetype, name, protect, want_type)
{
type = xbasetype;
basetype_path = TYPE_BINFO (type);
- BINFO_VIA_PUBLIC (basetype_path) = 1;
- BINFO_INHERITANCE_CHAIN (basetype_path) = NULL_TREE;
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (basetype_path) == NULL_TREE,
+ 980827);
}
else
my_friendly_abort (97);
complete_type (type);
- if (CLASSTYPE_MTABLE_ENTRY (type))
- {
- tree tem = MEMOIZED_FIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
-
- while (tem && TREE_PURPOSE (tem) != name)
- {
- memoized_fields_searched[0]++;
- tem = TREE_CHAIN (tem);
- }
- if (tem)
- {
- if (protect && TREE_TYPE (tem))
- {
- error (TREE_STRING_POINTER (TREE_TYPE (tem)),
- IDENTIFIER_POINTER (name),
- TYPE_NAME_STRING (DECL_FIELD_CONTEXT (TREE_VALUE (tem))));
- return error_mark_node;
- }
- if (TREE_VALUE (tem) == NULL_TREE)
- memoized_fast_rejects[0] += 1;
- else
- memoized_fast_finds[0] += 1;
- return TREE_VALUE (tem);
- }
- }
-
#ifdef GATHER_STATISTICS
n_calls_lookup_field++;
#endif /* GATHER_STATISTICS */
- if (protect && flag_memoize_lookups && ! global_bindings_p ())
- entry = make_memoized_table_entry (type, name, 0);
- else
- entry = 0;
rval = lookup_field_1 (type, name);
if (rval || lookup_fnfields_here (type, name) >= 0)
{
- if (entry)
- TREE_VALUE (entry) = rval;
-
if (rval)
{
if (want_type)
@@ -1322,9 +973,6 @@ lookup_field (xbasetype, name, protect, want_type)
}
basetype_chain = build_expr_list (NULL_TREE, basetype_path);
- TREE_VIA_PUBLIC (basetype_chain) = TREE_VIA_PUBLIC (basetype_path);
- TREE_VIA_PROTECTED (basetype_chain) = TREE_VIA_PROTECTED (basetype_path);
- TREE_VIA_VIRTUAL (basetype_chain) = TREE_VIA_VIRTUAL (basetype_path);
/* The ambiguity check relies upon breadth first searching. */
@@ -1347,16 +995,13 @@ lookup_field (xbasetype, name, protect, want_type)
tree btypes;
SET_BINFO_FIELDS_MARKED (base_binfo);
- btypes = my_tree_cons (NULL_TREE, base_binfo, basetype_chain);
- TREE_VIA_PUBLIC (btypes) = TREE_VIA_PUBLIC (base_binfo);
- TREE_VIA_PROTECTED (btypes) = TREE_VIA_PROTECTED (base_binfo);
- TREE_VIA_VIRTUAL (btypes) = TREE_VIA_VIRTUAL (base_binfo);
+ btypes = scratch_tree_cons (NULL_TREE, base_binfo, basetype_chain);
if (TREE_VIA_VIRTUAL (base_binfo))
- btypes = my_tree_cons (NULL_TREE,
+ btypes = scratch_tree_cons (NULL_TREE,
TYPE_BINFO (BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (binfo_h), i))),
btypes);
else
- btypes = my_tree_cons (NULL_TREE,
+ btypes = scratch_tree_cons (NULL_TREE,
TREE_VEC_ELT (BINFO_BASETYPES (binfo_h), i),
btypes);
obstack_ptr_grow (&search_obstack, btypes);
@@ -1375,9 +1020,15 @@ lookup_field (xbasetype, name, protect, want_type)
basetype_chain = TREE_CHAIN (basetype_chain);
basetype_path = TREE_VALUE (basetype_chain);
if (TREE_CHAIN (basetype_chain))
- BINFO_INHERITANCE_CHAIN (basetype_path) = TREE_VALUE (TREE_CHAIN (basetype_chain));
+ my_friendly_assert
+ ((BINFO_INHERITANCE_CHAIN (basetype_path)
+ == TREE_VALUE (TREE_CHAIN (basetype_chain)))
+ /* We only approximate base info for partial instantiations. */
+ || current_template_parms,
+ 980827);
else
- BINFO_INHERITANCE_CHAIN (basetype_path) = NULL_TREE;
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (basetype_path)
+ == NULL_TREE, 980827);
binfo = basetype_path;
type = BINFO_TYPE (binfo);
@@ -1406,7 +1057,7 @@ lookup_field (xbasetype, name, protect, want_type)
if (nval)
{
rval = nval;
- if (entry || protect)
+ if (protect)
this_v = compute_access (basetype_path, rval);
/* These may look ambiguous, but they really are not. */
if (vbase_name_p)
@@ -1433,9 +1084,6 @@ lookup_field (xbasetype, name, protect, want_type)
tree *tp = search_stack->first;
tree *search_tail = tp + tail;
- if (entry)
- TREE_VALUE (entry) = rval;
-
if (rval_binfo)
{
type = BINFO_TYPE (rval_binfo);
@@ -1465,7 +1113,7 @@ lookup_field (xbasetype, name, protect, want_type)
/* If this FIELD_DECL defines its own access level, deal with that. */
if (rval && errstr == 0
- && ((protect&1) || entry)
+ && (protect & 1)
&& DECL_LANG_SPECIFIC (rval)
&& DECL_ACCESS (rval))
{
@@ -1516,21 +1164,6 @@ lookup_field (xbasetype, name, protect, want_type)
}
out:
- if (entry)
- {
- if (errstr)
- {
- tree error_string = my_build_string (errstr);
- /* Save error message with entry. */
- TREE_TYPE (entry) = error_string;
- }
- else
- {
- /* Mark entry as having no error string. */
- TREE_TYPE (entry) = NULL_TREE;
- }
- }
-
if (protect == 2)
{
/* If we are not interested in ambiguities, don't report them,
@@ -1547,9 +1180,8 @@ lookup_field (xbasetype, name, protect, want_type)
/* Do implicit typename stuff. */
if (rval && TREE_CODE (rval) == TYPE_DECL
- && ! DECL_ARTIFICIAL (rval)
&& processing_template_decl
- && BINFO_TYPE (rval_binfo) != current_class_type
+ && ! currently_open_class (BINFO_TYPE (rval_binfo))
&& uses_template_parms (type))
{
binfo = rval_binfo;
@@ -1577,14 +1209,14 @@ lookup_nested_field (name, complain)
register tree t;
tree id = NULL_TREE;
- if (TREE_CHAIN (current_class_type))
+ if (TYPE_MAIN_DECL (current_class_type))
{
/* Climb our way up the nested ladder, seeing if we're trying to
modify a field in an enclosing class. If so, we should only
be able to modify if it's static. */
- for (t = TREE_CHAIN (current_class_type);
+ for (t = TYPE_MAIN_DECL (current_class_type);
t && DECL_CONTEXT (t);
- t = TREE_CHAIN (DECL_CONTEXT (t)))
+ t = TYPE_MAIN_DECL (DECL_CONTEXT (t)))
{
if (TREE_CODE (DECL_CONTEXT (t)) != RECORD_TYPE)
break;
@@ -1657,32 +1289,40 @@ lookup_fnfields_1 (type, name)
if (*++methods && name == dtor_identifier)
return 1;
- while (++methods != end)
+ while (++methods != end && *methods)
{
#ifdef GATHER_STATISTICS
n_outer_fields_searched++;
#endif /* GATHER_STATISTICS */
- if (DECL_NAME (*methods) == name)
+ if (DECL_NAME (OVL_CURRENT (*methods)) == name)
break;
}
/* If we didn't find it, it might have been a template
conversion operator. (Note that we don't look for this case
above so that we will always find specializations first.) */
- if (methods == end
+ if ((methods == end || !*methods)
&& IDENTIFIER_TYPENAME_P (name))
{
methods = &TREE_VEC_ELT (method_vec, 0) + 1;
- while (++methods != end)
+ while (++methods != end && *methods)
{
- if (TREE_CODE (*methods) == TEMPLATE_DECL
- && IDENTIFIER_TYPENAME_P (DECL_NAME (*methods)))
+ tree method_name = DECL_NAME (OVL_CURRENT (*methods));
+
+ if (!IDENTIFIER_TYPENAME_P (method_name))
+ {
+ /* Since all conversion operators come first, we know
+ there is no such operator. */
+ methods = end;
+ break;
+ }
+ else if (TREE_CODE (OVL_CURRENT (*methods)) == TEMPLATE_DECL)
break;
}
}
- if (methods != end)
+ if (methods != end && *methods)
return methods - &TREE_VEC_ELT (method_vec, 0);
}
@@ -1715,8 +1355,8 @@ lookup_fnfields (basetype_path, name, complain)
{
int head = 0, tail = 0;
tree type, rval, rval_binfo = NULL_TREE, rvals = NULL_TREE;
- tree rval_binfo_h = NULL_TREE, entry, binfo, basetype_chain, binfo_h;
- int find_all = 0;
+ tree rval_binfo_h = NULL_TREE, binfo, basetype_chain, binfo_h;
+ int idx, find_all = 0;
/* rval_binfo is the binfo associated with the found member, note,
this can be set with useful information, even when rval is not
@@ -1737,10 +1377,6 @@ lookup_fnfields (basetype_path, name, complain)
char *errstr = 0;
- /* Set this to nonzero if we don't know how to compute
- accurate error messages for access control. */
- int idx = MEMOIZED_HASH_FN (name);
-
if (complain == -1)
{
find_all = 1;
@@ -1760,65 +1396,9 @@ lookup_fnfields (basetype_path, name, complain)
binfo_h = binfo;
type = complete_type (BINFO_TYPE (basetype_path));
- /* The memoization code is in need of maintenance. */
- if (!find_all && CLASSTYPE_MTABLE_ENTRY (type))
- {
- tree tem = MEMOIZED_FNFIELDS (CLASSTYPE_MTABLE_ENTRY (type), idx);
-
- while (tem && TREE_PURPOSE (tem) != name)
- {
- memoized_fields_searched[1]++;
- tem = TREE_CHAIN (tem);
- }
- if (tem)
- {
- if (protect && TREE_TYPE (tem))
- {
- error (TREE_STRING_POINTER (TREE_TYPE (tem)),
- IDENTIFIER_POINTER (name),
- TYPE_NAME_STRING (DECL_CLASS_CONTEXT (TREE_VALUE (TREE_VALUE (tem)))));
- return error_mark_node;
- }
- if (TREE_VALUE (tem) == NULL_TREE)
- {
- memoized_fast_rejects[1] += 1;
- return NULL_TREE;
- }
- else
- {
- /* Want to return this, but we must make sure
- that access information is consistent. */
- tree baselink = TREE_VALUE (tem);
- tree memoized_basetypes = TREE_PURPOSE (baselink);
- tree these_basetypes = basetype_path;
- while (memoized_basetypes && these_basetypes)
- {
- memoized_fields_searched[1]++;
- if (TREE_VALUE (memoized_basetypes) != these_basetypes)
- break;
- memoized_basetypes = TREE_CHAIN (memoized_basetypes);
- these_basetypes = BINFO_INHERITANCE_CHAIN (these_basetypes);
- }
- /* The following statement is true only when both are NULL. */
- if (memoized_basetypes == these_basetypes)
- {
- memoized_fast_finds[1] += 1;
- return TREE_VALUE (tem);
- }
- /* else, we must re-find this field by hand. */
- baselink = tree_cons (basetype_path, TREE_VALUE (baselink), TREE_CHAIN (baselink));
- return baselink;
- }
- }
- }
-
#ifdef GATHER_STATISTICS
n_calls_lookup_fnfields++;
#endif /* GATHER_STATISTICS */
- if (protect && flag_memoize_lookups && ! global_bindings_p ())
- entry = make_memoized_table_entry (type, name, 1);
- else
- entry = 0;
idx = lookup_fnfields_here (type, name);
if (idx >= 0 || lookup_field_1 (type, name))
@@ -1830,16 +1410,10 @@ lookup_fnfields (basetype_path, name, complain)
if (idx >= 0)
{
rval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
- rvals = my_tree_cons (basetype_path, rval, rvals);
+ rvals = scratch_tree_cons (basetype_path, rval, rvals);
if (BINFO_BASETYPES (binfo) && CLASSTYPE_BASELINK_VEC (type))
TREE_TYPE (rvals) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
- if (entry)
- {
- TREE_VALUE (entry) = rvals;
- TREE_TYPE (entry) = NULL_TREE;
- }
-
return rvals;
}
rval = NULL_TREE;
@@ -1848,26 +1422,17 @@ lookup_fnfields (basetype_path, name, complain)
{
/* Don't allow lookups of constructors and destructors to go
deeper than the first place we look. */
- if (entry)
- TREE_TYPE (entry) = TREE_VALUE (entry) = NULL_TREE;
-
return NULL_TREE;
}
if (basetype_path == TYPE_BINFO (type))
{
basetype_chain = CLASSTYPE_BINFO_AS_LIST (type);
- TREE_VIA_PUBLIC (basetype_chain) = 1;
- BINFO_VIA_PUBLIC (basetype_path) = 1;
- BINFO_INHERITANCE_CHAIN (basetype_path) = NULL_TREE;
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (basetype_path) == NULL_TREE,
+ 980827);
}
else
- {
- basetype_chain = build_expr_list (NULL_TREE, basetype_path);
- TREE_VIA_PUBLIC (basetype_chain) = TREE_VIA_PUBLIC (basetype_path);
- TREE_VIA_PROTECTED (basetype_chain) = TREE_VIA_PROTECTED (basetype_path);
- TREE_VIA_VIRTUAL (basetype_chain) = TREE_VIA_VIRTUAL (basetype_path);
- }
+ basetype_chain = build_expr_list (NULL_TREE, basetype_path);
/* The ambiguity check relies upon breadth first searching. */
@@ -1890,16 +1455,13 @@ lookup_fnfields (basetype_path, name, complain)
tree btypes;
SET_BINFO_FIELDS_MARKED (base_binfo);
- btypes = my_tree_cons (NULL_TREE, base_binfo, basetype_chain);
- TREE_VIA_PUBLIC (btypes) = TREE_VIA_PUBLIC (base_binfo);
- TREE_VIA_PROTECTED (btypes) = TREE_VIA_PROTECTED (base_binfo);
- TREE_VIA_VIRTUAL (btypes) = TREE_VIA_VIRTUAL (base_binfo);
+ btypes = scratch_tree_cons (NULL_TREE, base_binfo, basetype_chain);
if (TREE_VIA_VIRTUAL (base_binfo))
- btypes = my_tree_cons (NULL_TREE,
+ btypes = scratch_tree_cons (NULL_TREE,
TYPE_BINFO (BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (binfo_h), i))),
btypes);
else
- btypes = my_tree_cons (NULL_TREE,
+ btypes = scratch_tree_cons (NULL_TREE,
TREE_VEC_ELT (BINFO_BASETYPES (binfo_h), i),
btypes);
obstack_ptr_grow (&search_obstack, btypes);
@@ -1918,9 +1480,15 @@ lookup_fnfields (basetype_path, name, complain)
basetype_chain = TREE_CHAIN (basetype_chain);
basetype_path = TREE_VALUE (basetype_chain);
if (TREE_CHAIN (basetype_chain))
- BINFO_INHERITANCE_CHAIN (basetype_path) = TREE_VALUE (TREE_CHAIN (basetype_chain));
+ my_friendly_assert
+ ((BINFO_INHERITANCE_CHAIN (basetype_path)
+ == TREE_VALUE (TREE_CHAIN (basetype_chain)))
+ /* We only approximate base info for partial instantiations. */
+ || current_template_parms,
+ 980827);
else
- BINFO_INHERITANCE_CHAIN (basetype_path) = NULL_TREE;
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (basetype_path)
+ == NULL_TREE, 980827);
binfo = basetype_path;
type = BINFO_TYPE (binfo);
@@ -1947,7 +1515,7 @@ lookup_fnfields (basetype_path, name, complain)
rval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
/* Note, rvals can only be previously set if find_all is
true. */
- rvals = my_tree_cons (basetype_path, rval, rvals);
+ rvals = scratch_tree_cons (basetype_path, rval, rvals);
if (TYPE_BINFO_BASETYPES (type)
&& CLASSTYPE_BASELINK_VEC (type))
TREE_TYPE (rvals) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
@@ -1982,22 +1550,6 @@ lookup_fnfields (basetype_path, name, complain)
}
search_stack = pop_search_level (search_stack);
- if (entry)
- {
- if (errstr)
- {
- tree error_string = my_build_string (errstr);
- /* Save error message with entry. */
- TREE_TYPE (entry) = error_string;
- }
- else
- {
- /* Mark entry as having no error string. */
- TREE_TYPE (entry) = NULL_TREE;
- TREE_VALUE (entry) = rvals;
- }
- }
-
if (errstr && protect)
{
cp_error (errstr, name);
@@ -2006,6 +1558,35 @@ lookup_fnfields (basetype_path, name, complain)
return rvals;
}
+
+/* Look for a field or function named NAME in an inheritance lattice
+ dominated by XBASETYPE. PROTECT is zero if we can avoid computing
+ access information, otherwise it is 1. WANT_TYPE is 1 when we should
+ only return TYPE_DECLs, if no TYPE_DECL can be found return NULL_TREE. */
+
+tree
+lookup_member (xbasetype, name, protect, want_type)
+ tree xbasetype, name;
+ int protect, want_type;
+{
+ tree ret, basetype_path;
+
+ if (TREE_CODE (xbasetype) == TREE_VEC)
+ basetype_path = xbasetype;
+ else if (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)))
+ {
+ basetype_path = TYPE_BINFO (xbasetype);
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (basetype_path)
+ == NULL_TREE, 980827);
+ }
+ else
+ my_friendly_abort (97);
+
+ ret = lookup_field (basetype_path, name, protect, want_type);
+ if (! ret && ! want_type)
+ ret = lookup_fnfields (basetype_path, name, protect);
+ return ret;
+}
/* BREADTH-FIRST SEARCH ROUTINES. */
@@ -2101,8 +1682,8 @@ get_virtuals_named_this (binfo)
{
tree fndecl;
- for (fndecl = TREE_VALUE (fields); fndecl; fndecl = DECL_CHAIN (fndecl))
- if (DECL_VINDEX (fndecl))
+ for (fndecl = TREE_VALUE (fields); fndecl; fndecl = OVL_NEXT (fndecl))
+ if (DECL_VINDEX (OVL_CURRENT (fndecl)))
return fields;
fields = next_baselink (fields);
}
@@ -2134,6 +1715,62 @@ tree_has_any_destructor_p (binfo, i)
return TYPE_NEEDS_DESTRUCTOR (type);
}
+/* 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;
+
+ if (TREE_CODE (brettype) == FUNCTION_DECL
+ || TREE_CODE (brettype) == THUNK_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 (comptypes (brettype, drettype, 1))
+ return 0;
+
+ if (! (TREE_CODE (brettype) == TREE_CODE (drettype)
+ && (TREE_CODE (brettype) == POINTER_TYPE
+ || TREE_CODE (brettype) == REFERENCE_TYPE)
+ && TYPE_READONLY (brettype) == TYPE_READONLY (drettype)
+ && TYPE_VOLATILE (brettype) == TYPE_VOLATILE (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 = get_binfo (brettype, drettype, 1);
+
+ /* If we get an error_mark_node from get_binfo, it already complained,
+ so let's just succeed. */
+ if (binfo == error_mark_node)
+ return 1;
+
+ if (! BINFO_OFFSET_ZEROP (binfo) || TREE_VIA_VIRTUAL (binfo))
+ return 2;
+ return 1;
+}
+
/* Given a class type TYPE, and a function decl FNDECL, look for a
virtual function in TYPE's hierarchy which FNDECL could match as a
virtual function. It doesn't matter which one we find.
@@ -2147,6 +1784,14 @@ get_matching_virtual (binfo, fndecl, dtorp)
int dtorp;
{
tree tmp = NULL_TREE;
+ int i;
+
+ if (TREE_CODE (fndecl) == TEMPLATE_DECL)
+ /* In [temp.mem] we have:
+
+ A specialization of a member function template does not
+ override a virtual function from a base class. */
+ return NULL_TREE;
/* Breadth first search routines start searching basetypes
of TYPE, so we must perform first ply of search here. */
@@ -2187,8 +1832,10 @@ get_matching_virtual (binfo, fndecl, dtorp)
for (; baselink; baselink = next_baselink (baselink))
{
- for (tmp = TREE_VALUE (baselink); tmp; tmp = DECL_CHAIN (tmp))
+ tree tmps;
+ for (tmps = TREE_VALUE (baselink); tmps; tmps = OVL_NEXT (tmps))
{
+ tmp = OVL_CURRENT (tmps);
if (! DECL_VINDEX (tmp))
continue;
@@ -2208,36 +1855,15 @@ get_matching_virtual (binfo, fndecl, dtorp)
tree brettype = TREE_TYPE (TREE_TYPE (tmp));
if (comptypes (brettype, drettype, 1))
/* OK */;
- else if
- (TREE_CODE (brettype) == TREE_CODE (drettype)
- && (TREE_CODE (brettype) == POINTER_TYPE
- || TREE_CODE (brettype) == REFERENCE_TYPE)
- && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (brettype)),
- TYPE_MAIN_VARIANT (TREE_TYPE (drettype)),
- 0))
- /* covariant return type */
+ else if ((i = covariant_return_p (brettype, drettype)))
{
- tree b = TREE_TYPE (brettype), d = TREE_TYPE (drettype);
- if (TYPE_MAIN_VARIANT (b) != TYPE_MAIN_VARIANT (d))
- {
- tree binfo = get_binfo (b, d, 1);
- if (binfo != error_mark_node
- && (! BINFO_OFFSET_ZEROP (binfo)
- || TREE_VIA_VIRTUAL (binfo)))
- sorry ("adjusting pointers for covariant returns");
- }
- if (TYPE_READONLY (d) > TYPE_READONLY (b))
- {
- cp_error_at ("return type of `%#D' adds const", fndecl);
- cp_error_at (" overriding definition as `%#D'",
- tmp);
- }
- else if (TYPE_VOLATILE (d) > TYPE_VOLATILE (b))
+ if (i == 2)
+ sorry ("adjusting pointers for covariant returns");
+
+ if (pedantic && i == -1)
{
- cp_error_at ("return type of `%#D' adds volatile",
- fndecl);
- cp_error_at (" overriding definition as `%#D'",
- tmp);
+ cp_pedwarn_at ("invalid covariant return type for `%#D' (must be pointer or reference to class)", fndecl);
+ cp_pedwarn_at (" overriding `%#D'", tmp);
}
}
else if (IS_AGGR_TYPE_2 (brettype, drettype)
@@ -2256,7 +1882,8 @@ get_matching_virtual (binfo, fndecl, dtorp)
break;
}
}
- if (tmp)
+ /* If not at the end */
+ if (tmps)
{
best = tmp;
break;
@@ -2431,33 +2058,6 @@ next_baselink (baselink)
/* DEPTH-FIRST SEARCH ROUTINES. */
-#ifdef MI_MATRIX
-/* Assign unique numbers to _CLASSTYPE members of the lattice
- specified by TYPE. The root nodes are marked first; the nodes
- are marked depth-fisrt, left-right. */
-
-static int cid;
-
-/* Matrix implementing a relation from CLASSTYPE X CLASSTYPE => INT.
- Relation yields 1 if C1 <= C2, 0 otherwise. */
-typedef char mi_boolean;
-static mi_boolean *mi_matrix;
-
-/* Type for which this matrix is defined. */
-static tree mi_type;
-
-/* Size of the matrix for indexing purposes. */
-static int mi_size;
-
-/* Return nonzero if class C2 derives from class C1. */
-#define BINFO_DERIVES_FROM(C1, C2) \
- ((mi_matrix+mi_size*(BINFO_CID (C1)-1))[BINFO_CID (C2)-1])
-#define TYPE_DERIVES_FROM(C1, C2) \
- ((mi_matrix+mi_size*(CLASSTYPE_CID (C1)-1))[CLASSTYPE_CID (C2)-1])
-#define BINFO_DERIVES_FROM_STAR(C) \
- (mi_matrix+(BINFO_CID (C)-1))
-#endif
-
/* This routine converts a pointer to be a pointer of an immediate
base class. The normal convert_pointer_to routine would diagnose
the conversion as ambiguous, under MI code that has the base class
@@ -2472,9 +2072,12 @@ convert_pointer_to_single_level (to_type, expr)
binfo_of_derived = TYPE_BINFO (TREE_TYPE (TREE_TYPE (expr)));
last = get_binfo (to_type, TREE_TYPE (TREE_TYPE (expr)), 0);
- BINFO_INHERITANCE_CHAIN (last) = binfo_of_derived;
- BINFO_INHERITANCE_CHAIN (binfo_of_derived) = NULL_TREE;
- return build_vbase_path (PLUS_EXPR, build_pointer_type (to_type), expr, last, 1);
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (last) == binfo_of_derived,
+ 980827);
+ my_friendly_assert (BINFO_INHERITANCE_CHAIN (binfo_of_derived) == NULL_TREE,
+ 980827);
+ return build_vbase_path (PLUS_EXPR, build_pointer_type (to_type), expr,
+ last, 1);
}
/* The main function which implements depth first search.
@@ -2547,13 +2150,40 @@ dfs_walk (binfo, fn, qfn)
fn (binfo);
}
-#ifdef MI_MATRIX
-/* Predicate functions which serve for dfs_walk. */
-static int numberedp (binfo) tree binfo;
-{ return BINFO_CID (binfo); }
-static int unnumberedp (binfo) tree binfo;
-{ return BINFO_CID (binfo) == 0; }
-#endif
+/* Like dfs_walk, but only walk until fn returns something, and return
+ that. We also use the real vbase binfos instead of the placeholders
+ in the normal binfo hierarchy. START is the most-derived type for this
+ hierarchy, so that we can find the vbase binfos. */
+
+static tree
+dfs_search (binfo, fn, start)
+ tree binfo, start;
+ tree (*fn) PROTO((tree));
+{
+ tree binfos = BINFO_BASETYPES (binfo);
+ int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
+ tree retval;
+
+ for (i = 0; i < n_baselinks; i++)
+ {
+ tree base_binfo = TREE_VEC_ELT (binfos, i);
+
+ if (TREE_CODE (BINFO_TYPE (base_binfo)) == TEMPLATE_TYPE_PARM
+ || TREE_CODE (BINFO_TYPE (base_binfo)) == TEMPLATE_TEMPLATE_PARM)
+ /* Pass */;
+ else
+ {
+ if (TREE_VIA_VIRTUAL (base_binfo) && start)
+ base_binfo = binfo_member (BINFO_TYPE (base_binfo),
+ CLASSTYPE_VBASECLASSES (start));
+ retval = dfs_search (base_binfo, fn, start);
+ if (retval)
+ return retval;
+ }
+ }
+
+ return fn (binfo);
+}
static int markedp (binfo) tree binfo;
{ return BINFO_MARKED (binfo); }
@@ -2583,6 +2213,10 @@ static int marked_new_vtablep (binfo) tree binfo;
{ return BINFO_NEW_VTABLE_MARKED (binfo); }
static int unmarked_new_vtablep (binfo) tree binfo;
{ return BINFO_NEW_VTABLE_MARKED (binfo) == 0; }
+static int marked_pushdecls_p (binfo) tree binfo;
+{ return BINFO_PUSHDECLS_MARKED (binfo); }
+static int unmarked_pushdecls_p (binfo) tree binfo;
+{ return BINFO_PUSHDECLS_MARKED (binfo) == 0; }
#if 0
static int dfs_search_slot_nonempty_p (binfo) tree binfo;
@@ -2596,25 +2230,6 @@ static int dfs_debug_unmarkedp (binfo) tree binfo;
test anything (vis a vis marking) if they are paired with
a predicate function (above). */
-#ifdef MI_MATRIX
-/* Assign each type within the lattice a number which is unique
- in the lattice. The first number assigned is 1. */
-
-static void
-dfs_number (binfo)
- tree binfo;
-{
- BINFO_CID (binfo) = ++cid;
-}
-
-static void
-dfs_unnumber (binfo)
- tree binfo;
-{
- BINFO_CID (binfo) = 0;
-}
-#endif
-
#if 0
static void
dfs_mark (binfo) tree binfo;
@@ -2664,8 +2279,7 @@ dfs_debug_mark (binfo)
/* If interface info is known, either we've already emitted the debug
info or we don't need to. */
- if (CLASSTYPE_INTERFACE_KNOWN (t)
- || (write_virtuals == 2 && TYPE_VIRTUAL_P (t)))
+ if (CLASSTYPE_INTERFACE_KNOWN (t))
return;
/* If debug info is requested from this context for this type, supply it.
@@ -2680,6 +2294,7 @@ dfs_debug_mark (binfo)
methods = TREE_VEC_ELT (methods, 0);
else
methods = TREE_VEC_ELT (methods, 2);
+ methods = OVL_CURRENT (methods);
while (methods)
{
if (DECL_VINDEX (methods)
@@ -2697,7 +2312,7 @@ dfs_debug_mark (binfo)
/* We cannot rely on some alien method to solve our problems,
so we must write out the debug info ourselves. */
TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (t)) = 0;
- rest_of_type_compilation (t, global_bindings_p ());
+ rest_of_type_compilation (t, toplevel_bindings_p ());
}
/* Attach to the type of the virtual base class, the pointer to the
@@ -2915,32 +2530,43 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
|| nvtbl == IDENTIFIER_GLOBAL_VALUE (DECL_NAME (vtbl)))
{
/* Dup it if it isn't in local scope yet. */
- nvtbl = build_decl (VAR_DECL,
- DECL_NAME (vtbl),
- TYPE_MAIN_VARIANT (TREE_TYPE (BINFO_VTABLE (binfo))));
+ nvtbl = build_decl
+ (VAR_DECL, DECL_NAME (vtbl),
+ TYPE_MAIN_VARIANT (TREE_TYPE (BINFO_VTABLE (binfo))));
DECL_ALIGN (nvtbl) = MAX (TYPE_ALIGN (double_type_node),
DECL_ALIGN (nvtbl));
TREE_READONLY (nvtbl) = 0;
DECL_ARTIFICIAL (nvtbl) = 1;
nvtbl = pushdecl (nvtbl);
init = NULL_TREE;
- cp_finish_decl (nvtbl, init, NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
- DECL_VIRTUAL_P (nvtbl) = 1;
- DECL_CONTEXT (nvtbl) = t;
+ cp_finish_decl (nvtbl, init, NULL_TREE, 0,
+ LOOKUP_ONLYCONVERTING);
+
+ /* We don't set DECL_VIRTUAL_P and DECL_CONTEXT on nvtbl
+ because they wouldn't be useful; everything that wants to
+ look at the vtable will look at the decl for the normal
+ vtable. Setting DECL_CONTEXT also screws up
+ decl_function_context. */
+
init = build (MODIFY_EXPR, TREE_TYPE (nvtbl),
nvtbl, vtbl);
TREE_SIDE_EFFECTS (init) = 1;
expand_expr_stmt (init);
/* Update the vtable pointers as necessary. */
- ref = build_vfield_ref (build_indirect_ref (addr, NULL_PTR), DECL_CONTEXT (CLASSTYPE_VFIELD (BINFO_TYPE (binfo))));
- expand_expr_stmt (build_modify_expr (ref, NOP_EXPR,
- build_unary_op (ADDR_EXPR, nvtbl, 0)));
+ ref = build_vfield_ref
+ (build_indirect_ref (addr, NULL_PTR),
+ DECL_CONTEXT (CLASSTYPE_VFIELD (BINFO_TYPE (binfo))));
+ expand_expr_stmt
+ (build_modify_expr (ref, NOP_EXPR,
+ build_unary_op (ADDR_EXPR, nvtbl, 0)));
}
assemble_external (vtbl);
aref = build_array_ref (vtbl, idx);
naref = build_array_ref (nvtbl, idx);
- old_delta = build_component_ref (aref, delta_identifier, NULL_TREE, 0);
- new_delta = build_component_ref (naref, delta_identifier, NULL_TREE, 0);
+ old_delta = build_component_ref (aref, delta_identifier,
+ NULL_TREE, 0);
+ new_delta = build_component_ref (naref, delta_identifier,
+ NULL_TREE, 0);
/* This is a upcast, so we have to add the offset for the
virtual base. */
@@ -2970,6 +2596,9 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
}
TREE_READONLY (new_delta) = 0;
+ TREE_TYPE (new_delta) =
+ cp_build_type_variant (TREE_TYPE (new_delta), /*constp=*/0,
+ TYPE_VOLATILE (TREE_TYPE (new_delta)));
expand_expr_stmt (build_modify_expr (new_delta, NOP_EXPR,
old_delta));
}
@@ -3039,6 +2668,17 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr)
{
tree type = BINFO_TYPE (binfo);
+ /* This function executes during the finish_function() segment,
+ AFTER the auto variables and temporary stack space has been marked
+ unused...If space is needed for the virtual function tables,
+ some of them might fit within what the compiler now thinks
+ are available stack slots... These values are actually initialized at
+ the beginnning of the function, so when the automatics use their space,
+ they will overwrite the values that are placed here. Marking all
+ temporary space as unavailable prevents this from happening. */
+
+ mark_all_temps_used();
+
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
{
rtx fixup_insns = NULL_RTX;
@@ -3114,10 +2754,12 @@ dfs_get_vbase_types (binfo)
{
if (TREE_VIA_VIRTUAL (binfo) && ! BINFO_VBASE_MARKED (binfo))
{
- vbase_types = make_binfo (integer_zero_node, binfo,
- BINFO_VTABLE (binfo),
- BINFO_VIRTUALS (binfo), vbase_types);
- TREE_VIA_VIRTUAL (vbase_types) = 1;
+ tree new_vbase = make_binfo (integer_zero_node, binfo,
+ BINFO_VTABLE (binfo),
+ BINFO_VIRTUALS (binfo));
+ TREE_CHAIN (new_vbase) = vbase_types;
+ TREE_VIA_VIRTUAL (new_vbase) = 1;
+ vbase_types = new_vbase;
SET_BINFO_VBASE_MARKED (binfo);
}
SET_BINFO_MARKED (binfo);
@@ -3132,11 +2774,7 @@ get_vbase_types (type)
tree vbases;
tree binfo;
- if (TREE_CODE (type) == TREE_VEC)
- binfo = type;
- else
- binfo = TYPE_BINFO (type);
-
+ binfo = TYPE_BINFO (type);
vbase_types = NULL_TREE;
dfs_walk (binfo, dfs_get_vbase_types, unmarkedp);
dfs_walk (binfo, dfs_unmark, markedp);
@@ -3151,95 +2789,6 @@ get_vbase_types (type)
return vbase_types;
}
-#ifdef MI_MATRIX
-static void
-dfs_record_inheritance (binfo)
- tree binfo;
-{
- tree binfos = BINFO_BASETYPES (binfo);
- int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
- mi_boolean *derived_row = BINFO_DERIVES_FROM_STAR (binfo);
-
- for (i = n_baselinks-1; i >= 0; i--)
- {
- int j;
- tree base_binfo = TREE_VEC_ELT (binfos, i);
- tree baseclass = BINFO_TYPE (base_binfo);
- mi_boolean *base_row = BINFO_DERIVES_FROM_STAR (base_binfo);
-
- if (TREE_CODE (baseclass) == TEMPLATE_TYPE_PARM
- || TREE_CODE (baseclass) == TEMPLATE_TEMPLATE_PARM)
- continue;
- my_friendly_assert (CLASSTYPE_CID (baseclass) != 0, 2365);
-
- /* Don't search if there's nothing there! MI_SIZE can be
- zero as a result of parse errors. */
- if (TYPE_BINFO_BASETYPES (baseclass) && mi_size > 0)
- for (j = mi_size*(CLASSTYPE_CID (baseclass)-1); j >= 0; j -= mi_size)
- derived_row[j] |= base_row[j];
- TYPE_DERIVES_FROM (baseclass, BINFO_TYPE (binfo)) = 1;
- }
-
- SET_BINFO_MARKED (binfo);
-}
-
-/* Given a _CLASSTYPE node in a multiple inheritance lattice,
- convert the lattice into a simple relation such that,
- given to CIDs, C1 and C2, one can determine if C1 <= C2
- or C2 <= C1 or C1 <> C2.
-
- Once constructed, we walk the lattice depth fisrt,
- applying various functions to elements as they are encountered.
-
- We use xmalloc here, in case we want to randomly free these tables. */
-
-#define SAVE_MI_MATRIX
-
-void
-build_mi_matrix (type)
- tree type;
-{
- tree binfo = TYPE_BINFO (type);
- cid = 0;
-
-#ifdef SAVE_MI_MATRIX
- if (CLASSTYPE_MI_MATRIX (type))
- {
- mi_size = CLASSTYPE_N_SUPERCLASSES (type) + CLASSTYPE_N_VBASECLASSES (type);
- mi_matrix = CLASSTYPE_MI_MATRIX (type);
- mi_type = type;
- dfs_walk (binfo, dfs_number, unnumberedp);
- return;
- }
-#endif
-
- dfs_walk (binfo, dfs_number, unnumberedp);
-
- mi_size = CLASSTYPE_N_SUPERCLASSES (type) + CLASSTYPE_N_VBASECLASSES (type);
- if (mi_size < (cid-1))
- mi_size = cid-1;
- mi_matrix = (char *)xmalloc ((mi_size + 1) * (mi_size + 1));
- mi_type = type;
- bzero (mi_matrix, (mi_size + 1) * (mi_size + 1));
- dfs_walk (binfo, dfs_record_inheritance, unmarkedp);
- dfs_walk (binfo, dfs_unmark, markedp);
-}
-
-void
-free_mi_matrix ()
-{
- dfs_walk (TYPE_BINFO (mi_type), dfs_unnumber, numberedp);
-
-#ifdef SAVE_MI_MATRIX
- CLASSTYPE_MI_MATRIX (mi_type) = mi_matrix;
-#else
- free (mi_matrix);
- mi_size = 0;
- cid = 0;
-#endif
-}
-#endif
-
/* If we want debug info for a type TYPE, make sure all its base types
are also marked as being potentially interesting. This avoids
the problem of not writing any debug info for intermediate basetypes
@@ -3288,6 +2837,12 @@ envelope_add_decl (type, decl, values)
tree name = DECL_NAME (decl);
int dont_add = 0;
+ /* Yet Another Implicit Typename Kludge: Since we don't tsubst
+ the members for partial instantiations, DECL_CONTEXT (decl) is wrong.
+ But pretend it's right for this function. */
+ if (processing_template_decl)
+ type = DECL_REAL_CONTEXT (decl);
+
/* virtual base names are always unique. */
if (VBASE_NAME_P (name))
*values = NULL_TREE;
@@ -3309,10 +2864,7 @@ envelope_add_decl (type, decl, values)
warning ("in this context");
}
- context = (TREE_CODE (value) == FUNCTION_DECL
- && DECL_VIRTUAL_P (value))
- ? DECL_CLASS_CONTEXT (value)
- : DECL_CONTEXT (value);
+ context = DECL_REAL_CONTEXT (value);
if (context == type)
{
@@ -3323,16 +2875,7 @@ envelope_add_decl (type, decl, values)
dont_add = 1;
}
else if (type == current_class_type
-#ifdef MI_MATRIX
- /* If we don't check CLASSTYPE_CID on CONTEXT right now,
- we'll end up subtracting from the address of MI_MATRIX,
- putting us off in la la land. */
- || (CLASSTYPE_CID (type)
- && TYPE_DERIVES_FROM (context, type))
-#else
- || DERIVED_FROM_P (context, type)
-#endif
- )
+ || DERIVED_FROM_P (context, type))
{
/* Don't add in *values to list */
*values = NULL_TREE;
@@ -3351,16 +2894,7 @@ envelope_add_decl (type, decl, values)
: DECL_CONTEXT (value);
if (type == current_class_type
-#ifdef MI_MATRIX
- /* If we don't check CLASSTYPE_CID on CONTEXT right now,
- we'll end up subtracting from the address of MI_MATRIX,
- putting us off in la la land. */
- || (CLASSTYPE_CID (type)
- && TYPE_DERIVES_FROM (context, type))
-#else
- || DERIVED_FROM_P (context, type)
-#endif
- )
+ || DERIVED_FROM_P (context, type))
{
/* remove *tmp from list */
*tmp = TREE_CHAIN (*tmp);
@@ -3395,6 +2929,23 @@ envelope_add_decl (type, decl, values)
}
}
+/* Returns 1 iff BINFO is a base we shouldn't really be able to see into,
+ because it (or one of the intermediate bases) depends on template parms. */
+
+static int
+dependent_base_p (binfo)
+ tree binfo;
+{
+ for (; binfo; binfo = BINFO_INHERITANCE_CHAIN (binfo))
+ {
+ if (TREE_TYPE (binfo) == current_class_type)
+ break;
+ if (uses_template_parms (TREE_TYPE (binfo)))
+ return 1;
+ }
+ return 0;
+}
+
/* Add the instance variables which this class contributed to the
current class binding contour. When a redefinition occurs, if the
redefinition is strictly within a single inheritance path, we just
@@ -3419,11 +2970,20 @@ dfs_pushdecls (binfo)
tree binfo;
{
tree type = BINFO_TYPE (binfo);
- tree fields, *methods, *end;
+ tree fields;
tree method_vec;
+ int dummy = 0;
+
+ /* Only record types if we're a template base. */
+ if (processing_template_decl && type != current_class_type
+ && dependent_base_p (binfo))
+ dummy = 1;
for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
{
+ if (dummy && TREE_CODE (fields) != TYPE_DECL)
+ continue;
+
/* Unmark so that if we are in a constructor, and then find that
this field was initialized by a base initializer,
we can emit an error message. */
@@ -3461,18 +3021,26 @@ dfs_pushdecls (binfo)
}
method_vec = CLASSTYPE_METHOD_VEC (type);
- if (method_vec)
+ if (method_vec && ! dummy)
{
+ tree *methods;
+ tree *end;
+
/* Farm out constructors and destructors. */
- methods = &TREE_VEC_ELT (method_vec, 2);
end = TREE_VEC_END (method_vec);
- while (methods != end)
+ for (methods = &TREE_VEC_ELT (method_vec, 2);
+ *methods && methods != end;
+ methods++)
{
/* This will cause lookup_name to return a pointer
to the tree_list of possible methods of this name. */
- tree name = DECL_NAME (*methods);
- tree class_value = IDENTIFIER_CLASS_VALUE (name);
+ tree name;
+ tree class_value;
+
+
+ name = DECL_NAME (OVL_CURRENT (*methods));
+ class_value = IDENTIFIER_CLASS_VALUE (name);
/* If the class value is not an envelope of the kind described in
the comment above, we create a new envelope. */
@@ -3491,13 +3059,18 @@ dfs_pushdecls (binfo)
If we can't do that, keep a TREE_LIST with possibly ambiguous
decls in there. */
maybe_push_cache_obstack ();
- envelope_add_decl (type, *methods, &TREE_PURPOSE (class_value));
+ /* Arbitrarily choose the first function in the list. This is OK
+ because this is only used for initial lookup; anything that
+ actually uses the function will look it up again. */
+ envelope_add_decl (type, OVL_CURRENT (*methods),
+ &TREE_PURPOSE (class_value));
pop_obstacks ();
-
- methods++;
}
}
- SET_BINFO_MARKED (binfo);
+
+ /* We can't just use BINFO_MARKED because envelope_add_decl uses
+ DERIVED_FROM_P, which calls get_base_distance. */
+ SET_BINFO_PUSHDECLS_MARKED (binfo);
}
/* Consolidate unique (by name) member functions. */
@@ -3509,17 +3082,22 @@ dfs_compress_decls (binfo)
tree type = BINFO_TYPE (binfo);
tree method_vec = CLASSTYPE_METHOD_VEC (type);
- if (method_vec != 0)
+ if (processing_template_decl && type != current_class_type
+ && dependent_base_p (binfo))
+ /* We only record types if we're a template base. */;
+ else if (method_vec != 0)
{
/* Farm out constructors and destructors. */
- tree *methods = &TREE_VEC_ELT (method_vec, 2);
+ tree *methods;
tree *end = TREE_VEC_END (method_vec);
- for (; methods != end; methods++)
+ for (methods = &TREE_VEC_ELT (method_vec, 2);
+ methods != end && *methods; methods++)
{
/* This is known to be an envelope of the kind described before
dfs_pushdecls. */
- tree class_value = IDENTIFIER_CLASS_VALUE (DECL_NAME (*methods));
+ tree class_value =
+ IDENTIFIER_CLASS_VALUE (DECL_NAME (OVL_CURRENT (*methods)));
tree tmp = TREE_PURPOSE (class_value);
/* This was replaced in scope by somebody else. Just leave it
@@ -3529,13 +3107,13 @@ dfs_compress_decls (binfo)
if (TREE_CHAIN (tmp) == NULL_TREE
&& TREE_VALUE (tmp)
- && DECL_CHAIN (TREE_VALUE (tmp)) == NULL_TREE)
+ && OVL_NEXT (TREE_VALUE (tmp)) == NULL_TREE)
{
TREE_PURPOSE (class_value) = TREE_VALUE (tmp);
}
}
}
- CLEAR_BINFO_MARKED (binfo);
+ CLEAR_BINFO_PUSHDECLS_MARKED (binfo);
}
/* When entering the scope of a class, we cache all of the
@@ -3553,11 +3131,11 @@ push_class_decls (type)
search_stack = push_search_level (search_stack, &search_obstack);
/* Push class fields into CLASS_VALUE scope, and mark. */
- dfs_walk (TYPE_BINFO (type), dfs_pushdecls, unmarkedp);
+ dfs_walk (TYPE_BINFO (type), dfs_pushdecls, unmarked_pushdecls_p);
/* Compress fields which have only a single entry
by a given name, and unmark. */
- dfs_walk (TYPE_BINFO (type), dfs_compress_decls, markedp);
+ dfs_walk (TYPE_BINFO (type), dfs_compress_decls, marked_pushdecls_p);
/* Open up all the closed envelopes and push the contained decls into
class scope. */
@@ -3663,23 +3241,6 @@ void
print_search_statistics ()
{
#ifdef GATHER_STATISTICS
- if (flag_memoize_lookups)
- {
- fprintf (stderr, "%d memoized contexts saved\n",
- n_contexts_saved);
- fprintf (stderr, "%d local tree nodes made\n", my_tree_node_counter);
- fprintf (stderr, "%d local hash nodes made\n", my_memoized_entry_counter);
- fprintf (stderr, "fields statistics:\n");
- fprintf (stderr, " memoized finds = %d; rejects = %d; (searches = %d)\n",
- memoized_fast_finds[0], memoized_fast_rejects[0],
- memoized_fields_searched[0]);
- fprintf (stderr, " memoized_adds = %d\n", memoized_adds[0]);
- fprintf (stderr, "fnfields statistics:\n");
- fprintf (stderr, " memoized finds = %d; rejects = %d; (searches = %d)\n",
- memoized_fast_finds[1], memoized_fast_rejects[1],
- memoized_fields_searched[1]);
- fprintf (stderr, " memoized_adds = %d\n", memoized_adds[1]);
- }
fprintf (stderr, "%d fields searched in %d[%d] calls to lookup_field[_1]\n",
n_fields_searched, n_calls_lookup_field, n_calls_lookup_field_1);
fprintf (stderr, "%d fnfields searched in %d calls to lookup_fnfields\n",
@@ -3694,27 +3255,12 @@ void
init_search_processing ()
{
gcc_obstack_init (&search_obstack);
- gcc_obstack_init (&type_obstack);
- gcc_obstack_init (&type_obstack_entries);
-
- /* This gives us room to build our chains of basetypes,
- whether or not we decide to memoize them. */
- type_stack = push_type_level ((struct stack_level *)0, &type_obstack);
_vptr_name = get_identifier ("_vptr");
}
void
reinit_search_statistics ()
{
- my_memoized_entry_counter = 0;
- memoized_fast_finds[0] = 0;
- memoized_fast_finds[1] = 0;
- memoized_adds[0] = 0;
- memoized_adds[1] = 0;
- memoized_fast_rejects[0] = 0;
- memoized_fast_rejects[1] = 0;
- memoized_fields_searched[0] = 0;
- memoized_fields_searched[1] = 0;
#ifdef GATHER_STATISTICS
n_fields_searched = 0;
n_calls_lookup_field = 0, n_calls_lookup_field_1 = 0;
@@ -3738,7 +3284,9 @@ add_conversions (binfo)
for (i = 2; i < TREE_VEC_LENGTH (method_vec); ++i)
{
tree tmp = TREE_VEC_ELT (method_vec, i);
- if (! IDENTIFIER_TYPENAME_P (DECL_NAME (tmp)))
+
+ if (!tmp
+ || !IDENTIFIER_TYPENAME_P (DECL_NAME (OVL_CURRENT (tmp))))
break;
conversions = scratch_tree_cons (binfo, tmp, conversions);
}
@@ -3863,7 +3411,7 @@ dfs_check_overlap (empty_binfo)
static int
dfs_no_overlap_yet (t)
- tree t;
+ tree t ATTRIBUTE_UNUSED;
{
return found_overlap == 0;
}
@@ -3882,3 +3430,27 @@ types_overlap_p (empty_type, next_type)
dfs_walk (TYPE_BINFO (empty_type), dfs_check_overlap, dfs_no_overlap_yet);
return found_overlap;
}
+
+/* Passed to dfs_search by binfo_for_vtable; determine if bvtable comes
+ from BINFO. */
+
+static tree bvtable;
+static tree
+dfs_bfv_helper (binfo)
+ tree binfo;
+{
+ if (BINFO_VTABLE (binfo) == bvtable)
+ return binfo;
+ return NULL_TREE;
+}
+
+/* Given a vtable VARS, determine which binfo it comes from. */
+
+tree
+binfo_for_vtable (vars)
+ tree vars;
+{
+ bvtable = vars;
+ return dfs_search (TYPE_BINFO (DECL_CONTEXT (vars)), dfs_bfv_helper,
+ DECL_CONTEXT (vars));
+}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 5d526c01757..9579d44d96b 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -66,19 +66,23 @@ void
finish_expr_stmt (expr)
tree expr;
{
- if (!processing_template_decl)
+ if (expr != NULL_TREE)
{
- emit_line_note (input_filename, lineno);
- /* Do default conversion if safe and possibly important,
- in case within ({...}). */
- if ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
- && lvalue_p (expr))
- || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE)
- expr = default_conversion (expr);
+ if (!processing_template_decl)
+ {
+ emit_line_note (input_filename, lineno);
+ /* Do default conversion if safe and possibly important,
+ in case within ({...}). */
+ if ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
+ && lvalue_p (expr))
+ || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE)
+ expr = default_conversion (expr);
+ }
+
+ cplus_expand_expr_stmt (expr);
+ clear_momentary ();
}
-
- cplus_expand_expr_stmt (expr);
- clear_momentary ();
+
finish_stmt ();
}
@@ -379,8 +383,8 @@ finish_for_cond (cond, for_stmt)
else
{
emit_line_note (input_filename, lineno);
- if (cond)
- expand_exit_loop_if_false (0, cond);
+ if (cond)
+ expand_exit_loop_if_false (0, condition_conversion (cond));
}
/* If the cond wasn't a declaration, clear out the
@@ -583,7 +587,9 @@ finish_try_block (try_block)
if (processing_template_decl)
RECHAIN_STMTS_FROM_LAST (try_block, TRY_STMTS (try_block));
else
- expand_start_all_catch ();
+ {
+ expand_start_all_catch ();
+ }
}
/* Finish a handler-sequence for a try-block, which may be given by
@@ -596,7 +602,9 @@ finish_handler_sequence (try_block)
if (processing_template_decl)
RECHAIN_STMTS_FROM_CHAIN (try_block, TRY_HANDLERS (try_block));
else
- expand_end_all_catch ();
+ {
+ expand_end_all_catch ();
+ }
}
/* Begin a handler. Returns a HANDLER if appropriate. */
@@ -722,28 +730,18 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
else
{
emit_line_note (input_filename, lineno);
- if (output_operands != NULL_TREE || input_operands != NULL_TREE
- || clobbers != NULL_TREE)
- {
- if (cv_qualifier != NULL_TREE
- && cv_qualifier != ridpointers[(int) RID_VOLATILE])
- cp_warning ("%s qualifier ignored on asm",
- IDENTIFIER_POINTER (cv_qualifier));
-
- c_expand_asm_operands (string, output_operands,
- input_operands,
- clobbers,
- cv_qualifier
- == ridpointers[(int) RID_VOLATILE],
- input_filename, lineno);
- }
- else
- {
- if (cv_qualifier != NULL_TREE)
- cp_warning ("%s qualifier ignored on asm",
- IDENTIFIER_POINTER (cv_qualifier));
- expand_asm (string);
- }
+
+ if (cv_qualifier != NULL_TREE
+ && cv_qualifier != ridpointers[(int) RID_VOLATILE])
+ cp_warning ("%s qualifier ignored on asm",
+ IDENTIFIER_POINTER (cv_qualifier));
+
+ c_expand_asm_operands (string, output_operands,
+ input_operands,
+ clobbers,
+ cv_qualifier
+ == ridpointers[(int) RID_VOLATILE],
+ input_filename, lineno);
finish_stmt ();
}
@@ -828,11 +826,21 @@ finish_stmt_expr (rtl_expr, expr)
call. */
tree
-finish_call_expr (fn, args)
+finish_call_expr (fn, args, koenig)
tree fn;
tree args;
+ int koenig;
{
- tree result = build_x_function_call (fn, args, current_class_ref);
+ tree result;
+
+ if (koenig)
+ {
+ if (TREE_CODE (fn) == BIT_NOT_EXPR)
+ fn = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (fn, 0));
+ else if (TREE_CODE (fn) != TEMPLATE_ID_EXPR)
+ fn = do_identifier (fn, 2, args);
+ }
+ result = build_x_function_call (fn, args, current_class_ref);
if (TREE_CODE (result) == CALL_EXPR
&& TREE_TYPE (result) != void_type_node)
@@ -909,6 +917,25 @@ finish_object_call_expr (fn, object, args)
tree real_fn = build_component_ref (object, fn, NULL_TREE, 1);
return finish_call_expr (real_fn, args);
#else
+ if (TREE_CODE (fn) == TYPE_DECL)
+ {
+ if (processing_template_decl)
+ /* This can happen on code like:
+
+ class X;
+ template <class T> void f(T t) {
+ t.X();
+ }
+
+ We just grab the underlying IDENTIFIER. */
+ fn = DECL_NAME (fn);
+ else
+ {
+ cp_error ("calling type `%T' like a method", fn);
+ return error_mark_node;
+ }
+ }
+
return build_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL);
#endif
}
@@ -958,7 +985,7 @@ finish_pseudo_destructor_call_expr (object, scope, destructor)
ARGS. Returns an expression for the call. */
tree
-finish_globally_qualified_member_call_expr (fn, args)
+finish_qualified_call_expr (fn, args)
tree fn;
tree args;
{
@@ -993,6 +1020,58 @@ finish_label_address_expr (label)
return result;
}
+/* Finish an expression of the form CODE EXPR. */
+
+tree
+finish_unary_op_expr (code, expr)
+ enum tree_code code;
+ tree expr;
+{
+ tree result = build_x_unary_op (code, expr);
+ if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST)
+ TREE_NEGATED_INT (result) = 1;
+ overflow_warning (result);
+ return result;
+}
+
+/* Finish an id-expression. */
+
+tree
+finish_id_expr (expr)
+ tree expr;
+{
+ if (TREE_CODE (expr) == IDENTIFIER_NODE)
+ expr = do_identifier (expr, 1, NULL_TREE);
+
+ return expr;
+}
+
+/* Begin a new-placement. */
+
+int
+begin_new_placement ()
+{
+ /* The arguments to a placement new might be passed to a
+ deallocation function, in the event that the allocation throws an
+ exception. Since we don't expand exception handlers until the
+ end of a function, we must make sure the arguments stay around
+ that long. */
+ return suspend_momentary ();
+}
+
+/* Finish a new-placement. The ARGS are the placement arguments. The
+ COOKIE is the value returned by the previous call to
+ begin_new_placement. */
+
+tree
+finish_new_placement (args, cookie)
+ tree args;
+ int cookie;
+{
+ resume_momentary (cookie);
+ return args;
+}
+
/* Begin a function defniition declared with DECL_SPECS and
DECLARATOR. Returns non-zero if the function-declaration is
legal. */
@@ -1009,6 +1088,10 @@ begin_function_definition (decl_specs, declarator)
return 0;
reinit_parse_for_function ();
+ /* The things we're about to see are not directly qualified by any
+ template headers we've seen thus far. */
+ reset_specialization ();
+
return 1;
}
@@ -1021,14 +1104,37 @@ begin_constructor_declarator (scope, name)
tree name;
{
tree result = build_parse_node (SCOPE_REF, scope, name);
+ enter_scope_of (result);
+ return result;
+}
- if (scope != current_class_type)
- {
- push_nested_class (scope, 3);
- TREE_COMPLEXITY (result) = current_class_depth;
- }
+/* Finish an init-declarator. Returns a DECL. */
- return result;
+tree
+finish_declarator (declarator, declspecs, attributes,
+ prefix_attributes, initialized)
+ tree declarator;
+ tree declspecs;
+ tree attributes;
+ tree prefix_attributes;
+ int initialized;
+{
+ return start_decl (declarator, declspecs, initialized, attributes,
+ prefix_attributes);
+}
+
+/* Finish a translation unit. */
+
+void
+finish_translation_unit ()
+{
+ /* In case there were missing closebraces,
+ get us back to the global binding level. */
+ while (! toplevel_bindings_p ())
+ poplevel (0, 0, 0);
+ while (current_namespace != global_namespace)
+ pop_namespace ();
+ finish_file ();
}
/* Finish a template type parameter, specified as AGGR IDENTIFIER.
@@ -1067,3 +1173,424 @@ finish_template_template_parm (aggr, identifier)
return finish_template_type_parm (aggr, tmpl);
}
+
+/* Finish a parameter list, indicated by PARMS. If ELLIPSIS is
+ non-zero, the parameter list was terminated by a `...'. */
+
+tree
+finish_parmlist (parms, ellipsis)
+ tree parms;
+ int ellipsis;
+{
+ if (!ellipsis)
+ chainon (parms, void_list_node);
+ /* We mark the PARMS as a parmlist so that declarator processing can
+ disambiguate certain constructs. */
+ if (parms != NULL_TREE)
+ TREE_PARMLIST (parms) = 1;
+
+ return parms;
+}
+
+/* Begin a class definition, as indicated by T. */
+
+tree
+begin_class_definition (t)
+ tree t;
+{
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+
+ if (t == error_mark_node
+ || ! IS_AGGR_TYPE (t))
+ {
+ t = make_lang_type (RECORD_TYPE);
+ pushtag (make_anon_name (), t, 0);
+ }
+
+ /* In a definition of a member class template, we will get here with an
+ implicit typename, a TYPENAME_TYPE with a type. */
+ if (TREE_CODE (t) == TYPENAME_TYPE)
+ t = TREE_TYPE (t);
+
+ if (TYPE_SIZE (t))
+ duplicate_tag_error (t);
+ if (TYPE_SIZE (t) || TYPE_BEING_DEFINED (t))
+ {
+ t = make_lang_type (TREE_CODE (t));
+ pushtag (TYPE_IDENTIFIER (t), t, 0);
+ }
+ if (processing_template_decl && TYPE_CONTEXT (t)
+ && TREE_CODE (TYPE_CONTEXT (t)) != NAMESPACE_DECL
+ && ! current_class_type)
+ push_template_decl (TYPE_STUB_DECL (t));
+ maybe_process_partial_specialization (t);
+ pushclass (t, 0);
+ TYPE_BEING_DEFINED (t) = 1;
+ /* Reset the interface data, at the earliest possible
+ moment, as it might have been set via a class foo;
+ before. */
+ /* Don't change signatures. */
+ if (! IS_SIGNATURE (t))
+ {
+ int needs_writing;
+ tree name = TYPE_IDENTIFIER (t);
+
+ if (! ANON_AGGRNAME_P (name))
+ {
+ CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
+ SET_CLASSTYPE_INTERFACE_UNKNOWN_X
+ (t, interface_unknown);
+ }
+
+ /* Record how to set the access of this class's
+ virtual functions. If write_virtuals == 3, then
+ inline virtuals are ``extern inline''. */
+ if (write_virtuals == 3)
+ needs_writing = ! CLASSTYPE_INTERFACE_ONLY (t)
+ && CLASSTYPE_INTERFACE_KNOWN (t);
+ else
+ needs_writing = 1;
+ CLASSTYPE_VTABLE_NEEDS_WRITING (t) = needs_writing;
+ }
+#if 0
+ tmp = TYPE_IDENTIFIER ($<ttype>0);
+ if (tmp && IDENTIFIER_TEMPLATE (tmp))
+ overload_template_name (tmp, 1);
+#endif
+ reset_specialization();
+
+ /* In case this is a local class within a template
+ function, we save the current tree structure so
+ that we can get it back later. */
+ begin_tree ();
+
+ return t;
+}
+
+/* Finish the member declaration given by DECL. */
+
+void
+finish_member_declaration (decl)
+ tree decl;
+{
+ if (decl == error_mark_node || decl == NULL_TREE)
+ return;
+
+ if (decl == void_type_node)
+ /* The COMPONENT was a friend, not a member, and so there's
+ nothing for us to do. */
+ return;
+
+ /* We should see only one DECL at a time. */
+ my_friendly_assert (TREE_CHAIN (decl) == NULL_TREE, 0);
+
+ /* Set up access control for DECL. */
+ TREE_PRIVATE (decl)
+ = (current_access_specifier == access_private_node);
+ TREE_PROTECTED (decl)
+ = (current_access_specifier == access_protected_node);
+ if (TREE_CODE (decl) == TEMPLATE_DECL)
+ {
+ TREE_PRIVATE (DECL_RESULT (decl)) = TREE_PRIVATE (decl);
+ TREE_PROTECTED (DECL_RESULT (decl)) = TREE_PROTECTED (decl);
+ }
+
+ /* Mark the DECL as a member of the current class. */
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ || DECL_FUNCTION_TEMPLATE_P (decl))
+ /* Historically, DECL_CONTEXT was not set for a FUNCTION_DECL in
+ finish_struct. Presumably it is already set as the function is
+ parsed. Perhaps DECL_CLASS_CONTEXT is already set, too? */
+ DECL_CLASS_CONTEXT (decl) = current_class_type;
+ else if (TREE_CODE (decl) == TYPE_DECL)
+ /* Historically, DECL_CONTEXT was not set for a TYPE_DECL in
+ finish_struct, so we do not do it here either. Perhaps we
+ should, though. */
+ ;
+ else
+ DECL_CONTEXT (decl) = current_class_type;
+
+ /* Put functions on the TYPE_METHODS list and everything else on the
+ TYPE_FIELDS list. Note that these are built up in reverse order.
+ We reverse them (to obtain declaration order) in finish_struct. */
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ || DECL_FUNCTION_TEMPLATE_P (decl))
+ {
+ /* We also need to add this function to the
+ CLASSTYPE_METHOD_VEC. */
+ add_method (current_class_type, 0, decl);
+
+ TREE_CHAIN (decl) = TYPE_METHODS (current_class_type);
+ TYPE_METHODS (current_class_type) = decl;
+ }
+ else
+ {
+ /* All TYPE_DECLs go at the end of TYPE_FIELDS. Ordinary fields
+ go at the beginning. The reason is that lookup_field_1
+ searches the list in order, and we want a field name to
+ override a type name so that the "struct stat hack" will
+ work. In particular:
+
+ struct S { enum E { }; int E } s;
+ s.E = 3;
+
+ is legal. In addition, the FIELD_DECLs must be maintained in
+ declaration order so that class layout works as expected.
+ However, we don't need that order until class layout, so we
+ save a little time by putting FIELD_DECLs on in reverse order
+ here, and then reversing them in finish_struct_1. (We could
+ also keep a pointer to the correct insertion points in the
+ list.) */
+
+ if (TREE_CODE (decl) == TYPE_DECL)
+ TYPE_FIELDS (current_class_type)
+ = chainon (TYPE_FIELDS (current_class_type), decl);
+ else
+ {
+ TREE_CHAIN (decl) = TYPE_FIELDS (current_class_type);
+ TYPE_FIELDS (current_class_type) = decl;
+ }
+ }
+}
+
+/* Finish a class definition T with the indicate ATTRIBUTES. If SEMI,
+ the definition is immediately followed by a semicolon. Returns the
+ type. */
+
+tree
+finish_class_definition (t, attributes, semi)
+ tree t;
+ tree attributes;
+ int semi;
+{
+#if 0
+ /* Need to rework class nesting in the presence of nested classes,
+ etc. */
+ shadow_tag (CLASSTYPE_AS_LIST (t)); */
+#endif
+
+ /* finish_struct nukes this anyway; if finish_exception does too,
+ then it can go. */
+ if (semi)
+ note_got_semicolon (t);
+
+ /* If we got any attributes in class_head, xref_tag will stick them in
+ TREE_TYPE of the type. Grab them now. */
+ attributes = chainon (TREE_TYPE (t), attributes);
+ TREE_TYPE (t) = NULL_TREE;
+
+ if (TREE_CODE (t) == ENUMERAL_TYPE)
+ ;
+ else
+ {
+ t = finish_struct (t, attributes, semi);
+ if (semi)
+ note_got_semicolon (t);
+ }
+
+ pop_obstacks ();
+
+ if (! semi)
+ check_for_missing_semicolon (t);
+ if (current_scope () == current_function_decl)
+ do_pending_defargs ();
+
+ return t;
+}
+
+/* Finish processing the default argument expressions cached during
+ the processing of a class definition. */
+
+void
+finish_default_args ()
+{
+ if (pending_inlines
+ && current_scope () == current_function_decl)
+ do_pending_inlines ();
+}
+
+/* Finish processing the inline function definitions cached during the
+ processing of a class definition. */
+
+void
+begin_inline_definitions ()
+{
+ if (current_class_type == NULL_TREE)
+ clear_inline_text_obstack ();
+
+ /* Undo the begin_tree in begin_class_definition. */
+ end_tree ();
+}
+
+/* Finish processing the declaration of a member class template
+ TYPES whose template parameters are given by PARMS. */
+
+tree
+finish_member_class_template (types)
+ tree types;
+{
+ tree t;
+
+ /* If there are declared, but undefined, partial specializations
+ mixed in with the typespecs they will not yet have passed through
+ maybe_process_partial_specialization, so we do that here. */
+ for (t = types; t != NULL_TREE; t = TREE_CHAIN (t))
+ if (IS_AGGR_TYPE_CODE (TREE_CODE (TREE_VALUE (t))))
+ maybe_process_partial_specialization (TREE_VALUE (t));
+
+ note_list_got_semicolon (types);
+ grok_x_components (types);
+ if (TYPE_CONTEXT (TREE_VALUE (types)) != current_class_type)
+ /* The component was in fact a friend declaration. We avoid
+ finish_member_template_decl performing certain checks by
+ unsetting TYPES. */
+ types = NULL_TREE;
+
+ finish_member_template_decl (types);
+
+ /* As with other component type declarations, we do
+ not store the new DECL on the list of
+ component_decls. */
+ return NULL_TREE;
+}
+
+/* Finish processsing a complete template declaration. The PARMS are
+ the template parameters. */
+
+void
+finish_template_decl (parms)
+ tree parms;
+{
+ if (parms)
+ end_template_decl ();
+ else
+ end_specialization ();
+}
+
+/* Finish processing a a template-id (which names a type) of the form
+ NAME < ARGS >. Return the TYPE_DECL for the type named by the
+ template-id. If ENTERING_SCOPE is non-zero we are about to enter
+ the scope of template-id indicated. */
+
+tree
+finish_template_type (name, args, entering_scope)
+ tree name;
+ tree args;
+ int entering_scope;
+{
+ tree decl;
+
+ decl = lookup_template_class (name, args,
+ NULL_TREE, NULL_TREE, entering_scope);
+ if (decl != error_mark_node)
+ decl = TYPE_STUB_DECL (decl);
+
+ return decl;
+}
+
+/* SR is a SCOPE_REF node. Enter the scope of SR, whether it is a
+ namespace scope or a class scope. */
+
+void
+enter_scope_of (sr)
+ tree sr;
+{
+ tree scope = TREE_OPERAND (sr, 0);
+
+ if (TREE_CODE (scope) == NAMESPACE_DECL)
+ {
+ push_decl_namespace (scope);
+ TREE_COMPLEXITY (sr) = -1;
+ }
+ else if (scope != current_class_type)
+ {
+ if (TREE_CODE (scope) == TYPENAME_TYPE)
+ {
+ /* In a declarator for a template class member, the scope will
+ get here as an implicit typename, a TYPENAME_TYPE with a type. */
+ scope = TREE_TYPE (scope);
+ TREE_OPERAND (sr, 0) = scope;
+ }
+ push_nested_class (scope, 3);
+ TREE_COMPLEXITY (sr) = current_class_depth;
+ }
+}
+
+/* Finish processing a BASE_CLASS with the indicated ACCESS_SPECIFIER.
+ Return a TREE_LIST containing the ACCESS_SPECIFIER and the
+ BASE_CLASS, or NULL_TREE if an error occurred. The
+ ACCESSS_SPECIFIER is one of
+ access_{default,public,protected_private}[_virtual]_node.*/
+
+tree
+finish_base_specifier (access_specifier, base_class,
+ current_aggr_is_signature)
+ tree access_specifier;
+ tree base_class;
+ int current_aggr_is_signature;
+{
+ tree type;
+ tree result;
+
+ if (base_class == NULL_TREE)
+ {
+ error ("invalid base class");
+ type = error_mark_node;
+ }
+ else
+ type = TREE_TYPE (base_class);
+ if (current_aggr_is_signature && access_specifier)
+ error ("access and source specifiers not allowed in signature");
+ if (! is_aggr_type (type, 1))
+ result = NULL_TREE;
+ else if (current_aggr_is_signature
+ && (! type) && (! IS_SIGNATURE (type)))
+ {
+ error ("class name not allowed as base signature");
+ result = NULL_TREE;
+ }
+ else if (current_aggr_is_signature)
+ {
+ sorry ("signature inheritance, base type `%s' ignored",
+ IDENTIFIER_POINTER (access_specifier));
+ result = build_tree_list (access_public_node, type);
+ }
+ else if (type && IS_SIGNATURE (type))
+ {
+ error ("signature name not allowed as base class");
+ result = NULL_TREE;
+ }
+ else
+ result = build_tree_list (access_specifier, type);
+
+ return result;
+}
+
+/* Called when multiple declarators are processed. If that is not
+ premitted in this context, an error is issued. */
+
+void
+check_multiple_declarators ()
+{
+ /* [temp]
+
+ In a template-declaration, explicit specialization, or explicit
+ instantiation the init-declarator-list in the declaration shall
+ contain at most one declarator.
+
+ We don't just use PROCESSING_TEMPLATE_DECL for the first
+ condition since that would disallow the perfectly legal code,
+ like `template <class T> struct S { int i, j; };'. */
+ tree scope = current_scope ();
+
+ if (scope && TREE_CODE (scope) == FUNCTION_DECL)
+ /* It's OK to write `template <class T> void f() { int i, j;}'. */
+ return;
+
+ if (PROCESSING_REAL_TEMPLATE_DECL_P ()
+ || processing_explicit_instantiation
+ || processing_specialization)
+ cp_error ("multiple declarators in template declaration");
+}
+
diff --git a/gcc/cp/sig.c b/gcc/cp/sig.c
index 01736a8d43f..6f8d14dd19d 100644
--- a/gcc/cp/sig.c
+++ b/gcc/cp/sig.c
@@ -250,23 +250,25 @@ build_signature_pointer_or_reference_type (to_type, constp, volatilep, refp)
/* Construct, lay out and return the type of pointers to signature TO_TYPE. */
tree
-build_signature_pointer_type (to_type, constp, volatilep)
+build_signature_pointer_type (to_type)
tree to_type;
- int constp, volatilep;
{
return
- build_signature_pointer_or_reference_type (to_type, constp, volatilep, 0);
+ build_signature_pointer_or_reference_type (TYPE_MAIN_VARIANT (to_type),
+ TYPE_READONLY (to_type),
+ TYPE_VOLATILE (to_type), 0);
}
/* Construct, lay out and return the type of pointers to signature TO_TYPE. */
tree
-build_signature_reference_type (to_type, constp, volatilep)
+build_signature_reference_type (to_type)
tree to_type;
- int constp, volatilep;
{
return
- build_signature_pointer_or_reference_type (to_type, constp, volatilep, 1);
+ build_signature_pointer_or_reference_type (TYPE_MAIN_VARIANT (to_type),
+ TYPE_READONLY (to_type),
+ TYPE_VOLATILE (to_type), 1);
}
/* Return the name of the signature table (as an IDENTIFIER_NODE)
@@ -321,7 +323,7 @@ build_member_function_pointer (member)
GNU_xref_ref (current_function_decl, name);
entry = build_lang_field_decl (FIELD_DECL, get_identifier (name),
- TYPE_MAIN_VARIANT (sigtable_entry_type));
+ sigtable_entry_type);
TREE_CONSTANT (entry) = 1;
TREE_READONLY (entry) = 1;
@@ -341,49 +343,45 @@ build_member_function_pointer (member)
The new FIELD_DECLs are appended at the end of the last (and only)
sublist of `list_of_fieldlists.'
+ T is the signature type.
+
As a side effect, each member function in the signature gets the
`decl.ignored' bit turned on, so we don't output debug info for it. */
void
-append_signature_fields (list_of_fieldlists)
- tree list_of_fieldlists;
+append_signature_fields (t)
+ tree t;
{
- tree l, x;
- tree last_x = NULL_TREE;
+ tree x;
tree mfptr;
tree last_mfptr = NULL_TREE;
tree mfptr_list = NULL_TREE;
- /* For signatures it should actually be only a list with one element. */
- for (l = list_of_fieldlists; l; l = TREE_CHAIN (l))
+ for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
{
- for (x = TREE_VALUE (l); x; x = TREE_CHAIN (x))
+ if (TREE_CODE (x) == FUNCTION_DECL)
{
- if (TREE_CODE (x) == FUNCTION_DECL)
+ mfptr = build_member_function_pointer (x);
+ DECL_MEMFUNC_POINTER_TO (x) = mfptr;
+ DECL_MEMFUNC_POINTING_TO (mfptr) = x;
+ DECL_IGNORED_P (x) = 1;
+ DECL_IN_AGGR_P (mfptr) = 1;
+ if (! mfptr_list)
+ mfptr_list = last_mfptr = mfptr;
+ else
{
- mfptr = build_member_function_pointer (x);
- DECL_MEMFUNC_POINTER_TO (x) = mfptr;
- DECL_MEMFUNC_POINTING_TO (mfptr) = x;
- DECL_IGNORED_P (x) = 1;
- DECL_IN_AGGR_P (mfptr) = 1;
- if (! mfptr_list)
- mfptr_list = last_mfptr = mfptr;
- else
- {
- TREE_CHAIN (last_mfptr) = mfptr;
- last_mfptr = mfptr;
- }
+ TREE_CHAIN (last_mfptr) = mfptr;
+ last_mfptr = mfptr;
}
- last_x = x;
}
}
- /* Append the lists. */
- if (last_x && mfptr_list)
- {
- TREE_CHAIN (last_x) = mfptr_list;
- TREE_CHAIN (last_mfptr) = NULL_TREE;
- }
+ /* The member function pointers must come after the TYPE_DECLs, in
+ this case, because build_signature_table_constructor depends on
+ finding opaque TYPE_DECLS before the functions that make use of
+ them. */
+ if (last_mfptr)
+ TYPE_FIELDS (t) = chainon (TYPE_FIELDS (t), mfptr_list);
}
/* Compare the types of a signature member function and a class member
@@ -532,19 +530,20 @@ build_signature_table_constructor (sig_ty, rhs)
else
{
/* Find the class method of the correct type. */
-
+ tree rhs_methods;
basetypes = TREE_PURPOSE (baselink);
if (TREE_CODE (basetypes) == TREE_LIST)
basetypes = TREE_VALUE (basetypes);
- rhs_method = TREE_VALUE (baselink);
- for (; rhs_method; rhs_method = TREE_CHAIN (rhs_method))
- if (sig_mname == DECL_NAME (rhs_method)
+ rhs_methods = TREE_VALUE (baselink);
+ for (; rhs_methods; rhs_methods = OVL_NEXT (rhs_methods))
+ if ((rhs_method = OVL_CURRENT (rhs_methods))
+ && sig_mname == DECL_NAME (rhs_method)
&& ! DECL_STATIC_FUNCTION_P (rhs_method)
&& match_method_types (sig_mtype, TREE_TYPE (rhs_method)))
break;
- if (rhs_method == NULL_TREE
+ if (rhs_methods == NULL_TREE
|| (compute_access (basetypes, rhs_method)
!= access_public_node))
{
@@ -754,7 +753,7 @@ build_sigtable (sig_type, rhs_type, init_from)
decl = pushdecl_top_level (build_decl (VAR_DECL, name, sig_type));
current_function_decl = context;
}
- IDENTIFIER_GLOBAL_VALUE (name) = decl;
+ SET_IDENTIFIER_GLOBAL_VALUE (name, decl);
store_init_value (decl, init_expr);
if (IS_SIGNATURE (rhs_type))
{
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index a13f659e1f4..ff93ac7e120 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "parse.h"
#include "flags.h"
#include "obstack.h"
+#include "toplev.h"
/* This takes a token stream that hasn't decided much about types and
tries to figure out as much as it can, with excessive lookahead and
@@ -47,7 +48,7 @@ struct token {
static int do_aggr PROTO((void));
static int probe_obstack PROTO((struct obstack *, tree, unsigned int));
-static void scan_tokens PROTO((int));
+static void scan_tokens PROTO((unsigned int));
#ifdef SPEW_DEBUG
static int num_tokens PROTO((void));
@@ -155,9 +156,9 @@ consume_token ()
static void
scan_tokens (n)
- int n;
+ unsigned int n;
{
- int i;
+ unsigned int i;
struct token *tmp;
/* We cannot read past certain tokens, so make sure we don't. */
@@ -244,7 +245,8 @@ int
yylex ()
{
struct token tmp_token;
- tree trrr;
+ tree trrr = NULL_TREE;
+ int old_looking_for_typename = 0;
retry:
#ifdef SPEW_DEBUG
@@ -306,8 +308,11 @@ yylex ()
case IDENTIFIER:
scan_tokens (1);
if (nth_token (1)->yychar == SCOPE)
- /* Don't interfere with the setting from an 'aggr' prefix. */
- looking_for_typename++;
+ {
+ /* Don't interfere with the setting from an 'aggr' prefix. */
+ old_looking_for_typename = looking_for_typename;
+ looking_for_typename = 1;
+ }
else if (nth_token (1)->yychar == '<')
looking_for_template = 1;
@@ -323,7 +328,10 @@ yylex ()
case NSNAME:
case PTYPENAME:
lastiddecl = trrr;
- if (got_scope)
+
+ /* If this got special lookup, remember it. In these cases,
+ we don't have to worry about being a declarator-id. */
+ if (got_scope || got_object)
tmp_token.yylval.ttype = trrr;
break;
@@ -346,12 +354,26 @@ yylex ()
case PTYPENAME:
case PTYPENAME_DEFN:
consume_token ();
- if (looking_for_typename > 0)
- looking_for_typename--;
+ /* If we see a SCOPE next, restore the old value.
+ Otherwise, we got what we want. */
+ looking_for_typename = old_looking_for_typename;
looking_for_template = 0;
break;
case SCSPEC:
+ /* If export, warn that it's unimplemented and go on. */
+ if (tmp_token.yylval.ttype == get_identifier("export"))
+ {
+ warning ("keyword 'export' not implemented and will be ignored");
+ consume_token ();
+ goto retry;
+ }
+ else
+ {
+ ++first_token;
+ break;
+ }
+
case NEW:
/* do_aggr needs to check if the previous token was RID_NEW,
so just increment first_token instead of calling consume_token. */
@@ -368,13 +390,17 @@ yylex ()
/* fall through to output... */
case ENUM:
/* Set this again, in case we are rescanning. */
- looking_for_typename = 1;
+ looking_for_typename = 2;
/* fall through... */
default:
consume_token ();
}
- got_object = NULL_TREE;
+ /* class member lookup only applies to the first token after the object
+ expression, except for explicit destructor calls. */
+ if (tmp_token.yychar != '~')
+ got_object = NULL_TREE;
+
yylval = tmp_token.yylval;
yychar = tmp_token.yychar;
end_of_file = tmp_token.end_of_file;
diff --git a/gcc/cp/tinfo.cc b/gcc/cp/tinfo.cc
index d82aaaf0431..4b68fd1b3fb 100644
--- a/gcc/cp/tinfo.cc
+++ b/gcc/cp/tinfo.cc
@@ -33,7 +33,7 @@
// that uses virtual functions and -frtti but does not actually use RTTI
// functionality.
-type_info::
+std::type_info::
~type_info ()
{ }
@@ -43,7 +43,7 @@ __rtti_class (void *addr, const char *name,
{ new (addr) __class_type_info (name, bl, bn); }
extern "C" void
-__rtti_si (void *addr, const char *n, const type_info *ti)
+__rtti_si (void *addr, const char *n, const std::type_info *ti)
{
new (addr) __si_type_info
(n, static_cast <const __user_type_info &> (*ti));
@@ -77,7 +77,7 @@ dcast (const type_info& desired, int is_public, void *objptr,
return objptr;
void *match_found = 0;
- for (int i = 0; i < n_bases; i++)
+ for (size_t i = 0; i < n_bases; i++)
{
if (is_public && base_list[i].access != PUBLIC)
continue;
diff --git a/gcc/cp/tinfo.h b/gcc/cp/tinfo.h
index 3df55a5c709..3cfee04cec0 100644
--- a/gcc/cp/tinfo.h
+++ b/gcc/cp/tinfo.h
@@ -7,7 +7,7 @@
// type_info for a class with no base classes (or an enum).
-struct __user_type_info : public type_info {
+struct __user_type_info : public std::type_info {
__user_type_info (const char *n) : type_info (n) {}
// If our type can be converted to the desired type,
diff --git a/gcc/cp/tinfo2.cc b/gcc/cp/tinfo2.cc
index 9496486a761..b797cc3e1db 100644
--- a/gcc/cp/tinfo2.cc
+++ b/gcc/cp/tinfo2.cc
@@ -29,6 +29,7 @@
#include "tinfo.h"
#include "new" // for placement new
+using std::type_info;
// service function for comparing types by name.
static inline int
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 9aeafd77202..1f55e56b1d8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -28,12 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "toplev.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
extern void compiler_error ();
static tree get_identifier_list PROTO((tree));
@@ -45,22 +39,20 @@ static int list_hash PROTO((tree, tree, tree));
static tree list_hash_lookup PROTO((int, int, int, int, tree, tree,
tree));
static void propagate_binfo_offsets PROTO((tree, tree));
-static void unshare_base_binfos PROTO((tree));
static int avoid_overlap PROTO((tree, tree));
+static int lvalue_p_1 PROTO((tree, int));
#define CEIL(x,y) (((x) + (y) - 1) / (y))
-/* Return nonzero if REF is an lvalue valid for this language.
- Lvalues can be assigned, unless they have TREE_READONLY.
- Lvalues can have their address taken, unless they have DECL_REGISTER. */
+/* Returns non-zero if REF is an lvalue. If
+ TREAT_CLASS_RVALUES_AS_LVALUES is non-zero, rvalues of class type
+ are considered lvalues. */
-int
-real_lvalue_p (ref)
+static int
+lvalue_p_1 (ref, treat_class_rvalues_as_lvalues)
tree ref;
+ int treat_class_rvalues_as_lvalues;
{
- if (! language_lvalue_valid (ref))
- return 0;
-
if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
return 1;
@@ -78,7 +70,10 @@ real_lvalue_p (ref)
case UNSAVE_EXPR:
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
- return real_lvalue_p (TREE_OPERAND (ref, 0));
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ return lvalue_p_1 (TREE_OPERAND (ref, 0),
+ treat_class_rvalues_as_lvalues);
case STRING_CST:
return 1;
@@ -92,7 +87,6 @@ real_lvalue_p (ref)
case ARRAY_REF:
case PARM_DECL:
case RESULT_DECL:
- case ERROR_MARK:
if (TREE_CODE (TREE_TYPE (ref)) != FUNCTION_TYPE
&& TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE)
return 1;
@@ -104,24 +98,43 @@ real_lvalue_p (ref)
case OFFSET_REF:
if (TREE_CODE (TREE_OPERAND (ref, 1)) == FUNCTION_DECL)
return 1;
- return real_lvalue_p (TREE_OPERAND (ref, 0))
- && real_lvalue_p (TREE_OPERAND (ref, 1));
+ return (lvalue_p_1 (TREE_OPERAND (ref, 0),
+ treat_class_rvalues_as_lvalues)
+ && lvalue_p_1 (TREE_OPERAND (ref, 1),
+ treat_class_rvalues_as_lvalues));
break;
case COND_EXPR:
- return (real_lvalue_p (TREE_OPERAND (ref, 1))
- && real_lvalue_p (TREE_OPERAND (ref, 2)));
+ return (lvalue_p_1 (TREE_OPERAND (ref, 1),
+ treat_class_rvalues_as_lvalues)
+ && lvalue_p_1 (TREE_OPERAND (ref, 2),
+ treat_class_rvalues_as_lvalues));
case MODIFY_EXPR:
return 1;
case COMPOUND_EXPR:
- return real_lvalue_p (TREE_OPERAND (ref, 1));
+ return lvalue_p_1 (TREE_OPERAND (ref, 1),
+ treat_class_rvalues_as_lvalues);
case MAX_EXPR:
case MIN_EXPR:
- return (real_lvalue_p (TREE_OPERAND (ref, 0))
- && real_lvalue_p (TREE_OPERAND (ref, 1)));
+ return (lvalue_p_1 (TREE_OPERAND (ref, 0),
+ treat_class_rvalues_as_lvalues)
+ && lvalue_p_1 (TREE_OPERAND (ref, 1),
+ treat_class_rvalues_as_lvalues));
+
+ case TARGET_EXPR:
+ return treat_class_rvalues_as_lvalues;
+
+ case CALL_EXPR:
+ return (treat_class_rvalues_as_lvalues
+ && IS_AGGR_TYPE (TREE_TYPE (ref)));
+
+ case FUNCTION_DECL:
+ /* All functions (except non-static-member functions) are
+ lvalues. */
+ return !DECL_NONSTATIC_MEMBER_FUNCTION_P (ref);
default:
break;
@@ -130,92 +143,26 @@ real_lvalue_p (ref)
return 0;
}
+/* Return nonzero if REF is an lvalue valid for this language.
+ Lvalues can be assigned, unless they have TREE_READONLY, or unless
+ they are FUNCTION_DECLs. Lvalues can have their address taken,
+ unless they have DECL_REGISTER. */
+
+int
+real_lvalue_p (ref)
+ tree ref;
+{
+ return lvalue_p_1 (ref, /*treat_class_rvalues_as_lvalues=*/0);
+}
+
/* This differs from real_lvalue_p in that class rvalues are considered
lvalues. */
+
int
lvalue_p (ref)
tree ref;
{
- if (! language_lvalue_valid (ref))
- return 0;
-
- if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
- return 1;
-
- if (ref == current_class_ptr && flag_this_is_variable <= 0)
- return 0;
-
- switch (TREE_CODE (ref))
- {
- /* preincrements and predecrements are valid lvals, provided
- what they refer to are valid lvals. */
- case PREINCREMENT_EXPR:
- case PREDECREMENT_EXPR:
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- case COMPONENT_REF:
- case SAVE_EXPR:
- case UNSAVE_EXPR:
- case TRY_CATCH_EXPR:
- case WITH_CLEANUP_EXPR:
- return lvalue_p (TREE_OPERAND (ref, 0));
-
- case STRING_CST:
- return 1;
-
- case VAR_DECL:
- if (TREE_READONLY (ref) && ! TREE_STATIC (ref)
- && DECL_LANG_SPECIFIC (ref)
- && DECL_IN_AGGR_P (ref))
- return 0;
- case INDIRECT_REF:
- case ARRAY_REF:
- case PARM_DECL:
- case RESULT_DECL:
- case ERROR_MARK:
- if (TREE_CODE (TREE_TYPE (ref)) != FUNCTION_TYPE
- && TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE)
- return 1;
- break;
-
- case TARGET_EXPR:
- return 1;
-
- case CALL_EXPR:
- if (IS_AGGR_TYPE (TREE_TYPE (ref)))
- return 1;
- break;
-
- /* A currently unresolved scope ref. */
- case SCOPE_REF:
- my_friendly_abort (103);
- case OFFSET_REF:
- if (TREE_CODE (TREE_OPERAND (ref, 1)) == FUNCTION_DECL)
- return 1;
- return lvalue_p (TREE_OPERAND (ref, 0))
- && lvalue_p (TREE_OPERAND (ref, 1));
- break;
-
- case COND_EXPR:
- return (lvalue_p (TREE_OPERAND (ref, 1))
- && lvalue_p (TREE_OPERAND (ref, 2)));
-
- case MODIFY_EXPR:
- return 1;
-
- case COMPOUND_EXPR:
- return lvalue_p (TREE_OPERAND (ref, 1));
-
- case MAX_EXPR:
- case MIN_EXPR:
- return (lvalue_p (TREE_OPERAND (ref, 0))
- && lvalue_p (TREE_OPERAND (ref, 1)));
-
- default:
- break;
- }
-
- return 0;
+ return lvalue_p_1 (ref, /*treat_class_rvalues_as_lvalues=*/1);
}
/* Return nonzero if REF is an lvalue valid for this language;
@@ -430,9 +377,7 @@ build_cplus_method_type (basetype, rettype, argtypes)
TYPE_METHOD_BASETYPE (t) = TYPE_MAIN_VARIANT (basetype);
TREE_TYPE (t) = rettype;
if (IS_SIGNATURE (basetype))
- ptype = build_signature_pointer_type (TYPE_MAIN_VARIANT (basetype),
- TYPE_READONLY (basetype),
- TYPE_VOLATILE (basetype));
+ ptype = build_signature_pointer_type (basetype);
else
ptype = build_pointer_type (basetype);
@@ -472,7 +417,8 @@ build_cplus_array_type_1 (elt_type, index_type)
saveable_obstack = &permanent_obstack;
}
- if (processing_template_decl)
+ if (processing_template_decl
+ || uses_template_parms (index_type))
{
t = make_node (ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
@@ -545,6 +491,29 @@ cp_build_type_variant (type, constp, volatilep)
}
return build_type_variant (type, constp, volatilep);
}
+
+/* Returns the canonical version of TYPE. In other words, if TYPE is
+ a typedef, returns the underlying type. The cv-qualification of
+ the type returned matches the type input; they will always be
+ compatible types. */
+
+tree
+canonical_type_variant (t)
+ tree t;
+{
+ int constp, volatilep;
+ if (TREE_CODE (t) == ARRAY_TYPE)
+ {
+ constp = TYPE_READONLY (TREE_TYPE (t));
+ volatilep = TYPE_VOLATILE (TREE_TYPE (t));
+ }
+ else
+ {
+ constp = TYPE_READONLY (t);
+ volatilep = TYPE_VOLATILE (t);
+ }
+ return cp_build_type_variant (TYPE_MAIN_VARIANT (t), constp, volatilep);
+}
/* Add OFFSET to all base types of T.
@@ -570,7 +539,6 @@ propagate_binfo_offsets (binfo, offset)
else
{
int j;
- tree base_binfos = BINFO_BASETYPES (base_binfo);
tree delta = NULL_TREE;
for (j = i+1; j < n_baselinks; j++)
@@ -594,7 +562,7 @@ propagate_binfo_offsets (binfo, offset)
BINFO_OFFSET (base_binfo) = offset;
#endif
- unshare_base_binfos (base_binfo);
+ propagate_binfo_offsets (base_binfo, offset);
/* Go to our next class that counts for offset propagation. */
i = j;
@@ -604,40 +572,35 @@ propagate_binfo_offsets (binfo, offset)
}
}
-/* Makes new binfos for the indirect bases under BASE_BINFO, and updates
+/* Makes new binfos for the indirect bases under BINFO, and updates
BINFO_OFFSET for them and their bases. */
-static void
-unshare_base_binfos (base_binfo)
- tree base_binfo;
+void
+unshare_base_binfos (binfo)
+ tree binfo;
{
- if (BINFO_BASETYPES (base_binfo))
- {
- tree base_binfos = BINFO_BASETYPES (base_binfo);
- tree chain = NULL_TREE;
- int j;
+ tree binfos = BINFO_BASETYPES (binfo);
+ tree new_binfo;
+ int j;
- /* Now unshare the structure beneath BASE_BINFO. */
- for (j = TREE_VEC_LENGTH (base_binfos)-1;
- j >= 0; j--)
- {
- tree base_base_binfo = TREE_VEC_ELT (base_binfos, j);
- if (! TREE_VIA_VIRTUAL (base_base_binfo))
- TREE_VEC_ELT (base_binfos, j)
- = make_binfo (BINFO_OFFSET (base_base_binfo),
- base_base_binfo,
- BINFO_VTABLE (base_base_binfo),
- BINFO_VIRTUALS (base_base_binfo),
- chain);
- chain = TREE_VEC_ELT (base_binfos, j);
- TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (base_base_binfo);
- TREE_VIA_PROTECTED (chain) = TREE_VIA_PROTECTED (base_base_binfo);
- BINFO_INHERITANCE_CHAIN (chain) = base_binfo;
- }
+ if (binfos == NULL_TREE)
+ return;
- /* Completely unshare potentially shared data, and
- update what is ours. */
- propagate_binfo_offsets (base_binfo, BINFO_OFFSET (base_binfo));
+ /* Now unshare the structure beneath BINFO. */
+ for (j = TREE_VEC_LENGTH (binfos)-1;
+ j >= 0; j--)
+ {
+ tree base_binfo = TREE_VEC_ELT (binfos, j);
+ new_binfo = TREE_VEC_ELT (binfos, j)
+ = make_binfo (BINFO_OFFSET (base_binfo),
+ base_binfo,
+ BINFO_VTABLE (base_binfo),
+ BINFO_VIRTUALS (base_binfo));
+ TREE_VIA_PUBLIC (new_binfo) = TREE_VIA_PUBLIC (base_binfo);
+ TREE_VIA_PROTECTED (new_binfo) = TREE_VIA_PROTECTED (base_binfo);
+ TREE_VIA_VIRTUAL (new_binfo) = TREE_VIA_VIRTUAL (base_binfo);
+ BINFO_INHERITANCE_CHAIN (new_binfo) = binfo;
+ unshare_base_binfos (new_binfo);
}
}
@@ -657,9 +620,7 @@ layout_basetypes (rec, max)
tree binfos = TYPE_BINFO_BASETYPES (rec);
int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
- /* Get all the virtual base types that this type uses.
- The TREE_VALUE slot holds the virtual baseclass type. */
- tree vbase_types = get_vbase_types (rec);
+ tree vbase_types;
unsigned int record_align = MAX (BITS_PER_UNIT, TYPE_ALIGN (rec));
unsigned int desired_align;
@@ -674,7 +635,11 @@ layout_basetypes (rec, max)
record_align = MAX (record_align, STRUCTURE_SIZE_BOUNDARY);
#endif
- CLASSTYPE_VBASECLASSES (rec) = vbase_types;
+ /* Get all the virtual base types that this type uses. The
+ TREE_VALUE slot holds the virtual baseclass type. Note that
+ get_vbase_types makes copies of the virtual base BINFOs, so that
+ the vbase_types are unshared. */
+ CLASSTYPE_VBASECLASSES (rec) = vbase_types = get_vbase_types (rec);
my_friendly_assert (TREE_CODE (TYPE_SIZE (rec)) == INTEGER_CST, 19970302);
const_size = TREE_INT_CST_LOW (TYPE_SIZE (rec));
@@ -723,7 +688,11 @@ layout_basetypes (rec, max)
here, as that is for this class, without any virtual base classes. */
TYPE_ALIGN (rec) = record_align;
if (const_size != nonvirtual_const_size)
- TYPE_SIZE (rec) = size_int (const_size);
+ {
+ TYPE_SIZE (rec) = size_int (const_size);
+ TYPE_SIZE_UNIT (rec) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (rec),
+ size_int (BITS_PER_UNIT));
+ }
/* Now propagate offset information throughout the lattice. */
for (i = 0; i < n_baseclasses; i++)
@@ -736,10 +705,15 @@ layout_basetypes (rec, max)
continue;
my_friendly_assert (TREE_TYPE (field) == basetype, 23897);
+
+ if (get_base_distance (basetype, rec, 0, (tree*)0) == -2)
+ cp_warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
+ basetype, rec);
+
BINFO_OFFSET (base_binfo)
= size_int (CEIL (TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)),
BITS_PER_UNIT));
- unshare_base_binfos (base_binfo);
+ propagate_binfo_offsets (base_binfo, BINFO_OFFSET (base_binfo));
TYPE_FIELDS (rec) = TREE_CHAIN (field);
}
@@ -748,6 +722,15 @@ layout_basetypes (rec, max)
{
BINFO_INHERITANCE_CHAIN (vbase_types) = TYPE_BINFO (rec);
unshare_base_binfos (vbase_types);
+ propagate_binfo_offsets (vbase_types, BINFO_OFFSET (vbase_types));
+
+ if (extra_warnings)
+ {
+ tree basetype = BINFO_TYPE (vbase_types);
+ if (get_base_distance (basetype, rec, 0, (tree*)0) == -2)
+ cp_warning ("virtual base `%T' inaccessible in `%T' due to ambiguity",
+ basetype, rec);
+ }
}
return max;
@@ -897,8 +880,7 @@ build_vbase_pointer_fields (rec)
if (TREE_VIA_VIRTUAL (base_binfo))
{
int j;
- char *name = (char *)alloca (TYPE_NAME_LENGTH (basetype)
- + sizeof (VBASE_NAME) + 1);
+ char *name;
/* The offset for a virtual base class is only used in computing
virtual function tables and for initializing virtual base
@@ -918,7 +900,7 @@ build_vbase_pointer_fields (rec)
))
goto got_it;
}
- sprintf (name, VBASE_NAME_FORMAT, TYPE_NAME_STRING (basetype));
+ FORMAT_VBASE_NAME (name, basetype);
decl = build_lang_field_decl (FIELD_DECL, get_identifier (name),
build_pointer_type (basetype));
/* If you change any of the below, take a look at all the
@@ -1172,17 +1154,14 @@ get_decl_list (value)
VTABLE is the virtual function table with which to initialize
sub-objects of type TYPE.
- VIRTUALS are the virtual functions sitting in VTABLE.
-
- CHAIN are more associations we must retain. */
+ VIRTUALS are the virtual functions sitting in VTABLE. */
tree
-make_binfo (offset, binfo, vtable, virtuals, chain)
+make_binfo (offset, binfo, vtable, virtuals)
tree offset, binfo;
tree vtable, virtuals;
- tree chain;
{
- tree new_binfo = make_tree_vec (6);
+ tree new_binfo = make_tree_vec (7);
tree type;
if (TREE_CODE (binfo) == TREE_VEC)
@@ -1193,10 +1172,6 @@ make_binfo (offset, binfo, vtable, virtuals, chain)
binfo = TYPE_BINFO (binfo);
}
- TREE_CHAIN (new_binfo) = chain;
- if (chain)
- TREE_USED (new_binfo) = TREE_USED (chain);
-
TREE_TYPE (new_binfo) = TYPE_MAIN_VARIANT (type);
BINFO_OFFSET (new_binfo) = offset;
BINFO_VTABLE (new_binfo) = vtable;
@@ -1225,17 +1200,24 @@ binfo_value (elem, type)
return get_binfo (elem, type, 0);
}
+/* Return a reversed copy of the BINFO-chain given by PATH. (If the
+ BINFO_INHERITANCE_CHAIN points from base classes to derived
+ classes, it will instead point from derived classes to base
+ classes.) Returns the first node in the reversed chain. */
+
tree
reverse_path (path)
tree path;
{
- register tree prev = 0, tmp, next;
- for (tmp = path; tmp; tmp = next)
+ register tree prev = NULL_TREE, cur;
+ push_expression_obstack ();
+ for (cur = path; cur; cur = BINFO_INHERITANCE_CHAIN (cur))
{
- next = BINFO_INHERITANCE_CHAIN (tmp);
- BINFO_INHERITANCE_CHAIN (tmp) = prev;
- prev = tmp;
+ tree r = copy_node (cur);
+ BINFO_INHERITANCE_CHAIN (r) = prev;
+ prev = r;
}
+ pop_obstacks ();
return prev;
}
@@ -1246,9 +1228,9 @@ debug_binfo (elem)
unsigned HOST_WIDE_INT n;
tree virtuals;
- fprintf (stderr, "type \"%s\"; offset = %d\n",
+ fprintf (stderr, "type \"%s\"; offset = %ld\n",
TYPE_NAME_STRING (BINFO_TYPE (elem)),
- TREE_INT_CST_LOW (BINFO_OFFSET (elem)));
+ (long) TREE_INT_CST_LOW (BINFO_OFFSET (elem)));
fprintf (stderr, "vtable type:\n");
debug_tree (BINFO_TYPE (elem));
if (BINFO_VTABLE (elem))
@@ -1263,41 +1245,46 @@ debug_binfo (elem)
while (virtuals)
{
tree fndecl = TREE_OPERAND (FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (virtuals)), 0);
- fprintf (stderr, "%s [%d =? %d]\n",
+ fprintf (stderr, "%s [%ld =? %ld]\n",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)),
- n, TREE_INT_CST_LOW (DECL_VINDEX (fndecl)));
+ (long) n, (long) TREE_INT_CST_LOW (DECL_VINDEX (fndecl)));
++n;
virtuals = TREE_CHAIN (virtuals);
}
}
-/* Return the length of a chain of nodes chained through DECL_CHAIN.
- We expect a null pointer to mark the end of the chain.
- This is the Lisp primitive `length'. */
+/* Initialize an CPLUS_BINDING node that does not live on an obstack. */
-int
-decl_list_length (t)
- tree t;
+tree
+binding_init (node)
+ struct tree_binding* node;
{
- register tree tail;
- register int len = 0;
-
- my_friendly_assert (TREE_CODE (t) == FUNCTION_DECL
- || TREE_CODE (t) == TEMPLATE_DECL, 300);
- for (tail = t; tail; tail = DECL_CHAIN (tail))
- len++;
-
- return len;
+ static struct tree_binding* source;
+ if (!source)
+ {
+ extern struct obstack permanent_obstack;
+ push_obstacks (&permanent_obstack, &permanent_obstack);
+ source = (struct tree_binding*)make_node (CPLUS_BINDING);
+ pop_obstacks ();
+ }
+ *node = *source;
+ TREE_PERMANENT ((tree)node) = 0;
+ return (tree)node;
}
int
count_functions (t)
tree t;
{
+ int i;
if (TREE_CODE (t) == FUNCTION_DECL)
return 1;
- else if (TREE_CODE (t) == TREE_LIST)
- return decl_list_length (TREE_VALUE (t));
+ else if (TREE_CODE (t) == OVERLOAD)
+ {
+ for (i=0; t; t = OVL_CHAIN (t))
+ i++;
+ return i;
+ }
my_friendly_abort (359);
return 0;
@@ -1307,19 +1294,32 @@ int
is_overloaded_fn (x)
tree x;
{
+ /* XXX A baselink is also considered an overloaded function.
+ As is a placeholder from push_class_decls. */
+ if (TREE_CODE (x) == TREE_LIST)
+ {
+ my_friendly_assert (TREE_CODE (TREE_PURPOSE (x)) == TREE_VEC
+ || TREE_CODE (TREE_PURPOSE (x)) == IDENTIFIER_NODE,
+ 388);
+ x = TREE_VALUE (x);
+ }
return (TREE_CODE (x) == FUNCTION_DECL
|| TREE_CODE (x) == TEMPLATE_ID_EXPR
|| DECL_FUNCTION_TEMPLATE_P (x)
- || really_overloaded_fn (x));
+ || TREE_CODE (x) == OVERLOAD);
}
int
really_overloaded_fn (x)
tree x;
{
- return (TREE_CODE (x) == TREE_LIST
- && (TREE_CODE (TREE_VALUE (x)) == FUNCTION_DECL
- || DECL_FUNCTION_TEMPLATE_P (TREE_VALUE (x))));
+ /* A baselink is also considered an overloaded function.
+ This might also be an ambiguous class member. */
+ if (TREE_CODE (x) == TREE_LIST)
+ x = TREE_VALUE (x);
+ return (TREE_CODE (x) == OVERLOAD
+ && (TREE_CHAIN (x) != NULL_TREE
+ || DECL_FUNCTION_TEMPLATE_P (OVL_FUNCTION (x))));
}
tree
@@ -1327,11 +1327,72 @@ get_first_fn (from)
tree from;
{
my_friendly_assert (is_overloaded_fn (from), 9);
+ /* A baselink is also considered an overloaded function. */
+ if (TREE_CODE (from) == TREE_LIST)
+ from = TREE_VALUE (from);
+ return OVL_CURRENT (from);
+}
- if (really_overloaded_fn (from))
- return TREE_VALUE (from);
- else
- return from;
+/* Return a new OVL node, concatenating it with the old one. */
+
+tree
+ovl_cons (decl, chain)
+ tree decl;
+ tree chain;
+{
+ tree result = make_node (OVERLOAD);
+ TREE_TYPE (result) = unknown_type_node;
+ OVL_FUNCTION (result) = decl;
+ TREE_CHAIN (result) = chain;
+
+ return result;
+}
+
+/* Same as ovl_cons, but on the scratch_obstack. */
+
+tree
+scratch_ovl_cons (value, chain)
+ tree value, chain;
+{
+ register tree node;
+ register struct obstack *ambient_obstack = current_obstack;
+ extern struct obstack *expression_obstack;
+ current_obstack = expression_obstack;
+ node = ovl_cons (value, chain);
+ current_obstack = ambient_obstack;
+ return node;
+}
+
+/* Build a new overloaded function. If this is the first one,
+ just return it; otherwise, ovl_cons the _DECLs */
+
+tree
+build_overload (decl, chain)
+ tree decl;
+ tree chain;
+{
+ if (!chain)
+ return decl;
+ if (TREE_CODE (chain) != OVERLOAD)
+ chain = ovl_cons (chain, NULL_TREE);
+ return ovl_cons (decl, chain);
+}
+
+/* True if fn is in ovl. */
+
+int
+ovl_member (fn, ovl)
+ tree fn;
+ tree ovl;
+{
+ if (ovl == NULL_TREE)
+ return 0;
+ if (TREE_CODE (ovl) != OVERLOAD)
+ return decls_match (ovl, fn);
+ for (; ovl; ovl = OVL_CHAIN (ovl))
+ if (decls_match (OVL_FUNCTION (ovl), fn))
+ return 1;
+ return 0;
}
int
@@ -1451,6 +1512,256 @@ copy_template_template_parm (t)
return t2;
}
+/* Walk through the tree structure T, applying func. If func ever returns
+ non-null, return that value. */
+
+static tree
+search_tree (t, func)
+ tree t;
+ tree (*func) PROTO((tree));
+{
+#define TRY(ARG) if (tmp=search_tree (ARG, func), tmp != NULL_TREE) return tmp
+
+ tree tmp;
+
+ if (t == NULL_TREE)
+ return t;
+
+ if (tmp = func (t), tmp != NULL_TREE)
+ return tmp;
+
+ switch (TREE_CODE (t))
+ {
+ case ERROR_MARK:
+ break;
+
+ case IDENTIFIER_NODE:
+ break;
+
+ case VAR_DECL:
+ case FUNCTION_DECL:
+ case CONST_DECL:
+ case TEMPLATE_DECL:
+ case NAMESPACE_DECL:
+ break;
+
+ case TYPE_DECL:
+ TRY (TREE_TYPE (t));
+ break;
+
+ case PARM_DECL:
+ TRY (TREE_TYPE (t));
+ TRY (TREE_CHAIN (t));
+ break;
+
+ case TREE_LIST:
+ TRY (TREE_PURPOSE (t));
+ TRY (TREE_VALUE (t));
+ TRY (TREE_CHAIN (t));
+ break;
+
+ case OVERLOAD:
+ TRY (OVL_FUNCTION (t));
+ TRY (OVL_CHAIN (t));
+ break;
+
+ case TREE_VEC:
+ {
+ int len = TREE_VEC_LENGTH (t);
+
+ t = copy_node (t);
+ while (len--)
+ TRY (TREE_VEC_ELT (t, len));
+ }
+ break;
+
+ case INTEGER_CST:
+ case REAL_CST:
+ case STRING_CST:
+ case DEFAULT_ARG:
+ break;
+
+ case PTRMEM_CST:
+ TRY (TREE_TYPE (t));
+ break;
+
+ case COND_EXPR:
+ case TARGET_EXPR:
+ case AGGR_INIT_EXPR:
+ case NEW_EXPR:
+ TRY (TREE_OPERAND (t, 0));
+ TRY (TREE_OPERAND (t, 1));
+ TRY (TREE_OPERAND (t, 2));
+ break;
+
+ case MODIFY_EXPR:
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ case MULT_EXPR:
+ case TRUNC_DIV_EXPR:
+ case TRUNC_MOD_EXPR:
+ case MIN_EXPR:
+ case MAX_EXPR:
+ case LSHIFT_EXPR:
+ case RSHIFT_EXPR:
+ case BIT_IOR_EXPR:
+ case BIT_XOR_EXPR:
+ case BIT_AND_EXPR:
+ case BIT_ANDTC_EXPR:
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
+ case LT_EXPR:
+ case LE_EXPR:
+ case GT_EXPR:
+ case GE_EXPR:
+ case EQ_EXPR:
+ case NE_EXPR:
+ case CEIL_DIV_EXPR:
+ case FLOOR_DIV_EXPR:
+ case ROUND_DIV_EXPR:
+ case CEIL_MOD_EXPR:
+ case FLOOR_MOD_EXPR:
+ case ROUND_MOD_EXPR:
+ case COMPOUND_EXPR:
+ case PREDECREMENT_EXPR:
+ case PREINCREMENT_EXPR:
+ case POSTDECREMENT_EXPR:
+ case POSTINCREMENT_EXPR:
+ case ARRAY_REF:
+ case SCOPE_REF:
+ case TRY_CATCH_EXPR:
+ case WITH_CLEANUP_EXPR:
+ case CALL_EXPR:
+ TRY (TREE_OPERAND (t, 0));
+ TRY (TREE_OPERAND (t, 1));
+ break;
+
+ case SAVE_EXPR:
+ case CONVERT_EXPR:
+ case ADDR_EXPR:
+ case INDIRECT_REF:
+ case NEGATE_EXPR:
+ case BIT_NOT_EXPR:
+ case TRUTH_NOT_EXPR:
+ case NOP_EXPR:
+ case NON_LVALUE_EXPR:
+ case COMPONENT_REF:
+ case CLEANUP_POINT_EXPR:
+ case LOOKUP_EXPR:
+ case SIZEOF_EXPR:
+ case ALIGNOF_EXPR:
+ TRY (TREE_OPERAND (t, 0));
+ break;
+
+ case MODOP_EXPR:
+ case CAST_EXPR:
+ case REINTERPRET_CAST_EXPR:
+ case CONST_CAST_EXPR:
+ case STATIC_CAST_EXPR:
+ case DYNAMIC_CAST_EXPR:
+ case ARROW_EXPR:
+ case DOTSTAR_EXPR:
+ case TYPEID_EXPR:
+ break;
+
+ case COMPLEX_CST:
+ TRY (TREE_REALPART (t));
+ TRY (TREE_IMAGPART (t));
+ break;
+
+ case CONSTRUCTOR:
+ TRY (CONSTRUCTOR_ELTS (t));
+ break;
+
+ case TEMPLATE_TEMPLATE_PARM:
+ case TEMPLATE_PARM_INDEX:
+ case TEMPLATE_TYPE_PARM:
+ break;
+
+ case BIND_EXPR:
+ break;
+
+ case REAL_TYPE:
+ case COMPLEX_TYPE:
+ case VOID_TYPE:
+ case BOOLEAN_TYPE:
+ case TYPENAME_TYPE:
+ case UNION_TYPE:
+ case ENUMERAL_TYPE:
+ break;
+
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
+ TRY (TREE_TYPE (t));
+ break;
+
+ case FUNCTION_TYPE:
+ case METHOD_TYPE:
+ TRY (TREE_TYPE (t));
+ TRY (TYPE_ARG_TYPES (t));
+ break;
+
+ case ARRAY_TYPE:
+ TRY (TREE_TYPE (t));
+ TRY (TYPE_DOMAIN (t));
+ break;
+
+ case INTEGER_TYPE:
+ TRY (TYPE_MAX_VALUE (t));
+ break;
+
+ case OFFSET_TYPE:
+ TRY (TREE_TYPE (t));
+ TRY (TYPE_OFFSET_BASETYPE (t));
+ break;
+
+ case RECORD_TYPE:
+ if (TYPE_PTRMEMFUNC_P (t))
+ TRY (TYPE_PTRMEMFUNC_FN_TYPE (t));
+ break;
+
+ /* This list is incomplete, but should suffice for now.
+ It is very important that `sorry' not call
+ `report_error_function'. That could cause an infinite loop. */
+ default:
+ sorry ("initializer contains unrecognized tree code");
+ return error_mark_node;
+
+ }
+
+ return NULL_TREE;
+
+#undef TRY
+}
+
+/* Passed to search_tree. Checks for the use of types with no linkage. */
+
+static tree
+no_linkage_helper (t)
+ tree t;
+{
+ if (TYPE_P (t)
+ && (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
+ && (decl_function_context (TYPE_MAIN_DECL (t))
+ || ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))))
+ return t;
+ return NULL_TREE;
+}
+
+/* Check if the type T depends on a type with no linkage and if so, return
+ it. */
+
+tree
+no_linkage_check (t)
+ tree t;
+{
+ t = search_tree (t, no_linkage_helper);
+ if (t != error_mark_node)
+ return t;
+ return NULL_TREE;
+}
+
+
/* Subroutine of copy_to_permanent
Assuming T is a node build bottom-up, make it all exist on
@@ -1514,6 +1825,15 @@ mapcar (t, func)
return t;
}
+ case OVERLOAD:
+ {
+ tree chain = OVL_CHAIN (t);
+ t = copy_node (t);
+ OVL_FUNCTION (t) = mapcar (OVL_FUNCTION (t), func);
+ OVL_CHAIN (t) = mapcar (chain, func);
+ return t;
+ }
+
case TREE_VEC:
{
int len = TREE_VEC_LENGTH (t);
@@ -1529,6 +1849,12 @@ mapcar (t, func)
case STRING_CST:
return copy_node (t);
+ case PTRMEM_CST:
+ t = copy_node (t);
+ TREE_TYPE (t) = mapcar (TREE_TYPE (t), func);
+ PTRMEM_CST_MEMBER (t) = mapcar (PTRMEM_CST_MEMBER (t), func);
+ return t;
+
case COND_EXPR:
case TARGET_EXPR:
case AGGR_INIT_EXPR:
@@ -1592,7 +1918,7 @@ mapcar (t, func)
TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
/* tree.def says that operand two is RTL, but
- build_call_declarator puts trees in there. */
+ make_call_declarator puts trees in there. */
if (TREE_OPERAND (t, 2)
&& TREE_CODE (TREE_OPERAND (t, 2)) == TREE_LIST)
TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
@@ -1662,6 +1988,18 @@ mapcar (t, func)
TREE_OPERAND (t, 2) = NULL_TREE;
return t;
+ case NEW_EXPR:
+ t = copy_node (t);
+ TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
+ TREE_OPERAND (t, 1) = mapcar (TREE_OPERAND (t, 1), func);
+ TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
+ return t;
+
+ case LOOKUP_EXPR:
+ t = copy_node (t);
+ TREE_OPERAND (t, 0) = mapcar (TREE_OPERAND (t, 0), func);
+ return t;
+
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (t))
return build_ptrmemfunc_type
@@ -1900,7 +2238,7 @@ build_min VPROTO((enum tree_code code, tree tt, ...))
t = make_node (code);
length = tree_code_length[(int) code];
- TREE_TYPE (t) = tt;
+ TREE_TYPE (t) = copy_to_permanent (tt);
TREE_COMPLEXITY (t) = lineno;
for (i = 0; i < length; i++)
@@ -2047,7 +2385,23 @@ cp_tree_equal (t1, t2)
TREE_STRING_LENGTH (t1));
case CONSTRUCTOR:
- abort ();
+ /* We need to do this when determining whether or not two
+ non-type pointer to member function template arguments
+ are the same. */
+ if (!(comptypes (TREE_TYPE (t1), TREE_TYPE (t2), 1)
+ /* The first operand is RTL. */
+ && TREE_OPERAND (t1, 0) == TREE_OPERAND (t2, 0)))
+ return 0;
+ return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
+
+ case TREE_LIST:
+ cmp = cp_tree_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2));
+ if (cmp <= 0)
+ return cmp;
+ cmp = cp_tree_equal (TREE_VALUE (t1), TREE_VALUE (t2));
+ if (cmp <= 0)
+ return cmp;
+ return cp_tree_equal (TREE_CHAIN (t1), TREE_CHAIN (t2));
case SAVE_EXPR:
return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
@@ -2105,6 +2459,13 @@ cp_tree_equal (t1, t2)
return comptypes (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0), 1);
break;
+ case PTRMEM_CST:
+ /* Two pointer-to-members are the same if they point to the same
+ field or function in the same class. */
+ return (PTRMEM_CST_MEMBER (t1) == PTRMEM_CST_MEMBER (t2)
+ && comptypes (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2),
+ 1));
+
default:
break;
}
@@ -2180,6 +2541,35 @@ build_int_wrapper (i)
return t;
}
+tree
+build_srcloc (file, line)
+ char *file;
+ int line;
+{
+ tree t;
+
+ /* Make sure that we put these on the permanent obstack; up in
+ add_pending_template, we pass this return value into perm_tree_cons,
+ which also puts it on the permanent_obstack. However, this wasn't
+ explicitly doing the same. */
+ register struct obstack *ambient_obstack = current_obstack;
+ current_obstack = &permanent_obstack;
+
+ t = make_node (SRCLOC);
+ SRCLOC_FILE (t) = file;
+ SRCLOC_LINE (t) = line;
+
+ current_obstack = ambient_obstack;
+
+ return t;
+}
+
+tree
+build_srcloc_here ()
+{
+ return build_srcloc (input_filename, lineno);
+}
+
void
push_expression_obstack ()
{
@@ -2193,8 +2583,10 @@ tree
lvalue_type (arg)
tree arg;
{
- return cp_build_type_variant
- (TREE_TYPE (arg), TREE_READONLY (arg), TREE_THIS_VOLATILE (arg));
+ tree type = TREE_TYPE (arg);
+ if (TREE_CODE (arg) == OVERLOAD)
+ type = unknown_type_node;
+ return type;
}
/* The type of ARG for printing error messages; denote lvalues with
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index e74e925e1f2..02a8c84c06d 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -80,7 +80,9 @@ target_type (type)
}
/* Do `exp = require_complete_type (exp);' to make sure exp
- does not have an incomplete type. (That includes void types.) */
+ does not have an incomplete type. (That includes void types.)
+ Returns the error_mark_node if the VALUE does not have
+ complete type when this function returns. */
tree
require_complete_type (value)
@@ -91,7 +93,10 @@ require_complete_type (value)
if (processing_template_decl)
return value;
- type = TREE_TYPE (value);
+ if (TREE_CODE (value) == OVERLOAD)
+ type = unknown_type_node;
+ else
+ type = TREE_TYPE (value);
/* First, detect a valid value with a complete type. */
if (TYPE_SIZE (type) != 0
@@ -117,17 +122,17 @@ require_complete_type (value)
return require_complete_type (value);
}
- if (IS_AGGR_TYPE (type) && CLASSTYPE_TEMPLATE_INSTANTIATION (type))
- {
- instantiate_class_template (TYPE_MAIN_VARIANT (type));
- if (TYPE_SIZE (type) != 0)
- return value;
- }
-
- incomplete_type_error (value, type);
- return error_mark_node;
+ if (complete_type_or_else (type))
+ return value;
+ else
+ return error_mark_node;
}
+/* Try to complete TYPE, if it is incomplete. For example, if TYPE is
+ a template instantiation, do the instantiation. Returns TYPE,
+ whether or not it could be completed, unless something goes
+ horribly wrong, in which case the error_mark_node is returned. */
+
tree
complete_type (type)
tree type;
@@ -155,13 +160,35 @@ complete_type (type)
return type;
}
+/* Like complete_type, but issue an error if the TYPE cannot be
+ completed. Returns NULL_TREE if the type cannot be made
+ complete. */
+
+tree
+complete_type_or_else (type)
+ tree type;
+{
+ type = complete_type (type);
+ if (type == error_mark_node)
+ /* We already issued an error. */
+ return NULL_TREE;
+ else if (!TYPE_SIZE (type))
+ {
+ incomplete_type_error (NULL_TREE, type);
+ return NULL_TREE;
+ }
+ else
+ return type;
+}
+
/* Return truthvalue of whether type of EXP is instantiated. */
int
type_unknown_p (exp)
tree exp;
{
- return (TREE_CODE (exp) == TREE_LIST
+ return (TREE_CODE (exp) == OVERLOAD
+ || TREE_CODE (exp) == TREE_LIST
|| TREE_TYPE (exp) == unknown_type_node
|| (TREE_CODE (TREE_TYPE (exp)) == OFFSET_TYPE
&& TREE_TYPE (TREE_TYPE (exp)) == unknown_type_node));
@@ -193,7 +220,8 @@ require_instantiated_type (type, exp, errval)
return errval;
}
- if (TREE_TYPE (exp) == unknown_type_node
+ if (TREE_CODE (exp) == OVERLOAD
+ || TREE_TYPE (exp) == unknown_type_node
|| (TREE_CODE (TREE_TYPE (exp)) == OFFSET_TYPE
&& TREE_TYPE (TREE_TYPE (exp)) == unknown_type_node))
{
@@ -288,6 +316,25 @@ commonparms (p1, p2)
return newargs;
}
+/* Given a type, perhaps copied for a typedef,
+ find the "original" version of it. */
+tree
+original_type (t)
+ tree t;
+{
+ while (TYPE_NAME (t) != NULL_TREE)
+ {
+ tree x = TYPE_NAME (t);
+ if (TREE_CODE (x) != TYPE_DECL)
+ break;
+ x = DECL_ORIGINAL_TYPE (x);
+ if (x == NULL_TREE)
+ break;
+ t = x;
+ }
+ return t;
+}
+
/* Return the common type of two types.
We assume that comptypes has already been done and returned 1;
if that isn't so, this may crash.
@@ -307,8 +354,12 @@ common_type (t1, t2)
tree attributes;
/* Save time if the two types are the same. */
-
- if (t1 == t2) return t1;
+ if (t1 == t2)
+ return t1;
+ t1 = original_type (t1);
+ t2 = original_type (t2);
+ if (t1 == t2)
+ return t1;
/* If one type is nonsense, use the other. */
if (t1 == error_mark_node)
@@ -538,7 +589,10 @@ common_type (t1, t2)
else if (binfo_or_else (t2, t1))
return build_type_attribute_variant (t2, attributes);
else
- compiler_error ("common_type called with uncommon aggregate types");
+ {
+ compiler_error ("common_type called with uncommon aggregate types");
+ return error_mark_node;
+ }
case METHOD_TYPE:
if (TREE_CODE (TREE_TYPE (t1)) == TREE_CODE (TREE_TYPE (t2)))
@@ -726,6 +780,8 @@ comptypes (type1, type2, strict)
return 0;
if (TYPE_VOLATILE (t1) != TYPE_VOLATILE (t2))
return 0;
+ if (strict > 0 && TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2))
+ return 0;
/* Allow for two different type nodes which have essentially the same
definition. Note that we already checked for equality of the type
@@ -753,6 +809,9 @@ comptypes (type1, type2, strict)
if (TEMPLATE_TYPE_IDX (t1) != TEMPLATE_TYPE_IDX (t2)
|| TEMPLATE_TYPE_LEVEL (t1) != TEMPLATE_TYPE_LEVEL (t2))
return 0;
+ if (! comp_template_parms (DECL_TEMPLATE_PARMS (TYPE_NAME (t1)),
+ DECL_TEMPLATE_PARMS (TYPE_NAME (t2))))
+ return 0;
if (! CLASSTYPE_TEMPLATE_INFO (t1) && ! CLASSTYPE_TEMPLATE_INFO (t2))
return 1;
/* Don't check inheritance. */
@@ -794,11 +853,12 @@ comptypes (type1, type2, strict)
case REFERENCE_TYPE:
t1 = TREE_TYPE (t1);
t2 = TREE_TYPE (t2);
- if (t1 == t2)
- {
- val = 1;
- break;
- }
+ /* first, check whether the referred types match with the
+ required level of strictness */
+ val = comptypes (t1, t2, strict);
+ if (val)
+ break;
+ /* if they do not, try more relaxed alternatives */
if (strict <= 0)
{
if (TREE_CODE (t1) == RECORD_TYPE && TREE_CODE (t2) == RECORD_TYPE)
@@ -820,8 +880,6 @@ comptypes (type1, type2, strict)
}
return 0;
}
- else
- val = comptypes (t1, t2, strict);
break;
case FUNCTION_TYPE:
@@ -853,6 +911,31 @@ comptypes (type1, type2, strict)
return attrval == 2 && val == 1 ? 2 : val;
}
+/* Subroutine of comp_target-types. Make sure that the cv-quals change
+ only in the same direction as the target type. */
+
+static int
+comp_cv_target_types (ttl, ttr, nptrs)
+ tree ttl, ttr;
+ int nptrs;
+{
+ int t;
+ int c = TYPE_READONLY (ttl) - TYPE_READONLY (ttr);
+ int v = TYPE_VOLATILE (ttl) - TYPE_VOLATILE (ttr);
+
+ if ((c > 0 && v < 0) || (c < 0 && v > 0))
+ return 0;
+
+ if (TYPE_MAIN_VARIANT (ttl) == TYPE_MAIN_VARIANT (ttr))
+ return (c + v < 0) ? -1 : 1;
+
+ t = comp_target_types (ttl, ttr, nptrs);
+ if ((t == 1 && c + v >= 0) || (t == -1 && c + v <= 0))
+ return t;
+
+ return 0;
+}
+
/* Return 1 or -1 if TTL and TTR are pointers to types that are equivalent,
ignoring their qualifiers, 0 if not. Return 1 means that TTR can be
converted to TTL. Return -1 means that TTL can be converted to TTR but
@@ -878,15 +961,20 @@ comp_target_types (ttl, ttr, nptrs)
if (TREE_CODE (ttr) != TREE_CODE (ttl))
return 0;
- if (TREE_CODE (ttr) == POINTER_TYPE
- || (TREE_CODE (ttr) == REFERENCE_TYPE))
+ if ((TREE_CODE (ttr) == POINTER_TYPE
+ || TREE_CODE (ttr) == REFERENCE_TYPE)
+ /* If we get a pointer with nptrs == 0, we don't allow any tweaking
+ of the type pointed to. This is necessary for reference init
+ semantics. We won't get here from a previous call with nptrs == 1;
+ for multi-level pointers we end up in comp_ptr_ttypes. */
+ && nptrs > 0)
{
int is_ptr = TREE_CODE (ttr) == POINTER_TYPE;
ttl = TREE_TYPE (ttl);
ttr = TREE_TYPE (ttr);
- if (nptrs > 0 && is_ptr)
+ if (is_ptr)
{
if (TREE_CODE (ttl) == UNKNOWN_TYPE
|| TREE_CODE (ttr) == UNKNOWN_TYPE)
@@ -917,25 +1005,7 @@ comp_target_types (ttl, ttr, nptrs)
if (TREE_CODE (ttl) == FUNCTION_TYPE || TREE_CODE (ttl) == METHOD_TYPE)
return comp_target_types (ttl, ttr, nptrs - 1);
- /* Make sure that the cv-quals change only in the same direction as
- the target type. */
- {
- int t;
- int c = TYPE_READONLY (ttl) - TYPE_READONLY (ttr);
- int v = TYPE_VOLATILE (ttl) - TYPE_VOLATILE (ttr);
-
- if ((c > 0 && v < 0) || (c < 0 && v > 0))
- return 0;
-
- if (TYPE_MAIN_VARIANT (ttl) == TYPE_MAIN_VARIANT (ttr))
- return (c + v < 0) ? -1 : 1;
-
- t = comp_target_types (ttl, ttr, nptrs - 1);
- if ((t == 1 && c + v >= 0) || (t == -1 && c + v <= 0))
- return t;
-
- return 0;
- }
+ return comp_cv_target_types (ttl, ttr, nptrs - 1);
}
if (TREE_CODE (ttr) == ARRAY_TYPE)
@@ -995,16 +1065,41 @@ comp_target_types (ttl, ttr, nptrs)
/* for C++ */
else if (TREE_CODE (ttr) == OFFSET_TYPE)
{
+ int base;
+
/* Contravariance: we can assign a pointer to base member to a pointer
to derived member. Note difference from simple pointer case, where
we can pass a pointer to derived to a pointer to base. */
if (comptypes (TYPE_OFFSET_BASETYPE (ttr),
TYPE_OFFSET_BASETYPE (ttl), 0))
- return comp_target_types (TREE_TYPE (ttl), TREE_TYPE (ttr), nptrs);
+ base = 1;
else if (comptypes (TYPE_OFFSET_BASETYPE (ttl),
- TYPE_OFFSET_BASETYPE (ttr), 0)
- && comp_target_types (TREE_TYPE (ttl), TREE_TYPE (ttr), nptrs))
- return -1;
+ TYPE_OFFSET_BASETYPE (ttr), 0))
+ {
+ tree tmp = ttl;
+ ttl = ttr;
+ ttr = tmp;
+ base = -1;
+ }
+ else
+ return 0;
+
+ ttl = TREE_TYPE (ttl);
+ ttr = TREE_TYPE (ttr);
+
+ if (TREE_CODE (ttl) == POINTER_TYPE
+ || TREE_CODE (ttl) == ARRAY_TYPE)
+ {
+ if (comp_ptr_ttypes (ttl, ttr))
+ return base;
+ return 0;
+ }
+ else
+ {
+ if (comp_cv_target_types (ttl, ttr, nptrs) == 1)
+ return base;
+ return 0;
+ }
}
else if (IS_AGGR_TYPE (ttl))
{
@@ -1020,6 +1115,46 @@ comp_target_types (ttl, ttr, nptrs)
return 0;
}
+/* Returns 1 if TYPE1 is more cv-qualified than TYPE2, -1 if TYPE2 is
+ more cv-qualified that TYPE1, and 0 otherwise. */
+
+int
+comp_cv_qualification (type1, type2)
+ tree type1;
+ tree type2;
+{
+ if (TYPE_READONLY (type1) == TYPE_READONLY (type2)
+ && TYPE_VOLATILE (type1) == TYPE_VOLATILE (type2))
+ return 0;
+
+ if (TYPE_READONLY (type1) >= TYPE_READONLY (type2)
+ && TYPE_VOLATILE (type1) >= TYPE_VOLATILE (type2))
+ return 1;
+
+ if (TYPE_READONLY (type2) >= TYPE_READONLY (type1)
+ && TYPE_VOLATILE (type2) >= TYPE_VOLATILE (type1))
+ return -1;
+
+ return 0;
+}
+
+/* Returns 1 if the cv-qualification signature of TYPE1 is a proper
+ subset of the cv-qualification signature of TYPE2, and the types
+ are similar. Returns -1 if the other way 'round, and 0 otherwise. */
+
+int
+comp_cv_qual_signature (type1, type2)
+ tree type1;
+ tree type2;
+{
+ if (comp_ptr_ttypes_real (type2, type1, -1))
+ return 1;
+ else if (comp_ptr_ttypes_real (type1, type2, -1))
+ return -1;
+ else
+ return 0;
+}
+
/* If two types share a common base type, return that basetype.
If there is not a unique most-derived base type, this function
returns ERROR_MARK_NODE. */
@@ -1087,7 +1222,7 @@ common_base_type (tt1, tt2)
int
compparms (parms1, parms2, strict)
tree parms1, parms2;
- int strict;
+ int strict ATTRIBUTE_UNUSED;
{
register tree t1 = parms1, t2 = parms2;
@@ -1549,9 +1684,7 @@ decay_conversion (exp)
if (code == ARRAY_TYPE)
{
register tree adr;
- tree restype;
tree ptrtype;
- int constp, volatilep;
if (TREE_CODE (exp) == INDIRECT_REF)
{
@@ -1583,21 +1716,7 @@ decay_conversion (exp)
return error_mark_node;
}
- constp = volatilep = 0;
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'r'
- || TREE_CODE_CLASS (TREE_CODE (exp)) == 'd')
- {
- constp = TREE_READONLY (exp);
- volatilep = TREE_THIS_VOLATILE (exp);
- }
-
- restype = TREE_TYPE (type);
- if (TYPE_READONLY (type) || TYPE_VOLATILE (type)
- || constp || volatilep)
- restype = cp_build_type_variant (restype,
- TYPE_READONLY (type) || constp,
- TYPE_VOLATILE (type) || volatilep);
- ptrtype = build_pointer_type (restype);
+ ptrtype = build_pointer_type (TREE_TYPE (type));
if (TREE_CODE (exp) == VAR_DECL)
{
@@ -1658,6 +1777,42 @@ inline_conversion (exp)
}
return exp;
}
+
+/* Returns nonzero iff exp is a STRING_CST or the result of applying
+ decay_conversion to one. */
+
+int
+string_conv_p (totype, exp, warn)
+ tree totype, exp;
+ int warn;
+{
+ tree t;
+
+ if (! flag_const_strings || TREE_CODE (totype) != POINTER_TYPE)
+ return 0;
+
+ t = TREE_TYPE (totype);
+ if (! comptypes (t, char_type_node, 1)
+ && ! comptypes (t, wchar_type_node, 1))
+ return 0;
+
+ if (TREE_CODE (exp) != STRING_CST)
+ {
+ t = build_pointer_type (build_type_variant (t, 1, 0));
+ if (! comptypes (TREE_TYPE (exp), t, 1))
+ return 0;
+ STRIP_NOPS (exp);
+ if (TREE_CODE (exp) != ADDR_EXPR
+ || TREE_CODE (TREE_OPERAND (exp, 0)) != STRING_CST)
+ return 0;
+ }
+
+ /* This warning is not very useful, as it complains about printf. */
+ if (warn && warn_write_strings)
+ cp_warning ("deprecated conversion from string constant to `char *'");
+
+ return 1;
+}
tree
build_object_ref (datum, basetype, field)
@@ -1783,14 +1938,24 @@ build_component_ref (datum, component, basetype_path, protect)
tree datum, component, basetype_path;
int protect;
{
- register tree basetype = TREE_TYPE (datum);
+ register tree basetype;
register enum tree_code code;
register tree field = NULL;
register tree ref;
+ tree field_type;
+ int constp;
+ int volatilep;
if (processing_template_decl)
return build_min_nt (COMPONENT_REF, datum, component);
+
+ if (datum == error_mark_node
+ || TREE_TYPE (datum) == error_mark_node)
+ return error_mark_node;
+ /* BASETYPE holds the type of the class containing the COMPONENT. */
+ basetype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
+
/* If DATUM is a COMPOUND_EXPR or COND_EXPR, move our reference
inside it. */
switch (TREE_CODE (datum))
@@ -1824,21 +1989,25 @@ build_component_ref (datum, component, basetype_path, protect)
if (code == REFERENCE_TYPE)
{
datum = convert_from_reference (datum);
- basetype = TREE_TYPE (datum);
+ basetype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
code = TREE_CODE (basetype);
}
if (TREE_CODE (datum) == OFFSET_REF)
{
datum = resolve_offset_ref (datum);
- basetype = TREE_TYPE (datum);
+ basetype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
code = TREE_CODE (basetype);
}
/* First, see if there is a field or component with name COMPONENT. */
if (TREE_CODE (component) == TREE_LIST)
{
+ /* I could not trigger this code. MvL */
+ my_friendly_abort (980326);
+#ifdef DEAD
my_friendly_assert (!(TREE_CHAIN (component) == NULL_TREE
&& DECL_CHAIN (TREE_VALUE (component)) == NULL_TREE), 309);
+#endif
return build (COMPONENT_REF, TREE_TYPE (component), datum, component);
}
@@ -1850,11 +2019,8 @@ build_component_ref (datum, component, basetype_path, protect)
return error_mark_node;
}
- if (TYPE_SIZE (complete_type (basetype)) == 0)
- {
- incomplete_type_error (0, basetype);
- return error_mark_node;
- }
+ if (!complete_type_or_else (basetype))
+ return error_mark_node;
if (TREE_CODE (component) == BIT_NOT_EXPR)
{
@@ -1879,10 +2045,12 @@ build_component_ref (datum, component, basetype_path, protect)
hierarchy, the compiler will abort (because vptr lookups are
not supposed to be ambiguous. */
field = CLASSTYPE_VFIELD (basetype);
- else if (TREE_CODE (component) == FIELD_DECL
- || TREE_CODE (component) == TYPE_DECL)
+ else if (TREE_CODE (component) == FIELD_DECL)
+ field = component;
+ else if (TREE_CODE (component) == TYPE_DECL)
{
- field = component;
+ cp_pedwarn ("invalid use of type decl `%#D' as expression", component);
+ return component;
}
else
{
@@ -1907,12 +2075,12 @@ build_component_ref (datum, component, basetype_path, protect)
if (fndecls)
{
if (TREE_CHAIN (fndecls) == NULL_TREE
- && DECL_CHAIN (TREE_VALUE (fndecls)) == NULL_TREE)
+ && TREE_CODE (TREE_VALUE (fndecls)) != OVERLOAD)
{
tree access, fndecl;
/* Unique, so use this one now. */
- basetype = TREE_PURPOSE (fndecls);
+ basetype = TYPE_MAIN_VARIANT (TREE_PURPOSE (fndecls));
fndecl = TREE_VALUE (fndecls);
access = compute_access (TREE_PURPOSE (fndecls), fndecl);
if (access == access_public_node)
@@ -1969,10 +2137,7 @@ build_component_ref (datum, component, basetype_path, protect)
if (TREE_CODE (field) != FIELD_DECL)
{
if (TREE_CODE (field) == TYPE_DECL)
- {
- cp_error ("invalid use of type decl `%#D' as expression", field);
- return error_mark_node;
- }
+ cp_pedwarn ("invalid use of type decl `%#D' as expression", field);
else if (DECL_RTL (field) != 0)
mark_used (field);
else
@@ -1987,8 +2152,8 @@ build_component_ref (datum, component, basetype_path, protect)
{
tree context = DECL_FIELD_CONTEXT (field);
tree base = context;
- while (base != basetype && TYPE_NAME (base)
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (base)))
+ while (!comptypes (base, basetype,1) && TYPE_NAME (base)
+ && ANON_UNION_TYPE_P (base))
{
base = TYPE_CONTEXT (base);
}
@@ -2018,7 +2183,7 @@ build_component_ref (datum, component, basetype_path, protect)
basetype = base;
/* Handle things from anon unions here... */
- if (TYPE_NAME (context) && ANON_AGGRNAME_P (TYPE_IDENTIFIER (context)))
+ if (TYPE_NAME (context) && ANON_UNION_TYPE_P (context))
{
tree subfield = lookup_anon_field (basetype, context);
tree subdatum = build_component_ref (datum, subfield,
@@ -2027,15 +2192,40 @@ build_component_ref (datum, component, basetype_path, protect)
}
}
- ref = fold (build (COMPONENT_REF, TREE_TYPE (field),
+ /* Compute the type of the field, as described in [expr.ref]. */
+ constp = 0;
+ volatilep = 0;
+ field_type = TREE_TYPE (field);
+ if (TREE_CODE (field_type) == REFERENCE_TYPE)
+ /* The standard says that the type of the result should be the
+ type referred to by the reference. But for now, at least, we
+ do the conversion from reference type later. */
+ ;
+ else
+ {
+ /* A field is const (volatile) if the enclosing object, or the
+ field itself, is const (volatile). But, a mutable field is
+ not const, even within a const object. */
+ constp = (!(DECL_LANG_SPECIFIC (field)
+ && DECL_MUTABLE_P (field))
+ && (TYPE_READONLY (field_type)
+ || TYPE_READONLY (TREE_TYPE (datum))));
+ volatilep = (TYPE_VOLATILE (field_type)
+ || TYPE_VOLATILE (TREE_TYPE (datum)));
+ if (!IS_SIGNATURE (field_type))
+ field_type = cp_build_type_variant (field_type, constp, volatilep);
+ }
+
+ ref = fold (build (COMPONENT_REF, field_type,
break_out_cleanups (datum), field));
- if (TREE_READONLY (datum) || TREE_READONLY (field))
+ /* Mark the expression const or volatile, as appropriate. Even
+ though we've dealt with the type above, we still have to mark the
+ expression itself. */
+ if (constp)
TREE_READONLY (ref) = 1;
- if (TREE_THIS_VOLATILE (datum) || TREE_THIS_VOLATILE (field))
+ else if (volatilep)
TREE_THIS_VOLATILE (ref) = 1;
- if (DECL_MUTABLE_P (field))
- TREE_READONLY (ref) = 0;
return ref;
}
@@ -2099,29 +2289,34 @@ build_indirect_ref (ptr, errorstring)
if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE)
{
+ /* [expr.unary.op]
+
+ If the type of the expression is "pointer to T," the type
+ of the result is "T."
+
+ We must use the canonical variant because certain parts of
+ the back end, like fold, do pointer comparisons between
+ types. */
+ tree t = canonical_type_variant (TREE_TYPE (type));
+
if (TREE_CODE (pointer) == ADDR_EXPR
&& !flag_volatile
- && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (pointer, 0)))
- == TYPE_MAIN_VARIANT (TREE_TYPE (type)))
- && (TREE_READONLY (TREE_OPERAND (pointer, 0))
- == TYPE_READONLY (TREE_TYPE (type)))
- && (TREE_THIS_VOLATILE (TREE_OPERAND (pointer, 0))
- == TYPE_VOLATILE (TREE_TYPE (type))))
+ && comptypes (t, TREE_TYPE (TREE_OPERAND (pointer, 0)), 1))
+ /* The POINTER was something like `&x'. We simplify `*&x' to
+ `x'. */
return TREE_OPERAND (pointer, 0);
else
{
- tree t = TREE_TYPE (type);
- register tree ref = build1 (INDIRECT_REF,
- TYPE_MAIN_VARIANT (t), pointer);
+ tree ref = build1 (INDIRECT_REF, t, pointer);
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
TREE_READONLY (ref) = TYPE_READONLY (t);
+ TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t);
TREE_SIDE_EFFECTS (ref)
- = (TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer)
+ = (TREE_THIS_VOLATILE (ref) || TREE_SIDE_EFFECTS (pointer)
|| flag_volatile);
- TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t);
return ref;
}
}
@@ -2232,23 +2427,16 @@ build_array_ref (array, idx)
warning ("subscripting array declared `register'");
}
- type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
+ type = TREE_TYPE (TREE_TYPE (array));
rval = build (ARRAY_REF, type, array, idx);
/* Array ref is const/volatile if the array elements are
or if the array is.. */
TREE_READONLY (rval)
- |= (TYPE_READONLY (TREE_TYPE (TREE_TYPE (array)))
- | TREE_READONLY (array));
+ |= (TYPE_READONLY (type) | TREE_READONLY (array));
TREE_SIDE_EFFECTS (rval)
- |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
- | TREE_SIDE_EFFECTS (array));
+ |= (TYPE_VOLATILE (type) | TREE_SIDE_EFFECTS (array));
TREE_THIS_VOLATILE (rval)
- |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
- /* This was added by rms on 16 Nov 91.
- It fixes vol struct foo *a; a->elts[1]
- in an inline function.
- Hope it doesn't break something else. */
- | TREE_THIS_VOLATILE (array));
+ |= (TYPE_VOLATILE (type) | TREE_THIS_VOLATILE (array));
return require_complete_type (fold (rval));
}
@@ -2342,6 +2530,8 @@ build_x_function_call (function, params, decl)
my_friendly_assert (TREE_CODE (function) == TREE_LIST, 999);
my_friendly_assert (TREE_CHAIN (function) == NULL_TREE, 999);
function = TREE_VALUE (function);
+ if (TREE_CODE (function) == OVERLOAD)
+ function = OVL_FUNCTION (function);
my_friendly_assert (TREE_CODE (function) == FUNCTION_DECL, 999);
function = DECL_NAME (function);
return build_method_call (decl, function, params,
@@ -2365,7 +2555,7 @@ build_x_function_call (function, params, decl)
/* A friend template. Make it look like a toplevel declaration. */
if (! is_method && TREE_CODE (function) == TEMPLATE_DECL)
- function = build_scratch_list (NULL_TREE, function);
+ function = scratch_ovl_cons (function, NULL_TREE);
/* Handle methods, friends, and overloaded functions, respectively. */
if (is_method)
@@ -2453,7 +2643,7 @@ build_x_function_call (function, params, decl)
}
else if (really_overloaded_fn (function))
{
- if (TREE_VALUE (function) == NULL_TREE)
+ if (OVL_FUNCTION (function) == NULL_TREE)
{
cp_error ("function `%D' declared overloaded, but no definitions appear with which to resolve it?!?",
TREE_PURPOSE (function));
@@ -2467,6 +2657,9 @@ build_x_function_call (function, params, decl)
return build_new_function_call (function, params);
}
}
+ else
+ /* Remove a potential OVERLOAD around it */
+ function = OVL_CURRENT (function);
do_x_function:
if (TREE_CODE (function) == OFFSET_REF)
@@ -2481,8 +2674,19 @@ build_x_function_call (function, params, decl)
decl = current_class_ref;
decl_addr = build_unary_op (ADDR_EXPR, decl, 0);
- function = get_member_function_from_ptrfunc (&decl_addr,
- TREE_OPERAND (function, 1));
+
+ /* Sigh. OFFSET_REFs are being used for too many things.
+ They're being used both for -> and ->*, and we want to resolve
+ the -> cases here, but leave the ->*. We could use
+ resolve_offset_ref for those, too, but it would call
+ get_member_function_from_ptrfunc and decl_addr wouldn't get
+ updated properly. Nasty. */
+ if (TREE_CODE (TREE_OPERAND (function, 1)) == FIELD_DECL)
+ function = resolve_offset_ref (function);
+ else
+ function = TREE_OPERAND (function, 1);
+
+ function = get_member_function_from_ptrfunc (&decl_addr, function);
params = expr_tree_cons (NULL_TREE, decl_addr, params);
return build_function_call (function, params);
}
@@ -2556,7 +2760,7 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function)))
{
tree fntype, idx, e1, delta, delta2, e2, e3, aref, vtbl;
- tree instance;
+ tree instance, basetype;
tree instance_ptr = *instance_ptrptr;
@@ -2567,61 +2771,76 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
function = save_expr (function);
fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function));
+ basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (fntype));
- /* Promoting idx before saving it improves performance on RISC
- targets. Without promoting, the first compare used
- load-with-sign-extend, while the second used normal load then
- shift to sign-extend. An optimizer flaw, perhaps, but it's easier
- to make this change. */
- idx = save_expr (default_conversion
- (build_component_ref (function,
- index_identifier,
- NULL_TREE, 0)));
- e1 = build_binary_op (GT_EXPR, idx, integer_zero_node, 1);
delta = cp_convert (ptrdiff_type_node,
build_component_ref (function, delta_identifier,
NULL_TREE, 0));
- delta2 = DELTA2_FROM_PTRMEMFUNC (function);
-
- /* Convert down to the right base, before using the instance. */
- instance
- = convert_pointer_to_real (TYPE_METHOD_BASETYPE (TREE_TYPE (fntype)),
- instance_ptr);
- if (instance == error_mark_node && instance_ptr != error_mark_node)
- return instance;
-
- vtbl = convert_pointer_to (ptr_type_node, instance);
- vtbl
- = build (PLUS_EXPR,
- build_pointer_type (build_pointer_type (vtable_entry_type)),
- vtbl, cp_convert (ptrdiff_type_node, delta2));
- vtbl = build_indirect_ref (vtbl, NULL_PTR);
- aref = build_array_ref (vtbl, build_binary_op (MINUS_EXPR,
- idx,
- integer_one_node, 1));
- if (! flag_vtable_thunks)
- {
- aref = save_expr (aref);
-
- delta = build_binary_op
+ e3 = PFN_FROM_PTRMEMFUNC (function);
+
+ if (TYPE_SIZE (basetype) != NULL_TREE
+ && ! TYPE_VIRTUAL_P (basetype))
+ /* If basetype doesn't have virtual functions, don't emit code to
+ handle that case. */
+ e1 = e3;
+ else
+ {
+ /* Promoting idx before saving it improves performance on RISC
+ targets. Without promoting, the first compare used
+ load-with-sign-extend, while the second used normal load then
+ shift to sign-extend. An optimizer flaw, perhaps, but it's
+ easier to make this change. */
+ idx = save_expr (default_conversion
+ (build_component_ref (function,
+ index_identifier,
+ NULL_TREE, 0)));
+ e1 = build_binary_op (GT_EXPR, idx, integer_zero_node, 1);
+
+ /* Convert down to the right base, before using the instance. */
+ instance = convert_pointer_to_real (basetype, instance_ptr);
+ if (instance == error_mark_node && instance_ptr != error_mark_node)
+ return instance;
+
+ vtbl = convert_pointer_to (ptr_type_node, instance);
+ delta2 = DELTA2_FROM_PTRMEMFUNC (function);
+ vtbl = build
(PLUS_EXPR,
- build_conditional_expr (e1, build_component_ref (aref,
+ build_pointer_type (build_pointer_type (vtable_entry_type)),
+ vtbl, cp_convert (ptrdiff_type_node, delta2));
+ vtbl = build_indirect_ref (vtbl, NULL_PTR);
+ aref = build_array_ref (vtbl, build_binary_op (MINUS_EXPR,
+ idx,
+ integer_one_node, 1));
+ if (! flag_vtable_thunks)
+ {
+ aref = save_expr (aref);
+
+ delta = build_binary_op
+ (PLUS_EXPR,
+ build_conditional_expr (e1,
+ build_component_ref (aref,
delta_identifier,
NULL_TREE, 0),
- integer_zero_node),
- delta, 1);
+ integer_zero_node),
+ delta, 1);
+ }
+
+ if (flag_vtable_thunks)
+ e2 = aref;
+ else
+ e2 = build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
+ TREE_TYPE (e2) = TREE_TYPE (e3);
+ e1 = build_conditional_expr (e1, e2, e3);
+
+ /* Make sure this doesn't get evaluated first inside one of the
+ branches of the COND_EXPR. */
+ if (TREE_CODE (instance_ptr) == SAVE_EXPR)
+ e1 = build (COMPOUND_EXPR, TREE_TYPE (e1),
+ instance_ptr, e1);
}
*instance_ptrptr = build (PLUS_EXPR, TREE_TYPE (instance_ptr),
instance_ptr, delta);
- if (flag_vtable_thunks)
- e2 = aref;
- else
- e2 = build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
-
- e3 = PFN_FROM_PTRMEMFUNC (function);
- TREE_TYPE (e2) = TREE_TYPE (e3);
- e1 = build_conditional_expr (e1, e2, e3);
if (instance_ptr == error_mark_node
&& TREE_CODE (e1) != ADDR_EXPR
@@ -2629,12 +2848,6 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
cp_error ("object missing in `%E'", function);
function = e1;
-
- /* Make sure this doesn't get evaluated first inside one of the
- branches of the COND_EXPR. */
- if (TREE_CODE (instance_ptr) == SAVE_EXPR)
- function = build (COMPOUND_EXPR, TREE_TYPE (function),
- instance_ptr, function);
}
return function;
}
@@ -2669,14 +2882,8 @@ build_function_call_real (function, params, require_complete, flags)
fndecl = function;
/* Convert anything with function type to a pointer-to-function. */
- if (pedantic
- && name
- && IDENTIFIER_LENGTH (name) == 4
- && ! strcmp (IDENTIFIER_POINTER (name), "main")
- && DECL_CONTEXT (function) == NULL_TREE)
- {
- pedwarn ("ANSI C++ forbids calling `main' from within program");
- }
+ if (pedantic && DECL_MAIN_P (function))
+ pedwarn ("ANSI C++ forbids calling `main' from within program");
/* Differs from default_conversion by not setting TREE_ADDRESSABLE
(because calling an inline function does not mean the function
@@ -2725,10 +2932,10 @@ build_function_call_real (function, params, require_complete, flags)
function prototype, or apply default promotions. */
if (flags & LOOKUP_COMPLAIN)
- coerced_params = convert_arguments (NULL_TREE, TYPE_ARG_TYPES (fntype),
+ coerced_params = convert_arguments (TYPE_ARG_TYPES (fntype),
params, fndecl, LOOKUP_NORMAL);
else
- coerced_params = convert_arguments (NULL_TREE, TYPE_ARG_TYPES (fntype),
+ coerced_params = convert_arguments (TYPE_ARG_TYPES (fntype),
params, fndecl, 0);
if (coerced_params == error_mark_node)
@@ -2794,12 +3001,6 @@ build_function_call (function, params)
If parmdecls is exhausted, or when an element has NULL as its type,
perform the default conversions.
- RETURN_LOC is the location of the return value, if known, NULL_TREE
- otherwise. This is useful in the case where we can avoid creating
- a temporary variable in the case where we can initialize the return
- value directly. If we are not eliding constructors, then we set this
- to NULL_TREE to avoid this avoidance.
-
NAME is an IDENTIFIER_NODE or 0. It is used only for error messages.
This is also where warnings about wrong number of args are generated.
@@ -2813,8 +3014,8 @@ build_function_call (function, params)
default arguments, if such were specified. Do so here. */
tree
-convert_arguments (return_loc, typelist, values, fndecl, flags)
- tree return_loc, typelist, values, fndecl;
+convert_arguments (typelist, values, fndecl, flags)
+ tree typelist, values, fndecl;
int flags;
{
register tree typetail, valtail;
@@ -2822,9 +3023,6 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
char *called_thing = 0;
int i = 0;
- if (! flag_elide_constructors)
- return_loc = 0;
-
/* Argument passing is always copy-initialization. */
flags |= LOOKUP_ONLYCONVERTING;
@@ -2929,7 +3127,7 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
else
{
parmval = convert_for_initialization
- (return_loc, type, val, flags,
+ (NULL_TREE, type, val, flags,
"argument passing", fndecl, i);
#ifdef PROMOTE_PROTOTYPES
if ((TREE_CODE (type) == INTEGER_TYPE
@@ -2950,24 +3148,9 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
if (TREE_CODE (TREE_TYPE (val)) == REFERENCE_TYPE)
val = convert_from_reference (val);
- if (TREE_CODE (TREE_TYPE (val)) == REAL_TYPE
- && (TYPE_PRECISION (TREE_TYPE (val))
- < TYPE_PRECISION (double_type_node)))
- /* Convert `float' to `double'. */
- result = expr_tree_cons (NULL_TREE,
- cp_convert (double_type_node, val),
- result);
- else if (IS_AGGR_TYPE (TREE_TYPE (val))
- && ! TYPE_HAS_TRIVIAL_INIT_REF (TREE_TYPE (val)))
- {
- cp_warning ("cannot pass objects of type `%T' through `...'",
- TREE_TYPE (val));
- result = expr_tree_cons (NULL_TREE, val, result);
- }
- else
- /* Convert `short' and `char' to full-size `int'. */
- result = expr_tree_cons (NULL_TREE, default_conversion (val),
- result);
+ result = expr_tree_cons (NULL_TREE,
+ convert_arg_to_ellipsis (val),
+ result);
}
if (typetail)
@@ -2982,37 +3165,8 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
for (; typetail != void_list_node; ++i)
{
tree type = TREE_VALUE (typetail);
- tree val = break_out_target_exprs (TREE_PURPOSE (typetail));
- tree parmval;
-
- if (val == NULL_TREE)
- parmval = error_mark_node;
- else if (TREE_CODE (val) == CONSTRUCTOR)
- {
- parmval = digest_init (type, val, (tree *)0);
- parmval = convert_for_initialization (return_loc, type,
- parmval, flags,
- "default constructor",
- fndecl, i);
- }
- else
- {
- /* This could get clobbered by the following call. */
- if (TREE_HAS_CONSTRUCTOR (val))
- val = copy_node (val);
-
- parmval = convert_for_initialization (return_loc, type,
- val, flags,
- "default argument",
- fndecl, i);
-#ifdef PROMOTE_PROTOTYPES
- if ((TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
- && (TYPE_PRECISION (type)
- < TYPE_PRECISION (integer_type_node)))
- parmval = default_conversion (parmval);
-#endif
- }
+ tree val = TREE_PURPOSE (typetail);
+ tree parmval = convert_default_arg (type, val);
if (parmval == error_mark_node)
return error_mark_node;
@@ -3299,9 +3453,9 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
if (code1 == INTEGER_TYPE && integer_zerop (op1))
- cp_warning ("division by zero in `%E % 0'", op0);
+ cp_warning ("division by zero in `%E %% 0'", op0);
else if (code1 == REAL_TYPE && real_zerop (op1))
- cp_warning ("division by zero in `%E % 0.'", op0);
+ cp_warning ("division by zero in `%E %% 0.'", op0);
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
@@ -3766,8 +3920,7 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
tree primop1 = get_narrower (op1, &unsignedp1);
/* Check for comparison of different enum types. */
- if (flag_int_enum_equivalence == 0
- && TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE
+ if (TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE
&& TREE_CODE (TREE_TYPE (orig_op1)) == ENUMERAL_TYPE
&& TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
!= TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1)))
@@ -3880,6 +4033,25 @@ build_binary_op_nodefault (code, orig_op0, orig_op1, error_code)
return error_mark_node;
}
+ /* Issue warnings about peculiar, but legal, uses of NULL. */
+ if (/* It's reasonable to use pointer values as operands of &&
+ and ||, so NULL is no exception. */
+ !(code == TRUTH_ANDIF_EXPR || code == TRUTH_ORIF_EXPR)
+ && (/* If OP0 is NULL and OP1 is not a pointer, or vice versa. */
+ (orig_op0 == null_node
+ && TREE_CODE (TREE_TYPE (op1)) != POINTER_TYPE)
+ /* Or vice versa. */
+ || (orig_op1 == null_node
+ && TREE_CODE (TREE_TYPE (op0)) != POINTER_TYPE)
+ /* Or, both are NULL and the operation was not a comparison. */
+ || (orig_op0 == null_node && orig_op1 == null_node
+ && code != EQ_EXPR && code != NE_EXPR)))
+ /* Some sort of arithmetic operation involving NULL was
+ performed. Note that pointer-difference and pointer-addition
+ have already been handled above, and so we don't end up here in
+ that case. */
+ cp_warning ("NULL used in arithmetic");
+
if (! converted)
{
if (TREE_TYPE (op0) != result_type)
@@ -3921,6 +4093,9 @@ pointer_int_sum (resultcode, ptrop, intop)
register tree result_type = TREE_TYPE (ptrop);
+ if (!complete_type_or_else (result_type))
+ return error_mark_node;
+
if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
if (pedantic || warn_pointer_arith)
@@ -4010,6 +4185,9 @@ pointer_diff (op0, op1, ptrtype)
tree restype = ptrdiff_type_node;
tree target_type = TREE_TYPE (ptrtype);
+ if (!complete_type_or_else (target_type))
+ return error_mark_node;
+
if (pedantic || warn_pointer_arith)
{
if (TREE_CODE (target_type) == VOID_TYPE)
@@ -4190,6 +4368,7 @@ build_unary_op (code, xarg, noconvert)
if (!noconvert)
arg = default_conversion (arg);
arg = build1 (NON_LVALUE_EXPR, TREE_TYPE (arg), arg);
+ TREE_CONSTANT (arg) = TREE_CONSTANT (TREE_OPERAND (arg, 0));
}
break;
@@ -4425,22 +4604,16 @@ build_unary_op (code, xarg, noconvert)
/* Note that this operation never does default_conversion
regardless of NOCONVERT. */
- argtype = TREE_TYPE (arg);
+ argtype = lvalue_type (arg);
if (TREE_CODE (argtype) == REFERENCE_TYPE)
{
arg = build1
(CONVERT_EXPR,
- build_pointer_type (TREE_TYPE (TREE_TYPE (arg))), arg);
+ build_pointer_type (TREE_TYPE (argtype)), arg);
TREE_CONSTANT (arg) = TREE_CONSTANT (TREE_OPERAND (arg, 0));
return arg;
}
- else if (pedantic
- && TREE_CODE (arg) == FUNCTION_DECL
- && DECL_NAME (arg)
- && DECL_CONTEXT (arg) == NULL_TREE
- && IDENTIFIER_LENGTH (DECL_NAME (arg)) == 4
- && IDENTIFIER_POINTER (DECL_NAME (arg))[0] == 'm'
- && ! strcmp (IDENTIFIER_POINTER (DECL_NAME (arg)), "main"))
+ else if (pedantic && DECL_MAIN_P (arg))
/* ARM $3.4 */
pedwarn ("taking address of function `main'");
@@ -4488,15 +4661,18 @@ build_unary_op (code, xarg, noconvert)
return build1 (ADDR_EXPR, unknown_type_node, arg);
}
- if (TREE_CODE (arg) == TREE_LIST)
+ if (TREE_CODE (arg) == OVERLOAD
+ || (TREE_CODE (arg) == OFFSET_REF
+ && TREE_CODE (TREE_OPERAND (arg, 1)) == TEMPLATE_ID_EXPR))
+ return build1 (ADDR_EXPR, unknown_type_node, arg);
+ else if (TREE_CODE (arg) == TREE_LIST)
{
- if (TREE_CODE (TREE_VALUE (arg)) == FUNCTION_DECL
- && DECL_CHAIN (TREE_VALUE (arg)) == NULL_TREE)
+ if (TREE_CODE (TREE_VALUE (arg)) == FUNCTION_DECL)
/* Unique overloaded non-member function. */
return build_unary_op (ADDR_EXPR, TREE_VALUE (arg), 0);
if (TREE_CHAIN (arg) == NULL_TREE
&& TREE_CODE (TREE_VALUE (arg)) == TREE_LIST
- && DECL_CHAIN (TREE_VALUE (TREE_VALUE (arg))) == NULL_TREE)
+ && TREE_CODE (TREE_VALUE (TREE_VALUE (arg))) != OVERLOAD)
/* Unique overloaded member function. */
return build_unary_op (ADDR_EXPR, TREE_VALUE (TREE_VALUE (arg)),
0);
@@ -4561,19 +4737,8 @@ build_unary_op (code, xarg, noconvert)
&& !lvalue_or_else (arg, "unary `&'"))
return error_mark_node;
- /* Ordinary case; arg is a COMPONENT_REF or a decl. */
- /* If the lvalue is const or volatile,
- merge that into the type that the address will point to. */
- if (TREE_CODE_CLASS (TREE_CODE (arg)) == 'd'
- || TREE_CODE_CLASS (TREE_CODE (arg)) == 'r')
- {
- if (TREE_READONLY (arg) || TREE_THIS_VOLATILE (arg))
- argtype = cp_build_type_variant (argtype,
- TREE_READONLY (arg),
- TREE_THIS_VOLATILE (arg));
- }
-
- argtype = build_pointer_type (argtype);
+ if (argtype != error_mark_node)
+ argtype = build_pointer_type (argtype);
if (mark_addressable (arg) == 0)
return error_mark_node;
@@ -4709,41 +4874,34 @@ unary_complex_lvalue (code, arg)
/* Check all this code for right semantics. */
if (TREE_CODE (t) == FUNCTION_DECL)
- return build_unary_op (ADDR_EXPR, t, 0);
+ {
+ if (DECL_DESTRUCTOR_P (t))
+ cp_error ("taking address of destructor");
+ return build_unary_op (ADDR_EXPR, t, 0);
+ }
if (TREE_CODE (t) == VAR_DECL)
return build_unary_op (ADDR_EXPR, t, 0);
else
{
tree type;
- tree offset;
if (TREE_OPERAND (arg, 0)
&& (TREE_CODE (TREE_OPERAND (arg, 0)) != NOP_EXPR
|| (TREE_OPERAND (TREE_OPERAND (arg, 0), 0)
- != error_mark_node)))
- if (TREE_CODE (t) != FIELD_DECL)
- {
- /* Don't know if this should return address to just
- _DECL, or actual address resolved in this expression. */
- sorry ("address of bound pointer-to-member expression");
- return error_mark_node;
- }
-
- /* Add in the offset to the field. */
- offset = convert (sizetype,
- size_binop (EASY_DIV_EXPR,
- DECL_FIELD_BITPOS (t),
- size_int (BITS_PER_UNIT)));
-
- /* We offset all pointer to data members by 1 so that we can
- distinguish between a null pointer to data member and the first
- data member of a structure. */
- offset = size_binop (PLUS_EXPR, offset, size_int (1));
+ != error_mark_node))
+ && TREE_CODE (t) != FIELD_DECL)
+ {
+ cp_error ("taking address of bound pointer-to-member expression");
+ return error_mark_node;
+ }
type = build_offset_type (DECL_FIELD_CONTEXT (t), TREE_TYPE (t));
type = build_pointer_type (type);
- return cp_convert (type, offset);
+ t = make_node (PTRMEM_CST);
+ TREE_TYPE (t) = type;
+ PTRMEM_CST_MEMBER (t) = TREE_OPERAND (arg, 1);
+ return t;
}
}
@@ -4964,8 +5122,8 @@ build_conditional_expr (ifexp, op1, op2)
if (type1 != type2)
type1 = cp_build_type_variant
(type1,
- TREE_READONLY (op1) || TREE_READONLY (op2),
- TREE_THIS_VOLATILE (op1) || TREE_THIS_VOLATILE (op2));
+ TYPE_READONLY (op1) || TYPE_READONLY (op2),
+ TYPE_VOLATILE (op1) || TYPE_VOLATILE (op2));
/* ??? This is a kludge to deal with the fact that
we don't sort out integers and enums properly, yet. */
result = fold (build (COND_EXPR, type1, ifexp, op1, op2));
@@ -5194,7 +5352,7 @@ build_conditional_expr (ifexp, op1, op2)
op2 = convert_for_initialization
(NULL_TREE, result_type, op2, LOOKUP_NORMAL, "converting", NULL_TREE, 0);
- if (TREE_CONSTANT (ifexp))
+ if (TREE_CODE (ifexp) == INTEGER_CST)
return integer_zerop (ifexp) ? op2 : op1;
return convert_from_reference
@@ -5357,8 +5515,8 @@ build_static_cast (type, expr)
>= TYPE_READONLY (TREE_TYPE (TREE_TYPE (intype))))
&& (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (type)))
>= TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (intype))))
- && (binfo = get_binfo (TYPE_OFFSET_BASETYPE (intype),
- TYPE_OFFSET_BASETYPE (type), 0))
+ && (binfo = get_binfo (TYPE_OFFSET_BASETYPE (TREE_TYPE (type)),
+ TYPE_OFFSET_BASETYPE (TREE_TYPE (intype)), 0))
&& ! TREE_VIA_VIRTUAL (binfo))
ok = 1;
}
@@ -5621,16 +5779,36 @@ build_c_cast (type, expr)
/* Convert functions and arrays to pointers and
convert references to their expanded types,
- but don't convert any other types. */
- if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
- || (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE
- /* Don't do the default conversion if we want a
- pointer to a function. */
- && ! (TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE))
- || TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE)
- value = default_conversion (value);
+ but don't convert any other types. If, however, we are
+ casting to a class type, there's no reason to do this: the
+ cast will only succeed if there is a converting constructor,
+ and the default conversions will be done at that point. In
+ fact, doing the default conversion here is actually harmful
+ in cases like this:
+
+ typedef int A[2];
+ struct S { S(const A&); };
+
+ since we don't want the array-to-pointer conversion done. */
+ if (!IS_AGGR_TYPE (type))
+ {
+ if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
+ || (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE
+ /* Don't do the default conversion if we want a
+ pointer to a function. */
+ && ! (TREE_CODE (type) == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE))
+ || TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE)
+ value = default_conversion (value);
+ }
+ else if (TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE)
+ /* However, even for class types, we still need to strip away
+ the reference type, since the call to convert_force below
+ does not expect the input expression to be of reference
+ type. */
+ value = convert_from_reference (value);
+
otype = TREE_TYPE (value);
/* Optionally warn about potentially worrisome casts. */
@@ -5935,6 +6113,9 @@ build_modify_expr (lhs, modifycode, rhs)
&& (IS_SIGNATURE_POINTER (TREE_TYPE (TREE_OPERAND (lhs, 0)))
|| IS_SIGNATURE_REFERENCE (TREE_TYPE (TREE_OPERAND (lhs, 0)))))
&& (TREE_READONLY (lhs) || TYPE_READONLY (lhstype)
+ /* Functions are not modifiable, even though they are
+ lvalues. */
+ || TREE_CODE (TREE_TYPE (lhs)) == FUNCTION_TYPE
|| ((TREE_CODE (lhstype) == RECORD_TYPE
|| TREE_CODE (lhstype) == UNION_TYPE)
&& C_TYPE_FIELDS_READONLY (lhstype))
@@ -6183,15 +6364,6 @@ build_x_modify_expr (lhs, modifycode, rhs)
return build_modify_expr (lhs, modifycode, rhs);
}
-/* Return 0 if EXP is not a valid lvalue in this language
- even though `lvalue_or_else' would accept it. */
-
-int
-language_lvalue_valid (exp)
- tree exp;
-{
- return 1;
-}
/* Get difference in deltas for different pointer to member function
types. Return integer_zero_node, if FROM cannot be converted to a
@@ -6370,7 +6542,7 @@ build_ptrmemfunc (type, pfn, force)
pfn_type = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (pfn));
if (!force
- && comp_target_types (type, pfn_type, 0) != 1)
+ && comp_target_types (type, pfn_type, 1) != 1)
cp_error ("conversion to `%T' from `%T'", type, pfn_type);
ndelta = cp_convert (ptrdiff_type_node, build_component_ref (pfn, delta_identifier, NULL_TREE, 0));
@@ -6481,6 +6653,10 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
register tree rhstype;
register enum tree_code coder = TREE_CODE (TREE_TYPE (rhs));
+ /* Issue warnings about peculiar, but legal, uses of NULL. */
+ if (ARITHMETIC_TYPE_P (type) && rhs == null_node)
+ cp_warning ("converting NULL to non-pointer type");
+
if (coder == UNKNOWN_TYPE)
rhs = instantiate_type (type, rhs, 1);
@@ -6500,7 +6676,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (rhs == error_mark_node)
return error_mark_node;
- if (TREE_VALUE (rhs) == error_mark_node)
+ if (TREE_CODE (rhs) == TREE_LIST && TREE_VALUE (rhs) == error_mark_node)
return error_mark_node;
if (TREE_CODE (TREE_TYPE (rhs)) == OFFSET_TYPE)
@@ -6528,7 +6704,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
else if (TREE_READONLY_DECL_P (rhs))
rhs = decl_constant_value (rhs);
- if (type == rhstype)
+ if (comptypes (type, rhstype, 1))
{
overflow_warning (rhs);
return rhs;
@@ -6623,20 +6799,20 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards const",
- rhstype, parmnum, fndecl);
+ cp_error ("passing `%T' as argument %P of `%D' discards const",
+ rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards const",
- errtype, type, rhstype);
+ cp_error ("%s to `%T' from `%T' discards const",
+ errtype, type, rhstype);
}
if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards volatile",
- rhstype, parmnum, fndecl);
+ cp_error ("passing `%T' as argument %P of `%D' discards volatile",
+ rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards volatile",
- errtype, type, rhstype);
+ cp_error ("%s to `%T' from `%T' discards volatile",
+ errtype, type, rhstype);
}
}
@@ -6681,25 +6857,27 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
&& binfo_member (TYPE_OFFSET_BASETYPE (ttr),
CLASSTYPE_VBASECLASSES (TYPE_OFFSET_BASETYPE (ttl))))
{
- sorry ("%s between pointer to members converting across virtual baseclasses", errtype);
+ error ("%s between pointer to members converting across virtual baseclasses", errtype);
return error_mark_node;
}
else if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
{
- if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards const",
- rhstype, parmnum, fndecl);
+ if (string_conv_p (type, rhs, 1))
+ /* converting from string constant to char *, OK. */;
+ else if (fndecl)
+ cp_error ("passing `%T' as argument %P of `%D' discards const",
+ rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards const",
+ cp_error ("%s to `%T' from `%T' discards const",
errtype, type, rhstype);
}
else if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards volatile",
+ cp_error ("passing `%T' as argument %P of `%D' discards volatile",
rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards volatile",
+ cp_error ("%s to `%T' from `%T' discards volatile",
errtype, type, rhstype);
}
else if (TREE_CODE (ttl) == TREE_CODE (ttr)
@@ -6761,20 +6939,20 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
if (const_parity)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards const",
- rhstype, parmnum, fndecl);
+ cp_error ("passing `%T' as argument %P of `%D' discards const",
+ rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards const",
+ cp_error ("%s to `%T' from `%T' discards const",
errtype, type, rhstype);
}
if (volatile_parity)
{
if (fndecl)
- cp_pedwarn ("passing `%T' as argument %P of `%D' discards volatile",
- rhstype, parmnum, fndecl);
+ cp_error ("passing `%T' as argument %P of `%D' discards volatile",
+ rhstype, parmnum, fndecl);
else
- cp_pedwarn ("%s to `%T' from `%T' discards volatile",
- errtype, type, rhstype);
+ cp_error ("%s to `%T' from `%T' discards volatile",
+ errtype, type, rhstype);
}
if (unsigned_parity > 0)
{
@@ -6906,8 +7084,8 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
return error_mark_node;
}
-/* Convert RHS to be of type TYPE. If EXP is non-zero,
- it is the target of the initialization.
+/* Convert RHS to be of type TYPE.
+ If EXP is non-zero, it is the target of the initialization.
ERRTYPE is a string to use in error messages.
Two major differences between the behavior of
@@ -7021,8 +7199,16 @@ convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
if (type == TREE_TYPE (rhs))
{
+ /* Issue warnings about peculiar, but legal, uses of NULL. We
+ do this *before* the call to decl_constant_value so as to
+ avoid duplicate warnings on code like `const int I = NULL;
+ f(I);'. */
+ if (ARITHMETIC_TYPE_P (type) && rhs == null_node)
+ cp_warning ("converting NULL to non-pointer type");
+
if (TREE_READONLY_DECL_P (rhs))
rhs = decl_constant_value (rhs);
+
return rhs;
}
@@ -7121,16 +7307,19 @@ c_expand_return (retval)
return;
}
- if (retval == NULL_TREE)
+ if (dtor_label)
{
- /* A non-named return value does not count. */
+ if (retval)
+ error ("returning a value from a destructor");
/* Can't just return from a destructor. */
- if (dtor_label)
- {
- expand_goto (dtor_label);
- return;
- }
+ expand_goto (dtor_label);
+ return;
+ }
+
+ if (retval == NULL_TREE)
+ {
+ /* A non-named return value does not count. */
if (DECL_CONSTRUCTOR_P (current_function_decl))
retval = current_class_ptr;
@@ -7157,13 +7346,12 @@ c_expand_return (retval)
return;
}
}
- else if (DECL_CONSTRUCTOR_P (current_function_decl)
- && retval != current_class_ptr)
+ else if (DECL_CONSTRUCTOR_P (current_function_decl))
{
if (flag_this_is_variable)
error ("return from a constructor: use `this = ...' instead");
else
- error ("return from a constructor");
+ error ("returning a value from a constructor");
retval = current_class_ptr;
}
@@ -7176,8 +7364,7 @@ c_expand_return (retval)
if (valtype == NULL_TREE || TREE_CODE (valtype) == VOID_TYPE)
{
current_function_returns_null = 1;
- if ((pedantic && ! DECL_ARTIFICIAL (current_function_decl))
- || TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
+ if (TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
pedwarn ("`return' with a value, in function returning void");
expand_return (retval);
return;
@@ -7202,10 +7389,18 @@ c_expand_return (retval)
}
else
{
+ tree functype = TREE_TYPE (TREE_TYPE (current_function_decl));
+
+ /* First convert the value to the function's return type, then
+ to the type of return value's location to handle the
+ case that functype is thiner than the valtype. */
+
retval = convert_for_initialization
- (NULL_TREE, valtype, retval, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING,
+ (NULL_TREE, functype, retval, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING,
"return", NULL_TREE, 0);
+ retval = convert (valtype, retval);
+
if (retval == error_mark_node)
{
/* Avoid warning about control reaching end of function. */
@@ -7353,14 +7548,21 @@ c_expand_start_case (exp)
return exp;
}
-/* CONSTP remembers whether or not all the intervening pointers in the `to'
- type have been const. */
+/* Returns non-zero if the pointer-type FROM can be converted to the
+ pointer-type TO via a qualification conversion. If CONSTP is -1,
+ then we return non-zero if the pointers are similar, and the
+ cv-qualification signature of FROM is a proper subset of that of TO.
+
+ If CONSTP is positive, then all outer pointers have been
+ const-qualified. */
static int
comp_ptr_ttypes_real (to, from, constp)
tree to, from;
int constp;
{
+ int to_more_cv_qualified = 0;
+
for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
{
if (TREE_CODE (to) != TREE_CODE (from))
@@ -7379,15 +7581,23 @@ comp_ptr_ttypes_real (to, from, constp)
|| TYPE_VOLATILE (from) > TYPE_VOLATILE (to))
return 0;
- if (! constp
- && (TYPE_READONLY (to) > TYPE_READONLY (from)
- || TYPE_VOLATILE (to) > TYPE_READONLY (from)))
- return 0;
- constp &= TYPE_READONLY (to);
+ if (TYPE_READONLY (to) > TYPE_READONLY (from)
+ || TYPE_VOLATILE (to) > TYPE_VOLATILE (from))
+ {
+ if (constp == 0)
+ return 0;
+ else
+ ++to_more_cv_qualified;
+ }
+
+ if (constp > 0)
+ constp &= TYPE_READONLY (to);
}
if (TREE_CODE (to) != POINTER_TYPE)
- return comptypes (TYPE_MAIN_VARIANT (to), TYPE_MAIN_VARIANT (from), 1);
+ return
+ comptypes (TYPE_MAIN_VARIANT (to), TYPE_MAIN_VARIANT (from), 1)
+ && (constp >= 0 || to_more_cv_qualified);
}
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 781d0d91725..a00a4f13ffc 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -118,7 +118,9 @@ readonly_error (arg, string, soft)
(*fn) ("%s of read-only reference `%D'", string, TREE_OPERAND (arg, 0));
else if (TREE_CODE (arg) == RESULT_DECL)
(*fn) ("%s of read-only named return value `%D'", string, arg);
- else
+ else if (TREE_CODE (arg) == FUNCTION_DECL)
+ (*fn) ("%s of function `%D'", string, arg);
+ else
(*fn) ("%s of read-only location", string);
}
@@ -485,13 +487,18 @@ initializer_constant_valid_p (value, endtype)
return initializer_constant_valid_p (TREE_OPERAND (value, 0),
endtype);
- /* Likewise conversions from int to pointers. */
+ /* Likewise conversions from int to pointers, but also allow
+ conversions from 0. */
if (TREE_CODE (TREE_TYPE (value)) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE
- && (TYPE_PRECISION (TREE_TYPE (value))
- <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))))
- return initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE)
+ {
+ if (integer_zerop (TREE_OPERAND (value, 0)))
+ return null_pointer_node;
+ else if (TYPE_PRECISION (TREE_TYPE (value))
+ <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))
+ return initializer_constant_valid_p (TREE_OPERAND (value, 0),
+ endtype);
+ }
/* Allow conversions to union types if the value inside is okay. */
if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE)
@@ -779,7 +786,15 @@ digest_init (type, init, tail)
if (code == ARRAY_TYPE)
{
- tree typ1 = TYPE_MAIN_VARIANT (TREE_TYPE (type));
+ tree typ1;
+
+ if (TREE_CODE (init) == TREE_LIST)
+ {
+ error ("initializing array with parameter list");
+ return error_mark_node;
+ }
+
+ typ1 = TYPE_MAIN_VARIANT (TREE_TYPE (type));
if ((typ1 == char_type_node
|| typ1 == signed_char_type_node
|| typ1 == unsigned_char_type_node
@@ -1097,6 +1112,11 @@ process_init_constructor (type, init, elts)
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
error ("member `%s' is uninitialized reference",
IDENTIFIER_POINTER (DECL_NAME (field)));
+ /* Warn when some struct elements are implicitly initialized
+ to zero. */
+ else if (extra_warnings)
+ warning ("missing initializer for member `%s'",
+ IDENTIFIER_POINTER (DECL_NAME (field)));
}
}
@@ -1488,6 +1508,15 @@ build_functional_cast (exp, parms)
if (parms && TREE_CHAIN (parms) == NULL_TREE)
return build_c_cast (type, TREE_VALUE (parms));
+ /* We need to zero-initialize POD types. Let's do that for everything
+ that doesn't need a constructor. */
+ if (parms == NULL_TREE && !TYPE_NEEDS_CONSTRUCTING (type)
+ && TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
+ {
+ exp = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
+ return get_target_expr (exp);
+ }
+
exp = build_method_call (NULL_TREE, ctor_identifier, parms,
TYPE_BINFO (type), LOOKUP_NORMAL);
@@ -1517,8 +1546,8 @@ enum_name_string (value, type)
char *buf = (char *)oballoc (16 + TYPE_NAME_LENGTH (type));
/* Value must have been cast. */
- sprintf (buf, "(enum %s)%d",
- TYPE_NAME_STRING (type), intval);
+ sprintf (buf, "(enum %s)%ld",
+ TYPE_NAME_STRING (type), (long) intval);
return buf;
}
return IDENTIFIER_POINTER (TREE_PURPOSE (values));
diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c
index 9c530d0132f..e38546e0367 100644
--- a/gcc/cp/xref.c
+++ b/gcc/cp/xref.c
@@ -286,8 +286,10 @@ GNU_xref_end_scope (id,inid,prm,keep)
else if (keep == 2 || inid != 0) stype = "INTERN";
else stype = "EXTERN";
- fprintf (xref_file,"SCP %s %d %d %d %d %s\n",
- filename (xf), xs->start, lineno,xs->lid, inid, stype);
+ fprintf (xref_file, "SCP %s %d %d %d ",
+ filename (xf), xs->start, lineno,xs->lid);
+ fprintf (xref_file, HOST_WIDE_INT_PRINT_DEC, inid);
+ fprintf (xref_file, " %s\n", stype);
if (lxs == NULL) cur_scope = xs->outer;
else lxs->outer = xs->outer;
@@ -539,6 +541,19 @@ gen_assign(xf, name)
fprintf(xref_file, "ASG %s %d %s\n", filename(xf), lineno, s);
}
+static char*
+classname (cls)
+ tree cls;
+{
+ if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 't')
+ cls = TYPE_NAME (cls);
+ if (cls && TREE_CODE_CLASS (TREE_CODE (cls)) == 'd')
+ cls = DECL_NAME (cls);
+ if (cls && TREE_CODE (cls) == IDENTIFIER_NODE)
+ return IDENTIFIER_POINTER (cls);
+ return "?";
+}
+
/* Output cross-reference info about a class hierarchy.
CLS is the class type of interest. BASE is a baseclass
for CLS. PUB and VIRT give the access info about
@@ -549,8 +564,8 @@ gen_assign(xf, name)
void
GNU_xref_hier(cls, base, pub, virt, frnd)
- char *cls;
- char *base;
+ tree cls;
+ tree base;
int pub;
int virt;
int frnd;
@@ -562,7 +577,8 @@ GNU_xref_hier(cls, base, pub, virt, frnd)
if (xf == NULL) return;
fprintf(xref_file, "HIE %s %d %s %s %d %d %d\n",
- filename(xf), lineno, cls, base, pub, virt, frnd);
+ filename(xf), lineno, classname (cls), classname (base),
+ pub, virt, frnd);
}
/* Output cross-reference info about class members. CLS
@@ -601,7 +617,7 @@ GNU_xref_member(cls, fld)
pure = 1;
d = IDENTIFIER_POINTER(cls);
- sprintf(buf, "%d%s", strlen(d), d);
+ sprintf(buf, "%d%s", (int) strlen(d), d);
#ifdef XREF_SHORT_MEMBER_NAMES
i = strlen(buf);
#endif
@@ -715,7 +731,7 @@ simplify_type(typ)
int lvl, i;
i = strlen(typ);
- while (i > 0 && ISSPACE(typ[i-1])) typ[--i] = 0;
+ while (i > 0 && ISSPACE((unsigned char) typ[i-1])) typ[--i] = 0;
if (i > 7 && STREQL(&typ[i-5], "const"))
{
diff --git a/gcc/cplus-dem.c b/gcc/cplus-dem.c
deleted file mode 100644
index 266a112326f..00000000000
--- a/gcc/cplus-dem.c
+++ /dev/null
@@ -1,3780 +0,0 @@
-/* Demangler for GNU C++
- Copyright 1989, 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.uucp)
- Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file exports two functions; cplus_mangle_opname and cplus_demangle.
-
- This file imports xmalloc and xrealloc, which are like malloc and
- realloc except that they generate a fatal error if there is no
- available memory. */
-
-/* This file lives in both GCC and libiberty. When making changes, please
- try not to break either. */
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#include <demangle.h>
-#undef CURRENT_DEMANGLING_STYLE
-#define CURRENT_DEMANGLING_STYLE work->options
-
-extern char *xmalloc PARAMS((unsigned));
-extern char *xrealloc PARAMS((char *, unsigned));
-
-static const char *mystrstr PARAMS ((const char *, const char *));
-
-static const char *
-mystrstr (s1, s2)
- const char *s1, *s2;
-{
- register const char *p = s1;
- register int len = strlen (s2);
-
- for (; (p = strchr (p, *s2)) != 0; p++)
- {
- if (strncmp (p, s2, len) == 0)
- {
- return (p);
- }
- }
- return (0);
-}
-
-/* In order to allow a single demangler executable to demangle strings
- using various common values of CPLUS_MARKER, as well as any specific
- one set at compile time, we maintain a string containing all the
- commonly used ones, and check to see if the marker we are looking for
- is in that string. CPLUS_MARKER is usually '$' on systems where the
- assembler can deal with that. Where the assembler can't, it's usually
- '.' (but on many systems '.' is used for other things). We put the
- current defined CPLUS_MARKER first (which defaults to '$'), followed
- by the next most common value, followed by an explicit '$' in case
- the value of CPLUS_MARKER is not '$'.
-
- We could avoid this if we could just get g++ to tell us what the actual
- cplus marker character is as part of the debug information, perhaps by
- ensuring that it is the character that terminates the gcc<n>_compiled
- marker symbol (FIXME). */
-
-#if !defined (CPLUS_MARKER)
-#define CPLUS_MARKER '$'
-#endif
-
-enum demangling_styles current_demangling_style = gnu_demangling;
-
-static char cplus_markers[] = { CPLUS_MARKER, '.', '$', '\0' };
-
-void
-set_cplus_marker_for_demangling (ch)
- int ch;
-{
- cplus_markers[0] = ch;
-}
-
-/* Stuff that is shared between sub-routines.
- Using a shared structure allows cplus_demangle to be reentrant. */
-
-struct work_stuff
-{
- int options;
- char **typevec;
- char **ktypevec;
- char **btypevec;
- int numk;
- int numb;
- int ksize;
- int bsize;
- int ntypes;
- int typevec_size;
- int constructor;
- int destructor;
- int static_type; /* A static member function */
- int const_type; /* A const member function */
- char **tmpl_argvec; /* Template function arguments. */
- int ntmpl_args; /* The number of template function arguments. */
-};
-
-#define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
-#define PRINT_ARG_TYPES (work -> options & DMGL_PARAMS)
-
-static const struct optable
-{
- const char *in;
- const char *out;
- int flags;
-} optable[] = {
- {"nw", " new", DMGL_ANSI}, /* new (1.92, ansi) */
- {"dl", " delete", DMGL_ANSI}, /* new (1.92, ansi) */
- {"new", " new", 0}, /* old (1.91, and 1.x) */
- {"delete", " delete", 0}, /* old (1.91, and 1.x) */
- {"vn", " new []", DMGL_ANSI}, /* GNU, pending ansi */
- {"vd", " delete []", DMGL_ANSI}, /* GNU, pending ansi */
- {"as", "=", DMGL_ANSI}, /* ansi */
- {"ne", "!=", DMGL_ANSI}, /* old, ansi */
- {"eq", "==", DMGL_ANSI}, /* old, ansi */
- {"ge", ">=", DMGL_ANSI}, /* old, ansi */
- {"gt", ">", DMGL_ANSI}, /* old, ansi */
- {"le", "<=", DMGL_ANSI}, /* old, ansi */
- {"lt", "<", DMGL_ANSI}, /* old, ansi */
- {"plus", "+", 0}, /* old */
- {"pl", "+", DMGL_ANSI}, /* ansi */
- {"apl", "+=", DMGL_ANSI}, /* ansi */
- {"minus", "-", 0}, /* old */
- {"mi", "-", DMGL_ANSI}, /* ansi */
- {"ami", "-=", DMGL_ANSI}, /* ansi */
- {"mult", "*", 0}, /* old */
- {"ml", "*", DMGL_ANSI}, /* ansi */
- {"amu", "*=", DMGL_ANSI}, /* ansi (ARM/Lucid) */
- {"aml", "*=", DMGL_ANSI}, /* ansi (GNU/g++) */
- {"convert", "+", 0}, /* old (unary +) */
- {"negate", "-", 0}, /* old (unary -) */
- {"trunc_mod", "%", 0}, /* old */
- {"md", "%", DMGL_ANSI}, /* ansi */
- {"amd", "%=", DMGL_ANSI}, /* ansi */
- {"trunc_div", "/", 0}, /* old */
- {"dv", "/", DMGL_ANSI}, /* ansi */
- {"adv", "/=", DMGL_ANSI}, /* ansi */
- {"truth_andif", "&&", 0}, /* old */
- {"aa", "&&", DMGL_ANSI}, /* ansi */
- {"truth_orif", "||", 0}, /* old */
- {"oo", "||", DMGL_ANSI}, /* ansi */
- {"truth_not", "!", 0}, /* old */
- {"nt", "!", DMGL_ANSI}, /* ansi */
- {"postincrement","++", 0}, /* old */
- {"pp", "++", DMGL_ANSI}, /* ansi */
- {"postdecrement","--", 0}, /* old */
- {"mm", "--", DMGL_ANSI}, /* ansi */
- {"bit_ior", "|", 0}, /* old */
- {"or", "|", DMGL_ANSI}, /* ansi */
- {"aor", "|=", DMGL_ANSI}, /* ansi */
- {"bit_xor", "^", 0}, /* old */
- {"er", "^", DMGL_ANSI}, /* ansi */
- {"aer", "^=", DMGL_ANSI}, /* ansi */
- {"bit_and", "&", 0}, /* old */
- {"ad", "&", DMGL_ANSI}, /* ansi */
- {"aad", "&=", DMGL_ANSI}, /* ansi */
- {"bit_not", "~", 0}, /* old */
- {"co", "~", DMGL_ANSI}, /* ansi */
- {"call", "()", 0}, /* old */
- {"cl", "()", DMGL_ANSI}, /* ansi */
- {"alshift", "<<", 0}, /* old */
- {"ls", "<<", DMGL_ANSI}, /* ansi */
- {"als", "<<=", DMGL_ANSI}, /* ansi */
- {"arshift", ">>", 0}, /* old */
- {"rs", ">>", DMGL_ANSI}, /* ansi */
- {"ars", ">>=", DMGL_ANSI}, /* ansi */
- {"component", "->", 0}, /* old */
- {"pt", "->", DMGL_ANSI}, /* ansi; Lucid C++ form */
- {"rf", "->", DMGL_ANSI}, /* ansi; ARM/GNU form */
- {"indirect", "*", 0}, /* old */
- {"method_call", "->()", 0}, /* old */
- {"addr", "&", 0}, /* old (unary &) */
- {"array", "[]", 0}, /* old */
- {"vc", "[]", DMGL_ANSI}, /* ansi */
- {"compound", ", ", 0}, /* old */
- {"cm", ", ", DMGL_ANSI}, /* ansi */
- {"cond", "?:", 0}, /* old */
- {"cn", "?:", DMGL_ANSI}, /* pseudo-ansi */
- {"max", ">?", 0}, /* old */
- {"mx", ">?", DMGL_ANSI}, /* pseudo-ansi */
- {"min", "<?", 0}, /* old */
- {"mn", "<?", DMGL_ANSI}, /* pseudo-ansi */
- {"nop", "", 0}, /* old (for operator=) */
- {"rm", "->*", DMGL_ANSI}, /* ansi */
- {"sz", "sizeof ", DMGL_ANSI} /* pseudo-ansi */
-};
-
-
-typedef struct string /* Beware: these aren't required to be */
-{ /* '\0' terminated. */
- char *b; /* pointer to start of string */
- char *p; /* pointer after last character */
- char *e; /* pointer after end of allocated space */
-} string;
-
-#define STRING_EMPTY(str) ((str) -> b == (str) -> p)
-#define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \
- string_prepend(str, " ");}
-#define APPEND_BLANK(str) {if (!STRING_EMPTY(str)) \
- string_append(str, " ");}
-#define LEN_STRING(str) ( (STRING_EMPTY(str))?0:((str)->p - (str)->b))
-
-#define ARM_VTABLE_STRING "__vtbl__" /* Lucid/ARM virtual table prefix */
-#define ARM_VTABLE_STRLEN 8 /* strlen (ARM_VTABLE_STRING) */
-
-/* Prototypes for local functions */
-
-static char *
-mop_up PARAMS ((struct work_stuff *, string *, int));
-
-static char *
-squangle_mop_up PARAMS ((struct work_stuff *));
-
-#if 0
-static int
-demangle_method_args PARAMS ((struct work_stuff *, const char **, string *));
-#endif
-
-static char *
-internal_cplus_demangle PARAMS ((struct work_stuff *, const char *, int));
-
-static int
-demangle_template_template_parm PARAMS ((struct work_stuff *work,
- const char **, string *));
-
-static int
-demangle_template PARAMS ((struct work_stuff *work, const char **, string *,
- string *, int));
-
-static int
-arm_pt PARAMS ((struct work_stuff *, const char *, int, const char **,
- const char **));
-
-static void
-demangle_arm_pt PARAMS ((struct work_stuff *, const char **, int, string *));
-
-static int
-demangle_class_name PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_qualified PARAMS ((struct work_stuff *, const char **, string *,
- int, int));
-
-static int
-demangle_class PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_fund_type PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_signature PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-demangle_prefix PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-gnu_special PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-arm_special PARAMS ((const char **, string *));
-
-static void
-string_need PARAMS ((string *, int));
-
-static void
-string_delete PARAMS ((string *));
-
-static void
-string_init PARAMS ((string *));
-
-static void
-string_clear PARAMS ((string *));
-
-#if 0
-static int
-string_empty PARAMS ((string *));
-#endif
-
-static void
-string_append PARAMS ((string *, const char *));
-
-static void
-string_appends PARAMS ((string *, string *));
-
-static void
-string_appendn PARAMS ((string *, const char *, int));
-
-static void
-string_prepend PARAMS ((string *, const char *));
-
-static void
-string_prependn PARAMS ((string *, const char *, int));
-
-static int
-get_count PARAMS ((const char **, int *));
-
-static int
-consume_count PARAMS ((const char **));
-
-static int
-consume_count_with_underscores PARAMS ((const char**));
-
-static int
-demangle_args PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-do_type PARAMS ((struct work_stuff *, const char **, string *));
-
-static int
-do_arg PARAMS ((struct work_stuff *, const char **, string *));
-
-static void
-demangle_function_name PARAMS ((struct work_stuff *, const char **, string *,
- const char *));
-
-static void
-remember_type PARAMS ((struct work_stuff *, const char *, int));
-
-static void
-remember_Btype PARAMS ((struct work_stuff *, const char *, int, int));
-
-static int
-register_Btype PARAMS ((struct work_stuff *));
-
-static void
-remember_Ktype PARAMS ((struct work_stuff *, const char *, int));
-
-static void
-forget_types PARAMS ((struct work_stuff *));
-
-static void
-forget_B_and_K_types PARAMS ((struct work_stuff *));
-
-static void
-string_prepends PARAMS ((string *, string *));
-
-static int
-demangle_template_value_parm PARAMS ((struct work_stuff*,
- const char**, string*));
-
-/* Translate count to integer, consuming tokens in the process.
- Conversion terminates on the first non-digit character.
- Trying to consume something that isn't a count results in
- no consumption of input and a return of 0. */
-
-static int
-consume_count (type)
- const char **type;
-{
- int count = 0;
-
- while (isdigit (**type))
- {
- count *= 10;
- count += **type - '0';
- (*type)++;
- }
- return (count);
-}
-
-
-/* Like consume_count, but for counts that are preceded and followed
- by '_' if they are greater than 10. Also, -1 is returned for
- failure, since 0 can be a valid value. */
-
-static int
-consume_count_with_underscores (mangled)
- const char **mangled;
-{
- int idx;
-
- if (**mangled == '_')
- {
- (*mangled)++;
- if (!isdigit (**mangled))
- return -1;
-
- idx = consume_count (mangled);
- if (**mangled != '_')
- /* The trailing underscore was missing. */
- return -1;
-
- (*mangled)++;
- }
- else
- {
- if (**mangled < '0' || **mangled > '9')
- return -1;
-
- idx = **mangled - '0';
- (*mangled)++;
- }
-
- return idx;
-}
-
-int
-cplus_demangle_opname (opname, result, options)
- const char *opname;
- char *result;
- int options;
-{
- int len, i, len1, ret;
- string type;
- struct work_stuff work[1];
- const char *tem;
-
- len = strlen(opname);
- result[0] = '\0';
- ret = 0;
- work->options = options;
-
- if (opname[0] == '_' && opname[1] == '_'
- && opname[2] == 'o' && opname[3] == 'p')
- {
- /* ANSI. */
- /* type conversion operator. */
- tem = opname + 4;
- if (do_type (work, &tem, &type))
- {
- strcat (result, "operator ");
- strncat (result, type.b, type.p - type.b);
- string_delete (&type);
- ret = 1;
- }
- }
- else if (opname[0] == '_' && opname[1] == '_'
- && opname[2] >= 'a' && opname[2] <= 'z'
- && opname[3] >= 'a' && opname[3] <= 'z')
- {
- if (opname[4] == '\0')
- {
- /* Operator. */
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 2
- && memcmp (optable[i].in, opname + 2, 2) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- ret = 1;
- break;
- }
- }
- }
- else
- {
- if (opname[2] == 'a' && opname[5] == '\0')
- {
- /* Assignment. */
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 3
- && memcmp (optable[i].in, opname + 2, 3) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- ret = 1;
- break;
- }
- }
- }
- }
- }
- else if (len >= 3
- && opname[0] == 'o'
- && opname[1] == 'p'
- && strchr (cplus_markers, opname[2]) != NULL)
- {
- /* see if it's an assignment expression */
- if (len >= 10 /* op$assign_ */
- && memcmp (opname + 3, "assign_", 7) == 0)
- {
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- len1 = len - 10;
- if (strlen (optable[i].in) == len1
- && memcmp (optable[i].in, opname + 10, len1) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- strcat (result, "=");
- ret = 1;
- break;
- }
- }
- }
- else
- {
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- len1 = len - 3;
- if (strlen (optable[i].in) == len1
- && memcmp (optable[i].in, opname + 3, len1) == 0)
- {
- strcat (result, "operator");
- strcat (result, optable[i].out);
- ret = 1;
- break;
- }
- }
- }
- }
- else if (len >= 5 && memcmp (opname, "type", 4) == 0
- && strchr (cplus_markers, opname[4]) != NULL)
- {
- /* type conversion operator */
- tem = opname + 5;
- if (do_type (work, &tem, &type))
- {
- strcat (result, "operator ");
- strncat (result, type.b, type.p - type.b);
- string_delete (&type);
- ret = 1;
- }
- }
- squangle_mop_up (work);
- return ret;
-
-}
-/* Takes operator name as e.g. "++" and returns mangled
- operator name (e.g. "postincrement_expr"), or NULL if not found.
-
- If OPTIONS & DMGL_ANSI == 1, return the ANSI name;
- if OPTIONS & DMGL_ANSI == 0, return the old GNU name. */
-
-const char *
-cplus_mangle_opname (opname, options)
- const char *opname;
- int options;
-{
- int i;
- int len;
-
- len = strlen (opname);
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].out) == len
- && (options & DMGL_ANSI) == (optable[i].flags & DMGL_ANSI)
- && memcmp (optable[i].out, opname, len) == 0)
- return optable[i].in;
- }
- return (0);
-}
-
-/* char *cplus_demangle (const char *mangled, int options)
-
- If MANGLED is a mangled function name produced by GNU C++, then
- a pointer to a malloced string giving a C++ representation
- of the name will be returned; otherwise NULL will be returned.
- It is the caller's responsibility to free the string which
- is returned.
-
- The OPTIONS arg may contain one or more of the following bits:
-
- DMGL_ANSI ANSI qualifiers such as `const' and `void' are
- included.
- DMGL_PARAMS Function parameters are included.
-
- For example,
-
- cplus_demangle ("foo__1Ai", DMGL_PARAMS) => "A::foo(int)"
- cplus_demangle ("foo__1Ai", DMGL_PARAMS | DMGL_ANSI) => "A::foo(int)"
- cplus_demangle ("foo__1Ai", 0) => "A::foo"
-
- cplus_demangle ("foo__1Afe", DMGL_PARAMS) => "A::foo(float,...)"
- cplus_demangle ("foo__1Afe", DMGL_PARAMS | DMGL_ANSI)=> "A::foo(float,...)"
- cplus_demangle ("foo__1Afe", 0) => "A::foo"
-
- Note that any leading underscores, or other such characters prepended by
- the compilation system, are presumed to have already been stripped from
- MANGLED. */
-
-char *
-cplus_demangle (mangled, options)
- const char *mangled;
- int options;
-{
- char *ret;
- struct work_stuff work[1];
- memset ((char *) work, 0, sizeof (work));
- work -> options = options;
- if ((work -> options & DMGL_STYLE_MASK) == 0)
- work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK;
-
- ret = internal_cplus_demangle (work, mangled, options);
- squangle_mop_up (work);
- return (ret);
-}
-
-
-/* This function performs most of what cplus_demangle use to do, but
- to be able to demangle a name with a B, K or n code, we need to
- have a longer term memory of what types have been seen. The original
- now intializes and cleans up the squangle code info, while internal
- calls go directly to this routine to avoid resetting that info. */
-
-static char *
-internal_cplus_demangle (work, mangled, options)
- struct work_stuff *work;
- const char *mangled;
- int options;
-{
-
- string decl;
- int success = 0;
- char *demangled = NULL;
- int s1,s2,s3,s4;
- s1 = work->constructor;
- s2 = work->destructor;
- s3 = work->static_type;
- s4 = work->const_type;
- work->constructor = work->destructor = 0;
- work->static_type = work->const_type = 0;
-
- if ((mangled != NULL) && (*mangled != '\0'))
- {
- string_init (&decl);
-
- /* First check to see if gnu style demangling is active and if the
- string to be demangled contains a CPLUS_MARKER. If so, attempt to
- recognize one of the gnu special forms rather than looking for a
- standard prefix. In particular, don't worry about whether there
- is a "__" string in the mangled string. Consider "_$_5__foo" for
- example. */
-
- if ((AUTO_DEMANGLING || GNU_DEMANGLING))
- {
- success = gnu_special (work, &mangled, &decl);
- }
- if (!success)
- {
- success = demangle_prefix (work, &mangled, &decl);
- }
- if (success && (*mangled != '\0'))
- {
- success = demangle_signature (work, &mangled, &decl);
- }
- if (work->constructor == 2)
- {
- string_prepend (&decl, "global constructors keyed to ");
- work->constructor = 0;
- }
- else if (work->destructor == 2)
- {
- string_prepend (&decl, "global destructors keyed to ");
- work->destructor = 0;
- }
- demangled = mop_up (work, &decl, success);
- }
- work->constructor = s1;
- work->destructor = s2;
- work->static_type = s3;
- work->const_type = s4;
- return (demangled);
-}
-
-
-/* Clear out and squangling related storage */
-static char *
-squangle_mop_up (work)
- struct work_stuff *work;
-{
- /* clean up the B and K type mangling types. */
- forget_B_and_K_types (work);
- if (work -> btypevec != NULL)
- {
- free ((char *) work -> btypevec);
- }
- if (work -> ktypevec != NULL)
- {
- free ((char *) work -> ktypevec);
- }
-}
-
-/* Clear out any mangled storage */
-
-static char *
-mop_up (work, declp, success)
- struct work_stuff *work;
- string *declp;
- int success;
-{
- char *demangled = NULL;
-
- /* Discard the remembered types, if any. */
-
- forget_types (work);
- if (work -> typevec != NULL)
- {
- free ((char *) work -> typevec);
- work -> typevec = NULL;
- }
- if (work->tmpl_argvec)
- {
- int i;
-
- for (i = 0; i < work->ntmpl_args; i++)
- if (work->tmpl_argvec[i])
- free ((char*) work->tmpl_argvec[i]);
-
- free ((char*) work->tmpl_argvec);
- work->tmpl_argvec = NULL;
- }
-
- /* If demangling was successful, ensure that the demangled string is null
- terminated and return it. Otherwise, free the demangling decl. */
-
- if (!success)
- {
- string_delete (declp);
- }
- else
- {
- string_appendn (declp, "", 1);
- demangled = declp -> b;
- }
- return (demangled);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_signature -- demangle the signature part of a mangled name
-
-SYNOPSIS
-
- static int
- demangle_signature (struct work_stuff *work, const char **mangled,
- string *declp);
-
-DESCRIPTION
-
- Consume and demangle the signature portion of the mangled name.
-
- DECLP is the string where demangled output is being built. At
- entry it contains the demangled root name from the mangled name
- prefix. I.E. either a demangled operator name or the root function
- name. In some special cases, it may contain nothing.
-
- *MANGLED points to the current unconsumed location in the mangled
- name. As tokens are consumed and demangling is performed, the
- pointer is updated to continuously point at the next token to
- be consumed.
-
- Demangling GNU style mangled names is nasty because there is no
- explicit token that marks the start of the outermost function
- argument list. */
-
-static int
-demangle_signature (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 1;
- int func_done = 0;
- int expect_func = 0;
- int expect_return_type = 0;
- const char *oldmangled = NULL;
- string trawname;
- string tname;
-
- while (success && (**mangled != '\0'))
- {
- switch (**mangled)
- {
- case 'Q':
- oldmangled = *mangled;
- success = demangle_qualified (work, mangled, declp, 1, 0);
- if (success)
- {
- remember_type (work, oldmangled, *mangled - oldmangled);
- }
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- expect_func = 1;
- }
- oldmangled = NULL;
- break;
-
- case 'K':
- oldmangled = *mangled;
- success = demangle_qualified (work, mangled, declp, 1, 0);
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- expect_func = 1;
- }
- oldmangled = NULL;
- break;
-
- case 'S':
- /* Static member function */
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- (*mangled)++;
- work -> static_type = 1;
- break;
-
- case 'C':
- /* a const member function */
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- (*mangled)++;
- work -> const_type = 1;
- break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- success = demangle_class (work, mangled, declp);
- if (success)
- {
- remember_type (work, oldmangled, *mangled - oldmangled);
- }
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- expect_func = 1;
- }
- oldmangled = NULL;
- break;
-
- case 'F':
- /* Function */
- /* ARM style demangling includes a specific 'F' character after
- the class name. For GNU style, it is just implied. So we can
- safely just consume any 'F' at this point and be compatible
- with either style. */
-
- oldmangled = NULL;
- func_done = 1;
- (*mangled)++;
-
- /* For lucid/ARM style we have to forget any types we might
- have remembered up to this point, since they were not argument
- types. GNU style considers all types seen as available for
- back references. See comment in demangle_args() */
-
- if (LUCID_DEMANGLING || ARM_DEMANGLING)
- {
- forget_types (work);
- }
- success = demangle_args (work, mangled, declp);
- break;
-
- case 't':
- /* G++ Template */
- string_init(&trawname);
- string_init(&tname);
- if (oldmangled == NULL)
- {
- oldmangled = *mangled;
- }
- success = demangle_template (work, mangled, &tname, &trawname, 1);
- if (success)
- {
- remember_type (work, oldmangled, *mangled - oldmangled);
- }
- string_append(&tname, (work -> options & DMGL_JAVA) ? "." : "::");
- string_prepends(declp, &tname);
- if (work -> destructor & 1)
- {
- string_prepend (&trawname, "~");
- string_appends (declp, &trawname);
- work->destructor -= 1;
- }
- if ((work->constructor & 1) || (work->destructor & 1))
- {
- string_appends (declp, &trawname);
- work->constructor -= 1;
- }
- string_delete(&trawname);
- string_delete(&tname);
- oldmangled = NULL;
- expect_func = 1;
- break;
-
- case '_':
- if (GNU_DEMANGLING && expect_return_type)
- {
- /* Read the return type. */
- string return_type;
- string_init (&return_type);
-
- (*mangled)++;
- success = do_type (work, mangled, &return_type);
- APPEND_BLANK (&return_type);
-
- string_prepends (declp, &return_type);
- string_delete (&return_type);
- break;
- }
- else
- /* At the outermost level, we cannot have a return type specified,
- so if we run into another '_' at this point we are dealing with
- a mangled name that is either bogus, or has been mangled by
- some algorithm we don't know how to deal with. So just
- reject the entire demangling. */
- success = 0;
- break;
-
- case 'H':
- if (GNU_DEMANGLING)
- {
- /* A G++ template function. Read the template arguments. */
- success = demangle_template (work, mangled, declp, 0, 0);
- if (!(work->constructor & 1))
- expect_return_type = 1;
- (*mangled)++;
- break;
- }
- else
- /* fall through */
- {;}
-
- default:
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- /* Assume we have stumbled onto the first outermost function
- argument token, and start processing args. */
- func_done = 1;
- success = demangle_args (work, mangled, declp);
- }
- else
- {
- /* Non-GNU demanglers use a specific token to mark the start
- of the outermost function argument tokens. Typically 'F',
- for ARM-demangling, for example. So if we find something
- we are not prepared for, it must be an error. */
- success = 0;
- }
- break;
- }
- /*
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- */
- {
- if (success && expect_func)
- {
- func_done = 1;
- success = demangle_args (work, mangled, declp);
- /* Since template include the mangling of their return types,
- we must set expect_func to 0 so that we don't try do
- demangle more arguments the next time we get here. */
- expect_func = 0;
- }
- }
- }
- if (success && !func_done)
- {
- if (AUTO_DEMANGLING || GNU_DEMANGLING)
- {
- /* With GNU style demangling, bar__3foo is 'foo::bar(void)', and
- bar__3fooi is 'foo::bar(int)'. We get here when we find the
- first case, and need to ensure that the '(void)' gets added to
- the current declp. Note that with ARM, the first case
- represents the name of a static data member 'foo::bar',
- which is in the current declp, so we leave it alone. */
- success = demangle_args (work, mangled, declp);
- }
- }
- if (success && work -> static_type && PRINT_ARG_TYPES)
- {
- string_append (declp, " static");
- }
- if (success && work -> const_type && PRINT_ARG_TYPES)
- {
- string_append (declp, " const");
- }
- return (success);
-}
-
-#if 0
-
-static int
-demangle_method_args (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 0;
-
- if (work -> static_type)
- {
- string_append (declp, *mangled + 1);
- *mangled += strlen (*mangled);
- success = 1;
- }
- else
- {
- success = demangle_args (work, mangled, declp);
- }
- return (success);
-}
-
-#endif
-
-static int
-demangle_template_template_parm (work, mangled, tname)
- struct work_stuff *work;
- const char **mangled;
- string *tname;
-{
- int i;
- int r;
- int need_comma = 0;
- int success = 1;
- string temp;
-
- string_append (tname, "template <");
- /* get size of template parameter list */
- if (get_count (mangled, &r))
- {
- for (i = 0; i < r; i++)
- {
- if (need_comma)
- {
- string_append (tname, ", ");
- }
-
- /* Z for type parameters */
- if (**mangled == 'Z')
- {
- (*mangled)++;
- string_append (tname, "class");
- }
- /* z for template parameters */
- else if (**mangled == 'z')
- {
- (*mangled)++;
- success =
- demangle_template_template_parm (work, mangled, tname);
- if (!success)
- {
- break;
- }
- }
- else
- {
- /* temp is initialized in do_type */
- success = do_type (work, mangled, &temp);
- if (success)
- {
- string_appends (tname, &temp);
- }
- string_delete(&temp);
- if (!success)
- {
- break;
- }
- }
- need_comma = 1;
- }
-
- }
- if (tname->p[-1] == '>')
- string_append (tname, " ");
- string_append (tname, "> class");
- return (success);
-}
-
-static int
-demangle_integral_value (work, mangled, s)
- struct work_stuff *work;
- const char** mangled;
- string* s;
-{
- int success;
-
- if (**mangled == 'E')
- {
- int need_operator = 0;
-
- success = 1;
- string_appendn (s, "(", 1);
- (*mangled)++;
- while (success && **mangled != 'W' && **mangled != '\0')
- {
- if (need_operator)
- {
- size_t i;
- size_t len;
-
- success = 0;
-
- len = strlen (*mangled);
-
- for (i = 0;
- i < sizeof (optable) / sizeof (optable [0]);
- ++i)
- {
- size_t l = strlen (optable[i].in);
-
- if (l <= len
- && memcmp (optable[i].in, *mangled, l) == 0)
- {
- string_appendn (s, " ", 1);
- string_append (s, optable[i].out);
- string_appendn (s, " ", 1);
- success = 1;
- (*mangled) += l;
- break;
- }
- }
-
- if (!success)
- break;
- }
- else
- need_operator = 1;
-
- success = demangle_template_value_parm (work, mangled, s);
- }
-
- if (**mangled != 'W')
- success = 0;
- else
- {
- string_appendn (s, ")", 1);
- (*mangled)++;
- }
- }
- else if (**mangled == 'Q' || **mangled == 'K')
- success = demangle_qualified (work, mangled, s, 0, 1);
- else
- {
- success = 0;
-
- if (**mangled == 'm')
- {
- string_appendn (s, "-", 1);
- (*mangled)++;
- }
- while (isdigit (**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- success = 1;
- }
- }
-
- return success;
-}
-
-static int
-demangle_template_value_parm (work, mangled, s)
- struct work_stuff *work;
- const char **mangled;
- string* s;
-{
- const char *old_p = *mangled;
- int is_pointer = 0;
- int is_real = 0;
- int is_integral = 0;
- int is_char = 0;
- int is_bool = 0;
- int done = 0;
- int success = 1;
-
- while (*old_p && !done)
- {
- switch (*old_p)
- {
- case 'P':
- case 'p':
- case 'R':
- done = is_pointer = 1;
- break;
- case 'C': /* const */
- case 'S': /* explicitly signed [char] */
- case 'U': /* unsigned */
- case 'V': /* volatile */
- case 'F': /* function */
- case 'M': /* member function */
- case 'O': /* ??? */
- case 'J': /* complex */
- old_p++;
- continue;
- case 'E': /* expression */
- case 'Q': /* qualified name */
- case 'K': /* qualified name */
- done = is_integral = 1;
- break;
- case 'B': /* squangled name */
- done = is_integral = 1;
- break;
- case 'T': /* remembered type */
- abort ();
- break;
- case 'v': /* void */
- abort ();
- break;
- case 'x': /* long long */
- case 'l': /* long */
- case 'i': /* int */
- case 's': /* short */
- case 'w': /* wchar_t */
- done = is_integral = 1;
- break;
- case 'b': /* bool */
- done = is_bool = 1;
- break;
- case 'c': /* char */
- done = is_char = 1;
- break;
- case 'r': /* long double */
- case 'd': /* double */
- case 'f': /* float */
- done = is_real = 1;
- break;
- default:
- /* it's probably user defined type, let's assume
- it's integral, it seems hard to figure out
- what it really is */
- done = is_integral = 1;
- }
- }
- if (**mangled == 'Y')
- {
- /* The next argument is a template parameter. */
- int idx;
-
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
- if (idx == -1
- || (work->tmpl_argvec && idx >= work->ntmpl_args)
- || consume_count_with_underscores (mangled) == -1)
- return -1;
- if (work->tmpl_argvec)
- string_append (s, work->tmpl_argvec[idx]);
- else
- {
- char buf[10];
- sprintf(buf, "T%d", idx);
- string_append (s, buf);
- }
- }
- else if (is_integral)
- success = demangle_integral_value (work, mangled, s);
- else if (is_char)
- {
- char tmp[2];
- int val;
- if (**mangled == 'm')
- {
- string_appendn (s, "-", 1);
- (*mangled)++;
- }
- string_appendn (s, "'", 1);
- val = consume_count(mangled);
- if (val == 0)
- return -1;
- tmp[0] = (char)val;
- tmp[1] = '\0';
- string_appendn (s, &tmp[0], 1);
- string_appendn (s, "'", 1);
- }
- else if (is_bool)
- {
- int val = consume_count (mangled);
- if (val == 0)
- string_appendn (s, "false", 5);
- else if (val == 1)
- string_appendn (s, "true", 4);
- else
- success = 0;
- }
- else if (is_real)
- {
- if (**mangled == 'm')
- {
- string_appendn (s, "-", 1);
- (*mangled)++;
- }
- while (isdigit (**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- }
- if (**mangled == '.') /* fraction */
- {
- string_appendn (s, ".", 1);
- (*mangled)++;
- while (isdigit (**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- }
- }
- if (**mangled == 'e') /* exponent */
- {
- string_appendn (s, "e", 1);
- (*mangled)++;
- while (isdigit (**mangled))
- {
- string_appendn (s, *mangled, 1);
- (*mangled)++;
- }
- }
- }
- else if (is_pointer)
- {
- int symbol_len = consume_count (mangled);
- if (symbol_len == 0)
- return -1;
- if (symbol_len == 0)
- string_appendn (s, "0", 1);
- else
- {
- char *p = xmalloc (symbol_len + 1), *q;
- strncpy (p, *mangled, symbol_len);
- p [symbol_len] = '\0';
- q = internal_cplus_demangle (work, p, work->options);
- string_appendn (s, "&", 1);
- if (q)
- {
- string_append (s, q);
- free (q);
- }
- else
- string_append (s, p);
- free (p);
- }
- *mangled += symbol_len;
- }
-
- return success;
-}
-
-static int
-demangle_template (work, mangled, tname, trawname, is_type)
- struct work_stuff *work;
- const char **mangled;
- string *tname;
- string *trawname;
- int is_type;
-{
- int i;
- int r;
- int need_comma = 0;
- int success = 0;
- const char *start;
- int is_java_array = 0;
- string temp;
-
- (*mangled)++;
- if (is_type)
- {
- start = *mangled;
- /* get template name */
- if (**mangled == 'z')
- {
- int idx;
- (*mangled)++;
- (*mangled)++;
-
- idx = consume_count_with_underscores (mangled);
- if (idx == -1
- || (work->tmpl_argvec && idx >= work->ntmpl_args)
- || consume_count_with_underscores (mangled) == -1)
- {
- return (0);
- }
- if (work->tmpl_argvec)
- {
- string_append (tname, work->tmpl_argvec[idx]);
- if (trawname)
- string_append (trawname, work->tmpl_argvec[idx]);
- }
- else
- {
- char buf[10];
- sprintf(buf, "T%d", idx);
- string_append (tname, buf);
- if (trawname)
- string_append (trawname, work->tmpl_argvec[idx]);
- }
- }
- else
- {
- if ((r = consume_count (mangled)) == 0 || strlen (*mangled) < r)
- {
- return (0);
- }
- if (trawname)
- string_appendn (trawname, *mangled, r);
- is_java_array = (work -> options & DMGL_JAVA)
- && strncmp (*mangled, "JArray1Z", 8) == 0;
- if (! is_java_array)
- {
- string_appendn (tname, *mangled, r);
- }
- *mangled += r;
- }
- }
- if (!is_java_array)
- string_append (tname, "<");
- /* get size of template parameter list */
- if (!get_count (mangled, &r))
- {
- return (0);
- }
- if (!is_type)
- {
- /* Create an array for saving the template argument values. */
- work->tmpl_argvec = (char**) xmalloc (r * sizeof (char *));
- work->ntmpl_args = r;
- for (i = 0; i < r; i++)
- work->tmpl_argvec[i] = 0;
- }
- for (i = 0; i < r; i++)
- {
- if (need_comma)
- {
- string_append (tname, ", ");
- }
- /* Z for type parameters */
- if (**mangled == 'Z')
- {
- (*mangled)++;
- /* temp is initialized in do_type */
- success = do_type (work, mangled, &temp);
- if (success)
- {
- string_appends (tname, &temp);
-
- if (!is_type)
- {
- /* Save the template argument. */
- int len = temp.p - temp.b;
- work->tmpl_argvec[i] = xmalloc (len + 1);
- memcpy (work->tmpl_argvec[i], temp.b, len);
- work->tmpl_argvec[i][len] = '\0';
- }
- }
- string_delete(&temp);
- if (!success)
- {
- break;
- }
- }
- /* z for template parameters */
- else if (**mangled == 'z')
- {
- int r2;
- (*mangled)++;
- success = demangle_template_template_parm (work, mangled, tname);
-
- if (success
- && (r2 = consume_count (mangled)) > 0 && strlen (*mangled) >= r2)
- {
- string_append (tname, " ");
- string_appendn (tname, *mangled, r2);
- if (!is_type)
- {
- /* Save the template argument. */
- int len = r2;
- work->tmpl_argvec[i] = xmalloc (len + 1);
- memcpy (work->tmpl_argvec[i], *mangled, len);
- work->tmpl_argvec[i][len] = '\0';
- }
- *mangled += r2;
- }
- if (!success)
- {
- break;
- }
- }
- else
- {
- string param;
- string* s;
-
- /* otherwise, value parameter */
-
- /* temp is initialized in do_type */
- success = do_type (work, mangled, &temp);
- /*
- if (success)
- {
- string_appends (s, &temp);
- }
- */
- string_delete(&temp);
- if (!success)
- {
- break;
- }
- /*
- string_append (s, "=");
- */
-
- if (!is_type)
- {
- s = &param;
- string_init (s);
- }
- else
- s = tname;
-
- success = demangle_template_value_parm (work, mangled, s);
-
- if (!success)
- {
- if (!is_type)
- string_delete (s);
- success = 0;
- break;
- }
-
- if (!is_type)
- {
- int len = s->p - s->b;
- work->tmpl_argvec[i] = xmalloc (len + 1);
- memcpy (work->tmpl_argvec[i], s->b, len);
- work->tmpl_argvec[i][len] = '\0';
-
- string_appends (tname, s);
- string_delete (s);
- }
- }
- need_comma = 1;
- }
- if (is_java_array)
- {
- string_append (tname, "[]");
- }
- else
- {
- if (tname->p[-1] == '>')
- string_append (tname, " ");
- string_append (tname, ">");
- }
-
- /*
- if (work -> static_type)
- {
- string_append (declp, *mangled + 1);
- *mangled += strlen (*mangled);
- success = 1;
- }
- else
- {
- success = demangle_args (work, mangled, declp);
- }
- }
- */
- return (success);
-}
-
-static int
-arm_pt (work, mangled, n, anchor, args)
- struct work_stuff *work;
- const char *mangled;
- int n;
- const char **anchor, **args;
-{
- /* ARM template? */
- if (ARM_DEMANGLING && (*anchor = mystrstr (mangled, "__pt__")))
- {
- int len;
- *args = *anchor + 6;
- len = consume_count (args);
- if (*args + len == mangled + n && **args == '_')
- {
- ++*args;
- return 1;
- }
- }
- return 0;
-}
-
-static void
-demangle_arm_pt (work, mangled, n, declp)
- struct work_stuff *work;
- const char **mangled;
- int n;
- string *declp;
-{
- const char *p;
- const char *args;
- const char *e = *mangled + n;
-
- /* ARM template? */
- if (arm_pt (work, *mangled, n, &p, &args))
- {
- string arg;
- string_init (&arg);
- string_appendn (declp, *mangled, p - *mangled);
- string_append (declp, "<");
- /* should do error checking here */
- while (args < e) {
- string_clear (&arg);
- do_type (work, &args, &arg);
- string_appends (declp, &arg);
- string_append (declp, ",");
- }
- string_delete (&arg);
- --declp->p;
- string_append (declp, ">");
- }
- else
- {
- string_appendn (declp, *mangled, n);
- }
- *mangled += n;
-}
-
-static int
-demangle_class_name (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int n;
- int success = 0;
-
- n = consume_count (mangled);
- if (strlen (*mangled) >= n)
- {
- demangle_arm_pt (work, mangled, n, declp);
- success = 1;
- }
-
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_class -- demangle a mangled class sequence
-
-SYNOPSIS
-
- static int
- demangle_class (struct work_stuff *work, const char **mangled,
- strint *declp)
-
-DESCRIPTION
-
- DECLP points to the buffer into which demangling is being done.
-
- *MANGLED points to the current token to be demangled. On input,
- it points to a mangled class (I.E. "3foo", "13verylongclass", etc.)
- On exit, it points to the next token after the mangled class on
- success, or the first unconsumed token on failure.
-
- If the CONSTRUCTOR or DESTRUCTOR flags are set in WORK, then
- we are demangling a constructor or destructor. In this case
- we prepend "class::class" or "class::~class" to DECLP.
-
- Otherwise, we prepend "class::" to the current DECLP.
-
- Reset the constructor/destructor flags once they have been
- "consumed". This allows demangle_class to be called later during
- the same demangling, to do normal class demangling.
-
- Returns 1 if demangling is successful, 0 otherwise.
-
-*/
-
-static int
-demangle_class (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 0;
- int btype;
- string class_name;
-
- string_init (&class_name);
- btype = register_Btype (work);
- if (demangle_class_name (work, mangled, &class_name))
- {
- if ((work->constructor & 1) || (work->destructor & 1))
- {
- string_prepends (declp, &class_name);
- if (work -> destructor & 1)
- {
- string_prepend (declp, "~");
- work -> destructor -= 1;
- }
- else
- {
- work -> constructor -= 1;
- }
- }
- remember_Ktype (work, class_name.b, LEN_STRING(&class_name));
- remember_Btype (work, class_name.b, LEN_STRING(&class_name), btype);
- string_prepend (declp, (work -> options & DMGL_JAVA) ? "." : "::");
- string_prepends (declp, &class_name);
- success = 1;
- }
- string_delete (&class_name);
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_prefix -- consume the mangled name prefix and find signature
-
-SYNOPSIS
-
- static int
- demangle_prefix (struct work_stuff *work, const char **mangled,
- string *declp);
-
-DESCRIPTION
-
- Consume and demangle the prefix of the mangled name.
-
- DECLP points to the string buffer into which demangled output is
- placed. On entry, the buffer is empty. On exit it contains
- the root function name, the demangled operator name, or in some
- special cases either nothing or the completely demangled result.
-
- MANGLED points to the current pointer into the mangled name. As each
- token of the mangled name is consumed, it is updated. Upon entry
- the current mangled name pointer points to the first character of
- the mangled name. Upon exit, it should point to the first character
- of the signature if demangling was successful, or to the first
- unconsumed character if demangling of the prefix was unsuccessful.
-
- Returns 1 on success, 0 otherwise.
- */
-
-static int
-demangle_prefix (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int success = 1;
- const char *scan;
- int i;
-
- if (strlen(*mangled) >= 11 && strncmp(*mangled, "_GLOBAL_", 8) == 0)
- {
- char *marker = strchr (cplus_markers, (*mangled)[8]);
- if (marker != NULL && *marker == (*mangled)[10])
- {
- if ((*mangled)[9] == 'D')
- {
- /* it's a GNU global destructor to be executed at program exit */
- (*mangled) += 11;
- work->destructor = 2;
- if (gnu_special (work, mangled, declp))
- return success;
- }
- else if ((*mangled)[9] == 'I')
- {
- /* it's a GNU global constructor to be executed at program init */
- (*mangled) += 11;
- work->constructor = 2;
- if (gnu_special (work, mangled, declp))
- return success;
- }
- }
- }
- else if (ARM_DEMANGLING && strncmp(*mangled, "__std__", 7) == 0)
- {
- /* it's a ARM global destructor to be executed at program exit */
- (*mangled) += 7;
- work->destructor = 2;
- }
- else if (ARM_DEMANGLING && strncmp(*mangled, "__sti__", 7) == 0)
- {
- /* it's a ARM global constructor to be executed at program initial */
- (*mangled) += 7;
- work->constructor = 2;
- }
-
- /* This block of code is a reduction in strength time optimization
- of:
- scan = mystrstr (*mangled, "__"); */
-
- {
- scan = *mangled;
-
- do {
- scan = strchr (scan, '_');
- } while (scan != NULL && *++scan != '_');
-
- if (scan != NULL) --scan;
- }
-
- if (scan != NULL)
- {
- /* We found a sequence of two or more '_', ensure that we start at
- the last pair in the sequence. */
- i = strspn (scan, "_");
- if (i > 2)
- {
- scan += (i - 2);
- }
- }
-
- if (scan == NULL)
- {
- success = 0;
- }
- else if (work -> static_type)
- {
- if (!isdigit (scan[0]) && (scan[0] != 't'))
- {
- success = 0;
- }
- }
- else if ((scan == *mangled)
- && (isdigit (scan[2]) || (scan[2] == 'Q') || (scan[2] == 't')
- || (scan[2] == 'K') || (scan[2] == 'H')))
- {
- /* The ARM says nothing about the mangling of local variables.
- But cfront mangles local variables by prepending __<nesting_level>
- to them. As an extension to ARM demangling we handle this case. */
- if ((LUCID_DEMANGLING || ARM_DEMANGLING) && isdigit (scan[2]))
- {
- *mangled = scan + 2;
- consume_count (mangled);
- string_append (declp, *mangled);
- *mangled += strlen (*mangled);
- success = 1;
- }
- else
- {
- /* A GNU style constructor starts with __[0-9Qt]. But cfront uses
- names like __Q2_3foo3bar for nested type names. So don't accept
- this style of constructor for cfront demangling. A GNU
- style member-template constructor starts with 'H'. */
- if (!(LUCID_DEMANGLING || ARM_DEMANGLING))
- work -> constructor += 1;
- *mangled = scan + 2;
- }
- }
- else if ((scan == *mangled) && !isdigit (scan[2]) && (scan[2] != 't'))
- {
- /* Mangled name starts with "__". Skip over any leading '_' characters,
- then find the next "__" that separates the prefix from the signature.
- */
- if (!(ARM_DEMANGLING || LUCID_DEMANGLING)
- || (arm_special (mangled, declp) == 0))
- {
- while (*scan == '_')
- {
- scan++;
- }
- if ((scan = mystrstr (scan, "__")) == NULL || (*(scan + 2) == '\0'))
- {
- /* No separator (I.E. "__not_mangled"), or empty signature
- (I.E. "__not_mangled_either__") */
- success = 0;
- }
- else
- {
- demangle_function_name (work, mangled, declp, scan);
- }
- }
- }
- else if (ARM_DEMANGLING && scan[2] == 'p' && scan[3] == 't')
- {
- /* Cfront-style parameterized type. Handled later as a signature. */
- success = 1;
-
- /* ARM template? */
- demangle_arm_pt (work, mangled, strlen (*mangled), declp);
- }
- else if (*(scan + 2) != '\0')
- {
- /* Mangled name does not start with "__" but does have one somewhere
- in there with non empty stuff after it. Looks like a global
- function name. */
- demangle_function_name (work, mangled, declp, scan);
- }
- else
- {
- /* Doesn't look like a mangled name */
- success = 0;
- }
-
- if (!success && (work->constructor == 2 || work->destructor == 2))
- {
- string_append (declp, *mangled);
- *mangled += strlen (*mangled);
- success = 1;
- }
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- gnu_special -- special handling of gnu mangled strings
-
-SYNOPSIS
-
- static int
- gnu_special (struct work_stuff *work, const char **mangled,
- string *declp);
-
-
-DESCRIPTION
-
- Process some special GNU style mangling forms that don't fit
- the normal pattern. For example:
-
- _$_3foo (destructor for class foo)
- _vt$foo (foo virtual table)
- _vt$foo$bar (foo::bar virtual table)
- __vt_foo (foo virtual table, new style with thunks)
- _3foo$varname (static data member)
- _Q22rs2tu$vw (static data member)
- __t6vector1Zii (constructor with template)
- __thunk_4__$_7ostream (virtual function thunk)
- */
-
-static int
-gnu_special (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- int n;
- int success = 1;
- const char *p;
-
- if ((*mangled)[0] == '_'
- && strchr (cplus_markers, (*mangled)[1]) != NULL
- && (*mangled)[2] == '_')
- {
- /* Found a GNU style destructor, get past "_<CPLUS_MARKER>_" */
- (*mangled) += 3;
- work -> destructor += 1;
- }
- else if ((*mangled)[0] == '_'
- && (((*mangled)[1] == '_'
- && (*mangled)[2] == 'v'
- && (*mangled)[3] == 't'
- && (*mangled)[4] == '_')
- || ((*mangled)[1] == 'v'
- && (*mangled)[2] == 't'
- && strchr (cplus_markers, (*mangled)[3]) != NULL)))
- {
- /* Found a GNU style virtual table, get past "_vt<CPLUS_MARKER>"
- and create the decl. Note that we consume the entire mangled
- input string, which means that demangle_signature has no work
- to do. */
- if ((*mangled)[2] == 'v')
- (*mangled) += 5; /* New style, with thunks: "__vt_" */
- else
- (*mangled) += 4; /* Old style, no thunks: "_vt<CPLUS_MARKER>" */
- while (**mangled != '\0')
- {
- p = strpbrk (*mangled, cplus_markers);
- switch (**mangled)
- {
- case 'Q':
- case 'K':
- success = demangle_qualified (work, mangled, declp, 0, 1);
- break;
- case 't':
- success = demangle_template (work, mangled, declp, 0, 1);
- break;
- default:
- if (isdigit(*mangled[0]))
- {
- n = consume_count(mangled);
- /* We may be seeing a too-large size, or else a
- ".<digits>" indicating a static local symbol. In
- any case, declare victory and move on; *don't* try
- to use n to allocate. */
- if (n > strlen (*mangled))
- {
- success = 1;
- break;
- }
- }
- else
- {
- n = strcspn (*mangled, cplus_markers);
- }
- string_appendn (declp, *mangled, n);
- (*mangled) += n;
- }
-
- if (success && ((p == NULL) || (p == *mangled)))
- {
- if (p != NULL)
- {
- string_append (declp,
- (work -> options & DMGL_JAVA) ? "." : "::");
- (*mangled)++;
- }
- }
- else
- {
- success = 0;
- break;
- }
- }
- if (success)
- string_append (declp, " virtual table");
- }
- else if ((*mangled)[0] == '_'
- && (strchr("0123456789Qt", (*mangled)[1]) != NULL)
- && (p = strpbrk (*mangled, cplus_markers)) != NULL)
- {
- /* static data member, "_3foo$varname" for example */
- (*mangled)++;
- switch (**mangled)
- {
- case 'Q':
- case 'K':
- success = demangle_qualified (work, mangled, declp, 0, 1);
- break;
- case 't':
- success = demangle_template (work, mangled, declp, 0, 1);
- break;
- default:
- n = consume_count (mangled);
- string_appendn (declp, *mangled, n);
- (*mangled) += n;
- }
- if (success && (p == *mangled))
- {
- /* Consumed everything up to the cplus_marker, append the
- variable name. */
- (*mangled)++;
- string_append (declp, (work -> options & DMGL_JAVA) ? "." : "::");
- n = strlen (*mangled);
- string_appendn (declp, *mangled, n);
- (*mangled) += n;
- }
- else
- {
- success = 0;
- }
- }
- else if (strncmp (*mangled, "__thunk_", 8) == 0)
- {
- int delta = ((*mangled) += 8, consume_count (mangled));
- char *method = internal_cplus_demangle (work, ++*mangled, work->options);
- if (method)
- {
- char buf[50];
- sprintf (buf, "virtual function thunk (delta:%d) for ", -delta);
- string_append (declp, buf);
- string_append (declp, method);
- free (method);
- n = strlen (*mangled);
- (*mangled) += n;
- }
- else
- {
- success = 0;
- }
- }
- else if (strncmp (*mangled, "__t", 3) == 0
- && ((*mangled)[3] == 'i' || (*mangled)[3] == 'f'))
- {
- p = (*mangled)[3] == 'i' ? " type_info node" : " type_info function";
- (*mangled) += 4;
- switch (**mangled)
- {
- case 'Q':
- case 'K':
- success = demangle_qualified (work, mangled, declp, 0, 1);
- break;
- case 't':
- success = demangle_template (work, mangled, declp, 0, 1);
- break;
- default:
- success = demangle_fund_type (work, mangled, declp);
- break;
- }
- if (success && **mangled != '\0')
- success = 0;
- if (success)
- string_append (declp, p);
- }
- else
- {
- success = 0;
- }
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- arm_special -- special handling of ARM/lucid mangled strings
-
-SYNOPSIS
-
- static int
- arm_special (const char **mangled,
- string *declp);
-
-
-DESCRIPTION
-
- Process some special ARM style mangling forms that don't fit
- the normal pattern. For example:
-
- __vtbl__3foo (foo virtual table)
- __vtbl__3foo__3bar (bar::foo virtual table)
-
- */
-
-static int
-arm_special (mangled, declp)
- const char **mangled;
- string *declp;
-{
- int n;
- int success = 1;
- const char *scan;
-
- if (strncmp (*mangled, ARM_VTABLE_STRING, ARM_VTABLE_STRLEN) == 0)
- {
- /* Found a ARM style virtual table, get past ARM_VTABLE_STRING
- and create the decl. Note that we consume the entire mangled
- input string, which means that demangle_signature has no work
- to do. */
- scan = *mangled + ARM_VTABLE_STRLEN;
- while (*scan != '\0') /* first check it can be demangled */
- {
- n = consume_count (&scan);
- if (n==0)
- {
- return (0); /* no good */
- }
- scan += n;
- if (scan[0] == '_' && scan[1] == '_')
- {
- scan += 2;
- }
- }
- (*mangled) += ARM_VTABLE_STRLEN;
- while (**mangled != '\0')
- {
- n = consume_count (mangled);
- string_prependn (declp, *mangled, n);
- (*mangled) += n;
- if ((*mangled)[0] == '_' && (*mangled)[1] == '_')
- {
- string_prepend (declp, "::");
- (*mangled) += 2;
- }
- }
- string_append (declp, " virtual table");
- }
- else
- {
- success = 0;
- }
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- demangle_qualified -- demangle 'Q' qualified name strings
-
-SYNOPSIS
-
- static int
- demangle_qualified (struct work_stuff *, const char *mangled,
- string *result, int isfuncname, int append);
-
-DESCRIPTION
-
- Demangle a qualified name, such as "Q25Outer5Inner" which is
- the mangled form of "Outer::Inner". The demangled output is
- prepended or appended to the result string according to the
- state of the append flag.
-
- If isfuncname is nonzero, then the qualified name we are building
- is going to be used as a member function name, so if it is a
- constructor or destructor function, append an appropriate
- constructor or destructor name. I.E. for the above example,
- the result for use as a constructor is "Outer::Inner::Inner"
- and the result for use as a destructor is "Outer::Inner::~Inner".
-
-BUGS
-
- Numeric conversion is ASCII dependent (FIXME).
-
- */
-
-static int
-demangle_qualified (work, mangled, result, isfuncname, append)
- struct work_stuff *work;
- const char **mangled;
- string *result;
- int isfuncname;
- int append;
-{
- int qualifiers = 0;
- int namelength;
- int success = 1;
- const char *p;
- char num[2];
- string temp;
-
- string_init (&temp);
-
- if ((*mangled)[0] == 'K')
- {
- /* Squangling qualified name reuse */
- int idx;
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
- if (idx == -1 || idx > work -> numk)
- success = 0;
- else
- string_append (&temp, work -> ktypevec[idx]);
- }
- else
- switch ((*mangled)[1])
- {
- case '_':
- /* GNU mangled name with more than 9 classes. The count is preceded
- by an underscore (to distinguish it from the <= 9 case) and followed
- by an underscore. */
- p = *mangled + 2;
- qualifiers = atoi (p);
- if (!isdigit (*p) || *p == '0')
- success = 0;
-
- /* Skip the digits. */
- while (isdigit (*p))
- ++p;
-
- if (*p != '_')
- success = 0;
-
- *mangled = p + 1;
- break;
-
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- /* The count is in a single digit. */
- num[0] = (*mangled)[1];
- num[1] = '\0';
- qualifiers = atoi (num);
-
- /* If there is an underscore after the digit, skip it. This is
- said to be for ARM-qualified names, but the ARM makes no
- mention of such an underscore. Perhaps cfront uses one. */
- if ((*mangled)[2] == '_')
- {
- (*mangled)++;
- }
- (*mangled) += 2;
- break;
-
- case '0':
- default:
- success = 0;
- }
-
- if (!success)
- return success;
-
- /* Pick off the names and collect them in the temp buffer in the order
- in which they are found, separated by '::'. */
-
- while (qualifiers-- > 0)
- {
- int remember_K = 1;
- if (*mangled[0] == '_')
- *mangled = *mangled + 1;
- if (*mangled[0] == 't')
- {
- success = demangle_template(work, mangled, &temp, 0, 1);
- if (!success) break;
- }
- else if (*mangled[0] == 'X')
- {
- success = do_type (work, mangled, &temp);
- if (!success) break;
- }
- else if (*mangled[0] == 'K')
- {
- int idx;
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
- if (idx == -1 || idx > work->numk)
- success = 0;
- else
- string_append (&temp, work->ktypevec[idx]);
- remember_K = 0;
-
- if (!success) break;
- }
- else
- {
- namelength = consume_count (mangled);
- if (strlen (*mangled) < namelength)
- {
- /* Simple sanity check failed */
- success = 0;
- break;
- }
- string_appendn (&temp, *mangled, namelength);
- *mangled += namelength;
- }
-
- if (remember_K)
- {
- remember_Ktype (work, temp.b, LEN_STRING (&temp));
- }
-
- if (qualifiers > 0)
- {
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
- }
- }
-
- /* If we are using the result as a function name, we need to append
- the appropriate '::' separated constructor or destructor name.
- We do this here because this is the most convenient place, where
- we already have a pointer to the name and the length of the name. */
-
- if (isfuncname && (work->constructor & 1 || work->destructor & 1))
- {
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
- if (work -> destructor & 1)
- {
- string_append (&temp, "~");
- }
- string_appendn (&temp, (*mangled) - namelength, namelength);
- }
-
- /* Now either prepend the temp buffer to the result, or append it,
- depending upon the state of the append flag. */
-
- if (append)
- {
- string_appends (result, &temp);
- }
- else
- {
- if (!STRING_EMPTY (result))
- {
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
- }
- string_prepends (result, &temp);
- }
-
- string_delete (&temp);
- return (success);
-}
-
-/*
-
-LOCAL FUNCTION
-
- get_count -- convert an ascii count to integer, consuming tokens
-
-SYNOPSIS
-
- static int
- get_count (const char **type, int *count)
-
-DESCRIPTION
-
- Return 0 if no conversion is performed, 1 if a string is converted.
-*/
-
-static int
-get_count (type, count)
- const char **type;
- int *count;
-{
- const char *p;
- int n;
-
- if (!isdigit (**type))
- {
- return (0);
- }
- else
- {
- *count = **type - '0';
- (*type)++;
- if (isdigit (**type))
- {
- p = *type;
- n = *count;
- do
- {
- n *= 10;
- n += *p - '0';
- p++;
- }
- while (isdigit (*p));
- if (*p == '_')
- {
- *type = p + 1;
- *count = n;
- }
- }
- }
- return (1);
-}
-
-/* result will be initialised here; it will be freed on failure */
-
-static int
-do_type (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- int n;
- int done;
- int success;
- string decl;
- const char *remembered_type;
- int constp;
- int volatilep;
- string btype;
-
- string_init (&btype);
- string_init (&decl);
- string_init (result);
-
- done = 0;
- success = 1;
- while (success && !done)
- {
- int member;
- switch (**mangled)
- {
-
- /* A pointer type */
- case 'P':
- case 'p':
- (*mangled)++;
- if (! (work -> options & DMGL_JAVA))
- string_prepend (&decl, "*");
- break;
-
- /* A reference type */
- case 'R':
- (*mangled)++;
- string_prepend (&decl, "&");
- break;
-
- /* An array */
- case 'A':
- {
- const char *p = ++(*mangled);
-
- string_prepend (&decl, "(");
- string_append (&decl, ")[");
- /* Copy anything up until the next underscore (the size of the
- array). */
- while (**mangled && **mangled != '_')
- ++(*mangled);
- if (**mangled == '_')
- {
- string_appendn (&decl, p, *mangled - p);
- string_append (&decl, "]");
- *mangled += 1;
- }
- else
- success = 0;
- break;
- }
-
- /* A back reference to a previously seen type */
- case 'T':
- (*mangled)++;
- if (!get_count (mangled, &n) || n >= work -> ntypes)
- {
- success = 0;
- }
- else
- {
- remembered_type = work -> typevec[n];
- mangled = &remembered_type;
- }
- break;
-
- /* A function */
- case 'F':
- (*mangled)++;
- if (!STRING_EMPTY (&decl) && decl.b[0] == '*')
- {
- string_prepend (&decl, "(");
- string_append (&decl, ")");
- }
- /* After picking off the function args, we expect to either find the
- function return type (preceded by an '_') or the end of the
- string. */
- if (!demangle_args (work, mangled, &decl)
- || (**mangled != '_' && **mangled != '\0'))
- {
- success = 0;
- }
- if (success && (**mangled == '_'))
- {
- (*mangled)++;
- }
- break;
-
- case 'M':
- case 'O':
- {
- constp = 0;
- volatilep = 0;
-
- member = **mangled == 'M';
- (*mangled)++;
- if (!isdigit (**mangled) && **mangled != 't')
- {
- success = 0;
- break;
- }
-
- string_append (&decl, ")");
- string_prepend (&decl, (work -> options & DMGL_JAVA) ? "." : "::");
- if (isdigit (**mangled))
- {
- n = consume_count (mangled);
- if (strlen (*mangled) < n)
- {
- success = 0;
- break;
- }
- string_prependn (&decl, *mangled, n);
- *mangled += n;
- }
- else
- {
- string temp;
- string_init (&temp);
- success = demangle_template (work, mangled, &temp, NULL, 1);
- if (success)
- {
- string_prependn (&decl, temp.b, temp.p - temp.b);
- string_clear (&temp);
- }
- else
- break;
- }
- string_prepend (&decl, "(");
- if (member)
- {
- if (**mangled == 'C')
- {
- (*mangled)++;
- constp = 1;
- }
- if (**mangled == 'V')
- {
- (*mangled)++;
- volatilep = 1;
- }
- if (*(*mangled)++ != 'F')
- {
- success = 0;
- break;
- }
- }
- if ((member && !demangle_args (work, mangled, &decl))
- || **mangled != '_')
- {
- success = 0;
- break;
- }
- (*mangled)++;
- if (! PRINT_ANSI_QUALIFIERS)
- {
- break;
- }
- if (constp)
- {
- APPEND_BLANK (&decl);
- string_append (&decl, "const");
- }
- if (volatilep)
- {
- APPEND_BLANK (&decl);
- string_append (&decl, "volatile");
- }
- break;
- }
- case 'G':
- (*mangled)++;
- break;
-
- case 'C':
- (*mangled)++;
- /*
- if ((*mangled)[1] == 'P')
- {
- */
- if (PRINT_ANSI_QUALIFIERS)
- {
- if (!STRING_EMPTY (&decl))
- {
- string_prepend (&decl, " ");
- }
- string_prepend (&decl, "const");
- }
- break;
- /*
- }
- */
-
- /* fall through */
- default:
- done = 1;
- break;
- }
- }
-
- switch (**mangled)
- {
- /* A qualified name, such as "Outer::Inner". */
- case 'Q':
- case 'K':
- {
- int btype = register_Btype (work);
- success = demangle_qualified (work, mangled, result, 0, 1);
- remember_Btype (work, result->b, LEN_STRING (result), btype);
-
- break;
- }
-
- /* A back reference to a previously seen squangled type */
- case 'B':
- (*mangled)++;
- if (!get_count (mangled, &n) || n >= work -> numb)
- success = 0;
- else
- {
- string_append (result, work->btypevec[n]);
- }
- break;
-
- case 'X':
- case 'Y':
- /* A template parm. We substitute the corresponding argument. */
- {
- int idx;
-
- (*mangled)++;
- idx = consume_count_with_underscores (mangled);
-
- if (idx == -1
- || (work->tmpl_argvec && idx >= work->ntmpl_args)
- || consume_count_with_underscores (mangled) == -1)
- {
- success = 0;
- break;
- }
-
- if (work->tmpl_argvec)
- string_append (result, work->tmpl_argvec[idx]);
- else
- {
- char buf[10];
- sprintf(buf, "T%d", idx);
- string_append (result, buf);
- }
-
- success = 1;
- }
- break;
-
- default:
- success = demangle_fund_type (work, mangled, result);
- break;
- }
-
- if (success)
- {
- if (!STRING_EMPTY (&decl))
- {
- string_append (result, " ");
- string_appends (result, &decl);
- }
- }
- else
- {
- string_delete (result);
- }
- string_delete (&decl);
- return (success);
-}
-
-/* Given a pointer to a type string that represents a fundamental type
- argument (int, long, unsigned int, etc) in TYPE, a pointer to the
- string in which the demangled output is being built in RESULT, and
- the WORK structure, decode the types and add them to the result.
-
- For example:
-
- "Ci" => "const int"
- "Sl" => "signed long"
- "CUs" => "const unsigned short"
-
- */
-
-static int
-demangle_fund_type (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- int done = 0;
- int success = 1;
- string btype;
- string_init (&btype);
-
- /* First pick off any type qualifiers. There can be more than one. */
-
- while (!done)
- {
- switch (**mangled)
- {
- case 'C':
- (*mangled)++;
- if (PRINT_ANSI_QUALIFIERS)
- {
- APPEND_BLANK (result);
- string_append (result, "const");
- }
- break;
- case 'U':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "unsigned");
- break;
- case 'S': /* signed char only */
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "signed");
- break;
- case 'V':
- (*mangled)++;
- if (PRINT_ANSI_QUALIFIERS)
- {
- APPEND_BLANK (result);
- string_append (result, "volatile");
- }
- break;
- case 'J':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "__complex");
- break;
- default:
- done = 1;
- break;
- }
- }
-
- /* Now pick off the fundamental type. There can be only one. */
-
- switch (**mangled)
- {
- case '\0':
- case '_':
- break;
- case 'v':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "void");
- break;
- case 'x':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "long long");
- break;
- case 'l':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "long");
- break;
- case 'i':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "int");
- break;
- case 's':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "short");
- break;
- case 'b':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "bool");
- break;
- case 'c':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "char");
- break;
- case 'w':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "wchar_t");
- break;
- case 'r':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "long double");
- break;
- case 'd':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "double");
- break;
- case 'f':
- (*mangled)++;
- APPEND_BLANK (result);
- string_append (result, "float");
- break;
- case 'G':
- (*mangled)++;
- if (!isdigit (**mangled))
- {
- success = 0;
- break;
- }
- /* fall through */
- /* An explicit type, such as "6mytype" or "7integer" */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- int bindex = register_Btype (work);
- string btype;
- string_init (&btype);
- if (demangle_class_name (work, mangled, &btype)) {
- remember_Btype (work, btype.b, LEN_STRING (&btype), bindex);
- APPEND_BLANK (result);
- string_appends (result, &btype);
- }
- else
- success = 0;
- string_delete (&btype);
- break;
- }
- case 't':
- {
- int bindex= register_Btype (work);
- success = demangle_template (work, mangled, &btype, 0, 1);
- remember_Btype (work, btype.b, LEN_STRING (&btype), bindex);
- string_appends (result, &btype);
- break;
- }
- default:
- success = 0;
- break;
- }
-
- return (success);
-}
-
-/* `result' will be initialized in do_type; it will be freed on failure */
-
-static int
-do_arg (work, mangled, result)
- struct work_stuff *work;
- const char **mangled;
- string *result;
-{
- const char *start = *mangled;
-
- if (!do_type (work, mangled, result))
- {
- return (0);
- }
- else
- {
- remember_type (work, start, *mangled - start);
- return (1);
- }
-}
-
-static void
-remember_type (work, start, len)
- struct work_stuff *work;
- const char *start;
- int len;
-{
- char *tem;
-
- if (work -> ntypes >= work -> typevec_size)
- {
- if (work -> typevec_size == 0)
- {
- work -> typevec_size = 3;
- work -> typevec
- = (char **) xmalloc (sizeof (char *) * work -> typevec_size);
- }
- else
- {
- work -> typevec_size *= 2;
- work -> typevec
- = (char **) xrealloc ((char *)work -> typevec,
- sizeof (char *) * work -> typevec_size);
- }
- }
- tem = xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- work -> typevec[work -> ntypes++] = tem;
-}
-
-
-/* Remember a K type class qualifier. */
-static void
-remember_Ktype (work, start, len)
- struct work_stuff *work;
- const char *start;
- int len;
-{
- char *tem;
-
- if (work -> numk >= work -> ksize)
- {
- if (work -> ksize == 0)
- {
- work -> ksize = 5;
- work -> ktypevec
- = (char **) xmalloc (sizeof (char *) * work -> ksize);
- }
- else
- {
- work -> ksize *= 2;
- work -> ktypevec
- = (char **) xrealloc ((char *)work -> ktypevec,
- sizeof (char *) * work -> ksize);
- }
- }
- tem = xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- work -> ktypevec[work -> numk++] = tem;
-}
-
-/* Register a B code, and get an index for it. B codes are registered
- as they are seen, rather than as they are completed, so map<temp<char> >
- registers map<temp<char> > as B0, and temp<char> as B1 */
-
-static int
-register_Btype (work)
- struct work_stuff *work;
-{
- int ret;
-
- if (work -> numb >= work -> bsize)
- {
- if (work -> bsize == 0)
- {
- work -> bsize = 5;
- work -> btypevec
- = (char **) xmalloc (sizeof (char *) * work -> bsize);
- }
- else
- {
- work -> bsize *= 2;
- work -> btypevec
- = (char **) xrealloc ((char *)work -> btypevec,
- sizeof (char *) * work -> bsize);
- }
- }
- ret = work -> numb++;
- work -> btypevec[ret] = NULL;
- return(ret);
-}
-
-/* Store a value into a previously registered B code type. */
-
-static void
-remember_Btype (work, start, len, index)
- struct work_stuff *work;
- const char *start;
- int len, index;
-{
- char *tem;
-
- tem = xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- work -> btypevec[index] = tem;
-}
-
-/* Lose all the info related to B and K type codes. */
-static void
-forget_B_and_K_types (work)
- struct work_stuff *work;
-{
- int i;
-
- while (work -> numk > 0)
- {
- i = --(work -> numk);
- if (work -> ktypevec[i] != NULL)
- {
- free (work -> ktypevec[i]);
- work -> ktypevec[i] = NULL;
- }
- }
-
- while (work -> numb > 0)
- {
- i = --(work -> numb);
- if (work -> btypevec[i] != NULL)
- {
- free (work -> btypevec[i]);
- work -> btypevec[i] = NULL;
- }
- }
-}
-/* Forget the remembered types, but not the type vector itself. */
-
-static void
-forget_types (work)
- struct work_stuff *work;
-{
- int i;
-
- while (work -> ntypes > 0)
- {
- i = --(work -> ntypes);
- if (work -> typevec[i] != NULL)
- {
- free (work -> typevec[i]);
- work -> typevec[i] = NULL;
- }
- }
-}
-
-/* Process the argument list part of the signature, after any class spec
- has been consumed, as well as the first 'F' character (if any). For
- example:
-
- "__als__3fooRT0" => process "RT0"
- "complexfunc5__FPFPc_PFl_i" => process "PFPc_PFl_i"
-
- DECLP must be already initialised, usually non-empty. It won't be freed
- on failure.
-
- Note that g++ differs significantly from ARM and lucid style mangling
- with regards to references to previously seen types. For example, given
- the source fragment:
-
- class foo {
- public:
- foo::foo (int, foo &ia, int, foo &ib, int, foo &ic);
- };
-
- foo::foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; }
- void foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; }
-
- g++ produces the names:
-
- __3fooiRT0iT2iT2
- foo__FiR3fooiT1iT1
-
- while lcc (and presumably other ARM style compilers as well) produces:
-
- foo__FiR3fooT1T2T1T2
- __ct__3fooFiR3fooT1T2T1T2
-
- Note that g++ bases it's type numbers starting at zero and counts all
- previously seen types, while lucid/ARM bases it's type numbers starting
- at one and only considers types after it has seen the 'F' character
- indicating the start of the function args. For lucid/ARM style, we
- account for this difference by discarding any previously seen types when
- we see the 'F' character, and subtracting one from the type number
- reference.
-
- */
-
-static int
-demangle_args (work, mangled, declp)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
-{
- string arg;
- int need_comma = 0;
- int r;
- int t;
- const char *tem;
- char temptype;
-
- if (PRINT_ARG_TYPES)
- {
- string_append (declp, "(");
- if (**mangled == '\0')
- {
- string_append (declp, "void");
- }
- }
-
- while (**mangled != '_' && **mangled != '\0' && **mangled != 'e')
- {
- if ((**mangled == 'N') || (**mangled == 'T'))
- {
- temptype = *(*mangled)++;
-
- if (temptype == 'N')
- {
- if (!get_count (mangled, &r))
- {
- return (0);
- }
- }
- else
- {
- r = 1;
- }
- if (ARM_DEMANGLING && work -> ntypes >= 10)
- {
- /* If we have 10 or more types we might have more than a 1 digit
- index so we'll have to consume the whole count here. This
- will lose if the next thing is a type name preceded by a
- count but it's impossible to demangle that case properly
- anyway. Eg if we already have 12 types is T12Pc "(..., type1,
- Pc, ...)" or "(..., type12, char *, ...)" */
- if ((t = consume_count(mangled)) == 0)
- {
- return (0);
- }
- }
- else
- {
- if (!get_count (mangled, &t))
- {
- return (0);
- }
- }
- if (LUCID_DEMANGLING || ARM_DEMANGLING)
- {
- t--;
- }
- /* Validate the type index. Protect against illegal indices from
- malformed type strings. */
- if ((t < 0) || (t >= work -> ntypes))
- {
- return (0);
- }
- while (--r >= 0)
- {
- tem = work -> typevec[t];
- if (need_comma && PRINT_ARG_TYPES)
- {
- string_append (declp, ", ");
- }
- if (!do_arg (work, &tem, &arg))
- {
- return (0);
- }
- if (PRINT_ARG_TYPES)
- {
- string_appends (declp, &arg);
- }
- string_delete (&arg);
- need_comma = 1;
- }
- }
- else
- {
- if (need_comma & PRINT_ARG_TYPES)
- {
- string_append (declp, ", ");
- }
- if (!do_arg (work, mangled, &arg))
- {
- return (0);
- }
- if (PRINT_ARG_TYPES)
- {
- string_appends (declp, &arg);
- }
- string_delete (&arg);
- need_comma = 1;
- }
- }
-
- if (**mangled == 'e')
- {
- (*mangled)++;
- if (PRINT_ARG_TYPES)
- {
- if (need_comma)
- {
- string_append (declp, ",");
- }
- string_append (declp, "...");
- }
- }
-
- if (PRINT_ARG_TYPES)
- {
- string_append (declp, ")");
- }
- return (1);
-}
-
-static void
-demangle_function_name (work, mangled, declp, scan)
- struct work_stuff *work;
- const char **mangled;
- string *declp;
- const char *scan;
-{
- size_t i;
- string type;
- const char *tem;
-
- string_appendn (declp, (*mangled), scan - (*mangled));
- string_need (declp, 1);
- *(declp -> p) = '\0';
-
- /* Consume the function name, including the "__" separating the name
- from the signature. We are guaranteed that SCAN points to the
- separator. */
-
- (*mangled) = scan + 2;
-
- if (LUCID_DEMANGLING || ARM_DEMANGLING)
- {
-
- /* See if we have an ARM style constructor or destructor operator.
- If so, then just record it, clear the decl, and return.
- We can't build the actual constructor/destructor decl until later,
- when we recover the class name from the signature. */
-
- if (strcmp (declp -> b, "__ct") == 0)
- {
- work -> constructor += 1;
- string_clear (declp);
- return;
- }
- else if (strcmp (declp -> b, "__dt") == 0)
- {
- work -> destructor += 1;
- string_clear (declp);
- return;
- }
- }
-
- if (declp->p - declp->b >= 3
- && declp->b[0] == 'o'
- && declp->b[1] == 'p'
- && strchr (cplus_markers, declp->b[2]) != NULL)
- {
- /* see if it's an assignment expression */
- if (declp->p - declp->b >= 10 /* op$assign_ */
- && memcmp (declp->b + 3, "assign_", 7) == 0)
- {
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- int len = declp->p - declp->b - 10;
- if (strlen (optable[i].in) == len
- && memcmp (optable[i].in, declp->b + 10, len) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- string_append (declp, "=");
- break;
- }
- }
- }
- else
- {
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- int len = declp->p - declp->b - 3;
- if (strlen (optable[i].in) == len
- && memcmp (optable[i].in, declp->b + 3, len) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- break;
- }
- }
- }
- }
- else if (declp->p - declp->b >= 5 && memcmp (declp->b, "type", 4) == 0
- && strchr (cplus_markers, declp->b[4]) != NULL)
- {
- /* type conversion operator */
- tem = declp->b + 5;
- if (do_type (work, &tem, &type))
- {
- string_clear (declp);
- string_append (declp, "operator ");
- string_appends (declp, &type);
- string_delete (&type);
- }
- }
- else if (declp->b[0] == '_' && declp->b[1] == '_'
- && declp->b[2] == 'o' && declp->b[3] == 'p')
- {
- /* ANSI. */
- /* type conversion operator. */
- tem = declp->b + 4;
- if (do_type (work, &tem, &type))
- {
- string_clear (declp);
- string_append (declp, "operator ");
- string_appends (declp, &type);
- string_delete (&type);
- }
- }
- else if (declp->b[0] == '_' && declp->b[1] == '_'
- && declp->b[2] >= 'a' && declp->b[2] <= 'z'
- && declp->b[3] >= 'a' && declp->b[3] <= 'z')
- {
- if (declp->b[4] == '\0')
- {
- /* Operator. */
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 2
- && memcmp (optable[i].in, declp->b + 2, 2) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- break;
- }
- }
- }
- else
- {
- if (declp->b[2] == 'a' && declp->b[5] == '\0')
- {
- /* Assignment. */
- for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 3
- && memcmp (optable[i].in, declp->b + 2, 3) == 0)
- {
- string_clear (declp);
- string_append (declp, "operator");
- string_append (declp, optable[i].out);
- break;
- }
- }
- }
- }
- }
-}
-
-/* a mini string-handling package */
-
-static void
-string_need (s, n)
- string *s;
- int n;
-{
- int tem;
-
- if (s->b == NULL)
- {
- if (n < 32)
- {
- n = 32;
- }
- s->p = s->b = xmalloc (n);
- s->e = s->b + n;
- }
- else if (s->e - s->p < n)
- {
- tem = s->p - s->b;
- n += tem;
- n *= 2;
- s->b = xrealloc (s->b, n);
- s->p = s->b + tem;
- s->e = s->b + n;
- }
-}
-
-static void
-string_delete (s)
- string *s;
-{
- if (s->b != NULL)
- {
- free (s->b);
- s->b = s->e = s->p = NULL;
- }
-}
-
-static void
-string_init (s)
- string *s;
-{
- s->b = s->p = s->e = NULL;
-}
-
-static void
-string_clear (s)
- string *s;
-{
- s->p = s->b;
-}
-
-#if 0
-
-static int
-string_empty (s)
- string *s;
-{
- return (s->b == s->p);
-}
-
-#endif
-
-static void
-string_append (p, s)
- string *p;
- const char *s;
-{
- int n;
- if (s == NULL || *s == '\0')
- return;
- n = strlen (s);
- string_need (p, n);
- memcpy (p->p, s, n);
- p->p += n;
-}
-
-static void
-string_appends (p, s)
- string *p, *s;
-{
- int n;
-
- if (s->b != s->p)
- {
- n = s->p - s->b;
- string_need (p, n);
- memcpy (p->p, s->b, n);
- p->p += n;
- }
-}
-
-static void
-string_appendn (p, s, n)
- string *p;
- const char *s;
- int n;
-{
- if (n != 0)
- {
- string_need (p, n);
- memcpy (p->p, s, n);
- p->p += n;
- }
-}
-
-static void
-string_prepend (p, s)
- string *p;
- const char *s;
-{
- if (s != NULL && *s != '\0')
- {
- string_prependn (p, s, strlen (s));
- }
-}
-
-static void
-string_prepends (p, s)
- string *p, *s;
-{
- if (s->b != s->p)
- {
- string_prependn (p, s->b, s->p - s->b);
- }
-}
-
-static void
-string_prependn (p, s, n)
- string *p;
- const char *s;
- int n;
-{
- char *q;
-
- if (n != 0)
- {
- string_need (p, n);
- for (q = p->p - 1; q >= p->b; q--)
- {
- q[n] = q[0];
- }
- memcpy (p->b, s, n);
- p->p += n;
- }
-}
-
-/* To generate a standalone demangler program for testing purposes,
- just compile and link this file with -DMAIN and libiberty.a. When
- run, it demangles each command line arg, or each stdin string, and
- prints the result on stdout. */
-
-#ifdef MAIN
-
-#include "getopt.h"
-
-static char *program_name;
-static char *program_version = VERSION;
-static int flags = DMGL_PARAMS | DMGL_ANSI;
-
-static void demangle_it PARAMS ((char *));
-static void usage PARAMS ((FILE *, int));
-static void fatal PARAMS ((char *));
-
-static void
-demangle_it (mangled_name)
- char *mangled_name;
-{
- char *result;
-
- result = cplus_demangle (mangled_name, flags);
- if (result == NULL)
- {
- printf ("%s\n", mangled_name);
- }
- else
- {
- printf ("%s\n", result);
- free (result);
- }
-}
-
-static void
-usage (stream, status)
- FILE *stream;
- int status;
-{
- fprintf (stream, "\
-Usage: %s [-_] [-n] [-s {gnu,lucid,arm}] [--strip-underscores]\n\
- [--no-strip-underscores] [--format={gnu,lucid,arm}]\n\
- [--help] [--version] [arg...]\n",
- program_name);
- exit (status);
-}
-
-#define MBUF_SIZE 512
-char mbuffer[MBUF_SIZE];
-
-/* Defined in the automatically-generated underscore.c. */
-extern int prepends_underscore;
-
-int strip_underscore = 0;
-
-static struct option long_options[] = {
- {"strip-underscores", no_argument, 0, '_'},
- {"format", required_argument, 0, 's'},
- {"help", no_argument, 0, 'h'},
- {"java", no_argument, 0, 'j'},
- {"no-strip-underscores", no_argument, 0, 'n'},
- {"version", no_argument, 0, 'v'},
- {0, no_argument, 0, 0}
-};
-
-/* More 'friendly' abort that prints the line and file.
- config.h can #define abort fancy_abort if you like that sort of thing. */
-
-void
-fancy_abort ()
-{
- fatal ("Internal gcc abort.");
-}
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- char *result;
- int c;
-
- program_name = argv[0];
-
- strip_underscore = prepends_underscore;
-
- while ((c = getopt_long (argc, argv, "_ns:j", 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 version %s\n", program_name, program_version);
- exit (0);
- case '_':
- strip_underscore = 1;
- break;
- case 'j':
- flags |= DMGL_JAVA;
- break;
- case 's':
- if (strcmp (optarg, "gnu") == 0)
- {
- current_demangling_style = gnu_demangling;
- }
- else if (strcmp (optarg, "lucid") == 0)
- {
- current_demangling_style = lucid_demangling;
- }
- else if (strcmp (optarg, "arm") == 0)
- {
- current_demangling_style = arm_demangling;
- }
- else
- {
- fprintf (stderr, "%s: unknown demangling style `%s'\n",
- program_name, optarg);
- exit (1);
- }
- break;
- }
- }
-
- if (optind < argc)
- {
- for ( ; optind < argc; optind++)
- {
- demangle_it (argv[optind]);
- }
- }
- else
- {
- for (;;)
- {
- int i = 0;
- c = getchar ();
- /* Try to read a label. */
- while (c != EOF && (isalnum(c) || c == '_' || c == '$' || c == '.'))
- {
- if (i >= MBUF_SIZE-1)
- break;
- mbuffer[i++] = c;
- c = getchar ();
- }
- if (i > 0)
- {
- int skip_first = 0;
-
- if (mbuffer[0] == '.')
- ++skip_first;
- if (strip_underscore && mbuffer[skip_first] == '_')
- ++skip_first;
-
- if (skip_first > i)
- skip_first = i;
-
- mbuffer[i] = 0;
-
- 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);
- }
- }
-
- exit (0);
-}
-
-static void
-fatal (str)
- char *str;
-{
- fprintf (stderr, "%s: %s\n", program_name, str);
- exit (1);
-}
-
-char * malloc ();
-char * realloc ();
-
-char *
-xmalloc (size)
- unsigned size;
-{
- register char *value = (char *) malloc (size);
- if (value == 0)
- fatal ("virtual memory exhausted");
- return value;
-}
-
-char *
-xrealloc (ptr, size)
- char *ptr;
- unsigned size;
-{
- register char *value = (char *) realloc (ptr, size);
- if (value == 0)
- fatal ("virtual memory exhausted");
- return value;
-}
-#endif /* main */
diff --git a/gcc/cpp.texi b/gcc/cpp.texi
index fb730e2ef23..c81554b6a92 100644
--- a/gcc/cpp.texi
+++ b/gcc/cpp.texi
@@ -2,15 +2,12 @@
@setfilename cpp.info
@settitle The C Preprocessor
-@ignore
@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Cpp: (cpp). The C preprocessor.
-END-INFO-DIR-ENTRY
-@end format
+@dircategory Programming
+@direntry
+* Cpp: (cpp). The GNU C preprocessor.
+@end direntry
@end ifinfo
-@end ignore
@c @smallbook
@c @cropmarks
@@ -45,7 +42,7 @@ into another language, under the above conditions for modified versions.
@titlepage
@c @finalout
@title The C Preprocessor
-@subtitle Last revised March 1997
+@subtitle Last revised September 1998
@subtitle for GCC version 2
@author Richard M. Stallman
@page
@@ -54,8 +51,8 @@ This booklet is eventually intended to form the first chapter of a GNU
C Language manual.
@vskip 0pt plus 1filll
-Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free
-Software Foundation, Inc.
+Copyright @copyright{} 1987, 1989, 1991-1998
+Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -2597,6 +2594,46 @@ Traditionally, @samp{\} inside a macro argument suppresses the syntactic
significance of the following character.
@end itemize
+@cindex Fortran
+@cindex unterminated
+Use the @samp{-traditional} option when preprocessing Fortran code,
+so that singlequotes and doublequotes
+within Fortran comment lines
+(which are generally not recognized as such by the preprocessor)
+do not cause diagnostics
+about unterminated character or string constants.
+
+However, this option does not prevent diagnostics
+about unterminated comments
+when a C-style comment appears to start, but not end,
+within Fortran-style commentary.
+
+So, the following Fortran comment lines are accepted with
+@samp{-traditional}:
+
+@smallexample
+C This isn't an unterminated character constant
+C Neither is "20000000000, an octal constant
+C in some dialects of Fortran
+@end smallexample
+
+However, this type of comment line will likely produce a diagnostic,
+or at least unexpected output from the preprocessor,
+due to the unterminated comment:
+
+@smallexample
+C Some Fortran compilers accept /* as starting
+C an inline comment.
+@end smallexample
+
+@cindex g77
+Note that @code{g77} automatically supplies
+the @samp{-traditional} option
+when it invokes the preprocessor.
+However, a future version of @code{g77}
+might use a different, more-Fortran-aware preprocessor
+in place of @code{cpp}.
+
@item -trigraphs
@findex -trigraphs
Process ANSI standard trigraph sequences. These are three-character
@@ -2781,8 +2818,8 @@ Like @samp{-M} but the dependency information is written to @var{file}.
This is in addition to compiling the file as specified---@samp{-MD} does
not inhibit ordinary compilation the way @samp{-M} does.
-When invoking gcc, do not specify the @var{file} argument.
-Gcc will create file names made by replacing ".c" with ".d" at
+When invoking @code{gcc}, do not specify the @var{file} argument.
+@code{gcc} will create file names made by replacing ".c" with ".d" at
the end of the input file names.
In Mach, you can use the utility @code{md} to merge multiple dependency
diff --git a/gcc/cppalloc.c b/gcc/cppalloc.c
index a32d737820c..bd3a6051971 100644
--- a/gcc/cppalloc.c
+++ b/gcc/cppalloc.c
@@ -24,6 +24,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "gansidecl.h"
#include "cpplib.h"
static void
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 94bd3e0b8ac..308ef299a18 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -25,6 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef EMACS
#include "config.h"
#include "system.h"
+#include "gansidecl.h"
#else
#include <stdio.h>
#endif /* not EMACS */
@@ -79,7 +80,7 @@ cpp_print_containing_files (pfile)
void
cpp_file_line_for_message (pfile, filename, line, column)
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
char *filename;
int line, column;
{
@@ -92,11 +93,11 @@ cpp_file_line_for_message (pfile, filename, line, column)
/* IS_ERROR is 2 for "fatal" error, 1 for error, 0 for warning */
void
-cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
- int is_error;
- cpp_reader *pfile;
- char *msg;
- char *arg1, *arg2, *arg3;
+v_cpp_message (pfile, is_error, msg, ap)
+ cpp_reader * pfile;
+ int is_error;
+ const char *msg;
+ va_list ap;
{
if (!is_error)
fprintf (stderr, "warning: ");
@@ -104,10 +105,32 @@ cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
pfile->errors = CPP_FATAL_LIMIT;
else if (pfile->errors < CPP_FATAL_LIMIT)
pfile->errors++;
- fprintf (stderr, msg, arg1, arg2, arg3);
+ vfprintf (stderr, msg, ap);
fprintf (stderr, "\n");
}
+void
+cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msg, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ int is_error;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ is_error = va_arg (ap, int);
+ msg = va_arg (ap, const char *);
+#endif
+
+ v_cpp_message(pfile, is_error, msg, ap);
+ va_end(ap);
+}
+
/* Same as cpp_error, except we consider the error to be "fatal",
such as inconsistent options. I.e. there is little point in continuing.
(We do not exit, to support use of cpplib as a library.
@@ -115,18 +138,30 @@ cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
CPP_FATAL_ERRORS. */
void
-cpp_fatal (pfile, str, arg)
- cpp_reader *pfile;
- char *str, *arg;
-{
+cpp_fatal VPROTO ((cpp_reader *pfile, const char *str, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ const char *str;
+#endif
+ va_list ap;
+
+ VA_START (ap, str);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ str = va_arg (ap, const char *);
+#endif
+
fprintf (stderr, "%s: ", progname);
- cpp_message (pfile, 2, str, arg);
+ v_cpp_message (pfile, 2, str, ap);
+ va_end(ap);
}
void
cpp_pfatal_with_name (pfile, name)
cpp_reader *pfile;
- char *name;
+ const char *name;
{
cpp_perror_with_name (pfile, name);
#ifdef VMS
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index bf0b8a03d14..44f8a66547c 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -26,8 +26,8 @@ Written by Per Bothner 1994. */
#include "config.h"
#include "system.h"
-#include "cpplib.h"
#include "gansidecl.h"
+#include "cpplib.h"
extern char *xmalloc PARAMS ((unsigned));
extern char *xrealloc PARAMS ((void *, unsigned));
@@ -617,7 +617,7 @@ left_shift (pfile, a, unsignedp, b)
static long
right_shift (pfile, a, unsignedp, b)
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
long a;
int unsignedp;
unsigned long b;
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 8fd1cca7311..6aa9e9c7c12 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -24,9 +24,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "gansidecl.h"
#include "cpplib.h"
#include "cpphash.h"
-#include "gansidecl.h"
extern char *xmalloc PARAMS ((unsigned));
@@ -58,7 +58,7 @@ hashf (name, len, hashsize)
HASHNODE *
cpp_lookup (pfile, name, len, hash)
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
const U_CHAR *name;
int len;
int hash;
@@ -193,7 +193,7 @@ install (name, len, type, ivalue, value, hash)
void
cpp_hash_cleanup (pfile)
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
{
register int i;
for (i = HASHSIZE; --i >= 0; )
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index ed06c186aed..2b0668d3eb2 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -36,3 +36,5 @@ static HASHNODE *hashtab[HASHSIZE];
#define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
extern HASHNODE *install PARAMS ((U_CHAR *,int,enum node_type, int,char *,int));
+extern int hashf PARAMS ((const U_CHAR *, int, int));
+extern void delete_macro PARAMS ((HASHNODE *));
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 80865afb161..874a1759a50 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -35,15 +35,15 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# include <sys/resource.h>
#endif
+#include "gansidecl.h"
#include "cpplib.h"
#include "cpphash.h"
-#include "gansidecl.h"
-#ifndef GET_ENVIRONMENT
-#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
+#ifndef GET_ENV_PATH_LIST
+#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif
-extern char *update_path ();
+extern char *update_path PARAMS ((char *, char *));
#undef MIN
#undef MAX
@@ -196,52 +196,58 @@ struct cpp_pending {
/* Forward declarations. */
char *xmalloc ();
-void cpp_fatal ();
-void cpp_file_line_for_message PARAMS ((char *, int, int));
-void cpp_hash_cleanup PARAMS ((cpp_reader *));
-void cpp_message ();
-void cpp_print_containing_files PARAMS ((cpp_reader *));
-
-static void add_import ();
-static void append_include_chain ();
-static void make_assertion ();
-static void path_include ();
-static void initialize_builtins ();
-static void initialize_char_syntax ();
-extern void delete_macro ();
+extern void cpp_hash_cleanup PARAMS ((cpp_reader *));
+
+static char *my_strerror PROTO ((int));
+static void add_import PROTO ((cpp_reader *, int, char *));
+static void append_include_chain PROTO ((cpp_reader *,
+ struct file_name_list *,
+ struct file_name_list *));
+static void make_assertion PROTO ((cpp_reader *, char *, U_CHAR *));
+static void path_include PROTO ((cpp_reader *, char *));
+static void initialize_builtins PROTO ((cpp_reader *));
+static void initialize_char_syntax PROTO ((struct cpp_options *));
#if 0
static void trigraph_pcp ();
#endif
-static int finclude ();
-static void validate_else ();
-static int comp_def_part ();
+static int finclude PROTO ((cpp_reader *, int, char *,
+ int, struct file_name_list *));
+static void validate_else PROTO ((cpp_reader *, char *));
+static int comp_def_part PROTO ((int, U_CHAR *, int, U_CHAR *,
+ int, int));
#ifdef abort
extern void fancy_abort ();
#endif
-static int lookup_import ();
-static int redundant_include_p ();
-static int is_system_include ();
-static struct file_name_map *read_name_map ();
-static char *read_filename_string ();
-static int open_include_file ();
-static int check_macro_name ();
-static int compare_defs ();
-static int compare_token_lists ();
-static HOST_WIDE_INT eval_if_expression ();
-static int change_newlines ();
-extern int hashf ();
-static struct arglist *read_token_list ();
-static void free_token_list ();
-static int safe_read ();
+static int lookup_import PROTO ((cpp_reader *, char *,
+ struct file_name_list *));
+static int redundant_include_p PROTO ((cpp_reader *, char *));
+static int is_system_include PROTO ((cpp_reader *, char *));
+static struct file_name_map *read_name_map PROTO ((cpp_reader *, char *));
+static char *read_filename_string PROTO ((int, FILE *));
+static int open_include_file PROTO ((cpp_reader *, char *,
+ struct file_name_list *));
+static int check_macro_name PROTO ((cpp_reader *, U_CHAR *, char *));
+static int compare_defs PROTO ((cpp_reader *,
+ DEFINITION *, DEFINITION *));
+static int compare_token_lists PROTO ((struct arglist *,
+ struct arglist *));
+static HOST_WIDE_INT eval_if_expression PROTO ((cpp_reader *, U_CHAR *, int));
+static int change_newlines PROTO ((U_CHAR *, int));
+static struct arglist *read_token_list PROTO ((cpp_reader *, int *));
+static void free_token_list PROTO ((struct arglist *));
+static int safe_read PROTO ((int, char *, int));
static void push_macro_expansion PARAMS ((cpp_reader *,
U_CHAR *, int, HASHNODE *));
static struct cpp_pending *nreverse_pending PARAMS ((struct cpp_pending *));
extern char *xrealloc ();
-static char *xcalloc ();
-static char *savestring ();
+static char *xcalloc PROTO ((unsigned, unsigned));
+static char *savestring PROTO ((char *));
-static void conditional_skip ();
-static void skip_if_group ();
+static void conditional_skip PROTO ((cpp_reader *, int,
+ enum node_type, U_CHAR *));
+static void skip_if_group PROTO ((cpp_reader *, int));
+static int parse_name PARAMS ((cpp_reader *, int));
+static void print_help PROTO ((void));
/* Last arg to output_line_command. */
enum file_change_code {same_file, enter_file, leave_file};
@@ -250,33 +256,8 @@ enum file_change_code {same_file, enter_file, leave_file};
extern HOST_WIDE_INT cpp_parse_expr PARAMS ((cpp_reader *));
-extern FILE *fdopen ();
extern char *version_string;
extern struct tm *localtime ();
-
-/* These functions are declared to return int instead of void since they
- are going to be placed in a table and some old compilers have trouble with
- pointers to functions returning void. */
-
-static int do_define ();
-static int do_line ();
-static int do_include ();
-static int do_undef ();
-static int do_error ();
-static int do_pragma ();
-static int do_ident ();
-static int do_if ();
-static int do_xifdef ();
-static int do_else ();
-static int do_elif ();
-static int do_endif ();
-#ifdef SCCS_DIRECTIVE
-static int do_sccs ();
-#endif
-static int do_once ();
-static int do_assert ();
-static int do_unassert ();
-static int do_warning ();
struct file_name_list
{
@@ -316,7 +297,6 @@ static struct default_include {
= {
/* Pick up GNU C++ specific include files. */
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },
- { OLD_GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 },
#ifdef CROSS_COMPILE
/* This is the dir for fixincludes. Put it just before
the files that we fix. */
@@ -359,12 +339,37 @@ static struct default_include {
struct directive {
int length; /* Length of name */
- int (*func)(); /* Function to handle directive */
+ int (*func) /* Function to handle directive */
+ PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
char *name; /* Name of directive */
enum node_type type; /* Code which describes which directive. */
char command_reads_line; /* One if rest of line is read by func. */
};
+/* These functions are declared to return int instead of void since they
+ are going to be placed in a table and some old compilers have trouble with
+ pointers to functions returning void. */
+
+static int do_define PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_line PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_include PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_undef PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_error PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_pragma PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_ident PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_if PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_xifdef PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_else PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_elif PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_endif PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+#ifdef SCCS_DIRECTIVE
+static int do_sccs PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+#endif
+static int do_once PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_assert PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_unassert PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+static int do_warning PARAMS ((cpp_reader *, struct directive *, U_CHAR *, U_CHAR *));
+
#define IS_INCLUDE_DIRECTIVE_TYPE(t) \
((int) T_INCLUDE <= (int) (t) && (int) (t) <= (int) T_IMPORT)
@@ -523,6 +528,12 @@ cpp_define (pfile, str)
}
while (is_idchar[*++p])
;
+ if (*p == '(') {
+ while (is_idchar[*++p] || *p == ',' || is_hor_space[*p])
+ ;
+ if (*p++ != ')')
+ p = (U_CHAR *) str; /* Error */
+ }
if (*p == 0)
{
buf = (U_CHAR *) alloca (p - buf + 4);
@@ -752,7 +763,7 @@ cpp_options_init (opts)
opts->no_output = 0;
opts->remap = 0;
opts->cplusplus = 0;
- opts->cplusplus_comments = 0;
+ opts->cplusplus_comments = 1;
opts->verbose = 0;
opts->objc = 0;
@@ -768,15 +779,15 @@ cpp_options_init (opts)
enum cpp_token
null_underflow (pfile)
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
{
return CPP_EOF;
}
int
null_cleanup (pbuf, pfile)
- cpp_buffer *pbuf;
- cpp_reader *pfile;
+ cpp_buffer *pbuf ATTRIBUTE_UNUSED;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -784,7 +795,7 @@ null_cleanup (pbuf, pfile)
int
macro_cleanup (pbuf, pfile)
cpp_buffer *pbuf;
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
{
HASHNODE *macro = (HASHNODE *) pbuf->data;
if (macro->type == T_DISABLED)
@@ -797,7 +808,7 @@ macro_cleanup (pbuf, pfile)
int
file_cleanup (pbuf, pfile)
cpp_buffer *pbuf;
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
{
if (pbuf->buf)
{
@@ -992,7 +1003,7 @@ handle_directive (pfile)
/* Handle # followed by a line number. */
if (CPP_PEDANTIC (pfile))
cpp_pedwarn (pfile, "`#' followed by integer");
- do_line (pfile, NULL);
+ do_line (pfile, NULL, NULL, NULL);
goto done_a_directive;
}
@@ -2863,11 +2874,6 @@ macroexpand (pfile, hp)
while (p1 != l1 && is_space[*p1]) p1++;
while (p1 != l1 && is_idchar[*p1])
xbuf[totlen++] = *p1++;
- /* Delete any no-reexpansion marker that follows
- an identifier at the beginning of the argument
- if the argument is concatenated with what precedes it. */
- if (p1[0] == '@' && p1[1] == '-')
- p1 += 2;
}
if (ap->raw_after)
{
@@ -2876,21 +2882,38 @@ macroexpand (pfile, hp)
while (p1 != l1)
{
if (is_space[l1[-1]]) l1--;
+ else if (l1[-1] == '@')
+ {
+ U_CHAR *p2 = l1 - 1;
+ /* If whitespace is preceded by an odd number
+ of `@' signs, the last `@' was a whitespace
+ marker; drop it too. */
+ while (p2 != p1 && p2[0] == '@') p2--;
+ if ((l1 - p2) & 1)
+ l1--;
+ break;
+ }
else if (l1[-1] == '-')
{
U_CHAR *p2 = l1 - 1;
- /* If a `-' is preceded by an odd number of newlines then it
- and the last newline are a no-reexpansion marker. */
- while (p2 != p1 && p2[-1] == '\n') p2--;
- if ((l1 - 1 - p2) & 1) {
+ /* If a `-' is preceded by an odd number of
+ `@' signs then it and the last `@' are
+ a no-reexpansion marker. */
+ while (p2 != p1 && p2[0] == '@') p2--;
+ if ((l1 - p2) & 1)
l1 -= 2;
- }
- else break;
+ else
+ break;
}
else break;
}
}
+ /* Delete any no-reexpansion marker that precedes
+ an identifier at the beginning of the argument. */
+ if (p1[0] == '@' && p1[1] == '-')
+ p1 += 2;
+
bcopy (p1, xbuf + totlen, l1 - p1);
totlen += l1 - p1;
}
@@ -3049,7 +3072,7 @@ static int
do_include (pfile, keyword, unused1, unused2)
cpp_reader *pfile;
struct directive *keyword;
- U_CHAR *unused1, *unused2;
+ U_CHAR *unused1 ATTRIBUTE_UNUSED, *unused2 ATTRIBUTE_UNUSED;
{
int importing = (keyword->type == T_IMPORT);
int skip_dirs = (keyword->type == T_INCLUDE_NEXT);
@@ -3670,9 +3693,10 @@ convert_string (pfile, result, in, limit, handle_escapes)
#define FNAME_HASHSIZE 37
static int
-do_line (pfile, keyword)
+do_line (pfile, keyword, unused1, unused2)
cpp_reader *pfile;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *unused1 ATTRIBUTE_UNUSED, *unused2 ATTRIBUTE_UNUSED;
{
cpp_buffer *ip = CPP_BUFFER (pfile);
int new_lineno;
@@ -3742,18 +3766,18 @@ do_line (pfile, keyword)
}
if (*p == '1')
file_change = enter_file;
- else if (*p == 2)
+ else if (*p == '2')
file_change = leave_file;
- else if (*p == 3)
+ else if (*p == '3')
ip->system_header_p = 1;
- else /* if (*p == 4) */
+ else /* if (*p == '4') */
ip->system_header_p = 2;
CPP_SET_WRITTEN (pfile, num_start);
token = get_directive_token (pfile);
p = pfile->token_buffer + num_start;
if (token == CPP_NUMBER && p[1] == '\0' && (*p == '3' || *p== '4')) {
- ip->system_header_p = *p == 3 ? 1 : 2;
+ ip->system_header_p = *p == '3' ? 1 : 2;
token = get_directive_token (pfile);
}
if (token != CPP_VSPACE) {
@@ -3847,7 +3871,7 @@ do_undef (pfile, keyword, buf, limit)
static int
do_error (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
U_CHAR *buf, *limit;
{
int length = limit - buf;
@@ -3868,7 +3892,7 @@ do_error (pfile, keyword, buf, limit)
static int
do_warning (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
U_CHAR *buf, *limit;
{
int length = limit - buf;
@@ -3878,7 +3902,7 @@ do_warning (pfile, keyword, buf, limit)
SKIP_WHITE_SPACE (copy);
if (CPP_PEDANTIC (pfile) && !CPP_BUFFER (pfile)->system_header_p)
- cpp_pedwarn ("ANSI C does not allow `#warning'");
+ cpp_pedwarn (pfile, "ANSI C does not allow `#warning'");
/* Use `pedwarn' not `warning', because #warning isn't in the C Standard;
if -pedantic-errors is given, #warning should cause an error. */
@@ -3890,8 +3914,10 @@ do_warning (pfile, keyword, buf, limit)
avoid ever including it again. */
static int
-do_once (pfile)
+do_once (pfile, keyword, unused1, unused2)
cpp_reader *pfile;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *unused1 ATTRIBUTE_UNUSED, *unused2 ATTRIBUTE_UNUSED;
{
cpp_buffer *ip = NULL;
struct file_name_list *new;
@@ -3921,8 +3947,8 @@ do_once (pfile)
static int
do_ident (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
{
/* long old_written = CPP_WRITTEN (pfile);*/
@@ -3941,8 +3967,8 @@ do_ident (pfile, keyword, buf, limit)
static int
do_pragma (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf, *limit ATTRIBUTE_UNUSED;
{
while (*buf == ' ' || *buf == '\t')
buf++;
@@ -3951,7 +3977,7 @@ do_pragma (pfile, keyword, buf, limit)
fault. */
if (!CPP_BUFFER (pfile)->system_header_p)
cpp_warning (pfile, "`#pragma once' is obsolete");
- do_once (pfile);
+ do_once (pfile, NULL, NULL, NULL);
}
if (!strncmp (buf, "implementation", 14)) {
@@ -4014,8 +4040,8 @@ nope:
static int
do_sccs (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
{
if (CPP_PEDANTIC (pfile))
cpp_pedwarn (pfile, "ANSI C does not allow `#sccs'");
@@ -4039,7 +4065,7 @@ do_sccs (pfile, keyword, buf, limit)
static int
do_if (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
U_CHAR *buf, *limit;
{
HOST_WIDE_INT value = eval_if_expression (pfile, buf, limit - buf);
@@ -4055,7 +4081,7 @@ do_if (pfile, keyword, buf, limit)
static int
do_elif (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
+ struct directive *keyword ATTRIBUTE_UNUSED;
U_CHAR *buf, *limit;
{
if (pfile->if_stack == CPP_BUFFER (pfile)->if_stack) {
@@ -4098,8 +4124,8 @@ do_elif (pfile, keyword, buf, limit)
static HOST_WIDE_INT
eval_if_expression (pfile, buf, length)
cpp_reader *pfile;
- U_CHAR *buf;
- int length;
+ U_CHAR *buf ATTRIBUTE_UNUSED;
+ int length ATTRIBUTE_UNUSED;
{
HASHNODE *save_defined;
HOST_WIDE_INT value;
@@ -4127,7 +4153,7 @@ static int
do_xifdef (pfile, keyword, unused1, unused2)
cpp_reader *pfile;
struct directive *keyword;
- U_CHAR *unused1, *unused2;
+ U_CHAR *unused1 ATTRIBUTE_UNUSED, *unused2 ATTRIBUTE_UNUSED;
{
int skip;
cpp_buffer *ip = CPP_BUFFER (pfile);
@@ -4407,8 +4433,8 @@ skip_if_group (pfile, any)
static int
do_else (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
{
cpp_buffer *ip = CPP_BUFFER (pfile);
@@ -4450,8 +4476,8 @@ do_else (pfile, keyword, buf, limit)
static int
do_endif (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
{
if (CPP_PEDANTIC (pfile))
validate_else (pfile, "#endif");
@@ -5200,7 +5226,7 @@ cpp_get_non_space_token (pfile)
/* Parse an identifier starting with C. */
-int
+static int
parse_name (pfile, c)
cpp_reader *pfile; int c;
{
@@ -5218,7 +5244,7 @@ parse_name (pfile, c)
}
if (c == '$' && CPP_PEDANTIC (pfile))
- cpp_pedwarn ("`$' in identifier");
+ cpp_pedwarn (pfile, "`$' in identifier");
CPP_RESERVE(pfile, 2); /* One more for final NUL. */
CPP_PUTC_Q (pfile, c);
@@ -5696,7 +5722,7 @@ cpp_start_read (pfile, fname)
/* Some people say that CPATH should replace the standard include dirs,
but that seems pointless: it comes before them, so it overrides them
anyway. */
- GET_ENVIRONMENT (p, "CPATH");
+ GET_ENV_PATH_LIST (p, "CPATH");
if (p != 0 && ! opts->no_standard_includes)
path_include (pfile, p);
@@ -5826,16 +5852,16 @@ cpp_start_read (pfile, fname)
switch ((opts->objc << 1) + opts->cplusplus)
{
case 0:
- GET_ENVIRONMENT (epath, "C_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "C_INCLUDE_PATH");
break;
case 1:
- GET_ENVIRONMENT (epath, "CPLUS_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "CPLUS_INCLUDE_PATH");
break;
case 2:
- GET_ENVIRONMENT (epath, "OBJC_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "OBJC_INCLUDE_PATH");
break;
case 3:
- GET_ENVIRONMENT (epath, "OBJCPLUS_INCLUDE_PATH");
+ GET_ENV_PATH_LIST (epath, "OBJCPLUS_INCLUDE_PATH");
break;
}
/* If the environment var for this language is set,
@@ -5958,29 +5984,6 @@ cpp_start_read (pfile, fname)
fprintf (stderr, "End of search list.\n");
}
- /* Scan the -imacros files before the main input.
- Much like #including them, but with no_output set
- so that only their macro definitions matter. */
-
- opts->no_output++; pfile->no_record_file++;
- for (pend = opts->pending; pend; pend = pend->next)
- {
- if (pend->cmd != NULL && strcmp (pend->cmd, "-imacros") == 0)
- {
- int fd = open (pend->arg, O_RDONLY, 0666);
- if (fd < 0)
- {
- cpp_perror_with_name (pfile, pend->arg);
- return 0;
- }
- if (!cpp_push_buffer (pfile, NULL, 0))
- return 0;
- finclude (pfile, fd, pend->arg, 0, NULL_PTR);
- cpp_scan_buffer (pfile);
- }
- }
- opts->no_output--; pfile->no_record_file--;
-
/* Copy the entire contents of the main input file into
the stacked input buffer previously allocated for it. */
if (fname == NULL || *fname == 0) {
@@ -6125,24 +6128,48 @@ cpp_start_read (pfile, fname)
trigraph_pcp (fp);
#endif
- /* Scan the -include files before the main input.
- We push these in reverse order, so that the first one is handled first. */
+ /* Avoid a #line 0 if -include files are present. */
+ CPP_BUFFER (pfile)->lineno = 1;
+ output_line_command (pfile, 0, same_file);
+
+ /* Scan the -include and -imacros files before the main input. */
pfile->no_record_file++;
- opts->pending = nreverse_pending (opts->pending);
for (pend = opts->pending; pend; pend = pend->next)
{
- if (pend->cmd != NULL && strcmp (pend->cmd, "-include") == 0)
- {
- int fd = open (pend->arg, O_RDONLY, 0666);
- if (fd < 0)
+ if (pend->cmd != NULL)
+ {
+ if (strcmp (pend->cmd, "-include") == 0)
{
- cpp_perror_with_name (pfile, pend->arg);
- return 0;
+ int fd = open (pend->arg, O_RDONLY, 0666);
+ if (fd < 0)
+ {
+ cpp_perror_with_name (pfile, pend->arg);
+ return 0;
+ }
+ if (!cpp_push_buffer (pfile, NULL, 0))
+ return 0;
+ if (finclude (pfile, fd, pend->arg, 0, NULL_PTR))
+ {
+ output_line_command (pfile, 0, enter_file);
+ cpp_scan_buffer (pfile);
+ }
+ }
+ else if (strcmp (pend->cmd, "-imacros") == 0)
+ {
+ int fd = open (pend->arg, O_RDONLY, 0666);
+ if (fd < 0)
+ {
+ cpp_perror_with_name (pfile, pend->arg);
+ return 0;
+ }
+ opts->no_output++;
+ if (!cpp_push_buffer (pfile, NULL, 0))
+ return 0;
+ if (finclude (pfile, fd, pend->arg, 0, NULL_PTR))
+ cpp_scan_buffer (pfile);
+ opts->no_output--;
}
- if (!cpp_push_buffer (pfile, NULL, 0))
- return 0;
- finclude (pfile, fd, pend->arg, 0, NULL_PTR);
}
}
pfile->no_record_file--;
@@ -6168,8 +6195,7 @@ cpp_start_read (pfile, fname)
pedwarn ("file does not end in newline");
#endif
- if (finclude (pfile, f, fname, 0, NULL_PTR))
- output_line_command (pfile, 0, same_file);
+ finclude (pfile, f, fname, 0, NULL_PTR);
return 1;
}
@@ -6222,507 +6248,602 @@ push_pending (pfile, cmd, arg)
CPP_OPTIONS (pfile)->pending = pend;
}
-/* Handle command-line options in (argc, argv).
- Can be called multiple times, to handle multiple sets of options.
- Returns if an unrecognized option is seen.
- Returns number of handled arguments. */
+
+static void
+print_help ()
+{
+ printf ("Usage: %s [switches] input output\n", progname);
+ printf ("Switches:\n");
+ printf (" -include <file> Include the contents of <file> before other files\n");
+ printf (" -imacros <file> Accept definition of marcos in <file>\n");
+ printf (" -iprefix <path> Specify <path> as a prefix for next two options\n");
+ printf (" -iwithprefix <dir> Add <dir> to the end of the system include paths\n");
+ printf (" -iwithprefixbefore <dir> Add <dir> to the end of the main include paths\n");
+ printf (" -isystem <dir> Add <dir> to the start of the system include paths\n");
+ printf (" -idirafter <dir> Add <dir> to the end of the system include paths\n");
+ printf (" -I <dir> Add <dir> to the end of the main include paths\n");
+ printf (" -nostdinc Do not search the system include directories\n");
+ printf (" -nostdinc++ Do not search the system include directories for C++\n");
+ printf (" -o <file> Put output into <file>\n");
+ printf (" -pedantic Issue all warnings demanded by strict ANSI C\n");
+ printf (" -traditional Follow K&R pre-processor behaviour\n");
+ printf (" -trigraphs Support ANSI C trigraphs\n");
+ printf (" -lang-c Assume that the input sources are in C\n");
+ printf (" -lang-c89 Assume that the input sources are in C89\n");
+ printf (" -lang-c++ Assume that the input sources are in C++\n");
+ printf (" -lang-objc Assume that the input sources are in ObjectiveC\n");
+ printf (" -lang-objc++ Assume that the input sources are in ObjectiveC++\n");
+ printf (" -lang-asm Assume that the input sources are in assembler\n");
+ printf (" -lang-chill Assume that the input sources are in Chill\n");
+ printf (" -+ Allow parsing of C++ style features\n");
+ printf (" -w Inhibit warning messages\n");
+ printf (" -Wtrigraphs Warn if trigraphs are encountered\n");
+ printf (" -Wno-trigraphs Do not warn about trigraphs\n");
+ printf (" -Wcomment{s} Warn if one comment starts inside another\n");
+ printf (" -Wno-comment{s} Do not warn about comments\n");
+ printf (" -Wtraditional Warn if a macro argument is/would be turned into\n");
+ printf (" a string if -tradtional is specified\n");
+ printf (" -Wno-traditional Do not warn about stringification\n");
+ printf (" -Wundef Warn if an undefined macro is used by #if\n");
+ printf (" -Wno-undef Do not warn about testing udefined macros\n");
+ printf (" -Wimport Warn about the use of the #import directive\n");
+ printf (" -Wno-import Do not warn about the use of #import\n");
+ printf (" -Werror Treat all warnings as errors\n");
+ printf (" -Wno-error Do not treat warnings as errors\n");
+ printf (" -Wall Enable all preprocessor warnings\n");
+ printf (" -M Generate make dependencies\n");
+ printf (" -MM As -M, but ignore system header files\n");
+ printf (" -MD As -M, but put output in a .d file\n");
+ printf (" -MMD As -MD, but ignore system header files\n");
+ printf (" -MG Treat missing header file as generated files\n");
+ printf (" -g Include #define and #undef directives in the output\n");
+ printf (" -D<macro> Define a <macro> with string '1' as its value\n");
+ printf (" -D<macro>=<val> Define a <macro> with <val> as its value\n");
+ printf (" -A<question> (<answer>) Assert the <answer> to <question>\n");
+ printf (" -U<macro> Undefine <macro> \n");
+ printf (" -u or -undef Do not predefine any macros\n");
+ printf (" -v Display the version number\n");
+ printf (" -H Print the name of header files as they are used\n");
+ printf (" -C Do not discard comments\n");
+ printf (" -dM Display a list of macro definitions active at end\n");
+ printf (" -dD Preserve macro definitions in output\n");
+ printf (" -dN As -dD except that only the names are preserved\n");
+ printf (" -dI Include #include directives in the output\n");
+ printf (" -ifoutput Describe skipped code blocks in output \n");
+ printf (" -P Do not generate #line directives\n");
+ printf (" -$ Do not include '$' in identifiers\n");
+ printf (" -remap Remap file names when including files.\n");
+ printf (" -h or --help Display this information\n");
+}
+
+/* Handle one command-line option in (argc, argv).
+ Can be called multiple times, to handle multiple sets of options.
+ Returns number of strings consumed. */
int
-cpp_handle_options (pfile, argc, argv)
+cpp_handle_option (pfile, argc, argv)
cpp_reader *pfile;
int argc;
char **argv;
{
- int i;
struct cpp_options *opts = CPP_OPTIONS (pfile);
- for (i = 0; i < argc; i++) {
- if (argv[i][0] != '-') {
- if (opts->out_fname != NULL)
- {
- cpp_fatal (pfile, "Usage: %s [switches] input output", argv[0]);
- return argc;
- }
- else if (opts->in_fname != NULL)
- opts->out_fname = argv[i];
- else
- opts->in_fname = argv[i];
- } else {
- switch (argv[i][1]) {
-
- missing_filename:
- cpp_fatal (pfile, "Filename missing after `%s' option", argv[i]);
- return argc;
- missing_dirname:
- cpp_fatal (pfile, "Directory name missing after `%s' option", argv[i]);
- return argc;
-
- case 'i':
- if (!strcmp (argv[i], "-include")
- || !strcmp (argv[i], "-imacros")) {
- if (i + 1 == argc)
- goto missing_filename;
- else
- push_pending (pfile, argv[i], argv[i+1]), i++;
- }
- if (!strcmp (argv[i], "-iprefix")) {
- if (i + 1 == argc)
- goto missing_filename;
- else
- opts->include_prefix = argv[++i];
- }
- if (!strcmp (argv[i], "-ifoutput")) {
- opts->output_conditionals = 1;
- }
- if (!strcmp (argv[i], "-isystem")) {
- struct file_name_list *dirtmp;
-
- if (i + 1 == argc)
- goto missing_filename;
-
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
- dirtmp->next = 0;
- dirtmp->control_macro = 0;
- dirtmp->c_system_include_path = 1;
- dirtmp->fname = (char *) xmalloc (strlen (argv[i+1]) + 1);
- strcpy (dirtmp->fname, argv[++i]);
- dirtmp->got_name_map = 0;
-
- if (opts->before_system == 0)
- opts->before_system = dirtmp;
- else
- opts->last_before_system->next = dirtmp;
- opts->last_before_system = dirtmp; /* Tail follows the last one */
- }
- /* Add directory to end of path for includes,
- with the default prefix at the front of its name. */
- if (!strcmp (argv[i], "-iwithprefix")) {
- struct file_name_list *dirtmp;
- char *prefix;
-
- if (opts->include_prefix != 0)
- prefix = opts->include_prefix;
- else {
- prefix = savestring (GCC_INCLUDE_DIR);
- /* Remove the `include' from /usr/local/lib/gcc.../include. */
- if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
- prefix[strlen (prefix) - 7] = 0;
- }
-
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
- dirtmp->next = 0; /* New one goes on the end */
- dirtmp->control_macro = 0;
- dirtmp->c_system_include_path = 0;
- if (i + 1 == argc)
- goto missing_dirname;
-
- dirtmp->fname = (char *) xmalloc (strlen (argv[i+1])
- + strlen (prefix) + 1);
- strcpy (dirtmp->fname, prefix);
- strcat (dirtmp->fname, argv[++i]);
- dirtmp->got_name_map = 0;
-
- if (opts->after_include == 0)
- opts->after_include = dirtmp;
- else
- opts->last_after_include->next = dirtmp;
- opts->last_after_include = dirtmp; /* Tail follows the last one */
- }
- /* Add directory to main path for includes,
- with the default prefix at the front of its name. */
- if (!strcmp (argv[i], "-iwithprefixbefore")) {
- struct file_name_list *dirtmp;
- char *prefix;
-
- if (opts->include_prefix != 0)
- prefix = opts->include_prefix;
- else {
- prefix = savestring (GCC_INCLUDE_DIR);
- /* Remove the `include' from /usr/local/lib/gcc.../include. */
- if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
- prefix[strlen (prefix) - 7] = 0;
- }
-
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
- dirtmp->next = 0; /* New one goes on the end */
- dirtmp->control_macro = 0;
- dirtmp->c_system_include_path = 0;
- if (i + 1 == argc)
- goto missing_dirname;
-
- dirtmp->fname = (char *) xmalloc (strlen (argv[i+1])
- + strlen (prefix) + 1);
- strcpy (dirtmp->fname, prefix);
- strcat (dirtmp->fname, argv[++i]);
- dirtmp->got_name_map = 0;
-
- append_include_chain (pfile, dirtmp, dirtmp);
+ int i = 0;
+ if (argv[i][0] != '-') {
+ if (opts->out_fname != NULL)
+ {
+ print_help ();
+ cpp_fatal (pfile, "Too many arguments");
+ }
+ else if (opts->in_fname != NULL)
+ opts->out_fname = argv[i];
+ else
+ opts->in_fname = argv[i];
+ } else {
+ switch (argv[i][1]) {
+
+ missing_filename:
+ cpp_fatal (pfile, "Filename missing after `%s' option", argv[i]);
+ return argc;
+ missing_dirname:
+ cpp_fatal (pfile, "Directory name missing after `%s' option", argv[i]);
+ return argc;
+
+ case 'i':
+ if (!strcmp (argv[i], "-include")
+ || !strcmp (argv[i], "-imacros")) {
+ if (i + 1 == argc)
+ goto missing_filename;
+ else
+ push_pending (pfile, argv[i], argv[i+1]), i++;
+ }
+ if (!strcmp (argv[i], "-iprefix")) {
+ if (i + 1 == argc)
+ goto missing_filename;
+ else
+ opts->include_prefix = argv[++i];
+ }
+ if (!strcmp (argv[i], "-ifoutput")) {
+ opts->output_conditionals = 1;
+ }
+ if (!strcmp (argv[i], "-isystem")) {
+ struct file_name_list *dirtmp;
+
+ if (i + 1 == argc)
+ goto missing_filename;
+
+ dirtmp = (struct file_name_list *)
+ xmalloc (sizeof (struct file_name_list));
+ dirtmp->next = 0;
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 1;
+ dirtmp->fname = (char *) xmalloc (strlen (argv[i+1]) + 1);
+ strcpy (dirtmp->fname, argv[++i]);
+ dirtmp->got_name_map = 0;
+
+ if (opts->before_system == 0)
+ opts->before_system = dirtmp;
+ else
+ opts->last_before_system->next = dirtmp;
+ opts->last_before_system = dirtmp; /* Tail follows the last one */
+ }
+ /* Add directory to end of path for includes,
+ with the default prefix at the front of its name. */
+ if (!strcmp (argv[i], "-iwithprefix")) {
+ struct file_name_list *dirtmp;
+ char *prefix;
+
+ if (opts->include_prefix != 0)
+ prefix = opts->include_prefix;
+ else {
+ prefix = savestring (GCC_INCLUDE_DIR);
+ /* Remove the `include' from /usr/local/lib/gcc.../include. */
+ if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
+ prefix[strlen (prefix) - 7] = 0;
}
- /* Add directory to end of path for includes. */
- if (!strcmp (argv[i], "-idirafter")) {
- struct file_name_list *dirtmp;
-
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
- dirtmp->next = 0; /* New one goes on the end */
- dirtmp->control_macro = 0;
- dirtmp->c_system_include_path = 0;
- if (i + 1 == argc)
- goto missing_dirname;
- else
- dirtmp->fname = argv[++i];
- dirtmp->got_name_map = 0;
-
- if (opts->after_include == 0)
- opts->after_include = dirtmp;
- else
- opts->last_after_include->next = dirtmp;
- opts->last_after_include = dirtmp; /* Tail follows the last one */
+
+ dirtmp = (struct file_name_list *)
+ xmalloc (sizeof (struct file_name_list));
+ dirtmp->next = 0; /* New one goes on the end */
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
+ if (i + 1 == argc)
+ goto missing_dirname;
+
+ dirtmp->fname = (char *) xmalloc (strlen (argv[i+1])
+ + strlen (prefix) + 1);
+ strcpy (dirtmp->fname, prefix);
+ strcat (dirtmp->fname, argv[++i]);
+ dirtmp->got_name_map = 0;
+
+ if (opts->after_include == 0)
+ opts->after_include = dirtmp;
+ else
+ opts->last_after_include->next = dirtmp;
+ opts->last_after_include = dirtmp; /* Tail follows the last one */
+ }
+ /* Add directory to main path for includes,
+ with the default prefix at the front of its name. */
+ if (!strcmp (argv[i], "-iwithprefixbefore")) {
+ struct file_name_list *dirtmp;
+ char *prefix;
+
+ if (opts->include_prefix != 0)
+ prefix = opts->include_prefix;
+ else {
+ prefix = savestring (GCC_INCLUDE_DIR);
+ /* Remove the `include' from /usr/local/lib/gcc.../include. */
+ if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
+ prefix[strlen (prefix) - 7] = 0;
}
- break;
-
- case 'o':
- if (opts->out_fname != NULL)
- {
- cpp_fatal (pfile, "Output filename specified twice");
- return argc;
- }
+
+ dirtmp = (struct file_name_list *)
+ xmalloc (sizeof (struct file_name_list));
+ dirtmp->next = 0; /* New one goes on the end */
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
if (i + 1 == argc)
- goto missing_filename;
- opts->out_fname = argv[++i];
- if (!strcmp (opts->out_fname, "-"))
- opts->out_fname = "";
- break;
-
- case 'p':
- if (!strcmp (argv[i], "-pedantic"))
- CPP_PEDANTIC (pfile) = 1;
- else if (!strcmp (argv[i], "-pedantic-errors")) {
- CPP_PEDANTIC (pfile) = 1;
- opts->pedantic_errors = 1;
+ goto missing_dirname;
+
+ dirtmp->fname = (char *) xmalloc (strlen (argv[i+1])
+ + strlen (prefix) + 1);
+ strcpy (dirtmp->fname, prefix);
+ strcat (dirtmp->fname, argv[++i]);
+ dirtmp->got_name_map = 0;
+
+ append_include_chain (pfile, dirtmp, dirtmp);
+ }
+ /* Add directory to end of path for includes. */
+ if (!strcmp (argv[i], "-idirafter")) {
+ struct file_name_list *dirtmp;
+
+ dirtmp = (struct file_name_list *)
+ xmalloc (sizeof (struct file_name_list));
+ dirtmp->next = 0; /* New one goes on the end */
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
+ if (i + 1 == argc)
+ goto missing_dirname;
+ else
+ dirtmp->fname = argv[++i];
+ dirtmp->got_name_map = 0;
+
+ if (opts->after_include == 0)
+ opts->after_include = dirtmp;
+ else
+ opts->last_after_include->next = dirtmp;
+ opts->last_after_include = dirtmp; /* Tail follows the last one */
+ }
+ break;
+
+ case 'o':
+ if (opts->out_fname != NULL)
+ {
+ cpp_fatal (pfile, "Output filename specified twice");
+ return argc;
}
+ if (i + 1 == argc)
+ goto missing_filename;
+ opts->out_fname = argv[++i];
+ if (!strcmp (opts->out_fname, "-"))
+ opts->out_fname = "";
+ break;
+
+ case 'p':
+ if (!strcmp (argv[i], "-pedantic"))
+ CPP_PEDANTIC (pfile) = 1;
+ else if (!strcmp (argv[i], "-pedantic-errors")) {
+ CPP_PEDANTIC (pfile) = 1;
+ opts->pedantic_errors = 1;
+ }
#if 0
- else if (!strcmp (argv[i], "-pcp")) {
- char *pcp_fname = argv[++i];
- pcp_outfile = ((pcp_fname[0] != '-' || pcp_fname[1] != '\0')
- ? fopen (pcp_fname, "w")
- : fdopen (dup (fileno (stdout)), "w"));
- if (pcp_outfile == 0)
- cpp_pfatal_with_name (pfile, pcp_fname);
- no_precomp = 1;
- }
+ else if (!strcmp (argv[i], "-pcp")) {
+ char *pcp_fname = argv[++i];
+ pcp_outfile = ((pcp_fname[0] != '-' || pcp_fname[1] != '\0')
+ ? fopen (pcp_fname, "w")
+ : fdopen (dup (fileno (stdout)), "w"));
+ if (pcp_outfile == 0)
+ cpp_pfatal_with_name (pfile, pcp_fname);
+ no_precomp = 1;
+ }
#endif
- break;
-
- case 't':
- if (!strcmp (argv[i], "-traditional")) {
- opts->traditional = 1;
- } else if (!strcmp (argv[i], "-trigraphs")) {
- if (!opts->chill)
- opts->no_trigraphs = 0;
- }
- break;
-
- case 'l':
- if (! strcmp (argv[i], "-lang-c"))
- opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
+ break;
+
+ case 't':
+ if (!strcmp (argv[i], "-traditional")) {
+ opts->traditional = 1;
+ opts->cplusplus_comments = 0;
+ } else if (!strcmp (argv[i], "-trigraphs")) {
+ if (!opts->chill)
+ opts->no_trigraphs = 0;
+ }
+ break;
+
+ case 'l':
+ if (! strcmp (argv[i], "-lang-c"))
+ opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
opts->objc = 0;
- if (! strcmp (argv[i], "-lang-c89"))
- opts->cplusplus = 0, opts->cplusplus_comments = 0, opts->c89 = 1,
+ if (! strcmp (argv[i], "-lang-c89"))
+ opts->cplusplus = 0, opts->cplusplus_comments = 0, opts->c89 = 1,
opts->objc = 0;
- if (! strcmp (argv[i], "-lang-c++"))
- opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
+ if (! strcmp (argv[i], "-lang-c++"))
+ opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
opts->objc = 0;
- if (! strcmp (argv[i], "-lang-objc"))
- opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
+ if (! strcmp (argv[i], "-lang-objc"))
+ opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
opts->objc = 1;
- if (! strcmp (argv[i], "-lang-objc++"))
- opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
+ if (! strcmp (argv[i], "-lang-objc++"))
+ opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
opts->objc = 1;
- if (! strcmp (argv[i], "-lang-asm"))
- opts->lang_asm = 1;
- if (! strcmp (argv[i], "-lint"))
- opts->for_lint = 1;
- if (! strcmp (argv[i], "-lang-chill"))
- opts->objc = 0, opts->cplusplus = 0, opts->chill = 1,
+ if (! strcmp (argv[i], "-lang-asm"))
+ opts->lang_asm = 1;
+ if (! strcmp (argv[i], "-lint"))
+ opts->for_lint = 1;
+ if (! strcmp (argv[i], "-lang-chill"))
+ opts->objc = 0, opts->cplusplus = 0, opts->chill = 1,
opts->traditional = 1, opts->no_trigraphs = 1;
- break;
-
- case '+':
- opts->cplusplus = 1, opts->cplusplus_comments = 1;
- break;
-
- case 'w':
- opts->inhibit_warnings = 1;
- break;
-
- case 'W':
- if (!strcmp (argv[i], "-Wtrigraphs"))
+ break;
+
+ case '+':
+ opts->cplusplus = 1, opts->cplusplus_comments = 1;
+ break;
+
+ case 'w':
+ opts->inhibit_warnings = 1;
+ break;
+
+ case 'W':
+ if (!strcmp (argv[i], "-Wtrigraphs"))
+ opts->warn_trigraphs = 1;
+ else if (!strcmp (argv[i], "-Wno-trigraphs"))
+ opts->warn_trigraphs = 0;
+ else if (!strcmp (argv[i], "-Wcomment"))
+ opts->warn_comments = 1;
+ else if (!strcmp (argv[i], "-Wno-comment"))
+ opts->warn_comments = 0;
+ else if (!strcmp (argv[i], "-Wcomments"))
+ opts->warn_comments = 1;
+ else if (!strcmp (argv[i], "-Wno-comments"))
+ opts->warn_comments = 0;
+ else if (!strcmp (argv[i], "-Wtraditional"))
+ opts->warn_stringify = 1;
+ else if (!strcmp (argv[i], "-Wno-traditional"))
+ opts->warn_stringify = 0;
+ else if (!strcmp (argv[i], "-Wundef"))
+ opts->warn_undef = 1;
+ else if (!strcmp (argv[i], "-Wno-undef"))
+ opts->warn_undef = 0;
+ else if (!strcmp (argv[i], "-Wimport"))
+ opts->warn_import = 1;
+ else if (!strcmp (argv[i], "-Wno-import"))
+ opts->warn_import = 0;
+ else if (!strcmp (argv[i], "-Werror"))
+ opts->warnings_are_errors = 1;
+ else if (!strcmp (argv[i], "-Wno-error"))
+ opts->warnings_are_errors = 0;
+ else if (!strcmp (argv[i], "-Wall"))
+ {
opts->warn_trigraphs = 1;
- else if (!strcmp (argv[i], "-Wno-trigraphs"))
- opts->warn_trigraphs = 0;
- else if (!strcmp (argv[i], "-Wcomment"))
- opts->warn_comments = 1;
- else if (!strcmp (argv[i], "-Wno-comment"))
- opts->warn_comments = 0;
- else if (!strcmp (argv[i], "-Wcomments"))
opts->warn_comments = 1;
- else if (!strcmp (argv[i], "-Wno-comments"))
- opts->warn_comments = 0;
- else if (!strcmp (argv[i], "-Wtraditional"))
- opts->warn_stringify = 1;
- else if (!strcmp (argv[i], "-Wno-traditional"))
- opts->warn_stringify = 0;
- else if (!strcmp (argv[i], "-Wundef"))
- opts->warn_undef = 1;
- else if (!strcmp (argv[i], "-Wno-undef"))
- opts->warn_undef = 0;
- else if (!strcmp (argv[i], "-Wimport"))
- opts->warn_import = 1;
- else if (!strcmp (argv[i], "-Wno-import"))
- opts->warn_import = 0;
- else if (!strcmp (argv[i], "-Werror"))
- opts->warnings_are_errors = 1;
- else if (!strcmp (argv[i], "-Wno-error"))
- opts->warnings_are_errors = 0;
- else if (!strcmp (argv[i], "-Wall"))
- {
- opts->warn_trigraphs = 1;
- opts->warn_comments = 1;
- }
- break;
-
- case 'M':
- /* The style of the choices here is a bit mixed.
- The chosen scheme is a hybrid of keeping all options in one string
- and specifying each option in a separate argument:
- -M|-MM|-MD file|-MMD file [-MG]. An alternative is:
- -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely:
- -M[M][G][D file]. This is awkward to handle in specs, and is not
- as extensible. */
- /* ??? -MG must be specified in addition to one of -M or -MM.
- This can be relaxed in the future without breaking anything.
- The converse isn't true. */
-
- /* -MG isn't valid with -MD or -MMD. This is checked for later. */
- if (!strcmp (argv[i], "-MG"))
- {
- opts->print_deps_missing_files = 1;
- break;
- }
- if (!strcmp (argv[i], "-M"))
- opts->print_deps = 2;
- else if (!strcmp (argv[i], "-MM"))
- opts->print_deps = 1;
- else if (!strcmp (argv[i], "-MD"))
- opts->print_deps = 2;
- else if (!strcmp (argv[i], "-MMD"))
- opts->print_deps = 1;
- /* For -MD and -MMD options, write deps on file named by next arg. */
- if (!strcmp (argv[i], "-MD") || !strcmp (argv[i], "-MMD"))
- {
- if (i+1 == argc)
- goto missing_filename;
- opts->deps_file = argv[++i];
- }
- else
- {
- /* For -M and -MM, write deps on standard output
- and suppress the usual output. */
- opts->no_output = 1;
- }
- break;
-
- case 'd':
+ }
+ break;
+
+ case 'M':
+ /* The style of the choices here is a bit mixed.
+ The chosen scheme is a hybrid of keeping all options in one string
+ and specifying each option in a separate argument:
+ -M|-MM|-MD file|-MMD file [-MG]. An alternative is:
+ -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely:
+ -M[M][G][D file]. This is awkward to handle in specs, and is not
+ as extensible. */
+ /* ??? -MG must be specified in addition to one of -M or -MM.
+ This can be relaxed in the future without breaking anything.
+ The converse isn't true. */
+
+ /* -MG isn't valid with -MD or -MMD. This is checked for later. */
+ if (!strcmp (argv[i], "-MG"))
{
- char *p = argv[i] + 2;
- char c;
- while ((c = *p++) != 0) {
- /* Arg to -d specifies what parts of macros to dump */
- switch (c) {
- case 'M':
- opts->dump_macros = dump_only;
- opts->no_output = 1;
- break;
- case 'N':
- opts->dump_macros = dump_names;
- break;
- case 'D':
- opts->dump_macros = dump_definitions;
- break;
- case 'I':
- opts->dump_includes = 1;
- break;
- }
+ opts->print_deps_missing_files = 1;
+ break;
+ }
+ if (!strcmp (argv[i], "-M"))
+ opts->print_deps = 2;
+ else if (!strcmp (argv[i], "-MM"))
+ opts->print_deps = 1;
+ else if (!strcmp (argv[i], "-MD"))
+ opts->print_deps = 2;
+ else if (!strcmp (argv[i], "-MMD"))
+ opts->print_deps = 1;
+ /* For -MD and -MMD options, write deps on file named by next arg. */
+ if (!strcmp (argv[i], "-MD") || !strcmp (argv[i], "-MMD"))
+ {
+ if (i+1 == argc)
+ goto missing_filename;
+ opts->deps_file = argv[++i];
+ }
+ else
+ {
+ /* For -M and -MM, write deps on standard output
+ and suppress the usual output. */
+ opts->no_output = 1;
+ }
+ break;
+
+ case 'd':
+ {
+ char *p = argv[i] + 2;
+ char c;
+ while ((c = *p++) != 0) {
+ /* Arg to -d specifies what parts of macros to dump */
+ switch (c) {
+ case 'M':
+ opts->dump_macros = dump_only;
+ opts->no_output = 1;
+ break;
+ case 'N':
+ opts->dump_macros = dump_names;
+ break;
+ case 'D':
+ opts->dump_macros = dump_definitions;
+ break;
+ case 'I':
+ opts->dump_includes = 1;
+ break;
}
}
- break;
-
- case 'g':
- if (argv[i][2] == '3')
- opts->debug_output = 1;
- break;
-
- case 'v':
- fprintf (stderr, "GNU CPP version %s", version_string);
+ }
+ break;
+
+ case 'g':
+ if (argv[i][2] == '3')
+ opts->debug_output = 1;
+ break;
+
+ case '-':
+ if (strcmp (argv[i], "--help") != 0)
+ return i;
+ print_help ();
+ break;
+
+ case 'v':
+ fprintf (stderr, "GNU CPP version %s", version_string);
#ifdef TARGET_VERSION
- TARGET_VERSION;
+ TARGET_VERSION;
#endif
- fprintf (stderr, "\n");
- opts->verbose = 1;
- break;
-
- case 'H':
- opts->print_include_names = 1;
- break;
-
- case 'D':
+ fprintf (stderr, "\n");
+ opts->verbose = 1;
+ break;
+
+ case 'H':
+ opts->print_include_names = 1;
+ break;
+
+ case 'D':
+ if (argv[i][2] != 0)
+ push_pending (pfile, "-D", argv[i] + 2);
+ else if (i + 1 == argc)
+ {
+ cpp_fatal (pfile, "Macro name missing after -D option");
+ return argc;
+ }
+ else
+ i++, push_pending (pfile, "-D", argv[i]);
+ break;
+
+ case 'A':
+ {
+ char *p;
+
if (argv[i][2] != 0)
- push_pending (pfile, "-D", argv[i] + 2);
+ p = argv[i] + 2;
else if (i + 1 == argc)
{
- cpp_fatal (pfile, "Macro name missing after -D option");
+ cpp_fatal (pfile, "Assertion missing after -A option");
return argc;
}
else
- i++, push_pending (pfile, "-D", argv[i]);
- break;
-
- case 'A':
- {
- char *p;
-
- if (argv[i][2] != 0)
- p = argv[i] + 2;
- else if (i + 1 == argc)
+ p = argv[++i];
+
+ if (!strcmp (p, "-")) {
+ struct cpp_pending **ptr;
+ /* -A- eliminates all predefined macros and assertions.
+ Let's include also any that were specified earlier
+ on the command line. That way we can get rid of any
+ that were passed automatically in from GCC. */
+ opts->inhibit_predefs = 1;
+ for (ptr = &opts->pending; *ptr != NULL; )
{
- cpp_fatal (pfile, "Assertion missing after -A option");
- return argc;
+ struct cpp_pending *pend = *ptr;
+ if (pend->cmd && pend->cmd[0] == '-'
+ && (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
+ {
+ *ptr = pend->next;
+ free (pend);
+ }
+ else
+ ptr = &pend->next;
}
- else
- p = argv[++i];
-
- if (!strcmp (p, "-")) {
- struct cpp_pending **ptr;
- /* -A- eliminates all predefined macros and assertions.
- Let's include also any that were specified earlier
- on the command line. That way we can get rid of any
- that were passed automatically in from GCC. */
- opts->inhibit_predefs = 1;
- for (ptr = &opts->pending; *ptr != NULL; )
- {
- struct cpp_pending *pend = *ptr;
- if (pend->cmd && pend->cmd[0] == '-'
- && (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
- {
- *ptr = pend->next;
- free (pend);
- }
- else
- ptr = &pend->next;
- }
- } else {
- push_pending (pfile, "-A", p);
- }
+ } else {
+ push_pending (pfile, "-A", p);
}
- break;
-
- case 'U': /* JF #undef something */
- if (argv[i][2] != 0)
- push_pending (pfile, "-U", argv[i] + 2);
- else if (i + 1 == argc)
- {
- cpp_fatal (pfile, "Macro name missing after -U option", NULL);
- return argc;
- }
- else
- push_pending (pfile, "-U", argv[i+1]), i++;
- break;
-
- case 'C':
- opts->put_out_comments = 1;
- break;
-
- case 'E': /* -E comes from cc -E; ignore it. */
- break;
-
- case 'P':
- opts->no_line_commands = 1;
- break;
-
- case '$': /* Don't include $ in identifiers. */
- opts->dollars_in_ident = 0;
- break;
-
- case 'I': /* Add directory to path for includes. */
+ }
+ break;
+
+ case 'U': /* JF #undef something */
+ if (argv[i][2] != 0)
+ push_pending (pfile, "-U", argv[i] + 2);
+ else if (i + 1 == argc)
{
- struct file_name_list *dirtmp;
-
- if (! CPP_OPTIONS(pfile)->ignore_srcdir
- && !strcmp (argv[i] + 2, "-")) {
- CPP_OPTIONS (pfile)->ignore_srcdir = 1;
- /* Don't use any preceding -I directories for #include <...>. */
- CPP_OPTIONS (pfile)->first_bracket_include = 0;
- }
- else {
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
- dirtmp->next = 0; /* New one goes on the end */
- dirtmp->control_macro = 0;
- dirtmp->c_system_include_path = 0;
- if (argv[i][2] != 0)
- dirtmp->fname = argv[i] + 2;
- else if (i + 1 == argc)
- goto missing_dirname;
- else
- dirtmp->fname = argv[++i];
- dirtmp->got_name_map = 0;
- append_include_chain (pfile, dirtmp, dirtmp);
- }
+ cpp_fatal (pfile, "Macro name missing after -U option");
+ return argc;
}
- break;
-
- case 'n':
- if (!strcmp (argv[i], "-nostdinc"))
- /* -nostdinc causes no default include directories.
- You must specify all include-file directories with -I. */
- opts->no_standard_includes = 1;
- else if (!strcmp (argv[i], "-nostdinc++"))
- /* -nostdinc++ causes no default C++-specific include directories. */
- opts->no_standard_cplusplus_includes = 1;
+ else
+ push_pending (pfile, "-U", argv[i+1]), i++;
+ break;
+
+ case 'C':
+ opts->put_out_comments = 1;
+ break;
+
+ case 'E': /* -E comes from cc -E; ignore it. */
+ break;
+
+ case 'P':
+ opts->no_line_commands = 1;
+ break;
+
+ case '$': /* Don't include $ in identifiers. */
+ opts->dollars_in_ident = 0;
+ break;
+
+ case 'I': /* Add directory to path for includes. */
+ {
+ struct file_name_list *dirtmp;
+
+ if (! CPP_OPTIONS(pfile)->ignore_srcdir
+ && !strcmp (argv[i] + 2, "-")) {
+ CPP_OPTIONS (pfile)->ignore_srcdir = 1;
+ /* Don't use any preceding -I directories for #include <...>. */
+ CPP_OPTIONS (pfile)->first_bracket_include = 0;
+ }
+ else {
+ dirtmp = (struct file_name_list *)
+ xmalloc (sizeof (struct file_name_list));
+ dirtmp->next = 0; /* New one goes on the end */
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 0;
+ if (argv[i][2] != 0)
+ dirtmp->fname = argv[i] + 2;
+ else if (i + 1 == argc)
+ goto missing_dirname;
+ else
+ dirtmp->fname = argv[++i];
+ dirtmp->got_name_map = 0;
+ append_include_chain (pfile, dirtmp, dirtmp);
+ }
+ }
+ break;
+
+ case 'n':
+ if (!strcmp (argv[i], "-nostdinc"))
+ /* -nostdinc causes no default include directories.
+ You must specify all include-file directories with -I. */
+ opts->no_standard_includes = 1;
+ else if (!strcmp (argv[i], "-nostdinc++"))
+ /* -nostdinc++ causes no default C++-specific include directories. */
+ opts->no_standard_cplusplus_includes = 1;
#if 0
- else if (!strcmp (argv[i], "-noprecomp"))
- no_precomp = 1;
+ else if (!strcmp (argv[i], "-noprecomp"))
+ no_precomp = 1;
#endif
+ break;
+
+ case 'r':
+ if (!strcmp (argv[i], "-remap"))
+ opts->remap = 1;
+ break;
+
+ case 'u':
+ /* Sun compiler passes undocumented switch "-undef".
+ Let's assume it means to inhibit the predefined symbols. */
+ opts->inhibit_predefs = 1;
+ break;
+
+ case '\0': /* JF handle '-' as file name meaning stdin or stdout */
+ if (opts->in_fname == NULL) {
+ opts->in_fname = "";
break;
-
- case 'r':
- if (!strcmp (argv[i], "-remap"))
- opts->remap = 1;
+ } else if (opts->out_fname == NULL) {
+ opts->out_fname = "";
break;
+ } /* else fall through into error */
+
+ default:
+ return i;
+ }
+ }
- case 'u':
- /* Sun compiler passes undocumented switch "-undef".
- Let's assume it means to inhibit the predefined symbols. */
- opts->inhibit_predefs = 1;
- break;
+ return i + 1;
+}
- case '\0': /* JF handle '-' as file name meaning stdin or stdout */
- if (opts->in_fname == NULL) {
- opts->in_fname = "";
- break;
- } else if (opts->out_fname == NULL) {
- opts->out_fname = "";
- break;
- } /* else fall through into error */
+/* Handle command-line options in (argc, argv).
+ Can be called multiple times, to handle multiple sets of options.
+ Returns if an unrecognized option is seen.
+ Returns number of strings consumed. */
- default:
- return i;
- }
+int
+cpp_handle_options (pfile, argc, argv)
+ cpp_reader *pfile;
+ int argc;
+ char **argv;
+{
+ int i;
+ int strings_processed;
+ for (i = 0; i < argc; i += strings_processed)
+ {
+ strings_processed = cpp_handle_option (pfile, argc - i, argv + i);
+ if (strings_processed == 0)
+ break;
}
- }
return i;
}
@@ -6828,8 +6949,8 @@ cpp_cleanup (pfile)
static int
do_assert (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
{
long symstart; /* remember where symbol name starts */
int c;
@@ -6901,8 +7022,8 @@ do_assert (pfile, keyword, buf, limit)
static int
do_unassert (pfile, keyword, buf, limit)
cpp_reader *pfile;
- struct directive *keyword;
- U_CHAR *buf, *limit;
+ struct directive *keyword ATTRIBUTE_UNUSED;
+ U_CHAR *buf ATTRIBUTE_UNUSED, *limit ATTRIBUTE_UNUSED;
{
long symstart; /* remember where symbol name starts */
int sym_length; /* and how long it is */
@@ -7315,29 +7436,49 @@ cpp_print_file_and_line (pfile)
{
long line, col;
cpp_buf_line_and_col (ip, &line, &col);
- cpp_file_line_for_message (ip->nominal_fname,
+ cpp_file_line_for_message (pfile, ip->nominal_fname,
line, pfile->show_column ? col : -1);
}
}
-void
-cpp_error (pfile, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- char *msg;
- char *arg1, *arg2, *arg3;
+static void
+v_cpp_error (pfile, msg, ap)
+ cpp_reader *pfile;
+ const char *msg;
+ va_list ap;
{
cpp_print_containing_files (pfile);
cpp_print_file_and_line (pfile);
- cpp_message (pfile, 1, msg, arg1, arg2, arg3);
+ v_cpp_message (pfile, 1, msg, ap);
+}
+
+void
+cpp_error VPROTO ((cpp_reader * pfile, const char *msg, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START(ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ msg = va_arg (ap, const char *);
+#endif
+
+ v_cpp_error (pfile, msg, ap);
+ va_end(ap);
}
/* Print error message but don't count it. */
-void
-cpp_warning (pfile, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- char *msg;
- char *arg1, *arg2, *arg3;
+static void
+v_cpp_warning (pfile, msg, ap)
+ cpp_reader *pfile;
+ const char *msg;
+ va_list ap;
{
if (CPP_OPTIONS (pfile)->inhibit_warnings)
return;
@@ -7347,46 +7488,103 @@ cpp_warning (pfile, msg, arg1, arg2, arg3)
cpp_print_containing_files (pfile);
cpp_print_file_and_line (pfile);
- cpp_message (pfile, 0, msg, arg1, arg2, arg3);
+ v_cpp_message (pfile, 0, msg, ap);
+}
+
+void
+cpp_warning VPROTO ((cpp_reader * pfile, const char *msg, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ msg = va_arg (ap, const char *);
+#endif
+
+ v_cpp_warning (pfile, msg, ap);
+ va_end(ap);
}
/* Print an error message and maybe count it. */
void
-cpp_pedwarn (pfile, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- char *msg;
- char *arg1, *arg2, *arg3;
+cpp_pedwarn VPROTO ((cpp_reader * pfile, const char *msg, ...))
{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ msg = va_arg (ap, const char *);
+#endif
+
if (CPP_OPTIONS (pfile)->pedantic_errors)
- cpp_error (pfile, msg, arg1, arg2, arg3);
+ v_cpp_error (pfile, msg, ap);
else
- cpp_warning (pfile, msg, arg1, arg2, arg3);
+ v_cpp_warning (pfile, msg, ap);
+ va_end(ap);
}
-void
-cpp_error_with_line (pfile, line, column, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- int line, column;
- char *msg;
- char *arg1, *arg2, *arg3;
+static void
+v_cpp_error_with_line (pfile, line, column, msg, ap)
+ cpp_reader * pfile;
+ int line;
+ int column;
+ const char * msg;
+ va_list ap;
{
cpp_buffer *ip = cpp_file_buffer (pfile);
cpp_print_containing_files (pfile);
if (ip != NULL)
- cpp_file_line_for_message (ip->nominal_fname, line, column);
+ cpp_file_line_for_message (pfile, ip->nominal_fname, line, column);
- cpp_message (pfile, 1, msg, arg1, arg2, arg3);
+ v_cpp_message (pfile, 1, msg, ap);
+}
+
+void
+cpp_error_with_line VPROTO ((cpp_reader * pfile, int line, int column, const char *msg, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ int line;
+ int column;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ line = va_arg (ap, int);
+ column = va_arg (ap, int);
+ msg = va_arg (ap, const char *);
+#endif
+
+ v_cpp_error_with_line(pfile, line, column, msg, ap);
+ va_end(ap);
}
static void
-cpp_warning_with_line (pfile, line, column, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- int line, column;
- char *msg;
- char *arg1, *arg2, *arg3;
+v_cpp_warning_with_line (pfile, line, column, msg, ap)
+ cpp_reader * pfile;
+ int line;
+ int column;
+ const char *msg;
+ va_list ap;
{
cpp_buffer *ip;
@@ -7401,65 +7599,100 @@ cpp_warning_with_line (pfile, line, column, msg, arg1, arg2, arg3)
ip = cpp_file_buffer (pfile);
if (ip != NULL)
- cpp_file_line_for_message (ip->nominal_fname, line, column);
+ cpp_file_line_for_message (pfile, ip->nominal_fname, line, column);
+
+ v_cpp_message (pfile, 0, msg, ap);
+}
+
+#if 0
+static void
+cpp_warning_with_line VPROTO ((cpp_reader * pfile, int line, int column, const char *msg, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ int line;
+ int column;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ line = va_arg (ap, int);
+ column = va_arg (ap, int);
+ msg = va_arg (ap, const char *);
+#endif
- cpp_message (pfile, 0, msg, arg1, arg2, arg3);
+ v_cpp_warning_with_line (pfile, line, column, msg, ap);
+ va_end(ap);
}
+#endif
void
-cpp_pedwarn_with_line (pfile, line, column, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- int line, column;
- char *msg;
- char *arg1, *arg2, *arg3;
+cpp_pedwarn_with_line VPROTO ((cpp_reader * pfile, int line, int column, const char *msg, ...))
{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ int line;
+ int column;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ line = va_arg (ap, int);
+ column = va_arg (ap, int);
+ msg = va_arg (ap, const char *);
+#endif
+
if (CPP_OPTIONS (pfile)->pedantic_errors)
- cpp_error_with_line (pfile, column, line, msg, arg1, arg2, arg3);
+ v_cpp_error_with_line (pfile, column, line, msg, ap);
else
- cpp_warning_with_line (pfile, line, column, msg, arg1, arg2, arg3);
+ v_cpp_warning_with_line (pfile, line, column, msg, ap);
+ va_end(ap);
}
/* Report a warning (or an error if pedantic_errors)
giving specified file name and line number, not current. */
void
-cpp_pedwarn_with_file_and_line (pfile, file, line, msg, arg1, arg2, arg3)
- cpp_reader *pfile;
- char *file;
- int line;
- char *msg;
- char *arg1, *arg2, *arg3;
+cpp_pedwarn_with_file_and_line VPROTO ((cpp_reader *pfile, char *file, int line, const char *msg, ...))
{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ char *file;
+ int line;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ file = va_arg (ap, char *);
+ line = va_arg (ap, int);
+ msg = va_arg (ap, const char *);
+#endif
+
if (!CPP_OPTIONS (pfile)->pedantic_errors
&& CPP_OPTIONS (pfile)->inhibit_warnings)
return;
if (file != NULL)
- cpp_file_line_for_message (file, line, -1);
- cpp_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors,
- msg, arg1, arg2, arg3);
+ cpp_file_line_for_message (pfile, file, line, -1);
+ v_cpp_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors, msg, ap);
+ va_end(ap);
}
-/* This defines "errno" properly for VMS, and gives us EACCES. */
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
/* my_strerror - return the descriptive text associated with an
`errno' code. */
-char *
+static char *
my_strerror (errnum)
int errnum;
{
@@ -7493,7 +7726,16 @@ my_strerror (errnum)
void
cpp_error_from_errno (pfile, name)
cpp_reader *pfile;
- char *name;
+ const char *name;
+{
+ cpp_message_from_errno (pfile, 1, name);
+}
+
+void
+cpp_message_from_errno (pfile, is_error, name)
+ cpp_reader *pfile;
+ int is_error;
+ const char *name;
{
int e = errno;
cpp_buffer *ip = cpp_file_buffer (pfile);
@@ -7501,15 +7743,15 @@ cpp_error_from_errno (pfile, name)
cpp_print_containing_files (pfile);
if (ip != NULL)
- cpp_file_line_for_message (ip->nominal_fname, ip->lineno, -1);
+ cpp_file_line_for_message (pfile, ip->nominal_fname, ip->lineno, -1);
- cpp_message (pfile, 1, "%s: %s", name, my_strerror (e));
+ cpp_message (pfile, is_error, "%s: %s", name, my_strerror (e));
}
void
cpp_perror_with_name (pfile, name)
cpp_reader *pfile;
- char *name;
+ const char *name;
{
cpp_message (pfile, 1, "%s: %s: %s", progname, name, my_strerror (errno));
}
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 346ce44037d..ad69646d4fe 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -69,11 +69,7 @@ enum cpp_token {
};
#ifndef PARAMS
-#ifdef __STDC__
-#define PARAMS(P) P
-#else
-#define PARAMS(P) ()
-#endif
+#define PARAMS(P) PROTO(P)
#endif /* !PARAMS */
typedef enum cpp_token (*parse_underflow_t) PARAMS((cpp_reader *));
@@ -93,6 +89,7 @@ extern void parse_clear_mark PARAMS ((struct parse_marker *));
extern void parse_goto_mark PARAMS((struct parse_marker *, cpp_reader *));
extern void parse_move_mark PARAMS((struct parse_marker *, cpp_reader *));
+extern int cpp_handle_option PARAMS ((cpp_reader *, int, char **));
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
extern enum cpp_token cpp_get_token PARAMS ((cpp_reader *));
extern void cpp_skip_hspace PARAMS((cpp_reader *));
@@ -644,16 +641,22 @@ extern void cpp_buf_line_and_col PARAMS((cpp_buffer *, long *, long *));
extern cpp_buffer* cpp_file_buffer PARAMS((cpp_reader *));
extern void cpp_define PARAMS ((cpp_reader*, unsigned char *));
-extern void cpp_error ();
-extern void cpp_warning ();
-extern void cpp_pedwarn ();
-extern void cpp_error_with_line ();
-extern void cpp_pedwarn_with_line ();
-extern void cpp_pedwarn_with_file_and_line ();
-extern void fatal ();
-extern void cpp_error_from_errno ();
-extern void cpp_perror_with_name ();
-extern void cpp_pfatal_with_name ();
+extern void cpp_error PVPROTO ((cpp_reader *, const char *, ...))
+ ATTRIBUTE_PRINTF_2;
+extern void cpp_warning PVPROTO ((cpp_reader *, const char *, ...))
+ ATTRIBUTE_PRINTF_2;
+extern void cpp_pedwarn PVPROTO ((cpp_reader *, const char *, ...))
+ ATTRIBUTE_PRINTF_2;
+extern void cpp_error_with_line PVPROTO ((cpp_reader *, int, int, const char *, ...))
+ ATTRIBUTE_PRINTF_4;
+extern void cpp_pedwarn_with_line PVPROTO ((cpp_reader *, int, int, const char *, ...))
+ ATTRIBUTE_PRINTF_4;
+extern void cpp_pedwarn_with_file_and_line PVPROTO ((cpp_reader *, char *, int, const char *, ...))
+ ATTRIBUTE_PRINTF_4;
+extern void cpp_message_from_errno PROTO ((cpp_reader *, int, const char *));
+extern void cpp_error_from_errno PROTO ((cpp_reader *, const char *));
+extern void cpp_perror_with_name PROTO ((cpp_reader *, const char *));
+extern void v_cpp_message PROTO ((cpp_reader *, int, const char *, va_list));
extern void cpp_grow_buffer PARAMS ((cpp_reader *, long));
extern int cpp_parse_escape PARAMS ((cpp_reader *, char **));
@@ -663,6 +666,22 @@ extern cpp_buffer *cpp_pop_buffer PARAMS ((cpp_reader *));
extern cpp_hashnode *cpp_lookup PARAMS ((cpp_reader *, const unsigned char *,
int, int));
+extern void cpp_reader_init PARAMS ((cpp_reader *));
+extern void cpp_options_init PARAMS ((cpp_options *));
+extern int cpp_start_read PARAMS ((cpp_reader *, char *));
+extern int cpp_read_check_assertion PARAMS ((cpp_reader *));
+extern int scan_decls PARAMS ((cpp_reader *, int, char **));
+extern void skip_rest_of_line PARAMS ((cpp_reader *));
+extern void cpp_finish PARAMS ((cpp_reader *));
+
+/* From cpperror.c */
+extern void cpp_fatal PVPROTO ((cpp_reader *, const char *, ...))
+ ATTRIBUTE_PRINTF_2;
+extern void cpp_message PVPROTO ((cpp_reader *, int, const char *, ...))
+ ATTRIBUTE_PRINTF_3;
+extern void cpp_pfatal_with_name PROTO ((cpp_reader *, const char *));
+extern void cpp_file_line_for_message PROTO ((cpp_reader *, char *, int, int));
+extern void cpp_print_containing_files PROTO ((cpp_reader *));
#ifdef __cplusplus
}
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index d4b27da4a6d..0a45e86907b 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -23,6 +23,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef EMACS
#include "config.h"
#include "system.h"
+#include "gansidecl.h"
#else
#include <stdio.h>
@@ -39,6 +40,13 @@ cpp_options options;
#ifdef abort
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
+void
+fatal (s)
+ char *s;
+{
+ fputs (s, stderr);
+ exit (FATAL_EXIT_CODE);
+}
void
fancy_abort ()
@@ -54,7 +62,6 @@ main (argc, argv)
char **argv;
{
char *p;
- int i;
int argi = 1; /* Next argument to handle. */
struct cpp_options *opts = &options;
diff --git a/gcc/cross-make b/gcc/cross-make
index 5e5a93fb44e..810f5051a63 100644
--- a/gcc/cross-make
+++ b/gcc/cross-make
@@ -12,7 +12,8 @@ RANLIB = $(RANLIB_FOR_TARGET)
RANLIB_TEST = $(RANLIB_TEST_FOR_TARGET)
# Dir to search for system headers. Normally /usr/include.
-SYSTEM_HEADER_DIR = $(tooldir)/include
+# Use CROSS_INCLUDE_DIR not TOOL_INCLUDE_DIR for other vendor's headers.
+SYSTEM_HEADER_DIR = $(tooldir)/sys-include
# Don't try to compile the things we can't compile.
ALL = all.cross
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index e6238de5e9b..ce2c9561e64 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -56,6 +56,8 @@ Boston, MA 02111-1307, USA. */
#include <stddef.h>
#include "frame.h"
+#ifndef OBJECT_FORMAT_MACHO
+
/* Provide default definitions for the pseudo-ops used to switch to the
.ctors and .dtors sections.
@@ -150,7 +152,7 @@ __do_global_dtors_aux ()
/* Stick a call to __do_global_dtors_aux into the .fini section. */
-static void
+static void __attribute__ ((__unused__))
fini_dummy ()
{
asm (FINI_SECTION_ASM_OP);
@@ -173,7 +175,7 @@ frame_dummy ()
__register_frame_info (__EH_FRAME_BEGIN__, &object);
}
-static void
+static void __attribute__ ((__unused__))
init_dummy ()
{
asm (INIT_SECTION_ASM_OP);
@@ -274,7 +276,7 @@ __frame_dummy ()
#endif /* defined(INIT_SECTION_ASM_OP) */
/* Force cc1 to switch to .data section. */
-static func_ptr force_to_data[0] = { };
+static func_ptr force_to_data[0] __attribute__ ((__unused__)) = { };
/* NOTE: In order to be able to support SVR4 shared libraries, we arrange
to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
@@ -294,7 +296,8 @@ static func_ptr force_to_data[0] = { };
CTOR_LIST_BEGIN;
#else
asm (CTORS_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
-STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) };
+STATIC func_ptr __CTOR_LIST__[1] __attribute__ ((__unused__))
+ = { (func_ptr) (-1) };
#endif
#ifdef DTOR_LIST_BEGIN
@@ -334,7 +337,7 @@ __do_global_ctors_aux ()
/* Stick a call to __do_global_ctors_aux into the .init section. */
-static void
+static void __attribute__ ((__unused__))
init_dummy ()
{
asm (INIT_SECTION_ASM_OP);
@@ -406,6 +409,9 @@ asm (TEXT_SECTION_ASM_OP);
not an SVR4-style .init section. __do_global_ctors can be non-static
in this case because we protect it with -hidden_symbol. */
static func_ptr __CTOR_END__[];
+#ifdef EH_FRAME_SECTION_ASM_OP
+extern void __frame_dummy (void);
+#endif
void
__do_global_ctors ()
{
@@ -421,7 +427,7 @@ __do_global_ctors ()
#endif /* defined(INIT_SECTION_ASM_OP) */
/* Force cc1 to switch to .data section. */
-static func_ptr force_to_data[0] = { };
+static func_ptr force_to_data[0] __attribute__ ((__unused__)) = { };
/* Put a word containing zero at the end of each of our two lists of function
addresses. Note that the words defined here go into the .ctors and .dtors
@@ -440,7 +446,8 @@ STATIC func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
DTOR_LIST_END;
#else
asm (DTORS_SECTION_ASM_OP); /* cc1 doesn't know that we are switching! */
-STATIC func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
+STATIC func_ptr __DTOR_END__[1] __attribute__ ((__unused__))
+ = { (func_ptr) 0 };
#endif
#ifdef EH_FRAME_SECTION_ASM_OP
@@ -449,7 +456,75 @@ STATIC func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
typedef unsigned int ui32 __attribute__ ((mode (SI)));
asm (EH_FRAME_SECTION_ASM_OP);
-STATIC ui32 __FRAME_END__[] = { 0 };
+STATIC ui32 __FRAME_END__[] __attribute__ ((__unused__)) = { 0 };
#endif /* EH_FRAME_SECTION */
#endif /* defined(CRT_END) */
+
+#else /* OBJECT_FORMAT_MACHO */
+
+/* For Mach-O format executables, we assume that the system's runtime is
+ smart enough to handle constructors and destructors, but doesn't have
+ an init section (if it can't even handle constructors/destructors
+ you should be using INVOKE__main, not crtstuff). All we need to do
+ is install/deinstall the frame information for exceptions. We do this
+ by putting a constructor in crtbegin.o and a destructor in crtend.o.
+
+ crtend.o also puts in the terminating zero in the frame information
+ segment. */
+
+/* The crtstuff for other object formats use the symbol __EH_FRAME_BEGIN__
+ to figure out the start of the exception frame, but here we use
+ getsectbynamefromheader to find this value. Either method would work,
+ but this method avoids creating any global symbols, which seems
+ cleaner. */
+
+#include <mach-o/ldsyms.h>
+extern const struct section *
+ getsectbynamefromheader (const struct mach_header *,
+ const char *, const char *);
+
+#ifdef CRT_BEGIN
+
+static void __reg_frame_ctor () __attribute__ ((constructor));
+
+static void
+__reg_frame_ctor ()
+{
+ static struct object object;
+ const struct section *eh_frame;
+
+ eh_frame = getsectbynamefromheader (&_mh_execute_header,
+ "__TEXT", "__eh_frame");
+ __register_frame_info ((void *) eh_frame->addr, &object);
+}
+
+#endif /* CRT_BEGIN */
+
+#ifdef CRT_END
+
+static void __dereg_frame_dtor () __attribute__ ((destructor));
+
+static
+void __dereg_frame_dtor ()
+{
+ const struct section *eh_frame;
+
+ eh_frame = getsectbynamefromheader (&_mh_execute_header,
+ "__TEXT", "__eh_frame");
+ __deregister_frame_info ((void *) eh_frame->addr);
+}
+
+/* Terminate the frame section with a final zero. */
+
+/* Force cc1 to switch to .data section. */
+static void * force_to_data[0] __attribute__ ((__unused__)) = { };
+
+typedef unsigned int ui32 __attribute__ ((mode (SI)));
+asm (EH_FRAME_SECTION_ASM_OP);
+static ui32 __FRAME_END__[] __attribute__ ((__unused__)) = { 0 };
+
+#endif /* CRT_END */
+
+#endif /* OBJECT_FORMAT_MACHO */
+
diff --git a/gcc/cse.c b/gcc/cse.c
index 26dd99132ff..8c0a6661364 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
/* stdio.h must precede rtl.h for FFS. */
#include "system.h"
+#include <setjmp.h>
#include "rtl.h"
#include "regs.h"
@@ -31,8 +32,8 @@ Boston, MA 02111-1307, USA. */
#include "insn-config.h"
#include "recog.h"
#include "expr.h"
-
-#include <setjmp.h>
+#include "toplev.h"
+#include "output.h"
/* The basic idea of common subexpression elimination is to go
through the code, keeping a record of expressions that would
@@ -496,6 +497,16 @@ struct table_elt
#define REGNO_QTY_VALID_P(N) (reg_qty[N] != (N))
+#ifdef ADDRESS_COST
+/* The ADDRESS_COST macro does not deal with ADDRESSOF nodes. But,
+ during CSE, such nodes are present. Using an ADDRESSOF node which
+ refers to the address of a REG is a good thing because we can then
+ turn (MEM (ADDRESSSOF (REG))) into just plain REG. */
+#define CSE_ADDRESS_COST(RTX) \
+ ((GET_CODE (RTX) == ADDRESSOF && REG_P (XEXP ((RTX), 0))) \
+ ? -1 : ADDRESS_COST(RTX))
+#endif
+
static struct table_elt *table[NBUCKETS];
/* Chain of `struct table_elt's made so far for this function
@@ -615,6 +626,7 @@ static void merge_equiv_classes PROTO((struct table_elt *,
static void invalidate PROTO((rtx, enum machine_mode));
static int cse_rtx_varies_p PROTO((rtx));
static void remove_invalid_refs PROTO((int));
+static void remove_invalid_subreg_refs PROTO((int, int, enum machine_mode));
static void rehash_using_reg PROTO((rtx));
static void invalidate_memory PROTO((void));
static void invalidate_for_call PROTO((void));
@@ -640,7 +652,7 @@ static rtx equiv_constant PROTO((rtx));
static void record_jump_equiv PROTO((rtx, int));
static void record_jump_cond PROTO((enum rtx_code, enum machine_mode,
rtx, rtx, int));
-static void cse_insn PROTO((rtx, int));
+static void cse_insn PROTO((rtx, rtx));
static int note_mem_written PROTO((rtx));
static void invalidate_from_clobbers PROTO((rtx));
static rtx cse_process_notes PROTO((rtx, rtx));
@@ -969,6 +981,30 @@ mention_regs (x)
return 0;
}
+ /* If this is a SUBREG, we don't want to discard other SUBREGs of the same
+ pseudo if they don't use overlapping words. We handle only pseudos
+ here for simplicity. */
+ if (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG
+ && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER)
+ {
+ int i = REGNO (SUBREG_REG (x));
+
+ if (reg_in_table[i] >= 0 && reg_in_table[i] != reg_tick[i])
+ {
+ /* If reg_tick has been incremented more than once since
+ reg_in_table was last set, that means that the entire
+ register has been set before, so discard anything memorized
+ for the entrire register, including all SUBREG expressions. */
+ if (reg_in_table[i] != reg_tick[i] - 1)
+ remove_invalid_refs (i);
+ else
+ remove_invalid_subreg_refs (i, SUBREG_WORD (x), GET_MODE (x));
+ }
+
+ reg_in_table[i] = reg_tick[i];
+ return 0;
+ }
+
/* If X is a comparison or a COMPARE and either operand is a register
that does not have a quantity, give it one. This is so that a later
call to record_jump_equiv won't cause X to be assigned a different
@@ -1066,8 +1102,19 @@ insert_regs (x, classp, modified)
else if (GET_CODE (x) == SUBREG && GET_CODE (SUBREG_REG (x)) == REG
&& ! REGNO_QTY_VALID_P (REGNO (SUBREG_REG (x))))
{
+ int regno = REGNO (SUBREG_REG (x));
+
insert_regs (SUBREG_REG (x), NULL_PTR, 0);
- mention_regs (SUBREG_REG (x));
+ /* Mention_regs checks if REG_TICK is exactly one larger than
+ REG_IN_TABLE to find out if there was only a single preceding
+ invalidation - for the SUBREG - or another one, which would be
+ for the full register. Since we don't invalidate the SUBREG
+ here first, we might have to bump up REG_TICK so that mention_regs
+ will do the right thing. */
+ if (reg_in_table[regno] >= 0
+ && reg_tick[regno] == reg_in_table[regno] + 1)
+ reg_tick[regno]++;
+ mention_regs (x);
return 1;
}
else
@@ -1243,6 +1290,17 @@ lookup_as_function (x, code)
{
register struct table_elt *p = lookup (x, safe_hash (x, VOIDmode) % NBUCKETS,
GET_MODE (x));
+ /* If we are looking for a CONST_INT, the mode doesn't really matter, as
+ long as we are narrowing. So if we looked in vain for a mode narrower
+ than word_mode before, look for word_mode now. */
+ if (p == 0 && code == CONST_INT
+ && GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (word_mode))
+ {
+ x = copy_rtx (x);
+ PUT_MODE (x, word_mode);
+ p = lookup (x, safe_hash (x, VOIDmode) % NBUCKETS, word_mode);
+ }
+
if (p == 0)
return 0;
@@ -1540,7 +1598,7 @@ invalidate (x, full_mode)
register unsigned hash = HASH (x, GET_MODE (x));
/* Remove REGNO from any quantity list it might be on and indicate
- that it's value might have changed. If it is a pseudo, remove its
+ that its value might have changed. If it is a pseudo, remove its
entry from the hash table.
For a hard register, we do the first two actions above for any
@@ -1608,6 +1666,24 @@ invalidate (x, full_mode)
return;
}
+ /* If X is a parallel, invalidate all of its elements. */
+
+ if (GET_CODE (x) == PARALLEL)
+ {
+ for (i = XVECLEN (x, 0) - 1; i >= 0 ; --i)
+ invalidate (XVECEXP (x, 0, i), VOIDmode);
+ return;
+ }
+
+ /* If X is an expr_list, this is part of a disjoint return value;
+ extract the location in question ignoring the offset. */
+
+ if (GET_CODE (x) == EXPR_LIST)
+ {
+ invalidate (XEXP (x, 0), VOIDmode);
+ return;
+ }
+
/* X is not a register; it must be a memory reference with
a nonvarying address. Remove all hash table elements
that refer to overlapping pieces of memory. */
@@ -1655,6 +1731,37 @@ remove_invalid_refs (regno)
remove_from_table (p, i);
}
}
+
+/* Likewise for a subreg with subreg_reg WORD and mode MODE. */
+static void
+remove_invalid_subreg_refs (regno, word, mode)
+ int regno;
+ int word;
+ enum machine_mode mode;
+{
+ register int i;
+ register struct table_elt *p, *next;
+ int end = word + (GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD;
+
+ for (i = 0; i < NBUCKETS; i++)
+ for (p = table[i]; p; p = next)
+ {
+ rtx exp;
+ next = p->next_same_hash;
+
+ exp = p->exp;
+ if (GET_CODE (p->exp) != REG
+ && (GET_CODE (exp) != SUBREG
+ || GET_CODE (SUBREG_REG (exp)) != REG
+ || REGNO (SUBREG_REG (exp)) != regno
+ || (((SUBREG_WORD (exp)
+ + (GET_MODE_SIZE (GET_MODE (exp)) - 1) / UNITS_PER_WORD)
+ >= word)
+ && SUBREG_WORD (exp) <= end))
+ && refers_to_regno_p (regno, regno + 1, p->exp, NULL_PTR))
+ remove_from_table (p, i);
+ }
+}
/* Recompute the hash codes of any valid entries in the hash table that
reference X, if X is a register, or SUBREG_REG (X) if X is a SUBREG.
@@ -1901,6 +2008,20 @@ canon_hash (x, mode)
return hash;
}
+ /* We handle SUBREG of a REG specially because the underlying
+ reg changes its hash value with every value change; we don't
+ want to have to forget unrelated subregs when one subreg changes. */
+ case SUBREG:
+ {
+ if (GET_CODE (SUBREG_REG (x)) == REG)
+ {
+ hash += (((unsigned) SUBREG << 7)
+ + REGNO (SUBREG_REG (x)) + SUBREG_WORD (x));
+ return hash;
+ }
+ break;
+ }
+
case CONST_INT:
{
unsigned HOST_WIDE_INT tem = INTVAL (x);
@@ -2564,9 +2685,12 @@ find_best_addr (insn, loc)
rtx insn;
rtx *loc;
{
- struct table_elt *elt, *p;
+ struct table_elt *elt;
rtx addr = *loc;
+#ifdef ADDRESS_COST
+ struct table_elt *p;
int found_better = 1;
+#endif
int save_do_not_record = do_not_record;
int save_hash_arg_in_memory = hash_arg_in_memory;
int save_hash_arg_in_struct = hash_arg_in_struct;
@@ -2607,8 +2731,8 @@ find_best_addr (insn, loc)
if (1
#ifdef ADDRESS_COST
- && (ADDRESS_COST (folded) < ADDRESS_COST (addr)
- || (ADDRESS_COST (folded) == ADDRESS_COST (addr)
+ && (CSE_ADDRESS_COST (folded) < CSE_ADDRESS_COST (addr)
+ || (CSE_ADDRESS_COST (folded) == CSE_ADDRESS_COST (addr)
&& rtx_cost (folded, MEM) > rtx_cost (addr, MEM)))
#else
&& rtx_cost (folded, MEM) < rtx_cost (addr, MEM)
@@ -2660,23 +2784,25 @@ find_best_addr (insn, loc)
while (found_better)
{
- int best_addr_cost = ADDRESS_COST (*loc);
+ int best_addr_cost = CSE_ADDRESS_COST (*loc);
int best_rtx_cost = (elt->cost + 1) >> 1;
struct table_elt *best_elt = elt;
found_better = 0;
for (p = elt->first_same_value; p; p = p->next_same_value)
- if (! p->flag
- && (GET_CODE (p->exp) == REG
- || exp_equiv_p (p->exp, p->exp, 1, 0))
- && (ADDRESS_COST (p->exp) < best_addr_cost
- || (ADDRESS_COST (p->exp) == best_addr_cost
- && (p->cost + 1) >> 1 > best_rtx_cost)))
+ if (! p->flag)
{
- found_better = 1;
- best_addr_cost = ADDRESS_COST (p->exp);
- best_rtx_cost = (p->cost + 1) >> 1;
- best_elt = p;
+ if ((GET_CODE (p->exp) == REG
+ || exp_equiv_p (p->exp, p->exp, 1, 0))
+ && (CSE_ADDRESS_COST (p->exp) < best_addr_cost
+ || (CSE_ADDRESS_COST (p->exp) == best_addr_cost
+ && (p->cost + 1) >> 1 > best_rtx_cost)))
+ {
+ found_better = 1;
+ best_addr_cost = CSE_ADDRESS_COST (p->exp);
+ best_rtx_cost = (p->cost + 1) >> 1;
+ best_elt = p;
+ }
}
if (found_better)
@@ -2728,7 +2854,7 @@ find_best_addr (insn, loc)
while (found_better)
{
- int best_addr_cost = ADDRESS_COST (*loc);
+ int best_addr_cost = CSE_ADDRESS_COST (*loc);
int best_rtx_cost = (COST (*loc) + 1) >> 1;
struct table_elt *best_elt = elt;
rtx best_rtx = *loc;
@@ -2749,12 +2875,12 @@ find_best_addr (insn, loc)
{
rtx new = cse_gen_binary (GET_CODE (*loc), Pmode, p->exp, c);
- if ((ADDRESS_COST (new) < best_addr_cost
- || (ADDRESS_COST (new) == best_addr_cost
+ if ((CSE_ADDRESS_COST (new) < best_addr_cost
+ || (CSE_ADDRESS_COST (new) == best_addr_cost
&& (COST (new) + 1) >> 1 > best_rtx_cost)))
{
found_better = 1;
- best_addr_cost = ADDRESS_COST (new);
+ best_addr_cost = CSE_ADDRESS_COST (new);
best_rtx_cost = (COST (new) + 1) >> 1;
best_elt = p;
best_rtx = new;
@@ -5711,6 +5837,12 @@ fold_rtx (x, insn)
const_arg1 ? const_arg1 : folded_arg1,
const_arg2 ? const_arg2 : XEXP (x, 2));
break;
+
+ case 'x':
+ /* Always eliminate CONSTANT_P_RTX at this stage. */
+ if (code == CONSTANT_P_RTX)
+ return (const_arg0 ? const1_rtx : const0_rtx);
+ break;
}
return new ? new : x;
@@ -6077,8 +6209,9 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
Then install the new sources and destinations in the table
of available values.
- If IN_LIBCALL_BLOCK is nonzero, don't record any equivalence made in
- the insn. */
+ If LIBCALL_INSN is nonzero, don't record any equivalence made in
+ the insn. It means that INSN is inside libcall block. In this
+ case LIBCALL_INSN is the corresponding insn with REG_LIBCALL. */
/* Data on one SET contained in the instruction. */
@@ -6116,9 +6249,9 @@ struct set
};
static void
-cse_insn (insn, in_libcall_block)
+cse_insn (insn, libcall_insn)
rtx insn;
- int in_libcall_block;
+ rtx libcall_insn;
{
register rtx x = PATTERN (insn);
register int i;
@@ -6811,7 +6944,7 @@ cse_insn (insn, in_libcall_block)
the current contents will be tested and will always be valid. */
while (1)
{
- rtx trial;
+ rtx trial, old_src;
/* Skip invalid entries. */
while (elt && GET_CODE (elt->exp) != REG
@@ -6877,6 +7010,10 @@ cse_insn (insn, in_libcall_block)
insert the substitution here and we will delete and re-emit
the insn later. */
+ /* Keep track of the original SET_SRC so that we can fix notes
+ on libcall instructions. */
+ old_src = SET_SRC (sets[i].rtl);
+
if (n_sets == 1 && dest == pc_rtx
&& (trial == pc_rtx
|| (GET_CODE (trial) == LABEL_REF
@@ -6901,6 +7038,16 @@ cse_insn (insn, in_libcall_block)
/* Look for a substitution that makes a valid insn. */
else if (validate_change (insn, &SET_SRC (sets[i].rtl), trial, 0))
{
+ /* If we just made a substitution inside a libcall, then we
+ need to make the same substitution in any notes attached
+ to the RETVAL insn. */
+ if (libcall_insn
+ && (GET_CODE (old_src) == REG
+ || GET_CODE (old_src) == SUBREG
+ || GET_CODE (old_src) == MEM))
+ replace_rtx (REG_NOTES (libcall_insn), old_src,
+ canon_reg (SET_SRC (sets[i].rtl), insn));
+
/* The result of apply_change_group can be ignored; see
canon_reg. */
@@ -6953,17 +7100,24 @@ cse_insn (insn, in_libcall_block)
SRC is a hard register. */
{
int first = qty_first_reg[reg_qty[REGNO (src)]];
-
- src = SET_SRC (sets[i].rtl)
- = first >= FIRST_PSEUDO_REGISTER ? regno_reg_rtx[first]
- : gen_rtx_REG (GET_MODE (src), first);
-
- /* If we had a constant that is cheaper than what we are now
- setting SRC to, use that constant. We ignored it when we
- thought we could make this into a no-op. */
- if (src_const && COST (src_const) < COST (src)
- && validate_change (insn, &SET_SRC (sets[i].rtl), src_const, 0))
- src = src_const;
+ rtx new_src
+ = (first >= FIRST_PSEUDO_REGISTER
+ ? regno_reg_rtx[first] : gen_rtx_REG (GET_MODE (src), first));
+
+ /* We must use validate-change even for this, because this
+ might be a special no-op instruction, suitable only to
+ tag notes onto. */
+ if (validate_change (insn, &SET_SRC (sets[i].rtl), new_src, 0))
+ {
+ src = new_src;
+ /* If we had a constant that is cheaper than what we are now
+ setting SRC to, use that constant. We ignored it when we
+ thought we could make this into a no-op. */
+ if (src_const && COST (src_const) < COST (src)
+ && validate_change (insn, &SET_SRC (sets[i].rtl), src_const,
+ 0))
+ src = src_const;
+ }
}
/* If we made a change, recompute SRC values. */
@@ -7347,8 +7501,44 @@ cse_insn (insn, in_libcall_block)
we are going to hash the SET_DEST values unconditionally. */
for (i = 0; i < n_sets; i++)
- if (sets[i].rtl && GET_CODE (SET_DEST (sets[i].rtl)) != REG)
- mention_regs (SET_DEST (sets[i].rtl));
+ {
+ if (sets[i].rtl)
+ {
+ rtx x = SET_DEST (sets[i].rtl);
+
+ if (GET_CODE (x) != REG)
+ mention_regs (x);
+ else
+ {
+ /* We used to rely on all references to a register becoming
+ inaccessible when a register changes to a new quantity,
+ since that changes the hash code. However, that is not
+ safe, since after NBUCKETS new quantities we get a
+ hash 'collision' of a register with its own invalid
+ entries. And since SUBREGs have been changed not to
+ change their hash code with the hash code of the register,
+ it wouldn't work any longer at all. So we have to check
+ for any invalid references lying around now.
+ This code is similar to the REG case in mention_regs,
+ but it knows that reg_tick has been incremented, and
+ it leaves reg_in_table as -1 . */
+ register int regno = REGNO (x);
+ register int endregno
+ = regno + (regno >= FIRST_PSEUDO_REGISTER ? 1
+ : HARD_REGNO_NREGS (regno, GET_MODE (x)));
+ int i;
+
+ for (i = regno; i < endregno; i++)
+ {
+ if (reg_in_table[i] >= 0)
+ {
+ remove_invalid_refs (i);
+ reg_in_table[i] = -1;
+ }
+ }
+ }
+ }
+ }
/* We may have just removed some of the src_elt's from the hash table.
So replace each one with the current head of the same class. */
@@ -7377,6 +7567,7 @@ cse_insn (insn, in_libcall_block)
if (sets[i].rtl)
{
register rtx dest = SET_DEST (sets[i].rtl);
+ rtx inner_dest = sets[i].inner_dest;
register struct table_elt *elt;
/* Don't record value if we are not supposed to risk allocating
@@ -7393,7 +7584,7 @@ cse_insn (insn, in_libcall_block)
since we might delete the libcall. Things should have been set
up so we won't want to reuse such a value, but we play it safe
here. */
- || in_libcall_block
+ || libcall_insn
/* If we didn't put a REG_EQUAL value or a source into the hash
table, there is no point is recording DEST. */
|| sets[i].src_elt == 0
@@ -7425,8 +7616,18 @@ cse_insn (insn, in_libcall_block)
sets[i].dest_hash = HASH (dest, GET_MODE (dest));
}
- elt = insert (dest, sets[i].src_elt,
- sets[i].dest_hash, GET_MODE (dest));
+ if (GET_CODE (inner_dest) == MEM
+ && GET_CODE (XEXP (inner_dest, 0)) == ADDRESSOF)
+ /* Given (SET (MEM (ADDRESSOF (X))) Y) we don't want to say
+ that (MEM (ADDRESSOF (X))) is equivalent to Y.
+ Consider the case in which the address of the MEM is
+ passed to a function, which alters the MEM. Then, if we
+ later use Y instead of the MEM we'll miss the update. */
+ elt = insert (dest, 0, sets[i].dest_hash, GET_MODE (dest));
+ else
+ elt = insert (dest, sets[i].src_elt,
+ sets[i].dest_hash, GET_MODE (dest));
+
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,
@@ -7933,7 +8134,7 @@ static rtx cse_check_loop_start_value;
static void
cse_check_loop_start (x, set)
rtx x;
- rtx set;
+ rtx set ATTRIBUTE_UNUSED;
{
if (cse_check_loop_start_value == 0
|| GET_CODE (x) == CC0 || GET_CODE (x) == PC)
@@ -8470,7 +8671,7 @@ cse_basic_block (from, to, next_branch, around_loop)
{
register rtx insn;
int to_usage = 0;
- int in_libcall_block = 0;
+ rtx libcall_insn = NULL_RTX;
int num_insns = 0;
/* Each of these arrays is undefined before max_reg, so only allocate
@@ -8503,16 +8704,20 @@ cse_basic_block (from, to, next_branch, around_loop)
for (insn = from; insn != to; insn = NEXT_INSN (insn))
{
- register enum rtx_code code;
+ register enum rtx_code code = GET_CODE (insn);
int i;
struct table_elt *p, *next;
- /* If we have processed 1,000 insns, flush the hash table to avoid
- extreme quadratic behavior.
+ /* If we have processed 1,000 insns, flush the hash table to
+ avoid extreme quadratic behavior. We must not include NOTEs
+ in the count since there may be more or them when generating
+ debugging information. If we clear the table at different
+ times, code generated with -g -O might be different than code
+ generated with -O but not -g.
??? This is a real kludge and needs to be done some other way.
Perhaps for 2.9. */
- if (num_insns++ > 1000)
+ if (code != NOTE && num_insns++ > 1000)
{
for (i = 0; i < NBUCKETS; i++)
for (p = table[i]; p; p = next)
@@ -8551,12 +8756,13 @@ cse_basic_block (from, to, next_branch, around_loop)
}
}
- code = GET_CODE (insn);
if (GET_MODE (insn) == QImode)
PUT_MODE (insn, VOIDmode);
if (GET_RTX_CLASS (code) == 'i')
{
+ rtx p;
+
/* Process notes first so we have all notes in canonical forms when
looking for duplicate operations. */
@@ -8569,12 +8775,12 @@ cse_basic_block (from, to, next_branch, around_loop)
its destination is the result of the block and hence should be
recorded. */
- if (find_reg_note (insn, REG_LIBCALL, NULL_RTX))
- in_libcall_block = 1;
+ if ((p = find_reg_note (insn, REG_LIBCALL, NULL_RTX)))
+ libcall_insn = XEXP (p, 0);
else if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
- in_libcall_block = 0;
+ libcall_insn = NULL_RTX;
- cse_insn (insn, in_libcall_block);
+ cse_insn (insn, libcall_insn);
}
/* If INSN is now an unconditional jump, skip to the end of our
@@ -8710,7 +8916,13 @@ count_reg_usage (x, counts, dest, incr)
case CONST_DOUBLE:
case SYMBOL_REF:
case LABEL_REF:
- case CLOBBER:
+ return;
+
+ case CLOBBER:
+ /* If we are clobbering a MEM, mark any registers inside the address
+ as being used. */
+ if (GET_CODE (XEXP (x, 0)) == MEM)
+ count_reg_usage (XEXP (XEXP (x, 0), 0), counts, NULL_RTX, incr);
return;
case SET:
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 7c9500b2f21..b00b8467ec5 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -78,6 +78,8 @@ Boston, MA 02111-1307, USA. */
#include "reload.h"
#include "defaults.h"
#include "output.h" /* ASM_OUTPUT_SOURCE_LINE may refer to sdb functions. */
+#include "dbxout.h"
+#include "toplev.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
@@ -134,6 +136,13 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
+char *getpwd ();
+
+/* Typical USG systems don't have stab.h, and they also have
+ no use for DBX-format debugging info. */
+
+#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
+
static int flag_minimal_debug = MINIMAL_DEBUG;
/* Nonzero if we have actually used any of the GDB extensions
@@ -148,13 +157,6 @@ static int have_used_extensions = 0;
static int source_label_number = 1;
-char *getpwd ();
-
-/* Typical USG systems don't have stab.h, and they also have
- no use for DBX-format debugging info. */
-
-#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
-
#ifdef DEBUG_SYMS_TEXT
#define FORCE_TEXT text_section ();
#else
@@ -324,7 +326,9 @@ static void dbxout_function_end PROTO((void));
#endif
static void dbxout_typedefs PROTO((tree));
static void dbxout_type_index PROTO((tree));
+#if DBX_CONTIN_LENGTH > 0
static void dbxout_continue PROTO((void));
+#endif
static void dbxout_type_fields PROTO((tree));
static void dbxout_type_method_1 PROTO((tree, char *));
static void dbxout_type_methods PROTO((tree));
@@ -599,6 +603,7 @@ dbxout_type_index (type)
#endif
}
+#if DBX_CONTIN_LENGTH > 0
/* Continue a symbol-description that gets too big.
End one symbol table entry with a double-backslash
and start a new one, eventually producing something like
@@ -617,6 +622,7 @@ dbxout_continue ()
fprintf (asmfile, "%s \"", ASM_STABS_OP);
current_sym_nchars = 0;
}
+#endif /* DBX_CONTIN_LENGTH > 0 */
/* Subroutine of `dbxout_type'. Output the type fields of TYPE.
This must be a separate function because anonymous unions require
@@ -807,13 +813,7 @@ dbxout_type_methods (type)
{
static int warned;
if (!warned)
- {
warned = 1;
-#ifdef HAVE_TEMPLATES
- if (warn_template_debugging)
- warning ("dbx info for template class methods not yet supported");
-#endif
- }
return;
}
}
@@ -953,8 +953,18 @@ dbxout_range_type (type)
were defined to be sub-ranges of int. Unfortunately, this
does not allow us to distinguish true sub-ranges from integer
types. So, instead we define integer (non-sub-range) types as
- sub-ranges of themselves. */
- dbxout_type_index (type);
+ sub-ranges of themselves. This matters for Chill. If this isn't
+ a subrange type, then we want to define it in terms of itself.
+ However, in C, this may be an anonymous integer type, and we don't
+ want to emit debug info referring to it. Just calling
+ dbxout_type_index won't work anyways, because the type hasn't been
+ defined yet. We make this work for both cases by checked to see
+ whether this is a defined type, referring to it if it is, and using
+ 'int' otherwise. */
+ if (TYPE_SYMTAB_ADDRESS (type) != 0)
+ dbxout_type_index (type);
+ else
+ dbxout_type_index (integer_type_node);
}
if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
{
@@ -1269,6 +1279,20 @@ dbxout_type (type, full, show_arg_types)
break;
case ARRAY_TYPE:
+ /* Make arrays of packed bits look like bitstrings for chill. */
+ if (TYPE_PACKED (type) && use_gnu_debug_info_extensions)
+ {
+ have_used_extensions = 1;
+ fputs ("@s", asmfile);
+ fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
+ BITS_PER_UNIT * int_size_in_bytes (type));
+ fputc (';', asmfile);
+ fprintf (asmfile, "@S;");
+ putc ('S', asmfile);
+ CHARS (1);
+ dbxout_type (TYPE_DOMAIN (type), 0, 0);
+ break;
+ }
/* Output "a" followed by a range type definition
for the index type of the array
followed by a reference to the target-type.
@@ -1939,7 +1963,7 @@ dbxout_symbol_location (decl, type, suffix, home)
/* Don't mention a variable at all
if it was completely optimized into nothingness.
- If the decl was from an inline function, then it's rtl
+ If the decl was from an inline function, then its rtl
is not identically the rtl that was used in this
particular compilation. */
if (GET_CODE (home) == REG)
@@ -2272,7 +2296,21 @@ dbxout_parms (parms)
DBX_MEMPARM_STABS_LETTER);
}
- dbxout_type (DECL_ARG_TYPE (parms), 0, 0);
+ /* It is quite tempting to use:
+
+ dbxout_type (TREE_TYPE (parms), 0, 0);
+
+ as the next statement, rather than using DECL_ARG_TYPE(), so
+ that gcc reports the actual type of the parameter, rather
+ than the promoted type. This certainly makes GDB's life
+ easier, at least for some ports. The change is a bad idea
+ however, since GDB expects to be able access the type without
+ performing any conversions. So for example, if we were
+ passing a float to an unprototyped function, gcc will store a
+ double on the stack, but if we emit a stab saying the type is a
+ float, then gdb will only read in a single value, and this will
+ produce an erropneous value. */
+ dbxout_type (DECL_ARG_TYPE (parms), 0, 0);
current_sym_value = DEBUGGER_ARG_OFFSET (current_sym_value, addr);
dbxout_finish_symbol (parms);
}
@@ -2402,6 +2440,15 @@ dbxout_parms (parms)
current_sym_value = INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1));
current_sym_addr = 0;
+ /* Make a big endian correction if the mode of the type of the
+ parameter is not the same as the mode of the rtl. */
+ if (BYTES_BIG_ENDIAN
+ && TYPE_MODE (TREE_TYPE (parms)) != GET_MODE (DECL_RTL (parms))
+ && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms))) < UNITS_PER_WORD)
+ {
+ current_sym_value += UNITS_PER_WORD - GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms)));
+ }
+
FORCE_TEXT;
if (DECL_NAME (parms))
{
@@ -2666,4 +2713,4 @@ dbxout_function (decl)
dbxout_function_end ();
#endif
}
-#endif /* DBX_DEBUGGING_INFO */
+#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
diff --git a/gcc/demangle.h b/gcc/demangle.h
index 00f6a0c3bc0..1e1e705512a 100644
--- a/gcc/demangle.h
+++ b/gcc/demangle.h
@@ -87,4 +87,22 @@ cplus_mangle_opname PARAMS ((const char *opname, int options));
extern void
set_cplus_marker_for_demangling PARAMS ((int ch));
+extern void
+do_tlink PARAMS ((char **, char **));
+
+extern void
+collect_execute PARAMS ((char *, char **, char *));
+
+extern void
+collect_exit PARAMS ((int));
+
+extern int
+collect_wait PARAMS ((char *));
+
+extern void
+dump_file PARAMS ((char *));
+
+extern int
+file_exists PARAMS ((char *));
+
#endif /* DEMANGLE_H */
diff --git a/gcc/doprint.c b/gcc/doprint.c
index dc36254006e..e09e1988122 100644
--- a/gcc/doprint.c
+++ b/gcc/doprint.c
@@ -4,11 +4,6 @@
*/
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include "gansidecl.h"
#undef _doprnt
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 291f03c533f..40d6d93d64c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -40,7 +40,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "expr.h"
#include "except.h"
#include "dwarf2.h"
+#include "dwarf2out.h"
#include "toplev.h"
+#include "dyn-string.h"
/* We cannot use <assert.h> in GCC source, since that would include
GCC's assert.h, which may not be compatible with the host compiler. */
@@ -58,6 +60,9 @@ int
dwarf2out_do_frame ()
{
return (write_symbols == DWARF2_DEBUG
+#ifdef DWARF2_FRAME_INFO
+ || DWARF2_FRAME_INFO
+#endif
#ifdef DWARF2_UNWIND_INFO
|| (flag_exceptions && ! exceptions_via_longjmp)
#endif
@@ -274,7 +279,7 @@ static void dwarf2out_stack_adjust PROTO((rtx));
#ifndef ASM_OUTPUT_DWARF_DATA1
#define ASM_OUTPUT_DWARF_DATA1(FILE,VALUE) \
- fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, VALUE)
+ fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) (VALUE))
#endif
#ifndef ASM_OUTPUT_DWARF_DELTA1
@@ -341,6 +346,16 @@ static void dwarf2out_stack_adjust PROTO((rtx));
} while (0)
#endif
+/* ??? This macro takes an RTX in dwarfout.c and a string in dwarf2out.c.
+ We resolve the conflict by creating a new macro ASM_OUTPUT_DWARF2_ADDR_CONST
+ for ports that want to support both DWARF1 and DWARF2. This needs a better
+ solution. See also the comments in sparc/sp64-elf.h. */
+#ifdef ASM_OUTPUT_DWARF2_ADDR_CONST
+#undef ASM_OUTPUT_DWARF_ADDR_CONST
+#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,ADDR) \
+ ASM_OUTPUT_DWARF2_ADDR_CONST (FILE, ADDR)
+#endif
+
#ifndef ASM_OUTPUT_DWARF_ADDR_CONST
#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,ADDR) \
fprintf ((FILE), "\t%s\t%s", UNALIGNED_WORD_ASM_OP, (ADDR))
@@ -362,24 +377,24 @@ static void dwarf2out_stack_adjust PROTO((rtx));
#ifndef ASM_OUTPUT_DWARF_DATA2
#define ASM_OUTPUT_DWARF_DATA2(FILE,VALUE) \
- fprintf ((FILE), "\t%s\t0x%x", UNALIGNED_SHORT_ASM_OP, (unsigned) VALUE)
+ fprintf ((FILE), "\t%s\t0x%x", UNALIGNED_SHORT_ASM_OP, (unsigned) (VALUE))
#endif
#ifndef ASM_OUTPUT_DWARF_DATA4
#define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \
- fprintf ((FILE), "\t%s\t0x%x", UNALIGNED_INT_ASM_OP, (unsigned) VALUE)
+ fprintf ((FILE), "\t%s\t0x%x", UNALIGNED_INT_ASM_OP, (unsigned) (VALUE))
#endif
#ifndef ASM_OUTPUT_DWARF_DATA
#define ASM_OUTPUT_DWARF_DATA(FILE,VALUE) \
fprintf ((FILE), "\t%s\t0x%lx", UNALIGNED_OFFSET_ASM_OP, \
- (unsigned long) VALUE)
+ (unsigned long) (VALUE))
#endif
#ifndef ASM_OUTPUT_DWARF_ADDR_DATA
#define ASM_OUTPUT_DWARF_ADDR_DATA(FILE,VALUE) \
fprintf ((FILE), "\t%s\t0x%lx", UNALIGNED_WORD_ASM_OP, \
- (unsigned long) VALUE)
+ (unsigned long) (VALUE))
#endif
#ifndef ASM_OUTPUT_DWARF_DATA8
@@ -387,13 +402,13 @@ static void dwarf2out_stack_adjust PROTO((rtx));
do { \
if (WORDS_BIG_ENDIAN) \
{ \
- fprintf ((FILE), "\t%s\t0x%lx\n", UNALIGNED_INT_ASM_OP, HIGH_VALUE); \
- fprintf ((FILE), "\t%s\t0x%lx", UNALIGNED_INT_ASM_OP, LOW_VALUE);\
+ fprintf ((FILE), "\t%s\t0x%lx\n", UNALIGNED_INT_ASM_OP, (HIGH_VALUE));\
+ fprintf ((FILE), "\t%s\t0x%lx", UNALIGNED_INT_ASM_OP, (LOW_VALUE));\
} \
else \
{ \
- fprintf ((FILE), "\t%s\t0x%lx\n", UNALIGNED_INT_ASM_OP, LOW_VALUE);\
- fprintf ((FILE), "\t%s\t0x%lx", UNALIGNED_INT_ASM_OP, HIGH_VALUE); \
+ fprintf ((FILE), "\t%s\t0x%lx\n", UNALIGNED_INT_ASM_OP, (LOW_VALUE)); \
+ fprintf ((FILE), "\t%s\t0x%lx", UNALIGNED_INT_ASM_OP, (HIGH_VALUE)); \
} \
} while (0)
#endif
@@ -511,17 +526,19 @@ expand_builtin_dwarf_fp_regnum ()
#endif
/* Return a pointer to a copy of the section string name S with all
- attributes stripped off. */
+ attributes stripped off, and an asterisk prepended (for assemble_name). */
static inline char *
stripattributes (s)
char *s;
{
- char *stripped = xstrdup (s);
+ char *stripped = xmalloc (strlen (s) + 2);
char *p = stripped;
- while (*p && *p != ',')
- p++;
+ *p++ = '*';
+
+ while (*s && *s != ',')
+ *p++ = *s++;
*p = '\0';
return stripped;
@@ -625,24 +642,28 @@ expand_builtin_dwarf_reg_size (reg_tree, target)
}
else
{
+ /* Initialize last_end to be larger than any possible
+ DWARF_FRAME_REGNUM. */
+ int last_end = 0x7fffffff;
--n_ranges;
t = build_int_2 (ranges[n_ranges].size, 0);
- size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
- for (; n_ranges--; )
+ do
{
- if ((DWARF_FRAME_REGNUM (ranges[n_ranges].end)
- - DWARF_FRAME_REGNUM (ranges[n_ranges].beg))
- != ranges[n_ranges].end - ranges[n_ranges].beg)
+ int beg = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
+ int end = DWARF_FRAME_REGNUM (ranges[n_ranges].end);
+ if (beg < 0)
+ continue;
+ if (end >= last_end)
abort ();
- if (DWARF_FRAME_REGNUM (ranges[n_ranges].beg) >= size)
+ last_end = end;
+ if (end - beg != ranges[n_ranges].end - ranges[n_ranges].beg)
abort ();
- size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
- build_int_2 (DWARF_FRAME_REGNUM
- (ranges[n_ranges].end), 0)));
+ build_int_2 (end, 0)));
t = fold (build (COND_EXPR, integer_type_node, t2,
build_int_2 (ranges[n_ranges].size, 0), t));
}
+ while (--n_ranges > 0);
}
return expand_expr (t, target, Pmode, 0);
}
@@ -1206,7 +1227,12 @@ dwarf2out_frame_debug (insn)
label = dwarf2out_cfi_label ();
- insn = PATTERN (insn);
+ src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
+ if (src)
+ insn = XEXP (src, 0);
+ else
+ insn = PATTERN (insn);
+
/* Assume that in a PARALLEL prologue insn, only the first elt is
significant. Currently this is true. */
if (GET_CODE (insn) == PARALLEL)
@@ -1375,6 +1401,13 @@ dwarf2out_frame_debug (insn)
offset -= cfa_store_offset;
break;
+ /* Without an offset. */
+ case REG:
+ if (cfa_store_reg != REGNO (XEXP (dest, 0)))
+ abort();
+ offset = -cfa_store_offset;
+ break;
+
default:
abort ();
}
@@ -1621,6 +1654,11 @@ output_cfi (cfi, fde)
#endif
#endif
+/* If we aren't using crtstuff to run ctors, don't use it for EH. */
+#if !defined (HAS_INIT_SECTION) && !defined (INIT_SECTION_ASM_OP)
+#undef EH_FRAME_SECTION
+#endif
+
/* Output the call frame information used to used to record information
that relates to calculating the frame pointer, and records the
location of saved registers. */
@@ -1941,7 +1979,7 @@ dwarf2out_frame_finish ()
/* And now, the support for symbolic debugging information. */
#ifdef DWARF2_DEBUGGING_INFO
-extern char *getpwd ();
+extern char *getpwd PROTO((void));
/* NOTE: In the comments in this file, many references are made to
"Debugging Information Entries". This term is abbreviated as `DIE'
@@ -2361,7 +2399,7 @@ static tree dwarf_last_decl;
/* Forward declarations for functions defined in this file. */
-static void addr_const_to_string PROTO((char *, rtx));
+static void addr_const_to_string PROTO((dyn_string_t, rtx));
static char *addr_to_string PROTO((rtx));
static int is_pseudo_reg PROTO((rtx));
static tree type_main_variant PROTO((tree));
@@ -2370,7 +2408,9 @@ static char *dwarf_tag_name PROTO((unsigned));
static char *dwarf_attr_name PROTO((unsigned));
static char *dwarf_form_name PROTO((unsigned));
static char *dwarf_stack_op_name PROTO((unsigned));
+#if 0
static char *dwarf_type_encoding_name PROTO((unsigned));
+#endif
static tree decl_ultimate_origin PROTO((tree));
static tree block_ultimate_origin PROTO((tree));
static tree decl_class_context PROTO((tree));
@@ -2501,10 +2541,14 @@ static void add_type_attribute PROTO((dw_die_ref, tree, int, int,
dw_die_ref));
static char *type_tag PROTO((tree));
static tree member_declared_type PROTO((tree));
+#if 0
static char *decl_start_label PROTO((tree));
+#endif
static void gen_array_type_die PROTO((tree, dw_die_ref));
static void gen_set_type_die PROTO((tree, dw_die_ref));
+#if 0
static void gen_entry_point_die PROTO((tree, dw_die_ref));
+#endif
static void pend_type PROTO((tree));
static void output_pending_types_for_scope PROTO((dw_die_ref));
static void gen_inlined_enumeration_type_die PROTO((tree, dw_die_ref));
@@ -2620,9 +2664,9 @@ static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
#define ASM_NAME_TO_STRING(STR, NAME) \
do { \
if ((NAME)[0] == '*') \
- strcpy (STR, NAME+1); \
+ dyn_string_append (STR, NAME + 1); \
else \
- strcpy (STR, NAME); \
+ dyn_string_append (STR, NAME); \
} \
while (0)
#endif
@@ -2635,50 +2679,44 @@ static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
static void
addr_const_to_string (str, x)
- char *str;
+ dyn_string_t str;
rtx x;
{
char buf1[256];
- char buf2[256];
restart:
- str[0] = '\0';
switch (GET_CODE (x))
{
case PC:
if (flag_pic)
- strcat (str, ",");
+ dyn_string_append (str, ",");
else
abort ();
break;
case SYMBOL_REF:
- ASM_NAME_TO_STRING (buf1, XSTR (x, 0));
- strcat (str, buf1);
+ ASM_NAME_TO_STRING (str, XSTR (x, 0));
break;
case LABEL_REF:
ASM_GENERATE_INTERNAL_LABEL (buf1, "L", CODE_LABEL_NUMBER (XEXP (x, 0)));
- ASM_NAME_TO_STRING (buf2, buf1);
- strcat (str, buf2);
+ ASM_NAME_TO_STRING (str, buf1);
break;
case CODE_LABEL:
ASM_GENERATE_INTERNAL_LABEL (buf1, "L", CODE_LABEL_NUMBER (x));
- ASM_NAME_TO_STRING (buf2, buf1);
- strcat (str, buf2);
+ ASM_NAME_TO_STRING (str, buf1);
break;
case CONST_INT:
sprintf (buf1, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
- strcat (str, buf1);
+ dyn_string_append (str, buf1);
break;
case CONST:
/* This used to output parentheses around the expression, but that does
not work on the 386 (either ATT or BSD assembler). */
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
break;
case CONST_DOUBLE:
@@ -2693,7 +2731,7 @@ restart:
else
sprintf (buf1, HOST_WIDE_INT_PRINT_DEC,
CONST_DOUBLE_LOW (x));
- strcat (str, buf1);
+ dyn_string_append (str, buf1);
}
else
/* We can't handle floating point constants; PRINT_OPERAND must
@@ -2705,23 +2743,19 @@ restart:
/* Some assemblers need integer constants to appear last (eg masm). */
if (GET_CODE (XEXP (x, 0)) == CONST_INT)
{
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 1));
if (INTVAL (XEXP (x, 0)) >= 0)
- strcat (str, "+");
+ dyn_string_append (str, "+");
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
}
else
{
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
if (INTVAL (XEXP (x, 1)) >= 0)
- strcat (str, "+");
+ dyn_string_append (str, "+");
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 1));
}
break;
@@ -2732,28 +2766,22 @@ restart:
if (GET_CODE (x) != MINUS)
goto restart;
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
- strcat (str, "-");
+ addr_const_to_string (str, XEXP (x, 0));
+ dyn_string_append (str, "-");
if (GET_CODE (XEXP (x, 1)) == CONST_INT
&& INTVAL (XEXP (x, 1)) < 0)
{
- strcat (str, ASM_OPEN_PAREN);
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
- strcat (str, ASM_CLOSE_PAREN);
+ dyn_string_append (str, ASM_OPEN_PAREN);
+ addr_const_to_string (str, XEXP (x, 1));
+ dyn_string_append (str, ASM_CLOSE_PAREN);
}
else
- {
- addr_const_to_string (buf1, XEXP (x, 1));
- strcat (str, buf1);
- }
+ addr_const_to_string (str, XEXP (x, 1));
break;
case ZERO_EXTEND:
case SIGN_EXTEND:
- addr_const_to_string (buf1, XEXP (x, 0));
- strcat (str, buf1);
+ addr_const_to_string (str, XEXP (x, 0));
break;
default:
@@ -2768,9 +2796,16 @@ static char *
addr_to_string (x)
rtx x;
{
- char buf[1024];
- addr_const_to_string (buf, x);
- return xstrdup (buf);
+ dyn_string_t ds = dyn_string_new (256);
+ char *s;
+
+ addr_const_to_string (ds, x);
+
+ /* Return the dynamically allocated string, but free the
+ dyn_string_t itself. */
+ s = ds->s;
+ free (ds);
+ return s;
}
/* Test if rtl node points to a pseudo register. */
@@ -3467,6 +3502,7 @@ dwarf_stack_op_name (op)
/* Convert a DWARF type code into its string name. */
+#if 0
static char *
dwarf_type_encoding_name (enc)
register unsigned enc;
@@ -3493,6 +3529,7 @@ dwarf_type_encoding_name (enc)
return "DW_ATE_<unknown>";
}
}
+#endif
/* Determine the "ultimate origin" of a decl. The decl may be an inlined
instance of an inlined instance of a decl which is local to an inline
@@ -3504,24 +3541,14 @@ static tree
decl_ultimate_origin (decl)
register tree decl;
{
- register tree immediate_origin = DECL_ABSTRACT_ORIGIN (decl);
-
- if (immediate_origin == NULL_TREE)
- return NULL_TREE;
- else
- {
- register tree ret_val;
- register tree lookahead = immediate_origin;
-
- do
- {
- ret_val = lookahead;
- lookahead = DECL_ABSTRACT_ORIGIN (ret_val);
- }
- while (lookahead != NULL && lookahead != ret_val);
+#ifdef ENABLE_CHECKING
+ if (DECL_FROM_INLINE (DECL_ORIGIN (decl)))
+ /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
+ most distant ancestor, this should never happen. */
+ abort ();
+#endif
- return ret_val;
- }
+ return DECL_ABSTRACT_ORIGIN (decl);
}
/* Determine the "ultimate origin" of a block. The block may be an inlined
@@ -4433,29 +4460,18 @@ build_abbrev_table (die)
build_abbrev_table (c);
}
-/* Return the size of a string, including the null byte. */
+/* Return the size of a string, including the null byte.
+
+ This used to treat backslashes as escapes, and hence they were not included
+ in the count. However, that conflicts with what ASM_OUTPUT_ASCII does,
+ which treats a backslash as a backslash, escaping it if necessary, and hence
+ we must include them in the count. */
static unsigned long
size_of_string (str)
register char *str;
{
- register unsigned long size = 0;
- register unsigned long slen = strlen (str);
- register unsigned long i;
- register unsigned c;
-
- for (i = 0; i < slen; ++i)
- {
- c = str[i];
- if (c == '\\')
- ++i;
-
- size += 1;
- }
-
- /* Null terminator. */
- size += 1;
- return size;
+ return strlen (str) + 1;
}
/* Return the size of a location descriptor. */
@@ -5574,12 +5590,13 @@ output_aranges ()
ASM_COMMENT_START, 2 * PTR_SIZE);
fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_SECTION);
+ ASM_OUTPUT_DWARF_ADDR (asm_out_file, stripattributes (TEXT_SECTION));
if (flag_debug_asm)
fprintf (asm_out_file, "\t%s Address", ASM_COMMENT_START);
fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, text_end_label, TEXT_SECTION);
+ ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, text_end_label,
+ stripattributes (TEXT_SECTION));
if (flag_debug_asm)
fprintf (asm_out_file, "%s Length", ASM_COMMENT_START);
@@ -5764,14 +5781,14 @@ output_line_info ()
fputc ('\n', asm_out_file);
ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_SECTION);
+ ASM_OUTPUT_DWARF_ADDR (asm_out_file, stripattributes (TEXT_SECTION));
fputc ('\n', asm_out_file);
/* Generate the line number to PC correspondence table, encoded as
a series of state machine operations. */
current_file = 1;
current_line = 1;
- strcpy (prev_line_label, TEXT_SECTION);
+ strcpy (prev_line_label, stripattributes (TEXT_SECTION));
for (lt_index = 1; lt_index < line_info_table_in_use; ++lt_index)
{
register dw_line_info_ref line_info;
@@ -6172,7 +6189,7 @@ base_type_die (type)
base_type_result = new_die (DW_TAG_base_type, comp_unit_die);
add_AT_string (base_type_result, DW_AT_name, type_name);
add_AT_unsigned (base_type_result, DW_AT_byte_size,
- TYPE_PRECISION (type) / BITS_PER_UNIT);
+ int_size_in_bytes (type));
add_AT_unsigned (base_type_result, DW_AT_encoding, encoding);
return base_type_result;
@@ -7723,6 +7740,7 @@ member_declared_type (member)
/* Get the decl's label, as described by its RTL. This may be different
from the DECL_NAME name used in the source file. */
+#if 0
static char *
decl_start_label (decl)
register tree decl;
@@ -7740,6 +7758,7 @@ decl_start_label (decl)
fnname = XSTR (x, 0);
return fnname;
}
+#endif
/* These routines generate the internal representation of the DIE's for
the compilation unit. Debugging information is collected by walking
@@ -7814,6 +7833,7 @@ gen_set_type_die (type, context_die)
add_type_attribute (type_die, TREE_TYPE (type), 0, 0, context_die);
}
+#if 0
static void
gen_entry_point_die (decl, context_die)
register tree decl;
@@ -7835,6 +7855,7 @@ gen_entry_point_die (decl, context_die)
else
add_AT_lbl_id (decl_die, DW_AT_low_pc, decl_start_label (decl));
}
+#endif
/* Remember a type in the pending_types_list. */
@@ -8042,8 +8063,7 @@ gen_unspecified_parameters_die (decl_or_type, context_die)
register tree decl_or_type;
register dw_die_ref context_die;
{
- register dw_die_ref parm_die = new_die (DW_TAG_unspecified_parameters,
- context_die);
+ new_die (DW_TAG_unspecified_parameters, context_die);
}
/* Generate a list of nameless DW_TAG_formal_parameter DIEs (and perhaps a
@@ -8157,7 +8177,17 @@ gen_subprogram_die (decl, context_die)
= lookup_filename (DECL_SOURCE_FILE (decl));
if (get_AT_flag (old_die, DW_AT_declaration) != 1)
- abort ();
+ {
+ /* ??? This can happen if there is a bug in the program, for
+ instance, if it has duplicate function definitions. Ideally,
+ we should detect this case and ignore it. For now, if we have
+ already reported an error, any error at all, then assume that
+ we got here because of a input error, not a dwarf2 bug. */
+ extern int errorcount;
+ if (errorcount)
+ return;
+ abort ();
+ }
/* If the definition comes from the same place as the declaration,
maybe use the old DIE. We always want the DIE for this function
@@ -9178,7 +9208,7 @@ gen_block_die (stmt, context_die, depth)
}
/* Generate all of the decls declared within a given scope and (recursively)
- all of it's sub-blocks. */
+ all of its sub-blocks. */
static void
decls_for_scope (stmt, context_die, depth)
@@ -9404,7 +9434,7 @@ dwarf2out_decl (decl)
if (DECL_IGNORED_P (decl))
{
if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_INITIAL (decl) != NULL)
+ && DECL_INITIAL (decl) != NULL)
abort ();
return;
@@ -9667,7 +9697,7 @@ dwarf2out_line (filename, line)
void
dwarf2out_start_source_file (filename)
- register char *filename;
+ register char *filename ATTRIBUTE_UNUSED;
{
}
@@ -9702,8 +9732,8 @@ dwarf2out_define (lineno, buffer)
void
dwarf2out_undef (lineno, buffer)
- register unsigned lineno;
- register char *buffer;
+ register unsigned lineno ATTRIBUTE_UNUSED;
+ register char *buffer ATTRIBUTE_UNUSED;
{
}
@@ -9828,7 +9858,8 @@ dwarf2out_finish ()
was in .text. */
if (separate_line_info_table_in_use == 0)
{
- add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, TEXT_SECTION);
+ add_AT_lbl_id (comp_unit_die, DW_AT_low_pc,
+ stripattributes (TEXT_SECTION));
add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label);
}
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 566e6d290a3..660865b11d6 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "reload.h"
#include "output.h"
#include "defaults.h"
+#include "dwarfout.h"
#include "toplev.h"
#if defined(DWARF_TIMESTAMPS)
@@ -49,7 +50,7 @@ extern time_t time PROTO ((time_t *)); /* FIXME: use NEED_DECLARATION_TIME */
# define assert(e) do { if (! (e)) abort (); } while (0)
#endif
-extern char *getpwd ();
+extern char *getpwd PROTO((void));
/* IMPORTANT NOTE: Please see the file README.DWARF for important details
regarding the GNU implementation of Dwarf. */
@@ -313,8 +314,10 @@ static char *dwarf_fund_type_name PROTO((unsigned));
static tree decl_ultimate_origin PROTO((tree));
static tree block_ultimate_origin PROTO((tree));
static tree decl_class_context PROTO((tree));
+#if 0
static void output_unsigned_leb128 PROTO((unsigned long));
static void output_signed_leb128 PROTO((long));
+#endif
static inline int is_body_block PROTO((tree));
static int fundamental_type_code PROTO((tree));
static tree root_type_1 PROTO((tree, int));
@@ -359,7 +362,9 @@ static inline void body_begin_attribute PROTO((char *));
static inline void body_end_attribute PROTO((char *));
static inline void language_attribute PROTO((unsigned));
static inline void member_attribute PROTO((tree));
+#if 0
static inline void string_length_attribute PROTO((tree));
+#endif
static inline void comp_dir_attribute PROTO((char *));
static inline void sf_names_attribute PROTO((char *));
static inline void src_info_attribute PROTO((char *));
@@ -412,7 +417,7 @@ static void output_typedef_die PROTO((void *));
static void output_union_type_die PROTO((void *));
static void output_unspecified_parameters_die PROTO((void *));
static void output_padded_null_die PROTO((void *));
-static void output_die PROTO((void (*) (), void *));
+static void output_die PROTO((void (*) PROTO((void *)), void *));
static void end_sibling_chain PROTO((void));
static void output_formal_types PROTO((tree));
static void pend_type PROTO((tree));
@@ -428,6 +433,10 @@ static void generate_new_sfname_entry PROTO((void));
static unsigned lookup_filename PROTO((char *));
static void generate_srcinfo_entry PROTO((unsigned, unsigned));
static void generate_macinfo_entry PROTO((char *, char *));
+static int is_pseudo_reg PROTO((rtx));
+static tree type_main_variant PROTO((tree));
+static int is_tagged_type PROTO((tree));
+static int is_redundant_typedef PROTO((tree));
/* Definitions of defaults for assembler-dependent names of various
pseudo-ops and section names.
@@ -855,7 +864,7 @@ static void generate_macinfo_entry PROTO((char *, char *));
/************************ general utility functions **************************/
-inline int
+inline static int
is_pseudo_reg (rtl)
register rtx rtl;
{
@@ -864,7 +873,7 @@ is_pseudo_reg (rtl)
&& (REGNO (XEXP (rtl, 0)) >= FIRST_PSEUDO_REGISTER)));
}
-inline tree
+inline static tree
type_main_variant (type)
register tree type;
{
@@ -886,7 +895,7 @@ type_main_variant (type)
/* Return non-zero if the given type node represents a tagged type. */
-inline int
+inline static int
is_tagged_type (type)
register tree type;
{
@@ -1141,23 +1150,14 @@ static tree
decl_ultimate_origin (decl)
register tree decl;
{
- register tree immediate_origin = DECL_ABSTRACT_ORIGIN (decl);
-
- if (immediate_origin == NULL)
- return NULL;
- else
- {
- register tree ret_val;
- register tree lookahead = immediate_origin;
+#ifdef ENABLE_CHECKING
+ if (DECL_FROM_INLINE (DECL_ORIGIN (decl)))
+ /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
+ most distant ancestor, this should never happen. */
+ abort ();
+#endif
- do
- {
- ret_val = lookahead;
- lookahead = DECL_ABSTRACT_ORIGIN (ret_val);
- }
- while (lookahead != NULL && lookahead != ret_val);
- return ret_val;
- }
+ return DECL_ABSTRACT_ORIGIN (decl);
}
/* Determine the "ultimate origin" of a block. The block may be an
@@ -1212,6 +1212,7 @@ decl_class_context (decl)
return context;
}
+#if 0
static void
output_unsigned_leb128 (value)
register unsigned long value;
@@ -1265,6 +1266,7 @@ output_signed_leb128 (value)
}
while (more);
}
+#endif
/**************** utility functions for attribute functions ******************/
@@ -1410,7 +1412,16 @@ fundamental_type_code (type)
}
if (TYPE_PRECISION (type) == DOUBLE_TYPE_SIZE)
- return FT_dbl_prec_float;
+ {
+ /* On the SH, when compiling with -m3e or -m4-single-only, both
+ float and double are 32 bits. But since the debugger doesn't
+ know about the subtarget, it always thinks double is 64 bits.
+ So we have to tell the debugger that the type is float to
+ make the output of the 'print' command etc. readable. */
+ if (DOUBLE_TYPE_SIZE == FLOAT_TYPE_SIZE && FLOAT_TYPE_SIZE == 32)
+ return FT_float;
+ return FT_dbl_prec_float;
+ }
if (TYPE_PRECISION (type) == FLOAT_TYPE_SIZE)
return FT_float;
@@ -2870,6 +2881,7 @@ member_attribute (context)
}
}
+#if 0
static inline void
string_length_attribute (upper_bound)
register tree upper_bound;
@@ -2885,6 +2897,7 @@ string_length_attribute (upper_bound)
output_bound_representation (upper_bound, 0, 'u');
ASM_OUTPUT_LABEL (asm_out_file, end_label);
}
+#endif
static inline void
comp_dir_attribute (dirname)
@@ -3921,7 +3934,7 @@ output_unspecified_parameters_die (arg)
static void
output_padded_null_die (arg)
- register void *arg;
+ register void *arg ATTRIBUTE_UNUSED;
{
ASM_OUTPUT_ALIGN (asm_out_file, 2); /* 2**2 == 4 */
}
@@ -3936,7 +3949,7 @@ output_padded_null_die (arg)
static void
output_die (die_specific_output_function, param)
- register void (*die_specific_output_function)();
+ register void (*die_specific_output_function) PROTO ((void *));
register void *param;
{
char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
@@ -4647,7 +4660,7 @@ output_decls_for_scope (stmt, depth)
/* Is this a typedef we can avoid emitting? */
-inline int
+inline static int
is_redundant_typedef (decl)
register tree decl;
{
@@ -4988,7 +5001,7 @@ output_decl (decl, containing_scope)
function. */
{
- register void (*func) ();
+ register void (*func) PROTO((void *));
register tree origin = decl_ultimate_origin (decl);
if (origin != NULL && TREE_CODE (origin) == PARM_DECL)
@@ -5185,8 +5198,18 @@ dwarfout_file_scope_decl (decl, set_finalizing)
really need to output these (non-fundamental) types because other
DIEs may contain references to them. */
+ /* Also ignore language dependent types here, because they are probably
+ also built-in types. If we didn't ignore them, then we would get
+ references to undefined labels because output_type doesn't support
+ them. So, for now, we need to ignore them to avoid assembler
+ errors. */
+
+ /* ??? This code is different than the equivalent code in dwarf2out.c.
+ The dwarf2out.c code is probably more correct. */
+
if (DECL_SOURCE_LINE (decl) == 0
- && type_is_fundamental (TREE_TYPE (decl)))
+ && (type_is_fundamental (TREE_TYPE (decl))
+ || TREE_CODE (TREE_TYPE (decl)) == LANG_TYPE))
return;
/* If we are in terse mode, don't generate any DIEs to represent
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index da82ab02026..4ed85d57207 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -35,11 +35,6 @@ Boston, MA 02111-1307, USA. */
is the kind of rtx's they make and what arguments they use. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include "rtl.h"
#include "tree.h"
@@ -53,12 +48,14 @@ Boston, MA 02111-1307, USA. */
#include "recog.h"
#include "real.h"
#include "obstack.h"
+#include "bitmap.h"
#include "ggc.h"
/* Commonly used modes. */
enum machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
enum machine_mode word_mode; /* Mode whose width is BITS_PER_WORD. */
+enum machine_mode double_mode; /* Mode whose width is DOUBLE_TYPE_SIZE. */
enum machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */
/* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
@@ -107,6 +104,7 @@ struct _global_rtl global_rtl =
{REG}, /* virtual_stack_vars_rtx */
{REG}, /* virtual_stack_dynamic_rtx */
{REG}, /* virtual_outgoing_args_rtx */
+ {REG}, /* virtual_cfa_rtx */
};
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
@@ -278,6 +276,20 @@ gen_rtx_REG (mode, regno)
return gen_rtx_raw_REG (mode, regno);
}
+rtx
+gen_rtx_MEM (mode, addr)
+ enum machine_mode mode;
+ rtx addr;
+{
+ rtx rt = gen_rtx_raw_MEM (mode, addr);
+
+ /* This field is not cleared by the mere allocation of the rtx, so
+ we clear it here. */
+ MEM_ALIAS_SET (rt) = 0;
+
+ return rt;
+}
+
/* rtx gen_rtx (code, mode, [element1, ..., elementn])
**
** This routine generates an RTX of the size specified by
@@ -328,6 +340,8 @@ gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...))
rt_val = gen_rtx_CONST_INT (mode, va_arg (p, HOST_WIDE_INT));
else if (code == REG)
rt_val = gen_rtx_REG (mode, va_arg (p, int));
+ else if (code == MEM)
+ rt_val = gen_rtx_MEM (mode, va_arg (p, rtx));
else
{
rt_val = rtx_alloc (code); /* Allocate the storage space. */
@@ -362,6 +376,14 @@ gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...))
XVEC (rt_val, i) = va_arg (p, rtvec);
break;
+ case 'b': /* A bitmap? */
+ XBITMAP (rt_val, i) = va_arg (p, bitmap);
+ break;
+
+ case 't': /* A tree? */
+ XTREE (rt_val, i) = va_arg (p, tree);
+ break;
+
default:
abort ();
}
@@ -730,6 +752,9 @@ gen_lowpart_common (mode, x)
i = INTVAL (x);
r = REAL_VALUE_FROM_TARGET_SINGLE (i);
+ /* Avoid changing the bit pattern of a NaN. */
+ if (REAL_VALUE_ISNAN (r))
+ return 0;
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
}
#else
@@ -768,6 +793,8 @@ gen_lowpart_common (mode, x)
i[0] = low, i[1] = high;
r = REAL_VALUE_FROM_TARGET_DOUBLE (i);
+ if (REAL_VALUE_ISNAN (r))
+ return 0;
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
}
#else
@@ -3206,6 +3233,18 @@ gen_sequence ()
return result;
}
+/* Put the various virtual registers into REGNO_REG_RTX. */
+
+void
+init_virtual_regs ()
+{
+ regno_reg_rtx[VIRTUAL_INCOMING_ARGS_REGNUM] = virtual_incoming_args_rtx;
+ regno_reg_rtx[VIRTUAL_STACK_VARS_REGNUM] = virtual_stack_vars_rtx;
+ regno_reg_rtx[VIRTUAL_STACK_DYNAMIC_REGNUM] = virtual_stack_dynamic_rtx;
+ regno_reg_rtx[VIRTUAL_OUTGOING_ARGS_REGNUM] = virtual_outgoing_args_rtx;
+ regno_reg_rtx[VIRTUAL_CFA_REGNUM] = virtual_cfa_rtx;
+}
+
/* Initialize data structures and variables in this file
before generating rtl for each function. */
@@ -3242,10 +3281,7 @@ init_emit ()
bzero ((char *) regno_reg_rtx, regno_pointer_flag_length * sizeof (rtx));
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
- regno_reg_rtx[VIRTUAL_INCOMING_ARGS_REGNUM] = virtual_incoming_args_rtx;
- regno_reg_rtx[VIRTUAL_STACK_VARS_REGNUM] = virtual_stack_vars_rtx;
- regno_reg_rtx[VIRTUAL_STACK_DYNAMIC_REGNUM] = virtual_stack_dynamic_rtx;
- regno_reg_rtx[VIRTUAL_OUTGOING_ARGS_REGNUM] = virtual_outgoing_args_rtx;
+ init_virtual_regs ();
/* Indicate that the virtual registers and stack locations are
all pointers. */
@@ -3258,6 +3294,7 @@ init_emit ()
REGNO_POINTER_FLAG (VIRTUAL_STACK_VARS_REGNUM) = 1;
REGNO_POINTER_FLAG (VIRTUAL_STACK_DYNAMIC_REGNUM) = 1;
REGNO_POINTER_FLAG (VIRTUAL_OUTGOING_ARGS_REGNUM) = 1;
+ REGNO_POINTER_FLAG (VIRTUAL_CFA_REGNUM) = 1;
#ifdef STACK_BOUNDARY
REGNO_POINTER_ALIGN (STACK_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT;
@@ -3274,6 +3311,7 @@ init_emit ()
= STACK_BOUNDARY / BITS_PER_UNIT;
REGNO_POINTER_ALIGN (VIRTUAL_OUTGOING_ARGS_REGNUM)
= STACK_BOUNDARY / BITS_PER_UNIT;
+ REGNO_POINTER_ALIGN (VIRTUAL_CFA_REGNUM) = UNITS_PER_WORD;
#endif
#ifdef INIT_EXPANDERS
@@ -3317,6 +3355,7 @@ init_emit_once (line_numbers)
{
int i;
enum machine_mode mode;
+ enum machine_mode double_mode;
no_line_numbers = ! line_numbers;
@@ -3326,6 +3365,7 @@ init_emit_once (line_numbers)
byte_mode = VOIDmode;
word_mode = VOIDmode;
+ double_mode = VOIDmode;
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
@@ -3339,6 +3379,18 @@ init_emit_once (line_numbers)
word_mode = mode;
}
+#ifndef DOUBLE_TYPE_SIZE
+#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
+#endif
+
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ {
+ if (GET_MODE_BITSIZE (mode) == DOUBLE_TYPE_SIZE
+ && double_mode == VOIDmode)
+ double_mode = mode;
+ }
+
ptr_mode = mode_for_size (POINTER_SIZE, GET_MODE_CLASS (Pmode), 0);
/* Create the unique rtx's for certain rtx codes and operand values. */
@@ -3356,10 +3408,10 @@ init_emit_once (line_numbers)
else
const_true_rtx = gen_rtx_CONST_INT (VOIDmode, STORE_FLAG_VALUE);
- dconst0 = REAL_VALUE_ATOF ("0", DFmode);
- dconst1 = REAL_VALUE_ATOF ("1", DFmode);
- dconst2 = REAL_VALUE_ATOF ("2", DFmode);
- dconstm1 = REAL_VALUE_ATOF ("-1", DFmode);
+ dconst0 = REAL_VALUE_ATOF ("0", double_mode);
+ dconst1 = REAL_VALUE_ATOF ("1", double_mode);
+ dconst2 = REAL_VALUE_ATOF ("2", double_mode);
+ dconstm1 = REAL_VALUE_ATOF ("-1", double_mode);
for (i = 0; i <= 2; i++)
{
@@ -3420,6 +3472,8 @@ init_emit_once (line_numbers)
PUT_MODE (virtual_stack_dynamic_rtx, Pmode);
REGNO (virtual_outgoing_args_rtx) = VIRTUAL_OUTGOING_ARGS_REGNUM;
PUT_MODE (virtual_outgoing_args_rtx, Pmode);
+ REGNO (virtual_cfa_rtx) = VIRTUAL_CFA_REGNUM;
+ PUT_MODE (virtual_cfa_rtx, Pmode);
#ifdef RETURN_ADDRESS_POINTER_REGNUM
return_address_pointer_rtx
@@ -3475,6 +3529,7 @@ init_emit_once (line_numbers)
ggc_add_rtx_root (&struct_value_incoming_rtx, 1);
ggc_add_rtx_root (&static_chain_rtx, 1);
ggc_add_rtx_root (&static_chain_incoming_rtx, 1);
+ ggc_add_rtx_root (&return_address_pointer_rtx, 1);
ggc_add_rtx_root (&first_insn, 1);
ggc_add_tree_root (&sequence_rtl_expr, 1);
diff --git a/gcc/except.c b/gcc/except.c
index 2e365bbb6f4..17eb567b6a0 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -390,6 +390,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "defaults.h"
+#include "eh-common.h"
#include "system.h"
#include "rtl.h"
#include "tree.h"
@@ -443,6 +444,12 @@ rtx current_function_ehc;
static struct eh_stack ehstack;
+
+/* This stack is used to represent what the current eh region is
+ for the catch blocks beings processed */
+
+static struct eh_stack catchstack;
+
/* A queue used for tracking which exception regions have closed but
whose handlers have not yet been expanded. Regions are emitted in
groups in an attempt to improve paging performance.
@@ -484,6 +491,20 @@ struct label_node *outer_context_label_stack = NULL;
struct label_node *false_label_stack = NULL;
+/* Pseudos used to hold exception return data in the interim between
+ __builtin_eh_return and the end of the function. */
+
+static rtx eh_return_context;
+static rtx eh_return_stack_adjust;
+static rtx eh_return_handler;
+
+/* Used to mark the eh return stub for flow, so that the Right Thing
+ happens with the values for the hardregs therin. */
+
+rtx eh_return_stub_label;
+
+/* Prototypes for local functions. */
+
static void push_eh_entry PROTO((struct eh_stack *));
static struct eh_entry * pop_eh_entry PROTO((struct eh_stack *));
static void enqueue_eh_entry PROTO((struct eh_queue *, struct eh_entry *));
@@ -495,8 +516,11 @@ static void expand_rethrow PROTO((rtx));
static void output_exception_table_entry PROTO((FILE *, int));
static int can_throw PROTO((rtx));
static rtx scan_region PROTO((rtx, int, int *));
-static void eh_regs PROTO((rtx *, rtx *, int));
+static void eh_regs PROTO((rtx *, rtx *, rtx *, int));
static void set_insn_eh_region PROTO((rtx *, int));
+#ifdef DONT_USE_BUILTIN_SETJMP
+static void jumpif_rtx PROTO((rtx, rtx));
+#endif
rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
@@ -554,6 +578,20 @@ top_label_entry (stack)
return (*stack)->u.tlabel;
}
+/* get an exception label. These must be on the permanent obstack */
+
+rtx
+gen_exception_label ()
+{
+ rtx lab;
+
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+ lab = gen_label_rtx ();
+ pop_obstacks ();
+ return lab;
+}
+
/* Push a new eh_node entry onto STACK. */
static void
@@ -564,14 +602,28 @@ push_eh_entry (stack)
struct eh_entry *entry = (struct eh_entry *) xmalloc (sizeof (struct eh_entry));
entry->outer_context = gen_label_rtx ();
- entry->exception_handler_label = gen_label_rtx ();
entry->finalization = NULL_TREE;
+ entry->label_used = 0;
+ entry->exception_handler_label = gen_exception_label ();
+ entry->false_label = NULL_RTX;
node->entry = entry;
node->chain = stack->top;
stack->top = node;
}
+/* push an existing entry onto a stack. */
+static void
+push_entry (stack, entry)
+ struct eh_stack *stack;
+ struct eh_entry *entry;
+{
+ struct eh_node *node = (struct eh_node *) xmalloc (sizeof (struct eh_node));
+ node->entry = entry;
+ node->chain = stack->top;
+ stack->top = node;
+}
+
/* Pop an entry from the given STACK. */
static struct eh_entry *
@@ -632,6 +684,275 @@ dequeue_eh_entry (queue)
return tempentry;
}
+
+static void
+receive_exception_label (handler_label)
+ rtx handler_label;
+{
+ emit_label (handler_label);
+
+#ifdef HAVE_exception_receiver
+ if (! exceptions_via_longjmp)
+ if (HAVE_exception_receiver)
+ emit_insn (gen_exception_receiver ());
+#endif
+
+#ifdef HAVE_nonlocal_goto_receiver
+ if (! exceptions_via_longjmp)
+ if (HAVE_nonlocal_goto_receiver)
+ emit_insn (gen_nonlocal_goto_receiver ());
+#endif
+}
+
+
+struct func_eh_entry
+{
+ int range_number; /* EH region number from EH NOTE insn's */
+ struct handler_info *handlers;
+};
+
+
+/* table of function eh regions */
+static struct func_eh_entry *function_eh_regions = NULL;
+static int num_func_eh_entries = 0;
+static int current_func_eh_entry = 0;
+
+#define SIZE_FUNC_EH(X) (sizeof (struct func_eh_entry) * X)
+
+/* Add a new eh_entry for this function, and base it off of the information
+ in the EH_ENTRY parameter. A NULL parameter is invalid. The number
+ returned is an number which uniquely identifies this exception range. */
+
+int
+new_eh_region_entry (note_eh_region)
+ int note_eh_region;
+{
+ if (current_func_eh_entry == num_func_eh_entries)
+ {
+ if (num_func_eh_entries == 0)
+ {
+ function_eh_regions =
+ (struct func_eh_entry *) malloc (SIZE_FUNC_EH (50));
+ num_func_eh_entries = 50;
+ }
+ else
+ {
+ num_func_eh_entries = num_func_eh_entries * 3 / 2;
+ function_eh_regions = (struct func_eh_entry *)
+ realloc (function_eh_regions, SIZE_FUNC_EH (num_func_eh_entries));
+ }
+ }
+ function_eh_regions[current_func_eh_entry].range_number = note_eh_region;
+ function_eh_regions[current_func_eh_entry].handlers = NULL;
+
+ return current_func_eh_entry++;
+}
+
+/* Add new handler information to an exception range. The first parameter
+ specifies the range number (returned from new_eh_entry()). The second
+ parameter specifies the handler. By default the handler is inserted at
+ the end of the list. A handler list may contain only ONE NULL_TREE
+ typeinfo entry. Regardless where it is positioned, a NULL_TREE entry
+ is always output as the LAST handler in the exception table for a region. */
+
+void
+add_new_handler (region, newhandler)
+ int region;
+ struct handler_info *newhandler;
+{
+ struct handler_info *last;
+
+ newhandler->next = NULL;
+ last = function_eh_regions[region].handlers;
+ if (last == NULL)
+ function_eh_regions[region].handlers = newhandler;
+ else
+ {
+ for ( ; last->next != NULL; last = last->next)
+ ;
+ last->next = newhandler;
+ }
+}
+
+/* Remove a handler label. The handler label is being deleted, so all
+ regions which reference this handler should have it removed from their
+ list of possible handlers. Any region which has the final handler
+ removed can be deleted. */
+
+void remove_handler (removing_label)
+ rtx removing_label;
+{
+ struct handler_info *handler, *last;
+ int x;
+ for (x = 0 ; x < current_func_eh_entry; ++x)
+ {
+ last = NULL;
+ handler = function_eh_regions[x].handlers;
+ for ( ; handler; last = handler, handler = handler->next)
+ if (handler->handler_label == removing_label)
+ {
+ if (last)
+ {
+ last->next = handler->next;
+ handler = last;
+ }
+ else
+ function_eh_regions[x].handlers = handler->next;
+ }
+ }
+}
+
+/* This function will return a malloc'd pointer to an array of
+ void pointer representing the runtime match values that
+ currently exist in all regions. */
+
+int
+find_all_handler_type_matches (array)
+ void ***array;
+{
+ struct handler_info *handler, *last;
+ int x,y;
+ void *val;
+ void **ptr;
+ int max_ptr;
+ int n_ptr = 0;
+
+ *array = NULL;
+
+ if (!doing_eh (0) || ! flag_new_exceptions)
+ return 0;
+
+ max_ptr = 100;
+ ptr = (void **)malloc (max_ptr * sizeof (void *));
+
+ if (ptr == NULL)
+ return 0;
+
+ for (x = 0 ; x < current_func_eh_entry; x++)
+ {
+ last = NULL;
+ handler = function_eh_regions[x].handlers;
+ for ( ; handler; last = handler, handler = handler->next)
+ {
+ val = handler->type_info;
+ if (val != NULL && val != CATCH_ALL_TYPE)
+ {
+ /* See if this match value has already been found. */
+ for (y = 0; y < n_ptr; y++)
+ if (ptr[y] == val)
+ break;
+
+ /* If we break early, we already found this value. */
+ if (y < n_ptr)
+ continue;
+
+ /* Do we need to allocate more space? */
+ if (n_ptr >= max_ptr)
+ {
+ max_ptr += max_ptr / 2;
+ ptr = (void **)realloc (ptr, max_ptr * sizeof (void *));
+ if (ptr == NULL)
+ return 0;
+ }
+ ptr[n_ptr] = val;
+ n_ptr++;
+ }
+ }
+ }
+ *array = ptr;
+ return n_ptr;
+}
+
+/* Create a new handler structure initialized with the handler label and
+ typeinfo fields passed in. */
+
+struct handler_info *
+get_new_handler (handler, typeinfo)
+ rtx handler;
+ void *typeinfo;
+{
+ struct handler_info* ptr;
+ ptr = (struct handler_info *) malloc (sizeof (struct handler_info));
+ ptr->handler_label = handler;
+ ptr->type_info = typeinfo;
+ ptr->next = NULL;
+
+ return ptr;
+}
+
+
+
+/* Find the index in function_eh_regions associated with a NOTE region. If
+ the region cannot be found, a -1 is returned. This should never happen! */
+
+int
+find_func_region (insn_region)
+ int insn_region;
+{
+ int x;
+ for (x = 0; x < current_func_eh_entry; x++)
+ if (function_eh_regions[x].range_number == insn_region)
+ return x;
+
+ return -1;
+}
+
+/* Get a pointer to the first handler in an exception region's list. */
+
+struct handler_info *
+get_first_handler (region)
+ int region;
+{
+ return function_eh_regions[find_func_region (region)].handlers;
+}
+
+/* Clean out the function_eh_region table and free all memory */
+
+static void
+clear_function_eh_region ()
+{
+ int x;
+ struct handler_info *ptr, *next;
+ for (x = 0; x < current_func_eh_entry; x++)
+ for (ptr = function_eh_regions[x].handlers; ptr != NULL; ptr = next)
+ {
+ next = ptr->next;
+ free (ptr);
+ }
+ free (function_eh_regions);
+ num_func_eh_entries = 0;
+ current_func_eh_entry = 0;
+}
+
+/* Make a duplicate of an exception region by copying all the handlers
+ for an exception region. Return the new handler index. */
+
+int
+duplicate_handlers (old_note_eh_region, new_note_eh_region)
+ int old_note_eh_region, new_note_eh_region;
+{
+ struct handler_info *ptr, *new_ptr;
+ int new_region, region;
+
+ region = find_func_region (old_note_eh_region);
+ if (region == -1)
+ error ("Cannot duplicate non-existant exception region.");
+
+ if (find_func_region (new_note_eh_region) != -1)
+ error ("Cannot duplicate EH region because new note region already exists");
+
+ new_region = new_eh_region_entry (new_note_eh_region);
+ ptr = function_eh_regions[region].handlers;
+
+ for ( ; ptr; ptr = ptr->next)
+ {
+ new_ptr = get_new_handler (ptr->handler_label, ptr->type_info);
+ add_new_handler (new_region, new_ptr);
+ }
+
+ return new_region;
+}
+
/* Routine to see if exception handling is turned on.
DO_WARN is non-zero if we want to inform the user that exception
@@ -777,7 +1098,10 @@ get_dynamic_handler_chain ()
rtx ehc, dhc, result;
ehc = get_eh_context ();
- dhc = ehc;
+
+ /* This is the offset of dynamic_handler_chain in the eh_context struct
+ declared in eh-common.h. If its location is change, change this offset */
+ dhc = plus_constant (ehc, POINTER_SIZE / BITS_PER_UNIT);
result = copy_to_reg (dhc);
@@ -797,7 +1121,7 @@ get_dynamic_cleanup_chain ()
rtx dhc, dcc, result;
dhc = get_dynamic_handler_chain ();
- dcc = plus_constant (dhc, GET_MODE_SIZE (Pmode));
+ dcc = plus_constant (dhc, POINTER_SIZE / BITS_PER_UNIT);
result = copy_to_reg (dcc);
@@ -805,27 +1129,18 @@ get_dynamic_cleanup_chain ()
return gen_rtx_MEM (Pmode, result);
}
+#ifdef DONT_USE_BUILTIN_SETJMP
/* Generate code to evaluate X and jump to LABEL if the value is nonzero.
LABEL is an rtx of code CODE_LABEL, in this function. */
-void
+static void
jumpif_rtx (x, label)
rtx x;
rtx label;
{
jumpif (make_tree (type_for_mode (GET_MODE (x), 0), x), label);
}
-
-/* Generate code to evaluate X and jump to LABEL if the value is zero.
- LABEL is an rtx of code CODE_LABEL, in this function. */
-
-void
-jumpifnot_rtx (x, label)
- rtx x;
- rtx label;
-{
- jumpifnot (make_tree (type_for_mode (GET_MODE (x), 0), x), label);
-}
+#endif
/* Start a dynamic cleanup on the EH runtime dynamic cleanup stack.
We just need to create an element for the cleanup list, and push it
@@ -1119,6 +1434,9 @@ expand_eh_region_end (handler)
entry->finalization = handler;
+ /* create region entry in final exception table */
+ new_eh_region_entry (NOTE_BLOCK_NUMBER (note));
+
enqueue_eh_entry (&ehqueue, entry);
/* If we have already started ending the bindings, don't recurse.
@@ -1233,19 +1551,13 @@ expand_leftover_cleanups ()
abort ();
/* Output the label for the start of the exception handler. */
- emit_label (entry->exception_handler_label);
-#ifdef HAVE_exception_receiver
- if (! exceptions_via_longjmp)
- if (HAVE_exception_receiver)
- emit_insn (gen_exception_receiver ());
-#endif
+ receive_exception_label (entry->exception_handler_label);
-#ifdef HAVE_nonlocal_goto_receiver
- if (! exceptions_via_longjmp)
- if (HAVE_nonlocal_goto_receiver)
- emit_insn (gen_nonlocal_goto_receiver ());
-#endif
+ /* register a handler for this cleanup region */
+ add_new_handler (
+ find_func_region (CODE_LABEL_NUMBER (entry->exception_handler_label)),
+ get_new_handler (entry->exception_handler_label, NULL));
/* And now generate the insns for the handler. */
expand_expr (entry->finalization, const0_rtx, VOIDmode, 0);
@@ -1271,6 +1583,81 @@ expand_start_try_stmts ()
expand_eh_region_start ();
}
+/* Called to begin a catch clause. The parameter is the object which
+ will be passed to the runtime type check routine. */
+void
+start_catch_handler (rtime)
+ tree rtime;
+{
+ rtx handler_label;
+ int insn_region_num;
+ int eh_region_entry;
+
+ if (! doing_eh (1))
+ return;
+
+ handler_label = catchstack.top->entry->exception_handler_label;
+ insn_region_num = CODE_LABEL_NUMBER (handler_label);
+ eh_region_entry = find_func_region (insn_region_num);
+
+ /* If we've already issued this label, pick a new one */
+ if (catchstack.top->entry->label_used)
+ handler_label = gen_exception_label ();
+ else
+ catchstack.top->entry->label_used = 1;
+
+ receive_exception_label (handler_label);
+
+ add_new_handler (eh_region_entry, get_new_handler (handler_label, rtime));
+
+ if (flag_new_exceptions && ! exceptions_via_longjmp)
+ return;
+
+ /* Under the old mechanism, as well as setjmp/longjmp, we need to
+ issue code to compare 'rtime' to the value in eh_info, via the
+ matching function in eh_info. If its is false, we branch around
+ the handler we are about to issue. */
+
+ if (rtime != NULL_TREE && rtime != CATCH_ALL_TYPE)
+ {
+ rtx call_rtx, rtime_address;
+
+ if (catchstack.top->entry->false_label != NULL_RTX)
+ fatal ("Compiler Bug: Never issued previous false_label");
+ catchstack.top->entry->false_label = gen_exception_label ();
+
+ rtime_address = expand_expr (rtime, NULL_RTX, Pmode, EXPAND_INITIALIZER);
+ rtime_address = force_reg (Pmode, rtime_address);
+
+ /* Now issue the call, and branch around handler if needed */
+ call_rtx = emit_library_call_value (eh_rtime_match_libfunc, NULL_RTX,
+ 0, SImode, 1, rtime_address, Pmode);
+
+ /* Did the function return true? */
+ emit_cmp_insn (call_rtx, const0_rtx, EQ, NULL_RTX,
+ GET_MODE (call_rtx), 0 ,0);
+ emit_jump_insn (gen_beq (catchstack.top->entry->false_label));
+ }
+}
+
+/* Called to end a catch clause. If we aren't using the new exception
+ model tabel mechanism, we need to issue the branch-around label
+ for the end of the catch block. */
+
+void
+end_catch_handler ()
+{
+ if (! doing_eh (1) || (flag_new_exceptions && ! exceptions_via_longjmp))
+ return;
+
+ /* A NULL label implies the catch clause was a catch all or cleanup */
+ if (catchstack.top->entry->false_label == NULL_RTX)
+ return;
+
+ emit_label (catchstack.top->entry->false_label);
+ catchstack.top->entry->false_label = NULL_RTX;
+}
+
/* Generate RTL for the start of a group of catch clauses.
It is responsible for starting a new instruction sequence for the
@@ -1309,12 +1696,13 @@ expand_start_all_catch ()
the handlers in this handler-seq. */
start_sequence ();
- while (1)
+ entry = dequeue_eh_entry (&ehqueue);
+ for ( ; entry->finalization != integer_zero_node;
+ entry = dequeue_eh_entry (&ehqueue))
{
rtx prev;
- entry = dequeue_eh_entry (&ehqueue);
- /* Emit the label for the exception handler for this region, and
+ /* Emit the label for the cleanup handler for this region, and
expand the code for the handler.
Note that a catch region is handled as a side-effect here;
@@ -1323,29 +1711,15 @@ expand_start_all_catch ()
expand_expr call below. But, the label for the handler will
still be emitted, so any code emitted after this point will
end up being the handler. */
- emit_label (entry->exception_handler_label);
-
-#ifdef HAVE_exception_receiver
- if (! exceptions_via_longjmp)
- if (HAVE_exception_receiver)
- emit_insn (gen_exception_receiver ());
-#endif
-
-#ifdef HAVE_nonlocal_goto_receiver
- if (! exceptions_via_longjmp)
- if (HAVE_nonlocal_goto_receiver)
- emit_insn (gen_nonlocal_goto_receiver ());
-#endif
+
+ receive_exception_label (entry->exception_handler_label);
- /* When we get down to the matching entry for this try block, stop. */
- if (entry->finalization == integer_zero_node)
- {
- /* Don't forget to free this entry. */
- free (entry);
- break;
- }
+ /* register a handler for this cleanup region */
+ add_new_handler (
+ find_func_region (CODE_LABEL_NUMBER (entry->exception_handler_label)),
+ get_new_handler (entry->exception_handler_label, NULL));
- /* And now generate the insns for the handler. */
+ /* And now generate the insns for the cleanup handler. */
expand_expr (entry->finalization, const0_rtx, VOIDmode, 0);
prev = get_last_insn ();
@@ -1359,6 +1733,12 @@ expand_start_all_catch ()
free (entry);
}
+ /* At this point, all the cleanups are done, and the ehqueue now has
+ the current exception region at its head. We dequeue it, and put it
+ on the catch stack. */
+
+ push_entry (&catchstack, entry);
+
/* If we are not doing setjmp/longjmp EH, because we are reordered
out of line, we arrange to rethrow in the outer context. We need to
do this because we are not physically within the region, if any, that
@@ -1368,6 +1748,7 @@ expand_start_all_catch ()
expand_eh_region_start ();
ehstack.top->entry->outer_context = outer_context;
}
+
}
/* Finish up the catch block. At this point all the insns for the
@@ -1380,10 +1761,15 @@ void
expand_end_all_catch ()
{
rtx new_catch_clause, outer_context = NULL_RTX;
+ struct eh_entry *entry;
if (! doing_eh (1))
return;
+ /* Dequeue the current catch clause region. */
+ entry = pop_eh_entry (&catchstack);
+ free (entry);
+
if (! exceptions_via_longjmp)
{
outer_context = ehstack.top->entry->outer_context;
@@ -1497,15 +1883,16 @@ protect_with_terminate (e)
handler for the region. This is added by add_eh_table_entry and
used by output_exception_table_entry. */
-static int *eh_table;
-static int eh_table_size;
-static int eh_table_max_size;
+static int *eh_table = NULL;
+static int eh_table_size = 0;
+static int eh_table_max_size = 0;
/* Note the need for an exception table entry for region N. If we
don't need to output an explicit exception table, avoid all of the
extra work.
Called from final_scan_insn when a NOTE_INSN_EH_REGION_BEG is seen.
+ (Or NOTE_INSN_EH_REGION_END sometimes)
N is the NOTE_BLOCK_NUMBER of the note, which comes from the code
label number of the exception handler for the region. */
@@ -1563,24 +1950,64 @@ output_exception_table_entry (file, n)
{
char buf[256];
rtx sym;
+ struct handler_info *handler;
- ASM_GENERATE_INTERNAL_LABEL (buf, "LEHB", n);
- sym = gen_rtx_SYMBOL_REF (Pmode, buf);
- assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
+ handler = get_first_handler (n);
- ASM_GENERATE_INTERNAL_LABEL (buf, "LEHE", n);
- sym = gen_rtx_SYMBOL_REF (Pmode, buf);
- assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
+ for ( ; handler != NULL; handler = handler->next)
+ {
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LEHB", n);
+ sym = gen_rtx_SYMBOL_REF (Pmode, buf);
+ assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
- ASM_GENERATE_INTERNAL_LABEL (buf, "L", n);
- sym = gen_rtx_SYMBOL_REF (Pmode, buf);
- assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LEHE", n);
+ sym = gen_rtx_SYMBOL_REF (Pmode, buf);
+ assemble_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
+
+ assemble_integer (handler->handler_label,
+ POINTER_SIZE / BITS_PER_UNIT, 1);
- putc ('\n', file); /* blank line */
+ if (flag_new_exceptions)
+ {
+ if (handler->type_info == NULL)
+ assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+ else
+ if (handler->type_info == CATCH_ALL_TYPE)
+ assemble_integer (GEN_INT (CATCH_ALL_TYPE),
+ POINTER_SIZE / BITS_PER_UNIT, 1);
+ else
+ output_constant ((tree)(handler->type_info),
+ POINTER_SIZE / BITS_PER_UNIT);
+ }
+ putc ('\n', file); /* blank line */
+ /* We only output the first label under the old scheme */
+ if (! flag_new_exceptions)
+ break;
+ }
}
/* Output the exception table if we have and need one. */
+static short language_code = 0;
+static short version_code = 0;
+
+/* This routine will set the language code for exceptions. */
+void
+set_exception_lang_code (code)
+ int code;
+{
+ language_code = code;
+}
+
+/* This routine will set the language version code for exceptions. */
+void
+set_exception_version_code (code)
+ short code;
+{
+ version_code = code;
+}
+
+
void
output_exception_table ()
{
@@ -1596,15 +2023,35 @@ output_exception_table ()
assemble_align (GET_MODE_ALIGNMENT (ptr_mode));
assemble_label ("__EXCEPTION_TABLE__");
+ if (flag_new_exceptions)
+ {
+ assemble_integer (GEN_INT (NEW_EH_RUNTIME),
+ POINTER_SIZE / BITS_PER_UNIT, 1);
+ assemble_integer (GEN_INT (language_code), 2 , 1);
+ assemble_integer (GEN_INT (version_code), 2 , 1);
+
+ /* Add enough padding to make sure table aligns on a pointer boundry. */
+ i = GET_MODE_ALIGNMENT (ptr_mode) / BITS_PER_UNIT - 4;
+ for ( ; i < 0; i = i + GET_MODE_ALIGNMENT (ptr_mode) / BITS_PER_UNIT)
+ ;
+ if (i != 0)
+ assemble_integer (const0_rtx, i , 1);
+ }
+
for (i = 0; i < eh_table_size; ++i)
output_exception_table_entry (asm_out_file, eh_table[i]);
free (eh_table);
+ clear_function_eh_region ();
/* Ending marker for table. */
assemble_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
- assemble_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
- assemble_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+
+ /* for binary compatability, the old __throw checked the second
+ position for a -1, so we should output at least 2 -1's */
+ if (! flag_new_exceptions)
+ assemble_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+
putc ('\n', asm_out_file); /* blank line */
}
@@ -1663,9 +2110,6 @@ void
find_exception_handler_labels ()
{
rtx insn;
- int max_labelno = max_label_num ();
- int min_labelno = get_first_label_num ();
- rtx *labels;
exception_handler_labels = NULL_RTX;
@@ -1673,52 +2117,42 @@ find_exception_handler_labels ()
if (! doing_eh (0))
return;
- /* Generate a handy reference to each label. */
-
- /* We call xcalloc here instead of alloca; we did the latter in the past,
- but found that it can sometimes end up being asked to allocate space
- for more than 1 million labels. */
- labels = (rtx *) xcalloc ((max_labelno - min_labelno), sizeof (rtx));
-
- /* Arrange for labels to be indexed directly by CODE_LABEL_NUMBER. */
- labels -= min_labelno;
-
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- if (GET_CODE (insn) == CODE_LABEL)
- if (CODE_LABEL_NUMBER (insn) >= min_labelno
- && CODE_LABEL_NUMBER (insn) < max_labelno)
- labels[CODE_LABEL_NUMBER (insn)] = insn;
- }
-
/* For each start of a region, add its label to the list. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
+ struct handler_info* ptr;
if (GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
{
- rtx label = NULL_RTX;
-
- if (NOTE_BLOCK_NUMBER (insn) >= min_labelno
- && NOTE_BLOCK_NUMBER (insn) < max_labelno)
- {
- label = labels[NOTE_BLOCK_NUMBER (insn)];
-
- if (label)
- exception_handler_labels
- = gen_rtx_EXPR_LIST (VOIDmode,
- label, exception_handler_labels);
- else
- warning ("didn't find handler for EH region %d",
- NOTE_BLOCK_NUMBER (insn));
- }
- else
- warning ("mismatched EH region %d", NOTE_BLOCK_NUMBER (insn));
+ ptr = get_first_handler (NOTE_BLOCK_NUMBER (insn));
+ for ( ; ptr; ptr = ptr->next)
+ {
+ /* make sure label isn't in the list already */
+ rtx x;
+ for (x = exception_handler_labels; x; x = XEXP (x, 1))
+ if (XEXP (x, 0) == ptr->handler_label)
+ break;
+ if (! x)
+ exception_handler_labels = gen_rtx_EXPR_LIST (VOIDmode,
+ ptr->handler_label, exception_handler_labels);
+ }
}
}
+}
+
+/* Return a value of 1 if the parameter label number is an exception handler
+ label. Return 0 otherwise. */
- free (labels + min_labelno);
+int
+is_exception_handler_label (lab)
+ int lab;
+{
+ rtx x;
+ for (x = exception_handler_labels ; x ; x = XEXP (x, 1))
+ if (lab == CODE_LABEL_NUMBER (XEXP (x, 0)))
+ return 1;
+ return 0;
}
/* Perform sanity checking on the exception_handler_labels list.
@@ -1730,60 +2164,24 @@ find_exception_handler_labels ()
void
check_exception_handler_labels ()
{
- rtx insn, handler;
+ rtx insn, insn2;
/* If we aren't doing exception handling, there isn't much to check. */
if (! doing_eh (0))
return;
- /* Ensure that the CODE_LABEL_NUMBER for the CODE_LABEL entry point
- in each handler corresponds to the CODE_LABEL_NUMBER of the
- handler. */
-
- for (handler = exception_handler_labels;
- handler;
- handler = XEXP (handler, 1))
+ /* Make sure there is no more than 1 copy of a label */
+ for (insn = exception_handler_labels; insn; insn = XEXP (insn, 1))
{
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- if (GET_CODE (insn) == CODE_LABEL)
- {
- if (CODE_LABEL_NUMBER (insn)
- == CODE_LABEL_NUMBER (XEXP (handler, 0)))
- {
- if (insn != XEXP (handler, 0))
- warning ("mismatched handler %d",
- CODE_LABEL_NUMBER (insn));
- break;
- }
- }
- }
- if (insn == NULL_RTX)
- warning ("handler not found %d",
- CODE_LABEL_NUMBER (XEXP (handler, 0)));
+ int count = 0;
+ for (insn2 = exception_handler_labels; insn2; insn2 = XEXP (insn2, 1))
+ if (XEXP (insn, 0) == XEXP (insn2, 0))
+ count++;
+ if (count != 1)
+ warning ("Counted %d copies of EH region %d in list.\n", count,
+ CODE_LABEL_NUMBER (insn));
}
- /* Now go through and make sure that for each region there is a
- corresponding label. */
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- if (GET_CODE (insn) == NOTE
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
- {
- for (handler = exception_handler_labels;
- handler;
- handler = XEXP (handler, 1))
- {
- if (CODE_LABEL_NUMBER (XEXP (handler, 0))
- == NOTE_BLOCK_NUMBER (insn))
- break;
- }
- if (handler == NULL_RTX && !flag_syntax_only)
- warning ("region exists, no handler %d",
- NOTE_BLOCK_NUMBER (insn));
- }
- }
}
/* This group of functions initializes the exception handling data
@@ -1811,12 +2209,17 @@ void
init_eh_for_function ()
{
ehstack.top = 0;
+ catchstack.top = 0;
ehqueue.head = ehqueue.tail = 0;
catch_clauses = NULL_RTX;
false_label_stack = 0;
caught_return_label_stack = 0;
protect_list = NULL_TREE;
current_function_ehc = NULL_RTX;
+ eh_return_context = NULL_RTX;
+ eh_return_stack_adjust = NULL_RTX;
+ eh_return_handler = NULL_RTX;
+ eh_return_stub_label = NULL_RTX;
}
/* Save some of the per-function EH info into the save area denoted by
@@ -1832,6 +2235,7 @@ save_eh_status (p)
abort ();
p->ehstack = ehstack;
+ p->catchstack = catchstack;
p->ehqueue = ehqueue;
p->catch_clauses = catch_clauses;
p->false_label_stack = false_label_stack;
@@ -1859,6 +2263,7 @@ restore_eh_status (p)
catch_clauses = p->catch_clauses;
ehqueue = p->ehqueue;
ehstack = p->ehstack;
+ catchstack = p->catchstack;
current_function_ehc = p->ehc;
}
@@ -2017,6 +2422,10 @@ scan_region (insn, n, delete_outer)
delete_insn (start);
delete_insn (insn);
+/* We no longer removed labels here, since flow will now remove any
+ handler which cannot be called any more. */
+
+#if 0
/* Only do this part if we have built the exception handler
labels. */
if (exception_handler_labels)
@@ -2050,6 +2459,7 @@ scan_region (insn, n, delete_outer)
prev = &XEXP (x, 1);
}
}
+#endif
}
return insn;
}
@@ -2126,121 +2536,164 @@ expand_builtin_frob_return_addr (addr_tree)
return addr;
}
-/* Given an actual address in addr_tree, set the return address register up
- so the epilogue will return to that address. If the return address is
- not in a register, do nothing. */
-
-void
-expand_builtin_set_return_addr_reg (addr_tree)
- tree addr_tree;
-{
- rtx tmp;
- rtx ra = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
- 0, hard_frame_pointer_rtx);
-
- if (GET_CODE (ra) != REG || REGNO (ra) >= FIRST_PSEUDO_REGISTER)
- return;
+/* Choose three registers for communication between the main body of
+ __throw and the epilogue (or eh stub) and the exception handler.
+ We must do this with hard registers because the epilogue itself
+ will be generated after reload, at which point we may not reference
+ pseudos at all.
- tmp = force_operand (expand_builtin_frob_return_addr (addr_tree), ra);
- if (tmp != ra)
- emit_move_insn (ra, tmp);
-}
+ The first passes the exception context to the handler. For this
+ we use the return value register for a void*.
-/* Choose two registers for communication between the main body of
- __throw and the stub for adjusting the stack pointer. The first register
- is used to pass the address of the exception handler; the second register
- is used to pass the stack pointer offset.
+ The second holds the stack pointer value to be restored. For
+ this we use the static chain register if it exists and is different
+ from the previous, otherwise some arbitrary call-clobbered register.
- For register 1 we use the return value register for a void *.
- For register 2 we use the static chain register if it exists and is
- different from register 1, otherwise some arbitrary call-clobbered
- register. */
+ The third holds the address of the handler itself. Here we use
+ some arbitrary call-clobbered register. */
static void
-eh_regs (r1, r2, outgoing)
- rtx *r1, *r2;
+eh_regs (pcontext, psp, pra, outgoing)
+ rtx *pcontext, *psp, *pra;
int outgoing;
{
- rtx reg1, reg2;
+ rtx rcontext, rsp, rra;
+ int i;
#ifdef FUNCTION_OUTGOING_VALUE
if (outgoing)
- reg1 = FUNCTION_OUTGOING_VALUE (build_pointer_type (void_type_node),
- current_function_decl);
+ rcontext = FUNCTION_OUTGOING_VALUE (build_pointer_type (void_type_node),
+ current_function_decl);
else
#endif
- reg1 = FUNCTION_VALUE (build_pointer_type (void_type_node),
- current_function_decl);
+ rcontext = FUNCTION_VALUE (build_pointer_type (void_type_node),
+ current_function_decl);
#ifdef STATIC_CHAIN_REGNUM
if (outgoing)
- reg2 = static_chain_incoming_rtx;
+ rsp = static_chain_incoming_rtx;
else
- reg2 = static_chain_rtx;
- if (REGNO (reg2) == REGNO (reg1))
+ rsp = static_chain_rtx;
+ if (REGNO (rsp) == REGNO (rcontext))
#endif /* STATIC_CHAIN_REGNUM */
- reg2 = NULL_RTX;
+ rsp = NULL_RTX;
- if (reg2 == NULL_RTX)
+ if (rsp == NULL_RTX)
{
- int i;
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
- if (call_used_regs[i] && ! fixed_regs[i] && i != REGNO (reg1))
- {
- reg2 = gen_rtx_REG (Pmode, i);
- break;
- }
+ if (call_used_regs[i] && ! fixed_regs[i] && i != REGNO (rcontext))
+ break;
+ if (i == FIRST_PSEUDO_REGISTER)
+ abort();
- if (reg2 == NULL_RTX)
- abort ();
+ rsp = gen_rtx_REG (Pmode, i);
}
- *r1 = reg1;
- *r2 = reg2;
-}
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
+ if (call_used_regs[i] && ! fixed_regs[i]
+ && i != REGNO (rcontext) && i != REGNO (rsp))
+ break;
+ if (i == FIRST_PSEUDO_REGISTER)
+ abort();
-/* Emit inside of __throw a stub which adjusts the stack pointer and jumps
- to the exception handler. __throw will set up the necessary values
- and then return to the stub. */
+ rra = gen_rtx_REG (Pmode, i);
-rtx
-expand_builtin_eh_stub ()
-{
- rtx stub_start = gen_label_rtx ();
- rtx after_stub = gen_label_rtx ();
- rtx handler, offset;
+ *pcontext = rcontext;
+ *psp = rsp;
+ *pra = rra;
+}
- emit_jump (after_stub);
- emit_label (stub_start);
+/* Retrieve the register which contains the pointer to the eh_context
+ structure set the __throw. */
- eh_regs (&handler, &offset, 0);
+rtx
+get_reg_for_handler ()
+{
+ rtx reg1;
+ reg1 = FUNCTION_VALUE (build_pointer_type (void_type_node),
+ current_function_decl);
+ return reg1;
+}
- adjust_stack (offset);
- emit_indirect_jump (handler);
+/* Set up the epilogue with the magic bits we'll need to return to the
+ exception handler. */
- emit_label (after_stub);
- return gen_rtx_LABEL_REF (Pmode, stub_start);
+void
+expand_builtin_eh_return (context, stack, handler)
+ tree context, stack, handler;
+{
+ if (eh_return_context)
+ error("Duplicate call to __builtin_eh_return");
+
+ eh_return_context
+ = copy_to_reg (expand_expr (context, NULL_RTX, VOIDmode, 0));
+ eh_return_stack_adjust
+ = copy_to_reg (expand_expr (stack, NULL_RTX, VOIDmode, 0));
+ eh_return_handler
+ = copy_to_reg (expand_expr (handler, NULL_RTX, VOIDmode, 0));
}
-/* Set up the registers for passing the handler address and stack offset
- to the stub above. */
-
void
-expand_builtin_set_eh_regs (handler, offset)
- tree handler, offset;
+expand_eh_return ()
{
- rtx reg1, reg2;
+ rtx reg1, reg2, reg3;
+ rtx stub_start, after_stub;
+ rtx ra, tmp;
- eh_regs (&reg1, &reg2, 1);
+ if (!eh_return_context)
+ return;
+
+ eh_regs (&reg1, &reg2, &reg3, 1);
+ emit_move_insn (reg1, eh_return_context);
+ emit_move_insn (reg2, eh_return_stack_adjust);
+ emit_move_insn (reg3, eh_return_handler);
- store_expr (offset, reg2, 0);
- store_expr (handler, reg1, 0);
+ /* Talk directly to the target's epilogue code when possible. */
- /* These will be used by the stub. */
+#ifdef HAVE_eh_epilogue
+ if (HAVE_eh_epilogue)
+ {
+ emit_insn (gen_eh_epilogue (reg1, reg2, reg3));
+ return;
+ }
+#endif
+
+ /* Otherwise, use the same stub technique we had before. */
+
+ eh_return_stub_label = stub_start = gen_label_rtx ();
+ after_stub = gen_label_rtx ();
+
+ /* Set the return address to the stub label. */
+
+ ra = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
+ 0, hard_frame_pointer_rtx);
+ if (GET_CODE (ra) == REG && REGNO (ra) >= FIRST_PSEUDO_REGISTER)
+ abort();
+
+ tmp = memory_address (Pmode, gen_rtx_LABEL_REF (Pmode, stub_start));
+#ifdef RETURN_ADDR_OFFSET
+ tmp = plus_constant (tmp, -RETURN_ADDR_OFFSET);
+#endif
+ emit_move_insn (ra, tmp);
+
+ /* Indicate that the registers are in fact used. */
emit_insn (gen_rtx_USE (VOIDmode, reg1));
emit_insn (gen_rtx_USE (VOIDmode, reg2));
-}
+ emit_insn (gen_rtx_USE (VOIDmode, reg3));
+ if (GET_CODE (ra) == REG)
+ emit_insn (gen_rtx_USE (VOIDmode, ra));
+
+ /* Generate the stub. */
+
+ emit_jump (after_stub);
+ emit_label (stub_start);
+
+ eh_regs (&reg1, &reg2, &reg3, 0);
+ adjust_stack (reg2);
+ emit_indirect_jump (reg3);
+ emit_label (after_stub);
+}
/* This contains the code required to verify whether arbitrary instructions
@@ -2279,7 +2732,8 @@ set_insn_eh_region (first, region_num)
/* Free the insn table, an make sure it cannot be used again. */
-void free_insn_eh_region ()
+void
+free_insn_eh_region ()
{
if (!doing_eh (0))
return;
@@ -2295,7 +2749,8 @@ void free_insn_eh_region ()
this routine. If it is unavailable, passing a value of 0 will
cause this routine to calculate it as well. */
-void init_insn_eh_region (first, max_uid)
+void
+init_insn_eh_region (first, max_uid)
rtx first;
int max_uid;
{
@@ -2321,8 +2776,9 @@ void init_insn_eh_region (first, max_uid)
/* Check whether 2 instructions are within the same region. */
-int in_same_eh_region(insn1, insn2)
- rtx insn1,insn2;
+int
+in_same_eh_region (insn1, insn2)
+ rtx insn1, insn2;
{
int ret, uid1, uid2;
diff --git a/gcc/except.h b/gcc/except.h
index 0356bd398e9..540044bde02 100644
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -19,11 +19,15 @@ 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. */
-
-#ifndef GET_CODE
-#define rtx int *
+#if !defined(NULL_RTX) && !defined(rtx)
+typedef struct rtx_def *_except_rtx;
+#define rtx _except_rtx
#endif
+/* The label generated by expand_builtin_eh_return. */
+
+extern rtx eh_return_stub_label;
+
#ifdef TREE_CODE
/* A stack of labels. CHAIN points to the next entry in the stack. */
@@ -43,6 +47,14 @@ struct label_node {
EXCEPTION_HANDLER_LABEL is the label corresponding to the handler
for this region.
+ LABEL_USED indicates whether a CATCH block has already used this
+ label or not. New ones are needed for additional catch blocks if
+ it has.
+
+ FALSE_LABEL is used when either setjmp/longjmp exceptions are in
+ use, or old style table exceptions. It contains the label for
+ branching to the next runtime type check as handlers are processed.
+
FINALIZATION is the tree codes for the handler, or is NULL_TREE if
one hasn't been generated yet, or is integer_zero_node to mark the
end of a group of try blocks. */
@@ -50,8 +62,9 @@ struct label_node {
struct eh_entry {
rtx outer_context;
rtx exception_handler_label;
-
tree finalization;
+ int label_used;
+ rtx false_label;
};
/* A list of EH_ENTRYs. ENTRY is the entry; CHAIN points to the next
@@ -78,7 +91,6 @@ struct eh_queue {
struct eh_node *tail;
};
-
/* Start an exception handling region. All instructions emitted after
this point are considered to be part of the region until
expand_eh_region_end () is invoked. */
@@ -139,19 +151,99 @@ extern rtx catch_clauses;
#endif
+/* Test: is exception handling turned on? */
+
+extern int doing_eh PROTO ((int));
+
/* Toplevel initialization for EH. */
+void set_exception_lang_code PROTO((int));
+void set_exception_version_code PROTO((int));
+
+/* A list of handlers asocciated with an exception region. HANDLER_LABEL
+ is the the label that control should be transfered to if the data
+ in TYPE_INFO matches an exception. a value of NULL_TREE for TYPE_INFO
+ means This is a cleanup, and must always be called. A value of
+ CATCH_ALL_TYPE works like a cleanup, but a call to the runtime matcher
+ is still performed to avoid being caught by a different language
+ exception. NEXT is a pointer to the next handler for this region.
+ NULL means there are no more. */
+
+typedef struct handler_info
+{
+ rtx handler_label;
+ void *type_info;
+ struct handler_info *next;
+} handler_info;
+
+
+/* Add a new eh_entry for this function, The parameter specifies what
+ exception region number NOTE insns use to delimit this range.
+ The integer returned is uniquely identifies this exception range
+ within an internal table. */
+
+int new_eh_region_entry PROTO((int));
+
+/* Add new handler information to an exception range. The first parameter
+ specifies the range number (returned from new_eh_entry()). The second
+ parameter specifies the handler. By default the handler is inserted at
+ the end of the list. A handler list may contain only ONE NULL_TREE
+ typeinfo entry. Regardless where it is positioned, a NULL_TREE entry
+ is always output as the LAST handler in the exception table for a region. */
+
+void add_new_handler PROTO((int, struct handler_info *));
+
+/* Remove a handler label. The handler label is being deleted, so all
+ regions which reference this handler should have it removed from their
+ list of possible handlers. Any region which has the final handler
+ removed can be deleted. */
+
+void remove_handler PROTO((rtx));
+
+/* Create a new handler structure initialized with the handler label and
+ typeinfo fields passed in. */
+
+struct handler_info *get_new_handler PROTO((rtx, void *));
+
+/* Make a duplicate of an exception region by copying all the handlers
+ for an exception region. Return the new handler index. */
+
+int duplicate_handlers PROTO((int, int));
+
+
+/* Get a pointer to the first handler in an exception region's list. */
+
+struct handler_info *get_first_handler PROTO((int));
+
+/* Find all the runtime handlers type matches currently referenced */
+
+int find_all_handler_type_matches PROTO((void ***));
+
extern void init_eh PROTO((void));
/* Initialization for the per-function EH data. */
extern void init_eh_for_function PROTO((void));
+/* Generate an exception label. Use instead of gen_label_rtx */
+
+extern rtx gen_exception_label PROTO((void));
+
/* Adds an EH table entry for EH entry number N. Called from
final_scan_insn for NOTE_INSN_EH_REGION_BEG. */
extern void add_eh_table_entry PROTO((int n));
+/* Start a catch clause, triggered by runtime value paramter. */
+
+#ifdef TREE_CODE
+extern void start_catch_handler PROTO((tree));
+#endif
+
+/* End an individual catch clause. */
+
+extern void end_catch_handler PROTO((void));
+
/* Returns a non-zero value if we need to output an exception table. */
extern int exception_table_p PROTO((void));
@@ -206,21 +298,15 @@ extern void expand_leftover_cleanups PROTO((void));
extern void emit_eh_context PROTO((void));
-/* If necessary, emit insns for the start of per-function unwinder for
- the current function. */
-
-extern void emit_unwinder PROTO((void));
-
-/* If necessary, emit insns for the end of the per-function unwinder
- for the current function. */
-
-extern void end_eh_unwinder PROTO((void));
-
/* Builds a list of handler labels and puts them in the global
variable exception_handler_labels. */
extern void find_exception_handler_labels PROTO((void));
+/* Determine if an arbitrary label is an exception label */
+
+extern int is_exception_handler_label PROTO((int));
+
/* Performs sanity checking on the check_exception_handler_labels
list. */
@@ -280,18 +366,22 @@ extern int protect_cleanup_actions_with_terminate;
extern tree protect_with_terminate PROTO((tree));
#endif
+extern void expand_fixup_region_start PROTO((void));
+#ifdef TREE_CODE
+extern void expand_fixup_region_end PROTO((tree));
+#endif
+
/* Various hooks for the DWARF 2 __throw routine. */
void expand_builtin_unwind_init PROTO((void));
rtx expand_builtin_dwarf_fp_regnum PROTO((void));
-rtx expand_builtin_eh_stub PROTO((void));
#ifdef TREE_CODE
rtx expand_builtin_frob_return_addr PROTO((tree));
rtx expand_builtin_extract_return_addr PROTO((tree));
-void expand_builtin_set_return_addr_reg PROTO((tree));
-void expand_builtin_set_eh_regs PROTO((tree, tree));
rtx expand_builtin_dwarf_reg_size PROTO((tree, rtx));
+void expand_builtin_eh_return PROTO((tree, tree, tree));
#endif
+void expand_eh_return PROTO((void));
/* Checking whether 2 instructions are within the same exception region. */
@@ -299,3 +389,7 @@ rtx expand_builtin_dwarf_reg_size PROTO((tree, rtx));
int in_same_eh_region PROTO((rtx, rtx));
void free_insn_eh_region PROTO((void));
void init_insn_eh_region PROTO((rtx, int));
+
+#ifdef rtx
+#undef rtx
+#endif
diff --git a/gcc/explow.c b/gcc/explow.c
index 15663c1cfb4..58d4ebd9757 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -592,6 +592,11 @@ stabilize (x)
MEM_IN_STRUCT_P (mem) = MEM_IN_STRUCT_P (x) || GET_CODE (addr) == PLUS;
RTX_UNCHANGING_P (mem) = RTX_UNCHANGING_P (x);
MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (x);
+
+ /* Since the new MEM is just like the old X, it can alias only
+ the things that X could. */
+ MEM_ALIAS_SET (mem) = MEM_ALIAS_SET (x);
+
return mem;
}
return x;
@@ -866,8 +871,8 @@ emit_stack_save (save_level, psave, after)
{
rtx sa = *psave;
/* The default is that we use a move insn and save in a Pmode object. */
- rtx (*fcn) () = gen_move_insn;
- enum machine_mode mode = Pmode;
+ rtx (*fcn) PROTO ((rtx, rtx)) = gen_move_insn;
+ enum machine_mode mode = STACK_SAVEAREA_MODE (save_level);
/* See if this machine has anything special to do for this kind of save. */
switch (save_level)
@@ -875,28 +880,19 @@ emit_stack_save (save_level, psave, after)
#ifdef HAVE_save_stack_block
case SAVE_BLOCK:
if (HAVE_save_stack_block)
- {
- fcn = gen_save_stack_block;
- mode = insn_operand_mode[CODE_FOR_save_stack_block][0];
- }
+ fcn = gen_save_stack_block;
break;
#endif
#ifdef HAVE_save_stack_function
case SAVE_FUNCTION:
if (HAVE_save_stack_function)
- {
- fcn = gen_save_stack_function;
- mode = insn_operand_mode[CODE_FOR_save_stack_function][0];
- }
+ fcn = gen_save_stack_function;
break;
#endif
#ifdef HAVE_save_stack_nonlocal
case SAVE_NONLOCAL:
if (HAVE_save_stack_nonlocal)
- {
- fcn = gen_save_stack_nonlocal;
- mode = insn_operand_mode[(int) CODE_FOR_save_stack_nonlocal][0];
- }
+ fcn = gen_save_stack_nonlocal;
break;
#endif
default:
@@ -957,7 +953,7 @@ emit_stack_restore (save_level, sa, after)
rtx sa;
{
/* The default is that we use a move insn. */
- rtx (*fcn) () = gen_move_insn;
+ rtx (*fcn) PROTO ((rtx, rtx)) = gen_move_insn;
/* See if this machine has anything special to do for this kind of save. */
switch (save_level)
@@ -975,7 +971,6 @@ emit_stack_restore (save_level, sa, after)
break;
#endif
#ifdef HAVE_restore_stack_nonlocal
-
case SAVE_NONLOCAL:
if (HAVE_restore_stack_nonlocal)
fcn = gen_restore_stack_nonlocal;
@@ -1243,13 +1238,12 @@ allocate_dynamic_stack_space (size, target, known_align)
#ifdef HAVE_allocate_stack
if (HAVE_allocate_stack)
{
- enum machine_mode mode;
+ enum machine_mode mode = STACK_SIZE_MODE;
if (insn_operand_predicate[(int) CODE_FOR_allocate_stack][0]
&& ! ((*insn_operand_predicate[(int) CODE_FOR_allocate_stack][0])
(target, Pmode)))
target = copy_to_mode_reg (Pmode, target);
- mode = insn_operand_mode[(int) CODE_FOR_allocate_stack][1];
size = convert_modes (mode, ptr_mode, size, 1);
if (insn_operand_predicate[(int) CODE_FOR_allocate_stack][1]
&& ! ((*insn_operand_predicate[(int) CODE_FOR_allocate_stack][1])
@@ -1271,9 +1265,9 @@ allocate_dynamic_stack_space (size, target, known_align)
{
rtx note_target = get_last_insn ();
- REG_NOTES (note_target) = gen_rtx (EXPR_LIST, REG_SAVE_AREA,
- setjmpless_size,
- REG_NOTES (note_target));
+ REG_NOTES (note_target)
+ = gen_rtx_EXPR_LIST (REG_SAVE_AREA, setjmpless_size,
+ REG_NOTES (note_target));
}
#endif /* SETJMP_VIA_SAVE_AREA */
#ifdef STACK_GROWS_DOWNWARD
diff --git a/gcc/expmed.c b/gcc/expmed.c
index e81eb0a1b01..f9bd9ad20be 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -93,9 +93,10 @@ init_expmed ()
/* Since we are on the permanent obstack, we must be sure we save this
spot AFTER we call start_sequence, since it will reuse the rtl it
makes. */
-
free_point = (char *) oballoc (0);
+ reg = gen_rtx (REG, word_mode, 10000);
+
zero_cost = rtx_cost (const0_rtx, 0);
add_cost = rtx_cost (gen_rtx_PLUS (word_mode, reg, reg), SET);
@@ -122,7 +123,7 @@ init_expmed ()
shift_cost[0] = 0;
shiftadd_cost[0] = shiftsub_cost[0] = add_cost;
- for (m = 1; m < BITS_PER_WORD; m++)
+ for (m = 1; m < MAX_BITS_PER_WORD; m++)
{
shift_cost[m] = shiftadd_cost[m] = shiftsub_cost[m] = 32000;
@@ -210,10 +211,10 @@ negate_rtx (mode, x)
/* ??? Note that there are two different ideas here for how
to determine the size to count bits within, for a register.
One is BITS_PER_WORD, and the other is the size of operand 3
- of the insv pattern. (The latter assumes that an n-bit machine
- will be able to insert bit fields up to n bits wide.)
- It isn't certain that either of these is right.
- extract_bit_field has the same quandary. */
+ of the insv pattern.
+
+ If operand 3 of the insv pattern is VOIDmode, then we will use BITS_PER_WORD
+ else, we use the mode of operand 3. */
rtx
store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
@@ -229,6 +230,14 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
register int offset = bitnum / unit;
register int bitpos = bitnum % unit;
register rtx op0 = str_rtx;
+#ifdef HAVE_insv
+ int insv_bitsize;
+
+ if (insn_operand_mode[(int) CODE_FOR_insv][3] == VOIDmode)
+ insv_bitsize = GET_MODE_BITSIZE (word_mode);
+ else
+ insv_bitsize = GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_insv][3]);
+#endif
if (GET_CODE (str_rtx) == MEM && ! MEM_IN_STRUCT_P (str_rtx))
abort ();
@@ -399,21 +408,22 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
&& GET_MODE (value) != BLKmode
&& !(bitsize == 1 && GET_CODE (value) == CONST_INT)
/* Ensure insv's size is wide enough for this field. */
- && (GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_insv][3])
- >= bitsize)
+ && (insv_bitsize >= bitsize)
&& ! ((GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG)
- && (bitsize + bitpos
- > GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_insv][3]))))
+ && (bitsize + bitpos > insv_bitsize)))
{
int xbitpos = bitpos;
rtx value1;
rtx xop0 = op0;
rtx last = get_last_insn ();
rtx pat;
- enum machine_mode maxmode
- = insn_operand_mode[(int) CODE_FOR_insv][3];
-
+ enum machine_mode maxmode;
int save_volatile_ok = volatile_ok;
+
+ maxmode = insn_operand_mode[(int) CODE_FOR_insv][3];
+ if (maxmode == VOIDmode)
+ maxmode = word_mode;
+
volatile_ok = 1;
/* If this machine's insv can only insert into a register, copy OP0
@@ -893,6 +903,27 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
register rtx op0 = str_rtx;
rtx spec_target = target;
rtx spec_target_subreg = 0;
+#ifdef HAVE_extv
+ int extv_bitsize;
+#endif
+#ifdef HAVE_extzv
+ int extzv_bitsize;
+#endif
+
+#ifdef HAVE_extv
+ if (insn_operand_mode[(int) CODE_FOR_extv][0] == VOIDmode)
+ extv_bitsize = GET_MODE_BITSIZE (word_mode);
+ else
+ extv_bitsize = GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_extv][0]);
+#endif
+
+#ifdef HAVE_extzv
+ if (insn_operand_mode[(int) CODE_FOR_extzv][0] == VOIDmode)
+ extzv_bitsize = GET_MODE_BITSIZE (word_mode);
+ else
+ extzv_bitsize
+ = GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_extzv][0]);
+#endif
/* Discount the part of the structure before the desired byte.
We need to know how many bytes are safe to reference after it. */
@@ -952,6 +983,10 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
&& ((bitsize >= BITS_PER_WORD && bitsize == GET_MODE_BITSIZE (mode)
&& bitpos % BITS_PER_WORD == 0)
|| (mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0) != BLKmode
+ /* ??? The big endian test here is wrong. This is correct
+ if the value is in a register, and if mode_for_size is not
+ the same mode as op0. This causes us to get unnecessarily
+ inefficient code from the Thumb port when -mbig-endian. */
&& (BYTES_BIG_ENDIAN
? bitpos + bitsize == BITS_PER_WORD
: bitpos == 0))))
@@ -1072,11 +1107,9 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
{
#ifdef HAVE_extzv
if (HAVE_extzv
- && (GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_extzv][0])
- >= bitsize)
+ && (extzv_bitsize >= bitsize)
&& ! ((GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG)
- && (bitsize + bitpos
- > GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_extzv][0]))))
+ && (bitsize + bitpos > extzv_bitsize)))
{
int xbitpos = bitpos, xoffset = offset;
rtx bitsize_rtx, bitpos_rtx;
@@ -1086,8 +1119,11 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
rtx xspec_target = spec_target;
rtx xspec_target_subreg = spec_target_subreg;
rtx pat;
- enum machine_mode maxmode
- = insn_operand_mode[(int) CODE_FOR_extzv][0];
+ enum machine_mode maxmode;
+
+ maxmode = insn_operand_mode[(int) CODE_FOR_extzv][0];
+ if (maxmode == VOIDmode)
+ maxmode = word_mode;
if (GET_CODE (xop0) == MEM)
{
@@ -1212,11 +1248,9 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
{
#ifdef HAVE_extv
if (HAVE_extv
- && (GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_extv][0])
- >= bitsize)
+ && (extv_bitsize >= bitsize)
&& ! ((GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG)
- && (bitsize + bitpos
- > GET_MODE_BITSIZE (insn_operand_mode[(int) CODE_FOR_extv][0]))))
+ && (bitsize + bitpos > extv_bitsize)))
{
int xbitpos = bitpos, xoffset = offset;
rtx bitsize_rtx, bitpos_rtx;
@@ -1225,8 +1259,11 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
rtx xspec_target = spec_target;
rtx xspec_target_subreg = spec_target_subreg;
rtx pat;
- enum machine_mode maxmode
- = insn_operand_mode[(int) CODE_FOR_extv][0];
+ enum machine_mode maxmode;
+
+ maxmode = insn_operand_mode[(int) CODE_FOR_extv][0];
+ if (maxmode == VOIDmode)
+ maxmode = word_mode;
if (GET_CODE (xop0) == MEM)
{
@@ -1614,7 +1651,7 @@ extract_split_bit_field (op0, bitsize, bitpos, unsignedp, align)
{
int unit;
int bitsdone = 0;
- rtx result;
+ rtx result = NULL_RTX;
int first = 1;
/* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that
@@ -2277,7 +2314,8 @@ expand_mult (mode, op0, op1, target, unsignedp)
rtx shift_subtarget = preserve ? 0 : accum;
rtx add_target
= (opno == alg.ops - 1 && target != 0 && variant != add_variant
- ? target : 0);
+ && ! preserve)
+ ? target : 0;
rtx accum_target = preserve ? 0 : accum;
switch (alg.op[opno])
@@ -2746,6 +2784,7 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
optab optab1, optab2;
int op1_is_constant, op1_is_pow2;
int max_cost, extra_cost;
+ static HOST_WIDE_INT last_div_const = 0;
op1_is_constant = GET_CODE (op1) == CONST_INT;
op1_is_pow2 = (op1_is_constant
@@ -2855,8 +2894,15 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
size = GET_MODE_BITSIZE (mode);
#endif
+ /* Only deduct something for a REM if the last divide done was
+ for a different constant. Then set the constant of the last
+ divide. */
max_cost = div_cost[(int) compute_mode]
- - (rem_flag ? mul_cost[(int) compute_mode] + add_cost : 0);
+ - (rem_flag && ! (last_div_const != 0 && op1_is_constant
+ && INTVAL (op1) == last_div_const)
+ ? mul_cost[(int) compute_mode] + add_cost : 0);
+
+ last_div_const = ! rem_flag && op1_is_constant ? INTVAL (op1) : 0;
/* Now convert to the best mode to use. */
if (compute_mode != mode)
@@ -3663,10 +3709,22 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
if (rem_flag)
{
- /* Try to produce the remainder directly without a library call. */
- remainder = sign_expand_binop (compute_mode, umod_optab, smod_optab,
- op0, op1, target,
- unsignedp, OPTAB_WIDEN);
+ /* Try to produce the remainder without producing the quotient.
+ If we seem to have a divmod patten that does not require widening,
+ don't try windening here. We should really have an WIDEN argument
+ to expand_twoval_binop, since what we'd really like to do here is
+ 1) try a mod insn in compute_mode
+ 2) try a divmod insn in compute_mode
+ 3) try a div insn in compute_mode and multiply-subtract to get
+ remainder
+ 4) try the same things with widening allowed. */
+ remainder
+ = sign_expand_binop (compute_mode, umod_optab, smod_optab,
+ op0, op1, target,
+ unsignedp,
+ ((optab2->handlers[(int) compute_mode].insn_code
+ != CODE_FOR_nothing)
+ ? OPTAB_DIRECT : OPTAB_WIDEN));
if (remainder == 0)
{
/* No luck there. Can we do remainder and divide at once
@@ -3757,7 +3815,9 @@ make_tree (type, x)
{
case CONST_INT:
t = build_int_2 (INTVAL (x),
- TREE_UNSIGNED (type) || INTVAL (x) >= 0 ? 0 : -1);
+ (TREE_UNSIGNED (type)
+ && (GET_MODE_BITSIZE (TYPE_MODE (type)) < HOST_BITS_PER_WIDE_INT))
+ || INTVAL (x) >= 0 ? 0 : -1);
TREE_TYPE (t) = type;
return t;
diff --git a/gcc/expr.c b/gcc/expr.c
index d416e922718..d2dcdf8c592 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -32,8 +32,9 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "insn-flags.h"
#include "insn-codes.h"
-#include "expr.h"
#include "insn-config.h"
+/* Include expr.h after insn-config.h so we get HAVE_conditional_move. */
+#include "expr.h"
#include "recog.h"
#include "output.h"
#include "typeclass.h"
@@ -103,6 +104,11 @@ static rtx saveregs_value;
/* Similarly for __builtin_apply_args. */
static rtx apply_args_value;
+/* Nonzero if the machine description has been fixed to accept
+ CONSTANT_P_RTX patterns. We will emit a warning and continue
+ if we find we must actually use such a beast. */
+static int can_handle_constant_p;
+
/* Don't check memory usage, since code is being emitted to check a memory
usage. Used when flag_check_memory_usage is true, to avoid infinite
recursion. */
@@ -150,7 +156,6 @@ static rtx get_push_address PROTO ((int));
static rtx enqueue_insn PROTO((rtx, rtx));
static int queued_subexp_p PROTO((rtx));
static void init_queue PROTO((void));
-static void move_by_pieces PROTO((rtx, rtx, int, int));
static int move_by_pieces_ninsns PROTO((unsigned int, int));
static void move_by_pieces_1 PROTO((rtx (*) (rtx, ...), enum machine_mode,
struct move_by_pieces *));
@@ -163,7 +168,8 @@ static void store_constructor_field PROTO((rtx, int, int, enum machine_mode,
tree, tree, int));
static void store_constructor PROTO((tree, rtx, int));
static rtx store_field PROTO((rtx, int, int, enum machine_mode, tree,
- enum machine_mode, int, int, int));
+ enum machine_mode, int, int,
+ int, int));
static enum memory_use_mode
get_memory_usage_from_modifier PROTO((enum expand_modifier));
static tree save_noncopied_parts PROTO((tree, tree));
@@ -174,6 +180,7 @@ static rtx var_rtx PROTO((tree));
static int get_pointer_alignment PROTO((tree, unsigned));
static tree string_constant PROTO((tree, tree *));
static tree c_strlen PROTO((tree));
+static rtx get_memory_rtx PROTO((tree));
static rtx expand_builtin PROTO((tree, rtx, rtx,
enum machine_mode, int));
static int apply_args_size PROTO((void));
@@ -185,13 +192,10 @@ static void expand_builtin_return PROTO((rtx));
static rtx expand_increment PROTO((tree, int, int));
static void preexpand_calls PROTO((tree));
static void do_jump_by_parts_greater PROTO((tree, int, rtx, rtx));
-void do_jump_by_parts_greater_rtx PROTO((enum machine_mode, int, rtx, rtx, rtx, rtx));
static void do_jump_by_parts_equality PROTO((tree, rtx, rtx));
-void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx));
static void do_jump_for_compare PROTO((rtx, rtx, rtx));
static rtx compare PROTO((tree, enum rtx_code, enum rtx_code));
static rtx do_store_flag PROTO((tree, rtx, enum machine_mode, int));
-extern tree truthvalue_conversion PROTO((tree));
/* Record for each mode whether we can move a register directly to or
from an object of that mode in memory. If we can't, we won't try
@@ -200,8 +204,8 @@ extern tree truthvalue_conversion PROTO((tree));
static char direct_load[NUM_MACHINE_MODES];
static char direct_store[NUM_MACHINE_MODES];
-/* MOVE_RATIO is the number of move instructions that is better than
- a block move. */
+/* If a memory-to-memory move would take MOVE_RATIO or more simple
+ move-instruction sequences, we will do a movstr or libcall instead. */
#ifndef MOVE_RATIO
#if defined (HAVE_movstrqi) || defined (HAVE_movstrhi) || defined (HAVE_movstrsi) || defined (HAVE_movstrdi) || defined (HAVE_movstrti)
@@ -240,13 +244,23 @@ init_expr_once ()
{
rtx insn, pat;
enum machine_mode mode;
+ int num_clobbers;
+ rtx mem, mem1;
+ char *free_point;
+
+ start_sequence ();
+
+ /* Since we are on the permanent obstack, we must be sure we save this
+ spot AFTER we call start_sequence, since it will reuse the rtl it
+ makes. */
+ free_point = (char *) oballoc (0);
+
/* Try indexing by frame ptr and try by stack ptr.
It is known that on the Convex the stack ptr isn't a valid index.
With luck, one or the other is valid on any machine. */
- rtx mem = gen_rtx_MEM (VOIDmode, stack_pointer_rtx);
- rtx mem1 = gen_rtx_MEM (VOIDmode, frame_pointer_rtx);
+ mem = gen_rtx_MEM (VOIDmode, stack_pointer_rtx);
+ mem1 = gen_rtx_MEM (VOIDmode, frame_pointer_rtx);
- start_sequence ();
insn = emit_insn (gen_rtx_SET (0, NULL_RTX, NULL_RTX));
pat = PATTERN (insn);
@@ -255,7 +269,6 @@ init_expr_once ()
{
int regno;
rtx reg;
- int num_clobbers;
direct_load[(int) mode] = direct_store[(int) mode] = 0;
PUT_MODE (mem, mode);
@@ -296,9 +309,18 @@ init_expr_once ()
}
}
+ /* Find out if CONSTANT_P_RTX is accepted. */
+ SET_DEST (pat) = gen_rtx_REG (TYPE_MODE (integer_type_node),
+ FIRST_PSEUDO_REGISTER);
+ SET_SRC (pat) = gen_rtx_CONSTANT_P_RTX (TYPE_MODE (integer_type_node),
+ SET_DEST (pat));
+ if (recog (pat, insn, &num_clobbers) >= 0)
+ can_handle_constant_p = 1;
+
end_sequence ();
+ obfree (free_point);
}
-
+
/* This is run at the start of compiling a function. */
void
@@ -416,6 +438,7 @@ protect_from_queue (x, modify)
MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (x);
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (x);
MEM_VOLATILE_P (new) = MEM_VOLATILE_P (x);
+ MEM_ALIAS_SET (new) = MEM_ALIAS_SET (x);
if (QUEUED_INSN (y))
{
@@ -499,7 +522,15 @@ emit_queue ()
register rtx p;
while ((p = pending_chain))
{
- QUEUED_INSN (p) = emit_insn (QUEUED_BODY (p));
+ rtx body = QUEUED_BODY (p);
+
+ if (GET_CODE (body) == SEQUENCE)
+ {
+ QUEUED_INSN (p) = XVECEXP (QUEUED_BODY (p), 0, 0);
+ emit_insn (QUEUED_BODY (p));
+ }
+ else
+ QUEUED_INSN (p) = emit_insn (QUEUED_BODY (p));
pending_chain = QUEUED_NEXT (p);
}
}
@@ -1363,7 +1394,7 @@ convert_modes (mode, oldmode, x, unsignedp)
through protect_from_queue before calling.
ALIGN (in bytes) is maximum alignment we can assume. */
-static void
+void
move_by_pieces (to, from, len, align)
rtx to, from;
int len, align;
@@ -1586,6 +1617,10 @@ emit_block_move (x, y, size, align)
int align;
{
rtx retval = 0;
+#ifdef TARGET_MEM_FUNCTIONS
+ static tree fn;
+ tree call_expr, arg_list;
+#endif
if (GET_MODE (x) != BLKmode)
abort ();
@@ -1659,13 +1694,60 @@ emit_block_move (x, y, size, align)
}
#ifdef TARGET_MEM_FUNCTIONS
- retval
- = emit_library_call_value (memcpy_libfunc, NULL_RTX, 0,
- ptr_mode, 3, XEXP (x, 0), Pmode,
- XEXP (y, 0), Pmode,
- convert_to_mode (TYPE_MODE (sizetype), size,
- TREE_UNSIGNED (sizetype)),
- TYPE_MODE (sizetype));
+ /* It is incorrect to use the libcall calling conventions to call
+ memcpy in this context.
+
+ This could be a user call to memcpy and the user may wish to
+ examine the return value from memcpy.
+
+ For targets where libcalls and normal calls have different conventions
+ for returning pointers, we could end up generating incorrect code.
+
+ So instead of using a libcall sequence we build up a suitable
+ CALL_EXPR and expand the call in the normal fashion. */
+ if (fn == NULL_TREE)
+ {
+ tree fntype;
+
+ /* This was copied from except.c, I don't know if all this is
+ necessary in this context or not. */
+ fn = get_identifier ("memcpy");
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+ fntype = build_pointer_type (void_type_node);
+ fntype = build_function_type (fntype, NULL_TREE);
+ fn = build_decl (FUNCTION_DECL, fn, fntype);
+ DECL_EXTERNAL (fn) = 1;
+ TREE_PUBLIC (fn) = 1;
+ DECL_ARTIFICIAL (fn) = 1;
+ make_decl_rtl (fn, NULL_PTR, 1);
+ assemble_external (fn);
+ pop_obstacks ();
+ }
+
+ /* We need to make an argument list for the function call.
+
+ memcpy has three arguments, the first two are void * addresses and
+ the last is a size_t byte count for the copy. */
+ arg_list
+ = build_tree_list (NULL_TREE,
+ make_tree (build_pointer_type (void_type_node),
+ XEXP (x, 0)));
+ TREE_CHAIN (arg_list)
+ = build_tree_list (NULL_TREE,
+ make_tree (build_pointer_type (void_type_node),
+ XEXP (y, 0)));
+ TREE_CHAIN (TREE_CHAIN (arg_list))
+ = build_tree_list (NULL_TREE, make_tree (sizetype, size));
+ TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arg_list))) = NULL_TREE;
+
+ /* Now we have to build up the CALL_EXPR itself. */
+ call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
+ call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
+ call_expr, arg_list, NULL_TREE);
+ TREE_SIDE_EFFECTS (call_expr) = 1;
+
+ retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
#else
emit_library_call (bcopy_libfunc, 0,
VOIDmode, 3, XEXP (y, 0), Pmode,
@@ -1799,105 +1881,290 @@ move_block_from_reg (regno, x, nregs, size)
}
}
-/* Emit code to move a block Y to a block X, where X is non-consecutive
- registers represented by a PARALLEL. */
+/* Emit code to move a block SRC to a block DST, where DST is non-consecutive
+ registers represented by a PARALLEL. SSIZE represents the total size of
+ block SRC in bytes, or -1 if not known. ALIGN is the known alignment of
+ SRC in bits. */
+/* ??? If SSIZE % UNITS_PER_WORD != 0, we make the blatent assumption that
+ the balance will be in what would be the low-order memory addresses, i.e.
+ left justified for big endian, right justified for little endian. This
+ happens to be true for the targets currently using this support. If this
+ ever changes, a new target macro along the lines of FUNCTION_ARG_PADDING
+ would be needed. */
void
-emit_group_load (x, y)
- rtx x, y;
+emit_group_load (dst, orig_src, ssize, align)
+ rtx dst, orig_src;
+ int align, ssize;
{
- rtx target_reg, source;
- int i;
+ rtx *tmps, src;
+ int start, i;
- if (GET_CODE (x) != PARALLEL)
+ if (GET_CODE (dst) != PARALLEL)
abort ();
/* Check for a NULL entry, used to indicate that the parameter goes
both on the stack and in registers. */
- if (XEXP (XVECEXP (x, 0, 0), 0))
- i = 0;
+ if (XEXP (XVECEXP (dst, 0, 0), 0))
+ start = 0;
else
- i = 1;
-
- for (; i < XVECLEN (x, 0); i++)
- {
- rtx element = XVECEXP (x, 0, i);
-
- target_reg = XEXP (element, 0);
-
- if (GET_CODE (y) == MEM)
- source = change_address (y, GET_MODE (target_reg),
- plus_constant (XEXP (y, 0),
- INTVAL (XEXP (element, 1))));
- else if (XEXP (element, 1) == const0_rtx)
- {
- if (GET_MODE (target_reg) == GET_MODE (y))
- source = y;
- /* Allow for the target_reg to be smaller than the input register
- to allow for AIX with 4 DF arguments after a single SI arg. The
- last DF argument will only load 1 word into the integer registers,
- but load a DF value into the float registers. */
- else if ((GET_MODE_SIZE (GET_MODE (target_reg))
- <= GET_MODE_SIZE (GET_MODE (y)))
- && GET_MODE (target_reg) == word_mode)
- /* This might be a const_double, so we can't just use SUBREG. */
- source = operand_subword (y, 0, 0, VOIDmode);
- else if (GET_MODE_SIZE (GET_MODE (target_reg))
- == GET_MODE_SIZE (GET_MODE (y)))
- source = gen_lowpart (GET_MODE (target_reg), y);
- else
- abort ();
+ start = 1;
+
+ tmps = (rtx *) alloca (sizeof(rtx) * XVECLEN (dst, 0));
+
+ /* If we won't be loading directly from memory, protect the real source
+ from strange tricks we might play. */
+ src = orig_src;
+ if (GET_CODE (src) != MEM)
+ {
+ src = gen_reg_rtx (GET_MODE (orig_src));
+ emit_move_insn (src, orig_src);
+ }
+
+ /* Process the pieces. */
+ for (i = start; i < XVECLEN (dst, 0); i++)
+ {
+ enum machine_mode mode = GET_MODE (XEXP (XVECEXP (dst, 0, i), 0));
+ int bytepos = INTVAL (XEXP (XVECEXP (dst, 0, i), 1));
+ int bytelen = GET_MODE_SIZE (mode);
+ int shift = 0;
+
+ /* Handle trailing fragments that run over the size of the struct. */
+ if (ssize >= 0 && bytepos + bytelen > ssize)
+ {
+ shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
+ bytelen = ssize - bytepos;
+ if (bytelen <= 0)
+ abort();
+ }
+
+ /* Optimize the access just a bit. */
+ if (GET_CODE (src) == MEM
+ && align*BITS_PER_UNIT >= GET_MODE_ALIGNMENT (mode)
+ && bytepos*BITS_PER_UNIT % GET_MODE_ALIGNMENT (mode) == 0
+ && bytelen == GET_MODE_SIZE (mode))
+ {
+ tmps[i] = gen_reg_rtx (mode);
+ emit_move_insn (tmps[i],
+ change_address (src, mode,
+ plus_constant (XEXP (src, 0),
+ bytepos)));
}
else
- abort ();
+ {
+ tmps[i] = extract_bit_field (src, bytelen*BITS_PER_UNIT,
+ bytepos*BITS_PER_UNIT, 1, NULL_RTX,
+ mode, mode, align, ssize);
+ }
- emit_move_insn (target_reg, source);
+ if (BYTES_BIG_ENDIAN && shift)
+ {
+ expand_binop (mode, ashl_optab, tmps[i], GEN_INT (shift),
+ tmps[i], 0, OPTAB_WIDEN);
+ }
}
+ emit_queue();
+
+ /* Copy the extracted pieces into the proper (probable) hard regs. */
+ for (i = start; i < XVECLEN (dst, 0); i++)
+ emit_move_insn (XEXP (XVECEXP (dst, 0, i), 0), tmps[i]);
}
-/* Emit code to move a block Y to a block X, where Y is non-consecutive
- registers represented by a PARALLEL. */
+/* Emit code to move a block SRC to a block DST, where SRC is non-consecutive
+ registers represented by a PARALLEL. SSIZE represents the total size of
+ block DST, or -1 if not known. ALIGN is the known alignment of DST. */
void
-emit_group_store (x, y)
- rtx x, y;
+emit_group_store (orig_dst, src, ssize, align)
+ rtx orig_dst, src;
+ int ssize, align;
{
- rtx source_reg, target;
- int i;
+ rtx *tmps, dst;
+ int start, i;
- if (GET_CODE (y) != PARALLEL)
+ if (GET_CODE (src) != PARALLEL)
abort ();
/* Check for a NULL entry, used to indicate that the parameter goes
both on the stack and in registers. */
- if (XEXP (XVECEXP (y, 0, 0), 0))
- i = 0;
+ if (XEXP (XVECEXP (src, 0, 0), 0))
+ start = 0;
else
- i = 1;
+ start = 1;
- for (; i < XVECLEN (y, 0); i++)
+ tmps = (rtx *) alloca (sizeof(rtx) * XVECLEN (src, 0));
+
+ /* Copy the (probable) hard regs into pseudos. */
+ for (i = start; i < XVECLEN (src, 0); i++)
{
- rtx element = XVECEXP (y, 0, i);
+ rtx reg = XEXP (XVECEXP (src, 0, i), 0);
+ tmps[i] = gen_reg_rtx (GET_MODE (reg));
+ emit_move_insn (tmps[i], reg);
+ }
+ emit_queue();
- source_reg = XEXP (element, 0);
+ /* If we won't be storing directly into memory, protect the real destination
+ from strange tricks we might play. */
+ dst = orig_dst;
+ if (GET_CODE (dst) == PARALLEL)
+ {
+ rtx temp;
+
+ /* We can get a PARALLEL dst if there is a conditional expression in
+ a return statement. In that case, the dst and src are the same,
+ so no action is necessary. */
+ if (rtx_equal_p (dst, src))
+ return;
+
+ /* It is unclear if we can ever reach here, but we may as well handle
+ it. Allocate a temporary, and split this into a store/load to/from
+ the temporary. */
- if (GET_CODE (x) == MEM)
- target = change_address (x, GET_MODE (source_reg),
- plus_constant (XEXP (x, 0),
- INTVAL (XEXP (element, 1))));
- else if (XEXP (element, 1) == const0_rtx)
+ temp = assign_stack_temp (GET_MODE (dst), ssize, 0);
+ emit_group_store (temp, src, ssize, align);
+ emit_group_load (dst, temp, ssize, align);
+ return;
+ }
+ else if (GET_CODE (dst) != MEM)
+ {
+ dst = gen_reg_rtx (GET_MODE (orig_dst));
+ /* Make life a bit easier for combine. */
+ emit_move_insn (dst, const0_rtx);
+ }
+ else if (! MEM_IN_STRUCT_P (dst))
+ {
+ /* store_bit_field requires that memory operations have
+ mem_in_struct_p set; we might not. */
+
+ dst = copy_rtx (orig_dst);
+ MEM_IN_STRUCT_P (dst) = 1;
+ }
+
+ /* Process the pieces. */
+ for (i = start; i < XVECLEN (src, 0); i++)
+ {
+ int bytepos = INTVAL (XEXP (XVECEXP (src, 0, i), 1));
+ enum machine_mode mode = GET_MODE (tmps[i]);
+ int bytelen = GET_MODE_SIZE (mode);
+
+ /* Handle trailing fragments that run over the size of the struct. */
+ if (ssize >= 0 && bytepos + bytelen > ssize)
{
- target = x;
- if (GET_MODE (target) != GET_MODE (source_reg))
- target = gen_lowpart (GET_MODE (source_reg), target);
+ if (BYTES_BIG_ENDIAN)
+ {
+ int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
+ expand_binop (mode, ashr_optab, tmps[i], GEN_INT (shift),
+ tmps[i], 0, OPTAB_WIDEN);
+ }
+ bytelen = ssize - bytepos;
}
- else
- abort ();
- emit_move_insn (target, source_reg);
+ /* Optimize the access just a bit. */
+ if (GET_CODE (dst) == MEM
+ && align*BITS_PER_UNIT >= GET_MODE_ALIGNMENT (mode)
+ && bytepos*BITS_PER_UNIT % GET_MODE_ALIGNMENT (mode) == 0
+ && bytelen == GET_MODE_SIZE (mode))
+ {
+ emit_move_insn (change_address (dst, mode,
+ plus_constant (XEXP (dst, 0),
+ bytepos)),
+ tmps[i]);
+ }
+ else
+ {
+ store_bit_field (dst, bytelen*BITS_PER_UNIT, bytepos*BITS_PER_UNIT,
+ mode, tmps[i], align, ssize);
+ }
}
+ emit_queue();
+
+ /* Copy from the pseudo into the (probable) hard reg. */
+ if (GET_CODE (dst) == REG)
+ emit_move_insn (orig_dst, dst);
}
+/* Generate code to copy a BLKmode object of TYPE out of a
+ set of registers starting with SRCREG into TGTBLK. If TGTBLK
+ is null, a stack temporary is created. TGTBLK is returned.
+
+ The primary purpose of this routine is to handle functions
+ that return BLKmode structures in registers. Some machines
+ (the PA for example) want to return all small structures
+ in registers regardless of the structure's alignment.
+ */
+
+rtx
+copy_blkmode_from_reg(tgtblk,srcreg,type)
+ rtx tgtblk;
+ rtx srcreg;
+ tree type;
+{
+ int bytes = int_size_in_bytes (type);
+ rtx src = NULL, dst = NULL;
+ int bitsize = MIN (TYPE_ALIGN (type), BITS_PER_WORD);
+ int bitpos, xbitpos, big_endian_correction = 0;
+
+ if (tgtblk == 0)
+ {
+ tgtblk = assign_stack_temp (BLKmode, bytes, 0);
+ MEM_IN_STRUCT_P (tgtblk) = AGGREGATE_TYPE_P (type);
+ preserve_temp_slots (tgtblk);
+ }
+
+ /* This code assumes srcreg is at least a full word. If it isn't,
+ copy it into a new pseudo which is a full word. */
+ if (GET_MODE (srcreg) != BLKmode
+ && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
+ srcreg = convert_to_mode (word_mode, srcreg,
+ TREE_UNSIGNED (type));
+
+ /* Structures whose size is not a multiple of a word are aligned
+ to the least significant byte (to the right). On a BYTES_BIG_ENDIAN
+ machine, this means we must skip the empty high order bytes when
+ calculating the bit offset. */
+ if (BYTES_BIG_ENDIAN && bytes % UNITS_PER_WORD)
+ big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD)
+ * BITS_PER_UNIT));
+
+ /* Copy the structure BITSIZE bites at a time.
+
+ We could probably emit more efficient code for machines
+ which do not use strict alignment, but it doesn't seem
+ worth the effort at the current time. */
+ for (bitpos = 0, xbitpos = big_endian_correction;
+ bitpos < bytes * BITS_PER_UNIT;
+ bitpos += bitsize, xbitpos += bitsize)
+ {
+
+ /* We need a new source operand each time xbitpos is on a
+ word boundary and when xbitpos == big_endian_correction
+ (the first time through). */
+ if (xbitpos % BITS_PER_WORD == 0
+ || xbitpos == big_endian_correction)
+ src = operand_subword_force (srcreg,
+ xbitpos / BITS_PER_WORD,
+ BLKmode);
+
+ /* We need a new destination operand each time bitpos is on
+ a word boundary. */
+ if (bitpos % BITS_PER_WORD == 0)
+ dst = operand_subword (tgtblk, bitpos / BITS_PER_WORD, 1, BLKmode);
+
+ /* Use xbitpos for the source extraction (right justified) and
+ xbitpos for the destination store (left justified). */
+ store_bit_field (dst, bitsize, bitpos % BITS_PER_WORD, word_mode,
+ extract_bit_field (src, bitsize,
+ xbitpos % BITS_PER_WORD, 1,
+ NULL_RTX, word_mode,
+ word_mode,
+ bitsize / BITS_PER_UNIT,
+ BITS_PER_WORD),
+ bitsize / BITS_PER_UNIT, BITS_PER_WORD);
+ }
+ return tgtblk;
+}
+
+
/* Add a USE expression for REG to the (possibly empty) list pointed
to by CALL_FUSAGE. REG must denote a hard register. */
@@ -2097,6 +2364,10 @@ clear_storage (object, size, align)
rtx size;
int align;
{
+#ifdef TARGET_MEM_FUNCTIONS
+ static tree fn;
+ tree call_expr, arg_list;
+#endif
rtx retval = 0;
if (GET_MODE (object) == BLKmode)
@@ -2161,16 +2432,60 @@ clear_storage (object, size, align)
#ifdef TARGET_MEM_FUNCTIONS
- retval
- = emit_library_call_value (memset_libfunc, NULL_RTX, 0,
- ptr_mode, 3,
- XEXP (object, 0), Pmode,
- const0_rtx,
- TYPE_MODE (integer_type_node),
- convert_to_mode
- (TYPE_MODE (sizetype), size,
- TREE_UNSIGNED (sizetype)),
- TYPE_MODE (sizetype));
+ /* It is incorrect to use the libcall calling conventions to call
+ memset in this context.
+
+ This could be a user call to memset and the user may wish to
+ examine the return value from memset.
+
+ For targets where libcalls and normal calls have different conventions
+ for returning pointers, we could end up generating incorrect code.
+
+ So instead of using a libcall sequence we build up a suitable
+ CALL_EXPR and expand the call in the normal fashion. */
+ if (fn == NULL_TREE)
+ {
+ tree fntype;
+
+ /* This was copied from except.c, I don't know if all this is
+ necessary in this context or not. */
+ fn = get_identifier ("memset");
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+ fntype = build_pointer_type (void_type_node);
+ fntype = build_function_type (fntype, NULL_TREE);
+ fn = build_decl (FUNCTION_DECL, fn, fntype);
+ DECL_EXTERNAL (fn) = 1;
+ TREE_PUBLIC (fn) = 1;
+ DECL_ARTIFICIAL (fn) = 1;
+ make_decl_rtl (fn, NULL_PTR, 1);
+ assemble_external (fn);
+ pop_obstacks ();
+ }
+
+ /* We need to make an argument list for the function call.
+
+ memset has three arguments, the first is a void * addresses, the
+ second a integer with the initialization value, the last is a size_t
+ byte count for the copy. */
+ arg_list
+ = build_tree_list (NULL_TREE,
+ make_tree (build_pointer_type (void_type_node),
+ XEXP (object, 0)));
+ TREE_CHAIN (arg_list)
+ = build_tree_list (NULL_TREE,
+ make_tree (integer_type_node, const0_rtx));
+ TREE_CHAIN (TREE_CHAIN (arg_list))
+ = build_tree_list (NULL_TREE, make_tree (sizetype, size));
+ TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arg_list))) = NULL_TREE;
+
+ /* Now we have to build up the CALL_EXPR itself. */
+ call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
+ call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
+ call_expr, arg_list, NULL_TREE);
+ TREE_SIDE_EFFECTS (call_expr) = 1;
+
+ retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
#else
emit_library_call (bzero_libfunc, 0,
VOIDmode, 2,
@@ -2288,6 +2603,10 @@ emit_move_insn_1 (x, y)
}
else
{
+ /* Show the output dies here. */
+ if (x != y)
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, x));
+
emit_insn (GEN_FCN (mov_optab->handlers[(int) submode].insn_code)
(gen_realpart (submode, x), gen_realpart (submode, y)));
emit_insn (GEN_FCN (mov_optab->handlers[(int) submode].insn_code)
@@ -2636,7 +2955,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
{
rtx opalign = GEN_INT (align);
enum machine_mode mode;
- rtx target = gen_rtx (MEM, BLKmode, temp);
+ rtx target = gen_rtx_MEM (BLKmode, temp);
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
mode != VOIDmode;
@@ -2835,7 +3154,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
/* Handle calls that pass values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
if (GET_CODE (reg) == PARALLEL)
- emit_group_load (reg, x);
+ emit_group_load (reg, x, -1, align); /* ??? size? */
else
move_block_to_reg (REGNO (reg), x, partial, mode);
}
@@ -2907,6 +3226,36 @@ expand_assignment (to, from, want_value, suggest_reg)
if (GET_CODE (to_rtx) != MEM)
abort ();
+
+ if (GET_MODE (offset_rtx) != ptr_mode)
+ {
+#ifdef POINTERS_EXTEND_UNSIGNED
+ offset_rtx = convert_memory_address (ptr_mode, offset_rtx);
+#else
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+#endif
+ }
+
+ if (GET_CODE (to_rtx) == MEM
+ && GET_MODE (to_rtx) == BLKmode
+ && bitsize
+ && (bitpos % bitsize) == 0
+ && (bitsize % GET_MODE_ALIGNMENT (mode1)) == 0
+ && (alignment * BITS_PER_UNIT) == GET_MODE_ALIGNMENT (mode1))
+ {
+ rtx temp = change_address (to_rtx, mode1,
+ plus_constant (XEXP (to_rtx, 0),
+ (bitpos /
+ BITS_PER_UNIT)));
+ if (GET_CODE (XEXP (temp, 0)) == REG)
+ to_rtx = temp;
+ else
+ to_rtx = change_address (to_rtx, mode1,
+ force_reg (GET_MODE (XEXP (temp, 0)),
+ XEXP (temp, 0)));
+ bitpos = 0;
+ }
+
to_rtx = change_address (to_rtx, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
force_reg (ptr_mode, offset_rtx)));
@@ -2976,7 +3325,8 @@ expand_assignment (to, from, want_value, suggest_reg)
unsignedp,
/* Required alignment of containing datum. */
alignment,
- int_size_in_bytes (TREE_TYPE (tem)));
+ int_size_in_bytes (TREE_TYPE (tem)),
+ get_alias_set (to));
preserve_temp_slots (result);
free_temp_slots ();
pop_temp_slots ();
@@ -3014,7 +3364,8 @@ expand_assignment (to, from, want_value, suggest_reg)
/* Handle calls that return values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
if (GET_CODE (to_rtx) == PARALLEL)
- emit_group_load (to_rtx, value);
+ emit_group_load (to_rtx, value, int_size_in_bytes (TREE_TYPE (from)),
+ TYPE_ALIGN (TREE_TYPE (from)) / BITS_PER_UNIT);
else if (GET_MODE (to_rtx) == BLKmode)
emit_block_move (to_rtx, value, expr_size (from),
TYPE_ALIGN (TREE_TYPE (from)) / BITS_PER_UNIT);
@@ -3030,7 +3381,11 @@ expand_assignment (to, from, want_value, suggest_reg)
Don't re-expand if it was expanded already (in COMPONENT_REF case). */
if (to_rtx == 0)
- to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_WO);
+ {
+ to_rtx = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_WO);
+ if (GET_CODE (to_rtx) == MEM)
+ MEM_ALIAS_SET (to_rtx) = get_alias_set (to);
+ }
/* Don't move directly into a return register. */
if (TREE_CODE (to) == RESULT_DECL && GET_CODE (to_rtx) == REG)
@@ -3303,7 +3658,10 @@ store_expr (exp, target, want_value)
/* If value was not generated in the target, store it there.
Convert the value to TARGET's type first if nec. */
- if (! rtx_equal_p (temp, target) && TREE_CODE (exp) != ERROR_MARK)
+ if ((! rtx_equal_p (temp, target)
+ || side_effects_p (temp)
+ || side_effects_p (target))
+ && TREE_CODE (exp) != ERROR_MARK)
{
target = protect_from_queue (target, 1);
if (GET_MODE (temp) != GET_MODE (target)
@@ -3415,7 +3773,8 @@ store_expr (exp, target, want_value)
/* Handle calls that return values in multiple non-contiguous locations.
The Irix 6 ABI has examples of this. */
else if (GET_CODE (target) == PARALLEL)
- emit_group_load (target, temp);
+ emit_group_load (target, temp, int_size_in_bytes (TREE_TYPE (exp)),
+ TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT);
else if (GET_MODE (temp) == BLKmode)
emit_block_move (target, temp, expr_size (exp),
TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT);
@@ -3549,7 +3908,7 @@ store_constructor_field (target, bitsize, bitpos,
else
store_field (target, bitsize, bitpos, mode, exp,
VOIDmode, 0, TYPE_ALIGN (type) / BITS_PER_UNIT,
- int_size_in_bytes (type));
+ int_size_in_bytes (type), 0);
}
/* Store the value of constructor EXP into the rtx TARGET.
@@ -3563,6 +3922,7 @@ store_constructor (exp, target, cleared)
int cleared;
{
tree type = TREE_TYPE (exp);
+ rtx exp_size = expr_size (exp);
/* We know our target cannot conflict, since safe_from_p has been called. */
#if 0
@@ -3624,6 +3984,7 @@ store_constructor (exp, target, cleared)
for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt))
{
register tree field = TREE_PURPOSE (elt);
+ tree value = TREE_VALUE (elt);
register enum machine_mode mode;
int bitsize;
int bitpos = 0;
@@ -3673,6 +4034,15 @@ store_constructor (exp, target, cleared)
if (GET_CODE (to_rtx) != MEM)
abort ();
+ if (GET_MODE (offset_rtx) != ptr_mode)
+ {
+#ifdef POINTERS_EXTEND_UNSIGNED
+ offset_rtx = convert_memory_address (ptr_mode, offset_rtx);
+#else
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+#endif
+ }
+
to_rtx
= change_address (to_rtx, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
@@ -3686,8 +4056,36 @@ store_constructor (exp, target, cleared)
RTX_UNCHANGING_P (to_rtx) = 1;
}
+#ifdef WORD_REGISTER_OPERATIONS
+ /* If this initializes a field that is smaller than a word, at the
+ start of a word, try to widen it to a full word.
+ This special case allows us to output C++ member function
+ initializations in a form that the optimizers can understand. */
+ if (constant
+ && GET_CODE (target) == REG
+ && bitsize < BITS_PER_WORD
+ && bitpos % BITS_PER_WORD == 0
+ && GET_MODE_CLASS (mode) == MODE_INT
+ && TREE_CODE (value) == INTEGER_CST
+ && GET_CODE (exp_size) == CONST_INT
+ && bitpos + BITS_PER_WORD <= INTVAL (exp_size) * BITS_PER_UNIT)
+ {
+ tree type = TREE_TYPE (value);
+ if (TYPE_PRECISION (type) < BITS_PER_WORD)
+ {
+ type = type_for_size (BITS_PER_WORD, TREE_UNSIGNED (type));
+ value = convert (type, value);
+ }
+ if (BYTES_BIG_ENDIAN)
+ value
+ = fold (build (LSHIFT_EXPR, type, value,
+ build_int_2 (BITS_PER_WORD - bitsize, 0)));
+ bitsize = BITS_PER_WORD;
+ mode = word_mode;
+ }
+#endif
store_constructor_field (to_rtx, bitsize, bitpos,
- mode, TREE_VALUE (elt), type, cleared);
+ mode, value, type, cleared);
}
}
else if (TREE_CODE (type) == ARRAY_TYPE)
@@ -4090,11 +4488,15 @@ store_constructor (exp, target, cleared)
In this case, UNSIGNEDP must be nonzero if the value is an unsigned type.
ALIGN is the alignment that TARGET is known to have, measured in bytes.
- TOTAL_SIZE is the size in bytes of the structure, or -1 if varying. */
+ TOTAL_SIZE is the size in bytes of the structure, or -1 if varying.
+
+ ALIAS_SET is the alias set for the destination. This value will
+ (in general) be different from that for TARGET, since TARGET is a
+ reference to the containing structure. */
static rtx
store_field (target, bitsize, bitpos, mode, exp, value_mode,
- unsignedp, align, total_size)
+ unsignedp, align, total_size, alias_set)
rtx target;
int bitsize, bitpos;
enum machine_mode mode;
@@ -4103,6 +4505,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
int unsignedp;
int align;
int total_size;
+ int alias_set;
{
HOST_WIDE_INT width_mask = 0;
@@ -4138,7 +4541,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
emit_move_insn (object, target);
store_field (blk_object, bitsize, bitpos, mode, exp, VOIDmode, 0,
- align, total_size);
+ align, total_size, alias_set);
/* Even though we aren't returning target, we need to
give it the updated value. */
@@ -4253,6 +4656,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
(bitpos
/ BITS_PER_UNIT))));
MEM_IN_STRUCT_P (to_rtx) = 1;
+ MEM_ALIAS_SET (to_rtx) = alias_set;
return store_expr (exp, to_rtx, value_mode != VOIDmode);
}
@@ -4373,6 +4777,7 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
tree low_bound
= domain ? TYPE_MIN_VALUE (domain) : integer_zero_node;
tree index_type = TREE_TYPE (index);
+ tree xindex;
if (TYPE_PRECISION (index_type) != TYPE_PRECISION (sizetype))
{
@@ -4381,8 +4786,20 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
index_type = TREE_TYPE (index);
}
+ /* Optimize the special-case of a zero lower bound.
+
+ We convert the low_bound to sizetype to avoid some problems
+ with constant folding. (E.g. suppose the lower bound is 1,
+ and its mode is QI. Without the conversion, (ARRAY
+ +(INDEX-(unsigned char)1)) becomes ((ARRAY+(-(unsigned char)1))
+ +INDEX), which becomes (ARRAY+255+INDEX). Oops!)
+
+ But sizetype isn't quite right either (especially if
+ the lowbound is negative). FIXME */
+
if (! integer_zerop (low_bound))
- index = fold (build (MINUS_EXPR, index_type, index, low_bound));
+ index = fold (build (MINUS_EXPR, index_type, index,
+ convert (sizetype, low_bound)));
if (TREE_CODE (index) == INTEGER_CST)
{
@@ -4390,21 +4807,27 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
index_type = TREE_TYPE (index);
}
- index = fold (build (MULT_EXPR, sbitsizetype, index,
- convert (sbitsizetype,
- TYPE_SIZE (TREE_TYPE (exp)))));
+ xindex = fold (build (MULT_EXPR, sbitsizetype, index,
+ convert (sbitsizetype,
+ TYPE_SIZE (TREE_TYPE (exp)))));
- if (TREE_CODE (index) == INTEGER_CST
- && TREE_INT_CST_HIGH (index) == 0)
- *pbitpos += TREE_INT_CST_LOW (index);
+ if (TREE_CODE (xindex) == INTEGER_CST
+ && TREE_INT_CST_HIGH (xindex) == 0)
+ *pbitpos += TREE_INT_CST_LOW (xindex);
else
{
- if (contains_placeholder_p (index))
- index = build (WITH_RECORD_EXPR, sizetype, index, exp);
-
- offset = size_binop (PLUS_EXPR, offset,
- size_binop (FLOOR_DIV_EXPR, index,
- size_int (BITS_PER_UNIT)));
+ /* Either the bit offset calculated above is not constant, or
+ it overflowed. In either case, redo the multiplication
+ against the size in units. This is especially important
+ in the non-constant case to avoid a division at runtime. */
+ xindex = fold (build (MULT_EXPR, ssizetype, index,
+ convert (ssizetype,
+ TYPE_SIZE_UNIT (TREE_TYPE (exp)))));
+
+ if (contains_placeholder_p (xindex))
+ xindex = build (WITH_RECORD_EXPR, sizetype, xindex, exp);
+
+ offset = size_binop (PLUS_EXPR, offset, xindex);
}
}
else if (TREE_CODE (exp) != NON_LVALUE_EXPR
@@ -4495,6 +4918,20 @@ force_operand (value, target)
/* Use subtarget as the target for operand 0 of a binary operation. */
register rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
+ /* Check for a PIC address load. */
+ if (flag_pic
+ && (GET_CODE (value) == PLUS || GET_CODE (value) == MINUS)
+ && XEXP (value, 0) == pic_offset_table_rtx
+ && (GET_CODE (XEXP (value, 1)) == SYMBOL_REF
+ || GET_CODE (XEXP (value, 1)) == LABEL_REF
+ || GET_CODE (XEXP (value, 1)) == CONST))
+ {
+ if (!subtarget)
+ subtarget = gen_reg_rtx (GET_MODE (value));
+ emit_move_insn (subtarget, value);
+ return subtarget;
+ }
+
if (GET_CODE (value) == PLUS)
binoptab = add_optab;
else if (GET_CODE (value) == MINUS)
@@ -4614,7 +5051,10 @@ init_noncopied_parts (lhs, list)
/* Subroutine of expand_expr: return nonzero iff there is no way that
EXP can reference X, which is being modified. TOP_P is nonzero if this
call is going to be used to determine whether we need a temporary
- for EXP, as opposed to a recursive call to this function. */
+ for EXP, as opposed to a recursive call to this function.
+
+ It is always safe for this routine to return zero since it merely
+ searches for optimization opportunities. */
static int
safe_from_p (x, exp, top_p)
@@ -4624,6 +5064,10 @@ safe_from_p (x, exp, top_p)
{
rtx exp_rtl = 0;
int i, nops;
+ static int save_expr_count;
+ static int save_expr_size = 0;
+ static tree *save_expr_rewritten;
+ static tree save_expr_trees[256];
if (x == 0
/* If EXP has varying size, we MUST use a target since we currently
@@ -4641,6 +5085,28 @@ safe_from_p (x, exp, top_p)
&& GET_MODE (x) == BLKmode))
return 1;
+ if (top_p && save_expr_size == 0)
+ {
+ int rtn;
+
+ save_expr_count = 0;
+ save_expr_size = sizeof (save_expr_trees) / sizeof (save_expr_trees[0]);
+ save_expr_rewritten = &save_expr_trees[0];
+
+ rtn = safe_from_p (x, exp, 1);
+
+ for (i = 0; i < save_expr_count; ++i)
+ {
+ if (TREE_CODE (save_expr_trees[i]) != ERROR_MARK)
+ abort ();
+ TREE_SET_CODE (save_expr_trees[i], SAVE_EXPR);
+ }
+
+ save_expr_size = 0;
+
+ return rtn;
+ }
+
/* If this is a subreg of a hard register, declare it unsafe, otherwise,
find the underlying pseudo. */
if (GET_CODE (x) == SUBREG)
@@ -4672,6 +5138,8 @@ safe_from_p (x, exp, top_p)
|| safe_from_p (x, TREE_VALUE (exp), 0))
&& (TREE_CHAIN (exp) == 0
|| safe_from_p (x, TREE_CHAIN (exp), 0)));
+ else if (TREE_CODE (exp) == ERROR_MARK)
+ return 1; /* An already-visited SAVE_EXPR? */
else
return 0;
@@ -4734,7 +5202,41 @@ safe_from_p (x, exp, top_p)
case SAVE_EXPR:
exp_rtl = SAVE_EXPR_RTL (exp);
- break;
+ if (exp_rtl)
+ break;
+
+ /* This SAVE_EXPR might appear many times in the top-level
+ safe_from_p() expression, and if it has a complex
+ subexpression, examining it multiple times could result
+ in a combinatorial explosion. E.g. on an Alpha
+ running at least 200MHz, a Fortran test case compiled with
+ optimization took about 28 minutes to compile -- even though
+ it was only a few lines long, and the complicated line causing
+ so much time to be spent in the earlier version of safe_from_p()
+ had only 293 or so unique nodes.
+
+ So, turn this SAVE_EXPR into an ERROR_MARK for now, but remember
+ where it is so we can turn it back in the top-level safe_from_p()
+ when we're done. */
+
+ /* For now, don't bother re-sizing the array. */
+ if (save_expr_count >= save_expr_size)
+ return 0;
+ save_expr_rewritten[save_expr_count++] = exp;
+
+ nops = tree_code_length[(int) SAVE_EXPR];
+ for (i = 0; i < nops; i++)
+ {
+ tree operand = TREE_OPERAND (exp, i);
+ if (operand == NULL_TREE)
+ continue;
+ TREE_SET_CODE (exp, ERROR_MARK);
+ if (!safe_from_p (x, operand, 0))
+ return 0;
+ TREE_SET_CODE (exp, SAVE_EXPR);
+ }
+ TREE_SET_CODE (exp, ERROR_MARK);
+ return 1;
case BIND_EXPR:
/* The only operand we look at is operand 1. The rest aren't
@@ -4816,6 +5318,57 @@ var_rtx (exp)
return 0;
}
}
+
+#ifdef MAX_INTEGER_COMPUTATION_MODE
+void
+check_max_integer_computation_mode (exp)
+ tree exp;
+{
+ enum tree_code code = TREE_CODE (exp);
+ enum machine_mode mode;
+
+ /* We must allow conversions of constants to MAX_INTEGER_COMPUTATION_MODE. */
+ if (code == NOP_EXPR
+ && TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST)
+ return;
+
+ /* First check the type of the overall operation. We need only look at
+ unary, binary and relational operations. */
+ if (TREE_CODE_CLASS (code) == '1'
+ || TREE_CODE_CLASS (code) == '2'
+ || TREE_CODE_CLASS (code) == '<')
+ {
+ mode = TYPE_MODE (TREE_TYPE (exp));
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && mode > MAX_INTEGER_COMPUTATION_MODE)
+ fatal ("unsupported wide integer operation");
+ }
+
+ /* Check operand of a unary op. */
+ if (TREE_CODE_CLASS (code) == '1')
+ {
+ mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && mode > MAX_INTEGER_COMPUTATION_MODE)
+ fatal ("unsupported wide integer operation");
+ }
+
+ /* Check operands of a binary/comparison op. */
+ if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<')
+ {
+ mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && mode > MAX_INTEGER_COMPUTATION_MODE)
+ fatal ("unsupported wide integer operation");
+
+ mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)));
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && mode > MAX_INTEGER_COMPUTATION_MODE)
+ fatal ("unsupported wide integer operation");
+ }
+}
+#endif
+
/* expand_expr: generate code for computing expression EXP.
An rtx for the computed value is returned. The value is never null.
@@ -4938,6 +5491,37 @@ expand_expr (exp, target, tmode, modifier)
target = 0;
}
+#ifdef MAX_INTEGER_COMPUTATION_MODE
+ if (target
+ && TREE_CODE (exp) != INTEGER_CST
+ && TREE_CODE (exp) != PARM_DECL
+ && TREE_CODE (exp) != ARRAY_REF
+ && TREE_CODE (exp) != COMPONENT_REF
+ && TREE_CODE (exp) != BIT_FIELD_REF
+ && TREE_CODE (exp) != INDIRECT_REF
+ && TREE_CODE (exp) != VAR_DECL)
+ {
+ enum machine_mode mode = GET_MODE (target);
+
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && mode > MAX_INTEGER_COMPUTATION_MODE)
+ fatal ("unsupported wide integer operation");
+ }
+
+ if (TREE_CODE (exp) != INTEGER_CST
+ && TREE_CODE (exp) != PARM_DECL
+ && TREE_CODE (exp) != ARRAY_REF
+ && TREE_CODE (exp) != COMPONENT_REF
+ && TREE_CODE (exp) != BIT_FIELD_REF
+ && TREE_CODE (exp) != INDIRECT_REF
+ && TREE_CODE (exp) != VAR_DECL
+ && GET_MODE_CLASS (tmode) == MODE_INT
+ && tmode > MAX_INTEGER_COMPUTATION_MODE)
+ fatal ("unsupported wide integer operation");
+
+ check_max_integer_computation_mode (exp);
+#endif
+
/* If will do cse, generate all results into pseudo registers
since 1) that allows cse to find more things
and 2) otherwise cse could produce an insn the machine
@@ -5170,9 +5754,20 @@ expand_expr (exp, target, tmode, modifier)
return TREE_CST_RTL (exp);
case EXPR_WITH_FILE_LOCATION:
- if (EXPR_WFL_EMIT_LINE_NOTE (exp))
- emit_line_note (EXPR_WFL_FILENAME (exp), EXPR_WFL_LINENO (exp));
- return expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
+ {
+ rtx to_return;
+ char *saved_input_filename = input_filename;
+ int saved_lineno = lineno;
+ input_filename = EXPR_WFL_FILENAME (exp);
+ lineno = EXPR_WFL_LINENO (exp);
+ if (EXPR_WFL_EMIT_LINE_NOTE (exp))
+ emit_line_note (input_filename, lineno);
+ /* Possibly avoid switching back and force here */
+ to_return = expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
+ input_filename = saved_input_filename;
+ lineno = saved_lineno;
+ return to_return;
+ }
case SAVE_EXPR:
context = decl_function_context (exp);
@@ -5343,11 +5938,30 @@ expand_expr (exp, target, tmode, modifier)
placeholder_list = TREE_CHAIN (placeholder_list);
return target;
+ case GOTO_EXPR:
+ if (TREE_CODE (TREE_OPERAND (exp, 0)) == LABEL_DECL)
+ expand_goto (TREE_OPERAND (exp, 0));
+ else
+ expand_computed_goto (TREE_OPERAND (exp, 0));
+ return const0_rtx;
+
case EXIT_EXPR:
expand_exit_loop_if_false (NULL_PTR,
invert_truthvalue (TREE_OPERAND (exp, 0)));
return const0_rtx;
+ case LABELED_BLOCK_EXPR:
+ if (LABELED_BLOCK_BODY (exp))
+ expand_expr_stmt (LABELED_BLOCK_BODY (exp));
+ emit_label (label_rtx (LABELED_BLOCK_LABEL (exp)));
+ return const0_rtx;
+
+ case EXIT_BLOCK_EXPR:
+ if (EXIT_BLOCK_RETURN (exp))
+ really_sorry ("returned value in block_exit_expr");
+ expand_goto (LABELED_BLOCK_LABEL (EXIT_BLOCK_LABELED_BLOCK (exp)));
+ return const0_rtx;
+
case LOOP_EXPR:
push_temp_slots ();
expand_start_loop (1);
@@ -5429,7 +6043,7 @@ expand_expr (exp, target, tmode, modifier)
&& (move_by_pieces_ninsns
(TREE_INT_CST_LOW (TYPE_SIZE (type))/BITS_PER_UNIT,
TYPE_ALIGN (type) / BITS_PER_UNIT)
- > MOVE_RATIO)
+ >= MOVE_RATIO)
&& ! mostly_zeros_p (exp))))
|| (modifier == EXPAND_INITIALIZER && TREE_CONSTANT (exp)))
{
@@ -5514,15 +6128,36 @@ expand_expr (exp, target, tmode, modifier)
temp = gen_rtx_MEM (mode, op0);
/* If address was computed by addition,
mark this as an element of an aggregate. */
- if (TREE_CODE (TREE_OPERAND (exp, 0)) == PLUS_EXPR
- || (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR
- && TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) == PLUS_EXPR)
+ if (TREE_CODE (exp1) == PLUS_EXPR
+ || (TREE_CODE (exp1) == SAVE_EXPR
+ && TREE_CODE (TREE_OPERAND (exp1, 0)) == PLUS_EXPR)
|| AGGREGATE_TYPE_P (TREE_TYPE (exp))
|| (TREE_CODE (exp1) == ADDR_EXPR
&& (exp2 = TREE_OPERAND (exp1, 0))
&& AGGREGATE_TYPE_P (TREE_TYPE (exp2))))
MEM_IN_STRUCT_P (temp) = 1;
+
+ /* If the pointer is actually a REFERENCE_TYPE, this could be pointing
+ into some aggregate too. In theory we could fold this into the
+ previous check and use rtx_addr_varies_p there too.
+
+ However, this seems safer. */
+ if (!MEM_IN_STRUCT_P (temp)
+ && (TREE_CODE (TREE_TYPE (exp1)) == REFERENCE_TYPE
+ /* This may have been an array reference to the first element
+ that was optimized away from being an addition. */
+ || (TREE_CODE (exp1) == NOP_EXPR
+ && ((TREE_CODE (TREE_TYPE (TREE_OPERAND (exp1, 0)))
+ == REFERENCE_TYPE)
+ || ((TREE_CODE (TREE_TYPE (TREE_OPERAND (exp1, 0)))
+ == POINTER_TYPE)
+ && (AGGREGATE_TYPE_P
+ (TREE_TYPE (TREE_TYPE
+ (TREE_OPERAND (exp1, 0))))))))))
+ MEM_IN_STRUCT_P (temp) = ! rtx_addr_varies_p (temp);
+
MEM_VOLATILE_P (temp) = TREE_THIS_VOLATILE (exp) | flag_volatile;
+ MEM_ALIAS_SET (temp) = get_alias_set (exp);
/* It is incorrect to set RTX_UNCHANGING_P from TREE_READONLY
here, because, in C and C++, the fact that a location is accessed
@@ -5734,11 +6369,34 @@ expand_expr (exp, target, tmode, modifier)
abort ();
if (GET_MODE (offset_rtx) != ptr_mode)
+ {
#ifdef POINTERS_EXTEND_UNSIGNED
- offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
+ offset_rtx = convert_memory_address (ptr_mode, offset_rtx);
#else
- offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#endif
+ }
+
+ if (GET_CODE (op0) == MEM
+ && GET_MODE (op0) == BLKmode
+ && bitsize
+ && (bitpos % bitsize) == 0
+ && (bitsize % GET_MODE_ALIGNMENT (mode1)) == 0
+ && (alignment * BITS_PER_UNIT) == GET_MODE_ALIGNMENT (mode1))
+ {
+ rtx temp = change_address (op0, mode1,
+ plus_constant (XEXP (op0, 0),
+ (bitpos /
+ BITS_PER_UNIT)));
+ if (GET_CODE (XEXP (temp, 0)) == REG)
+ op0 = temp;
+ else
+ op0 = change_address (op0, mode1,
+ force_reg (GET_MODE (XEXP (temp, 0)),
+ XEXP (temp, 0)));
+ bitpos = 0;
+ }
+
op0 = change_address (op0, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (op0, 0),
@@ -5875,6 +6533,10 @@ expand_expr (exp, target, tmode, modifier)
op0 = change_address (op0, mode1,
plus_constant (XEXP (op0, 0),
(bitpos / BITS_PER_UNIT)));
+
+ if (GET_CODE (op0) == MEM)
+ MEM_ALIAS_SET (op0) = get_alias_set (exp);
+
if (GET_CODE (XEXP (op0, 0)) == REG)
mark_reg_pointer (XEXP (op0, 0), alignment);
@@ -6076,7 +6738,8 @@ expand_expr (exp, target, tmode, modifier)
store_field (target, GET_MODE_BITSIZE (TYPE_MODE (valtype)), 0,
TYPE_MODE (valtype), TREE_OPERAND (exp, 0),
VOIDmode, 0, 1,
- int_size_in_bytes (TREE_TYPE (TREE_OPERAND (exp, 0))));
+ int_size_in_bytes (TREE_TYPE (TREE_OPERAND (exp, 0))),
+ 0);
else
abort ();
@@ -7177,6 +7840,13 @@ expand_expr (exp, target, tmode, modifier)
return temp;
}
+ case RETURN_EXPR:
+ if (!TREE_OPERAND (exp, 0))
+ expand_null_return ();
+ else
+ expand_return (TREE_OPERAND (exp, 0));
+ return const0_rtx;
+
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
return expand_increment (exp, 0, ignore);
@@ -7236,7 +7906,7 @@ expand_expr (exp, target, tmode, modifier)
}
else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
- || GET_CODE (op0) == CONCAT)
+ || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF)
{
/* If this object is in a register, it must be not
be BLKmode. */
@@ -7669,7 +8339,8 @@ expand_builtin_setjmp (buf_addr, target, first_label, next_label)
rtx first_label, next_label;
{
rtx lab1 = gen_label_rtx ();
- enum machine_mode sa_mode = Pmode, value_mode;
+ enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
+ enum machine_mode value_mode;
rtx stack_save;
value_mode = TYPE_MODE (integer_type_node);
@@ -7689,19 +8360,19 @@ expand_builtin_setjmp (buf_addr, target, first_label, next_label)
/* We store the frame pointer and the address of lab1 in the buffer
and use the rest of it for the stack save area, which is
machine-dependent. */
+
+#ifndef BUILTIN_SETJMP_FRAME_VALUE
+#define BUILTIN_SETJMP_FRAME_VALUE virtual_stack_vars_rtx
+#endif
+
emit_move_insn (gen_rtx_MEM (Pmode, buf_addr),
- virtual_stack_vars_rtx);
+ BUILTIN_SETJMP_FRAME_VALUE);
emit_move_insn (validize_mem
(gen_rtx_MEM (Pmode,
plus_constant (buf_addr,
GET_MODE_SIZE (Pmode)))),
gen_rtx_LABEL_REF (Pmode, lab1));
-#ifdef HAVE_save_stack_nonlocal
- if (HAVE_save_stack_nonlocal)
- sa_mode = insn_operand_mode[(int) CODE_FOR_save_stack_nonlocal][0];
-#endif
-
stack_save = gen_rtx_MEM (sa_mode,
plus_constant (buf_addr,
2 * GET_MODE_SIZE (Pmode)));
@@ -7781,7 +8452,7 @@ expand_builtin_setjmp (buf_addr, target, first_label, next_label)
}
/* Set TARGET, and branch to the next-time-through label. */
- emit_move_insn (target, gen_lowpart (GET_MODE (target), static_chain_rtx));
+ emit_move_insn (target, const1_rtx);
emit_jump_insn (gen_jump (next_label));
emit_barrier ();
@@ -7793,42 +8464,24 @@ expand_builtin_longjmp (buf_addr, value)
rtx buf_addr, value;
{
rtx fp, lab, stack;
- enum machine_mode sa_mode;
+ enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
#ifdef POINTERS_EXTEND_UNSIGNED
buf_addr = convert_memory_address (Pmode, buf_addr);
#endif
buf_addr = force_reg (Pmode, buf_addr);
- /* The value sent by longjmp is not allowed to be zero. Force it
- to one if so. */
- if (GET_CODE (value) == CONST_INT)
- {
- if (INTVAL (value) == 0)
- value = const1_rtx;
- }
- else
- {
- lab = gen_label_rtx ();
-
- emit_cmp_insn (value, const0_rtx, NE, NULL_RTX, GET_MODE (value), 0, 0);
- emit_jump_insn (gen_bne (lab));
- emit_move_insn (value, const1_rtx);
- emit_label (lab);
- }
-
- /* Make sure the value is in the right mode to be copied to the chain. */
- if (GET_MODE (value) != VOIDmode)
- value = gen_lowpart (GET_MODE (static_chain_rtx), value);
+ /* We used to store value in static_chain_rtx, but that fails if pointers
+ are smaller than integers. We instead require that the user must pass
+ a second argument of 1, because that is what builtin_setjmp will
+ return. This also makes EH slightly more efficient, since we are no
+ longer copying around a value that we don't care about. */
+ if (value != const1_rtx)
+ abort ();
#ifdef HAVE_builtin_longjmp
if (HAVE_builtin_longjmp)
- {
- /* Copy the "return value" to the static chain reg. */
- emit_move_insn (static_chain_rtx, value);
- emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
- emit_insn (gen_builtin_longjmp (buf_addr));
- }
+ emit_insn (gen_builtin_longjmp (buf_addr));
else
#endif
{
@@ -7836,14 +8489,6 @@ expand_builtin_longjmp (buf_addr, value)
lab = gen_rtx_MEM (Pmode, plus_constant (buf_addr,
GET_MODE_SIZE (Pmode)));
-#ifdef HAVE_save_stack_nonlocal
- sa_mode = (HAVE_save_stack_nonlocal
- ? insn_operand_mode[(int) CODE_FOR_save_stack_nonlocal][0]
- : Pmode);
-#else
- sa_mode = Pmode;
-#endif
-
stack = gen_rtx_MEM (sa_mode, plus_constant (buf_addr,
2 * GET_MODE_SIZE (Pmode)));
@@ -7851,26 +8496,73 @@ expand_builtin_longjmp (buf_addr, value)
from expand_goto in stmt.c; see there for detailed comments. */
#if HAVE_nonlocal_goto
if (HAVE_nonlocal_goto)
+ /* We have to pass a value to the nonlocal_goto pattern that will
+ get copied into the static_chain pointer, but it does not matter
+ what that value is, because builtin_setjmp does not use it. */
emit_insn (gen_nonlocal_goto (value, fp, stack, lab));
else
#endif
{
lab = copy_to_reg (lab);
- /* Copy the "return value" to the static chain reg. */
- emit_move_insn (static_chain_rtx, value);
-
emit_move_insn (hard_frame_pointer_rtx, fp);
emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
- emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
emit_indirect_jump (lab);
}
}
}
+static rtx
+get_memory_rtx (exp)
+ tree exp;
+{
+ rtx mem;
+ int is_aggregate;
+
+ mem = gen_rtx_MEM (BLKmode,
+ memory_address (BLKmode,
+ expand_expr (exp, NULL_RTX,
+ ptr_mode, EXPAND_SUM)));
+
+ RTX_UNCHANGING_P (mem) = TREE_READONLY (exp);
+
+ /* Figure out the type of the object pointed to. Set MEM_IN_STRUCT_P
+ if the value is the address of a structure or if the expression is
+ cast to a pointer to structure type. */
+ is_aggregate = 0;
+
+ while (TREE_CODE (exp) == NOP_EXPR)
+ {
+ tree cast_type = TREE_TYPE (exp);
+ if (TREE_CODE (cast_type) == POINTER_TYPE
+ && AGGREGATE_TYPE_P (TREE_TYPE (cast_type)))
+ {
+ is_aggregate = 1;
+ break;
+ }
+ exp = TREE_OPERAND (exp, 0);
+ }
+
+ if (is_aggregate == 0)
+ {
+ tree type;
+
+ if (TREE_CODE (exp) == ADDR_EXPR)
+ /* If this is the address of an object, check whether the
+ object is an array. */
+ type = TREE_TYPE (TREE_OPERAND (exp, 0));
+ else
+ type = TREE_TYPE (TREE_TYPE (exp));
+ is_aggregate = AGGREGATE_TYPE_P (type);
+ }
+
+ MEM_IN_STRUCT_P (mem) = is_aggregate;
+ return mem;
+}
+
/* Expand an expression EXP that calls a built-in function,
with result going to TARGET if that's convenient
@@ -8292,10 +8984,34 @@ expand_builtin (exp, target, subtarget, mode, ignore)
tree arg = TREE_VALUE (arglist);
STRIP_NOPS (arg);
- return (TREE_CODE_CLASS (TREE_CODE (arg)) == 'c'
- || (TREE_CODE (arg) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (arg, 0)) == STRING_CST)
- ? const1_rtx : const0_rtx);
+ if (really_constant_p (arg)
+ || (TREE_CODE (arg) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (arg, 0)) == STRING_CST))
+ return const1_rtx;
+
+ /* Only emit CONSTANT_P_RTX if CSE will be run.
+ Moreover, we don't want to expand trees that have side effects,
+ as the original __builtin_constant_p did not evaluate its
+ argument at all, and we would break existing usage by changing
+ this. This quirk was generally useful, eliminating a bit of hair
+ in the writing of the macros that use this function. Now the
+ same thing can be better accomplished in an inline function. */
+
+ if (! cse_not_expected && ! TREE_SIDE_EFFECTS (arg))
+ {
+ /* Lazy fixup of old code: issue a warning and fail the test. */
+ if (! can_handle_constant_p)
+ {
+ warning ("Delayed evaluation of __builtin_constant_p not supported on this target.");
+ warning ("Please report this as a bug to egcs-bugs@cygnus.com.");
+ return const0_rtx;
+ }
+ return gen_rtx_CONSTANT_P_RTX (TYPE_MODE (integer_type_node),
+ expand_expr (arg, NULL_RTX,
+ VOIDmode, 0));
+ }
+
+ return const0_rtx;
}
case BUILT_IN_FRAME_ADDRESS:
@@ -8519,13 +9235,12 @@ expand_builtin (exp, target, subtarget, mode, ignore)
tree dest = TREE_VALUE (arglist);
tree src = TREE_VALUE (TREE_CHAIN (arglist));
tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
- tree type;
int src_align
= get_pointer_alignment (src, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
int dest_align
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
- rtx dest_rtx, dest_mem, src_mem, src_rtx, dest_addr, len_rtx;
+ rtx dest_mem, src_mem, dest_addr, len_rtx;
/* If either SRC or DEST is not a pointer type, don't do
this operation in-line. */
@@ -8536,39 +9251,24 @@ expand_builtin (exp, target, subtarget, mode, ignore)
break;
}
- dest_rtx = expand_expr (dest, NULL_RTX, ptr_mode, EXPAND_SUM);
- dest_mem = gen_rtx_MEM (BLKmode,
- memory_address (BLKmode, dest_rtx));
- /* There could be a void* cast on top of the object. */
- while (TREE_CODE (dest) == NOP_EXPR)
- dest = TREE_OPERAND (dest, 0);
- type = TREE_TYPE (TREE_TYPE (dest));
- MEM_IN_STRUCT_P (dest_mem) = AGGREGATE_TYPE_P (type);
- src_rtx = expand_expr (src, NULL_RTX, ptr_mode, EXPAND_SUM);
- src_mem = gen_rtx_MEM (BLKmode,
- memory_address (BLKmode, src_rtx));
+ dest_mem = get_memory_rtx (dest);
+ src_mem = get_memory_rtx (src);
len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0);
/* Just copy the rights of SRC to the rights of DEST. */
if (flag_check_memory_usage)
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3,
- dest_rtx, ptr_mode,
- src_rtx, ptr_mode,
+ XEXP (dest_mem, 0), ptr_mode,
+ XEXP (src_mem, 0), ptr_mode,
len_rtx, TYPE_MODE (sizetype));
- /* There could be a void* cast on top of the object. */
- while (TREE_CODE (src) == NOP_EXPR)
- src = TREE_OPERAND (src, 0);
- type = TREE_TYPE (TREE_TYPE (src));
- MEM_IN_STRUCT_P (src_mem) = AGGREGATE_TYPE_P (type);
-
/* Copy word part most expediently. */
dest_addr
= emit_block_move (dest_mem, src_mem, len_rtx,
MIN (src_align, dest_align));
if (dest_addr == 0)
- dest_addr = force_operand (dest_rtx, NULL_RTX);
+ dest_addr = force_operand (XEXP (dest_mem, 0), NULL_RTX);
return dest_addr;
}
@@ -8595,11 +9295,10 @@ expand_builtin (exp, target, subtarget, mode, ignore)
tree dest = TREE_VALUE (arglist);
tree val = TREE_VALUE (TREE_CHAIN (arglist));
tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
- tree type;
int dest_align
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
- rtx dest_rtx, dest_mem, dest_addr, len_rtx;
+ rtx dest_mem, dest_addr, len_rtx;
/* If DEST is not a pointer type, don't do this
operation in-line. */
@@ -8625,34 +9324,21 @@ expand_builtin (exp, target, subtarget, mode, ignore)
if (GET_CODE (len_rtx) != CONST_INT)
break;
- dest_rtx = expand_expr (dest, NULL_RTX, ptr_mode, EXPAND_SUM);
- dest_mem = gen_rtx_MEM (BLKmode,
- memory_address (BLKmode, dest_rtx));
+ dest_mem = get_memory_rtx (dest);
/* Just check DST is writable and mark it as readable. */
if (flag_check_memory_usage)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3,
- dest_rtx, ptr_mode,
+ XEXP (dest_mem, 0), ptr_mode,
len_rtx, TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO),
TYPE_MODE (integer_type_node));
- /* There could be a void* cast on top of the object. */
- while (TREE_CODE (dest) == NOP_EXPR)
- dest = TREE_OPERAND (dest, 0);
-
- if (TREE_CODE (dest) == ADDR_EXPR)
- /* If this is the address of an object, check whether the
- object is an array. */
- type = TREE_TYPE (TREE_OPERAND (dest, 0));
- else
- type = TREE_TYPE (TREE_TYPE (dest));
- MEM_IN_STRUCT_P (dest_mem) = AGGREGATE_TYPE_P (type);
dest_addr = clear_storage (dest_mem, len_rtx, dest_align);
if (dest_addr == 0)
- dest_addr = force_operand (dest_rtx, NULL_RTX);
+ dest_addr = force_operand (XEXP (dest_mem, 0), NULL_RTX);
return dest_addr;
}
@@ -8764,15 +9450,8 @@ expand_builtin (exp, target, subtarget, mode, ignore)
&& REGNO (result) >= FIRST_PSEUDO_REGISTER))
result = gen_reg_rtx (insn_mode);
- emit_insn (gen_cmpstrsi (result,
- gen_rtx_MEM (BLKmode,
- expand_expr (arg1, NULL_RTX,
- ptr_mode,
- EXPAND_NORMAL)),
- gen_rtx_MEM (BLKmode,
- expand_expr (arg2, NULL_RTX,
- ptr_mode,
- EXPAND_NORMAL)),
+ emit_insn (gen_cmpstrsi (result, get_memory_rtx (arg1),
+ get_memory_rtx (arg2),
expand_expr (len, NULL_RTX, VOIDmode, 0),
GEN_INT (MIN (arg1_align, arg2_align))));
@@ -8820,19 +9499,34 @@ expand_builtin (exp, target, subtarget, mode, ignore)
rtx buf_addr = expand_expr (TREE_VALUE (arglist), subtarget,
VOIDmode, 0);
rtx value = expand_expr (TREE_VALUE (TREE_CHAIN (arglist)),
- const0_rtx, VOIDmode, 0);
+ NULL_RTX, VOIDmode, 0);
+
+ if (value != const1_rtx)
+ {
+ error ("__builtin_longjmp second argument must be 1");
+ return const0_rtx;
+ }
+
expand_builtin_longjmp (buf_addr, value);
return const0_rtx;
}
+ case BUILT_IN_TRAP:
+#ifdef HAVE_trap
+ if (HAVE_trap)
+ emit_insn (gen_trap ());
+ else
+#endif
+ error ("__builtin_trap not supported by this target");
+ emit_barrier ();
+ return const0_rtx;
+
/* Various hooks for the DWARF 2 __throw routine. */
case BUILT_IN_UNWIND_INIT:
expand_builtin_unwind_init ();
return const0_rtx;
- case BUILT_IN_FP:
- return frame_pointer_rtx;
- case BUILT_IN_SP:
- return stack_pointer_rtx;
+ case BUILT_IN_DWARF_CFA:
+ return virtual_cfa_rtx;
#ifdef DWARF2_UNWIND_INFO
case BUILT_IN_DWARF_FP_REGNUM:
return expand_builtin_dwarf_fp_regnum ();
@@ -8843,14 +9537,10 @@ expand_builtin (exp, target, subtarget, mode, ignore)
return expand_builtin_frob_return_addr (TREE_VALUE (arglist));
case BUILT_IN_EXTRACT_RETURN_ADDR:
return expand_builtin_extract_return_addr (TREE_VALUE (arglist));
- case BUILT_IN_SET_RETURN_ADDR_REG:
- expand_builtin_set_return_addr_reg (TREE_VALUE (arglist));
- return const0_rtx;
- case BUILT_IN_EH_STUB:
- return expand_builtin_eh_stub ();
- case BUILT_IN_SET_EH_REGS:
- expand_builtin_set_eh_regs (TREE_VALUE (arglist),
- TREE_VALUE (TREE_CHAIN (arglist)));
+ case BUILT_IN_EH_RETURN:
+ expand_builtin_eh_return (TREE_VALUE (arglist),
+ TREE_VALUE (TREE_CHAIN (arglist)),
+ TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))));
return const0_rtx;
default: /* just do library call, if unknown builtin */
@@ -9725,6 +10415,10 @@ do_jump (exp, if_false_label, if_true_label)
tree type;
enum machine_mode mode;
+#ifdef MAX_INTEGER_COMPUTATION_MODE
+ check_max_integer_computation_mode (exp);
+#endif
+
emit_queue ();
switch (code)
@@ -9912,28 +10606,34 @@ do_jump (exp, if_false_label, if_true_label)
{
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
- if (integer_zerop (TREE_OPERAND (exp, 1)))
+ if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_FLOAT
+ || GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_INT)
+ {
+ tree exp0 = save_expr (TREE_OPERAND (exp, 0));
+ tree exp1 = save_expr (TREE_OPERAND (exp, 1));
+ do_jump
+ (fold
+ (build (TRUTH_ANDIF_EXPR, TREE_TYPE (exp),
+ fold (build (EQ_EXPR, TREE_TYPE (exp),
+ fold (build1 (REALPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp0)),
+ fold (build1 (REALPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp1)))),
+ fold (build (EQ_EXPR, TREE_TYPE (exp),
+ fold (build1 (IMAGPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp0)),
+ fold (build1 (IMAGPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp1)))))),
+ if_false_label, if_true_label);
+ }
+
+ else if (integer_zerop (TREE_OPERAND (exp, 1)))
do_jump (TREE_OPERAND (exp, 0), if_true_label, if_false_label);
- else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_FLOAT
- || GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_INT)
- do_jump
- (fold
- (build (TRUTH_ANDIF_EXPR, TREE_TYPE (exp),
- fold (build (EQ_EXPR, TREE_TYPE (exp),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 0))),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 1))))),
- fold (build (EQ_EXPR, TREE_TYPE (exp),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 0))),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 1))))))),
- if_false_label, if_true_label);
+
else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_INT
&& !can_compare_p (TYPE_MODE (inner_type)))
do_jump_by_parts_equality (exp, if_false_label, if_true_label);
@@ -9946,28 +10646,34 @@ do_jump (exp, if_false_label, if_true_label)
{
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
- if (integer_zerop (TREE_OPERAND (exp, 1)))
+ if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_FLOAT
+ || GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_INT)
+ {
+ tree exp0 = save_expr (TREE_OPERAND (exp, 0));
+ tree exp1 = save_expr (TREE_OPERAND (exp, 1));
+ do_jump
+ (fold
+ (build (TRUTH_ORIF_EXPR, TREE_TYPE (exp),
+ fold (build (NE_EXPR, TREE_TYPE (exp),
+ fold (build1 (REALPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp0)),
+ fold (build1 (REALPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp1)))),
+ fold (build (NE_EXPR, TREE_TYPE (exp),
+ fold (build1 (IMAGPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp0)),
+ fold (build1 (IMAGPART_EXPR,
+ TREE_TYPE (inner_type),
+ exp1)))))),
+ if_false_label, if_true_label);
+ }
+
+ else if (integer_zerop (TREE_OPERAND (exp, 1)))
do_jump (TREE_OPERAND (exp, 0), if_false_label, if_true_label);
- else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_FLOAT
- || GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_COMPLEX_INT)
- do_jump
- (fold
- (build (TRUTH_ORIF_EXPR, TREE_TYPE (exp),
- fold (build (NE_EXPR, TREE_TYPE (exp),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 0))),
- fold (build1 (REALPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 1))))),
- fold (build (NE_EXPR, TREE_TYPE (exp),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 0))),
- fold (build1 (IMAGPART_EXPR,
- TREE_TYPE (inner_type),
- TREE_OPERAND (exp, 1))))))),
- if_false_label, if_true_label);
+
else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_INT
&& !can_compare_p (TYPE_MODE (inner_type)))
do_jump_by_parts_equality (exp, if_true_label, if_false_label);
diff --git a/gcc/expr.h b/gcc/expr.h
index fc9125eeb15..bf623211043 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -30,7 +30,8 @@ Boston, MA 02111-1307, USA. */
/* The variable for which an increment is queued. */
#define QUEUED_VAR(P) XEXP (P, 0)
/* If the increment has been emitted, this is the insn
- that does the increment. It is zero before the increment is emitted. */
+ that does the increment. It is zero before the increment is emitted.
+ If more than one insn is emitted, this is the first insn. */
#define QUEUED_INSN(P) XEXP (P, 1)
/* If a pre-increment copy has been generated, this is the copy
(it is a temporary reg). Zero if no copy made yet. */
@@ -245,6 +246,20 @@ enum direction {none, upward, downward}; /* Value has this type. */
#define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode)
#endif
+/* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save.
+ Normally move_insn, so Pmode stack pointer. */
+
+#ifndef STACK_SAVEAREA_MODE
+#define STACK_SAVEAREA_MODE(LEVEL) Pmode
+#endif
+
+/* Supply a default definition of STACK_SIZE_MODE for
+ allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */
+
+#ifndef STACK_SIZE_MODE
+#define STACK_SIZE_MODE word_mode
+#endif
+
/* Provide default values for the macros controlling stack checking. */
#ifndef STACK_CHECK_BUILTIN
@@ -438,98 +453,103 @@ enum optab_methods
#define terminate_libfunc all_libfuncs[19]
#define setjmp_libfunc all_libfuncs[20]
#define longjmp_libfunc all_libfuncs[21]
-
-#define eqhf2_libfunc all_libfuncs[22]
-#define nehf2_libfunc all_libfuncs[23]
-#define gthf2_libfunc all_libfuncs[24]
-#define gehf2_libfunc all_libfuncs[25]
-#define lthf2_libfunc all_libfuncs[26]
-#define lehf2_libfunc all_libfuncs[27]
-
-#define eqsf2_libfunc all_libfuncs[28]
-#define nesf2_libfunc all_libfuncs[29]
-#define gtsf2_libfunc all_libfuncs[30]
-#define gesf2_libfunc all_libfuncs[31]
-#define ltsf2_libfunc all_libfuncs[32]
-#define lesf2_libfunc all_libfuncs[33]
-
-#define eqdf2_libfunc all_libfuncs[34]
-#define nedf2_libfunc all_libfuncs[35]
-#define gtdf2_libfunc all_libfuncs[36]
-#define gedf2_libfunc all_libfuncs[37]
-#define ltdf2_libfunc all_libfuncs[38]
-#define ledf2_libfunc all_libfuncs[39]
-
-#define eqxf2_libfunc all_libfuncs[40]
-#define nexf2_libfunc all_libfuncs[41]
-#define gtxf2_libfunc all_libfuncs[42]
-#define gexf2_libfunc all_libfuncs[43]
-#define ltxf2_libfunc all_libfuncs[44]
-#define lexf2_libfunc all_libfuncs[45]
-
-#define eqtf2_libfunc all_libfuncs[46]
-#define netf2_libfunc all_libfuncs[47]
-#define gttf2_libfunc all_libfuncs[48]
-#define getf2_libfunc all_libfuncs[49]
-#define lttf2_libfunc all_libfuncs[50]
-#define letf2_libfunc all_libfuncs[51]
-
-#define floatsisf_libfunc all_libfuncs[52]
-#define floatdisf_libfunc all_libfuncs[53]
-#define floattisf_libfunc all_libfuncs[54]
-
-#define floatsidf_libfunc all_libfuncs[55]
-#define floatdidf_libfunc all_libfuncs[56]
-#define floattidf_libfunc all_libfuncs[57]
-
-#define floatsixf_libfunc all_libfuncs[58]
-#define floatdixf_libfunc all_libfuncs[59]
-#define floattixf_libfunc all_libfuncs[60]
-
-#define floatsitf_libfunc all_libfuncs[61]
-#define floatditf_libfunc all_libfuncs[62]
-#define floattitf_libfunc all_libfuncs[63]
-
-#define fixsfsi_libfunc all_libfuncs[64]
-#define fixsfdi_libfunc all_libfuncs[65]
-#define fixsfti_libfunc all_libfuncs[66]
-
-#define fixdfsi_libfunc all_libfuncs[67]
-#define fixdfdi_libfunc all_libfuncs[68]
-#define fixdfti_libfunc all_libfuncs[69]
-
-#define fixxfsi_libfunc all_libfuncs[70]
-#define fixxfdi_libfunc all_libfuncs[71]
-#define fixxfti_libfunc all_libfuncs[72]
-
-#define fixtfsi_libfunc all_libfuncs[73]
-#define fixtfdi_libfunc all_libfuncs[74]
-#define fixtfti_libfunc all_libfuncs[75]
-
-#define fixunssfsi_libfunc all_libfuncs[76]
-#define fixunssfdi_libfunc all_libfuncs[77]
-#define fixunssfti_libfunc all_libfuncs[78]
-
-#define fixunsdfsi_libfunc all_libfuncs[79]
-#define fixunsdfdi_libfunc all_libfuncs[80]
-#define fixunsdfti_libfunc all_libfuncs[81]
-
-#define fixunsxfsi_libfunc all_libfuncs[82]
-#define fixunsxfdi_libfunc all_libfuncs[83]
-#define fixunsxfti_libfunc all_libfuncs[84]
-
-#define fixunstfsi_libfunc all_libfuncs[85]
-#define fixunstfdi_libfunc all_libfuncs[86]
-#define fixunstfti_libfunc all_libfuncs[87]
+#define eh_rtime_match_libfunc all_libfuncs[22]
+
+#define eqhf2_libfunc all_libfuncs[23]
+#define nehf2_libfunc all_libfuncs[24]
+#define gthf2_libfunc all_libfuncs[25]
+#define gehf2_libfunc all_libfuncs[26]
+#define lthf2_libfunc all_libfuncs[27]
+#define lehf2_libfunc all_libfuncs[28]
+
+#define eqsf2_libfunc all_libfuncs[29]
+#define nesf2_libfunc all_libfuncs[30]
+#define gtsf2_libfunc all_libfuncs[31]
+#define gesf2_libfunc all_libfuncs[32]
+#define ltsf2_libfunc all_libfuncs[33]
+#define lesf2_libfunc all_libfuncs[34]
+
+#define eqdf2_libfunc all_libfuncs[35]
+#define nedf2_libfunc all_libfuncs[36]
+#define gtdf2_libfunc all_libfuncs[37]
+#define gedf2_libfunc all_libfuncs[38]
+#define ltdf2_libfunc all_libfuncs[39]
+#define ledf2_libfunc all_libfuncs[40]
+
+#define eqxf2_libfunc all_libfuncs[41]
+#define nexf2_libfunc all_libfuncs[42]
+#define gtxf2_libfunc all_libfuncs[43]
+#define gexf2_libfunc all_libfuncs[44]
+#define ltxf2_libfunc all_libfuncs[45]
+#define lexf2_libfunc all_libfuncs[46]
+
+#define eqtf2_libfunc all_libfuncs[47]
+#define netf2_libfunc all_libfuncs[48]
+#define gttf2_libfunc all_libfuncs[49]
+#define getf2_libfunc all_libfuncs[50]
+#define lttf2_libfunc all_libfuncs[51]
+#define letf2_libfunc all_libfuncs[52]
+
+#define floatsisf_libfunc all_libfuncs[53]
+#define floatdisf_libfunc all_libfuncs[54]
+#define floattisf_libfunc all_libfuncs[55]
+
+#define floatsidf_libfunc all_libfuncs[56]
+#define floatdidf_libfunc all_libfuncs[57]
+#define floattidf_libfunc all_libfuncs[58]
+
+#define floatsixf_libfunc all_libfuncs[59]
+#define floatdixf_libfunc all_libfuncs[60]
+#define floattixf_libfunc all_libfuncs[61]
+
+#define floatsitf_libfunc all_libfuncs[62]
+#define floatditf_libfunc all_libfuncs[63]
+#define floattitf_libfunc all_libfuncs[64]
+
+#define fixsfsi_libfunc all_libfuncs[65]
+#define fixsfdi_libfunc all_libfuncs[66]
+#define fixsfti_libfunc all_libfuncs[67]
+
+#define fixdfsi_libfunc all_libfuncs[68]
+#define fixdfdi_libfunc all_libfuncs[69]
+#define fixdfti_libfunc all_libfuncs[70]
+
+#define fixxfsi_libfunc all_libfuncs[71]
+#define fixxfdi_libfunc all_libfuncs[72]
+#define fixxfti_libfunc all_libfuncs[73]
+
+#define fixtfsi_libfunc all_libfuncs[74]
+#define fixtfdi_libfunc all_libfuncs[75]
+#define fixtfti_libfunc all_libfuncs[76]
+
+#define fixunssfsi_libfunc all_libfuncs[77]
+#define fixunssfdi_libfunc all_libfuncs[78]
+#define fixunssfti_libfunc all_libfuncs[79]
+
+#define fixunsdfsi_libfunc all_libfuncs[80]
+#define fixunsdfdi_libfunc all_libfuncs[81]
+#define fixunsdfti_libfunc all_libfuncs[82]
+
+#define fixunsxfsi_libfunc all_libfuncs[83]
+#define fixunsxfdi_libfunc all_libfuncs[84]
+#define fixunsxfti_libfunc all_libfuncs[85]
+
+#define fixunstfsi_libfunc all_libfuncs[86]
+#define fixunstfdi_libfunc all_libfuncs[87]
+#define fixunstfti_libfunc all_libfuncs[88]
/* For check-memory-usage. */
-#define chkr_check_addr_libfunc all_libfuncs[88]
-#define chkr_set_right_libfunc all_libfuncs[89]
-#define chkr_copy_bitmap_libfunc all_libfuncs[90]
-#define chkr_check_exec_libfunc all_libfuncs[91]
-#define chkr_check_str_libfunc all_libfuncs[92]
+#define chkr_check_addr_libfunc all_libfuncs[89]
+#define chkr_set_right_libfunc all_libfuncs[90]
+#define chkr_copy_bitmap_libfunc all_libfuncs[91]
+#define chkr_check_exec_libfunc all_libfuncs[92]
+#define chkr_check_str_libfunc all_libfuncs[93]
+
+/* For instrument-functions. */
+#define profile_function_entry_libfunc all_libfuncs[94]
+#define profile_function_exit_libfunc all_libfuncs[95]
-extern rtx all_libfuncs[93];
+extern rtx all_libfuncs[96];
typedef rtx (*rtxfun) PROTO ((rtx));
@@ -677,6 +697,9 @@ extern rtx emit_store_flag_force PROTO((rtx, enum rtx_code, rtx, rtx,
/* Given a JUMP_INSN, return a description of the test being made. */
extern rtx get_condition PROTO((rtx, rtx *));
+
+/* Generate a conditional trap instruction. */
+extern rtx gen_cond_trap PROTO((enum rtx_code, rtx, rtx, rtx));
/* Functions from expr.c: */
@@ -717,10 +740,15 @@ extern void move_block_from_reg PROTO((int, rtx, int, int));
/* Load a BLKmode value into non-consecutive registers represented by a
PARALLEL. */
-extern void emit_group_load PROTO((rtx, rtx));
+extern void emit_group_load PROTO((rtx, rtx, int, int));
/* Store a BLKmode value from non-consecutive registers represented by a
PARALLEL. */
-extern void emit_group_store PROTO((rtx, rtx));
+extern void emit_group_store PROTO((rtx, rtx, int, int));
+
+#ifdef TREE_CODE
+/* Copy BLKmode object from a set of registers. */
+extern rtx copy_blkmode_from_reg PROTO((rtx,rtx,tree));
+#endif
/* Mark REG as holding a parameter for the next CALL_INSN. */
extern void use_reg PROTO((rtx *, rtx));
@@ -960,6 +988,7 @@ extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx,
extern void init_all_optabs PROTO ((void));
extern void init_mov_optab PROTO ((void));
+extern void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx));
extern void do_jump_by_parts_greater_rtx PROTO ((enum machine_mode, int,
rtx, rtx, rtx, rtx));
diff --git a/gcc/extend.texi b/gcc/extend.texi
index a691162bf6b..45b31b82322 100644
--- a/gcc/extend.texi
+++ b/gcc/extend.texi
@@ -366,7 +366,8 @@ does not refer to anything that has gone out of scope, you should be
safe.
GNU CC implements taking the address of a nested function using a
-technique called @dfn{trampolines}.
+technique called @dfn{trampolines}. A paper describing them is
+available as @samp{http://master.debian.org/~karlheg/Usenix88-lexic.pdf}.
A nested function can jump to a label inherited from a containing
function, provided the label was explicitly declared in the containing
@@ -1285,8 +1286,9 @@ carefully.
The keyword @code{__attribute__} allows you to specify special
attributes when making a declaration. This keyword is followed by an
-attribute specification inside double parentheses. Eight attributes,
-@code{noreturn}, @code{const}, @code{format}, @code{section},
+attribute specification inside double parentheses. Nine attributes,
+@code{noreturn}, @code{const}, @code{format},
+@code{no_instrument_function}, @code{section},
@code{constructor}, @code{destructor}, @code{unused} and @code{weak} are
currently defined for functions. Other attributes, including
@code{section} are supported for variables declarations (@pxref{Variable
@@ -1446,6 +1448,12 @@ operands are a call to one of your own function. The compiler always
treats @code{gettext}, @code{dgettext}, and @code{dcgettext} in this
manner.
+@item no_instrument_function
+@cindex @code{no_instrument_function} function attribute
+If @samp{-finstrument-functions} is given, profiling function calls will
+be generated at entry and exit of most user-compiled functions.
+Functions with this attribute will not be so instrumented.
+
@item section ("section-name")
@cindex @code{section} function attribute
Normally, the compiler places the code it generates in the @code{text} section.
@@ -2014,6 +2022,9 @@ closing curly brace of a complete enum, struct or union type
@emph{definition} and the @code{packed} attribute only past the closing
brace of a definition.
+You may also specify attributes between the enum, struct or union
+tag and the name of the type rather than after the closing brace.
+
@table @code
@cindex @code{aligned} attribute
@item aligned (@var{alignment})
@@ -2589,7 +2600,9 @@ very often.
Local register variables in specific registers do not reserve the
registers. The compiler's data flow analysis is capable of determining
where the specified registers contain live values, and where they are
-available for other uses.
+available for other uses. Stores into local register variables may be deleted
+when they appear to be dead according to dataflow analysis. References
+to local register variables may be deleted or moved or simplified.
These local variables are sometimes convenient for use with the extended
@code{asm} feature (@pxref{Extended Asm}), if you want to write one
@@ -2740,6 +2753,10 @@ this variable in the register you specify at all times. You may not
code an explicit reference to this register in an @code{asm} statement
and assume it will always refer to this variable.
+Stores into local register variables may be deleted when they appear to be dead
+according to dataflow analysis. References to local register variables may
+be deleted or moved or simplified.
+
@node Alternate Keywords
@section Alternate Keywords
@cindex alternate keywords
@@ -3313,14 +3330,12 @@ instances required by your explicit instantiations (but not by any
other files) without having to specify them as well.
g++ has extended the template instantiation syntax outlined in the
-Working Paper to allow forward declaration of explicit instantiations,
-explicit instantiation of members of template classes and instantiation
-of the compiler support data for a template class (i.e. the vtable)
-without instantiating any of its members:
+Working Paper to allow forward declaration of explicit instantiations
+and instantiation of the compiler support data for a template class
+(i.e. the vtable) without instantiating any of its members:
@example
extern template int max (int, int);
-template void Foo<int>::f ();
inline template class Foo<int>;
@end example
diff --git a/gcc/f/BUGS b/gcc/f/BUGS
index aa6bf3709ea..2f136287080 100644
--- a/gcc/f/BUGS
+++ b/gcc/f/BUGS
@@ -15,26 +15,46 @@ separating them out.
For information on bugs that might afflict people who configure,
port, build, and install `g77', *Note Problems Installing::.
- * `g77''s version of `gcc', and probably `g77' itself, cannot be
- reliably used with the `-O2' option (or higher) on Digital
- Semiconductor Alpha AXP machines. The problem is most immediately
- noticed in differences discovered by `make compare' following a
- bootstrap build using `-O2'. It also manifests itself as a
- failure to compile `DATA' statements such as `DATA R/7./'
- correctly; in this case, `R' might be initialized to `4.0'.
+ * `g77' sometimes crashes when compiling code containing the
+ construct `CMPLX(0.)' or similar. This is a `gcc' back-end bug.
+ It can be worked around using `-fno-emulate-complex', though that
+ might trigger other, older bugs. Compiling without optimization
+ is another work-around.
- Until this bug is fixed, use only `-O1' or no optimization.
+ Fixed in `egcs' 1.1.
+
+ * Automatic arrays aren't working on HP-UX systems, at least in
+ HP-UX version 10.20. Writing into them apparently causes
+ over-writing of statically declared data in the main program.
+ This probably means the arrays themselves are being
+ under-allocated, or pointers to them being improperly handled,
+ e.g. not passed to other procedures as they should be.
+
+ * Some Fortran code has been found to be miscompiled by `g77' built
+ on `gcc' version 2.8.1 on m68k-next-nextstep3 configurations when
+ using the `-O2' option. Even a C function is known to miscompile
+ on that configuration when using the `-O2 -funroll-loops' options.
+
+ Fixed in `egcs'.
+
+ * A code-generation bug afflicts Intel x86 targets when `-O2' is
+ specified compiling, for example, an old version of the `DNRM2'
+ routine. The x87 coprocessor stack is being mismanaged in cases
+ where assigned `GOTO' and `ASSIGN' are involved.
+
+ Fixed in `egcs' version 1.1.
+
+ * A compiler crash, or apparently infinite run time, can result when
+ compiling complicated expressions involving `COMPLEX' arithmetic
+ (especially multiplication).
+
+ Fixed in `egcs' version 1.1.
* Something about `g77''s straightforward handling of label
references and definitions sometimes prevents the GBE from
unrolling loops. Until this is solved, try inserting or removing
`CONTINUE' statements as the terminal statement, using the `END DO'
- form instead, and so on. (Probably improved, but not wholly
- fixed, in 0.5.21.)
-
- * The `g77' command itself should more faithfully process options
- the way the `gcc' command does. For example, `gcc' accepts
- abbreviated forms of long options, `g77' generally doesn't.
+ form instead, and so on.
* Some confusion in diagnostics concerning failing `INCLUDE'
statements from within `INCLUDE''d or `#include''d files.
@@ -117,37 +137,12 @@ port, build, and install `g77', *Note Problems Installing::.
information might even lead to all relevant products working
together properly sooner.
- * `g77' currently inserts needless padding for things like `COMMON
- A,IPAD' where `A' is `CHARACTER*1' and `IPAD' is `INTEGER(KIND=1)'
- on machines like x86, because the back end insists that `IPAD' be
- aligned to a 4-byte boundary, but the processor has no such
- requirement (though it's good for performance).
-
- It is possible that this is not a real bug, and could be considered
- a performance feature, but it might be important to provide the
- ability to Fortran code to specify minimum padding for aggregate
- areas such as common blocks--and, certainly, there is the
- potential, with the current setup, for interface differences in
- the way such areas are laid out between `g77' and other compilers.
-
* `g77' doesn't work perfectly on 64-bit configurations such as the
- Alpha. This problem is expected to be largely resolved as of
- version 0.5.20, and further addressed by 0.5.21. Version 0.6
- should solve most or all related problems (such as 64-bit machines
- other than Digital Semiconductor ("DEC") Alphas).
+ Digital Semiconductor ("DEC") Alpha.
- One known bug that causes a compile-time crash occurs when
- compiling code such as the following with optimization:
-
- SUBROUTINE CRASH (TEMP)
- INTEGER*2 HALF(2)
- REAL TEMP
- HALF(1) = NINT (TEMP)
- END
-
- It is expected that a future version of `g77' will have a fix for
- this problem, almost certainly by the time `g77' supports the
- forthcoming version 2.8.0 of `gcc'.
+ This problem is largely resolved as of version 0.5.23. Version
+ 0.6 should solve most or all remaining problems (such as
+ cross-compiling involving 64-bit machines).
* Maintainers of gcc report that the back end definitely has "broken"
support for `COMPLEX' types. Based on their input, it seems many
@@ -169,3 +164,55 @@ port, build, and install `g77', *Note Problems Installing::.
in the gcc back end, and it apparently occurs only when compiling
sufficiently complicated functions *without* the `-O' option.
+ Fixed in `egcs' version 1.1.
+
+ * `g77' currently inserts needless padding for things like `COMMON
+ A,IPAD' where `A' is `CHARACTER*1' and `IPAD' is `INTEGER(KIND=1)'
+ on machines like x86, because the back end insists that `IPAD' be
+ aligned to a 4-byte boundary, but the processor has no such
+ requirement (though it is usually good for performance).
+
+ The `gcc' back end needs to provide a wider array of
+ specifications of alignment requirements and preferences for
+ targets, and front ends like `g77' should take advantage of this
+ when it becomes available.
+
+ * The x86 target's `-malign-double' option no longer reliably aligns
+ double-precision variables and arrays when they are placed in the
+ stack frame.
+
+ This can significantly reduce the performance of some applications,
+ even on a run-to-run basis (that is, performance measurements can
+ vary fairly widely depending on whether frequently used variables
+ are properly aligned, and that can change from one program run to
+ the next, even from one procedure call to the next).
+
+ Versions 0.5.22 and earlier of `g77' included a patch to `gcc'
+ that enabled this, but that patch has been deemed an improper
+ (probably buggy) one for version 2.8 of `gcc' and for `egcs'.
+
+ Note that version 1.1 of `egcs' aligns double-precision variables
+ and arrays when they are in static storage even if
+ `-malign-double' is not specified.
+
+ There is ongoing investigation into how to make `-malign-double'
+ work properly, also into how to make it unnecessary to get all
+ double-precision variables and arrays aligned when such alignment
+ would not violate the relevant specifications for processor and
+ inter-procedural interfaces.
+
+ For a suite of programs to test double-precision alignment, see
+ `ftp://alpha.gnu.org/gnu/g77/align/'.
+
+ * The `libf2c' routines that perform some run-time arithmetic on
+ `COMPLEX' operands were modified circa version 0.5.20 of `g77' to
+ work properly even in the presence of aliased operands.
+
+ While the `g77' and `netlib' versions of `libf2c' differ on how
+ this is accomplished, the main differences are that we believe the
+ `g77' version works properly even in the presence of *partially*
+ aliased operands.
+
+ However, these modifications have reduced performance on targets
+ such as x86, due to the extra copies of operands involved.
+
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 5b5b0fe3a9a..1806bbb4673 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,603 @@
+1998-10-02 Dave Love <d.love@dl.ac.uk>
+
+ * com.c (ffecom_expr_intrinsic_): Fix return type for RAND.
+
+Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lex.c: Replace occurances of HANDLE_SYSV_PRAGMA with
+ HANDLE_GENERIC_PRAGMAS.
+
+Mon Sep 28 04:22:00 1998 Jeffrey A Law (law@cygnus.com)
+
+ * news.texi: Update from Craig.
+
+1998-09-23 Dave Love <d.love@dl.ac.uk>
+
+ * g77.texi: Additions about `/*', trailing comments and cpp.
+
+1998-09-18 Dave Love <d.love@dl.ac.uk>
+
+ * g77.texi: Various additions and some small fixes.
+
+Thu Sep 10 14:55:44 1998 Kamil Iskra <iskra@student.uci.agh.edu.pl>
+
+ * Make-lang.in (f77.install-common): Add missing "else true;".
+
+1998-09-07 Dave Love <d.love@dl.ac.uk>
+
+ * ChangeLog.egcs: Deleted. Entries merged here.
+
+1998-09-05 Dave Love <d.love@dl.ac.uk>
+
+ * Makefile.in (LDFLAGS): Set from BOOT_LDFLAGS.
+ (F771_LDFLAGS): Variable dispensed with.
+
+Fri Sep 4 19:53:34 1998 Craig Burley <burley@gnu.org>
+
+ * intdoc.in: Minor editorial tweaks.
+
+Fri Sep 4 18:35:52 1998 Craig Burley <burley@gnu.org>
+
+ * lang-options.h: Convert to wrap option and doc string
+ in a new macro invocation, FTNOPT, so the nearly identical
+ list can be used in FSF-g77.
+
+Fri Sep 4 18:35:52 1998 Craig Burley <burley@gnu.org>
+
+ * Makefile.in (fini.o): Don't define USE_HCONFIG here.
+ * fini.c: Define USE_HCONFIG here instead, so deps-kinda
+ picks up correct dependency.
+
+ * Makefile.in (proj-h.o): Fix dependencies list.
+
+Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lex.c (ffe_lex_hash): Change how HANDLE_PRAGMA and
+ HANDLE_SYSV_PRAGMA would be called if they pragma parsing was
+ enabled in this code.
+ Generate warning messages if unknown pragmas are encountered.
+ (pragma_getc): New function: retrieves characters from the
+ input stream. Defined when HANDLE_PRAGMA is defined.
+ (pragma_ungetc): New function: replaces characters back into the
+ input stream. Defined when HANDLE_PRAGMA is defined.
+
+Tue Sep 1 10:00:21 1998 Craig Burley <burley@gnu.org>
+
+ * bugs.texi, g77.1, g77.texi, intdoc.in, news.texi: Doc updates
+ from Craig.
+
+1998-08-23 Dave Love <d.love@dl.ac.uk>
+
+ * g77.texi: Increment `version-g77' and fix a few typos.
+
+Tue Aug 18 21:41:31 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in: Add several "else true" clauses to deal with lame
+ systems.
+
+Tue Aug 11 08:12:14 1998 H.J. Lu (hjl@gnu.org)
+
+ * Make-lang.in (g77.o): Touch lang-f77 before checking it.
+
+1998-08-09 Dave Love <d.love@dl.ac.uk>
+
+ * Make-lang.in (f/g77.dvi): Replace non-working use of texi2dvi
+ with explicit use of tex.
+ (f77.mostlyclean): Remove TeX index files.
+
+ * g77install.texi (Prerequisites): Kluge round TeX lossage with
+ hyphen in @value in @code.
+
+Tue Aug 4 16:59:39 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_convert_narrow_, ffecom_convert_widen_):
+ Allow conversion from pointer to same-sized integer,
+ to fix invoking SIGNAL as a function.
+
+1998-07-26 Dave Love <d.love@dl.ac.uk>
+
+ * BUGS, INSTALL, NEWS: Rebuilt.
+
+Sat Jul 25 17:23:55 1998 Craig Burley <burley@gnu.org>
+
+ Fix 980615-0.f:
+ * stc.c (ffestc_R1229_start): Set info to ANY as well.
+
+Tue Jul 21 04:33:37 1998 Craig Burley <burley@gnu.org>
+
+ * g77spec.c (lang_specific_driver): Return unmolested
+ command line when --help seen.
+ Comment out code that printed g77-specific --help info.
+
+Sat Jul 18 19:16:48 1998 Craig Burley <burley@gnu.org>
+
+ * lang-options.h: Fix up doc strings.
+ Remove the unimplemented -fdcp-intrinsics-* options.
+
+ * str-1t.fin: Change mixed-case spelling of `GoTo' from
+ `Goto'.
+
+Thu Jul 16 13:26:36 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_finish_symbol_transform_): Revert change
+ of 1998-05-23, as it was too aggressive, in that it
+ prevented transformation of (used) functions before
+ primary code generation.
+
+1998-07-15 Dave Love <d.love@dl.ac.uk>
+
+ * intdoc.texi: Regenerated.
+
+Mon Jul 13 18:45:06 1998 Craig Burley <burley@gnu.org>
+
+ * Make-lang.in (f77.rebuilt): Fix to depend on
+ build-dir-based, not source-based, g77.info.
+
+ * g77.texi: Merge docs with 0.5.24.
+ * g77install.texi: Ditto.
+
+Mon Jul 13 18:02:29 1998 Craig Burley <burley@gnu.org>
+
+ Cleanups vis-a-vis g77-0.5.24:
+ * g77spec.c (lang_specific_driver): Tabify source.
+ * top.c (ffe_decode_option): Use fixed macro to set
+ internal-checking flag.
+ * top.h (ffe_set_is_do_internal_checks): Fix macro.
+
+Mon Jul 13 17:33:44 1998 Craig Burley <burley@gnu.org>
+
+ Cleanups vis-a-vis system.h cutover and g77-0.5.24:
+ * Makefile.in (fini.o): Define USE_HCONFIG macro
+ so source code doesn't have to.
+ * fini.c: Don't define USE_HCONFIG here, since
+ source code usually shouldn't care about this.
+ * ansify.c: Include stddef.h only if we have it.
+ * intdoc.c: Ditto.
+ * proj.h: Ditto.
+
+Mon Jul 13 17:30:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lang-options.h: Format changed to work with --help support added
+ to gcc/toplev.c
+
+Mon Jul 13 11:54:03 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_push_tempvar): Replace kludge that
+ munged back-end globals directly with proper calls
+ to push_topmost_sequence and pop_topmost_sequence.
+
+1998-07-12 Dave Love <d.love@dl.ac.uk>
+
+ * version.c: Bump version.
+
+Sat Jul 11 19:24:32 1998 Craig Burley <burley@gnu.org>
+
+ Fix 980616-0.f:
+ * equiv.c (ffeequiv_offset_): Don't crash on various
+ possible ANY operands.
+
+Sat Jul 11 18:24:37 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_expr_) [FFEBLD_opCONTER]: Die if padding
+ for constant is non-zero.
+
+ * com.c (__eprintf): Delete this function, it is obsolete.
+
+1998-07-09 Dave Love <d.love@dl.ac.uk>
+
+ * intdoc.in (HOSTNM_func, HOSTNM_subr): Update last change.
+
+Thu Jul 9 00:45:59 1998 Craig Burley <burley@gnu.org>
+
+ Fix debugging of CHARACTER*(*), etc., which requires
+ emitting debug info on types like `ftnlen':
+ * com.c (ffecom_start_progunit_): Don't bother
+ resetting "invented" flag for identifier.
+ (ffecom_transform_equiv_): Don't bother zeroing
+ "ignored" flag for decl.
+ (pushdecl): No longer set "ignored", "used", or
+ "suppressed debug" flags for decls having "invented"
+ identifiers.
+
+1998-07-06 Mike Stump <mrs@wrs.com>
+
+ * Make-lang.in (f77.stage?): Use mv -f instead of just mv so that
+ we can move g77.c.
+
+1998-07-06 Dave Love <d.love@dl.ac.uk>
+
+ * intdoc.in (HOSTNM_func, HOSTNM_subr): Note possible need for
+ -lsocket.
+
+1998-07-05 Dave Love <d.love@dl.ac.uk>
+
+ * intdoc.in: Add entry for DATE_AND_TIME.
+
+ * intrin.def: Add implementation for DATE_AND_TIME. Make second
+ and third args of SYSTEM_CLOCK optional.
+
+ * com.c (ffecom_expr_intrinsic_): New case for DATE_AND_TIME.
+
+ * com-rt.def (FFECOM_gfrtSYSTEM_CLOCK): Call G77_system_clock_0,
+ not system_clock_.
+ (FFECOM_gfrtDATE_AND_TIME): New DEFGFRT.
+
+Wed Jul 1 11:19:13 1998 Craig Burley <burley@gnu.org>
+
+ Fix 980701-1.f (which was producing "unaligned trap"
+ on an Alpha running GNU/Linux, as predicted):
+ * equiv.c (ffeequiv_layout_local_): Don't bother
+ coping with pre-padding of entire area while building
+ it; do that instead after the building is done, and
+ do it by modifying only the modulo field. This covers
+ the case of alignment stringency being increased without
+ lowering the starting offset, unlike the previous changes,
+ and even more elegantly than those.
+
+ * target.c (ffetarget_align): Make sure alignments
+ are non-zero, just in case.
+
+Mon Jun 29 09:47:33 1998 Craig Burley <burley@gnu.org>
+
+ Fix 980628-*.f:
+ * bld.h: New `pad' field and accessor macros for
+ ACCTER, ARRTER, and CONTER ops.
+ * bld.c (ffebld_new_accter, ffebld_new_arrter,
+ ffebld_new_conter_with_orig): Initialize `pad' field
+ to zero.
+ * com.c (ffecom_transform_common_): Include initial
+ padding (aka modulo aka offset) in size calculation.
+ Copy initial padding value into FFE initialization expression
+ so the GBE transformation of that expression includes it.
+ Make array low bound 0 instead of 1, for consistency.
+ (ffecom_transform_equiv_): Include initial
+ padding (aka modulo aka offset) in size calculation.
+ Copy initial padding value into FFE initialization expression
+ so the GBE transformation of that expression includes it.
+ Make array low bound 0 instead of 1, for consistency.
+ (ffecom_expr_, case FFEBLD_opACCTER): Delete unused `size'
+ variable.
+ Track destination offset separately, allowing for
+ initial padding.
+ Don't bother setting initial PURPOSE offset if zero.
+ Include initial padding in size calculation.
+ (ffecom_expr_, case FFEBLD_opARRTER): Allow for
+ initial padding.
+ Include initial padding in size calculation.
+ Make array low bound 0 instead of 1, for consistency.
+ (ffecom_finish_global_): Make array low bound 0 instead
+ of 1, for consistency.
+ (ffecom_notify_init_storage): Copy `pad' field from old
+ ACCTER to new ARRTER.
+ (ffecom_notify_init_symbol): Ditto.
+ * data.c (ffedata_gather_): Initialize `pad' field in new
+ ARRTER to 0.
+ (ffedata_value_): Ditto.
+ * equiv.c (ffeequiv_layout_local_): When lowering start
+ of equiv area, extend lowering to maintain needed alignment.
+ * target.c (ffetarget_align): Handle negative offset correctly.
+
+ * global.c (ffeglobal_pad_common): Warn about non-zero
+ padding only the first time its seen.
+ If new padding larger than old, update old.
+ (ffeglobal_save_common): Use correct type for size throughout.
+ * global.h: Use correct type for size throughout.
+ (ffeglobal_common_pad): New macro.
+ (ffeglobal_pad): Delete this unused and broken macro.
+
+Sat Jun 27 12:18:33 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in (g77): Depend on mkstemp.o. Link in mkstemp.o.
+
+Fri Jun 26 11:54:19 1998 Craig Burley <burley@gnu.org>
+
+ * g77spec.c (lang_specific_driver): Put `-lg2c' in
+ front of any `-lm' that is seen.
+
+Wed Jun 24 01:01:23 1998 Jeffrey A Law (law@cygnus.com)
+
+ * g77spec.c (lang_specific_driver): Revert last change.
+
+Mon Jun 22 23:12:05 1998 H.J. Lu (hjl@gnu.org)
+
+ * Make-lang.in (G77STAGESTUFF): Add g77.c.
+
+Fri Jun 19 07:54:40 1998 H.J. Lu (hjl@gnu.org)
+
+ * g77spec.c (lang_specific_driver): Check n_infiles before
+ appending args.
+
+Mon Jun 15 23:39:24 1998 Craig Burley <burley@gnu.org>
+
+ * Make-lang.in (f/g77.info): Use -f when removing
+ pre-existing Info files, if any. (This rm command
+ can go away once makeinfo has been changed to delete
+ .info-N files beyond the last one it creates.)
+
+ * Make-lang.in ($(srcdir)/f/intdoc.texi): Compile
+ using $(INCLUDES) macro to get the new hconfig.h
+ and system.h headers.
+
+Mon Jun 15 22:21:57 1998 Craig Burley <burley@gnu.org>
+
+ Cutover to system.h:
+ * Make-lang.in:
+ * Makefile.in:
+ * ansify.c:
+ * bad.c:
+ * bld.c:
+ * com.c:
+ * com.h:
+ * expr.c:
+ * fini.c:
+ * g77spec.c:
+ * implic.c:
+ * intdoc.c:
+ * intrin.c:
+ * lex.c:
+ * lex.h:
+ * parse.c:
+ * proj.c:
+ * proj.h:
+ * src.c:
+ * src.h:
+ * stb.c:
+ * ste.c:
+ * target.c:
+ * top.c:
+ * system.j: New file.
+
+ Use toplev.h where appropriate:
+ * Make-lang.in:
+ * Makefile.in:
+ * bad.c:
+ * bld.c:
+ * com.c:
+ * lex.c:
+ * ste.c:
+ * top.c:
+ * toplev.j: New file.
+
+ Conditionalize all dumping/reporting routines so they don't
+ get built for gcc/egcs:
+ * bld.c:
+ * bld.h:
+ * com.c:
+ * equiv.c:
+ * equiv.h:
+ * sta.c:
+ * stt.c:
+ * stt.h:
+ * symbol.c:
+ * symbol.h:
+
+ Use hconfig.h instead of config.h where appropriate:
+ * Makefile.in (proj-h.o): Compile with -DUSE_HCONFIG.
+ * fini.c: Define USE_HCONFIG before including proj.h.
+
+ * Makefile.in (deps-kinda): Redirect stderr to stdout,
+ to eliminate diagnostics vis-a-vis g77spec.c.
+
+ * Makefile.in: Regenerate dependencies via deps-kinda.
+
+ * lex.c (ffelex_file_fixed, ffelex_file_free): Eliminate
+ apparently spurious warnings about uninitialized variables
+ `c', `column', and so on.
+
+Sat Jun 13 03:13:18 1998 Craig Burley <burley@gnu.org>
+
+ * g77spec.c (lang_specific_driver): Print out egcs
+ version info first, to be compatible with what some
+ test facilities expect.
+
+Wed Jun 10 13:17:32 1998 Dave Brolley <brolley@cygnus.com>
+
+ * top.h (ffe_decode_option): New argc/argv interface.
+ * top.c (ffe_decode_option): New argc/argv interface.
+ * parse.c (yyparse): New argc/argv interface for ffe_decode_option.
+ * com.c (lang_decode_option): New argc/argv interface.
+
+Sun Jun 7 14:04:34 1998 Richard Henderson <rth@cygnus.com>
+
+ * com.c (lang_init_options): New function.
+ * top.c (ffe_decode_option): Remove all trace of -fset-g77-defaults.
+ Set ffe_is_do_internal_checks_ with -version.
+ * lang-options.h: Likewise.
+ * lang-specs.h: Likewise.
+
+Fri Jun 5 15:53:17 1998 Per Bothner <bothner@cygnus.com>
+
+ * g77spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
+ Define - update needed by gcc.c change.
+
+Mon Jun 1 19:37:42 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_init_0): Fix setup of INTEGER(KIND=7)
+ pointer type.
+ * info.c (ffeinfo_type): Don't crash on null type.
+ * expr.c (ffeexpr_fulfill_call_): Don't special-case
+ %LOC(expr) or LOC(expr).
+ Delete FFEGLOBAL_argsummaryPTR.
+ * global.c, global.h: Delete FFEGLOBAL_argsummaryPTR.
+
+Thu May 28 21:32:18 1998 Craig Burley <burley@gnu.org>
+
+ Restore circa-0.5.22 capabilities of `g77' driver:
+ * Make-lang.in (g77spec.o): Depend on f/version.h.
+ (g77version.o): New rule to compile g77 version info.
+ (g77$(exeext)): Depend on and link in g77version.o.
+ * g77spec.c: Rewrite to be more like 0.5.22 version
+ of g77.c, making filtering of command line smarter
+ so mixed Fortran and C (etc.) can be compiled, verbose
+ version info can be obtained, etc.
+ * lang-specs.h (f77-version): New "language" to support
+ "g77 -v" command under new gcc 2.8 regime.
+ * lex.c (ffelex_file_fixed): If -fnull-version, just
+ substitute a "source file" that prints out version info.
+ * top.c, top.h: Support -fnull-version.
+
+ * lang-specs.h: Use "%O" instead of OO macro to specify
+ object extension. Remove old stringizing cruft.
+
+ * Make-lang.in (g77.c, g77spec.o, g77.o, g77$(exeext),
+ g77-cross$(exeext), f771,
+ $(srcdir)/f/g77.info, $(srcdir)/f/g77.dvi,
+ $(srcdir)/f/intdoc.texi,
+ f77.install-common, f77.install-info, f77.install-man,
+ f77.uninstall, $(G77STAGESTUFF), f77.stage1, f77.stage2,
+ f77.stage3, f77.stage4, f77.distdir): Don't do anything
+ unless user specified "f77" or "F77" in $LANGUAGES either
+ during configuration or explicitly. For convenience of
+ various tests and to work around lack of the assignment
+ "LANGUAGES=$(BOOT_LANGUAGES)" in the "make stage1" command
+ of "make bootstrap" in gcc, use a touch file named "lang-f77"
+ to communicate whether this is the case.
+
+ * Make-lang.in (F77_FLAGS_TO_PASS): Delete this macro,
+ replace with minimal expansion of its former self in
+ each of the two instances where it was used.
+
+ * Makefile.in (HOST_CC): Delete this definition.
+
+ * com.c (index, rindex): Delete these declarations.
+
+ * proj.h: (isascii): Delete this.
+
+ * Make-lang.in (f77.install-common): Warn if `f77-install-ok'
+ flag-file exists, since it no longer triggers any activity.
+
+ Rename libf2c.a and f2c.h to libg2c.a and g2c.h,
+ normalize and simplify g77/libg2c build process:
+ * Make-lang.in: Remove all support for overwriting
+ /usr/bin/f77 etc., or whatever the actual names are
+ via $(prefix) and $(local_prefix). (g++ overwrites
+ /usr/bin/c++, but then it's often the only C++ compiler
+ on the system; f77 often exists on systems that are
+ installing g77.)
+ (f77.realclean): Remove obsolete target.
+ (g77.c, g77$(exeext)): Minor changes to look more like g++'s
+ stuff.
+ (f771): Now built with srcdir=gcc/f, not srcdir=gcc, to be
+ more like g++ and such.
+ (f/Makefile): Removed, as g++ doesn't need this rule.
+ (f77.install-common): No longer install f77, etc.
+ (f77.install-man): No longer install f77.1.
+ (f77.uninstall): No longer uninstall f77, f77.1, etc.
+ (f77.stage1, f77.stage2, f77.stage3, f77.stage4): Do work
+ only if "f77" appears in $(LANGUAGES).
+ (Note: gcc's Makefile.in's bootstrap target should set
+ LANGUAGES=$(BOOT_LANGUAGES) when making the stage1 target.)
+ * Makefile.in: Update vis-a-vis gcc/cp/Makefile.in.
+ (none): Remove.
+ (g77-only): Relocate.
+ (all.indirect, f771, *.o): Now assumes current directory
+ is this dir (gcc/f), not the parent directory.
+ (TAGS): Remove "echo 'parse.y,0' >> TAGS ;" line.
+ * config-lang.in: Delete commented-out code.
+ Fix stagestuff definition. Add more stuff to
+ diff_excludes definition. Don't create any directories.
+ Set outputs to f/Makefile, to get variable substition
+ to happen (what does that really do, anyway?!).
+ * g77spec.c: Rename libf2c to libg2c.
+
+ * com.h: Remove all of the gcc back-end decls,
+ since egcs should have all of them correct.
+
+ * com.c: Include "proj.h" before anything else,
+ as that's how things are supposed to work.
+ * ste.c: Ditto.
+
+ * bad.c: Include "flags.j" here, since some diagnostics
+ check flag_pedantic_errors.
+
+ * Makefile.in (f/*.o): Rebuild dependencies via
+ deps-kinda.
+
+ * output.j: New source file.
+ * Make-lang.in (F77_SRCS): Update accordingly.
+ * Makefile.in (OUTPUT_H): Ditto.
+ (deps-kinda): Ditto.
+ * com.c: Include "output.j" here.
+ * lex.c: Ditto.
+
+Mon May 25 03:34:42 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_expr_): Fix D**I and Z**I cases to
+ not convert (DOUBLE PRECISION) D and (DOUBLE COMPLEX) Z
+ to INTEGER. (This is dead code here anyway.)
+
+Sat May 23 06:32:52 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_finish_symbol_transform_): Don't transform
+ statement (nested) functions, to avoid gcc compiling them
+ and thus producing linker errors if they refer to undefined
+ external functions. But warn if they're unused and -Wunused.
+ * bad.def (FFEBAD_SFUNC_UNUSED): New diagnostic.
+
+Wed May 20 12:12:55 1998 Craig Burley <burley@gnu.org>
+
+ * Version 0.5.23 released.
+
+Tue May 19 14:52:41 1998 Craig Burley <burley@gnu.org>
+
+ * bad.def (FFEBAD_OPEN_UNSUPPORTED, FFEBAD_INQUIRE_UNSUPPORTED,
+ FFEBAD_READ_UNSUPPORTED, FFEBAD_WRITE_UNSUPPORTED,
+ FFEBAD_QUAD_UNSUPPORTED, FFEBAD_BLOCKDATA_STMT,
+ FFEBAD_TRUNCATING_CHARACTER, FFEBAD_TRUNCATING_HOLLERITH,
+ FFEBAD_TRUNCATING_NUMERIC, FFEBAD_TRUNCATING_TYPELESS,
+ FFEBAD_TYPELESS_OVERFLOW): Change these from warnings
+ to errors.
+
+Tue May 19 14:51:59 1998 Craig Burley <burley@gnu.org>
+
+ * Make-lang.in (f77.install-info, f77.uninstall):
+ Use install-info as appropriate.
+
+Tue May 19 12:56:54 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_init_0): Rename xargc to f__xargc,
+ in accord with same-dated change to f/runtime.
+
+Fri May 15 10:52:49 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_convert_narrow_, ffecom_convert_widen_):
+ Be even more persnickety in checking for internal bugs.
+ Also, if precision isn't changing, just return the expr.
+
+ * expr.c (ffeexpr_token_number_): Call
+ ffeexpr_make_float_const_ to make an integer.
+ (ffeexpr_make_float_const_): Handle making an integer.
+
+ * intrin.c (ffeintrin_init_0): Distinguish between
+ crashes on bad arg base and kind types.
+
+Fri May 15 01:44:22 1998 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * Make-lang.in (f77.mostlyclean): Add missing exeext.
+
+Thu May 14 13:30:59 1998 Craig Burley <burley@gnu.org>
+
+ * Make-lang.in (f/expr.c): Now depends on f/stamp-str.
+ * expr.c: Use ffestrOther in place of ffeexprDotdot_.
+ * str-ot.fin: Add more keywords for expr.c.
+
+ * intdoc.c (dumpimp): Trivial fix.
+
+ * com.c (ffecom_expr_): Add ltkt variable for clarity.
+
+Wed May 13 13:05:34 1998 Craig Burley <burley@gnu.org>
+
+ * Make-lang.in (G77STAGESTUFF): Add g77.o, g77spec.o,
+ and g77version.o.
+ (f77.clean): Add removal of g77.c, g77.o, g77spec.o,
+ and g77version.o.
+ (f77.distclean): Delete removal of g77.c.
+
+Thu Apr 30 18:59:43 1998 Jim Wilson <wilson@cygnus.com>
+
+ * Make-lang.in (g77.info, g77.dvi, BUGS, INSTALL, NEWS): Put -o
+ option before input file.
+
Tue Apr 28 09:23:10 1998 Craig Burley <burley@gnu.org>
Fix 980427-0.f:
@@ -5,6 +605,33 @@ Tue Apr 28 09:23:10 1998 Craig Burley <burley@gnu.org>
from EXT to FUNC, discard hook, since the decl, if any, is
probably wrong.
+Sun Apr 26 09:05:50 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_char_enhance_arg_): Wrap the upper bound
+ (the PARM_DECL specifying the length of the CHARACTER*(*)
+ dummy arg) in a variable_size invocation, to prevent
+ dwarf2out.c crashing when compiling code with -g.
+
+Sat Apr 18 15:26:57 1998 Jim Wilson <wilson@cygnus.com>
+
+ * g77spec.c (lang_specific_driver): New argument in_added_libraries.
+ New local added_libraries. Increment count when add library to
+ arglist.
+
+Sat Apr 18 05:03:21 1998 Craig Burley <burley@gnu.org>
+
+ * com.c (ffecom_check_size_overflow_): Ignore overflow
+ as well if dummy argument.
+
+Fri Apr 17 17:18:04 1998 Craig Burley <burley@gnu.org>
+
+ * version.h: Get rid of the overly large headers
+ here too, as done in version.c.
+
+Tue Apr 14 15:51:37 1998 Dave Brolley <brolley@cygnus.com>
+
+ * com.c (init_parse): Now returns char* containing filename;
+
Tue Apr 14 14:40:40 1998 Craig Burley <burley@gnu.org>
* com.c (ffecom_start_progunit_): Mark function decl
@@ -15,23 +642,51 @@ Tue Apr 14 14:19:34 1998 Craig Burley <burley@gnu.org>
* sta.c (ffesta_second_): Check for CASE DEFAULT
as well as CASE, or it won't be recognized.
+Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
+
+ * com.c (finput): New variable.
+ (init_parse): Handle !USE_CPPLIB.
+ (finish_parse): New function.
+ (lang_init): No longer declare finput.
+
+Sat Apr 4 17:45:01 1998 Richard Henderson <rth@cygnus.com>
+
+ * com.c (ffecom_expr_): Revert Oct 22 change. Instead take a WIDENP
+ argument so that we can respect the signedness of the original type.
+ (ffecom_init_0): Do sizetype initialization first.
+
+1998-03-28 Dave Love <d.love@dl.ac.uk>
+
+ * Make-lang.in (f771$(exeext)): Fix typo.
+
+1998-03-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
+
+ * com.c (lang_print_xnode): New function.
+
+Mon Mar 23 21:20:35 1998 Craig Burley <burley@gnu.org>
+
+ * version.c: Reduce to a one-line file, like
+ gcc's version.c, since there's really no content
+ there.
+
Mon Mar 23 11:58:43 1998 Craig Burley <burley@gnu.org>
* bugs.texi: Various updates.
* com.c (ffecom_tree_canonize_ptr_): Fix up spacing a bit.
+Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
+ Geoff Noer <noer@cygnus.com>
+
+ * Makefile.in: Various fixes for building cygwin32 native toolchains.
+ * Make-lang.in: Likewise.
+
Mon Mar 16 21:20:35 1998 Craig Burley <burley@gnu.org>
* expr.c (ffeexpr_sym_impdoitem_): Don't blindly
reset symbol info after calling ffesymbol_error,
to avoid crash.
-Thu Mar 12 13:50:21 1998 Craig Burley <burley@gnu.org>
-
- * lang-options.h: Sort all -f*-intrinsics-* options,
- for consistency with other g77 versions.
-
Mon Mar 16 15:38:50 1998 Craig Burley <burley@gnu.org>
* Version 0.5.22 released.
@@ -50,6 +705,15 @@ Sun Mar 15 05:48:49 1998 Craig Burley <burley@gnu.org>
* intrin.def: Fix spelling of mixed-case form
of `CPU_Time' (was `Cpu_Time').
+Thu Mar 12 13:50:21 1998 Craig Burley <burley@gnu.org>
+
+ * lang-options.h: Sort all -f*-intrinsics-* options,
+ for consistency with other g77 versions.
+
+Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * lang-specs.h: Properly put brackets around array elements in initializer.
+
1998-03-09 Dave Love <d.love@dl.ac.uk>
* Make-lang.in: Set CONFIG_SITE to a non-existent file since
@@ -61,6 +725,14 @@ Sun Mar 8 16:35:34 1998 Craig Burley <burley@gnu.org>
* intrin.def: Use tabs instead of blanks more
consistently (excepting DEFGEN section for now).
+Wed Mar 4 17:38:21 1998 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in: Remove more references to libf77.
+
+Tue Mar 3 10:52:35 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * g77.texi: Use @url for citing URLs.
+
Sat Feb 28 15:24:38 1998 Craig Burley <burley@gnu.org>
* intrin.def: Make CPU_TIME's arg generic real to be just
@@ -75,6 +747,83 @@ Fri Feb 20 12:45:53 1998 Craig Burley <burley@gnu.org>
* Makefile.in (f/fini): Don't use -W -Wall with HOST_CC.
+Fri Feb 13 00:14:56 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * com.c (type_for_mode): Add explicit braces to avoid ambiguous `else'.
+
+ * expr.c (ffeexpr_type_combine): Likewise.
+ (ffeexpr_reduce_): Likewise.
+ (ffeexpr_declare_parenthesized_): Likewise.
+
+ * src.c (ffesrc_strcmp_1ns2i): Likewise.
+ (ffesrc_strcmp_2c): Likewise.
+ (ffesrc_strncmp_2c): Likewise.
+
+ * stb.c (ffestb_halt1_): Likewise.
+ (ffestb_R90910_): Likewise.
+ (ffestb_R9109_): Likewise.
+
+ * stc.c (ffestc_R544_equiv_): Likewise.
+
+ * std.c (ffestd_subr_copy_easy_): Likewise.
+ (ffestd_R1001dump_): Likewise.
+ (ffestd_R1001dump_1005_1_): Likewise.
+ (ffestd_R1001dump_1005_2_): Likewise.
+ (ffestd_R1001dump_1005_3_): Likewise.
+ (ffestd_R1001dump_1005_4_): Likewise.
+ (ffestd_R1001dump_1005_5_): Likewise.
+ (ffestd_R1001dump_1010_2_): Likewise.
+
+ * ste.c (ffeste_R840): Likewise.
+
+ * sts.c (ffests_puttext): Likewise.
+
+ * symbol.c (ffesymbol_check_token_): Likewise.
+
+ * target.c (ffetarget_real1): Likewise.
+ (ffetarget_real2): Likewise.
+
+Wed Feb 11 01:44:48 1998 Richard Henderson (rth@cygnus.com)
+
+ * com.c (ffecom_ptr_to_expr) [FFEBLD_opARRAYREF]: Do upper - lower
+ in the native type, so as to properly handle negative indices.
+
+Tue Feb 3 20:13:05 1998 Richard Henderson <rth@cygnus.com>
+
+ * config-lang.in: Remove references to runtime/.
+
+Sun Feb 1 12:43:49 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * com.c (ffecom_tree_canonize_ptr_): Place bitsizetype typed expr
+ as first agument in MULT_EXPR.
+ Use bitsize_int (0L, 0L) as zero for bitsizes.
+ (ffecom_tree_canonize_ref_):
+ Use bitsize_int (0L, 0L) as zero for bitsizes.
+ (ffecom_init_0): Use set_sizetype.
+
+Sun Feb 1 02:26:58 1998 Richard Henderson <rth@cygnus.com>
+
+ * runtime directory -- moved into "libf2c" in the toplevel
+ directory.
+ * Make-lang.in: Remove all runtime related stuff.
+
+Sun Jan 25 12:32:15 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Make-lang.in (f77.stage1): Depend on stage1-start so parallel
+ make works better.
+ * (f77.stage2): Likewise for stage2-start.
+ * (f77.stage3): Likewise for stage3-start.
+ * (f77.stage4): Likewise for stage4-start.
+
+Sat Jan 17 21:28:08 1998 Pieter Nagel <pnagel@epiuse.co.za>
+
+ * Makefile.in (FLAGS_TO_PASS): Pass down gcc_include_dir and
+ local_prefix to sub-make invocations.
+
+Tue Jan 13 22:07:54 1998 Jeffrey A Law (law@cygnus.com)
+
+ * lang-options.h: Add missing options.
+
Sun Jan 11 02:14:47 1998 Craig Burley <burley@gnu.org>
Support FORMAT(I<1+2>) (constant variable-FORMAT
@@ -169,6 +918,14 @@ Mon Dec 22 12:41:07 1997 Craig Burley <burley@gnu.org>
* intrin.c (ffeintrin_init_0): Remove duplicate
check for `!'.
+Fri Dec 19 00:12:01 1997 Richard Henderson <rth@cygnus.com>
+
+ * com.c (ffecom_sym_transform_): Assumed arrays have no upper bound.
+
+Mon Dec 15 17:35:35 1997 Richard Henderson <rth@cygnus.com>
+
+ * com.c (ffecom_type_vardesc_): Vardesc.dims is a `ftnlen*'.
+
Sun Dec 14 02:49:58 1997 Craig Burley <burley@gnu.org>
* intrin.c (ffeintrin_init_0): Fix up indentation a bit.
@@ -181,6 +938,10 @@ Tue Dec 9 16:20:57 1997 Richard Henderson <rth@cygnus.com>
* com.c (ffecom_type_vardesc_): Vardesc.dims is a `ftnlen*'.
+Tue Dec 2 09:57:16 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in (f77.clean): Remove g77.c.
+
Mon Dec 1 19:12:36 1997 Craig Burley <burley@gnu.org>
* intrin.c (ffeintrin_check_): Fix up indentation a bit more.
@@ -201,6 +962,20 @@ Sun Nov 30 22:22:22 1997 Craig Burley <burley@gnu.org>
* intrin.def: Fix up spacing a bit.
+Tue Nov 25 15:33:28 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in (f77.all.build): Add $(exeext) to binary files.
+ (f77.all.cross, f77.start.encap): Simliarly.
+
+Fri Nov 21 09:35:20 1997 Fred Fish <fnf@cygnus.com>
+
+ * Make-lang.in (stmp-f2c.h): Move inclusion of F77_FLAGS_TO_PASS
+ to before override of CC so that the override works.
+
+Thu Nov 20 00:58:14 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * Make-lang.in (f77.install-info): Depend on f77.info.
+
1997-11-17 Dave Love <d.love@dl.ac.uk>
* com.c (ffecom_arglist_expr_): Pass null pointers for optional
@@ -210,11 +985,21 @@ Sun Nov 16 21:45:43 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
* Make-lang.in (f77.install-info): Depend on f77.info.
+1997-11-14 Dave Love <d.love@dl.ac.uk>
+
+ * intrin.def: Supply gfrt for CPU_TIME. Generalize arg types of
+ INT2, INT8, per doc.
+
1997-11-06 Dave Love <d.love@dl.ac.uk>
* intrin.def: Allow non-integer args for INT2 and INT8 (per
documentation).
+Sun Nov 2 19:49:51 1997 Richard Henderson <rth@cygnus.com>
+
+ * com.c (ffecom_expr_): Only use TREE_TYPE argument for simple
+ arithmetic; convert types as necessary; recurse with target tree type.
+
Tue Oct 28 02:21:25 1997 Craig Burley <burley@gnu.ai.mit.edu>
* lang-options.h: Add -fgnu-intrinsics-* and
@@ -236,6 +1021,23 @@ Sat Oct 25 23:43:36 1997 Craig Burley <burley@gnu.ai.mit.edu>
* malloc.c [MALLOC_DEBUG]: Put initializer for `name'
component in braces, to avoid compiler warning.
+Wed Oct 22 11:37:41 1997 Richard Henderson <rth@cygnus.com>
+
+ * com.c (ffecom_expr_): Take an new arg TREE_TYPE that if non-null
+ specifies the type in which to do the calculation. Change all callers.
+ [FFEBLD_opARRAYREF]: Force the index expr to use sizetype.
+
+Thu Oct 16 02:04:08 1997 Paul Koning <pkoning@xedia.com>
+
+ * Make-lang.in (stmp-f2c.h): Don't configure the runtime
+ directory if LANGUAGES does not include f77.
+
+Mon Oct 13 12:12:41 1997 Richard Henderson <rth@cygnus.com>
+
+ * Make-lang.in (g77*): Copied from cp/Make-lang.in g++*.
+ * g77spec.c: New file, mostly copied from g++spec.c
+ * g77.c: Removed.
+
Fri Oct 10 13:00:48 1997 Craig Burley <burley@gnu.ai.mit.edu>
* ste.c (ffeste_begin_iterdo_): Fix loop setup so iteration
@@ -246,11 +1048,21 @@ Fri Oct 10 13:00:48 1997 Craig Burley <burley@gnu.ai.mit.edu>
* com.c (ffecom_save_tree): Fix indentation.
+Mon Oct 6 14:15:03 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in (f77.mostlyclean): Clean up stuff in the
+ object tree too.
+ (f77.clean, f77.distclean, f77.maintainer-clean): Likewise.
+
1997-10-05 Dave Love <d.love@dl.ac.uk>
* intrin.def: Make SECOND_subr's arg generic real for people
porting from Cray and making everything double precision.
+Wed Oct 1 01:45:36 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
+
+ * g77.c (pexecute, main): Use unlink, not remove.
+
Mon Sep 29 16:18:21 1997 Craig Burley <burley@gnu.ai.mit.edu>
* stu.c (ffestu_list_exec_transition_,
@@ -261,6 +1073,20 @@ Mon Sep 29 16:18:21 1997 Craig Burley <burley@gnu.ai.mit.edu>
of #include'ing "output.h" from gcc) to eliminate warnings
from lex.c.
+Mon Sep 29 10:37:07 1997 Jeffrey A Law (law@cygnus.com)
+
+ * intdoc.c (main): Remove unused attribute for main's arguments.
+
+Sun Sep 28 01:47:17 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in (G77_FLAGS_TO_PASS): Pass down RANLIB, RANLIB_TEST
+ and AR instead of the _FOR_TARGET versions.
+
+Tue Sep 23 00:39:57 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * Make-lang.in: install.texi was renamed to g77install.texi
+ * install0.texi: Likewise.
+
Fri Sep 19 01:12:27 1997 Craig Burley <burley@gnu.ai.mit.edu>
* expr.c (ffeexpr_reduced_eqop2_):
@@ -268,6 +1094,25 @@ Fri Sep 19 01:12:27 1997 Craig Burley <burley@gnu.ai.mit.edu>
* fini.c (main): Change return type to `int'.
+Thu Sep 18 17:31:38 1997 Jeffrey A Law (law@cygnus.com)
+
+ * proj.h (FFEPROJ_BSEARCH): Delete all references.
+ (FFEPROJ_STRTOUL): Likewise.
+ * proj.c (bsearch): Compile this if no bsearch is provided by the
+ host system.
+ (strtoul): Similarly.
+
+ * g77install.texi: Renamed from install.texi
+ * g77.texi: Corresponding changes.
+
+ * fini.c (main): Return type is int.
+
+ * com.c (lang_printable_name): Use verbosity argument.
+
+Thu Sep 18 16:08:40 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in: Fix merge problems.
+
Wed Sep 17 10:47:08 1997 Craig Burley <burley@gnu.ai.mit.edu>
* com-rt.def (FFECOM_gfrtDSIGN, FFECOM_gfrtISIGN,
@@ -275,6 +1120,29 @@ Wed Sep 17 10:47:08 1997 Craig Burley <burley@gnu.ai.mit.edu>
* expr.c (ffeexpr_cb_comma_c_): Trivial fixes.
+Sun Sep 14 21:01:23 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Make-lang.in: Various changes to build info files
+ in the object tree rather than the source tree.
+
+ * proj.h: Include ctype.h.
+
+Sun Sep 14 12:35:20 1997 Fred Fish (fnf@ninemoons.com)
+
+ * proj.h (isascii): Provide a default definition if none is available.
+
+Thu Sep 11 19:26:10 1997 Dave Love <d.love@dl.ac.uk>
+
+ * config-lang.in: Remove the messages about possible build problems.
+
+Wed Sep 10 16:39:47 1997 Jim Wilson <wilson@cygnus.com>
+
+ * Make-lang.in (LN, LN_S): New macros, use where appropriate.
+
+Tue Sep 9 13:20:40 1997 Jim Wilson <wilson@cygnus.com>
+
+ * g77.c (pexecute, doit): Add checks for __CYGWIN32__.
+
Tue Sep 9 01:59:35 1997 Craig Burley <burley@gnu.ai.mit.edu>
* Version 0.5.21 released.
@@ -284,6 +1152,11 @@ Tue Sep 9 00:31:01 1997 Craig Burley <burley@gnu.ai.mit.edu>
* intdoc.c (dumpem): Put appropriate commentary in
output file, so readers know it isn't source.
+Wed Aug 27 20:32:03 1997 Jeffrey A Law (law@cygnus.com)
+
+ * top.c (ffe_decode_option): Turn on flag_move_all_moveables
+ and flag_reduce_all_givs.
+
Wed Aug 27 08:08:25 1997 Craig Burley <burley@gnu.ai.mit.edu>
* proj.h: Always #include "config.j" first, to pick up
@@ -326,6 +1199,23 @@ Mon Aug 25 23:48:17 1997 Craig Burley <burley@gnu.ai.mit.edu>
changes made to the content in this patch!
* f/intrin.h (ffeintrinFamily): Fix to conform to ANSI C.
+Mon Aug 25 23:24:32 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * Make-lang.in ($(srcdir)/f/runtime/configure,
+ $(srcdir)/f/runtime/libU77/configure, f77.mostlyclean,
+ f77.clean, f77.distclean, f77.maintainer-clean, f77.realclean):
+ Handle absolute pathname of $(srcdir).
+ (stmp-f2c.h): New.
+ (include/f2c.h, f/runtime/Makefile, f/runtime/libF77/Makefile,
+ f/runtime/libI77/Makefile, f/runtime/libU77/Makefile): Only
+ depend on stmp-f2c.h.
+ (f77.maintainer-clean): Don't make itself.
+
+Sun Aug 24 17:00:27 1997 Jim Wilson <wilson@cygnus.com>
+
+ * Make-lang.in (f77.install-info): Don't cd into srcdir. Add srcdir
+ to filenames. Use sed to extract base filename for install.
+
Sun Aug 24 06:52:48 1997 Craig Burley <burley@gnu.ai.mit.edu>
Fix up g77 compiler data base for libf2c routines:
@@ -339,12 +1229,21 @@ Sun Aug 24 06:52:48 1997 Craig Burley <burley@gnu.ai.mit.edu>
ffecom_gfrt_kindtype): Replace FFECOM_rttypeINT_ with
FFECOM_rttypeFTNINT_; add FFECOM_rttypeDOUBLEREAL_.
+Thu Aug 21 13:15:29 1997 Jim Wilson <wilson@cygnus.com>
+
+ * Make-lang.in (f77): Delete f77-runtime.
+ (f77.all.build, f77.all.cross, f77.rest.encap): Add f77-runtime.
+
Wed Aug 20 17:18:40 1997 Craig Burley <burley@gnu.ai.mit.edu>
* global.c (ffeglobal_ref_progunit_): It's okay to have
a different CHARACTER*n length for a reference if the
existing length is for another reference, not a definition.
+Wed Aug 20 16:36:59 1997 Jim Wilson <wilson@cygnus.com>
+
+ * intdoc.texi: Readd generated file.
+
Mon Aug 18 14:27:18 1997 Craig Burley <burley@gnu.ai.mit.edu>
Fix 970814-0.f:
@@ -361,6 +1260,24 @@ Mon Aug 18 14:27:18 1997 Craig Burley <burley@gnu.ai.mit.edu>
* com-rt.def (FFECOM_gfrtALARM): Returns `integer', not
`void'.
+Mon Aug 18 09:01:54 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (F77_OBJS): Re-alphabetize.
+ * Make-lang.in (F77_SRCS): Likewise.
+
+Sun Aug 17 08:35:11 1997 Jeffrey A Law (law@cygnus.com)
+
+ * INSTALL: Rebuilt.
+ * install.texi: Remove "Object File Differences" section. Remove
+ all references to zzz.o failing comparison tests.
+ * version.c, version.h: Renamed from zzz.c and zzz.h. Remove
+ date and time stamps so a 3 stage build reports no differences.
+ * Make-lang.in: Corresponding changes.
+ * Makefile.in: Likewise.
+ * g77.c, parse.c: Likewise.
+
+ * intdoc.texi: Remove generated file from distribution.
+
Sun Aug 17 03:32:44 1997 Craig Burley <burley@gnu.ai.mit.edu>
Fix up problems when virtual memory exhausted:
@@ -386,6 +1303,21 @@ Sat Aug 16 19:41:33 1997 Craig Burley <burley@gnu.ai.mit.edu>
* intdoc.h: Document `alarm'.
+Tue Aug 12 10:23:02 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config-lang.in: Don't demand the backend patch.
+ * com.c (lang_printable_name): Second argument is now an int. Don't
+ store into the value of the second argument.
+ * top.c (ffe_decode_option): Temporarily disable setting
+ of "Toon" loop options until we figure out how to address
+ them.
+
+Mon Aug 11 23:18:35 1997 Jeffrey A Law (law@cygnus.com)
+
+ * g77-0.5.21-19970811 Imported.
+ This file describes changes to the front end necessary to make
+ it work with egcs.
+
Mon Aug 11 21:19:22 1997 Craig Burley <burley@gnu.ai.mit.edu>
* Make-lang.in ($(RUNTIMESTAGESTUFF)): Add
diff --git a/gcc/f/ChangeLog.egcs b/gcc/f/ChangeLog.egcs
deleted file mode 100644
index fab34fb258a..00000000000
--- a/gcc/f/ChangeLog.egcs
+++ /dev/null
@@ -1,326 +0,0 @@
-Thu Apr 30 18:59:43 1998 Jim Wilson <wilson@cygnus.com>
-
- * Make-lang.in (g77.info, g77.dvi, BUGS, INSTALL, NEWS): Put -o
- option before input file.
-
-Sat Apr 18 15:26:57 1998 Jim Wilson <wilson@cygnus.com>
-
- * g77spec.c (lang_specific_driver): New argument in_added_libraries.
- New local added_libraries. Increment count when add library to
- arglist.
-
-Tue Apr 14 15:51:37 1998 Dave Brolley <brolley@cygnus.com>
-
- * com.c (init_parse): Now returns char* containing filename;
-
-Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
-
- * com.c (finput): New variable.
- (init_parse): Handle !USE_CPPLIB.
- (finish_parse): New function.
- (lang_init): No longer declare finput.
-
-Sat Apr 4 17:45:01 1998 Richard Henderson <rth@cygnus.com>
-
- * com.c (ffecom_expr_): Revert Oct 22 change. Instead take a WIDENP
- argument so that we can respect the signedness of the original type.
- (ffecom_init_0): Do sizetype initialization first.
-
-1998-03-28 Dave Love <d.love@dl.ac.uk>
-
- * Make-lang.in (f771$(exeext)): Fix typpo.
-
-1998-03-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
-
- * com.c (lang_print_xnode): New function.
-
-Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
- Geoff Noer <noer@cygnus.com>
-
- * Makefile.in: Various fixes for building cygwin32 native toolchains.
- * Make-lang.in: Likewise.
-
-Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * lang-specs.h: Properly put brackets around array elements in initializer.
-
-Wed Mar 4 17:38:21 1998 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in: Remove more references to libf77.
-
-Tue Mar 3 10:52:35 1998 Manfred Hollstein <manfred@s-direktnet.de>
-
- * g77.texi: Use @url for citing URLs.
-
-Fri Feb 13 00:14:56 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * com.c (type_for_mode): Add explicit braces to avoid ambiguous `else'.
-
- * expr.c (ffeexpr_type_combine): Likewise.
- (ffeexpr_reduce_): Likewise.
- (ffeexpr_declare_parenthesized_): Likewise.
-
- * src.c (ffesrc_strcmp_1ns2i): Likewise.
- (ffesrc_strcmp_2c): Likewise.
- (ffesrc_strncmp_2c): Likewise.
-
- * stb.c (ffestb_halt1_): Likewise.
- (ffestb_R90910_): Likewise.
- (ffestb_R9109_): Likewise.
-
- * stc.c (ffestc_R544_equiv_): Likewise.
-
- * std.c (ffestd_subr_copy_easy_): Likewise.
- (ffestd_R1001dump_): Likewise.
- (ffestd_R1001dump_1005_1_): Likewise.
- (ffestd_R1001dump_1005_2_): Likewise.
- (ffestd_R1001dump_1005_3_): Likewise.
- (ffestd_R1001dump_1005_4_): Likewise.
- (ffestd_R1001dump_1005_5_): Likewise.
- (ffestd_R1001dump_1010_2_): Likewise.
-
- * ste.c (ffeste_R840): Likewise.
-
- * sts.c (ffests_puttext): Likewise.
-
- * symbol.c (ffesymbol_check_token_): Likewise.
-
- * target.c (ffetarget_real1): Likewise.
- (ffetarget_real2): Likewise.
-
-Wed Feb 11 01:44:48 1998 Richard Henderson (rth@cygnus.com)
-
- * com.c (ffecom_ptr_to_expr) [FFEBLD_opARRAYREF]: Do upper - lower
- in the native type, so as to properly handle negative indices.
-
-Fri Jan 9 19:09:07 1998 Craig Burley <burley@gnu.org>
-
- Fix -fpedantic combined with `F()' invocation,
- also -fugly-comma combined with `IARGC()' invocation:
- * bad.def (FFEBAD_NULL_ARGUMENT_W): New diagnostic.
- * expr.c (ffeexpr_finished_): Don't reject null expressions
- in the argument-expression context -- let outer context
- handle that.
- (ffeexpr_token_arguments_): Warn about null expressions
- here if -fpedantic (as appropriate).
- Obey -fugly-comma for only external-procedure invocations.
-
-Tue Feb 3 20:13:05 1998 Richard Henderson <rth@cygnus.com>
-
- * config-lang.in: Remove references to runtime/.
-
-Sun Feb 1 12:43:49 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * com.c (ffecom_tree_canonize_ptr_): Place bitsizetype typed expr
- as first agument in MULT_EXPR.
- Use bitsize_int (0L, 0L) as zero for bitsizes.
- (ffecom_tree_canonize_ref_):
- Use bitsize_int (0L, 0L) as zero for bitsizes.
- (ffecom_init_0): Use set_sizetype.
-
-Sun Feb 1 02:26:58 1998 Richard Henderson <rth@cygnus.com>
-
- * runtime directory -- moved into "libfc2" in the toplevel
- directory.
- * Make-lang.in: Remove all runtime related stuff.
-
-Sun Jan 25 12:32:15 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Make-lang.in (f77.stage1): Depend on stage1-start so parallel
- make works better.
- * (f77.stage2): Likewise for stage2-start.
- * (f77.stage3): Likewise for stage3-start.
- * (f77.stage4): Likewise for stage4-start.
-
-Sat Jan 17 21:28:08 1998 Pieter Nagel <pnagel@epiuse.co.za>
-
- * Makefile.in (FLAGS_TO_PASS): Pass down gcc_include_dir and
- local_prefix to sub-make invocations.
-
-Tue Jan 13 22:07:54 1998 Jeffrey A Law (law@cygnus.com)
-
- * lang-options.h: Add missing options.
-
-Fri Dec 19 00:12:01 1997 Richard Henderson <rth@cygnus.com>
-
- * com.c (ffecom_sym_transform_): Assumed arrays have no upper bound.
-
-Mon Dec 15 17:35:35 1997 Richard Henderson <rth@cygnus.com>
-
- * com.c (ffecom_type_vardesc_): Vardesc.dims is a `ftnlen*'.
-
-Tue Dec 2 09:57:16 1997 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in (f77.clean): Remove g77.c.
-
-Tue Nov 25 15:33:28 1997 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in (f77.all.build): Add $(exeext) to binary files.
- (f77.all.cross, f77.start.encap): Simliarly.
-
-Fri Nov 21 09:35:20 1997 Fred Fish <fnf@cygnus.com>
-
- * Make-lang.in (stmp-f2c.h): Move inclusion of F77_FLAGS_TO_PASS
- to before override of CC so that the override works.
-
-Thu Nov 20 00:58:14 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Make-lang.in (f77.install-info): Depend on f77.info.
-
-1997-11-14 Dave Love <d.love@dl.ac.uk>
-
- * intrin.def: Supply gfrt for CPU_TIME. Generalize arg types of
- INT2, INT8, per doc.
-
-Sun Nov 2 19:49:51 1997 Richard Henderson <rth@cygnus.com>
-
- * com.c (ffecom_expr_): Only use TREE_TYPE argument for simple
- arithmetic; convert types as necessary; recurse with target tree type.
-
-Wed Oct 22 11:37:41 1997 Richard Henderson <rth@cygnus.com>
-
- * com.c (ffecom_expr_): Take an new arg TREE_TYPE that if non-null
- specifies the type in which to do the calculation. Change all callers.
- [FFEBLD_opARRAYREF]: Force the index expr to use sizetype.
-
-Thu Oct 16 02:04:08 1997 Paul Koning <pkoning@xedia.com>
-
- * Make-lang.in (stmp-f2c.h): Don't configure the runtime
- directory if LANGUAGES does not include f77.
-
-Mon Oct 13 12:12:41 1997 Richard Henderson <rth@cygnus.com>
-
- * Make-lang.in (g77*): Copied from cp/Make-lang.in g++*.
- * g77spec.c: New file, mostly copied from g++spec.c
- * g77.c: Removed.
-
-Mon Oct 6 14:15:03 1997 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in (f77.mostlyclean): Clean up stuff in the
- object tree too.
- (f77.clean, f77.distclean, f77.maintainer-clean): Likewise.
-
-Wed Oct 1 01:45:36 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * g77.c (pexecute, main): Use unlink, not remove.
-
-Mon Sep 29 10:37:07 1997 Jeffrey A Law (law@cygnus.com)
-
- * intdoc.c (main): Remove unused attribute for main's arguments.
-
-Sun Sep 28 01:47:17 1997 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in (G77_FLAGS_TO_PASS): Pass down RANLIB, RANLIB_TEST
- and AR instead of the _FOR_TARGET versions.
-
-Tue Sep 23 00:39:57 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
-
- * Make-lang.in: install.texi was renamed to g77install.texi
- * install0.texi: Likewise.
-
-Thu Sep 18 17:31:38 1997 Jeffrey A Law (law@cygnus.com)
-
- * proj.h (FFEPROJ_BSEARCH): Delete all references.
- (FFEPROJ_STRTOUL): Likewise.
- * proj.c (bsearch): Compile this if no bsearch is provided by the
- host system.
- (strtoul): Similarly.
-
- * g77install.texi: Renamed from install.texi
- * g77.texi: Corresponding changes.
-
- * fini.c (main): Return type is int.
-
- * com.c (lang_printable_name): Use verbosity argument.
-
-Thu Sep 18 16:08:40 1997 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in: Fix merge problems.
-
-Sun Sep 14 21:01:23 1997 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in: Various changes to build info files
- in the object tree rather than the source tree.
-
- * proj.h: Include ctype.h.
-
-Sun Sep 14 12:35:20 1997 Fred Fish (fnf@ninemoons.com)
-
- * proj.h (isascii): Provide a default definition if none is available.
-
-Thu Sep 11 19:26:10 1997 Dave Love <d.love@dl.ac.uk>
-
- * config-lang.in: Remove the messages about possible build problems.
-
-Wed Sep 10 16:39:47 1997 Jim Wilson <wilson@cygnus.com>
-
- * Make-lang.in (LN, LN_S): New macros, use where appropriate.
-
-Tue Sep 9 13:20:40 1997 Jim Wilson <wilson@cygnus.com>
-
- * g77.c (pexecute, doit): Add checks for __CYGWIN32__.
-
-Wed Aug 27 20:32:03 1997 Jeffrey A Law (law@cygnus.com)
-
- * top.c (ffe_decode_option): Turn on flag_move_all_moveables
- and flag_reduce_all_givs.
-
-Mon Aug 25 23:24:32 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
-
- * Make-lang.in ($(srcdir)/f/runtime/configure,
- $(srcdir)/f/runtime/libU77/configure, f77.mostlyclean,
- f77.clean, f77.distclean, f77.maintainer-clean, f77.realclean):
- Handle absolute pathname of $(srcdir).
- (stmp-f2c.h): New.
- (include/f2c.h, f/runtime/Makefile, f/runtime/libF77/Makefile,
- f/runtime/libI77/Makefile, f/runtime/libU77/Makefile): Only
- depend on stmp-f2c.h.
- (f77.maintainer-clean): Don't make itself.
-
-Sun Aug 24 17:00:27 1997 Jim Wilson <wilson@cygnus.com>
-
- * Make-lang.in (f77.install-info): Don't cd into srcdir. Add srcdir
- to filenames. Use sed to extract base filename for install.
-
-Thu Aug 21 13:15:29 1997 Jim Wilson <wilson@cygnus.com>
-
- * Make-lang.in (f77): Delete f77-runtime.
- (f77.all.build, f77.all.cross, f77.rest.encap): Add f77-runtime.
-
-Wed Aug 20 16:36:59 1997 Jim Wilson <wilson@cygnus.com>
-
- * intdoc.texi: Readd generated file.
-
-Mon Aug 18 09:01:54 1997 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (F77_OBJS): Re-alphabetize.
- * Make-lang.in (F77_SRCS): Likewise.
-
-Sun Aug 17 08:35:11 1997 Jeffrey A Law (law@cygnus.com)
-
- * INSTALL: Rebuilt.
- * install.texi: Remove "Object File Differences" section. Remove
- all references to zzz.o failing comparison tests.
- * version.c, version.h: Renamed from zzz.c and zzz.h. Remove
- date and time stamps so a 3 stage build reports no differences.
- * Make-lang.in: Corresponding changes.
- * Makefile.in: Likewise.
- * g77.c, parse.c: Likewise.
-
- * intdoc.texi: Remove generated file from distribution.
-
-Tue Aug 12 10:23:02 1997 Jeffrey A Law (law@cygnus.com)
-
- * config-lang.in: Don't demand the backend patch.
- * com.c (lang_printable_name): Second argument is now an int. Don't
- store into the value of the second argument.
- * top.c (ffe_decode_option): Temporarily disable setting
- of "Toon" loop options until we figure out how to address
- them.
-
-Mon Aug 11 23:18:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * g77-0.5.21-19970811 Imported.
- This file describes changes to the front end necessary to make
- it work with egcs.
-
diff --git a/gcc/f/INSTALL b/gcc/f/INSTALL
index 176c03035d6..ab0d5b43fc4 100644
--- a/gcc/f/INSTALL
+++ b/gcc/f/INSTALL
@@ -3,14 +3,15 @@ compiler. Copyright (C) 1995, 1996 Free Software Foundation, Inc. You
may copy, distribute, and modify it freely as long as you preserve this
copyright notice and permission notice.
-Note most of this information is out of date and superceded by the EGCS
-install procedures. It is provided for historical reference only.
-
Installing GNU Fortran
**********************
The following information describes how to install `g77'.
+ Note that, for `egcs' users, much of this information is obsolete,
+and is superceded by the `egcs' installation procedures. Such
+information is explicitly flagged as such.
+
The information in this file generally pertains to dealing with
*source* distributions of `g77' and `gcc'. It is possible that some of
this information will be applicable to some *binary* distributions of
@@ -24,13 +25,16 @@ from source and package up as a binary distribution are ongoing.
Prerequisites
=============
+ *Version info:* For `egcs' users, the following information is
+superceded by the `egcs' installation instructions.
+
The procedures described to unpack, configure, build, and install
`g77' assume your system has certain programs already installed.
The following prerequisites should be met by your system before you
follow the `g77' installation instructions:
-`gzip'
+`gzip' and `tar'
To unpack the `gcc' and `g77' distributions, you'll need the
`gunzip' utility in the `gzip' distribution. Most UNIX systems
already have `gzip' installed. If yours doesn't, you can get it
@@ -45,24 +49,24 @@ follow the `g77' installation instructions:
1.2.4. (The version of GNU `tar' used to package this release is
1.12.)
-`gcc-2.7.2.3.tar.gz'
+`gcc-2.8.1.tar.gz'
You need to have this, or some other applicable, version of `gcc'
on your system. The version should be an exact copy of a
- distribution from the FSF. Its size is approximately 7.1MB.
+ distribution from the FSF. Its size is approximately 8.4MB.
- If you've already unpacked `gcc-2.7.2.3.tar.gz' into a directory
- (named `gcc-2.7.2.3') called the "source tree" for `gcc', you can
+ If you've already unpacked `gcc-2.8.1.tar.gz' into a directory
+ (named `gcc-2.8.1') called the "source tree" for `gcc', you can
delete the distribution itself, but you'll need to remember to
skip any instructions to unpack this distribution.
Without an applicable `gcc' source tree, you cannot build `g77'.
You can obtain an FSF distribution of `gcc' from the FSF.
-`g77-0.5.22.tar.gz'
+`g77-0.5.24.tar.gz'
You probably have already unpacked this package, or you are
reading an advance copy of these installation instructions, which
are contained in this distribution. The size of this package is
- approximately 1.5MB.
+ approximately 1.4MB.
You can obtain an FSF distribution of `g77' from the FSF, the same
way you obtained `gcc'.
@@ -74,46 +78,45 @@ Enough disk space
you install).
The sizes shown below assume all languages distributed in
- `gcc-2.7.2.3', plus `g77', will be built and installed. These
- sizes are indicative of GNU/Linux systems on Intel x86 running
- COFF and on Digital Alpha (AXP) systems running ELF. These should
- be fairly representative of 32-bit and 64-bit systems,
- respectively.
+ `gcc-2.8.1', plus `g77', will be built and installed. These sizes
+ are indicative of GNU/Linux systems on Intel x86 running COFF and
+ on Digital Alpha (AXP) systems running ELF. These should be
+ fairly representative of 32-bit and 64-bit systems, respectively.
Note that all sizes are approximate and subject to change without
notice! They are based on preliminary releases of g77 made shortly
before the public beta release.
- -- `gcc' and `g77' distributions occupy 8.6MB packed, 35MB
+ -- `gcc' and `g77' distributions occupy 10MB packed, 40MB
unpacked. These consist of the source code and documentation,
plus some derived files (mostly documentation), for `gcc' and
`g77'. Any deviations from these numbers for different kinds
of systems are likely to be very minor.
- -- A "bootstrap" build requires an additional 67.3MB for a
- total of 102MB on an ix86, and an additional 98MB for a total
- of 165MB on an Alpha.
+ -- A "bootstrap" build requires an additional 91MB for a total
+ of 132MB on an ix86, and an additional 136MB for a total of
+ 177MB on an Alpha.
- -- Removing `gcc/stage1' after the build recovers 10.7MB for a
- total of 91MB on an ix86, and recovers ??MB for a total of
- ??MB on an Alpha.
+ -- Removing `gcc/stage1' after the build recovers 13MB for a
+ total of 119MB on an ix86, and recovers 21MB for a total of
+ 155MB on an Alpha.
After doing this, the integrity of the build can still be
verified via `make compare', and the `gcc' compiler modified
and used to build itself for testing fairly quickly, using
the copy of the compiler kept in `gcc/stage2'.
- -- Removing `gcc/stage2' after the build further recovers
- 27.3MB for a total of 64.3MB, and recovers ??MB for a total
- of ??MB on an Alpha.
+ -- Removing `gcc/stage2' after the build further recovers 39MB
+ for a total of 80MB, and recovers 57MB for a total of 98MB on
+ an Alpha.
After doing this, the compiler can still be installed,
especially if GNU `make' is used to avoid gratuitous rebuilds
(or, the installation can be done by hand).
- -- Installing `gcc' and `g77' copies 14.9MB onto the `--prefix'
- disk for a total of 79.2MB on an ix86, and copies ??MB onto
- the `--prefix' disk for a total of ??MB on an Alpha.
+ -- Installing `gcc' and `g77' copies 23MB onto the `--prefix'
+ disk for a total of 103MB on an ix86, and copies 31MB onto
+ the `--prefix' disk for a total of 130MB on an Alpha.
After installation, if no further modifications and builds of
`gcc' or `g77' are planned, the source and build directory may be
@@ -139,57 +142,26 @@ Enough disk space
without replacing existing installed versions (assuming they have
different version numbers).
-`patch'
- Although you can do everything `patch' does yourself, by hand,
- without much trouble, having `patch' installed makes installation
- of new versions of GNU utilities such as `g77' so much easier that
- it is worth getting. You can obtain `patch' the same way you
- obtained `gcc' and `g77'.
-
- In any case, you can apply patches by hand--patch files are
- designed for humans to read them.
-
- The version of GNU `patch' used to develop this release is
- 2.5.
-
`make'
Your system must have `make', and you will probably save yourself
a lot of trouble if it is GNU `make' (sometimes referred to as
- `gmake').
+ `gmake'). In particular, you probably need GNU `make' to build
+ outside the source directory (with `configure''s `--srcdir'
+ option.)
The version of GNU `make' used to develop this release is
3.76.1.
`cc'
- Your system must have a working C compiler.
+ Your system must have a working C compiler. If it doesn't, you
+ might be able to obtain a prebuilt binary of some version of `gcc'
+ from the network or on CD-ROM, perhaps from the FSF. The best
+ source of information about binaries is probably a system-specific
+ Usenet news group, initially via its FAQ.
*Note Installing GNU CC: (gcc)Installation, for more information
on prerequisites for installing `gcc'.
-`bison'
- If you do not have `bison' installed, you can usually work around
- any need for it, since `g77' itself does not use it, and `gcc'
- normally includes all files generated by running it in its
- distribution. You can obtain `bison' the same way you obtained
- `gcc' and `g77'.
-
- The version of GNU `bison' used to develop this release is
- 1.25.
-
- *Note Missing bison?::, for information on how to work around not
- having `bison'.
-
-`makeinfo'
- If you are missing `makeinfo', you can usually work around any
- need for it. You can obtain `makeinfo' the same way you obtained
- `gcc' and `g77'.
-
- The version of GNU `makeinfo' used to develop this release is
- 1.68, from GNU `texinfo' version 3.11.
-
- *Note Missing makeinfo?::, for information on getting around the
- lack of `makeinfo'.
-
`sed'
All UNIX systems have `sed', but some have a broken version that
cannot handle configuring, building, or installing `gcc' or `g77'.
@@ -217,6 +189,61 @@ Enough disk space
for themselves how they want to modify the procedures described
below to suit the needs of their installation.
+`autoconf'
+ The version of GNU `autoconf' used to develop this release is
+ 2.12.
+
+ `autoconf' is not needed in the typical case of installing `gcc'
+ and `g77'. *Note Missing tools?::, for information on when it
+ might be needed and how to work around not having it.
+
+`bison'
+ The version of GNU `bison' used to develop this release is
+ 1.25.
+
+ `bison' is not needed in the typical case of installing `gcc' and
+ `g77'. *Note Missing tools?::, for information on when it might
+ be needed and how to work around not having it.
+
+`gperf'
+ The version of GNU `gperf' used to develop this release is
+ 2.5.
+
+ `gperf' is not needed in the typical case of installing `gcc' and
+ `g77'. *Note Missing tools?::, for information on when it might
+ be needed and how to work around not having it.
+
+`makeinfo'
+ The version of GNU `makeinfo' used to develop this release is
+ 1.68.
+
+ `makeinfo' is part of the GNU `texinfo' package; `makeinfo'
+ version 1.68 is distributed as part of GNU `texinfo' version
+ 3.11.
+
+ `makeinfo' is not needed in the typical case of installing `gcc'
+ and `g77'. *Note Missing tools?::, for information on when it
+ might be needed and how to work around not having it.
+
+ An up-to-date version of GNU `makeinfo' is still convenient when
+ obtaining a new version of a GNU distribution such as `gcc' or
+ `g77', as it allows you to obtain the `.diff.gz' file instead of
+ the entire `.tar.gz' distribution (assuming you have installed
+ `patch').
+
+`patch'
+ The version of GNU `patch' used to develop this release is
+ 2.5.
+
+ Beginning with `g77' version 0.5.23, it is no longer necessary to
+ patch the `gcc' back end to build `g77'.
+
+ An up-to-date version of GNU `patch' is still convenient when
+ obtaining a new version of a GNU distribution such as `gcc' or
+ `g77', as it allows you to obtain the `.diff.gz' file instead of
+ the entire `.tar.gz' distribution (assuming you have installed the
+ tools needed to rebuild derived files, such as `makeinfo').
+
Problems Installing
===================
@@ -247,21 +274,12 @@ bootstrap build to automate the process of first building `gcc' using
the working C compiler you have, then building `g77' and rebuilding
`gcc' using that just-built `gcc', and so on.
-Patching GNU CC Necessary
-.........................
-
- `g77' currently requires application of a patch file to the gcc
-compiler tree. The necessary patches should be folded in to the
-mainline gcc distribution.
+Patching GNU CC
+...............
- Some combinations of versions of `g77' and `gcc' might actually
-*require* no patches, but the patch files will be provided anyway as
-long as there are more changes expected in subsequent releases. These
-patch files might contain unnecessary, but possibly helpful, patches.
-As a result, it is possible this issue might never be resolved, except
-by eliminating the need for the person configuring `g77' to apply a
-patch by hand, by going to a more automated approach (such as
-configure-time patching).
+ `g77' no longer requires application of a patch file to the `gcc'
+compiler tree. In fact, no such patch file is distributed with `g77'.
+This is as of version 0.5.23 and `egcs' version 1.0.
Building GNU CC Necessary
.........................
@@ -270,31 +288,50 @@ Building GNU CC Necessary
and other non-Fortran items, but, for now, an easy way to do that is
not yet established.
-Missing strtoul
-...............
+Missing strtoul or bsearch
+..........................
+
+ *Version info:* The following information does not apply to the
+`egcs' version of `g77'.
+
+ On SunOS4 systems, linking the `f771' program used to produce an
+error message concerning an undefined symbol named `_strtoul', because
+the `strtoul' library function is not provided on that system.
+
+ Other systems have, in the past, been reported to not provide their
+own `strtoul' or `bsearch' function.
+
+ Some versions `g77' tried to default to providing bare-bones
+versions of `bsearch' and `strtoul' automatically, but every attempt at
+this has failed for at least one kind of system.
+
+ To limit the failures to those few systems actually missing the
+required routines, the bare-bones versions are still provided, in
+`gcc/f/proj.c', if the appropriate macros are defined. These are
+`NEED_BSEARCH' for `bsearch' and `NEED_STRTOUL' for `NEED_STRTOUL'.
+
+ Therefore, if you are sure your system is missing `bsearch' or
+`strtoul' in its library, define the relevant macro(s) before building
+`g77'. This can be done by editing `gcc/f/proj.c' and inserting either
+or both of the following `#define' statements before the comment shown:
- On SunOS4 systems, linking the `f771' program produces an error
-message concerning an undefined symbol named `_strtoul'.
-
- This is not a `g77' bug. *Note Patching GNU Fortran::, for
-information on a workaround provided by `g77'.
-
- The proper fix is either to upgrade your system to one that provides
-a complete ANSI C environment, or improve `gcc' so that it provides one
-for all the languages and configurations it supports.
-
- *Note:* In earlier versions of `g77', an automated workaround for
-this problem was attempted. It worked for systems without `_strtoul',
-substituting the incomplete-yet-sufficient version supplied with `g77'
-for those systems. However, the automated workaround failed
-mysteriously for systems that appeared to have conforming ANSI C
-environments, and it was decided that, lacking resources to more fully
-investigate the problem, it was better to not punish users of those
-systems either by requiring them to work around the problem by hand or
-by always substituting an incomplete `strtoul()' implementation when
-their systems had a complete, working one. Unfortunately, this meant
-inconveniencing users of systems not having `strtoul()', but they're
-using obsolete (and generally unsupported) systems anyway.
+ /* Insert #define statements here. */
+
+ #define NEED_BSEARCH
+ #define NEED_STRTOUL
+
+ Then, continue configuring and building `g77' as usual.
+
+ Or, you can define these on the `make' command line. To build with
+the bundled `cc' on SunOS4, for example, try:
+ make bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL'
+
+ If you then encounter problems compiling `gcc/f/proj.c', it might be
+due to a discrepancy between how `bsearch' or `strtoul' are defined by
+that file and how they're declared by your system's header files.
+
+ In that case, you'll have to use some basic knowledge of C to work
+around the problem, perhaps by editing `gcc/f/proj.c' somewhat.
Cleanup Kills Stage Directories
...............................
@@ -304,49 +341,37 @@ create the various `stageN' directories and their subdirectories, so
developers and expert installers wouldn't have to reconfigure after
cleaning up.
-Missing `gperf'?
-................
+ That help has arrived as of version 0.5.23 of `g77' and version 1.1
+of `egcs'. Configuration itself no longer creates any particular
+directories that are unique to `g77'. The build procedures in
+`Make-lang.in' take care of that, on demand.
- If a build aborts trying to invoke `gperf', that strongly suggests
-an improper method was used to create the `gcc' source directory, such
-as the UNIX `cp -r' command instead of `cp -pr', since this problem
-very likely indicates that the date-time-modified information on the
-`gcc' source files is incorrect.
+LANGUAGES Macro Ignored
+.......................
- The proper solution is to recreate the `gcc' source directory from a
-`gcc' distribution known to be provided by the FSF.
+ Prior to version 0.5.23 of `g77' and version 1.1 of `egcs', `g77'
+would sometimes ignore the absence of `f77' and `F77' in the
+`LANGUAGES' macro definition used for the `make' command being
+processed.
- It is possible you might be able to temporarily work around the
-problem, however, by trying these commands:
+ As of `g77' version 0.5.23 and `egcs' version 1.1, `g77' now obeys
+this macro in all relevant situations.
- sh# cd gcc
- sh# touch c-gperf.h
- sh#
-
- These commands update the date-time-modified information for the
-file produced by the invocation of `gperf' in the current versions of
-`gcc', so that `make' no longer believes it needs to update it. This
-file should already exist in a `gcc' distribution, but mistakes made
-when copying the `gcc' directory can leave the modification information
-set such that the `gperf' input files look more "recent" than the
-corresponding output files.
+ However, in versions of `gcc' through 2.8.1, non-`g77' portions of
+`gcc', such as `g++', are known to go ahead and perform various
+language-specific activities when their respective language strings do
+not appear in the `LANGUAGES' macro in effect during that invocation of
+`make'.
- If the above does not work, definitely start from scratch and avoid
-copying the `gcc' using any method that does not reliably preserve
-date-time-modified information, such as the UNIX `cp -r' command (use
-`cp -pr' instead).
+ It is expected that these remaining problems will be fixed in a
+future version of `gcc'.
System-specific Problems
------------------------
- If your system is based on a Digital Alpha (AXP) architecture and
-employs a 64-bit operating system (such as GNU/Linux), you might
-consider using `egcs' instead of versions of `g77' based on versions of
-`gcc' prior to 2.8. `http://www.cygnus.com/egcs' for information on
-`egcs', or obtain a copy from `ftp://egcs.cygnus.com/pub/egcs'.
-
- If your system is Irix 6, to obtain a working version of `gcc',
-`http://reality.sgi.com/knobi/gcc-2.7.2.x-on-irix-6.2-6.3'.
+ A linker bug on some versions of AIX 4.1 might prevent building when
+`g77' is built within `gcc'. It might also occur when building within
+`egcs'. *Note LINKFAIL::.
Cross-compiler Problems
-----------------------
@@ -382,12 +407,13 @@ reasons.
combinations of machines. For example, it might not know how to
handle floating-point constants.
- * Improvements to the way `libf2c' is built could make building
+ * Improvements to the way `libg2c' is built could make building
`g77' as a cross-compiler easier--for example, passing and using
- `$(LD)' and `$(AR)' in the appropriate ways.
+ `$(LD)' and `$(AR)' in the appropriate ways. (This is improved in
+ the `egcs' version of `g77', especially as of version 1.1.)
* There are still some challenges putting together the right
- run-time libraries (needed by `libf2c') for a target system,
+ run-time libraries (needed by `libg2c') for a target system,
depending on the systems involved in the configuration. (This is
a general problem with cross-compilation, and with `gcc' in
particular.)
@@ -453,8 +479,8 @@ reporting (immediate flagging of errors during writes) versus
asynchronous, or, more precisely, buffered error reporting (detection
of errors might be delayed).
- `libf2c' supports flagging write errors immediately when it is built
-with the `ALWAYS_FLUSH' macro defined. This results in a `libf2c' that
+ `libg2c' supports flagging write errors immediately when it is built
+with the `ALWAYS_FLUSH' macro defined. This results in a `libg2c' that
runs slower, sometimes quite a bit slower, under certain
circumstances--for example, accessing files via the networked file
system NFS--but the effect can be more reliable, robust file I/O.
@@ -462,18 +488,16 @@ system NFS--but the effect can be more reliable, robust file I/O.
If you know that Fortran programs requiring this level of precision
of error reporting are to be compiled using the version of `g77' you
are building, you might wish to modify the `g77' source tree so that
-the version of `libf2c' is built with the `ALWAYS_FLUSH' macro defined,
+the version of `libg2c' is built with the `ALWAYS_FLUSH' macro defined,
enabling this behavior.
- To do this, find this line in `f/runtime/configure.in' in your `g77'
-source tree:
+ To do this, find this line in `f/runtime/f2c.h' in your `g77' source
+tree:
- dnl AC_DEFINE(ALWAYS_FLUSH)
+ /* #define ALWAYS_FLUSH */
- Remove the leading `dnl ', so the line begins with `AC_DEFINE(', and
-run `autoconf' in that file's directory. (Or, if you don't have
-`autoconf', you can modify `f2c.h.in' in the same directory to include
-the line `#define ALWAYS_FLUSH' after `#define F2C_INCLUDE'.)
+ Remove the leading `/* ', so the line begins with `#define', and the
+trailing ` */'.
Then build or rebuild `g77' as appropriate.
@@ -558,6 +582,9 @@ support 64-bit systems.
Quick Start
===========
+ *Version info:* For `egcs' users, the following information is
+superceded by the `egcs' installation instructions.
+
This procedure configures, builds, and installs `g77' "out of the
box" and works on most UNIX systems. Each command is identified by a
unique number, used in the explanatory text that follows. For the most
@@ -575,81 +602,51 @@ is assumed that the source distributions themselves already reside in
`/usr/FSF', a naming convention used by the author of `g77' on his own
system:
- /usr/FSF/gcc-2.7.2.3.tar.gz
- /usr/FSF/g77-0.5.22.tar.gz
-
- Users of the following systems should not blindly follow these
-quick-start instructions, because of problems their systems have coping
-with straightforward installation of `g77':
-
- * SunOS4
-
- Instead, see *Note Complete Installation::, for detailed information
-on how to configure, build, and install `g77' for your particular
-system. Also, see *Note Known Causes of Trouble with GNU Fortran:
-Trouble, for information on bugs and other problems known to afflict the
-installation process, and how to report newly discovered ones.
+ /usr/FSF/gcc-2.8.1.tar.gz
+ /usr/FSF/g77-0.5.24.tar.gz
- If your system is *not* on the above list, and *is* a UNIX system or
-one of its variants, you should be able to follow the instructions
-below. If you vary *any* of the steps below, you might run into
-trouble, including possibly breaking existing programs for other users
-of your system. Before doing so, it is wise to review the explanations
-of some of the steps. These explanations follow this list of steps.
+ If you vary *any* of the steps below, you might run into trouble,
+including possibly breaking existing programs for other users of your
+system. Before doing so, it is wise to review the explanations of some
+of the steps. These explanations follow this list of steps.
sh[ 1]# cd /usr/src
- sh[ 2]# gunzip -c < /usr/FSF/gcc-2.7.2.3.tar.gz | tar xf -
+ sh[ 2]# gunzip -c < /usr/FSF/gcc-2.8.1.tar.gz | tar xf -
[Might say "Broken pipe"...that is normal on some systems.]
- sh[ 3]# gunzip -c < /usr/FSF/g77-0.5.22.tar.gz | tar xf -
+ sh[ 3]# gunzip -c < /usr/FSF/g77-0.5.24.tar.gz | tar xf -
["Broken pipe" again possible.]
- sh[ 4]# ln -s gcc-2.7.2.3 gcc
+ sh[ 4]# ln -s gcc-2.8.1 gcc
- sh[ 5]# ln -s g77-0.5.22 g77
+ sh[ 5]# ln -s g77-0.5.24 g77
sh[ 6]# mv -i g77/* gcc
[No questions should be asked by mv here; or, you made a mistake.]
- sh[ 7]# patch -p1 -E -V t -d gcc < gcc/f/gbe/2.7.2.3.diff
- [Unless patch complains about rejected patches, this step worked.]
-
- sh[ 8]# cd gcc
- sh[ 9]# touch f77-install-ok
- [Do not do the above if your system already has an f77
- command, unless you've checked that overwriting it
- is okay.]
-
- sh[10]# touch f2c-install-ok
- [Do not do the above if your system already has an f2c
- command, unless you've checked that overwriting it
- is okay. Else, touch f2c-exists-ok.]
-
- sh[11]# ./configure --prefix=/usr
+ sh[ 7]# cd gcc
+ sh[ 8]# ./configure --prefix=/usr
[Do not do the above if gcc is not installed in /usr/bin.
You might need a different --prefix=..., as
described below.]
- sh[12]# make bootstrap
+ sh[ 9]# make bootstrap
[This takes a long time, and is where most problems occur.]
- sh[13]# make compare
- [This verifies that the compiler is `sane'. Only
- the file `f/zzz.o' (aka `tmp-foo1' and `tmp-foo2')
- should be in the list of object files this command
- prints as having different contents. If other files
- are printed, you have likely found a g77 bug.]
+ sh[10]# make compare
+ [This verifies that the compiler is `sane'.
+ If any files are printed, you have likely found a g77 bug.]
- sh[14]# rm -fr stage1
+ sh[11]# rm -fr stage1
- sh[15]# make -k install
+ sh[12]# make -k install
[The actual installation.]
- sh[16]# g77 -v
+ sh[13]# g77 -v
[Verify that g77 is installed, obtain version info.]
- sh[17]#
+ sh[14]#
*Note Updating Your Info Directory: Updating Documentation, for
information on how to update your system's top-level `info' directory
@@ -664,17 +661,17 @@ Step 1: `cd /usr/src'
your system knew where to look for the source code for the
installed version of `g77' and `gcc' in any case.
-Step 3: `gunzip -d < /usr/FSF/g77-0.5.22.tar.gz | tar xf -'
+Step 3: `gunzip -d < /usr/FSF/g77-0.5.24.tar.gz | tar xf -'
It is not always necessary to obtain the latest version of `g77'
as a complete `.tar.gz' file if you have a complete, earlier
distribution of `g77'. If appropriate, you can unpack that earlier
version of `g77', and then apply the appropriate patches to
achieve the same result--a source tree containing version
- 0.5.22 of `g77'.
+ 0.5.24 of `g77'.
-Step 4: `ln -s gcc-2.7.2.3 gcc'
+Step 4: `ln -s gcc-2.8.1 gcc'
-Step 5: `ln -s g77-0.5.22 g77'
+Step 5: `ln -s g77-0.5.24 g77'
These commands mainly help reduce typing, and help reduce visual
clutter in examples in this manual showing what to type to install
`g77'.
@@ -684,7 +681,7 @@ Step 5: `ln -s g77-0.5.22 g77'
Step 6: `mv -i g77/* gcc'
After doing this, you can, if you like, type `rm g77' and `rmdir
- g77-0.5.22' to remove the empty directory and the symbol link to
+ g77-0.5.24' to remove the empty directory and the symbol link to
it. But, it might be helpful to leave them around as quick
reminders of which version(s) of `g77' are installed on your
system.
@@ -692,57 +689,19 @@ Step 6: `mv -i g77/* gcc'
*Note Unpacking::, for information on the contents of the `g77'
directory (as merged into the `gcc' directory).
-Step 7: `patch -p1 ...'
- If you are using GNU `patch' version 2.5 or later, this should
- produce a list of files patched. (Other versions of `patch' might
- not work properly.)
-
- If messages about "fuzz", "offset", or especially "reject files"
- are printed, it might mean you applied the wrong patch file. If
- you believe this is the case, it is best to restart the sequence
- after deleting (or at least renaming to unused names) the
- top-level directories for `g77' and `gcc' and their symbolic links.
-
- After this command finishes, the `gcc' directory might have old
- versions of several files as saved by `patch'. To remove these,
- after `cd gcc', type `rm -i *.~*~'.
-
- *Note Merging Distributions::, for more information.
-
- *Note:* `gcc' versions circa 2.7.2.2 and 2.7.2.3 are known to have
- slightly differing versions of the `gcc/ChangeLog' file, depending
- on how they are obtained. You can safely ignore diagnostics
- `patch' reports when patching this particular file, since it is
- purely a documentation file for implementors. See
- `gcc/f/gbe/2.7.2.3.diff' for more information.
-
-Step 9: `touch f77-install-ok'
- Don't do this if you don't want to overwrite an existing version
- of `f77' (such as a native compiler, or a script that invokes
- `f2c'). Otherwise, installation will overwrite the `f77' command
- and the `f77' man pages with copies of the corresponding `g77'
- material.
-
- *Note Installing `f77': Installing f77, for more information.
-
-Step 10: `touch f2c-install-ok'
- Don't do this if you don't want to overwrite an existing
- installation of `libf2c' (though, chances are, you do). Instead,
- `touch f2c-exists-ok' to allow the installation to continue
- without any error messages about `/usr/lib/libf2c.a' already
- existing.
-
- *Note Installing `f2c': Installing f2c, for more information.
-
-Step 11: `./configure --prefix=/usr'
- This is where you specify that the `g77' executable is to be
- installed in `/usr/bin/', the `libf2c.a' library is to be
- installed in `/usr/lib/', and so on.
+Step 8: `./configure --prefix=/usr'
+ This is where you specify that the `g77' and `gcc' executables are
+ to be installed in `/usr/bin/', the `g77' and `gcc' documentation
+ is to be installed in `/usr/info/' and `/usr/man/', and so on.
You should ensure that any existing installation of the `gcc'
- executable is in `/usr/bin/'. Otherwise, installing `g77' so that
- it does not fully replace the existing installation of `gcc' is
- likely to result in the inability to compile Fortran programs.
+ executable is in `/usr/bin/'.
+
+ However, if that existing version of `gcc' is not 2.8.1, or if you
+ simply wish to avoid risking overwriting it with a newly built
+ copy of the same version, you can specify `--prefix=/usr/local'
+ (which is the default) or some other path, and invoke the newly
+ installed version directly from that path's `bin' directory.
*Note Where in the World Does Fortran (and GNU CC) Go?: Where to
Install, for more information on determining where to install
@@ -750,28 +709,30 @@ Step 11: `./configure --prefix=/usr'
configuration process triggered by invoking the `./configure'
script.
-Step 12: `make bootstrap'
+Step 9: `make bootstrap'
*Note Installing GNU CC: (gcc)Installation, for information on the
kinds of diagnostics you should expect during this procedure.
*Note Building gcc::, for complete `g77'-specific information on
this step.
-Step 13: `make compare'
+Step 10: `make compare'
*Note Where to Port Bugs: Bug Lists, for information on where to
- report that you observed more than `f/zzz.o' having different
- contents during this phase.
+ report that you observed files having different contents during
+ this phase.
*Note How to Report Bugs: Bug Reporting, for information on *how*
to report bugs like this.
-Step 14: `rm -fr stage1'
+Step 11: `rm -fr stage1'
You don't need to do this, but it frees up disk space.
-Step 15: `make -k install'
+Step 12: `make -k install'
If this doesn't seem to work, try:
- make -k install install-libf77 install-f2c-all
+ make -k install install-libf77
+
+ Or, make sure you're using GNU `make'.
*Note Installation of Binaries::, for more information.
@@ -779,7 +740,7 @@ Step 15: `make -k install'
information on entering this manual into your system's list of
texinfo manuals.
-Step 16: `g77 -v'
+Step 13: `g77 -v'
If this command prints approximately 25 lines of output, including
the GNU Fortran Front End version number (which should be the same
as the version number for the version of `g77' you just built and
@@ -815,6 +776,13 @@ Step 16: `g77 -v'
Hello World # 10
sh#
+ If invoking `g77' doesn't seem to work, the problem might be that
+ you've installed it in a location that is not in your shell's
+ search path. For example, if you specified `--prefix=/gnu', and
+ `/gnu/bin' is not in your `PATH' environment variable, you must
+ explicitly specify the location of the compiler via `/gnu/bin/g77
+ -o smtest smtest.f'.
+
After proper installation, you don't need to keep your gcc and g77
source and build directories around anymore. Removing them can
free up a lot of disk space.
@@ -822,6 +790,9 @@ Step 16: `g77 -v'
Complete Installation
=====================
+ *Version info:* For `egcs' users, the following information is
+mostly superceded by the `egcs' installation instructions.
+
Here is the complete `g77'-specific information on how to configure,
build, and install `g77'.
@@ -847,10 +818,10 @@ generally only the documentation is immediately usable.
A sequence of commands typically used to unpack `gcc' and `g77' is:
sh# cd /usr/src
- sh# gunzip -c /usr/FSF/gcc-2.7.2.3.tar.gz | tar xf -
- sh# gunzip -c /usr/FSF/g77-0.5.22.tar.gz | tar xf -
- sh# ln -s gcc-2.7.2.3 gcc
- sh# ln -s g77-0.5.22 g77
+ sh# gunzip -c /usr/FSF/gcc-2.8.1.tar.gz | tar xf -
+ sh# gunzip -c /usr/FSF/g77-0.5.24.tar.gz | tar xf -
+ sh# ln -s gcc-2.8.1 gcc
+ sh# ln -s g77-0.5.24 g77
sh# mv -i g77/* gcc
*Notes:* The commands beginning with `gunzip...' might print `Broken
@@ -869,7 +840,7 @@ and the top level of just the `g77' source tree (prior to issuing the
All three entries should be moved (or copied) into a `gcc' source
tree (typically named after its version number and as it appears in the
-FSF distributions--e.g. `gcc-2.7.2.3').
+FSF distributions--e.g. `gcc-2.8.1').
`g77/f' is the subdirectory containing all of the code,
documentation, and other information that is specific to `g77'. The
@@ -881,10 +852,9 @@ from a single FSF distribution. They also help people encountering an
unmerged `g77' source tree for the first time.
*Note:* Please use *only* `gcc' and `g77' source trees as
-distributed by the FSF. Use of modified versions, such as the
-Pentium-specific-optimization port of `gcc', is likely to result in
-problems that appear to be in the `g77' code but, in fact, are not. Do
-not use such modified versions unless you understand all the
+distributed by the FSF. Use of modified versions is likely to result
+in problems that appear to be in the `g77' code but, in fact, are not.
+Do not use such modified versions unless you understand all the
differences between them and the versions the FSF distributes--in which
case you should be able to modify the `g77' (or `gcc') source trees
appropriately so `g77' and `gcc' can coexist as they do in the stock
@@ -893,22 +863,18 @@ FSF distributions.
Merging Distributions
---------------------
- After merging the `g77' source tree into the `gcc' source tree, the
-final merge step is done by applying the pertinent patches the `g77'
-distribution provides for the `gcc' source tree.
+ After merging the `g77' source tree into the `gcc' source tree, you
+have put together a complete `g77' source tree.
- Read the file `gcc/f/gbe/README', and apply the appropriate patch
-file for the version of the GNU CC compiler you have, if that exists.
-If the directory exists but the appropriate file does not exist, you
-are using either an old, unsupported version, or a release one that is
-newer than the newest `gcc' version supported by the version of `g77'
-you have.
+ As of version 0.5.23, `g77' no longer modifies the version number of
+`gcc', nor does it patch `gcc' itself.
- As of version 0.5.18, `g77' modifies the version number of `gcc' via
-the pertinent patches. This is done because the resulting version of
-`gcc' is deemed sufficiently different from the vanilla distribution to
-make it worthwhile to present, to the user, information signaling the
-fact that there are some differences.
+ `g77' still depends on being merged with an appropriate version of
+`gcc'. For version 0.5.24 of `g77', the specific version of `gcc'
+supported is 2.8.1.
+
+ However, other versions of `gcc' might be suitable "hosts" for this
+version of `g77'.
GNU version numbers make it easy to figure out whether a particular
version of a distribution is newer or older than some other version of
@@ -924,9 +890,10 @@ create.)
If your version of `gcc' is older than the oldest version supported
by `g77' (as casually determined by listing the contents of
-`gcc/f/gbe/'), you should obtain a newer, supported version of `gcc'.
-(You could instead obtain an older version of `g77', or try and get
-your `g77' to work with the old `gcc', but neither approach is
+`gcc/f/INSTALL/', which contains these installation instructions in
+plain-text format), you should obtain a newer, supported version of
+`gcc'. (You could instead obtain an older version of `g77', or try and
+get your `g77' to work with the old `gcc', but neither approach is
recommended, and you shouldn't bother reporting any bugs you find if you
take either approach, because they're probably already fixed in the
newer versions you're not using.)
@@ -934,191 +901,26 @@ newer versions you're not using.)
If your version of `gcc' is newer than the newest version supported
by `g77', it is possible that your `g77' will work with it anyway. If
the version number for `gcc' differs only in the PATCH field, you might
-as well try applying the `g77' patch that is for the newest version of
-`gcc' having the same MAJOR and MINOR fields, as this is likely to work.
+as well try that version of `gcc'. Since it has the same MAJOR and
+MINOR fields, the resulting combination is likely to work.
So, for example, if a particular version of `g77' has support for
-`gcc' versions 2.7.0 and 2.7.1, it is likely that `gcc-2.7.2' would
-work well with `g77' by using the `2.7.1.diff' patch file provided with
-`g77' (aside from some offsets reported by `patch', which usually are
-harmless).
+`gcc' versions 2.8.0 and 2.8.1, it is likely that `gcc-2.8.2' would
+work well with `g77'.
- However, `gcc-2.8.0' would almost certainly not work with that
-version of `g77' no matter which patch file was used, so a new version
-of `g77' would be needed (and you should wait for it rather than
-bothering the maintainers--*note User-Visible Changes: Changes.).
+ However, `gcc-2.9.0' would almost certainly not work with that
+version of `g77' without appropriate modifications, so a new version of
+`g77' would be needed (and you should wait for it rather than bothering
+the maintainers--*note User-Visible Changes: Changes.).
This complexity is the result of `gcc' and `g77' being separate
distributions. By keeping them separate, each product is able to be
independently improved and distributed to its user base more frequently.
- However, `g77' often requires changes to contemporary versions of
-`gcc'. Also, the GBE interface defined by `gcc' typically undergoes
-some incompatible changes at least every time the MINOR field of the
-version number is incremented, and such changes require corresponding
-changes to the `g77' front end (FFE).
-
- It is hoped that the GBE interface, and the `gcc' and `g77' products
-in general, will stabilize sufficiently for the need for hand-patching
-to disappear.
-
- If you are using GNU `patch' version 2.5 or later, this should
-produce a list of files patched. (Other versions of `patch' might not
-work properly.)
-
- If messages about "fuzz", "offset", or especially "reject files" are
-printed, it might mean you applied the wrong patch file. If you
-believe this is the case, it is best to restart the sequence after
-deleting (or at least renaming to unused names) the top-level
-directories for `g77' and `gcc' and their symbolic links. That is
-because `patch' might have partially patched some `gcc' source files,
-so reapplying the correct patch file might result in the correct
-patches being applied incorrectly (due to the way `patch' necessarily
-works).
-
- After `patch' finishes, the `gcc' directory might have old versions
-of several files as saved by `patch'. To remove these, after `cd gcc',
-type `rm -i *.~*~'.
-
- *Note:* `gcc' versions circa 2.7.2.2 and 2.7.2.3 are known to have
-slightly differing versions of the `gcc/ChangeLog' file, depending on
-how they are obtained. You can safely ignore diagnostics `patch'
-reports when patching this particular file, since it is purely a
-documentation file for implementors. See `gcc/f/gbe/2.7.2.3.diff' for
-more information.
-
- *Note:* `g77''s configuration file `gcc/f/config-lang.in' ensures
-that the source code for the version of `gcc' being configured has at
-least one indication of being patched as required specifically by `g77'.
-This configuration-time checking should catch failure to apply the
-correct patch and, if so caught, should abort the configuration with an
-explanation. *Please* do not try to disable the check, otherwise `g77'
-might well appear to build and install correctly, and even appear to
-compile correctly, but could easily produce broken code.
-
- `LC_ALL=C TZ=UTC0 diff -rcp2N' is used to create the patch files in
-`gcc/f/gbe/'.
-
-Installing `f77'
-----------------
-
- You should decide whether you want installation of `g77' to also
-install an `f77' command. On systems with a native `f77', this is not
-normally desired, so `g77' does not do this by default.
-
- If you want `f77' installed, create the file `f77-install-ok' (e.g.
-via the UNIX command `touch f77-install-ok') in the source or build
-top-level directory (the same directory in which the `g77' `f'
-directory resides, not the `f' directory itself), or edit
-`gcc/f/Make-lang.in' and change the definition of the
-`F77_INSTALL_FLAG' macro appropriately.
-
- Usually, this means that, after typing `cd gcc', you would type
-`touch f77-install-ok'.
-
- When you enable installation of `f77', either a link to or a direct
-copy of the `g77' command is made. Similarly, `f77.1' is installed as
-a man page.
-
- (The `uninstall' target in the `gcc/Makefile' also tests this macro
-and file, when invoked, to determine whether to delete the installed
-copies of `f77' and `f77.1'.)
-
- *Note:* No attempt is yet made to install a program (like a shell
-script) that provides compatibility with any other `f77' programs.
-Only the most rudimentary invocations of `f77' will work the same way
-with `g77'.
-
-Installing `f2c'
-----------------
-
- Currently, `g77' does not include `f2c' itself in its distribution.
-However, it does include a modified version of the `libf2c'. This
-version is normally compatible with `f2c', but has been modified to
-meet the needs of `g77' in ways that might possibly be incompatible
-with some versions or configurations of `f2c'.
-
- Decide how installation of `g77' should affect any existing
-installation of `f2c' on your system.
-
- If you do not have `f2c' on your system (e.g. no `/usr/bin/f2c', no
-`/usr/include/f2c.h', and no `/usr/lib/libf2c.a', `/usr/lib/libF77.a',
-or `/usr/lib/libI77.a'), you don't need to be concerned with this item.
-
- If you do have `f2c' on your system, you need to decide how users of
-`f2c' will be affected by your installing `g77'. Since `g77' is
-currently designed to be object-code-compatible with `f2c' (with very
-few, clear exceptions), users of `f2c' might want to combine
-`f2c'-compiled object files with `g77'-compiled object files in a
-single executable.
-
- To do this, users of `f2c' should use the same copies of `f2c.h' and
-`libf2c.a' that `g77' uses (and that get built as part of `g77').
-
- If you do nothing here, the `g77' installation process will not
-overwrite the `include/f2c.h' and `lib/libf2c.a' files with its own
-versions, and in fact will not even install `libf2c.a' for use with the
-newly installed versions of `gcc' and `g77' if it sees that
-`lib/libf2c.a' exists--instead, it will print an explanatory message
-and skip this part of the installation.
-
- To install `g77''s versions of `f2c.h' and `libf2c.a' in the
-appropriate places, create the file `f2c-install-ok' (e.g. via the UNIX
-command `touch f2c-install-ok') in the source or build top-level
-directory (the same directory in which the `g77' `f' directory resides,
-not the `f' directory itself), or edit `gcc/f/Make-lang.in' and change
-the definition of the `F2C_INSTALL_FLAG' macro appropriately.
-
- Usually, this means that, after typing `cd gcc', you would type
-`touch f2c-install-ok'.
-
- Make sure that when you enable the overwriting of `f2c.h' and
-`libf2c.a' as used by `f2c', you have a recent and properly configured
-version of `bin/f2c' so that it generates code that is compatible with
-`g77'.
-
- If you don't want installation of `g77' to overwrite `f2c''s existing
-installation, but you do want `g77' installation to proceed with
-installation of its own versions of `f2c.h' and `libf2c.a' in places
-where `g77' will pick them up (even when linking `f2c'-compiled object
-files--which might lead to incompatibilities), create the file
-`f2c-exists-ok' (e.g. via the UNIX command `touch f2c-exists-ok') in
-the source or build top-level directory, or edit `gcc/f/Make-lang.in'
-and change the definition of the `F2CLIBOK' macro appropriately.
-
-Patching GNU Fortran
---------------------
-
- If you're using a SunOS4 system, you'll need to make the following
-change to `gcc/f/proj.h': edit the line reading
-
- #define FFEPROJ_STRTOUL 1 ...
-
-by replacing the `1' with `0'. Or, you can avoid editing the source by
-adding
- CFLAGS='-DFFEPROJ_STRTOUL=0 -g -O'
- to the command line for `make' when you invoke it. (`-g' is the
-default for `CFLAGS'.)
-
- This causes a minimal version of `strtoul()' provided as part of the
-`g77' distribution to be compiled and linked into whatever `g77'
-programs need it, since some systems (like SunOS4 with only the bundled
-compiler and its runtime) do not provide this function in their system
-libraries.
-
- Similarly, a minimal version of `bsearch()' is available and can be
-enabled by editing a line similar to the one for `strtoul()' above in
-`gcc/f/proj.h', if your system libraries lack `bsearch()'. The method
-of overriding `X_CFLAGS' may also be used.
-
- These are not problems with `g77', which requires an ANSI C
-environment. You should upgrade your system to one that provides a
-full ANSI C environment, or encourage the maintainers of `gcc' to
-provide one to all `gcc'-based compilers in future `gcc' distributions.
-
- *Note Problems Installing::, for more information on why `strtoul()'
-comes up missing and on approaches to dealing with this problem that
-have already been tried.
+ However, the GBE interface defined by `gcc' typically undergoes some
+incompatible changes at least every time the MINOR field of the version
+number is incremented, and such changes require corresponding changes to
+the `g77' front end (FFE).
Where in the World Does Fortran (and GNU CC) Go?
------------------------------------------------
@@ -1128,8 +930,8 @@ Where in the World Does Fortran (and GNU CC) Go?
this information is given to the configuration tool and used during the
build itself.
- A `g77' installation necessarily requires installation of a
-`g77'-aware version of `gcc', so that the `gcc' command recognizes
+ A `g77' installation normally includes installation of a
+Fortran-aware version of `gcc', so that the `gcc' command recognizes
Fortran source files and knows how to compile them.
For this to work, the version of `gcc' that you will be building as
@@ -1138,24 +940,27 @@ the system.
Sometimes people make the mistake of installing `gcc' as
`/usr/local/bin/gcc', leaving an older, non-Fortran-aware version in
-`/usr/bin/gcc'. (Or, the opposite happens.) This can result in `g77'
-being unable to compile Fortran source files, because when it calls on
-`gcc' to do the actual compilation, `gcc' complains that it does not
-recognize the language, or the file name suffix.
+`/usr/bin/gcc'. (Or, the opposite happens.) This can result in `gcc'
+being unable to compile Fortran source files, because when the older
+version of `gcc' is invoked, it complains that it does not recognize
+the language, or the file name suffix.
So, determine whether `gcc' already is installed on your system,
and, if so, *where* it is installed, and prepare to configure the new
version of `gcc' you'll be building so that it installs over the
existing version of `gcc'.
- You might want to back up your existing copy of `bin/gcc', and the
-entire `lib/' directory, before you perform the actual installation (as
-described in this manual).
+ You might want to back up your existing copy of `/usr/bin/gcc', and
+the entire `/usr/lib' directory, before you perform the actual
+installation (as described in this manual).
Existing `gcc' installations typically are found in `/usr' or
-`/usr/local'. If you aren't certain where the currently installed
-version of `gcc' and its related programs reside, look at the output of
-this command:
+`/usr/local'. (This means the commands are installed in `/usr/bin' or
+`/usr/local/bin', the libraries in `/usr/lib' or `/usr/local/lib', and
+so on.)
+
+ If you aren't certain where the currently installed version of `gcc'
+and its related programs reside, look at the output of this command:
gcc -v -o /tmp/delete-me -xc /dev/null -xnone
@@ -1174,7 +979,8 @@ true for any package, not just `g77', though in this case it is
intentional that `g77' overwrites `gcc' if it is already installed--it
is unusual that the installation process for one distribution
intentionally overwrites a program or file installed by another
-distribution.)
+distribution, although, in this case, `g77' is an augmentation of the
+`gcc' distribution.)
Another reason to back up the existing version first, or make sure
you can restore it easily, is that it might be an older version on
@@ -1191,12 +997,12 @@ Configuring GNU CC
`g77' is configured automatically when you configure `gcc'. There
are two parts of `g77' that are configured in two different
ways--`g77', which "camps on" to the `gcc' configuration mechanism, and
-`libf2c', which uses a variation of the GNU `autoconf' configuration
+`libg2c', which uses a variation of the GNU `autoconf' configuration
system.
Generally, you shouldn't have to be concerned with either `g77' or
-`libf2c' configuration, unless you're configuring `g77' as a
-cross-compiler. In this case, the `libf2c' configuration, and possibly
+`libg2c' configuration, unless you're configuring `g77' as a
+cross-compiler. In this case, the `libg2c' configuration, and possibly
the `g77' and `gcc' configurations as well, might need special
attention. (This also might be the case if you're porting `gcc' to a
whole new system--even if it is just a new operating system on an
@@ -1207,19 +1013,27 @@ existing, supported CPU.)
Pay special attention to the `--prefix=' option, which you almost
certainly will need to specify.
- (Note that `gcc' installation information is provided as a straight
-text file in `gcc/INSTALL'.)
+ (Note that `gcc' installation information is provided as a
+plain-text file in `gcc/INSTALL'.)
The information printed by the invocation of `./configure' should
show that the `f' directory (the Fortran language) has been configured.
If it does not, there is a problem.
- *Note:* Configuring with the `--srcdir' argument is known to work
-with GNU `make', but it is not known to work with other variants of
-`make'. Irix5.2 and SunOS4.1 versions of `make' definitely won't work
-outside the source directory at present. `g77''s portion of the
-`configure' script issues a warning message about this when you
-configure for building binaries outside the source directory.
+ *Note:* Configuring with the `--srcdir' argument, or by starting in
+an empty directory and typing a command such as `../gcc/configure' to
+build with separate build and source directories, is known to work with
+GNU `make', but it is known to not work with other variants of `make'.
+Irix5.2 and SunOS4.1 versions of `make' definitely won't work outside
+the source directory at present.
+
+ `g77''s portion of the `configure' script used to issue a warning
+message about this when configuring for building binaries outside the
+source directory, but no longer does this as of version 0.5.23.
+
+ Instead, `g77' simply rejects most common attempts to build it using
+a non-GNU `make' when the build directory is not the same as the source
+directory, issuing an explanatory diagnostic.
Building GNU CC
---------------
@@ -1232,14 +1046,14 @@ or `gcc/Makefile', but if you do that, you're on your own. One change
is almost *certainly* going to cause failures: removing `c' or `f77'
from the definition of the `LANGUAGES' macro.
- After configuring `gcc', which configures `g77' and `libf2c'
+ After configuring `gcc', which configures `g77' and `libg2c'
automatically, you're ready to start the actual build by invoking
`make'.
- *Note:* You *must* have run `./configure' before you run `make',
-even if you're using an already existing `gcc' development directory,
-because `./configure' does the work to recognize that you've added
-`g77' to the configuration.
+ *Note:* You *must* have run the `configure' script in `gcc' before
+you run `make', even if you're using an already existing `gcc'
+development directory, because `./configure' does the work to recognize
+that you've added `g77' to the configuration.
There are two general approaches to building GNU CC from scratch:
@@ -1285,12 +1099,6 @@ large number of object files to ensure they're identical).
you can type `rm -fr stage1' to remove the binaries built during Stage
1.
- *Note:* *Note Object File Differences::, for information on expected
-differences in object files produced during Stage 2 and Stage 3 of a
-bootstrap build. These differences will be encountered as a result of
-using the `make compare' or similar command sequence recommended by the
-GNU CC installation documentation.
-
Also, *Note Installing GNU CC: (gcc)Installation, for important
information on building `gcc' that is not described in this `g77'
manual. For example, explanations of diagnostic messages and whether
@@ -1305,15 +1113,10 @@ object-compatible with the version of `gcc' you want to build as part
of building `g77', you can save time and disk space by doing a straight
build.
- To build just the C and Fortran compilers and the necessary run-time
+ To build just the compilers along with the necessary run-time
libraries, issue the following command:
- make -k CC=gcc LANGUAGES=f77 all g77
-
- (The `g77' target is necessary because the `gcc' build procedures
-apparently do not automatically build command drivers for languages in
-subdirectories. It's the `all' target that triggers building
-everything except, apparently, the `g77' command itself.)
+ make -k CC=gcc
If you run into problems using this method, you have two options:
@@ -1328,7 +1131,8 @@ Fortran: Trouble.
However, understand that many problems preventing a straight build
from working are not `g77' problems, and, in such cases, are not likely
-to be addressed in future versions of `g77'.
+to be addressed in future versions of `g77'. Consider treating them as
+`gcc' bugs instead.
Pre-installation Checks
-----------------------
@@ -1341,52 +1145,51 @@ work.
them when they work:
sh# cd /usr/src/gcc
- sh# ./g77 --driver=./xgcc -B./ -v
- g77 version 0.5.22
- ./xgcc -B./ -v -fnull-version -o /tmp/gfa18047 ...
+ sh# ./g77 -B./ -v
+ g77 version 0.5.24
+ Driving: ./g77 -B./ -v -c -xf77-version /dev/null -xnone
Reading specs from ./specs
- gcc version 2.7.2.3.f.2
- ./cpp -lang-c -v -isystem ./include -undef ...
- GNU CPP version 2.7.2.3.f.2 (Linux/Alpha)
+ gcc version 2.8.1
+ cpp -lang-c -v -isystem ./include -undef -D__GNUC__=2 ...
+ GNU CPP version 2.8.1 (Alpha GNU/Linux with ELF)
#include "..." search starts here:
#include <...> search starts here:
- ./include
- /usr/local/include
- /usr/alpha-unknown-linux/include
- /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.3.f.2/include
+ include
+ /usr/alpha-linux/include
+ /usr/lib/gcc-lib/alpha-linux/2.8.1/include
/usr/include
End of search list.
- ./f771 /tmp/cca18048.i -fset-g77-defaults -quiet -dumpbase ...
- GNU F77 version 2.7.2.3.f.2 (Linux/Alpha) compiled ...
- GNU Fortran Front End version 0.5.22 compiled: ...
- as -nocpp -o /tmp/cca180481.o /tmp/cca18048.s
- ld -G 8 -O1 -o /tmp/gfa18047 /usr/lib/crt0.o -L. ...
- __G77_LIBF77_VERSION__: 0.5.22
- @(#)LIBF77 VERSION 19970404
- __G77_LIBI77_VERSION__: 0.5.22
- @(#) LIBI77 VERSION pjw,dmg-mods 19970816
- __G77_LIBU77_VERSION__: 0.5.22
- @(#) LIBU77 VERSION 19970609
+ ./f771 -fnull-version -quiet -dumpbase g77-version.f -version ...
+ GNU F77 version 2.8.1 (alpha-linux) compiled ...
+ GNU Fortran Front End version 0.5.24
+ as -nocpp -o /tmp/cca14485.o /tmp/cca14485.s
+ ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 ...
+ /tmp/cca14485
+ __G77_LIBF77_VERSION__: 0.5.24
+ @(#)LIBF77 VERSION 19970919
+ __G77_LIBI77_VERSION__: 0.5.24
+ @(#) LIBI77 VERSION pjw,dmg-mods 19980405
+ __G77_LIBU77_VERSION__: 0.5.24
+ @(#) LIBU77 VERSION 19970919
sh# ./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone
Reading specs from ./specs
- gcc version 2.7.2.3.f.2
+ gcc version 2.8.1
./cpp -lang-c -v -isystem ./include -undef ...
- GNU CPP version 2.7.2.3.f.2 (Linux/Alpha)
+ GNU CPP version 2.8.1 (Alpha GNU/Linux with ELF)
#include "..." search starts here:
#include <...> search starts here:
- ./include
- /usr/local/include
- /usr/alpha-unknown-linux/include
- /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.3.f.2/include
+ include
+ /usr/alpha-linux/include
+ /usr/lib/gcc-lib/alpha-linux/2.8.1/include
/usr/include
End of search list.
./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version ...
- GNU C version 2.7.2.3.f.2 (Linux/Alpha) compiled ...
+ GNU C version 2.8.1 (alpha-linux) compiled ...
as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s
- ld -G 8 -O1 -o /tmp/delete-me /usr/lib/crt0.o -L. ...
- /usr/lib/crt0.o: In function `__start':
- crt0.S:110: undefined reference to `main'
- /usr/lib/crt0.o(.lita+0x28): undefined reference to `main'
+ ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 ...
+ /usr/lib/crt1.o: In function `_start':
+ ../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
+ ../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
sh#
(Note that long lines have been truncated, and `...' used to
@@ -1410,7 +1213,7 @@ use the following commands to invoke them.
To invoke `g77', type:
- /usr/src/gcc/g77 --driver=/usr/src/gcc/xgcc -B/usr/src/gcc/ ...
+ /usr/src/gcc/g77 -B/usr/src/gcc/ ...
To invoke `gcc', type:
@@ -1422,7 +1225,7 @@ Installation of Binaries
After configuring, building, and testing `g77' and `gcc', when you
are ready to install them on your system, type:
- make -k CC=gcc LANGUAGES=f77 install
+ make -k CC=gcc install
As described in *Note Installing GNU CC: (gcc)Installation, the
values for the `CC' and `LANGUAGES' macros should be the same as those
@@ -1434,83 +1237,179 @@ might have to supply the same definitions you used when building the
final stage) or if you deviated from the instructions for a straight
build.
- If the above command does not install `libf2c.a' as expected, try
+ If the above command does not install `libg2c.a' as expected, try
this:
- make -k ... install install-libf77 install-f2c-all
+ make -k ... install install-libf77
We don't know why some non-GNU versions of `make' sometimes require
this alternate command, but they do. (Remember to supply the
-appropriate definitions for `CC' and `LANGUAGES' where you see `...' in
-the above command.)
+appropriate definition for `CC' where you see `...' in the above
+command.)
Note that using the `-k' option tells `make' to continue after some
installation problems, like not having `makeinfo' installed on your
system. It might not be necessary for your system.
+ *Note:* `g77' no longer installs files not directly part of `g77',
+such as `/usr/bin/f77', `/usr/lib/libf2c.a', and `/usr/include/f2c.h',
+or their `/usr/local' equivalents.
+
+ *Note Distributing Binaries::, for information on how to accommodate
+systems with no existing non-`g77' `f77' compiler and systems with
+`f2c' installed.
+
Updating Your Info Directory
----------------------------
As part of installing `g77', you should make sure users of `info'
-can easily access this manual on-line. Do this by making sure a line
-such as the following exists in `/usr/info/dir', or in whatever file is
-the top-level file in the `info' directory on your system (perhaps
-`/usr/local/info/dir':
+can easily access this manual on-line.
+
+ `g77' does this automatically by invoking the `install-info' command
+when you use `make install' to install `g77'.
+
+ If that fails, or if the `info' directory it updates is not the one
+normally accessed by users, consider invoking it yourself. For example:
+
+ install-info --info-dir=/usr/info /usr/info/g77.info
+
+ The above example assumes the `g77' documentation already is
+installed in `/usr/info' and that `/usr/info/dir' is the file you wish
+to update. Adjust the command accordingly, if those assumptions are
+wrong.
+
+Missing tools?
+--------------
+
+ A build of `gcc' might fail due to one or more tools being called
+upon by `make' (during the build or install process), when those tools
+are not installed on your system.
+
+ This situation can result from any of the following actions
+(performed by you or someone else):
+
+ * Changing the source code or documentation yourself (as a developer
+ or technical writer).
+
+ * Applying a patch that changes the source code or documentation
+ (including, sometimes, the official patches distributed by the
+ FSF).
+
+ * Deleting the files that are created by the (missing) tools.
+
+ The `make maintainer-clean' command is supposed to delete these
+ files, so invoking this command without having all the appropriate
+ tools installed is not recommended.
+
+ * Creating the source directory using a method that does not
+ preserve the date-time-modified information in the original
+ distribution.
+
+ For example, the UNIX `cp -r' command copies a directory tree
+ without preserving the date-time-modified information. Use `cp
+ -pr' instead.
+
+ The reason these activities cause `make' to try and invoke tools
+that it probably wouldn't when building from a perfectly "clean" source
+directory containing `gcc' and `g77' is that some files in the source
+directory (and the corresponding distribution) aren't really source
+files, but *derived* files that are produced by running tools with the
+corresponding source files as input. These derived files "depend", in
+`make' terminology, on the corresponding source files.
- * g77: (g77). The GNU Fortran programming language.
+ `make' determines that a file that depends on another needs to be
+updated if the date-time-modified information for the source file shows
+that it is newer than the corresponding information for the derived
+file.
- If the menu in `dir' is organized into sections, `g77' probably
-belongs in a section with a name such as one of the following:
+ If it makes that determination, `make' runs the appropriate commands
+(specified in the "Makefile") to update the derived file, and this
+process typically calls upon one or more installed tools to do the work.
- * Fortran Programming
+ The "safest" approach to dealing with this situation is to recreate
+the `gcc' and `g77' source directories from complete `gcc' and `g77'
+distributions known to be provided by the FSF.
- * Writing Programs
+ Another fairly "safe" approach is to simply install the tools you
+need to complete the build process. This is especially appropriate if
+you've changed the source code or applied a patch to do so.
- * Programming Languages
+ However, if you're certain that the problem is limited entirely to
+incorrect date-time-modified information, that there are no
+discrepancies between the contents of source files and files derived
+from them in the source directory, you can often update the
+date-time-modified information for the derived files to work around the
+problem of not having the appropriate tools installed.
- * Languages Other Than C
+ On UNIX systems, the simplest way to update the date-time-modified
+information of a file is to use the use the `touch' command.
- * Scientific/Engineering Tools
+ How to use `touch' to update the derived files updated by each of
+the tools is described below. *Note:* New versions of `g77' might
+change the set of files it generates by invoking each of these tools.
+If you cannot figure out for yourself how to handle such a situation,
+try an older version of `g77' until you find someone who can (or until
+you obtain and install the relevant tools).
- * GNU Compilers
+Missing `autoconf'?
+...................
+
+ If you cannot install `autoconf', make sure you have started with a
+*fresh* distribution of `gcc' and `g77', do *not* do `make
+maintainer-clean', and, to ensure that `autoconf' is not invoked by
+`make' during the build, type these commands:
+
+ sh# cd gcc/f/runtime
+ sh# touch configure libU77/configure
+ sh# cd ../../..
+ sh#
Missing `bison'?
-----------------
+................
If you cannot install `bison', make sure you have started with a
-*fresh* distribution of `gcc', do *not* do `make maintainer-clean' (in
-other versions of `gcc', this was called `make realclean'), and, to
-ensure that `bison' is not invoked by `make' during the build, type
-these commands:
+*fresh* distribution of `gcc', do *not* do `make maintainer-clean',
+and, to ensure that `bison' is not invoked by `make' during the build,
+type these commands:
sh# cd gcc
- sh# touch c-parse.c c-parse.h cexp.c
+ sh# touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c
sh# touch cp/parse.c cp/parse.h objc-parse.c
+ sh# cd ..
sh#
- These commands update the date-time-modified information for all the
-files produced by the various invocations of `bison' in the current
-versions of `gcc', so that `make' no longer believes it needs to update
-them. All of these files should already exist in a `gcc' distribution,
-but the application of patches to upgrade to a newer version can leave
-the modification information set such that the `bison' input files look
-more "recent" than the corresponding output files.
+Missing `gperf'?
+................
- *Note:* New versions of `gcc' might change the set of files it
-generates by invoking `bison'--if you cannot figure out for yourself
-how to handle such a situation, try an older version of `gcc' until you
-find someone who can (or until you obtain and install `bison').
+ If you cannot install `gperf', make sure you have started with a
+*fresh* distribution of `gcc', do *not* do `make maintainer-clean',
+and, to ensure that `gperf' is not invoked by `make' during the build,
+type these commands:
+
+ sh# cd gcc
+ sh# touch c-gperf.h
+ sh# cd ..
+ sh#
Missing `makeinfo'?
--------------------
+...................
+
+ If `makeinfo' is needed but unavailable when installing (via `make
+install'), some files, like `libg2c.a', might not be installed, because
+once `make' determines that it cannot invoke `makeinfo', it cancels any
+further processing.
- If you cannot install `makeinfo', either use the `-k' option when
-invoking make to specify any of the `install' or related targets, or
-specify `MAKEINFO=echo' on the `make' command line.
+ If you cannot install `makeinfo', an easy work-around is to specify
+`MAKEINFO=true' on the `make' command line, or to specify the `-k'
+option (`make -k install').
- If you fail to do one of these things, some files, like `libf2c.a',
-might not be installed, because the failed attempt by `make' to invoke
-`makeinfo' causes it to cancel any further processing.
+ Another approach is to force the relevant files to be up-to-date by
+typing these commands and then re-trying the installation step:
+
+ sh# cd gcc
+ sh# touch f/g77.info f/BUGS f/INSTALL f/NEWS
+ sh# cd ..
+ sh#
Distributing Binaries
=====================
@@ -1526,33 +1425,62 @@ installed.
where `g77' could be considered the native compiler for Fortran and
`gcc' for C, etc.), you should definitely configure `g77' for
installation in `/usr/bin' instead of `/usr/local/bin'. Specify the
-`--prefix=/usr' option when running `./configure'. You might also want
-to set up the distribution so the `f77' command is a link to
-`g77'--just make an empty file named `f77-install-ok' in the source or
-build directory (the one in which the `f' directory resides, not the
-`f' directory itself) when you specify one of the `install' or
-`uninstall' targets in a `make' command.
-
- For a system that might already have `f2c' installed, you definitely
-will want to make another empty file (in the same directory) named
-either `f2c-exists-ok' or `f2c-install-ok'. Use the former if you
-don't want your distribution to overwrite `f2c'-related files in
-existing systems; use the latter if you want to improve the likelihood
-that users will be able to use both `f2c' and `g77' to compile code for
-a single program without encountering link-time or run-time
-incompatibilities.
-
- (Make sure you clearly document, in the "advertising" for your
+`--prefix=/usr' option when running `./configure'.
+
+ You might also want to set up the distribution so the `f77' command
+is a link to `g77', although a script that accepts "classic" UNIX `f77'
+options and translates the command-line to the appropriate `g77'
+command line would be more appropriate. If you do this, *please* also
+provide a "man page" in `man/man1/f77.1' describing the command. (A
+link to `man/man1/g77.1' is appropriate if `bin/f77' is a link to
+`bin/g77'.)
+
+ For a system that might already have `f2c' installed, consider
+whether inter-operation with `g77' will be important to users of `f2c'
+on that system. If you want to improve the likelihood that users will
+be able to use both `f2c' and `g77' to compile code for a single program
+without encountering link-time or run-time incompatibilities, make sure
+that, whenever they intend to combine `f2c'-produced code with
+`g77'-produced code in an executable, they:
+
+ * Use the `lib/gcc-lib/.../include/g2c.h' file generated by the
+ `g77' build in place of the `f2c.h' file that normally comes with
+ `f2c' (or versions of `g77' prior to 0.5.23) when compiling *all*
+ of the `f2c'-produced C code
+
+ * Link to the `lib/gcc-lib/.../libg2c.a' library built by the `g77'
+ build instead of the `libf2c.a' library that normally comes with
+ `f2c' (or versions of `g77' prior to 0.5.23)
+
+ How you choose to effect the above depends on whether the existing
+installation of `f2c' must be maintained.
+
+ In any case, it is important to try and ensure that the installation
+keeps working properly even after subsequent re-installation of `f2c',
+which probably involves overwriting `/usr/local/lib/libf2c.a' and
+`/usr/local/include/f2c.h', or similar.
+
+ At least, copying `libg2c.a' and `g2c.h' into the appropriate
+"public" directories allows users to more easily select the version of
+`libf2c' they wish to use for a particular build. The names are
+changed by `g77' to make this coexistence easier to maintain; even if
+`f2c' is installed later, the `g77' files normally installed by its
+installation process aren't disturbed. Use of symbolic links from one
+set of files to another might result in problems after a subsequent
+reinstallation of either `f2c' or `g77', so be sure to alert users of
+your distribution accordingly.
+
+ (Make sure you clearly document, in the description of your
distribution, how installation of your distribution will affect
existing installations of `gcc', `f2c', `f77', `libf2c.a', and so on.
-Similarly, you should clearly document any requirements you assume are
-met by users of your distribution.)
+Similarly, you should clearly document any requirements you assume will
+be met by users of your distribution.)
For other systems with native `f77' (and `cc') compilers, configure
`g77' as you (or most of your audience) would configure `gcc' for their
installations. Typically this is for installation in `/usr/local', and
-would not include a copy of `g77' named `f77', so users could still use
-the native `f77'.
+would not include a new version of `/usr/bin/f77' or
+`/usr/local/bin/f77', so users could still use the native `f77'.
In any case, for `g77' to work properly, you *must* ensure that the
binaries you distribute include:
@@ -1561,17 +1489,11 @@ binaries you distribute include:
This is the command most users use to compile Fortran.
`bin/gcc'
- This is the command all users use to compile Fortran, either
- directly or indirectly via the `g77' command. The `bin/gcc'
- executable file must have been built from a `gcc' source tree into
- which a `g77' source tree was merged and configured, or it will
- not know how to compile Fortran programs.
-
-`bin/f77'
- In installations with no non-GNU native Fortran compiler, this is
- the same as `bin/g77'. Otherwise, it should be omitted from the
- distribution, so the one on already on a particular system does
- not get overwritten.
+ This is the command some users use to compile Fortran, typically
+ when compiling programs written in other languages at the same
+ time. The `bin/gcc' executable file must have been built from a
+ `gcc' source tree into which a `g77' source tree was merged and
+ configured, or it will not know how to compile Fortran programs.
`info/g77.info*'
This is the documentation for `g77'. If it is not included, users
@@ -1591,35 +1513,36 @@ binaries you distribute include:
Documentation.
`man/man1/g77.1'
- This is the short man page for `g77'. It is out of date, but you
- might as well include it for people who really like man pages.
+ This is the short man page for `g77'. It is not always kept
+ up-to-date, but you might as well include it for people who really
+ like "man" pages.
-`man/man1/f77.1'
- In installations where `f77' is the same as `g77', this is the
- same as `man/man1/g77.1'. Otherwise, it should be omitted from
- the distribution, so the one already on a particular system does
- not get overwritten.
+`lib/gcc-lib'
+ This is the directory containing the "private" files installed by
+ and for `gcc', `g77', `g++', and other GNU compilers.
`lib/gcc-lib/.../f771'
This is the actual Fortran compiler.
-`lib/gcc-lib/.../libf2c.a'
+`lib/gcc-lib/.../libg2c.a'
This is the run-time library for `g77'-compiled programs.
Whether you want to include the slightly updated (and possibly
improved) versions of `cc1', `cc1plus', and whatever other binaries get
rebuilt with the changes the GNU Fortran distribution makes to the GNU
back end, is up to you. These changes are highly unlikely to break any
-compilers, and it is possible they'll fix back-end bugs that can be
-demonstrated using front ends other than GNU Fortran's.
+compilers, because they involve doing things like adding to the list of
+acceptable compiler options (so, for example, `cc1plus' accepts, and
+ignores, options that only `f771' actually processes).
Please assure users that unless they have a specific need for their
existing, older versions of `gcc' command, they are unlikely to
experience any problems by overwriting it with your version--though
they could certainly protect themselves by making backup copies first!
-Otherwise, users might try and install your binaries in a "safe" place,
-find they cannot compile Fortran programs with your distribution
-(because, perhaps, they're picking up their old version of the `gcc'
+
+ Otherwise, users might try and install your binaries in a "safe"
+place, find they cannot compile Fortran programs with your distribution
+(because, perhaps, they're invoking their old version of the `gcc'
command, which does not recognize Fortran programs), and assume that
your binaries (or, more generally, GNU Fortran distributions in
general) are broken, at least for their system.
diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in
index 9c91f8c6062..a180760348a 100644
--- a/gcc/f/Make-lang.in
+++ b/gcc/f/Make-lang.in
@@ -1,5 +1,5 @@
# Top level makefile fragment for GNU Fortran. -*-makefile-*-
-# Copyright (C) 1995-1997 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
@@ -15,8 +15,8 @@
#You should have received a copy of the GNU General Public License
#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.
+#the Free Software Foundation, 59 Temple Place - Suite 330,
+#Boston, MA 02111-1307, USA.
# This file provides the language dependent support in the main Makefile.
# Each language makefile fragment must provide the following targets:
@@ -32,55 +32,16 @@
#
# It should also provide rules for:
#
-# - making any compiler driver (eg: g77)
-# - the compiler proper (eg: f771)
+# - making any compiler driver (eg: g++)
+# - the compiler proper (eg: cc1plus)
# - define the names for selecting the language in LANGUAGES.
#
# $(srcdir) must be set to the gcc/ source directory (not gcc/f/).
#
-# Extra flags to pass to recursive makes (and to sub-configure).
-# Use different quoting rules compared with FLAGS_TO_PASS so we can use
-# this to set environment variables as well
-# Note that GCC_FOR_TARGET, GCC_FLAGS aren't in here -- treated separately.
-F77_FLAGS_TO_PASS = \
- CROSS="$(CROSS)" \
- AR_FLAGS="$(AR_FLAGS)" \
- AR="$(AR)" \
- BISON="$(BISON)" \
- BISONFLAGS="$(BISONFLAGS)" \
- CC="$(CC)" \
- CFLAGS="$(CFLAGS)" \
- X_CFLAGS="$(X_CFLAGS)" \
- LDFLAGS="$(LDFLAGS)" \
- LEX="$(LEX)" \
- LEXFLAGS="$(LEXFLAGS)" \
- MAKEINFO="$(MAKEINFO)" \
- MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
- RANLIB="$(RANLIB)" \
- RANLIB_TEST="$(RANLIB_TEST)" \
- SHELL="$(SHELL)" \
- exec_prefix="$(exec_prefix)" \
- prefix="$(prefix)" \
- tooldir="$(tooldir)" \
- bindir="$(bindir)" \
- libsubdir="$(libsubdir)"
-# "F77_FOR_BUILD=$(F77_FOR_BUILD)" \
-# "F77FLAGS=$(F77FLAGS)" \
-# "F77_FOR_TARGET=$(F77_FOR_TARGET)"
-
-# This flag controls whether to install (overwrite) f77 on this system,
-# and also whether to uninstall it when using the uninstall target.
-# As shipped, the flag is a test of whether the `f77_install_ok'
-# file exists in the build or source directories (top level), but
-# you can just change it here if you like.
-F77_INSTALL_FLAG = [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ]
-
-# Actual names to use when installing a native compiler.
-F77_INSTALL_NAME = `t='$(program_transform_name)'; echo f77 | sed $$t`
+# Actual name to use when installing a native compiler.
G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t`
-# Actual names to use when installing a cross-compiler.
-F77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo f77 | sed $$t`
+# Actual name to use when installing a cross-compiler.
G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t`
#
# Define the names for selecting f77 in LANGUAGES.
@@ -95,34 +56,66 @@ F77 f77: f771$(exeext)
f77.install-normal \
f77.install-common f77.install-info f77.install-man \
f77.uninstall f77.mostlyclean f77.clean f77.distclean \
- f77.maintainer-clean f77.realclean f77.stage1 f77.stage2 f77.stage3 \
- f77.stage4 f77.distdir f77.rebuilt
+ f77.extraclean f77.maintainer-clean f77.distdir f77.rebuilt \
+ f77.stage1 f77.stage2 f77.stage3 f77.stage4
g77.c: $(srcdir)/gcc.c
- -rm -f $@
- $(LN_S) $(srcdir)/gcc.c $@
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 ]; then \
+ rm -f g77.c; \
+ $(LN_S) $(srcdir)/gcc.c g77.c; \
+ else true; fi
+
+g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 ]; then \
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/f/g77spec.c; \
+ else true; fi
-g77spec.o: $(srcdir)/f/g77spec.c
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/f/g77spec.c
+g77version.o: $(srcdir)/f/version.c
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 ]; then \
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o g77version.o \
+ $(srcdir)/f/version.c; \
+ else true; fi
# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
# It'd be nice if we could find an easier way to do this---rather than have
# to track changes to the toplevel gcc Makefile as well.
# We depend on g77.c last, to make it obvious where it came from.
g77.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g77.c
- $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- $(DRIVER_DEFINES) \
- -DLANG_SPECIFIC_DRIVER -c g77.c
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 ]; then \
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(DRIVER_DEFINES) \
+ -DLANG_SPECIFIC_DRIVER -c g77.c; \
+ else true; fi
# Create the compiler driver for g77.
-g77$(exeext): g77.o g77spec.o version.o choose-temp.o pexecute.o prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g77.o g77spec.o prefix.o version.o \
- choose-temp.o pexecute.o $(EXTRA_GCC_OBJS) $(LIBS)
+g77$(exeext): g77.o g77spec.o g77version.o version.o choose-temp.o pexecute.o prefix.o mkstemp.o \
+ $(LIBDEPS) $(EXTRA_GCC_OBJS)
+ if [ -f lang-f77 ]; then \
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g77.o g77spec.o g77version.o \
+ version.o choose-temp.o pexecute.o prefix.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS); \
+ else true; fi
# Create a version of the g77 driver which calls the cross-compiler.
g77-cross$(exeext): g77$(exeext)
- -rm -f g77-cross$(exeext)
- cp g77$(exeext) g77-cross$(exeext)
+ if [ -f lang-f77 ]; then \
+ rm -f g77-cross$(exeext); \
+ cp g77$(exeext) g77-cross$(exeext); \
+ else true; fi
F77_SRCS = \
$(srcdir)/f/assert.j \
@@ -170,6 +163,7 @@ F77_SRCS = \
$(srcdir)/f/malloc.h \
$(srcdir)/f/name.c \
$(srcdir)/f/name.h \
+ $(srcdir)/f/output.j \
$(srcdir)/f/parse.c \
$(srcdir)/f/proj.c \
$(srcdir)/f/proj.h \
@@ -214,12 +208,14 @@ F77_SRCS = \
$(srcdir)/f/symbol.c \
$(srcdir)/f/symbol.def \
$(srcdir)/f/symbol.h \
+ $(srcdir)/f/system.j \
$(srcdir)/f/target.c \
$(srcdir)/f/target.h \
$(srcdir)/f/tconfig.j \
$(srcdir)/f/tm.j \
$(srcdir)/f/top.c \
$(srcdir)/f/top.h \
+ $(srcdir)/f/toplev.j \
$(srcdir)/f/tree.j \
$(srcdir)/f/type.c \
$(srcdir)/f/type.h \
@@ -228,11 +224,11 @@ F77_SRCS = \
$(srcdir)/f/where.c \
$(srcdir)/f/where.h
-f771$(exeext): $(P) $(F77_SRCS) $(LIBDEPS) stamp-objlist f/Makefile
- $(MAKE) -f f/Makefile $(FLAGS_TO_PASS) VPATH=$(srcdir) srcdir=$(srcdir) f771$(exeext)
-
-f/Makefile: $(srcdir)/f/Makefile.in $(srcdir)/configure
- $(SHELL) config.status
+f771$(exeext): $(P) $(F77_SRCS) $(LIBDEPS) stamp-objlist
+ touch lang-f77
+ cd f; $(MAKE) $(FLAGS_TO_PASS) \
+ HOST_CC="$(HOST_CC)" HOST_CFLAGS="$(HOST_CFLAGS)" HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \
+ ../f771$(exeext)
#
# Build hooks:
@@ -249,12 +245,32 @@ f77.dvi: f/g77.dvi
f/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
$(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
$(srcdir)/f/intdoc.texi
- $(MAKEINFO) -I$(srcdir)/f -o f/g77.info $(srcdir)/f/g77.texi
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 ]; then \
+ rm -f $(srcdir)/f/g77.info-*; \
+ $(MAKEINFO) -I$(srcdir)/f -o f/g77.info $(srcdir)/f/g77.texi; \
+ else true; fi
f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
- $(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
- $(srcdir)/f/intdoc.texi
- $(TEXI2DVI) -I$(srcdir)/f -o f/g77.dvi $(srcdir)/f/g77.texi
+ $(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
+ $(srcdir)/f/intdoc.texi
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+# `tex2dvi' was used below, but the Texinfo 3.12 one won't work properly
+# with the include files from $(srcdir). This use of TEXINPUTS may not
+# be universally valid. `$(TEX)' should be used if it gets defined in
+# gcc/Makefile.in.
+ if [ -f lang-f77 ]; then \
+ TEXINPUTS=$(srcdir)/f:$$TEXINPUTS tex $(srcdir)/f/g77.texi; \
+ texindex g77.??; \
+ TEXINPUTS=$(srcdir)/f:$$TEXINPUTS tex $(srcdir)/f/g77.texi; \
+ mv g77.dvi f; \
+ else true; fi
# This dance is all about producing accurate documentation for g77's
# intrinsics with minimum fuss. f/ansify appends "\n\" to C strings
@@ -276,13 +292,19 @@ f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
# been found only upon reading the documentation that was automatically
# produced from it.
$(srcdir)/f/intdoc.texi: f/intdoc.c f/intdoc.in f/ansify.c f/intrin.def f/intrin.h
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
- `echo $(srcdir)/f/ansify.c | sed 's,^\./,,'` -o f/ansify
- f/ansify < $(srcdir)/f/intdoc.in > f/intdoc.h0 $(srcdir)/f/intdoc.in
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -I./f \
- `echo $(srcdir)/f/intdoc.c | sed 's,^\./,,'` -o f/intdoc
- f/intdoc > $(srcdir)/f/intdoc.texi
- rm f/intdoc f/ansify f/intdoc.h0
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 ]; then \
+ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(INCLUDES) \
+ `echo $(srcdir)/f/ansify.c | sed 's,^\./,,'` -o f/ansify; \
+ f/ansify < $(srcdir)/f/intdoc.in > f/intdoc.h0 $(srcdir)/f/intdoc.in; \
+ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(INCLUDES) -I./f \
+ `echo $(srcdir)/f/intdoc.c | sed 's,^\./,,'` -o f/intdoc; \
+ f/intdoc > $(srcdir)/f/intdoc.texi; \
+ rm f/intdoc f/ansify f/intdoc.h0; \
+ else true; fi
$(srcdir)/f/BUGS: f/bugs0.texi f/bugs.texi
cd $(srcdir)/f; $(MAKEINFO) -D BUGSONLY --no-header --no-split \
@@ -296,7 +318,7 @@ $(srcdir)/f/NEWS: f/news0.texi f/news.texi
cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \
--no-validate -o NEWS news0.texi
-f77.rebuilt: $(srcdir)/f/g77.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \
+f77.rebuilt: f/g77.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \
$(srcdir)/f/NEWS
#
@@ -308,71 +330,88 @@ f77.install-normal:
# Install the driver program as $(target)-g77
# and also as either g77 (if native) or $(tooldir)/bin/g77.
f77.install-common:
- -if [ -f f771$(exeext) ] ; then \
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ -if [ -f lang-f77 -a -f f771$(exeext) ] ; then \
if [ -f g77-cross$(exeext) ] ; then \
rm -f $(bindir)/$(G77_CROSS_NAME)$(exeext); \
$(INSTALL_PROGRAM) g77-cross$(exeext) $(bindir)/$(G77_CROSS_NAME)$(exeext); \
chmod a+x $(bindir)/$(G77_CROSS_NAME)$(exeext); \
- if $(F77_INSTALL_FLAG) ; then \
- rm -f $(bindir)/$(F77_CROSS_NAME)$(exeext); \
- $(LN) $(bindir)/$(G77_CROSS_NAME)$(exeext) $(bindir)/$(F77_CROSS_NAME)$(exeext); \
- fi ; \
else \
rm -f $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
$(INSTALL_PROGRAM) g77$(exeext) $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
chmod a+x $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
- if $(F77_INSTALL_FLAG) ; then \
- rm -f $(bindir)/$(F77_INSTALL_NAME)$(exeext); \
- $(LN) $(bindir)/$(G77_INSTALL_NAME)$(exeext) $(bindir)/$(F77_INSTALL_NAME)$(exeext); \
- fi ; \
fi ; \
else true; fi
+ @if [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ]; then \
+ echo ''; \
+ echo 'Warning: egcs no longer installs an f77 command.'; \
+ echo ' You must do so yourself. For more information,'; \
+ echo ' read "Distributing Binaries" in the egcs g77 docs.'; \
+ echo ' (To turn off this warning, delete the file'; \
+ echo ' f77-install-ok in the source or build directory.)'; \
+ echo ''; \
+ else true; fi
# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
# to do the install. The sed rule was copied from stmp-int-hdrs.
f77.install-info: f77.info
- if [ -f f/g77.info ] ; then \
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ if [ -f lang-f77 -a -f f/g77.info ] ; then \
rm -f $(infodir)/g77.info*; \
for f in f/g77.info*; do \
realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
$(INSTALL_DATA) $$f $(infodir)/$$realfile; \
done; \
chmod a-x $(infodir)/g77.info*; \
- fi
+ else true; fi
+ @if [ -f lang-f77 -a -f $(srcdir)/f/g77.info ] ; then \
+ if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ echo " install-info --info-dir=$(infodir) $(infodir)/g77.info"; \
+ install-info --info-dir=$(infodir) $(infodir)/g77.info || : ; \
+ else : ; fi; \
+ else : ; fi
f77.install-man: $(srcdir)/f/g77.1
- -if [ -f f771$(exeext) ] ; then \
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ -if [ -f lang-f77 -a -f f771$(exeext) ] ; then \
if [ -f g77-cross$(exeext) ] ; then \
rm -f $(mandir)/$(G77_CROSS_NAME)$(manext); \
$(INSTALL_DATA) $(srcdir)/f/g77.1 $(mandir)/$(G77_CROSS_NAME)$(manext); \
chmod a-x $(mandir)/$(G77_CROSS_NAME)$(manext); \
- if $(F77_INSTALL_FLAG) ; then \
- rm -f $(mandir)/$(F77_CROSS_NAME)$(manext); \
- $(LN) $(mandir)/$(G77_CROSS_NAME)$(manext) $(mandir)/$(F77_CROSS_NAME)$(manext); \
- fi ;\
else \
rm -f $(mandir)/$(G77_INSTALL_NAME)$(manext); \
$(INSTALL_DATA) $(srcdir)/f/g77.1 $(mandir)/$(G77_INSTALL_NAME)$(manext); \
chmod a-x $(mandir)/$(G77_INSTALL_NAME)$(manext); \
- if $(F77_INSTALL_FLAG) ; then \
- rm -f $(mandir)/$(F77_INSTALL_NAME)$(manext); \
- $(LN) $(mandir)/$(G77_INSTALL_NAME)$(manext) $(mandir)/$(F77_INSTALL_NAME)$(manext); \
- fi ;\
fi; \
else true; fi
f77.uninstall:
- -if $(F77_INSTALL_FLAG) ; then \
- rm -rf $(bindir)/$(F77_INSTALL_NAME)$(exeext) ; \
- rm -rf $(bindir)/$(F77_CROSS_NAME)$(exeext) ; \
- rm -rf $(mandir)/$(F77_INSTALL_NAME)$(manext) ; \
- rm -rf $(mandir)/$(F77_CROSS_NAME)$(manext) ; \
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ @if [ -f lang-f77 ] ; then \
+ if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ echo " install-info --delete --info-dir=$(infodir) $(infodir)/g77.info"; \
+ install-info --delete --info-dir=$(infodir) $(infodir)/g77.info || : ; \
+ else : ; fi; \
+ else : ; fi
+ -if [ -f lang-f77 ]; then \
+ rm -rf $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
+ rm -rf $(bindir)/$(G77_CROSS_NAME)$(exeext); \
+ rm -rf $(mandir)/$(G77_INSTALL_NAME)$(manext); \
+ rm -rf $(mandir)/$(G77_CROSS_NAME)$(manext); \
+ rm -rf $(infodir)/g77.info*; \
fi
- -rm -rf $(bindir)/$(G77_INSTALL_NAME)$(exeext)
- -rm -rf $(bindir)/$(G77_CROSS_NAME)$(exeext)
- -rm -rf $(mandir)/$(G77_INSTALL_NAME)$(manext)
- -rm -rf $(mandir)/$(G77_CROSS_NAME)$(manext)
- -rm -rf $(infodir)/g77.info*
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
@@ -380,36 +419,54 @@ f77.uninstall:
f77.mostlyclean:
-rm -f f/*$(objext)
- -rm -f f/fini f/f771 f/stamp-str f/str-*.h f/str-*.j f/intdoc f/ansify f/intdoc.h0
+ -rm -f f/fini f/stamp-str f/str-*.h f/str-*.j
+ -rm -f f/intdoc f/ansify f/intdoc.h0
+ -rm -f g77.aux g77.cps g77.ky g77.toc g77.vr g77.fn g77.kys \
+ g77.pg g77.tp g77.vrs g77.cp g77.fns g77.log g77.pgs g77.tps
f77.clean:
- -rm -f g77.c
+ -rm -f g77.c g77.o g77spec.o g77version.o
f77.distclean:
- -rm -f f/Makefile
-# realclean is the pre-2.7.0 name for maintainer-clean
-f77.maintainer-clean f77.realclean: f77.distclean
+ -rm -f lang-f77 f/Makefile
+f77.extraclean:
+f77.maintainer-clean:
-rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/INSTALL f/NEWS f/intdoc.texi
#
# Stage hooks:
# The main makefile has already created stage?/f.
-G77STAGESTUFF = f/*$(objext) f/fini f/stamp-str f/str-*.h f/str-*.j
+G77STAGESTUFF = f/*$(objext) f/fini f/stamp-str f/str-*.h f/str-*.j \
+ lang-f77 g77.c g77.o g77spec.o g77version.o
f77.stage1: stage1-start
- -mv $(G77STAGESTUFF) stage1/f
+ -if [ -f lang-f77 ]; then \
+ mv -f $(G77STAGESTUFF) stage1/f; \
+ fi
f77.stage2: stage2-start
- -mv $(G77STAGESTUFF) stage2/f
+ -if [ -f lang-f77 ]; then \
+ mv -f $(G77STAGESTUFF) stage2/f; \
+ fi
f77.stage3: stage3-start
- -mv $(G77STAGESTUFF) stage3/f
+ -if [ -f lang-f77 ]; then \
+ mv -f $(G77STAGESTUFF) stage3/f; \
+ fi
f77.stage4: stage4-start
- -mv $(G77STAGESTUFF) stage4/f
+ -if [ -f lang-f77 ]; then \
+ mv -f $(G77STAGESTUFF) stage4/f; \
+ fi
#
# Maintenance hooks:
# This target creates the files that can be rebuilt, but go in the
# distribution anyway. It then copies the files to the distdir directory.
f77.distdir: f77.rebuilt
- mkdir tmp/f
- cd f; \
- for file in *[0-9a-zA-Z+]; do \
- ($LN) $$file ../tmp/f
- done
+ case "$(LANGUAGES)" in \
+ *[fF]77*) touch lang-f77;; \
+ *) rm -f lang-f77;; \
+ esac
+ -if [ -f lang-f77 ]; then \
+ mkdir tmp/f; \
+ cd f; \
+ for file in *[0-9a-zA-Z+]; do \
+ $(LN_S) $$file ../tmp/f; \
+ done; \
+ fi
diff --git a/gcc/f/Makefile.in b/gcc/f/Makefile.in
index 7ef9bc49e1c..639d633b5e5 100644
--- a/gcc/f/Makefile.in
+++ b/gcc/f/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for GNU F77 compiler.
-# Copyright (C) 1995-1997 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
@@ -54,8 +54,7 @@ T_CFLAGS =
X_CPPFLAGS =
T_CPPFLAGS =
-CC = cc
-HOST_CC = $(CC)
+CC = @CC@
BISON = bison
BISONFLAGS =
LEX = flex
@@ -84,15 +83,13 @@ GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
-target= ... `configure' substitutes actual target name here.
-xmake_file= ... `configure' substitutes actual x- file name here.
-tmake_file= ... `configure' substitutes actual t- file name here.
+target=@target@
+xmake_file=@dep_host_xmake_file@
+tmake_file=@dep_tmake_file@
-# Directory where gcc sources are (gcc/), from where we are.
-# Note that this should be overridden when building f771, which happens
-# at the top level, not in f. Likewise for VPATH (if added).
-srcdir = .
-VPATH = .
+# Directory where sources are, from where we are.
+srcdir = @srcdir@
+VPATH = @srcdir@
# Additional system libraries to link with.
CLIB=
@@ -106,26 +103,8 @@ ALL=all
# End of variables for you to override.
-# Definition of `none' is here so that new rules inserted by sed
+# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
-none:
- @echo ''
- @echo 'Do not use this makefile to build anything other than the'
- @echo 'g77 derived files via the "make g77-only" target.'
- @echo 'Instead, use the documented procedures to build gcc itself,'
- @echo 'which will build g77 as well when done properly.'
- @echo ''
- @exit 1
-
-# This rule is just a handy way to build the g77 derived files without
-# having the gcc source tree around.
-g77-only: force
- if [ -f g77.texi ] ; then \
- (cd ..; $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt); \
- else \
- $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt; \
- fi
-
all: all.indirect
# This tells GNU Make version 3 not to put all variables in the environment.
@@ -133,16 +112,21 @@ all: all.indirect
# sed inserts variable overrides after the following line.
####target overrides
+@target_overrides@
####host overrides
+@host_overrides@
####cross overrides
+@cross_defines@
+@cross_overrides@
####build overrides
+@build_overrides@
#
# Now figure out from those variables how to compile and link.
-all.indirect: f/Makefile f771$(exeext)
+all.indirect: Makefile ../f771$(exeext)
# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
+INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall
@@ -150,18 +134,17 @@ ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
-# f771 is so big, need to tell linker on m68k-next-nextstep* to make enough
-# room for it. On AIX, linking f771 overflows the linker TOC. -bbigtoc is
-# appropriate for the linker on AIX 4.1 and above.
-F771_LDFLAGS = `case "${target}" in\
- m68k-next-nextstep*) echo -segaddr __DATA 6000000;;\
- *-*-aix[4-9]*) \`$(CC) --print-prog-name=ld\` -v 2>&1 | grep BFD >/dev/null || echo -Wl,-bbigtoc;; esac`
+# We should be compiling with the built compiler, for which
+# BOOT_LDFLAGS is appropriate. (Formerly we had a separate
+# F771_LDFLAGS, but the ld flags can be taken care of by the target
+# configuration files in egcs.)
+LDFLAGS=$(BOOT_LDFLAGS)
# Even if ALLOCA is set, don't use it if compiling with GCC.
-SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo $(OBSTACK); else true; fi`
-SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo $(ALLOCA); else true; fi ;; esac`
-SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo $(MALLOC); else true; fi`
+SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
+SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
+SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
# How to link with both our special library facilities
# and the system's installed libraries.
@@ -170,105 +153,71 @@ LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
-# directory rather than in the source directory.
-INCLUDES = -If -I$(srcdir)/f -I. -I$(srcdir) -I$(srcdir)/config
-
-# Flags_to_pass to recursive makes.
-# Note that we don't need to distinguish the `_FOR_TARGET' cross tools
-# as AR and RANLIB are set appropriately by configure iff cross compiling.
-FLAGS_TO_PASS = \
- "CROSS=$(CROSS)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "AR=$(AR)" \
- "BISON=$(BISON)" \
- "BISONFLAGS=$(BISONFLAGS)" \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "GCCFLAGS=$(GCCFLAGS)" \
- "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LEX=$(LEX)" \
- "LEXFLAGS=$(LEXFLAGS)" \
- "MAKEINFO=$(MAKEINFO)" \
- "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
- "RANLIB=$(RANLIB)" \
- "RANLIB_TEST=$(RANLIB_TEST)" \
- "SHELL=$(SHELL)" \
- "exec_prefix=$(exec_prefix)" \
- "prefix=$(prefix)" \
- "local_prefix=$(local_prefix)" \
- "gxx_include_dir=$(gxx_include_dir)" \
- "tooldir=$(tooldir)" \
- "bindir=$(bindir)" \
- "libsubdir=$(libsubdir)"
+# subdirectory rather than in the source directory.
+INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
+# Always use -I$(srcdir)/config when compiling.
.c.o:
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
#
# Lists of files for various purposes.
# Language-specific object files for g77
F77_OBJS = \
- f/bad.o \
- f/bit.o \
- f/bld.o \
- f/com.o \
- f/data.o \
- f/equiv.o \
- f/expr.o \
- f/global.o \
- f/implic.o \
- f/info.o \
- f/intrin.o \
- f/lab.o \
- f/lex.o \
- f/malloc.o \
- f/name.o \
- f/parse.o \
- f/proj.o \
- f/src.o \
- f/st.o \
- f/sta.o \
- f/stb.o \
- f/stc.o \
- f/std.o \
- f/ste.o \
- f/storag.o \
- f/stp.o \
- f/str.o \
- f/sts.o \
- f/stt.o \
- f/stu.o \
- f/stv.o \
- f/stw.o \
- f/symbol.o \
- f/target.o \
- f/top.o \
- f/type.o \
- f/version.o \
- f/where.o
+ bad.o \
+ bit.o \
+ bld.o \
+ com.o \
+ data.o \
+ equiv.o \
+ expr.o \
+ global.o \
+ implic.o \
+ info.o \
+ intrin.o \
+ lab.o \
+ lex.o \
+ malloc.o \
+ name.o \
+ parse.o \
+ proj.o \
+ src.o \
+ st.o \
+ sta.o \
+ stb.o \
+ stc.o \
+ std.o \
+ ste.o \
+ storag.o \
+ stp.o \
+ str.o \
+ sts.o \
+ stt.o \
+ stu.o \
+ stv.o \
+ stw.o \
+ symbol.o \
+ target.o \
+ top.o \
+ type.o \
+ version.o \
+ where.o
# Language-independent object files.
-OBJS = `cat stamp-objlist | sed -e "s: : :g" -e "s: : f/:g"`
-OBJDEPS = stamp-objlist
+OBJS = `cat ../stamp-objlist`
+OBJDEPS = ../stamp-objlist
-compiler: f771$(exeext)
-# This is now meant to be built in the top level directory, not `f':
-f771$(exeext): $(P) f/Makefile $(F77_OBJS) $(OBJDEPS) $(LIBDEPS)
+compiler: ../f771$(exeext)
+../f771$(exeext): $(P) $(F77_OBJS) $(OBJDEPS) $(LIBDEPS)
rm -f f771$(exeext)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(F771_LDFLAGS) -o $@ \
- $(F77_OBJS) $(OBJS) $(LIBS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(F77_OBJS) $(OBJS) $(LIBS)
-# Check in case anyone expects to build in this directory:
-f/Makefile:
- @if test ! -f f/Makefile ; \
- then echo "Build f771 only at the top level." 2>&1; exit 1; \
- else true; fi
+Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
+ cd ..; $(SHELL) config.status
-Makefile: $(srcdir)/f/Makefile.in $(srcdir)/configure
-
-native: f771$(exeext)
+native: config.status ../f771$(exeext)
#
# Compiling object files from source files.
@@ -284,234 +233,239 @@ native: f771$(exeext)
# that live in a distclean'd gcc source directory have "$(srcdir)/"
# prefixes, while the others don't because they'll be created
# only in the build directory.
-ASSERT_H = $(srcdir)/f/assert.j $(srcdir)/assert.h
-CONFIG_H = $(srcdir)/f/config.j config.h
-CONVERT_H = $(srcdir)/f/convert.j $(srcdir)/convert.h
-FLAGS_H = $(srcdir)/f/flags.j $(srcdir)/flags.h
-GLIMITS_H = $(srcdir)/f/glimits.j $(srcdir)/glimits.h
-HCONFIG_H = $(srcdir)/f/hconfig.j hconfig.h
-INPUT_H = $(srcdir)/f/input.j $(srcdir)/input.h
-RTL_H = $(srcdir)/f/rtl.j $(srcdir)/rtl.h $(srcdir)/rtl.def \
- $(srcdir)/machmode.h $(srcdir)/machmode.def
-TCONFIG_H = $(srcdir)/f/tconfig.j tconfig.h
-TM_H = $(srcdir)/f/tm.j tm.h
-TREE_H = $(srcdir)/f/tree.j $(srcdir)/tree.h $(srcdir)/real.h \
- $(srcdir)/tree.def $(srcdir)/machmode.h $(srcdir)/machmode.def
+ASSERT_H = $(srcdir)/assert.j $(srcdir)/../assert.h
+CONFIG_H = $(srcdir)/config.j ../config.h
+CONVERT_H = $(srcdir)/convert.j $(srcdir)/../convert.h
+FLAGS_H = $(srcdir)/flags.j $(srcdir)/../flags.h
+GLIMITS_H = $(srcdir)/glimits.j $(srcdir)/../glimits.h
+HCONFIG_H = $(srcdir)/hconfig.j ../hconfig.h
+INPUT_H = $(srcdir)/input.j $(srcdir)/../input.h
+OUTPUT_H = $(srcdir)/output.j $(srcdir)/../output.h
+RTL_H = $(srcdir)/rtl.j $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
+ $(srcdir)/../machmode.h $(srcdir)/../machmode.def
+SYSTEM_H = $(srcdir)/system.j $(srcdir)/../system.h
+TCONFIG_H = $(srcdir)/tconfig.j ../tconfig.h
+TM_H = $(srcdir)/tm.j ../tm.h
+TOPLEV_H = $(srcdir)/toplev.j $(srcdir)/../toplev.h
+TREE_H = $(srcdir)/tree.j $(srcdir)/../tree.h $(srcdir)/../real.h \
+ $(srcdir)/../tree.def $(srcdir)/../machmode.h $(srcdir)/../machmode.def
#Build the first part of this list with the command line:
# cd gcc/; make deps-kinda -f f/Makefile.in
#Note that this command uses the host C compiler;
# use HOST_CC="./xgcc -B./" to use GCC in the build directory, for example.
#Also note that this particular build file seems to want to use
-# substitions: $(CONFIG_H) for config.h; $(TREE_H) for tree.h; and
-# $(RTL_H) for rtl.h. deps-kinda uses a sed script to do those
+# substitions: $(CONFIG_H) for config.h; $(TREE_H) for tree.h;
+# $(RTL_H) for rtl.h; etc.. deps-kinda uses a sed script to do those
# substitutions, plus others for elegance.
-f/bad.o: f/bad.c f/proj.h $(ASSERT_H) f/bad.h f/bad.def f/where.h $(GLIMITS_H) \
- f/top.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/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/bit.o: f/bit.c f/proj.h $(ASSERT_H) $(GLIMITS_H) f/bit.h f/malloc.h
-f/bld.o: f/bld.c f/proj.h $(ASSERT_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/com.o: f/com.c $(CONFIG_H) $(FLAGS_H) $(RTL_H) $(TREE_H) $(CONVERT_H) f/proj.h \
- $(ASSERT_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
-f/data.o: f/data.c f/proj.h $(ASSERT_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/equiv.o: f/equiv.c f/proj.h $(ASSERT_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/expr.o: f/expr.c f/proj.h $(ASSERT_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/fini.o: f/fini.c f/proj.h $(ASSERT_H) f/malloc.h
-f/g77.o: f/g77.c $(CONFIG_H)
-f/global.o: f/global.c f/proj.h $(ASSERT_H) f/global.h f/lex.h f/top.h f/malloc.h \
- f/where.h $(GLIMITS_H) f/name.h f/symbol.h f/symbol.def f/bad.h f/bad.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/implic.o: f/implic.c f/proj.h $(ASSERT_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/info.o: f/info.c f/proj.h $(ASSERT_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/intrin.o: f/intrin.c f/proj.h $(ASSERT_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/src.h
-f/lab.o: f/lab.c f/proj.h $(ASSERT_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/lex.o: f/lex.c f/proj.h $(ASSERT_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 $(CONFIG_H) $(FLAGS_H) $(INPUT_H)
-f/malloc.o: f/malloc.c f/proj.h $(ASSERT_H) f/malloc.h
-f/name.o: f/name.c f/proj.h $(ASSERT_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/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/src.h
-f/parse.o: f/parse.c f/proj.h $(ASSERT_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 f/version.h $(FLAGS_H)
-f/proj.o: f/proj.c f/proj.h $(ASSERT_H) $(GLIMITS_H)
-f/src.o: f/src.c f/proj.h $(ASSERT_H) f/src.h f/bad.h f/bad.def f/where.h \
- $(GLIMITS_H) f/top.h f/malloc.h
-f/st.o: f/st.c f/proj.h $(ASSERT_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/sta.o: f/sta.c f/proj.h $(ASSERT_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.o: f/stb.c f/proj.h $(ASSERT_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/stc.o: f/stc.c f/proj.h $(ASSERT_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/std.o: f/std.c f/proj.h $(ASSERT_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/ste.o: f/ste.c $(CONFIG_H) $(RTL_H) f/proj.h $(ASSERT_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/sta.h
-f/storag.o: f/storag.c f/proj.h $(ASSERT_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/stp.o: f/stp.c f/proj.h $(ASSERT_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/str.o: f/str.c f/proj.h $(ASSERT_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/sts.o: f/sts.c f/proj.h $(ASSERT_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/stt.o: f/stt.c f/proj.h $(ASSERT_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/stu.o: f/stu.c f/proj.h $(ASSERT_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/stv.o: f/stv.c f/proj.h $(ASSERT_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/stw.o: f/stw.c f/proj.h $(ASSERT_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/symbol.o: f/symbol.c f/proj.h $(ASSERT_H) f/symbol.h f/symbol.def 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/intrin.h f/intrin.def \
- f/equiv.h f/global.h f/name.h f/src.h f/st.h
-f/target.o: f/target.c f/proj.h $(ASSERT_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 f/info-b.def f/info-k.def \
- f/info-w.def f/type.h f/lex.h
-f/top.o: f/top.c f/proj.h $(ASSERT_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)
-f/type.o: f/type.c f/proj.h $(ASSERT_H) f/type.h f/malloc.h
-f/where.o: f/where.c f/proj.h $(ASSERT_H) f/where.h $(GLIMITS_H) f/top.h f/malloc.h \
- f/lex.h
-f/version.o: f/version.c f/proj.h $(ASSERT_H) f/version.h
+ansify.o: ansify.c $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H)
+bad.o: bad.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bad.h bad.def where.h \
+ $(GLIMITS_H) top.h malloc.h $(FLAGS_H) com.h com-rt.def $(TREE_H) bld.h \
+ bld-op.def bit.h info.h info-b.def info-k.def info-w.def target.h \
+ lex.h type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h \
+ storag.h global.h name.h $(TOPLEV_H)
+bit.o: bit.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H) bit.h \
+ malloc.h
+bld.o: bld.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bld.h bld-op.def bit.h \
+ malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def
+com.o: com.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(FLAGS_H) $(RTL_H) $(TOPLEV_H) \
+ $(TREE_H) $(OUTPUT_H) $(CONVERT_H) com.h com-rt.def bld.h bld-op.def bit.h \
+ malloc.h info.h info-b.def info-k.def info-w.def target.h bad.h \
+ bad.def where.h $(GLIMITS_H) top.h lex.h type.h intrin.h intrin.def \
+ lab.h symbol.h symbol.def equiv.h storag.h global.h name.h expr.h \
+ implic.h src.h st.h
+data.o: data.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) data.h bld.h \
+ bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
+ info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
+ lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
+ name.h intrin.h intrin.def expr.h st.h
+equiv.o: equiv.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) equiv.h bld.h \
+ bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
+ info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
+ lex.h type.h lab.h storag.h symbol.h symbol.def global.h name.h \
+ intrin.h intrin.def data.h
+expr.o: expr.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) expr.h bld.h \
+ bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
+ info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
+ lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
+ name.h intrin.h intrin.def implic.h src.h st.h stamp-str
+fini.o: fini.c proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) malloc.h
+global.o: global.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) global.h info.h \
+ info-b.def info-k.def info-w.def target.h $(TREE_H) bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h lex.h type.h name.h symbol.h \
+ symbol.def bld.h bld-op.def bit.h com.h com-rt.def lab.h storag.h \
+ intrin.h intrin.def equiv.h
+implic.o: implic.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) implic.h info.h \
+ info-b.def info-k.def info-w.def target.h $(TREE_H) bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h lex.h type.h symbol.h symbol.def \
+ bld.h bld-op.def bit.h com.h com-rt.def lab.h storag.h intrin.h \
+ intrin.def equiv.h global.h name.h src.h
+info.o: info.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) info.h info-b.def \
+ info-k.def info-w.def target.h $(TREE_H) bad.h bad.def where.h $(GLIMITS_H) \
+ top.h malloc.h lex.h type.h
+intdoc.o: intdoc.c $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) intrin.h intrin.def \
+ intdoc.h0 intdoc.h0
+intrin.o: intrin.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) intrin.h \
+ intrin.def bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) \
+ info.h info-b.def info-k.def info-w.def target.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h lex.h type.h lab.h storag.h symbol.h \
+ symbol.def equiv.h global.h name.h expr.h src.h
+lab.o: lab.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) lab.h com.h com-rt.def \
+ $(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \
+ global.h name.h
+lex.o: lex.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h where.h \
+ $(GLIMITS_H) bad.h bad.def com.h com-rt.def $(TREE_H) bld.h bld-op.def \
+ bit.h info.h info-b.def info-k.def info-w.def target.h lex.h type.h \
+ intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
+ global.h name.h src.h $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) $(OUTPUT_H)
+malloc.o: malloc.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) malloc.h
+name.o: name.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bad.h bad.def where.h \
+ $(GLIMITS_H) top.h malloc.h name.h global.h info.h info-b.def info-k.def \
+ info-w.def target.h $(TREE_H) lex.h type.h symbol.h symbol.def bld.h \
+ bld-op.def bit.h com.h com-rt.def lab.h storag.h intrin.h intrin.def \
+ equiv.h src.h
+parse.o: parse.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h \
+ where.h $(GLIMITS_H) com.h com-rt.def $(TREE_H) bld.h bld-op.def bit.h \
+ info.h info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h \
+ type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
+ global.h name.h version.h $(FLAGS_H)
+proj.o: proj.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
+src.o: src.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) src.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h
+st.o: st.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) st.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h lex.h symbol.h symbol.def bld.h \
+ bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
+ info-w.def target.h type.h lab.h storag.h intrin.h intrin.def equiv.h \
+ global.h name.h sta.h stamp-str stb.h expr.h stp.h stt.h stc.h std.h \
+ stv.h stw.h ste.h sts.h stu.h
+sta.o: sta.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) sta.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h lex.h stamp-str symbol.h symbol.def \
+ bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) info.h info-b.def \
+ info-k.def info-w.def target.h type.h lab.h storag.h intrin.h \
+ intrin.def equiv.h global.h name.h implic.h stb.h expr.h stp.h stt.h \
+ stc.h std.h stv.h stw.h
+stb.o: stb.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stb.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h expr.h bld.h bld-op.def bit.h com.h \
+ com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \
+ lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
+ name.h intrin.h intrin.def stp.h stt.h stamp-str src.h sta.h stc.h
+stc.o: stc.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stc.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h bld.h bld-op.def bit.h com.h \
+ com-rt.def $(TREE_H) info.h info-b.def info-k.def info-w.def target.h \
+ lex.h type.h lab.h storag.h symbol.h symbol.def equiv.h global.h \
+ name.h intrin.h intrin.def expr.h stp.h stt.h stamp-str data.h implic.h \
+ src.h sta.h std.h stv.h stw.h
+std.o: std.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) std.h bld.h bld-op.def \
+ bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def stp.h stt.h stamp-str stv.h stw.h sta.h ste.h sts.h
+ste.o: ste.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(RTL_H) $(TOPLEV_H) ste.h \
+ bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h \
+ info-b.def info-k.def info-w.def target.h bad.h bad.def where.h \
+ $(GLIMITS_H) top.h lex.h type.h lab.h storag.h symbol.h symbol.def \
+ equiv.h global.h name.h intrin.h intrin.def stp.h stt.h stamp-str sts.h \
+ stv.h stw.h expr.h sta.h
+storag.o: storag.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) storag.h bld.h \
+ bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def \
+ info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
+ lex.h type.h lab.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def data.h
+stp.o: stp.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stp.h bld.h bld-op.def \
+ bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def stt.h
+str.o: str.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) src.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h malloc.h stamp-str lex.h
+sts.o: sts.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) sts.h malloc.h com.h \
+ com-rt.def $(TREE_H) bld.h bld-op.def bit.h info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h intrin.h intrin.def lab.h symbol.h symbol.def equiv.h storag.h \
+ global.h name.h
+stt.o: stt.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stt.h top.h malloc.h \
+ where.h $(GLIMITS_H) bld.h bld-op.def bit.h com.h com-rt.def $(TREE_H) \
+ info.h info-b.def info-k.def info-w.def target.h bad.h bad.def lex.h \
+ type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def stp.h expr.h sta.h stamp-str
+stu.o: stu.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) bld.h bld-op.def bit.h \
+ malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def implic.h stu.h sta.h stamp-str
+stv.o: stv.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stv.h lab.h com.h \
+ com-rt.def $(TREE_H) bld.h bld-op.def bit.h malloc.h info.h info-b.def \
+ info-k.def info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h \
+ lex.h type.h intrin.h intrin.def symbol.h symbol.def equiv.h storag.h \
+ global.h name.h
+stw.o: stw.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) stw.h bld.h bld-op.def \
+ bit.h malloc.h com.h com-rt.def $(TREE_H) info.h info-b.def info-k.def \
+ info-w.def target.h bad.h bad.def where.h $(GLIMITS_H) top.h lex.h \
+ type.h lab.h storag.h symbol.h symbol.def equiv.h global.h name.h \
+ intrin.h intrin.def stv.h sta.h stamp-str
+symbol.o: symbol.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) symbol.h \
+ symbol.def bld.h bld-op.def bit.h malloc.h com.h com-rt.def $(TREE_H) \
+ info.h info-b.def info-k.def info-w.def target.h bad.h bad.def \
+ where.h $(GLIMITS_H) top.h lex.h type.h lab.h storag.h intrin.h \
+ intrin.def equiv.h global.h name.h src.h st.h
+target.o: target.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H) \
+ target.h $(TREE_H) bad.h bad.def where.h top.h malloc.h info.h \
+ info-b.def info-k.def info-w.def type.h lex.h
+top.o: top.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) top.h malloc.h where.h \
+ $(GLIMITS_H) bad.h bad.def bit.h bld.h bld-op.def com.h com-rt.def \
+ $(TREE_H) info.h info-b.def info-k.def info-w.def target.h lex.h type.h \
+ lab.h storag.h symbol.h symbol.def equiv.h global.h name.h intrin.h \
+ intrin.def data.h expr.h implic.h src.h st.h $(FLAGS_H) $(TOPLEV_H)
+type.o: type.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) type.h malloc.h
+version.o: version.c
+where.o: where.c proj.h $(CONFIG_H) $(SYSTEM_H) $(ASSERT_H) where.h $(GLIMITS_H) \
+ top.h malloc.h lex.h
# The rest of this list (Fortran 77 language-specific files) is hand-generated.
-f/stamp-str: f/str-1t.h f/str-1t.j f/str-2t.h f/str-2t.j \
- f/str-fo.h f/str-fo.j f/str-io.h f/str-io.j f/str-nq.h f/str-nq.j \
- f/str-op.h f/str-op.j f/str-ot.h f/str-ot.j
- touch f/stamp-str
+stamp-str: str-1t.h str-1t.j str-2t.h str-2t.j \
+ str-fo.h str-fo.j str-io.h str-io.j str-nq.h str-nq.j \
+ str-op.h str-op.j str-ot.h str-ot.j
+ touch stamp-str
-f/str-1t.h f/str-1t.j: f/fini f/str-1t.fin
- ./f/fini `echo $(srcdir)/f/str-1t.fin | sed 's,^\./,,'` f/str-1t.j f/str-1t.h
+str-1t.h str-1t.j: fini str-1t.fin
+ ./fini `echo $(srcdir)/str-1t.fin | sed 's,^\./,,'` str-1t.j str-1t.h
-f/str-2t.h f/str-2t.j: f/fini f/str-2t.fin
- ./f/fini `echo $(srcdir)/f/str-2t.fin | sed 's,^\./,,'` f/str-2t.j f/str-2t.h
+str-2t.h str-2t.j: fini str-2t.fin
+ ./fini `echo $(srcdir)/str-2t.fin | sed 's,^\./,,'` str-2t.j str-2t.h
-f/str-fo.h f/str-fo.j: f/fini f/str-fo.fin
- ./f/fini `echo $(srcdir)/f/str-fo.fin | sed 's,^\./,,'` f/str-fo.j f/str-fo.h
+str-fo.h str-fo.j: fini str-fo.fin
+ ./fini `echo $(srcdir)/str-fo.fin | sed 's,^\./,,'` str-fo.j str-fo.h
-f/str-io.h f/str-io.j: f/fini f/str-io.fin
- ./f/fini `echo $(srcdir)/f/str-io.fin | sed 's,^\./,,'` f/str-io.j f/str-io.h
+str-io.h str-io.j: fini str-io.fin
+ ./fini `echo $(srcdir)/str-io.fin | sed 's,^\./,,'` str-io.j str-io.h
-f/str-nq.h f/str-nq.j: f/fini f/str-nq.fin
- ./f/fini `echo $(srcdir)/f/str-nq.fin | sed 's,^\./,,'` f/str-nq.j f/str-nq.h
+str-nq.h str-nq.j: fini str-nq.fin
+ ./fini `echo $(srcdir)/str-nq.fin | sed 's,^\./,,'` str-nq.j str-nq.h
-f/str-op.h f/str-op.j: f/fini f/str-op.fin
- ./f/fini `echo $(srcdir)/f/str-op.fin | sed 's,^\./,,'` f/str-op.j f/str-op.h
+str-op.h str-op.j: fini str-op.fin
+ ./fini `echo $(srcdir)/str-op.fin | sed 's,^\./,,'` str-op.j str-op.h
-f/str-ot.h f/str-ot.j: f/fini f/str-ot.fin
- ./f/fini `echo $(srcdir)/f/str-ot.fin | sed 's,^\./,,'` f/str-ot.j f/str-ot.h
+str-ot.h str-ot.j: fini str-ot.fin
+ ./fini `echo $(srcdir)/str-ot.fin | sed 's,^\./,,'` str-ot.j str-ot.h
-f/fini: f/fini.o f/proj-h.o
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o f/fini f/fini.o f/proj-h.o
+fini: fini.o proj-h.o
+ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o fini fini.o proj-h.o
-f/fini.o:
+fini.o:
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
- `echo $(srcdir)/f/fini.c | sed 's,^\./,,'` -o $@
+ `echo $(srcdir)/fini.c | sed 's,^\./,,'` -o $@
-f/proj-h.o: f/proj.o
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
- `echo $(srcdir)/f/proj.c | sed 's,^\./,,'` -o $@
+# Like proj.o, but depends on hconfig.h instead of config.h.
+proj-h.o: proj.c proj.h $(HCONFIG_H) $(SYSTEM_H) $(ASSERT_H) $(GLIMITS_H)
+ $(HOST_CC) -c -DUSE_HCONFIG $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ `echo $(srcdir)/proj.c | sed 's,^\./,,'` -o $@
# Other than str-*.j, the *.j files are dummy #include files
# that normally just #include the corresponding back-end *.h
@@ -532,21 +486,33 @@ f/proj-h.o: f/proj.o
# as will be the case with proj.h in a clean directory.
MG=-MG
deps-kinda:
- $(HOST_CC) -DMAKING_DEPENDENCIES -MM $(MG) -I -If f/*.c | \
- sed -e 's: \([.]/\)*f/assert[.]j: $$(ASSERT_H):g' \
- -e 's: \([.]/\)*f/config[.]j: $$(CONFIG_H):g' \
- -e 's: \([.]/\)*f/convert[.]j: $$(CONVERT_H):g' \
- -e 's: \([.]/\)*f/flags[.]j: $$(FLAGS_H):g' \
- -e 's: \([.]/\)*f/glimits[.]j: $$(GLIMITS_H):g' \
- -e 's: \([.]/\)*f/hconfig[.]j: $$(HCONFIG_H):g' \
- -e 's: \([.]/\)*f/input[.]j: $$(INPUT_H):g' \
- -e 's: \([.]/\)*f/rtl[.]j: $$(RTL_H):g' \
- -e 's: \([.]/\)*f/tconfig[.]j: $$(TCONFIG_H):g' \
- -e 's: \([.]/\)*f/tm[.]j: $$(TM_H):g' \
- -e 's: \([.]/\)*f/tree[.]j: $$(TREE_H):g' \
- -e 's: proj[.]h: f/proj.h:g' \
- -e 's: \([.]/\)*f/str[.]h: f/stamp-str:g' \
- -e 's%^\(.*\)[ ]*: %f/\1: %g'
+ $(HOST_CC) -DMAKING_DEPENDENCIES -MM $(MG) *.c 2>&1 | \
+ sed -e 's: \([.]/\)*assert[.]j: $$(ASSERT_H):g' \
+ -e 's: \([.]/\)*config[.]j: $$(CONFIG_H):g' \
+ -e 's: \([.]/\)*convert[.]j: $$(CONVERT_H):g' \
+ -e 's: \([.]/\)*flags[.]j: $$(FLAGS_H):g' \
+ -e 's: \([.]/\)*glimits[.]j: $$(GLIMITS_H):g' \
+ -e 's: \([.]/\)*hconfig[.]j: $$(HCONFIG_H):g' \
+ -e 's: \([.]/\)*input[.]j: $$(INPUT_H):g' \
+ -e 's: \([.]/\)*output[.]j: $$(OUTPUT_H):g' \
+ -e 's: \([.]/\)*rtl[.]j: $$(RTL_H):g' \
+ -e 's: \([.]/\)*system[.]j: $$(SYSTEM_H):g' \
+ -e 's: \([.]/\)*tconfig[.]j: $$(TCONFIG_H):g' \
+ -e 's: \([.]/\)*tm[.]j: $$(TM_H):g' \
+ -e 's: \([.]/\)*toplev[.]j: $$(TOPLEV_H):g' \
+ -e 's: \([.]/\)*tree[.]j: $$(TREE_H):g' \
+ -e 's: \([.]/\)*str[.]h: stamp-str:g' \
+ -e 's:.*g77spec.*::g' \
+ -e 's%^\(.*\)[ ]*: %\1: %g'
+
+# This rule is just a handy way to build the g77 derived files without
+# having the gcc source tree around.
+g77-only: force
+ if [ -f g77.texi ] ; then \
+ (cd ..; $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt); \
+ else \
+ $(MAKE) srcdir=. HOST_CC=cc HOST_CFLAGS=-g -f f/Make-lang.in f77.rebuilt; \
+ fi
#
# These exist for maintenance purposes.
@@ -556,9 +522,8 @@ TAGS: force
cd $(srcdir)/f ; \
etags *.c *.h ; \
echo 'l' | tr 'l' '\f' >> TAGS ; \
- echo 'parse.y,0' >> TAGS ; \
etags -a ../*.h ../*.c;
-.PHONY: none all all.indirect f77.rebuilt compiler native deps-kinda TAGS g77-only
+.PHONY: none all all.indirect f77.rebuilt compiler native deps-kinda g77-only TAGS force
force:
diff --git a/gcc/f/NEWS b/gcc/f/NEWS
index 143e53e4e94..2cc6cbfe5a2 100644
--- a/gcc/f/NEWS
+++ b/gcc/f/NEWS
@@ -11,9 +11,10 @@ with the most recent version first.
The changes are generally listed in order:
- 1. Code-generation and run-time-library bugs
+ 1. Code-generation and run-time-library bug-fixes
- 2. Compiler and run-time-library crashes involving valid code
+ 2. Compiler and run-time-library crashes involving valid code that
+ have been fixed
3. New features
@@ -28,6 +29,175 @@ with the most recent version first.
This order is not strict--for example, some items involve a
combination of these elements.
+In `egcs' 1.1:
+==============
+
+ * `g77' no longer produces incorrect code and initial values for
+ `EQUIVALENCE' and `COMMON' aggregates that, due to "unnatural"
+ ordering of members vis-a-vis their types, require initial padding.
+
+ * `g77' no longer crashes when compiling code containing
+ specification statements such as `INTEGER(KIND=7) PTR'.
+
+ * `g77' now treats `%LOC(EXPR)' and `LOC(EXPR)' as "ordinary"
+ expressions when they are used as arguments in procedure calls.
+ This change applies only to global (filewide) analysis, making it
+ consistent with how `g77' actually generates code for these cases.
+
+ Previously, `g77' treated these expressions as denoting special
+ "pointer" arguments for the purposes of filewide analysis.
+
+ * The `g77' driver now ensures that `-lg2c' is specified in the link
+ phase prior to any occurrence of `-lm'. This prevents
+ accidentally linking to a routine in the SunOS4 `-lm' library when
+ the generated code wants to link to the one in `libf2c' (`libg2c').
+
+ * `g77' emits more debugging information when `-g' is used.
+
+ This new information allows, for example, `which __g77_length_a'
+ to be used in `gdb' to determine the type of the phantom length
+ argument supplied with `CHARACTER' variables.
+
+ This information pertains to internally-generated type, variable,
+ and other information, not to the longstanding deficiencies
+ vis-a-vis `COMMON' and `EQUIVALENCE'.
+
+ * The F90 `DATE_AND_TIME' intrinsic now is supported.
+
+ * The F90 `SYSTEM_CLOCK' intrinsic allows the optional arguments
+ (except for the `Count' argument) to be omitted.
+
+ * Upgrade to `libf2c' as of 1998-06-18.
+
+ * Improve documentation and indexing.
+
+In 0.5.23:
+==========
+
+ * This release contains several regressions against version 0.5.22
+ of `g77', due to using the "vanilla" `gcc' back end instead of
+ patching it to fix a few bugs and improve performance in a few
+ cases.
+
+ *Note Actual Bugs We Haven't Fixed Yet: Actual Bugs, available in
+ plain-text format in `gcc/f/BUGS', for information on the known
+ bugs in this version, including the regressions.
+
+ Features that have been dropped from this version of `g77' due to
+ their being implemented via `g77'-specific patches to the `gcc'
+ back end in previous releases include:
+
+ - Support for `__restrict__' keyword, the options
+ `-fargument-alias', `-fargument-noalias', and
+ `-fargument-noalias-global', and the corresponding
+ alias-analysis code.
+
+ (Version 1.0.1 of `egcs' has the alias-analysis code, but not
+ the `__restrict__' keyword. `egcs' `g77' users benefit from
+ the alias-analysis code despite the lack of the
+ `__restrict__' keyword, which is a C-language construct.)
+
+ - Support for the GNU compiler options `-fmove-all-movables',
+ `-freduce-all-givs', and `-frerun-loop-opt'.
+
+ (Version 1.0.1 of `egcs' supports these options. `g77' users
+ of `egcs' benefit from them even if they are not explicitly
+ specified, because the defaults are optimized for `g77'
+ users.)
+
+ - Support for the `-W' option warning about integer division by
+ zero.
+
+ - The Intel x86-specific option `-malign-double' applying to
+ stack-allocated data as well as statically-allocate data.
+
+ Note that the `gcc/f/gbe/' subdirectory has been removed from this
+ distribution as a result of `g77' no longer including patches for
+ the `gcc' back end.
+
+ * Fix bugs in the `libU77' intrinsic `HostNm' that wrote one byte
+ beyond the end of its `CHARACTER' argument, and in the `libU77'
+ intrinsics `GMTime' and `LTime' that overwrote their arguments.
+
+ * Support `gcc' version 2.8, and remove support for prior versions
+ of `gcc'.
+
+ * Remove support for the `--driver' option, as `g77' now does all
+ the driving, just like `gcc'.
+
+ * `CASE DEFAULT' no longer crashes `g77'.
+
+ * Valid combinations of `EXTERNAL', passing that external as a dummy
+ argument without explicitly giving it a type, and, in a subsequent
+ program unit, referencing that external as an external function
+ with a different type no longer crash `g77'.
+
+ * `g77' no longer installs the `f77' command and `f77.1' man page in
+ the `/usr' or `/usr/local' heirarchy, even if the `f77-install-ok'
+ file exists in the source or build directory. See the
+ installation documentation for more information.
+
+ * `g77' no longer installs the `libf2c.a' library and `f2c.h'
+ include file in the `/usr' or `/usr/local' heirarchy, even if the
+ `f2c-install-ok' or `f2c-exists-ok' files exist in the source or
+ build directory. See the installation documentation for more
+ information.
+
+ * The `libf2c.a' library produced by `g77' has been renamed to
+ `libg2c.a'. It is installed only in the `gcc' "private" directory
+ heirarchy, `gcc-lib'. This allows system administrators and users
+ to choose which version of the `libf2c' library from `netlib' they
+ wish to use on a case-by-case basis. See the installation
+ documentation for more information.
+
+ * The `f2c.h' include (header) file produced by `g77' has been
+ renamed to `g2c.h'. It is installed only in the `gcc' "private"
+ directory heirarchy, `gcc-lib'. This allows system administrators
+ and users to choose which version of the include file from
+ `netlib' they wish to use on a case-by-case basis. See the
+ installation documentation for more information.
+
+ * The `g77' command now expects the run-time library to be named
+ `libg2c.a' instead of `libf2c.a', to ensure that a version other
+ than the one built and installed as part of the same `g77' version
+ is picked up.
+
+ * The `-Wunused' option no longer issues a spurious warning about
+ the "master" procedure generated by `g77' for procedures
+ containing `ENTRY' statements.
+
+ * `g77''s version of `libf2c' separates out the setting of global
+ state (such as command-line arguments and signal handling) from
+ `main.o' into distinct, new library archive members.
+
+ This should make it easier to write portable applications that
+ have their own (non-Fortran) `main()' routine properly set up the
+ `libf2c' environment, even when `libf2c' (now `libg2c') is a
+ shared library.
+
+ * During the configuration and build process, `g77' creates
+ subdirectories it needs only as it needs them, thus avoiding
+ unnecessary creation of, for example, `stage1/f/runtime' when
+ doing a non-bootstrap build. Other cleaning up of the
+ configuration and build process has been performed as well.
+
+ * `install-info' now used to update the directory of Info
+ documentation to contain an entry for `g77' (during installation).
+
+ * Some diagnostics have been changed from warnings to errors, to
+ prevent inadvertent use of the resulting, probably buggy, programs.
+ These mostly include diagnostics about use of unsupported features
+ in the `OPEN', `INQUIRE', `READ', and `WRITE' statements, and
+ about truncations of various sorts of constants.
+
+ * Improve documentation and indexing.
+
+ * Upgrade to `libf2c' as of 1998-04-20.
+
+ This should fix a variety of problems, including those involving
+ some uses of the `T' format specifier, and perhaps some build
+ (porting) problems as well.
+
In 0.5.22:
==========
diff --git a/gcc/f/ansify.c b/gcc/f/ansify.c
index c73cc42c856..3af68e55483 100644
--- a/gcc/f/ansify.c
+++ b/gcc/f/ansify.c
@@ -1,6 +1,6 @@
/* ansify.c
Copyright (C) 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -22,12 +22,12 @@ 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 "assert.j" /* Use gcc's assert.h. */
-#include <stdio.h>
+#include "hconfig.j"
+#include "system.j"
+#include "assert.j"
+#if HAVE_STDDEF_H
#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
+#endif
typedef enum
{
diff --git a/gcc/f/assert.j b/gcc/f/assert.j
index fe95676ea53..5bf37928672 100644
--- a/gcc/f/assert.j
+++ b/gcc/f/assert.j
@@ -1,27 +1 @@
-/* assert.j -- Wrapper for GCC's assert.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_assert
-#define _J_f_assert
-#include "assert.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/bad.c b/gcc/f/bad.c
index 3db782f9259..a9b84d156ad 100644
--- a/gcc/f/bad.c
+++ b/gcc/f/bad.c
@@ -1,543 +1,6 @@
-/* bad.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Handles the displaying of diagnostic messages regarding the user's source
- files.
-
- Modifications:
-*/
-
-/* If there's a %E or %4 in the messages, set this to at least 5,
- for example. */
-
-#define FFEBAD_MAX_ 6
-
-/* Include files. */
-
-#include "proj.h"
-#include <ctype.h>
-#include "bad.h"
-#include "com.h"
-#include "where.h"
-
-/* Externals defined here. */
-
-bool ffebad_is_inhibited_ = FALSE;
-
-/* Simple definitions and enumerations. */
-
-#define FFEBAD_LONG_MSGS_ 1 /* 0 to use short (or same) messages. */
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-struct _ffebad_message_
- {
- ffebadSeverity severity;
- char *message;
- };
-
-/* Static objects accessed by functions in this module. */
-
-static struct _ffebad_message_ ffebad_messages_[]
-=
-{
-#define FFEBAD_MSGS1(KWD,SEV,MSG) { SEV, MSG },
-#if FFEBAD_LONG_MSGS_ == 0
-#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) { SEV, SMSG },
-#else
-#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) { SEV, LMSG },
-#endif
-#include "bad.def"
-#undef FFEBAD_MSGS1
-#undef FFEBAD_MSGS2
-};
-
-static struct
- {
- ffewhereLine line;
- ffewhereColumn col;
- ffebadIndex tag;
- }
-
-ffebad_here_[FFEBAD_MAX_];
-static char *ffebad_string_[FFEBAD_MAX_];
-static ffebadIndex ffebad_order_[FFEBAD_MAX_];
-static ffebad ffebad_errnum_;
-static ffebadSeverity ffebad_severity_;
-static char *ffebad_message_;
-static unsigned char ffebad_index_;
-static ffebadIndex ffebad_places_;
-static bool ffebad_is_temp_inhibited_; /* Effective setting of
- _is_inhibited_ for this
- _start/_finish invocation. */
-
-/* Static functions (internal). */
-
-static int ffebad_bufputs_ (char buf[], int bufi, char *s);
-
-/* Internal macros. */
-
-#define ffebad_bufflush_(buf, bufi) \
- (((buf)[bufi] = '\0'), fputs ((buf), stderr), 0)
-#define ffebad_bufputc_(buf, bufi, c) \
- (((bufi) == ARRAY_SIZE (buf)) \
- ? (ffebad_bufflush_ ((buf), (bufi)), ((buf)[0] = (c)), 1) \
- : (((buf)[bufi] = (c)), (bufi) + 1))
-
-
-static int
-ffebad_bufputs_ (char buf[], int bufi, char *s)
-{
- for (; *s != '\0'; ++s)
- bufi = ffebad_bufputc_ (buf, bufi, *s);
- return bufi;
-}
-
-/* ffebad_init_0 -- Initialize
-
- ffebad_init_0(); */
-
-void
-ffebad_init_0 ()
-{
- assert (FFEBAD == ARRAY_SIZE (ffebad_messages_));
-}
-
-ffebadSeverity
-ffebad_severity (ffebad errnum)
-{
- return ffebad_messages_[errnum].severity;
-}
-
-/* ffebad_start_ -- Start displaying an error message
-
- ffebad_start(FFEBAD_SOME_ERROR_CODE);
-
- Call ffebad_start to establish the message, ffebad_here and ffebad_string
- to send run-time data to it as necessary, then ffebad_finish when through
- to actually get it to print (to stderr).
-
- Note: ffebad_start(errnum) turns into ffebad_start_(FALSE,errnum). No
- outside caller should call ffebad_start_ directly (as indicated by the
- trailing underscore).
-
- Call ffebad_start to start a normal message, one that might be inhibited
- by the current state of statement guessing. Call ffebad_start_lex
- instead to start a message that is global to all statement guesses and
- happens only once for all guesses (i.e. the lexer).
-
- sev and message are overrides for the severity and messages when errnum
- is FFEBAD, meaning the caller didn't want to have to put a message in
- bad.def to produce a diagnostic. */
-
-bool
-ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
- char *message)
-{
- unsigned char i;
-
- if (ffebad_is_inhibited_ && !lex_override)
- {
- ffebad_is_temp_inhibited_ = TRUE;
- return FALSE;
- }
-
- if (errnum != FFEBAD)
- {
- ffebad_severity_ = ffebad_messages_[errnum].severity;
- ffebad_message_ = ffebad_messages_[errnum].message;
- }
- else
- {
- ffebad_severity_ = sev;
- ffebad_message_ = message;
- }
-
-#if FFECOM_targetCURRENT == FFECOM_targetGCC
- {
- extern int inhibit_warnings; /* From toplev.c. */
-
- switch (ffebad_severity_)
- { /* Tell toplev.c about this message. */
- case FFEBAD_severityINFORMATIONAL:
- case FFEBAD_severityTRIVIAL:
- if (inhibit_warnings)
- { /* User wants no warnings. */
- ffebad_is_temp_inhibited_ = TRUE;
- return FALSE;
- }
- /* Fall through. */
- case FFEBAD_severityWARNING:
- case FFEBAD_severityPECULIAR:
- case FFEBAD_severityPEDANTIC:
- if ((ffebad_severity_ != FFEBAD_severityPEDANTIC)
- || !flag_pedantic_errors)
- {
- if (count_error (1) == 0)
- { /* User wants no warnings. */
- ffebad_is_temp_inhibited_ = TRUE;
- return FALSE;
- }
- break;
- }
- /* Fall through (PEDANTIC && flag_pedantic_errors). */
- case FFEBAD_severityFATAL:
- case FFEBAD_severityWEIRD:
- case FFEBAD_severitySEVERE:
- case FFEBAD_severityDISASTER:
- count_error (0);
- break;
-
- default:
- break;
- }
- }
-#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
-
- ffebad_is_temp_inhibited_ = FALSE;
- ffebad_errnum_ = errnum;
- ffebad_index_ = 0;
- ffebad_places_ = 0;
- for (i = 0; i < FFEBAD_MAX_; ++i)
- {
- ffebad_string_[i] = NULL;
- ffebad_here_[i].line = ffewhere_line_unknown ();
- ffebad_here_[i].col = ffewhere_column_unknown ();
- }
-
- return TRUE;
-}
-
-/* ffebad_here -- Establish source location of some diagnostic concern
-
- ffebad_here(ffebadIndex i,ffewhereLine line,ffewhereColumn col);
-
- Call ffebad_start to establish the message, ffebad_here and ffebad_string
- to send run-time data to it as necessary, then ffebad_finish when through
- to actually get it to print (to stderr). */
-
-void
-ffebad_here (ffebadIndex index, ffewhereLine line, ffewhereColumn col)
-{
- ffewhereLineNumber line_num;
- ffewhereLineNumber ln;
- ffewhereColumnNumber col_num;
- ffewhereColumnNumber cn;
- ffebadIndex i;
- ffebadIndex j;
-
- if (ffebad_is_temp_inhibited_)
- return;
-
- assert (index < FFEBAD_MAX_);
- ffebad_here_[index].line = ffewhere_line_use (line);
- ffebad_here_[index].col = ffewhere_column_use (col);
- if (ffewhere_line_is_unknown (line)
- || ffewhere_column_is_unknown (col))
- {
- ffebad_here_[index].tag = FFEBAD_MAX_;
- return;
- }
- ffebad_here_[index].tag = 0; /* For now, though it shouldn't matter. */
-
- /* Sort the source line/col points into the order they occur in the source
- file. Deal with duplicates appropriately. */
-
- line_num = ffewhere_line_number (line);
- col_num = ffewhere_column_number (col);
-
- /* Determine where in the ffebad_order_ array this new place should go. */
-
- for (i = 0; i < ffebad_places_; ++i)
- {
- ln = ffewhere_line_number (ffebad_here_[ffebad_order_[i]].line);
- cn = ffewhere_column_number (ffebad_here_[ffebad_order_[i]].col);
- if (line_num < ln)
- break;
- if (line_num == ln)
- {
- if (col_num == cn)
- {
- ffebad_here_[index].tag = i;
- return; /* Shouldn't go in, has equivalent. */
- }
- else if (col_num < cn)
- break;
- }
- }
-
- /* Before putting new place in ffebad_order_[i], first increment all tags
- that are i or greater. */
-
- if (i != ffebad_places_)
- {
- for (j = 0; j < FFEBAD_MAX_; ++j)
- {
- if (ffebad_here_[j].tag >= i)
- ++ffebad_here_[j].tag;
- }
- }
-
- /* Then slide all ffebad_order_[] entries at and above i up one entry. */
-
- for (j = ffebad_places_; j > i; --j)
- ffebad_order_[j] = ffebad_order_[j - 1];
-
- /* Finally can put new info in ffebad_order_[i]. */
-
- ffebad_order_[i] = index;
- ffebad_here_[index].tag = i;
- ++ffebad_places_;
-}
-
-/* Establish string for next index (always in order) of message
-
- ffebad_string(char *string);
-
- Call ffebad_start to establish the message, ffebad_here and ffebad_string
- to send run-time data to it as necessary, then ffebad_finish when through
- to actually get it to print (to stderr). Note: don't trash the string
- until after calling ffebad_finish, since we just maintain a pointer to
- the argument passed in until then. */
-
-void
-ffebad_string (char *string)
-{
- if (ffebad_is_temp_inhibited_)
- return;
-
- assert (ffebad_index_ != FFEBAD_MAX_);
- ffebad_string_[ffebad_index_++] = string;
-}
-
-/* ffebad_finish -- Display error message with where & run-time info
-
- ffebad_finish();
-
- Call ffebad_start to establish the message, ffebad_here and ffebad_string
- to send run-time data to it as necessary, then ffebad_finish when through
- to actually get it to print (to stderr). */
-
-void
-ffebad_finish ()
-{
-#define MAX_SPACES 132
- static char *spaces
- = "...>\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
-\040\040\040"; /* MAX_SPACES - 1 spaces. */
- ffewhereLineNumber last_line_num;
- ffewhereLineNumber ln;
- ffewhereLineNumber rn;
- ffewhereColumnNumber last_col_num;
- ffewhereColumnNumber cn;
- ffewhereColumnNumber cnt;
- ffewhereLine l;
- ffebadIndex bi;
- unsigned short i;
- char pointer;
- char c;
- char *s;
- char *fn;
- static char buf[1024];
- int bufi;
- int index;
-
- if (ffebad_is_temp_inhibited_)
- return;
-
- switch (ffebad_severity_)
- {
- case FFEBAD_severityINFORMATIONAL:
- s = "note:";
- break;
-
- case FFEBAD_severityWARNING:
- s = "warning:";
- break;
-
- case FFEBAD_severitySEVERE:
- s = "fatal:";
- break;
-
- default:
- s = "";
- break;
- }
-
- /* Display the annoying source references. */
-
- last_line_num = 0;
- last_col_num = 0;
-
- for (bi = 0; bi < ffebad_places_; ++bi)
- {
- if (ffebad_places_ == 1)
- pointer = '^';
- else
- pointer = '1' + bi;
-
- l = ffebad_here_[ffebad_order_[bi]].line;
- ln = ffewhere_line_number (l);
- rn = ffewhere_line_filelinenum (l);
- cn = ffewhere_column_number (ffebad_here_[ffebad_order_[bi]].col);
- fn = ffewhere_line_filename (l);
- if (ln != last_line_num)
- {
- if (bi != 0)
- fputc ('\n', stderr);
-#if FFECOM_targetCURRENT == FFECOM_targetGCC
- report_error_function (fn);
-#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
- fprintf (stderr,
-#if 0
- "Line %" ffewhereLineNumber_f "u of %s:\n %s\n %s%c",
- rn, fn,
-#else
- /* the trailing space on the <file>:<line>: line
- fools emacs19 compilation mode into finding the
- report */
- "%s:%" ffewhereLineNumber_f "u: %s\n %s\n %s%c",
- fn, rn,
-#endif
- s,
- ffewhere_line_content (l),
- &spaces[cn > MAX_SPACES ? 0 : MAX_SPACES - cn + 4],
- pointer);
- last_line_num = ln;
- last_col_num = cn;
- s = "(continued):";
- }
- else
- {
- cnt = cn - last_col_num;
- fprintf (stderr,
- "%s%c", &spaces[cnt > MAX_SPACES
- ? 0 : MAX_SPACES - cnt + 4],
- pointer);
- last_col_num = cn;
- }
- }
- if (ffebad_places_ == 0)
- {
- /* Didn't output "warning:" string, capitalize it for message. */
- if ((s[0] != '\0') && isalpha (s[0]) && islower (s[0]))
- {
- char c;
-
- c = toupper (s[0]);
- fprintf (stderr, "%c%s ", c, &s[1]);
- }
- else if (s[0] != '\0')
- fprintf (stderr, "%s ", s);
- }
- else
- fputc ('\n', stderr);
-
- /* Release the ffewhere info. */
-
- for (bi = 0; bi < FFEBAD_MAX_; ++bi)
- {
- ffewhere_line_kill (ffebad_here_[bi].line);
- ffewhere_column_kill (ffebad_here_[bi].col);
- }
-
- /* Now display the message. */
-
- bufi = 0;
- for (i = 0; (c = ffebad_message_[i]) != '\0'; ++i)
- {
- if (c == '%')
- {
- c = ffebad_message_[++i];
- if (isalpha (c) && isupper (c))
- {
- index = c - 'A';
-
- if ((index < 0) || (index >= FFEBAD_MAX_))
- {
- bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!] %");
- bufi = ffebad_bufputc_ (buf, bufi, c);
- }
- else
- {
- s = ffebad_string_[index];
- if (s == NULL)
- bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!]");
- else
- bufi = ffebad_bufputs_ (buf, bufi, s);
- }
- }
- else if (isdigit (c))
- {
- index = c - '0';
-
- if ((index < 0) || (index >= FFEBAD_MAX_))
- {
- bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!] %");
- bufi = ffebad_bufputc_ (buf, bufi, c);
- }
- else
- {
- pointer = ffebad_here_[index].tag + '1';
- if (pointer == FFEBAD_MAX_ + '1')
- pointer = '?';
- else if (ffebad_places_ == 1)
- pointer = '^';
- bufi = ffebad_bufputc_ (buf, bufi, '(');
- bufi = ffebad_bufputc_ (buf, bufi, pointer);
- bufi = ffebad_bufputc_ (buf, bufi, ')');
- }
- }
- else if (c == '\0')
- break;
- else if (c == '%')
- bufi = ffebad_bufputc_ (buf, bufi, '%');
- else
- {
- bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!]");
- bufi = ffebad_bufputc_ (buf, bufi, '%');
- bufi = ffebad_bufputc_ (buf, bufi, c);
- }
- }
- else
- bufi = ffebad_bufputc_ (buf, bufi, c);
- }
- bufi = ffebad_bufputc_ (buf, bufi, '\n');
- bufi = ffebad_bufflush_ (buf, bufi);
-}
+ Contributed by James Craig Burley (burley@gnu.org).
+#include "flags.j"
+#include "toplev.j"
+ if ((s[0] != '\0') && ISALPHA (s[0]) && ISLOWER (s[0]))
+ if (ISALPHA (c) && ISUPPER (c))
+ else if (ISDIGIT (c))
diff --git a/gcc/f/bad.def b/gcc/f/bad.def
index 9a3cf5a323d..3a86a1f1ffc 100644
--- a/gcc/f/bad.def
+++ b/gcc/f/bad.def
@@ -1,6 +1,6 @@
/* bad.def -- Public #include File (module.h template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -551,16 +551,16 @@ FFEBAD_MSGS1 (FFEBAD_FORMAT_UNSUPPORTED, FATAL,
"Unsupported FORMAT specifier at %0")
FFEBAD_MSGS1 (FFEBAD_FORMAT_VARIABLE, FATAL,
"Variable-expression FORMAT specifier at %0 -- unsupported")
-FFEBAD_MSGS2 (FFEBAD_OPEN_UNSUPPORTED, WARN,
+FFEBAD_MSGS2 (FFEBAD_OPEN_UNSUPPORTED, FATAL,
"Unsupported OPEN control item at %0 -- ACTION=, ASSOCIATEVARIABLE=, BLOCKSIZE=, BUFFERCOUNT=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, DISPOSE=, EXTENDSIZE=, INITIALSIZE=, KEY=, MAXREC=, NOSPANBLOCKS, ORGANIZATION=, PAD=, POSITION=, READONLY=, RECORDTYPE=, SHARED=, and USEROPEN= are not supported",
"Unsupported OPEN control item at %0")
-FFEBAD_MSGS2 (FFEBAD_INQUIRE_UNSUPPORTED, WARN,
+FFEBAD_MSGS2 (FFEBAD_INQUIRE_UNSUPPORTED, FATAL,
"Unsupported INQUIRE control item at %0 -- ACTION=, CARRIAGECONTROL=, DEFAULTFILE=, DELIM=, KEYED=, ORGANIZATION=, PAD=, POSITION=, READ=, READWRITE=, RECORDTYPE=, and WRITE= are not supported",
"Unsupported INQUIRE control item at %0")
-FFEBAD_MSGS2 (FFEBAD_READ_UNSUPPORTED, WARN,
+FFEBAD_MSGS2 (FFEBAD_READ_UNSUPPORTED, FATAL,
"Unsupported READ control item at %0 -- ADVANCE=, EOR=, KEYEQ=, KEYGE=, KEYGT=, KEYID=, NULLS=, and SIZE= are not supported",
"Unsupported READ control item at %0")
-FFEBAD_MSGS2 (FFEBAD_WRITE_UNSUPPORTED, WARN,
+FFEBAD_MSGS2 (FFEBAD_WRITE_UNSUPPORTED, FATAL,
"Unsupported WRITE control item at %0 -- ADVANCE= and EOR= are not supported",
"Unsupported WRITE control item at %0")
FFEBAD_MSGS1 (FFEBAD_VXT_UNSUPPORTED, FATAL,
@@ -656,23 +656,23 @@ FFEBAD_MSGS1 (FFEBAD_NESTED_PERCENT, WARN,
FFEBAD_MSGS2 (FFEBAD_ACTUALARG, WARN,
"Invalid actual argument at %0 -- replace hollerith constants with %%REF('string') and typeless constants with INTEGER constant equivalents, or use -fugly-args or -fugly",
"Invalid actual argument at %0")
-FFEBAD_MSGS2 (FFEBAD_QUAD_UNSUPPORTED, WARN,
+FFEBAD_MSGS2 (FFEBAD_QUAD_UNSUPPORTED, FATAL,
"Quadruple-precision floating-point unsupported -- treating constant at %0 as double-precision",
"Quadruple-precision floating-point unsupported")
FFEBAD_MSGS2 (FFEBAD_TOO_BIG_INIT, WARN,
"Initialization of large (%B-unit) aggregate area `%A' at %0 currently very slow and takes lots of memory during g77 compile -- to be improved in 0.6",
"This could take a while (initializing `%A' at %0)...")
-FFEBAD_MSGS1 (FFEBAD_BLOCKDATA_STMT, WARN,
+FFEBAD_MSGS1 (FFEBAD_BLOCKDATA_STMT, FATAL,
"Statement at %0 invalid in BLOCK DATA program unit at %1")
-FFEBAD_MSGS1 (FFEBAD_TRUNCATING_CHARACTER, WARN,
+FFEBAD_MSGS1 (FFEBAD_TRUNCATING_CHARACTER, FATAL,
"Truncating characters on right side of character constant at %0")
-FFEBAD_MSGS1 (FFEBAD_TRUNCATING_HOLLERITH, WARN,
+FFEBAD_MSGS1 (FFEBAD_TRUNCATING_HOLLERITH, FATAL,
"Truncating characters on right side of hollerith constant at %0")
-FFEBAD_MSGS1 (FFEBAD_TRUNCATING_NUMERIC, WARN,
+FFEBAD_MSGS1 (FFEBAD_TRUNCATING_NUMERIC, FATAL,
"Truncating non-zero data on left side of numeric constant at %0")
-FFEBAD_MSGS1 (FFEBAD_TRUNCATING_TYPELESS, WARN,
+FFEBAD_MSGS1 (FFEBAD_TRUNCATING_TYPELESS, FATAL,
"Truncating non-zero data on left side of typeless constant at %0")
-FFEBAD_MSGS1 (FFEBAD_TYPELESS_OVERFLOW, WARN,
+FFEBAD_MSGS1 (FFEBAD_TYPELESS_OVERFLOW, FATAL,
"Typeless constant at %0 too large")
FFEBAD_MSGS1 (FFEBAD_AMPERSAND, WARN,
"First-column ampersand continuation at %0")
@@ -698,6 +698,8 @@ FFEBAD_MSGS1 (FFEBAD_FILEWIDE_ARG_W, WARN,
"Argument #%B of `%A' is %C at %0 but is %D at %1 [info -f g77 M GLOBALS]")
FFEBAD_MSGS1 (FFEBAD_ARRAY_LARGE, FATAL,
"Array `%A' at %0 is too large to handle")
+FFEBAD_MSGS1 (FFEBAD_SFUNC_UNUSED, WARN,
+"Statement function `%A' defined at %0 is not used")
#undef INFORM
#undef TRIVIAL
diff --git a/gcc/f/bad.h b/gcc/f/bad.h
index cdbf32c007c..5bf37928672 100644
--- a/gcc/f/bad.h
+++ b/gcc/f/bad.h
@@ -1,108 +1 @@
-/* bad.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- bad.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_bad
-#define _H_f_bad
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
-#define FFEBAD_MSGS1(KWD,SEV,MSG) KWD,
-#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) KWD,
-#include "bad.def"
-#undef FFEBAD_MSGS1
-#undef FFEBAD_MSGS2
- FFEBAD
- } ffebad;
-
-typedef enum
- {
-
- /* Order important; must be increasing severity. */
-
- FFEBAD_severityINFORMATIONAL, /* User notice. */
- FFEBAD_severityTRIVIAL, /* Internal notice. */
- FFEBAD_severityWARNING, /* User warning. */
- FFEBAD_severityPECULIAR, /* Internal warning. */
- FFEBAD_severityPEDANTIC, /* Pedantic, could be warning or error. */
- FFEBAD_severityFATAL, /* User error. */
- FFEBAD_severityWEIRD, /* Internal error. */
- FFEBAD_severitySEVERE, /* User error, cannot continue. */
- FFEBAD_severityDISASTER, /* Internal error, cannot continue. */
- FFEBAD_severity
- } ffebadSeverity;
-
-/* Typedefs. */
-
-typedef unsigned char ffebadIndex;
-
-/* Include files needed by this one. */
-
-#include "where.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-extern bool ffebad_is_inhibited_;
-
-/* Declare functions with prototypes. */
-
-void ffebad_finish (void);
-void ffebad_here (ffebadIndex i, ffewhereLine wl, ffewhereColumn wc);
-void ffebad_init_0 (void);
-bool ffebad_is_fatal (ffebad errnum);
-ffebadSeverity ffebad_severity (ffebad errnum);
-bool ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
- char *message);
-void ffebad_string (char *string);
-
-/* Define macros. */
-
-#define ffebad_inhibit() (ffebad_is_inhibited_)
-#define ffebad_init_1()
-#define ffebad_init_2()
-#define ffebad_init_3()
-#define ffebad_init_4()
-#define ffebad_set_inhibit(f) (ffebad_is_inhibited_ = (f))
-#define ffebad_start(e) ffebad_start_ (FALSE, (e), FFEBAD_severity, NULL)
-#define ffebad_start_lex(e) ffebad_start_ (TRUE, (e), FFEBAD_severity, NULL)
-#define ffebad_start_msg(m,s) ffebad_start_ (FALSE, FFEBAD, (s), (m))
-#define ffebad_start_msg_lex(m,s) ffebad_start_ (TRUE, FFEBAD, (s), (m))
-#define ffebad_terminate_0()
-#define ffebad_terminate_1()
-#define ffebad_terminate_2()
-#define ffebad_terminate_3()
-#define ffebad_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/bit.c b/gcc/f/bit.c
index 864d601665b..5bf37928672 100644
--- a/gcc/f/bit.c
+++ b/gcc/f/bit.c
@@ -1,201 +1 @@
-/* bit.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Tracks arrays of booleans in useful ways.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "glimits.j"
-#include "bit.h"
-#include "malloc.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffebit_count -- Count # of bits set a particular way
-
- ffebit b; // the ffebit object
- ffebitCount offset; // 0..size-1
- bool value; // FALSE (0), TRUE (1)
- ffebitCount range; // # bits to test
- ffebitCount number; // # bits equal to value
- ffebit_count(b,offset,value,range,&number);
-
- Sets <number> to # bits at <offset> through <offset + range - 1> set to
- <value>. If <range> is 0, <number> is set to 0. */
-
-void
-ffebit_count (ffebit b, ffebitCount offset, bool value, ffebitCount range,
- ffebitCount *number)
-{
- ffebitCount element;
- ffebitCount bitno;
-
- assert (offset + range <= b->size);
-
- for (*number = 0; range != 0; --range, ++offset)
- {
- element = offset / CHAR_BIT;
- bitno = offset % CHAR_BIT;
- if (value
- == ((b->bits[element] & ((unsigned char) 1 << bitno)) == 0 ? FALSE : TRUE))
- ++ * number;
- }
-}
-
-/* ffebit_new -- Create a new ffebit object
-
- ffebit b;
- ffebit_kill(b);
-
- Destroys an ffebit object obtained via ffebit_new. */
-
-void
-ffebit_kill (ffebit b)
-{
- malloc_kill_ks (b->pool, b,
- offsetof (struct _ffebit_, bits)
- + (b->size + CHAR_BIT - 1) / CHAR_BIT);
-}
-
-/* ffebit_new -- Create a new ffebit object
-
- ffebit b;
- mallocPool pool;
- ffebitCount size;
- b = ffebit_new(pool,size);
-
- Allocates an ffebit object that holds the values of <size> bits in pool
- <pool>. */
-
-ffebit
-ffebit_new (mallocPool pool, ffebitCount size)
-{
- ffebit b;
-
- b = malloc_new_zks (pool, "ffebit",
- offsetof (struct _ffebit_, bits)
- + (size + CHAR_BIT - 1) / CHAR_BIT,
- 0);
- b->pool = pool;
- b->size = size;
-
- return b;
-}
-
-/* ffebit_set -- Set value of # of bits
-
- ffebit b; // the ffebit object
- ffebitCount offset; // 0..size-1
- bool value; // FALSE (0), TRUE (1)
- ffebitCount length; // # bits to set starting at offset (usually 1)
- ffebit_set(b,offset,value,length);
-
- Sets bit #s <offset> through <offset + length - 1> to <value>. */
-
-void
-ffebit_set (ffebit b, ffebitCount offset, bool value, ffebitCount length)
-{
- ffebitCount i;
- ffebitCount element;
- ffebitCount bitno;
-
- assert (offset + length <= b->size);
-
- for (i = 0; i < length; ++i, ++offset)
- {
- element = offset / CHAR_BIT;
- bitno = offset % CHAR_BIT;
- b->bits[element] = (((unsigned char) (value ? 1 : 0)) << bitno)
- | (b->bits[element] & ~((unsigned char) 1 << bitno));
- }
-}
-
-/* ffebit_test -- Test value of # of bits
-
- ffebit b; // the ffebit object
- ffebitCount offset; // 0..size-1
- bool value; // FALSE (0), TRUE (1)
- ffebitCount length; // # bits with same value
- ffebit_test(b,offset,&value,&length);
-
- Returns value of bits at <offset> through <offset + length - 1> in
- <value>. If <offset> is already at the end of the bit array (if
- offset == ffebit_size(b)), <length> is set to 0 and <value> is
- undefined. */
-
-void
-ffebit_test (ffebit b, ffebitCount offset, bool *value, ffebitCount *length)
-{
- ffebitCount i;
- ffebitCount element;
- ffebitCount bitno;
-
- if (offset >= b->size)
- {
- assert (offset == b->size);
- *length = 0;
- return;
- }
-
- element = offset / CHAR_BIT;
- bitno = offset % CHAR_BIT;
- *value = (b->bits[element] & ((unsigned char) 1 << bitno)) == 0 ? FALSE : TRUE;
- *length = 1;
-
- for (i = b->size - offset - 1, ++offset; i != 0; --i, ++offset, ++*length)
- {
- element = offset / CHAR_BIT;
- bitno = offset % CHAR_BIT;
- if (*value
- != ((b->bits[element] & ((unsigned char) 1 << bitno)) == 0 ? FALSE : TRUE))
- break;
- }
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/bit.h b/gcc/f/bit.h
index cb7357fa1bb..5bf37928672 100644
--- a/gcc/f/bit.h
+++ b/gcc/f/bit.h
@@ -1,84 +1 @@
-/* bit.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- bit.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_bit
-#define _H_f_bit
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-typedef struct _ffebit_ *ffebit;
-typedef unsigned long ffebitCount;
-#define ffebitCount_f "l"
-
-/* Include files needed by this one. */
-
-#include "malloc.h"
-
-/* Structure definitions. */
-
-struct _ffebit_
- {
- mallocPool pool;
- ffebitCount size;
- unsigned char bits[1];
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffebit_count (ffebit b, ffebitCount offset, bool value, ffebitCount range,
- ffebitCount *number);
-void ffebit_kill (ffebit b);
-ffebit ffebit_new (mallocPool pool, ffebitCount size);
-void ffebit_set (ffebit b, ffebitCount offset, bool value, ffebitCount length);
-void ffebit_test (ffebit b, ffebitCount offset, bool *value, ffebitCount *length);
-
-/* Define macros. */
-
-#define ffebit_init_0()
-#define ffebit_init_1()
-#define ffebit_init_2()
-#define ffebit_init_3()
-#define ffebit_init_4()
-#define ffebit_pool(b) ((b)->pool)
-#define ffebit_size(b) ((b)->size)
-#define ffebit_terminate_0()
-#define ffebit_terminate_1()
-#define ffebit_terminate_2()
-#define ffebit_terminate_3()
-#define ffebit_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/bld-op.def b/gcc/f/bld-op.def
index adaec06673c..5bf37928672 100644
--- a/gcc/f/bld-op.def
+++ b/gcc/f/bld-op.def
@@ -1,69 +1 @@
-/* bld-op.def -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- bad.c
-
- Modifications:
-*/
-
-FFEBLD_OP (FFEBLD_opANY, "ANY", 0)
-FFEBLD_OP (FFEBLD_opSTAR, "STAR", 0) /* For adjustable arrays, alternate return dummies, etc. */
-FFEBLD_OP (FFEBLD_opCONTER, "CONTER", 0)
-FFEBLD_OP (FFEBLD_opARRTER, "ARRTER", 0) /* Array of constants (DATA...). */
-FFEBLD_OP (FFEBLD_opACCTER, "ACCTER", 0) /* Accreting ARRTER. */
-FFEBLD_OP (FFEBLD_opSYMTER, "SYMTER", 0)
-FFEBLD_OP (FFEBLD_opITEM, "ITEM", 0)
-FFEBLD_OP (FFEBLD_opUPLUS, "UPLUS", 1)
-FFEBLD_OP (FFEBLD_opUMINUS, "UMINUS", 1)
-FFEBLD_OP (FFEBLD_opADD, "ADD", 2)
-FFEBLD_OP (FFEBLD_opSUBTRACT, "SUBTRACT", 2)
-FFEBLD_OP (FFEBLD_opMULTIPLY, "MULTIPLY", 2)
-FFEBLD_OP (FFEBLD_opDIVIDE, "DIVIDE", 2)
-FFEBLD_OP (FFEBLD_opPOWER, "POWER", 2)
-FFEBLD_OP (FFEBLD_opCONCATENATE, "CONCATENATE", 2)
-FFEBLD_OP (FFEBLD_opNOT, "NOT", 1)
-FFEBLD_OP (FFEBLD_opLT, "LT", 2)
-FFEBLD_OP (FFEBLD_opLE, "LE", 2)
-FFEBLD_OP (FFEBLD_opEQ, "EQ", 2)
-FFEBLD_OP (FFEBLD_opNE, "NE", 2)
-FFEBLD_OP (FFEBLD_opGT, "GT", 2)
-FFEBLD_OP (FFEBLD_opGE, "GE", 2)
-FFEBLD_OP (FFEBLD_opAND, "AND", 2)
-FFEBLD_OP (FFEBLD_opOR, "OR", 2)
-FFEBLD_OP (FFEBLD_opXOR, "XOR", 2)
-FFEBLD_OP (FFEBLD_opEQV, "EQV", 2)
-FFEBLD_OP (FFEBLD_opNEQV, "NEQV", 2)
-FFEBLD_OP (FFEBLD_opPAREN, "PAREN", 1)
-FFEBLD_OP (FFEBLD_opPERCENT_LOC, "%LOC", 1)
-FFEBLD_OP (FFEBLD_opPERCENT_VAL, "%VAL", 1)
-FFEBLD_OP (FFEBLD_opPERCENT_REF, "%REF", 1)
-FFEBLD_OP (FFEBLD_opPERCENT_DESCR, "%DESCR", 1)
-FFEBLD_OP (FFEBLD_opCONVERT, "CONVERT", 1)
-FFEBLD_OP (FFEBLD_opREPEAT, "REPEAT", 2)
-FFEBLD_OP (FFEBLD_opBOUNDS, "BOUNDS", 2) /* For low:high in dimension lists. */
-FFEBLD_OP (FFEBLD_opFUNCREF, "FUNCREF", 2)
-FFEBLD_OP (FFEBLD_opSUBRREF, "SUBRREF", 2)
-FFEBLD_OP (FFEBLD_opARRAYREF, "ARRAYREF", 2)
-FFEBLD_OP (FFEBLD_opSUBSTR, "SUBSTR", 2)
-FFEBLD_OP (FFEBLD_opLABTER, "LABTER", 0)
-FFEBLD_OP (FFEBLD_opLABTOK, "LABTOK", 0) /* Like LABTER but contains ffelexToken instead. */
-FFEBLD_OP (FFEBLD_opIMPDO, "IMPDO", 2)
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/bld.c b/gcc/f/bld.c
index 3a95727adc1..c27e525eb66 100644
--- a/gcc/f/bld.c
+++ b/gcc/f/bld.c
@@ -1,5782 +1,14 @@
-/* bld.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- The primary "output" of the FFE includes ffebld objects, which
- connect expressions, operators, and operands together, along with
- connecting lists of expressions together for argument or dimension
- lists.
-
- Modifications:
- 30-Aug-92 JCB 1.1
- Change names of some things for consistency.
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include <ctype.h>
-#include "bld.h"
-#include "bit.h"
-#include "info.h"
-#include "lex.h"
-#include "malloc.h"
-#include "target.h"
-#include "where.h"
-
-/* Externals defined here. */
-
-ffebldArity ffebld_arity_op_[]
-=
-{
-#define FFEBLD_OP(KWD,NAME,ARITY) ARITY,
-#include "bld-op.def"
-#undef FFEBLD_OP
-};
-struct _ffebld_pool_stack_ ffebld_pool_stack_;
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-#if FFEBLD_BLANK_
-static struct _ffebld_ ffebld_blank_
-=
-{
- 0,
- {FFEINFO_basictypeNONE, FFEINFO_kindtypeNONE, 0, FFEINFO_kindNONE,
- FFEINFO_whereNONE, FFETARGET_charactersizeNONE},
- {NULL, NULL}
-};
+ Contributed by James Craig Burley (burley@gnu.org).
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-#if FFETARGET_okCHARACTER1
-static ffebldConstant ffebld_constant_character1_;
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-#if FFETARGET_okCHARACTER2
-static ffebldConstant ffebld_constant_character2_;
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-#if FFETARGET_okCHARACTER3
-static ffebldConstant ffebld_constant_character3_;
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-#if FFETARGET_okCHARACTER4
-static ffebldConstant ffebld_constant_character4_;
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-#if FFETARGET_okCHARACTER5
-static ffebldConstant ffebld_constant_character5_;
-#endif
-#if FFETARGET_okCHARACTER6
-static ffebldConstant ffebld_constant_character6_;
-#endif
-#if FFETARGET_okCHARACTER7
-static ffebldConstant ffebld_constant_character7_;
-#endif
-#if FFETARGET_okCHARACTER8
-static ffebldConstant ffebld_constant_character8_;
-#endif
-#if FFETARGET_okCOMPLEX1
-static ffebldConstant ffebld_constant_complex1_;
-#endif
-#if FFETARGET_okCOMPLEX2
-static ffebldConstant ffebld_constant_complex2_;
-#endif
-#if FFETARGET_okCOMPLEX3
-static ffebldConstant ffebld_constant_complex3_;
-#endif
-#if FFETARGET_okCOMPLEX4
-static ffebldConstant ffebld_constant_complex4_;
-#endif
-#if FFETARGET_okCOMPLEX5
-static ffebldConstant ffebld_constant_complex5_;
-#endif
-#if FFETARGET_okCOMPLEX6
-static ffebldConstant ffebld_constant_complex6_;
-#endif
-#if FFETARGET_okCOMPLEX7
-static ffebldConstant ffebld_constant_complex7_;
-#endif
-#if FFETARGET_okCOMPLEX8
-static ffebldConstant ffebld_constant_complex8_;
-#endif
-#if FFETARGET_okINTEGER1
-static ffebldConstant ffebld_constant_integer1_;
-#endif
-#if FFETARGET_okINTEGER2
-static ffebldConstant ffebld_constant_integer2_;
-#endif
-#if FFETARGET_okINTEGER3
-static ffebldConstant ffebld_constant_integer3_;
-#endif
-#if FFETARGET_okINTEGER4
-static ffebldConstant ffebld_constant_integer4_;
-#endif
-#if FFETARGET_okINTEGER5
-static ffebldConstant ffebld_constant_integer5_;
-#endif
-#if FFETARGET_okINTEGER6
-static ffebldConstant ffebld_constant_integer6_;
-#endif
-#if FFETARGET_okINTEGER7
-static ffebldConstant ffebld_constant_integer7_;
-#endif
-#if FFETARGET_okINTEGER8
-static ffebldConstant ffebld_constant_integer8_;
-#endif
-#if FFETARGET_okLOGICAL1
-static ffebldConstant ffebld_constant_logical1_;
-#endif
-#if FFETARGET_okLOGICAL2
-static ffebldConstant ffebld_constant_logical2_;
-#endif
-#if FFETARGET_okLOGICAL3
-static ffebldConstant ffebld_constant_logical3_;
-#endif
-#if FFETARGET_okLOGICAL4
-static ffebldConstant ffebld_constant_logical4_;
-#endif
-#if FFETARGET_okLOGICAL5
-static ffebldConstant ffebld_constant_logical5_;
-#endif
-#if FFETARGET_okLOGICAL6
-static ffebldConstant ffebld_constant_logical6_;
-#endif
-#if FFETARGET_okLOGICAL7
-static ffebldConstant ffebld_constant_logical7_;
-#endif
-#if FFETARGET_okLOGICAL8
-static ffebldConstant ffebld_constant_logical8_;
-#endif
-#if FFETARGET_okREAL1
-static ffebldConstant ffebld_constant_real1_;
-#endif
-#if FFETARGET_okREAL2
-static ffebldConstant ffebld_constant_real2_;
-#endif
-#if FFETARGET_okREAL3
-static ffebldConstant ffebld_constant_real3_;
-#endif
-#if FFETARGET_okREAL4
-static ffebldConstant ffebld_constant_real4_;
-#endif
-#if FFETARGET_okREAL5
-static ffebldConstant ffebld_constant_real5_;
-#endif
-#if FFETARGET_okREAL6
-static ffebldConstant ffebld_constant_real6_;
-#endif
-#if FFETARGET_okREAL7
-static ffebldConstant ffebld_constant_real7_;
-#endif
-#if FFETARGET_okREAL8
-static ffebldConstant ffebld_constant_real8_;
-#endif
-static ffebldConstant ffebld_constant_hollerith_;
-static ffebldConstant ffebld_constant_typeless_[FFEBLD_constTYPELESS_LAST
- - FFEBLD_constTYPELESS_FIRST + 1];
-
-static char *ffebld_op_string_[]
-=
-{
-#define FFEBLD_OP(KWD,NAME,ARITY) NAME,
-#include "bld-op.def"
-#undef FFEBLD_OP
-};
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-#define integerdefault_ CATX(integer,FFETARGET_ktINTEGERDEFAULT)
-#define logicaldefault_ CATX(logical,FFETARGET_ktLOGICALDEFAULT)
-#define realdefault_ CATX(real,FFETARGET_ktREALDEFAULT)
-#define realdouble_ CATX(real,FFETARGET_ktREALDOUBLE)
-#define realquad_ CATX(real,FFETARGET_ktREALQUAD)
-
-/* ffebld_constant_cmp -- Compare two constants a la strcmp
-
- ffebldConstant c1, c2;
- if (ffebld_constant_cmp(c1,c2) == 0)
- // they're equal, else they're not.
-
- Returns -1 if c1 < c2, 0 if c1 == c2, +1 if c1 == c2. */
-
-int
-ffebld_constant_cmp (ffebldConstant c1, ffebldConstant c2)
-{
- if (c1 == c2)
- return 0;
-
- assert (ffebld_constant_type (c1) == ffebld_constant_type (c2));
-
- switch (ffebld_constant_type (c1))
- {
-#if FFETARGET_okINTEGER1
- case FFEBLD_constINTEGER1:
- return ffetarget_cmp_integer1 (ffebld_constant_integer1 (c1),
- ffebld_constant_integer1 (c2));
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEBLD_constINTEGER2:
- return ffetarget_cmp_integer2 (ffebld_constant_integer2 (c1),
- ffebld_constant_integer2 (c2));
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEBLD_constINTEGER3:
- return ffetarget_cmp_integer3 (ffebld_constant_integer3 (c1),
- ffebld_constant_integer3 (c2));
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEBLD_constINTEGER4:
- return ffetarget_cmp_integer4 (ffebld_constant_integer4 (c1),
- ffebld_constant_integer4 (c2));
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEBLD_constINTEGER5:
- return ffetarget_cmp_integer5 (ffebld_constant_integer5 (c1),
- ffebld_constant_integer5 (c2));
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEBLD_constINTEGER6:
- return ffetarget_cmp_integer6 (ffebld_constant_integer6 (c1),
- ffebld_constant_integer6 (c2));
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEBLD_constINTEGER7:
- return ffetarget_cmp_integer7 (ffebld_constant_integer7 (c1),
- ffebld_constant_integer7 (c2));
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEBLD_constINTEGER8:
- return ffetarget_cmp_integer8 (ffebld_constant_integer8 (c1),
- ffebld_constant_integer8 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL1
- case FFEBLD_constLOGICAL1:
- return ffetarget_cmp_logical1 (ffebld_constant_logical1 (c1),
- ffebld_constant_logical1 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEBLD_constLOGICAL2:
- return ffetarget_cmp_logical2 (ffebld_constant_logical2 (c1),
- ffebld_constant_logical2 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEBLD_constLOGICAL3:
- return ffetarget_cmp_logical3 (ffebld_constant_logical3 (c1),
- ffebld_constant_logical3 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEBLD_constLOGICAL4:
- return ffetarget_cmp_logical4 (ffebld_constant_logical4 (c1),
- ffebld_constant_logical4 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEBLD_constLOGICAL5:
- return ffetarget_cmp_logical5 (ffebld_constant_logical5 (c1),
- ffebld_constant_logical5 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEBLD_constLOGICAL6:
- return ffetarget_cmp_logical6 (ffebld_constant_logical6 (c1),
- ffebld_constant_logical6 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEBLD_constLOGICAL7:
- return ffetarget_cmp_logical7 (ffebld_constant_logical7 (c1),
- ffebld_constant_logical7 (c2));
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEBLD_constLOGICAL8:
- return ffetarget_cmp_logical8 (ffebld_constant_logical8 (c1),
- ffebld_constant_logical8 (c2));
-#endif
-
-#if FFETARGET_okREAL1
- case FFEBLD_constREAL1:
- return ffetarget_cmp_real1 (ffebld_constant_real1 (c1),
- ffebld_constant_real1 (c2));
-#endif
-
-#if FFETARGET_okREAL2
- case FFEBLD_constREAL2:
- return ffetarget_cmp_real2 (ffebld_constant_real2 (c1),
- ffebld_constant_real2 (c2));
-#endif
-
-#if FFETARGET_okREAL3
- case FFEBLD_constREAL3:
- return ffetarget_cmp_real3 (ffebld_constant_real3 (c1),
- ffebld_constant_real3 (c2));
-#endif
-
-#if FFETARGET_okREAL4
- case FFEBLD_constREAL4:
- return ffetarget_cmp_real4 (ffebld_constant_real4 (c1),
- ffebld_constant_real4 (c2));
-#endif
-
-#if FFETARGET_okREAL5
- case FFEBLD_constREAL5:
- return ffetarget_cmp_real5 (ffebld_constant_real5 (c1),
- ffebld_constant_real5 (c2));
-#endif
-
-#if FFETARGET_okREAL6
- case FFEBLD_constREAL6:
- return ffetarget_cmp_real6 (ffebld_constant_real6 (c1),
- ffebld_constant_real6 (c2));
-#endif
-
-#if FFETARGET_okREAL7
- case FFEBLD_constREAL7:
- return ffetarget_cmp_real7 (ffebld_constant_real7 (c1),
- ffebld_constant_real7 (c2));
-#endif
-
-#if FFETARGET_okREAL8
- case FFEBLD_constREAL8:
- return ffetarget_cmp_real8 (ffebld_constant_real8 (c1),
- ffebld_constant_real8 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER1
- case FFEBLD_constCHARACTER1:
- return ffetarget_cmp_character1 (ffebld_constant_character1 (c1),
- ffebld_constant_character1 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEBLD_constCHARACTER2:
- return ffetarget_cmp_character2 (ffebld_constant_character2 (c1),
- ffebld_constant_character2 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEBLD_constCHARACTER3:
- return ffetarget_cmp_character3 (ffebld_constant_character3 (c1),
- ffebld_constant_character3 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEBLD_constCHARACTER4:
- return ffetarget_cmp_character4 (ffebld_constant_character4 (c1),
- ffebld_constant_character4 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEBLD_constCHARACTER5:
- return ffetarget_cmp_character5 (ffebld_constant_character5 (c1),
- ffebld_constant_character5 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEBLD_constCHARACTER6:
- return ffetarget_cmp_character6 (ffebld_constant_character6 (c1),
- ffebld_constant_character6 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEBLD_constCHARACTER7:
- return ffetarget_cmp_character7 (ffebld_constant_character7 (c1),
- ffebld_constant_character7 (c2));
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEBLD_constCHARACTER8:
- return ffetarget_cmp_character8 (ffebld_constant_character8 (c1),
- ffebld_constant_character8 (c2));
-#endif
-
- default:
- assert ("bad constant type" == NULL);
- return 0;
- }
-}
-
-/* ffebld_constant_dump -- Display summary of constant's contents
-
- ffebldConstant c;
- ffebld_constant_dump(c);
-
- Displays the constant in summary form. */
-
-void
-ffebld_constant_dump (ffebldConstant c)
-{
- switch (ffebld_constant_type (c))
- {
-#if FFETARGET_okINTEGER1
- case FFEBLD_constINTEGER1:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER1);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER1);
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEBLD_constINTEGER2:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER2);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER2);
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEBLD_constINTEGER3:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER3);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER3);
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEBLD_constINTEGER4:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER4);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER4);
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEBLD_constINTEGER5:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER5);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER5);
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEBLD_constINTEGER6:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER6);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER6);
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEBLD_constINTEGER7:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER7);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER7);
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEBLD_constINTEGER8:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER8);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeINTEGER, FFEINFO_kindtypeINTEGER8);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL1
- case FFEBLD_constLOGICAL1:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL1);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL1);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEBLD_constLOGICAL2:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL2);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL2);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEBLD_constLOGICAL3:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL3);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL3);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEBLD_constLOGICAL4:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL4);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL4);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEBLD_constLOGICAL5:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL5);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL5);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEBLD_constLOGICAL6:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL6);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL6);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEBLD_constLOGICAL7:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL7);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL7);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEBLD_constLOGICAL8:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeLOGICAL,
- FFEINFO_kindtypeLOGICAL8);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeLOGICAL, FFEINFO_kindtypeLOGICAL8);
- break;
-#endif
-
-#if FFETARGET_okREAL1
- case FFEBLD_constREAL1:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL1);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL1);
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEBLD_constREAL2:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL2);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL2);
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEBLD_constREAL3:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL3);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL3);
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEBLD_constREAL4:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL4);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL4);
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEBLD_constREAL5:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL5);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL5);
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEBLD_constREAL6:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL6);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL6);
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEBLD_constREAL7:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL7);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL7);
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEBLD_constREAL8:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREAL8);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeREAL, FFEINFO_kindtypeREAL8);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX1
- case FFEBLD_constCOMPLEX1:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL1);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL1);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEBLD_constCOMPLEX2:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL2);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL2);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEBLD_constCOMPLEX3:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL3);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL3);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEBLD_constCOMPLEX4:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL4);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL4);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEBLD_constCOMPLEX5:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL5);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL5);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEBLD_constCOMPLEX6:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL6);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL6);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEBLD_constCOMPLEX7:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL7);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL7);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEBLD_constCOMPLEX8:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCOMPLEX,
- FFEINFO_kindtypeREAL8);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCOMPLEX, FFEINFO_kindtypeREAL8);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER1
- case FFEBLD_constCHARACTER1:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER1);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER1);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEBLD_constCHARACTER2:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER2);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER2);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEBLD_constCHARACTER3:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER3);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER3);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEBLD_constCHARACTER4:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER4);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER4);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEBLD_constCHARACTER5:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER5);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER5);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEBLD_constCHARACTER6:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER6);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER6);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEBLD_constCHARACTER7:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER7);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER7);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEBLD_constCHARACTER8:
- ffebld_dump_prefix (dmpout, FFEINFO_basictypeCHARACTER,
- FFEINFO_kindtypeCHARACTER8);
- ffebld_constantunion_dump (ffebld_constant_union (c),
- FFEINFO_basictypeCHARACTER, FFEINFO_kindtypeCHARACTER8);
- break;
-#endif
-
- case FFEBLD_constHOLLERITH:
- fprintf (dmpout, "H%" ffetargetHollerithSize_f "u/",
- ffebld_constant_hollerith (c).length);
- ffetarget_print_hollerith (dmpout, ffebld_constant_hollerith (c));
- break;
-
- case FFEBLD_constBINARY_MIL:
- fprintf (dmpout, "BM/");
- ffetarget_print_binarymil (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constBINARY_VXT:
- fprintf (dmpout, "BV/");
- ffetarget_print_binaryvxt (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constOCTAL_MIL:
- fprintf (dmpout, "OM/");
- ffetarget_print_octalmil (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constOCTAL_VXT:
- fprintf (dmpout, "OV/");
- ffetarget_print_octalvxt (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constHEX_X_MIL:
- fprintf (dmpout, "XM/");
- ffetarget_print_hexxmil (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constHEX_X_VXT:
- fprintf (dmpout, "XV/");
- ffetarget_print_hexxvxt (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constHEX_Z_MIL:
- fprintf (dmpout, "ZM/");
- ffetarget_print_hexzmil (dmpout, ffebld_constant_typeless (c));
- break;
-
- case FFEBLD_constHEX_Z_VXT:
- fprintf (dmpout, "ZV/");
- ffetarget_print_hexzvxt (dmpout, ffebld_constant_typeless (c));
- break;
-
- default:
- assert ("bad constant type" == NULL);
- fprintf (dmpout, "?/?");
- break;
- }
-}
-
-/* ffebld_constant_is_magical -- Determine if integer is "magical"
-
- ffebldConstant c;
- if (ffebld_constant_is_magical(c))
- // it is 2**(n-1), where n is # bits in ffetargetIntegerDefault type
- // (this test is important for 2's-complement machines only). */
-
-bool
-ffebld_constant_is_magical (ffebldConstant c)
-{
- switch (ffebld_constant_type (c))
- {
- case FFEBLD_constINTEGERDEFAULT:
- return ffetarget_integerdefault_is_magical (ffebld_constant_integer1 (c));
-
- default:
- return FALSE;
- }
-}
-
-/* Determine if constant is zero. Used to ensure step count
- for DO loops isn't zero, also to determine if values will
- be binary zeros, so not entirely portable at this point. */
-
-bool
-ffebld_constant_is_zero (ffebldConstant c)
-{
- switch (ffebld_constant_type (c))
- {
-#if FFETARGET_okINTEGER1
- case FFEBLD_constINTEGER1:
- return ffebld_constant_integer1 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEBLD_constINTEGER2:
- return ffebld_constant_integer2 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEBLD_constINTEGER3:
- return ffebld_constant_integer3 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEBLD_constINTEGER4:
- return ffebld_constant_integer4 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEBLD_constINTEGER5:
- return ffebld_constant_integer5 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEBLD_constINTEGER6:
- return ffebld_constant_integer6 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEBLD_constINTEGER7:
- return ffebld_constant_integer7 (c) == 0;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEBLD_constINTEGER8:
- return ffebld_constant_integer8 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL1
- case FFEBLD_constLOGICAL1:
- return ffebld_constant_logical1 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEBLD_constLOGICAL2:
- return ffebld_constant_logical2 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEBLD_constLOGICAL3:
- return ffebld_constant_logical3 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEBLD_constLOGICAL4:
- return ffebld_constant_logical4 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEBLD_constLOGICAL5:
- return ffebld_constant_logical5 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEBLD_constLOGICAL6:
- return ffebld_constant_logical6 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEBLD_constLOGICAL7:
- return ffebld_constant_logical7 (c) == 0;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEBLD_constLOGICAL8:
- return ffebld_constant_logical8 (c) == 0;
-#endif
-
-#if FFETARGET_okREAL1
- case FFEBLD_constREAL1:
- return ffetarget_iszero_real1 (ffebld_constant_real1 (c));
-#endif
-
-#if FFETARGET_okREAL2
- case FFEBLD_constREAL2:
- return ffetarget_iszero_real2 (ffebld_constant_real2 (c));
-#endif
-
-#if FFETARGET_okREAL3
- case FFEBLD_constREAL3:
- return ffetarget_iszero_real3 (ffebld_constant_real3 (c));
-#endif
-
-#if FFETARGET_okREAL4
- case FFEBLD_constREAL4:
- return ffetarget_iszero_real4 (ffebld_constant_real4 (c));
-#endif
-
-#if FFETARGET_okREAL5
- case FFEBLD_constREAL5:
- return ffetarget_iszero_real5 (ffebld_constant_real5 (c));
-#endif
-
-#if FFETARGET_okREAL6
- case FFEBLD_constREAL6:
- return ffetarget_iszero_real6 (ffebld_constant_real6 (c));
-#endif
-
-#if FFETARGET_okREAL7
- case FFEBLD_constREAL7:
- return ffetarget_iszero_real7 (ffebld_constant_real7 (c));
-#endif
-
-#if FFETARGET_okREAL8
- case FFEBLD_constREAL8:
- return ffetarget_iszero_real8 (ffebld_constant_real8 (c));
-#endif
-
-#if FFETARGET_okCOMPLEX1
- case FFEBLD_constCOMPLEX1:
- return ffetarget_iszero_real1 (ffebld_constant_complex1 (c).real)
- && ffetarget_iszero_real1 (ffebld_constant_complex1 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEBLD_constCOMPLEX2:
- return ffetarget_iszero_real2 (ffebld_constant_complex2 (c).real)
- && ffetarget_iszero_real2 (ffebld_constant_complex2 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEBLD_constCOMPLEX3:
- return ffetarget_iszero_real3 (ffebld_constant_complex3 (c).real)
- && ffetarget_iszero_real3 (ffebld_constant_complex3 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEBLD_constCOMPLEX4:
- return ffetarget_iszero_real4 (ffebld_constant_complex4 (c).real)
- && ffetarget_iszero_real4 (ffebld_constant_complex4 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEBLD_constCOMPLEX5:
- return ffetarget_iszero_real5 (ffebld_constant_complex5 (c).real)
- && ffetarget_iszero_real5 (ffebld_constant_complex5 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEBLD_constCOMPLEX6:
- return ffetarget_iszero_real6 (ffebld_constant_complex6 (c).real)
- && ffetarget_iszero_real6 (ffebld_constant_complex6 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEBLD_constCOMPLEX7:
- return ffetarget_iszero_real7 (ffebld_constant_complex7 (c).real)
- && ffetarget_iszero_real7 (ffebld_constant_complex7 (c).imaginary);
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEBLD_constCOMPLEX8:
- return ffetarget_iszero_real8 (ffebld_constant_complex8 (c).real)
- && ffetarget_iszero_real8 (ffebld_constant_complex8 (c).imaginary);
-#endif
-
-#if FFETARGET_okCHARACTER1
- case FFEBLD_constCHARACTER1:
- return ffetarget_iszero_character1 (ffebld_constant_character1 (c));
-#endif
-
-#if FFETARGET_okCHARACTER2 || FFETARGET_okCHARACTER3 /* ... */
-#error "no support for these!!"
-#endif
-
- case FFEBLD_constHOLLERITH:
- return ffetarget_iszero_hollerith (ffebld_constant_hollerith (c));
-
- case FFEBLD_constBINARY_MIL:
- case FFEBLD_constBINARY_VXT:
- case FFEBLD_constOCTAL_MIL:
- case FFEBLD_constOCTAL_VXT:
- case FFEBLD_constHEX_X_MIL:
- case FFEBLD_constHEX_X_VXT:
- case FFEBLD_constHEX_Z_MIL:
- case FFEBLD_constHEX_Z_VXT:
- return ffetarget_iszero_typeless (ffebld_constant_typeless (c));
-
- default:
- return FALSE;
- }
-}
-
-/* ffebld_constant_new_character1 -- Return character1 constant object from token
-
- See prototype. */
-
-#if FFETARGET_okCHARACTER1
-ffebldConstant
-ffebld_constant_new_character1 (ffelexToken t)
-{
- ffetargetCharacter1 val;
-
- ffetarget_character1 (&val, t, ffebld_constant_pool());
- return ffebld_constant_new_character1_val (val);
-}
-
-#endif
-/* ffebld_constant_new_character1_val -- Return an character1 constant object
-
- See prototype. */
-
-#if FFETARGET_okCHARACTER1
-ffebldConstant
-ffebld_constant_new_character1_val (ffetargetCharacter1 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- ffetarget_verify_character1 (ffebld_constant_pool(), val);
-
- for (c = (ffebldConstant) &ffebld_constant_character1_;
- c->next != NULL;
- c = c->next)
- {
- malloc_verify_kp (ffebld_constant_pool(),
- c->next,
- sizeof (*(c->next)));
- ffetarget_verify_character1 (ffebld_constant_pool(),
- ffebld_constant_character1 (c->next));
- cmp = ffetarget_cmp_character1 (val,
- ffebld_constant_character1 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constCHARACTER1",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constCHARACTER1;
- nc->u.character1 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_complex1 -- Return complex1 constant object from token
-
- See prototype. */
-
-#if FFETARGET_okCOMPLEX1
-ffebldConstant
-ffebld_constant_new_complex1 (ffebldConstant real,
- ffebldConstant imaginary)
-{
- ffetargetComplex1 val;
-
- val.real = ffebld_constant_real1 (real);
- val.imaginary = ffebld_constant_real1 (imaginary);
- return ffebld_constant_new_complex1_val (val);
-}
-
-#endif
-/* ffebld_constant_new_complex1_val -- Return a complex1 constant object
-
- See prototype. */
-
-#if FFETARGET_okCOMPLEX1
-ffebldConstant
-ffebld_constant_new_complex1_val (ffetargetComplex1 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_complex1_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_real1 (val.real, ffebld_constant_complex1 (c->next).real);
- if (cmp == 0)
- cmp = ffetarget_cmp_real1 (val.imaginary,
- ffebld_constant_complex1 (c->next).imaginary);
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constCOMPLEX1",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constCOMPLEX1;
- nc->u.complex1 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_complex2 -- Return complex2 constant object from token
-
- See prototype. */
-
-#if FFETARGET_okCOMPLEX2
-ffebldConstant
-ffebld_constant_new_complex2 (ffebldConstant real,
- ffebldConstant imaginary)
-{
- ffetargetComplex2 val;
-
- val.real = ffebld_constant_real2 (real);
- val.imaginary = ffebld_constant_real2 (imaginary);
- return ffebld_constant_new_complex2_val (val);
-}
-
-#endif
-/* ffebld_constant_new_complex2_val -- Return a complex2 constant object
-
- See prototype. */
-
-#if FFETARGET_okCOMPLEX2
-ffebldConstant
-ffebld_constant_new_complex2_val (ffetargetComplex2 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_complex2_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_real2 (val.real, ffebld_constant_complex2 (c->next).real);
- if (cmp == 0)
- cmp = ffetarget_cmp_real2 (val.imaginary,
- ffebld_constant_complex2 (c->next).imaginary);
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constCOMPLEX2",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constCOMPLEX2;
- nc->u.complex2 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_hollerith -- Return hollerith constant object from token
-
- See prototype. */
-
-ffebldConstant
-ffebld_constant_new_hollerith (ffelexToken t)
-{
- ffetargetHollerith val;
-
- ffetarget_hollerith (&val, t, ffebld_constant_pool());
- return ffebld_constant_new_hollerith_val (val);
-}
-
-/* ffebld_constant_new_hollerith_val -- Return an hollerith constant object
-
- See prototype. */
-
-ffebldConstant
-ffebld_constant_new_hollerith_val (ffetargetHollerith val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_hollerith_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_hollerith (val, ffebld_constant_hollerith (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constHOLLERITH",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constHOLLERITH;
- nc->u.hollerith = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-/* ffebld_constant_new_integer1 -- Return integer1 constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-#if FFETARGET_okINTEGER1
-ffebldConstant
-ffebld_constant_new_integer1 (ffelexToken t)
-{
- ffetargetInteger1 val;
-
- assert (ffelex_token_type (t) == FFELEX_typeNUMBER);
-
- ffetarget_integer1 (&val, t);
- return ffebld_constant_new_integer1_val (val);
-}
-
-#endif
-/* ffebld_constant_new_integer1_val -- Return an integer1 constant object
-
- See prototype. */
-
-#if FFETARGET_okINTEGER1
-ffebldConstant
-ffebld_constant_new_integer1_val (ffetargetInteger1 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_integer1_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_integer1 (val, ffebld_constant_integer1 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constINTEGER1",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constINTEGER1;
- nc->u.integer1 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_integer2_val -- Return an integer2 constant object
-
- See prototype. */
-
-#if FFETARGET_okINTEGER2
-ffebldConstant
-ffebld_constant_new_integer2_val (ffetargetInteger2 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_integer2_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_integer2 (val, ffebld_constant_integer2 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constINTEGER2",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constINTEGER2;
- nc->u.integer2 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_integer3_val -- Return an integer3 constant object
-
- See prototype. */
-
-#if FFETARGET_okINTEGER3
-ffebldConstant
-ffebld_constant_new_integer3_val (ffetargetInteger3 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_integer3_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_integer3 (val, ffebld_constant_integer3 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constINTEGER3",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constINTEGER3;
- nc->u.integer3 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_integer4_val -- Return an integer4 constant object
-
- See prototype. */
-
-#if FFETARGET_okINTEGER4
-ffebldConstant
-ffebld_constant_new_integer4_val (ffetargetInteger4 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_integer4_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_integer4 (val, ffebld_constant_integer4 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constINTEGER4",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constINTEGER4;
- nc->u.integer4 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_integerbinary -- Return binary constant object from token
-
- See prototype.
-
- Parses the token as a binary integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_integerbinary (ffelexToken t)
-{
- ffetargetIntegerDefault val;
-
- assert ((ffelex_token_type (t) == FFELEX_typeNAME)
- || (ffelex_token_type (t) == FFELEX_typeNUMBER));
-
- ffetarget_integerbinary (&val, t);
- return ffebld_constant_new_integerdefault_val (val);
-}
-
-/* ffebld_constant_new_integerhex -- Return hex constant object from token
-
- See prototype.
-
- Parses the token as a hex integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_integerhex (ffelexToken t)
-{
- ffetargetIntegerDefault val;
-
- assert ((ffelex_token_type (t) == FFELEX_typeNAME)
- || (ffelex_token_type (t) == FFELEX_typeNUMBER));
-
- ffetarget_integerhex (&val, t);
- return ffebld_constant_new_integerdefault_val (val);
-}
-
-/* ffebld_constant_new_integeroctal -- Return octal constant object from token
-
- See prototype.
-
- Parses the token as a octal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_integeroctal (ffelexToken t)
-{
- ffetargetIntegerDefault val;
-
- assert ((ffelex_token_type (t) == FFELEX_typeNAME)
- || (ffelex_token_type (t) == FFELEX_typeNUMBER));
-
- ffetarget_integeroctal (&val, t);
- return ffebld_constant_new_integerdefault_val (val);
-}
-
-/* ffebld_constant_new_logical1 -- Return logical1 constant object from token
-
- See prototype.
-
- Parses the token as a decimal logical constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-#if FFETARGET_okLOGICAL1
-ffebldConstant
-ffebld_constant_new_logical1 (bool truth)
-{
- ffetargetLogical1 val;
-
- ffetarget_logical1 (&val, truth);
- return ffebld_constant_new_logical1_val (val);
-}
-
-#endif
-/* ffebld_constant_new_logical1_val -- Return a logical1 constant object
-
- See prototype. */
-
-#if FFETARGET_okLOGICAL1
-ffebldConstant
-ffebld_constant_new_logical1_val (ffetargetLogical1 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_logical1_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_logical1 (val, ffebld_constant_logical1 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constLOGICAL1",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constLOGICAL1;
- nc->u.logical1 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_logical2_val -- Return a logical2 constant object
-
- See prototype. */
-
-#if FFETARGET_okLOGICAL2
-ffebldConstant
-ffebld_constant_new_logical2_val (ffetargetLogical2 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_logical2_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_logical2 (val, ffebld_constant_logical2 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constLOGICAL2",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constLOGICAL2;
- nc->u.logical2 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_logical3_val -- Return a logical3 constant object
-
- See prototype. */
-
-#if FFETARGET_okLOGICAL3
-ffebldConstant
-ffebld_constant_new_logical3_val (ffetargetLogical3 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_logical3_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_logical3 (val, ffebld_constant_logical3 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constLOGICAL3",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constLOGICAL3;
- nc->u.logical3 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_logical4_val -- Return a logical4 constant object
-
- See prototype. */
-
-#if FFETARGET_okLOGICAL4
-ffebldConstant
-ffebld_constant_new_logical4_val (ffetargetLogical4 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_logical4_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_logical4 (val, ffebld_constant_logical4 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constLOGICAL4",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constLOGICAL4;
- nc->u.logical4 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_real1 -- Return real1 constant object from token
-
- See prototype. */
-
-#if FFETARGET_okREAL1
-ffebldConstant
-ffebld_constant_new_real1 (ffelexToken integer, ffelexToken decimal,
- ffelexToken fraction, ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits)
-{
- ffetargetReal1 val;
-
- ffetarget_real1 (&val,
- integer, decimal, fraction, exponent, exponent_sign, exponent_digits);
- return ffebld_constant_new_real1_val (val);
-}
-
-#endif
-/* ffebld_constant_new_real1_val -- Return an real1 constant object
-
- See prototype. */
-
-#if FFETARGET_okREAL1
-ffebldConstant
-ffebld_constant_new_real1_val (ffetargetReal1 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_real1_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_real1 (val, ffebld_constant_real1 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constREAL1",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constREAL1;
- nc->u.real1 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_real2 -- Return real2 constant object from token
-
- See prototype. */
-
-#if FFETARGET_okREAL2
-ffebldConstant
-ffebld_constant_new_real2 (ffelexToken integer, ffelexToken decimal,
- ffelexToken fraction, ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits)
-{
- ffetargetReal2 val;
-
- ffetarget_real2 (&val,
- integer, decimal, fraction, exponent, exponent_sign, exponent_digits);
- return ffebld_constant_new_real2_val (val);
-}
-
-#endif
-/* ffebld_constant_new_real2_val -- Return an real2 constant object
-
- See prototype. */
-
-#if FFETARGET_okREAL2
-ffebldConstant
-ffebld_constant_new_real2_val (ffetargetReal2 val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_real2_;
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_real2 (val, ffebld_constant_real2 (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constREAL2",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = FFEBLD_constREAL2;
- nc->u.real2 = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-#endif
-/* ffebld_constant_new_typeless_bm -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_bm (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_binarymil (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_MIL, val);
-}
-
-/* ffebld_constant_new_typeless_bv -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_bv (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_binaryvxt (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_VXT, val);
-}
-
-/* ffebld_constant_new_typeless_hxm -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_hxm (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_hexxmil (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_MIL, val);
-}
-
-/* ffebld_constant_new_typeless_hxv -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_hxv (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_hexxvxt (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_VXT, val);
-}
-
-/* ffebld_constant_new_typeless_hzm -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_hzm (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_hexzmil (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_MIL, val);
-}
-
-/* ffebld_constant_new_typeless_hzv -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_hzv (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_hexzvxt (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_VXT, val);
-}
-
-/* ffebld_constant_new_typeless_om -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_om (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_octalmil (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_MIL, val);
-}
-
-/* ffebld_constant_new_typeless_ov -- Return typeless constant object from token
-
- See prototype.
-
- Parses the token as a decimal integer constant, thus it must be an
- FFELEX_typeNUMBER. */
-
-ffebldConstant
-ffebld_constant_new_typeless_ov (ffelexToken t)
-{
- ffetargetTypeless val;
-
- ffetarget_octalvxt (&val, t);
- return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_VXT, val);
-}
-
-/* ffebld_constant_new_typeless_val -- Return a typeless constant object
-
- See prototype. */
-
-ffebldConstant
-ffebld_constant_new_typeless_val (ffebldConst type, ffetargetTypeless val)
-{
- ffebldConstant c;
- ffebldConstant nc;
- int cmp;
-
- for (c = (ffebldConstant) &ffebld_constant_typeless_[type
- - FFEBLD_constTYPELESS_FIRST];
- c->next != NULL;
- c = c->next)
- {
- cmp = ffetarget_cmp_typeless (val, ffebld_constant_typeless (c->next));
- if (cmp == 0)
- return c->next;
- if (cmp > 0)
- break;
- }
-
- nc = malloc_new_kp (ffebld_constant_pool(),
- "FFEBLD_constTYPELESS",
- sizeof (*nc));
- nc->next = c->next;
- nc->consttype = type;
- nc->u.typeless = val;
-#ifdef FFECOM_constantHOOK
- nc->hook = FFECOM_constantNULL;
-#endif
- c->next = nc;
-
- return nc;
-}
-
-/* ffebld_constantarray_dump -- Display summary of array's contents
-
- ffebldConstantArray a;
- ffeinfoBasictype bt;
- ffeinfoKindtype kt;
- ffetargetOffset size;
- ffebld_constant_dump(a,bt,kt,size,NULL);
-
- Displays the constant array in summary form. The fifth argument, if
- supplied, is an ffebit object that is consulted as to whether the
- constant at a particular offset is valid. */
-
-void
-ffebld_constantarray_dump (ffebldConstantArray array, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset size, ffebit bits)
-{
- ffetargetOffset i;
- ffebitCount j;
-
- ffebld_dump_prefix (dmpout, bt, kt);
-
- fprintf (dmpout, "\\(");
-
- if (bits == NULL)
- {
- for (i = 0; i < size; ++i)
- {
- ffebld_constantunion_dump (ffebld_constantarray_get (array, bt, kt, i), bt,
- kt);
- if (i != size - 1)
- fputc (',', dmpout);
- }
- }
- else
- {
- bool value;
- ffebitCount length;
- ffetargetOffset offset = 0;
-
- do
- {
- ffebit_test (bits, offset, &value, &length);
- if (value && (length != 0))
- {
- if (length == 1)
- fprintf (dmpout, "[%" ffetargetOffset_f "d]:", offset);
- else
- fprintf (dmpout,
- "[%" ffetargetOffset_f "u..%" ffetargetOffset_f "d]:",
- offset, offset + (ffetargetOffset) length - 1);
- for (j = 0; j < length; ++j, ++offset)
- {
- ffebld_constantunion_dump (ffebld_constantarray_get (array, bt, kt,
- offset), bt, kt);
- if (j != length - 1)
- fputc (',', dmpout);
- }
- fprintf (dmpout, ";");
- }
- else
- offset += length;
- }
- while (length != 0);
- }
- fprintf (dmpout, "\\)");
-
-}
-
-/* ffebld_constantarray_get -- Get a value from an array of constants
-
- See prototype. */
-
-ffebldConstantUnion
-ffebld_constantarray_get (ffebldConstantArray array, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset offset)
-{
- ffebldConstantUnion u;
-
- switch (bt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (kt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- u.integer1 = *(array.integer1 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- u.integer2 = *(array.integer2 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- u.integer3 = *(array.integer3 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- u.integer4 = *(array.integer4 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- u.integer5 = *(array.integer5 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- u.integer6 = *(array.integer6 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- u.integer7 = *(array.integer7 + offset);
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- u.integer8 = *(array.integer8 + offset);
- break;
-#endif
-
- default:
- assert ("bad INTEGER kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (kt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- u.logical1 = *(array.logical1 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- u.logical2 = *(array.logical2 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- u.logical3 = *(array.logical3 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- u.logical4 = *(array.logical4 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- u.logical5 = *(array.logical5 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- u.logical6 = *(array.logical6 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- u.logical7 = *(array.logical7 + offset);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- u.logical8 = *(array.logical8 + offset);
- break;
-#endif
-
- default:
- assert ("bad LOGICAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (kt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- u.real1 = *(array.real1 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- u.real2 = *(array.real2 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- u.real3 = *(array.real3 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- u.real4 = *(array.real4 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- u.real5 = *(array.real5 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- u.real6 = *(array.real6 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- u.real7 = *(array.real7 + offset);
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- u.real8 = *(array.real8 + offset);
- break;
-#endif
-
- default:
- assert ("bad REAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (kt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- u.complex1 = *(array.complex1 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- u.complex2 = *(array.complex2 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- u.complex3 = *(array.complex3 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- u.complex4 = *(array.complex4 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- u.complex5 = *(array.complex5 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- u.complex6 = *(array.complex6 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- u.complex7 = *(array.complex7 + offset);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- u.complex8 = *(array.complex8 + offset);
- break;
-#endif
-
- default:
- assert ("bad COMPLEX kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (kt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- u.character1.length = 1;
- u.character1.text = array.character1 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- u.character2.length = 1;
- u.character2.text = array.character2 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- u.character3.length = 1;
- u.character3.text = array.character3 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- u.character4.length = 1;
- u.character4.text = array.character4 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- u.character5.length = 1;
- u.character5.text = array.character5 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- u.character6.length = 1;
- u.character6.text = array.character6 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- u.character7.length = 1;
- u.character7.text = array.character7 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- u.character8.length = 1;
- u.character8.text = array.character8 + offset;
- break;
-#endif
-
- default:
- assert ("bad CHARACTER kindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad basictype" == NULL);
- break;
- }
-
- return u;
-}
-
-/* ffebld_constantarray_new -- Make an array of constants
-
- See prototype. */
-
-ffebldConstantArray
-ffebld_constantarray_new (ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset size)
-{
- ffebldConstantArray ptr;
-
- switch (bt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (kt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- ptr.integer1 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger1),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- ptr.integer2 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger2),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- ptr.integer3 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger3),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- ptr.integer4 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger4),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- ptr.integer5 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger5),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- ptr.integer6 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger6),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- ptr.integer7 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger7),
- 0);
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- ptr.integer8 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetInteger8),
- 0);
- break;
-#endif
-
- default:
- assert ("bad INTEGER kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (kt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- ptr.logical1 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical1),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- ptr.logical2 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical2),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- ptr.logical3 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical3),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- ptr.logical4 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical4),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- ptr.logical5 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical5),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- ptr.logical6 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical6),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- ptr.logical7 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical7),
- 0);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- ptr.logical8 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetLogical8),
- 0);
- break;
-#endif
-
- default:
- assert ("bad LOGICAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (kt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- ptr.real1 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal1),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- ptr.real2 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal2),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- ptr.real3 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal3),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- ptr.real4 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal4),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- ptr.real5 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal5),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- ptr.real6 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal6),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- ptr.real7 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal7),
- 0);
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- ptr.real8 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetReal8),
- 0);
- break;
-#endif
-
- default:
- assert ("bad REAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (kt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- ptr.complex1 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex1),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- ptr.complex2 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex2),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- ptr.complex3 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex3),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- ptr.complex4 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex4),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- ptr.complex5 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex5),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- ptr.complex6 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex6),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- ptr.complex7 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex7),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- ptr.complex8 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size *= sizeof (ffetargetComplex8),
- 0);
- break;
-#endif
-
- default:
- assert ("bad COMPLEX kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (kt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- ptr.character1 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit1),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- ptr.character2 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit2),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- ptr.character3 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit3),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- ptr.character4 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit4),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- ptr.character5 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit5),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- ptr.character6 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit6),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- ptr.character7 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit7),
- 0);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- ptr.character8 = malloc_new_zkp (ffebld_constant_pool(),
- "ffebldConstantArray",
- size
- *= sizeof (ffetargetCharacterUnit8),
- 0);
- break;
-#endif
-
- default:
- assert ("bad CHARACTER kindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad basictype" == NULL);
- break;
- }
-
- return ptr;
-}
-
-/* ffebld_constantarray_preparray -- Prepare for copy between arrays
-
- See prototype.
-
- Like _prepare, but the source is an array instead of a single-value
- constant. */
-
-void
-ffebld_constantarray_preparray (void **aptr, void **cptr, size_t *size,
- ffebldConstantArray array, ffeinfoBasictype abt, ffeinfoKindtype akt,
- ffetargetOffset offset, ffebldConstantArray source_array,
- ffeinfoBasictype cbt, ffeinfoKindtype ckt)
-{
- switch (abt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (akt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- *aptr = array.integer1 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- *aptr = array.integer2 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- *aptr = array.integer3 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- *aptr = array.integer4 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- *aptr = array.integer5 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- *aptr = array.integer6 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- *aptr = array.integer7 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- *aptr = array.integer8 + offset;
- break;
-#endif
-
- default:
- assert ("bad INTEGER akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (akt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- *aptr = array.logical1 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- *aptr = array.logical2 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- *aptr = array.logical3 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- *aptr = array.logical4 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- *aptr = array.logical5 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- *aptr = array.logical6 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- *aptr = array.logical7 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- *aptr = array.logical8 + offset;
- break;
-#endif
-
- default:
- assert ("bad LOGICAL akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (akt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- *aptr = array.real1 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- *aptr = array.real2 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- *aptr = array.real3 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- *aptr = array.real4 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- *aptr = array.real5 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- *aptr = array.real6 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- *aptr = array.real7 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- *aptr = array.real8 + offset;
- break;
-#endif
-
- default:
- assert ("bad REAL akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (akt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- *aptr = array.complex1 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- *aptr = array.complex2 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- *aptr = array.complex3 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- *aptr = array.complex4 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- *aptr = array.complex5 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- *aptr = array.complex6 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- *aptr = array.complex7 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- *aptr = array.complex8 + offset;
- break;
-#endif
-
- default:
- assert ("bad COMPLEX akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (akt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- *aptr = array.character1 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- *aptr = array.character2 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- *aptr = array.character3 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- *aptr = array.character4 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- *aptr = array.character5 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- *aptr = array.character6 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- *aptr = array.character7 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- *aptr = array.character8 + offset;
- break;
-#endif
-
- default:
- assert ("bad CHARACTER akindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad abasictype" == NULL);
- break;
- }
-
- switch (cbt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (ckt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- *cptr = source_array.integer1;
- *size = sizeof (*source_array.integer1);
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- *cptr = source_array.integer2;
- *size = sizeof (*source_array.integer2);
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- *cptr = source_array.integer3;
- *size = sizeof (*source_array.integer3);
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- *cptr = source_array.integer4;
- *size = sizeof (*source_array.integer4);
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- *cptr = source_array.integer5;
- *size = sizeof (*source_array.integer5);
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- *cptr = source_array.integer6;
- *size = sizeof (*source_array.integer6);
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- *cptr = source_array.integer7;
- *size = sizeof (*source_array.integer7);
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- *cptr = source_array.integer8;
- *size = sizeof (*source_array.integer8);
- break;
-#endif
-
- default:
- assert ("bad INTEGER ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (ckt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- *cptr = source_array.logical1;
- *size = sizeof (*source_array.logical1);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- *cptr = source_array.logical2;
- *size = sizeof (*source_array.logical2);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- *cptr = source_array.logical3;
- *size = sizeof (*source_array.logical3);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- *cptr = source_array.logical4;
- *size = sizeof (*source_array.logical4);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- *cptr = source_array.logical5;
- *size = sizeof (*source_array.logical5);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- *cptr = source_array.logical6;
- *size = sizeof (*source_array.logical6);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- *cptr = source_array.logical7;
- *size = sizeof (*source_array.logical7);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- *cptr = source_array.logical8;
- *size = sizeof (*source_array.logical8);
- break;
-#endif
-
- default:
- assert ("bad LOGICAL ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (ckt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- *cptr = source_array.real1;
- *size = sizeof (*source_array.real1);
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- *cptr = source_array.real2;
- *size = sizeof (*source_array.real2);
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- *cptr = source_array.real3;
- *size = sizeof (*source_array.real3);
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- *cptr = source_array.real4;
- *size = sizeof (*source_array.real4);
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- *cptr = source_array.real5;
- *size = sizeof (*source_array.real5);
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- *cptr = source_array.real6;
- *size = sizeof (*source_array.real6);
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- *cptr = source_array.real7;
- *size = sizeof (*source_array.real7);
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- *cptr = source_array.real8;
- *size = sizeof (*source_array.real8);
- break;
-#endif
-
- default:
- assert ("bad REAL ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (ckt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- *cptr = source_array.complex1;
- *size = sizeof (*source_array.complex1);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- *cptr = source_array.complex2;
- *size = sizeof (*source_array.complex2);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- *cptr = source_array.complex3;
- *size = sizeof (*source_array.complex3);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- *cptr = source_array.complex4;
- *size = sizeof (*source_array.complex4);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- *cptr = source_array.complex5;
- *size = sizeof (*source_array.complex5);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- *cptr = source_array.complex6;
- *size = sizeof (*source_array.complex6);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- *cptr = source_array.complex7;
- *size = sizeof (*source_array.complex7);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- *cptr = source_array.complex8;
- *size = sizeof (*source_array.complex8);
- break;
-#endif
-
- default:
- assert ("bad COMPLEX ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (ckt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- *cptr = source_array.character1;
- *size = sizeof (*source_array.character1);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- *cptr = source_array.character2;
- *size = sizeof (*source_array.character2);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- *cptr = source_array.character3;
- *size = sizeof (*source_array.character3);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- *cptr = source_array.character4;
- *size = sizeof (*source_array.character4);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- *cptr = source_array.character5;
- *size = sizeof (*source_array.character5);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- *cptr = source_array.character6;
- *size = sizeof (*source_array.character6);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- *cptr = source_array.character7;
- *size = sizeof (*source_array.character7);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- *cptr = source_array.character8;
- *size = sizeof (*source_array.character8);
- break;
-#endif
-
- default:
- assert ("bad CHARACTER ckindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad cbasictype" == NULL);
- break;
- }
-}
-
-/* ffebld_constantarray_prepare -- Prepare for copy between value and array
-
- See prototype.
-
- Like _put, but just returns the pointers to the beginnings of the
- array and the constant and returns the size (the amount of info to
- copy). The idea is that the caller can use memcpy to accomplish the
- same thing as _put (though slower), or the caller can use a different
- function that swaps bytes, words, etc for a different target machine.
- Also, the type of the array may be different from the type of the
- constant; the array type is used to determine the meaning (scale) of
- the offset field (to calculate the array pointer), the constant type is
- used to determine the constant pointer and the size (amount of info to
- copy). */
-
-void
-ffebld_constantarray_prepare (void **aptr, void **cptr, size_t *size,
- ffebldConstantArray array, ffeinfoBasictype abt, ffeinfoKindtype akt,
- ffetargetOffset offset, ffebldConstantUnion *constant,
- ffeinfoBasictype cbt, ffeinfoKindtype ckt)
-{
- switch (abt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (akt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- *aptr = array.integer1 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- *aptr = array.integer2 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- *aptr = array.integer3 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- *aptr = array.integer4 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- *aptr = array.integer5 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- *aptr = array.integer6 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- *aptr = array.integer7 + offset;
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- *aptr = array.integer8 + offset;
- break;
-#endif
-
- default:
- assert ("bad INTEGER akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (akt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- *aptr = array.logical1 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- *aptr = array.logical2 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- *aptr = array.logical3 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- *aptr = array.logical4 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- *aptr = array.logical5 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- *aptr = array.logical6 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- *aptr = array.logical7 + offset;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- *aptr = array.logical8 + offset;
- break;
-#endif
-
- default:
- assert ("bad LOGICAL akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (akt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- *aptr = array.real1 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- *aptr = array.real2 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- *aptr = array.real3 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- *aptr = array.real4 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- *aptr = array.real5 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- *aptr = array.real6 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- *aptr = array.real7 + offset;
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- *aptr = array.real8 + offset;
- break;
-#endif
-
- default:
- assert ("bad REAL akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (akt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- *aptr = array.complex1 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- *aptr = array.complex2 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- *aptr = array.complex3 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- *aptr = array.complex4 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- *aptr = array.complex5 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- *aptr = array.complex6 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- *aptr = array.complex7 + offset;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- *aptr = array.complex8 + offset;
- break;
-#endif
-
- default:
- assert ("bad COMPLEX akindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (akt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- *aptr = array.character1 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- *aptr = array.character2 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- *aptr = array.character3 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- *aptr = array.character4 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- *aptr = array.character5 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- *aptr = array.character6 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- *aptr = array.character7 + offset;
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- *aptr = array.character8 + offset;
- break;
-#endif
-
- default:
- assert ("bad CHARACTER akindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad abasictype" == NULL);
- break;
- }
-
- switch (cbt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (ckt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- *cptr = &constant->integer1;
- *size = sizeof (constant->integer1);
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- *cptr = &constant->integer2;
- *size = sizeof (constant->integer2);
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- *cptr = &constant->integer3;
- *size = sizeof (constant->integer3);
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- *cptr = &constant->integer4;
- *size = sizeof (constant->integer4);
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- *cptr = &constant->integer5;
- *size = sizeof (constant->integer5);
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- *cptr = &constant->integer6;
- *size = sizeof (constant->integer6);
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- *cptr = &constant->integer7;
- *size = sizeof (constant->integer7);
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- *cptr = &constant->integer8;
- *size = sizeof (constant->integer8);
- break;
-#endif
-
- default:
- assert ("bad INTEGER ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (ckt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- *cptr = &constant->logical1;
- *size = sizeof (constant->logical1);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- *cptr = &constant->logical2;
- *size = sizeof (constant->logical2);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- *cptr = &constant->logical3;
- *size = sizeof (constant->logical3);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- *cptr = &constant->logical4;
- *size = sizeof (constant->logical4);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- *cptr = &constant->logical5;
- *size = sizeof (constant->logical5);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- *cptr = &constant->logical6;
- *size = sizeof (constant->logical6);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- *cptr = &constant->logical7;
- *size = sizeof (constant->logical7);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- *cptr = &constant->logical8;
- *size = sizeof (constant->logical8);
- break;
-#endif
-
- default:
- assert ("bad LOGICAL ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (ckt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- *cptr = &constant->real1;
- *size = sizeof (constant->real1);
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- *cptr = &constant->real2;
- *size = sizeof (constant->real2);
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- *cptr = &constant->real3;
- *size = sizeof (constant->real3);
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- *cptr = &constant->real4;
- *size = sizeof (constant->real4);
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- *cptr = &constant->real5;
- *size = sizeof (constant->real5);
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- *cptr = &constant->real6;
- *size = sizeof (constant->real6);
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- *cptr = &constant->real7;
- *size = sizeof (constant->real7);
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- *cptr = &constant->real8;
- *size = sizeof (constant->real8);
- break;
-#endif
-
- default:
- assert ("bad REAL ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (ckt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- *cptr = &constant->complex1;
- *size = sizeof (constant->complex1);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- *cptr = &constant->complex2;
- *size = sizeof (constant->complex2);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- *cptr = &constant->complex3;
- *size = sizeof (constant->complex3);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- *cptr = &constant->complex4;
- *size = sizeof (constant->complex4);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- *cptr = &constant->complex5;
- *size = sizeof (constant->complex5);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- *cptr = &constant->complex6;
- *size = sizeof (constant->complex6);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- *cptr = &constant->complex7;
- *size = sizeof (constant->complex7);
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- *cptr = &constant->complex8;
- *size = sizeof (constant->complex8);
- break;
-#endif
-
- default:
- assert ("bad COMPLEX ckindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (ckt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- *cptr = ffetarget_text_character1 (constant->character1);
- *size = ffetarget_length_character1 (constant->character1);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- *cptr = ffetarget_text_character2 (constant->character2);
- *size = ffetarget_length_character2 (constant->character2);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- *cptr = ffetarget_text_character3 (constant->character3);
- *size = ffetarget_length_character3 (constant->character3);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- *cptr = ffetarget_text_character4 (constant->character4);
- *size = ffetarget_length_character4 (constant->character4);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- *cptr = ffetarget_text_character5 (constant->character5);
- *size = ffetarget_length_character5 (constant->character5);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- *cptr = ffetarget_text_character6 (constant->character6);
- *size = ffetarget_length_character6 (constant->character6);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- *cptr = ffetarget_text_character7 (constant->character7);
- *size = ffetarget_length_character7 (constant->character7);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- *cptr = ffetarget_text_character8 (constant->character8);
- *size = ffetarget_length_character8 (constant->character8);
- break;
-#endif
-
- default:
- assert ("bad CHARACTER ckindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad cbasictype" == NULL);
- break;
- }
-}
-
-/* ffebld_constantarray_put -- Put a value into an array of constants
-
- See prototype. */
-
-void
-ffebld_constantarray_put (ffebldConstantArray array, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset offset, ffebldConstantUnion constant)
-{
- switch (bt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (kt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- *(array.integer1 + offset) = constant.integer1;
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- *(array.integer2 + offset) = constant.integer2;
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- *(array.integer3 + offset) = constant.integer3;
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- *(array.integer4 + offset) = constant.integer4;
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- *(array.integer5 + offset) = constant.integer5;
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- *(array.integer6 + offset) = constant.integer6;
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- *(array.integer7 + offset) = constant.integer7;
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- *(array.integer8 + offset) = constant.integer8;
- break;
-#endif
-
- default:
- assert ("bad INTEGER kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (kt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- *(array.logical1 + offset) = constant.logical1;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- *(array.logical2 + offset) = constant.logical2;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- *(array.logical3 + offset) = constant.logical3;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- *(array.logical4 + offset) = constant.logical4;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- *(array.logical5 + offset) = constant.logical5;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- *(array.logical6 + offset) = constant.logical6;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- *(array.logical7 + offset) = constant.logical7;
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- *(array.logical8 + offset) = constant.logical8;
- break;
-#endif
-
- default:
- assert ("bad LOGICAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (kt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- *(array.real1 + offset) = constant.real1;
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- *(array.real2 + offset) = constant.real2;
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- *(array.real3 + offset) = constant.real3;
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- *(array.real4 + offset) = constant.real4;
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- *(array.real5 + offset) = constant.real5;
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- *(array.real6 + offset) = constant.real6;
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- *(array.real7 + offset) = constant.real7;
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- *(array.real8 + offset) = constant.real8;
- break;
-#endif
-
- default:
- assert ("bad REAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (kt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- *(array.complex1 + offset) = constant.complex1;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- *(array.complex2 + offset) = constant.complex2;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- *(array.complex3 + offset) = constant.complex3;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- *(array.complex4 + offset) = constant.complex4;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- *(array.complex5 + offset) = constant.complex5;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- *(array.complex6 + offset) = constant.complex6;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- *(array.complex7 + offset) = constant.complex7;
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- *(array.complex8 + offset) = constant.complex8;
- break;
-#endif
-
- default:
- assert ("bad COMPLEX kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (kt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- memcpy (array.character1 + offset,
- ffetarget_text_character1 (constant.character1),
- ffetarget_length_character1 (constant.character1));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- memcpy (array.character2 + offset,
- ffetarget_text_character2 (constant.character2),
- ffetarget_length_character2 (constant.character2));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- memcpy (array.character3 + offset,
- ffetarget_text_character3 (constant.character3),
- ffetarget_length_character3 (constant.character3));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- memcpy (array.character4 + offset,
- ffetarget_text_character4 (constant.character4),
- ffetarget_length_character4 (constant.character4));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- memcpy (array.character5 + offset,
- ffetarget_text_character5 (constant.character5),
- ffetarget_length_character5 (constant.character5));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- memcpy (array.character6 + offset,
- ffetarget_text_character6 (constant.character6),
- ffetarget_length_character6 (constant.character6));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- memcpy (array.character7 + offset,
- ffetarget_text_character7 (constant.character7),
- ffetarget_length_character7 (constant.character7));
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- memcpy (array.character8 + offset,
- ffetarget_text_character8 (constant.character8),
- ffetarget_length_character8 (constant.character8));
- break;
-#endif
-
- default:
- assert ("bad CHARACTER kindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad basictype" == NULL);
- break;
- }
-}
-
-/* ffebld_constantunion_dump -- Dump a constant
-
- See prototype. */
-
-void
-ffebld_constantunion_dump (ffebldConstantUnion u, ffeinfoBasictype bt,
- ffeinfoKindtype kt)
-{
- switch (bt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (kt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- ffetarget_print_integer1 (dmpout, u.integer1);
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- ffetarget_print_integer2 (dmpout, u.integer2);
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- ffetarget_print_integer3 (dmpout, u.integer3);
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- ffetarget_print_integer4 (dmpout, u.integer4);
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- ffetarget_print_integer5 (dmpout, u.integer5);
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- ffetarget_print_integer6 (dmpout, u.integer6);
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- ffetarget_print_integer7 (dmpout, u.integer7);
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- ffetarget_print_integer8 (dmpout, u.integer8);
- break;
-#endif
-
- default:
- assert ("bad INTEGER kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (kt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- ffetarget_print_logical1 (dmpout, u.logical1);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- ffetarget_print_logical2 (dmpout, u.logical2);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- ffetarget_print_logical3 (dmpout, u.logical3);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- ffetarget_print_logical4 (dmpout, u.logical4);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- ffetarget_print_logical5 (dmpout, u.logical5);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- ffetarget_print_logical6 (dmpout, u.logical6);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- ffetarget_print_logical7 (dmpout, u.logical7);
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- ffetarget_print_logical8 (dmpout, u.logical8);
- break;
-#endif
-
- default:
- assert ("bad LOGICAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (kt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- ffetarget_print_real1 (dmpout, u.real1);
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- ffetarget_print_real2 (dmpout, u.real2);
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- ffetarget_print_real3 (dmpout, u.real3);
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- ffetarget_print_real4 (dmpout, u.real4);
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- ffetarget_print_real5 (dmpout, u.real5);
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- ffetarget_print_real6 (dmpout, u.real6);
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- ffetarget_print_real7 (dmpout, u.real7);
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- ffetarget_print_real8 (dmpout, u.real8);
- break;
-#endif
-
- default:
- assert ("bad REAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (kt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- fprintf (dmpout, "(");
- ffetarget_print_real1 (dmpout, u.complex1.real);
- fprintf (dmpout, ",");
- ffetarget_print_real1 (dmpout, u.complex1.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- fprintf (dmpout, "(");
- ffetarget_print_real2 (dmpout, u.complex2.real);
- fprintf (dmpout, ",");
- ffetarget_print_real2 (dmpout, u.complex2.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- fprintf (dmpout, "(");
- ffetarget_print_real3 (dmpout, u.complex3.real);
- fprintf (dmpout, ",");
- ffetarget_print_real3 (dmpout, u.complex3.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- fprintf (dmpout, "(");
- ffetarget_print_real4 (dmpout, u.complex4.real);
- fprintf (dmpout, ",");
- ffetarget_print_real4 (dmpout, u.complex4.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- fprintf (dmpout, "(");
- ffetarget_print_real5 (dmpout, u.complex5.real);
- fprintf (dmpout, ",");
- ffetarget_print_real5 (dmpout, u.complex5.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- fprintf (dmpout, "(");
- ffetarget_print_real6 (dmpout, u.complex6.real);
- fprintf (dmpout, ",");
- ffetarget_print_real6 (dmpout, u.complex6.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- fprintf (dmpout, "(");
- ffetarget_print_real7 (dmpout, u.complex7.real);
- fprintf (dmpout, ",");
- ffetarget_print_real7 (dmpout, u.complex7.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- fprintf (dmpout, "(");
- ffetarget_print_real8 (dmpout, u.complex8.real);
- fprintf (dmpout, ",");
- ffetarget_print_real8 (dmpout, u.complex8.imaginary);
- fprintf (dmpout, ")");
- break;
-#endif
-
- default:
- assert ("bad COMPLEX kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (kt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- ffetarget_print_character1 (dmpout, u.character1);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- ffetarget_print_character2 (dmpout, u.character2);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- ffetarget_print_character3 (dmpout, u.character3);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- ffetarget_print_character4 (dmpout, u.character4);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- ffetarget_print_character5 (dmpout, u.character5);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- ffetarget_print_character6 (dmpout, u.character6);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- ffetarget_print_character7 (dmpout, u.character7);
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- ffetarget_print_character8 (dmpout, u.character8);
- break;
-#endif
-
- default:
- assert ("bad CHARACTER kindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad basictype" == NULL);
- break;
- }
-}
-
-/* ffebld_dump -- Dump expression tree in concise form
-
- ffebld b;
- ffebld_dump(b); */
-
-void
-ffebld_dump (ffebld b)
-{
- ffeinfoKind k;
- ffeinfoWhere w;
-
- if (b == NULL)
- {
- fprintf (dmpout, "(null)");
- return;
- }
-
- switch (ffebld_op (b))
- {
- case FFEBLD_opITEM:
- fputs ("[", dmpout);
- while (b != NULL)
- {
- ffebld_dump (ffebld_head (b));
- if ((b = ffebld_trail (b)) != NULL)
- fputs (",", dmpout);
- }
- fputs ("]", dmpout);
- return;
-
- case FFEBLD_opSTAR:
- case FFEBLD_opBOUNDS:
- case FFEBLD_opREPEAT:
- case FFEBLD_opLABTER:
- case FFEBLD_opLABTOK:
- case FFEBLD_opIMPDO:
- fputs (ffebld_op_string (ffebld_op (b)), dmpout);
- break;
-
- default:
- if (ffeinfo_size (ffebld_info (b)) != FFETARGET_charactersizeNONE)
- fprintf (dmpout, "%s%d%s%s*%" ffetargetCharacterSize_f "u",
- ffebld_op_string (ffebld_op (b)),
- (int) ffeinfo_rank (ffebld_info (b)),
- ffeinfo_basictype_string (ffeinfo_basictype (ffebld_info (b))),
- ffeinfo_kindtype_string (ffeinfo_kindtype (ffebld_info (b))),
- ffeinfo_size (ffebld_info (b)));
- else
- fprintf (dmpout, "%s%d%s%s", ffebld_op_string (ffebld_op (b)),
- (int) ffeinfo_rank (ffebld_info (b)),
- ffeinfo_basictype_string (ffeinfo_basictype (ffebld_info (b))),
- ffeinfo_kindtype_string (ffeinfo_kindtype (ffebld_info (b))));
- if ((k = ffeinfo_kind (ffebld_info (b))) != FFEINFO_kindNONE)
- fprintf (dmpout, "/%s", ffeinfo_kind_string (k));
- if ((w = ffeinfo_where (ffebld_info (b))) != FFEINFO_whereNONE)
- fprintf (dmpout, "@%s", ffeinfo_where_string (w));
- break;
- }
-
- switch (ffebld_arity (b))
- {
- case 2:
- fputs ("(", dmpout);
- ffebld_dump (ffebld_left (b));
- fputs (",", dmpout);
- ffebld_dump (ffebld_right (b));
- fputs (")", dmpout);
- break;
-
- case 1:
- fputs ("(", dmpout);
- ffebld_dump (ffebld_left (b));
- fputs (")", dmpout);
- break;
-
- default:
- switch (ffebld_op (b))
- {
- case FFEBLD_opCONTER:
- fprintf (dmpout, "<");
- ffebld_constant_dump (b->u.conter.expr);
- fprintf (dmpout, ">");
- break;
-
- case FFEBLD_opACCTER:
- fprintf (dmpout, "<");
- ffebld_constantarray_dump (b->u.accter.array,
- ffeinfo_basictype (ffebld_info (b)),
- ffeinfo_kindtype (ffebld_info (b)),
- ffebit_size (b->u.accter.bits), b->u.accter.bits);
- fprintf (dmpout, ">");
- break;
-
- case FFEBLD_opARRTER:
- fprintf (dmpout, "<");
- ffebld_constantarray_dump (b->u.arrter.array,
- ffeinfo_basictype (ffebld_info (b)),
- ffeinfo_kindtype (ffebld_info (b)),
- b->u.arrter.size, NULL);
- fprintf (dmpout, ">");
- break;
-
- case FFEBLD_opLABTER:
- if (b->u.labter == NULL)
- fprintf (dmpout, "<>");
- else
- fprintf (dmpout, "<%" ffelabValue_f "u>", ffelab_value (b->u.labter));
- break;
-
- case FFEBLD_opLABTOK:
- fprintf (dmpout, "<%s>", ffelex_token_text (b->u.labtok));
- break;
-
- case FFEBLD_opSYMTER:
- fprintf (dmpout, "<");
- ffesymbol_dump (b->u.symter.symbol);
- if ((b->u.symter.generic != FFEINTRIN_genNONE)
- || (b->u.symter.specific != FFEINTRIN_specNONE))
- fprintf (dmpout, "{%s:%s:%s}",
- ffeintrin_name_generic (b->u.symter.generic),
- ffeintrin_name_specific (b->u.symter.specific),
- ffeintrin_name_implementation (b->u.symter.implementation));
- if (b->u.symter.do_iter)
- fprintf (dmpout, "{/do-iter}");
- fprintf (dmpout, ">");
- break;
-
- default:
- break;
- }
- }
-}
-
-/* ffebld_dump_prefix -- Dump the prefix for a constant of a given type
-
- ffebld_dump_prefix(dmpout,FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGER1); */
-
-void
-ffebld_dump_prefix (FILE *out, ffeinfoBasictype bt, ffeinfoKindtype kt)
-{
- switch (bt)
- {
- case FFEINFO_basictypeINTEGER:
- switch (kt)
- {
-#if FFETARGET_okINTEGER1
- case FFEINFO_kindtypeINTEGER1:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER1) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER2
- case FFEINFO_kindtypeINTEGER2:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER2) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER3
- case FFEINFO_kindtypeINTEGER3:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER3) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER4
- case FFEINFO_kindtypeINTEGER4:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER4) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER5
- case FFEINFO_kindtypeINTEGER5:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER5) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER6
- case FFEINFO_kindtypeINTEGER6:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER6) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER7
- case FFEINFO_kindtypeINTEGER7:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER7) "/");
- break;
-#endif
-
-#if FFETARGET_okINTEGER8
- case FFEINFO_kindtypeINTEGER8:
- fprintf (out, "I" STRX (FFETARGET_kindINTEGER8) "/");
- break;
-#endif
-
- default:
- assert ("bad INTEGER kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeLOGICAL:
- switch (kt)
- {
-#if FFETARGET_okLOGICAL1
- case FFEINFO_kindtypeLOGICAL1:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL1) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL2
- case FFEINFO_kindtypeLOGICAL2:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL2) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL3
- case FFEINFO_kindtypeLOGICAL3:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL3) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL4
- case FFEINFO_kindtypeLOGICAL4:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL4) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL5
- case FFEINFO_kindtypeLOGICAL5:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL5) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL6
- case FFEINFO_kindtypeLOGICAL6:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL6) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL7
- case FFEINFO_kindtypeLOGICAL7:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL7) "/");
- break;
-#endif
-
-#if FFETARGET_okLOGICAL8
- case FFEINFO_kindtypeLOGICAL8:
- fprintf (out, "L" STRX (FFETARGET_kindLOGICAL8) "/");
- break;
-#endif
-
- default:
- assert ("bad LOGICAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (kt)
- {
-#if FFETARGET_okREAL1
- case FFEINFO_kindtypeREAL1:
- fprintf (out, "R" STRX (FFETARGET_kindREAL1) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL2
- case FFEINFO_kindtypeREAL2:
- fprintf (out, "R" STRX (FFETARGET_kindREAL2) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL3
- case FFEINFO_kindtypeREAL3:
- fprintf (out, "R" STRX (FFETARGET_kindREAL3) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL4
- case FFEINFO_kindtypeREAL4:
- fprintf (out, "R" STRX (FFETARGET_kindREAL4) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL5
- case FFEINFO_kindtypeREAL5:
- fprintf (out, "R" STRX (FFETARGET_kindREAL5) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL6
- case FFEINFO_kindtypeREAL6:
- fprintf (out, "R" STRX (FFETARGET_kindREAL6) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL7
- case FFEINFO_kindtypeREAL7:
- fprintf (out, "R" STRX (FFETARGET_kindREAL7) "/");
- break;
-#endif
-
-#if FFETARGET_okREAL8
- case FFEINFO_kindtypeREAL8:
- fprintf (out, "R" STRX (FFETARGET_kindREAL8) "/");
- break;
-#endif
-
- default:
- assert ("bad REAL kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCOMPLEX:
- switch (kt)
- {
-#if FFETARGET_okCOMPLEX1
- case FFEINFO_kindtypeREAL1:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX1) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX2
- case FFEINFO_kindtypeREAL2:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX2) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX3
- case FFEINFO_kindtypeREAL3:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX3) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX4
- case FFEINFO_kindtypeREAL4:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX4) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX5
- case FFEINFO_kindtypeREAL5:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX5) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX6
- case FFEINFO_kindtypeREAL6:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX6) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX7
- case FFEINFO_kindtypeREAL7:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX7) "/");
- break;
-#endif
-
-#if FFETARGET_okCOMPLEX8
- case FFEINFO_kindtypeREAL8:
- fprintf (out, "C" STRX (FFETARGET_kindCOMPLEX8) "/");
- break;
-#endif
-
- default:
- assert ("bad COMPLEX kindtype" == NULL);
- break;
- }
- break;
-
- case FFEINFO_basictypeCHARACTER:
- switch (kt)
- {
-#if FFETARGET_okCHARACTER1
- case FFEINFO_kindtypeCHARACTER1:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER1) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER2
- case FFEINFO_kindtypeCHARACTER2:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER2) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER3
- case FFEINFO_kindtypeCHARACTER3:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER3) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER4
- case FFEINFO_kindtypeCHARACTER4:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER4) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER5
- case FFEINFO_kindtypeCHARACTER5:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER5) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER6
- case FFEINFO_kindtypeCHARACTER6:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER6) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER7
- case FFEINFO_kindtypeCHARACTER7:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER7) "/");
- break;
-#endif
-
-#if FFETARGET_okCHARACTER8
- case FFEINFO_kindtypeCHARACTER8:
- fprintf (out, "A" STRX (FFETARGET_kindCHARACTER8) "/");
- break;
-#endif
-
- default:
- assert ("bad CHARACTER kindtype" == NULL);
- break;
- }
- break;
-
- default:
- assert ("bad basictype" == NULL);
- fprintf (out, "?/?");
- break;
- }
-}
-
-/* ffebld_init_0 -- Initialize the module
-
- ffebld_init_0(); */
-
-void
-ffebld_init_0 ()
-{
- assert (FFEBLD_op == ARRAY_SIZE (ffebld_op_string_));
- assert (FFEBLD_op == ARRAY_SIZE (ffebld_arity_op_));
-}
-
-/* ffebld_init_1 -- Initialize the module for a file
-
- ffebld_init_1(); */
-
-void
-ffebld_init_1 ()
-{
-#if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstFILE_
- int i;
-
-#if FFETARGET_okCHARACTER1
- ffebld_constant_character1_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER2
- ffebld_constant_character2_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER3
- ffebld_constant_character3_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER4
- ffebld_constant_character4_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER5
- ffebld_constant_character5_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER6
- ffebld_constant_character6_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER7
- ffebld_constant_character7_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER8
- ffebld_constant_character8_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX1
- ffebld_constant_complex1_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX2
- ffebld_constant_complex2_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX3
- ffebld_constant_complex3_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX4
- ffebld_constant_complex4_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX5
- ffebld_constant_complex5_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX6
- ffebld_constant_complex6_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX7
- ffebld_constant_complex7_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX8
- ffebld_constant_complex8_ = NULL;
-#endif
-#if FFETARGET_okINTEGER1
- ffebld_constant_integer1_ = NULL;
-#endif
-#if FFETARGET_okINTEGER2
- ffebld_constant_integer2_ = NULL;
-#endif
-#if FFETARGET_okINTEGER3
- ffebld_constant_integer3_ = NULL;
-#endif
-#if FFETARGET_okINTEGER4
- ffebld_constant_integer4_ = NULL;
-#endif
-#if FFETARGET_okINTEGER5
- ffebld_constant_integer5_ = NULL;
-#endif
-#if FFETARGET_okINTEGER6
- ffebld_constant_integer6_ = NULL;
-#endif
-#if FFETARGET_okINTEGER7
- ffebld_constant_integer7_ = NULL;
-#endif
-#if FFETARGET_okINTEGER8
- ffebld_constant_integer8_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL1
- ffebld_constant_logical1_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL2
- ffebld_constant_logical2_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL3
- ffebld_constant_logical3_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL4
- ffebld_constant_logical4_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL5
- ffebld_constant_logical5_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL6
- ffebld_constant_logical6_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL7
- ffebld_constant_logical7_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL8
- ffebld_constant_logical8_ = NULL;
-#endif
-#if FFETARGET_okREAL1
- ffebld_constant_real1_ = NULL;
-#endif
-#if FFETARGET_okREAL2
- ffebld_constant_real2_ = NULL;
-#endif
-#if FFETARGET_okREAL3
- ffebld_constant_real3_ = NULL;
-#endif
-#if FFETARGET_okREAL4
- ffebld_constant_real4_ = NULL;
-#endif
-#if FFETARGET_okREAL5
- ffebld_constant_real5_ = NULL;
-#endif
-#if FFETARGET_okREAL6
- ffebld_constant_real6_ = NULL;
-#endif
-#if FFETARGET_okREAL7
- ffebld_constant_real7_ = NULL;
-#endif
-#if FFETARGET_okREAL8
- ffebld_constant_real8_ = NULL;
-#endif
- ffebld_constant_hollerith_ = NULL;
- for (i = FFEBLD_constTYPELESS_FIRST; i <= FFEBLD_constTYPELESS_LAST; ++i)
- ffebld_constant_typeless_[i - FFEBLD_constTYPELESS_FIRST] = NULL;
-#endif
-}
-
-/* ffebld_init_2 -- Initialize the module
-
- ffebld_init_2(); */
-
-void
-ffebld_init_2 ()
-{
-#if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
- int i;
-#endif
-
- ffebld_pool_stack_.next = NULL;
- ffebld_pool_stack_.pool = ffe_pool_program_unit ();
-#if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
-#if FFETARGET_okCHARACTER1
- ffebld_constant_character1_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER2
- ffebld_constant_character2_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER3
- ffebld_constant_character3_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER4
- ffebld_constant_character4_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER5
- ffebld_constant_character5_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER6
- ffebld_constant_character6_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER7
- ffebld_constant_character7_ = NULL;
-#endif
-#if FFETARGET_okCHARACTER8
- ffebld_constant_character8_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX1
- ffebld_constant_complex1_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX2
- ffebld_constant_complex2_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX3
- ffebld_constant_complex3_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX4
- ffebld_constant_complex4_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX5
- ffebld_constant_complex5_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX6
- ffebld_constant_complex6_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX7
- ffebld_constant_complex7_ = NULL;
-#endif
-#if FFETARGET_okCOMPLEX8
- ffebld_constant_complex8_ = NULL;
-#endif
-#if FFETARGET_okINTEGER1
- ffebld_constant_integer1_ = NULL;
-#endif
-#if FFETARGET_okINTEGER2
- ffebld_constant_integer2_ = NULL;
-#endif
-#if FFETARGET_okINTEGER3
- ffebld_constant_integer3_ = NULL;
-#endif
-#if FFETARGET_okINTEGER4
- ffebld_constant_integer4_ = NULL;
-#endif
-#if FFETARGET_okINTEGER5
- ffebld_constant_integer5_ = NULL;
-#endif
-#if FFETARGET_okINTEGER6
- ffebld_constant_integer6_ = NULL;
-#endif
-#if FFETARGET_okINTEGER7
- ffebld_constant_integer7_ = NULL;
-#endif
-#if FFETARGET_okINTEGER8
- ffebld_constant_integer8_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL1
- ffebld_constant_logical1_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL2
- ffebld_constant_logical2_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL3
- ffebld_constant_logical3_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL4
- ffebld_constant_logical4_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL5
- ffebld_constant_logical5_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL6
- ffebld_constant_logical6_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL7
- ffebld_constant_logical7_ = NULL;
-#endif
-#if FFETARGET_okLOGICAL8
- ffebld_constant_logical8_ = NULL;
-#endif
-#if FFETARGET_okREAL1
- ffebld_constant_real1_ = NULL;
-#endif
-#if FFETARGET_okREAL2
- ffebld_constant_real2_ = NULL;
-#endif
-#if FFETARGET_okREAL3
- ffebld_constant_real3_ = NULL;
-#endif
-#if FFETARGET_okREAL4
- ffebld_constant_real4_ = NULL;
-#endif
-#if FFETARGET_okREAL5
- ffebld_constant_real5_ = NULL;
-#endif
-#if FFETARGET_okREAL6
- ffebld_constant_real6_ = NULL;
-#endif
-#if FFETARGET_okREAL7
- ffebld_constant_real7_ = NULL;
-#endif
-#if FFETARGET_okREAL8
- ffebld_constant_real8_ = NULL;
-#endif
- ffebld_constant_hollerith_ = NULL;
- for (i = FFEBLD_constTYPELESS_FIRST; i <= FFEBLD_constTYPELESS_LAST; ++i)
- ffebld_constant_typeless_[i - FFEBLD_constTYPELESS_FIRST] = NULL;
-#endif
-}
-
-/* ffebld_list_length -- Return # of opITEMs in list
-
- ffebld list; // Must be NULL or opITEM
- ffebldListLength length;
- length = ffebld_list_length(list);
-
- Returns 0 if list is NULL, 1 if it's ffebld_trail is NULL, and so on. */
-
-ffebldListLength
-ffebld_list_length (ffebld list)
-{
- ffebldListLength length;
-
- for (length = 0; list != NULL; ++length, list = ffebld_trail (list))
- ;
-
- return length;
-}
-
-/* ffebld_new_accter -- Create an ffebld object that is an array
-
- ffebld x;
- ffebldConstantArray a;
- ffebit b;
- x = ffebld_new_accter(a,b); */
-
-ffebld
-ffebld_new_accter (ffebldConstantArray a, ffebit b)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opACCTER;
- x->u.accter.array = a;
- x->u.accter.bits = b;
- return x;
-}
-
-/* ffebld_new_arrter -- Create an ffebld object that is an array
-
- ffebld x;
- ffebldConstantArray a;
- ffetargetOffset size;
- x = ffebld_new_arrter(a,size); */
-
-ffebld
-ffebld_new_arrter (ffebldConstantArray a, ffetargetOffset size)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opARRTER;
- x->u.arrter.array = a;
- x->u.arrter.size = size;
- return x;
-}
-
-/* ffebld_new_conter_with_orig -- Create an ffebld object that is a constant
-
- ffebld x;
- ffebldConstant c;
- x = ffebld_new_conter_with_orig(c,NULL); */
-
-ffebld
-ffebld_new_conter_with_orig (ffebldConstant c, ffebld o)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opCONTER;
- x->u.conter.expr = c;
- x->u.conter.orig = o;
- return x;
-}
-
-/* ffebld_new_item -- Create an ffebld item object
-
- ffebld x,y,z;
- x = ffebld_new_item(y,z); */
-
-ffebld
-ffebld_new_item (ffebld head, ffebld trail)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opITEM;
- x->u.item.head = head;
- x->u.item.trail = trail;
- return x;
-}
-
-/* ffebld_new_labter -- Create an ffebld object that is a label
-
- ffebld x;
- ffelab l;
- x = ffebld_new_labter(c); */
-
-ffebld
-ffebld_new_labter (ffelab l)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opLABTER;
- x->u.labter = l;
- return x;
-}
-
-/* ffebld_new_labtok -- Create object that is a label's NUMBER token
-
- ffebld x;
- ffelexToken t;
- x = ffebld_new_labter(c);
-
- Like the other ffebld_new_ functions, the
- supplied argument is stored exactly as is: ffelex_token_use is NOT
- called, so the token is "consumed", if one is indeed supplied (it may
- be NULL). */
-
-ffebld
-ffebld_new_labtok (ffelexToken t)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opLABTOK;
- x->u.labtok = t;
- return x;
-}
-
-/* ffebld_new_none -- Create an ffebld object with no arguments
-
- ffebld x;
- x = ffebld_new_none(FFEBLD_opWHATEVER); */
-
-ffebld
-ffebld_new_none (ffebldOp o)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = o;
- return x;
-}
-
-/* ffebld_new_one -- Create an ffebld object with one argument
-
- ffebld x,y;
- x = ffebld_new_one(FFEBLD_opWHATEVER,y); */
-
-ffebld
-ffebld_new_one (ffebldOp o, ffebld left)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = o;
- x->u.nonter.left = left;
- return x;
-}
-
-/* ffebld_new_symter -- Create an ffebld object that is a symbol
-
- ffebld x;
- ffesymbol s;
- ffeintrinGen gen; // Generic intrinsic id, if any
- ffeintrinSpec spec; // Specific intrinsic id, if any
- ffeintrinImp imp; // Implementation intrinsic id, if any
- x = ffebld_new_symter (s, gen, spec, imp); */
-
-ffebld
-ffebld_new_symter (ffesymbol s, ffeintrinGen gen, ffeintrinSpec spec,
- ffeintrinImp imp)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = FFEBLD_opSYMTER;
- x->u.symter.symbol = s;
- x->u.symter.generic = gen;
- x->u.symter.specific = spec;
- x->u.symter.implementation = imp;
- x->u.symter.do_iter = FALSE;
- return x;
-}
-
-/* ffebld_new_two -- Create an ffebld object with two arguments
-
- ffebld x,y,z;
- x = ffebld_new_two(FFEBLD_opWHATEVER,y,z); */
-
-ffebld
-ffebld_new_two (ffebldOp o, ffebld left, ffebld right)
-{
- ffebld x;
-
- x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
- x->op = o;
- x->u.nonter.left = left;
- x->u.nonter.right = right;
- return x;
-}
-
-/* ffebld_pool_pop -- Pop ffebld's pool stack
-
- ffebld_pool_pop(); */
-
-void
-ffebld_pool_pop ()
-{
- ffebldPoolstack_ ps;
-
- assert (ffebld_pool_stack_.next != NULL);
- ps = ffebld_pool_stack_.next;
- ffebld_pool_stack_.next = ps->next;
- ffebld_pool_stack_.pool = ps->pool;
- malloc_kill_ks (malloc_pool_image (), ps, sizeof (*ps));
-}
-
-/* ffebld_pool_push -- Push ffebld's pool stack
-
- ffebld_pool_push(); */
-
-void
-ffebld_pool_push (mallocPool pool)
-{
- ffebldPoolstack_ ps;
-
- ps = malloc_new_ks (malloc_pool_image (), "Pool stack", sizeof (*ps));
- ps->next = ffebld_pool_stack_.next;
- ps->pool = ffebld_pool_stack_.pool;
- ffebld_pool_stack_.next = ps;
- ffebld_pool_stack_.pool = pool;
-}
-
-/* ffebld_op_string -- Return short string describing op
-
- ffebldOp o;
- ffebld_op_string(o);
-
- Returns a short string (uppercase) containing the name of the op. */
-
-char *
-ffebld_op_string (ffebldOp o)
-{
- if (o >= ARRAY_SIZE (ffebld_op_string_))
- return "?\?\?";
- return ffebld_op_string_[o];
-}
-
-/* ffebld_size_max -- Return maximum possible size of CHARACTER-type expr
-
- ffetargetCharacterSize sz;
- ffebld b;
- sz = ffebld_size_max (b);
-
- Like ffebld_size_known, but if that would return NONE and the expression
- is opSUBSTR, opCONVERT, opPAREN, or opCONCATENATE, returns ffebld_size_max
- of the subexpression(s). */
-
-ffetargetCharacterSize
-ffebld_size_max (ffebld b)
-{
- ffetargetCharacterSize sz;
-
-recurse: /* :::::::::::::::::::: */
-
- sz = ffebld_size_known (b);
-
- if (sz != FFETARGET_charactersizeNONE)
- return sz;
-
- switch (ffebld_op (b))
- {
- case FFEBLD_opSUBSTR:
- case FFEBLD_opCONVERT:
- case FFEBLD_opPAREN:
- b = ffebld_left (b);
- goto recurse; /* :::::::::::::::::::: */
-
- case FFEBLD_opCONCATENATE:
- sz = ffebld_size_max (ffebld_left (b))
- + ffebld_size_max (ffebld_right (b));
- return sz;
-
- default:
- return sz;
- }
-}
+ x->u.accter.pad = 0;
+ x->u.arrter.pad = 0;
+ x->u.conter.pad = 0;
diff --git a/gcc/f/bld.h b/gcc/f/bld.h
index a9dbe9f2e03..071d78230a1 100644
--- a/gcc/f/bld.h
+++ b/gcc/f/bld.h
@@ -1,1009 +1,16 @@
-/* bld.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- bld.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_bld
-#define _H_f_bld
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFEBLD_constNONE,
- FFEBLD_constINTEGER1,
- FFEBLD_constINTEGER2,
- FFEBLD_constINTEGER3,
- FFEBLD_constINTEGER4,
- FFEBLD_constINTEGER5,
- FFEBLD_constINTEGER6,
- FFEBLD_constINTEGER7,
- FFEBLD_constINTEGER8,
- FFEBLD_constLOGICAL1,
- FFEBLD_constLOGICAL2,
- FFEBLD_constLOGICAL3,
- FFEBLD_constLOGICAL4,
- FFEBLD_constLOGICAL5,
- FFEBLD_constLOGICAL6,
- FFEBLD_constLOGICAL7,
- FFEBLD_constLOGICAL8,
- FFEBLD_constREAL1,
- FFEBLD_constREAL2,
- FFEBLD_constREAL3,
- FFEBLD_constREAL4,
- FFEBLD_constREAL5,
- FFEBLD_constREAL6,
- FFEBLD_constREAL7,
- FFEBLD_constREAL8,
- FFEBLD_constCOMPLEX1,
- FFEBLD_constCOMPLEX2,
- FFEBLD_constCOMPLEX3,
- FFEBLD_constCOMPLEX4,
- FFEBLD_constCOMPLEX5,
- FFEBLD_constCOMPLEX6,
- FFEBLD_constCOMPLEX7,
- FFEBLD_constCOMPLEX8,
- FFEBLD_constCHARACTER1,
- FFEBLD_constCHARACTER2,
- FFEBLD_constCHARACTER3,
- FFEBLD_constCHARACTER4,
- FFEBLD_constCHARACTER5,
- FFEBLD_constCHARACTER6,
- FFEBLD_constCHARACTER7,
- FFEBLD_constCHARACTER8,
- FFEBLD_constHOLLERITH,
- FFEBLD_constTYPELESS_FIRST,
- FFEBLD_constBINARY_MIL = FFEBLD_constTYPELESS_FIRST,
- FFEBLD_constBINARY_VXT,
- FFEBLD_constOCTAL_MIL,
- FFEBLD_constOCTAL_VXT,
- FFEBLD_constHEX_X_MIL,
- FFEBLD_constHEX_X_VXT,
- FFEBLD_constHEX_Z_MIL,
- FFEBLD_constHEX_Z_VXT,
- FFEBLD_constTYPELESS_LAST = FFEBLD_constHEX_Z_VXT,
- FFEBLD_const
- } ffebldConst;
-
-typedef enum
- {
-#define FFEBLD_OP(KWD,NAME,ARITY) KWD,
-#include "bld-op.def"
-#undef FFEBLD_OP
- FFEBLD_op
- } ffebldOp;
-
-/* Typedefs. */
-
-typedef struct _ffebld_ *ffebld;
-typedef unsigned char ffebldArity;
-typedef union _ffebld_constant_array_ ffebldConstantArray;
-typedef struct _ffebld_constant_ *ffebldConstant;
-typedef union _ffebld_constant_union_ ffebldConstantUnion;
-typedef ffebld *ffebldListBottom;
-typedef unsigned int ffebldListLength;
-#define ffebldListLength_f ""
-typedef struct _ffebld_pool_stack_ *ffebldPoolstack_;
-
-/* Include files needed by this one. */
-
-#include "bit.h"
-#include "com.h"
-#include "info.h"
-#include "intrin.h"
-#include "lab.h"
-#include "lex.h"
-#include "malloc.h"
-#include "symbol.h"
-#include "target.h"
-
-#define FFEBLD_whereconstPROGUNIT_ 1
-#define FFEBLD_whereconstFILE_ 2
-
+ Contributed by James Craig Burley (burley@gnu.org).
+ ffetargetAlign pad; /* Initial padding (for DATA, etc.). */
+ ffetargetAlign pad; /* Initial padding (for DATA, etc.). */
+ ffetargetAlign pad; /* Initial padding (for DATA, etc.). */
#if FFECOM_targetCURRENT == FFECOM_targetFFE
-#define FFEBLD_whereconstCURRENT_ FFEBLD_whereconstPROGUNIT_
-#elif FFECOM_targetCURRENT == FFECOM_targetGCC
-#define FFEBLD_whereconstCURRENT_ FFEBLD_whereconstFILE_
-#else
-#error
#endif
-
-/* Structure definitions. */
-
-#define FFEBLD_constINTEGERDEFAULT FFEBLD_constINTEGER1
-#define FFEBLD_constLOGICALDEFAULT FFEBLD_constLOGICAL1
-#define FFEBLD_constREALDEFAULT FFEBLD_constREAL1
-#define FFEBLD_constREALDOUBLE FFEBLD_constREAL2
-#define FFEBLD_constREALQUAD FFEBLD_constREAL3
-#define FFEBLD_constCOMPLEX FFEBLD_constCOMPLEX1
-#define FFEBLD_constCOMPLEXDOUBLE FFEBLD_constCOMPLEX2
-#define FFEBLD_constCOMPLEXQUAD FFEBLD_constCOMPLEX3
-#define FFEBLD_constCHARACTERDEFAULT FFEBLD_constCHARACTER1
-
-union _ffebld_constant_union_
- {
- ffetargetTypeless typeless;
- ffetargetHollerith hollerith;
-#if FFETARGET_okINTEGER1
- ffetargetInteger1 integer1;
-#endif
-#if FFETARGET_okINTEGER2
- ffetargetInteger2 integer2;
-#endif
-#if FFETARGET_okINTEGER3
- ffetargetInteger3 integer3;
-#endif
-#if FFETARGET_okINTEGER4
- ffetargetInteger4 integer4;
-#endif
-#if FFETARGET_okINTEGER5
- ffetargetInteger5 integer5;
-#endif
-#if FFETARGET_okINTEGER6
- ffetargetInteger6 integer6;
-#endif
-#if FFETARGET_okINTEGER7
- ffetargetInteger7 integer7;
-#endif
-#if FFETARGET_okINTEGER8
- ffetargetInteger8 integer8;
-#endif
-#if FFETARGET_okLOGICAL1
- ffetargetLogical1 logical1;
-#endif
-#if FFETARGET_okLOGICAL2
- ffetargetLogical2 logical2;
-#endif
-#if FFETARGET_okLOGICAL3
- ffetargetLogical3 logical3;
-#endif
-#if FFETARGET_okLOGICAL4
- ffetargetLogical4 logical4;
-#endif
-#if FFETARGET_okLOGICAL5
- ffetargetLogical5 logical5;
-#endif
-#if FFETARGET_okLOGICAL6
- ffetargetLogical6 logical6;
-#endif
-#if FFETARGET_okLOGICAL7
- ffetargetLogical7 logical7;
-#endif
-#if FFETARGET_okLOGICAL8
- ffetargetLogical8 logical8;
-#endif
-#if FFETARGET_okREAL1
- ffetargetReal1 real1;
-#endif
-#if FFETARGET_okREAL2
- ffetargetReal2 real2;
-#endif
-#if FFETARGET_okREAL3
- ffetargetReal3 real3;
-#endif
-#if FFETARGET_okREAL4
- ffetargetReal4 real4;
-#endif
-#if FFETARGET_okREAL5
- ffetargetReal5 real5;
-#endif
-#if FFETARGET_okREAL6
- ffetargetReal6 real6;
-#endif
-#if FFETARGET_okREAL7
- ffetargetReal7 real7;
-#endif
-#if FFETARGET_okREAL8
- ffetargetReal8 real8;
-#endif
-#if FFETARGET_okCOMPLEX1
- ffetargetComplex1 complex1;
-#endif
-#if FFETARGET_okCOMPLEX2
- ffetargetComplex2 complex2;
-#endif
-#if FFETARGET_okCOMPLEX3
- ffetargetComplex3 complex3;
-#endif
-#if FFETARGET_okCOMPLEX4
- ffetargetComplex4 complex4;
-#endif
-#if FFETARGET_okCOMPLEX5
- ffetargetComplex5 complex5;
-#endif
-#if FFETARGET_okCOMPLEX6
- ffetargetComplex6 complex6;
-#endif
-#if FFETARGET_okCOMPLEX7
- ffetargetComplex7 complex7;
-#endif
-#if FFETARGET_okCOMPLEX8
- ffetargetComplex8 complex8;
-#endif
-#if FFETARGET_okCHARACTER1
- ffetargetCharacter1 character1;
-#endif
-#if FFETARGET_okCHARACTER2
- ffetargetCharacter2 character2;
-#endif
-#if FFETARGET_okCHARACTER3
- ffetargetCharacter3 character3;
-#endif
-#if FFETARGET_okCHARACTER4
- ffetargetCharacter4 character4;
-#endif
-#if FFETARGET_okCHARACTER5
- ffetargetCharacter5 character5;
-#endif
-#if FFETARGET_okCHARACTER6
- ffetargetCharacter6 character6;
-#endif
-#if FFETARGET_okCHARACTER7
- ffetargetCharacter7 character7;
-#endif
-#if FFETARGET_okCHARACTER8
- ffetargetCharacter8 character8;
-#endif
- };
-
-union _ffebld_constant_array_
- {
-#if FFETARGET_okINTEGER1
- ffetargetInteger1 *integer1;
-#endif
-#if FFETARGET_okINTEGER2
- ffetargetInteger2 *integer2;
-#endif
-#if FFETARGET_okINTEGER3
- ffetargetInteger3 *integer3;
-#endif
-#if FFETARGET_okINTEGER4
- ffetargetInteger4 *integer4;
-#endif
-#if FFETARGET_okINTEGER5
- ffetargetInteger5 *integer5;
-#endif
-#if FFETARGET_okINTEGER6
- ffetargetInteger6 *integer6;
-#endif
-#if FFETARGET_okINTEGER7
- ffetargetInteger7 *integer7;
-#endif
-#if FFETARGET_okINTEGER8
- ffetargetInteger8 *integer8;
-#endif
-#if FFETARGET_okLOGICAL1
- ffetargetLogical1 *logical1;
-#endif
-#if FFETARGET_okLOGICAL2
- ffetargetLogical2 *logical2;
-#endif
-#if FFETARGET_okLOGICAL3
- ffetargetLogical3 *logical3;
-#endif
-#if FFETARGET_okLOGICAL4
- ffetargetLogical4 *logical4;
-#endif
-#if FFETARGET_okLOGICAL5
- ffetargetLogical5 *logical5;
-#endif
-#if FFETARGET_okLOGICAL6
- ffetargetLogical6 *logical6;
-#endif
-#if FFETARGET_okLOGICAL7
- ffetargetLogical7 *logical7;
-#endif
-#if FFETARGET_okLOGICAL8
- ffetargetLogical8 *logical8;
-#endif
-#if FFETARGET_okREAL1
- ffetargetReal1 *real1;
-#endif
-#if FFETARGET_okREAL2
- ffetargetReal2 *real2;
-#endif
-#if FFETARGET_okREAL3
- ffetargetReal3 *real3;
-#endif
-#if FFETARGET_okREAL4
- ffetargetReal4 *real4;
-#endif
-#if FFETARGET_okREAL5
- ffetargetReal5 *real5;
-#endif
-#if FFETARGET_okREAL6
- ffetargetReal6 *real6;
-#endif
-#if FFETARGET_okREAL7
- ffetargetReal7 *real7;
-#endif
-#if FFETARGET_okREAL8
- ffetargetReal8 *real8;
-#endif
-#if FFETARGET_okCOMPLEX1
- ffetargetComplex1 *complex1;
-#endif
-#if FFETARGET_okCOMPLEX2
- ffetargetComplex2 *complex2;
-#endif
-#if FFETARGET_okCOMPLEX3
- ffetargetComplex3 *complex3;
-#endif
-#if FFETARGET_okCOMPLEX4
- ffetargetComplex4 *complex4;
-#endif
-#if FFETARGET_okCOMPLEX5
- ffetargetComplex5 *complex5;
-#endif
-#if FFETARGET_okCOMPLEX6
- ffetargetComplex6 *complex6;
-#endif
-#if FFETARGET_okCOMPLEX7
- ffetargetComplex7 *complex7;
-#endif
-#if FFETARGET_okCOMPLEX8
- ffetargetComplex8 *complex8;
-#endif
-#if FFETARGET_okCHARACTER1
- ffetargetCharacterUnit1 *character1;
-#endif
-#if FFETARGET_okCHARACTER2
- ffetargetCharacterUnit2 *character2;
-#endif
-#if FFETARGET_okCHARACTER3
- ffetargetCharacterUnit3 *character3;
-#endif
-#if FFETARGET_okCHARACTER4
- ffetargetCharacterUnit4 *character4;
-#endif
-#if FFETARGET_okCHARACTER5
- ffetargetCharacterUnit5 *character5;
-#endif
-#if FFETARGET_okCHARACTER6
- ffetargetCharacterUnit6 *character6;
-#endif
-#if FFETARGET_okCHARACTER7
- ffetargetCharacterUnit7 *character7;
-#endif
-#if FFETARGET_okCHARACTER8
- ffetargetCharacterUnit8 *character8;
-#endif
- };
-
-struct _ffebld_
- {
- ffebldOp op;
- ffeinfo info; /* Not used or valid for
- op=={STAR,ITEM,BOUNDS,REPEAT,LABTER,
- LABTOK,IMPDO}. */
- union
- {
- struct
- {
- ffebld left;
- ffebld right;
- }
- nonter;
- struct
- {
- ffebld head;
- ffebld trail;
- }
- item;
- struct
- {
- ffebldConstant expr;
- ffebld orig; /* Original expression, or NULL if none. */
- }
- conter;
- struct
- {
- ffebldConstantArray array;
- ffetargetOffset size;
- }
- arrter;
- struct
- {
- ffebldConstantArray array;
- ffebit bits;
- }
- accter;
- struct
- {
- ffesymbol symbol;
- ffeintrinGen generic; /* Id for generic intrinsic. */
- ffeintrinSpec specific; /* Id for specific intrinsic. */
- ffeintrinImp implementation; /* Id for implementation. */
- bool do_iter; /* TRUE if this ref is a read-only ref by
- definition (ref within DO loop using this
- var as iterator). */
- }
- symter;
- ffelab labter;
- ffelexToken labtok;
- }
- u;
- };
-
-struct _ffebld_constant_
- {
- ffebldConstant next;
- ffebldConstant first_complex; /* First complex const with me as
- real. */
- ffebldConstant negated; /* We point to each other through here. */
- ffebldConst consttype;
-#ifdef FFECOM_constantHOOK
- ffecomConstant hook; /* Whatever the compiler/backend wants! */
-#endif
- bool numeric; /* A numeric kind of constant. */
- ffebldConstantUnion u;
- };
-
-struct _ffebld_pool_stack_
- {
- ffebldPoolstack_ next;
- mallocPool pool;
- };
-
-/* Global objects accessed by users of this module. */
-
-extern ffebldArity ffebld_arity_op_[];
-extern struct _ffebld_pool_stack_ ffebld_pool_stack_;
-
-/* Declare functions with prototypes. */
-
-int ffebld_constant_cmp (ffebldConstant c1, ffebldConstant c2);
-void ffebld_constant_dump (ffebldConstant c);
-bool ffebld_constant_is_magical (ffebldConstant c);
-bool ffebld_constant_is_zero (ffebldConstant c);
-#if FFETARGET_okCHARACTER1
-ffebldConstant ffebld_constant_new_character1 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character1_val (ffetargetCharacter1 val);
-#endif
-#if FFETARGET_okCHARACTER2
-ffebldConstant ffebld_constant_new_character2 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character2_val (ffetargetCharacter2 val);
-#endif
-#if FFETARGET_okCHARACTER3
-ffebldConstant ffebld_constant_new_character3 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character3_val (ffetargetCharacter3 val);
-#endif
-#if FFETARGET_okCHARACTER4
-ffebldConstant ffebld_constant_new_character4 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character4_val (ffetargetCharacter4 val);
-#endif
-#if FFETARGET_okCHARACTER5
-ffebldConstant ffebld_constant_new_character5 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character5_val (ffetargetCharacter5 val);
-#endif
-#if FFETARGET_okCHARACTER6
-ffebldConstant ffebld_constant_new_character6 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character6_val (ffetargetCharacter6 val);
-#endif
-#if FFETARGET_okCHARACTER7
-ffebldConstant ffebld_constant_new_character7 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character7_val (ffetargetCharacter7 val);
-#endif
-#if FFETARGET_okCHARACTER8
-ffebldConstant ffebld_constant_new_character8 (ffelexToken t);
-ffebldConstant ffebld_constant_new_character8_val (ffetargetCharacter8 val);
-#endif
-#if FFETARGET_okCOMPLEX1
-ffebldConstant ffebld_constant_new_complex1 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex1_val (ffetargetComplex1 val);
-#endif
-#if FFETARGET_okCOMPLEX2
-ffebldConstant ffebld_constant_new_complex2 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex2_val (ffetargetComplex2 val);
-#endif
-#if FFETARGET_okCOMPLEX3
-ffebldConstant ffebld_constant_new_complex3 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex3_val (ffetargetComplex3 val);
-#endif
-#if FFETARGET_okCOMPLEX4
-ffebldConstant ffebld_constant_new_complex4 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex4_val (ffetargetComplex4 val);
-#endif
-#if FFETARGET_okCOMPLEX5
-ffebldConstant ffebld_constant_new_complex5 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex5_val (ffetargetComplex5 val);
-#endif
-#if FFETARGET_okCOMPLEX6
-ffebldConstant ffebld_constant_new_complex6 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex6_val (ffetargetComplex6 val);
-#endif
-#if FFETARGET_okCOMPLEX7
-ffebldConstant ffebld_constant_new_complex7 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex7_val (ffetargetComplex7 val);
-#endif
-#if FFETARGET_okCOMPLEX8
-ffebldConstant ffebld_constant_new_complex8 (ffebldConstant real,
- ffebldConstant imaginary);
-ffebldConstant ffebld_constant_new_complex8_val (ffetargetComplex8 val);
-#endif
-ffebldConstant ffebld_constant_new_hollerith (ffelexToken t);
-ffebldConstant ffebld_constant_new_hollerith_val (ffetargetHollerith val);
-#if FFETARGET_okINTEGER1
-ffebldConstant ffebld_constant_new_integer1 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer1_val (ffetargetInteger1 val);
-#endif
-#if FFETARGET_okINTEGER2
-ffebldConstant ffebld_constant_new_integer2 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer2_val (ffetargetInteger2 val);
-#endif
-#if FFETARGET_okINTEGER3
-ffebldConstant ffebld_constant_new_integer3 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer3_val (ffetargetInteger3 val);
-#endif
-#if FFETARGET_okINTEGER4
-ffebldConstant ffebld_constant_new_integer4 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer4_val (ffetargetInteger4 val);
-#endif
-#if FFETARGET_okINTEGER5
-ffebldConstant ffebld_constant_new_integer5 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer5_val (ffetargetInteger5 val);
-#endif
-#if FFETARGET_okINTEGER6
-ffebldConstant ffebld_constant_new_integer6 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer6_val (ffetargetInteger6 val);
-#endif
-#if FFETARGET_okINTEGER7
-ffebldConstant ffebld_constant_new_integer7 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer7_val (ffetargetInteger7 val);
-#endif
-#if FFETARGET_okINTEGER8
-ffebldConstant ffebld_constant_new_integer8 (ffelexToken t);
-ffebldConstant ffebld_constant_new_integer8_val (ffetargetInteger8 val);
-#endif
-ffebldConstant ffebld_constant_new_integerbinary (ffelexToken t);
-ffebldConstant ffebld_constant_new_integerhex (ffelexToken t);
-ffebldConstant ffebld_constant_new_integeroctal (ffelexToken t);
-#if FFETARGET_okLOGICAL1
-ffebldConstant ffebld_constant_new_logical1 (bool truth);
-ffebldConstant ffebld_constant_new_logical1_val (ffetargetLogical1 val);
-#endif
-#if FFETARGET_okLOGICAL2
-ffebldConstant ffebld_constant_new_logical2 (bool truth);
-ffebldConstant ffebld_constant_new_logical2_val (ffetargetLogical2 val);
-#endif
-#if FFETARGET_okLOGICAL3
-ffebldConstant ffebld_constant_new_logical3 (bool truth);
-ffebldConstant ffebld_constant_new_logical3_val (ffetargetLogical3 val);
-#endif
-#if FFETARGET_okLOGICAL4
-ffebldConstant ffebld_constant_new_logical4 (bool truth);
-ffebldConstant ffebld_constant_new_logical4_val (ffetargetLogical4 val);
-#endif
-#if FFETARGET_okLOGICAL5
-ffebldConstant ffebld_constant_new_logical5 (bool truth);
-ffebldConstant ffebld_constant_new_logical5_val (ffetargetLogical5 val);
-#endif
-#if FFETARGET_okLOGICAL6
-ffebldConstant ffebld_constant_new_logical6 (bool truth);
-ffebldConstant ffebld_constant_new_logical6_val (ffetargetLogical6 val);
-#endif
-#if FFETARGET_okLOGICAL7
-ffebldConstant ffebld_constant_new_logical7 (bool truth);
-ffebldConstant ffebld_constant_new_logical7_val (ffetargetLogical7 val);
-#endif
-#if FFETARGET_okLOGICAL8
-ffebldConstant ffebld_constant_new_logical8 (bool truth);
-ffebldConstant ffebld_constant_new_logical8_val (ffetargetLogical8 val);
-#endif
-#if FFETARGET_okREAL1
-ffebldConstant ffebld_constant_new_real1 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real1_val (ffetargetReal1 val);
-#endif
-#if FFETARGET_okREAL2
-ffebldConstant ffebld_constant_new_real2 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real2_val (ffetargetReal2 val);
-#endif
-#if FFETARGET_okREAL3
-ffebldConstant ffebld_constant_new_real3 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real3_val (ffetargetReal3 val);
-#endif
-#if FFETARGET_okREAL4
-ffebldConstant ffebld_constant_new_real4 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real4_val (ffetargetReal4 val);
-#endif
-#if FFETARGET_okREAL5
-ffebldConstant ffebld_constant_new_real5 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real5_val (ffetargetReal5 val);
-#endif
-#if FFETARGET_okREAL6
-ffebldConstant ffebld_constant_new_real6 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real6_val (ffetargetReal6 val);
-#endif
-#if FFETARGET_okREAL7
-ffebldConstant ffebld_constant_new_real7 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real7_val (ffetargetReal7 val);
-#endif
-#if FFETARGET_okREAL8
-ffebldConstant ffebld_constant_new_real8 (ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction, ffelexToken exponent,
- ffelexToken exponent_sign, ffelexToken exponent_digits);
-ffebldConstant ffebld_constant_new_real8_val (ffetargetReal8 val);
-#endif
-ffebldConstant ffebld_constant_new_typeless_bm (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_bv (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_hxm (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_hxv (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_hzm (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_hzv (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_om (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_ov (ffelexToken t);
-ffebldConstant ffebld_constant_new_typeless_val (ffebldConst type,
- ffetargetTypeless val);
-ffebldConstant ffebld_constant_negated (ffebldConstant c);
-void ffebld_constantarray_dump (ffebldConstantArray array, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset size, ffebit bits);
-ffebldConstantUnion ffebld_constantarray_get (ffebldConstantArray array,
- ffeinfoBasictype bt, ffeinfoKindtype kt, ffetargetOffset offset);
-void ffebld_constantarray_kill (ffebldConstantArray array, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset size);
-ffebldConstantArray ffebld_constantarray_new (ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset size);
-void ffebld_constantarray_prepare (void **aptr, void **cptr, size_t *size,
- ffebldConstantArray array, ffeinfoBasictype abt, ffeinfoKindtype akt,
- ffetargetOffset offset, ffebldConstantUnion *constant,
- ffeinfoBasictype cbt, ffeinfoKindtype ckt);
-void ffebld_constantarray_preparray (void **aptr, void **cptr, size_t *size,
- ffebldConstantArray array, ffeinfoBasictype abt, ffeinfoKindtype akt,
- ffetargetOffset offset, ffebldConstantArray source_array,
- ffeinfoBasictype cbt, ffeinfoKindtype ckt);
-void ffebld_constantarray_put (ffebldConstantArray array, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffetargetOffset offset, ffebldConstantUnion constant);
-void ffebld_constantunion_dump (ffebldConstantUnion u, ffeinfoBasictype bt,
- ffeinfoKindtype kt);
-void ffebld_dump (ffebld b);
-void ffebld_dump_prefix (FILE *out, ffeinfoBasictype bt, ffeinfoKindtype kt);
-void ffebld_init_0 (void);
-void ffebld_init_1 (void);
-void ffebld_init_2 (void);
-ffebldListLength ffebld_list_length (ffebld l);
-ffebld ffebld_new_accter (ffebldConstantArray array, ffebit b);
-ffebld ffebld_new_arrter (ffebldConstantArray array, ffetargetOffset size);
-ffebld ffebld_new_conter_with_orig (ffebldConstant c, ffebld orig);
-ffebld ffebld_new_item (ffebld head, ffebld trail);
-ffebld ffebld_new_labter (ffelab l);
-ffebld ffebld_new_labtok (ffelexToken t);
-ffebld ffebld_new_none (ffebldOp o);
-ffebld ffebld_new_symter (ffesymbol s, ffeintrinGen gen, ffeintrinSpec spec,
- ffeintrinImp imp);
-ffebld ffebld_new_one (ffebldOp o, ffebld left);
-ffebld ffebld_new_two (ffebldOp o, ffebld left, ffebld right);
-char *ffebld_op_string (ffebldOp o);
-void ffebld_pool_pop (void);
-void ffebld_pool_push (mallocPool pool);
-ffetargetCharacterSize ffebld_size_max (ffebld b);
-
-/* Define macros. */
-
-#define ffebld_accter(b) ((b)->u.accter.array)
-#define ffebld_accter_bits(b) ((b)->u.accter.bits)
-#define ffebld_accter_set_bits(b,bt) ((b)->u.accter.bits = (bt))
-#define ffebld_accter_size(b) ffebit_size((b)->u.accter.bits)
-#define ffebld_append_item(b,i) (**(b) = ffebld_new_item((i),NULL), \
- *(b) = &((**(b))->u.item.trail))
-#define ffebld_arity(b) ffebld_arity_op(ffebld_op(b))
-#define ffebld_arity_op(o) (ffebld_arity_op_[o])
-#define ffebld_arrter(b) ((b)->u.arrter.array)
-#define ffebld_arrter_set_size(b,s) ((b)->u.arrter.size = (s))
-#define ffebld_arrter_size(b) ((b)->u.arrter.size)
-#if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
-#define ffebld_constant_pool() ffe_pool_program_unit()
-#elif FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstFILE_
-#define ffebld_constant_pool() ffe_pool_file()
-#else
-#error
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-#define ffebld_constant_character1(c) ((c)->u.character1)
-#define ffebld_constant_character2(c) ((c)->u.character2)
-#define ffebld_constant_character3(c) ((c)->u.character3)
-#define ffebld_constant_character4(c) ((c)->u.character4)
-#define ffebld_constant_character5(c) ((c)->u.character5)
-#define ffebld_constant_character6(c) ((c)->u.character6)
-#define ffebld_constant_character7(c) ((c)->u.character7)
-#define ffebld_constant_character8(c) ((c)->u.character8)
-#define ffebld_constant_characterdefault ffebld_constant_character1
-#define ffebld_constant_complex1(c) ((c)->u.complex1)
-#define ffebld_constant_complex2(c) ((c)->u.complex2)
-#define ffebld_constant_complex3(c) ((c)->u.complex3)
-#define ffebld_constant_complex4(c) ((c)->u.complex4)
-#define ffebld_constant_complex5(c) ((c)->u.complex5)
-#define ffebld_constant_complex6(c) ((c)->u.complex6)
-#define ffebld_constant_complex7(c) ((c)->u.complex7)
-#define ffebld_constant_complex8(c) ((c)->u.complex8)
-#define ffebld_constant_complexdefault ffebld_constant_complex1
-#define ffebld_constant_complexdouble ffebld_constant_complex2
-#define ffebld_constant_complexquad ffebld_constant_complex3
-#define ffebld_constant_copy(c) (c)
-#define ffebld_constant_hollerith(c) ((c)->u.hollerith)
-#define ffebld_constant_hook(c) ((c)->hook)
-#define ffebld_constant_integer1(c) ((c)->u.integer1)
-#define ffebld_constant_integer2(c) ((c)->u.integer2)
-#define ffebld_constant_integer3(c) ((c)->u.integer3)
-#define ffebld_constant_integer4(c) ((c)->u.integer4)
-#define ffebld_constant_integer5(c) ((c)->u.integer5)
-#define ffebld_constant_integer6(c) ((c)->u.integer6)
-#define ffebld_constant_integer7(c) ((c)->u.integer7)
-#define ffebld_constant_integer8(c) ((c)->u.integer8)
-#define ffebld_constant_integerdefault ffebld_constant_integer1
-#define ffebld_constant_is_numeric(c) ((c)->numeric)
-#define ffebld_constant_logical1(c) ((c)->u.logical1)
-#define ffebld_constant_logical2(c) ((c)->u.logical2)
-#define ffebld_constant_logical3(c) ((c)->u.logical3)
-#define ffebld_constant_logical4(c) ((c)->u.logical4)
-#define ffebld_constant_logical5(c) ((c)->u.logical5)
-#define ffebld_constant_logical6(c) ((c)->u.logical6)
-#define ffebld_constant_logical7(c) ((c)->u.logical7)
-#define ffebld_constant_logical8(c) ((c)->u.logical8)
-#define ffebld_constant_logicaldefault ffebld_constant_logical1
-#define ffebld_constant_new_characterdefault ffebld_constant_new_character1
-#define ffebld_constant_new_characterdefault_val ffebld_constant_new_character1_val
-#define ffebld_constant_new_complexdefault ffebld_constant_new_complex1
-#define ffebld_constant_new_complexdefault_val ffebld_constant_new_complex1_val
-#define ffebld_constant_new_complexdouble ffebld_constant_new_complex2
-#define ffebld_constant_new_complexdouble_val ffebld_constant_new_complex2_val
-#define ffebld_constant_new_complexquad ffebld_constant_new_complex3
-#define ffebld_constant_new_complexquad_valffebld_constant_new_complex3_val
-#define ffebld_constant_new_integerdefault ffebld_constant_new_integer1
-#define ffebld_constant_new_integerdefault_val ffebld_constant_new_integer1_val
-#define ffebld_constant_new_logicaldefault ffebld_constant_new_logical1
-#define ffebld_constant_new_logicaldefault_val ffebld_constant_new_logical1_val
-#define ffebld_constant_new_realdefault ffebld_constant_new_real1
-#define ffebld_constant_new_realdefault_val ffebld_constant_new_real1_val
-#define ffebld_constant_new_realdouble ffebld_constant_new_real2
-#define ffebld_constant_new_realdouble_val ffebld_constant_new_real2_val
-#define ffebld_constant_new_realquad ffebld_constant_new_real3
-#define ffebld_constant_new_realquad_val ffebld_constant_new_real3_val
-#define ffebld_constant_ptr_to_union(c) (&(c)->u)
-#define ffebld_constant_real1(c) ((c)->u.real1)
-#define ffebld_constant_real2(c) ((c)->u.real2)
-#define ffebld_constant_real3(c) ((c)->u.real3)
-#define ffebld_constant_real4(c) ((c)->u.real4)
-#define ffebld_constant_real5(c) ((c)->u.real5)
-#define ffebld_constant_real6(c) ((c)->u.real6)
-#define ffebld_constant_real7(c) ((c)->u.real7)
-#define ffebld_constant_real8(c) ((c)->u.real8)
-#define ffebld_constant_realdefault ffebld_constant_real1
-#define ffebld_constant_realdouble ffebld_constant_real2
-#define ffebld_constant_realquad ffebld_constant_real3
-#define ffebld_constant_set_hook(c,h) ((c)->hook = (h))
-#define ffebld_constant_set_union(c,un) ((c)->u = (un))
-#define ffebld_constant_type(c) ((c)->consttype)
-#define ffebld_constant_typeless(c) ((c)->u.typeless)
-#define ffebld_constant_union(c) ((c)->u)
-#define ffebld_conter(b) ((b)->u.conter.expr)
-#define ffebld_conter_orig(b) ((b)->u.conter.orig)
-#define ffebld_conter_set_orig(b,o) ((b)->u.conter.orig = (o))
-#define ffebld_copy(b) (b) /* ~~~Someday really make a copy. */
-#define ffebld_cu_ptr_typeless(u) &(u).typeless
-#define ffebld_cu_ptr_hollerith(u) &(u).hollerith
-#define ffebld_cu_ptr_integer1(u) &(u).integer1
-#define ffebld_cu_ptr_integer2(u) &(u).integer2
-#define ffebld_cu_ptr_integer3(u) &(u).integer3
-#define ffebld_cu_ptr_integer4(u) &(u).integer4
-#define ffebld_cu_ptr_integer5(u) &(u).integer5
-#define ffebld_cu_ptr_integer6(u) &(u).integer6
-#define ffebld_cu_ptr_integer7(u) &(u).integer7
-#define ffebld_cu_ptr_integer8(u) &(u).integer8
-#define ffebld_cu_ptr_integerdefault ffebld_cu_ptr_integer1
-#define ffebld_cu_ptr_logical1(u) &(u).logical1
-#define ffebld_cu_ptr_logical2(u) &(u).logical2
-#define ffebld_cu_ptr_logical3(u) &(u).logical3
-#define ffebld_cu_ptr_logical4(u) &(u).logical4
-#define ffebld_cu_ptr_logical5(u) &(u).logical5
-#define ffebld_cu_ptr_logical6(u) &(u).logical6
-#define ffebld_cu_ptr_logical7(u) &(u).logical7
-#define ffebld_cu_ptr_logical8(u) &(u).logical8
-#define ffebld_cu_ptr_logicaldefault ffebld_cu_ptr_logical1
-#define ffebld_cu_ptr_real1(u) &(u).real1
-#define ffebld_cu_ptr_real2(u) &(u).real2
-#define ffebld_cu_ptr_real3(u) &(u).real3
-#define ffebld_cu_ptr_real4(u) &(u).real4
-#define ffebld_cu_ptr_real5(u) &(u).real5
-#define ffebld_cu_ptr_real6(u) &(u).real6
-#define ffebld_cu_ptr_real7(u) &(u).real7
-#define ffebld_cu_ptr_real8(u) &(u).real8
-#define ffebld_cu_ptr_realdefault ffebld_cu_ptr_real1
-#define ffebld_cu_ptr_realdouble ffebld_cu_ptr_real2
-#define ffebld_cu_ptr_realquad ffebld_cu_ptr_real3
-#define ffebld_cu_ptr_complex1(u) &(u).complex1
-#define ffebld_cu_ptr_complex2(u) &(u).complex2
-#define ffebld_cu_ptr_complex3(u) &(u).complex3
-#define ffebld_cu_ptr_complex4(u) &(u).complex4
-#define ffebld_cu_ptr_complex5(u) &(u).complex5
-#define ffebld_cu_ptr_complex6(u) &(u).complex6
-#define ffebld_cu_ptr_complex7(u) &(u).complex7
-#define ffebld_cu_ptr_complex8(u) &(u).complex8
-#define ffebld_cu_ptr_complexdefault ffebld_cu_ptr_complex1
-#define ffebld_cu_ptr_complexdouble ffebld_cu_ptr_complex2
-#define ffebld_cu_ptr_complexquad ffebld_cu_ptr_complex3
-#define ffebld_cu_ptr_character1(u) &(u).character1
-#define ffebld_cu_ptr_character2(u) &(u).character2
-#define ffebld_cu_ptr_character3(u) &(u).character3
-#define ffebld_cu_ptr_character4(u) &(u).character4
-#define ffebld_cu_ptr_character5(u) &(u).character5
-#define ffebld_cu_ptr_character6(u) &(u).character6
-#define ffebld_cu_ptr_character7(u) &(u).character7
-#define ffebld_cu_ptr_character8(u) &(u).character8
-#define ffebld_cu_val_typeless(u) (u).typeless
-#define ffebld_cu_val_hollerith(u) (u).hollerith
-#define ffebld_cu_val_integer1(u) (u).integer1
-#define ffebld_cu_val_integer2(u) (u).integer2
-#define ffebld_cu_val_integer3(u) (u).integer3
-#define ffebld_cu_val_integer4(u) (u).integer4
-#define ffebld_cu_val_integer5(u) (u).integer5
-#define ffebld_cu_val_integer6(u) (u).integer6
-#define ffebld_cu_val_integer7(u) (u).integer7
-#define ffebld_cu_val_integer8(u) (u).integer8
-#define ffebld_cu_val_integerdefault ffebld_cu_val_integer1
-#define ffebld_cu_val_logical1(u) (u).logical1
-#define ffebld_cu_val_logical2(u) (u).logical2
-#define ffebld_cu_val_logical3(u) (u).logical3
-#define ffebld_cu_val_logical4(u) (u).logical4
-#define ffebld_cu_val_logical5(u) (u).logical5
-#define ffebld_cu_val_logical6(u) (u).logical6
-#define ffebld_cu_val_logical7(u) (u).logical7
-#define ffebld_cu_val_logical8(u) (u).logical8
-#define ffebld_cu_val_logicaldefault ffebld_cu_val_logical
-#define ffebld_cu_val_real1(u) (u).real1
-#define ffebld_cu_val_real2(u) (u).real2
-#define ffebld_cu_val_real3(u) (u).real3
-#define ffebld_cu_val_real4(u) (u).real4
-#define ffebld_cu_val_real5(u) (u).real5
-#define ffebld_cu_val_real6(u) (u).real6
-#define ffebld_cu_val_real7(u) (u).real7
-#define ffebld_cu_val_real8(u) (u).real8
-#define ffebld_cu_val_realdefault ffebld_cu_val_real1
-#define ffebld_cu_val_realdouble ffebld_cu_val_real2
-#define ffebld_cu_val_realquad ffebld_cu_val_real3
-#define ffebld_cu_val_complex1(u) (u).complex1
-#define ffebld_cu_val_complex2(u) (u).complex2
-#define ffebld_cu_val_complex3(u) (u).complex3
-#define ffebld_cu_val_complex4(u) (u).complex4
-#define ffebld_cu_val_complex5(u) (u).complex5
-#define ffebld_cu_val_complex6(u) (u).complex6
-#define ffebld_cu_val_complex7(u) (u).complex7
-#define ffebld_cu_val_complex8(u) (u).complex8
-#define ffebld_cu_val_complexdefault ffebld_cu_val_complex1
-#define ffebld_cu_val_complexdouble ffebld_cu_val_complex2
-#define ffebld_cu_val_complexquad ffebld_cu_val_complex3
-#define ffebld_cu_val_character1(u) (u).character1
-#define ffebld_cu_val_character2(u) (u).character2
-#define ffebld_cu_val_character3(u) (u).character3
-#define ffebld_cu_val_character4(u) (u).character4
-#define ffebld_cu_val_character5(u) (u).character5
-#define ffebld_cu_val_character6(u) (u).character6
-#define ffebld_cu_val_character7(u) (u).character7
-#define ffebld_cu_val_character8(u) (u).character8
-#define ffebld_end_list(b) (*(b) = NULL)
-#define ffebld_head(b) ((b)->u.item.head)
-#define ffebld_info(b) ((b)->info)
-#define ffebld_init_3()
-#define ffebld_init_4()
-#define ffebld_init_list(l,b) (*(l) = NULL, *(b) = (l))
-#define ffebld_labter(b) ((b)->u.labter)
-#define ffebld_labtok(b) ((b)->u.labtok)
-#define ffebld_left(b) ((b)->u.nonter.left)
-#define ffebld_name_string(n) ((n)->name)
-#define ffebld_new() \
- ((ffebld) malloc_new_kp(ffebld_pool(), "FFEBLD",sizeof(struct _ffebld_)))
-#define ffebld_new_any() ffebld_new_none(FFEBLD_opANY)
-#define ffebld_new_conter(c) ffebld_new_conter_with_orig((c),NULL)
-#define ffebld_new_star() ffebld_new_none(FFEBLD_opSTAR)
-#define ffebld_new_uplus(l) ffebld_new_one(FFEBLD_opUPLUS,(l))
-#define ffebld_new_uminus(l) ffebld_new_one(FFEBLD_opUMINUS,(l))
-#define ffebld_new_add(l,r) ffebld_new_two(FFEBLD_opADD,(l),(r))
-#define ffebld_new_subtract(l,r) ffebld_new_two(FFEBLD_opSUBTRACT,(l),(r))
-#define ffebld_new_multiply(l,r) ffebld_new_two(FFEBLD_opMULTIPLY,(l),(r))
-#define ffebld_new_divide(l,r) ffebld_new_two(FFEBLD_opDIVIDE,(l),(r))
-#define ffebld_new_power(l,r) ffebld_new_two(FFEBLD_opPOWER,(l),(r))
-#define ffebld_new_bounds(l,r) ffebld_new_two(FFEBLD_opBOUNDS,(l),(r))
-#define ffebld_new_concatenate(l,r) ffebld_new_two(FFEBLD_opCONCATENATE,(l),(r))
-#define ffebld_new_not(l) ffebld_new_one(FFEBLD_opNOT,(l))
-#define ffebld_new_lt(l,r) ffebld_new_two(FFEBLD_opLT,(l),(r))
-#define ffebld_new_le(l,r) ffebld_new_two(FFEBLD_opLE,(l),(r))
-#define ffebld_new_eq(l,r) ffebld_new_two(FFEBLD_opEQ,(l),(r))
-#define ffebld_new_ne(l,r) ffebld_new_two(FFEBLD_opNE,(l),(r))
-#define ffebld_new_gt(l,r) ffebld_new_two(FFEBLD_opGT,(l),(r))
-#define ffebld_new_ge(l,r) ffebld_new_two(FFEBLD_opGE,(l),(r))
-#define ffebld_new_and(l,r) ffebld_new_two(FFEBLD_opAND,(l),(r))
-#define ffebld_new_or(l,r) ffebld_new_two(FFEBLD_opOR,(l),(r))
-#define ffebld_new_xor(l,r) ffebld_new_two(FFEBLD_opXOR,(l),(r))
-#define ffebld_new_eqv(l,r) ffebld_new_two(FFEBLD_opEQV,(l),(r))
-#define ffebld_new_neqv(l,r) ffebld_new_two(FFEBLD_opNEQV,(l),(r))
-#define ffebld_new_paren(l) ffebld_new_one(FFEBLD_opPAREN,(l))
-#define ffebld_new_repeat(l,r) ffebld_new_two(FFEBLD_opREPEAT,(l),(r))
-#define ffebld_new_percent_descr(l) ffebld_new_one(FFEBLD_opPERCENT_DESCR,(l))
-#define ffebld_new_percent_loc(l) ffebld_new_one(FFEBLD_opPERCENT_LOC,(l))
-#define ffebld_new_percent_ref(l) ffebld_new_one(FFEBLD_opPERCENT_REF,(l))
-#define ffebld_new_percent_val(l) ffebld_new_one(FFEBLD_opPERCENT_VAL,(l))
-#define ffebld_new_complex(l,r) ffebld_new_two(FFEBLD_opCOMPLEX,(l),(r))
-#define ffebld_new_convert(l) ffebld_new_one(FFEBLD_opCONVERT,(l))
-#define ffebld_new_funcref(l,r) ffebld_new_two(FFEBLD_opFUNCREF,(l),(r))
-#define ffebld_new_subrref(l,r) ffebld_new_two(FFEBLD_opSUBRREF,(l),(r))
-#define ffebld_new_arrayref(l,r) ffebld_new_two(FFEBLD_opARRAYREF,(l),(r))
-#define ffebld_new_substr(l,r) ffebld_new_two(FFEBLD_opSUBSTR,(l),(r))
-#define ffebld_new_impdo(l,r) ffebld_new_two(FFEBLD_opIMPDO,(l),(r))
-#define ffebld_op(b) ((b)->op)
-#define ffebld_pool() (ffebld_pool_stack_.pool)
-#define ffebld_right(b) ((b)->u.nonter.right)
-#define ffebld_set_accter(b,a) ((b)->u.accter.array = (a))
-#define ffebld_set_arrter(b,a) ((b)->u.arrter.array = (a))
-#define ffebld_set_conter(b,c) ((b)->u.conter.expr = (c))
-#define ffebld_set_info(b,i) ((b)->info = (i))
-#define ffebld_set_labter(b,l) ((b)->u.labter = (l))
-#define ffebld_set_op(b,o) ((b)->op = (o))
-#define ffebld_set_head(b,h) ((b)->u.item.head = (h))
-#define ffebld_set_left(b,l) ((b)->u.nonter.left = (l))
-#define ffebld_set_right(b,r) ((b)->u.nonter.right = (r))
-#define ffebld_set_trail(b,t) ((b)->u.item.trail = (t))
-#define ffebld_size(b) (ffeinfo_size((b)->info))
-#define ffebld_size_known(b) ffebld_size(b)
-#define ffebld_symter(b) ((b)->u.symter.symbol)
-#define ffebld_symter_generic(b) ((b)->u.symter.generic)
-#define ffebld_symter_doiter(b) ((b)->u.symter.do_iter)
-#define ffebld_symter_implementation(b) ((b)->u.symter.implementation)
-#define ffebld_symter_specific(b) ((b)->u.symter.specific)
-#define ffebld_symter_set_generic(b,g) ((b)->u.symter.generic = (g))
-#define ffebld_symter_set_implementation(b,i) \
- ((b)->u.symter.implementation = (i))
-#define ffebld_symter_set_is_doiter(b,f) ((b)->u.symter.do_iter = (f))
-#define ffebld_symter_set_specific(b,s) ((b)->u.symter.specific = (s))
-#define ffebld_terminate_0()
-#define ffebld_terminate_1()
-#define ffebld_terminate_2()
-#define ffebld_terminate_3()
-#define ffebld_terminate_4()
-#define ffebld_trail(b) ((b)->u.item.trail)
-
-/* End of #include file. */
-
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
+#define ffebld_accter_pad(b) ((b)->u.accter.pad)
+#define ffebld_accter_set_pad(b,p) ((b)->u.accter.pad = (p))
+#define ffebld_arrter_pad(b) ((b)->u.arrter.pad)
+#define ffebld_arrter_set_pad(b,p) ((b)->u.arrter.pad = (p))
+#define ffebld_conter_pad(b) ((b)->u.conter.pad)
+#define ffebld_conter_set_pad(b,p) ((b)->u.conter.pad = (p))
diff --git a/gcc/f/bugs.texi b/gcc/f/bugs.texi
index d6370f99a49..af18d80cdbc 100644
--- a/gcc/f/bugs.texi
+++ b/gcc/f/bugs.texi
@@ -5,7 +5,7 @@
@c The text of this file appears in the file BUGS
@c in the G77 distribution, as well as in the G77 manual.
-@c 1998-03-17
+@c 1998-09-01
@ifclear BUGSONLY
@node Actual Bugs
@@ -26,19 +26,74 @@ configure, port, build, and install @code{g77},
@itemize @bullet
@item
+@code{g77} sometimes crashes when compiling code
+containing the construct @samp{CMPLX(0.)} or similar.
+This is a @code{gcc} back-end bug.
+It can be worked around using @samp{-fno-emulate-complex},
+though that might trigger other, older bugs.
+Compiling without optimization is another work-around.
+
+Fixed in @code{egcs} 1.1.
+
+@item
+@c Tim Prince discovered this.
+Automatic arrays aren't working on HP-UX systems,
+at least in HP-UX version 10.20.
+Writing into them apparently causes over-writing
+of statically declared data in the main program.
+This probably means the arrays themselves are being under-allocated,
+or pointers to them being improperly handled,
+e.g. not passed to other procedures as they should be.
+
+@item
+@c Toon Moene discovered these.
+Some Fortran code has been found to be miscompiled
+by @code{g77} built on @code{gcc} version 2.8.1
+on m68k-next-nextstep3 configurations
+when using the @samp{-O2} option.
+Even a C function is known to miscompile
+on that configuration
+when using the @samp{-O2 -funroll-loops} options.
+
+Fixed in @code{egcs}.
+
+@cindex DNRM2
+@cindex stack, 387 coprocessor
+@cindex ix86
+@cindex -O2
+@item
+A code-generation bug afflicts
+Intel x86 targets when @samp{-O2} is specified
+compiling, for example, an old version of
+the @samp{DNRM2} routine.
+The x87 coprocessor stack is being
+mismanaged in cases where assigned @code{GOTO}
+and @code{ASSIGN} are involved.
+
+Fixed in @code{egcs} version 1.1.
+
+@item
+@code{g77} fails to warn about
+use of a ``live'' iterative-DO variable
+as an implied-DO variable
+in a @samp{WRITE} or @samp{PRINT} statement
+(although it does warn about this in a @samp{READ} statement).
+
+@item
+A compiler crash, or apparently infinite run time,
+can result when compiling complicated expressions
+involving @code{COMPLEX} arithmetic
+(especially multiplication).
+
+Fixed in @code{egcs} version 1.1.
+
+@item
Something about @code{g77}'s straightforward handling of
label references and definitions sometimes prevents the GBE
from unrolling loops.
Until this is solved, try inserting or removing @code{CONTINUE}
statements as the terminal statement, using the @code{END DO}
form instead, and so on.
-(Probably improved, but not wholly fixed, in 0.5.21.)
-
-@item
-The @code{g77} command itself should more faithfully process
-options the way the @code{gcc} command does.
-For example, @code{gcc} accepts abbreviated forms of long options,
-@code{g77} generally doesn't.
@item
Some confusion in diagnostics concerning failing @code{INCLUDE}
@@ -151,49 +206,15 @@ is definitely welcome.
Such information might even lead to all relevant products
working together properly sooner.
-@cindex padding
-@cindex structures
-@cindex common blocks
-@cindex equivalence areas
-@item
-@code{g77} currently inserts needless padding for things like
-@samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
-is @code{INTEGER(KIND=1)} on machines like x86, because
-the back end insists that @samp{IPAD} be aligned to a 4-byte boundary, but
-the processor has no such requirement (though it's good for
-performance).
-
-It is possible that this is not a real bug, and could be considered
-a performance feature, but it might be important to provide
-the ability to Fortran code to specify minimum padding for
-aggregate areas such as common blocks---and, certainly, there
-is the potential, with the current setup, for interface differences
-in the way such areas are laid out between @code{g77} and other
-compilers.
-
@cindex Alpha, support
@cindex support, Alpha
@item
-@code{g77} doesn't work perfectly on 64-bit configurations such as the Alpha.
-This problem is expected to be largely resolved as of version 0.5.20,
-and further addressed by 0.5.21.
-Version 0.6 should solve most or all related problems (such as
-64-bit machines other than Digital Semiconductor (``DEC'') Alphas).
+@code{g77} doesn't work perfectly on 64-bit configurations
+such as the Digital Semiconductor (``DEC'') Alpha.
-One known bug that causes a compile-time crash occurs when compiling
-code such as the following with optimization:
-
-@example
-SUBROUTINE CRASH (TEMP)
-INTEGER*2 HALF(2)
-REAL TEMP
-HALF(1) = NINT (TEMP)
-END
-@end example
-
-It is expected that a future version of @code{g77} will have a fix for this
-problem, almost certainly by the time @code{g77} supports
-version 2.8 of @code{gcc}.
+This problem is largely resolved as of version 0.5.23.
+Version 0.6 should solve most or all remaining problems
+(such as cross-compiling involving 64-bit machines).
@cindex COMPLEX support
@cindex support, COMPLEX
@@ -211,4 +232,89 @@ problem by not using the back end's support for @code{COMPLEX}.
The new option @samp{-fno-emulate-complex} avoids the work-around,
reverting to using the same ``broken'' mechanism as that used
by versions of @code{g77} prior to 0.5.20.
+
+@cindex ELF support
+@cindex support, ELF
+@cindex -fPIC option
+@cindex options, -fPIC
+@item
+@code{g77} sometimes produces invalid assembler code
+when using the @samp{-fPIC} option (such as compiling for ELF targets)
+on the Intel x86 architecture target.
+The symptom is that the assembler complains about invalid opcodes.
+This bug is in the gcc back end.
+
+Fixed in @code{egcs} version 1.0.2.
+
+@cindex padding
+@cindex structures
+@cindex common blocks
+@cindex equivalence areas
+@item
+@code{g77} currently inserts needless padding for things like
+@samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
+is @code{INTEGER(KIND=1)} on machines like x86,
+because the back end insists that @samp{IPAD}
+be aligned to a 4-byte boundary,
+but the processor has no such requirement
+(though it is usually good for performance).
+
+The @code{gcc} back end needs to provide a wider array
+of specifications of alignment requirements and preferences for targets,
+and front ends like @code{g77} should take advantage of this
+when it becomes available.
+
+@cindex alignment
+@cindex double-precision performance
+@cindex -malign-double
+@item
+The x86 target's @samp{-malign-double} option
+no longer reliably aligns double-precision variables and arrays
+when they are placed in the stack frame.
+
+This can significantly reduce the performance of some applications,
+even on a run-to-run basis
+(that is, performance measurements can vary fairly widely
+depending on whether frequently used variables are properly aligned,
+and that can change from one program run to the next,
+even from one procedure call to the next).
+
+Versions 0.5.22 and earlier of @code{g77}
+included a patch to @code{gcc} that enabled this,
+but that patch has been deemed an improper (probably buggy) one
+for version 2.8 of @code{gcc} and for @code{egcs}.
+
+Note that version 1.1 of @code{egcs}
+aligns double-precision variables and arrays
+when they are in static storage
+even if @samp{-malign-double} is not specified.
+
+There is ongoing investigation into
+how to make @samp{-malign-double} work properly,
+also into how to make it unnecessary to get
+all double-precision variables and arrays aligned
+when such alignment would not violate
+the relevant specifications for processor
+and inter-procedural interfaces.
+
+For a suite of programs to test double-precision alignment,
+see @uref{ftp://alpha.gnu.org/gnu/g77/align/}.
+
+@cindex complex performance
+@cindex aliasing
+@item
+The @code{libf2c} routines that perform some run-time
+arithmetic on @code{COMPLEX} operands
+were modified circa version 0.5.20 of @code{g77}
+to work properly even in the presence of aliased operands.
+
+While the @code{g77} and @code{netlib} versions of @code{libf2c}
+differ on how this is accomplished,
+the main differences are that we believe
+the @code{g77} version works properly
+even in the presence of @emph{partially} aliased operands.
+
+However, these modifications have reduced performance
+on targets such as x86,
+due to the extra copies of operands involved.
@end itemize
diff --git a/gcc/f/com-rt.def b/gcc/f/com-rt.def
index f124379c9cf..6ceaf17db76 100644
--- a/gcc/f/com-rt.def
+++ b/gcc/f/com-rt.def
@@ -1,6 +1,6 @@
/* com-rt.def -- Public #include File (module.h template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -143,6 +143,7 @@ DEFGFRT (FFECOM_gfrtDASIN, "d_asin", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATAN, "d_atan", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATAN2, "d_atn2", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtDATE, "G77_date_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE)
+DEFGFRT (FFECOM_gfrtDATE_AND_TIME, "G77_date_and_time_0", FFECOM_rttypeVOID_, "&a&a&a&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESJ0, "j0", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESJ1, "j1", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtL_BESJN, "jn", FFECOM_rttypeDOUBLE_, "id", FALSE, FALSE)
@@ -234,7 +235,7 @@ DEFGFRT (FFECOM_gfrtSRAND, "G77_srand_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE
DEFGFRT (FFECOM_gfrtSTAT, "G77_stat_0", FFECOM_rttypeINTEGER_, "&a&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSYMLNK, "G77_symlnk_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtSYSTEM, "G77_system_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE)
-DEFGFRT (FFECOM_gfrtSYSTEM_CLOCK, "system_clock_", FFECOM_rttypeVOID_, "&i&i&i", FALSE, FALSE)
+DEFGFRT (FFECOM_gfrtSYSTEM_CLOCK, "G77_system_clock_0", FFECOM_rttypeVOID_, "&i&i&i", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTAN, "r_tan", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTANH, "r_tanh", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE)
DEFGFRT (FFECOM_gfrtTIME, "G77_time_0", FFECOM_rttypeLONGINT_, 0, FALSE, FALSE)
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 75b7274ae55..9db1f8462f4 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -1,6 +1,6 @@
/* com.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -85,11 +85,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Include files. */
+#include "proj.h"
#if FFECOM_targetCURRENT == FFECOM_targetGCC
-#include "config.j"
#include "flags.j"
#include "rtl.j"
+#include "toplev.j"
#include "tree.j"
+#include "output.j" /* Must follow tree.j so TREE_CODE is defined! */
#include "convert.j"
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
@@ -154,9 +156,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
char *getenv ();
#endif
-char *index ();
-char *rindex ();
-
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -195,7 +194,6 @@ typedef struct { unsigned :16, :16, :16; } vms_ino_t;
/* END stuff from gcc/cccp.c. */
-#include "proj.h"
#define FFECOM_DETERMINE_TYPES 1 /* for com.h */
#include "com.h"
#include "bad.h"
@@ -924,8 +922,11 @@ ffecom_convert_narrow_ (type, expr)
assert (code != ENUMERAL_TYPE);
if (code == INTEGER_TYPE)
{
- assert (TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE);
- assert (TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (e)));
+ assert ((TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE
+ && TYPE_PRECISION (type) <= TYPE_PRECISION (TREE_TYPE (e)))
+ || (TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE
+ && (TYPE_PRECISION (type)
+ == TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (e))))));
return fold (convert_to_integer (type, e));
}
if (code == POINTER_TYPE)
@@ -948,8 +949,14 @@ ffecom_convert_narrow_ (type, expr)
if (code == RECORD_TYPE)
{
assert (TREE_CODE (TREE_TYPE (e)) == RECORD_TYPE);
+ /* Check that at least the first field name agrees. */
+ assert (DECL_NAME (TYPE_FIELDS (type))
+ == DECL_NAME (TYPE_FIELDS (TREE_TYPE (e))));
assert (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type)))
<= TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e)))));
+ if (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type)))
+ == TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e)))))
+ return e;
return fold (ffecom_convert_to_complex_ (type, e));
}
@@ -988,8 +995,11 @@ ffecom_convert_widen_ (type, expr)
assert (code != ENUMERAL_TYPE);
if (code == INTEGER_TYPE)
{
- assert (TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE);
- assert (TYPE_PRECISION (type) >= TYPE_PRECISION (TREE_TYPE (e)));
+ assert ((TREE_CODE (TREE_TYPE (e)) == INTEGER_TYPE
+ && TYPE_PRECISION (type) >= TYPE_PRECISION (TREE_TYPE (e)))
+ || (TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE
+ && (TYPE_PRECISION (type)
+ == TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (e))))));
return fold (convert_to_integer (type, e));
}
if (code == POINTER_TYPE)
@@ -1012,8 +1022,14 @@ ffecom_convert_widen_ (type, expr)
if (code == RECORD_TYPE)
{
assert (TREE_CODE (TREE_TYPE (e)) == RECORD_TYPE);
+ /* Check that at least the first field name agrees. */
+ assert (DECL_NAME (TYPE_FIELDS (type))
+ == DECL_NAME (TYPE_FIELDS (TREE_TYPE (e))));
assert (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type)))
>= TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e)))));
+ if (TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (type)))
+ == TYPE_PRECISION (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (e)))))
+ return e;
return fold (ffecom_convert_to_complex_ (type, e));
}
@@ -2027,8 +2043,8 @@ ffecom_check_size_overflow_ (ffesymbol s, tree type, bool dummy)
return type;
if ((tree_int_cst_sgn (TYPE_SIZE (type)) < 0)
- || (!dummy && (TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0))
- || TREE_OVERFLOW (TYPE_SIZE (type)))
+ || (!dummy && (((TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0))
+ || TREE_OVERFLOW (TYPE_SIZE (type)))))
{
ffebad_start (FFEBAD_ARRAY_LARGE);
ffebad_string (ffesymbol_text (s));
@@ -2074,7 +2090,7 @@ ffecom_char_enhance_arg_ (tree *xtype, ffesymbol s)
if (sz == FFETARGET_charactersizeNONE)
{
assert (tlen != NULL_TREE);
- highval = tlen;
+ highval = variable_size (tlen);
}
else
{
@@ -2761,10 +2777,12 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
ffebitCount i;
ffebit bits = ffebld_accter_bits (expr);
ffetargetOffset source_offset = 0;
- size_t size;
+ ffetargetOffset dest_offset = ffebld_accter_pad (expr);
tree purpose;
- size = ffetype_size (ffeinfo_type (bt, kt));
+ assert (dest_offset == 0
+ || (bt == FFEINFO_basictypeCHARACTER
+ && kt == FFEINFO_kindtypeCHARACTER1));
list = item = NULL;
for (;;)
@@ -2787,8 +2805,9 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
t = ffecom_constantunion (&cu, bt, kt, tree_type);
- if (i == 0)
- purpose = build_int_2 (source_offset, 0);
+ if (i == 0
+ && dest_offset != 0)
+ purpose = build_int_2 (dest_offset, 0);
else
purpose = NULL_TREE;
@@ -2802,10 +2821,12 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
}
}
source_offset += length;
+ dest_offset += length;
}
}
- item = build_int_2 (ffebld_accter_size (expr), 0);
+ item = build_int_2 ((ffebld_accter_size (expr)
+ + ffebld_accter_pad (expr)) - 1, 0);
ffebit_kill (ffebld_accter_bits (expr));
TREE_TYPE (item) = ffecom_integer_type_node;
item
@@ -2823,7 +2844,18 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
{
ffetargetOffset i;
- list = item = NULL_TREE;
+ list = NULL_TREE;
+ if (ffebld_arrter_pad (expr) == 0)
+ item = NULL_TREE;
+ else
+ {
+ assert (bt == FFEINFO_basictypeCHARACTER
+ && kt == FFEINFO_kindtypeCHARACTER1);
+
+ /* Becomes PURPOSE first time through loop. */
+ item = build_int_2 (ffebld_arrter_pad (expr), 0);
+ }
+
for (i = 0; i < ffebld_arrter_size (expr); ++i)
{
ffebldConstantUnion cu
@@ -2832,7 +2864,8 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
t = ffecom_constantunion (&cu, bt, kt, tree_type);
if (list == NULL_TREE)
- list = item = build_tree_list (NULL_TREE, t);
+ /* Assume item is PURPOSE first time through loop. */
+ list = item = build_tree_list (item, t);
else
{
TREE_CHAIN (item) = build_tree_list (NULL_TREE, t);
@@ -2841,13 +2874,14 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
}
}
- item = build_int_2 (ffebld_arrter_size (expr), 0);
+ item = build_int_2 ((ffebld_arrter_size (expr)
+ + ffebld_arrter_pad (expr)) - 1, 0);
TREE_TYPE (item) = ffecom_integer_type_node;
item
= build_array_type
(tree_type,
build_range_type (ffecom_integer_type_node,
- ffecom_integer_one_node,
+ ffecom_integer_zero_node,
item));
list = build (CONSTRUCTOR, item, NULL_TREE, list);
TREE_CONSTANT (list) = 1;
@@ -2855,6 +2889,7 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
return list;
case FFEBLD_opCONTER:
+ assert (ffebld_conter_pad (expr) == 0);
item
= ffecom_constantunion (&ffebld_constant_union (ffebld_conter (expr)),
bt, kt, tree_type);
@@ -3062,6 +3097,7 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
ffebld right = ffebld_right (expr);
ffecomGfrt code;
ffeinfoKindtype rtkt;
+ ffeinfoKindtype ltkt;
switch (ffeinfo_basictype (ffebld_info (right)))
{
@@ -3083,37 +3119,54 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
== FFEINFO_kindtypeINTEGER4))
{
code = FFECOM_gfrtPOW_QQ;
+ ltkt = FFEINFO_kindtypeINTEGER4;
rtkt = FFEINFO_kindtypeINTEGER4;
}
else
- code = FFECOM_gfrtPOW_II;
+ {
+ code = FFECOM_gfrtPOW_II;
+ ltkt = FFEINFO_kindtypeINTEGER1;
+ }
break;
case FFEINFO_basictypeREAL:
if (ffeinfo_kindtype (ffebld_info (left))
== FFEINFO_kindtypeREAL1)
- code = FFECOM_gfrtPOW_RI;
+ {
+ code = FFECOM_gfrtPOW_RI;
+ ltkt = FFEINFO_kindtypeREAL1;
+ }
else
- code = FFECOM_gfrtPOW_DI;
+ {
+ code = FFECOM_gfrtPOW_DI;
+ ltkt = FFEINFO_kindtypeREAL2;
+ }
break;
case FFEINFO_basictypeCOMPLEX:
if (ffeinfo_kindtype (ffebld_info (left))
== FFEINFO_kindtypeREAL1)
- code = FFECOM_gfrtPOW_CI; /* Overlapping result okay. */
+ {
+ code = FFECOM_gfrtPOW_CI; /* Overlapping result okay. */
+ ltkt = FFEINFO_kindtypeREAL1;
+ }
else
- code = FFECOM_gfrtPOW_ZI; /* Overlapping result okay. */
+ {
+ code = FFECOM_gfrtPOW_ZI; /* Overlapping result okay. */
+ ltkt = FFEINFO_kindtypeREAL2;
+ }
break;
default:
assert ("bad pow_*i" == NULL);
code = FFECOM_gfrtPOW_CI; /* Overlapping result okay. */
+ ltkt = FFEINFO_kindtypeREAL1;
break;
}
- if (ffeinfo_kindtype (ffebld_info (left)) != rtkt)
+ if (ffeinfo_kindtype (ffebld_info (left)) != ltkt)
left = ffeexpr_convert (left, NULL, NULL,
- FFEINFO_basictypeINTEGER,
- rtkt, 0,
+ ffeinfo_basictype (ffebld_info (left)),
+ ltkt, 0,
FFETARGET_charactersizeNONE,
FFEEXPR_contextLET);
if (ffeinfo_kindtype (ffebld_info (right)) != rtkt)
@@ -5050,7 +5103,7 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree,
FALSE,
((codegen_imp == FFEINTRIN_impIRAND) ?
ffecom_f2c_integer_type_node :
- ffecom_f2c_doublereal_type_node),
+ ffecom_f2c_real_type_node),
arg1_tree,
dest_tree, dest, dest_used,
NULL_TREE, TRUE);
@@ -5158,6 +5211,7 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree,
case FFEINTRIN_impCHDIR_func:
case FFEINTRIN_impCHMOD_func:
case FFEINTRIN_impDATE:
+ case FFEINTRIN_impDATE_AND_TIME:
case FFEINTRIN_impDBESJ0:
case FFEINTRIN_impDBESJ1:
case FFEINTRIN_impDBESJN:
@@ -6626,11 +6680,13 @@ ffecom_finish_global_ (ffeglobal global)
/* Give the array a size now. */
- size = build_int_2 (ffeglobal_common_size (global), 0);
+ size = build_int_2 ((ffeglobal_common_size (global)
+ + ffeglobal_common_pad (global)) - 1,
+ 0);
cbtype = TREE_TYPE (cbt);
TYPE_DOMAIN (cbtype) = build_range_type (integer_type_node,
- integer_one_node,
+ integer_zero_node,
size);
if (!TREE_TYPE (size))
TREE_TYPE (size) = TYPE_DOMAIN (cbtype);
@@ -6663,15 +6719,17 @@ ffecom_finish_symbol_transform_ (ffesymbol s)
VAR_DECLs for COMMON variables when we transform them for real
use, and therefore we do all the VAR_DECL creating here. */
- if ((ffesymbol_hook (s).decl_tree == NULL_TREE)
- && ((ffesymbol_kind (s) != FFEINFO_kindNONE)
- || ((ffesymbol_where (s) != FFEINFO_whereNONE)
- && (ffesymbol_where (s) != FFEINFO_whereINTRINSIC)))
- && (ffesymbol_where (s) != FFEINFO_whereDUMMY))
- /* Not transformed, and not CHARACTER*(*), and not a dummy
- argument, which can happen only if the entry point names
- it "rides in on" are all invalidated for other reasons. */
- s = ffecom_sym_transform_ (s);
+ if (ffesymbol_hook (s).decl_tree == NULL_TREE)
+ {
+ if (ffesymbol_kind (s) != FFEINFO_kindNONE
+ || (ffesymbol_where (s) != FFEINFO_whereNONE
+ && ffesymbol_where (s) != FFEINFO_whereINTRINSIC
+ && ffesymbol_where (s) != FFEINFO_whereDUMMY))
+ /* Not transformed, and not CHARACTER*(*), and not a dummy
+ argument, which can happen only if the entry point names
+ it "rides in on" are all invalidated for other reasons. */
+ s = ffecom_sym_transform_ (s);
+ }
if ((ffesymbol_where (s) == FFEINFO_whereCOMMON)
&& (ffesymbol_hook (s).decl_tree != error_mark_node))
@@ -7853,7 +7911,6 @@ ffecom_start_progunit_ ()
id = ffecom_get_invented_identifier ("__g77_masterfun_%s",
ffesymbol_text (fn),
0);
- IDENTIFIER_INVENTED (id) = 0; /* Allow this to be debugged. */
}
#if FFETARGET_isENFORCED_MAIN
else if (main_program)
@@ -9144,6 +9201,7 @@ ffecom_transform_common_ (ffesymbol s)
tree cbt;
tree cbtype;
tree init;
+ tree high;
bool is_init = ffestorag_is_init (st);
assert (st != NULL);
@@ -9176,7 +9234,30 @@ ffecom_transform_common_ (ffesymbol s)
{
if (ffestorag_init (st) != NULL)
{
- init = ffecom_expr (ffestorag_init (st));
+ ffebld sexp;
+
+ /* Set the padding for the expression, so ffecom_expr
+ knows to insert that many zeros. */
+ switch (ffebld_op (sexp = ffestorag_init (st)))
+ {
+ case FFEBLD_opCONTER:
+ ffebld_conter_set_pad (sexp, ffestorag_modulo (st));
+ break;
+
+ case FFEBLD_opARRTER:
+ ffebld_arrter_set_pad (sexp, ffestorag_modulo (st));
+ break;
+
+ case FFEBLD_opACCTER:
+ ffebld_accter_set_pad (sexp, ffestorag_modulo (st));
+ break;
+
+ default:
+ assert ("bad op for cmn init (pad)" == NULL);
+ break;
+ }
+
+ init = ffecom_expr (sexp);
if (init == error_mark_node)
{ /* Hopefully the back end complained! */
init = NULL_TREE;
@@ -9195,13 +9276,16 @@ ffecom_transform_common_ (ffesymbol s)
/* cbtype must be permanently allocated! */
+ /* Allocate the MAX of the areas so far, seen filewide. */
+ high = build_int_2 ((ffeglobal_common_size (g)
+ + ffeglobal_common_pad (g)) - 1, 0);
+ TREE_TYPE (high) = ffecom_integer_type_node;
+
if (init)
cbtype = build_array_type (char_type_node,
build_range_type (integer_type_node,
- integer_one_node,
- build_int_2
- (ffeglobal_common_size (g),
- 0)));
+ integer_zero_node,
+ high));
else
cbtype = build_array_type (char_type_node, NULL_TREE);
@@ -9253,7 +9337,8 @@ ffecom_transform_common_ (ffesymbol s)
DECL_SIZE (cbt),
size_int (BITS_PER_UNIT));
assert (TREE_INT_CST_HIGH (size_tree) == 0);
- assert (TREE_INT_CST_LOW (size_tree) == ffeglobal_common_size (g));
+ assert (TREE_INT_CST_LOW (size_tree)
+ == ffeglobal_common_size (g) + ffeglobal_common_pad (g));
}
ffeglobal_set_hook (g, cbt);
@@ -9291,7 +9376,30 @@ ffecom_transform_equiv_ (ffestorag eqst)
{
if (ffestorag_init (eqst) != NULL)
{
- init = ffecom_expr (ffestorag_init (eqst));
+ ffebld sexp;
+
+ /* Set the padding for the expression, so ffecom_expr
+ knows to insert that many zeros. */
+ switch (ffebld_op (sexp = ffestorag_init (eqst)))
+ {
+ case FFEBLD_opCONTER:
+ ffebld_conter_set_pad (sexp, ffestorag_modulo (eqst));
+ break;
+
+ case FFEBLD_opARRTER:
+ ffebld_arrter_set_pad (sexp, ffestorag_modulo (eqst));
+ break;
+
+ case FFEBLD_opACCTER:
+ ffebld_accter_set_pad (sexp, ffestorag_modulo (eqst));
+ break;
+
+ default:
+ assert ("bad op for eqv init (pad)" == NULL);
+ break;
+ }
+
+ init = ffecom_expr (sexp);
if (init == error_mark_node)
init = NULL_TREE; /* Hopefully the back end complained! */
}
@@ -9310,12 +9418,13 @@ ffecom_transform_equiv_ (ffestorag eqst)
yes = suspend_momentary ();
- high = build_int_2 (ffestorag_size (eqst), 0);
+ high = build_int_2 ((ffestorag_size (eqst)
+ + ffestorag_modulo (eqst)) - 1, 0);
TREE_TYPE (high) = ffecom_integer_type_node;
eqtype = build_array_type (char_type_node,
build_range_type (ffecom_integer_type_node,
- ffecom_integer_one_node,
+ ffecom_integer_zero_node,
high));
eqt = build_decl (VAR_DECL,
@@ -9346,11 +9455,6 @@ ffecom_transform_equiv_ (ffestorag eqst)
eqt = start_decl (eqt, FALSE);
- /* Make sure this shows up as a debug symbol, which is not normally
- the case for invented identifiers. */
-
- DECL_IGNORED_P (eqt) = 0;
-
/* Make sure that any type can live in EQUIVALENCE and be referenced
without getting a bus error. We could pick the most restrictive
alignment of all entities actually placed in the EQUIVALENCE, but
@@ -9374,7 +9478,8 @@ ffecom_transform_equiv_ (ffestorag eqst)
DECL_SIZE (eqt),
size_int (BITS_PER_UNIT));
assert (TREE_INT_CST_HIGH (size_tree) == 0);
- assert (TREE_INT_CST_LOW (size_tree) == ffestorag_size (eqst));
+ assert (TREE_INT_CST_LOW (size_tree)
+ == ffestorag_size (eqst) + ffestorag_modulo (eqst));
}
ffestorag_set_hook (eqst, eqt);
@@ -11429,7 +11534,9 @@ ffecom_end_transition ()
if (ffe_is_ffedebug ())
{
ffestorag_report ();
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
ffesymbol_report_all ();
+#endif
}
#if FFECOM_targetCURRENT == FFECOM_targetGCC
@@ -11514,7 +11621,9 @@ ffecom_exec_transition ()
if (ffe_is_ffedebug ())
{
ffestorag_report ();
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
ffesymbol_report_all ();
+#endif
}
if (inhibited)
@@ -12294,10 +12403,11 @@ ffecom_init_0 ()
fatal ("no INTEGER type can hold a pointer on this configuration");
else if (0 && ffe_is_do_internal_checks ())
fprintf (stderr, "Pointer type kt=%d\n", ffecom_pointer_kind_);
- type = ffetype_new ();
ffetype_set_kind (ffeinfo_type (FFEINFO_basictypeINTEGER,
FFEINFO_kindtypeINTEGERDEFAULT),
- 7, type);
+ 7,
+ ffeinfo_type (FFEINFO_basictypeINTEGER,
+ ffecom_pointer_kind_));
if (ffe_is_ugly_assign ())
ffecom_label_kind_ = ffecom_pointer_kind_; /* Require ASSIGN etc to this. */
@@ -12503,7 +12613,7 @@ ffecom_init_0 ()
/* Do "extern int xargc;". */
ffecom_tree_xargc_ = build_decl (VAR_DECL,
- get_identifier ("xargc"),
+ get_identifier ("f__xargc"),
integer_type_node);
DECL_EXTERNAL (ffecom_tree_xargc_) = 1;
TREE_STATIC (ffecom_tree_xargc_) = 1;
@@ -12782,6 +12892,7 @@ ffecom_notify_init_storage (ffestorag st)
ffebld init; /* The initialization expression. */
#if 0 && FFECOM_targetCURRENT == FFECOM_targetGCC
ffetargetOffset size; /* The size of the entity. */
+ ffetargetAlign pad; /* Its initial padding. */
#endif
if (ffestorag_init (st) == NULL)
@@ -12794,10 +12905,12 @@ ffecom_notify_init_storage (ffestorag st)
#if 0 && FFECOM_targetCURRENT == FFECOM_targetGCC
/* For GNU backend, just turn ACCTER into ARRTER and proceed. */
size = ffebld_accter_size (init);
+ pad = ffebld_accter_pad (init);
ffebit_kill (ffebld_accter_bits (init));
ffebld_set_op (init, FFEBLD_opARRTER);
ffebld_set_arrter (init, ffebld_accter (init));
ffebld_arrter_set_size (init, size);
+ ffebld_arrter_set_pad (init, size);
#endif
#if FFECOM_TWOPASS
@@ -12868,6 +12981,7 @@ ffecom_notify_init_symbol (ffesymbol s)
ffebld init; /* The initialization expression. */
#if 0 && FFECOM_targetCURRENT == FFECOM_targetGCC
ffetargetOffset size; /* The size of the entity. */
+ ffetargetAlign pad; /* Its initial padding. */
#endif
if (ffesymbol_storage (s) == NULL)
@@ -12883,10 +12997,12 @@ ffecom_notify_init_symbol (ffesymbol s)
#if 0 && FFECOM_targetCURRENT == FFECOM_targetGCC
/* For GNU backend, just turn ACCTER into ARRTER and proceed. */
size = ffebld_accter_size (init);
+ pad = ffebld_accter_pad (init);
ffebit_kill (ffebld_accter_bits (init));
ffebld_set_op (init, FFEBLD_opARRTER);
ffebld_set_arrter (init, ffebld_accter (init));
ffebld_arrter_set_size (init, size);
+ ffebld_arrter_set_pad (init, size);
#endif
#if FFECOM_TWOPASS
@@ -13259,18 +13375,19 @@ ffecom_push_tempvar (tree type, ffetargetCharacterSize size, int elements,
ffecom_get_invented_identifier ("__g77_expr_%d", NULL,
mynumber++),
type);
- { /* ~~~~ kludge alert here!!! else temp gets reused outside
- a compound-statement sequence.... */
- extern tree sequence_rtl_expr;
- tree back_end_bug = sequence_rtl_expr;
- sequence_rtl_expr = NULL_TREE;
+ /* This temp must be put in the same scope as the containing BLOCK
+ (aka function), but for reasons that should be explained elsewhere,
+ the GBE normally decides it should be in a "phantom BLOCK" associated
+ with the expand_start_stmt_expr() call. So push the topmost
+ sequence back onto the GBE's internal stack before telling it
+ about the decl, then restore it afterwards. */
+ push_topmost_sequence ();
- t = start_decl (t, FALSE);
- finish_decl (t, NULL_TREE, FALSE);
+ t = start_decl (t, FALSE);
+ finish_decl (t, NULL_TREE, FALSE);
- sequence_rtl_expr = back_end_bug;
- }
+ pop_topmost_sequence ();
resume_momentary (yes);
@@ -14683,29 +14800,6 @@ start_function (tree name, tree type, int nested, int public)
/* Here are the public functions the GNU back end needs. */
-/* This is used by the `assert' macro. It is provided in libgcc.a,
- which `cc' doesn't know how to link. Note that the C++ front-end
- no longer actually uses the `assert' macro (instead, it calls
- my_friendly_assert). But all of the back-end files still need this. */
-void
-__eprintf (string, expression, line, filename)
-#ifdef __STDC__
- const char *string;
- const char *expression;
- unsigned line;
- const char *filename;
-#else
- char *string;
- char *expression;
- unsigned line;
- char *filename;
-#endif
-{
- fprintf (stderr, string, expression, line, filename);
- fflush (stderr);
- abort ();
-}
-
tree
convert (type, expr)
tree type, expr;
@@ -14846,10 +14940,11 @@ insert_block (block)
}
int
-lang_decode_option (p)
- char *p;
+lang_decode_option (argc, argv)
+ int argc;
+ char **argv;
{
- return ffe_decode_option (p);
+ return ffe_decode_option (argc, argv);
}
/* used by print-tree.c */
@@ -14878,6 +14973,15 @@ lang_identify ()
}
void
+lang_init_options ()
+{
+ /* Set default options for Fortran. */
+ flag_move_all_movables = 1;
+ flag_reduce_all_givs = 1;
+ flag_argument_noalias = 2;
+}
+
+void
lang_init ()
{
/* If the file is output from cpp, it should contain a first line
@@ -15180,10 +15284,6 @@ pushdecl (x)
DECL_ARTIFICIAL (x) = 1;
#endif
DECL_IN_SYSTEM_HEADER (x) = 1;
- DECL_IGNORED_P (x) = 1;
- TREE_USED (x) = 1;
- if (TREE_CODE (x) == TYPE_DECL)
- TYPE_DECL_SUPPRESS_DEBUG (x) = 1;
}
t = lookup_name_current_level (name);
diff --git a/gcc/f/com.h b/gcc/f/com.h
index 946e8a5d006..db8f4693f87 100644
--- a/gcc/f/com.h
+++ b/gcc/f/com.h
@@ -1,6 +1,6 @@
/* com.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -83,8 +83,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
to build the libf2c with which g77-generated code is linked, or there
will probably be bugs, some of them difficult to detect or even trigger. */
-#include "config.j"
-
/* Do we need int (for 32-bit or 64-bit systems) or long (16-bit or
normally 32-bit) for f2c-type integers? */
@@ -338,53 +336,11 @@ tree ffecom_temp_label (void);
tree ffecom_truth_value (tree expr);
tree ffecom_truth_value_invert (tree expr);
tree ffecom_which_entrypoint_decl (void);
-#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
-/* ~~~Eliminate these when possible, since the back end should be
- declaring them in some .h file. */
+/* These need to be in the front end with exactly these interfaces,
+ as they're called by the back end. */
-#if FFECOM_targetCURRENT == FFECOM_targetGCC
-extern int flag_pedantic_errors;
-void emit_nop (void);
-void announce_function (tree decl);
-extern FILE *asm_out_file;
-void assemble_string (char *, int);
-void assemble_variable (tree decl, int top_level, int at_end,
- int dont_output_data);
-void assemble_zeros (int size);
-int count_error (int warningp);
-void error (char *s, ...);
-void expand_decl (tree decl);
-void expand_computed_goto (tree exp);
-void expand_function_end (char *filename, int line, int end_bindings);
-void expand_function_start (tree subr, int parms_have_cleanups);
-void expand_main_function (void);
-void fatal (char *s, ...);
-void init_function_start (tree subr, char *filename, int line);
-void make_function_rtl (tree decl);
-void make_decl_rtl (tree decl, char *asmspec, int top_level);
-void make_var_volatile (tree var);
int mark_addressable (tree expr);
-void output_inline_function (tree fndecl);
-void pedwarn (char *s, ...);
-void pop_function_context (void);
-void pop_momentary_nofree (void);
-void preserve_initializer (void);
-void print_node (FILE *file, char *prefix, tree node, int indent);
-void push_function_context (void);
-void push_obstacks (struct obstack *current, struct obstack *saveable);
-void put_var_into_stack (tree decl);
-void remember_end_note (tree block);
-void report_error_function (char *file);
-void rest_of_compilation (tree decl);
-void rest_of_decl_compilation (tree decl, char *asmspec, int top_level,
- int at_end);
-void resume_temporary_allocation (void);
-void set_identifier_size (int size);
-void temporary_allocation (void);
-tree truthvalue_conversion (tree expr);
-void warning_with_decl (tree decl, char *s, ...);
-void warning (char *s, ...);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
/* Define macros. */
diff --git a/gcc/f/config-lang.in b/gcc/f/config-lang.in
index d28619fd7e3..504bc203169 100644
--- a/gcc/f/config-lang.in
+++ b/gcc/f/config-lang.in
@@ -26,42 +26,12 @@
# stagestuff - files to add to $(STAGESTUFF)
# diff_excludes - files to ignore when building diffs between two versions.
-#if grep DECL_STATIC_CONSTRUCTOR $srcdir/tree.h >/dev/null; then
-# if grep flag_move_all_movables $srcdir/toplev.c >/dev/null; then true
-# else
-# echo "You haven't applied the patches to the GCC 2.7.x distribution in"
-# echo "$srcdir as described in g77/README.g77 and gcc/f/gbe/README."
-# echo ""
-# exit 1
-# fi
-#else
-# if grep put_pending_sizes $srcdir/stor-layout.c >/dev/null; then true
-# else
-# echo "You haven't applied the patches to the GCC 2.6.x distribution in"
-# echo "$srcdir as described in g77/README.g77 and gcc/f/gbe/README."
-# echo ""
-# exit 1
-# fi
-#fi
-
language="f77"
compilers="f771\$(exeext)"
stagestuff="g77\$(exeext) g77-cross\$(exeext) f771\$(exeext)"
-diff_excludes="-x \"f/g77.info*\""
-
-test -d f || mkdir f
-for stageN in stage1 stage2 stage3 stage4
-do
- test -d $stageN || mkdir $stageN
- test -d $stageN/f || mkdir $stageN/f
-done
+diff_excludes="-x f/BUGS -x f/NEWS -x f/INSTALL -x f/intdoc.texi"
-# Make links into top-level stageN from target trees.
-for stageN in stage1 stage2 stage3 stage4 include
-do
- $remove -f f/$stageN
- (cd f; $symbolic_link ../$stageN . 2>/dev/null)
-done
+outputs=f/Makefile
diff --git a/gcc/f/config.j b/gcc/f/config.j
index b70c3c07b34..5bf37928672 100644
--- a/gcc/f/config.j
+++ b/gcc/f/config.j
@@ -1,27 +1 @@
-/* config.j -- Wrapper for GCC's config.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_config
-#define _J_f_config
-#include "config.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/convert.j b/gcc/f/convert.j
index c2e1e4f85d9..5bf37928672 100644
--- a/gcc/f/convert.j
+++ b/gcc/f/convert.j
@@ -1,28 +1 @@
-/* convert.j -- Wrapper for GCC's convert.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_convert
-#define _J_f_convert
-#include "tree.j"
-#include "convert.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/data.c b/gcc/f/data.c
index 15bf3b00cbb..4e359ac39d5 100644
--- a/gcc/f/data.c
+++ b/gcc/f/data.c
@@ -1,1810 +1,7 @@
-/* data.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
-
- Description:
- Do the tough things for DATA statement (and INTEGER FOO/.../-style
- initializations), like implied-DO and suchlike.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "data.h"
-#include "bit.h"
-#include "bld.h"
-#include "com.h"
-#include "expr.h"
-#include "global.h"
-#include "malloc.h"
-#include "st.h"
-#include "storag.h"
-#include "top.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-/* I picked this value as one that, when plugged into a couple of small
- but nearly identical test cases I have called BIG-0.f and BIG-1.f,
- causes BIG-1.f to take about 10 times as long (elapsed) to compile
- (in f771 only) as BIG-0.f. These test cases differ in that BIG-0.f
- doesn't put the one initialized variable in a common area that has
- a large uninitialized array in it, while BIG-1.f does. The size of
- the array is this many elements, as long as they all are INTEGER
- type. Note that, as of 0.5.18, sparse cases are better handled,
- so BIG-2.f now is used; it provides nonzero initial
- values for all elements of the same array BIG-0 has. */
-#ifndef FFEDATA_sizeTOO_BIG_INIT_
-#define FFEDATA_sizeTOO_BIG_INIT_ 75*1024
-#endif
-
-/* Internal typedefs. */
-
-typedef struct _ffedata_convert_cache_ *ffedataConvertCache_;
-typedef struct _ffedata_impdo_ *ffedataImpdo_;
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-struct _ffedata_convert_cache_
- {
- ffebld converted; /* Results of converting expr to following
- type. */
- ffeinfoBasictype basic_type;
- ffeinfoKindtype kind_type;
- ffetargetCharacterSize size;
- ffeinfoRank rank;
- };
-
-struct _ffedata_impdo_
- {
- ffedataImpdo_ outer; /* Enclosing IMPDO construct. */
- ffebld outer_list; /* Item after my IMPDO on the outer list. */
- ffebld my_list; /* Beginning of list in my IMPDO. */
- ffesymbol itervar; /* Iteration variable. */
- ffetargetIntegerDefault increment;
- ffetargetIntegerDefault final;
- };
-
-/* Static objects accessed by functions in this module. */
-
-static ffedataImpdo_ ffedata_stack_ = NULL;
-static ffebld ffedata_list_ = NULL;
-static bool ffedata_reinit_; /* value_ should report REINIT error. */
-static bool ffedata_reported_error_; /* Error has been reported. */
-static ffesymbol ffedata_symbol_ = NULL; /* Symbol being initialized. */
-static ffeinfoBasictype ffedata_basictype_; /* Info on symbol. */
-static ffeinfoKindtype ffedata_kindtype_;
-static ffestorag ffedata_storage_; /* If non-NULL, inits go into this parent. */
-static ffeinfoBasictype ffedata_storage_bt_; /* Info on storage. */
-static ffeinfoKindtype ffedata_storage_kt_;
-static ffetargetOffset ffedata_storage_size_; /* Size of entire storage. */
-static ffetargetAlign ffedata_storage_units_; /* #units per storage unit. */
-static ffetargetOffset ffedata_arraysize_; /* Size of array being
- inited. */
-static ffetargetOffset ffedata_expected_; /* Number of elements to
- init. */
-static ffetargetOffset ffedata_number_; /* #elements inited so far. */
-static ffetargetOffset ffedata_offset_; /* Offset of next element. */
-static ffetargetOffset ffedata_symbolsize_; /* Size of entire sym. */
-static ffetargetCharacterSize ffedata_size_; /* Size of an element. */
-static ffetargetCharacterSize ffedata_charexpected_; /* #char to init. */
-static ffetargetCharacterSize ffedata_charnumber_; /* #chars inited. */
-static ffetargetCharacterSize ffedata_charoffset_; /* Offset of next char. */
-static ffedataConvertCache_ ffedata_convert_cache_; /* Fewer conversions. */
-static int ffedata_convert_cache_max_ = 0; /* #entries available. */
-static int ffedata_convert_cache_use_ = 0; /* #entries in use. */
-
-/* Static functions (internal). */
-
-static bool ffedata_advance_ (void);
-static ffebld ffedata_convert_ (ffebld source, ffelexToken source_token,
- ffelexToken dest_token, ffeinfoBasictype bt, ffeinfoKindtype kt,
- ffeinfoRank rk, ffetargetCharacterSize sz);
-static ffetargetInteger1 ffedata_eval_integer1_ (ffebld expr);
-static ffetargetOffset ffedata_eval_offset_ (ffebld subscripts,
- ffebld dims);
-static ffetargetCharacterSize ffedata_eval_substr_begin_ (ffebld expr);
-static ffetargetCharacterSize ffedata_eval_substr_end_ (ffebld expr,
- ffetargetCharacterSize min, ffetargetCharacterSize max);
-static void ffedata_gather_ (ffestorag mst, ffestorag st);
-static void ffedata_pop_ (void);
-static void ffedata_push_ (void);
-static bool ffedata_value_ (ffebld value, ffelexToken token);
-
-/* Internal macros. */
-
-
-/* ffedata_begin -- Initialize with list of targets
-
- ffebld list;
- ffedata_begin(list); // ITEM... list of SYMTERs, ARRAYs, SUBSTRs, ...
-
- Remember the list. After this call, 0...n calls to ffedata_value must
- follow, and then a single call to ffedata_end. */
-
-void
-ffedata_begin (ffebld list)
-{
- assert (ffedata_list_ == NULL);
- ffedata_list_ = list;
- ffedata_symbol_ = NULL;
- ffedata_reported_error_ = FALSE;
- ffedata_reinit_ = FALSE;
- ffedata_advance_ ();
-}
-
-/* ffedata_end -- End of initialization sequence
-
- if (ffedata_end(FALSE))
- // everything's ok
-
- Make sure the end of the list is valid here. */
-
-bool
-ffedata_end (bool reported_error, ffelexToken t)
-{
- reported_error |= ffedata_reported_error_;
-
- /* If still targets to initialize, too few initializers, so complain. */
-
- if ((ffedata_symbol_ != NULL) && !reported_error)
- {
- reported_error = TRUE;
- ffebad_start (FFEBAD_DATA_TOOFEW);
- ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- }
-
- /* Pop off any impdo stacks (present only if ffedata_symbol_ != NULL). */
-
- while (ffedata_stack_ != NULL)
- ffedata_pop_ ();
-
- if (ffedata_list_ != NULL)
- {
- assert (reported_error);
- ffedata_list_ = NULL;
- }
-
- return TRUE;
-}
-
-/* ffedata_gather -- Gather previously disparate initializations into one place
-
- ffestorag st; // A typeCBLOCK or typeLOCAL aggregate.
- ffedata_gather(st);
-
- Prior to this call, st has no init or accretion info, but (presumably
- at least one of) its subordinate storage areas has init or accretion
- info. After this call, none of the subordinate storage areas has inits,
- because they've all been moved into the newly created init/accretion
- info for st. During this call, conflicting inits produce only one
- error message. */
-
-void
-ffedata_gather (ffestorag st)
-{
- ffesymbol s;
- ffebld b;
-
- /* Prepare info on the storage area we're putting init info into. */
-
- ffetarget_aggregate_info (&ffedata_storage_bt_, &ffedata_storage_kt_,
- &ffedata_storage_units_, ffestorag_basictype (st),
- ffestorag_kindtype (st));
- ffedata_storage_size_ = ffestorag_size (st) / ffedata_storage_units_;
- assert (ffestorag_size (st) % ffedata_storage_units_ == 0);
-
- /* If a CBLOCK, gather all the init info for its explicit members. */
-
- if ((ffestorag_type (st) == FFESTORAG_typeCBLOCK)
- && (ffestorag_symbol (st) != NULL))
- {
- s = ffestorag_symbol (st);
- for (b = ffesymbol_commonlist (s); b != NULL; b = ffebld_trail (b))
- ffedata_gather_ (st,
- ffesymbol_storage (ffebld_symter (ffebld_head (b))));
- }
-
- /* For CBLOCK or LOCAL, gather all the init info for equivalenced members. */
-
- ffestorag_drive (ffestorag_list_equivs (st), ffedata_gather_, st);
-}
-
-/* ffedata_value -- Provide some number of initial values
-
- ffebld value;
- ffelexToken t; // Points to the value.
- if (ffedata_value(1,value,t))
- // Everything's ok
-
- Makes sure the value is ok, then remembers it according to the list
- provided to ffedata_begin. As many instances of the value may be
- supplied as desired, as indicated by the first argument. */
-
-bool
-ffedata_value (ffetargetIntegerDefault rpt, ffebld value, ffelexToken token)
-{
- ffetargetIntegerDefault i;
-
- /* Maybe ignore zero values, to speed up compiling, even though we lose
- checking for multiple initializations for now. */
-
- if (!ffe_is_zeros ()
- && (value != NULL)
- && (ffebld_op (value) == FFEBLD_opCONTER)
- && ffebld_constant_is_zero (ffebld_conter (value)))
- value = NULL;
- else if ((value != NULL)
- && (ffebld_op (value) == FFEBLD_opANY))
- value = NULL;
- else
- {
- /* Must be a constant. */
- assert (value != NULL);
- assert (ffebld_op (value) == FFEBLD_opCONTER);
- }
-
- /* Later we can optimize certain cases by seeing that the target array can
- take some number of values, and provide this number to _value_. */
-
- if (rpt == 1)
- ffedata_convert_cache_use_ = -1; /* Don't bother caching. */
- else
- ffedata_convert_cache_use_ = 0; /* Maybe use the cache. */
-
- for (i = 0; i < rpt; ++i)
- {
- if ((ffedata_symbol_ != NULL)
- && !ffesymbol_is_init (ffedata_symbol_))
- {
- ffesymbol_signal_change (ffedata_symbol_);
- ffesymbol_update_init (ffedata_symbol_);
- if (1 || ffe_is_90 ())
- ffesymbol_update_save (ffedata_symbol_);
-#if FFEGLOBAL_ENABLED
- if (ffesymbol_common (ffedata_symbol_) != NULL)
- ffeglobal_init_common (ffesymbol_common (ffedata_symbol_),
- token);
-#endif
- ffesymbol_signal_unreported (ffedata_symbol_);
- }
- if (!ffedata_value_ (value, token))
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* ffedata_advance_ -- Advance initialization target to next item in list
-
- if (ffedata_advance_())
- // everything's ok
-
- Sets common info to characterize the next item in the list. Handles
- IMPDO constructs accordingly. Does not handle advances within a single
- item, as in the common extension "DATA CHARTYPE/33,34,35/", where
- CHARTYPE is CHARACTER*3, for example. */
-
-static bool
-ffedata_advance_ ()
-{
- ffebld next;
-
- /* Come here after handling an IMPDO. */
-
-tail_recurse: /* :::::::::::::::::::: */
-
- /* Assume we're not going to find a new target for now. */
-
- ffedata_symbol_ = NULL;
-
- /* If at the end of the list, we're done. */
-
- if (ffedata_list_ == NULL)
- {
- ffetargetIntegerDefault newval;
-
- if (ffedata_stack_ == NULL)
- return TRUE; /* No IMPDO in progress, we is done! */
-
- /* Iterate the IMPDO. */
-
- newval = ffesymbol_value (ffedata_stack_->itervar)
- + ffedata_stack_->increment;
-
- /* See if we're still in the loop. */
-
- if (((ffedata_stack_->increment > 0)
- ? newval > ffedata_stack_->final
- : newval < ffedata_stack_->final)
- || (((ffesymbol_value (ffedata_stack_->itervar) < 0)
- == (ffedata_stack_->increment < 0))
- && ((ffesymbol_value (ffedata_stack_->itervar) < 0)
- != (newval < 0)))) /* Overflow/underflow? */
- { /* Done with the loop. */
- ffedata_list_ = ffedata_stack_->outer_list; /* Restore list. */
- ffedata_pop_ (); /* Pop me off the impdo stack. */
- }
- else
- { /* Still in the loop, reset the list and
- update the iter var. */
- ffedata_list_ = ffedata_stack_->my_list; /* Reset list. */
- ffesymbol_set_value (ffedata_stack_->itervar, newval);
- }
- goto tail_recurse; /* :::::::::::::::::::: */
- }
-
- /* Move to the next item in the list. */
-
- next = ffebld_head (ffedata_list_);
- ffedata_list_ = ffebld_trail (ffedata_list_);
-
- /* Really shouldn't happen. */
-
- if (next == NULL)
- return TRUE;
-
- /* See what kind of target this is. */
-
- switch (ffebld_op (next))
- {
- case FFEBLD_opSYMTER: /* Simple reference to scalar or array. */
- ffedata_symbol_ = ffebld_symter (next);
- ffedata_storage_ = (ffesymbol_storage (ffedata_symbol_) == NULL) ? NULL
- : ffestorag_parent (ffesymbol_storage (ffedata_symbol_));
- if (ffedata_storage_ != NULL)
- {
- ffetarget_aggregate_info (&ffedata_storage_bt_, &ffedata_storage_kt_,
- &ffedata_storage_units_,
- ffestorag_basictype (ffedata_storage_),
- ffestorag_kindtype (ffedata_storage_));
- ffedata_storage_size_ = ffestorag_size (ffedata_storage_)
- / ffedata_storage_units_;
- assert (ffestorag_size (ffedata_storage_) % ffedata_storage_units_ == 0);
- }
-
- if ((ffesymbol_init (ffedata_symbol_) != NULL)
- || (ffesymbol_accretion (ffedata_symbol_) != NULL)
- || ((ffedata_storage_ != NULL)
- && (ffestorag_init (ffedata_storage_) != NULL)))
- {
-#if 0
- ffebad_start (FFEBAD_DATA_REINIT);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
-#else
- ffedata_reinit_ = TRUE;
- return TRUE;
-#endif
- }
- ffedata_basictype_ = ffesymbol_basictype (ffedata_symbol_);
- ffedata_kindtype_ = ffesymbol_kindtype (ffedata_symbol_);
- if (ffesymbol_rank (ffedata_symbol_) == 0)
- ffedata_arraysize_ = 1;
- else
- {
- ffebld size = ffesymbol_arraysize (ffedata_symbol_);
-
- assert (size != NULL);
- assert (ffebld_op (size) == FFEBLD_opCONTER);
- assert (ffeinfo_basictype (ffebld_info (size))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (size))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffedata_arraysize_ = ffebld_constant_integerdefault (ffebld_conter
- (size));
- }
- ffedata_expected_ = ffedata_arraysize_;
- ffedata_number_ = 0;
- ffedata_offset_ = 0;
- ffedata_size_ = (ffedata_basictype_ == FFEINFO_basictypeCHARACTER)
- ? ffesymbol_size (ffedata_symbol_) : 1;
- ffedata_symbolsize_ = ffedata_size_ * ffedata_arraysize_;
- ffedata_charexpected_ = ffedata_size_;
- ffedata_charnumber_ = 0;
- ffedata_charoffset_ = 0;
- break;
-
- case FFEBLD_opARRAYREF: /* Reference to element of array. */
- ffedata_symbol_ = ffebld_symter (ffebld_left (next));
- ffedata_storage_ = (ffesymbol_storage (ffedata_symbol_) == NULL) ? NULL
- : ffestorag_parent (ffesymbol_storage (ffedata_symbol_));
- if (ffedata_storage_ != NULL)
- {
- ffetarget_aggregate_info (&ffedata_storage_bt_, &ffedata_storage_kt_,
- &ffedata_storage_units_,
- ffestorag_basictype (ffedata_storage_),
- ffestorag_kindtype (ffedata_storage_));
- ffedata_storage_size_ = ffestorag_size (ffedata_storage_)
- / ffedata_storage_units_;
- assert (ffestorag_size (ffedata_storage_) % ffedata_storage_units_ == 0);
- }
-
- if ((ffesymbol_init (ffedata_symbol_) != NULL)
- || ((ffedata_storage_ != NULL)
- && (ffestorag_init (ffedata_storage_) != NULL)))
- {
-#if 0
- ffebad_start (FFEBAD_DATA_REINIT);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
-#else
- ffedata_reinit_ = TRUE;
- return TRUE;
-#endif
- }
- ffedata_basictype_ = ffesymbol_basictype (ffedata_symbol_);
- ffedata_kindtype_ = ffesymbol_kindtype (ffedata_symbol_);
- if (ffesymbol_rank (ffedata_symbol_) == 0)
- ffedata_arraysize_ = 1; /* Shouldn't happen in this case... */
- else
- {
- ffebld size = ffesymbol_arraysize (ffedata_symbol_);
-
- assert (size != NULL);
- assert (ffebld_op (size) == FFEBLD_opCONTER);
- assert (ffeinfo_basictype (ffebld_info (size))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (size))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffedata_arraysize_ = ffebld_constant_integerdefault (ffebld_conter
- (size));
- }
- ffedata_expected_ = 1;
- ffedata_number_ = 0;
- ffedata_offset_ = ffedata_eval_offset_ (ffebld_right (next),
- ffesymbol_dims (ffedata_symbol_));
- ffedata_size_ = (ffedata_basictype_ == FFEINFO_basictypeCHARACTER)
- ? ffesymbol_size (ffedata_symbol_) : 1;
- ffedata_symbolsize_ = ffedata_size_ * ffedata_arraysize_;
- ffedata_charexpected_ = ffedata_size_;
- ffedata_charnumber_ = 0;
- ffedata_charoffset_ = 0;
- break;
-
- case FFEBLD_opSUBSTR: /* Substring reference to scalar or array
- element. */
- {
- bool arrayref = ffebld_op (ffebld_left (next)) == FFEBLD_opARRAYREF;
- ffebld colon = ffebld_right (next);
-
- assert (colon != NULL);
-
- ffedata_symbol_ = ffebld_symter (ffebld_left (arrayref
- ? ffebld_left (next) : next));
- ffedata_storage_ = (ffesymbol_storage (ffedata_symbol_) == NULL) ? NULL
- : ffestorag_parent (ffesymbol_storage (ffedata_symbol_));
- if (ffedata_storage_ != NULL)
- {
- ffetarget_aggregate_info (&ffedata_storage_bt_, &ffedata_storage_kt_,
- &ffedata_storage_units_,
- ffestorag_basictype (ffedata_storage_),
- ffestorag_kindtype (ffedata_storage_));
- ffedata_storage_size_ = ffestorag_size (ffedata_storage_)
- / ffedata_storage_units_;
- assert (ffestorag_size (ffedata_storage_) % ffedata_storage_units_ == 0);
- }
-
- if ((ffesymbol_init (ffedata_symbol_) != NULL)
- || ((ffedata_storage_ != NULL)
- && (ffestorag_init (ffedata_storage_) != NULL)))
- {
-#if 0
- ffebad_start (FFEBAD_DATA_REINIT);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
-#else
- ffedata_reinit_ = TRUE;
- return TRUE;
-#endif
- }
- ffedata_basictype_ = ffesymbol_basictype (ffedata_symbol_);
- ffedata_kindtype_ = ffesymbol_kindtype (ffedata_symbol_);
- if (ffesymbol_rank (ffedata_symbol_) == 0)
- ffedata_arraysize_ = 1;
- else
- {
- ffebld size = ffesymbol_arraysize (ffedata_symbol_);
-
- assert (size != NULL);
- assert (ffebld_op (size) == FFEBLD_opCONTER);
- assert (ffeinfo_basictype (ffebld_info (size))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (size))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffedata_arraysize_ = ffebld_constant_integerdefault (ffebld_conter
- (size));
- }
- ffedata_expected_ = arrayref ? 1 : ffedata_arraysize_;
- ffedata_number_ = 0;
- ffedata_offset_ = arrayref ? ffedata_eval_offset_ (ffebld_right
- (ffebld_left (next)), ffesymbol_dims (ffedata_symbol_)) : 0;
- ffedata_size_ = ffesymbol_size (ffedata_symbol_);
- ffedata_symbolsize_ = ffedata_size_ * ffedata_arraysize_;
- ffedata_charnumber_ = 0;
- ffedata_charoffset_ = ffedata_eval_substr_begin_ (ffebld_head (colon));
- ffedata_charexpected_ = ffedata_eval_substr_end_ (ffebld_head
- (ffebld_trail (colon)), ffedata_charoffset_,
- ffedata_size_) - ffedata_charoffset_ + 1;
- }
- break;
-
- case FFEBLD_opIMPDO: /* Implied-DO construct. */
- {
- ffebld itervar;
- ffebld start;
- ffebld end;
- ffebld incr;
- ffebld item = ffebld_right (next);
-
- itervar = ffebld_head (item);
- item = ffebld_trail (item);
- start = ffebld_head (item);
- item = ffebld_trail (item);
- end = ffebld_head (item);
- item = ffebld_trail (item);
- incr = ffebld_head (item);
-
- ffedata_push_ ();
- ffedata_stack_->outer_list = ffedata_list_;
- ffedata_stack_->my_list = ffedata_list_ = ffebld_left (next);
-
- assert (ffeinfo_basictype (ffebld_info (itervar))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (itervar))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffedata_stack_->itervar = ffebld_symter (itervar);
-
- assert (ffeinfo_basictype (ffebld_info (start))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (start))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffesymbol_set_value (ffedata_stack_->itervar, ffedata_eval_integer1_ (start));
-
- assert (ffeinfo_basictype (ffebld_info (end))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (end))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffedata_stack_->final = ffedata_eval_integer1_ (end);
-
- if (incr == NULL)
- ffedata_stack_->increment = 1;
- else
- {
- assert (ffeinfo_basictype (ffebld_info (incr))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (incr))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- ffedata_stack_->increment = ffedata_eval_integer1_ (incr);
- if (ffedata_stack_->increment == 0)
- {
- ffebad_start (FFEBAD_DATA_ZERO);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_stack_->itervar));
- ffebad_finish ();
- ffedata_pop_ ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
- }
-
- if ((ffedata_stack_->increment > 0)
- ? ffesymbol_value (ffedata_stack_->itervar)
- > ffedata_stack_->final
- : ffesymbol_value (ffedata_stack_->itervar)
- < ffedata_stack_->final)
- {
- ffedata_reported_error_ = TRUE;
- ffebad_start (FFEBAD_DATA_EMPTY);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_stack_->itervar));
- ffebad_finish ();
- ffedata_pop_ ();
- return FALSE;
- }
- }
- goto tail_recurse; /* :::::::::::::::::::: */
-
- case FFEBLD_opANY:
- ffedata_reported_error_ = TRUE;
- return FALSE;
-
- default:
- assert ("bad op" == NULL);
- break;
- }
-
- return TRUE;
-}
-
-/* ffedata_convert_ -- Convert source expression to given type using cache
-
- ffebld source;
- ffelexToken source_token;
- ffelexToken dest_token; // Any appropriate token for "destination".
- ffeinfoBasictype bt;
- ffeinfoKindtype kt;
- ffetargetCharactersize sz;
- source = ffedata_convert_(source,source_token,dest_token,bt,kt,sz);
-
- Like ffeexpr_convert, but calls it only if necessary (if the converted
- expression doesn't already exist in the cache) and then puts the result
- in the cache. */
-
-ffebld
-ffedata_convert_ (ffebld source, ffelexToken source_token,
- ffelexToken dest_token, ffeinfoBasictype bt,
- ffeinfoKindtype kt, ffeinfoRank rk,
- ffetargetCharacterSize sz)
-{
- ffebld converted;
- int i;
- int max;
- ffedataConvertCache_ cache;
-
- for (i = 0; i < ffedata_convert_cache_use_; ++i)
- if ((bt == ffedata_convert_cache_[i].basic_type)
- && (kt == ffedata_convert_cache_[i].kind_type)
- && (sz == ffedata_convert_cache_[i].size)
- && (rk == ffedata_convert_cache_[i].rank))
- return ffedata_convert_cache_[i].converted;
-
- converted = ffeexpr_convert (source, source_token, dest_token, bt, kt, rk,
- sz, FFEEXPR_contextDATA);
-
- if (ffedata_convert_cache_use_ >= ffedata_convert_cache_max_)
- {
- if (ffedata_convert_cache_max_ == 0)
- max = 4;
- else
- max = ffedata_convert_cache_max_ << 1;
-
- if (max > ffedata_convert_cache_max_)
- {
- cache = (ffedataConvertCache_) malloc_new_ks (malloc_pool_image (),
- "FFEDATA cache", max * sizeof (*cache));
- if (ffedata_convert_cache_max_ != 0)
- {
- memcpy (cache, ffedata_convert_cache_,
- ffedata_convert_cache_max_ * sizeof (*cache));
- malloc_kill_ks (malloc_pool_image (), ffedata_convert_cache_,
- ffedata_convert_cache_max_ * sizeof (*cache));
- }
- ffedata_convert_cache_ = cache;
- ffedata_convert_cache_max_ = max;
- }
- else
- return converted; /* In case int overflows! */
- }
-
- i = ffedata_convert_cache_use_++;
-
- ffedata_convert_cache_[i].converted = converted;
- ffedata_convert_cache_[i].basic_type = bt;
- ffedata_convert_cache_[i].kind_type = kt;
- ffedata_convert_cache_[i].size = sz;
- ffedata_convert_cache_[i].rank = rk;
-
- return converted;
-}
-
-/* ffedata_eval_integer1_ -- Evaluate expression
-
- ffetargetIntegerDefault result;
- ffebld expr; // must be kindtypeINTEGER1.
-
- result = ffedata_eval_integer1_(expr);
-
- Evalues the expression (which yields a kindtypeINTEGER1 result) and
- returns the result. */
-
-static ffetargetIntegerDefault
-ffedata_eval_integer1_ (ffebld expr)
-{
- ffetargetInteger1 result;
- ffebad error;
-
- assert (expr != NULL);
-
- switch (ffebld_op (expr))
- {
- case FFEBLD_opCONTER:
- return ffebld_constant_integer1 (ffebld_conter (expr));
-
- case FFEBLD_opSYMTER:
- return ffesymbol_value (ffebld_symter (expr));
-
- case FFEBLD_opUPLUS:
- return ffedata_eval_integer1_ (ffebld_left (expr));
-
- case FFEBLD_opUMINUS:
- error = ffetarget_uminus_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)));
- break;
-
- case FFEBLD_opADD:
- error = ffetarget_add_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opSUBTRACT:
- error = ffetarget_subtract_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opMULTIPLY:
- error = ffetarget_multiply_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opDIVIDE:
- error = ffetarget_divide_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opPOWER:
- {
- ffebld r = ffebld_right (expr);
-
- if ((ffeinfo_basictype (ffebld_info (r)) != FFEINFO_basictypeINTEGER)
- || (ffeinfo_kindtype (ffebld_info (r)) != FFEINFO_kindtypeINTEGERDEFAULT))
- error = FFEBAD_DATA_EVAL;
- else
- error = ffetarget_power_integerdefault_integerdefault (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (r));
- }
- break;
-
-#if 0 /* Only for character basictype. */
- case FFEBLD_opCONCATENATE:
- error =;
- break;
-#endif
-
- case FFEBLD_opNOT:
- error = ffetarget_not_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)));
- break;
-
-#if 0 /* Only for logical basictype. */
- case FFEBLD_opLT:
- error =;
- break;
-
- case FFEBLD_opLE:
- error =;
- break;
-
- case FFEBLD_opEQ:
- error =;
- break;
-
- case FFEBLD_opNE:
- error =;
- break;
-
- case FFEBLD_opGT:
- error =;
- break;
-
- case FFEBLD_opGE:
- error =;
- break;
-#endif
-
- case FFEBLD_opAND:
- error = ffetarget_and_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opOR:
- error = ffetarget_or_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opXOR:
- error = ffetarget_xor_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opEQV:
- error = ffetarget_eqv_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opNEQV:
- error = ffetarget_neqv_integer1 (&result,
- ffedata_eval_integer1_ (ffebld_left (expr)),
- ffedata_eval_integer1_ (ffebld_right (expr)));
- break;
-
- case FFEBLD_opPAREN:
- return ffedata_eval_integer1_ (ffebld_left (expr));
-
-#if 0 /* ~~ no idea how to do this */
- case FFEBLD_opPERCENT_LOC:
- error =;
- break;
-#endif
-
-#if 0 /* not allowed by ANSI, but perhaps as an
- extension someday? */
- case FFEBLD_opCONVERT:
- switch (ffeinfo_basictype (ffebld_info (ffebld_left (expr))))
- {
- case FFEINFO_basictypeINTEGER:
- switch (ffeinfo_kindtype (ffebld_info (ffebld_left (expr))))
- {
- default:
- error = FFEBAD_DATA_EVAL;
- break;
- }
- break;
-
- case FFEINFO_basictypeREAL:
- switch (ffeinfo_kindtype (ffebld_info (ffebld_left (expr))))
- {
- default:
- error = FFEBAD_DATA_EVAL;
- break;
- }
- break;
- }
- break;
-#endif
-
-#if 0 /* not valid ops */
- case FFEBLD_opREPEAT:
- error =;
- break;
-
- case FFEBLD_opBOUNDS:
- error =;
- break;
-#endif
-
-#if 0 /* not allowed by ANSI, but perhaps as an
- extension someday? */
- case FFEBLD_opFUNCREF:
- error =;
- break;
-#endif
-
-#if 0 /* not valid ops */
- case FFEBLD_opSUBRREF:
- error =;
- break;
-
- case FFEBLD_opARRAYREF:
- error =;
- break;
-#endif
-
-#if 0 /* not valid for integer1 */
- case FFEBLD_opSUBSTR:
- error =;
- break;
-#endif
-
- default:
- error = FFEBAD_DATA_EVAL;
- break;
- }
-
- if (error != FFEBAD)
- {
- ffebad_start (error);
- ffest_ffebad_here_current_stmt (0);
- ffebad_finish ();
- result = 0;
- }
-
- return result;
-}
-
-/* ffedata_eval_offset_ -- Evaluate offset info array
-
- ffetargetOffset offset; // 0...max-1.
- ffebld subscripts; // an opITEM list of subscript exprs.
- ffebld dims; // an opITEM list of opBOUNDS exprs.
-
- result = ffedata_eval_offset_(expr);
-
- Evalues the expression (which yields a kindtypeINTEGER1 result) and
- returns the result. */
-
-static ffetargetOffset
-ffedata_eval_offset_ (ffebld subscripts, ffebld dims)
-{
- ffetargetIntegerDefault offset = 0;
- ffetargetIntegerDefault width = 1;
- ffetargetIntegerDefault value;
- ffetargetIntegerDefault lowbound;
- ffetargetIntegerDefault highbound;
- ffetargetOffset final;
- ffebld subscript;
- ffebld dim;
- ffebld low;
- ffebld high;
- int rank = 0;
- bool ok;
-
- while (subscripts != NULL)
- {
- ++rank;
- assert (dims != NULL);
-
- subscript = ffebld_head (subscripts);
- dim = ffebld_head (dims);
-
- assert (ffeinfo_basictype (ffebld_info (subscript)) == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (subscript)) == FFEINFO_kindtypeINTEGER1);
- value = ffedata_eval_integer1_ (subscript);
-
- assert (ffebld_op (dim) == FFEBLD_opBOUNDS);
- low = ffebld_left (dim);
- high = ffebld_right (dim);
-
- if (low == NULL)
- lowbound = 1;
- else
- {
- assert (ffeinfo_basictype (ffebld_info (low)) == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (low)) == FFEINFO_kindtypeINTEGERDEFAULT);
- lowbound = ffedata_eval_integer1_ (low);
- }
-
- assert (ffeinfo_basictype (ffebld_info (high)) == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (high)) == FFEINFO_kindtypeINTEGERDEFAULT);
- highbound = ffedata_eval_integer1_ (high);
-
- if ((value < lowbound) || (value > highbound))
- {
- char rankstr[10];
-
- sprintf (rankstr, "%d", rank);
- value = lowbound;
- ffebad_start (FFEBAD_DATA_SUBSCRIPT);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_string (rankstr);
- ffebad_finish ();
- }
-
- subscripts = ffebld_trail (subscripts);
- dims = ffebld_trail (dims);
-
- offset += width * (value - lowbound);
- if (subscripts != NULL)
- width *= highbound - lowbound + 1;
- }
-
- assert (dims == NULL);
-
- ok = ffetarget_offset (&final, offset);
- assert (ok);
-
- return final;
-}
-
-/* ffedata_eval_substr_begin_ -- Evaluate begin-point of substr reference
-
- ffetargetCharacterSize beginpoint;
- ffebld endval; // head(colon).
-
- beginpoint = ffedata_eval_substr_end_(endval);
-
- If beginval is NULL, returns 0. Otherwise makes sure beginval is
- kindtypeINTEGERDEFAULT, makes sure its value is > 0,
- and returns its value minus one, or issues an error message. */
-
-static ffetargetCharacterSize
-ffedata_eval_substr_begin_ (ffebld expr)
-{
- ffetargetIntegerDefault val;
-
- if (expr == NULL)
- return 0;
-
- assert (ffeinfo_basictype (ffebld_info (expr)) == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (expr)) == FFEINFO_kindtypeINTEGERDEFAULT);
-
- val = ffedata_eval_integer1_ (expr);
-
- if (val < 1)
- {
- val = 1;
- ffebad_start (FFEBAD_DATA_RANGE);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- }
-
- return val - 1;
-}
-
-/* ffedata_eval_substr_end_ -- Evaluate end-point of substr reference
-
- ffetargetCharacterSize endpoint;
- ffebld endval; // head(trail(colon)).
- ffetargetCharacterSize min; // beginpoint of substr reference.
- ffetargetCharacterSize max; // size of entity.
-
- endpoint = ffedata_eval_substr_end_(endval,dflt);
-
- If endval is NULL, returns max. Otherwise makes sure endval is
- kindtypeINTEGERDEFAULT, makes sure its value is > min and <= max,
- and returns its value minus one, or issues an error message. */
-
-static ffetargetCharacterSize
-ffedata_eval_substr_end_ (ffebld expr, ffetargetCharacterSize min,
- ffetargetCharacterSize max)
-{
- ffetargetIntegerDefault val;
-
- if (expr == NULL)
- return max - 1;
-
- assert (ffeinfo_basictype (ffebld_info (expr)) == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (expr)) == FFEINFO_kindtypeINTEGER1);
-
- val = ffedata_eval_integer1_ (expr);
-
- if ((val < (ffetargetIntegerDefault) min)
- || (val > (ffetargetIntegerDefault) max))
- {
- val = 1;
- ffebad_start (FFEBAD_DATA_RANGE);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- }
-
- return val - 1;
-}
-
-/* ffedata_gather_ -- Gather initial values for sym into master sym inits
-
- ffestorag mst; // A typeCBLOCK or typeLOCAL aggregate.
- ffestorag st; // A typeCOMMON or typeEQUIV member.
- ffedata_gather_(mst,st);
-
- If st has any initialization info, transfer that info into mst and
- clear st's info. */
-
-void
-ffedata_gather_ (ffestorag mst, ffestorag st)
-{
- ffesymbol s;
- ffesymbol s_whine; /* Symbol to complain about in diagnostics. */
- ffebld b;
- ffetargetOffset offset;
- ffetargetOffset units_expected;
- ffebitCount actual;
- ffebldConstantArray array;
- ffebld accter;
- ffetargetCopyfunc fn;
- void *ptr1;
- void *ptr2;
- size_t size;
- ffeinfoBasictype bt;
- ffeinfoKindtype kt;
- ffeinfoBasictype ign_bt;
- ffeinfoKindtype ign_kt;
- ffetargetAlign units;
- ffebit bits;
- ffetargetOffset source_offset;
- bool whine = FALSE;
-
- if (st == NULL)
- return; /* Nothing to do. */
-
- s = ffestorag_symbol (st);
-
- assert (s != NULL); /* Must have a corresponding symbol (else how
- inited?). */
- assert (ffestorag_init (st) == NULL); /* No init info on storage itself. */
- assert (ffestorag_accretion (st) == NULL);
-
- if ((((b = ffesymbol_init (s)) == NULL)
- && ((b = ffesymbol_accretion (s)) == NULL))
- || (ffebld_op (b) == FFEBLD_opANY)
- || ((ffebld_op (b) == FFEBLD_opCONVERT)
- && (ffebld_op (ffebld_left (b)) == FFEBLD_opANY)))
- return; /* Nothing to do. */
-
- /* b now holds the init/accretion expr. */
-
- ffesymbol_set_init (s, NULL);
- ffesymbol_set_accretion (s, NULL);
- ffesymbol_set_accretes (s, 0);
-
- s_whine = ffestorag_symbol (mst);
- if (s_whine == NULL)
- s_whine = s;
-
- /* Make sure we haven't fully accreted during an array init. */
-
- if (ffestorag_init (mst) != NULL)
- {
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffewhere_line_unknown (), ffewhere_column_unknown ());
- ffebad_string (ffesymbol_text (s_whine));
- ffebad_finish ();
- return;
- }
-
- bt = ffeinfo_basictype (ffebld_info (b));
- kt = ffeinfo_kindtype (ffebld_info (b));
-
- /* Calculate offset for aggregate area. */
-
- ffedata_charexpected_ = (bt == FFEINFO_basictypeCHARACTER)
- ? ffebld_size (b) : 1;
- ffetarget_aggregate_info (&ign_bt, &ign_kt, &units, bt,
- kt);/* Find out unit size of source datum. */
- assert (units % ffedata_storage_units_ == 0);
- units_expected = ffedata_charexpected_ * units / ffedata_storage_units_;
- offset = (ffestorag_offset (st) - ffestorag_offset (mst))
- / ffedata_storage_units_;
-
- /* Does an accretion array exist? If not, create it. */
-
- if (ffestorag_accretion (mst) == NULL)
- {
-#if FFEDATA_sizeTOO_BIG_INIT_ != 0
- if (ffedata_storage_size_ >= FFEDATA_sizeTOO_BIG_INIT_)
- {
- char bignum[40];
-
- sprintf (&bignum[0], "%ld", (long) ffedata_storage_size_);
- ffebad_start (FFEBAD_TOO_BIG_INIT);
- ffebad_here (0, ffesymbol_where_line (s_whine),
- ffesymbol_where_column (s_whine));
- ffebad_string (ffesymbol_text (s_whine));
- ffebad_string (bignum);
- ffebad_finish ();
- }
-#endif
- array = ffebld_constantarray_new (ffedata_storage_bt_,
- ffedata_storage_kt_, ffedata_storage_size_);
- accter = ffebld_new_accter (array, ffebit_new (ffe_pool_program_unit (),
- ffedata_storage_size_));
- ffebld_set_info (accter, ffeinfo_new
- (ffedata_storage_bt_,
- ffedata_storage_kt_,
- 1,
- FFEINFO_kindENTITY,
- FFEINFO_whereCONSTANT,
- (ffedata_basictype_ == FFEINFO_basictypeCHARACTER)
- ? 1 : FFETARGET_charactersizeNONE));
- ffestorag_set_accretion (mst, accter);
- ffestorag_set_accretes (mst, ffedata_storage_size_);
- }
- else
- {
- accter = ffestorag_accretion (mst);
- assert (ffedata_storage_size_ == (ffetargetOffset) ffebld_accter_size (accter));
- array = ffebld_accter (accter);
- }
-
- /* Put value in accretion array at desired offset. */
-
- fn = ffetarget_aggregate_ptr_memcpy (ffedata_storage_bt_, ffedata_storage_kt_,
- bt, kt);
-
- switch (ffebld_op (b))
- {
- case FFEBLD_opCONTER:
- ffebld_constantarray_prepare (&ptr1, &ptr2, &size, array, ffedata_storage_bt_,
- ffedata_storage_kt_, offset,
- ffebld_constant_ptr_to_union (ffebld_conter (b)),
- bt, kt);
- (*fn) (ptr1, ptr2, size); /* Does the appropriate memcpy-like
- operation. */
- ffebit_count (ffebld_accter_bits (accter),
- offset, FALSE, units_expected, &actual); /* How many FALSE? */
- if (units_expected != (ffetargetOffset) actual)
- {
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffewhere_line_unknown (), ffewhere_column_unknown ());
- ffebad_string (ffesymbol_text (s));
- ffebad_finish ();
- }
- ffestorag_set_accretes (mst,
- ffestorag_accretes (mst)
- - actual); /* Decrement # of values
- actually accreted. */
- ffebit_set (ffebld_accter_bits (accter), offset, 1, units_expected);
-
- /* If done accreting for this storage area, establish as initialized. */
-
- if (ffestorag_accretes (mst) == 0)
- {
- ffestorag_set_init (mst, accter);
- ffestorag_set_accretion (mst, NULL);
- ffebit_kill (ffebld_accter_bits (ffestorag_init (mst)));
- ffebld_set_op (ffestorag_init (mst), FFEBLD_opARRTER);
- ffebld_set_arrter (ffestorag_init (mst),
- ffebld_accter (ffestorag_init (mst)));
- ffebld_arrter_set_size (ffestorag_init (mst),
- ffedata_storage_size_);
- ffecom_notify_init_storage (mst);
- }
-
- return;
-
- case FFEBLD_opARRTER:
- ffebld_constantarray_preparray (&ptr1, &ptr2, &size, array, ffedata_storage_bt_,
- ffedata_storage_kt_, offset, ffebld_arrter (b),
- bt, kt);
- size *= ffebld_arrter_size (b);
- units_expected *= ffebld_arrter_size (b);
- (*fn) (ptr1, ptr2, size); /* Does the appropriate memcpy-like
- operation. */
- ffebit_count (ffebld_accter_bits (accter),
- offset, FALSE, units_expected, &actual); /* How many FALSE? */
- if (units_expected != (ffetargetOffset) actual)
- {
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffewhere_line_unknown (), ffewhere_column_unknown ());
- ffebad_string (ffesymbol_text (s));
- ffebad_finish ();
- }
- ffestorag_set_accretes (mst,
- ffestorag_accretes (mst)
- - actual); /* Decrement # of values
- actually accreted. */
- ffebit_set (ffebld_accter_bits (accter), offset, 1, units_expected);
-
- /* If done accreting for this storage area, establish as initialized. */
-
- if (ffestorag_accretes (mst) == 0)
- {
- ffestorag_set_init (mst, accter);
- ffestorag_set_accretion (mst, NULL);
- ffebit_kill (ffebld_accter_bits (ffestorag_init (mst)));
- ffebld_set_op (ffestorag_init (mst), FFEBLD_opARRTER);
- ffebld_set_arrter (ffestorag_init (mst),
- ffebld_accter (ffestorag_init (mst)));
- ffebld_arrter_set_size (ffestorag_init (mst),
- ffedata_storage_size_);
- ffecom_notify_init_storage (mst);
- }
-
- return;
-
- case FFEBLD_opACCTER:
- ffebld_constantarray_preparray (&ptr1, &ptr2, &size, array, ffedata_storage_bt_,
- ffedata_storage_kt_, offset, ffebld_accter (b),
- bt, kt);
- bits = ffebld_accter_bits (b);
- source_offset = 0;
-
- for (;;)
- {
- ffetargetOffset unexp;
- ffetargetOffset siz;
- ffebitCount length;
- bool value;
-
- ffebit_test (bits, source_offset, &value, &length);
- if (length == 0)
- break; /* Exit the loop early. */
- siz = size * length;
- unexp = units_expected * length;
- if (value)
- {
- (*fn) (ptr1, ptr2, siz); /* Does memcpy-like operation. */
- ffebit_count (ffebld_accter_bits (accter), /* How many FALSE? */
- offset, FALSE, unexp, &actual);
- if (!whine && (unexp != (ffetargetOffset) actual))
- {
- whine = TRUE; /* Don't whine more than once for one gather. */
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffewhere_line_unknown (), ffewhere_column_unknown ());
- ffebad_string (ffesymbol_text (s));
- ffebad_finish ();
- }
- ffestorag_set_accretes (mst,
- ffestorag_accretes (mst)
- - actual); /* Decrement # of values
- actually accreted. */
- ffebit_set (ffebld_accter_bits (accter), offset, 1, unexp);
- }
- source_offset += length;
- offset += unexp;
- ptr1 = ((char *) ptr1) + siz;
- ptr2 = ((char *) ptr2) + siz;
- }
-
- /* If done accreting for this storage area, establish as initialized. */
-
- if (ffestorag_accretes (mst) == 0)
- {
- ffestorag_set_init (mst, accter);
- ffestorag_set_accretion (mst, NULL);
- ffebit_kill (ffebld_accter_bits (ffestorag_init (mst)));
- ffebld_set_op (ffestorag_init (mst), FFEBLD_opARRTER);
- ffebld_set_arrter (ffestorag_init (mst),
- ffebld_accter (ffestorag_init (mst)));
- ffebld_arrter_set_size (ffestorag_init (mst),
- ffedata_storage_size_);
- ffecom_notify_init_storage (mst);
- }
-
- return;
-
- default:
- assert ("bad init op in gather_" == NULL);
- return;
- }
-}
-
-/* ffedata_pop_ -- Pop an impdo stack entry
-
- ffedata_pop_(); */
-
-static void
-ffedata_pop_ ()
-{
- ffedataImpdo_ victim = ffedata_stack_;
-
- assert (victim != NULL);
-
- ffedata_stack_ = ffedata_stack_->outer;
-
- malloc_kill_ks (ffe_pool_program_unit (), victim, sizeof (*victim));
-}
-
-/* ffedata_push_ -- Push an impdo stack entry
-
- ffedata_push_(); */
-
-static void
-ffedata_push_ ()
-{
- ffedataImpdo_ baby;
-
- baby = malloc_new_ks (ffe_pool_program_unit (), "ffedataImpdo_", sizeof (*baby));
-
- baby->outer = ffedata_stack_;
- ffedata_stack_ = baby;
-}
-
-/* ffedata_value_ -- Provide an initial value
-
- ffebld value;
- ffelexToken t; // Points to the value.
- if (ffedata_value(value,t))
- // Everything's ok
-
- Makes sure the value is ok, then remembers it according to the list
- provided to ffedata_begin. */
-
-static bool
-ffedata_value_ (ffebld value, ffelexToken token)
-{
-
- /* If already reported an error, don't do anything. */
-
- if (ffedata_reported_error_)
- return FALSE;
-
- /* If the value is an error marker, remember we've seen one and do nothing
- else. */
-
- if ((value != NULL)
- && (ffebld_op (value) == FFEBLD_opANY))
- {
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
- /* If too many values (no more targets), complain. */
-
- if (ffedata_symbol_ == NULL)
- {
- ffebad_start (FFEBAD_DATA_TOOMANY);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
- /* If ffedata_advance_ wanted to register a complaint, do it now
- that we have the token to point at instead of just the start
- of the whole statement. */
-
- if (ffedata_reinit_)
- {
- ffebad_start (FFEBAD_DATA_REINIT);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
-#if FFEGLOBAL_ENABLED
- if (ffesymbol_common (ffedata_symbol_) != NULL)
- ffeglobal_init_common (ffesymbol_common (ffedata_symbol_), token);
-#endif
-
- /* Convert value to desired type. */
-
- if (value != NULL)
- {
- if (ffedata_convert_cache_use_ == -1)
- value = ffeexpr_convert
- (value, token, NULL, ffedata_basictype_,
- ffedata_kindtype_, 0,
- (ffedata_basictype_ == FFEINFO_basictypeCHARACTER)
- ? ffedata_charexpected_ : FFETARGET_charactersizeNONE,
- FFEEXPR_contextDATA);
- else /* Use the cache. */
- value = ffedata_convert_
- (value, token, NULL, ffedata_basictype_,
- ffedata_kindtype_, 0,
- (ffedata_basictype_ == FFEINFO_basictypeCHARACTER)
- ? ffedata_charexpected_ : FFETARGET_charactersizeNONE);
- }
-
- /* If we couldn't, bug out. */
-
- if ((value != NULL) && (ffebld_op (value) == FFEBLD_opANY))
- {
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
- /* Handle the case where initializes go to a parent's storage area. */
-
- if (ffedata_storage_ != NULL)
- {
- ffetargetOffset offset;
- ffetargetOffset units_expected;
- ffebitCount actual;
- ffebldConstantArray array;
- ffebld accter;
- ffetargetCopyfunc fn;
- void *ptr1;
- void *ptr2;
- size_t size;
- ffeinfoBasictype ign_bt;
- ffeinfoKindtype ign_kt;
- ffetargetAlign units;
-
- /* Make sure we haven't fully accreted during an array init. */
-
- if (ffestorag_init (ffedata_storage_) != NULL)
- {
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
- /* Calculate offset. */
-
- offset = ffedata_offset_ * ffedata_size_ + ffedata_charoffset_;
-
- /* Is offset within range? If not, whine, but don't do anything else. */
-
- if (offset + ffedata_charexpected_ - 1 > ffedata_symbolsize_)
- {
- ffebad_start (FFEBAD_DATA_RANGE);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
- /* Now calculate offset for aggregate area. */
-
- ffetarget_aggregate_info (&ign_bt, &ign_kt, &units, ffedata_basictype_,
- ffedata_kindtype_); /* Find out unit size of
- source datum. */
- assert (units % ffedata_storage_units_ == 0);
- units_expected = ffedata_charexpected_ * units / ffedata_storage_units_;
- offset *= units / ffedata_storage_units_;
- offset += (ffestorag_offset (ffesymbol_storage (ffedata_symbol_))
- - ffestorag_offset (ffedata_storage_))
- / ffedata_storage_units_;
-
- assert (offset + units_expected - 1 <= ffedata_storage_size_);
-
- /* Does an accretion array exist? If not, create it. */
-
- if (value != NULL)
- {
- if (ffestorag_accretion (ffedata_storage_) == NULL)
- {
-#if FFEDATA_sizeTOO_BIG_INIT_ != 0
- if (ffedata_storage_size_ >= FFEDATA_sizeTOO_BIG_INIT_)
- {
- char bignum[40];
-
- sprintf (&bignum[0], "%ld", (long) ffedata_storage_size_);
- ffebad_start (FFEBAD_TOO_BIG_INIT);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_string (bignum);
- ffebad_finish ();
- }
-#endif
- array = ffebld_constantarray_new
- (ffedata_storage_bt_, ffedata_storage_kt_,
- ffedata_storage_size_);
- accter = ffebld_new_accter (array,
- ffebit_new (ffe_pool_program_unit (),
- ffedata_storage_size_));
- ffebld_set_info (accter, ffeinfo_new
- (ffedata_storage_bt_,
- ffedata_storage_kt_,
- 1,
- FFEINFO_kindENTITY,
- FFEINFO_whereCONSTANT,
- (ffedata_basictype_
- == FFEINFO_basictypeCHARACTER)
- ? 1 : FFETARGET_charactersizeNONE));
- ffestorag_set_accretion (ffedata_storage_, accter);
- ffestorag_set_accretes (ffedata_storage_, ffedata_storage_size_);
- }
- else
- {
- accter = ffestorag_accretion (ffedata_storage_);
- assert (ffedata_storage_size_ == (ffetargetOffset) ffebld_accter_size (accter));
- array = ffebld_accter (accter);
- }
-
- /* Put value in accretion array at desired offset. */
-
- fn = ffetarget_aggregate_ptr_memcpy
- (ffedata_storage_bt_, ffedata_storage_kt_,
- ffedata_basictype_, ffedata_kindtype_);
- ffebld_constantarray_prepare
- (&ptr1, &ptr2, &size, array, ffedata_storage_bt_,
- ffedata_storage_kt_, offset,
- ffebld_constant_ptr_to_union (ffebld_conter (value)),
- ffedata_basictype_, ffedata_kindtype_);
- (*fn) (ptr1, ptr2, size); /* Does the appropriate memcpy-like
- operation. */
- ffebit_count (ffebld_accter_bits (accter),
- offset, FALSE, units_expected,
- &actual); /* How many FALSE? */
- if (units_expected != (ffetargetOffset) actual)
- {
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- }
- ffestorag_set_accretes (ffedata_storage_,
- ffestorag_accretes (ffedata_storage_)
- - actual); /* Decrement # of values
- actually accreted. */
- ffebit_set (ffebld_accter_bits (accter), offset,
- 1, units_expected);
-
- /* If done accreting for this storage area, establish as
- initialized. */
-
- if (ffestorag_accretes (ffedata_storage_) == 0)
- {
- ffestorag_set_init (ffedata_storage_, accter);
- ffestorag_set_accretion (ffedata_storage_, NULL);
- ffebit_kill (ffebld_accter_bits
- (ffestorag_init (ffedata_storage_)));
- ffebld_set_op (ffestorag_init (ffedata_storage_),
- FFEBLD_opARRTER);
- ffebld_set_arrter
- (ffestorag_init (ffedata_storage_),
- ffebld_accter (ffestorag_init (ffedata_storage_)));
- ffebld_arrter_set_size (ffestorag_init (ffedata_storage_),
- ffedata_storage_size_);
- ffecom_notify_init_storage (ffedata_storage_);
- }
- }
-
- /* If still accreting, adjust specs accordingly and return. */
-
- if (++ffedata_number_ < ffedata_expected_)
- {
- ++ffedata_offset_;
- return TRUE;
- }
-
- return ffedata_advance_ ();
- }
-
- /* Figure out where the value goes -- in an accretion array or directly
- into the final initial-value slot for the symbol. */
-
- if ((ffedata_number_ != 0)
- || (ffedata_arraysize_ > 1)
- || (ffedata_charnumber_ != 0)
- || (ffedata_size_ > ffedata_charexpected_))
- { /* Accrete this value. */
- ffetargetOffset offset;
- ffebitCount actual;
- ffebldConstantArray array;
- ffebld accter = NULL;
-
- /* Calculate offset. */
-
- offset = ffedata_offset_ * ffedata_size_ + ffedata_charoffset_;
-
- /* Is offset within range? If not, whine, but don't do anything else. */
-
- if (offset + ffedata_charexpected_ - 1 > ffedata_symbolsize_)
- {
- ffebad_start (FFEBAD_DATA_RANGE);
- ffest_ffebad_here_current_stmt (0);
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- ffedata_reported_error_ = TRUE;
- return FALSE;
- }
-
- /* Does an accretion array exist? If not, create it. */
-
- if (value != NULL)
- {
- if (ffesymbol_accretion (ffedata_symbol_) == NULL)
- {
-#if FFEDATA_sizeTOO_BIG_INIT_ != 0
- if (ffedata_symbolsize_ >= FFEDATA_sizeTOO_BIG_INIT_ )
- {
- char bignum[40];
-
- sprintf (&bignum[0], "%ld", (long) ffedata_symbolsize_);
- ffebad_start (FFEBAD_TOO_BIG_INIT);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_string (bignum);
- ffebad_finish ();
- }
-#endif
- array = ffebld_constantarray_new
- (ffedata_basictype_, ffedata_kindtype_,
- ffedata_symbolsize_);
- accter = ffebld_new_accter (array,
- ffebit_new (ffe_pool_program_unit (),
- ffedata_symbolsize_));
- ffebld_set_info (accter, ffeinfo_new
- (ffedata_basictype_,
- ffedata_kindtype_,
- 1,
- FFEINFO_kindENTITY,
- FFEINFO_whereCONSTANT,
- (ffedata_basictype_
- == FFEINFO_basictypeCHARACTER)
- ? 1 : FFETARGET_charactersizeNONE));
- ffesymbol_set_accretion (ffedata_symbol_, accter);
- ffesymbol_set_accretes (ffedata_symbol_, ffedata_symbolsize_);
- }
- else
- {
- accter = ffesymbol_accretion (ffedata_symbol_);
- assert (ffedata_symbolsize_
- == (ffetargetOffset) ffebld_accter_size (accter));
- array = ffebld_accter (accter);
- }
-
- /* Put value in accretion array at desired offset. */
-
- ffebld_constantarray_put
- (array, ffedata_basictype_, ffedata_kindtype_,
- offset, ffebld_constant_union (ffebld_conter (value)));
- ffebit_count (ffebld_accter_bits (accter), offset, FALSE,
- ffedata_charexpected_,
- &actual); /* How many FALSE? */
- if (actual != (unsigned long int) ffedata_charexpected_)
- {
- ffebad_start (FFEBAD_DATA_MULTIPLE);
- ffebad_here (0, ffelex_token_where_line (token),
- ffelex_token_where_column (token));
- ffebad_string (ffesymbol_text (ffedata_symbol_));
- ffebad_finish ();
- }
- ffesymbol_set_accretes (ffedata_symbol_,
- ffesymbol_accretes (ffedata_symbol_)
- - actual); /* Decrement # of values
- actually accreted. */
- ffebit_set (ffebld_accter_bits (accter), offset,
- 1, ffedata_charexpected_);
- ffesymbol_signal_unreported (ffedata_symbol_);
- }
-
- /* If still accreting, adjust specs accordingly and return. */
-
- if (++ffedata_number_ < ffedata_expected_)
- {
- ++ffedata_offset_;
- return TRUE;
- }
-
- /* Else, if done accreting for this symbol, establish as initialized. */
-
- if ((value != NULL)
- && (ffesymbol_accretes (ffedata_symbol_) == 0))
- {
- ffesymbol_set_init (ffedata_symbol_, accter);
- ffesymbol_set_accretion (ffedata_symbol_, NULL);
- ffebit_kill (ffebld_accter_bits (ffesymbol_init (ffedata_symbol_)));
- ffebld_set_op (ffesymbol_init (ffedata_symbol_), FFEBLD_opARRTER);
- ffebld_set_arrter (ffesymbol_init (ffedata_symbol_),
- ffebld_accter (ffesymbol_init (ffedata_symbol_)));
- ffebld_arrter_set_size (ffesymbol_init (ffedata_symbol_),
- ffedata_symbolsize_);
- ffecom_notify_init_symbol (ffedata_symbol_);
- }
- }
- else if (value != NULL)
- {
- /* Simple, direct, one-shot assignment. */
- ffesymbol_set_init (ffedata_symbol_, value);
- ffecom_notify_init_symbol (ffedata_symbol_);
- }
-
- /* Call on advance function to get next target in list. */
-
- return ffedata_advance_ ();
-}
+ Contributed by James Craig Burley (burley@gnu.org).
+ ffebld_arrter_set_pad (ffestorag_init (mst), 0);
+ ffebld_arrter_set_pad (ffestorag_init (mst), 0);
+ ffebld_arrter_set_pad (ffestorag_init (mst), 0);
+ ffebld_arrter_set_pad (ffestorag_init (ffedata_storage_),
+ 0);
+ ffebld_arrter_set_pad (ffestorag_init (ffedata_symbol_), 0);
diff --git a/gcc/f/data.h b/gcc/f/data.h
index a17aa2f8b27..5bf37928672 100644
--- a/gcc/f/data.h
+++ b/gcc/f/data.h
@@ -1,74 +1 @@
-/* data.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- data.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_data
-#define _H_f_data
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "lex.h"
-#include "storag.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffedata_begin (ffebld list);
-bool ffedata_end (bool report_errors, ffelexToken t);
-void ffedata_gather (ffestorag st);
-bool ffedata_value (ffetargetIntegerDefault rpt, ffebld value,
- ffelexToken value_token);
-
-/* Define macros. */
-
-#define ffedata_init_0()
-#define ffedata_init_1()
-#define ffedata_init_2()
-#define ffedata_init_3()
-#define ffedata_init_4()
-#define ffedata_terminate_0()
-#define ffedata_terminate_1()
-#define ffedata_terminate_2()
-#define ffedata_terminate_3()
-#define ffedata_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/equiv.c b/gcc/f/equiv.c
index 7dd2344cecb..3e4818ee545 100644
--- a/gcc/f/equiv.c
+++ b/gcc/f/equiv.c
@@ -1,1444 +1,64 @@
-/* equiv.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Handles the EQUIVALENCE relationships in a program unit.
-
- Modifications:
-*/
-
-#define FFEEQUIV_DEBUG 0
-
-/* Include files. */
-
-#include "proj.h"
-#include "equiv.h"
-#include "bad.h"
-#include "bld.h"
-#include "com.h"
-#include "data.h"
-#include "global.h"
-#include "lex.h"
-#include "malloc.h"
-#include "symbol.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-struct _ffeequiv_list_
- {
- ffeequiv first;
- ffeequiv last;
- };
-
-/* Static objects accessed by functions in this module. */
-
-static struct _ffeequiv_list_ ffeequiv_list_;
-
-/* Static functions (internal). */
-
-static void ffeequiv_destroy_ (ffeequiv eq);
-static void ffeequiv_layout_local_ (ffeequiv eq);
-static bool ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s,
- ffebld expr, bool subtract,
- ffetargetOffset adjust, bool no_precede);
-
-/* Internal macros. */
-
-
-static void
-ffeequiv_destroy_ (ffeequiv victim)
-{
- ffebld list;
- ffebld item;
- ffebld expr;
-
- for (list = victim->list; list != NULL; list = ffebld_trail (list))
- {
- for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item))
- {
- ffesymbol sym;
-
- expr = ffebld_head (item);
- sym = ffeequiv_symbol (expr);
- if (sym == NULL)
- continue;
- if (ffesymbol_equiv (sym) != NULL)
- ffesymbol_set_equiv (sym, NULL);
- }
- }
- ffeequiv_kill (victim);
-}
-
-/* ffeequiv_layout_local_ -- Lay out storage for local equivalenced vars
-
- ffeequiv eq;
- ffeequiv_layout_local_(eq);
-
- Makes a single master ffestorag object that contains all the vars
- in the equivalence, and makes subordinate ffestorag objects for the
- vars with the correct offsets.
-
- The resulting var offsets are relative not necessarily to 0 -- the
- are relative to the offset of the master area, which might be 0 or
- negative, but should never be positive. */
-
-static void
-ffeequiv_layout_local_ (ffeequiv eq)
-{
- ffestorag st; /* Equivalence storage area. */
- ffebld list; /* List of list of equivalences. */
- ffebld item; /* List of equivalences. */
- ffebld root_exp; /* Expression for root sym. */
- ffestorag root_st; /* Storage for root. */
- ffesymbol root_sym; /* Root itself. */
- ffebld rooted_exp; /* Expression for rooted sym in an eqlist. */
- ffestorag rooted_st; /* Storage for rooted. */
- ffesymbol rooted_sym; /* Rooted symbol itself. */
- ffetargetOffset eqlist_offset;/* Offset for eqlist from rooted sym. */
- ffetargetAlign alignment;
- ffetargetAlign modulo;
- ffetargetAlign pad;
- ffetargetOffset size;
- ffetargetOffset num_elements;
- bool new_storage; /* Established new storage info. */
- bool need_storage; /* Have need for more storage info. */
- bool init;
-
- assert (eq != NULL);
-
- if (ffeequiv_common (eq) != NULL)
- { /* Put in common due to programmer error. */
- ffeequiv_destroy_ (eq);
- return;
- }
-
- /* Find the symbol for the first valid item in the list of lists, use that
- as the root symbol. Doesn't matter if it won't end up at the beginning
- of the list, though. */
-
-#if FFEEQUIV_DEBUG
- fprintf (stderr, "Equiv1:\n");
-#endif
-
- root_sym = NULL;
- root_exp = NULL;
-
- for (list = ffeequiv_list (eq);
- list != NULL;
- list = ffebld_trail (list))
- { /* For every equivalence list in the list of
- equivs */
- for (item = ffebld_head (list);
- item != NULL;
- item = ffebld_trail (item))
- { /* For every equivalence item in the list */
- ffetargetOffset ign; /* Ignored. */
-
- root_exp = ffebld_head (item);
- root_sym = ffeequiv_symbol (root_exp);
- if (root_sym == NULL)
- continue; /* Ignore me. */
-
- assert (ffesymbol_storage (root_sym) == NULL); /* No storage yet. */
-
- if (!ffeequiv_offset_ (&ign, root_sym, root_exp, FALSE, 0, FALSE))
- {
- /* We can't just eliminate this one symbol from the list
- of candidates, because it might be the only one that
- ties all these equivs together. So just destroy the
- whole list. */
-
- ffeequiv_destroy_ (eq);
- return;
- }
-
- break; /* Use first valid eqv expr for root exp/sym. */
- }
- if (root_sym != NULL)
- break;
- }
-
- if (root_sym == NULL)
+ Copyright (C) 1995-1998 Free Software Foundation, Inc.
+ Contributed by James Craig Burley (burley@gnu.org).
+ ffetargetOffset new_size;
+ /* Increase size of equiv area to start for lower offset
+ relative to root symbol. */
+ if (! ffetarget_offset_add (&new_size,
+ ffestorag_offset (st)
+ - item_offset,
+ ffestorag_size (st)))
+ /* If the offset for this storage area is zero (it cannot be positive),
+ that means the alignment/modulo info is already correct. Otherwise,
+ the alignment info is correct, but the modulo info reflects a
+ zero offset, so fix it. */
+
+ if (ffestorag_offset (st) < 0)
{
- ffeequiv_destroy_ (eq);
- return;
+ /* Calculate the initial padding necessary to preserve
+ the alignment/modulo requirements for the storage area.
+ These requirements are themselves kept track of in the
+ record for the storage area as a whole, but really pertain
+ to offset 0 of that area, which is where the root symbol
+ was originally placed.
+
+ The goal here is to have the offset and size for the area
+ faithfully reflect the area itself, not extra requirements
+ like alignment. So to meet the alignment requirements,
+ the modulo for the area should be set as if the area had an
+ alignment requirement of alignment/0 and was aligned/padded
+ downward to meet the alignment requirements of the area at
+ offset zero, the amount of padding needed being the desired
+ value for the modulo of the area. */
+
+ alignment = ffestorag_alignment (st);
+ modulo = ffestorag_modulo (st);
+
+ /* Since we want to move the whole area *down* (lower memory
+ addresses) as required by the alignment/modulo paid, negate
+ the offset to ffetarget_align, which assumes aligning *up*
+ is desired. */
+ pad = ffetarget_align (&alignment, &modulo,
+ - ffestorag_offset (st),
+ alignment, 0);
+ ffestorag_set_modulo (st, pad);
}
-
-#if FFEEQUIV_DEBUG
- fprintf (stderr, " Root: `%s'\n", ffesymbol_text (root_sym));
-#endif
-
- /* We've got work to do, so make the LOCAL storage object that'll hold all
- the equivalenced vars inside it. */
-
- st = ffestorag_new (ffestorag_list_master ());
- ffestorag_set_parent (st, NULL); /* Initializations happen here. */
- ffestorag_set_init (st, NULL);
- ffestorag_set_accretion (st, NULL);
- ffestorag_set_offset (st, 0); /* Assume equiv will be at root offset 0 for now. */
- ffestorag_set_alignment (st, 1);
- ffestorag_set_modulo (st, 0);
- ffestorag_set_type (st, FFESTORAG_typeLOCAL);
- ffestorag_set_basictype (st, ffesymbol_basictype (root_sym));
- ffestorag_set_kindtype (st, ffesymbol_kindtype (root_sym));
- ffestorag_set_typesymbol (st, root_sym);
- ffestorag_set_is_save (st, ffeequiv_is_save (eq));
- if (ffesymbol_is_save (root_sym))
- ffestorag_update_save (st);
- ffestorag_set_is_init (st, ffeequiv_is_init (eq));
- if (ffesymbol_is_init (root_sym))
- ffestorag_update_init (st);
- ffestorag_set_symbol (st, root_sym); /* Assume this will be the root until
- we know better (used only to generate
- the internal name for the aggregate area,
- e.g. for debugging). */
-
- /* Make the EQUIV storage object for the root symbol. */
-
- if (ffesymbol_rank (root_sym) == 0)
- num_elements = 1;
- else
- num_elements = ffebld_constant_integerdefault (ffebld_conter
- (ffesymbol_arraysize (root_sym)));
- ffetarget_layout (ffesymbol_text (root_sym), &alignment, &modulo, &size,
- ffesymbol_basictype (root_sym), ffesymbol_kindtype (root_sym),
- ffesymbol_size (root_sym), num_elements);
- ffestorag_set_size (st, size); /* Set initial size of aggregate area. */
-
- pad = ffetarget_align (ffestorag_ptr_to_alignment (st),
- ffestorag_ptr_to_modulo (st), 0, alignment,
- modulo);
- assert (pad == 0);
-
- root_st = ffestorag_new (ffestorag_list_equivs (st));
- ffestorag_set_parent (root_st, st); /* Initializations happen there. */
- ffestorag_set_init (root_st, NULL);
- ffestorag_set_accretion (root_st, NULL);
- ffestorag_set_symbol (root_st, root_sym);
- ffestorag_set_size (root_st, size);
- ffestorag_set_offset (root_st, 0); /* Will not change; always 0 relative to itself! */
- ffestorag_set_alignment (root_st, alignment);
- ffestorag_set_modulo (root_st, modulo);
- ffestorag_set_type (root_st, FFESTORAG_typeEQUIV);
- ffestorag_set_basictype (root_st, ffesymbol_basictype (root_sym));
- ffestorag_set_kindtype (root_st, ffesymbol_kindtype (root_sym));
- ffestorag_set_typesymbol (root_st, root_sym);
- ffestorag_set_is_save (root_st, FALSE); /* Assume FALSE, then... */
- if (ffestorag_is_save (st)) /* ...update to TRUE if needed. */
- ffestorag_update_save (root_st);
- ffestorag_set_is_init (root_st, FALSE); /* Assume FALSE, then... */
- if (ffestorag_is_init (st)) /* ...update to TRUE if needed. */
- ffestorag_update_init (root_st);
- ffesymbol_set_storage (root_sym, root_st);
- ffesymbol_signal_unreported (root_sym);
- init = ffesymbol_is_init (root_sym);
-
- /* Now that we know the root (offset=0) symbol, revisit all the lists and
- do the actual storage allocation. Keep doing this until we've gone
- through them all without making any new storage objects. */
-
- do
- {
- new_storage = FALSE;
- need_storage = FALSE;
- for (list = ffeequiv_list (eq);
- list != NULL;
- list = ffebld_trail (list))
- { /* For every equivalence list in the list of
- equivs */
- /* Now find a "rooted" symbol in this list. That is, find the
- first item we can that is valid and whose symbol already
- has a storage area, because that means we know where it
- belongs in the equivalence area and can then allocate the
- rest of the items in the list accordingly. */
-
- rooted_sym = NULL;
- rooted_exp = NULL;
- eqlist_offset = 0;
-
- for (item = ffebld_head (list);
- item != NULL;
- item = ffebld_trail (item))
- { /* For every equivalence item in the list */
- rooted_exp = ffebld_head (item);
- rooted_sym = ffeequiv_symbol (rooted_exp);
- if ((rooted_sym == NULL)
- || ((rooted_st = ffesymbol_storage (rooted_sym)) == NULL))
- {
- rooted_sym = NULL;
- continue; /* Ignore me. */
- }
-
- need_storage = TRUE; /* Somebody is likely to need
- storage. */
-
-#if FFEEQUIV_DEBUG
- fprintf (stderr, " Rooted: `%s' at %" ffetargetOffset_f "d\n",
- ffesymbol_text (rooted_sym),
- ffestorag_offset (rooted_st));
-#endif
-
- /* The offset of this symbol from the equiv's root symbol
- is already known, and the size of this symbol is already
- incorporated in the size of the equiv's aggregate area.
- What we now determine is the offset of this equivalence
- _list_ from the equiv's root symbol.
-
- For example, if we know that A is at offset 16 from the
- root symbol, given EQUIVALENCE (B(24),A(2)), we're looking
- at A(2), meaning that the offset for this equivalence list
- is 20 (4 bytes beyond the beginning of A, assuming typical
- array types, dimensions, and type info). */
-
- if (!ffeequiv_offset_ (&eqlist_offset, rooted_sym, rooted_exp, FALSE,
- ffestorag_offset (rooted_st), FALSE))
-
- { /* Can't use this one. */
- ffesymbol_set_equiv (rooted_sym, NULL);/* Equiv area slated for
- death. */
- rooted_sym = NULL;
- continue; /* Something's wrong with eqv expr, try another. */
- }
-
-#if FFEEQUIV_DEBUG
- fprintf (stderr, " Eqlist offset: %" ffetargetOffset_f "d\n",
- eqlist_offset);
-#endif
-
- break;
- }
-
- /* If no rooted symbol, it means this list has no roots -- yet.
- So, forget this list this time around, but we'll get back
- to it after the outer loop iterates at least one more time,
- and, ultimately, it will have a root. */
-
- if (rooted_sym == NULL)
- {
-#if FFEEQUIV_DEBUG
- fprintf (stderr, "No roots.\n");
-#endif
- continue;
- }
-
- /* We now have a rooted symbol/expr and the offset of this equivalence
- list from the root symbol. The other expressions in this
- list all identify an initial storage unit that must have the
- same offset. */
-
- for (item = ffebld_head (list);
- item != NULL;
- item = ffebld_trail (item))
- { /* For every equivalence item in the list */
- ffebld item_exp; /* Expression for equivalence. */
- ffestorag item_st; /* Storage for var. */
- ffesymbol item_sym; /* Var itself. */
- ffetargetOffset item_offset; /* Offset for var from root. */
-
- item_exp = ffebld_head (item);
- item_sym = ffeequiv_symbol (item_exp);
- if ((item_sym == NULL)
- || (ffesymbol_equiv (item_sym) == NULL))
- continue; /* Ignore me. */
-
- if (item_sym == rooted_sym)
- continue; /* Rooted sym already set up. */
-
- if (!ffeequiv_offset_ (&item_offset, item_sym, item_exp, TRUE,
- eqlist_offset, FALSE))
- {
- ffesymbol_set_equiv (item_sym, NULL); /* Don't bother with me anymore. */
- continue;
- }
-
-#if FFEEQUIV_DEBUG
- fprintf (stderr, " Item `%s' at %" ffetargetOffset_f "d",
- ffesymbol_text (item_sym), item_offset);
-#endif
-
- if (ffesymbol_rank (item_sym) == 0)
- num_elements = 1;
- else
- num_elements = ffebld_constant_integerdefault (ffebld_conter
- (ffesymbol_arraysize (item_sym)));
- ffetarget_layout (ffesymbol_text (item_sym), &alignment, &modulo,
- &size, ffesymbol_basictype (item_sym),
- ffesymbol_kindtype (item_sym), ffesymbol_size (item_sym),
- num_elements);
- pad = ffetarget_align (ffestorag_ptr_to_alignment (st),
- ffestorag_ptr_to_modulo (st),
- item_offset, alignment, modulo);
- if (pad != 0)
- {
- ffebad_start (FFEBAD_EQUIV_ALIGN);
- ffebad_string (ffesymbol_text (item_sym));
- ffebad_finish ();
- ffesymbol_set_equiv (item_sym, NULL); /* Don't bother with me anymore. */
- continue;
- }
-
- /* If the variable's offset is less than the offset for the
- aggregate storage area, it means it has to expand backwards
- -- i.e. the new known starting point of the area precedes the
- old one. This can't happen with COMMON areas (the standard,
- and common sense, disallow it), but it is normal for local
- EQUIVALENCE areas.
-
- Also handle choosing the "documented" rooted symbol for this
- area here. It's the symbol at the bottom (lowest offset)
- of the aggregate area, with ties going to the name that would
- sort to the top of the list of ties. */
-
- if (item_offset == ffestorag_offset (st))
- {
- if ((item_sym != ffestorag_symbol (st))
- && (strcmp (ffesymbol_text (item_sym),
- ffesymbol_text (ffestorag_symbol (st)))
- < 0))
- ffestorag_set_symbol (st, item_sym);
- }
- else if (item_offset < ffestorag_offset (st))
- {
- ffetargetOffset new_size;
-
- /* Increase size of equiv area to start for lower offset relative
- to root symbol. */
-
- if (!ffetarget_offset_add (&new_size,
- ffestorag_offset (st) - item_offset,
- ffestorag_size (st)))
- ffetarget_offset_overflow (ffesymbol_text (s));
- else
- ffestorag_set_size (st, new_size);
-
- ffestorag_set_symbol (st, item_sym);
- ffestorag_set_offset (st, item_offset);
-
-#if FFEEQUIV_DEBUG
- fprintf (stderr, " [eq offset=%" ffetargetOffset_f
- "d, size=%" ffetargetOffset_f "d]",
- item_offset, new_size);
-#endif
- }
-
- if ((item_st = ffesymbol_storage (item_sym)) == NULL)
- { /* Create new ffestorag object, extend equiv
- area. */
-#if FFEEQUIV_DEBUG
- fprintf (stderr, ".\n");
-#endif
- new_storage = TRUE;
- item_st = ffestorag_new (ffestorag_list_equivs (st));
- ffestorag_set_parent (item_st, st); /* Initializations
- happen there. */
- ffestorag_set_init (item_st, NULL);
- ffestorag_set_accretion (item_st, NULL);
- ffestorag_set_symbol (item_st, item_sym);
- ffestorag_set_size (item_st, size);
- ffestorag_set_offset (item_st, item_offset);
- ffestorag_set_alignment (item_st, alignment);
- ffestorag_set_modulo (item_st, modulo);
- ffestorag_set_type (item_st, FFESTORAG_typeEQUIV);
- ffestorag_set_basictype (item_st, ffesymbol_basictype (item_sym));
- ffestorag_set_kindtype (item_st, ffesymbol_kindtype (item_sym));
- ffestorag_set_typesymbol (item_st, item_sym);
- ffestorag_set_is_save (item_st, FALSE); /* Assume FALSE... */
- if (ffestorag_is_save (st)) /* ...update TRUE */
- ffestorag_update_save (item_st); /* if needed. */
- ffestorag_set_is_init (item_st, FALSE); /* Assume FALSE... */
- if (ffestorag_is_init (st)) /* ...update TRUE */
- ffestorag_update_init (item_st); /* if needed. */
- ffesymbol_set_storage (item_sym, item_st);
- ffesymbol_signal_unreported (item_sym);
- if (ffesymbol_is_init (item_sym))
- init = TRUE;
-
- /* Determine new size of equiv area, complain if overflow. */
-
- if (!ffetarget_offset_add (&size, item_offset, size)
- || !ffetarget_offset_add (&size, -ffestorag_offset (st), size))
- ffetarget_offset_overflow (ffesymbol_text (s));
- else if (size > ffestorag_size (st))
- ffestorag_set_size (st, size);
- ffestorag_update (st, item_sym, ffesymbol_basictype (item_sym),
- ffesymbol_kindtype (item_sym));
- }
- else
- {
-#if FFEEQUIV_DEBUG
- fprintf (stderr, " (was %" ffetargetOffset_f "d).\n",
- ffestorag_offset (item_st));
-#endif
- /* Make sure offset agrees with known offset. */
- if (item_offset != ffestorag_offset (item_st))
- {
- char io1[40];
- char io2[40];
-
- sprintf (&io1[0], "%" ffetargetOffset_f "d", item_offset);
- sprintf (&io2[0], "%" ffetargetOffset_f "d", ffestorag_offset (item_st));
- ffebad_start (FFEBAD_EQUIV_MISMATCH);
- ffebad_string (ffesymbol_text (item_sym));
- ffebad_string (ffesymbol_text (root_sym));
- ffebad_string (io1);
- ffebad_string (io2);
- ffebad_finish ();
- }
- }
- ffesymbol_set_equiv (item_sym, NULL); /* Don't bother with me anymore. */
- } /* (For every equivalence item in the list) */
- ffebld_set_head (list, NULL); /* Don't do this list again. */
- } /* (For every equivalence list in the list of
- equivs) */
- } while (new_storage && need_storage);
-
- ffesymbol_set_equiv (root_sym, NULL); /* This one has storage now. */
-
- ffeequiv_kill (eq); /* Fully processed, no longer needed. */
-
- if (init)
- ffedata_gather (st); /* Gather subordinate inits into one init. */
-}
-
-/* ffeequiv_offset_ -- Determine offset from start of symbol
-
- ffetargetOffset offset;
- ffesymbol s; // Symbol for error reporting.
- ffebld expr; // opSUBSTR, opARRAYREF, opSYMTER, opANY.
- bool subtract; // FALSE means add to adjust, TRUE means subtract from it.
- ffetargetOffset adjust; // Helps keep answer in pos range (unsigned).
- if (!ffeequiv_offset_(&offset,s,expr,subtract,adjust))
- // error doing the calculation, message already printed
-
- Returns the offset represented by the SUBSTR, ARRAYREF, or SUBSTR/ARRAYREF
- combination added-to/subtracted-from the adjustment specified. If there
- is an error of some kind, returns FALSE, else returns TRUE. Note that
- only the first storage unit specified is considered; A(1:1) and A(1:2000)
- have the same first storage unit and so return the same offset. */
-
-static bool
-ffeequiv_offset_ (ffetargetOffset *offset, ffesymbol s UNUSED,
- ffebld expr, bool subtract, ffetargetOffset adjust,
- bool no_precede)
-{
- ffetargetIntegerDefault value = 0;
- ffetargetOffset cval; /* Converted value. */
- ffesymbol sym;
-
- if (expr == NULL)
- return FALSE;
-
-again: /* :::::::::::::::::::: */
-
- switch (ffebld_op (expr))
- {
- case FFEBLD_opANY:
- return FALSE;
-
- case FFEBLD_opSYMTER:
- {
- ffetargetOffset size; /* Size of a single unit. */
- ffetargetAlign a; /* Ignored. */
- ffetargetAlign m; /* Ignored. */
-
- sym = ffebld_symter (expr);
- if (ffesymbol_basictype (sym) == FFEINFO_basictypeANY)
- return FALSE;
-
- ffetarget_layout (ffesymbol_text (sym), &a, &m, &size,
- ffesymbol_basictype (sym),
- ffesymbol_kindtype (sym), 1, 1);
-
- if (value < 0)
- { /* Really invalid, as in A(-2:5), but in case
- it's wanted.... */
- if (!ffetarget_offset (&cval, -value))
+ if (ffebld_op (subscript) == FFEBLD_opANY)
return FALSE;
- if (!ffetarget_offset_multiply (&cval, cval, size))
+ if (ffebld_op (dim) == FFEBLD_opANY)
return FALSE;
- if (subtract)
- return ffetarget_offset_add (offset, cval, adjust);
-
- if (no_precede && (cval > adjust))
- {
- neg: /* :::::::::::::::::::: */
- ffebad_start (FFEBAD_COMMON_NEG);
- ffebad_string (ffesymbol_text (sym));
- ffebad_finish ();
- return FALSE;
- }
- return ffetarget_offset_add (offset, -cval, adjust);
- }
-
- if (!ffetarget_offset (&cval, value))
- return FALSE;
-
- if (!ffetarget_offset_multiply (&cval, cval, size))
- return FALSE;
-
- if (!subtract)
- return ffetarget_offset_add (offset, cval, adjust);
-
- if (no_precede && (cval > adjust))
- goto neg; /* :::::::::::::::::::: */
-
- return ffetarget_offset_add (offset, -cval, adjust);
- }
-
- case FFEBLD_opARRAYREF:
- {
- ffebld symexp = ffebld_left (expr);
- ffebld subscripts = ffebld_right (expr);
- ffebld dims;
- ffetargetIntegerDefault width;
- ffetargetIntegerDefault arrayval;
- ffetargetIntegerDefault lowbound;
- ffetargetIntegerDefault highbound;
- ffebld subscript;
- ffebld dim;
- ffebld low;
- ffebld high;
- int rank = 0;
-
- if (ffebld_op (symexp) != FFEBLD_opSYMTER)
- return FALSE;
-
- sym = ffebld_symter (symexp);
- if (ffesymbol_basictype (sym) == FFEINFO_basictypeANY)
- return FALSE;
-
- if (ffesymbol_size (sym) == FFETARGET_charactersizeNONE)
- width = 1;
- else
- width = ffesymbol_size (sym);
- dims = ffesymbol_dims (sym);
-
- while (subscripts != NULL)
- {
- ++rank;
- if (dims == NULL)
- {
- ffebad_start (FFEBAD_EQUIV_MANY);
- ffebad_string (ffesymbol_text (sym));
- ffebad_finish ();
- return FALSE;
- }
-
- subscript = ffebld_head (subscripts);
- dim = ffebld_head (dims);
-
- assert (ffebld_op (subscript) == FFEBLD_opCONTER);
- assert (ffeinfo_basictype (ffebld_info (subscript))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (subscript))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- arrayval = ffebld_constant_integerdefault (ffebld_conter
- (subscript));
-
- assert (ffebld_op (dim) == FFEBLD_opBOUNDS);
- low = ffebld_left (dim);
- high = ffebld_right (dim);
-
- if (low == NULL)
- lowbound = 1;
- else
- {
- assert (ffeinfo_basictype (ffebld_info (low))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (low))
- == FFEINFO_kindtypeINTEGERDEFAULT);
- lowbound
- = ffebld_constant_integerdefault (ffebld_conter (low));
- }
-
- assert (ffebld_op (high) == FFEBLD_opCONTER);
- assert (ffeinfo_basictype (ffebld_info (high))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (high))
- == FFEINFO_kindtypeINTEGER1);
- highbound
- = ffebld_constant_integerdefault (ffebld_conter (high));
-
- if ((arrayval < lowbound) || (arrayval > highbound))
- {
- char rankstr[10];
-
- sprintf (rankstr, "%d", rank);
- ffebad_start (FFEBAD_EQUIV_SUBSCRIPT);
- ffebad_string (ffesymbol_text (sym));
- ffebad_string (rankstr);
- ffebad_finish ();
- }
-
- subscripts = ffebld_trail (subscripts);
- dims = ffebld_trail (dims);
-
- value += width * (arrayval - lowbound);
- if (subscripts != NULL)
- width *= highbound - lowbound + 1;
- }
-
- if (dims != NULL)
- {
- ffebad_start (FFEBAD_EQUIV_FEW);
- ffebad_string (ffesymbol_text (sym));
- ffebad_finish ();
- return FALSE;
- }
-
- expr = symexp;
- }
- goto again; /* :::::::::::::::::::: */
+ if (ffebld_op (low) == FFEBLD_opANY)
+ return FALSE;
- case FFEBLD_opSUBSTR:
- {
- ffebld begin = ffebld_head (ffebld_right (expr));
-
- expr = ffebld_left (expr);
- if (ffebld_op (expr) == FFEBLD_opARRAYREF)
- sym = ffebld_symter (ffebld_left (expr));
- else if (ffebld_op (expr) == FFEBLD_opSYMTER)
- sym = ffebld_symter (expr);
- else
- sym = NULL;
+ assert (ffebld_op (low) == FFEBLD_opCONTER);
+ if (ffebld_op (high) == FFEBLD_opANY)
+ return FALSE;
- if ((sym != NULL)
- && (ffesymbol_basictype (sym) == FFEINFO_basictypeANY))
+ if (ffebld_op (expr) == FFEBLD_opANY)
return FALSE;
-
- if (begin == NULL)
- value = 0;
- else
- {
- assert (ffebld_op (begin) == FFEBLD_opCONTER);
- assert (ffeinfo_basictype (ffebld_info (begin))
- == FFEINFO_basictypeINTEGER);
- assert (ffeinfo_kindtype (ffebld_info (begin))
- == FFEINFO_kindtypeINTEGERDEFAULT);
-
- value = ffebld_constant_integerdefault (ffebld_conter (begin));
-
- if ((value < 1)
- || ((sym != NULL)
- && (value > ffesymbol_size (sym))))
- {
- ffebad_start (FFEBAD_EQUIV_RANGE);
- ffebad_string (ffesymbol_text (sym));
- ffebad_finish ();
- }
-
- --value;
- }
- if ((sym != NULL)
- && (ffesymbol_basictype (sym) != FFEINFO_basictypeCHARACTER))
- {
- ffebad_start (FFEBAD_EQUIV_SUBSTR);
- ffebad_string (ffesymbol_text (sym));
- ffebad_finish ();
- value = 0;
- }
- }
- goto again; /* :::::::::::::::::::: */
-
- default:
- assert ("bad op" == NULL);
- return FALSE;
- }
-
-}
-
-/* ffeequiv_add -- Add list of equivalences to list of lists for eq object
-
- ffeequiv eq;
- ffebld list;
- ffelexToken t; // points to first item in equivalence list
- ffeequiv_add(eq,list,t);
-
- Check the list to make sure only one common symbol is involved (even
- if multiple times) and agrees with the common symbol for the equivalence
- object (or it has no common symbol until now). Prepend (or append, it
- doesn't matter) the list to the list of lists for the equivalence object.
- Otherwise report an error and return. */
-
-void
-ffeequiv_add (ffeequiv eq, ffebld list, ffelexToken t)
-{
- ffebld item;
- ffesymbol symbol;
- ffesymbol common = ffeequiv_common (eq);
-
- for (item = list; item != NULL; item = ffebld_trail (item))
- {
- symbol = ffeequiv_symbol (ffebld_head (item));
-
- if (ffesymbol_common (symbol) != NULL) /* Is symbol known in COMMON yet? */
- {
- if (common == NULL)
- common = ffesymbol_common (symbol);
- else if (common != ffesymbol_common (symbol))
- {
- /* Yes, and symbol disagrees with others on the COMMON area. */
- ffebad_start (FFEBAD_EQUIV_COMMON);
- ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
- ffebad_string (ffesymbol_text (common));
- ffebad_string (ffesymbol_text (ffesymbol_common (symbol)));
- ffebad_finish ();
- return;
- }
- }
- }
-
- if ((common != NULL)
- && (ffeequiv_common (eq) == NULL)) /* Is COMMON involved already? */
- ffeequiv_set_common (eq, common); /* No, but it is now. */
-
- for (item = list; item != NULL; item = ffebld_trail (item))
- {
- symbol = ffeequiv_symbol (ffebld_head (item));
-
- if (ffesymbol_equiv (symbol) == NULL)
- ffesymbol_set_equiv (symbol, eq);
- else
- assert (ffesymbol_equiv (symbol) == eq);
-
- if (ffesymbol_common (symbol) == NULL) /* Is symbol in a COMMON
- area? */
- { /* No (at least not yet). */
- if (ffesymbol_is_save (symbol))
- ffeequiv_update_save (eq); /* EQUIVALENCE has >=1 SAVEd entity. */
- if (ffesymbol_is_init (symbol))
- ffeequiv_update_init (eq); /* EQUIVALENCE has >=1 init'd entity. */
- continue; /* Nothing more to do here. */
- }
-
-#if FFEGLOBAL_ENABLED
- if (ffesymbol_is_init (symbol))
- ffeglobal_init_common (ffesymbol_common (symbol), t);
-#endif
-
- if (ffesymbol_is_save (ffesymbol_common (symbol)))
- ffeequiv_update_save (eq); /* EQUIVALENCE is in a SAVEd COMMON block. */
- if (ffesymbol_is_init (ffesymbol_common (symbol)))
- ffeequiv_update_init (eq); /* EQUIVALENCE is in a init'd COMMON block. */
- }
-
- ffeequiv_set_list (eq, ffebld_new_item (list, ffeequiv_list (eq)));
-}
-
-/* ffeequiv_dump -- Dump info on equivalence object
-
- ffeequiv eq;
- ffeequiv_dump(eq); */
-
-void
-ffeequiv_dump (ffeequiv eq)
-{
- if (ffeequiv_common (eq) != NULL)
- fprintf (dmpout, "(common %s) ", ffesymbol_text (ffeequiv_common (eq)));
- ffebld_dump (ffeequiv_list (eq));
-}
-
-/* ffeequiv_exec_transition -- Do the hard work on all the equivalence objects
-
- ffeequiv_exec_transition(); */
-
-void
-ffeequiv_exec_transition ()
-{
- while (ffeequiv_list_.first != (ffeequiv) &ffeequiv_list_.first)
- ffeequiv_layout_local_ (ffeequiv_list_.first);
-}
-
-/* ffeequiv_init_2 -- Initialize for new program unit
-
- ffeequiv_init_2();
-
- Initializes the list of equivalences. */
-
-void
-ffeequiv_init_2 ()
-{
- ffeequiv_list_.first = (ffeequiv) &ffeequiv_list_.first;
- ffeequiv_list_.last = (ffeequiv) &ffeequiv_list_.first;
-}
-
-/* ffeequiv_kill -- Kill equivalence object after removing from list
-
- ffeequiv eq;
- ffeequiv_kill(eq);
-
- Removes equivalence object from master list, then kills it. */
-
-void
-ffeequiv_kill (ffeequiv victim)
-{
- victim->next->previous = victim->previous;
- victim->previous->next = victim->next;
- if (ffe_is_do_internal_checks ())
- {
- ffebld list;
- ffebld item;
- ffebld expr;
-
- /* Assert that nobody our victim points to still points to it. */
-
- assert ((victim->common == NULL)
- || (ffesymbol_equiv (victim->common) == NULL));
-
- for (list = victim->list; list != NULL; list = ffebld_trail (list))
- {
- for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item))
- {
- ffesymbol sym;
-
- expr = ffebld_head (item);
- sym = ffeequiv_symbol (expr);
- if (sym == NULL)
- continue;
- assert (ffesymbol_equiv (sym) != victim);
- }
- }
- }
- malloc_kill_ks (ffe_pool_program_unit (), victim, sizeof (*victim));
-}
-
-/* ffeequiv_layout_cblock -- Lay out storage for common area
-
- ffestorag st;
- if (ffeequiv_layout_cblock(st))
- // at least one equiv'd symbol has init/accretion expr.
-
- Now that the explicitly COMMONed variables in the common area (whose
- ffestorag object is passed) have been laid out, lay out the storage
- for all variables equivalenced into the area by making subordinate
- ffestorag objects for them. */
-
-bool
-ffeequiv_layout_cblock (ffestorag st)
-{
- ffesymbol s = ffestorag_symbol (st); /* CBLOCK symbol. */
- ffebld list; /* List of explicit common vars, in order, in
- s. */
- ffebld item; /* List of list of equivalences in a given
- explicit common var. */
- ffebld root; /* Expression for (1st) explicit common var
- in list of eqs. */
- ffestorag rst; /* Storage for root. */
- ffetargetOffset root_offset; /* Offset for root into common area. */
- ffesymbol sr; /* Root itself. */
- ffeequiv seq; /* Its equivalence object, if any. */
- ffebld var; /* Expression for equivalence. */
- ffestorag vst; /* Storage for var. */
- ffetargetOffset var_offset; /* Offset for var into common area. */
- ffesymbol sv; /* Var itself. */
- ffebld altroot; /* Alternate root. */
- ffesymbol altrootsym; /* Alternate root symbol. */
- ffetargetAlign alignment;
- ffetargetAlign modulo;
- ffetargetAlign pad;
- ffetargetOffset size;
- ffetargetOffset num_elements;
- bool new_storage; /* Established new storage info. */
- bool need_storage; /* Have need for more storage info. */
- bool ok;
- bool init = FALSE;
-
- assert (st != NULL);
- assert (ffestorag_type (st) == FFESTORAG_typeCBLOCK);
- assert (ffesymbol_kind (ffestorag_symbol (st)) == FFEINFO_kindCOMMON);
-
- for (list = ffesymbol_commonlist (ffestorag_symbol (st));
- list != NULL;
- list = ffebld_trail (list))
- { /* For every variable in the common area */
- assert (ffebld_op (ffebld_head (list)) == FFEBLD_opSYMTER);
- sr = ffebld_symter (ffebld_head (list));
- if ((seq = ffesymbol_equiv (sr)) == NULL)
- continue; /* No equivalences to process. */
- rst = ffesymbol_storage (sr);
- if (rst == NULL)
- {
- assert (ffesymbol_kind (sr) == FFEINFO_kindANY);
- continue;
- }
- ffesymbol_set_equiv (sr, NULL); /* Cancel ref to equiv obj. */
- do
- {
- new_storage = FALSE;
- need_storage = FALSE;
- for (item = ffeequiv_list (seq); /* Get list of equivs. */
- item != NULL;
- item = ffebld_trail (item))
- { /* For every eqv list in the list of equivs
- for the variable */
- altroot = NULL;
- altrootsym = NULL;
- for (root = ffebld_head (item);
- root != NULL;
- root = ffebld_trail (root))
- { /* For every equivalence item in the list */
- sv = ffeequiv_symbol (ffebld_head (root));
- if (sv == sr)
- break; /* Found first mention of "rooted" symbol. */
- if (ffesymbol_storage (sv) != NULL)
- {
- altroot = root; /* If no mention, use this guy
- instead. */
- altrootsym = sv;
- }
- }
- if (root != NULL)
- {
- root = ffebld_head (root); /* Lose its opITEM. */
- ok = ffeequiv_offset_ (&root_offset, sr, root, FALSE,
- ffestorag_offset (rst), TRUE);
- /* Equiv point prior to start of common area? */
- }
- else if (altroot != NULL)
- {
- /* Equiv point prior to start of common area? */
- root = ffebld_head (altroot);
- ok = ffeequiv_offset_ (&root_offset, altrootsym, root,
- FALSE,
- ffestorag_offset (ffesymbol_storage (altrootsym)),
- TRUE);
- ffesymbol_set_equiv (altrootsym, NULL);
- }
- else
- /* No rooted symbol in list of equivalences! */
- { /* Assume this was due to opANY and ignore
- this list for now. */
- need_storage = TRUE;
- continue;
- }
-
- /* We now know the root symbol and the operating offset of that
- root into the common area. The other expressions in the
- list all identify an initial storage unit that must have the
- same offset. */
-
- for (var = ffebld_head (item);
- var != NULL;
- var = ffebld_trail (var))
- { /* For every equivalence item in the list */
- if (ffebld_head (var) == root)
- continue; /* Except root, of course. */
- sv = ffeequiv_symbol (ffebld_head (var));
- if (sv == NULL)
- continue; /* Except erroneous stuff (opANY). */
- ffesymbol_set_equiv (sv, NULL); /* Don't need this ref
- anymore. */
- if (!ok
- || !ffeequiv_offset_ (&var_offset, sv,
- ffebld_head (var), TRUE,
- root_offset, TRUE))
- continue; /* Can't do negative offset wrt COMMON. */
-
- if (ffesymbol_rank (sv) == 0)
- num_elements = 1;
- else
- num_elements = ffebld_constant_integerdefault
- (ffebld_conter (ffesymbol_arraysize (sv)));
- ffetarget_layout (ffesymbol_text (sv), &alignment,
- &modulo, &size,
- ffesymbol_basictype (sv),
- ffesymbol_kindtype (sv),
- ffesymbol_size (sv), num_elements);
- pad = ffetarget_align (ffestorag_ptr_to_alignment (st),
- ffestorag_ptr_to_modulo (st),
- var_offset, alignment, modulo);
- if (pad != 0)
- {
- ffebad_start (FFEBAD_EQUIV_ALIGN);
- ffebad_string (ffesymbol_text (sv));
- ffebad_finish ();
- continue;
- }
-
- if ((vst = ffesymbol_storage (sv)) == NULL)
- { /* Create new ffestorag object, extend
- cblock. */
- new_storage = TRUE;
- vst = ffestorag_new (ffestorag_list_equivs (st));
- ffestorag_set_parent (vst, st); /* Initializations
- happen there. */
- ffestorag_set_init (vst, NULL);
- ffestorag_set_accretion (vst, NULL);
- ffestorag_set_symbol (vst, sv);
- ffestorag_set_size (vst, size);
- ffestorag_set_offset (vst, var_offset);
- ffestorag_set_alignment (vst, alignment);
- ffestorag_set_modulo (vst, modulo);
- ffestorag_set_type (vst, FFESTORAG_typeEQUIV);
- ffestorag_set_basictype (vst, ffesymbol_basictype (sv));
- ffestorag_set_kindtype (vst, ffesymbol_kindtype (sv));
- ffestorag_set_typesymbol (vst, sv);
- ffestorag_set_is_save (vst, FALSE); /* Assume FALSE... */
- if (ffestorag_is_save (st)) /* ...update TRUE */
- ffestorag_update_save (vst); /* if needed. */
- ffestorag_set_is_init (vst, FALSE); /* Assume FALSE... */
- if (ffestorag_is_init (st)) /* ...update TRUE */
- ffestorag_update_init (vst); /* if needed. */
- if (!ffetarget_offset_add (&size, var_offset, size))
- /* Find one size of common block, complain if
- overflow. */
- ffetarget_offset_overflow (ffesymbol_text (s));
- else if (size > ffestorag_size (st))
- /* Extend common. */
- ffestorag_set_size (st, size);
- ffesymbol_set_storage (sv, vst);
- ffesymbol_set_common (sv, s);
- ffesymbol_signal_unreported (sv);
- ffestorag_update (st, sv, ffesymbol_basictype (sv),
- ffesymbol_kindtype (sv));
- if (ffesymbol_is_init (sv))
- init = TRUE;
- }
- else
- {
- /* Make sure offset agrees with known offset. */
- if (var_offset != ffestorag_offset (vst))
- {
- char io1[40];
- char io2[40];
-
- sprintf (&io1[0], "%" ffetargetOffset_f "d", var_offset);
- sprintf (&io2[0], "%" ffetargetOffset_f "d", ffestorag_offset (vst));
- ffebad_start (FFEBAD_EQUIV_MISMATCH);
- ffebad_string (ffesymbol_text (sv));
- ffebad_string (ffesymbol_text (s));
- ffebad_string (io1);
- ffebad_string (io2);
- ffebad_finish ();
- }
- }
- } /* (For every equivalence item in the list) */
- } /* (For every eqv list in the list of equivs
- for the variable) */
- }
- while (new_storage && need_storage);
-
- ffeequiv_kill (seq); /* Kill equiv obj. */
- } /* (For every variable in the common area) */
-
- return init;
-}
-
-/* ffeequiv_merge -- Merge two equivalence objects, return the merged result
-
- ffeequiv eq1;
- ffeequiv eq2;
- ffelexToken t; // points to current equivalence item forcing the merge.
- eq1 = ffeequiv_merge(eq1,eq2,t);
-
- If the two equivalence objects can be merged, they are, all the
- ffesymbols in their lists of lists are adjusted to point to the merged
- equivalence object, and the merged object is returned.
-
- Otherwise, the two equivalence objects have different non-NULL common
- symbols, so the merge cannot take place. An error message is issued and
- NULL is returned. */
-
-ffeequiv
-ffeequiv_merge (ffeequiv eq1, ffeequiv eq2, ffelexToken t)
-{
- ffebld list;
- ffebld eqs;
- ffesymbol symbol;
- ffebld last = NULL;
-
- /* If both equivalence objects point to different common-based symbols,
- complain. Of course, one or both might have NULL common symbols now,
- and get COMMONed later, but the COMMON statement handler checks for
- this. */
-
- if ((ffeequiv_common (eq1) != NULL) && (ffeequiv_common (eq2) != NULL)
- && (ffeequiv_common (eq1) != ffeequiv_common (eq2)))
- {
- ffebad_start (FFEBAD_EQUIV_COMMON);
- ffebad_here (0, ffelex_token_where_line (t), ffelex_token_where_column (t));
- ffebad_string (ffesymbol_text (ffeequiv_common (eq1)));
- ffebad_string (ffesymbol_text (ffeequiv_common (eq2)));
- ffebad_finish ();
- return NULL;
- }
-
- /* Make eq1 the new, merged object (arbitrarily). */
-
- if (ffeequiv_common (eq1) == NULL)
- ffeequiv_set_common (eq1, ffeequiv_common (eq2));
-
- /* If the victim object has any init'ed entities, so does the new object. */
-
- if (eq2->is_init)
- eq1->is_init = TRUE;
-
-#if FFEGLOBAL_ENABLED
- if (eq1->is_init && (ffeequiv_common (eq1) != NULL))
- ffeglobal_init_common (ffeequiv_common (eq1), t);
+ if (ffebld_op (begin) == FFEBLD_opANY)
+ return FALSE;
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
-
- /* If the victim object has any SAVEd entities, then the new object has
- some. */
-
- if (ffeequiv_is_save (eq2))
- ffeequiv_update_save (eq1);
-
- /* If the victim object has any init'd entities, then the new object has
- some. */
-
- if (ffeequiv_is_init (eq2))
- ffeequiv_update_init (eq1);
-
- /* Adjust all the symbols in the list of lists of equivalences for the
- victim equivalence object so they point to the new merged object
- instead. */
-
- for (list = ffeequiv_list (eq2); list != NULL; list = ffebld_trail (list))
- {
- for (eqs = ffebld_head (list); eqs != NULL; eqs = ffebld_trail (eqs))
- {
- symbol = ffeequiv_symbol (ffebld_head (eqs));
- if (ffesymbol_equiv (symbol) == eq2)
- ffesymbol_set_equiv (symbol, eq1);
- else
- assert (ffesymbol_equiv (symbol) == eq1); /* Can see a sym > once. */
- }
-
- /* For convenience, remember where the last ITEM in the outer list is. */
-
- if (ffebld_trail (list) == NULL)
- {
- last = list;
- break;
- }
- }
-
- /* Append the list of lists in the new, merged object to the list of lists
- in the victim object, then use the new combined list in the new merged
- object. */
-
- ffebld_set_trail (last, ffeequiv_list (eq1));
- ffeequiv_set_list (eq1, ffeequiv_list (eq2));
-
- /* Unlink and kill the victim object. */
-
- ffeequiv_kill (eq2);
-
- return eq1; /* Return the new merged object. */
-}
-
-/* ffeequiv_new -- Create new equivalence object, put in list
-
- ffeequiv eq;
- eq = ffeequiv_new();
-
- Creates a new equivalence object and adds it to the list of equivalence
- objects. */
-
-ffeequiv
-ffeequiv_new ()
-{
- ffeequiv eq;
-
- eq = malloc_new_ks (ffe_pool_program_unit (), "ffeequiv", sizeof (*eq));
- eq->next = (ffeequiv) &ffeequiv_list_.first;
- eq->previous = ffeequiv_list_.last;
- ffeequiv_set_common (eq, NULL); /* No COMMON area yet. */
- ffeequiv_set_list (eq, NULL); /* No list of lists of equivalences yet. */
- ffeequiv_set_is_save (eq, FALSE);
- ffeequiv_set_is_init (eq, FALSE);
- eq->next->previous = eq;
- eq->previous->next = eq;
-
- return eq;
-}
-
-/* ffeequiv_symbol -- Return symbol for equivalence expression
-
- ffesymbol symbol;
- ffebld expr;
- symbol = ffeequiv_symbol(expr);
-
- Finds the terminal SYMTER in an equivalence expression and returns the
- ffesymbol for it. */
-
-ffesymbol
-ffeequiv_symbol (ffebld expr)
-{
- assert (expr != NULL);
-
-again: /* :::::::::::::::::::: */
-
- switch (ffebld_op (expr))
- {
- case FFEBLD_opARRAYREF:
- case FFEBLD_opSUBSTR:
- expr = ffebld_left (expr);
- goto again; /* :::::::::::::::::::: */
-
- case FFEBLD_opSYMTER:
- return ffebld_symter (expr);
-
- case FFEBLD_opANY:
- return NULL;
-
- default:
- assert ("bad eq expr" == NULL);
- return NULL;
- }
-}
-
-/* ffeequiv_update_init -- Update the INIT flag for the area to TRUE
-
- ffeequiv eq;
- ffeequiv_update_init(eq);
-
- If the INIT flag for the <eq> object is already set, return. Else,
- set it TRUE and call ffe*_update_init for all objects contained in
- this one. */
-
-void
-ffeequiv_update_init (ffeequiv eq)
-{
- ffebld list; /* Current list in list of lists. */
- ffebld item; /* Current item in current list. */
- ffebld expr; /* Expression in head of current item. */
-
- if (eq->is_init)
- return;
-
- eq->is_init = TRUE;
-
- if ((eq->common != NULL)
- && !ffesymbol_is_init (eq->common))
- ffesymbol_update_init (eq->common); /* Shouldn't be needed. */
-
- for (list = eq->list; list != NULL; list = ffebld_trail (list))
- {
- for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item))
- {
- expr = ffebld_head (item);
-
- again: /* :::::::::::::::::::: */
-
- switch (ffebld_op (expr))
- {
- case FFEBLD_opANY:
- break;
-
- case FFEBLD_opSYMTER:
- if (!ffesymbol_is_init (ffebld_symter (expr)))
- ffesymbol_update_init (ffebld_symter (expr));
- break;
-
- case FFEBLD_opARRAYREF:
- expr = ffebld_left (expr);
- goto again; /* :::::::::::::::::::: */
-
- case FFEBLD_opSUBSTR:
- expr = ffebld_left (expr);
- goto again; /* :::::::::::::::::::: */
-
- default:
- assert ("bad op for ffeequiv_update_init" == NULL);
- break;
- }
- }
- }
-}
-
-/* ffeequiv_update_save -- Update the SAVE flag for the area to TRUE
-
- ffeequiv eq;
- ffeequiv_update_save(eq);
-
- If the SAVE flag for the <eq> object is already set, return. Else,
- set it TRUE and call ffe*_update_save for all objects contained in
- this one. */
-
-void
-ffeequiv_update_save (ffeequiv eq)
-{
- ffebld list; /* Current list in list of lists. */
- ffebld item; /* Current item in current list. */
- ffebld expr; /* Expression in head of current item. */
-
- if (eq->is_save)
- return;
-
- eq->is_save = TRUE;
-
- if ((eq->common != NULL)
- && !ffesymbol_is_save (eq->common))
- ffesymbol_update_save (eq->common); /* Shouldn't be needed. */
-
- for (list = eq->list; list != NULL; list = ffebld_trail (list))
- {
- for (item = ffebld_head (list); item != NULL; item = ffebld_trail (item))
- {
- expr = ffebld_head (item);
-
- again: /* :::::::::::::::::::: */
-
- switch (ffebld_op (expr))
- {
- case FFEBLD_opANY:
- break;
-
- case FFEBLD_opSYMTER:
- if (!ffesymbol_is_save (ffebld_symter (expr)))
- ffesymbol_update_save (ffebld_symter (expr));
- break;
-
- case FFEBLD_opARRAYREF:
- expr = ffebld_left (expr);
- goto again; /* :::::::::::::::::::: */
-
- case FFEBLD_opSUBSTR:
- expr = ffebld_left (expr);
- goto again; /* :::::::::::::::::::: */
-
- default:
- assert ("bad op for ffeequiv_update_save" == NULL);
- break;
- }
- }
- }
-}
diff --git a/gcc/f/equiv.h b/gcc/f/equiv.h
index 225cafded1b..eb0758ab9c5 100644
--- a/gcc/f/equiv.h
+++ b/gcc/f/equiv.h
@@ -1,101 +1,3 @@
-/* equiv.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- equiv.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_equiv
-#define _H_f_equiv
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-typedef struct _ffeequiv_ *ffeequiv;
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "lex.h"
-#include "storag.h"
-#include "symbol.h"
-
-/* Structure definitions. */
-
-struct _ffeequiv_
- {
- ffeequiv next;
- ffeequiv previous;
- ffesymbol common; /* Common area for this equiv, if any. */
- ffebld list; /* List of lists of equiv exprs. */
- bool is_save; /* Any SAVEd members? */
- bool is_init; /* Any initialized members? */
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffeequiv_add (ffeequiv eq, ffebld list, ffelexToken t);
-void ffeequiv_dump (ffeequiv eq);
-void ffeequiv_exec_transition (void);
-void ffeequiv_init_2 (void);
-void ffeequiv_kill (ffeequiv victim);
-bool ffeequiv_layout_cblock (ffestorag st);
-ffeequiv ffeequiv_merge (ffeequiv eq1, ffeequiv eq2, ffelexToken t);
-ffeequiv ffeequiv_new (void);
-ffesymbol ffeequiv_symbol (ffebld expr);
-void ffeequiv_update_init (ffeequiv eq);
-void ffeequiv_update_save (ffeequiv eq);
-
-/* Define macros. */
-
-#define ffeequiv_common(e) ((e)->common)
-#define ffeequiv_init_0()
-#define ffeequiv_init_1()
-#define ffeequiv_init_3()
-#define ffeequiv_init_4()
-#define ffeequiv_is_init(e) ((e)->is_init)
-#define ffeequiv_is_save(e) ((e)->is_save)
-#define ffeequiv_list(e) ((e)->list)
-#define ffeequiv_next(e) ((e)->next)
-#define ffeequiv_previous(e) ((e)->previous)
-#define ffeequiv_set_common(e,c) ((e)->common = (c))
-#define ffeequiv_set_init(e,i) ((e)->init = (i))
-#define ffeequiv_set_is_init(e,in) ((e)->is_init = (in))
-#define ffeequiv_set_is_save(e,sa) ((e)->is_save = (sa))
-#define ffeequiv_set_list(e,l) ((e)->list = (l))
-#define ffeequiv_terminate_0()
-#define ffeequiv_terminate_1()
-#define ffeequiv_terminate_2()
-#define ffeequiv_terminate_3()
-#define ffeequiv_terminate_4()
-
-/* End of #include file. */
-
+ Contributed by James Craig Burley (burley@gnu.org).
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
diff --git a/gcc/f/expr.c b/gcc/f/expr.c
index 9ab97556022..7e7bf867875 100644
--- a/gcc/f/expr.c
+++ b/gcc/f/expr.c
@@ -1,6 +1,6 @@
/* expr.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -31,7 +31,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Include files. */
#include "proj.h"
-#include <ctype.h>
#include "expr.h"
#include "bad.h"
#include "bld.h"
@@ -45,6 +44,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "src.h"
#include "st.h"
#include "symbol.h"
+#include "str.h"
#include "target.h"
#include "where.h"
@@ -55,26 +55,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
typedef enum
{
- FFEEXPR_dotdotNONE_,
- FFEEXPR_dotdotTRUE_,
- FFEEXPR_dotdotFALSE_,
- FFEEXPR_dotdotNOT_,
- FFEEXPR_dotdotAND_,
- FFEEXPR_dotdotOR_,
- FFEEXPR_dotdotXOR_,
- FFEEXPR_dotdotEQV_,
- FFEEXPR_dotdotNEQV_,
- FFEEXPR_dotdotLT_,
- FFEEXPR_dotdotLE_,
- FFEEXPR_dotdotEQ_,
- FFEEXPR_dotdotNE_,
- FFEEXPR_dotdotGT_,
- FFEEXPR_dotdotGE_,
- FFEEXPR_dotdot
- } ffeexprDotdot_;
-
-typedef enum
- {
FFEEXPR_exprtypeUNKNOWN_,
FFEEXPR_exprtypeOPERAND_,
FFEEXPR_exprtypeUNARY_,
@@ -242,7 +222,7 @@ struct _ffeexpr_find_
static ffeexprStack_ ffeexpr_stack_; /* Expression stack for semantic. */
static ffelexToken ffeexpr_tokens_[10]; /* Scratchpad tokens for syntactic. */
-static ffeexprDotdot_ ffeexpr_current_dotdot_; /* Current .FOO. keyword. */
+static ffestrOther ffeexpr_current_dotdot_; /* Current .FOO. keyword. */
static long ffeexpr_hollerith_count_; /* ffeexpr_token_number_ and caller. */
static int ffeexpr_level_; /* Level of DATA implied-DO construct. */
static bool ffeexpr_is_substr_ok_; /* If OPEN_PAREN as binary "op" ok. */
@@ -286,7 +266,6 @@ static void ffeexpr_check_impdo_ (ffebld list, ffelexToken list_t,
static void ffeexpr_update_impdo_ (ffebld expr, ffebld dovar);
static void ffeexpr_update_impdo_sym_ (ffebld expr, ffesymbol dovar);
static ffeexprContext ffeexpr_context_outer_ (ffeexprStack_ s);
-static ffeexprDotdot_ ffeexpr_dotdot_ (ffelexToken t);
static ffeexprExpr_ ffeexpr_expr_new_ (void);
static void ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t);
static bool ffeexpr_isdigits_ (char *p);
@@ -8530,124 +8509,6 @@ ffeexpr_context_outer_ (ffeexprStack_ s)
}
}
-/* ffeexpr_dotdot_ -- Look up name in list of .FOO. possibilities
-
- ffeexprDotdot_ d;
- ffelexToken t;
- d = ffeexpr_dotdot_(t);
-
- Returns the identifier for the name, or the NONE identifier. */
-
-static ffeexprDotdot_
-ffeexpr_dotdot_ (ffelexToken t)
-{
- char *p;
-
- switch (ffelex_token_length (t))
- {
- case 2:
- switch (*(p = ffelex_token_text (t)))
- {
- case FFESRC_CASE_MATCH_INIT ('E', 'e', match_2e, no_match_2):
- if (ffesrc_char_match_noninit (*++p, 'Q', 'q'))
- return FFEEXPR_dotdotEQ_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('G', 'g', match_2g, no_match_2):
- if (ffesrc_char_match_noninit (*++p, 'E', 'e'))
- return FFEEXPR_dotdotGE_;
- if (ffesrc_char_match_noninit (*p, 'T', 't'))
- return FFEEXPR_dotdotGT_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('L', 'l', match_2l, no_match_2):
- if (ffesrc_char_match_noninit (*++p, 'E', 'e'))
- return FFEEXPR_dotdotLE_;
- if (ffesrc_char_match_noninit (*p, 'T', 't'))
- return FFEEXPR_dotdotLT_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('N', 'n', match_2n, no_match_2):
- if (ffesrc_char_match_noninit (*++p, 'E', 'e'))
- return FFEEXPR_dotdotNE_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('O', 'o', match_2o, no_match_2):
- if (ffesrc_char_match_noninit (*++p, 'R', 'r'))
- return FFEEXPR_dotdotOR_;
- return FFEEXPR_dotdotNONE_;
-
- default:
- no_match_2: /* :::::::::::::::::::: */
- return FFEEXPR_dotdotNONE_;
- }
-
- case 3:
- switch (*(p = ffelex_token_text (t)))
- {
- case FFESRC_CASE_MATCH_INIT ('A', 'a', match_3a, no_match_3):
- if ((ffesrc_char_match_noninit (*++p, 'N', 'n'))
- && (ffesrc_char_match_noninit (*++p, 'D', 'd')))
- return FFEEXPR_dotdotAND_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('E', 'e', match_3e, no_match_3):
- if ((ffesrc_char_match_noninit (*++p, 'Q', 'q'))
- && (ffesrc_char_match_noninit (*++p, 'V', 'v')))
- return FFEEXPR_dotdotEQV_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('N', 'n', match_3n, no_match_3):
- if ((ffesrc_char_match_noninit (*++p, 'O', 'o'))
- && (ffesrc_char_match_noninit (*++p, 'T', 't')))
- return FFEEXPR_dotdotNOT_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('X', 'x', match_3x, no_match_3):
- if ((ffesrc_char_match_noninit (*++p, 'O', 'o'))
- && (ffesrc_char_match_noninit (*++p, 'R', 'r')))
- return FFEEXPR_dotdotXOR_;
- return FFEEXPR_dotdotNONE_;
-
- default:
- no_match_3: /* :::::::::::::::::::: */
- return FFEEXPR_dotdotNONE_;
- }
-
- case 4:
- switch (*(p = ffelex_token_text (t)))
- {
- case FFESRC_CASE_MATCH_INIT ('N', 'n', match_4n, no_match_4):
- if ((ffesrc_char_match_noninit (*++p, 'E', 'e'))
- && (ffesrc_char_match_noninit (*++p, 'Q', 'q'))
- && (ffesrc_char_match_noninit (*++p, 'V', 'v')))
- return FFEEXPR_dotdotNEQV_;
- return FFEEXPR_dotdotNONE_;
-
- case FFESRC_CASE_MATCH_INIT ('T', 't', match_4t, no_match_4):
- if ((ffesrc_char_match_noninit (*++p, 'R', 'r'))
- && (ffesrc_char_match_noninit (*++p, 'U', 'u'))
- && (ffesrc_char_match_noninit (*++p, 'E', 'e')))
- return FFEEXPR_dotdotTRUE_;
- return FFEEXPR_dotdotNONE_;
-
- default:
- no_match_4: /* :::::::::::::::::::: */
- return FFEEXPR_dotdotNONE_;
- }
-
- case 5:
- if (ffesrc_strcmp_2c (ffe_case_match (), ffelex_token_text (t), "FALSE",
- "false", "False")
- == 0)
- return FFEEXPR_dotdotFALSE_;
- return FFEEXPR_dotdotNONE_;
-
- default:
- return FFEEXPR_dotdotNONE_;
- }
-}
-
/* ffeexpr_percent_ -- Look up name in list of %FOO possibilities
ffeexprPercent_ p;
@@ -9523,9 +9384,13 @@ ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t)
as = FFEGLOBAL_argsummaryALTRTN;
break;
+#if 0
+ /* No, %LOC(foo) is just like any INTEGER(KIND=7)
+ expression, so don't treat it specially. */
case FFEBLD_opPERCENT_LOC:
as = FFEGLOBAL_argsummaryPTR;
break;
+#endif
case FFEBLD_opPERCENT_VAL:
as = FFEGLOBAL_argsummaryVAL;
@@ -9540,6 +9405,9 @@ ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t)
break;
case FFEBLD_opFUNCREF:
+#if 0
+ /* No, LOC(foo) is just like any INTEGER(KIND=7)
+ expression, so don't treat it specially. */
if ((ffebld_op (ffebld_left (item)) == FFEBLD_opSYMTER)
&& (ffesymbol_specific (ffebld_symter (ffebld_left (item)))
== FFEINTRIN_specLOC))
@@ -9547,6 +9415,7 @@ ffeexpr_fulfill_call_ (ffebld *expr, ffelexToken t)
as = FFEGLOBAL_argsummaryPTR;
break;
}
+#endif
/* Fall through. */
default:
if (ffebld_op (item) == FFEBLD_opSYMTER)
@@ -9607,7 +9476,7 @@ static bool
ffeexpr_isdigits_ (char *p)
{
for (; *p != '\0'; ++p)
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
return FALSE;
return TRUE;
}
@@ -11674,15 +11543,15 @@ ffeexpr_nil_period_ (ffelexToken t)
{
case FFELEX_typeNAME:
case FFELEX_typeNAMES:
- ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t);
+ ffeexpr_current_dotdot_ = ffestr_other (t);
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotNONE_:
+ case FFESTR_otherNone:
return (ffelexHandler) ffeexpr_nil_rhs_ (t);
- case FFEEXPR_dotdotTRUE_:
- case FFEEXPR_dotdotFALSE_:
- case FFEEXPR_dotdotNOT_:
+ case FFESTR_otherTRUE:
+ case FFESTR_otherFALSE:
+ case FFESTR_otherNOT:
return (ffelexHandler) ffeexpr_nil_end_period_;
default:
@@ -11703,13 +11572,13 @@ ffeexpr_nil_end_period_ (ffelexToken t)
{
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotNOT_:
+ case FFESTR_otherNOT:
if (ffelex_token_type (t) != FFELEX_typePERIOD)
return (ffelexHandler) ffeexpr_nil_rhs_ (t);
return (ffelexHandler) ffeexpr_nil_rhs_;
- case FFEEXPR_dotdotTRUE_:
- case FFEEXPR_dotdotFALSE_:
+ case FFESTR_otherTRUE:
+ case FFESTR_otherFALSE:
if (ffelex_token_type (t) != FFELEX_typePERIOD)
return (ffelexHandler) ffeexpr_nil_binary_ (t);
return (ffelexHandler) ffeexpr_nil_binary_;
@@ -11979,12 +11848,12 @@ ffeexpr_nil_binary_period_ (ffelexToken t)
{
case FFELEX_typeNAME:
case FFELEX_typeNAMES:
- ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t);
+ ffeexpr_current_dotdot_ = ffestr_other (t);
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotTRUE_:
- case FFEEXPR_dotdotFALSE_:
- case FFEEXPR_dotdotNOT_:
+ case FFESTR_otherTRUE:
+ case FFESTR_otherFALSE:
+ case FFESTR_otherNOT:
return (ffelexHandler) ffeexpr_nil_binary_sw_per_;
default:
@@ -13559,10 +13428,10 @@ ffeexpr_token_period_ (ffelexToken t)
{
case FFELEX_typeNAME:
case FFELEX_typeNAMES:
- ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t);
+ ffeexpr_current_dotdot_ = ffestr_other (t);
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotNONE_:
+ case FFESTR_otherNone:
if (ffest_ffebad_start (FFEBAD_IGNORING_PERIOD))
{
ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]),
@@ -13572,9 +13441,9 @@ ffeexpr_token_period_ (ffelexToken t)
ffelex_token_kill (ffeexpr_tokens_[0]);
return (ffelexHandler) ffeexpr_token_rhs_ (t);
- case FFEEXPR_dotdotTRUE_:
- case FFEEXPR_dotdotFALSE_:
- case FFEEXPR_dotdotNOT_:
+ case FFESTR_otherTRUE:
+ case FFESTR_otherFALSE:
+ case FFESTR_otherNOT:
ffeexpr_tokens_[1] = ffelex_token_use (t);
return (ffelexHandler) ffeexpr_token_end_period_;
@@ -13641,7 +13510,7 @@ ffeexpr_token_end_period_ (ffelexToken t)
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotNOT_:
+ case FFESTR_otherNOT:
e->type = FFEEXPR_exprtypeUNARY_;
e->u.operator.op = FFEEXPR_operatorNOT_;
e->u.operator.prec = FFEEXPR_operatorprecedenceNOT_;
@@ -13651,7 +13520,7 @@ ffeexpr_token_end_period_ (ffelexToken t)
return (ffelexHandler) ffeexpr_token_rhs_ (t);
return (ffelexHandler) ffeexpr_token_rhs_;
- case FFEEXPR_dotdotTRUE_:
+ case FFESTR_otherTRUE:
e->type = FFEEXPR_exprtypeOPERAND_;
e->u.operand
= ffebld_new_conter (ffebld_constant_new_logicaldefault (TRUE));
@@ -13663,7 +13532,7 @@ ffeexpr_token_end_period_ (ffelexToken t)
return (ffelexHandler) ffeexpr_token_binary_ (t);
return (ffelexHandler) ffeexpr_token_binary_;
- case FFEEXPR_dotdotFALSE_:
+ case FFESTR_otherFALSE:
e->type = FFEEXPR_exprtypeOPERAND_;
e->u.operand
= ffebld_new_conter (ffebld_constant_new_logicaldefault (FALSE));
@@ -13931,17 +13800,8 @@ ffeexpr_token_number_ (ffelexToken t)
/* Nothing specific we were looking for, so make an integer and pass the
current token to the binary state. */
- e = ffeexpr_expr_new_ ();
- e->type = FFEEXPR_exprtypeOPERAND_;
- e->token = ffeexpr_tokens_[0];
- e->u.operand = ffebld_new_conter (ffebld_constant_new_integerdefault
- (ffeexpr_tokens_[0]));
- ffebld_set_info (e->u.operand,
- ffeinfo_new (FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT, 0,
- FFEINFO_kindENTITY, FFEINFO_whereCONSTANT,
- FFETARGET_charactersizeNONE));
- ffeexpr_exprstack_push_operand_ (e);
+ ffeexpr_make_float_const_ ('I', ffeexpr_tokens_[0], NULL, NULL,
+ NULL, NULL, NULL);
return (ffelexHandler) ffeexpr_token_binary_ (t);
}
@@ -14599,12 +14459,12 @@ ffeexpr_token_binary_period_ (ffelexToken t)
{
case FFELEX_typeNAME:
case FFELEX_typeNAMES:
- ffeexpr_current_dotdot_ = ffeexpr_dotdot_ (t);
+ ffeexpr_current_dotdot_ = ffestr_other (t);
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotTRUE_:
- case FFEEXPR_dotdotFALSE_:
- case FFEEXPR_dotdotNOT_:
+ case FFESTR_otherTRUE:
+ case FFESTR_otherFALSE:
+ case FFESTR_otherNOT:
if (ffest_ffebad_start (FFEBAD_MISSING_BINARY_OPERATOR))
{
operand = ffeexpr_stack_->exprstack;
@@ -14618,16 +14478,6 @@ ffeexpr_token_binary_period_ (ffelexToken t)
ffelex_token_kill (ffeexpr_tokens_[0]);
return (ffelexHandler) ffeexpr_token_binary_sw_per_;
- case FFEEXPR_dotdotNONE_:
- if (ffest_ffebad_start (FFEBAD_INVALID_DOTDOT))
- {
- ffebad_string (ffelex_token_text (t));
- ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]),
- ffelex_token_where_column (ffeexpr_tokens_[0]));
- ffebad_finish ();
- }
- ffeexpr_current_dotdot_ = FFEEXPR_dotdotEQ_;
- /* Fall through here, pretending we got a .EQ. operator. */
default:
ffeexpr_tokens_[1] = ffelex_token_use (t);
return (ffelexHandler) ffeexpr_token_binary_end_per_;
@@ -14661,100 +14511,109 @@ ffeexpr_token_binary_end_per_ (ffelexToken t)
{
ffeexprExpr_ e;
- if (ffelex_token_type (t) != FFELEX_typePERIOD)
- {
- if (ffest_ffebad_start (FFEBAD_INSERTING_PERIOD))
- {
- ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]),
- ffelex_token_where_column (ffeexpr_tokens_[0]));
- ffebad_here (1, ffelex_token_where_line (t), ffelex_token_where_column (t));
- ffebad_string (ffelex_token_text (ffeexpr_tokens_[1]));
- ffebad_finish ();
- }
- }
-
- ffelex_token_kill (ffeexpr_tokens_[1]); /* Kill dot-dot token. */
-
e = ffeexpr_expr_new_ ();
e->type = FFEEXPR_exprtypeBINARY_;
e->token = ffeexpr_tokens_[0];
switch (ffeexpr_current_dotdot_)
{
- case FFEEXPR_dotdotAND_:
+ case FFESTR_otherAND:
e->u.operator.op = FFEEXPR_operatorAND_;
e->u.operator.prec = FFEEXPR_operatorprecedenceAND_;
e->u.operator.as = FFEEXPR_operatorassociativityAND_;
break;
- case FFEEXPR_dotdotOR_:
+ case FFESTR_otherOR:
e->u.operator.op = FFEEXPR_operatorOR_;
e->u.operator.prec = FFEEXPR_operatorprecedenceOR_;
e->u.operator.as = FFEEXPR_operatorassociativityOR_;
break;
- case FFEEXPR_dotdotXOR_:
+ case FFESTR_otherXOR:
e->u.operator.op = FFEEXPR_operatorXOR_;
e->u.operator.prec = FFEEXPR_operatorprecedenceXOR_;
e->u.operator.as = FFEEXPR_operatorassociativityXOR_;
break;
- case FFEEXPR_dotdotEQV_:
+ case FFESTR_otherEQV:
e->u.operator.op = FFEEXPR_operatorEQV_;
e->u.operator.prec = FFEEXPR_operatorprecedenceEQV_;
e->u.operator.as = FFEEXPR_operatorassociativityEQV_;
break;
- case FFEEXPR_dotdotNEQV_:
+ case FFESTR_otherNEQV:
e->u.operator.op = FFEEXPR_operatorNEQV_;
e->u.operator.prec = FFEEXPR_operatorprecedenceNEQV_;
e->u.operator.as = FFEEXPR_operatorassociativityNEQV_;
break;
- case FFEEXPR_dotdotLT_:
+ case FFESTR_otherLT:
e->u.operator.op = FFEEXPR_operatorLT_;
e->u.operator.prec = FFEEXPR_operatorprecedenceLT_;
e->u.operator.as = FFEEXPR_operatorassociativityLT_;
break;
- case FFEEXPR_dotdotLE_:
+ case FFESTR_otherLE:
e->u.operator.op = FFEEXPR_operatorLE_;
e->u.operator.prec = FFEEXPR_operatorprecedenceLE_;
e->u.operator.as = FFEEXPR_operatorassociativityLE_;
break;
- case FFEEXPR_dotdotEQ_:
+ case FFESTR_otherEQ:
e->u.operator.op = FFEEXPR_operatorEQ_;
e->u.operator.prec = FFEEXPR_operatorprecedenceEQ_;
e->u.operator.as = FFEEXPR_operatorassociativityEQ_;
break;
- case FFEEXPR_dotdotNE_:
+ case FFESTR_otherNE:
e->u.operator.op = FFEEXPR_operatorNE_;
e->u.operator.prec = FFEEXPR_operatorprecedenceNE_;
e->u.operator.as = FFEEXPR_operatorassociativityNE_;
break;
- case FFEEXPR_dotdotGT_:
+ case FFESTR_otherGT:
e->u.operator.op = FFEEXPR_operatorGT_;
e->u.operator.prec = FFEEXPR_operatorprecedenceGT_;
e->u.operator.as = FFEEXPR_operatorassociativityGT_;
break;
- case FFEEXPR_dotdotGE_:
+ case FFESTR_otherGE:
e->u.operator.op = FFEEXPR_operatorGE_;
e->u.operator.prec = FFEEXPR_operatorprecedenceGE_;
e->u.operator.as = FFEEXPR_operatorassociativityGE_;
break;
default:
- assert ("Bad unary dotdot in ffeexpr_current_dotdot_" == NULL);
+ if (ffest_ffebad_start (FFEBAD_INVALID_DOTDOT))
+ {
+ ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]),
+ ffelex_token_where_column (ffeexpr_tokens_[0]));
+ ffebad_string (ffelex_token_text (ffeexpr_tokens_[1]));
+ ffebad_finish ();
+ }
+ e->u.operator.op = FFEEXPR_operatorEQ_;
+ e->u.operator.prec = FFEEXPR_operatorprecedenceEQ_;
+ e->u.operator.as = FFEEXPR_operatorassociativityEQ_;
+ break;
}
ffeexpr_exprstack_push_binary_ (e);
if (ffelex_token_type (t) != FFELEX_typePERIOD)
- return (ffelexHandler) ffeexpr_token_rhs_ (t);
+ {
+ if (ffest_ffebad_start (FFEBAD_INSERTING_PERIOD))
+ {
+ ffebad_here (0, ffelex_token_where_line (ffeexpr_tokens_[0]),
+ ffelex_token_where_column (ffeexpr_tokens_[0]));
+ ffebad_here (1, ffelex_token_where_line (t), ffelex_token_where_column (t));
+ ffebad_string (ffelex_token_text (ffeexpr_tokens_[1]));
+ ffebad_finish ();
+ }
+ ffelex_token_kill (ffeexpr_tokens_[1]); /* Kill dot-dot token. */
+ return (ffelexHandler) ffeexpr_token_rhs_ (t);
+ }
+
+ ffelex_token_kill (ffeexpr_tokens_[1]); /* Kill dot-dot token. */
return (ffelexHandler) ffeexpr_token_rhs_;
}
@@ -15853,6 +15712,16 @@ ffeexpr_make_float_const_ (char exp_letter, ffelexToken integer,
break;
#endif
+ case 'I': /* Make an integer. */
+ e->u.operand = ffebld_new_conter (ffebld_constant_new_integerdefault
+ (ffeexpr_tokens_[0]));
+ ffebld_set_info (e->u.operand,
+ ffeinfo_new (FFEINFO_basictypeINTEGER,
+ FFEINFO_kindtypeINTEGERDEFAULT, 0,
+ FFEINFO_kindENTITY, FFEINFO_whereCONSTANT,
+ FFETARGET_charactersizeNONE));
+ break;
+
default:
no_match: /* :::::::::::::::::::: */
assert ("Lost the exponent letter!" == NULL);
diff --git a/gcc/f/expr.h b/gcc/f/expr.h
index db7d9fa78e7..5bf37928672 100644
--- a/gcc/f/expr.h
+++ b/gcc/f/expr.h
@@ -1,194 +1 @@
-/* expr.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- expr.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_expr
-#define _H_f_expr
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFEEXPR_contextLET,
- FFEEXPR_contextASSIGN,
- FFEEXPR_contextIOLIST,
- FFEEXPR_contextPARAMETER,
- FFEEXPR_contextSUBROUTINEREF,
- FFEEXPR_contextDATA,
- FFEEXPR_contextIF,
- FFEEXPR_contextARITHIF,
- FFEEXPR_contextDO,
- FFEEXPR_contextDOWHILE,
- FFEEXPR_contextFORMAT,
- FFEEXPR_contextAGOTO,
- FFEEXPR_contextCGOTO,
- FFEEXPR_contextCHARACTERSIZE,
- FFEEXPR_contextEQUIVALENCE,
- FFEEXPR_contextSTOP,
- FFEEXPR_contextRETURN,
- FFEEXPR_contextSFUNCDEF,
- FFEEXPR_contextINCLUDE,
- FFEEXPR_contextWHERE,
- FFEEXPR_contextSELECTCASE,
- FFEEXPR_contextCASE,
- FFEEXPR_contextDIMLIST,
- FFEEXPR_contextDIMLISTCOMMON, /* Dim list in COMMON stmt. */
- FFEEXPR_contextFILEASSOC, /* ASSOCIATEVARIABLE=. */
- FFEEXPR_contextFILEINT, /* IOSTAT=. */
- FFEEXPR_contextFILEDFINT, /* NEXTREC=. */
- FFEEXPR_contextFILELOG, /* NAMED=. */
- FFEEXPR_contextFILENUM, /* Numerical expression. */
- FFEEXPR_contextFILECHAR, /* Character expression. */
- FFEEXPR_contextFILENUMCHAR, /* READ KEYxyz=. */
- FFEEXPR_contextFILEDFCHAR, /* Default kind character expression. */
- FFEEXPR_contextFILEKEY, /* OPEN KEY=. */
- FFEEXPR_contextFILEEXTFUNC, /* USEROPEN=. */
- FFEEXPR_contextFILEUNIT, /* READ/WRITE UNIT=. */
- FFEEXPR_contextFILEUNIT_DF, /* DEFINE FILE unit (no "(" after it). */
- FFEEXPR_contextFILEFORMATNML, /* [FMT=] or [NML=]. */
- FFEEXPR_contextFILEFORMAT, /* FMT=. */
- FFEEXPR_contextFILENAMELIST,/* NML=. */
- FFEEXPR_contextFILENUMAMBIG,/* BACKSPACE, ENDFILE, REWIND, UNLOCK...
- where at e.g. BACKSPACE(, if COMMA seen
- before ), it is ok. */
- FFEEXPR_contextFILEUNITAMBIG, /* READ(, if COMMA seen before ), ok. */
- FFEEXPR_contextFILEVXTCODE, /* ENCODE/DECODE third arg (scalar/array). */
- FFEEXPR_contextALLOCATE, /* ALLOCATE objects (weird). */
- FFEEXPR_contextDEALLOCATE, /* DEALLOCATE objects (weird). */
- FFEEXPR_contextHEAPSTAT, /* ALLOCATE/DEALLOCATE STAT= variable. */
- FFEEXPR_contextKINDTYPE, /* KIND=. */
- FFEEXPR_contextINITVAL, /* R426 =initialization-expr. */
- FFEEXPR_contextNULLIFY, /* Pointer names only (F90) or pointers. */
- FFEEXPR_contextIOLISTDF, /* IOLIST w/internal file (V112 9-14 30,31). */
- FFEEXPR_contextINDEX_, /* Element dimension or substring value. */
- FFEEXPR_contextEQVINDEX_, /* EQUIVALENCE element dimension. */
- FFEEXPR_contextDATAIMPDOINDEX_, /* INDEX in DATAIMPDO context. */
- FFEEXPR_contextIMPDOITEM_,
- FFEEXPR_contextIMPDOITEMDF_,/* to ...ITEM_ as IOLISTDF is to IOLIST. */
- FFEEXPR_contextIMPDOCTRL_,
- FFEEXPR_contextDATAIMPDOITEM_,
- FFEEXPR_contextDATAIMPDOCTRL_,
- FFEEXPR_contextLOC_,
- FFEEXPR_contextACTUALARG_, /* Actual arg to function or subroutine;
- turns into ACTUALARGEXPR_ if tokens not
- NAME (CLOSE_PAREN/COMMA) or PERCENT.... */
- FFEEXPR_contextACTUALARGEXPR_, /* Like LET but disallow CHAR*(*)
- concats. */
- FFEEXPR_contextINDEXORACTUALARG_, /* "CHARACTER FOO; PRINT *,FOO(?". */
- FFEEXPR_contextINDEXORACTUALARGEXPR_, /* ? not NAME
- (CLOSE_PAREN/COMMA). */
- FFEEXPR_contextSFUNCDEFINDEX_, /* INDEX_ within stmt-func def. */
- FFEEXPR_contextSFUNCDEFACTUALARG_,
- FFEEXPR_contextSFUNCDEFACTUALARGEXPR_,
- FFEEXPR_contextSFUNCDEFINDEXORACTUALARG_,
- FFEEXPR_contextSFUNCDEFINDEXORACTUALARGEXPR_,
- FFEEXPR_contextPAREN_, /* Rhs paren except in LET context. */
- FFEEXPR_contextPARENFILENUM_, /* Either PAREN or FILENUM context. */
- FFEEXPR_contextPARENFILEUNIT_, /* Either PAREN or FILEUNIT context. */
- FFEEXPR_context
- } ffeexprContext;
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "lex.h"
-#include "malloc.h"
-
-/* Structure definitions. */
-
-typedef ffelexHandler (*ffeexprCallback) (ffelexToken ft, ffebld expr,
- ffelexToken t);
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-ffebld ffeexpr_collapse_convert (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_paren (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_uplus (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_uminus (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_not (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_add (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_subtract (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_multiply (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_divide (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_power (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_concatenate (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_lt (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_le (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_eq (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_ne (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_gt (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_ge (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_and (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_or (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_xor (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_eqv (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_neqv (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_symter (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_funcref (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_arrayref (ffebld expr, ffelexToken t);
-ffebld ffeexpr_collapse_substr (ffebld expr, ffelexToken t);
-ffebld ffeexpr_convert (ffebld source, ffelexToken source_token,
- ffelexToken dest_token, ffeinfoBasictype bt, ffeinfoKindtype kt,
- ffeinfoRank rk, ffetargetCharacterSize sz,
- ffeexprContext context);
-ffebld ffeexpr_convert_expr (ffebld source, ffelexToken source_token,
- ffebld dest, ffelexToken dest_token,
- ffeexprContext context);
-ffebld ffeexpr_convert_to_sym (ffebld source, ffelexToken source_token,
- ffesymbol dest, ffelexToken dest_token);
-void ffeexpr_init_2 (void);
-ffelexHandler ffeexpr_rhs (mallocPool pool, ffeexprContext context,
- ffeexprCallback callback);
-ffelexHandler ffeexpr_lhs (mallocPool pool, ffeexprContext context,
- ffeexprCallback callback);
-void ffeexpr_terminate_2 (void);
-void ffeexpr_type_combine (ffeinfoBasictype *nbt, ffeinfoKindtype *nkt,
- ffeinfoBasictype lbt, ffeinfoKindtype lkt,
- ffeinfoBasictype rbt, ffeinfoKindtype rkt,
- ffelexToken t);
-
-/* Define macros. */
-
-#define ffeexpr_init_0()
-#define ffeexpr_init_1()
-#define ffeexpr_init_3()
-#define ffeexpr_init_4()
-#define ffeexpr_terminate_0()
-#define ffeexpr_terminate_1()
-#define ffeexpr_terminate_3()
-#define ffeexpr_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/fini.c b/gcc/f/fini.c
index fdf577b91a2..3b98949524b 100644
--- a/gcc/f/fini.c
+++ b/gcc/f/fini.c
@@ -1,6 +1,6 @@
/* fini.c
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -19,8 +19,9 @@ 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
+
#include "proj.h"
-#include <ctype.h>
#include "malloc.h"
#define MAXNAMELEN 100
@@ -306,7 +307,7 @@ main (int argc, char **argv)
}
else if (cc != EOF)
{
- while (((cc = getc (in)) != EOF) && (!isalnum (cc)))
+ while (((cc = getc (in)) != EOF) && (! ISALNUM (cc)))
;
ungetc (cc, in);
break;
@@ -377,7 +378,7 @@ main (int argc, char **argv)
for (i = 0; i < newname->namelen; ++i)
{
cc = buf[i];
- if (isascii (cc) && isalpha (cc))
+ if (ISALPHA (cc))
{
newname->name_uc[i] = toupper (cc);
newname->name_lc[i] = tolower (cc);
diff --git a/gcc/f/flags.j b/gcc/f/flags.j
index 67966b9448e..5bf37928672 100644
--- a/gcc/f/flags.j
+++ b/gcc/f/flags.j
@@ -1,27 +1 @@
-/* flags.j -- Wrapper for GCC's flags.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_flags
-#define _J_f_flags
-#include "flags.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/g77.1 b/gcc/f/g77.1
index 479e3006ea6..d6a465b07ea 100644
--- a/gcc/f/g77.1
+++ b/gcc/f/g77.1
@@ -1,20 +1,20 @@
.\" Copyright (c) 1995-1997 Free Software Foundation -*-Text-*-
.\" See section COPYING for conditions for redistribution
.\" FIXME: no info here on predefines. Should there be? extra for F77...
-.TH G77 1 "1998-03-08" "GNU Tools" "GNU Tools"
+.TH G77 1 "1998-09-01" "GNU Tools" "GNU Tools"
.de BP
.sp
.ti \-.2i
\(**
..
.SH NAME
-g77 \- GNU project Fortran Compiler (v0.5.22)
+g77 \- GNU project Fortran Compiler (v0.5.24)
.SH SYNOPSIS
.RB g77 " [" \c
.IR option " | " "filename " ].\|.\|.
.SH WARNING
The information in this man page is an extract from the full
-documentation of the GNU Fortran compiler (version 0.5.22),
+documentation of the GNU Fortran compiler (version 0.5.24),
and is limited to the meaning of some of the options.
.PP
This man page is not up to date, since no volunteers want to
@@ -22,8 +22,8 @@ maintain it. If you find a discrepancy between the man page and the
software, please check the Info file, which is the authoritative
documentation.
.\" .PP
-.\" The version of GNU Fortran documented by the Info file is 0.5.22,
-.\" which includes substantial improvements and changes since 0.5.22,
+.\" The version of GNU Fortran documented by the Info file is 0.5.24,
+.\" which includes substantial improvements and changes since 0.5.24,
.\" the version documented in this man page.
.PP
If we find that the things in this man page that are out of date cause
@@ -37,7 +37,7 @@ For complete and current documentation, refer to the Info file `\|\c
.B g77\c
\&\|' or the manual
.I
-Using and Porting GNU Fortran (for version 0.5.22)\c
+Using and Porting GNU Fortran (for version 0.5.24)\c
\&. Both are made from the Texinfo source file
.BR g77.texi .
.PP
@@ -152,19 +152,6 @@ Define macro \c
.I defn\c
\&.
.TP
-.BI \-\-driver= command
-Specifies that
-.IR command ,
-rather than
-.RB ` gcc ',
-is to be invoked by
-.RB ` g77 '
-to do its job. Example: Within the gcc build directory after building
-GNU Fortran (but without having to install it),
-.nf
- ./g77 \-\-driver=./xgcc -B./ foo.f
-.fi
-.TP
.B \-E
Stop after the preprocessing stage; do not run the compiler proper. The
output is preprocessed source code, which is sent to the
@@ -247,16 +234,7 @@ Print (on standard error output) the commands executed to run the
stages of compilation. Also print the version number of the compiler
driver program and of the preprocessor and the compiler proper. The
version numbers of g77 itself and the GCC distribution on which it is
-based are distinct. Use
-.RB ` \-\-driver=true '
-to disable actual invocation of
-.RB ` gcc '
-(since
-.RB ` true '
-is the name of a UNIX command that simply returns success status).
-The command
-.RB ` "g77 -v" '
-is the appropriate one to determine the g77 and GCC version numbers.
+based are distinct.
.TP
.B \-Wall
Issue warnings for conditions which pertain to usage that we recommend
@@ -290,7 +268,7 @@ a.out link edited output
.br
\fILIBDIR\fR/f771 compiler
.br
-\fILIBDIR\fR/libf2c.a Fortran run-time library
+\fILIBDIR\fR/libg2c.a Fortran run-time library
.br
\fILIBDIR\fR/libgcc.a GCC subroutine library
.br
@@ -333,7 +311,7 @@ entries in
\&.
.br
.I
-Using and Porting GNU Fortran (for version 0.5.22)\c
+Using and Porting GNU Fortran (for version 0.5.24)\c
, James Craig Burley;
.I
Using and Porting GNU CC (for version 2.0)\c
@@ -357,7 +335,7 @@ For instructions on how to report bugs, type `\|\c
\&\|'.
.SH COPYING
-Copyright (c) 1991-1997 Free Software Foundation, Inc.
+Copyright (c) 1991-1998 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi
index 5cf39974994..b799e6f7bb3 100644
--- a/gcc/f/g77.texi
+++ b/gcc/f/g77.texi
@@ -13,6 +13,14 @@
@c %**start of header
@setfilename g77.info
+
+@set last-up-date 1998-09-01
+@set version-g77 0.5.24
+@set email-general egcs@@cygnus.com
+@set email-bugs egcs-bugs@@cygnus.com
+@set path-g77 egcs/gcc/f
+@set path-libf2c egcs/libf2c
+
@c @setfilename useg77.info
@c @setfilename portg77.info
@c To produce the full manual, use the "g77.info" setfilename, and
@@ -102,16 +110,16 @@ was contributed to Craig by David Ronis (@email{ronis@@onsager.chem.mcgill.ca}).
@sp 2
@center James Craig Burley
@sp 3
-@center Last updated 1998-01-11
+@center Last updated @value{last-up-date}
@sp 1
@c The version number appears some more times in this file.
-@center for version 0.5.21
+@center for version @value{version-g77}
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1995-1997 Free Software Foundation, Inc.
@sp 2
-For GNU Fortran Version 0.5.21*
+For GNU Fortran Version @value{version-g77}*
@sp 1
Published by the Free Software Foundation @*
59 Temple Place - Suite 330@*
@@ -144,9 +152,9 @@ original English.
@ifinfo
-@dircategory Fortran Programming
+@dircategory Programming
@direntry
-* g77: (g77). The GNU Fortran compilation system.
+* g77: (g77). The GNU Fortran compiler.
@end direntry
@node Top, Copying,, (DIR)
@top Introduction
@@ -156,19 +164,19 @@ original English.
@ifset USING
This manual documents how to run, install and port the GNU Fortran
compiler, as well as its new features and incompatibilities, and how to
-report bugs. It corresponds to GNU Fortran version 0.5.21.
+report bugs. It corresponds to GNU Fortran version @value{version-g77}.
@end ifset
@end ifset
@ifclear INTERNALS
This manual documents how to run and install the GNU Fortran compiler,
as well as its new features and incompatibilities, and how to report
-bugs. It corresponds to GNU Fortran version 0.5.21.
+bugs. It corresponds to GNU Fortran version @value{version-g77}.
@end ifclear
@ifclear USING
This manual documents how to port the GNU Fortran compiler,
as well as its new features and incompatibilities, and how to report
-bugs. It corresponds to GNU Fortran version 0.5.21.
+bugs. It corresponds to GNU Fortran version @value{version-g77}.
@end ifclear
@end ifinfo
@@ -639,7 +647,7 @@ Jonathan Corbet
@item
Dr.@: Mark Fernyhough
@item
-Takafumi Hayashi (The University of AIzu)---@email{takafumi@@u-aizu.ac.jp}
+Takafumi Hayashi (The University of Aizu)---@email{takafumi@@u-aizu.ac.jp}
@item
Kate Hedstrom
@item
@@ -691,6 +699,11 @@ So far, this has resulted in the three, somewhat
experimental, options added by @code{g77} to the @code{gcc}
compiler and its back end.
+(These, in turn, have made their way into the @code{egcs}
+version of the compiler, and do not exist in @code{gcc}
+version 2.8 or versions of @code{g77} based on that version
+of @code{gcc}.)
+
@item
John Carr (@email{jfc@@mit.edu}) wrote the alias analysis improvements.
@@ -810,7 +823,7 @@ Work is needed on documentation, testing, porting
to various machines, and in some cases, coding (although major
changes planned for version 0.6 make it difficult to add manpower to this
area).
-Email @email{egcs@@cygnus.com} to volunteer for this work.
+Email @email{@value{email-general}} to volunteer for this work.
@xref{Funding,,Funding Free Software}, for more information.
@@ -1035,16 +1048,28 @@ used to build the operating system kernel.)
The @code{g77} command itself, which also might be installed as the
system's @code{f77} command.
+@cindex libg2c library
@cindex libf2c library
@cindex libraries, libf2c
+@cindex libraries, libg2c
@cindex run-time library
@item
-The @code{libf2c} run-time library.
+The @code{libg2c} run-time library.
This library contains the machine code needed to support
capabilities of the Fortran language that are not directly
provided by the machine code generated by the @code{g77}
compilation phase.
+@code{libg2c} is just the unique name @code{g77} gives
+to its version of @code{libf2c} to distinguish it from
+any copy of @code{libf2c} installed from @code{f2c}
+(or versions of @code{g77} that built @code{libf2c} under
+that same name)
+on the system.
+
+The maintainer of @code{libf2c} currently is
+@email{dmg@@bell-labs.com}.
+
@cindex f771 program
@cindex programs, f771
@cindex assembler
@@ -1114,7 +1139,7 @@ the @code{gcc} command.
Fortran users will normally use @code{g77} instead of @code{gcc},
because @code{g77}
knows how to specify the libraries needed to link with Fortran programs
-(@code{libf2c} and @code{lm}).
+(@code{libg2c} and @code{lm}).
@code{g77} can still compile and link programs and
source files written in other languages, just like @code{gcc}.
@@ -1127,7 +1152,7 @@ produces much more output than @samp{gcc -v} currently does.
(If it produces an error message near the end of the output---diagnostics
from the linker, usually @code{ld}---you might
have an out-of-date @code{libf2c} that improperly handles
-complex arithmetic.)@
+complex arithmetic.)
In the output of this command, the line beginning @samp{GNU Fortran Front
End} identifies the version number of GNU Fortran; immediately
preceding that line is a line identifying the version of @code{gcc}
@@ -1150,14 +1175,15 @@ functions this way.
Instead, operations like trigonometric
functions are compiled by the @code{f771} compiler
(invoked by @code{g77} when compiling Fortran code) into machine
-code that, when run, calls on functions in @code{libf2c}, so
-@code{libf2c} must be linked with almost every useful program
+code that, when run, calls on functions in @code{libg2c}, so
+@code{libg2c} must be linked with almost every useful program
having any component compiled by GNU Fortran.
(As mentioned above, the @code{g77} command takes
care of all this for you.)
The @code{f771} program represents most of what is unique to GNU Fortran.
-While much of the @code{libf2c} component is really part of @code{f2c},
+While much of the @code{libg2c} component comes from
+the @code{libf2c} component of @code{f2c},
a free Fortran-to-C converter distributed by Bellcore (AT&T),
plus @code{libU77}, provided by Dave Love,
and the @code{g77} command is just a small front-end to @code{gcc},
@@ -1239,15 +1265,9 @@ appropriately before submitting it to the @code{gcc} command.
@cindex -v option
@cindex g77 options, -v
@cindex options, -v
-@cindex -@w{}-driver option
-@cindex g77 options, -@w{}-driver
-@cindex options, -@w{}-driver
Use the @samp{-v} option with @code{g77}
to see what is going on---the first line of output is the invocation
of the @code{gcc} command.
-Use @samp{--driver=true} to disable actual invocation
-of @code{gcc} (this works because @samp{true} is the name of a
-UNIX command that simply returns success status).
@node Invoking G77
@chapter GNU Fortran Command Options
@@ -1262,25 +1282,16 @@ for information
on the non-Fortran-specific aspects of the @code{gcc} command (and,
therefore, the @code{g77} command).
-The @code{g77} command supports one option not supported by
-the @code{gcc} command:
-
-@table @code
-@cindex -@w{}-driver option
-@cindex g77 options, -@w{}-driver
-@cindex options, -@w{}-driver
-@item --driver=@var{command}
-Specifies that @var{command}, rather than @code{gcc}, is to
-be invoked by @code{g77} to do its job.
-For example, within the @code{gcc} build directory after
-building GNU Fortran (but without having to install it),
-@kbd{./g77 --driver=./xgcc foo.f -B./}.
-@end table
-
@cindex options, negative forms
@cindex negative forms of options
-All other options are supported both by @code{g77} and by @code{gcc} as
-modified (and reinstalled) by the @code{g77} distribution.
+All @code{gcc} and @code{g77} options
+are accepted both by @code{g77} and by @code{gcc}
+(as well as any other drivers built at the same time,
+such as @code{g++}),
+since adding @code{g77} to the @code{gcc} distribution
+enables acceptance of @code{g77}-specific options
+by all of the relevant drivers.
+
In some cases, options have positive and negative forms;
the negative form of @samp{-ffoo} would be @samp{-fno-foo}.
This manual documents only one of these two forms, whichever
@@ -1317,7 +1328,7 @@ by type. Explanations are in the following sections.
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@smallexample
---driver -fversion -fset-g77-defaults -fno-silent
+-fversion -fset-g77-defaults -fno-silent
@end smallexample
@item Shorthand Options
@@ -1528,7 +1539,7 @@ line being effectively commented out---unfortunate if that
line is a non-comment line of important code!
@emph{Note:} The @samp{-traditional} and @samp{-undef} flags are supplied
-to @code{cpp} by default, to avoid unpleasant surprises.
+to @code{cpp} by default, to help avoid unpleasant surprises.
@xref{Preprocessor Options,,Options Controlling the Preprocessor,
gcc,Using and Porting GNU CC}.
This means that ANSI C preprocessor features (such as the @samp{#}
@@ -1539,16 +1550,19 @@ Thus, if you want to do system-specific
tests, use, for example, @samp{#ifdef __linux__} rather than @samp{#ifdef linux}.
Use the @samp{-v} option to see exactly how the preprocessor is invoked.
+@cindex /*
+Unfortunately, the @samp{-traditional} flag will not avoid an error from
+anything that @code{cpp} sees as an unterminated C comment, such as:
+@smallexample
+C Some Fortran compilers accept /* as starting
+C an inline comment.
+@end smallexample
+@xref{Trailing Comment}.
+
The following options that affect overall processing are recognized
by the @code{g77} and @code{gcc} commands in a GNU Fortran installation:
@table @code
-@item --driver=@var{command}
-This works when invoking only the @code{g77} command, not
-when invoking the @code{gcc} command.
-@xref{Invoking G77,,GNU Fortran Command Options}, for
-information on this option.
-
@cindex -fversion option
@cindex options, -fversion
@cindex printing version information
@@ -1563,13 +1577,14 @@ and when the resulting commands compile Fortran source files.)
@cindex -fset-g77-defaults option
@cindex options, -fset-g77-defaults
@item -fset-g77-defaults
+@emph{Version info:}
+This option is obsolete in @code{egcs}
+as of version 1.1.
+
Set up whatever @code{gcc} options are to apply to Fortran
compilations, and avoid running internal consistency checks
that might take some time.
-As of version 0.5.20, this is equivalent to @samp{-fmove-all-movables
--freduce-all-givs -frerun-loop-opt -fargument-noalias-global}.
-
This option is supplied automatically when compiling Fortran code
via the @code{g77} or @code{gcc} command.
The description of this option is provided so that users seeing
@@ -1900,7 +1915,7 @@ ANSI FORTRAN 77 and more recent versions of the Fortran standard
specify that the body of an imperative @code{DO} loop is not executed
if the number of iterations calculated from the parameters of the
loop is less than 1.
-(For example, @samp{DO 10 I = 1, 0}.)@
+(For example, @samp{DO 10 I = 1, 0}.)
Such a loop is called a @dfn{zero-trip loop}.
Prior to ANSI FORTRAN 77, many compilers implemented @code{DO} loops
@@ -2587,6 +2602,9 @@ gcc,Using and Porting GNU CC}, for more information on debugging options.
Most Fortran users will want to use no optimization when
developing and testing programs, and use @samp{-O} or @samp{-O2} when
compiling programs for late-cycle testing and for production use.
+However, note that certain diagnostics---such as for uninitialized
+variables---depend on the flow analysis done by @samp{-O}, i.e.@: you
+must use @samp{-O} or @samp{-O2} to get such diagnostics.
The following flags have particular applicability when
compiling Fortran programs:
@@ -2595,7 +2613,7 @@ compiling Fortran programs:
@cindex -malign-double option
@cindex options, -malign-double
@item -malign-double
-(Intel 386 architecture only.)
+(Intel x86 architecture only.)
Noticeably improves performance of @code{g77} programs making
heavy use of @code{REAL(KIND=2)} (@code{DOUBLE PRECISION}) data
@@ -2615,9 +2633,11 @@ and data sets.
this option does not apply, generally speaking, to Fortran
code compiled by @code{g77}.
-@emph{Also note:} @code{g77} fixes a @code{gcc} backend bug to allow
-@samp{-malign-double} to work generally, not just with
+@emph{Also note:} @samp{-malign-double} applies only to
statically-allocated data.
+Double-precision data on the stack can still
+cause problems due to misalignment.
+@xref{Aligned Data}.
@emph{Also also note:} The negative form of @samp{-malign-double}
is @samp{-mno-align-double}, not @samp{-benign-double}.
@@ -2627,8 +2647,28 @@ is @samp{-mno-align-double}, not @samp{-benign-double}.
@item -ffloat-store
@cindex IEEE conformance
@cindex conformance, IEEE
-Might help a Fortran program that depends on exact IEEE conformance
-on some machines, but might slow down a program that doesn't.
+@cindex floating point precision
+Might help a Fortran program that depends on exact IEEE conformance on
+some machines, but might slow down a program that doesn't.
+
+This option is effective when the floating point unit is set to work in
+IEEE 854 `extended precision'---as it typically is on x86 and m68k GNU
+systems---rather than IEEE 754 double precision. @code{-ffloat-store}
+tries to remove the extra precision by spilling data from floating point
+registers into memory and this typically involves a big performance
+hit. However, it doesn't affect intermediate results, so that it is
+only partially effective. `Excess precision' is avoided in code like:
+@smallexample
+a = b + c
+d = a * e
+@end smallexample
+but not in code like:
+@smallexample
+ d = (b + c) * e
+@end smallexample
+
+@xref{Floating point precision} for another, potentially better way of
+controlling the precision.
@cindex -fforce-mem option
@cindex options, -fforce-mem
@@ -2645,6 +2685,7 @@ Might improve optimization of loops.
@item -fno-inline
@cindex in-line compilation
@cindex compilation, in-line
+@c DL: Only relevant for -O3?
Don't compile statement functions inline.
Might reduce the size of a program unit---which might be at
expense of some speed (though it should compile faster).
@@ -2663,6 +2704,7 @@ on IEEE behavior for floating-point to run faster, or die trying.
@item -fstrength-reduce
@cindex loops, speeding up
@cindex speeding up loops
+@c DL: normally defaulted?
Might make some loops run faster.
@cindex -frerun-cse-after-loop option
@@ -2670,6 +2712,7 @@ Might make some loops run faster.
@item -frerun-cse-after-loop
@cindex -fexpensive-optimizations option
@cindex options, -fexpensive-optimizations
+@c DL: This is -O2?
@item -fexpensive-optimizations
@cindex -fdelayed-branch option
@cindex options, -fdelayed-branch
@@ -2690,12 +2733,42 @@ Might improve performance on some code.
@item -funroll-loops
@cindex loops, unrolling
@cindex unrolling loops
-Definitely improves performance on some code.
+@cindex loop optimization
+@c DL: fixme: Craig doesn't like `indexed' but f95 doesn't seem to
+@c provide a suitable term
+Typically improves performance on code using indexed @code{DO} loops by
+unrolling them and is probably generally appropriate for Fortran, though
+it is not turned on at any optimization level.
+Note that outer loop unrolling isn't done specifically; decisions about
+whether to unroll a loop are made on the basis of its instruction count.
+
+@c DL: Fixme: This should obviously go somewhere else...
+Also, no `loop discovery'@footnote{@dfn{loop discovery} refers to the
+process by which a compiler, or indeed any reader of a program,
+determines which portions of the program are more likely to be executed
+repeatedly as it is being run. Such discovery typically is done early
+when compiling using optimization techniques, so the ``discovered''
+loops get more attention---and more run-time resources, such as
+registers---from the compiler. It is easy to ``discover'' loops that are
+constructed out of looping constructs in the language
+(such as Fortran's @code{DO}). For some programs, ``discovering'' loops
+constructed out of lower-level constructs (such as @code{IF} and
+@code{GOTO}) can lead to generation of more optimal code
+than otherwise.} is done, so only loops written with @code{DO}
+benefit from loop optimizations, including---but not limited
+to---unrolling. Loops written with @code{IF} and @code{GOTO} will not
+be recognized as such. This option only unrolls indexed @code{DO}
+loops, not @code{DO WHILE} loops.
@cindex -funroll-all-loops option
@cindex options, -funroll-all-loops
+@cindex @code{DO WHILE}
@item -funroll-all-loops
-Definitely improves performance on some code.
+@c DL: Check my understanding of -funroll-all-loops v. -funroll-loops is correct.
+Probably improves performance on code using @code{DO WHILE} loops by
+unrolling them in addition to indexed @code{DO} loops. In the absence
+of @code{DO WHILE}, this option is equivalent to @code{-funroll-loops}
+but possibly slower.
@item -fno-move-all-movables
@cindex -fno-move-all-movables option
@@ -2706,6 +2779,10 @@ Definitely improves performance on some code.
@item -fno-rerun-loop-opt
@cindex -fno-rerun-loop-opt option
@cindex options, -fno-rerun-loop-opt
+@emph{Version info:}
+These options are not supported by
+versions of @code{g77} based on @code{gcc} version 2.8.
+
Each of these might improve performance on some code.
Analysis of Fortran code optimization and the resulting
@@ -2770,7 +2847,7 @@ contains preprocessor directives.
These options affect how the @code{cpp} preprocessor searches
for files specified via the @code{#include} directive.
Therefore, when compiling Fortran programs, they are meaningful
-when the preproecssor is used.
+when the preprocessor is used.
@cindex INCLUDE directive
@cindex directive, INCLUDE
@@ -2873,9 +2950,9 @@ return the GNU C type @code{complex} (or its @code{struct}
equivalent).
This does not affect the generation of code that interfaces with the
-@code{libf2c} library.
+@code{libg2c} library.
-However, because the @code{libf2c} library uses @code{f2c}
+However, because the @code{libg2c} library uses @code{f2c}
calling conventions, @code{g77} rejects attempts to pass
intrinsics implemented by routines in this library as actual
arguments when @samp{-fno-f2c} is used, to avoid bugs when
@@ -2900,7 +2977,8 @@ source file used in a program, it must be used when compiling
@cindex -ff2c-library option
@cindex options, -ff2c-library
@item -ff2c-library
-Specify that use of @code{libf2c} is required.
+Specify that use of @code{libg2c} (or the original @code{libf2c})
+is required.
This is the default for the current version of @code{g77}.
Currently it is not
@@ -3152,6 +3230,10 @@ the programs you compile before assuming they are working.
@item -fargument-alias
@item -fargument-noalias
@item -fno-argument-noalias-global
+@emph{Version info:}
+These options are not supported by
+versions of @code{g77} based on @code{gcc} version 2.8.
+
These options specify to what degree aliasing
(overlap)
is permitted between
@@ -3226,7 +3308,7 @@ Some of these do @emph{not} work when compiling programs written in Fortran:
@cindex options, -freg-struct-return
@item -freg-struct-return
You should not use these except strictly the same way as you
-used them to build the version of @code{libf2c} with which
+used them to build the version of @code{libg2c} with which
you will be linking all code compiled by @code{g77} with the
same option.
@@ -3245,7 +3327,7 @@ or there will be Trouble.
@cindex -fpack-struct option
@cindex options, -fpack-struct
@item -fpack-struct
-This probably will break any calls to the @code{libf2c} library,
+This probably will break any calls to the @code{libg2c} library,
at the very least, even if it is built with the same option.
@end table
@@ -3281,11 +3363,319 @@ users use @code{g77}.
such changes to @code{g77}.
To find out about existing bugs and ongoing plans for GNU
-Fortran, retrieve @url{ftp://alpha.gnu.org/g77.plan}
+Fortran, retrieve @uref{ftp://alpha.gnu.org/g77.plan}
or, if you cannot do that, email
@email{fortran@@gnu.org} asking for a recent copy of the
GNU Fortran @file{.plan} file.
+@heading In @code{egcs} 1.1 (versus 0.5.24):
+@itemize @bullet
+@cindex alignment
+@cindex double-precision performance
+@cindex -malign-double
+@item
+Align static double-precision variables and arrays
+on Intel x86 targets
+regardless of whether @samp{-malign-double} is specified.
+
+Generally, this affects only local variables and arrays
+having the @code{SAVE} attribute
+or given initial values via @code{DATA}.
+@end itemize
+
+@heading In @code{egcs} 1.1 (versus @code{egcs} 1.0.3):
+@itemize @bullet
+@item
+Support @samp{FORMAT(I<@var{expr}>)} when @var{expr} is a
+compile-time constant @code{INTEGER} expression.
+
+@item
+Fix @code{g77} @samp{-g} option so procedures that
+use @samp{ENTRY} can be stepped through, line by line,
+in @code{gdb}.
+
+@item
+Allow any @code{REAL} argument to intrinsics
+@code{Second} and @code{CPU_Time}.
+
+@item
+Use @code{tempnam}, if available, to open scratch files
+(as in @samp{OPEN(STATUS='SCRATCH')})
+so that the @code{TMPDIR} environment variable,
+if present, is used.
+
+@item
+@code{g77}'s version of @code{libf2c} separates out
+the setting of global state
+(such as command-line arguments and signal handling)
+from @file{main.o} into distinct, new library
+archive members.
+
+This should make it easier to write portable applications
+that have their own (non-Fortran) @code{main()} routine
+properly set up the @code{libf2c} environment, even
+when @code{libf2c} (now @code{libg2c}) is a shared library.
+
+@item
+The @code{g77} command now expects the run-time library
+to be named @code{libg2c.a} instead of @code{libf2c.a},
+to ensure that a version other than the one built and
+installed as part of the same @code{g77} version is picked up.
+
+@item
+Some diagnostics have been changed from warnings to errors,
+to prevent inadvertent use of the resulting, probably buggy,
+programs.
+These mostly include diagnostics about use of unsupported features
+in the @code{OPEN}, @code{INQUIRE}, @code{READ}, and
+@code{WRITE} statements,
+and about truncations of various sorts of constants.
+@end itemize
+
+@heading In 0.5.24 and @code{egcs} 1.1 (versus 0.5.23):
+@itemize @bullet
+@item
+@code{g77} now treats @samp{%LOC(@var{expr})} and
+@samp{LOC(@var{expr})} as ``ordinary'' expressions
+when they are used as arguments in procedure calls.
+This change applies only to global (filewide) analysis,
+making it consistent with
+how @code{g77} actually generates code
+for these cases.
+
+Previously, @code{g77} treated these expressions
+as denoting special ``pointer'' arguments
+for the purposes of filewide analysis.
+
+@item
+The @code{g77} driver now ensures that @samp{-lg2c}
+is specified in the link phase prior to any
+occurrence of @samp{-lm}.
+This prevents accidentally linking to a routine
+in the SunOS4 @samp{-lm} library
+when the generated code wants to link to the one
+in @code{libf2c} (@code{libg2c}).
+
+@item
+@code{g77} emits more debugging information when
+@samp{-g} is used.
+
+This new information allows, for example,
+@kbd{which __g77_length_a} to be used in @code{gdb}
+to determine the type of the phantom length argument
+supplied with @samp{CHARACTER} variables.
+
+This information pertains to internally-generated
+type, variable, and other information,
+not to the longstanding deficiencies vis-a-vis
+@samp{COMMON} and @samp{EQUIVALENCE}.
+
+@item
+The F90 @samp{Date_and_Time} intrinsic now is
+supported.
+
+@item
+The F90 @samp{System_Clock} intrinsic allows
+the optional arguments (except for the @samp{Count}
+argument) to be omitted.
+@end itemize
+
+@heading In 0.5.23:
+@itemize @bullet
+@item
+This release contains several regressions against
+version 0.5.22 of @code{g77}, due to using the
+``vanilla'' @code{gcc} back end instead of patching
+it to fix a few bugs and improve performance in a
+few cases.
+
+@xref{Actual Bugs,,Actual Bugs We Haven't Fixed Yet},
+available in plain-text format in @code{gcc/f/BUGS},
+for information on the known bugs in this version,
+including the regressions.
+
+Features that have been dropped from this version
+of @code{g77} due to their being implemented
+via @code{g77}-specific patches to the @code{gcc}
+back end in previous releases include:
+
+@itemize --
+@item
+Support for @code{__restrict__} keyword,
+the options @samp{-fargument-alias}, @samp{-fargument-noalias},
+and @samp{-fargument-noalias-global},
+and the corresponding alias-analysis code.
+
+(@code{egcs} has the alias-analysis
+code, but not the @code{__restrict__} keyword.
+@code{egcs} @code{g77} users benefit from the alias-analysis
+code despite the lack of the @code{__restrict__} keyword,
+which is a C-language construct.)
+
+@item
+Support for the GNU compiler options
+@samp{-fmove-all-movables},
+@samp{-freduce-all-givs},
+and @samp{-frerun-loop-opt}.
+
+(@code{egcs} supports these options.
+@code{g77} users of @code{egcs} benefit from them even if
+they are not explicitly specified,
+because the defaults are optimized for @code{g77} users.)
+
+@item
+Support for the @samp{-W} option warning about
+integer division by zero.
+
+@item
+The Intel x86-specific option @samp{-malign-double}
+applying to stack-allocated data
+as well as statically-allocate data.
+@end itemize
+
+@item
+Support @code{gcc} version 2.8,
+and remove support for prior versions of @code{gcc}.
+
+@cindex -@w{}-driver option
+@cindex g77 options, -@w{}-driver
+@cindex options, -@w{}-driver
+@item
+Remove support for the @samp{--driver} option,
+as @code{g77} now does all the driving,
+just like @code{gcc}.
+
+@item
+The @code{g77} command now expects the run-time library
+to be named @code{libg2c.a} instead of @code{libf2c.a},
+to ensure that a version other than the one built and
+installed as part of the same @code{g77} version is picked up.
+
+@item
+@code{g77}'s version of @code{libf2c} separates out
+the setting of global state
+(such as command-line arguments and signal handling)
+from @file{main.o} into distinct, new library
+archive members.
+
+This should make it easier to write portable applications
+that have their own (non-Fortran) @code{main()} routine
+properly set up the @code{libf2c} environment, even
+when @code{libf2c} (now @code{libg2c}) is a shared library.
+
+@item
+Some diagnostics have been changed from warnings to errors,
+to prevent inadvertent use of the resulting, probably buggy,
+programs.
+These mostly include diagnostics about use of unsupported features
+in the @code{OPEN}, @code{INQUIRE}, @code{READ}, and
+@code{WRITE} statements,
+and about truncations of various sorts of constants.
+@end itemize
+
+@heading In 0.5.22:
+@itemize @bullet
+@item
+Fix @code{Signal} intrinsic so it offers portable
+support for 64-bit systems (such as Digital Alphas
+running GNU/Linux).
+
+@item
+Support @samp{FORMAT(I<@var{expr}>)} when @var{expr} is a
+compile-time constant @code{INTEGER} expression.
+
+@item
+Fix @code{g77} @samp{-g} option so procedures that
+use @samp{ENTRY} can be stepped through, line by line,
+in @code{gdb}.
+
+@item
+Allow any @code{REAL} argument to intrinsics
+@code{Second} and @code{CPU_Time}.
+
+@item
+Allow any numeric argument to intrinsics
+@code{Int2} and @code{Int8}.
+
+@item
+Use @code{tempnam}, if available, to open scratch files
+(as in @samp{OPEN(STATUS='SCRATCH')})
+so that the @code{TMPDIR} environment variable,
+if present, is used.
+
+@item
+Rename the @code{gcc} keyword @code{restrict} to
+@code{__restrict__}, to avoid rejecting valid, existing,
+C programs.
+Support for @code{restrict} is now more like support
+for @code{complex}.
+
+@item
+Fix @samp{-fugly-comma} to affect invocations of
+only external procedures.
+Restore rejection of gratuitous trailing omitted
+arguments to intrinsics, as in @samp{I=MAX(3,4,,)}.
+
+@item
+Fix compiler so it accepts @samp{-fgnu-intrinsics-*} and
+@samp{-fbadu77-intrinsics-*} options.
+@end itemize
+
+@heading In @code{egcs} 1.0.2 (versus @code{egcs} 1.0.1):
+@itemize @bullet
+@item
+Fix compiler so it accepts @samp{-fgnu-intrinsics-*} and
+@samp{-fbadu77-intrinsics-*} options.
+@end itemize
+
+@heading In @code{egcs} 1.0 (versus 0.5.21):
+@itemize @bullet
+@item
+Version 1.0 of @code{egcs}
+contains several regressions against
+version 0.5.21 of @code{g77},
+due to using the
+``vanilla'' @code{gcc} back end instead of patching
+it to fix a few bugs and improve performance in a
+few cases.
+
+@xref{Actual Bugs,,Actual Bugs We Haven't Fixed Yet},
+available in plain-text format in @code{gcc/f/BUGS},
+for information on the known bugs in this version,
+including the regressions.
+
+Features that have been dropped from this version
+of @code{g77} due to their being implemented
+via @code{g77}-specific patches to the @code{gcc}
+back end in previous releases include:
+
+@itemize --
+@item
+Support for the C-language @code{restrict} keyword.
+
+@item
+Support for the @samp{-W} option warning about
+integer division by zero.
+
+@item
+The Intel x86-specific option @samp{-malign-double}
+applying to stack-allocated data
+as well as statically-allocate data.
+@end itemize
+
+@cindex -@w{}-driver option
+@cindex g77 options, -@w{}-driver
+@cindex options, -@w{}-driver
+@item
+Remove support for the @samp{--driver} option,
+as @code{g77} now does all the driving,
+just like @code{gcc}.
+
+@item
+Allow any numeric argument to intrinsics
+@code{Int2} and @code{Int8}.
+@end itemize
+
@heading In 0.5.21:
@itemize @bullet
@item
@@ -3323,9 +3713,16 @@ to avoid compiler crashes resulting from coding errors
that these diagnostics normally would identify.
@item
-Fix @code{libU77} routines that accept file names
-to strip trailing spaces from them, for consistency
+Fix @code{libU77} routines that accept file and other names
+to strip trailing blanks from them, for consistency
with other implementations.
+Blanks may be forcibly appended to such names by
+appending a single null character (@samp{CHAR(0)})
+to the significant trailing blanks.
+
+@item
+Fix @code{CHMOD} intrinsic to work with file names
+that have embedded blanks, commas, and so on.
@item
Fix @code{SIGNAL} intrinsic so it accepts an
@@ -3354,8 +3751,20 @@ Add @code{INT2} and @code{INT8} intrinsics.
Add @code{CPU_TIME} intrinsic.
@item
+Add @code{ALARM} intrinsic.
+
+@item
@code{CTIME} intrinsic now accepts any @code{INTEGER}
argument, not just @code{INTEGER(KIND=2)}.
+
+@item
+@code{g77} driver now prints version information (such as produced
+by @kbd{g77 -v}) to @code{stderr} instead of @code{stdout}.
+
+@item
+The @samp{.r} suffix now designates a Ratfor source file,
+to be preprocessed via the @code{ratfor} command, available
+separately.
@end itemize
@heading In 0.5.20:
@@ -3404,7 +3813,7 @@ building it from this and future versions of @code{g77}.
@item
Dave Love's implementation of @code{libU77} has been
added to the version of @code{libf2c} distributed with
-and built by @code{g77}.
+and built as part of @code{g77}.
@code{g77} now knows about the routines in this library
as intrinsics.
@@ -3452,8 +3861,8 @@ This type is wide enough
(holds the same number of bits)
as the character-pointer type on the machine.
-On most systems, this won't make a noticable difference,
-whereas on Alphas and other systems with 64-bit pointers,
+On most machines, this won't make a difference,
+whereas, on Alphas and other systems with 64-bit pointers,
the @code{INTEGER(KIND=0)} type is equivalent to @code{INTEGER(KIND=2)}
(often referred to as @code{INTEGER*8})
instead of the more common @code{INTEGER(KIND=1)}
@@ -3529,6 +3938,15 @@ A new group of intrinsics, @samp{gnu}, has been added
to contain the new @code{REALPART}, @code{IMAGPART},
and @code{COMPLEX} intrinsics.
An old group, @samp{dcp}, has been removed.
+
+@item
+Complain about industry-wide ambiguous references
+@samp{REAL(@var{expr})} and @samp{AIMAG(@var{expr})},
+where @var{expr} is @code{DOUBLE COMPLEX} (or any
+complex type other than @code{COMPLEX}), unless
+@samp{-ff90} option specifies Fortran 90 interpretation
+or new @samp{-fugly-complex} option, in conjunction with
+@samp{-fnot-f90}, specifies @code{f2c} interpretation.
@end itemize
@heading In 0.5.19:
@@ -3729,8 +4147,10 @@ way through the compilation process instead of being lost.
GNU Fortran supports a variety of extensions to, and dialects
of, the Fortran language.
Its primary base is the ANSI FORTRAN 77 standard, currently available on
-the network at @url{http://kumo.swcp.com/fortran/F77_std/f77_std.html}
-or in @url{ftp://ftp.ast.cam.ac.uk/pub/michael/}.
+the network at
+@uref{http://www.fortran.com/fortran/F77_std/rjcnf0001.html}
+or as monolithic text at
+@uref{http://www.fortran.com/fortran/F77_std/f77_std.html}.
It offers some extensions that are popular among users
of UNIX @code{f77} and @code{f2c} compilers, some that
are popular among users of other compilers (such as Digital
@@ -3741,7 +4161,7 @@ by GNU Fortran.
@cindex textbooks
(If you need a text on Fortran,
a few freely available electronic references have pointers from
-@code{http://www.fortran.com/fortran/Books/}.)
+@uref{http://www.fortran.com/fortran/Books/}.)
Part of what defines a particular implementation of a Fortran
system, such as @code{g77}, is the particular characteristics
@@ -3775,6 +4195,8 @@ Extensions to the ANSI FORTRAN 77 standard:
* Control Statements::
* Functions and Subroutines::
* Scope and Classes of Names::
+* I/O::
+* Fortran 90 Features::
@end menu
@node Direction of Language Development
@@ -3888,7 +4310,7 @@ As such, GNU users rarely need consider just what kind of underlying
hardware (or, in many cases, operating system) they are using at any
particular time.
They can use and write software designed for a general-purpose,
-widely portable, heteregenous environment---the GNU environment.
+widely portable, heterogenous environment---the GNU environment.
In line with this philosophy, GNU Fortran must evolve into a product
that is widely ported and portable not only in the sense that it can
@@ -4231,7 +4653,7 @@ Otherwise, it is treated as an indicator of a continuation
line.
@item
-The exclamation point appears outside a character or hollerith
+The exclamation point appears outside a character or Hollerith
constant.
Otherwise, the exclamation point is considered part of the
constant.
@@ -4250,7 +4672,7 @@ is permitted under the following conditions:
@itemize @bullet
@item
-The semicolon appears outside a character or hollerith
+The semicolon appears outside a character or Hollerith
constant.
Otherwise, the semicolon is considered part of the
constant.
@@ -4309,6 +4731,7 @@ for the relevant aspects of GNU Fortran.)
* Statement Labels::
* Order::
* INCLUDE::
+* Cpp-style directives::
@end menu
@node Character Set
@@ -4321,7 +4744,7 @@ Letters include uppercase letters (the twenty-six characters
of the English alphabet) and lowercase letters (their lowercase
equivalent).
Generally, lowercase letters may be used in place of uppercase
-letters, though in character and hollerith constants, they
+letters, though in character and Hollerith constants, they
are distinct.
Special characters include:
@@ -4648,6 +5071,18 @@ An @code{INCLUDE} directive may be continued across multiple
lines as if it were a statement.
This permits long names to be used for @var{filename}.
+@node Cpp-style directives
+@subsection Cpp-style directives
+@cindex #
+@cindex preprocessor
+
+@code{cpp} output-style @code{#} directives @xref{C Preprocessor
+Output,,, cpp, The C Preprocessor}, are recognized by the compiler even
+when the preprocessor isn't run on the input (as it is when compiling
+@samp{.F} files). (Note the distinction between these @code{cpp}
+@code{#} @emph{output} directives and @code{#line} @emph{input}
+directives.)
+
@node Data Types and Constants
@section Data Types and Constants
@@ -5199,6 +5634,7 @@ is 11, and so on.)
(Corresponds to Section 4.8 of ANSI X3.9-1978 FORTRAN 77.)
+@cindex double quoted character constants
A character constant may be delimited by a pair of double quotes
(@samp{"}) instead of apostrophes.
In this case, an apostrophe within the constant represents
@@ -5282,16 +5718,17 @@ arguments (those not passed using a construct such as @code{%VAL()})
by reference or descriptor, depending on the type of
the actual argument.
Thus, given @samp{INTEGER I}, @samp{CALL FOO(I)} would
-seem to mean the same thing as @samp{CALL FOO(%LOC(I))}, and
+seem to mean the same thing as @samp{CALL FOO(%VAL(%LOC(I)))}, and
in fact might compile to identical code.
-However, @samp{CALL FOO(%LOC(I))} emphatically means ``pass the
-address of @samp{I} in memory''.
+However, @samp{CALL FOO(%VAL(%LOC(I)))} emphatically means
+``pass, by value, the address of @samp{I} in memory''.
While @samp{CALL FOO(I)} might use that same approach in a
particular version of @code{g77}, another version or compiler
might choose a different implementation, such as copy-in/copy-out,
to effect the desired behavior---and which will therefore not
-necessarily compile to the same code as would @samp{CALL FOO(%LOC(I))}
+necessarily compile to the same code as would
+@samp{CALL FOO(%VAL(%LOC(I)))}
using the same version or compiler.
@xref{Debugging and Interfacing}, for detailed information on
@@ -5321,6 +5758,27 @@ The @code{NAMELIST} statement, and related I/O constructs, are
supported by the GNU Fortran language in essentially the same
way as they are by @code{f2c}.
+This follows Fortran 90 with the restriction that on @code{NAMELIST}
+input, subscripts must have the form
+@smallexample
+@var{subscript} [ @code{:} @var{subscript} [ @code{:} @var{stride}]]
+@end smallexample
+i.e.@:
+@smallexample
+&xx x(1:3,8:10:2)=1,2,3,4,5,6/
+@end smallexample
+is allowed, but not, say,
+@smallexample
+&xx x(:3,8::2)=1,2,3,4,5,6/
+@end smallexample
+
+As an extension of the Fortran 90 form, @code{$} and @code{$END} may be
+used in place of @code{&} and @code{/} in @code{NAMELIST} input, so that
+@smallexample
+$&xx x(1:3,8:10:2)=1,2,3,4,5,6 $end
+@end smallexample
+could be used instead of the example above.
+
@node DOUBLE COMPLEX
@subsection @code{DOUBLE COMPLEX} Statement
@cindex DOUBLE COMPLEX
@@ -5347,10 +5805,13 @@ for the relevant aspects of GNU Fortran.)
@node DO WHILE
@subsection DO WHILE
@cindex DO WHILE
+@cindex DO
@cindex MIL-STD 1753
The @code{DO WHILE} statement, a feature of both the MIL-STD 1753 and
Fortran 90 standards, is provided by the GNU Fortran language.
+The Fortran 90 ``do forever'' statement comprising just @code{DO} is
+also supported.
@node END DO
@subsection END DO
@@ -5652,7 +6113,7 @@ While that is a likely implementation choice, other
implementation choices are available that preserve the
pass-by-reference semantics without passing a pointer to
the argument, @var{arg}.
-(For example, a copy-in/copy-out implementation.)@
+(For example, a copy-in/copy-out implementation.)
And, future versions of @code{g77} might change the
way descriptors are implemented, such as passing a
single argument pointing to a record containing the
@@ -6138,6 +6599,115 @@ for the relevant aspects of GNU Fortran.)
Underscores (@samp{_}) are accepted in symbol names after the first
character (which must be a letter).
+@node I/O
+@section I/O
+
+@cindex dollar sign
+A dollar sign at the end of an output format specification suppresses
+the newline at the end of the output.
+
+@cindex <> edit descriptor
+@cindex edit descriptor, <>
+Edit descriptors in @code{FORMAT} statements may contain compile-time
+@code{INTEGER} constant expressions in angle brackets, such as
+@smallexample
+10 FORMAT (I<WIDTH>)
+@end smallexample
+
+The @code{OPEN} specifier @code{NAME=} is equivalent to @code{FILE=}.
+
+These Fortran 90 features are supported:
+@itemize @bullet
+@item
+@cindex Z edit descriptor
+@cindex edit descriptor, Z
+The @code{Z} edit descriptor is supported.
+@item
+The @code{FILE=} specifier may be omitted in an @code{OPEN} statement if
+@code{STATUS='SCRATCH'} is supplied. The @code{STATUS='REPLACE'}
+specifier is supported.
+@end itemize
+
+@node Fortran 90 Features
+@section Fortran 90 Features
+@cindex Fortran 90
+
+For convenience this section collects a list (probably incomplete) of
+the Fortran 90 features supported by the GNU Fortran language, even if
+they are documented elsewhere.
+@c makeinfo 1.68 objects to the nested parens
+@ifnotinfo
+@xref{Characters Lines Sequence,,{Characters, Lines, and Execution Sequence}},
+@end ifnotinfo
+@ifinfo
+@xref{Characters Lines Sequence},
+@end ifinfo
+for information on additional fixed source form lexical issues. In
+addition, the free source form is supported through the
+@cindex @samp{-ffree-form}
+@samp{-ffree-form} option. @xref{Fortran 90} for other Fortran 90
+features be turned on by the
+@cindex @samp{-ff90}
+@samp{-ff90} option. @xref{Table of Intrinsic Functions} for
+information on the Fortran 90 intrinsics available.
+
+@table @asis
+@item Automatic arrays in procedures
+@item Character assignments
+@cindex character assignments
+In character assignments, the variable being assigned may occur on the
+right hand side of the assignment.
+@item Character strings
+@cindex double quoted character constants
+Strings may have zero length and substrings of character constants are
+permitted. Character constants may be enclosed in double quotes
+(@code{"}) as well as single quotes. @xref{Character Type}.
+@item Construct names
+(Symbolic tags on blocks.) @xref{Construct Names }.
+@item @code{CYCLE} and @code{EXIT}
+@xref{CYCLE and EXIT,,The @code{CYCLE} and @code{EXIT} Statements}.
+@item @code{DOUBLE COMPLEX}
+@xref{DOUBLE COMPLEX,,@code{DOUBLE COMPLEX} Statement
+}.
+@item @code{DO WHILE}
+@xref{DO WHILE}.
+@item @code{END} decoration
+@xref{Statements}.
+@item @code{END DO}
+@xref{END DO}.
+@item @code{KIND}
+@item @code{IMPLICIT NONE}
+@item @code{INCLUDE} statements
+@xref{INCLUDE}.
+@item List directed and namelist i/o on internal files
+@item Binary, octal and hexadecimal constants
+These are supported more generally than required by Fortran 90.
+@xref{Integer Type}.
+@item @code{NAMELIST}
+@xref{NAMELIST}.
+@item @code{OPEN} specifiers
+@code{STATUS='REPLACE'} is supported.
+@item Relational operators
+The operators @code{<}, @code{<=}, @code{==}, @code{/=}, @code{>} and
+@code{>=} may be used instead of @code{.LT.}, @code{.LE.}, @code{.EQ.},
+@code{.NE.}, @code{.GT.} and @code{.GE.} respectively.
+@item @code{SELECT CASE}
+Not fully implemented. @xref{SELECT CASE on CHARACTER Type,,
+@code{SELECT CASE} on @code{CHARACTER} Type}.
+@item Specification statements
+A limited subset of the Fortran 90 syntax and semantics for variable
+declarations is supported, including @code{KIND}. @xref{Kind Notation}.
+(@code{KIND} is of limited usefulness in the absence of the
+@code{KIND}-related intrinsics, since these intrinsics permit writing
+more widely portable code.) An example of supported @code{KIND} usage
+is:
+@smallexample
+INTEGER (KIND=1) :: FOO=1, BAR=2
+CHARACTER (LEN=3) FOO
+@end smallexample
+@code{PARAMETER} and @code{DIMENSION} attributes aren't supported.
+@end table
+
@node Other Dialects
@chapter Other Dialects
@@ -6307,6 +6877,9 @@ continuation line, imitating the behavior of @code{f2c}.
@node Trailing Comment
@section Trailing Comment
+@cindex trailing comment
+@cindex comment, trailing
+@cindex /*
@code{g77} supports use of @samp{/*} to start a trailing
comment.
In the GNU Fortran language, @samp{!} is used for this purpose.
@@ -6326,6 +6899,7 @@ error (though it would likely behave incorrectly).
@node Debug Line
@section Debug Line
@cindex debug line
+@cindex comment line, debug
Use of @samp{D} or @samp{d} as the first character (column 1) of
a source line denotes a debug line.
@@ -6438,7 +7012,7 @@ consistent with these source switches---in the sense that input will be
expected to meet the same requirements as source code in terms
of matching symbol names and keywords (for the exponent letters).
-Currently, however, @code{NAMELIST} is supported by @code{libf2c},
+Currently, however, @code{NAMELIST} is supported by @code{libg2c},
which uppercases @code{NAMELIST} input and symbol names for matching.
This means not only that @code{NAMELIST} output currently shows symbol
(and keyword) names in uppercase even if lower-case source
@@ -7391,7 +7965,7 @@ architectures.
These rules are based on the configuration that is in force for the
version of @code{gcc} built in the same release as @code{g77} (and
which was therefore used to build both the @code{g77} compiler
-components and the @code{libf2c} run-time library):
+components and the @code{libg2c} run-time library):
@table @code
@cindex REAL(KIND=1) type
@@ -7464,7 +8038,7 @@ Two @code{REAL(KIND=2)} scalars.
@cindex *@var{n} notation
@item @var{numeric-type}*@var{n}
-(Where @var{numeric-type} is any type other than @code{CHARACTER}.)@
+(Where @var{numeric-type} is any type other than @code{CHARACTER}.)
Same as whatever @code{gcc} type occupies @var{n} times the storage
space of a @code{gcc} @code{char} item.
@@ -7734,11 +8308,15 @@ argument will become two arguments on the C side: a @code{char *}
and an @code{int} length.
Much of this compatibility results from the fact that
-@code{g77} uses the same run-time library, @code{libf2c}, used by
-@code{f2c}.
+@code{g77} uses the same run-time library,
+@code{libf2c}, used by @code{f2c},
+though @code{g77} gives its version the name @code{libg2c}
+so as to avoid conflicts when linking,
+installing them in the same directories,
+and so on.
Other compilers might or might not generate code that
-is object-compatible with @code{libf2c} and current @code{g77},
+is object-compatible with @code{libg2c} and current @code{g77},
and some might offer such compatibility only when explicitly
selected via a command-line option to the compiler.
@@ -7809,13 +8387,18 @@ This should cause future versions of @code{g77} either to produce
compatible code (at the expense of the availability of some features and
performance), or at the very least, to produce diagnostics.
+(The library @code{g77} produces will no longer be named @file{libg2c}
+when it is no longer generally compatible with @file{libf2c}.
+It will likely be referred to, and, if installed as a distinct
+library, named @code{libg77}, or some other as-yet-unused name.)
+
@node Compilers Other Than f2c
@section Compilers Other Than @code{f2c}
On systems with Fortran compilers other than @code{f2c} and @code{g77},
code compiled by @code{g77} is not expected to work
well with code compiled by the native compiler.
-(This is true for @code{f2c}-compiled objects as well.)@
+(This is true for @code{f2c}-compiled objects as well.)
Libraries compiled with the native compiler probably will have
to be recompiled with @code{g77} to be used with @code{g77}-compiled code.
@@ -7872,7 +8455,7 @@ of work!}
@cindex C++, linking with
@cindex linking with C
The following discussion assumes that you are running @code{g77} in @code{f2c}
-compatibility mode, i.e.@ not using @samp{-fno-f2c}.
+compatibility mode, i.e.@: not using @samp{-fno-f2c}.
It provides some
advice about quick and simple techniques for linking Fortran and C (or
C++), the most common requirement.
@@ -7904,7 +8487,7 @@ options @code{g77} passes by running @samp{g77 -v}.
@cindex cfortran.h
@cindex Netlib
Even if you don't actually use it as a compiler, @samp{f2c} from
-@url{ftp://ftp.netlib.org/f2c/src}, can be a useful tool when you're
+@uref{ftp://ftp.netlib.org/f2c/src}, can be a useful tool when you're
interfacing (linking) Fortran and C@.
@xref{f2c Skeletons and Prototypes,,Generating Skeletons and Prototypes with @code{f2c}}.
@@ -7914,7 +8497,7 @@ build the @file{src} directory from the distribution, consult the
@code{f2c} program on your path.
Something else that might be useful is @samp{cfortran.h} from
-@url{ftp://zebra/desy.de/cfortran}.
+@uref{ftp://zebra/desy.de/cfortran}.
This is a fairly general tool which
can be used to generate interfaces for calling in both directions
between Fortran and C@.
@@ -7927,12 +8510,12 @@ It can be used in @code{f2c} mode with
@cindex types, Fortran/C
Generally, C code written to link with
@code{g77} code---calling and/or being
-called from Fortran---should @samp{#include <f2c.h>} to define the C
+called from Fortran---should @samp{#include <g2c.h>} to define the C
versions of the Fortran types.
Don't assume Fortran @code{INTEGER} types
correspond to C @samp{int}s, for instance; instead, declare them as
-@code{integer}, a type defined by @file{f2c.h}.
-@file{f2c.h} is installed where @code{gcc} will find it by
+@code{integer}, a type defined by @file{g2c.h}.
+@file{g2c.h} is installed where @code{gcc} will find it by
default, assuming you use a copy of @code{gcc} compatible with
@code{g77}, probably built at the same time as @code{g77}.
@@ -7941,7 +8524,7 @@ default, assuming you use a copy of @code{gcc} compatible with
@pindex f2c
@cindex -fno-second-underscore
-A simple and foolproof way to write @code{g77}-callable C routines---e.g.@ to
+A simple and foolproof way to write @code{g77}-callable C routines---e.g.@: to
interface with an existing library---is to write a file (named, for
example, @file{fred.f}) of dummy Fortran
skeletons comprising just the declaration of the routine(s) and dummy
@@ -7950,16 +8533,17 @@ Then run @code{f2c} on file @file{fred.f} to produce @file{fred.c}
into which you can edit
useful code, confident the calling sequence is correct, at least.
(There are some errors otherwise commonly made in generating C
-interfaces with f2c conventions, such as not using @code{doublereal} as
-the return type of a @code{REAL} @code{FUNCTION}.)
+interfaces with @code{f2c} conventions,
+such as not using @code{doublereal}
+as the return type of a @code{REAL} @code{FUNCTION}.)
@pindex ftnchek
@code{f2c} also can help with calling Fortran from C, using its
@samp{-P} option to generate C prototypes appropriate for calling the
Fortran.@footnote{The files generated like this can also be used for
inter-unit consistency checking of dummy and actual arguments, although
-the @samp{ftnchek} tool from @url{ftp://ftp.netlib.org/fortran}
-or @url{ftp://ftp.dsm.fordham.edu} is
+the @samp{ftnchek} tool from @uref{ftp://ftp.netlib.org/fortran}
+or @uref{ftp://ftp.dsm.fordham.edu} is
probably better for this purpose.}
If the Fortran code containing any
routines to be called from C is in file @file{joe.f}, use the command
@@ -7968,7 +8552,7 @@ prototype information.
@code{#include} this in the C which has to call
the Fortran routines to make sure you get it right.
-@xref{Arrays,,Arrays (DIMENSION}, for information on the differences
+@xref{Arrays,,Arrays (DIMENSION)}, for information on the differences
between the way Fortran (including compilers like @code{g77}) and
C handle arrays.
@@ -7992,23 +8576,148 @@ avoid clashes with C++ reserved words in addition to those in C@.
@cindex startup code
@cindex runtime initialization
@cindex initialization, runtime
-Unlike with some runtime systems, it shouldn't be necessary (unless there are
-bugs) to use a Fortran main program to ensure the
-runtime---specifically the i/o system---is initialized.
-However, to use
-the @code{g77} intrinsics @code{GETARG()} and @code{IARGC()} the
-@code{main()} routine from the @file{libf2c} library must be used, either
-explicitly or implicitly by using a Fortran main program.
-This
-@code{main()} program calls @code{MAIN__()} (where the names are C-type
-@code{extern} names, i.e.@ not mangled).
-You need to provide this
-nullary procedure as the entry point for your C code if using
-@file{libf2c}'s @code{main}.
-In some cases it might be necessary to
-provide a dummy version of this to avoid linkers complaining about
-failure to resolve @code{MAIN__()} if linking against @file{libf2c} and
-not using @code{main()} from it.
+Unlike with some runtime systems,
+it shouldn't be necessary
+(unless there are bugs)
+to use a Fortran main program unit to ensure the
+runtime---specifically the I/O system---is initialized.
+
+However, to use the @code{g77} intrinsics @code{GETARG} and @code{IARGC},
+either the @code{main} routine from the @file{libg2c} library must be used,
+or the @code{f_setarg} routine
+(new as of @code{egcs} version 1.1 and @code{g77} version 0.5.23)
+must be called with the appropriate @code{argc} and @code{argv} arguments
+prior to the program calling @code{GETARG} or @code{IARGC}.
+
+To provide more flexibility for mixed-language programming
+involving @code{g77} while allowing for shared libraries,
+as of @code{egcs} version 1.1 and @code{g77} version 0.5.23,
+@code{g77}'s @code{main} routine in @code{libg2c}
+does the following, in order:
+
+@enumerate
+@item
+Calls @code{f_setarg}
+with the incoming @code{argc} and @code{argv} arguments,
+in the same order as for @code{main} itself.
+
+This sets up the command-line environment
+for @code{GETARG} and @code{IARGC}.
+
+@item
+Calls @code{f_setsig} (with no arguments).
+
+This sets up the signaling and exception environment.
+
+@item
+Calls @code{f_init} (with no arguments).
+
+This initializes the I/O environment,
+though that should not be necessary,
+as all I/O functions in @code{libf2c}
+are believed to call @code{f_init} automatically,
+if necessary.
+
+(A future version of @code{g77} might skip this explicit step,
+to speed up normal exit of a program.)
+
+@item
+Arranges for @code{f_exit} to be called (with no arguments)
+when the program exits.
+
+This ensures that the I/O environment is properly shut down
+before the program exits normally.
+Otherwise, output buffers might not be fully flushed,
+scratch files might not be deleted, and so on.
+
+The simple way @code{main} does this is
+to call @code{f_exit} itself after calling
+@code{MAIN__} (in the next step).
+
+However, this does not catch the cases where the program
+might call @code{exit} directly,
+instead of using the @code{EXIT} intrinsic
+(implemented as @code{exit_} in @code{libf2c}).
+
+So, @code{main} attempts to use
+the operating environment's @code{onexit} or @code{atexit}
+facility, if available,
+to cause @code{f_exit} to be called automatically
+upon any invocation of @code{exit}.
+
+@item
+Calls @code{MAIN__} (with no arguments).
+
+This starts executing the Fortran main program unit for
+the application.
+(Both @code{g77} and @code{f2c} currently compile a main
+program unit so that its global name is @code{MAIN__}.)
+
+@item
+If no @code{onexit} or @code{atexit} is provided by the system,
+calls @code{f_exit}.
+
+@item
+Calls @code{exit} with a zero argument,
+to signal a successful program termination.
+
+@item
+Returns a zero value to the caller,
+to signal a successful program termination,
+in case @code{exit} doesn't exit on the system.
+@end enumerate
+
+All of the above names are C @code{extern} names,
+i.e.@: not mangled.
+
+When using the @code{main} procedure provided by @code{g77}
+without a Fortran main program unit,
+you need to provide @code{MAIN__}
+as the entry point for your C code.
+(Make sure you link the object file that defines that
+entry point with the rest of your program.)
+
+To provide your own @code{main} procedure
+in place of @code{g77}'s,
+make sure you specify the object file defining that procedure
+@emph{before} @samp{-lg2c} on the @code{g77} command line.
+Since the @samp{-lg2c} option is implicitly provided,
+this is usually straightforward.
+(Use the @samp{--verbose} option to see how and where
+@code{g77} implicitly adds @samp{-lg2c} in a command line
+that will link the program.
+Feel free to specify @samp{-lg2c} explicitly,
+as appropriate.)
+
+However, when providing your own @code{main},
+make sure you perform the appropriate tasks in the
+appropriate order.
+For example, if your @code{main} does not call @code{f_setarg},
+make sure the rest of your application does not call
+@code{GETARG} or @code{IARGC}.
+
+And, if your @code{main} fails to ensure that @code{f_exit}
+is called upon program exit,
+some files might end up incompletely written,
+some scratch files might be left lying around,
+and some existing files being written might be left
+with old data not properly truncated at the end.
+
+Note that, generally, the @code{g77} operating environment
+does not depend on a procedure named @code{MAIN__} actually
+being called prior to any other @code{g77}-compiled code.
+That is, @code{MAIN__} does not, itself,
+set up any important operating-environment characteristics
+upon which other code might depend.
+This might change in future versions of @code{g77},
+with appropriate notification in the release notes.
+
+For more information, consult the source code for the above routines.
+These are in @file{@value{path-libf2c}/libF77/}, named @file{main.c},
+@file{setarg.c}, @file{setsig.c}, @file{getarg_.c}, and @file{iargc_.c}.
+
+Also, the file @file{@value{path-g77}/com.c} contains the code @code{g77}
+uses to open-code (inline) references to @code{IARGC}.
@include g77install.texi
@@ -8080,24 +8789,24 @@ described in this section.
When @code{g77} compiles a main program unit, it gives it the public
procedure name @samp{MAIN__}.
-The @code{libf2c} library has the actual @code{main()} procedure
+The @code{libg2c} library has the actual @code{main()} procedure
as is typical of C-based environments, and
it is this procedure that performs some initial start-up
activity and then calls @samp{MAIN__}.
-Generally, @code{g77} and @code{libf2c} are designed so that you need not
+Generally, @code{g77} and @code{libg2c} are designed so that you need not
include a main program unit written in Fortran in your program---it
can be written in C or some other language.
Especially for I/O handling, this is the case, although @code{g77} version 0.5.16
-includes a bug fix for @code{libf2c} that solved a problem with using the
+includes a bug fix for @code{libg2c} that solved a problem with using the
@code{OPEN} statement as the first Fortran I/O activity in a program
without a Fortran main program unit.
However, if you don't intend to use @code{g77} (or @code{f2c}) to compile
your main program unit---that is, if you intend to compile a @code{main()}
procedure using some other language---you should carefully
-examine the code for @code{main()} in @code{libf2c}, found in the source
-file @file{gcc/f/runtime/libF77/main.c}, to see what kinds of things
+examine the code for @code{main()} in @code{libg2c}, found in the source
+file @file{@value{path-libf2c}/libF77/main.c}, to see what kinds of things
might need to be done by your @code{main()} in order to provide the
Fortran environment your Fortran code is expecting.
@@ -8105,9 +8814,9 @@ Fortran environment your Fortran code is expecting.
@cindex intrinsics, IARGC()
@cindex GETARG() intrinsic
@cindex intrinsics, GETARG()
-For example, @code{libf2c}'s @code{main()} sets up the information used by
+For example, @code{libg2c}'s @code{main()} sets up the information used by
the @code{IARGC} and @code{GETARG} intrinsics.
-Bypassing @code{libf2c}'s @code{main()}
+Bypassing @code{libg2c}'s @code{main()}
without providing a substitute for this activity would mean
that invoking @code{IARGC} and @code{GETARG} would produce undefined
results.
@@ -8119,7 +8828,7 @@ results.
@cindex .gdbinit
When debugging, one implication of the fact that @code{main()}, which
is the place where the debugged program ``starts'' from the
-debugger's point of view, is in @code{libf2c} is that you won't be
+debugger's point of view, is in @code{libg2c} is that you won't be
starting your Fortran program at a point you recognize as your
Fortran code.
@@ -8172,7 +8881,7 @@ The second argument is appended to the end of the user-specified
calling sequence and is named @samp{__g77_length_@var{x}}, where @var{x}
is the user-specified name.
This argument is of the C type @code{ftnlen}
-(see @file{gcc/f/runtime/f2c.h.in} for information on that type) and
+(see @file{@value{path-libf2c}/g2c.h.in} for information on that type) and
is the number of characters the caller has allocated in the
array pointed to by the first argument.
@@ -8284,7 +8993,8 @@ as how casing is handled.
External names---names of entities that are public, or ``accessible'',
to all modules in a program---normally have an underscore (@samp{_})
-appended by @code{g77}, to generate code that is compatible with f2c.
+appended by @code{g77},
+to generate code that is compatible with @code{f2c}.
External names include names of Fortran things like common blocks,
external procedures (subroutines and functions, but not including
statement functions, which are internal procedures), and entry point
@@ -8304,7 +9014,7 @@ When @samp{-funderscoring} is in force, any name (external or local)
that already has at least one underscore in it is
implemented by @code{g77} by appending two underscores.
(This second underscore can be disabled via the
-@samp{-fno-second-underscore} option.)@
+@samp{-fno-second-underscore} option.)
External names are changed this way for @code{f2c} compatibility.
Local names are changed this way to avoid collisions with external names
that are different in the source code---@code{f2c} does the same thing, but
@@ -8377,8 +9087,9 @@ could be used to inhibit the appending of the underscore to the name.
@cindex COMMON statement
@cindex statements, COMMON
-@code{g77} names and lays out @code{COMMON} areas the same way f2c does,
-for compatibility with f2c.
+@code{g77} names and lays out @code{COMMON} areas
+the same way @code{f2c} does,
+for compatibility with @code{f2c}.
Currently, @code{g77} does not emit ``true'' debugging information for
members of a @code{COMMON} area, due to an apparent bug in the GBE.
@@ -8929,7 +9640,7 @@ assigned-label uses of a variable.
@cindex messages, run-time
@cindex I/O, errors
-The @code{libf2c} library currently has the following table to relate
+The @code{libg2c} library currently has the following table to relate
error code numbers, returned in @code{IOSTAT=} variables, to messages.
This information should, in future versions of this document, be
expanded upon to include detailed descriptions of each message.
@@ -9202,6 +9913,9 @@ savings of resources, such as on systems where @file{/dev/null} or
@file{/dev/zero} represent bottlenecks in the systems' performance,
because @code{g77} simply asks for fewer zeros from the operating
system than @code{f2c}.
+(Avoiding spurious use of zero bytes, each byte typically have
+eight zero bits, also reduces the liabilities in case
+Microsoft's rumored patent on the digits 0 and 1 is upheld.)
@node Block Data and Libraries
@section Block Data and Libraries
@@ -9233,12 +9947,12 @@ The implementation @code{g77} currently uses to make this work is
one of the few things not compatible with @code{f2c} as currently
shipped.
@code{f2c} currently does nothing with @samp{EXTERNAL FOO} except
-issue a warning that @samp{FOO} is not otherwise referenced, and for
-@samp{BLOCK DATA FOO}, f2c doesn't generate a dummy procedure with the
-name @samp{FOO}.
+issue a warning that @samp{FOO} is not otherwise referenced,
+and, for @samp{BLOCK DATA FOO},
+@code{f2c} doesn't generate a dummy procedure with the name @samp{FOO}.
The upshot is that you shouldn't mix @code{f2c} and @code{g77} in
this particular case.
-If you use f2c to compile @samp{BLOCK DATA FOO},
+If you use @code{f2c} to compile @samp{BLOCK DATA FOO},
then any @code{g77}-compiled program unit that says @samp{EXTERNAL FOO}
will result in an unresolved reference when linked.
If you do the
@@ -9310,7 +10024,7 @@ The meaning of a @code{DO} loop in Fortran is precisely specified
in the Fortran standard@dots{}and is quite different from what
many programmers might expect.
-In particular, Fortran @code{DO} loops are implemented as if
+In particular, Fortran indexed @code{DO} loops are implemented as if
the number of trips through the loop is calculated @emph{before}
the loop is entered.
@@ -9494,6 +10208,8 @@ tracking down bugs in such programs.
* Aliasing Assumed To Work::
* Output Assumed To Flush::
* Large File Unit Numbers::
+* Floating point precision::
+* Inconsistent Calling Sequences::
@end menu
@node Not My Type
@@ -9644,7 +10360,7 @@ of floating-point constants under certain circumstances.
@node Surprising Interpretations of Code
@subsection Surprising Interpretations of Code
-The @samp{-Wsuprising} option can help find bugs involving
+The @samp{-Wsurprising} option can help find bugs involving
expression evaluation or in
the way @code{DO} loops with non-integral iteration variables
are handled.
@@ -9683,13 +10399,24 @@ The @samp{-falias-check}, @samp{-fargument-alias},
and @samp{-fno-argument-noalias-global} options,
introduced in version 0.5.20 and
@code{g77}'s version 2.7.2.2.f.2 of @code{gcc},
-control the assumptions regarding aliasing
-(overlapping)
-of writes and reads to main memory (core) made
-by the @code{gcc} back end.
+were withdrawn as of @code{g77} version 0.5.23
+due to their not being supported by @code{gcc} version 2.8.
+
+These options, which control the assumptions regarding aliasing
+(overlapping) of writes and reads to main memory (core) made
+by the @code{gcc} back end,
+might well be added back (in some form) in a future version
+of @code{gcc}.
+
+However, these options @emph{are} supported by @code{egcs}.
-They are effective only when compiling with @samp{-O} (specifying
-any level other than @samp{-O0}) or with @samp{-falias-check}.
+The information below still is useful, but applies to
+only those versions of @code{g77} that support the
+alias analysis implied by support for these options.
+
+These options are effective only when compiling with @samp{-O}
+(specifying any level other than @samp{-O0})
+or with @samp{-falias-check}.
The default for Fortran code is @samp{-fargument-noalias-global}.
(The default for C code and code written in other C-based languages
@@ -9813,8 +10540,7 @@ Static analysis is certainly imperfect, as is run-time analysis,
since neither can catch all violations.
(Static analysis can catch all likely violations, and some that
might never actually happen, while run-time analysis can catch
-only those violations that actually happen during a particular
-run.
+only those violations that actually happen during a particular run.
Neither approach can cope with programs mixing Fortran code with
routines written in other languages, however.)
@@ -9849,20 +10575,21 @@ relevant @code{ERR=} and @code{IOSTAT=} mechanism.
Because of the adverse effects this approach had on the performance
of many programs, @code{g77} no longer configures @code{libf2c}
+(now named @code{libg2c} in its @code{g77} incarnation)
to always flush output.
If your program depends on this behavior, either insert the
appropriate @samp{CALL FLUSH} statements, or modify the sources
-to the @code{libf2c}, rebuild and reinstall @code{g77}, and
+to the @code{libg2c}, rebuild and reinstall @code{g77}, and
relink your programs with the modified library.
-(Ideally, @code{libf2c} would offer the choice at run-time, so
+(Ideally, @code{libg2c} would offer the choice at run-time, so
that a compile-time option to @code{g77} or @code{f2c} could
result in generating the appropriate calls to flushing or
non-flushing library routines.)
@xref{Always Flush Output}, for information on how to modify
-the @code{g77} source tree so that a version of @code{libf2c}
+the @code{g77} source tree so that a version of @code{libg2c}
can be built and installed with the @samp{ALWAYS_FLUSH} macro defined.
@node Large File Unit Numbers
@@ -9875,25 +10602,24 @@ can be built and installed with the @samp{ALWAYS_FLUSH} macro defined.
If your program crashes at run time with a message including
the text @samp{illegal unit number}, that probably is
-a message from the run-time library, @code{libf2c}, used, and
-distributed with, @code{g77}.
+a message from the run-time library, @code{libg2c}.
The message means that your program has attempted to use a
file unit number that is out of the range accepted by
-@code{libf2c}.
+@code{libg2c}.
Normally, this range is 0 through 99, and the high end
-of the range is controlled by a @code{libf2c} source-file
+of the range is controlled by a @code{libg2c} source-file
macro named @samp{MXUNIT}.
If you can easily change your program to use unit numbers
in the range 0 through 99, you should do so.
Otherwise, see @ref{Larger File Unit Numbers}, for information on how
-to change @samp{MXUNIT} in @code{libf2c} so you can build and
-install a new version of @code{libf2c} that supports the larger
+to change @samp{MXUNIT} in @code{libg2c} so you can build and
+install a new version of @code{libg2c} that supports the larger
unit numbers you need.
-@emph{Note:} While @code{libf2c} places a limit on the range
+@emph{Note:} While @code{libg2c} places a limit on the range
of Fortran file-unit numbers, the underlying library and operating
system might impose different kinds of limits.
For example, some systems limit the number of files simultaneously
@@ -9901,6 +10627,62 @@ open by a running program.
Information on how to increase these limits should be found
in your system's documentation.
+@node Floating point precision
+@subsection Floating point precision
+
+@cindex IEEE 754
+@cindex IEEE conformance
+@cindex conformance, IEEE
+@cindex floating point precision
+If your program depends on exact IEEE 754 floating point handling it may
+help on some systems---specifically x86 or m68k hardware---to use
+the @code{-ffloat-store} option or to reset the precision flag on the
+floating point unit @xref{Optimize Options}.
+
+However, it might be better simply to put the FPU into double precision
+mode and not take the performance hit of @code{-ffloat-store}. On x86
+and m68k GNU systems you can do this with a technique similar to that
+for turning on floating point exceptions @xref{Floating-point Exception
+Handling}. The control word could be set to double precision by
+replacing the @code{__setfpucw} call with one like this:
+@smallexample
+ __setfpucw ((_FPU_DEFAULT & ~_FPU_EXTENDED) | _FPU_DOUBLE);
+@end smallexample
+(It is not clear whether this has any effect on the operation of the GNU
+maths library, but we have no evidence of it causing trouble.)
+
+Some targets (such as the Alpha) may need special options for full IEEE
+conformance @xref{Submodel Options,,Hardware Models and
+Configurations,gcc,Using and Porting GNU CC}.
+
+@node Inconsistent Calling Sequences
+@subsection Inconsistent Calling Sequences
+
+@pindex ftnchek
+@cindex floating point errors
+@cindex x86 FPU stack
+Code containing inconsistent calling sequences in the same file is
+normally rejected @xref{GLOBALS}. (Use, say, @code{ftnchek} to ensure
+consistency across source files
+@c makeinfo 1.68 objects to the nested parens
+@ifinfo
+@xref{f2c Skeletons and Prototypes}.)
+@end ifinfo
+@ifnotinfo
+@xref{f2c Skeletons and Prototypes,,
+{Generating Skeletons and Prototypes with @code{f2c}}}.)
+@end ifnotinfo
+
+Mysterious errors, which may appear to be code generation problems, can
+appear specifically on the x86 architecture with some such
+inconsistencies. On x86 hardware, floating point return values of
+functions are placed on the floating point unit's register stack, not
+the normal stack. Thus calling a @code{REAL} or @code{DOUBLE PRECISION}
+@code{FUNCTION} as some other sort of procedure, or vice versa,
+scrambles the floating point stack. This may break unrelated code
+executed later. Similarly if, say, external C routines are written
+incorrectly.
+
@node Overly Convenient Options
@section Overly Convenient Command-line Options
@cindex overly convenient options
@@ -10094,6 +10876,32 @@ generally relevant to Fortran,
but using it will force @code{COMMON} to be padded if necessary to align
@code{DOUBLE PRECISION} data.
+When @code{DOUBLE PRECISION} data is forcibly aligned
+in @code{COMMON} by @code{g77} due to specifying @samp{-malign-double},
+@code{g77} issues a warning about the need to
+insert padding.
+
+In this case, each and every program unit that uses
+the same @code{COMMON} area
+must specify the same layout of variables and their types
+for that area
+and be compiled with @samp{-malign-double} as well.
+@code{g77} will issue warnings in each case,
+but as long as every program unit using that area
+is compiled with the same warnings,
+the resulting object files should work when linked together
+unless the program makes additional assumptions about
+@code{COMMON} area layouts that are outside the scope
+of the FORTRAN 77 standard,
+or uses @code{EQUIVALENCE} or different layouts
+in ways that assume no padding is ever inserted by the compiler.
+
+@emph{Note:} @samp{-malign-double} applies only to
+statically-allocated data.
+Double-precision data on the stack can still
+cause problems due to misalignment.
+@xref{Aligned Data}.
+
@item
Ensure that @file{crt0.o} or @file{crt1.o}
on your system guarantees a 64-bit
@@ -10201,7 +11009,7 @@ or installing @code{g77} is not provided here.
To find out about major bugs discovered in the current release and
possible workarounds for them, retrieve
-@url{ftp://alpha.gnu.org/g77.plan}.
+@uref{ftp://alpha.gnu.org/g77.plan}.
(Note that some of this portion of the manual is lifted
directly from the @code{gcc} manual, with minor modifications
@@ -10307,7 +11115,7 @@ How to cope with such problems is well beyond the scope
of this manual.
However, users of Linux-based systems (such as GNU/Linux)
-should review @code{http://www.bitwizard.nl/sig11}, a source
+should review @uref{http://www.bitwizard.nl/sig11}, a source
of detailed information on diagnosing hardware problems,
by recognizing their common symptoms.
@@ -10330,12 +11138,12 @@ programs (which should be done using @code{g77}).
If this happens to you, try appending @samp{-lc} to the command you
use to link the program, e.g. @samp{g77 foo.f -lc}.
-@code{g77} already specifies @samp{-lf2c -lm} when it calls the linker,
+@code{g77} already specifies @samp{-lg2c -lm} when it calls the linker,
but it cannot also specify @samp{-lc} because not all systems have a
file named @file{libc.a}.
It is unclear at this point whether there are legitimately installed
-systems where @samp{-lf2c -lm} is insufficient to resolve code produced
+systems where @samp{-lg2c -lm} is insufficient to resolve code produced
by @code{g77}.
@cindex undefined reference (_main)
@@ -10346,7 +11154,7 @@ by @code{g77}.
If your program doesn't link due to unresolved references to names
like @samp{_main}, make sure you're using the @code{g77} command to do the
link, since this command ensures that the necessary libraries are
-loaded by specifying @samp{-lf2c -lm} when it invokes the @code{gcc}
+loaded by specifying @samp{-lg2c -lm} when it invokes the @code{gcc}
command to do the actual link.
(Use the @samp{-v} option to discover
more about what actually happens when you use the @code{g77} and @code{gcc}
@@ -10378,8 +11186,12 @@ compiled by @code{g77}.
Inadequate investigation as of the release of 0.5.16 results in not
knowing which products are the culprit, but @file{gdb-4.14} definitely
crashes when, for example, an attempt is made to print the contents
-of a @code{COMPLEX(KIND=2)} dummy array, on at least some GNU/Linux machines, plus
-some others.
+of a @code{COMPLEX(KIND=2)} dummy array, on at least some GNU/Linux
+machines, plus some others.
+Attempts to access assumed-size arrays are
+also known to crash recent versions of @code{gdb}.
+(@code{gdb}'s Fortran support was done for a different compiler
+and isn't properly compatible with @code{g77}.)
@node NeXTStep Problems
@subsection NeXTStep Problems
@@ -10425,7 +11237,7 @@ ebadexec: file: a.out appears to be executable
%
@end smallexample
-Browsing through @file{gcc/f/Makefile.in},
+Browsing through @file{@value{path-g77}/Makefile.in},
you will find that the @code{f771} program itself also has to be
linked with these flags---it has large statically allocated
data structures.
@@ -10626,7 +11438,7 @@ power of two (in Fortran, by @samp{2**N}) that typically is between
is negative.
So, a value like 0.2 is exactly represented in decimal---since
-it is a fraction, @samp{2/10}, with a denomenator that is compatible
+it is a fraction, @samp{2/10}, with a denominator that is compatible
with the base of the number system (base 10).
However, @samp{2/10} cannot be represented by any finite number
of sums of any of 1.0, 0.5, 0.25, and so on, so 0.2 cannot
@@ -10660,7 +11472,7 @@ When compiled by @code{g77}, the above program might output
executable that outputs @samp{0.2}.
This particular difference is due to the fact that, currently,
-conversion of floating-point values by the @code{libf2c} library,
+conversion of floating-point values by the @code{libg2c} library,
used by @code{g77}, handles only double-precision values.
Since @samp{0.2} in the program is a single-precision value, it
@@ -10702,12 +11514,31 @@ PRINT *, 0.2D0
END
@end smallexample
-Future versions of @code{g77} and/or @code{libf2c} might convert
+Future versions of @code{g77} and/or @code{libg2c} might convert
single-precision values directly to decimal,
instead of converting them to double precision first.
This would tend to result in output that is more consistent
with that produced by some other Fortran implementations.
+A useful source of information on floating point computation is David
+Goldberg, `What Every Computer Scientist Should Know About
+Floating-Point Arithmetic', Computing Surveys, 23, March 1991, pp.@:
+5--48. At the time of writing this is available online under
+@uref{http://docs.sun.com} and there is a supplemented version at
+@uref{http://www.validgh.com/}. Information related to the IEEE 754
+floating point standard by a leading light can be found at
+@uref{http://http.cs.berkeley.edu/%7Ewkahan/ieee754status }; see also
+slides from the short course referenced from
+@uref{http://http.cs.berkeley.edu/%7Efateman/}.
+@uref{http://www.suburbia.net/%7Ebillm/floating-point/} has a brief
+guide to IEEE 754, a somewhat x86 GNU/Linux-specific FAQ and library
+code for GNU/Linux x86 systems.
+@c xref would be different between editions:
+The GNU C library provides routines for controlling the FPU, and other
+documentation about this.
+
+@xref{Floating point precision}, regarding IEEE 754 conformance.
+
@include bugs.texi
@node Missing Features
@@ -10769,6 +11600,7 @@ Better diagnostics:
Run-time facilities:
* Uninitialized Variables at Run Time::
* Bounds Checking at Run Time::
+* Portable Unformatted Files::
Debugging:
* Labels Visible to Debugger::
@@ -11064,7 +11896,7 @@ specifiers.
@code{g77} doesn't support @samp{FORMAT(I<J>)} and the like.
Supporting this requires a significant redesign or replacement
-of @code{libf2c}.
+of @code{libg2c}.
However, @code{g77} does support
this construct when the expression is constant
@@ -11110,11 +11942,12 @@ code to specify explicit assembler code.
@subsection Q Edit Descriptor
@cindex FORMAT statement
@cindex Q edit descriptor
+@cindex edit descriptor, Q
The @code{Q} edit descriptor in @code{FORMAT}s isn't supported.
(This is meant to get the number of characters remaining in an input record.)
Supporting this requires a significant redesign or replacement
-of @code{libf2c}.
+of @code{libg2c}.
A workaround might be using internal I/O or the stream-based intrinsics.
@xref{FGetC Intrinsic (subroutine)}.
@@ -11170,7 +12003,7 @@ replaced by @samp{READ fmt,list}.
This set of extensions is quite a bit
lower on the list of large, important things to add to @code{g77}, partly
because it requires a great deal of work either upgrading or
-replacing @code{libf2c}.
+replacing @code{libg2c}.
@node OPEN CLOSE and INQUIRE Keywords
@subsection @code{OPEN}, @code{CLOSE}, and @code{INQUIRE} Keywords
@@ -11185,7 +12018,26 @@ replacing @code{libf2c}.
@code{g77} doesn't have support for keywords such as @code{DISP='DELETE'} in
the @code{OPEN}, @code{CLOSE}, and @code{INQUIRE} statements.
These extensions are easy to add to @code{g77} itself, but
-require much more work on @code{libf2c}.
+require much more work on @code{libg2c}.
+
+@cindex FORM='PRINT'
+@cindex ANS carriage control
+@cindex carraige control
+@pindex asa
+@pindex fpr
+@code{g77} doesn't support @code{FORM='PRINT'} or an equivalent to
+translate the traditional `carraige control' characters in column 1 of
+output to use backspaces, carriage returns and the like. However
+programs exist to translate them in output files (or standard output).
+These are typically called either @code{fpr} or @code{asa}. You can get
+a version of @code{asa} from
+@uref{ftp://sunsite.unc.edu/pub/Linux/devel/lang/fortran} for GNU
+systems which will probably build easily on other systems.
+Alternatively, @code{fpr} is in BSD distributions in various archive
+sites.
+
+I think both programs can either be used in a pipeline.
+
@node ENCODE and DECODE
@subsection @code{ENCODE} and @code{DECODE}
@@ -11322,11 +12174,13 @@ END
@cindex NaN values
The @code{gcc} backend and, consequently, @code{g77}, currently provides no
-control over whether or not floating-point exceptions are trapped or
+general control over whether or not floating-point exceptions are trapped or
ignored.
(Ignoring them typically results in NaN values being
-propagated in systems that conform to IEEE 754.)@
-The behaviour is inherited from the system-dependent startup code.
+propagated in systems that conform to IEEE 754.)
+The behaviour is normally inherited from the system-dependent startup
+code, though some targets, such as the Alpha, have code generation
+options which change the behaviour.
Most systems provide some C-callable mechanism to change this; this can
be invoked at startup using @code{gcc}'s @code{constructor} attribute.
@@ -11336,13 +12190,21 @@ on an x86-based GNU system:
@smallexample
#include <fpu_control.h>
-void __attribute__ ((constructor))
-trapfpe () @{
- (void) __setfpucw (_FPU_DEFAULT &
- ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM));
+static void __attribute__ ((constructor))
+trapfpe ()
+@{
+ __setfpucw (_FPU_DEFAULT &
+ ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM));
@}
@end smallexample
+A convenient trick is to compile this something like:
+@smallexample
+gcc -o libtrapfpe.a trapfpe.c
+@end smallexample
+and then use it by adding @code{-trapfpe} to the @code{g77} command line
+when linking.
+
@node Nonportable Conversions
@subsection Nonportable Conversions
@cindex nonportable conversions
@@ -11373,7 +12235,7 @@ allocation of automatic arrays in heap storage.
@cindex threads
@cindex parallel processing
-Neither the code produced by @code{g77} nor the @code{libf2c} library
+Neither the code produced by @code{g77} nor the @code{libg2c} library
are thread-safe, nor does @code{g77} have support for parallel processing
(other than the instruction-level parallelism available on some
processors).
@@ -11556,6 +12418,76 @@ in a fashion similar to @code{f2c}.
Note that @code{g77} already warns about references to out-of-bounds
elements of arrays when it detects these at compile time.
+@node Portable Unformatted Files
+@subsection Portable Unformatted Files
+
+@cindex unformatted files
+@cindex file formats
+@cindex binary data
+@cindex byte ordering
+@code{g77} has no facility for exchanging unformatted files with systems
+using different number formats---even differing only in endianness (byte
+order)---or written by other compilers. Some compilers provide
+facilities at least for doing byte-swapping during unformatted I/O.
+
+It is unrealistic to expect to cope with exchanging unformatted files
+with arbitrary other compiler runtimes, but the @code{g77} runtime
+should at least be able to read files written by @code{g77} on systems
+with different number formats, particularly if they differ only in byte
+order.
+
+In case you do need to write a program to translate to or from
+@code{g77} (@code{libf2c}) unformatted files, they are written as
+follows:
+@table @asis
+@item Sequential
+Unformatted sequential records consist of
+@enumerate
+@item
+A number giving the length of the record contents;
+@item
+the length of record contents again (for backspace).
+@end enumerate
+The record length is of C type
+@code{long}; this means that it is 8 bytes on 64-bit systems such as
+Alpha GNU/Linux and 4 bytes on other systems, such as x86 GNU/Linux.
+Consequently such files cannot be exchanged between 64-bit and 32-bit
+systems, even with the same basic number format.
+@item Direct access
+Unformatted direct access files form a byte stream of length
+@var{records}*@var{recl} bytes, where @var{records} is the maximum
+record number (@code{REC=@var{records}}) written and @var{recl} is the
+record length in bytes specified in the @code{OPEN} statement
+(@code{RECL=@var{recl}}). Data appear in the records as determined by
+the relevant @code{WRITE} statement. Dummy records with arbitrary
+contents appear in the file in place of records which haven't been
+written.
+@end table
+
+Thus for exchanging a sequential or direct access unformatted file
+between big- and little-endian 32-bit systems using IEEE 754 floating
+point it would be sufficient to reverse the bytes in consecutive words
+in the file @emph{iff} only @code{REAL*4}, @code{COMPLEX},
+@code{INTEGER*4} and/or @code{LOGICAL*4} data have been written to it by
+@code{g77}.
+
+If necessary, it is possible to do byte-oriented i/o with @code{g77}'s
+@code{FGETC} and @code{FPUTC} intrinsics. Byte-swapping can be done in
+Fortran by equivalencing larger sized variables to an @code{INTEGER*1}
+array or a set of scalars.
+
+@cindex HDF
+@cindex PDB
+If you need to exchange binary data between arbitrary system and
+compiler variations, we recommend using a portable binary format with
+Fortran bindings, such as NCSA's HDF (@uref{http://hdf.ncsa.uiuc.edu/})
+or PACT's PDB@footnote{No, not @emph{that} one.}
+(@uref{http://www.llnl.gov/def_sci/pact/pact_homepage.html}). (Unlike,
+say, CDF or XDR, HDF-like systems write in the native number formats and
+only incur overhead when they are read on a system with a different
+format.) A future @code{g77} runtime library should use such
+techniques.
+
@node Labels Visible to Debugger
@subsection Labels Visible to Debugger
@@ -11900,7 +12832,8 @@ number---producing different computational results.)
The reason this misfeature is dangerous is that a slight,
apparently innocuous change to the source code can change
-the computational results. Consider:
+the computational results.
+Consider:
@smallexample
REAL ALMOST, CLOSE
@@ -12136,22 +13069,6 @@ Please consider offering useful answers to these questions!
@itemize @bullet
@item
-How do system administrators and users manage multiple incompatible
-Fortran compilers on their systems?
-How can @code{g77} contribute to this, or at least avoiding
-intefering with it?
-
-Currently, @code{g77} provides rudimentary ways to choose whether to
-overwrite portions of other Fortran compilation systems
-(such as the @code{f77} command and the @code{libf2c} library).
-Is this sufficient?
-What happens when users choose not to overwrite these---does
-@code{g77} work properly in all such installations, picking
-up its own versions, or does it pick up the existing ``alien''
-versions it didn't overwrite with its own, possibly leading
-to subtle bugs?
-
-@item
@code{LOC()} and other intrinsics are probably somewhat misclassified.
Is the a need for more precise classification of intrinsics, and if so,
what are the appropriate groupings?
@@ -12174,7 +13091,7 @@ If it isn't known, then you should report the problem.
Reporting a bug might help you by bringing a solution to your problem, or
it might not.
(If it does not, look in the service directory; see
-@ref{Service}.)@
+@ref{Service}.)
In any case, the principal function of a bug report is
to help the entire community by making the next version of GNU Fortran work
better.
@@ -12297,7 +13214,7 @@ If your code works with any of these combinations, that is not
proof that the bug isn't in @code{g77}---a @code{g77} bug exposed
by your code might simply be avoided, or have a different, more subtle
effect, when different options are used---but it can be a
-strong indicator that your code is making unawarranted assumptions
+strong indicator that your code is making unwarranted assumptions
about the Fortran dialect and/or underlying machine it is
being compiled and run on.
@@ -12307,11 +13224,11 @@ for information on the @samp{-fno-automatic} and
their use into selective changes in your own code.
@item
-@pindex ftncheck
+@pindex ftnchek
Validate your code with @code{ftnchek} or a similar code-checking
tool.
-@code{ftncheck} can be found at @url{ftp://ftp.netlib.org/fortran}
-or @url{ftp://ftp.dsm.fordham.edu}.
+@code{ftnchek} can be found at @uref{ftp://ftp.netlib.org/fortran}
+or @uref{ftp://ftp.dsm.fordham.edu}.
@pindex make
@cindex Makefile example
@@ -12385,8 +13302,8 @@ exposes it more readily than other compilers.
@node Bug Lists
@section Where to Report Bugs
@cindex bug report mailing lists
-@kindex egcs-bugs@@cygnus.com
-Send bug reports for GNU Fortran to @email{egcs-bugs@@cygnus.com}.
+@kindex @value{email-bugs}
+Send bug reports for GNU Fortran to @email{@value{email-bugs}}.
Often people think of posting bug reports to a newsgroup instead of
mailing them.
@@ -12722,7 +13639,7 @@ we should be able to reproduce the crash ourselves.
If you would like to write bug fixes or improvements for the GNU Fortran
compiler, that is very helpful.
Send suggested fixes to the bug report
-mailing list, @email{egcs-bugs@@cygnus.com}.
+mailing list, @email{@value{email-bugs}}.
Please follow these guidelines so we can study your patches efficiently.
If you don't follow these guidelines, your information might still be
@@ -12847,7 +13764,7 @@ The service directory is found in the file named @file{SERVICE} in the
GNU CC distribution.
@item
-Send a message to @email{egcs@@cygnus.com}.
+Send a message to @email{@value{email-general}}.
@end itemize
@end ifset
@@ -12877,7 +13794,7 @@ when compiling most any kind of program.
@end itemize
@emph{Fortran options} are listed in the file
-@file{gcc/f/lang-options.h},
+@file{@value{path-g77}/lang-options.h},
which is used during the build of @code{gcc} to
build a list of all options that are accepted by
at least one language's compiler.
@@ -12886,7 +13803,7 @@ in @file{gcc/toplev.c}, which uses this array to
determine whether a particular option should be
offered to the linked-in front end for processing
by calling @samp{lang_option_decode}, which, for
-@code{g77}, is in @file{gcc/f/com.c} and just
+@code{g77}, is in @file{@value{path-g77}/com.c} and just
calls @samp{ffe_decode_option}.
If the linked-in front end ``rejects'' a
@@ -12910,14 +13827,14 @@ a warning about this would be helpful if it were
possible.
Code that processes Fortran options is found in
-@file{gcc/f/top.c}, function @samp{ffe_decode_option}.
+@file{@value{path-g77}/top.c}, function @samp{ffe_decode_option}.
This code needs to check positive and negative forms
of each option.
The defaults for Fortran options are set in their
-global definitions, also found in @file{gcc/f/top.c}.
+global definitions, also found in @file{@value{path-g77}/top.c}.
Many of these defaults are actually macros defined
-in @file{gcc/f/target.h}, since they might be
+in @file{@value{path-g77}/target.h}, since they might be
machine-specific.
However, since, in practice, GNU compilers
should behave the same way on all configurations
@@ -12927,7 +13844,7 @@ is likely to be deprecated and, ultimately, stopped
in future versions of @code{g77}.
Accessor macros for Fortran options, used by code
-in the @code{g77} FFE, are defined in @file{gcc/f/top.h}.
+in the @code{g77} FFE, are defined in @file{@value{path-g77}/top.h}.
@emph{Compiler options} are listed in @file{gcc/toplev.c}
in the array @samp{f_options}.
@@ -12944,21 +13861,21 @@ the way @code{f771} handles the @samp{-fset-g77-defaults}
option, which is always provided as the first option when
called by @code{g77} or @code{gcc}.
-This code is in @samp{ffe_decode_options} in @file{gcc/f/top.c}.
+This code is in @samp{ffe_decode_options} in @file{@value{path-g77}/top.c}.
Have it change just the variables that you want to default
to a different setting for Fortran compiles compared to
compiles of other languages.
The @samp{-fset-g77-defaults} option is passed to @code{f771}
automatically because of the specification information
-kept in @file{gcc/f/lang-specs.h}.
+kept in @file{@value{path-g77}/lang-specs.h}.
This file tells the @code{gcc} command how to recognize,
in this case, Fortran source files (those to be preprocessed,
and those that are not), and further, how to invoke the
appropriate programs (including @code{f771}) to process
those source files.
-It is in @file{gcc/f/lang-specs.h} that @samp{-fset-g77-defaults},
+It is in @file{@value{path-g77}/lang-specs.h} that @samp{-fset-g77-defaults},
@samp{-fversion}, and other options are passed, as appropriate,
even when the user has not explicitly specified them.
Other ``internal'' options such as @samp{-quiet} also
@@ -12971,6 +13888,8 @@ are passed via this mechanism.
If you want to contribute to @code{g77} by doing research,
design, specification, documentation, coding, or testing,
the following information should give you some ideas.
+More relevant information might be available from
+@uref{ftp://alpha.gnu.org/gnu/g77/projects/}.
@menu
* Efficiency:: Make @code{g77} itself compile code faster.
@@ -13068,7 +13987,7 @@ the feature-adding work.
@itemize @bullet
@item
Do the equivalent of the trick of putting @samp{extern inline} in front
-of every function definition in @code{libf2c} and #include'ing the resulting
+of every function definition in @code{libg2c} and #include'ing the resulting
file in @code{f2c}+@code{gcc}---that is, inline all run-time-library functions
that are at all worth inlining.
(Some of this has already been done, such as for integral exponentiation.)
@@ -13103,7 +14022,7 @@ Among the important things the library would do are:
@item
Be a one-stop-shop-type
library, hence shareable and usable by all, in that what are now
-library-build-time options in @code{libf2c} would be moved at least to the
+library-build-time options in @code{libg2c} would be moved at least to the
@code{g77} compile phase, if not to finer grains (such as choosing how
list-directed I/O formatting is done by default at @code{OPEN} time, for
preconnected units via options or even statements in the main program
@@ -13146,7 +14065,7 @@ very useful.
@itemize @bullet
@item
-A new library (replacing @code{libf2c}) should improve portability as well as
+A new library (replacing @code{libg2c}) should improve portability as well as
produce more optimal code.
Further, @code{g77} and the new library should
conspire to simplify naming of externals, such as by removing unnecessarily
@@ -13223,7 +14142,7 @@ Support @samp{OPEN(@dots{},KEY=(@dots{}),@dots{})}.
@item
Support arbitrary file unit numbers, instead of limiting them
to 0 through @samp{MXUNIT-1}.
-(This is a @code{libf2c} issue.)
+(This is a @code{libg2c} issue.)
@item
@samp{OPEN(NOSPANBLOCKS,@dots{})} is treated as
@@ -13247,7 +14166,7 @@ for @code{%FILL} in @code{STRUCTURE} and related syntax,
whereas the rest of the
stuff has at least some parsing support.
This requires either major
-changes to @code{libf2c} or its replacement.
+changes to @code{libg2c} or its replacement.
@item
F90 and @code{g77} probably disagree about label scoping relative to
@@ -13480,6 +14399,7 @@ as the above is just a sample, no such section exists.
* INTGLOB:: Intrinsic also used as name of global.
* LEX:: Various lexer messages
* GLOBALS:: Disagreements about globals.
+* LINKFAIL:: When linking @samp{f771} fails.
@end menu
@node CMPAMBIG
@@ -13848,7 +14768,7 @@ Consecutive keywords must be separated by spaces, so
@samp{REALX,Y} is not valid, while @samp{REAL X,Y} is.
There are no comment lines per se, but @samp{!} starts a
comment anywhere in a line (other than within a character or
-hollerith constant).
+Hollerith constant).
@xref{Source Form}, for more information.
@@ -13924,7 +14844,7 @@ someone examining the source file itself.
Examples of errors resulting from preprocessor macro expansion
include exceeding the line-length limit, improperly starting,
terminating, or incorporating the apostrophe or double-quote in
-a character constant, improperly forming a hollerith constant,
+a character constant, improperly forming a Hollerith constant,
and so on.
@xref{Overall Options,,Options Controlling the Kind of Output},
@@ -13978,6 +14898,37 @@ In particular, the code might appear to work on a particular
system, but have bugs that affect the reliability of the data
without exhibiting any other outward manifestations of the bugs.
+@node LINKFAIL
+@section @code{LINKFAIL}
+
+@noindent
+@smallexample
+If the above command failed due to an unresolved reference
+to strtoul, _strtoul, bsearch, _bsearch, or similar, see
+[info -f g77 M LINKFAIL] (a node in the g77 documentation)
+for information on what causes this, how to work around
+the problem by editing $@{srcdir@}/proj.c, and what else to do.
+@end smallexample
+
+@xref{Missing strtoul or bsearch}, for more information on
+this problem,
+which occurs only in releases of @code{g77}
+based on @code{gcc}.
+(It does not occur in @code{egcs}.)
+
+On AIX 4.1, @code{g77} might not build with the native (non-GNU) tools
+due to a linker bug in coping with the @samp{-bbigtoc} option which
+leads to a @samp{Relocation overflow} error. The GNU linker is not
+recommended on current AIX versions, though; it was developed under a
+now-unsupported version. This bug is said to be fixed by `update PTF
+U455193 for APAR IX75823'.
+
+Compiling with @samp{-mminimal-toc}
+might solve this problem, e.g.@: by adding
+@smallexample
+BOOT_CFLAGS='-mminimal-toc -O2 -g'
+@end smallexample
+to the @code{make bootstrap} command line.
@end ifset
@node Index
diff --git a/gcc/f/g77install.texi b/gcc/f/g77install.texi
index 33223fc552f..70411078f83 100644
--- a/gcc/f/g77install.texi
+++ b/gcc/f/g77install.texi
@@ -5,10 +5,20 @@
@c The text of this file appears in the file INSTALL
@c in the G77 distribution, as well as in the G77 manual.
-@c 1997-12-23
-
-Note most of this information is out of date and superceded by the EGCS
-install procedures. It is provided for historical reference only.
+@c 1998-07-13
+
+@set version-g77 0.5.24
+@set version-gcc 2.8.1
+@set version-autoconf 2.12
+@set version-bison 1.25
+@set version-gperf 2.5
+@set version-gzip 1.2.4
+@set version-make 3.76.1
+@set version-makeinfo 1.68
+@set version-patch 2.5
+@set version-sed 2.05
+@set version-tar 1.12
+@set version-texinfo 3.12
@ifclear INSTALLONLY
@node Installation
@@ -18,6 +28,12 @@ install procedures. It is provided for historical reference only.
The following information describes how to install @code{g77}.
+Note that, for @code{egcs} users,
+much of this information is obsolete,
+and is superceded by the
+@code{egcs} installation procedures.
+Such information is explicitly flagged as such.
+
The information in this file generally pertains to dealing
with @emph{source} distributions of @code{g77} and @code{gcc}.
It is possible that some of this information will be applicable
@@ -43,6 +59,10 @@ are ongoing.
@section Prerequisites
@cindex prerequisites
+@emph{Version info:}
+For @code{egcs} users, the following information is
+superceded by the @code{egcs} installation instructions.
+
The procedures described to unpack, configure, build, and
install @code{g77} assume your system has certain programs
already installed.
@@ -51,7 +71,7 @@ The following prerequisites should be met by your
system before you follow the @code{g77} installation instructions:
@table @asis
-@item @code{gzip}
+@item @code{gzip} and @code{tar}
To unpack the @code{gcc} and @code{g77} distributions,
you'll need the @code{gunzip} utility in the @code{gzip}
distribution.
@@ -64,21 +84,20 @@ There are GNU versions of all these available---in fact,
a complete GNU UNIX system can be put together on
most systems, if desired.
-=======
The version of GNU @code{gzip} used to package this release
-is 1.2.4.
+is @value{version-gzip}.
(The version of GNU @code{tar} used to package this release
-is 1.12.)
+is @value{version-tar}.)
-@item @file{gcc-2.7.2.3.tar.gz}
+@item @file{gcc-@value{version-gcc}.tar.gz}
You need to have this, or some other applicable, version
of @code{gcc} on your system.
The version should be an exact copy of a distribution
from the FSF.
-Its size is approximately 7.1MB.
+Its size is approximately 8.4MB.
-If you've already unpacked @file{gcc-2.7.2.3.tar.gz} into a
-directory (named @file{gcc-2.7.2.3}) called the @dfn{source tree}
+If you've already unpacked @file{gcc-@value{version-gcc}.tar.gz} into a
+directory (named @file{gcc-@value{version-gcc}}) called the @dfn{source tree}
for @code{gcc}, you can delete the distribution
itself, but you'll need to remember to skip any instructions to unpack
this distribution.
@@ -87,11 +106,11 @@ Without an applicable @code{gcc} source tree, you cannot
build @code{g77}.
You can obtain an FSF distribution of @code{gcc} from the FSF.
-@item @file{g77-0.5.21.tar.gz}
+@item @file{g77-@value{version-g77}.tar.gz}
You probably have already unpacked this package,
or you are reading an advance copy of these installation instructions,
which are contained in this distribution.
-The size of this package is approximately 1.5MB.
+The size of this package is approximately 1.4MB.
You can obtain an FSF distribution of @code{g77} from the FSF,
the same way you obtained @code{gcc}.
@@ -102,9 +121,19 @@ and use @code{g77} depends on the type of system you're
using, how you build @code{g77}, and how much of it you
install (primarily, which languages you install).
-The sizes shown below assume all languages distributed
-in @code{gcc-2.7.2.3}, plus @code{g77}, will be built
-and installed.
+The sizes shown below assume all languages distributed in
+@c As of `Version 2.249', texinfo.tex loses on a construction like
+@c @code{...@value{...-...}...} since the hyphen is expanded as
+@c -@discretionary{}{}{}, even though @value resets its catcode.
+@c Fortunately this is currently the only instance. Kluge, kluge.
+@iftex
+@begingroup @let@codedash=@realdash
+@end iftex
+@code{gcc-@value{version-gcc}},
+@iftex
+@endgroup
+@end iftex
+plus @code{g77}, will be built and installed.
These sizes are indicative of GNU/Linux systems on
Intel x86 running COFF and on Digital Alpha (AXP) systems
running ELF.
@@ -118,8 +147,8 @@ before the public beta release.
@itemize ---
@item
-@code{gcc} and @code{g77} distributions occupy 8.6MB
-packed, 35MB unpacked.
+@code{gcc} and @code{g77} distributions occupy 10MB
+packed, 40MB unpacked.
These consist of the source code and documentation,
plus some derived files (mostly documentation), for
@code{gcc} and @code{g77}.
@@ -127,14 +156,14 @@ Any deviations from these numbers for different
kinds of systems are likely to be very minor.
@item
-A ``bootstrap'' build requires an additional 67.3MB
-for a total of 102MB on an ix86, and an additional
-98MB for a total of 165MB on an Alpha.
+A ``bootstrap'' build requires an additional 91MB
+for a total of 132MB on an ix86, and an additional
+136MB for a total of 177MB on an Alpha.
@item
Removing @file{gcc/stage1} after the build recovers
-10.7MB for a total of 91MB on an ix86, and recovers
-??MB for a total of ??MB on an Alpha.
+13MB for a total of 119MB on an ix86, and recovers
+21MB for a total of 155MB on an Alpha.
After doing this, the integrity of the build can
still be verified via @samp{make compare}, and the
@@ -144,8 +173,8 @@ kept in @code{gcc/stage2}.
@item
Removing @file{gcc/stage2} after the build further
-recovers 27.3MB for a total of 64.3MB, and recovers
-??MB for a total of ??MB on an Alpha.
+recovers 39MB for a total of 80MB, and recovers
+57MB for a total of 98MB on an Alpha.
After doing this, the compiler can still be installed,
especially if GNU @code{make} is used to avoid
@@ -154,9 +183,9 @@ by hand).
@item
Installing @code{gcc} and @code{g77} copies
-14.9MB onto the @samp{--prefix} disk for a total of 79.2MB
-on an ix86, and copies ??MB onto the @samp{--prefix}
-disk for a total of ??MB on an Alpha.
+23MB onto the @samp{--prefix} disk for a total of 103MB
+on an ix86, and copies 31MB onto the @samp{--prefix}
+disk for a total of 130MB on an Alpha.
@end itemize
After installation, if no further modifications and
@@ -190,70 +219,40 @@ The rest of the new installation is done without
replacing existing installed versions (assuming
they have different version numbers).
-@item @code{patch}
-Although you can do everything @code{patch} does yourself,
-by hand, without much trouble, having @code{patch} installed
-makes installation of new versions of GNU utilities such as
-@code{g77} so much easier that it is worth getting.
-You can obtain @code{patch} the same way you obtained
-@code{gcc} and @code{g77}.
-
-In any case, you can apply patches by hand---patch files
-are designed for humans to read them.
-
-The version of GNU @code{patch} used to develop this release
-is 2.5.
-
@item @code{make}
Your system must have @code{make}, and you will probably save
yourself a lot of trouble if it is GNU @code{make} (sometimes
referred to as @code{gmake}).
+In particular, you probably need GNU @code{make}
+to build outside the source directory
+(with @code{configure}'s @samp{--srcdir} option.)
The version of GNU @code{make} used to develop this release
-is 3.76.1.
+is @value{version-make}.
@item @code{cc}
Your system must have a working C compiler.
+If it doesn't, you might be able to obtain
+a prebuilt binary of some version of @code{gcc}
+from the network or on CD-ROM,
+perhaps from the FSF@.
+The best source of information about binaries
+is probably a system-specific Usenet news group,
+initially via its FAQ.
@xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC},
for more information on prerequisites for installing @code{gcc}.
-@item @code{bison}
-If you do not have @code{bison} installed, you can usually
-work around any need for it, since @code{g77} itself does
-not use it, and @code{gcc} normally includes all files
-generated by running it in its distribution.
-You can obtain @code{bison} the same way you obtained
-@code{gcc} and @code{g77}.
-
-The version of GNU @code{bison} used to develop this release
-is 1.25.
-
-@xref{Missing bison?},
-for information on how to work around not having @code{bison}.
-
-@item @code{makeinfo}
-If you are missing @code{makeinfo}, you can usually work
-around any need for it.
-You can obtain @code{makeinfo} the same way you obtained
-@code{gcc} and @code{g77}.
-
-The version of GNU @code{makeinfo} used to develop this release
-is 1.68, from GNU @code{texinfo} version 3.11.
-
-@xref{Missing makeinfo?},
-for information on getting around the lack of @code{makeinfo}.
-
@item @code{sed}
All UNIX systems have @code{sed}, but some have a broken
version that cannot handle configuring, building, or
installing @code{gcc} or @code{g77}.
The version of GNU @code{sed} used to develop this release
-is 2.05.
+is @value{version-sed}.
(Note that GNU @code{sed} version 3.0 was withdrawn by the
FSF---if you happen to have this version installed, replace
-it with version 2.05 immediately.
+it with version @value{version-sed} immediately.
See a GNU distribution site for further explanation.)
@item @code{root} access or equivalent
@@ -274,6 +273,69 @@ System administrators with more experience will want to
determine for themselves how they want to modify the
procedures described below to suit the needs of their
installation.
+
+@item @code{autoconf}
+The version of GNU @code{autoconf} used to develop this release
+is @value{version-autoconf}.
+
+@code{autoconf} is not needed in the typical case of
+installing @code{gcc} and @code{g77}.
+@xref{Missing tools?}, for information on when it
+might be needed and how to work around not having it.
+
+@item @code{bison}
+The version of GNU @code{bison} used to develop this release
+is @value{version-bison}.
+
+@code{bison} is not needed in the typical case of
+installing @code{gcc} and @code{g77}.
+@xref{Missing tools?}, for information on when it
+might be needed and how to work around not having it.
+
+@item @code{gperf}
+The version of GNU @code{gperf} used to develop this release
+is @value{version-gperf}.
+
+@code{gperf} is not needed in the typical case of
+installing @code{gcc} and @code{g77}.
+@xref{Missing tools?}, for information on when it
+might be needed and how to work around not having it.
+
+@item @code{makeinfo}
+The version of GNU @code{makeinfo} used to develop this release
+is @value{version-makeinfo}.
+
+@code{makeinfo} is part of the GNU @code{texinfo} package;
+@code{makeinfo} version @value{version-makeinfo}
+is distributed as part of
+GNU @code{texinfo} version @value{version-texinfo}.
+
+@code{makeinfo} is not needed in the typical case of
+installing @code{gcc} and @code{g77}.
+@xref{Missing tools?}, for information on when it
+might be needed and how to work around not having it.
+
+An up-to-date version of GNU @code{makeinfo} is still convenient
+when obtaining a new version of a GNU distribution such as
+@code{gcc} or @code{g77},
+as it allows you to obtain the @file{.diff.gz} file
+instead of the entire @file{.tar.gz} distribution
+(assuming you have installed @code{patch}).
+
+@item @code{patch}
+The version of GNU @code{patch} used to develop this release
+is @value{version-patch}.
+
+Beginning with @code{g77} version 0.5.23, it is no longer
+necessary to patch the @code{gcc} back end to build @code{g77}.
+
+An up-to-date version of GNU @code{patch} is still convenient
+when obtaining a new version of a GNU distribution such as
+@code{gcc} or @code{g77},
+as it allows you to obtain the @file{.diff.gz} file
+instead of the entire @file{.tar.gz} distribution
+(assuming you have installed the tools needed
+to rebuild derived files, such as @code{makeinfo}).
@end table
@node Problems Installing
@@ -291,6 +353,7 @@ either @code{gcc} or @code{g77}.
@menu
* General Problems:: Problems afflicting most or all systems.
+* System-specific Problems:: Problems afflicting particular systems.
* Cross-compiler Problems:: Problems afflicting cross-compilation setups.
@end menu
@@ -301,12 +364,11 @@ These problems can occur on most or all systems.
@menu
* GNU C Required:: Why even ANSI C is not enough.
-* Patching GNU CC Necessary:: Why @code{gcc} must be patched first.
+* Patching GNU CC:: Why @code{gcc} needn't be patched.
* Building GNU CC Necessary:: Why you can't build @emph{just} Fortran.
-* Missing strtoul:: If linking @code{f771} fails due to an
- unresolved reference to @code{strtoul}.
-* Cleanup Kills Stage Directories:: A minor nit for @code{g77} developers.
-* Missing gperf?:: When building requires @code{gperf}.
+* Missing strtoul or bsearch:: When linking @samp{f771} fails.
+* Cleanup Kills Stage Directories:: For @code{g77} developers.
+* LANGUAGES Macro Ignored:: Sometimes @samp{LANGUAGES} is ignored.
@end menu
@node GNU C Required
@@ -328,25 +390,16 @@ bootstrap build to automate the process of first building
@code{g77} and rebuilding @code{gcc} using that just-built @code{gcc},
and so on.
-@node Patching GNU CC Necessary
-@subsubsection Patching GNU CC Necessary
+@node Patching GNU CC
+@subsubsection Patching GNU CC
@cindex patch files
@cindex GBE
-@code{g77} currently requires application of a patch file to the gcc compiler
-tree.
-The necessary patches should be folded in to the mainline gcc distribution.
-
-Some combinations
-of versions of @code{g77} and @code{gcc} might actually @emph{require} no
-patches, but the patch files will be provided anyway as long as
-there are more changes expected in subsequent releases.
-These patch files might contain
-unnecessary, but possibly helpful, patches.
-As a result, it is possible this issue might never be
-resolved, except by eliminating the need for the person
-configuring @code{g77} to apply a patch by hand, by going
-to a more automated approach (such as configure-time patching).
+@code{g77} no longer requires application of a patch file
+to the @code{gcc} compiler tree.
+In fact, no such patch file is distributed with @code{g77}.
+This is as of version 0.5.23
+and @code{egcs} version 1.0.
@node Building GNU CC Necessary
@subsubsection Building GNU CC Necessary
@@ -357,44 +410,74 @@ It should be possible to build the runtime without building @code{cc1}
and other non-Fortran items, but, for now, an easy way to do that
is not yet established.
-@node Missing strtoul
-@subsubsection Missing strtoul
+@node Missing strtoul or bsearch
+@subsubsection Missing strtoul or bsearch
+@cindex bsearch
+@cindex _bsearch
@cindex strtoul
@cindex _strtoul
+@cindex undefined reference (_bsearch)
@cindex undefined reference (_strtoul)
@cindex f771, linking error for
@cindex linking error for f771
@cindex ld error for f771
+@cindex ld can't find _bsearch
@cindex ld can't find _strtoul
@cindex SunOS4
-On SunOS4 systems, linking the @code{f771} program produces
-an error message concerning an undefined symbol named
-@samp{_strtoul}.
-
-This is not a @code{g77} bug.
-@xref{Patching GNU Fortran}, for information on
-a workaround provided by @code{g77}.
-
-The proper fix is either to upgrade your system to one that
-provides a complete ANSI C environment, or improve @code{gcc} so
-that it provides one for all the languages and configurations it supports.
-
-@emph{Note:} In earlier versions of @code{g77}, an automated
-workaround for this problem was attempted.
-It worked for systems without @samp{_strtoul}, substituting
-the incomplete-yet-sufficient version supplied with @code{g77}
-for those systems.
-However, the automated workaround failed mysteriously for systems
-that appeared to have conforming ANSI C environments, and it
-was decided that, lacking resources to more fully investigate
-the problem, it was better to not punish users of those systems
-either by requiring them to work around the problem by hand or
-by always substituting an incomplete @code{strtoul()} implementation
-when their systems had a complete, working one.
-Unfortunately, this meant inconveniencing users of systems not
-having @code{strtoul()}, but they're using obsolete (and generally
-unsupported) systems anyway.
+@emph{Version info:}
+The following information does not apply to the
+@code{egcs} version of @code{g77}.
+
+On SunOS4 systems, linking the @code{f771} program used to
+produce an error message concerning an undefined symbol named
+@samp{_strtoul}, because the @samp{strtoul} library function
+is not provided on that system.
+
+Other systems have, in the past, been reported to not provide
+their own @samp{strtoul} or @samp{bsearch} function.
+
+Some versions @code{g77} tried to default to providing bare-bones
+versions of @code{bsearch} and @code{strtoul} automatically,
+but every attempt at this has failed for at least one kind of system.
+
+To limit the failures to those few systems actually missing the
+required routines, the bare-bones versions are still provided,
+in @file{gcc/f/proj.c},
+if the appropriate macros are defined.
+These are @code{NEED_BSEARCH} for @samp{bsearch} and
+@code{NEED_STRTOUL} for @samp{NEED_STRTOUL}.
+
+Therefore, if you are sure your system is missing
+@code{bsearch} or @code{strtoul} in its library,
+define the relevant macro(s) before building @code{g77}.
+This can be done by editing @file{gcc/f/proj.c} and inserting
+either or both of the following @samp{#define} statements
+before the comment shown:
+
+@smallexample
+/* Insert #define statements here. */
+
+#define NEED_BSEARCH
+#define NEED_STRTOUL
+@end smallexample
+
+Then, continue configuring and building @code{g77} as usual.
+
+Or, you can define these on the @code{make} command line.
+To build with the bundled @code{cc} on SunOS4, for example, try:
+@smallexample
+make bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL'
+@end smallexample
+
+If you then encounter problems compiling @file{gcc/f/proj.c},
+it might be due to a discrepancy between how @samp{bsearch}
+or @samp{strtoul} are defined by that file and how they're
+declared by your system's header files.
+
+In that case, you'll have to use some basic knowledge of C
+to work around the problem, perhaps by editing @file{gcc/f/proj.c}
+somewhat.
@node Cleanup Kills Stage Directories
@subsubsection Cleanup Kills Stage Directories
@@ -406,47 +489,50 @@ would create the various @file{stage@var{n}} directories and their
subdirectories, so developers and expert installers wouldn't have to
reconfigure after cleaning up.
-@node Missing gperf?
-@subsubsection Missing @code{gperf}?
-@cindex @code{gperf}
-@cindex missing @code{gperf}
-
-If a build aborts trying to invoke @code{gperf}, that
-strongly suggests an improper method was used to
-create the @code{gcc} source directory,
-such as the UNIX @samp{cp -r} command instead
-of @samp{cp -pr}, since this problem very likely
-indicates that the date-time-modified information on
-the @code{gcc} source files is incorrect.
-
-The proper solution is to recreate the @code{gcc} source
-directory from a @code{gcc} distribution known to be
-provided by the FSF.
-
-It is possible you might be able to temporarily
-work around the problem, however, by trying these
-commands:
-
-@example
-sh# @kbd{cd gcc}
-sh# @kbd{touch c-gperf.h}
-sh#
-@end example
-
-These commands update the date-time-modified information for
-the file produced by the invocation of @code{gperf}
-in the current versions of @code{gcc}, so that @code{make} no
-longer believes it needs to update it.
-This file should already exist in a @code{gcc}
-distribution, but mistakes made when copying the @code{gcc}
-directory can leave the modification information
-set such that the @code{gperf} input files look more ``recent''
-than the corresponding output files.
-
-If the above does not work, definitely start from scratch
-and avoid copying the @code{gcc} using any method that does
-not reliably preserve date-time-modified information, such
-as the UNIX @samp{cp -r} command.
+That help has arrived as of version 0.5.23 of @code{g77}
+and version 1.1 of @code{egcs}.
+Configuration itself no longer creates any particular directories
+that are unique to @code{g77}.
+The build procedures in @file{Make-lang.in} take care of
+that, on demand.
+
+@node LANGUAGES Macro Ignored
+@subsubsection LANGUAGES Macro Ignored
+@cindex @samp{LANGUAGES} macro ignored
+@cindex ignoring @samp{LANGUAGES} macro
+
+Prior to version 0.5.23 of @code{g77}
+and version 1.1 of @code{egcs},
+@code{g77} would sometimes ignore
+the absence of @samp{f77} and @samp{F77} in the
+@samp{LANGUAGES} macro definition used for the
+@code{make} command being processed.
+
+As of @code{g77} version 0.5.23
+and @code{egcs} version 1.1,
+@code{g77} now obeys this macro
+in all relevant situations.
+
+However, in versions of @code{gcc} through 2.8.1,
+non-@code{g77} portions of @code{gcc},
+such as @code{g++},
+are known to go ahead and perform various
+language-specific activities when their
+respective language strings do not appear
+in the @samp{LANGUAGES} macro in effect
+during that invocation of @code{make}.
+
+It is expected that these remaining problems will
+be fixed in a future version of @code{gcc}.
+
+@node System-specific Problems
+@subsection System-specific Problems
+
+@cindex AIX
+A linker bug on some versions of AIX 4.1 might prevent building
+when @code{g77} is built within @code{gcc}.
+It might also occur when building within @code{egcs}.
+@xref{LINKFAIL}.
@node Cross-compiler Problems
@subsection Cross-compiler Problems
@@ -492,14 +578,16 @@ For example, it might not know how to handle floating-point
constants.
@item
-Improvements to the way @code{libf2c} is built could make
+Improvements to the way @code{libg2c} is built could make
building @code{g77} as a cross-compiler easier---for example,
passing and using @samp{$(LD)} and @samp{$(AR)} in the appropriate
ways.
+(This is improved in the @code{egcs} version of @code{g77},
+especially as of version 1.1.)
@item
There are still some challenges putting together the right
-run-time libraries (needed by @code{libf2c}) for a target
+run-time libraries (needed by @code{libg2c}) for a target
system, depending on the systems involved in the configuration.
(This is a general problem with cross-compilation, and with
@code{gcc} in particular.)
@@ -601,9 +689,9 @@ reporting (immediate flagging of errors during writes) versus
asynchronous, or, more precisely, buffered error reporting
(detection of errors might be delayed).
-@code{libf2c} supports flagging write errors immediately when
+@code{libg2c} supports flagging write errors immediately when
it is built with the @samp{ALWAYS_FLUSH} macro defined.
-This results in a @code{libf2c} that runs slower, sometimes
+This results in a @code{libg2c} that runs slower, sometimes
quite a bit slower, under certain circumstances---for example,
accessing files via the networked file system NFS---but the
effect can be more reliable, robust file I/O.
@@ -612,21 +700,19 @@ If you know that Fortran programs requiring this level of precision
of error reporting are to be compiled using the
version of @code{g77} you are building, you might wish to
modify the @code{g77} source tree so that the version of
-@code{libf2c} is built with the @samp{ALWAYS_FLUSH} macro
+@code{libg2c} is built with the @samp{ALWAYS_FLUSH} macro
defined, enabling this behavior.
-To do this, find this line in @file{f/runtime/configure.in} in
+To do this, find this line in @file{f/runtime/f2c.h} in
your @code{g77} source tree:
@example
-dnl AC_DEFINE(ALWAYS_FLUSH)
+/* #define ALWAYS_FLUSH */
@end example
-Remove the leading @samp{dnl@w{ }}, so the line begins with
-@samp{AC_DEFINE(}, and run @code{autoconf} in that file's directory.
-(Or, if you don't have @code{autoconf}, you can modify @file{f2c.h.in}
-in the same directory to include the line @samp{#define ALWAYS_FLUSH}
-after @samp{#define F2C_INCLUDE}.)
+Remove the leading @samp{/*@w{ }},
+so the line begins with @samp{#define},
+and the trailing @samp{@w{ }*/}.
Then build or rebuild @code{g77} as appropriate.
@@ -661,7 +747,7 @@ The @code{g77} build will crash if an attempt is made to build
it as a cross-compiler
for a target when @code{g77} cannot reliably determine the bit pattern of
floating-point constants for the target.
-Planned improvements for g77-0.6
+Planned improvements for version 0.6 of @code{g77}
will give it the capabilities it needs to not have to crash the build
but rather generate correct code for the target.
(Currently, @code{g77}
@@ -741,6 +827,10 @@ systems.
@section Quick Start
@cindex quick start
+@emph{Version info:}
+For @code{egcs} users, the following information is
+superceded by the @code{egcs} installation instructions.
+
This procedure configures, builds, and installs @code{g77}
``out of the box'' and works on most UNIX systems.
Each command is identified by a unique number,
@@ -763,8 +853,8 @@ already reside in @file{/usr/FSF}, a naming convention
used by the author of @code{g77} on his own system:
@example
-/usr/FSF/gcc-2.7.2.3.tar.gz
-/usr/FSF/g77-0.5.21.tar.gz
+/usr/FSF/gcc-@value{version-gcc}.tar.gz
+/usr/FSF/g77-@value{version-g77}.tar.gz
@end example
@c (You can use @file{gcc-2.7.2.1.tar.gz} instead, or
@@ -774,27 +864,28 @@ used by the author of @code{g77} on his own system:
@c if you remember to make the appropriate adjustments in the
@c instructions below.)
-@cindex SunOS4
-Users of the following systems should not blindly follow
-these quick-start instructions, because of problems their
-systems have coping with straightforward installation of
-@code{g77}:
+@c @cindex SunOS4
+@c Users of the following systems should not blindly follow
+@c these quick-start instructions, because of problems their
+@c systems have coping with straightforward installation of
+@c @code{g77}:
+@c
+@c @itemize @bullet
+@c @item
+@c SunOS4
+@c @end itemize
+@c
+@c Instead, see @ref{Complete Installation}, for detailed information
+@c on how to configure, build, and install @code{g77} for your
+@c particular system.
+@c Also, see @ref{Trouble,,Known Causes of Trouble with GNU Fortran},
+@c for information on bugs and other problems known to afflict the
+@c installation process, and how to report newly discovered ones.
+@c
+@c If your system is @emph{not} on the above list, and @emph{is}
+@c a UNIX system or one of its variants, you should be able to
+@c follow the instructions below.
-@itemize @bullet
-@item
-SunOS4
-@end itemize
-
-Instead, see @ref{Complete Installation}, for detailed information
-on how to configure, build, and install @code{g77} for your
-particular system.
-Also, see @ref{Trouble,,Known Causes of Trouble with GNU Fortran},
-for information on bugs and other problems known to afflict the
-installation process, and how to report newly discovered ones.
-
-If your system is @emph{not} on the above list, and @emph{is}
-a UNIX system or one of its variants, you should be able to
-follow the instructions below.
If you vary @emph{any} of the steps below, you might run into
trouble, including possibly breaking existing programs for
other users of your system.
@@ -805,55 +896,42 @@ These explanations follow this list of steps.
@example
sh[ 1]# @kbd{cd /usr/src}
@set source-dir 1
-sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-2.7.2.3.tar.gz | tar xf -}
+sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -}
[Might say "Broken pipe"...that is normal on some systems.]
@set unpack-gcc 2
-sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-0.5.21.tar.gz | tar xf -}
+sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}
["Broken pipe" again possible.]
@set unpack-g77 3
-sh[ 4]# @kbd{ln -s gcc-2.7.2.3 gcc}
+sh[ 4]# @kbd{ln -s gcc-@value{version-gcc} gcc}
@set link-gcc 4
-sh[ 5]# @kbd{ln -s g77-0.5.21 g77}
+sh[ 5]# @kbd{ln -s g77-@value{version-g77} g77}
@set link-g77 5
sh[ 6]# @kbd{mv -i g77/* gcc}
[No questions should be asked by mv here; or, you made a mistake.]
@set merge-g77 6
-sh[ 7]# @kbd{patch -p1 -V t -d gcc < gcc/f/gbe/2.7.2.3.diff}
-[Unless patch complains about rejected patches, this step worked.]
-@set apply-patch 7
-sh[ 8]# @kbd{cd gcc}
-sh[ 9]# @kbd{touch f77-install-ok}
-[Do not do the above if your system already has an f77
-command, unless you've checked that overwriting it
-is okay.]
-@set f77-install-ok 9
-sh[10]# @kbd{touch f2c-install-ok}
-[Do not do the above if your system already has an f2c
-command, unless you've checked that overwriting it
-is okay. Else, @kbd{touch f2c-exists-ok}.]
-@set f2c-install-ok 10
-sh[11]# @kbd{./configure --prefix=/usr}
+sh[ 7]# @kbd{cd gcc}
+sh[ 8]# @kbd{./configure --prefix=/usr}
[Do not do the above if gcc is not installed in /usr/bin.
You might need a different @kbd{--prefix=@dots{}}, as
described below.]
-@set configure-gcc 11
-sh[12]# @kbd{make bootstrap}
+@set configure-gcc 8
+sh[ 9]# @kbd{make bootstrap}
[This takes a long time, and is where most problems occur.]
-@set build-gcc 12
-sh[13]# @kbd{make compare}
+@set build-gcc 9
+sh[10]# @kbd{make compare}
[This verifies that the compiler is `sane'.
If any files are printed, you have likely found a g77 bug.]
-@set compare-gcc 13
-sh[14]# @kbd{rm -fr stage1}
-@set rm-stage1 14
-sh[15]# @kbd{make -k install}
+@set compare-gcc 10
+sh[11]# @kbd{rm -fr stage1}
+@set rm-stage1 11
+sh[12]# @kbd{make -k install}
[The actual installation.]
-@set install-g77 15
-sh[16]# @kbd{g77 -v}
+@set install-g77 12
+sh[13]# @kbd{g77 -v}
[Verify that g77 is installed, obtain version info.]
-@set show-version 16
-sh[17]#
-@set end-procedure 17
+@set show-version 13
+sh[14]#
+@set end-procedure 14
@end example
@xref{Updating Documentation,,Updating Your Info Directory}, for
@@ -877,17 +955,17 @@ installed version of @code{g77} and @code{gcc} in any case.
@c instead, or apply @file{gcc-2.7.2-2.7.2.1.diff.gz} to achieve
@c similar results.
-@item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-0.5.21.tar.gz | tar xf -}
+@item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}
It is not always necessary to obtain the latest version of
@code{g77} as a complete @file{.tar.gz} file if you have
a complete, earlier distribution of @code{g77}.
If appropriate, you can unpack that earlier
version of @code{g77}, and then apply the appropriate patches
to achieve the same result---a source tree containing version
-0.5.21 of @code{g77}.
+@value{version-g77} of @code{g77}.
-@item Step @value{link-gcc}: @kbd{ln -s gcc-2.7.2.3 gcc}
-@item Step @value{link-g77}: @kbd{ln -s g77-0.5.21 g77}
+@item Step @value{link-gcc}: @kbd{ln -s gcc-@value{version-gcc} gcc}
+@item Step @value{link-g77}: @kbd{ln -s g77-@value{version-g77} g77}
These commands mainly help reduce typing,
and help reduce visual clutter in examples
in this manual showing what to type to install @code{g77}.
@@ -901,7 +979,7 @@ other than the FSF.
@item Step @value{merge-g77}: @kbd{mv -i g77/* gcc}
After doing this, you can, if you like, type
-@samp{rm g77} and @samp{rmdir g77-0.5.21} to remove
+@samp{rm g77} and @samp{rmdir g77-@value{version-g77}} to remove
the empty directory and the symbol link to it.
But, it might be helpful to leave them around as
quick reminders of which version(s) of @code{g77} are
@@ -911,59 +989,25 @@ installed on your system.
on the contents of the @file{g77} directory (as merged
into the @file{gcc} directory).
-@item Step @value{apply-patch}: @kbd{patch -p1 @dots{}}
-@c (Or `@kbd{@dots{} < gcc/f/gbe/2.7.2.1.diff}', if appropriate.)
-@c
-This can produce a wide variety of printed output,
-from @samp{Hmm, I can't seem to find a patch in there anywhere...}
-to long lists of messages indicated that patches are
-being found, applied successfully, and so on.
-
-If messages about ``fuzz'', ``offset'', or
-especially ``reject files'' are printed, it might
-mean you applied the wrong patch file.
-If you believe this is the case, it is best to restart
-the sequence after deleting (or at least renaming to unused
-names) the top-level directories for @code{g77} and @code{gcc}
-and their symbolic links.
-
-After this command finishes, the @code{gcc} directory might
-have old versions of several files as saved by @code{patch}.
-To remove these, after @kbd{cd gcc}, type @kbd{rm -i *.~*~}.
-
-@xref{Merging Distributions}, for more information.
-
-@item Step @value{f77-install-ok}: @kbd{touch f77-install-ok}
-Don't do this if you don't want to overwrite an existing
-version of @code{f77} (such as a native compiler, or a
-script that invokes @code{f2c}).
-Otherwise, installation will overwrite the @code{f77} command
-and the @code{f77} man pages with copies of the corresponding
-@code{g77} material.
-
-@xref{Installing f77,,Installing @code{f77}}, for more
-information.
-
-@item Step @value{f2c-install-ok}: @kbd{touch f2c-install-ok}
-Don't do this if you don't want to overwrite an existing
-installation of @code{libf2c} (though, chances are, you do).
-Instead, @kbd{touch f2c-exists-ok} to allow the installation
-to continue without any error messages about @file{/usr/lib/libf2c.a}
-already existing.
-
-@xref{Installing f2c,,Installing @code{f2c}}, for more
-information.
-
@item Step @value{configure-gcc}: @kbd{./configure --prefix=/usr}
-This is where you specify that the @file{g77} executable is to be
-installed in @file{/usr/bin/}, the @file{libf2c.a} library is
-to be installed in @file{/usr/lib/}, and so on.
+This is where you specify that
+the @file{g77} and @file{gcc} executables are to be
+installed in @file{/usr/bin/},
+the @code{g77} and @code{gcc} documentation is
+to be installed in @file{/usr/info/} and @file{/usr/man/},
+and so on.
You should ensure that any existing installation of the @file{gcc}
executable is in @file{/usr/bin/}.
-Otherwise, installing @code{g77} so that it does not fully
-replace the existing installation of @code{gcc} is likely
-to result in the inability to compile Fortran programs.
+
+However, if that existing version of @code{gcc} is not @value{version-gcc},
+or if you simply wish to avoid risking overwriting it with a
+newly built copy of the same version,
+you can specify @samp{--prefix=/usr/local}
+(which is the default)
+or some other path,
+and invoke the newly installed version
+directly from that path's @file{bin} directory.
@xref{Where to Install,,Where in the World Does Fortran (and GNU CC) Go?},
for more information on determining where to install @code{g77}.
@@ -996,9 +1040,11 @@ You don't need to do this, but it frees up disk space.
If this doesn't seem to work, try:
@example
-make -k install install-libf77 install-f2c-all
+make -k install install-libf77
@end example
+Or, make sure you're using GNU @code{make}.
+
@xref{Installation of Binaries}, for more information.
@xref{Updating Documentation,,Updating Your Info Directory},
@@ -1047,6 +1093,15 @@ sh# @kbd{./smtest}
sh#
@end example
+If invoking @code{g77} doesn't seem to work,
+the problem might be that you've installed it in
+a location that is not in your shell's search path.
+For example, if you specified @samp{--prefix=/gnu},
+and @file{/gnu/bin} is not in your @code{PATH}
+environment variable,
+you must explicitly specify the location of the compiler
+via @kbd{/gnu/bin/g77 -o smtest smtest.f}.
+
After proper installation, you don't
need to keep your gcc and g77 source and build directories
around anymore.
@@ -1056,23 +1111,23 @@ Removing them can free up a lot of disk space.
@node Complete Installation
@section Complete Installation
+@emph{Version info:}
+For @code{egcs} users, the following information is
+mostly superceded by the @code{egcs} installation instructions.
+
Here is the complete @code{g77}-specific information on how
to configure, build, and install @code{g77}.
@menu
* Unpacking::
* Merging Distributions::
-* f77: Installing f77.
-* f2c: Installing f2c.
-* Patching GNU Fortran::
* Where to Install::
* Configuring gcc::
* Building gcc::
* Pre-installation Checks::
* Installation of Binaries::
* Updating Documentation::
-* bison: Missing bison?.
-* makeinfo: Missing makeinfo?.
+* Missing tools?::
@end menu
@node Unpacking
@@ -1109,10 +1164,10 @@ and @code{g77} is:
@example
sh# @kbd{cd /usr/src}
-sh# @kbd{gunzip -c /usr/FSF/gcc-2.7.2.3.tar.gz | tar xf -}
-sh# @kbd{gunzip -c /usr/FSF/g77-0.5.21.tar.gz | tar xf -}
-sh# @kbd{ln -s gcc-2.7.2.3 gcc}
-sh# @kbd{ln -s g77-0.5.21 g77}
+sh# @kbd{gunzip -c /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -}
+sh# @kbd{gunzip -c /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}
+sh# @kbd{ln -s gcc-@value{version-gcc} gcc}
+sh# @kbd{ln -s g77-@value{version-g77} g77}
sh# @kbd{mv -i g77/* gcc}
@end example
@@ -1137,7 +1192,7 @@ g77/f
All three entries should be moved (or copied) into a @code{gcc}
source tree (typically named after its version number and
-as it appears in the FSF distributions---e.g. @file{gcc-2.7.2.3}).
+as it appears in the FSF distributions---e.g. @file{gcc-@value{version-gcc}}).
@file{g77/f} is the subdirectory containing all of the
code, documentation, and other information that is specific
@@ -1157,8 +1212,7 @@ tree for the first time.
@cindex optimizations, Pentium
@emph{Note:} Please use @strong{only} @code{gcc} and @code{g77}
source trees as distributed by the FSF.
-Use of modified versions, such as the Pentium-specific-optimization
-port of @code{gcc}, is likely to result in problems that appear to be
+Use of modified versions is likely to result in problems that appear to be
in the @code{g77} code but, in fact, are not.
Do not use such modified versions
unless you understand all the differences between them and the versions
@@ -1173,29 +1227,24 @@ and @code{gcc} can coexist as they do in the stock FSF distributions.
@cindex versions of @code{gcc}
@cindex support for @code{gcc} versions
-After merging the @code{g77} source tree into the @code{gcc}
-source tree, the final merge step is done by applying the
-pertinent patches the @code{g77} distribution provides for
-the @code{gcc} source tree.
-
-Read the file @file{gcc/f/gbe/README}, and apply the appropriate
-patch file for the version of the GNU CC compiler you have, if
-that exists.
-If the directory exists but the appropriate file
-does not exist, you are using either an old, unsupported version,
-or a release one that is newer than the newest @code{gcc} version
-supported by the version of @code{g77} you have.
+After merging the @code{g77} source tree into the @code{gcc} source tree,
+you have put together a complete @code{g77} source tree.
@cindex gcc version numbering
@cindex version numbering
@cindex g77 version number
@cindex GNU version numbering
-As of version 0.5.18, @code{g77} modifies the version number
-of @code{gcc} via the pertinent patches.
-This is done because the resulting version of @code{gcc} is
-deemed sufficiently different from the vanilla distribution
-to make it worthwhile to present, to the user, information
-signaling the fact that there are some differences.
+As of version 0.5.23, @code{g77} no longer modifies
+the version number of @code{gcc},
+nor does it patch @code{gcc} itself.
+
+@code{g77} still depends on being merged with an
+appropriate version of @code{gcc}.
+For version @value{version-g77} of @code{g77},
+the specific version of @code{gcc} supported is @value{version-gcc}.
+
+However, other versions of @code{gcc} might be suitable
+``hosts'' for this version of @code{g77}.
GNU version numbers make it easy to figure out whether a
particular version of a distribution is newer or older than
@@ -1204,7 +1253,7 @@ The format is,
generally, @var{major}.@var{minor}.@var{patch}, with
each field being a decimal number.
(You can safely ignore
-leading zeros; for example, 1.5.3 is the same as 1.5.03.)@
+leading zeros; for example, 1.5.3 is the same as 1.5.03.)
The @var{major} field only increases with time.
The other two fields are reset to 0 when the field to
their left is incremented; otherwise, they, too, only
@@ -1216,9 +1265,10 @@ announcements and in names for distributions and
the directories they create.)
If your version of @code{gcc} is older than the oldest version
-supported by @code{g77} (as casually determined by listing
-the contents of @file{gcc/f/gbe/}), you should obtain a newer,
-supported version of @code{gcc}.
+supported by @code{g77}
+(as casually determined by listing the contents of @file{gcc/f/INSTALL/},
+which contains these installation instructions in plain-text format),
+you should obtain a newer, supported version of @code{gcc}.
(You could instead obtain an older version of @code{g77},
or try and get your @code{g77} to work with the old
@code{gcc}, but neither approach is recommended, and
@@ -1230,20 +1280,18 @@ If your version of @code{gcc} is newer than the newest version
supported by @code{g77}, it is possible that your @code{g77}
will work with it anyway.
If the version number for @code{gcc} differs only in the
-@var{patch} field, you might as well try applying the @code{g77} patch
-that is for the newest version of @code{gcc} having the same
-@var{major} and @var{minor} fields, as this is likely to work.
+@var{patch} field, you might as well try that version of @code{gcc}.
+Since it has the same @var{major} and @var{minor} fields,
+the resulting combination is likely to work.
So, for example, if a particular version of @code{g77} has support for
-@code{gcc} versions 2.7.0 and 2.7.1,
-it is likely that @file{gcc-2.7.2} would work well with @code{g77}
-by using the @file{2.7.1.diff} patch file provided
-with @code{g77} (aside from some offsets reported by @code{patch},
-which usually are harmless).
-
-However, @file{gcc-2.8.0} would almost certainly
-not work with that version of @code{g77} no matter which patch file was
-used, so a new version of @code{g77} would be needed (and you should
+@code{gcc} versions 2.8.0 and 2.8.1,
+it is likely that @file{gcc-2.8.2} would work well with @code{g77}.
+
+However, @file{gcc-2.9.0} would almost certainly
+not work with that version of @code{g77}
+without appropriate modifications,
+so a new version of @code{g77} would be needed (and you should
wait for it rather than bothering the maintainers---@pxref{Changes,,
User-Visible Changes}).
@@ -1255,211 +1303,24 @@ separate distributions.
By keeping them separate, each product is able to be independently
improved and distributed to its user base more frequently.
-However, @code{g77} often requires changes to contemporary
-versions of @code{gcc}.
-Also, the GBE interface defined by @code{gcc} typically
+However, the GBE interface defined by @code{gcc} typically
undergoes some incompatible changes at least every time the
@var{minor} field of the version number is incremented,
and such changes require corresponding changes to
the @code{g77} front end (FFE).
-It is hoped that the GBE interface, and the @code{gcc} and
-@code{g77} products in general, will stabilize sufficiently
-for the need for hand-patching to disappear.
-
-Invoking @code{patch} as described in @file{gcc/f/gbe/README}
-can produce a wide variety of printed output,
-from @samp{Hmm, I can't seem to find a patch in there anywhere...}
-to long lists of messages indicated that patches are
-being found, applied successfully, and so on.
-
-If messages about ``fuzz'', ``offset'', or
-especially ``reject files'' are printed, it might
-mean you applied the wrong patch file.
-If you believe this is the case, it is best to restart
-the sequence after deleting (or at least renaming to unused
-names) the top-level directories for @code{g77} and @code{gcc}
-and their symbolic links.
-That is because @code{patch} might have partially patched
-some @code{gcc} source files, so reapplying the correct
-patch file might result in the correct patches being
-applied incorrectly (due to the way @code{patch} necessarily
-works).
-
-After @code{patch} finishes, the @code{gcc} directory might
-have old versions of several files as saved by @code{patch}.
-To remove these, after @kbd{cd gcc}, type @kbd{rm -i *.~*~}.
-
-@pindex config-lang.in
-@emph{Note:} @code{g77}'s configuration file @file{gcc/f/config-lang.in}
-ensures that the source code for the version of @code{gcc}
-being configured has at least one indication of being patched
-as required specifically by @code{g77}.
-This configuration-time
-checking should catch failure to apply the correct patch and,
-if so caught, should abort the configuration with an explanation.
-@emph{Please} do not try to disable the check,
-otherwise @code{g77} might well appear to build
-and install correctly, and even appear to compile correctly,
-but could easily produce broken code.
-
-@cindex creating patch files
-@cindex patch files, creating
-@pindex gcc/f/gbe/
-@samp{diff -rcp2N} is used to create the patch files
-in @file{gcc/f/gbe/}.
-
-@node Installing f77
-@subsection Installing @code{f77}
-@cindex f77 command
-@cindex commands, f77
-@cindex native compiler
-
-You should decide whether you want installation of @code{g77}
-to also install an @code{f77} command.
-On systems with a native @code{f77}, this is not
-normally desired, so @code{g77} does not do this by
-default.
-
-@pindex f77-install-ok
-@vindex F77_INSTALL_FLAG
-If you want @code{f77} installed, create the file @file{f77-install-ok}
-(e.g. via the UNIX command @samp{touch f77-install-ok}) in the
-source or build top-level directory (the same directory in
-which the @code{g77} @file{f} directory resides, not the @file{f} directory
-itself), or edit @file{gcc/f/Make-lang.in} and change the definition
-of the @samp{F77_INSTALL_FLAG} macro appropriately.
-
-Usually, this means that, after typing @samp{cd gcc}, you
-would type @samp{touch f77-install-ok}.
-
-When you enable installation of @code{f77}, either a link to or a
-direct copy of the @code{g77} command is made.
-Similarly, @file{f77.1} is installed as a man page.
-
-(The @code{uninstall} target in the @file{gcc/Makefile} also tests
-this macro and file, when invoked, to determine whether to delete the
-installed copies of @code{f77} and @file{f77.1}.)
-
-@emph{Note:} No attempt is yet made
-to install a program (like a shell script) that provides
-compatibility with any other @code{f77} programs.
-Only the most rudimentary invocations of @code{f77} will
-work the same way with @code{g77}.
-
-@node Installing f2c
-@subsection Installing @code{f2c}
-
-Currently, @code{g77} does not include @code{f2c} itself in its
-distribution.
-However, it does include a modified version of the @code{libf2c}.
-This version is normally compatible with @code{f2c}, but has been
-modified to meet the needs of @code{g77} in ways that might possibly
-be incompatible with some versions or configurations of @code{f2c}.
-
-Decide how installation of @code{g77} should affect any existing installation
-of @code{f2c} on your system.
-
-@pindex f2c
-@pindex f2c.h
-@pindex libf2c.a
-@pindex libF77.a
-@pindex libI77.a
-If you do not have @code{f2c} on your system (e.g. no @file{/usr/bin/f2c},
-no @file{/usr/include/f2c.h}, and no @file{/usr/lib/libf2c.a},
-@file{/usr/lib/libF77.a}, or @file{/usr/lib/libI77.a}), you don't need to
-be concerned with this item.
-
-If you do have @code{f2c} on your system, you need to decide how users
-of @code{f2c} will be affected by your installing @code{g77}.
-Since @code{g77} is
-currently designed to be object-code-compatible with @code{f2c} (with
-very few, clear exceptions), users of @code{f2c} might want to combine
-@code{f2c}-compiled object files with @code{g77}-compiled object files in a
-single executable.
-
-To do this, users of @code{f2c} should use the same copies of @file{f2c.h} and
-@file{libf2c.a} that @code{g77} uses (and that get built as part of
-@code{g77}).
-
-If you do nothing here, the @code{g77} installation process will not
-overwrite the @file{include/f2c.h} and @file{lib/libf2c.a} files with its
-own versions, and in fact will not even install @file{libf2c.a} for use
-with the newly installed versions of @code{gcc} and @code{g77} if it sees
-that @file{lib/libf2c.a} exists---instead, it will print an explanatory
-message and skip this part of the installation.
-
-@pindex f2c-install-ok
-@vindex F2C_INSTALL_FLAG
-To install @code{g77}'s versions of @file{f2c.h} and @file{libf2c.a}
-in the appropriate
-places, create the file @file{f2c-install-ok} (e.g. via the UNIX
-command @samp{touch f2c-install-ok}) in the source or build top-level
-directory (the same directory in which the @code{g77} @file{f} directory
-resides, not the @file{f} directory itself), or edit @file{gcc/f/Make-lang.in}
-and change the definition of the @samp{F2C_INSTALL_FLAG} macro appropriately.
-
-Usually, this means that, after typing @samp{cd gcc}, you
-would type @samp{touch f2c-install-ok}.
-
-Make sure that when you enable the overwriting of @file{f2c.h}
-and @file{libf2c.a}
-as used by @code{f2c}, you have a recent and properly configured version of
-@file{bin/f2c} so that it generates code that is compatible with @code{g77}.
-
-@pindex f2c-exists-ok
-@vindex F2CLIBOK
-If you don't want installation of @code{g77} to overwrite @code{f2c}'s existing
-installation, but you do want @code{g77} installation to proceed with
-installation of its own versions of @file{f2c.h} and @file{libf2c.a} in places
-where @code{g77} will pick them up (even when linking @code{f2c}-compiled
-object files---which might lead to incompatibilities), create
-the file @file{f2c-exists-ok} (e.g. via the UNIX command
-@samp{touch f2c-exists-ok}) in the source or build top-level directory,
-or edit @file{gcc/f/Make-lang.in} and change the definition of the
-@samp{F2CLIBOK} macro appropriately.
-
-@node Patching GNU Fortran
-@subsection Patching GNU Fortran
-
-If you're using a SunOS4 system, you'll need to make the following
-change to @file{gcc/f/proj.h}: edit the line reading
-
-@example
-#define FFEPROJ_STRTOUL 1 @dots{}
-@end example
-
-@noindent
-by replacing the @samp{1} with @samp{0}.
-Or, you can avoid editing the source by adding
-@example
-CFLAGS='-DFFEPROJ_STRTOUL=0 -g -O'
-@end example
-to the command line for @code{make} when you invoke it.
-(@samp{-g} is the default for @samp{CFLAGS}.)
-
-This causes a minimal version of @code{strtoul()} provided
-as part of the @code{g77} distribution to be compiled and
-linked into whatever @code{g77} programs need it, since
-some systems (like SunOS4 with only the bundled compiler and its
-runtime) do not provide this function in their system libraries.
-
-Similarly, a minimal version of @code{bsearch()} is available
-and can be enabled by editing a line similar to the one
-for @code{strtoul()} above in @file{gcc/f/proj.h}, if
-your system libraries lack @code{bsearch()}.
-The method of overriding @samp{X_CFLAGS} may also be used.
-
-These are not problems with @code{g77}, which requires an
-ANSI C environment.
-You should upgrade your system to one that provides
-a full ANSI C environment, or encourage the maintainers
-of @code{gcc} to provide one to all @code{gcc}-based
-compilers in future @code{gcc} distributions.
-
-@xref{Problems Installing}, for more information on
-why @code{strtoul()} comes up missing and on approaches
-to dealing with this problem that have already been tried.
+@c @pindex config-lang.in
+@c @emph{Note:} @code{g77}'s configuration file @file{gcc/f/config-lang.in}
+@c sometimes ensures that the source code for the version of @code{gcc}
+@c being configured has at least one indication of being an appropriate
+@c version as required specifically by @code{g77}.
+@c This configuration-time
+@c checking should catch failures to use the proper version of @code{gcc} and,
+@c if so caught, should abort the configuration with an explanation.
+@c @emph{Please} do not try to disable this check,
+@c otherwise @code{g77} might well appear to build
+@c and install correctly, and even appear to compile correctly,
+@c but could easily produce broken code.
@node Where to Install
@subsection Where in the World Does Fortran (and GNU CC) Go?
@@ -1472,8 +1333,8 @@ binaries to be installed after they're built,
because this information is given to the configuration
tool and used during the build itself.
-A @code{g77} installation necessarily requires installation of
-a @code{g77}-aware version of @code{gcc}, so that the @code{gcc}
+A @code{g77} installation normally includes installation of
+a Fortran-aware version of @code{gcc}, so that the @code{gcc}
command recognizes Fortran source files and knows how to compile
them.
@@ -1484,10 +1345,11 @@ version of @code{gcc} on the system.
Sometimes people make the mistake of installing @code{gcc} as
@file{/usr/local/bin/gcc},
leaving an older, non-Fortran-aware version in @file{/usr/bin/gcc}.
-(Or, the opposite happens.)@
-This can result in @code{g77} being unable to compile Fortran
-source files, because when it calls on @code{gcc} to do the
-actual compilation, @code{gcc} complains that it does not
+(Or, the opposite happens.)
+This can result in @code{gcc} being unable to compile Fortran
+source files,
+because when the older version of @code{gcc} is invoked,
+it complains that it does not
recognize the language, or the file name suffix.
So, determine whether @code{gcc} already is installed on your system,
@@ -1495,12 +1357,17 @@ and, if so, @emph{where} it is installed, and prepare to configure the
new version of @code{gcc} you'll be building so that it installs
over the existing version of @code{gcc}.
-You might want to back up your existing copy of @file{bin/gcc}, and
-the entire @file{lib/} directory, before
+You might want to back up your existing copy of @file{/usr/bin/gcc}, and
+the entire @file{/usr/lib} directory, before
you perform the actual installation (as described in this manual).
Existing @code{gcc} installations typically are
found in @file{/usr} or @file{/usr/local}.
+(This means the commands are installed in @file{/usr/bin} or
+@file{/usr/local/bin},
+the libraries in @file{/usr/lib} or @file{/usr/local/lib},
+and so on.)
+
If you aren't certain where the currently
installed version of @code{gcc} and its
related programs reside, look at the output
@@ -1528,7 +1395,9 @@ a good idea.
though in this case it is intentional that @code{g77} overwrites
@code{gcc} if it is already installed---it is unusual that
the installation process for one distribution intentionally
-overwrites a program or file installed by another distribution.)
+overwrites a program or file installed by another distribution,
+although, in this case, @code{g77} is an augmentation of the
+@code{gcc} distribution.)
Another reason to back up the existing version first,
or make sure you can restore it easily, is that it might be
@@ -1549,14 +1418,14 @@ option of @code{gcc}.
@code{gcc}.
There are two parts of @code{g77} that are configured in two
different ways---@code{g77}, which ``camps on'' to the
-@code{gcc} configuration mechanism, and @code{libf2c}, which
+@code{gcc} configuration mechanism, and @code{libg2c}, which
uses a variation of the GNU @code{autoconf} configuration
system.
Generally, you shouldn't have to be concerned with
-either @code{g77} or @code{libf2c} configuration, unless
+either @code{g77} or @code{libg2c} configuration, unless
you're configuring @code{g77} as a cross-compiler.
-In this case, the @code{libf2c} configuration, and possibly the
+In this case, the @code{libg2c} configuration, and possibly the
@code{g77} and @code{gcc} configurations as well,
might need special attention.
(This also might be the case if you're porting @code{gcc} to
@@ -1570,22 +1439,31 @@ Pay special attention to the @samp{--prefix=} option, which
you almost certainly will need to specify.
(Note that @code{gcc} installation information is provided
-as a straight text file in @file{gcc/INSTALL}.)
+as a plain-text file in @file{gcc/INSTALL}.)
The information printed by the invocation of @file{./configure}
should show that the @file{f} directory (the Fortran language)
has been configured.
If it does not, there is a problem.
-@emph{Note:} Configuring with the @samp{--srcdir} argument is known
-to work with GNU @code{make}, but it is not known to work with
-other variants of @code{make}.
+@emph{Note:} Configuring with the @samp{--srcdir} argument,
+or by starting in an empty directory
+and typing a command such as @kbd{../gcc/configure} to
+build with separate build and source directories,
+is known to work with GNU @code{make},
+but it is known to not work with other variants of @code{make}.
Irix5.2 and SunOS4.1 versions of @code{make} definitely
won't work outside the source directory at present.
-@code{g77}'s
-portion of the @file{configure} script issues a warning message
-about this when you configure for building binaries outside
-the source directory.
+
+@code{g77}'s portion of the @file{configure} script
+used to issue a warning message about this
+when configuring for building binaries outside the source directory,
+but no longer does this as of version 0.5.23.
+
+Instead, @code{g77} simply rejects most common attempts
+to build it using a non-GNU @code{make} when the
+build directory is not the same as the source directory,
+issuing an explanatory diagnostic.
@node Building gcc
@subsection Building GNU CC
@@ -1604,14 +1482,14 @@ removing @samp{c} or @samp{f77} from the definition of the
@samp{LANGUAGES} macro.
After configuring @code{gcc}, which configures @code{g77} and
-@code{libf2c} automatically, you're ready to start the actual
+@code{libg2c} automatically, you're ready to start the actual
build by invoking @code{make}.
@pindex configure
-@emph{Note:} You @strong{must} have run @file{./configure}
-before you run @code{make}, even if you're
-using an already existing @code{gcc} development directory, because
-@file{./configure} does the work to recognize that you've added
+@emph{Note:} You @strong{must} have run the @file{configure}
+script in @code{gcc} before you run @code{make},
+even if you're using an already existing @code{gcc} development directory,
+because @file{./configure} does the work to recognize that you've added
@code{g77} to the configuration.
There are two general approaches to building GNU CC from
@@ -1699,21 +1577,14 @@ you want to build as part of building @code{g77},
you can save time and disk space by doing a straight
build.
-To build just the C and Fortran compilers and the
+To build just the compilers along with the
necessary run-time libraries, issue the following
command:
@example
-make -k CC=gcc LANGUAGES=f77 all g77
+make -k CC=gcc
@end example
-(The @samp{g77} target is necessary because the @code{gcc}
-build procedures apparently do not automatically build
-command drivers for languages in subdirectories.
-It's the @samp{all} target that triggers building
-everything except, apparently, the @code{g77} command
-itself.)
-
If you run into problems using this method, you have
two options:
@@ -1734,6 +1605,7 @@ However, understand that many problems preventing a
straight build from working are not @code{g77} problems,
and, in such cases, are not likely to be addressed in
future versions of @code{g77}.
+Consider treating them as @code{gcc} bugs instead.
@node Pre-installation Checks
@subsection Pre-installation Checks
@@ -1749,52 +1621,51 @@ printed by them when they work:
@example
sh# @kbd{cd /usr/src/gcc}
-sh# @kbd{./g77 --driver=./xgcc -B./ -v}
-g77 version 0.5.21
- ./xgcc -B./ -v -fnull-version -o /tmp/gfa18047 @dots{}
+sh# @kbd{./g77 -B./ -v}
+g77 version @value{version-g77}
+Driving: ./g77 -B./ -v -c -xf77-version /dev/null -xnone
Reading specs from ./specs
-gcc version 2.7.2.3.f.1
- ./cpp -lang-c -v -isystem ./include -undef @dots{}
-GNU CPP version 2.7.2.3.f.1 (Linux/Alpha)
+gcc version @value{version-gcc}
+ cpp -lang-c -v -isystem ./include -undef -D__GNUC__=2 @dots{}
+GNU CPP version @value{version-gcc} (Alpha GNU/Linux with ELF)
#include "..." search starts here:
#include <...> search starts here:
- ./include
- /usr/local/include
- /usr/alpha-unknown-linux/include
- /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.3.f.1/include
+ include
+ /usr/alpha-linux/include
+ /usr/lib/gcc-lib/alpha-linux/@value{version-gcc}/include
/usr/include
End of search list.
- ./f771 /tmp/cca18048.i -fset-g77-defaults -quiet -dumpbase @dots{}
-GNU F77 version 2.7.2.3.f.1 (Linux/Alpha) compiled @dots{}
-GNU Fortran Front End version 0.5.21 compiled: @dots{}
- as -nocpp -o /tmp/cca180481.o /tmp/cca18048.s
- ld -G 8 -O1 -o /tmp/gfa18047 /usr/lib/crt0.o -L. @dots{}
-__G77_LIBF77_VERSION__: 0.5.21
-@@(#)LIBF77 VERSION 19970404
-__G77_LIBI77_VERSION__: 0.5.21
-@@(#) LIBI77 VERSION pjw,dmg-mods 19970816
-__G77_LIBU77_VERSION__: 0.5.21
-@@(#) LIBU77 VERSION 19970609
+ ./f771 -fnull-version -quiet -dumpbase g77-version.f -version @dots{}
+GNU F77 version @value{version-gcc} (alpha-linux) compiled @dots{}
+GNU Fortran Front End version @value{version-g77}
+ as -nocpp -o /tmp/cca14485.o /tmp/cca14485.s
+ ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 @dots{}
+ /tmp/cca14485
+__G77_LIBF77_VERSION__: @value{version-g77}
+@@(#)LIBF77 VERSION 19970919
+__G77_LIBI77_VERSION__: @value{version-g77}
+@@(#) LIBI77 VERSION pjw,dmg-mods 19980405
+__G77_LIBU77_VERSION__: @value{version-g77}
+@@(#) LIBU77 VERSION 19970919
sh# @kbd{./xgcc -B./ -v -o /tmp/delete-me -xc /dev/null -xnone}
Reading specs from ./specs
-gcc version 2.7.2.3.f.1
+gcc version @value{version-gcc}
./cpp -lang-c -v -isystem ./include -undef @dots{}
-GNU CPP version 2.7.2.3.f.1 (Linux/Alpha)
+GNU CPP version @value{version-gcc} (Alpha GNU/Linux with ELF)
#include "..." search starts here:
#include <...> search starts here:
- ./include
- /usr/local/include
- /usr/alpha-unknown-linux/include
- /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.3.f.1/include
+ include
+ /usr/alpha-linux/include
+ /usr/lib/gcc-lib/alpha-linux/@value{version-gcc}/include
/usr/include
End of search list.
./cc1 /tmp/cca18063.i -quiet -dumpbase null.c -version @dots{}
-GNU C version 2.7.2.3.f.1 (Linux/Alpha) compiled @dots{}
+GNU C version @value{version-gcc} (alpha-linux) compiled @dots{}
as -nocpp -o /tmp/cca180631.o /tmp/cca18063.s
- ld -G 8 -O1 -o /tmp/delete-me /usr/lib/crt0.o -L. @dots{}
-/usr/lib/crt0.o: In function `__start':
-crt0.S:110: undefined reference to `main'
-/usr/lib/crt0.o(.lita+0x28): undefined reference to `main'
+ ld -m elf64alpha -G 8 -O1 -dynamic-linker /lib/ld-linux.so.2 @dots{}
+/usr/lib/crt1.o: In function `_start':
+../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
+../sysdeps/alpha/elf/start.S:77: undefined reference to `main'
sh#
@end example
@@ -1823,7 +1694,7 @@ and @code{g77}, use the following commands to invoke them.
To invoke @code{g77}, type:
@example
-/usr/src/gcc/g77 --driver=/usr/src/gcc/xgcc -B/usr/src/gcc/ @dots{}
+/usr/src/gcc/g77 -B/usr/src/gcc/ @dots{}
@end example
To invoke @code{gcc}, type:
@@ -1842,7 +1713,7 @@ After configuring, building, and testing @code{g77} and @code{gcc},
when you are ready to install them on your system, type:
@example
-make -k CC=gcc LANGUAGES=f77 install
+make -k CC=gcc install
@end example
As described in @ref{Installation,,Installing GNU CC,
@@ -1858,23 +1729,33 @@ supply the same definitions you used when building
the final stage) or if you deviated from the
instructions for a straight build.
-If the above command does not install @file{libf2c.a}
+If the above command does not install @file{libg2c.a}
as expected, try this:
@example
-make -k @dots{} install install-libf77 install-f2c-all
+make -k @dots{} install install-libf77
@end example
We don't know why some non-GNU versions of @code{make} sometimes
require this alternate command, but they do.
-(Remember to supply the appropriate definitions for @samp{CC} and
-@samp{LANGUAGES} where you see @samp{@dots{}} in the above command.)
+(Remember to supply the appropriate definition for @samp{CC}
+where you see @samp{@dots{}} in the above command.)
Note that using the @samp{-k} option tells @code{make} to
continue after some installation problems, like not having
@code{makeinfo} installed on your system.
It might not be necessary for your system.
+@emph{Note:} @code{g77} no longer installs
+files not directly part of @code{g77},
+such as @file{/usr/bin/f77}, @file{/usr/lib/libf2c.a},
+and @file{/usr/include/f2c.h}, or their
+@file{/usr/local} equivalents.
+
+@xref{Distributing Binaries}, for information on
+how to accommodate systems with no existing non-@code{g77}
+@code{f77} compiler and systems with @code{f2c} installed.
+
@node Updating Documentation
@subsection Updating Your Info Directory
@cindex updating info directory
@@ -1887,86 +1768,211 @@ It might not be necessary for your system.
As part of installing @code{g77}, you should make sure users
of @code{info} can easily access this manual on-line.
-Do this by making sure a line such as the following exists
-in @file{/usr/info/dir}, or in whatever file is the top-level
-file in the @code{info} directory on your system (perhaps
-@file{/usr/local/info/dir}:
-@example
-* g77: (g77). The GNU Fortran programming language.
-@end example
-
-If the menu in @file{dir} is organized into sections, @code{g77}
-probably belongs in a section with a name such as one of
-the following:
+@code{g77} does this automatically by
+invoking the @code{install-info} command
+when you use @samp{make install} to install @code{g77}.
+
+If that fails, or if the @code{info} directory
+it updates is not the one normally accessed by users,
+consider invoking it yourself.
+For example:
+
+@smallexample
+install-info --info-dir=/usr/info /usr/info/g77.info
+@end smallexample
+
+The above example assumes the @code{g77} documentation
+already is installed in @file{/usr/info}
+and that @file{/usr/info/dir} is the file
+you wish to update.
+Adjust the command accordingly,
+if those assumptions are wrong.
+
+@node Missing tools?
+@subsection Missing tools?
+@cindex command missing
+@cindex command not found
+@cindex file not found
+@cindex not found
+
+A build of @code{gcc} might fail due to one or more tools
+being called upon by @code{make}
+(during the build or install process),
+when those tools are not installed on your system.
+
+This situation can result from any of the following actions
+(performed by you or someone else):
@itemize @bullet
@item
-Fortran Programming
+Changing the source code or documentation yourself
+(as a developer or technical writer).
@item
-Writing Programs
+Applying a patch that changes the source code or documentation
+(including, sometimes, the official patches distributed by
+the FSF).
@item
-Programming Languages
+Deleting the files that are created by the (missing) tools.
-@item
-Languages Other Than C
+The @samp{make maintainer-clean} command is supposed
+to delete these files, so invoking this command without
+having all the appropriate tools installed is not recommended.
@item
-Scientific/Engineering Tools
+Creating the source directory using a method that
+does not preserve the date-time-modified information
+in the original distribution.
-@item
-GNU Compilers
+For example, the UNIX @samp{cp -r} command copies a
+directory tree without preserving the date-time-modified
+information.
+Use @samp{cp -pr} instead.
@end itemize
+The reason these activities cause @code{make} to try and
+invoke tools that it probably wouldn't when building
+from a perfectly ``clean'' source directory containing
+@code{gcc} and @code{g77} is that some files in the
+source directory (and the corresponding distribution)
+aren't really source files, but @emph{derived} files
+that are produced by running tools with the corresponding
+source files as input.
+These derived files @dfn{depend}, in @code{make} terminology,
+on the corresponding source files.
+
+@code{make} determines that a file that depends on another
+needs to be updated if the date-time-modified information for
+the source file shows that it is newer than the corresponding
+information for the derived file.
+
+If it makes that determination, @code{make} runs the appropriate
+commands (specified in the ``Makefile'') to update the
+derived file, and this process typically calls upon one or
+more installed tools to do the work.
+
+The ``safest'' approach to dealing with this situation
+is to recreate the @code{gcc} and @code{g77} source
+directories from complete @code{gcc} and @code{g77} distributions
+known to be provided by the FSF.
+
+Another fairly ``safe'' approach is to simply install
+the tools you need to complete the build process.
+This is especially appropriate if you've changed the
+source code or applied a patch to do so.
+
+However, if you're certain that the problem is limited
+entirely to incorrect date-time-modified information,
+that there are no discrepancies between the contents of
+source files and files derived from them in the source
+directory, you can often update the date-time-modified
+information for the derived files to work around the
+problem of not having the appropriate tools installed.
+
+On UNIX systems, the simplest way to update the date-time-modified
+information of a file is to use the use the @samp{touch}
+command.
+
+How to use @samp{touch} to update the derived files
+updated by each of the tools is described below.
+@emph{Note:} New versions of @code{g77} might change the set of
+files it generates by invoking each of these tools.
+If you cannot figure
+out for yourself how to handle such a situation, try an
+older version of @code{g77} until you find someone who can
+(or until you obtain and install the relevant tools).
+
+@menu
+* autoconf: Missing autoconf?.
+* bison: Missing bison?.
+* gperf: Missing gperf?.
+* makeinfo: Missing makeinfo?.
+@end menu
+
+@node Missing autoconf?
+@subsubsection Missing @code{autoconf}?
+@cindex @code{autoconf}
+@cindex missing @code{autoconf}
+
+If you cannot install @code{autoconf}, make sure you have started
+with a @emph{fresh} distribution of @code{gcc} and @code{g77},
+do @emph{not} do @samp{make maintainer-clean}, and, to ensure that
+@code{autoconf} is not invoked by @code{make} during the build,
+type these commands:
+
+@example
+sh# @kbd{cd gcc/f/runtime}
+sh# @kbd{touch configure libU77/configure}
+sh# @kbd{cd ../../..}
+sh#
+@end example
+
@node Missing bison?
-@subsection Missing @code{bison}?
+@subsubsection Missing @code{bison}?
@cindex @code{bison}
@cindex missing @code{bison}
If you cannot install @code{bison}, make sure you have started
with a @emph{fresh} distribution of @code{gcc}, do @emph{not}
-do @samp{make maintainer-clean} (in other versions of @code{gcc},
-this was called @samp{make realclean}), and, to ensure that
+do @samp{make maintainer-clean}, and, to ensure that
@code{bison} is not invoked by @code{make} during the build,
type these commands:
@example
sh# @kbd{cd gcc}
-sh# @kbd{touch c-parse.c c-parse.h cexp.c}
+sh# @kbd{touch bi-parser.c bi-parser.h c-parse.c c-parse.h cexp.c}
sh# @kbd{touch cp/parse.c cp/parse.h objc-parse.c}
+sh# @kbd{cd ..}
sh#
@end example
-These commands update the date-time-modified information for
-all the files produced by the various invocations of @code{bison}
-in the current versions of @code{gcc}, so that @code{make} no
-longer believes it needs to update them.
-All of these files should already exist in a @code{gcc}
-distribution, but the application of patches to upgrade
-to a newer version can leave the modification information
-set such that the @code{bison} input files look more ``recent''
-than the corresponding output files.
-
-@emph{Note:} New versions of @code{gcc} might change the set of
-files it generates by invoking @code{bison}---if you cannot figure
-out for yourself how to handle such a situation, try an
-older version of @code{gcc} until you find someone who can
-(or until you obtain and install @code{bison}).
+@node Missing gperf?
+@subsubsection Missing @code{gperf}?
+@cindex @code{gperf}
+@cindex missing @code{gperf}
+
+If you cannot install @code{gperf}, make sure you have started
+with a @emph{fresh} distribution of @code{gcc}, do @emph{not}
+do @samp{make maintainer-clean}, and, to ensure that
+@code{gperf} is not invoked by @code{make} during the build,
+type these commands:
+
+@example
+sh# @kbd{cd gcc}
+sh# @kbd{touch c-gperf.h}
+sh# @kbd{cd ..}
+sh#
+@end example
@node Missing makeinfo?
-@subsection Missing @code{makeinfo}?
+@subsubsection Missing @code{makeinfo}?
@cindex @code{makeinfo}
@cindex missing @code{makeinfo}
+@cindex @code{libg2c.a} not found
+@cindex missing @code{libg2c.a}
+
+If @code{makeinfo} is needed but unavailable
+when installing (via @code{make install}),
+some files, like @file{libg2c.a},
+might not be installed,
+because once @code{make} determines that it cannot
+invoke @code{makeinfo}, it cancels any further processing.
-If you cannot install @code{makeinfo}, either use the @code{-k} option when
-invoking make to specify any of the @samp{install} or related targets,
-or specify @samp{MAKEINFO=echo} on the @code{make} command line.
+If you cannot install @code{makeinfo}, an easy work-around is to
+specify @samp{MAKEINFO=true} on the @code{make} command line,
+or to specify the @samp{-k} option (@kbd{make -k install}).
-If you fail to do one of these things, some files, like @file{libf2c.a},
-might not be installed, because the failed attempt by @code{make} to
-invoke @code{makeinfo} causes it to cancel any further processing.
+Another approach is to force the relevant files to be up-to-date
+by typing these commands and then re-trying the installation step:
+
+@example
+sh# @kbd{cd gcc}
+sh# @kbd{touch f/g77.info f/BUGS f/INSTALL f/NEWS}
+sh# @kbd{cd ..}
+sh#
+@end example
@node Distributing Binaries
@section Distributing Binaries
@@ -1987,37 +1993,87 @@ where @code{g77} could be considered the native compiler for Fortran and
in @file{/usr/bin} instead of @file{/usr/local/bin}.
Specify the
@samp{--prefix=/usr} option when running @file{./configure}.
-You might
-also want to set up the distribution so the @code{f77} command is a
-link to @code{g77}---just make an empty file named @file{f77-install-ok} in
-the source or build directory (the one in which the @file{f} directory
-resides, not the @file{f} directory itself) when you specify one of the
-@file{install} or @file{uninstall} targets in a @code{make} command.
-
-For a system that might already have @code{f2c} installed, you definitely
-will want to make another empty file (in the same directory) named
-either @file{f2c-exists-ok} or @file{f2c-install-ok}.
-Use the former if you
-don't want your distribution to overwrite @code{f2c}-related files in existing
-systems; use the latter if you want to improve the likelihood that
-users will be able to use both @code{f2c} and @code{g77} to compile code for a
-single program without encountering link-time or run-time
-incompatibilities.
-
-(Make sure you clearly document, in the ``advertising'' for
+
+You might also want to set up the distribution
+so the @file{f77} command is a link to @file{g77},
+although a script that accepts ``classic'' UNIX @code{f77}
+options and translates the command-line to the
+appropriate @code{g77} command line would be more appropriate.
+If you do this, @emph{please} also provide a ``man page'' in
+@file{man/man1/f77.1} describing the command.
+(A link to @file{man/man1/g77.1} is appropriate
+if @file{bin/f77} is a link to @file{bin/g77}.)
+
+For a system that might already have @code{f2c} installed,
+consider whether inter-operation with @code{g77} will be
+important to users of @code{f2c} on that system.
+If you want to improve the likelihood
+that users will be able to use both @code{f2c} and @code{g77}
+to compile code for a single program
+without encountering link-time or run-time incompatibilities,
+make sure that,
+whenever they intend to combine @code{f2c}-produced code
+with @code{g77}-produced code in an executable, they:
+
+@itemize @bullet
+@item
+Use the @file{lib/gcc-lib/@dots{}/include/g2c.h} file
+generated by the @code{g77} build
+in place of the @file{f2c.h} file
+that normally comes with @code{f2c}
+(or versions of @code{g77} prior to 0.5.23)
+when compiling @emph{all} of the @code{f2c}-produced C code
+
+@item
+Link to the @code{lib/gcc-lib/@dots{}/libg2c.a} library
+built by the @code{g77} build
+instead of the @file{libf2c.a} library
+that normally comes with @code{f2c}
+(or versions of @code{g77} prior to 0.5.23)
+@end itemize
+
+How you choose to effect the above depends on whether
+the existing installation of @code{f2c} must be
+maintained.
+
+In any case, it is important to try and ensure that
+the installation keeps working properly even after
+subsequent re-installation of @code{f2c},
+which probably involves overwriting
+@file{/usr/local/lib/libf2c.a} and
+@file{/usr/local/include/f2c.h},
+or similar.
+
+At least, copying @file{libg2c.a} and @file{g2c.h} into
+the appropriate ``public'' directories
+allows users to more easily select the version of
+@code{libf2c} they wish to use for a particular
+build.
+The names are changed by @code{g77} to make this
+coexistence easier to maintain;
+even if @code{f2c} is installed later,
+the @code{g77} files normally installed
+by its installation process aren't disturbed.
+Use of symbolic links from one set of files to
+another might result in problems after a subsequent
+reinstallation of either @code{f2c} or @code{g77},
+so be sure to alert users of your distribution
+accordingly.
+
+(Make sure you clearly document, in the description of
your distribution, how installation of your distribution will
affect existing installations of @code{gcc}, @code{f2c},
@code{f77}, @file{libf2c.a}, and so on.
Similarly, you should clearly document any requirements
-you assume are met by users of your distribution.)
+you assume will be met by users of your distribution.)
For other systems with native @code{f77} (and @code{cc}) compilers,
configure @code{g77} as you (or most of your audience) would
configure @code{gcc} for their installations.
-Typically this is for installation in
-@file{/usr/local}, and would not include a copy of
-@code{g77} named @code{f77}, so
-users could still use the native @code{f77}.
+Typically this is for installation in @file{/usr/local},
+and would not include a new version of @file{/usr/bin/f77}
+or @file{/usr/local/bin/f77},
+so users could still use the native @code{f77}.
In any case, for @code{g77} to work properly, you @strong{must} ensure
that the binaries you distribute include:
@@ -2027,20 +2083,14 @@ that the binaries you distribute include:
This is the command most users use to compile Fortran.
@item bin/gcc
-This is the command all users use to compile Fortran, either
-directly or indirectly via the @code{g77} command.
+This is the command some users use to compile Fortran,
+typically when compiling programs written in other languages
+at the same time.
The @file{bin/gcc} executable file must have been built
from a @code{gcc} source tree into which a @code{g77} source
tree was merged and configured, or it will not know how
to compile Fortran programs.
-@item bin/f77
-In installations with no non-GNU native Fortran
-compiler, this is the same as @file{bin/g77}.
-Otherwise, it should be omitted from the distribution,
-so the one on already on a particular system does
-not get overwritten.
-
@item info/g77.info*
This is the documentation for @code{g77}.
If it is not included, users will have trouble understanding
@@ -2063,42 +2113,45 @@ easily.
@item man/man1/g77.1
This is the short man page for @code{g77}.
-It is out of date, but you might as well include it
-for people who really like man pages.
+It is not always kept up-to-date,
+but you might as well include it
+for people who really like ``man'' pages.
-@item man/man1/f77.1
-In installations where @code{f77} is the same as @code{g77},
-this is the same as @file{man/man1/g77.1}.
-Otherwise, it should be omitted from the distribution,
-so the one already on a particular system does not
-get overwritten.
+@cindex gcc-lib directory
+@cindex directories, gcc-lib
+@item lib/gcc-lib
+This is the directory containing the ``private'' files
+installed by and for @code{gcc}, @code{g77}, @code{g++},
+and other GNU compilers.
@item lib/gcc-lib/@dots{}/f771
This is the actual Fortran compiler.
-@item lib/gcc-lib/@dots{}/libf2c.a
+@item lib/gcc-lib/@dots{}/libg2c.a
This is the run-time library for @code{g77}-compiled programs.
@end table
Whether you want to include the slightly updated (and possibly
-improved) versions of @code{cc1}, @code{cc1plus}, and whatever other
+improved) versions of @file{cc1}, @file{cc1plus}, and whatever other
binaries get rebuilt with the changes the GNU Fortran distribution
makes to the GNU back end, is up to you.
-These changes are
-highly unlikely to break any compilers, and it is possible
-they'll fix back-end bugs that can be demonstrated using front
-ends other than GNU Fortran's.
+These changes are highly unlikely to break any compilers,
+because they involve doing things like adding to the
+list of acceptable compiler options
+(so, for example, @file{cc1plus} accepts, and ignores,
+options that only @file{f771} actually processes).
Please assure users that unless
they have a specific need for their existing,
-older versions of @code{gcc} command,
+older versions of @file{gcc} command,
they are unlikely to experience any problems by overwriting
it with your version---though they could certainly protect
themselves by making backup copies first!
+
Otherwise, users might try and install your binaries
in a ``safe'' place, find they cannot compile Fortran
programs with your distribution (because, perhaps, they're
-picking up their old version of the @code{gcc} command,
+invoking their old version of the @file{gcc} command,
which does not recognize Fortran programs), and assume
that your binaries (or, more generally, GNU Fortran
distributions in general) are broken, at least for their
diff --git a/gcc/f/g77spec.c b/gcc/f/g77spec.c
index c45b1808418..79d36379a71 100644
--- a/gcc/f/g77spec.c
+++ b/gcc/f/g77spec.c
@@ -18,38 +18,242 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "config.h"
+/* This file contains a filter for the main `gcc' driver, which is
+ replicated for the `g77' driver by adding this filter. The purpose
+ of this filter is to be basically identical to gcc (in that
+ it faithfully passes all of the original arguments to gcc) but,
+ unless explicitly overridden by the user in certain ways, ensure
+ that the needs of the language supported by this wrapper are met.
-#include <sys/types.h>
-#include <stdio.h>
+ For GNU Fortran (g77), we do the following to the argument list
+ before passing it to `gcc':
-#include "gansidecl.h"
+ 1. Make sure `-lg2c -lm' is at the end of the list.
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+ 2. Make sure each time `-lg2c' or `-lm' is seen, it forms
+ part of the series `-lg2c -lm'.
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
+ #1 and #2 are not done if `-nostdlib' or any option that disables
+ the linking phase is present, or if `-xfoo' is in effect. Note that
+ a lack of source files or -l options disables linking.
-/* This bit is set if we saw a `-xfoo' language specification. */
-#define LANGSPEC (1<<1)
-/* This bit is set if they did `-lm' or `-lmath'. */
-#define MATHLIB (1<<2)
-/* This bit is set if they did `-lc'. */
-#define WITHLIBC (1<<3)
+ This program was originally made out of gcc/cp/g++spec.c, but the
+ way it builds the new argument list was rewritten so it is much
+ easier to maintain, improve the way it decides to add or not add
+ extra arguments, etc. And several improvements were made in the
+ handling of arguments, primarily to make it more consistent with
+ `gcc' itself. */
+
+#include "config.h"
+#include "system.h"
+#include "gansidecl.h"
+#include <f/version.h>
#ifndef MATH_LIBRARY
#define MATH_LIBRARY "-lm"
#endif
#ifndef FORTRAN_LIBRARY
-#define FORTRAN_LIBRARY "-lf2c"
+#define FORTRAN_LIBRARY "-lg2c"
#endif
+/* Options this driver needs to recognize, not just know how to
+ skip over. */
+typedef enum
+{
+ OPTION_b, /* Aka --prefix. */
+ OPTION_B, /* Aka --target. */
+ OPTION_c, /* Aka --compile. */
+ OPTION_driver, /* Wrapper-specific option. */
+ OPTION_E, /* Aka --preprocess. */
+ OPTION_help, /* --help. */
+ OPTION_i, /* -imacros, -include, -include-*. */
+ OPTION_l,
+ OPTION_L, /* Aka --library-directory. */
+ OPTION_M, /* Aka --dependencies. */
+ OPTION_MM, /* Aka --user-dependencies. */
+ OPTION_nostdlib, /* Aka --no-standard-libraries, or
+ -nodefaultlibs. */
+ OPTION_o, /* Aka --output. */
+ OPTION_S, /* Aka --assemble. */
+ OPTION_syntax_only, /* -fsyntax-only. */
+ OPTION_v, /* Aka --verbose. */
+ OPTION_version, /* --version. */
+ OPTION_V, /* Aka --use-version. */
+ OPTION_x, /* Aka --language. */
+ OPTION_ /* Unrecognized or unimportant. */
+} Option;
+
+/* The original argument list and related info is copied here. */
+static int g77_xargc;
+static char **g77_xargv;
+static void (*g77_fn)();
+
+/* The new argument list will be built here. */
+static int g77_newargc;
+static char **g77_newargv;
+
extern char *xmalloc PROTO((size_t));
+extern char *version_string;
+
+/* --- This comes from gcc.c (2.8.1) verbatim: */
+
+/* This defines which switch letters take arguments. */
+
+#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
+ ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
+ || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
+ || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
+ || (CHAR) == 'L' || (CHAR) == 'A')
+
+#ifndef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
+#endif
+
+/* This defines which multi-letter switches take arguments. */
+
+#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \
+ (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
+ || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \
+ || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
+ || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
+ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
+ || !strcmp (STR, "isystem") || !strcmp (STR, "specs"))
+
+#ifndef WORD_SWITCH_TAKES_ARG
+#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
+#endif
+
+/* --- End of verbatim. */
+
+/* Assumes text[0] == '-'. Returns number of argv items that belong to
+ (and follow) this one, an option id for options important to the
+ caller, and a pointer to the first char of the arg, if embedded (else
+ returns NULL, meaning no arg or it's the next argv).
+
+ Note that this also assumes gcc.c's pass converting long options
+ to short ones, where available, has already been run. */
+
+static void
+lookup_option (xopt, xskip, xarg, text)
+ Option *xopt;
+ int *xskip;
+ char **xarg;
+ char *text;
+{
+ Option opt = OPTION_;
+ int skip;
+ char *arg = NULL;
+
+ if ((skip = SWITCH_TAKES_ARG (text[1])))
+ skip -= (text[2] != '\0'); /* See gcc.c. */
+
+ if (text[1] == 'B')
+ opt = OPTION_B, skip = (text[2] == '\0'), arg = text + 2;
+ else if (text[1] == 'b')
+ opt = OPTION_b, skip = (text[2] == '\0'), arg = text + 2;
+ else if ((text[1] == 'c') && (text[2] == '\0'))
+ opt = OPTION_c, skip = 0;
+ else if ((text[1] == 'E') && (text[2] == '\0'))
+ opt = OPTION_E, skip = 0;
+ else if (text[1] == 'i')
+ opt = OPTION_i, skip = 0;
+ else if (text[1] == 'l')
+ opt = OPTION_l;
+ else if (text[1] == 'L')
+ opt = OPTION_L, arg = text + 2;
+ else if (text[1] == 'o')
+ opt = OPTION_o;
+ else if ((text[1] == 'S') && (text[2] == '\0'))
+ opt = OPTION_S, skip = 0;
+ else if (text[1] == 'V')
+ opt = OPTION_V, skip = (text[2] == '\0');
+ else if ((text[1] == 'v') && (text[2] == '\0'))
+ opt = OPTION_v, skip = 0;
+ else if (text[1] == 'x')
+ opt = OPTION_x, arg = text + 2;
+ else
+ {
+ if ((skip = WORD_SWITCH_TAKES_ARG (text + 1)) != 0) /* See gcc.c. */
+ ;
+ else if (! strncmp (text, "-fdriver", 8)) /* Really --driver!! */
+ opt = OPTION_driver; /* Never mind arg, this is unsupported. */
+ else if (! strcmp (text, "-fhelp")) /* Really --help!! */
+ opt = OPTION_help;
+ else if (! strcmp (text, "-M"))
+ opt = OPTION_M;
+ else if (! strcmp (text, "-MM"))
+ opt = OPTION_MM;
+ else if (! strcmp (text, "-nostdlib")
+ || ! strcmp (text, "-nodefaultlibs"))
+ opt = OPTION_nostdlib;
+ else if (! strcmp (text, "-fsyntax-only"))
+ opt = OPTION_syntax_only;
+ else if (! strcmp (text, "-dumpversion"))
+ opt = OPTION_version;
+ else if (! strcmp (text, "-Xlinker")
+ || ! strcmp (text, "-specs"))
+ skip = 1;
+ else
+ skip = 0;
+ }
+
+ if (xopt != NULL)
+ *xopt = opt;
+ if (xskip != NULL)
+ *xskip = skip;
+ if (xarg != NULL)
+ {
+ if ((arg != NULL)
+ && (arg[0] == '\0'))
+ *xarg = NULL;
+ else
+ *xarg = arg;
+ }
+}
+
+/* Append another argument to the list being built. As long as it is
+ identical to the corresponding arg in the original list, just increment
+ the new arg count. Otherwise allocate a new list, etc. */
+
+static void
+append_arg (arg)
+ char *arg;
+{
+ static int newargsize;
+
+#if 0
+ fprintf (stderr, "`%s'\n", arg);
+#endif
+
+ if (g77_newargv == g77_xargv
+ && g77_newargc < g77_xargc
+ && (arg == g77_xargv[g77_newargc]
+ || ! strcmp (arg, g77_xargv[g77_newargc])))
+ {
+ ++g77_newargc;
+ return; /* Nothing new here. */
+ }
+
+ if (g77_newargv == g77_xargv)
+ { /* Make new arglist. */
+ int i;
+
+ newargsize = (g77_xargc << 2) + 20; /* This should handle all. */
+ g77_newargv = (char **) xmalloc (newargsize * sizeof (char *));
+
+ /* Copy what has been done so far. */
+ for (i = 0; i < g77_newargc; ++i)
+ g77_newargv[i] = g77_xargv[i];
+ }
+
+ if (g77_newargc == newargsize)
+ (*g77_fn) ("overflowed output arg list for `%s'", arg);
+
+ g77_newargv[g77_newargc++] = arg;
+}
+
void
lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
void (*fn)();
@@ -57,225 +261,320 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
char ***in_argv;
int *in_added_libraries;
{
- int i, j;
+ int argc = *in_argc;
+ char **argv = *in_argv;
+ int i;
+ int verbose = 0;
+ Option opt;
+ int skip;
+ char *arg;
+
+ /* This will be NULL if we encounter a situation where we should not
+ link in libf2c. */
+ char *library = FORTRAN_LIBRARY;
+
+ /* This will become 0 if anything other than -v and kin (like -V)
+ is seen, meaning the user is trying to accomplish something.
+ If it remains nonzero, and the user wants version info, add stuff to
+ the command line to make gcc invoke all the appropriate phases
+ to get all the version info. */
+ int add_version_magic = 1;
+
+ /* 0 => -xnone in effect.
+ 1 => -xfoo in effect. */
+ int saw_speclang = 0;
- /* If non-zero, the user gave us the `-v' flag. */
- int saw_verbose_flag = 0;
+ /* 0 => initial/reset state
+ 1 => last arg was -l<library>
+ 2 => last two args were -l<library> -lm. */
+ int saw_library = 0;
- /* This will be 0 if we encounter a situation where we should not
- link in libstdf77. */
- int library = 1;
+ /* The number of input and output files in the incoming arg list. */
+ int n_infiles = 0;
+ int n_outfiles = 0;
- /* The number of arguments being added to what's in argv, other than
- libraries. We use this to track the number of times we've inserted
- -xf77/-xnone. */
- int added = 2;
+#if 0
+ fprintf (stderr, "Incoming:");
+ for (i = 0; i < argc; i++)
+ fprintf (stderr, " %s", argv[i]);
+ fprintf (stderr, "\n");
+#endif
- /* Used to track options that take arguments, so we don't go wrapping
- those with -xf77/-xnone. */
- char *quote = NULL;
+ g77_xargc = argc;
+ g77_xargv = argv;
+ g77_newargc = 0;
+ g77_newargv = argv;
+ g77_fn = fn;
- /* The new argument list will be contained in this. */
- char **arglist;
+ /* First pass through arglist.
- /* Non-zero if we saw a `-xfoo' language specification on the
- command line. Used to avoid adding our own -xf77 if the user
- already gave a language for the file. */
- int saw_speclang = 0;
+ If -nostdlib or a "turn-off-linking" option is anywhere in the
+ command line, don't do any library-option processing (except
+ relating to -x). Also, if -v is specified, but no other options
+ that do anything special (allowing -V version, etc.), remember
+ to add special stuff to make gcc command actually invoke all
+ the different phases of the compilation process so all the version
+ numbers can be seen.
- /* "-lm" or "-lmath" if it appears on the command line. */
- char *saw_math = 0;
+ Also, here is where all problems with missing arguments to options
+ are caught. If this loop is exited normally, it means all options
+ have the appropriate number of arguments as far as the rest of this
+ program is concerned. */
- /* "-lc" if it appears on the command line. */
- char *saw_libc = 0;
+ for (i = 1; i < argc; ++i)
+ {
+ if ((argv[i][0] == '+') && (argv[i][1] == 'e'))
+ {
+ add_version_magic = 0;
+ continue;
+ }
- /* An array used to flag each argument that needs a bit set for
- LANGSPEC, MATHLIB, or WITHLIBC. */
- int *args;
+ if ((argv[i][0] != '-') || (argv[i][1] == '\0'))
+ {
+ ++n_infiles;
+ add_version_magic = 0;
+ continue;
+ }
- /* By default, we throw on the math library. */
- int need_math = 1;
+ lookup_option (&opt, &skip, NULL, argv[i]);
- /* The total number of arguments with the new stuff. */
- int argc;
+ switch (opt)
+ {
+ case OPTION_nostdlib:
+ case OPTION_c:
+ case OPTION_S:
+ case OPTION_syntax_only:
+ case OPTION_E:
+ case OPTION_M:
+ case OPTION_MM:
+ /* These options disable linking entirely or linking of the
+ standard libraries. */
+ library = 0;
+ add_version_magic = 0;
+ break;
+
+ case OPTION_l:
+ ++n_infiles;
+ add_version_magic = 0;
+ break;
+
+ case OPTION_o:
+ ++n_outfiles;
+ add_version_magic = 0;
+ break;
+
+ case OPTION_v:
+ if (! verbose)
+ fprintf (stderr, "g77 version %s (from FSF-g77 version %s)\n",
+ version_string, ffe_version_string);
+ verbose = 1;
+ break;
+
+ case OPTION_b:
+ case OPTION_B:
+ case OPTION_L:
+ case OPTION_i:
+ case OPTION_V:
+ /* These options are useful in conjunction with -v to get
+ appropriate version info. */
+ break;
+
+ case OPTION_version:
+ printf ("\
+GNU Fortran %s\n\
+Copyright (C) 1997 Free Software Foundation, Inc.\n\
+For more version information on components of the GNU Fortran\n\
+compilation system, especially useful when reporting bugs,\n\
+type the command `g77 --verbose'.\n\
+\n\
+GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\
+You may redistribute copies of GNU Fortran\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the file named COPYING\n\
+or type the command `info -f g77 Copying'.\n\
+", ffe_version_string);
+ exit (0);
+ break;
+
+ case OPTION_help:
+ /* Let gcc.c handle this, as the egcs version has a really
+ cool facility for handling --help and --verbose --help. */
+ return;
+
+#if 0
+ printf ("\
+Usage: g77 [OPTION]... FORTRAN-SOURCE...\n\
+\n\
+Compile and link Fortran source code to produce an executable program,\n\
+which by default is named `a.out', and can be invoked with the UNIX\n\
+command `./a.out'.\n\
+\n\
+Options:\n\
+--debug include debugging information in executable.\n\
+--help display this help and exit.\n\
+--optimize[=LEVEL] take extra time and memory to make generated\n\
+ executable run faster. LEVEL is 0 for no\n\
+ optimization, 1 for normal optimization, and\n\
+ increases through 3 for more optimization.\n\
+--output=PROGRAM name the executable PROGRAM instead of a.out;\n\
+ invoke with the command `./PROGRAM'.\n\
+--version display version information and exit.\n\
+\n\
+Many other options exist to tailor the compilation process, specify\n\
+the dialect of the Fortran source code, specify details of the\n\
+code-generation methodology, and so on.\n\
+\n\
+For more information on g77 and gcc, type the commands `info -f g77'\n\
+and `info -f gcc' to read the Info documentation.\n\
+\n\
+Report bugs to <egcs-bugs@cygnus.org>.\n");
+ exit (0);
+ break;
+#endif
+
+ case OPTION_driver:
+ (*fn) ("--driver no longer supported", argv[i]);
+ break;
+
+ default:
+ add_version_magic = 0;
+ break;
+ }
- /* The argument list. */
- char **argv;
+ /* This is the one place we check for missing arguments in the
+ program. */
- /* The number of libraries added in. */
- int added_libraries;
+ if (i + skip < argc)
+ i += skip;
+ else
+ (*fn) ("argument to `%s' missing", argv[i]);
+ }
- /* The total number of arguments with the new stuff. */
- int num_args = 1;
+ if ((n_outfiles != 0) && (n_infiles == 0))
+ (*fn) ("No input files; unwilling to write output files");
- argc = *in_argc;
- argv = *in_argv;
- added_libraries = *in_added_libraries;
+ /* Second pass through arglist, transforming arguments as appropriate. */
- args = (int *) xmalloc (argc * sizeof (int));
- bzero ((char *) args, argc * sizeof (int));
+ append_arg (argv[0]); /* Start with command name, of course. */
- for (i = 1; i < argc; i++)
+ for (i = 1; i < argc; ++i)
{
- /* If the previous option took an argument, we swallow it here. */
- if (quote)
+ if (argv[i][0] == '\0')
{
- quote = NULL;
+ append_arg (argv[i]); /* Interesting. Just append as is. */
continue;
}
- /* We don't do this anymore, since we don't get them with minus
- signs on them. */
- if (argv[i][0] == '\0' || argv[i][1] == '\0')
- continue;
-
- if (argv[i][0] == '-')
+ if ((argv[i][0] == '-') && (argv[i][1] != 'l'))
{
- if (library != 0 && (strcmp (argv[i], "-nostdlib") == 0
- || strcmp (argv[i], "-nodefaultlibs") == 0))
- {
- library = 0;
- }
- else if (strcmp (argv[i], "-lm") == 0
- || strcmp (argv[i], "-lmath") == 0
-#ifdef ALT_LIBM
- || strcmp (argv[i], ALT_LIBM) == 0
-#endif
- )
- {
- args[i] |= MATHLIB;
- need_math = 0;
- }
- else if (strcmp (argv[i], "-lc") == 0)
- args[i] |= WITHLIBC;
- else if (strcmp (argv[i], "-v") == 0)
- {
- saw_verbose_flag = 1;
- if (argc == 2)
- {
- /* If they only gave us `-v', don't try to link in libf2c. */
- library = 0;
- }
- }
- else if (strncmp (argv[i], "-x", 2) == 0)
- saw_speclang = 1;
- else if (((argv[i][2] == '\0'
- && (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL)
- || strcmp (argv[i], "-Tdata") == 0))
- quote = argv[i];
- else if (library != 0 && ((argv[i][2] == '\0'
- && (char *) strchr ("cSEM", argv[i][1]) != NULL)
- || strcmp (argv[i], "-MM") == 0))
- {
- /* Don't specify libraries if we won't link, since that would
- cause a warning. */
- library = 0;
- added -= 2;
- }
- else
- /* Pass other options through. */
- continue;
- }
- else
- {
- int len;
+ /* Not a filename or library. */
+
+ if (saw_library == 1) /* -l<library>. */
+ append_arg (MATH_LIBRARY);
+
+ saw_library = 0;
+
+ lookup_option (&opt, &skip, &arg, argv[i]);
- if (saw_speclang)
+ if (argv[i][1] == '\0')
{
- saw_speclang = 0;
+ append_arg (argv[i]); /* "-" == Standard input. */
continue;
}
- /* If the filename ends in .c or .i, put options around it.
- But not if a specified -x option is currently active. */
- len = strlen (argv[i]);
- if (len > 2
- && (argv[i][len - 1] == 'c' || argv[i][len - 1] == 'i')
- && argv[i][len - 2] == '.')
+ if (opt == OPTION_x)
{
- args[i] |= LANGSPEC;
- added += 2;
- }
- }
- }
+ /* Track input language. */
+ char *lang;
- if (quote)
- (*fn) ("argument to `%s' missing\n", quote);
+ if (arg == NULL)
+ lang = argv[i+1];
+ else
+ lang = arg;
- /* If we know we don't have to do anything, bail now. */
- if (! added && ! library)
- {
- free (args);
- return;
- }
+ saw_speclang = (strcmp (lang, "none") != 0);
+ }
- num_args = argc + added + need_math;
- arglist = (char **) xmalloc (num_args * sizeof (char *));
+ append_arg (argv[i]);
- /* NOTE: We start at 1 now, not 0. */
- for (i = 0, j = 0; i < argc; i++, j++)
- {
- arglist[j] = argv[i];
+ for (; skip != 0; --skip)
+ append_arg (argv[++i]);
- /* Make sure -lf2c is before the math library, since libf2c
- itself uses those math routines. */
- if (!saw_math && (args[i] & MATHLIB) && library)
- {
- --j;
- saw_math = argv[i];
+ continue;
}
- if (!saw_libc && (args[i] & WITHLIBC) && library)
- {
- --j;
- saw_libc = argv[i];
- }
+ /* A filename/library, not an option. */
- /* Wrap foo.c and foo.i files in a language specification to
- force the gcc compiler driver to run cc1plus on them. */
- if (args[i] & LANGSPEC)
- {
- int len = strlen (argv[i]);
- switch (argv[i][len - 1])
+ if (saw_speclang)
+ saw_library = 0; /* -xfoo currently active. */
+ else
+ { /* -lfoo or filename. */
+ if (strcmp (argv[i], MATH_LIBRARY) == 0
+#ifdef ALT_LIBM
+ || strcmp (argv[i], ALT_LIBM) == 0
+#endif
+ )
{
- case 'F':
- arglist[j++] = "-xf77-cpp-input";
- break;
- case 'r':
- /* Don't do ratfor for ".for". */
- if (argv[i][len - 2] == '.')
- {
- arglist[j++] = "-xratfor";
- break;
- }
- default:
- arglist[j++] = "-xf77";
- break;
+ if (saw_library == 1)
+ saw_library = 2; /* -l<library> -lm. */
+ else
+ append_arg (FORTRAN_LIBRARY);
+ }
+ else if (strcmp (argv[i], FORTRAN_LIBRARY) == 0)
+ saw_library = 1; /* -l<library>. */
+ else
+ { /* Other library, or filename. */
+ if (saw_library == 1)
+ append_arg (MATH_LIBRARY);
+ saw_library = 0;
}
- arglist[j++] = argv[i];
- arglist[j] = "-xnone";
}
- }
+ append_arg (argv[i]);
+ }
- /* Add `-lf2c' if we haven't already done so. */
- if (library)
+ /* Append `-lg2c -lm' as necessary. */
+
+ if (! add_version_magic && library)
+ { /* Doing a link and no -nostdlib. */
+ if (saw_speclang)
+ append_arg ("-xnone");
+
+ switch (saw_library)
+ {
+ case 0:
+ append_arg (library);
+ case 1:
+ append_arg (MATH_LIBRARY);
+ default:
+ break;
+ }
+ }
+ else if (add_version_magic && verbose)
{
- arglist[j++] = FORTRAN_LIBRARY;
- added_libraries++;
+ append_arg ("-c");
+ append_arg ("-xf77-version");
+ append_arg ("/dev/null");
+ append_arg ("-xnone");
}
- if (saw_math)
- arglist[j++] = saw_math;
- else if (library)
+
+ if (verbose
+ && g77_newargv != g77_xargv)
{
- arglist[j++] = MATH_LIBRARY;
- added_libraries++;
+ fprintf (stderr, "Driving:");
+ for (i = 0; i < g77_newargc; i++)
+ fprintf (stderr, " %s", g77_newargv[i]);
+ fprintf (stderr, "\n");
}
- if (saw_libc)
- arglist[j++] = saw_libc;
- arglist[j] = NULL;
+ *in_argc = g77_newargc;
+ *in_argv = g77_newargv;
+}
- *in_argc = j;
- *in_argv = arglist;
- *in_added_libraries = added_libraries;
+/* Called before linking. Returns 0 on success and -1 on failure. */
+int lang_specific_pre_link () /* Not used for F77. */
+{
+ return 0;
}
+
+/* Number of extra output files that lang_specific_pre_link may generate. */
+int lang_specific_extra_outfiles = 0; /* Not used for F77. */
diff --git a/gcc/f/glimits.j b/gcc/f/glimits.j
index 9a30bdbfba1..5bf37928672 100644
--- a/gcc/f/glimits.j
+++ b/gcc/f/glimits.j
@@ -1,28 +1 @@
-/* glimits.j -- Wrapper for GCC's glimits.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#if !USE_HOST_LIMITS
-#include "glimits.h"
-#else
-#include <limits.h>
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/global.c b/gcc/f/global.c
index a1fdf3daadd..8be7d0c4c66 100644
--- a/gcc/f/global.c
+++ b/gcc/f/global.c
@@ -1,6 +1,6 @@
/* global.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -437,6 +437,20 @@ ffeglobal_pad_common (ffesymbol s, ffetargetAlign pad, ffewhereLine wl,
g->u.common.pad = pad;
g->u.common.pad_where_line = ffewhere_line_use (wl);
g->u.common.pad_where_col = ffewhere_column_use (wc);
+
+ if (pad != 0)
+ {
+ char padding[20];
+
+ sprintf (&padding[0], "%" ffetargetAlign_f "u", pad);
+ ffebad_start (FFEBAD_COMMON_INIT_PAD);
+ ffebad_string (ffesymbol_text (s));
+ ffebad_string (padding);
+ ffebad_string ((pad == 1)
+ ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
+ ffebad_here (0, wl, wc);
+ ffebad_finish ();
+ }
}
else
{
@@ -459,22 +473,15 @@ ffeglobal_pad_common (ffesymbol s, ffetargetAlign pad, ffewhereLine wl,
ffebad_here (1, g->u.common.pad_where_line, g->u.common.pad_where_col);
ffebad_finish ();
}
- }
-#endif
-
- if (pad != 0)
- { /* Warn about initial padding in common area. */
- char padding[20];
- sprintf (&padding[0], "%" ffetargetAlign_f "u", pad);
- ffebad_start (FFEBAD_COMMON_INIT_PAD);
- ffebad_string (ffesymbol_text (s));
- ffebad_string (padding);
- ffebad_string ((pad == 1)
- ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
- ffebad_here (0, wl, wc);
- ffebad_finish ();
+ if (g->u.common.pad < pad)
+ {
+ g->u.common.pad = pad;
+ g->u.common.pad_where_line = ffewhere_line_use (wl);
+ g->u.common.pad_where_col = ffewhere_column_use (wc);
+ }
}
+#endif
}
/* Collect info for a global's argument. */
@@ -616,9 +623,11 @@ ffeglobal_proc_def_arg (ffesymbol s, int argno, char *name, ffeglobalArgSummary
defwhy = "an alternate-return label";
break;
+#if 0
case FFEGLOBAL_argsummaryPTR:
defwhy = "a pointer";
break;
+#endif
default:
defwhy = "???";
@@ -868,6 +877,7 @@ ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as,
}
break;
+#if 0
case FFEGLOBAL_argsummaryPTR:
if ((ai->as != FFEGLOBAL_argsummaryPTR)
&& (ai->as != FFEGLOBAL_argsummaryNONE))
@@ -876,6 +886,7 @@ ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as,
refwhy = "a pointer";
}
break;
+#endif
default:
break;
@@ -919,9 +930,11 @@ ffeglobal_proc_ref_arg (ffesymbol s, int argno, ffeglobalArgSummary as,
defwhy = "an alternate-return label";
break;
+#if 0
case FFEGLOBAL_argsummaryPTR:
defwhy = "a pointer";
break;
+#endif
default:
defwhy = "???";
@@ -1418,7 +1431,7 @@ ffeglobal_save_common (ffesymbol s, bool save, ffewhereLine wl,
/* ffeglobal_size_common -- Establish size of COMMON area
ffesymbol s; // the common area
- long size; // size in units
+ ffetargetOffset size; // size in units
if (ffeglobal_size_common(s,size)) // new size is largest seen
In global-enabled mode, set the size if it current size isn't known or is
@@ -1429,7 +1442,7 @@ ffeglobal_save_common (ffesymbol s, bool save, ffewhereLine wl,
#if FFEGLOBAL_ENABLED
bool
-ffeglobal_size_common (ffesymbol s, long size)
+ffeglobal_size_common (ffesymbol s, ffetargetOffset size)
{
ffeglobal g;
@@ -1446,13 +1459,18 @@ ffeglobal_size_common (ffesymbol s, long size)
return TRUE;
}
- if ((g->u.common.size < size) && (g->tick > 0) && (g->tick < ffe_count_2))
+ if ((g->tick > 0) && (g->tick < ffe_count_2)
+ && (g->u.common.size < size))
{
char oldsize[40];
char newsize[40];
- sprintf (&oldsize[0], "%ld", g->u.common.size);
- sprintf (&newsize[0], "%ld", size);
+ /* Common block initialized in a previous program unit, which
+ effectively freezes its size, but now the program is trying
+ to enlarge it. */
+
+ sprintf (&oldsize[0], "%" ffetargetOffset_f "d", g->u.common.size);
+ sprintf (&newsize[0], "%" ffetargetOffset_f "d", size);
ffebad_start (FFEBAD_COMMON_ENLARGED);
ffebad_string (ffesymbol_text (s));
@@ -1484,8 +1502,8 @@ ffeglobal_size_common (ffesymbol s, long size)
that way. Warnings about differing sizes must therefore
always be issued. */
- sprintf (&oldsize[0], "%ld", g->u.common.size);
- sprintf (&newsize[0], "%ld", size);
+ sprintf (&oldsize[0], "%" ffetargetOffset_f "d", g->u.common.size);
+ sprintf (&newsize[0], "%" ffetargetOffset_f "d", size);
ffebad_start (FFEBAD_COMMON_DIFF_SIZE);
ffebad_string (ffesymbol_text (s));
@@ -1507,6 +1525,7 @@ ffeglobal_size_common (ffesymbol s, long size)
g->u.common.size = size;
return TRUE;
}
+
return FALSE;
}
diff --git a/gcc/f/global.h b/gcc/f/global.h
index ee4a41b7748..38cf8d55cfc 100644
--- a/gcc/f/global.h
+++ b/gcc/f/global.h
@@ -1,6 +1,6 @@
/* global.h -- Public #include File (module.h template V1.0)
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -55,7 +55,6 @@ typedef enum
FFEGLOBAL_argsummarySUBR, /* Subroutine (intrinsic, external). */
FFEGLOBAL_argsummaryFUNC, /* Function (intrinsic, external). */
FFEGLOBAL_argsummaryALTRTN, /* Alternate-return (label). */
- FFEGLOBAL_argsummaryPTR, /* Pointer (%LOC, LOC()). */
FFEGLOBAL_argsummaryANY,
FFEGLOBAL_argsummary
} ffeglobalArgSummary;
@@ -109,7 +108,7 @@ struct _ffeglobal_
ffewhereLine save_where_line;
ffewhereColumn save_where_col;
bool have_size; /* Size info avail for COMMON? */
- long size; /* Size info for COMMON. */
+ ffetargetOffset size; /* Size info for COMMON. */
bool blank; /* TRUE if blank COMMON. */
} common;
struct {
@@ -149,7 +148,7 @@ void ffeglobal_ref_intrinsic (ffesymbol s, ffelexToken t, bool explicit);
bool ffeglobal_ref_progunit_ (ffesymbol s, ffelexToken t, ffeglobalType type);
void ffeglobal_save_common (ffesymbol s, bool save, ffewhereLine wl,
ffewhereColumn wc);
-bool ffeglobal_size_common (ffesymbol s, long size);
+bool ffeglobal_size_common (ffesymbol s, ffetargetOffset size);
void ffeglobal_terminate_1 (void);
/* Define macros. */
@@ -165,6 +164,7 @@ void ffeglobal_terminate_1 (void);
#define ffeglobal_common_init(g) ((g)->tick != 0)
#define ffeglobal_common_have_pad(g) ((g)->u.common.have_pad)
#define ffeglobal_common_have_size(g) ((g)->u.common.have_size)
+#define ffeglobal_common_pad(g) ((g)->u.common.pad)
#define ffeglobal_common_size(g) ((g)->u.common.size)
#define ffeglobal_hook(g) ((g)->hook)
#define ffeglobal_init_0()
@@ -179,7 +179,6 @@ void ffeglobal_terminate_1 (void);
ffeglobal_new_progunit_(s,t,FFEGLOBAL_typeMAIN)
#define ffeglobal_new_subroutine(s,t) \
ffeglobal_new_progunit_(s,t,FFEGLOBAL_typeSUBR)
-#define ffeglobal_pad(g) ((g)->pad)
#define ffeglobal_ref_blockdata(s,t) \
ffeglobal_ref_progunit_(s,t,FFEGLOBAL_typeBDATA)
#define ffeglobal_ref_external(s,t) \
diff --git a/gcc/f/hconfig.j b/gcc/f/hconfig.j
index b777b68b92d..5bf37928672 100644
--- a/gcc/f/hconfig.j
+++ b/gcc/f/hconfig.j
@@ -1,27 +1 @@
-/* hconfig.j -- Wrapper for GCC's hconfig.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_hconfig
-#define _J_f_hconfig
-#include "hconfig.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/implic.c b/gcc/f/implic.c
index 292f88f7410..5c721890a21 100644
--- a/gcc/f/implic.c
+++ b/gcc/f/implic.c
@@ -1,383 +1,2 @@
-/* implic.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None.
-
- Description:
- The GNU Fortran Front End.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include <ctype.h>
-#include "implic.h"
-#include "info.h"
-#include "src.h"
-#include "symbol.h"
-#include "target.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFEIMPLIC_stateINITIAL_,
- FFEIMPLIC_stateASSUMED_,
- FFEIMPLIC_stateESTABLISHED_,
- FFEIMPLIC_state
- } ffeimplicState_;
-
-/* Internal typedefs. */
-
-typedef struct _ffeimplic_ *ffeimplic_;
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-struct _ffeimplic_
- {
- ffeimplicState_ state;
- ffeinfo info;
- };
-
-/* Static objects accessed by functions in this module. */
-
-/* NOTE: This is definitely ASCII-specific!! */
-
-static struct _ffeimplic_ ffeimplic_table_['z' - 'A' + 1];
-
-/* Static functions (internal). */
-
-static ffeimplic_ ffeimplic_lookup_ (char c);
-
-/* Internal macros. */
-
-
-/* ffeimplic_lookup_ -- Look up implicit descriptor for initial character
-
- ffeimplic_ imp;
- if ((imp = ffeimplic_lookup_('A')) == NULL)
- // error
-
- Returns a pointer to an implicit descriptor block based on the character
- passed, or NULL if it is not a valid initial character for an implicit
- data type. */
-
-static ffeimplic_
-ffeimplic_lookup_ (char c)
-{
- /* NOTE: This is definitely ASCII-specific!! */
- if (isalpha (c) || (c == '_'))
- return &ffeimplic_table_[c - 'A'];
- return NULL;
-}
-
-/* ffeimplic_establish_initial -- Establish type of implicit initial letter
-
- ffesymbol s;
- if (!ffeimplic_establish_initial(s))
- // error
-
- Assigns implicit type information to the symbol based on the first
- character of the symbol's name. */
-
-bool
-ffeimplic_establish_initial (char c, ffeinfoBasictype basic_type,
- ffeinfoKindtype kind_type, ffetargetCharacterSize size)
-{
- ffeimplic_ imp;
-
- imp = ffeimplic_lookup_ (c);
- if (imp == NULL)
- return FALSE; /* Character not A-Z or some such thing. */
- if (ffeinfo_basictype (imp->info) == FFEINFO_basictypeNONE)
- return FALSE; /* IMPLICIT NONE in effect here. */
-
- switch (imp->state)
- {
- case FFEIMPLIC_stateINITIAL_:
- imp->info = ffeinfo_new (basic_type,
- kind_type,
- 0,
- FFEINFO_kindNONE,
- FFEINFO_whereNONE,
- size);
- imp->state = FFEIMPLIC_stateESTABLISHED_;
- return TRUE;
-
- case FFEIMPLIC_stateASSUMED_:
- if ((ffeinfo_basictype (imp->info) != basic_type)
- || (ffeinfo_kindtype (imp->info) != kind_type)
- || (ffeinfo_size (imp->info) != size))
- return FALSE;
- imp->state = FFEIMPLIC_stateESTABLISHED_;
- return TRUE;
-
- case FFEIMPLIC_stateESTABLISHED_:
- return FALSE;
-
- default:
- assert ("Weird state for implicit object" == NULL);
- return FALSE;
- }
-}
-
-/* ffeimplic_establish_symbol -- Establish implicit type of a symbol
-
- ffesymbol s;
- if (!ffeimplic_establish_symbol(s))
- // error
-
- Assigns implicit type information to the symbol based on the first
- character of the symbol's name.
-
- If symbol already has a type, return TRUE.
- Get first character of symbol's name.
- Get ffeimplic_ object for it (return FALSE if NULL returned).
- Return FALSE if object has no assigned type (IMPLICIT NONE).
- Copy the type information from the object to the symbol.
- If the object is state "INITIAL", set to state "ASSUMED" so no
- subsequent IMPLICIT statement may change the state.
- Return TRUE. */
-
-bool
-ffeimplic_establish_symbol (ffesymbol s)
-{
- char c;
- ffeimplic_ imp;
-
- if (ffesymbol_basictype (s) != FFEINFO_basictypeNONE)
- return TRUE;
-
- c = *(ffesymbol_text (s));
- imp = ffeimplic_lookup_ (c);
- if (imp == NULL)
- return FALSE; /* First character not A-Z or some such
- thing. */
- if (ffeinfo_basictype (imp->info) == FFEINFO_basictypeNONE)
- return FALSE; /* IMPLICIT NONE in effect here. */
-
- ffesymbol_signal_change (s); /* Gonna change, save existing? */
-
- /* Establish basictype, kindtype, size; preserve rank, kind, where. */
-
- ffesymbol_set_info (s,
- ffeinfo_new (ffeinfo_basictype (imp->info),
- ffeinfo_kindtype (imp->info),
- ffesymbol_rank (s),
- ffesymbol_kind (s),
- ffesymbol_where (s),
- ffeinfo_size (imp->info)));
-
- if (imp->state == FFEIMPLIC_stateINITIAL_)
- imp->state = FFEIMPLIC_stateASSUMED_;
-
- if (ffe_is_warn_implicit ())
- {
- ffebad_start_msg ("Implicit declaration of `%A' at %0",
- FFEBAD_severityWARNING);
- ffebad_here (0, ffesymbol_where_line (s),
- ffesymbol_where_column (s));
- ffebad_string (ffesymbol_text (s));
- ffebad_finish ();
- }
-
- return TRUE;
-}
-
-/* ffeimplic_init_2 -- Initialize table
-
- ffeimplic_init_2();
-
- Assigns initial type information to all initial letters.
-
- Allows for holes in the sequence of letters (i.e. EBCDIC). */
-
-void
-ffeimplic_init_2 ()
-{
- ffeimplic_ imp;
- char c;
-
- for (c = 'A'; c <= 'z'; ++c)
- {
- imp = &ffeimplic_table_[c - 'A'];
- imp->state = FFEIMPLIC_stateINITIAL_;
- switch (c)
- {
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z':
- imp->info = ffeinfo_new (FFEINFO_basictypeREAL,
- FFEINFO_kindtypeREALDEFAULT,
- 0,
- FFEINFO_kindNONE,
- FFEINFO_whereNONE,
- FFETARGET_charactersizeNONE);
- break;
-
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- imp->info = ffeinfo_new (FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT, 0, FFEINFO_kindNONE, FFEINFO_whereNONE,
- FFETARGET_charactersizeNONE);
- break;
-
- default:
- imp->info = ffeinfo_new (FFEINFO_basictypeNONE, FFEINFO_kindtypeNONE, 0,
- FFEINFO_kindNONE, FFEINFO_whereNONE, FFETARGET_charactersizeNONE);
- break;
- }
- }
-}
-
-/* ffeimplic_none -- Implement IMPLICIT NONE statement
-
- ffeimplic_none();
-
- Assigns null type information to all initial letters. */
-
-void
-ffeimplic_none ()
-{
- ffeimplic_ imp;
-
- for (imp = &ffeimplic_table_[0];
- imp != &ffeimplic_table_[ARRAY_SIZE (ffeimplic_table_)];
- imp++)
- {
- imp->info = ffeinfo_new (FFEINFO_basictypeNONE,
- FFEINFO_kindtypeNONE,
- 0,
- FFEINFO_kindNONE,
- FFEINFO_whereNONE,
- FFETARGET_charactersizeNONE);
- }
-}
-
-/* ffeimplic_peek_symbol_type -- Determine implicit type of a symbol
-
- ffesymbol s;
- char *name; // name for s in case it is NULL, or NULL if s never NULL
- if (ffeimplic_peek_symbol_type(s,name) == FFEINFO_basictypeCHARACTER)
- // is or will be a CHARACTER-typed name
-
- Like establish_symbol, but doesn't change anything.
-
- If symbol is non-NULL and already has a type, return it.
- Get first character of symbol's name or from name arg if symbol is NULL.
- Get ffeimplic_ object for it (return FALSE if NULL returned).
- Return NONE if object has no assigned type (IMPLICIT NONE).
- Return the data type indicated in the object.
-
- 24-Oct-91 JCB 2.0
- Take a char * instead of ffelexToken, since the latter isn't always
- needed anyway (as when ffecom calls it). */
-
-ffeinfoBasictype
-ffeimplic_peek_symbol_type (ffesymbol s, char *name)
-{
- char c;
- ffeimplic_ imp;
-
- if (s == NULL)
- c = *name;
- else
- {
- if (ffesymbol_basictype (s) != FFEINFO_basictypeNONE)
- return ffesymbol_basictype (s);
-
- c = *(ffesymbol_text (s));
- }
-
- imp = ffeimplic_lookup_ (c);
- if (imp == NULL)
- return FFEINFO_basictypeNONE; /* First character not A-Z or
- something. */
- return ffeinfo_basictype (imp->info);
-}
-
-/* ffeimplic_terminate_2 -- Terminate table
-
- ffeimplic_terminate_2();
-
- Kills info object for each entry in table. */
-
-void
-ffeimplic_terminate_2 ()
-{
-}
+ Contributed by James Craig Burley (burley@gnu.org).
+ if (ISALPHA (c) || (c == '_'))
diff --git a/gcc/f/implic.h b/gcc/f/implic.h
index 2c03ab2cde1..5bf37928672 100644
--- a/gcc/f/implic.h
+++ b/gcc/f/implic.h
@@ -1,74 +1 @@
-/* implic.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- implic.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_implic
-#define _H_f_implic
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "info.h"
-#include "symbol.h"
-#include "target.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-bool ffeimplic_establish_initial (char c, ffeinfoBasictype basic_type,
- ffeinfoKindtype kind_type, ffetargetCharacterSize size);
-bool ffeimplic_establish_symbol (ffesymbol s);
-void ffeimplic_init_2 (void);
-void ffeimplic_none (void);
-ffeinfoBasictype ffeimplic_peek_symbol_type (ffesymbol s, char *name);
-void ffeimplic_terminate_2 (void);
-
-/* Define macros. */
-
-#define ffeimplic_init_0()
-#define ffeimplic_init_1()
-#define ffeimplic_init_3()
-#define ffeimplic_init_4()
-#define ffeimplic_terminate_0()
-#define ffeimplic_terminate_1()
-#define ffeimplic_terminate_3()
-#define ffeimplic_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/info-b.def b/gcc/f/info-b.def
index 0084f7afc99..5bf37928672 100644
--- a/gcc/f/info-b.def
+++ b/gcc/f/info-b.def
@@ -1,36 +1 @@
-/* info-b.def -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- info.c
-
- Modifications:
-*/
-
-FFEINFO_BASICTYPE (FFEINFO_basictypeNONE, "None", "")
-FFEINFO_BASICTYPE (FFEINFO_basictypeINTEGER, "INTEGER", "i")
-FFEINFO_BASICTYPE (FFEINFO_basictypeLOGICAL, "LOGICAL", "l")
-FFEINFO_BASICTYPE (FFEINFO_basictypeREAL, "REAL", "r")
-FFEINFO_BASICTYPE (FFEINFO_basictypeCOMPLEX, "COMPLEX", "c")
-FFEINFO_BASICTYPE (FFEINFO_basictypeCHARACTER, "CHARACTER", "a")
-FFEINFO_BASICTYPE (FFEINFO_basictypeHOLLERITH, "Hollerith", "h")
-FFEINFO_BASICTYPE (FFEINFO_basictypeTYPELESS, "Typeless", "t")
-FFEINFO_BASICTYPE (FFEINFO_basictypeANY, "Any", "~")
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/info-k.def b/gcc/f/info-k.def
index 46e32b27e50..5bf37928672 100644
--- a/gcc/f/info-k.def
+++ b/gcc/f/info-k.def
@@ -1,37 +1 @@
-/* info-k.def -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- info.c
-
- Modifications:
-*/
-
-FFEINFO_KIND (FFEINFO_kindNONE, "an unknown kind", "")
-FFEINFO_KIND (FFEINFO_kindENTITY, "an entity", "e")
-FFEINFO_KIND (FFEINFO_kindFUNCTION, "a function", "f")
-FFEINFO_KIND (FFEINFO_kindSUBROUTINE, "a subroutine", "u")
-FFEINFO_KIND (FFEINFO_kindPROGRAM, "a program", "p")
-FFEINFO_KIND (FFEINFO_kindBLOCKDATA, "a block-data unit", "b")
-FFEINFO_KIND (FFEINFO_kindCOMMON, "a common block", "c")
-FFEINFO_KIND (FFEINFO_kindCONSTRUCT, "a construct", ":")
-FFEINFO_KIND (FFEINFO_kindNAMELIST, "a namelist", "n")
-FFEINFO_KIND (FFEINFO_kindANY, "anything", "~")
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/info-w.def b/gcc/f/info-w.def
index 14e8a583a68..5bf37928672 100644
--- a/gcc/f/info-w.def
+++ b/gcc/f/info-w.def
@@ -1,41 +1 @@
-/* info-w.def -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- info.c
-
- Modifications:
-*/
-
-FFEINFO_WHERE (FFEINFO_whereNONE, "None", "")
-FFEINFO_WHERE (FFEINFO_whereLOCAL, "Local", "l") /* Defined locally. */
-FFEINFO_WHERE (FFEINFO_whereCOMMON, "Common", "c") /* In a common area. */
-FFEINFO_WHERE (FFEINFO_whereDUMMY, "Dummy", "d") /* A dummy argument. */
-FFEINFO_WHERE (FFEINFO_whereGLOBAL, "Global", "g") /* Reference to external global like FUNCTION, SUBR. */
-FFEINFO_WHERE (FFEINFO_whereRESULT, "Result", "r") /* Result of this function. */
-FFEINFO_WHERE (FFEINFO_whereFLEETING, "Fleeting", "f") /* Result of "X*Y", "FUNCREF(5,1.3)", "ARRAY(X)", etc. */
-FFEINFO_WHERE (FFEINFO_whereFLEETING_CADDR, "Fleet-Const", "fp") /* "A(3)", "CHARS(4:5)". */
-FFEINFO_WHERE (FFEINFO_whereFLEETING_IADDR, "Fleet-Immed", "fi") /* A(IX) in "DATA (A(IX),IX=1,100)/.../". */
-FFEINFO_WHERE (FFEINFO_whereIMMEDIATE, "Immediate", "i") /* IX in "DATA (A(IX),IX=1,100)/.../". */
-FFEINFO_WHERE (FFEINFO_whereINTRINSIC, "Intrinsic", "b")
-FFEINFO_WHERE (FFEINFO_whereCONSTANT, "Constant", "p") /* For kindFUNCTION, means statement function! */
-FFEINFO_WHERE (FFEINFO_whereCONSTANT_SUBOBJECT, "Const-subobj", "q") /* As in "'FOO'(I:J)". */
-FFEINFO_WHERE (FFEINFO_whereANY, "Any", "~")
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/info.c b/gcc/f/info.c
index 7c1ca9b0155..5bf37928672 100644
--- a/gcc/f/info.c
+++ b/gcc/f/info.c
@@ -1,305 +1 @@
-/* info.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- An abstraction for information maintained on a per-operator and per-
- operand basis in expression trees.
-
- Modifications:
- 30-Aug-90 JCB 2.0
- Extensive rewrite for new cleaner approach.
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "info.h"
-#include "target.h"
-#include "type.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-static char *ffeinfo_basictype_string_[]
-=
-{
-#define FFEINFO_BASICTYPE(KWD,LNAM,SNAM) SNAM,
-#include "info-b.def"
-#undef FFEINFO_BASICTYPE
-};
-static char *ffeinfo_kind_message_[]
-=
-{
-#define FFEINFO_KIND(KWD,LNAM,SNAM) LNAM,
-#include "info-k.def"
-#undef FFEINFO_KIND
-};
-static char *ffeinfo_kind_string_[]
-=
-{
-#define FFEINFO_KIND(KWD,LNAM,SNAM) SNAM,
-#include "info-k.def"
-#undef FFEINFO_KIND
-};
-static ffeinfoBasictype ffeinfo_combine_[FFEINFO_basictype][FFEINFO_basictype];
-static char *ffeinfo_kindtype_string_[]
-=
-{
- "",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "*",
-};
-static char *ffeinfo_where_string_[]
-=
-{
-#define FFEINFO_WHERE(KWD,LNAM,SNAM) SNAM,
-#include "info-w.def"
-#undef FFEINFO_WHERE
-};
-static ffetype ffeinfo_types_[FFEINFO_basictype][FFEINFO_kindtype]
- = { { NULL } };
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffeinfo_basictype_combine -- Combine two basictypes into highest rank type
-
- ffeinfoBasictype i, j, k;
- k = ffeinfo_basictype_combine(i,j);
-
- Returns a type based on "standard" operation between two given types. */
-
-ffeinfoBasictype
-ffeinfo_basictype_combine (ffeinfoBasictype l, ffeinfoBasictype r)
-{
- assert (l < FFEINFO_basictype);
- assert (r < FFEINFO_basictype);
- return ffeinfo_combine_[l][r];
-}
-
-/* ffeinfo_basictype_string -- Return tiny string showing the basictype
-
- ffeinfoBasictype i;
- printf("%s",ffeinfo_basictype_string(dt));
-
- Returns the string based on the basic type. */
-
-char *
-ffeinfo_basictype_string (ffeinfoBasictype basictype)
-{
- if (basictype >= ARRAY_SIZE (ffeinfo_basictype_string_))
- return "?\?\?";
- return ffeinfo_basictype_string_[basictype];
-}
-
-/* ffeinfo_init_0 -- Initialize
-
- ffeinfo_init_0(); */
-
-void
-ffeinfo_init_0 ()
-{
- ffeinfoBasictype i;
- ffeinfoBasictype j;
-
- assert (FFEINFO_basictype == ARRAY_SIZE (ffeinfo_basictype_string_));
- assert (FFEINFO_kind == ARRAY_SIZE (ffeinfo_kind_message_));
- assert (FFEINFO_kind == ARRAY_SIZE (ffeinfo_kind_string_));
- assert (FFEINFO_kindtype == ARRAY_SIZE (ffeinfo_kindtype_string_));
- assert (FFEINFO_where == ARRAY_SIZE (ffeinfo_where_string_));
-
- /* Make array that, given two basic types, produces resulting basic type. */
-
- for (i = 0; i < FFEINFO_basictype; ++i)
- for (j = 0; j < FFEINFO_basictype; ++j)
- if ((i == FFEINFO_basictypeANY) || (j == FFEINFO_basictypeANY))
- ffeinfo_combine_[i][j] = FFEINFO_basictypeANY;
- else
- ffeinfo_combine_[i][j] = FFEINFO_basictypeNONE;
-
-#define same(bt) ffeinfo_combine_[bt][bt] = bt
-#define use2(bt1,bt2) ffeinfo_combine_[bt1][bt2] \
- = ffeinfo_combine_[bt2][bt1] = bt2
-
- same (FFEINFO_basictypeINTEGER);
- same (FFEINFO_basictypeLOGICAL);
- same (FFEINFO_basictypeREAL);
- same (FFEINFO_basictypeCOMPLEX);
- same (FFEINFO_basictypeCHARACTER);
- use2 (FFEINFO_basictypeINTEGER, FFEINFO_basictypeREAL);
- use2 (FFEINFO_basictypeINTEGER, FFEINFO_basictypeCOMPLEX);
- use2 (FFEINFO_basictypeREAL, FFEINFO_basictypeCOMPLEX);
-
-#undef same
-#undef use2
-}
-
-/* ffeinfo_kind_message -- Return helpful string showing the kind
-
- ffeinfoKind kind;
- printf("%s",ffeinfo_kind_message(kind));
-
- Returns the string based on the kind. */
-
-char *
-ffeinfo_kind_message (ffeinfoKind kind)
-{
- if (kind >= ARRAY_SIZE (ffeinfo_kind_message_))
- return "?\?\?";
- return ffeinfo_kind_message_[kind];
-}
-
-/* ffeinfo_kind_string -- Return tiny string showing the kind
-
- ffeinfoKind kind;
- printf("%s",ffeinfo_kind_string(kind));
-
- Returns the string based on the kind. */
-
-char *
-ffeinfo_kind_string (ffeinfoKind kind)
-{
- if (kind >= ARRAY_SIZE (ffeinfo_kind_string_))
- return "?\?\?";
- return ffeinfo_kind_string_[kind];
-}
-
-ffeinfoKindtype
-ffeinfo_kindtype_max(ffeinfoBasictype bt,
- ffeinfoKindtype k1,
- ffeinfoKindtype k2)
-{
- if ((bt == FFEINFO_basictypeANY)
- || (k1 == FFEINFO_kindtypeANY)
- || (k2 == FFEINFO_kindtypeANY))
- return FFEINFO_kindtypeANY;
-
- if (ffetype_size (ffeinfo_types_[bt][k1])
- > ffetype_size (ffeinfo_types_[bt][k2]))
- return k1;
- return k2;
-}
-
-/* ffeinfo_kindtype_string -- Return tiny string showing the kind type
-
- ffeinfoKindtype kind_type;
- printf("%s",ffeinfo_kindtype_string(kind));
-
- Returns the string based on the kind type. */
-
-char *
-ffeinfo_kindtype_string (ffeinfoKindtype kind_type)
-{
- if (kind_type >= ARRAY_SIZE (ffeinfo_kindtype_string_))
- return "?\?\?";
- return ffeinfo_kindtype_string_[kind_type];
-}
-
-void
-ffeinfo_set_type (ffeinfoBasictype basictype, ffeinfoKindtype kindtype,
- ffetype type)
-{
- assert (basictype < FFEINFO_basictype);
- assert (kindtype < FFEINFO_kindtype);
- assert (ffeinfo_types_[basictype][kindtype] == NULL);
-
- ffeinfo_types_[basictype][kindtype] = type;
-}
-
-ffetype
-ffeinfo_type (ffeinfoBasictype basictype, ffeinfoKindtype kindtype)
-{
- assert (basictype < FFEINFO_basictype);
- assert (kindtype < FFEINFO_kindtype);
- assert (ffeinfo_types_[basictype][kindtype] != NULL);
-
- return ffeinfo_types_[basictype][kindtype];
-}
-
-/* ffeinfo_where_string -- Return tiny string showing the where
-
- ffeinfoWhere where;
- printf("%s",ffeinfo_where_string(where));
-
- Returns the string based on the where. */
-
-char *
-ffeinfo_where_string (ffeinfoWhere where)
-{
- if (where >= ARRAY_SIZE (ffeinfo_where_string_))
- return "?\?\?";
- return ffeinfo_where_string_[where];
-}
-
-/* ffeinfo_new -- Return object representing datatype, kind, and where info
-
- ffeinfo i;
- i = ffeinfo_new(FFEINFO_datatypeINTEGER,FFEINFO_kindSCALAR,
- FFEINFO_whereLOCAL);
-
- Returns the string based on the data type. */
-
-#ifndef __GNUC__
-ffeinfo
-ffeinfo_new (ffeinfoBasictype basictype, ffeinfoKindtype kindtype,
- ffeinfoRank rank, ffeinfoKind kind, ffeinfoWhere where,
- ffetargetCharacterSize size)
-{
- ffeinfo i;
-
- i.basictype = basictype;
- i.kindtype = kindtype;
- i.rank = rank;
- i.size = size;
- i.kind = kind;
- i.where = where;
- i.size = size;
-
- return i;
-}
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/info.h b/gcc/f/info.h
index 33f1aa9e61e..5bf37928672 100644
--- a/gcc/f/info.h
+++ b/gcc/f/info.h
@@ -1,186 +1 @@
-/* info.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- info.c
-
- Modifications:
- 30-Aug-90 JCB 2.0
- Extensive rewrite for new cleaner approach.
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_info
-#define _H_f_info
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
-#define FFEINFO_BASICTYPE(KWD,LNAM,SNAM) KWD,
-#include "info-b.def"
-#undef FFEINFO_BASICTYPE
- FFEINFO_basictype
- } ffeinfoBasictype;
-
-typedef enum
- { /* If these kindtypes aren't in size order,
- change _kindtype_max. */
- FFEINFO_kindtypeNONE,
- FFEINFO_kindtypeINTEGER1,
- FFEINFO_kindtypeINTEGER2,
- FFEINFO_kindtypeINTEGER3,
- FFEINFO_kindtypeINTEGER4,
- FFEINFO_kindtypeINTEGER5,
- FFEINFO_kindtypeINTEGER6,
- FFEINFO_kindtypeINTEGER7,
- FFEINFO_kindtypeINTEGER8,
- FFEINFO_kindtypeLOGICAL1 = 1, /* Ok to omit, but ok to overlap. */
- FFEINFO_kindtypeLOGICAL2,
- FFEINFO_kindtypeLOGICAL3,
- FFEINFO_kindtypeLOGICAL4,
- FFEINFO_kindtypeLOGICAL5,
- FFEINFO_kindtypeLOGICAL6,
- FFEINFO_kindtypeLOGICAL7,
- FFEINFO_kindtypeLOGICAL8,
- FFEINFO_kindtypeREAL1 = 1, /* Ok to omit, but ok to overlap. */
- FFEINFO_kindtypeREAL2,
- FFEINFO_kindtypeREAL3,
- FFEINFO_kindtypeREAL4,
- FFEINFO_kindtypeREAL5,
- FFEINFO_kindtypeREAL6,
- FFEINFO_kindtypeREAL7,
- FFEINFO_kindtypeREAL8,
- FFEINFO_kindtypeCHARACTER1 = 1, /* Ok to omit, but ok to overlap. */
- FFEINFO_kindtypeCHARACTER2,
- FFEINFO_kindtypeCHARACTER3,
- FFEINFO_kindtypeCHARACTER4,
- FFEINFO_kindtypeCHARACTER5,
- FFEINFO_kindtypeCHARACTER6,
- FFEINFO_kindtypeCHARACTER7,
- FFEINFO_kindtypeCHARACTER8,
- FFEINFO_kindtypeANY,
- FFEINFO_kindtype
- } ffeinfoKindtype;
-
-typedef enum
- {
-#define FFEINFO_KIND(KWD,LNAM,SNAM) KWD,
-#include "info-k.def"
-#undef FFEINFO_KIND
- FFEINFO_kind
- } ffeinfoKind;
-
-typedef enum
- {
-#define FFEINFO_WHERE(KWD,LNAM,SNAM) KWD,
-#include "info-w.def"
-#undef FFEINFO_WHERE
- FFEINFO_where
- } ffeinfoWhere;
-
-/* Typedefs. */
-
-typedef struct _ffeinfo_ ffeinfo;
-typedef char ffeinfoRank;
-
-/* Include files needed by this one. */
-
-#include "target.h"
-#include "type.h"
-
-/* Structure definitions. */
-
-struct _ffeinfo_
- {
- ffeinfoBasictype basictype;
- ffeinfoKindtype kindtype;
- ffeinfoRank rank;
- ffeinfoKind kind;
- ffeinfoWhere where;
- ffetargetCharacterSize size;
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-ffeinfoBasictype ffeinfo_basictype_combine (ffeinfoBasictype l,
- ffeinfoBasictype r);
-char *ffeinfo_basictype_string (ffeinfoBasictype basictype);
-void ffeinfo_init_0 (void);
-char *ffeinfo_kind_message (ffeinfoKind kind);
-char *ffeinfo_kind_string (ffeinfoKind kind);
-ffeinfoKindtype ffeinfo_kindtype_max(ffeinfoBasictype bt,
- ffeinfoKindtype k1,
- ffeinfoKindtype k2);
-char *ffeinfo_kindtype_string (ffeinfoKindtype kind_type);
-char *ffeinfo_where_string (ffeinfoWhere where);
-ffeinfo ffeinfo_new (ffeinfoBasictype basictype, ffeinfoKindtype kindtype,
- ffeinfoRank rank, ffeinfoKind kind, ffeinfoWhere where,
- ffetargetCharacterSize size);
-void ffeinfo_set_type (ffeinfoBasictype basictype, ffeinfoKindtype kindtype,
- ffetype type);
-ffetype ffeinfo_type (ffeinfoBasictype basictype, ffeinfoKindtype kindtype);
-
-/* Define macros. */
-
-#define ffeinfo_basictype(i) (i.basictype)
-#define ffeinfo_init_1()
-#define ffeinfo_init_2()
-#define ffeinfo_init_3()
-#define ffeinfo_init_4()
-#define ffeinfo_kind(i) (i.kind)
-#define ffeinfo_kindtype(i) (i.kindtype)
-#ifdef __GNUC__
-#define ffeinfo_new(bt,kt,r,k,w,sz) \
- ((ffeinfo) {(bt), (kt), (r), (k), (w), (sz)})
-#endif
-#define ffeinfo_new_any() \
- ffeinfo_new (FFEINFO_basictypeANY, FFEINFO_kindtypeANY, 0, \
- FFEINFO_kindANY, FFEINFO_whereANY, \
- FFETARGET_charactersizeNONE)
-#define ffeinfo_new_null() \
- ffeinfo_new (FFEINFO_basictypeNONE, FFEINFO_kindtypeNONE, 0, \
- FFEINFO_kindNONE, FFEINFO_whereNONE, \
- FFETARGET_charactersizeNONE)
-#define ffeinfo_rank(i) (i.rank)
-#define ffeinfo_size(i) (i.size)
-#define ffeinfo_terminate_0()
-#define ffeinfo_terminate_1()
-#define ffeinfo_terminate_2()
-#define ffeinfo_terminate_3()
-#define ffeinfo_terminate_4()
-#define ffeinfo_use(i) i
-#define ffeinfo_where(i) (i.where)
-
-#define FFEINFO_kindtypeINTEGERDEFAULT FFEINFO_kindtypeINTEGER1
-#define FFEINFO_kindtypeLOGICALDEFAULT FFEINFO_kindtypeLOGICAL1
-#define FFEINFO_kindtypeREALDEFAULT FFEINFO_kindtypeREAL1
-#define FFEINFO_kindtypeREALDOUBLE FFEINFO_kindtypeREAL2
-#define FFEINFO_kindtypeREALQUAD FFEINFO_kindtypeREAL3
-#define FFEINFO_kindtypeCHARACTERDEFAULT FFEINFO_kindtypeCHARACTER1
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/input.j b/gcc/f/input.j
index c7ec5b690ff..5bf37928672 100644
--- a/gcc/f/input.j
+++ b/gcc/f/input.j
@@ -1,27 +1 @@
-/* input.j -- Wrapper for GCC's input.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_input
-#define _J_f_input
-#include "input.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/intdoc.c b/gcc/f/intdoc.c
index 6e88df4dbbb..0ac39ff43ce 100644
--- a/gcc/f/intdoc.c
+++ b/gcc/f/intdoc.c
@@ -1,6 +1,6 @@
/* intdoc.c
Copyright (C) 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -20,16 +20,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* From f/proj.h, which uses #error -- not all C compilers
- support that, and we want _this_ program to be compilable
+ support that, and we want *this* program to be compilable
by pretty much any C compiler. */
-
-#include "assert.j" /* Use gcc's assert.h. */
-#include <stdio.h>
+#include "hconfig.j"
+#include "system.j"
+#include "assert.j"
+#if HAVE_STDDEF_H
#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#define FFEINTRIN_DOC 1
-#include "intrin.h"
+#endif
typedef enum
{
@@ -44,6 +42,10 @@ typedef enum
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
+/* Pull in the intrinsics info, but only the doc parts. */
+#define FFEINTRIN_DOC 1
+#include "intrin.h"
+
char *family_name (ffeintrinFamily family);
static void dumpif (ffeintrinFamily fam);
static void dumpendif (void);
@@ -844,7 +846,7 @@ types of all the arguments.\n\n");
break;
default:
- assert ("E1" == NULL);
+ assert ("N1" == NULL);
break;
}
break;
diff --git a/gcc/f/intdoc.in b/gcc/f/intdoc.in
index 1ef6a94be68..a0b90ae3907 100644
--- a/gcc/f/intdoc.in
+++ b/gcc/f/intdoc.in
@@ -1058,7 +1058,7 @@ DEFDOC (DATE, "Get current date as dd-Mon-yy.", "\
Returns @var{@1@} in the form @samp{@var{dd}-@var{mmm}-@var{yy}},
representing the numeric day of the month @var{dd}, a three-character
abbreviation of the month name @var{mmm} and the last two digits of
-the year @var{yy}, e.g.@ @samp{25-Nov-96}.
+the year @var{yy}, e.g.@: @samp{25-Nov-96}.
This intrinsic is not recommended, due to the year 2000 approaching.
@xref{CTime Intrinsic (subroutine)}, for information on obtaining more digits
@@ -1365,7 +1365,7 @@ See @code{erf(3m)}, which provides the implementation.
DEFDOC (ERFC, "Complementary error function.", "\
Returns the complementary error function of @var{@1@}:
-@samp{ERFC(R) = 1 - ERF(R)} (except that the result may be more
+@samp{ERFC(R) = 1 - ERF(R)} (except that the result might be more
accurate than explicitly evaluating that formulae would give).
See @code{erfc(3m)}, which provides the implementation.
")
@@ -1445,7 +1445,7 @@ See @code{chdir(3)}.
@emph{Caution:} Using this routine during I/O to a unit connected with a
non-absolute file name can cause subsequent I/O on such a unit to fail
-because the I/O library may reopen files by name.
+because the I/O library might reopen files by name.
Some non-GNU implementations of Fortran provide this intrinsic as
only a function, not as a subroutine, or do not support the
@@ -1459,7 +1459,7 @@ See @code{chdir(3)}.
@emph{Caution:} Using this routine during I/O to a unit connected with a
non-absolute file name can cause subsequent I/O on such a unit to fail
-because the I/O library may reopen files by name.
+because the I/O library might reopen files by name.
Due to the side effects performed by this intrinsic, the function
form is not recommended.
@@ -1479,7 +1479,7 @@ Returns 0 on success or a non-zero error code otherwise.
Note that this currently works
by actually invoking @code{/bin/chmod} (or the @code{chmod} found when
-the library was configured) and so may fail in some circumstances and
+the library was configured) and so might fail in some circumstances and
will, anyway, be slow.
Due to the side effects performed by this intrinsic, the function
@@ -1501,7 +1501,7 @@ If the @var{@3@} argument is supplied, it contains
Note that this currently works
by actually invoking @code{/bin/chmod} (or the @code{chmod} found when
-the library was configured) and so may fail in some circumstances and
+the library was configured) and so might fail in some circumstances and
will, anyway, be slow.
Some non-GNU implementations of Fortran provide this intrinsic as
@@ -2057,6 +2057,11 @@ DEFDOC (HOSTNM_func, "Get host name.", "\
Fills @var{@1@} with the system's host name returned by
@code{gethostname(2)}, returning 0 on success or a non-zero error code
(@code{ENOSYS} if the system does not provide @code{gethostname(2)}).
+
+On some systems (specifically SCO) it might be necessary to link the
+``socket'' library if you call this routine.
+Typically this means adding @samp{-lg2c -lsocket -lm}
+to the @code{g77} command line when linking the program.
")
DEFDOC (HOSTNM_subr, "Get host name.", "\
@@ -2069,9 +2074,12 @@ If the @var{@2@} argument is supplied, it contains
Some non-GNU implementations of Fortran provide this intrinsic as
only a function, not as a subroutine, or do not support the
(optional) @var{@2@} argument.
-")
-/* Fixme: stream I/O */
+On some systems (specifically SCO) it might be necessary to link the
+``socket'' library if you call this routine.
+Typically this means adding @samp{-lg2c -lsocket -lm}
+to the @code{g77} command line when linking the program.
+")
DEFDOC (FLUSH, "Flush buffered output.", "\
Flushes Fortran unit(s) currently open for output.
@@ -2156,10 +2164,10 @@ Returns in
DEFDOC (FSEEK, "Position file (low-level).", "\
Attempts to move Fortran unit @var{@1@} to the specified
-@var{Offset}: absolute offset if @var{@2@}=0; relative to the
-current offset if @var{@2@}=1; relative to the end of the file if
-@var{@2@}=2.
-It branches to label @var{@3@} if @var{@1@} is
+@var{@2@}: absolute offset if @var{@3@}=0; relative to the
+current offset if @var{@3@}=1; relative to the end of the file if
+@var{@3@}=2.
+It branches to label @var{@4@} if @var{@1@} is
not open or if the call otherwise fails.
")
@@ -2418,8 +2426,7 @@ All bits representing @var{@1@} are shifted @var{@2@} places.
indicates no shift and @samp{@var{@2@}.LT.0} indicates a right shift.
If the absolute value of the shift count is greater than
@samp{BIT_SIZE(@var{@1@})}, the result is undefined.
-Bits shifted out from the left end or the right end, as the case may be,
-are lost.
+Bits shifted out from the left end or the right end are lost.
Zeros are shifted in from the opposite end.
@xref{IShftC Intrinsic} for the circular-shift equivalent.
@@ -2428,7 +2435,7 @@ Zeros are shifted in from the opposite end.
DEFDOC (ISHFTC, "Circular bit shift.", "\
The rightmost @var{@3@} bits of the argument @var{@1@}
are shifted circularly @var{@2@}
-places, i.e.@ the bits shifted out of one end are shifted into
+places, i.e.@: the bits shifted out of one end are shifted into
the opposite end.
No bits are lost.
The unshifted bits of the result are the same as
@@ -2468,3 +2475,24 @@ scheduled alarm was due to be delivered, or zero if there was no
previously scheduled alarm.
@xref{Signal Intrinsic (subroutine)}.
")
+
+DEFDOC (DATE_AND_TIME, "Get the current date and time.", "\
+Returns:
+@table @var
+@item @1@
+The date in the form @var{ccyymmdd}: century, year, month and day;
+@item @2@
+The time in the form @samp{@var{hhmmss.ss}}: hours, minutes, seconds
+and milliseconds;
+@item @3@
+The difference between local time and UTC (GMT) in the form @var{Shhmm}:
+sign, hours and minutes, e.g.@: @samp{-0500} (winter in New York);
+@item @4@
+The year, month of the year, day of the month, time difference in
+minutes from UTC, hour of the day, minutes of the hour and milliseconds
+of the second in successive values of the array.
+@end table
+
+On systems where a millisecond timer isn't available, the millisecond
+value is returned as zero.
+")
diff --git a/gcc/f/intdoc.texi b/gcc/f/intdoc.texi
index 74153db4fdd..1da381111c2 100644
--- a/gcc/f/intdoc.texi
+++ b/gcc/f/intdoc.texi
@@ -184,7 +184,7 @@
* Date Intrinsic:: Get current date as dd-Mon-yy.
@end ifset
@ifset familyF90
-* Date_and_Time Intrinsic:: (Reserved for future use.)
+* Date_and_Time Intrinsic:: Get the current date and time.
@end ifset
@ifset familyF2U
* DbesJ0 Intrinsic:: Bessel function (archaic).
@@ -2964,7 +2964,7 @@ Description:
Returns @var{Date} in the form @samp{@var{dd}-@var{mmm}-@var{yy}},
representing the numeric day of the month @var{dd}, a three-character
abbreviation of the month name @var{mmm} and the last two digits of
-the year @var{yy}, e.g.@ @samp{25-Nov-96}.
+the year @var{yy}, e.g.@: @samp{25-Nov-96}.
This intrinsic is not recommended, due to the year 2000 approaching.
@xref{CTime Intrinsic (subroutine)}, for information on obtaining more digits
@@ -2977,10 +2977,47 @@ for the current (or any) date.
@cindex Date_and_Time intrinsic
@cindex intrinsics, Date_and_Time
-This intrinsic is not yet implemented.
-The name is, however, reserved as an intrinsic.
-Use @samp{EXTERNAL Date_and_Time} to use this name for an
-external procedure.
+@noindent
+@example
+CALL Date_and_Time(@var{Date}, @var{Time}, @var{Zone}, @var{Values})
+@end example
+
+@noindent
+@var{Date}: @code{CHARACTER}; scalar; INTENT(OUT).
+
+@noindent
+@var{Time}: @code{CHARACTER}; OPTIONAL; scalar; INTENT(OUT).
+
+@noindent
+@var{Zone}: @code{CHARACTER}; OPTIONAL; scalar; INTENT(OUT).
+
+@noindent
+@var{Values}: @code{INTEGER(KIND=1)}; OPTIONAL; DIMENSION(8); INTENT(OUT).
+
+@noindent
+Intrinsic groups: @code{f90}.
+
+@noindent
+Description:
+
+Returns:
+@table @var
+@item Date
+The date in the form @var{ccyymmdd}: century, year, month and day;
+@item Time
+The time in the form @samp{@var{hhmmss.ss}}: hours, minutes, seconds
+and milliseconds;
+@item Zone
+The difference between local time and UTC (GMT) in the form @var{Shhmm}:
+sign, hours and minutes, e.g.@: @samp{-0500} (winter in New York);
+@item Values
+The year, month of the year, day of the month, time difference in
+minutes from UTC, hour of the day, minutes of the hour and milliseconds
+of the second in successive values of the array.
+@end table
+
+On systems where a millisecond timer isn't available, the millisecond
+value is returned as zero.
@end ifset
@ifset familyF2U
@@ -5417,6 +5454,10 @@ Some non-GNU implementations of Fortran provide this intrinsic as
only a function, not as a subroutine, or do not support the
(optional) @var{Status} argument.
+On some systems (specifically SCO) it might be necessary to link the
+``socket'' library if you call this routine, i.e.@: append
+@samp{-lg2c -lsocket -lm} to the @code{g77} arguments.
+
For information on other intrinsics with the same name:
@xref{HostNm Intrinsic (function)}.
@@ -5446,6 +5487,10 @@ Fills @var{Name} with the system's host name returned by
@code{gethostname(2)}, returning 0 on success or a non-zero error code
(@code{ENOSYS} if the system does not provide @code{gethostname(2)}).
+On some systems (specifically SCO) it might be necessary to link the
+``socket'' library if you call this routine, i.e.@: append
+@samp{-lg2c -lsocket -lm} to the @code{g77} arguments.
+
For information on other intrinsics with the same name:
@xref{HostNm Intrinsic (subroutine)}.
@@ -6589,7 +6634,7 @@ Description:
The rightmost @var{Size} bits of the argument @var{I}
are shifted circularly @var{Shift}
-places, i.e.@ the bits shifted out of one end are shifted into
+places, i.e.@: the bits shifted out of one end are shifted into
the opposite end.
No bits are lost.
The unshifted bits of the result are the same as
@@ -10006,10 +10051,10 @@ CALL System_Clock(@var{Count}, @var{Rate}, @var{Max})
@var{Count}: @code{INTEGER(KIND=1)}; scalar; INTENT(OUT).
@noindent
-@var{Rate}: @code{INTEGER(KIND=1)}; scalar; INTENT(OUT).
+@var{Rate}: @code{INTEGER(KIND=1)}; OPTIONAL; scalar; INTENT(OUT).
@noindent
-@var{Max}: @code{INTEGER(KIND=1)}; scalar; INTENT(OUT).
+@var{Max}: @code{INTEGER(KIND=1)}; OPTIONAL; scalar; INTENT(OUT).
@noindent
Intrinsic groups: @code{f90}.
diff --git a/gcc/f/intrin.c b/gcc/f/intrin.c
index 5ab530be809..6e27d210142 100644
--- a/gcc/f/intrin.c
+++ b/gcc/f/intrin.c
@@ -1,6 +1,6 @@
/* intrin.c -- Recognize references to intrinsics
Copyright (C) 1995-1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -22,7 +22,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
*/
#include "proj.h"
-#include <ctype.h>
#include "intrin.h"
#include "expr.h"
#include "info.h"
@@ -1553,11 +1552,13 @@ ffeintrin_init_0 ()
p3 = ffeintrin_names_[i].name_ic;
for (; *p1 != '\0' && *p2 != '\0' && *p3 != '\0'; ++p1, ++p2, ++p3)
{
- if (!isascii (*p1) || !isascii (*p2) || !isascii (*p3))
+ if (! IN_CTYPE_DOMAIN (*p1)
+ || ! IN_CTYPE_DOMAIN (*p2)
+ || ! IN_CTYPE_DOMAIN (*p3))
break;
- if ((isdigit (*p1) || (*p1 == '_')) && (*p1 == *p2) && (*p1 == *p3))
+ if ((ISDIGIT (*p1) || (*p1 == '_')) && (*p1 == *p2) && (*p1 == *p3))
continue;
- if (!isupper (*p1) || !islower (*p2)
+ if (! ISUPPER (*p1) || ! ISLOWER (*p2)
|| (*p1 != toupper (*p2)) || ((*p3 != *p1) && (*p3 != *p2)))
break;
}
@@ -1643,24 +1644,29 @@ ffeintrin_init_0 ()
|| (c[1] == 'n')
|| (c[1] == 'p'))
++c;
- if (((c[1] != '-')
- && (c[1] != 'A')
- && (c[1] != 'C')
- && (c[1] != 'I')
- && (c[1] != 'L')
- && (c[1] != 'R')
- && (c[1] != 'B')
- && (c[1] != 'F')
- && (c[1] != 'N')
- && (c[1] != 'S')
- && (c[1] != 'g')
- && (c[1] != 's'))
- || ((c[2] != '*')
- && ((c[2] < '1')
- || (c[2] > '9'))
- && (c[2] != 'A')))
+ if ((c[1] != '-')
+ && (c[1] != 'A')
+ && (c[1] != 'C')
+ && (c[1] != 'I')
+ && (c[1] != 'L')
+ && (c[1] != 'R')
+ && (c[1] != 'B')
+ && (c[1] != 'F')
+ && (c[1] != 'N')
+ && (c[1] != 'S')
+ && (c[1] != 'g')
+ && (c[1] != 's'))
{
- fprintf (stderr, "%s: bad arg-type\n",
+ fprintf (stderr, "%s: bad arg-base-type\n",
+ ffeintrin_imps_[i].name);
+ break;
+ }
+ if ((c[2] != '*')
+ && ((c[2] < '1')
+ || (c[2] > '9'))
+ && (c[2] != 'A'))
+ {
+ fprintf (stderr, "%s: bad arg-kind-type\n",
ffeintrin_imps_[i].name);
break;
}
diff --git a/gcc/f/intrin.def b/gcc/f/intrin.def
index 29766543c8f..0c00dccfb01 100644
--- a/gcc/f/intrin.def
+++ b/gcc/f/intrin.def
@@ -1377,7 +1377,7 @@ DEFSPEC (DATE_AND_TIME,
"DATE_AND_TIME",
FALSE,
FFEINTRIN_familyF90,
- FFEINTRIN_impNONE
+ FFEINTRIN_impDATE_AND_TIME
)
DEFSPEC (DBESJ0,
"DBESJ0",
@@ -3233,6 +3233,7 @@ DEFIMP (CPU_TIME, "CPU_TIME", SECOND,,, "--:-:Seconds=R*w")
DEFIMP (CTIME_func, "CTIME_func", CTIME,,, "A1*:-:STime=I*")
DEFIMP (CTIME_subr, "CTIME_subr", CTIME,,, "--:-:Result=A1w,STime=I*")
DEFIMP (DATE, "DATE", DATE,,, "--:-:Date=A1w")
+DEFIMP (DATE_AND_TIME, "DATE_AND_TIME", DATE_AND_TIME,,, "--:-:Date=A1w,Time=?A1w,Zone=?A1w,Values=?I1(8)w")
DEFIMP (DBESJ0, "DBESJ0", L_BESJ0,,, "R2:-:X=R2")
DEFIMP (DBESJ1, "DBESJ1", L_BESJ1,,, "R2:-:X=R2")
DEFIMP (DBESJN, "DBESJN", L_BESJN,,, "R2:-:N=I*,X=R2")
@@ -3336,7 +3337,7 @@ DEFIMP (SYMLNK_func, "SYMLNK_func", SYMLNK,,, "I1:-:Path1=A1,Path2=A1")
DEFIMP (SYMLNK_subr, "SYMLNK_subr", SYMLNK,,, "--:-:Path1=A1,Path2=A1,Status=?I1w")
DEFIMP (SYSTEM_func, "SYSTEM_func", SYSTEM,SYSTEM,SYSTEM,"I1:-:Command=A1")
DEFIMP (SYSTEM_subr, "SYSTEM_subr", SYSTEM,,, "--:-:Command=A1,Status=?I1w")
-DEFIMP (SYSTEM_CLOCK, "SYSTEM_CLOCK", SYSTEM_CLOCK,,, "--:-:Count=I1w,Rate=I1w,Max=I1w")
+DEFIMP (SYSTEM_CLOCK, "SYSTEM_CLOCK", SYSTEM_CLOCK,,, "--:-:Count=I1w,Rate=?I1w,Max=?I1w")
DEFIMP (TIME8, "TIME8", TIME,,, "I2:-:")
DEFIMP (TIME_unix, "TIME_unix", TIME,,, "I1:-:")
DEFIMP (TIME_vxt, "TIME_vxt", VXTTIME,,, "--:-:Time=A1[8]w")
diff --git a/gcc/f/intrin.h b/gcc/f/intrin.h
index fccef06eef6..0006c8aa7d5 100644
--- a/gcc/f/intrin.h
+++ b/gcc/f/intrin.h
@@ -1,6 +1,6 @@
/* intrin.h -- Public interface for intrin.c
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
diff --git a/gcc/f/lab.c b/gcc/f/lab.c
index 772553105cc..5bf37928672 100644
--- a/gcc/f/lab.c
+++ b/gcc/f/lab.c
@@ -1,159 +1 @@
-/* lab.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
-
- Description:
- Complex data abstraction for Fortran labels. Maintains a single master
- list for all labels; it is expected initialization and termination of
- this list will occur on program-unit boundaries.
-
- Modifications:
- 22-Aug-89 JCB 1.1
- Change ffelab_new for new ffewhere interface.
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "lab.h"
-#include "malloc.h"
-
-/* Externals defined here. */
-
-ffelab ffelab_list_;
-ffelabNumber ffelab_num_news_;
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffelab_find -- Find the ffelab object having the desired label value
-
- ffelab l;
- ffelabValue v;
- l = ffelab_find(v);
-
- If the desired ffelab object doesn't exist, returns NULL.
-
- Straightforward search of list of ffelabs. */
-
-ffelab
-ffelab_find (ffelabValue v)
-{
- ffelab l;
-
- for (l = ffelab_list_; (l != NULL) && (ffelab_value (l) != v); l = l->next)
- ;
-
- return l;
-}
-
-/* ffelab_finish -- Shut down label management
-
- ffelab_finish();
-
- At the end of processing a program unit, call this routine to shut down
- label management.
-
- Kill all the labels on the list. */
-
-void
-ffelab_finish ()
-{
- ffelab l;
- ffelab pl;
-
- for (pl = NULL, l = ffelab_list_; l != NULL; pl = l, l = l->next)
- if (pl != NULL)
- malloc_kill_ks (ffe_pool_any_unit (), pl, sizeof (*pl));
-
- if (pl != NULL)
- malloc_kill_ks (ffe_pool_any_unit (), pl, sizeof (*pl));
-}
-
-/* ffelab_init_3 -- Initialize label management system
-
- ffelab_init_3();
-
- Initialize the label management system. Do this before a new program
- unit is going to be processed. */
-
-void
-ffelab_init_3 ()
-{
- ffelab_list_ = NULL;
- ffelab_num_news_ = 0;
-}
-
-/* ffelab_new -- Create an ffelab object.
-
- ffelab l;
- ffelabValue v;
- l = ffelab_new(v);
-
- Create a label having a given value. If the value isn't known, pass
- FFELAB_valueNONE, and set it later with ffelab_set_value.
-
- Allocate, initialize, and stick at top of label list.
-
- 22-Aug-89 JCB 1.1
- Change for new ffewhere interface. */
-
-ffelab
-ffelab_new (ffelabValue v)
-{
- ffelab l;
-
- ++ffelab_num_news_;
- l = (ffelab) malloc_new_ks (ffe_pool_any_unit (), "FFELAB label", sizeof (*l));
- l->next = ffelab_list_;
-#ifdef FFECOM_labelHOOK
- l->hook = FFECOM_labelNULL;
-#endif
- l->value = v;
- l->firstref_line = ffewhere_line_unknown ();
- l->firstref_col = ffewhere_column_unknown ();
- l->doref_line = ffewhere_line_unknown ();
- l->doref_col = ffewhere_column_unknown ();
- l->definition_line = ffewhere_line_unknown ();
- l->definition_col = ffewhere_column_unknown ();
- l->type = FFELAB_typeUNKNOWN;
- ffelab_list_ = l;
- return l;
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/lab.h b/gcc/f/lab.h
index d79e35b85ce..5bf37928672 100644
--- a/gcc/f/lab.h
+++ b/gcc/f/lab.h
@@ -1,154 +1 @@
-/* lab.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- lab.c
-
- Modifications:
- 22-Aug-89 JCB 1.1
- Change for new ffewhere interface.
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_lab
-#define _H_f_lab
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFELAB_typeUNKNOWN, /* No info yet on label. */
- FFELAB_typeANY, /* Label valid for anything, no msgs. */
- FFELAB_typeUSELESS, /* No valid way to reference this label. */
- FFELAB_typeASSIGNABLE, /* Target of ASSIGN: so FORMAT or BRANCH. */
- FFELAB_typeFORMAT, /* FORMAT label. */
- FFELAB_typeLOOPEND, /* Target of a labeled DO statement. */
- FFELAB_typeNOTLOOP, /* Branch target statement not valid DO
- target. */
- FFELAB_typeENDIF, /* END IF label. */
- FFELAB_type
- } ffelabType;
-
-#define FFELAB_valueNONE 0
-#define FFELAB_valueMAX 99999
-
-/* Typedefs. */
-
-typedef struct _ffelab_ *ffelab;
-typedef ffelab ffelabHandle;
-typedef unsigned long ffelabNumber; /* Count of new labels. */
-#define ffelabNumber_f "l"
-typedef unsigned long ffelabValue;
-#define ffelabValue_f "l"
-
-/* Include files needed by this one. */
-
-#include "com.h"
-#include "where.h"
-
-/* Structure definitions. */
-
-struct _ffelab_
- {
- ffelab next;
-#ifdef FFECOM_labelHOOK
- ffecomLabel hook;
-#endif
- ffelabValue value; /* 1 through 99999, or 100000+ for temp
- labels. */
- unsigned long blocknum; /* Managed entirely by user of module. */
- ffewhereLine firstref_line;
- ffewhereColumn firstref_col;
- ffewhereLine doref_line;
- ffewhereColumn doref_col;
- ffewhereLine definition_line; /* ffewhere_line_unknown() if not
- defined. */
- ffewhereColumn definition_col;
- ffelabType type;
- };
-
-/* Global objects accessed by users of this module. */
-
-extern ffelab ffelab_list_;
-extern ffelabNumber ffelab_num_news_;
-
-/* Declare functions with prototypes. */
-
-ffelab ffelab_find (ffelabValue v);
-void ffelab_finish (void);
-void ffelab_init_3 (void);
-ffelab ffelab_new (ffelabValue v);
-
-/* Define macros. */
-
-#define ffelab_blocknum(l) ((l)->blocknum)
-#define ffelab_definition_column(l) ((l)->definition_col)
-#define ffelab_definition_filename(l) \
- ffewhere_line_filename((l)->definition_line)
-#define ffelab_definition_filelinenum(l) \
- ffewhere_line_filelinenum((l)->definition_line)
-#define ffelab_definition_line(l) ((l)->definition_line)
-#define ffelab_definition_line_number(l) \
- ffewhere_line_number((l)->definition_line)
-#define ffelab_doref_column(l) ((l)->doref_col)
-#define ffelab_doref_filename(l) ffewhere_line_filename((l)->doref_line)
-#define ffelab_doref_filelinenum(l) ffewhere_line_filelinenum((l)->doref_line)
-#define ffelab_doref_line(l) ((l)->doref_line)
-#define ffelab_doref_line_number(l) ffewhere_line_number((l)->doref_line)
-#define ffelab_firstref_column(l) ((l)->firstref_col)
-#define ffelab_firstref_filename(l) ffewhere_line_filename((l)->firstref_line)
-#define ffelab_firstref_filelinenum(l) \
- ffewhere_line_filelinenum((l)->firstref_line)
-#define ffelab_firstref_line(l) ((l)->firstref_line)
-#define ffelab_firstref_line_number(l) ffewhere_line_number((l)->firstref_line)
-#define ffelab_handle_done(h)
-#define ffelab_handle_first() ((ffelabHandle) ffelab_list_)
-#define ffelab_handle_next(h) ((ffelabHandle) (((ffelab) h)->next))
-#define ffelab_handle_target(h) ((ffelab) h)
-#define ffelab_hook(l) ((l)->hook)
-#define ffelab_init_0()
-#define ffelab_init_1()
-#define ffelab_init_2()
-#define ffelab_init_4()
-#define ffelab_kill(l) ffelab_set_value(l,FFELAB_valueNONE);
-#define ffelab_new_generated() (ffelab_new(ffelab_generated_++))
-#define ffelab_number() (ffelab_num_news_)
-#define ffelab_set_blocknum(l,b) ((l)->blocknum = (b))
-#define ffelab_set_definition_column(l,cn) ((l)->definition_col = (cn))
-#define ffelab_set_definition_line(l,ln) ((l)->definition_line = (ln))
-#define ffelab_set_doref_column(l,cn) ((l)->doref_col = (cn))
-#define ffelab_set_doref_line(l,ln) ((l)->doref_line = (ln))
-#define ffelab_set_firstref_column(l,cn) ((l)->firstref_col = (cn))
-#define ffelab_set_firstref_line(l,ln) ((l)->firstref_line = (ln))
-#define ffelab_set_hook(l,h) ((l)->hook = (h))
-#define ffelab_set_type(l,t) ((l)->type = (t))
-#define ffelab_terminate_0()
-#define ffelab_terminate_1()
-#define ffelab_terminate_2()
-#define ffelab_terminate_3()
-#define ffelab_terminate_4()
-#define ffelab_type(l) ((l)->type)
-#define ffelab_value(l) ((l)->value)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/lang-options.h b/gcc/f/lang-options.h
index 29c79190dbf..0fa927a2156 100644
--- a/gcc/f/lang-options.h
+++ b/gcc/f/lang-options.h
@@ -1,6 +1,6 @@
/* lang-options.h file for Fortran
- Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Copyright (C) 1995-1998 Free Software Foundation, Inc.
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -27,134 +27,138 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifdef __STDC__ /* To be consistent with lang-specs.h. Maybe avoid
overflowing some old compiler's tables, etc. */
- "-fversion",
- "-fnull-version",
- "-fset-g77-defaults",
+DEFINE_LANG_NAME ("Fortran")
+
+/* Use of FTNOPT makes tracking changes between FSF-g77 and egcs-g77
+ easier, since FSF-gcc doesn't support doc strings. */
+#define FTNOPT(opt,doc) { opt, doc },
+
+FTNOPT( "-fversion", "Print g77-specific compiler version info, run internal tests" )
+FTNOPT( "-fnull-version", "" )
/*"-fident",*/
/*"-fno-ident",*/
- "-ff66",
- "-fno-f66",
- "-ff77",
- "-fno-f77",
- "-ff90",
- "-fno-f90",
- "-fautomatic",
- "-fno-automatic",
- "-fdollar-ok",
- "-fno-dollar-ok",
- "-ff2c",
- "-fno-f2c",
- "-ff2c-library",
- "-fno-f2c-library",
- "-ffree-form",
- "-fno-free-form",
- "-ffixed-form",
- "-fno-fixed-form",
- "-fpedantic",
- "-fno-pedantic",
- "-fvxt",
- "-fno-vxt",
- "-fugly",
- "-fno-ugly",
- "-fugly-args",
- "-fno-ugly-args",
- "-fugly-assign",
- "-fno-ugly-assign",
- "-fugly-assumed",
- "-fno-ugly-assumed",
- "-fugly-comma",
- "-fno-ugly-comma",
- "-fugly-complex",
- "-fno-ugly-complex",
- "-fugly-init",
- "-fno-ugly-init",
- "-fugly-logint",
- "-fno-ugly-logint",
- "-fxyzzy",
- "-fno-xyzzy",
- "-finit-local-zero",
- "-fno-init-local-zero",
- "-fbackslash",
- "-fno-backslash",
- "-femulate-complex",
- "-fno-emulate-complex",
- "-funderscoring",
- "-fno-underscoring",
- "-fsecond-underscore",
- "-fno-second-underscore",
- "-fintrin-case-initcap",
- "-fintrin-case-upper",
- "-fintrin-case-lower",
- "-fintrin-case-any",
- "-fmatch-case-initcap",
- "-fmatch-case-upper",
- "-fmatch-case-lower",
- "-fmatch-case-any",
- "-fsource-case-upper",
- "-fsource-case-lower",
- "-fsource-case-preserve",
- "-fsymbol-case-initcap",
- "-fsymbol-case-upper",
- "-fsymbol-case-lower",
- "-fsymbol-case-any",
- "-fcase-strict-upper",
- "-fcase-strict-lower",
- "-fcase-initcap",
- "-fcase-upper",
- "-fcase-lower",
- "-fcase-preserve",
- "-fbadu77-intrinsics-delete",
- "-fbadu77-intrinsics-disable",
- "-fbadu77-intrinsics-enable",
- "-fbadu77-intrinsics-hide",
- "-fdcp-intrinsics-delete",
- "-fdcp-intrinsics-disable",
- "-fdcp-intrinsics-enable",
- "-fdcp-intrinsics-hide",
- "-ff2c-intrinsics-delete",
- "-ff2c-intrinsics-disable",
- "-ff2c-intrinsics-enable",
- "-ff2c-intrinsics-hide",
- "-ff90-intrinsics-delete",
- "-ff90-intrinsics-disable",
- "-ff90-intrinsics-enable",
- "-ff90-intrinsics-hide",
- "-fgnu-intrinsics-delete",
- "-fgnu-intrinsics-disable",
- "-fgnu-intrinsics-enable",
- "-fgnu-intrinsics-hide",
- "-fmil-intrinsics-delete",
- "-fmil-intrinsics-disable",
- "-fmil-intrinsics-enable",
- "-fmil-intrinsics-hide",
- "-funix-intrinsics-delete",
- "-funix-intrinsics-disable",
- "-funix-intrinsics-enable",
- "-funix-intrinsics-hide",
- "-fvxt-intrinsics-delete",
- "-fvxt-intrinsics-disable",
- "-fvxt-intrinsics-enable",
- "-fvxt-intrinsics-hide",
- "-fzeros",
- "-fno-zeros",
- "-fdebug-kludge",
- "-fno-debug-kludge",
- "-fonetrip",
- "-fno-onetrip",
- "-fsilent",
- "-fno-silent",
- "-fglobals",
- "-fno-globals",
- "-ftypeless-boz",
- "-fno-typeless-boz",
- "-Wglobals",
- "-Wno-globals",
+FTNOPT( "-ff66", "Program is written in typical FORTRAN 66 dialect" )
+FTNOPT( "-fno-f66", "" )
+FTNOPT( "-ff77", "Program is written in typical Unix f77 dialect" )
+FTNOPT( "-fno-f77", "Program does not use Unix-f77 dialectal features" )
+FTNOPT( "-ff90", "Program is written in Fortran-90-ish dialect" )
+FTNOPT( "-fno-f90", "" )
+FTNOPT( "-fautomatic", "" )
+FTNOPT( "-fno-automatic", "Treat local vars and COMMON blocks as if they were named in SAVE statements" )
+FTNOPT( "-fdollar-ok", "Allow $ in symbol names" )
+FTNOPT( "-fno-dollar-ok", "" )
+FTNOPT( "-ff2c", "" )
+FTNOPT( "-fno-f2c", "f2c-compatible code need not be generated" )
+FTNOPT( "-ff2c-library", "" )
+FTNOPT( "-fno-f2c-library", "Unsupported; do not generate libf2c-calling code" )
+FTNOPT( "-ffree-form", "Program is written in Fortran-90-ish free form" )
+FTNOPT( "-fno-free-form", "" )
+FTNOPT( "-ffixed-form", "" )
+FTNOPT( "-fno-fixed-form", "" )
+FTNOPT( "-fpedantic", "Warn about use of (only a few for now) Fortran extensions" )
+FTNOPT( "-fno-pedantic", "" )
+FTNOPT( "-fvxt", "Program is written in VXT (Digital-like) FORTRAN" )
+FTNOPT( "-fno-vxt", "" )
+FTNOPT( "-fugly", "Obsolete; allow certain ugly features" )
+FTNOPT( "-fno-ugly", "" )
+FTNOPT( "-fugly-args", "" )
+FTNOPT( "-fno-ugly-args", "Hollerith and typeless constants not passed as arguments" )
+FTNOPT( "-fugly-assign", "Allow ordinary copying of ASSIGN'ed vars" )
+FTNOPT( "-fno-ugly-assign", "" )
+FTNOPT( "-fugly-assumed", "Dummy array dimensioned to (1) is assumed-size" )
+FTNOPT( "-fno-ugly-assumed", "" )
+FTNOPT( "-fugly-comma", "Trailing comma in procedure call denotes null argument" )
+FTNOPT( "-fno-ugly-comma", "" )
+FTNOPT( "-fugly-complex", "Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z" )
+FTNOPT( "-fno-ugly-complex", "" )
+FTNOPT( "-fugly-init", "" )
+FTNOPT( "-fno-ugly-init", "Initialization via DATA and PARAMETER is type-compatible" )
+FTNOPT( "-fugly-logint", "Allow INTEGER and LOGICAL interchangeability" )
+FTNOPT( "-fno-ugly-logint", "" )
+FTNOPT( "-fxyzzy", "Print internal debugging-related info" )
+FTNOPT( "-fno-xyzzy", "" )
+FTNOPT( "-finit-local-zero", "Initialize local vars and arrays to zero" )
+FTNOPT( "-fno-init-local-zero", "" )
+FTNOPT( "-fbackslash", "" )
+FTNOPT( "-fno-backslash", "Backslashes in character/hollerith constants not special (C-style)" )
+FTNOPT( "-femulate-complex", "" )
+FTNOPT( "-fno-emulate-complex", "Have compiler back end cope with COMPLEX arithmetic" )
+FTNOPT( "-funderscoring", "" )
+FTNOPT( "-fno-underscoring", "Disable the appending of underscores to externals" )
+FTNOPT( "-fsecond-underscore", "" )
+FTNOPT( "-fno-second-underscore", "Never append a second underscore to externals" )
+FTNOPT( "-fintrin-case-initcap", "Intrinsics spelled as e.g. SqRt" )
+FTNOPT( "-fintrin-case-upper", "Intrinsics in uppercase" )
+FTNOPT( "-fintrin-case-lower", "" )
+FTNOPT( "-fintrin-case-any", "Intrinsics letters in arbitrary cases" )
+FTNOPT( "-fmatch-case-initcap", "Language keywords spelled as e.g. IOStat" )
+FTNOPT( "-fmatch-case-upper", "Language keywords in uppercase" )
+FTNOPT( "-fmatch-case-lower", "" )
+FTNOPT( "-fmatch-case-any", "Language keyword letters in arbitrary cases" )
+FTNOPT( "-fsource-case-upper", "Internally convert most source to uppercase" )
+FTNOPT( "-fsource-case-lower", "" )
+FTNOPT( "-fsource-case-preserve", "Internally preserve source case" )
+FTNOPT( "-fsymbol-case-initcap", "Symbol names spelled in mixed case" )
+FTNOPT( "-fsymbol-case-upper", "Symbol names in uppercase" )
+FTNOPT( "-fsymbol-case-lower", "Symbol names in lowercase" )
+FTNOPT( "-fsymbol-case-any", "" )
+FTNOPT( "-fcase-strict-upper", "Program written in uppercase" )
+FTNOPT( "-fcase-strict-lower", "Program written in lowercase" )
+FTNOPT( "-fcase-initcap", "Program written in strict mixed-case" )
+FTNOPT( "-fcase-upper", "Compile as if program written in uppercase" )
+FTNOPT( "-fcase-lower", "Compile as if program written in lowercase" )
+FTNOPT( "-fcase-preserve", "Preserve all spelling (case) used in program" )
+FTNOPT( "-fbadu77-intrinsics-delete", "Delete libU77 intrinsics with bad interfaces" )
+FTNOPT( "-fbadu77-intrinsics-disable", "Disable libU77 intrinsics with bad interfaces" )
+FTNOPT( "-fbadu77-intrinsics-enable", "" )
+FTNOPT( "-fbadu77-intrinsics-hide", "Hide libU77 intrinsics with bad interfaces" )
+FTNOPT( "-ff2c-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics f2c supports" )
+FTNOPT( "-ff2c-intrinsics-disable", "Disable non-FORTRAN-77 intrinsics f2c supports" )
+FTNOPT( "-ff2c-intrinsics-enable", "" )
+FTNOPT( "-ff2c-intrinsics-hide", "Hide non-FORTRAN-77 intrinsics f2c supports" )
+FTNOPT( "-ff90-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics F90 supports" )
+FTNOPT( "-ff90-intrinsics-disable", "Disable non-FORTRAN-77 intrinsics F90 supports" )
+FTNOPT( "-ff90-intrinsics-enable", "" )
+FTNOPT( "-ff90-intrinsics-hide", "Hide non-FORTRAN-77 intrinsics F90 supports" )
+FTNOPT( "-fgnu-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics g77 supports" )
+FTNOPT( "-fgnu-intrinsics-disable", "Disable non-FORTRAN 77 intrinsics F90 supports" )
+FTNOPT( "-fgnu-intrinsics-enable", "" )
+FTNOPT( "-fgnu-intrinsics-hide", "Hide non-FORTRAN 77 intrinsics F90 supports" )
+FTNOPT( "-fmil-intrinsics-delete", "Delete MIL-STD 1753 intrinsics" )
+FTNOPT( "-fmil-intrinsics-disable", "Disable MIL-STD 1753 intrinsics" )
+FTNOPT( "-fmil-intrinsics-enable", "" )
+FTNOPT( "-fmil-intrinsics-hide", "Hide MIL-STD 1753 intrinsics" )
+FTNOPT( "-funix-intrinsics-delete", "Delete libU77 intrinsics" )
+FTNOPT( "-funix-intrinsics-disable", "Disable libU77 intrinsics" )
+FTNOPT( "-funix-intrinsics-enable", "" )
+FTNOPT( "-funix-intrinsics-hide", "Hide libU77 intrinsics" )
+FTNOPT( "-fvxt-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports" )
+FTNOPT( "-fvxt-intrinsics-disable", "Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports" )
+FTNOPT( "-fvxt-intrinsics-enable", "" )
+FTNOPT( "-fvxt-intrinsics-hide", "Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports" )
+FTNOPT( "-fzeros", "Treat initial values of 0 like non-zero values" )
+FTNOPT( "-fno-zeros", "" )
+FTNOPT( "-fdebug-kludge", "Emit special debugging information for COMMON and EQUIVALENCE" )
+FTNOPT( "-fno-debug-kludge", "" )
+FTNOPT( "-fonetrip", "Take at least one trip through each iterative DO loop" )
+FTNOPT( "-fno-onetrip", "" )
+FTNOPT( "-fsilent", "" )
+FTNOPT( "-fno-silent", "Print names of program units as they are compiled" )
+FTNOPT( "-fglobals", "" )
+FTNOPT( "-fno-globals", "Disable fatal diagnostics about inter-procedural problems" )
+FTNOPT( "-ftypeless-boz", "Make prefix-radix non-decimal constants be typeless" )
+FTNOPT( "-fno-typeless-boz", "" )
+FTNOPT( "-Wglobals", "" )
+FTNOPT( "-Wno-globals", "Disable warnings about inter-procedural problems" )
/*"-Wimplicit",*/
/*"-Wno-implicit",*/
- "-Wsurprising",
- "-Wno-surprising",
+FTNOPT( "-Wsurprising", "Warn about constructs with surprising meanings" )
+FTNOPT( "-Wno-surprising", "" )
/*"-Wall",*/
/* Prefix options. */
- "-I",
- "-ffixed-line-length-",
+FTNOPT( "-I", "Add a directory for INCLUDE searching" )
+FTNOPT( "-ffixed-line-length-", "Set the maximum line length" )
+
+#undef FTNOPT
+
#endif
diff --git a/gcc/f/lang-specs.h b/gcc/f/lang-specs.h
index c9419c33e20..bf8786febde 100644
--- a/gcc/f/lang-specs.h
+++ b/gcc/f/lang-specs.h
@@ -1,6 +1,6 @@
/* lang-specs.h file for Fortran
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -24,15 +24,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This is the contribution to the `default_compilers' array in gcc.c for
g77. */
-#ifdef __STDC__ /* Else stringizing of OO below won't work, but in
- K&R case we're not building the f77 language. */
-
-#ifdef OBJECT_SUFFIX /* Not defined compiling gcc.c prior to 2.7.0. */
-#define OO "%O"
-#else
-#define OO ".o"
-#endif
-
{".F", {"@f77-cpp-input"}},
{".fpp", {"@f77-cpp-input"}},
{"@f77-cpp-input",
@@ -52,7 +43,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
- "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} -fset-g77-defaults %(f771) \
+ "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} %(f771) \
%{!Q:-quiet} -dumpbase %b.F %{d*} %{m*} %{a}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
%{v:-version -fversion} %{pg:-p} %{p} %{f*} %{I*}\
@@ -60,14 +51,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
%{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\
- %{c:%W{o*}%{!o*:-o %w%b" OO "}}%{!c:-o %d%w%u" OO "}\
+ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},
{".r", {"@ratfor"}},
{"@ratfor",
{"ratfor %{C} %{v}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{!E:%{!pipe:-o %g.f}}%{E:%W{o*}} %i |\n",
- "%{!E:f771 %{!pipe:%g.f} -fset-g77-defaults %(f771) \
+ "%{!E:f771 %{!pipe:%g.f} %(f771) \
%{!Q:-quiet} -dumpbase %b.r %{d*} %{m*} %{a}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
%{v:-version -fversion} %{pg:-p} %{p} %{f*} %{I*}\
@@ -75,12 +66,12 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
%{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\
- %{c:%W{o*}%{!o*:-o %w%b" OO "}}%{!c:-o %d%w%u" OO "}\
+ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}"}},
{".f", {"@f77"}},
{".for", {"@f77"}},
{"@f77",
- {"%{!M:%{!MM:%{!E:f771 %i -fset-g77-defaults %(f771) \
+ {"%{!M:%{!MM:%{!E:f771 %i %(f771) \
%{!Q:-quiet} -dumpbase %b.f %{d*} %{m*} %{a}\
%{g*} %{O*} %{W*} %{w} %{pedantic*}\
%{v:-version -fversion} %{pg:-p} %{p} %{f*} %{I*}\
@@ -88,9 +79,28 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
%{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\
- %{c:%W{o*}%{!o*:-o %w%b" OO "}}%{!c:-o %d%w%u" OO "}\
+ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},
-
-#undef OO
-
-#endif
+ {"@f77-version",
+ {"cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I \
+ %{C:%{!E:%eGNU C does not support -C without using -E}} \
+ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} \
+ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 \
+ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} \
+ %{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional \
+ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z \
+ /dev/null /dev/null \n\
+ f771 -fnull-version %(f771) \
+ %{!Q:-quiet} -dumpbase g77-version.f %{d*} %{m*} %{a} \
+ %{g*} %{O*} %{W*} %{w} %{pedantic*} \
+ -version -fversion %{f*} %{I*} -o %g.s /dev/null \n\
+ as %a %Y -o %g%O %g.s %A \n\
+ ld %l %X -o %g %g%O %{A} %{d} %{e*} %{m} %{N} %{n} \
+ %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} \
+ %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
+ %{static:} %{L*} %D -lg2c -lm \
+ %{!nostdlib:%{!nodefaultlibs:%G %L %G}} \
+ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} \
+ %{T*} \n\
+ %g \n"}},
diff --git a/gcc/f/lex.c b/gcc/f/lex.c
index 1a0913b5872..c43aa7e05b9 100644
--- a/gcc/f/lex.c
+++ b/gcc/f/lex.c
@@ -1,6 +1,6 @@
/* Implementation of Fortran lexer
- Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Copyright (C) 1995-1998 Free Software Foundation, Inc.
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -20,7 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "proj.h"
-#include <ctype.h>
#include "top.h"
#include "bad.h"
#include "com.h"
@@ -28,10 +27,11 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "malloc.h"
#include "src.h"
#if FFECOM_targetCURRENT == FFECOM_targetGCC
-#include "config.j"
#include "flags.j"
#include "input.j"
+#include "toplev.j"
#include "tree.j"
+#include "output.j" /* Must follow tree.j so TREE_CODE is defined! */
#endif
#ifdef DWARF_DEBUGGING_INFO
@@ -769,7 +769,7 @@ ffelex_cfelex_ (ffelexToken *xtoken, FILE *finput, int c)
r = &q[buffer_length];
}
c = ffelex_getc_ (finput);
- if (!isdigit (c))
+ if (! ISDIGIT (c))
break;
}
*p = '\0';
@@ -1077,6 +1077,23 @@ ffelex_get_directive_line_ (char **text, FILE *finput)
Returns the next character unhandled, which is always newline or EOF. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
+
+#if defined HANDLE_PRAGMA
+/* Local versions of these macros, that can be passed as function pointers. */
+static int
+pragma_getc ()
+{
+ return getc (finput);
+}
+
+static void
+pragma_ungetc (arg)
+ int arg;
+{
+ ungetc (arg, finput);
+}
+#endif /* HANDLE_PRAGMA */
+
static int
ffelex_hash_ (FILE *finput)
{
@@ -1105,17 +1122,42 @@ ffelex_hash_ (FILE *finput)
&& ((c = getc (finput)) == ' ' || c == '\t' || c == '\n'
|| c == EOF))
{
- goto skipline;
#if 0 /* g77 doesn't handle pragmas, so ignores them FOR NOW. */
-#ifdef HANDLE_SYSV_PRAGMA
- return handle_sysv_pragma (finput, c);
-#else /* !HANDLE_SYSV_PRAGMA */
+ static char buffer [128];
+ char * buff = buffer;
+
+ /* Read the pragma name into a buffer. */
+ while (isspace (c = getc (finput)))
+ continue;
+
+ do
+ {
+ * buff ++ = c;
+ c = getc (finput);
+ }
+ while (c != EOF && ! isspace (c) && c != '\n'
+ && buff < buffer + 128);
+
+ pragma_ungetc (c);
+
+ * -- buff = 0;
#ifdef HANDLE_PRAGMA
- HANDLE_PRAGMA (finput);
+ if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc, buffer))
+ goto skipline;
#endif /* HANDLE_PRAGMA */
- goto skipline;
-#endif /* !HANDLE_SYSV_PRAGMA */
+#ifdef HANDLE_GENERIC_PRAGMAS
+ if (handle_generic_pragma (buffer))
+ goto skipline;
+#endif /* !HANDLE_GENERIC_PRAGMAS */
+
+ /* Issue a warning message if we have been asked to do so.
+ Ignoring unknown pragmas in system header file unless
+ an explcit -Wunknown-pragmas has been given. */
+ if (warn_unknown_pragmas > 1
+ || (warn_unknown_pragmas && ! in_system_header))
+ warning ("ignoring pragma: %s", token_buffer);
#endif /* 0 */
+ goto skipline;
}
}
@@ -1811,10 +1853,10 @@ ffelex_expecting_character ()
ffelexHandler
ffelex_file_fixed (ffewhereFile wf, FILE *f)
{
- register int c; /* Character currently under consideration. */
- register ffewhereColumnNumber column; /* Not really; 0 means column 1... */
+ register int c = 0; /* Character currently under consideration. */
+ register ffewhereColumnNumber column = 0; /* Not really; 0 means column 1... */
bool disallow_continuation_line;
- bool ignore_disallowed_continuation;
+ bool ignore_disallowed_continuation = FALSE;
int latest_char_in_file = 0; /* For getting back into comment-skipping
code. */
ffelexType lextype;
@@ -1848,6 +1890,23 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f)
ffelex_current_wl_ = ffewhere_line_unknown ();
ffelex_current_wc_ = ffewhere_column_unknown ();
latest_char_in_file = '\n';
+
+ if (ffe_is_null_version ())
+ {
+ /* Just substitute a "program" directly here. */
+
+ char line[] = " call g77__fvers;call g77__ivers;call g77__uvers;end";
+ char *p;
+
+ column = 0;
+ for (p = &line[0]; *p != '\0'; ++p)
+ column = ffelex_image_char_ (*p, column);
+
+ c = EOF;
+
+ goto have_line; /* :::::::::::::::::::: */
+ }
+
goto first_line; /* :::::::::::::::::::: */
/* Come here to get a new line. */
@@ -1995,6 +2054,9 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f)
column = ffelex_final_nontab_column_;
}
+
+ have_line: /* :::::::::::::::::::: */
+
ffelex_card_image_[column] = '\0';
ffelex_card_length_ = column;
@@ -3012,11 +3074,11 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f)
ffelexHandler
ffelex_file_free (ffewhereFile wf, FILE *f)
{
- register int c; /* Character currently under consideration. */
- register ffewhereColumnNumber column; /* Not really; 0 means column 1... */
- bool continuation_line;
+ register int c = 0; /* Character currently under consideration. */
+ register ffewhereColumnNumber column = 0; /* Not really; 0 means column 1... */
+ bool continuation_line = FALSE;
ffewhereColumnNumber continuation_column;
- int latest_char_in_file; /* For getting back into comment-skipping
+ int latest_char_in_file = 0; /* For getting back into comment-skipping
code. */
/* Lex is called for a particular file, not for a particular program unit.
@@ -4293,7 +4355,7 @@ ffelex_splice_tokens (ffelexHandler first, ffelexToken master,
while (*p != '\0')
{
- if (isdigit (*p))
+ if (ISDIGIT (*p))
{
t = ffelex_token_number_from_names (master, i);
p += ffelex_token_length (t);
diff --git a/gcc/f/lex.h b/gcc/f/lex.h
index bae1147dcc5..b5235f86279 100644
--- a/gcc/f/lex.h
+++ b/gcc/f/lex.h
@@ -1,202 +1,2 @@
-/* lex.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- lex.c
-
- Modifications:
- 22-Aug-89 JCB 1.1
- Change for new ffewhere interface.
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_lex
-#define _H_f_lex
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFELEX_typeNONE,
- FFELEX_typeCOMMENT,
- FFELEX_typeEOS,
- FFELEX_typeEOF,
- FFELEX_typeERROR,
- FFELEX_typeRAW,
- FFELEX_typeQUOTE,
- FFELEX_typeDOLLAR,
- FFELEX_typeHASH,
- FFELEX_typePERCENT,
- FFELEX_typeAMPERSAND,
- FFELEX_typeAPOSTROPHE,
- FFELEX_typeOPEN_PAREN,
- FFELEX_typeCLOSE_PAREN,
- FFELEX_typeASTERISK,
- FFELEX_typePLUS,
- FFELEX_typeMINUS,
- FFELEX_typePERIOD,
- FFELEX_typeSLASH,
- FFELEX_typeNUMBER, /* Grep: [0-9][0-9]*. */
- FFELEX_typeOPEN_ANGLE,
- FFELEX_typeEQUALS,
- FFELEX_typeCLOSE_ANGLE,
- FFELEX_typeNAME, /* Grep: [A-Za-z][A-Za-z0-9_]*. */
- FFELEX_typeCOMMA,
- FFELEX_typePOWER, /* "**". */
- FFELEX_typeCONCAT, /* "//". */
- FFELEX_typeDEBUG,
- FFELEX_typeNAMES, /* Same as FFELEX_typeNAME in initial
- context. */
- FFELEX_typeHOLLERITH, /* <text> part of <nn>H<text>. */
- FFELEX_typeCHARACTER, /* <text> part of '<text>' or "<text>". */
- FFELEX_typeCOLON,
- FFELEX_typeSEMICOLON,
- FFELEX_typeUNDERSCORE,
- FFELEX_typeQUESTION,
- FFELEX_typeOPEN_ARRAY, /* "(/". */
- FFELEX_typeCLOSE_ARRAY, /* "/)". */
- FFELEX_typeCOLONCOLON, /* "::". */
- FFELEX_typeREL_LE, /* "<=". */
- FFELEX_typeREL_NE, /* "<>". */
- FFELEX_typeREL_EQ, /* "==". */
- FFELEX_typePOINTS, /* "=>". */
- FFELEX_typeREL_GE, /* ">=". */
- FFELEX_type
- } ffelexType;
-
-/* Typedefs. */
-
-typedef struct _lextoken_ *ffelexToken;
-typedef void *lex_sigh_;
-typedef lex_sigh_ (*lex_sigh__) (ffelexToken);
-typedef lex_sigh__ (*ffelexHandler) (ffelexToken);
-
-/* Include files needed by this one. */
-
-#include <ctype.h>
-#include "top.h"
-#include "where.h"
-
-/* Structure definitions. */
-
-struct _lextoken_
- {
- long int id_; /* DEBUG ONLY. */
- ffeTokenLength size;
- ffeTokenLength length;
- unsigned short uses;
- char *text;
- ffelexType type;
- ffewhereLine where_line;
- ffewhereColumn where_col;
- ffewhereLine currentnames_line; /* For tracking NAMES tokens. */
- ffewhereColumn currentnames_col; /* For tracking NAMES tokens. */
- ffewhereTrack wheretrack; /* For tracking NAMES tokens. */
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffelex_display_token (ffelexToken t);
-bool ffelex_expecting_character (void);
-ffelexHandler ffelex_file_fixed (ffewhereFile wf, FILE *f);
-ffelexHandler ffelex_file_free (ffewhereFile wf, FILE *f);
-void ffelex_hash_kludge (FILE *f);
-void ffelex_init_1 (void);
-bool ffelex_is_names_expected (void);
-char *ffelex_line (void);
-ffewhereColumnNumber ffelex_line_length (void);
-ffewhereLineNumber ffelex_line_number (void);
-void ffelex_set_expecting_hollerith (long length, char which,
- ffewhereLine line,
- ffewhereColumn column);
-void ffelex_set_handler (ffelexHandler first);
-void ffelex_set_hexnum (bool on);
-void ffelex_set_include (ffewhereFile wf, bool free_form, FILE *fi);
-void ffelex_set_names (bool on);
-void ffelex_set_names_pure (bool on);
-ffelexHandler ffelex_splice_tokens (ffelexHandler first, ffelexToken master,
- ffeTokenLength start);
-ffelexHandler ffelex_swallow_tokens (ffelexToken t, ffelexHandler handler);
-ffelexToken ffelex_token_dollar_from_names (ffelexToken t,
- ffeTokenLength start);
-void ffelex_token_kill (ffelexToken t);
-ffelexToken ffelex_token_name_from_names (ffelexToken t,
- ffeTokenLength start,
- ffeTokenLength len);
-ffelexToken ffelex_token_names_from_names (ffelexToken t,
- ffeTokenLength start,
- ffeTokenLength len);
-ffelexToken ffelex_token_new (void);
-ffelexToken ffelex_token_new_character (char *s, ffewhereLine l,
- ffewhereColumn c);
-ffelexToken ffelex_token_new_eof (void);
-ffelexToken ffelex_token_new_name (char *s, ffewhereLine l,
- ffewhereColumn c);
-ffelexToken ffelex_token_new_names (char *s, ffewhereLine l,
- ffewhereColumn c);
-ffelexToken ffelex_token_new_number (char *s, ffewhereLine l,
- ffewhereColumn c);
-ffelexToken ffelex_token_new_simple_ (ffelexType type, ffewhereLine l,
- ffewhereColumn c);
-ffelexToken ffelex_token_number_from_names (ffelexToken t,
- ffeTokenLength start);
-ffelexToken ffelex_token_uscore_from_names (ffelexToken t,
- ffeTokenLength start);
-ffelexToken ffelex_token_use (ffelexToken t);
-
-/* Define macros. */
-
-#define ffelex_init_0()
-#define ffelex_init_2()
-#define ffelex_init_3()
-#define ffelex_init_4()
-#define ffelex_is_firstnamechar(c) \
- (isalpha ((c)) || ((c) == '_'))
-#define ffelex_terminate_0()
-#define ffelex_terminate_1()
-#define ffelex_terminate_2()
-#define ffelex_terminate_3()
-#define ffelex_terminate_4()
-#define ffelex_token_length(t) ((t)->length)
-#define ffelex_token_new_eos(l,c) \
- ffelex_token_new_simple_ (FFELEX_typeEOS, (l), (c))
-#define ffelex_token_new_period(l,c) \
- ffelex_token_new_simple_ (FFELEX_typePERIOD, (l), (c))
-#define ffelex_token_strcmp(t1,t2) strcmp ((t1)->text, (t2)->text)
-#define ffelex_token_text(t) ((t)->text)
-#define ffelex_token_type(t) ((t)->type)
-#define ffelex_token_where_column(t) ((t)->where_col)
-#define ffelex_token_where_filename(t) \
- ffewhere_line_filename ((t)->where_line)
-#define ffelex_token_where_filelinenum(t) \
- ffewhere_line_filelinenum((t)->where_line)
-#define ffelex_token_where_line(t) ((t)->where_line)
-#define ffelex_token_where_line_number(t) \
- ffewhere_line_number ((t)->where_line)
-#define ffelex_token_wheretrack(t) ((t)->wheretrack)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
+ (ISALPHA ((c)) || ((c) == '_'))
diff --git a/gcc/f/malloc.c b/gcc/f/malloc.c
index 4a553e92084..456021149ea 100644
--- a/gcc/f/malloc.c
+++ b/gcc/f/malloc.c
@@ -1,6 +1,6 @@
/* malloc.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
diff --git a/gcc/f/malloc.h b/gcc/f/malloc.h
index 3d3cd50c404..5bf37928672 100644
--- a/gcc/f/malloc.h
+++ b/gcc/f/malloc.h
@@ -1,183 +1 @@
-/* malloc.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- malloc.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_malloc
-#define _H_f_malloc
-
-#ifndef MALLOC_DEBUG
-#define MALLOC_DEBUG 0 /* 1 means check caller's use of this module. */
-#endif
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- MALLOC_typeKS_,
- MALLOC_typeKSR_,
- MALLOC_typeKP_,
- MALLOC_typeKPR_,
- MALLOC_typeUS_,
- MALLOC_typeUSR_,
- MALLOC_type_
- } mallocType_;
-
-/* Typedefs. */
-
-typedef struct _malloc_area_ *mallocArea_;
-typedef struct _malloc_pool_ *mallocPool;
-typedef unsigned long int mallocSize;
-#define mallocSize_f "l"
-
-/* Include files needed by this one. */
-
-
-/* Structure definitions. */
-
-struct _malloc_area_
- {
- mallocArea_ next;
- mallocArea_ previous;
- void *where;
-#if MALLOC_DEBUG
- mallocSize size;
- mallocType_ type;
-#endif
- char name[1];
- };
-
-struct _malloc_pool_
- {
- mallocPool next;
- mallocPool previous;
- mallocPool eldest;
- mallocPool youngest;
- mallocArea_ first;
- mallocArea_ last;
- unsigned long uses;
-#if MALLOC_DEBUG
- mallocSize allocated;
- mallocSize freed;
- mallocSize old_sizes;
- mallocSize new_sizes;
- unsigned long allocations;
- unsigned long frees;
- unsigned long resizes;
-#endif
- char name[1];
- };
-
-struct _malloc_root_
- {
- struct _malloc_pool_ malloc_pool_image_;
- };
-
-/* Global objects accessed by users of this module. */
-
-extern struct _malloc_root_ malloc_root_;
-
-/* Declare functions with prototypes. */
-
-void malloc_display_ (mallocArea_ a);
-mallocArea_ malloc_find_inpool_ (mallocPool pool, void *ptr);
-void malloc_init (void);
-void malloc_kill_inpool_ (mallocPool pool, mallocType_ type, void *ptr,
- mallocSize size);
-void *malloc_new_ (mallocSize size);
-void *malloc_new_inpool_ (mallocPool pool, mallocType_ type, char *name,
- mallocSize size);
-void *malloc_new_zinpool_ (mallocPool pool, mallocType_ type, char *name,
- mallocSize size, int z);
-void malloc_pool_display (mallocPool p);
-char malloc_pool_find_ (mallocPool p, mallocPool parent);
-void malloc_pool_kill (mallocPool p);
-mallocPool malloc_pool_new (char *name, mallocPool parent, unsigned long chunks);
-mallocPool malloc_pool_use (mallocPool p);
-void *malloc_resize_ (void *ptr, mallocSize new_size);
-void *malloc_resize_inpool_ (mallocPool pool, mallocType_ type, void *ptr,
- mallocSize new_size, mallocSize old_size);
-void malloc_verify_inpool_ (mallocPool pool, mallocType_ type, void *ptr,
- mallocSize size);
-
-/* Define macros. */
-
-#define malloc_new_ks(pool,name,size) \
- malloc_new_inpool_ (pool,MALLOC_typeKS_,name,size)
-#define malloc_new_ksr(pool,name,size) \
- malloc_new_inpool_ (pool,MALLOC_typeKSR_,name,size)
-#define malloc_new_kp(pool,name,size) \
- malloc_new_inpool_ (pool,MALLOC_typeKP_,name,size)
-#define malloc_new_kpr(pool,name,size) \
- malloc_new_inpool_ (pool,MALLOC_typeKPR_,name,size)
-#define malloc_new_us(pool,name,size) \
- malloc_new_inpool_ (pool,MALLOC_typeUS_,name,size)
-#define malloc_new_usr(pool,name,size) \
- malloc_new_inpool_ (pool,MALLOC_typeUSR_,name,size)
-#define malloc_new_zks(pool,name,size,z) \
- malloc_new_zinpool_ (pool,MALLOC_typeKS_,name,size,z)
-#define malloc_new_zksr(pool,name,size,z) \
- malloc_new_zinpool_ (pool,MALLOC_typeKSR_,name,size,z)
-#define malloc_new_zkp(pool,name,size,z) \
- malloc_new_zinpool_ (pool,MALLOC_typeKP_,name,size,z)
-#define malloc_new_zkpr(pool,name,size,z) \
- malloc_new_zinpool_ (pool,MALLOC_typeKPR_,name,size,z)
-#define malloc_new_zus(pool,name,size,z) \
- malloc_new_zinpool_ (pool,MALLOC_typeUS_,name,size,z)
-#define malloc_new_zusr(pool,name,size,z) \
- malloc_new_zinpool_ (pool,MALLOC_typeUSR_,name,size,z)
-#define malloc_kill_ks(pool,ptr,size) \
- malloc_kill_inpool_ (pool,MALLOC_typeKS_,ptr,size)
-#define malloc_kill_ksr(pool,ptr,size) \
- malloc_kill_inpool_ (pool,MALLOC_typeKSR_,ptr,size)
-#define malloc_kill_us(pool,ptr) \
- malloc_kill_inpool_ (pool,MALLOC_typeUS_,ptr,0)
-#define malloc_kill_usr(pool,ptr) \
- malloc_kill_inpool_ (pool,MALLOC_typeUSR_,ptr,0)
-#define malloc_pool_image() (&malloc_root_.malloc_pool_image_)
-#define malloc_resize_ksr(pool,ptr,new_size,old_size) \
- malloc_resize_inpool_ (pool,MALLOC_typeKSR_,ptr,new_size,old_size)
-#define malloc_resize_kpr(pool,ptr,new_size,old_size) \
- malloc_resize_inpool_ (pool,MALLOC_typeKPR_,ptr,new_size,old_size)
-#define malloc_resize_usr(pool,ptr,new_size) \
- malloc_resize_inpool_ (pool,MALLOC_typeUSR_,ptr,new_size,0)
-#define malloc_verify_kp(pool,name,size) \
- malloc_verify_inpool_ (pool,MALLOC_typeKP_,name,size)
-#define malloc_verify_kpr(pool,name,size) \
- malloc_verify_inpool_ (pool,MALLOC_typeKPR_,name,size)
-#define malloc_verify_ks(pool,ptr,size) \
- malloc_verify_inpool_ (pool,MALLOC_typeKS_,ptr,size)
-#define malloc_verify_ksr(pool,ptr,size) \
- malloc_verify_inpool_ (pool,MALLOC_typeKSR_,ptr,size)
-#define malloc_verify_us(pool,ptr) \
- malloc_verify_inpool_ (pool,MALLOC_typeUS_,ptr,0)
-#define malloc_verify_usr(pool,ptr) \
- malloc_verify_inpool_ (pool,MALLOC_typeUSR_,ptr,0)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/name.c b/gcc/f/name.c
index 0d85863611f..5bf37928672 100644
--- a/gcc/f/name.c
+++ b/gcc/f/name.c
@@ -1,242 +1 @@
-/* name.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None.
-
- Description:
- Name and name space abstraction.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "bad.h"
-#include "name.h"
-#include "lex.h"
-#include "malloc.h"
-#include "src.h"
-#include "where.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-static ffename ffename_lookup_ (ffenameSpace ns, ffelexToken t, bool *found);
-
-/* Internal macros. */
-
-
-/* Searches for and returns the matching ffename object, or returns a
- pointer to the name before which the new name should go. */
-
-static ffename
-ffename_lookup_ (ffenameSpace ns, ffelexToken t, bool *found)
-{
- ffename n;
-
- for (n = ns->first; n != (ffename) &ns->first; n = n->next)
- {
- if (ffelex_token_strcmp (t, n->t) == 0)
- {
- *found = TRUE;
- return n;
- }
- }
-
- *found = FALSE;
- return n; /* (n == (ffename) &ns->first) */
-}
-
-/* Searches for and returns the matching ffename object, or creates a new
- one (with a NULL ffesymbol) and returns that. If last arg is TRUE,
- check whether token meets character-content requirements (such as
- "all characters must be uppercase", as determined by
- ffesrc_bad_char_symbol (), issue diagnostic if it doesn't. */
-
-ffename
-ffename_find (ffenameSpace ns, ffelexToken t)
-{
- ffename n;
- ffename newn;
- bool found;
-
- assert (ns != NULL);
- assert ((t != NULL) && ((ffelex_token_type (t) == FFELEX_typeNAME)
- || (ffelex_token_type (t) == FFELEX_typeNAMES)));
-
- n = ffename_lookup_ (ns, t, &found);
- if (found)
- return n;
-
- newn = (ffename) malloc_new_ks (ns->pool, "FFENAME name", sizeof (*n));
- newn->next = n;
- newn->previous = n->previous;
- n->previous = newn;
- newn->previous->next = newn;
- newn->t = ffelex_token_use (t);
- newn->u.s = NULL;
-
- return newn;
-}
-
-/* ffename_kill -- Kill name from name space
-
- ffenameSpace ns;
- ffename s;
- ffename_kill(ns,s);
-
- Removes the name from the name space. */
-
-void
-ffename_kill (ffenameSpace ns, ffename n)
-{
- assert (ns != NULL);
- assert (n != NULL);
-
- ffelex_token_kill (n->t);
- n->next->previous = n->previous;
- n->previous->next = n->next;
- malloc_kill_ks (ns->pool, n, sizeof (*n));
-}
-
-/* ffename_lookup -- Look up name in name space
-
- ffenameSpace ns;
- ffelexToken t;
- ffename s;
- n = ffename_lookup(ns,t);
-
- Searches for and returns the matching ffename object, or returns NULL. */
-
-ffename
-ffename_lookup (ffenameSpace ns, ffelexToken t)
-{
- ffename n;
- bool found;
-
- assert (ns != NULL);
- assert ((t != NULL) && ((ffelex_token_type (t) == FFELEX_typeNAME)
- || (ffelex_token_type (t) == FFELEX_typeNAMES)));
-
- n = ffename_lookup_ (ns, t, &found);
-
- return found ? n : NULL;
-}
-
-/* ffename_space_drive_global -- Call given fn for each global in name space
-
- ffenameSpace ns;
- ffeglobal (*fn)();
- ffename_space_drive_global(ns,fn); */
-
-void
-ffename_space_drive_global (ffenameSpace ns, ffeglobal (*fn) ())
-{
- ffename n;
-
- if (ns == NULL)
- return;
-
- for (n = ns->first; n != (ffename) &ns->first; n = n->next)
- {
- if (n->u.g != NULL)
- n->u.g = (*fn) (n->u.g);
- }
-}
-
-/* ffename_space_drive_symbol -- Call given fn for each symbol in name space
-
- ffenameSpace ns;
- ffesymbol (*fn)();
- ffename_space_drive_symbol(ns,fn); */
-
-void
-ffename_space_drive_symbol (ffenameSpace ns, ffesymbol (*fn) ())
-{
- ffename n;
-
- if (ns == NULL)
- return;
-
- for (n = ns->first; n != (ffename) &ns->first; n = n->next)
- {
- if (n->u.s != NULL)
- n->u.s = (*fn) (n->u.s);
- }
-}
-
-/* ffename_space_kill -- Kill name space
-
- ffenameSpace ns;
- ffename_space_kill(ns);
-
- Removes the names from the name space; kills the name space. */
-
-void
-ffename_space_kill (ffenameSpace ns)
-{
- assert (ns != NULL);
-
- while (ns->first != (ffename) &ns->first)
- ffename_kill (ns, ns->first);
-
- malloc_kill_ks (ns->pool, ns, sizeof (*ns));
-}
-
-/* ffename_space_new -- Create name space
-
- ffenameSpace ns;
- ns = ffename_space_new(malloc_pool_image());
-
- Create new name space. */
-
-ffenameSpace
-ffename_space_new (mallocPool pool)
-{
- ffenameSpace ns;
-
- ns = (ffenameSpace) malloc_new_ks (pool, "FFENAME space",
- sizeof (*ns));
- ns->first = (ffename) &ns->first;
- ns->last = (ffename) &ns->first;
- ns->pool = pool;
-
- return ns;
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/name.h b/gcc/f/name.h
index e73d9504aa1..5bf37928672 100644
--- a/gcc/f/name.h
+++ b/gcc/f/name.h
@@ -1,109 +1 @@
-/* name.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- name.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_name
-#define _H_f_name
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-typedef struct _ffename_ *ffename;
-typedef struct _ffename_space_ *ffenameSpace;
-
-/* Include files needed by this one. */
-
-#include "global.h"
-#include "lex.h"
-#include "malloc.h"
-#include "symbol.h"
-
-/* Structure definitions. */
-
-struct _ffename_
- {
- ffename next;
- ffename previous;
- ffelexToken t;
- union
- {
- ffesymbol s;
- ffeglobal g;
- }
- u;
- };
-
-struct _ffename_space_
- {
- ffename first;
- ffename last;
- mallocPool pool;
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-ffename ffename_find (ffenameSpace ns, ffelexToken t);
-void ffename_kill (ffenameSpace ns, ffename n);
-ffename ffename_lookup (ffenameSpace ns, ffelexToken t);
-void ffename_space_drive_global (ffenameSpace ns, ffeglobal (*fn) ());
-void ffename_space_drive_symbol (ffenameSpace ns, ffesymbol (*fn) ());
-void ffename_space_kill (ffenameSpace ns);
-ffenameSpace ffename_space_new (mallocPool pool);
-
-/* Define macros. */
-
-#define ffename_first_token(n) ((n)->t)
-#define ffename_global(n) ((n)->u.g)
-#define ffename_init_0()
-#define ffename_init_1()
-#define ffename_init_2()
-#define ffename_init_3()
-#define ffename_init_4()
-#define ffename_set_global(n,glob) ((n)->u.g = (glob))
-#define ffename_set_symbol(n,sym) ((n)->u.s = (sym))
-#define ffename_symbol(n) ((n)->u.s)
-#define ffename_terminate_0()
-#define ffename_terminate_1()
-#define ffename_terminate_2()
-#define ffename_terminate_3()
-#define ffename_terminate_4()
-#define ffename_text(n) ffelex_token_text((n)->t)
-#define ffename_token(n) ((n)->t)
-#define ffename_where_filename(n) ffelex_token_where_filename((n)->t)
-#define ffename_where_filelinenum(n) ffelex_token_where_filelinenum((n)->t)
-#define ffename_where_line(n) ffelex_token_where_line((n)->t)
-#define ffename_where_column(n) ffelex_token_where_column((n)->t)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/news.texi b/gcc/f/news.texi
index 7c3411a6d2d..dea4e6626fa 100644
--- a/gcc/f/news.texi
+++ b/gcc/f/news.texi
@@ -5,7 +5,7 @@
@c The text of this file appears in the file BUGS
@c in the G77 distribution, as well as in the G77 manual.
-@c 1998-03-16
+@c 1998-09-04
@ifclear NEWSONLY
@node News
@@ -21,10 +21,11 @@ The changes are generally listed in order:
@enumerate
@item
-Code-generation and run-time-library bugs
+Code-generation and run-time-library bug-fixes
@item
Compiler and run-time-library crashes involving valid code
+that have been fixed
@item
New features
@@ -33,6 +34,101 @@ New features
Fixes and enhancements to existing features
@item
+New diagnostics
+
+@item
+Internal improvements
+
+@item
+Miscellany
+@end enumerate
+
+This order is not strict---for example, some items
+involve a combination of these elements.
+
+Note that two variants of @code{g77} are tracked below.
+The @code{egcs} variant is described vis-a-vis
+previous versions of @code{egcs} and/or
+an official FSF version,
+as appropriate.
+
+Therefore, @code{egcs} versions sometimes have multiple listings
+to help clarify how they differ from other versions,
+though this can make getting a complete picture
+of what a particular @code{egcs} version contains
+somewhat more difficult.
+
+@heading In @code{egcs} 1.1 (versus 0.5.24):
+@itemize @bullet
+@item
+Fix @code{g77} crash compiling code
+containing the construct @samp{CMPLX(0.)} or similar.
+
+@item
+Fix @code{g77} crash
+(or apparently infinite run-time)
+when compiling certain complicated expressions
+involving @code{COMPLEX} arithmetic
+(especially multiplication).
+
+@cindex DNRM2
+@cindex stack, 387 coprocessor
+@cindex Intel x86
+@cindex -O2
+@item
+Fix a code-generation bug that afflicted
+Intel x86 targets when @samp{-O2} was specified
+compiling, for example, an old version of
+the @samp{DNRM2} routine.
+
+The x87 coprocessor stack was being
+mismanaged in cases involving assigned @code{GOTO}
+and @code{ASSIGN}.
+
+@cindex alignment
+@cindex double-precision performance
+@cindex -malign-double
+@item
+Align static double-precision variables and arrays
+on Intel x86 targets
+regardless of whether @samp{-malign-double} is specified.
+
+Generally, this affects only local variables and arrays
+having the @code{SAVE} attribute
+or given initial values via @code{DATA}.
+@end itemize
+
+@heading In @code{egcs} 1.1 (versus @code{egcs} 1.0.3):
+@itemize @bullet
+@item
+Fix bugs in the @code{libU77} intrinsic @samp{HostNm}
+that wrote one byte beyond the end of its @samp{CHARACTER}
+argument,
+and in the @code{libU77} intrinsics
+@samp{GMTime} and @samp{LTime}
+that overwrote their arguments.
+
+@item
+Assumed arrays with negative bounds
+(such as @samp{REAL A(-1:*)})
+no longer elicit spurious diagnostics from @code{g77},
+even on systems with pointers having
+different sizes than integers.
+
+This bug is not known to have existed in any
+recent version of @code{gcc}.
+It was introduced in an early release of @code{egcs}.
+
+@item
+Valid combinations of @code{EXTERNAL},
+passing that external as a dummy argument
+without explicitly giving it a type,
+and, in a subsequent program unit,
+referencing that external as
+an external function with a different type
+no longer crash @code{g77}.
+
+@item
@code{CASE DEFAULT} no longer crashes @code{g77}.
@item
@@ -41,19 +137,368 @@ warning about the ``master'' procedure generated by
@code{g77} for procedures containing @code{ENTRY} statements.
@item
-New diagnostics
+Support @samp{FORMAT(I<@var{expr}>)} when @var{expr} is a
+compile-time constant @code{INTEGER} expression.
@item
-Internal improvements
+Fix @code{g77} @samp{-g} option so procedures that
+use @samp{ENTRY} can be stepped through, line by line,
+in @code{gdb}.
@item
-Miscellany
-@end enumerate
+Allow any @code{REAL} argument to intrinsics
+@code{Second} and @code{CPU_Time}.
-This order is not strict---for example, some items
-involve a combination of these elements.
+@item
+Use @code{tempnam}, if available, to open scratch files
+(as in @samp{OPEN(STATUS='SCRATCH')})
+so that the @code{TMPDIR} environment variable,
+if present, is used.
+
+@item
+@code{g77}'s version of @code{libf2c} separates out
+the setting of global state
+(such as command-line arguments and signal handling)
+from @file{main.o} into distinct, new library
+archive members.
+
+This should make it easier to write portable applications
+that have their own (non-Fortran) @code{main()} routine
+properly set up the @code{libf2c} environment, even
+when @code{libf2c} (now @code{libg2c}) is a shared library.
+
+@item
+@code{g77} no longer installs the @file{f77} command
+and @file{f77.1} man page
+in the @file{/usr} or @file{/usr/local} heirarchy,
+even if the @file{f77-install-ok} file exists
+in the source or build directory.
+See the installation documentation for more information.
+
+@item
+@code{g77} no longer installs the @file{libf2c.a} library
+and @file{f2c.h} include file
+in the @file{/usr} or @file{/usr/local} heirarchy,
+even if the @file{f2c-install-ok} or @file{f2c-exists-ok} files exist
+in the source or build directory.
+See the installation documentation for more information.
+
+@item
+The @file{libf2c.a} library produced by @code{g77} has been
+renamed to @file{libg2c.a}.
+It is installed only in the @code{gcc} ``private''
+directory heirarchy, @file{gcc-lib}.
+This allows system administrators and users to choose which
+version of the @code{libf2c} library from @code{netlib} they
+wish to use on a case-by-case basis.
+See the installation documentation for more information.
+
+@item
+The @file{f2c.h} include (header) file produced by @code{g77}
+has been renamed to @file{g2c.h}.
+It is installed only in the @code{gcc} ``private''
+directory heirarchy, @file{gcc-lib}.
+This allows system administrators and users to choose which
+version of the include file from @code{netlib} they
+wish to use on a case-by-case basis.
+See the installation documentation for more information.
+
+@item
+The @code{g77} command now expects the run-time library
+to be named @code{libg2c.a} instead of @code{libf2c.a},
+to ensure that a version other than the one built and
+installed as part of the same @code{g77} version is picked up.
+
+@item
+During the configuration and build process,
+@code{g77} creates subdirectories it needs only as it
+needs them.
+Other cleaning up of the configuration and build process
+has been performed as well.
+
+@item
+@code{install-info} now used to update the directory of
+Info documentation to contain an entry for @code{g77}
+(during installation).
+
+@item
+Some diagnostics have been changed from warnings to errors,
+to prevent inadvertent use of the resulting, probably buggy,
+programs.
+These mostly include diagnostics about use of unsupported features
+in the @code{OPEN}, @code{INQUIRE}, @code{READ}, and
+@code{WRITE} statements,
+and about truncations of various sorts of constants.
+
+@item
+Improve compilation of @code{FORMAT} expressions so that
+a null byte is appended to the last operand if it
+is a constant.
+This provides a cleaner run-time diagnostic as provided
+by @code{libf2c} for statements like @samp{PRINT '(I1', 42}.
+
+@item
+Improve documentation and indexing.
+
+@item
+The upgrade to @code{libf2c} as of 1998-06-18
+should fix a variety of problems, including
+those involving some uses of the @samp{T} format
+specifier, and perhaps some build (porting) problems
+as well.
+@end itemize
+
+@heading In 0.5.24 and @code{egcs} 1.1 (versus 0.5.23):
+@itemize @bullet
+@item
+@code{g77} no longer produces incorrect code
+and initial values
+for @samp{EQUIVALENCE} and @samp{COMMON}
+aggregates that, due to ``unnatural'' ordering of members
+vis-a-vis their types, require initial padding.
+
+@item
+@code{g77} no longer crashes when compiling code
+containing specification statements such as
+@samp{INTEGER(KIND=7) PTR}.
+
+@item
+@code{g77} now treats @samp{%LOC(@var{expr})} and
+@samp{LOC(@var{expr})} as ``ordinary'' expressions
+when they are used as arguments in procedure calls.
+This change applies only to global (filewide) analysis,
+making it consistent with
+how @code{g77} actually generates code
+for these cases.
+
+Previously, @code{g77} treated these expressions
+as denoting special ``pointer'' arguments
+for the purposes of filewide analysis.
+
+@item
+The @code{g77} driver now ensures that @samp{-lg2c}
+is specified in the link phase prior to any
+occurrence of @samp{-lm}.
+This prevents accidentally linking to a routine
+in the SunOS4 @samp{-lm} library
+when the generated code wants to link to the one
+in @code{libf2c} (@code{libg2c}).
+
+@item
+@code{g77} emits more debugging information when
+@samp{-g} is used.
+
+This new information allows, for example,
+@kbd{which __g77_length_a} to be used in @code{gdb}
+to determine the type of the phantom length argument
+supplied with @samp{CHARACTER} variables.
+
+This information pertains to internally-generated
+type, variable, and other information,
+not to the longstanding deficiencies vis-a-vis
+@samp{COMMON} and @samp{EQUIVALENCE}.
+
+@item
+The F90 @samp{Date_and_Time} intrinsic now is
+supported.
+
+@item
+The F90 @samp{System_Clock} intrinsic allows
+the optional arguments (except for the @samp{Count}
+argument) to be omitted.
+
+@item
+Upgrade to @code{libf2c} as of 1998-06-18.
+
+@item
+Improve documentation and indexing.
+@end itemize
+
+@c 1998-05-20: 0.5.23 released.
+@heading In 0.5.23 (versus 0.5.22):
+@itemize @bullet
+@item
+This release contains several regressions against
+version 0.5.22 of @code{g77}, due to using the
+``vanilla'' @code{gcc} back end instead of patching
+it to fix a few bugs and improve performance in a
+few cases.
+
+@xref{Actual Bugs,,Actual Bugs We Haven't Fixed Yet},
+available in plain-text format in @code{gcc/f/BUGS},
+for information on the known bugs in this version,
+including the regressions.
+
+Features that have been dropped from this version
+of @code{g77} due to their being implemented
+via @code{g77}-specific patches to the @code{gcc}
+back end in previous releases include:
+
+@itemize --
+@item
+Support for @code{__restrict__} keyword,
+the options @samp{-fargument-alias}, @samp{-fargument-noalias},
+and @samp{-fargument-noalias-global},
+and the corresponding alias-analysis code.
+
+(@code{egcs} has the alias-analysis
+code, but not the @code{__restrict__} keyword.
+@code{egcs} @code{g77} users benefit from the alias-analysis
+code despite the lack of the @code{__restrict__} keyword,
+which is a C-language construct.)
+
+@item
+Support for the GNU compiler options
+@samp{-fmove-all-movables},
+@samp{-freduce-all-givs},
+and @samp{-frerun-loop-opt}.
-@heading In 0.5.22:
+(@code{egcs} supports these options.
+@code{g77} users of @code{egcs} benefit from them even if
+they are not explicitly specified,
+because the defaults are optimized for @code{g77} users.)
+
+@item
+Support for the @samp{-W} option warning about
+integer division by zero.
+
+@item
+The Intel x86-specific option @samp{-malign-double}
+applying to stack-allocated data
+as well as statically-allocate data.
+@end itemize
+
+Note that the @file{gcc/f/gbe/} subdirectory has been removed
+from this distribution as a result of @code{g77} no longer
+including patches for the @code{gcc} back end.
+
+@item
+Fix bugs in the @code{libU77} intrinsic @samp{HostNm}
+that wrote one byte beyond the end of its @samp{CHARACTER}
+argument,
+and in the @code{libU77} intrinsics
+@samp{GMTime} and @samp{LTime}
+that overwrote their arguments.
+
+@item
+Support @code{gcc} version 2.8,
+and remove support for prior versions of @code{gcc}.
+
+@cindex -@w{}-driver option
+@cindex g77 options, -@w{}-driver
+@cindex options, -@w{}-driver
+@item
+Remove support for the @samp{--driver} option,
+as @code{g77} now does all the driving,
+just like @code{gcc}.
+
+@item
+@code{CASE DEFAULT} no longer crashes @code{g77}.
+
+@item
+Valid combinations of @code{EXTERNAL},
+passing that external as a dummy argument
+without explicitly giving it a type,
+and, in a subsequent program unit,
+referencing that external as
+an external function with a different type
+no longer crash @code{g77}.
+
+@item
+@code{g77} no longer installs the @file{f77} command
+and @file{f77.1} man page
+in the @file{/usr} or @file{/usr/local} heirarchy,
+even if the @file{f77-install-ok} file exists
+in the source or build directory.
+See the installation documentation for more information.
+
+@item
+@code{g77} no longer installs the @file{libf2c.a} library
+and @file{f2c.h} include file
+in the @file{/usr} or @file{/usr/local} heirarchy,
+even if the @file{f2c-install-ok} or @file{f2c-exists-ok} files exist
+in the source or build directory.
+See the installation documentation for more information.
+
+@item
+The @file{libf2c.a} library produced by @code{g77} has been
+renamed to @file{libg2c.a}.
+It is installed only in the @code{gcc} ``private''
+directory heirarchy, @file{gcc-lib}.
+This allows system administrators and users to choose which
+version of the @code{libf2c} library from @code{netlib} they
+wish to use on a case-by-case basis.
+See the installation documentation for more information.
+
+@item
+The @file{f2c.h} include (header) file produced by @code{g77}
+has been renamed to @file{g2c.h}.
+It is installed only in the @code{gcc} ``private''
+directory heirarchy, @file{gcc-lib}.
+This allows system administrators and users to choose which
+version of the include file from @code{netlib} they
+wish to use on a case-by-case basis.
+See the installation documentation for more information.
+
+@item
+The @code{g77} command now expects the run-time library
+to be named @code{libg2c.a} instead of @code{libf2c.a},
+to ensure that a version other than the one built and
+installed as part of the same @code{g77} version is picked up.
+
+@item
+The @samp{-Wunused} option no longer issues a spurious
+warning about the ``master'' procedure generated by
+@code{g77} for procedures containing @code{ENTRY} statements.
+
+@item
+@code{g77}'s version of @code{libf2c} separates out
+the setting of global state
+(such as command-line arguments and signal handling)
+from @file{main.o} into distinct, new library
+archive members.
+
+This should make it easier to write portable applications
+that have their own (non-Fortran) @code{main()} routine
+properly set up the @code{libf2c} environment, even
+when @code{libf2c} (now @code{libg2c}) is a shared library.
+
+@item
+During the configuration and build process,
+@code{g77} creates subdirectories it needs only as it
+needs them, thus avoiding unnecessary creation of, for example,
+@file{stage1/f/runtime} when doing a non-bootstrap build.
+Other cleaning up of the configuration and build process
+has been performed as well.
+
+@item
+@code{install-info} now used to update the directory of
+Info documentation to contain an entry for @code{g77}
+(during installation).
+
+@item
+Some diagnostics have been changed from warnings to errors,
+to prevent inadvertent use of the resulting, probably buggy,
+programs.
+These mostly include diagnostics about use of unsupported features
+in the @code{OPEN}, @code{INQUIRE}, @code{READ}, and
+@code{WRITE} statements,
+and about truncations of various sorts of constants.
+
+@item
+Improve documentation and indexing.
+
+@item
+Upgrade to @code{libf2c} as of 1998-04-20.
+
+This should fix a variety of problems, including
+those involving some uses of the @samp{T} format
+specifier, and perhaps some build (porting) problems
+as well.
+@end itemize
+
+@c 1998-03-16: 0.5.22 released.
+@heading In 0.5.22 (versus 0.5.21):
@itemize @bullet
@item
Fix code generation for iterative @code{DO} loops that
@@ -63,7 +508,7 @@ For example, @samp{DO 10 J=2,J} now is compiled correctly.
@cindex DNRM2
@cindex stack, 387 coprocessor
-@cindex ix86
+@cindex Intel x86
@cindex -O2
@item
Fix a code-generation bug that afflicted
@@ -80,7 +525,7 @@ Fix @code{DTime} intrinsic so as not to truncate
results to integer values (on some systems).
@item
-Fix @code{SIGNAL} intrinsic so it offers portable
+Fix @code{Signal} intrinsic so it offers portable
support for 64-bit systems (such as Digital Alphas
running GNU/Linux).
@@ -141,7 +586,7 @@ Allow any numeric argument to intrinsics
@item
Use @code{tempnam}, if available, to open scratch files
-(as in @samp{OPEN(STATUS='SCRATCH')}
+(as in @samp{OPEN(STATUS='SCRATCH')})
so that the @code{TMPDIR} environment variable,
if present, is used.
@@ -180,7 +625,7 @@ anyway for a statement like @samp{PRINT '(I)garbage', 1}
by printing @samp{(I)garbage} as the format string.)
@item
-Improve compilation of FORMAT expressions so that
+Improve compilation of @code{FORMAT} expressions so that
a null byte is appended to the last operand if it
is a constant.
This provides a cleaner run-time diagnostic as provided
@@ -205,6 +650,137 @@ This fixes a formatted-I/O bug that afflicted
(such as Digital Alpha running GNU/Linux).
@end itemize
+@c 1998-03-15: egcs-1.0.2 released.
+@heading In @code{egcs} 1.0.2 (versus @code{egcs} 1.0.1):
+@itemize @bullet
+@item
+Fix @code{g77} crash triggered by @code{CASE} statement with
+an omitted lower or upper bound.
+
+@item
+Fix @code{g77} crash on statements such as
+@samp{PRINT *, (REAL(Z(I)),I=1,2)}, where
+@samp{Z} is @code{DOUBLE COMPLEX}.
+
+@cindex ELF support
+@cindex support, ELF
+@cindex -fPIC option
+@cindex options, -fPIC
+@item
+Fix @samp{-fPIC} (such as compiling for ELF targets)
+on the Intel x86 architecture target
+so invalid assembler code is no longer produced.
+
+@item
+Fix @samp{-fpedantic} to not reject procedure invocations
+such as @samp{I=J()} and @samp{CALL FOO()}.
+
+@item
+Fix @samp{-fugly-comma} to affect invocations of
+only external procedures.
+Restore rejection of gratuitous trailing omitted
+arguments to intrinsics, as in @samp{I=MAX(3,4,,)}.
+
+@item
+Fix compiler so it accepts @samp{-fgnu-intrinsics-*} and
+@samp{-fbadu77-intrinsics-*} options.
+@end itemize
+
+@c 1998-01-02: egcs-1.0.1 released.
+@heading In @code{egcs} 1.0.1 (versus @code{egcs} 1.0):
+@itemize @bullet
+@item
+Fix run-time crash involving @code{NAMELIST} on 64-bit
+machines such as Alphas.
+@end itemize
+
+@c 1997-12-03: egcs-1.0 released.
+@heading In @code{egcs} 1.0 (versus 0.5.21):
+@itemize @bullet
+@item
+Version 1.0 of @code{egcs}
+contains several regressions against
+version 0.5.21 of @code{g77},
+due to using the
+``vanilla'' @code{gcc} back end instead of patching
+it to fix a few bugs and improve performance in a
+few cases.
+
+@xref{Actual Bugs,,Actual Bugs We Haven't Fixed Yet},
+available in plain-text format in @code{gcc/f/BUGS},
+for information on the known bugs in this version,
+including the regressions.
+
+Features that have been dropped from this version
+of @code{g77} due to their being implemented
+via @code{g77}-specific patches to the @code{gcc}
+back end in previous releases include:
+
+@itemize --
+@item
+Support for the C-language @code{restrict} keyword.
+
+@item
+Support for the @samp{-W} option warning about
+integer division by zero.
+
+@item
+The Intel x86-specific option @samp{-malign-double}
+applying to stack-allocated data
+as well as statically-allocate data.
+@end itemize
+
+Note that the @file{gcc/f/gbe/} subdirectory has been removed
+from this distribution as a result of @code{g77}
+being fully integrated with
+the @code{egcs} variant of the @code{gcc} back end.
+
+@item
+Fix code generation for iterative @code{DO} loops that
+have one or more references to the iteration variable,
+or to aliases of it, in their control expressions.
+For example, @samp{DO 10 J=2,J} now is compiled correctly.
+
+@item
+Fix @code{DTime} intrinsic so as not to truncate
+results to integer values (on some systems).
+
+@item
+Remove support for non-@code{egcs} versions of @code{gcc}.
+
+@cindex -@w{}-driver option
+@cindex g77 options, -@w{}-driver
+@cindex options, -@w{}-driver
+@item
+Remove support for the @samp{--driver} option,
+as @code{g77} now does all the driving,
+just like @code{gcc}.
+
+@item
+Allow any numeric argument to intrinsics
+@code{Int2} and @code{Int8}.
+
+@item
+Improve diagnostic messages from @code{libf2c}
+so it is more likely that the printing of the
+active format string is limited to the string,
+with no trailing garbage being printed.
+
+(Unlike @code{f2c}, @code{g77} did not append
+a null byte to its compiled form of every
+format string specified via a @code{FORMAT} statement.
+However, @code{f2c} would exhibit the problem
+anyway for a statement like @samp{PRINT '(I)garbage', 1}
+by printing @samp{(I)garbage} as the format string.)
+
+@item
+Upgrade to @code{libf2c} as of 1997-09-23.
+This fixes a formatted-I/O bug that afflicted
+64-bit systems with 32-bit integers
+(such as Digital Alpha running GNU/Linux).
+@end itemize
+
+@c 1997-09-09: 0.5.21 released.
@heading In 0.5.21:
@itemize @bullet
@item
@@ -524,6 +1100,7 @@ that aren't quite accurate in @code{g77}'s version of
Reserve @code{INTEGER(KIND=0)} for future use.
@end itemize
+@c 1997-02-28: 0.5.20 released.
@heading In 0.5.20:
@itemize @bullet
@item
@@ -785,6 +1362,7 @@ up automatically via a message in the diagnostic itself.
the Info documentation.)
@end itemize
+@c 1997-02-01: 0.5.19.1 released.
@heading In 0.5.19.1:
@itemize @bullet
@item
@@ -809,6 +1387,7 @@ For example, @samp{C = CSQRT(C)}, @samp{Z = Z/C}, and @samp{Z = Z**I}
@code{DOUBLE COMPLEX}) have been fixed.
@end itemize
+@c 1996-12-07: 0.5.19 released.
@heading In 0.5.19:
@itemize @bullet
@item
@@ -928,6 +1507,7 @@ of the areas.
Improvements to documentation and indexing.
@end itemize
+@c 1996-04-01: 0.5.18 released.
@heading In 0.5.18:
@itemize @bullet
@item
@@ -1115,6 +1695,7 @@ named @code{netlib.bell-labs.com}, and the
maintainer's new address is @email{dmg@@bell-labs.com}.
@end itemize
+@c 1995-11-18: 0.5.17 released.
@heading In 0.5.17:
@itemize @bullet
@item
@@ -1221,6 +1802,7 @@ Support @code{gcc} version 2.7.1.
Upgrade to @code{libf2c} as of 1995-11-15.
@end itemize
+@c 1995-08-30: 0.5.16 released.
@heading In 0.5.16:
@itemize @bullet
@item
@@ -1393,6 +1975,7 @@ Build @code{libf2c} with @samp{-g0}, not @samp{-g2}, in effect
smaller library without lots of debugging clutter.
@end itemize
+@c 1995-05-19: 0.5.15 released.
@heading In 0.5.15:
@itemize @bullet
@item
diff --git a/gcc/f/parse.c b/gcc/f/parse.c
index 62b98f31930..6c92de9230e 100644
--- a/gcc/f/parse.c
+++ b/gcc/f/parse.c
@@ -1,6 +1,6 @@
/* GNU Fortran
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -20,8 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "proj.h"
-#include <ctype.h>
-#include <signal.h>
#include "top.h"
#include "com.h"
#include "where.h"
@@ -52,11 +50,18 @@ yyparse ()
#if FFECOM_targetCURRENT == FFECOM_targetFFE
ffe_init_0 ();
- for (--argc, ++argv; argc > 0; --argc, ++argv)
- {
- if (!ffe_decode_option (argv[0]))
- fprintf (stderr, "Unrecognized option: %s\n", argv[0]);
- }
+ {
+ int strings_processed;
+ for (--argc, ++argv; argc > 0; argc -= strings_processed, argv += strings_processed)
+ {
+ strings_processed = ffe_decode_option (argc, argv);
+ if (strings_processed == 0)
+ {
+ fprintf (stderr, "Unrecognized option: %s\n", argv[0]);
+ strings_processed = 1;
+ }
+ }
+ }
#elif FFECOM_targetCURRENT == FFECOM_targetGCC
if (!ffe_is_pedantic ())
ffe_set_is_pedantic (pedantic);
diff --git a/gcc/f/proj.c b/gcc/f/proj.c
index 78fcc45927b..6af2df50885 100644
--- a/gcc/f/proj.c
+++ b/gcc/f/proj.c
@@ -1,6 +1,6 @@
/* proj.c file for GNU Fortran
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -20,7 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "proj.h"
-#include <ctype.h>
#include "glimits.j"
#ifndef HAVE_STRTOUL
@@ -33,7 +32,7 @@ strtoul (const char *nptr, char **endptr, int base)
assert (base == 10);
assert (endptr == NULL);
- while (isdigit (*nptr))
+ while (ISDIGIT (*nptr))
{
number = old_number * 10 + (*(nptr++) - '0');
if ((number <= old_number) && (old_number != 0))
diff --git a/gcc/f/proj.h b/gcc/f/proj.h
index d05b1c32b8d..93b12b330c8 100644
--- a/gcc/f/proj.h
+++ b/gcc/f/proj.h
@@ -1,6 +1,6 @@
/* proj.h file for Gnu Fortran
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -24,6 +24,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef _H_f_proj
#define _H_f_proj
+#ifdef USE_HCONFIG
+#include "hconfig.j"
+#else
+#include "config.j"
+#endif
+#include "system.j"
+
#if !defined (__GNUC__) || (__GNUC__ < 2)
#error "You have to use gcc 2.x to build g77 (might be fixed in g77-0.6)."
#endif
@@ -36,25 +43,15 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
#endif /* !defined (BUILT_WITH_270) */
-/* This file used to attempt to allow for all sorts of broken systems.
- Because the auto-configuration scripts in conf-proj(.in) didn't work
- on all systems, and I received far too many bug reports about them,
- I decided to stop trying to cater to broken systems at all, and
- simply remove all but the simplest and most useful code (which is
- still in proj.c).
-
- XXX Not entirely true anymore. We do want to cater to broken systems
- again by using autoconf to handle the braindamage for us. */
+/* Include files everyone gets. <assert.h> is needed for assert().
+ <stddef.h> is needed for offsetof, but technically also NULL,
+ size_t, ptrdiff_t, and so on. */
-/* Include files everyone gets. */
+#include "assert.j"
-#include "config.j" /* Must come before any other #includes in gcc. */
-#include "assert.j" /* Use gcc's assert.h. */
-#include <ctype.h>
-#include <stdio.h>
+#if HAVE_STDDEF_H
#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
+#endif
/* Generally useful definitions. */
@@ -70,8 +67,6 @@ typedef enum
} bool;
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
-#define STR(s) # s
-#define STRX(s) STR(s)
#ifndef UNUSED /* Compile with -DUNUSED= if cc doesn't support this. */
#if BUILT_WITH_270
@@ -85,8 +80,4 @@ typedef enum
#define dmpout stderr
#endif
-#ifndef isascii
-#define isascii(c) ((unsigned char)(c) <= 0x7f)
-#endif
-
#endif
diff --git a/gcc/f/rtl.j b/gcc/f/rtl.j
index 646e1f6a404..5bf37928672 100644
--- a/gcc/f/rtl.j
+++ b/gcc/f/rtl.j
@@ -1,28 +1 @@
-/* rtl.j -- Wrapper for GCC's rtl.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_rtl
-#define _J_f_rtl
-#include "config.j"
-#include "rtl.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/src.c b/gcc/f/src.c
index fe39961daa2..3fd17552441 100644
--- a/gcc/f/src.c
+++ b/gcc/f/src.c
@@ -1,6 +1,6 @@
/* src.c -- Implementation File
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -29,7 +29,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
*/
#include "proj.h"
-#include <ctype.h>
#include "src.h"
#include "top.h"
diff --git a/gcc/f/src.h b/gcc/f/src.h
index 02279154d28..6f8bff2f3fc 100644
--- a/gcc/f/src.h
+++ b/gcc/f/src.h
@@ -1,144 +1,3 @@
-/* src.h -- Public #include File
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- src.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_src
-#define _H_f_src
-
-#include "bad.h"
-#include "top.h"
-
-extern char ffesrc_toupper_[256];
-extern char ffesrc_tolower_[256];
-extern char ffesrc_char_match_init_[256];
-extern char ffesrc_char_match_noninit_[256];
-extern char ffesrc_char_source_[256];
-extern char ffesrc_char_internal_init_[256];
-extern ffebad ffesrc_bad_symbol_init_[256];
-extern ffebad ffesrc_bad_symbol_noninit_[256];
-extern bool ffesrc_check_symbol_;
-extern bool ffesrc_ok_match_init_upper_;
-extern bool ffesrc_ok_match_init_lower_;
-extern bool ffesrc_ok_match_noninit_upper_;
-extern bool ffesrc_ok_match_noninit_lower_;
-
-/* These C-language-syntax modifiers could avoid the match arg if gcc's
- extension allowing macros to generate dynamic labels was used. They
- could use the no_match arg (and the "caller's" label defs) if there
- was a way to say "goto default" in a switch statement. Oh well.
-
- NOTE: These macro assume "case FFESRC_CASE_MATCH_[NON]INIT(...):" is used
- to invoke them, and thus assume the "above" case does not fall through to
- this one. This syntax was chosen to keep indenting tools working. */
-
-#define FFESRC_CASE_MATCH_INIT(upper, lower, match, no_match) \
- upper: if (!ffesrc_ok_match_init_upper_) goto no_match; \
- else goto match; \
- case lower: if (!ffesrc_ok_match_init_lower_) goto no_match; \
- match
-
-#define FFESRC_CASE_MATCH_NONINIT(upper, lower, match, no_match) \
- upper: if (!ffesrc_ok_match_noninit_upper_) goto no_match; \
- else goto match; \
- case lower: if (!ffesrc_ok_match_noninit_lower_) goto no_match; \
- match
-
-/* If character is ok in a symbol name (not including intrinsic names),
- returns FFEBAD, else returns something else, type ffebad. */
-
-#define ffesrc_bad_char_symbol_init(c) \
- (ffesrc_bad_symbol_init_[(unsigned int) (c)])
-#define ffesrc_bad_char_symbol_noninit(c) \
- (ffesrc_bad_symbol_noninit_[(unsigned int) (c)])
-
-/* Returns TRUE if character is ok in a symbol name (including
- intrinsic names). Doesn't care about case settings, this is
- used just for parsing (before semantic complaints about symbol-
- name casing and such). One specific usage is to decide whether
- an underscore is valid as the first or subsequent character in
- some symbol name -- if not, an underscore is a separate token
- (while lexing, for example). Note that ffesrc_is_name_init
- must return TRUE for a (not necessarily proper) subset of
- characters for which ffelex_is_firstnamechar returns TRUE. */
-
-#define ffesrc_is_name_init(c) \
- ((isalpha ((c))) || (!(1 || ffe_is_90 ()) && ((c) == '_')))
-#define ffesrc_is_name_noninit(c) \
- ((isalnum ((c))) || (!(1 || ffe_is_90 ()) && ((c) == '_')))
-
-/* Test if source-translated character matches given alphabetic character
- (passed in both uppercase and lowercase, to allow for custom speedup
- of compilation in environments where compile-time options aren't needed
- for casing). */
-
-#define ffesrc_char_match_init(c, up, low) \
- (ffesrc_char_match_init_[(unsigned int) (c)] == up)
-
-#define ffesrc_char_match_noninit(c, up, low) \
- (ffesrc_char_match_noninit_[(unsigned int) (c)] == up)
-
-/* Translate character from input-file form to source form. */
-
-#define ffesrc_char_source(c) (ffesrc_char_source_[(unsigned int) (c)])
-
-/* Translate internal character (upper/lower) to source form in an
- initial-character context (i.e. ffesrc_char_match_init of the result
- will always succeed). */
-
-#define ffesrc_char_internal_init(up, low) \
- (ffesrc_char_internal_init_[(unsigned int) (up)])
-
-/* Returns TRUE if a name representing a symbol should be checked for
- validity according to compile-time options. That is, if it is possible
- that ffesrc_bad_char_symbol(c) can return something other than FFEBAD
- for any valid character in an ffelex NAME(S) token. */
-
-#define ffesrc_check_symbol() ffesrc_check_symbol_
-
-#define ffesrc_init_0()
-void ffesrc_init_1 (void);
-#define ffesrc_init_2()
-#define ffesrc_init_3()
-#define ffesrc_init_4()
-int ffesrc_strcmp_1ns2i (ffeCase mcase, const char *var, int len,
- const char *str_ic);
-int ffesrc_strcmp_2c (ffeCase mcase, const char *var, const char *str_uc,
- const char *str_lc, const char *str_ic);
-int ffesrc_strncmp_2c (ffeCase mcase, const char *var, const char *str_uc,
- const char *str_lc, const char *str_ic, int len);
-#define ffesrc_terminate_0()
-#define ffesrc_terminate_1()
-#define ffesrc_terminate_2()
-#define ffesrc_terminate_3()
-#define ffesrc_terminate_4()
-#define ffesrc_toupper(c) (ffesrc_toupper_[(unsigned int) (c)])
-#define ffesrc_tolower(c) (ffesrc_tolower_[(unsigned int) (c)])
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
+ ((ISALPHA ((c))) || (! (1 || ffe_is_90 ()) && ((c) == '_')))
+ ((ISALNUM ((c))) || (! (1 || ffe_is_90 ()) && ((c) == '_')))
diff --git a/gcc/f/st.c b/gcc/f/st.c
index 5406acdb5a7..5bf37928672 100644
--- a/gcc/f/st.c
+++ b/gcc/f/st.c
@@ -1,554 +1 @@
-/* st.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- The high-level input level to statement handling for the rest of the
- FFE. ffest_first is the first state for the lexer to invoke to start
- a statement. A statement normally starts with a NUMBER token (to indicate
- a label def) followed by a NAME token (to indicate what kind of statement
- it is), though of course the NUMBER token may be omitted. ffest_first
- gathers the first NAME token and returns a state of ffest_second_,
- where the trailing underscore means "internal to ffest" and thus outside
- users should not depend on this. ffest_second_ then looks at the second
- token in conjunction with the first, decides what possible statements are
- meant, and tries each possible statement in turn, from most likely to
- least likely. A successful attempt currently is recorded, and further
- successful attempts by other possibilities raise an assertion error in
- ffest_confirmed (this is to detect ambiguities). A failure in an
- attempt is signaled by calling ffest_ffebad_start; this results in the
- next token sent by ffest_save_ (the intermediary when more than one
- possible statement exists) being EOS to shut down processing and the next
- possibility tried.
-
- When all possibilities have been tried, the successful one is retried with
- inhibition turned off (FALSE) as reported by ffest_is_inhibited(). If
- there is no successful one, the first one is retried so the user gets to
- see the error messages.
-
- In the future, after syntactic bugs have been reasonably shaken out and
- ambiguities thus detected, the first successful possibility will be
- enabled (inhibited goes FALSE) as soon as it confirms success by calling
- ffest_confirmed, thus retrying the possibility will not be necessary.
-
- The only complication in all this is that expression handling is
- happening while possibilities are inhibited. It is up to the expression
- handler, conceptually, to not make any changes to its knowledge base for
- variable names and so on when inhibited that cannot be undone if
- the current possibility fails (shuts down via ffest_ffebad_start). In
- fact, this business is handled not be ffeexpr, but by lower levels.
-
- ffesta functions serve only to provide information used in syntactic
- processing of possible statements, and thus may not make changes to the
- knowledge base for variables and such.
-
- ffestb functions perform the syntactic analysis for possible statements,
- and thus again may not make changes to the knowledge base except under the
- auspices of ffeexpr and its subordinates, changes which can be undone when
- necessary.
-
- ffestc functions perform the semantic analysis for the chosen statement,
- and thus may change the knowledge base as necessary since they are invoked
- by ffestb functions only after a given statement is confirmed and
- enabled. Note, however, that a few ffestc functions (identified by
- their statement names rather than grammar numbers) indicate valid forms
- that are, outside of any context, ambiguous, such as ELSE WHERE and
- PRIVATE; these functions should make a quick decision as to what is
- intended and dispatch to the appropriate specific ffestc function.
-
- ffestd functions actually implement statements. When called, the
- statement is considered valid and is either an executable statement or
- a nonexecutable statement with direct-output results. For example, CALL,
- GOTO, and assignment statements pass through ffestd because they are
- executable; DATA statements pass through because they map directly to the
- output file (or at least might so map); ENTRY statements also pass through
- because they essentially affect code generation in an immediate way;
- whereas INTEGER, SAVE, and SUBROUTINE statements do not go through
- ffestd functions because they merely update the knowledge base.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "st.h"
-#include "bad.h"
-#include "lex.h"
-#include "sta.h"
-#include "stb.h"
-#include "stc.h"
-#include "std.h"
-#include "ste.h"
-#include "stp.h"
-#include "str.h"
-#include "sts.h"
-#include "stt.h"
-#include "stu.h"
-#include "stv.h"
-#include "stw.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffest_confirmed -- Confirm current possibility as only one
-
- ffest_confirmed();
-
- Sets the confirmation flag. During debugging for ambiguous constructs,
- asserts that the confirmation flag for a previous possibility has not
- yet been set. */
-
-void
-ffest_confirmed ()
-{
- ffesta_confirmed ();
-}
-
-/* ffest_eof -- End of (non-INCLUDEd) source file
-
- ffest_eof();
-
- Call after piping tokens through ffest_first, where the most recent
- token sent through must be EOS.
-
- 20-Feb-91 JCB 1.1
- Put new EOF token in ffesta_tokens[0], not NULL, because too much
- code expects something there for error reporting and the like. Also,
- do basically the same things ffest_second and ffesta_zero do for
- processing a statement (make and destroy pools, et cetera). */
-
-void
-ffest_eof ()
-{
- ffesta_eof ();
-}
-
-/* ffest_ffebad_here_current_stmt -- ffebad_here with ptr to current stmt
-
- ffest_ffebad_here_current_stmt(0);
-
- Outsiders can call this fn if they have no more convenient place to
- point to (via a token or pair of ffewhere objects) and they know a
- current, useful statement is being evaluted by ffest (i.e. they are
- being called from ffestb, ffestc, ffestd, ... functions). */
-
-void
-ffest_ffebad_here_current_stmt (ffebadIndex i)
-{
- ffesta_ffebad_here_current_stmt (i);
-}
-
-/* ffest_ffebad_here_doiter -- Calls ffebad_here with ptr to DO iter var
-
- ffesymbol s;
- // call ffebad_start first, of course.
- ffest_ffebad_here_doiter(0,s);
- // call ffebad_finish afterwards, naturally.
-
- Searches the stack of blocks backwards for a DO loop that has s
- as its iteration variable, then calls ffebad_here with pointers to
- that particular reference to the variable. Crashes if the DO loop
- can't be found. */
-
-void
-ffest_ffebad_here_doiter (ffebadIndex i, ffesymbol s)
-{
- ffestc_ffebad_here_doiter (i, s);
-}
-
-/* ffest_ffebad_start -- Start a possibly inhibited error report
-
- if (ffest_ffebad_start(FFEBAD_SOME_ERROR))
- {
- ffebad_here, ffebad_string ...;
- ffebad_finish();
- }
-
- Call if the error might indicate that ffest is evaluating the wrong
- statement form, instead of calling ffebad_start directly. If ffest
- is choosing between forms, it will return FALSE, send an EOS/SEMICOLON
- token through as the next token (if the current one isn't already one
- of those), and try another possible form. Otherwise, ffebad_start is
- called with the argument and TRUE returned. */
-
-bool
-ffest_ffebad_start (ffebad errnum)
-{
- return ffesta_ffebad_start (errnum);
-}
-
-/* ffest_first -- Parse the first token in a statement
-
- return ffest_first; // to lexer. */
-
-ffelexHandler
-ffest_first (ffelexToken t)
-{
- return ffesta_first (t);
-}
-
-/* ffest_init_0 -- Initialize for entire image invocation
-
- ffest_init_0();
-
- Call just once per invocation of the compiler (not once per invocation
- of the front end).
-
- Gets memory for the list of possibles once and for all, since this
- list never gets larger than a certain size (FFEST_maxPOSSIBLES_)
- and is not particularly large. Initializes the array of pointers to
- this list. Initializes the executable and nonexecutable lists. */
-
-void
-ffest_init_0 ()
-{
- ffesta_init_0 ();
- ffestb_init_0 ();
- ffestc_init_0 ();
- ffestd_init_0 ();
- ffeste_init_0 ();
- ffestp_init_0 ();
- ffestr_init_0 ();
- ffests_init_0 ();
- ffestt_init_0 ();
- ffestu_init_0 ();
- ffestv_init_0 ();
- ffestw_init_0 ();
-}
-
-/* ffest_init_1 -- Initialize for entire image invocation
-
- ffest_init_1();
-
- Call just once per invocation of the compiler (not once per invocation
- of the front end).
-
- Gets memory for the list of possibles once and for all, since this
- list never gets larger than a certain size (FFEST_maxPOSSIBLES_)
- and is not particularly large. Initializes the array of pointers to
- this list. Initializes the executable and nonexecutable lists. */
-
-void
-ffest_init_1 ()
-{
- ffesta_init_1 ();
- ffestb_init_1 ();
- ffestc_init_1 ();
- ffestd_init_1 ();
- ffeste_init_1 ();
- ffestp_init_1 ();
- ffestr_init_1 ();
- ffests_init_1 ();
- ffestt_init_1 ();
- ffestu_init_1 ();
- ffestv_init_1 ();
- ffestw_init_1 ();
-}
-
-/* ffest_init_2 -- Initialize for entire image invocation
-
- ffest_init_2();
-
- Call just once per invocation of the compiler (not once per invocation
- of the front end).
-
- Gets memory for the list of possibles once and for all, since this
- list never gets larger than a certain size (FFEST_maxPOSSIBLES_)
- and is not particularly large. Initializes the array of pointers to
- this list. Initializes the executable and nonexecutable lists. */
-
-void
-ffest_init_2 ()
-{
- ffesta_init_2 ();
- ffestb_init_2 ();
- ffestc_init_2 ();
- ffestd_init_2 ();
- ffeste_init_2 ();
- ffestp_init_2 ();
- ffestr_init_2 ();
- ffests_init_2 ();
- ffestt_init_2 ();
- ffestu_init_2 ();
- ffestv_init_2 ();
- ffestw_init_2 ();
-}
-
-/* ffest_init_3 -- Initialize for any program unit
-
- ffest_init_3(); */
-
-void
-ffest_init_3 ()
-{
- ffesta_init_3 ();
- ffestb_init_3 ();
- ffestc_init_3 ();
- ffestd_init_3 ();
- ffeste_init_3 ();
- ffestp_init_3 ();
- ffestr_init_3 ();
- ffests_init_3 ();
- ffestt_init_3 ();
- ffestu_init_3 ();
- ffestv_init_3 ();
- ffestw_init_3 ();
-
- ffestw_display_state ();
-}
-
-/* ffest_init_4 -- Initialize for statement functions
-
- ffest_init_4(); */
-
-void
-ffest_init_4 ()
-{
- ffesta_init_4 ();
- ffestb_init_4 ();
- ffestc_init_4 ();
- ffestd_init_4 ();
- ffeste_init_4 ();
- ffestp_init_4 ();
- ffestr_init_4 ();
- ffests_init_4 ();
- ffestt_init_4 ();
- ffestu_init_4 ();
- ffestv_init_4 ();
- ffestw_init_4 ();
-}
-
-/* Test whether ENTRY statement is valid.
-
- Returns TRUE if current program unit is known to be FUNCTION or SUBROUTINE.
- Else returns FALSE. */
-
-bool
-ffest_is_entry_valid ()
-{
- return ffesta_is_entry_valid;
-}
-
-/* ffest_is_inhibited -- Test whether the current possibility is inhibited
-
- if (!ffest_is_inhibited())
- // implement the statement.
-
- Just make sure the current possibility has been confirmed. If anyone
- really needs to test whether the current possibility is inhibited prior
- to confirming it, that indicates a need to begin statement processing
- before it is certain that the given possibility is indeed the statement
- to be processed. As of this writing, there does not appear to be such
- a need. If there is, then when confirming a statement would normally
- immediately disable the inhibition (whereas currently we leave the
- confirmed statement disabled until we've tried the other possibilities,
- to check for ambiguities), we must check to see if the possibility has
- already tested for inhibition prior to confirmation and, if so, maintain
- inhibition until the end of the statement (which may be forced right
- away) and then rerun the entire statement from the beginning. Otherwise,
- initial calls to ffestb functions won't have been made, but subsequent
- calls (after confirmation) will, which is wrong. Of course, this all
- applies only to those statements implemented via multiple calls to
- ffestb, although if a statement requiring only a single ffestb call
- tested for inhibition prior to confirmation, it would likely mean that
- the ffestb call would be completely dropped without this mechanism. */
-
-bool
-ffest_is_inhibited ()
-{
- return ffesta_is_inhibited ();
-}
-
-/* ffest_seen_first_exec -- Test whether first executable stmt has been seen
-
- if (ffest_seen_first_exec())
- // No more spec stmts can be seen.
-
- In a case where, say, the first statement is PARAMETER(A)=B, FALSE
- will be returned while the PARAMETER statement is being run, and TRUE
- will be returned if it doesn't confirm and the assignment statement
- is being run. */
-
-bool
-ffest_seen_first_exec ()
-{
- return ffesta_seen_first_exec;
-}
-
-/* Shut down current parsing possibility, but without bothering the
- user with a diagnostic if we're not inhibited. */
-
-void
-ffest_shutdown ()
-{
- ffesta_shutdown ();
-}
-
-/* ffest_sym_end_transition -- Update symbol info just before end of unit
-
- ffesymbol s;
- ffest_sym_end_transition(s); */
-
-ffesymbol
-ffest_sym_end_transition (ffesymbol s)
-{
- return ffestu_sym_end_transition (s);
-}
-
-/* ffest_sym_exec_transition -- Update symbol just before first exec stmt
-
- ffesymbol s;
- ffest_sym_exec_transition(s); */
-
-ffesymbol
-ffest_sym_exec_transition (ffesymbol s)
-{
- return ffestu_sym_exec_transition (s);
-}
-
-/* ffest_terminate_0 -- Terminate for entire image invocation
-
- ffest_terminate_0(); */
-
-void
-ffest_terminate_0 ()
-{
- ffesta_terminate_0 ();
- ffestb_terminate_0 ();
- ffestc_terminate_0 ();
- ffestd_terminate_0 ();
- ffeste_terminate_0 ();
- ffestp_terminate_0 ();
- ffestr_terminate_0 ();
- ffests_terminate_0 ();
- ffestt_terminate_0 ();
- ffestu_terminate_0 ();
- ffestv_terminate_0 ();
- ffestw_terminate_0 ();
-}
-
-/* ffest_terminate_1 -- Terminate for source file
-
- ffest_terminate_1(); */
-
-void
-ffest_terminate_1 ()
-{
- ffesta_terminate_1 ();
- ffestb_terminate_1 ();
- ffestc_terminate_1 ();
- ffestd_terminate_1 ();
- ffeste_terminate_1 ();
- ffestp_terminate_1 ();
- ffestr_terminate_1 ();
- ffests_terminate_1 ();
- ffestt_terminate_1 ();
- ffestu_terminate_1 ();
- ffestv_terminate_1 ();
- ffestw_terminate_1 ();
-}
-
-/* ffest_terminate_2 -- Terminate for outer program unit
-
- ffest_terminate_2(); */
-
-void
-ffest_terminate_2 ()
-{
- ffesta_terminate_2 ();
- ffestb_terminate_2 ();
- ffestc_terminate_2 ();
- ffestd_terminate_2 ();
- ffeste_terminate_2 ();
- ffestp_terminate_2 ();
- ffestr_terminate_2 ();
- ffests_terminate_2 ();
- ffestt_terminate_2 ();
- ffestu_terminate_2 ();
- ffestv_terminate_2 ();
- ffestw_terminate_2 ();
-}
-
-/* ffest_terminate_3 -- Terminate for any program unit
-
- ffest_terminate_3(); */
-
-void
-ffest_terminate_3 ()
-{
- ffesta_terminate_3 ();
- ffestb_terminate_3 ();
- ffestc_terminate_3 ();
- ffestd_terminate_3 ();
- ffeste_terminate_3 ();
- ffestp_terminate_3 ();
- ffestr_terminate_3 ();
- ffests_terminate_3 ();
- ffestt_terminate_3 ();
- ffestu_terminate_3 ();
- ffestv_terminate_3 ();
- ffestw_terminate_3 ();
-}
-
-/* ffest_terminate_4 -- Terminate for statement functions
-
- ffest_terminate_4(); */
-
-void
-ffest_terminate_4 ()
-{
- ffesta_terminate_4 ();
- ffestb_terminate_4 ();
- ffestc_terminate_4 ();
- ffestd_terminate_4 ();
- ffeste_terminate_4 ();
- ffestp_terminate_4 ();
- ffestr_terminate_4 ();
- ffests_terminate_4 ();
- ffestt_terminate_4 ();
- ffestu_terminate_4 ();
- ffestv_terminate_4 ();
- ffestw_terminate_4 ();
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/st.h b/gcc/f/st.h
index d762f6c9253..5bf37928672 100644
--- a/gcc/f/st.h
+++ b/gcc/f/st.h
@@ -1,81 +1 @@
-/* st.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- st.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_st
-#define _H_f_st
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bad.h"
-#include "lex.h"
-#include "symbol.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffest_confirmed (void);
-void ffest_eof (void);
-bool ffest_ffebad_start (ffebad errnum);
-void ffest_ffebad_here_current_stmt (ffebadIndex i);
-void ffest_ffebad_here_doiter (ffebadIndex i, ffesymbol s);
-ffelexHandler ffest_first (ffelexToken t);
-void ffest_init_0 (void);
-void ffest_init_1 (void);
-void ffest_init_2 (void);
-void ffest_init_3 (void);
-void ffest_init_4 (void);
-bool ffest_is_entry_valid (void);
-bool ffest_is_inhibited (void);
-bool ffest_seen_first_exec (void);
-void ffest_shutdown (void);
-ffesymbol ffest_sym_end_transition (ffesymbol s);
-ffesymbol ffest_sym_exec_transition (ffesymbol s);
-void ffest_terminate_0 (void);
-void ffest_terminate_1 (void);
-void ffest_terminate_2 (void);
-void ffest_terminate_3 (void);
-void ffest_terminate_4 (void);
-
-/* Define macros. */
-
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/sta.c b/gcc/f/sta.c
index e26fa69d0fb..58156f592ba 100644
--- a/gcc/f/sta.c
+++ b/gcc/f/sta.c
@@ -1,6 +1,6 @@
/* sta.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -1452,7 +1452,9 @@ ffesta_eof ()
if (ffe_is_ffedebug ())
{
ffestorag_report ();
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
ffesymbol_report_all ();
+#endif
}
}
@@ -1988,7 +1990,9 @@ ffesta_zero (ffelexToken t)
if (ffe_is_ffedebug ())
{
ffestorag_report ();
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
ffesymbol_report_all ();
+#endif
}
ffelex_set_names (TRUE);
diff --git a/gcc/f/sta.h b/gcc/f/sta.h
index 26e78c412ce..6bb9913d1ff 100644
--- a/gcc/f/sta.h
+++ b/gcc/f/sta.h
@@ -1,6 +1,6 @@
/* sta.h -- Private #include File (module.h template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
diff --git a/gcc/f/stb.c b/gcc/f/stb.c
index 90ae83d5637..dc4bda4d98a 100644
--- a/gcc/f/stb.c
+++ b/gcc/f/stb.c
@@ -1,6 +1,6 @@
/* stb.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -88,7 +88,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Include files. */
#include "proj.h"
-#include <ctype.h>
#include "stb.h"
#include "bad.h"
#include "expr.h"
@@ -1916,7 +1915,7 @@ ffestb_do (ffelexToken t)
goto bad_1; /* :::::::::::::::::::: */
case FFELEX_typeOPEN_PAREN: /* Must be "DO" label "WHILE". */
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
goto bad_i; /* :::::::::::::::::::: */
ffesta_tokens[1] = ffelex_token_number_from_names (ffesta_tokens[0],
i);
@@ -1939,7 +1938,7 @@ ffestb_do (ffelexToken t)
ffesta_tokens[1] = NULL;
return (ffelexHandler) ffestb_do2_;
}
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
goto bad_i; /* :::::::::::::::::::: */
ffesta_tokens[1] = ffelex_token_number_from_names (ffesta_tokens[0],
i);
@@ -1950,7 +1949,7 @@ ffestb_do (ffelexToken t)
return (ffelexHandler) ffestb_do2_;
case FFELEX_typeEQUALS:
- if (isdigit (*p))
+ if (ISDIGIT (*p))
{
ffesta_tokens[1]
= ffelex_token_number_from_names (ffesta_tokens[0], i);
@@ -1972,7 +1971,7 @@ ffestb_do (ffelexToken t)
case FFELEX_typeEOS:
case FFELEX_typeSEMICOLON:
ffesta_confirmed ();
- if (isdigit (*p))
+ if (ISDIGIT (*p))
{
ffesta_tokens[1]
= ffelex_token_number_from_names (ffesta_tokens[0], i);
@@ -3369,7 +3368,7 @@ ffestb_goto (ffelexToken t)
if (ffelex_token_length (ffesta_tokens[0]) != FFESTR_firstlGOTO)
{
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlGOTO);
- if (isdigit (*p))
+ if (ISDIGIT (*p))
{
nt = ffelex_token_number_from_names (ffesta_tokens[0], i);
p += ffelex_token_length (nt);
@@ -6691,7 +6690,7 @@ ffestb_R838 (ffelexToken t)
case FFELEX_typePERCENT:
case FFELEX_typeOPEN_PAREN:
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlASSIGN);
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
goto bad_i; /* :::::::::::::::::::: */
ffesta_tokens[1]
= ffelex_token_number_from_names (ffesta_tokens[0], i);
@@ -9688,7 +9687,7 @@ ffestb_R10014_ (ffelexToken t)
p = ffelex_token_text (t) + i;
if (*p == '\0')
return (ffelexHandler) ffestb_R10015_;
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
{
if (ffestb_local_.format.current == FFESTP_formattypeH)
p = strpbrk (p, "0123456789");
@@ -9766,7 +9765,7 @@ ffestb_R10014_ (ffelexToken t)
p = ffelex_token_text (t) + i;
if (*p == '\0')
return (ffelexHandler) ffestb_R10015_;
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
{
ffestb_local_.format.current = FFESTP_formattypeNone;
p = strpbrk (p, "0123456789");
@@ -10046,7 +10045,7 @@ ffestb_R10015_ (ffelexToken t)
p = ffelex_token_text (t) + i;
if (*p == '\0')
return (ffelexHandler) ffestb_R10015_;
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
{
ffestb_local_.format.current = FFESTP_formattypeNone;
p = strpbrk (p, "0123456789");
@@ -10220,7 +10219,7 @@ ffestb_R10018_ (ffelexToken t)
if (*++p == '\0')
return (ffelexHandler) ffestb_R10019_; /* Go get NUMBER. */
i = 1;
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
{
ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER, t, 1, NULL);
return (ffelexHandler) ffestb_R10018_;
@@ -10589,7 +10588,7 @@ ffestb_R100110_ (ffelexToken t)
return (ffelexHandler) ffestb_R100111_ (t);
default:
- assert (FALSE);
+ assert ("bad format item" == NULL);
err = FFEBAD_FORMAT_BAD_H_SPEC;
pre = disallowed;
post = disallowed;
@@ -11903,7 +11902,7 @@ ffestb_R12026_ (ffelexToken t)
default:
for (p = ffelex_token_text (ffesta_tokens[2]); *p != '\0'; ++p)
{
- if (!isalpha (*p))
+ if (! ISALPHA (*p))
{
ffelex_token_kill (ffesta_tokens[1]);
ffelex_token_kill (ffesta_tokens[2]);
@@ -12010,7 +12009,7 @@ ffestb_S3P4 (ffelexToken t)
ffeexpr_rhs (ffesta_output_pool, FFEEXPR_contextINCLUDE,
(ffeexprCallback) ffestb_S3P41_)))
(t);
- if (!isdigit (*p))
+ if (! ISDIGIT (*p))
goto bad_i; /* :::::::::::::::::::: */
nt = ffelex_token_number_from_names (ffesta_tokens[0], i);
p += ffelex_token_length (nt);
@@ -12443,7 +12442,7 @@ ffestb_V025 (ffelexToken t)
break;
}
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlDEFINEFILE);
- if (isdigit (*p))
+ if (ISDIGIT (*p))
nt = ffelex_token_number_from_names (ffesta_tokens[0], i);
else if (ffesrc_is_name_init (*p))
nt = ffelex_token_name_from_names (ffesta_tokens[0], i, 0);
@@ -17980,7 +17979,7 @@ ffestb_V020 (ffelexToken t)
break;
}
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlTYPE);
- if (isdigit (*p))
+ if (ISDIGIT (*p))
ffesta_confirmed (); /* Else might be '90 TYPE statement. */
for (ix = 0; ix < FFESTP_typeix; ++ix)
ffestp_file.type.type_spec[ix].kw_or_val_present = FALSE;
diff --git a/gcc/f/stb.h b/gcc/f/stb.h
index a3385d9a596..5bf37928672 100644
--- a/gcc/f/stb.h
+++ b/gcc/f/stb.h
@@ -1,253 +1 @@
-/* stb.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stb.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stb
-#define _H_f_stb
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bad.h"
-#include "expr.h"
-#include "lex.h"
-#include "stp.h"
-#include "str.h"
-
-/* Structure definitions. */
-
-struct _ffestb_args_
- {
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of "ENTRY/FUNCTION/SUBROUTINE". */
- bool is_subr; /* TRUE if SUBROUTINE or if ENTRY within
- SUBROUTINE. */
- }
- dummy;
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of
- "BACKSPACE/ENDFILE/REWIND/UNLOCK". */
- }
- beru;
- struct
- {
- ffeTokenLength len; /* Length of keyword including "END". */
- ffestrSecond second; /* Second keyword. */
- }
- endxyz;
- struct
- {
- ffestrSecond second; /* Second keyword. */
- }
- elsexyz;
- struct
- {
- ffeTokenLength len; /* Length of "STOP/PAUSE". */
- }
- halt;
-#if FFESTR_F90
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of "ALLOCATE/DEALLOCATE". */
- ffeexprContext ctx; /* Either ALLOCATE or DEALLOCATE. */
- }
- heap;
-#endif
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of
- "EXTERNAL/INTENT/INTRINSIC/OPTIONAL/PUBLIC/
- PRIVATE". */
- }
- varlist;
-#if FFESTR_VXT
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of "ENCODE/DECODE". */
- }
- vxtcode;
-#endif
-#if FFESTR_F90
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of "ALLOCATABLE/POINTER/TARGET". */
- }
- dimlist;
-#endif
- struct
- {
- char *badname;
- ffeTokenLength len; /* Length of "DIMENSION/VIRTUAL". */
- }
- R524;
- struct
- {
- ffeTokenLength len; /* Length of first keyword. */
- ffestpType type; /* Type of declaration. */
- }
- decl;
- };
-
-/* Global objects accessed by users of this module. */
-
-extern struct _ffestb_args_ ffestb_args;
-
-/* Declare functions with prototypes. */
-
-ffelexHandler ffestb_beru (ffelexToken t);
-ffelexHandler ffestb_block (ffelexToken t);
-ffelexHandler ffestb_blockdata (ffelexToken t);
-ffelexHandler ffestb_decl_chartype (ffelexToken t);
-ffelexHandler ffestb_construct (ffelexToken t);
-ffelexHandler ffestb_decl_dbltype (ffelexToken t);
-ffelexHandler ffestb_decl_double (ffelexToken t);
-ffelexHandler ffestb_dimlist (ffelexToken t);
-ffelexHandler ffestb_do (ffelexToken t);
-ffelexHandler ffestb_dowhile (ffelexToken t);
-ffelexHandler ffestb_dummy (ffelexToken t);
-ffelexHandler ffestb_else (ffelexToken t);
-ffelexHandler ffestb_elsexyz (ffelexToken t);
-ffelexHandler ffestb_end (ffelexToken t);
-ffelexHandler ffestb_endxyz (ffelexToken t);
-ffelexHandler ffestb_decl_gentype (ffelexToken t);
-ffelexHandler ffestb_goto (ffelexToken t);
-ffelexHandler ffestb_halt (ffelexToken t);
-#if FFESTR_F90
-ffelexHandler ffestb_heap (ffelexToken t);
-#endif
-ffelexHandler ffestb_if (ffelexToken t);
-ffelexHandler ffestb_let (ffelexToken t);
-#if FFESTR_F90
-ffelexHandler ffestb_module (ffelexToken t);
-#endif
-#if FFESTR_F90
-ffelexHandler ffestb_decl_recursive (ffelexToken t);
-#endif
-#if FFESTR_F90
-ffelexHandler ffestb_type (ffelexToken t);
-#endif
-#if FFESTR_F90
-ffelexHandler ffestb_decl_typetype (ffelexToken t);
-#endif
-ffelexHandler ffestb_varlist (ffelexToken t);
-#if FFESTR_VXT
-ffelexHandler ffestb_vxtcode (ffelexToken t);
-#endif
-#if FFESTR_F90
-ffelexHandler ffestb_where (ffelexToken t);
-#endif
-#if HARD_F90
-ffelexHandler ffestb_R423B (ffelexToken t);
-#endif
-ffelexHandler ffestb_R522 (ffelexToken t);
-ffelexHandler ffestb_R524 (ffelexToken t);
-ffelexHandler ffestb_R528 (ffelexToken t);
-ffelexHandler ffestb_R537 (ffelexToken t);
-ffelexHandler ffestb_decl_R539 (ffelexToken t);
-ffelexHandler ffestb_R542 (ffelexToken t);
-ffelexHandler ffestb_R544 (ffelexToken t);
-ffelexHandler ffestb_R547 (ffelexToken t);
-#if FFESTR_F90
-ffelexHandler ffestb_R624 (ffelexToken t);
-#endif
-ffelexHandler ffestb_R809 (ffelexToken t);
-ffelexHandler ffestb_R810 (ffelexToken t);
-ffelexHandler ffestb_R834 (ffelexToken t);
-ffelexHandler ffestb_R835 (ffelexToken t);
-ffelexHandler ffestb_R838 (ffelexToken t);
-ffelexHandler ffestb_R840 (ffelexToken t);
-ffelexHandler ffestb_R841 (ffelexToken t);
-ffelexHandler ffestb_R904 (ffelexToken t);
-ffelexHandler ffestb_R907 (ffelexToken t);
-ffelexHandler ffestb_R909 (ffelexToken t);
-ffelexHandler ffestb_R910 (ffelexToken t);
-ffelexHandler ffestb_R911 (ffelexToken t);
-ffelexHandler ffestb_R923 (ffelexToken t);
-ffelexHandler ffestb_R1001 (ffelexToken t);
-ffelexHandler ffestb_R1102 (ffelexToken t);
-#if FFESTR_F90
-ffelexHandler ffestb_R1107 (ffelexToken t);
-#endif
-#if FFESTR_F90
-ffelexHandler ffestb_R1202 (ffelexToken t);
-#endif
-ffelexHandler ffestb_R1212 (ffelexToken t);
-ffelexHandler ffestb_R1227 (ffelexToken t);
-#if FFESTR_F90
-ffelexHandler ffestb_R1228 (ffelexToken t);
-#endif
-ffelexHandler ffestb_R1229 (ffelexToken t);
-ffelexHandler ffestb_S3P4 (ffelexToken t);
-#if FFESTR_VXT
-ffelexHandler ffestb_V003 (ffelexToken t);
-ffelexHandler ffestb_V009 (ffelexToken t);
-ffelexHandler ffestb_V012 (ffelexToken t);
-#endif
-ffelexHandler ffestb_V014 (ffelexToken t);
-#if FFESTR_VXT
-ffelexHandler ffestb_V016 (ffelexToken t);
-ffelexHandler ffestb_V018 (ffelexToken t);
-ffelexHandler ffestb_V019 (ffelexToken t);
-#endif
-ffelexHandler ffestb_V020 (ffelexToken t);
-#if FFESTR_VXT
-ffelexHandler ffestb_V021 (ffelexToken t);
-ffelexHandler ffestb_V025 (ffelexToken t);
-ffelexHandler ffestb_V026 (ffelexToken t);
-#endif
-ffelexHandler ffestb_V027 (ffelexToken t);
-
-/* Define macros. */
-
-#define ffestb_init_0()
-#define ffestb_init_1()
-#define ffestb_init_2()
-#define ffestb_init_3()
-#define ffestb_init_4()
-#define ffestb_terminate_0()
-#define ffestb_terminate_1()
-#define ffestb_terminate_2()
-#define ffestb_terminate_3()
-#define ffestb_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stc.c b/gcc/f/stc.c
index 872b81756ad..e720f9dd03e 100644
--- a/gcc/f/stc.c
+++ b/gcc/f/stc.c
@@ -1,6 +1,6 @@
/* stc.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -12798,6 +12798,7 @@ ffestc_R1229_start (ffelexToken name, ffesttTokenList args,
{
/* Tell ffeexpr that sfunc def is in progress. */
ffesymbol_set_sfexpr (s, ffebld_new_any ());
+ ffebld_set_info (ffesymbol_sfexpr (s), ffeinfo_new_any ());
ffestc_parent_ok_ = TRUE;
}
}
diff --git a/gcc/f/stc.h b/gcc/f/stc.h
index d5cc601b945..5bf37928672 100644
--- a/gcc/f/stc.h
+++ b/gcc/f/stc.h
@@ -1,360 +1 @@
-/* stc.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stc.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stc
-#define _H_f_stc
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bad.h"
-#include "bld.h"
-#include "expr.h"
-#include "lex.h"
-#include "stp.h"
-#include "str.h"
-#include "stt.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-extern ffeexprContext ffestc_iolist_context_;
-
-/* Declare functions with prototypes. */
-
-void ffestc_decl_start (ffestpType type, ffelexToken typet, ffebld kind,
- ffelexToken kindt, ffebld len, ffelexToken lent);
-void ffestc_decl_attrib (ffestpAttrib attrib, ffelexToken attribt,
- ffestrOther intent_kw, ffesttDimList dims);
-void ffestc_decl_item (ffelexToken name, ffebld kind, ffelexToken kindt,
- ffesttDimList dims, ffebld len, ffelexToken lent,
- ffebld init, ffelexToken initt, bool clist);
-void ffestc_decl_itemstartvals (void);
-void ffestc_decl_itemvalue (ffebld repeat, ffelexToken repeat_token,
- ffebld value, ffelexToken value_token);
-void ffestc_decl_itemendvals (ffelexToken t);
-void ffestc_decl_finish (void);
-void ffestc_elsewhere (ffelexToken where_token);
-void ffestc_end (void);
-void ffestc_eof (void);
-bool ffestc_exec_transition (void);
-void ffestc_ffebad_here_doiter (ffebadIndex i, ffesymbol s);
-void ffestc_init_3 (void);
-void ffestc_init_4 (void);
-bool ffestc_is_decl_not_R1219 (void);
-bool ffestc_is_entry_in_subr (void);
-bool ffestc_is_let_not_V027 (void);
-#if FFESTR_F90
-void ffestc_let (ffebld dest, ffebld source, ffelexToken source_token);
-#else
-#define ffestc_let ffestc_R737
-#endif
-#if FFESTR_F90
-void ffestc_module (ffelexToken module_name, ffelexToken procedure_name);
-#endif
-#if FFESTR_F90
-void ffestc_private (void);
-#endif
-void ffestc_terminate_4 (void);
-#if FFESTR_F90
-void ffestc_R423A (void);
-void ffestc_R423B (void);
-void ffestc_R424 (ffelexToken access, ffestrOther access_kw, ffelexToken name);
-void ffestc_R425 (ffelexToken name);
-void ffestc_R426_start (ffestpType type, ffelexToken typet, ffebld kind,
- ffelexToken kindt, ffebld len, ffelexToken lent);
-void ffestc_R426_attrib (ffestpAttrib attrib, ffelexToken attribt,
- ffestrOther intent_kw, ffesttDimList dims);
-void ffestc_R426_item (ffelexToken name, ffebld kind, ffelexToken kindt,
- ffesttDimList dims, ffebld len, ffelexToken lent, ffebld init,
- ffelexToken initt, bool clist);
-void ffestc_R426_itemstartvals (void);
-void ffestc_R426_itemvalue (ffebld repeat, ffelexToken repeat_token,
- ffebld value, ffelexToken value_token);
-void ffestc_R426_itemendvals (ffelexToken t);
-void ffestc_R426_finish (void);
-#endif
-void ffestc_R501_start (ffestpType type, ffelexToken typet, ffebld kind,
- ffelexToken kindt, ffebld len, ffelexToken lent);
-void ffestc_R501_attrib (ffestpAttrib attrib, ffelexToken attribt,
- ffestrOther intent_kw, ffesttDimList dims);
-void ffestc_R501_item (ffelexToken name, ffebld kind, ffelexToken kindt,
- ffesttDimList dims, ffebld len, ffelexToken lent, ffebld init,
- ffelexToken initt, bool clist);
-void ffestc_R501_itemstartvals (void);
-void ffestc_R501_itemvalue (ffebld repeat, ffelexToken repeat_token,
- ffebld value, ffelexToken value_token);
-void ffestc_R501_itemendvals (ffelexToken t);
-void ffestc_R501_finish (void);
-#if FFESTR_F90
-void ffestc_R519_start (ffelexToken intent, ffestrOther intent_kw);
-void ffestc_R519_item (ffelexToken name);
-void ffestc_R519_finish (void);
-void ffestc_R520_start (void);
-void ffestc_R520_item (ffelexToken name);
-void ffestc_R520_finish (void);
-void ffestc_R521A (void);
-void ffestc_R521Astart (void);
-void ffestc_R521Aitem (ffelexToken name);
-void ffestc_R521Afinish (void);
-void ffestc_R521B (void);
-void ffestc_R521Bstart (void);
-void ffestc_R521Bitem (ffelexToken name);
-void ffestc_R521Bfinish (void);
-#endif
-void ffestc_R522 (void);
-void ffestc_R522start (void);
-void ffestc_R522item_object (ffelexToken name);
-void ffestc_R522item_cblock (ffelexToken name);
-void ffestc_R522finish (void);
-void ffestc_R524_start (bool virtual);
-void ffestc_R524_item (ffelexToken name, ffesttDimList dims);
-void ffestc_R524_finish (void);
-#if FFESTR_F90
-void ffestc_R525_start (void);
-void ffestc_R525_item (ffelexToken name, ffesttDimList dims);
-void ffestc_R525_finish (void);
-void ffestc_R526_start (void);
-void ffestc_R526_item (ffelexToken name, ffesttDimList dims);
-void ffestc_R526_finish (void);
-void ffestc_R527_start (void);
-void ffestc_R527_item (ffelexToken name, ffesttDimList dims);
-void ffestc_R527_finish (void);
-#endif
-void ffestc_R528_start (void);
-void ffestc_R528_item_object (ffebld expr, ffelexToken expr_token);
-void ffestc_R528_item_startvals (void);
-void ffestc_R528_item_value (ffebld repeat, ffelexToken repeat_token,
- ffebld value, ffelexToken value_token);
-void ffestc_R528_item_endvals (ffelexToken t);
-void ffestc_R528_finish (void);
-void ffestc_R537_start (void);
-void ffestc_R537_item (ffebld dest, ffelexToken dest_token, ffebld source,
- ffelexToken source_token);
-void ffestc_R537_finish (void);
-void ffestc_R539 (void);
-void ffestc_R539start (void);
-void ffestc_R539item (ffestpType type, ffebld kind, ffelexToken kindt,
- ffebld len, ffelexToken lent, ffesttImpList letters);
-void ffestc_R539finish (void);
-void ffestc_R542_start (void);
-void ffestc_R542_item_nlist (ffelexToken name);
-void ffestc_R542_item_nitem (ffelexToken name);
-void ffestc_R542_finish (void);
-void ffestc_R544_start (void);
-void ffestc_R544_item (ffesttExprList exprlist);
-void ffestc_R544_finish (void);
-void ffestc_R547_start (void);
-void ffestc_R547_item_object (ffelexToken name, ffesttDimList dims);
-void ffestc_R547_item_cblock (ffelexToken name);
-void ffestc_R547_finish (void);
-#if FFESTR_F90
-void ffestc_R620 (ffesttExprList objects, ffebld stat,
- ffelexToken stat_token);
-void ffestc_R624 (ffesttExprList pointers);
-void ffestc_R625 (ffesttExprList objects, ffebld stat,
- ffelexToken stat_token);
-#endif
-void ffestc_R737 (ffebld dest, ffebld source, ffelexToken source_token);
-#if FFESTR_F90
-void ffestc_R738 (ffebld dest, ffebld source, ffelexToken source_token);
-void ffestc_R740 (ffebld expr, ffelexToken expr_token);
-void ffestc_R742 (ffebld expr, ffelexToken expr_token);
-void ffestc_R744 (void);
-void ffestc_R745 (void);
-#endif
-void ffestc_R803 (ffelexToken construct_name, ffebld expr,
- ffelexToken expr_token);
-void ffestc_R804 (ffebld expr, ffelexToken expr_token, ffelexToken name);
-void ffestc_R805 (ffelexToken name);
-void ffestc_R806 (ffelexToken name);
-void ffestc_R807 (ffebld expr, ffelexToken expr_token);
-void ffestc_R809 (ffelexToken construct_name, ffebld expr,
- ffelexToken expr_token);
-void ffestc_R810 (ffesttCaseList cases, ffelexToken name);
-void ffestc_R811 (ffelexToken name);
-void ffestc_R819A (ffelexToken construct_name, ffelexToken label, ffebld var,
- ffelexToken var_token, ffebld start, ffelexToken start_token, ffebld end,
- ffelexToken end_token, ffebld incr, ffelexToken incr_token);
-void ffestc_R819B (ffelexToken construct_name, ffelexToken label, ffebld expr,
- ffelexToken expr_token);
-void ffestc_R820A (ffelexToken construct_name, ffebld var,
- ffelexToken var_token, ffebld start, ffelexToken start_token, ffebld end,
- ffelexToken end_token, ffebld incr, ffelexToken incr_token);
-void ffestc_R820B (ffelexToken construct_name, ffebld expr,
- ffelexToken expr_token);
-void ffestc_R825 (ffelexToken name);
-void ffestc_R834 (ffelexToken name);
-void ffestc_R835 (ffelexToken name);
-void ffestc_R836 (ffelexToken label);
-void ffestc_R837 (ffesttTokenList label_toks, ffebld expr,
- ffelexToken expr_token);
-void ffestc_R838 (ffelexToken label, ffebld target, ffelexToken target_token);
-void ffestc_R839 (ffebld target, ffelexToken target_token,
- ffesttTokenList label_toks);
-void ffestc_R840 (ffebld expr, ffelexToken expr_token, ffelexToken neg,
- ffelexToken zero, ffelexToken pos);
-void ffestc_R841 (void);
-void ffestc_R842 (ffebld expr, ffelexToken expr_token);
-void ffestc_R843 (ffebld expr, ffelexToken expr_token);
-void ffestc_R904 (void);
-void ffestc_R907 (void);
-void ffestc_R909_start (bool only_format);
-void ffestc_R909_item (ffebld expr, ffelexToken expr_token);
-void ffestc_R909_finish (void);
-void ffestc_R910_start (void);
-void ffestc_R910_item (ffebld expr, ffelexToken expr_token);
-void ffestc_R910_finish (void);
-void ffestc_R911_start (void);
-void ffestc_R911_item (ffebld expr, ffelexToken expr_token);
-void ffestc_R911_finish (void);
-void ffestc_R919 (void);
-void ffestc_R920 (void);
-void ffestc_R921 (void);
-void ffestc_R923A (void);
-void ffestc_R923B_start (void);
-void ffestc_R923B_item (ffebld expr, ffelexToken expr_token);
-void ffestc_R923B_finish (void);
-void ffestc_R1001 (ffesttFormatList f);
-void ffestc_R1102 (ffelexToken name);
-void ffestc_R1103 (ffelexToken name);
-#if FFESTR_F90
-void ffestc_R1105 (ffelexToken name);
-void ffestc_R1106 (ffelexToken name);
-void ffestc_R1107_start (ffelexToken name, bool only);
-void ffestc_R1107_item (ffelexToken local, ffelexToken use);
-void ffestc_R1107_finish (void);
-#endif
-void ffestc_R1111 (ffelexToken name);
-void ffestc_R1112 (ffelexToken name);
-#if FFESTR_F90
-void ffestc_R1202 (ffestpDefinedOperator operator, ffelexToken name);
-void ffestc_R1203 (void);
-void ffestc_R1205_start (void);
-void ffestc_R1205_item (ffelexToken name);
-void ffestc_R1205_finish (void);
-#endif
-void ffestc_R1207_start (void);
-void ffestc_R1207_item (ffelexToken name);
-void ffestc_R1207_finish (void);
-void ffestc_R1208_start (void);
-void ffestc_R1208_item (ffelexToken name);
-void ffestc_R1208_finish (void);
-void ffestc_R1212 (ffebld expr, ffelexToken expr_token);
-#if FFESTR_F90
-void ffestc_R1213 (ffebld dest, ffebld source, ffelexToken source_token);
-#endif
-void ffestc_R1219 (ffelexToken funcname, ffesttTokenList args,
- ffelexToken final, ffestpType type, ffebld kind, ffelexToken kindt,
- ffebld len, ffelexToken lent, ffelexToken recursive, ffelexToken result);
-void ffestc_R1221 (ffelexToken name);
-void ffestc_R1223 (ffelexToken subrname, ffesttTokenList args,
- ffelexToken final, ffelexToken recursive);
-void ffestc_R1225 (ffelexToken name);
-void ffestc_R1226 (ffelexToken entryname, ffesttTokenList args,
- ffelexToken final);
-void ffestc_R1227 (ffebld expr, ffelexToken expr_token);
-#if FFESTR_F90
-void ffestc_R1228 (void);
-#endif
-void ffestc_R1229_start (ffelexToken name, ffesttTokenList args,
- ffelexToken final);
-void ffestc_R1229_finish (ffebld expr, ffelexToken expr_token);
-void ffestc_S3P4 (ffebld filename, ffelexToken filename_token);
-#if FFESTR_VXT
-void ffestc_V003_start (ffelexToken structure_name);
-void ffestc_V003_item (ffelexToken name, ffesttDimList dims);
-void ffestc_V003_finish (void);
-void ffestc_V004 (void);
-void ffestc_V009 (void);
-void ffestc_V010 (void);
-void ffestc_V012 (void);
-void ffestc_V013 (void);
-#endif
-void ffestc_V014_start (void);
-void ffestc_V014_item_object (ffelexToken name);
-void ffestc_V014_item_cblock (ffelexToken name);
-void ffestc_V014_finish (void);
-#if FFESTR_VXT
-void ffestc_V016_start (void);
-void ffestc_V016_item_structure (ffelexToken name);
-void ffestc_V016_item_object (ffelexToken name, ffesttDimList dims);
-void ffestc_V016_finish (void);
-void ffestc_V018_start (void);
-void ffestc_V018_item (ffebld expr, ffelexToken expr_token);
-void ffestc_V018_finish (void);
-void ffestc_V019_start (void);
-void ffestc_V019_item (ffebld expr, ffelexToken expr_token);
-void ffestc_V019_finish (void);
-#endif
-void ffestc_V020_start (void);
-void ffestc_V020_item (ffebld expr, ffelexToken expr_token);
-void ffestc_V020_finish (void);
-#if FFESTR_VXT
-void ffestc_V021 (void);
-void ffestc_V022 (void);
-void ffestc_V023_start (void);
-void ffestc_V023_item (ffebld expr, ffelexToken expr_token);
-void ffestc_V023_finish (void);
-void ffestc_V024_start (void);
-void ffestc_V024_item (ffebld expr, ffelexToken expr_token);
-void ffestc_V024_finish (void);
-void ffestc_V025_start (void);
-void ffestc_V025_item (ffebld u, ffelexToken ut, ffebld m, ffelexToken mt,
- ffebld n, ffelexToken nt, ffebld asv, ffelexToken asvt);
-void ffestc_V025_finish (void);
-void ffestc_V026 (void);
-#endif
-void ffestc_V027_start (void);
-void ffestc_V027_item (ffelexToken dest_token, ffebld source,
- ffelexToken source_token);
-void ffestc_V027_finish (void);
-void ffestc_any (void);
-
-/* Define macros. */
-
-#define ffestc_context_iolist() ffestc_iolist_context_
-#define ffestc_init_0()
-#define ffestc_init_1()
-#define ffestc_init_2()
-#define ffestc_terminate_0()
-#define ffestc_terminate_1()
-#define ffestc_terminate_2()
-#define ffestc_terminate_3()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/std.c b/gcc/f/std.c
index 8c2adfb74f8..540da6c5498 100644
--- a/gcc/f/std.c
+++ b/gcc/f/std.c
@@ -1,6 +1,6 @@
/* std.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995-1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
diff --git a/gcc/f/std.h b/gcc/f/std.h
index 0e608b13548..5bf37928672 100644
--- a/gcc/f/std.h
+++ b/gcc/f/std.h
@@ -1,298 +1 @@
-/* std.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- std.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_std
-#define _H_f_std
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "lab.h"
-#include "lex.h"
-#include "stp.h"
-#include "str.h"
-#include "stt.h"
-#include "stv.h"
-#include "stw.h"
-#include "symbol.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffestd_begin_uses (void);
-void ffestd_do (bool ok);
-#if FFESTR_F90
-void ffestd_end_uses (bool ok);
-void ffestd_end_R740 (bool ok);
-#endif
-void ffestd_end_R807 (bool ok);
-void ffestd_exec_begin (void);
-void ffestd_exec_end (void);
-void ffestd_init_3 (void);
-void ffestd_labeldef_any (ffelab label);
-void ffestd_labeldef_branch (ffelab label);
-void ffestd_labeldef_format (ffelab label);
-void ffestd_labeldef_useless (ffelab label);
-#if FFESTR_F90
-void ffestd_R423A (void);
-void ffestd_R423B (void);
-void ffestd_R424 (ffelexToken access, ffestrOther access_kw, ffelexToken name);
-void ffestd_R425 (bool ok);
-void ffestd_R519_start (ffestrOther intent_kw);
-void ffestd_R519_item (ffelexToken name);
-void ffestd_R519_finish (void);
-void ffestd_R520_start (void);
-void ffestd_R520_item (ffelexToken name);
-void ffestd_R520_finish (void);
-void ffestd_R521A (void);
-void ffestd_R521Astart (void);
-void ffestd_R521Aitem (ffelexToken name);
-void ffestd_R521Afinish (void);
-void ffestd_R521B (void);
-void ffestd_R521Bstart (void);
-void ffestd_R521Bitem (ffelexToken name);
-void ffestd_R521Bfinish (void);
-#endif
-void ffestd_R522 (void);
-void ffestd_R522start (void);
-void ffestd_R522item_object (ffelexToken name);
-void ffestd_R522item_cblock (ffelexToken name);
-void ffestd_R522finish (void);
-void ffestd_R524_start (bool virtual);
-void ffestd_R524_item (ffelexToken name, ffesttDimList dims);
-void ffestd_R524_finish (void);
-#if FFESTR_F90
-void ffestd_R525_start (void);
-void ffestd_R525_item (ffelexToken name, ffesttDimList dims);
-void ffestd_R525_finish (void);
-void ffestd_R526_start (void);
-void ffestd_R526_item (ffelexToken name, ffesttDimList dims);
-void ffestd_R526_finish (void);
-void ffestd_R527_start (void);
-void ffestd_R527_item (ffelexToken name, ffesttDimList dims);
-void ffestd_R527_finish (void);
-#endif
-void ffestd_R537_start (void);
-void ffestd_R537_item (ffebld dest, ffebld source);
-void ffestd_R537_finish (void);
-void ffestd_R539 (void);
-void ffestd_R539start (void);
-void ffestd_R539item (ffestpType type, ffebld kind, ffelexToken kindt,
- ffebld len, ffelexToken lent, ffesttImpList letters);
-void ffestd_R539finish (void);
-void ffestd_R542_start (void);
-void ffestd_R542_item_nlist (ffelexToken name);
-void ffestd_R542_item_nitem (ffelexToken name);
-void ffestd_R542_finish (void);
-void ffestd_R544_start (void);
-void ffestd_R544_item (ffesttExprList exprlist);
-void ffestd_R544_finish (void);
-void ffestd_R547_start (void);
-void ffestd_R547_item_object (ffelexToken name, ffesttDimList dims);
-void ffestd_R547_item_cblock (ffelexToken name);
-void ffestd_R547_finish (void);
-#if FFESTR_F90
-void ffestd_R620 (ffesttExprList exprlist, ffebld stat);
-void ffestd_R624 (ffesttExprList pointers);
-void ffestd_R625 (ffesttExprList exprlist, ffebld stat);
-#endif
-void ffestd_R737A (ffebld dest, ffebld source);
-#if FFESTR_F90
-void ffestd_R737B (ffebld dest, ffebld source);
-void ffestd_R738 (ffebld dest, ffebld source);
-void ffestd_R740 (ffebld expr);
-void ffestd_R742 (ffebld expr);
-void ffestd_R744 (void);
-void ffestd_R745 (bool ok);
-#endif
-void ffestd_R803 (ffelexToken construct_name, ffebld expr);
-void ffestd_R804 (ffebld expr, ffelexToken name);
-void ffestd_R805 (ffelexToken name);
-void ffestd_R806 (bool ok);
-void ffestd_R807 (ffebld expr);
-void ffestd_R809 (ffelexToken construct_name, ffebld expr);
-void ffestd_R810 (unsigned long casenum);
-void ffestd_R811 (bool ok);
-void ffestd_R819A (ffelexToken construct_name, ffelab label, ffebld var,
- ffebld start, ffelexToken start_token,
- ffebld end, ffelexToken end_token,
- ffebld incr, ffelexToken incr_token);
-void ffestd_R819B (ffelexToken construct_name, ffelab label, ffebld expr);
-void ffestd_R825 (ffelexToken name);
-void ffestd_R834 (ffestw block);
-void ffestd_R835 (ffestw block);
-void ffestd_R836 (ffelab label);
-void ffestd_R837 (ffelab *labels, int count, ffebld expr);
-void ffestd_R838 (ffelab label, ffebld target);
-void ffestd_R839 (ffebld target, ffelab *labels, int count);
-void ffestd_R840 (ffebld expr, ffelab neg, ffelab zero, ffelab pos);
-void ffestd_R841 (bool in_where);
-void ffestd_R842 (ffebld expr);
-void ffestd_R843 (ffebld expr);
-void ffestd_R904 (void);
-void ffestd_R907 (void);
-void ffestd_R909_start (bool only_format, ffestvUnit unit,
- ffestvFormat format, bool rec, bool key);
-void ffestd_R909_item (ffebld expr, ffelexToken expr_token);
-void ffestd_R909_finish (void);
-void ffestd_R910_start (ffestvUnit unit, ffestvFormat format, bool rec);
-void ffestd_R910_item (ffebld expr, ffelexToken expr_token);
-void ffestd_R910_finish (void);
-void ffestd_R911_start (ffestvFormat format);
-void ffestd_R911_item (ffebld expr, ffelexToken expr_token);
-void ffestd_R911_finish (void);
-void ffestd_R919 (void);
-void ffestd_R920 (void);
-void ffestd_R921 (void);
-void ffestd_R923A (bool by_file);
-void ffestd_R923B_start (void);
-void ffestd_R923B_item (ffebld expr);
-void ffestd_R923B_finish (void);
-void ffestd_R1001 (ffesttFormatList f);
-void ffestd_R1102 (ffesymbol s, ffelexToken name);
-void ffestd_R1103 (bool ok);
-#if FFESTR_F90
-void ffestd_R1105 (ffelexToken name);
-void ffestd_R1106 (bool ok);
-void ffestd_R1107_start (ffelexToken name, bool only);
-void ffestd_R1107_item (ffelexToken local, ffelexToken use);
-void ffestd_R1107_finish (void);
-#endif
-void ffestd_R1111 (ffesymbol s, ffelexToken name);
-void ffestd_R1112 (bool ok);
-#if FFESTR_F90
-void ffestd_R1202 (ffestpDefinedOperator operator, ffelexToken name);
-void ffestd_R1203 (bool ok);
-void ffestd_R1205_start (void);
-void ffestd_R1205_item (ffelexToken name);
-void ffestd_R1205_finish (void);
-#endif
-void ffestd_R1207_start (void);
-void ffestd_R1207_item (ffelexToken name);
-void ffestd_R1207_finish (void);
-void ffestd_R1208_start (void);
-void ffestd_R1208_item (ffelexToken name);
-void ffestd_R1208_finish (void);
-void ffestd_R1212 (ffebld expr);
-#if FFESTR_F90
-void ffestd_R1213 (ffebld dest, ffebld source);
-#endif
-void ffestd_R1219 (ffesymbol s, ffelexToken funcname,
- ffesttTokenList args, ffestpType type, ffebld kind,
- ffelexToken kindt, ffebld len, ffelexToken lent,
- bool recursive, ffelexToken result,
- bool separate_result);
-void ffestd_R1221 (bool ok);
-void ffestd_R1223 (ffesymbol s, ffelexToken subrname, ffesttTokenList args,
- ffelexToken final, bool recursive);
-void ffestd_R1225 (bool ok);
-void ffestd_R1226 (ffesymbol entry);
-void ffestd_R1227 (ffebld expr);
-#if FFESTR_F90
-void ffestd_R1228 (void);
-#endif
-void ffestd_R1229_start (ffelexToken name, ffesttTokenList args);
-void ffestd_R1229_finish (ffesymbol s);
-void ffestd_S3P4 (ffebld filename);
-#if FFESTR_VXT
-void ffestd_V003_start (ffelexToken structure_name);
-void ffestd_V003_item (ffelexToken name, ffesttDimList dims);
-void ffestd_V003_finish (void);
-void ffestd_V004 (bool ok);
-void ffestd_V009 (void);
-void ffestd_V010 (bool ok);
-void ffestd_V012 (void);
-void ffestd_V013 (bool ok);
-#endif
-void ffestd_V014_start (void);
-void ffestd_V014_item_object (ffelexToken name);
-void ffestd_V014_item_cblock (ffelexToken name);
-void ffestd_V014_finish (void);
-#if FFESTR_VXT
-void ffestd_V016_start (void);
-void ffestd_V016_item_structure (ffelexToken name);
-void ffestd_V016_item_object (ffelexToken name, ffesttDimList dims);
-void ffestd_V016_finish (void);
-void ffestd_V018_start (ffestvFormat format);
-void ffestd_V018_item (ffebld expr);
-void ffestd_V018_finish (void);
-void ffestd_V019_start (ffestvFormat format);
-void ffestd_V019_item (ffebld expr);
-void ffestd_V019_finish (void);
-#endif
-void ffestd_V020_start (ffestvFormat format);
-void ffestd_V020_item (ffebld expr);
-void ffestd_V020_finish (void);
-#if FFESTR_VXT
-void ffestd_V021 (void);
-void ffestd_V022 (void);
-void ffestd_V023_start (void);
-void ffestd_V023_item (ffebld expr);
-void ffestd_V023_finish (void);
-void ffestd_V024_start (void);
-void ffestd_V024_item (ffebld expr);
-void ffestd_V024_finish (void);
-void ffestd_V025_start (void);
-void ffestd_V025_item (ffebld u, ffebld m, ffebld n, ffebld asv);
-void ffestd_V025_finish (void);
-void ffestd_V026 (void);
-#endif
-void ffestd_V027_start (void);
-void ffestd_V027_item (ffelexToken dest_token, ffebld source);
-void ffestd_V027_finish (void);
-void ffestd_any (void);
-
-/* Define macros. */
-
-#define ffestd_init_0()
-#define ffestd_init_1()
-#define ffestd_init_2()
-#define ffestd_init_4()
-#define ffestd_labeldef_notloop(l) ffestd_labeldef_branch(l)
-#define ffestd_labeldef_endif(l) ffestd_labeldef_branch(l)
-#define ffestd_terminate_0()
-#define ffestd_terminate_1()
-#define ffestd_terminate_2()
-#define ffestd_terminate_3()
-#define ffestd_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/ste.c b/gcc/f/ste.c
index e09654232b6..4a2476dde51 100644
--- a/gcc/f/ste.c
+++ b/gcc/f/ste.c
@@ -1,6 +1,6 @@
/* ste.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995-1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -45,12 +45,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Include files. */
+#include "proj.h"
+
#if FFECOM_targetCURRENT == FFECOM_targetGCC
-#include "config.j"
#include "rtl.j"
+#include "toplev.j"
#endif
-#include "proj.h"
#include "ste.h"
#include "bld.h"
#include "com.h"
@@ -636,7 +637,8 @@ ffeste_io_dofio_ (ffebld expr)
{
num_elements = size_binop (CEIL_DIV_EXPR,
TYPE_SIZE (TREE_TYPE (TREE_TYPE (variable))), size);
- num_elements = size_binop (CEIL_DIV_EXPR, num_elements,
+ num_elements = size_binop (CEIL_DIV_EXPR,
+ num_elements,
size_int (TYPE_PRECISION
(char_type_node)));
num_elements = convert (ffecom_f2c_ftnlen_type_node,
@@ -736,8 +738,9 @@ ffeste_io_dolio_ (ffebld expr)
num_elements = size_binop (CEIL_DIV_EXPR,
TYPE_SIZE (TREE_TYPE (TREE_TYPE (variable))), size);
num_elements = size_binop (CEIL_DIV_EXPR,
- num_elements, size_int (TYPE_PRECISION
- (char_type_node)));
+ num_elements,
+ size_int (TYPE_PRECISION
+ (char_type_node)));
num_elements = convert (ffecom_f2c_ftnlen_type_node,
num_elements);
}
diff --git a/gcc/f/ste.h b/gcc/f/ste.h
index e2122cecffd..5bf37928672 100644
--- a/gcc/f/ste.h
+++ b/gcc/f/ste.h
@@ -1,168 +1 @@
-/* ste.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- ste.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_ste
-#define _H_f_ste
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "lab.h"
-#include "lex.h"
-#include "stp.h"
-#include "str.h"
-#include "sts.h"
-#include "stt.h"
-#include "stv.h"
-#include "stw.h"
-#include "symbol.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffeste_do (ffestw block);
-void ffeste_end_R807 (void);
-void ffeste_labeldef_branch (ffelab label);
-void ffeste_labeldef_format (ffelab label);
-void ffeste_R737A (ffebld dest, ffebld source);
-void ffeste_R803 (ffebld expr);
-void ffeste_R804 (ffebld expr);
-void ffeste_R805 (void);
-void ffeste_R806 (void);
-void ffeste_R807 (ffebld expr);
-void ffeste_R809 (ffestw block, ffebld expr);
-void ffeste_R810 (ffestw block, unsigned long casenum);
-void ffeste_R811 (ffestw block);
-void ffeste_R819A (ffestw block, ffelab label, ffebld var,
- ffebld start, ffelexToken start_token,
- ffebld end, ffelexToken end_token,
- ffebld incr, ffelexToken incr_token);
-void ffeste_R819B (ffestw block, ffelab label, ffebld expr);
-void ffeste_R825 (void);
-void ffeste_R834 (ffestw block);
-void ffeste_R835 (ffestw block);
-void ffeste_R836 (ffelab label);
-void ffeste_R837 (ffelab *labels, int count, ffebld expr);
-void ffeste_R838 (ffelab label, ffebld target);
-void ffeste_R839 (ffebld target);
-void ffeste_R840 (ffebld expr, ffelab neg, ffelab zero, ffelab pos);
-void ffeste_R841 (void);
-void ffeste_R842 (ffebld expr);
-void ffeste_R843 (ffebld expr);
-void ffeste_R904 (ffestpOpenStmt *info);
-void ffeste_R907 (ffestpCloseStmt *info);
-void ffeste_R909_start (ffestpReadStmt *info, bool only_format,
- ffestvUnit unit, ffestvFormat format, bool rec, bool key);
-void ffeste_R909_item (ffebld expr, ffelexToken expr_token);
-void ffeste_R909_finish (void);
-void ffeste_R910_start (ffestpWriteStmt *info, ffestvUnit unit,
- ffestvFormat format, bool rec);
-void ffeste_R910_item (ffebld expr, ffelexToken expr_token);
-void ffeste_R910_finish (void);
-void ffeste_R911_start (ffestpPrintStmt *info, ffestvFormat format);
-void ffeste_R911_item (ffebld expr, ffelexToken expr_token);
-void ffeste_R911_finish (void);
-void ffeste_R919 (ffestpBeruStmt *info);
-void ffeste_R920 (ffestpBeruStmt *info);
-void ffeste_R921 (ffestpBeruStmt *info);
-void ffeste_R923A (ffestpInquireStmt *info, bool by_file);
-void ffeste_R923B_start (ffestpInquireStmt *info);
-void ffeste_R923B_item (ffebld expr);
-void ffeste_R923B_finish (void);
-void ffeste_R1001 (ffests s);
-void ffeste_R1103 (void);
-void ffeste_R1112 (void);
-void ffeste_R1212 (ffebld expr);
-void ffeste_R1221 (void);
-void ffeste_R1225 (void);
-void ffeste_R1226 (ffesymbol entry);
-void ffeste_R1227 (ffestw block, ffebld expr);
-#if FFESTR_VXT
-void ffeste_V018_start (ffestpRewriteStmt *info, ffestvFormat format);
-void ffeste_V018_item (ffebld expr);
-void ffeste_V018_finish (void);
-void ffeste_V019_start (ffestpAcceptStmt *info, ffestvFormat format);
-void ffeste_V019_item (ffebld expr);
-void ffeste_V019_finish (void);
-#endif
-void ffeste_V020_start (ffestpTypeStmt *info, ffestvFormat format);
-void ffeste_V020_item (ffebld expr);
-void ffeste_V020_finish (void);
-#if FFESTR_VXT
-void ffeste_V021 (ffestpDeleteStmt *info);
-void ffeste_V022 (ffestpBeruStmt *info);
-void ffeste_V023_start (ffestpVxtcodeStmt *info);
-void ffeste_V023_item (ffebld expr);
-void ffeste_V023_finish (void);
-void ffeste_V024_start (ffestpVxtcodeStmt *info);
-void ffeste_V024_item (ffebld expr);
-void ffeste_V024_finish (void);
-void ffeste_V025_start (void);
-void ffeste_V025_item (ffebld u, ffebld m, ffebld n, ffebld asv);
-void ffeste_V025_finish (void);
-void ffeste_V026 (ffestpFindStmt *info);
-#endif
-
-/* Define macros. */
-
-#define ffeste_init_0()
-#define ffeste_init_1()
-#define ffeste_init_2()
-#define ffeste_init_3()
-#define ffeste_init_4()
-#if FFECOM_targetCURRENT == FFECOM_targetGCC
-#define ffeste_filename() input_filename
-#define ffeste_filelinenum() lineno
-#define ffeste_set_line(name,num) \
- (input_filename = (name), lineno = (num))
-#elif FFECOM_targetCURRENT == FFECOM_targetFFE
-#define ffeste_set_line(name,num)
-#else
-#error
-#endif /* FFECOM_targetCURRENT == FFECOM_targetFFE */
-#define ffeste_terminate_0()
-#define ffeste_terminate_1()
-#define ffeste_terminate_2()
-#define ffeste_terminate_3()
-#define ffeste_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/storag.c b/gcc/f/storag.c
index 7ad155b983a..5bf37928672 100644
--- a/gcc/f/storag.c
+++ b/gcc/f/storag.c
@@ -1,573 +1 @@
-/* storag.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Maintains information on storage (memory) relationships between
- COMMON, dummy, and local variables, plus their equivalences (dummies
- don't have equivalences, however).
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "storag.h"
-#include "data.h"
-#include "malloc.h"
-#include "symbol.h"
-#include "target.h"
-
-/* Externals defined here. */
-
-ffestoragList_ ffestorag_list_;
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-static ffetargetOffset ffestorag_local_size_; /* #units allocated so far. */
-static bool ffestorag_reported_;/* Reports happen only once. */
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-#define ffestorag_next_(s) ((s)->next)
-#define ffestorag_previous_(s) ((s)->previous)
-
-/* ffestorag_drive -- Drive fn from list of storage objects
-
- ffestoragList sl;
- void (*fn)(ffestorag mst,ffestorag st);
- ffestorag mst; // the master ffestorag object (or whatever)
- ffestorag_drive(sl,fn,mst);
-
- Calls (*fn)(mst,st) for every st in the list sl. */
-
-void
-ffestorag_drive (ffestoragList sl, void (*fn) (ffestorag mst, ffestorag st),
- ffestorag mst)
-{
- ffestorag st;
-
- for (st = sl->first;
- st != (ffestorag) &sl->first;
- st = st->next)
- (*fn) (mst, st);
-}
-
-/* ffestorag_dump -- Dump information on storage object
-
- ffestorag s; // the ffestorag object
- ffestorag_dump(s);
-
- Dumps information in the storage object. */
-
-void
-ffestorag_dump (ffestorag s)
-{
- if (s == NULL)
- {
- fprintf (dmpout, "(no storage object)");
- return;
- }
-
- switch (s->type)
- {
- case FFESTORAG_typeCBLOCK:
- fprintf (dmpout, "CBLOCK ");
- break;
-
- case FFESTORAG_typeCOMMON:
- fprintf (dmpout, "COMMON ");
- break;
-
- case FFESTORAG_typeLOCAL:
- fprintf (dmpout, "LOCAL ");
- break;
-
- case FFESTORAG_typeEQUIV:
- fprintf (dmpout, "EQUIV ");
- break;
-
- default:
- fprintf (dmpout, "?%d? ", s->type);
- break;
- }
-
- if (s->symbol != NULL)
- fprintf (dmpout, "\"%s\" ", ffesymbol_text (s->symbol));
-
- fprintf (dmpout, "at %" ffetargetOffset_f "d size %" ffetargetOffset_f
- "d, align loc%%%"
- ffetargetAlign_f "u=%" ffetargetAlign_f "u, bt=%s, kt=%s",
- s->offset,
- s->size, (unsigned int) s->alignment, (unsigned int) s->modulo,
- ffeinfo_basictype_string (s->basic_type),
- ffeinfo_kindtype_string (s->kind_type));
-
- if (s->equivs_.first != (ffestorag) &s->equivs_.first)
- {
- ffestorag sq;
-
- fprintf (dmpout, " with equivs");
- for (sq = s->equivs_.first;
- sq != (ffestorag) &s->equivs_.first;
- sq = ffestorag_next_ (sq))
- {
- if (ffestorag_previous_ (sq) == (ffestorag) &s->equivs_.first)
- fputc (' ', dmpout);
- else
- fputc (',', dmpout);
- fprintf (dmpout, "%s", ffesymbol_text (ffestorag_symbol (sq)));
- }
- }
-}
-
-/* ffestorag_init_2 -- Initialize for new program unit
-
- ffestorag_init_2(); */
-
-void
-ffestorag_init_2 ()
-{
- ffestorag_list_.first = ffestorag_list_.last
- = (ffestorag) &ffestorag_list_.first;
- ffestorag_local_size_ = 0;
- ffestorag_reported_ = FALSE;
-}
-
-/* ffestorag_end_layout -- Do final layout for symbol
-
- ffesymbol s;
- ffestorag_end_layout(s); */
-
-void
-ffestorag_end_layout (ffesymbol s)
-{
- if (ffesymbol_storage (s) != NULL)
- return; /* Already laid out. */
-
- ffestorag_exec_layout (s); /* Do what we have in common. */
-#if 0
- assert (ffesymbol_storage (s) == NULL); /* I'd like to know what
- cases miss going through
- ffecom_sym_learned, and
- why; I don't think we
- should have to do the
- exec_layout thing at all
- here. */
- /* Now I think I know: we have to do exec_layout here, because equivalence
- handling could encounter an error that takes a variable off of its
- equivalence object (and vice versa), and we should then layout the var
- as a local entity. */
-#endif
-}
-
-/* ffestorag_exec_layout -- Do initial layout for symbol
-
- ffesymbol s;
- ffestorag_exec_layout(s); */
-
-void
-ffestorag_exec_layout (ffesymbol s)
-{
- ffetargetAlign alignment;
- ffetargetAlign modulo;
- ffetargetOffset size;
- ffetargetOffset num_elements;
- ffetargetAlign pad;
- ffestorag st;
- ffestorag stv;
- ffebld list;
- ffebld item;
- ffesymbol var;
- bool init;
-
- if (ffesymbol_storage (s) != NULL)
- return; /* Already laid out. */
-
- switch (ffesymbol_kind (s))
- {
- default:
- return; /* Do nothing. */
-
- case FFEINFO_kindENTITY:
- switch (ffesymbol_where (s))
- {
- case FFEINFO_whereLOCAL:
- if (ffesymbol_equiv (s) != NULL)
- return; /* Let ffeequiv handle this guy. */
- if (ffesymbol_rank (s) == 0)
- num_elements = 1;
- else
- {
- if (ffebld_op (ffesymbol_arraysize (s))
- != FFEBLD_opCONTER)
- return; /* An adjustable local array, just like a dummy. */
- num_elements
- = ffebld_constant_integerdefault (ffebld_conter
- (ffesymbol_arraysize (s)));
- }
- ffetarget_layout (ffesymbol_text (s), &alignment, &modulo,
- &size, ffesymbol_basictype (s),
- ffesymbol_kindtype (s), ffesymbol_size (s),
- num_elements);
- st = ffestorag_new (ffestorag_list_master ());
- st->parent = NULL; /* Initializations happen at sym level. */
- st->init = NULL;
- st->accretion = NULL;
- st->symbol = s;
- st->size = size;
- st->offset = 0;
- st->alignment = alignment;
- st->modulo = modulo;
- st->type = FFESTORAG_typeLOCAL;
- st->basic_type = ffesymbol_basictype (s);
- st->kind_type = ffesymbol_kindtype (s);
- st->type_symbol = s;
- st->is_save = ffesymbol_is_save (s);
- st->is_init = ffesymbol_is_init (s);
- ffesymbol_set_storage (s, st);
- if (ffesymbol_is_init (s))
- ffecom_notify_init_symbol (s); /* Init completed before, but
- we didn't have a storage
- object for it; maybe back
- end wants to see the sym
- again now. */
- ffesymbol_signal_unreported (s);
- return;
-
- case FFEINFO_whereCOMMON:
- return; /* Allocate storage for entire common block
- at once. */
-
- case FFEINFO_whereDUMMY:
- return; /* Don't do anything about dummies for now. */
-
- case FFEINFO_whereRESULT:
- case FFEINFO_whereIMMEDIATE:
- case FFEINFO_whereCONSTANT:
- case FFEINFO_whereNONE:
- return; /* These don't get storage (esp. NONE, which
- is UNCERTAIN). */
-
- default:
- assert ("bad ENTITY where" == NULL);
- return;
- }
- break;
-
- case FFEINFO_kindCOMMON:
- assert (ffesymbol_where (s) == FFEINFO_whereLOCAL);
- st = ffestorag_new (ffestorag_list_master ());
- st->parent = NULL; /* Initializations happen here. */
- st->init = NULL;
- st->accretion = NULL;
- st->symbol = s;
- st->size = 0;
- st->offset = 0;
- st->alignment = 1;
- st->modulo = 0;
- st->type = FFESTORAG_typeCBLOCK;
- if (ffesymbol_commonlist (s) != NULL)
- {
- var = ffebld_symter (ffebld_head (ffesymbol_commonlist (s)));
- st->basic_type = ffesymbol_basictype (var);
- st->kind_type = ffesymbol_kindtype (var);
- st->type_symbol = var;
- }
- else
- { /* Special case for empty common area:
- NONE/NONE means nothing. */
- st->basic_type = FFEINFO_basictypeNONE;
- st->kind_type = FFEINFO_kindtypeNONE;
- st->type_symbol = NULL;
- }
- st->is_save = ffesymbol_is_save (s);
- st->is_init = ffesymbol_is_init (s);
- if (!ffe_is_mainprog ())
- ffeglobal_save_common (s,
- st->is_save || ffe_is_saveall (),
- ffesymbol_where_line (s),
- ffesymbol_where_column (s));
- ffesymbol_set_storage (s, st);
-
- init = FALSE;
- for (list = ffesymbol_commonlist (s);
- list != NULL;
- list = ffebld_trail (list))
- {
- item = ffebld_head (list);
- assert (ffebld_op (item) == FFEBLD_opSYMTER);
- var = ffebld_symter (item);
- if (ffesymbol_basictype (var) == FFEINFO_basictypeANY)
- continue; /* Ignore any symbols that have errors. */
- if (ffesymbol_rank (var) == 0)
- num_elements = 1;
- else
- num_elements = ffebld_constant_integerdefault (ffebld_conter
- (ffesymbol_arraysize (var)));
- ffetarget_layout (ffesymbol_text (var), &alignment, &modulo,
- &size, ffesymbol_basictype (var),
- ffesymbol_kindtype (var), ffesymbol_size (var),
- num_elements);
- pad = ffetarget_align (&st->alignment, &st->modulo, st->size,
- alignment, modulo);
- if (pad != 0)
- { /* Warn about padding in the midst of a
- common area. */
- char padding[20];
-
- sprintf (&padding[0], "%" ffetargetAlign_f "u", pad);
- ffebad_start (FFEBAD_COMMON_PAD);
- ffebad_string (padding);
- ffebad_string (ffesymbol_text (var));
- ffebad_string (ffesymbol_text (s));
- ffebad_string ((pad == 1)
- ? FFECOM_SIZE_UNIT : FFECOM_SIZE_UNITS);
- ffebad_here (0, ffesymbol_where_line (s), ffesymbol_where_column (s));
- ffebad_finish ();
- }
- stv = ffestorag_new (ffestorag_list_master ());
- stv->parent = st; /* Initializations happen in COMMON block. */
- stv->init = NULL;
- stv->accretion = NULL;
- stv->symbol = var;
- stv->size = size;
- if (!ffetarget_offset_add (&stv->offset, st->size, pad))
- { /* Common block size plus pad, complain if
- overflow. */
- ffetarget_offset_overflow (ffesymbol_text (s));
- }
- if (!ffetarget_offset_add (&st->size, stv->offset, stv->size))
- { /* Adjust size of common block, complain if
- overflow. */
- ffetarget_offset_overflow (ffesymbol_text (s));
- }
- stv->alignment = alignment;
- stv->modulo = modulo;
- stv->type = FFESTORAG_typeCOMMON;
- stv->basic_type = ffesymbol_basictype (var);
- stv->kind_type = ffesymbol_kindtype (var);
- stv->type_symbol = var;
- stv->is_save = st->is_save;
- stv->is_init = st->is_init;
- ffesymbol_set_storage (var, stv);
- ffesymbol_signal_unreported (var);
- ffestorag_update (st, var, ffesymbol_basictype (var),
- ffesymbol_kindtype (var));
- if (ffesymbol_is_init (var))
- init = TRUE; /* Must move inits over to COMMON's
- ffestorag. */
- }
- if (ffeequiv_layout_cblock (st))
- init = TRUE;
- ffeglobal_pad_common (s, st->modulo, ffesymbol_where_line (s),
- ffesymbol_where_column (s));
- if (init)
- ffedata_gather (st); /* Gather subordinate inits into one init. */
- ffesymbol_signal_unreported (s);
- return;
- }
-}
-
-/* ffestorag_new -- Create new ffestorag object, append to list
-
- ffestorag s;
- ffestoragList sl;
- s = ffestorag_new(sl); */
-
-ffestorag
-ffestorag_new (ffestoragList sl)
-{
- ffestorag s;
-
- s = (ffestorag) malloc_new_kp (ffe_pool_program_unit (), "ffestorag",
- sizeof (*s));
- s->next = (ffestorag) &sl->first;
- s->previous = sl->last;
-#ifdef FFECOM_storageHOOK
- s->hook = FFECOM_storageNULL;
-#endif
- s->previous->next = s;
- sl->last = s;
- s->equivs_.first = s->equivs_.last = (ffestorag) &s->equivs_.first;
-
- return s;
-}
-
-/* Report info on LOCAL non-sym-assoc'ed entities if needed. */
-
-void
-ffestorag_report ()
-{
- ffestorag s;
-
- if (ffestorag_reported_)
- return;
-
- for (s = ffestorag_list_.first;
- s != (ffestorag) &ffestorag_list_.first;
- s = s->next)
- {
- if (s->symbol == NULL)
- {
- ffestorag_reported_ = TRUE;
- fputs ("Storage area: ", dmpout);
- ffestorag_dump (s);
- fputc ('\n', dmpout);
- }
- }
-}
-
-/* ffestorag_update -- Update type info for ffestorag object
-
- ffestorag s; // existing object
- ffeinfoBasictype bt; // basic type for newly added member of object
- ffeinfoKindtype kt; // kind type for it
- ffestorag_update(s,bt,kt);
-
- If the existing type for the storage object agrees with the new type
- info, just returns. If the basic types agree but not the kind types,
- sets the kind type for the object to NONE. If the basic types
- disagree, sets the kind type to NONE, and the basic type to NONE if the
- basic types both are not CHARACTER, otherwise to ANY. If the basic
- type for the object already is NONE, it is set to ANY if the new basic
- type is CHARACTER. Any time a transition is made to ANY and pedantic
- mode is on, a message is issued that mixing CHARACTER and non-CHARACTER
- stuff in the same COMMON/EQUIVALENCE is invalid. */
-
-void
-ffestorag_update (ffestorag s, ffesymbol sym, ffeinfoBasictype bt,
- ffeinfoKindtype kt)
-{
- if (s->basic_type == bt)
- {
- if (s->kind_type == kt)
- return;
- s->kind_type = FFEINFO_kindtypeNONE;
- return;
- }
-
- switch (s->basic_type)
- {
- case FFEINFO_basictypeANY:
- return; /* No need to do anything further. */
-
- case FFEINFO_basictypeCHARACTER:
- any: /* :::::::::::::::::::: */
- s->basic_type = FFEINFO_basictypeANY;
- s->kind_type = FFEINFO_kindtypeANY;
- if (ffe_is_pedantic ())
- {
- ffebad_start (FFEBAD_MIXED_TYPES);
- ffebad_string (ffesymbol_text (s->type_symbol));
- ffebad_string (ffesymbol_text (sym));
- ffebad_finish ();
- }
- return;
-
- default:
- if (bt == FFEINFO_basictypeCHARACTER)
- goto any; /* :::::::::::::::::::: */
- s->basic_type = FFEINFO_basictypeNONE;
- s->kind_type = FFEINFO_kindtypeNONE;
- return;
- }
-}
-
-/* Update INIT flag for storage object.
-
- If the INIT flag for the <s> object is already TRUE, return. Else,
- set it to TRUE and call ffe*_update_init for all contained objects. */
-
-void
-ffestorag_update_init (ffestorag s)
-{
- ffestorag sq;
-
- if (s->is_init)
- return;
-
- s->is_init = TRUE;
-
- if ((s->symbol != NULL)
- && !ffesymbol_is_init (s->symbol))
- ffesymbol_update_init (s->symbol);
-
- if (s->parent != NULL)
- ffestorag_update_init (s->parent);
-
- for (sq = s->equivs_.first;
- sq != (ffestorag) &s->equivs_.first;
- sq = ffestorag_next_ (sq))
- {
- if (!sq->is_init)
- ffestorag_update_init (sq);
- }
-}
-
-/* Update SAVE flag for storage object.
-
- If the SAVE flag for the <s> object is already TRUE, return. Else,
- set it to TRUE and call ffe*_update_save for all contained objects. */
-
-void
-ffestorag_update_save (ffestorag s)
-{
- ffestorag sq;
-
- if (s->is_save)
- return;
-
- s->is_save = TRUE;
-
- if ((s->symbol != NULL)
- && !ffesymbol_is_save (s->symbol))
- ffesymbol_update_save (s->symbol);
-
- if (s->parent != NULL)
- ffestorag_update_save (s->parent);
-
- for (sq = s->equivs_.first;
- sq != (ffestorag) &s->equivs_.first;
- sq = ffestorag_next_ (sq))
- {
- if (!sq->is_save)
- ffestorag_update_save (sq);
- }
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/storag.h b/gcc/f/storag.h
index 89c5f95b726..5bf37928672 100644
--- a/gcc/f/storag.h
+++ b/gcc/f/storag.h
@@ -1,167 +1 @@
-/* storag.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- storag.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_storag
-#define _H_f_storag
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFESTORAG_typeNONE,
- FFESTORAG_typeCBLOCK, /* A COMMON block. */
- FFESTORAG_typeCOMMON, /* A COMMON variable. */
- FFESTORAG_typeLOCAL, /* A local entity (var/array/equivalence). */
- FFESTORAG_typeEQUIV, /* An entity equivalenced into a COMMON/LOCAL
- entity. */
- FFESTORAG_type
- } ffestoragType;
-
-/* Typedefs. */
-
-typedef struct _ffestorag_ *ffestorag;
-typedef struct _ffestorag_list_ *ffestoragList;
-typedef struct _ffestorag_list_ ffestoragList_;
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "info.h"
-#include "symbol.h"
-#include "target.h"
-
-/* Structure definitions. */
-
-struct _ffestorag_list_
- {
- ffestorag first; /* First storage area in list. */
- ffestorag last; /* Last storage area in list. */
- };
-
-struct _ffestorag_
- {
- ffestorag next; /* Next storage area in list. */
- ffestorag previous; /* Previous storage area in list. */
- ffestorag parent; /* Parent who holds aggregate
- initializations. */
- ffebld init; /* Initialization expression. */
- ffebld accretion; /* Initializations seen so far for aggregate. */
- ffetargetOffset accretes; /* # inits needed to fill entire aggregate. */
- ffesymbol symbol; /* NULL if typeLOCAL and non-NULL equivs
- and the first "rooted" symbol not known. */
- ffestoragList_ equivs_; /* NULL if typeLOCAL and not an EQUIVALENCE
- area. */
- ffetargetOffset size; /* Size of area. */
- ffetargetOffset offset; /* Offset of entity within area, 0 for CBLOCK
- and non-equivalence LOCAL, <= 0 for equivalence
- LOCAL. */
- ffetargetAlign alignment; /* Initial alignment for entity. */
- ffetargetAlign modulo; /* Modulo within alignment. */
-#ifdef FFECOM_storageHOOK
- ffecomStorage hook; /* Whatever the backend needs here. */
-#endif
- ffestoragType type;
- ffeinfoBasictype basic_type;/* NONE= >1 non-CHARACTER; ANY=
- CHAR+non-CHAR. */
- ffeinfoKindtype kind_type; /* NONE= >1 kind type or NONE/ANY basic_type. */
- ffesymbol type_symbol; /* First symbol for basic_type/kind_type. */
- bool is_save; /* SAVE flag set for this storage area. */
- bool is_init; /* INIT flag set for this storage area. */
- };
-
-/* Global objects accessed by users of this module. */
-
-extern ffestoragList_ ffestorag_list_;
-
-/* Declare functions with prototypes. */
-
-void ffestorag_drive (ffestoragList sl, void (*fn) (ffestorag mst, ffestorag st),
- ffestorag mst);
-void ffestorag_dump (ffestorag s);
-void ffestorag_end_layout (ffesymbol s);
-void ffestorag_exec_layout (ffesymbol s);
-void ffestorag_init_2 (void);
-ffestorag ffestorag_new (ffestoragList sl);
-void ffestorag_report (void);
-void ffestorag_update (ffestorag s, ffesymbol sym, ffeinfoBasictype bt,
- ffeinfoKindtype kt);
-void ffestorag_update_init (ffestorag s);
-void ffestorag_update_save (ffestorag s);
-
-/* Define macros. */
-
-#define ffestorag_accretes(s) ((s)->accretes)
-#define ffestorag_accretion(s) ((s)->accretion)
-#define ffestorag_alignment(s) ((s)->alignment)
-#define ffestorag_basictype(s) ((s)->basic_type)
-#define ffestorag_hook(s) ((s)->hook)
-#define ffestorag_init(s) ((s)->init)
-#define ffestorag_init_0()
-#define ffestorag_init_1()
-#define ffestorag_init_3()
-#define ffestorag_init_4()
-#define ffestorag_is_init(s) ((s)->is_init)
-#define ffestorag_is_save(s) ((s)->is_save)
-#define ffestorag_kindtype(s) ((s)->kind_type)
-#define ffestorag_list_equivs(s) (&(s)->equivs_)
-#define ffestorag_list_master() (&ffestorag_list_)
-#define ffestorag_modulo(s) ((s)->modulo)
-#define ffestorag_offset(s) ((s)->offset)
-#define ffestorag_parent(s) ((s)->parent)
-#define ffestorag_ptr_to_alignment(s) (&(s)->alignment)
-#define ffestorag_ptr_to_modulo(s) (&(s)->modulo)
-#define ffestorag_set_accretes(s,a) ((s)->accretes = (a))
-#define ffestorag_set_accretion(s,a) ((s)->accretion = (a))
-#define ffestorag_set_alignment(s,a) ((s)->alignment = (a))
-#define ffestorag_set_basictype(s,b) ((s)->basic_type = (b))
-#define ffestorag_set_hook(s,h) ((s)->hook = (h))
-#define ffestorag_set_init(s,i) ((s)->init = (i))
-#define ffestorag_set_is_init(s,in) ((s)->is_init = (in))
-#define ffestorag_set_is_save(s,sa) ((s)->is_save = (sa))
-#define ffestorag_set_kindtype(s,k) ((s)->kind_type = (k))
-#define ffestorag_set_modulo(s,m) ((s)->modulo = (m))
-#define ffestorag_set_offset(s,o) ((s)->offset = (o))
-#define ffestorag_set_parent(s,p) ((s)->parent = (p))
-#define ffestorag_set_size(s,si) ((s)->size = (si))
-#define ffestorag_set_symbol(s,sy) ((s)->symbol = (sy))
-#define ffestorag_set_type(s,t) ((s)->type = (t))
-#define ffestorag_set_typesymbol(s,sy) ((s)->type_symbol = (sy))
-#define ffestorag_size(s) ((s)->size)
-#define ffestorag_symbol(s) ((s)->symbol)
-#define ffestorag_terminate_0()
-#define ffestorag_terminate_1()
-#define ffestorag_terminate_2()
-#define ffestorag_terminate_3()
-#define ffestorag_terminate_4()
-#define ffestorag_type(s) ((s)->type)
-#define ffestorag_typesymbol(s) ((s)->type_symbol)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stp.c b/gcc/f/stp.c
index 1f28c2e2283..5bf37928672 100644
--- a/gcc/f/stp.c
+++ b/gcc/f/stp.c
@@ -1,59 +1 @@
-/* stp.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Keeps track of some information needed while parsing (and usually
- before the exact statement is not confirmed).
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "stp.h"
-
-/* Externals defined here. */
-
-union _ffestp_fileu_ ffestp_file;
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stp.h b/gcc/f/stp.h
index 6ad9f681fe7..5bf37928672 100644
--- a/gcc/f/stp.h
+++ b/gcc/f/stp.h
@@ -1,508 +1 @@
-/* stp.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stp.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stp
-#define _H_f_stp
-
-/* Simple definitions and enumerations. */
-
-enum _ffestp_acceptix_
- {
- FFESTP_acceptixFORMAT,
- FFESTP_acceptix
- };
-typedef enum _ffestp_acceptix_ ffestpAcceptIx;
-
-enum _ffestp_attrib_
- {
-#if FFESTR_F90
- FFESTP_attribALLOCATABLE,
-#endif
- FFESTP_attribDIMENSION,
- FFESTP_attribEXTERNAL,
-#if FFESTR_F90
- FFESTP_attribINTENT,
-#endif
- FFESTP_attribINTRINSIC,
-#if FFESTR_F90
- FFESTP_attribOPTIONAL,
-#endif
- FFESTP_attribPARAMETER,
-#if FFESTR_F90
- FFESTP_attribPOINTER,
-#endif
-#if FFESTR_F90
- FFESTP_attribPRIVATE,
- FFESTP_attribPUBLIC,
-#endif
- FFESTP_attribSAVE,
-#if FFESTR_F90
- FFESTP_attribTARGET,
-#endif
- FFESTP_attrib
- };
-typedef enum _ffestp_attrib_ ffestpAttrib;
-
-enum _ffestp_beruix_
- {
- FFESTP_beruixERR,
- FFESTP_beruixIOSTAT,
- FFESTP_beruixUNIT,
- FFESTP_beruix
- };
-typedef enum _ffestp_beruix_ ffestpBeruIx;
-
-enum _ffestp_closeix_
- {
- FFESTP_closeixERR,
- FFESTP_closeixIOSTAT,
- FFESTP_closeixSTATUS,
- FFESTP_closeixUNIT,
- FFESTP_closeix
- };
-typedef enum _ffestp_closeix_ ffestpCloseIx;
-
-enum _ffestp_deleteix_
- {
- FFESTP_deleteixERR,
- FFESTP_deleteixIOSTAT,
- FFESTP_deleteixREC,
- FFESTP_deleteixUNIT,
- FFESTP_deleteix
- };
-typedef enum _ffestp_deleteix_ ffestpDeleteIx;
-
-enum _ffestp_findix_
- {
- FFESTP_findixERR,
- FFESTP_findixIOSTAT,
- FFESTP_findixREC,
- FFESTP_findixUNIT,
- FFESTP_findix
- };
-typedef enum _ffestp_findix_ ffestpFindIx;
-
-enum _ffestp_inquireix_
- {
- FFESTP_inquireixACCESS,
- FFESTP_inquireixACTION,
- FFESTP_inquireixBLANK,
- FFESTP_inquireixCARRIAGECONTROL,
- FFESTP_inquireixDEFAULTFILE,
- FFESTP_inquireixDELIM,
- FFESTP_inquireixDIRECT,
- FFESTP_inquireixERR,
- FFESTP_inquireixEXIST,
- FFESTP_inquireixFILE,
- FFESTP_inquireixFORM,
- FFESTP_inquireixFORMATTED,
- FFESTP_inquireixIOLENGTH,
- FFESTP_inquireixIOSTAT,
- FFESTP_inquireixKEYED,
- FFESTP_inquireixNAME,
- FFESTP_inquireixNAMED,
- FFESTP_inquireixNEXTREC,
- FFESTP_inquireixNUMBER,
- FFESTP_inquireixOPENED,
- FFESTP_inquireixORGANIZATION,
- FFESTP_inquireixPAD,
- FFESTP_inquireixPOSITION,
- FFESTP_inquireixREAD,
- FFESTP_inquireixREADWRITE,
- FFESTP_inquireixRECL,
- FFESTP_inquireixRECORDTYPE,
- FFESTP_inquireixSEQUENTIAL,
- FFESTP_inquireixUNFORMATTED,
- FFESTP_inquireixUNIT,
- FFESTP_inquireixWRITE,
- FFESTP_inquireix
- };
-typedef enum _ffestp_inquireix_ ffestpInquireIx;
-
-enum _ffestp_openix_
- {
- FFESTP_openixACCESS,
- FFESTP_openixACTION,
- FFESTP_openixASSOCIATEVARIABLE,
- FFESTP_openixBLANK,
- FFESTP_openixBLOCKSIZE,
- FFESTP_openixBUFFERCOUNT,
- FFESTP_openixCARRIAGECONTROL,
- FFESTP_openixDEFAULTFILE,
- FFESTP_openixDELIM,
- FFESTP_openixDISPOSE,
- FFESTP_openixERR,
- FFESTP_openixEXTENDSIZE,
- FFESTP_openixFILE,
- FFESTP_openixFORM,
- FFESTP_openixINITIALSIZE,
- FFESTP_openixIOSTAT,
- FFESTP_openixKEY,
- FFESTP_openixMAXREC,
- FFESTP_openixNOSPANBLOCKS,
- FFESTP_openixORGANIZATION,
- FFESTP_openixPAD,
- FFESTP_openixPOSITION,
- FFESTP_openixREADONLY,
- FFESTP_openixRECL,
- FFESTP_openixRECORDTYPE,
- FFESTP_openixSHARED,
- FFESTP_openixSTATUS,
- FFESTP_openixUNIT,
- FFESTP_openixUSEROPEN,
- FFESTP_openix
- };
-typedef enum _ffestp_openix_ ffestpOpenIx;
-
-enum _ffestp_printix_
- {
- FFESTP_printixFORMAT,
- FFESTP_printix
- };
-typedef enum _ffestp_printix_ ffestpPrintIx;
-
-enum _ffestp_readix_
- {
- FFESTP_readixADVANCE,
- FFESTP_readixEND,
- FFESTP_readixEOR,
- FFESTP_readixERR,
- FFESTP_readixFORMAT, /* Or NAMELIST (use expr info to
- distinguish). */
- FFESTP_readixIOSTAT,
- FFESTP_readixKEYEQ,
- FFESTP_readixKEYGE,
- FFESTP_readixKEYGT,
- FFESTP_readixKEYID,
- FFESTP_readixNULLS,
- FFESTP_readixREC,
- FFESTP_readixSIZE,
- FFESTP_readixUNIT,
- FFESTP_readix
- };
-typedef enum _ffestp_readix_ ffestpReadIx;
-
-enum _ffestp_rewriteix_
- {
- FFESTP_rewriteixERR,
- FFESTP_rewriteixFMT,
- FFESTP_rewriteixIOSTAT,
- FFESTP_rewriteixUNIT,
- FFESTP_rewriteix
- };
-typedef enum _ffestp_rewriteix_ ffestpRewriteIx;
-
-enum _ffestp_typeix_
- {
- FFESTP_typeixFORMAT,
- FFESTP_typeix
- };
-typedef enum _ffestp_typeix_ ffestpTypeIx;
-
-enum _ffestp_vxtcodeix_
- {
- FFESTP_vxtcodeixB,
- FFESTP_vxtcodeixC,
- FFESTP_vxtcodeixERR,
- FFESTP_vxtcodeixF,
- FFESTP_vxtcodeixIOSTAT,
- FFESTP_vxtcodeix
- };
-typedef enum _ffestp_vxtcodeix_ ffestpVxtcodeIx;
-
-enum _ffestp_writeix_
- {
- FFESTP_writeixADVANCE,
- FFESTP_writeixEOR,
- FFESTP_writeixERR,
- FFESTP_writeixFORMAT, /* Or NAMELIST (use expr info to
- distinguish). */
- FFESTP_writeixIOSTAT,
- FFESTP_writeixREC,
- FFESTP_writeixUNIT,
- FFESTP_writeix
- };
-typedef enum _ffestp_writeix_ ffestpWriteIx;
-
-#if FFESTR_F90
-enum _ffestp_definedoperator_
- {
- FFESTP_definedoperatorNone, /* INTERFACE generic-name. */
- FFESTP_definedoperatorOPERATOR, /* INTERFACE
- OPERATOR(defined-operator). */
- FFESTP_definedoperatorASSIGNMENT, /* INTERFACE ASSIGNMENT(=). */
- FFESTP_definedoperatorPOWER,
- FFESTP_definedoperatorMULT,
- FFESTP_definedoperatorADD,
- FFESTP_definedoperatorCONCAT,
- FFESTP_definedoperatorDIVIDE,
- FFESTP_definedoperatorSUBTRACT,
- FFESTP_definedoperatorNOT,
- FFESTP_definedoperatorAND,
- FFESTP_definedoperatorOR,
- FFESTP_definedoperatorEQV,
- FFESTP_definedoperatorNEQV,
- FFESTP_definedoperatorEQ,
- FFESTP_definedoperatorNE,
- FFESTP_definedoperatorLT,
- FFESTP_definedoperatorLE,
- FFESTP_definedoperatorGT,
- FFESTP_definedoperatorGE,
- FFESTP_definedoperator
- };
-typedef enum _ffestp_definedoperator_ ffestpDefinedOperator;
-#endif
-
-enum _ffestp_dimtype_
- {
- FFESTP_dimtypeNONE,
- FFESTP_dimtypeKNOWN, /* Known-bounds dimension list. */
- FFESTP_dimtypeADJUSTABLE, /* Adjustable dimension list. */
- FFESTP_dimtypeASSUMED, /* Assumed dimension list (known except for
- last). */
- FFESTP_dimtypeADJUSTABLEASSUMED, /* Both. */
- FFESTP_dimtype
- };
-typedef enum _ffestp_dimtype_ ffestpDimtype;
-
-enum _ffestp_formattype_
- {
- FFESTP_formattypeNone,
- FFESTP_formattypeI,
- FFESTP_formattypeB,
- FFESTP_formattypeO,
- FFESTP_formattypeZ,
- FFESTP_formattypeF,
- FFESTP_formattypeE,
- FFESTP_formattypeEN,
- FFESTP_formattypeG,
- FFESTP_formattypeL,
- FFESTP_formattypeA,
- FFESTP_formattypeD,
- FFESTP_formattypeQ,
- FFESTP_formattypeDOLLAR, /* $ (V-extension). */
- FFESTP_formattypeP,
- FFESTP_formattypeT,
- FFESTP_formattypeTL,
- FFESTP_formattypeTR,
- FFESTP_formattypeX,
- FFESTP_formattypeS,
- FFESTP_formattypeSP,
- FFESTP_formattypeSS,
- FFESTP_formattypeBN,
- FFESTP_formattypeBZ,
- FFESTP_formattypeH, /* Hollerith, used only for error-reporting. */
- FFESTP_formattypeSLASH,
- FFESTP_formattypeCOLON,
- FFESTP_formattypeR1016, /* char-literal-constant or cHchars. */
- FFESTP_formattypeFORMAT, /* [r](format-item-list). */
- FFESTP_formattype
- };
-typedef enum _ffestp_formattype_ ffestpFormatType;
-
-enum _ffestp_type_
- {
- FFESTP_typeNone,
- FFESTP_typeINTEGER,
- FFESTP_typeREAL,
- FFESTP_typeCOMPLEX,
- FFESTP_typeLOGICAL,
- FFESTP_typeCHARACTER,
- FFESTP_typeDBLPRCSN,
- FFESTP_typeDBLCMPLX,
- FFESTP_typeBYTE,
- FFESTP_typeWORD,
-#if FFESTR_F90
- FFESTP_typeTYPE,
-#endif
- FFESTP_type
- };
-typedef enum _ffestp_type_ ffestpType;
-
-/* Typedefs. */
-
-typedef struct _ffest_accept_stmt_ ffestpAcceptStmt;
-typedef struct _ffest_beru_stmt_ ffestpBeruStmt;
-typedef struct _ffest_close_stmt_ ffestpCloseStmt;
-typedef struct _ffest_delete_stmt_ ffestpDeleteStmt;
-typedef struct _ffestp_file ffestpFile;
-typedef struct _ffest_find_stmt_ ffestpFindStmt;
-typedef struct _ffest_inquire_stmt_ ffestpInquireStmt;
-typedef struct _ffest_open_stmt_ ffestpOpenStmt;
-typedef struct _ffest_print_stmt_ ffestpPrintStmt;
-typedef struct _ffest_read_stmt_ ffestpReadStmt;
-typedef struct _ffest_rewrite_stmt_ ffestpRewriteStmt;
-typedef struct _ffest_type_stmt_ ffestpTypeStmt;
-typedef struct _ffest_vxtcode_stmt_ ffestpVxtcodeStmt;
-typedef struct _ffest_write_stmt_ ffestpWriteStmt;
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "lab.h"
-#include "lex.h"
-#include "stp.h"
-#include "stt.h"
-
-/* Structure definitions. */
-
-struct _ffestp_file
- {
- bool kw_or_val_present; /* If FALSE, all else is n/a. */
- bool kw_present; /* Indicates whether kw has a token. */
- bool value_present; /* Indicates whether value/expr are valid. */
- bool value_is_label; /* TRUE if expr has no expression, value is
- NUMBER. */
- ffelexToken kw; /* The keyword, iff kw_or_val_present &&
- kw_present. */
- ffelexToken value; /* The value, iff kw_or_val_present &&
- value_present. */
- union
- {
- ffebld expr; /* The expr, iff kw_or_val_present &&
- value_present && !value_is_label. */
- ffelab label; /* The label, iff kw_or_val_present &&
- value_present && value_is_label. */
- }
- u;
- };
-
-struct _ffest_accept_stmt_
- {
- ffestpFile accept_spec[FFESTP_acceptix];
- };
-
-struct _ffest_beru_stmt_
- {
- ffestpFile beru_spec[FFESTP_beruix];
- };
-
-struct _ffest_close_stmt_
- {
- ffestpFile close_spec[FFESTP_closeix];
- };
-
-struct _ffest_delete_stmt_
- {
- ffestpFile delete_spec[FFESTP_deleteix];
- };
-
-struct _ffest_find_stmt_
- {
- ffestpFile find_spec[FFESTP_findix];
- };
-
-struct _ffest_imp_list_
- {
- ffesttImpList next;
- ffesttImpList previous;
- ffelexToken first;
- ffelexToken last; /* NULL if a single letter. */
- };
-
-struct _ffest_inquire_stmt_
- {
- ffestpFile inquire_spec[FFESTP_inquireix];
- };
-
-struct _ffest_open_stmt_
- {
- ffestpFile open_spec[FFESTP_openix];
- };
-
-struct _ffest_print_stmt_
- {
- ffestpFile print_spec[FFESTP_printix];
- };
-
-struct _ffest_read_stmt_
- {
- ffestpFile read_spec[FFESTP_readix];
- };
-
-struct _ffest_rewrite_stmt_
- {
- ffestpFile rewrite_spec[FFESTP_rewriteix];
- };
-
-struct _ffest_type_stmt_
- {
- ffestpFile type_spec[FFESTP_typeix];
- };
-
-struct _ffest_vxtcode_stmt_
- {
- ffestpFile vxtcode_spec[FFESTP_vxtcodeix];
- };
-
-struct _ffest_write_stmt_
- {
- ffestpFile write_spec[FFESTP_writeix];
- };
-
-union _ffestp_fileu_
- {
- ffestpAcceptStmt accept;
- ffestpBeruStmt beru;
- ffestpCloseStmt close;
- ffestpDeleteStmt delete;
- ffestpFindStmt find;
- ffestpInquireStmt inquire;
- ffestpOpenStmt open;
- ffestpPrintStmt print;
- ffestpReadStmt read;
- ffestpRewriteStmt rewrite;
- ffestpTypeStmt type;
- ffestpVxtcodeStmt vxtcode;
- ffestpWriteStmt write;
- };
-
-/* Global objects accessed by users of this module. */
-
-extern union _ffestp_fileu_ ffestp_file;
-
-/* Declare functions with prototypes. */
-
-
-/* Define macros. */
-
-#define ffestp_init_0()
-#define ffestp_init_1()
-#define ffestp_init_2()
-#define ffestp_init_3()
-#define ffestp_init_4()
-#define ffestp_terminate_0()
-#define ffestp_terminate_1()
-#define ffestp_terminate_2()
-#define ffestp_terminate_3()
-#define ffestp_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str-1t.fin b/gcc/f/str-1t.fin
index b2c7766afc4..716adefc4c8 100644
--- a/gcc/f/str-1t.fin
+++ b/gcc/f/str-1t.fin
@@ -1,135 +1,2 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_first // // ffestrFirst ffestr_first 1 1
-;Accept ACCEPT
-;Allocatable ALLOCATABLE
-;Allocate ALLOCATE
-Assign ASSIGN
-Backspace BACKSPACE
-Block BLOCK
-BlockData BLOCKDATA
-Byte BYTE
-Call CALL
-Case CASE
-CaseDefault CASEDEFAULT
-Character CHRCTR
-Close CLOSE
-Common COMMON
-Complex CMPLX
-;Contains CONTAINS
-Continue CONTINUE
-Cycle CYCLE
-Data DATA
-;Deallocate DEALLOCATE
-Decode DECODE
-Define DEFINE
-;DefineFile DEFINEFILE
-Delete DELETE
-Dimension DIMENSION
-Do DO
-Double DBL
-DoubleComplex DBLCMPLX
-DoublePrecision DBLPRCSN
-DoWhile DOWHILE
-Else ELSE
-ElseIf ELSEIF
-;ElseWhere ELSEWHERE
-Encode ENCODE
-End END
-EndBlock ENDBLOCK
-EndBlockData ENDBLOCKDATA
-EndDo ENDDO
-EndFile ENDFILE
-EndFunction ENDFUNCTION
-EndIf ENDIF
-;EndInterface ENDINTERFACE
-;EndMap ENDMAP
-;EndModule ENDMODULE
-EndProgram ENDPROGRAM
-EndSelect ENDSELECT
-;EndStructure ENDSTRUCTURE
-EndSubroutine ENDSUBROUTINE
-;EndType ENDTYPE
-;EndUnion ENDUNION
-;EndWhere ENDWHERE
-Entry ENTRY
-Equivalence EQUIVALENCE
-Exit EXIT
-External EXTERNAL
-Find FIND
-Format FORMAT
-Function FUNCTION
-Go GO
-Goto GOTO
-If IF
-Implicit IMPLICIT
-Include INCLUDE
-Inquire INQUIRE
-Integer INTGR
-;Intent INTENT
-;Interface INTERFACE
-;InterfaceAssignment INTERFACEASSGNMNT
-;InterfaceOperator INTERFACEOPERATOR
-Intrinsic INTRINSIC
-Logical LGCL
-;Map MAP
-;Module MODULE
-;ModuleProcedure MODULEPROCEDURE
-NameList NAMELIST
-;Nullify NULLIFY
-Open OPEN
-;Optional OPTIONAL
-Parameter PARAMETER
-Pause PAUSE
-;Pointer POINTER
-Print PRINT
-;Private PRIVATE
-Program PROGRAM
-;Public PUBLIC
-Read READ
-Real REAL
-;Record RECORD
-;Recursive RECURSIVE
-;RecursiveFunction RECURSIVEFNCTN
-Return RETURN
-Rewind REWIND
-;Rewrite REWRITE
-Save SAVE
-Select SELECT
-SelectCase SELECTCASE
-;Sequence SEQUENCE
-Stop STOP
-;Structure STRUCTURE
-Subroutine SUBROUTINE
-;Target TARGET
-Then THEN
-Type TYPE
-;Union UNION
-;Unlock UNLOCK
-;Use USE
-Virtual VIRTUAL
-Volatile VOLATILE
-;Where WHERE
-Word WORD
-Write WRITE
+ Contributed by James Craig Burley (burley@gnu.org).
+GoTo GOTO
diff --git a/gcc/f/str-2t.fin b/gcc/f/str-2t.fin
index c8973809af5..5bf37928672 100644
--- a/gcc/f/str-2t.fin
+++ b/gcc/f/str-2t.fin
@@ -1,60 +1 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_second // // ffestrSecond ffestr_second 1 0
-;Assignment ASSIGNMENT
-Block BLOCK
-BlockData BLOCKDATA
-Byte BYTE
-Case CASE
-Character CHARACTER
-Complex COMPLEX
-Data DATA
-Default DEFAULT
-Do DO
-Double DOUBLE
-DoubleComplex DOUBLECOMPLEX
-DoublePrecision DOUBLEPRECISION
-File FILE
-Function FUNCTION
-If IF
-Integer INTEGER
-;Interface INTERFACE
-Logical LOGICAL
-;Map MAP
-;Module MODULE
-None NONE
-;Operator OPERATOR
-Precision PRECISION
-;Procedure PROCEDURE
-Program PROGRAM
-Real REAL
-Select SELECT
-;Structure STRUCTURE
-Subroutine SUBROUTINE
-To TO
-;Type TYPE
-;Union UNION
-;Where WHERE
-While WHILE
-Word WORD
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str-fo.fin b/gcc/f/str-fo.fin
index f0475cd6c4b..5bf37928672 100644
--- a/gcc/f/str-fo.fin
+++ b/gcc/f/str-fo.fin
@@ -1,55 +1 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_format // // ffestrFormat ffestr_format 0 1
-$ DOLLAR
-A A
-B B
-BN BN
-BZ BZ
-D D
-E E
-En EN
-F F
-G G
-H H
-I I
-L L
-N N
-O O
-P P
-PD PD
-PE PE
-PEn PEN
-PF PF
-PG PG
-Q Q
-R R
-S S
-SP SP
-SS SS
-T T
-TL TL
-TR TR
-X X
-Z Z
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str-io.fin b/gcc/f/str-io.fin
index 12066a59c0d..5bf37928672 100644
--- a/gcc/f/str-io.fin
+++ b/gcc/f/str-io.fin
@@ -1,43 +1 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_genio // // ffestrGenio ffestr_genio 1 0
-Advance ADVANCE
-Disp DISP
-Dispose DISPOSE
-End END
-EoR EOR
-Err ERR
-Fmt FMT
-IOStat IOSTAT
-Key KEY
-KeyEQ KEYEQ
-KeyGE KEYGE
-KeyGT KEYGT
-KeyID KEYID
-Nml NML
-Nulls NULLS
-Rec REC
-Size SIZE
-Status STATUS
-Unit UNIT
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str-nq.fin b/gcc/f/str-nq.fin
index ef4729e0339..5bf37928672 100644
--- a/gcc/f/str-nq.fin
+++ b/gcc/f/str-nq.fin
@@ -1,55 +1 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_inquire // // ffestrInquire ffestr_inquire 1 0
-Access ACCESS
-Action ACTION
-Blank BLANK
-CarriageControl CARRIAGECONTROL
-DefaultFile DEFAULTFILE
-Delim DELIM
-Direct DIRECT
-Err ERR
-Exist EXIST
-File FILE
-Form FORM
-Formatted FORMATTED
-IOLength IOLENGTH
-IOStat IOSTAT
-Keyed KEYED
-Name NAME
-Named NAMED
-NextRec NEXTREC
-Number NUMBER
-Opened OPENED
-Organization ORGANIZATION
-Pad PAD
-Position POSITION
-Read READ
-ReadWrite READWRITE
-RecL RECL
-RecordType RECORDTYPE
-Sequential SEQUENTIAL
-Unformatted UNFORMATTED
-Unit UNIT
-Write WRITE
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str-op.fin b/gcc/f/str-op.fin
index 161a6486187..5bf37928672 100644
--- a/gcc/f/str-op.fin
+++ b/gcc/f/str-op.fin
@@ -1,57 +1 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_open // // ffestrOpen ffestr_open 1 0
-Access ACCESS
-Action ACTION
-AssociateVariable ASSOCIATEVARIABLE
-Blank BLANK
-BlockSize BLOCKSIZE
-BufferCount BUFFERCOUNT
-CarriageControl CARRIAGECONTROL
-DefaultFile DEFAULTFILE
-Delim DELIM
-Disp DISP
-Dispose DISPOSE
-Err ERR
-ExtendSize EXTENDSIZE
-File FILE
-Form FORM
-InitialSize INITIALSIZE
-IOStat IOSTAT
-Key KEY
-MaxRec MAXREC
-Name NAME
-NoSpanBlocks NOSPANBLOCKS
-Organization ORGANIZATION
-Pad PAD
-Position POSITION
-Readonly READONLY
-Recl RECL
-RecordSize RECORDSIZE
-RecordType RECORDTYPE
-Shared SHARED
-Status STATUS
-Type TYPE
-Unit UNIT
-UserOpen USEROPEN
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str-ot.fin b/gcc/f/str-ot.fin
index 107d0bb50cf..ae7329efef9 100644
--- a/gcc/f/str-ot.fin
+++ b/gcc/f/str-ot.fin
@@ -1,47 +1,15 @@
-{
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
-}
-
-FFESTR_other // // ffestrOther ffestr_other 1 1
-;And AND
-;Dimension DIMENSION
-;Eq EQ
-;Eqv EQV
-;Ge GE
-;Gt GT
-In IN
-InOut INOUT
-Kind KIND
-;Le LE
-Len LEN
-;Lt LT
-;Ne NE
-;Neqv NEQV
-;Not NOT
-;Only ONLY
-;Or OR
-Out OUT
-;Pointer POINTER
-;Private PRIVATE
-;Public PUBLIC
-Result RESULT
-;Stat STAT
+ Contributed by James Craig Burley (burley@gnu.org).
+And AND
+Eq EQ
+Eqv EQV
+False FALSE
+GE GE
+GT GT
+LE LE
+LT LT
+NE NE
+NEqv NEQV
+Not NOT
+Or OR
+True TRUE
+XOr XOR
diff --git a/gcc/f/str.c b/gcc/f/str.c
index 3fa6b86200e..5bf37928672 100644
--- a/gcc/f/str.c
+++ b/gcc/f/str.c
@@ -1,217 +1 @@
-/* str.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Handles recognition of keywords.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "src.h"
-#include "str.h"
-#include "lex.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffestr_first -- Look up the first names in a statement
-
- ffestrFirst kw;
- ffelexToken t;
- kw = ffestr_first(t);
-
- Returns FFESTR_firstNone if no matches, else FFESTR_firstXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_first.fini", consisting primarily of a
- list of statements (ASSIGN, IF, DO, DOWHILE), and outputs a C file,
- "str-1t.j", that contains the definition of the
- ffestr_first function. We #include that file here.
-
- 30-Jan-90 JCB 2.0
- Updated for Fortran 90.
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-1t.j"
-#endif
-/* ffestr_format -- Look up format names in a statement
-
- ffestrFormat kw;
- ffelexToken t;
- kw = ffestr_format(t);
-
- Returns FFESTR_formatNone if no matches, else FFESTR_formatXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_format.fini", consisting primarily of a
- list of format keywords (I, F, TL, TR), and outputs a C file,
- "str-fo.j", that contains the definition of the
- ffestr_format function. We #include that file here.
-
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-fo.j"
-#endif
-/* ffestr_genio -- Look up genio names in a statement
-
- ffestrGenio kw;
- ffelexToken t;
- kw = ffestr_genio(t);
-
- Returns FFESTR_genioNone if no matches, else FFESTR_genioXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_genio.fini", consisting primarily of a
- list of statement keywords (TO, FUNCTION), and outputs a C file,
- "str-io.j", that contains the definition of the
- ffestr_genio function. We #include that file here.
-
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-io.j"
-#endif
-/* ffestr_inquire -- Look up inquire names in a statement
-
- ffestrInquire kw;
- ffelexToken t;
- kw = ffestr_inquire(t);
-
- Returns FFESTR_inquireNone if no matches, else FFESTR_inquireXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_inquire.fini", consisting primarily of a
- list of statement keywords (TO, FUNCTION), and outputs a C file,
- "str-nq.j", that contains the definition of the
- ffestr_inquire function. We #include that file here.
-
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-nq.j"
-#endif
-/* ffestr_open -- Look up open names in a statement
-
- ffestrOpen kw;
- ffelexToken t;
- kw = ffestr_open(t);
-
- Returns FFESTR_openNone if no matches, else FFESTR_openXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_open.fini", consisting primarily of a
- list of statement keywords (TO, FUNCTION), and outputs a C file,
- "str-op.j", that contains the definition of the
- ffestr_open function. We #include that file here.
-
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-op.j"
-#endif
-/* ffestr_other -- Look up other names in a statement
-
- ffestrOther kw;
- ffelexToken t;
- kw = ffestr_other(t);
-
- Returns FFESTR_otherNone if no matches, else FFESTR_otherXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_other.fini", consisting primarily of a
- list of statement keywords (TO, FUNCTION), and outputs a C file,
- "str-ot.j", that contains the definition of the
- ffestr_other function. We #include that file here.
-
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-ot.j"
-#endif
-/* ffestr_second -- Look up the second name in a statement
-
- ffestrSecond kw;
- ffelexToken t;
- kw = ffestr_second(t);
-
- Returns FFESTR_secondNone if no matches, else FFESTR_secondXYZ if the
- NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
- routine will crash.
-
- This routine's code is actually written by a utility called FINI, itself
- written specifically for the Gnu Fortran project. FINI takes an input
- file, in this case "ffe_second.fini", consisting primarily of a
- list of statement keywords (TO, FUNCTION), and outputs a C file,
- "str-2t.j", that contains the definition of the
- ffestr_second function. We #include that file here.
-
-*/
-
-#ifndef MAKING_DEPENDENCIES
-#include "str-2t.j"
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/str.h b/gcc/f/str.h
index 84def9a79af..5bf37928672 100644
--- a/gcc/f/str.h
+++ b/gcc/f/str.h
@@ -1,85 +1 @@
-/* str.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- str.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_str
-#define _H_f_str
-
-/* Simple definitions and enumerations. */
-
-#define FFESTR_F90 0 /* Unsupported F90 stuff. */
-#define FFESTR_VXT 0 /* Unsupported VXT stuff. */
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "lex.h"
-#ifndef MAKING_DEPENDENCIES
-#include "str-1t.h"
-#include "str-fo.h"
-#include "str-io.h"
-#include "str-nq.h"
-#include "str-ot.h"
-#include "str-op.h"
-#include "str-2t.h"
-#endif
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-ffestrFirst ffestr_first (ffelexToken t);
-ffestrFormat ffestr_format (ffelexToken t);
-ffestrGenio ffestr_genio (ffelexToken t);
-ffestrInquire ffestr_inquire (ffelexToken t);
-ffestrOpen ffestr_open (ffelexToken t);
-ffestrOther ffestr_other (ffelexToken t);
-ffestrSecond ffestr_second (ffelexToken t);
-
-/* Define macros. */
-
-#define ffestr_init_0()
-#define ffestr_init_1()
-#define ffestr_init_2()
-#define ffestr_init_3()
-#define ffestr_init_4()
-#define ffestr_terminate_0()
-#define ffestr_terminate_1()
-#define ffestr_terminate_2()
-#define ffestr_terminate_3()
-#define ffestr_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/sts.c b/gcc/f/sts.c
index dabb919d566..1229ad55dc7 100644
--- a/gcc/f/sts.c
+++ b/gcc/f/sts.c
@@ -1,6 +1,6 @@
/* sts.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
diff --git a/gcc/f/sts.h b/gcc/f/sts.h
index c8141fe01fb..5bf37928672 100644
--- a/gcc/f/sts.h
+++ b/gcc/f/sts.h
@@ -1,89 +1 @@
-/* sts.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- sts.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_sts
-#define _H_f_sts
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-typedef struct _ffests_ *ffests;
-typedef struct _ffests_ ffestsHolder;
-typedef unsigned long int ffestsLength;
-
-/* Include files needed by this one. */
-
-#include "malloc.h"
-
-/* Structure definitions. */
-
-struct _ffests_
- {
- char *text_;
- mallocPool pool_;
- ffestsLength len_;
- ffestsLength max_;
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffests_kill (ffests s);
-void ffests_new (ffests s, mallocPool pool, ffestsLength size);
-void ffests_printf_1D (ffests s, char *ctl, long arg1);
-void ffests_printf_1U (ffests s, char *ctl, unsigned long arg1);
-void ffests_printf_1s (ffests s, char *ctl, char *arg1);
-void ffests_printf_2Us (ffests s, char *ctl, unsigned long arg1,
- char *arg2);
-void ffests_putc (ffests s, char c);
-void ffests_puts (ffests s, char *string);
-void ffests_puttext (ffests s, char *text, ffestsLength length);
-
-/* Define macros. */
-
-#define ffests_init_0()
-#define ffests_init_1()
-#define ffests_init_2()
-#define ffests_init_3()
-#define ffests_init_4()
-#define ffests_length(s) ((s)->len_)
-#define ffests_terminate_0()
-#define ffests_terminate_1()
-#define ffests_terminate_2()
-#define ffests_terminate_3()
-#define ffests_terminate_4()
-#define ffests_text(s) ((s)->text_)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stt.c b/gcc/f/stt.c
index d0fd582355b..521fd4c58a4 100644
--- a/gcc/f/stt.c
+++ b/gcc/f/stt.c
@@ -1,1034 +1,12 @@
-/* stt.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Manages lists of tokens and related info for parsing.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "stt.h"
-#include "bld.h"
-#include "expr.h"
-#include "info.h"
-#include "lex.h"
-#include "malloc.h"
-#include "sta.h"
-#include "stp.h"
-
-/* Externals defined here. */
-
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffestt_caselist_append -- Append case to list of cases
-
- ffesttCaseList list;
- ffelexToken t;
- ffestt_caselist_append(list,range,case1,case2,t);
-
- list must have already been created by ffestt_caselist_create. The
- list is allocated out of the scratch pool. The token is consumed. */
-
-void
-ffestt_caselist_append (ffesttCaseList list, bool range, ffebld case1,
- ffebld case2, ffelexToken t)
-{
- ffesttCaseList new;
-
- new = (ffesttCaseList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST case list", sizeof (*new));
- new->next = list->previous->next;
- new->previous = list->previous;
- new->next->previous = new;
- new->previous->next = new;
- new->expr1 = case1;
- new->expr2 = case2;
- new->range = range;
- new->t = t;
-}
-
-/* ffestt_caselist_create -- Create new list of cases
-
- ffesttCaseList list;
- list = ffestt_caselist_create();
-
- The list is allocated out of the scratch pool. */
-
-ffesttCaseList
-ffestt_caselist_create ()
-{
- ffesttCaseList new;
-
- new = (ffesttCaseList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST case list root",
- sizeof (*new));
- new->next = new->previous = new;
- new->t = NULL;
- new->expr1 = NULL;
- new->expr2 = NULL;
- new->range = FALSE;
- return new;
-}
-
-/* ffestt_caselist_dump -- Dump list of cases
-
- ffesttCaseList list;
- ffestt_caselist_dump(list);
-
- The cases in the list are dumped with commas separating them. */
-
-void
-ffestt_caselist_dump (ffesttCaseList list)
-{
- ffesttCaseList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- if (next != list->next)
- fputc (',', dmpout);
- if (next->expr1 != NULL)
- ffebld_dump (next->expr1);
- if (next->range)
- {
- fputc (':', dmpout);
- if (next->expr2 != NULL)
- ffebld_dump (next->expr2);
- }
- }
-}
-
-/* ffestt_caselist_kill -- Kill list of cases
-
- ffesttCaseList list;
- ffestt_caselist_kill(list);
-
- The tokens on the list are killed.
-
- 02-Mar-90 JCB 1.1
- Don't kill the list itself or change it, since it will be trashed when
- ffesta_scratch_pool is killed anyway, so kill only the lex tokens. */
-
-void
-ffestt_caselist_kill (ffesttCaseList list)
-{
- ffesttCaseList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- ffelex_token_kill (next->t);
- }
-}
-
-/* ffestt_dimlist_append -- Append dim to list of dims
-
- ffesttDimList list;
- ffelexToken t;
- ffestt_dimlist_append(list,lower,upper,t);
-
- list must have already been created by ffestt_dimlist_create. The
- list is allocated out of the scratch pool. The token is consumed. */
-
-void
-ffestt_dimlist_append (ffesttDimList list, ffebld lower, ffebld upper,
- ffelexToken t)
-{
- ffesttDimList new;
-
- new = (ffesttDimList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST dim list", sizeof (*new));
- new->next = list->previous->next;
- new->previous = list->previous;
- new->next->previous = new;
- new->previous->next = new;
- new->lower = lower;
- new->upper = upper;
- new->t = t;
-}
-
-/* Convert list of dims into ffebld format.
-
- ffesttDimList list;
- ffeinfoRank rank;
- ffebld array_size;
- ffebld extents;
- ffestt_dimlist_as_expr (list, &rank, &array_size, &extents);
-
- The dims in the list are converted to a list of ITEMs; the rank of the
- array, an expression representing the array size, a list of extent
- expressions, and the list of ITEMs are returned.
-
- If is_ugly_assumed, treat a final dimension with no lower bound
- and an upper bound of 1 as a * bound. */
-
-ffebld
-ffestt_dimlist_as_expr (ffesttDimList list, ffeinfoRank *rank,
- ffebld *array_size, ffebld *extents,
- bool is_ugly_assumed)
-{
- ffesttDimList next;
- ffebld expr;
- ffebld as;
- ffebld ex; /* List of extents. */
- ffebld ext; /* Extent of a given dimension. */
- ffebldListBottom bottom;
- ffeinfoRank r;
- ffeinfoKindtype nkt;
- ffetargetIntegerDefault low;
- ffetargetIntegerDefault high;
- bool zero = FALSE; /* Zero-size array. */
- bool any = FALSE;
- bool star = FALSE; /* Adjustable array. */
-
- assert (list != NULL);
-
- r = 0;
- ffebld_init_list (&expr, &bottom);
- for (next = list->next; next != list; next = next->next)
- {
- ++r;
- if (((next->lower == NULL)
- || (ffebld_op (next->lower) == FFEBLD_opCONTER))
- && (ffebld_op (next->upper) == FFEBLD_opCONTER))
- {
- if (next->lower == NULL)
- low = 1;
- else
- low = ffebld_constant_integerdefault (ffebld_conter (next->lower));
- high = ffebld_constant_integerdefault (ffebld_conter (next->upper));
- if (low
- > high)
- zero = TRUE;
- if ((next->next == list)
- && is_ugly_assumed
- && (next->lower == NULL)
- && (high == 1)
- && (ffebld_conter_orig (next->upper) == NULL))
- {
- star = TRUE;
- ffebld_append_item (&bottom,
- ffebld_new_bounds (NULL, ffebld_new_star ()));
- continue;
- }
- }
- else if (((next->lower != NULL)
- && (ffebld_op (next->lower) == FFEBLD_opANY))
- || (ffebld_op (next->upper) == FFEBLD_opANY))
- any = TRUE;
- else if (ffebld_op (next->upper) == FFEBLD_opSTAR)
- star = TRUE;
- ffebld_append_item (&bottom,
- ffebld_new_bounds (next->lower, next->upper));
- }
- ffebld_end_list (&bottom);
-
- if (zero)
- {
- as = ffebld_new_conter (ffebld_constant_new_integerdefault_val (0));
- ffebld_set_info (as, ffeinfo_new
- (FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT,
- 0,
- FFEINFO_kindENTITY,
- FFEINFO_whereCONSTANT,
- FFETARGET_charactersizeNONE));
- ex = NULL;
- }
- else if (any)
- {
- as = ffebld_new_any ();
- ffebld_set_info (as, ffeinfo_new_any ());
- ex = ffebld_copy (as);
- }
- else if (star)
- {
- as = ffebld_new_star ();
- ex = ffebld_new_star (); /* ~~Should really be list as below. */
- }
- else
- {
- as = NULL;
- ffebld_init_list (&ex, &bottom);
- for (next = list->next; next != list; next = next->next)
- {
- if ((next->lower == NULL)
- || ((ffebld_op (next->lower) == FFEBLD_opCONTER)
- && (ffebld_constant_integerdefault (ffebld_conter
- (next->lower)) == 1)))
- ext = ffebld_copy (next->upper);
- else
- {
- ext = ffebld_new_subtract (next->upper, next->lower);
- nkt
- = ffeinfo_kindtype_max (FFEINFO_basictypeINTEGER,
- ffeinfo_kindtype (ffebld_info
- (next->lower)),
- ffeinfo_kindtype (ffebld_info
- (next->upper)));
- ffebld_set_info (ext,
- ffeinfo_new (FFEINFO_basictypeINTEGER,
- nkt,
- 0,
- FFEINFO_kindENTITY,
- ((ffebld_op (ffebld_left (ext))
- == FFEBLD_opCONTER)
- && (ffebld_op (ffebld_right
- (ext))
- == FFEBLD_opCONTER))
- ? FFEINFO_whereCONSTANT
- : FFEINFO_whereFLEETING,
- FFETARGET_charactersizeNONE));
- ffebld_set_left (ext,
- ffeexpr_convert_expr (ffebld_left (ext),
- next->t, ext, next->t,
- FFEEXPR_contextLET));
- ffebld_set_right (ext,
- ffeexpr_convert_expr (ffebld_right (ext),
- next->t, ext,
- next->t,
- FFEEXPR_contextLET));
- ext = ffeexpr_collapse_subtract (ext, next->t);
-
- nkt
- = ffeinfo_kindtype_max (FFEINFO_basictypeINTEGER,
- ffeinfo_kindtype (ffebld_info (ext)),
- FFEINFO_kindtypeINTEGERDEFAULT);
- ext
- = ffebld_new_add (ext,
- ffebld_new_conter
- (ffebld_constant_new_integerdefault_val
- (1)));
- ffebld_set_info (ffebld_right (ext), ffeinfo_new
- (FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT,
- 0,
- FFEINFO_kindENTITY,
- FFEINFO_whereCONSTANT,
- FFETARGET_charactersizeNONE));
- ffebld_set_info (ext,
- ffeinfo_new (FFEINFO_basictypeINTEGER,
- nkt, 0, FFEINFO_kindENTITY,
- (ffebld_op (ffebld_left (ext))
- == FFEBLD_opCONTER)
- ? FFEINFO_whereCONSTANT
- : FFEINFO_whereFLEETING,
- FFETARGET_charactersizeNONE));
- ffebld_set_left (ext,
- ffeexpr_convert_expr (ffebld_left (ext),
- next->t, ext,
- next->t,
- FFEEXPR_contextLET));
- ffebld_set_right (ext,
- ffeexpr_convert_expr (ffebld_right (ext),
- next->t, ext,
- next->t,
- FFEEXPR_contextLET));
- ext = ffeexpr_collapse_add (ext, next->t);
- }
- ffebld_append_item (&bottom, ext);
- if (as == NULL)
- as = ext;
- else
- {
- nkt
- = ffeinfo_kindtype_max (FFEINFO_basictypeINTEGER,
- ffeinfo_kindtype (ffebld_info (as)),
- ffeinfo_kindtype (ffebld_info (ext)));
- as = ffebld_new_multiply (as, ext);
- ffebld_set_info (as,
- ffeinfo_new (FFEINFO_basictypeINTEGER,
- nkt, 0, FFEINFO_kindENTITY,
- ((ffebld_op (ffebld_left (as))
- == FFEBLD_opCONTER)
- && (ffebld_op (ffebld_right
- (as))
- == FFEBLD_opCONTER))
- ? FFEINFO_whereCONSTANT
- : FFEINFO_whereFLEETING,
- FFETARGET_charactersizeNONE));
- ffebld_set_left (as,
- ffeexpr_convert_expr (ffebld_left (as),
- next->t, as, next->t,
- FFEEXPR_contextLET));
- ffebld_set_right (as,
- ffeexpr_convert_expr (ffebld_right (as),
- next->t, as,
- next->t,
- FFEEXPR_contextLET));
- as = ffeexpr_collapse_multiply (as, next->t);
- }
- }
- ffebld_end_list (&bottom);
- as = ffeexpr_convert (as, list->next->t, NULL,
- FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT, 0,
- FFETARGET_charactersizeNONE,
- FFEEXPR_contextLET);
- }
-
- *rank = r;
- *array_size = as;
- *extents = ex;
- return expr;
-}
-
-/* ffestt_dimlist_create -- Create new list of dims
-
- ffesttDimList list;
- list = ffestt_dimlist_create();
-
- The list is allocated out of the scratch pool. */
-
-ffesttDimList
-ffestt_dimlist_create ()
-{
- ffesttDimList new;
-
- new = (ffesttDimList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST dim list root", sizeof (*new));
- new->next = new->previous = new;
- new->t = NULL;
- new->lower = NULL;
- new->upper = NULL;
- return new;
-}
-
-/* ffestt_dimlist_dump -- Dump list of dims
-
- ffesttDimList list;
- ffestt_dimlist_dump(list);
-
- The dims in the list are dumped with commas separating them. */
-
-void
-ffestt_dimlist_dump (ffesttDimList list)
-{
- ffesttDimList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- if (next != list->next)
- fputc (',', dmpout);
- if (next->lower != NULL)
- ffebld_dump (next->lower);
- fputc (':', dmpout);
- if (next->upper != NULL)
- ffebld_dump (next->upper);
- }
-}
-
-/* ffestt_dimlist_kill -- Kill list of dims
-
- ffesttDimList list;
- ffestt_dimlist_kill(list);
-
- The tokens on the list are killed. */
-
-void
-ffestt_dimlist_kill (ffesttDimList list)
-{
- ffesttDimList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- ffelex_token_kill (next->t);
- }
-}
-
-/* Determine type of list of dimensions.
-
- Return KNOWN for all-constant bounds, ADJUSTABLE for constant
- and variable but no * bounds, ASSUMED for constant and * but
- not variable bounds, ADJUSTABLEASSUMED for constant and variable
- and * bounds.
-
- If is_ugly_assumed, treat a final dimension with no lower bound
- and an upper bound of 1 as a * bound. */
-
-ffestpDimtype
-ffestt_dimlist_type (ffesttDimList list, bool is_ugly_assumed)
-{
- ffesttDimList next;
- ffestpDimtype type;
-
- if (list == NULL)
- return FFESTP_dimtypeNONE;
-
- type = FFESTP_dimtypeKNOWN;
- for (next = list->next; next != list; next = next->next)
- {
- bool ugly_assumed = FALSE;
-
- if ((next->next == list)
- && is_ugly_assumed
- && (next->lower == NULL)
- && (next->upper != NULL)
- && (ffebld_op (next->upper) == FFEBLD_opCONTER)
- && (ffebld_constant_integerdefault (ffebld_conter (next->upper))
- == 1)
- && (ffebld_conter_orig (next->upper) == NULL))
- ugly_assumed = TRUE;
-
- if (next->lower != NULL)
- {
- if (ffebld_op (next->lower) != FFEBLD_opCONTER)
- {
- if (type == FFESTP_dimtypeASSUMED)
- type = FFESTP_dimtypeADJUSTABLEASSUMED;
- else
- type = FFESTP_dimtypeADJUSTABLE;
- }
- }
- if (next->upper != NULL)
- {
- if (ugly_assumed
- || (ffebld_op (next->upper) == FFEBLD_opSTAR))
- {
- if (type == FFESTP_dimtypeADJUSTABLE)
- type = FFESTP_dimtypeADJUSTABLEASSUMED;
- else
- type = FFESTP_dimtypeASSUMED;
- }
- else if (ffebld_op (next->upper) != FFEBLD_opCONTER)
- type = FFESTP_dimtypeADJUSTABLE;
- }
- }
-
- return type;
-}
-
-/* ffestt_exprlist_append -- Append expr to list of exprs
-
- ffesttExprList list;
- ffelexToken t;
- ffestt_exprlist_append(list,expr,t);
-
- list must have already been created by ffestt_exprlist_create. The
- list is allocated out of the scratch pool. The token is consumed. */
-
-void
-ffestt_exprlist_append (ffesttExprList list, ffebld expr, ffelexToken t)
-{
- ffesttExprList new;
-
- new = (ffesttExprList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST expr list", sizeof (*new));
- new->next = list->previous->next;
- new->previous = list->previous;
- new->next->previous = new;
- new->previous->next = new;
- new->expr = expr;
- new->t = t;
-}
-
-/* ffestt_exprlist_create -- Create new list of exprs
-
- ffesttExprList list;
- list = ffestt_exprlist_create();
-
- The list is allocated out of the scratch pool. */
-
-ffesttExprList
-ffestt_exprlist_create ()
-{
- ffesttExprList new;
-
- new = (ffesttExprList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST expr list root", sizeof (*new));
- new->next = new->previous = new;
- new->expr = NULL;
- new->t = NULL;
- return new;
-}
-
-/* ffestt_exprlist_drive -- Drive list of token pairs into function
-
- ffesttExprList list;
- void fn(ffebld expr,ffelexToken t);
- ffestt_exprlist_drive(list,fn);
-
- The expr/token pairs in the list are passed to the function one pair
- at a time. */
-
-void
-ffestt_exprlist_drive (ffesttExprList list, void (*fn) ())
-{
- ffesttExprList next;
-
- if (list == NULL)
- return;
-
- for (next = list->next; next != list; next = next->next)
- {
- (*fn) (next->expr, next->t);
- }
-}
-
-/* ffestt_exprlist_dump -- Dump list of exprs
-
- ffesttExprList list;
- ffestt_exprlist_dump(list);
-
- The exprs in the list are dumped with commas separating them. */
-
-void
-ffestt_exprlist_dump (ffesttExprList list)
-{
- ffesttExprList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- if (next != list->next)
- fputc (',', dmpout);
- ffebld_dump (next->expr);
- }
-}
-
-/* ffestt_exprlist_kill -- Kill list of exprs
-
- ffesttExprList list;
- ffestt_exprlist_kill(list);
-
- The tokens on the list are killed.
-
- 02-Mar-90 JCB 1.1
- Don't kill the list itself or change it, since it will be trashed when
- ffesta_scratch_pool is killed anyway, so kill only the lex tokens. */
-
-void
-ffestt_exprlist_kill (ffesttExprList list)
-{
- ffesttExprList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- ffelex_token_kill (next->t);
- }
-}
-
-/* ffestt_formatlist_append -- Append null format to list of formats
-
- ffesttFormatList list, new;
- new = ffestt_formatlist_append(list);
-
- list must have already been created by ffestt_formatlist_create. The
- new item is allocated out of the scratch pool. The caller must initialize
- it appropriately. */
-
-ffesttFormatList
-ffestt_formatlist_append (ffesttFormatList list)
-{
- ffesttFormatList new;
-
- new = (ffesttFormatList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST format list", sizeof (*new));
- new->next = list->previous->next;
- new->previous = list->previous;
- new->next->previous = new;
- new->previous->next = new;
- return new;
-}
-
-/* ffestt_formatlist_create -- Create new list of formats
-
- ffesttFormatList list;
- list = ffestt_formatlist_create(NULL);
-
- The list is allocated out of the scratch pool. */
-
-ffesttFormatList
-ffestt_formatlist_create (ffesttFormatList parent, ffelexToken t)
-{
- ffesttFormatList new;
-
- new = (ffesttFormatList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST format list root", sizeof (*new));
- new->next = new->previous = new;
- new->type = FFESTP_formattypeNone;
- new->t = t;
- new->u.root.parent = parent;
- return new;
-}
-
-/* ffestt_formatlist_kill -- Kill tokens on list of formats
-
- ffesttFormatList list;
- ffestt_formatlist_kill(list);
-
- The tokens on the list are killed. */
-
-void
-ffestt_formatlist_kill (ffesttFormatList list)
-{
- ffesttFormatList next;
-
- /* Always kill from the very top on down. */
-
- while (list->u.root.parent != NULL)
- list = list->u.root.parent->next;
-
- /* Kill first token for this list. */
-
- if (list->t != NULL)
- ffelex_token_kill (list->t);
-
- /* Kill each item in this list. */
-
- for (next = list->next; next != list; next = next->next)
- {
- ffelex_token_kill (next->t);
- switch (next->type)
- {
- case FFESTP_formattypeI:
- case FFESTP_formattypeB:
- case FFESTP_formattypeO:
- case FFESTP_formattypeZ:
- case FFESTP_formattypeF:
- case FFESTP_formattypeE:
- case FFESTP_formattypeEN:
- case FFESTP_formattypeG:
- case FFESTP_formattypeL:
- case FFESTP_formattypeA:
- case FFESTP_formattypeD:
- if (next->u.R1005.R1004.t != NULL)
- ffelex_token_kill (next->u.R1005.R1004.t);
- if (next->u.R1005.R1006.t != NULL)
- ffelex_token_kill (next->u.R1005.R1006.t);
- if (next->u.R1005.R1007_or_R1008.t != NULL)
- ffelex_token_kill (next->u.R1005.R1007_or_R1008.t);
- if (next->u.R1005.R1009.t != NULL)
- ffelex_token_kill (next->u.R1005.R1009.t);
- break;
-
- case FFESTP_formattypeQ:
- case FFESTP_formattypeDOLLAR:
- case FFESTP_formattypeP:
- case FFESTP_formattypeT:
- case FFESTP_formattypeTL:
- case FFESTP_formattypeTR:
- case FFESTP_formattypeX:
- case FFESTP_formattypeS:
- case FFESTP_formattypeSP:
- case FFESTP_formattypeSS:
- case FFESTP_formattypeBN:
- case FFESTP_formattypeBZ:
- case FFESTP_formattypeSLASH:
- case FFESTP_formattypeCOLON:
- if (next->u.R1010.val.t != NULL)
- ffelex_token_kill (next->u.R1010.val.t);
- break;
-
- case FFESTP_formattypeR1016:
- break; /* Nothing more to do. */
-
- case FFESTP_formattypeFORMAT:
- if (next->u.R1003D.R1004.t != NULL)
- ffelex_token_kill (next->u.R1003D.R1004.t);
- next->u.R1003D.format->u.root.parent = NULL; /* Parent already dying. */
- ffestt_formatlist_kill (next->u.R1003D.format);
- break;
-
- default:
- assert (FALSE);
- }
- }
-}
-
-/* ffestt_implist_append -- Append token pair to list of token pairs
-
- ffesttImpList list;
- ffelexToken t;
- ffestt_implist_append(list,start_token,end_token);
-
- list must have already been created by ffestt_implist_create. The
- list is allocated out of the scratch pool. The tokens are consumed. */
-
-void
-ffestt_implist_append (ffesttImpList list, ffelexToken first, ffelexToken last)
-{
- ffesttImpList new;
-
- new = (ffesttImpList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token list", sizeof (*new));
- new->next = list->previous->next;
- new->previous = list->previous;
- new->next->previous = new;
- new->previous->next = new;
- new->first = first;
- new->last = last;
-}
-
-/* ffestt_implist_create -- Create new list of token pairs
-
- ffesttImpList list;
- list = ffestt_implist_create();
-
- The list is allocated out of the scratch pool. */
-
-ffesttImpList
-ffestt_implist_create ()
-{
- ffesttImpList new;
-
- new = (ffesttImpList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token list root",
- sizeof (*new));
- new->next = new->previous = new;
- new->first = NULL;
- new->last = NULL;
- return new;
-}
-
-/* ffestt_implist_drive -- Drive list of token pairs into function
-
- ffesttImpList list;
- void fn(ffelexToken first,ffelexToken last);
- ffestt_implist_drive(list,fn);
-
- The token pairs in the list are passed to the function one pair at a time. */
-
-void
-ffestt_implist_drive (ffesttImpList list, void (*fn) ())
-{
- ffesttImpList next;
-
- if (list == NULL)
- return;
-
- for (next = list->next; next != list; next = next->next)
- {
- (*fn) (next->first, next->last);
- }
-}
-
-/* ffestt_implist_dump -- Dump list of token pairs
-
- ffesttImpList list;
- ffestt_implist_dump(list);
-
- The token pairs in the list are dumped with commas separating them. */
-
-void
-ffestt_implist_dump (ffesttImpList list)
-{
- ffesttImpList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- if (next != list->next)
- fputc (',', dmpout);
- assert (ffelex_token_type (next->first) == FFELEX_typeNAME);
- fputs (ffelex_token_text (next->first), dmpout);
- if (next->last != NULL)
- {
- fputc ('-', dmpout);
- assert (ffelex_token_type (next->last) == FFELEX_typeNAME);
- fputs (ffelex_token_text (next->last), dmpout);
- }
- }
-}
-
-/* ffestt_implist_kill -- Kill list of token pairs
-
- ffesttImpList list;
- ffestt_implist_kill(list);
-
- The tokens on the list are killed. */
-
-void
-ffestt_implist_kill (ffesttImpList list)
-{
- ffesttImpList next;
-
- for (next = list->next; next != list; next = next->next)
- {
- ffelex_token_kill (next->first);
- if (next->last != NULL)
- ffelex_token_kill (next->last);
- }
-}
-
-/* ffestt_tokenlist_append -- Append token to list of tokens
-
- ffesttTokenList tl;
- ffelexToken t;
- ffestt_tokenlist_append(tl,t);
-
- tl must have already been created by ffestt_tokenlist_create. The
- list is allocated out of the scratch pool. The token is consumed. */
-
-void
-ffestt_tokenlist_append (ffesttTokenList tl, ffelexToken t)
-{
- ffesttTokenItem ti;
-
- ti = (ffesttTokenItem) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token item", sizeof (*ti));
- ti->next = (ffesttTokenItem) &tl->first;
- ti->previous = tl->last;
- ti->next->previous = ti;
- ti->previous->next = ti;
- ti->t = t;
- ++tl->count;
-}
-
-/* ffestt_tokenlist_create -- Create new list of tokens
-
- ffesttTokenList tl;
- tl = ffestt_tokenlist_create();
-
- The list is allocated out of the scratch pool. */
-
-ffesttTokenList
-ffestt_tokenlist_create ()
-{
- ffesttTokenList tl;
-
- tl = (ffesttTokenList) malloc_new_kp (ffesta_scratch_pool,
- "FFEST token list", sizeof (*tl));
- tl->first = tl->last = (ffesttTokenItem) &tl->first;
- tl->count = 0;
- return tl;
-}
-
-/* ffestt_tokenlist_drive -- Dump list of tokens
-
- ffesttTokenList tl;
- void fn(ffelexToken t);
- ffestt_tokenlist_drive(tl,fn);
-
- The tokens in the list are passed to the given function. */
-
-void
-ffestt_tokenlist_drive (ffesttTokenList tl, void (*fn) ())
-{
- ffesttTokenItem ti;
-
- if (tl == NULL)
- return;
-
- for (ti = tl->first; ti != (ffesttTokenItem) &tl->first; ti = ti->next)
- {
- (*fn) (ti->t);
- }
-}
-
-/* ffestt_tokenlist_dump -- Dump list of tokens
-
- ffesttTokenList tl;
- ffestt_tokenlist_dump(tl);
-
- The tokens in the list are dumped with commas separating them. */
-
-void
-ffestt_tokenlist_dump (ffesttTokenList tl)
-{
- ffesttTokenItem ti;
-
- for (ti = tl->first; ti != (ffesttTokenItem) &tl->first; ti = ti->next)
- {
- if (ti != tl->first)
- fputc (',', dmpout);
- switch (ffelex_token_type (ti->t))
- {
- case FFELEX_typeNUMBER:
- case FFELEX_typeNAME:
- case FFELEX_typeNAMES:
- fputs (ffelex_token_text (ti->t), dmpout);
- break;
-
- case FFELEX_typeASTERISK:
- fputc ('*', dmpout);
- break;
-
- default:
- assert (FALSE);
- fputc ('?', dmpout);
- break;
- }
- }
-}
-
-/* ffestt_tokenlist_handle -- Handle list of tokens
-
- ffesttTokenList tl;
- ffelexHandler handler;
- handler = ffestt_tokenlist_handle(tl,handler);
-
- The tokens in the list are passed to the handler(s). */
-
-ffelexHandler
-ffestt_tokenlist_handle (ffesttTokenList tl, ffelexHandler handler)
-{
- ffesttTokenItem ti;
-
- for (ti = tl->first; ti != (ffesttTokenItem) &tl->first; ti = ti->next)
- handler = (ffelexHandler) (*handler) (ti->t);
-
- return (ffelexHandler) handler;
-}
-
-/* ffestt_tokenlist_kill -- Kill list of tokens
-
- ffesttTokenList tl;
- ffestt_tokenlist_kill(tl);
-
- The tokens on the list are killed.
-
- 02-Mar-90 JCB 1.1
- Don't kill the list itself or change it, since it will be trashed when
- ffesta_scratch_pool is killed anyway, so kill only the lex tokens. */
-
-void
-ffestt_tokenlist_kill (ffesttTokenList tl)
-{
- ffesttTokenItem ti;
-
- for (ti = tl->first; ti != (ffesttTokenItem) &tl->first; ti = ti->next)
- {
- ffelex_token_kill (ti->t);
- }
-}
+ Contributed by James Craig Burley (burley@gnu.org).
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+/* ffestt_tokenlist_drive -- Drive list of tokens
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
diff --git a/gcc/f/stt.h b/gcc/f/stt.h
index 827841ea983..e1aceb68b35 100644
--- a/gcc/f/stt.h
+++ b/gcc/f/stt.h
@@ -1,218 +1,13 @@
-/* stt.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stt.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stt
-#define _H_f_stt
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-typedef struct _ffest_case_list_ *ffesttCaseList;
-typedef struct _ffest_dim_list_ *ffesttDimList;
-typedef struct _ffest_expr_list_ *ffesttExprList;
-typedef struct _ffest_format_value_ ffesttFormatValue;
-typedef struct _ffest_format_list_ *ffesttFormatList;
-typedef struct _ffest_imp_list_ *ffesttImpList;
-typedef struct _ffest_token_item_ *ffesttTokenItem;
-typedef struct _ffest_token_list_ *ffesttTokenList;
-
-/* Include files needed by this one. */
-
-#include "top.h"
-#include "bld.h"
-#include "info.h"
-#include "lex.h"
-#include "stp.h"
-
-/* Structure definitions. */
-
-struct _ffest_case_list_
- {
- ffesttCaseList next;
- ffesttCaseList previous;
- ffelexToken t;
- ffebld expr1;
- ffebld expr2;
- bool range; /* TRUE if "[expr1]:[expr2]", FALSE if
- "expr1". */
- };
-
-struct _ffest_dim_list_
- {
- ffesttDimList next;
- ffesttDimList previous;
- ffelexToken t;
- ffebld lower;
- ffebld upper;
- };
-
-struct _ffest_expr_list_
- {
- ffesttExprList next;
- ffesttExprList previous;
- ffelexToken t;
- ffebld expr;
- };
-
-struct _ffest_token_item_
- {
- ffesttTokenItem next;
- ffesttTokenItem previous;
- ffelexToken t;
- };
-
-struct _ffest_token_list_
- {
- ffesttTokenItem first;
- ffesttTokenItem last;
- int count; /* Number of tokens in list. */
- };
-
-struct _ffest_format_value_
- {
- bool present; /* TRUE if value supplied (needed for
- optional values only). */
- bool rtexpr; /* FALSE if constant value here, TRUE if
- run-time expr (VXT). */
- ffelexToken t; /* The first token, or perhaps just prior if
- can't get it. */
- union
- {
- ffeUnionLongPtr unused; /* Make sure all the info gets copied. */
- long signed_val; /* for R1011. */
- unsigned long unsigned_val; /* For other constant values. */
- ffebld expr; /* For run-time expression (VXT). */
- }
- u;
- };
-
-struct _ffest_format_list_
- {
- ffesttFormatList next;
- ffesttFormatList previous;
- ffelexToken t; /* The NAME, CHARACTER, or HOLLERITH token. */
- ffestpFormatType type;
- union ffest_format_
- {
- struct
- {
- ffesttFormatValue R1004; /* r, the repeat count. */
- ffesttFormatValue R1006; /* w, the field width. */
- ffesttFormatValue R1007_or_R1008; /* m, the minimum number of
- digits; d, the number of
- decimal digits. */
- ffesttFormatValue R1009; /* e, the number of exponent digits. */
- }
- R1005; /* data-edit-desc. */
- struct
- {
- ffesttFormatValue val; /* r, the repeat count; k, the
- precision magnitude adjustment; n,
- the column number (abs or rel). */
- }
- R1010; /* control-edit-desc. */
- struct
- {
- ffesttFormatValue R1004; /* r, the repeat count. */
- ffesttFormatList format; /* the parenthesized
- format-item-list. */
- }
- R1003D; /* format-item of for [r](format-item-list). */
- struct
- {
- ffesttFormatList parent; /* NULL if outer list, else parent
- item. */
- }
- root; /* FFESTP_formattypeNone case. */
- }
- u;
- };
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-void ffestt_caselist_append (ffesttCaseList list, bool range, ffebld case1,
- ffebld case2, ffelexToken t);
-ffesttCaseList ffestt_caselist_create (void);
-void ffestt_caselist_dump (ffesttCaseList list);
-void ffestt_caselist_kill (ffesttCaseList list);
-void ffestt_dimlist_append (ffesttDimList list, ffebld lower, ffebld upper,
- ffelexToken t);
-ffebld ffestt_dimlist_as_expr (ffesttDimList list, ffeinfoRank *rank,
- ffebld *array_size, ffebld *extents,
- bool is_ugly_assumed);
-ffesttDimList ffestt_dimlist_create (void);
-void ffestt_dimlist_dump (ffesttDimList list);
-void ffestt_dimlist_kill (ffesttDimList list);
-ffestpDimtype ffestt_dimlist_type (ffesttDimList dims, bool is_ugly_assumed);
-void ffestt_exprlist_append (ffesttExprList list, ffebld expr, ffelexToken t);
-ffesttExprList ffestt_exprlist_create (void);
-void ffestt_exprlist_drive (ffesttExprList list, void (*fn) ());
-void ffestt_exprlist_dump (ffesttExprList list);
-void ffestt_exprlist_kill (ffesttExprList list);
-ffesttFormatList ffestt_formatlist_append (ffesttFormatList list);
-ffesttFormatList ffestt_formatlist_create (ffesttFormatList parent,
- ffelexToken t);
-void ffestt_formatlist_dump (ffesttFormatList list);
-void ffestt_formatlist_kill (ffesttFormatList list);
-void ffestt_implist_append (ffesttImpList list, ffelexToken first,
- ffelexToken last);
-ffesttImpList ffestt_implist_create (void);
-void ffestt_implist_drive (ffesttImpList list, void (*fn) ());
-void ffestt_implist_dump (ffesttImpList list);
-void ffestt_implist_kill (ffesttImpList list);
-void ffestt_tokenlist_append (ffesttTokenList list, ffelexToken t);
-ffesttTokenList ffestt_tokenlist_create (void);
-void ffestt_tokenlist_drive (ffesttTokenList list, void (*fn) ());
-void ffestt_tokenlist_dump (ffesttTokenList list);
-ffelexHandler ffestt_tokenlist_handle (ffesttTokenList list,
- ffelexHandler handler);
-void ffestt_tokenlist_kill (ffesttTokenList list);
-
-/* Define macros. */
-
-#define ffestt_init_0()
-#define ffestt_init_1()
-#define ffestt_init_2()
-#define ffestt_init_3()
-#define ffestt_init_4()
-#define ffestt_terminate_0()
-#define ffestt_terminate_1()
-#define ffestt_terminate_2()
-#define ffestt_terminate_3()
-#define ffestt_terminate_4()
-#define ffestt_tokenlist_count(tl) ((tl)->count)
-
-/* End of #include file. */
-
+ Contributed by James Craig Burley (burley@gnu.org).
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
+#endif
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
diff --git a/gcc/f/stu.c b/gcc/f/stu.c
index a11f00c9cd2..7dcbdcbb67b 100644
--- a/gcc/f/stu.c
+++ b/gcc/f/stu.c
@@ -1,6 +1,6 @@
/* stu.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
diff --git a/gcc/f/stu.h b/gcc/f/stu.h
index 1b1718c048f..5bf37928672 100644
--- a/gcc/f/stu.h
+++ b/gcc/f/stu.h
@@ -1,69 +1 @@
-/* stu.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stu.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stu
-#define _H_f_stu
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "symbol.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-
-/* Declare functions with prototypes. */
-
-ffesymbol ffestu_sym_end_transition (ffesymbol s);
-ffesymbol ffestu_sym_exec_transition (ffesymbol s);
-
-/* Define macros. */
-
-#define ffestu_init_0()
-#define ffestu_init_1()
-#define ffestu_init_2()
-#define ffestu_init_3()
-#define ffestu_init_4()
-#define ffestu_terminate_0()
-#define ffestu_terminate_1()
-#define ffestu_terminate_2()
-#define ffestu_terminate_3()
-#define ffestu_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stv.c b/gcc/f/stv.c
index bd62e699865..5bf37928672 100644
--- a/gcc/f/stv.c
+++ b/gcc/f/stv.c
@@ -1,66 +1 @@
-/* stv.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None (despite the name, it doesn't really depend on ffest*)
-
- Description:
- Various and sundry info.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "stv.h"
-#include "lab.h"
-#include "where.h"
-
-/* Externals defined here. */
-
-ffestvSavestate ffestv_save_state_;
-ffewhereLine ffestv_save_line_;
-ffewhereColumn ffestv_save_col_;
-ffestvAccessstate ffestv_access_state_;
-ffewhereLine ffestv_access_line_;
-ffewhereColumn ffestv_access_col_;
-ffelabNumber ffestv_num_label_defines_;
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stv.h b/gcc/f/stv.h
index 6cd9299aaf2..5bf37928672 100644
--- a/gcc/f/stv.h
+++ b/gcc/f/stv.h
@@ -1,165 +1 @@
-/* stv.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stv.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stv
-#define _H_f_stv
-
-/* Simple definitions and enumerations. */
-
-typedef enum
- {
- FFESTV_accessstateNONE, /* Haven't seen PUBLIC or PRIVATE yet. */
- FFESTV_accessstatePUBLIC, /* Seen PUBLIC stmt w/o args. */
- FFESTV_accessstatePRIVATE, /* Seen PRIVATE stmt w/o args. */
- FFESTV_accessstateANY, /* Conflict seen and reported, so stop
- whining. */
- FFESTV_accessstate
- } ffestvAccessstate;
-
-typedef enum
- { /* Format specifier in an I/O statement. */
- FFESTV_formatNONE, /* None. */
- FFESTV_formatLABEL, /* Label (normal format). */
- FFESTV_formatCHAREXPR, /* Character expression (normal format). */
- FFESTV_formatASTERISK, /* Asterisk (list-directed). */
- FFESTV_formatINTEXPR, /* Integer expression (assigned label). */
- FFESTV_formatNAMELIST, /* Namelist (namelist-directed). */
- FFESTV_format
- } ffestvFormat;
-
-typedef enum
- {
- FFESTV_savestateNONE, /* Haven't seen SAVE stmt or attribute yet. */
- FFESTV_savestateSPECIFIC, /* Seen SAVE stmt w/args or SAVE attr. */
- FFESTV_savestateALL, /* Seen SAVE stmt w/o args. */
- FFESTV_savestateANY, /* Conflict seen and reported, so stop
- whining. */
- FFESTV_savestate
- } ffestvSavestate;
-
-typedef enum
- {
- FFESTV_stateNIL, /* Initial state, and after end of outer prog
- unit. */
- FFESTV_statePROGRAM0, /* After PROGRAM. */
- FFESTV_statePROGRAM1, /* Before first non-USE statement. */
- FFESTV_statePROGRAM2, /* After IMPLICIT NONE. */
- FFESTV_statePROGRAM3, /* After IMPLICIT, PARAMETER, FORMAT. */
- FFESTV_statePROGRAM4, /* Before executable stmt or CONTAINS. */
- FFESTV_statePROGRAM5, /* After CONTAINS. */
- FFESTV_stateSUBROUTINE0, /* After SUBROUTINE. */
- FFESTV_stateSUBROUTINE1, /* Before first non-USE statement. */
- FFESTV_stateSUBROUTINE2, /* After IMPLICIT NONE. */
- FFESTV_stateSUBROUTINE3, /* After IMPLICIT, PARAMETER, FORMAT, ENTRY. */
- FFESTV_stateSUBROUTINE4, /* Before executable stmt or CONTAINS. */
- FFESTV_stateSUBROUTINE5, /* After CONTAINS. */
- FFESTV_stateFUNCTION0, /* After FUNCTION. */
- FFESTV_stateFUNCTION1, /* Before first non-USE statement. */
- FFESTV_stateFUNCTION2, /* After IMPLICIT NONE. */
- FFESTV_stateFUNCTION3, /* After IMPLICIT, PARAMETER, FORMAT, ENTRY. */
- FFESTV_stateFUNCTION4, /* Before executable stmt or CONTAINS. */
- FFESTV_stateFUNCTION5, /* After CONTAINS. */
- FFESTV_stateMODULE0, /* After MODULE. */
- FFESTV_stateMODULE1, /* Before first non-USE statement. */
- FFESTV_stateMODULE2, /* After IMPLICIT NONE. */
- FFESTV_stateMODULE3, /* After IMPLICIT, PARAMETER, FORMAT, ENTRY. */
- FFESTV_stateMODULE4, /* Before executable stmt or CONTAINS. */
- FFESTV_stateMODULE5, /* After CONTAINS. */
- FFESTV_stateBLOCKDATA0, /* After BLOCKDATA. */
- FFESTV_stateBLOCKDATA1, /* Before first non-USE statement. */
- FFESTV_stateBLOCKDATA2, /* After IMPLICIT NONE. */
- FFESTV_stateBLOCKDATA3, /* After IMPLICIT, PARAMETER, FORMAT, ENTRY. */
- FFESTV_stateBLOCKDATA4, /* Before executable stmt or CONTAINS. */
- FFESTV_stateBLOCKDATA5, /* After CONTAINS. */
- FFESTV_stateUSE, /* Before first USE thru last USE. */
- FFESTV_stateTYPE, /* After TYPE thru END TYPE. */
- FFESTV_stateINTERFACE0, /* After INTERFACE thru MODULE PROCEDURE. */
- FFESTV_stateINTERFACE1, /* After MODULE PROCEDURE thru END INTERFACE. */
- FFESTV_stateSTRUCTURE, /* After STRUCTURE thru END STRUCTURE. */
- FFESTV_stateUNION, /* After UNION thru END UNION. */
- FFESTV_stateMAP, /* After MAP thru END MAP. */
- FFESTV_stateWHERETHEN, /* After WHERE-construct thru END WHERE. */
- FFESTV_stateWHERE, /* After WHERE-stmt thru next stmt. */
- FFESTV_stateIFTHEN, /* After IF THEN thru END IF. */
- FFESTV_stateIF, /* After IF thru next stmt. */
- FFESTV_stateDO, /* After DO thru END DO or terminating label. */
- FFESTV_stateSELECT0, /* After SELECT to before first CASE. */
- FFESTV_stateSELECT1, /* First CASE in SELECT thru END SELECT. */
- FFESTV_state
- } ffestvState;
-
-typedef enum
- { /* Unit specifier. */
- FFESTV_unitNONE, /* None. */
- FFESTV_unitINTEXPR, /* Integer expression (external file unit). */
- FFESTV_unitASTERISK, /* Default unit. */
- FFESTV_unitCHAREXPR, /* Character expression (internal file unit). */
- FFESTV_unit
- } ffestvUnit;
-
-/* Typedefs. */
-
-
-/* Include files needed by this one. */
-
-#include "lab.h"
-#include "where.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-extern ffestvSavestate ffestv_save_state_;
-extern ffewhereLine ffestv_save_line_;
-extern ffewhereColumn ffestv_save_col_;
-extern ffestvAccessstate ffestv_access_state_;
-extern ffewhereLine ffestv_access_line_;
-extern ffewhereColumn ffestv_access_col_;
-extern ffelabNumber ffestv_num_label_defines_;
-
-/* Declare functions with prototypes. */
-
-
-/* Define macros. */
-
-#define ffestv_init_0()
-#define ffestv_init_1()
-#define ffestv_init_2()
-#define ffestv_init_3()
-#define ffestv_init_4()
-#define ffestv_terminate_0()
-#define ffestv_terminate_1()
-#define ffestv_terminate_2()
-#define ffestv_terminate_3()
-#define ffestv_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stw.c b/gcc/f/stw.c
index 70d8803dcb0..5bf37928672 100644
--- a/gcc/f/stw.c
+++ b/gcc/f/stw.c
@@ -1,428 +1 @@
-/* stw.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None (despite the name, it doesn't really depend on ffest*)
-
- Description:
- Provides abstraction and stack mechanism to track the block structure
- of a Fortran program.
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "stw.h"
-#include "bld.h"
-#include "com.h"
-#include "info.h"
-#include "lab.h"
-#include "lex.h"
-#include "malloc.h"
-#include "sta.h"
-#include "stv.h"
-#include "symbol.h"
-#include "where.h"
-
-/* Externals defined here. */
-
-ffestw ffestw_stack_top_ = NULL;
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-
-/* Static objects accessed by functions in this module. */
-
-
-/* Static functions (internal). */
-
-
-/* Internal macros. */
-
-
-/* ffestw_display_state -- DEBUGGING; display current block state
-
- ffestw_display_state(); */
-
-void
-ffestw_display_state ()
-{
- assert (ffestw_stack_top_ != NULL);
-
- if (!ffe_is_ffedebug ())
- return;
-
- fprintf (dmpout, "; block %lu, state ", ffestw_stack_top_->blocknum_);
- switch (ffestw_stack_top_->state_)
- {
- case FFESTV_stateNIL:
- fputs ("NIL", dmpout);
- break;
-
- case FFESTV_statePROGRAM0:
- fputs ("PROGRAM0", dmpout);
- break;
-
- case FFESTV_statePROGRAM1:
- fputs ("PROGRAM1", dmpout);
- break;
-
- case FFESTV_statePROGRAM2:
- fputs ("PROGRAM2", dmpout);
- break;
-
- case FFESTV_statePROGRAM3:
- fputs ("PROGRAM3", dmpout);
- break;
-
- case FFESTV_statePROGRAM4:
- fputs ("PROGRAM4", dmpout);
- break;
-
- case FFESTV_statePROGRAM5:
- fputs ("PROGRAM5", dmpout);
- break;
-
- case FFESTV_stateSUBROUTINE0:
- fputs ("SUBROUTINE0", dmpout);
- break;
-
- case FFESTV_stateSUBROUTINE1:
- fputs ("SUBROUTINE1", dmpout);
- break;
-
- case FFESTV_stateSUBROUTINE2:
- fputs ("SUBROUTINE2", dmpout);
- break;
-
- case FFESTV_stateSUBROUTINE3:
- fputs ("SUBROUTINE3", dmpout);
- break;
-
- case FFESTV_stateSUBROUTINE4:
- fputs ("SUBROUTINE4", dmpout);
- break;
-
- case FFESTV_stateSUBROUTINE5:
- fputs ("SUBROUTINE5", dmpout);
- break;
-
- case FFESTV_stateFUNCTION0:
- fputs ("FUNCTION0", dmpout);
- break;
-
- case FFESTV_stateFUNCTION1:
- fputs ("FUNCTION1", dmpout);
- break;
-
- case FFESTV_stateFUNCTION2:
- fputs ("FUNCTION2", dmpout);
- break;
-
- case FFESTV_stateFUNCTION3:
- fputs ("FUNCTION3", dmpout);
- break;
-
- case FFESTV_stateFUNCTION4:
- fputs ("FUNCTION4", dmpout);
- break;
-
- case FFESTV_stateFUNCTION5:
- fputs ("FUNCTION5", dmpout);
- break;
-
- case FFESTV_stateMODULE0:
- fputs ("MODULE0", dmpout);
- break;
-
- case FFESTV_stateMODULE1:
- fputs ("MODULE1", dmpout);
- break;
-
- case FFESTV_stateMODULE2:
- fputs ("MODULE2", dmpout);
- break;
-
- case FFESTV_stateMODULE3:
- fputs ("MODULE3", dmpout);
- break;
-
- case FFESTV_stateMODULE4:
- fputs ("MODULE4", dmpout);
- break;
-
- case FFESTV_stateMODULE5:
- fputs ("MODULE5", dmpout);
- break;
-
- case FFESTV_stateBLOCKDATA0:
- fputs ("BLOCKDATA0", dmpout);
- break;
-
- case FFESTV_stateBLOCKDATA1:
- fputs ("BLOCKDATA1", dmpout);
- break;
-
- case FFESTV_stateBLOCKDATA2:
- fputs ("BLOCKDATA2", dmpout);
- break;
-
- case FFESTV_stateBLOCKDATA3:
- fputs ("BLOCKDATA3", dmpout);
- break;
-
- case FFESTV_stateBLOCKDATA4:
- fputs ("BLOCKDATA4", dmpout);
- break;
-
- case FFESTV_stateBLOCKDATA5:
- fputs ("BLOCKDATA5", dmpout);
- break;
-
- case FFESTV_stateUSE:
- fputs ("USE", dmpout);
- break;
-
- case FFESTV_stateTYPE:
- fputs ("TYPE", dmpout);
- break;
-
- case FFESTV_stateINTERFACE0:
- fputs ("INTERFACE0", dmpout);
- break;
-
- case FFESTV_stateINTERFACE1:
- fputs ("INTERFACE1", dmpout);
- break;
-
- case FFESTV_stateSTRUCTURE:
- fputs ("STRUCTURE", dmpout);
- break;
-
- case FFESTV_stateUNION:
- fputs ("UNION", dmpout);
- break;
-
- case FFESTV_stateMAP:
- fputs ("MAP", dmpout);
- break;
-
- case FFESTV_stateWHERETHEN:
- fputs ("WHERETHEN", dmpout);
- break;
-
- case FFESTV_stateWHERE:
- fputs ("WHERE", dmpout);
- break;
-
- case FFESTV_stateIFTHEN:
- fputs ("IFTHEN", dmpout);
- break;
-
- case FFESTV_stateIF:
- fputs ("IF", dmpout);
- break;
-
- case FFESTV_stateDO:
- fputs ("DO", dmpout);
- break;
-
- case FFESTV_stateSELECT0:
- fputs ("SELECT0", dmpout);
- break;
-
- case FFESTV_stateSELECT1:
- fputs ("SELECT1", dmpout);
- break;
-
- default:
- assert ("bad state" == NULL);
- break;
- }
- if (ffestw_stack_top_->top_do_ != NULL)
- fputs (" (within DO)", dmpout);
- fputc ('\n', dmpout);
-}
-
-/* ffestw_init_0 -- Initialize ffestw structures
-
- ffestw_init_0(); */
-
-void
-ffestw_init_0 ()
-{
- ffestw b;
-
- ffestw_stack_top_ = b = (ffestw) malloc_new_kp (malloc_pool_image (),
- "FFESTW stack base", sizeof (*b));
- b->uses_ = 0; /* catch if anyone uses, kills, &c this
- block. */
- b->next_ = NULL;
- b->previous_ = NULL;
- b->top_do_ = NULL;
- b->blocknum_ = 0;
- b->shriek_ = NULL;
- b->state_ = FFESTV_stateNIL;
- b->line_ = ffewhere_line_unknown ();
- b->col_ = ffewhere_column_unknown ();
-}
-
-/* ffestw_kill -- Kill block
-
- ffestw b;
- ffestw_kill(b); */
-
-void
-ffestw_kill (ffestw b)
-{
- assert (b != NULL);
- assert (b->uses_ > 0);
-
- if (--b->uses_ != 0)
- return;
-
- ffewhere_line_kill (b->line_);
- ffewhere_column_kill (b->col_);
-}
-
-/* ffestw_new -- Create block
-
- ffestw b;
- b = ffestw_new(); */
-
-ffestw
-ffestw_new ()
-{
- ffestw b;
-
- b = (ffestw) malloc_new_kp (malloc_pool_image (), "FFESTW", sizeof (*b));
- b->uses_ = 1;
-
- return b;
-}
-
-/* ffestw_pop -- Pop block off stack
-
- ffestw_pop(); */
-
-ffestw
-ffestw_pop ()
-{
- ffestw b;
- ffestw oldb = ffestw_stack_top_;
-
- assert (oldb != NULL);
- ffestw_stack_top_ = b = ffestw_stack_top_->previous_;
- assert (b != NULL);
- if ((ffewhere_line_is_unknown (b->line_) || ffewhere_column_is_unknown (b->col_))
- && (ffesta_tokens[0] != NULL))
- {
- assert (b->state_ == FFESTV_stateNIL);
- if (ffewhere_line_is_unknown (b->line_))
- b->line_
- = ffewhere_line_use (ffelex_token_where_line (ffesta_tokens[0]));
- if (ffewhere_column_is_unknown (b->col_))
- b->col_
- = ffewhere_column_use (ffelex_token_where_column (ffesta_tokens[0]));
- }
-
- return oldb;
-}
-
-/* ffestw_push -- Push block onto stack, return its address
-
- ffestw b; // NULL if new block to be obtained first.
- ffestw_push(b);
-
- Returns address of block if desired, also updates ffestw_stack_top_
- to point to it.
-
- 30-Oct-91 JCB 2.0
- Takes block as arg, or NULL if new block needed. */
-
-ffestw
-ffestw_push (ffestw b)
-{
- if (b == NULL)
- b = ffestw_new ();
-
- b->next_ = NULL;
- b->previous_ = ffestw_stack_top_;
- b->line_ = ffewhere_line_unknown ();
- b->col_ = ffewhere_column_unknown ();
- ffestw_stack_top_ = b;
- return b;
-}
-
-/* ffestw_update -- Update current block line/col info
-
- ffestw_update();
-
- Updates block to point to current statement. */
-
-ffestw
-ffestw_update (ffestw b)
-{
- if (b == NULL)
- {
- b = ffestw_stack_top_;
- assert (b != NULL);
- }
-
- if (ffesta_tokens[0] == NULL)
- return b;
-
- ffewhere_line_kill (b->line_);
- ffewhere_column_kill (b->col_);
- b->line_ = ffewhere_line_use (ffelex_token_where_line (ffesta_tokens[0]));
- b->col_ = ffewhere_column_use (ffelex_token_where_column (ffesta_tokens[0]));
-
- return b;
-}
-
-/* ffestw_use -- Mark extra use of block
-
- ffestw b;
- b = ffestw_use(b); // will always return original copy of b
-
- Increments use counter for b. */
-
-ffestw
-ffestw_use (ffestw b)
-{
- assert (b != NULL);
- assert (b->uses_ != 0);
-
- ++b->uses_;
-
- return b;
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/stw.h b/gcc/f/stw.h
index 54643b833d4..5bf37928672 100644
--- a/gcc/f/stw.h
+++ b/gcc/f/stw.h
@@ -1,184 +1 @@
-/* stw.h -- Private #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- stw.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_stw
-#define _H_f_stw
-
-/* Simple definitions and enumerations. */
-
-
-/* Typedefs. */
-
-typedef struct _ffestw_ *ffestw;
-typedef struct _ffestw_case_ *ffestwCase;
-typedef struct _ffestw_select_ *ffestwSelect;
-typedef void (*ffestwShriek) (bool ok);
-
-/* Include files needed by this one. */
-
-#include "bld.h"
-#include "com.h"
-#include "info.h"
-#include "lab.h"
-#include "lex.h"
-#include "malloc.h"
-#include "stv.h"
-#include "symbol.h"
-#include "where.h"
-
-/* Structure definitions. */
-
-struct _ffestw_
- {
- ffestw next_; /* Next (unused) block, or NULL. */
- ffestw previous_; /* Previous block, NULL if this is NIL state. */
- ffestw top_do_; /* Previous or current DO state, or NULL. */
- unsigned long blocknum_; /* Block # w/in procedure/program. */
- ffestwShriek shriek_; /* Call me to pop block in a hurry. */
- ffesymbol sym_; /* Related symbol (if there is one). */
- ffelexToken name_; /* Construct name (IFTHEN, SELECT, DO only). */
- ffestwSelect select_; /* Info for SELECT CASE blocks. */
- ffelab label_; /* For DO blocks w/labels, the target label. */
- ffesymbol do_iter_var_; /* For iter DO blocks, the iter var or NULL. */
- ffelexToken do_iter_var_t_; /* The token for do_iter_var. */
- ffewhereLine line_; /* Where first token of statement triggering
- state */
- ffewhereColumn col_; /* was seen in source file. */
- char uses_; /* # uses (new+use-kill calls). */
- ffestvState state_;
- int substate_; /* Used on a per-block-state basis. */
-#if FFECOM_targetCURRENT == FFECOM_targetGCC
- struct nesting *do_hook_; /* backend id for given loop (EXIT/CYCLE). */
- tree do_tvar_; /* tree form of do_iter_var. */
- tree do_incr_saved_; /* tree SAVED_EXPR of incr expr. */
- tree do_count_var_; /* tree of countdown variable. */
- tree select_texpr_; /* tree for end case. */
- bool select_break_; /* TRUE when CASE should start with gen
- "break;". */
-#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC*/
- };
-
-struct _ffestw_case_
- {
- ffestwCase next_rel; /* Next case range in relational order. */
- ffestwCase previous_rel; /* Previous case range in relational order. */
- ffestwCase next_stmt; /* Next range in stmt or first in next stmt. */
- ffestwCase previous_stmt; /* Previous range. */
- ffebldConstant low; /* Low value in range. */
- ffebldConstant high; /* High value in range. */
- unsigned long casenum; /* CASE stmt index for this range/value. */
- ffelexToken t; /* Token for this range/value; ffestc only. */
- };
-
-struct _ffestw_select_
- {
- ffestwCase first_rel; /* First CASE range (after low) in order. */
- ffestwCase last_rel; /* Last CASE range (before high) in order. */
- ffestwCase first_stmt; /* First range in first CASE stmt. */
- ffestwCase last_stmt; /* Last range in last CASE stmt. */
- mallocPool pool; /* Pool in which this and all cases are
- allocated. */
- unsigned long cases; /* Number of CASE stmts seen so far. */
- ffelexToken t; /* First token of selected expression; ffestc
- only. */
- ffeinfoBasictype type; /* Basic type (integer, character, or
- logical). */
- ffeinfoKindtype kindtype; /* Kind type. */
- };
-
-/* Global objects accessed by users of this module. */
-
-extern ffestw ffestw_stack_top_;
-
-/* Declare functions with prototypes. */
-
-void ffestw_display_state ();
-void ffestw_kill (ffestw block);
-void ffestw_init_0 (void);
-ffestw ffestw_new ();
-ffestw ffestw_pop ();
-ffestw ffestw_push (ffestw block);
-ffestw ffestw_update (ffestw block);
-ffestw ffestw_use (ffestw block);
-
-/* Define macros. */
-
-#define ffestw_blocknum(b) ((b)->blocknum_)
-#define ffestw_col(b) ((b)->col_)
-#define ffestw_do_count_var(b) ((b)->do_count_var_)
-#define ffestw_do_hook(b) ((b)->do_hook_)
-#define ffestw_do_incr_saved(b) ((b)->do_incr_saved_)
-#define ffestw_do_iter_var(b) ((b)->do_iter_var_)
-#define ffestw_do_iter_var_t(b) ((b)->do_iter_var_t_)
-#define ffestw_do_tvar(b) ((b)->do_tvar_)
-#define ffestw_init_1()
-#define ffestw_init_2()
-#define ffestw_init_3()
-#define ffestw_init_4()
-#define ffestw_label(b) ((b)->label_)
-#define ffestw_line(b) ((b)->line_)
-#define ffestw_name(b) ((b)->name_)
-#define ffestw_previous(b) ((b)->previous_)
-#define ffestw_select(b) ((b)->select_)
-#define ffestw_select_break(b) ((b)->select_break_)
-#define ffestw_select_texpr(b) ((b)->select_texpr_)
-#define ffestw_set_blocknum(b,bl) ((b)->blocknum_ = (bl))
-#define ffestw_set_col(b,c) ((b)->col_ = (c))
-#define ffestw_set_do_count_var(b,d) ((b)->do_count_var_ = (d))
-#define ffestw_set_do_hook(b,d) ((b)->do_hook_ = (d))
-#define ffestw_set_do_incr_saved(b,d) ((b)->do_incr_saved_ = (d))
-#define ffestw_set_do_iter_var(b,v) ((b)->do_iter_var_ = (v))
-#define ffestw_set_do_iter_var_t(b,t) ((b)->do_iter_var_t_ = (t))
-#define ffestw_set_do_tvar(b,d) ((b)->do_tvar_ = (d))
-#define ffestw_set_label(b,l) ((b)->label_ = (l))
-#define ffestw_set_line(b,l) ((b)->line_ = (l))
-#define ffestw_set_name(b,n) ((b)->name_ = (n))
-#define ffestw_set_select(b,s) ((b)->select_ = (s))
-#define ffestw_set_select_break(b,br) ((b)->select_break_ = (br))
-#define ffestw_set_select_texpr(b,t) ((b)->select_texpr_ = (t))
-#define ffestw_set_shriek(b,s) ((b)->shriek_ = (s))
-#define ffestw_set_state(b,s) ((b)->state_ = (s))
-#define ffestw_set_substate(b,s) ((b)->substate_ = (s))
-#define ffestw_set_sym(b,s) ((b)->sym_= (s))
-#define ffestw_set_top_do(b,t) ((b)->top_do_ = (t))
-#define ffestw_shriek(b) ((b)->shriek_)
-#define ffestw_stack_top() ffestw_stack_top_
-#define ffestw_state(b) ((b)->state_)
-#define ffestw_substate(b) ((b)->substate_)
-#define ffestw_sym(b) ((b)->sym_)
-#define ffestw_terminate_0()
-#define ffestw_terminate_1()
-#define ffestw_terminate_2()
-#define ffestw_terminate_3()
-#define ffestw_terminate_4()
-#define ffestw_top_do(b) ((b)->top_do_)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/symbol.c b/gcc/f/symbol.c
index 5e87cf50919..8aa72306eca 100644
--- a/gcc/f/symbol.c
+++ b/gcc/f/symbol.c
@@ -1,6 +1,6 @@
/* Implementation of Fortran symbol manager
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -794,6 +794,7 @@ ffesymbol_drive_sfnames (ffesymbol (*fn) ())
/* Dump info on the symbol for debugging purposes. */
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
void
ffesymbol_dump (ffesymbol s)
{
@@ -828,6 +829,7 @@ ffesymbol_dump (ffesymbol s)
ffeintrin_name_specific (s->specific),
ffeintrin_name_implementation (s->implementation));
}
+#endif
/* Produce generic error message about a symbol.
@@ -1011,6 +1013,7 @@ ffesymbol_reference (ffesymbol s, ffelexToken t, bool explicit)
/* Report info on the symbol for debugging purposes. */
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
ffesymbol
ffesymbol_report (ffesymbol s)
{
@@ -1172,9 +1175,11 @@ ffesymbol_report (ffesymbol s)
return s;
}
+#endif
/* Report info on the symbols. */
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
void
ffesymbol_report_all ()
{
@@ -1182,6 +1187,7 @@ ffesymbol_report_all ()
ffename_space_drive_symbol (ffesymbol_local_, ffesymbol_report);
ffename_space_drive_symbol (ffesymbol_global_, ffesymbol_report);
}
+#endif
/* Resolve symbol that has become known intrinsic or non-intrinsic. */
diff --git a/gcc/f/symbol.def b/gcc/f/symbol.def
index ad100d4ebbe..5bf37928672 100644
--- a/gcc/f/symbol.def
+++ b/gcc/f/symbol.def
@@ -1,654 +1 @@
-/* Definitions and documentations for attributes used in GNU F77 compiler
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-/* "How g77 learns about symbols"
-
- There are three primary things in a symbol that g77 uses to keep
- track of what it has learned about that symbol:
-
- 1. The state
- 2. The attributes
- 3. The info
-
- State, attributes, and info (see f-info* files) all start out with
- "NONE" fields when a symbol is first created.
-
- In a PROGRAM or BLOCK DATA program unit, info where cannot be DUMMY
- or RESULT. Any combinations including those possibilities are not
- considered possible in such program units.
-
- As soon as a symbol is created, it _must_ have its state changed to
- SEEN, UNCERTAIN, or UNDERSTOOD.
-
- If SEEN, some info might be set, such as the type info (as in when
- the TYPE attribute is present) or kind/where info.
-
- If UNCERTAIN, the permitted combinations of attributes and info are
- listed below. Only the attributes ACTUALARG, ADJUSTABLE, ANYLEN, ARRAY,
- DUMMY, EXTERNAL, SFARG, and TYPE are permitted. (All these attributes
- are contrasted to each attribute below, even though some combinations
- wouldn't be permitted in SEEN state either.) Note that DUMMY and
- RESULT are not permitted in a PROGRAM/BLOCKDATA program unit, which
- results in some of the combinations below not occurring (not UNCERTAIN,
- but UNDERSTOOD).
-
- ANYLEN|TYPE & ~(ACTUALARG|ADJUSTABLE|ARRAY|DUMMY|EXTERNAL|SFARG):
- ENTITY/DUMMY, ENTITY/RESULT, FUNCTION/INTRINSIC.
-
- ARRAY & ~(ACTUALARG|ANYLEN|DUMMY|EXTERNAL|SFARG|TYPE):
- ENTITY/DUMMY, ENTITY/LOCAL.
-
- ARRAY|TYPE & ~(ACTUALARG|ANYLEN|DUMMY|EXTERNAL|SFARG):
- ENTITY/DUMMY, ENTITY/LOCAL.
-
- DUMMY & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|EXTERNAL|SFARG|TYPE):
- ENTITY/DUMMY, FUNCTION/DUMMY, SUBROUTINE/DUMMY.
-
- DUMMY|TYPE & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|EXTERNAL|SFARG):
- ENTITY/DUMMY, FUNCTION/DUMMY.
-
- EXTERNAL & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|DUMMY|SFARG|TYPE):
- FUNCTION/DUMMY, FUNCTION/GLOBAL, SUBROUTINE/DUMMY,
- SUBROUTINE/GLOBAL, BLOCKDATA/GLOBAL.
-
- EXTERNAL|ACTUALARG & ~(ADJUSTABLE|ANYLEN|ARRAY|DUMMY|SFARG|TYPE):
- FUNCTION/GLOBAL, SUBROUTINE/GLOBAL.
-
- EXTERNAL|DUMMY & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|SFARG|TYPE):
- FUNCTION/DUMMY, SUBROUTINE/DUMMY.
-
- EXTERNAL|TYPE & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|DUMMY|SFARG):
- FUNCTION/DUMMY, FUNCTION/GLOBAL.
-
- SFARG & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|DUMMY|EXTERNAL|TYPE):
- ENTITY/DUMMY, ENTITY/LOCAL.
-
- SFARG|TYPE & ~(ACTUALARG|ADJUSTABLE|ANYLEN|ARRAY|DUMMY|EXTERNAL):
- ENTITY/DUMMY, ENTITY/LOCAL.
-
- TYPE & ~(ACTUALARG|ANYLEN|ARRAY|DUMMY|EXTERNAL|SFARG):
- ENTITY/DUMMY, ENTITY/LOCAL, ENTITY/RESULT, FUNCTION/DUMMY,
- FUNCTION/GLOBAL, FUNCTION/INTRINSIC.
-
- If UNDERSTOOD, the attributes are no longer considered, and the info
- field is considered to be as fully filled in as possible by analyzing
- a single program unit.
-
- Each of the attributes (used only for SEEN/UNCERTAIN states) is
- defined and described below. In many cases, a symbol starts out as
- SEEN and has attributes set as it is seen in various contexts prior
- to the first executable statement being seen (the "exec transition").
- Once that happens, either it becomes immediately UNDERSTOOD and all
- its info filled in, or it becomes UNCERTAIN and its info only partially
- filled in until it becomes UNDERSTOOD. While UNCERTAIN, only a
- subset of attributes are possible/important.
-
- Not all symbols reach the UNDERSTOOD state, and in some cases symbols
- go immediately from NONE to the UNDERSTOOD or even UNCERTAIN state.
- For example, given "PROGRAM FOO", everything is known about the name
- "FOO", so it becomes immediately UNDERSTOOD.
-
- Also, there are multiple name spaces, and not all attributes are
- possible/permitted in all name spaces.
-
- The only attributes permitted in the global name space are:
-
- ANY, CBLOCK, SAVECBLOCK.
-
- The only attributes permitted in the local name space are:
-
- ANY, ACTUALARG, ADJUSTABLE, ADJUSTS, ANYLEN, ANYSIZE, ARRAY, COMMON,
- DUMMY, EQUIV, EXTERNAL, INIT, INTRINSIC, NAMELIST, RESULT, SAVE, SFARG,
- SFUNC, TYPE.
-
- In the stmt-func name space, no attributes are used, just the states.
-
-*/
-
-
-/* Actual argument. Always accompanied by EXTERNAL.
-
- Context is a name used as an actual argument passed to a procedure
- other than a statement function.
-
- Valid in UNCERTAIN state and local name space only.
-
- This attribute is used only to flag the fact that an EXTERNAL'ed name
- has been seen as an actual argument, and therefore cannot be
- discovered later to be a DUMMY argument (via an ENTRY statement).
-
- If DUMMY + EXTERNAL already, it is permitted to see the name
- as an actual argument, but ACTUALARG is not added as an attribute since
- that fact does not improve knowledge about the name. Hence it is not
- permitted to transition ACTUALARG + EXTERNAL += DUMMY, and the
- transition DUMMY + EXTERNAL += ACTUALARG is not actually done.
-
- Cannot be combined with: ANYLEN, ARRAY, DUMMY, SFARG, TYPE.
-
- Can be combined with: ACTUALARG, ANY, EXTERNAL.
-
- Unrelated: ADJUSTABLE, ADJUSTS, ANYSIZE, CBLOCK, COMMON, EQUIV, INIT,
- INTRINSIC, NAMELIST, RESULT, SAVE, SAVECBLOCK, SFUNC.
-
-*/
-
-DEFATTR (FFESYMBOL_attrACTUALARG, FFESYMBOL_attrsACTUALARG, "ACTUALARG")
-#ifndef FFESYMBOL_attrsACTUALARG
-#define FFESYMBOL_attrsACTUALARG ((ffesymbolAttrs) 1 << FFESYMBOL_attrACTUALARG)
-#endif
-
-/* Has adjustable dimension(s). Always accompanied by ARRAY.
-
- Context is an ARRAY-attributed name with an adjustable dimension (at
- least one dimension containing a variable reference).
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ADJUSTS, COMMON, EQUIV, EXTERNAL,
- NAMELIST, INIT, INTRINSIC, RESULT, SAVE, SFARG, SFUNC.
-
- Can be combined with: ANY, ANYLEN, ANYSIZE, ARRAY, TYPE.
-
- Must be combined with: DUMMY.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrADJUSTABLE, FFESYMBOL_attrsADJUSTABLE, "ADJUSTABLE")
-#ifndef FFESYMBOL_attrsADJUSTABLE
-#define FFESYMBOL_attrsADJUSTABLE ((ffesymbolAttrs) 1 << FFESYMBOL_attrADJUSTABLE)
-#endif
-
-/* Adjusts an array.
-
- Context is an expression in an array declarator, such as in a
- DIMENSION, COMMON, or type-specification statement.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ANYLEN, ANYSIZE, ARRAY,
- EXTERNAL, INTRINSIC, RESULT, SAVE, SFUNC.
-
- Can be combined with: ADJUSTS, ANY, COMMON, DUMMY, EQUIV, INIT,
- NAMELIST, SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrADJUSTS, FFESYMBOL_attrsADJUSTS, "ADJUSTS")
-#ifndef FFESYMBOL_attrsADJUSTS
-#define FFESYMBOL_attrsADJUSTS ((ffesymbolAttrs) 1 << FFESYMBOL_attrADJUSTS)
-#endif
-
-/* Can be anything now, diagnostic has been issued at least once.
-
- Valid in UNDERSTOOD state only. Valid in any name space.
-
- Can be combined with anything.
-
-*/
-
-DEFATTR (FFESYMBOL_attrANY, FFESYMBOL_attrsANY, "ANY")
-#ifndef FFESYMBOL_attrsANY
-#define FFESYMBOL_attrsANY ((ffesymbolAttrs) 1 << FFESYMBOL_attrANY)
-#endif
-
-/* Assumed (any) length. Always accompanied by TYPE.
-
- Context is a name listed in a CHARACTER statement and given a length
- specification of (*).
-
- Valid in SEEN and UNCERTAIN states. Valid in local name space only.
-
- In SEEN state, attributes marked below with "=" are unrelated.
-
- In UNCERTAIN state, attributes marked below with "+" are unrelated,
- attributes marked below with "-" cannot be combined with ANYLEN,
- and attributes marked below with "!" transition to state UNDERSTOOD
- instead of acquiring the new attribute. Any other subsequent mentioning
- of the name transitions to state UNDERSTOOD. UNCERTAIN state is not
- valid for this attribute in PROGRAM/BLOCKDATA program unit.
-
- Cannot be combined with: ACTUALARG=, ADJUSTS+, ANYLEN, COMMON+, EQUIV+,
- EXTERNAL, INIT+, INTRINSIC+, NAMELIST+, SAVE+, SFARG, SFUNC+.
-
- Can be combined with: ADJUSTABLE+, ANY, ANYSIZE+, ARRAY-, DUMMY!, RESULT+,
- TYPE.
-
- Unrelated: CBLOCK, SAVECBLOCK.
-
- In PROGRAM/BLOCKDATA, cannot be combined with ARRAY.
-
-*/
-
-DEFATTR (FFESYMBOL_attrANYLEN, FFESYMBOL_attrsANYLEN, "ANYLEN")
-#ifndef FFESYMBOL_attrsANYLEN
-#define FFESYMBOL_attrsANYLEN ((ffesymbolAttrs) 1 << FFESYMBOL_attrANYLEN)
-#endif
-
-/* Has assumed (any) size. Always accompanied by ARRAY.
-
- Context is an ARRAY-attributed name with its last dimension having
- an upper bound of "*".
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTS, ANYSIZE, COMMON, EQUIV, EXTERNAL,
- NAMELIST, INIT, INTRINSIC, RESULT, SAVE, SFARG, SFUNC.
-
- Can be combined with: ADJUSTABLE, ANY, ANYLEN, ARRAY, TYPE.
-
- Must be combined with: DUMMY.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrANYSIZE, FFESYMBOL_attrsANYSIZE, "ANYSIZE")
-#ifndef FFESYMBOL_attrsANYSIZE
-#define FFESYMBOL_attrsANYSIZE ((ffesymbolAttrs) 1 << FFESYMBOL_attrANYSIZE)
-#endif
-
-/* Array.
-
- Context is a name followed by an array declarator, such as in a
- type-statement-decl, a DIMENSION statement, or a COMMON statement.
-
- Valid in SEEN and UNCERTAIN states. Valid in local name space only.
-
- In SEEN state, attributes marked below with "=" are unrelated.
-
- In UNCERTAIN state, attributes marked below with "+" are unrelated,
- attributes marked below with "-" cannot be combined with ARRAY,
- and attributes marked below with "!" transition to state UNDERSTOOD
- instead of acquiring the new attribute. Any other subsequent mentioning
- of the name transitions to state UNDERSTOOD. UNCERTAIN state is not
- valid for this attribute in PROGRAM/BLOCKDATA program unit.
-
- Cannot be combined with: ACTUALARG=, ADJUSTS+, ARRAY, EXTERNAL,
- INTRINSIC+, RESULT+, SFARG, SFUNC+.
-
- Can be combined with: ADJUSTABLE+, ANY, ANYLEN-, ANYSIZE+, COMMON+,
- DUMMY!, EQUIV+, INIT+, NAMELIST+, SAVE+, TYPE.
-
- Unrelated: CBLOCK, SAVECBLOCK.
-
- In PROGRAM/BLOCKDATA, cannot be combined with ANYLEN.
- Cannot follow INIT.
-
-*/
-
-DEFATTR (FFESYMBOL_attrARRAY, FFESYMBOL_attrsARRAY, "ARRAY")
-#ifndef FFESYMBOL_attrsARRAY
-#define FFESYMBOL_attrsARRAY ((ffesymbolAttrs) 1 << FFESYMBOL_attrARRAY)
-#endif
-
-/* COMMON block.
-
- Context is a name enclosed in slashes in a COMMON statement.
-
- Valid in SEEN state and global name space only.
-
- Cannot be combined with:
-
- Can be combined with: CBLOCK, SAVECBLOCK.
-
- Unrelated: ACTUALARG, ADJUSTABLE, ADJUSTS, ANY, ANYLEN, ANYSIZE,
- ARRAY, COMMON, DUMMY, EQUIV, EXTERNAL, INIT, INTRINSIC, NAMELIST,
- RESULT, SAVE, SFARG, SFUNC, TYPE.
-
-*/
-
-DEFATTR (FFESYMBOL_attrCBLOCK, FFESYMBOL_attrsCBLOCK, "CBLOCK")
-#ifndef FFESYMBOL_attrsCBLOCK
-#define FFESYMBOL_attrsCBLOCK ((ffesymbolAttrs) 1 << FFESYMBOL_attrCBLOCK)
-#endif
-
-/* Placed in COMMON.
-
- Context is a name listed in a COMMON statement but not enclosed in
- slashes.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ANYLEN, ANYSIZE, COMMON, DUMMY,
- EXTERNAL, INTRINSIC, RESULT, SAVE, SFUNC.
-
- Can be combined with: ADJUSTS, ANY, ARRAY, EQUIV, INIT, NAMELIST,
- SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrCOMMON, FFESYMBOL_attrsCOMMON, "COMMON")
-#ifndef FFESYMBOL_attrsCOMMON
-#define FFESYMBOL_attrsCOMMON ((ffesymbolAttrs) 1 << FFESYMBOL_attrCOMMON)
-#endif
-
-/* Dummy argument.
-
- Context is a name listed in the arglist of FUNCTION, SUBROUTINE, ENTRY.
- (Statement-function definitions have dummy arguments, but since they're
- the only possible entities in the statement-function name space, this
- attribution mechanism isn't used for them.)
-
- Valid in SEEN and UNCERTAIN states. Valid in local name space only.
-
- In SEEN state, attributes marked below with "=" are unrelated.
-
- In UNCERTAIN state, attributes marked below with "+" are unrelated,
- attributes marked below with "-" cannot be combined with DUMMY,
- and attributes marked below with "!" transition to state UNDERSTOOD
- instead of acquiring the new attribute. Any other subsequent mentioning
- of the name transitions to state UNDERSTOOD. UNCERTAIN state is not
- valid for this attribute in PROGRAM/BLOCKDATA program unit.
-
- Cannot be combined with: ACTUALARG=, COMMON+, EQUIV+, INIT+, INTRINSIC+,
- NAMELIST+, RESULT+, SAVE+, SFUNC+.
-
- Can be combined with: ADJUSTABLE+, ADJUSTS+, ANY, ANYLEN-, ANYSIZE+,
- ARRAY-, DUMMY, EXTERNAL, SFARG-, TYPE.
-
- Unrelated: CBLOCK, SAVECBLOCK.
-
- VXT Fortran disallows DUMMY + NAMELIST.
- F90 allows DUMMY + NAMELIST (with some restrictions), g77 doesn't yet.
-
-*/
-
-DEFATTR (FFESYMBOL_attrDUMMY, FFESYMBOL_attrsDUMMY, "DUMMY")
-#ifndef FFESYMBOL_attrsDUMMY
-#define FFESYMBOL_attrsDUMMY ((ffesymbolAttrs) 1 << FFESYMBOL_attrDUMMY)
-#endif
-
-/* EQUIVALENCE'd.
-
- Context is a name given in an EQUIVALENCE statement.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ANYLEN, ANYSIZE, DUMMY,
- EXTERNAL, INTRINSIC, RESULT, SFUNC.
-
- Can be combined with: ADJUSTS, ANY, ARRAY, COMMON, EQUIV, INIT,
- NAMELIST, SAVE, SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrEQUIV, FFESYMBOL_attrsEQUIV, "EQUIV")
-#ifndef FFESYMBOL_attrsEQUIV
-#define FFESYMBOL_attrsEQUIV ((ffesymbolAttrs) 1 << FFESYMBOL_attrEQUIV)
-#endif
-
-/* EXTERNAL.
-
- Context is a name listed in an EXTERNAL statement.
-
- Valid in SEEN and UNCERTAIN states. Valid in local name space only.
-
- In SEEN state, attributes marked below with "=" are unrelated.
-
- In UNCERTAIN state, attributes marked below with "+" are unrelated,
- attributes marked below with "-" cannot be combined with EXTERNAL,
- and attributes marked below with "!" transition to state UNDERSTOOD
- instead of acquiring the new attribute. Many other subsequent mentionings
- of the name transitions to state UNDERSTOOD. UNCERTAIN state is not
- valid for this attribute in PROGRAM/BLOCKDATA program unit.
-
- Cannot be combined with: ADJUSTABLE+, ADJUSTS+, ANYLEN, ANYSIZE+,
- ARRAY, COMMON+, EQUIV+, EXTERNAL, INIT+, INTRINSIC+, NAMELIST+, RESULT+,
- SAVE+, SFARG, SFUNC+.
-
- Can be combined with: ACTUALARG=, ANY, DUMMY, TYPE.
-
- Unrelated: CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrEXTERNAL, FFESYMBOL_attrsEXTERNAL, "EXTERNAL")
-#ifndef FFESYMBOL_attrsEXTERNAL
-#define FFESYMBOL_attrsEXTERNAL ((ffesymbolAttrs) 1 << FFESYMBOL_attrEXTERNAL)
-#endif
-
-/* Given an initial value.
-
- Context is a name listed in a type-def-stmt such as INTEGER or REAL
- and given an initial value or values. Someday will also include
- names in DATA statements, which currently immediately exec-transition
- their targets.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ANYLEN, ANYSIZE, DUMMY, EXTERNAL,
- INIT, INTRINSIC, RESULT, SFUNC.
-
- Can be combined with: ADJUSTS, ANY, ARRAY, COMMON, EQUIV, NAMELIST,
- SAVE, SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
- Cannot be followed by ARRAY.
-
-*/
-
-DEFATTR (FFESYMBOL_attrINIT, FFESYMBOL_attrsINIT, "INIT")
-#ifndef FFESYMBOL_attrsINIT
-#define FFESYMBOL_attrsINIT ((ffesymbolAttrs) 1 << FFESYMBOL_attrINIT)
-#endif
-
-/* INTRINSIC.
-
- Context is a name listed in an INTRINSIC statement.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ADJUSTS, ANYLEN, ANYSIZE, ARRAY,
- COMMON, DUMMY, EQUIV, EXTERNAL, INIT, INTRINSIC, NAMELIST, RESULT,
- SAVE, SFARG, SFUNC.
-
- Can be combined with: ANY, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrINTRINSIC, FFESYMBOL_attrsINTRINSIC, "INTRINSIC")
-#ifndef FFESYMBOL_attrsINTRINSIC
-#define FFESYMBOL_attrsINTRINSIC ((ffesymbolAttrs) 1 << FFESYMBOL_attrINTRINSIC)
-#endif
-
-/* NAMELISTed.
-
- Context is a name listed in a NAMELIST statement but not enclosed in
- slashes.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ANYLEN, ANYSIZE, DUMMY, EXTERNAL,
- INTRINSIC, RESULT, SFUNC.
-
- Can be combined with: ADJUSTS, ANY, ARRAY, COMMON, EQUIV, INIT,
- NAMELIST, SAVE, SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrNAMELIST, FFESYMBOL_attrsNAMELIST, "NAMELIST")
-#ifndef FFESYMBOL_attrsNAMELIST
-#define FFESYMBOL_attrsNAMELIST ((ffesymbolAttrs) 1 << FFESYMBOL_attrNAMELIST)
-#endif
-
-/* RESULT of a function.
-
- Context is name in RESULT() clause in FUNCTION or ENTRY statement, or
- the name in a FUNCTION or ENTRY statement (within a FUNCTION subprogram)
- that has no RESULT() clause.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ADJUSTS, ANYSIZE, ARRAY, COMMON,
- DUMMY, EQUIV, EXTERNAL, INIT, INTRINSIC, NAMELIST, RESULT, SAVE, SFUNC.
-
- Can be combined with: ANY, ANYLEN, SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
- Cannot be preceded by SFARG.
-
-*/
-
-DEFATTR (FFESYMBOL_attrRESULT, FFESYMBOL_attrsRESULT, "RESULT")
-#ifndef FFESYMBOL_attrsRESULT
-#define FFESYMBOL_attrsRESULT ((ffesymbolAttrs) 1 << FFESYMBOL_attrRESULT)
-#endif
-
-/* SAVEd (not enclosed in slashes).
-
- Context is a name listed in a SAVE statement but not enclosed in slashes.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADUSTABLE, ADJUSTS, ANYLEN, ANYSIZE, COMMON,
- DUMMY, EXTERNAL, INTRINSIC, RESULT, SAVE, SFUNC.
-
- Can be combined with: ANY, ARRAY, EQUIV, INIT, NAMELIST,
- SFARG, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrSAVE, FFESYMBOL_attrsSAVE, "SAVE")
-#ifndef FFESYMBOL_attrsSAVE
-#define FFESYMBOL_attrsSAVE ((ffesymbolAttrs) 1 << FFESYMBOL_attrSAVE)
-#endif
-
-/* SAVEd (enclosed in slashes).
-
- Context is a name enclosed in slashes in a SAVE statement.
-
- Valid in SEEN state and global name space only.
-
- Cannot be combined with: SAVECBLOCK.
-
- Can be combined with: CBLOCK.
-
- Unrelated: ACTUALARG, ADJUSTABLE, ADJUSTS, ANY, ANYLEN, ANYSIZE,
- ARRAY, COMMON, DUMMY, EQUIV, EXTERNAL, INIT, INTRINSIC, NAMELIST,
- RESULT, SAVE, SFARG, SFUNC, TYPE.
-
-*/
-
-DEFATTR (FFESYMBOL_attrSAVECBLOCK, FFESYMBOL_attrsSAVECBLOCK, "SAVECBLOCK")
-#ifndef FFESYMBOL_attrsSAVECBLOCK
-#define FFESYMBOL_attrsSAVECBLOCK ((ffesymbolAttrs) 1 << FFESYMBOL_attrSAVECBLOCK)
-#endif
-
-/* Name used as a statement function arg or DATA implied-DO iterator.
-
- Context is a name listed in the arglist of statement-function-definition
- or as the iterator in an implied-DO construct in a DATA statement.
-
- Valid in SEEN and UNCERTAIN states. Valid in local name space only.
-
- In SEEN state, attributes marked below with "=" are unrelated.
-
- In UNCERTAIN state, attributes marked below with "+" are unrelated,
- attributes marked below with "-" cannot be combined with SFARG,
- and attributes marked below with "!" transition to state UNDERSTOOD
- instead of acquiring the new attribute. Any other subsequent mentioning
- of the name transitions to state UNDERSTOOD. UNCERTAIN state is not
- valid for this attribute in PROGRAM/BLOCKDATA program unit.
-
- Cannot be combined with: ACTUALARG=, ADJUSTABLE+, ANYLEN, ANYSIZE+,
- ARRAY, EXTERNAL, INTRINSIC+, SFUNC+.
-
- Can be combined with: ADJUSTS+, ANY, COMMON+, DUMMY!, EQUIV+, INIT+,
- NAMELIST+, RESULT+, SAVE+, SFARG, TYPE.
-
- Unrelated: CBLOCK, SAVECBLOCK.
-
- Cannot be followed by RESULT.
-
-*/
-
-DEFATTR (FFESYMBOL_attrSFARG, FFESYMBOL_attrsSFARG, "SFARG")
-#ifndef FFESYMBOL_attrsSFARG
-#define FFESYMBOL_attrsSFARG ((ffesymbolAttrs) 1 << FFESYMBOL_attrSFARG)
-#endif
-
-/* Statement function name.
-
- Context is a statement-function-definition statement, the name being
- defined.
-
- Valid in SEEN state and local name space only.
-
- Cannot be combined with: ADJUSTABLE, ADJUSTS, ANYLEN, ANYSIZE, ARRAY,
- COMMON, DUMMY, EQUIV, EXTERNAL, INIT, INTRINSIC, NAMELIST, RESULT,
- SAVE, SFARG, SFUNC.
-
- Can be combined with: ANY, TYPE.
-
- Unrelated: ACTUALARG, CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrSFUNC, FFESYMBOL_attrsSFUNC, "SFUNC")
-#ifndef FFESYMBOL_attrsSFUNC
-#define FFESYMBOL_attrsSFUNC ((ffesymbolAttrs) 1 << FFESYMBOL_attrSFUNC)
-#endif
-
-/* Explicitly typed.
-
- Context is a name listed in a type-def-stmt such as INTEGER or REAL.
-
- Valid in SEEN and UNCERTAIN states. Valid in local name space only.
-
- In SEEN state, attributes marked below with "=" are unrelated.
-
- In UNCERTAIN state, attributes marked below with "+" are unrelated,
- attributes marked below with "-" cannot be combined with TYPE,
- and attributes marked below with "!" transition to state UNDERSTOOD
- instead of acquiring the new attribute. Many other subsequent mentionings
- of the name transitions to state UNDERSTOOD. UNCERTAIN state is not
- valid for this attribute in PROGRAM/BLOCKDATA program unit.
-
- Cannot be combined with: ACTUALARG=, TYPE.
-
- Can be combined with: ADJUSTABLE+, ADJUSTS+, ANY, ANYLEN, ANYSIZE+,
- ARRAY, COMMON+, DUMMY, EQUIV+, EXTERNAL, INIT+, INTRINSIC+, NAMELIST+,
- RESULT+, SAVE+, SFARG, SFUNC+.
-
- Unrelated: CBLOCK, SAVECBLOCK.
-
-*/
-
-DEFATTR (FFESYMBOL_attrTYPE, FFESYMBOL_attrsTYPE, "TYPE")
-#ifndef FFESYMBOL_attrsTYPE
-#define FFESYMBOL_attrsTYPE ((ffesymbolAttrs) 1 << FFESYMBOL_attrTYPE)
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/symbol.h b/gcc/f/symbol.h
index efa91bb01b6..bb3a6670163 100644
--- a/gcc/f/symbol.h
+++ b/gcc/f/symbol.h
@@ -1,289 +1,5 @@
-/* Interface definitions for Fortran symbol manager
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef _H_f_symbol
-#define _H_f_symbol
-
-/* The main symbol type. */
-
-typedef struct _ffesymbol_ *ffesymbol;
-
-/* State of understanding about what the symbol represents. */
-
-enum _ffesymbol_state_
- {
-/* See ffesymbol_state_is_exec() macro below when making changes. */
- FFESYMBOL_stateNONE, /* Never before seen. */
- FFESYMBOL_stateSEEN, /* Seen before exec transition and not yet
- understood (info not filled in, etc). */
- FFESYMBOL_stateUNCERTAIN, /* Almost understood (info partly filled in). */
- FFESYMBOL_stateUNDERSTOOD, /* Fully understood (info filled in). */
- FFESYMBOL_state
- };
-typedef enum _ffesymbol_state_ ffesymbolState;
-#define ffesymbolState_f ""
-
-/* Attributes. Symbols acquire attributes while their state is SEEN.
- These attributes are basically ignored once the symbol becomes
- UNDERSTOOD. */
-
-typedef long int ffesymbolAttrs;/* Holds set of attributes. */
-#define ffesymbolAttrs_f "l"
-
-enum _ffesymbol_attr_
- {
-#define DEFATTR(ATTR,ATTRS,NAME) ATTR,
-#include "symbol.def"
-#undef DEFATTR
- FFESYMBOL_attr
- }; /* A given attribute. */
-typedef enum _ffesymbol_attr_ ffesymbolAttr;
-#define ffesymbolAttr_f ""
-
-#define FFESYMBOL_attrsetNONE 0
-#define FFESYMBOL_attrsetALL (((ffesymbolAttrs) 1 << FFESYMBOL_attr) - 1)
-
-/* This is just for avoiding complaining about, e.g., "I = IABS(3)", that
- IABS doesn't meet the requirements for a user-defined symbol name as
- a result of, say, --symbol-case-lower, if IABS turns out to indeed be
- a reference to the intrinsic IABS (in which case it's a Fortran keyword
- like CALL) and not a user-defined name. */
-
-enum _ffesymbol_checkstate_
- {
- FFESYMBOL_checkstateNONE_, /* Not checked/never necessary to check. */
- FFESYMBOL_checkstateINHIBITED_, /* Bad name, but inhibited. */
- FFESYMBOL_checkstatePENDING_, /* Bad name, might be intrinsic. */
- FFESYMBOL_checkstateCHECKED_, /* Ok name, intrinsic, or bad name
- reported. */
- FFESYMBOL_checkstate_
- };
-typedef enum _ffesymbol_checkstate_ ffesymbolCheckState_;
-#define ffesymbolCheckState_f_ ""
-
-#include "bld.h"
-#include "com.h"
-#include "equiv.h"
-#include "global.h"
-#include "info.h"
-#include "intrin.h"
-#include "lex.h"
-#include "malloc.h"
-#include "name.h"
-#include "storag.h"
-#include "target.h"
-#include "top.h"
-#include "where.h"
-
-struct _ffesymbol_
- {
- ffename name;
- ffename other_space_name; /* For dual-space objects. */
- ffeglobal global; /* In filewide name space. */
- ffesymbolAttrs attrs; /* What kind of symbol am I? */
- ffesymbolState state; /* What state am I in? */
- ffeinfo info; /* Info filled in when _stateUNDERSTOOD. */
- ffebld dims; /* Dimension list expression. */
- ffebld extents; /* Extents list expression. */
- ffebld dim_syms; /* List of SYMTERs of all symbols in dims. */
- ffebld array_size; /* Size as an expression involving some of
- dims. */
- ffebld init; /* Initialization expression or expr list or
- PARAMETER value. */
- ffebld accretion; /* Initializations seen so far for
- array/substr. */
- ffetargetOffset accretes; /* # inits needed to fill entire array. */
- ffebld dummy_args; /* For functions, subroutines, and entry
- points. */
- ffebld namelist; /* List of symbols in NML. */
- ffebld common_list; /* List of entities in BCB/NCB. */
- ffebld sfunc_expr; /* SFN's expression. */
- ffebldListBottom list_bottom; /* For BCB, NCB, NML. */
- ffesymbol common; /* Who is my containing COMMON area? */
- ffeequiv equiv; /* Who have I been equivalenced with? */
- ffestorag storage; /* Where am I in relation to my outside
- world? */
-#ifdef FFECOM_symbolHOOK
- ffecomSymbol hook; /* Whatever the compiler/backend wants! */
+ Contributed by James Craig Burley (burley@gnu.org).
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
- ffesymbol sfa_dummy_parent; /* "X" outside sfunc "CIRC(X) = 3.14 * X". */
- ffesymbol func_result; /* FUN sym's corresponding RES sym, & vice
- versa. */
- ffetargetIntegerDefault value; /* IMMEDIATE (DATA impdo) value. */
- ffesymbolCheckState_ check_state; /* Valid name? */
- ffelexToken check_token; /* checkstatePENDING_ only. */
- int max_entry_num; /* For detecting dummy arg listed twice/IMPDO
- iterator nesting violation; also for id of
- sfunc dummy arg. */
- int num_entries; /* Number of entry points in which this
- symbol appears as a dummy arg; helps
- determine whether arg might not be passed,
- for example. */
- ffeintrinGen generic; /* Generic intrinsic id, if any. */
- ffeintrinSpec specific; /* Specific intrinsic id, if any. */
- ffeintrinImp implementation;/* Implementation id, if any. */
- bool is_save; /* SAVE flag set for this symbol (see also
- ffe_is_saveall()). */
- bool is_init; /* INIT flag set for this symbol. */
- bool do_iter; /* Is currently a DO-loop iter (can't be
- changed in loop). */
- bool reported; /* (Debug) TRUE if the latest version has
- been reported. */
- bool have_old; /* TRUE if old copy of this symbol saved
- away. */
- bool explicit_where; /* TRUE if INTRINSIC/EXTERNAL explicit. */
- bool namelisted; /* TRUE if in NAMELIST (needs static alloc). */
- };
-
-#define ffesymbol_accretes(s) ((s)->accretes)
-#define ffesymbol_accretion(s) ((s)->accretion)
-#define ffesymbol_arraysize(s) ((s)->array_size)
-#define ffesymbol_attr(s,a) ((s)->attrs & ((ffesymbolAttrs) 1 << (a)))
-#define ffesymbol_attrs(s) ((s)->attrs)
-char *ffesymbol_attrs_string (ffesymbolAttrs attrs);
-#define ffesymbol_basictype(s) ffeinfo_basictype((s)->info)
-void ffesymbol_check (ffesymbol s, ffelexToken t, bool maybe_intrin);
-#define ffesymbol_common(s) ((s)->common)
-#define ffesymbol_commonlist(s) ((s)->common_list)
-ffesymbol ffesymbol_declare_blockdataunit (ffelexToken t, ffewhereLine wl,
- ffewhereColumn wc);
-ffesymbol ffesymbol_declare_cblock (ffelexToken t, ffewhereLine wl,
- ffewhereColumn wc);
-ffesymbol ffesymbol_declare_funcnotresunit (ffelexToken t);
-ffesymbol ffesymbol_declare_funcresult (ffelexToken t);
-ffesymbol ffesymbol_declare_funcunit (ffelexToken t);
-ffesymbol ffesymbol_declare_local (ffelexToken t, bool maybe_intrin);
-ffesymbol ffesymbol_declare_programunit (ffelexToken t, ffewhereLine wl,
- ffewhereColumn wc);
-ffesymbol ffesymbol_declare_sfdummy (ffelexToken t);
-ffesymbol ffesymbol_declare_subrunit (ffelexToken t);
-#define ffesymbol_dims(s) ((s)->dims)
-#define ffesymbol_dim_syms(s) ((s)->dim_syms)
-void ffesymbol_drive (ffesymbol (*fn) ());
-void ffesymbol_drive_sfnames (ffesymbol (*fn) ());
-#define ffesymbol_dummyargs(s) ((s)->dummy_args)
-void ffesymbol_dump (ffesymbol s);
-void ffesymbol_error (ffesymbol s, ffelexToken t);
-#define ffesymbol_equiv(s) ((s)->equiv)
-#define ffesymbol_explicitwhere(s) ((s)->explicit_where)
-#define ffesymbol_extents(s) ((s)->extents)
-#define ffesymbol_first_token(s) ((s)->name == NULL ? NULL \
- : ffename_first_token((s)->name))
-#define ffesymbol_funcresult(s) ((s)->func_result)
-#define ffesymbol_generic(s) ((s)->generic)
-#define ffesymbol_global(s) ((s)->global)
-#define ffesymbol_hook(s) ((s)->hook)
-#define ffesymbol_implementation(s) ((s)->implementation)
-#define ffesymbol_info(s) ((s)->info)
-#define ffesymbol_init(s) ((s)->init)
-void ffesymbol_init_0 (void);
-void ffesymbol_init_1 (void);
-void ffesymbol_init_2 (void);
-void ffesymbol_init_3 (void);
-void ffesymbol_init_4 (void);
-#define ffesymbol_is_doiter(s) ((s)->do_iter)
-#define ffesymbol_is_dualspace(s) ((s)->other_space_name != NULL)
-#define ffesymbol_is_f2c(s) (ffe_is_f2c())
-#define ffesymbol_is_init(s) ((s)->is_init)
-#define ffesymbol_is_reported(s) ((s)->reported)
-#define ffesymbol_is_save(s) ((s)->is_save)
-#define ffesymbol_is_specable(s) ffesymbol_state_is_specable(s->state)
-#define ffesymbol_kindtype(s) ffeinfo_kindtype((s)->info)
-#define ffesymbol_kind(s) ffeinfo_kind((s)->info)
-ffesymbol ffesymbol_lookup_local (ffelexToken t);
-#define ffesymbol_maxentrynum(s) ((s)->max_entry_num)
-#define ffesymbol_name(s) ((s)->name)
-#define ffesymbol_namelist(s) ((s)->namelist)
-#define ffesymbol_namelisted(s) ((s)->namelisted)
-#define ffesymbol_numentries(s) ((s)->num_entries)
-#define ffesymbol_ptr_to_commonlist(s) (&(s)->common_list)
-#define ffesymbol_ptr_to_listbottom(s) (&(s)->list_bottom)
-#define ffesymbol_ptr_to_namelist(s) (&(s)->namelist)
-#define ffesymbol_rank(s) ffeinfo_rank((s)->info)
-void ffesymbol_reference (ffesymbol s, ffelexToken t, bool explicit);
-ffesymbol ffesymbol_report (ffesymbol s);
-void ffesymbol_report_all (void);
-void ffesymbol_resolve_intrin (ffesymbol s);
-void ffesymbol_retract (bool retract);
-bool ffesymbol_retractable (void);
-#define ffesymbol_set_accretes(s,a) ((s)->accretes = (a))
-#define ffesymbol_set_accretion(s,a) ((s)->accretion = (a))
-#define ffesymbol_set_arraysize(s,a) ((s)->array_size = (a))
-#define ffesymbol_set_attr(s,a) ((s)->attrs |= ((ffesymbolAttrs) 1 << (a)))
-#define ffesymbol_set_attrs(s,a) ((s)->attrs = (a))
-#define ffesymbol_set_common(s,c) ((s)->common = (c))
-#define ffesymbol_set_commonlist(s,c) ((s)->common_list = (c))
-#define ffesymbol_set_dims(s,d) ((s)->dims = (d))
-#define ffesymbol_set_dim_syms(s,d) ((s)->dim_syms = (d))
-#define ffesymbol_set_dummyargs(s,d) ((s)->dummy_args = (d))
-#define ffesymbol_set_equiv(s,e) ((s)->equiv = (e))
-#define ffesymbol_set_explicitwhere(s,e) ((s)->explicit_where = (e))
-#define ffesymbol_set_extents(s,e) ((s)->extents = (e))
-#define ffesymbol_set_funcresult(s,f) ((s)->func_result = (f))
-#define ffesymbol_set_generic(s,g) ((s)->generic = (g))
-#define ffesymbol_set_global(s,g) ((s)->global = (g))
-#define ffesymbol_set_hook(s,h) ((s)->hook = (h))
-#define ffesymbol_set_implementation(s,im) ((s)->implementation = (im))
-#define ffesymbol_set_init(s,i) ((s)->init = (i))
-#define ffesymbol_set_info(s,i) ((s)->info = (i))
-#define ffesymbol_set_is_doiter(s,f) ((s)->do_iter = (f))
-#define ffesymbol_set_is_init(s,in) ((s)->is_init = (in))
-#define ffesymbol_set_is_save(s,sa) ((s)->is_save = (sa))
-#define ffesymbol_set_maxentrynum(s,m) ((s)->max_entry_num = (m))
-#define ffesymbol_set_namelist(s,n) ((s)->namelist = (n))
-#define ffesymbol_set_namelisted(s,n) ((s)->namelisted = (n))
-#define ffesymbol_set_numentries(s,n) ((s)->num_entries = (n))
-void ffesymbol_set_retractable (mallocPool pool);
-#define ffesymbol_set_sfexpr(s,e) ((s)->sfunc_expr = (e))
-#define ffesymbol_set_specific(s,sp) ((s)->specific = (sp))
-#define ffesymbol_set_state(s,st) ((s)->state = (st))
-#define ffesymbol_set_storage(s,st) ((s)->storage = (st))
-#define ffesymbol_set_value(s,v) ((s)->value = (v))
-#define ffesymbol_sfdummyparent(s) ((s)->sfa_dummy_parent)
-#define ffesymbol_sfexpr(s) ((s)->sfunc_expr)
-void ffesymbol_signal_change (ffesymbol s);
-#define ffesymbol_signal_unreported(s) ((s)->reported = FALSE)
-#define ffesymbol_size(s) ffeinfo_size((s)->info)
-#define ffesymbol_specific(s) ((s)->specific)
-#define ffesymbol_state(s) ((s)->state)
-#define ffesymbol_state_is_specable(s) ((s) <= FFESYMBOL_stateSEEN)
-char *ffesymbol_state_string (ffesymbolState state);
-#define ffesymbol_storage(s) ((s)->storage)
-void ffesymbol_terminate_0 (void);
-void ffesymbol_terminate_1 (void);
-void ffesymbol_terminate_2 (void);
-void ffesymbol_terminate_3 (void);
-void ffesymbol_terminate_4 (void);
-#define ffesymbol_text(s) (((s)->name == NULL) ? "<->" : ffename_text((s)->name))
-void ffesymbol_update_init (ffesymbol s);
-void ffesymbol_update_save (ffesymbol s);
-#define ffesymbol_value(s) ((s)->value)
-#define ffesymbol_where(s) ffeinfo_where((s)->info)
-#define ffesymbol_where_column(s) (((s)->name == NULL) \
- ? ffewhere_column_unknown() : ffename_where_column((s)->name))
-#define ffesymbol_where_filename(s) \
- ffewhere_line_filename(ffesymbol_where_line(s))
-#define ffesymbol_where_filelinenum(s) \
- ffewhere_line_filelinenum(ffesymbol_where_line(s))
-#define ffesymbol_where_line(s) (((s)->name == NULL) ? ffewhere_line_unknown() \
- : ffename_where_line((s)->name))
-
+#if FFECOM_targetCURRENT == FFECOM_targetFFE
#endif
diff --git a/gcc/f/target.c b/gcc/f/target.c
index 638a71ae3dd..5de05ff07ca 100644
--- a/gcc/f/target.c
+++ b/gcc/f/target.c
@@ -1,6 +1,6 @@
/* target.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1998 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -69,7 +69,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Include files. */
#include "proj.h"
-#include <ctype.h>
#include "glimits.j"
#include "target.h"
#include "bad.h"
@@ -131,7 +130,7 @@ ffetarget_print_char_ (FILE *f, unsigned char c)
break;
default:
- if (isprint (c) && isascii (c))
+ if (ISPRINT (c))
fputc (c, f);
else
fprintf (f, "\\%03o", (unsigned int) c);
@@ -215,17 +214,22 @@ ffetarget_align (ffetargetAlign *updated_alignment,
ffetargetAlign i;
ffetargetAlign j;
+ assert (alignment > 0);
+ assert (*updated_alignment > 0);
+
assert (*updated_modulo < *updated_alignment);
assert (modulo < alignment);
- /* The easy case: similar alignment requirements. */
-
+ /* The easy case: similar alignment requirements. */
if (*updated_alignment == alignment)
{
if (modulo > *updated_modulo)
pad = alignment - (modulo - *updated_modulo);
else
pad = *updated_modulo - modulo;
+ if (offset < 0)
+ /* De-negatize offset, since % wouldn't do the expected thing. */
+ offset = alignment - ((- offset) % alignment);
pad = (offset + pad) % alignment;
if (pad != 0)
pad = alignment - pad;
@@ -241,7 +245,12 @@ ffetarget_align (ffetargetAlign *updated_alignment,
cnt = ua / alignment;
- min_pad = ~(ffetargetAlign) 0;/* Set to largest value. */
+ if (offset < 0)
+ /* De-negatize offset, since % wouldn't do the expected thing. */
+ offset = ua - ((- offset) % ua);
+
+ /* Set to largest value. */
+ min_pad = ~(ffetargetAlign) 0;
/* Find all combinations of modulo values the two alignment requirements
have; pick the combination that results in the smallest padding
@@ -252,21 +261,20 @@ ffetarget_align (ffetargetAlign *updated_alignment,
{
for (m = modulo, j = 0; j < cnt; m += alignment, ++j)
{
- if (m > um) /* This code is similar to the "easy case"
- code above. */
+ /* This code is similar to the "easy case" code above. */
+ if (m > um)
pad = ua - (m - um);
else
pad = um - m;
pad = (offset + pad) % ua;
- if (pad != 0)
- pad = ua - pad;
- else
- { /* A zero pad means we've got something
- useful. */
+ if (pad == 0)
+ {
+ /* A zero pad means we've got something useful. */
*updated_alignment = ua;
*updated_modulo = um;
return 0;
}
+ pad = ua - pad;
if (pad < min_pad)
{ /* New minimum padding value. */
min_pad = pad;
@@ -2386,7 +2394,7 @@ ffetarget_typeless_binary (ffetargetTypeless *xvalue, ffelexToken token)
new_value <<= 1;
if ((new_value >> 1) != value)
overflow = TRUE;
- if (isdigit (c))
+ if (ISDIGIT (c))
new_value += c - '0';
else
bad_digit = TRUE;
@@ -2430,7 +2438,7 @@ ffetarget_typeless_octal (ffetargetTypeless *xvalue, ffelexToken token)
new_value <<= 3;
if ((new_value >> 3) != value)
overflow = TRUE;
- if (isdigit (c))
+ if (ISDIGIT (c))
new_value += c - '0';
else
bad_digit = TRUE;
@@ -2474,7 +2482,7 @@ ffetarget_typeless_hex (ffetargetTypeless *xvalue, ffelexToken token)
new_value <<= 4;
if ((new_value >> 4) != value)
overflow = TRUE;
- if (isdigit (c))
+ if (ISDIGIT (c))
new_value += c - '0';
else if ((c >= 'A') && (c <= 'F'))
new_value += c - 'A' + 10;
diff --git a/gcc/f/target.h b/gcc/f/target.h
index 216d7704bd3..5bf37928672 100644
--- a/gcc/f/target.h
+++ b/gcc/f/target.h
@@ -1,1865 +1 @@
-/* target.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- target.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_target
-#define _H_f_target
-
-#ifdef FFE_STANDALONE
-#define HOST_WIDE_INT long
-#else
-#ifndef TREE_CODE
-#include "tree.j"
-#endif
-#endif
-
-/* For now, g77 requires the ability to determine the exact bit pattern
- of a float on the target machine. (Hopefully this will be changed
- soon). Make sure we can do this. */
-
-#if !defined (REAL_ARITHMETIC) \
- && ((TARGET_FLOAT_FORMAT != HOST_FLOAT_FORMAT) \
- || (FLOAT_WORDS_BIG_ENDIAN != HOST_FLOAT_WORDS_BIG_ENDIAN))
-#error "g77 requires ability to access exact FP representation of target machine"
-#endif
-
-/* Simple definitions and enumerations. */
-
-#define FFETARGET_charactersizeNONE (-1)
-#ifndef FFETARGET_charactersizeMAXIMUM
-#define FFETARGET_charactersizeMAXIMUM 2147483647
-#endif
-
-#ifndef FFETARGET_defaultIS_90
-#define FFETARGET_defaultIS_90 0
-#endif
-#ifndef FFETARGET_defaultIS_AUTOMATIC
-#define FFETARGET_defaultIS_AUTOMATIC 1
-#endif
-#ifndef FFETARGET_defaultIS_BACKSLASH
-#define FFETARGET_defaultIS_BACKSLASH 1
-#endif
-#ifndef FFETARGET_defaultIS_INIT_LOCAL_ZERO
-#define FFETARGET_defaultIS_INIT_LOCAL_ZERO 0
-#endif
-#ifndef FFETARGET_defaultIS_DOLLAR_OK
-#define FFETARGET_defaultIS_DOLLAR_OK 0
-#endif
-#ifndef FFETARGET_defaultIS_F2C
-#define FFETARGET_defaultIS_F2C 1
-#endif
-#ifndef FFETARGET_defaultIS_F2C_LIBRARY
-#define FFETARGET_defaultIS_F2C_LIBRARY 1
-#endif
-#ifndef FFETARGET_defaultIS_FREE_FORM
-#define FFETARGET_defaultIS_FREE_FORM 0
-#endif
-#ifndef FFETARGET_defaultIS_PEDANTIC
-#define FFETARGET_defaultIS_PEDANTIC 0
-#endif
-#ifndef FFETARGET_defaultCASE_INTRIN
-#define FFETARGET_defaultCASE_INTRIN FFE_caseLOWER
-#endif
-#ifndef FFETARGET_defaultCASE_MATCH
-#define FFETARGET_defaultCASE_MATCH FFE_caseLOWER
-#endif
-#ifndef FFETARGET_defaultCASE_SOURCE
-#define FFETARGET_defaultCASE_SOURCE FFE_caseLOWER
-#endif
-#ifndef FFETARGET_defaultCASE_SYMBOL
-#define FFETARGET_defaultCASE_SYMBOL FFE_caseNONE
-#endif
-
-#ifndef FFETARGET_defaultFIXED_LINE_LENGTH
-#define FFETARGET_defaultFIXED_LINE_LENGTH 72
-#endif
-
-/* 1 if external Fortran names ("FOO" in SUBROUTINE FOO, COMMON /FOO/,
- and even enforced/default-for-unnamed PROGRAM, blank-COMMON, and
- BLOCK DATA names, but not names of library functions implementing
- intrinsics or names of local/internal variables) should have an
- underscore appended (for compatibility with existing systems). */
-
-#ifndef FFETARGET_defaultEXTERNAL_UNDERSCORED
-#define FFETARGET_defaultEXTERNAL_UNDERSCORED 1
-#endif
-
-/* 1 if external Fortran names with underscores already in them should
- have an extra underscore appended (in addition to the one they
- might already have appened if FFETARGET_defaultEXTERNAL_UNDERSCORED). */
-
-#ifndef FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED
-#define FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED 1
-#endif
-
-/* If FFETARGET_defaultEXTERNAL_UNDERSCORED is 0, the following definitions
- might also need to be overridden to make g77 objects compatible with
- f2c+gcc objects. Although I don't think the unnamed BLOCK DATA one
- is an issue at all. Of course, on some systems it isn't f2c
- compatibility that is the issue -- maybe compatibility with some
- other compiler(s). I don't know what to recommend for systems where
- there is no existing Fortran compiler -- I suppose porting f2c and
- pretending it's the existing one is best for now. */
-
-/* 1 if the "FOO" in "PROGRAM FOO" should be overridden and a particular
- name imposed in place of it in the actual code (normally the case,
- because the library's main entry point on most systems calls the main
- function by a particular name). Someday g77 might do the f2c trick
- of also outputting a "FOO" procedure that just calls the main procedure,
- but that'll wait until somebody shows why it is needed. */
-
-#ifndef FFETARGET_isENFORCED_MAIN
-#define FFETARGET_isENFORCED_MAIN 1
-#endif
-
-/* The enforced name of the main program if ENFORCED_MAIN is 1. */
-
-#ifndef FFETARGET_nameENFORCED_MAIN_NAME
-#define FFETARGET_nameENFORCED_MAIN_NAME "MAIN__"
-#endif
-
-/* The name used for an unnamed main program if ENFORCED_MAIN is 0. */
-
-#ifndef FFETARGET_nameUNNAMED_MAIN
-#define FFETARGET_nameUNNAMED_MAIN "MAIN__"
-#endif
-
-/* The name used for an unnamed block data program. */
-
-#ifndef FFETARGET_nameUNNAMED_BLOCK_DATA
-#define FFETARGET_nameUNNAMED_BLOCK_DATA "_BLOCK_DATA__"
-#endif
-
-/* The name used for blank common. */
-
-#ifndef FFETARGET_nameBLANK_COMMON
-#define FFETARGET_nameBLANK_COMMON "_BLNK__"
-#endif
-
-#ifndef FFETARGET_integerSMALLEST_POSITIVE
-#define FFETARGET_integerSMALLEST_POSITIVE 0
-#endif
-#ifndef FFETARGET_integerLARGEST_POSITIVE
-#define FFETARGET_integerLARGEST_POSITIVE 2147483647
-#endif
-#ifndef FFETARGET_integerBIG_MAGICAL
-#define FFETARGET_integerBIG_MAGICAL 020000000000 /* 2147483648 */
-#endif
-#ifndef FFETARGET_integerALMOST_BIG_MAGICAL
-#define FFETARGET_integerALMOST_BIG_MAGICAL 214748364
-#endif
-#ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY
-#define FFETARGET_integerALMOST_BIG_OVERFLOW_BINARY 0x80000000
-#endif
-#ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_HEX
-#define FFETARGET_integerALMOST_BIG_OVERFLOW_HEX 0x10000000
-#endif
-#ifndef FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL
-#define FFETARGET_integerALMOST_BIG_OVERFLOW_OCTAL 0x20000000
-#endif
-#ifndef FFETARGET_integerFINISH_BIG_MAGICAL
-#define FFETARGET_integerFINISH_BIG_MAGICAL 8
-#endif
-#ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY
-#define FFETARGET_integerFINISH_BIG_OVERFLOW_BINARY 0
-#endif
-#ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_HEX
-#define FFETARGET_integerFINISH_BIG_OVERFLOW_HEX 0
-#endif
-#ifndef FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL
-#define FFETARGET_integerFINISH_BIG_OVERFLOW_OCTAL 0
-#endif
-
-#ifndef FFETARGET_offsetNONE
-#define FFETARGET_offsetNONE 0 /* Not used by FFE, for backend if needed. */
-#endif
-
-#define FFETARGET_okINTEGER1 1
-#define FFETARGET_okINTEGER2 1
-#define FFETARGET_okINTEGER3 1
-#define FFETARGET_okINTEGER4 1
-#define FFETARGET_okLOGICAL1 1
-#define FFETARGET_okLOGICAL2 1
-#define FFETARGET_okLOGICAL3 1
-#define FFETARGET_okLOGICAL4 1
-#define FFETARGET_okREAL1 1
-#define FFETARGET_okREAL2 1
-#define FFETARGET_okREAL3 0
-#define FFETARGET_okREALQUAD FFETARGET_okREAL3
-#define FFETARGET_okCOMPLEX1 1
-#define FFETARGET_okCOMPLEX2 1
-#define FFETARGET_okCOMPLEX3 0
-#define FFETARGET_okCOMPLEXDOUBLE FFETARGET_okCOMPLEX2
-#define FFETARGET_okCOMPLEXQUAD FFETARGET_okCOMPLEX3
-#define FFETARGET_okCHARACTER1 1
-
-#define FFETARGET_f2cTYUNKNOWN 0
-#define FFETARGET_f2cTYADDR 1
-#define FFETARGET_f2cTYSHORT 2
-#define FFETARGET_f2cTYLONG 3
-#define FFETARGET_f2cTYREAL 4
-#define FFETARGET_f2cTYDREAL 5
-#define FFETARGET_f2cTYCOMPLEX 6
-#define FFETARGET_f2cTYDCOMPLEX 7
-#define FFETARGET_f2cTYLOGICAL 8
-#define FFETARGET_f2cTYCHAR 9
-#define FFETARGET_f2cTYSUBR 10
-#define FFETARGET_f2cTYINT1 11
-#define FFETARGET_f2cTYLOGICAL1 12
-#define FFETARGET_f2cTYLOGICAL2 13
-#define FFETARGET_f2cTYQUAD 14
-
-/* Typedefs. */
-
-typedef unsigned char ffetargetAlign; /* ffetargetOffset for alignment. */
-#define ffetargetAlign_f ""
-typedef long ffetargetCharacterSize;
-#define ffetargetCharacterSize_f "l"
-typedef void (*ffetargetCopyfunc) (void *, void *, size_t);
-typedef ffetargetCharacterSize ffetargetHollerithSize;
-#define ffetargetHollerithSize_f "l"
-typedef long long ffetargetOffset;
-#define ffetargetOffset_f "ll"
-
-#if FFETARGET_okINTEGER1
-#ifndef __alpha__
-typedef long int ffetargetInteger1;
-#define ffetargetInteger1_f "l"
-#else
-typedef int ffetargetInteger1;
-#define ffetargetInteger1_f ""
-#endif
-#endif
-#if FFETARGET_okINTEGER2
-typedef signed char ffetargetInteger2;
-#define ffetargetInteger2_f ""
-#endif
-#if FFETARGET_okINTEGER3
-typedef short int ffetargetInteger3;
-#define ffetargetInteger3_f ""
-#endif
-#if FFETARGET_okINTEGER4
-typedef long long int ffetargetInteger4;
-#define ffetargetInteger4_f "ll"
-#endif
-#if FFETARGET_okINTEGER5
-typedef ? ffetargetInteger5;
-#define ffetargetInteger5_f
-?
-#endif
-#if FFETARGET_okINTEGER6
-typedef ? ffetargetInteger6;
-#define ffetargetInteger6_f
-?
-#endif
-#if FFETARGET_okINTEGER7
-typedef ? ffetargetInteger7;
-#define ffetargetInteger7_f
-?
-#endif
-#if FFETARGET_okINTEGER8
-typedef ? ffetargetInteger8;
-#define ffetargetInteger8_f
-?
-#endif
-#if FFETARGET_okLOGICAL1
-#ifndef __alpha__
-typedef long int ffetargetLogical1;
-#define ffetargetLogical1_f "l"
-#else
-typedef int ffetargetLogical1;
-#define ffetargetLogical1_f ""
-#endif
-#endif
-#if FFETARGET_okLOGICAL2
-typedef signed char ffetargetLogical2;
-#define ffetargetLogical2_f ""
-#endif
-#if FFETARGET_okLOGICAL3
-typedef short int ffetargetLogical3;
-#define ffetargetLogical3_f ""
-#endif
-#if FFETARGET_okLOGICAL4
-typedef long long int ffetargetLogical4;
-#define ffetargetLogical4_f "ll"
-#endif
-#if FFETARGET_okLOGICAL5
-typedef ? ffetargetLogical5;
-#define ffetargetLogical5_f
-?
-#endif
-#if FFETARGET_okLOGICAL6
-typedef ? ffetargetLogical6;
-#define ffetargetLogical6_f
-?
-#endif
-#if FFETARGET_okLOGICAL7
-typedef ? ffetargetLogical7;
-#define ffetargetLogical7_f
-?
-#endif
-#if FFETARGET_okLOGICAL8
-typedef ? ffetargetLogical8;
-#define ffetargetLogical8_f
-?
-#endif
-#if FFETARGET_okREAL1
-#ifdef REAL_ARITHMETIC
-#ifndef __alpha__
-typedef long int ffetargetReal1;
-#define ffetargetReal1_f "l"
-#define ffetarget_cvt_r1_to_rv_ REAL_VALUE_UNTO_TARGET_SINGLE
-#define ffetarget_cvt_rv_to_r1_ REAL_VALUE_TO_TARGET_SINGLE
-#else
-typedef int ffetargetReal1;
-#define ffetargetReal1_f ""
-#define ffetarget_cvt_r1_to_rv_(in) \
- ({ REAL_VALUE_TYPE _rv; \
- _rv = REAL_VALUE_UNTO_TARGET_SINGLE ((long) (in)); \
- _rv; })
-#define ffetarget_cvt_rv_to_r1_(in, out) \
- ({ long _tmp; \
- REAL_VALUE_TO_TARGET_SINGLE ((in), _tmp); \
- (out) = (ffetargetReal1) _tmp; })
-#endif
-#else /* REAL_ARITHMETIC */
-typedef float ffetargetReal1;
-#define ffetargetReal1_f ""
-#endif /* REAL_ARITHMETIC */
-#endif
-#if FFETARGET_okREAL2
-#ifdef REAL_ARITHMETIC
-#ifndef __alpha__
-typedef struct
- {
- long int v[2];
- }
-ffetargetReal2;
-#define ffetargetReal2_f "l"
-#define ffetarget_cvt_r2_to_rv_ REAL_VALUE_UNTO_TARGET_DOUBLE
-#define ffetarget_cvt_rv_to_r2_ REAL_VALUE_TO_TARGET_DOUBLE
-#else
-typedef struct
- {
- int v[2];
- }
-ffetargetReal2;
-#define ffetargetReal2_f ""
-#define ffetarget_cvt_r2_to_rv_(in) \
- ({ REAL_VALUE_TYPE _rv; \
- long _tmp[2]; \
- _tmp[0] = (in)[0]; \
- _tmp[1] = (in)[1]; \
- _rv = REAL_VALUE_UNTO_TARGET_DOUBLE (_tmp); \
- _rv; })
-#define ffetarget_cvt_rv_to_r2_(in, out) \
- ({ long _tmp[2]; \
- REAL_VALUE_TO_TARGET_DOUBLE ((in), _tmp); \
- (out)[0] = (int) (_tmp[0]); \
- (out)[1] = (int) (_tmp[1]); })
-#endif
-#else
-typedef double ffetargetReal2;
-#define ffetargetReal2_f ""
-#endif
-#endif
-#if FFETARGET_okREAL3
-#ifdef REAL_ARITHMETIC
-typedef long ffetargetReal3[?];
-#else
-typedef ? ffetargetReal3;
-#define ffetargetReal3_f
-#endif
-?
-#endif
-#if FFETARGET_okREAL4
-#ifdef REAL_ARITHMETIC
-typedef long ffetargetReal4[?];
-#else
-typedef ? ffetargetReal4;
-#define ffetargetReal4_f
-#endif
-?
-#endif
-#if FFETARGET_okREAL5
-#ifdef REAL_ARITHMETIC
-typedef long ffetargetReal5[?];
-#else
-typedef ? ffetargetReal5;
-#define ffetargetReal5_f
-#endif
-?
-#endif
-#if FFETARGET_okREAL6
-#ifdef REAL_ARITHMETIC
-typedef long ffetargetReal6[?];
-#else
-typedef ? ffetargetReal6;
-#define ffetargetReal6_f
-#endif
-?
-#endif
-#if FFETARGET_okREAL7
-#ifdef REAL_ARITHMETIC
-typedef long ffetargetReal7[?];
-#else
-typedef ? ffetargetReal7;
-#define ffetargetReal7_f
-#endif
-?
-#endif
-#if FFETARGET_okREAL8
-#ifdef REAL_ARITHMETIC
-typedef long ffetargetReal8[?];
-#else
-typedef ? ffetargetReal8;
-#define ffetargetReal8_f
-#endif
-?
-#endif
-#if FFETARGET_okCOMPLEX1
-struct _ffetarget_complex_1_
- {
- ffetargetReal1 real;
- ffetargetReal1 imaginary;
- };
-typedef struct _ffetarget_complex_1_ ffetargetComplex1;
-#endif
-#if FFETARGET_okCOMPLEX2
-struct _ffetarget_complex_2_
- {
- ffetargetReal2 real;
- ffetargetReal2 imaginary;
- };
-typedef struct _ffetarget_complex_2_ ffetargetComplex2;
-#endif
-#if FFETARGET_okCOMPLEX3
-struct _ffetarget_complex_3_
- {
- ffetargetReal3 real;
- ffetargetReal3 imaginary;
- };
-typedef struct _ffetarget_complex_3_ ffetargetComplex3;
-#endif
-#if FFETARGET_okCOMPLEX4
-struct _ffetarget_complex_4_
- {
- ffetargetReal4 real;
- ffetargetReal4 imaginary;
- };
-typedef struct _ffetarget_complex_4_ ffetargetComplex4;
-#endif
-#if FFETARGET_okCOMPLEX5
-struct _ffetarget_complex_5_
- {
- ffetargetReal5 real;
- ffetargetReal5 imaginary;
- };
-typedef struct _ffetarget_complex_5_ ffetargetComplex5;
-#endif
-#if FFETARGET_okCOMPLEX6
-struct _ffetarget_complex_6_
- {
- ffetargetReal6 real;
- ffetargetReal6 imaginary;
- };
-typedef struct _ffetarget_complex_6_ ffetargetComplex6;
-#endif
-#if FFETARGET_okCOMPLEX7
-struct _ffetarget_complex_7_
- {
- ffetargetReal7 real;
- ffetargetReal7 imaginary;
- };
-typedef struct _ffetarget_complex_7_ ffetargetComplex7;
-#endif
-#if FFETARGET_okCOMPLEX8
-struct _ffetarget_complex_8_
- {
- ffetargetReal8 real;
- ffetargetReal8 imaginary;
- };
-typedef struct _ffetarget_complex_8_ ffetargetComplex8;
-#endif
-#if FFETARGET_okCHARACTER1
-struct _ffetarget_char_1_
- {
- ffetargetCharacterSize length;
- unsigned char *text;
- };
-typedef struct _ffetarget_char_1_ ffetargetCharacter1;
-typedef unsigned char ffetargetCharacterUnit1;
-#endif
-#if FFETARGET_okCHARACTER2
-typedef ? ffetargetCharacter2;
-typedef ? ffetargetCharacterUnit2;
-#endif
-#if FFETARGET_okCHARACTER3
-typedef ? ffetargetCharacter3;
-typedef ? ffetargetCharacterUnit3;
-#endif
-#if FFETARGET_okCHARACTER4
-typedef ? ffetargetCharacter4;
-typedef ? ffetargetCharacterUnit4;
-#endif
-#if FFETARGET_okCHARACTER5
-typedef ? ffetargetCharacter5;
-typedef ? ffetargetCharacterUnit5;
-#endif
-#if FFETARGET_okCHARACTER6
-typedef ? ffetargetCharacter6;
-typedef ? ffetargetCharacterUnit6;
-#endif
-#if FFETARGET_okCHARACTER7
-typedef ? ffetargetCharacter7;
-typedef ? ffetargetCharacterUnit7;
-#endif
-#if FFETARGET_okCHARACTER8
-typedef ? ffetargetCharacter8;
-typedef ? ffetargetCharacterUnit8;
-#endif
-
-typedef unsigned long long int ffetargetTypeless;
-
-struct _ffetarget_hollerith_
- {
- ffetargetHollerithSize length;
- unsigned char *text;
- };
-typedef struct _ffetarget_hollerith_ ffetargetHollerith;
-
-typedef ffetargetCharacter1 ffetargetCharacterDefault;
-typedef ffetargetComplex1 ffetargetComplexDefault;
-#if FFETARGET_okCOMPLEXDOUBLE
-typedef ffetargetComplex2 ffetargetComplexDouble;
-#endif
-#if FFETARGET_okCOMPLEXQUAD
-typedef ffetargetComplex3 ffetargetComplexQuad;
-#endif
-typedef ffetargetInteger1 ffetargetIntegerDefault;
-#define ffetargetIntegerDefault_f ffetargetInteger1_f
-typedef ffetargetLogical1 ffetargetLogicalDefault;
-#define ffetargetLogicalDefault_f ffetargetLogical1_f
-typedef ffetargetReal1 ffetargetRealDefault;
-#define ffetargetRealDefault_f ffetargetReal1_f
-typedef ffetargetReal2 ffetargetRealDouble;
-#define ffetargetRealDouble_f ffetargetReal2_f
-#if FFETARGET_okREALQUAD
-typedef ffetargetReal3 ffetargetRealQuad;
-#define ffetargetRealQuad_f ffetargetReal3_f
-#endif
-
-/* Include files needed by this one. */
-
-#include "bad.h"
-#include "info.h"
-#include "lex.h"
-#include "malloc.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-extern char ffetarget_string_[40]; /* Temp for ascii-to-double (atof). */
-extern HOST_WIDE_INT ffetarget_long_val_;
-extern HOST_WIDE_INT ffetarget_long_junk_;
-
-/* Declare functions with prototypes. */
-
-void ffetarget_aggregate_info (ffeinfoBasictype *ebt, ffeinfoKindtype *ekt,
- ffetargetAlign *units, ffeinfoBasictype abt,
- ffeinfoKindtype akt);
-ffetargetAlign ffetarget_align (ffetargetAlign *updated_alignment,
- ffetargetAlign *updated_modulo,
- ffetargetOffset offset,
- ffetargetAlign alignment,
- ffetargetAlign modulo);
-#if FFETARGET_okCHARACTER1
-bool ffetarget_character1 (ffetargetCharacter1 *val, ffelexToken character,
- mallocPool pool);
-int ffetarget_cmp_character1 (ffetargetCharacter1 l, ffetargetCharacter1 r);
-ffebad ffetarget_concatenate_character1 (ffetargetCharacter1 *res,
- ffetargetCharacter1 l,
- ffetargetCharacter1 r,
- mallocPool pool,
- ffetargetCharacterSize *len);
-ffebad ffetarget_convert_character1_character1 (ffetargetCharacter1 *res,
- ffetargetCharacterSize res_size,
- ffetargetCharacter1 l,
- mallocPool pool);
-ffebad ffetarget_convert_character1_hollerith (ffetargetCharacter1 *res,
- ffetargetCharacterSize res_size,
- ffetargetHollerith l,
- mallocPool pool);
-ffebad ffetarget_convert_character1_integer4 (ffetargetCharacter1 *res,
- ffetargetCharacterSize res_size,
- ffetargetInteger4 l,
- mallocPool pool);
-ffebad ffetarget_convert_character1_logical4 (ffetargetCharacter1 *res,
- ffetargetCharacterSize res_size,
- ffetargetLogical4 l,
- mallocPool pool);
-ffebad ffetarget_convert_character1_typeless (ffetargetCharacter1 *res,
- ffetargetCharacterSize res_size,
- ffetargetTypeless l,
- mallocPool pool);
-ffebad ffetarget_eq_character1 (bool *res, ffetargetCharacter1 l,
- ffetargetCharacter1 r);
-ffebad ffetarget_le_character1 (bool *res, ffetargetCharacter1 l,
- ffetargetCharacter1 r);
-ffebad ffetarget_ge_character1 (bool *res, ffetargetCharacter1 l,
- ffetargetCharacter1 r);
-ffebad ffetarget_gt_character1 (bool *res, ffetargetCharacter1 l,
- ffetargetCharacter1 r);
-ffebad ffetarget_lt_character1 (bool *res, ffetargetCharacter1 l,
- ffetargetCharacter1 r);
-ffebad ffetarget_ne_character1 (bool *res, ffetargetCharacter1 l,
- ffetargetCharacter1 r);
-ffebad ffetarget_substr_character1 (ffetargetCharacter1 *res,
- ffetargetCharacter1 l,
- ffetargetCharacterSize first,
- ffetargetCharacterSize last,
- mallocPool pool,
- ffetargetCharacterSize *len);
-#endif
-int ffetarget_cmp_hollerith (ffetargetHollerith l, ffetargetHollerith r);
-bool ffetarget_hollerith (ffetargetHollerith *val, ffelexToken hollerith,
- mallocPool pool);
-int ffetarget_cmp_typeless (ffetargetTypeless l, ffetargetTypeless r);
-ffebad ffetarget_convert_any_character1_ (char *res, size_t size,
- ffetargetCharacter1 l);
-ffebad ffetarget_convert_any_hollerith_ (char *res, size_t size,
- ffetargetHollerith l);
-ffebad ffetarget_convert_any_typeless_ (char *res, size_t size,
- ffetargetTypeless l);
-#if FFETARGET_okCOMPLEX1
-ffebad ffetarget_divide_complex1 (ffetargetComplex1 *res, ffetargetComplex1 l,
- ffetargetComplex1 r);
-#endif
-#if FFETARGET_okCOMPLEX2
-ffebad ffetarget_divide_complex2 (ffetargetComplex2 *res, ffetargetComplex2 l,
- ffetargetComplex2 r);
-#endif
-#if FFETARGET_okCOMPLEX3
-ffebad ffetarget_divide_complex3 (ffetargetComplex3 *res, ffetargetComplex3 l,
- ffetargetComplex3 r);
-#endif
-#if FFETARGET_okCOMPLEX4
-ffebad ffetarget_divide_complex4 (ffetargetComplex4 *res, ffetargetComplex4 l,
- ffetargetComplex4 r);
-#endif
-#if FFETARGET_okCOMPLEX5
-ffebad ffetarget_divide_complex5 (ffetargetComplex5 *res, ffetargetComplex5 l,
- ffetargetComplex5 r);
-#endif
-#if FFETARGET_okCOMPLEX6
-ffebad ffetarget_divide_complex6 (ffetargetComplex6 *res, ffetargetComplex6 l,
- ffetargetComplex6 r);
-#endif
-#if FFETARGET_okCOMPLEX7
-ffebad ffetarget_divide_complex7 (ffetargetComplex7 *res, ffetargetComplex7 l,
- ffetargetComplex7 r);
-#endif
-#if FFETARGET_okCOMPLEX8
-ffebad ffetarget_divide_complex8 (ffetargetComplex8 *res, ffetargetComplex8 l,
- ffetargetComplex8 r);
-#endif
-#if FFETARGET_okINTEGER1
-bool ffetarget_integer1 (ffetargetInteger1 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER2
-bool ffetarget_integer2 (ffetargetInteger2 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER3
-bool ffetarget_integer3 (ffetargetInteger3 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER4
-bool ffetarget_integer4 (ffetargetInteger4 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER5
-bool ffetarget_integer5 (ffetargetInteger5 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER6
-bool ffetarget_integer6 (ffetargetInteger6 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER7
-bool ffetarget_integer7 (ffetargetInteger7 *val, ffelexToken integer);
-#endif
-#if FFETARGET_okINTEGER8
-bool ffetarget_integer8 (ffetargetInteger8 *val, ffelexToken integer);
-#endif
-bool ffetarget_integerbinary (ffetargetIntegerDefault *val,
- ffelexToken integer);
-bool ffetarget_integerhex (ffetargetIntegerDefault *val,
- ffelexToken integer);
-bool ffetarget_integeroctal (ffetargetIntegerDefault *val,
- ffelexToken integer);
-void ffetarget_integer_bad_magical (ffelexToken t);
-void ffetarget_integer_bad_magical_binary (ffelexToken integer, ffelexToken minus);
-void ffetarget_integer_bad_magical_precedence (ffelexToken integer,
- ffelexToken uminus,
- ffelexToken higher_op);
-void ffetarget_integer_bad_magical_precedence_binary (ffelexToken integer,
- ffelexToken minus,
- ffelexToken higher_op);
-#if FFETARGET_okCHARACTER1
-bool ffetarget_iszero_character1 (ffetargetCharacter1 constant);
-#endif
-bool ffetarget_iszero_hollerith (ffetargetHollerith constant);
-void ffetarget_layout (char *error_text, ffetargetAlign *alignment,
- ffetargetAlign *modulo, ffetargetOffset *size,
- ffeinfoBasictype bt, ffeinfoKindtype kt,
- ffetargetCharacterSize charsize,
- ffetargetIntegerDefault num_elements);
-#if FFETARGET_okCOMPLEX1
-ffebad ffetarget_multiply_complex1 (ffetargetComplex1 *res,
- ffetargetComplex1 l,
- ffetargetComplex1 r);
-#endif
-#if FFETARGET_okCOMPLEX2
-ffebad ffetarget_multiply_complex2 (ffetargetComplex2 *res,
- ffetargetComplex2 l,
- ffetargetComplex2 r);
-#endif
-#if FFETARGET_okCOMPLEX3
-ffebad ffetarget_multiply_complex3 (ffetargetComplex3 *res,
- ffetargetComplex3 l,
- ffetargetComplex3 r);
-#endif
-#if FFETARGET_okCOMPLEX4
-ffebad ffetarget_multiply_complex4 (ffetargetComplex4 *res,
- ffetargetComplex4 l,
- ffetargetComplex4 r);
-#endif
-#if FFETARGET_okCOMPLEX5
-ffebad ffetarget_multiply_complex5 (ffetargetComplex5 *res,
- ffetargetComplex5 l,
- ffetargetComplex5 r);
-#endif
-#if FFETARGET_okCOMPLEX6
-ffebad ffetarget_multiply_complex6 (ffetargetComplex6 *res,
- ffetargetComplex6 l,
- ffetargetComplex6 r);
-#endif
-#if FFETARGET_okCOMPLEX7
-ffebad ffetarget_multiply_complex7 (ffetargetComplex7 *res,
- ffetargetComplex7 l,
- ffetargetComplex7 r);
-#endif
-#if FFETARGET_okCOMPLEX8
-ffebad ffetarget_multiply_complex8 (ffetargetComplex8 *res,
- ffetargetComplex8 l,
- ffetargetComplex8 r);
-#endif
-ffebad ffetarget_power_complexdefault_integerdefault (ffetargetComplexDefault *res,
- ffetargetComplexDefault l,
- ffetargetIntegerDefault r);
-#if FFETARGET_okCOMPLEXDOUBLE
-ffebad ffetarget_power_complexdouble_integerdefault (ffetargetComplexDouble *res,
- ffetargetComplexDouble l,
- ffetargetIntegerDefault r);
-#endif
-ffebad ffetarget_power_integerdefault_integerdefault (ffetargetIntegerDefault *res,
- ffetargetIntegerDefault l,
- ffetargetIntegerDefault r);
-ffebad ffetarget_power_realdefault_integerdefault (ffetargetRealDefault *res,
- ffetargetRealDefault l,
- ffetargetIntegerDefault r);
-ffebad ffetarget_power_realdouble_integerdefault (ffetargetRealDouble *res,
- ffetargetRealDouble l,
- ffetargetIntegerDefault r);
-void ffetarget_print_binary (FILE *f, ffetargetTypeless val);
-void ffetarget_print_character1 (FILE *f, ffetargetCharacter1 val);
-void ffetarget_print_hollerith (FILE *f, ffetargetHollerith val);
-void ffetarget_print_octal (FILE *f, ffetargetTypeless val);
-void ffetarget_print_hex (FILE *f, ffetargetTypeless val);
-#if FFETARGET_okREAL1
-bool ffetarget_real1 (ffetargetReal1 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL2
-bool ffetarget_real2 (ffetargetReal2 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL3
-bool ffetarget_real3 (ffetargetReal3 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL4
-bool ffetarget_real4 (ffetargetReal4 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL5
-bool ffetarget_real5 (ffetargetReal5 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL6
-bool ffetarget_real6 (ffetargetReal6 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL7
-bool ffetarget_real7 (ffetargetReal7 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-#if FFETARGET_okREAL8
-bool ffetarget_real8 (ffetargetReal8 *value, ffelexToken integer,
- ffelexToken decimal, ffelexToken fraction,
- ffelexToken exponent, ffelexToken exponent_sign,
- ffelexToken exponent_digits);
-#endif
-bool ffetarget_typeless_binary (ffetargetTypeless *value, ffelexToken token);
-bool ffetarget_typeless_octal (ffetargetTypeless *value, ffelexToken token);
-bool ffetarget_typeless_hex (ffetargetTypeless *value, ffelexToken token);
-void ffetarget_verify_character1 (mallocPool pool, ffetargetCharacter1 val);
-int ffetarget_num_digits_ (ffelexToken t);
-void *ffetarget_memcpy_ (void *dst, void *src, size_t len);
-
-/* Define macros. */
-
-#if BUILT_FOR_280
-#define FFETARGET_REAL_VALUE_FROM_INT_(resr, lf, kt) \
- REAL_VALUE_FROM_INT (resr, (long) lf, (long) ((lf < 0) ? -1 : 0), ((kt == 1) ? SFmode : DFmode))
-#else
-#define FFETARGET_REAL_VALUE_FROM_INT_(resr, lf, kt) \
- REAL_VALUE_FROM_INT (resr, (long) lf, (long) ((lf < 0) ? -1 : 0))
-#endif
-
-#ifdef REAL_ARITHMETIC
-#define ffetarget_add_complex1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri, resr, resi; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- li = ffetarget_cvt_r1_to_rv_ ((l).imaginary); \
- rr = ffetarget_cvt_r1_to_rv_ ((r).real); \
- ri = ffetarget_cvt_r1_to_rv_ ((r).imaginary); \
- REAL_ARITHMETIC (resr, PLUS_EXPR, lr, rr); \
- REAL_ARITHMETIC (resi, PLUS_EXPR, li, ri); \
- ffetarget_cvt_rv_to_r1_ (resr, (res)->real); \
- ffetarget_cvt_rv_to_r1_ (resi, (res)->imaginary); \
- FFEBAD; })
-#define ffetarget_add_complex2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri, resr, resi; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- li = ffetarget_cvt_r2_to_rv_ (&((l).imaginary.v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).real.v[0])); \
- ri = ffetarget_cvt_r2_to_rv_ (&((r).imaginary.v[0])); \
- REAL_ARITHMETIC (resr, PLUS_EXPR, lr, rr); \
- REAL_ARITHMETIC (resi, PLUS_EXPR, li, ri); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->real.v[0])); \
- ffetarget_cvt_rv_to_r2_ (resi, &((res)->imaginary.v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_add_complex1(res,l,r) \
- ((res)->real = (l).real + (r).real, \
- (res)->imaginary = (l).imaginary + (r).imaginary, FFEBAD)
-#define ffetarget_add_complex2(res,l,r) \
- ((res)->real = (l).real + (r).real, \
- (res)->imaginary = (l).imaginary + (r).imaginary, FFEBAD)
-#endif
-#define ffetarget_add_integer1(res,l,r) (*(res) = (l) + (r), FFEBAD)
-#define ffetarget_add_integer2(res,l,r) (*(res) = (l) + (r), FFEBAD)
-#define ffetarget_add_integer3(res,l,r) (*(res) = (l) + (r), FFEBAD)
-#define ffetarget_add_integer4(res,l,r) (*(res) = (l) + (r), FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_add_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- REAL_ARITHMETIC (resr, PLUS_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r1_ (resr, *(res)); \
- FFEBAD; })
-#define ffetarget_add_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- REAL_ARITHMETIC (resr, PLUS_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_add_real1(res,l,r) (*(res) = (l) + (r), FFEBAD)
-#define ffetarget_add_real2(res,l,r) (*(res) = (l) + (r), FFEBAD)
-#endif
-#define ffetarget_aggregate_ptr_memcpy(dbt,dkt,sbt,skt) \
- ((ffetargetCopyfunc) ffetarget_memcpy_)
-#define ffetarget_and_integer1(res,l,r) (*(res) = (l) & (r), FFEBAD)
-#define ffetarget_and_integer2(res,l,r) (*(res) = (l) & (r), FFEBAD)
-#define ffetarget_and_integer3(res,l,r) (*(res) = (l) & (r), FFEBAD)
-#define ffetarget_and_integer4(res,l,r) (*(res) = (l) & (r), FFEBAD)
-#define ffetarget_and_logical1(res,l,r) (*(res) = (l) && (r), FFEBAD)
-#define ffetarget_and_logical2(res,l,r) (*(res) = (l) && (r), FFEBAD)
-#define ffetarget_and_logical3(res,l,r) (*(res) = (l) && (r), FFEBAD)
-#define ffetarget_and_logical4(res,l,r) (*(res) = (l) && (r), FFEBAD)
-#define ffetarget_binarymil(v,t) ffetarget_typeless_binary (v, t)
-#define ffetarget_binaryvxt(v,t) ffetarget_typeless_binary (v, t)
-#define ffetarget_cmp_integer1(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_integer2(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_integer3(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_integer4(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_logical1(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_logical2(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_logical3(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_logical4(l,r) ((l) == (r) ? 0 : ((l) < (r) ? -1 : 1))
-#define ffetarget_cmp_real1(l,r) memcmp (&(l), &(r), sizeof(l))
-#define ffetarget_cmp_real2(l,r) memcmp (&(l), &(r), sizeof(l))
-#define ffetarget_cmp_real3(l,r) memcmp (&(l), &(r), sizeof(l))
-#define ffetarget_cmp_typeless(l,r) \
- memcmp (&(l), &(r), sizeof ((l)))
-#define ffetarget_convert_character1_integer1(res,res_size,l,pool) \
- ffetarget_convert_character1_integer4(res,res_size,(ffetargetInteger4)l,pool)
-#define ffetarget_convert_character1_integer2(res,res_size,l,pool) \
- ffetarget_convert_character1_integer4(res,res_size,(ffetargetInteger4)l,pool)
-#define ffetarget_convert_character1_integer3(res,res_size,l,pool) \
- ffetarget_convert_character1_integer4(res,res_size,(ffetargetInteger4)l,pool)
-#define ffetarget_convert_character1_logical1(res,res_size,l,pool) \
- ffetarget_convert_character1_logical4(res,res_size,(ffetargetLogical4)l,pool)
-#define ffetarget_convert_character1_logical2(res,res_size,l,pool) \
- ffetarget_convert_character1_logical4(res,res_size,(ffetargetLogical4)l,pool)
-#define ffetarget_convert_character1_logical3(res,res_size,l,pool) \
- ffetarget_convert_character1_logical4(res,res_size,(ffetargetLogical4)l,pool)
-#define ffetarget_convert_complex1_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_complex1_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_complex1_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_complex1_complex2(res,l) \
- ({ REAL_VALUE_TYPE lr, li; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- li = ffetarget_cvt_r2_to_rv_ (&((l).imaginary.v[0])); \
- ffetarget_cvt_rv_to_r1_ (lr, (res)->real); \
- ffetarget_cvt_rv_to_r1_ (li, (res)->imaginary), \
- FFEBAD; })
-#else
-#define ffetarget_convert_complex1_complex2(res,l) \
- ((res)->real = (l).real, (res)->imaginary = (l).imaginary, FFEBAD)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_complex1_integer(res,l) \
- ({ REAL_VALUE_TYPE resi, resr; \
- ffetargetInteger1 lf = (l); \
- FFETARGET_REAL_VALUE_FROM_INT_ (resr, lf, 1); \
- resi = dconst0; \
- ffetarget_cvt_rv_to_r1_ (resr, (res)->real); \
- ffetarget_cvt_rv_to_r1_ (resi, (res)->imaginary); \
- FFEBAD; })
-#else
-#define ffetarget_convert_complex1_integer(res,l) \
- ((res)->real = (l), (res)->imaginary = 0, FFEBAD)
-#endif
-#define ffetarget_convert_complex1_integer1 ffetarget_convert_complex1_integer
-#define ffetarget_convert_complex1_integer2 ffetarget_convert_complex1_integer
-#define ffetarget_convert_complex1_integer3 ffetarget_convert_complex1_integer
-#define ffetarget_convert_complex1_integer4 ffetarget_convert_complex1_integer
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_complex1_real1(res,l) \
- ((res)->real = (l), \
- ffetarget_cvt_rv_to_r1_ (dconst0, (res)->imaginary), \
- FFEBAD)
-#define ffetarget_convert_complex1_real2(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- ffetarget_cvt_rv_to_r1_ (lr, (res)->real); \
- ffetarget_cvt_rv_to_r1_ (dconst0, (res)->imaginary), \
- FFEBAD; })
-#else
-#define ffetarget_convert_complex1_real1(res,l) \
- ((res)->real = (l), (res)->imaginary = 0, FFEBAD)
-#define ffetarget_convert_complex1_real2(res,l) \
- ((res)->real = (l), (res)->imaginary = 0, FFEBAD)
-#endif
-#define ffetarget_convert_complex2_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_complex2_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_complex2_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_complex2_complex1(res,l) \
- ({ REAL_VALUE_TYPE lr, li; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- li = ffetarget_cvt_r1_to_rv_ ((l).imaginary); \
- ffetarget_cvt_rv_to_r2_ (lr, &((res)->real.v[0])); \
- ffetarget_cvt_rv_to_r2_ (li, &((res)->imaginary.v[0])), \
- FFEBAD; })
-#else
-#define ffetarget_convert_complex2_complex1(res,l) \
- ((res)->real = (l).real, (res)->imaginary = (l).imaginary, FFEBAD)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_complex2_integer(res,l) \
- ({ REAL_VALUE_TYPE resi, resr; \
- ffetargetInteger1 lf = (l); \
- FFETARGET_REAL_VALUE_FROM_INT_ (resr, lf, 2); \
- resi = dconst0; \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->real.v[0])); \
- ffetarget_cvt_rv_to_r2_ (resi, &((res)->imaginary.v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_convert_complex2_integer(res,l) \
- ((res)->real = (l), (res)->imaginary = 0, FFEBAD)
-#endif
-#define ffetarget_convert_complex2_integer1 ffetarget_convert_complex2_integer
-#define ffetarget_convert_complex2_integer2 ffetarget_convert_complex2_integer
-#define ffetarget_convert_complex2_integer3 ffetarget_convert_complex2_integer
-#define ffetarget_convert_complex2_integer4 ffetarget_convert_complex2_integer
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_complex2_real1(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r1_to_rv_ (l); \
- ffetarget_cvt_rv_to_r2_ (lr, &((res)->real.v[0])); \
- ffetarget_cvt_rv_to_r2_ (dconst0, &((res)->imaginary.v[0])), \
- FFEBAD; })
-#define ffetarget_convert_complex2_real2(res,l) \
- ((res)->real = (l), \
- ffetarget_cvt_rv_to_r2_ (dconst0, &((res)->imaginary.v[0])), \
- FFEBAD)
-#else
-#define ffetarget_convert_complex2_real1(res,l) \
- ((res)->real = (l), (res)->imaginary = 0, FFEBAD)
-#define ffetarget_convert_complex2_real2(res,l) \
- ((res)->real = (l), (res)->imaginary = 0, FFEBAD)
-#endif
-#define ffetarget_convert_integer2_character1(res,l) \
- ffetarget_convert_integer1_character1(res,l)
-#define ffetarget_convert_integer2_complex1(res,l) \
- ffetarget_convert_integer1_complex1(res,l)
-#define ffetarget_convert_integer2_complex2(res,l) \
- ffetarget_convert_integer1_complex2(res,l)
-#define ffetarget_convert_integer2_hollerith(res,l) \
- ffetarget_convert_integer1_hollerith(res,l)
-#define ffetarget_convert_integer2_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer2_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer2_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer2_logical1(res,l) \
- ffetarget_convert_integer1_logical1(res,l)
-#define ffetarget_convert_integer2_logical2(res,l) \
- ffetarget_convert_integer2_logical1(res,l)
-#define ffetarget_convert_integer2_logical3(res,l) \
- ffetarget_convert_integer2_logical1(res,l)
-#define ffetarget_convert_integer2_logical4(res,l) \
- ffetarget_convert_integer2_logical1(res,l)
-#define ffetarget_convert_integer2_real1(res,l) \
- ffetarget_convert_integer1_real1(res,l)
-#define ffetarget_convert_integer2_real2(res,l) \
- ffetarget_convert_integer1_real2(res,l)
-#define ffetarget_convert_integer2_typeless(res,l) \
- ffetarget_convert_integer1_typeless(res,l)
-#define ffetarget_convert_integer3_character1(res,l) \
- ffetarget_convert_integer1_character1(res,l)
-#define ffetarget_convert_integer3_complex1(res,l) \
- ffetarget_convert_integer1_complex1(res,l)
-#define ffetarget_convert_integer3_complex2(res,l) \
- ffetarget_convert_integer1_complex2(res,l)
-#define ffetarget_convert_integer3_hollerith(res,l) \
- ffetarget_convert_integer1_hollerith(res,l)
-#define ffetarget_convert_integer3_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer3_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer3_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer3_logical1(res,l) \
- ffetarget_convert_integer1_logical1(res,l)
-#define ffetarget_convert_integer3_logical2(res,l) \
- ffetarget_convert_integer3_logical1(res,l)
-#define ffetarget_convert_integer3_logical3(res,l) \
- ffetarget_convert_integer3_logical1(res,l)
-#define ffetarget_convert_integer3_logical4(res,l) \
- ffetarget_convert_integer3_logical1(res,l)
-#define ffetarget_convert_integer3_real1(res,l) \
- ffetarget_convert_integer1_real1(res,l)
-#define ffetarget_convert_integer3_real2(res,l) \
- ffetarget_convert_integer1_real2(res,l)
-#define ffetarget_convert_integer3_typeless(res,l) \
- ffetarget_convert_integer1_typeless(res,l)
-#define ffetarget_convert_integer4_character1(res,l) \
- ffetarget_convert_integer1_character1(res,l)
-#define ffetarget_convert_integer4_complex1(res,l) \
- ffetarget_convert_integer1_complex1(res,l)
-#define ffetarget_convert_integer4_complex2(res,l) \
- ffetarget_convert_integer1_complex2(res,l)
-#define ffetarget_convert_integer4_hollerith(res,l) \
- ffetarget_convert_integer1_hollerith(res,l)
-#define ffetarget_convert_integer4_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer4_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer4_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer4_logical1(res,l) \
- ffetarget_convert_integer1_logical1(res,l)
-#define ffetarget_convert_integer4_logical2(res,l) \
- ffetarget_convert_integer1_logical1(res,l)
-#define ffetarget_convert_integer4_logical3(res,l) \
- ffetarget_convert_integer1_logical1(res,l)
-#define ffetarget_convert_integer4_logical4(res,l) \
- ffetarget_convert_integer1_logical1(res,l)
-#define ffetarget_convert_integer4_real1(res,l) \
- ffetarget_convert_integer1_real1(res,l)
-#define ffetarget_convert_integer4_real2(res,l) \
- ffetarget_convert_integer1_real2(res,l)
-#define ffetarget_convert_integer4_typeless(res,l) \
- ffetarget_convert_integer1_typeless(res,l)
-#define ffetarget_convert_logical1_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical1_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical1_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical1_logical2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical1_logical3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical1_logical4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical1_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical1_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical1_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical1_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical2_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical2_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical2_logical1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_logical3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_logical4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical2_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical3_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical3_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical3_logical1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_logical2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_logical4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical3_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical4_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical4_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_logical4_logical1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_logical2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_logical3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_integer1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_logical4_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_integer1_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_integer1_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_integer1_integer2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_integer3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_integer4(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_logical1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_logical2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_logical3(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_logical4(res,l) (*(res) = (l), FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_integer1_real1(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r1_to_rv_ (l); \
- REAL_VALUE_TO_INT (&ffetarget_long_val_, &ffetarget_long_junk_, lr); \
- *(res) = ffetarget_long_val_; \
- FFEBAD; })
-#define ffetarget_convert_integer1_real2(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- REAL_VALUE_TO_INT (&ffetarget_long_val_, &ffetarget_long_junk_, lr); \
- *(res) = ffetarget_long_val_; \
- FFEBAD; })
-#define ffetarget_convert_integer1_complex1(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- REAL_VALUE_TO_INT (&ffetarget_long_val_, &ffetarget_long_junk_, lr); \
- *(res) = ffetarget_long_val_; \
- FFEBAD; })
-#define ffetarget_convert_integer1_complex2(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- REAL_VALUE_TO_INT (&ffetarget_long_val_, &ffetarget_long_junk_, lr); \
- *(res) = ffetarget_long_val_; \
- FFEBAD; })
-#else
-#define ffetarget_convert_integer1_real1(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_real2(res,l) (*(res) = (l), FFEBAD)
-#define ffetarget_convert_integer1_complex1(res,l) (*(res) = (l).real, FFEBAD)
-#define ffetarget_convert_integer1_complex2(res,l) (*(res) = (l).real, FFEBAD)
-#endif
-#define ffetarget_convert_real1_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_real1_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_real1_integer2(res,l) \
- ffetarget_convert_real1_integer1(res,l)
-#define ffetarget_convert_real1_integer3(res,l) \
- ffetarget_convert_real1_integer1(res,l)
-#define ffetarget_convert_real1_integer4(res,l) \
- ffetarget_convert_real1_integer1(res,l)
-#define ffetarget_convert_real1_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_real1_complex1(res,l) (*(res) = (l).real, FFEBAD)
-#define ffetarget_convert_real1_complex2(res,l) \
- ffetarget_convert_real1_real2 ((res), (l).real)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_real1_integer1(res,l) \
- ({ REAL_VALUE_TYPE resr; \
- ffetargetInteger1 lf = (l); \
- FFETARGET_REAL_VALUE_FROM_INT_ (resr, lf, 1); \
- ffetarget_cvt_rv_to_r1_ (resr, *(res)); \
- FFEBAD; })
-#else
-#define ffetarget_convert_real1_integer1(res,l) (*(res) = (l), FFEBAD)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_real1_real2(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- ffetarget_cvt_rv_to_r1_ (lr, *(res)); \
- FFEBAD; })
-#else
-#define ffetarget_convert_real1_real2(res,l) (*(res) = (l), FFEBAD)
-#endif
-#define ffetarget_convert_real2_character1(res,l) \
- ffetarget_convert_any_character1_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_real2_hollerith(res,l) \
- ffetarget_convert_any_hollerith_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_real2_integer2(res,l) \
- ffetarget_convert_real2_integer1(res,l)
-#define ffetarget_convert_real2_integer3(res,l) \
- ffetarget_convert_real2_integer1(res,l)
-#define ffetarget_convert_real2_integer4(res,l) \
- ffetarget_convert_real2_integer1(res,l)
-#define ffetarget_convert_real2_typeless(res,l) \
- ffetarget_convert_any_typeless_ ((char *) (res), sizeof(*(res)), l)
-#define ffetarget_convert_real2_complex1(res,l) \
- ffetarget_convert_real2_real1 ((res), (l).real)
-#define ffetarget_convert_real2_complex2(res,l) (*(res) = (l).real, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_real2_integer(res,l) \
- ({ REAL_VALUE_TYPE resr; \
- ffetargetInteger1 lf = (l); \
- FFETARGET_REAL_VALUE_FROM_INT_ (resr, lf, 2); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->v[0])); \
- FFEBAD; })
-#define ffetarget_convert_real2_integer1 ffetarget_convert_real2_integer
-#else
-#define ffetarget_convert_real2_integer1(res,l) (*(res) = (l), FFEBAD)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_convert_real2_real1(res,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- ffetarget_cvt_rv_to_r2_ (lr, &((res)->v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_convert_real2_real1(res,l) (*(res) = (l), FFEBAD)
-#endif
-#define ffetarget_divide_integer1(res,l,r) \
- (((r) == 0) ? (*(res) = 0, FFEBAD_DIV_BY_ZERO) \
- : (*(res) = (l) / (r), FFEBAD))
-#define ffetarget_divide_integer2(res,l,r) \
- ffetarget_divide_integer1(res,l,r)
-#define ffetarget_divide_integer3(res,l,r) \
- ffetarget_divide_integer1(res,l,r)
-#define ffetarget_divide_integer4(res,l,r) \
- ffetarget_divide_integer1(res,l,r)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_divide_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- REAL_VALUES_EQUAL (rr, dconst0) \
- ? ({ ffetarget_cvt_rv_to_r1_ (dconst0, *(res)); \
- FFEBAD_DIV_BY_ZERO; \
- }) \
- : ({ REAL_ARITHMETIC (resr, RDIV_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r1_ (resr, *(res)); \
- FFEBAD; \
- }); \
- })
-#define ffetarget_divide_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- REAL_VALUES_EQUAL (rr, dconst0) \
- ? ({ ffetarget_cvt_rv_to_r2_ (dconst0, &((res)->v[0])); \
- FFEBAD_DIV_BY_ZERO; \
- }) \
- : ({ REAL_ARITHMETIC (resr, RDIV_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->v[0])); \
- FFEBAD; \
- }); \
- })
-#else
-#define ffetarget_divide_real1(res,l,r) \
- (((r) == 0) ? (*(res) = 0, FFEBAD_DIV_BY_ZERO) \
- : (*(res) = (l) / (r), FFEBAD))
-#define ffetarget_divide_real2(res,l,r) \
- (((r) == 0) ? (*(res) = 0, FFEBAD_DIV_BY_ZERO) \
- : (*(res) = (l) / (r), FFEBAD))
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_eq_complex1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- li = ffetarget_cvt_r1_to_rv_ ((l).imaginary); \
- rr = ffetarget_cvt_r1_to_rv_ ((r).real); \
- ri = ffetarget_cvt_r1_to_rv_ ((r).imaginary); \
- *(res) = (REAL_VALUES_EQUAL (lr, rr) && REAL_VALUES_EQUAL (li, ri)) \
- ? TRUE : FALSE; \
- FFEBAD; })
-#define ffetarget_eq_complex2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- li = ffetarget_cvt_r2_to_rv_ (&((l).imaginary.v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).real.v[0])); \
- ri = ffetarget_cvt_r2_to_rv_ (&((r).imaginary.v[0])); \
- *(res) = (REAL_VALUES_EQUAL (lr, rr) && REAL_VALUES_EQUAL (li, ri)) \
- ? TRUE : FALSE; \
- FFEBAD; })
-#else
-#define ffetarget_eq_complex1(res,l,r) \
- (*(res) = (((l).real == (r).real) && ((l).imaginary == (r).imaginary)) \
- ? TRUE : FALSE, FFEBAD)
-#define ffetarget_eq_complex2(res,l,r) \
- (*(res) = (((l).real == (r).real) && ((l).imaginary == (r).imaginary)) \
- ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_eq_integer1(res,l,r) \
- (*(res) = ((l) == (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_eq_integer2(res,l,r) \
- (*(res) = ((l) == (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_eq_integer3(res,l,r) \
- (*(res) = ((l) == (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_eq_integer4(res,l,r) \
- (*(res) = ((l) == (r)) ? TRUE : FALSE, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_eq_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- *(res) = REAL_VALUES_EQUAL (lr, rr) ? TRUE : FALSE; \
- FFEBAD; })
-#define ffetarget_eq_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- *(res) = REAL_VALUES_EQUAL (lr, rr) ? TRUE : FALSE; \
- FFEBAD; })
-#else
-#define ffetarget_eq_real1(res,l,r) \
- (*(res) = ((l) == (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_eq_real2(res,l,r) \
- (*(res) = ((l) == (r)) ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_eqv_integer1(res,l,r) (*(res) = (l) ^ ~(r), FFEBAD)
-#define ffetarget_eqv_integer2(res,l,r) (*(res) = (l) ^ ~(r), FFEBAD)
-#define ffetarget_eqv_integer3(res,l,r) (*(res) = (l) ^ ~(r), FFEBAD)
-#define ffetarget_eqv_integer4(res,l,r) (*(res) = (l) ^ ~(r), FFEBAD)
-#define ffetarget_eqv_logical1(res,l,r) (*(res) = (l) == (r), FFEBAD)
-#define ffetarget_eqv_logical2(res,l,r) (*(res) = (l) == (r), FFEBAD)
-#define ffetarget_eqv_logical3(res,l,r) (*(res) = (l) == (r), FFEBAD)
-#define ffetarget_eqv_logical4(res,l,r) (*(res) = (l) == (r), FFEBAD)
-#define ffetarget_ge_integer1(res,l,r) \
- (*(res) = ((l) >= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ge_integer2(res,l,r) \
- (*(res) = ((l) >= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ge_integer3(res,l,r) \
- (*(res) = ((l) >= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ge_integer4(res,l,r) \
- (*(res) = ((l) >= (r)) ? TRUE : FALSE, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_ge_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- *(res) = REAL_VALUES_LESS (lr, rr) ? FALSE : TRUE; \
- FFEBAD; })
-#define ffetarget_ge_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- *(res) = REAL_VALUES_LESS (lr, rr) ? FALSE : TRUE; \
- FFEBAD; })
-#else
-#define ffetarget_ge_real1(res,l,r) \
- (*(res) = ((l) >= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ge_real2(res,l,r) \
- (*(res) = ((l) >= (r)) ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_gt_integer1(res,l,r) \
- (*(res) = ((l) > (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_gt_integer2(res,l,r) \
- (*(res) = ((l) > (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_gt_integer3(res,l,r) \
- (*(res) = ((l) > (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_gt_integer4(res,l,r) \
- (*(res) = ((l) > (r)) ? TRUE : FALSE, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_gt_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- *(res) = (REAL_VALUES_LESS (lr, rr) || REAL_VALUES_EQUAL (lr, rr)) \
- ? FALSE : TRUE; \
- FFEBAD; })
-#define ffetarget_gt_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- *(res) = (REAL_VALUES_LESS (lr, rr) || REAL_VALUES_EQUAL (lr, rr)) \
- ? FALSE : TRUE; \
- FFEBAD; })
-#else
-#define ffetarget_gt_real1(res,l,r) \
- (*(res) = ((l) > (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_gt_real2(res,l,r) \
- (*(res) = ((l) > (r)) ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_hexxmil(v,t) ffetarget_typeless_hex (v, t)
-#define ffetarget_hexxvxt(v,t) ffetarget_typeless_hex (v, t)
-#define ffetarget_hexzmil(v,t) ffetarget_typeless_hex (v, t)
-#define ffetarget_hexzvxt(v,t) ffetarget_typeless_hex (v, t)
-#define ffetarget_init_0()
-#define ffetarget_init_1()
-#define ffetarget_init_2()
-#define ffetarget_init_3()
-#define ffetarget_init_4()
-#ifndef __alpha__
-#define ffetarget_integerdefault_is_magical(i) \
- (((unsigned long int) i) == FFETARGET_integerBIG_MAGICAL)
-#else
-#define ffetarget_integerdefault_is_magical(i) \
- (((unsigned int) i) == FFETARGET_integerBIG_MAGICAL)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_iszero_real1(l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- REAL_VALUES_EQUAL (lr, dconst0); \
- })
-#define ffetarget_iszero_real2(l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- REAL_VALUES_EQUAL (lr, dconst0); \
- })
-#else
-#define ffetarget_iszero_real1(l) ((l) == 0.)
-#define ffetarget_iszero_real2(l) ((l) == 0.)
-#endif
-#define ffetarget_iszero_typeless(l) ((l) == 0)
-#define ffetarget_logical1(v,truth) (*(v) = truth ? 1 : 0)
-#define ffetarget_le_integer1(res,l,r) \
- (*(res) = ((l) <= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_le_integer2(res,l,r) \
- (*(res) = ((l) <= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_le_integer3(res,l,r) \
- (*(res) = ((l) <= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_le_integer4(res,l,r) \
- (*(res) = ((l) <= (r)) ? TRUE : FALSE, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_le_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- *(res) = (REAL_VALUES_LESS (lr, rr) || REAL_VALUES_EQUAL (lr, rr)) \
- ? TRUE : FALSE; \
- FFEBAD; })
-#define ffetarget_le_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- *(res) = (REAL_VALUES_LESS (lr, rr) || REAL_VALUES_EQUAL (lr, rr)) \
- ? TRUE : FALSE; \
- FFEBAD; })
-#else
-#define ffetarget_le_real1(res,l,r) \
- (*(res) = ((l) <= (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_le_real2(res,l,r) \
- (*(res) = ((l) <= (r)) ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_lt_integer1(res,l,r) \
- (*(res) = ((l) < (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_lt_integer2(res,l,r) \
- (*(res) = ((l) < (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_lt_integer3(res,l,r) \
- (*(res) = ((l) < (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_lt_integer4(res,l,r) \
- (*(res) = ((l) < (r)) ? TRUE : FALSE, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_lt_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- *(res) = REAL_VALUES_LESS (lr, rr) ? TRUE : FALSE; \
- FFEBAD; })
-#define ffetarget_lt_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- *(res) = REAL_VALUES_LESS (lr, rr) ? TRUE : FALSE; \
- FFEBAD; })
-#else
-#define ffetarget_lt_real1(res,l,r) \
- (*(res) = ((l) < (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_lt_real2(res,l,r) \
- (*(res) = ((l) < (r)) ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_length_character1(c) ((c).length)
-#define ffetarget_length_characterdefault ffetarget_length_character1
-#ifdef REAL_ARITHMETIC
-#define ffetarget_make_real1(res,lr) \
- ffetarget_cvt_rv_to_r1_ ((lr), *(res))
-#define ffetarget_make_real2(res,lr) \
- ffetarget_cvt_rv_to_r2_ ((lr), &((res)->v[0]))
-#else
-#define ffetarget_make_real1(res,lr) (*(res) = (lr))
-#define ffetarget_make_real2(res,lr) (*(res) = (lr))
-#endif
-#define ffetarget_multiply_integer1(res,l,r) (*(res) = (l) * (r), FFEBAD)
-#define ffetarget_multiply_integer2(res,l,r) (*(res) = (l) * (r), FFEBAD)
-#define ffetarget_multiply_integer3(res,l,r) (*(res) = (l) * (r), FFEBAD)
-#define ffetarget_multiply_integer4(res,l,r) (*(res) = (l) * (r), FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_multiply_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- REAL_ARITHMETIC (resr, MULT_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r1_ (resr, *(res)); \
- FFEBAD; })
-#define ffetarget_multiply_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- REAL_ARITHMETIC (resr, MULT_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_multiply_real1(res,l,r) (*(res) = (l) * (r), FFEBAD)
-#define ffetarget_multiply_real2(res,l,r) (*(res) = (l) * (r), FFEBAD)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_ne_complex1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- li = ffetarget_cvt_r1_to_rv_ ((l).imaginary); \
- rr = ffetarget_cvt_r1_to_rv_ ((r).real); \
- ri = ffetarget_cvt_r1_to_rv_ ((r).imaginary); \
- *(res) = (REAL_VALUES_EQUAL (lr, rr) && REAL_VALUES_EQUAL (li, ri)) \
- ? FALSE : TRUE; \
- FFEBAD; })
-#define ffetarget_ne_complex2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- li = ffetarget_cvt_r2_to_rv_ (&((l).imaginary.v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).real.v[0])); \
- ri = ffetarget_cvt_r2_to_rv_ (&((r).imaginary.v[0])); \
- *(res) = (REAL_VALUES_EQUAL (lr, rr) && REAL_VALUES_EQUAL (li, ri)) \
- ? FALSE : TRUE; \
- FFEBAD; })
-#else
-#define ffetarget_ne_complex1(res,l,r) \
- (*(res) = (((l).real != (r).real) || ((l).imaginary != (r).imaginary)) \
- ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ne_complex2(res,l,r) \
- (*(res) = (((l).real != (r).real) || ((l).imaginary != (r).imaginary)) \
- ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_ne_integer1(res,l,r) \
- (*(res) = ((l) != (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ne_integer2(res,l,r) \
- (*(res) = ((l) != (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ne_integer3(res,l,r) \
- (*(res) = ((l) != (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ne_integer4(res,l,r) \
- (*(res) = ((l) != (r)) ? TRUE : FALSE, FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_ne_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- *(res) = REAL_VALUES_EQUAL (lr, rr) ? FALSE : TRUE; \
- FFEBAD; })
-#define ffetarget_ne_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- *(res) = REAL_VALUES_EQUAL (lr, rr) ? FALSE : TRUE; \
- FFEBAD; })
-#else
-#define ffetarget_ne_real1(res,l,r) \
- (*(res) = ((l) != (r)) ? TRUE : FALSE, FFEBAD)
-#define ffetarget_ne_real2(res,l,r) \
- (*(res) = ((l) != (r)) ? TRUE : FALSE, FFEBAD)
-#endif
-#define ffetarget_neqv_integer1(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_neqv_integer2(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_neqv_integer3(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_neqv_integer4(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_neqv_logical1(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_neqv_logical2(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_neqv_logical3(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_neqv_logical4(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_not_integer1(res,l) (*(res) = ~(l), FFEBAD)
-#define ffetarget_not_integer2(res,l) (*(res) = ~(l), FFEBAD)
-#define ffetarget_not_integer3(res,l) (*(res) = ~(l), FFEBAD)
-#define ffetarget_not_integer4(res,l) (*(res) = ~(l), FFEBAD)
-#define ffetarget_not_logical1(res,l) (*(res) = !(l), FFEBAD)
-#define ffetarget_not_logical2(res,l) (*(res) = !(l), FFEBAD)
-#define ffetarget_not_logical3(res,l) (*(res) = !(l), FFEBAD)
-#define ffetarget_not_logical4(res,l) (*(res) = !(l), FFEBAD)
-#define ffetarget_octalmil(v,t) ffetarget_typeless_octal (v, t)
-#define ffetarget_octalvxt(v,t) ffetarget_typeless_octal (v, t)
-#define ffetarget_offset(res,l) (*(res) = (l), TRUE) /* Overflow? */
-#define ffetarget_offset_add(res,l,r) (*(res) = (l) + (r), TRUE) /* Overflow? */
-#define ffetarget_offset_charsize(res,l,u) (*(res) = (l) * (u), TRUE) /* Ov? */
-#define ffetarget_offset_multiply(res,l,r) (*(res) = (l) * (r), TRUE) /* Ov? */
-#define ffetarget_offset_overflow(text) ((void) 0) /* ~~no message? */
-#define ffetarget_or_integer1(res,l,r) (*(res) = (l) | (r), FFEBAD)
-#define ffetarget_or_integer2(res,l,r) (*(res) = (l) | (r), FFEBAD)
-#define ffetarget_or_integer3(res,l,r) (*(res) = (l) | (r), FFEBAD)
-#define ffetarget_or_integer4(res,l,r) (*(res) = (l) | (r), FFEBAD)
-#define ffetarget_or_logical1(res,l,r) (*(res) = (l) || (r), FFEBAD)
-#define ffetarget_or_logical2(res,l,r) (*(res) = (l) || (r), FFEBAD)
-#define ffetarget_or_logical3(res,l,r) (*(res) = (l) || (r), FFEBAD)
-#define ffetarget_or_logical4(res,l,r) (*(res) = (l) || (r), FFEBAD)
-#define ffetarget_print_binarymil(f,v) ffetarget_print_binary (f, v)
-#define ffetarget_print_binaryvxt(f,v) ffetarget_print_binary (f, v)
-#define ffetarget_print_hexxmil(f,v) ffetarget_print_hex (f, v)
-#define ffetarget_print_hexxvxt(f,v) ffetarget_print_hex (f, v)
-#define ffetarget_print_hexzmil(f,v) ffetarget_print_hex (f, v)
-#define ffetarget_print_hexzvxt(f,v) ffetarget_print_hex (f, v)
-#define ffetarget_print_integer1(f,v) \
- fprintf ((f), "%" ffetargetInteger1_f "d", (v))
-#define ffetarget_print_integer2(f,v) \
- fprintf ((f), "%" ffetargetInteger2_f "d", (v))
-#define ffetarget_print_integer3(f,v) \
- fprintf ((f), "%" ffetargetInteger3_f "d", (v))
-#define ffetarget_print_integer4(f,v) \
- fprintf ((f), "%" ffetargetInteger4_f "d", (v))
-#define ffetarget_print_logical1(f,v) \
- fprintf ((f), "%" ffetargetLogical1_f "d", (v))
-#define ffetarget_print_logical2(f,v) \
- fprintf ((f), "%" ffetargetLogical2_f "d", (v))
-#define ffetarget_print_logical3(f,v) \
- fprintf ((f), "%" ffetargetLogical3_f "d", (v))
-#define ffetarget_print_logical4(f,v) \
- fprintf ((f), "%" ffetargetLogical4_f "d", (v))
-#define ffetarget_print_octalmil(f,v) ffetarget_print_octal(f,v)
-#define ffetarget_print_octalvxt(f,v) ffetarget_print_octal(f,v)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_print_real1(f,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- REAL_VALUE_TO_DECIMAL (lr, bad_fmt_val??, ffetarget_string_); \
- fputs (ffetarget_string_, (f)); \
- })
-#define ffetarget_print_real2(f,l) \
- ({ REAL_VALUE_TYPE lr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- REAL_VALUE_TO_DECIMAL (lr, bad_fmt_val??, ffetarget_string_); \
- fputs (ffetarget_string_, (f)); \
- })
-#else
-#define ffetarget_print_real1(f,v) \
- fprintf ((f), "%" ffetargetReal1_f "g", (v))
-#define ffetarget_print_real2(f,v) \
- fprintf ((f), "%" ffetargetReal2_f "g", (v))
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_real1_one(res) ffetarget_cvt_rv_to_r1_ (dconst1, *(res))
-#define ffetarget_real2_one(res) ffetarget_cvt_rv_to_r2_ (dconst1, &((res)->v[0]))
-#else
-#define ffetarget_real1_one(res) (*(res) = (float) 1.)
-#define ffetarget_real2_one(res) (*(res) = 1.)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_real1_two(res) ffetarget_cvt_rv_to_r1_ (dconst2, *(res))
-#define ffetarget_real2_two(res) ffetarget_cvt_rv_to_r2_ (dconst2, &((res)->v[0]))
-#else
-#define ffetarget_real1_two(res) (*(res) = (float) 2.)
-#define ffetarget_real2_two(res) (*(res) = 2.)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_real1_zero(res) ffetarget_cvt_rv_to_r1_ (dconst0, *(res))
-#define ffetarget_real2_zero(res) ffetarget_cvt_rv_to_r2_ (dconst0, &((res)->v[0]))
-#else
-#define ffetarget_real1_zero(res) (*(res) = (float) 0.)
-#define ffetarget_real2_zero(res) (*(res) = 0.)
-#endif
-#define ffetarget_size_typeless_binary(t) ((ffetarget_num_digits_(t) + 7) / 8)
-#define ffetarget_size_typeless_octal(t) \
- ((ffetarget_num_digits_(t) * 3 + 7) / 8)
-#define ffetarget_size_typeless_hex(t) ((ffetarget_num_digits_(t) + 1) / 2)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_subtract_complex1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri, resr, resi; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- li = ffetarget_cvt_r1_to_rv_ ((l).imaginary); \
- rr = ffetarget_cvt_r1_to_rv_ ((r).real); \
- ri = ffetarget_cvt_r1_to_rv_ ((r).imaginary); \
- REAL_ARITHMETIC (resr, MINUS_EXPR, lr, rr); \
- REAL_ARITHMETIC (resi, MINUS_EXPR, li, ri); \
- ffetarget_cvt_rv_to_r1_ (resr, (res)->real); \
- ffetarget_cvt_rv_to_r1_ (resi, (res)->imaginary); \
- FFEBAD; })
-#define ffetarget_subtract_complex2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, li, rr, ri, resr, resi; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- li = ffetarget_cvt_r2_to_rv_ (&((l).imaginary.v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).real.v[0])); \
- ri = ffetarget_cvt_r2_to_rv_ (&((r).imaginary.v[0])); \
- REAL_ARITHMETIC (resr, MINUS_EXPR, lr, rr); \
- REAL_ARITHMETIC (resi, MINUS_EXPR, li, ri); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->real.v[0])); \
- ffetarget_cvt_rv_to_r2_ (resi, &((res)->imaginary.v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_subtract_complex1(res,l,r) \
- ((res)->real = (l).real - (r).real, \
- (res)->imaginary = (l).imaginary - (r).imaginary, FFEBAD)
-#define ffetarget_subtract_complex2(res,l,r) \
- ((res)->real = (l).real - (r).real, \
- (res)->imaginary = (l).imaginary - (r).imaginary, FFEBAD)
-#endif
-#define ffetarget_subtract_integer1(res,l,r) (*(res) = (l) - (r), FFEBAD)
-#define ffetarget_subtract_integer2(res,l,r) (*(res) = (l) - (r), FFEBAD)
-#define ffetarget_subtract_integer3(res,l,r) (*(res) = (l) - (r), FFEBAD)
-#define ffetarget_subtract_integer4(res,l,r) (*(res) = (l) - (r), FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_subtract_real1(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- rr = ffetarget_cvt_r1_to_rv_ ((r)); \
- REAL_ARITHMETIC (resr, MINUS_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r1_ (resr, *(res)); \
- FFEBAD; })
-#define ffetarget_subtract_real2(res,l,r) \
- ({ REAL_VALUE_TYPE lr, rr, resr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- rr = ffetarget_cvt_r2_to_rv_ (&((r).v[0])); \
- REAL_ARITHMETIC (resr, MINUS_EXPR, lr, rr); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_subtract_real1(res,l,r) (*(res) = (l) - (r), FFEBAD)
-#define ffetarget_subtract_real2(res,l,r) (*(res) = (l) - (r), FFEBAD)
-#endif
-#define ffetarget_terminate_0()
-#define ffetarget_terminate_1()
-#define ffetarget_terminate_2()
-#define ffetarget_terminate_3()
-#define ffetarget_terminate_4()
-#define ffetarget_text_character1(c) ((c).text)
-#define ffetarget_text_characterdefault ffetarget_text_character1
-#ifdef REAL_ARITHMETIC
-#define ffetarget_uminus_complex1(res,l) \
- ({ REAL_VALUE_TYPE lr, li, resr, resi; \
- lr = ffetarget_cvt_r1_to_rv_ ((l).real); \
- li = ffetarget_cvt_r1_to_rv_ ((l).imaginary); \
- resr = REAL_VALUE_NEGATE (lr); \
- resi = REAL_VALUE_NEGATE (li); \
- ffetarget_cvt_rv_to_r1_ (resr, (res)->real); \
- ffetarget_cvt_rv_to_r1_ (resi, (res)->imaginary); \
- FFEBAD; })
-#define ffetarget_uminus_complex2(res,l) \
- ({ REAL_VALUE_TYPE lr, li, resr, resi; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).real.v[0])); \
- li = ffetarget_cvt_r2_to_rv_ (&((l).imaginary.v[0])); \
- resr = REAL_VALUE_NEGATE (lr); \
- resi = REAL_VALUE_NEGATE (li); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->real.v[0])); \
- ffetarget_cvt_rv_to_r2_ (resi, &((res)->imaginary.v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_uminus_complex1(res,l) \
- ((res)->real = -(l).real, (res)->imaginary = -(l).imaginary, FFEBAD)
-#define ffetarget_uminus_complex2(res,l) \
- ((res)->real = -(l).real, (res)->imaginary = -(l).imaginary, FFEBAD)
-#endif
-#define ffetarget_uminus_integer1(res,l) (*(res) = -(l), FFEBAD)
-#define ffetarget_uminus_integer2(res,l) (*(res) = -(l), FFEBAD)
-#define ffetarget_uminus_integer3(res,l) (*(res) = -(l), FFEBAD)
-#define ffetarget_uminus_integer4(res,l) (*(res) = -(l), FFEBAD)
-#ifdef REAL_ARITHMETIC
-#define ffetarget_uminus_real1(res,l) \
- ({ REAL_VALUE_TYPE lr, resr; \
- lr = ffetarget_cvt_r1_to_rv_ ((l)); \
- resr = REAL_VALUE_NEGATE (lr); \
- ffetarget_cvt_rv_to_r1_ (resr, *(res)); \
- FFEBAD; })
-#define ffetarget_uminus_real2(res,l) \
- ({ REAL_VALUE_TYPE lr, resr; \
- lr = ffetarget_cvt_r2_to_rv_ (&((l).v[0])); \
- resr = REAL_VALUE_NEGATE (lr); \
- ffetarget_cvt_rv_to_r2_ (resr, &((res)->v[0])); \
- FFEBAD; })
-#else
-#define ffetarget_uminus_real1(res,l) (*(res) = -(l), FFEBAD)
-#define ffetarget_uminus_real2(res,l) (*(res) = -(l), FFEBAD)
-#endif
-#ifdef REAL_ARITHMETIC
-#define ffetarget_value_real1(lr) ffetarget_cvt_r1_to_rv_ ((lr))
-#define ffetarget_value_real2(lr) ffetarget_cvt_r2_to_rv_ (&((lr).v[0]))
-#else
-#define ffetarget_value_real1
-#define ffetarget_value_real2
-#endif
-#define ffetarget_xor_integer1(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_xor_integer2(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_xor_integer3(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_xor_integer4(res,l,r) (*(res) = (l) ^ (r), FFEBAD)
-#define ffetarget_xor_logical1(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_xor_logical2(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_xor_logical3(res,l,r) (*(res) = (l) != (r), FFEBAD)
-#define ffetarget_xor_logical4(res,l,r) (*(res) = (l) != (r), FFEBAD)
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/tconfig.j b/gcc/f/tconfig.j
index b5fb04259c9..5bf37928672 100644
--- a/gcc/f/tconfig.j
+++ b/gcc/f/tconfig.j
@@ -1,27 +1 @@
-/* tconfig.j -- Wrapper for GCC's tconfig.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_tconfig
-#define _J_f_tconfig
-#include "tconfig.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/tm.j b/gcc/f/tm.j
index 08efa5133ca..5bf37928672 100644
--- a/gcc/f/tm.j
+++ b/gcc/f/tm.j
@@ -1,27 +1 @@
-/* tm.j -- Wrapper for GCC's tm.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_tm
-#define _J_f_tm
-#include "tm.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/top.c b/gcc/f/top.c
index 641bd39dc4a..17e4139bb7d 100644
--- a/gcc/f/top.c
+++ b/gcc/f/top.c
@@ -1,6 +1,6 @@
/* top.c -- Implementation File (module.c template V1.0)
Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+ Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
@@ -30,7 +30,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Include files. */
-#include <ctype.h>
#include "proj.h"
#include "top.h"
#include "bad.h"
@@ -56,12 +55,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "where.h"
#if FFECOM_targetCURRENT == FFECOM_targetGCC
#include "flags.j"
+#include "toplev.j"
#endif
/* Externals defined here. */
int flag_traditional; /* Shouldn't need this (C front end only)! */
-bool ffe_is_do_internal_checks_ = TRUE;
+bool ffe_is_do_internal_checks_ = FALSE;
bool ffe_is_90_ = FFETARGET_defaultIS_90;
bool ffe_is_automatic_ = FFETARGET_defaultIS_AUTOMATIC;
bool ffe_is_backslash_ = FFETARGET_defaultIS_BACKSLASH;
@@ -80,6 +80,7 @@ bool ffe_is_ident_ = TRUE;
bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO;
bool ffe_is_mainprog_; /* TRUE if current prog unit known to be
main. */
+bool ffe_is_null_version_ = FALSE;
bool ffe_is_onetrip_ = FALSE;
bool ffe_is_silent_ = TRUE;
bool ffe_is_typeless_boz_ = FALSE;
@@ -150,7 +151,7 @@ ffe_is_digit_string_ (char *s)
{
char *p;
- for (p = s; isdigit (*p); ++p)
+ for (p = s; ISDIGIT (*p); ++p)
;
return (p != s) && (*p == '\0');
@@ -160,29 +161,22 @@ ffe_is_digit_string_ (char *s)
recognized and handled. */
int
-ffe_decode_option (char *opt)
+ffe_decode_option (argc, argv)
+ int argc;
+ char **argv;
{
+ char *opt = argv[0];
if (opt[0] != '-')
return 0;
if (opt[1] == 'f')
{
if (strcmp (&opt[2], "version") == 0)
- ffe_set_is_version (TRUE);
- else if (strcmp (&opt[2], "null-version") == 0)
- ; /* Someday generate program to print version
- info. */
- else if (strcmp (&opt[2], "set-g77-defaults") == 0)
{
- ffe_is_do_internal_checks_ = 0;
-#if BUILT_FOR_270 /* User must have applied patch (circa 2.7.2 and beyond). */
-#if 0
- flag_rerun_loop_opt = 1;
-#endif
- flag_move_all_movables = 1;
- flag_reduce_all_givs = 1;
- flag_argument_noalias = 2;
-#endif
+ ffe_set_is_version (TRUE);
+ ffe_set_is_do_internal_checks (TRUE);
}
+ else if (strcmp (&opt[2], "null-version") == 0)
+ ffe_set_is_null_version (TRUE);
else if (strcmp (&opt[2], "ident") == 0)
ffe_set_is_ident (TRUE);
else if (strcmp (&opt[2], "no-ident") == 0)
diff --git a/gcc/f/top.h b/gcc/f/top.h
index 3d91fd77be7..41ce6af1e11 100644
--- a/gcc/f/top.h
+++ b/gcc/f/top.h
@@ -1,261 +1,6 @@
-/* top.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995-1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- top.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_parse
-#define _H_f_parse
-
-/* Simple definitions and enumerations. */
-
-enum _ffe_case_
- {
- FFE_caseNONE, /* No case conversion, match
- case-insensitive. */
- FFE_caseUPPER, /* Convert lowercase to uppercase, match
- upper. */
- FFE_caseLOWER, /* Convert uppercase to lowercase, match
- lower. */
- FFE_caseINITCAP, /* Match InitialCap (no meaning for
- conversion). */
- FFE_case
- };
-typedef enum _ffe_case_ ffeCase;
-
-enum _ffeintrinsic_state_
- { /* State of a family of intrinsics. NOTE:
- order IS important, see
- ffe_intrinsic_state_max (). */
- FFE_intrinsicstateDELETED, /* Doesn't exist at all. */
- FFE_intrinsicstateDISABLED, /* Diagnostic if used as intrinsic. */
- FFE_intrinsicstateHIDDEN, /* Exists only if INTRINSIC stmt. */
- FFE_intrinsicstateENABLED, /* Exists as normal. */
- FFE_intrinsicstate
- };
-typedef enum _ffeintrinsic_state_ ffeIntrinsicState;
-
-/* Typedefs. */
-
-typedef unsigned long ffeCounter;
-#define ffeCounter_f "l"
-typedef unsigned int ffeKwIndex;
-typedef unsigned long int ffeTokenLength;
-#define ffeTokenLength_f "l"
-typedef void *ffeUnionLongPtr; /* unused type to cover union of long and
- ptr. */
-
-/* Include files needed by this one. */
-
-#include "malloc.h"
-#include "where.h"
-
-/* Structure definitions. */
-
-
-/* Global objects accessed by users of this module. */
-
-extern bool ffe_is_do_internal_checks_;
-extern bool ffe_is_90_;
-extern bool ffe_is_automatic_;
-extern bool ffe_is_backslash_;
-extern bool ffe_is_emulate_complex_;
-extern bool ffe_is_underscoring_;
-extern bool ffe_is_second_underscore_;
-extern bool ffe_is_debug_kludge_;
-extern bool ffe_is_dollar_ok_;
-extern bool ffe_is_f2c_;
-extern bool ffe_is_f2c_library_;
-extern bool ffe_is_ffedebug_;
-extern bool ffe_is_free_form_;
-extern bool ffe_is_globals_;
-extern bool ffe_is_ident_;
-extern bool ffe_is_init_local_zero_;
-extern bool ffe_is_mainprog_;
-extern bool ffe_is_onetrip_;
-extern bool ffe_is_silent_;
-extern bool ffe_is_typeless_boz_;
-extern bool ffe_is_pedantic_;
-extern bool ffe_is_saveall_;
-extern bool ffe_is_ugly_args_;
-extern bool ffe_is_ugly_assign_;
-extern bool ffe_is_ugly_assumed_;
-extern bool ffe_is_ugly_comma_;
-extern bool ffe_is_ugly_complex_;
-extern bool ffe_is_ugly_init_;
-extern bool ffe_is_ugly_logint_;
-extern bool ffe_is_version_;
-extern bool ffe_is_vxt_;
-extern bool ffe_is_warn_globals_;
-extern bool ffe_is_warn_implicit_;
-extern bool ffe_is_warn_surprising_;
-extern bool ffe_is_zeros_;
-extern ffeCase ffe_case_intrin_;
-extern ffeCase ffe_case_match_;
-extern ffeCase ffe_case_source_;
-extern ffeCase ffe_case_symbol_;
-extern ffeIntrinsicState ffe_intrinsic_state_badu77_;
-extern ffeIntrinsicState ffe_intrinsic_state_gnu_;
-extern ffeIntrinsicState ffe_intrinsic_state_f2c_;
-extern ffeIntrinsicState ffe_intrinsic_state_f90_;
-extern ffeIntrinsicState ffe_intrinsic_state_mil_;
-extern ffeIntrinsicState ffe_intrinsic_state_unix_;
-extern ffeIntrinsicState ffe_intrinsic_state_vxt_;
-extern int ffe_fixed_line_length_;
-extern mallocPool ffe_file_pool_;
-extern mallocPool ffe_any_unit_pool_;
-extern mallocPool ffe_program_unit_pool_;
-extern ffeCounter ffe_count_0;
-extern ffeCounter ffe_count_1;
-extern ffeCounter ffe_count_2;
-extern ffeCounter ffe_count_3;
-extern ffeCounter ffe_count_4;
-extern bool ffe_in_0;
-extern bool ffe_in_1;
-extern bool ffe_in_2;
-extern bool ffe_in_3;
-extern bool ffe_in_4;
-
-/* Declare functions with prototypes. */
-
-int ffe_decode_option (char *opt);
-void ffe_file (ffewhereFile wf, FILE *f);
-void ffe_init_0 (void);
-void ffe_init_1 (void);
-void ffe_init_2 (void);
-void ffe_init_3 (void);
-void ffe_init_4 (void);
-void ffe_terminate_0 (void);
-void ffe_terminate_1 (void);
-void ffe_terminate_2 (void);
-void ffe_terminate_3 (void);
-void ffe_terminate_4 (void);
-
-/* Define macros. */
-
-#define ffe_case_intrin() ffe_case_intrin_
-#define ffe_case_match() ffe_case_match_
-#define ffe_case_source() ffe_case_source_
-#define ffe_case_symbol() ffe_case_symbol_
-#define ffe_intrinsic_state_badu77() ffe_intrinsic_state_badu77_
-#define ffe_intrinsic_state_f2c() ffe_intrinsic_state_f2c_
-#define ffe_intrinsic_state_f90() ffe_intrinsic_state_f90_
-#define ffe_intrinsic_state_gnu() ffe_intrinsic_state_gnu_
-#define ffe_intrinsic_state_mil() ffe_intrinsic_state_mil_
-#define ffe_intrinsic_state_unix() ffe_intrinsic_state_unix_
-#define ffe_intrinsic_state_vxt() ffe_intrinsic_state_vxt_
-#define ffe_is_90() ffe_is_90_
-#define ffe_is_automatic() ffe_is_automatic_
-#define ffe_is_backslash() ffe_is_backslash_
-#define ffe_is_debug_kludge() ffe_is_debug_kludge_
-#define ffe_is_do_internal_checks() ffe_is_do_internal_checks_
-#define ffe_is_dollar_ok() ffe_is_dollar_ok_
-#define ffe_is_emulate_complex() ffe_is_emulate_complex_
-#define ffe_is_f2c() ffe_is_f2c_
-#define ffe_is_f2c_library() ffe_is_f2c_library_
-#define ffe_is_ffedebug() ffe_is_ffedebug_
-#define ffe_is_free_form() ffe_is_free_form_
-#define ffe_is_globals() ffe_is_globals_
-#define ffe_is_ident() ffe_is_ident_
-#define ffe_is_init_local_zero() ffe_is_init_local_zero_
-#define ffe_is_mainprog() ffe_is_mainprog_
-#define ffe_is_onetrip() ffe_is_onetrip_
-#define ffe_is_pedantic() ffe_is_pedantic_
-#define ffe_is_pedantic_not_90() (ffe_is_pedantic_ && !ffe_is_90_)
-#define ffe_is_saveall() ffe_is_saveall_
-#define ffe_is_second_underscore() ffe_is_second_underscore_
-#define ffe_is_silent() ffe_is_silent_
-#define ffe_is_typeless_boz() ffe_is_typeless_boz_
-#define ffe_is_ugly_args() ffe_is_ugly_args_
-#define ffe_is_ugly_assign() ffe_is_ugly_assign_
-#define ffe_is_ugly_assumed() ffe_is_ugly_assumed_
-#define ffe_is_ugly_comma() ffe_is_ugly_comma_
-#define ffe_is_ugly_complex() ffe_is_ugly_complex_
-#define ffe_is_ugly_init() ffe_is_ugly_init_
-#define ffe_is_ugly_logint() ffe_is_ugly_logint_
-#define ffe_is_underscoring() ffe_is_underscoring_
-#define ffe_is_version() ffe_is_version_
-#define ffe_is_vxt() ffe_is_vxt_
-#define ffe_is_warn_globals() ffe_is_warn_globals_
-#define ffe_is_warn_implicit() ffe_is_warn_implicit_
-#define ffe_is_warn_surprising() ffe_is_warn_surprising_
-#define ffe_is_zeros() ffe_is_zeros_
-#define ffe_fixed_line_length() ffe_fixed_line_length_
-#define ffe_pool_file() (ffe_file_pool_)
-#define ffe_pool_any_unit() (ffe_any_unit_pool_)
-#define ffe_pool_program_unit() (ffe_program_unit_pool_)
-#define ffe_set_case_intrin(f) (ffe_case_intrin_ = (f))
-#define ffe_set_case_match(f) (ffe_case_match_ = (f))
-#define ffe_set_case_source(f) (ffe_case_source_ = (f))
-#define ffe_set_case_symbol(f) (ffe_case_symbol_ = (f))
-#define ffe_set_intrinsic_state_badu77(s) (ffe_intrinsic_state_badu77_ = (s))
-#define ffe_set_intrinsic_state_f2c(s) (ffe_intrinsic_state_f2c_ = (s))
-#define ffe_set_intrinsic_state_f90(s) (ffe_intrinsic_state_f90_ = (s))
-#define ffe_set_intrinsic_state_gnu(s) (ffe_intrinsic_state_gnu_ = (s))
-#define ffe_set_intrinsic_state_mil(s) (ffe_intrinsic_state_mil_ = (s))
-#define ffe_set_intrinsic_state_unix(s) (ffe_intrinsic_state_unix_ = (s))
-#define ffe_set_intrinsic_state_vxt(s) (ffe_intrinsic_state_vxt_ = (s))
-#define ffe_set_is_90(f) (ffe_is_90_ = (f))
-#define ffe_set_is_automatic(f) (ffe_is_automatic_ = (f))
-#define ffe_set_is_backslash(f) (ffe_is_backslash_ = (f))
-#define ffe_set_is_debug_kludge(f) (ffe_is_debug_kludge_ = (f))
-#define ffe_set_is_do_internal_checks(f) (ffe_set_is_do_internal_checks_ = (f))
-#define ffe_set_is_dollar_ok(f) (ffe_is_dollar_ok_ = (f))
-#define ffe_set_is_emulate_complex(f) (ffe_is_emulate_complex_ = (f))
-#define ffe_set_is_f2c(f) (ffe_is_f2c_ = (f))
-#define ffe_set_is_f2c_library(f) (ffe_is_f2c_library_ = (f))
-#define ffe_set_is_ffedebug(f) (ffe_is_ffedebug_ = (f))
-#define ffe_set_is_free_form(f) (ffe_is_free_form_ = (f))
-#define ffe_set_is_globals(f) (ffe_is_globals_ = (f))
-#define ffe_set_is_ident(f) (ffe_is_ident_ = (f))
-#define ffe_set_is_init_local_zero(f) (ffe_is_init_local_zero_ = (f))
-#define ffe_set_is_mainprog(f) (ffe_is_mainprog_ = (f))
-#define ffe_set_is_onetrip(f) (ffe_is_onetrip_ = (f))
-#define ffe_set_is_pedantic(f) (ffe_is_pedantic_ = (f))
-#define ffe_set_is_saveall(f) (ffe_is_saveall_ = (f))
-#define ffe_set_is_second_underscore(f) (ffe_is_second_underscore_ = (f))
-#define ffe_set_is_silent(f) (ffe_is_silent_ = (f))
-#define ffe_set_is_typeless_boz(f) (ffe_is_typeless_boz_ = (f))
-#define ffe_set_is_ugly_args(f) (ffe_is_ugly_args_ = (f))
-#define ffe_set_is_ugly_assign(f) (ffe_is_ugly_assign_ = (f))
-#define ffe_set_is_ugly_assumed(f) (ffe_is_ugly_assumed_ = (f))
-#define ffe_set_is_ugly_comma(f) (ffe_is_ugly_comma_ = (f))
-#define ffe_set_is_ugly_complex(f) (ffe_is_ugly_complex_ = (f))
-#define ffe_set_is_ugly_init(f) (ffe_is_ugly_init_ = (f))
-#define ffe_set_is_ugly_logint(f) (ffe_is_ugly_logint_ = (f))
-#define ffe_set_is_underscoring(f) (ffe_is_underscoring_ = (f))
-#define ffe_set_is_version(f) (ffe_is_version_ = (f))
-#define ffe_set_is_vxt(f) (ffe_is_vxt_ = (f))
-#define ffe_set_is_warn_globals(f) (ffe_is_warn_globals_ = (f))
-#define ffe_set_is_warn_implicit(f) (ffe_is_warn_implicit_ = (f))
-#define ffe_set_is_warn_surprising(f) (ffe_is_warn_surprising_ = (f))
-#define ffe_set_is_zeros(f) (ffe_is_zeros_ = (f))
-#define ffe_set_fixed_line_length(l) (ffe_fixed_line_length_ = (l))
-#define ffe_state_max(s1,s2) ((s1) > (s2) ? (s1) : (s2))
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
+extern bool ffe_is_null_version_;
+int ffe_decode_option (int argc, char **argv);
+#define ffe_is_null_version() ffe_is_null_version_
+#define ffe_set_is_do_internal_checks(f) (ffe_is_do_internal_checks_ = (f))
+#define ffe_set_is_null_version(f) (ffe_is_null_version_ = (f))
diff --git a/gcc/f/tree.j b/gcc/f/tree.j
index 3b836b32819..5bf37928672 100644
--- a/gcc/f/tree.j
+++ b/gcc/f/tree.j
@@ -1,28 +1 @@
-/* tree.j -- Wrapper for GCC's tree.h
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef MAKING_DEPENDENCIES
-#ifndef _J_f_tree
-#define _J_f_tree
-#include "config.j"
-#include "tree.h"
-#endif
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/type.c b/gcc/f/type.c
index f359362849f..5bf37928672 100644
--- a/gcc/f/type.c
+++ b/gcc/f/type.c
@@ -1,107 +1 @@
-/* Implementation of Fortran type abstraction
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#include "proj.h"
-#include "type.h"
-#include "malloc.h"
-
-
-/* Look up a type given its base type and kind value. */
-
-ffetype
-ffetype_lookup_kind (ffetype base_type, int kind)
-{
- if ((base_type->kinds_ == NULL)
- || (kind < 0)
- || (((size_t) kind) >= ARRAY_SIZE (base_type->kinds_->type_)))
- return NULL;
-
- return base_type->kinds_->type_[kind];
-}
-
-ffetype
-ffetype_lookup_star (ffetype base_type, int star)
-{
- if ((base_type->stars_ == NULL)
- || (star < 0)
- || (((size_t) star) >= ARRAY_SIZE (base_type->stars_->type_)))
- return NULL;
-
- return base_type->stars_->type_[star];
-}
-
-ffetype
-ffetype_new (void)
-{
- ffetype type;
-
- type = (ffetype) malloc_new_kp (malloc_pool_image (), "ffetype",
- sizeof (*type));
- type->kinds_ = NULL;
- type->stars_ = NULL;
- type->alignment_ = 0;
- type->modulo_ = 0;
- type->size_ = 0;
-
- return type;
-}
-
-void
-ffetype_set_kind (ffetype base_type, int kind, ffetype type)
-{
- assert (kind < (int) sizeof (*(base_type->kinds_)));
-
- if (base_type->kinds_ == NULL)
- {
- int i;
-
- base_type->kinds_
- = (ffetype_indexes_) malloc_new_kp (malloc_pool_image (),
- "ffetype_indexes_[kinds]",
- sizeof (*(base_type->kinds_)));
- for (i = 0; ((size_t) i) < ARRAY_SIZE (base_type->kinds_->type_); ++i)
- base_type->kinds_->type_[i] = NULL;
- }
-
- assert (base_type->kinds_->type_[kind] == NULL);
-
- base_type->kinds_->type_[kind] = type;
-}
-
-void
-ffetype_set_star (ffetype base_type, int star, ffetype type)
-{
- if (base_type->stars_ == NULL)
- {
- int i;
-
- base_type->stars_
- = (ffetype_indexes_) malloc_new_kp (malloc_pool_image (),
- "ffetype_indexes_[stars]",
- sizeof (*(base_type->stars_)));
- for (i = 0; ((size_t) i) < ARRAY_SIZE (base_type->stars_->type_); ++i)
- base_type->stars_->type_[i] = NULL;
- }
-
- assert (base_type->stars_->type_[star] == NULL);
-
- base_type->stars_->type_[star] = type;
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/type.h b/gcc/f/type.h
index a89364fa4b9..5bf37928672 100644
--- a/gcc/f/type.h
+++ b/gcc/f/type.h
@@ -1,64 +1 @@
-/* Interface definitions for Fortran type abstraction
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef _H_f_type
-#define _H_f_type
-
-typedef struct _ffetype_ *ffetype;
-typedef struct _ffetype_indexes_ *ffetype_indexes_;
-
-struct _ffetype_
- {
- ffetype_indexes_ kinds_;
- ffetype_indexes_ stars_;
- int alignment_;
- int modulo_;
- int size_;
- };
-
-struct _ffetype_indexes_
- {
- ffetype type_[40]; /* *n, KIND=n: 0 <= n <= 39. */
- };
-
-#define ffetype_alignment(t) ((t)->alignment_)
-#define ffetype_init_0()
-#define ffetype_init_1()
-#define ffetype_init_2()
-#define ffetype_init_3()
-#define ffetype_init_4()
-ffetype ffetype_lookup_kind (ffetype base_type, int kind);
-ffetype ffetype_lookup_star (ffetype base_type, int star);
-#define ffetype_modulo(t) ((t)->modulo_)
-ffetype ffetype_new (void);
-#define ffetype_set_ams(t,a,m,s) ((t)->alignment_ = (a), \
- (t)->modulo_ = (m), \
- (t)->size_ = (s))
-void ffetype_set_kind (ffetype base_type, int kind, ffetype type);
-void ffetype_set_star (ffetype base_type, int star, ffetype type);
-#define ffetype_size(t) ((t)->size_)
-#define ffetype_terminate_0()
-#define ffetype_terminate_1()
-#define ffetype_terminate_2()
-#define ffetype_terminate_3()
-#define ffetype_terminate_4()
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/version.c b/gcc/f/version.c
index 6fbc1caa87d..417a538b18c 100644
--- a/gcc/f/version.c
+++ b/gcc/f/version.c
@@ -1,34 +1 @@
-/* version.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
- None
-
- Description:
- Has the version number for the front end. Makes it easier to
- tell how consistently patches have been applied, etc.
-
- Modifications:
-*/
-
-#include "version.h"
-
-char *ffe_version_string = "0.5.22-release";
+char *ffe_version_string = "0.5.24-19980804";
diff --git a/gcc/f/version.h b/gcc/f/version.h
index f8dcd327e27..cd578a8b1e3 100644
--- a/gcc/f/version.h
+++ b/gcc/f/version.h
@@ -1,30 +1,3 @@
-/* version.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- version.c
-
- Modifications:
-*/
-
#ifndef _H_f_version
#define _H_f_version
diff --git a/gcc/f/where.c b/gcc/f/where.c
index 7442a5fac3a..5bf37928672 100644
--- a/gcc/f/where.c
+++ b/gcc/f/where.c
@@ -1,542 +1 @@
-/* where.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Related Modules:
-
- Description:
- Simple data abstraction for Fortran source lines (called card images).
-
- Modifications:
-*/
-
-/* Include files. */
-
-#include "proj.h"
-#include "where.h"
-#include "lex.h"
-#include "malloc.h"
-
-/* Externals defined here. */
-
-struct _ffewhere_line_ ffewhere_unknown_line_
-=
-{NULL, NULL, 0, 0, 0};
-
-/* Simple definitions and enumerations. */
-
-
-/* Internal typedefs. */
-
-typedef struct _ffewhere_ll_ *ffewhereLL_;
-
-/* Private include files. */
-
-
-/* Internal structure definitions. */
-
-struct _ffewhere_ll_
- {
- ffewhereLL_ next;
- ffewhereLL_ previous;
- ffewhereFile wf;
- ffewhereLineNumber line_no; /* ffelex_line_number() at time of creation. */
- ffewhereLineNumber offset; /* User-desired offset (usually 1). */
- };
-
-struct _ffewhere_root_ll_
- {
- ffewhereLL_ first;
- ffewhereLL_ last;
- };
-
-struct _ffewhere_root_line_
- {
- ffewhereLine first;
- ffewhereLine last;
- ffewhereLineNumber none;
- };
-
-/* Static objects accessed by functions in this module. */
-
-static struct _ffewhere_root_ll_ ffewhere_root_ll_;
-static struct _ffewhere_root_line_ ffewhere_root_line_;
-
-/* Static functions (internal). */
-
-static ffewhereLL_ ffewhere_ll_lookup_ (ffewhereLineNumber ln);
-
-/* Internal macros. */
-
-
-/* Look up line-to-line object from absolute line num. */
-
-static ffewhereLL_
-ffewhere_ll_lookup_ (ffewhereLineNumber ln)
-{
- ffewhereLL_ ll;
-
- if (ln == 0)
- return ffewhere_root_ll_.first;
-
- for (ll = ffewhere_root_ll_.last;
- ll != (ffewhereLL_) &ffewhere_root_ll_.first;
- ll = ll->previous)
- {
- if (ll->line_no <= ln)
- return ll;
- }
-
- assert ("no line num" == NULL);
- return NULL;
-}
-
-/* Kill file object.
-
- Note that this object must not have been passed in a call
- to any other ffewhere function except ffewhere_file_name and
- ffewhere_file_namelen. */
-
-void
-ffewhere_file_kill (ffewhereFile wf)
-{
- malloc_kill_ks (ffe_pool_file (), wf,
- offsetof (struct _ffewhere_file_, text)
- + wf->length + 1);
-}
-
-/* Create file object. */
-
-ffewhereFile
-ffewhere_file_new (char *name, size_t length)
-{
- ffewhereFile wf;
-
- wf = malloc_new_ks (ffe_pool_file (), "ffewhereFile",
- offsetof (struct _ffewhere_file_, text)
- + length + 1);
- wf->length = length;
- memcpy (&wf->text[0], name, length);
- wf->text[length] = '\0';
-
- return wf;
-}
-
-/* Set file and first line number.
-
- Pass FALSE if no line number is specified. */
-
-void
-ffewhere_file_set (ffewhereFile wf, bool have_num, ffewhereLineNumber ln)
-{
- ffewhereLL_ ll;
-
- ll = malloc_new_kp (ffe_pool_file (), "ffewhereLL_", sizeof (*ll));
- ll->next = (ffewhereLL_) &ffewhere_root_ll_.first;
- ll->previous = ffewhere_root_ll_.last;
- ll->next->previous = ll;
- ll->previous->next = ll;
- if (wf == NULL)
- {
- if (ll->previous == ll->next)
- ll->wf = NULL;
- else
- ll->wf = ll->previous->wf;
- }
- else
- ll->wf = wf;
- ll->line_no = ffelex_line_number ();
- if (have_num)
- ll->offset = ln;
- else
- {
- if (ll->previous == ll->next)
- ll->offset = 1;
- else
- ll->offset
- = ll->line_no - ll->previous->line_no + ll->previous->offset;
- }
-}
-
-/* Do initializations. */
-
-void
-ffewhere_init_1 ()
-{
- ffewhere_root_line_.first = ffewhere_root_line_.last
- = (ffewhereLine) &ffewhere_root_line_.first;
- ffewhere_root_line_.none = 0;
-
- ffewhere_root_ll_.first = ffewhere_root_ll_.last
- = (ffewhereLL_) &ffewhere_root_ll_.first;
-}
-
-/* Return the textual content of the line. */
-
-char *
-ffewhere_line_content (ffewhereLine wl)
-{
- assert (wl != NULL);
- return wl->content;
-}
-
-/* Look up file object from line object. */
-
-ffewhereFile
-ffewhere_line_file (ffewhereLine wl)
-{
- ffewhereLL_ ll;
-
- assert (wl != NULL);
- ll = ffewhere_ll_lookup_ (wl->line_num);
- return ll->wf;
-}
-
-/* Lookup file object from line object, calc line#. */
-
-ffewhereLineNumber
-ffewhere_line_filelinenum (ffewhereLine wl)
-{
- ffewhereLL_ ll;
-
- assert (wl != NULL);
- ll = ffewhere_ll_lookup_ (wl->line_num);
- return wl->line_num + ll->offset - ll->line_no;
-}
-
-/* Decrement use count for line, deallocate if no uses left. */
-
-void
-ffewhere_line_kill (ffewhereLine wl)
-{
-#if 0
- if (!ffewhere_line_is_unknown (wl))
- fprintf (dmpout, "; ffewhere_line_kill %" ffewhereLineNumber_f "u, uses=%"
- ffewhereUses_f_ "u\n",
- wl->line_num, wl->uses);
-#endif
- assert (ffewhere_line_is_unknown (wl) || (wl->uses != 0));
- if (!ffewhere_line_is_unknown (wl) && (--wl->uses == 0))
- {
- wl->previous->next = wl->next;
- wl->next->previous = wl->previous;
- malloc_kill_ks (ffe_pool_file (), wl,
- offsetof (struct _ffewhere_line_, content)
- + wl->length + 1);
- }
-}
-
-/* Make a new line or increment use count of existing one.
-
- Find out where line object is, if anywhere. If in lexer, it might also
- be at the end of the list of lines, else put it on the end of the list.
- Then, if in the list of lines, increment the use count and return the
- line object. Else, make an empty line object (no line) and return
- that. */
-
-ffewhereLine
-ffewhere_line_new (ffewhereLineNumber ln)
-{
- ffewhereLine wl = ffewhere_root_line_.last;
-
- /* If this is the lexer's current line, see if it is already at the end of
- the list, and if not, make it and return it. */
-
- if (((ln == 0) /* Presumably asking for EOF pointer. */
- || (wl->line_num != ln))
- && (ffelex_line_number () == ln))
- {
-#if 0
- fprintf (dmpout,
- "; ffewhere_line_new %" ffewhereLineNumber_f "u, lexer\n",
- ln);
-#endif
- wl = malloc_new_ks (ffe_pool_file (), "FFEWHERE line",
- offsetof (struct _ffewhere_line_, content)
- + (size_t) ffelex_line_length () + 1);
- wl->next = (ffewhereLine) &ffewhere_root_line_;
- wl->previous = ffewhere_root_line_.last;
- wl->previous->next = wl;
- wl->next->previous = wl;
- wl->line_num = ln;
- wl->uses = 1;
- wl->length = ffelex_line_length ();
- strcpy (wl->content, ffelex_line ());
- return wl;
- }
-
- /* See if line is on list already. */
-
- while (wl->line_num > ln)
- wl = wl->previous;
-
- /* If line is there, increment its use count and return. */
-
- if (wl->line_num == ln)
- {
-#if 0
- fprintf (dmpout, "; ffewhere_line_new %" ffewhereLineNumber_f "u, uses=%"
- ffewhereUses_f_ "u\n", ln,
- wl->uses);
-#endif
- wl->uses++;
- return wl;
- }
-
- /* Else, make a new one with a blank line (since we've obviously lost it,
- which should never happen) and return it. */
-
- fprintf (stderr,
- "(Cannot resurrect line %lu for error reporting purposes.)\n",
- ln);
-
- wl = malloc_new_ks (ffe_pool_file (), "FFEWHERE line",
- offsetof (struct _ffewhere_line_, content)
- + 1);
- wl->next = (ffewhereLine) &ffewhere_root_line_;
- wl->previous = ffewhere_root_line_.last;
- wl->previous->next = wl;
- wl->next->previous = wl;
- wl->line_num = ln;
- wl->uses = 1;
- wl->length = 0;
- *(wl->content) = '\0';
- return wl;
-}
-
-/* Increment use count of line, as in a copy. */
-
-ffewhereLine
-ffewhere_line_use (ffewhereLine wl)
-{
-#if 0
- fprintf (dmpout, "; ffewhere_line_use %" ffewhereLineNumber_f "u, uses=%" ffewhereUses_f_
- "u\n", wl->line_num, wl->uses);
-#endif
- assert (ffewhere_line_is_unknown (wl) || (wl->uses != 0));
- if (!ffewhere_line_is_unknown (wl))
- ++wl->uses;
- return wl;
-}
-
-/* Set an ffewhere object based on a track index.
-
- Determines the absolute line and column number of a character at a given
- index into an ffewhereTrack array. wr* is the reference position, wt is
- the tracking information, and i is the index desired. wo* is set to wr*
- plus the continual offsets described by wt[0...i-1], or unknown if any of
- the continual offsets are not known. */
-
-void
-ffewhere_set_from_track (ffewhereLine *wol, ffewhereColumn *woc,
- ffewhereLine wrl, ffewhereColumn wrc,
- ffewhereTrack wt, ffewhereIndex i)
-{
- ffewhereLineNumber ln;
- ffewhereColumnNumber cn;
- ffewhereIndex j;
- ffewhereIndex k;
-
- if ((i == 0) || (i >= FFEWHERE_indexMAX))
- {
- *wol = ffewhere_line_use (wrl);
- *woc = ffewhere_column_use (wrc);
- }
- else
- {
- ln = ffewhere_line_number (wrl);
- cn = ffewhere_column_number (wrc);
- for (j = 0, k = 0; j < i; ++j, k += 2)
- {
- if ((wt[k] == FFEWHERE_indexUNKNOWN)
- || (wt[k + 1] == FFEWHERE_indexUNKNOWN))
- {
- *wol = ffewhere_line_unknown ();
- *woc = ffewhere_column_unknown ();
- return;
- }
- if (wt[k] == 0)
- cn += wt[k + 1] + 1;
- else
- {
- ln += wt[k];
- cn = wt[k + 1] + 1;
- }
- }
- if (ln == ffewhere_line_number (wrl))
- { /* Already have the line object, just use it
- directly. */
- *wol = ffewhere_line_use (wrl);
- }
- else /* Must search for the line object. */
- *wol = ffewhere_line_new (ln);
- *woc = ffewhere_column_new (cn);
- }
-}
-
-/* Build next tracking index.
-
- Set wt[i-1] continual offset so that it offsets from w* to (ln,cn). Update
- w* to contain (ln,cn). DO NOT call this routine if i >= FFEWHERE_indexMAX
- or i == 0. */
-
-void
-ffewhere_track (ffewhereLine *wl, ffewhereColumn *wc, ffewhereTrack wt,
- ffewhereIndex i, ffewhereLineNumber ln,
- ffewhereColumnNumber cn)
-{
- unsigned int lo;
- unsigned int co;
-
- if ((ffewhere_line_is_unknown (*wl))
- || (ffewhere_column_is_unknown (*wc))
- || ((lo = ln - ffewhere_line_number (*wl)) >= FFEWHERE_indexUNKNOWN))
- {
- wt[i * 2 - 2] = wt[i * 2 - 1] = FFEWHERE_indexUNKNOWN;
- ffewhere_line_kill (*wl);
- ffewhere_column_kill (*wc);
- *wl = FFEWHERE_lineUNKNOWN;
- *wc = FFEWHERE_columnUNKNOWN;
- }
- else if (lo == 0)
- {
- wt[i * 2 - 2] = 0;
- if ((co = cn - ffewhere_column_number (*wc)) > FFEWHERE_indexUNKNOWN)
- {
- wt[i * 2 - 1] = FFEWHERE_indexUNKNOWN;
- ffewhere_line_kill (*wl);
- ffewhere_column_kill (*wc);
- *wl = FFEWHERE_lineUNKNOWN;
- *wc = FFEWHERE_columnUNKNOWN;
- }
- else
- {
- wt[i * 2 - 1] = co - 1;
- ffewhere_column_kill (*wc);
- *wc = ffewhere_column_use (ffewhere_column_new (cn));
- }
- }
- else
- {
- wt[i * 2 - 2] = lo;
- if (cn > FFEWHERE_indexUNKNOWN)
- {
- wt[i * 2 - 1] = FFEWHERE_indexUNKNOWN;
- ffewhere_line_kill (*wl);
- ffewhere_column_kill (*wc);
- *wl = ffewhere_line_unknown ();
- *wc = ffewhere_column_unknown ();
- }
- else
- {
- wt[i * 2 - 1] = cn - 1;
- ffewhere_line_kill (*wl);
- ffewhere_column_kill (*wc);
- *wl = ffewhere_line_use (ffewhere_line_new (ln));
- *wc = ffewhere_column_use (ffewhere_column_new (cn));
- }
- }
-}
-
-/* Clear tracking index for internally created track.
-
- Set the tracking information to indicate that the tracking is at its
- simplest (no spaces or newlines within the tracking). This means set
- everything to zero in the current implementation. Length is the total
- length of the token; length must be 2 or greater, since length-1 tracking
- characters are set. */
-
-void
-ffewhere_track_clear (ffewhereTrack wt, ffewhereIndex length)
-{
- ffewhereIndex i;
-
- if (length > FFEWHERE_indexMAX)
- length = FFEWHERE_indexMAX;
-
- for (i = 1; i < length; ++i)
- wt[i * 2 - 2] = wt[i * 2 - 1] = 0;
-}
-
-/* Copy tracking index from one place to another.
-
- Copy tracking information from swt[start] to dwt[0] and so on, presumably
- after an ffewhere_set_from_track call. Length is the total
- length of the token; length must be 2 or greater, since length-1 tracking
- characters are set. */
-
-void
-ffewhere_track_copy (ffewhereTrack dwt, ffewhereTrack swt, ffewhereIndex start,
- ffewhereIndex length)
-{
- ffewhereIndex i;
- ffewhereIndex copy;
-
- if (length > FFEWHERE_indexMAX)
- length = FFEWHERE_indexMAX;
-
- if (length + start > FFEWHERE_indexMAX)
- copy = FFEWHERE_indexMAX - start;
- else
- copy = length;
-
- for (i = 1; i < copy; ++i)
- {
- dwt[i * 2 - 2] = swt[(i + start) * 2 - 2];
- dwt[i * 2 - 1] = swt[(i + start) * 2 - 1];
- }
-
- for (; i < length; ++i)
- {
- dwt[i * 2 - 2] = 0;
- dwt[i * 2 - 1] = 0;
- }
-}
-
-/* Kill tracking data.
-
- Kill all the tracking information by killing incremented lines from the
- first line number. */
-
-void
-ffewhere_track_kill (ffewhereLine wrl, ffewhereColumn wrc UNUSED,
- ffewhereTrack wt, ffewhereIndex length)
-{
- ffewhereLineNumber ln;
- unsigned int lo;
- ffewhereIndex i;
-
- ln = ffewhere_line_number (wrl);
-
- if (length > FFEWHERE_indexMAX)
- length = FFEWHERE_indexMAX;
-
- for (i = 0; i < length - 1; ++i)
- {
- if ((lo = wt[i * 2]) == FFEWHERE_indexUNKNOWN)
- break;
- else if (lo != 0)
- {
- ln += lo;
- wrl = ffewhere_line_new (ln);
- ffewhere_line_kill (wrl);
- }
- }
-}
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/f/where.h b/gcc/f/where.h
index aae031367d2..5bf37928672 100644
--- a/gcc/f/where.h
+++ b/gcc/f/where.h
@@ -1,138 +1 @@
-/* where.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
-
-This file is part of GNU Fortran.
-
-GNU Fortran is free software; you can 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 Fortran is distributed in the hope that it will be useful,
-but WITHOUT 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 Fortran; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-
- Owning Modules:
- where.c
-
- Modifications:
-*/
-
-/* Allow multiple inclusion to work. */
-
-#ifndef _H_f_where
-#define _H_f_where
-
-/* Simple definitions and enumerations. */
-
-#define FFEWHERE_columnMAX UCHAR_MAX
-#define FFEWHERE_columnUNKNOWN 0
-#define FFEWHERE_indexMAX 36
-#define FFEWHERE_indexUNKNOWN UCHAR_MAX
-#define FFEWHERE_lineMAX ULONG_MAX
-#define FFEWHERE_lineUNKNOWN (&ffewhere_unknown_line_)
-#define FFEWHERE_filenameUNKNOWN ("(input file)")
-
-/* Typedefs. */
-
-typedef unsigned char ffewhereColumnNumber; /* Change FFEWHERE_columnMAX
- too. */
-#define ffewhereColumnNumber_f ""
-typedef unsigned char ffewhereColumn;
-typedef struct _ffewhere_file_ *ffewhereFile;
-typedef unsigned short ffewhereLength_;
-#define ffewhereLength_f_ ""
-typedef unsigned long ffewhereLineNumber; /* Change FFEWHERE_lineMAX
- too. */
-#define ffewhereLineNumber_f "l"
-typedef struct _ffewhere_line_ *ffewhereLine;
-typedef unsigned char ffewhereIndex;
-#define ffewhereIndex_f ""
-typedef ffewhereIndex ffewhereTrack[FFEWHERE_indexMAX * 2 - 2];
-typedef unsigned int ffewhereUses_;
-#define ffewhereUses_f_ ""
-
-/* Include files needed by this one. */
-
-#include "glimits.j"
-#include "top.h"
-
-/* Structure definitions. */
-
-struct _ffewhere_file_
- {
- size_t length;
- char text[1];
- };
-
-struct _ffewhere_line_
- {
- ffewhereLine next;
- ffewhereLine previous;
- ffewhereLineNumber line_num;
- ffewhereUses_ uses;
- ffewhereLength_ length;
- char content[1];
- };
-
-/* Global objects accessed by users of this module. */
-
-extern struct _ffewhere_line_ ffewhere_unknown_line_;
-
-/* Declare functions with prototypes. */
-
-void ffewhere_file_kill (ffewhereFile wf);
-ffewhereFile ffewhere_file_new (char *name, size_t length);
-void ffewhere_file_set (ffewhereFile wf, bool have_num, ffewhereLineNumber ln);
-void ffewhere_init_1 (void);
-char *ffewhere_line_content (ffewhereLine l);
-ffewhereFile ffewhere_line_file (ffewhereLine l);
-ffewhereLineNumber ffewhere_line_filelinenum (ffewhereLine l);
-void ffewhere_line_kill (ffewhereLine l);
-ffewhereLine ffewhere_line_new (ffewhereLineNumber ln);
-ffewhereLine ffewhere_line_use (ffewhereLine wl);
-void ffewhere_set_from_track (ffewhereLine *wol, ffewhereColumn *woc,
- ffewhereLine wrl, ffewhereColumn wrc, ffewhereTrack wt,
- ffewhereIndex i);
-void ffewhere_track (ffewhereLine *wl, ffewhereColumn *wc, ffewhereTrack wt,
- ffewhereIndex i, ffewhereLineNumber ln, ffewhereColumnNumber cn);
-void ffewhere_track_clear (ffewhereTrack wt, ffewhereIndex length);
-void ffewhere_track_copy (ffewhereTrack dwt, ffewhereTrack swt,
- ffewhereIndex start, ffewhereIndex length);
-void ffewhere_track_kill (ffewhereLine wrl, ffewhereColumn wrc, ffewhereTrack wt,
- ffewhereIndex length);
-
-/* Define macros. */
-
-#define ffewhere_column_is_unknown(c) (c == FFEWHERE_columnUNKNOWN)
-#define ffewhere_column_kill(c) ((void) 0)
-#define ffewhere_column_new(cn) (cn)
-#define ffewhere_column_number(c) (c)
-#define ffewhere_column_unknown() (FFEWHERE_columnUNKNOWN)
-#define ffewhere_column_use(c) (c)
-#define ffewhere_file_name(f) ((f)->text)
-#define ffewhere_file_namelen(f) ((f)->length)
-#define ffewhere_init_0()
-#define ffewhere_init_2()
-#define ffewhere_init_3()
-#define ffewhere_init_4()
-#define ffewhere_line_filename(l) (ffewhere_line_file(l)->text)
-#define ffewhere_line_is_unknown(l) (l == FFEWHERE_lineUNKNOWN)
-#define ffewhere_line_number(l) ((l)->line_num)
-#define ffewhere_line_unknown() (FFEWHERE_lineUNKNOWN)
-#define ffewhere_terminate_0()
-#define ffewhere_terminate_1()
-#define ffewhere_terminate_2()
-#define ffewhere_terminate_3()
-#define ffewhere_terminate_4()
-
-/* End of #include file. */
-
-#endif
+ Contributed by James Craig Burley (burley@gnu.org).
diff --git a/gcc/final.c b/gcc/final.c
index 594ed3567af..04f72cd422c 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -45,11 +45,6 @@ Boston, MA 02111-1307, USA. */
FUNCTION_EPILOGUE. Those instructions never exist as rtl. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include "tree.h"
@@ -68,20 +63,35 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "except.h"
#include "toplev.h"
+#include "reload.h"
/* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist. */
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
-#if defined (USG) || defined (NO_STAB_H)
+#include "dbxout.h"
+#if defined (USG) || !defined (HAVE_STAB_H)
#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
#else
-#include <stab.h> /* On BSD, use the system's stab.h. */
-#endif /* not USG */
+#include <stab.h>
+#endif
+
#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
#endif
+#ifdef DWARF_DEBUGGING_INFO
+#include "dwarfout.h"
+#endif
+
+#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
+#include "dwarf2out.h"
+#endif
+
+#ifdef SDB_DEBUGGING_INFO
+#include "sdbout.h"
+#endif
+
/* .stabd code for line number. */
#ifndef N_SLINE
#define N_SLINE 0x44
@@ -116,6 +126,10 @@ Boston, MA 02111-1307, USA. */
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == ';')
#endif
+#ifndef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
+#endif
+
/* Nonzero means this function is a leaf function, with no function calls.
This variable exists to be examined in FUNCTION_PROLOGUE
and FUNCTION_EPILOGUE. Always zero, unless set by some action. */
@@ -635,9 +649,14 @@ int insn_current_align;
for each insn we'll call the alignment chain of this insn in the following
comments. */
-rtx *uid_align;
-int *uid_shuid;
-short *label_align;
+struct label_alignment {
+ short alignment;
+ short max_skip;
+};
+
+static rtx *uid_align;
+static int *uid_shuid;
+static struct label_alignment *label_align;
/* Indicate that branch shortening hasn't yet been done. */
@@ -780,14 +799,26 @@ get_attr_length (insn)
#define LABEL_ALIGN(LABEL) 0
#endif
+#ifndef LABEL_ALIGN_MAX_SKIP
+#define LABEL_ALIGN_MAX_SKIP 0
+#endif
+
#ifndef LOOP_ALIGN
#define LOOP_ALIGN(LABEL) 0
#endif
+#ifndef LOOP_ALIGN_MAX_SKIP
+#define LOOP_ALIGN_MAX_SKIP 0
+#endif
+
#ifndef LABEL_ALIGN_AFTER_BARRIER
#define LABEL_ALIGN_AFTER_BARRIER(LABEL) 0
#endif
+#ifndef LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
+#define LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP 0
+#endif
+
#ifndef ADDR_VEC_ALIGN
int
final_addr_vec_align (addr_vec)
@@ -812,7 +843,10 @@ final_addr_vec_align (addr_vec)
static int min_labelno, max_labelno;
#define LABEL_TO_ALIGNMENT(LABEL) \
- (label_align[CODE_LABEL_NUMBER (LABEL) - min_labelno])
+ (label_align[CODE_LABEL_NUMBER (LABEL) - min_labelno].alignment)
+
+#define LABEL_TO_MAX_SKIP(LABEL) \
+ (label_align[CODE_LABEL_NUMBER (LABEL) - min_labelno].max_skip)
/* For the benefit of port specific code do this also as a function. */
int
@@ -948,6 +982,7 @@ shorten_branches (first)
int max_uid;
int i;
int max_log;
+ int max_skip;
#ifdef HAVE_ATTR_length
#define MAX_CODE_ALIGN 16
rtx seq;
@@ -987,8 +1022,8 @@ shorten_branches (first)
max_labelno = max_label_num ();
min_labelno = get_first_label_num ();
- label_align
- = (short*) xcalloc ((max_labelno - min_labelno + 1), sizeof (short));
+ label_align = (struct label_alignment **)
+ xcalloc ((max_labelno - min_labelno + 1), sizeof (struct label_alignment));
uid_shuid = (int *) xmalloc (max_uid * sizeof *uid_shuid);
@@ -998,7 +1033,10 @@ shorten_branches (first)
impose on the next CODE_LABEL (or the current one if we are processing
the CODE_LABEL itself). */
- for (max_log = 0, insn = get_insns (), i = 1; insn; insn = NEXT_INSN (insn))
+ max_log = 0;
+ max_skip = 0;
+
+ for (insn = get_insns (), i = 1; insn; insn = NEXT_INSN (insn))
{
int log;
@@ -1017,24 +1055,36 @@ shorten_branches (first)
log = LABEL_ALIGN (insn);
if (max_log < log)
- max_log = log;
- next = NEXT_INSN (insn);
-/* ADDR_VECs only take room if read-only data goes into the text section. */
-#if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
- if (next && GET_CODE (next) == JUMP_INSN)
{
- rtx nextbody = PATTERN (next);
- if (GET_CODE (nextbody) == ADDR_VEC
- || GET_CODE (nextbody) == ADDR_DIFF_VEC)
- {
- log = ADDR_VEC_ALIGN (next);
- if (max_log < log)
- max_log = log;
- }
+ max_log = log;
+ max_skip = LABEL_ALIGN_MAX_SKIP;
}
+ next = NEXT_INSN (insn);
+ /* ADDR_VECs only take room if read-only data goes into the text
+ section. */
+ if (JUMP_TABLES_IN_TEXT_SECTION
+#if !defined(READONLY_DATA_SECTION)
+ || 1
#endif
+ )
+ if (next && GET_CODE (next) == JUMP_INSN)
+ {
+ rtx nextbody = PATTERN (next);
+ if (GET_CODE (nextbody) == ADDR_VEC
+ || GET_CODE (nextbody) == ADDR_DIFF_VEC)
+ {
+ log = ADDR_VEC_ALIGN (next);
+ if (max_log < log)
+ {
+ max_log = log;
+ max_skip = LABEL_ALIGN_MAX_SKIP;
+ }
+ }
+ }
LABEL_TO_ALIGNMENT (insn) = max_log;
+ LABEL_TO_MAX_SKIP (insn) = max_skip;
max_log = 0;
+ max_skip = 0;
}
else if (GET_CODE (insn) == BARRIER)
{
@@ -1046,7 +1096,10 @@ shorten_branches (first)
{
log = LABEL_ALIGN_AFTER_BARRIER (insn);
if (max_log < log)
- max_log = log;
+ {
+ max_log = log;
+ max_skip = LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP;
+ }
break;
}
}
@@ -1062,7 +1115,10 @@ shorten_branches (first)
{
log = LOOP_ALIGN (insn);
if (max_log < log)
- max_log = log;
+ {
+ max_log = log;
+ max_skip = LOOP_ALIGN_MAX_SKIP;
+ }
break;
}
}
@@ -1196,11 +1252,15 @@ shorten_branches (first)
{
/* This only takes room if read-only data goes into the text
section. */
-#if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
- insn_lengths[uid] = (XVECLEN (body, GET_CODE (body) == ADDR_DIFF_VEC)
- * GET_MODE_SIZE (GET_MODE (body)));
+ if (JUMP_TABLES_IN_TEXT_SECTION
+#if !defined(READONLY_DATA_SECTION)
+ || 1
+#endif
+ )
+ insn_lengths[uid] = (XVECLEN (body,
+ GET_CODE (body) == ADDR_DIFF_VEC)
+ * GET_MODE_SIZE (GET_MODE (body)));
/* Alignment is handled by ADDR_VEC_ALIGN. */
-#endif
}
else if (asm_noperands (body) >= 0)
insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn);
@@ -1391,13 +1451,19 @@ shorten_branches (first)
PUT_MODE (body, CASE_VECTOR_SHORTEN_MODE (min_addr - rel_addr,
max_addr - rel_addr,
body));
-#if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
- insn_lengths[uid]
- = (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body)));
- insn_current_address += insn_lengths[uid];
- if (insn_lengths[uid] != old_length)
- something_changed = 1;
+ if (JUMP_TABLES_IN_TEXT_SECTION
+#if !defined(READONLY_DATA_SECTION)
+ || 1
#endif
+ )
+ {
+ insn_lengths[uid]
+ = (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body)));
+ insn_current_address += insn_lengths[uid];
+ if (insn_lengths[uid] != old_length)
+ something_changed = 1;
+ }
+
continue;
}
#endif /* CASE_VECTOR_SHORTEN_MODE */
@@ -1520,7 +1586,7 @@ final_start_function (first, file, optimize)
int i;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (!call_used_regs[i] && !call_fixed_regs[i])
+ if (!call_used_regs[i])
regs_ever_live[i] = 1;
}
#endif
@@ -1908,6 +1974,18 @@ final (first, file, optimize, prescan)
max_uid = INSN_UID (insn);
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
line_note_exists[NOTE_LINE_NUMBER (insn)] = 1;
+#ifdef HAVE_cc0
+ /* If CC tracking across branches is enabled, record the insn which
+ jumps to each branch only reached from one place. */
+ if (optimize && GET_CODE (insn) == JUMP_INSN)
+ {
+ rtx lab = JUMP_LABEL (insn);
+ if (lab && LABEL_NUSES (lab) == 1)
+ {
+ LABEL_REFS (lab) = insn;
+ }
+ }
+#endif
}
/* Initialize insn_eh_region table if eh is being used. */
@@ -1981,7 +2059,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
&& ! exceptions_via_longjmp)
{
ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_BLOCK_NUMBER (insn));
- add_eh_table_entry (NOTE_BLOCK_NUMBER (insn));
+ if (! flag_new_exceptions)
+ add_eh_table_entry (NOTE_BLOCK_NUMBER (insn));
#ifdef ASM_OUTPUT_EH_REGION_BEG
ASM_OUTPUT_EH_REGION_BEG (file, NOTE_BLOCK_NUMBER (insn));
#endif
@@ -1992,6 +2071,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
&& ! exceptions_via_longjmp)
{
ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_BLOCK_NUMBER (insn));
+ if (flag_new_exceptions)
+ add_eh_table_entry (NOTE_BLOCK_NUMBER (insn));
#ifdef ASM_OUTPUT_EH_REGION_END
ASM_OUTPUT_EH_REGION_END (file, NOTE_BLOCK_NUMBER (insn));
#endif
@@ -2197,11 +2278,44 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (CODE_LABEL_NUMBER (insn) <= max_labelno)
{
int align = LABEL_TO_ALIGNMENT (insn);
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
+ int max_skip = LABEL_TO_MAX_SKIP (insn);
+#endif
if (align && NEXT_INSN (insn))
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
+ ASM_OUTPUT_MAX_SKIP_ALIGN (file, align, max_skip);
+#else
ASM_OUTPUT_ALIGN (file, align);
+#endif
}
+#ifdef HAVE_cc0
CC_STATUS_INIT;
+ /* If this label is reached from only one place, set the condition
+ codes from the instruction just before the branch. */
+
+ /* Disabled because some insns set cc_status in the C output code
+ and NOTICE_UPDATE_CC alone can set incorrect status. */
+ if (0 /* optimize && LABEL_NUSES (insn) == 1*/)
+ {
+ rtx jump = LABEL_REFS (insn);
+ rtx barrier = prev_nonnote_insn (insn);
+ rtx prev;
+ /* If the LABEL_REFS field of this label has been set to point
+ at a branch, the predecessor of the branch is a regular
+ insn, and that branch is the only way to reach this label,
+ set the condition codes based on the branch and its
+ predecessor. */
+ if (barrier && GET_CODE (barrier) == BARRIER
+ && jump && GET_CODE (jump) == JUMP_INSN
+ && (prev = prev_nonnote_insn (jump))
+ && GET_CODE (prev) == INSN)
+ {
+ NOTICE_UPDATE_CC (PATTERN (prev), prev);
+ NOTICE_UPDATE_CC (PATTERN (jump), jump);
+ }
+ }
+#endif
if (prescan > 0)
break;
new_block = 1;
@@ -2239,22 +2353,30 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (GET_CODE (nextbody) == ADDR_VEC
|| GET_CODE (nextbody) == ADDR_DIFF_VEC)
{
-#ifndef JUMP_TABLES_IN_TEXT_SECTION
- readonly_data_section ();
+#if defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC)
+ /* In this case, the case vector is being moved by the
+ target, so don't output the label at all. Leave that
+ to the back end macros. */
+#else
+ if (! JUMP_TABLES_IN_TEXT_SECTION)
+ {
+ readonly_data_section ();
#ifdef READONLY_DATA_SECTION
- ASM_OUTPUT_ALIGN (file,
- exact_log2 (BIGGEST_ALIGNMENT
- / BITS_PER_UNIT));
+ ASM_OUTPUT_ALIGN (file,
+ exact_log2 (BIGGEST_ALIGNMENT
+ / BITS_PER_UNIT));
#endif /* READONLY_DATA_SECTION */
-#else /* JUMP_TABLES_IN_TEXT_SECTION */
- function_section (current_function_decl);
-#endif /* JUMP_TABLES_IN_TEXT_SECTION */
+ }
+ else
+ function_section (current_function_decl);
+
#ifdef ASM_OUTPUT_CASE_LABEL
ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
NEXT_INSN (insn));
#else
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
#endif
+#endif
break;
}
}
@@ -2308,6 +2430,24 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
app_on = 0;
}
+#if defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC)
+ if (GET_CODE (body) == ADDR_VEC)
+ {
+#ifdef ASM_OUTPUT_ADDR_VEC
+ ASM_OUTPUT_ADDR_VEC (PREV_INSN (insn), body);
+#else
+ abort();
+#endif
+ }
+ else
+ {
+#ifdef ASM_OUTPUT_ADDR_DIFF_VEC
+ ASM_OUTPUT_ADDR_DIFF_VEC (PREV_INSN (insn), body);
+#else
+ abort();
+#endif
+ }
+#else
vlen = XVECLEN (body, GET_CODE (body) == ADDR_DIFF_VEC);
for (idx = 0; idx < vlen; idx++)
{
@@ -2338,6 +2478,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
CODE_LABEL_NUMBER (PREV_INSN (insn)),
insn);
#endif
+#endif
function_section (current_function_decl);
@@ -2773,7 +2914,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
/* If we didn't split the insn, go away. */
if (new == insn && PATTERN (new) == body)
- abort ();
+ fatal_insn ("Could not split insn", insn);
#ifdef HAVE_ATTR_length
/* This instruction should have been split in shorten_branches,
@@ -2932,6 +3073,8 @@ alter_subreg (x)
- MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (y))));
PUT_CODE (x, MEM);
MEM_VOLATILE_P (x) = MEM_VOLATILE_P (y);
+ MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (y);
+ MEM_ALIAS_SET (x) = MEM_ALIAS_SET (y);
XEXP (x, 0) = plus_constant (XEXP (y, 0), offset);
}
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 3456e531c13..698c69de80b 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -72,16 +72,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "hconfig.h"
#include "system.h"
+#include "gansidecl.h"
#include "obstack.h"
#include "scan.h"
#include "cpplib.h"
-#include "gansidecl.h"
+#include "cpphash.h"
-extern void cpp_fatal ();
-
-#if !__STDC__ && !defined(const)
-#define const /* nothing */
-#endif
+void fatal PVPROTO ((const char *, ...)) ATTRIBUTE_PRINTF_1;
sstring buf;
@@ -339,7 +336,7 @@ setgid\0setpgid\0setsid\0setuid\0sleep\0sysconf\0tcgetpgrp\0tcsetpgrp\0\
ttyname\0unlink\0write\0" },
{ CONTINUED, POSIX2_SYMBOL, "getopt\0" },
{ CONTINUED, XOPEN_EXTENDED_SYMBOL,
- "lockf\0gethostid\0gethostname\0readlink\0" },
+ "lockf\0gethostid\0gethostname\0readlink\0symlink\0" },
{ "utime.h", POSIX1_SYMBOL, "utime\0" },
@@ -1327,7 +1324,8 @@ main (argc, argv)
because we want to suppress error messages. */
void
-cpp_file_line_for_message (filename, line, column)
+cpp_file_line_for_message (pfile, filename, line, column)
+ cpp_reader * pfile;
char *filename;
int line, column;
{
@@ -1341,17 +1339,18 @@ cpp_file_line_for_message (filename, line, column)
void
cpp_print_containing_files (pfile)
- cpp_reader *pfile;
+ cpp_reader *pfile ATTRIBUTE_UNUSED;
{
}
/* IS_ERROR is 2 for fatal error, 1 for error, 0 for warning */
-void cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
- int is_error;
+void
+v_cpp_message (pfile, is_error, msg, ap)
cpp_reader *pfile;
- char *msg;
- char *arg1, *arg2, *arg3;
+ int is_error;
+ const char *msg;
+ va_list ap;
{
if (is_error == 1)
pfile->errors++;
@@ -1361,32 +1360,86 @@ void cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
return;
if (!is_error)
fprintf (stderr, "warning: ");
- fprintf (stderr, msg, arg1, arg2, arg3);
+ vfprintf (stderr, msg, ap);
fprintf (stderr, "\n");
}
void
-fatal (str, arg)
- char *str, *arg;
+cpp_message VPROTO ((cpp_reader *pfile, int is_error, const char *msg, ...))
+{
+#ifndef __STDC__
+ cpp_reader *pfile;
+ int is_error;
+ const char *msg;
+#endif
+ va_list ap;
+
+ VA_START (ap, msg);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ is_error = va_arg (ap, const int);
+ msg = va_arg (ap, const char *);
+#endif
+
+ v_cpp_message(pfile, is_error, msg, ap);
+ va_end(ap);
+}
+
+static void
+v_fatal (str, ap)
+ const char * str;
+ va_list ap;
{
fprintf (stderr, "%s: %s: ", progname, inc_filename);
- fprintf (stderr, str, arg);
+ vfprintf (stderr, str, ap);
fprintf (stderr, "\n");
+
exit (FATAL_EXIT_CODE);
}
void
-cpp_fatal (pfile, str, arg)
- cpp_reader *pfile;
- char *str, *arg;
+fatal VPROTO ((const char *str, ...))
{
- fatal (str, arg);
+#ifndef __STDC__
+ const char *str;
+#endif
+ va_list ap;
+
+ VA_START(ap, str);
+
+#ifndef __STDC__
+ str = va_arg (ap, const char *);
+#endif
+
+ v_fatal(str, ap);
+ va_end(ap);
+}
+
+void
+cpp_fatal VPROTO ((cpp_reader * pfile, const char *str, ...))
+{
+#ifndef __STDC__
+ cpp_reader * pfile;
+ const char *str;
+#endif
+ va_list ap;
+
+ VA_START(ap, str);
+
+#ifndef __STDC__
+ pfile = va_arg (ap, cpp_reader *);
+ str = va_arg (ap, const char *);
+#endif
+
+ v_fatal(str, ap);
+ va_end(ap);
}
void
cpp_pfatal_with_name (pfile, name)
cpp_reader *pfile;
- char *name;
+ const char *name;
{
cpp_perror_with_name (pfile, name);
exit (FATAL_EXIT_CODE);
diff --git a/gcc/fixinc.irix b/gcc/fixinc.irix
index 337289a121e..6562581df6e 100755
--- a/gcc/fixinc.irix
+++ b/gcc/fixinc.irix
@@ -1,5 +1,7 @@
#! /bin/sh
# Install modified versions of certain problematic Irix include files.
+# If possible, create a wrapper (see fixinc.wrap) instead of copying files.
+#
# Copyright (C) 1997 Free Software Foundation, Inc.
# Contributed by Brendan Kehoe (brendan@cygnus.com).
#
@@ -59,40 +61,73 @@ echo 'Building fixincludes in ' ${LIB}
# ADD ANY OTHERS, the "Making directories:" and symlinks code from
# fixinc.svr4 may have to go back in.
-# The Irix math.h defines struct exception, which conflicts with
+# This math.h fix is copied from fixinc.wrap. We want to avoid copying
+# math.h because both math.h and stdlib.h have a declaration for initstate,
+# and this declaration changed between Irix 6.2 and Irix 6.3. If we copy this
+# file, then the same toolchain can't be shared between 6.2 and 6.3+.
+
+# Some math.h files define struct exception, which conflicts with
# the class exception defined in the C++ file std/stdexcept.h. We
# redefine it to __math_exception. This is not a great fix, but I
# haven't been able to think of anything better.
file=math.h
-base=`basename $file`
-if [ -r ${LIB}/$file ]; then
- file_to_fix=${LIB}/$file
-else
- if [ -r ${INPUT}/$file ]; then
- file_to_fix=${INPUT}/$file
- else
- file_to_fix=""
+if [ -r $INPUT/$file ]; then
+ echo Checking $INPUT/$file
+ if grep 'struct exception' $INPUT/$file >/dev/null
+ then
+ echo Fixed $file
+ rm -f $LIB/$file
+ cat <<'__EOF__' >$LIB/$file
+#ifndef _MATH_H_WRAPPER
+#ifdef __cplusplus
+# define exception __math_exception
+#endif
+#include_next <math.h>
+#ifdef __cplusplus
+# undef exception
+#endif
+#define _MATH_H_WRAPPER
+#endif /* _MATH_H_WRAPPER */
+__EOF__
+ # Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
+ # so that if #include_next gets another instance of the wrapper,
+ # this will follow the #include_next chain until we arrive at
+ # the real <math.h>.
+ chmod a+r $LIB/$file
fi
fi
-if [ \! -z "$file_to_fix" ]; then
- echo Checking $file_to_fix
- sed -e '/struct exception/i\
-#ifdef __cplusplus\
-#define exception __math_exception\
-#endif'\
- -e '/struct exception/a\
-#ifdef __cplusplus\
-#undef exception\
-#endif' $file_to_fix > /tmp/$base
- if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
- true
- else
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
- chmod a+r ${LIB}/$file
+
+# Avoid the definition of the bool type in curses.h when using
+# g++, since it's now an official type in the C++ language.
+
+# This is also from fixinc.wrap.
+
+file=curses.h
+if [ -r $INPUT/$file ]; then
+ echo Checking $INPUT/$file
+ w='[ ]'
+ if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
+ then
+ echo Fixed $file
+ rm -f $LIB/$file
+ cat <<'__EOF__' >$LIB/$file
+#ifndef _CURSES_H_WRAPPER
+#ifdef __cplusplus
+# define bool __curses_bool_t
+#endif
+#include_next <curses.h>
+#ifdef __cplusplus
+# undef bool
+#endif
+#define _CURSES_H_WRAPPER
+#endif /* _CURSES_H_WRAPPER */
+__EOF__
+ # Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
+ # so that if #include_next gets another instance of the wrapper,
+ # this will follow the #include_next chain until we arrive at
+ # the real <curses.h>.
+ chmod a+r $LIB/$file
fi
- rm -f /tmp/$base
fi
# In limits.h, put #ifndefs around things that are supposed to be defined
diff --git a/gcc/fixinc.math b/gcc/fixinc.math
deleted file mode 100755
index a8a9fe7e4d3..00000000000
--- a/gcc/fixinc.math
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh
-# Fix struct exception in /usr/include/math.h.
-#
-# We expect several systems which did not need fixincludes in the past
-# to need to fix just math.h. So we created a separate fixinc.math
-# script to fix just that problem.
-# See README-fixinc for more information.
-
-# Directory containing the original header files.
-# (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
-INPUT=${2-${INPUT-/usr/include}}
-
-# Directory in which to store the results.
-LIB=${1?"fixincludes: output directory not specified"}
-
-# Make sure it exists.
-if [ ! -d $LIB ]; then
- mkdir $LIB || exit 1
-fi
-
-echo Building fixed headers in ${LIB}
-
-# Some math.h files define struct exception, which conflicts with
-# the class exception defined in the C++ file std/stdexcept.h. We
-# redefine it to __math_exception. This is not a great fix, but I
-# haven't been able to think of anything better.
-file=math.h
-if [ -r $INPUT/$file ]; then
- echo Checking $INPUT/$file
- if grep 'struct exception' $INPUT/$file >/dev/null
- then
- echo Fixed $file
- rm -f $LIB/$file
- cat <<'__EOF__' >$LIB/$file
-#ifndef _MATH_H_WRAPPER
-#ifdef __cplusplus
-# define exception __math_exception
-#endif
-#include_next <math.h>
-#ifdef __cplusplus
-# undef exception
-#endif
-#define _MATH_H_WRAPPER
-#endif /* _MATH_H_WRAPPER */
-__EOF__
- # Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
- # so that if #include_next gets another instance of the wrapper,
- # this will follow the #include_next chain until we arrive at
- # the real <math.h>.
- chmod a+r $LIB/$file
- fi
-fi
-exit 0
diff --git a/gcc/fixinc.sco b/gcc/fixinc.sco
index c0ca7826d7f..205a8822af1 100755
--- a/gcc/fixinc.sco
+++ b/gcc/fixinc.sco
@@ -369,6 +369,39 @@ extern "C"\
fi
fi
+# This fix has the regex modified from the from fixinc.wrap
+# Avoid the definition of the bool type in the following files when using
+# g++, since it's now an official type in the C++ language.
+for file in term.h tinfo.h
+do
+ if [ -r $INPUT/$file ]; then
+ echo Checking $INPUT/$file
+ w='[ ]'
+ if grep "typedef$w.*char$w.*bool$w*;" $INPUT/$file >/dev/null
+ then
+ echo Fixed $file
+ rm -f $LIB/$file
+ cat <<'__EOF__' >$LIB/$file
+#ifndef _CURSES_H_WRAPPER
+#ifdef __cplusplus
+# define bool __curses_bool_t
+#endif
+#include_next <curses.h>
+#ifdef __cplusplus
+# undef bool
+#endif
+#define _CURSES_H_WRAPPER
+#endif /* _CURSES_H_WRAPPER */
+__EOF__
+ # Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
+ # so that if #include_next gets another instance of the wrapper,
+ # this will follow the #include_next chain until we arrive at
+ # the real <curses.h>.
+ chmod a+r $LIB/$file
+ fi
+ fi
+done
+
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
diff --git a/gcc/flags.h b/gcc/flags.h
index dccfc54b8bf..3b7dd5ee3b8 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -1,5 +1,5 @@
/* Compilation switch flag definitions for GNU CC.
- Copyright (C) 1987, 88, 94-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -356,6 +356,11 @@ extern int flag_branch_on_count_reg;
extern int flag_delayed_branch;
+/* Nonzero means suppress output of instruction numbers and line number
+ notes in debugging dumps. */
+
+extern int flag_dump_unnumbered;
+
/* Nonzero means pretend it is OK to examine bits of target floats,
even if that isn't true. The resulting code will have incorrect constants,
but the same series of instructions that the native compiler would make. */
@@ -377,6 +382,11 @@ extern int flag_pic;
extern int flag_exceptions;
+/* Nonzero means use the new model for exception handling. Replaces
+ -DNEW_EH_MODEL as a compile option. */
+
+extern int flag_new_exceptions;
+
/* Nonzero means don't place uninitialized global data in common storage
by default. */
@@ -393,6 +403,10 @@ extern int flag_inhibit_size_directive;
extern int flag_function_sections;
+/* ... and similar for data. */
+
+extern int flag_data_sections;
+
/* -fverbose-asm causes extra commentary information to be produced in
the generated assembly code (to make it more readable). This option
is generally only of use to those who actually need to read the
@@ -427,12 +441,21 @@ extern int flag_pack_struct;
The value is ignored if flag_alias_check is 0. */
extern int flag_argument_noalias;
+/* Nonzero if we should do (language-dependent) alias analysis.
+ Typically, this analysis will assume that expressions of certain
+ types do not alias expressions of certain other types. Only used
+ if alias analysis (in general) is enabled. */
+extern int flag_strict_aliasing;
+
/* Emit code to check for stack overflow; also may cause large objects
to be allocated dynamically. */
extern int flag_stack_check;
/* Do the full regmove optimization pass. */
extern int flag_regmove;
+
+/* Instrument functions with calls at entry and exit, for profiling. */
+extern int flag_instrument_function_entry_exit;
/* Other basic status info about current function. */
diff --git a/gcc/flow.c b/gcc/flow.c
index cb3c2e6d61c..3aa26ef0281 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -118,6 +118,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "output.h"
#include "except.h"
+#include "toplev.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
@@ -173,7 +174,11 @@ static int num_scratch;
/* Indexed by n, giving various register information */
-reg_info *reg_n_info;
+varray_type reg_n_info;
+
+/* Size of the reg_n_info table. */
+
+unsigned int reg_n_max;
/* Element N is the next insn that uses (hard or pseudo) register number N
within the current basic block; or zero, if there is no such insn.
@@ -256,9 +261,6 @@ static HARD_REG_SET elim_reg_set;
static void find_basic_blocks_1 PROTO((rtx, rtx, int));
static void mark_label_ref PROTO((rtx, rtx, int));
static void life_analysis_1 PROTO((rtx, int));
-void allocate_for_life_analysis PROTO((void));
-void init_regset_vector PROTO((regset *, int, struct obstack *));
-void free_regset_vector PROTO((regset *, int));
static void propagate_block PROTO((regset, rtx, rtx, int,
regset, int));
static rtx flow_delete_insn PROTO((rtx));
@@ -280,6 +282,11 @@ static void add_pred_succ PROTO ((int, int, int_list_ptr *,
static int_list_ptr alloc_int_list_node PROTO ((int_list_block **));
static int_list_ptr add_int_list_node PROTO ((int_list_block **,
int_list **, int));
+static void init_regset_vector PROTO ((regset *, int,
+ struct obstack *));
+static void count_reg_sets_1 PROTO ((rtx));
+static void count_reg_sets PROTO ((rtx));
+static void count_reg_references PROTO ((rtx));
/* Find basic blocks of the current function.
F is the first insn of the function and NREGS the number of register numbers
@@ -299,6 +306,7 @@ find_basic_blocks (f, nregs, file, live_reachable_p)
register int i;
rtx nonlocal_label_list = nonlocal_label_rtx_list ();
int in_libcall_block = 0;
+ int extra_uids_for_flow = 0;
/* Count the basic blocks. Also find maximum insn uid value used. */
@@ -311,7 +319,6 @@ find_basic_blocks (f, nregs, file, live_reachable_p)
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
-
/* Track when we are inside in LIBCALL block. */
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& find_reg_note (insn, REG_LIBCALL, NULL_RTX))
@@ -320,16 +327,37 @@ find_basic_blocks (f, nregs, file, live_reachable_p)
code = GET_CODE (insn);
if (INSN_UID (insn) > max_uid_for_flow)
max_uid_for_flow = INSN_UID (insn);
- if (code == CODE_LABEL
- || (GET_RTX_CLASS (code) == 'i'
- && (prev_code == JUMP_INSN
- || (prev_code == CALL_INSN
- && (nonlocal_label_list != 0 || eh_region)
- && ! in_libcall_block)
- || prev_code == BARRIER)))
+ if (code == CODE_LABEL)
i++;
+ else if (GET_RTX_CLASS (code) == 'i')
+ {
+ if (prev_code == JUMP_INSN || prev_code == BARRIER)
+ i++;
+ else if (prev_code == CALL_INSN)
+ {
+ if (nonlocal_label_list != 0 || eh_region)
+ i++;
+ else
+ {
+ /* Else this call does not force a new block to be
+ created. However, it may still be the end of a basic
+ block if it is followed by a CODE_LABEL or a BARRIER.
+
+ To disambiguate calls which force new blocks to be
+ created from those which just happen to be at the end
+ of a block we insert nops during find_basic_blocks_1
+ after calls which are the last insn in a block by
+ chance. We must account for such insns in
+ max_uid_for_flow. */
+
+ extra_uids_for_flow++;
+ }
+ }
+ }
- if (code == CALL_INSN && find_reg_note (insn, REG_RETVAL, NULL_RTX))
+ /* We change the code of the CALL_INSN, so that it won't start a
+ new block. */
+ if (code == CALL_INSN && in_libcall_block)
code = INSN;
if (code != NOTE)
@@ -352,6 +380,7 @@ find_basic_blocks (f, nregs, file, live_reachable_p)
These cases are rare, so we don't need too much space. */
max_uid_for_flow += max_uid_for_flow / 10;
#endif
+ max_uid_for_flow += extra_uids_for_flow;
/* Allocate some tables that last till end of compiling this function
and some needed only in find_basic_blocks and life_analysis. */
@@ -391,7 +420,8 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
register char *block_marked = (char *) alloca (n_basic_blocks);
/* An array of CODE_LABELs, indexed by UID for the start of the active
EH handler for each insn in F. */
- rtx *active_eh_handler;
+ int *active_eh_region;
+ int *nested_eh_region;
/* List of label_refs to all labels whose addresses are taken
and used as data. */
rtx label_value_list;
@@ -399,9 +429,12 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
enum rtx_code prev_code, code;
int depth, pass;
int in_libcall_block = 0;
+ int deleted_handler = 0;
+ int call_had_abnormal_edge = 0;
pass = 1;
- active_eh_handler = (rtx *) alloca ((max_uid_for_flow + 1) * sizeof (rtx));
+ active_eh_region = (int *) alloca ((max_uid_for_flow + 1) * sizeof (int));
+ nested_eh_region = (int *) alloca ((max_label_num () + 1) * sizeof (int));
restart:
label_value_list = 0;
@@ -409,7 +442,8 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
bzero (block_live, n_basic_blocks);
bzero (block_marked, n_basic_blocks);
bzero (basic_block_computed_jump_target, n_basic_blocks);
- bzero (active_eh_handler, (max_uid_for_flow + 1) * sizeof (rtx));
+ bzero ((char *) active_eh_region, (max_uid_for_flow + 1) * sizeof (int));
+ bzero ((char *) nested_eh_region, (max_label_num () + 1) * sizeof (int));
current_function_has_computed_jump = 0;
/* Initialize with just block 0 reachable and no blocks marked. */
@@ -443,9 +477,7 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
else if (code == CODE_LABEL
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
- || (prev_code == CALL_INSN
- && (nonlocal_label_list != 0 || eh_note)
- && ! in_libcall_block)
+ || (prev_code == CALL_INSN && call_had_abnormal_edge)
|| prev_code == BARRIER)))
{
basic_block_head[++i] = insn;
@@ -454,12 +486,26 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
if (code == CODE_LABEL)
{
- LABEL_REFS (insn) = insn;
- /* Any label that cannot be deleted
- is considered to start a reachable block. */
- if (LABEL_PRESERVE_P (insn))
- block_live[i] = 1;
- }
+ LABEL_REFS (insn) = insn;
+ /* Any label that cannot be deleted
+ is considered to start a reachable block. */
+ if (LABEL_PRESERVE_P (insn))
+ block_live[i] = 1;
+ }
+
+ /* If the previous insn was a call that did not create an
+ abnormal edge, we want to add a nop so that the CALL_INSN
+ itself is not at basic_block_end. This allows us to easily
+ distinguish between normal calls and those which create
+ abnormal edges in the flow graph. */
+
+ if (i > 0 && !call_had_abnormal_edge
+ && GET_CODE (basic_block_end[i-1]) == CALL_INSN)
+ {
+ rtx nop = gen_rtx_USE (VOIDmode, const0_rtx);
+ nop = emit_insn_after (nop, basic_block_end[i-1]);
+ basic_block_end[i-1] = nop;
+ }
}
else if (GET_RTX_CLASS (code) == 'i')
@@ -472,25 +518,24 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
{
/* Make a list of all labels referred to other than by jumps. */
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
- if (REG_NOTE_KIND (note) == REG_LABEL)
+ if (REG_NOTE_KIND (note) == REG_LABEL
+ && XEXP (note, 0) != eh_return_stub_label)
label_value_list = gen_rtx_EXPR_LIST (VOIDmode, XEXP (note, 0),
label_value_list);
}
- /* Keep a lifo list of the currently active exception handlers. */
+ /* Keep a lifo list of the currently active exception notes. */
if (GET_CODE (insn) == NOTE)
{
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
{
- for (x = exception_handler_labels; x; x = XEXP (x, 1))
- if (CODE_LABEL_NUMBER (XEXP (x, 0)) == NOTE_BLOCK_NUMBER (insn))
- {
- eh_note = gen_rtx_EXPR_LIST (VOIDmode,
- XEXP (x, 0), eh_note);
- break;
- }
- if (x == NULL_RTX)
- abort ();
+ if (eh_note)
+ nested_eh_region [NOTE_BLOCK_NUMBER (insn)] =
+ NOTE_BLOCK_NUMBER (XEXP (eh_note, 0));
+ else
+ nested_eh_region [NOTE_BLOCK_NUMBER (insn)] = 0;
+ eh_note = gen_rtx_EXPR_LIST (VOIDmode,
+ insn, eh_note);
}
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
eh_note = XEXP (eh_note, 1);
@@ -504,10 +549,19 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
&& (asynchronous_exceptions
|| (GET_CODE (insn) == CALL_INSN
&& ! in_libcall_block)))
- active_eh_handler[INSN_UID (insn)] = XEXP (eh_note, 0);
-
+ active_eh_region[INSN_UID (insn)] =
+ NOTE_BLOCK_NUMBER (XEXP (eh_note, 0));
BLOCK_NUM (insn) = i;
+ /* We change the code of the CALL_INSN, so that it won't start a
+ new block. */
+ if (code == CALL_INSN && in_libcall_block)
+ code = INSN;
+
+ /* Record whether this call created an edge. */
+ if (code == CALL_INSN)
+ call_had_abnormal_edge = (nonlocal_label_list != 0 || eh_note);
+
if (code != NOTE)
prev_code = code;
@@ -579,7 +633,6 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
{
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{
-
/* References to labels in non-jumping insns have
REG_LABEL notes attached to them.
@@ -599,12 +652,16 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
associated insns aren't marked dead, so we make
the block in question live and create an edge from
this insn to the label. This is not strictly
- correct, but it is close enough for now. */
+ correct, but it is close enough for now.
+
+ See below for code that handles the eh_stub labels
+ specially. */
for (note = REG_NOTES (insn);
note;
note = XEXP (note, 1))
{
- if (REG_NOTE_KIND (note) == REG_LABEL)
+ if (REG_NOTE_KIND (note) == REG_LABEL
+ && XEXP (note, 0) != eh_return_stub_label)
{
x = XEXP (note, 0);
block_live[BLOCK_NUM (x)] = 1;
@@ -650,11 +707,20 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
&& ! find_reg_note (insn, REG_RETVAL,
NULL_RTX)))
{
- if (active_eh_handler[INSN_UID (insn)])
- mark_label_ref (gen_rtx_LABEL_REF (VOIDmode,
- active_eh_handler[INSN_UID (insn)]),
- insn, 0);
-
+ if (active_eh_region[INSN_UID (insn)])
+ {
+ int region;
+ handler_info *ptr;
+ region = active_eh_region[INSN_UID (insn)];
+ for ( ; region;
+ region = nested_eh_region[region])
+ {
+ ptr = get_first_handler (region);
+ for ( ; ptr ; ptr = ptr->next)
+ mark_label_ref (gen_rtx_LABEL_REF
+ (VOIDmode, ptr->handler_label), insn, 0);
+ }
+ }
if (!asynchronous_exceptions)
{
for (x = nonlocal_label_list;
@@ -676,6 +742,19 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
}
}
}
+ /* We know something about the structure of the function
+ __throw in libgcc2.c. It is the only function that ever
+ contains eh_stub labels. It modifies its return address
+ so that the last block returns to one of the eh_stub labels
+ within it. So we have to make additional edges in the
+ flow graph. */
+ if (i + 1 == n_basic_blocks
+ && eh_return_stub_label != 0)
+ {
+ mark_label_ref (gen_rtx_LABEL_REF (VOIDmode,
+ eh_return_stub_label),
+ basic_block_end[i], 0);
+ }
}
}
@@ -756,23 +835,9 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
XEXP (x, 1) = NULL_RTX;
XEXP (x, 0) = NULL_RTX;
- /* Now we have to find the EH_BEG and EH_END notes
- associated with this label and remove them. */
-
- for (x = get_insns (); x; x = NEXT_INSN (x))
- {
- if (GET_CODE (x) == NOTE
- && ((NOTE_LINE_NUMBER (x)
- == NOTE_INSN_EH_REGION_BEG)
- || (NOTE_LINE_NUMBER (x)
- == NOTE_INSN_EH_REGION_END))
- && (NOTE_BLOCK_NUMBER (x)
- == CODE_LABEL_NUMBER (insn)))
- {
- NOTE_LINE_NUMBER (x) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (x) = 0;
- }
- }
+ /* Remove the handler from all regions */
+ remove_handler (insn);
+ deleted_handler = 1;
break;
}
prev = &XEXP (x, 1);
@@ -842,6 +907,24 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p)
}
}
}
+ /* If we deleted an exception handler, we may have EH region
+ begin/end blocks to remove as well. */
+ if (deleted_handler)
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if (GET_CODE (insn) == NOTE)
+ {
+ if ((NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) ||
+ (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
+ {
+ int num = CODE_LABEL_NUMBER (insn);
+ /* A NULL handler indicates a region is no longer needed */
+ if (get_first_handler (num) == NULL)
+ {
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ }
+ }
+ }
/* There are pathological cases where one function calling hundreds of
nested inline functions can generate lots and lots of unreachable
@@ -1478,7 +1561,7 @@ allocate_for_life_analysis ()
NELTS elements, and space is allocated from the ALLOC_OBSTACK
obstack. */
-void
+static void
init_regset_vector (vector, nelts, alloc_obstack)
regset *vector;
int nelts;
@@ -2007,10 +2090,10 @@ libcall_dead_p (x, needed, note, insn)
return 1;
}
-/* Return 1 if register REGNO was used before it was set.
- In other words, if it is live at function entry.
- Don't count global register variables or variables in registers
- that can be used for function arg passing, though. */
+/* Return 1 if register REGNO was used before it was set, i.e. if it is
+ live at function entry. Don't count global register variables, variables
+ in registers that can be used for function arg passing, or variables in
+ fixed hard registers. */
int
regno_uninitialized (regno)
@@ -2018,7 +2101,9 @@ regno_uninitialized (regno)
{
if (n_basic_blocks == 0
|| (regno < FIRST_PSEUDO_REGISTER
- && (global_regs[regno] || FUNCTION_ARG_REGNO_P (regno))))
+ && (global_regs[regno]
+ || fixed_regs[regno]
+ || FUNCTION_ARG_REGNO_P (regno))))
return 0;
return REGNO_REG_SET_P (basic_block_live_at_start[0], regno);
@@ -2086,6 +2171,19 @@ mark_set_1 (needed, dead, x, insn, significant)
register int regno;
register rtx reg = SET_DEST (x);
+ /* Some targets place small structures in registers for
+ return values of functions. We have to detect this
+ case specially here to get correct flow information. */
+ if (GET_CODE (reg) == PARALLEL
+ && GET_MODE (reg) == BLKmode)
+ {
+ register int i;
+
+ for (i = XVECLEN (reg, 0) - 1; i >= 0; i--)
+ mark_set_1 (needed, dead, XVECEXP (reg, 0, i), insn, significant);
+ return;
+ }
+
/* Modifying just one hardware register of a multi-reg value
or just a byte field of a register
does not mean the value from before this insn is now dead.
@@ -2358,7 +2456,7 @@ find_auto_inc (needed, x, insn)
{
/* We have *p followed sometime later by q = p+size.
Both p and q must be live afterward,
- and q is not used between INSN and it's assignment.
+ and q is not used between INSN and its assignment.
Change it to q = p, ...*q..., q = q+size.
Then fall into the usual case. */
rtx insns, temp;
@@ -2747,15 +2845,17 @@ mark_used_regs (needed, live, x, final, insn)
/* If this is a store into a register,
recursively scan the value being stored. */
- if (GET_CODE (testreg) == REG
- && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM)
+ if ((GET_CODE (testreg) == PARALLEL
+ && GET_MODE (testreg) == BLKmode)
+ || (GET_CODE (testreg) == REG
+ && (regno = REGNO (testreg), regno != FRAME_POINTER_REGNUM)
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
+ && regno != HARD_FRAME_POINTER_REGNUM
#endif
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
+ && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif
- )
+ ))
/* We used to exclude global_regs here, but that seems wrong.
Storing in them is like storing in mem. */
{
@@ -3034,6 +3134,11 @@ dump_flow_info (file)
i, REG_N_REFS (i), REG_LIVE_LENGTH (i));
if (REG_BASIC_BLOCK (i) >= 0)
fprintf (file, " in block %d", REG_BASIC_BLOCK (i));
+ if (REG_N_SETS (i))
+ fprintf (file, "; set %d time%s", REG_N_SETS (i),
+ (REG_N_SETS (i) == 1) ? "" : "s");
+ if (REG_USERVAR_P (regno_reg_rtx[i]))
+ fprintf (file, "; user var");
if (REG_N_DEATHS (i) != 1)
fprintf (file, "; dies in %d places", REG_N_DEATHS (i));
if (REG_N_CALLS_CROSSED (i) == 1)
@@ -3141,6 +3246,8 @@ print_rtl_with_bb (outf, rtx_first)
for (tmp_rtx = rtx_first; NULL != tmp_rtx; tmp_rtx = NEXT_INSN (tmp_rtx))
{
+ int did_output;
+
if ((bb = start[INSN_UID (tmp_rtx)]) >= 0)
{
fprintf (outf, ";; Start of basic block %d, registers live:",
@@ -3163,12 +3270,13 @@ print_rtl_with_bb (outf, rtx_first)
else if (in_bb_p[ INSN_UID(tmp_rtx)] == IN_MULTIPLE_BB)
fprintf (outf, ";; Insn is in multiple basic blocks\n");
- print_rtl_single (outf, tmp_rtx);
+ did_output = print_rtl_single (outf, tmp_rtx);
if ((bb = end[INSN_UID (tmp_rtx)]) >= 0)
fprintf (outf, ";; End of basic block %d\n", bb);
- putc ('\n', outf);
+ if (did_output)
+ putc ('\n', outf);
}
}
}
@@ -3535,13 +3643,7 @@ void
sbitmap_copy (dst, src)
sbitmap dst, src;
{
- int i;
- sbitmap_ptr d,s;
-
- s = src->elms;
- d = dst->elms;
- for (i = 0; i < dst->size; i++)
- *d++ = *s++;
+ bcopy (src->elms, dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
}
/* Zero all elements in a bitmap. */
@@ -3972,3 +4074,290 @@ compute_dominators (dominators, post_dominators, s_preds, s_succs)
free (temp_bitmap);
}
+
+/* Count for a single SET rtx, X. */
+
+static void
+count_reg_sets_1 (x)
+ rtx x;
+{
+ register int regno;
+ register rtx reg = SET_DEST (x);
+
+ /* Find the register that's set/clobbered. */
+ while (GET_CODE (reg) == SUBREG || GET_CODE (reg) == ZERO_EXTRACT
+ || GET_CODE (reg) == SIGN_EXTRACT
+ || GET_CODE (reg) == STRICT_LOW_PART)
+ reg = XEXP (reg, 0);
+
+ if (GET_CODE (reg) == PARALLEL
+ && GET_MODE (reg) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (reg, 0) - 1; i >= 0; i--)
+ count_reg_sets_1 (XVECEXP (reg, 0, i));
+ return;
+ }
+
+ if (GET_CODE (reg) == REG)
+ {
+ regno = REGNO (reg);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ {
+ /* Count (weighted) references, stores, etc. This counts a
+ register twice if it is modified, but that is correct. */
+ REG_N_SETS (regno)++;
+
+ REG_N_REFS (regno) += loop_depth;
+ }
+ }
+}
+
+/* Increment REG_N_SETS for each SET or CLOBBER found in X; also increment
+ REG_N_REFS by the current loop depth for each SET or CLOBBER found. */
+
+static void
+count_reg_sets (x)
+ rtx x;
+{
+ register RTX_CODE code = GET_CODE (x);
+
+ if (code == SET || code == CLOBBER)
+ count_reg_sets_1 (x);
+ else if (code == PARALLEL)
+ {
+ register int i;
+ for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ {
+ code = GET_CODE (XVECEXP (x, 0, i));
+ if (code == SET || code == CLOBBER)
+ count_reg_sets_1 (XVECEXP (x, 0, i));
+ }
+ }
+}
+
+/* Increment REG_N_REFS by the current loop depth each register reference
+ found in X. */
+
+static void
+count_reg_references (x)
+ rtx x;
+{
+ register RTX_CODE code;
+
+ retry:
+ code = GET_CODE (x);
+ switch (code)
+ {
+ case LABEL_REF:
+ case SYMBOL_REF:
+ case CONST_INT:
+ case CONST:
+ case CONST_DOUBLE:
+ case PC:
+ case ADDR_VEC:
+ case ADDR_DIFF_VEC:
+ case ASM_INPUT:
+ return;
+
+#ifdef HAVE_cc0
+ case CC0:
+ return;
+#endif
+
+ case CLOBBER:
+ /* If we are clobbering a MEM, mark any registers inside the address
+ as being used. */
+ if (GET_CODE (XEXP (x, 0)) == MEM)
+ count_reg_references (XEXP (XEXP (x, 0), 0));
+ return;
+
+ case SUBREG:
+ /* While we're here, optimize this case. */
+ x = SUBREG_REG (x);
+
+ /* In case the SUBREG is not of a register, don't optimize */
+ if (GET_CODE (x) != REG)
+ {
+ count_reg_references (x);
+ return;
+ }
+
+ /* ... fall through ... */
+
+ case REG:
+ if (REGNO (x) >= FIRST_PSEUDO_REGISTER)
+ REG_N_REFS (REGNO (x)) += loop_depth;
+ return;
+
+ case SET:
+ {
+ register rtx testreg = SET_DEST (x);
+ int mark_dest = 0;
+
+ /* If storing into MEM, don't show it as being used. But do
+ show the address as being used. */
+ if (GET_CODE (testreg) == MEM)
+ {
+ count_reg_references (XEXP (testreg, 0));
+ count_reg_references (SET_SRC (x));
+ return;
+ }
+
+ /* Storing in STRICT_LOW_PART is like storing in a reg
+ in that this SET might be dead, so ignore it in TESTREG.
+ but in some other ways it is like using the reg.
+
+ Storing in a SUBREG or a bit field is like storing the entire
+ register in that if the register's value is not used
+ then this SET is not needed. */
+ while (GET_CODE (testreg) == STRICT_LOW_PART
+ || GET_CODE (testreg) == ZERO_EXTRACT
+ || GET_CODE (testreg) == SIGN_EXTRACT
+ || GET_CODE (testreg) == SUBREG)
+ {
+ /* Modifying a single register in an alternate mode
+ does not use any of the old value. But these other
+ ways of storing in a register do use the old value. */
+ if (GET_CODE (testreg) == SUBREG
+ && !(REG_SIZE (SUBREG_REG (testreg)) > REG_SIZE (testreg)))
+ ;
+ else
+ mark_dest = 1;
+
+ testreg = XEXP (testreg, 0);
+ }
+
+ /* If this is a store into a register,
+ recursively scan the value being stored. */
+
+ if ((GET_CODE (testreg) == PARALLEL
+ && GET_MODE (testreg) == BLKmode)
+ || GET_CODE (testreg) == REG)
+ {
+ count_reg_references (SET_SRC (x));
+ if (mark_dest)
+ count_reg_references (SET_DEST (x));
+ return;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /* Recursively scan the operands of this expression. */
+
+ {
+ register char *fmt = GET_RTX_FORMAT (code);
+ register int i;
+
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ {
+ /* Tail recursive case: save a function call level. */
+ if (i == 0)
+ {
+ x = XEXP (x, 0);
+ goto retry;
+ }
+ count_reg_references (XEXP (x, i));
+ }
+ else if (fmt[i] == 'E')
+ {
+ register int j;
+ for (j = 0; j < XVECLEN (x, i); j++)
+ count_reg_references (XVECEXP (x, i, j));
+ }
+ }
+ }
+}
+
+/* Recompute register set/reference counts immediately prior to register
+ allocation.
+
+ This avoids problems with set/reference counts changing to/from values
+ which have special meanings to the register allocators.
+
+ Additionally, the reference counts are the primary component used by the
+ register allocators to prioritize pseudos for allocation to hard regs.
+ More accurate reference counts generally lead to better register allocation.
+
+ It might be worthwhile to update REG_LIVE_LENGTH, REG_BASIC_BLOCK and
+ possibly other information which is used by the register allocators. */
+
+void
+recompute_reg_usage (f)
+ rtx f;
+{
+ rtx insn;
+ int i, max_reg;
+
+ /* Clear out the old data. */
+ max_reg = max_reg_num ();
+ for (i = FIRST_PSEUDO_REGISTER; i < max_reg; i++)
+ {
+ REG_N_SETS (i) = 0;
+ REG_N_REFS (i) = 0;
+ }
+
+ /* Scan each insn in the chain and count how many times each register is
+ set/used. */
+ loop_depth = 1;
+ for (insn = f; insn; insn = NEXT_INSN (insn))
+ {
+ /* Keep track of loop depth. */
+ if (GET_CODE (insn) == NOTE)
+ {
+ /* Look for loop boundaries. */
+ if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
+ loop_depth--;
+ else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
+ loop_depth++;
+
+ /* If we have LOOP_DEPTH == 0, there has been a bookkeeping error.
+ Abort now rather than setting register status incorrectly. */
+ if (loop_depth == 0)
+ abort ();
+ }
+ else if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
+ {
+ rtx links;
+
+ /* This call will increment REG_N_SETS for each SET or CLOBBER
+ of a register in INSN. It will also increment REG_N_REFS
+ by the loop depth for each set of a register in INSN. */
+ count_reg_sets (PATTERN (insn));
+
+ /* count_reg_sets does not detect autoincrement address modes, so
+ detect them here by looking at the notes attached to INSN. */
+ for (links = REG_NOTES (insn); links; links = XEXP (links, 1))
+ {
+ if (REG_NOTE_KIND (links) == REG_INC)
+ /* Count (weighted) references, stores, etc. This counts a
+ register twice if it is modified, but that is correct. */
+ REG_N_SETS (REGNO (XEXP (links, 0)))++;
+ }
+
+ /* This call will increment REG_N_REFS by the current loop depth for
+ each reference to a register in INSN. */
+ count_reg_references (PATTERN (insn));
+
+ /* count_reg_references will not include counts for arguments to
+ function calls, so detect them here by examining the
+ CALL_INSN_FUNCTION_USAGE data. */
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ rtx note;
+
+ for (note = CALL_INSN_FUNCTION_USAGE (insn);
+ note;
+ note = XEXP (note, 1))
+ if (GET_CODE (XEXP (note, 0)) == USE)
+ count_reg_references (SET_DEST (XEXP (note, 0)));
+ }
+ }
+ }
+}
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 3df949ce3b7..8ba27d227df 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */
#include <setjmp.h>
#include "flags.h"
#include "tree.h"
+#include "rtl.h"
#include "toplev.h"
/* Handle floating overflow for `const_binop'. */
@@ -94,6 +95,7 @@ static tree unextend PROTO((tree, int, int, tree));
static tree fold_truthop PROTO((enum tree_code, tree, tree, tree));
static tree strip_compound_expr PROTO((tree, tree));
static int multiple_of_p PROTO((tree, tree, tree));
+static tree constant_boolean_node PROTO((int, tree));
#ifndef BRANCH_COST
#define BRANCH_COST 1
@@ -1471,6 +1473,40 @@ size_binop (code, arg0, arg1)
return fold (build (code, sizetype, arg0, arg1));
}
+
+/* Combine operands OP1 and OP2 with arithmetic operation CODE.
+ CODE is a tree code. Data type is taken from `ssizetype',
+ If the operands are constant, so is the result. */
+
+tree
+ssize_binop (code, arg0, arg1)
+ enum tree_code code;
+ tree arg0, arg1;
+{
+ /* Handle the special case of two integer constants faster. */
+ if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST)
+ {
+ /* And some specific cases even faster than that. */
+ if (code == PLUS_EXPR && integer_zerop (arg0))
+ return arg1;
+ else if ((code == MINUS_EXPR || code == PLUS_EXPR)
+ && integer_zerop (arg1))
+ return arg0;
+ else if (code == MULT_EXPR && integer_onep (arg0))
+ return arg1;
+
+ /* Handle general case of two integer constants. We convert
+ arg0 to ssizetype because int_const_binop uses its type for the
+ return value. */
+ arg0 = convert (ssizetype, arg0);
+ return int_const_binop (code, arg0, arg1, 0, 0);
+ }
+
+ if (arg0 == error_mark_node || arg1 == error_mark_node)
+ return error_mark_node;
+
+ return fold (build (code, ssizetype, arg0, arg1));
+}
/* Given T, a tree representing type conversion of ARG1, a constant,
return a constant tree representing the result of conversion. */
@@ -1627,8 +1663,7 @@ fold_convert (t, arg1)
return t;
}
-/* Return an expr equal to X but certainly not valid as an lvalue.
- Also make sure it is not valid as an null pointer constant. */
+/* Return an expr equal to X but certainly not valid as an lvalue. */
tree
non_lvalue (x)
@@ -1642,18 +1677,7 @@ non_lvalue (x)
|| TREE_CODE (x) == REAL_CST
|| TREE_CODE (x) == STRING_CST
|| TREE_CODE (x) == ADDR_EXPR)
- {
- if (TREE_CODE (x) == INTEGER_CST && integer_zerop (x))
- {
- /* Use NOP_EXPR instead of NON_LVALUE_EXPR
- so convert_for_assignment won't strip it.
- This is so this 0 won't be treated as a null pointer constant. */
- result = build1 (NOP_EXPR, TREE_TYPE (x), x);
- TREE_CONSTANT (result) = TREE_CONSTANT (x);
- return result;
- }
- return x;
- }
+ return x;
result = build1 (NON_LVALUE_EXPR, TREE_TYPE (x), x);
TREE_CONSTANT (result) = TREE_CONSTANT (x);
@@ -1876,6 +1900,11 @@ operand_equal_p (arg0, arg1, only_const)
default:
return 0;
}
+
+ case 'e':
+ if (TREE_CODE (arg0) == RTL_EXPR)
+ return rtx_equal_p (RTL_EXPR_RTL (arg0), RTL_EXPR_RTL (arg1));
+ return 0;
default:
return 0;
@@ -2184,7 +2213,7 @@ invert_truthvalue (arg)
if (TREE_CODE_CLASS (code) == '<')
{
if (FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg, 0)))
- && code != NE_EXPR && code != EQ_EXPR)
+ && !flag_fast_math && code != NE_EXPR && code != EQ_EXPR)
return build1 (TRUTH_NOT_EXPR, type, arg);
else
return build (invert_tree_comparison (code), type,
@@ -2769,6 +2798,7 @@ make_range (exp, pin_p, plow, phigh)
{
enum tree_code code;
tree arg0, arg1, type = NULL_TREE;
+ tree orig_type = NULL_TREE;
int in_p, n_in_p;
tree low, high, n_low, n_high;
@@ -2783,10 +2813,20 @@ make_range (exp, pin_p, plow, phigh)
while (1)
{
code = TREE_CODE (exp);
- arg0 = TREE_OPERAND (exp, 0), arg1 = TREE_OPERAND (exp, 1);
- if (TREE_CODE_CLASS (code) == '<' || TREE_CODE_CLASS (code) == '1'
- || TREE_CODE_CLASS (code) == '2')
- type = TREE_TYPE (arg0);
+
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
+ {
+ arg0 = TREE_OPERAND (exp, 0);
+ if (TREE_CODE_CLASS (code) == '<'
+ || TREE_CODE_CLASS (code) == '1'
+ || TREE_CODE_CLASS (code) == '2')
+ type = TREE_TYPE (arg0);
+ if (TREE_CODE_CLASS (code) == '2'
+ || TREE_CODE_CLASS (code) == '<'
+ || (TREE_CODE_CLASS (code) == 'e'
+ && tree_code_length[(int) code] > 1))
+ arg1 = TREE_OPERAND (exp, 1);
+ }
switch (code)
{
@@ -2906,6 +2946,11 @@ make_range (exp, pin_p, plow, phigh)
continue;
case NOP_EXPR: case NON_LVALUE_EXPR: case CONVERT_EXPR:
+ if (orig_type == NULL_TREE)
+ orig_type = type;
+ if (TYPE_PRECISION (type) > TYPE_PRECISION (orig_type))
+ break;
+
if (! INTEGRAL_TYPE_P (type)
|| (low != 0 && ! int_fits_type_p (low, type))
|| (high != 0 && ! int_fits_type_p (high, type)))
@@ -3225,14 +3270,16 @@ fold_range_test (exp)
&& operand_equal_p (lhs, rhs, 0))
{
/* If simple enough, just rewrite. Otherwise, make a SAVE_EXPR
- unless we are at top level, in which case we can't do this. */
+ unless we are at top level or LHS contains a PLACEHOLDER_EXPR, in
+ which cases we can't do this. */
if (simple_operand_p (lhs))
return build (TREE_CODE (exp) == TRUTH_ANDIF_EXPR
? TRUTH_AND_EXPR : TRUTH_OR_EXPR,
TREE_TYPE (exp), TREE_OPERAND (exp, 0),
TREE_OPERAND (exp, 1));
- else if (current_function_decl != 0)
+ else if (current_function_decl != 0
+ && ! contains_placeholder_p (lhs))
{
tree common = save_expr (lhs);
@@ -3685,6 +3732,27 @@ strip_compound_expr (t, s)
return t;
}
+/* Return a node which has the indicated constant VALUE (either 0 or
+ 1), and is of the indicated TYPE. */
+
+static tree
+constant_boolean_node (value, type)
+ int value;
+ tree type;
+{
+ if (type == integer_type_node)
+ return value ? integer_one_node : integer_zero_node;
+ else if (TREE_CODE (type) == BOOLEAN_TYPE)
+ return truthvalue_conversion (value ? integer_one_node :
+ integer_zero_node);
+ else
+ {
+ tree t = build_int_2 (value, 0);
+ TREE_TYPE (t) = type;
+ return t;
+ }
+}
+
/* Perform constant folding and related simplification of EXPR.
The related simplifications include x*1 => x, x*0 => 0, etc.,
and application of the associative law.
@@ -3724,6 +3792,10 @@ fold (expr)
return t;
}
+#ifdef MAX_INTEGER_COMPUTATION_MODE
+ check_max_integer_computation_mode (expr);
+#endif
+
kind = TREE_CODE_CLASS (code);
if (code == NOP_EXPR || code == FLOAT_EXPR || code == CONVERT_EXPR)
{
@@ -3904,7 +3976,9 @@ fold (expr)
else if ((TREE_CODE (arg1) == COND_EXPR
|| (TREE_CODE_CLASS (TREE_CODE (arg1)) == '<'
&& TREE_CODE_CLASS (code) != '<'))
- && (! TREE_SIDE_EFFECTS (arg0) || current_function_decl != 0))
+ && (! TREE_SIDE_EFFECTS (arg0)
+ || (current_function_decl != 0
+ && ! contains_placeholder_p (arg0))))
{
tree test, true_value, false_value;
tree lhs = 0, rhs = 0;
@@ -3975,7 +4049,9 @@ fold (expr)
else if ((TREE_CODE (arg0) == COND_EXPR
|| (TREE_CODE_CLASS (TREE_CODE (arg0)) == '<'
&& TREE_CODE_CLASS (code) != '<'))
- && (! TREE_SIDE_EFFECTS (arg1) || current_function_decl != 0))
+ && (! TREE_SIDE_EFFECTS (arg1)
+ || (current_function_decl != 0
+ && ! contains_placeholder_p (arg1))))
{
tree test, true_value, false_value;
tree lhs = 0, rhs = 0;
@@ -4314,18 +4390,36 @@ fold (expr)
goto bit_ior;
}
- /* (A * C) + (B * C) -> (A+B) * C. Since we are most concerned
- about the case where C is a constant, just try one of the
- four possibilities. */
-
- if (TREE_CODE (arg0) == MULT_EXPR && TREE_CODE (arg1) == MULT_EXPR
- && operand_equal_p (TREE_OPERAND (arg0, 1),
- TREE_OPERAND (arg1, 1), 0))
- return fold (build (MULT_EXPR, type,
- fold (build (PLUS_EXPR, type,
- TREE_OPERAND (arg0, 0),
- TREE_OPERAND (arg1, 0))),
- TREE_OPERAND (arg0, 1)));
+ if (TREE_CODE (arg0) == MULT_EXPR && TREE_CODE (arg1) == MULT_EXPR)
+ {
+ tree arg00, arg01, arg10, arg11;
+ tree alt0, alt1, same;
+
+ /* (A * C) + (B * C) -> (A+B) * C.
+ We are most concerned about the case where C is a constant,
+ but other combinations show up during loop reduction. Since
+ it is not difficult, try all four possibilities. */
+
+ arg00 = TREE_OPERAND (arg0, 0);
+ arg01 = TREE_OPERAND (arg0, 1);
+ arg10 = TREE_OPERAND (arg1, 0);
+ arg11 = TREE_OPERAND (arg1, 1);
+ same = NULL_TREE;
+
+ if (operand_equal_p (arg01, arg11, 0))
+ same = arg01, alt0 = arg00, alt1 = arg10;
+ else if (operand_equal_p (arg00, arg10, 0))
+ same = arg00, alt0 = arg01, alt1 = arg11;
+ else if (operand_equal_p (arg00, arg11, 0))
+ same = arg00, alt0 = arg01, alt1 = arg10;
+ else if (operand_equal_p (arg01, arg10, 0))
+ same = arg01, alt0 = arg00, alt1 = arg11;
+
+ if (same)
+ return fold (build (MULT_EXPR, type,
+ fold (build (PLUS_EXPR, type, alt0, alt1)),
+ same));
+ }
}
/* In IEEE floating point, x+0 may not equal x. */
else if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
@@ -4540,7 +4634,8 @@ fold (expr)
if (real_onep (arg1))
return non_lvalue (convert (type, arg0));
/* x*2 is x+x */
- if (! wins && real_twop (arg1) && current_function_decl != 0)
+ if (! wins && real_twop (arg1) && current_function_decl != 0
+ && ! contains_placeholder_p (arg0))
{
tree arg = save_expr (arg0);
return build (PLUS_EXPR, type, arg, arg);
@@ -5149,11 +5244,35 @@ fold (expr)
= TREE_INT_CST_LOW (DECL_SIZE
(TREE_OPERAND
(TREE_OPERAND (varop, 0), 1)));
-
+ tree mask, unsigned_type;
+ int precision;
+ tree folded_compare;
+
+ /* First check whether the comparison would come out
+ always the same. If we don't do that we would
+ change the meaning with the masking. */
+ if (constopnum == 0)
+ folded_compare = fold (build (code, type, constop,
+ TREE_OPERAND (varop, 0)));
+ else
+ folded_compare = fold (build (code, type,
+ TREE_OPERAND (varop, 0),
+ constop));
+ if (integer_zerop (folded_compare)
+ || integer_onep (folded_compare))
+ return omit_one_operand (type, folded_compare, varop);
+
+ unsigned_type = type_for_size (size, 1);
+ precision = TYPE_PRECISION (unsigned_type);
+ mask = build_int_2 (~0, ~0);
+ TREE_TYPE (mask) = unsigned_type;
+ force_fit_type (mask, 0);
+ mask = const_binop (RSHIFT_EXPR, mask,
+ size_int (precision - size), 0);
newconst = fold (build (BIT_AND_EXPR,
TREE_TYPE (varop), newconst,
convert (TREE_TYPE (varop),
- build_int_2 (size, 0))));
+ mask)));
}
@@ -5182,11 +5301,32 @@ fold (expr)
= TREE_INT_CST_LOW (DECL_SIZE
(TREE_OPERAND
(TREE_OPERAND (varop, 0), 1)));
-
+ tree mask, unsigned_type;
+ int precision;
+ tree folded_compare;
+
+ if (constopnum == 0)
+ folded_compare = fold (build (code, type, constop,
+ TREE_OPERAND (varop, 0)));
+ else
+ folded_compare = fold (build (code, type,
+ TREE_OPERAND (varop, 0),
+ constop));
+ if (integer_zerop (folded_compare)
+ || integer_onep (folded_compare))
+ return omit_one_operand (type, folded_compare, varop);
+
+ unsigned_type = type_for_size (size, 1);
+ precision = TYPE_PRECISION (unsigned_type);
+ mask = build_int_2 (~0, ~0);
+ TREE_TYPE (mask) = TREE_TYPE (varop);
+ force_fit_type (mask, 0);
+ mask = const_binop (RSHIFT_EXPR, mask,
+ size_int (precision - size), 0);
newconst = fold (build (BIT_AND_EXPR,
TREE_TYPE (varop), newconst,
convert (TREE_TYPE (varop),
- build_int_2 (size, 0))));
+ mask)));
}
@@ -5326,14 +5466,7 @@ fold (expr)
case GE_EXPR:
case LE_EXPR:
if (INTEGRAL_TYPE_P (TREE_TYPE (arg0)))
- {
- if (type == integer_type_node)
- return integer_one_node;
-
- t = build_int_2 (1, 0);
- TREE_TYPE (t) = type;
- return t;
- }
+ return constant_boolean_node (1, type);
code = EQ_EXPR;
TREE_SET_CODE (t, code);
break;
@@ -5345,12 +5478,7 @@ fold (expr)
/* ... fall through ... */
case GT_EXPR:
case LT_EXPR:
- if (type == integer_type_node)
- return integer_zero_node;
-
- t = build_int_2 (0, 0);
- TREE_TYPE (t) = type;
- return t;
+ return constant_boolean_node (0, type);
default:
abort ();
}
@@ -5530,20 +5658,26 @@ fold (expr)
return t1 ? t1 : t;
}
- /* If this is a comparison of complex values and either or both
- sizes are a COMPLEX_EXPR, it is best to split up the comparisons
- and join them with a TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR. This
- may prevent needless evaluations. */
+ /* If this is a comparison of complex values and either or both sides
+ are a COMPLEX_EXPR or COMPLEX_CST, it is best to split up the
+ comparisons and join them with a TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR.
+ This may prevent needless evaluations. */
if ((code == EQ_EXPR || code == NE_EXPR)
&& TREE_CODE (TREE_TYPE (arg0)) == COMPLEX_TYPE
&& (TREE_CODE (arg0) == COMPLEX_EXPR
- || TREE_CODE (arg1) == COMPLEX_EXPR))
+ || TREE_CODE (arg1) == COMPLEX_EXPR
+ || TREE_CODE (arg0) == COMPLEX_CST
+ || TREE_CODE (arg1) == COMPLEX_CST))
{
tree subtype = TREE_TYPE (TREE_TYPE (arg0));
- tree real0 = fold (build1 (REALPART_EXPR, subtype, arg0));
- tree imag0 = fold (build1 (IMAGPART_EXPR, subtype, arg0));
- tree real1 = fold (build1 (REALPART_EXPR, subtype, arg1));
- tree imag1 = fold (build1 (IMAGPART_EXPR, subtype, arg1));
+ tree real0, imag0, real1, imag1;
+
+ arg0 = save_expr (arg0);
+ arg1 = save_expr (arg1);
+ real0 = fold (build1 (REALPART_EXPR, subtype, arg0));
+ imag0 = fold (build1 (IMAGPART_EXPR, subtype, arg0));
+ real1 = fold (build1 (REALPART_EXPR, subtype, arg1));
+ imag1 = fold (build1 (IMAGPART_EXPR, subtype, arg1));
return fold (build ((code == EQ_EXPR ? TRUTH_ANDIF_EXPR
: TRUTH_ORIF_EXPR),
@@ -5673,7 +5807,8 @@ fold (expr)
t = build (code, type, tem,
TREE_OPERAND (t, 2), TREE_OPERAND (t, 1));
arg0 = tem;
- arg1 = TREE_OPERAND (t, 2);
+ /* arg1 should be the first argument of the new T. */
+ arg1 = TREE_OPERAND (t, 1);
STRIP_NOPS (arg1);
}
}
@@ -5711,11 +5846,15 @@ fold (expr)
return pedantic_non_lvalue (convert (type, arg1));
case GE_EXPR:
case GT_EXPR:
+ if (TREE_UNSIGNED (TREE_TYPE (arg1)))
+ arg1 = convert (signed_type (TREE_TYPE (arg1)), arg1);
return pedantic_non_lvalue
(convert (type, fold (build1 (ABS_EXPR,
TREE_TYPE (arg1), arg1))));
case LE_EXPR:
case LT_EXPR:
+ if (TREE_UNSIGNED (TREE_TYPE (arg1)))
+ arg1 = convert (signed_type (TREE_TYPE (arg1)), arg1);
return pedantic_non_lvalue
(fold (build1 (NEGATE_EXPR, type,
convert (type,
@@ -5862,7 +6001,8 @@ fold (expr)
t = build (code, type, tem,
TREE_OPERAND (t, 2), TREE_OPERAND (t, 1));
arg0 = tem;
- arg1 = TREE_OPERAND (t, 2);
+ /* arg1 should be the first argument of the new T. */
+ arg1 = TREE_OPERAND (t, 1);
STRIP_NOPS (arg1);
}
}
@@ -5898,7 +6038,7 @@ fold (expr)
return t;
/* Don't let (0, 0) be null pointer constant. */
if (integer_zerop (arg1))
- return non_lvalue (arg1);
+ return build1 (NOP_EXPR, TREE_TYPE (arg1), arg1);
return arg1;
case COMPLEX_EXPR:
diff --git a/gcc/frame.c b/gcc/frame.c
index 4b62759c1af..b3d30c86f5e 100644
--- a/gcc/frame.c
+++ b/gcc/frame.c
@@ -1,6 +1,6 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of GNU CC.
@@ -114,6 +114,33 @@ struct frame_state_internal
struct frame_state s;
struct frame_state_internal *saved_state;
};
+
+/* This is undefined below if we need it to be an actual function. */
+#define init_object_mutex_once()
+
+#if __GTHREADS
+#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
+
+/* Helper for init_object_mutex_once. */
+
+static void
+init_object_mutex (void)
+{
+ __GTHREAD_MUTEX_INIT_FUNCTION (&object_mutex);
+}
+
+/* Call this to arrange to initialize the object mutex. */
+
+#undef init_object_mutex_once
+static void
+init_object_mutex_once (void)
+{
+ static __gthread_once_t once = __GTHREAD_ONCE_INIT;
+ __gthread_once (&once, init_object_mutex);
+}
+
+#endif /* __GTHREAD_MUTEX_INIT_FUNCTION */
+#endif /* __GTHREADS */
/* Decode the unsigned LEB128 constant at BUF into the variable pointed to
by R, and return the new value of BUF. */
@@ -468,6 +495,7 @@ find_fde (void *pc)
struct object *ob;
size_t lo, hi;
+ init_object_mutex_once ();
__gthread_mutex_lock (&object_mutex);
for (ob = objects; ob; ob = ob->next)
@@ -685,6 +713,7 @@ __register_frame_info (void *begin, struct object *ob)
ob->fde_array = 0;
ob->count = 0;
+ init_object_mutex_once ();
__gthread_mutex_lock (&object_mutex);
ob->next = objects;
@@ -713,6 +742,7 @@ __register_frame_info_table (void *begin, struct object *ob)
ob->pc_begin = ob->pc_end = 0;
ob->count = 0;
+ init_object_mutex_once ();
__gthread_mutex_lock (&object_mutex);
ob->next = objects;
@@ -735,6 +765,7 @@ __deregister_frame_info (void *begin)
{
struct object **p;
+ init_object_mutex_once ();
__gthread_mutex_lock (&object_mutex);
p = &objects;
diff --git a/gcc/function.c b/gcc/function.c
index 23e01a6317a..47e60c211b9 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -214,6 +214,13 @@ int current_function_uses_pic_offset_table;
/* The arg pointer hard register, or the pseudo into which it was copied. */
rtx current_function_internal_arg_pointer;
+/* Language-specific reason why the current function cannot be made inline. */
+char *current_function_cannot_inline;
+
+/* Nonzero if instrumentation calls for function entry and exit should be
+ generated. */
+int current_function_instrument_entry_exit;
+
/* The FUNCTION_DECL for an inline function currently being expanded. */
tree inline_function_decl;
@@ -440,16 +447,18 @@ static void pad_to_arg_alignment PROTO((struct args_size *, int));
static void pad_below PROTO((struct args_size *, enum machine_mode,
tree));
#endif
+#ifdef ARGS_GROW_DOWNWARD
static tree round_down PROTO((tree, int));
+#endif
static rtx round_trampoline_addr PROTO((rtx));
static tree blocks_nreverse PROTO((tree));
static int all_blocks PROTO((tree, tree *));
-static int *record_insns PROTO((rtx));
#if defined (HAVE_prologue) || defined (HAVE_epilogue)
+static int *record_insns PROTO((rtx));
static int contains PROTO((rtx, int *));
#endif /* HAVE_prologue || HAVE_epilogue */
static void put_addressof_into_stack PROTO((rtx));
-static void purge_addressof_1 PROTO((rtx *, rtx, int));
+static void purge_addressof_1 PROTO((rtx *, rtx, int, int));
/* Pointer to chain of `struct function' for containing functions. */
struct function *outer_function_chain;
@@ -506,6 +515,7 @@ push_function_context_to (context)
p->uses_const_pool = current_function_uses_const_pool;
p->uses_pic_offset_table = current_function_uses_pic_offset_table;
p->internal_arg_pointer = current_function_internal_arg_pointer;
+ p->cannot_inline = current_function_cannot_inline;
p->max_parm_reg = max_parm_reg;
p->parm_reg_stack_loc = parm_reg_stack_loc;
p->outgoing_args_size = current_function_outgoing_args_size;
@@ -534,6 +544,7 @@ push_function_context_to (context)
p->fixup_var_refs_queue = 0;
p->epilogue_delay_list = current_function_epilogue_delay_list;
p->args_info = current_function_args_info;
+ p->instrument_entry_exit = current_function_instrument_entry_exit;
save_tree_status (p, context);
save_storage_status (p);
@@ -587,6 +598,7 @@ pop_function_context_from (context)
current_function_uses_const_pool = p->uses_const_pool;
current_function_uses_pic_offset_table = p->uses_pic_offset_table;
current_function_internal_arg_pointer = p->internal_arg_pointer;
+ current_function_cannot_inline = p->cannot_inline;
max_parm_reg = p->max_parm_reg;
parm_reg_stack_loc = p->parm_reg_stack_loc;
current_function_outgoing_args_size = p->outgoing_args_size;
@@ -615,6 +627,7 @@ pop_function_context_from (context)
current_function_epilogue_delay_list = p->epilogue_delay_list;
reg_renumber = 0;
current_function_args_info = p->args_info;
+ current_function_instrument_entry_exit = p->instrument_entry_exit;
restore_tree_status (p, context);
restore_storage_status (p);
@@ -1369,7 +1382,7 @@ put_var_into_stack (decl)
context = decl_function_context (decl);
- /* Get the current rtl used for this object and it's original mode. */
+ /* Get the current rtl used for this object and its original mode. */
reg = TREE_CODE (decl) == SAVE_EXPR ? SAVE_EXPR_RTL (decl) : DECL_RTL (decl);
/* No need to do anything if decl has no rtx yet
@@ -1460,6 +1473,7 @@ put_var_into_stack (decl)
/* Change the CONCAT into a combined MEM for both parts. */
PUT_CODE (reg, MEM);
MEM_VOLATILE_P (reg) = MEM_VOLATILE_P (XEXP (reg, 0));
+ MEM_ALIAS_SET (reg) = get_alias_set (decl);
/* The two parts are in memory order already.
Use the lower parts address as ours. */
@@ -1532,6 +1546,7 @@ put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
case it was set for other reasons. For instance, it is set for
__builtin_va_alist. */
MEM_IN_STRUCT_P (reg) = AGGREGATE_TYPE_P (type) | MEM_IN_STRUCT_P (new);
+ MEM_ALIAS_SET (reg) = get_alias_set (type);
/* Now make sure that all refs to the variable, previously made
when it was a register, are fixed up to be valid again. */
@@ -1653,7 +1668,10 @@ fixup_var_refs_insns (var, promoted_mode, unsignedp, insn, toplevel)
If it has a REG_LIBCALL note, delete the REG_LIBCALL
and REG_RETVAL notes too. */
if (GET_CODE (PATTERN (insn)) == CLOBBER
- && XEXP (PATTERN (insn), 0) == var)
+ && (XEXP (PATTERN (insn), 0) == var
+ || (GET_CODE (XEXP (PATTERN (insn), 0)) == CONCAT
+ && (XEXP (XEXP (PATTERN (insn), 0), 0) == var
+ || XEXP (XEXP (PATTERN (insn), 0), 1) == var))))
{
if ((note = find_reg_note (insn, REG_LIBCALL, NULL_RTX)) != 0)
/* The REG_LIBCALL note will go away since we are going to
@@ -1958,11 +1976,19 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements)
#ifdef HAVE_extzv
if (GET_CODE (x) == ZERO_EXTRACT)
- wanted_mode = insn_operand_mode[(int) CODE_FOR_extzv][1];
+ {
+ wanted_mode = insn_operand_mode[(int) CODE_FOR_extzv][1];
+ if (wanted_mode == VOIDmode)
+ wanted_mode = word_mode;
+ }
#endif
#ifdef HAVE_extv
if (GET_CODE (x) == SIGN_EXTRACT)
- wanted_mode = insn_operand_mode[(int) CODE_FOR_extv][1];
+ {
+ wanted_mode = insn_operand_mode[(int) CODE_FOR_extv][1];
+ if (wanted_mode == VOIDmode)
+ wanted_mode = word_mode;
+ }
#endif
/* If we have a narrower mode, we can do something. */
if (wanted_mode != VOIDmode
@@ -2151,11 +2177,14 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements)
&& ! mode_dependent_address_p (XEXP (tem, 0))
&& ! MEM_VOLATILE_P (tem))
{
- enum machine_mode wanted_mode
- = insn_operand_mode[(int) CODE_FOR_insv][0];
+ enum machine_mode wanted_mode;
enum machine_mode is_mode = GET_MODE (tem);
HOST_WIDE_INT pos = INTVAL (XEXP (outerdest, 2));
+ wanted_mode = insn_operand_mode[(int) CODE_FOR_insv][0];
+ if (wanted_mode == VOIDmode)
+ wanted_mode = word_mode;
+
/* If we have a narrower mode, we can do something. */
if (GET_MODE_SIZE (wanted_mode) < GET_MODE_SIZE (is_mode))
{
@@ -2671,6 +2700,7 @@ static int in_arg_offset;
static int var_offset;
static int dynamic_offset;
static int out_arg_offset;
+static int cfa_offset;
/* In most machines, the stack pointer register is equivalent to the bottom
of the stack. */
@@ -2709,6 +2739,13 @@ static int out_arg_offset;
#endif
#endif
+/* On a few machines, the CFA coincides with the arg pointer. */
+
+#ifndef ARG_POINTER_CFA_OFFSET
+#define ARG_POINTER_CFA_OFFSET 0
+#endif
+
+
/* Build up a (MEM (ADDRESSOF (REG))) rtx for a register REG that just had
its address taken. DECL is the decl for the object stored in the
register, for later use if we do need to force REG into the stack.
@@ -2720,15 +2757,18 @@ gen_mem_addressof (reg, decl)
tree decl;
{
tree type = TREE_TYPE (decl);
-
rtx r = gen_rtx_ADDRESSOF (Pmode, gen_reg_rtx (GET_MODE (reg)), REGNO (reg));
SET_ADDRESSOF_DECL (r, decl);
+ /* If the original REG was a user-variable, then so is the REG whose
+ address is being taken. */
+ REG_USERVAR_P (XEXP (r, 0)) = REG_USERVAR_P (reg);
XEXP (reg, 0) = r;
PUT_CODE (reg, MEM);
PUT_MODE (reg, DECL_MODE (decl));
MEM_VOLATILE_P (reg) = TREE_SIDE_EFFECTS (decl);
MEM_IN_STRUCT_P (reg) = AGGREGATE_TYPE_P (type);
+ MEM_ALIAS_SET (reg) = get_alias_set (decl);
if (TREE_USED (decl) || DECL_INITIAL (decl) != 0)
fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type));
@@ -2773,10 +2813,10 @@ put_addressof_into_stack (r)
the stack. */
static void
-purge_addressof_1 (loc, insn, force)
+purge_addressof_1 (loc, insn, force, store)
rtx *loc;
rtx insn;
- int force;
+ int force, store;
{
rtx x;
RTX_CODE code;
@@ -2808,7 +2848,7 @@ purge_addressof_1 (loc, insn, force)
0))
abort ();
- insns = get_insns ();
+ insns = gen_sequence ();
end_sequence ();
emit_insns_before (insns, insn);
return;
@@ -2828,11 +2868,71 @@ purge_addressof_1 (loc, insn, force)
}
else if (GET_CODE (sub) == REG && GET_MODE (x) != GET_MODE (sub))
{
- if (! BYTES_BIG_ENDIAN && ! WORDS_BIG_ENDIAN)
+ int size_x, size_sub;
+
+ size_x = GET_MODE_BITSIZE (GET_MODE (x));
+ size_sub = GET_MODE_BITSIZE (GET_MODE (sub));
+
+ /* Don't even consider working with paradoxical subregs,
+ or the moral equivalent seen here. */
+ if (size_x < size_sub)
{
- rtx sub2 = gen_rtx_SUBREG (GET_MODE (x), sub, 0);
- if (validate_change (insn, loc, sub2, 0))
- goto restart;
+ /* Do a bitfield insertion to mirror what would happen
+ in memory. */
+
+ rtx val, seq;
+
+ /* We cannot do this if we are trying to pick out
+ an integral piece, smaller than a word, of a
+ floating point value. */
+ if (INTEGRAL_MODE_P (GET_MODE (x))
+ && GET_MODE_SIZE (GET_MODE (x)) < UNITS_PER_WORD
+ && FLOAT_MODE_P (GET_MODE (sub)))
+ {
+ put_addressof_into_stack (XEXP (x, 0));
+ return;
+ }
+
+ if (store)
+ {
+ /* If we can't replace with a register, be afraid. */
+
+ start_sequence ();
+ val = gen_reg_rtx (GET_MODE (x));
+ if (! validate_change (insn, loc, val, 0))
+ abort ();
+ seq = gen_sequence ();
+ end_sequence ();
+ emit_insn_before (seq, insn);
+
+ start_sequence ();
+ store_bit_field (sub, size_x, 0, GET_MODE (x),
+ val, GET_MODE_SIZE (GET_MODE (sub)),
+ GET_MODE_SIZE (GET_MODE (sub)));
+
+ seq = gen_sequence ();
+ end_sequence ();
+ emit_insn_after (seq, insn);
+ }
+ else
+ {
+ start_sequence ();
+ val = extract_bit_field (sub, size_x, 0, 1, NULL_RTX,
+ GET_MODE (x), GET_MODE (x),
+ GET_MODE_SIZE (GET_MODE (sub)),
+ GET_MODE_SIZE (GET_MODE (sub)));
+
+ /* If we can't replace with a register, be afraid. */
+ if (! validate_change (insn, loc, val, 0))
+ abort ();
+
+ seq = gen_sequence ();
+ end_sequence ();
+ emit_insn_before (seq, insn);
+ }
+
+ /* We replaced with a reg -- all done. */
+ return;
}
}
else if (validate_change (insn, loc, sub, 0))
@@ -2844,16 +2944,22 @@ purge_addressof_1 (loc, insn, force)
put_addressof_into_stack (x);
return;
}
+ else if (code == SET)
+ {
+ purge_addressof_1 (&SET_DEST (x), insn, force, 1);
+ purge_addressof_1 (&SET_SRC (x), insn, force, 0);
+ return;
+ }
/* Scan all subexpressions. */
fmt = GET_RTX_FORMAT (code);
for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++)
{
if (*fmt == 'e')
- purge_addressof_1 (&XEXP (x, i), insn, force);
+ purge_addressof_1 (&XEXP (x, i), insn, force, 0);
else if (*fmt == 'E')
for (j = 0; j < XVECLEN (x, i); j++)
- purge_addressof_1 (&XVECEXP (x, i, j), insn, force);
+ purge_addressof_1 (&XVECEXP (x, i, j), insn, force, 0);
}
}
@@ -2871,8 +2977,8 @@ purge_addressof (insns)
|| GET_CODE (insn) == CALL_INSN)
{
purge_addressof_1 (&PATTERN (insn), insn,
- asm_noperands (PATTERN (insn)) > 0);
- purge_addressof_1 (&REG_NOTES (insn), NULL_RTX, 0);
+ asm_noperands (PATTERN (insn)) > 0, 0);
+ purge_addressof_1 (&REG_NOTES (insn), NULL_RTX, 0, 0);
}
}
@@ -2892,6 +2998,7 @@ instantiate_virtual_regs (fndecl, insns)
var_offset = STARTING_FRAME_OFFSET;
dynamic_offset = STACK_DYNAMIC_OFFSET (fndecl);
out_arg_offset = STACK_POINTER_OFFSET;
+ cfa_offset = ARG_POINTER_CFA_OFFSET;
/* Scan all variables and parameters of this function. For each that is
in memory, instantiate all virtual registers if the result is a valid
@@ -3125,6 +3232,8 @@ instantiate_virtual_regs_1 (loc, object, extra_insns)
new = stack_pointer_rtx, offset = - dynamic_offset;
else if (SET_DEST (x) == virtual_outgoing_args_rtx)
new = stack_pointer_rtx, offset = - out_arg_offset;
+ else if (SET_DEST (x) == virtual_cfa_rtx)
+ new = arg_pointer_rtx, offset = - cfa_offset;
if (new)
{
@@ -3176,6 +3285,8 @@ instantiate_virtual_regs_1 (loc, object, extra_insns)
new = stack_pointer_rtx, offset = dynamic_offset;
else if (inner == virtual_outgoing_args_rtx)
new = stack_pointer_rtx, offset = out_arg_offset;
+ else if (inner == virtual_cfa_rtx)
+ new = arg_pointer_rtx, offset = cfa_offset;
else
{
loc = &XEXP (x, 0);
@@ -3195,6 +3306,8 @@ instantiate_virtual_regs_1 (loc, object, extra_insns)
new = stack_pointer_rtx, offset = dynamic_offset;
else if (XEXP (x, 0) == virtual_outgoing_args_rtx)
new = stack_pointer_rtx, offset = out_arg_offset;
+ else if (XEXP (x, 0) == virtual_cfa_rtx)
+ new = arg_pointer_rtx, offset = cfa_offset;
else
{
/* We know the second operand is a constant. Unless the
@@ -3402,6 +3515,8 @@ instantiate_virtual_regs_1 (loc, object, extra_insns)
new = stack_pointer_rtx, offset = dynamic_offset;
else if (x == virtual_outgoing_args_rtx)
new = stack_pointer_rtx, offset = out_arg_offset;
+ else if (x == virtual_cfa_rtx)
+ new = arg_pointer_rtx, offset = cfa_offset;
if (new)
{
@@ -3902,6 +4017,7 @@ assign_parms (fndecl, second_time)
is readonly. */
MEM_IN_STRUCT_P (stack_parm) = aggregate;
RTX_UNCHANGING_P (stack_parm) = TREE_READONLY (parm);
+ MEM_ALIAS_SET (stack_parm) = get_alias_set (parm);
}
/* If this parameter was passed both in registers and in the stack,
@@ -3935,8 +4051,10 @@ assign_parms (fndecl, second_time)
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (entry_parm) == PARALLEL)
- emit_group_store (validize_mem (stack_parm),
- entry_parm);
+ emit_group_store (validize_mem (stack_parm), entry_parm,
+ int_size_in_bytes (TREE_TYPE (parm)),
+ (TYPE_ALIGN (TREE_TYPE (parm))
+ / BITS_PER_UNIT));
else
move_block_from_reg (REGNO (entry_parm),
validize_mem (stack_parm), nregs,
@@ -4106,7 +4224,10 @@ assign_parms (fndecl, second_time)
/* Handle calls that pass values in multiple non-contiguous
locations. The Irix 6 ABI has examples of this. */
if (GET_CODE (entry_parm) == PARALLEL)
- emit_group_store (validize_mem (stack_parm), entry_parm);
+ emit_group_store (validize_mem (stack_parm), entry_parm,
+ int_size_in_bytes (TREE_TYPE (parm)),
+ (TYPE_ALIGN (TREE_TYPE (parm))
+ / BITS_PER_UNIT));
else
move_block_from_reg (REGNO (entry_parm),
validize_mem (stack_parm),
@@ -4748,6 +4869,7 @@ pad_below (offset_ptr, passed_mode, sizetree)
}
#endif
+#ifdef ARGS_GROW_DOWNWARD
static tree
round_down (value, divisor)
tree value;
@@ -4757,6 +4879,7 @@ round_down (value, divisor)
size_binop (FLOOR_DIV_EXPR, value, size_int (divisor)),
size_int (divisor));
}
+#endif
/* Walk the tree of blocks describing the binding levels within a function
and warn about uninitialized variables.
@@ -4823,7 +4946,7 @@ setjmp_protect (block)
|| (GET_CODE (DECL_RTL (decl)) == MEM
&& GET_CODE (XEXP (DECL_RTL (decl), 0)) == ADDRESSOF))
/* If this variable came from an inline function, it must be
- that it's life doesn't overlap the setjmp. If there was a
+ that its life doesn't overlap the setjmp. If there was a
setjmp in the function, it would already be in memory. We
must exclude such variable because their DECL_RTL might be
set to strange things such as virtual_stack_vars_rtx. */
@@ -5134,8 +5257,8 @@ identify_blocks (block, insns)
}
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
{
- current_block_number = block_stack[--depth];
NOTE_BLOCK_NUMBER (insn) = current_block_number;
+ current_block_number = block_stack[--depth];
}
}
@@ -5316,6 +5439,7 @@ init_function_start (subr, filename, line)
current_function_epilogue_delay_list = 0;
current_function_uses_const_pool = 0;
current_function_uses_pic_offset_table = 0;
+ current_function_cannot_inline = 0;
/* We have not yet needed to make a label to jump to for tail-recursion. */
tail_recursion_label = 0;
@@ -5348,8 +5472,10 @@ init_function_start (subr, filename, line)
current_function_outgoing_args_size = 0;
/* Prevent ever trying to delete the first instruction of a function.
- Also tell final how to output a linenum before the function prologue. */
- emit_line_note (filename, line);
+ Also tell final how to output a linenum before the function prologue.
+ Note linenums could be missing, e.g. when compiling a Java .class file. */
+ if (line > 0)
+ emit_line_note (filename, line);
/* Make sure first insn is a note even if we don't want linenums.
This makes sure the first insn will never be deleted.
@@ -5435,6 +5561,10 @@ expand_function_start (subr, parms_have_cleanups)
valid operands of arithmetic insns. */
init_recog_no_volatile ();
+ current_function_instrument_entry_exit
+ = (flag_instrument_function_entry_exit
+ && ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (subr));
+
/* If function gets a static chain arg, store it in the stack frame.
Do this first, so it gets the first stack slot offset. */
if (current_function_needs_context)
@@ -5461,6 +5591,7 @@ expand_function_start (subr, parms_have_cleanups)
or if it returns a structure, or if it has parm cleanups. */
#ifdef HAVE_return
if (cleanup_label == 0 && HAVE_return
+ && ! current_function_instrument_entry_exit
&& ! current_function_returns_pcc_struct
&& ! (current_function_returns_struct && ! optimize))
return_label = 0;
@@ -5509,7 +5640,7 @@ expand_function_start (subr, parms_have_cleanups)
else if (DECL_MODE (DECL_RESULT (subr)) == VOIDmode)
/* If return mode is void, this decl rtl should not be used. */
DECL_RTL (DECL_RESULT (subr)) = 0;
- else if (parms_have_cleanups)
+ else if (parms_have_cleanups || current_function_instrument_entry_exit)
{
/* If function will end with cleanup code for parms,
compute the return values into a pseudo reg,
@@ -5627,6 +5758,21 @@ expand_function_start (subr, parms_have_cleanups)
}
}
+ if (current_function_instrument_entry_exit)
+ {
+ rtx fun = DECL_RTL (current_function_decl);
+ if (GET_CODE (fun) == MEM)
+ fun = XEXP (fun, 0);
+ else
+ abort ();
+ emit_library_call (profile_function_entry_libfunc, 0, VOIDmode, 2,
+ fun, Pmode,
+ expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
+ 0,
+ hard_frame_pointer_rtx),
+ Pmode);
+ }
+
/* After the display initializations is where the tail-recursion label
should go, if we end up needing one. Ensure we have a NOTE here
since some things (like trampolines) get placed before this. */
@@ -5690,7 +5836,9 @@ expand_function_end (filename, line, end_bindings)
tree function = TREE_PURPOSE (link);
rtx context = lookup_static_chain (function);
rtx tramp = RTL_EXPR_RTL (TREE_VALUE (link));
+#ifdef TRAMPOLINE_TEMPLATE
rtx blktramp;
+#endif
rtx seq;
#ifdef TRAMPOLINE_TEMPLATE
@@ -5838,6 +5986,21 @@ expand_function_end (filename, line, end_bindings)
}
}
+ if (current_function_instrument_entry_exit)
+ {
+ rtx fun = DECL_RTL (current_function_decl);
+ if (GET_CODE (fun) == MEM)
+ fun = XEXP (fun, 0);
+ else
+ abort ();
+ emit_library_call (profile_function_exit_libfunc, 0, VOIDmode, 2,
+ fun, Pmode,
+ expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
+ 0,
+ hard_frame_pointer_rtx),
+ Pmode);
+ }
+
/* If we had calls to alloca, and this machine needs
an accurate stack pointer to exit the function,
insert some code to save and restore the stack pointer. */
@@ -5915,6 +6078,10 @@ expand_function_end (filename, line, end_bindings)
use_variable (outgoing);
}
+ /* If this is an implementation of __throw, do what's necessary to
+ communicate between __builtin_eh_return and the epilogue. */
+ expand_eh_return ();
+
/* Output a return insn if we are using one.
Otherwise, let the rtl chain end here, to drop through
into the epilogue. */
@@ -5945,6 +6112,7 @@ static int *epilogue;
/* Create an array that records the INSN_UIDs of INSNS (either a sequence
or a single insn). */
+#if defined (HAVE_prologue) || defined (HAVE_epilogue)
static int *
record_insns (insns)
rtx insns;
@@ -5970,7 +6138,6 @@ record_insns (insns)
/* Determine how many INSN_UIDs in VEC are part of INSN. */
-#if defined (HAVE_prologue) || defined (HAVE_epilogue)
static int
contains (insn, vec)
rtx insn;
@@ -6141,12 +6308,19 @@ reposition_prologue_and_epilogue_notes (f)
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END)
break;
}
+
next = NEXT_INSN (note);
prev = PREV_INSN (note);
if (prev)
NEXT_INSN (prev) = next;
if (next)
PREV_INSN (next) = prev;
+
+ /* Whether or not we can depend on basic_block_head,
+ attempt to keep it up-to-date. */
+ if (basic_block_head[0] == note)
+ basic_block_head[0] = next;
+
add_insn_after (note, insn);
}
}
@@ -6185,7 +6359,14 @@ reposition_prologue_and_epilogue_notes (f)
NEXT_INSN (prev) = next;
if (next)
PREV_INSN (next) = prev;
- add_insn_after (note, PREV_INSN (insn));
+
+ /* Whether or not we can depend on basic_block_head,
+ attempt to keep it up-to-date. */
+ if (n_basic_blocks
+ && basic_block_head[n_basic_blocks-1] == insn)
+ basic_block_head[n_basic_blocks-1] = note;
+
+ add_insn_before (note, insn);
}
}
}
diff --git a/gcc/function.h b/gcc/function.h
index 3c887a3fc49..e84f71e3fe3 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -19,11 +19,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef NULL_TREE
-#define tree int *
+#if !defined(NULL_TREE) && !defined(tree)
+typedef union union_node *_function_tree;
+#define tree _function_tree
#endif
-#ifndef GET_CODE
-#define rtx int *
+#if !defined(NULL_RTX) && !defined(rtx)
+typedef struct rtx_def *_function_rtx;
+#define rtx _function_rtx
#endif
struct var_refs_queue
@@ -100,6 +102,7 @@ struct function
rtx tail_recursion_label;
rtx tail_recursion_reentry;
rtx internal_arg_pointer;
+ char *cannot_inline;
rtx arg_pointer_save_area;
tree rtl_expr_chain;
rtx last_parm_insn;
@@ -110,6 +113,7 @@ struct function
int temp_slot_level;
int target_temp_slot_level;
int var_temp_slot_level;
+ int instrument_entry_exit;
/* This slot is initialized as 0 and is added to
during the nested function. */
struct var_refs_queue *fixup_var_refs_queue;
@@ -133,6 +137,7 @@ struct function
/* For exception handling information. */
struct eh_stack ehstack;
+ struct eh_stack catchstack;
struct eh_queue ehqueue;
rtx catch_clauses;
struct label_node *false_label_stack;
@@ -256,6 +261,8 @@ extern void restore_emit_status PROTO((struct function *));
extern void save_storage_status PROTO((struct function *));
extern void restore_storage_status PROTO((struct function *));
+extern rtx get_first_block_beg PROTO((void));
+
#ifdef rtx
#undef rtx
#endif
diff --git a/gcc/gansidecl.h b/gcc/gansidecl.h
index 68cf7b26403..f9326403774 100644
--- a/gcc/gansidecl.h
+++ b/gcc/gansidecl.h
@@ -51,22 +51,22 @@ Boston, MA 02111-1307, USA. */
#endif
#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((unused))
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif /* ATTRIBUTE_UNUSED */
+#ifndef ATTRIBUTE_NORETURN
+#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif /* ATTRIBUTE_NORETURN */
+
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
+#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
+#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
#endif /* ATTRIBUTE_PRINTF */
-/* Define a generic NULL if one hasn't already been defined. */
-
-#ifndef NULL
-#define NULL 0
-#endif
-
#ifndef GENERIC_PTR
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
#define GENERIC_PTR void *
@@ -92,51 +92,4 @@ Boston, MA 02111-1307, USA. */
#endif /* ! __STDC__ */
-/* We don't have autoconf for libgcc2.c since it's a target, so don't
- define these functions, which aren't used there anyway. */
-#ifndef IN_LIBGCC2
-#ifndef bcopy
-# ifdef HAVE_BCOPY
-# ifdef NEED_DECLARATION_BCOPY
-void bcopy ();
-# endif
-# else
-# define bcopy(src,dst,len) memcpy ((dst),(src),(len))
-# endif
-#endif
-
-#ifndef bzero
-# ifdef HAVE_BZERO
-# ifdef NEED_DECLARATION_BZERO
-void bzero ();
-# endif
-# else
-# define bzero(dst,len) memset ((dst),0,(len))
-# endif
-#endif
-
-#ifndef bcmp
-# ifdef HAVE_BCMP
-# ifdef NEED_DECLARATION_BCMP
-int bcmp ();
-# endif
-# else
-# define bcmp(left,right,len) memcmp ((left),(right),(len))
-# endif
-#endif
-
-#ifndef HAVE_RINDEX
-# ifndef rindex
-# define rindex strrchr
-# endif
-#endif
-
-#ifndef HAVE_INDEX
-# ifndef index
-# define index strchr
-# endif
-#endif
-
-#endif /* IN_LIBGCC2 */
-
#endif /* ANSIDECL_H */
diff --git a/gcc/gbl-ctors.h b/gcc/gbl-ctors.h
index 50e0e567636..86b1c0ebcac 100644
--- a/gcc/gbl-ctors.h
+++ b/gcc/gbl-ctors.h
@@ -60,7 +60,7 @@ extern func_ptr __DTOR_LIST__[];
/* Declare the routine which need to get invoked at program exit time. */
-extern void __do_global_dtors ();
+extern void __do_global_dtors (void);
/* Define a macro with the code which needs to be executed at program
start-up time. This macro is used in two places in crtstuff.c (for
@@ -83,7 +83,7 @@ extern void __do_global_dtors ();
do { \
unsigned long nptrs = (unsigned long) __CTOR_LIST__[0]; \
unsigned i; \
- if (nptrs == -1) \
+ if (nptrs == (unsigned long)-1) \
for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++); \
for (i = nptrs; i >= 1; i--) \
__CTOR_LIST__[i] (); \
diff --git a/gcc/gcc.1 b/gcc/gcc.1
index 7fd507bb48d..b6a9d6211df 100644
--- a/gcc/gcc.1
+++ b/gcc/gcc.1
@@ -20,10 +20,10 @@
.if n .sp
.if t .sp 0.4
..
-.Id $Id: gcc.1,v 1.9 1998/12/16 20:55:57 law Exp $
+.Id $Id: gcc.1,v 1.8 1998/08/29 10:37:47 law Exp $
.TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
.SH NAME
-gcc, g++ \- GNU project C and C++ Compiler (egcs-1.0)
+gcc, g++ \- GNU project C and C++ Compiler (egcs-1.1)
.SH SYNOPSIS
.B gcc
.RI "[ " option " | " filename " ].\|.\|."
@@ -193,6 +193,7 @@ in the following sections.
\-Wimplicit\-int
\-Wimplicit\-function\-declaration
\-Winline
+\-Wlong\-long
\-Wmain
\-Wmissing\-prototypes
\-Wmissing\-declarations
@@ -2004,6 +2005,20 @@ Warn if an \c
.B \-Wenum\-clash
Warn about conversion between different enumeration types (C++ only).
.TP
+.B \-Wlong-long
+Warn if
+.B long long \c
+type is used. This is default. To inhibit
+the warning messages, use flag `\|\c
+.B \-Wno\-long\-long\c
+\&\|'. Flags `\|\c
+.B \-W\-long\-long\c
+\&\|' and `\|\c
+.B \-Wno\-long\-long\c
+\&\|' are taken into account only when flag `\|\c
+.B \-pedantic\c
+\&\|' is used.
+.TP
.B \-Woverloaded\-virtual
(C++ only.)
In a derived class, the definitions of virtual functions must match
@@ -3547,7 +3562,7 @@ be compiled with the same
value.
.TP
.B \-nocpp
-Tell the MIPS assembler to not run it's preprocessor over user
+Tell the MIPS assembler to not run its preprocessor over user
assembler files (with a `\|\c
.B .s\c
\&\|' suffix) when assembling them.
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1941aed2751..64fa16db3e5 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -32,12 +32,6 @@ Once it knows which kind of compilation to perform, the procedure for
compilation is specified by a string called a "spec". */
#include "config.h"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include <signal.h>
#include <sys/stat.h>
@@ -117,18 +111,11 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0};
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifndef GET_ENVIRONMENT
-#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
+#ifndef GET_ENV_PATH_LIST
+#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif
-extern char *choose_temp_base PROTO((void));
-
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else
-extern char *strerror();
-#endif
+extern char *my_strerror PROTO((int));
#ifndef HAVE_KILL
#define kill(p,s) raise(s)
@@ -163,6 +150,11 @@ static int print_multi_directory;
static int print_multi_lib;
+/* Flag saying to print the command line options understood by gcc and its
+ sub-processes. */
+
+static int print_help_list;
+
/* Flag indicating whether we should print the command and arguments */
static int verbose_flag;
@@ -232,7 +224,7 @@ static int check_live_switch PROTO((int, int));
static char *handle_braces PROTO((char *));
static char *save_string PROTO((char *, int));
static char *concat PVPROTO((char *, ...));
-static int do_spec PROTO((char *));
+extern int do_spec PROTO((char *));
static int do_spec_1 PROTO((char *, int, char *));
static char *find_file PROTO((char *));
static int is_directory PROTO((char *, char *, int));
@@ -248,13 +240,21 @@ static void perror_with_name PROTO((char *));
static void pfatal_pexecute PROTO((char *, char *));
static void fatal PVPROTO((char *, ...));
static void error PVPROTO((char *, ...));
+static void display_help PROTO((void));
void fancy_abort ();
char *xmalloc ();
char *xrealloc ();
#ifdef LANG_SPECIFIC_DRIVER
+/* Called before processing to change/add/remove arguments. */
extern void lang_specific_driver PROTO ((void (*) PVPROTO((char *, ...)), int *, char ***, int *));
+
+/* Called before linking. Returns 0 on success and -1 on failure. */
+extern int lang_specific_pre_link ();
+
+/* Number of extra output files that lang_specific_pre_link may generate. */
+extern int lang_specific_extra_outfiles;
#endif
/* Specs are strings containing lines, each of which (if not blank)
@@ -275,12 +275,30 @@ or with constant text in a single argument.
%b substitute the basename of the input file being processed.
This is the substring up to (and not including) the last period
and not including the directory.
- %g substitute the temporary-file-name-base. This is a string chosen
- once per compilation. Different temporary file names are made by
- concatenation of constant strings on the end, as in `%g.s'.
- %g also has the same effect of %d.
- %u like %g, but make the temporary file name unique.
- %U returns the last file name generated with %u.
+ %gSUFFIX
+ substitute a file name that has suffix SUFFIX and is chosen
+ once per compilation, and mark the argument a la %d. To reduce
+ exposure to denial-of-service attacks, the file name is now
+ chosen in a way that is hard to predict even when previously
+ chosen file names are known. For example, `%g.s ... %g.o ... %g.s'
+ might turn into `ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s'. SUFFIX matches
+ the regexp "[.A-Za-z]*" or the special string "%O", which is
+ treated exactly as if %O had been pre-processed. Previously, %g
+ was simply substituted 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.
+ %uSUFFIX
+ like %g, but generates a new temporary file name even if %uSUFFIX
+ was already seen.
+ %USUFFIX
+ substitutes the last file name generated with %uSUFFIX, generating a
+ new one if there is no such last file name. In the absence of any
+ %uSUFFIX, this is just like %gSUFFIX, except they don't share
+ the same suffix "space", so `%g.s ... %U.s ... %g.s ... %U.s'
+ would involve the generation of two distinct file names, one
+ for each `%g.s' and another for each `%U.s'. Previously, %U was
+ simply substituted with a file name chosen for the previous %u,
+ without regard to any appended suffix.
%d marks the argument containing or following the %d as a
temporary file name, so that that file will be deleted if CC exits
successfully. Unlike %g, this contributes no text to the argument.
@@ -297,7 +315,13 @@ or with constant text in a single argument.
Input files whose names have no recognized suffix are not compiled
at all, but they are included among the output files, so they will
be linked.
- %O substitutes the suffix for object files.
+ %O substitutes the suffix for object files. Note that this is
+ handled specially when it immediately follows %g, %u, or %U,
+ because of the need for those to form complete file names. The
+ handling is such that %O is treated exactly as if it had already
+ been substituted, except that %g, %u, and %U do not currently
+ support additional SUFFIX characters following %O as they would
+ following, for example, `.o'.
%p substitutes the standard macro predefinitions for the
current target machine. Use this when running cpp.
%P like %p, but puts `__' before and after the name of each macro.
@@ -321,7 +345,7 @@ or with constant text in a single argument.
This allows config.h to specify part of the spec for running as.
%A process ASM_FINAL_SPEC as a spec. A capital A is actually
used here. This can be used to run a post-processor after the
- assembler has done it's job.
+ assembler has done its job.
%D Dump out a -L option for each directory in startfile_prefixes.
If multilib_dir is set, extra entries are generated with it affixed.
%l process LINK_SPEC as a spec.
@@ -356,6 +380,8 @@ or with constant text in a single argument.
%{|!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.
%(Spec) processes a specification defined in a specs file as *Spec:
%[Spec] as above, but put __ around -D arguments
@@ -369,8 +395,9 @@ constructs. If another value of -O or the negated form of a -f, -m, or
value is ignored, except with {S*} where S is just one letter; this
passes all matching options.
-The character | is used to indicate that a command should be piped to
-the following command, but only if -pipe is specified.
+The character | at the beginning of the predicate text is used to indicate
+that a command should be piped to the following command, but only if -pipe
+is specified.
Note that it is built into CC which switches take arguments and which
do not. You might think it would be useful to generalize this to
@@ -536,6 +563,18 @@ static struct user_specs *user_specs_head, *user_specs_tail;
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
+
+#ifdef HAVE_EXECUTABLE_SUFFIX
+/* This defines which switches stop a full compilation. */
+#define DEFAULT_SWITCH_CURTAILS_COMPILATION(CHAR) \
+ ((CHAR) == 'c' || (CHAR) == 'S')
+
+#ifndef SWITCH_CURTAILS_COMPILATION
+#define SWITCH_CURTAILS_COMPILATION(CHAR) \
+ DEFAULT_SWITCH_CURTAILS_COMPILATION(CHAR)
+#endif
+#endif
+
/* Record the mapping from file suffixes for compilation specs. */
struct compiler
@@ -578,7 +617,42 @@ static struct compiler default_compilers[] =
/* Next come the entries for C. */
{".c", {"@c"}},
{"@c",
- {"cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ {
+#if USE_CPPLIB
+ "%{E|M|MM:cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ %{C:%{!E:%eGNU C does not support -C without using -E}}\
+ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
+ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
+ %{ansi:-trigraphs -D__STRICT_ANSI__}\
+ %{!undef:%{!ansi:%p} %P} %{trigraphs} \
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ %{traditional} %{ftraditional:-traditional}\
+ %{traditional-cpp:-traditional}\
+ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+ %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
+ %{!E:%{!M:%{!MM:cc1 %i %1 \
+ -lang-c%{ansi:89} %{nostdinc*} %{A*} %{I*} %I\
+ %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
+ %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
+ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
+ %{ansi:-trigraphs -D__STRICT_ANSI__}\
+ %{!undef:%{!ansi:%p} %P} %{trigraphs} \
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
+ %{H} %C %{D*} %{U*} %{i*} %Z\
+ %{ftraditional:-traditional}\
+ %{traditional-cpp:-traditional}\
+ %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
+ %{aux-info*}\
+ %{--help:--help} \
+ %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} \
+ %{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\
+ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
+ %{!pipe:%g.s} %A\n }}}}"
+ }},
+#else /* ! USE_CPPLIB */
+ "cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
@@ -589,16 +663,19 @@ static struct compiler default_compilers[] =
%{traditional-cpp:-traditional}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
- "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \
+ "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} \
%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
%{aux-info*}\
+ %{--help:--help} \
%{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\
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
- %{!pipe:%g.s} %A\n }}}}"}},
+ %{!pipe:%g.s} %A\n }}}}"
+ }},
+#endif /* ! USE_CPPLIB */
{"-",
{"%{E:cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
@@ -698,6 +775,12 @@ static int n_default_compilers
/* We want %{T*} after %{L*} and %D so that it can be used to specify linker
scripts which exist in user specified directories, or in standard
directories. */
+#ifdef LINK_COMMAND_SPEC
+/* Provide option to override link_command_spec from machine specific
+ configuration files. */
+static char *link_command_spec =
+ LINK_COMMAND_SPEC;
+#else
#ifdef LINK_LIBGCC_SPECIAL
/* Don't generate -L options. */
static char *link_command_spec = "\
@@ -723,6 +806,7 @@ static char *link_command_spec = "\
%{T*}\
\n }}}}}}";
#endif
+#endif
/* A vector of options to give to the linker.
These options are accumulated by %x,
@@ -1213,7 +1297,13 @@ static int argbuf_length;
static int argbuf_index;
+/* We want this on by default all the time now. */
+#define MKTEMP_EACH_FILE
+
#ifdef MKTEMP_EACH_FILE
+
+extern char *make_temp_file PROTO((char *));
+
/* This is the list of suffixes and codes (%g/%u/%U) and the associated
temp file. */
@@ -1225,8 +1315,11 @@ static struct temp_name {
int filename_length; /* strlen (filename). */
struct temp_name *next;
} *temp_names;
+#else
+extern char *choose_temp_base PROTO((void));
#endif
+
/* Number of commands executed so far. */
static int execution_count;
@@ -1557,8 +1650,8 @@ read_specs (filename, main_p)
fatal ("specs file malformed after %d characters", p - buffer);
p1 = p;
- /* Find next blank line. */
- while (*p1 && !(*p1 == '\n' && p1[1] == '\n'))
+ /* Find next blank line or end of string. */
+ while (*p1 && !(*p1 == '\n' && (p1[1] == '\n' || p1[1] == '\0')))
p1++;
/* Specs end at the blank line and do not include the newline. */
@@ -1791,7 +1884,7 @@ putenv (str)
/* Add a new environment variable */
environ = (char **) xmalloc (sizeof (char *) * (num_envs+2));
*environ = str;
- bcopy ((char *) old_environ, (char *) (environ + 1),
+ memcpy ((char *) (environ + 1), (char *) old_environ,
sizeof (char *) * (num_envs+1));
#endif /* VMS */
@@ -1890,6 +1983,26 @@ find_a_file (pprefix, name, mode)
struct prefix_list *pl;
int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
+#ifdef DEFAULT_ASSEMBLER
+ if (! strcmp(name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0) {
+ name = DEFAULT_ASSEMBLER;
+ len = strlen(name)+1;
+ temp = xmalloc (len);
+ strcpy (temp, name);
+ return temp;
+ }
+#endif
+
+#ifdef DEFAULT_LINKER
+ if (! strcmp(name, "ld") && access (DEFAULT_LINKER, mode) == 0) {
+ name = DEFAULT_LINKER;
+ len = strlen(name)+1;
+ temp = xmalloc (len);
+ strcpy (temp, name);
+ return temp;
+ }
+#endif
+
if (machine_suffix)
len += strlen (machine_suffix);
@@ -1902,7 +2015,7 @@ find_a_file (pprefix, name, mode)
|| (DIR_SEPARATOR == '\\' && name[1] == ':'
&& (name[2] == DIR_SEPARATOR || name[2] == '/')))
{
- if (access (name, mode))
+ if (access (name, mode) == 0)
{
strcpy (temp, name);
return temp;
@@ -2150,6 +2263,10 @@ execute ()
if (verbose_flag)
{
+ /* For help listings, put a blank line between sub-processes. */
+ if (print_help_list)
+ fputc ('\n', stderr);
+
/* Print each piped command as a separate line. */
for (i = 0; i < n_commands ; i++)
{
@@ -2347,6 +2464,109 @@ convert_filename (name, do_exe)
}
#endif
+/* Display the command line switches accepted by gcc. */
+static void
+display_help ()
+{
+ printf ("Usage: %s [options] file...\n", programname);
+ printf ("Options:\n");
+
+ printf (" --help Display this information\n");
+ if (! verbose_flag)
+ printf (" (Use '-v --help' to display command line options of sub-processes)\n");
+ printf (" -dumpspecs Display all of the built in spec strings\n");
+ printf (" -dumpversion Display the version of the compiler\n");
+ printf (" -dumpmachine Display the compiler's target processor\n");
+ printf (" -print-search-dirs Display the directories in the compiler's search path\n");
+ printf (" -print-libgcc-file-name Display the name of the compiler's companion library\n");
+ printf (" -print-file-name=<lib> Display the full path to library <lib>\n");
+ printf (" -print-prog-name=<prog> Display the full path to compiler component <prog>\n");
+ printf (" -print-multi-directory Display the root directory for versions of libgcc\n");
+ printf (" -print-multi-lib Display the mapping between command line options and\n");
+ printf (" multiple library search directories\n");
+ printf (" -Wa,<options> Pass comma-separated <options> on to the assembler\n");
+ printf (" -Wp,<options> Pass comma-separated <options> on to the preprocessor\n");
+ printf (" -Wl,<options> Pass comma-separated <options> on to the linker\n");
+ printf (" -Xlinker <arg> Pass <arg> on to the linker\n");
+ printf (" -save-temps Do not delete intermediate files\n");
+ printf (" -pipe Use pipes rather than intermediate files\n");
+ printf (" -specs=<file> Override builtin specs with the contents of <file>\n");
+ printf (" -B <directory> Add <directory> to the compiler's search paths\n");
+ printf (" -b <machine> Run gcc for target <machine>, if installed\n");
+ printf (" -V <version> Run gcc version number <version>, if installed\n");
+ printf (" -v Display the programs invoked by the compiler\n");
+ printf (" -E Preprocess only; do not compile, assemble or link\n");
+ printf (" -S Compile only; do not assemble or link\n");
+ printf (" -c Compile and assemble, but do not link\n");
+ printf (" -o <file> Place the output into <file>\n");
+ printf (" -x <language> Specify the language of the following input files\n");
+ printf (" Permissable languages include: c c++ assembler none\n");
+ printf (" 'none' means revert to the default behaviour of\n");
+ printf (" guessing the language based on the file's extension\n");
+
+ printf ("\nOptions starting with -g, -f, -m, -O or -W are automatically passed on to\n");
+ printf ("the various sub-processes invoked by %s. In order to pass other options\n",
+ programname);
+ printf ("on to these processes the -W<letter> options must be used.\n");
+
+ /* The rest of the options are displayed by invocations of the various
+ sub-processes. */
+}
+
+static void
+add_preprocessor_option (option, len)
+ char * option;
+ int len;
+{
+ n_preprocessor_options++;
+
+ if (! preprocessor_options)
+ preprocessor_options
+ = (char **) xmalloc (n_preprocessor_options * sizeof (char **));
+ else
+ preprocessor_options
+ = (char **) xrealloc (preprocessor_options,
+ n_preprocessor_options * sizeof (char **));
+
+ preprocessor_options [n_preprocessor_options - 1] = save_string (option, len);
+}
+
+static void
+add_assembler_option (option, len)
+ char * option;
+ int len;
+{
+ n_assembler_options++;
+
+ if (! assembler_options)
+ assembler_options
+ = (char **) xmalloc (n_assembler_options * sizeof (char **));
+ else
+ assembler_options
+ = (char **) xrealloc (assembler_options,
+ n_assembler_options * sizeof (char **));
+
+ assembler_options [n_assembler_options - 1] = save_string (option, len);
+}
+
+static void
+add_linker_option (option, len)
+ char * option;
+ int len;
+{
+ n_linker_options++;
+
+ if (! linker_options)
+ linker_options
+ = (char **) xmalloc (n_linker_options * sizeof (char **));
+ else
+ linker_options
+ = (char **) xrealloc (linker_options,
+ n_linker_options * sizeof (char **));
+
+ linker_options [n_linker_options - 1] = save_string (option, len);
+}
+
/* Create the vector `switches' and its contents.
Store its length in `n_switches'. */
@@ -2363,7 +2583,7 @@ process_command (argc, argv)
int have_o = 0;
int lang_n_infiles = 0;
- GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX");
+ GET_ENV_PATH_LIST (gcc_exec_prefix, "GCC_EXEC_PREFIX");
n_switches = 0;
n_infiles = 0;
@@ -2406,7 +2626,7 @@ process_command (argc, argv)
/* COMPILER_PATH and LIBRARY_PATH have values
that are lists of directory names with colons. */
- GET_ENVIRONMENT (temp, "COMPILER_PATH");
+ GET_ENV_PATH_LIST (temp, "COMPILER_PATH");
if (temp)
{
char *startp, *endp;
@@ -2440,7 +2660,7 @@ process_command (argc, argv)
}
}
- GET_ENVIRONMENT (temp, "LIBRARY_PATH");
+ GET_ENV_PATH_LIST (temp, "LIBRARY_PATH");
if (temp && *cross_compile == '0')
{
char *startp, *endp;
@@ -2473,7 +2693,7 @@ process_command (argc, argv)
}
/* Use LPATH like LIBRARY_PATH (for the CMU build program). */
- GET_ENVIRONMENT (temp, "LPATH");
+ GET_ENV_PATH_LIST (temp, "LPATH");
if (temp && *cross_compile == '0')
{
char *startp, *endp;
@@ -2537,6 +2757,19 @@ process_command (argc, argv)
printf ("%s\n", spec_machine);
exit (0);
}
+ else if (strcmp (argv[i], "-fhelp") == 0)
+ {
+ /* translate_options () has turned --help into -fhelp. */
+ print_help_list = 1;
+
+ /* We will be passing a dummy file on to the sub-processes. */
+ n_infiles++;
+ n_switches++;
+
+ add_preprocessor_option ("--help", 6);
+ add_assembler_option ("--help", 6);
+ add_linker_option ("--help", 6);
+ }
else if (! strcmp (argv[i], "-print-search-dirs"))
print_search_dirs = 1;
else if (! strcmp (argv[i], "-print-libgcc-file-name"))
@@ -2554,60 +2787,34 @@ process_command (argc, argv)
int prev, j;
/* Pass the rest of this option to the assembler. */
- n_assembler_options++;
- if (!assembler_options)
- assembler_options
- = (char **) xmalloc (n_assembler_options * sizeof (char **));
- else
- assembler_options
- = (char **) xrealloc (assembler_options,
- n_assembler_options * sizeof (char **));
-
/* Split the argument at commas. */
prev = 4;
for (j = 4; argv[i][j]; j++)
if (argv[i][j] == ',')
{
- assembler_options[n_assembler_options - 1]
- = save_string (argv[i] + prev, j - prev);
- n_assembler_options++;
- assembler_options
- = (char **) xrealloc (assembler_options,
- n_assembler_options * sizeof (char **));
+ add_assembler_option (argv[i] + prev, j - prev);
prev = j + 1;
}
+
/* Record the part after the last comma. */
- assembler_options[n_assembler_options - 1] = argv[i] + prev;
+ add_assembler_option (argv[i] + prev, j - prev);
}
else if (! strncmp (argv[i], "-Wp,", 4))
{
int prev, j;
/* Pass the rest of this option to the preprocessor. */
- n_preprocessor_options++;
- if (!preprocessor_options)
- preprocessor_options
- = (char **) xmalloc (n_preprocessor_options * sizeof (char **));
- else
- preprocessor_options
- = (char **) xrealloc (preprocessor_options,
- n_preprocessor_options * sizeof (char **));
-
/* Split the argument at commas. */
prev = 4;
for (j = 4; argv[i][j]; j++)
if (argv[i][j] == ',')
{
- preprocessor_options[n_preprocessor_options - 1]
- = save_string (argv[i] + prev, j - prev);
- n_preprocessor_options++;
- preprocessor_options
- = (char **) xrealloc (preprocessor_options,
- n_preprocessor_options * sizeof (char **));
+ add_preprocessor_option (argv[i] + prev, j - prev);
prev = j + 1;
}
+
/* Record the part after the last comma. */
- preprocessor_options[n_preprocessor_options - 1] = argv[i] + prev;
+ add_preprocessor_option (argv[i] + prev, j - prev);
}
else if (argv[i][0] == '+' && argv[i][1] == 'e')
/* The +e options to the C++ front-end. */
@@ -2780,6 +2987,7 @@ process_command (argc, argv)
}
break;
+ case 'S':
case 'c':
if (p[1] == 0)
{
@@ -2791,10 +2999,40 @@ process_command (argc, argv)
case 'o':
have_o = 1;
+#if defined(HAVE_EXECUTABLE_SUFFIX)
+ if (! have_c)
+ {
+ int skip;
+
+ /* Forward scan, just in case -S or -c is specified
+ after -o. */
+ int j = i + 1;
+ if (p[1] == 0)
+ ++j;
+ while (j < argc)
+ {
+ if (argv[j][0] == '-')
+ {
+ if (SWITCH_CURTAILS_COMPILATION (argv[j][1])
+ && argv[j][2] == 0)
+ {
+ have_c = 1;
+ break;
+ }
+ else if (skip = SWITCH_TAKES_ARG (argv[j][1]))
+ j += skip - (argv[j][2] != 0);
+ else if (skip = WORD_SWITCH_TAKES_ARG (argv[j] + 1))
+ j += skip;
+ }
+ j++;
+ }
+ }
+#endif
#if defined(HAVE_EXECUTABLE_SUFFIX) || defined(HAVE_OBJECT_SUFFIX)
- argv[i] = convert_filename (argv[i], 1);
if (p[1] == 0)
- argv[i+1] = convert_filename (argv[i+1], 1);
+ argv[i+1] = convert_filename (argv[i+1], ! have_c);
+ else
+ argv[i] = convert_filename (argv[i], ! have_c);
#endif
goto normal_switch;
@@ -2912,6 +3150,25 @@ process_command (argc, argv)
;
else if (! strcmp (argv[i], "-print-multi-directory"))
;
+ else if (strcmp (argv[i], "-fhelp") == 0)
+ {
+ if (verbose_flag)
+ {
+ /* Create a dummy input file, so that we can pass --help on to
+ the various sub-processes. */
+ infiles[n_infiles].language = "c";
+ infiles[n_infiles++].name = "help-dummy";
+
+ /* Preserve the --help switch so that it can be caught by the
+ cc1 spec string. */
+ switches[n_switches].part1 = "--help";
+ switches[n_switches].args = 0;
+ switches[n_switches].live_cond = 0;
+ switches[n_switches].valid = 0;
+
+ n_switches++;
+ }
+ }
else if (argv[i][0] == '+' && argv[i][1] == 'e')
{
/* Compensate for the +e options to the C++ front-end;
@@ -3068,9 +3325,9 @@ process_command (argc, argv)
sans all directory names, and basename_length is the number
of characters starting there excluding the suffix .c or whatever. */
-static char *input_filename;
+char *input_filename;
static int input_file_number;
-static size_t input_filename_length;
+size_t input_filename_length;
static int basename_length;
static char *input_basename;
static char *input_suffix;
@@ -3100,7 +3357,7 @@ static int input_from_pipe;
/* Process the spec SPEC and run the commands specified therein.
Returns 0 if the spec is successfully processed; -1 if failed. */
-static int
+int
do_spec (spec)
char *spec;
{
@@ -3401,16 +3658,30 @@ do_spec_1 (spec, inswitch, soft_matched_part)
That matters for the names of object files.
In 2.4, do something about that. */
struct temp_name *t;
+ int suffix_length;
char *suffix = p;
- while (*p == '.' || ISALPHA (*p)
- || (p[0] == '%' && p[1] == 'O'))
- p++;
+
+ if (p[0] == '%' && p[1] == 'O')
+ {
+ /* We don't support extra suffix characters after %O. */
+ if (*p == '.' || ISALPHA (*p))
+ abort ();
+ suffix = OBJECT_SUFFIX;
+ suffix_length = strlen (OBJECT_SUFFIX);
+ p += 2;
+ }
+ else
+ {
+ while (*p == '.' || ISALPHA (*p))
+ p++;
+ suffix_length = p - suffix;
+ }
/* See if we already have an association of %g/%u/%U and
suffix. */
for (t = temp_names; t; t = t->next)
- if (t->length == p - suffix
- && strncmp (t->suffix, suffix, p - suffix) == 0
+ if (t->length == suffix_length
+ && strncmp (t->suffix, suffix, suffix_length) == 0
&& t->unique == (c != 'g'))
break;
@@ -3423,10 +3694,10 @@ do_spec_1 (spec, inswitch, soft_matched_part)
t->next = temp_names;
temp_names = t;
}
- t->length = p - suffix;
- t->suffix = save_string (suffix, p - suffix);
+ t->length = suffix_length;
+ t->suffix = save_string (suffix, suffix_length);
t->unique = (c != 'g');
- temp_filename = choose_temp_base ();
+ temp_filename = make_temp_file (t->suffix);
temp_filename_length = strlen (temp_filename);
t->filename = temp_filename;
t->filename_length = temp_filename_length;
@@ -3481,9 +3752,16 @@ do_spec_1 (spec, inswitch, soft_matched_part)
break;
case 'o':
- for (i = 0; i < n_infiles; i++)
- store_arg (outfiles[i], 0, 0);
- break;
+ {
+ int max = n_infiles;
+#ifdef LANG_SPECIFIC_DRIVER
+ max += lang_specific_extra_outfiles;
+#endif
+ for (i = 0; i < max; i++)
+ if (outfiles[i])
+ store_arg (outfiles[i], 0, 0);
+ break;
+ }
case 'O':
obstack_grow (&obstack, OBJECT_SUFFIX, strlen (OBJECT_SUFFIX));
@@ -3536,16 +3814,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
/* This option is new; add it. */
- n_linker_options++;
- if (!linker_options)
- linker_options
- = (char **) xmalloc (n_linker_options * sizeof (char **));
- else
- linker_options
- = (char **) xrealloc (linker_options,
- n_linker_options * sizeof (char **));
-
- linker_options[n_linker_options - 1] = string;
+ add_linker_option (string, strlen (string));
}
break;
@@ -3817,8 +4086,9 @@ do_spec_1 (spec, inswitch, soft_matched_part)
to add and use their own specs.
%[...] modifies -D options the way %P does;
%(...) uses the spec unmodified. */
- case '(':
case '[':
+ error ("Warning: use of obsolete %%[ operator in specs");
+ case '(':
{
char *name = p;
struct spec_list *sl;
@@ -3965,11 +4235,10 @@ static char *
handle_braces (p)
register char *p;
{
- register char *q;
- char *filter;
+ char *filter, *body = NULL, *endbody;
int pipe_p = 0;
- int negate = 0;
- int suffix = 0;
+ int negate;
+ int suffix;
int include_blanks = 1;
if (*p == '^')
@@ -3982,6 +4251,9 @@ handle_braces (p)
This is used in %{|!pipe:...}. */
pipe_p = 1, ++p;
+next_member:
+ negate = suffix = 0;
+
if (*p == '!')
/* A `!' after the open-brace negates the condition:
succeed if the specified switch is not present. */
@@ -3998,24 +4270,36 @@ handle_braces (p)
}
filter = p;
- while (*p != ':' && *p != '}') p++;
- if (*p != '}')
+ while (*p != ':' && *p != '}' && *p != '|') p++;
+
+ if (*p == '|' && pipe_p)
+ abort ();
+
+ if (!body)
{
- register int count = 1;
- q = p + 1;
- while (count > 0)
- {
- if (*q == '{')
- count++;
- else if (*q == '}')
- count--;
- else if (*q == 0)
- abort ();
- q++;
+ if (*p != '}')
+ {
+ register int count = 1;
+ register char *q = p;
+
+ while (*q++ != ':') continue;
+ body = q;
+
+ while (count > 0)
+ {
+ if (*q == '{')
+ count++;
+ else if (*q == '}')
+ count--;
+ else if (*q == 0)
+ abort ();
+ q++;
+ }
+ endbody = q;
}
+ else
+ body = p, endbody = p+1;
}
- else
- q = p + 1;
if (suffix)
{
@@ -4023,14 +4307,12 @@ handle_braces (p)
&& strlen (input_suffix) == p - filter
&& strncmp (input_suffix, filter, p - filter) == 0);
- if (p[0] == '}')
+ if (body[0] == '}')
abort ();
if (negate != found
- && do_spec_1 (save_string (p + 1, q - p - 2), 0, NULL_PTR) < 0)
+ && do_spec_1 (save_string (body, endbody-body-1), 0, NULL_PTR) < 0)
return 0;
-
- return q;
}
else if (p[-1] == '*' && p[0] == '}')
{
@@ -4053,11 +4335,11 @@ handle_braces (p)
if (p[-1] == '*' && !negate)
{
int substitution;
- char *r = p;
+ char *r = body;
/* First see whether we have %*. */
substitution = 0;
- while (r < q)
+ while (r < endbody)
{
if (*r == '%' && r[1] == '*')
substitution = 1;
@@ -4071,7 +4353,7 @@ handle_braces (p)
in the text that follows the colon. */
unsigned hard_match_len = p - filter - 1;
- char *string = save_string (p + 1, q - p - 2);
+ char *string = save_string (body, endbody - body - 1);
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, filter, hard_match_len)
@@ -4082,7 +4364,10 @@ handle_braces (p)
give_switch (i, 1, 1);
}
- return q;
+ /* We didn't match. Try again. */
+ if (*p++ == '|')
+ goto next_member;
+ return endbody;
}
}
@@ -4116,7 +4401,7 @@ handle_braces (p)
}
}
- /* If it is as desired (present for %{s...}, absent for %{-s...})
+ /* If it is as desired (present for %{s...}, absent for %{!s...})
then substitute either the switch or the specified
conditional text. */
if (present != negate)
@@ -4127,7 +4412,8 @@ handle_braces (p)
}
else
{
- if (do_spec_1 (save_string (p + 1, q - p - 2), 0, NULL_PTR) < 0)
+ if (do_spec_1 (save_string (body, endbody - body - 1),
+ 0, NULL_PTR) < 0)
return 0;
}
}
@@ -4136,10 +4422,15 @@ handle_braces (p)
/* Here if a %{|...} conditional fails: output a minus sign,
which means "standard output" or "standard input". */
do_spec_1 ("-", 0, NULL_PTR);
+ return endbody;
}
}
- return q;
+ /* We didn't match; try again. */
+ if (*p++ == '|')
+ goto next_member;
+
+ return endbody;
}
/* Return 0 iff switch number SWITCHNUM is obsoleted by a later switch
@@ -4313,8 +4604,8 @@ is_directory (path1, path2, linker)
/* Construct the path from the two parts. Ensure the string ends with "/.".
The resulting path will be a directory even if the given path is a
symbolic link. */
- bcopy (path1, path, len1);
- bcopy (path2, path + len1, len2);
+ memcpy (path, path1, len1);
+ memcpy (path + len1, path2, len2);
cp = path + len1 + len2;
if (cp[-1] != '/' && cp[-1] != DIR_SEPARATOR)
*cp++ = DIR_SEPARATOR;
@@ -4437,8 +4728,10 @@ main (argc, argv)
/* Choose directory for temp files. */
+#ifndef MKTEMP_EACH_FILE
temp_filename = choose_temp_base ();
temp_filename_length = strlen (temp_filename);
+#endif
/* Make a table of what switches there are (switches, n_switches).
Make a table of specified input files (infiles, n_infiles).
@@ -4668,6 +4961,23 @@ main (argc, argv)
exit (0);
}
+ if (print_help_list)
+ {
+ display_help ();
+
+ if (! verbose_flag)
+ {
+ printf ("\nReport bugs to egcs-bugs@cygnus.com.\n");
+ printf ("Please see the file BUGS (included with the sources) first.\n");
+
+ exit (0);
+ }
+
+ /* We do not exit here. Instead we have created a fake input file
+ called 'help-dummy' which needs to be compiled, and we pass this
+ on the the various sub-processes, along with the --help switch. */
+ }
+
if (verbose_flag)
{
int n;
@@ -4696,8 +5006,12 @@ main (argc, argv)
/* Make a place to record the compiler output file names
that correspond to the input files. */
- outfiles = (char **) xmalloc (n_infiles * sizeof (char *));
- bzero ((char *) outfiles, n_infiles * sizeof (char *));
+ i = n_infiles;
+#ifdef LANG_SPECIFIC_DRIVER
+ i += lang_specific_extra_outfiles;
+#endif
+ outfiles = (char **) xmalloc (i * sizeof (char *));
+ bzero ((char *) outfiles, i * sizeof (char *));
/* Record which files were specified explicitly as link input. */
@@ -4792,6 +5106,17 @@ main (argc, argv)
clear_failure_queue ();
}
+#ifdef LANG_SPECIFIC_DRIVER
+ if (error_count == 0)
+ {
+ /* Make sure INPUT_FILE_NUMBER points to first available open
+ slot. */
+ input_file_number = n_infiles;
+ if (lang_specific_pre_link ())
+ error_count++;
+ }
+#endif
+
/* Run ld to link all the compiler output files. */
if (error_count == 0)
@@ -4835,6 +5160,12 @@ main (argc, argv)
delete_failure_queue ();
delete_temp_files ();
+ if (print_help_list)
+ {
+ printf ("\nReport bugs to egcs-bugs@cygnus.com.\n");
+ printf ("Please see the file BUGS (included with the sources) first.\n");
+ }
+
exit (error_count > 0 ? (signal_count ? 2 : 1) : 0);
/* NOTREACHED */
return 0;
diff --git a/gcc/gcc.texi b/gcc/gcc.texi
index e0584aafc6e..b0fee64ddcd 100644
--- a/gcc/gcc.texi
+++ b/gcc/gcc.texi
@@ -80,6 +80,10 @@
@c @end tex
@ifinfo
+@dircategory Programming
+@direntry
+* gcc: (gcc). The GNU C compiler.
+@end direntry
@ifset INTERNALS
@ifset USING
This file documents the use and the internals of the GNU compiler.
@@ -146,7 +150,7 @@ instead of in the original English.
@sp 1
@c The version number appears five times more in this file.
-@center for egcs-1.0
+@center for egcs-1.1
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, 89, 92, 93, 94, 95, 96, 98 Free Software Foundation, Inc.
@@ -2244,11 +2248,13 @@ Please report each bug in a separate message. This makes it easier for
us to track which bugs have been fixed and to forward your bugs reports
to the appropriate maintainer.
-Do not compress and encode any part of your bug report using programs
-such as @file{uuencode}. If you do so it will slow down the processing
-of your bug. If you must submit multiple large files, use @file{shar},
-which allows us to read your message without having to run any
-decompression programs.
+If you include source code in your message, you can send it as clear
+text if it is small. If the message is larger, you may compress it using
+@file{gzip}, @file{bzip2}, or @file{pkzip}. Please be aware that sending
+compressed files needs an additional binary-safe mechanism such as
+@code{MIME} or @code{uuencode}. There is a 40k message limit on the
+@samp{egcs-bugs@@cygnus.com} mailing list at the time of this writing
+(August 1998).
To enable someone to investigate the bug, you should include all these
things:
@@ -2264,12 +2270,12 @@ the bug in the current version of GNU CC.
@item
A complete input file that will reproduce the bug. If the bug is in the
C preprocessor, send a source file and any header files that it
-requires. If the bug is in the compiler proper (@file{cc1}), run your
-source file through the C preprocessor by doing @samp{gcc -E
-@var{sourcefile} > @var{outfile}}, then include the contents of
-@var{outfile} in the bug report. (When you do this, use the same
-@samp{-I}, @samp{-D} or @samp{-U} options that you used in actual
-compilation.)
+requires. If the bug is in the compiler proper (@file{cc1}), send the
+preprocessor output generated by adding @samp{-save-temps} to the
+compilation command (@pxref{Debugging Options}). When you do this, use
+the same @samp{-I}, @samp{-D} or @samp{-U} options that you used in
+actual compilation. Then send the @var{input}.i or @var{input}.ii files
+generated.
A single statement is not enough of an example. In order to compile it,
it must be embedded in a complete file of compiler input; and the bug
@@ -3302,6 +3308,22 @@ The option @samp{-ds} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.cse} to
the input file name.
+@cindex global common subexpression elimination
+@cindex constant propagation
+@cindex copy propagation
+@item
+Global common subexpression elimination. This pass performs GCSE
+using Morel-Renvoise Partial Redundancy Elimination, with the exception
+that it does not try to move invariants out of loops - that is left to
+the loop optimization pass. This pass also performs global constant
+and copy propagation.
+
+The source file for this pass is gcse.c.
+
+The option @samp{-dG} causes a debugging dump of the RTL code after
+this pass. This dump file's name is made by appending @samp{.gcse} to
+the input file name.
+
@cindex loop optimization
@cindex code motion
@cindex strength-reduction
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index e49511d29bb..c2949a311af 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -24,6 +24,11 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <sys/types.h>
+static int __fetch_long PROTO ((long *, char *, int));
+static int __store_long PROTO ((long, char *, size_t));
+static int __read_long PROTO ((long *, FILE *, size_t));
+static int __write_long PROTO ((long, FILE *, size_t));
+
/* These routines only work for signed values. */
/* Store a portable representation of VALUE in DEST using BYTES*8-1 bits.
diff --git a/gcc/gcov.c b/gcc/gcov.c
index c546bdce7b7..eff68f1608a 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -218,6 +218,7 @@ static void open_files PROTO ((void));
static void read_files PROTO ((void));
static void scan_for_source_files PROTO ((void));
static void output_data PROTO ((void));
+static void print_usage PROTO ((void));
char * xmalloc ();
int
diff --git a/gcc/gen-protos.c b/gcc/gen-protos.c
index f423b3ff86e..f6533e7bed3 100644
--- a/gcc/gen-protos.c
+++ b/gcc/gen-protos.c
@@ -17,6 +17,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "hconfig.h"
#include "system.h"
+#include "gansidecl.h"
#include "scan.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -28,9 +29,9 @@ char *progname;
int hash_tab[HASH_SIZE];
int next_index;
-static int
+int
hashf (name, len, hashsize)
- register U_CHAR *name;
+ register const U_CHAR *name;
register int len;
int hashsize;
{
@@ -109,7 +110,7 @@ parse_fn_proto (start, end, fn)
ptr--;
while (*ptr == ' ' || *ptr == '\t') ptr--;
- if (!ISALNUM (*ptr))
+ if (!ISALNUM ((unsigned char)*ptr))
{
if (verbose)
fprintf (stderr, "%s: Can't handle this complex prototype: %s\n",
@@ -118,7 +119,7 @@ parse_fn_proto (start, end, fn)
}
name_end = ptr+1;
- while (ISALNUM (*ptr) || *ptr == '_') --ptr;
+ while (ISALNUM ((unsigned char)*ptr) || *ptr == '_') --ptr;
name_start = ptr+1;
while (*ptr == ' ' || *ptr == '\t') ptr--;
ptr[1] = 0;
@@ -139,7 +140,7 @@ parse_fn_proto (start, end, fn)
int
main (argc, argv)
- int argc;
+ int argc ATTRIBUTE_UNUSED;
char **argv;
{
FILE *inf = stdin;
@@ -157,7 +158,7 @@ main (argc, argv)
fprintf (outf, "struct fn_decl std_protos[] = {\n");
/* A hash table entry of 0 means "unused" so reserve it. */
- fprintf (outf, " {\"\", \"\", \"\"},\n");
+ fprintf (outf, " {\"\", \"\", \"\", 0},\n");
next_index = 1;
for (;;)
@@ -179,13 +180,13 @@ main (argc, argv)
add_hash (fn_decl.fname);
- fprintf (outf, " {\"%s\", \"%s\", \"%s\"},\n",
+ fprintf (outf, " {\"%s\", \"%s\", \"%s\", 0},\n",
fn_decl.fname, fn_decl.rtype, fn_decl.params);
if (c == EOF)
break;
}
- fprintf (outf, " {0, 0, 0}\n};\n");
+ fprintf (outf, " {0, 0, 0, 0}\n};\n");
fprintf (outf, "#define HASH_SIZE %d\n", HASH_SIZE);
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 58e99307b6c..191e27486c5 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -32,7 +32,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
@@ -221,11 +221,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genattr: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 9680d8bd3ab..d57dd51b72f 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -96,12 +96,6 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
-/* varargs must always be included after *config.h. */
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include "rtl.h"
#include "insn-config.h" /* For REGISTER_CONSTRAINTS */
@@ -125,7 +119,7 @@ struct obstack *temp_obstack = &obstack2;
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
char **insn_name_ptr = 0;
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* enough space to reserve for printing out ints */
@@ -178,11 +172,13 @@ struct attr_desc
{
char *name; /* Name of attribute. */
struct attr_desc *next; /* Next attribute. */
- int is_numeric; /* Values of this attribute are numeric. */
- int negative_ok; /* Allow negative numeric values. */
- int unsigned_p; /* Make the output function unsigned int. */
- int is_const; /* Attribute value constant for each run. */
- int is_special; /* Don't call `write_attr_set'. */
+ unsigned is_numeric : 1; /* Values of this attribute are numeric. */
+ unsigned negative_ok : 1; /* Allow negative numeric values. */
+ unsigned unsigned_p : 1; /* Make the output function unsigned int. */
+ unsigned is_const : 1; /* Attribute value constant for each run. */
+ unsigned is_special : 1; /* Don't call `write_attr_set'. */
+ unsigned func_units_p : 1; /* this is the function_units attribute */
+ unsigned blockage_p : 1; /* this is the blockage range function */
struct attr_value *first_value; /* First value of this attribute. */
struct attr_value *default_val; /* Default value for this attribute. */
};
@@ -339,7 +335,9 @@ static char *alternative_name;
int reload_completed = 0;
-/* Similarly since PRESERVE_DEATH_INFO_REGNO_P might reference "optimize". */
+/* Some machines test `optimize' in macros called from rtlanal.c, so we need
+ to define it here. */
+
int optimize = 0;
/* Simplify an expression. Only call the routine if there is something to
@@ -435,6 +433,7 @@ static void write_attr_set PROTO((struct attr_desc *, int, rtx, char *,
char *, rtx, int, int));
static void write_attr_case PROTO((struct attr_desc *, struct attr_value *,
int, char *, char *, int, rtx));
+static void write_unit_name PROTO((char *, int, char *));
static void write_attr_valueq PROTO((struct attr_desc *, char *));
static void write_attr_value PROTO((struct attr_desc *, rtx));
static void write_upcase PROTO((char *));
@@ -952,12 +951,12 @@ check_attr_test (exp, is_const)
return exp;
}
else
- fatal ("Unknown attribute `%s' in EQ_ATTR", XEXP (exp, 0));
+ fatal ("Unknown attribute `%s' in EQ_ATTR", XSTR (exp, 0));
}
if (is_const && ! attr->is_const)
fatal ("Constant expression uses insn attribute `%s' in EQ_ATTR",
- XEXP (exp, 0));
+ XSTR (exp, 0));
/* Copy this just to make it permanent,
so expressions using it can be permanent too. */
@@ -974,7 +973,7 @@ check_attr_test (exp, is_const)
for (p = XSTR (exp, 1); *p; p++)
if (*p < '0' || *p > '9')
fatal ("Attribute `%s' takes only numeric values",
- XEXP (exp, 0));
+ XSTR (exp, 0));
}
else
{
@@ -985,7 +984,7 @@ check_attr_test (exp, is_const)
if (av == NULL)
fatal ("Unknown value `%s' for `%s' attribute",
- XEXP (exp, 1), XEXP (exp, 0));
+ XSTR (exp, 1), XSTR (exp, 0));
}
}
else
@@ -1909,7 +1908,7 @@ expand_units ()
unitsmask = attr_rtx (FFS, unitsmask);
}
- make_internal_attr ("*function_units_used", unitsmask, 2);
+ make_internal_attr ("*function_units_used", unitsmask, 10);
/* Create an array of ops for each unit. Add an extra unit for the
result_ready_cost function that has the ops of all other units. */
@@ -2122,13 +2121,13 @@ expand_units ()
if (unit->needs_range_function)
{
/* Compute the blockage range function and make an attribute
- for writing it's value. */
+ for writing its value. */
newexp = operate_exp (RANGE_OP, min_blockage, max_blockage);
newexp = simplify_knowing (newexp, unit->condexp);
str = attr_printf (strlen (unit->name) + sizeof ("*_unit_blockage_range"),
"*%s_unit_blockage_range", unit->name);
- make_internal_attr (str, newexp, 4);
+ make_internal_attr (str, newexp, 20);
}
str = attr_printf (strlen (unit->name) + sizeof ("*_unit_ready_cost"),
@@ -2392,7 +2391,7 @@ make_length_attrs ()
"*insn_current_length"};
static rtx (*no_address_fn[]) PROTO((rtx)) = {identity_fn, zero_fn, zero_fn};
static rtx (*address_fn[]) PROTO((rtx)) = {max_fn, one_fn, identity_fn};
- int i;
+ size_t i;
struct attr_desc *length_attr, *new_attr;
struct attr_value *av, *new_av;
struct insn_ent *ie, *new_ie;
@@ -2443,14 +2442,14 @@ identity_fn (exp)
static rtx
zero_fn (exp)
- rtx exp;
+ rtx exp ATTRIBUTE_UNUSED;
{
return make_numeric_value (0);
}
static rtx
one_fn (exp)
- rtx exp;
+ rtx exp ATTRIBUTE_UNUSED;
{
return make_numeric_value (1);
}
@@ -4401,8 +4400,7 @@ gen_unit (def)
unit->condexp = insert_right_side (IOR, unit->condexp, op->condexp, -2, -2);
}
-/* Given a piece of RTX, print a C expression to test it's truth value.
-
+/* Given a piece of RTX, print a C expression to test its truth value.
We use AND and IOR both for logical and bit-wise operations, so
interpret them as logical unless they are inside a comparison expression.
The first bit of FLAGS will be non-zero in that case.
@@ -5177,16 +5175,61 @@ write_toplevel_expr (p)
/* Utilities to write names in various forms. */
static void
+write_unit_name (prefix, num, suffix)
+ char *prefix;
+ int num;
+ char *suffix;
+{
+ struct function_unit *unit;
+
+ for (unit = units; unit; unit = unit->next)
+ if (unit->num == num)
+ {
+ printf ("%s%s%s", prefix, unit->name, suffix);
+ return;
+ }
+
+ printf ("%s<unknown>%s", prefix, suffix);
+}
+
+static void
write_attr_valueq (attr, s)
struct attr_desc *attr;
char *s;
{
if (attr->is_numeric)
{
- printf ("%s", s);
- /* Make the blockage range values easier to read. */
- if (strlen (s) > 1)
- printf (" /* 0x%x */", atoi (s));
+ int num = atoi (s);
+
+ printf ("%d", num);
+
+ /* Make the blockage range values and function units used values easier
+ to read. */
+ if (attr->func_units_p)
+ {
+ if (num == -1)
+ printf (" /* units: none */");
+ else if (num >= 0)
+ write_unit_name (" /* units: ", num, " */");
+ else
+ {
+ int i;
+ char *sep = " /* units: ";
+ for (i = 0, num = ~num; num; i++, num >>= 1)
+ if (num & 1)
+ {
+ write_unit_name (sep, i, (num == 1) ? " */" : "");
+ sep = ", ";
+ }
+ }
+ }
+
+ else if (attr->blockage_p)
+ printf (" /* min %d, max %d */", num >> (HOST_BITS_PER_INT / 2),
+ num & ((1 << (HOST_BITS_PER_INT / 2)) - 1));
+
+ else if (num > 9 || num < 0)
+ printf (" /* 0x%x */", num);
}
else
{
@@ -5626,6 +5669,8 @@ make_internal_attr (name, value, special)
attr->is_special = (special & 1) != 0;
attr->negative_ok = (special & 2) != 0;
attr->unsigned_p = (special & 4) != 0;
+ attr->func_units_p = (special & 8) != 0;
+ attr->blockage_p = (special & 16) != 0;
attr->default_val = get_attr_value (value, attr, -2);
}
@@ -5769,12 +5814,22 @@ copy_rtx_unchanging (orig)
}
static void
-fatal (s, a1, a2)
- char *s;
- char *a1, *a2;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genattrtab: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
@@ -5945,6 +6000,7 @@ from the machine description file `md'. */\n\n");
printf ("#include \"real.h\"\n");
printf ("#include \"output.h\"\n");
printf ("#include \"insn-attr.h\"\n");
+ printf ("#include \"toplev.h\"\n");
printf ("\n");
printf ("#define operands recog_operand\n\n");
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index c74ae0a6e9f..725cc651e69 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -34,7 +34,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
@@ -79,11 +79,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "gencodes: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index ce85c7a52d2..75693c1fb65 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -50,7 +50,7 @@ static int clobbers_seen_this_insn;
static int dup_operands_seen_this_insn;
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
static void walk_insn_part PROTO((rtx, int, int));
@@ -268,11 +268,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genconfig: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
diff --git a/gcc/genemit.c b/gcc/genemit.c
index e61d3c09dc4..d13ff5e35b2 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -31,7 +31,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
@@ -620,7 +620,6 @@ output_add_clobbers ()
printf ("\n\nvoid\nadd_clobbers (pattern, insn_code_number)\n");
printf (" rtx pattern;\n int insn_code_number;\n");
printf ("{\n");
- printf (" int i;\n\n");
printf (" switch (insn_code_number)\n");
printf (" {\n");
@@ -703,11 +702,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genemit: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
@@ -763,11 +773,12 @@ from the machine description file `md'. */\n\n");
printf ("#include \"insn-config.h\"\n\n");
printf ("#include \"insn-flags.h\"\n\n");
printf ("#include \"insn-codes.h\"\n\n");
+ printf ("#include \"reload.h\"\n");
printf ("extern char *insn_operand_constraint[][MAX_RECOG_OPERANDS];\n\n");
printf ("extern rtx recog_operand[];\n");
printf ("#define operands emit_operand\n\n");
- printf ("#define FAIL do {end_sequence (); return _val;} while (0)\n");
- printf ("#define DONE do {_val = gen_sequence (); end_sequence (); return _val;} while (0)\n");
+ printf ("#define FAIL return (end_sequence (), _val)\n");
+ printf ("#define DONE return (_val = gen_sequence (), end_sequence (), _val)\n");
/* Read the machine description. */
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 574a8f38b9c..6b64077c026 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -100,7 +100,7 @@ static void walk_rtx PROTO ((rtx, char *));
static void print_path PROTO ((char *));
char *xmalloc PROTO ((unsigned));
char *xrealloc PROTO ((char *, unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
static char *copystr PROTO ((char *));
static void mybzero ();
void fancy_abort PROTO ((void));
@@ -313,6 +313,14 @@ print_path (path)
register int len = strlen (path);
register int i;
+ if (len == 0)
+ {
+ /* Don't emit "pat", since we may try to take the address of it,
+ which isn't what is intended. */
+ printf("PATTERN (insn)");
+ return;
+ }
+
/* We first write out the operations (XEXP or XVECEXP) in reverse
order, then write "insn", then the indices in forward order. */
@@ -362,11 +370,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genextract: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
@@ -439,11 +458,12 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
- printf ("#include \"rtl.h\"\n\n");
+ printf ("#include \"rtl.h\"\n");
+ printf ("#include \"toplev.h\"\n\n");
/* This variable exists only so it can be the "location"
of any missing operand whose numbers are skipped by a given pattern. */
- printf ("static rtx junk;\n");
+ printf ("static rtx junk ATTRIBUTE_UNUSED;\n");
printf ("extern rtx recog_operand[];\n");
printf ("extern rtx *recog_operand_loc[];\n");
@@ -456,7 +476,7 @@ from the machine description file `md'. */\n\n");
printf (" register rtx *ro = recog_operand;\n");
printf (" register rtx **ro_loc = recog_operand_loc;\n");
printf (" rtx pat = PATTERN (insn);\n");
- printf (" int i;\n\n");
+ printf (" int i ATTRIBUTE_UNUSED;\n\n");
printf (" switch (INSN_CODE (insn))\n");
printf (" {\n");
printf (" case -1:\n");
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 9a21ef0c265..dee8128a9c2 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -34,7 +34,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* Names for patterns. Need to allow linking with print-rtl. */
@@ -199,11 +199,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genflags: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index dfa3a6ae55b..aa886aba23a 100644
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
#include "system.h"
-#include "obstack.h"
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-
#define NO_GENRTL_H
#include "rtl.h"
@@ -35,11 +31,7 @@ struct rtx_definition
const char *enumname, *name, *format;
};
-#if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__))
-#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { # ENUM, NAME, FORMAT },
-#else
-#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { "ENUM", NAME, FORMAT },
-#endif
+#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGIFY(ENUM), NAME, FORMAT },
struct rtx_definition defs[] =
{
@@ -48,8 +40,8 @@ struct rtx_definition defs[] =
const char *formats[NUM_RTX_CODE];
-static const char *type_from_format PROTO((char));
-static const char *accessor_from_format PROTO((char));
+static const char *type_from_format PROTO((int));
+static const char *accessor_from_format PROTO((int));
static int special_format PROTO((const char *));
static int special_rtx PROTO((int));
static void find_formats PROTO((void));
@@ -62,7 +54,7 @@ static void gencode PROTO((FILE *));
static const char *
type_from_format (c)
- char c;
+ int c;
{
switch (c)
{
@@ -77,6 +69,16 @@ type_from_format (c)
return "rtx";
case 'E':
return "rtvec";
+ /* ?!? These should be bitmap and tree respectively, but those types
+ are not available in many of the files which include the output
+ of gengenrtl.
+
+ These are only used in prototypes, so I think we can assume that
+ void * is useable. */
+ case 'b':
+ return "void *";
+ case 't':
+ return "void *";
default:
abort ();
}
@@ -84,7 +86,7 @@ type_from_format (c)
static const char *
accessor_from_format (c)
- char c;
+ int c;
{
switch (c)
{
@@ -99,6 +101,10 @@ accessor_from_format (c)
return "XEXP";
case 'E':
return "XVEC";
+ case 'b':
+ return "XBITMAP";
+ case 't':
+ return "XTREE";
default:
abort ();
}
@@ -119,7 +125,8 @@ special_rtx (idx)
int idx;
{
return (strcmp (defs[idx].enumname, "CONST_INT") == 0
- || strcmp (defs[idx].enumname, "REG") == 0);
+ || strcmp (defs[idx].enumname, "REG") == 0
+ || strcmp (defs[idx].enumname, "MEM") == 0);
}
static void
@@ -258,14 +265,16 @@ gencode (f)
const char **fmt;
fputs ("#include \"config.h\"\n", f);
- fputs ("#include \"rtl.h\"\n\n", f);
+ fputs ("#include \"system.h\"\n", f);
+ fputs ("#include \"obstack.h\"\n", f);
+ fputs ("#include \"rtl.h\"\n", f);
fputs ("#include \"ggc.h\"\n\n\n", f);
for (fmt = formats; *fmt; ++fmt)
gendef (f, *fmt);
}
-#if defined(USE_C_ALLOCA) && !defined(__GNUC__)
+#if defined(USE_C_ALLOCA)
char *
xmalloc (nbytes)
int nbytes;
@@ -274,13 +283,14 @@ xmalloc (nbytes)
if (!tmp)
{
- fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
+ fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
+ nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
-#endif /* USE_C_ALLOCA && !__GNUC__ */
+#endif /* USE_C_ALLOCA */
int
main(argc, argv)
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index fad369526a6..f0b57bb9be9 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -31,7 +31,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* Many parts of GCC use arrays that are indexed by machine mode and
@@ -304,11 +304,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genopinit: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 490ecb47c5a..400a8be442b 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -108,9 +108,9 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
-static void error ();
+static void error PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
static void mybcopy ();
static void mybzero ();
static int n_occurrences PROTO((int, char *));
@@ -922,11 +922,22 @@ mybcopy (b1, b2, length)
}
static void
-fatal (s, a1, a2, a3, a4)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genoutput: ");
- fprintf (stderr, s, a1, a2, a3, a4);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
@@ -941,11 +952,22 @@ fancy_abort ()
}
static void
-error (s, a1, a2)
- char *s;
+error VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genoutput: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
have_error = 1;
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index 805e9efc5ae..99fcec54ce5 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -47,7 +47,7 @@ struct link
};
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
static int max_opno;
@@ -407,11 +407,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genpeep: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}
@@ -465,7 +476,7 @@ from the machine description file `md'. */\n\n");
printf ("#define operands peep_operand\n\n");
printf ("rtx\npeephole (ins1)\n rtx ins1;\n{\n");
- printf (" rtx insn, x, pat;\n\n");
+ printf (" rtx insn ATTRIBUTE_UNUSED, x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n");
/* Early out: no peepholes for insns followed by barriers. */
printf (" if (NEXT_INSN (ins1)\n");
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 21a5abd8109..cffa47fd7b9 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -191,7 +191,7 @@ static void change_state PROTO((char *, char *, int));
static char *copystr PROTO((char *));
static void mybzero PROTO((char *, unsigned));
static void mybcopy PROTO((char *, char *, unsigned));
-static void fatal PROTO((char *));
+static void fatal PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1;
char *xrealloc PROTO((char *, unsigned));
char *xmalloc PROTO((unsigned));
void fancy_abort PROTO((void));
@@ -451,6 +451,19 @@ add_to_sequence (pattern, last, position)
goto restart;
case SET:
+ /* The operands of a SET must have the same mode unless one is VOIDmode. */
+ if (GET_MODE (SET_SRC (pattern)) != VOIDmode
+ && GET_MODE (SET_DEST (pattern)) != VOIDmode
+ && GET_MODE (SET_SRC (pattern)) != GET_MODE (SET_DEST (pattern))
+ /* The mode of an ADDRESS_OPERAND is the mode of the memory reference,
+ not the mode of the address. */
+ && ! (GET_CODE (SET_SRC (pattern)) == MATCH_OPERAND
+ && ! strcmp (XSTR (SET_SRC (pattern), 1), "address_operand")))
+ {
+ print_rtl (stderr, pattern);
+ fputc ('\n', stderr);
+ fatal ("mode mismatch in SET");
+ }
newpos[depth] = '0';
new = add_to_sequence (SET_DEST (pattern), &new->success, newpos);
this->success.first->enforce_mode = 1;
@@ -998,19 +1011,19 @@ write_subroutine (tree, type)
printf (", pnum_clobbers");
printf (")\n");
- printf (" register rtx x0;\n rtx insn;\n");
+ printf (" register rtx x0;\n rtx insn ATTRIBUTE_UNUSED;\n");
if (type == RECOG)
- printf (" int *pnum_clobbers;\n");
+ printf (" int *pnum_clobbers ATTRIBUTE_UNUSED;\n");
printf ("{\n");
printf (" register rtx *ro = &recog_operand[0];\n");
printf (" register rtx ");
for (i = 1; i < max_depth; i++)
- printf ("x%d, ", i);
+ printf ("x%d ATTRIBUTE_UNUSED, ", i);
- printf ("x%d;\n", max_depth);
- printf (" %s tem;\n", type == SPLIT ? "rtx" : "int");
+ printf ("x%d ATTRIBUTE_UNUSED;\n", max_depth);
+ printf (" %s tem ATTRIBUTE_UNUSED;\n", type == SPLIT ? "rtx" : "int");
write_tree (tree, "", NULL_PTR, 1, type);
printf (" ret0: return %d;\n}\n\n", type == SPLIT ? 0 : -1);
}
@@ -1669,11 +1682,22 @@ xmalloc (size)
}
static void
-fatal (s)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "genrecog: ");
- fprintf (stderr, s);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
fprintf (stderr, "after %d definitions\n", next_index);
exit (FATAL_EXIT_CODE);
diff --git a/gcc/getopt.c b/gcc/getopt.c
deleted file mode 100644
index a9a101f3c1b..00000000000
--- a/gcc/getopt.c
+++ /dev/null
@@ -1,1051 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to drepper@gnu.org
- before changing it!
-
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
- Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-# ifndef const
-# define const
-# endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-# define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-# include <stdlib.h>
-# include <unistd.h>
-#endif /* GNU C library. */
-
-#ifdef VMS
-# include <unixlib.h>
-# if HAVE_STRING_H - 0
-# include <string.h>
-# endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# define _(msgid) gettext (msgid)
-# else
-# define _(msgid) (msgid)
-# endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable POSIXLY_CORRECT disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg = NULL;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
- causes problems with re-calling getopt as programs generally don't
- know that. */
-
-int __getopt_initialized = 0;
-
-/* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters.
-
- PERMUTE is the default. We permute the contents of ARGV as we scan,
- so that eventually all the non-options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1.
- Using `-' as the first character of the list of option characters
- selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
-static enum
-{
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
-
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
- because there are many ways it can cause trouble.
- On some systems, it contains special magic macros that don't work
- in GCC. */
-# include <string.h>
-# define my_index strchr
-#else
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-#ifndef strncmp
-extern int strncmp ();
-#endif
-
-static char *
-my_index (str, chr)
- const char *str;
- int chr;
-{
- while (*str)
- {
- if (*str == chr)
- return (char *) str;
- str++;
- }
- return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments. */
-
-/* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
- is valid for the getopt call we must make sure that the ARGV passed
- to getopt is that one passed to the process. */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
- /* XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
- original_argc = argc;
- original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
- if (nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-#if defined __STDC__ && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
- char **argv;
-{
- int bottom = first_nonopt;
- int middle = last_nonopt;
- int top = optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#ifdef _LIBC
- /* First make sure the handling of the `__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- nonoption_flags_len = nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- nonoption_flags_max_len),
- '\0', top + 1 - nonoption_flags_max_len);
- nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-#if defined __STDC__ && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
-#ifdef _LIBC
- if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
- {
- if (nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = nonoption_flags_max_len = strlen (orig_str);
- if (nonoption_flags_max_len < argc)
- nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', nonoption_flags_max_len - len);
- }
- }
- nonoption_flags_len = nonoption_flags_max_len;
- }
- else
- nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct option *longopts;
- int *longind;
- int long_only;
-{
- optarg = NULL;
-
- if (optind == 0 || !__getopt_initialized)
- {
- if (optind == 0)
- optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring);
- __getopt_initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#ifdef _LIBC
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
- || (optind < nonoption_flags_len \
- && __getopt_nonoption_flags[optind] == '1'))
-#else
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
- if (nextchar == NULL || *nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (last_nonopt > optind)
- last_nonopt = optind;
- if (first_nonopt > optind)
- first_nonopt = optind;
-
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < argc && NONOPTION_P)
- optind++;
- last_nonopt = optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != argc && !strcmp (argv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = argc;
-
- optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (ordering == REQUIRE_ORDER)
- return -1;
- optarg = argv[optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- nextchar = (argv[optind] + 1
- + (longopts != NULL && argv[optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- {
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
-
- nextchar += strlen (nextchar);
-
- optopt = pfound->val;
- return '?';
- }
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[optind][1] == '-'
- || my_index (optstring, *nextchar) == NULL)
- {
- if (opterr)
- {
- if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
- else
- /* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
- }
- nextchar = (char *) "";
- optind++;
- optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *nextchar++;
- char *temp = my_index (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == '\0')
- ++optind;
-
- if (temp == NULL || c == ':')
- {
- if (opterr)
- {
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
- else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-
- nextchar += strlen (nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = NULL;
- nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
- nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0);
-}
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/gcc/getopt.h b/gcc/getopt.h
deleted file mode 100644
index fb30719a860..00000000000
--- a/gcc/getopt.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifndef _GETOPT_H
-#define _GETOPT_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-#if defined (__STDC__) && __STDC__
- const char *name;
-#else
- char *name;
-#endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
-extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- const struct option *longopts, int *longind);
-extern int getopt_long_only (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind,
- int long_only);
-#else /* not __STDC__ */
-extern int getopt ();
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* getopt.h */
diff --git a/gcc/getopt1.c b/gcc/getopt1.c
deleted file mode 100644
index ff257374c33..00000000000
--- a/gcc/getopt1.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
- Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "getopt.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/gcc/getpwd.c b/gcc/getpwd.c
index 6830c164acf..947383ef9a4 100644
--- a/gcc/getpwd.c
+++ b/gcc/getpwd.c
@@ -9,7 +9,6 @@
the few exceptions to the general rule here. */
#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)
-extern char *getwd ();
#define getcwd(buf,len) getwd(buf)
#ifdef MAXPATHLEN
#define GUESSPATHLEN (MAXPATHLEN + 1)
@@ -17,7 +16,6 @@ extern char *getwd ();
#define GUESSPATHLEN 100
#endif
#else /* (defined (USG) || defined (VMS)) */
-extern char *getcwd ();
/* We actually use this as a starting point, not a limit. */
#define GUESSPATHLEN 100
#endif /* (defined (USG) || defined (VMS)) */
diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h
index 24f3383198d..c9c61567cd8 100644
--- a/gcc/ginclude/stdarg.h
+++ b/gcc/ginclude/stdarg.h
@@ -59,6 +59,9 @@
#ifdef __v850__
#include "va-v850.h"
#else
+#if defined (_TMS320C4x) || defined (_TMS320C3x)
+#include <va-c4x.h>
+#else
/* Define __gnuc_va_list. */
@@ -115,6 +118,7 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#endif /* _STDARG_H */
+#endif /* not TMS320C3x or TMS320C4x */
#endif /* not v850 */
#endif /* not mn10200 */
#endif /* not mn10300 */
diff --git a/gcc/ginclude/va-alpha.h b/gcc/ginclude/va-alpha.h
index 2a4ba60b532..2528a712ada 100644
--- a/gcc/ginclude/va-alpha.h
+++ b/gcc/ginclude/va-alpha.h
@@ -10,7 +10,6 @@
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
-
/* In VMS, __gnuc_va_list is simply char *; on OSF, it's a structure. */
#ifdef __VMS__
@@ -23,16 +22,19 @@ typedef struct {
} __gnuc_va_list;
#endif
-#endif /* not __GNUC_VA_LIST */
+#endif /* __GNUC_VA_LIST */
/* If this is for internal libc use, don't define anything but
__gnuc_va_list. */
-#if defined (_STDARG_H) || defined (_VARARGS_H)
-#define va_list __gnuc_va_list
+#if !defined(__GNUC_VA_LIST_1) && (defined (_STDARG_H) || defined (_VARARGS_H))
+#define __GNUC_VA_LIST_1
+
#define _VA_LIST
#define _VA_LIST_
+typedef __gnuc_va_list va_list;
+
#if !defined(_STDARG_H)
/* varargs support */
@@ -63,8 +65,6 @@ typedef struct {
#endif /* _STDARG_H */
-#ifndef va_end
-
#define va_end(__va) ((void) 0)
/* Values returned by __builtin_classify_type. */
@@ -92,8 +92,6 @@ enum {
__lang_type_class
};
-#endif
-
/* Note that parameters are always aligned at least to a word boundary
(when passed) regardless of what GCC's __alignof__ operator says. */
@@ -127,5 +125,4 @@ enum {
/* Copy __gnuc_va_list into another variable of this type. */
#define __va_copy(dest, src) (dest) = (src)
-#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
-
+#endif /* __GNUC_VA_LIST_1 */
diff --git a/gcc/ginclude/va-clipper.h b/gcc/ginclude/va-clipper.h
index 38cc77f9c1a..213afca93f0 100644
--- a/gcc/ginclude/va-clipper.h
+++ b/gcc/ginclude/va-clipper.h
@@ -15,7 +15,7 @@ typedef struct
#if defined (_STDARG_H) || defined (_VARARGS_H)
-#define va_list __gnuc_va_list
+typedef __gnuc_va_list va_list;
#define __va_list __gnuc_va_list /* acc compatibility */
#define _VA_LIST
diff --git a/gcc/ginclude/va-ppc.h b/gcc/ginclude/va-ppc.h
index 5d87f38d910..736369dbe7d 100644
--- a/gcc/ginclude/va-ppc.h
+++ b/gcc/ginclude/va-ppc.h
@@ -158,9 +158,6 @@ __extension__ (*({ \
} \
else \
{ \
- if (__va_longlong_p(TYPE) && ((long)__va_overflow(AP) & 4) != 0) \
- __va_overflow(AP) += 4; \
- \
__ptr = (TYPE *) (void *) (__va_overflow(AP)); \
__va_overflow(AP) += __va_size (TYPE) * sizeof (long); \
} \
diff --git a/gcc/ginclude/varargs.h b/gcc/ginclude/varargs.h
index 410d06aac69..d1704079bda 100644
--- a/gcc/ginclude/varargs.h
+++ b/gcc/ginclude/varargs.h
@@ -57,6 +57,9 @@
#ifdef __v850__
#include "va-v850.h"
#else
+#if defined (_TMS320C4x) || defined (_TMS320C3x)
+#include <va-c4x.h>
+#else
#ifdef __NeXT__
@@ -132,6 +135,7 @@ typedef void *__gnuc_va_list;
/* Copy __gnuc_va_list into another variable of this type. */
#define __va_copy(dest, src) (dest) = (src)
+#endif /* not TMS320C3x or TMS320C4x */
#endif /* not v850 */
#endif /* not mn10200 */
#endif /* not mn10300 */
diff --git a/gcc/glimits.h b/gcc/glimits.h
index 0e3228bab62..559e712d726 100644
--- a/gcc/glimits.h
+++ b/gcc/glimits.h
@@ -64,7 +64,7 @@
/* Minimum and maximum values a `signed long int' can hold.
(Same as `int'). */
#ifndef __LONG_MAX__
-#if defined (__alpha__) || (defined (__sparc_v9__) && defined (__arch64__))
+#if defined (__alpha__) || defined (__sparc_v9__) || defined (__sparcv9)
#define __LONG_MAX__ 9223372036854775807L
#else
#define __LONG_MAX__ 2147483647L
diff --git a/gcc/global.c b/gcc/global.c
index be272e6bf2f..b133b893a97 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -22,13 +22,16 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "machmode.h"
+#include "hard-reg-set.h"
#include "rtl.h"
#include "flags.h"
#include "basic-block.h"
-#include "hard-reg-set.h"
#include "regs.h"
#include "insn-config.h"
+#include "reload.h"
#include "output.h"
+#include "toplev.h"
/* This pass of the compiler performs global register allocation.
It assigns hard register numbers to all the pseudo registers
@@ -43,8 +46,9 @@ Boston, MA 02111-1307, USA. */
reg for it. The reload pass is independent in other respects
and it is run even when stupid register allocation is in use.
- 1. count the pseudo-registers still needing allocation
- and assign allocation-numbers (allocnos) to them.
+ 1. Assign allocation-numbers (allocnos) to the pseudo-registers
+ still needing allocations and to the pseudo-registers currently
+ allocated by local-alloc which may be spilled by reload.
Set up tables reg_allocno and allocno_reg to map
reg numbers to allocnos and vice versa.
max_allocno gets the number of allocnos in use.
@@ -54,13 +58,13 @@ Boston, MA 02111-1307, USA. */
for conflicts between allocnos and explicit hard register use
(which includes use of pseudo-registers allocated by local_alloc).
- 3. for each basic block
+ 3. For each basic block
walk forward through the block, recording which
- unallocated registers and which hardware registers are live.
- Build the conflict matrix between the unallocated registers
- and another of unallocated registers versus hardware registers.
+ pseudo-registers and which hardware registers are live.
+ Build the conflict matrix between the pseudo-registers
+ and another of pseudo-registers versus hardware registers.
Also record the preferred hardware registers
- for each unallocated one.
+ for each pseudo-register.
4. Sort a table of the allocnos into order of
desirability of the variables.
@@ -68,15 +72,14 @@ Boston, MA 02111-1307, USA. */
5. Allocate the variables in that order; each if possible into
a preferred register, else into another register. */
-/* Number of pseudo-registers still requiring allocation
- (not allocated by local_allocate). */
+/* Number of pseudo-registers which are candidates for allocation. */
static int max_allocno;
/* Indexed by (pseudo) reg number, gives the allocno, or -1
- for pseudo registers already allocated by local_allocate. */
+ for pseudo registers which are not to be allocated. */
-int *reg_allocno;
+static int *reg_allocno;
/* Indexed by allocno, gives the reg number. */
@@ -266,6 +269,9 @@ static void mark_reg_death PROTO((rtx));
static void mark_reg_live_nc PROTO((int, enum machine_mode));
static void set_preference PROTO((rtx, rtx));
static void dump_conflicts PROTO((FILE *));
+static void reg_becomes_live PROTO((rtx, rtx));
+static void reg_dies PROTO((int, enum machine_mode));
+static void build_insn_chain PROTO((rtx));
/* Perform allocation of pseudo-registers not allocated by local_alloc.
FILE is a file to output debugging information on,
@@ -387,13 +393,13 @@ global_alloc (file)
/* Note that reg_live_length[i] < 0 indicates a "constant" reg
that we are supposed to refrain from putting in a hard reg.
-2 means do make an allocno but don't allocate it. */
- if (REG_N_REFS (i) != 0 && reg_renumber[i] < 0 && REG_LIVE_LENGTH (i) != -1
+ if (REG_N_REFS (i) != 0 && REG_LIVE_LENGTH (i) != -1
/* Don't allocate pseudos that cross calls,
if this function receives a nonlocal goto. */
&& (! current_function_has_nonlocal_label
|| REG_N_CALLS_CROSSED (i) == 0))
{
- if (reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
+ if (reg_renumber[i] < 0 && reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
reg_allocno[i] = reg_allocno[reg_may_share[i]];
else
reg_allocno[i] = max_allocno++;
@@ -431,7 +437,7 @@ global_alloc (file)
bzero ((char *) local_reg_live_length, sizeof local_reg_live_length);
bzero ((char *) local_reg_n_refs, sizeof local_reg_n_refs);
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
- if (reg_allocno[i] < 0 && reg_renumber[i] >= 0)
+ if (reg_renumber[i] >= 0)
{
int regno = reg_renumber[i];
int endregno = regno + HARD_REGNO_NREGS (regno, PSEUDO_REGNO_MODE (i));
@@ -448,18 +454,6 @@ global_alloc (file)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (regs_ever_live[i])
local_reg_n_refs[i] = 0;
-
- /* Likewise for regs used in a SCRATCH. */
- for (i = 0; i < scratch_list_length; i++)
- if (scratch_list[i])
- {
- int regno = REGNO (scratch_list[i]);
- int lim = regno + HARD_REGNO_NREGS (regno, GET_MODE (scratch_list[i]));
- int j;
-
- for (j = regno; j < lim; j++)
- local_reg_n_refs[j] = 0;
- }
/* Allocate the space for the conflict and preference tables and
initialize them. */
@@ -557,7 +551,8 @@ global_alloc (file)
except for parameters marked with reg_live_length[regno] == -2. */
for (i = 0; i < max_allocno; i++)
- if (REG_LIVE_LENGTH (allocno_reg[allocno_order[i]]) >= 0)
+ if (reg_renumber[allocno_reg[allocno_order[i]]] < 0
+ && REG_LIVE_LENGTH (allocno_reg[allocno_order[i]]) >= 0)
{
/* If we have more than one register class,
first try allocating in the class that is cheapest
@@ -580,7 +575,10 @@ global_alloc (file)
for the sake of debugging information. */
if (n_basic_blocks > 0)
#endif
- retval = reload (get_insns (), 1, file);
+ {
+ build_insn_chain (get_insns ());
+ retval = reload (get_insns (), 1, file);
+ }
free (conflicts);
return retval;
@@ -971,7 +969,10 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
int regno = i;
#endif
if (! TEST_HARD_REG_BIT (used, regno)
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (allocno_calls_crossed[allocno] == 0
+ || accept_call_clobbered
+ || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
{
register int j;
register int lim = regno + HARD_REGNO_NREGS (regno, mode);
@@ -1320,16 +1321,13 @@ record_conflicts (allocno_vec, len)
if so, we do nothing.
SETTER is 0 if this register was modified by an auto-increment (i.e.,
- a REG_INC note was found for it).
-
- CLOBBERs are processed here by calling mark_reg_clobber. */
+ a REG_INC note was found for it). */
static void
-mark_reg_store (orig_reg, setter)
- rtx orig_reg, setter;
+mark_reg_store (reg, setter)
+ rtx reg, setter;
{
register int regno;
- register rtx reg = orig_reg;
/* WORD is which word of a multi-register group is being stored.
For the case where the store is actually into a SUBREG of REG.
@@ -1346,23 +1344,13 @@ mark_reg_store (orig_reg, setter)
if (GET_CODE (reg) != REG)
return;
- if (setter && GET_CODE (setter) == CLOBBER)
- {
- /* A clobber of a register should be processed here too. */
- mark_reg_clobber (orig_reg, setter);
- return;
- }
-
regs_set[n_regs_set++] = reg;
- if (setter)
+ if (setter && GET_CODE (setter) != CLOBBER)
set_preference (reg, SET_SRC (setter));
regno = REGNO (reg);
- if (reg_renumber[regno] >= 0)
- regno = reg_renumber[regno] /* + word */;
-
/* Either this is one of the max_allocno pseudo regs not allocated,
or it is or has a hardware reg. First handle the pseudo-regs. */
if (regno >= FIRST_PSEUDO_REGISTER)
@@ -1373,8 +1361,12 @@ mark_reg_store (orig_reg, setter)
record_one_conflict (regno);
}
}
+
+ if (reg_renumber[regno] >= 0)
+ regno = reg_renumber[regno] /* + word */;
+
/* Handle hardware regs (and pseudos allocated to hard regs). */
- else if (! fixed_regs[regno])
+ if (regno < FIRST_PSEUDO_REGISTER && ! fixed_regs[regno])
{
register int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
while (regno < last)
@@ -1392,54 +1384,8 @@ static void
mark_reg_clobber (reg, setter)
rtx reg, setter;
{
- register int regno;
-
- /* WORD is which word of a multi-register group is being stored.
- For the case where the store is actually into a SUBREG of REG.
- Except we don't use it; I believe the entire REG needs to be
- made live. */
- int word = 0;
-
- if (GET_CODE (setter) != CLOBBER)
- return;
-
- if (GET_CODE (reg) == SUBREG)
- {
- word = SUBREG_WORD (reg);
- reg = SUBREG_REG (reg);
- }
-
- if (GET_CODE (reg) != REG)
- return;
-
- regs_set[n_regs_set++] = reg;
-
- regno = REGNO (reg);
-
- if (reg_renumber[regno] >= 0)
- regno = reg_renumber[regno] /* + word */;
-
- /* Either this is one of the max_allocno pseudo regs not allocated,
- or it is or has a hardware reg. First handle the pseudo-regs. */
- if (regno >= FIRST_PSEUDO_REGISTER)
- {
- if (reg_allocno[regno] >= 0)
- {
- SET_ALLOCNO_LIVE (reg_allocno[regno]);
- record_one_conflict (regno);
- }
- }
- /* Handle hardware regs (and pseudos allocated to hard regs). */
- else if (! fixed_regs[regno])
- {
- register int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (regno < last)
- {
- record_one_conflict (regno);
- SET_HARD_REG_BIT (hard_regs_live, regno);
- regno++;
- }
- }
+ if (GET_CODE (setter) == CLOBBER)
+ mark_reg_store (reg, setter);
}
/* Record that REG has conflicts with all the regs currently live.
@@ -1459,9 +1405,6 @@ mark_reg_conflicts (reg)
regno = REGNO (reg);
- if (reg_renumber[regno] >= 0)
- regno = reg_renumber[regno];
-
/* Either this is one of the max_allocno pseudo regs not allocated,
or it is or has a hardware reg. First handle the pseudo-regs. */
if (regno >= FIRST_PSEUDO_REGISTER)
@@ -1469,8 +1412,12 @@ mark_reg_conflicts (reg)
if (reg_allocno[regno] >= 0)
record_one_conflict (regno);
}
+
+ if (reg_renumber[regno] >= 0)
+ regno = reg_renumber[regno];
+
/* Handle hardware regs (and pseudos allocated to hard regs). */
- else if (! fixed_regs[regno])
+ if (regno < FIRST_PSEUDO_REGISTER && ! fixed_regs[regno])
{
register int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
while (regno < last)
@@ -1490,10 +1437,6 @@ mark_reg_death (reg)
{
register int regno = REGNO (reg);
- /* For pseudo reg, see if it has been assigned a hardware reg. */
- if (reg_renumber[regno] >= 0)
- regno = reg_renumber[regno];
-
/* Either this is one of the max_allocno pseudo regs not allocated,
or it is a hardware reg. First handle the pseudo-regs. */
if (regno >= FIRST_PSEUDO_REGISTER)
@@ -1501,8 +1444,13 @@ mark_reg_death (reg)
if (reg_allocno[regno] >= 0)
CLEAR_ALLOCNO_LIVE (reg_allocno[regno]);
}
+
+ /* For pseudo reg, see if it has been assigned a hardware reg. */
+ if (reg_renumber[regno] >= 0)
+ regno = reg_renumber[regno];
+
/* Handle hardware regs (and pseudos allocated to hard regs). */
- else if (! fixed_regs[regno])
+ if (regno < FIRST_PSEUDO_REGISTER && ! fixed_regs[regno])
{
/* Pseudo regs already assigned hardware regs are treated
almost the same as explicit hardware regs. */
@@ -1648,6 +1596,135 @@ mark_elimination (from, to)
}
}
+/* Used for communication between the following functions. Holds the
+ current life information. */
+static regset live_relevant_regs;
+
+/* Record in live_relevant_regs that register REG became live. This
+ is called via note_stores. */
+static void
+reg_becomes_live (reg, setter)
+ rtx reg;
+ rtx setter ATTRIBUTE_UNUSED;
+{
+ int regno;
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+
+ if (GET_CODE (reg) != REG)
+ return;
+
+ regno = REGNO (reg);
+ if (regno < FIRST_PSEUDO_REGISTER)
+ {
+ int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
+ while (nregs-- > 0)
+ SET_REGNO_REG_SET (live_relevant_regs, regno++);
+ }
+ else if (reg_renumber[regno] >= 0)
+ SET_REGNO_REG_SET (live_relevant_regs, regno);
+}
+
+/* Record in live_relevant_regs that register REGNO died. */
+static void
+reg_dies (regno, mode)
+ int regno;
+ enum machine_mode mode;
+{
+ if (regno < FIRST_PSEUDO_REGISTER)
+ {
+ int nregs = HARD_REGNO_NREGS (regno, mode);
+ while (nregs-- > 0)
+ CLEAR_REGNO_REG_SET (live_relevant_regs, regno++);
+ }
+ else
+ CLEAR_REGNO_REG_SET (live_relevant_regs, regno);
+}
+
+/* Walk the insns of the current function and build reload_insn_chain,
+ and record register life information. */
+static void
+build_insn_chain (first)
+ rtx first;
+{
+ struct insn_chain **p = &reload_insn_chain;
+ struct insn_chain *prev = 0;
+ int b = 0;
+
+ live_relevant_regs = ALLOCA_REG_SET ();
+
+ for (; first; first = NEXT_INSN (first))
+ {
+ struct insn_chain *c;
+
+ if (first == basic_block_head[b])
+ {
+ int i;
+ CLEAR_REG_SET (live_relevant_regs);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (REGNO_REG_SET_P (basic_block_live_at_start[b], i)
+ && ! TEST_HARD_REG_BIT (eliminable_regset, i))
+ SET_REGNO_REG_SET (live_relevant_regs, i);
+
+ for (; i < max_regno; i++)
+ if (reg_renumber[i] >= 0
+ && REGNO_REG_SET_P (basic_block_live_at_start[b], i))
+ SET_REGNO_REG_SET (live_relevant_regs, i);
+ }
+
+ if (GET_CODE (first) != NOTE && GET_CODE (first) != BARRIER)
+ {
+ c = new_insn_chain ();
+ c->prev = prev;
+ prev = c;
+ *p = c;
+ p = &c->next;
+ c->insn = first;
+ c->block = b;
+
+ COPY_REG_SET (c->live_before, live_relevant_regs);
+
+ if (GET_RTX_CLASS (GET_CODE (first)) == 'i')
+ {
+ rtx link;
+
+ /* Mark the death of everything that dies in this instruction. */
+
+ for (link = REG_NOTES (first); link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_DEAD
+ && GET_CODE (XEXP (link, 0)) == REG)
+ reg_dies (REGNO (XEXP (link, 0)), GET_MODE (XEXP (link, 0)));
+
+ /* Mark everything born in this instruction as live. */
+
+ note_stores (PATTERN (first), reg_becomes_live);
+ }
+
+ /* Remember which registers are live at the end of the insn, before
+ killing those with REG_UNUSED notes. */
+ COPY_REG_SET (c->live_after, live_relevant_regs);
+
+ if (GET_RTX_CLASS (GET_CODE (first)) == 'i')
+ {
+ rtx link;
+
+ /* Mark anything that is set in this insn and then unused as dying. */
+
+ for (link = REG_NOTES (first); link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_UNUSED
+ && GET_CODE (XEXP (link, 0)) == REG)
+ reg_dies (REGNO (XEXP (link, 0)), GET_MODE (XEXP (link, 0)));
+ }
+ }
+
+ if (first == basic_block_end[b])
+ b++;
+ }
+ FREE_REG_SET (live_relevant_regs);
+ *p = 0;
+}
+
/* Print debugging trace information if -greg switch is given,
showing the information on which the allocation decisions are based. */
@@ -1657,10 +1734,20 @@ dump_conflicts (file)
{
register int i;
register int has_preferences;
- fprintf (file, ";; %d regs to allocate:", max_allocno);
+ register int nregs;
+ nregs = 0;
+ for (i = 0; i < max_allocno; i++)
+ {
+ if (reg_renumber[allocno_reg[allocno_order[i]]] >= 0)
+ continue;
+ nregs++;
+ }
+ fprintf (file, ";; %d regs to allocate:", nregs);
for (i = 0; i < max_allocno; i++)
{
int j;
+ if (reg_renumber[allocno_reg[allocno_order[i]]] >= 0)
+ continue;
fprintf (file, " %d", allocno_reg[allocno_order[i]]);
for (j = 0; j < max_regno; j++)
if (reg_allocno[j] == allocno_order[i]
diff --git a/gcc/gthr.h b/gcc/gthr.h
index d1028cb58e9..7511e35a7ab 100644
--- a/gcc/gthr.h
+++ b/gcc/gthr.h
@@ -1,6 +1,6 @@
/* Threads compatibily routines for libgcc2. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -48,6 +48,12 @@ Boston, MA 02111-1307, USA. */
__GTHREAD_MUTEX_INIT
to initialize __gthread_mutex_t to get a fast
non-recursive mutex.
+ __GTHREAD_MUTEX_INIT_FUNCTION
+ some systems can't initalize a mutex without a
+ function call. On such systems, define this to a
+ function which looks like this:
+ void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
+ Don't define __GTHREAD_MUTEX_INIT in this case
The threads interface must define the following static functions:
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index c32f3f5a8d9..5274f01be66 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -87,7 +87,8 @@
broken by
6. choose insn with the least dependences upon the previously
scheduled insn, or finally
- 7. choose insn with lowest UID.
+ 7 choose the insn which has the most insns dependent on it.
+ 8. choose insn with lowest UID.
Memory references complicate matters. Only if we can be certain
that memory references are not part of the data dependency graph
@@ -164,6 +165,7 @@
#include "insn-config.h"
#include "insn-attr.h"
#include "except.h"
+#include "toplev.h"
extern char *reg_known_equiv_p;
extern rtx *reg_known_value;
@@ -451,9 +453,9 @@ static void new_insn_dead_notes PROTO ((rtx, rtx, rtx, rtx));
static void update_n_sets PROTO ((rtx, int));
static void update_flow_info PROTO ((rtx, rtx, rtx, rtx));
static char *safe_concat PROTO ((char *, char *, char *));
-
-/* Main entry point of this file. */
-void schedule_insns PROTO ((FILE *));
+static int insn_issue_delay PROTO ((rtx));
+static int birthing_insn_p PROTO ((rtx));
+static void adjust_priority PROTO ((rtx));
/* Mapping of insns to their original block prior to scheduling. */
static int *insn_orig_block;
@@ -741,11 +743,11 @@ static void find_post_sched_live PROTO ((int));
static void update_reg_usage PROTO ((void));
static int queue_to_ready PROTO ((rtx [], int));
-void debug_ready_list PROTO ((rtx[], int));
-static void init_target_units PROTO (());
+static void debug_ready_list PROTO ((rtx[], int));
+static void init_target_units PROTO ((void));
static void insn_print_units PROTO ((rtx));
-static int get_visual_tbl_length PROTO (());
-static void init_block_visualization PROTO (());
+static int get_visual_tbl_length PROTO ((void));
+static void init_block_visualization PROTO ((void));
static void print_block_visualization PROTO ((int, char *));
static void visualize_scheduled_insns PROTO ((int, int));
static void visualize_no_unit PROTO ((rtx));
@@ -830,10 +832,10 @@ alloc_EXPR_LIST (kind, val, next)
{
rtx r;
- if (unused_insn_list)
+ if (unused_expr_list)
{
- r = unused_insn_list;
- unused_insn_list = XEXP (r, 1);
+ r = unused_expr_list;
+ unused_expr_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
PUT_REG_NOTE_KIND (r, kind);
@@ -971,6 +973,10 @@ schedule_insns (dump_file)
#define __inline
#endif
+#ifndef HAIFA_INLINE
+#define HAIFA_INLINE __inline
+#endif
+
/* Computation of memory dependencies. */
/* The *_insns and *_mems are paired lists. Each pending memory operation
@@ -1463,7 +1469,7 @@ find_rgns (s_preds, s_succs, num_preds, num_succs, dom)
{
int *max_hdr, *dfs_nr, *stack, *queue, *degree;
char no_loops = 1;
- int node, child, loop_head, i, j, head, tail;
+ int node, child, loop_head, i, head, tail;
int count = 0, sp, idx = 0, current_edge = out_edges[0];
int num_bbs, num_insns, unreachable;
int too_large_failure;
@@ -2107,6 +2113,16 @@ check_live_1 (src, x)
|| GET_CODE (reg) == STRICT_LOW_PART)
reg = XEXP (reg, 0);
+ if (GET_CODE (reg) == PARALLEL
+ && GET_MODE (reg) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (reg, 0) - 1; i >= 0; i--)
+ if (check_live_1 (src, XVECEXP (reg, 0, i)))
+ return 1;
+ return 0;
+ }
+
if (GET_CODE (reg) != REG)
return 1;
@@ -2175,6 +2191,15 @@ update_live_1 (src, x)
|| GET_CODE (reg) == STRICT_LOW_PART)
reg = XEXP (reg, 0);
+ if (GET_CODE (reg) == PARALLEL
+ && GET_MODE (reg) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (reg, 0) - 1; i >= 0; i--)
+ update_live_1 (src, XVECEXP (reg, 0, i));
+ return;
+ }
+
if (GET_CODE (reg) != REG)
return;
@@ -2619,6 +2644,10 @@ haifa_classify_insn (insn)
tmp_class =
WORST_CLASS (tmp_class,
may_trap_exp (SET_SRC (XVECEXP (pat, 0, i)), 0));
+ break;
+ case TRAP_IF:
+ tmp_class = TRAP_RISKY;
+ break;
default:;
}
insn_class = WORST_CLASS (insn_class, tmp_class);
@@ -2644,6 +2673,10 @@ haifa_classify_insn (insn)
tmp_class =
WORST_CLASS (tmp_class,
may_trap_exp (SET_SRC (pat), 0));
+ break;
+ case TRAP_IF:
+ tmp_class = TRAP_RISKY;
+ break;
default:;
}
insn_class = tmp_class;
@@ -2736,7 +2769,7 @@ is_exception_free (insn, bb_src, bb_trg)
/* Return the INSN_LIST containing INSN in LIST, or NULL
if LIST does not contain INSN. */
-__inline static rtx
+HAIFA_INLINE static rtx
find_insn_list (insn, list)
rtx insn;
rtx list;
@@ -2753,7 +2786,7 @@ find_insn_list (insn, list)
/* Return 1 if the pair (insn, x) is found in (LIST, LIST1), or 0 otherwise. */
-__inline static char
+HAIFA_INLINE static char
find_insn_mem_list (insn, x, list, list1)
rtx insn, x;
rtx list, list1;
@@ -2776,7 +2809,7 @@ find_insn_mem_list (insn, x, list, list1)
mask if the value is negative. A function unit index is the
non-negative encoding. */
-__inline static int
+HAIFA_INLINE static int
insn_unit (insn)
rtx insn;
{
@@ -2813,7 +2846,7 @@ insn_unit (insn)
These values are encoded in an int where the upper half gives the
minimum value and the lower half gives the maximum value. */
-__inline static unsigned int
+HAIFA_INLINE static unsigned int
blockage_range (unit, insn)
int unit;
rtx insn;
@@ -2860,7 +2893,7 @@ clear_units ()
/* Return the issue-delay of an insn */
-__inline static int
+HAIFA_INLINE static int
insn_issue_delay (insn)
rtx insn;
{
@@ -2890,7 +2923,7 @@ insn_issue_delay (insn)
instance INSTANCE at time CLOCK if the previous actual hazard cost
was COST. */
-__inline static int
+HAIFA_INLINE static int
actual_hazard_this_instance (unit, instance, insn, clock, cost)
int unit, instance, clock, cost;
rtx insn;
@@ -2927,7 +2960,7 @@ actual_hazard_this_instance (unit, instance, insn, clock, cost)
/* Record INSN as having begun execution on the units encoded by UNIT at
time CLOCK. */
-__inline static void
+HAIFA_INLINE static void
schedule_unit (unit, insn, clock)
int unit, clock;
rtx insn;
@@ -2959,7 +2992,7 @@ schedule_unit (unit, insn, clock)
/* Return the actual hazard cost of executing INSN on the units encoded by
UNIT at time CLOCK if the previous actual hazard cost was COST. */
-__inline static int
+HAIFA_INLINE static int
actual_hazard (unit, insn, clock, cost)
int unit, clock, cost;
rtx insn;
@@ -3008,7 +3041,7 @@ actual_hazard (unit, insn, clock, cost)
to be used is chosen in preference to one with a unit that is less
used. We are trying to minimize a subsequent actual hazard. */
-__inline static int
+HAIFA_INLINE static int
potential_hazard (unit, insn, cost)
int unit, cost;
rtx insn;
@@ -3053,7 +3086,7 @@ potential_hazard (unit, insn, cost)
This is the number of cycles between instruction issue and
instruction results. */
-__inline static int
+HAIFA_INLINE static int
insn_cost (insn, link, used)
rtx insn, link, used;
{
@@ -3270,6 +3303,17 @@ sched_analyze_1 (x, insn)
if (dest == 0)
return;
+ if (GET_CODE (dest) == PARALLEL
+ && GET_MODE (dest) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
+ sched_analyze_1 (XVECEXP (dest, 0, i), insn);
+ if (GET_CODE (x) == SET)
+ sched_analyze_2 (SET_SRC (x), insn);
+ return;
+ }
+
while (GET_CODE (dest) == STRICT_LOW_PART || GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
{
@@ -3550,10 +3594,14 @@ sched_analyze_2 (x, insn)
return;
}
+ /* Force pending stores to memory in case a trap handler needs them. */
+ case TRAP_IF:
+ flush_pending_lists (insn, 1);
+ break;
+
case ASM_OPERANDS:
case ASM_INPUT:
case UNSPEC_VOLATILE:
- case TRAP_IF:
{
rtx u;
@@ -3665,36 +3713,54 @@ sched_analyze_insn (x, insn, loop_notes)
sched_analyze_2 (XEXP (link, 0), insn);
}
- /* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic block, then
- we must be sure that no instructions are scheduled across it.
+ /* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic
+ block, then we must be sure that no instructions are scheduled across it.
Otherwise, the reg_n_refs info (which depends on loop_depth) would
become incorrect. */
if (loop_notes)
{
int max_reg = max_reg_num ();
+ int schedule_barrier_found = 0;
rtx link;
- for (i = 0; i < max_reg; i++)
+ /* Update loop_notes with any notes from this insn. Also determine
+ if any of the notes on the list correspond to instruction scheduling
+ barriers (loop, eh & setjmp notes, but not range notes. */
+ link = loop_notes;
+ while (XEXP (link, 1))
{
- rtx u;
- for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[i] = 0;
+ if (INTVAL (XEXP (link, 0)) == NOTE_INSN_LOOP_BEG
+ || INTVAL (XEXP (link, 0)) == NOTE_INSN_LOOP_END
+ || INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_BEG
+ || INTVAL (XEXP (link, 0)) == NOTE_INSN_EH_REGION_END
+ || INTVAL (XEXP (link, 0)) == NOTE_INSN_SETJMP)
+ schedule_barrier_found = 1;
- /* reg_last_sets[r] is now a list of insns */
- for (u = reg_last_sets[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), 0);
+ link = XEXP (link, 1);
}
- reg_pending_sets_all = 1;
-
- flush_pending_lists (insn, 0);
-
- link = loop_notes;
- while (XEXP (link, 1))
- link = XEXP (link, 1);
XEXP (link, 1) = REG_NOTES (insn);
REG_NOTES (insn) = loop_notes;
+
+ /* Add dependencies if a scheduling barrier was found. */
+ if (schedule_barrier_found)
+ {
+ for (i = 0; i < max_reg; i++)
+ {
+ rtx u;
+ for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ reg_last_uses[i] = 0;
+
+ /* reg_last_sets[r] is now a list of insns */
+ for (u = reg_last_sets[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), 0);
+ }
+ reg_pending_sets_all = 1;
+
+ flush_pending_lists (insn, 0);
+ }
+
}
/* After reload, it is possible for an instruction to have a REG_DEAD note
@@ -3791,6 +3857,10 @@ sched_analyze (head, tail)
{
if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
{
+ /* Make each JUMP_INSN a scheduling barrier for memory references. */
+ if (GET_CODE (insn) == JUMP_INSN)
+ last_pending_memory_flush
+ = alloc_INSN_LIST (insn, last_pending_memory_flush);
sched_analyze_insn (PATTERN (insn), insn, loop_notes);
loop_notes = 0;
}
@@ -3886,6 +3956,18 @@ sched_analyze (head, tail)
}
/* See comments on reemit_notes as to why we do this. */
+ /* ??? Actually, the reemit_notes just say what is done, not why. */
+
+ else if (GET_CODE (insn) == NOTE
+ && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_RANGE_START
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_RANGE_END))
+ {
+ loop_notes = alloc_EXPR_LIST (REG_DEAD, NOTE_RANGE_INFO (insn),
+ loop_notes);
+ loop_notes = alloc_EXPR_LIST (REG_DEAD,
+ GEN_INT (NOTE_LINE_NUMBER (insn)),
+ loop_notes);
+ }
else if (GET_CODE (insn) == NOTE
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
@@ -3926,6 +4008,15 @@ sched_note_set (x, death)
if (reg == 0)
return;
+ if (GET_CODE (reg) == PARALLEL
+ && GET_MODE (reg) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (reg, 0) - 1; i >= 0; i--)
+ sched_note_set (XVECEXP (reg, 0, i), death);
+ return;
+ }
+
while (GET_CODE (reg) == SUBREG || GET_CODE (reg) == STRICT_LOW_PART
|| GET_CODE (reg) == SIGN_EXTRACT || GET_CODE (reg) == ZERO_EXTRACT)
{
@@ -4018,7 +4109,7 @@ rank_for_schedule (x, y)
rtx tmp = *(rtx *)y;
rtx tmp2 = *(rtx *)x;
rtx link;
- int tmp_class, tmp2_class;
+ int tmp_class, tmp2_class, depend_count1, depend_count2;
int val, priority_val, spec_val, prob_val, weight_val;
@@ -4079,6 +4170,21 @@ rank_for_schedule (x, y)
return val;
}
+ /* Prefer the insn which has more later insns that depend on it.
+ This gives the scheduler more freedom when scheduling later
+ instructions at the expense of added register pressure. */
+ depend_count1 = 0;
+ for (link = INSN_DEPEND (tmp); link; link = XEXP (link, 1))
+ depend_count1++;
+
+ depend_count2 = 0;
+ for (link = INSN_DEPEND (tmp2); link; link = XEXP (link, 1))
+ depend_count2++;
+
+ val = depend_count2 - depend_count1;
+ if (val)
+ return val;
+
/* If insns are equally good, sort by INSN_LUID (original insn order),
so that we make the sort stable. This minimizes instruction movement,
thus minimizing sched's effect on debugging and cross-jumping. */
@@ -4087,7 +4193,7 @@ rank_for_schedule (x, y)
/* Resort the array A in which only element at index N may be out of order. */
-__inline static void
+HAIFA_INLINE static void
swap_sort (a, n)
rtx *a;
int n;
@@ -4109,7 +4215,7 @@ static int max_priority;
N_CYCLES after the currently executing insn. Preserve insns
chain for debugging purposes. */
-__inline static void
+HAIFA_INLINE static void
queue_insn (insn, n_cycles)
rtx insn;
int n_cycles;
@@ -4134,7 +4240,7 @@ queue_insn (insn, n_cycles)
/* Return nonzero if PAT is the pattern of an insn which makes a
register live. */
-__inline static int
+HAIFA_INLINE static int
birthing_insn_p (pat)
rtx pat;
{
@@ -4144,18 +4250,31 @@ birthing_insn_p (pat)
return 0;
if (GET_CODE (pat) == SET
- && GET_CODE (SET_DEST (pat)) == REG)
+ && (GET_CODE (SET_DEST (pat)) == REG
+ || (GET_CODE (SET_DEST (pat)) == PARALLEL
+ && GET_MODE (SET_DEST (pat)) == BLKmode)))
{
rtx dest = SET_DEST (pat);
- int i = REGNO (dest);
+ int i;
/* It would be more accurate to use refers_to_regno_p or
- reg_mentioned_p to determine when the dest is not live before this
- insn. */
-
- if (REGNO_REG_SET_P (bb_live_regs, i))
- return (REG_N_SETS (i) == 1);
-
+ reg_mentioned_p to determine when the dest is not live before this
+ insn. */
+ if (GET_CODE (dest) == REG)
+ {
+ i = REGNO (dest);
+ if (REGNO_REG_SET_P (bb_live_regs, i))
+ return (REG_N_SETS (i) == 1);
+ }
+ else
+ {
+ for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
+ {
+ int regno = REGNO (SET_DEST (XVECEXP (dest, 0, i)));
+ if (REGNO_REG_SET_P (bb_live_regs, regno))
+ return (REG_N_SETS (regno) == 1);
+ }
+ }
return 0;
}
if (GET_CODE (pat) == PARALLEL)
@@ -4170,7 +4289,7 @@ birthing_insn_p (pat)
/* PREV is an insn that is ready to execute. Adjust its priority if that
will help shorten register lifetimes. */
-__inline static void
+HAIFA_INLINE static void
adjust_priority (prev)
rtx prev;
{
@@ -4218,6 +4337,9 @@ adjust_priority (prev)
}
}
+/* Clock at which the previous instruction was issued. */
+static int last_clock_var;
+
/* INSN is the "currently executing insn". Launch each insn which was
waiting on INSN. READY is a vector of insns which are ready to fire.
N_READY is the number of elements in READY. CLOCK is the current
@@ -4302,6 +4424,17 @@ schedule_insn (insn, ready, n_ready, clock)
}
}
+ /* Annotate the instruction with issue information -- TImode
+ indicates that the instruction is expected not to be able
+ to issue on the same cycle as the previous insn. A machine
+ may use this information to decide how the instruction should
+ be aligned. */
+ if (reload_completed && issue_rate > 1)
+ {
+ PUT_MODE (insn, clock > last_clock_var ? TImode : VOIDmode);
+ last_clock_var = clock;
+ }
+
return n_ready;
}
@@ -4553,6 +4686,16 @@ attach_deaths (x, insn, set_p)
attach_deaths (XEXP (x, 2), insn, 0);
return;
+ case PARALLEL:
+ if (set_p
+ && GET_MODE (x) == BLKmode)
+ {
+ for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ attach_deaths (SET_DEST (XVECEXP (x, 0, i)), insn, 1);
+ return;
+ }
+
+ /* fallthrough */
default:
/* Other cases: walk the insn. */
fmt = GET_RTX_FORMAT (code);
@@ -4648,6 +4791,8 @@ unlink_other_notes (insn, tail)
if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_SETJMP
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_START
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END)
{
@@ -4697,7 +4842,7 @@ unlink_line_notes (insn, tail)
/* Return the head and tail pointers of BB. */
-__inline static void
+HAIFA_INLINE static void
get_block_head_tail (bb, headp, tailp)
int bb;
rtx *headp;
@@ -5486,7 +5631,7 @@ queue_to_ready (ready, n_ready)
/* Print the ready list for debugging purposes. Callable from debugger. */
-extern void
+static void
debug_ready_list (ready, n_ready)
rtx ready[];
int n_ready;
@@ -6235,36 +6380,6 @@ print_insn (buf, x, verbose)
}
} /* print_insn */
-void
-print_insn_chain (rtx_first)
- rtx rtx_first;
-{
- register rtx tmp_rtx;
- char str[BUF_LEN];
-
- strcpy (str, "(nil)\n");
- if (rtx_first != 0)
- switch (GET_CODE (rtx_first))
- {
- case INSN:
- case JUMP_INSN:
- case CALL_INSN:
- case NOTE:
- case CODE_LABEL:
- case BARRIER:
- for (tmp_rtx = rtx_first; tmp_rtx != NULL;
- tmp_rtx = NEXT_INSN (tmp_rtx))
- {
- print_insn (str, tmp_rtx, 0);
- printf ("%s\n", str);
- }
- break;
- default:
- print_insn (str, rtx_first, 0);
- printf ("%s\n", str);
- }
-} /* print_insn_chain */
-
/* Print visualization debugging info */
static void
@@ -6414,13 +6529,22 @@ reemit_notes (insn, last)
if (REG_NOTE_KIND (note) == REG_DEAD
&& GET_CODE (XEXP (note, 0)) == CONST_INT)
{
- if (INTVAL (XEXP (note, 0)) == NOTE_INSN_SETJMP)
+ int note_type = INTVAL (XEXP (note, 0));
+ if (note_type == NOTE_INSN_SETJMP)
{
- retval = emit_note_after (INTVAL (XEXP (note, 0)), insn);
+ retval = emit_note_after (NOTE_INSN_SETJMP, insn);
CONST_CALL_P (retval) = CONST_CALL_P (note);
remove_note (insn, note);
note = XEXP (note, 1);
}
+ else if (note_type == NOTE_INSN_RANGE_START
+ || note_type == NOTE_INSN_RANGE_END)
+ {
+ last = emit_note_before (note_type, last);
+ remove_note (insn, note);
+ note = XEXP (note, 1);
+ NOTE_RANGE_INFO (last) = XEXP (note, 0);
+ }
else
{
last = emit_note_before (INTVAL (XEXP (note, 0)), last);
@@ -6683,15 +6807,22 @@ schedule_block (bb, rgn_n_insns)
}
}
+#ifdef MD_SCHED_INIT
+ MD_SCHED_INIT (dump, sched_verbose);
+#endif
+
/* no insns scheduled in this block yet */
last_scheduled_insn = 0;
/* Sort the ready list */
SCHED_SORT (ready, n_ready);
+#ifdef MD_SCHED_REORDER
+ MD_SCHED_REORDER (dump, sched_verbose, ready, n_ready);
+#endif
if (sched_verbose >= 2)
{
- fprintf (dump, ";;\t\tReady list initially: ");
+ fprintf (dump, ";;\t\tReady list initially: ");
debug_ready_list (ready, n_ready);
}
@@ -6699,6 +6830,7 @@ schedule_block (bb, rgn_n_insns)
q_ptr = 0;
q_size = 0;
clock_var = 0;
+ last_clock_var = 0;
bzero ((char *) insn_queue, sizeof (insn_queue));
/* We start inserting insns after PREV_HEAD. */
@@ -6734,10 +6866,13 @@ schedule_block (bb, rgn_n_insns)
/* Sort the ready list. */
SCHED_SORT (ready, n_ready);
+#ifdef MD_SCHED_REORDER
+ MD_SCHED_REORDER (dump, sched_verbose, ready, n_ready);
+#endif
if (sched_verbose)
{
- fprintf (dump, ";;\tReady list (t =%3d): ", clock_var);
+ fprintf (dump, "\n;;\tReady list (t =%3d): ", clock_var);
debug_ready_list (ready, n_ready);
}
@@ -6823,7 +6958,11 @@ schedule_block (bb, rgn_n_insns)
last = move_insn (insn, last);
sched_n_insns++;
+#ifdef MD_SCHED_VARIABLE_ISSUE
+ MD_SCHED_VARIABLE_ISSUE (dump, sched_verbose, insn, can_issue_more);
+#else
can_issue_more--;
+#endif
n_ready = schedule_insn (insn, ready, n_ready, clock_var);
@@ -7967,7 +8106,7 @@ update_flow_info (notes, first, last, orig_insn)
break;
/* Likewise for multi-word memory references. */
if (GET_CODE (orig_dest) == MEM
- && SIZE_FOR_MODE (orig_dest) > MOVE_MAX)
+ && SIZE_FOR_MODE (orig_dest) > UNITS_PER_WORD)
break;
abort ();
}
@@ -8406,17 +8545,17 @@ schedule_insns (dump_file)
max_uid = (get_max_uid () + 1);
- cant_move = (char *) alloca (max_uid * sizeof (char));
+ cant_move = (char *) xmalloc (max_uid * sizeof (char));
bzero ((char *) cant_move, max_uid * sizeof (char));
- fed_by_spec_load = (char *) alloca (max_uid * sizeof (char));
+ fed_by_spec_load = (char *) xmalloc (max_uid * sizeof (char));
bzero ((char *) fed_by_spec_load, max_uid * sizeof (char));
- is_load_insn = (char *) alloca (max_uid * sizeof (char));
+ is_load_insn = (char *) xmalloc (max_uid * sizeof (char));
bzero ((char *) is_load_insn, max_uid * sizeof (char));
- insn_orig_block = (int *) alloca (max_uid * sizeof (int));
- insn_luid = (int *) alloca (max_uid * sizeof (int));
+ insn_orig_block = (int *) xmalloc (max_uid * sizeof (int));
+ insn_luid = (int *) xmalloc (max_uid * sizeof (int));
luid = 0;
for (b = 0; b < n_basic_blocks; b++)
@@ -8536,18 +8675,22 @@ schedule_insns (dump_file)
}
/* Allocate data for this pass. See comments, above,
- for what these vectors do. */
- insn_priority = (int *) alloca (max_uid * sizeof (int));
- insn_reg_weight = (int *) alloca (max_uid * sizeof (int));
- insn_tick = (int *) alloca (max_uid * sizeof (int));
- insn_costs = (short *) alloca (max_uid * sizeof (short));
- insn_units = (short *) alloca (max_uid * sizeof (short));
- insn_blockage = (unsigned int *) alloca (max_uid * sizeof (unsigned int));
- insn_ref_count = (int *) alloca (max_uid * sizeof (int));
+ for what these vectors do.
+
+ We use xmalloc instead of alloca, because max_uid can be very large
+ when there is a lot of function inlining. If we used alloca, we could
+ exceed stack limits on some hosts for some inputs. */
+ insn_priority = (int *) xmalloc (max_uid * sizeof (int));
+ insn_reg_weight = (int *) xmalloc (max_uid * sizeof (int));
+ insn_tick = (int *) xmalloc (max_uid * sizeof (int));
+ insn_costs = (short *) xmalloc (max_uid * sizeof (short));
+ insn_units = (short *) xmalloc (max_uid * sizeof (short));
+ insn_blockage = (unsigned int *) xmalloc (max_uid * sizeof (unsigned int));
+ insn_ref_count = (int *) xmalloc (max_uid * sizeof (int));
/* Allocate for forward dependencies */
- insn_dep_count = (int *) alloca (max_uid * sizeof (int));
- insn_depend = (rtx *) alloca (max_uid * sizeof (rtx));
+ insn_dep_count = (int *) xmalloc (max_uid * sizeof (int));
+ insn_depend = (rtx *) xmalloc (max_uid * sizeof (rtx));
if (reload_completed == 0)
{
@@ -8575,7 +8718,7 @@ schedule_insns (dump_file)
{
rtx line;
- line_note = (rtx *) alloca (max_uid * sizeof (rtx));
+ line_note = (rtx *) xmalloc (max_uid * sizeof (rtx));
bzero ((char *) line_note, max_uid * sizeof (rtx));
line_note_head = (rtx *) alloca (n_basic_blocks * sizeof (rtx));
bzero ((char *) line_note_head, n_basic_blocks * sizeof (rtx));
@@ -8662,6 +8805,26 @@ schedule_insns (dump_file)
fprintf (dump, "\n\n");
}
+ free (cant_move);
+ free (fed_by_spec_load);
+ free (is_load_insn);
+ free (insn_orig_block);
+ free (insn_luid);
+
+ free (insn_priority);
+ free (insn_reg_weight);
+ free (insn_tick);
+ free (insn_costs);
+ free (insn_units);
+ free (insn_blockage);
+ free (insn_ref_count);
+
+ free (insn_dep_count);
+ free (insn_depend);
+
+ if (write_symbols != NO_DEBUG)
+ free (line_note);
+
if (bb_live_regs)
FREE_REG_SET (bb_live_regs);
diff --git a/gcc/install.texi b/gcc/install.texi
index dc48c420507..5e3da8e58c1 100644
--- a/gcc/install.texi
+++ b/gcc/install.texi
@@ -199,6 +199,14 @@ threads implementation available, in which case threads can be enabled
with this option by supplying a suitable @var{type}, probably
@samp{posix}. The possibilities for @var{type} are @samp{single},
@samp{posix}, @samp{win32}, @samp{solaris}, @samp{irix} and @samp{mach}.
+
+@cindex Internal Compiler Checking
+@item --enable-checking
+When you specify this option, the compiler is built to perform checking
+of tree node types when referencing fields of that node. This does not
+change the generated code, but adds error checking within the compiler.
+This will slow down the compiler and may only work properly if you
+are building the compiler with GNU C.
@end table
The @file{configure} script searches subdirectories of the source
@@ -946,7 +954,9 @@ highly recommend using GAS for all HP-PA configurations.
You should be using GAS-2.6 (or later) along with GDB-4.16 (or later). These
can be retrieved from all the traditional GNU ftp archive sites.
-GAS will need to be installed into a directory before @code{/bin},
+On some versions of HP-UX, you will need to install GNU @file{sed}.
+
+You will need to be install GAS into a directory before @code{/bin},
@code{/usr/bin}, and @code{/usr/ccs/bin} in your search path. You
should install GAS before you build GNU CC.
@@ -980,19 +990,30 @@ Use this configuration for SCO release 3.2 version 4.
@item i386-*-sco3.2v5*
Use this for the SCO OpenServer Release family including 5.0.0, 5.0.2,
-5.0.4, Internet FastStart 1.0, and Internet FastStart 1.1.
-
-GNU CC can generate either ELF or COFF binaries. ELF is the default.
-To get COFF output, you must specify @samp{-mcoff}) on the command line.
-
-For 5.0.0 and 5.0.2, you must install TLS597 from ftp.sco.com/TLS.
-5.0.4 and later do not require this patch.
-
-@emph{NOTE:} You must follow the instructions about invoking
-@samp{make bootstrap} because the native OpenServer compiler builds
-a @file{cc1plus} that will not correctly parse many valid C++ programs.
-You must do a @samp{make bootstrap} if you are building with the native
-compiler.
+5.0.4, 5.0.5, Internet FastStart 1.0, and Internet FastStart 1.1.
+
+GNU CC can generate COFF binaries if you specify @samp{-mcoff} or ELF
+binaries, the default. A full @samp{make bootstrap} is recommended
+so that an ELF compiler that builds ELF is generated.
+
+You must have TLS597 from @uref{ftp://ftp.sco.com/TLS} installed for ELF
+C++ binaries to work correctly on releases before 5.0.4.
+
+The native SCO assembler that is provided with the OS at no charge
+is normally required. If, however, you must be able to use the GNU
+assembler (perhaps you have complex asms) you must configure this
+package @samp{--with-gnu-as}. To do this, install (cp or symlink)
+gcc/as to your copy of the GNU assembler. You must use a recent version
+of GNU binutils; version 2.9.1 seems to work well. If you select this
+option, you will be unable to build COFF images. Trying to do so will
+result in non-obvious failures. In general, the "--with-gnu-as" option
+isn't as well tested as the native assembler.
+
+@emph{NOTE:} If you are building C++, you must follow the instructions
+about invoking @samp{make bootstrap} because the native OpenServer
+compiler may build a @file{cc1plus} that will not correctly parse many
+valid C++ programs. You must do a @samp{make bootstrap} if you are
+building with the native compiler.
@item i386-*-isc
It may be a good idea to link with GNU malloc instead of the malloc that
@@ -1013,10 +1034,8 @@ GNU binutils version 2.2 or later.
Go to the Berkeley universe before compiling.
@item i386-sequent-ptx1*
-Sequent DYNIX/ptx 1.x.
-
-@item i386-sequent-ptx2*
-Sequent DYNIX/ptx 2.x.
+@itemx i386-sequent-ptx2*
+You must install GNU @file{sed} before running @file{configure}.
@item i386-sun-sunos4
You may find that you need another version of GNU CC to begin
@@ -1219,8 +1238,8 @@ PHCO_4484 from HP.
In addition, if you wish to use gas @samp{--with-gnu-as} you must use
gas version 2.1 or later, and you must use the GNU linker version 2.1 or
later. Earlier versions of gas relied upon a program which converted the
-gas output into the native HP/UX format, but that program has not been
-kept up to date. gdb does not understand that native HP/UX format, so
+gas output into the native HP-UX format, but that program has not been
+kept up to date. gdb does not understand that native HP-UX format, so
you must use gas if you wish to use gdb.
@item m68k-sun
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 0702249623b..d374543dc26 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "except.h"
#include "function.h"
+#include "toplev.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
@@ -43,9 +44,6 @@ Boston, MA 02111-1307, USA. */
extern struct obstack *function_maybepermanent_obstack;
-extern tree pushdecl ();
-extern tree poplevel ();
-
/* Similar, but round to the next highest integer that meets the
alignment. */
#define CEIL_ROUND(VALUE,ALIGN) (((VALUE) + (ALIGN) - 1) & ~((ALIGN)- 1))
@@ -61,25 +59,32 @@ extern tree poplevel ();
: (8 * (8 + list_length (DECL_ARGUMENTS (DECL)))))
#endif
-static rtx initialize_for_inline PROTO((tree, int, int, int, int));
-static void finish_inline PROTO((tree, rtx));
-static void adjust_copied_decl_tree PROTO((tree));
-static tree copy_decl_list PROTO((tree));
-static tree copy_decl_tree PROTO((tree));
-static void copy_decl_rtls PROTO((tree));
-static void save_constants PROTO((rtx *));
-static void note_modified_parmregs PROTO((rtx, rtx));
-static rtx copy_for_inline PROTO((rtx));
-static void integrate_parm_decls PROTO((tree, struct inline_remap *, rtvec));
-static void integrate_decl_tree PROTO((tree, int, struct inline_remap *));
+static rtx initialize_for_inline PROTO((tree, int, int, int, int));
+static void finish_inline PROTO((tree, rtx));
+static void adjust_copied_decl_tree PROTO((tree));
+static tree copy_decl_list PROTO((tree));
+static tree copy_decl_tree PROTO((tree));
+static void copy_decl_rtls PROTO((tree));
+static void save_constants PROTO((rtx *));
+static void note_modified_parmregs PROTO((rtx, rtx));
+static rtx copy_for_inline PROTO((rtx));
+static void integrate_parm_decls PROTO((tree, struct inline_remap *,
+ rtvec));
+static void integrate_decl_tree PROTO((tree, int,
+ struct inline_remap *));
static void save_constants_in_decl_trees PROTO ((tree));
-static void subst_constants PROTO((rtx *, rtx, struct inline_remap *));
-static void restore_constants PROTO((rtx *));
-static void set_block_origin_self PROTO((tree));
-static void set_decl_origin_self PROTO((tree));
-static void set_block_abstract_flags PROTO((tree, int));
-
-void set_decl_abstract_flags PROTO((tree, int));
+static void subst_constants PROTO((rtx *, rtx,
+ struct inline_remap *));
+static void restore_constants PROTO((rtx *));
+static void set_block_origin_self PROTO((tree));
+static void set_decl_origin_self PROTO((tree));
+static void set_block_abstract_flags PROTO((tree, int));
+static void process_reg_param PROTO((struct inline_remap *, rtx,
+ rtx));
+
+
+void set_decl_abstract_flags PROTO((tree, int));
+static tree copy_and_set_decl_abstract_origin PROTO((tree));
/* Returns the Ith entry in the label_map contained in MAP. If the
Ith entry has not yet been set, return a fresh label. This function
@@ -94,7 +99,12 @@ get_label_from_map (map, i)
rtx x = map->label_map[i];
if (x == NULL_RTX)
- x = map->label_map[i] = gen_label_rtx();
+ {
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+ x = map->label_map[i] = gen_label_rtx();
+ pop_obstacks ();
+ }
return x;
}
@@ -126,6 +136,9 @@ function_cannot_inline_p (fndecl)
if (current_function_contains_functions)
return "function with nested functions cannot be inline";
+ if (current_function_cannot_inline)
+ return current_function_cannot_inline;
+
/* If its not even close, don't even look. */
if (!DECL_INLINE (fndecl) && get_max_uid () > 3 * max_insns)
return "function too large to be inline";
@@ -147,11 +160,6 @@ function_cannot_inline_p (fndecl)
if (current_function_returns_pcc_struct)
return "inline functions not supported for this return value type";
- /* We can't inline functions that return BLKmode structures in registers. */
- if (TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == BLKmode
- && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl))))
- return "inline functions not supported for this return value type";
-
/* We can't inline functions that return structures of varying size. */
if (int_size_in_bytes (TREE_TYPE (TREE_TYPE (fndecl))) < 0)
return "function with varying-size return value cannot be inline";
@@ -553,10 +561,7 @@ save_for_inline_copying (fndecl)
regno_reg_rtx = reg_map;
/* Put copies of all the virtual register rtx into the new regno_reg_rtx. */
- regno_reg_rtx[VIRTUAL_INCOMING_ARGS_REGNUM] = virtual_incoming_args_rtx;
- regno_reg_rtx[VIRTUAL_STACK_VARS_REGNUM] = virtual_stack_vars_rtx;
- regno_reg_rtx[VIRTUAL_STACK_DYNAMIC_REGNUM] = virtual_stack_dynamic_rtx;
- regno_reg_rtx[VIRTUAL_OUTGOING_ARGS_REGNUM] = virtual_outgoing_args_rtx;
+ init_virtual_regs ();
/* Likewise each label rtx must have a unique rtx as its copy. */
@@ -656,10 +661,28 @@ save_for_inline_copying (fndecl)
if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG
|| NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END)
{
+ int new_region = CODE_LABEL_NUMBER
+ (label_map[NOTE_BLOCK_NUMBER (copy)]);
+
+ /* we have to duplicate the handlers for the original */
+ if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG)
+ {
+ handler_info *ptr, *temp;
+ int nr;
+ nr = new_eh_region_entry (new_region);
+ ptr = get_first_handler (NOTE_BLOCK_NUMBER (copy));
+ for ( ; ptr; ptr = ptr->next)
+ {
+ temp = get_new_handler (
+ label_map[CODE_LABEL_NUMBER (ptr->handler_label)],
+ ptr->type_info);
+ add_new_handler (nr, temp);
+ }
+ }
+
/* We have to forward these both to match the new exception
region. */
- NOTE_BLOCK_NUMBER (copy)
- = CODE_LABEL_NUMBER (label_map[NOTE_BLOCK_NUMBER (copy)]);
+ NOTE_BLOCK_NUMBER (copy) = new_region;
}
RTX_INTEGRATED_P (copy) = RTX_INTEGRATED_P (insn);
@@ -727,11 +750,30 @@ save_for_inline_copying (fndecl)
free (label_map);
}
+/* Copy NODE (as with copy_node). NODE must be a DECL. Set the
+ DECL_ABSTRACT_ORIGIN for the new accordinly. */
+
+static tree
+copy_and_set_decl_abstract_origin (node)
+ tree node;
+{
+ tree copy = copy_node (node);
+ if (DECL_ABSTRACT_ORIGIN (copy) != NULL_TREE)
+ /* That means that NODE already had a DECL_ABSTRACT_ORIGIN. (This
+ situation occurs if we inline a function which itself made
+ calls to inline functions.) Since DECL_ABSTRACT_ORIGIN is the
+ most distant ancestor, we don't have to do anything here. */
+ ;
+ else
+ /* The most distant ancestor must be NODE. */
+ DECL_ABSTRACT_ORIGIN (copy) = node;
+
+ return copy;
+}
+
/* Return a copy of a chain of nodes, chained through the TREE_CHAIN field.
For example, this can copy a list made of TREE_LIST nodes. While copying,
- for each node copied which doesn't already have is DECL_ABSTRACT_ORIGIN
- set to some non-zero value, set the DECL_ABSTRACT_ORIGIN of the copy to
- point to the corresponding (abstract) original node. */
+ set DECL_ABSTRACT_ORIGIN appropriately. */
static tree
copy_decl_list (list)
@@ -743,17 +785,13 @@ copy_decl_list (list)
if (list == 0)
return 0;
- head = prev = copy_node (list);
- if (DECL_ABSTRACT_ORIGIN (head) == NULL_TREE)
- DECL_ABSTRACT_ORIGIN (head) = list;
+ head = prev = copy_and_set_decl_abstract_origin (list);
next = TREE_CHAIN (list);
while (next)
{
register tree copy;
- copy = copy_node (next);
- if (DECL_ABSTRACT_ORIGIN (copy) == NULL_TREE)
- DECL_ABSTRACT_ORIGIN (copy) = next;
+ copy = copy_and_set_decl_abstract_origin (next);
TREE_CHAIN (prev) = copy;
prev = copy;
next = TREE_CHAIN (next);
@@ -993,7 +1031,7 @@ save_constants (px)
static void
note_modified_parmregs (reg, x)
rtx reg;
- rtx x;
+ rtx x ATTRIBUTE_UNUSED;
{
if (GET_CODE (reg) == REG && in_nonparm_insns
&& REGNO (reg) < max_parm_reg
@@ -1267,6 +1305,38 @@ int global_const_equiv_map_size;
&& REGNO (XEXP (X, 0)) >= FIRST_VIRTUAL_REGISTER \
&& REGNO (XEXP (X, 0)) <= LAST_VIRTUAL_REGISTER)
+/* Called to set up a mapping for the case where a parameter is in a
+ register. If it is read-only and our argument is a constant, set up the
+ constant equivalence.
+
+ If LOC is REG_USERVAR_P, the usual case, COPY must also have that flag set
+ if it is a register.
+
+ Also, don't allow hard registers here; they might not be valid when
+ substituted into insns. */
+static void
+process_reg_param (map, loc, copy)
+ struct inline_remap *map;
+ rtx loc, copy;
+{
+ if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG)
+ || (GET_CODE (copy) == REG && REG_USERVAR_P (loc)
+ && ! REG_USERVAR_P (copy))
+ || (GET_CODE (copy) == REG
+ && REGNO (copy) < FIRST_PSEUDO_REGISTER))
+ {
+ rtx temp = copy_to_mode_reg (GET_MODE (loc), copy);
+ REG_USERVAR_P (temp) = REG_USERVAR_P (loc);
+ if ((CONSTANT_P (copy) || FIXED_BASE_PLUS_P (copy))
+ && REGNO (temp) < map->const_equiv_map_size)
+ {
+ map->const_equiv_map[REGNO (temp)] = copy;
+ map->const_age_map[REGNO (temp)] = CONST_AGE_PARM;
+ }
+ copy = temp;
+ }
+ map->reg_map[REGNO (loc)] = copy;
+}
/* Integrate the procedure defined by FNDECL. Note that this function
may wind up calling itself. Since the static variables are not
reentrant, we do not assign them until after the possibility
@@ -1577,87 +1647,16 @@ expand_inline_function (fndecl, parms, target, ignore, type,
;
}
else if (GET_CODE (loc) == REG)
- {
- /* This is the good case where the parameter is in a register.
- If it is read-only and our argument is a constant, set up the
- constant equivalence.
-
- If LOC is REG_USERVAR_P, the usual case, COPY must also have
- that flag set if it is a register.
-
- Also, don't allow hard registers here; they might not be valid
- when substituted into insns. */
-
- if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG)
- || (GET_CODE (copy) == REG && REG_USERVAR_P (loc)
- && ! REG_USERVAR_P (copy))
- || (GET_CODE (copy) == REG
- && REGNO (copy) < FIRST_PSEUDO_REGISTER))
- {
- temp = copy_to_mode_reg (GET_MODE (loc), copy);
- REG_USERVAR_P (temp) = REG_USERVAR_P (loc);
- if ((CONSTANT_P (copy) || FIXED_BASE_PLUS_P (copy))
- && REGNO (temp) < map->const_equiv_map_size)
- {
- map->const_equiv_map[REGNO (temp)] = copy;
- map->const_age_map[REGNO (temp)] = CONST_AGE_PARM;
- }
- copy = temp;
- }
- map->reg_map[REGNO (loc)] = copy;
- }
+ process_reg_param (map, loc, copy);
else if (GET_CODE (loc) == CONCAT)
{
- /* This is the good case where the parameter is in a
- pair of separate pseudos.
- If it is read-only and our argument is a constant, set up the
- constant equivalence.
-
- If LOC is REG_USERVAR_P, the usual case, COPY must also have
- that flag set if it is a register.
-
- Also, don't allow hard registers here; they might not be valid
- when substituted into insns. */
rtx locreal = gen_realpart (GET_MODE (XEXP (loc, 0)), loc);
rtx locimag = gen_imagpart (GET_MODE (XEXP (loc, 0)), loc);
rtx copyreal = gen_realpart (GET_MODE (locreal), copy);
rtx copyimag = gen_imagpart (GET_MODE (locimag), copy);
- if ((GET_CODE (copyreal) != REG && GET_CODE (copyreal) != SUBREG)
- || (GET_CODE (copyreal) == REG && REG_USERVAR_P (locreal)
- && ! REG_USERVAR_P (copyreal))
- || (GET_CODE (copyreal) == REG
- && REGNO (copyreal) < FIRST_PSEUDO_REGISTER))
- {
- temp = copy_to_mode_reg (GET_MODE (locreal), copyreal);
- REG_USERVAR_P (temp) = REG_USERVAR_P (locreal);
- if ((CONSTANT_P (copyreal) || FIXED_BASE_PLUS_P (copyreal))
- && REGNO (temp) < map->const_equiv_map_size)
- {
- map->const_equiv_map[REGNO (temp)] = copyreal;
- map->const_age_map[REGNO (temp)] = CONST_AGE_PARM;
- }
- copyreal = temp;
- }
- map->reg_map[REGNO (locreal)] = copyreal;
-
- if ((GET_CODE (copyimag) != REG && GET_CODE (copyimag) != SUBREG)
- || (GET_CODE (copyimag) == REG && REG_USERVAR_P (locimag)
- && ! REG_USERVAR_P (copyimag))
- || (GET_CODE (copyimag) == REG
- && REGNO (copyimag) < FIRST_PSEUDO_REGISTER))
- {
- temp = copy_to_mode_reg (GET_MODE (locimag), copyimag);
- REG_USERVAR_P (temp) = REG_USERVAR_P (locimag);
- if ((CONSTANT_P (copyimag) || FIXED_BASE_PLUS_P (copyimag))
- && REGNO (temp) < map->const_equiv_map_size)
- {
- map->const_equiv_map[REGNO (temp)] = copyimag;
- map->const_age_map[REGNO (temp)] = CONST_AGE_PARM;
- }
- copyimag = temp;
- }
- map->reg_map[REGNO (locimag)] = copyimag;
+ process_reg_param (map, locreal, copyreal);
+ process_reg_param (map, locimag, copyimag);
}
else
abort ();
@@ -1766,7 +1765,23 @@ expand_inline_function (fndecl, parms, target, ignore, type,
Let the combiner substitute the MEM if that is valid. */
if (target == 0 || GET_CODE (target) != REG
|| GET_MODE (target) != departing_mode)
+ {
+ /* Don't make BLKmode registers. If this looks like
+ a BLKmode object being returned in a register, get
+ the mode from that, otherwise abort. */
+ if (departing_mode == BLKmode)
+ {
+ if (REG == GET_CODE (DECL_RTL (DECL_RESULT (fndecl))))
+ {
+ departing_mode = GET_MODE (DECL_RTL (DECL_RESULT (fndecl)));
+ arriving_mode = departing_mode;
+ }
+ else
+ abort();
+ }
+
target = gen_reg_rtx (departing_mode);
+ }
/* If function's value was promoted before return,
avoid machine mode mismatch when we substitute INLINE_TARGET.
@@ -2036,6 +2051,22 @@ expand_inline_function (fndecl, parms, target, ignore, type,
rtx label
= get_label_from_map (map, NOTE_BLOCK_NUMBER (copy));
+ /* we have to duplicate the handlers for the original */
+ if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG)
+ {
+ handler_info *ptr, *temp;
+ int nr;
+ nr = new_eh_region_entry (CODE_LABEL_NUMBER (label));
+ ptr = get_first_handler (NOTE_BLOCK_NUMBER (copy));
+ for ( ; ptr; ptr = ptr->next)
+ {
+ temp = get_new_handler ( get_label_from_map (map,
+ CODE_LABEL_NUMBER (ptr->handler_label)),
+ ptr->type_info);
+ add_new_handler (nr, temp);
+ }
+ }
+
/* We have to forward these both to match the new exception
region. */
NOTE_BLOCK_NUMBER (copy) = CODE_LABEL_NUMBER (label);
@@ -2110,6 +2141,12 @@ expand_inline_function (fndecl, parms, target, ignore, type,
emit_line_note (input_filename, lineno);
+ /* If the function returns a BLKmode object in a register, copy it
+ out of the temp register into a BLKmode memory object. */
+ if (TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == BLKmode
+ && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl))))
+ target = copy_blkmode_from_reg (0, target, TREE_TYPE (TREE_TYPE (fndecl)));
+
if (structure_value_addr)
{
target = gen_rtx_MEM (TYPE_MODE (type),
@@ -2151,7 +2188,7 @@ integrate_parm_decls (args, map, arg_vector)
/* These args would always appear unused, if not for this. */
TREE_USED (decl) = 1;
/* Prevent warning for shadowing with these. */
- DECL_ABSTRACT_ORIGIN (decl) = tail;
+ DECL_ABSTRACT_ORIGIN (decl) = DECL_ORIGIN (tail);
pushdecl (decl);
/* Fully instantiate the address with the equivalent form so that the
debugging information contains the actual register, instead of the
@@ -2190,7 +2227,7 @@ integrate_decl_tree (let, level, map)
push_obstacks_nochange ();
saveable_allocation ();
- d = copy_node (t);
+ d = copy_and_set_decl_abstract_origin (t);
pop_obstacks ();
if (DECL_RTL (t) != 0)
@@ -2205,8 +2242,6 @@ integrate_decl_tree (let, level, map)
}
/* These args would always appear unused, if not for this. */
TREE_USED (d) = 1;
- /* Prevent warning for shadowing with these. */
- DECL_ABSTRACT_ORIGIN (d) = t;
if (DECL_LANG_SPECIFIC (d))
copy_lang_decl (d);
@@ -2376,12 +2411,13 @@ copy_rtx_and_substitute (orig, map)
{
/* This is a reference to the function return value. If
the function doesn't have a return value, error. If the
- mode doesn't agree, make a SUBREG. */
+ mode doesn't agree, and it ain't BLKmode, make a SUBREG. */
if (map->inline_target == 0)
/* Must be unrolling loops or replicating code if we
reach here, so return the register unchanged. */
return orig;
- else if (mode != GET_MODE (map->inline_target))
+ else if (GET_MODE (map->inline_target) != BLKmode
+ && mode != GET_MODE (map->inline_target))
return gen_lowpart (mode, map->inline_target);
else
return map->inline_target;
@@ -2647,6 +2683,7 @@ copy_rtx_and_substitute (orig, map)
XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (orig, 0), map);
MEM_IN_STRUCT_P (copy) = MEM_IN_STRUCT_P (orig);
MEM_VOLATILE_P (copy) = MEM_VOLATILE_P (orig);
+ MEM_ALIAS_SET (copy) = MEM_ALIAS_SET (orig);
/* If doing function inlining, this MEM might not be const in the
function that it is being inlined into, and thus may not be
@@ -3055,7 +3092,7 @@ subst_constants (loc, insn, map)
void
mark_stores (dest, x)
rtx dest;
- rtx x;
+ rtx x ATTRIBUTE_UNUSED;
{
int regno = -1;
enum machine_mode mode;
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 894ffe7c3fc..d0339e47699 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -102,13 +102,14 @@ in the following sections.
@item C++ Language Options
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@smallexample
--fall-virtual -fdollars-in-identifiers -felide-constructors
--fenum-int-equiv -fexternal-templates -ffor-scope
--fno-for-scope -fhandle-signatures -fmemoize-lookups
--fname-mangling-version-@var{n} -fno-default-inline
--fno-gnu-keywords -fnonnull-objects -fguiding-decls
--foperator-names -fstrict-prototype -fthis-is-variable
--ftemplate-depth-@var{n} -nostdinc++ -traditional +e@var{n}
+-fno-access-control -fcheck-new -fconserve-space -fdollars-in-identifiers
+-fno-elide-constructors -fexternal-templates -ffor-scope
+-fno-for-scope -fno-gnu-keywords -fguiding-decls -fhandle-signatures
+-fhonor-std -fhuge-objects -fno-implicit-templates -finit-priority
+-fno-implement-inlines -fname-mangling-version-@var{n} -fno-default-inline
+-foperator-names -fno-optional-diags -frepo -fstrict-prototype
+-fsquangle -ftemplate-depth-@var{n} -fthis-is-variable -fvtable-thunks
+-nostdinc++
@end smallexample
@item Warning Options
@@ -121,20 +122,21 @@ in the following sections.
-Wid-clash-@var{len} -Wimplicit -Wimplicit-int
-Wimplicit-function-declaration -Wimport
-Werror-implicit-function-declaration -Winline
--Wlarger-than-@var{len} -Wmain -Wmissing-declarations
--Wmissing-prototypes -Wnested-externs -Wno-import
--Wold-style-cast -Woverloaded-virtual -Wparentheses
--Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type
--Wshadow -Wsign-compare -Wstrict-prototypes -Wswitch
--Wsynth -Wtemplate-debugging -Wtraditional -Wtrigraphs
--Wundef -Wuninitialized -Wunused -Wwrite-strings
+-Wlarger-than-@var{len} -Wlong-long
+-Wmain -Wmissing-declarations
+-Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import
+-Wno-non-template-friend -Wold-style-cast -Woverloaded-virtual
+-Wparentheses -Wpointer-arith -Wredundant-decls -Wreorder
+-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
+-Wswitch -Wsynth -Wtraditional
+-Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
-Wunknown-pragmas
@end smallexample
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@smallexample
--a -ax -d@var{letters} -fpretend-float
+-a -ax -d@var{letters} -fdump-unnumbered -fpretend-float
-fprofile-arcs -ftest-coverage
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2
-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+
@@ -145,18 +147,18 @@ in the following sections.
@item Optimization Options
@xref{Optimize Options,,Options that Control Optimization}.
@smallexample
--fbranch-probabilities
+-fbranch-probabilities -foptimize-register-moves
-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks
-fdelayed-branch -fexpensive-optimizations
-ffast-math -ffloat-store -fforce-addr -fforce-mem
--ffunction-sections -finline-functions
--fkeep-inline-functions -fno-default-inline
--fno-defer-pop -fno-function-cse
+-fdata-sections -ffunction-sections -fgcse
+-finline-functions -fkeep-inline-functions
+-fno-default-inline -fno-defer-pop -fno-function-cse
-fno-inline -fno-peephole -fomit-frame-pointer -fregmove
-frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
-fschedule-insns2 -fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops
--fmove-all-movables -freduce-all-givs
+-fmove-all-movables -freduce-all-givs -fstrict-aliasing
-O -O0 -O1 -O2 -O3 -Os
@end smallexample
@@ -265,9 +267,13 @@ in the following sections.
-mthumb-interwork -mno-thumb-interwork
-mstructure-size-boundary=
+@emph{MN10200 Options}
+-mrelax
+
@emph{MN10300 Options}
-mmult-bug
-mno-mult-bug
+-mrelax
@emph{M32R/D Options}
-mcode-model=@var{model type} -msdata=@var{sdata type}
@@ -294,17 +300,16 @@ in the following sections.
-mpowerpc-gfxopt -mno-powerpc-gfxopt
-mnew-mnemonics -mno-new-mnemonics
-mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc
--mxl-call -mno-xl-call -mthreads -mpe
+-maix64 -maix32 -mxl-call -mno-xl-call -mthreads -mpe
-msoft-float -mhard-float -mmultiple -mno-multiple
-mstring -mno-string -mupdate -mno-update
-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
-mstrict-align -mno-strict-align -mrelocatable
-mno-relocatable -mrelocatable-lib -mno-relocatable-lib
--mtoc -mno-toc -mtraceback -mno-traceback
--mlittle -mlittle-endian -mbig -mbig-endian
+-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian
-mcall-aix -mcall-sysv -mprototype -mno-prototype
--msim -mmvme -mads -myellowknife -memb
--msdata -msdata=@var{opt} -G @var{num}
+-msim -mmvme -mads -myellowknife -memb -msdata
+-msdata=@var{opt} -G @var{num}
@emph{RT Options}
-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs
@@ -315,7 +320,7 @@ in the following sections.
-mabicalls -mcpu=@var{cpu type} -membedded-data
-membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64
-mgpopt -mhalf-pic -mhard-float -mint64 -mips1
--mips2 -mips3 -mlong64 -mlong-calls -mmemcpy
+-mips2 -mips3 -mips4 -mlong64 -mlong-calls -mmemcpy
-mmips-as -mmips-tfile -mno-abicalls
-mno-embedded-data -mno-embedded-pic
-mno-gpopt -mno-long-calls
@@ -323,6 +328,7 @@ in the following sections.
-mrnames -msoft-float
-m4650 -msingle-float -mmad
-mstats -EL -EB -G @var{num} -nocpp
+-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi
@emph{i386 Options}
-mcpu=@var{cpu type}
@@ -399,7 +405,7 @@ in the following sections.
-fpcc-struct-return -fpic -fPIC
-freg-struct-return -fshared-data -fshort-enums
-fshort-double -fvolatile -fvolatile-global
--fverbose-asm -fpack-struct -fstack-check +e0 +e1
+-fverbose-asm -fpack-struct -fstack-check
-fargument-alias -fargument-noalias
-fargument-noalias-global
@end smallexample
@@ -666,8 +672,8 @@ other, C++-specific, extension keywords such as @code{headof}.
@findex strcmp
@findex strcpy
@findex strlen
-Don't recognize builtin functions that do not begin with two leading
-underscores. Currently, the functions affected include @code{abort},
+Don't recognize builtin functions that do not begin with `__builtin_'
+as prefix. Currently, the functions affected include @code{abort},
@code{abs}, @code{alloca}, @code{cos}, @code{exit}, @code{fabs},
@code{ffs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{sin},
@code{sqrt}, @code{strcmp}, @code{strcpy}, and @code{strlen}.
@@ -758,11 +764,6 @@ The character escape sequences @samp{\x} and @samp{\a} evaluate as the
literal characters @samp{x} and @samp{a} respectively. Without
@w{@samp{-traditional}}, @samp{\x} is a prefix for the hexadecimal
representation of a character, and @samp{\a} produces a bell.
-
-@item
-In C++ programs, assignment to @code{this} is permitted with
-@samp{-traditional}. (The option @samp{-fthis-is-variable} also has
-this effect.)
@end itemize
You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
@@ -903,11 +904,11 @@ regardless of what language your program is in. For example, you
might compile a file @code{firstClass.C} like this:
@example
-g++ -g -felide-constructors -O -c firstClass.C
+g++ -g -frepo -O -c firstClass.C
@end example
@noindent
-In this example, only @samp{-felide-constructors} is an option meant
+In this example, only @samp{-frepo} is an option meant
only for C++ programs; you can use the other options with any
language supported by GNU CC.
@@ -918,24 +919,17 @@ Here is a list of options that are @emph{only} for compiling C++ programs:
Turn off all access checking. This switch is mainly useful for working
around bugs in the access control code.
-@item -fall-virtual
-Treat all possible member functions as virtual, implicitly.
-All member functions (except for constructor functions and @code{new} or
-@code{delete} member operators) are treated as virtual functions of the
-class where they appear.
-
-This does not mean that all calls to these member functions will be made
-through the internal table of virtual functions. Under some
-circumstances, the compiler can determine that a call to a given virtual
-function can be made directly; in these cases the calls are direct in
-any case.
-
@item -fcheck-new
Check that the pointer returned by @code{operator new} is non-null
before attempting to modify the storage allocated. The current Working
Paper requires that @code{operator new} never return a null pointer, so
this check is normally unnecessary.
+An alternative to using this option is to specify that your
+@code{operator new} does not throw any exceptions; if you declare it
+@samp{throw()}, g++ will check the return value. See also @samp{new
+(nothrow)}.
+
@item -fconserve-space
Put uninitialized or runtime-initialized global variables into the
common segment, as C does. This saves space in the executable at the
@@ -944,6 +938,9 @@ flag and your program mysteriously crashes after @code{main()} has
completed, you may have an object that is being destroyed twice because
two definitions were merged.
+This option is no longer useful on most targets, now that support has
+been added for putting variables into BSS without making them common.
+
@item -fdollars-in-identifiers
Accept @samp{$} in identifiers. You can also explicitly prohibit use of
@samp{$} with the option @samp{-fno-dollars-in-identifiers}. (GNU C allows
@@ -951,10 +948,11 @@ Accept @samp{$} in identifiers. You can also explicitly prohibit use of
Traditional C allowed the character @samp{$} to form part of
identifiers. However, ANSI C and C++ forbid @samp{$} in identifiers.
-@item -fenum-int-equiv
-Anachronistically permit implicit conversion of @code{int} to
-enumeration types. Current C++ allows conversion of @code{enum} to
-@code{int}, but not the other way around.
+@item -fno-elide-constructors
+The C++ standard allows an implementation to omit creating a temporary
+which is only used to initialize another object of the same type.
+Specifying this option disables that optimization, and forces g++ to
+call the copy constructor in all cases.
@item -fexternal-templates
Cause template instantiations to obey @samp{#pragma interface} and
@@ -1003,12 +1001,9 @@ be instantiated. This behavior reflects the C++ language prior to
September 1996, when guiding declarations were removed.
This option implies @samp{-fname-mangling-version-0}, and will not work
-with other name mangling versions.
-
-@item -fno-implicit-templates
-Never emit code for templates which are instantiated implicitly (i.e. by
-use); only emit code for explicit instantiations. @xref{Template
-Instantiation}, for more information.
+with other name mangling versions. Like all options that change the
+ABI, all C++ code, @emph{including libgcc.a} must be built with the same
+setting of this option.
@item -fhandle-signatures
Recognize the @code{signature} and @code{sigof} keywords for specifying
@@ -1016,72 +1011,38 @@ abstract types. The default (@samp{-fno-handle-signatures}) is not to
recognize them. @xref{C++ Signatures, Type Abstraction using
Signatures}.
+@item -fhonor-std
+Treat the @code{namespace std} as a namespace, instead of ignoring
+it. For compatibility with earlier versions of g++, the compiler will,
+by default, ignore @code{namespace-declarations},
+@code{using-declarations}, @code{using-directives}, and
+@code{namespace-names}, if they involve @code{std}.
+
@item -fhuge-objects
Support virtual function calls for objects that exceed the size
representable by a @samp{short int}. Users should not use this flag by
-default; if you need to use it, the compiler will tell you so. If you
-compile any of your code with this flag, you must compile @emph{all} of
-your code with this flag (including the C++ library, if you use it).
+default; if you need to use it, the compiler will tell you so.
This flag is not useful when compiling with -fvtable-thunks.
+Like all options that change the ABI, all C++ code, @emph{including
+libgcc} must be built with the same setting of this option.
+
+@item -fno-implicit-templates
+Never emit code for templates which are instantiated implicitly (i.e. by
+use); only emit code for explicit instantiations. @xref{Template
+Instantiation}, for more information.
+
+@item -finit-priority
+Support @samp{__attribute__ ((init_priority (n)))} for controlling the
+order of initialization of file-scope objects. On ELF targets, this
+requires GNU ld 2.10 or later.
+
@item -fno-implement-inlines
To save space, do not emit out-of-line copies of inline functions
controlled by @samp{#pragma implementation}. This will cause linker
errors if these functions are not inlined everywhere they are called.
-@item -fmemoize-lookups
-@itemx -fsave-memoized
-Use heuristics to compile faster. These heuristics are not enabled by
-default, since they are only effective for certain input files. Other
-input files compile more slowly.
-
-The first time the compiler must build a call to a member function (or
-reference to a data member), it must (1) determine whether the class
-implements member functions of that name; (2) resolve which member
-function to call (which involves figuring out what sorts of type
-conversions need to be made); and (3) check the visibility of the member
-function to the caller. All of this adds up to slower compilation.
-Normally, the second time a call is made to that member function (or
-reference to that data member), it must go through the same lengthy
-process again. This means that code like this:
-
-@smallexample
-cout << "This " << p << " has " << n << " legs.\n";
-@end smallexample
-
-@noindent
-makes six passes through all three steps. By using a software cache, a
-``hit'' significantly reduces this cost. Unfortunately, using the cache
-introduces another layer of mechanisms which must be implemented, and so
-incurs its own overhead. @samp{-fmemoize-lookups} enables the software
-cache.
-
-Because access privileges (visibility) to members and member functions
-may differ from one function context to the next, G++ may need to flush
-the cache. With the @samp{-fmemoize-lookups} flag, the cache is flushed
-after every function that is compiled. The @samp{-fsave-memoized} flag
-enables the same software cache, but when the compiler determines that
-the context of the last function compiled would yield the same access
-privileges of the next function to compile, it preserves the cache.
-This is most helpful when defining many member functions for the same
-class: with the exception of member functions which are friends of other
-classes, each member function has exactly the same access privileges as
-every other, and the cache need not be flushed.
-
-The code that implements these flags has rotted; you should probably
-avoid using them.
-
-@item -fstrict-prototype
-Within an @samp{extern "C"} linkage specification, treat a function
-declaration with no arguments, such as @samp{int foo ();}, as declaring
-the function to take no arguments. Normally, such a declaration means
-that the function @code{foo} can take any combination of arguments, as
-in C. @samp{-pedantic} implies @samp{-fstrict-prototype} unless
-overridden with @samp{-fno-strict-prototype}.
-
-This flag no longer affects declarations with C++ linkage.
-
@item -fname-mangling-version-@var{n}
Control the way in which names are mangled. Version 0 is compatible
with versions of g++ before 2.8. Version 1 is the default. Version 1
@@ -1093,26 +1054,35 @@ given this declaration:
template <class T, class U> void foo(T t);
@end example
-@item -fno-nonnull-objects
-Don't assume that a reference is initialized to refer to a valid object.
-Although the current C++ Working Paper prohibits null references, some
-old code may rely on them, and you can use @samp{-fno-nonnull-objects}
-to turn on checking.
-
-At the moment, the compiler only does this checking for conversions to
-virtual base classes.
-
@item -foperator-names
Recognize the operator name keywords @code{and}, @code{bitand},
@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
synonyms for the symbols they refer to. @samp{-ansi} implies
@samp{-foperator-names}.
+@item -fno-optional-diags
+Disable diagnostics that the standard says a compiler does not need to
+issue. Currently, this means the diagnostic for a name having multiple
+meanings within a class.
+
@item -frepo
Enable automatic template instantiation. This option also implies
@samp{-fno-implicit-templates}. @xref{Template Instantiation}, for more
information.
+@item -fstrict-prototype
+Within an @samp{extern "C"} linkage specification, treat a function
+declaration with no arguments, such as @samp{int foo ();}, as declaring
+the function to take no arguments. Normally, such a declaration means
+that the function @code{foo} can take any combination of arguments, as
+in C. @samp{-pedantic} implies @samp{-fstrict-prototype} unless
+overridden with @samp{-fno-strict-prototype}.
+
+Specifying this option will also suppress implicit declarations of
+functions.
+
+This flag no longer affects declarations with C++ linkage.
+
@item -fsquangle
@itemx -fno-squangle
@samp{-fsquangle} will enable a compressed form of name mangling for
@@ -1122,6 +1092,15 @@ short ID codes. This option also requires any C++ libraries being used to
be compiled with this option as well. The compiler has this disabled (the
equivalent of @samp{-fno-squangle}) by default.
+Like all options that change the ABI, all C++ code, @emph{including
+libgcc.a} must be built with the same setting of this option.
+
+@item -ftemplate-depth-@var{n}
+Set the maximum instantiation depth for template classes to @var{n}.
+A limit on the template instantiation depth is needed to detect
+endless recursions during template class instantiation. ANSI/ISO C++
+conforming programs must not rely on a maximum depth greater than 17.
+
@item -fthis-is-variable
Permit assignment to @code{this}. The incorporation of user-defined
free store management into C++ has made assignment to @samp{this} an
@@ -1139,26 +1118,13 @@ offsets for adjusting the @samp{this} pointer at the call site. Newer
implementations store a single pointer to a @samp{thunk} function which
does any necessary adjustment and then calls the target function.
-This option also enables a heuristic for controlling emission of
-vtables; if a class has any non-inline virtual functions, the vtable
-will be emitted in the translation unit containing the first one of
-those.
-
-@item -ftemplate-depth-@var{n}
-Set the maximum instantiation depth for template classes to @var{n}.
-A limit on the template instantiation depth is needed to detect
-endless recursions during template class instantiation. ANSI/ISO C++
-conforming programs must not rely on a maximum depth greater than 17.
+Like all options that change the ABI, all C++ code, @emph{including
+libgcc.a} must be built with the same setting of this option.
@item -nostdinc++
Do not search for header files in the standard directories specific to
C++, but do still search the other standard directories. (This option
is used when building the C++ library.)
-
-@item -traditional
-For C++ programs (in addition to the effects that apply to both C and
-C++), this has the same effect as @samp{-fthis-is-variable}.
-@xref{C Dialect Options,, Options Controlling C Dialect}.
@end table
In addition, these optimization, warning, and code generation options
@@ -1167,21 +1133,19 @@ have meanings only for C++ programs:
@table @code
@item -fno-default-inline
Do not assume @samp{inline} for functions defined inside a class scope.
-@xref{Optimize Options,,Options That Control Optimization}.
+@xref{Optimize Options,,Options That Control Optimization}. Note that these
+functions will have linkage like inline functions; they just won't be
+inlined by default.
+@item -Wno-non-template-friend
+@xref{Warning Options,,Options to Request or Suppress Warnings}.
@item -Wold-style-cast
@itemx -Woverloaded-virtual
-@itemx -Wtemplate-debugging
Warnings that apply only to C++ programs. @xref{Warning
Options,,Options to Request or Suppress Warnings}.
@item -Weffc++
Warn about violation of some style rules from Effective C++ by Scott Myers.
-
-@item +e@var{n}
-Control how virtual function definitions are used, in a fashion
-compatible with @code{cfront} 1.x. @xref{Code Gen Options,,Options for
-Code Generation Conventions}.
@end table
@node Warning Options
@@ -1283,6 +1247,11 @@ Same as @samp{-Wimplicit-int} and @samp{-Wimplicit-function-}@*
Warn if the type of @samp{main} is suspicious. @samp{main} should be a
function with external linkage, returning int, taking either zero
arguments, two, or three arguments of appropriate types.
+
+@item -Wmultichar
+Warn if a multicharacter constant (@samp{'FOOF'}) is used. Usually they
+indicate a typo in the user's code, as they have implementation-defined
+values, and should not be used in portable code.
@item -Wparentheses
Warn if parentheses are omitted in certain contexts, such
@@ -1530,6 +1499,16 @@ struct s @{ int f, g; @};
struct t @{ struct s h; int i; @};
struct t x = @{ 1, 2, 3 @};
@end smallexample
+
+@item
+An aggregate has an initializer which does not initialize all members.
+For example, the following code would cause such a warning, because
+@code{x.h} would be implicitly initialized to zero:
+
+@smallexample
+struct s @{ int f, g, h; @};
+struct s x = @{ 3, 4 @};
+@end smallexample
@end itemize
@item -Wtraditional
@@ -1645,6 +1624,22 @@ cases where multiple declaration is valid and changes nothing.
@item -Wnested-externs
Warn if an @code{extern} declaration is encountered within an function.
+@item -Wno-non-template-friend
+Disable warnings when non-templatized friend functions are declared
+within a template. With the advent of explicit template specification
+support in g++, if the name of the friend is an unqualified-id (ie,
+@samp{friend foo(int)}), the C++ language specification demands that the
+friend declare or define an ordinary, nontemplate function. (Section
+14.5.3). Before g++ implemented explicit specification, unqualified-ids
+could be interpreted as a particular specialization of a templatized
+function. Because this non-conforming behavior is no longer the default
+behavior for g++, @samp{-Wnon-template-friend} allows the compiler to
+check existing code for potential trouble spots, and is on by default.
+This new compiler behavior can also be turned off with the flag
+@samp{-fguiding-decls}, which activates the older, non-specification
+compiler code, or with @samp{-Wno-non-template-friend} which keeps the
+conformant compiler code but disables the helpful warning.
+
@item -Winline
Warn if a function can not be inlined, and either it was declared as inline,
or else the @samp{-finline-functions} option was given.
@@ -1685,6 +1680,12 @@ main ()
In this example, g++ will synthesize a default @samp{A& operator =
(const A&);}, while cfront will use the user-defined @samp{operator =}.
+@item -Wlong-long
+Warn if @samp{long long} type is used. This is default. To inhibit
+the warning messages, use @samp{-Wno-long-long}. Flags
+@samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
+only when @samp{-pedantic} flag is used.
+
@item -Werror
Make all warnings into errors.
@end table
@@ -1986,6 +1987,8 @@ Dump after purging ADDRESSOF, to @file{@var{file}.addressof}.
Dump after flow analysis, to @file{@var{file}.flow}.
@item g
Dump after global register allocation, to @file{@var{file}.greg}.
+@item G
+Dump after GCSE, to @file{@var{file}.gcse}.
@item j
Dump after first jump optimization, to @file{@var{file}.jump}.
@item J
@@ -2030,6 +2033,12 @@ Dump debugging information during parsing, to standard error.
Annotate the assembler output with miscellaneous debugging information.
@end table
+@item -fdump-unnumbered
+When doing debugging dumps (see -d option above), suppress instruction
+numbers and line number note output. This makes it more feasible to
+use diff on debugging dumps for compiler invokations with different
+options, in particular with and without -g.
+
@item -fpretend-float
When running a cross-compiler, pretend that the target machine uses the
same floating point format as the host machine. This causes incorrect
@@ -2156,7 +2165,8 @@ the 68000 where the floating registers (of the 68881) keep more
precision than a @code{double} is supposed to have. Similarly for the
x86 architecture. For most programs, the excess precision does only
good, but a few programs rely on the precise definition of IEEE floating
-point. Use @samp{-ffloat-store} for such programs.
+point. Use @samp{-ffloat-store} for such programs, after modifying
+them to store all pertinent intermediate computations into variables.
@item -fno-default-inline
Do not make member functions inline by default merely because they are
@@ -2299,9 +2309,24 @@ performed.
@item -frerun-loop-opt
Run the loop optimizer twice.
+@item -fgcse
+Perform a global common subexpression elimination pass.
+This pass also performs global constant and copy propagation.
+
@item -fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
+@item -foptimize-register-moves
+@item -fregmove
+Attempt to reassign register numbers in move instructions and as
+operands of other simple instructions in order to maximize the amount of
+register tying. This is especially helpful on machines with two-operand
+instructions. GNU CC enables this optimization by default with @samp{-O2}
+or higher.
+
+Note @code{-fregmove} and @code{-foptimize-register-moves} are the same
+optimization.
+
@item -fdelayed-branch
If supported for the target machine, attempt to reorder instructions
to exploit instruction slots available after delayed branch
@@ -2321,18 +2346,20 @@ especially useful on machines with a relatively small number of
registers and where memory load instructions take more than one cycle.
@item -ffunction-sections
-Place each function into its own section in the output file if the
-target supports arbitrary sections. The function's name determines
-the section's name in the output file.
+@item -fdata-sections
+Place each function or data item into its own section in the output
+file if the target supports arbitrary sections. The name of the
+function or the name of the data item determines the section's name
+in the output file.
-Use this option on systems where the linker can perform optimizations
+Use these options on systems where the linker can perform optimizations
to improve locality of reference in the instruction space. HPPA
processors running HP-UX and Sparc processors running Solaris 2 have
linkers with such optimizations. Other systems using the ELF object format
as well as AIX may have these optimizations in the future.
-Only use this option when there are significant benefits from doing
-so. When you specify this option, the assembler and linker will
+Only use these options when there are significant benefits from doing
+so. When you specify these options, the assembler and linker will
create larger object and executable files and will also be slower.
You will not be able to use @code{gprof} on all systems if you
specify this option and you may have problems with debugging if
@@ -2344,8 +2371,11 @@ function calls, by emitting extra instructions to save and restore the
registers around such calls. Such allocation is done only when it
seems to result in better code than would otherwise be produced.
-This option is enabled by default on certain machines, usually those
-which have no call-preserved registers to use instead.
+This option is always enabled by default on certain machines, usually
+those which have no call-preserved registers to use instead.
+
+For all machines, optimization level 2 and higher enables this flag by
+default.
@item -funroll-loops
Perform the optimization of loop unrolling. This is only done for loops
@@ -2403,11 +2433,52 @@ branch is mostly to take, the @samp{REG_BR_PROB} values are used to
exactly determine which path is taken more often.
@end ifset
-@item -fregmove
-Some machines only support 2 operands per instruction. On such
-machines, GNU CC might have to do extra copies. The @samp{-fregmove}
-option overrides the default for the machine to do the copy before
-register allocation.
+@item -fstrict-aliasing
+Allows the compiler to assume the strictest aliasing rules applicable to
+the language being compiled. For C (and C++), this activates
+optimizations based on the type of expressions. In particular, an
+object of one type is assumed never to reside at the same address as an
+object of a different type, unless the types are almost the same. For
+example, an @code{unsigned int} can alias an @code{int}, but not a
+@code{void*} or a @code{double}. A character type may alias any other
+type.
+
+Pay special attention to code like this:
+@example
+union a_union @{
+ int i;
+ double d;
+@};
+
+int f() @{
+ a_union t;
+ t.d = 3.0;
+ return t.i;
+@}
+@end example
+The practice of reading from a different union member than the one most
+recently written to (called ``type-punning'') is common. Even with
+@samp{-fstrict-aliasing}, type-punning is allowed, provided the memory
+is accessed through the union type. So, the code above will work as
+expected. However, this code might not:
+@example
+int f() @{
+ a_union t;
+ int* ip;
+ t.d = 3.0;
+ ip = &t.i;
+ return *ip;
+@}
+@end example
+
+@ifset INTERNALS
+Every language that wishes to perform language-specific alias analysis
+should define a function that computes, given an @code{tree}
+node, an alias set for the node. Nodes in different alias sets are not
+allowed to alias. For an example, see the C front-end function
+@code{c_get_alias_set}.
+@end ifset
+
@end table
@node Preprocessor Options
@@ -2941,6 +3012,7 @@ that macro, which enables you to change the defaults.
* AMD29K Options::
* ARM Options::
* Thumb Options::
+* MN10200 Options::
* MN10300 Options::
* M32R/D Options::
* M88K Options::
@@ -3766,6 +3838,19 @@ value as future versions of the toolchain may default to this value.
@end table
+@node MN10200 Options
+@subsection MN10200 Options
+@cindex MN10200 options
+These @samp{-m} options are defined for Matsushita MN10200 architectures:
+@table @code
+
+@item -mrelax
+Indicate to the linker that it should perform a relaxation optimization pass
+to shorten branches, calls and absolute memory addresses. This option only
+has an effect when used on the command line for the final link step.
+
+This option makes symbolic debugging impossible.
+@end table
@node MN10300 Options
@subsection MN10300 Options
@@ -3780,8 +3865,16 @@ processors. This is the default.
@item -mno-mult-bug
Do not generate code to avoid bugs in the multiply instructions for the
MN10300 processors.
+
+@item -mrelax
+Indicate to the linker that it should perform a relaxation optimization pass
+to shorten branches, calls and absolute memory addresses. This option only
+has an effect when used on the command line for the final link step.
+
+This option makes symbolic debugging impossible.
@end table
+
@node M32R/D Options
@subsection M32R/D Options
@cindex M32R/D options
@@ -4086,11 +4179,14 @@ These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
@itemx -mno-powerpc-gpopt
@itemx -mpowerpc-gfxopt
@itemx -mno-powerpc-gfxopt
+@itemx -mpowerpc64
+@itemx -mno-powerpc64
@kindex -mpower
@kindex -mpower2
@kindex -mpowerpc
@kindex -mpowerpc-gpopt
@kindex -mpowerpc-gfxopt
+@kindex -mpowerpc64
GNU CC supports two related instruction set architectures for the
RS/6000 and PowerPC. The @dfn{POWER} instruction set are those
instructions supported by the @samp{rios} chip set used in the original
@@ -4124,6 +4220,11 @@ General Purpose group, including floating-point square root. Specifying
use the optional PowerPC architecture instructions in the Graphics
group, including floating-point select.
+The @samp{-mpowerpc64} option allows GNU CC to generate the additional
+64-bit instructions that are found in the full PowerPC64 architecture
+and to treat GPRs as 64-bit, doubleword quantities. GNU CC defaults to
+@samp{-mno-powerpc64}.
+
If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GNU CC
will use only the instructions in the common subset of both
architectures plus some special AIX common-mode calls, and will not use
@@ -4143,18 +4244,14 @@ Instructions defined in only one architecture have only one mnemonic;
GNU CC uses that mnemonic irrespective of which of these options is
specified.
-PowerPC assemblers support both the old and new mnemonics, as will later
-POWER assemblers. Current POWER assemblers only support the old
-mnemonics. Specify @samp{-mnew-mnemonics} if you have an assembler that
-supports them, otherwise specify @samp{-mold-mnemonics}.
-
-The default value of these options depends on how GNU CC was configured.
-Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the value of
-these option. Unless you are building a cross-compiler, you should
-normally not specify either @samp{-mnew-mnemonics} or
+GNU CC defaults to the mnemonics appropriate for the architecture in
+use. Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the
+value of these option. Unless you are building a cross-compiler, you
+should normally not specify either @samp{-mnew-mnemonics} or
@samp{-mold-mnemonics}, but should instead accept the default.
@item -mcpu=@var{cpu_type}
+@kindex -mcpu
Set architecture type, register usage, choice of mnemonics, and
instruction scheduling parameters for machine type @var{cpu_type}.
Supported values for @var{cpu_type} are @samp{rs6000}, @samp{rios1},
@@ -4228,6 +4325,7 @@ instruction scheduling parameters.
@itemx -mno-fp-in-toc
@itemx -mno-sum-in-toc
@itemx -mminimal-toc
+@kindex -mminimal-toc
Modify generation of the TOC (Table Of Contents), which is created for
every executable file. The @samp{-mfull-toc} option is selected by
default. In that case, GNU CC will allocate at least one TOC entry for
@@ -4252,26 +4350,39 @@ option, GNU CC will produce code that is slower and larger but which
uses extremely little TOC space. You may wish to use this option
only on files that contain less frequently executed code. @refill
+@item -maix64
+@itemx -maix32
+@kindex -maix64
+@kindex -maix32
+Enable AIX 64-bit ABI and calling convention: 64-bit pointers, 64-bit
+@code{long} type, and the infrastructure needed to support them.
+Specifying @samp{-maix64} implies @samp{-mpowerpc64} and
+@samp{-mpowerpc}, while @samp{-maix32} disables the 64-bit ABI and
+implies @samp{-mno-powerpc64}. GNU CC defaults to @samp{-maix32}.
+
@item -mxl-call
@itemx -mno-xl-call
+@kindex -mxl-call
On AIX, pass floating-point arguments to prototyped functions beyond the
register save area (RSA) on the stack in addition to argument FPRs. The
AIX calling convention was extended but not initially documented to
handle an obscure K&R C case of calling a function that takes the
address of its arguments with fewer arguments than declared. AIX XL
-compilers assume that floating point arguments which do not fit in the
-RSA are on the stack when they compile a subroutine without
+compilers access floating point arguments which do not fit in the
+RSA from the stack when a subroutine is compiled without
optimization. Because always storing floating-point arguments on the
stack is inefficient and rarely needed, this option is not enabled by
default and only is necessary when calling subroutines compiled by AIX
XL compilers without optimization.
@item -mthreads
+@kindex -mthreads
Support @dfn{AIX Threads}. Link an application written to use
@dfn{pthreads} with special libraries and startup code to enable the
application to run.
@item -mpe
+@kindex -mpe
Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE). Link an
application written to use message passing with special startup code to
enable the application to run. The system must have PE installed in the
@@ -4283,6 +4394,7 @@ option are incompatible.
@item -msoft-float
@itemx -mhard-float
+@kindex -msoft-float
Generate code that does not use (uses) the floating-point register set.
Software floating point emulation is provided if you use the
@samp{-msoft-float} option, and pass the option to GNU CC when linking.
@@ -4298,6 +4410,7 @@ processor is in little endian mode.
@item -mstring
@itemx -mno-string
+@kindex -mstring
Generate code that uses (does not use) the load string instructions and the
store string word instructions to save multiple registers and do small block
moves. These instructions are generated by default on POWER systems, and not
@@ -4307,6 +4420,7 @@ little endian mode.
@item -mupdate
@itemx -mno-update
+@kindex -mupdate
Generate code that uses (does not use) the load or store instructions
that update the base register to the address of the calculated memory
location. These instructions are generated by default. If you use
@@ -4317,12 +4431,14 @@ signals may get corrupted data.
@item -mfused-madd
@itemx -mno-fused-madd
+@kindex -mfused-madd
Generate code that uses (does not use) the floating point multiply and
accumulate instructions. These instructions are generated by default if
hardware floating is used.
@item -mno-bit-align
@itemx -mbit-align
+@kindex -mbit-align
On System V.4 and embedded PowerPC systems do not (do) force structures
and unions that contain bit fields to be aligned to the base type of the
bit field.
@@ -4335,11 +4451,13 @@ size.
@item -mno-strict-align
@itemx -mstrict-align
+@kindex -mstrict-align
On System V.4 and embedded PowerPC systems do not (do) assume that
unaligned memory references will be handled by the system.
@item -mrelocatable
@itemx -mno-relocatable
+@kindex -mrelocatable
On embedded PowerPC systems generate code that allows (does not allow)
the program to be relocated to a different address at runtime. If you
use @samp{-mrelocatable} on any module, all objects linked together must
@@ -4359,12 +4477,6 @@ On System V.4 and embedded PowerPC systems do not (do) assume that
register 2 contains a pointer to a global area pointing to the addresses
used in the program.
-@item -mno-traceback
-@itemx -mtraceback
-On embedded PowerPC systems do not (do) generate a traceback tag before
-the start of the function. This tag can be used by the debugger to
-identify where the start of a function is.
-
@item -mlittle
@itemx -mlittle-endian
On System V.4 and embedded PowerPC systems compile code for the
@@ -4584,6 +4696,10 @@ Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
@samp{r4000} is the default @var{cpu type} at this ISA level.
This option does not change the sizes of any of the C data types.
+@item -mips4
+Issue instructions from level 4 of the MIPS ISA. @samp{r8000} is the
+default @var{cpu type} at this ISA level.
+
@item -mfp32
Assume that 32 32-bit floating point registers are available. This is
the default.
@@ -4608,6 +4724,12 @@ is also specified.
Types long and pointer are 64 bits, and type int is 32 bits.
This works only if @samp{-mips3} is also specified.
+@itemx -mabi=32
+@itemx -mabi=n32
+@itemx -mabi=64
+@itemx -mabi=eabi
+Generate code for the indicated ABI.
+
@item -mmips-as
Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
add normal debug information. This is the default for all
@@ -4753,7 +4875,7 @@ All modules should be compiled with the same @samp{-G @var{num}}
value.
@item -nocpp
-Tell the MIPS assembler to not run it's preprocessor over user
+Tell the MIPS assembler to not run its preprocessor over user
assembler files (with a @samp{.s} suffix) when assembling them.
@end table
@@ -4899,12 +5021,18 @@ startup modules.
@item -malign-loops=@var{num}
Align loops to a 2 raised to a @var{num} byte boundary. If
-@samp{-malign-loops} is not specified, the default is 2.
+@samp{-malign-loops} is not specified, the default is 2 unless
+gas 2.8 (or later) is being used in which case the default is
+to align the loop on a 16 byte boundary if it is less than 8
+bytes away.
@item -malign-jumps=@var{num}
Align instructions that are only jumped to to a 2 raised to a @var{num}
byte boundary. If @samp{-malign-jumps} is not specified, the default is
-2 if optimizing for a 386, and 4 if optimizing for a 486.
+2 if optimizing for a 386, and 4 if optimizing for a 486 unless
+gas 2.8 (or later) is being used in which case the default is
+to align the instruction on a 16 byte boundary if it is less
+than 8 bytes away.
@item -malign-functions=@var{num}
Align the start of functions to a 2 raised to @var{num} byte boundary.
@@ -5542,9 +5670,12 @@ it.
@table @code
@item -fexceptions
-Enable exception handling, and generate extra code needed to propagate
-exceptions. If you do not specify this option, GNU CC enables it by
-default for languages like C++ that normally require exception handling,
+Enable exception handling. Generates extra code needed to propagate
+exceptions. For some targets, this implies generation of frame unwind
+information for all functions. This can produce significant data size
+overhead, although it does not affect execution.
+If you do not specify this option, it is enabled by
+default for languages like C++ which normally require exception handling,
and disabled for languages like C that do not normally require it.
However, when compiling C code that needs to interoperate properly with
exception handlers written in C++, you may need to enable this option.
@@ -5757,6 +5888,41 @@ prefix_foo (int a)
@end example
This option is designed to be used with @samp{-fcheck-memory-usage}.
+@item -finstrument-functions
+Generate instrumentation calls for entry and exit to functions. Just
+after function entry and just before function exit, the following
+profiling functions will be called with the address of the current
+function and its call site. (On some platforms,
+@code{__builtin_return_address} does not work beyond the current
+function, so the call site information may not be available to the
+profiling functions otherwise.)
+
+@example
+void __cyg_profile_func_enter (void *this_fn, void *call_site);
+void __cyg_profile_func_exit (void *this_fn, void *call_site);
+@end example
+
+The first argument is the address of the start of the current function,
+which may be looked up exactly in the symbol table.
+
+This instrumentation is also done for functions expanded inline in other
+functions. The profiling calls will indicate where, conceptually, the
+inline function is entered and exited. This means that addressable
+versions of such functions must be available. If all your uses of a
+function are expanded inline, this may mean an additional expansion of
+code size. If you use @samp{extern inline} in your C code, an
+addressable version of such functions must be provided. (This is
+normally the case anyways, but if you get lucky and the optimizer always
+expands the functions inline, you might have gotten away without
+providing static copies.)
+
+A function may be given the attribute @code{no_instrument_function}, in
+which case this instrumentation will not be done. This can be used, for
+example, for the profiling functions listed above, high-priority
+interrupt routines, and any functions from which the profiling functions
+cannot safely be called (perhaps signal handlers, if the profiling
+routines generate output or allocate memory).
+
@item -fstack-check
Generate code to verify that you do not go beyond the boundary of the
stack. You should specify this flag if you are running in an
@@ -5764,32 +5930,6 @@ environment with multiple threads, but only rarely need to specify it in
a single-threaded environment since stack overflow is automatically
detected on nearly all systems if there is only one stack.
-@item -fexceptions
-Enable exception handling. For some targets, this implies
-generation of frame unwind information for all functions, which can produce
-significant data size overhead, though it does not affect execution.
-
-This option is on by default for languages that support exception
-handling (such as C++), and off for those that don't (such as C).
-
-@item +e0
-@itemx +e1
-Control whether virtual function definitions in classes are used to
-generate code, or only to define interfaces for their callers. (C++
-only).
-
-These options are provided for compatibility with @code{cfront} 1.x
-usage; the recommended alternative GNU C++ usage is in flux. @xref{C++
-Interface,,Declarations and Definitions in One Header}.
-
-With @samp{+e0}, virtual function definitions in classes are declared
-@code{extern}; the declaration is used only as an interface
-specification, not to generate code for the virtual functions (in this
-compilation).
-
-With @samp{+e1}, G++ actually generates the code implementing virtual
-functions defined in the code, and makes them publicly visible.
-
@cindex aliasing of parameters
@cindex parameters, aliased
@item -fargument-alias
@@ -5814,8 +5954,9 @@ the language standard. You should not need to use these options yourself.
@cindex environment variables
This section describes several environment variables that affect how GNU
-CC operates. They work by specifying directories or prefixes to use
-when searching for various kinds of files.
+CC operates. Some of them work by specifying directories or prefixes to use
+when searching for various kinds of files. Some are used to specify other
+aspects of the compilation environment.
@ifclear INTERNALS
Note that you can also specify places to search using options such as
@@ -5915,6 +6056,28 @@ which case the Make rules are written to that file, guessing the target
name from the source file name. Or the value can have the form
@samp{@var{file} @var{target}}, in which case the rules are written to
file @var{file} using @var{target} as the target name.
+
+@item LANG
+@findex LANG
+@cindex locale definition
+This variable is used to pass locale information to the compiler. One way in
+which this information is used is to determine the character set to be used
+when character literals, string literals and comments are parsed in C and C++.
+When the compiler is configured to allow multibyte characters,
+the following values for @code{LANG} are recognized:
+
+@table @code
+@item C-JIS
+Recognize JIS characters.
+@item C-SJIS
+Recognize SJIS characters.
+@item C-EUCJP
+Recognize EUCJP characters.
+@end table
+
+If @code{LANG} is not defined, or if it has some other value, then the
+compiler will use mblen and mbtowc as defined by the default locale to
+recognize and translate multibyte characters.
@end table
@node Running Protoize
diff --git a/gcc/jump.c b/gcc/jump.c
index 49c07fcb39e..967981aef44 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -63,6 +63,7 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "real.h"
#include "except.h"
+#include "toplev.h"
/* ??? Eventually must record somehow the labels used by jumps
from nested functions. */
@@ -118,7 +119,9 @@ static void delete_from_jump_chain PROTO((rtx));
static int delete_labelref_insn PROTO((rtx, rtx, int));
static void mark_modified_reg PROTO((rtx, rtx));
static void redirect_tablejump PROTO((rtx, rtx));
+#ifndef HAVE_cc0
static rtx find_insert_position PROTO((rtx, rtx));
+#endif
/* Delete no-op jumps and optimize jumps to jumps
and jumps around jumps.
@@ -148,6 +151,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
{
register rtx insn, next, note;
int changed;
+ int old_max_reg;
int first = 1;
int max_uid = 0;
rtx last_insn;
@@ -297,6 +301,9 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* Zero the "deleted" flag of all the "deleted" insns. */
for (insn = f; insn; insn = NEXT_INSN (insn))
INSN_DELETED_P (insn) = 0;
+
+ /* Show that the jump chain is not valid. */
+ jump_chain = 0;
return;
}
@@ -395,9 +402,14 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
if (GET_CODE (p) != INSN)
break;
pbody = PATTERN (p);
- if (GET_CODE (pbody) == SET)
+ if (GET_CODE (pbody) != SET)
break;
dest = SET_DEST (pbody);
+ /* Allow a no-op move between the adjust and the push. */
+ if (GET_CODE (dest) == REG
+ && GET_CODE (SET_SRC (pbody)) == REG
+ && REGNO (dest) == REGNO (SET_SRC (pbody)))
+ continue;
if (! (GET_CODE (dest) == MEM
&& GET_CODE (XEXP (dest, 0)) == POST_INC
&& XEXP (XEXP (dest, 0), 0) == stack_pointer_rtx))
@@ -468,12 +480,9 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
remove_death (dreg, trial);
break;
}
-#ifdef PRESERVE_DEATH_INFO_REGNO_P
- /* Deleting insn could lose a death-note for SREG
- so don't do it if final needs accurate
- death-notes. */
- if (PRESERVE_DEATH_INFO_REGNO_P (sreg)
- && (trial = find_regno_note (insn, REG_DEAD, sreg)))
+
+ /* Deleting insn could lose a death-note for SREG. */
+ if ((trial = find_regno_note (insn, REG_DEAD, sreg)))
{
/* Change this into a USE so that we won't emit
code for it, but still can keep the note. */
@@ -485,7 +494,6 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
XEXP (trial, 1) = NULL_RTX;
}
else
-#endif
delete_insn (insn);
}
}
@@ -585,6 +593,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* Now iterate optimizing jumps until nothing changes over one pass. */
changed = 1;
+ old_max_reg = max_reg_num ();
while (changed)
{
changed = 0;
@@ -594,8 +603,9 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
rtx reallabelprev;
rtx temp, temp1, temp2, temp3, temp4, temp5, temp6;
rtx nlabel;
- int this_is_simplejump, this_is_condjump, reversep;
+ int this_is_simplejump, this_is_condjump, reversep = 0;
int this_is_condjump_in_parallel;
+
#if 0
/* If NOT the first iteration, if this is the last jump pass
(just before final), do the special peephole optimizations.
@@ -769,11 +779,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& GET_CODE (temp2) == INSN
&& (temp4 = single_set (temp2)) != 0
&& rtx_equal_p (SET_DEST (temp4), temp1)
- && (GET_CODE (SET_SRC (temp4)) == REG
- || GET_CODE (SET_SRC (temp4)) == SUBREG
- || (GET_CODE (SET_SRC (temp4)) == MEM
- && RTX_UNCHANGING_P (SET_SRC (temp4)))
- || CONSTANT_P (SET_SRC (temp4)))
+ && ! side_effects_p (SET_SRC (temp4))
+ && ! may_trap_p (SET_SRC (temp4))
&& (REG_NOTES (temp2) == 0
|| ((REG_NOTE_KIND (REG_NOTES (temp2)) == REG_EQUAL
|| REG_NOTE_KIND (REG_NOTES (temp2)) == REG_EQUIV)
@@ -844,7 +851,11 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& ! reg_referenced_between_p (temp1, p, NEXT_INSN (temp3))
&& ! reg_set_between_p (temp1, p, temp3)
&& (GET_CODE (SET_SRC (temp4)) == CONST_INT
- || ! reg_set_between_p (SET_SRC (temp4), p, temp2)))
+ || ! modified_between_p (SET_SRC (temp4), p, temp2))
+ /* Verify that registers used by the jump are not clobbered
+ by the instruction being moved. */
+ && ! modified_between_p (PATTERN (temp), temp2,
+ NEXT_INSN (temp2)))
{
emit_insn_after_with_line_notes (PATTERN (temp2), p, temp2);
delete_insn (temp2);
@@ -910,11 +921,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& GET_CODE (temp3) == INSN
&& (temp4 = single_set (temp3)) != 0
&& rtx_equal_p (SET_DEST (temp4), temp1)
- && (GET_CODE (SET_SRC (temp4)) == REG
- || GET_CODE (SET_SRC (temp4)) == SUBREG
- || (GET_CODE (SET_SRC (temp4)) == MEM
- && RTX_UNCHANGING_P (SET_SRC (temp4)))
- || CONSTANT_P (SET_SRC (temp4)))
+ && ! side_effects_p (SET_SRC (temp4))
+ && ! may_trap_p (SET_SRC (temp4))
&& (REG_NOTES (temp3) == 0
|| ((REG_NOTE_KIND (REG_NOTES (temp3)) == REG_EQUAL
|| REG_NOTE_KIND (REG_NOTES (temp3)) == REG_EQUIV)
@@ -944,9 +952,11 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& ! reg_referenced_between_p (temp1, temp3,
NEXT_INSN (temp2))
&& ! reg_set_between_p (temp1, insert_after, temp)
- && (GET_CODE (SET_SRC (temp4)) == CONST_INT
- || ! reg_set_between_p (SET_SRC (temp4),
- insert_after, temp))
+ && ! modified_between_p (SET_SRC (temp4), insert_after, temp)
+ /* Verify that registers used by the jump are not clobbered
+ by the instruction being moved. */
+ && ! modified_between_p (PATTERN (temp), temp3,
+ NEXT_INSN (temp3))
&& invert_jump (temp, JUMP_LABEL (insn)))
{
emit_insn_after_with_line_notes (PATTERN (temp3),
@@ -977,7 +987,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
We set:
TEMP to the "x = exp;" insn.
- TEMP1 to the single set in the "x = exp; insn.
+ TEMP1 to the single set in the "x = exp;" insn.
TEMP2 to "x". */
if (! reload_completed
@@ -992,7 +1002,6 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& JUMP_LABEL (temp2) == JUMP_LABEL (insn)))
&& (temp1 = single_set (temp)) != 0
&& (temp2 = SET_DEST (temp1), GET_CODE (temp2) == REG)
- && GET_MODE_CLASS (GET_MODE (temp2)) == MODE_INT
&& (! SMALL_REGISTER_CLASSES
|| REGNO (temp2) >= FIRST_PSEUDO_REGISTER)
&& GET_CODE (SET_SRC (temp1)) != REG
@@ -1012,6 +1021,12 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
PREV_INSN (temp3), temp);
delete_insn (temp);
reallabelprev = prev_active_insn (JUMP_LABEL (insn));
+
+ if (after_regscan)
+ {
+ reg_scan_update (temp3, NEXT_INSN (next), old_max_reg);
+ old_max_reg = max_reg_num ();
+ }
}
}
@@ -1064,6 +1079,12 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
delete_insn (temp);
delete_insn (temp3);
reallabelprev = prev_active_insn (JUMP_LABEL (insn));
+
+ if (after_regscan)
+ {
+ reg_scan_update (temp6, NEXT_INSN (next), old_max_reg);
+ old_max_reg = max_reg_num ();
+ }
}
}
@@ -1124,6 +1145,12 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
delete_insn (temp);
delete_insn (temp3);
reallabelprev = prev_active_insn (JUMP_LABEL (insn));
+
+ if (after_regscan)
+ {
+ reg_scan_update (temp6, NEXT_INSN (next), old_max_reg);
+ old_max_reg = max_reg_num ();
+ }
}
}
#endif /* HAVE_cc0 */
@@ -1159,11 +1186,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
&& GET_CODE (temp1 = SET_DEST (PATTERN (temp))) == REG
&& (! SMALL_REGISTER_CLASSES
|| REGNO (temp1) >= FIRST_PSEUDO_REGISTER)
- && (GET_CODE (temp2 = SET_SRC (PATTERN (temp))) == REG
- || (GET_CODE (temp2) == MEM && RTX_UNCHANGING_P (temp2))
- || GET_CODE (temp2) == SUBREG
- /* ??? How about floating point constants? */
- || CONSTANT_P (temp2))
+ && ! side_effects_p (temp2 = SET_SRC (PATTERN (temp)))
+ && ! may_trap_p (temp2)
/* Allow either form, but prefer the former if both apply.
There is no point in using the old value of TEMP1 if
it is a register, since cse will alias them. It can
@@ -1238,7 +1262,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
if (target)
{
- rtx seq1,seq2;
+ rtx seq1,seq2,last;
/* Save the conditional move sequence but don't emit it
yet. On some machines, like the alpha, it is possible
@@ -1260,13 +1284,20 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
emit_insns_before (seq1, temp5);
/* Insert conditional move after insn, to be sure that
the jump and a possible compare won't be separated */
- emit_insns_after (seq2, insn);
+ last = emit_insns_after (seq2, insn);
/* ??? We can also delete the insn that sets X to A.
Flow will do it too though. */
delete_insn (temp);
next = NEXT_INSN (insn);
delete_jump (insn);
+
+ if (after_regscan)
+ {
+ reg_scan_update (seq1, NEXT_INSN (last), old_max_reg);
+ old_max_reg = max_reg_num ();
+ }
+
changed = 1;
continue;
}
@@ -1305,11 +1336,13 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* Check that the mask is a power of two,
so that it can probably be generated
with a shift. */
+ && GET_CODE (temp3) == CONST_INT
&& exact_log2 (INTVAL (temp3)) >= 0))
&& (reversep = 0, temp2 == const0_rtx))
|| ((BRANCH_COST >= 2
|| STORE_FLAG_VALUE == -1
|| (STORE_FLAG_VALUE == 1
+ && GET_CODE (temp2) == CONST_INT
&& exact_log2 (INTVAL (temp2)) >= 0))
&& temp3 == const0_rtx
&& (reversep = can_reverse_comparison_p (temp4, insn)))
@@ -1447,6 +1480,13 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
delete_insn (temp);
next = NEXT_INSN (insn);
delete_jump (insn);
+
+ if (after_regscan)
+ {
+ reg_scan_update (seq, NEXT_INSN (next), old_max_reg);
+ old_max_reg = max_reg_num ();
+ }
+
changed = 1;
continue;
}
@@ -1566,6 +1606,13 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
delete_insn (prev_nonnote_insn (insn));
#endif
delete_insn (insn);
+
+ if (after_regscan)
+ {
+ reg_scan_update (seq, NEXT_INSN (next), old_max_reg);
+ old_max_reg = max_reg_num ();
+ }
+
changed = 1;
continue;
}
@@ -1897,6 +1944,80 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
continue;
}
}
+#ifdef HAVE_trap
+ /* Detect a conditional jump jumping over an unconditional trap. */
+ else if (HAVE_trap
+ && this_is_condjump && ! this_is_simplejump
+ && reallabelprev != 0
+ && GET_CODE (reallabelprev) == INSN
+ && GET_CODE (PATTERN (reallabelprev)) == TRAP_IF
+ && TRAP_CONDITION (PATTERN (reallabelprev)) == const_true_rtx
+ && prev_active_insn (reallabelprev) == insn
+ && no_labels_between_p (insn, reallabelprev)
+ && (temp2 = get_condition (insn, &temp4))
+ && can_reverse_comparison_p (temp2, insn))
+ {
+ rtx new = gen_cond_trap (reverse_condition (GET_CODE (temp2)),
+ XEXP (temp2, 0), XEXP (temp2, 1),
+ TRAP_CODE (PATTERN (reallabelprev)));
+
+ if (new)
+ {
+ emit_insn_before (new, temp4);
+ delete_insn (reallabelprev);
+ delete_jump (insn);
+ changed = 1;
+ continue;
+ }
+ }
+ /* Detect a jump jumping to an unconditional trap. */
+ else if (HAVE_trap && this_is_condjump
+ && (temp = next_active_insn (JUMP_LABEL (insn)))
+ && GET_CODE (temp) == INSN
+ && GET_CODE (PATTERN (temp)) == TRAP_IF
+ && (this_is_simplejump
+ || (temp2 = get_condition (insn, &temp4))))
+ {
+ rtx tc = TRAP_CONDITION (PATTERN (temp));
+
+ if (tc == const_true_rtx
+ || (! this_is_simplejump && rtx_equal_p (temp2, tc)))
+ {
+ rtx new;
+ /* Replace an unconditional jump to a trap with a trap. */
+ if (this_is_simplejump)
+ {
+ emit_barrier_after (emit_insn_before (gen_trap (), insn));
+ delete_jump (insn);
+ changed = 1;
+ continue;
+ }
+ new = gen_cond_trap (GET_CODE (temp2), XEXP (temp2, 0),
+ XEXP (temp2, 1),
+ TRAP_CODE (PATTERN (temp)));
+ if (new)
+ {
+ emit_insn_before (new, temp4);
+ delete_jump (insn);
+ changed = 1;
+ continue;
+ }
+ }
+ /* If the trap condition and jump condition are mutually
+ exclusive, redirect the jump to the following insn. */
+ else if (GET_RTX_CLASS (GET_CODE (tc)) == '<'
+ && ! this_is_simplejump
+ && swap_condition (GET_CODE (temp2)) == GET_CODE (tc)
+ && rtx_equal_p (XEXP (tc, 0), XEXP (temp2, 0))
+ && rtx_equal_p (XEXP (tc, 1), XEXP (temp2, 1))
+ && redirect_jump (insn, get_label_after (temp)))
+ {
+ changed = 1;
+ continue;
+ }
+ }
+#endif
+
/* Detect a conditional jump jumping over an unconditional jump. */
else if ((this_is_condjump || this_is_condjump_in_parallel)
@@ -2309,7 +2430,11 @@ duplicate_loop_exit_test (loop_start)
has a REG_RETVAL or REG_LIBCALL note (hard to adjust)
is a NOTE_INSN_LOOP_BEG because this means we have a nested loop
is a NOTE_INSN_BLOCK_{BEG,END} because duplicating these notes
- are not valid
+ is not valid.
+
+ We also do not do this if we find an insn with ASM_OPERANDS. While
+ this restriction should not be necessary, copying an insn with
+ ASM_OPERANDS can confuse asm_noperands in some cases.
Also, don't do this if the exit code is more than 20 insns. */
@@ -2335,16 +2460,29 @@ duplicate_loop_exit_test (loop_start)
This can be avoided by checking here for NOTE_INSN_LOOP_CONT. */
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT)
return 0;
+
+ if (optimize < 2
+ && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
+ /* If we were to duplicate this code, we would not move
+ the BLOCK notes, and so debugging the moved code would
+ be difficult. Thus, we only move the code with -O2 or
+ higher. */
+ return 0;
+
break;
case JUMP_INSN:
case INSN:
+ /* The code below would grossly mishandle REG_WAS_0 notes,
+ so get rid of them here. */
+ while ((p = find_reg_note (insn, REG_WAS_0, NULL_RTX)) != 0)
+ remove_note (insn, p);
if (++num_insns > 20
|| find_reg_note (insn, REG_RETVAL, NULL_RTX)
- || find_reg_note (insn, REG_LIBCALL, NULL_RTX))
+ || find_reg_note (insn, REG_LIBCALL, NULL_RTX)
+ || asm_noperands (PATTERN (insn)) > 0)
return 0;
break;
default:
@@ -4103,7 +4241,15 @@ delete_labelref_insn (insn, label, delete_this)
/* Like rtx_equal_p except that it considers two REGs as equal
if they renumber to the same value and considers two commutative
operations to be the same if the order of the operands has been
- reversed. */
+ reversed.
+
+ ??? Addition is not commutative on the PA due to the weird implicit
+ space register selection rules for memory addresses. Therefore, we
+ don't consider a + b == b + a.
+
+ We could/should make this test a little tighter. Possibly only
+ disabling it on the PA via some backend macro or only disabling this
+ case when the PLUS is inside a MEM. */
int
rtx_renumbered_equal_p (x, y)
@@ -4211,8 +4357,11 @@ rtx_renumbered_equal_p (x, y)
return 0;
/* For commutative operations, the RTX match if the operand match in any
- order. Also handle the simple binary and unary cases without a loop. */
- if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
+ order. Also handle the simple binary and unary cases without a loop.
+
+ ??? Don't consider PLUS a commutative operator; see comments above. */
+ if ((code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
+ && code != PLUS)
return ((rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 0))
&& rtx_renumbered_equal_p (XEXP (x, 1), XEXP (y, 1)))
|| (rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 1))
@@ -4347,7 +4496,7 @@ static int modified_mem;
static void
mark_modified_reg (dest, x)
rtx dest;
- rtx x;
+ rtx x ATTRIBUTE_UNUSED;
{
int regno, i;
@@ -4524,6 +4673,7 @@ thread_jumps (f, max_reg, flag_before_loop)
rtx prev = PREV_INSN (new_label);
if (flag_before_loop
+ && GET_CODE (prev) == NOTE
&& NOTE_LINE_NUMBER (prev) == NOTE_INSN_LOOP_BEG)
{
/* Don't thread to the loop label. If a loop
@@ -4739,6 +4889,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
}
+#ifndef HAVE_cc0
/* Return the insn that NEW can be safely inserted in front of starting at
the jump insn INSN. Return 0 if it is not safe to do this jump
optimization. Note that NEW must contain a single set. */
@@ -4779,3 +4930,4 @@ find_insert_position (insn, new)
return reg_mentioned_p (SET_DEST (single_set (new)), prev) ? 0 : prev;
}
+#endif /* !HAVE_cc0 */
diff --git a/gcc/libgcc1-test.c b/gcc/libgcc1-test.c
index 977b9c76188..d9c250e99d0 100644
--- a/gcc/libgcc1-test.c
+++ b/gcc/libgcc1-test.c
@@ -97,6 +97,9 @@ extern void start() __asm__("start");
extern void _start() __asm__("_start");
extern void __start() __asm__("__start");
+/* Provide functions that might be needed by soft-float emulation routines. */
+void memcpy() {}
+
void start() {}
void _start() {}
void __start() {}
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 8a913deb851..586aa2c7a6d 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -1405,7 +1405,7 @@ __builtin_saveregs ()
/* This is used by the `assert' macro. */
void
__eprintf (const char *string, const char *expression,
- int line, const char *filename)
+ unsigned int line, const char *filename)
{
fprintf (stderr, string, expression, line, filename);
fflush (stderr);
@@ -2157,7 +2157,7 @@ __bb_init_prg ()
bb_hashbuckets = (struct bb_edge **)
malloc (BB_BUCKETS * sizeof (struct bb_edge *));
if (bb_hashbuckets)
- bzero ((char *) bb_hashbuckets, BB_BUCKETS);
+ memset (bb_hashbuckets, 0, BB_BUCKETS * sizeof (struct bb_edge *));
}
if (bb_mode & 12)
@@ -3003,9 +3003,17 @@ exit (int status)
_exit (status);
}
-#else
+#else /* ON_EXIT defined */
int _exit_dummy_decl = 0; /* prevent compiler & linker warnings */
-#endif
+
+# ifndef HAVE_ATEXIT
+/* Provide a fake for atexit() using ON_EXIT. */
+int atexit (func_ptr func)
+{
+ return ON_EXIT (func, NULL);
+}
+# endif /* HAVE_ATEXIT */
+#endif /* ON_EXIT defined */
#endif /* L_exit */
@@ -3046,14 +3054,13 @@ __empty ()
{
}
-/* EH context structure. */
-struct eh_context
-{
- void **dynamic_handler_chain;
- /* This is language dependent part of the eh context. */
- void *info;
-};
+/* Include definitions of EH context and table layout */
+
+#include "eh-common.h"
+#ifndef inhibit_libc
+#include <stdio.h>
+#endif
/* This is a safeguard for dynamic handler chain. */
@@ -3351,6 +3358,26 @@ __sjpopnthrow ()
/* Support code for all exception region-based exception handling. */
+int
+__eh_rtime_match (void *rtime)
+{
+ void *info;
+ __eh_matcher matcher;
+ void *ret;
+
+ info = *(__get_eh_info ());
+ matcher = ((__eh_info *)info)->match_function;
+ if (! matcher)
+ {
+#ifndef inhibit_libc
+ fprintf (stderr, "Internal Compiler Bug: No runtime type matcher.");
+#endif
+ return 0;
+ }
+ ret = (*matcher) (info, rtime, (void *)0);
+ return (ret != NULL);
+}
+
/* This value identifies the place from which an exception is being
thrown. */
@@ -3360,11 +3387,24 @@ EH_TABLE_LOOKUP
#else
-typedef struct exception_table {
- void *start;
- void *end;
- void *exception_handler;
-} exception_table;
+#ifdef DWARF2_UNWIND_INFO
+
+
+/* Return the table version of an exception descriptor */
+
+short
+__get_eh_table_version (exception_descriptor *table)
+{
+ return table->lang.version;
+}
+
+/* Return the originating table language of an exception descriptor */
+
+short
+__get_eh_table_language (exception_descriptor *table)
+{
+ return table->lang.language;
+}
/* This routine takes a PC and a pointer to the exception region TABLE for
its translation unit, and returns the address of the exception handler
@@ -3375,7 +3415,7 @@ typedef struct exception_table {
an inner block. */
static void *
-find_exception_handler (void *pc, exception_table *table)
+old_find_exception_handler (void *pc, old_exception_table *table)
{
if (table)
{
@@ -3383,27 +3423,69 @@ find_exception_handler (void *pc, exception_table *table)
int best = -1;
/* We can't do a binary search because the table isn't guaranteed
- to be sorted from function to function. */
- for (pos = 0; table[pos].exception_handler != (void *) -1; ++pos)
- {
- if (table[pos].start <= pc && table[pos].end > pc)
- {
- /* This can apply. Make sure it is at least as small as
- the previous best. */
- if (best == -1 || (table[pos].end <= table[best].end
- && table[pos].start >= table[best].start))
- best = pos;
- }
- /* But it is sorted by starting PC within a function. */
- else if (best >= 0 && table[pos].start > pc)
- break;
- }
+ to be sorted from function to function. */
+ for (pos = 0; table[pos].start_region != (void *) -1; ++pos)
+ {
+ if (table[pos].start_region <= pc && table[pos].end_region > pc)
+ {
+ /* This can apply. Make sure it is at least as small as
+ the previous best. */
+ if (best == -1 || (table[pos].end_region <= table[best].end_region
+ && table[pos].start_region >= table[best].start_region))
+ best = pos;
+ }
+ /* But it is sorted by starting PC within a function. */
+ else if (best >= 0 && table[pos].start_region > pc)
+ break;
+ }
if (best != -1)
- return table[best].exception_handler;
+ return table[best].exception_handler;
}
return (void *) 0;
}
+
+static void *
+find_exception_handler (void *pc, exception_descriptor *table, void *eh_info)
+{
+ if (table)
+ {
+ /* The new model assumed the table is sorted inner-most out so the
+ first region we find which matches is the correct one */
+
+ int pos;
+ void *ret;
+ exception_table *tab = &(table->table[0]);
+
+ /* Subtract 1 from the PC to avoid hitting the next region */
+ pc--;
+
+ /* We can't do a binary search because the table is in inner-most
+ to outermost address ranges within functions */
+ for (pos = 0; tab[pos].start_region != (void *) -1; pos++)
+ {
+ if (tab[pos].start_region <= pc && tab[pos].end_region > pc)
+ {
+ if (tab[pos].match_info)
+ {
+ __eh_matcher matcher = ((__eh_info *)eh_info)->match_function;
+ /* match info but no matcher is NOT a match */
+ if (matcher)
+ {
+ ret = (*matcher)(eh_info, tab[pos].match_info, table);
+ if (ret)
+ return tab[pos].exception_handler;
+ }
+ }
+ else
+ return tab[pos].exception_handler;
+ }
+ }
+ }
+
+ return (void *) 0;
+}
+#endif /* DWARF2_UNWIND_INFO */
#endif /* EH_TABLE_LOOKUP */
#ifdef DWARF2_UNWIND_INFO
@@ -3418,31 +3500,71 @@ find_exception_handler (void *pc, exception_table *table)
typedef int ptr_type __attribute__ ((mode (pointer)));
-/* Get the value of register REG as saved in UDATA, where SUB_UDATA is a
+#ifdef INCOMING_REGNO
+/* Is the saved value for register REG in frame UDATA stored in a register
+ window in the previous frame? */
+
+/* ??? The Sparc INCOMING_REGNO references TARGET_FLAT. This allows us
+ to use the macro here. One wonders, though, that perhaps TARGET_FLAT
+ compiled functions won't work with the frame-unwind stuff here.
+ Perhaps the entireity of in_reg_window should be conditional on having
+ seen a DW_CFA_GNU_window_save? */
+#define target_flags 0
+
+static int
+in_reg_window (int reg, frame_state *udata)
+{
+ if (udata->saved[reg] == REG_SAVED_REG)
+ return INCOMING_REGNO (reg) == reg;
+ if (udata->saved[reg] != REG_SAVED_OFFSET)
+ return 0;
+
+#ifdef STACK_GROWS_DOWNWARD
+ return udata->reg_or_offset[reg] > 0;
+#else
+ return udata->reg_or_offset[reg] < 0;
+#endif
+}
+#else
+static inline int in_reg_window (int reg, frame_state *udata) { return 0; }
+#endif /* INCOMING_REGNO */
+
+/* Get the address of register REG as saved in UDATA, where SUB_UDATA is a
frame called by UDATA or 0. */
-static void*
-get_reg (unsigned reg, frame_state *udata, frame_state *sub_udata)
+static word_type *
+get_reg_addr (unsigned reg, frame_state *udata, frame_state *sub_udata)
{
+ while (udata->saved[reg] == REG_SAVED_REG)
+ {
+ reg = udata->reg_or_offset[reg];
+ if (in_reg_window (reg, udata))
+ {
+ udata = sub_udata;
+ sub_udata = NULL;
+ }
+ }
if (udata->saved[reg] == REG_SAVED_OFFSET)
- return (void *)(ptr_type)
- *(word_type *)(udata->cfa + udata->reg_or_offset[reg]);
- else if (udata->saved[reg] == REG_SAVED_REG && sub_udata)
- return get_reg (udata->reg_or_offset[reg], sub_udata, 0);
+ return (word_type *)(udata->cfa + udata->reg_or_offset[reg]);
else
abort ();
}
+/* Get the value of register REG as saved in UDATA, where SUB_UDATA is a
+ frame called by UDATA or 0. */
+
+static inline void *
+get_reg (unsigned reg, frame_state *udata, frame_state *sub_udata)
+{
+ return (void *)(ptr_type) *get_reg_addr (reg, udata, sub_udata);
+}
+
/* Overwrite the saved value for register REG in frame UDATA with VAL. */
-static void
+static inline void
put_reg (unsigned reg, void *val, frame_state *udata)
{
- if (udata->saved[reg] == REG_SAVED_OFFSET)
- *(word_type *)(udata->cfa + udata->reg_or_offset[reg])
- = (word_type)(ptr_type) val;
- else
- abort ();
+ *get_reg_addr (reg, udata, NULL) = (word_type)(ptr_type) val;
}
/* Copy the saved value for register REG from frame UDATA to frame
@@ -3452,17 +3574,13 @@ put_reg (unsigned reg, void *val, frame_state *udata)
static void
copy_reg (unsigned reg, frame_state *udata, frame_state *target_udata)
{
- if (udata->saved[reg] == REG_SAVED_OFFSET
- && target_udata->saved[reg] == REG_SAVED_OFFSET)
- memcpy (target_udata->cfa + target_udata->reg_or_offset[reg],
- udata->cfa + udata->reg_or_offset[reg],
- __builtin_dwarf_reg_size (reg));
- else
- abort ();
+ word_type *preg = get_reg_addr (reg, udata, NULL);
+ word_type *ptreg = get_reg_addr (reg, target_udata, NULL);
+
+ memcpy (ptreg, preg, __builtin_dwarf_reg_size (reg));
}
-/* Retrieve the return address for frame UDATA, where SUB_UDATA is a
- frame called by UDATA or 0. */
+/* Retrieve the return address for frame UDATA. */
static inline void *
get_return_addr (frame_state *udata, frame_state *sub_udata)
@@ -3502,24 +3620,6 @@ next_stack_level (void *pc, frame_state *udata, frame_state *caller_udata)
return caller_udata;
}
-#ifdef INCOMING_REGNO
-/* Is the saved value for register REG in frame UDATA stored in a register
- window in the previous frame? */
-
-static int
-in_reg_window (int reg, frame_state *udata)
-{
- if (udata->saved[reg] != REG_SAVED_OFFSET)
- return 0;
-
-#ifdef STACK_GROWS_DOWNWARD
- return udata->reg_or_offset[reg] > 0;
-#else
- return udata->reg_or_offset[reg] < 0;
-#endif
-}
-#endif /* INCOMING_REGNO */
-
/* We first search for an exception handler, and if we don't find
it, we call __terminate on the current stack frame so that we may
use the debugger to walk the stack and understand why no handler
@@ -3532,12 +3632,13 @@ void
__throw ()
{
struct eh_context *eh = (*get_eh_context) ();
- void *saved_pc, *pc, *handler, *retaddr;
+ void *saved_pc, *pc, *handler;
frame_state ustruct, ustruct2;
frame_state *udata = &ustruct;
frame_state *sub_udata = &ustruct2;
frame_state my_ustruct, *my_udata = &my_ustruct;
long args_size;
+ int new_exception_model;
/* This is required for C++ semantics. We must call terminate if we
try and rethrow an exception, when there is no exception currently
@@ -3551,14 +3652,8 @@ label:
if (! udata)
__terminate ();
- /* We need to get the value from the CFA register. At this point in
- compiling __throw we don't know whether or not we will use the frame
- pointer register for the CFA, so we check our unwind info. */
- if (udata->cfa_reg == __builtin_dwarf_fp_regnum ())
- udata->cfa = __builtin_fp ();
- else
- udata->cfa = __builtin_sp ();
- udata->cfa += udata->cfa_offset;
+ /* We need to get the value from the CFA register. */
+ udata->cfa = __builtin_dwarf_cfa ();
memcpy (my_udata, udata, sizeof (*udata));
@@ -3581,7 +3676,16 @@ label:
if (! udata)
break;
- handler = find_exception_handler (pc, udata->eh_ptr);
+ if (udata->eh_ptr == NULL)
+ new_exception_model = 0;
+ else
+ new_exception_model = (((exception_descriptor *)(udata->eh_ptr))->
+ runtime_id_field == NEW_EH_RUNTIME);
+
+ if (new_exception_model)
+ handler = find_exception_handler (pc, udata->eh_ptr, eh->info);
+ else
+ handler = old_find_exception_handler (pc, udata->eh_ptr);
/* If we found one, we can stop searching. */
if (handler)
@@ -3600,6 +3704,8 @@ label:
if (! handler)
__terminate ();
+ eh->handler_label = handler;
+
if (pc == saved_pc)
/* We found a handler in the throw context, no need to unwind. */
udata = my_udata;
@@ -3626,7 +3732,6 @@ label:
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
if (i != udata->retaddr_column && udata->saved[i])
{
-#ifdef INCOMING_REGNO
/* If you modify the saved value of the return address
register on the SPARC, you modify the return address for
your caller's frame. Don't do that here, as it will
@@ -3635,14 +3740,12 @@ label:
&& udata->saved[udata->retaddr_column] == REG_SAVED_REG
&& udata->reg_or_offset[udata->retaddr_column] == i)
continue;
-#endif
copy_reg (i, udata, my_udata);
}
pc = get_return_addr (udata, sub_udata) - 1;
}
-#ifdef INCOMING_REGNO
/* But we do need to update the saved return address register from
the last frame we unwind, or the handler frame will have the wrong
return address. */
@@ -3652,29 +3755,17 @@ label:
if (in_reg_window (i, udata))
copy_reg (i, udata, my_udata);
}
-#endif
}
- /* udata now refers to the frame called by the handler frame. */
- /* Emit the stub to adjust sp and jump to the handler. */
- retaddr = __builtin_eh_stub ();
-
- /* And then set our return address to point to the stub. */
- if (my_udata->saved[my_udata->retaddr_column] == REG_SAVED_OFFSET)
- put_return_addr (retaddr, my_udata);
- else
- __builtin_set_return_addr_reg (retaddr);
+ /* Now go! */
- /* Set up the registers we use to communicate with the stub.
- We check STACK_GROWS_DOWNWARD so the stub can use adjust_stack. */
- __builtin_set_eh_regs (handler,
+ __builtin_eh_return ((void *)eh,
#ifdef STACK_GROWS_DOWNWARD
- udata->cfa - my_udata->cfa
+ udata->cfa - my_udata->cfa,
#else
- my_udata->cfa - udata->cfa
+ my_udata->cfa - udata->cfa,
#endif
- + args_size
- );
+ handler);
/* Epilogue: restore the handler frame's register values and return
to the stub. */
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 38c53531986..3bcd4f8e1b1 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -55,8 +55,8 @@ Boston, MA 02111-1307, USA. */
But this is currently disabled since tying in global_alloc is not
yet implemented. */
-/* Pseudos allocated here cannot be reallocated by global.c if the hard
- register is used as a spill register. So we don't allocate such pseudos
+/* Pseudos allocated here can be reallocated by global.c if the hard register
+ is used as a spill register. Currently we don't allocate such pseudos
here if their preferred class is likely to be used by spills. */
#include "config.h"
@@ -67,8 +67,10 @@ Boston, MA 02111-1307, USA. */
#include "regs.h"
#include "hard-reg-set.h"
#include "insn-config.h"
+#include "insn-attr.h"
#include "recog.h"
#include "output.h"
+#include "toplev.h"
/* Next quantity number available for allocation. */
@@ -154,19 +156,14 @@ static int *qty_n_calls_crossed;
static enum reg_class *qty_alternate_class;
-/* Element Q is the SCRATCH expression for which this quantity is being
- allocated or 0 if this quantity is allocating registers. */
-
-static rtx *qty_scratch_rtx;
-
/* Element Q is nonzero if this quantity has been used in a SUBREG
that changes its size. */
static char *qty_changes_size;
/* Element Q is the register number of one pseudo register whose
- reg_qty value is Q, or -1 is this quantity is for a SCRATCH. This
- register should be the head of the chain maintained in reg_next_in_qty. */
+ reg_qty value is Q. This register should be the head of the chain
+ maintained in reg_next_in_qty. */
static int *qty_first_reg;
@@ -225,11 +222,6 @@ static HARD_REG_SET regs_live;
static HARD_REG_SET *regs_live_at;
-int *scratch_block;
-rtx *scratch_list;
-int scratch_list_length;
-static int scratch_index;
-
/* Communicate local vars `insn_number' and `insn'
from `block_alloc' to `reg_is_set', `wipe_dead_reg', and `alloc_qty'. */
static int this_insn_number;
@@ -243,7 +235,6 @@ static rtx this_insn;
static rtx *reg_equiv_replacement;
static void alloc_qty PROTO((int, enum machine_mode, int, int));
-static void alloc_qty_for_scratch PROTO((rtx, int, rtx, int, int));
static void validate_equiv_mem_from_store PROTO((rtx, rtx));
static int validate_equiv_mem PROTO((rtx, rtx, rtx));
static int contains_replace_regs PROTO((rtx, char *));
@@ -295,96 +286,6 @@ alloc_qty (regno, mode, size, birth)
qty_changes_size[qty] = REG_CHANGES_SIZE (regno);
}
-/* Similar to `alloc_qty', but allocates a quantity for a SCRATCH rtx
- used as operand N in INSN. We assume here that the SCRATCH is used in
- a CLOBBER. */
-
-static void
-alloc_qty_for_scratch (scratch, n, insn, insn_code_num, insn_number)
- rtx scratch;
- int n;
- rtx insn;
- int insn_code_num, insn_number;
-{
- register int qty;
- enum reg_class class;
- char *p, c;
- int i;
-
-#ifdef REGISTER_CONSTRAINTS
- /* If we haven't yet computed which alternative will be used, do so now.
- Then set P to the constraints for that alternative. */
- if (which_alternative == -1)
- if (! constrain_operands (insn_code_num, 0))
- return;
-
- for (p = insn_operand_constraint[insn_code_num][n], i = 0;
- *p && i < which_alternative; p++)
- if (*p == ',')
- i++;
-
- /* Compute the class required for this SCRATCH. If we don't need a
- register, the class will remain NO_REGS. If we guessed the alternative
- number incorrectly, reload will fix things up for us. */
-
- class = NO_REGS;
- while ((c = *p++) != '\0' && c != ',')
- switch (c)
- {
- case '=': case '+': case '?':
- case '#': case '&': case '!':
- case '*': case '%':
- case '0': case '1': case '2': case '3': case '4':
- case 'm': case '<': case '>': case 'V': case 'o':
- case 'E': case 'F': case 'G': case 'H':
- case 's': case 'i': case 'n':
- case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P':
-#ifdef EXTRA_CONSTRAINT
- case 'Q': case 'R': case 'S': case 'T': case 'U':
-#endif
- case 'p':
- /* These don't say anything we care about. */
- break;
-
- case 'X':
- /* We don't need to allocate this SCRATCH. */
- return;
-
- case 'g': case 'r':
- class = reg_class_subunion[(int) class][(int) GENERAL_REGS];
- break;
-
- default:
- class
- = reg_class_subunion[(int) class][(int) REG_CLASS_FROM_LETTER (c)];
- break;
- }
-
- if (class == NO_REGS)
- return;
-
-#else /* REGISTER_CONSTRAINTS */
-
- class = GENERAL_REGS;
-#endif
-
-
- qty = next_qty++;
-
- qty_first_reg[qty] = -1;
- qty_scratch_rtx[qty] = scratch;
- qty_size[qty] = GET_MODE_SIZE (GET_MODE (scratch));
- qty_mode[qty] = GET_MODE (scratch);
- qty_birth[qty] = 2 * insn_number - 1;
- qty_death[qty] = 2 * insn_number + 1;
- qty_n_calls_crossed[qty] = 0;
- qty_min_class[qty] = class;
- qty_alternate_class[qty] = NO_REGS;
- qty_n_refs[qty] = 1;
- qty_changes_size[qty] = 0;
-}
-
/* Main entry point of this file. */
void
@@ -405,24 +306,13 @@ local_alloc ()
update_equiv_regs ();
/* This sets the maximum number of quantities we can have. Quantity
- numbers start at zero and we can have one for each pseudo plus the
- number of SCRATCHes in the largest block, in the worst case. */
- max_qty = (max_regno - FIRST_PSEUDO_REGISTER) + max_scratch;
+ numbers start at zero and we can have one for each pseudo. */
+ max_qty = (max_regno - FIRST_PSEUDO_REGISTER);
/* Allocate vectors of temporary data.
See the declarations of these variables, above,
for what they mean. */
- /* There can be up to MAX_SCRATCH * N_BASIC_BLOCKS SCRATCHes to allocate.
- Instead of allocating this much memory from now until the end of
- reload, only allocate space for MAX_QTY SCRATCHes. If there are more
- reload will allocate them. */
-
- scratch_list_length = max_qty;
- scratch_list = (rtx *) xcalloc (scratch_list_length, sizeof (rtx));
- scratch_block = (int *) xcalloc (scratch_list_length, sizeof (int));
- scratch_index = 0;
-
qty_phys_reg = (short *) alloca (max_qty * sizeof (short));
qty_phys_copy_sugg
= (HARD_REG_SET *) alloca (max_qty * sizeof (HARD_REG_SET));
@@ -431,7 +321,6 @@ local_alloc ()
qty_phys_num_sugg = (short *) alloca (max_qty * sizeof (short));
qty_birth = (int *) alloca (max_qty * sizeof (int));
qty_death = (int *) alloca (max_qty * sizeof (int));
- qty_scratch_rtx = (rtx *) alloca (max_qty * sizeof (rtx));
qty_first_reg = (int *) alloca (max_qty * sizeof (int));
qty_size = (int *) alloca (max_qty * sizeof (int));
qty_mode
@@ -489,7 +378,6 @@ local_alloc ()
{
for (i = 0; i < next_qty; i++)
{
- qty_scratch_rtx[i] = 0;
CLEAR_HARD_REG_SET (qty_phys_copy_sugg[i]);
qty_phys_num_copy_sugg[i] = 0;
CLEAR_HARD_REG_SET (qty_phys_sugg[i]);
@@ -501,7 +389,6 @@ local_alloc ()
#define CLEAR(vector) \
bzero ((char *) (vector), (sizeof (*(vector))) * next_qty);
- CLEAR (qty_scratch_rtx);
CLEAR (qty_phys_copy_sugg);
CLEAR (qty_phys_num_copy_sugg);
CLEAR (qty_phys_sugg);
@@ -1025,9 +912,6 @@ block_alloc (b)
int max_uid = get_max_uid ();
int *qty_order;
int no_conflict_combined_regno = -1;
- /* Counter to prevent allocating more SCRATCHes than can be stored
- in SCRATCH_LIST. */
- int scratches_allocated = scratch_index;
/* Count the instructions in the basic block. */
@@ -1281,15 +1165,6 @@ block_alloc (b)
&& GET_CODE (XEXP (link, 0)) == REG)
wipe_dead_reg (XEXP (link, 0), 1);
- /* Allocate quantities for any SCRATCH operands of this insn. */
-
- if (insn_code_number >= 0)
- for (i = 0; i < insn_n_operands[insn_code_number]; i++)
- if (GET_CODE (recog_operand[i]) == SCRATCH
- && scratches_allocated++ < scratch_list_length)
- alloc_qty_for_scratch (recog_operand[i], i, insn,
- insn_code_number, insn_number);
-
/* If this is an insn that has a REG_RETVAL note pointing at a
CLOBBER insn, we have reached the end of a REG_NO_CONFLICT
block, so clear any register number that combined within it. */
@@ -1412,8 +1287,50 @@ block_alloc (b)
q = qty_order[i];
if (qty_phys_reg[q] < 0)
{
+#ifdef INSN_SCHEDULING
+ /* These values represent the adjusted lifetime of a qty so
+ that it conflicts with qtys which appear near the start/end
+ of this qty's lifetime.
+
+ The purpose behind extending the lifetime of this qty is to
+ discourage the register allocator from creating false
+ dependencies.
+
+ The adjustment by the value +-3 indicates precisely that
+ this qty conflicts with qtys in the instructions immediately
+ before and after the lifetime of this qty.
+
+ Experiments have shown that higher values tend to hurt
+ overall code performance.
+
+ If allocation using the extended lifetime fails we will try
+ again with the qty's unadjusted lifetime. */
+ int fake_birth = MAX (0, qty_birth[q] - 3);
+ int fake_death = MIN (insn_number * 2 + 1, qty_death[q] + 3);
+#endif
+
if (N_REG_CLASSES > 1)
{
+#ifdef INSN_SCHEDULING
+ /* We try to avoid using hard registers allocated to qtys which
+ are born immediately after this qty or die immediately before
+ this qty.
+
+ This optimization is only appropriate when we will run
+ a scheduling pass after reload and we are not optimizing
+ for code size. */
+ if (flag_schedule_insns_after_reload
+ && !optimize_size
+ && !SMALL_REGISTER_CLASSES)
+ {
+
+ qty_phys_reg[q] = find_free_reg (qty_min_class[q],
+ qty_mode[q], q, 0, 0,
+ fake_birth, fake_death);
+ if (qty_phys_reg[q] >= 0)
+ continue;
+ }
+#endif
qty_phys_reg[q] = find_free_reg (qty_min_class[q],
qty_mode[q], q, 0, 0,
qty_birth[q], qty_death[q]);
@@ -1421,6 +1338,16 @@ block_alloc (b)
continue;
}
+#ifdef INSN_SCHEDULING
+ /* Similarly, avoid false dependencies. */
+ if (flag_schedule_insns_after_reload
+ && !optimize_size
+ && !SMALL_REGISTER_CLASSES
+ && qty_alternate_class[q] != NO_REGS)
+ qty_phys_reg[q] = find_free_reg (qty_alternate_class[q],
+ qty_mode[q], q, 0, 0,
+ fake_birth, fake_death);
+#endif
if (qty_alternate_class[q] != NO_REGS)
qty_phys_reg[q] = find_free_reg (qty_alternate_class[q],
qty_mode[q], q, 0, 0,
@@ -1436,16 +1363,6 @@ block_alloc (b)
{
for (i = qty_first_reg[q]; i >= 0; i = reg_next_in_qty[i])
reg_renumber[i] = qty_phys_reg[q] + reg_offset[i];
- if (qty_scratch_rtx[q])
- {
- if (GET_CODE (qty_scratch_rtx[q]) == REG)
- abort ();
- qty_scratch_rtx[q] = gen_rtx_REG (GET_MODE (qty_scratch_rtx[q]),
- qty_phys_reg[q]);
- scratch_block[scratch_index] = b;
- scratch_list[scratch_index++] = qty_scratch_rtx[q];
-
- }
}
}
@@ -1987,7 +1904,10 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested,
int regno = i;
#endif
if (! TEST_HARD_REG_BIT (first_used, regno)
- && HARD_REGNO_MODE_OK (regno, mode))
+ && HARD_REGNO_MODE_OK (regno, mode)
+ && (qty_n_calls_crossed[qty] == 0
+ || accept_call_clobbered
+ || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
{
register int j;
register int size1 = HARD_REGNO_NREGS (regno, mode);
diff --git a/gcc/longlong.h b/gcc/longlong.h
index f86f894714d..2c047117d44 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -978,9 +978,11 @@ UDItype __umulsidi3 (USItype, USItype);
: "%g1" __AND_CLOBBER_CC)
#define UDIV_TIME 37
#define count_leading_zeros(count, x) \
- __asm__ ("scan %1,0,%0" \
- : "=r" ((USItype) (x)) \
- : "r" ((USItype) (count)))
+ do { \
+ __asm__ ("scan %1,1,%0" \
+ : "=r" ((USItype) (count)) \
+ : "r" ((USItype) (x))); \
+ } while (0)
#else
/* SPARC without integer multiplication and divide instructions.
(i.e. at least Sun4/20,40,60,65,75,110,260,280,330,360,380,470,490) */
diff --git a/gcc/loop.c b/gcc/loop.c
index f63ce33415f..4529946d1a9 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "loop.h"
#include "except.h"
+#include "toplev.h"
/* Vector mapping INSN_UIDs to luids.
The luids are like uids but increase monotonically always.
@@ -81,26 +82,11 @@ static rtx *loop_number_loop_starts, *loop_number_loop_ends;
int *loop_outer_loop;
-#ifdef HAIFA
-/* The main output of analyze_loop_iterations is placed here */
-
-int *loop_can_insert_bct;
-
-/* For each loop, determines whether some of its inner loops has used
- count register */
+#ifdef HAVE_decrement_and_branch_on_count
+/* Records whether resource in use by inner loop. */
int *loop_used_count_register;
-
-/* loop parameters for arithmetic loops. These loops have a loop variable
- which is initialized to loop_start_value, incremented in each iteration
- by "loop_increment". At the end of the iteration the loop variable is
- compared to the loop_comparison_value (using loop_comparison_code). */
-
-rtx *loop_increment;
-rtx *loop_comparison_value;
-rtx *loop_start_value;
-enum rtx_code *loop_comparison_code;
-#endif /* HAIFA */
+#endif /* HAVE_decrement_and_branch_on_count */
/* For each loop, keep track of its unrolling factor.
Potential values:
@@ -167,18 +153,18 @@ static rtx loop_continue;
Therefore, at all times, == 0 indicates an invariant register;
< 0 a conditionally invariant one. */
-static int *n_times_set;
+static varray_type n_times_set;
/* Original value of n_times_set; same except that this value
is not set negative for a reg whose sets have been made candidates
and not set to 0 for a reg that is moved. */
-static int *n_times_used;
+static varray_type n_times_used;
/* Index by register number, 1 indicates that the register
cannot be moved or strength reduced. */
-static char *may_not_optimize;
+static varray_type may_not_optimize;
/* Nonzero means reg N has already been moved out of one loop.
This reduces the desire to move it out of another. */
@@ -194,6 +180,27 @@ static rtx loop_store_mems[NUM_STORES];
/* Index of first available slot in above array. */
static int loop_store_mems_idx;
+typedef struct loop_mem_info {
+ rtx mem; /* The MEM itself. */
+ rtx reg; /* Corresponding pseudo, if any. */
+ int optimize; /* Nonzero if we can optimize access to this MEM. */
+} loop_mem_info;
+
+/* Array of MEMs that are used (read or written) in this loop, but
+ cannot be aliased by anything in this loop, except perhaps
+ themselves. In other words, if loop_mems[i] is altered during the
+ loop, it is altered by an expression that is rtx_equal_p to it. */
+
+static loop_mem_info *loop_mems;
+
+/* The index of the next available slot in LOOP_MEMS. */
+
+static int loop_mems_idx;
+
+/* The number of elements allocated in LOOP_MEMs. */
+
+static int loop_mems_allocated;
+
/* Nonzero if we don't know what MEMs were changed in the current loop.
This happens if the loop contains a call (in which case `loop_has_call'
will also be set) or if we store into more than NUM_STORES MEMs. */
@@ -226,8 +233,6 @@ extern struct obstack *rtl_obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-
-extern char *oballoc ();
/* During the analysis of a loop, a chain of `struct movable's
is made to record all the movable insns found.
@@ -273,6 +278,8 @@ struct movable
struct movable *next;
};
+static struct movable *the_movables;
+
FILE *loop_dump_stream;
/* Forward declarations. */
@@ -284,12 +291,15 @@ static int reg_in_basic_block_p PROTO((rtx, rtx));
static int consec_sets_invariant_p PROTO((rtx, int, rtx));
static rtx libcall_other_reg PROTO((rtx, rtx));
static int labels_in_range_p PROTO((rtx, int));
-static void count_loop_regs_set PROTO((rtx, rtx, char *, rtx *, int *, int));
+static void count_one_set PROTO((rtx, rtx, varray_type, rtx *));
+
+static void count_loop_regs_set PROTO((rtx, rtx, varray_type, varray_type,
+ int *, int));
static void note_addr_stored PROTO((rtx, rtx));
static int loop_reg_used_before_p PROTO((rtx, rtx, rtx, rtx, rtx));
static void scan_loop PROTO((rtx, rtx, int, int));
#if 0
-static void replace_call_address PROTO(());
+static void replace_call_address PROTO((rtx, rtx, rtx));
#endif
static rtx skip_consec_insns PROTO((rtx, int));
static int libcall_benefit PROTO((rtx));
@@ -301,8 +311,8 @@ static int rtx_equal_for_loop_p PROTO((rtx, rtx, struct movable *));
static void add_label_notes PROTO((rtx, rtx));
static void move_movables PROTO((struct movable *, int, int, rtx, rtx, int));
static int count_nonfixed_reads PROTO((rtx));
-static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, int));
-static void find_single_use_in_loop PROTO((rtx, rtx, rtx *));
+static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, int, int));
+static void find_single_use_in_loop PROTO((rtx, rtx, varray_type));
static int valid_initial_value_p PROTO((rtx, rtx, int, rtx));
static void find_mem_givs PROTO((rtx, rtx, int, rtx, rtx));
static void record_biv PROTO((struct induction *, rtx, rtx, rtx, rtx, int, int));
@@ -311,16 +321,12 @@ static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, int,
static void update_giv_derive PROTO((rtx));
static int basic_induction_var PROTO((rtx, enum machine_mode, rtx, rtx, rtx *, rtx *));
static rtx simplify_giv_expr PROTO((rtx, int *));
-static int general_induction_var PROTO((rtx, rtx *, rtx *, rtx *));
+static int general_induction_var PROTO((rtx, rtx *, rtx *, rtx *, int, int *));
static int consec_sets_giv PROTO((int, rtx, rtx, rtx, rtx *, rtx *));
static int check_dbra_loop PROTO((rtx, int, rtx));
-#ifdef ADDRESS_COST
+static rtx express_from_1 PROTO((rtx, rtx, rtx));
static rtx express_from PROTO((struct induction *, struct induction *));
-#endif
-static int combine_givs_p PROTO((struct induction *, struct induction *));
-#ifdef GIV_SORT_CRITERION
-static int giv_sort PROTO((struct induction **, struct induction **));
-#endif
+static rtx combine_givs_p PROTO((struct induction *, struct induction *));
static void combine_givs PROTO((struct iv_class *));
static int product_cheap_p PROTO((rtx, rtx));
static int maybe_eliminate_biv PROTO((struct iv_class *, rtx, rtx, int, int, int));
@@ -328,21 +334,38 @@ static int maybe_eliminate_biv_1 PROTO((rtx, rtx, struct iv_class *, int, rtx));
static int last_use_this_basic_block PROTO((rtx, rtx));
static void record_initial PROTO((rtx, rtx));
static void update_reg_last_use PROTO((rtx, rtx));
+static rtx next_insn_in_loop PROTO((rtx, rtx, rtx, rtx));
+static void load_mems_and_recount_loop_regs_set PROTO((rtx, rtx, rtx,
+ rtx, varray_type,
+ int *));
+static void load_mems PROTO((rtx, rtx, rtx, rtx));
+static int insert_loop_mem PROTO((rtx *, void *));
+static int replace_loop_mem PROTO((rtx *, void *));
+static int replace_label PROTO((rtx *, void *));
+
+typedef struct rtx_and_int {
+ rtx r;
+ int i;
+} rtx_and_int;
+
+typedef struct rtx_pair {
+ rtx r1;
+ rtx r2;
+} rtx_pair;
-#ifdef HAIFA
-/* This is extern from unroll.c */
-extern void iteration_info PROTO((rtx, rtx *, rtx *, rtx, rtx));
+/* Nonzero iff INSN is between START and END, inclusive. */
+#define INSN_IN_RANGE_P(INSN, START, END) \
+ (INSN_UID (INSN) < max_uid_for_loop \
+ && INSN_LUID (INSN) >= INSN_LUID (START) \
+ && INSN_LUID (INSN) <= INSN_LUID (END))
-/* Two main functions for implementing bct:
- first - to be called before loop unrolling, and the second - after */
#ifdef HAVE_decrement_and_branch_on_count
-static void analyze_loop_iterations PROTO((rtx, rtx));
+/* Test whether BCT applicable and safe. */
static void insert_bct PROTO((rtx, rtx));
-/* Auxiliary function that inserts the bct pattern into the loop */
+/* Auxiliary function that inserts the BCT pattern into the loop. */
static void instrument_loop_bct PROTO((rtx, rtx, rtx));
#endif /* HAVE_decrement_and_branch_on_count */
-#endif /* HAIFA */
/* Indirect_jump_in_function is computed once per function. */
int indirect_jump_in_function = 0;
@@ -350,15 +373,19 @@ static int indirect_jump_in_function_p PROTO((rtx));
/* Relative gain of eliminating various kinds of operations. */
-int add_cost;
+static int add_cost;
#if 0
-int shift_cost;
-int mult_cost;
+static int shift_cost;
+static int mult_cost;
#endif
/* Benefit penalty, if a giv is not replaceable, i.e. must emit an insn to
copy the value of the strength reduced giv to its original register. */
-int copy_cost;
+static int copy_cost;
+
+/* Cost of using a register, to normalize the benefits of a giv. */
+static int reg_address_cost;
+
void
init_loop ()
@@ -368,6 +395,12 @@ init_loop ()
add_cost = rtx_cost (gen_rtx_PLUS (word_mode, reg, reg), SET);
+#ifdef ADDRESS_COST
+ reg_address_cost = ADDRESS_COST (reg);
+#else
+ reg_address_cost = rtx_cost (reg, MEM);
+#endif
+
/* We multiply by 2 to reconcile the difference in scale between
these two ways of computing costs. Otherwise the cost of a copy
will be far less than the cost of an add. */
@@ -387,11 +420,11 @@ init_loop ()
(or 0 if none should be output). */
void
-loop_optimize (f, dumpfile, unroll_p)
+loop_optimize (f, dumpfile, unroll_p, bct_p)
/* f is the first instruction of a chain of insns for one function */
rtx f;
FILE *dumpfile;
- int unroll_p;
+ int unroll_p, bct_p;
{
register rtx insn;
register int i;
@@ -400,7 +433,6 @@ loop_optimize (f, dumpfile, unroll_p)
loop_dump_stream = dumpfile;
init_recog_no_volatile ();
- init_alias_analysis ();
max_reg_before_loop = max_reg_num ();
@@ -448,25 +480,11 @@ loop_optimize (f, dumpfile, unroll_p)
loop_unroll_factor = (int *) alloca (max_loop_num *sizeof (int));
bzero ((char *) loop_unroll_factor, max_loop_num * sizeof (int));
-#ifdef HAIFA
+#ifdef HAVE_decrement_and_branch_on_count
/* Allocate for BCT optimization */
- loop_can_insert_bct = (int *) alloca (max_loop_num * sizeof (int));
- bzero ((char *) loop_can_insert_bct, max_loop_num * sizeof (int));
-
loop_used_count_register = (int *) alloca (max_loop_num * sizeof (int));
bzero ((char *) loop_used_count_register, max_loop_num * sizeof (int));
-
- loop_increment = (rtx *) alloca (max_loop_num * sizeof (rtx));
- loop_comparison_value = (rtx *) alloca (max_loop_num * sizeof (rtx));
- loop_start_value = (rtx *) alloca (max_loop_num * sizeof (rtx));
- bzero ((char *) loop_increment, max_loop_num * sizeof (rtx));
- bzero ((char *) loop_comparison_value, max_loop_num * sizeof (rtx));
- bzero ((char *) loop_start_value, max_loop_num * sizeof (rtx));
-
- loop_comparison_code
- = (enum rtx_code *) alloca (max_loop_num * sizeof (enum rtx_code));
- bzero ((char *) loop_comparison_code, max_loop_num * sizeof (enum rtx_code));
-#endif /* HAIFA */
+#endif /* HAVE_decrement_and_branch_on_count */
/* Find and process each loop.
First, find them, and record them in order of their beginnings. */
@@ -477,6 +495,13 @@ loop_optimize (f, dumpfile, unroll_p)
function. */
reg_scan (f, max_reg_num (), 1);
+ /* This must occur after reg_scan so that registers created by gcse
+ will have entries in the register tables.
+
+ We could have added a call to reg_scan after gcse_main in toplev.c,
+ but moving this call to init_alias_analysis is more efficient. */
+ init_alias_analysis ();
+
/* See if we went too far. */
if (get_max_uid () > max_uid_for_loop)
abort ();
@@ -530,15 +555,49 @@ loop_optimize (f, dumpfile, unroll_p)
for (i = max_loop_num-1; i >= 0; i--)
if (! loop_invalid[i] && loop_number_loop_ends[i])
scan_loop (loop_number_loop_starts[i], loop_number_loop_ends[i],
- max_reg_num (), unroll_p);
+ unroll_p, bct_p);
/* If debugging and unrolling loops, we must replicate the tree nodes
corresponding to the blocks inside the loop, so that the original one
to one mapping will remain. */
if (unroll_p && write_symbols != NO_DEBUG)
unroll_block_trees ();
+
+ end_alias_analysis ();
}
+/* Returns the next insn, in execution order, after INSN. START and
+ END are the NOTE_INSN_LOOP_BEG and NOTE_INSN_LOOP_END for the loop,
+ respectively. LOOP_TOP, if non-NULL, is the top of the loop in the
+ insn-stream; it is used with loops that are entered near the
+ bottom. */
+
+static rtx
+next_insn_in_loop (insn, start, end, loop_top)
+ rtx insn;
+ rtx start;
+ rtx end;
+ rtx loop_top;
+{
+ insn = NEXT_INSN (insn);
+
+ if (insn == end)
+ {
+ if (loop_top)
+ /* Go to the top of the loop, and continue there. */
+ insn = loop_top;
+ else
+ /* We're done. */
+ insn = NULL_RTX;
+ }
+
+ if (insn == start)
+ /* We're done. */
+ insn = NULL_RTX;
+
+ return insn;
+}
+
/* Optimize one loop whose start is LOOP_START and end is END.
LOOP_START is the NOTE_INSN_LOOP_BEG and END is the matching
NOTE_INSN_LOOP_END. */
@@ -550,13 +609,12 @@ loop_optimize (f, dumpfile, unroll_p)
write, then we can also mark the memory read as invariant. */
static void
-scan_loop (loop_start, end, nregs, unroll_p)
+scan_loop (loop_start, end, unroll_p, bct_p)
rtx loop_start, end;
- int nregs;
- int unroll_p;
+ int unroll_p, bct_p;
{
register int i;
- register rtx p;
+ rtx p;
/* 1 if we are scanning insns that could be executed zero times. */
int maybe_never = 0;
/* 1 if we are scanning insns that might never be executed
@@ -588,13 +646,10 @@ scan_loop (loop_start, end, nregs, unroll_p)
/* If we have calls, contains the insn in which a register was used
if it was used exactly once; contains const0_rtx if it was used more
than once. */
- rtx *reg_single_usage = 0;
+ varray_type reg_single_usage = 0;
/* Nonzero if we are scanning instructions in a sub-loop. */
int loop_depth = 0;
-
- n_times_set = (int *) alloca (nregs * sizeof (int));
- n_times_used = (int *) alloca (nregs * sizeof (int));
- may_not_optimize = (char *) alloca (nregs);
+ int nregs;
/* Determine whether this loop starts with a jump down to a test at
the end. This will occur for a small number of loops with a test
@@ -645,9 +700,7 @@ scan_loop (loop_start, end, nregs, unroll_p)
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_UID (JUMP_LABEL (p)) < max_uid_for_loop
- && INSN_LUID (JUMP_LABEL (p)) >= INSN_LUID (loop_start)
- && INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (end))
+ && INSN_IN_RANGE_P (JUMP_LABEL (p), loop_start, end))
{
loop_top = next_label (scan_start);
scan_start = JUMP_LABEL (p);
@@ -672,25 +725,42 @@ scan_loop (loop_start, end, nregs, unroll_p)
}
/* Count number of times each reg is set during this loop.
- Set may_not_optimize[I] if it is not safe to move out
+ Set VARRAY_CHAR (may_not_optimize, I) if it is not safe to move out
the setting of register I. If this loop has calls, set
- reg_single_usage[I]. */
-
- bzero ((char *) n_times_set, nregs * sizeof (int));
- bzero (may_not_optimize, nregs);
+ VARRAY_RTX (reg_single_usage, I). */
+
+ /* Allocate extra space for REGS that might be created by
+ load_mems. We allocate a little extra slop as well, in the hopes
+ that even after the moving of movables creates some new registers
+ we won't have to reallocate these arrays. However, we do grow
+ the arrays, if necessary, in load_mems_recount_loop_regs_set. */
+ nregs = max_reg_num () + loop_mems_idx + 16;
+ VARRAY_INT_INIT (n_times_set, nregs, "n_times_set");
+ VARRAY_INT_INIT (n_times_used, nregs, "n_times_used");
+ VARRAY_CHAR_INIT (may_not_optimize, nregs, "may_not_optimize");
if (loop_has_call)
- {
- reg_single_usage = (rtx *) alloca (nregs * sizeof (rtx));
- bzero ((char *) reg_single_usage, nregs * sizeof (rtx));
- }
+ VARRAY_RTX_INIT (reg_single_usage, nregs, "reg_single_usage");
count_loop_regs_set (loop_top ? loop_top : loop_start, end,
may_not_optimize, reg_single_usage, &insn_count, nregs);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- may_not_optimize[i] = 1, n_times_set[i] = 1;
- bcopy ((char *) n_times_set, (char *) n_times_used, nregs * sizeof (int));
+ {
+ VARRAY_CHAR (may_not_optimize, i) = 1;
+ VARRAY_INT (n_times_set, i) = 1;
+ }
+
+#ifdef AVOID_CCMODE_COPIES
+ /* Don't try to move insns which set CC registers if we should not
+ create CCmode register copies. */
+ for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
+ if (GET_MODE_CLASS (GET_MODE (regno_reg_rtx[i])) == MODE_CC)
+ VARRAY_CHAR (may_not_optimize, i) = 1;
+#endif
+
+ bcopy ((char *) &n_times_set->data,
+ (char *) &n_times_used->data, nregs * sizeof (int));
if (loop_dump_stream)
{
@@ -714,24 +784,10 @@ scan_loop (loop_start, end, nregs, unroll_p)
When MAYBE_NEVER is 0, all insns will be executed at least once
so that is not a problem. */
- p = scan_start;
- while (1)
+ for (p = next_insn_in_loop (scan_start, scan_start, end, loop_top);
+ p != NULL_RTX;
+ p = next_insn_in_loop (p, scan_start, end, loop_top))
{
- p = NEXT_INSN (p);
- /* At end of a straight-in loop, we are done.
- At end of a loop entered at the bottom, scan the top. */
- if (p == scan_start)
- break;
- if (p == end)
- {
- if (loop_top != 0)
- p = loop_top;
- else
- break;
- if (p == scan_start)
- break;
- }
-
if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
&& find_reg_note (p, REG_LIBCALL, NULL_RTX))
in_libcall = 1;
@@ -742,7 +798,7 @@ scan_loop (loop_start, end, nregs, unroll_p)
if (GET_CODE (p) == INSN
&& (set = single_set (p))
&& GET_CODE (SET_DEST (set)) == REG
- && ! may_not_optimize[REGNO (SET_DEST (set))])
+ && ! VARRAY_CHAR (may_not_optimize, REGNO (SET_DEST (set))))
{
int tem1 = 0;
int tem2 = 0;
@@ -781,28 +837,42 @@ scan_loop (loop_start, end, nregs, unroll_p)
We don't know its life-span, so we can't compute the benefit. */
if (REGNO (SET_DEST (set)) >= max_reg_before_loop)
;
- /* In order to move a register, we need to have one of three cases:
- (1) it is used only in the same basic block as the set
- (2) it is not a user variable and it is not used in the
- exit test (this can cause the variable to be used
- before it is set just like a user-variable).
- (3) the set is guaranteed to be executed once the loop starts,
- and the reg is not used until after that. */
- else if (! ((! maybe_never
- && ! loop_reg_used_before_p (set, p, loop_start,
- scan_start, end))
- || (! REG_USERVAR_P (SET_DEST (set))
- && ! REG_LOOP_TEST_P (SET_DEST (set)))
- || reg_in_basic_block_p (p, SET_DEST (set))))
+ else if (/* The set is a user-variable or it is used in
+ the exit test (this can cause the variable to be
+ used before it is set just like a
+ user-variable)... */
+ (REG_USERVAR_P (SET_DEST (set))
+ || REG_LOOP_TEST_P (SET_DEST (set)))
+ /* And the set is not guaranteed to be executed one
+ the loop starts, or the value before the set is
+ needed before the set occurs... */
+ && (maybe_never
+ || loop_reg_used_before_p (set, p, loop_start,
+ scan_start, end))
+ /* And the register is used in basic blocks other
+ than the one where it is set (meaning that
+ something after this point in the loop might
+ depend on its value before the set). */
+ && !reg_in_basic_block_p (p, SET_DEST (set)))
+ /* It is unsafe to move the set. The fact that these
+ three conditions are considered in conjunction means
+ that we are assuming various conditions, such as:
+
+ o It's OK to move a set of a variable which was not
+ created by the user and is not used in an exit test
+ even if that point in the set would not be reached
+ during execution of the loop. */
;
else if ((tem = invariant_p (src))
&& (dependencies == 0
|| (tem2 = invariant_p (dependencies)) != 0)
- && (n_times_set[REGNO (SET_DEST (set))] == 1
+ && (VARRAY_INT (n_times_set,
+ REGNO (SET_DEST (set))) == 1
|| (tem1
- = consec_sets_invariant_p (SET_DEST (set),
- n_times_set[REGNO (SET_DEST (set))],
- p)))
+ = consec_sets_invariant_p
+ (SET_DEST (set),
+ VARRAY_INT (n_times_set, REGNO (SET_DEST (set))),
+ p)))
/* If the insn can cause a trap (such as divide by zero),
can't move it unless it's guaranteed to be executed
once loop is entered. Even a function call might
@@ -828,12 +898,12 @@ scan_loop (loop_start, end, nregs, unroll_p)
Don't do this if P has a REG_RETVAL note or if we have
SMALL_REGISTER_CLASSES and SET_SRC is a hard register. */
- if (reg_single_usage && reg_single_usage[regno] != 0
- && reg_single_usage[regno] != const0_rtx
+ if (reg_single_usage && VARRAY_RTX (reg_single_usage, regno) != 0
+ && VARRAY_RTX (reg_single_usage, regno) != const0_rtx
&& REGNO_FIRST_UID (regno) == INSN_UID (p)
&& (REGNO_LAST_UID (regno)
- == INSN_UID (reg_single_usage[regno]))
- && n_times_set[REGNO (SET_DEST (set))] == 1
+ == INSN_UID (VARRAY_RTX (reg_single_usage, regno)))
+ && VARRAY_INT (n_times_set, regno) == 1
&& ! side_effects_p (SET_SRC (set))
&& ! find_reg_note (p, REG_RETVAL, NULL_RTX)
&& (! SMALL_REGISTER_CLASSES
@@ -843,22 +913,25 @@ scan_loop (loop_start, end, nregs, unroll_p)
a call-clobbered register and the life of REGNO
might span a call. */
&& ! modified_between_p (SET_SRC (set), p,
- reg_single_usage[regno])
- && no_labels_between_p (p, reg_single_usage[regno])
+ VARRAY_RTX
+ (reg_single_usage, regno))
+ && no_labels_between_p (p, VARRAY_RTX (reg_single_usage, regno))
&& validate_replace_rtx (SET_DEST (set), SET_SRC (set),
- reg_single_usage[regno]))
+ VARRAY_RTX
+ (reg_single_usage, regno)))
{
/* Replace any usage in a REG_EQUAL note. Must copy the
new source, so that we don't get rtx sharing between the
SET_SOURCE and REG_NOTES of insn p. */
- REG_NOTES (reg_single_usage[regno])
- = replace_rtx (REG_NOTES (reg_single_usage[regno]),
+ REG_NOTES (VARRAY_RTX (reg_single_usage, regno))
+ = replace_rtx (REG_NOTES (VARRAY_RTX
+ (reg_single_usage, regno)),
SET_DEST (set), copy_rtx (SET_SRC (set)));
PUT_CODE (p, NOTE);
NOTE_LINE_NUMBER (p) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (p) = 0;
- n_times_set[regno] = 0;
+ VARRAY_INT (n_times_set, regno) = 0;
continue;
}
@@ -869,7 +942,8 @@ scan_loop (loop_start, end, nregs, unroll_p)
m->dependencies = dependencies;
m->set_dest = SET_DEST (set);
m->force = 0;
- m->consec = n_times_set[REGNO (SET_DEST (set))] - 1;
+ m->consec = VARRAY_INT (n_times_set,
+ REGNO (SET_DEST (set))) - 1;
m->done = 0;
m->forces = 0;
m->partial = 0;
@@ -886,10 +960,10 @@ scan_loop (loop_start, end, nregs, unroll_p)
m->match = 0;
m->lifetime = (uid_luid[REGNO_LAST_UID (regno)]
- uid_luid[REGNO_FIRST_UID (regno)]);
- m->savings = n_times_used[regno];
+ m->savings = VARRAY_INT (n_times_used, regno);
if (find_reg_note (p, REG_RETVAL, NULL_RTX))
m->savings += libcall_benefit (p);
- n_times_set[regno] = move_insn ? -2 : -1;
+ VARRAY_INT (n_times_set, regno) = move_insn ? -2 : -1;
/* Add M to the end of the chain MOVABLES. */
if (movables == 0)
movables = m;
@@ -948,7 +1022,7 @@ scan_loop (loop_start, end, nregs, unroll_p)
&& !reg_mentioned_p (SET_DEST (set), SET_SRC (set1)))
{
register int regno = REGNO (SET_DEST (set));
- if (n_times_set[regno] == 2)
+ if (VARRAY_INT (n_times_set, regno) == 2)
{
register struct movable *m;
m = (struct movable *) alloca (sizeof (struct movable));
@@ -998,7 +1072,7 @@ scan_loop (loop_start, end, nregs, unroll_p)
m->lifetime = (uid_luid[REGNO_LAST_UID (regno)]
- uid_luid[REGNO_FIRST_UID (regno)]);
m->savings = 1;
- n_times_set[regno] = -1;
+ VARRAY_INT (n_times_set, regno) = -1;
/* Add M to the end of the chain MOVABLES. */
if (movables == 0)
movables = m;
@@ -1063,20 +1137,39 @@ scan_loop (loop_start, end, nregs, unroll_p)
combine_movables (movables, nregs);
/* Now consider each movable insn to decide whether it is worth moving.
- Store 0 in n_times_set for each reg that is moved. */
+ Store 0 in n_times_set for each reg that is moved.
+
+ Generally this increases code size, so do not move moveables when
+ optimizing for code size. */
- move_movables (movables, threshold,
- insn_count, loop_start, end, nregs);
+ if (! optimize_size)
+ move_movables (movables, threshold,
+ insn_count, loop_start, end, nregs);
/* Now candidates that still are negative are those not moved.
Change n_times_set to indicate that those are not actually invariant. */
for (i = 0; i < nregs; i++)
- if (n_times_set[i] < 0)
- n_times_set[i] = n_times_used[i];
+ if (VARRAY_INT (n_times_set, i) < 0)
+ VARRAY_INT (n_times_set, i) = VARRAY_INT (n_times_used, i);
+
+ /* Now that we've moved some things out of the loop, we able to
+ hoist even more memory references. There's no need to pass
+ reg_single_usage this time, since we're done with it. */
+ load_mems_and_recount_loop_regs_set (scan_start, end, loop_top,
+ loop_start, 0,
+ &insn_count);
if (flag_strength_reduce)
- strength_reduce (scan_start, end, loop_top,
- insn_count, loop_start, end, unroll_p);
+ {
+ the_movables = movables;
+ strength_reduce (scan_start, end, loop_top,
+ insn_count, loop_start, end, unroll_p, bct_p);
+ }
+
+ VARRAY_FREE (n_times_set);
+ VARRAY_FREE (n_times_used);
+ VARRAY_FREE (may_not_optimize);
+ VARRAY_FREE (reg_single_usage);
}
/* Add elements to *OUTPUT to record all the pseudo-regs
@@ -1350,7 +1443,7 @@ combine_movables (movables, nregs)
/* Perhaps testing m->consec_sets would be more appropriate here? */
for (m = movables; m; m = m->next)
- if (m->match == 0 && n_times_used[m->regno] == 1 && !m->partial)
+ if (m->match == 0 && VARRAY_INT (n_times_used, m->regno) == 1 && !m->partial)
{
register struct movable *m1;
int regno = m->regno;
@@ -1361,7 +1454,7 @@ combine_movables (movables, nregs)
/* We want later insns to match the first one. Don't make the first
one match any later ones. So start this loop at m->next. */
for (m1 = m->next; m1; m1 = m1->next)
- if (m != m1 && m1->match == 0 && n_times_used[m1->regno] == 1
+ if (m != m1 && m1->match == 0 && VARRAY_INT (n_times_used, m1->regno) == 1
/* A reg used outside the loop mustn't be eliminated. */
&& !m1->global
/* A reg used for zero-extending mustn't be eliminated. */
@@ -1498,7 +1591,7 @@ rtx_equal_for_loop_p (x, y, movables)
/* If we have a register and a constant, they may sometimes be
equal. */
- if (GET_CODE (x) == REG && n_times_set[REGNO (x)] == -2
+ if (GET_CODE (x) == REG && VARRAY_INT (n_times_set, REGNO (x)) == -2
&& CONSTANT_P (y))
{
for (m = movables; m; m = m->next)
@@ -1506,7 +1599,7 @@ rtx_equal_for_loop_p (x, y, movables)
&& rtx_equal_p (m->set_src, y))
return 1;
}
- else if (GET_CODE (y) == REG && n_times_set[REGNO (y)] == -2
+ else if (GET_CODE (y) == REG && VARRAY_INT (n_times_set, REGNO (y)) == -2
&& CONSTANT_P (x))
{
for (m = movables; m; m = m->next)
@@ -1605,22 +1698,15 @@ add_label_notes (x, insns)
if (code == LABEL_REF && !LABEL_REF_NONLOCAL_P (x))
{
- rtx next = next_real_insn (XEXP (x, 0));
-
- /* Don't record labels that refer to dispatch tables.
- This is not necessary, since the tablejump references the same label.
- And if we did record them, flow.c would make worse code. */
- if (next == 0
- || ! (GET_CODE (next) == JUMP_INSN
- && (GET_CODE (PATTERN (next)) == ADDR_VEC
- || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)))
- {
- for (insn = insns; insn; insn = NEXT_INSN (insn))
- if (reg_mentioned_p (XEXP (x, 0), insn))
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
- REG_NOTES (insn));
- }
- return;
+ /* This code used to ignore labels that referred to dispatch tables to
+ avoid flow generating (slighly) worse code.
+
+ We no longer ignore such label references (see LABEL_REF handling in
+ mark_jump_label for additional information). */
+ for (insn = insns; insn; insn = NEXT_INSN (insn))
+ if (reg_mentioned_p (XEXP (x, 0), insn))
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
+ REG_NOTES (insn));
}
fmt = GET_RTX_FORMAT (code);
@@ -1719,13 +1805,8 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
if (loop_dump_stream)
fprintf (loop_dump_stream, "savings %d ", savings);
- if (moved_once[regno])
- {
- insn_count *= 2;
-
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "halved since already moved ");
- }
+ if (moved_once[regno] && loop_dump_stream)
+ fprintf (loop_dump_stream, "halved since already moved ");
/* An insn MUST be moved if we already moved something else
which is safe only if this one is moved too: that is,
@@ -1742,9 +1823,10 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
if (already_moved[regno]
|| flag_move_all_movables
- || (threshold * savings * m->lifetime) >= insn_count
+ || (threshold * savings * m->lifetime) >=
+ (moved_once[regno] ? insn_count * 2 : insn_count)
|| (m->forces && m->forces->done
- && n_times_used[m->forces->regno] == 1))
+ && VARRAY_INT (n_times_used, m->forces->regno) == 1))
{
int count;
register struct movable *m1;
@@ -1808,9 +1890,17 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
temp = delete_insn (temp);
}
+ temp = p;
p = delete_insn (p);
+
+ /* simplify_giv_expr expects that it can walk the insns
+ at m->insn forwards and see this old sequence we are
+ tossing here. delete_insn does preserve the next
+ pointers, but when we skip over a NOTE we must fix
+ it up. Otherwise that code walks into the non-deleted
+ insn stream. */
while (p && GET_CODE (p) == NOTE)
- p = NEXT_INSN (p);
+ p = NEXT_INSN (temp) = NEXT_INSN (p);
}
start_sequence ();
@@ -2017,9 +2107,18 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
XEXP (temp, 0) = i1;
}
+ temp = p;
delete_insn (p);
- do p = NEXT_INSN (p);
- while (p && GET_CODE (p) == NOTE);
+ p = NEXT_INSN (p);
+
+ /* simplify_giv_expr expects that it can walk the insns
+ at m->insn forwards and see this old sequence we are
+ tossing here. delete_insn does preserve the next
+ pointers, but when we skip over a NOTE we must fix
+ it up. Otherwise that code walks into the non-deleted
+ insn stream. */
+ while (p && GET_CODE (p) == NOTE)
+ p = NEXT_INSN (temp) = NEXT_INSN (p);
}
/* The more regs we move, the less we like moving them. */
@@ -2035,7 +2134,7 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
/* The reg set here is now invariant. */
if (! m->partial)
- n_times_set[regno] = 0;
+ VARRAY_INT (n_times_set, regno) = 0;
m->done = 1;
@@ -2092,7 +2191,7 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
/* The reg merged here is now invariant,
if the reg it matches is invariant. */
if (! m->partial)
- n_times_set[m1->regno] = 0;
+ VARRAY_INT (n_times_set, m1->regno) = 0;
}
}
else if (loop_dump_stream)
@@ -2278,20 +2377,29 @@ constant_high_bytes (p, loop_start)
/* Scan a loop setting the variables `unknown_address_altered',
`num_mem_sets', `loop_continue', loops_enclosed', `loop_has_call',
- and `loop_has_volatile'.
- Also, fill in the array `loop_store_mems'. */
+ and `loop_has_volatile'. Also, fill in the arrays `loop_mems' and
+ `loop_store_mems'. */
static void
prescan_loop (start, end)
rtx start, end;
{
register int level = 1;
- register rtx insn;
+ rtx insn;
+ int loop_has_multiple_exit_targets = 0;
+ /* The label after END. Jumping here is just like falling off the
+ end of the loop. We use next_nonnote_insn instead of next_label
+ as a hedge against the (pathological) case where some actual insn
+ might end up between the two. */
+ rtx exit_target = next_nonnote_insn (end);
+ if (exit_target == NULL_RTX || GET_CODE (exit_target) != CODE_LABEL)
+ loop_has_multiple_exit_targets = 1;
unknown_address_altered = 0;
loop_has_call = 0;
loop_has_volatile = 0;
loop_store_mems_idx = 0;
+ loop_mems_idx = 0;
num_mem_sets = 0;
loops_enclosed = 1;
@@ -2329,17 +2437,75 @@ prescan_loop (start, end)
unknown_address_altered = 1;
loop_has_call = 1;
}
- else
+ else if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
{
- if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
+ rtx label1 = NULL_RTX;
+ rtx label2 = NULL_RTX;
+
+ if (volatile_refs_p (PATTERN (insn)))
+ loop_has_volatile = 1;
+
+ note_stores (PATTERN (insn), note_addr_stored);
+
+ if (!loop_has_multiple_exit_targets
+ && GET_CODE (insn) == JUMP_INSN
+ && GET_CODE (PATTERN (insn)) == SET
+ && SET_DEST (PATTERN (insn)) == pc_rtx)
{
- if (volatile_refs_p (PATTERN (insn)))
- loop_has_volatile = 1;
+ if (GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE)
+ {
+ label1 = XEXP (SET_SRC (PATTERN (insn)), 1);
+ label2 = XEXP (SET_SRC (PATTERN (insn)), 2);
+ }
+ else
+ {
+ label1 = SET_SRC (PATTERN (insn));
+ }
- note_stores (PATTERN (insn), note_addr_stored);
+ do {
+ if (label1 && label1 != pc_rtx)
+ {
+ if (GET_CODE (label1) != LABEL_REF)
+ {
+ /* Something tricky. */
+ loop_has_multiple_exit_targets = 1;
+ break;
+ }
+ else if (XEXP (label1, 0) != exit_target
+ && LABEL_OUTSIDE_LOOP_P (label1))
+ {
+ /* A jump outside the current loop. */
+ loop_has_multiple_exit_targets = 1;
+ break;
+ }
+ }
+
+ label1 = label2;
+ label2 = NULL_RTX;
+ } while (label1);
}
}
+ else if (GET_CODE (insn) == RETURN)
+ loop_has_multiple_exit_targets = 1;
}
+
+ /* Now, rescan the loop, setting up the LOOP_MEMS array. */
+ if (/* We can't tell what MEMs are aliased by what. */
+ !unknown_address_altered
+ /* An exception thrown by a called function might land us
+ anywhere. */
+ && !loop_has_call
+ /* We don't want loads for MEMs moved to a location before the
+ one at which their stack memory becomes allocated. (Note
+ that this is not a problem for malloc, etc., since those
+ require actual function calls. */
+ && !current_function_calls_alloca
+ /* There are ways to leave the loop other than falling off the
+ end. */
+ && !loop_has_multiple_exit_targets)
+ for (insn = NEXT_INSN (start); insn != NEXT_INSN (end);
+ insn = NEXT_INSN (insn))
+ for_each_rtx (&insn, insert_loop_mem, 0);
}
/* Scan the function looking for loops. Record the start and end of each loop.
@@ -2789,10 +2955,10 @@ mark_loop_jump (x, loop_num)
if (loop_num != -1)
{
-#ifdef HAIFA
+#ifdef HAVE_decrement_and_branch_on_count
LABEL_OUTSIDE_LOOP_P (x) = 1;
LABEL_NEXTREF (x) = loop_number_exit_labels[loop_num];
-#endif /* HAIFA */
+#endif /* HAVE_decrement_and_branch_on_count */
loop_number_exit_labels[loop_num] = x;
@@ -2927,10 +3093,10 @@ invariant_p (x)
&& REGNO (x) < FIRST_PSEUDO_REGISTER && call_used_regs[REGNO (x)])
return 0;
- if (n_times_set[REGNO (x)] < 0)
+ if (VARRAY_INT (n_times_set, REGNO (x)) < 0)
return 2;
- return n_times_set[REGNO (x)] == 0;
+ return VARRAY_INT (n_times_set, REGNO (x)) == 0;
case MEM:
/* Volatile memory references must be rejected. Do this before
@@ -3018,7 +3184,7 @@ consec_sets_invariant_p (reg, n_sets, insn)
rtx temp;
/* Number of sets we have to insist on finding after INSN. */
int count = n_sets - 1;
- int old = n_times_set[regno];
+ int old = VARRAY_INT (n_times_set, regno);
int value = 0;
int this;
@@ -3026,7 +3192,7 @@ consec_sets_invariant_p (reg, n_sets, insn)
if (n_sets == 127)
return 0;
- n_times_set[regno] = 0;
+ VARRAY_INT (n_times_set, regno) = 0;
while (count > 0)
{
@@ -3065,12 +3231,12 @@ consec_sets_invariant_p (reg, n_sets, insn)
count--;
else if (code != NOTE)
{
- n_times_set[regno] = old;
+ VARRAY_INT (n_times_set, regno) = old;
return 0;
}
}
- n_times_set[regno] = old;
+ VARRAY_INT (n_times_set, regno) = old;
/* If invariant_p ever returned 2, we return 2. */
return 1 + (value & 2);
}
@@ -3116,15 +3282,16 @@ static void
find_single_use_in_loop (insn, x, usage)
rtx insn;
rtx x;
- rtx *usage;
+ varray_type usage;
{
enum rtx_code code = GET_CODE (x);
char *fmt = GET_RTX_FORMAT (code);
int i, j;
if (code == REG)
- usage[REGNO (x)]
- = (usage[REGNO (x)] != 0 && usage[REGNO (x)] != insn)
+ VARRAY_RTX (usage, REGNO (x))
+ = (VARRAY_RTX (usage, REGNO (x)) != 0
+ && VARRAY_RTX (usage, REGNO (x)) != insn)
? const0_rtx : insn;
else if (code == SET)
@@ -3148,6 +3315,51 @@ find_single_use_in_loop (insn, x, usage)
}
}
+/* Count and record any set in X which is contained in INSN. Update
+ MAY_NOT_MOVE and LAST_SET for any register set in X. */
+
+static void
+count_one_set (insn, x, may_not_move, last_set)
+ rtx insn, x;
+ varray_type may_not_move;
+ rtx *last_set;
+{
+ if (GET_CODE (x) == CLOBBER && GET_CODE (XEXP (x, 0)) == REG)
+ /* Don't move a reg that has an explicit clobber.
+ It's not worth the pain to try to do it correctly. */
+ VARRAY_CHAR (may_not_move, REGNO (XEXP (x, 0))) = 1;
+
+ if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)
+ {
+ rtx dest = SET_DEST (x);
+ while (GET_CODE (dest) == SUBREG
+ || GET_CODE (dest) == ZERO_EXTRACT
+ || GET_CODE (dest) == SIGN_EXTRACT
+ || GET_CODE (dest) == STRICT_LOW_PART)
+ dest = XEXP (dest, 0);
+ if (GET_CODE (dest) == REG)
+ {
+ register int regno = REGNO (dest);
+ /* If this is the first setting of this reg
+ in current basic block, and it was set before,
+ it must be set in two basic blocks, so it cannot
+ be moved out of the loop. */
+ if (VARRAY_INT (n_times_set, regno) > 0
+ && last_set[regno] == 0)
+ VARRAY_CHAR (may_not_move, regno) = 1;
+ /* If this is not first setting in current basic block,
+ see if reg was used in between previous one and this.
+ If so, neither one can be moved. */
+ if (last_set[regno] != 0
+ && reg_used_between_p (dest, last_set[regno], insn))
+ VARRAY_CHAR (may_not_move, regno) = 1;
+ if (VARRAY_INT (n_times_set, regno) < 127)
+ ++VARRAY_INT (n_times_set, regno);
+ last_set[regno] = insn;
+ }
+ }
+}
+
/* Increment N_TIMES_SET at the index of each register
that is modified by an insn between FROM and TO.
If the value of an element of N_TIMES_SET becomes 127 or more,
@@ -3167,8 +3379,8 @@ find_single_use_in_loop (insn, x, usage)
static void
count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs)
register rtx from, to;
- char *may_not_move;
- rtx *single_usage;
+ varray_type may_not_move;
+ varray_type single_usage;
int *count_ptr;
int nregs;
{
@@ -3194,74 +3406,15 @@ count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs)
find_single_use_in_loop (insn, REG_NOTES (insn), single_usage);
}
- if (GET_CODE (PATTERN (insn)) == CLOBBER
- && GET_CODE (XEXP (PATTERN (insn), 0)) == REG)
- /* Don't move a reg that has an explicit clobber.
- We might do so sometimes, but it's not worth the pain. */
- may_not_move[REGNO (XEXP (PATTERN (insn), 0))] = 1;
-
if (GET_CODE (PATTERN (insn)) == SET
|| GET_CODE (PATTERN (insn)) == CLOBBER)
- {
- dest = SET_DEST (PATTERN (insn));
- while (GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == ZERO_EXTRACT
- || GET_CODE (dest) == SIGN_EXTRACT
- || GET_CODE (dest) == STRICT_LOW_PART)
- dest = XEXP (dest, 0);
- if (GET_CODE (dest) == REG)
- {
- register int regno = REGNO (dest);
- /* If this is the first setting of this reg
- in current basic block, and it was set before,
- it must be set in two basic blocks, so it cannot
- be moved out of the loop. */
- if (n_times_set[regno] > 0 && last_set[regno] == 0)
- may_not_move[regno] = 1;
- /* If this is not first setting in current basic block,
- see if reg was used in between previous one and this.
- If so, neither one can be moved. */
- if (last_set[regno] != 0
- && reg_used_between_p (dest, last_set[regno], insn))
- may_not_move[regno] = 1;
- if (n_times_set[regno] < 127)
- ++n_times_set[regno];
- last_set[regno] = insn;
- }
- }
+ count_one_set (insn, PATTERN (insn), may_not_move, last_set);
else if (GET_CODE (PATTERN (insn)) == PARALLEL)
{
register int i;
for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
- {
- register rtx x = XVECEXP (PATTERN (insn), 0, i);
- if (GET_CODE (x) == CLOBBER && GET_CODE (XEXP (x, 0)) == REG)
- /* Don't move a reg that has an explicit clobber.
- It's not worth the pain to try to do it correctly. */
- may_not_move[REGNO (XEXP (x, 0))] = 1;
-
- if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)
- {
- dest = SET_DEST (x);
- while (GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == ZERO_EXTRACT
- || GET_CODE (dest) == SIGN_EXTRACT
- || GET_CODE (dest) == STRICT_LOW_PART)
- dest = XEXP (dest, 0);
- if (GET_CODE (dest) == REG)
- {
- register int regno = REGNO (dest);
- if (n_times_set[regno] > 0 && last_set[regno] == 0)
- may_not_move[regno] = 1;
- if (last_set[regno] != 0
- && reg_used_between_p (dest, last_set[regno], insn))
- may_not_move[regno] = 1;
- if (n_times_set[regno] < 127)
- ++n_times_set[regno];
- last_set[regno] = insn;
- }
- }
- }
+ count_one_set (insn, XVECEXP (PATTERN (insn), 0, i),
+ may_not_move, last_set);
}
}
@@ -3309,7 +3462,7 @@ loop_reg_used_before_p (set, insn, loop_start, scan_start, loop_end)
value is a linear function of a biv. */
/* Bivs are recognized by `basic_induction_var';
- Givs by `general_induct_var'. */
+ Givs by `general_induction_var'. */
/* Indexed by register number, indicates whether or not register is an
induction variable, and if so what type. */
@@ -3345,18 +3498,6 @@ static rtx addr_placeholder;
/* ??? Unfinished optimizations, and possible future optimizations,
for the strength reduction code. */
-/* ??? There is one more optimization you might be interested in doing: to
- allocate pseudo registers for frequently-accessed memory locations.
- If the same memory location is referenced each time around, it might
- be possible to copy it into a register before and out after.
- This is especially useful when the memory location is a variable which
- is in a stack slot because somewhere its address is taken. If the
- loop doesn't contain a function call and the variable isn't volatile,
- it is safe to keep the value in a register for the duration of the
- loop. One tricky thing is that the copying of the value back from the
- register has to be done on all exits from the loop. You need to check that
- all the exits from the loop go to the same place. */
-
/* ??? The interaction of biv elimination, and recognition of 'constant'
bivs, may cause problems. */
@@ -3381,24 +3522,29 @@ static rtx addr_placeholder;
was rerun in loop_optimize whenever a register was added or moved.
Also, some of the optimizations could be a little less conservative. */
-/* Perform strength reduction and induction variable elimination. */
+/* Perform strength reduction and induction variable elimination.
-/* Pseudo registers created during this function will be beyond the last
+ Pseudo registers created during this function will be beyond the last
valid index in several tables including n_times_set and regno_last_uid.
This does not cause a problem here, because the added registers cannot be
givs outside of their loop, and hence will never be reconsidered.
- But scan_loop must check regnos to make sure they are in bounds. */
+ But scan_loop must check regnos to make sure they are in bounds.
+
+ SCAN_START is the first instruction in the loop, as the loop would
+ actually be executed. END is the NOTE_INSN_LOOP_END. LOOP_TOP is
+ the first instruction in the loop, as it is layed out in the
+ instruction stream. LOOP_START is the NOTE_INSN_LOOP_BEG. */
static void
strength_reduce (scan_start, end, loop_top, insn_count,
- loop_start, loop_end, unroll_p)
+ loop_start, loop_end, unroll_p, bct_p)
rtx scan_start;
rtx end;
rtx loop_top;
int insn_count;
rtx loop_start;
rtx loop_end;
- int unroll_p;
+ int unroll_p, bct_p;
{
rtx p;
rtx set;
@@ -3455,24 +3601,10 @@ strength_reduce (scan_start, end, loop_top, insn_count,
/* Scan through loop to find all possible bivs. */
- p = scan_start;
- while (1)
+ for (p = next_insn_in_loop (scan_start, scan_start, end, loop_top);
+ p != NULL_RTX;
+ p = next_insn_in_loop (p, scan_start, end, loop_top))
{
- p = NEXT_INSN (p);
- /* At end of a straight-in loop, we are done.
- At end of a loop entered at the bottom, scan the top. */
- if (p == scan_start)
- break;
- if (p == end)
- {
- if (loop_top != 0)
- p = loop_top;
- else
- break;
- if (p == scan_start)
- break;
- }
-
if (GET_CODE (p) == INSN
&& (set = single_set (p))
&& GET_CODE (SET_DEST (set)) == REG)
@@ -3606,7 +3738,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
if (reg_iv_type[bl->regno] != BASIC_INDUCT
/* Above happens if register modified by subreg, etc. */
/* Make sure it is not recognized as a basic induction var: */
- || n_times_set[bl->regno] != bl->biv_count
+ || VARRAY_INT (n_times_set, bl->regno) != bl->biv_count
/* If never incremented, it is invariant that we decided not to
move. So leave it alone. */
|| ! bl->incremented)
@@ -3767,7 +3899,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
if (GET_CODE (p) == INSN
&& (set = single_set (p))
&& GET_CODE (SET_DEST (set)) == REG
- && ! may_not_optimize[REGNO (SET_DEST (set))])
+ && ! VARRAY_CHAR (may_not_optimize, REGNO (SET_DEST (set))))
{
rtx src_reg;
rtx add_val;
@@ -3780,21 +3912,20 @@ strength_reduce (scan_start, end, loop_top, insn_count,
continue;
if (/* SET_SRC is a giv. */
- ((benefit = general_induction_var (SET_SRC (set),
- &src_reg, &add_val,
- &mult_val))
+ (general_induction_var (SET_SRC (set), &src_reg, &add_val,
+ &mult_val, 0, &benefit)
/* Equivalent expression is a giv. */
|| ((regnote = find_reg_note (p, REG_EQUAL, NULL_RTX))
- && (benefit = general_induction_var (XEXP (regnote, 0),
- &src_reg,
- &add_val, &mult_val))))
+ && general_induction_var (XEXP (regnote, 0), &src_reg,
+ &add_val, &mult_val, 0,
+ &benefit)))
/* Don't try to handle any regs made by loop optimization.
We have nothing on them in regno_first_uid, etc. */
&& REGNO (dest_reg) < max_reg_before_loop
/* Don't recognize a BASIC_INDUCT_VAR here. */
&& dest_reg != src_reg
/* This must be the only place where the register is set. */
- && (n_times_set[REGNO (dest_reg)] == 1
+ && (VARRAY_INT (n_times_set, REGNO (dest_reg)) == 1
/* or all sets must be consecutive and make a giv. */
|| (benefit = consec_sets_giv (benefit, p,
src_reg, dest_reg,
@@ -3810,7 +3941,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
benefit += libcall_benefit (p);
/* Skip the consecutive insns, if there are any. */
- for (count = n_times_set[REGNO (dest_reg)] - 1;
+ for (count = VARRAY_INT (n_times_set, REGNO (dest_reg)) - 1;
count > 0; count--)
{
/* If first insn of libcall sequence, skip to end.
@@ -3928,16 +4059,6 @@ strength_reduce (scan_start, end, loop_top, insn_count,
so that "decrement and branch until zero" insn can be used. */
check_dbra_loop (loop_end, insn_count, loop_start);
-#ifdef HAIFA
- /* record loop-variables relevant for BCT optimization before unrolling
- the loop. Unrolling may update part of this information, and the
- correct data will be used for generating the BCT. */
-#ifdef HAVE_decrement_and_branch_on_count
- if (HAVE_decrement_and_branch_on_count)
- analyze_loop_iterations (loop_start, loop_end);
-#endif
-#endif /* HAIFA */
-
/* Create reg_map to hold substitutions for replaceable giv regs. */
reg_map = (rtx *) alloca (max_reg_before_loop * sizeof (rtx));
bzero ((char *) reg_map, max_reg_before_loop * sizeof (rtx));
@@ -4437,13 +4558,12 @@ strength_reduce (scan_start, end, loop_top, insn_count,
if (unroll_p)
unroll_loop (loop_end, insn_count, loop_start, end_insert_before, 1);
-#ifdef HAIFA
- /* instrument the loop with bct insn */
#ifdef HAVE_decrement_and_branch_on_count
- if (HAVE_decrement_and_branch_on_count)
+ /* Instrument the loop with BCT insn. */
+ if (HAVE_decrement_and_branch_on_count && bct_p
+ && flag_branch_on_count_reg)
insert_bct (loop_start, loop_end);
-#endif
-#endif /* HAIFA */
+#endif /* HAVE_decrement_and_branch_on_count */
if (loop_dump_stream)
fprintf (loop_dump_stream, "\n");
@@ -4531,12 +4651,13 @@ find_mem_givs (x, insn, not_every_iteration, loop_start, loop_end)
rtx mult_val;
int benefit;
- benefit = general_induction_var (XEXP (x, 0),
- &src_reg, &add_val, &mult_val);
+ /* This code used to disable creating GIVs with mult_val == 1 and
+ add_val == 0. However, this leads to lost optimizations when
+ it comes time to combine a set of related DEST_ADDR GIVs, since
+ this one would not be seen. */
- /* Don't make a DEST_ADDR giv with mult_val == 1 && add_val == 0.
- Such a giv isn't useful. */
- if (benefit > 0 && (mult_val != const1_rtx || add_val != const0_rtx))
+ if (general_induction_var (XEXP (x, 0), &src_reg, &add_val,
+ &mult_val, 1, &benefit))
{
/* Found one; record it. */
struct induction *v
@@ -4751,7 +4872,7 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit,
v->lifetime = (uid_luid[REGNO_LAST_UID (REGNO (dest_reg))]
- uid_luid[REGNO_FIRST_UID (REGNO (dest_reg))]);
- v->times_used = n_times_used[REGNO (dest_reg)];
+ v->times_used = VARRAY_INT (n_times_used, REGNO (dest_reg));
/* If the lifetime is zero, it means that this register is
really a dead store. So mark this as a giv that can be
@@ -4849,6 +4970,32 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit,
}
}
+ /* Record whether the add_val contains a const_int, for later use by
+ combine_givs. */
+ {
+ rtx tem = add_val;
+
+ v->no_const_addval = 1;
+ if (tem == const0_rtx)
+ ;
+ else if (GET_CODE (tem) == CONST_INT)
+ v->no_const_addval = 0;
+ else if (GET_CODE (tem) == PLUS)
+ {
+ while (1)
+ {
+ if (GET_CODE (XEXP (tem, 0)) == PLUS)
+ tem = XEXP (tem, 0);
+ else if (GET_CODE (XEXP (tem, 1)) == PLUS)
+ tem = XEXP (tem, 1);
+ else
+ break;
+ }
+ if (GET_CODE (XEXP (tem, 1)) == CONST_INT)
+ v->no_const_addval = 0;
+ }
+ }
+
if (loop_dump_stream)
{
if (type == DEST_REG)
@@ -4866,6 +5013,9 @@ record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit,
if (v->replaceable)
fprintf (loop_dump_stream, " replaceable");
+ if (v->no_const_addval)
+ fprintf (loop_dump_stream, " ncav");
+
if (GET_CODE (mult_val) == CONST_INT)
{
fprintf (loop_dump_stream, " mult ");
@@ -5188,12 +5338,12 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
switch (code)
{
case PLUS:
- if (XEXP (x, 0) == dest_reg
+ if (rtx_equal_p (XEXP (x, 0), dest_reg)
|| (GET_CODE (XEXP (x, 0)) == SUBREG
&& SUBREG_PROMOTED_VAR_P (XEXP (x, 0))
&& SUBREG_REG (XEXP (x, 0)) == dest_reg))
arg = XEXP (x, 1);
- else if (XEXP (x, 1) == dest_reg
+ else if (rtx_equal_p (XEXP (x, 1), dest_reg)
|| (GET_CODE (XEXP (x, 1)) == SUBREG
&& SUBREG_PROMOTED_VAR_P (XEXP (x, 1))
&& SUBREG_REG (XEXP (x, 1)) == dest_reg))
@@ -5217,30 +5367,36 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
return 0;
case REG:
- /* If this register is assigned in the previous insn, look at its
+ /* If this register is assigned in a previous insn, look at its
source, but don't go outside the loop or past a label. */
- for (insn = PREV_INSN (p);
- (insn && GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG);
- insn = PREV_INSN (insn))
- ;
+ insn = p;
+ while (1)
+ {
+ do {
+ insn = PREV_INSN (insn);
+ } while (insn && GET_CODE (insn) == NOTE
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG);
- if (insn)
- set = single_set (insn);
+ if (!insn)
+ break;
+ set = single_set (insn);
+ if (set == 0)
+ break;
- if (set != 0
- && (SET_DEST (set) == x
- || (GET_CODE (SET_DEST (set)) == SUBREG
- && (GET_MODE_SIZE (GET_MODE (SET_DEST (set)))
- <= UNITS_PER_WORD)
- && SUBREG_REG (SET_DEST (set)) == x)))
- return basic_induction_var (SET_SRC (set),
- (GET_MODE (SET_SRC (set)) == VOIDmode
- ? GET_MODE (x)
- : GET_MODE (SET_SRC (set))),
- dest_reg, insn,
- inc_val, mult_val);
+ if ((SET_DEST (set) == x
+ || (GET_CODE (SET_DEST (set)) == SUBREG
+ && (GET_MODE_SIZE (GET_MODE (SET_DEST (set)))
+ <= UNITS_PER_WORD)
+ && SUBREG_REG (SET_DEST (set)) == x))
+ && basic_induction_var (SET_SRC (set),
+ (GET_MODE (SET_SRC (set)) == VOIDmode
+ ? GET_MODE (x)
+ : GET_MODE (SET_SRC (set))),
+ dest_reg, insn,
+ inc_val, mult_val))
+ return 1;
+ }
/* ... fall through ... */
/* Can accept constant setting of biv only when inside inner most loop.
@@ -5253,7 +5409,12 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
case CONST_INT:
case SYMBOL_REF:
case CONST:
- if (loops_enclosed == 1)
+ /* convert_modes aborts if we try to convert to or from CCmode, so just
+ exclude that case. It is very unlikely that a condition code value
+ would be a useful iterator anyways. */
+ if (loops_enclosed == 1
+ && GET_MODE_CLASS (mode) != MODE_CC
+ && GET_MODE_CLASS (GET_MODE (dest_reg)) != MODE_CC)
{
/* Possible bug here? Perhaps we don't know the mode of X. */
*inc_val = convert_modes (GET_MODE (dest_reg), mode, x, 0);
@@ -5266,6 +5427,7 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
case SIGN_EXTEND:
return basic_induction_var (XEXP (x, 0), GET_MODE (XEXP (x, 0)),
dest_reg, p, inc_val, mult_val);
+
case ASHIFTRT:
/* Similar, since this can be a sign extension. */
for (insn = PREV_INSN (p);
@@ -5307,14 +5469,15 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
such that the value of X is biv * mult + add; */
static int
-general_induction_var (x, src_reg, add_val, mult_val)
+general_induction_var (x, src_reg, add_val, mult_val, is_addr, pbenefit)
rtx x;
rtx *src_reg;
rtx *add_val;
rtx *mult_val;
+ int is_addr;
+ int *pbenefit;
{
rtx orig_x = x;
- int benefit = 0;
char *storage;
/* If this is an invariant, forget it, it isn't a giv. */
@@ -5324,7 +5487,8 @@ general_induction_var (x, src_reg, add_val, mult_val)
/* See if the expression could be a giv and get its form.
Mark our place on the obstack in case we don't find a giv. */
storage = (char *) oballoc (0);
- x = simplify_giv_expr (x, &benefit);
+ *pbenefit = 0;
+ x = simplify_giv_expr (x, pbenefit);
if (x == 0)
{
obfree (storage);
@@ -5384,12 +5548,21 @@ general_induction_var (x, src_reg, add_val, mult_val)
if (GET_CODE (*mult_val) == USE)
*mult_val = XEXP (*mult_val, 0);
- benefit += rtx_cost (orig_x, SET);
+ if (is_addr)
+ {
+#ifdef ADDRESS_COST
+ *pbenefit += ADDRESS_COST (orig_x) - reg_address_cost;
+#else
+ *pbenefit += rtx_cost (orig_x, MEM) - reg_address_cost;
+#endif
+ }
+ else
+ *pbenefit += rtx_cost (orig_x, SET);
- /* Always return some benefit if this is a giv so it will be detected
- as such. This allows elimination of bivs that might otherwise
- not be eliminated. */
- return benefit == 0 ? 1 : benefit;
+ /* Always return true if this is a giv so it will be detected as such,
+ even if the benefit is zero or negative. This allows elimination
+ of bivs that might otherwise not be eliminated. */
+ return 1;
}
/* Given an expression, X, try to form it as a linear function of a biv.
@@ -5412,6 +5585,9 @@ general_induction_var (x, src_reg, add_val, mult_val)
*BENEFIT will be incremented by the benefit of any sub-giv encountered. */
+static rtx sge_plus PROTO ((enum machine_mode, rtx, rtx));
+static rtx sge_plus_constant PROTO ((rtx, rtx));
+
static rtx
simplify_giv_expr (x, benefit)
rtx x;
@@ -5426,7 +5602,7 @@ simplify_giv_expr (x, benefit)
if (mode != VOIDmode
&& (GET_MODE_CLASS (mode) != MODE_INT
|| GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT))
- return 0;
+ return NULL_RTX;
switch (GET_CODE (x))
{
@@ -5434,12 +5610,14 @@ simplify_giv_expr (x, benefit)
arg0 = simplify_giv_expr (XEXP (x, 0), benefit);
arg1 = simplify_giv_expr (XEXP (x, 1), benefit);
if (arg0 == 0 || arg1 == 0)
- return 0;
+ return NULL_RTX;
/* Put constant last, CONST_INT last if both constant. */
if ((GET_CODE (arg0) == USE
|| GET_CODE (arg0) == CONST_INT)
- && GET_CODE (arg1) != CONST_INT)
+ && ! ((GET_CODE (arg0) == USE
+ && GET_CODE (arg1) == USE)
+ || GET_CODE (arg1) == CONST_INT))
tem = arg0, arg0 = arg1, arg1 = tem;
/* Handle addition of zero, then addition of an invariant. */
@@ -5450,29 +5628,22 @@ simplify_giv_expr (x, benefit)
{
case CONST_INT:
case USE:
- /* Both invariant. Only valid if sum is machine operand.
- First strip off possible USE on the operands. */
+ /* Adding two invariants must result in an invariant, so enclose
+ addition operation inside a USE and return it. */
if (GET_CODE (arg0) == USE)
arg0 = XEXP (arg0, 0);
-
if (GET_CODE (arg1) == USE)
arg1 = XEXP (arg1, 0);
- tem = 0;
- if (CONSTANT_P (arg0) && GET_CODE (arg1) == CONST_INT)
- {
- tem = plus_constant (arg0, INTVAL (arg1));
- if (GET_CODE (tem) != CONST_INT)
- tem = gen_rtx_USE (mode, tem);
- }
+ if (GET_CODE (arg0) == CONST_INT)
+ tem = arg0, arg0 = arg1, arg1 = tem;
+ if (GET_CODE (arg1) == CONST_INT)
+ tem = sge_plus_constant (arg0, arg1);
else
- {
- /* Adding two invariants must result in an invariant,
- so enclose addition operation inside a USE and
- return it. */
- tem = gen_rtx_USE (mode, gen_rtx_PLUS (mode, arg0, arg1));
- }
+ tem = sge_plus (mode, arg0, arg1);
+ if (GET_CODE (tem) != CONST_INT)
+ tem = gen_rtx_USE (mode, tem);
return tem;
case REG:
@@ -5482,11 +5653,10 @@ simplify_giv_expr (x, benefit)
case PLUS:
/* (a + invar_1) + invar_2. Associate. */
- return simplify_giv_expr (gen_rtx_PLUS (mode,
- XEXP (arg0, 0),
- gen_rtx_PLUS (mode,
- XEXP (arg0, 1), arg1)),
- benefit);
+ return simplify_giv_expr (
+ gen_rtx_PLUS (mode, XEXP (arg0, 0),
+ gen_rtx_PLUS (mode, XEXP (arg0, 1), arg1)),
+ benefit);
default:
abort ();
@@ -5514,10 +5684,10 @@ simplify_giv_expr (x, benefit)
/* Now must have MULT + MULT. Distribute if same biv, else not giv. */
if (GET_CODE (arg0) != MULT || GET_CODE (arg1) != MULT)
- abort ();
+ return NULL_RTX;
- if (XEXP (arg0, 0) != XEXP (arg1, 0))
- return 0;
+ if (!rtx_equal_p (arg0, arg1))
+ return NULL_RTX;
return simplify_giv_expr (gen_rtx_MULT (mode,
XEXP (arg0, 0),
@@ -5538,7 +5708,7 @@ simplify_giv_expr (x, benefit)
arg0 = simplify_giv_expr (XEXP (x, 0), benefit);
arg1 = simplify_giv_expr (XEXP (x, 1), benefit);
if (arg0 == 0 || arg1 == 0)
- return 0;
+ return NULL_RTX;
/* Put constant last, CONST_INT last if both constant. */
if ((GET_CODE (arg0) == USE || GET_CODE (arg0) == CONST_INT)
@@ -5547,7 +5717,7 @@ simplify_giv_expr (x, benefit)
/* If second argument is not now constant, not giv. */
if (GET_CODE (arg1) != USE && GET_CODE (arg1) != CONST_INT)
- return 0;
+ return NULL_RTX;
/* Handle multiply by 0 or 1. */
if (arg1 == const0_rtx)
@@ -5567,8 +5737,25 @@ simplify_giv_expr (x, benefit)
return GEN_INT (INTVAL (arg0) * INTVAL (arg1));
case USE:
- /* invar * invar. Not giv. */
- return 0;
+ /* invar * invar. It is a giv, but very few of these will
+ actually pay off, so limit to simple registers. */
+ if (GET_CODE (arg1) != CONST_INT)
+ return NULL_RTX;
+
+ arg0 = XEXP (arg0, 0);
+ if (GET_CODE (arg0) == REG)
+ tem = gen_rtx_MULT (mode, arg0, arg1);
+ else if (GET_CODE (arg0) == MULT
+ && GET_CODE (XEXP (arg0, 0)) == REG
+ && GET_CODE (XEXP (arg0, 1)) == CONST_INT)
+ {
+ tem = gen_rtx_MULT (mode, XEXP (arg0, 0),
+ GEN_INT (INTVAL (XEXP (arg0, 1))
+ * INTVAL (arg1)));
+ }
+ else
+ return NULL_RTX;
+ return gen_rtx_USE (mode, tem);
case MULT:
/* (a * invar_1) * invar_2. Associate. */
@@ -5649,6 +5836,72 @@ simplify_giv_expr (x, benefit)
}
default:
+ /* If it isn't an induction variable, and it is invariant, we
+ may be able to simplify things further by looking through
+ the bits we just moved outside the loop. */
+ if (invariant_p (x) == 1)
+ {
+ struct movable *m;
+
+ for (m = the_movables; m ; m = m->next)
+ if (rtx_equal_p (x, m->set_dest))
+ {
+ /* Ok, we found a match. Substitute and simplify. */
+
+ /* If we match another movable, we must use that, as
+ this one is going away. */
+ if (m->match)
+ return simplify_giv_expr (m->match->set_dest, benefit);
+
+ /* If consec is non-zero, this is a member of a group of
+ instructions that were moved together. We handle this
+ case only to the point of seeking to the last insn and
+ looking for a REG_EQUAL. Fail if we don't find one. */
+ if (m->consec != 0)
+ {
+ int i = m->consec;
+ tem = m->insn;
+ do { tem = NEXT_INSN (tem); } while (--i > 0);
+
+ tem = find_reg_note (tem, REG_EQUAL, NULL_RTX);
+ if (tem)
+ tem = XEXP (tem, 0);
+ }
+ else
+ {
+ tem = single_set (m->insn);
+ if (tem)
+ tem = SET_SRC (tem);
+ }
+
+ if (tem)
+ {
+ /* What we are most interested in is pointer
+ arithmetic on invariants -- only take
+ patterns we may be able to do something with. */
+ if (GET_CODE (tem) == PLUS
+ || GET_CODE (tem) == MULT
+ || GET_CODE (tem) == ASHIFT
+ || GET_CODE (tem) == CONST_INT
+ || GET_CODE (tem) == SYMBOL_REF)
+ {
+ tem = simplify_giv_expr (tem, benefit);
+ if (tem)
+ return tem;
+ }
+ else if (GET_CODE (tem) == CONST
+ && GET_CODE (XEXP (tem, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (tem, 0), 0)) == SYMBOL_REF
+ && GET_CODE (XEXP (XEXP (tem, 0), 1)) == CONST_INT)
+ {
+ tem = simplify_giv_expr (XEXP (tem, 0), benefit);
+ if (tem)
+ return tem;
+ }
+ }
+ break;
+ }
+ }
break;
}
@@ -5663,13 +5916,67 @@ simplify_giv_expr (x, benefit)
{
if (GET_CODE (x) == CONST_INT)
return x;
- else
- return gen_rtx_USE (mode, x);
+ if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
+ x = XEXP (x, 0);
+ return gen_rtx_USE (mode, x);
}
else
return 0;
}
}
+
+/* This routine folds invariants such that there is only ever one
+ CONST_INT in the summation. It is only used by simplify_giv_expr. */
+
+static rtx
+sge_plus_constant (x, c)
+ rtx x, c;
+{
+ if (GET_CODE (x) == CONST_INT)
+ return GEN_INT (INTVAL (x) + INTVAL (c));
+ else if (GET_CODE (x) != PLUS)
+ return gen_rtx_PLUS (GET_MODE (x), x, c);
+ else if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ return gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0),
+ GEN_INT (INTVAL (XEXP (x, 1)) + INTVAL (c)));
+ }
+ else if (GET_CODE (XEXP (x, 0)) == PLUS
+ || GET_CODE (XEXP (x, 1)) != PLUS)
+ {
+ return gen_rtx_PLUS (GET_MODE (x),
+ sge_plus_constant (XEXP (x, 0), c), XEXP (x, 1));
+ }
+ else
+ {
+ return gen_rtx_PLUS (GET_MODE (x),
+ sge_plus_constant (XEXP (x, 1), c), XEXP (x, 0));
+ }
+}
+
+static rtx
+sge_plus (mode, x, y)
+ enum machine_mode mode;
+ rtx x, y;
+{
+ while (GET_CODE (y) == PLUS)
+ {
+ rtx a = XEXP (y, 0);
+ if (GET_CODE (a) == CONST_INT)
+ x = sge_plus_constant (x, a);
+ else
+ x = gen_rtx_PLUS (mode, x, a);
+ y = XEXP (y, 1);
+ }
+ if (GET_CODE (y) == CONST_INT)
+ x = sge_plus_constant (x, y);
+ else
+ x = gen_rtx_PLUS (mode, x, y);
+ return x;
+}
/* Help detect a giv that is calculated by several consecutive insns;
for example,
@@ -5725,7 +6032,7 @@ consec_sets_giv (first_benefit, p, src_reg, dest_reg,
reg_iv_type[REGNO (dest_reg)] = GENERAL_INDUCT;
reg_iv_info[REGNO (dest_reg)] = v;
- count = n_times_set[REGNO (dest_reg)] - 1;
+ count = VARRAY_INT (n_times_set, REGNO (dest_reg)) - 1;
while (count > 0)
{
@@ -5740,12 +6047,12 @@ consec_sets_giv (first_benefit, p, src_reg, dest_reg,
&& (set = single_set (p))
&& GET_CODE (SET_DEST (set)) == REG
&& SET_DEST (set) == dest_reg
- && ((benefit = general_induction_var (SET_SRC (set), &src_reg,
- add_val, mult_val))
+ && (general_induction_var (SET_SRC (set), &src_reg,
+ add_val, mult_val, 0, &benefit)
/* Giv created by equivalent expression. */
|| ((temp = find_reg_note (p, REG_EQUAL, NULL_RTX))
- && (benefit = general_induction_var (XEXP (temp, 0), &src_reg,
- add_val, mult_val))))
+ && general_induction_var (XEXP (temp, 0), &src_reg,
+ add_val, mult_val, 0, &benefit)))
&& src_reg == v->src_reg)
{
if (find_reg_note (p, REG_RETVAL, NULL_RTX))
@@ -5780,13 +6087,110 @@ consec_sets_giv (first_benefit, p, src_reg, dest_reg,
it cannot possibly be a valid address, 0 is returned.
To perform the computation, we note that
- G1 = a * v + b and
- G2 = c * v + d
+ G1 = x * v + a and
+ G2 = y * v + b
where `v' is the biv.
- So G2 = (c/a) * G1 + (d - b*c/a) */
+ So G2 = (y/b) * G1 + (b - a*y/x).
+
+ Note that MULT = y/x.
+
+ Update: A and B are now allowed to be additive expressions such that
+ B contains all variables in A. That is, computing B-A will not require
+ subtracting variables. */
+
+static rtx
+express_from_1 (a, b, mult)
+ rtx a, b, mult;
+{
+ /* If MULT is zero, then A*MULT is zero, and our expression is B. */
+
+ if (mult == const0_rtx)
+ return b;
+
+ /* If MULT is not 1, we cannot handle A with non-constants, since we
+ would then be required to subtract multiples of the registers in A.
+ This is theoretically possible, and may even apply to some Fortran
+ constructs, but it is a lot of work and we do not attempt it here. */
+
+ if (mult != const1_rtx && GET_CODE (a) != CONST_INT)
+ return NULL_RTX;
+
+ /* In general these structures are sorted top to bottom (down the PLUS
+ chain), but not left to right across the PLUS. If B is a higher
+ order giv than A, we can strip one level and recurse. If A is higher
+ order, we'll eventually bail out, but won't know that until the end.
+ If they are the same, we'll strip one level around this loop. */
+
+ while (GET_CODE (a) == PLUS && GET_CODE (b) == PLUS)
+ {
+ rtx ra, rb, oa, ob, tmp;
+
+ ra = XEXP (a, 0), oa = XEXP (a, 1);
+ if (GET_CODE (ra) == PLUS)
+ tmp = ra, ra = oa, oa = tmp;
+
+ rb = XEXP (b, 0), ob = XEXP (b, 1);
+ if (GET_CODE (rb) == PLUS)
+ tmp = rb, rb = ob, ob = tmp;
+
+ if (rtx_equal_p (ra, rb))
+ /* We matched: remove one reg completely. */
+ a = oa, b = ob;
+ else if (GET_CODE (ob) != PLUS && rtx_equal_p (ra, ob))
+ /* An alternate match. */
+ a = oa, b = rb;
+ else if (GET_CODE (oa) != PLUS && rtx_equal_p (oa, rb))
+ /* An alternate match. */
+ a = ra, b = ob;
+ else
+ {
+ /* Indicates an extra register in B. Strip one level from B and
+ recurse, hoping B was the higher order expression. */
+ ob = express_from_1 (a, ob, mult);
+ if (ob == NULL_RTX)
+ return NULL_RTX;
+ return gen_rtx_PLUS (GET_MODE (b), rb, ob);
+ }
+ }
+
+ /* Here we are at the last level of A, go through the cases hoping to
+ get rid of everything but a constant. */
+
+ if (GET_CODE (a) == PLUS)
+ {
+ rtx ra, oa;
+
+ ra = XEXP (a, 0), oa = XEXP (a, 1);
+ if (rtx_equal_p (oa, b))
+ oa = ra;
+ else if (!rtx_equal_p (ra, b))
+ return NULL_RTX;
+
+ if (GET_CODE (oa) != CONST_INT)
+ return NULL_RTX;
+
+ return GEN_INT (-INTVAL (oa) * INTVAL (mult));
+ }
+ else if (GET_CODE (a) == CONST_INT)
+ {
+ return plus_constant (b, -INTVAL (a) * INTVAL (mult));
+ }
+ else if (GET_CODE (b) == PLUS)
+ {
+ if (rtx_equal_p (a, XEXP (b, 0)))
+ return XEXP (b, 1);
+ else if (rtx_equal_p (a, XEXP (b, 1)))
+ return XEXP (b, 0);
+ else
+ return NULL_RTX;
+ }
+ else if (rtx_equal_p (a, b))
+ return const0_rtx;
+
+ return NULL_RTX;
+}
-#ifdef ADDRESS_COST
static rtx
express_from (g1, g2)
struct induction *g1, *g2;
@@ -5796,15 +6200,25 @@ express_from (g1, g2)
/* The value that G1 will be multiplied by must be a constant integer. Also,
the only chance we have of getting a valid address is if b*c/a (see above
for notation) is also an integer. */
- if (GET_CODE (g1->mult_val) != CONST_INT
- || GET_CODE (g2->mult_val) != CONST_INT
- || GET_CODE (g1->add_val) != CONST_INT
- || g1->mult_val == const0_rtx
- || INTVAL (g2->mult_val) % INTVAL (g1->mult_val) != 0)
- return 0;
+ if (GET_CODE (g1->mult_val) == CONST_INT
+ && GET_CODE (g2->mult_val) == CONST_INT)
+ {
+ if (g1->mult_val == const0_rtx
+ || INTVAL (g2->mult_val) % INTVAL (g1->mult_val) != 0)
+ return NULL_RTX;
+ mult = GEN_INT (INTVAL (g2->mult_val) / INTVAL (g1->mult_val));
+ }
+ else if (rtx_equal_p (g1->mult_val, g2->mult_val))
+ mult = const1_rtx;
+ else
+ {
+ /* ??? Find out if the one is a multiple of the other? */
+ return NULL_RTX;
+ }
- mult = GEN_INT (INTVAL (g2->mult_val) / INTVAL (g1->mult_val));
- add = plus_constant (g2->add_val, - INTVAL (g1->add_val) * INTVAL (mult));
+ add = express_from_1 (g1->add_val, g2->add_val, mult);
+ if (add == NULL_RTX)
+ return NULL_RTX;
/* Form simplified final result. */
if (mult == const0_rtx)
@@ -5819,57 +6233,101 @@ express_from (g1, g2)
else
return gen_rtx_PLUS (g2->mode, mult, add);
}
-#endif
-/* Return 1 if giv G2 can be combined with G1. This means that G2 can use
- (either directly or via an address expression) a register used to represent
- G1. Set g2->new_reg to a represtation of G1 (normally just
- g1->dest_reg). */
+/* Return an rtx, if any, that expresses giv G2 as a function of the register
+ represented by G1. This indicates that G2 should be combined with G1 and
+ that G2 can use (either directly or via an address expression) a register
+ used to represent G1. */
-static int
+static rtx
combine_givs_p (g1, g2)
struct induction *g1, *g2;
{
- rtx tem;
+ rtx tem = express_from (g1, g2);
- /* If these givs are identical, they can be combined. */
- if (rtx_equal_p (g1->mult_val, g2->mult_val)
- && rtx_equal_p (g1->add_val, g2->add_val))
+ /* If these givs are identical, they can be combined. We use the results
+ of express_from because the addends are not in a canonical form, so
+ rtx_equal_p is a weaker test. */
+ if (tem == g1->dest_reg)
{
- g2->new_reg = g1->dest_reg;
- return 1;
+ return g1->dest_reg;
}
-#ifdef ADDRESS_COST
/* If G2 can be expressed as a function of G1 and that function is valid
as an address and no more expensive than using a register for G2,
the expression of G2 in terms of G1 can be used. */
- if (g2->giv_type == DEST_ADDR
- && (tem = express_from (g1, g2)) != 0
+ if (tem != NULL_RTX
+ && g2->giv_type == DEST_ADDR
&& memory_address_p (g2->mem_mode, tem)
- && ADDRESS_COST (tem) <= ADDRESS_COST (*g2->location))
+ /* ??? Looses, especially with -fforce-addr, where *g2->location
+ will always be a register, and so anything more complicated
+ gets discarded. */
+#if 0
+#ifdef ADDRESS_COST
+ && ADDRESS_COST (tem) <= ADDRESS_COST (*g2->location)
+#else
+ && rtx_cost (tem, MEM) <= rtx_cost (*g2->location, MEM)
+#endif
+#endif
+ )
{
- g2->new_reg = tem;
- return 1;
+ return tem;
}
-#endif
- return 0;
+ return NULL_RTX;
}
-#ifdef GIV_SORT_CRITERION
-/* Compare two givs and sort the most desirable one for combinations first.
- This is used only in one qsort call below. */
+struct combine_givs_stats
+{
+ int giv_number;
+ int total_benefit;
+};
+
+static int
+cmp_combine_givs_stats (x, y)
+ struct combine_givs_stats *x, *y;
+{
+ int d;
+ d = y->total_benefit - x->total_benefit;
+ /* Stabilize the sort. */
+ if (!d)
+ d = x->giv_number - y->giv_number;
+ return d;
+}
+
+/* If one of these givs is a DEST_REG that was only used once, by the
+ other giv, this is actually a single use. Return 0 if this is not
+ the case, -1 if g1 is the DEST_REG involved, and 1 if it was g2. */
static int
-giv_sort (x, y)
- struct induction **x, **y;
+combine_givs_used_once (g1, g2)
+ struct induction *g1, *g2;
{
- GIV_SORT_CRITERION (*x, *y);
+ if (g1->giv_type == DEST_REG
+ && VARRAY_INT (n_times_used, REGNO (g1->dest_reg)) == 1
+ && reg_mentioned_p (g1->dest_reg, PATTERN (g2->insn)))
+ return -1;
+
+ if (g2->giv_type == DEST_REG
+ && VARRAY_INT (n_times_used, REGNO (g2->dest_reg)) == 1
+ && reg_mentioned_p (g2->dest_reg, PATTERN (g1->insn)))
+ return 1;
return 0;
}
-#endif
+
+static int
+combine_givs_benefit_from (g1, g2)
+ struct induction *g1, *g2;
+{
+ int tmp = combine_givs_used_once (g1, g2);
+ if (tmp < 0)
+ return 0;
+ else if (tmp > 0)
+ return g2->benefit - g1->benefit;
+ else
+ return g2->benefit;
+}
/* Check all pairs of givs for iv_class BL and see if any can be combined with
any other. If so, point SAME to the giv combined with and set NEW_REG to
@@ -5881,80 +6339,155 @@ combine_givs (bl)
struct iv_class *bl;
{
struct induction *g1, *g2, **giv_array;
- int i, j, giv_count, pass;
+ int i, j, k, giv_count;
+ struct combine_givs_stats *stats;
+ rtx *can_combine;
/* Count givs, because bl->giv_count is incorrect here. */
giv_count = 0;
for (g1 = bl->giv; g1; g1 = g1->next_iv)
- giv_count++;
+ if (!g1->ignore)
+ giv_count++;
giv_array
= (struct induction **) alloca (giv_count * sizeof (struct induction *));
i = 0;
for (g1 = bl->giv; g1; g1 = g1->next_iv)
- giv_array[i++] = g1;
-
-#ifdef GIV_SORT_CRITERION
- /* Sort the givs if GIV_SORT_CRITERION is defined.
- This is usually defined for processors which lack
- negative register offsets so more givs may be combined. */
+ if (!g1->ignore)
+ giv_array[i++] = g1;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "%d givs counted, sorting...\n", giv_count);
+ stats = (struct combine_givs_stats *) alloca (giv_count * sizeof (*stats));
+ bzero ((char *) stats, giv_count * sizeof (*stats));
- qsort (giv_array, giv_count, sizeof (struct induction *), giv_sort);
-#endif
+ can_combine = (rtx *) alloca (giv_count * giv_count * sizeof(rtx));
+ bzero ((char *) can_combine, giv_count * giv_count * sizeof(rtx));
for (i = 0; i < giv_count; i++)
{
+ int this_benefit;
+
g1 = giv_array[i];
- for (pass = 0; pass <= 1; pass++)
- for (j = 0; j < giv_count; j++)
- {
- g2 = giv_array[j];
- if (g1 != g2
- /* First try to combine with replaceable givs, then all givs. */
- && (g1->replaceable || pass == 1)
- /* If either has already been combined or is to be ignored, can't
- combine. */
- && ! g1->ignore && ! g2->ignore && ! g1->same && ! g2->same
- /* If something has been based on G2, G2 cannot itself be based
- on something else. */
- && ! g2->combined_with
- && combine_givs_p (g1, g2))
- {
- /* g2->new_reg set by `combine_givs_p' */
- g2->same = g1;
- g1->combined_with = 1;
-
- /* If one of these givs is a DEST_REG that was only used
- once, by the other giv, this is actually a single use.
- The DEST_REG has the correct cost, while the other giv
- counts the REG use too often. */
- if (g2->giv_type == DEST_REG
- && n_times_used[REGNO (g2->dest_reg)] == 1
- && reg_mentioned_p (g2->dest_reg, PATTERN (g1->insn)))
- g1->benefit = g2->benefit;
- else if (g1->giv_type != DEST_REG
- || n_times_used[REGNO (g1->dest_reg)] != 1
- || ! reg_mentioned_p (g1->dest_reg,
- PATTERN (g2->insn)))
- {
- g1->benefit += g2->benefit;
- g1->times_used += g2->times_used;
- }
- /* ??? The new final_[bg]iv_value code does a much better job
- of finding replaceable giv's, and hence this code may no
- longer be necessary. */
- if (! g2->replaceable && REG_USERVAR_P (g2->dest_reg))
- g1->benefit -= copy_cost;
- g1->lifetime += g2->lifetime;
+
+ this_benefit = g1->benefit;
+ /* Add an additional weight for zero addends. */
+ if (g1->no_const_addval)
+ this_benefit += 1;
+ for (j = 0; j < giv_count; j++)
+ {
+ rtx this_combine;
+
+ g2 = giv_array[j];
+ if (g1 != g2
+ && (this_combine = combine_givs_p (g1, g2)) != NULL_RTX)
+ {
+ can_combine[i*giv_count + j] = this_combine;
+ this_benefit += combine_givs_benefit_from (g1, g2);
+ /* Add an additional weight for being reused more times. */
+ this_benefit += 3;
+ }
+ }
+ stats[i].giv_number = i;
+ stats[i].total_benefit = this_benefit;
+ }
+
+ /* Iterate, combining until we can't. */
+restart:
+ qsort (stats, giv_count, sizeof(*stats), cmp_combine_givs_stats);
+
+ if (loop_dump_stream)
+ {
+ fprintf (loop_dump_stream, "Sorted combine statistics:\n");
+ for (k = 0; k < giv_count; k++)
+ {
+ g1 = giv_array[stats[k].giv_number];
+ if (!g1->combined_with && !g1->same)
+ fprintf (loop_dump_stream, " {%d, %d}",
+ INSN_UID (giv_array[stats[k].giv_number]->insn),
+ stats[k].total_benefit);
+ }
+ putc ('\n', loop_dump_stream);
+ }
+
+ for (k = 0; k < giv_count; k++)
+ {
+ int g1_add_benefit = 0;
+
+ i = stats[k].giv_number;
+ g1 = giv_array[i];
+
+ /* If it has already been combined, skip. */
+ if (g1->combined_with || g1->same)
+ continue;
+
+ for (j = 0; j < giv_count; j++)
+ {
+ g2 = giv_array[j];
+ if (g1 != g2 && can_combine[i*giv_count + j]
+ /* If it has already been combined, skip. */
+ && ! g2->same && ! g2->combined_with)
+ {
+ int l;
+
+ g2->new_reg = can_combine[i*giv_count + j];
+ g2->same = g1;
+ g1->combined_with = 1;
+ if (!combine_givs_used_once (g1, g2))
+ g1->times_used += 1;
+ g1->lifetime += g2->lifetime;
+
+ g1_add_benefit += combine_givs_benefit_from (g1, g2);
+
+ /* ??? The new final_[bg]iv_value code does a much better job
+ of finding replaceable giv's, and hence this code may no
+ longer be necessary. */
+ if (! g2->replaceable && REG_USERVAR_P (g2->dest_reg))
+ g1_add_benefit -= copy_cost;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, "giv at %d combined with giv at %d\n",
- INSN_UID (g2->insn), INSN_UID (g1->insn));
- }
- }
+ /* To help optimize the next set of combinations, remove
+ this giv from the benefits of other potential mates. */
+ for (l = 0; l < giv_count; ++l)
+ {
+ int m = stats[l].giv_number;
+ if (can_combine[m*giv_count + j])
+ {
+ /* Remove additional weight for being reused. */
+ stats[l].total_benefit -= 3 +
+ combine_givs_benefit_from (giv_array[m], g2);
+ }
+ }
+
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "giv at %d combined with giv at %d\n",
+ INSN_UID (g2->insn), INSN_UID (g1->insn));
+ }
+ }
+
+ /* To help optimize the next set of combinations, remove
+ this giv from the benefits of other potential mates. */
+ if (g1->combined_with)
+ {
+ for (j = 0; j < giv_count; ++j)
+ {
+ int m = stats[j].giv_number;
+ if (can_combine[m*giv_count + j])
+ {
+ /* Remove additional weight for being reused. */
+ stats[j].total_benefit -= 3 +
+ combine_givs_benefit_from (giv_array[m], g1);
+ }
+ }
+
+ g1->benefit += g1_add_benefit;
+
+ /* We've finished with this giv, and everything it touched.
+ Restart the combination so that proper weights for the
+ rest of the givs are properly taken into account. */
+ /* ??? Ideally we would compact the arrays at this point, so
+ as to not cover old ground. But sanely compacting
+ can_combine is tricky. */
+ goto restart;
+ }
}
}
@@ -5989,7 +6522,23 @@ emit_iv_add_mult (b, m, a, reg, insert_before)
emit_insn_before (seq, insert_before);
- record_base_value (REGNO (reg), b, 0);
+ /* It is entirely possible that the expansion created lots of new
+ registers. Iterate over the sequence we just created and
+ record them all. */
+
+ if (GET_CODE (seq) == SEQUENCE)
+ {
+ int i;
+ for (i = 0; i < XVECLEN (seq, 0); ++i)
+ {
+ rtx set = single_set (XVECEXP (seq, 0, i));
+ if (set && GET_CODE (SET_DEST (set)) == REG)
+ record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
+ }
+ }
+ else if (GET_CODE (seq) == SET
+ && GET_CODE (SET_DEST (seq)) == REG)
+ record_base_value (REGNO (SET_DEST (seq)), SET_SRC (seq), 0);
}
/* Test whether A * B can be computed without
@@ -6192,7 +6741,7 @@ check_dbra_loop (loop_end, insn_count, loop_start)
}
}
}
- else if (num_mem_sets <= 1)
+ else if (INTVAL (bl->biv->add_val) > 0)
{
/* Try to change inc to dec, so can apply above optimization. */
/* Can do this if:
@@ -6212,10 +6761,6 @@ check_dbra_loop (loop_end, insn_count, loop_start)
which is reversible. */
int reversible_mem_store = 1;
- for (p = loop_start; p != loop_end; p = NEXT_INSN (p))
- if (GET_RTX_CLASS (GET_CODE (p)) == 'i')
- num_nonfixed_reads += count_nonfixed_reads (PATTERN (p));
-
if (bl->giv_count == 0
&& ! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]])
{
@@ -6239,7 +6784,6 @@ check_dbra_loop (loop_end, insn_count, loop_start)
/* Don't bother about the end test. */
;
else if (reg_mentioned_p (bivreg, PATTERN (p)))
- /* Any other use of the biv is no good. */
{
no_use_except_counting = 0;
break;
@@ -6247,31 +6791,44 @@ check_dbra_loop (loop_end, insn_count, loop_start)
}
}
- /* If the loop has a single store, and the destination address is
- invariant, then we can't reverse the loop, because this address
- might then have the wrong value at loop exit.
- This would work if the source was invariant also, however, in that
- case, the insn should have been moved out of the loop. */
-
- if (num_mem_sets == 1)
- reversible_mem_store
- = (! unknown_address_altered
- && ! invariant_p (XEXP (loop_store_mems[0], 0)));
+ if (no_use_except_counting)
+ ; /* no need to worry about MEMs. */
+ else if (num_mem_sets <= 1)
+ {
+ for (p = loop_start; p != loop_end; p = NEXT_INSN (p))
+ if (GET_RTX_CLASS (GET_CODE (p)) == 'i')
+ num_nonfixed_reads += count_nonfixed_reads (PATTERN (p));
+
+ /* If the loop has a single store, and the destination address is
+ invariant, then we can't reverse the loop, because this address
+ might then have the wrong value at loop exit.
+ This would work if the source was invariant also, however, in that
+ case, the insn should have been moved out of the loop. */
+
+ if (num_mem_sets == 1)
+ reversible_mem_store
+ = (! unknown_address_altered
+ && ! invariant_p (XEXP (loop_store_mems[0], 0)));
+ }
+ else
+ return 0;
/* This code only acts for innermost loops. Also it simplifies
the memory address check by only reversing loops with
zero or one memory access.
Two memory accesses could involve parts of the same array,
- and that can't be reversed. */
-
- if (num_nonfixed_reads <= 1
- && !loop_has_call
- && !loop_has_volatile
- && reversible_mem_store
- && (no_use_except_counting
- || ((bl->giv_count + bl->biv_count + num_mem_sets
- + num_movables + compare_and_branch == insn_count)
- && (bl == loop_iv_list && bl->next == 0))))
+ and that can't be reversed.
+ If the biv is used only for counting, than we don't need to worry
+ about all these things. */
+
+ if ((num_nonfixed_reads <= 1
+ && !loop_has_call
+ && !loop_has_volatile
+ && reversible_mem_store
+ && (bl->giv_count + bl->biv_count + num_mem_sets
+ + num_movables + compare_and_branch == insn_count)
+ && (bl == loop_iv_list && bl->next == 0))
+ || no_use_except_counting)
{
rtx tem;
@@ -6289,45 +6846,146 @@ check_dbra_loop (loop_end, insn_count, loop_start)
confusing. */
if (comparison
- && GET_CODE (XEXP (comparison, 1)) == CONST_INT
- /* LE gets turned into LT */
- && GET_CODE (comparison) == LT
- && GET_CODE (bl->initial_value) == CONST_INT)
+ /* for constants, LE gets turned into LT */
+ && (GET_CODE (comparison) == LT
+ || (GET_CODE (comparison) == LE
+ && no_use_except_counting)))
{
- HOST_WIDE_INT add_val, comparison_val;
- rtx initial_value;
+ HOST_WIDE_INT add_val, add_adjust, comparison_val;
+ rtx initial_value, comparison_value;
+ int nonneg = 0;
+ enum rtx_code cmp_code;
+ int comparison_const_width;
+ unsigned HOST_WIDE_INT comparison_sign_mask;
+ rtx vtop;
add_val = INTVAL (bl->biv->add_val);
- comparison_val = INTVAL (XEXP (comparison, 1));
+ comparison_value = XEXP (comparison, 1);
+ comparison_const_width
+ = GET_MODE_BITSIZE (GET_MODE (XEXP (comparison, 1)));
+ if (comparison_const_width > HOST_BITS_PER_WIDE_INT)
+ comparison_const_width = HOST_BITS_PER_WIDE_INT;
+ comparison_sign_mask
+ = (unsigned HOST_WIDE_INT)1 << (comparison_const_width - 1);
+
+ /* If the comparison value is not a loop invariant, then we
+ can not reverse this loop.
+
+ ??? If the insns which initialize the comparison value as
+ a whole compute an invariant result, then we could move
+ them out of the loop and proceed with loop reversal. */
+ if (!invariant_p (comparison_value))
+ return 0;
+
+ if (GET_CODE (comparison_value) == CONST_INT)
+ comparison_val = INTVAL (comparison_value);
initial_value = bl->initial_value;
/* Normalize the initial value if it is an integer and
has no other use except as a counter. This will allow
a few more loops to be reversed. */
if (no_use_except_counting
+ && GET_CODE (comparison_value) == CONST_INT
&& GET_CODE (initial_value) == CONST_INT)
{
comparison_val = comparison_val - INTVAL (bl->initial_value);
- /* Check for overflow. If comparison_val ends up as a
- negative value, then we can't reverse the loop. */
- if (comparison_val >= 0)
- initial_value = const0_rtx;
+ /* The code below requires comparison_val to be a multiple
+ of add_val in order to do the loop reversal, so
+ round up comparison_val to a multiple of add_val.
+ Since comparison_value is constant, we know that the
+ current comparison code is LT. */
+ comparison_val = comparison_val + add_val - 1;
+ comparison_val
+ -= (unsigned HOST_WIDE_INT) comparison_val % add_val;
+ /* We postpone overflow checks for COMPARISON_VAL here;
+ even if there is an overflow, we might still be able to
+ reverse the loop, if converting the loop exit test to
+ NE is possible. */
+ initial_value = const0_rtx;
+ }
+
+ /* Check if there is a NOTE_INSN_LOOP_VTOP note. If there is,
+ that means that this is a for or while style loop, with
+ a loop exit test at the start. Thus, we can assume that
+ the loop condition was true when the loop was entered.
+ This allows us to change the loop exit condition to an
+ equality test.
+ We start at the end and search backwards for the previous
+ NOTE. If there is no NOTE_INSN_LOOP_VTOP for this loop,
+ the search will stop at the NOTE_INSN_LOOP_CONT. */
+ vtop = loop_end;
+ do
+ vtop = PREV_INSN (vtop);
+ while (GET_CODE (vtop) != NOTE
+ || NOTE_LINE_NUMBER (vtop) > 0
+ || NOTE_LINE_NUMBER (vtop) == NOTE_REPEATED_LINE_NUMBER
+ || NOTE_LINE_NUMBER (vtop) == NOTE_INSN_DELETED);
+ if (NOTE_LINE_NUMBER (vtop) != NOTE_INSN_LOOP_VTOP)
+ vtop = NULL_RTX;
+
+ /* First check if we can do a vanilla loop reversal. */
+ if (initial_value == const0_rtx
+ /* If we have a decrement_and_branch_on_count, prefer
+ the NE test, since this will allow that instruction to
+ be generated. Note that we must use a vanilla loop
+ reversal if the biv is used to calculate a giv or has
+ a non-counting use. */
+#if ! defined (HAVE_decrement_and_branch_until_zero) && defined (HAVE_decrement_and_branch_on_count)
+ && (! (add_val == 1 && vtop
+ && (bl->biv_count == 0
+ || no_use_except_counting)))
+#endif
+ && GET_CODE (comparison_value) == CONST_INT
+ /* Now do postponed overflow checks on COMPARISON_VAL. */
+ && ! (((comparison_val - add_val) ^ INTVAL (comparison_value))
+ & comparison_sign_mask))
+ {
+ /* Register will always be nonnegative, with value
+ 0 on last iteration */
+ add_adjust = add_val;
+ nonneg = 1;
+ cmp_code = GE;
+ }
+ else if (add_val == 1 && vtop
+ && (bl->biv_count == 0
+ || no_use_except_counting))
+ {
+ add_adjust = 0;
+ cmp_code = NE;
}
+ else
+ return 0;
+
+ if (GET_CODE (comparison) == LE)
+ add_adjust -= add_val;
/* If the initial value is not zero, or if the comparison
value is not an exact multiple of the increment, then we
can not reverse this loop. */
- if (initial_value != const0_rtx
- || (comparison_val % add_val) != 0)
- return 0;
+ if (initial_value == const0_rtx
+ && GET_CODE (comparison_value) == CONST_INT)
+ {
+ if (((unsigned HOST_WIDE_INT) comparison_val % add_val) != 0)
+ return 0;
+ }
+ else
+ {
+ if (! no_use_except_counting || add_val != 1)
+ return 0;
+ }
+
+ final_value = comparison_value;
/* Reset these in case we normalized the initial value
and comparison value above. */
+ if (GET_CODE (comparison_value) == CONST_INT
+ && GET_CODE (initial_value) == CONST_INT)
+ {
+ comparison_value = GEN_INT (comparison_val);
+ final_value
+ = GEN_INT (comparison_val + INTVAL (bl->initial_value));
+ }
bl->initial_value = initial_value;
- XEXP (comparison, 1) = GEN_INT (comparison_val);
-
- /* Register will always be nonnegative, with value
- 0 on last iteration if loop reversed */
/* Save some info needed to produce the new insns. */
reg = bl->biv->dest_reg;
@@ -6336,14 +6994,59 @@ check_dbra_loop (loop_end, insn_count, loop_start)
jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 2);
new_add_val = GEN_INT (- INTVAL (bl->biv->add_val));
- final_value = XEXP (comparison, 1);
- start_value = GEN_INT (INTVAL (XEXP (comparison, 1))
- - INTVAL (bl->biv->add_val));
-
- /* Initialize biv to start_value before loop start.
+ /* Set start_value; if this is not a CONST_INT, we need
+ to generate a SUB.
+ Initialize biv to start_value before loop start.
The old initializing insn will be deleted as a
dead store by flow.c. */
- emit_insn_before (gen_move_insn (reg, start_value), loop_start);
+ if (initial_value == const0_rtx
+ && GET_CODE (comparison_value) == CONST_INT)
+ {
+ start_value = GEN_INT (comparison_val - add_adjust);
+ emit_insn_before (gen_move_insn (reg, start_value),
+ loop_start);
+ }
+ else if (GET_CODE (initial_value) == CONST_INT)
+ {
+ rtx offset = GEN_INT (-INTVAL (initial_value) - add_adjust);
+ enum machine_mode mode = GET_MODE (reg);
+ enum insn_code icode
+ = add_optab->handlers[(int) mode].insn_code;
+ if (! (*insn_operand_predicate[icode][0]) (reg, mode)
+ || ! ((*insn_operand_predicate[icode][1])
+ (comparison_value, mode))
+ || ! (*insn_operand_predicate[icode][2]) (offset, mode))
+ return 0;
+ start_value
+ = gen_rtx_PLUS (mode, comparison_value, offset);
+ emit_insn_before ((GEN_FCN (icode)
+ (reg, comparison_value, offset)),
+ loop_start);
+ if (GET_CODE (comparison) == LE)
+ final_value = gen_rtx_PLUS (mode, comparison_value,
+ GEN_INT (add_val));
+ }
+ else if (! add_adjust)
+ {
+ enum machine_mode mode = GET_MODE (reg);
+ enum insn_code icode
+ = sub_optab->handlers[(int) mode].insn_code;
+ if (! (*insn_operand_predicate[icode][0]) (reg, mode)
+ || ! ((*insn_operand_predicate[icode][1])
+ (comparison_value, mode))
+ || ! ((*insn_operand_predicate[icode][2])
+ (initial_value, mode)))
+ return 0;
+ start_value
+ = gen_rtx_MINUS (mode, comparison_value, initial_value);
+ emit_insn_before ((GEN_FCN (icode)
+ (reg, comparison_value, initial_value)),
+ loop_start);
+ }
+ else
+ /* We could handle the other cases too, but it'll be
+ better to have a testcase first. */
+ return 0;
/* Add insn to decrement register, and delete insn
that incremented the register. */
@@ -6375,29 +7078,33 @@ check_dbra_loop (loop_end, insn_count, loop_start)
/* Add new compare/branch insn at end of loop. */
start_sequence ();
- emit_cmp_insn (reg, const0_rtx, GE, NULL_RTX,
+ emit_cmp_insn (reg, const0_rtx, cmp_code, NULL_RTX,
GET_MODE (reg), 0, 0);
- emit_jump_insn (gen_bge (XEXP (jump_label, 0)));
+ emit_jump_insn ((*bcc_gen_fctn[(int) cmp_code])
+ (XEXP (jump_label, 0)));
tem = gen_sequence ();
end_sequence ();
emit_jump_insn_before (tem, loop_end);
- for (tem = PREV_INSN (loop_end);
- tem && GET_CODE (tem) != JUMP_INSN; tem = PREV_INSN (tem))
- ;
- if (tem)
+ if (nonneg)
{
- JUMP_LABEL (tem) = XEXP (jump_label, 0);
+ for (tem = PREV_INSN (loop_end);
+ tem && GET_CODE (tem) != JUMP_INSN;
+ tem = PREV_INSN (tem))
+ ;
+ if (tem)
+ {
+ JUMP_LABEL (tem) = XEXP (jump_label, 0);
- /* Increment of LABEL_NUSES done above. */
- /* Register is now always nonnegative,
- so add REG_NONNEG note to the branch. */
- REG_NOTES (tem) = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX,
- REG_NOTES (tem));
+ /* Increment of LABEL_NUSES done above. */
+ /* Register is now always nonnegative,
+ so add REG_NONNEG note to the branch. */
+ REG_NOTES (tem) = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX,
+ REG_NOTES (tem));
+ }
+ bl->nonneg = 1;
}
- bl->nonneg = 1;
-
/* Mark that this biv has been reversed. Each giv which depends
on this biv, and which is also live past the end of the loop
will have to be fixed up. */
@@ -6978,6 +7685,7 @@ get_condition (jump, earliest)
rtx op0, op1;
int reverse_code = 0;
int did_reverse_condition = 0;
+ enum machine_mode mode;
/* If this is not a standard conditional jump, we can't parse it. */
if (GET_CODE (jump) != JUMP_INSN
@@ -6985,6 +7693,7 @@ get_condition (jump, earliest)
return 0;
code = GET_CODE (XEXP (SET_SRC (PATTERN (jump)), 0));
+ mode = GET_MODE (XEXP (SET_SRC (PATTERN (jump)), 0));
op0 = XEXP (XEXP (SET_SRC (PATTERN (jump)), 0), 0);
op1 = XEXP (XEXP (SET_SRC (PATTERN (jump)), 0), 1);
@@ -7051,6 +7760,13 @@ get_condition (jump, earliest)
{
enum machine_mode inner_mode = GET_MODE (SET_SRC (set));
+ /* ??? We may not combine comparisons done in a CCmode with
+ comparisons not done in a CCmode. This is to aid targets
+ like Alpha that have an IEEE compliant EQ instruction, and
+ a non-IEEE compliant BEQ instruction. The use of CCmode is
+ actually artificial, simply to prevent the combination, but
+ should not affect other platforms. */
+
if ((GET_CODE (SET_SRC (set)) == COMPARE
|| (((code == NE
|| (code == LT
@@ -7066,7 +7782,9 @@ get_condition (jump, earliest)
&& FLOAT_STORE_FLAG_VALUE < 0)
#endif
))
- && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<')))
+ && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))
+ && ((GET_MODE_CLASS (mode) == MODE_CC)
+ == (GET_MODE_CLASS (inner_mode) == MODE_CC)))
x = SET_SRC (set);
else if (((code == EQ
|| (code == GE
@@ -7082,7 +7800,9 @@ get_condition (jump, earliest)
&& FLOAT_STORE_FLAG_VALUE < 0)
#endif
))
- && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<')
+ && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'
+ && ((GET_MODE_CLASS (mode) == MODE_CC)
+ == (GET_MODE_CLASS (inner_mode) == MODE_CC)))
{
/* We might have reversed a LT to get a GE here. But this wasn't
actually the comparison of data, so we don't flag that we
@@ -7204,529 +7924,281 @@ get_condition_for_loop (x)
XEXP (comparison, 1), XEXP (comparison, 0));
}
-#ifdef HAIFA
-/* Analyze a loop in order to instrument it with the use of count register.
- loop_start and loop_end are the first and last insns of the loop.
- This function works in cooperation with insert_bct ().
- loop_can_insert_bct[loop_num] is set according to whether the optimization
- is applicable to the loop. When it is applicable, the following variables
- are also set:
- loop_start_value[loop_num]
- loop_comparison_value[loop_num]
- loop_increment[loop_num]
- loop_comparison_code[loop_num] */
-
#ifdef HAVE_decrement_and_branch_on_count
-static
-void analyze_loop_iterations (loop_start, loop_end)
- rtx loop_start, loop_end;
-{
- rtx comparison, comparison_value;
- rtx iteration_var, initial_value, increment;
- enum rtx_code comparison_code;
+/* Instrument loop for insertion of bct instruction. We distinguish between
+ loops with compile-time bounds and those with run-time bounds.
+ Information from loop_iterations() is used to compute compile-time bounds.
+ Run-time bounds should use loop preconditioning, but currently ignored.
+ */
- rtx last_loop_insn;
- rtx insn;
+static void
+insert_bct (loop_start, loop_end)
+ rtx loop_start, loop_end;
+{
int i;
+ unsigned HOST_WIDE_INT n_iterations;
+ rtx insn;
- /* loop_variable mode */
- enum machine_mode original_mode;
-
- /* find the number of the loop */
- int loop_num = uid_loop_num [INSN_UID (loop_start)];
-
- /* we change our mind only when we are sure that loop will be instrumented */
- loop_can_insert_bct[loop_num] = 0;
-
- /* is the optimization suppressed. */
- if ( !flag_branch_on_count_reg )
- return;
-
- /* make sure that count-reg is not in use */
- if (loop_used_count_register[loop_num]){
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed: count register already in use\n",
- loop_num);
- return;
- }
-
- /* make sure that the function has no indirect jumps. */
- if (indirect_jump_in_function){
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed: indirect jump in function\n",
- loop_num);
- return;
- }
-
- /* make sure that the last loop insn is a conditional jump */
- last_loop_insn = PREV_INSN (loop_end);
- if (GET_CODE (last_loop_insn) != JUMP_INSN || !condjump_p (last_loop_insn)) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed: invalid jump at loop end\n",
- loop_num);
- return;
- }
-
- /* First find the iteration variable. If the last insn is a conditional
- branch, and the insn preceding it tests a register value, make that
- register the iteration variable. */
-
- /* We used to use prev_nonnote_insn here, but that fails because it might
- accidentally get the branch for a contained loop if the branch for this
- loop was deleted. We can only trust branches immediately before the
- loop_end. */
+ int increment_direction, compare_direction;
- comparison = get_condition_for_loop (last_loop_insn);
- /* ??? Get_condition may switch position of induction variable and
- invariant register when it canonicalizes the comparison. */
+ /* If the loop condition is <= or >=, the number of iteration
+ is 1 more than the range of the bounds of the loop. */
+ int add_iteration = 0;
- if (comparison == 0) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed: comparison not found\n",
- loop_num);
- return;
- }
+ enum machine_mode loop_var_mode = word_mode;
- comparison_code = GET_CODE (comparison);
- iteration_var = XEXP (comparison, 0);
- comparison_value = XEXP (comparison, 1);
+ int loop_num = uid_loop_num [INSN_UID (loop_start)];
- original_mode = GET_MODE (iteration_var);
- if (GET_MODE_CLASS (original_mode) != MODE_INT
- || GET_MODE_SIZE (original_mode) != UNITS_PER_WORD) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT Instrumentation failed: loop variable not integer\n",
- loop_num);
+ /* It's impossible to instrument a competely unrolled loop. */
+ if (loop_unroll_factor [loop_num] == -1)
return;
- }
-
- /* get info about loop bounds and increment */
- iteration_info (iteration_var, &initial_value, &increment,
- loop_start, loop_end);
- /* make sure that all required loop data were found */
- if (!(initial_value && increment && comparison_value
- && invariant_p (comparison_value) && invariant_p (increment)
- && ! indirect_jump_in_function))
+ /* Make sure that the count register is not in use. */
+ if (loop_used_count_register [loop_num])
{
- if (loop_dump_stream) {
+ if (loop_dump_stream)
fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed because of wrong loop: ", loop_num);
- if (!(initial_value && increment && comparison_value)) {
- fprintf (loop_dump_stream, "\tbounds not available: ");
- if ( ! initial_value )
- fprintf (loop_dump_stream, "initial ");
- if ( ! increment )
- fprintf (loop_dump_stream, "increment ");
- if ( ! comparison_value )
- fprintf (loop_dump_stream, "comparison ");
- fprintf (loop_dump_stream, "\n");
- }
- if (!invariant_p (comparison_value) || !invariant_p (increment))
- fprintf (loop_dump_stream, "\tloop bounds not invariant\n");
- }
+ "insert_bct %d: BCT instrumentation failed: count register already in use\n",
+ loop_num);
return;
}
- /* make sure that the increment is constant */
- if (GET_CODE (increment) != CONST_INT) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: instrumentation failed: not arithmetic loop\n",
- loop_num);
- return;
- }
-
- /* make sure that the loop contains neither function call, nor jump on table.
- (the count register might be altered by the called function, and might
- be used for a branch on table). */
- for (insn = loop_start; insn && insn != loop_end; insn = NEXT_INSN (insn)) {
- if (GET_CODE (insn) == CALL_INSN){
+ /* Make sure that the function has no indirect jumps. */
+ if (indirect_jump_in_function)
+ {
if (loop_dump_stream)
fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed: function call in the loop\n",
- loop_num);
+ "insert_bct %d: BCT instrumentation failed: indirect jump in function\n",
+ loop_num);
return;
}
- if (GET_CODE (insn) == JUMP_INSN
- && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_VEC)){
+ /* Make sure that the last loop insn is a conditional jump. */
+ if (GET_CODE (PREV_INSN (loop_end)) != JUMP_INSN
+ || ! condjump_p (PREV_INSN (loop_end))
+ || simplejump_p (PREV_INSN (loop_end)))
+ {
if (loop_dump_stream)
fprintf (loop_dump_stream,
- "analyze_loop_iterations %d: BCT instrumentation failed: computed branch in the loop\n",
- loop_num);
+ "insert_bct %d: BCT instrumentation failed: invalid jump at loop end\n",
+ loop_num);
return;
}
- }
-
- /* At this point, we are sure that the loop can be instrumented with BCT.
- Some of the loops, however, will not be instrumented - the final decision
- is taken by insert_bct () */
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "analyze_loop_iterations: loop (luid =%d) can be BCT instrumented.\n",
- loop_num);
-
- /* mark all enclosing loops that they cannot use count register */
- /* ???: In fact, since insert_bct may decide not to instrument this loop,
- marking here may prevent instrumenting an enclosing loop that could
- actually be instrumented. But since this is rare, it is safer to mark
- here in case the order of calling (analyze/insert)_bct would be changed. */
- for (i=loop_num; i != -1; i = loop_outer_loop[i])
- loop_used_count_register[i] = 1;
-
- /* Set data structures which will be used by the instrumentation phase */
- loop_start_value[loop_num] = initial_value;
- loop_comparison_value[loop_num] = comparison_value;
- loop_increment[loop_num] = increment;
- loop_comparison_code[loop_num] = comparison_code;
- loop_can_insert_bct[loop_num] = 1;
-}
-
-
-/* instrument loop for insertion of bct instruction. We distinguish between
- loops with compile-time bounds, to those with run-time bounds. The loop
- behaviour is analized according to the following characteristics/variables:
- ; Input variables:
- ; comparison-value: the value to which the iteration counter is compared.
- ; initial-value: iteration-counter initial value.
- ; increment: iteration-counter increment.
- ; Computed variables:
- ; increment-direction: the sign of the increment.
- ; compare-direction: '1' for GT, GTE, '-1' for LT, LTE, '0' for NE.
- ; range-direction: sign (comparison-value - initial-value)
- We give up on the following cases:
- ; loop variable overflow.
- ; run-time loop bounds with comparison code NE.
- */
-static void
-insert_bct (loop_start, loop_end)
- rtx loop_start, loop_end;
-{
- rtx initial_value, comparison_value, increment;
- enum rtx_code comparison_code;
-
- int increment_direction, compare_direction;
- int unsigned_p = 0;
-
- /* if the loop condition is <= or >=, the number of iteration
- is 1 more than the range of the bounds of the loop */
- int add_iteration = 0;
-
- /* the only machine mode we work with - is the integer of the size that the
- machine has */
- enum machine_mode loop_var_mode = SImode;
-
- int loop_num = uid_loop_num [INSN_UID (loop_start)];
-
- /* get loop-variables. No need to check that these are valid - already
- checked in analyze_loop_iterations (). */
- comparison_code = loop_comparison_code[loop_num];
- initial_value = loop_start_value[loop_num];
- comparison_value = loop_comparison_value[loop_num];
- increment = loop_increment[loop_num];
-
- /* check analyze_loop_iterations decision for this loop. */
- if (! loop_can_insert_bct[loop_num]){
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: [%d] - was decided not to instrument by analyze_loop_iterations ()\n",
- loop_num);
- return;
- }
-
- /* It's impossible to instrument a competely unrolled loop. */
- if (loop_unroll_factor [loop_num] == -1)
- return;
-
- /* make sure that the last loop insn is a conditional jump .
- This check is repeated from analyze_loop_iterations (),
- because unrolling might have changed that. */
- if (GET_CODE (PREV_INSN (loop_end)) != JUMP_INSN
- || !condjump_p (PREV_INSN (loop_end))) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: not instrumenting BCT because of invalid branch\n");
- return;
- }
-
- /* fix increment in case loop was unrolled. */
- if (loop_unroll_factor [loop_num] > 1)
- increment = GEN_INT ( INTVAL (increment) * loop_unroll_factor [loop_num] );
-
- /* determine properties and directions of the loop */
- increment_direction = (INTVAL (increment) > 0) ? 1:-1;
- switch ( comparison_code ) {
- case LEU:
- unsigned_p = 1;
- /* fallthrough */
- case LE:
- compare_direction = 1;
- add_iteration = 1;
- break;
- case GEU:
- unsigned_p = 1;
- /* fallthrough */
- case GE:
- compare_direction = -1;
- add_iteration = 1;
- break;
- case EQ:
- /* in this case we cannot know the number of iterations */
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: %d: loop cannot be instrumented: == in condition\n",
- loop_num);
- return;
- case LTU:
- unsigned_p = 1;
- /* fallthrough */
- case LT:
- compare_direction = 1;
- break;
- case GTU:
- unsigned_p = 1;
- /* fallthrough */
- case GT:
- compare_direction = -1;
- break;
- case NE:
- compare_direction = 0;
- break;
- default:
- abort ();
- }
-
-
- /* make sure that the loop does not end by an overflow */
- if (compare_direction != increment_direction) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: %d: loop cannot be instrumented: terminated by overflow\n",
- loop_num);
- return;
- }
-
- /* try to instrument the loop. */
-
- /* Handle the simpler case, where the bounds are known at compile time. */
- if (GET_CODE (initial_value) == CONST_INT && GET_CODE (comparison_value) == CONST_INT)
+ /* Make sure that the loop does not contain a function call
+ (the count register might be altered by the called function). */
+ if (loop_has_call)
{
- int n_iterations;
- int increment_value_abs = INTVAL (increment) * increment_direction;
-
- /* check the relation between compare-val and initial-val */
- int difference = INTVAL (comparison_value) - INTVAL (initial_value);
- int range_direction = (difference > 0) ? 1 : -1;
-
- /* make sure the loop executes enough iterations to gain from BCT */
- if (difference > -3 && difference < 3) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: loop %d not BCT instrumented: too small iteration count.\n",
- loop_num);
- return;
- }
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "insert_bct %d: BCT instrumentation failed: function call in loop\n",
+ loop_num);
+ return;
+ }
- /* make sure that the loop executes at least once */
- if ((range_direction == 1 && compare_direction == -1)
- || (range_direction == -1 && compare_direction == 1))
+ /* Make sure that the loop does not jump via a table.
+ (the count register might be used to perform the branch on table). */
+ for (insn = loop_start; insn && insn != loop_end; insn = NEXT_INSN (insn))
+ {
+ if (GET_CODE (insn) == JUMP_INSN
+ && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
+ || GET_CODE (PATTERN (insn)) == ADDR_VEC))
{
if (loop_dump_stream)
fprintf (loop_dump_stream,
- "insert_bct: loop %d: does not iterate even once. Not instrumenting.\n",
- loop_num);
+ "insert_bct %d: BCT instrumentation failed: computed branch in the loop\n",
+ loop_num);
return;
}
+ }
- /* make sure that the loop does not end by an overflow (in compile time
- bounds we must have an additional check for overflow, because here
- we also support the compare code of 'NE'. */
- if (comparison_code == NE
- && increment_direction != range_direction) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct (compile time bounds): %d: loop not instrumented: terminated by overflow\n",
- loop_num);
- return;
- }
+ /* Account for loop unrolling in instrumented iteration count. */
+ if (loop_unroll_factor [loop_num] > 1)
+ n_iterations = loop_n_iterations / loop_unroll_factor [loop_num];
+ else
+ n_iterations = loop_n_iterations;
- /* Determine the number of iterations by:
- ;
- ; compare-val - initial-val + (increment -1) + additional-iteration
- ; num_iterations = -----------------------------------------------------------------
- ; increment
- */
- difference = (range_direction > 0) ? difference : -difference;
-#if 0
- fprintf (stderr, "difference is: %d\n", difference); /* @*/
- fprintf (stderr, "increment_value_abs is: %d\n", increment_value_abs); /* @*/
- fprintf (stderr, "add_iteration is: %d\n", add_iteration); /* @*/
- fprintf (stderr, "INTVAL (comparison_value) is: %d\n", INTVAL (comparison_value)); /* @*/
- fprintf (stderr, "INTVAL (initial_value) is: %d\n", INTVAL (initial_value)); /* @*/
-#endif
+ if (n_iterations != 0 && n_iterations < 3)
+ {
+ /* Allow an enclosing outer loop to benefit if possible. */
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "insert_bct %d: Too few iterations to benefit from BCT optimization\n",
+ loop_num);
+ return;
+ }
- if (increment_value_abs == 0) {
- fprintf (stderr, "insert_bct: error: increment == 0 !!!\n");
- abort ();
- }
- n_iterations = (difference + increment_value_abs - 1 + add_iteration)
- / increment_value_abs;
+ /* Try to instrument the loop. */
-#if 0
- fprintf (stderr, "number of iterations is: %d\n", n_iterations); /* @*/
-#endif
+ /* Handle the simpler case, where the bounds are known at compile time. */
+ if (n_iterations > 0)
+ {
+ /* Mark all enclosing loops that they cannot use count register. */
+ for (i=loop_num; i != -1; i = loop_outer_loop[i])
+ loop_used_count_register[i] = 1;
instrument_loop_bct (loop_start, loop_end, GEN_INT (n_iterations));
-
- /* Done with this loop. */
return;
}
- /* Handle the more complex case, that the bounds are NOT known at compile time. */
- /* In this case we generate run_time calculation of the number of iterations */
+ /* Handle the more complex case, that the bounds are NOT known
+ at compile time. In this case we generate run_time calculation
+ of the number of iterations. */
+
+ if (GET_MODE_CLASS (GET_MODE (loop_iteration_var)) != MODE_INT
+ || GET_MODE_SIZE (GET_MODE (loop_iteration_var)) != UNITS_PER_WORD)
+ {
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "insert_bct %d: BCT Instrumentation failed: loop variable not integer\n",
+ loop_num);
+ return;
+ }
/* With runtime bounds, if the compare is of the form '!=' we give up */
- if (comparison_code == NE) {
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: fail for loop %d: runtime bounds with != comparison\n",
- loop_num);
- return;
- }
+ if (loop_comparison_code == NE)
+ {
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "insert_bct %d: runtime bounds with != comparison\n",
+ loop_num);
+ return;
+ }
+/* Use common loop preconditioning code instead. */
+#if 0
+ else
+ {
+ /* We rely on the existence of run-time guard to ensure that the
+ loop executes at least once. */
+ rtx sequence;
+ rtx iterations_num_reg;
- else {
- /* We rely on the existence of run-time guard to ensure that the
- loop executes at least once. */
- rtx sequence;
- rtx iterations_num_reg;
+ unsigned HOST_WIDE_INT increment_value_abs
+ = INTVAL (increment) * increment_direction;
- int increment_value_abs = INTVAL (increment) * increment_direction;
+ /* make sure that the increment is a power of two, otherwise (an
+ expensive) divide is needed. */
+ if (exact_log2 (increment_value_abs) == -1)
+ {
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "insert_bct: not instrumenting BCT because the increment is not power of 2\n");
+ return;
+ }
- /* make sure that the increment is a power of two, otherwise (an
- expensive) divide is needed. */
- if (exact_log2 (increment_value_abs) == -1)
+ /* compute the number of iterations */
+ start_sequence ();
{
- if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "insert_bct: not instrumenting BCT because the increment is not power of 2\n");
- return;
- }
-
- /* compute the number of iterations */
- start_sequence ();
- {
- rtx temp_reg;
+ rtx temp_reg;
- /* Again, the number of iterations is calculated by:
- ;
- ; compare-val - initial-val + (increment -1) + additional-iteration
- ; num_iterations = -----------------------------------------------------------------
- ; increment
+ /* Again, the number of iterations is calculated by:
+ ;
+ ; compare-val - initial-val + (increment -1) + additional-iteration
+ ; num_iterations = -----------------------------------------------------------------
+ ; increment
*/
- /* ??? Do we have to call copy_rtx here before passing rtx to
- expand_binop? */
- if (compare_direction > 0) {
- /* <, <= :the loop variable is increasing */
- temp_reg = expand_binop (loop_var_mode, sub_optab, comparison_value,
- initial_value, NULL_RTX, 0, OPTAB_LIB_WIDEN);
- }
- else {
- temp_reg = expand_binop (loop_var_mode, sub_optab, initial_value,
- comparison_value, NULL_RTX, 0, OPTAB_LIB_WIDEN);
- }
+ /* ??? Do we have to call copy_rtx here before passing rtx to
+ expand_binop? */
+ if (compare_direction > 0)
+ {
+ /* <, <= :the loop variable is increasing */
+ temp_reg = expand_binop (loop_var_mode, sub_optab,
+ comparison_value, initial_value,
+ NULL_RTX, 0, OPTAB_LIB_WIDEN);
+ }
+ else
+ {
+ temp_reg = expand_binop (loop_var_mode, sub_optab,
+ initial_value, comparison_value,
+ NULL_RTX, 0, OPTAB_LIB_WIDEN);
+ }
- if (increment_value_abs - 1 + add_iteration != 0)
- temp_reg = expand_binop (loop_var_mode, add_optab, temp_reg,
- GEN_INT (increment_value_abs - 1 + add_iteration),
- NULL_RTX, 0, OPTAB_LIB_WIDEN);
+ if (increment_value_abs - 1 + add_iteration != 0)
+ temp_reg = expand_binop (loop_var_mode, add_optab, temp_reg,
+ GEN_INT (increment_value_abs - 1
+ + add_iteration),
+ NULL_RTX, 0, OPTAB_LIB_WIDEN);
- if (increment_value_abs != 1)
- {
- /* ??? This will generate an expensive divide instruction for
- most targets. The original authors apparently expected this
- to be a shift, since they test for power-of-2 divisors above,
- but just naively generating a divide instruction will not give
- a shift. It happens to work for the PowerPC target because
- the rs6000.md file has a divide pattern that emits shifts.
- It will probably not work for any other target. */
- iterations_num_reg = expand_binop (loop_var_mode, sdiv_optab,
- temp_reg,
- GEN_INT (increment_value_abs),
- NULL_RTX, 0, OPTAB_LIB_WIDEN);
- }
- else
- iterations_num_reg = temp_reg;
+ if (increment_value_abs != 1)
+ {
+ /* ??? This will generate an expensive divide instruction for
+ most targets. The original authors apparently expected this
+ to be a shift, since they test for power-of-2 divisors above,
+ but just naively generating a divide instruction will not give
+ a shift. It happens to work for the PowerPC target because
+ the rs6000.md file has a divide pattern that emits shifts.
+ It will probably not work for any other target. */
+ iterations_num_reg = expand_binop (loop_var_mode, sdiv_optab,
+ temp_reg,
+ GEN_INT (increment_value_abs),
+ NULL_RTX, 0, OPTAB_LIB_WIDEN);
+ }
+ else
+ iterations_num_reg = temp_reg;
+ }
+ sequence = gen_sequence ();
+ end_sequence ();
+ emit_insn_before (sequence, loop_start);
+ instrument_loop_bct (loop_start, loop_end, iterations_num_reg);
}
- sequence = gen_sequence ();
- end_sequence ();
- emit_insn_before (sequence, loop_start);
- instrument_loop_bct (loop_start, loop_end, iterations_num_reg);
- }
+
+ return;
+#endif /* Complex case */
}
-/* instrument loop by inserting a bct in it. This is done in the following way:
- 1. A new register is created and assigned the hard register number of the count
- register.
- 2. In the head of the loop the new variable is initialized by the value passed in the
- loop_num_iterations parameter.
+/* Instrument loop by inserting a bct in it as follows:
+ 1. A new counter register is created.
+ 2. In the head of the loop the new variable is initialized to the value
+ passed in the loop_num_iterations parameter.
3. At the end of the loop, comparison of the register with 0 is generated.
- The created comparison follows the pattern defined for the
- decrement_and_branch_on_count insn, so this insn will be generated in assembly
- generation phase.
- 4. The compare&branch on the old variable is deleted. So, if the loop-variable was
- not used elsewhere, it will be eliminated by data-flow analisys. */
+ The created comparison follows the pattern defined for the
+ decrement_and_branch_on_count insn, so this insn will be generated.
+ 4. The branch on the old variable are deleted. The compare must remain
+ because it might be used elsewhere. If the loop-variable or condition
+ register are used elsewhere, they will be eliminated by flow. */
static void
instrument_loop_bct (loop_start, loop_end, loop_num_iterations)
rtx loop_start, loop_end;
rtx loop_num_iterations;
{
- rtx temp_reg1, temp_reg2;
+ rtx counter_reg;
rtx start_label;
-
rtx sequence;
- enum machine_mode loop_var_mode = SImode;
if (HAVE_decrement_and_branch_on_count)
{
if (loop_dump_stream)
- fprintf (loop_dump_stream, "Loop: Inserting BCT\n");
+ {
+ fputs ("instrument_bct: Inserting BCT (", loop_dump_stream);
+ if (GET_CODE (loop_num_iterations) == CONST_INT)
+ fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC,
+ INTVAL (loop_num_iterations));
+ else
+ fputs ("runtime", loop_dump_stream);
+ fputs (" iterations)", loop_dump_stream);
+ }
- /* eliminate the check on the old variable */
- delete_insn (PREV_INSN (loop_end));
+ /* Discard original jump to continue loop. Original compare result
+ may still be live, so it cannot be discarded explicitly. */
delete_insn (PREV_INSN (loop_end));
- /* insert the label which will delimit the start of the loop */
+ /* Insert the label which will delimit the start of the loop. */
start_label = gen_label_rtx ();
emit_label_after (start_label, loop_start);
- /* insert initialization of the count register into the loop header */
+ /* Insert initialization of the count register into the loop header. */
start_sequence ();
- temp_reg1 = gen_reg_rtx (loop_var_mode);
- emit_insn (gen_move_insn (temp_reg1, loop_num_iterations));
-
- /* this will be count register */
- temp_reg2 = gen_rtx_REG (loop_var_mode, COUNT_REGISTER_REGNUM);
- /* we have to move the value to the count register from an GPR
- because rtx pointed to by loop_num_iterations could contain
- expression which cannot be moved into count register */
- emit_insn (gen_move_insn (temp_reg2, temp_reg1));
-
+ counter_reg = gen_reg_rtx (word_mode);
+ emit_insn (gen_move_insn (counter_reg, loop_num_iterations));
sequence = gen_sequence ();
end_sequence ();
- emit_insn_after (sequence, loop_start);
+ emit_insn_before (sequence, loop_start);
- /* insert new comparison on the count register instead of the
+ /* Insert new comparison on the count register instead of the
old one, generating the needed BCT pattern (that will be
later recognized by assembly generation phase). */
- emit_jump_insn_before (gen_decrement_and_branch_on_count (temp_reg2, start_label),
+ emit_jump_insn_before (gen_decrement_and_branch_on_count (counter_reg,
+ start_label),
loop_end);
LABEL_NUSES (start_label)++;
}
@@ -7734,8 +8206,6 @@ instrument_loop_bct (loop_start, loop_end, loop_num_iterations)
}
#endif /* HAVE_decrement_and_branch_on_count */
-#endif /* HAIFA */
-
/* Scan the function and determine whether it has indirect (computed) jumps.
This is taken mostly from flow.c; similar code exists elsewhere
@@ -7752,3 +8222,419 @@ indirect_jump_in_function_p (start)
return 0;
}
+
+/* Add MEM to the LOOP_MEMS array, if appropriate. See the
+ documentation for LOOP_MEMS for the definition of `appropriate'.
+ This function is called from prescan_loop via for_each_rtx. */
+
+static int
+insert_loop_mem (mem, data)
+ rtx *mem;
+ void *data;
+{
+ int i;
+ rtx m = *mem;
+
+ if (m == NULL_RTX)
+ return 0;
+
+ switch (GET_CODE (m))
+ {
+ case MEM:
+ break;
+
+ case CONST_DOUBLE:
+ /* We're not interested in the MEM associated with a
+ CONST_DOUBLE, so there's no need to traverse into this. */
+ return -1;
+
+ default:
+ /* This is not a MEM. */
+ return 0;
+ }
+
+ /* See if we've already seen this MEM. */
+ for (i = 0; i < loop_mems_idx; ++i)
+ if (rtx_equal_p (m, loop_mems[i].mem))
+ {
+ if (GET_MODE (m) != GET_MODE (loop_mems[i].mem))
+ /* The modes of the two memory accesses are different. If
+ this happens, something tricky is going on, and we just
+ don't optimize accesses to this MEM. */
+ loop_mems[i].optimize = 0;
+
+ return 0;
+ }
+
+ /* Resize the array, if necessary. */
+ if (loop_mems_idx == loop_mems_allocated)
+ {
+ if (loop_mems_allocated != 0)
+ loop_mems_allocated *= 2;
+ else
+ loop_mems_allocated = 32;
+
+ loop_mems = (loop_mem_info*)
+ xrealloc (loop_mems,
+ loop_mems_allocated * sizeof (loop_mem_info));
+ }
+
+ /* Actually insert the MEM. */
+ loop_mems[loop_mems_idx].mem = m;
+ /* We can't hoist this MEM out of the loop if it's a BLKmode MEM
+ because we can't put it in a register. We still store it in the
+ table, though, so that if we see the same address later, but in a
+ non-BLK mode, we'll not think we can optimize it at that point. */
+ loop_mems[loop_mems_idx].optimize = (GET_MODE (m) != BLKmode);
+ loop_mems[loop_mems_idx].reg = NULL_RTX;
+ ++loop_mems_idx;
+
+ return 0;
+}
+
+/* Like load_mems, but also ensures that N_TIMES_SET,
+ MAY_NOT_OPTIMIZE, REG_SINGLE_USAGE, and INSN_COUNT have the correct
+ values after load_mems. */
+
+static void
+load_mems_and_recount_loop_regs_set (scan_start, end, loop_top, start,
+ reg_single_usage, insn_count)
+ rtx scan_start;
+ rtx end;
+ rtx loop_top;
+ rtx start;
+ varray_type reg_single_usage;
+ int *insn_count;
+{
+ int nregs = max_reg_num ();
+
+ load_mems (scan_start, end, loop_top, start);
+
+ /* Recalculate n_times_set and friends since load_mems may have
+ created new registers. */
+ if (max_reg_num () > nregs)
+ {
+ int i;
+ int old_nregs;
+
+ old_nregs = nregs;
+ nregs = max_reg_num ();
+
+ if (nregs > n_times_set->num_elements)
+ {
+ /* Grow all the arrays. */
+ VARRAY_GROW (n_times_set, nregs);
+ VARRAY_GROW (n_times_used, nregs);
+ VARRAY_GROW (may_not_optimize, nregs);
+ if (reg_single_usage)
+ VARRAY_GROW (reg_single_usage, nregs);
+ }
+ /* Clear the arrays */
+ bzero ((char *) &n_times_set->data, nregs * sizeof (int));
+ bzero ((char *) &may_not_optimize->data, nregs * sizeof (char));
+ if (reg_single_usage)
+ bzero ((char *) &reg_single_usage->data, nregs * sizeof (rtx));
+
+ count_loop_regs_set (loop_top ? loop_top : start, end,
+ may_not_optimize, reg_single_usage,
+ insn_count, nregs);
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ VARRAY_CHAR (may_not_optimize, i) = 1;
+ VARRAY_INT (n_times_set, i) = 1;
+ }
+
+#ifdef AVOID_CCMODE_COPIES
+ /* Don't try to move insns which set CC registers if we should not
+ create CCmode register copies. */
+ for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
+ if (GET_MODE_CLASS (GET_MODE (regno_reg_rtx[i])) == MODE_CC)
+ VARRAY_CHAR (may_not_optimize, i) = 1;
+#endif
+
+ /* Set n_times_used for the new registers. */
+ bcopy ((char *) (&n_times_set->data.i[0] + old_nregs),
+ (char *) (&n_times_used->data.i[0] + old_nregs),
+ (nregs - old_nregs) * sizeof (int));
+ }
+}
+
+/* Move MEMs into registers for the duration of the loop. SCAN_START
+ is the first instruction in the loop (as it is executed). The
+ other parameters are as for next_insn_in_loop. */
+
+static void
+load_mems (scan_start, end, loop_top, start)
+ rtx scan_start;
+ rtx end;
+ rtx loop_top;
+ rtx start;
+{
+ int maybe_never = 0;
+ int i;
+ rtx p;
+ rtx label = NULL_RTX;
+ rtx end_label;
+
+ if (loop_mems_idx > 0)
+ {
+ /* Nonzero if the next instruction may never be executed. */
+ int next_maybe_never = 0;
+
+ /* Check to see if it's possible that some instructions in the
+ loop are never executed. */
+ for (p = next_insn_in_loop (scan_start, scan_start, end, loop_top);
+ p != NULL_RTX && !maybe_never;
+ p = next_insn_in_loop (p, scan_start, end, loop_top))
+ {
+ if (GET_CODE (p) == CODE_LABEL)
+ maybe_never = 1;
+ else if (GET_CODE (p) == JUMP_INSN
+ /* If we enter the loop in the middle, and scan
+ around to the beginning, don't set maybe_never
+ for that. This must be an unconditional jump,
+ otherwise the code at the top of the loop might
+ never be executed. Unconditional jumps are
+ followed a by barrier then loop end. */
+ && ! (GET_CODE (p) == JUMP_INSN
+ && JUMP_LABEL (p) == loop_top
+ && NEXT_INSN (NEXT_INSN (p)) == end
+ && simplejump_p (p)))
+ {
+ if (!condjump_p (p))
+ /* Something complicated. */
+ maybe_never = 1;
+ else
+ /* If there are any more instructions in the loop, they
+ might not be reached. */
+ next_maybe_never = 1;
+ }
+ else if (next_maybe_never)
+ maybe_never = 1;
+ }
+
+ /* Actually move the MEMs. */
+ for (i = 0; i < loop_mems_idx; ++i)
+ {
+ int j;
+ int written = 0;
+ rtx reg;
+ rtx mem = loop_mems[i].mem;
+
+ if (MEM_VOLATILE_P (mem)
+ || invariant_p (XEXP (mem, 0)) != 1)
+ /* There's no telling whether or not MEM is modified. */
+ loop_mems[i].optimize = 0;
+
+ /* Go through the MEMs written to in the loop to see if this
+ one is aliased by one of them. */
+ for (j = 0; j < loop_store_mems_idx; ++j)
+ {
+ if (rtx_equal_p (mem, loop_store_mems[j]))
+ written = 1;
+ else if (true_dependence (loop_store_mems[j], VOIDmode,
+ mem, rtx_varies_p))
+ {
+ /* MEM is indeed aliased by this store. */
+ loop_mems[i].optimize = 0;
+ break;
+ }
+ }
+
+ /* If this MEM is written to, we must be sure that there
+ are no reads from another MEM that aliases this one. */
+ if (loop_mems[i].optimize && written)
+ {
+ int j;
+
+ for (j = 0; j < loop_mems_idx; ++j)
+ {
+ if (j == i)
+ continue;
+ else if (true_dependence (mem,
+ VOIDmode,
+ loop_mems[j].mem,
+ rtx_varies_p))
+ {
+ /* It's not safe to hoist loop_mems[i] out of
+ the loop because writes to it might not be
+ seen by reads from loop_mems[j]. */
+ loop_mems[i].optimize = 0;
+ break;
+ }
+ }
+ }
+
+ if (maybe_never && may_trap_p (mem))
+ /* We can't access the MEM outside the loop; it might
+ cause a trap that wouldn't have happened otherwise. */
+ loop_mems[i].optimize = 0;
+
+ if (!loop_mems[i].optimize)
+ /* We thought we were going to lift this MEM out of the
+ loop, but later discovered that we could not. */
+ continue;
+
+ /* Allocate a pseudo for this MEM. We set REG_USERVAR_P in
+ order to keep scan_loop from moving stores to this MEM
+ out of the loop just because this REG is neither a
+ user-variable nor used in the loop test. */
+ reg = gen_reg_rtx (GET_MODE (mem));
+ REG_USERVAR_P (reg) = 1;
+ loop_mems[i].reg = reg;
+
+ /* Now, replace all references to the MEM with the
+ corresponding pesudos. */
+ for (p = next_insn_in_loop (scan_start, scan_start, end, loop_top);
+ p != NULL_RTX;
+ p = next_insn_in_loop (p, scan_start, end, loop_top))
+ {
+ rtx_and_int ri;
+ ri.r = p;
+ ri.i = i;
+ for_each_rtx (&p, replace_loop_mem, &ri);
+ }
+
+ if (!apply_change_group ())
+ /* We couldn't replace all occurrences of the MEM. */
+ loop_mems[i].optimize = 0;
+ else
+ {
+ rtx set;
+
+ /* Load the memory immediately before START, which is
+ the NOTE_LOOP_BEG. */
+ set = gen_rtx_SET (GET_MODE (reg), reg, mem);
+ emit_insn_before (set, start);
+
+ if (written)
+ {
+ if (label == NULL_RTX)
+ {
+ /* We must compute the former
+ right-after-the-end label before we insert
+ the new one. */
+ end_label = next_label (end);
+ label = gen_label_rtx ();
+ emit_label_after (label, end);
+ }
+
+ /* Store the memory immediately after END, which is
+ the NOTE_LOOP_END. */
+ set = gen_rtx_SET (GET_MODE (reg), copy_rtx (mem), reg);
+ emit_insn_after (set, label);
+ }
+
+ if (loop_dump_stream)
+ {
+ fprintf (loop_dump_stream, "Hoisted regno %d %s from ",
+ REGNO (reg), (written ? "r/w" : "r/o"));
+ print_rtl (loop_dump_stream, mem);
+ fputc ('\n', loop_dump_stream);
+ }
+ }
+ }
+ }
+
+ if (label != NULL_RTX)
+ {
+ /* Now, we need to replace all references to the previous exit
+ label with the new one. */
+ rtx_pair rr;
+ rr.r1 = end_label;
+ rr.r2 = label;
+
+ for (p = start; p != end; p = NEXT_INSN (p))
+ {
+ for_each_rtx (&p, replace_label, &rr);
+
+ /* If this is a JUMP_INSN, then we also need to fix the JUMP_LABEL
+ field. This is not handled by for_each_rtx because it doesn't
+ handle unprinted ('0') fields. We need to update JUMP_LABEL
+ because the immediately following unroll pass will use it.
+ replace_label would not work anyways, because that only handles
+ LABEL_REFs. */
+ if (GET_CODE (p) == JUMP_INSN && JUMP_LABEL (p) == end_label)
+ JUMP_LABEL (p) = label;
+ }
+ }
+}
+
+/* Replace MEM with its associated pseudo register. This function is
+ called from load_mems via for_each_rtx. DATA is actually an
+ rtx_and_int * describing the instruction currently being scanned
+ and the MEM we are currently replacing. */
+
+static int
+replace_loop_mem (mem, data)
+ rtx *mem;
+ void *data;
+{
+ rtx_and_int *ri;
+ rtx insn;
+ int i;
+ rtx m = *mem;
+
+ if (m == NULL_RTX)
+ return 0;
+
+ switch (GET_CODE (m))
+ {
+ case MEM:
+ break;
+
+ case CONST_DOUBLE:
+ /* We're not interested in the MEM associated with a
+ CONST_DOUBLE, so there's no need to traverse into one. */
+ return -1;
+
+ default:
+ /* This is not a MEM. */
+ return 0;
+ }
+
+ ri = (rtx_and_int*) data;
+ i = ri->i;
+
+ if (!rtx_equal_p (loop_mems[i].mem, m))
+ /* This is not the MEM we are currently replacing. */
+ return 0;
+
+ insn = ri->r;
+
+ /* Actually replace the MEM. */
+ validate_change (insn, mem, loop_mems[i].reg, 1);
+
+ return 0;
+}
+
+/* Replace occurrences of the old exit label for the loop with the new
+ one. DATA is an rtx_pair containing the old and new labels,
+ respectively. */
+
+static int
+replace_label (x, data)
+ rtx *x;
+ void *data;
+{
+ rtx l = *x;
+ rtx old_label = ((rtx_pair*) data)->r1;
+ rtx new_label = ((rtx_pair*) data)->r2;
+
+ if (l == NULL_RTX)
+ return 0;
+
+ if (GET_CODE (l) != LABEL_REF)
+ return 0;
+
+ if (XEXP (l, 0) != old_label)
+ return 0;
+
+ XEXP (l, 0) = new_label;
+ ++LABEL_NUSES (new_label);
+ --LABEL_NUSES (old_label);
+
+ return 0;
+}
+
diff --git a/gcc/loop.h b/gcc/loop.h
index 8a92a321185..d0ae25f4d45 100644
--- a/gcc/loop.h
+++ b/gcc/loop.h
@@ -1,5 +1,5 @@
/* Loop optimization definitions for GNU C-Compiler
- Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -92,9 +92,10 @@ struct induction
would probably lose. */
unsigned auto_inc_opt : 1; /* 1 if this giv had its increment output next
to it to try to form an auto-inc address. */
- unsigned unrolled : 1; /* 1 if new register has been allocated in
- unrolled loop. */
+ unsigned unrolled : 1; /* 1 if new register has been allocated and
+ initialized in unrolled loop. */
unsigned shared : 1;
+ unsigned no_const_addval : 1; /* 1 if add_val does not contain a const. */
int lifetime; /* Length of life of this giv */
int times_used; /* # times this giv is used. */
rtx derive_adjustment; /* If nonzero, is an adjustment to be
@@ -183,9 +184,12 @@ void emit_unrolled_add PROTO((rtx, rtx, rtx));
int back_branch_in_range_p PROTO((rtx, rtx, rtx));
extern int *loop_unroll_factor;
-#ifdef HAIFA
-/* variables for interaction between unroll.c and loop.c, for
- the insertion of branch-on-count instruction. */
-extern rtx *loop_start_value;
-#endif /* HAIFA */
+
+#ifdef HAVE_decrement_and_branch_on_count
+extern rtx loop_iteration_var;
+extern rtx loop_initial_value;
+extern rtx loop_increment;
+extern rtx loop_final_value;
+extern enum rtx_code loop_comparison_code;
+#endif /* HAVE_decrement_and_branch_on_count */
diff --git a/gcc/machmode.h b/gcc/machmode.h
index f1f146f2ecf..119950c4348 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -53,10 +53,14 @@ Boston, MA 02111-1307, USA. */
/* Provide a default way to print an address in hex via printf. */
#ifndef HOST_PTR_PRINTF
-#define HOST_PTR_PRINTF \
- (sizeof (int) == sizeof (char *) ? "%x" \
- : sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
-#endif
+# ifdef HAVE_PRINTF_PTR
+# define HOST_PTR_PRINTF "%p"
+# else
+# define HOST_PTR_PRINTF \
+ (sizeof (int) == sizeof (char *) ? "%x" \
+ : sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
+# endif
+#endif /* ! HOST_PTR_PRINTF */
/* Provide defaults for the way to print a HOST_WIDE_INT
in various manners. */
@@ -164,6 +168,11 @@ extern enum mode_class mode_class[];
(GET_MODE_CLASS (MODE) == MODE_FLOAT \
|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)
+/* Nonzero if MODE is a complex mode. */
+#define COMPLEX_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT \
+ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)
+
/* Get the size in bytes of an object of mode MODE. */
extern int mode_size[];
@@ -187,14 +196,14 @@ extern int mode_unit_size[];
/* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */
-#define GET_MODE_MASK(MODE) \
- ((GET_MODE_BITSIZE (MODE) >= HOST_BITS_PER_WIDE_INT) \
- ?(HOST_WIDE_INT) ~0 : (((HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (MODE)) - 1))
+extern const unsigned HOST_WIDE_INT mode_mask_array[];
+
+#define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)]
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */
-extern enum machine_mode mode_wider_mode[];
-#define GET_MODE_WIDER_MODE(MODE) (mode_wider_mode[(int) (MODE)])
+extern unsigned char mode_wider_mode[];
+#define GET_MODE_WIDER_MODE(MODE) ((enum machine_mode)mode_wider_mode[(int) (MODE)])
/* Return the mode for data of a given size SIZE and mode class CLASS.
If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
diff --git a/gcc/md.texi b/gcc/md.texi
index 2fcff2f0a18..e9892593ab3 100644
--- a/gcc/md.texi
+++ b/gcc/md.texi
@@ -1377,6 +1377,9 @@ Floating point register
@item y
@samp{CR} register (condition register)
+@item z
+@samp{FPMEM} stack memory for FPR-GPR transfers
+
@item I
Signed 16 bit constant
@@ -1413,10 +1416,7 @@ for @code{asm} statements)
AIX TOC entry
@item S
-Windows NT SYMBOL_REF
-
-@item T
-Windows NT LABEL_REF
+Constant suitable as a 64-bit mask operand
@item U
System V Release 4 small data area reference
@@ -2412,14 +2412,15 @@ such required data.
@end enumerate
When saving the stack pointer, operand 0 is the save area and operand 1
-is the stack pointer. The mode used to allocate the save area is the
-mode of operand 0. You must specify an integral mode, or
-@code{VOIDmode} if no save area is needed for a particular type of save
-(either because no save is needed or because a machine-specific save
-area can be used). Operand 0 is the stack pointer and operand 1 is the
-save area for restore operations. If @samp{save_stack_block} is
-defined, operand 0 must not be @code{VOIDmode} since these saves can be
-arbitrarily nested.
+is the stack pointer. The mode used to allocate the save area defaults
+to @code{Pmode} but you can override that choice by defining the
+@code{STACK_SAVEAREA_MODE} macro (@pxref{Storage Layout}). You must
+specify an integral mode, or @code{VOIDmode} if no save area is needed
+for a particular type of save (either because no save is needed or
+because a machine-specific save area can be used). Operand 0 is the
+stack pointer and operand 1 is the save area for restore operations. If
+@samp{save_stack_block} is defined, operand 0 must not be
+@code{VOIDmode} since these saves can be arbitrarily nested.
A save area is a @code{mem} that is at a constant offset from
@code{virtual_stack_vars_rtx} when the stack pointer is saved for use by
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index 6722469fd54..558e090a64d 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -937,7 +937,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp)
else
{
used_ptr[index] = 1;
- printf (" First symbol: %ld\n", aux_base[index].isym);
+ printf (" First symbol: %ld\n", (long) aux_base[index].isym);
}
if (want_scope)
@@ -962,7 +962,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp)
{
used_ptr[index] = used_ptr[index+1] = 1;
printf (" End+1 symbol: %-7ld Type: %s\n",
- aux_base[index].isym,
+ (long) aux_base[index].isym,
type_to_string (aux_base, index+1, fdp));
}
else /* global symbol */
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 1c4b935daa2..0922bf1ad14 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -600,11 +600,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#ifndef __SABER__
@@ -707,12 +702,14 @@ main ()
#include "mips/a.out.h"
#endif /* CROSS_COMPILE */
-#if defined (USG) || defined (NO_STAB_H)
+#if defined (USG) || !defined (HAVE_STAB_H)
#include "gstab.h" /* If doing DBX on sysV, use our own stab.h. */
#else
#include <stab.h> /* On BSD, use the system's stab.h. */
#endif /* not USG */
+#include "machmode.h"
+
#ifdef __GNU_STAB__
#define STAB_CODE_TYPE enum __stab_debug_code
#else
@@ -937,7 +934,7 @@ enum alloc_type {
grow linearly, and which are written in the object file as sequential
pages. On systems with a BSD malloc that define USE_MALLOC, the
MAX_CLUSTER_PAGES should be 1 less than a power of two, since malloc
- adds it's overhead, and rounds up to the next power of 2. Pages are
+ adds its overhead, and rounds up to the next power of 2. Pages are
linked together via a linked list.
If PAGE_SIZE is > 4096, the string length in the shash_t structure
@@ -1725,6 +1722,7 @@ STATIC void free_thead __proto((thead_t *));
STATIC char *local_index __proto((const char *, int));
STATIC char *local_rindex __proto((const char *, int));
+STATIC const char *my_strsignal __proto((int));
extern char *mktemp __proto((char *));
extern long strtol __proto((const char *, char **, int));
@@ -1733,12 +1731,6 @@ extern char *optarg;
extern int optind;
extern int opterr;
extern char *version_string;
-#ifndef NO_SYS_SIGLIST
-#ifndef SYS_SIGLIST_DECLARED
-extern char *sys_siglist[NSIG + 1];
-#endif
-#endif
-
/* List of assembler pseudo ops and beginning sequences that need
special actions. Someday, this should be a hash table, and such,
@@ -2054,11 +2046,12 @@ add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
value, depth, sc_str);
if (str_start && str_end_p1 - str_start > 0)
- fprintf (stderr, " st= %-11s name= %.*s\n", st_str, str_end_p1 - str_start, str_start);
+ fprintf (stderr, " st= %-11s name= %.*s\n",
+ st_str, (int) (str_end_p1 - str_start), str_start);
else
{
Size_t len = strlen (st_str);
- fprintf (stderr, " st= %.*s\n", len-1, st_str);
+ fprintf (stderr, " st= %.*s\n", (int) (len-1), st_str);
}
}
@@ -2092,7 +2085,8 @@ add_ext_symbol (str_start, str_end_p1, type, storage, value, indx, ifd)
value, ifd, sc_str);
if (str_start && str_end_p1 - str_start > 0)
- fprintf (stderr, " st= %-11s name= %.*s\n", st_str, str_end_p1 - str_start, str_start);
+ fprintf (stderr, " st= %-11s name= %.*s\n",
+ st_str, (int) (str_end_p1 - str_start), str_start);
else
fprintf (stderr, " st= %s\n", st_str);
}
@@ -2401,8 +2395,8 @@ add_unknown_tag (ptag)
default: break;
}
- fprintf (stderr, "unknown %s %.*s found\n", agg_type,
- hash_ptr->len, name_start);
+ fprintf (stderr, "unknown %s %.*s found\n",
+ agg_type, (int) hash_ptr->len, name_start);
}
sym_index = add_local_symbol (name_start,
@@ -2515,7 +2509,7 @@ add_file (file_start, file_end_p1)
register efdr_t *file_ptr;
if (debug)
- fprintf (stderr, "\tfile\t%.*s\n", len, file_start);
+ fprintf (stderr, "\tfile\t%.*s\n", (int) len, file_start);
/* See if the file has already been created. */
for (file_ptr = first_file;
@@ -3224,7 +3218,7 @@ parse_def (name_start)
&& eptr == (EXTR *) 0)
{
fprintf (stderr, "warning, %.*s not found in original or external symbol tables, value defaults to 0\n",
- arg_end_p1 - arg_start,
+ (int) (arg_end_p1 - arg_start),
arg_start);
value = 0;
}
@@ -4117,9 +4111,13 @@ write_varray (vp, offset, str)
return;
if (debug)
- fprintf (stderr, "\twarray\tvp = 0x%.8x, offset = %7u, size = %7u, %s\n",
- vp, offset, vp->num_allocated * vp->object_size, str);
-
+ {
+ fputs ("\twarray\tvp = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, vp);
+ fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
+ (unsigned long) offset, vp->num_allocated * vp->object_size, str);
+ }
+
if (file_offset != offset
&& fseek (object_stream, (long)offset, SEEK_SET) < 0)
pfatal_with_name (object_name);
@@ -4155,9 +4153,12 @@ write_object __proto((void))
off_t offset;
if (debug)
- fprintf (stderr, "\n\twrite\tvp = 0x%.8x, offset = %7u, size = %7u, %s\n",
- (PTR_T *) &symbolic_header, 0, sizeof (symbolic_header),
- "symbolic header");
+ {
+ fputs ("\n\twrite\tvp = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &symbolic_header);
+ fprintf (stderr, ", offset = %7u, size = %7lu, %s\n",
+ 0, (unsigned long) sizeof (symbolic_header), "symbolic header");
+ }
sys_write = fwrite ((PTR_T) &symbolic_header,
1,
@@ -4185,9 +4186,13 @@ write_object __proto((void))
pfatal_with_name (object_name);
if (debug)
- fprintf (stderr, "\twrite\tvp = 0x%.8x, offset = %7u, size = %7u, %s\n",
- (PTR_T *) &orig_linenum, symbolic_header.cbLineOffset,
- symbolic_header.cbLine, "Line numbers");
+ {
+ fputs ("\twrite\tvp = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &orig_linenum);
+ fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
+ (long) symbolic_header.cbLineOffset,
+ (long) symbolic_header.cbLine, "Line numbers");
+ }
sys_write = fwrite ((PTR_T) orig_linenum,
1,
@@ -4216,9 +4221,13 @@ write_object __proto((void))
pfatal_with_name (object_name);
if (debug)
- fprintf (stderr, "\twrite\tvp = 0x%.8x, offset = %7u, size = %7u, %s\n",
- (PTR_T *) &orig_opt_syms, symbolic_header.cbOptOffset,
- num_write, "Optimizer symbols");
+ {
+ fputs ("\twrite\tvp = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &orig_opt_syms);
+ fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
+ (long) symbolic_header.cbOptOffset,
+ num_write, "Optimizer symbols");
+ }
sys_write = fwrite ((PTR_T) orig_opt_syms,
1,
@@ -4304,8 +4313,13 @@ write_object __proto((void))
file_ptr = file_ptr->next_file)
{
if (debug)
- fprintf (stderr, "\twrite\tvp = 0x%.8x, offset = %7u, size = %7u, %s\n",
- (PTR_T *) &file_ptr->fdr, file_offset, sizeof (FDR), "File header");
+ {
+ fputs ("\twrite\tvp = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &file_ptr->fdr);
+ fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
+ file_offset, (unsigned long) sizeof (FDR),
+ "File header");
+ }
sys_write = fwrite (&file_ptr->fdr,
1,
@@ -4335,9 +4349,13 @@ write_object __proto((void))
pfatal_with_name (object_name);
if (debug)
- fprintf (stderr, "\twrite\tvp = 0x%.8x, offset = %7u, size = %7u, %s\n",
- (PTR_T *) &orig_rfds, symbolic_header.cbRfdOffset,
- num_write, "Relative file descriptors");
+ {
+ fputs ("\twrite\tvp = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &orig_rfds);
+ fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
+ (long) symbolic_header.cbRfdOffset,
+ num_write, "Relative file descriptors");
+ }
sys_write = fwrite (orig_rfds,
1,
@@ -4379,8 +4397,9 @@ read_seek (size, offset, str)
return (page_t *) 0;
if (debug)
- fprintf (stderr, "\trseek\tsize = %7u, offset = %7u, currently at %7u, %s\n",
- size, offset, file_offset, str);
+ fprintf (stderr,
+ "\trseek\tsize = %7lu, offset = %7lu, currently at %7lu, %s\n",
+ (unsigned long) size, (unsigned long) offset, file_offset, str);
#ifndef MALLOC_CHECK
ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE);
@@ -5026,6 +5045,29 @@ main (argc, argv)
}
+STATIC const char *
+my_strsignal (s)
+ int s;
+{
+#ifdef HAVE_STRSIGNAL
+ return strsignal (s);
+#else
+ if (s >= 0 && s < NSIG)
+ {
+# ifdef NO_SYS_SIGLIST
+ static char buffer[30];
+
+ sprintf (buffer, "Unknown signal %d", s);
+ return buffer;
+# else
+ return sys_siglist[s];
+# endif
+ }
+ else
+ return NULL;
+#endif /* HAVE_STRSIGNAL */
+}
+
/* Catch a signal and exit without dumping core. */
STATIC void
@@ -5033,11 +5075,7 @@ catch_signal (signum)
int signum;
{
(void) signal (signum, SIG_DFL); /* just in case... */
-#ifdef NO_SYS_SIGLIST
- fatal ("caught signal");
-#else
- fatal (sys_siglist[signum]);
-#endif
+ fatal (my_strsignal(signum));
}
/* Print a fatal error message. NAME is the text.
@@ -5077,7 +5115,7 @@ out_of_bounds (indx, max, str, prog_line)
if (indx < max) /* just in case */
return 0;
- fprintf (stderr, "%s, %s:%ld index %u is out of bounds for %s, max is %u, mips-tfile.c line# %d\n",
+ fprintf (stderr, "%s, %s:%ld index %lu is out of bounds for %s, max is %lu, mips-tfile.c line# %d\n",
progname, input_name, line_number, indx, str, max, prog_line);
exit (1);
@@ -5086,7 +5124,7 @@ out_of_bounds (indx, max, str, prog_line)
/* Allocate a cluster of pages. USE_MALLOC says that malloc does not
- like sbrk's behind it's back (or sbrk isn't available). If we use
+ like sbrk's behind its back (or sbrk isn't available). If we use
sbrk, we assume it gives us zeroed pages. */
#ifndef MALLOC_CHECK
@@ -5128,7 +5166,12 @@ allocate_cluster (npages)
pfatal_with_name ("allocate_cluster");
if (debug > 3)
- fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, ptr);
+ {
+ fprintf (stderr, "\talloc\tnpages = %lu, value = ",
+ (unsigned long) npages);
+ fprintf (stderr, HOST_PTR_PRINTF, ptr);
+ fputs ("\n", stderr);
+ }
return ptr;
}
@@ -5652,7 +5695,11 @@ xmalloc (size)
fatal ("Virtual memory exhausted.");
if (debug > 3)
- fprintf (stderr, "\tmalloc\tptr = 0x%.8x, size = %10u\n", value, size);
+ {
+ fputs ("\tmalloc\tptr = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, value);
+ fprintf (stderr, ", size = %10lu\n", (unsigned long) size);
+ }
return value;
}
@@ -5668,8 +5715,13 @@ xcalloc (size1, size2)
fatal ("Virtual memory exhausted.");
if (debug > 3)
- fprintf (stderr, "\tcalloc\tptr = 0x%.8x, size1 = %10u, size2 = %10u [%u]\n",
- value, size1, size2, size1+size2);
+ {
+ fputs ("\tcalloc\tptr = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, value);
+ fprintf (stderr, ", size1 = %10lu, size2 = %10lu [%lu]\n",
+ (unsigned long) size1, (unsigned long) size2,
+ (unsigned long) size1*size2);
+ }
return value;
}
@@ -5686,8 +5738,13 @@ xrealloc (ptr, size)
fatal ("Virtual memory exhausted.");
if (debug > 3)
- fprintf (stderr, "\trealloc\tptr = 0x%.8x, size = %10u, orig = 0x%.8x\n",
- result, size, ptr);
+ {
+ fputs ("\trealloc\tptr = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, result);
+ fprintf (stderr, ", size = %10lu, orig = ", size);
+ fprintf (stderr, HOST_PTR_PRINTF, ptr);
+ fputs ("\n", stderr);
+ }
return result;
}
@@ -5697,7 +5754,11 @@ xfree (ptr)
PTR_T ptr;
{
if (debug > 3)
- fprintf (stderr, "\tfree\tptr = 0x%.8x\n", ptr);
+ {
+ fputs ("\tfree\tptr = ", stderr);
+ fprintf (stderr, HOST_PTR_PRINTF, ptr);
+ fputs ("\n", stderr);
+ }
free (ptr);
}
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 1e4fd67bfe9..bc47fc2e143 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -50,15 +50,12 @@ OBJC_FLAGS_TO_PASS = \
#
# Define the names for selecting Objective-C in LANGUAGES.
-OBJC objc: cc1obj$(exeext) objc-runtime
-OBJECTIVE-C objective-c: cc1obj$(exeext) objc-runtime
+OBJC objc: cc1obj$(exeext)
+OBJECTIVE-C objective-c: cc1obj$(exeext)
# Tell GNU make to ignore these if they exist.
.PHONY: objective-c objc ObjC
-# The Objective C thread file
-OBJC_THREAD_FILE=thr-$(GCC_THREAD_FILE)
-
# Language-specific object files for Objective C.
OBJC_OBJS = objc-parse.o objc-act.o $(C_AND_OBJC_OBJS)
@@ -88,131 +85,12 @@ $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
objc-act.o : $(srcdir)/objc/objc-act.c \
$(CONFIG_H) $(TREE_H) $(RTL_H) system.h \
- $(srcdir)/c-tree.h $(srcdir)/c-lex.h \
+ $(srcdir)/c-tree.h $(srcdir)/c-lex.h $(srcdir)/toplev.h \
$(srcdir)/flags.h $(srcdir)/objc/objc-act.h $(srcdir)/input.h \
$(srcdir)/function.h $(srcdir)/output.h $(srcdir)/c-parse.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
-c $(srcdir)/objc/objc-act.c
-objc-runtime: objc-headers libobjc.a
-
-# copy objc header files into build directory
-objc-headers: stmp-fixinc
- if [ -d include ]; then true; else mkdir include; fi
- cd objc; \
- if [ -f Makefile ]; then \
- $(MAKE) copy-headers \
- tooldir=$(tooldir) \
- AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
- GCC_FOR_TARGET="../xgcc -B../" \
- GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=../include; \
- fi
- touch objc-headers
-
-# Objective C runtime library specific files.
-
-OBJC_O = objc/hash.o objc/sarray.o \
- objc/class.o objc/sendmsg.o \
- objc/init.o objc/archive.o \
- objc/encoding.o objc/selector.o \
- objc/objects.o objc/misc.o \
- objc/NXConstStr.o objc/Object.o \
- objc/Protocol.o objc/nil_method.o \
- objc/thr.o objc/linking.o \
- objc/$(OBJC_THREAD_FILE).o
-
-objc/hash.o: $(srcdir)/objc/hash.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/hash.c -o $@
-objc/sarray.o: $(srcdir)/objc/sarray.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/sarray.c -o $@
-objc/class.o: $(srcdir)/objc/class.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/class.c -o $@
-objc/sendmsg.o: $(srcdir)/objc/sendmsg.c $(GCC_PASSES) objc/runtime-info.h
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -Iobjc \
- -c $(srcdir)/objc/sendmsg.c -o $@
-objc/init.o: $(srcdir)/objc/init.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/init.c -o $@
-objc/archive.o: $(srcdir)/objc/archive.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/archive.c -o $@
-objc/encoding.o: $(srcdir)/objc/encoding.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/encoding.c -o $@
-objc/selector.o: $(srcdir)/objc/selector.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/selector.c -o $@
-objc/objects.o: $(srcdir)/objc/objects.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/objects.c -o $@
-objc/misc.o: $(srcdir)/objc/misc.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/misc.c -o $@
-objc/NXConstStr.o: $(srcdir)/objc/NXConstStr.m $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -fgnu-runtime -c $(srcdir)/objc/NXConstStr.m -o $@
-objc/Object.o: $(srcdir)/objc/Object.m $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -fgnu-runtime -c $(srcdir)/objc/Object.m -o $@
-objc/Protocol.o: $(srcdir)/objc/Protocol.m $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -fgnu-runtime -c $(srcdir)/objc/Protocol.m -o $@
-objc/thr.o: $(srcdir)/objc/thr.h $(srcdir)/objc/thr.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/thr.c -o $@
-objc/$(OBJC_THREAD_FILE).o: $(srcdir)/objc/$(OBJC_THREAD_FILE).c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/$(OBJC_THREAD_FILE).c -o $@
-objc/nil_method.o: $(srcdir)/objc/nil_method.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/nil_method.c -o $@
-objc/linking.o: $(srcdir)/objc/linking.m $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -fgnu-runtime -c $(srcdir)/objc/linking.m -o $@
-
-objc/libobjc_entry.o: $(srcdir)/objc/libobjc_entry.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
- -c $(srcdir)/objc/libobjc_entry.c -o $@
-
-$(OBJC_O): $(GCC_PASSES) cc1obj
-
-# Build the Objective C runtime library.
-libobjc.a: cc1obj specs stmp-int-hdrs libgcc2.ready \
- $(USE_COLLECT2) $(EXTRA_PARTS) objc/runtime-info.h $(OBJC_O)
- -rm -f libobjc.a
- $(AR) $(AR_FLAGS) libobjc.a $(OBJC_O)
- -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
-
-libobjc_s.a: libobjc.a
- mv libobjc.a libobjc_s.a
-
-# Create a relocatable DLL
-libobjc.dll: libobjc_s.a objc/libobjc_entry.o
- $(GCC_FOR_TARGET) -mdll -Wl,--base-file -Wl,libobjc.base \
- -o libobjc.dll libobjc_s.a \
- objc/libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/objc/libobjc.def \
- --base-file libobjc.base --output-exp libobjc.exp
- $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
- -o libobjc.dll libobjc_s.a \
- objc/libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/objc/libobjc.def \
- --base-file libobjc.base --output-exp libobjc.exp
- $(GCC_FOR_TARGET) libobjc.exp -mdll \
- -o libobjc.dll libobjc_s.a \
- objc/libobjc_entry.o -lkernel32
- $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/objc/libobjc.def \
- --output-lib libobjc.a
-
-# Platform generated information needed by ObjC runtime
-objc/runtime-info.h: cc1obj
- echo "" > tmp-runtime
- echo "/* This file is automatically generated */" >$@
- ./cc1obj -print-objc-runtime-info tmp-runtime >>$@
- rm -f tmp-runtime
#
# Build hooks:
@@ -228,25 +106,7 @@ objc.dvi:
# Install hooks:
# cc1obj is installed elsewhere as part of $(COMPILERS).
-objc.install-normal: installdirs
- -if [ -f libobjc.a ] ; then \
- rm -f $(libsubdir)/libobjc.a; \
- $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
- if $(RANLIB_TEST) ; then \
- (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \
- chmod a-x $(libsubdir)/libobjc.a; \
- else true; fi
- -if [ -f libobjc_s.a ] ; then \
- rm -f $(libsubdir)/libobjc_s.a; \
- $(INSTALL_DATA) libobjc_s.a $(libsubdir)/libobjc_s.a; \
- if $(RANLIB_TEST) ; then \
- (cd $(libsubdir); $(RANLIB) libobjc_s.a); else true; fi; \
- chmod a-x $(libsubdir)/libobjc_s.a; \
- else true; fi
- -if [ -f libobjc.dll ] ; then \
- rm -f $(bindir)/libobjc.dll; \
- $(INSTALL_DATA) libobjc.dll $(bindir)/libobjc.dll; \
- else true; fi
+objc.install-normal:
objc.install-common:
@@ -262,9 +122,6 @@ objc.uninstall:
objc.mostlyclean:
-rm -f tmp-objc-prs.y
-rm -f objc/*$(objext) objc/xforward objc/fflags
- -rm -f objc/runtime-info.h
- -rm -f libobjc.a libobjc_s.a libobjc.dll
- -rm -f libobjc.base libobjc.exp
objc.clean: objc.mostlyclean
-rm -rf objc-headers
objc.distclean:
@@ -282,19 +139,15 @@ objc.maintainer-clean:
objc.stage1: stage1-start
-mv objc/*$(objext) stage1/objc
-mv cc1obj$(exeext) stage1
- -mv libobjc.a stage1
objc.stage2: stage2-start
-mv objc/*$(objext) stage2/objc
-mv cc1obj$(exeext) stage2
- -mv libobjc.a stage2
objc.stage3: stage3-start
-mv objc/*$(objext) stage3/objc
-mv cc1obj$(exeext) stage3
- -mv libobjc.a stage3
objc.stage4: stage4-start
-mv objc/*$(objext) stage4/objc
-mv cc1obj$(exeext) stage4
- -mv libobjc.a stage4
#
# Maintenance hooks:
diff --git a/gcc/objc/Makefile.in b/gcc/objc/Makefile.in
index 5f1bc8811eb..0bc92122e5d 100644
--- a/gcc/objc/Makefile.in
+++ b/gcc/objc/Makefile.in
@@ -1,4 +1,4 @@
-# GNU Objective C Runtime Makefile
+# GNU Objective C frontend Makefile
# Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
#
# This file is part of GNU CC.
@@ -17,21 +17,19 @@
# Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-# This makefile is run by the parent dir's makefile.
-# thisdir1=`pwd`; \
-# srcdir1=`cd $(srcdir); pwd`; \
-# cd objc; \
-# $(MAKE) $(MAKEFLAGS) -f $$srcdir1/objc/Makefile libobjc.a \
-# srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
-# GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
-# GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$$thisdir1/include
-# OBJC_THREAD_FILE="$(OBJC_THREAD_FILE)"
-# Two targets are used by ../Makefile: `all' and `mostlyclean'.
+# The Makefile built from this file lives in the objc language subdirectory.
+# Its purpose is to provide support for:
+#
+# 1. recursion where necessary, and only then (building .o's), and
+# 2. building and debugging cc1objc from the language subdirectory.
+#
+# The parent Makefile handles all other chores, with help from the language
+# Makefile fragment.
+#
+# The targets for external use are `all' and `mostlyclean'.
SHELL=/bin/sh
-.SUFFIXES: .m
-
OPTIMIZE= -O
srcdir = .
@@ -56,33 +54,17 @@ all: all.indirect
####build overrides
#
-OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
- NXConstStr.h Object.h Protocol.h encoding.h typedstream.h thr.h
-
# Now figure out from those variables how to compile and link.
-all.indirect: Makefile compiler objc-runtime
+all.indirect: Makefile frontend
-compiler:
+frontend:
cd ..; $(MAKE) cc1obj$(exeext)
-objc-runtime:
- cd ..; $(MAKE) libobjc.a
-
-# copy objc headers to installation include directory
-copy-headers:
- -rm -fr $(incinstalldir)/objc
- -mkdir $(incinstalldir)/objc
- for file in $(OBJC_H); do \
- realfile=$(srcdir)/$${file}; \
- cp $${realfile} $(incinstalldir)/objc; \
- chmod a+r $(incinstalldir)/objc/$${file}; \
- done
-
Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
cd ..; $(SHELL) config.status
mostlyclean:
- -rm -f *.o libobjc.a xforward fflags
+ -rm -f *.o xforward fflags
clean: mostlyclean
distclean: mostlyclean
extraclean: mostlyclean
diff --git a/gcc/objc/NXConstStr.h b/gcc/objc/NXConstStr.h
deleted file mode 100644
index c9799544a02..00000000000
--- a/gcc/objc/NXConstStr.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Interface for the NXConstantString class for Objective-C.
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
-
-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 files
- compiled with GCC to produce an executable, this does not 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. */
-
-#ifndef __nxconstantstring_INCLUDE_GNU
-#define __nxconstantstring_INCLUDE_GNU
-
-#include "objc/Object.h"
-
-@interface NXConstantString: Object
-{
- char *c_string;
- unsigned int len;
-}
-
--(const char *) cString;
--(unsigned int) length;
-
-@end
-
-#endif
diff --git a/gcc/objc/NXConstStr.m b/gcc/objc/NXConstStr.m
deleted file mode 100644
index 4d2f3e1d7fc..00000000000
--- a/gcc/objc/NXConstStr.m
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Implementation of the NXConstantString class for Objective-C.
- Copyright (C) 1995 Free Software Foundation, Inc.
- Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
-
-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 files
- compiled with GCC to produce an executable, this does not 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 "objc/NXConstStr.h"
-
-@implementation NXConstantString
-
--(const char *) cString
-{
- return (c_string);
-} /* -cString */
-
--(unsigned int) length
-{
- return (len);
-} /* -length */
-
-@end
diff --git a/gcc/objc/Object.h b/gcc/objc/Object.h
deleted file mode 100644
index a762acc3f7d..00000000000
--- a/gcc/objc/Object.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Interface for the Object class for Objective-C.
- Copyright (C) 1993, 1994, 1995 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. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not 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. */
-
-#ifndef __object_INCLUDE_GNU
-#define __object_INCLUDE_GNU
-
-#include <objc/objc.h>
-#include <objc/typedstream.h>
-
-/*
- * All classes are derived from Object. As such,
- * this is the overhead tacked onto those objects.
- */
-@interface Object
-{
- Class isa; /* A pointer to the instance's class structure */
-}
-
- /* Initializing classes and instances */
-+ initialize;
-- init;
-
- /* Creating, freeing, and copying instances */
-+ new;
-+ alloc;
-- free;
-- copy;
-- shallowCopy;
-- deepen;
-- deepCopy;
-
- /* Identifying classes */
-- (Class)class;
-- (Class)superClass;
-- (MetaClass)metaClass;
-- (const char *)name;
-
- /* Identifying and comparing objects */
-- self;
-- (unsigned int)hash;
-- (BOOL)isEqual:anObject;
-- (int)compare:anotherObject;
-
- /* Testing object type */
-- (BOOL)isMetaClass;
-- (BOOL)isClass;
-- (BOOL)isInstance;
-
- /* Testing inheritance relationships */
-- (BOOL)isKindOf:(Class)aClassObject;
-- (BOOL)isMemberOf:(Class)aClassObject;
-- (BOOL)isKindOfClassNamed:(const char *)aClassName;
-- (BOOL)isMemberOfClassNamed:(const char *)aClassName;
-
- /* Testing class functionality */
-+ (BOOL)instancesRespondTo:(SEL)aSel;
-- (BOOL)respondsTo:(SEL)aSel;
-
- /* Testing protocol conformance */
-- (BOOL)conformsTo:(Protocol*)aProtocol;
-
- /* Introspection */
-+ (IMP)instanceMethodFor:(SEL)aSel;
-- (IMP)methodFor:(SEL)aSel;
-+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel;
-- (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
-
- /* Sending messages determined at run time */
-- perform:(SEL)aSel;
-- perform:(SEL)aSel with:anObject;
-- perform:(SEL)aSel with:anObject1 with:anObject2;
-
- /* Forwarding */
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
-- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
-
- /* Posing */
-+ poseAs:(Class)aClassObject;
-- (Class)transmuteClassTo:(Class)aClassObject;
-
- /* Enforcing intentions */
-- subclassResponsibility:(SEL)aSel;
-- notImplemented:(SEL)aSel;
-- shouldNotImplement:(SEL)aSel;
-
- /* Error handling */
-- doesNotRecognize:(SEL)aSel;
-- error:(const char *)aString, ...;
-
- /* Archiving */
-+ (int)version;
-+ setVersion:(int)aVersion;
-+ (int)streamVersion: (TypedStream*)aStream;
-
-- read: (TypedStream*)aStream;
-- write: (TypedStream*)aStream;
-- awake;
-
-@end
-
-#endif
diff --git a/gcc/objc/Object.m b/gcc/objc/Object.m
deleted file mode 100644
index 64b52f48368..00000000000
--- a/gcc/objc/Object.m
+++ /dev/null
@@ -1,387 +0,0 @@
-/* The implementation of class Object for Objective-C.
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not 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 <stdarg.h>
-#include "objc/Object.h"
-#include "objc/Protocol.h"
-#include "objc/objc-api.h"
-
-extern int errno;
-
-#define MAX_CLASS_NAME_LEN 256
-
-@implementation Object
-
-+ initialize
-{
- return self;
-}
-
-- init
-{
- return self;
-}
-
-+ new
-{
- return [[self alloc] init];
-}
-
-+ alloc
-{
- return class_create_instance(self);
-}
-
-- free
-{
- return object_dispose(self);
-}
-
-- copy
-{
- return [[self shallowCopy] deepen];
-}
-
-- shallowCopy
-{
- return object_copy(self);
-}
-
-- deepen
-{
- return self;
-}
-
-- deepCopy
-{
- return [self copy];
-}
-
-- (Class)class
-{
- return object_get_class(self);
-}
-
-- (Class)superClass
-{
- return object_get_super_class(self);
-}
-
-- (MetaClass)metaClass
-{
- return object_get_meta_class(self);
-}
-
-- (const char *)name
-{
- return object_get_class_name(self);
-}
-
-- self
-{
- return self;
-}
-
-- (unsigned int)hash
-{
- return (size_t)self;
-}
-
-- (BOOL)isEqual:anObject
-{
- return self==anObject;
-}
-
-- (int)compare:anotherObject;
-{
- if ([self isEqual:anotherObject])
- return 0;
- // Ordering objects by their address is pretty useless,
- // so subclasses should override this is some useful way.
- else if (self > anotherObject)
- return 1;
- else
- return -1;
-}
-
-- (BOOL)isMetaClass
-{
- return NO;
-}
-
-- (BOOL)isClass
-{
- return object_is_class(self);
-}
-
-- (BOOL)isInstance
-{
- return object_is_instance(self);
-}
-
-- (BOOL)isKindOf:(Class)aClassObject
-{
- Class class;
-
- for (class = self->isa; class!=Nil; class = class_get_super_class(class))
- if (class==aClassObject)
- return YES;
- return NO;
-}
-
-- (BOOL)isMemberOf:(Class)aClassObject
-{
- return self->isa==aClassObject;
-}
-
-- (BOOL)isKindOfClassNamed:(const char *)aClassName
-{
- Class class;
-
- if (aClassName!=NULL)
- for (class = self->isa; class!=Nil; class = class_get_super_class(class))
- if (!strcmp(class_get_class_name(class), aClassName))
- return YES;
- return NO;
-}
-
-- (BOOL)isMemberOfClassNamed:(const char *)aClassName
-{
- return ((aClassName!=NULL)
- &&!strcmp(class_get_class_name(self->isa), aClassName));
-}
-
-+ (BOOL)instancesRespondTo:(SEL)aSel
-{
- return class_get_instance_method(self, aSel)!=METHOD_NULL;
-}
-
-- (BOOL)respondsTo:(SEL)aSel
-{
- return ((object_is_instance(self)
- ?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel))!=METHOD_NULL);
-}
-
-+ (IMP)instanceMethodFor:(SEL)aSel
-{
- return method_get_imp(class_get_instance_method(self, aSel));
-}
-
-// Indicates if the receiving class or instance conforms to the given protocol
-// not usually overridden by subclasses
-//
-// Modified 9/5/94 to always search the class object's protocol list, rather
-// than the meta class.
-
-+ (BOOL) conformsTo: (Protocol*)aProtocol
-{
- int i;
- struct objc_protocol_list* proto_list;
- id parent;
-
- for (proto_list = ((Class)self)->protocols;
- proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ([proto_list->list[i] conformsTo: aProtocol])
- return YES;
- }
- }
-
- if ((parent = [self superClass]))
- return [parent conformsTo: aProtocol];
- else
- return NO;
-}
-
-- (BOOL) conformsTo: (Protocol*)aProtocol
-{
- return [[self class] conformsTo:aProtocol];
-}
-
-- (IMP)methodFor:(SEL)aSel
-{
- return (method_get_imp(object_is_instance(self)
- ?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel)));
-}
-
-+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel
-{
- return ((struct objc_method_description *)
- class_get_instance_method(self, aSel));
-}
-
-- (struct objc_method_description *)descriptionForMethod:(SEL)aSel
-{
- return ((struct objc_method_description *)
- (object_is_instance(self)
- ?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel)));
-}
-
-- perform:(SEL)aSel
-{
- IMP msg = objc_msg_lookup(self, aSel);
- if (!msg)
- return [self error:"invalid selector passed to %s", sel_get_name(_cmd)];
- return (*msg)(self, aSel);
-}
-
-- perform:(SEL)aSel with:anObject
-{
- IMP msg = objc_msg_lookup(self, aSel);
- if (!msg)
- return [self error:"invalid selector passed to %s", sel_get_name(_cmd)];
- return (*msg)(self, aSel, anObject);
-}
-
-- perform:(SEL)aSel with:anObject1 with:anObject2
-{
- IMP msg = objc_msg_lookup(self, aSel);
- if (!msg)
- return [self error:"invalid selector passed to %s", sel_get_name(_cmd)];
- return (*msg)(self, aSel, anObject1, anObject2);
-}
-
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame
-{
- return (retval_t)[self doesNotRecognize: aSel];
-}
-
-- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame
-{
- return objc_msg_sendv(self, aSel, argFrame);
-}
-
-+ poseAs:(Class)aClassObject
-{
- return class_pose_as(self, aClassObject);
-}
-
-- (Class)transmuteClassTo:(Class)aClassObject
-{
- if (object_is_instance(self))
- if (class_is_class(aClassObject))
- if (class_get_instance_size(aClassObject)==class_get_instance_size(isa))
- if ([self isKindOf:aClassObject])
- {
- Class old_isa = isa;
- isa = aClassObject;
- return old_isa;
- }
- return nil;
-}
-
-- subclassResponsibility:(SEL)aSel
-{
- return [self error:"subclass should override %s", sel_get_name(aSel)];
-}
-
-- notImplemented:(SEL)aSel
-{
- return [self error:"method %s not implemented", sel_get_name(aSel)];
-}
-
-- shouldNotImplement:(SEL)aSel
-{
- return [self error:"%s should not implement %s",
- object_get_class_name(self), sel_get_name(aSel)];
-}
-
-- doesNotRecognize:(SEL)aSel
-{
- return [self error:"%s does not recognize %s",
- object_get_class_name(self), sel_get_name(aSel)];
-}
-
-#ifdef __alpha__
-extern size_t strlen(const char*);
-#endif
-
-- error:(const char *)aString, ...
-{
-#define FMT "error: %s (%s)\n%s\n"
- char fmt[(strlen((char*)FMT)+strlen((char*)object_get_class_name(self))
- +((aString!=NULL)?strlen((char*)aString):0)+8)];
- va_list ap;
-
- sprintf(fmt, FMT, object_get_class_name(self),
- object_is_instance(self)?"instance":"class",
- (aString!=NULL)?aString:"");
- va_start(ap, aString);
- objc_verror(self, OBJC_ERR_UNKNOWN, fmt, ap);
- va_end(ap);
- return nil;
-#undef FMT
-}
-
-+ (int)version
-{
- return class_get_version(self);
-}
-
-+ setVersion:(int)aVersion
-{
- class_set_version(self, aVersion);
- return self;
-}
-
-+ (int)streamVersion: (TypedStream*)aStream
-{
- if (aStream->mode == OBJC_READONLY)
- return objc_get_stream_class_version (aStream, self);
- else
- return class_get_version (self);
-}
-
-// These are used to write or read the instance variables
-// declared in this particular part of the object. Subclasses
-// should extend these, by calling [super read/write: aStream]
-// before doing their own archiving. These methods are private, in
-// the sense that they should only be called from subclasses.
-
-- read: (TypedStream*)aStream
-{
- // [super read: aStream];
- return self;
-}
-
-- write: (TypedStream*)aStream
-{
- // [super write: aStream];
- return self;
-}
-
-- awake
-{
- // [super awake];
- return self;
-}
-
-@end
diff --git a/gcc/objc/Protocol.h b/gcc/objc/Protocol.h
deleted file mode 100644
index c7464cf17a9..00000000000
--- a/gcc/objc/Protocol.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Declare the class Protocol for Objective C programs.
- Copyright (C) 1993 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. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not 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. */
-
-#ifndef __Protocol_INCLUDE_GNU
-#define __Protocol_INCLUDE_GNU
-
-#include "objc/Object.h"
-
-@interface Protocol : Object
-{
-@private
- char *protocol_name;
- struct objc_protocol_list *protocol_list;
- struct objc_method_description_list *instance_methods, *class_methods;
-}
-
-/* Obtaining attributes intrinsic to the protocol */
-
-- (const char *)name;
-
-/* Testing protocol conformance */
-
-- (BOOL) conformsTo: (Protocol *)aProtocolObject;
-
-/* Looking up information specific to a protocol */
-
-- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
-- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
-
-@end
-
-
-
-
-#endif __Protocol_INCLUDE_GNU
diff --git a/gcc/objc/Protocol.m b/gcc/objc/Protocol.m
deleted file mode 100644
index 43ba44eaf4f..00000000000
--- a/gcc/objc/Protocol.m
+++ /dev/null
@@ -1,128 +0,0 @@
-/* This file contains the implementation of class Protocol.
- Copyright (C) 1993 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. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not 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 "objc/Protocol.h"
-#include "objc/objc-api.h"
-
-/* Method description list */
-struct objc_method_description_list {
- int count;
- struct objc_method_description list[1];
-};
-
-
-@implementation Protocol
-{
-@private
- char *protocol_name;
- struct objc_protocol_list *protocol_list;
- struct objc_method_description_list *instance_methods, *class_methods;
-}
-
-/* Obtaining attributes intrinsic to the protocol */
-
-- (const char *)name
-{
- return protocol_name;
-}
-
-/* Testing protocol conformance */
-
-- (BOOL) conformsTo: (Protocol *)aProtocolObject
-{
- int i;
- struct objc_protocol_list* proto_list;
-
- if (!strcmp(aProtocolObject->protocol_name, self->protocol_name))
- return YES;
-
- for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ([proto_list->list[i] conformsTo: aProtocolObject])
- return YES;
- }
- }
-
- return NO;
-}
-
-/* Looking up information specific to a protocol */
-
-- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel
-{
- int i;
- struct objc_protocol_list* proto_list;
- const char* name = sel_get_name (aSel);
- struct objc_method_description *result;
-
- for (i = 0; i < instance_methods->count; i++)
- {
- if (!strcmp ((char*)instance_methods->list[i].name, name))
- return &(instance_methods->list[i]);
- }
-
- for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ((result = [proto_list->list[i]
- descriptionForInstanceMethod: aSel]))
- return result;
- }
- }
-
- return NULL;
-}
-
-- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
-{
- int i;
- struct objc_protocol_list* proto_list;
- const char* name = sel_get_name (aSel);
- struct objc_method_description *result;
-
- for (i = 0; i < class_methods->count; i++)
- {
- if (!strcmp ((char*)class_methods->list[i].name, name))
- return &(class_methods->list[i]);
- }
-
- for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
- {
- for (i=0; i < proto_list->count; i++)
- {
- if ((result = [proto_list->list[i]
- descriptionForClassMethod: aSel]))
- return result;
- }
- }
-
- return NULL;
-}
-
-@end
diff --git a/gcc/objc/README.threads b/gcc/objc/README.threads
deleted file mode 100644
index 2cafb4ea7cf..00000000000
--- a/gcc/objc/README.threads
+++ /dev/null
@@ -1,50 +0,0 @@
-==============================================================================
-README - Wed Nov 29 15:16:24 EST 1995
-------------------------------------------------------------------------------
-
-Limited documentation is available in the THREADS file.
-
-This version has been tested on Sun Solaris, SGI Irix, and Windows NT.
-It should also work on any single threaded system.
-
-Thanks go to the following people for help test and debug the library:
-
- Scott Christley, scottc@ocbi.com
- Andrew McCallum, mccallum@cs.rochester.edu
-
-galen
-gchunt@cs.rochester.edu
-
-Any questions, bug reports, etc should be directed to:
-
-Scott Christley, scottc@ocbi.com
-
-Please do not bug Galen with email as he no longer supports the code.
-
-==============================================================================
-Changes from prior releases (in revered chronological order):
-------------------------------------------------------------------------------
-
-* Fixed bug in copy part of sarray_realloc. I had an < which should
- have been <=. (Bug report from Scott).
-
-------------------------------------------------------------------------------
-
-* Support for DEC OSF/1 is definitely broken. My programs always
- seg-fault when I link with libpthreads.a.
-
-* Thread id's are no longer int's, but are instead of type
- _objc_thread_t which is typedef'ed from a void *. An invalid thread
- id is denoted by NULL and not -1 as before.
-
-------------------------------------------------------------------------------
-
-* Renamed thread-winnt.c to thread-win32.c to better reflect support
- for the API on both Windows NT and Windows 95 platforms.
- (Who knows, maybe even Win32s :-).
-
-* Fixed bugs in Win32 support as per report from Scott Christley.
-
-* Fixed bug in sarray_get as per report from Scott Christley.
-
-
diff --git a/gcc/objc/THREADS b/gcc/objc/THREADS
deleted file mode 100644
index 9dfbbed97af..00000000000
--- a/gcc/objc/THREADS
+++ /dev/null
@@ -1,374 +0,0 @@
-This file describes in little detail the modifications to the
-Objective-C runtime needed to make it thread safe.
-
-First off, kudos to Galen Hunt who is the author of this great work.
-
-If you have an comments or just want to know where to
-send me money to express your undying gratitude for threading the
-Objective-C runtime you can reach Galen at:
-
- gchunt@cs.rochester.edu
-
-Any questions, comments, bug reports, etc. should send email either to the
-GCC bug account or to:
-
- Scott Christley <scottc@net-community.com>
-
-* Sarray Threading:
-
-The most critical component of the Objective-C runtime is the sparse array
-structure (sarray). Sarrays store object selectors and implementations.
-Following in the tradition of the Objective-C runtime, my threading
-support assumes that fast message dispatching is far more important
-than *ANY* and *ALL* other operations. The message dispatching thus
-uses *NO* locks on any kind. In fact, if you look in sarray.h, you
-will notice that the message dispatching has not been modified.
-Instead, I have modified the sarray management functions so that all
-updates to the sarray data structure can be made in parallel will
-message dispatching.
-
-To support concurrent message dispatching, no dynamically allocated
-sarray data structures are freed while more than one thread is
-operational. Sarray data structures that are no longer in use are
-kept in a linked list of garbage and are released whenever the program
-is operating with a single thread. The programmer can also flush the
-garbage list by calling sarray_remove_garbage when the programmer can
-ensure that no message dispatching is taking place concurrently. The
-amount of un-reclaimed sarray garbage should normally be extremely
-small in a real program as sarray structures are freed only when using
-the "poseAs" functionality and early in program initialization, which
-normally occurs while the program is single threaded.
-
-******************************************************************************
-* Static Variables:
-
-The following variables are either statically or globally defined. This list
-does not include variables which are internal to implementation dependent
-versions of thread-*.c.
-
-The following threading designations are used:
- SAFE : Implicitly thread safe.
- SINGLE : Must only be used in single thread mode.
- MUTEX : Protected by single global mutex objc_runtime_mutex.
- UNUSED : Not used in the runtime.
-
-Variable Name: Usage: Defined: Also used in:
-=========================== ====== ============ =====================
-__objc_class_hash MUTEX class.c
-__objc_class_links_resolved UNUSED class.c runtime.h
-__objc_class_number MUTEX class.c
-__objc_dangling_categories UNUSED init.c
-__objc_module_list MUTEX init.c
-__objc_selector_array MUTEX selector.c
-__objc_selector_hash MUTEX selector.c
-__objc_selector_max_index MUTEX selector.c sendmsg.c runtime.h
-__objc_selector_names MUTEX selector.c
-__objc_thread_exit_status SAFE thread.c
-__objc_uninstalled_dtable MUTEX sendmsg.c selector.c
-_objc_load_callback SAFE init.c objc-api.h
-_objc_lookup_class SAFE class.c objc-api.h
-_objc_object_alloc SINGLE objects.c objc-api.h
-_objc_object_copy SINGLE objects.c objc-api.h
-_objc_object_dispose SINGLE objects.c objc-api.h
-frwd_sel SAFE2 sendmsg.c
-idxsize MUTEX sarray.c sendmsg.c sarray.h
-initialize_sel SAFE2 sendmsg.c
-narrays MUTEX sarray.c sendmsg.c sarray.h
-nbuckets MUTEX sarray.c sendmsg.c sarray.h
-nindices MUTEX sarray.c sarray.h
-previous_constructors SAFE1 init.c
-proto_class SAFE1 init.c
-unclaimed_categories MUTEX init.c
-unclaimed_proto_list MUTEX init.c
-uninitialized_statics MUTEX init.c
-
-Notes:
-1) Initialized once in unithread mode.
-2) Initialized value will always be same, guaranteed by lock on selector
- hash table.
-
-
-******************************************************************************
-* Frontend/Backend design:
-
-The design of the Objective-C runtime thread and mutex functions utilizes a
-frontend/backend implementation.
-
-The frontend, as characterized by the files thr.h and thr.c, is a set
-of platform independent structures and functions which represent the
-user interface. Objective-C programs should use these structures and
-functions for their thread and mutex work if they wish to maintain a
-high degree of portability across platforms.
-
-The backend is composed of a file with the necessary code to map the ObjC
-thread and mutex to a platform specific implementation. For example, the
-file thr-solaris.c contains the implementation for Solaris. When you
-configure GCC, it attempts to pick an appropriate backend file for the
-target platform; however, you can override this choice by assign the
-OBJC_THREAD_FILE make variable to the basename of the backend file. This
-is especially useful on platforms which have multiple thread libraries.
-For example:
-
- make OBJC_THREAD_FILE=thr-posix
-
-would indicate that the generic posix backend file, thr-posix.c, should be
-compiled with the ObjC runtime library. If your platform does not support
-threads then you should specify the OBJC_THREAD_FILE=thr-single backend file
-to compile the ObjC runtime library without thread or mutex support; note
-that programs which rely upon the ObjC thread and mutex functions will
-compile and link correctly but attempting to create a thread or mutex will
-result in an error.
-
-It is questionable whether it is really necessary to have both a
-frontend and backend function for all available functionality. On the
-one hand, it provides a clear, consistent differentiation between what
-is public and what is private with the downside of having the overhead
-of multiple functions calls. For example, the function to have a thread
-yield the processor is objc_thread_yield; in the current implementation
-this produces a function call set:
-
-objc_thread_yield() -> __objc_thread_yield() -> system yield function
-
-This has two extra function calls over calling the platform specific function
-explicitly, but the issue is whether only the overhead of a single function
-is necessary.
-
-objc_thread_yield() -> system yield function
-
-This breaks the public/private dichotomy between the frontend/backend
-for the sake of efficiency. It is possible to just use a preprocessor
-define so as to eliminate the extra function call:
-
-#define objc_thread_yield() __objc_thread_yield()
-
-This has the undesirable effect that if objc_thread_yield is actually
-turned into a function based upon future need; then ObjC programs which
-access the thread functions would need to be recompiled versus just
-being relinked.
-
-******************************************************************************
-* Threads:
-
-The thread system attempts to create multiple threads using whatever
-operating system or library thread support is available. It does
-assume that all system functions are thread safe. Notably this means
-that the system implementation of malloc and free must be thread safe.
-If a system has multiple processors, the threads are configured for
-full parallel processing.
-
-* Backend initialization functions
-
-__objc_init_thread_system(void), int
- Initialize the thread subsystem. Called once by __objc_exec_class.
- Return -1 if error otherwise return 0.
-
-__objc_close_thread_system(void), int
- Closes the thread subsystem, not currently guaranteed to be called.
- Return -1 if error otherwise return 0.
-
-*****
-* Frontend thread functions
-* User programs should use these functions.
-
-objc_thread_detach(SEL selector, id object, id argument), objc_thread_t
- Creates and detaches a new thread. The new thread starts by
- sending the given selector with a single argument to the
- given object.
-
-objc_thread_set_priority(int priority), int
- Sets a thread's relative priority within the program. Valid
- options are:
-
- OBJC_THREAD_INTERACTIVE_PRIORITY
- OBJC_THREAD_BACKGROUND_PRIORITY
- OBJC_THREAD_LOW_PRIORITY
-
-objc_thread_get_priority(void), int
- Query a thread's priority.
-
-objc_thread_yield(void), void
- Yields processor to another thread with equal or higher
- priority. It is up to the system scheduler to determine if
- the processor is taken or not.
-
-objc_thread_exit(void), int
- Terminates a thread. If this is the last thread executing
- then the program will terminate.
-
-objc_thread_id(void), int
- Returns the current thread's id.
-
-objc_thread_set_data(void *value), int
- Set a pointer to the thread's local storage. Local storage is
- thread specific.
-
-objc_thread_get_data(void), void *
- Returns the pointer to the thread's local storage.
-
-*****
-* Backend thread functions
-* User programs should *NOT* directly call these functions.
-
-__objc_thread_detach(void (*func)(void *arg), void *arg), objc_thread_t
- Spawns a new thread executing func, called by objc_thread_detach.
- Return NULL if error otherwise return thread id.
-
-__objc_thread_set_priority(int priority), int
- Set the thread's priority, called by objc_thread_set_priority.
- Return -1 if error otherwise return 0.
-
-__objc_thread_get_priority(void), int
- Query a thread's priority, called by objc_thread_get_priority.
- Return -1 if error otherwise return the priority.
-
-__objc_thread_yield(void), void
- Yields the processor, called by objc_thread_yield.
-
-__objc_thread_exit(void), int
- Terminates the thread, called by objc_thread_exit.
- Return -1 if error otherwise function does not return.
-
-__objc_thread_id(void), objc_thread_t
- Returns the current thread's id, called by objc_thread_id.
- Return -1 if error otherwise return thread id.
-
-__objc_thread_set_data(void *value), int
- Set pointer for thread local storage, called by objc_thread_set_data.
- Returns -1 if error otherwise return 0.
-
-__objc_thread_get_data(void), void *
- Returns the pointer to the thread's local storage.
- Returns NULL if error, called by objc_thread_get_data.
-
-
-******************************************************************************
-* Mutexes:
-
-Mutexes can be locked recursively. Each locked mutex remembers
-its owner (by thread id) and how many times it has been locked. The
-last unlock on a mutex removes the system lock and allows other
-threads to access the mutex.
-
-*****
-* Frontend mutex functions
-* User programs should use these functions.
-
-objc_mutex_allocate(void), objc_mutex_t
- Allocates a new mutex. Mutex is initially unlocked.
- Return NULL if error otherwise return mutex pointer.
-
-objc_mutex_deallocate(objc_mutex_t mutex), int
- Free a mutex. Before freeing the mutex, makes sure that no
- one else is using it.
- Return -1 if error otherwise return 0.
-
-objc_mutex_lock(objc_mutex_t mutex), int
- Locks a mutex. As mentioned earlier, the same thread may call
- this routine repeatedly.
- Return -1 if error otherwise return 0.
-
-objc_mutex_trylock(objc_mutex_t mutex), int
- Attempts to lock a mutex. If lock on mutex can be acquired
- then function operates exactly as objc_mutex_lock.
- Return -1 if failed to acquire lock otherwise return 0.
-
-objc_mutex_unlock(objc_mutex_t mutex), int
- Unlocks the mutex by one level. Other threads may not acquire
- the mutex until this thread has released all locks on it.
- Return -1 if error otherwise return 0.
-
-*****
-* Backend mutex functions
-* User programs should *NOT* directly call these functions.
-
-__objc_mutex_allocate(objc_mutex_t mutex), int
- Allocates a new mutex, called by objc_mutex_allocate.
- Return -1 if error otherwise return 0.
-
-__objc_mutex_deallocate(objc_mutex_t mutex), int
- Free a mutex, called by objc_mutex_deallocate.
- Return -1 if error otherwise return 0.
-
-__objc_mutex_lock(objc_mutex_t mutex), int
- Locks a mutex, called by objc_mutex_lock.
- Return -1 if error otherwise return 0.
-
-__objc_mutex_trylock(objc_mutex_t mutex), int
- Attempts to lock a mutex, called by objc_mutex_trylock.
- Return -1 if failed to acquire lock or error otherwise return 0.
-
-__objc_mutex_unlock(objc_mutex_t mutex), int
- Unlocks the mutex, called by objc_mutex_unlock.
- Return -1 if error otherwise return 0.
-
-******************************************************************************
-* Condition Mutexes:
-
-Mutexes can be locked recursively. Each locked mutex remembers
-its owner (by thread id) and how many times it has been locked. The
-last unlock on a mutex removes the system lock and allows other
-threads to access the mutex.
-
-*
-* Frontend condition mutex functions
-* User programs should use these functions.
-*
-
-objc_condition_allocate(void), objc_condition_t
- Allocate a condition mutex.
- Return NULL if error otherwise return condition pointer.
-
-objc_condition_deallocate(objc_condition_t condition), int
- Deallocate a condition. Note that this includes an implicit
- condition_broadcast to insure that waiting threads have the
- opportunity to wake. It is legal to dealloc a condition only
- if no other thread is/will be using it. Does NOT check for
- other threads waiting but just wakes them up.
- Return -1 if error otherwise return 0.
-
-objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int
- Wait on the condition unlocking the mutex until objc_condition_signal()
- or objc_condition_broadcast() are called for the same condition. The
- given mutex *must* have the depth 1 so that it can be unlocked
- here, for someone else can lock it and signal/broadcast the condition.
- The mutex is used to lock access to the shared data that make up the
- "condition" predicate.
- Return -1 if error otherwise return 0.
-
-objc_condition_broadcast(objc_condition_t condition), int
- Wake up all threads waiting on this condition. It is recommended that
- the called would lock the same mutex as the threads in
- objc_condition_wait before changing the "condition predicate"
- and make this call and unlock it right away after this call.
- Return -1 if error otherwise return 0.
-
-objc_condition_signal(objc_condition_t condition), int
- Wake up one thread waiting on this condition.
- Return -1 if error otherwise return 0.
-
-*
-* Backend condition mutex functions
-* User programs should *NOT* directly call these functions.
-*
-
-__objc_condition_allocate(objc_condition_t condition), int
- Allocate a condition mutex, called by objc_condition_allocate.
- Return -1 if error otherwise return 0.
-
-__objc_condition_deallocate(objc_condition_t condition), int
- Deallocate a condition, called by objc_condition_deallocate.
- Return -1 if error otherwise return 0.
-
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int
- Wait on the condition, called by objc_condition_wait.
- Return -1 if error otherwise return 0 when condition is met.
-
-__objc_condition_broadcast(objc_condition_t condition), int
- Wake up all threads waiting on this condition.
- Called by objc_condition_broadcast.
- Return -1 if error otherwise return 0.
-
-__objc_condition_signal(objc_condition_t condition), int
- Wake up one thread waiting on this condition.
- Called by objc_condition_signal.
- Return -1 if error otherwise return 0.
diff --git a/gcc/objc/THREADS.MACH b/gcc/objc/THREADS.MACH
deleted file mode 100644
index 55de6637866..00000000000
--- a/gcc/objc/THREADS.MACH
+++ /dev/null
@@ -1,23 +0,0 @@
-This readme refers to the file thr-mach.c.
-
-Under mach, thread priorities are kinda strange-- any given thread has
-a MAXIMUM priority and a BASE priority. The BASE priority is the
-current priority of the thread and the MAXIMUM is the maximum possible
-priority the thread can assume. The developer can lower, but never
-raise the maximum priority.
-
-The gcc concept of thread priorities is that they run at one of three
-levels; interactive, background, and low.
-
-Under mach, this is translated to:
-
-interactive -- set priority to maximum
-background -- set priority to 2/3 of maximum
-low -- set priority to 1/3 of maximum
-
-This means that it is possible for a thread with the priority of
-interactive to actually run at a lower priority than another thread
-with a background, or even low, priority if the developer has modified
-the maximum priority.
-
-
diff --git a/gcc/objc/archive.c b/gcc/objc/archive.c
deleted file mode 100644
index af9591b25ec..00000000000
--- a/gcc/objc/archive.c
+++ /dev/null
@@ -1,1657 +0,0 @@
-/* GNU Objective C Runtime archiving
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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 "config.h"
-#include "runtime.h"
-#include "typedstream.h"
-#include "encoding.h"
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-extern int fflush(FILE*);
-
-#define ROUND(V, A) \
- ({ typeof(V) __v=(V); typeof(A) __a=(A); \
- __a*((__v+__a-1)/__a); })
-
-#define PTR2LONG(P) (((char*)(P))-(char*)0)
-#define LONG2PTR(L) (((char*)0)+(L))
-
-/* Declare some functions... */
-
-static int
-objc_read_class (struct objc_typed_stream* stream, Class* class);
-
-int objc_sizeof_type(const char* type);
-
-static int
-objc_write_use_common (struct objc_typed_stream* stream, unsigned long key);
-
-static int
-objc_write_register_common (struct objc_typed_stream* stream,
- unsigned long key);
-
-static int
-objc_write_class (struct objc_typed_stream* stream,
- struct objc_class* class);
-
-const char* objc_skip_type (const char* type);
-
-static void __objc_finish_write_root_object(struct objc_typed_stream*);
-static void __objc_finish_read_root_object(struct objc_typed_stream*);
-
-static __inline__ int
-__objc_code_unsigned_char (unsigned char* buf, unsigned char val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- buf[0] = _B_NINT|0x01;
- buf[1] = val;
- return 2;
- }
-}
-
-int
-objc_write_unsigned_char (struct objc_typed_stream* stream,
- unsigned char value)
-{
- unsigned char buf[sizeof (unsigned char)+1];
- int len = __objc_code_unsigned_char (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_char (unsigned char* buf, char val)
-{
- if (val >= 0)
- return __objc_code_unsigned_char (buf, val);
- else
- {
- buf[0] = _B_NINT|_B_SIGN|0x01;
- buf[1] = -val;
- return 2;
- }
-}
-
-int
-objc_write_char (struct objc_typed_stream* stream, char value)
-{
- unsigned char buf[sizeof (char)+1];
- int len = __objc_code_char (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_unsigned_short (unsigned char* buf, unsigned short val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- int c, b;
-
- buf[0] = _B_NINT;
-
- for (c= sizeof(short); c != 0; c -= 1)
- if (((val>>(8*(c-1)))%0x100) != 0)
- break;
-
- buf[0] |= c;
-
- for (b = 1; c != 0; c--, b++)
- {
- buf[b] = (val >> (8*(c-1)))%0x100;
- }
-
- return b;
- }
-}
-
-int
-objc_write_unsigned_short (struct objc_typed_stream* stream,
- unsigned short value)
-{
- unsigned char buf[sizeof (unsigned short)+1];
- int len = __objc_code_unsigned_short (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_short (unsigned char* buf, short val)
-{
- int sign = (val < 0);
- int size = __objc_code_unsigned_short (buf, sign ? -val : val);
- if (sign)
- buf[0] |= _B_SIGN;
- return size;
-}
-
-int
-objc_write_short (struct objc_typed_stream* stream, short value)
-{
- unsigned char buf[sizeof (short)+1];
- int len = __objc_code_short (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-
-static __inline__ int
-__objc_code_unsigned_int (unsigned char* buf, unsigned int val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- int c, b;
-
- buf[0] = _B_NINT;
-
- for (c= sizeof(int); c != 0; c -= 1)
- if (((val>>(8*(c-1)))%0x100) != 0)
- break;
-
- buf[0] |= c;
-
- for (b = 1; c != 0; c--, b++)
- {
- buf[b] = (val >> (8*(c-1)))%0x100;
- }
-
- return b;
- }
-}
-
-int
-objc_write_unsigned_int (struct objc_typed_stream* stream, unsigned int value)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len = __objc_code_unsigned_int (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_int (unsigned char* buf, int val)
-{
- int sign = (val < 0);
- int size = __objc_code_unsigned_int (buf, sign ? -val : val);
- if (sign)
- buf[0] |= _B_SIGN;
- return size;
-}
-
-int
-objc_write_int (struct objc_typed_stream* stream, int value)
-{
- unsigned char buf[sizeof(int)+1];
- int len = __objc_code_int (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_unsigned_long (unsigned char* buf, unsigned long val)
-{
- if ((val&_B_VALUE) == val)
- {
- buf[0] = val|_B_SINT;
- return 1;
- }
- else
- {
- int c, b;
-
- buf[0] = _B_NINT;
-
- for (c= sizeof(long); c != 0; c -= 1)
- if (((val>>(8*(c-1)))%0x100) != 0)
- break;
-
- buf[0] |= c;
-
- for (b = 1; c != 0; c--, b++)
- {
- buf[b] = (val >> (8*(c-1)))%0x100;
- }
-
- return b;
- }
-}
-
-int
-objc_write_unsigned_long (struct objc_typed_stream* stream,
- unsigned long value)
-{
- unsigned char buf[sizeof(unsigned long)+1];
- int len = __objc_code_unsigned_long (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-static __inline__ int
-__objc_code_long (unsigned char* buf, long val)
-{
- int sign = (val < 0);
- int size = __objc_code_unsigned_long (buf, sign ? -val : val);
- if (sign)
- buf[0] |= _B_SIGN;
- return size;
-}
-
-int
-objc_write_long (struct objc_typed_stream* stream, long value)
-{
- unsigned char buf[sizeof(long)+1];
- int len = __objc_code_long (buf, value);
- return (*stream->write)(stream->physical, buf, len);
-}
-
-
-int
-objc_write_string (struct objc_typed_stream* stream,
- const unsigned char* string, unsigned int nbytes)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len = __objc_code_unsigned_int (buf, nbytes);
-
- if ((buf[0]&_B_CODE) == _B_SINT)
- buf[0] = (buf[0]&_B_VALUE)|_B_SSTR;
-
- else /* _B_NINT */
- buf[0] = (buf[0]&_B_VALUE)|_B_NSTR;
-
- if ((*stream->write)(stream->physical, buf, len) != 0)
- return (*stream->write)(stream->physical, string, nbytes);
- else
- return 0;
-}
-
-int
-objc_write_string_atomic (struct objc_typed_stream* stream,
- unsigned char* string, unsigned int nbytes)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, string))))
- return objc_write_use_common (stream, key);
- else
- {
- int length;
- hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(string)), string);
- if ((length = objc_write_register_common (stream, key)))
- return objc_write_string (stream, string, nbytes);
- return length;
- }
-}
-
-static int
-objc_write_register_common (struct objc_typed_stream* stream,
- unsigned long key)
-{
- unsigned char buf[sizeof (unsigned long)+2];
- int len = __objc_code_unsigned_long (buf+1, key);
- if (len == 1)
- {
- buf[0] = _B_RCOMM|0x01;
- buf[1] &= _B_VALUE;
- return (*stream->write)(stream->physical, buf, len+1);
- }
- else
- {
- buf[1] = (buf[1]&_B_VALUE)|_B_RCOMM;
- return (*stream->write)(stream->physical, buf+1, len);
- }
-}
-
-static int
-objc_write_use_common (struct objc_typed_stream* stream, unsigned long key)
-{
- unsigned char buf[sizeof (unsigned long)+2];
- int len = __objc_code_unsigned_long (buf+1, key);
- if (len == 1)
- {
- buf[0] = _B_UCOMM|0x01;
- buf[1] &= _B_VALUE;
- return (*stream->write)(stream->physical, buf, 2);
- }
- else
- {
- buf[1] = (buf[1]&_B_VALUE)|_B_UCOMM;
- return (*stream->write)(stream->physical, buf+1, len);
- }
-}
-
-static __inline__ int
-__objc_write_extension (struct objc_typed_stream* stream, unsigned char code)
-{
- if (code <= _B_VALUE)
- {
- unsigned char buf = code|_B_EXT;
- return (*stream->write)(stream->physical, &buf, 1);
- }
- else
- {
- objc_error(nil, OBJC_ERR_BAD_OPCODE,
- "__objc_write_extension: bad opcode %c\n", code);
- return -1;
- }
-}
-
-__inline__ int
-__objc_write_object (struct objc_typed_stream* stream, id object)
-{
- unsigned char buf = '\0';
- SEL write_sel = sel_get_any_uid ("write:");
- if (object)
- {
- __objc_write_extension (stream, _BX_OBJECT);
- objc_write_class (stream, object->class_pointer);
- (*objc_msg_lookup(object, write_sel))(object, write_sel, stream);
- return (*stream->write)(stream->physical, &buf, 1);
- }
- else
- return objc_write_use_common(stream, 0);
-}
-
-int
-objc_write_object_reference (struct objc_typed_stream* stream, id object)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->object_table, object))))
- return objc_write_use_common (stream, key);
-
- __objc_write_extension (stream, _BX_OBJREF);
- return objc_write_unsigned_long (stream, PTR2LONG (object));
-}
-
-int
-objc_write_root_object (struct objc_typed_stream* stream, id object)
-{
- int len = 0;
- if (stream->writing_root_p)
- objc_error (nil, OBJC_ERR_RECURSE_ROOT,
- "objc_write_root_object called recursively");
- else
- {
- stream->writing_root_p = 1;
- __objc_write_extension (stream, _BX_OBJROOT);
- if((len = objc_write_object (stream, object)))
- __objc_finish_write_root_object(stream);
- stream->writing_root_p = 0;
- }
- return len;
-}
-
-int
-objc_write_object (struct objc_typed_stream* stream, id object)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->object_table, object))))
- return objc_write_use_common (stream, key);
-
- else if (object == nil)
- return objc_write_use_common(stream, 0);
-
- else
- {
- int length;
- hash_add (&stream->object_table, LONG2PTR(key=PTR2LONG(object)), object);
- if ((length = objc_write_register_common (stream, key)))
- return __objc_write_object (stream, object);
- return length;
- }
-}
-
-#ifdef __alpha__
-extern int atoi (const char*);
-extern size_t strlen(const char*);
-extern size_t strcpy(char*, const char*);
-#endif
-
-__inline__ int
-__objc_write_class (struct objc_typed_stream* stream, struct objc_class* class)
-{
- __objc_write_extension (stream, _BX_CLASS);
- objc_write_string_atomic(stream, (char*)class->name,
- strlen((char*)class->name));
- return objc_write_unsigned_long (stream, class->version);
-}
-
-
-static int
-objc_write_class (struct objc_typed_stream* stream,
- struct objc_class* class)
-{
- unsigned long key;
- if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, class))))
- return objc_write_use_common (stream, key);
- else
- {
- int length;
- hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(class)), class);
- if ((length = objc_write_register_common (stream, key)))
- return __objc_write_class (stream, class);
- return length;
- }
-}
-
-
-__inline__ int
-__objc_write_selector (struct objc_typed_stream* stream, SEL selector)
-{
- const char* sel_name;
- __objc_write_extension (stream, _BX_SEL);
- /* to handle NULL selectors */
- if ((SEL)0 == selector)
- return objc_write_string (stream, "", 0);
- sel_name = sel_get_name (selector);
- return objc_write_string (stream, sel_name, strlen ((char*)sel_name));
-}
-
-int
-objc_write_selector (struct objc_typed_stream* stream, SEL selector)
-{
- const char* sel_name;
- unsigned long key;
-
- /* to handle NULL selectors */
- if ((SEL)0 == selector)
- return __objc_write_selector (stream, selector);
-
- sel_name = sel_get_name (selector);
- if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, sel_name))))
- return objc_write_use_common (stream, key);
- else
- {
- int length;
- hash_add (&stream->stream_table,
- LONG2PTR(key=PTR2LONG(sel_name)), (char*)sel_name);
- if ((length = objc_write_register_common (stream, key)))
- return __objc_write_selector (stream, selector);
- return length;
- }
-}
-
-
-
-/*
-** Read operations
-*/
-
-__inline__ int
-objc_read_char (struct objc_typed_stream* stream, char* val)
-{
- unsigned char buf;
- int len;
- len = (*stream->read)(stream->physical, &buf, 1);
- if (len != 0)
- {
- if ((buf & _B_CODE) == _B_SINT)
- (*val) = (buf & _B_VALUE);
-
- else if ((buf & _B_NUMBER) == 1)
- {
- len = (*stream->read)(stream->physical, val, 1);
- if (buf&_B_SIGN)
- (*val) = -1*(*val);
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected 8bit signed int, got %dbit int",
- (int)(buf&_B_NUMBER)*8);
- }
- return len;
-}
-
-
-__inline__ int
-objc_read_unsigned_char (struct objc_typed_stream* stream, unsigned char* val)
-{
- unsigned char buf;
- int len;
- if ((len = (*stream->read)(stream->physical, &buf, 1)))
- {
- if ((buf & _B_CODE) == _B_SINT)
- (*val) = (buf & _B_VALUE);
-
- else if ((buf & _B_NUMBER) == 1)
- len = (*stream->read)(stream->physical, val, 1);
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected 8bit unsigned int, got %dbit int",
- (int)(buf&_B_NUMBER)*8);
- }
- return len;
-}
-
-__inline__ int
-objc_read_short (struct objc_typed_stream* stream, short* value)
-{
- unsigned char buf[sizeof(short)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (short))
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected short, got bigger (%dbits)", nbytes*8);
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- if (buf[0] & _B_SIGN)
- (*value) = -(*value);
- }
- }
- return len;
-}
-
-__inline__ int
-objc_read_unsigned_short (struct objc_typed_stream* stream,
- unsigned short* value)
-{
- unsigned char buf[sizeof(unsigned short)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (short))
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected short, got int or bigger");
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- }
- }
- return len;
-}
-
-
-__inline__ int
-objc_read_int (struct objc_typed_stream* stream, int* value)
-{
- unsigned char buf[sizeof(int)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (int))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- if (buf[0] & _B_SIGN)
- (*value) = -(*value);
- }
- }
- return len;
-}
-
-__inline__ int
-objc_read_long (struct objc_typed_stream* stream, long* value)
-{
- unsigned char buf[sizeof(long)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- {
- int pos = 1;
- int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (long))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
- len = (*stream->read)(stream->physical, buf+1, nbytes);
- (*value) = 0;
- while (pos <= nbytes)
- (*value) = ((*value)*0x100) + buf[pos++];
- if (buf[0] & _B_SIGN)
- (*value) = -(*value);
- }
- }
- return len;
-}
-
-__inline__ int
-__objc_read_nbyte_uint (struct objc_typed_stream* stream,
- unsigned int nbytes, unsigned int* val)
-{
- int len, pos = 0;
- unsigned char buf[sizeof(unsigned int)+1];
-
- if (nbytes > sizeof (int))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
-
- len = (*stream->read)(stream->physical, buf, nbytes);
- (*val) = 0;
- while (pos < nbytes)
- (*val) = ((*val)*0x100) + buf[pos++];
- return len;
-}
-
-
-__inline__ int
-objc_read_unsigned_int (struct objc_typed_stream* stream,
- unsigned int* value)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- len = __objc_read_nbyte_uint (stream, (buf[0] & _B_VALUE), value);
-
- }
- return len;
-}
-
-int
-__objc_read_nbyte_ulong (struct objc_typed_stream* stream,
- unsigned int nbytes, unsigned long* val)
-{
- int len, pos = 0;
- unsigned char buf[sizeof(unsigned long)+1];
-
- if (nbytes > sizeof (long))
- objc_error(nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
-
- len = (*stream->read)(stream->physical, buf, nbytes);
- (*val) = 0;
- while (pos < nbytes)
- (*val) = ((*val)*0x100) + buf[pos++];
- return len;
-}
-
-
-__inline__ int
-objc_read_unsigned_long (struct objc_typed_stream* stream,
- unsigned long* value)
-{
- unsigned char buf[sizeof(unsigned long)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- if ((buf[0] & _B_CODE) == _B_SINT)
- (*value) = (buf[0] & _B_VALUE);
-
- else
- len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), value);
-
- }
- return len;
-}
-
-__inline__ int
-objc_read_string (struct objc_typed_stream* stream,
- char** string)
-{
- unsigned char buf[sizeof(unsigned int)+1];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- switch (buf[0]&_B_CODE) {
- case _B_SSTR:
- {
- int length = buf[0]&_B_VALUE;
- (*string) = (char*)objc_malloc(length+1);
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), *string);
- len = (*stream->read)(stream->physical, *string, length);
- (*string)[length] = '\0';
- }
- break;
-
- case _B_UCOMM:
- {
- char *tmp;
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- tmp = hash_value_for_key (stream->stream_table, LONG2PTR (key));
- *string = objc_malloc (strlen(tmp) + 1);
- strcpy (*string, tmp);
- }
- break;
-
- case _B_NSTR:
- {
- unsigned int nbytes = buf[0]&_B_VALUE;
- len = __objc_read_nbyte_uint(stream, nbytes, &nbytes);
- if (len) {
- (*string) = (char*)objc_malloc(nbytes+1);
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), *string);
- len = (*stream->read)(stream->physical, *string, nbytes);
- (*string)[nbytes] = '\0';
- }
- }
- break;
-
- default:
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected string, got opcode %c\n", (buf[0]&_B_CODE));
- }
- }
-
- return len;
-}
-
-
-int
-objc_read_object (struct objc_typed_stream* stream, id* object)
-{
- unsigned char buf[sizeof (unsigned int)];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- SEL read_sel = sel_get_any_uid ("read:");
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register common */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- if (buf[0] == (_B_EXT | _BX_OBJECT))
- {
- Class class;
-
- /* get class */
- len = objc_read_class (stream, &class);
-
- /* create instance */
- (*object) = class_create_instance(class);
-
- /* register? */
- if (key)
- hash_add (&stream->object_table, LONG2PTR(key), *object);
-
- /* send -read: */
- if (__objc_responds_to (*object, read_sel))
- (*get_imp(class, read_sel))(*object, read_sel, stream);
-
- /* check null-byte */
- len = (*stream->read)(stream->physical, buf, 1);
- if (buf[0] != '\0')
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected null-byte, got opcode %c", buf[0]);
- }
-
- else if ((buf[0]&_B_CODE) == _B_UCOMM)
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*object) = hash_value_for_key (stream->object_table, LONG2PTR(key));
- }
-
- else if (buf[0] == (_B_EXT | _BX_OBJREF)) /* a forward reference */
- {
- struct objc_list* other;
- len = objc_read_unsigned_long (stream, &key);
- other = (struct objc_list*)hash_value_for_key (stream->object_refs,
- LONG2PTR(key));
- hash_add (&stream->object_refs, LONG2PTR(key),
- (void*)list_cons(object, other));
- }
-
- else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY,
- "cannot register root object...");
- len = objc_read_object (stream, object);
- __objc_finish_read_root_object (stream);
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected object, got opcode %c", buf[0]);
- }
- return len;
-}
-
-static int
-objc_read_class (struct objc_typed_stream* stream, Class* class)
-{
- unsigned char buf[sizeof (unsigned int)];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- if (buf[0] == (_B_EXT | _BX_CLASS))
- {
- char* class_name;
- unsigned long version;
-
- /* get class */
- len = objc_read_string (stream, &class_name);
- (*class) = objc_get_class(class_name);
- objc_free(class_name);
-
- /* register */
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), *class);
-
- objc_read_unsigned_long(stream, &version);
- hash_add (&stream->class_table, (*class)->name, (void*)version);
- }
-
- else if ((buf[0]&_B_CODE) == _B_UCOMM)
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*class) = hash_value_for_key (stream->stream_table, LONG2PTR(key));
- if (!*class)
- objc_error(nil, OBJC_ERR_BAD_CLASS,
- "cannot find class for key %lu", key);
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected class, got opcode %c", buf[0]);
- }
- return len;
-}
-
-int
-objc_read_selector (struct objc_typed_stream* stream, SEL* selector)
-{
- unsigned char buf[sizeof (unsigned int)];
- int len;
- if ((len = (*stream->read)(stream->physical, buf, 1)))
- {
- unsigned long key = 0;
-
- if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
- {
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- len = (*stream->read)(stream->physical, buf, 1);
- }
-
- if (buf[0] == (_B_EXT|_BX_SEL)) /* selector! */
- {
- char* selector_name;
-
- /* get selector */
- len = objc_read_string (stream, &selector_name);
- /* To handle NULL selectors */
- if (0 == strlen(selector_name))
- {
- (*selector) = (SEL)0;
- return 0;
- }
- else
- (*selector) = sel_get_any_uid(selector_name);
- objc_free(selector_name);
-
- /* register */
- if (key)
- hash_add (&stream->stream_table, LONG2PTR(key), (void*)*selector);
- }
-
- else if ((buf[0]&_B_CODE) == _B_UCOMM)
- {
- if (key)
- objc_error(nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
- len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*selector) = hash_value_for_key (stream->stream_table,
- LONG2PTR(key));
- }
-
- else
- objc_error(nil, OBJC_ERR_BAD_DATA,
- "expected selector, got opcode %c", buf[0]);
- }
- return len;
-}
-
-/*
-** USER LEVEL FUNCTIONS
-*/
-
-/*
-** Write one object, encoded in TYPE and pointed to by DATA to the
-** typed stream STREAM.
-*/
-
-int
-objc_write_type(TypedStream* stream, const char* type, const void* data)
-{
- switch(*type) {
- case _C_ID:
- return objc_write_object (stream, *(id*)data);
- break;
-
- case _C_CLASS:
- return objc_write_class (stream, *(Class*)data);
- break;
-
- case _C_SEL:
- return objc_write_selector (stream, *(SEL*)data);
- break;
-
- case _C_CHR:
- return objc_write_char(stream, *(char*)data);
- break;
-
- case _C_UCHR:
- return objc_write_unsigned_char(stream, *(unsigned char*)data);
- break;
-
- case _C_SHT:
- return objc_write_short(stream, *(short*)data);
- break;
-
- case _C_USHT:
- return objc_write_unsigned_short(stream, *(unsigned short*)data);
- break;
-
- case _C_INT:
- return objc_write_int(stream, *(int*)data);
- break;
-
- case _C_UINT:
- return objc_write_unsigned_int(stream, *(unsigned int*)data);
- break;
-
- case _C_LNG:
- return objc_write_long(stream, *(long*)data);
- break;
-
- case _C_ULNG:
- return objc_write_unsigned_long(stream, *(unsigned long*)data);
- break;
-
- case _C_CHARPTR:
- return objc_write_string (stream, *(char**)data, strlen(*(char**)data));
- break;
-
- case _C_ATOM:
- return objc_write_string_atomic (stream, *(char**)data,
- strlen(*(char**)data));
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(type+1);
- while (isdigit(*++type))
- ;
- return objc_write_array (stream, type, len, data);
- }
- break;
-
- case _C_STRUCT_B:
- {
- int acc_size = 0;
- int align;
- while (*type != _C_STRUCT_E && *type++ != '=')
- ; /* skip "<name>=" */
- while (*type != _C_STRUCT_E)
- {
- align = objc_alignof_type (type); /* padd to alignment */
- acc_size += ROUND (acc_size, align);
- objc_write_type (stream, type, ((char*)data)+acc_size);
- acc_size += objc_sizeof_type (type); /* add component size */
- type = objc_skip_typespec (type); /* skip component */
- }
- return 1;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_write_type: cannot parse typespec: %s\n", type);
- return 0;
- }
- }
-}
-
-/*
-** Read one object, encoded in TYPE and pointed to by DATA to the
-** typed stream STREAM. DATA specifies the address of the types to
-** read. Expected type is checked against the type actually present
-** on the stream.
-*/
-
-int
-objc_read_type(TypedStream* stream, const char* type, void* data)
-{
- char c;
- switch(c = *type) {
- case _C_ID:
- return objc_read_object (stream, (id*)data);
- break;
-
- case _C_CLASS:
- return objc_read_class (stream, (Class*)data);
- break;
-
- case _C_SEL:
- return objc_read_selector (stream, (SEL*)data);
- break;
-
- case _C_CHR:
- return objc_read_char (stream, (char*)data);
- break;
-
- case _C_UCHR:
- return objc_read_unsigned_char (stream, (unsigned char*)data);
- break;
-
- case _C_SHT:
- return objc_read_short (stream, (short*)data);
- break;
-
- case _C_USHT:
- return objc_read_unsigned_short (stream, (unsigned short*)data);
- break;
-
- case _C_INT:
- return objc_read_int (stream, (int*)data);
- break;
-
- case _C_UINT:
- return objc_read_unsigned_int (stream, (unsigned int*)data);
- break;
-
- case _C_LNG:
- return objc_read_long (stream, (long*)data);
- break;
-
- case _C_ULNG:
- return objc_read_unsigned_long (stream, (unsigned long*)data);
- break;
-
- case _C_CHARPTR:
- case _C_ATOM:
- return objc_read_string (stream, (char**)data);
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(type+1);
- while (isdigit(*++type))
- ;
- return objc_read_array (stream, type, len, data);
- }
- break;
-
- case _C_STRUCT_B:
- {
- int acc_size = 0;
- int align;
- while (*type != _C_STRUCT_E && *type++ != '=')
- ; /* skip "<name>=" */
- while (*type != _C_STRUCT_E)
- {
- align = objc_alignof_type (type); /* padd to alignment */
- acc_size += ROUND (acc_size, align);
- objc_read_type (stream, type, ((char*)data)+acc_size);
- acc_size += objc_sizeof_type (type); /* add component size */
- type = objc_skip_typespec (type); /* skip component */
- }
- return 1;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_read_type: cannot parse typespec: %s\n", type);
- return 0;
- }
- }
-}
-
-/*
-** Write the object specified by the template TYPE to STREAM. Last
-** arguments specify addresses of values to be written. It might
-** seem surprising to specify values by address, but this is extremely
-** convenient for copy-paste with objc_read_types calls. A more
-** down-to-the-earth cause for this passing of addresses is that values
-** of arbitrary size is not well supported in ANSI C for functions with
-** variable number of arguments.
-*/
-
-int
-objc_write_types (TypedStream* stream, const char* type, ...)
-{
- va_list args;
- const char *c;
- int res = 0;
-
- va_start(args, type);
-
- for (c = type; *c; c = objc_skip_typespec (c))
- {
- switch(*c) {
- case _C_ID:
- res = objc_write_object (stream, *va_arg (args, id*));
- break;
-
- case _C_CLASS:
- res = objc_write_class (stream, *va_arg(args, Class*));
- break;
-
- case _C_SEL:
- res = objc_write_selector (stream, *va_arg(args, SEL*));
- break;
-
- case _C_CHR:
- res = objc_write_char (stream, *va_arg (args, char*));
- break;
-
- case _C_UCHR:
- res = objc_write_unsigned_char (stream,
- *va_arg (args, unsigned char*));
- break;
-
- case _C_SHT:
- res = objc_write_short (stream, *va_arg(args, short*));
- break;
-
- case _C_USHT:
- res = objc_write_unsigned_short (stream,
- *va_arg(args, unsigned short*));
- break;
-
- case _C_INT:
- res = objc_write_int(stream, *va_arg(args, int*));
- break;
-
- case _C_UINT:
- res = objc_write_unsigned_int(stream, *va_arg(args, unsigned int*));
- break;
-
- case _C_LNG:
- res = objc_write_long(stream, *va_arg(args, long*));
- break;
-
- case _C_ULNG:
- res = objc_write_unsigned_long(stream, *va_arg(args, unsigned long*));
- break;
-
- case _C_CHARPTR:
- {
- char** str = va_arg(args, char**);
- res = objc_write_string (stream, *str, strlen(*str));
- }
- break;
-
- case _C_ATOM:
- {
- char** str = va_arg(args, char**);
- res = objc_write_string_atomic (stream, *str, strlen(*str));
- }
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(c+1);
- const char* t = c;
- while (isdigit(*++t))
- ;
- res = objc_write_array (stream, t, len, va_arg(args, void*));
- t = objc_skip_typespec (t);
- if (*t != _C_ARY_E)
- objc_error(nil, OBJC_ERR_BAD_TYPE, "expected `]', got: %s", t);
- }
- break;
-
- default:
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_write_types: cannot parse typespec: %s\n", type);
- }
- }
- va_end(args);
- return res;
-}
-
-
-/*
-** Last arguments specify addresses of values to be read. Expected
-** type is checked against the type actually present on the stream.
-*/
-
-int
-objc_read_types(TypedStream* stream, const char* type, ...)
-{
- va_list args;
- const char *c;
- int res = 0;
-
- va_start(args, type);
-
- for (c = type; *c; c = objc_skip_typespec(c))
- {
- switch(*c) {
- case _C_ID:
- res = objc_read_object(stream, va_arg(args, id*));
- break;
-
- case _C_CLASS:
- res = objc_read_class(stream, va_arg(args, Class*));
- break;
-
- case _C_SEL:
- res = objc_read_selector(stream, va_arg(args, SEL*));
- break;
-
- case _C_CHR:
- res = objc_read_char(stream, va_arg(args, char*));
- break;
-
- case _C_UCHR:
- res = objc_read_unsigned_char(stream, va_arg(args, unsigned char*));
- break;
-
- case _C_SHT:
- res = objc_read_short(stream, va_arg(args, short*));
- break;
-
- case _C_USHT:
- res = objc_read_unsigned_short(stream, va_arg(args, unsigned short*));
- break;
-
- case _C_INT:
- res = objc_read_int(stream, va_arg(args, int*));
- break;
-
- case _C_UINT:
- res = objc_read_unsigned_int(stream, va_arg(args, unsigned int*));
- break;
-
- case _C_LNG:
- res = objc_read_long(stream, va_arg(args, long*));
- break;
-
- case _C_ULNG:
- res = objc_read_unsigned_long(stream, va_arg(args, unsigned long*));
- break;
-
- case _C_CHARPTR:
- case _C_ATOM:
- {
- char** str = va_arg(args, char**);
- res = objc_read_string (stream, str);
- }
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(c+1);
- const char* t = c;
- while (isdigit(*++t))
- ;
- res = objc_read_array (stream, t, len, va_arg(args, void*));
- t = objc_skip_typespec (t);
- if (*t != _C_ARY_E)
- objc_error(nil, OBJC_ERR_BAD_TYPE, "expected `]', got: %s", t);
- }
- break;
-
- default:
- objc_error(nil, OBJC_ERR_BAD_TYPE,
- "objc_read_types: cannot parse typespec: %s\n", type);
- }
- }
- va_end(args);
- return res;
-}
-
-/*
-** Write an array of COUNT elements of TYPE from the memory address DATA.
-** This is equivalent of objc_write_type (stream, "[N<type>]", data)
-*/
-
-int
-objc_write_array (TypedStream* stream, const char* type,
- int count, const void* data)
-{
- int off = objc_sizeof_type(type);
- const char* where = data;
-
- while (count-- > 0)
- {
- objc_write_type(stream, type, where);
- where += off;
- }
- return 1;
-}
-
-/*
-** Read an array of COUNT elements of TYPE into the memory address
-** DATA. The memory pointed to by data is supposed to be allocated
-** by the callee. This is equivalent of
-** objc_read_type (stream, "[N<type>]", data)
-*/
-
-int
-objc_read_array (TypedStream* stream, const char* type,
- int count, void* data)
-{
- int off = objc_sizeof_type(type);
- char* where = (char*)data;
-
- while (count-- > 0)
- {
- objc_read_type(stream, type, where);
- where += off;
- }
- return 1;
-}
-
-static int
-__objc_fread(FILE* file, char* data, int len)
-{
- return fread(data, len, 1, file);
-}
-
-static int
-__objc_fwrite(FILE* file, char* data, int len)
-{
- return fwrite(data, len, 1, file);
-}
-
-static int
-__objc_feof(FILE* file)
-{
- return feof(file);
-}
-
-static int
-__objc_no_write(FILE* file, char* data, int len)
-{
- objc_error (nil, OBJC_ERR_NO_WRITE, "TypedStream not open for writing");
- return 0;
-}
-
-static int
-__objc_no_read(FILE* file, char* data, int len)
-{
- objc_error (nil, OBJC_ERR_NO_READ, "TypedStream not open for reading");
- return 0;
-}
-
-static int
-__objc_read_typed_stream_signature (TypedStream* stream)
-{
- char buffer[80];
- int pos = 0;
- do
- (*stream->read)(stream->physical, buffer+pos, 1);
- while (buffer[pos++] != '\0')
- ;
- sscanf (buffer, "GNU TypedStream %d", &stream->version);
- if (stream->version != OBJC_TYPED_STREAM_VERSION)
- objc_error (nil, OBJC_ERR_STREAM_VERSION,
- "cannot handle TypedStream version %d", stream->version);
- return 1;
-}
-
-static int
-__objc_write_typed_stream_signature (TypedStream* stream)
-{
- char buffer[80];
- sprintf(buffer, "GNU TypedStream %d", OBJC_TYPED_STREAM_VERSION);
- stream->version = OBJC_TYPED_STREAM_VERSION;
- (*stream->write)(stream->physical, buffer, strlen(buffer)+1);
- return 1;
-}
-
-static void __objc_finish_write_root_object(struct objc_typed_stream* stream)
-{
- hash_delete (stream->object_table);
- stream->object_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
-}
-
-static void __objc_finish_read_root_object(struct objc_typed_stream* stream)
-{
- node_ptr node;
- SEL awake_sel = sel_get_any_uid ("awake");
- cache_ptr free_list = hash_new (64,
- (hash_func_type) hash_ptr,
- (compare_func_type) compare_ptrs);
-
- /* resolve object forward references */
- for (node = hash_next (stream->object_refs, NULL); node;
- node = hash_next (stream->object_refs, node))
- {
- struct objc_list* reflist = node->value;
- const void* key = node->key;
- id object = hash_value_for_key (stream->object_table, key);
- while(reflist)
- {
- *((id*)reflist->head) = object;
- if (hash_value_for_key (free_list,reflist) == NULL)
- hash_add (&free_list,reflist,reflist);
-
- reflist = reflist->tail;
- }
- }
-
- /* apply __objc_free to all objects stored in free_list */
- for (node = hash_next (free_list, NULL); node;
- node = hash_next (free_list, node))
- objc_free ((void *) node->key);
-
- hash_delete (free_list);
-
- /* empty object reference table */
- hash_delete (stream->object_refs);
- stream->object_refs = hash_new(8, (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
-
- /* call -awake for all objects read */
- if (awake_sel)
- {
- for (node = hash_next (stream->object_table, NULL); node;
- node = hash_next (stream->object_table, node))
- {
- id object = node->value;
- if (__objc_responds_to (object, awake_sel))
- (*objc_msg_lookup(object, awake_sel))(object, awake_sel);
- }
- }
-
- /* empty object table */
- hash_delete (stream->object_table);
- stream->object_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
-}
-
-/*
-** Open the stream PHYSICAL in MODE
-*/
-
-TypedStream*
-objc_open_typed_stream (FILE* physical, int mode)
-{
- TypedStream* s = (TypedStream*)objc_malloc(sizeof(TypedStream));
-
- s->mode = mode;
- s->physical = physical;
- s->stream_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
- s->object_table = hash_new(64,
- (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
- s->eof = (objc_typed_eof_func)__objc_feof;
- s->flush = (objc_typed_flush_func)fflush;
- s->writing_root_p = 0;
- if (mode == OBJC_READONLY)
- {
- s->class_table = hash_new(8, (hash_func_type)hash_string,
- (compare_func_type)compare_strings);
- s->object_refs = hash_new(8, (hash_func_type)hash_ptr,
- (compare_func_type)compare_ptrs);
- s->read = (objc_typed_read_func)__objc_fread;
- s->write = (objc_typed_write_func)__objc_no_write;
- __objc_read_typed_stream_signature (s);
- }
- else if (mode == OBJC_WRITEONLY)
- {
- s->class_table = 0;
- s->object_refs = 0;
- s->read = (objc_typed_read_func)__objc_no_read;
- s->write = (objc_typed_write_func)__objc_fwrite;
- __objc_write_typed_stream_signature (s);
- }
- else
- {
- objc_close_typed_stream (s);
- return NULL;
- }
- s->type = OBJC_FILE_STREAM;
- return s;
-}
-
-/*
-** Open the file named by FILE_NAME in MODE
-*/
-
-TypedStream*
-objc_open_typed_stream_for_file (const char* file_name, int mode)
-{
- FILE* file = NULL;
- TypedStream* s;
-
- if (mode == OBJC_READONLY)
- file = fopen (file_name, "r");
- else
- file = fopen (file_name, "w");
-
- if (file)
- {
- s = objc_open_typed_stream (file, mode);
- if (s)
- s->type |= OBJC_MANAGED_STREAM;
- return s;
- }
- else
- return NULL;
-}
-
-/*
-** Close STREAM freeing the structure it self. If it was opened with
-** objc_open_typed_stream_for_file, the file will also be closed.
-*/
-
-void
-objc_close_typed_stream (TypedStream* stream)
-{
- if (stream->mode == OBJC_READONLY)
- {
- __objc_finish_read_root_object (stream); /* Just in case... */
- hash_delete (stream->class_table);
- hash_delete (stream->object_refs);
- }
-
- hash_delete (stream->stream_table);
- hash_delete (stream->object_table);
-
- if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM))
- fclose ((FILE*)stream->physical);
-
- objc_free(stream);
-}
-
-BOOL
-objc_end_of_typed_stream (TypedStream* stream)
-{
- return (*stream->eof)(stream->physical);
-}
-
-void
-objc_flush_typed_stream (TypedStream* stream)
-{
- (*stream->flush)(stream->physical);
-}
-
-long
-objc_get_stream_class_version (TypedStream* stream, Class class)
-{
- if (stream->class_table)
- return PTR2LONG(hash_value_for_key (stream->class_table, class->name));
- else
- return class_get_version (class);
-}
-
diff --git a/gcc/objc/class.c b/gcc/objc/class.c
deleted file mode 100644
index 44aa1b9f98e..00000000000
--- a/gcc/objc/class.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/* GNU Objective C Runtime class related functions
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup and Dennis Glatting.
-
-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 files compiled with
- GCC to produce an executable, this does not 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 "runtime.h" /* the kitchen sink */
-#include "sarray.h"
-
-/* The table of classname->class. Used for objc_lookup_class and friends */
-static cache_ptr __objc_class_hash = 0; /* !T:MUTEX */
-
-/* This is a hook which is called by objc_get_class and
- objc_lookup_class if the runtime is not able to find the class.
- This may e.g. try to load in the class using dynamic loading */
-Class (*_objc_lookup_class)(const char* name) = 0; /* !T:SAFE */
-
-
-/* True when class links has been resolved */
-BOOL __objc_class_links_resolved = NO; /* !T:UNUSED */
-
-
-/* Initial number of buckets size of class hash table. */
-#define CLASS_HASH_SIZE 32
-
-void __objc_init_class_tables()
-{
- /* Allocate the class hash table */
-
- if(__objc_class_hash)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- __objc_class_hash
- = hash_new (CLASS_HASH_SIZE,
- (hash_func_type) hash_string,
- (compare_func_type) compare_strings);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* This function adds a class to the class hash table, and assigns the
- class a number, unless it's already known */
-void
-__objc_add_class_to_hash(Class class)
-{
- Class h_class;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* make sure the table is there */
- assert(__objc_class_hash);
-
- /* make sure it's not a meta class */
- assert(CLS_ISCLASS(class));
-
- /* Check to see if the class is already in the hash table. */
- h_class = hash_value_for_key (__objc_class_hash, class->name);
- if (!h_class)
- {
- /* The class isn't in the hash table. Add the class and assign a class
- number. */
- static unsigned int class_number = 1;
-
- CLS_SETNUMBER(class, class_number);
- CLS_SETNUMBER(class->class_pointer, class_number);
-
- ++class_number;
- hash_add (&__objc_class_hash, class->name, class);
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Get the class object for the class named NAME. If NAME does not
- identify a known class, the hook _objc_lookup_class is called. If
- this fails, nil is returned */
-Class objc_lookup_class (const char* name)
-{
- Class class;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Make sure the class hash table exists. */
- assert (__objc_class_hash);
-
- class = hash_value_for_key (__objc_class_hash, name);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (class)
- return class;
-
- if (_objc_lookup_class)
- return (*_objc_lookup_class)(name);
- else
- return 0;
-}
-
-/* Get the class object for the class named NAME. If NAME does not
- identify a known class, the hook _objc_lookup_class is called. If
- this fails, an error message is issued and the system aborts */
-Class
-objc_get_class (const char *name)
-{
- Class class;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Make sure the class hash table exists. */
- assert (__objc_class_hash);
-
- class = hash_value_for_key (__objc_class_hash, name);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (class)
- return class;
-
- if (_objc_lookup_class)
- class = (*_objc_lookup_class)(name);
-
- if(class)
- return class;
-
- objc_error(nil, OBJC_ERR_BAD_CLASS,
- "objc runtime: cannot find class %s\n", name);
- return 0;
-}
-
-MetaClass
-objc_get_meta_class(const char *name)
-{
- return objc_get_class(name)->class_pointer;
-}
-
-/* This function provides a way to enumerate all the classes in the
- executable. Pass *ENUM_STATE == NULL to start the enumeration. The
- function will return 0 when there are no more classes.
- For example:
- id class;
- void *es = NULL;
- while ((class = objc_next_class(&es)))
- ... do something with class;
-*/
-Class
-objc_next_class(void **enum_state)
-{
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* make sure the table is there */
- assert(__objc_class_hash);
-
- *(node_ptr*)enum_state =
- hash_next(__objc_class_hash, *(node_ptr*)enum_state);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (*(node_ptr*)enum_state)
- return (*(node_ptr*)enum_state)->value;
- return (Class)0;
-}
-
-/* Resolve super/subclass links for all classes. The only thing we
- can be sure of is that the class_pointer for class objects point
- to the right meta class objects */
-void __objc_resolve_class_links()
-{
- node_ptr node;
- Class object_class = objc_get_class ("Object");
-
- assert(object_class);
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Assign subclass links */
- for (node = hash_next (__objc_class_hash, NULL); node;
- node = hash_next (__objc_class_hash, node))
- {
- Class class1 = node->value;
-
- /* Make sure we have what we think we have. */
- assert (CLS_ISCLASS(class1));
- assert (CLS_ISMETA(class1->class_pointer));
-
- /* The class_pointer of all meta classes point to Object's meta class. */
- class1->class_pointer->class_pointer = object_class->class_pointer;
-
- if (!(CLS_ISRESOLV(class1)))
- {
- CLS_SETRESOLV(class1);
- CLS_SETRESOLV(class1->class_pointer);
-
- if(class1->super_class)
- {
- Class a_super_class
- = objc_get_class ((char *) class1->super_class);
-
- assert (a_super_class);
-
- DEBUG_PRINTF ("making class connections for: %s\n",
- class1->name);
-
- /* assign subclass links for superclass */
- class1->sibling_class = a_super_class->subclass_list;
- a_super_class->subclass_list = class1;
-
- /* Assign subclass links for meta class of superclass */
- if (a_super_class->class_pointer)
- {
- class1->class_pointer->sibling_class
- = a_super_class->class_pointer->subclass_list;
- a_super_class->class_pointer->subclass_list
- = class1->class_pointer;
- }
- }
- else /* a root class, make its meta object */
- /* be a subclass of Object */
- {
- class1->class_pointer->sibling_class
- = object_class->subclass_list;
- object_class->subclass_list = class1->class_pointer;
- }
- }
- }
-
- /* Assign superclass links */
- for (node = hash_next (__objc_class_hash, NULL); node;
- node = hash_next (__objc_class_hash, node))
- {
- Class class1 = node->value;
- Class sub_class;
- for (sub_class = class1->subclass_list; sub_class;
- sub_class = sub_class->sibling_class)
- {
- sub_class->super_class = class1;
- if(CLS_ISCLASS(sub_class))
- sub_class->class_pointer->super_class = class1->class_pointer;
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-
-
-#define CLASSOF(c) ((c)->class_pointer)
-
-Class
-class_pose_as (Class impostor, Class super_class)
-{
- node_ptr node;
- Class class1;
-
- if (!CLS_ISRESOLV (impostor))
- __objc_resolve_class_links ();
-
- /* preconditions */
- assert (impostor);
- assert (super_class);
- assert (impostor->super_class == super_class);
- assert (CLS_ISCLASS (impostor));
- assert (CLS_ISCLASS (super_class));
- assert (impostor->instance_size == super_class->instance_size);
-
- {
- Class *subclass = &(super_class->subclass_list);
-
- /* move subclasses of super_class to impostor */
- while (*subclass)
- {
- Class nextSub = (*subclass)->sibling_class;
-
- if (*subclass != impostor)
- {
- Class sub = *subclass;
-
- /* classes */
- sub->sibling_class = impostor->subclass_list;
- sub->super_class = impostor;
- impostor->subclass_list = sub;
-
- /* It will happen that SUB is not a class object if it is
- the top of the meta class hierarchy chain. (root
- meta-class objects inherit their class object) If that is
- the case... don't mess with the meta-meta class. */
- if (CLS_ISCLASS (sub))
- {
- /* meta classes */
- CLASSOF (sub)->sibling_class =
- CLASSOF (impostor)->subclass_list;
- CLASSOF (sub)->super_class = CLASSOF (impostor);
- CLASSOF (impostor)->subclass_list = CLASSOF (sub);
- }
- }
-
- *subclass = nextSub;
- }
-
- /* set subclasses of superclass to be impostor only */
- super_class->subclass_list = impostor;
- CLASSOF (super_class)->subclass_list = CLASSOF (impostor);
-
- /* set impostor to have no sibling classes */
- impostor->sibling_class = 0;
- CLASSOF (impostor)->sibling_class = 0;
- }
-
- /* check relationship of impostor and super_class is kept. */
- assert (impostor->super_class == super_class);
- assert (CLASSOF (impostor)->super_class == CLASSOF (super_class));
-
- /* This is how to update the lookup table. Regardless of
- what the keys of the hashtable is, change all values that are
- superclass into impostor. */
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- for (node = hash_next (__objc_class_hash, NULL); node;
- node = hash_next (__objc_class_hash, node))
- {
- class1 = (Class)node->value;
- if (class1 == super_class)
- {
- node->value = impostor; /* change hash table value */
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-
- /* next, we update the dispatch tables... */
- __objc_update_dispatch_table_for_class (CLASSOF (impostor));
- __objc_update_dispatch_table_for_class (impostor);
-
- return impostor;
-}
-
-
diff --git a/gcc/objc/config-lang.in b/gcc/objc/config-lang.in
index 6c9b2032083..5287c8d4d6c 100644
--- a/gcc/objc/config-lang.in
+++ b/gcc/objc/config-lang.in
@@ -33,5 +33,3 @@ compilers="cc1obj\$(exeext)"
stagestuff=""
diff_excludes="-x objc-parse.c -x objc-parse.y "
-
-echo "Using \`$srcdir/objc/thr-${thread_file}.c' as Objective-C Runtime thread file."
diff --git a/gcc/objc/encoding.c b/gcc/objc/encoding.c
deleted file mode 100644
index e6f84aa04a4..00000000000
--- a/gcc/objc/encoding.c
+++ /dev/null
@@ -1,554 +0,0 @@
-/* Encoding of types for Objective C.
- Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files
- compiled with GCC to produce an executable, this does not 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 "encoding.h"
-
-#define MAX(X, Y) \
- ({ typeof(X) __x = (X), __y = (Y); \
- (__x > __y ? __x : __y); })
-
-#define MIN(X, Y) \
- ({ typeof(X) __x = (X), __y = (Y); \
- (__x < __y ? __x : __y); })
-
-#define ROUND(V, A) \
- ({ typeof(V) __v=(V); typeof(A) __a=(A); \
- __a*((__v+__a-1)/__a); })
-
-
-static inline int
-atoi (const char* str)
-{
- int res = 0;
-
- while (isdigit (*str))
- res *= 10, res += (*str++ - '0');
-
- return res;
-}
-
-/*
- return the size of an object specified by type
-*/
-
-int
-objc_sizeof_type(const char* type)
-{
- switch(*type) {
- case _C_ID:
- return sizeof(id);
- break;
-
- case _C_CLASS:
- return sizeof(Class);
- break;
-
- case _C_SEL:
- return sizeof(SEL);
- break;
-
- case _C_CHR:
- return sizeof(char);
- break;
-
- case _C_UCHR:
- return sizeof(unsigned char);
- break;
-
- case _C_SHT:
- return sizeof(short);
- break;
-
- case _C_USHT:
- return sizeof(unsigned short);
- break;
-
- case _C_INT:
- return sizeof(int);
- break;
-
- case _C_UINT:
- return sizeof(unsigned int);
- break;
-
- case _C_LNG:
- return sizeof(long);
- break;
-
- case _C_ULNG:
- return sizeof(unsigned long);
- break;
-
- case _C_FLT:
- return sizeof(float);
- break;
-
- case _C_DBL:
- return sizeof(double);
- break;
-
- case _C_VOID:
- return sizeof(void);
- break;
- case _C_PTR:
- case _C_ATOM:
- case _C_CHARPTR:
- return sizeof(char*);
- break;
-
- case _C_ARY_B:
- {
- int len = atoi(type+1);
- while (isdigit(*++type));
- return len*objc_aligned_size (type);
- }
- break;
-
- case _C_STRUCT_B:
- {
- int acc_size = 0;
- int align;
- while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
- while (*type != _C_STRUCT_E)
- {
- align = objc_alignof_type (type); /* padd to alignment */
- acc_size = ROUND (acc_size, align);
- acc_size += objc_sizeof_type (type); /* add component size */
- type = objc_skip_typespec (type); /* skip component */
- }
- return acc_size;
- }
-
- case _C_UNION_B:
- {
- int max_size = 0;
- while (*type != _C_UNION_E && *type++ != '=') /* do nothing */;
- while (*type != _C_UNION_E)
- {
- max_size = MAX (max_size, objc_sizeof_type (type));
- type = objc_skip_typespec (type);
- }
- return max_size;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
- return 0;
- }
- }
-}
-
-
-/*
- Return the alignment of an object specified by type
-*/
-
-int
-objc_alignof_type(const char* type)
-{
- switch(*type) {
- case _C_ID:
- return __alignof__(id);
- break;
-
- case _C_CLASS:
- return __alignof__(Class);
- break;
-
- case _C_SEL:
- return __alignof__(SEL);
- break;
-
- case _C_CHR:
- return __alignof__(char);
- break;
-
- case _C_UCHR:
- return __alignof__(unsigned char);
- break;
-
- case _C_SHT:
- return __alignof__(short);
- break;
-
- case _C_USHT:
- return __alignof__(unsigned short);
- break;
-
- case _C_INT:
- return __alignof__(int);
- break;
-
- case _C_UINT:
- return __alignof__(unsigned int);
- break;
-
- case _C_LNG:
- return __alignof__(long);
- break;
-
- case _C_ULNG:
- return __alignof__(unsigned long);
- break;
-
- case _C_FLT:
- return __alignof__(float);
- break;
-
- case _C_DBL:
- return __alignof__(double);
- break;
-
- case _C_PTR:
- case _C_ATOM:
- case _C_CHARPTR:
- return __alignof__(char*);
- break;
-
- case _C_ARY_B:
- while (isdigit(*++type)) /* do nothing */;
- return objc_alignof_type (type);
-
- case _C_STRUCT_B:
- {
- struct { int x; double y; } fooalign;
- while(*type != _C_STRUCT_E && *type++ != '=') /* do nothing */;
- if (*type != _C_STRUCT_E)
- return MAX (objc_alignof_type (type), __alignof__ (fooalign));
- else
- return __alignof__ (fooalign);
- }
-
- case _C_UNION_B:
- {
- int maxalign = 0;
- while (*type != _C_UNION_E && *type++ != '=') /* do nothing */;
- while (*type != _C_UNION_E)
- {
- maxalign = MAX (maxalign, objc_alignof_type (type));
- type = objc_skip_typespec (type);
- }
- return maxalign;
- }
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
- return 0;
- }
- }
-}
-
-/*
- The aligned size if the size rounded up to the nearest alignment.
-*/
-
-int
-objc_aligned_size (const char* type)
-{
- int size = objc_sizeof_type (type);
- int align = objc_alignof_type (type);
- return ROUND (size, align);
-}
-
-/*
- The size rounded up to the nearest integral of the wordsize, taken
- to be the size of a void*.
-*/
-
-int
-objc_promoted_size (const char* type)
-{
- int size = objc_sizeof_type (type);
- int wordsize = sizeof (void*);
-
- return ROUND (size, wordsize);
-}
-
-/*
- Skip type qualifiers. These may eventually precede typespecs
- occurring in method prototype encodings.
-*/
-
-inline const char*
-objc_skip_type_qualifiers (const char* type)
-{
- while (*type == _C_CONST
- || *type == _C_IN
- || *type == _C_INOUT
- || *type == _C_OUT
- || *type == _C_BYCOPY
- || *type == _C_ONEWAY)
- {
- type += 1;
- }
- return type;
-}
-
-
-/*
- Skip one typespec element. If the typespec is prepended by type
- qualifiers, these are skipped as well.
-*/
-
-const char*
-objc_skip_typespec (const char* type)
-{
- type = objc_skip_type_qualifiers (type);
-
- switch (*type) {
-
- case _C_ID:
- /* An id may be annotated by the actual type if it is known
- with the @"ClassName" syntax */
-
- if (*++type != '"')
- return type;
- else
- {
- while (*++type != '"') /* do nothing */;
- return type + 1;
- }
-
- /* The following are one character type codes */
- case _C_CLASS:
- case _C_SEL:
- case _C_CHR:
- case _C_UCHR:
- case _C_CHARPTR:
- case _C_ATOM:
- case _C_SHT:
- case _C_USHT:
- case _C_INT:
- case _C_UINT:
- case _C_LNG:
- case _C_ULNG:
- case _C_FLT:
- case _C_DBL:
- case _C_VOID:
- case _C_UNDEF:
- return ++type;
- break;
-
- case _C_ARY_B:
- /* skip digits, typespec and closing ']' */
-
- while(isdigit(*++type));
- type = objc_skip_typespec(type);
- if (*type == _C_ARY_E)
- return ++type;
- else
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "bad array type %s\n", type);
- return 0;
- }
-
- case _C_STRUCT_B:
- /* skip name, and elements until closing '}' */
-
- while (*type != _C_STRUCT_E && *type++ != '=');
- while (*type != _C_STRUCT_E) { type = objc_skip_typespec (type); }
- return ++type;
-
- case _C_UNION_B:
- /* skip name, and elements until closing ')' */
-
- while (*type != _C_UNION_E && *type++ != '=');
- while (*type != _C_UNION_E) { type = objc_skip_typespec (type); }
- return ++type;
-
- case _C_PTR:
- /* Just skip the following typespec */
-
- return objc_skip_typespec (++type);
-
- default:
- {
- objc_error(nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
- return 0;
- }
- }
-}
-
-/*
- Skip an offset as part of a method encoding. This is prepended by a
- '+' if the argument is passed in registers.
-*/
-inline const char*
-objc_skip_offset (const char* type)
-{
- if (*type == '+') type++;
- while(isdigit(*++type));
- return type;
-}
-
-/*
- Skip an argument specification of a method encoding.
-*/
-const char*
-objc_skip_argspec (const char* type)
-{
- type = objc_skip_typespec (type);
- type = objc_skip_offset (type);
- return type;
-}
-
-/*
- Return the number of arguments that the method MTH expects.
- Note that all methods need two implicit arguments `self' and
- `_cmd'.
-*/
-int
-method_get_number_of_arguments (struct objc_method* mth)
-{
- int i = 0;
- const char* type = mth->method_types;
- while (*type)
- {
- type = objc_skip_argspec (type);
- i += 1;
- }
- return i - 1;
-}
-
-/*
- Return the size of the argument block needed on the stack to invoke
- the method MTH. This may be zero, if all arguments are passed in
- registers.
-*/
-
-int
-method_get_sizeof_arguments (struct objc_method* mth)
-{
- const char* type = objc_skip_typespec (mth->method_types);
- return atoi (type);
-}
-
-/*
- Return a pointer to the next argument of ARGFRAME. type points to
- the last argument. Typical use of this look like:
-
- {
- char *datum, *type;
- for (datum = method_get_first_argument (method, argframe, &type);
- datum; datum = method_get_next_argument (argframe, &type))
- {
- unsigned flags = objc_get_type_qualifiers (type);
- type = objc_skip_type_qualifiers (type);
- if (*type != _C_PTR)
- [portal encodeData: datum ofType: type];
- else
- {
- if ((flags & _F_IN) == _F_IN)
- [portal encodeData: *(char**)datum ofType: ++type];
- }
- }
- }
-*/
-
-char*
-method_get_next_argument (arglist_t argframe,
- const char **type)
-{
- const char *t = objc_skip_argspec (*type);
-
- if (*t == '\0')
- return 0;
-
- *type = t;
- t = objc_skip_typespec (t);
-
- if (*t == '+')
- return argframe->arg_regs + atoi (++t);
- else
- return argframe->arg_ptr + atoi (t);
-}
-
-/*
- Return a pointer to the value of the first argument of the method
- described in M with the given argumentframe ARGFRAME. The type
- is returned in TYPE. type must be passed to successive calls of
- method_get_next_argument.
-*/
-char*
-method_get_first_argument (struct objc_method* m,
- arglist_t argframe,
- const char** type)
-{
- *type = m->method_types;
- return method_get_next_argument (argframe, type);
-}
-
-/*
- Return a pointer to the ARGth argument of the method
- M from the frame ARGFRAME. The type of the argument
- is returned in the value-result argument TYPE
-*/
-
-char*
-method_get_nth_argument (struct objc_method* m,
- arglist_t argframe, int arg,
- const char **type)
-{
- const char* t = objc_skip_argspec (m->method_types);
-
- if (arg > method_get_number_of_arguments (m))
- return 0;
-
- while (arg--)
- t = objc_skip_argspec (t);
-
- *type = t;
- t = objc_skip_typespec (t);
-
- if (*t == '+')
- return argframe->arg_regs + atoi (++t);
- else
- return argframe->arg_ptr + atoi (t);
-}
-
-unsigned
-objc_get_type_qualifiers (const char* type)
-{
- unsigned res = 0;
- BOOL flag = YES;
-
- while (flag)
- switch (*type++)
- {
- case _C_CONST: res |= _F_CONST; break;
- case _C_IN: res |= _F_IN; break;
- case _C_INOUT: res |= _F_INOUT; break;
- case _C_OUT: res |= _F_OUT; break;
- case _C_BYCOPY: res |= _F_BYCOPY; break;
- case _C_ONEWAY: res |= _F_ONEWAY; break;
- default: flag = NO;
- }
-
- return res;
-}
diff --git a/gcc/objc/encoding.h b/gcc/objc/encoding.h
deleted file mode 100644
index 141e9fe9e97..00000000000
--- a/gcc/objc/encoding.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Encoding of types for Objective C.
- Copyright (C) 1993, 1997 Free Software Foundation, Inc.
-
-Author: Kresten Krab Thorup
-
-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 files
- compiled with GCC to produce an executable, this does not 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. */
-
-#ifndef __encoding_INCLUDE_GNU
-#define __encoding_INCLUDE_GNU
-
-#include <ctype.h>
-#include "objc/objc-api.h"
-
-#define _C_CONST 'r'
-#define _C_IN 'n'
-#define _C_INOUT 'N'
-#define _C_OUT 'o'
-#define _C_BYCOPY 'O'
-#define _C_ONEWAY 'V'
-
-#define _F_CONST 0x01
-#define _F_IN 0x01
-#define _F_OUT 0x02
-#define _F_INOUT 0x03
-#define _F_BYCOPY 0x04
-#define _F_ONEWAY 0x08
-
-
-int objc_aligned_size (const char* type);
-int objc_sizeof_type (const char* type);
-int objc_alignof_type (const char* type);
-int objc_aligned_size (const char* type);
-int objc_promoted_size (const char* type);
-const char* objc_skip_type_qualifiers (const char* type);
-const char* objc_skip_typespec (const char* type);
-const char* objc_skip_offset (const char* type);
-const char* objc_skip_argspec (const char* type);
-int method_get_number_of_arguments (struct objc_method*);
-int method_get_sizeof_arguments (struct objc_method*);
-
-char* method_get_first_argument (struct objc_method*,
- arglist_t argframe,
- const char** type);
-char* method_get_next_argument (arglist_t argframe,
- const char **type);
-char* method_get_nth_argument (struct objc_method* m,
- arglist_t argframe,
- int arg,
- const char **type);
-
-unsigned objc_get_type_qualifiers (const char* type);
-
-
-#endif /* __encoding_INCLUDE_GNU */
diff --git a/gcc/objc/hash.c b/gcc/objc/hash.c
deleted file mode 100644
index 7534330fa1c..00000000000
--- a/gcc/objc/hash.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Hash tables for Objective C internal structures
- Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not 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 "assert.h"
-
-#include "objc/hash.h"
-
-#include "runtime.h" /* for DEBUG_PRINTF */
-
-/* These two macros determine when a hash table is full and
- by how much it should be expanded respectively.
-
- These equations are percentages. */
-#define FULLNESS(cache) \
- ((((cache)->size * 75) / 100) <= (cache)->used)
-#define EXPANSION(cache) \
- ((cache)->size * 2)
-
-cache_ptr
-hash_new (unsigned int size, hash_func_type hash_func,
- compare_func_type compare_func)
-{
- cache_ptr cache;
-
- /* Pass me a value greater than 0 and a power of 2. */
- assert (size);
- assert (!(size & (size - 1)));
-
- /* Allocate the cache structure. calloc insures
- its initialization for default values. */
- cache = (cache_ptr) objc_calloc (1, sizeof (struct cache));
- assert (cache);
-
- /* Allocate the array of buckets for the cache.
- calloc initializes all of the pointers to NULL. */
- cache->node_table
- = (node_ptr *) objc_calloc (size, sizeof (node_ptr));
- assert (cache->node_table);
-
- cache->size = size;
-
- /* This should work for all processor architectures? */
- cache->mask = (size - 1);
-
- /* Store the hashing function so that codes can be computed. */
- cache->hash_func = hash_func;
-
- /* Store the function that compares hash keys to
- determine if they are equal. */
- cache->compare_func = compare_func;
-
- return cache;
-}
-
-
-void
-hash_delete (cache_ptr cache)
-{
- node_ptr node;
- node_ptr next_node;
- unsigned int i;
-
- /* Purge all key/value pairs from the table. */
- /* Step through the nodes one by one and remove every node WITHOUT
- using hash_next. this makes hash_delete much more efficient. */
- for (i = 0;i < cache->size;i++) {
- if ((node = cache->node_table[i])) {
- /* an entry in the hash table has been found, now step through the
- nodes next in the list and free them. */
- while ((next_node = node->next)) {
- hash_remove (cache,node->key);
- node = next_node;
- }
-
- hash_remove (cache,node->key);
- }
- }
-
- /* Release the array of nodes and the cache itself. */
- objc_free(cache->node_table);
- objc_free(cache);
-}
-
-
-void
-hash_add (cache_ptr *cachep, const void *key, void *value)
-{
- size_t indx = (*(*cachep)->hash_func)(*cachep, key);
- node_ptr node = (node_ptr) objc_calloc (1, sizeof (struct cache_node));
-
-
- assert (node);
-
- /* Initialize the new node. */
- node->key = key;
- node->value = value;
- node->next = (*cachep)->node_table[indx];
-
- /* Debugging.
- Check the list for another key. */
-#ifdef DEBUG
- { node_ptr node1 = (*cachep)->node_table[indx];
-
- while (node1) {
-
- assert (node1->key != key);
- node1 = node1->next;
- }
- }
-#endif
-
- /* Install the node as the first element on the list. */
- (*cachep)->node_table[indx] = node;
-
- /* Bump the number of entries in the cache. */
- ++(*cachep)->used;
-
- /* Check the hash table's fullness. We're going
- to expand if it is above the fullness level. */
- if (FULLNESS (*cachep)) {
-
- /* The hash table has reached its fullness level. Time to
- expand it.
-
- I'm using a slow method here but is built on other
- primitive functions thereby increasing its
- correctness. */
- node_ptr node1 = NULL;
- cache_ptr new = hash_new (EXPANSION (*cachep),
- (*cachep)->hash_func,
- (*cachep)->compare_func);
-
- DEBUG_PRINTF ("Expanding cache %#x from %d to %d\n",
- *cachep, (*cachep)->size, new->size);
-
- /* Copy the nodes from the first hash table to the new one. */
- while ((node1 = hash_next (*cachep, node1)))
- hash_add (&new, node1->key, node1->value);
-
- /* Trash the old cache. */
- hash_delete (*cachep);
-
- /* Return a pointer to the new hash table. */
- *cachep = new;
- }
-}
-
-
-void
-hash_remove (cache_ptr cache, const void *key)
-{
- size_t indx = (*cache->hash_func)(cache, key);
- node_ptr node = cache->node_table[indx];
-
-
- /* We assume there is an entry in the table. Error if it is not. */
- assert (node);
-
- /* Special case. First element is the key/value pair to be removed. */
- if ((*cache->compare_func)(node->key, key)) {
- cache->node_table[indx] = node->next;
- objc_free(node);
- } else {
-
- /* Otherwise, find the hash entry. */
- node_ptr prev = node;
- BOOL removed = NO;
-
- do {
-
- if ((*cache->compare_func)(node->key, key)) {
- prev->next = node->next, removed = YES;
- objc_free(node);
- } else
- prev = node, node = node->next;
- } while (!removed && node);
- assert (removed);
- }
-
- /* Decrement the number of entries in the hash table. */
- --cache->used;
-}
-
-
-node_ptr
-hash_next (cache_ptr cache, node_ptr node)
-{
- /* If the scan is being started then reset the last node
- visitied pointer and bucket index. */
- if (!node)
- cache->last_bucket = 0;
-
- /* If there is a node visited last then check for another
- entry in the same bucket; Otherwise step to the next bucket. */
- if (node) {
- if (node->next)
- /* There is a node which follows the last node
- returned. Step to that node and retun it. */
- return node->next;
- else
- ++cache->last_bucket;
- }
-
- /* If the list isn't exhausted then search the buckets for
- other nodes. */
- if (cache->last_bucket < cache->size) {
- /* Scan the remainder of the buckets looking for an entry
- at the head of the list. Return the first item found. */
- while (cache->last_bucket < cache->size)
- if (cache->node_table[cache->last_bucket])
- return cache->node_table[cache->last_bucket];
- else
- ++cache->last_bucket;
-
- /* No further nodes were found in the hash table. */
- return NULL;
- } else
- return NULL;
-}
-
-
-/* Given KEY, return corresponding value for it in CACHE.
- Return NULL if the KEY is not recorded. */
-
-void *
-hash_value_for_key (cache_ptr cache, const void *key)
-{
- node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];
- void *retval = NULL;
-
- if (node)
- do {
- if ((*cache->compare_func)(node->key, key)) {
- retval = node->value;
- break;
- } else
- node = node->next;
- } while (!retval && node);
-
- return retval;
-}
-
-/* Given KEY, return YES if it exists in the CACHE.
- Return NO if it does not */
-
-BOOL
-hash_is_key_in_hash (cache_ptr cache, const void *key)
-{
- node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];
-
- if (node)
- do {
- if ((*cache->compare_func)(node->key, key))
- return YES;
- else
- node = node->next;
- } while (node);
-
- return NO;
-}
diff --git a/gcc/objc/hash.h b/gcc/objc/hash.h
deleted file mode 100644
index bddb791c820..00000000000
--- a/gcc/objc/hash.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Hash tables for Objective C method dispatch.
- Copyright (C) 1993, 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. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not 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. */
-
-
-#ifndef __hash_INCLUDE_GNU
-#define __hash_INCLUDE_GNU
-
-#include <stddef.h>
-#include <objc/objc.h>
-
-/*
- * This data structure is used to hold items
- * stored in a hash table. Each node holds
- * a key/value pair.
- *
- * Items in the cache are really of type void *.
- */
-typedef struct cache_node
-{
- struct cache_node *next; /* Pointer to next entry on the list.
- NULL indicates end of list. */
- const void *key; /* Key used to locate the value. Used
- to locate value when more than one
- key computes the same hash
- value. */
- void *value; /* Value stored for the key. */
-} *node_ptr;
-
-
-/*
- * This data type is the function that computes a hash code given a key.
- * Therefore, the key can be a pointer to anything and the function specific
- * to the key type.
- *
- * Unfortunately there is a mutual data structure reference problem with this
- * typedef. Therefore, to remove compiler warnings the functions passed to
- * hash_new will have to be casted to this type.
- */
-typedef unsigned int (*hash_func_type)(void *, const void *);
-
-/*
- * This data type is the function that compares two hash keys and returns an
- * integer greater than, equal to, or less than 0, according as the first
- * parameter is lexicographically greater than, equal to, or less than the
- * second.
- */
-
-typedef int (*compare_func_type)(const void *, const void *);
-
-
-/*
- * This data structure is the cache.
- *
- * It must be passed to all of the hashing routines
- * (except for new).
- */
-typedef struct cache
-{
- /* Variables used to implement the hash itself. */
- node_ptr *node_table; /* Pointer to an array of hash nodes. */
- /* Variables used to track the size of the hash table so to determine
- when to resize it. */
- unsigned int size; /* Number of buckets allocated for the hash table
- (number of array entries allocated for
- "node_table"). Must be a power of two. */
- unsigned int used; /* Current number of entries in the hash table. */
- unsigned int mask; /* Precomputed mask. */
-
- /* Variables used to implement indexing through the hash table. */
-
- unsigned int last_bucket; /* Tracks which entry in the array where
- the last value was returned. */
- /* Function used to compute a hash code given a key.
- This function is specified when the hash table is created. */
- hash_func_type hash_func;
- /* Function used to compare two hash keys to see if they are equal. */
- compare_func_type compare_func;
-} *cache_ptr;
-
-
-/* Two important hash tables. */
-extern cache_ptr module_hash_table, class_hash_table;
-
-/* Allocate and initialize a hash table. */
-
-cache_ptr hash_new (unsigned int size,
- hash_func_type hash_func,
- compare_func_type compare_func);
-
-/* Deallocate all of the hash nodes and the cache itself. */
-
-void hash_delete (cache_ptr cache);
-
-/* Add the key/value pair to the hash table. If the
- hash table reaches a level of fullness then it will be resized.
-
- assert if the key is already in the hash. */
-
-void hash_add (cache_ptr *cachep, const void *key, void *value);
-
-/* Remove the key/value pair from the hash table.
- assert if the key isn't in the table. */
-
-void hash_remove (cache_ptr cache, const void *key);
-
-/* Used to index through the hash table. Start with NULL
- to get the first entry.
-
- Successive calls pass the value returned previously.
- ** Don't modify the hash during this operation ***
-
- Cache nodes are returned such that key or value can
- be extracted. */
-
-node_ptr hash_next (cache_ptr cache, node_ptr node);
-
-/* Used to return a value from a hash table using a given key. */
-
-void *hash_value_for_key (cache_ptr cache, const void *key);
-
-/* Used to determine if the given key exists in the hash table */
-
-BOOL hash_is_key_in_hash (cache_ptr cache, const void *key);
-
-/************************************************
-
- Useful hashing functions.
-
- Declared inline for your pleasure.
-
-************************************************/
-
-/* Calculate a hash code by performing some
- manipulation of the key pointer. (Use the lowest bits
- except for those likely to be 0 due to alignment.) */
-
-static inline unsigned int
-hash_ptr (cache_ptr cache, const void *key)
-{
- return ((size_t)key / sizeof (void *)) & cache->mask;
-}
-
-
-/* Calculate a hash code by iterating over a NULL
- terminate string. */
-static inline unsigned int
-hash_string (cache_ptr cache, const void *key)
-{
- unsigned int ret = 0;
- unsigned int ctr = 0;
-
-
- while (*(char*)key) {
- ret ^= *(char*)key++ << ctr;
- ctr = (ctr + 1) % sizeof (void *);
- }
-
- return ret & cache->mask;
-}
-
-
-/* Compare two pointers for equality. */
-static inline int
-compare_ptrs (const void *k1, const void *k2)
-{
- return !(k1 - k2);
-}
-
-
-/* Compare two strings. */
-static inline int
-compare_strings (const void *k1, const void *k2)
-{
- if (k1 == k2)
- return 1;
- else if (k1 == 0 || k2 == 0)
- return 0;
- else
- return !strcmp (k1, k2);
-}
-
-
-#endif /* not __hash_INCLUDE_GNU */
diff --git a/gcc/objc/init.c b/gcc/objc/init.c
deleted file mode 100644
index c900cac65e8..00000000000
--- a/gcc/objc/init.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/* GNU Objective C Runtime initialization
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
- +load support contributed by Ovidiu Predescu <ovidiu@net-community.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 files compiled with
- GCC to produce an executable, this does not 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 "runtime.h"
-
-/* The version number of this runtime. This must match the number
- defined in gcc (objc-act.c) */
-#define OBJC_VERSION 8
-#define PROTOCOL_VERSION 2
-
-/* This list contains all modules currently loaded into the runtime */
-static struct objc_list* __objc_module_list = 0; /* !T:MUTEX */
-
-/* This list contains all proto_list's not yet assigned class links */
-static struct objc_list* unclaimed_proto_list = 0; /* !T:MUTEX */
-
-/* List of unresolved static instances. */
-static struct objc_list *uninitialized_statics = 0; /* !T:MUTEX */
-
-/* Global runtime "write" mutex. */
-objc_mutex_t __objc_runtime_mutex = 0;
-
-/* Number of threads that are alive. */
-int __objc_runtime_threads_alive = 1; /* !T:MUTEX */
-
-/* Check compiler vs runtime version */
-static void init_check_module_version (Module_t);
-
-/* Assign isa links to protos */
-static void __objc_init_protocols (struct objc_protocol_list* protos);
-
-/* Add protocol to class */
-static void __objc_class_add_protocols (Class, struct objc_protocol_list*);
-
-/* This is a hook which is called by __objc_exec_class every time a class
- or a category is loaded into the runtime. This may e.g. help a
- dynamic loader determine the classes that have been loaded when
- an object file is dynamically linked in */
-void (*_objc_load_callback)(Class class, Category* category); /* !T:SAFE */
-
-/* Is all categories/classes resolved? */
-BOOL __objc_dangling_categories = NO; /* !T:UNUSED */
-
-extern SEL
-__sel_register_typed_name (const char *name, const char *types,
- struct objc_selector *orig, BOOL is_const);
-
-/* Sends +load to all classes and categories in certain situations. */
-static void objc_send_load (void);
-
-/* Inserts all the classes defined in module in a tree of classes that
- resembles the class hierarchy. This tree is traversed in preorder and the
- classes in its nodes receive the +load message if these methods were not
- executed before. The algorithm ensures that when the +load method of a class
- is executed all the superclasses have been already received the +load
- message. */
-static void __objc_create_classes_tree (Module_t module);
-
-static void __objc_call_callback (Module_t module);
-
-/* A special version that works only before the classes are completely
- installed in the runtime. */
-static BOOL class_is_subclass_of_class (Class class, Class superclass);
-
-typedef struct objc_class_tree {
- Class class;
- struct objc_list *subclasses; /* `head' is pointer to an objc_class_tree */
-} objc_class_tree;
-
-/* This is a linked list of objc_class_tree trees. The head of these trees
- are root classes (their super class is Nil). These different trees
- represent different class hierarchies. */
-static struct objc_list *__objc_class_tree_list = NULL;
-
-/* Keeps the +load methods who have been already executed. This hash should
- not be destroyed during the execution of the program. */
-static cache_ptr __objc_load_methods = NULL;
-
-/* Creates a tree of classes whose topmost class is directly inherited from
- `upper' and the bottom class in this tree is `bottom_class'. The classes
- in this tree are super classes of `bottom_class'. `subclasses' member
- of each tree node point to the next subclass tree node. */
-static objc_class_tree *
-create_tree_of_subclasses_inherited_from (Class bottom_class, Class upper)
-{
- Class superclass = bottom_class->super_class ?
- objc_lookup_class ((char*)bottom_class->super_class)
- : Nil;
-
- objc_class_tree *tree, *prev;
-
- DEBUG_PRINTF ("create_tree_of_subclasses_inherited_from:");
- DEBUG_PRINTF ("bottom_class = %s, upper = %s\n",
- (bottom_class ? bottom_class->name : NULL),
- (upper ? upper->name : NULL));
-
- tree = prev = objc_calloc (1, sizeof (objc_class_tree));
- prev->class = bottom_class;
-
- while (superclass != upper)
- {
- tree = objc_calloc (1, sizeof (objc_class_tree));
- tree->class = superclass;
- tree->subclasses = list_cons (prev, tree->subclasses);
- superclass = (superclass->super_class ?
- objc_lookup_class ((char*)superclass->super_class)
- : Nil);
- prev = tree;
- }
-
- return tree;
-}
-
-/* Insert the `class' into the proper place in the `tree' class hierarchy. This
- function returns a new tree if the class has been successfully inserted into
- the tree or NULL if the class is not part of the classes hierarchy described
- by `tree'. This function is private to objc_tree_insert_class(), you should
- not call it directly. */
-static objc_class_tree *
-__objc_tree_insert_class (objc_class_tree *tree, Class class)
-{
- DEBUG_PRINTF ("__objc_tree_insert_class: tree = %x, class = %s\n",
- tree, class->name);
-
- if (tree == NULL)
- return create_tree_of_subclasses_inherited_from (class, NULL);
- else if (class == tree->class)
- {
- /* `class' has been already inserted */
- DEBUG_PRINTF ("1. class %s was previously inserted\n", class->name);
- return tree;
- }
- else if ((class->super_class ?
- objc_lookup_class ((char*)class->super_class)
- : Nil)
- == tree->class)
- {
- /* If class is a direct subclass of tree->class then add class to the
- list of subclasses. First check to see if it wasn't already
- inserted. */
- struct objc_list *list = tree->subclasses;
- objc_class_tree *node;
-
- while (list)
- {
- /* Class has been already inserted; do nothing just return
- the tree. */
- if (((objc_class_tree*)list->head)->class == class)
- {
- DEBUG_PRINTF ("2. class %s was previously inserted\n",
- class->name);
- return tree;
- }
- list = list->tail;
- }
-
- /* Create a new node class and insert it into the list of subclasses */
- node = objc_calloc (1, sizeof (objc_class_tree));
- node->class = class;
- tree->subclasses = list_cons (node, tree->subclasses);
- DEBUG_PRINTF ("3. class %s inserted\n", class->name);
- return tree;
- }
- else
- {
- /* The class is not a direct subclass of tree->class. Search for class's
- superclasses in the list of subclasses. */
- struct objc_list *subclasses = tree->subclasses;
-
- /* Precondition: the class must be a subclass of tree->class; otherwise
- return NULL to indicate our caller that it must take the next tree. */
- if (!class_is_subclass_of_class (class, tree->class))
- return NULL;
-
- for (; subclasses != NULL; subclasses = subclasses->tail)
- {
- Class aClass = ((objc_class_tree*)(subclasses->head))->class;
-
- if (class_is_subclass_of_class (class, aClass))
- {
- /* If we found one of class's superclasses we insert the class
- into its subtree and return the original tree since nothing
- has been changed. */
- subclasses->head
- = __objc_tree_insert_class (subclasses->head, class);
- DEBUG_PRINTF ("4. class %s inserted\n", class->name);
- return tree;
- }
- }
-
- /* We haven't found a subclass of `class' in the `subclasses' list.
- Create a new tree of classes whose topmost class is a direct subclass
- of tree->class. */
- {
- objc_class_tree *new_tree
- = create_tree_of_subclasses_inherited_from (class, tree->class);
- tree->subclasses = list_cons (new_tree, tree->subclasses);
- DEBUG_PRINTF ("5. class %s inserted\n", class->name);
- return tree;
- }
- }
-}
-
-/* This function inserts `class' in the right tree hierarchy classes. */
-static void
-objc_tree_insert_class (Class class)
-{
- struct objc_list *list_node;
- objc_class_tree *tree;
-
- list_node = __objc_class_tree_list;
- while (list_node)
- {
- tree = __objc_tree_insert_class (list_node->head, class);
- if (tree)
- {
- list_node->head = tree;
- break;
- }
- else
- list_node = list_node->tail;
- }
-
- /* If the list was finished but the class hasn't been inserted, insert it
- here. */
- if (!list_node)
- {
- __objc_class_tree_list = list_cons (NULL, __objc_class_tree_list);
- __objc_class_tree_list->head = __objc_tree_insert_class (NULL, class);
- }
-}
-
-/* Traverse tree in preorder. Used to send +load. */
-static void
-objc_preorder_traverse (objc_class_tree *tree,
- int level,
- void (*function)(objc_class_tree*, int))
-{
- struct objc_list *node;
-
- (*function) (tree, level);
- for (node = tree->subclasses; node; node = node->tail)
- objc_preorder_traverse (node->head, level + 1, function);
-}
-
-/* Traverse tree in postorder. Used to destroy a tree. */
-static void
-objc_postorder_traverse (objc_class_tree *tree,
- int level,
- void (*function)(objc_class_tree*, int))
-{
- struct objc_list *node;
-
- for (node = tree->subclasses; node; node = node->tail)
- objc_postorder_traverse (node->head, level + 1, function);
- (*function) (tree, level);
-}
-
-/* Used to print a tree class hierarchy. */
-static void
-__objc_tree_print (objc_class_tree *tree, int level)
-{
- int i;
-
- for (i = 0; i < level; i++)
- printf (" ");
- printf ("%s\n", tree->class->name);
-}
-
-/* Walks on a linked list of methods in the reverse order and executes all
- the methods corresponding to `op' selector. Walking in the reverse order
- assures the +load of class is executed first and then +load of categories
- because of the way in which categories are added to the class methods. */
-static void
-__objc_send_message_in_list (MethodList_t method_list, Class class, SEL op)
-{
- int i;
-
- if (!method_list)
- return;
-
- /* First execute the `op' message in the following method lists */
- __objc_send_message_in_list (method_list->method_next, class, op);
-
- /* Search the method list. */
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t mth = &method_list->method_list[i];
-
- if (mth->method_name && sel_eq (mth->method_name, op)
- && !hash_is_key_in_hash (__objc_load_methods, mth->method_name))
- {
- /* The method was found and wasn't previously executed. */
- (*mth->method_imp) ((id)class, mth->method_name);
-
- /* Add this method into the +load hash table */
- hash_add (&__objc_load_methods, mth->method_imp, mth->method_imp);
-
- DEBUG_PRINTF ("sending +load in class: %s\n", class->name);
-
- break;
- }
- }
-}
-
-static void
-__objc_send_load (objc_class_tree *tree, int level)
-{
- static SEL load_sel = 0;
- Class class = tree->class;
- MethodList_t method_list = class->class_pointer->methods;
-
- if (!load_sel)
- load_sel = sel_register_name ("load");
-
- __objc_send_message_in_list (method_list, class, load_sel);
-}
-
-static void
-__objc_destroy_class_tree_node (objc_class_tree *tree, int level)
-{
- objc_free (tree);
-}
-
-/* This is used to check if the relationship between two classes before the
- runtime completely installs the classes. */
-static BOOL
-class_is_subclass_of_class (Class class, Class superclass)
-{
- for (; class != Nil;)
- {
- if (class == superclass)
- return YES;
- class = (class->super_class ?
- objc_lookup_class ((char*)class->super_class)
- : Nil);
- }
-
- return NO;
-}
-
-/* This list contains all the classes in the runtime system for whom their
- superclasses are not yet know to the runtime. */
-static struct objc_list* unresolved_classes = 0;
-
-/* Static function used to reference the Object and NXConstantString classes.
- */
-static void
-__objc_force_linking (void)
-{
- extern void __objc_linking (void);
- __objc_linking ();
-
- /* Call the function to avoid compiler warning */
- __objc_force_linking ();
-}
-
-/* Run through the statics list, removing modules as soon as all its statics
- have been initialized. */
-static void
-objc_init_statics (void)
-{
- struct objc_list **cell = &uninitialized_statics;
- struct objc_static_instances **statics_in_module;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- while (*cell)
- {
- int module_initialized = 1;
-
- for (statics_in_module = (*cell)->head;
- *statics_in_module; statics_in_module++)
- {
- struct objc_static_instances *statics = *statics_in_module;
- Class class = objc_lookup_class (statics->class_name);
-
- if (!class)
- module_initialized = 0;
- /* Actually, the static's class_pointer will be NULL when we
- haven't been here before. However, the comparison is to be
- reminded of taking into account class posing and to think about
- possible semantics... */
- else if (class != statics->instances[0]->class_pointer)
- {
- id *inst;
-
- for (inst = &statics->instances[0]; *inst; inst++)
- {
- (*inst)->class_pointer = class;
-
- /* ??? Make sure the object will not be freed. With
- refcounting, invoke `-retain'. Without refcounting, do
- nothing and hope that `-free' will never be invoked. */
-
- /* ??? Send the object an `-initStatic' or something to
- that effect now or later on? What are the semantics of
- statically allocated instances, besides the trivial
- NXConstantString, anyway? */
- }
- }
- }
- if (module_initialized)
- {
- /* Remove this module from the uninitialized list. */
- struct objc_list *this = *cell;
- *cell = this->tail;
- objc_free(this);
- }
- else
- cell = &(*cell)->tail;
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-} /* objc_init_statics */
-
-/* This function is called by constructor functions generated for each
- module compiled. (_GLOBAL_$I$...) The purpose of this function is to
- gather the module pointers so that they may be processed by the
- initialization routines as soon as possible */
-
-void
-__objc_exec_class (Module_t module)
-{
- /* Have we processed any constructors previously? This flag is used to
- indicate that some global data structures need to be built. */
- static BOOL previous_constructors = 0;
-
- static struct objc_list* unclaimed_categories = 0;
-
- /* The symbol table (defined in objc-api.h) generated by gcc */
- Symtab_t symtab = module->symtab;
-
- /* The statics in this module */
- struct objc_static_instances **statics
- = symtab->defs[symtab->cls_def_cnt + symtab->cat_def_cnt];
-
- /* Entry used to traverse hash lists */
- struct objc_list** cell;
-
- /* The table of selector references for this module */
- SEL selectors = symtab->refs;
-
- /* dummy counter */
- int i;
-
- DEBUG_PRINTF ("received module: %s\n", module->name);
-
- /* check gcc version */
- init_check_module_version(module);
-
- /* On the first call of this routine, initialize some data structures. */
- if (!previous_constructors)
- {
- /* Initialize thread-safe system */
- __objc_init_thread_system();
- __objc_runtime_threads_alive = 1;
- __objc_runtime_mutex = objc_mutex_allocate();
-
- __objc_init_selector_tables();
- __objc_init_class_tables();
- __objc_init_dispatch_tables();
- __objc_class_tree_list = list_cons (NULL, __objc_class_tree_list);
- __objc_load_methods
- = hash_new (128, (hash_func_type)hash_ptr, compare_ptrs);
- previous_constructors = 1;
- }
-
- /* Save the module pointer for later processing. (not currently used) */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_module_list = list_cons(module, __objc_module_list);
-
- /* Replace referenced selectors from names to SEL's. */
- if (selectors)
- {
- for (i = 0; selectors[i].sel_id; ++i)
- {
- const char *name, *type;
- name = (char*)selectors[i].sel_id;
- type = (char*)selectors[i].sel_types;
- /* Constructors are constant static data so we can safely store
- pointers to them in the runtime structures. is_const == YES */
- __sel_register_typed_name (name, type,
- (struct objc_selector*)&(selectors[i]),
- YES);
- }
- }
-
- /* Parse the classes in the load module and gather selector information. */
- DEBUG_PRINTF ("gathering selectors from module: %s\n", module->name);
- for (i = 0; i < symtab->cls_def_cnt; ++i)
- {
- Class class = (Class) symtab->defs[i];
- const char* superclass = (char*)class->super_class;
-
- /* Make sure we have what we think. */
- assert (CLS_ISCLASS(class));
- assert (CLS_ISMETA(class->class_pointer));
- DEBUG_PRINTF ("phase 1, processing class: %s\n", class->name);
-
- /* Initialize the subclass list to be NULL.
- In some cases it isn't and this crashes the program. */
- class->subclass_list = NULL;
-
- /* Store the class in the class table and assign class numbers. */
- __objc_add_class_to_hash (class);
-
- /* Register all of the selectors in the class and meta class. */
- __objc_register_selectors_from_class (class);
- __objc_register_selectors_from_class ((Class) class->class_pointer);
-
- /* Install the fake dispatch tables */
- __objc_install_premature_dtable(class);
- __objc_install_premature_dtable(class->class_pointer);
-
- /* Register the instance methods as class methods, this is
- only done for root classes. */
- __objc_register_instance_methods_to_class(class);
-
- if (class->protocols)
- __objc_init_protocols (class->protocols);
-
- /* Check to see if the superclass is known in this point. If it's not
- add the class to the unresolved_classes list. */
- if (superclass && !objc_lookup_class (superclass))
- unresolved_classes = list_cons (class, unresolved_classes);
- }
-
- /* Process category information from the module. */
- for (i = 0; i < symtab->cat_def_cnt; ++i)
- {
- Category_t category = symtab->defs[i + symtab->cls_def_cnt];
- Class class = objc_lookup_class (category->class_name);
-
- /* If the class for the category exists then append its methods. */
- if (class)
- {
-
- DEBUG_PRINTF ("processing categories from (module,object): %s, %s\n",
- module->name,
- class->name);
-
- /* Do instance methods. */
- if (category->instance_methods)
- class_add_method_list (class, category->instance_methods);
-
- /* Do class methods. */
- if (category->class_methods)
- class_add_method_list ((Class) class->class_pointer,
- category->class_methods);
-
- if (category->protocols)
- {
- __objc_init_protocols (category->protocols);
- __objc_class_add_protocols (class, category->protocols);
- }
-
- /* Register the instance methods as class methods, this is
- only done for root classes. */
- __objc_register_instance_methods_to_class(class);
- }
- else
- {
- /* The object to which the category methods belong can't be found.
- Save the information. */
- unclaimed_categories = list_cons(category, unclaimed_categories);
- }
- }
-
- if (statics)
- uninitialized_statics = list_cons (statics, uninitialized_statics);
- if (uninitialized_statics)
- objc_init_statics ();
-
- /* Scan the unclaimed category hash. Attempt to attach any unclaimed
- categories to objects. */
- for (cell = &unclaimed_categories;
- *cell;
- ({ if (*cell) cell = &(*cell)->tail; }))
- {
- Category_t category = (*cell)->head;
- Class class = objc_lookup_class (category->class_name);
-
- if (class)
- {
- DEBUG_PRINTF ("attaching stored categories to object: %s\n",
- class->name);
-
- list_remove_head (cell);
-
- if (category->instance_methods)
- class_add_method_list (class, category->instance_methods);
-
- if (category->class_methods)
- class_add_method_list ((Class) class->class_pointer,
- category->class_methods);
-
- if (category->protocols)
- {
- __objc_init_protocols (category->protocols);
- __objc_class_add_protocols (class, category->protocols);
- }
-
- /* Register the instance methods as class methods, this is
- only done for root classes. */
- __objc_register_instance_methods_to_class(class);
- }
- }
-
- if (unclaimed_proto_list && objc_lookup_class ("Protocol"))
- {
- list_mapcar (unclaimed_proto_list,(void(*)(void*))__objc_init_protocols);
- list_free (unclaimed_proto_list);
- unclaimed_proto_list = 0;
- }
-
- objc_send_load ();
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-static void objc_send_load (void)
-{
- if (!__objc_module_list)
- return;
-
- /* Try to find out if all the classes loaded so far also have their
- superclasses known to the runtime. We suppose that the objects that are
- allocated in the +load method are in general of a class declared in the
- same module. */
- if (unresolved_classes)
- {
- Class class = unresolved_classes->head;
-
- while (objc_lookup_class ((char*)class->super_class))
- {
- list_remove_head (&unresolved_classes);
- if (unresolved_classes)
- class = unresolved_classes->head;
- else
- break;
- }
-
- /*
- * If we still have classes for whom we don't have yet their super
- * classes known to the runtime we don't send the +load messages.
- */
- if (unresolved_classes)
- return;
- }
-
- /* Special check to allow creating and sending messages to constant strings
- in +load methods. If these classes are not yet known, even if all the
- other classes are known, delay sending of +load. */
- if (!objc_lookup_class ("NXConstantString") ||
- !objc_lookup_class ("Object"))
- return;
-
- /* Iterate over all modules in the __objc_module_list and call on them the
- __objc_create_classes_tree function. This function creates a tree of
- classes that resembles the class hierarchy. */
- list_mapcar (__objc_module_list, (void(*)(void*))__objc_create_classes_tree);
-
- while (__objc_class_tree_list)
- {
-#ifdef DEBUG
- objc_preorder_traverse (__objc_class_tree_list->head,
- 0, __objc_tree_print);
-#endif
- objc_preorder_traverse (__objc_class_tree_list->head,
- 0, __objc_send_load);
- objc_postorder_traverse (__objc_class_tree_list->head,
- 0, __objc_destroy_class_tree_node);
- list_remove_head (&__objc_class_tree_list);
- }
-
- list_mapcar (__objc_module_list, (void(*)(void*))__objc_call_callback);
- list_free (__objc_module_list);
- __objc_module_list = NULL;
-}
-
-static void
-__objc_create_classes_tree (Module_t module)
-{
- /* The runtime mutex is locked in this point */
-
- Symtab_t symtab = module->symtab;
- int i;
-
- /* Iterate thru classes defined in this module and insert them in the classes
- tree hierarchy. */
- for (i = 0; i < symtab->cls_def_cnt; i++)
- {
- Class class = (Class) symtab->defs[i];
-
- objc_tree_insert_class (class);
- }
-}
-
-static void
-__objc_call_callback (Module_t module)
-{
- /* The runtime mutex is locked in this point */
-
- Symtab_t symtab = module->symtab;
- int i;
-
- /* Iterate thru classes defined in this module and call the callback for
- each one. */
- for (i = 0; i < symtab->cls_def_cnt; i++)
- {
- Class class = (Class) symtab->defs[i];
-
- /* Call the _objc_load_callback for this class. */
- if (_objc_load_callback)
- _objc_load_callback(class, 0);
- }
-
- /* Call the _objc_load_callback for categories. Don't register the instance
- methods as class methods for categories to root classes since they were
- already added in the class. */
- for (i = 0; i < symtab->cat_def_cnt; i++)
- {
- Category_t category = symtab->defs[i + symtab->cls_def_cnt];
- Class class = objc_lookup_class (category->class_name);
-
- if (_objc_load_callback)
- _objc_load_callback(class, category);
- }
-}
-
-/* Sanity check the version of gcc used to compile `module'*/
-static void init_check_module_version(Module_t module)
-{
- if ((module->version != OBJC_VERSION) || (module->size != sizeof (Module)))
- {
- int code;
-
- if(module->version > OBJC_VERSION)
- code = OBJC_ERR_OBJC_VERSION;
- else if (module->version < OBJC_VERSION)
- code = OBJC_ERR_GCC_VERSION;
- else
- code = OBJC_ERR_MODULE_SIZE;
-
- objc_error(nil, code, "Module %s version %d doesn't match runtime %d\n",
- module->name, (int)module->version, OBJC_VERSION);
- }
-}
-
-static void
-__objc_init_protocols (struct objc_protocol_list* protos)
-{
- int i;
- static Class proto_class = 0;
-
- if (! protos)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- if (!proto_class)
- proto_class = objc_lookup_class("Protocol");
-
- if (!proto_class)
- {
- unclaimed_proto_list = list_cons (protos, unclaimed_proto_list);
- objc_mutex_unlock(__objc_runtime_mutex);
- return;
- }
-
-#if 0
- assert (protos->next == 0); /* only single ones allowed */
-#endif
-
- for(i = 0; i < protos->count; i++)
- {
- struct objc_protocol* aProto = protos->list[i];
- if (((size_t)aProto->class_pointer) == PROTOCOL_VERSION)
- {
- /* assign class pointer */
- aProto->class_pointer = proto_class;
-
- /* init super protocols */
- __objc_init_protocols (aProto->protocol_list);
- }
- else if (protos->list[i]->class_pointer != proto_class)
- {
- objc_error(nil, OBJC_ERR_PROTOCOL_VERSION,
- "Version %d doesn't match runtime protocol version %d\n",
- (int)((char*)protos->list[i]->class_pointer-(char*)0),
- PROTOCOL_VERSION);
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-static void __objc_class_add_protocols (Class class,
- struct objc_protocol_list* protos)
-{
- /* Well... */
- if (! protos)
- return;
-
- /* Add it... */
- protos->next = class->protocols;
- class->protocols = protos;
-}
diff --git a/gcc/objc/libobjc.def b/gcc/objc/libobjc.def
deleted file mode 100644
index a4a6049e816..00000000000
--- a/gcc/objc/libobjc.def
+++ /dev/null
@@ -1,161 +0,0 @@
-; GNU Objective C Runtime DLL Export Definitions
-; Copyright (C) 1997 Free Software Foundation, Inc.
-; Contributed by Scott Christley <scottc@net-community.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.
-
-LIBRARY libobjc
-EXPORTS
-search_for_method_in_list
-objc_get_uninstalled_dtable
-hash_is_key_in_hash
-objc_verror
-_objc_load_callback
-objc_malloc
-objc_atomic_malloc
-objc_valloc
-objc_realloc
-objc_calloc
-objc_free
-__objc_init_thread_system
-objc_mutex_allocate
-objc_mutex_deallocate
-objc_mutex_lock
-objc_mutex_trylock
-objc_mutex_unlock
-objc_thread_detach
-objc_thread_exit
-objc_thread_get_data
-objc_thread_get_priority
-objc_thread_id
-objc_thread_set_data
-objc_thread_set_priority
-objc_thread_yield
-__objc_class_name_Object
-__objc_class_name_Protocol
-__objc_class_name_NXConstantString
-objc_error
-__objc_object_alloc
-__objc_object_copy
-__objc_object_dispose
-class_create_instance
-object_copy
-object_dispose
-__objc_init_selector_tables
-__objc_register_selectors_from_class
-__sel_register_typed_name
-sel_get_any_typed_uid
-sel_get_any_uid
-sel_get_name
-sel_get_type
-sel_get_typed_uid
-sel_get_uid
-sel_is_mapped
-sel_register_name
-sel_register_typed_name
-sel_types_match
-method_get_first_argument
-method_get_next_argument
-method_get_nth_argument
-method_get_number_of_arguments
-method_get_sizeof_arguments
-objc_aligned_size
-objc_alignof_type
-objc_get_type_qualifiers
-objc_promoted_size
-objc_sizeof_type
-objc_skip_argspec
-objc_skip_offset
-objc_skip_type_qualifiers
-objc_skip_typespec
-__objc_read_nbyte_uint
-__objc_read_nbyte_ulong
-__objc_write_class
-__objc_write_object
-__objc_write_selector
-objc_close_typed_stream
-objc_end_of_typed_stream
-objc_flush_typed_stream
-objc_get_stream_class_version
-objc_open_typed_stream
-objc_open_typed_stream_for_file
-objc_read_array
-objc_read_char
-objc_read_int
-objc_read_long
-objc_read_object
-objc_read_selector
-objc_read_short
-objc_read_string
-objc_read_type
-objc_read_types
-objc_read_unsigned_char
-objc_read_unsigned_int
-objc_read_unsigned_long
-objc_read_unsigned_short
-objc_write_array
-objc_write_char
-objc_write_int
-objc_write_long
-objc_write_object
-objc_write_object_reference
-objc_write_root_object
-objc_write_selector
-objc_write_short
-objc_write_string
-objc_write_string_atomic
-objc_write_type
-objc_write_types
-objc_write_unsigned_char
-objc_write_unsigned_int
-objc_write_unsigned_long
-objc_write_unsigned_short
-__objc_exec_class
-__objc_init_dispatch_tables
-__objc_install_premature_dtable
-__objc_print_dtable_stats
-__objc_responds_to
-__objc_update_dispatch_table_for_class
-class_add_method_list
-class_get_class_method
-class_get_instance_method
-get_imp
-nil_method
-objc_msg_lookup
-objc_msg_lookup_super
-objc_msg_sendv
-__objc_add_class_to_hash
-__objc_init_class_tables
-__objc_resolve_class_links
-class_pose_as
-objc_get_class
-objc_get_meta_class
-objc_lookup_class
-objc_next_class
-sarray_at_put
-sarray_at_put_safe
-sarray_free
-sarray_lazy_copy
-sarray_new
-sarray_realloc
-sarray_remove_garbage
-hash_add
-hash_delete
-hash_new
-hash_next
-hash_remove
-hash_value_for_key
diff --git a/gcc/objc/libobjc_entry.c b/gcc/objc/libobjc_entry.c
deleted file mode 100644
index 2d584ab3c1e..00000000000
--- a/gcc/objc/libobjc_entry.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* GNU Objective C Runtime DLL Entry
- Copyright (C) 1997 Free Software Foundation, Inc.
- Contributed by Scott Christley <scottc@net-community.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 files compiled with
- GCC to produce an executable, this does not 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 <windows.h>
-
-/*
- DLL entry function for Objective-C Runtime library
- This function gets called everytime a process/thread attaches to DLL
- */
-WINBOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call,
- LPVOID lpReserved)
-{
- switch(ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- }
- return TRUE;
-}
-
-/*
- This section terminates the list of imports under GCC. If you do not
- include this then you will have problems when linking with DLLs.
- */
-asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");
diff --git a/gcc/objc/linking.m b/gcc/objc/linking.m
deleted file mode 100644
index 8ecca028110..00000000000
--- a/gcc/objc/linking.m
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Force linking of classes required by Objective C runtime.
- Copyright (C) 1997 Free Software Foundation, Inc.
- Contributed by Ovidiu Predescu (ovidiu@net-community.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 files compiled with
- GCC to produce an executable, this does not 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 <objc/Object.h>
-#include <objc/NXConstStr.h>
-
-/* Generate references to Object and NXConstanstString classes since they are
- needed by the runtime system to run correctly. */
-
-
-void __objc_linking (void)
-{
- [Object name];
- [NXConstantString name];
-}
-
diff --git a/gcc/objc/makefile.dos b/gcc/objc/makefile.dos
deleted file mode 100644
index 3e1b1871e40..00000000000
--- a/gcc/objc/makefile.dos
+++ /dev/null
@@ -1,56 +0,0 @@
-# GNU Objective C Runtime Makefile for compiling with djgpp
-# Copyright (C) 1993, 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 Makefile is configured for GnuMAKE
-
-GCC_FOR_TARGET=gcc
-
-.SUFFIXES: .o .m
-
-OPTIMIZE = -O2
-
-# Always search these dirs when compiling.
-SUBDIR_INCLUDES = -I. -I.. -I../config
-
-.c.o:
- $(GCC_FOR_TARGET) $(OPTIMIZE) \
- -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
-
-.m.o:
- $(GCC_FOR_TARGET) $(OPTIMIZE) -fgnu-runtime \
- -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
-
-OBJC_O = hash.o sarray.o class.o sendmsg.o init.o archive.o \
- selector.o objects.o misc.o object.o protocol.o encoding.o thread.o
-
-libobjc.a: $(OBJC_O)
- -rm -f libobjc.a
- ar rc libobjc.a $(OBJC_O)
- ranlib libobjc.a
-
-OBJC_H = hash.h objc-list.h sarray.h objc.h \
- objc-api.h \
- object.h protocol.h mutex.h \
- typedstream.h thread.h
-
-mostlyclean:
- -rm -f *.o libobjc.a xforward fflags
-clean: mostlyclean
-distclean: mostlyclean
-extraclean: mostlyclean
diff --git a/gcc/objc/misc.c b/gcc/objc/misc.c
deleted file mode 100644
index 01f9d3bbafa..00000000000
--- a/gcc/objc/misc.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* GNU Objective C Runtime Miscellaneous
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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. */
-
-#define __USE_FIXED_PROTOTYPES__
-#include <stdlib.h>
-#include "runtime.h"
-
-/*
-** Error handler function
-** NULL so that default is to just print to stderr
-*/
-static objc_error_handler _objc_error_handler = NULL;
-
-/* Trigger an objc error */
-void
-objc_error(id object, int code, const char* fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- objc_verror(object, code, fmt, ap);
- va_end(ap);
-}
-
-/* Trigger an objc error */
-void
-objc_verror(id object, int code, const char* fmt, va_list ap)
-{
- BOOL result = NO;
-
- /* Call the error handler if its there
- Otherwise print to stderr */
- if (_objc_error_handler)
- result = (*_objc_error_handler)(object, code, fmt, ap);
- else
- vfprintf (stderr, fmt, ap);
-
- /* Continue if the error handler says its ok
- Otherwise abort the program */
- if (result)
- return;
- else
- abort();
-}
-
-/* Set the error handler */
-objc_error_handler
-objc_set_error_handler(objc_error_handler func)
-{
- objc_error_handler temp = _objc_error_handler;
- _objc_error_handler = func;
- return temp;
-}
-
-/*
-** Standard functions for memory allocation and disposal.
-** Users should use these functions in their ObjC programs so
-** that they work properly with garbage collectors as well as
-** can take advantage of the exception/error handling available.
-*/
-
-void *
-objc_malloc(size_t size)
-{
- void* res = (void*) (*_objc_malloc)(size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_atomic_malloc(size_t size)
-{
- void* res = (void*) (*_objc_atomic_malloc)(size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_valloc(size_t size)
-{
- void* res = (void*) (*_objc_valloc)(size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_realloc(void *mem, size_t size)
-{
- void* res = (void*) (*_objc_realloc)(mem, size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void *
-objc_calloc(size_t nelem, size_t size)
-{
- void* res = (void*) (*_objc_calloc)(nelem, size);
- if(!res)
- objc_error(nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
- return res;
-}
-
-void
-objc_free(void *mem)
-{
- (*_objc_free)(mem);
-}
-
-/*
-** Hook functions for memory allocation and disposal.
-** This makes it easy to substitute garbage collection systems
-** such as Boehm's GC by assigning these function pointers
-** to the GC's allocation routines. By default these point
-** to the ANSI standard malloc, realloc, free, etc.
-**
-** Users should call the normal objc routines above for
-** memory allocation and disposal within their programs.
-*/
-void *(*_objc_malloc)(size_t) = malloc;
-void *(*_objc_atomic_malloc)(size_t) = malloc;
-void *(*_objc_valloc)(size_t) = malloc;
-void *(*_objc_realloc)(void *, size_t) = realloc;
-void *(*_objc_calloc)(size_t, size_t) = calloc;
-void (*_objc_free)(void *) = free;
diff --git a/gcc/objc/nil_method.c b/gcc/objc/nil_method.c
deleted file mode 100644
index 1b6212826bd..00000000000
--- a/gcc/objc/nil_method.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* GNU Objective C Runtime nil receiver function
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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. */
-
-/* This is the nil method, the function that is called when the receiver
- of a method is nil */
-
-#include "runtime.h"
-
-id
-nil_method(id receiver, SEL op, ...)
-{
- return receiver;
-}
-
-
-
-
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 463ef692c38..0dc5ef05398 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -49,6 +49,14 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "function.h"
#include "output.h"
+#include "toplev.h"
+
+#if USE_CPPLIB
+#include "cpplib.h"
+extern cpp_reader parse_in;
+extern cpp_options parse_options;
+static int cpp_initialized;
+#endif
/* This is the default way of generating a method name. */
/* I am not sure it is really correct.
@@ -184,7 +192,9 @@ static tree generate_protocol_list PROTO((tree));
static void generate_forward_declaration_to_string_table PROTO((void));
static void build_protocol_reference PROTO((tree));
+#if 0
static tree init_selector PROTO((int));
+#endif
static tree build_keyword_selector PROTO((tree));
static tree synth_id_with_class_suffix PROTO((char *, tree));
@@ -287,7 +297,9 @@ static tree init_objc_symtab PROTO((tree));
static void forward_declare_categories PROTO((void));
static void generate_objc_symtab_decl PROTO((void));
static tree build_selector PROTO((tree));
+#if 0
static tree build_msg_pool_reference PROTO((int));
+#endif
static tree build_typed_selector_reference PROTO((tree, tree));
static tree build_selector_reference PROTO((tree));
static tree build_class_reference_decl PROTO((tree));
@@ -580,6 +592,11 @@ generate_struct_by_value_array ()
}
void
+lang_init_options ()
+{
+}
+
+void
lang_init ()
{
#if !USE_CPPLIB
@@ -660,9 +677,20 @@ lang_identify ()
}
int
-lang_decode_option (p)
- char *p;
+lang_decode_option (argc, argv)
+ int argc;
+ char **argv;
{
+ char *p = argv[0];
+#if USE_CPPLIB
+ if (! cpp_initialized)
+ {
+ cpp_reader_init (&parse_in);
+ parse_in.data = &parse_options;
+ cpp_options_init (&parse_options);
+ cpp_initialized = 1;
+ }
+#endif
if (!strcmp (p, "-lang-objc"))
doing_objc_thang = 1;
else if (!strcmp (p, "-gen-decls"))
@@ -686,7 +714,7 @@ lang_decode_option (p)
else if (!strcmp (p, "-print-objc-runtime-info"))
print_struct_values = 1;
else
- return c_decode_option (p);
+ return c_decode_option (argc, argv);
return 1;
}
@@ -695,9 +723,9 @@ lang_decode_option (p)
void
lang_print_xnode (file, node, indent)
- FILE *file;
- tree node;
- int indent;
+ FILE *file ATTRIBUTE_UNUSED;
+ tree node ATTRIBUTE_UNUSED;
+ int indent ATTRIBUTE_UNUSED;
{
}
@@ -2016,6 +2044,7 @@ build_selector (ident)
grok.m: warning: initialization of non-const * pointer from const *
grok.m: warning: initialization between incompatible pointer types. */
+#if 0
static tree
build_msg_pool_reference (offset)
int offset;
@@ -2041,6 +2070,7 @@ init_selector (offset)
TREE_TYPE (expr) = selector_type;
return expr;
}
+#endif
static void
build_selector_translation_table ()
@@ -3350,6 +3380,7 @@ build_selector_template ()
struct objc_class *sibling_class;
}
struct objc_protocol_list *protocols;
+ void *gc_object_type;
}; */
static void
@@ -3485,6 +3516,21 @@ build_class_template ()
decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
+ /* void *sel_id; */
+
+ decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
+ field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sel_id"));
+ field_decl
+ = grokfield (input_filename, lineno, field_decl, decl_specs, NULL_TREE);
+ chainon (field_decl_chain, field_decl);
+
+ /* void *gc_object_type; */
+
+ decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
+ field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("gc_object_type"));
+ field_decl
+ = grokfield (input_filename, lineno, field_decl, decl_specs, NULL_TREE);
+ chainon (field_decl_chain, field_decl);
finish_struct (objc_class_template, field_decl_chain, NULL_TREE);
}
@@ -4257,6 +4303,7 @@ build_category_initializer (type, cat_name, class_name,
struct objc_class *sibling_class;
}
struct objc_protocol_list *protocols;
+ void *gc_object_type;
}; */
static tree
@@ -4347,6 +4394,9 @@ build_shared_structure_initializer (type, isa, super, name, size, status,
initlist = tree_cons (NULL_TREE, expr, initlist);
}
+ /* gc_object_type = NULL */
+ initlist = tree_cons (NULL_TREE, build_int_2 (0, 0), initlist);
+
return build_constructor (type, nreverse (initlist));
}
@@ -6419,7 +6469,7 @@ start_protocol (code, name, list)
void
finish_protocol (protocol)
- tree protocol;
+ tree protocol ATTRIBUTE_UNUSED;
{
}
@@ -6533,9 +6583,9 @@ encode_array (type, curtype, format)
return;
}
- sprintf (buffer, "[%d",
- (TREE_INT_CST_LOW (an_int_cst)
- / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
+ sprintf (buffer, "[%ld",
+ (long) (TREE_INT_CST_LOW (an_int_cst)
+ / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
obstack_grow (&util_obstack, buffer, strlen (buffer));
encode_type (array_of, curtype, format);
@@ -6789,6 +6839,62 @@ encode_type (type, curtype, format)
}
static void
+encode_complete_bitfield (int position, tree type, int size)
+{
+ enum tree_code code = TREE_CODE (type);
+ char buffer[40];
+ char charType = '?';
+
+ if (code == INTEGER_TYPE)
+ {
+ if (TREE_INT_CST_LOW (TYPE_MIN_VALUE (type)) == 0
+ && TREE_INT_CST_HIGH (TYPE_MIN_VALUE (type)) == 0)
+ {
+ /* Unsigned integer types. */
+
+ if (TYPE_MODE (type) == QImode)
+ charType = 'C';
+ else if (TYPE_MODE (type) == HImode)
+ charType = 'S';
+ else if (TYPE_MODE (type) == SImode)
+ {
+ if (type == long_unsigned_type_node)
+ charType = 'L';
+ else
+ charType = 'I';
+ }
+ else if (TYPE_MODE (type) == DImode)
+ charType = 'Q';
+ }
+
+ else
+ /* Signed integer types. */
+ {
+ if (TYPE_MODE (type) == QImode)
+ charType = 'c';
+ else if (TYPE_MODE (type) == HImode)
+ charType = 's';
+ else if (TYPE_MODE (type) == SImode)
+ {
+ if (type == long_integer_type_node)
+ charType = 'l';
+ else
+ charType = 'i';
+ }
+
+ else if (TYPE_MODE (type) == DImode)
+ charType = 'q';
+ }
+ }
+
+ else
+ abort ();
+
+ sprintf (buffer, "b%d%c%d", position, charType, size);
+ obstack_grow (&util_obstack, buffer, strlen (buffer));
+}
+
+static void
encode_field_decl (field_decl, curtype, format)
tree field_decl;
int curtype;
@@ -6796,18 +6902,36 @@ encode_field_decl (field_decl, curtype, format)
{
tree type;
- /* If this field is obviously a bitfield, or is a bitfield that has been
+ type = TREE_TYPE (field_decl);
+
+ /* If this field is obviously a bitfield, or is a bitfield that has been
clobbered to look like a ordinary integer mode, go ahead and generate
the bitfield typing information. */
- type = TREE_TYPE (field_decl);
- if (DECL_BIT_FIELD (field_decl))
- encode_bitfield (DECL_FIELD_SIZE (field_decl), format);
- else if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && DECL_FIELD_SIZE (field_decl)
- && TYPE_MODE (type) > DECL_MODE (field_decl))
- encode_bitfield (DECL_FIELD_SIZE (field_decl), format);
+ if (flag_next_runtime)
+ {
+ if (DECL_BIT_FIELD (field_decl))
+ encode_bitfield (DECL_FIELD_SIZE (field_decl), format);
+ else if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+ && DECL_FIELD_SIZE (field_decl)
+ && TYPE_MODE (type) > DECL_MODE (field_decl))
+ encode_bitfield (DECL_FIELD_SIZE (field_decl), format);
+ else
+ encode_type (TREE_TYPE (field_decl), curtype, format);
+ }
else
- encode_type (TREE_TYPE (field_decl), curtype, format);
+ {
+ if (DECL_BIT_FIELD (field_decl)
+ || (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+ && DECL_FIELD_SIZE (field_decl)
+ && TYPE_MODE (type) > DECL_MODE (field_decl)))
+ {
+ encode_complete_bitfield (TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field_decl)),
+ DECL_BIT_FIELD_TYPE (field_decl),
+ DECL_FIELD_SIZE (field_decl));
+ }
+ else
+ encode_type (TREE_TYPE (field_decl), curtype, format);
+ }
}
static tree
@@ -7337,7 +7461,8 @@ adorn_decl (decl, str)
tree an_int_cst = TREE_OPERAND (decl, 1);
if (an_int_cst && TREE_CODE (an_int_cst) == INTEGER_CST)
- sprintf (str + strlen (str), "[%d]", TREE_INT_CST_LOW (an_int_cst));
+ sprintf (str + strlen (str), "[%ld]",
+ (long) TREE_INT_CST_LOW (an_int_cst));
else
strcat (str, "[]");
}
@@ -7348,9 +7473,9 @@ adorn_decl (decl, str)
tree array_of = TREE_TYPE (decl);
if (an_int_cst && TREE_CODE (an_int_cst) == INTEGER_TYPE)
- sprintf (str + strlen (str), "[%d]",
- (TREE_INT_CST_LOW (an_int_cst)
- / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
+ sprintf (str + strlen (str), "[%ld]",
+ (long) (TREE_INT_CST_LOW (an_int_cst)
+ / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
else
strcat (str, "[]");
}
diff --git a/gcc/objc/objc-api.h b/gcc/objc/objc-api.h
deleted file mode 100644
index 5ca8865d942..00000000000
--- a/gcc/objc/objc-api.h
+++ /dev/null
@@ -1,584 +0,0 @@
-/* GNU Objective-C Runtime API.
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not 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. */
-
-#ifndef __objc_api_INCLUDE_GNU
-#define __objc_api_INCLUDE_GNU
-
-#include "objc/objc.h"
-#include "objc/hash.h"
-#include "objc/thr.h"
-#include <stdio.h>
-#include <stdarg.h>
-
-/* For functions which return Method_t */
-#define METHOD_NULL (Method_t)0
- /* Boolean typedefs */
-/*
-** Method descriptor returned by introspective Object methods.
-** This is really just the first part of the more complete objc_method
-** structure defined below and used internally by the runtime.
-*/
-struct objc_method_description
-{
- SEL name; /* this is a selector, not a string */
- char *types; /* type encoding */
-};
-
-/* Filer types used to describe Ivars and Methods. */
-#define _C_ID '@'
-#define _C_CLASS '#'
-#define _C_SEL ':'
-#define _C_CHR 'c'
-#define _C_UCHR 'C'
-#define _C_SHT 's'
-#define _C_USHT 'S'
-#define _C_INT 'i'
-#define _C_UINT 'I'
-#define _C_LNG 'l'
-#define _C_ULNG 'L'
-#define _C_FLT 'f'
-#define _C_DBL 'd'
-#define _C_BFLD 'b'
-#define _C_VOID 'v'
-#define _C_UNDEF '?'
-#define _C_PTR '^'
-#define _C_CHARPTR '*'
-#define _C_ATOM '%'
-#define _C_ARY_B '['
-#define _C_ARY_E ']'
-#define _C_UNION_B '('
-#define _C_UNION_E ')'
-#define _C_STRUCT_B '{'
-#define _C_STRUCT_E '}'
-
-
-/*
-** Error handling
-**
-** Call objc_error() or objc_verror() to record an error; this error
-** routine will generally exit the program but not necessarily if the
-** user has installed his own error handler.
-**
-** Call objc_set_error_handler to assign your own function for
-** handling errors. The function should return YES if it is ok
-** to continue execution, or return NO or just abort if the
-** program should be stopped. The default error handler is just to
-** print a message on stderr.
-**
-** The error handler function should be of type objc_error_handler
-** The first parameter is an object instance of relevance.
-** The second parameter is an error code.
-** The third parameter is a format string in the printf style.
-** The fourth parameter is a variable list of arguments.
-*/
-extern void objc_error(id object, int code, const char* fmt, ...);
-extern void objc_verror(id object, int code, const char* fmt, va_list ap);
-typedef BOOL (*objc_error_handler)(id, int code, const char *fmt, va_list ap);
-objc_error_handler objc_set_error_handler(objc_error_handler func);
-
-/*
-** Error codes
-** These are used by the runtime library, and your
-** error handling may use them to determine if the error is
-** hard or soft thus whether execution can continue or abort.
-*/
-#define OBJC_ERR_UNKNOWN 0 /* Generic error */
-
-#define OBJC_ERR_OBJC_VERSION 1 /* Incorrect runtime version */
-#define OBJC_ERR_GCC_VERSION 2 /* Incorrect compiler version */
-#define OBJC_ERR_MODULE_SIZE 3 /* Bad module size */
-#define OBJC_ERR_PROTOCOL_VERSION 4 /* Incorrect protocol version */
-
-#define OBJC_ERR_MEMORY 10 /* Out of memory */
-
-#define OBJC_ERR_RECURSE_ROOT 20 /* Attempt to archive the root
- object more than once. */
-#define OBJC_ERR_BAD_DATA 21 /* Didn't read expected data */
-#define OBJC_ERR_BAD_KEY 22 /* Bad key for object */
-#define OBJC_ERR_BAD_CLASS 23 /* Unknown class */
-#define OBJC_ERR_BAD_TYPE 24 /* Bad type specification */
-#define OBJC_ERR_NO_READ 25 /* Cannot read stream */
-#define OBJC_ERR_NO_WRITE 26 /* Cannot write stream */
-#define OBJC_ERR_STREAM_VERSION 27 /* Incorrect stream version */
-#define OBJC_ERR_BAD_OPCODE 28 /* Bad opcode */
-
-#define OBJC_ERR_UNIMPLEMENTED 30 /* Method is not implemented */
-
-#define OBJC_ERR_BAD_STATE 40 /* Bad thread state */
-
-/*
-** Set this variable nonzero to print a line describing each
-** message that is sent. (this is currently disabled)
-*/
-extern BOOL objc_trace;
-
-
-/* For every class which happens to have statically allocated instances in
- this module, one OBJC_STATIC_INSTANCES is allocated by the compiler.
- INSTANCES is NULL terminated and points to all statically allocated
- instances of this class. */
-struct objc_static_instances
-{
- char *class_name;
- id instances[0];
-};
-
-/*
-** Whereas a Module (defined further down) is the root (typically) of a file,
-** a Symtab is the root of the class and category definitions within the
-** module.
-**
-** A Symtab contains a variable length array of pointers to classes and
-** categories defined in the module.
-*/
-typedef struct objc_symtab {
- unsigned long sel_ref_cnt; /* Unknown. */
- SEL refs; /* Unknown. */
- unsigned short cls_def_cnt; /* Number of classes compiled
- (defined) in the module. */
- unsigned short cat_def_cnt; /* Number of categories
- compiled (defined) in the
- module. */
-
- void *defs[1]; /* Variable array of pointers.
- cls_def_cnt of type Class
- followed by cat_def_cnt of
- type Category_t, followed
- by a NULL terminated array
- of objc_static_instances. */
-} Symtab, *Symtab_t;
-
-
-/*
-** The compiler generates one of these structures for each module that
-** composes the executable (eg main.m).
-**
-** This data structure is the root of the definition tree for the module.
-**
-** A collect program runs between ld stages and creates a ObjC ctor array.
-** That array holds a pointer to each module structure of the executable.
-*/
-typedef struct objc_module {
- unsigned long version; /* Compiler revision. */
- unsigned long size; /* sizeof(Module). */
- const char* name; /* Name of the file where the
- module was generated. The
- name includes the path. */
-
- Symtab_t symtab; /* Pointer to the Symtab of
- the module. The Symtab
- holds an array of
- pointers to
- the classes and categories
- defined in the module. */
-} Module, *Module_t;
-
-
-/*
-** The compiler generates one of these structures for a class that has
-** instance variables defined in its specification.
-*/
-typedef struct objc_ivar* Ivar_t;
-typedef struct objc_ivar_list {
- int ivar_count; /* Number of structures (Ivar)
- contained in the list. One
- structure per instance
- variable defined in the
- class. */
- struct objc_ivar {
- const char* ivar_name; /* Name of the instance
- variable as entered in the
- class definition. */
- const char* ivar_type; /* Description of the Ivar's
- type. Useful for
- debuggers. */
- int ivar_offset; /* Byte offset from the base
- address of the instance
- structure to the variable. */
-
- } ivar_list[1]; /* Variable length
- structure. */
-} IvarList, *IvarList_t;
-
-
-/*
-** The compiler generates one (or more) of these structures for a class that
-** has methods defined in its specification.
-**
-** The implementation of a class can be broken into separate pieces in a file
-** and categories can break them across modules. To handle this problem is a
-** singly linked list of methods.
-*/
-typedef struct objc_method Method;
-typedef Method* Method_t;
-typedef struct objc_method_list {
- struct objc_method_list* method_next; /* This variable is used to link
- a method list to another. It
- is a singly linked list. */
- int method_count; /* Number of methods defined in
- this structure. */
- struct objc_method {
- SEL method_name; /* This variable is the method's
- name. It is a char*.
- The unique integer passed to
- objc_msg_send is a char* too.
- It is compared against
- method_name using strcmp. */
- const char* method_types; /* Description of the method's
- parameter list. Useful for
- debuggers. */
- IMP method_imp; /* Address of the method in the
- executable. */
- } method_list[1]; /* Variable length
- structure. */
-} MethodList, *MethodList_t;
-
-struct objc_protocol_list {
- struct objc_protocol_list *next;
- int count;
- Protocol *list[1];
-};
-
-/*
-** This is used to assure consistent access to the info field of
-** classes
-*/
-#ifndef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG (sizeof(long)*8)
-#endif
-
-#define __CLS_INFO(cls) ((cls)->info)
-#define __CLS_ISINFO(cls, mask) ((__CLS_INFO(cls)&mask)==mask)
-#define __CLS_SETINFO(cls, mask) (__CLS_INFO(cls) |= mask)
-
-/* The structure is of type MetaClass */
-#define _CLS_META 0x2L
-#define CLS_ISMETA(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_META))
-
-
-/* The structure is of type Class */
-#define _CLS_CLASS 0x1L
-#define CLS_ISCLASS(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_CLASS))
-
-/*
-** The class is initialized within the runtime. This means that
-** it has had correct super and sublinks assigned
-*/
-#define _CLS_RESOLV 0x8L
-#define CLS_ISRESOLV(cls) __CLS_ISINFO(cls, _CLS_RESOLV)
-#define CLS_SETRESOLV(cls) __CLS_SETINFO(cls, _CLS_RESOLV)
-
-/*
-** The class has been send a +initialize message or a such is not
-** defined for this class
-*/
-#define _CLS_INITIALIZED 0x04L
-#define CLS_ISINITIALIZED(cls) __CLS_ISINFO(cls, _CLS_INITIALIZED)
-#define CLS_SETINITIALIZED(cls) __CLS_SETINFO(cls, _CLS_INITIALIZED)
-
-/*
-** The class number of this class. This must be the same for both the
-** class and it's meta class object
-*/
-#define CLS_GETNUMBER(cls) (__CLS_INFO(cls) >> (HOST_BITS_PER_LONG/2))
-#define CLS_SETNUMBER(cls, num) \
- ({ (cls)->info <<= (HOST_BITS_PER_LONG/2); \
- (cls)->info >>= (HOST_BITS_PER_LONG/2); \
- __CLS_SETINFO(cls, (((unsigned long)num) << (HOST_BITS_PER_LONG/2))); })
-
-/*
-** The compiler generates one of these structures for each category. A class
-** may have many categories and contain both instance and factory methods.
-*/
-typedef struct objc_category {
- const char* category_name; /* Name of the category. Name
- contained in the () of the
- category definition. */
- const char* class_name; /* Name of the class to which
- the category belongs. */
- MethodList_t instance_methods; /* Linked list of instance
- methods defined in the
- category. NULL indicates no
- instance methods defined. */
- MethodList_t class_methods; /* Linked list of factory
- methods defined in the
- category. NULL indicates no
- class methods defined. */
- struct objc_protocol_list *protocols; /* List of Protocols
- conformed to */
-} Category, *Category_t;
-
-/*
-** Structure used when a message is send to a class's super class. The
-** compiler generates one of these structures and passes it to
-** objc_msg_super.
-*/
-typedef struct objc_super {
- id self; /* Id of the object sending
- the message. */
- Class class; /* Object's super class. */
-} Super, *Super_t;
-
-IMP objc_msg_lookup_super(Super_t super, SEL sel);
-
-retval_t objc_msg_sendv(id, SEL, arglist_t);
-
-
-
-/*
-** This is a hook which is called by objc_lookup_class and
-** objc_get_class if the runtime is not able to find the class.
-** This may e.g. try to load in the class using dynamic loading.
-** The function is guaranteed to be passed a non-NULL name string.
-*/
-extern Class (*_objc_lookup_class)(const char *name);
-
-/*
-** This is a hook which is called by __objc_exec_class every time a class
-** or a category is loaded into the runtime. This may e.g. help a
-** dynamic loader determine the classes that have been loaded when
-** an object file is dynamically linked in.
-*/
-extern void (*_objc_load_callback)(Class class, Category* category);
-
-/*
-** Hook functions for allocating, copying and disposing of instances
-*/
-extern id (*_objc_object_alloc)(Class class);
-extern id (*_objc_object_copy)(id object);
-extern id (*_objc_object_dispose)(id object);
-
-/*
-** Standard functions for memory allocation and disposal.
-** Users should use these functions in their ObjC programs so
-** that they work properly with garbage collectors as well as
-** can take advantage of the exception/error handling available.
-*/
-void *
-objc_malloc(size_t size);
-
-void *
-objc_atomic_malloc(size_t size);
-
-void *
-objc_valloc(size_t size);
-
-void *
-objc_realloc(void *mem, size_t size);
-
-void *
-objc_calloc(size_t nelem, size_t size);
-
-void
-objc_free(void *mem);
-
-/*
-** Hook functions for memory allocation and disposal.
-** This makes it easy to substitute garbage collection systems
-** such as Boehm's GC by assigning these function pointers
-** to the GC's allocation routines. By default these point
-** to the ANSI standard malloc, realloc, free, etc.
-**
-** Users should call the normal objc routines above for
-** memory allocation and disposal within their programs.
-*/
-extern void *(*_objc_malloc)(size_t);
-extern void *(*_objc_atomic_malloc)(size_t);
-extern void *(*_objc_valloc)(size_t);
-extern void *(*_objc_realloc)(void *, size_t);
-extern void *(*_objc_calloc)(size_t, size_t);
-extern void (*_objc_free)(void *);
-
-Method_t class_get_class_method(MetaClass class, SEL aSel);
-
-Method_t class_get_instance_method(Class class, SEL aSel);
-
-Class class_pose_as(Class impostor, Class superclass);
-
-Class objc_get_class(const char *name);
-
-Class objc_lookup_class(const char *name);
-
-Class objc_next_class(void **enum_state);
-
-const char *sel_get_name(SEL selector);
-
-const char *sel_get_type(SEL selector);
-
-SEL sel_get_uid(const char *name);
-
-SEL sel_get_any_uid(const char *name);
-
-SEL sel_get_any_typed_uid(const char *name);
-
-SEL sel_get_typed_uid(const char *name, const char*);
-
-SEL sel_register_name(const char *name);
-
-SEL sel_register_typed_name(const char *name, const char*type);
-
-
-BOOL sel_is_mapped (SEL aSel);
-
-extern id class_create_instance(Class class);
-
-static inline const char *
-class_get_class_name(Class class)
-{
- return CLS_ISCLASS(class)?class->name:((class==Nil)?"Nil":0);
-}
-
-static inline long
-class_get_instance_size(Class class)
-{
- return CLS_ISCLASS(class)?class->instance_size:0;
-}
-
-static inline MetaClass
-class_get_meta_class(Class class)
-{
- return CLS_ISCLASS(class)?class->class_pointer:Nil;
-}
-
-static inline Class
-class_get_super_class(Class class)
-{
- return CLS_ISCLASS(class)?class->super_class:Nil;
-}
-
-static inline int
-class_get_version(Class class)
-{
- return CLS_ISCLASS(class)?class->version:-1;
-}
-
-static inline BOOL
-class_is_class(Class class)
-{
- return CLS_ISCLASS(class);
-}
-
-static inline BOOL
-class_is_meta_class(Class class)
-{
- return CLS_ISMETA(class);
-}
-
-
-static inline void
-class_set_version(Class class, long version)
-{
- if (CLS_ISCLASS(class))
- class->version = version;
-}
-
-static inline IMP
-method_get_imp(Method_t method)
-{
- return (method!=METHOD_NULL)?method->method_imp:(IMP)0;
-}
-
-IMP get_imp (Class class, SEL sel);
-
-/* Redefine on NeXTSTEP so as not to conflict with system function */
-#ifdef __NeXT__
-#define object_copy gnu_object_copy
-#define object_dispose gnu_object_dispose
-#endif
-
-id object_copy(id object);
-
-id object_dispose(id object);
-
-static inline Class
-object_get_class(id object)
-{
- return ((object!=nil)
- ? (CLS_ISCLASS(object->class_pointer)
- ? object->class_pointer
- : (CLS_ISMETA(object->class_pointer)
- ? (Class)object
- : Nil))
- : Nil);
-}
-
-static inline const char *
-object_get_class_name(id object)
-{
- return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
- ?object->class_pointer->name
- :((Class)object)->name)
- :"Nil");
-}
-
-static inline MetaClass
-object_get_meta_class(id object)
-{
- return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
- ?object->class_pointer->class_pointer
- :(CLS_ISMETA(object->class_pointer)
- ?object->class_pointer
- :Nil))
- :Nil);
-}
-
-static inline Class
-object_get_super_class
-(id object)
-{
- return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
- ?object->class_pointer->super_class
- :(CLS_ISMETA(object->class_pointer)
- ?((Class)object)->super_class
- :Nil))
- :Nil);
-}
-
-static inline BOOL
-object_is_class(id object)
-{
- return CLS_ISCLASS((Class)object);
-}
-
-static inline BOOL
-object_is_instance(id object)
-{
- return (object!=nil)&&CLS_ISCLASS(object->class_pointer);
-}
-
-static inline BOOL
-object_is_meta_class(id object)
-{
- return CLS_ISMETA((Class)object);
-}
-
-struct sarray*
-objc_get_uninstalled_dtable(void);
-
-#endif /* not __objc_api_INCLUDE_GNU */
-
-
-
diff --git a/gcc/objc/objc-list.h b/gcc/objc/objc-list.h
deleted file mode 100644
index 19760906238..00000000000
--- a/gcc/objc/objc-list.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Generic single linked list to keep various information
- Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup.
-
-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 files compiled with
- GCC to produce an executable, this does not 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. */
-
-#ifndef __GNU_OBJC_LIST_H
-#define __GNU_OBJC_LIST_H
-
-struct objc_list {
- void *head;
- struct objc_list *tail;
-};
-
-/* Return a cons cell produced from (head . tail) */
-
-static inline struct objc_list*
-list_cons(void* head, struct objc_list* tail)
-{
- struct objc_list* cell;
-
- cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
- cell->head = head;
- cell->tail = tail;
- return cell;
-}
-
-/* Return the length of a list, list_length(NULL) returns zero */
-
-static inline int
-list_length(struct objc_list* list)
-{
- int i = 0;
- while(list)
- {
- i += 1;
- list = list->tail;
- }
- return i;
-}
-
-/* Return the Nth element of LIST, where N count from zero. If N
- larger than the list length, NULL is returned */
-
-static inline void*
-list_nth(int index, struct objc_list* list)
-{
- while(index-- != 0)
- {
- if(list->tail)
- list = list->tail;
- else
- return 0;
- }
- return list->head;
-}
-
-/* Remove the element at the head by replacing it by its successor */
-
-static inline void
-list_remove_head(struct objc_list** list)
-{
- if ((*list)->tail)
- {
- struct objc_list* tail = (*list)->tail; /* fetch next */
- *(*list) = *tail; /* copy next to list head */
- objc_free(tail); /* free next */
- }
- else /* only one element in list */
- {
- objc_free(*list);
- (*list) = 0;
- }
-}
-
-
-/* Remove the element with `car' set to ELEMENT */
-
-static inline void
-list_remove_elem(struct objc_list** list, void* elem)
-{
- while (*list) {
- if ((*list)->head == elem)
- list_remove_head(list);
- list = &((*list)->tail);
- }
-}
-
-/* Map FUNCTION over all elements in LIST */
-
-static inline void
-list_mapcar(struct objc_list* list, void(*function)(void*))
-{
- while(list)
- {
- (*function)(list->head);
- list = list->tail;
- }
-}
-
-/* Return element that has ELEM as car */
-
-static inline struct objc_list**
-list_find(struct objc_list** list, void* elem)
-{
- while(*list)
- {
- if ((*list)->head == elem)
- return list;
- list = &((*list)->tail);
- }
- return NULL;
-}
-
-/* Free list (backwards recursive) */
-
-static void
-list_free(struct objc_list* list)
-{
- if(list)
- {
- list_free(list->tail);
- objc_free(list);
- }
-}
-#endif __GNU_OBJC_LIST_H
diff --git a/gcc/objc/objc-parse.c b/gcc/objc/objc-parse.c
index ad06cf6ac26..81daef3b8f7 100644
--- a/gcc/objc/objc-parse.c
+++ b/gcc/objc/objc-parse.c
@@ -98,7 +98,7 @@ char *language_string = "GNU Obj-C";
#line 65 "objc-parse.y"
typedef union {long itype; tree ttype; enum tree_code code;
char *filename; int lineno; int ends_in_label; } YYSTYPE;
-#line 192 "objc-parse.y"
+#line 193 "objc-parse.y"
/* Number of statements (loosely speaking) and compound statements
seen so far. */
@@ -146,11 +146,11 @@ extern void yyprint PROTO ((FILE *, int, YYSTYPE));
-#define YYFINAL 941
+#define YYFINAL 947
#define YYFLAG -32768
#define YYNTBASE 84
-#define YYTRANSLATE(x) ((unsigned)(x) <= 316 ? yytranslate[x] : 306)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 316 ? yytranslate[x] : 309)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -213,59 +213,60 @@ static const short yyprhs[] = { 0,
630, 631, 636, 637, 643, 644, 645, 651, 652, 653,
659, 661, 663, 667, 671, 676, 680, 684, 688, 690,
692, 696, 701, 705, 709, 713, 715, 719, 723, 727,
- 732, 736, 740, 742, 743, 751, 757, 760, 761, 769,
- 775, 778, 779, 788, 789, 797, 800, 801, 803, 804,
- 806, 808, 811, 812, 816, 819, 824, 828, 830, 834,
- 836, 838, 841, 843, 847, 852, 859, 865, 867, 871,
- 873, 875, 879, 882, 885, 886, 888, 890, 893, 894,
- 897, 901, 905, 908, 912, 917, 921, 924, 928, 931,
- 933, 935, 938, 941, 942, 944, 947, 948, 949, 951,
- 953, 956, 960, 962, 965, 967, 970, 977, 983, 989,
- 992, 995, 1000, 1001, 1006, 1007, 1008, 1012, 1017, 1021,
- 1023, 1025, 1027, 1029, 1032, 1033, 1038, 1040, 1044, 1045,
- 1046, 1054, 1060, 1063, 1064, 1065, 1066, 1079, 1080, 1087,
- 1090, 1093, 1096, 1100, 1107, 1116, 1127, 1140, 1144, 1149,
- 1151, 1153, 1154, 1161, 1165, 1171, 1174, 1177, 1178, 1180,
- 1181, 1183, 1184, 1186, 1188, 1192, 1197, 1199, 1203, 1204,
- 1207, 1210, 1211, 1216, 1219, 1220, 1222, 1224, 1228, 1230,
- 1234, 1239, 1244, 1249, 1254, 1259, 1260, 1263, 1265, 1268,
- 1270, 1274, 1276, 1280, 1282, 1284, 1286, 1288, 1290, 1292,
- 1294, 1296, 1300, 1304, 1309, 1310, 1311, 1322, 1323, 1330,
- 1331, 1332, 1345, 1346, 1355, 1356, 1363, 1366, 1367, 1376,
- 1381, 1382, 1392, 1398, 1399, 1406, 1407, 1409, 1413, 1417,
- 1419, 1421, 1423, 1425, 1426, 1430, 1433, 1437, 1441, 1443,
- 1444, 1446, 1450, 1452, 1456, 1459, 1460, 1461, 1462, 1470,
- 1471, 1472, 1473, 1481, 1482, 1483, 1486, 1488, 1490, 1493,
- 1494, 1498, 1500, 1502, 1503, 1504, 1510, 1511, 1512, 1518,
- 1523, 1525, 1531, 1534, 1535, 1538, 1539, 1541, 1543, 1545,
- 1548, 1551, 1556, 1559, 1562, 1564, 1568, 1571, 1574, 1577,
- 1578, 1581, 1582, 1586, 1588, 1590, 1593, 1595, 1597, 1599,
- 1601, 1603, 1605, 1607, 1609, 1611, 1613, 1615, 1617, 1619,
- 1621, 1623, 1625, 1627, 1629, 1631, 1633, 1635, 1637, 1639,
- 1641, 1643, 1650, 1654, 1660, 1663, 1665, 1667, 1669, 1672,
- 1674, 1678, 1681, 1683, 1685, 1686, 1687, 1694, 1696, 1698,
- 1700, 1703, 1706, 1708, 1713, 1718
+ 732, 736, 740, 742, 744, 747, 749, 752, 754, 757,
+ 758, 766, 772, 775, 776, 784, 790, 793, 794, 803,
+ 804, 812, 815, 816, 818, 819, 821, 823, 826, 827,
+ 831, 834, 839, 843, 845, 849, 851, 853, 856, 858,
+ 862, 867, 874, 880, 882, 886, 888, 890, 894, 897,
+ 900, 901, 903, 905, 908, 909, 912, 916, 920, 923,
+ 927, 932, 936, 939, 943, 946, 948, 950, 953, 956,
+ 957, 959, 962, 963, 964, 966, 968, 971, 975, 977,
+ 980, 982, 985, 992, 998, 1004, 1007, 1010, 1015, 1016,
+ 1021, 1022, 1023, 1027, 1032, 1036, 1038, 1040, 1042, 1044,
+ 1047, 1048, 1053, 1055, 1059, 1060, 1061, 1069, 1075, 1078,
+ 1079, 1080, 1081, 1094, 1095, 1102, 1105, 1108, 1111, 1115,
+ 1122, 1131, 1142, 1155, 1159, 1164, 1166, 1168, 1169, 1176,
+ 1180, 1186, 1189, 1192, 1193, 1195, 1196, 1198, 1199, 1201,
+ 1203, 1207, 1212, 1214, 1218, 1219, 1222, 1225, 1226, 1231,
+ 1234, 1235, 1237, 1239, 1243, 1245, 1249, 1254, 1259, 1264,
+ 1269, 1274, 1275, 1278, 1280, 1283, 1285, 1289, 1291, 1295,
+ 1297, 1299, 1301, 1303, 1305, 1307, 1309, 1311, 1315, 1319,
+ 1324, 1325, 1326, 1337, 1338, 1345, 1346, 1347, 1360, 1361,
+ 1370, 1371, 1378, 1381, 1382, 1391, 1396, 1397, 1407, 1413,
+ 1414, 1421, 1422, 1424, 1428, 1432, 1434, 1436, 1438, 1440,
+ 1441, 1445, 1448, 1452, 1456, 1458, 1459, 1461, 1465, 1467,
+ 1471, 1474, 1475, 1476, 1477, 1485, 1486, 1487, 1488, 1496,
+ 1497, 1498, 1501, 1503, 1505, 1508, 1509, 1513, 1515, 1517,
+ 1518, 1519, 1525, 1526, 1527, 1533, 1538, 1540, 1546, 1549,
+ 1550, 1553, 1554, 1556, 1558, 1560, 1563, 1566, 1571, 1574,
+ 1577, 1579, 1583, 1586, 1589, 1592, 1593, 1596, 1597, 1601,
+ 1603, 1605, 1608, 1610, 1612, 1614, 1616, 1618, 1620, 1622,
+ 1624, 1626, 1628, 1630, 1632, 1634, 1636, 1638, 1640, 1642,
+ 1644, 1646, 1648, 1650, 1652, 1654, 1656, 1658, 1665, 1669,
+ 1675, 1678, 1680, 1682, 1684, 1687, 1689, 1693, 1696, 1698,
+ 1700, 1701, 1702, 1709, 1711, 1713, 1715, 1718, 1721, 1723,
+ 1728, 1733
};
static const short yyrhs[] = { -1,
85, 0, 0, 86, 88, 0, 0, 85, 87, 88,
- 0, 90, 0, 89, 0, 237, 0, 27, 59, 99,
- 76, 77, 0, 236, 88, 0, 123, 137, 77, 0,
+ 0, 90, 0, 89, 0, 240, 0, 27, 59, 99,
+ 76, 77, 0, 239, 88, 0, 123, 137, 77, 0,
130, 123, 137, 77, 0, 126, 123, 136, 77, 0,
130, 77, 0, 126, 77, 0, 1, 77, 0, 1,
78, 0, 77, 0, 0, 0, 126, 123, 163, 91,
- 117, 92, 194, 0, 126, 123, 163, 1, 0, 0,
- 0, 130, 123, 166, 93, 117, 94, 194, 0, 130,
+ 117, 92, 197, 0, 126, 123, 163, 1, 0, 0,
+ 0, 130, 123, 166, 93, 117, 94, 197, 0, 130,
123, 166, 1, 0, 0, 0, 123, 166, 95, 117,
- 96, 194, 0, 123, 166, 1, 0, 3, 0, 4,
+ 96, 197, 0, 123, 166, 1, 0, 3, 0, 4,
0, 72, 0, 67, 0, 43, 0, 49, 0, 48,
0, 54, 0, 55, 0, 79, 0, 80, 0, 101,
0, 0, 101, 0, 107, 0, 101, 81, 107, 0,
- 113, 0, 50, 105, 0, 236, 105, 0, 98, 105,
- 0, 40, 97, 0, 103, 102, 0, 103, 59, 181,
- 76, 0, 104, 102, 0, 104, 59, 181, 76, 0,
+ 113, 0, 50, 105, 0, 239, 105, 0, 98, 105,
+ 0, 40, 97, 0, 103, 102, 0, 103, 59, 184,
+ 76, 0, 104, 102, 0, 104, 59, 184, 76, 0,
33, 105, 0, 34, 105, 0, 11, 0, 29, 0,
- 102, 0, 59, 181, 76, 105, 0, 0, 59, 181,
+ 102, 0, 59, 184, 76, 105, 0, 0, 59, 184,
76, 82, 106, 151, 78, 0, 105, 0, 107, 48,
107, 0, 107, 49, 107, 0, 107, 50, 107, 0,
107, 51, 107, 0, 107, 52, 107, 0, 107, 46,
@@ -277,28 +278,28 @@ static const short yyrhs[] = { -1,
37, 112, 38, 107, 0, 107, 36, 107, 0, 107,
35, 107, 0, 3, 0, 8, 0, 115, 0, 59,
99, 76, 0, 59, 1, 76, 0, 0, 59, 114,
- 196, 76, 0, 113, 59, 100, 76, 0, 113, 60,
+ 199, 76, 0, 113, 59, 100, 76, 0, 113, 60,
99, 83, 0, 113, 58, 97, 0, 113, 57, 97,
- 0, 113, 54, 0, 113, 55, 0, 297, 0, 303,
- 0, 304, 0, 305, 0, 116, 0, 9, 0, 115,
+ 0, 113, 54, 0, 113, 55, 0, 300, 0, 306,
+ 0, 307, 0, 308, 0, 116, 0, 9, 0, 115,
9, 0, 75, 0, 116, 75, 0, 0, 119, 0,
- 119, 10, 0, 201, 202, 120, 0, 118, 0, 189,
- 0, 119, 118, 0, 118, 189, 0, 128, 123, 136,
+ 119, 10, 0, 204, 205, 120, 0, 118, 0, 192,
+ 0, 119, 118, 0, 118, 192, 0, 128, 123, 136,
77, 0, 131, 123, 137, 77, 0, 128, 77, 0,
- 131, 77, 0, 201, 202, 125, 0, 121, 0, 189,
- 0, 122, 121, 0, 121, 189, 0, 0, 0, 126,
+ 131, 77, 0, 204, 205, 125, 0, 121, 0, 192,
+ 0, 122, 121, 0, 121, 192, 0, 0, 0, 126,
123, 136, 77, 0, 130, 123, 137, 77, 0, 126,
123, 157, 0, 130, 123, 160, 0, 126, 77, 0,
- 130, 77, 0, 236, 125, 0, 134, 127, 0, 130,
+ 130, 77, 0, 239, 125, 0, 134, 127, 0, 130,
134, 127, 0, 0, 127, 135, 0, 127, 5, 0,
127, 144, 0, 134, 129, 0, 131, 134, 129, 0,
0, 129, 135, 0, 129, 5, 0, 131, 0, 144,
0, 130, 131, 0, 130, 144, 0, 7, 0, 5,
0, 131, 7, 0, 131, 5, 0, 134, 133, 0,
- 183, 134, 133, 0, 0, 133, 135, 0, 6, 0,
- 167, 0, 4, 0, 67, 253, 0, 72, 253, 0,
- 254, 0, 28, 59, 99, 76, 0, 28, 59, 181,
- 76, 0, 6, 0, 7, 0, 167, 0, 139, 0,
+ 186, 134, 133, 0, 0, 133, 135, 0, 6, 0,
+ 170, 0, 4, 0, 67, 256, 0, 72, 256, 0,
+ 257, 0, 28, 59, 99, 76, 0, 28, 59, 184,
+ 76, 0, 6, 0, 7, 0, 170, 0, 139, 0,
136, 81, 139, 0, 141, 0, 137, 81, 139, 0,
0, 27, 59, 115, 76, 0, 0, 163, 138, 143,
36, 140, 149, 0, 163, 138, 143, 0, 0, 166,
@@ -309,180 +310,182 @@ static const short yyrhs[] = { -1,
59, 3, 81, 101, 76, 0, 148, 59, 100, 76,
0, 97, 0, 5, 0, 6, 0, 7, 0, 107,
0, 0, 82, 150, 151, 78, 0, 1, 0, 0,
- 152, 172, 0, 153, 0, 152, 81, 153, 0, 107,
+ 152, 175, 0, 153, 0, 152, 81, 153, 0, 107,
0, 0, 82, 154, 151, 78, 0, 1, 0, 0,
97, 38, 155, 153, 0, 0, 58, 97, 36, 156,
- 153, 0, 0, 0, 163, 158, 117, 159, 196, 0,
- 0, 0, 166, 161, 117, 162, 196, 0, 164, 0,
- 166, 0, 59, 164, 76, 0, 164, 59, 231, 0,
+ 153, 0, 0, 0, 163, 158, 117, 159, 199, 0,
+ 0, 0, 166, 161, 117, 162, 199, 0, 164, 0,
+ 166, 0, 59, 164, 76, 0, 164, 59, 234, 0,
164, 60, 99, 83, 0, 164, 60, 83, 0, 50,
- 184, 164, 0, 144, 124, 164, 0, 4, 0, 72,
- 0, 165, 59, 231, 0, 165, 60, 99, 83, 0,
- 165, 60, 83, 0, 50, 184, 165, 0, 144, 124,
- 165, 0, 4, 0, 166, 59, 231, 0, 59, 166,
- 76, 0, 50, 184, 166, 0, 166, 60, 99, 83,
+ 187, 164, 0, 144, 124, 164, 0, 4, 0, 72,
+ 0, 165, 59, 234, 0, 165, 60, 99, 83, 0,
+ 165, 60, 83, 0, 50, 187, 165, 0, 144, 124,
+ 165, 0, 4, 0, 166, 59, 234, 0, 59, 166,
+ 76, 0, 50, 187, 166, 0, 166, 60, 99, 83,
0, 166, 60, 83, 0, 144, 124, 166, 0, 3,
- 0, 0, 13, 97, 82, 168, 174, 78, 143, 0,
- 13, 82, 174, 78, 143, 0, 13, 97, 0, 0,
- 14, 97, 82, 169, 174, 78, 143, 0, 14, 82,
- 174, 78, 143, 0, 14, 97, 0, 0, 12, 97,
- 82, 170, 179, 173, 78, 143, 0, 0, 12, 82,
- 171, 179, 173, 78, 143, 0, 12, 97, 0, 0,
- 81, 0, 0, 81, 0, 175, 0, 175, 176, 0,
- 0, 175, 176, 77, 0, 175, 77, 0, 65, 59,
- 67, 76, 0, 132, 123, 177, 0, 132, 0, 183,
- 123, 177, 0, 183, 0, 1, 0, 236, 176, 0,
- 178, 0, 177, 81, 178, 0, 201, 202, 163, 143,
- 0, 201, 202, 163, 38, 107, 143, 0, 201, 202,
- 38, 107, 143, 0, 180, 0, 179, 81, 180, 0,
- 1, 0, 97, 0, 97, 36, 107, 0, 132, 182,
- 0, 183, 182, 0, 0, 185, 0, 7, 0, 183,
- 7, 0, 0, 184, 7, 0, 59, 185, 76, 0,
- 50, 184, 185, 0, 50, 184, 0, 185, 59, 224,
- 0, 185, 60, 99, 83, 0, 185, 60, 83, 0,
- 59, 224, 0, 60, 99, 83, 0, 60, 83, 0,
- 187, 0, 204, 0, 187, 204, 0, 187, 189, 0,
- 0, 186, 0, 1, 77, 0, 0, 0, 192, 0,
- 193, 0, 192, 193, 0, 32, 235, 77, 0, 196,
- 0, 1, 196, 0, 82, 0, 195, 78, 0, 195,
- 190, 191, 122, 188, 78, 0, 195, 190, 191, 1,
- 78, 0, 195, 190, 191, 186, 78, 0, 198, 203,
- 0, 198, 1, 0, 15, 59, 99, 76, 0, 0,
- 18, 200, 203, 17, 0, 0, 0, 201, 202, 206,
- 0, 201, 202, 217, 203, 0, 201, 202, 205, 0,
- 206, 0, 217, 0, 196, 0, 214, 0, 99, 77,
- 0, 0, 197, 16, 207, 203, 0, 197, 0, 197,
- 16, 1, 0, 0, 0, 17, 208, 59, 99, 76,
- 209, 203, 0, 199, 59, 99, 76, 77, 0, 199,
- 1, 0, 0, 0, 0, 19, 59, 219, 77, 210,
- 219, 77, 211, 219, 76, 212, 203, 0, 0, 20,
- 59, 99, 76, 213, 203, 0, 23, 77, 0, 24,
- 77, 0, 25, 77, 0, 25, 99, 77, 0, 27,
- 218, 59, 99, 76, 77, 0, 27, 218, 59, 99,
- 38, 220, 76, 77, 0, 27, 218, 59, 99, 38,
- 220, 38, 220, 76, 77, 0, 27, 218, 59, 99,
- 38, 220, 38, 220, 38, 223, 76, 77, 0, 26,
- 97, 77, 0, 26, 50, 99, 77, 0, 77, 0,
- 215, 0, 0, 19, 59, 113, 76, 216, 203, 0,
- 21, 107, 38, 0, 21, 107, 10, 107, 38, 0,
- 22, 38, 0, 97, 38, 0, 0, 7, 0, 0,
- 99, 0, 0, 221, 0, 222, 0, 221, 81, 222,
- 0, 9, 59, 99, 76, 0, 115, 0, 223, 81,
- 115, 0, 0, 225, 226, 0, 228, 76, 0, 0,
- 229, 77, 227, 226, 0, 1, 76, 0, 0, 10,
- 0, 229, 0, 229, 81, 10, 0, 230, 0, 229,
- 81, 230, 0, 126, 123, 165, 143, 0, 126, 123,
- 166, 143, 0, 126, 123, 182, 143, 0, 130, 123,
- 166, 143, 0, 130, 123, 182, 143, 0, 0, 232,
- 233, 0, 226, 0, 234, 76, 0, 3, 0, 234,
- 81, 3, 0, 97, 0, 235, 81, 97, 0, 31,
- 0, 241, 0, 239, 0, 240, 0, 251, 0, 261,
- 0, 63, 0, 97, 0, 238, 81, 97, 0, 73,
- 238, 77, 0, 74, 97, 97, 77, 0, 0, 0,
- 61, 97, 253, 82, 242, 255, 78, 243, 268, 63,
- 0, 0, 61, 97, 253, 244, 268, 63, 0, 0,
- 0, 61, 97, 38, 97, 253, 82, 245, 255, 78,
- 246, 268, 63, 0, 0, 61, 97, 38, 97, 253,
- 247, 268, 63, 0, 0, 62, 97, 82, 248, 255,
- 78, 0, 62, 97, 0, 0, 62, 97, 38, 97,
- 82, 249, 255, 78, 0, 62, 97, 38, 97, 0,
- 0, 61, 97, 59, 97, 76, 253, 250, 268, 63,
- 0, 62, 97, 59, 97, 76, 0, 0, 71, 97,
- 253, 252, 268, 63, 0, 0, 254, 0, 45, 238,
- 45, 0, 255, 256, 257, 0, 257, 0, 69, 0,
- 70, 0, 68, 0, 0, 257, 258, 77, 0, 257,
- 77, 0, 132, 123, 259, 0, 183, 123, 259, 0,
- 1, 0, 0, 260, 0, 259, 81, 260, 0, 163,
- 0, 163, 38, 107, 0, 38, 107, 0, 0, 0,
- 0, 48, 262, 278, 263, 279, 264, 194, 0, 0,
- 0, 0, 49, 265, 278, 266, 279, 267, 194, 0,
- 0, 0, 269, 270, 0, 273, 0, 89, 0, 270,
- 273, 0, 0, 270, 271, 89, 0, 77, 0, 1,
- 0, 0, 0, 48, 274, 278, 275, 272, 0, 0,
- 0, 49, 276, 278, 277, 272, 0, 59, 181, 76,
- 287, 0, 287, 0, 59, 181, 76, 288, 285, 0,
- 288, 285, 0, 0, 77, 280, 0, 0, 281, 0,
- 282, 0, 189, 0, 281, 282, 0, 282, 189, 0,
- 126, 123, 283, 77, 0, 126, 77, 0, 130, 77,
- 0, 284, 0, 283, 81, 284, 0, 165, 143, 0,
- 166, 143, 0, 182, 143, 0, 0, 81, 10, 0,
- 0, 81, 286, 228, 0, 289, 0, 291, 0, 288,
- 291, 0, 3, 0, 4, 0, 72, 0, 290, 0,
- 12, 0, 13, 0, 14, 0, 15, 0, 16, 0,
- 17, 0, 18, 0, 19, 0, 20, 0, 21, 0,
- 22, 0, 23, 0, 24, 0, 25, 0, 26, 0,
- 27, 0, 11, 0, 28, 0, 29, 0, 6, 0,
- 7, 0, 289, 38, 59, 181, 76, 97, 0, 289,
- 38, 97, 0, 38, 59, 181, 76, 97, 0, 38,
- 97, 0, 289, 0, 293, 0, 295, 0, 293, 295,
- 0, 101, 0, 289, 38, 294, 0, 38, 294, 0,
- 99, 0, 67, 0, 0, 0, 60, 298, 296, 299,
- 292, 83, 0, 289, 0, 301, 0, 302, 0, 301,
- 302, 0, 289, 38, 0, 38, 0, 64, 59, 300,
- 76, 0, 71, 59, 97, 76, 0, 66, 59, 181,
- 76, 0
+ 0, 13, 0, 13, 144, 0, 14, 0, 14, 144,
+ 0, 12, 0, 12, 144, 0, 0, 167, 97, 82,
+ 171, 177, 78, 143, 0, 167, 82, 177, 78, 143,
+ 0, 167, 97, 0, 0, 168, 97, 82, 172, 177,
+ 78, 143, 0, 168, 82, 177, 78, 143, 0, 168,
+ 97, 0, 0, 169, 97, 82, 173, 182, 176, 78,
+ 143, 0, 0, 169, 82, 174, 182, 176, 78, 143,
+ 0, 169, 97, 0, 0, 81, 0, 0, 81, 0,
+ 178, 0, 178, 179, 0, 0, 178, 179, 77, 0,
+ 178, 77, 0, 65, 59, 67, 76, 0, 132, 123,
+ 180, 0, 132, 0, 186, 123, 180, 0, 186, 0,
+ 1, 0, 239, 179, 0, 181, 0, 180, 81, 181,
+ 0, 204, 205, 163, 143, 0, 204, 205, 163, 38,
+ 107, 143, 0, 204, 205, 38, 107, 143, 0, 183,
+ 0, 182, 81, 183, 0, 1, 0, 97, 0, 97,
+ 36, 107, 0, 132, 185, 0, 186, 185, 0, 0,
+ 188, 0, 7, 0, 186, 7, 0, 0, 187, 7,
+ 0, 59, 188, 76, 0, 50, 187, 188, 0, 50,
+ 187, 0, 188, 59, 227, 0, 188, 60, 99, 83,
+ 0, 188, 60, 83, 0, 59, 227, 0, 60, 99,
+ 83, 0, 60, 83, 0, 190, 0, 207, 0, 190,
+ 207, 0, 190, 192, 0, 0, 189, 0, 1, 77,
+ 0, 0, 0, 195, 0, 196, 0, 195, 196, 0,
+ 32, 238, 77, 0, 199, 0, 1, 199, 0, 82,
+ 0, 198, 78, 0, 198, 193, 194, 122, 191, 78,
+ 0, 198, 193, 194, 1, 78, 0, 198, 193, 194,
+ 189, 78, 0, 201, 206, 0, 201, 1, 0, 15,
+ 59, 99, 76, 0, 0, 18, 203, 206, 17, 0,
+ 0, 0, 204, 205, 209, 0, 204, 205, 220, 206,
+ 0, 204, 205, 208, 0, 209, 0, 220, 0, 199,
+ 0, 217, 0, 99, 77, 0, 0, 200, 16, 210,
+ 206, 0, 200, 0, 200, 16, 1, 0, 0, 0,
+ 17, 211, 59, 99, 76, 212, 206, 0, 202, 59,
+ 99, 76, 77, 0, 202, 1, 0, 0, 0, 0,
+ 19, 59, 222, 77, 213, 222, 77, 214, 222, 76,
+ 215, 206, 0, 0, 20, 59, 99, 76, 216, 206,
+ 0, 23, 77, 0, 24, 77, 0, 25, 77, 0,
+ 25, 99, 77, 0, 27, 221, 59, 99, 76, 77,
+ 0, 27, 221, 59, 99, 38, 223, 76, 77, 0,
+ 27, 221, 59, 99, 38, 223, 38, 223, 76, 77,
+ 0, 27, 221, 59, 99, 38, 223, 38, 223, 38,
+ 226, 76, 77, 0, 26, 97, 77, 0, 26, 50,
+ 99, 77, 0, 77, 0, 218, 0, 0, 19, 59,
+ 113, 76, 219, 206, 0, 21, 107, 38, 0, 21,
+ 107, 10, 107, 38, 0, 22, 38, 0, 97, 38,
+ 0, 0, 7, 0, 0, 99, 0, 0, 224, 0,
+ 225, 0, 224, 81, 225, 0, 9, 59, 99, 76,
+ 0, 115, 0, 226, 81, 115, 0, 0, 228, 229,
+ 0, 231, 76, 0, 0, 232, 77, 230, 229, 0,
+ 1, 76, 0, 0, 10, 0, 232, 0, 232, 81,
+ 10, 0, 233, 0, 232, 81, 233, 0, 126, 123,
+ 165, 143, 0, 126, 123, 166, 143, 0, 126, 123,
+ 185, 143, 0, 130, 123, 166, 143, 0, 130, 123,
+ 185, 143, 0, 0, 235, 236, 0, 229, 0, 237,
+ 76, 0, 3, 0, 237, 81, 3, 0, 97, 0,
+ 238, 81, 97, 0, 31, 0, 244, 0, 242, 0,
+ 243, 0, 254, 0, 264, 0, 63, 0, 97, 0,
+ 241, 81, 97, 0, 73, 241, 77, 0, 74, 97,
+ 97, 77, 0, 0, 0, 61, 97, 256, 82, 245,
+ 258, 78, 246, 271, 63, 0, 0, 61, 97, 256,
+ 247, 271, 63, 0, 0, 0, 61, 97, 38, 97,
+ 256, 82, 248, 258, 78, 249, 271, 63, 0, 0,
+ 61, 97, 38, 97, 256, 250, 271, 63, 0, 0,
+ 62, 97, 82, 251, 258, 78, 0, 62, 97, 0,
+ 0, 62, 97, 38, 97, 82, 252, 258, 78, 0,
+ 62, 97, 38, 97, 0, 0, 61, 97, 59, 97,
+ 76, 256, 253, 271, 63, 0, 62, 97, 59, 97,
+ 76, 0, 0, 71, 97, 256, 255, 271, 63, 0,
+ 0, 257, 0, 45, 241, 45, 0, 258, 259, 260,
+ 0, 260, 0, 69, 0, 70, 0, 68, 0, 0,
+ 260, 261, 77, 0, 260, 77, 0, 132, 123, 262,
+ 0, 186, 123, 262, 0, 1, 0, 0, 263, 0,
+ 262, 81, 263, 0, 163, 0, 163, 38, 107, 0,
+ 38, 107, 0, 0, 0, 0, 48, 265, 281, 266,
+ 282, 267, 197, 0, 0, 0, 0, 49, 268, 281,
+ 269, 282, 270, 197, 0, 0, 0, 272, 273, 0,
+ 276, 0, 89, 0, 273, 276, 0, 0, 273, 274,
+ 89, 0, 77, 0, 1, 0, 0, 0, 48, 277,
+ 281, 278, 275, 0, 0, 0, 49, 279, 281, 280,
+ 275, 0, 59, 184, 76, 290, 0, 290, 0, 59,
+ 184, 76, 291, 288, 0, 291, 288, 0, 0, 77,
+ 283, 0, 0, 284, 0, 285, 0, 192, 0, 284,
+ 285, 0, 285, 192, 0, 126, 123, 286, 77, 0,
+ 126, 77, 0, 130, 77, 0, 287, 0, 286, 81,
+ 287, 0, 165, 143, 0, 166, 143, 0, 185, 143,
+ 0, 0, 81, 10, 0, 0, 81, 289, 231, 0,
+ 292, 0, 294, 0, 291, 294, 0, 3, 0, 4,
+ 0, 72, 0, 293, 0, 12, 0, 13, 0, 14,
+ 0, 15, 0, 16, 0, 17, 0, 18, 0, 19,
+ 0, 20, 0, 21, 0, 22, 0, 23, 0, 24,
+ 0, 25, 0, 26, 0, 27, 0, 11, 0, 28,
+ 0, 29, 0, 6, 0, 7, 0, 292, 38, 59,
+ 184, 76, 97, 0, 292, 38, 97, 0, 38, 59,
+ 184, 76, 97, 0, 38, 97, 0, 292, 0, 296,
+ 0, 298, 0, 296, 298, 0, 101, 0, 292, 38,
+ 297, 0, 38, 297, 0, 99, 0, 67, 0, 0,
+ 0, 60, 301, 299, 302, 295, 83, 0, 292, 0,
+ 304, 0, 305, 0, 304, 305, 0, 292, 38, 0,
+ 38, 0, 64, 59, 303, 76, 0, 71, 59, 97,
+ 76, 0, 66, 59, 184, 76, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 232, 237, 251, 253, 253, 254, 256, 258, 259, 260,
- 268, 272, 283, 288, 293, 295, 297, 298, 299, 304,
- 311, 313, 318, 323, 329, 331, 336, 341, 347, 349,
- 354, 361, 363, 364, 365, 368, 370, 372, 374, 376,
- 378, 380, 384, 388, 391, 394, 397, 401, 403, 406,
- 409, 413, 441, 447, 450, 453, 456, 458, 462, 466,
- 470, 472, 475, 479, 506, 508, 510, 512, 514, 516,
- 518, 520, 522, 524, 526, 528, 530, 532, 536, 538,
- 542, 544, 547, 551, 553, 560, 563, 566, 572, 732,
- 733, 735, 741, 743, 757, 780, 782, 784, 796, 810,
- 812, 814, 816, 818, 820, 822, 827, 829, 835, 837,
- 841, 843, 844, 854, 859, 861, 862, 863, 870, 876,
- 881, 884, 892, 897, 899, 900, 901, 908, 919, 923,
- 929, 934, 939, 944, 946, 948, 957, 960, 964, 966,
- 968, 973, 977, 980, 984, 987, 989, 1001, 1004, 1006,
- 1008, 1012, 1016, 1018, 1021, 1034, 1037, 1041, 1043, 1051,
- 1052, 1053, 1057, 1059, 1064, 1066, 1068, 1074, 1075, 1076,
- 1079, 1081, 1084, 1086, 1089, 1092, 1098, 1105, 1107, 1114,
- 1121, 1124, 1131, 1134, 1138, 1141, 1145, 1150, 1153, 1157,
- 1160, 1162, 1164, 1166, 1173, 1175, 1176, 1177, 1182, 1184,
- 1189, 1197, 1202, 1206, 1209, 1211, 1216, 1219, 1221, 1223,
- 1227, 1230, 1230, 1233, 1235, 1246, 1254, 1258, 1269, 1277,
- 1284, 1286, 1291, 1294, 1299, 1301, 1303, 1310, 1312, 1313,
- 1321, 1327, 1329, 1331, 1338, 1340, 1346, 1352, 1354, 1356,
- 1358, 1365, 1367, 1370, 1375, 1377, 1381, 1383, 1385, 1387,
- 1391, 1393, 1396, 1399, 1402, 1405, 1409, 1411, 1414, 1416,
- 1420, 1423, 1428, 1430, 1432, 1436, 1460, 1467, 1472, 1478,
- 1483, 1485, 1490, 1492, 1496, 1500, 1504, 1514, 1516, 1521,
- 1526, 1529, 1533, 1536, 1540, 1543, 1546, 1549, 1553, 1556,
- 1560, 1564, 1566, 1568, 1570, 1572, 1574, 1576, 1578, 1588,
- 1596, 1598, 1600, 1604, 1606, 1609, 1612, 1625, 1627, 1632,
- 1634, 1637, 1651, 1654, 1657, 1659, 1661, 1669, 1677, 1688,
- 1693, 1696, 1710, 1719, 1723, 1727, 1731, 1737, 1741, 1746,
- 1749, 1754, 1757, 1758, 1775, 1780, 1783, 1795, 1797, 1807,
- 1817, 1818, 1826, 1829, 1841, 1845, 1862, 1872, 1881, 1886,
- 1891, 1896, 1900, 1904, 1915, 1922, 1929, 1936, 1947, 1953,
- 1956, 1961, 1984, 2018, 2049, 2080, 2095, 2106, 2110, 2114,
- 2117, 2122, 2124, 2127, 2129, 2133, 2138, 2141, 2147, 2152,
- 2157, 2159, 2168, 2169, 2175, 2177, 2187, 2189, 2193, 2196,
- 2202, 2212, 2221, 2230, 2240, 2254, 2259, 2264, 2266, 2275,
- 2278, 2283, 2286, 2290, 2298, 2300, 2301, 2302, 2303, 2304,
- 2318, 2321, 2325, 2331, 2337, 2344, 2349, 2355, 2362, 2368,
- 2374, 2379, 2385, 2392, 2398, 2404, 2410, 2418, 2424, 2430,
- 2438, 2445, 2451, 2460, 2467, 2475, 2480, 2483, 2493, 2495,
- 2498, 2500, 2501, 2504, 2509, 2510, 2527, 2534, 2540, 2544,
- 2547, 2548, 2551, 2559, 2565, 2574, 2584, 2591, 2595, 2600,
- 2609, 2616, 2620, 2630, 2632, 2633, 2635, 2637, 2638, 2639,
- 2640, 2642, 2644, 2647, 2655, 2662, 2662, 2669, 2675, 2677,
- 2683, 2688, 2693, 2702, 2704, 2710, 2712, 2715, 2717, 2718,
- 2719, 2722, 2728, 2730, 2734, 2737, 2744, 2750, 2755, 2762,
- 2767, 2772, 2777, 2784, 2788, 2791, 2797, 2799, 2800, 2801,
- 2804, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814,
- 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824,
- 2824, 2827, 2833, 2838, 2843, 2849, 2851, 2854, 2856, 2863,
- 2875, 2880, 2886, 2888, 2894, 2898, 2899, 2905, 2907, 2910,
- 2912, 2918, 2923, 2929, 2936, 2945
+ 233, 238, 252, 254, 254, 255, 257, 259, 260, 261,
+ 269, 273, 284, 289, 294, 296, 298, 299, 300, 305,
+ 312, 314, 319, 324, 330, 332, 337, 342, 348, 350,
+ 355, 362, 364, 365, 366, 369, 371, 373, 375, 377,
+ 379, 381, 385, 389, 392, 395, 398, 402, 404, 407,
+ 410, 414, 442, 448, 451, 454, 457, 459, 463, 467,
+ 471, 473, 476, 480, 507, 509, 511, 513, 515, 517,
+ 519, 521, 523, 525, 527, 529, 531, 533, 537, 539,
+ 543, 545, 548, 552, 554, 561, 564, 567, 573, 733,
+ 734, 736, 742, 744, 758, 781, 783, 785, 797, 811,
+ 813, 815, 817, 819, 821, 823, 828, 830, 836, 838,
+ 842, 844, 845, 855, 860, 862, 863, 864, 871, 877,
+ 882, 885, 893, 898, 900, 901, 902, 909, 920, 924,
+ 930, 935, 940, 945, 947, 949, 958, 961, 965, 967,
+ 969, 974, 978, 981, 985, 988, 990, 1002, 1005, 1007,
+ 1009, 1013, 1017, 1019, 1022, 1035, 1038, 1042, 1044, 1052,
+ 1053, 1054, 1058, 1060, 1065, 1067, 1069, 1075, 1076, 1077,
+ 1080, 1082, 1085, 1087, 1090, 1093, 1099, 1106, 1108, 1115,
+ 1122, 1125, 1132, 1135, 1139, 1142, 1146, 1151, 1154, 1158,
+ 1161, 1163, 1165, 1167, 1174, 1176, 1177, 1178, 1183, 1185,
+ 1190, 1198, 1203, 1207, 1210, 1212, 1217, 1220, 1222, 1224,
+ 1228, 1231, 1231, 1234, 1236, 1247, 1255, 1259, 1270, 1278,
+ 1285, 1287, 1292, 1295, 1300, 1302, 1304, 1311, 1313, 1314,
+ 1322, 1328, 1330, 1332, 1339, 1341, 1347, 1353, 1355, 1357,
+ 1359, 1366, 1368, 1371, 1374, 1378, 1381, 1385, 1388, 1392,
+ 1397, 1399, 1403, 1405, 1407, 1409, 1413, 1415, 1418, 1421,
+ 1424, 1427, 1431, 1433, 1436, 1438, 1442, 1445, 1450, 1452,
+ 1454, 1458, 1482, 1489, 1494, 1500, 1505, 1507, 1512, 1514,
+ 1518, 1522, 1526, 1536, 1538, 1543, 1548, 1551, 1555, 1558,
+ 1562, 1565, 1568, 1571, 1575, 1578, 1582, 1586, 1588, 1590,
+ 1592, 1594, 1596, 1598, 1600, 1610, 1618, 1620, 1622, 1626,
+ 1628, 1631, 1634, 1647, 1649, 1654, 1656, 1659, 1673, 1676,
+ 1679, 1681, 1683, 1691, 1699, 1710, 1715, 1718, 1732, 1741,
+ 1745, 1749, 1753, 1759, 1763, 1768, 1771, 1776, 1779, 1780,
+ 1797, 1802, 1805, 1817, 1819, 1829, 1839, 1840, 1848, 1851,
+ 1863, 1867, 1884, 1894, 1903, 1908, 1913, 1918, 1922, 1926,
+ 1937, 1944, 1951, 1958, 1969, 1975, 1978, 1983, 2006, 2040,
+ 2071, 2102, 2117, 2128, 2132, 2136, 2139, 2144, 2146, 2149,
+ 2151, 2155, 2160, 2163, 2169, 2174, 2179, 2181, 2190, 2191,
+ 2197, 2199, 2209, 2211, 2215, 2218, 2224, 2234, 2243, 2252,
+ 2262, 2276, 2281, 2286, 2288, 2297, 2300, 2305, 2308, 2312,
+ 2320, 2322, 2323, 2324, 2325, 2326, 2340, 2343, 2347, 2353,
+ 2359, 2366, 2371, 2377, 2384, 2390, 2396, 2401, 2407, 2414,
+ 2420, 2426, 2432, 2440, 2446, 2452, 2460, 2467, 2473, 2482,
+ 2489, 2497, 2502, 2505, 2515, 2517, 2520, 2522, 2523, 2526,
+ 2531, 2532, 2549, 2556, 2562, 2566, 2569, 2570, 2573, 2581,
+ 2587, 2596, 2606, 2613, 2617, 2622, 2631, 2638, 2642, 2652,
+ 2654, 2655, 2657, 2659, 2660, 2661, 2662, 2664, 2666, 2669,
+ 2677, 2684, 2684, 2691, 2697, 2699, 2705, 2710, 2715, 2724,
+ 2726, 2732, 2734, 2737, 2739, 2740, 2741, 2744, 2750, 2752,
+ 2756, 2759, 2766, 2772, 2777, 2784, 2789, 2794, 2799, 2806,
+ 2810, 2813, 2819, 2821, 2822, 2823, 2826, 2828, 2829, 2830,
+ 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840,
+ 2841, 2842, 2843, 2844, 2845, 2846, 2846, 2849, 2855, 2860,
+ 2865, 2871, 2873, 2876, 2878, 2885, 2897, 2902, 2908, 2910,
+ 2916, 2920, 2921, 2927, 2929, 2932, 2934, 2940, 2945, 2951,
+ 2958, 2967
};
#endif
@@ -511,21 +514,22 @@ static const char * const yytname[] = { "$","error","$undefined.","IDENTIFIER"
"attribute_list","attrib","any_word","init","@18","initlist_maybe_comma","initlist1",
"initelt","@19","@20","@21","nested_function","@22","@23","notype_nested_function",
"@24","@25","declarator","after_type_declarator","parm_declarator","notype_declarator",
-"structsp","@26","@27","@28","@29","maybecomma","maybecomma_warn","component_decl_list",
-"component_decl_list2","component_decl","components","component_declarator",
-"enumlist","enumerator","typename","absdcl","nonempty_type_quals","type_quals",
-"absdcl1","stmts","lineno_stmt_or_labels","xstmts","errstmt","pushlevel","maybe_label_decls",
-"label_decls","label_decl","compstmt_or_error","compstmt_start","compstmt","simple_if",
-"if_prefix","do_stmt_start","@30","save_filename","save_lineno","lineno_labeled_stmt",
-"lineno_stmt_or_label","stmt_or_label","stmt","@31","@32","@33","@34","@35",
-"@36","@37","all_iter_stmt","all_iter_stmt_simple","@38","label","maybe_type_qual",
-"xexpr","asm_operands","nonnull_asm_operands","asm_operand","asm_clobbers","parmlist",
-"@39","parmlist_1","@40","parmlist_2","parms","parm","parmlist_or_identifiers",
-"@41","parmlist_or_identifiers_1","identifiers","identifiers_or_typenames","extension",
-"objcdef","identifier_list","classdecl","aliasdecl","classdef","@42","@43","@44",
-"@45","@46","@47","@48","@49","@50","protocoldef","@51","protocolrefs","non_empty_protocolrefs",
-"ivar_decl_list","visibility_spec","ivar_decls","ivar_decl","ivars","ivar_declarator",
-"methoddef","@52","@53","@54","@55","@56","@57","methodprotolist","@58","methodprotolist2",
+"struct_head","union_head","enum_head","structsp","@26","@27","@28","@29","maybecomma",
+"maybecomma_warn","component_decl_list","component_decl_list2","component_decl",
+"components","component_declarator","enumlist","enumerator","typename","absdcl",
+"nonempty_type_quals","type_quals","absdcl1","stmts","lineno_stmt_or_labels",
+"xstmts","errstmt","pushlevel","maybe_label_decls","label_decls","label_decl",
+"compstmt_or_error","compstmt_start","compstmt","simple_if","if_prefix","do_stmt_start",
+"@30","save_filename","save_lineno","lineno_labeled_stmt","lineno_stmt_or_label",
+"stmt_or_label","stmt","@31","@32","@33","@34","@35","@36","@37","all_iter_stmt",
+"all_iter_stmt_simple","@38","label","maybe_type_qual","xexpr","asm_operands",
+"nonnull_asm_operands","asm_operand","asm_clobbers","parmlist","@39","parmlist_1",
+"@40","parmlist_2","parms","parm","parmlist_or_identifiers","@41","parmlist_or_identifiers_1",
+"identifiers","identifiers_or_typenames","extension","objcdef","identifier_list",
+"classdecl","aliasdecl","classdef","@42","@43","@44","@45","@46","@47","@48",
+"@49","@50","protocoldef","@51","protocolrefs","non_empty_protocolrefs","ivar_decl_list",
+"visibility_spec","ivar_decls","ivar_decl","ivars","ivar_declarator","methoddef",
+"@52","@53","@54","@55","@56","@57","methodprotolist","@58","methodprotolist2",
"@59","semi_or_error","methodproto","@60","@61","@62","@63","methoddecl","optarglist",
"myxdecls","mydecls","mydecl","myparms","myparm","optparmlist","@64","unaryselector",
"keywordselector","selector","reservedwords","keyworddecl","messageargs","keywordarglist",
@@ -559,38 +563,39 @@ static const short yyr1[] = { 0,
155, 153, 156, 153, 158, 159, 157, 161, 162, 160,
163, 163, 164, 164, 164, 164, 164, 164, 164, 164,
165, 165, 165, 165, 165, 165, 166, 166, 166, 166,
- 166, 166, 166, 168, 167, 167, 167, 169, 167, 167,
- 167, 170, 167, 171, 167, 167, 172, 172, 173, 173,
- 174, 174, 175, 175, 175, 175, 176, 176, 176, 176,
- 176, 176, 177, 177, 178, 178, 178, 179, 179, 179,
- 180, 180, 181, 181, 182, 182, 183, 183, 184, 184,
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 186,
- 187, 187, 187, 188, 188, 189, 190, 191, 191, 192,
- 192, 193, 194, 194, 195, 196, 196, 196, 196, 197,
- 197, 198, 200, 199, 201, 202, 203, 203, 204, 205,
- 205, 206, 206, 206, 207, 206, 206, 206, 208, 209,
- 206, 206, 206, 210, 211, 212, 206, 213, 206, 206,
- 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
- 214, 216, 215, 217, 217, 217, 217, 218, 218, 219,
- 219, 220, 220, 221, 221, 222, 223, 223, 225, 224,
- 226, 227, 226, 226, 228, 228, 228, 228, 229, 229,
- 230, 230, 230, 230, 230, 232, 231, 233, 233, 234,
- 234, 235, 235, 236, 237, 237, 237, 237, 237, 237,
- 238, 238, 239, 240, 242, 243, 241, 244, 241, 245,
- 246, 241, 247, 241, 248, 241, 241, 249, 241, 241,
- 250, 241, 241, 252, 251, 253, 253, 254, 255, 255,
- 256, 256, 256, 257, 257, 257, 258, 258, 258, 259,
- 259, 259, 260, 260, 260, 262, 263, 264, 261, 265,
- 266, 267, 261, 268, 269, 268, 270, 270, 270, 271,
- 270, 272, 272, 274, 275, 273, 276, 277, 273, 278,
- 278, 278, 278, 279, 279, 280, 280, 281, 281, 281,
- 281, 282, 282, 282, 283, 283, 284, 284, 284, 285,
- 285, 286, 285, 287, 288, 288, 289, 289, 289, 289,
- 290, 290, 290, 290, 290, 290, 290, 290, 290, 290,
- 290, 290, 290, 290, 290, 290, 290, 290, 290, 290,
- 290, 291, 291, 291, 291, 292, 292, 293, 293, 294,
- 295, 295, 296, 296, 298, 299, 297, 300, 300, 301,
- 301, 302, 302, 303, 304, 305
+ 166, 166, 166, 167, 167, 168, 168, 169, 169, 171,
+ 170, 170, 170, 172, 170, 170, 170, 173, 170, 174,
+ 170, 170, 175, 175, 176, 176, 177, 177, 178, 178,
+ 178, 178, 179, 179, 179, 179, 179, 179, 180, 180,
+ 181, 181, 181, 182, 182, 182, 183, 183, 184, 184,
+ 185, 185, 186, 186, 187, 187, 188, 188, 188, 188,
+ 188, 188, 188, 188, 188, 189, 190, 190, 190, 191,
+ 191, 192, 193, 194, 194, 195, 195, 196, 197, 197,
+ 198, 199, 199, 199, 199, 200, 200, 201, 203, 202,
+ 204, 205, 206, 206, 207, 208, 208, 209, 209, 209,
+ 210, 209, 209, 209, 211, 212, 209, 209, 209, 213,
+ 214, 215, 209, 216, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209, 209, 209, 209, 217, 219, 218, 220,
+ 220, 220, 220, 221, 221, 222, 222, 223, 223, 224,
+ 224, 225, 226, 226, 228, 227, 229, 230, 229, 229,
+ 231, 231, 231, 231, 232, 232, 233, 233, 233, 233,
+ 233, 235, 234, 236, 236, 237, 237, 238, 238, 239,
+ 240, 240, 240, 240, 240, 240, 241, 241, 242, 243,
+ 245, 246, 244, 247, 244, 248, 249, 244, 250, 244,
+ 251, 244, 244, 252, 244, 244, 253, 244, 244, 255,
+ 254, 256, 256, 257, 258, 258, 259, 259, 259, 260,
+ 260, 260, 261, 261, 261, 262, 262, 262, 263, 263,
+ 263, 265, 266, 267, 264, 268, 269, 270, 264, 271,
+ 272, 271, 273, 273, 273, 274, 273, 275, 275, 277,
+ 278, 276, 279, 280, 276, 281, 281, 281, 281, 282,
+ 282, 283, 283, 284, 284, 284, 284, 285, 285, 285,
+ 286, 286, 287, 287, 287, 288, 288, 289, 288, 290,
+ 291, 291, 292, 292, 292, 292, 293, 293, 293, 293,
+ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293,
+ 293, 293, 293, 293, 293, 293, 293, 294, 294, 294,
+ 294, 295, 295, 296, 296, 297, 298, 298, 299, 299,
+ 301, 302, 300, 303, 303, 304, 304, 305, 305, 306,
+ 307, 308
};
static const short yyr2[] = { 0,
@@ -618,1013 +623,1032 @@ static const short yyr2[] = { 0,
0, 4, 0, 5, 0, 0, 5, 0, 0, 5,
1, 1, 3, 3, 4, 3, 3, 3, 1, 1,
3, 4, 3, 3, 3, 1, 3, 3, 3, 4,
- 3, 3, 1, 0, 7, 5, 2, 0, 7, 5,
- 2, 0, 8, 0, 7, 2, 0, 1, 0, 1,
- 1, 2, 0, 3, 2, 4, 3, 1, 3, 1,
- 1, 2, 1, 3, 4, 6, 5, 1, 3, 1,
- 1, 3, 2, 2, 0, 1, 1, 2, 0, 2,
- 3, 3, 2, 3, 4, 3, 2, 3, 2, 1,
- 1, 2, 2, 0, 1, 2, 0, 0, 1, 1,
- 2, 3, 1, 2, 1, 2, 6, 5, 5, 2,
- 2, 4, 0, 4, 0, 0, 3, 4, 3, 1,
- 1, 1, 1, 2, 0, 4, 1, 3, 0, 0,
- 7, 5, 2, 0, 0, 0, 12, 0, 6, 2,
- 2, 2, 3, 6, 8, 10, 12, 3, 4, 1,
- 1, 0, 6, 3, 5, 2, 2, 0, 1, 0,
- 1, 0, 1, 1, 3, 4, 1, 3, 0, 2,
- 2, 0, 4, 2, 0, 1, 1, 3, 1, 3,
- 4, 4, 4, 4, 4, 0, 2, 1, 2, 1,
- 3, 1, 3, 1, 1, 1, 1, 1, 1, 1,
- 1, 3, 3, 4, 0, 0, 10, 0, 6, 0,
- 0, 12, 0, 8, 0, 6, 2, 0, 8, 4,
- 0, 9, 5, 0, 6, 0, 1, 3, 3, 1,
- 1, 1, 1, 0, 3, 2, 3, 3, 1, 0,
- 1, 3, 1, 3, 2, 0, 0, 0, 7, 0,
- 0, 0, 7, 0, 0, 2, 1, 1, 2, 0,
- 3, 1, 1, 0, 0, 5, 0, 0, 5, 4,
- 1, 5, 2, 0, 2, 0, 1, 1, 1, 2,
- 2, 4, 2, 2, 1, 3, 2, 2, 2, 0,
- 2, 0, 3, 1, 1, 2, 1, 1, 1, 1,
+ 3, 3, 1, 1, 2, 1, 2, 1, 2, 0,
+ 7, 5, 2, 0, 7, 5, 2, 0, 8, 0,
+ 7, 2, 0, 1, 0, 1, 1, 2, 0, 3,
+ 2, 4, 3, 1, 3, 1, 1, 2, 1, 3,
+ 4, 6, 5, 1, 3, 1, 1, 3, 2, 2,
+ 0, 1, 1, 2, 0, 2, 3, 3, 2, 3,
+ 4, 3, 2, 3, 2, 1, 1, 2, 2, 0,
+ 1, 2, 0, 0, 1, 1, 2, 3, 1, 2,
+ 1, 2, 6, 5, 5, 2, 2, 4, 0, 4,
+ 0, 0, 3, 4, 3, 1, 1, 1, 1, 2,
+ 0, 4, 1, 3, 0, 0, 7, 5, 2, 0,
+ 0, 0, 12, 0, 6, 2, 2, 2, 3, 6,
+ 8, 10, 12, 3, 4, 1, 1, 0, 6, 3,
+ 5, 2, 2, 0, 1, 0, 1, 0, 1, 1,
+ 3, 4, 1, 3, 0, 2, 2, 0, 4, 2,
+ 0, 1, 1, 3, 1, 3, 4, 4, 4, 4,
+ 4, 0, 2, 1, 2, 1, 3, 1, 3, 1,
+ 1, 1, 1, 1, 1, 1, 1, 3, 3, 4,
+ 0, 0, 10, 0, 6, 0, 0, 12, 0, 8,
+ 0, 6, 2, 0, 8, 4, 0, 9, 5, 0,
+ 6, 0, 1, 3, 3, 1, 1, 1, 1, 0,
+ 3, 2, 3, 3, 1, 0, 1, 3, 1, 3,
+ 2, 0, 0, 0, 7, 0, 0, 0, 7, 0,
+ 0, 2, 1, 1, 2, 0, 3, 1, 1, 0,
+ 0, 5, 0, 0, 5, 4, 1, 5, 2, 0,
+ 2, 0, 1, 1, 1, 2, 2, 4, 2, 2,
+ 1, 3, 2, 2, 2, 0, 2, 0, 3, 1,
+ 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 6, 3, 5, 2, 1, 1, 1, 2, 1,
- 3, 2, 1, 1, 0, 0, 6, 1, 1, 1,
- 2, 2, 1, 4, 4, 4
+ 1, 1, 1, 1, 1, 1, 1, 6, 3, 5,
+ 2, 1, 1, 1, 2, 1, 3, 2, 1, 1,
+ 0, 0, 6, 1, 1, 1, 2, 2, 1, 4,
+ 4, 4
};
static const short yydefact[] = { 3,
- 5, 0, 0, 0, 162, 153, 160, 152, 0, 0,
- 0, 0, 0, 0, 404, 0, 456, 460, 0, 0,
- 410, 436, 0, 436, 0, 0, 19, 4, 8, 7,
- 0, 128, 128, 148, 139, 149, 185, 161, 0, 9,
- 406, 407, 405, 408, 165, 409, 6, 17, 18, 32,
- 33, 35, 34, 254, 256, 263, 247, 263, 251, 0,
- 0, 0, 411, 0, 0, 0, 436, 427, 163, 437,
- 436, 164, 0, 0, 243, 289, 0, 0, 173, 129,
+ 5, 0, 0, 0, 162, 153, 160, 152, 248, 244,
+ 246, 0, 0, 0, 410, 0, 462, 466, 0, 0,
+ 416, 442, 0, 442, 0, 0, 19, 4, 8, 7,
+ 0, 128, 128, 148, 139, 149, 185, 0, 0, 0,
+ 161, 0, 9, 412, 413, 411, 414, 165, 415, 6,
+ 17, 18, 249, 245, 247, 0, 0, 0, 32, 33,
+ 35, 34, 417, 0, 0, 0, 442, 433, 163, 443,
+ 442, 164, 0, 0, 243, 295, 0, 0, 173, 129,
0, 16, 0, 15, 0, 150, 139, 151, 155, 154,
- 137, 186, 11, 0, 252, 0, 0, 0, 244, 0,
- 248, 89, 90, 107, 59, 60, 0, 0, 0, 36,
- 38, 37, 0, 39, 40, 0, 545, 0, 0, 0,
- 109, 41, 42, 0, 0, 43, 61, 0, 0, 65,
- 46, 48, 91, 106, 0, 102, 103, 104, 105, 287,
- 0, 285, 158, 0, 285, 190, 438, 0, 507, 508,
- 530, 531, 527, 511, 512, 513, 514, 515, 516, 517,
- 518, 519, 520, 521, 522, 523, 524, 525, 526, 528,
- 529, 0, 0, 509, 457, 481, 500, 504, 510, 505,
- 461, 0, 0, 418, 0, 0, 425, 434, 413, 0,
- 0, 0, 12, 0, 0, 31, 0, 396, 0, 0,
- 183, 229, 289, 0, 230, 0, 171, 129, 0, 221,
- 222, 0, 0, 138, 141, 168, 169, 140, 142, 170,
- 280, 281, 259, 278, 0, 0, 183, 271, 265, 128,
- 262, 128, 0, 263, 183, 263, 57, 58, 52, 49,
+ 137, 186, 269, 253, 269, 257, 260, 262, 11, 89,
+ 90, 107, 59, 60, 0, 0, 0, 36, 38, 37,
+ 0, 39, 40, 0, 551, 0, 0, 0, 109, 41,
+ 42, 0, 0, 43, 61, 0, 0, 65, 46, 48,
+ 91, 106, 0, 102, 103, 104, 105, 293, 0, 291,
+ 158, 0, 291, 190, 444, 0, 513, 514, 536, 537,
+ 533, 517, 518, 519, 520, 521, 522, 523, 524, 525,
+ 526, 527, 528, 529, 530, 531, 532, 534, 535, 0,
+ 0, 515, 463, 487, 506, 510, 516, 511, 467, 0,
+ 0, 424, 0, 0, 431, 440, 419, 0, 0, 0,
+ 12, 0, 0, 31, 0, 402, 0, 0, 183, 229,
+ 295, 0, 230, 0, 171, 129, 0, 221, 222, 0,
+ 0, 138, 141, 168, 169, 140, 142, 170, 0, 0,
+ 0, 250, 0, 254, 0, 258, 57, 58, 52, 49,
0, 0, 0, 0, 0, 0, 0, 0, 51, 0,
0, 0, 53, 0, 55, 0, 0, 82, 80, 78,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 100, 101, 0, 0, 44, 0, 108, 110,
- 50, 166, 289, 379, 0, 283, 286, 156, 167, 288,
- 158, 284, 196, 197, 198, 195, 0, 188, 191, 412,
- 0, 535, 0, 484, 502, 483, 0, 506, 0, 484,
- 436, 0, 415, 465, 430, 0, 444, 465, 414, 290,
+ 50, 166, 295, 385, 0, 289, 292, 156, 167, 294,
+ 158, 290, 196, 197, 198, 195, 0, 188, 191, 418,
+ 0, 541, 0, 490, 508, 489, 0, 512, 0, 490,
+ 442, 0, 421, 471, 436, 0, 450, 471, 420, 296,
239, 238, 174, 175, 242, 0, 237, 0, 241, 0,
- 0, 29, 0, 325, 116, 326, 182, 184, 0, 0,
- 14, 0, 0, 23, 0, 183, 396, 0, 13, 27,
- 0, 0, 260, 0, 259, 0, 246, 325, 264, 325,
- 272, 0, 250, 0, 93, 92, 315, 307, 0, 0,
- 544, 543, 546, 553, 548, 0, 549, 550, 0, 0,
- 10, 47, 0, 0, 88, 87, 0, 0, 0, 0,
- 76, 77, 75, 74, 73, 71, 72, 66, 67, 68,
- 69, 70, 99, 98, 0, 45, 0, 293, 0, 297,
- 0, 299, 0, 379, 0, 159, 157, 0, 190, 44,
- 0, 0, 0, 458, 501, 385, 0, 533, 462, 423,
- 436, 444, 0, 0, 428, 433, 0, 0, 0, 0,
- 0, 400, 386, 128, 128, 398, 0, 387, 389, 397,
- 0, 240, 306, 0, 118, 113, 117, 0, 180, 227,
- 223, 172, 228, 21, 179, 224, 226, 0, 25, 282,
- 279, 183, 0, 266, 267, 273, 326, 269, 183, 183,
- 316, 308, 95, 63, 62, 0, 552, 554, 0, 551,
- 556, 555, 54, 56, 0, 0, 81, 79, 96, 97,
- 292, 291, 380, 298, 294, 296, 0, 187, 189, 89,
- 0, 0, 480, 500, 128, 0, 489, 485, 487, 0,
- 0, 503, 387, 0, 0, 420, 465, 431, 0, 419,
- 474, 477, 468, 0, 128, 128, 470, 467, 444, 443,
- 441, 442, 426, 444, 449, 446, 128, 128, 0, 435,
- 176, 384, 285, 285, 381, 382, 0, 399, 0, 0,
- 30, 313, 114, 128, 128, 145, 0, 0, 177, 225,
- 0, 255, 183, 325, 0, 245, 249, 0, 0, 309,
- 310, 0, 0, 536, 0, 537, 538, 83, 86, 295,
- 192, 0, 194, 534, 482, 493, 285, 494, 490, 491,
- 459, 0, 463, 444, 0, 465, 416, 0, 0, 175,
- 0, 0, 0, 469, 0, 0, 450, 450, 445, 236,
- 289, 379, 129, 183, 183, 183, 289, 183, 183, 0,
- 388, 390, 401, 314, 121, 0, 122, 0, 145, 143,
- 202, 200, 199, 181, 22, 0, 26, 253, 274, 0,
- 183, 402, 0, 0, 0, 325, 0, 0, 125, 326,
- 301, 311, 210, 89, 0, 208, 0, 207, 0, 257,
- 205, 540, 542, 0, 547, 0, 539, 0, 0, 183,
- 183, 183, 0, 495, 532, 0, 424, 0, 465, 475,
- 478, 471, 429, 0, 453, 447, 451, 448, 293, 0,
- 396, 0, 391, 392, 393, 293, 394, 395, 383, 0,
- 0, 144, 147, 146, 0, 178, 183, 0, 275, 312,
- 0, 318, 127, 126, 305, 0, 319, 303, 326, 302,
- 0, 0, 0, 211, 64, 0, 204, 541, 84, 193,
- 497, 498, 499, 492, 285, 421, 432, 0, 0, 0,
- 455, 0, 0, 234, 289, 235, 231, 233, 0, 119,
- 120, 0, 277, 183, 403, 317, 0, 162, 0, 339,
- 323, 0, 0, 0, 0, 0, 0, 0, 0, 368,
- 436, 436, 360, 0, 0, 123, 128, 128, 332, 337,
- 0, 0, 329, 330, 333, 361, 331, 0, 213, 0,
- 0, 206, 496, 465, 417, 473, 472, 476, 479, 454,
- 452, 0, 232, 201, 276, 0, 0, 325, 370, 0,
- 0, 366, 350, 351, 352, 0, 0, 0, 369, 0,
- 367, 334, 134, 0, 135, 0, 0, 321, 326, 320,
- 343, 0, 136, 0, 209, 212, 0, 0, 0, 0,
- 371, 48, 0, 0, 0, 364, 353, 0, 358, 0,
- 0, 132, 215, 0, 133, 218, 338, 325, 0, 0,
- 214, 422, 322, 0, 324, 362, 344, 348, 0, 359,
- 0, 130, 0, 131, 0, 336, 327, 325, 0, 340,
- 325, 370, 325, 365, 372, 0, 216, 219, 328, 342,
- 325, 363, 0, 349, 0, 0, 373, 374, 354, 0,
- 0, 341, 345, 0, 372, 0, 0, 217, 220, 370,
- 0, 0, 355, 375, 0, 376, 0, 0, 346, 377,
- 0, 356, 325, 0, 0, 347, 357, 378, 0, 0,
- 0
+ 0, 29, 0, 331, 116, 332, 182, 184, 0, 0,
+ 14, 0, 0, 23, 0, 183, 402, 0, 13, 27,
+ 0, 0, 183, 277, 271, 128, 268, 128, 0, 269,
+ 183, 269, 286, 287, 265, 284, 0, 93, 92, 321,
+ 313, 0, 0, 550, 549, 552, 559, 554, 0, 555,
+ 556, 0, 0, 10, 47, 0, 0, 88, 87, 0,
+ 0, 0, 0, 76, 77, 75, 74, 73, 71, 72,
+ 66, 67, 68, 69, 70, 99, 98, 0, 45, 0,
+ 299, 0, 303, 0, 305, 0, 385, 0, 159, 157,
+ 0, 190, 44, 0, 0, 0, 464, 507, 391, 0,
+ 539, 468, 429, 442, 450, 0, 0, 434, 439, 0,
+ 0, 0, 0, 0, 406, 392, 128, 128, 404, 0,
+ 393, 395, 403, 0, 240, 312, 0, 118, 113, 117,
+ 0, 180, 227, 223, 172, 228, 21, 179, 224, 226,
+ 0, 25, 0, 252, 331, 270, 331, 278, 0, 256,
+ 0, 0, 266, 0, 265, 322, 314, 95, 63, 62,
+ 0, 558, 560, 0, 557, 562, 561, 54, 56, 0,
+ 0, 81, 79, 96, 97, 298, 297, 386, 304, 300,
+ 302, 0, 187, 189, 89, 0, 0, 486, 506, 128,
+ 0, 495, 491, 493, 0, 0, 509, 393, 0, 0,
+ 426, 471, 437, 0, 425, 480, 483, 474, 0, 128,
+ 128, 476, 473, 450, 449, 447, 448, 432, 450, 455,
+ 452, 128, 128, 0, 441, 176, 390, 291, 291, 387,
+ 388, 0, 405, 0, 0, 30, 319, 114, 128, 128,
+ 145, 0, 0, 177, 225, 0, 272, 273, 279, 332,
+ 275, 183, 183, 288, 285, 183, 0, 0, 0, 315,
+ 316, 0, 0, 542, 0, 543, 544, 83, 86, 301,
+ 192, 0, 194, 540, 488, 499, 291, 500, 496, 497,
+ 465, 0, 469, 450, 0, 471, 422, 0, 0, 175,
+ 0, 0, 0, 475, 0, 0, 456, 456, 451, 236,
+ 295, 385, 129, 183, 183, 183, 295, 183, 183, 0,
+ 394, 396, 407, 320, 121, 0, 122, 0, 145, 143,
+ 202, 200, 199, 181, 22, 0, 26, 331, 0, 251,
+ 255, 261, 183, 408, 0, 0, 0, 331, 0, 0,
+ 125, 332, 307, 317, 210, 89, 0, 208, 0, 207,
+ 0, 263, 205, 546, 548, 0, 553, 0, 545, 0,
+ 0, 183, 183, 183, 0, 501, 538, 0, 430, 0,
+ 471, 481, 484, 477, 435, 0, 459, 453, 457, 454,
+ 299, 0, 402, 0, 397, 398, 399, 299, 400, 401,
+ 389, 0, 0, 144, 147, 146, 0, 178, 280, 0,
+ 183, 259, 318, 0, 324, 127, 126, 311, 0, 325,
+ 309, 332, 308, 0, 0, 0, 211, 64, 0, 204,
+ 547, 84, 193, 503, 504, 505, 498, 291, 427, 438,
+ 0, 0, 0, 461, 0, 0, 234, 295, 235, 231,
+ 233, 0, 119, 120, 0, 183, 0, 281, 409, 323,
+ 0, 162, 0, 345, 329, 0, 0, 0, 0, 0,
+ 0, 0, 0, 374, 442, 442, 366, 0, 0, 123,
+ 128, 128, 338, 343, 0, 0, 335, 336, 339, 367,
+ 337, 0, 213, 0, 0, 206, 502, 471, 423, 479,
+ 478, 482, 485, 460, 458, 0, 232, 201, 283, 183,
+ 0, 0, 331, 376, 0, 0, 372, 356, 357, 358,
+ 0, 0, 0, 375, 0, 373, 340, 134, 0, 135,
+ 0, 0, 327, 332, 326, 349, 0, 136, 0, 209,
+ 212, 0, 282, 0, 0, 0, 377, 48, 0, 0,
+ 0, 370, 359, 0, 364, 0, 0, 132, 215, 0,
+ 133, 218, 344, 331, 0, 0, 214, 428, 328, 0,
+ 330, 368, 350, 354, 0, 365, 0, 130, 0, 131,
+ 0, 342, 333, 331, 0, 346, 331, 376, 331, 371,
+ 378, 0, 216, 219, 334, 348, 331, 369, 0, 355,
+ 0, 0, 379, 380, 360, 0, 0, 347, 351, 0,
+ 378, 0, 0, 217, 220, 376, 0, 0, 361, 381,
+ 0, 382, 0, 0, 352, 383, 0, 362, 331, 0,
+ 0, 353, 363, 384, 0, 0, 0
};
-static const short yydefgoto[] = { 939,
- 1, 2, 3, 28, 29, 30, 345, 568, 351, 571,
- 200, 454, 667, 124, 242, 405, 126, 127, 128, 129,
- 130, 582, 131, 390, 389, 387, 678, 388, 132, 243,
- 133, 134, 332, 333, 334, 563, 655, 656, 31, 195,
- 786, 444, 91, 564, 640, 445, 34, 142, 288, 35,
- 218, 206, 78, 201, 207, 646, 79, 567, 337, 338,
- 37, 297, 298, 299, 644, 715, 669, 670, 671, 733,
- 801, 844, 862, 883, 910, 865, 885, 911, 324, 210,
- 680, 211, 38, 234, 236, 225, 94, 737, 354, 97,
- 98, 231, 475, 476, 223, 224, 144, 682, 145, 191,
- 287, 657, 658, 726, 335, 482, 579, 580, 581, 561,
- 368, 562, 790, 791, 792, 818, 839, 458, 840, 661,
- 793, 794, 868, 817, 901, 892, 920, 933, 893, 795,
- 796, 891, 797, 830, 853, 906, 907, 908, 931, 410,
- 411, 446, 630, 447, 448, 449, 327, 328, 450, 451,
- 653, 135, 40, 64, 41, 42, 43, 432, 689, 314,
- 604, 804, 527, 317, 539, 606, 44, 318, 69, 45,
- 437, 544, 438, 549, 696, 697, 46, 65, 304, 521,
- 66, 310, 525, 433, 434, 537, 613, 808, 538, 608,
- 749, 609, 750, 175, 424, 518, 519, 520, 683, 684,
- 306, 426, 176, 177, 178, 179, 180, 585, 586, 673,
- 587, 373, 136, 245, 486, 376, 377, 378, 137, 138,
- 139
+static const short yydefgoto[] = { 945,
+ 1, 2, 3, 28, 29, 30, 335, 563, 341, 566,
+ 198, 447, 669, 122, 232, 398, 124, 125, 126, 127,
+ 128, 582, 129, 383, 382, 380, 680, 381, 130, 233,
+ 131, 132, 322, 323, 324, 558, 657, 658, 31, 193,
+ 790, 437, 91, 559, 640, 438, 34, 140, 278, 35,
+ 216, 204, 78, 199, 205, 646, 79, 562, 327, 328,
+ 37, 287, 288, 289, 644, 717, 671, 672, 673, 736,
+ 805, 849, 868, 889, 916, 871, 891, 917, 314, 208,
+ 682, 209, 38, 39, 40, 41, 350, 352, 357, 225,
+ 740, 474, 220, 221, 347, 568, 569, 355, 356, 142,
+ 684, 143, 189, 277, 659, 660, 729, 325, 477, 579,
+ 580, 581, 556, 361, 557, 794, 795, 796, 823, 844,
+ 451, 845, 663, 797, 798, 874, 822, 907, 898, 926,
+ 939, 899, 799, 800, 897, 801, 835, 859, 912, 913,
+ 914, 937, 403, 404, 439, 630, 440, 441, 442, 317,
+ 318, 443, 444, 655, 133, 43, 64, 44, 45, 46,
+ 425, 691, 304, 604, 808, 522, 307, 534, 606, 47,
+ 308, 69, 48, 430, 539, 431, 544, 698, 699, 49,
+ 65, 294, 516, 66, 300, 520, 426, 427, 532, 613,
+ 812, 533, 608, 752, 609, 753, 173, 417, 513, 514,
+ 515, 685, 686, 296, 419, 174, 175, 176, 177, 178,
+ 585, 586, 675, 587, 366, 134, 235, 481, 369, 370,
+ 371, 135, 136, 137
};
-static const short yypact[] = { 120,
- 131, 2895, 2895, 468,-32768,-32768,-32768,-32768, 98, 118,
- 257, 110, 122, 132,-32768, 266,-32768,-32768, 266, 266,
--32768, 158, 266, 158, 266, 266,-32768,-32768,-32768,-32768,
- 234, 153, 2375, 497,-32768, 218,-32768,-32768, 2895,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768, 172, 210, 203, 210, 221, 2604,
- 2442, 254,-32768, 61, 3182, 3182, 81, 133,-32768,-32768,
- 158,-32768, 151, 266,-32768,-32768, 234, 253,-32768, 218,
- 1662,-32768, 540,-32768, 234, 497,-32768, 218,-32768,-32768,
- 879,-32768,-32768, 94,-32768, 263, 289, 1593,-32768, 298,
--32768,-32768,-32768,-32768,-32768,-32768, 2604, 2604, 266,-32768,
--32768,-32768, 2604,-32768,-32768, 933,-32768, 278, 323, 326,
--32768,-32768,-32768, 2604, 331, 361,-32768, 2658, 2712,-32768,
- 3553, 1169, 403, 370, 2604,-32768,-32768,-32768,-32768,-32768,
- 396, 267,-32768, 402, 3336, 302,-32768, 266,-32768,-32768,
+static const short yypact[] = { 146,
+ 163, 3062, 3062, 133,-32768,-32768,-32768,-32768, 205, 205,
+ 205, 182, 209, 215,-32768, 282,-32768,-32768, 282, 282,
+-32768, 235, 282, 235, 282, 282,-32768,-32768,-32768,-32768,
+ 77, 206, 2542, 195,-32768, 205,-32768, 95, 125, 150,
+-32768, 3062,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 205, 205, 205, 2771, 2609, 246,-32768,-32768,
+-32768,-32768,-32768, 105, 3331, 3331, 211, 49,-32768,-32768,
+ 235,-32768, 23, 282,-32768,-32768, 77, 25,-32768, 205,
+ 1765,-32768, 464,-32768, 77, 195,-32768, 205,-32768,-32768,
+ 593,-32768, 248, 247, 248, 265,-32768, 274,-32768,-32768,
+-32768,-32768,-32768,-32768, 2771, 2771, 282,-32768,-32768,-32768,
+ 2771,-32768,-32768, 1370,-32768, 257, 279, 307,-32768,-32768,
+-32768, 2771, 301, 302,-32768, 2825, 2879,-32768, 3643, 773,
+ 371, 336, 2771,-32768,-32768,-32768,-32768,-32768, 362, 322,
+-32768, 387, 3451, 259,-32768, 282,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, 129, 3459,-32768,-32768,-32768, 2336, 457,-32768,-32768,
--32768, 266, 266, 449, 266, 266,-32768,-32768,-32768, 461,
- 642, 54,-32768, 540, 234,-32768, 474,-32768, 1805, 683,
- 218,-32768,-32768, 540,-32768, 259,-32768, 218, 1760, 526,
- 529, 318, 1681, 879,-32768,-32768,-32768,-32768, 218,-32768,
--32768, 505, 470,-32768, 94, 491, 218,-32768,-32768, 525,
- 486, 3078, 374, 210, 218, 210,-32768,-32768,-32768,-32768,
- 490, 499, 495, 503, 2496, 3244, 3459, 266,-32768, 517,
- 2604, 933,-32768, 933,-32768, 2604, 2604, 558,-32768,-32768,
- 2604, 2604, 2604, 2604, 2604, 2604, 2604, 2604, 2604, 2604,
- 2604, 2604,-32768,-32768, 266, 266, 2604, 2604,-32768,-32768,
--32768,-32768,-32768, 267, 1864,-32768, 547, 711,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, 29,-32768, 539,-32768,
- 3459,-32768, 537, 542, 618,-32768, 457,-32768, 147, 542,
- 158, 559,-32768, 574, 573, 585,-32768, 574,-32768,-32768,
- 529,-32768,-32768, 635, 529, 654,-32768, 3048,-32768, 582,
- 589,-32768, 276, 82,-32768,-32768, 631, 218, 269, 219,
--32768, 540, 540,-32768, 683, 218,-32768, 1923,-32768,-32768,
- 683, 2604, 266, 591, 470, 595,-32768,-32768,-32768,-32768,
--32768, 592,-32768, 596,-32768,-32768,-32768, 599, 597, 2256,
--32768,-32768,-32768,-32768, 640, 606, 3244,-32768, 607, 610,
--32768, 3553, 615, 617, 3553, 3553, 2604, 656, 2604, 2604,
- 2834, 2942, 880, 784, 1653, 900, 900, 478, 478,-32768,
--32768,-32768,-32768,-32768, 622, 361, 616, 456, 242,-32768,
- 3067,-32768, 621,-32768, 1982,-32768, 711, 624, 302, 2766,
- 632, 3272, 851,-32768,-32768, 3347, 3459,-32768,-32768, 628,
- 158,-32768, 658, 2970,-32768,-32768, 347, 2843, 666, 84,
- 643,-32768,-32768,-32768, 3422,-32768, 659, 327,-32768,-32768,
- 176,-32768,-32768, 86,-32768,-32768,-32768, 3441,-32768, 526,
--32768,-32768, 526,-32768, 701,-32768,-32768, 660,-32768, 3553,
--32768, 218, 663,-32768, 661,-32768,-32768, 661, 218, 218,
--32768, 713,-32768,-32768,-32768, 3308,-32768,-32768, 640,-32768,
--32768,-32768,-32768,-32768, 708, 2604, 2417, 1396,-32768,-32768,
- 547,-32768,-32768,-32768,-32768,-32768, 668,-32768,-32768, 211,
- 681, 266,-32768, 2336, 676, 3097,-32768,-32768, 3422, 1779,
- 86,-32768, 679, 700, 86,-32768, 574,-32768, 352,-32768,
--32768,-32768,-32768, 234, 153, 2375, 262,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, 3478, 705,-32768,
--32768,-32768, 464, 93,-32768,-32768, 3411,-32768, 780, 495,
--32768,-32768,-32768, 707, 726,-32768, 840, 86,-32768,-32768,
- 86,-32768, 218,-32768, 368,-32768,-32768, 266, 1102, 713,
--32768, 1422, 2604, 750, 706, 3308,-32768,-32768, 1475,-32768,
--32768, 2604,-32768,-32768,-32768,-32768, 464,-32768,-32768,-32768,
--32768, 266,-32768,-32768, 729, 574,-32768, 3182, 3182, 76,
- 540, 234, 2998,-32768, 430, 2861, 1377, 1377,-32768,-32768,
--32768, 93, 218, 238, 330, 218,-32768, 330, 218, 3067,
--32768,-32768,-32768,-32768,-32768, 540,-32768, 234,-32768, 767,
--32768,-32768, 3553,-32768,-32768, 840,-32768,-32768,-32768, 2604,
- 212,-32768, 377, 545, 1022, 716, 717, 1182,-32768,-32768,
--32768,-32768,-32768, 758, 266,-32768, 762, 3553, 735, 737,
--32768, 361,-32768, 2604,-32768, 750,-32768, 2604, 273, 238,
- 330, 218, 383,-32768,-32768, 442,-32768, 760, 574,-32768,
--32768,-32768,-32768, 2604, 789, 757,-32768, 757, 588, 677,
--32768, 2041,-32768,-32768,-32768, 594,-32768,-32768,-32768, 389,
- 416, 767,-32768,-32768, 1422,-32768, 3186, 2604,-32768,-32768,
- 266,-32768,-32768,-32768,-32768, 764,-32768,-32768,-32768,-32768,
- 2122, 808, 1422,-32768,-32768, 1502,-32768,-32768, 1475,-32768,
--32768,-32768,-32768,-32768, 464,-32768,-32768, 782, 72, 72,
- 3553, 2604, 1377, 583,-32768, 583,-32768,-32768, 763,-32768,
--32768, 775,-32768, 3186,-32768,-32768, 2202, 816, 800,-32768,
--32768, 802, 813, 2604, 829, 798, 805, 2550, 429, 890,
- 79, 141,-32768, 849, 824,-32768, 825, 3147,-32768, 887,
- 1262, 103,-32768,-32768,-32768,-32768,-32768, 2364,-32768, 827,
- 1582,-32768,-32768, 574,-32768,-32768,-32768,-32768,-32768, 3553,
--32768, 601,-32768,-32768,-32768, 2604, 848,-32768, 2604, 2604,
- 3517,-32768,-32768,-32768,-32768, 831, 2604, 833,-32768, 853,
--32768,-32768,-32768, 540,-32768, 234, 1342,-32768,-32768,-32768,
--32768, 2604,-32768, 1582,-32768,-32768, 854, 845, 2604, 899,
--32768, 752, 866, 878, 2604,-32768,-32768, 881,-32768, 2604,
- 432,-32768, 320, 440,-32768, 332,-32768,-32768, 2202, 883,
--32768,-32768,-32768, 889,-32768,-32768,-32768,-32768, 3535,-32768,
- 52,-32768, 683,-32768, 683,-32768,-32768,-32768, 886,-32768,
--32768, 2604,-32768,-32768, 946, 891,-32768,-32768,-32768,-32768,
--32768,-32768, 892,-32768, 898, 69, 893,-32768,-32768, 495,
- 495,-32768,-32768, 2604, 946, 894, 946,-32768,-32768, 2604,
- 901, 145,-32768,-32768, 903,-32768, 654, 907,-32768, 403,
- 303,-32768,-32768, 908, 654,-32768,-32768, 403, 970, 975,
--32768
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 225,
+ 837,-32768,-32768,-32768, 2503, 409,-32768,-32768,-32768, 282,
+ 282, 391, 282, 282,-32768,-32768,-32768, 388, 292, 144,
+-32768, 464, 77,-32768, 416,-32768, 1972, 1176, 205,-32768,
+-32768, 464,-32768, 39,-32768, 205, 1863, 234, 299, 263,
+ 1784, 593,-32768,-32768,-32768,-32768, 205,-32768, 426, 419,
+ 1696,-32768, 437,-32768, 239,-32768,-32768,-32768,-32768,-32768,
+ 449, 469, 465, 477, 2663, 3359, 837, 282,-32768, 450,
+ 2771, 1370,-32768, 1370,-32768, 2771, 2771, 518,-32768,-32768,
+ 2771, 2771, 2771, 2771, 2771, 2771, 2771, 2771, 2771, 2771,
+ 2771, 2771,-32768,-32768, 282, 282, 2771, 2771,-32768,-32768,
+-32768,-32768,-32768, 322, 2031,-32768, 337, 670,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768, 157,-32768, 498,-32768,
+ 837,-32768, 484, 485, 554,-32768, 409,-32768, 256, 485,
+ 235, 493,-32768, 509, 491, 502,-32768, 509,-32768,-32768,
+ 299,-32768,-32768, 558, 299, 582,-32768, 3215,-32768, 511,
+ 515,-32768, 879, 84,-32768,-32768, 561, 205, 372, 155,
+-32768, 464, 464,-32768, 1176, 205,-32768, 2090,-32768,-32768,
+ 1176, 534, 205,-32768,-32768, 326, 525, 1910, 717, 248,
+ 205, 248,-32768, 572, 529,-32768, 239,-32768,-32768,-32768,
+ 536, 552, 2423,-32768,-32768,-32768,-32768, 595, 560, 3359,
+-32768, 564, 570,-32768, 3643, 577, 580, 3643, 3643, 2771,
+ 620, 2771, 2771, 1580, 959, 1151, 1757, 1854, 658, 658,
+ 489, 489,-32768,-32768,-32768,-32768,-32768, 583, 302, 584,
+ 177, 213,-32768, 3234,-32768, 588,-32768, 2149,-32768, 670,
+ 587, 259, 2933, 590, 3395, 1882,-32768,-32768, 3464, 837,
+-32768,-32768, 578, 235,-32768, 611, 3137,-32768,-32768, 421,
+ 3010, 624, 75, 612,-32768,-32768,-32768, 3521,-32768, 626,
+ 360,-32768,-32768, 254,-32768,-32768, 92,-32768,-32768,-32768,
+ 3533,-32768, 234,-32768,-32768, 234,-32768, 668,-32768,-32768,
+ 628,-32768, 638,-32768,-32768,-32768,-32768,-32768, 647,-32768,
+ 650, 2771, 282, 654, 529,-32768, 703,-32768,-32768,-32768,
+ 3423,-32768,-32768, 595,-32768,-32768,-32768,-32768,-32768, 698,
+ 2771, 1345, 1501,-32768,-32768, 337,-32768,-32768,-32768,-32768,
+-32768, 655,-32768,-32768, 287, 663, 282,-32768, 2503, 665,
+ 3245,-32768,-32768, 3521, 1946, 92,-32768, 662, 671, 92,
+-32768, 509,-32768, 543,-32768,-32768,-32768,-32768, 77, 206,
+ 2542, 228,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 3546, 667,-32768,-32768,-32768, 592, 357,-32768,
+-32768, 3476,-32768, 743, 465,-32768,-32768,-32768, 672, 833,
+-32768, 1685, 92,-32768,-32768, 92,-32768, 674,-32768,-32768,
+ 674, 205, 205, 3643,-32768, 205, 673, 282, 1011, 703,
+-32768, 1450, 2771, 715, 675, 3423,-32768,-32768, 1423,-32768,
+-32768, 2771,-32768,-32768,-32768,-32768, 592,-32768,-32768,-32768,
+-32768, 282,-32768,-32768, 693, 509,-32768, 3331, 3331, 62,
+ 464, 77, 3165,-32768, 549, 3028, 405, 405,-32768,-32768,
+-32768, 357, 205, 260, 273, 205,-32768, 273, 205, 3234,
+-32768,-32768,-32768,-32768,-32768, 464,-32768, 77,-32768, 625,
+-32768,-32768, 3643,-32768,-32768, 1685,-32768,-32768, 446,-32768,
+-32768,-32768, 205,-32768, 411, 348, 914, 679, 682, 1091,
+-32768,-32768,-32768,-32768,-32768, 723, 282,-32768, 725, 3643,
+ 686, 689,-32768, 302,-32768, 2771,-32768, 715,-32768, 2771,
+ 318, 260, 273, 205, 427,-32768,-32768, 556,-32768, 704,
+ 509,-32768,-32768,-32768,-32768, 2771, 737, 697,-32768, 697,
+ 499, 410,-32768, 2208,-32768,-32768,-32768, 747,-32768,-32768,
+-32768, 435, 445, 625,-32768,-32768, 1450,-32768,-32768, 2771,
+ 73,-32768,-32768, 282,-32768,-32768,-32768,-32768, 701,-32768,
+-32768,-32768,-32768, 2289, 745, 1450,-32768,-32768, 1530,-32768,
+-32768, 1423,-32768,-32768,-32768,-32768,-32768, 592,-32768,-32768,
+ 719, 65, 65, 3643, 2771, 405, 398,-32768, 398,-32768,
+-32768, 700,-32768,-32768, 712, 3607, 2771,-32768,-32768,-32768,
+ 2369, 754, 734,-32768,-32768, 736, 739, 2771, 758, 724,
+ 726, 2717, 109, 793, 178, 289,-32768, 764, 727,-32768,
+ 731, 3264,-32768, 795, 1207, 89,-32768,-32768,-32768,-32768,
+-32768, 2531,-32768, 735, 1610,-32768,-32768, 509,-32768,-32768,
+-32768,-32768,-32768, 3643,-32768, 822,-32768,-32768,-32768, 3607,
+ 2771, 755,-32768, 2771, 2771, 3584,-32768,-32768,-32768,-32768,
+ 738, 2771, 740,-32768, 757,-32768,-32768,-32768, 464,-32768,
+ 77, 1290,-32768,-32768,-32768,-32768, 2771,-32768, 1610,-32768,
+-32768, 760,-32768, 742, 2771, 838,-32768, 799, 783, 786,
+ 2771,-32768,-32768, 789,-32768, 2771, 451,-32768, 221, 456,
+-32768, 471,-32768,-32768, 2369, 791,-32768,-32768,-32768, 792,
+-32768,-32768,-32768,-32768, 3625,-32768, 54,-32768, 1176,-32768,
+ 1176,-32768,-32768,-32768, 797,-32768,-32768, 2771,-32768,-32768,
+ 860, 800,-32768,-32768,-32768,-32768,-32768,-32768, 802,-32768,
+ 817, 80, 806,-32768,-32768, 465, 465,-32768,-32768, 2771,
+ 860, 811, 860,-32768,-32768, 2771, 814, 81,-32768,-32768,
+ 818,-32768, 582, 820,-32768, 371, 334,-32768,-32768, 821,
+ 582,-32768,-32768, 371, 895, 899,-32768
};
static const short yypgoto[] = {-32768,
--32768,-32768,-32768, 192, -367,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, -9,-32768, -52, 560, -231, 530,-32768,-32768,
- -54,-32768, 220,-32768,-32768,-32768,-32768,-32768, 167,-32768,
- -295,-32768, -312, 655,-32768,-32768, 334,-32768, 17, -195,
- 193, 16, 909,-32768, 356, 21, -11, -61, 710, 11,
- -276, -575, -58, -206, -118,-32768,-32768,-32768, 196, 3,
- -6,-32768, 579,-32768, 357,-32768, -604,-32768, -657,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -68, -135,
- -489, 14, -66,-32768,-32768,-32768,-32768,-32768, 647, 19,
--32768, 773, 649, 433, 785, 664, -27, -79, -55, -168,
- -226, 355,-32768,-32768, -285,-32768,-32768,-32768, 434, -413,
--32768, -205,-32768,-32768,-32768,-32768, -122, -415, -734, 358,
--32768, 149,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768, 150,-32768, -658, 105,-32768, 107,-32768, 608,
--32768, -359,-32768, 612, 633, 475, -307,-32768,-32768,-32768,
--32768, 18,-32768, 1029,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -20, 4,
- -364,-32768, 513,-32768, 443, 305,-32768,-32768,-32768,-32768,
--32768,-32768,-32768, -286,-32768,-32768,-32768, 310, 531,-32768,
--32768,-32768,-32768, -25, 753,-32768,-32768, 550,-32768, 321,
- 564,-32768, 651, 652, -121,-32768, -148,-32768,-32768, 405,
- 494,-32768,-32768,-32768,-32768,-32768,-32768, 714,-32768,-32768,
--32768
+-32768,-32768,-32768, 98, -363,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, -12,-32768, -56, 488, -230, 383,-32768,-32768,
+ -75,-32768, 439,-32768,-32768,-32768,-32768,-32768, 78,-32768,
+ -272,-32768, -312, 579,-32768,-32768, 250,-32768, 44, -181,
+ 110, 3, 819,-32768, 275, 7, -18, -162, 632, 104,
+ -228, -581, -68, -204, -123,-32768,-32768,-32768, -255, 32,
+ 90,-32768, 504,-32768, 303,-32768, -612,-32768, -653,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -67, -134,
+ -508, -29,-32768,-32768,-32768, -73,-32768,-32768,-32768,-32768,
+-32768, 475, -38,-32768, 603, 486, 308, 598, 487, -36,
+ -70, -160, -182, -221, 300,-32768,-32768, -269,-32768,-32768,
+-32768, 385, -177,-32768, -200,-32768,-32768,-32768,-32768, -186,
+ -487, -709, 306,-32768, 96,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 97,-32768, -801, 46,-32768,
+ 47,-32768, 568,-32768, -352,-32768, 557, 563, 425, -298,
+-32768,-32768,-32768,-32768, 18,-32768, 954,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 8, 0, -343,-32768, 444,-32768, 366, 231,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768, -270,-32768,-32768,-32768,
+ 237, 463,-32768,-32768,-32768,-32768, -20, 688,-32768,-32768,
+ 483,-32768, 251, 537,-32768, 585, 633, -103,-32768, -124,
+-32768,-32768, 351, 412,-32768,-32768,-32768,-32768,-32768,-32768,
+ 643,-32768,-32768,-32768
};
-#define YYLAST 3605
-
-
-static const short yytable[] = { 55,
- 57, 59, 346, 72, 36, 36, 63, 125, 141, 67,
- 68, 416, 343, 71, 209, 63, 74, 32, 32, 39,
- 39, 86, 33, 33, 220, 70, 212, 70, 308, 92,
- 440, 439, 464, 80, 339, 88, 230, 369, 469, 466,
- 181, 36, 232, 87, 81, 406, 184, 455, 83, 85,
- 188, 503, 237, 238, 32, 307, 39, 409, 240, 33,
- 710, 575, 286, 624, 190, 292, 533, 529, 340, 249,
- 70, 143, 806, 92, 70, 323, 100, 336, 802, 80,
- 281, 92, -112, 850, 222, 208, 560, 80, 244, 895,
- 192, 456, 279, 219, 221, 75, 50, 51, 213, 239,
- 50, 51, 197, 841, 418, 147, 915, 601, 143, 419,
- 762, 603, 198, 199, 408, 233, -35, 346, 182, -1,
- 50, 51, 14, 16, 375, 16, 143, 896, 800, 322,
- -2, 50, 51, 886, 198, 199, 296, 517, 300, 183,
- 416, 148, 627, 846, 916, 303, 330, 220, 807, 50,
- 51, 622, 285, 899, 645, 291, 902, 647, 904, 551,
- 52, 842, 302, -112, 52, 53, 912, 367, 60, 53,
- 185, 230, 311, 312, 615, 315, 316, 232, -34, 54,
- 61, 501, 927, 143, 52, 16, 871, 301, 406, 53,
- 62, 186, 372, 80, 47, 52, 208, 80, 936, 56,
- 53, 92, 16, 460, 321, 427, 208, 463, 325, 754,
- 756, 336, 92, 52, 187, 222, 219, 192, 53, 379,
- 928, 220, 336, 462, 383, 407, 384, 189, 336, 82,
- 93, 148, 413, 903, 600, 477, 75, 477, 380, 686,
- 605, 14, 291, 143, 731, 692, 358, 14, 360, 718,
- 233, 558, 362, 95, 364, 489, 559, 143, 861, 50,
- 51, 925, 143, 14, 143, 403, 404, 14, 50, 51,
- 709, 75, 202, 421, 96, 320, 331, 347, 348, -115,
- -115, -115, -115, 76, 99, -115, 591, -115, -115, -115,
- 430, 592, 77, 659, 461, 468, 701, 702, 14, 428,
- 414, 415, 101, -115, 50, 51, 293, 294, 295, 531,
- 532, 143, 146, 767, 70, 485, 283, 502, 203, 688,
- -115, 226, 754, 52, -466, 284, 285, 204, 53, 193,
- 36, 92, 52, 194, 495, 341, 246, 53, 58, 342,
- 205, 208, -115, 222, 208, 208, 197, -115, 740, -175,
- 220, 672, 321, 251, 634, -175, 325, -115, 197, 14,
- 679, -175, 507, 714, 584, 308, 227, -175, 52, 723,
- 75, 202, 728, 53, 228, 235, 547, 5, 934, 7,
- 140, 247, 548, 935, 248, 9, 10, 11, 198, 199,
- 198, 199, 307, 757, 349, 409, -175, 14, 194, 524,
- -175, 13, 748, 556, 15, 650, 250, 557, -175, 296,
- 528, 279, -175, 36, 540, 541, 542, 203, 16, 540,
- 541, 542, 357, 869, 543, 36, 204, 700, 36, 607,
- 363, 50, 51, 86, 70, 714, 36, 143, 515, 205,
- 22, 251, 672, 516, 280, 24, 565, 88, 143, 535,
- 534, 477, 699, 720, 536, 87, 660, 721, 706, 744,
- 553, 554, 320, 745, 676, 760, 75, 620, 566, 342,
- 382, 282, 501, 626, 629, 385, 386, 289, 827, 501,
- 391, 392, 393, 394, 395, 396, 397, 398, 399, 400,
- 401, 402, 761, 14, 309, 52, 194, 540, 541, 542,
- 53, 89, 594, 90, 86, 283, 651, 693, 882, 540,
- 541, 542, 342, 621, 284, 285, 884, 847, 88, 746,
- 194, 36, 622, 285, 86, 789, 87, 270, 271, 272,
- 313, 597, 326, 660, 515, 729, 80, 319, 88, 516,
- 352, 465, 75, 202, 48, 49, 87, 610, 695, 695,
- 353, 611, 612, 212, 547, 623, 80, 356, 291, 36,
- 548, 789, 359, 617, 618, 365, 625, 628, 652, 14,
- 897, 470, 898, 220, 366, 639, 367, 208, 370, 711,
- 636, 638, 690, 691, 347, 348, 812, 198, 199, 203,
- 75, 620, 685, 381, 320, -85, 75, 420, 204, 623,
- 320, -268, -268, 75, 620, 414, 415, 320, 497, 498,
- 681, 205, 422, 208, 80, 36, 92, 14, 423, 208,
- 208, 453, 722, 14, 80, 610, 143, 425, 535, 534,
- 14, 930, 36, 536, 431, 192, -464, 621, 208, 938,
- 80, 701, 702, 627, 75, 220, 622, 285, 320, 759,
- 755, 610, 622, 285, 435, 732, 346, 253, 255, 77,
- 436, 197, 104, 789, 452, 453, 459, 572, 472, 479,
- 474, 14, 483, 480, 576, 577, 481, 487, 785, 75,
- 620, 488, 491, 331, 695, 492, -325, -325, -325, -325,
- 493, 76, 494, 496, -325, -325, -325, 499, 500, 508,
- 77, 623, 623, 504, 918, 919, 14, 512, 80, 526,
- -325, 765, 321, 325, 785, 589, 216, 217, 552, 321,
- 530, 784, 9, 10, 11, 826, 755, -325, 550, 5,
- 89, 7, 90, 36, 555, 77, 569, 9, 10, 11,
- 573, 574, 570, 281, 578, 588, 787, 623, 798, -325,
- 590, 788, 596, 13, -325, 208, 593, 784, 681, 557,
- 336, 72, 336, 848, -111, 863, 851, 854, 648, 828,
- 16, 713, 216, 217, 858, 602, 86, 864, 9, 10,
- 11, 619, 633, 635, 70, 70, 643, 674, 675, 870,
- 88, 687, 22, -304, 727, -32, 874, 24, 87, 734,
- 36, 668, 637, 834, 836, 273, 274, 881, 275, 276,
- 277, 278, 735, 787, 623, 798, 785, 736, 788, 703,
- 704, 705, 747, 707, 708, 321, 752, 876, 265, 266,
- 267, 268, 269, 270, 271, 272, 208, 753, 80, 851,
- 641, 766, 102, 799, 805, 813, 719, 103, 104, 866,
- 105, 331, 814, -33, 5, 6, 7, 8, 816, 784,
- 819, 921, 9, 10, 11, 643, 822, 851, 106, 717,
- 15, 820, 107, 108, 823, 741, 742, 743, 13, 109,
- 14, 824, 110, 215, 216, 217, 831, 111, 112, 113,
- 9, 10, 11, 114, 115, 16, 829, 739, 116, 117,
- 832, 833, 837, 118, 845, 119, 849, 857, 14, 859,
- 120, 860, 763, 751, 121, 875, 872, 22, 122, 123,
- 873, 642, 24, 264, 265, 266, 267, 268, 269, 270,
- 271, 272, -486, 241, 668, 102, 5, 764, 7, 140,
- 103, 104, 877, 105, 9, 10, 11, 268, 269, 270,
- 271, 272, 668, 878, 905, 668, 914, 880, 889, 815,
- 13, 106, 900, 15, 890, 107, 108, 909, 913, 940,
- 923, 810, 109, 917, 941, 110, 926, 16, 929, 511,
- 111, 112, 113, 932, 937, 852, 114, 115, 457, 724,
- 843, 116, 117, 821, 712, 214, 118, 509, 119, 22,
- 417, 473, 716, 120, 24, 361, 649, 121, 478, 355,
- 725, 122, 123, 662, -94, 730, 471, 887, 888, 922,
- 668, 505, 331, 924, -124, -124, -124, -124, -124, -124,
- -124, 632, -124, -124, -124, -124, -124, 522, -124, -124,
+#define YYLAST 3695
+
+
+static const short yytable[] = { 123,
+ 139, 81, 336, 63, 32, 32, 67, 68, 33, 33,
+ 71, 326, 63, 74, 86, 207, 210, 218, 329, 42,
+ 42, 70, 457, 70, 333, 94, 96, 98, 462, 227,
+ 228, 72, 362, 36, 36, 230, 399, 432, 459, 624,
+ 53, 54, 55, 433, 32, 179, 239, 190, 33, 409,
+ 298, 498, 402, 448, 712, 211, 223, 271, 346, 42,
+ 348, 188, 80, 528, 88, 810, 70, 330, 313, 276,
+ 70, 297, 282, 36, 182, 83, 85, 234, 186, 75,
+ 458, 524, 649, 269, -112, 806, 183, 464, 195, 846,
+ 401, 901, 555, 449, 229, 470, 909, 59, 60, 187,
+ 50, 191, 14, 146, 765, 192, 14, 184, 80, 336,
+ 767, 59, 60, 856, 206, 331, 80, 921, 933, 332,
+ 196, 197, 217, 804, 931, 92, 76, 59, 60, 902,
+ 185, 286, 368, 290, 293, 77, 87, 326, 218, 99,
+ 320, 811, 92, 92, 92, -1, 512, 847, 326, 145,
+ 546, 851, 59, 60, 326, 922, 934, 292, 832, 311,
+ 141, 61, -2, 315, 892, -112, 62, 301, 302, 92,
+ 305, 306, 190, 360, 734, 61, 93, 92, 365, 496,
+ 62, 409, 399, 310, 905, 146, 346, 908, 348, 910,
+ 615, 61, 757, 759, 453, 877, 62, 918, 456, 89,
+ 372, 90, 196, 197, 218, 376, 95, 377, 455, 51,
+ 52, 400, 354, 337, 338, -35, 61, 141, 406, 312,
+ 80, 62, 16, 206, 80, 373, 273, 59, 60, 942,
+ 454, 97, 411, 206, 14, 274, 275, 412, 349, 353,
+ 56, 59, 60, 217, 771, 600, 281, 195, 180, 694,
+ -175, 605, 396, 397, 414, 16, -175, 867, 59, 60,
+ 688, 59, 60, 283, 284, 285, 484, 57, 542, 181,
+ 543, 407, 408, 58, 141, 526, 527, 711, 570, 16,
+ 570, 461, 82, 291, 59, 60, 421, 480, 497, 14,
+ -472, 61, 337, 338, 75, 92, 62, -175, 310, 311,
+ 70, -175, 14, 315, 144, 61, 92, 757, 423, 661,
+ 62, 469, 219, 471, 420, 236, 650, 651, 703, 704,
+ 652, 14, 61, 490, 141, 61, -34, 62, 222, 553,
+ 62, 196, 197, 16, 554, 690, 218, 237, 601, 339,
+ 141, 76, 603, 192, 354, 141, 224, 141, 61, 36,
+ 77, 502, 674, 62, 634, 226, 875, 196, 197, 75,
+ 206, 681, 591, 206, 206, 238, 349, 592, 705, 706,
+ 707, 273, 709, 710, 75, 200, 240, 584, 310, 269,
+ 274, 275, 241, 519, 298, 645, 14, 726, 647, 465,
+ 731, 467, 662, 743, 141, 407, 408, 722, 241, 286,
+ 402, 14, -274, -274, 760, 297, 627, 75, 200, 940,
+ 270, 716, 75, 620, 941, 622, 275, 92, 510, 86,
+ 751, 201, 511, 70, 446, 725, 744, 745, 746, 530,
+ 202, 523, 560, 531, 14, 36, 551, 272, 701, 14,
+ 552, 702, 696, 203, 708, 674, 299, 36, 75, 200,
+ 36, 281, 141, 542, 201, 543, 703, 704, 36, 758,
+ 354, 570, 279, 202, 309, 768, 75, 200, 77, 88,
+ 529, 662, 303, 732, 316, 14, 203, 626, 629, 496,
+ 548, 549, 678, 720, 342, 716, 496, 723, 535, 536,
+ 537, 724, 86, 14, 594, 201, 343, 195, 538, 610,
+ -175, 75, 620, 747, 202, 310, -175, 748, 243, 245,
+ 819, 763, 86, 201, 351, 332, 510, 203, 625, 628,
+ 511, 764, 202, 141, 358, 192, 374, 888, 14, 196,
+ 197, 332, 890, 793, 141, 203, 192, 852, 260, 261,
+ 262, 87, 88, 210, 359, 36, 360, -175, 621, 697,
+ 697, -175, 363, 597, 561, -85, 413, 622, 275, 415,
+ 80, 416, 88, 418, 853, 654, 218, 683, 424, 713,
+ 793, -470, 428, 611, 612, 816, 903, 429, 904, 623,
+ 80, 721, 610, 36, 195, 617, 618, 692, 693, 687,
+ 102, 446, 190, 445, 75, 620, 452, 213, 214, 215,
+ 463, 466, 636, 638, 9, 10, 11, 472, 610, 473,
+ 535, 536, 537, 476, 87, 530, 535, 536, 537, 531,
+ 607, 14, 14, 535, 536, 537, 695, 478, 623, 715,
+ 214, 215, 482, 749, 87, 483, 9, 10, 11, 486,
+ 218, 621, 206, 80, 36, 487, 281, 762, 206, 206,
+ 622, 275, 488, 80, 735, 489, 529, 491, 494, 521,
+ 936, 36, 503, 639, 336, 507, 495, 206, 944, 80,
+ 499, 311, 315, 525, 793, 214, 215, 789, 311, 375,
+ 206, 9, 10, 11, 378, 379, 545, 547, 697, 384,
+ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
+ 395, 550, 326, 564, 326, 258, 259, 260, 261, 262,
+ 565, 769, 92, 567, 789, 924, 925, 344, 683, 141,
+ 5, 788, 7, 138, 572, 831, 271, 573, 9, 10,
+ 11, 576, 623, 623, 578, 588, 791, 590, 593, 80,
+ 792, 596, 552, 619, 13, 633, 602, 15, 635, 75,
+ 653, 802, 676, 310, 648, 689, -310, 677, 788, 730,
+ -32, 16, 737, 738, 854, 36, 750, 857, 860, 739,
+ 833, 869, 870, 86, 755, 864, 14, 756, 770, 623,
+ 803, 809, 817, 22, 70, 70, 311, 206, 24, 818,
+ 876, -33, 821, 72, 824, 827, 627, 825, 880, 834,
+ 828, 836, 829, 837, 791, 622, 275, 838, 792, 887,
+ 842, 872, 850, 855, 863, 866, 865, 879, 789, 802,
+ 492, 493, 878, 88, 75, 620, 263, 264, 310, 265,
+ 266, 267, 268, 36, 839, 841, 5, 89, 7, 90,
+ 5, 857, 7, 138, 9, 10, 11, 623, 9, 10,
+ 11, 14, 263, 264, 881, 265, 266, 267, 268, 883,
+ 13, 884, 788, 927, 13, 886, 895, 896, 911, 857,
+ 206, 758, 80, 906, 882, 920, 915, 16, 919, 321,
+ 77, 16, -115, -115, -115, -115, 923, 929, -115, 932,
+ -115, -115, -115, 935, 946, 87, 938, 943, 947, 22,
+ 506, 858, 450, 22, 24, 212, -115, 727, 24, 637,
+ 574, 848, 410, 714, 321, 504, -124, -124, -124, -124,
+ -124, -124, -124, -115, -124, -124, -124, -124, -124, 589,
-124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, 73, -124, -124, 616, 811, 523, 809,
- 698, -124, 429, 668, -124, 803, -124, 614, 599, -124,
- -124, -124, 513, 514, 879, -124, -124, 595, 738, 677,
- -124, -124, 0, 0, 0, -124, 0, -124, -124, 0,
- 490, 0, -124, -124, 0, 0, -124, 0, -124, -124,
- -124, -124, 654, -124, -325, -325, -325, -325, -325, -325,
- -325, 0, -325, -325, -325, -325, -325, 0, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, -325, -325,
- -325, -325, -325, 0, -325, -325, 0, 0, 0, 0,
- 0, -325, 0, 0, -325, 0, -325, 0, 0, -325,
- -325, -325, 0, 0, 0, -325, -325, 0, 0, 0,
- -325, -325, 0, 0, 0, -325, 0, -325, -325, 0,
- 0, 0, -325, -325, 0, 0, -325, 0, -325, 0,
- -325, -325, 331, -325, -325, -325, 0, 0, 0, -325,
- -325, 0, -325, 0, 0, 0, -325, 0, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, -325, 0,
- -325, 0, -325, 0, -325, -325, 0, 0, 0, 0,
- 0, -325, 273, 274, -325, 275, 276, 277, 278, -325,
- -325, -325, 0, 0, 0, -325, -325, 0, 0, 0,
- -325, -325, 0, 0, 0, -325, 0, -325, -325, 0,
- 0, 0, -325, -325, 0, 0, -325, 0, -325, -300,
- -325, -325, 838, -325, -325, -325, 0, 0, 0, -325,
- -325, 0, -325, 0, 0, 0, -325, 0, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, -325, 0,
- -325, 0, -325, 0, -325, -325, 0, 0, 0, 0,
- 0, -325, 0, 0, -325, 0, 0, 0, 0, -325,
- -325, -325, 0, 0, 0, -325, -325, 0, 0, 0,
- -325, -325, 0, 0, 0, -325, 0, -325, -325, 0,
- 0, 0, -325, -325, 0, 0, -325, 0, -325, 0,
- -325, -325, 867, -325, -335, -335, 0, 0, 0, -335,
- -335, 0, -335, 0, 0, 0, -335, 0, -335, -335,
- -335, -335, -335, -335, -335, -335, -335, -335, -335, 0,
- -335, 0, -335, 0, -335, -335, 0, 0, 0, 75,
- 202, -335, 0, 0, -335, 0, 0, 0, 0, -335,
- -335, -335, 0, 0, 0, -335, -335, 0, 0, 0,
- -335, -335, 0, 0, 0, -335, 14, -335, -335, 0,
- 0, 0, -335, -335, 694, 0, -335, 0, -335, 0,
- -335, -335, 663, -335, 664, 51, 203, 0, 0, 103,
- 104, 0, 105, 0, 0, 204, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 205, 0,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 0, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 0, 665,
- 116, 117, 0, 0, 0, 118, 0, 119, 52, 0,
- 0, 0, 120, 53, 0, 0, 121, 0, 0, -203,
- 122, 123, 663, 666, 664, 51, 0, 0, 0, 103,
- 104, 258, 105, 259, 260, 261, 262, 263, 264, 265,
- 266, 267, 268, 269, 270, 271, 272, 0, 0, 0,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 0, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 0, 665,
- 116, 117, 0, 0, 0, 118, 0, 119, 52, 0,
- 0, 0, 120, 53, 0, 0, 121, 0, 0, -258,
- 122, 123, 663, 666, 664, 51, 0, 0, 0, 103,
- 104, 0, 105, 228, 0, 0, 5, 0, 7, 140,
- 0, 0, 0, 0, 9, 10, 11, 0, 0, 0,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 13, 109, 0, 15, 110, 0, 0, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 16, 0, 665,
- 116, 117, 0, 0, 0, 118, 0, 119, 52, 0,
- 0, 0, 120, 53, 0, 0, 121, 0, 0, 22,
- 122, 123, 196, 666, 24, -28, -28, -28, -28, 229,
- -261, 0, 0, -28, -28, -28, 0, 0, 0, 0,
- 0, 350, 0, 0, -24, -24, -24, -24, 197, -28,
- 0, -175, -24, -24, -24, 0, 0, -175, 266, 267,
- 268, 269, 270, 271, 272, 0, -28, 197, -24, 0,
- -175, 0, 0, 0, 0, 0, -175, 0, 0, 0,
- 198, 199, 0, 0, 0, -24, 0, 0, -28, 0,
- 0, 0, 0, -28, 0, 0, 0, 0, -175, 198,
- 199, 0, -175, -28, 0, 0, 0, -24, 0, 0,
- 0, 0, -24, 0, 0, 0, 0, -175, 0, 0,
- 344, -175, -24, -20, -20, -20, -20, 0, 0, 0,
- 0, -20, -20, -20, 0, 0, 0, 0, 0, 331,
- 0, 0, -488, -488, -488, -488, 197, -20, 0, -175,
- -488, -488, -488, 0, 0, -175, 0, 0, 0, 0,
- 0, 0, 0, 0, -20, 0, -488, 102, -488, 0,
- 0, 0, 103, 104, 0, 105, 0, 0, 0, 0,
- 0, 0, 0, -488, 0, 0, -20, 0, 0, 0,
- 0, -20, 0, 106, 0, 15, -175, 107, 108, 0,
- -175, -20, 0, 0, 109, -488, 0, 110, 0, 0,
- -488, 0, 111, 112, 113, 0, 0, 0, 114, 115,
- -488, 0, 0, 116, 117, 0, 102, 0, 118, 0,
- 119, 103, 104, 0, 105, 120, 0, 0, 0, 121,
- 0, 0, 0, 122, 123, 0, 0, 329, 0, 0,
- 0, 0, 106, 0, 15, 0, 107, 108, 0, 0,
- 0, 0, 0, 109, 0, 0, 110, 0, 0, 0,
- 0, 111, 112, 113, 0, 0, 0, 114, 115, 0,
- 0, 0, 116, 117, 0, 102, 0, 118, 0, 119,
- 103, 104, 0, 105, 120, 0, 0, 0, 121, 0,
- 0, 0, 122, 123, 0, 0, 412, 0, 0, 0,
- 0, 106, 0, 15, 0, 107, 108, 0, 0, 0,
- 0, 0, 109, 0, 0, 110, 0, 0, 0, 0,
- 111, 112, 113, 0, 0, 0, 114, 115, 0, 0,
- 0, 116, 117, 0, 102, 0, 118, 0, 119, 103,
- 104, 0, 105, 120, 0, 0, 0, 121, 0, 0,
- 0, 122, 123, 0, 0, 467, 0, 0, 0, 0,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 0, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 0, 0,
- 116, 117, 0, 102, 0, 118, 0, 119, 103, 104,
- 0, 105, 120, 0, 0, 0, 121, 0, 0, 0,
- 122, 123, 0, 0, 506, 0, 0, 0, 0, 106,
- 0, 15, 0, 107, 108, 0, 0, 0, 0, 0,
- 109, 0, 0, 110, 0, 0, 0, 0, 111, 112,
- 113, 0, 0, 0, 114, 115, 0, 0, 0, 116,
- 117, 0, 0, 0, 118, 0, 119, 0, 0, 0,
- 0, 120, 0, 0, 0, 121, 0, 0, 0, 122,
- 123, 0, 0, 758, 664, 768, 6, 7, 8, 103,
- 104, 0, 105, 9, 10, 11, 769, 0, 770, 771,
- 772, 773, 774, 775, 776, 777, 778, 779, 780, 13,
- 106, 14, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 16, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 0, 0,
- 116, 117, 0, 0, 0, 118, 0, 119, 781, 0,
- 0, 0, 120, 782, 0, 0, 121, 0, 783, 0,
- 122, 123, 0, 367, 664, 51, 0, 0, 0, 103,
- 104, 0, 105, 0, 0, 0, 769, 0, 770, 771,
- 772, 773, 774, 775, 776, 777, 778, 779, 780, 0,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 0, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 102, 0,
- 116, 117, 0, 103, 104, 118, 105, 119, 52, 0,
- 0, 0, 120, 53, 0, 0, 121, 0, 783, 0,
- 122, 123, 0, 367, 106, 0, 15, 0, 107, 108,
- 0, 0, 0, 0, 0, 109, 0, 0, 110, 0,
- 0, 0, 0, 111, 112, 113, 0, 0, 0, 114,
- 115, 0, 0, 0, 116, 117, 0, 0, 0, 118,
- 0, 119, 0, 0, 0, 0, 120, 0, 0, 0,
- 121, 0, 0, 0, 122, 123, 0, 484, 149, 150,
- 0, 151, 152, 0, 0, 0, 153, 154, 155, 156,
- 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
- 167, 168, 169, 170, 171, 0, 102, 5, 6, 7,
- 8, 103, 104, 172, 105, 9, 10, 11, 5, 6,
+ -124, -124, -124, -124, -124, -115, -124, -124, 718, 577,
+ -115, 468, 571, -124, 475, 719, -124, 728, -124, 575,
+ -115, -124, -124, -124, 664, 733, 928, -124, -124, 930,
+ 893, 894, -124, -124, 500, 517, 632, -124, 73, -124,
+ -124, 518, 616, 700, -124, -124, 815, 422, -124, 813,
+ -124, -124, -124, -124, 614, -124, 599, 679, 807, 508,
+ 643, 253, 254, 255, 256, 257, 258, 259, 260, 261,
+ 262, 656, 485, -331, -331, -331, -331, -331, -331, -331,
+ 670, -331, -331, -331, -331, -331, 741, -331, -331, -331,
+ -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
+ -331, -331, 0, -331, -331, 595, 0, 509, 0, 0,
+ -331, 0, 0, -331, 0, -331, 0, 0, -331, -331,
+ -331, 0, 0, 0, -331, -331, 0, 0, 0, -331,
+ -331, 0, 0, 0, -331, 0, -331, -331, 0, 0,
+ 0, -331, -331, 0, 643, -331, 0, -331, 0, -331,
+ -331, 321, -331, -331, -331, 0, 0, 0, -331, -331,
+ 0, -331, 0, 0, 0, -331, 0, -331, -331, -331,
+ -331, -331, -331, -331, -331, -331, -331, -331, 742, -331,
+ 0, -331, 0, -331, -331, 0, 0, 0, 0, 0,
+ -331, 0, 0, -331, 754, 0, 0, 0, -331, -331,
+ -331, 0, 0, 0, -331, -331, 0, 0, 0, -331,
+ -331, 0, 0, 0, -331, 670, -331, -331, 766, 0,
+ 0, -331, -331, 0, 0, -331, 0, -331, -306, -331,
+ -331, 0, -331, 0, 670, 0, 321, 670, 0, -331,
+ -331, -331, -331, 0, 0, 0, 0, -331, -331, -331,
+ 0, 0, 0, 814, 254, 255, 256, 257, 258, 259,
+ 260, 261, 262, -331, 0, 820, 0, 843, 0, -331,
+ -331, 0, 0, 0, -331, -331, 826, -331, 0, 0,
+ -331, -331, 0, -331, -331, -331, -331, -331, -331, -331,
+ -331, -331, -331, -331, 0, -331, 0, -331, 0, -331,
+ -331, 0, -331, 670, 0, 0, -331, -331, 0, -331,
+ 0, 0, 0, 0, -331, -331, -331, -111, 0, 0,
+ -331, -331, 0, 0, 0, -331, -331, 0, 0, 0,
+ -331, 0, -331, -331, 0, 0, 0, -331, -331, 0,
+ 0, -331, 0, -331, 0, -331, -331, 670, -331, 0,
+ 873, 0, -341, -341, 0, 0, 0, -341, -341, 885,
+ -341, 0, 0, 0, -341, 0, -341, -341, -341, -341,
+ -341, -341, -341, -341, -341, -341, -341, 0, -341, 0,
+ -341, 0, -341, -341, 0, 0, 0, 0, 0, -341,
+ 0, 0, -341, 0, 0, 0, 0, -341, -341, -341,
+ 0, 0, 0, -341, -341, 0, 0, 0, -341, -341,
+ 0, 0, 0, -341, 0, -341, -341, 0, 0, 0,
+ -341, -341, 0, 0, -341, 0, -341, 0, -341, -341,
+ 231, -341, 100, 5, 0, 7, 138, 101, 102, 0,
+ 103, 9, 10, 11, 250, 251, 252, 253, 254, 255,
+ 256, 257, 258, 259, 260, 261, 262, 13, 104, 0,
+ 15, 0, 105, 106, 0, 0, 0, 0, 0, 107,
+ 0, 0, 108, 0, 16, 0, 0, 109, 110, 111,
+ 0, 0, 0, 112, 113, 0, 0, 0, 114, 115,
+ 0, 0, 0, 116, 0, 117, 22, 0, 0, 0,
+ 118, 24, 0, 0, 119, 0, 0, 0, 120, 121,
+ 665, -94, 666, 60, 0, 0, 0, 101, 102, 248,
+ 103, 249, 250, 251, 252, 253, 254, 255, 256, 257,
+ 258, 259, 260, 261, 262, 0, 0, 0, 104, 0,
+ 15, 0, 105, 106, 0, 0, 0, 0, 0, 107,
+ 0, 0, 108, 0, 0, 0, 0, 109, 110, 111,
+ 0, 0, 0, 112, 113, 0, 0, 667, 114, 115,
+ 0, 0, 0, 116, 0, 117, 61, 0, 0, 0,
+ 118, 62, 0, 0, 119, 0, 0, -203, 120, 121,
+ 665, 668, 666, 60, 0, 0, 0, 101, 102, 0,
+ 103, 251, 252, 253, 254, 255, 256, 257, 258, 259,
+ 260, 261, 262, 0, 0, 0, 0, 0, 104, 0,
+ 15, 0, 105, 106, 0, 0, 0, 0, 0, 107,
+ 0, 0, 108, 0, 0, 0, 0, 109, 110, 111,
+ 0, 0, 0, 112, 113, 0, 0, 667, 114, 115,
+ 0, 0, 0, 116, 0, 117, 61, 0, 0, 0,
+ 118, 62, 0, 0, 119, 0, 0, -264, 120, 121,
+ 665, 668, 666, 60, 0, 0, 0, 101, 102, 0,
+ 103, 252, 253, 254, 255, 256, 257, 258, 259, 260,
+ 261, 262, 0, 0, 0, 0, 0, 0, 104, 0,
+ 15, 0, 105, 106, 0, 0, 0, 0, 0, 107,
+ 0, 0, 108, 0, 0, 0, 0, 109, 110, 111,
+ 0, 0, 0, 112, 113, 0, 0, 667, 114, 115,
+ 0, 0, 0, 116, 0, 117, 61, 0, 0, 0,
+ 118, 62, 0, 0, 119, 641, 0, 100, 120, 121,
+ 0, 668, 101, 102, 0, 103, 344, 0, 0, 5,
+ 0, 7, 138, 0, 0, 0, 0, 9, 10, 11,
+ 0, 0, 0, 104, 0, 15, 0, 105, 106, 0,
+ 0, 0, 0, 13, 107, 0, 15, 108, 0, 0,
+ 0, 0, 109, 110, 111, 0, 0, 0, 112, 113,
+ 16, 0, 0, 114, 115, 0, 0, 0, 116, 0,
+ 117, 0, 0, 0, 0, 118, 0, 0, 0, 119,
+ 0, 0, 22, 120, 121, 194, 642, 24, -28, -28,
+ -28, -28, 345, -267, 0, 0, -28, -28, -28, 0,
+ 0, 0, 0, 0, 340, 0, 0, -24, -24, -24,
+ -24, 195, -28, 0, -175, -24, -24, -24, 0, 0,
+ -175, 255, 256, 257, 258, 259, 260, 261, 262, -28,
+ 195, -24, 0, -175, 0, 0, 0, 0, 0, -175,
+ 0, 0, 0, 196, 197, 0, 0, 0, -24, 0,
+ 0, -28, 0, 0, 0, 0, -28, 0, 0, 0,
+ 0, -175, 196, 197, 0, -175, -28, 0, 0, 0,
+ -24, 0, 0, 0, 0, -24, 0, 0, 0, 0,
+ -175, 0, 0, 334, -175, -24, -20, -20, -20, -20,
+ 0, 0, 0, 0, -20, -20, -20, 0, 0, 0,
+ 0, 0, 321, 0, 0, 5, 6, 7, 8, 195,
+ -20, 0, -175, 9, 10, 11, 0, 0, -175, 256,
+ 257, 258, 259, 260, 261, 262, 0, -20, 0, 13,
+ 0, 14, 0, 5, 0, 7, 280, 0, 0, 0,
+ 0, 9, 10, 11, 0, 0, 16, 0, 0, -20,
+ 0, 0, 0, 0, -20, 0, 0, 13, 0, -175,
+ 0, 0, 0, -175, -20, 0, 321, 0, 22, -494,
+ -494, -494, -494, 24, 16, 0, 0, -494, -494, -494,
+ 0, 0, 0, -492, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, -494, 100, -494, 22, 0, 0, 101,
+ 102, 24, 103, 0, 0, 0, -276, -276, 0, 0,
+ -494, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 104, 0, 15, 0, 105, 106, 0, 0, 0, 0,
+ 0, 107, -494, 0, 108, 0, 0, -494, 0, 109,
+ 110, 111, 0, 0, 0, 112, 113, -494, 0, 0,
+ 114, 115, 0, 100, 0, 116, 0, 117, 101, 102,
+ 0, 103, 118, 0, 0, 0, 119, 0, 0, 0,
+ 120, 121, 0, 0, 319, 0, 0, 0, 0, 104,
+ 0, 15, 0, 105, 106, 0, 0, 0, 0, 0,
+ 107, 0, 0, 108, 0, 0, 0, 0, 109, 110,
+ 111, 0, 0, 0, 112, 113, 0, 0, 0, 114,
+ 115, 0, 100, 0, 116, 0, 117, 101, 102, 0,
+ 103, 118, 0, 0, 0, 119, 0, 0, 0, 120,
+ 121, 0, 0, 405, 0, 0, 0, 0, 104, 0,
+ 15, 0, 105, 106, 0, 0, 0, 0, 0, 107,
+ 0, 0, 108, 0, 0, 0, 0, 109, 110, 111,
+ 0, 0, 0, 112, 113, 0, 0, 0, 114, 115,
+ 0, 100, 0, 116, 0, 117, 101, 102, 0, 103,
+ 118, 0, 0, 0, 119, 0, 0, 0, 120, 121,
+ 0, 0, 460, 0, 0, 0, 0, 104, 0, 15,
+ 0, 105, 106, 0, 0, 0, 0, 0, 107, 0,
+ 0, 108, 0, 0, 0, 0, 109, 110, 111, 0,
+ 0, 0, 112, 113, 0, 0, 0, 114, 115, 0,
+ 100, 0, 116, 0, 117, 101, 102, 0, 103, 118,
+ 0, 0, 0, 119, 0, 0, 0, 120, 121, 0,
+ 0, 501, 0, 0, 0, 0, 104, 0, 15, 0,
+ 105, 106, 0, 0, 0, 0, 0, 107, 0, 0,
+ 108, 0, 0, 0, 0, 109, 110, 111, 0, 0,
+ 0, 112, 113, 0, 0, 0, 114, 115, 0, 0,
+ 0, 116, 0, 117, 0, 0, 0, 0, 118, 0,
+ 0, 0, 119, 0, 0, 0, 120, 121, 0, 0,
+ 761, 666, 772, 6, 7, 8, 101, 102, 0, 103,
+ 9, 10, 11, 773, 0, 774, 775, 776, 777, 778,
+ 779, 780, 781, 782, 783, 784, 13, 104, 14, 15,
+ 0, 105, 106, 0, 0, 0, 0, 0, 107, 0,
+ 0, 108, 0, 16, 0, 0, 109, 110, 111, 0,
+ 0, 0, 112, 113, 0, 0, 0, 114, 115, 0,
+ 0, 0, 116, 0, 117, 785, 0, 0, 0, 118,
+ 786, 0, 0, 119, 0, 787, 0, 120, 121, 0,
+ 360, 666, 60, 0, 0, 0, 101, 102, 0, 103,
+ 0, 0, 0, 773, 0, 774, 775, 776, 777, 778,
+ 779, 780, 781, 782, 783, 784, 0, 104, 0, 15,
+ 0, 105, 106, 0, 0, 0, 0, 0, 107, 0,
+ 0, 108, 0, 0, 0, 0, 109, 110, 111, 0,
+ 0, 0, 112, 113, 0, 100, 0, 114, 115, 0,
+ 101, 102, 116, 103, 117, 61, 0, 0, 0, 118,
+ 62, 0, 0, 119, 0, 787, 0, 120, 121, 0,
+ 360, 104, 0, 15, 0, 105, 106, 0, 0, 0,
+ 0, 0, 107, 0, 0, 108, 0, 0, 0, 0,
+ 109, 110, 111, 0, 0, 0, 112, 113, 0, 0,
+ 0, 114, 115, 0, 0, 0, 116, 0, 117, 0,
+ 0, 0, 0, 118, 0, 0, 0, 119, 0, 0,
+ 0, 120, 121, 0, 479, 147, 148, 0, 149, 150,
+ 0, 0, 0, 151, 152, 153, 154, 155, 156, 157,
+ 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 0, 100, 5, 6, 7, 8, 101, 102,
+ 170, 103, 9, 10, 11, 5, 6, 7, 8, 0,
+ 0, 0, 0, 9, 10, 11, 0, 0, 13, 104,
+ 14, 15, 0, 105, 106, 0, 0, 0, 0, 13,
+ 107, 14, 0, 108, 172, 16, 0, 0, 109, 110,
+ 111, 0, 0, 295, 112, 113, 16, 0, 0, 114,
+ 115, 0, 0, 0, 116, 0, 117, 22, 0, 0,
+ 0, 118, 24, 0, 0, 119, 0, 0, 22, 120,
+ 121, 100, 5, 24, 7, 138, 101, 102, 84, 103,
+ 9, 10, 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 13, 104, 0, 15,
+ 0, 105, 106, 0, 0, 0, 0, 0, 107, 0,
+ 0, 108, 0, 16, 0, 0, 109, 110, 111, 0,
+ 0, 0, 112, 113, 0, 100, 0, 114, 115, 0,
+ 101, 102, 116, 103, 117, 22, 0, 0, 0, 118,
+ 24, 0, 0, 119, 0, 0, 0, 120, 121, 0,
+ 0, 104, 0, 15, 0, 105, 106, 0, 0, 0,
+ 0, 0, 107, 0, 0, 108, 0, 0, 0, 0,
+ 109, 110, 111, 0, 0, 0, 112, 113, 0, 100,
+ 0, 114, 115, 0, 101, 102, 116, 103, 117, 364,
+ 0, 0, 0, 118, 0, 0, 0, 119, 0, 0,
+ 0, 120, 121, 0, 0, 104, 0, 15, 0, 105,
+ 106, 0, 0, 0, 0, 0, 107, 0, 0, 108,
+ 0, 0, 0, 0, 109, 110, 111, 0, 0, 0,
+ 112, 113, 0, 100, 0, 114, 115, 0, 101, 102,
+ 116, 103, 117, 0, 0, 0, 0, 118, 0, 0,
+ 0, 119, 0, 830, 0, 120, 121, 0, 0, 104,
+ 0, 15, 0, 105, 106, 0, 0, 0, 0, 0,
+ 107, 0, 0, 108, 0, 0, 0, 0, 109, 110,
+ 111, 0, 0, 0, 112, 113, 0, 100, 0, 114,
+ 115, 0, 101, 102, 116, 103, 117, 0, 0, 0,
+ 0, 118, 0, 0, 0, 119, 0, 0, 0, 120,
+ 121, 0, 0, 104, 0, 15, 0, 105, 106, 0,
+ 0, 0, 0, 0, 107, 0, 0, 108, 0, 0,
+ 0, 0, 109, 110, 111, 0, 0, 0, 112, 113,
+ 0, 100, 0, 242, 115, 0, 101, 102, 116, 103,
+ 117, 0, 0, 0, 0, 118, 0, 0, 0, 119,
+ 0, 0, 0, 120, 121, 0, 0, 104, 0, 15,
+ 0, 105, 106, 0, 0, 0, 0, 0, 107, 0,
+ 0, 108, 0, 0, 0, 0, 109, 110, 111, 0,
+ 0, 0, 112, 113, 0, 505, 0, 244, 115, 0,
+ 101, 102, 116, 103, 117, 0, 0, 0, 0, 118,
+ 0, 0, 0, 119, 0, 0, 0, 120, 121, 0,
+ 0, 104, 0, 15, 0, 105, 106, 0, 0, 0,
+ 0, 0, 107, 0, 0, 108, 0, 0, 0, 0,
+ 109, 110, 111, 0, 0, 0, 112, 113, 0, 0,
+ 0, 114, 115, 0, 0, 0, 116, 0, 117, 0,
+ 0, 0, 0, 118, 0, 0, 0, 119, 0, 0,
+ 540, 120, 121, 5, 0, 7, 138, 0, 0, 0,
+ 0, 9, 10, 11, 0, 0, 0, 0, 540, 0,
+ 0, 5, 0, 7, 138, 0, 0, 13, 0, 9,
+ 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 13, 0, 0, 0, 0,
+ 0, 0, 4, 0, -128, 5, 6, 7, 8, 0,
+ 0, 0, 16, 9, 10, 11, 22, -446, -446, -446,
+ 0, 24, 0, 0, 0, 0, 541, -446, 12, 13,
+ 0, 14, 15, 0, 22, -445, -445, -445, 0, 24,
+ 0, 0, 0, 0, 541, -445, 16, 0, 0, 17,
+ 18, -128, 0, 0, 0, 0, 0, 0, 0, 0,
+ -128, 0, 19, 20, 21, 0, 0, 0, 22, 0,
+ 0, 0, 23, 24, 25, 26, 0, 4, 27, -128,
+ 5, 6, 7, 8, 0, 0, 0, 0, 9, 10,
+ 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 13, 4, 14, -128, 5, 6,
7, 8, 0, 0, 0, 0, 9, 10, 11, 0,
- 0, 13, 106, 14, 15, 0, 107, 108, 0, 0,
- 0, 0, 13, 109, 14, 0, 110, 174, 16, 0,
- 0, 111, 112, 113, 0, 0, 305, 114, 115, 16,
- 0, 0, 116, 117, 0, 0, 0, 118, 0, 119,
- 22, 0, 0, 0, 120, 24, 0, 0, 121, 0,
- 0, 22, 122, 123, 102, 5, 24, 7, 140, 103,
- 104, 84, 105, 9, 10, 11, 260, 261, 262, 263,
- 264, 265, 266, 267, 268, 269, 270, 271, 272, 13,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 16, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 102, 0,
- 116, 117, 0, 103, 104, 118, 105, 119, 22, 0,
- 0, 0, 120, 24, 0, 0, 121, 0, 0, 0,
- 122, 123, 0, 0, 106, 0, 15, 0, 107, 108,
- 0, 0, 0, 0, 0, 109, 0, 0, 110, 0,
- 0, 0, 0, 111, 112, 113, 0, 0, 0, 114,
- 115, 0, 102, 0, 116, 117, 0, 103, 104, 118,
- 105, 119, 371, 0, 0, 0, 120, 0, 0, 0,
- 121, 0, 0, 0, 122, 123, 0, 0, 106, 0,
- 15, 0, 107, 108, 0, 0, 0, 0, 0, 109,
- 0, 0, 110, 0, 0, 0, 0, 111, 112, 113,
- 0, 0, 0, 114, 115, 0, 102, 0, 116, 117,
- 0, 103, 104, 118, 105, 119, 0, 0, 0, 0,
- 120, 0, 0, 0, 121, 0, 825, 0, 122, 123,
- 0, 0, 106, 0, 15, 0, 107, 108, 0, 0,
- 0, 0, 0, 109, 0, 0, 110, 0, 0, 0,
- 0, 111, 112, 113, 0, 0, 0, 114, 115, 0,
- 102, 0, 116, 117, 0, 103, 104, 118, 105, 119,
- 0, 0, 0, 0, 120, 0, 0, 0, 121, 0,
- 0, 0, 122, 123, 0, 0, 106, 0, 15, 0,
- 107, 108, 0, 0, 0, 0, 0, 109, 0, 0,
- 110, 0, 0, 0, 0, 111, 112, 113, 0, 0,
- 0, 114, 115, 0, 102, 0, 252, 117, 0, 103,
- 104, 118, 105, 119, 0, 0, 0, 0, 120, 0,
- 0, 0, 121, 0, 0, 0, 122, 123, 0, 0,
- 106, 0, 15, 0, 107, 108, 0, 0, 0, 0,
- 0, 109, 0, 0, 110, 0, 0, 0, 0, 111,
- 112, 113, 0, 0, 0, 114, 115, 0, 510, 0,
- 254, 117, 0, 103, 104, 118, 105, 119, 0, 0,
- 0, 0, 120, 0, 0, 0, 121, 0, 0, 0,
- 122, 123, 0, 0, 106, 0, 15, 0, 107, 108,
- 0, 0, 0, 0, 0, 109, 0, 0, 110, 0,
- 0, 0, 0, 111, 112, 113, 0, 0, 0, 114,
- 115, 0, 0, 0, 116, 117, 0, 0, 0, 118,
- 0, 119, 0, 0, 0, 0, 120, 0, 0, 0,
- 121, 0, 0, 545, 122, 123, 5, 0, 7, 140,
- 0, 0, 0, 0, 9, 10, 11, 0, 0, 0,
- 0, 545, 0, 0, 5, 0, 7, 140, 0, 0,
- 13, 0, 9, 10, 11, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 0, 16, 13, 0,
- 0, 0, 0, 0, 0, 4, 0, -128, 5, 6,
- 7, 8, 0, 0, 0, 16, 9, 10, 11, 22,
- -440, -440, -440, 0, 24, 0, 0, 0, 0, 546,
- -440, 12, 13, 0, 14, 15, 0, 22, -439, -439,
- -439, 0, 24, 0, 0, 0, 0, 546, -439, 16,
- 0, 0, 17, 18, -128, 0, 0, 0, 0, 0,
- 0, 0, 0, -128, 0, 19, 20, 21, 0, 0,
- 0, 22, 0, 0, 0, 23, 24, 25, 26, 0,
- 4, 27, -128, 5, 6, 7, 8, 0, 0, 0,
- 0, 9, 10, 11, 263, 264, 265, 266, 267, 268,
- 269, 270, 271, 272, 0, 0, 0, 13, 4, 14,
- -128, 5, 6, 7, 8, 0, 0, 0, 0, 9,
- 10, 11, 0, 0, 16, 0, 0, 531, 532, -128,
- 0, 0, 0, 0, 0, 13, 0, 14, -128, 0,
- 0, 0, 0, 0, 0, 0, 22, 0, 0, 0,
- 0, 24, 16, 0, 0, 0, 27, -128, 441, 0,
- 442, 5, 6, 7, 8, 0, -128, 443, 0, 9,
- 10, 11, 0, 0, 22, 0, 0, 441, 0, 24,
- 5, 6, 7, 8, 27, 13, 443, 14, 9, 10,
- 11, 5, 0, 7, 290, 0, 0, 0, 0, 9,
- 10, 11, 16, 0, 13, 0, 14, 0, 0, 0,
- 5, 6, 7, 8, 0, 13, 0, 0, 9, 10,
- 11, 16, 0, 0, 22, 0, 0, 0, 0, 24,
- 0, 0, 16, -385, 13, 0, 14, 0, 0, 0,
- 0, 0, 0, 22, 0, 0, 0, 0, 24, 0,
- 0, 16, -385, 0, 22, 0, 0, 0, 0, 24,
- 5, 6, 7, 8, -270, -270, 0, 0, 9, 10,
- 11, 0, 0, 22, 0, 0, 0, 0, 24, 0,
- 0, 0, 0, 598, 13, 0, 14, 0, 0, 0,
- 0, 0, 0, 0, 149, 150, 0, 151, 152, 0,
- 0, 16, 153, 154, 155, 156, 157, 158, 159, 160,
- 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
- 171, 0, 0, 22, 0, 14, 0, 0, 24, 172,
- 256, 257, 258, 835, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 0, 0,
- 173, 0, 0, 0, 0, 0, 149, 150, 0, 151,
- 152, 0, 0, 174, 153, 154, 155, 156, 157, 158,
- 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
- 169, 170, 171, 0, 149, 150, 0, 151, 152, 0,
- 0, 374, 153, 154, 155, 156, 157, 158, 159, 160,
- 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
- 171, 0, 0, 0, 0, 0, 0, 0, 0, 172,
- 149, 150, 0, 151, 152, 174, 0, 0, 153, 154,
- 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
- 165, 166, 167, 168, 169, 170, 171, 0, 0, 5,
- 0, 7, 290, 174, 0, 583, 0, 9, 10, 11,
- 5, 6, 7, 8, 0, 0, 443, 0, 9, 10,
- 11, 0, 0, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 0, 14, 0, 0, 174,
- 16, 0, 0, 0, 0, 283, 0, 0, 0, 0,
- 0, 16, 0, 0, 284, 285, 0, 0, 0, 0,
- 0, 0, 22, 0, 0, 0, 0, 24, 0, 0,
- 0, 0, 0, 22, 5, 6, 7, 8, 24, 0,
- 631, 0, 9, 10, 11, 5, 6, 7, 8, 0,
- 0, 0, 0, 9, 10, 11, 0, 0, 13, 0,
- 14, 0, 0, 0, 5, 6, 7, 8, 0, 13,
- 0, 14, 9, 10, 11, 16, 0, 0, 0, 0,
- 0, 0, 5, 0, 7, 140, 16, 0, 13, 0,
- 9, 10, 11, 0, 0, 0, 0, 22, 0, 0,
- 0, 5, 24, 7, 290, 16, 13, 0, 22, 9,
- 10, 11, 0, 24, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 0, 13, 0, 22, 0, 0,
- 0, 0, 24, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 16, 0, 0, 22, 855, 0, 0, 0,
- 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 22, 0, 0, 0, 0, 24,
- 0, 256, 257, 258, 856, 259, 260, 261, 262, 263,
- 264, 265, 266, 267, 268, 269, 270, 271, 272, 256,
- 257, 258, 894, 259, 260, 261, 262, 263, 264, 265,
- 266, 267, 268, 269, 270, 271, 272, 256, 257, 258,
- 0, 259, 260, 261, 262, 263, 264, 265, 266, 267,
- 268, 269, 270, 271, 272
+ 0, 16, 0, 0, 526, 527, -128, 0, 0, 0,
+ 0, 0, 13, 0, 14, -128, 0, 0, 0, 0,
+ 0, 0, 0, 22, 0, 0, 0, 0, 24, 16,
+ 0, 0, 0, 27, -128, 434, 0, 435, 5, 6,
+ 7, 8, 0, -128, 436, 0, 9, 10, 11, 0,
+ 0, 22, 0, 0, 434, 0, 24, 5, 6, 7,
+ 8, 27, 13, 436, 14, 9, 10, 11, 5, 6,
+ 7, 8, 0, 0, 0, 0, 9, 10, 11, 16,
+ 0, 13, 0, 14, 0, 0, 0, 5, 6, 7,
+ 8, 0, 13, 0, 14, 9, 10, 11, 16, 0,
+ 0, 22, 0, 0, 0, 0, 24, 0, 0, 16,
+ -391, 13, 0, 14, 0, 0, 0, 0, 0, 0,
+ 22, 0, 0, 0, 0, 24, 0, 0, 16, -391,
+ 0, 22, 0, 0, 0, 0, 24, 0, 0, 0,
+ 0, 598, 0, 0, 0, 0, 0, 0, 0, 0,
+ 22, 0, 0, 147, 148, 24, 149, 150, 0, 0,
+ 840, 151, 152, 153, 154, 155, 156, 157, 158, 159,
+ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+ 0, 147, 148, 0, 149, 150, 0, 0, 170, 151,
+ 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
+ 162, 163, 164, 165, 166, 167, 168, 169, 0, 171,
+ 0, 0, 0, 0, 0, 0, 367, 147, 148, 0,
+ 149, 150, 172, 0, 0, 151, 152, 153, 154, 155,
+ 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
+ 166, 167, 168, 169, 0, 147, 148, 0, 149, 150,
+ 172, 0, 170, 151, 152, 153, 154, 155, 156, 157,
+ 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 0, 0, 5, 0, 7, 280, 0, 0,
+ 583, 0, 9, 10, 11, 0, 172, 5, 6, 7,
+ 8, 0, 0, 436, 0, 9, 10, 11, 13, 5,
+ 6, 7, 8, 0, 0, 631, 0, 9, 10, 11,
+ 0, 13, 0, 14, 172, 16, 0, 0, 0, 0,
+ 273, 0, 0, 13, 0, 14, 0, 0, 16, 274,
+ 275, 0, 0, 0, 0, 0, 0, 22, 0, 0,
+ 16, 0, 24, 0, 5, 6, 7, 8, 0, 0,
+ 22, 0, 9, 10, 11, 24, 5, 6, 7, 8,
+ 0, 0, 22, 0, 9, 10, 11, 24, 13, 5,
+ 14, 7, 280, 0, 0, 0, 0, 9, 10, 11,
+ 13, 0, 0, 0, 0, 16, 0, 0, 0, 0,
+ 0, 0, 0, 13, 0, 0, 0, 16, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 22, 0, 0,
+ 16, 0, 24, 861, 0, 0, 0, 0, 0, 22,
+ 0, 0, 0, 0, 24, 0, 0, 0, 0, 0,
+ 0, 0, 22, 0, 0, 0, 0, 24, 246, 247,
+ 248, 862, 249, 250, 251, 252, 253, 254, 255, 256,
+ 257, 258, 259, 260, 261, 262, 14, 0, 0, 0,
+ 0, 246, 247, 248, 0, 249, 250, 251, 252, 253,
+ 254, 255, 256, 257, 258, 259, 260, 261, 262, 246,
+ 247, 248, 900, 249, 250, 251, 252, 253, 254, 255,
+ 256, 257, 258, 259, 260, 261, 262, 246, 247, 248,
+ 0, 249, 250, 251, 252, 253, 254, 255, 256, 257,
+ 258, 259, 260, 261, 262
};
-static const short yycheck[] = { 9,
- 10, 11, 209, 24, 2, 3, 16, 60, 61, 19,
- 20, 288, 208, 23, 83, 25, 26, 2, 3, 2,
- 3, 33, 2, 3, 91, 22, 85, 24, 177, 36,
- 326, 318, 345, 31, 203, 33, 98, 243, 351, 347,
- 66, 39, 98, 33, 31, 277, 67, 333, 32, 33,
- 71, 411, 107, 108, 39, 177, 39, 284, 113, 39,
- 636, 477, 142, 553, 74, 145, 434, 432, 204, 124,
- 67, 61, 1, 80, 71, 194, 58, 200, 736, 77,
- 135, 88, 1, 818, 94, 83, 1, 85, 116, 38,
- 77, 10, 9, 91, 1, 3, 3, 4, 85, 109,
- 3, 4, 27, 1, 76, 45, 38, 521, 98, 81,
- 715, 525, 59, 60, 283, 98, 38, 324, 38, 0,
- 3, 4, 30, 45, 246, 45, 116, 76, 733, 76,
- 0, 3, 4, 868, 59, 60, 146, 423, 148, 59,
- 417, 81, 50, 801, 76, 173, 199, 214, 77, 3,
- 4, 59, 60, 888, 568, 145, 891, 571, 893, 76,
- 67, 59, 172, 82, 67, 72, 901, 82, 59, 72,
- 38, 233, 182, 183, 539, 185, 186, 233, 38, 82,
- 59, 408, 38, 173, 67, 45, 844, 59, 420, 72,
- 59, 59, 245, 191, 3, 67, 194, 195, 933, 82,
- 72, 208, 45, 339, 191, 59, 204, 343, 195, 699,
- 700, 334, 219, 67, 82, 225, 214, 204, 72, 247,
- 76, 288, 345, 342, 252, 278, 254, 77, 351, 77,
- 39, 81, 285, 892, 520, 358, 3, 360, 248, 604,
- 527, 30, 232, 233, 660, 613, 230, 30, 232, 38,
- 233, 76, 234, 82, 236, 377, 81, 247, 834, 3,
- 4, 920, 252, 30, 254, 275, 276, 30, 3, 4,
- 630, 3, 4, 301, 65, 7, 1, 59, 60, 4,
- 5, 6, 7, 50, 82, 10, 76, 12, 13, 14,
- 311, 81, 59, 579, 76, 348, 59, 60, 30, 309,
- 59, 60, 82, 28, 3, 4, 5, 6, 7, 48,
- 49, 301, 59, 729, 311, 370, 50, 76, 50, 606,
- 45, 59, 812, 67, 63, 59, 60, 59, 72, 77,
- 328, 338, 67, 81, 387, 77, 59, 72, 82, 81,
- 72, 339, 67, 353, 342, 343, 27, 72, 76, 30,
- 417, 583, 339, 81, 560, 36, 343, 82, 27, 30,
- 592, 30, 415, 640, 486, 514, 78, 36, 67, 655,
- 3, 4, 658, 72, 1, 78, 438, 4, 76, 6,
- 7, 59, 438, 81, 59, 12, 13, 14, 59, 60,
- 59, 60, 514, 701, 77, 622, 77, 30, 81, 427,
- 81, 28, 689, 77, 31, 38, 76, 81, 77, 419,
- 431, 9, 81, 411, 68, 69, 70, 50, 45, 68,
- 69, 70, 227, 839, 78, 423, 59, 623, 426, 78,
- 235, 3, 4, 445, 431, 712, 434, 427, 423, 72,
- 67, 81, 674, 423, 75, 72, 458, 445, 438, 434,
- 434, 574, 621, 77, 434, 445, 579, 81, 627, 77,
- 444, 445, 7, 81, 586, 77, 3, 4, 458, 81,
- 251, 76, 699, 553, 554, 256, 257, 76, 50, 706,
- 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
- 271, 272, 77, 30, 38, 67, 81, 68, 69, 70,
- 72, 5, 512, 7, 516, 50, 575, 78, 77, 68,
- 69, 70, 81, 50, 59, 60, 77, 804, 516, 78,
- 81, 519, 59, 60, 536, 731, 516, 50, 51, 52,
- 82, 515, 59, 656, 519, 658, 534, 77, 536, 519,
- 36, 346, 3, 4, 77, 78, 536, 534, 617, 618,
- 81, 535, 536, 612, 616, 553, 554, 67, 548, 557,
- 616, 767, 77, 547, 548, 76, 553, 554, 578, 30,
- 883, 352, 885, 640, 76, 565, 82, 575, 76, 638,
- 564, 565, 608, 609, 59, 60, 755, 59, 60, 50,
- 3, 4, 602, 77, 7, 38, 3, 59, 59, 597,
- 7, 77, 78, 3, 4, 59, 60, 7, 389, 390,
- 597, 72, 76, 611, 612, 613, 623, 30, 77, 617,
- 618, 77, 78, 30, 622, 612, 616, 10, 613, 613,
- 30, 927, 630, 613, 76, 622, 63, 50, 636, 935,
- 638, 59, 60, 50, 3, 712, 59, 60, 7, 702,
- 50, 638, 59, 60, 82, 665, 863, 128, 129, 59,
- 76, 27, 9, 869, 83, 77, 36, 472, 78, 78,
- 76, 30, 76, 78, 479, 480, 78, 38, 731, 3,
- 4, 76, 76, 1, 753, 76, 4, 5, 6, 7,
- 76, 50, 76, 38, 12, 13, 14, 76, 83, 76,
- 59, 699, 700, 83, 910, 911, 30, 76, 706, 82,
- 28, 721, 699, 700, 767, 496, 6, 7, 76, 706,
- 63, 731, 12, 13, 14, 778, 50, 45, 63, 4,
- 5, 6, 7, 731, 76, 59, 36, 12, 13, 14,
- 78, 81, 83, 798, 32, 38, 731, 745, 731, 67,
- 83, 731, 77, 28, 72, 753, 76, 767, 745, 81,
- 883, 782, 885, 816, 82, 834, 819, 820, 573, 779,
- 45, 5, 6, 7, 827, 76, 788, 836, 12, 13,
- 14, 77, 3, 77, 781, 782, 567, 38, 83, 842,
- 788, 63, 67, 78, 78, 38, 849, 72, 788, 38,
- 798, 582, 77, 787, 788, 54, 55, 860, 57, 58,
- 59, 60, 78, 798, 812, 798, 869, 81, 798, 624,
- 625, 626, 63, 628, 629, 812, 38, 76, 45, 46,
- 47, 48, 49, 50, 51, 52, 834, 81, 836, 892,
- 1, 78, 3, 36, 63, 83, 651, 8, 9, 836,
- 11, 1, 78, 38, 4, 5, 6, 7, 59, 869,
- 59, 914, 12, 13, 14, 646, 38, 920, 29, 650,
- 31, 59, 33, 34, 77, 680, 681, 682, 28, 40,
- 30, 77, 43, 5, 6, 7, 38, 48, 49, 50,
- 12, 13, 14, 54, 55, 45, 7, 678, 59, 60,
- 77, 77, 16, 64, 78, 66, 59, 77, 30, 77,
- 71, 59, 717, 694, 75, 17, 63, 67, 79, 80,
- 76, 82, 72, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 82, 1, 715, 3, 4, 718, 6, 7,
- 8, 9, 77, 11, 12, 13, 14, 48, 49, 50,
- 51, 52, 733, 76, 9, 736, 59, 77, 76, 764,
- 28, 29, 77, 31, 76, 33, 34, 77, 77, 0,
- 77, 752, 40, 81, 0, 43, 76, 45, 76, 420,
- 48, 49, 50, 77, 77, 819, 54, 55, 334, 656,
- 798, 59, 60, 774, 639, 87, 64, 419, 66, 67,
- 291, 355, 646, 71, 72, 233, 574, 75, 360, 225,
- 656, 79, 80, 580, 82, 658, 353, 869, 869, 915,
- 801, 414, 1, 917, 3, 4, 5, 6, 7, 8,
- 9, 557, 11, 12, 13, 14, 15, 426, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 25, 33, 34, 544, 753, 426, 750,
- 618, 40, 310, 844, 43, 745, 45, 537, 519, 48,
- 49, 50, 422, 422, 855, 54, 55, 514, 674, 586,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- 377, -1, 71, 72, -1, -1, 75, -1, 77, 78,
- 79, 80, 1, 82, 3, 4, 5, 6, 7, 8,
- 9, -1, 11, 12, 13, 14, 15, -1, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, 45, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, -1,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, 77, -1,
- 79, 80, 1, 82, 3, 4, -1, -1, -1, 8,
- 9, -1, 11, -1, -1, -1, 15, -1, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, 54, 55, 43, 57, 58, 59, 60, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, -1,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, 77, 78,
- 79, 80, 1, 82, 3, 4, -1, -1, -1, 8,
- 9, -1, 11, -1, -1, -1, 15, -1, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, -1,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, 77, -1,
- 79, 80, 1, 82, 3, 4, -1, -1, -1, 8,
- 9, -1, 11, -1, -1, -1, 15, -1, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, 3,
- 4, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, -1,
- 59, 60, -1, -1, -1, 64, 30, 66, 67, -1,
- -1, -1, 71, 72, 38, -1, 75, -1, 77, -1,
- 79, 80, 1, 82, 3, 4, 50, -1, -1, 8,
- 9, -1, 11, -1, -1, 59, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 72, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, 58,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, -1, 78,
- 79, 80, 1, 82, 3, 4, -1, -1, -1, 8,
- 9, 37, 11, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, -1, -1, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, 58,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, -1, 78,
- 79, 80, 1, 82, 3, 4, -1, -1, -1, 8,
- 9, -1, 11, 1, -1, -1, 4, -1, 6, 7,
+static const short yycheck[] = { 56,
+ 57, 31, 207, 16, 2, 3, 19, 20, 2, 3,
+ 23, 198, 25, 26, 33, 83, 85, 91, 201, 2,
+ 3, 22, 335, 24, 206, 38, 39, 40, 341, 105,
+ 106, 24, 233, 2, 3, 111, 267, 308, 337, 548,
+ 9, 10, 11, 316, 42, 66, 122, 77, 42, 278,
+ 175, 404, 274, 323, 636, 85, 95, 133, 221, 42,
+ 221, 74, 31, 427, 33, 1, 67, 202, 192, 140,
+ 71, 175, 143, 42, 67, 32, 33, 114, 71, 3,
+ 336, 425, 570, 9, 1, 739, 38, 343, 27, 1,
+ 273, 38, 1, 10, 107, 351, 898, 3, 4, 77,
+ 3, 77, 30, 81, 717, 81, 30, 59, 77, 314,
+ 38, 3, 4, 823, 83, 77, 85, 38, 38, 81,
+ 59, 60, 91, 736, 926, 36, 50, 3, 4, 76,
+ 82, 144, 236, 146, 171, 59, 33, 324, 212, 42,
+ 197, 77, 53, 54, 55, 0, 416, 59, 335, 45,
+ 76, 805, 3, 4, 341, 76, 76, 170, 50, 189,
+ 57, 67, 0, 193, 874, 82, 72, 180, 181, 80,
+ 183, 184, 202, 82, 662, 67, 82, 88, 235, 401,
+ 72, 410, 413, 7, 894, 81, 349, 897, 349, 899,
+ 534, 67, 701, 702, 329, 849, 72, 907, 333, 5,
+ 237, 7, 59, 60, 278, 242, 82, 244, 332, 77,
+ 78, 268, 225, 59, 60, 38, 67, 114, 275, 76,
+ 189, 72, 45, 192, 193, 238, 50, 3, 4, 939,
+ 76, 82, 76, 202, 30, 59, 60, 81, 221, 1,
+ 59, 3, 4, 212, 732, 515, 143, 27, 38, 613,
+ 30, 522, 265, 266, 291, 45, 36, 839, 3, 4,
+ 604, 3, 4, 5, 6, 7, 370, 59, 431, 59,
+ 431, 59, 60, 59, 171, 48, 49, 630, 465, 45,
+ 467, 338, 77, 59, 3, 4, 299, 363, 76, 30,
+ 63, 67, 59, 60, 3, 206, 72, 77, 7, 329,
+ 301, 81, 30, 333, 59, 67, 217, 816, 301, 579,
+ 72, 350, 65, 352, 59, 59, 572, 573, 59, 60,
+ 576, 30, 67, 380, 221, 67, 38, 72, 82, 76,
+ 72, 59, 60, 45, 81, 606, 410, 59, 516, 77,
+ 237, 50, 520, 81, 357, 242, 82, 244, 67, 318,
+ 59, 408, 583, 72, 555, 82, 844, 59, 60, 3,
+ 329, 592, 76, 332, 333, 59, 349, 81, 624, 625,
+ 626, 50, 628, 629, 3, 4, 76, 481, 7, 9,
+ 59, 60, 81, 420, 509, 563, 30, 657, 566, 346,
+ 660, 348, 579, 76, 291, 59, 60, 653, 81, 412,
+ 622, 30, 77, 78, 703, 509, 50, 3, 4, 76,
+ 75, 640, 3, 4, 81, 59, 60, 328, 416, 438,
+ 691, 50, 416, 424, 77, 78, 682, 683, 684, 427,
+ 59, 424, 451, 427, 30, 404, 77, 76, 621, 30,
+ 81, 623, 38, 72, 627, 676, 38, 416, 3, 4,
+ 419, 348, 349, 616, 50, 616, 59, 60, 427, 50,
+ 473, 648, 76, 59, 77, 721, 3, 4, 59, 438,
+ 427, 658, 82, 660, 59, 30, 72, 548, 549, 701,
+ 437, 438, 586, 38, 59, 714, 708, 77, 68, 69,
+ 70, 81, 511, 30, 507, 50, 78, 27, 78, 529,
+ 30, 3, 4, 77, 59, 7, 36, 81, 126, 127,
+ 766, 77, 531, 50, 78, 81, 514, 72, 548, 549,
+ 514, 77, 59, 420, 76, 81, 77, 77, 30, 59,
+ 60, 81, 77, 734, 431, 72, 81, 808, 50, 51,
+ 52, 438, 511, 612, 76, 514, 82, 77, 50, 617,
+ 618, 81, 76, 510, 451, 38, 59, 59, 60, 76,
+ 529, 77, 531, 10, 820, 578, 640, 597, 76, 638,
+ 771, 63, 82, 530, 531, 758, 889, 76, 891, 548,
+ 549, 649, 612, 552, 27, 542, 543, 608, 609, 602,
+ 9, 77, 622, 83, 3, 4, 36, 5, 6, 7,
+ 67, 77, 559, 560, 12, 13, 14, 36, 638, 81,
+ 68, 69, 70, 78, 511, 613, 68, 69, 70, 613,
+ 78, 30, 30, 68, 69, 70, 78, 76, 597, 5,
+ 6, 7, 38, 78, 531, 76, 12, 13, 14, 76,
+ 714, 50, 611, 612, 613, 76, 543, 704, 617, 618,
+ 59, 60, 76, 622, 667, 76, 613, 38, 76, 82,
+ 933, 630, 76, 560, 869, 76, 83, 636, 941, 638,
+ 83, 701, 702, 63, 875, 6, 7, 734, 708, 241,
+ 649, 12, 13, 14, 246, 247, 63, 76, 756, 251,
+ 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
+ 262, 76, 889, 36, 891, 48, 49, 50, 51, 52,
+ 83, 724, 623, 76, 771, 916, 917, 1, 748, 616,
+ 4, 734, 6, 7, 78, 782, 802, 78, 12, 13,
+ 14, 78, 701, 702, 32, 38, 734, 83, 76, 708,
+ 734, 77, 81, 77, 28, 3, 76, 31, 77, 3,
+ 78, 734, 38, 7, 81, 63, 78, 83, 771, 78,
+ 38, 45, 38, 78, 821, 734, 63, 824, 825, 81,
+ 783, 839, 841, 792, 38, 832, 30, 81, 78, 748,
+ 36, 63, 83, 67, 785, 786, 816, 756, 72, 78,
+ 847, 38, 59, 786, 59, 38, 50, 59, 855, 7,
+ 77, 38, 77, 77, 802, 59, 60, 77, 802, 866,
+ 16, 841, 78, 59, 77, 59, 77, 76, 875, 802,
+ 382, 383, 63, 792, 3, 4, 54, 55, 7, 57,
+ 58, 59, 60, 802, 791, 792, 4, 5, 6, 7,
+ 4, 898, 6, 7, 12, 13, 14, 816, 12, 13,
+ 14, 30, 54, 55, 17, 57, 58, 59, 60, 77,
+ 28, 76, 875, 920, 28, 77, 76, 76, 9, 926,
+ 839, 50, 841, 77, 76, 59, 77, 45, 77, 1,
+ 59, 45, 4, 5, 6, 7, 81, 77, 10, 76,
+ 12, 13, 14, 76, 0, 792, 77, 77, 0, 67,
+ 413, 824, 324, 67, 72, 87, 28, 658, 72, 77,
+ 472, 802, 281, 639, 1, 412, 3, 4, 5, 6,
+ 7, 8, 9, 45, 11, 12, 13, 14, 15, 491,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 67, 33, 34, 646, 475,
+ 72, 349, 467, 40, 357, 648, 43, 658, 45, 473,
+ 82, 48, 49, 50, 580, 660, 921, 54, 55, 923,
+ 875, 875, 59, 60, 407, 419, 552, 64, 25, 66,
+ 67, 419, 539, 618, 71, 72, 756, 300, 75, 753,
+ 77, 78, 79, 80, 532, 82, 514, 586, 748, 415,
+ 562, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 1, 370, 3, 4, 5, 6, 7, 8, 9,
+ 582, 11, 12, 13, 14, 15, 676, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, -1, 33, 34, 509, -1, 415, -1, -1,
+ 40, -1, -1, 43, -1, 45, -1, -1, 48, 49,
+ 50, -1, -1, -1, 54, 55, -1, -1, -1, 59,
+ 60, -1, -1, -1, 64, -1, 66, 67, -1, -1,
+ -1, 71, 72, -1, 646, 75, -1, 77, -1, 79,
+ 80, 1, 82, 3, 4, -1, -1, -1, 8, 9,
+ -1, 11, -1, -1, -1, 15, -1, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 680, 29,
+ -1, 31, -1, 33, 34, -1, -1, -1, -1, -1,
+ 40, -1, -1, 43, 696, -1, -1, -1, 48, 49,
+ 50, -1, -1, -1, 54, 55, -1, -1, -1, 59,
+ 60, -1, -1, -1, 64, 717, 66, 67, 720, -1,
+ -1, 71, 72, -1, -1, 75, -1, 77, 78, 79,
+ 80, -1, 82, -1, 736, -1, 1, 739, -1, 4,
+ 5, 6, 7, -1, -1, -1, -1, 12, 13, 14,
+ -1, -1, -1, 755, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 28, -1, 767, -1, 1, -1, 3,
+ 4, -1, -1, -1, 8, 9, 778, 11, -1, -1,
+ 45, 15, -1, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, -1, 29, -1, 31, -1, 33,
+ 34, -1, 67, 805, -1, -1, 40, 72, -1, 43,
+ -1, -1, -1, -1, 48, 49, 50, 82, -1, -1,
+ 54, 55, -1, -1, -1, 59, 60, -1, -1, -1,
+ 64, -1, 66, 67, -1, -1, -1, 71, 72, -1,
+ -1, 75, -1, 77, -1, 79, 80, 849, 82, -1,
+ 1, -1, 3, 4, -1, -1, -1, 8, 9, 861,
+ 11, -1, -1, -1, 15, -1, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, -1, 29, -1,
+ 31, -1, 33, 34, -1, -1, -1, -1, -1, 40,
+ -1, -1, 43, -1, -1, -1, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, -1, 59, 60,
+ -1, -1, -1, 64, -1, 66, 67, -1, -1, -1,
+ 71, 72, -1, -1, 75, -1, 77, -1, 79, 80,
+ 1, 82, 3, 4, -1, 6, 7, 8, 9, -1,
+ 11, 12, 13, 14, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 28, 29, -1,
+ 31, -1, 33, 34, -1, -1, -1, -1, -1, 40,
+ -1, -1, 43, -1, 45, -1, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, -1, 59, 60,
+ -1, -1, -1, 64, -1, 66, 67, -1, -1, -1,
+ 71, 72, -1, -1, 75, -1, -1, -1, 79, 80,
+ 1, 82, 3, 4, -1, -1, -1, 8, 9, 37,
+ 11, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, -1, -1, -1, 29, -1,
+ 31, -1, 33, 34, -1, -1, -1, -1, -1, 40,
+ -1, -1, 43, -1, -1, -1, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, 58, 59, 60,
+ -1, -1, -1, 64, -1, 66, 67, -1, -1, -1,
+ 71, 72, -1, -1, 75, -1, -1, 78, 79, 80,
+ 1, 82, 3, 4, -1, -1, -1, 8, 9, -1,
+ 11, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, -1, -1, -1, -1, -1, 29, -1,
+ 31, -1, 33, 34, -1, -1, -1, -1, -1, 40,
+ -1, -1, 43, -1, -1, -1, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, 58, 59, 60,
+ -1, -1, -1, 64, -1, 66, 67, -1, -1, -1,
+ 71, 72, -1, -1, 75, -1, -1, 78, 79, 80,
+ 1, 82, 3, 4, -1, -1, -1, 8, 9, -1,
+ 11, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, -1, -1, -1, -1, -1, -1, 29, -1,
+ 31, -1, 33, 34, -1, -1, -1, -1, -1, 40,
+ -1, -1, 43, -1, -1, -1, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, 58, 59, 60,
+ -1, -1, -1, 64, -1, 66, 67, -1, -1, -1,
+ 71, 72, -1, -1, 75, 1, -1, 3, 79, 80,
+ -1, 82, 8, 9, -1, 11, 1, -1, -1, 4,
+ -1, 6, 7, -1, -1, -1, -1, 12, 13, 14,
+ -1, -1, -1, 29, -1, 31, -1, 33, 34, -1,
+ -1, -1, -1, 28, 40, -1, 31, 43, -1, -1,
+ -1, -1, 48, 49, 50, -1, -1, -1, 54, 55,
+ 45, -1, -1, 59, 60, -1, -1, -1, 64, -1,
+ 66, -1, -1, -1, -1, 71, -1, -1, -1, 75,
+ -1, -1, 67, 79, 80, 1, 82, 72, 4, 5,
+ 6, 7, 77, 78, -1, -1, 12, 13, 14, -1,
+ -1, -1, -1, -1, 1, -1, -1, 4, 5, 6,
+ 7, 27, 28, -1, 30, 12, 13, 14, -1, -1,
+ 36, 45, 46, 47, 48, 49, 50, 51, 52, 45,
+ 27, 28, -1, 30, -1, -1, -1, -1, -1, 36,
+ -1, -1, -1, 59, 60, -1, -1, -1, 45, -1,
+ -1, 67, -1, -1, -1, -1, 72, -1, -1, -1,
+ -1, 77, 59, 60, -1, 81, 82, -1, -1, -1,
+ 67, -1, -1, -1, -1, 72, -1, -1, -1, -1,
+ 77, -1, -1, 1, 81, 82, 4, 5, 6, 7,
-1, -1, -1, -1, 12, 13, 14, -1, -1, -1,
+ -1, -1, 1, -1, -1, 4, 5, 6, 7, 27,
+ 28, -1, 30, 12, 13, 14, -1, -1, 36, 46,
+ 47, 48, 49, 50, 51, 52, -1, 45, -1, 28,
+ -1, 30, -1, 4, -1, 6, 7, -1, -1, -1,
+ -1, 12, 13, 14, -1, -1, 45, -1, -1, 67,
+ -1, -1, -1, -1, 72, -1, -1, 28, -1, 77,
+ -1, -1, -1, 81, 82, -1, 1, -1, 67, 4,
+ 5, 6, 7, 72, 45, -1, -1, 12, 13, 14,
+ -1, -1, -1, 82, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 28, 3, 30, 67, -1, -1, 8,
+ 9, 72, 11, -1, -1, -1, 77, 78, -1, -1,
+ 45, -1, -1, -1, -1, -1, -1, -1, -1, -1,
29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- 28, 40, -1, 31, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, 45, -1, 58,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, -1, 67,
- 79, 80, 1, 82, 72, 4, 5, 6, 7, 77,
- 78, -1, -1, 12, 13, 14, -1, -1, -1, -1,
- -1, 1, -1, -1, 4, 5, 6, 7, 27, 28,
- -1, 30, 12, 13, 14, -1, -1, 36, 46, 47,
- 48, 49, 50, 51, 52, -1, 45, 27, 28, -1,
- 30, -1, -1, -1, -1, -1, 36, -1, -1, -1,
- 59, 60, -1, -1, -1, 45, -1, -1, 67, -1,
- -1, -1, -1, 72, -1, -1, -1, -1, 77, 59,
- 60, -1, 81, 82, -1, -1, -1, 67, -1, -1,
- -1, -1, 72, -1, -1, -1, -1, 77, -1, -1,
- 1, 81, 82, 4, 5, 6, 7, -1, -1, -1,
- -1, 12, 13, 14, -1, -1, -1, -1, -1, 1,
- -1, -1, 4, 5, 6, 7, 27, 28, -1, 30,
- 12, 13, 14, -1, -1, 36, -1, -1, -1, -1,
- -1, -1, -1, -1, 45, -1, 28, 3, 30, -1,
- -1, -1, 8, 9, -1, 11, -1, -1, -1, -1,
- -1, -1, -1, 45, -1, -1, 67, -1, -1, -1,
- -1, 72, -1, 29, -1, 31, 77, 33, 34, -1,
- 81, 82, -1, -1, 40, 67, -1, 43, -1, -1,
- 72, -1, 48, 49, 50, -1, -1, -1, 54, 55,
- 82, -1, -1, 59, 60, -1, 3, -1, 64, -1,
- 66, 8, 9, -1, 11, 71, -1, -1, -1, 75,
- -1, -1, -1, 79, 80, -1, -1, 83, -1, -1,
- -1, -1, 29, -1, 31, -1, 33, 34, -1, -1,
- -1, -1, -1, 40, -1, -1, 43, -1, -1, -1,
- -1, 48, 49, 50, -1, -1, -1, 54, 55, -1,
- -1, -1, 59, 60, -1, 3, -1, 64, -1, 66,
- 8, 9, -1, 11, 71, -1, -1, -1, 75, -1,
- -1, -1, 79, 80, -1, -1, 83, -1, -1, -1,
- -1, 29, -1, 31, -1, 33, 34, -1, -1, -1,
- -1, -1, 40, -1, -1, 43, -1, -1, -1, -1,
- 48, 49, 50, -1, -1, -1, 54, 55, -1, -1,
- -1, 59, 60, -1, 3, -1, 64, -1, 66, 8,
- 9, -1, 11, 71, -1, -1, -1, 75, -1, -1,
- -1, 79, 80, -1, -1, 83, -1, -1, -1, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, -1,
+ -1, 40, 67, -1, 43, -1, -1, 72, -1, 48,
+ 49, 50, -1, -1, -1, 54, 55, 82, -1, -1,
59, 60, -1, 3, -1, 64, -1, 66, 8, 9,
-1, 11, 71, -1, -1, -1, 75, -1, -1, -1,
79, 80, -1, -1, 83, -1, -1, -1, -1, 29,
-1, 31, -1, 33, 34, -1, -1, -1, -1, -1,
40, -1, -1, 43, -1, -1, -1, -1, 48, 49,
50, -1, -1, -1, 54, 55, -1, -1, -1, 59,
- 60, -1, -1, -1, 64, -1, 66, -1, -1, -1,
- -1, 71, -1, -1, -1, 75, -1, -1, -1, 79,
- 80, -1, -1, 83, 3, 4, 5, 6, 7, 8,
- 9, -1, 11, 12, 13, 14, 15, -1, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, 45, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, -1, -1,
- 59, 60, -1, -1, -1, 64, -1, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, 77, -1,
- 79, 80, -1, 82, 3, 4, -1, -1, -1, 8,
- 9, -1, 11, -1, -1, -1, 15, -1, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, 3, -1,
- 59, 60, -1, 8, 9, 64, 11, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, 77, -1,
- 79, 80, -1, 82, 29, -1, 31, -1, 33, 34,
- -1, -1, -1, -1, -1, 40, -1, -1, 43, -1,
- -1, -1, -1, 48, 49, 50, -1, -1, -1, 54,
- 55, -1, -1, -1, 59, 60, -1, -1, -1, 64,
- -1, 66, -1, -1, -1, -1, 71, -1, -1, -1,
- 75, -1, -1, -1, 79, 80, -1, 82, 3, 4,
- -1, 6, 7, -1, -1, -1, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, -1, 3, 4, 5, 6,
- 7, 8, 9, 38, 11, 12, 13, 14, 4, 5,
- 6, 7, -1, -1, -1, -1, 12, 13, 14, -1,
- -1, 28, 29, 30, 31, -1, 33, 34, -1, -1,
- -1, -1, 28, 40, 30, -1, 43, 72, 45, -1,
- -1, 48, 49, 50, -1, -1, 81, 54, 55, 45,
- -1, -1, 59, 60, -1, -1, -1, 64, -1, 66,
- 67, -1, -1, -1, 71, 72, -1, -1, 75, -1,
- -1, 67, 79, 80, 3, 4, 72, 6, 7, 8,
- 9, 77, 11, 12, 13, 14, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 28,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, 45, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, 3, -1,
- 59, 60, -1, 8, 9, 64, 11, 66, 67, -1,
- -1, -1, 71, 72, -1, -1, 75, -1, -1, -1,
- 79, 80, -1, -1, 29, -1, 31, -1, 33, 34,
- -1, -1, -1, -1, -1, 40, -1, -1, 43, -1,
- -1, -1, -1, 48, 49, 50, -1, -1, -1, 54,
- 55, -1, 3, -1, 59, 60, -1, 8, 9, 64,
- 11, 66, 67, -1, -1, -1, 71, -1, -1, -1,
- 75, -1, -1, -1, 79, 80, -1, -1, 29, -1,
+ 60, -1, 3, -1, 64, -1, 66, 8, 9, -1,
+ 11, 71, -1, -1, -1, 75, -1, -1, -1, 79,
+ 80, -1, -1, 83, -1, -1, -1, -1, 29, -1,
31, -1, 33, 34, -1, -1, -1, -1, -1, 40,
-1, -1, 43, -1, -1, -1, -1, 48, 49, 50,
- -1, -1, -1, 54, 55, -1, 3, -1, 59, 60,
- -1, 8, 9, 64, 11, 66, -1, -1, -1, -1,
- 71, -1, -1, -1, 75, -1, 77, -1, 79, 80,
- -1, -1, 29, -1, 31, -1, 33, 34, -1, -1,
- -1, -1, -1, 40, -1, -1, 43, -1, -1, -1,
- -1, 48, 49, 50, -1, -1, -1, 54, 55, -1,
- 3, -1, 59, 60, -1, 8, 9, 64, 11, 66,
- -1, -1, -1, -1, 71, -1, -1, -1, 75, -1,
- -1, -1, 79, 80, -1, -1, 29, -1, 31, -1,
+ -1, -1, -1, 54, 55, -1, -1, -1, 59, 60,
+ -1, 3, -1, 64, -1, 66, 8, 9, -1, 11,
+ 71, -1, -1, -1, 75, -1, -1, -1, 79, 80,
+ -1, -1, 83, -1, -1, -1, -1, 29, -1, 31,
+ -1, 33, 34, -1, -1, -1, -1, -1, 40, -1,
+ -1, 43, -1, -1, -1, -1, 48, 49, 50, -1,
+ -1, -1, 54, 55, -1, -1, -1, 59, 60, -1,
+ 3, -1, 64, -1, 66, 8, 9, -1, 11, 71,
+ -1, -1, -1, 75, -1, -1, -1, 79, 80, -1,
+ -1, 83, -1, -1, -1, -1, 29, -1, 31, -1,
33, 34, -1, -1, -1, -1, -1, 40, -1, -1,
43, -1, -1, -1, -1, 48, 49, 50, -1, -1,
- -1, 54, 55, -1, 3, -1, 59, 60, -1, 8,
- 9, 64, 11, 66, -1, -1, -1, -1, 71, -1,
+ -1, 54, 55, -1, -1, -1, 59, 60, -1, -1,
+ -1, 64, -1, 66, -1, -1, -1, -1, 71, -1,
-1, -1, 75, -1, -1, -1, 79, 80, -1, -1,
- 29, -1, 31, -1, 33, 34, -1, -1, -1, -1,
- -1, 40, -1, -1, 43, -1, -1, -1, -1, 48,
- 49, 50, -1, -1, -1, 54, 55, -1, 3, -1,
- 59, 60, -1, 8, 9, 64, 11, 66, -1, -1,
- -1, -1, 71, -1, -1, -1, 75, -1, -1, -1,
- 79, 80, -1, -1, 29, -1, 31, -1, 33, 34,
- -1, -1, -1, -1, -1, 40, -1, -1, 43, -1,
- -1, -1, -1, 48, 49, 50, -1, -1, -1, 54,
- 55, -1, -1, -1, 59, 60, -1, -1, -1, 64,
- -1, 66, -1, -1, -1, -1, 71, -1, -1, -1,
- 75, -1, -1, 1, 79, 80, 4, -1, 6, 7,
- -1, -1, -1, -1, 12, 13, 14, -1, -1, -1,
- -1, 1, -1, -1, 4, -1, 6, 7, -1, -1,
- 28, -1, 12, 13, 14, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, -1, 45, 28, -1,
- -1, -1, -1, -1, -1, 1, -1, 3, 4, 5,
- 6, 7, -1, -1, -1, 45, 12, 13, 14, 67,
- 68, 69, 70, -1, 72, -1, -1, -1, -1, 77,
- 78, 27, 28, -1, 30, 31, -1, 67, 68, 69,
- 70, -1, 72, -1, -1, -1, -1, 77, 78, 45,
- -1, -1, 48, 49, 50, -1, -1, -1, -1, -1,
- -1, -1, -1, 59, -1, 61, 62, 63, -1, -1,
- -1, 67, -1, -1, -1, 71, 72, 73, 74, -1,
- 1, 77, 3, 4, 5, 6, 7, -1, -1, -1,
- -1, 12, 13, 14, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, -1, -1, -1, 28, 1, 30,
- 3, 4, 5, 6, 7, -1, -1, -1, -1, 12,
- 13, 14, -1, -1, 45, -1, -1, 48, 49, 50,
- -1, -1, -1, -1, -1, 28, -1, 30, 59, -1,
- -1, -1, -1, -1, -1, -1, 67, -1, -1, -1,
- -1, 72, 45, -1, -1, -1, 77, 50, 1, -1,
- 3, 4, 5, 6, 7, -1, 59, 10, -1, 12,
- 13, 14, -1, -1, 67, -1, -1, 1, -1, 72,
- 4, 5, 6, 7, 77, 28, 10, 30, 12, 13,
- 14, 4, -1, 6, 7, -1, -1, -1, -1, 12,
- 13, 14, 45, -1, 28, -1, 30, -1, -1, -1,
- 4, 5, 6, 7, -1, 28, -1, -1, 12, 13,
- 14, 45, -1, -1, 67, -1, -1, -1, -1, 72,
- -1, -1, 45, 76, 28, -1, 30, -1, -1, -1,
- -1, -1, -1, 67, -1, -1, -1, -1, 72, -1,
- -1, 45, 76, -1, 67, -1, -1, -1, -1, 72,
- 4, 5, 6, 7, 77, 78, -1, -1, 12, 13,
- 14, -1, -1, 67, -1, -1, -1, -1, 72, -1,
- -1, -1, -1, 77, 28, -1, 30, -1, -1, -1,
- -1, -1, -1, -1, 3, 4, -1, 6, 7, -1,
- -1, 45, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, -1, -1, 67, -1, 30, -1, -1, 72, 38,
- 35, 36, 37, 77, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, -1, -1,
- 59, -1, -1, -1, -1, -1, 3, 4, -1, 6,
- 7, -1, -1, 72, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, -1, 3, 4, -1, 6, 7, -1,
- -1, 38, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, -1, -1, -1, -1, -1, -1, -1, -1, 38,
- 3, 4, -1, 6, 7, 72, -1, -1, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, -1, -1, 4,
- -1, 6, 7, 72, -1, 38, -1, 12, 13, 14,
- 4, 5, 6, 7, -1, -1, 10, -1, 12, 13,
- 14, -1, -1, 28, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 28, -1, 30, -1, -1, 72,
- 45, -1, -1, -1, -1, 50, -1, -1, -1, -1,
- -1, 45, -1, -1, 59, 60, -1, -1, -1, -1,
- -1, -1, 67, -1, -1, -1, -1, 72, -1, -1,
- -1, -1, -1, 67, 4, 5, 6, 7, 72, -1,
- 10, -1, 12, 13, 14, 4, 5, 6, 7, -1,
- -1, -1, -1, 12, 13, 14, -1, -1, 28, -1,
- 30, -1, -1, -1, 4, 5, 6, 7, -1, 28,
- -1, 30, 12, 13, 14, 45, -1, -1, -1, -1,
- -1, -1, 4, -1, 6, 7, 45, -1, 28, -1,
- 12, 13, 14, -1, -1, -1, -1, 67, -1, -1,
- -1, 4, 72, 6, 7, 45, 28, -1, 67, 12,
- 13, 14, -1, 72, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 45, -1, 28, -1, 67, -1, -1,
- -1, -1, 72, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 45, -1, -1, 67, 10, -1, -1, -1,
- 72, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 67, -1, -1, -1, -1, 72,
- -1, 35, 36, 37, 38, 39, 40, 41, 42, 43,
+ 83, 3, 4, 5, 6, 7, 8, 9, -1, 11,
+ 12, 13, 14, 15, -1, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ -1, 33, 34, -1, -1, -1, -1, -1, 40, -1,
+ -1, 43, -1, 45, -1, -1, 48, 49, 50, -1,
+ -1, -1, 54, 55, -1, -1, -1, 59, 60, -1,
+ -1, -1, 64, -1, 66, 67, -1, -1, -1, 71,
+ 72, -1, -1, 75, -1, 77, -1, 79, 80, -1,
+ 82, 3, 4, -1, -1, -1, 8, 9, -1, 11,
+ -1, -1, -1, 15, -1, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, -1, 29, -1, 31,
+ -1, 33, 34, -1, -1, -1, -1, -1, 40, -1,
+ -1, 43, -1, -1, -1, -1, 48, 49, 50, -1,
+ -1, -1, 54, 55, -1, 3, -1, 59, 60, -1,
+ 8, 9, 64, 11, 66, 67, -1, -1, -1, 71,
+ 72, -1, -1, 75, -1, 77, -1, 79, 80, -1,
+ 82, 29, -1, 31, -1, 33, 34, -1, -1, -1,
+ -1, -1, 40, -1, -1, 43, -1, -1, -1, -1,
+ 48, 49, 50, -1, -1, -1, 54, 55, -1, -1,
+ -1, 59, 60, -1, -1, -1, 64, -1, 66, -1,
+ -1, -1, -1, 71, -1, -1, -1, 75, -1, -1,
+ -1, 79, 80, -1, 82, 3, 4, -1, 6, 7,
+ -1, -1, -1, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, -1, 3, 4, 5, 6, 7, 8, 9,
+ 38, 11, 12, 13, 14, 4, 5, 6, 7, -1,
+ -1, -1, -1, 12, 13, 14, -1, -1, 28, 29,
+ 30, 31, -1, 33, 34, -1, -1, -1, -1, 28,
+ 40, 30, -1, 43, 72, 45, -1, -1, 48, 49,
+ 50, -1, -1, 81, 54, 55, 45, -1, -1, 59,
+ 60, -1, -1, -1, 64, -1, 66, 67, -1, -1,
+ -1, 71, 72, -1, -1, 75, -1, -1, 67, 79,
+ 80, 3, 4, 72, 6, 7, 8, 9, 77, 11,
+ 12, 13, 14, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 28, 29, -1, 31,
+ -1, 33, 34, -1, -1, -1, -1, -1, 40, -1,
+ -1, 43, -1, 45, -1, -1, 48, 49, 50, -1,
+ -1, -1, 54, 55, -1, 3, -1, 59, 60, -1,
+ 8, 9, 64, 11, 66, 67, -1, -1, -1, 71,
+ 72, -1, -1, 75, -1, -1, -1, 79, 80, -1,
+ -1, 29, -1, 31, -1, 33, 34, -1, -1, -1,
+ -1, -1, 40, -1, -1, 43, -1, -1, -1, -1,
+ 48, 49, 50, -1, -1, -1, 54, 55, -1, 3,
+ -1, 59, 60, -1, 8, 9, 64, 11, 66, 67,
+ -1, -1, -1, 71, -1, -1, -1, 75, -1, -1,
+ -1, 79, 80, -1, -1, 29, -1, 31, -1, 33,
+ 34, -1, -1, -1, -1, -1, 40, -1, -1, 43,
+ -1, -1, -1, -1, 48, 49, 50, -1, -1, -1,
+ 54, 55, -1, 3, -1, 59, 60, -1, 8, 9,
+ 64, 11, 66, -1, -1, -1, -1, 71, -1, -1,
+ -1, 75, -1, 77, -1, 79, 80, -1, -1, 29,
+ -1, 31, -1, 33, 34, -1, -1, -1, -1, -1,
+ 40, -1, -1, 43, -1, -1, -1, -1, 48, 49,
+ 50, -1, -1, -1, 54, 55, -1, 3, -1, 59,
+ 60, -1, 8, 9, 64, 11, 66, -1, -1, -1,
+ -1, 71, -1, -1, -1, 75, -1, -1, -1, 79,
+ 80, -1, -1, 29, -1, 31, -1, 33, 34, -1,
+ -1, -1, -1, -1, 40, -1, -1, 43, -1, -1,
+ -1, -1, 48, 49, 50, -1, -1, -1, 54, 55,
+ -1, 3, -1, 59, 60, -1, 8, 9, 64, 11,
+ 66, -1, -1, -1, -1, 71, -1, -1, -1, 75,
+ -1, -1, -1, 79, 80, -1, -1, 29, -1, 31,
+ -1, 33, 34, -1, -1, -1, -1, -1, 40, -1,
+ -1, 43, -1, -1, -1, -1, 48, 49, 50, -1,
+ -1, -1, 54, 55, -1, 3, -1, 59, 60, -1,
+ 8, 9, 64, 11, 66, -1, -1, -1, -1, 71,
+ -1, -1, -1, 75, -1, -1, -1, 79, 80, -1,
+ -1, 29, -1, 31, -1, 33, 34, -1, -1, -1,
+ -1, -1, 40, -1, -1, 43, -1, -1, -1, -1,
+ 48, 49, 50, -1, -1, -1, 54, 55, -1, -1,
+ -1, 59, 60, -1, -1, -1, 64, -1, 66, -1,
+ -1, -1, -1, 71, -1, -1, -1, 75, -1, -1,
+ 1, 79, 80, 4, -1, 6, 7, -1, -1, -1,
+ -1, 12, 13, 14, -1, -1, -1, -1, 1, -1,
+ -1, 4, -1, 6, 7, -1, -1, 28, -1, 12,
+ 13, 14, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 45, 28, -1, -1, -1, -1,
+ -1, -1, 1, -1, 3, 4, 5, 6, 7, -1,
+ -1, -1, 45, 12, 13, 14, 67, 68, 69, 70,
+ -1, 72, -1, -1, -1, -1, 77, 78, 27, 28,
+ -1, 30, 31, -1, 67, 68, 69, 70, -1, 72,
+ -1, -1, -1, -1, 77, 78, 45, -1, -1, 48,
+ 49, 50, -1, -1, -1, -1, -1, -1, -1, -1,
+ 59, -1, 61, 62, 63, -1, -1, -1, 67, -1,
+ -1, -1, 71, 72, 73, 74, -1, 1, 77, 3,
+ 4, 5, 6, 7, -1, -1, -1, -1, 12, 13,
+ 14, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 28, 1, 30, 3, 4, 5,
+ 6, 7, -1, -1, -1, -1, 12, 13, 14, -1,
+ -1, 45, -1, -1, 48, 49, 50, -1, -1, -1,
+ -1, -1, 28, -1, 30, 59, -1, -1, -1, -1,
+ -1, -1, -1, 67, -1, -1, -1, -1, 72, 45,
+ -1, -1, -1, 77, 50, 1, -1, 3, 4, 5,
+ 6, 7, -1, 59, 10, -1, 12, 13, 14, -1,
+ -1, 67, -1, -1, 1, -1, 72, 4, 5, 6,
+ 7, 77, 28, 10, 30, 12, 13, 14, 4, 5,
+ 6, 7, -1, -1, -1, -1, 12, 13, 14, 45,
+ -1, 28, -1, 30, -1, -1, -1, 4, 5, 6,
+ 7, -1, 28, -1, 30, 12, 13, 14, 45, -1,
+ -1, 67, -1, -1, -1, -1, 72, -1, -1, 45,
+ 76, 28, -1, 30, -1, -1, -1, -1, -1, -1,
+ 67, -1, -1, -1, -1, 72, -1, -1, 45, 76,
+ -1, 67, -1, -1, -1, -1, 72, -1, -1, -1,
+ -1, 77, -1, -1, -1, -1, -1, -1, -1, -1,
+ 67, -1, -1, 3, 4, 72, 6, 7, -1, -1,
+ 77, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ -1, 3, 4, -1, 6, 7, -1, -1, 38, 11,
+ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, -1, 59,
+ -1, -1, -1, -1, -1, -1, 38, 3, 4, -1,
+ 6, 7, 72, -1, -1, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, -1, 3, 4, -1, 6, 7,
+ 72, -1, 38, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, -1, -1, 4, -1, 6, 7, -1, -1,
+ 38, -1, 12, 13, 14, -1, 72, 4, 5, 6,
+ 7, -1, -1, 10, -1, 12, 13, 14, 28, 4,
+ 5, 6, 7, -1, -1, 10, -1, 12, 13, 14,
+ -1, 28, -1, 30, 72, 45, -1, -1, -1, -1,
+ 50, -1, -1, 28, -1, 30, -1, -1, 45, 59,
+ 60, -1, -1, -1, -1, -1, -1, 67, -1, -1,
+ 45, -1, 72, -1, 4, 5, 6, 7, -1, -1,
+ 67, -1, 12, 13, 14, 72, 4, 5, 6, 7,
+ -1, -1, 67, -1, 12, 13, 14, 72, 28, 4,
+ 30, 6, 7, -1, -1, -1, -1, 12, 13, 14,
+ 28, -1, -1, -1, -1, 45, -1, -1, -1, -1,
+ -1, -1, -1, 28, -1, -1, -1, 45, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 67, -1, -1,
+ 45, -1, 72, 10, -1, -1, -1, -1, -1, 67,
+ -1, -1, -1, -1, 72, -1, -1, -1, -1, -1,
+ -1, -1, 67, -1, -1, -1, -1, 72, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 30, -1, -1, -1,
+ -1, 35, 36, 37, -1, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51, 52, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 35, 36, 37,
@@ -1632,7 +1656,7 @@ static const short yycheck[] = { 9,
48, 49, 50, 51, 52
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/bison.simple"
+#line 3 "/usr/cygnus/progressive-98r1/share/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -1825,7 +1849,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/share/bison.simple"
+#line 196 "/usr/cygnus/progressive-98r1/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -2130,14 +2154,14 @@ yyreduce:
switch (yyn) {
case 1:
-#line 233 "objc-parse.y"
+#line 234 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids an empty source file");
finish_file ();
;
break;}
case 2:
-#line 238 "objc-parse.y"
+#line 239 "objc-parse.y"
{
/* In case there were missing closebraces,
get us back to the global binding level. */
@@ -2147,15 +2171,15 @@ case 2:
;
break;}
case 3:
-#line 252 "objc-parse.y"
+#line 253 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 5:
-#line 253 "objc-parse.y"
+#line 254 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
case 10:
-#line 261 "objc-parse.y"
+#line 262 "objc-parse.y"
{ STRIP_NOPS (yyvsp[-2].ttype);
if ((TREE_CODE (yyvsp[-2].ttype) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (yyvsp[-2].ttype, 0)) == STRING_CST)
@@ -2165,11 +2189,11 @@ case 10:
error ("argument of `asm' is not a constant string"); ;
break;}
case 11:
-#line 269 "objc-parse.y"
+#line 270 "objc-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 12:
-#line 274 "objc-parse.y"
+#line 275 "objc-parse.y"
{ if (pedantic)
error ("ANSI C forbids data definition with no type or storage class");
else if (!flag_traditional)
@@ -2181,45 +2205,45 @@ case 12:
resume_momentary (yyvsp[-2].itype); ;
break;}
case 13:
-#line 284 "objc-parse.y"
+#line 285 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 14:
-#line 289 "objc-parse.y"
+#line 290 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 15:
-#line 294 "objc-parse.y"
+#line 295 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 16:
-#line 296 "objc-parse.y"
+#line 297 "objc-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 19:
-#line 300 "objc-parse.y"
+#line 301 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C does not allow extra `;' outside of a function"); ;
break;}
case 20:
-#line 306 "objc-parse.y"
+#line 307 "objc-parse.y"
{ if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 21:
-#line 311 "objc-parse.y"
+#line 312 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 22:
-#line 313 "objc-parse.y"
+#line 314 "objc-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2227,25 +2251,25 @@ case 22:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 23:
-#line 319 "objc-parse.y"
+#line 320 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 24:
-#line 324 "objc-parse.y"
+#line 325 "objc-parse.y"
{ if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 25:
-#line 329 "objc-parse.y"
+#line 330 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 26:
-#line 331 "objc-parse.y"
+#line 332 "objc-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2253,25 +2277,25 @@ case 26:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 27:
-#line 337 "objc-parse.y"
+#line 338 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 28:
-#line 342 "objc-parse.y"
+#line 343 "objc-parse.y"
{ if (! start_function (NULL_TREE, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 0))
YYERROR1;
reinit_parse_for_function (); ;
break;}
case 29:
-#line 347 "objc-parse.y"
+#line 348 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 30:
-#line 349 "objc-parse.y"
+#line 350 "objc-parse.y"
{ finish_function (0);
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
@@ -2279,72 +2303,72 @@ case 30:
resume_momentary (yyvsp[-5].itype); ;
break;}
case 31:
-#line 355 "objc-parse.y"
+#line 356 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 36:
-#line 369 "objc-parse.y"
+#line 370 "objc-parse.y"
{ yyval.code = ADDR_EXPR; ;
break;}
case 37:
-#line 371 "objc-parse.y"
+#line 372 "objc-parse.y"
{ yyval.code = NEGATE_EXPR; ;
break;}
case 38:
-#line 373 "objc-parse.y"
+#line 374 "objc-parse.y"
{ yyval.code = CONVERT_EXPR; ;
break;}
case 39:
-#line 375 "objc-parse.y"
+#line 376 "objc-parse.y"
{ yyval.code = PREINCREMENT_EXPR; ;
break;}
case 40:
-#line 377 "objc-parse.y"
+#line 378 "objc-parse.y"
{ yyval.code = PREDECREMENT_EXPR; ;
break;}
case 41:
-#line 379 "objc-parse.y"
+#line 380 "objc-parse.y"
{ yyval.code = BIT_NOT_EXPR; ;
break;}
case 42:
-#line 381 "objc-parse.y"
+#line 382 "objc-parse.y"
{ yyval.code = TRUTH_NOT_EXPR; ;
break;}
case 43:
-#line 385 "objc-parse.y"
+#line 386 "objc-parse.y"
{ yyval.ttype = build_compound_expr (yyvsp[0].ttype); ;
break;}
case 44:
-#line 390 "objc-parse.y"
+#line 391 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 46:
-#line 396 "objc-parse.y"
+#line 397 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 47:
-#line 398 "objc-parse.y"
+#line 399 "objc-parse.y"
{ chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 49:
-#line 404 "objc-parse.y"
+#line 405 "objc-parse.y"
{ yyval.ttype = build_indirect_ref (yyvsp[0].ttype, "unary *"); ;
break;}
case 50:
-#line 407 "objc-parse.y"
+#line 408 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
case 51:
-#line 410 "objc-parse.y"
+#line 411 "objc-parse.y"
{ yyval.ttype = build_unary_op (yyvsp[-1].code, yyvsp[0].ttype, 0);
overflow_warning (yyval.ttype); ;
break;}
case 52:
-#line 414 "objc-parse.y"
+#line 415 "objc-parse.y"
{ tree label = lookup_label (yyvsp[0].ttype);
if (pedantic)
pedwarn ("ANSI C forbids `&&'");
@@ -2359,7 +2383,7 @@ case 52:
;
break;}
case 53:
-#line 442 "objc-parse.y"
+#line 443 "objc-parse.y"
{ skip_evaluation--;
if (TREE_CODE (yyvsp[0].ttype) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (yyvsp[0].ttype, 1)))
@@ -2367,49 +2391,49 @@ case 53:
yyval.ttype = c_sizeof (TREE_TYPE (yyvsp[0].ttype)); ;
break;}
case 54:
-#line 448 "objc-parse.y"
+#line 449 "objc-parse.y"
{ skip_evaluation--;
yyval.ttype = c_sizeof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 55:
-#line 451 "objc-parse.y"
+#line 452 "objc-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof_expr (yyvsp[0].ttype); ;
break;}
case 56:
-#line 454 "objc-parse.y"
+#line 455 "objc-parse.y"
{ skip_evaluation--;
yyval.ttype = c_alignof (groktypename (yyvsp[-1].ttype)); ;
break;}
case 57:
-#line 457 "objc-parse.y"
+#line 458 "objc-parse.y"
{ yyval.ttype = build_unary_op (REALPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 58:
-#line 459 "objc-parse.y"
+#line 460 "objc-parse.y"
{ yyval.ttype = build_unary_op (IMAGPART_EXPR, yyvsp[0].ttype, 0); ;
break;}
case 59:
-#line 463 "objc-parse.y"
+#line 464 "objc-parse.y"
{ skip_evaluation++; ;
break;}
case 60:
-#line 467 "objc-parse.y"
+#line 468 "objc-parse.y"
{ skip_evaluation++; ;
break;}
case 62:
-#line 473 "objc-parse.y"
+#line 474 "objc-parse.y"
{ tree type = groktypename (yyvsp[-2].ttype);
yyval.ttype = build_c_cast (type, yyvsp[0].ttype); ;
break;}
case 63:
-#line 476 "objc-parse.y"
+#line 477 "objc-parse.y"
{ start_init (NULL_TREE, NULL, 0);
yyvsp[-2].ttype = groktypename (yyvsp[-2].ttype);
really_start_incremental_init (yyvsp[-2].ttype); ;
break;}
case 64:
-#line 480 "objc-parse.y"
+#line 481 "objc-parse.y"
{ char *name;
tree result = pop_init_level (0);
tree type = yyvsp[-5].ttype;
@@ -2436,90 +2460,90 @@ case 64:
;
break;}
case 66:
-#line 509 "objc-parse.y"
+#line 510 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 67:
-#line 511 "objc-parse.y"
+#line 512 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 68:
-#line 513 "objc-parse.y"
+#line 514 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 69:
-#line 515 "objc-parse.y"
+#line 516 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 70:
-#line 517 "objc-parse.y"
+#line 518 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 71:
-#line 519 "objc-parse.y"
+#line 520 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 72:
-#line 521 "objc-parse.y"
+#line 522 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 73:
-#line 523 "objc-parse.y"
+#line 524 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 74:
-#line 525 "objc-parse.y"
+#line 526 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 75:
-#line 527 "objc-parse.y"
+#line 528 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 76:
-#line 529 "objc-parse.y"
+#line 530 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 77:
-#line 531 "objc-parse.y"
+#line 532 "objc-parse.y"
{ yyval.ttype = parser_build_binary_op (yyvsp[-1].code, yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 78:
-#line 533 "objc-parse.y"
+#line 534 "objc-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 79:
-#line 536 "objc-parse.y"
+#line 537 "objc-parse.y"
{ skip_evaluation -= yyvsp[-3].ttype == boolean_false_node;
yyval.ttype = parser_build_binary_op (TRUTH_ANDIF_EXPR, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 80:
-#line 539 "objc-parse.y"
+#line 540 "objc-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 81:
-#line 542 "objc-parse.y"
+#line 543 "objc-parse.y"
{ skip_evaluation -= yyvsp[-3].ttype == boolean_true_node;
yyval.ttype = parser_build_binary_op (TRUTH_ORIF_EXPR, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 82:
-#line 545 "objc-parse.y"
+#line 546 "objc-parse.y"
{ yyvsp[-1].ttype = truthvalue_conversion (default_conversion (yyvsp[-1].ttype));
skip_evaluation += yyvsp[-1].ttype == boolean_false_node; ;
break;}
case 83:
-#line 548 "objc-parse.y"
+#line 549 "objc-parse.y"
{ skip_evaluation += ((yyvsp[-4].ttype == boolean_true_node)
- (yyvsp[-4].ttype == boolean_false_node)); ;
break;}
case 84:
-#line 551 "objc-parse.y"
+#line 552 "objc-parse.y"
{ skip_evaluation -= yyvsp[-6].ttype == boolean_true_node;
yyval.ttype = build_conditional_expr (yyvsp[-6].ttype, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 85:
-#line 554 "objc-parse.y"
+#line 555 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids omitting the middle term of a ?: expression");
/* Make sure first operand is calculated only once. */
@@ -2528,23 +2552,23 @@ case 85:
skip_evaluation += yyvsp[-1].ttype == boolean_true_node; ;
break;}
case 86:
-#line 561 "objc-parse.y"
+#line 562 "objc-parse.y"
{ skip_evaluation -= yyvsp[-4].ttype == boolean_true_node;
yyval.ttype = build_conditional_expr (yyvsp[-4].ttype, yyvsp[-3].ttype, yyvsp[0].ttype); ;
break;}
case 87:
-#line 564 "objc-parse.y"
+#line 565 "objc-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, NOP_EXPR, yyvsp[0].ttype);
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, MODIFY_EXPR); ;
break;}
case 88:
-#line 567 "objc-parse.y"
+#line 568 "objc-parse.y"
{ yyval.ttype = build_modify_expr (yyvsp[-2].ttype, yyvsp[-1].code, yyvsp[0].ttype);
/* This inhibits warnings in truthvalue_conversion. */
C_SET_EXP_ORIGINAL_CODE (yyval.ttype, ERROR_MARK); ;
break;}
case 89:
-#line 574 "objc-parse.y"
+#line 575 "objc-parse.y"
{
yyval.ttype = lastiddecl;
if (!yyval.ttype || yyval.ttype == error_mark_node)
@@ -2705,11 +2729,11 @@ case 89:
;
break;}
case 91:
-#line 734 "objc-parse.y"
+#line 735 "objc-parse.y"
{ yyval.ttype = combine_strings (yyvsp[0].ttype); ;
break;}
case 92:
-#line 736 "objc-parse.y"
+#line 737 "objc-parse.y"
{ char class = TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype));
if (class == 'e' || class == '1'
|| class == '2' || class == '<')
@@ -2717,11 +2741,11 @@ case 92:
yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 93:
-#line 742 "objc-parse.y"
+#line 743 "objc-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 94:
-#line 744 "objc-parse.y"
+#line 745 "objc-parse.y"
{ if (current_function_decl == 0)
{
error ("braced-group within expression allowed only inside a function");
@@ -2737,7 +2761,7 @@ case 94:
yyval.ttype = expand_start_stmt_expr (); ;
break;}
case 95:
-#line 758 "objc-parse.y"
+#line 759 "objc-parse.y"
{ tree rtl_exp;
if (pedantic)
pedwarn ("ANSI C forbids braced-groups within expressions");
@@ -2762,15 +2786,15 @@ case 95:
;
break;}
case 96:
-#line 781 "objc-parse.y"
+#line 782 "objc-parse.y"
{ yyval.ttype = build_function_call (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 97:
-#line 783 "objc-parse.y"
+#line 784 "objc-parse.y"
{ yyval.ttype = build_array_ref (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 98:
-#line 785 "objc-parse.y"
+#line 786 "objc-parse.y"
{
if (doing_objc_thang)
{
@@ -2784,7 +2808,7 @@ case 98:
;
break;}
case 99:
-#line 797 "objc-parse.y"
+#line 798 "objc-parse.y"
{
tree expr = build_indirect_ref (yyvsp[-2].ttype, "->");
@@ -2800,80 +2824,80 @@ case 99:
;
break;}
case 100:
-#line 811 "objc-parse.y"
+#line 812 "objc-parse.y"
{ yyval.ttype = build_unary_op (POSTINCREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 101:
-#line 813 "objc-parse.y"
+#line 814 "objc-parse.y"
{ yyval.ttype = build_unary_op (POSTDECREMENT_EXPR, yyvsp[-1].ttype, 0); ;
break;}
case 102:
-#line 815 "objc-parse.y"
+#line 816 "objc-parse.y"
{ yyval.ttype = build_message_expr (yyvsp[0].ttype); ;
break;}
case 103:
-#line 817 "objc-parse.y"
+#line 818 "objc-parse.y"
{ yyval.ttype = build_selector_expr (yyvsp[0].ttype); ;
break;}
case 104:
-#line 819 "objc-parse.y"
+#line 820 "objc-parse.y"
{ yyval.ttype = build_protocol_expr (yyvsp[0].ttype); ;
break;}
case 105:
-#line 821 "objc-parse.y"
+#line 822 "objc-parse.y"
{ yyval.ttype = build_encode_expr (yyvsp[0].ttype); ;
break;}
case 106:
-#line 823 "objc-parse.y"
+#line 824 "objc-parse.y"
{ yyval.ttype = build_objc_string_object (yyvsp[0].ttype); ;
break;}
case 108:
-#line 830 "objc-parse.y"
+#line 831 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 110:
-#line 838 "objc-parse.y"
+#line 839 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 113:
-#line 846 "objc-parse.y"
+#line 847 "objc-parse.y"
{ c_mark_varargs ();
if (pedantic)
pedwarn ("ANSI C does not permit use of `varargs.h'"); ;
break;}
case 114:
-#line 856 "objc-parse.y"
+#line 857 "objc-parse.y"
{ ;
break;}
case 119:
-#line 872 "objc-parse.y"
+#line 873 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 120:
-#line 877 "objc-parse.y"
+#line 878 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 121:
-#line 882 "objc-parse.y"
+#line 883 "objc-parse.y"
{ shadow_tag_warned (yyvsp[-1].ttype, 1);
pedwarn ("empty declaration"); ;
break;}
case 122:
-#line 885 "objc-parse.y"
+#line 886 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 123:
-#line 894 "objc-parse.y"
+#line 895 "objc-parse.y"
{ ;
break;}
case 128:
-#line 909 "objc-parse.y"
+#line 910 "objc-parse.y"
{ yyval.itype = suspend_momentary ();
pending_xref_error ();
declspec_stack = tree_cons (prefix_attributes,
@@ -2883,131 +2907,131 @@ case 128:
&current_declspecs, &prefix_attributes); ;
break;}
case 129:
-#line 920 "objc-parse.y"
+#line 921 "objc-parse.y"
{ prefix_attributes = chainon (prefix_attributes, yyvsp[0].ttype); ;
break;}
case 130:
-#line 925 "objc-parse.y"
+#line 926 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 131:
-#line 930 "objc-parse.y"
+#line 931 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
case 132:
-#line 935 "objc-parse.y"
+#line 936 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
case 133:
-#line 940 "objc-parse.y"
+#line 941 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
case 134:
-#line 945 "objc-parse.y"
+#line 946 "objc-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
case 135:
-#line 947 "objc-parse.y"
+#line 948 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
case 136:
-#line 949 "objc-parse.y"
+#line 950 "objc-parse.y"
{ pedantic = yyvsp[-1].itype; ;
break;}
case 137:
-#line 959 "objc-parse.y"
+#line 960 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 138:
-#line 961 "objc-parse.y"
+#line 962 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 139:
-#line 965 "objc-parse.y"
+#line 966 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 140:
-#line 967 "objc-parse.y"
+#line 968 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 141:
-#line 969 "objc-parse.y"
+#line 970 "objc-parse.y"
{ if (extra_warnings)
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 142:
-#line 974 "objc-parse.y"
+#line 975 "objc-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 143:
-#line 979 "objc-parse.y"
+#line 980 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 144:
-#line 981 "objc-parse.y"
+#line 982 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 145:
-#line 986 "objc-parse.y"
+#line 987 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 146:
-#line 988 "objc-parse.y"
+#line 989 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 147:
-#line 990 "objc-parse.y"
+#line 991 "objc-parse.y"
{ if (extra_warnings)
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 148:
-#line 1003 "objc-parse.y"
+#line 1004 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 149:
-#line 1005 "objc-parse.y"
+#line 1006 "objc-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, NULL_TREE); ;
break;}
case 150:
-#line 1007 "objc-parse.y"
+#line 1008 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 151:
-#line 1009 "objc-parse.y"
+#line 1010 "objc-parse.y"
{ yyval.ttype = tree_cons (yyvsp[0].ttype, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 152:
-#line 1014 "objc-parse.y"
+#line 1015 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 153:
-#line 1017 "objc-parse.y"
+#line 1018 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 154:
-#line 1019 "objc-parse.y"
+#line 1020 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype);
TREE_STATIC (yyval.ttype) = 1; ;
break;}
case 155:
-#line 1022 "objc-parse.y"
+#line 1023 "objc-parse.y"
{ if (extra_warnings && TREE_STATIC (yyvsp[-1].ttype))
warning ("`%s' is not at beginning of declaration",
IDENTIFIER_POINTER (yyvsp[0].ttype));
@@ -3015,150 +3039,150 @@ case 155:
TREE_STATIC (yyval.ttype) = TREE_STATIC (yyvsp[-1].ttype); ;
break;}
case 156:
-#line 1036 "objc-parse.y"
+#line 1037 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 157:
-#line 1038 "objc-parse.y"
+#line 1039 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[0].ttype, tree_cons (NULL_TREE, yyvsp[-1].ttype, yyvsp[-2].ttype)); ;
break;}
case 158:
-#line 1042 "objc-parse.y"
+#line 1043 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 159:
-#line 1044 "objc-parse.y"
+#line 1045 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 162:
-#line 1054 "objc-parse.y"
+#line 1055 "objc-parse.y"
{ /* For a typedef name, record the meaning, not the name.
In case of `foo foo, bar;'. */
yyval.ttype = lookup_name (yyvsp[0].ttype); ;
break;}
case 163:
-#line 1058 "objc-parse.y"
+#line 1059 "objc-parse.y"
{ yyval.ttype = get_static_reference (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 164:
-#line 1060 "objc-parse.y"
+#line 1061 "objc-parse.y"
{ yyval.ttype = get_object_reference (yyvsp[0].ttype); ;
break;}
case 165:
-#line 1065 "objc-parse.y"
+#line 1066 "objc-parse.y"
{ yyval.ttype = get_object_reference (yyvsp[0].ttype); ;
break;}
case 166:
-#line 1067 "objc-parse.y"
+#line 1068 "objc-parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[-1].ttype); ;
break;}
case 167:
-#line 1069 "objc-parse.y"
+#line 1070 "objc-parse.y"
{ yyval.ttype = groktypename (yyvsp[-1].ttype); ;
break;}
case 175:
-#line 1091 "objc-parse.y"
+#line 1092 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 176:
-#line 1093 "objc-parse.y"
+#line 1094 "objc-parse.y"
{ if (TREE_CHAIN (yyvsp[-1].ttype)) yyvsp[-1].ttype = combine_strings (yyvsp[-1].ttype);
yyval.ttype = yyvsp[-1].ttype;
;
break;}
case 177:
-#line 1100 "objc-parse.y"
+#line 1101 "objc-parse.y"
{ yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1,
yyvsp[-1].ttype, prefix_attributes);
start_init (yyval.ttype, yyvsp[-2].ttype, global_bindings_p ()); ;
break;}
case 178:
-#line 1105 "objc-parse.y"
+#line 1106 "objc-parse.y"
{ finish_init ();
finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 179:
-#line 1108 "objc-parse.y"
+#line 1109 "objc-parse.y"
{ tree d = start_decl (yyvsp[-2].ttype, current_declspecs, 0,
yyvsp[0].ttype, prefix_attributes);
finish_decl (d, NULL_TREE, yyvsp[-1].ttype);
;
break;}
case 180:
-#line 1116 "objc-parse.y"
+#line 1117 "objc-parse.y"
{ yyval.ttype = start_decl (yyvsp[-3].ttype, current_declspecs, 1,
yyvsp[-1].ttype, prefix_attributes);
start_init (yyval.ttype, yyvsp[-2].ttype, global_bindings_p ()); ;
break;}
case 181:
-#line 1121 "objc-parse.y"
+#line 1122 "objc-parse.y"
{ finish_init ();
decl_attributes (yyvsp[-1].ttype, yyvsp[-3].ttype, prefix_attributes);
finish_decl (yyvsp[-1].ttype, yyvsp[0].ttype, yyvsp[-4].ttype); ;
break;}
case 182:
-#line 1125 "objc-parse.y"
+#line 1126 "objc-parse.y"
{ tree d = start_decl (yyvsp[-2].ttype, current_declspecs, 0,
yyvsp[0].ttype, prefix_attributes);
finish_decl (d, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 183:
-#line 1133 "objc-parse.y"
+#line 1134 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 184:
-#line 1135 "objc-parse.y"
+#line 1136 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 185:
-#line 1140 "objc-parse.y"
+#line 1141 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 186:
-#line 1142 "objc-parse.y"
+#line 1143 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 187:
-#line 1147 "objc-parse.y"
+#line 1148 "objc-parse.y"
{ yyval.ttype = yyvsp[-2].ttype; ;
break;}
case 188:
-#line 1152 "objc-parse.y"
+#line 1153 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 189:
-#line 1154 "objc-parse.y"
+#line 1155 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 190:
-#line 1159 "objc-parse.y"
+#line 1160 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 191:
-#line 1161 "objc-parse.y"
+#line 1162 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 192:
-#line 1163 "objc-parse.y"
+#line 1164 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, build_tree_list (NULL_TREE, yyvsp[-1].ttype)); ;
break;}
case 193:
-#line 1165 "objc-parse.y"
+#line 1166 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-5].ttype, tree_cons (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype)); ;
break;}
case 194:
-#line 1167 "objc-parse.y"
+#line 1168 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 200:
-#line 1185 "objc-parse.y"
+#line 1186 "objc-parse.y"
{ really_start_incremental_init (NULL_TREE);
/* Note that the call to clear_momentary
is in process_init_element. */
push_momentary (); ;
break;}
case 201:
-#line 1190 "objc-parse.y"
+#line 1191 "objc-parse.y"
{ yyval.ttype = pop_init_level (0);
if (yyval.ttype == error_mark_node
&& ! (yychar == STRING || yychar == CONSTANT))
@@ -3167,36 +3191,36 @@ case 201:
pop_momentary_nofree (); ;
break;}
case 202:
-#line 1198 "objc-parse.y"
+#line 1199 "objc-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
case 203:
-#line 1204 "objc-parse.y"
+#line 1205 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids empty initializer braces"); ;
break;}
case 207:
-#line 1218 "objc-parse.y"
+#line 1219 "objc-parse.y"
{ process_init_element (yyvsp[0].ttype); ;
break;}
case 208:
-#line 1220 "objc-parse.y"
+#line 1221 "objc-parse.y"
{ push_init_level (0); ;
break;}
case 209:
-#line 1222 "objc-parse.y"
+#line 1223 "objc-parse.y"
{ process_init_element (pop_init_level (0)); ;
break;}
case 211:
-#line 1228 "objc-parse.y"
+#line 1229 "objc-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 213:
-#line 1231 "objc-parse.y"
+#line 1232 "objc-parse.y"
{ set_init_label (yyvsp[-1].ttype); ;
break;}
case 215:
-#line 1237 "objc-parse.y"
+#line 1238 "objc-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -3207,16 +3231,16 @@ case 215:
reinit_parse_for_function (); ;
break;}
case 216:
-#line 1246 "objc-parse.y"
+#line 1247 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 217:
-#line 1254 "objc-parse.y"
+#line 1255 "objc-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 218:
-#line 1260 "objc-parse.y"
+#line 1261 "objc-parse.y"
{ push_c_function_context ();
if (! start_function (current_declspecs, yyvsp[0].ttype,
prefix_attributes, NULL_TREE, 1))
@@ -3227,172 +3251,196 @@ case 218:
reinit_parse_for_function (); ;
break;}
case 219:
-#line 1269 "objc-parse.y"
+#line 1270 "objc-parse.y"
{ store_parm_decls (); ;
break;}
case 220:
-#line 1277 "objc-parse.y"
+#line 1278 "objc-parse.y"
{ finish_function (1);
pop_c_function_context (); ;
break;}
case 223:
-#line 1293 "objc-parse.y"
+#line 1294 "objc-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 224:
-#line 1295 "objc-parse.y"
+#line 1296 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 225:
-#line 1300 "objc-parse.y"
+#line 1301 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 226:
-#line 1302 "objc-parse.y"
+#line 1303 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 227:
-#line 1304 "objc-parse.y"
+#line 1305 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 228:
-#line 1311 "objc-parse.y"
+#line 1312 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 231:
-#line 1323 "objc-parse.y"
+#line 1324 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 232:
-#line 1328 "objc-parse.y"
+#line 1329 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 233:
-#line 1330 "objc-parse.y"
+#line 1331 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 234:
-#line 1332 "objc-parse.y"
+#line 1333 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 235:
-#line 1339 "objc-parse.y"
+#line 1340 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 237:
-#line 1348 "objc-parse.y"
+#line 1349 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
case 238:
-#line 1353 "objc-parse.y"
+#line 1354 "objc-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 239:
-#line 1355 "objc-parse.y"
+#line 1356 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 240:
-#line 1357 "objc-parse.y"
+#line 1358 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 241:
-#line 1359 "objc-parse.y"
+#line 1360 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 242:
-#line 1366 "objc-parse.y"
+#line 1367 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 244:
-#line 1372 "objc-parse.y"
-{ yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype);
- /* Start scope of tag before parsing components. */
- ;
+#line 1373 "objc-parse.y"
+{ yyval.ttype = NULL_TREE; ;
break;}
case 245:
-#line 1376 "objc-parse.y"
-{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
+#line 1375 "objc-parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 246:
-#line 1378 "objc-parse.y"
-{ yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
- yyvsp[-2].ttype, yyvsp[0].ttype);
- ;
+#line 1380 "objc-parse.y"
+{ yyval.ttype = NULL_TREE; ;
break;}
case 247:
#line 1382 "objc-parse.y"
-{ yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ;
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 248:
-#line 1384 "objc-parse.y"
-{ yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ;
+#line 1387 "objc-parse.y"
+{ yyval.ttype = NULL_TREE; ;
break;}
case 249:
-#line 1386 "objc-parse.y"
-{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, yyvsp[0].ttype); ;
+#line 1389 "objc-parse.y"
+{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 250:
-#line 1388 "objc-parse.y"
-{ yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
- yyvsp[-2].ttype, yyvsp[0].ttype);
+#line 1394 "objc-parse.y"
+{ yyval.ttype = start_struct (RECORD_TYPE, yyvsp[-1].ttype);
+ /* Start scope of tag before parsing components. */
;
break;}
case 251:
-#line 1392 "objc-parse.y"
-{ yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ;
+#line 1398 "objc-parse.y"
+{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); ;
break;}
case 252:
-#line 1394 "objc-parse.y"
+#line 1400 "objc-parse.y"
+{ yyval.ttype = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
+ yyvsp[-2].ttype, chainon (yyvsp[-4].ttype, yyvsp[0].ttype));
+ ;
+ break;}
+case 253:
+#line 1404 "objc-parse.y"
+{ yyval.ttype = xref_tag (RECORD_TYPE, yyvsp[0].ttype); ;
+ break;}
+case 254:
+#line 1406 "objc-parse.y"
+{ yyval.ttype = start_struct (UNION_TYPE, yyvsp[-1].ttype); ;
+ break;}
+case 255:
+#line 1408 "objc-parse.y"
+{ yyval.ttype = finish_struct (yyvsp[-3].ttype, yyvsp[-2].ttype, chainon (yyvsp[-6].ttype, yyvsp[0].ttype)); ;
+ break;}
+case 256:
+#line 1410 "objc-parse.y"
+{ yyval.ttype = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
+ yyvsp[-2].ttype, chainon (yyvsp[-4].ttype, yyvsp[0].ttype));
+ ;
+ break;}
+case 257:
+#line 1414 "objc-parse.y"
+{ yyval.ttype = xref_tag (UNION_TYPE, yyvsp[0].ttype); ;
+ break;}
+case 258:
+#line 1416 "objc-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (yyvsp[-1].ttype); ;
break;}
-case 253:
-#line 1397 "objc-parse.y"
-{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
+case 259:
+#line 1419 "objc-parse.y"
+{ yyval.ttype= finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), chainon (yyvsp[-7].ttype, yyvsp[0].ttype));
resume_momentary (yyvsp[-5].itype); ;
break;}
-case 254:
-#line 1400 "objc-parse.y"
+case 260:
+#line 1422 "objc-parse.y"
{ yyvsp[0].itype = suspend_momentary ();
yyval.ttype = start_enum (NULL_TREE); ;
break;}
-case 255:
-#line 1403 "objc-parse.y"
-{ yyval.ttype = finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), yyvsp[0].ttype);
+case 261:
+#line 1425 "objc-parse.y"
+{ yyval.ttype= finish_enum (yyvsp[-4].ttype, nreverse (yyvsp[-3].ttype), chainon (yyvsp[-6].ttype, yyvsp[0].ttype));
resume_momentary (yyvsp[-5].itype); ;
break;}
-case 256:
-#line 1406 "objc-parse.y"
+case 262:
+#line 1428 "objc-parse.y"
{ yyval.ttype = xref_tag (ENUMERAL_TYPE, yyvsp[0].ttype); ;
break;}
-case 260:
-#line 1417 "objc-parse.y"
+case 266:
+#line 1439 "objc-parse.y"
{ if (pedantic) pedwarn ("comma at end of enumerator list"); ;
break;}
-case 261:
-#line 1422 "objc-parse.y"
+case 267:
+#line 1444 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 262:
-#line 1424 "objc-parse.y"
+case 268:
+#line 1446 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
pedwarn ("no semicolon at end of struct or union"); ;
break;}
-case 263:
-#line 1429 "objc-parse.y"
+case 269:
+#line 1451 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 264:
-#line 1431 "objc-parse.y"
+case 270:
+#line 1453 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
-case 265:
-#line 1433 "objc-parse.y"
+case 271:
+#line 1455 "objc-parse.y"
{ if (pedantic)
pedwarn ("extra semicolon in struct or union specified"); ;
break;}
-case 266:
-#line 1437 "objc-parse.y"
+case 272:
+#line 1459 "objc-parse.y"
{
tree interface = lookup_interface (yyvsp[-1].ttype);
@@ -3406,164 +3454,164 @@ case 266:
}
;
break;}
-case 267:
-#line 1462 "objc-parse.y"
+case 273:
+#line 1484 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
-case 268:
-#line 1468 "objc-parse.y"
+case 274:
+#line 1490 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids member declarations with no members");
shadow_tag(yyvsp[0].ttype);
yyval.ttype = NULL_TREE; ;
break;}
-case 269:
-#line 1473 "objc-parse.y"
+case 275:
+#line 1495 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
-case 270:
-#line 1479 "objc-parse.y"
+case 276:
+#line 1501 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids member declarations with no members");
shadow_tag(yyvsp[0].ttype);
yyval.ttype = NULL_TREE; ;
break;}
-case 271:
-#line 1484 "objc-parse.y"
+case 277:
+#line 1506 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 272:
-#line 1486 "objc-parse.y"
+case 278:
+#line 1508 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
pedantic = yyvsp[-1].itype; ;
break;}
-case 274:
-#line 1493 "objc-parse.y"
+case 280:
+#line 1515 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 275:
-#line 1498 "objc-parse.y"
+case 281:
+#line 1520 "objc-parse.y"
{ yyval.ttype = grokfield (yyvsp[-3].filename, yyvsp[-2].lineno, yyvsp[-1].ttype, current_declspecs, NULL_TREE);
decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 276:
-#line 1502 "objc-parse.y"
+case 282:
+#line 1524 "objc-parse.y"
{ yyval.ttype = grokfield (yyvsp[-5].filename, yyvsp[-4].lineno, yyvsp[-3].ttype, current_declspecs, yyvsp[-1].ttype);
decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 277:
-#line 1505 "objc-parse.y"
+case 283:
+#line 1527 "objc-parse.y"
{ yyval.ttype = grokfield (yyvsp[-4].filename, yyvsp[-3].lineno, NULL_TREE, current_declspecs, yyvsp[-1].ttype);
decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
-case 279:
-#line 1517 "objc-parse.y"
+case 285:
+#line 1539 "objc-parse.y"
{ if (yyvsp[-2].ttype == error_mark_node)
yyval.ttype = yyvsp[-2].ttype;
else
yyval.ttype = chainon (yyvsp[0].ttype, yyvsp[-2].ttype); ;
break;}
-case 280:
-#line 1522 "objc-parse.y"
+case 286:
+#line 1544 "objc-parse.y"
{ yyval.ttype = error_mark_node; ;
break;}
-case 281:
-#line 1528 "objc-parse.y"
+case 287:
+#line 1550 "objc-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 282:
-#line 1530 "objc-parse.y"
+case 288:
+#line 1552 "objc-parse.y"
{ yyval.ttype = build_enumerator (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 283:
-#line 1535 "objc-parse.y"
+case 289:
+#line 1557 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 284:
-#line 1537 "objc-parse.y"
+case 290:
+#line 1559 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 285:
-#line 1542 "objc-parse.y"
+case 291:
+#line 1564 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 287:
-#line 1548 "objc-parse.y"
+case 293:
+#line 1570 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 288:
-#line 1550 "objc-parse.y"
+case 294:
+#line 1572 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 289:
-#line 1555 "objc-parse.y"
+case 295:
+#line 1577 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 290:
-#line 1557 "objc-parse.y"
+case 296:
+#line 1579 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
-case 291:
-#line 1562 "objc-parse.y"
+case 297:
+#line 1584 "objc-parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
-case 292:
-#line 1565 "objc-parse.y"
+case 298:
+#line 1587 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
-case 293:
-#line 1567 "objc-parse.y"
+case 299:
+#line 1589 "objc-parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 294:
-#line 1569 "objc-parse.y"
+case 300:
+#line 1591 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 295:
-#line 1571 "objc-parse.y"
+case 301:
+#line 1593 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 296:
-#line 1573 "objc-parse.y"
+case 302:
+#line 1595 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, yyvsp[-2].ttype, NULL_TREE); ;
break;}
-case 297:
-#line 1575 "objc-parse.y"
+case 303:
+#line 1597 "objc-parse.y"
{ yyval.ttype = build_nt (CALL_EXPR, NULL_TREE, yyvsp[0].ttype, NULL_TREE); ;
break;}
-case 298:
-#line 1577 "objc-parse.y"
+case 304:
+#line 1599 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 299:
-#line 1579 "objc-parse.y"
+case 305:
+#line 1601 "objc-parse.y"
{ yyval.ttype = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
-case 300:
-#line 1590 "objc-parse.y"
+case 306:
+#line 1612 "objc-parse.y"
{
if (pedantic && yyvsp[0].ends_in_label)
pedwarn ("ANSI C forbids label at end of compound statement");
;
break;}
-case 302:
-#line 1599 "objc-parse.y"
+case 308:
+#line 1621 "objc-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
-case 303:
-#line 1601 "objc-parse.y"
+case 309:
+#line 1623 "objc-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
-case 307:
-#line 1613 "objc-parse.y"
+case 313:
+#line 1635 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
pushlevel (0);
clear_last_expr ();
@@ -3573,13 +3621,13 @@ case 307:
add_objc_decls ();
;
break;}
-case 309:
-#line 1628 "objc-parse.y"
+case 315:
+#line 1650 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids label declarations"); ;
break;}
-case 312:
-#line 1639 "objc-parse.y"
+case 318:
+#line 1661 "objc-parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -3589,20 +3637,20 @@ case 312:
}
;
break;}
-case 313:
-#line 1653 "objc-parse.y"
+case 319:
+#line 1675 "objc-parse.y"
{;
break;}
-case 315:
-#line 1657 "objc-parse.y"
+case 321:
+#line 1679 "objc-parse.y"
{ compstmt_count++; ;
break;}
-case 316:
-#line 1660 "objc-parse.y"
+case 322:
+#line 1682 "objc-parse.y"
{ yyval.ttype = convert (void_type_node, integer_zero_node); ;
break;}
-case 317:
-#line 1662 "objc-parse.y"
+case 323:
+#line 1684 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
yyval.ttype = poplevel (1, 1, 0);
@@ -3611,8 +3659,8 @@ case 317:
else
pop_momentary (); ;
break;}
-case 318:
-#line 1670 "objc-parse.y"
+case 324:
+#line 1692 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
yyval.ttype = poplevel (kept_level_p (), 0, 0);
@@ -3621,8 +3669,8 @@ case 318:
else
pop_momentary (); ;
break;}
-case 319:
-#line 1678 "objc-parse.y"
+case 325:
+#line 1700 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
yyval.ttype = poplevel (kept_level_p (), 0, 0);
@@ -3631,8 +3679,8 @@ case 319:
else
pop_momentary (); ;
break;}
-case 322:
-#line 1698 "objc-parse.y"
+case 328:
+#line 1720 "objc-parse.y"
{ emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_cond (truthvalue_conversion (yyvsp[-1].ttype), 0,
compstmt_count);
@@ -3641,8 +3689,8 @@ case 322:
if_stmt_line = yyvsp[-4].lineno;
position_after_white_space (); ;
break;}
-case 323:
-#line 1712 "objc-parse.y"
+case 329:
+#line 1734 "objc-parse.y"
{ stmt_count++;
compstmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
@@ -3651,44 +3699,44 @@ case 323:
expand_start_loop_continue_elsewhere (1);
position_after_white_space (); ;
break;}
-case 324:
-#line 1720 "objc-parse.y"
+case 330:
+#line 1742 "objc-parse.y"
{ expand_loop_continue_here (); ;
break;}
-case 325:
-#line 1724 "objc-parse.y"
+case 331:
+#line 1746 "objc-parse.y"
{ yyval.filename = input_filename; ;
break;}
-case 326:
-#line 1728 "objc-parse.y"
+case 332:
+#line 1750 "objc-parse.y"
{ yyval.lineno = lineno; ;
break;}
-case 327:
-#line 1733 "objc-parse.y"
+case 333:
+#line 1755 "objc-parse.y"
{ ;
break;}
-case 328:
-#line 1738 "objc-parse.y"
+case 334:
+#line 1760 "objc-parse.y"
{ ;
break;}
-case 329:
-#line 1743 "objc-parse.y"
+case 335:
+#line 1765 "objc-parse.y"
{ yyval.ends_in_label = yyvsp[0].ends_in_label; ;
break;}
-case 330:
-#line 1748 "objc-parse.y"
+case 336:
+#line 1770 "objc-parse.y"
{ yyval.ends_in_label = 0; ;
break;}
-case 331:
-#line 1750 "objc-parse.y"
+case 337:
+#line 1772 "objc-parse.y"
{ yyval.ends_in_label = 1; ;
break;}
-case 332:
-#line 1756 "objc-parse.y"
+case 338:
+#line 1778 "objc-parse.y"
{ stmt_count++; ;
break;}
-case 334:
-#line 1759 "objc-parse.y"
+case 340:
+#line 1781 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
/* It appears that this should not be done--that a non-lvalue array
@@ -3706,20 +3754,20 @@ case 334:
iterator_expand (yyvsp[-1].ttype);
clear_momentary (); ;
break;}
-case 335:
-#line 1776 "objc-parse.y"
+case 341:
+#line 1798 "objc-parse.y"
{ c_expand_start_else ();
yyvsp[-1].itype = stmt_count;
position_after_white_space (); ;
break;}
-case 336:
-#line 1780 "objc-parse.y"
+case 342:
+#line 1802 "objc-parse.y"
{ c_expand_end_cond ();
if (extra_warnings && stmt_count == yyvsp[-3].itype)
warning ("empty body in an else-statement"); ;
break;}
-case 337:
-#line 1784 "objc-parse.y"
+case 343:
+#line 1806 "objc-parse.y"
{ c_expand_end_cond ();
/* This warning is here instead of in simple_if, because we
do not want a warning if an empty if is followed by an
@@ -3729,12 +3777,12 @@ case 337:
warning_with_file_and_line (if_stmt_file, if_stmt_line,
"empty body in an if-statement"); ;
break;}
-case 338:
-#line 1796 "objc-parse.y"
+case 344:
+#line 1818 "objc-parse.y"
{ c_expand_end_cond (); ;
break;}
-case 339:
-#line 1798 "objc-parse.y"
+case 345:
+#line 1820 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-2].filename, yyvsp[-1].lineno);
/* The emit_nop used to come before emit_line_note,
@@ -3745,8 +3793,8 @@ case 339:
We will see. --rms, July 15, 1991. */
emit_nop (); ;
break;}
-case 340:
-#line 1808 "objc-parse.y"
+case 346:
+#line 1830 "objc-parse.y"
{ /* Don't start the loop till we have succeeded
in parsing the end test. This is to make sure
that we end every loop we start. */
@@ -3756,25 +3804,25 @@ case 340:
truthvalue_conversion (yyvsp[-1].ttype));
position_after_white_space (); ;
break;}
-case 341:
-#line 1817 "objc-parse.y"
+case 347:
+#line 1839 "objc-parse.y"
{ expand_end_loop (); ;
break;}
-case 342:
-#line 1820 "objc-parse.y"
+case 348:
+#line 1842 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
expand_exit_loop_if_false (NULL_PTR,
truthvalue_conversion (yyvsp[-2].ttype));
expand_end_loop ();
clear_momentary (); ;
break;}
-case 343:
-#line 1827 "objc-parse.y"
+case 349:
+#line 1849 "objc-parse.y"
{ expand_end_loop ();
clear_momentary (); ;
break;}
-case 344:
-#line 1831 "objc-parse.y"
+case 350:
+#line 1853 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
/* See comment in `while' alternative, above. */
@@ -3786,13 +3834,13 @@ case 344:
fn without calling expand_end_loop. */
;
break;}
-case 345:
-#line 1843 "objc-parse.y"
+case 351:
+#line 1865 "objc-parse.y"
{ yyvsp[0].lineno = lineno;
yyval.filename = input_filename; ;
break;}
-case 346:
-#line 1846 "objc-parse.y"
+case 352:
+#line 1868 "objc-parse.y"
{
/* Start the loop. Doing this after parsing
all the expressions ensures we will end the loop. */
@@ -3809,8 +3857,8 @@ case 346:
yyvsp[-2].filename = input_filename;
position_after_white_space (); ;
break;}
-case 347:
-#line 1862 "objc-parse.y"
+case 353:
+#line 1884 "objc-parse.y"
{ /* Emit the increment expression, with a line number. */
emit_line_note (yyvsp[-4].filename, yyvsp[-5].lineno);
expand_loop_continue_here ();
@@ -3822,8 +3870,8 @@ case 347:
pop_momentary ();
expand_end_loop (); ;
break;}
-case 348:
-#line 1873 "objc-parse.y"
+case 354:
+#line 1895 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
c_expand_start_case (yyvsp[-1].ttype);
@@ -3832,42 +3880,42 @@ case 348:
push_momentary ();
position_after_white_space (); ;
break;}
-case 349:
-#line 1881 "objc-parse.y"
+case 355:
+#line 1903 "objc-parse.y"
{ expand_end_case (yyvsp[-3].ttype);
if (yychar == CONSTANT || yychar == STRING)
pop_momentary_nofree ();
else
pop_momentary (); ;
break;}
-case 350:
-#line 1887 "objc-parse.y"
+case 356:
+#line 1909 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
if ( ! expand_exit_something ())
error ("break statement not within loop or switch"); ;
break;}
-case 351:
-#line 1892 "objc-parse.y"
+case 357:
+#line 1914 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
if (! expand_continue_loop (NULL_PTR))
error ("continue statement not within a loop"); ;
break;}
-case 352:
-#line 1897 "objc-parse.y"
+case 358:
+#line 1919 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-3].filename, yyvsp[-2].lineno);
c_expand_return (NULL_TREE); ;
break;}
-case 353:
-#line 1901 "objc-parse.y"
+case 359:
+#line 1923 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
c_expand_return (yyvsp[-1].ttype); ;
break;}
-case 354:
-#line 1905 "objc-parse.y"
+case 360:
+#line 1927 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-7].filename, yyvsp[-6].lineno);
STRIP_NOPS (yyvsp[-2].ttype);
@@ -3878,32 +3926,32 @@ case 354:
else
error ("argument of `asm' is not a constant string"); ;
break;}
-case 355:
-#line 1916 "objc-parse.y"
+case 361:
+#line 1938 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-9].filename, yyvsp[-8].lineno);
c_expand_asm_operands (yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, NULL_TREE,
yyvsp[-6].ttype == ridpointers[(int)RID_VOLATILE],
input_filename, lineno); ;
break;}
-case 356:
-#line 1923 "objc-parse.y"
+case 362:
+#line 1945 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-11].filename, yyvsp[-10].lineno);
c_expand_asm_operands (yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE,
yyvsp[-8].ttype == ridpointers[(int)RID_VOLATILE],
input_filename, lineno); ;
break;}
-case 357:
-#line 1931 "objc-parse.y"
+case 363:
+#line 1953 "objc-parse.y"
{ stmt_count++;
emit_line_note (yyvsp[-13].filename, yyvsp[-12].lineno);
c_expand_asm_operands (yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype,
yyvsp[-10].ttype == ridpointers[(int)RID_VOLATILE],
input_filename, lineno); ;
break;}
-case 358:
-#line 1937 "objc-parse.y"
+case 364:
+#line 1959 "objc-parse.y"
{ tree decl;
stmt_count++;
emit_line_note (yyvsp[-4].filename, yyvsp[-3].lineno);
@@ -3915,16 +3963,16 @@ case 358:
}
;
break;}
-case 359:
-#line 1948 "objc-parse.y"
+case 365:
+#line 1970 "objc-parse.y"
{ if (pedantic)
pedwarn ("ANSI C forbids `goto *expr;'");
stmt_count++;
emit_line_note (yyvsp[-5].filename, yyvsp[-4].lineno);
expand_computed_goto (convert (ptr_type_node, yyvsp[-1].ttype)); ;
break;}
-case 362:
-#line 1963 "objc-parse.y"
+case 368:
+#line 1985 "objc-parse.y"
{
/* The value returned by this action is */
/* 1 if everything is OK */
@@ -3946,15 +3994,15 @@ case 362:
}
;
break;}
-case 363:
-#line 1984 "objc-parse.y"
+case 369:
+#line 2006 "objc-parse.y"
{
if (yyvsp[-1].itype)
iterator_for_loop_end (yyvsp[-3].ttype);
;
break;}
-case 364:
-#line 2019 "objc-parse.y"
+case 370:
+#line 2041 "objc-parse.y"
{ register tree value = check_case_value (yyvsp[-1].ttype);
register tree label
= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -3986,8 +4034,8 @@ case 364:
}
position_after_white_space (); ;
break;}
-case 365:
-#line 2050 "objc-parse.y"
+case 371:
+#line 2072 "objc-parse.y"
{ register tree value1 = check_case_value (yyvsp[-3].ttype);
register tree value2 = check_case_value (yyvsp[-1].ttype);
register tree label
@@ -4019,8 +4067,8 @@ case 365:
}
position_after_white_space (); ;
break;}
-case 366:
-#line 2081 "objc-parse.y"
+case 372:
+#line 2103 "objc-parse.y"
{
tree duplicate;
register tree label
@@ -4036,8 +4084,8 @@ case 366:
}
position_after_white_space (); ;
break;}
-case 367:
-#line 2096 "objc-parse.y"
+case 373:
+#line 2118 "objc-parse.y"
{ tree label = define_label (input_filename, lineno, yyvsp[-1].ttype);
stmt_count++;
emit_nop ();
@@ -4045,53 +4093,53 @@ case 367:
expand_label (label);
position_after_white_space (); ;
break;}
-case 368:
-#line 2108 "objc-parse.y"
+case 374:
+#line 2130 "objc-parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
-case 369:
-#line 2111 "objc-parse.y"
+case 375:
+#line 2133 "objc-parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
-case 370:
-#line 2116 "objc-parse.y"
+case 376:
+#line 2138 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 372:
-#line 2123 "objc-parse.y"
+case 378:
+#line 2145 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 375:
-#line 2130 "objc-parse.y"
+case 381:
+#line 2152 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
-case 376:
-#line 2135 "objc-parse.y"
+case 382:
+#line 2157 "objc-parse.y"
{ yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
-case 377:
-#line 2140 "objc-parse.y"
+case 383:
+#line 2162 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), NULL_TREE); ;
break;}
-case 378:
-#line 2142 "objc-parse.y"
+case 384:
+#line 2164 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, combine_strings (yyvsp[0].ttype), yyvsp[-2].ttype); ;
break;}
-case 379:
-#line 2148 "objc-parse.y"
+case 385:
+#line 2170 "objc-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (0); ;
break;}
-case 380:
-#line 2152 "objc-parse.y"
+case 386:
+#line 2174 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
-case 382:
-#line 2160 "objc-parse.y"
+case 388:
+#line 2182 "objc-parse.y"
{ tree parm;
if (pedantic)
pedwarn ("ANSI C forbids forward parameter declarations");
@@ -4100,20 +4148,20 @@ case 382:
TREE_ASM_WRITTEN (parm) = 1;
clear_parm_order (); ;
break;}
-case 383:
-#line 2168 "objc-parse.y"
+case 389:
+#line 2190 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
-case 384:
-#line 2170 "objc-parse.y"
+case 390:
+#line 2192 "objc-parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); ;
break;}
-case 385:
-#line 2176 "objc-parse.y"
+case 391:
+#line 2198 "objc-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
-case 386:
-#line 2178 "objc-parse.y"
+case 392:
+#line 2200 "objc-parse.y"
{ yyval.ttype = get_parm_info (0);
/* Gcc used to allow this as an extension. However, it does
not work for all targets, and thus has been disabled.
@@ -4124,24 +4172,24 @@ case 386:
error ("ANSI C requires a named argument before `...'");
;
break;}
-case 387:
-#line 2188 "objc-parse.y"
+case 393:
+#line 2210 "objc-parse.y"
{ yyval.ttype = get_parm_info (1); ;
break;}
-case 388:
-#line 2190 "objc-parse.y"
+case 394:
+#line 2212 "objc-parse.y"
{ yyval.ttype = get_parm_info (0); ;
break;}
-case 389:
-#line 2195 "objc-parse.y"
+case 395:
+#line 2217 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
-case 390:
-#line 2197 "objc-parse.y"
+case 396:
+#line 2219 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
-case 391:
-#line 2204 "objc-parse.y"
+case 397:
+#line 2226 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4151,8 +4199,8 @@ case 391:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 392:
-#line 2213 "objc-parse.y"
+case 398:
+#line 2235 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4162,8 +4210,8 @@ case 392:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 393:
-#line 2222 "objc-parse.y"
+case 399:
+#line 2244 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4173,8 +4221,8 @@ case 393:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 394:
-#line 2231 "objc-parse.y"
+case 400:
+#line 2253 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4184,8 +4232,8 @@ case 394:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 395:
-#line 2241 "objc-parse.y"
+case 401:
+#line 2263 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
@@ -4195,49 +4243,49 @@ case 395:
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 396:
-#line 2255 "objc-parse.y"
+case 402:
+#line 2277 "objc-parse.y"
{ pushlevel (0);
clear_parm_order ();
declare_parm_level (1); ;
break;}
-case 397:
-#line 2259 "objc-parse.y"
+case 403:
+#line 2281 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
parmlist_tags_warning ();
poplevel (0, 0, 0); ;
break;}
-case 399:
-#line 2267 "objc-parse.y"
+case 405:
+#line 2289 "objc-parse.y"
{ tree t;
for (t = yyvsp[-1].ttype; t; t = TREE_CHAIN (t))
if (TREE_VALUE (t) == NULL_TREE)
error ("`...' in old-style identifier list");
yyval.ttype = tree_cons (NULL_TREE, NULL_TREE, yyvsp[-1].ttype); ;
break;}
-case 400:
-#line 2277 "objc-parse.y"
+case 406:
+#line 2299 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 401:
-#line 2279 "objc-parse.y"
+case 407:
+#line 2301 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 402:
-#line 2285 "objc-parse.y"
+case 408:
+#line 2307 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 403:
-#line 2287 "objc-parse.y"
+case 409:
+#line 2309 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 404:
-#line 2292 "objc-parse.y"
+case 410:
+#line 2314 "objc-parse.y"
{ yyval.itype = pedantic;
pedantic = 0; ;
break;}
-case 410:
-#line 2305 "objc-parse.y"
+case 416:
+#line 2327 "objc-parse.y"
{
if (objc_implementation_context)
{
@@ -4249,115 +4297,115 @@ case 410:
warning ("`@end' must appear in an implementation context");
;
break;}
-case 411:
-#line 2320 "objc-parse.y"
+case 417:
+#line 2342 "objc-parse.y"
{ yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype); ;
break;}
-case 412:
-#line 2322 "objc-parse.y"
+case 418:
+#line 2344 "objc-parse.y"
{ yyval.ttype = chainon (yyvsp[-2].ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
-case 413:
-#line 2327 "objc-parse.y"
+case 419:
+#line 2349 "objc-parse.y"
{
objc_declare_class (yyvsp[-1].ttype);
;
break;}
-case 414:
-#line 2333 "objc-parse.y"
+case 420:
+#line 2355 "objc-parse.y"
{
objc_declare_alias (yyvsp[-2].ttype, yyvsp[-1].ttype);
;
break;}
-case 415:
-#line 2339 "objc-parse.y"
+case 421:
+#line 2361 "objc-parse.y"
{
objc_interface_context = objc_ivar_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-2].ttype, NULL_TREE, yyvsp[-1].ttype);
objc_public_flag = 0;
;
break;}
-case 416:
-#line 2345 "objc-parse.y"
+case 422:
+#line 2367 "objc-parse.y"
{
continue_class (objc_interface_context);
;
break;}
-case 417:
-#line 2350 "objc-parse.y"
+case 423:
+#line 2372 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
-case 418:
-#line 2356 "objc-parse.y"
+case 424:
+#line 2378 "objc-parse.y"
{
objc_interface_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-1].ttype, NULL_TREE, yyvsp[0].ttype);
continue_class (objc_interface_context);
;
break;}
-case 419:
-#line 2363 "objc-parse.y"
+case 425:
+#line 2385 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
-case 420:
-#line 2369 "objc-parse.y"
+case 426:
+#line 2391 "objc-parse.y"
{
objc_interface_context = objc_ivar_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[-1].ttype);
objc_public_flag = 0;
;
break;}
-case 421:
-#line 2375 "objc-parse.y"
+case 427:
+#line 2397 "objc-parse.y"
{
continue_class (objc_interface_context);
;
break;}
-case 422:
-#line 2380 "objc-parse.y"
+case 428:
+#line 2402 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
-case 423:
-#line 2386 "objc-parse.y"
+case 429:
+#line 2408 "objc-parse.y"
{
objc_interface_context
= start_class (CLASS_INTERFACE_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
continue_class (objc_interface_context);
;
break;}
-case 424:
-#line 2393 "objc-parse.y"
+case 430:
+#line 2415 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
-case 425:
-#line 2399 "objc-parse.y"
+case 431:
+#line 2421 "objc-parse.y"
{
objc_implementation_context = objc_ivar_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-1].ttype, NULL_TREE, NULL_TREE);
objc_public_flag = 0;
;
break;}
-case 426:
-#line 2405 "objc-parse.y"
+case 432:
+#line 2427 "objc-parse.y"
{
objc_ivar_chain
= continue_class (objc_implementation_context);
;
break;}
-case 427:
-#line 2411 "objc-parse.y"
+case 433:
+#line 2433 "objc-parse.y"
{
objc_implementation_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[0].ttype, NULL_TREE, NULL_TREE);
@@ -4365,23 +4413,23 @@ case 427:
= continue_class (objc_implementation_context);
;
break;}
-case 428:
-#line 2419 "objc-parse.y"
+case 434:
+#line 2441 "objc-parse.y"
{
objc_implementation_context = objc_ivar_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE);
objc_public_flag = 0;
;
break;}
-case 429:
-#line 2425 "objc-parse.y"
+case 435:
+#line 2447 "objc-parse.y"
{
objc_ivar_chain
= continue_class (objc_implementation_context);
;
break;}
-case 430:
-#line 2431 "objc-parse.y"
+case 436:
+#line 2453 "objc-parse.y"
{
objc_implementation_context
= start_class (CLASS_IMPLEMENTATION_TYPE, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE);
@@ -4389,23 +4437,23 @@ case 430:
= continue_class (objc_implementation_context);
;
break;}
-case 431:
-#line 2439 "objc-parse.y"
+case 437:
+#line 2461 "objc-parse.y"
{
objc_interface_context
= start_class (CATEGORY_INTERFACE_TYPE, yyvsp[-4].ttype, yyvsp[-2].ttype, yyvsp[0].ttype);
continue_class (objc_interface_context);
;
break;}
-case 432:
-#line 2446 "objc-parse.y"
+case 438:
+#line 2468 "objc-parse.y"
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
-case 433:
-#line 2452 "objc-parse.y"
+case 439:
+#line 2474 "objc-parse.y"
{
objc_implementation_context
= start_class (CATEGORY_IMPLEMENTATION_TYPE, yyvsp[-3].ttype, yyvsp[-1].ttype, NULL_TREE);
@@ -4413,30 +4461,30 @@ case 433:
= continue_class (objc_implementation_context);
;
break;}
-case 434:
-#line 2462 "objc-parse.y"
+case 440:
+#line 2484 "objc-parse.y"
{
remember_protocol_qualifiers ();
objc_interface_context
= start_protocol(PROTOCOL_INTERFACE_TYPE, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 435:
-#line 2468 "objc-parse.y"
+case 441:
+#line 2490 "objc-parse.y"
{
forget_protocol_qualifiers();
finish_protocol(objc_interface_context);
objc_interface_context = NULL_TREE;
;
break;}
-case 436:
-#line 2477 "objc-parse.y"
+case 442:
+#line 2499 "objc-parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
-case 438:
-#line 2485 "objc-parse.y"
+case 444:
+#line 2507 "objc-parse.y"
{
if (yyvsp[-2].code == LT_EXPR && yyvsp[0].code == GT_EXPR)
yyval.ttype = yyvsp[-1].ttype;
@@ -4444,57 +4492,57 @@ case 438:
YYERROR1;
;
break;}
-case 441:
-#line 2499 "objc-parse.y"
+case 447:
+#line 2521 "objc-parse.y"
{ objc_public_flag = 2; ;
break;}
-case 442:
-#line 2500 "objc-parse.y"
+case 448:
+#line 2522 "objc-parse.y"
{ objc_public_flag = 0; ;
break;}
-case 443:
-#line 2501 "objc-parse.y"
+case 449:
+#line 2523 "objc-parse.y"
{ objc_public_flag = 1; ;
break;}
-case 444:
-#line 2506 "objc-parse.y"
+case 450:
+#line 2528 "objc-parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
-case 446:
-#line 2511 "objc-parse.y"
+case 452:
+#line 2533 "objc-parse.y"
{
if (pedantic)
pedwarn ("extra semicolon in struct or union specified");
;
break;}
-case 447:
-#line 2529 "objc-parse.y"
+case 453:
+#line 2551 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
-case 448:
-#line 2535 "objc-parse.y"
+case 454:
+#line 2557 "objc-parse.y"
{ yyval.ttype = yyvsp[0].ttype;
current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-1].itype); ;
break;}
-case 449:
-#line 2541 "objc-parse.y"
+case 455:
+#line 2563 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 450:
-#line 2546 "objc-parse.y"
+case 456:
+#line 2568 "objc-parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
-case 453:
-#line 2553 "objc-parse.y"
+case 459:
+#line 2575 "objc-parse.y"
{
yyval.ttype = add_instance_variable (objc_ivar_context,
objc_public_flag,
@@ -4502,16 +4550,16 @@ case 453:
NULL_TREE);
;
break;}
-case 454:
-#line 2560 "objc-parse.y"
+case 460:
+#line 2582 "objc-parse.y"
{
yyval.ttype = add_instance_variable (objc_ivar_context,
objc_public_flag,
yyvsp[-2].ttype, current_declspecs, yyvsp[0].ttype);
;
break;}
-case 455:
-#line 2566 "objc-parse.y"
+case 461:
+#line 2588 "objc-parse.y"
{
yyval.ttype = add_instance_variable (objc_ivar_context,
objc_public_flag,
@@ -4519,8 +4567,8 @@ case 455:
current_declspecs, yyvsp[0].ttype);
;
break;}
-case 456:
-#line 2576 "objc-parse.y"
+case 462:
+#line 2598 "objc-parse.y"
{
remember_protocol_qualifiers ();
if (objc_implementation_context)
@@ -4529,8 +4577,8 @@ case 456:
fatal ("method definition not in class context");
;
break;}
-case 457:
-#line 2584 "objc-parse.y"
+case 463:
+#line 2606 "objc-parse.y"
{
forget_protocol_qualifiers ();
add_class_method (objc_implementation_context, yyvsp[0].ttype);
@@ -4538,21 +4586,21 @@ case 457:
objc_method_context = yyvsp[0].ttype;
;
break;}
-case 458:
-#line 2591 "objc-parse.y"
+case 464:
+#line 2613 "objc-parse.y"
{
continue_method_def ();
;
break;}
-case 459:
-#line 2595 "objc-parse.y"
+case 465:
+#line 2617 "objc-parse.y"
{
finish_method_def ();
objc_method_context = NULL_TREE;
;
break;}
-case 460:
-#line 2601 "objc-parse.y"
+case 466:
+#line 2623 "objc-parse.y"
{
remember_protocol_qualifiers ();
if (objc_implementation_context)
@@ -4561,8 +4609,8 @@ case 460:
fatal ("method definition not in class context");
;
break;}
-case 461:
-#line 2609 "objc-parse.y"
+case 467:
+#line 2631 "objc-parse.y"
{
forget_protocol_qualifiers ();
add_instance_method (objc_implementation_context, yyvsp[0].ttype);
@@ -4570,268 +4618,268 @@ case 461:
objc_method_context = yyvsp[0].ttype;
;
break;}
-case 462:
-#line 2616 "objc-parse.y"
+case 468:
+#line 2638 "objc-parse.y"
{
continue_method_def ();
;
break;}
-case 463:
-#line 2620 "objc-parse.y"
+case 469:
+#line 2642 "objc-parse.y"
{
finish_method_def ();
objc_method_context = NULL_TREE;
;
break;}
-case 465:
-#line 2632 "objc-parse.y"
+case 471:
+#line 2654 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
-case 470:
-#line 2639 "objc-parse.y"
+case 476:
+#line 2661 "objc-parse.y"
{yyval.ttype = NULL_TREE; ;
break;}
-case 474:
-#line 2649 "objc-parse.y"
+case 480:
+#line 2671 "objc-parse.y"
{
/* Remember protocol qualifiers in prototypes. */
remember_protocol_qualifiers ();
objc_inherit_code = CLASS_METHOD_DECL;
;
break;}
-case 475:
-#line 2655 "objc-parse.y"
+case 481:
+#line 2677 "objc-parse.y"
{
/* Forget protocol qualifiers here. */
forget_protocol_qualifiers ();
add_class_method (objc_interface_context, yyvsp[0].ttype);
;
break;}
-case 477:
-#line 2663 "objc-parse.y"
+case 483:
+#line 2685 "objc-parse.y"
{
/* Remember protocol qualifiers in prototypes. */
remember_protocol_qualifiers ();
objc_inherit_code = INSTANCE_METHOD_DECL;
;
break;}
-case 478:
-#line 2669 "objc-parse.y"
+case 484:
+#line 2691 "objc-parse.y"
{
/* Forget protocol qualifiers here. */
forget_protocol_qualifiers ();
add_instance_method (objc_interface_context, yyvsp[0].ttype);
;
break;}
-case 480:
-#line 2679 "objc-parse.y"
+case 486:
+#line 2701 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, yyvsp[-2].ttype, yyvsp[0].ttype, NULL_TREE);
;
break;}
-case 481:
-#line 2684 "objc-parse.y"
+case 487:
+#line 2706 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, NULL_TREE, yyvsp[0].ttype, NULL_TREE);
;
break;}
-case 482:
-#line 2689 "objc-parse.y"
+case 488:
+#line 2711 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 483:
-#line 2694 "objc-parse.y"
+case 489:
+#line 2716 "objc-parse.y"
{
yyval.ttype = build_method_decl (objc_inherit_code, NULL_TREE, yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 492:
-#line 2724 "objc-parse.y"
+case 498:
+#line 2746 "objc-parse.y"
{ current_declspecs = TREE_VALUE (declspec_stack);
prefix_attributes = TREE_PURPOSE (declspec_stack);
declspec_stack = TREE_CHAIN (declspec_stack);
resume_momentary (yyvsp[-2].itype); ;
break;}
-case 493:
-#line 2729 "objc-parse.y"
+case 499:
+#line 2751 "objc-parse.y"
{ shadow_tag (yyvsp[-1].ttype); ;
break;}
-case 494:
-#line 2731 "objc-parse.y"
+case 500:
+#line 2753 "objc-parse.y"
{ pedwarn ("empty declaration"); ;
break;}
-case 495:
-#line 2736 "objc-parse.y"
+case 501:
+#line 2758 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
-case 496:
-#line 2738 "objc-parse.y"
+case 502:
+#line 2760 "objc-parse.y"
{ push_parm_decl (yyvsp[0].ttype); ;
break;}
-case 497:
-#line 2746 "objc-parse.y"
+case 503:
+#line 2768 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
yyvsp[0].ttype)); ;
break;}
-case 498:
-#line 2751 "objc-parse.y"
+case 504:
+#line 2773 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
yyvsp[0].ttype)); ;
break;}
-case 499:
-#line 2756 "objc-parse.y"
+case 505:
+#line 2778 "objc-parse.y"
{ yyval.ttype = build_tree_list (build_tree_list (current_declspecs,
yyvsp[-1].ttype),
build_tree_list (prefix_attributes,
yyvsp[0].ttype)); ;
break;}
-case 500:
-#line 2764 "objc-parse.y"
+case 506:
+#line 2786 "objc-parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
-case 501:
-#line 2768 "objc-parse.y"
+case 507:
+#line 2790 "objc-parse.y"
{
/* oh what a kludge! */
yyval.ttype = (tree)1;
;
break;}
-case 502:
-#line 2773 "objc-parse.y"
+case 508:
+#line 2795 "objc-parse.y"
{
pushlevel (0);
;
break;}
-case 503:
-#line 2777 "objc-parse.y"
+case 509:
+#line 2799 "objc-parse.y"
{
/* returns a tree list node generated by get_parm_info */
yyval.ttype = yyvsp[0].ttype;
poplevel (0, 0, 0);
;
break;}
-case 506:
-#line 2792 "objc-parse.y"
+case 512:
+#line 2814 "objc-parse.y"
{
yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 511:
-#line 2805 "objc-parse.y"
-{ yyval.ttype = get_identifier (token_buffer); ;
- break;}
-case 512:
-#line 2806 "objc-parse.y"
-{ yyval.ttype = get_identifier (token_buffer); ;
- break;}
-case 513:
-#line 2807 "objc-parse.y"
-{ yyval.ttype = get_identifier (token_buffer); ;
- break;}
-case 514:
-#line 2808 "objc-parse.y"
-{ yyval.ttype = get_identifier (token_buffer); ;
- break;}
-case 515:
-#line 2809 "objc-parse.y"
-{ yyval.ttype = get_identifier (token_buffer); ;
- break;}
-case 516:
-#line 2810 "objc-parse.y"
-{ yyval.ttype = get_identifier (token_buffer); ;
- break;}
case 517:
-#line 2811 "objc-parse.y"
+#line 2827 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 518:
-#line 2812 "objc-parse.y"
+#line 2828 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 519:
-#line 2813 "objc-parse.y"
+#line 2829 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 520:
-#line 2814 "objc-parse.y"
+#line 2830 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 521:
-#line 2815 "objc-parse.y"
+#line 2831 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 522:
-#line 2816 "objc-parse.y"
+#line 2832 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 523:
-#line 2817 "objc-parse.y"
+#line 2833 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 524:
-#line 2818 "objc-parse.y"
+#line 2834 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 525:
-#line 2819 "objc-parse.y"
+#line 2835 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 526:
-#line 2820 "objc-parse.y"
+#line 2836 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 527:
-#line 2821 "objc-parse.y"
+#line 2837 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 528:
-#line 2822 "objc-parse.y"
+#line 2838 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 529:
-#line 2823 "objc-parse.y"
+#line 2839 "objc-parse.y"
+{ yyval.ttype = get_identifier (token_buffer); ;
+ break;}
+case 530:
+#line 2840 "objc-parse.y"
+{ yyval.ttype = get_identifier (token_buffer); ;
+ break;}
+case 531:
+#line 2841 "objc-parse.y"
{ yyval.ttype = get_identifier (token_buffer); ;
break;}
case 532:
-#line 2829 "objc-parse.y"
+#line 2842 "objc-parse.y"
+{ yyval.ttype = get_identifier (token_buffer); ;
+ break;}
+case 533:
+#line 2843 "objc-parse.y"
+{ yyval.ttype = get_identifier (token_buffer); ;
+ break;}
+case 534:
+#line 2844 "objc-parse.y"
+{ yyval.ttype = get_identifier (token_buffer); ;
+ break;}
+case 535:
+#line 2845 "objc-parse.y"
+{ yyval.ttype = get_identifier (token_buffer); ;
+ break;}
+case 538:
+#line 2851 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (yyvsp[-5].ttype, yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
-case 533:
-#line 2834 "objc-parse.y"
+case 539:
+#line 2856 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (yyvsp[-2].ttype, NULL_TREE, yyvsp[0].ttype);
;
break;}
-case 534:
-#line 2839 "objc-parse.y"
+case 540:
+#line 2861 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (NULL_TREE, yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
-case 535:
-#line 2844 "objc-parse.y"
+case 541:
+#line 2866 "objc-parse.y"
{
yyval.ttype = build_keyword_decl (NULL_TREE, NULL_TREE, yyvsp[0].ttype);
;
break;}
-case 539:
-#line 2857 "objc-parse.y"
+case 545:
+#line 2879 "objc-parse.y"
{
yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 540:
-#line 2865 "objc-parse.y"
+case 546:
+#line 2887 "objc-parse.y"
{
if (TREE_CHAIN (yyvsp[0].ttype) == NULL_TREE)
/* just return the expr., remove a level of indirection */
@@ -4841,77 +4889,77 @@ case 540:
yyval.ttype = yyvsp[0].ttype;
;
break;}
-case 541:
-#line 2877 "objc-parse.y"
+case 547:
+#line 2899 "objc-parse.y"
{
yyval.ttype = build_tree_list (yyvsp[-2].ttype, yyvsp[0].ttype);
;
break;}
-case 542:
-#line 2881 "objc-parse.y"
+case 548:
+#line 2903 "objc-parse.y"
{
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype);
;
break;}
-case 544:
-#line 2889 "objc-parse.y"
+case 550:
+#line 2911 "objc-parse.y"
{
yyval.ttype = get_class_reference (yyvsp[0].ttype);
;
break;}
-case 545:
-#line 2896 "objc-parse.y"
+case 551:
+#line 2918 "objc-parse.y"
{ objc_receiver_context = 1; ;
break;}
-case 546:
-#line 2898 "objc-parse.y"
+case 552:
+#line 2920 "objc-parse.y"
{ objc_receiver_context = 0; ;
break;}
-case 547:
-#line 2900 "objc-parse.y"
+case 553:
+#line 2922 "objc-parse.y"
{
yyval.ttype = build_tree_list (yyvsp[-3].ttype, yyvsp[-1].ttype);
;
break;}
-case 551:
-#line 2913 "objc-parse.y"
+case 557:
+#line 2935 "objc-parse.y"
{
yyval.ttype = chainon (yyvsp[-1].ttype, yyvsp[0].ttype);
;
break;}
-case 552:
-#line 2920 "objc-parse.y"
+case 558:
+#line 2942 "objc-parse.y"
{
yyval.ttype = build_tree_list (yyvsp[-1].ttype, NULL_TREE);
;
break;}
-case 553:
-#line 2924 "objc-parse.y"
+case 559:
+#line 2946 "objc-parse.y"
{
yyval.ttype = build_tree_list (NULL_TREE, NULL_TREE);
;
break;}
-case 554:
-#line 2931 "objc-parse.y"
+case 560:
+#line 2953 "objc-parse.y"
{
yyval.ttype = yyvsp[-1].ttype;
;
break;}
-case 555:
-#line 2938 "objc-parse.y"
+case 561:
+#line 2960 "objc-parse.y"
{
yyval.ttype = yyvsp[-1].ttype;
;
break;}
-case 556:
-#line 2947 "objc-parse.y"
+case 562:
+#line 2969 "objc-parse.y"
{
yyval.ttype = groktypename (yyvsp[-1].ttype);
;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/bison.simple"
+#line 498 "/usr/cygnus/progressive-98r1/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -5107,5 +5155,5 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 2952 "objc-parse.y"
+#line 2974 "objc-parse.y"
diff --git a/gcc/objc/objc-parse.y b/gcc/objc/objc-parse.y
index 8f595654ce7..bc98ff23489 100644
--- a/gcc/objc/objc-parse.y
+++ b/gcc/objc/objc-parse.y
@@ -163,6 +163,7 @@ char *language_string = "GNU Obj-C";
%type <ttype> structsp component_decl_list component_decl_list2
%type <ttype> component_decl components component_declarator
%type <ttype> enumlist enumerator
+%type <ttype> struct_head union_head enum_head
%type <ttype> typename absdcl absdcl1 type_quals
%type <ttype> xexpr parms parm identifiers
@@ -1367,42 +1368,63 @@ notype_declarator:
| IDENTIFIER
;
+struct_head:
+ STRUCT
+ { $$ = NULL_TREE; }
+ | STRUCT attributes
+ { $$ = $2; }
+ ;
+
+union_head:
+ UNION
+ { $$ = NULL_TREE; }
+ | UNION attributes
+ { $$ = $2; }
+ ;
+
+enum_head:
+ ENUM
+ { $$ = NULL_TREE; }
+ | ENUM attributes
+ { $$ = $2; }
+ ;
+
structsp:
- STRUCT identifier '{'
+ struct_head identifier '{'
{ $$ = start_struct (RECORD_TYPE, $2);
/* Start scope of tag before parsing components. */
}
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, $5, $7); }
- | STRUCT '{' component_decl_list '}' maybe_attribute
+ { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
+ | struct_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
- $3, $5);
+ $3, chainon ($1, $5));
}
- | STRUCT identifier
+ | struct_head identifier
{ $$ = xref_tag (RECORD_TYPE, $2); }
- | UNION identifier '{'
+ | union_head identifier '{'
{ $$ = start_struct (UNION_TYPE, $2); }
component_decl_list '}' maybe_attribute
- { $$ = finish_struct ($<ttype>4, $5, $7); }
- | UNION '{' component_decl_list '}' maybe_attribute
+ { $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
+ | union_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
- $3, $5);
+ $3, chainon ($1, $5));
}
- | UNION identifier
+ | union_head identifier
{ $$ = xref_tag (UNION_TYPE, $2); }
- | ENUM identifier '{'
+ | enum_head identifier '{'
{ $<itype>3 = suspend_momentary ();
$$ = start_enum ($2); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>4, nreverse ($5), $8);
+ { $$= finish_enum ($<ttype>4, nreverse ($5), chainon ($1, $8));
resume_momentary ($<itype>3); }
- | ENUM '{'
+ | enum_head '{'
{ $<itype>2 = suspend_momentary ();
$$ = start_enum (NULL_TREE); }
enumlist maybecomma_warn '}' maybe_attribute
- { $$ = finish_enum ($<ttype>3, nreverse ($4), $7);
+ { $$= finish_enum ($<ttype>3, nreverse ($4), chainon ($1, $7));
resume_momentary ($<itype>2); }
- | ENUM identifier
+ | enum_head identifier
{ $$ = xref_tag (ENUMERAL_TYPE, $2); }
;
diff --git a/gcc/objc/objc.h b/gcc/objc/objc.h
deleted file mode 100644
index e48b0fd5bfb..00000000000
--- a/gcc/objc/objc.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Basic data types for Objective C.
- Copyright (C) 1993, 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. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not 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. */
-
-#ifndef __objc_INCLUDE_GNU
-#define __objc_INCLUDE_GNU
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-
-/*
-** Definition of the boolean type.
-*/
-#ifdef __vxworks
-typedef int BOOL;
-#else
-typedef unsigned char BOOL;
-#endif
-#define YES (BOOL)1
-#define NO (BOOL)0
-
-/*
-** Definition of a selector. Selectors themselves are not unique, but
-** the sel_id is a unique identifier.
-*/
-typedef const struct objc_selector
-{
- void *sel_id;
- const char *sel_types;
-} *SEL;
-
-inline static BOOL
-sel_eq (SEL s1, SEL s2)
-{
- if (s1 == 0 || s2 == 0)
- return s1 == s2;
- else
- return s1->sel_id == s2->sel_id;
-}
-
-
-/*
-** ObjC uses this typedef for untyped instances.
-*/
-typedef struct objc_object {
- struct objc_class* class_pointer;
-} *id;
-
-/*
-** Definition of method type. When retrieving the implementation of a
-** method, this is type of the pointer returned
-*/
-typedef id (*IMP)(id, SEL, ...);
-
-/*
-** More simple types...
-*/
-#define nil (id)0 /* id of Nil instance */
-#define Nil (Class)0 /* id of Nil class */
-typedef char *STR; /* String alias */
-
-/*
-** The compiler generates one of these structures for each class.
-**
-** This structure is the definition for classes.
-**
-** This structure is generated by the compiler in the executable and used by
-** the run-time during normal messaging operations. Therefore some members
-** change type. The compiler generates "char* const" and places a string in
-** the following member variables: super_class.
-*/
-typedef struct objc_class *MetaClass;
-typedef struct objc_class *Class;
-struct objc_class {
- MetaClass class_pointer; /* Pointer to the class's
- meta class. */
- struct objc_class* super_class; /* Pointer to the super
- class. NULL for class
- Object. */
- const char* name; /* Name of the class. */
- long version; /* Unknown. */
- unsigned long info; /* Bit mask. See class masks
- defined above. */
- long instance_size; /* Size in bytes of the class.
- The sum of the class
- definition and all super
- class definitions. */
- struct objc_ivar_list* ivars; /* Pointer to a structure that
- describes the instance
- variables in the class
- definition. NULL indicates
- no instance variables. Does
- not include super class
- variables. */
- struct objc_method_list* methods; /* Linked list of instance
- methods defined for the
- class. */
- struct sarray * dtable; /* Pointer to instance
- method dispatch table. */
- struct objc_class* subclass_list; /* Subclasses */
- struct objc_class* sibling_class;
-
- struct objc_protocol_list *protocols; /* Protocols conformed to */
-};
-
-#ifndef __OBJC__
-typedef struct objc_protocol {
- struct objc_class* class_pointer;
- char *protocol_name;
- struct objc_protocol_list *protocol_list;
- struct objc_method_description_list *instance_methods, *class_methods;
-} Protocol;
-
-#else /* __OBJC__ */
-@class Protocol;
-#endif
-
-typedef void* retval_t; /* return value */
-typedef void(*apply_t)(void); /* function pointer */
-typedef union {
- char *arg_ptr;
- char arg_regs[sizeof (char*)];
-} *arglist_t; /* argument frame */
-
-
-IMP objc_msg_lookup(id receiver, SEL op);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* not __objc_INCLUDE_GNU */
diff --git a/gcc/objc/objects.c b/gcc/objc/objects.c
deleted file mode 100644
index 3e68334c924..00000000000
--- a/gcc/objc/objects.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* GNU Objective C Runtime class related functions
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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 defs of bzero for target */
-#include "runtime.h" /* the kitchen sink */
-
-id __objc_object_alloc(Class);
-id __objc_object_dispose(id);
-id __objc_object_copy(id);
-
-id (*_objc_object_alloc)(Class) = __objc_object_alloc; /* !T:SINGLE */
-id (*_objc_object_dispose)(id) = __objc_object_dispose; /* !T:SINGLE */
-id (*_objc_object_copy)(id) = __objc_object_copy; /* !T:SINGLE */
-
-id
-class_create_instance(Class class)
-{
- id new = nil;
- if (CLS_ISCLASS(class))
- new = (*_objc_object_alloc)(class);
- if (new!=nil)
- {
- memset (new, 0, class->instance_size);
- new->class_pointer = class;
- }
- return new;
-}
-
-id
-object_copy(id object)
-{
- if ((object!=nil)&&CLS_ISCLASS(object->class_pointer))
- return (*_objc_object_copy)(object);
- else
- return nil;
-}
-
-id
-object_dispose(id object)
-{
- if ((object!=nil)&&CLS_ISCLASS(object->class_pointer))
- {
- if (_objc_object_dispose)
- (*_objc_object_dispose)(object);
- else
- objc_free(object);
- }
- return nil;
-}
-
-id __objc_object_alloc(Class class)
-{
- return (id)objc_malloc(class->instance_size);
-}
-
-id __objc_object_dispose(id object)
-{
- objc_free(object);
- return 0;
-}
-
-id __objc_object_copy(id object)
-{
- id copy = class_create_instance(object->class_pointer);
- memcpy(copy, object, object->class_pointer->instance_size);
- return copy;
-}
-
-
diff --git a/gcc/objc/runtime.h b/gcc/objc/runtime.h
deleted file mode 100644
index b0eae4a222d..00000000000
--- a/gcc/objc/runtime.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* GNU Objective C Runtime internal declarations
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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. */
-
-#ifndef __objc_runtime_INCLUDE_GNU
-#define __objc_runtime_INCLUDE_GNU
-
-#include <stdarg.h> /* for varargs and va_list's */
-
-#include <stdio.h>
-#include <ctype.h>
-
-#include <stddef.h> /* so noone else will get system versions */
-#include "assert.h"
-
-#include "objc/objc.h" /* core data types */
-#include "objc/objc-api.h" /* runtime api functions */
-
-#include "objc/thr.h" /* thread and mutex support */
-
-#include "objc/hash.h" /* hash structures */
-#include "objc/objc-list.h" /* linear lists */
-
-extern void __objc_add_class_to_hash(Class); /* (objc-class.c) */
-extern void __objc_init_selector_tables(void); /* (objc-sel.c) */
-extern void __objc_init_class_tables(void); /* (objc-class.c) */
-extern void __objc_init_dispatch_tables(void); /* (objc-dispatch.c) */
-extern void __objc_install_premature_dtable(Class); /* (objc-dispatch.c) */
-extern void __objc_resolve_class_links(void); /* (objc-class.c) */
-extern void __objc_register_selectors_from_class(Class); /* (objc-sel.c) */
-extern void __objc_update_dispatch_table_for_class (Class);/* (objc-msg.c) */
-
-extern int __objc_init_thread_system(void); /* thread.c */
-extern int __objc_fini_thread_system(void); /* thread.c */
-extern void __objc_print_dtable_stats(void); /* sendmsg.c */
-
-extern void class_add_method_list(Class, MethodList_t);
-
-/* Registering instance methods as class methods for root classes */
-extern void __objc_register_instance_methods_to_class(Class);
-extern Method_t search_for_method_in_list(MethodList_t list, SEL op);
-
-/* True when class links has been resolved */
-extern BOOL __objc_class_links_resolved;
-
-/* Number of selectors stored in each of the selector tables */
-extern int __objc_selector_max_index;
-
-/* Mutex locking __objc_selector_max_index and its arrays. */
-extern objc_mutex_t __objc_runtime_mutex;
-
-/* Number of threads which are alive. */
-extern int __objc_runtime_threads_alive;
-
-#ifdef DEBUG
-#define DEBUG_PRINTF(format, args...) printf (format, ## args)
-#else
-#define DEBUG_PRINTF(format, args...)
-#endif
-
-BOOL __objc_responds_to (id object, SEL sel); /* for internal use only! */
-SEL __sel_register_typed_name (const char*, const char*,
- struct objc_selector*, BOOL is_const);
-
-#endif /* not __objc_runtime_INCLUDE_GNU */
-
-
diff --git a/gcc/objc/sarray.c b/gcc/objc/sarray.c
deleted file mode 100644
index 7e40fba750f..00000000000
--- a/gcc/objc/sarray.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/* Sparse Arrays for Objective C dispatch tables
- Copyright (C) 1993, 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. */
-
-/* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not 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 "objc/sarray.h"
-#include "objc/runtime.h"
-#include <stdio.h>
-#include "assert.h"
-
-int nbuckets = 0; /* !T:MUTEX */
-int nindices = 0; /* !T:MUTEX */
-int narrays = 0; /* !T:MUTEX */
-int idxsize = 0; /* !T:MUTEX */
-
-static void * first_free_data = NULL; /* !T:MUTEX */
-
-#ifdef OBJC_SPARSE2
-const char* __objc_sparse2_id = "2 level sparse indices";
-#endif
-
-#ifdef OBJC_SPARSE3
-const char* __objc_sparse3_id = "3 level sparse indices";
-#endif
-
-#ifdef __alpha__
-const void *memcpy (void*, const void*, size_t);
-#endif
-
-/* This function removes any structures left over from free operations
- that were not safe in a multi-threaded environment. */
-void
-sarray_remove_garbage(void)
-{
- void **vp;
- void *np;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- vp = first_free_data;
- first_free_data = NULL;
-
- while (vp) {
- np = *vp;
- objc_free(vp);
- vp = np;
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Free a block of dynamically allocated memory. If we are in multi-threaded
- mode, it is ok to free it. If not, we add it to the garbage heap to be
- freed later. */
-
-static void
-sarray_free_garbage(void *vp)
-{
- objc_mutex_lock(__objc_runtime_mutex);
-
- if (__objc_runtime_threads_alive == 1) {
- objc_free(vp);
- if (first_free_data)
- sarray_remove_garbage();
- }
- else {
- *(void **)vp = first_free_data;
- first_free_data = vp;
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* sarray_at_put : copies data in such a way as to be thread reader safe. */
-void
-sarray_at_put(struct sarray* array, sidx index, void* element)
-{
-#ifdef OBJC_SPARSE3
- struct sindex** the_index;
- struct sindex* new_index;
-#endif
- struct sbucket** the_bucket;
- struct sbucket* new_bucket;
-#ifdef OBJC_SPARSE3
- size_t ioffset;
-#endif
- size_t boffset;
- size_t eoffset;
-#ifdef PRECOMPUTE_SELECTORS
- union sofftype xx;
- xx.idx = index;
-#ifdef OBJC_SPARSE3
- ioffset = xx.off.ioffset;
-#endif
- boffset = xx.off.boffset;
- eoffset = xx.off.eoffset;
-#else /* not PRECOMPUTE_SELECTORS */
-#ifdef OBJC_SPARSE3
- ioffset = index/INDEX_CAPACITY;
- boffset = (index/BUCKET_SIZE)%INDEX_SIZE;
- eoffset = index%BUCKET_SIZE;
-#else
- boffset = index/BUCKET_SIZE;
- eoffset = index%BUCKET_SIZE;
-#endif
-#endif /* not PRECOMPUTE_SELECTORS */
-
- assert(soffset_decode(index) < array->capacity); /* Range check */
-
-#ifdef OBJC_SPARSE3
- the_index = &(array->indices[ioffset]);
- the_bucket = &((*the_index)->buckets[boffset]);
-#else
- the_bucket = &(array->buckets[boffset]);
-#endif
-
- if ((*the_bucket)->elems[eoffset] == element)
- return; /* great! we just avoided a lazy copy */
-
-#ifdef OBJC_SPARSE3
-
- /* First, perform lazy copy/allocation of index if needed */
-
- if ((*the_index) == array->empty_index) {
-
- /* The index was previously empty, allocate a new */
- new_index = (struct sindex*)objc_malloc(sizeof(struct sindex));
- memcpy(new_index, array->empty_index, sizeof(struct sindex));
- new_index->version.version = array->version.version;
- *the_index = new_index; /* Prepared for install. */
- the_bucket = &((*the_index)->buckets[boffset]);
-
- nindices += 1;
- } else if ((*the_index)->version.version != array->version.version) {
-
- /* This index must be lazy copied */
- struct sindex* old_index = *the_index;
- new_index = (struct sindex*)objc_malloc(sizeof(struct sindex));
- memcpy( new_index, old_index, sizeof(struct sindex));
- new_index->version.version = array->version.version;
- *the_index = new_index; /* Prepared for install. */
- the_bucket = &((*the_index)->buckets[boffset]);
-
- nindices += 1;
- }
-
-#endif /* OBJC_SPARSE3 */
-
- /* next, perform lazy allocation/copy of the bucket if needed */
-
- if ((*the_bucket) == array->empty_bucket) {
-
- /* The bucket was previously empty (or something like that), */
- /* allocate a new. This is the effect of `lazy' allocation */
- new_bucket = (struct sbucket*)objc_malloc(sizeof(struct sbucket));
- memcpy((void *) new_bucket, (const void*)array->empty_bucket,
- sizeof(struct sbucket));
- new_bucket->version.version = array->version.version;
- *the_bucket = new_bucket; /* Prepared for install. */
-
- nbuckets += 1;
-
- } else if ((*the_bucket)->version.version != array->version.version) {
-
- /* Perform lazy copy. */
- struct sbucket* old_bucket = *the_bucket;
- new_bucket = (struct sbucket*)objc_malloc(sizeof(struct sbucket));
- memcpy( new_bucket, old_bucket, sizeof(struct sbucket));
- new_bucket->version.version = array->version.version;
- *the_bucket = new_bucket; /* Prepared for install. */
-
- nbuckets += 1;
-
- }
- (*the_bucket)->elems[eoffset] = element;
-}
-
-void
-sarray_at_put_safe(struct sarray* array, sidx index, void* element)
-{
- if(soffset_decode(index) >= array->capacity)
- sarray_realloc(array, soffset_decode(index)+1);
- sarray_at_put(array, index, element);
-}
-
-struct sarray*
-sarray_new (int size, void* default_element)
-{
- struct sarray* arr;
-#ifdef OBJC_SPARSE3
- size_t num_indices = ((size-1)/(INDEX_CAPACITY))+1;
- struct sindex ** new_indices;
-#else /* OBJC_SPARSE2 */
- size_t num_indices = ((size-1)/BUCKET_SIZE)+1;
- struct sbucket ** new_buckets;
-#endif
- int counter;
-
- assert(size > 0);
-
- /* Allocate core array */
- arr = (struct sarray*) objc_malloc(sizeof(struct sarray));
- arr->version.version = 0;
-
- /* Initialize members */
-#ifdef OBJC_SPARSE3
- arr->capacity = num_indices*INDEX_CAPACITY;
- new_indices = (struct sindex**)
- objc_malloc(sizeof(struct sindex*)*num_indices);
-
- arr->empty_index = (struct sindex*) objc_malloc(sizeof(struct sindex));
- arr->empty_index->version.version = 0;
-
- narrays += 1;
- idxsize += num_indices;
- nindices += 1;
-
-#else /* OBJC_SPARSE2 */
- arr->capacity = num_indices*BUCKET_SIZE;
- new_buckets = (struct sbucket**)
- objc_malloc(sizeof(struct sbucket*)*num_indices);
-
- narrays += 1;
- idxsize += num_indices;
-
-#endif
-
- arr->empty_bucket = (struct sbucket*) objc_malloc(sizeof(struct sbucket));
- arr->empty_bucket->version.version = 0;
-
- nbuckets += 1;
-
- arr->ref_count = 1;
- arr->is_copy_of = (struct sarray*)0;
-
- for (counter=0; counter<BUCKET_SIZE; counter++)
- arr->empty_bucket->elems[counter] = default_element;
-
-#ifdef OBJC_SPARSE3
- for (counter=0; counter<INDEX_SIZE; counter++)
- arr->empty_index->buckets[counter] = arr->empty_bucket;
-
- for (counter=0; counter<num_indices; counter++)
- new_indices[counter] = arr->empty_index;
-
-#else /* OBJC_SPARSE2 */
-
- for (counter=0; counter<num_indices; counter++)
- new_buckets[counter] = arr->empty_bucket;
-
-#endif
-
-#ifdef OBJC_SPARSE3
- arr->indices = new_indices;
-#else /* OBJC_SPARSE2 */
- arr->buckets = new_buckets;
-#endif
-
- return arr;
-}
-
-
-/* Reallocate the sparse array to hold `newsize' entries
- Note: We really allocate and then free. We have to do this to ensure that
- any concurrent readers notice the update. */
-
-void
-sarray_realloc(struct sarray* array, int newsize)
-{
-#ifdef OBJC_SPARSE3
- size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
- size_t new_max_index = ((newsize-1)/INDEX_CAPACITY);
- size_t rounded_size = (new_max_index+1)*INDEX_CAPACITY;
-
- struct sindex ** new_indices;
- struct sindex ** old_indices;
-
-#else /* OBJC_SPARSE2 */
- size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
- size_t new_max_index = ((newsize-1)/BUCKET_SIZE);
- size_t rounded_size = (new_max_index+1)*BUCKET_SIZE;
-
- struct sbucket ** new_buckets;
- struct sbucket ** old_buckets;
-
-#endif
-
- int counter;
-
- assert(newsize > 0);
-
- /* The size is the same, just ignore the request */
- if(rounded_size <= array->capacity)
- return;
-
- assert(array->ref_count == 1); /* stop if lazy copied... */
-
- /* We are asked to extend the array -- allocate new bucket table, */
- /* and insert empty_bucket in newly allocated places. */
- if(rounded_size > array->capacity)
- {
-
-#ifdef OBJC_SPARSE3
- new_max_index += 4;
- rounded_size = (new_max_index+1)*INDEX_CAPACITY;
-
-#else /* OBJC_SPARSE2 */
- new_max_index += 4;
- rounded_size = (new_max_index+1)*BUCKET_SIZE;
-#endif
-
- /* update capacity */
- array->capacity = rounded_size;
-
-#ifdef OBJC_SPARSE3
- /* alloc to force re-read by any concurrent readers. */
- old_indices = array->indices;
- new_indices = (struct sindex**)
- objc_malloc((new_max_index+1)*sizeof(struct sindex*));
-#else /* OBJC_SPARSE2 */
- old_buckets = array->buckets;
- new_buckets = (struct sbucket**)
- objc_malloc((new_max_index+1)*sizeof(struct sbucket*));
-#endif
-
- /* copy buckets below old_max_index (they are still valid) */
- for(counter = 0; counter <= old_max_index; counter++ ) {
-#ifdef OBJC_SPARSE3
- new_indices[counter] = old_indices[counter];
-#else /* OBJC_SPARSE2 */
- new_buckets[counter] = old_buckets[counter];
-#endif
- }
-
-#ifdef OBJC_SPARSE3
- /* reset entries above old_max_index to empty_bucket */
- for(counter = old_max_index+1; counter <= new_max_index; counter++)
- new_indices[counter] = array->empty_index;
-#else /* OBJC_SPARSE2 */
- /* reset entries above old_max_index to empty_bucket */
- for(counter = old_max_index+1; counter <= new_max_index; counter++)
- new_buckets[counter] = array->empty_bucket;
-#endif
-
-#ifdef OBJC_SPARSE3
- /* install the new indices */
- array->indices = new_indices;
-#else /* OBJC_SPARSE2 */
- array->buckets = new_buckets;
-#endif
-
-#ifdef OBJC_SPARSE3
- /* free the old indices */
- sarray_free_garbage(old_indices);
-#else /* OBJC_SPARSE2 */
- sarray_free_garbage(old_buckets);
-#endif
-
- idxsize += (new_max_index-old_max_index);
- return;
- }
-}
-
-
-/* Free a sparse array allocated with sarray_new */
-
-void
-sarray_free(struct sarray* array) {
-
-#ifdef OBJC_SPARSE3
- size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
- struct sindex ** old_indices;
-#else
- size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
- struct sbucket ** old_buckets;
-#endif
- int counter = 0;
-
- assert(array->ref_count != 0); /* Freed multiple times!!! */
-
- if(--(array->ref_count) != 0) /* There exists copies of me */
- return;
-
-#ifdef OBJC_SPARSE3
- old_indices = array->indices;
-#else
- old_buckets = array->buckets;
-#endif
-
- if((array->is_copy_of) && ((array->is_copy_of->ref_count - 1) == 0))
- sarray_free(array->is_copy_of);
-
- /* Free all entries that do not point to empty_bucket */
- for(counter = 0; counter <= old_max_index; counter++ ) {
-#ifdef OBJC_SPARSE3
- struct sindex* idx = old_indices[counter];
- if((idx != array->empty_index) &&
- (idx->version.version == array->version.version)) {
- int c2;
- for(c2=0; c2<INDEX_SIZE; c2++) {
- struct sbucket* bkt = idx->buckets[c2];
- if((bkt != array->empty_bucket) &&
- (bkt->version.version == array->version.version))
- {
- sarray_free_garbage(bkt);
- nbuckets -= 1;
- }
- }
- sarray_free_garbage(idx);
- nindices -= 1;
- }
-#else /* OBJC_SPARSE2 */
- struct sbucket* bkt = array->buckets[counter];
- if ((bkt != array->empty_bucket) &&
- (bkt->version.version == array->version.version))
- {
- sarray_free_garbage(bkt);
- nbuckets -= 1;
- }
-#endif
- }
-
-#ifdef OBJC_SPARSE3
- /* free empty_index */
- if(array->empty_index->version.version == array->version.version) {
- sarray_free_garbage(array->empty_index);
- nindices -= 1;
- }
-#endif
-
- /* free empty_bucket */
- if(array->empty_bucket->version.version == array->version.version) {
- sarray_free_garbage(array->empty_bucket);
- nbuckets -= 1;
- }
- idxsize -= (old_max_index+1);
- narrays -= 1;
-
-#ifdef OBJC_SPARSE3
- /* free bucket table */
- sarray_free_garbage(array->indices);
-
-#else
- /* free bucket table */
- sarray_free_garbage(array->buckets);
-
-#endif
-
- /* free array */
- sarray_free_garbage(array);
-}
-
-/* This is a lazy copy. Only the core of the structure is actually */
-/* copied. */
-
-struct sarray*
-sarray_lazy_copy(struct sarray* oarr)
-{
- struct sarray* arr;
-
-#ifdef OBJC_SPARSE3
- size_t num_indices = ((oarr->capacity-1)/INDEX_CAPACITY)+1;
- struct sindex ** new_indices;
-#else /* OBJC_SPARSE2 */
- size_t num_indices = ((oarr->capacity-1)/BUCKET_SIZE)+1;
- struct sbucket ** new_buckets;
-#endif
-
- /* Allocate core array */
- arr = (struct sarray*) objc_malloc(sizeof(struct sarray)); /* !!! */
- arr->version.version = oarr->version.version + 1;
-#ifdef OBJC_SPARSE3
- arr->empty_index = oarr->empty_index;
-#endif
- arr->empty_bucket = oarr->empty_bucket;
- arr->ref_count = 1;
- oarr->ref_count += 1;
- arr->is_copy_of = oarr;
- arr->capacity = oarr->capacity;
-
-#ifdef OBJC_SPARSE3
- /* Copy bucket table */
- new_indices = (struct sindex**)
- objc_malloc(sizeof(struct sindex*)*num_indices);
- memcpy( new_indices,oarr->indices,
- sizeof(struct sindex*)*num_indices);
- arr->indices = new_indices;
-#else
- /* Copy bucket table */
- new_buckets = (struct sbucket**)
- objc_malloc(sizeof(struct sbucket*)*num_indices);
- memcpy( new_buckets,oarr->buckets,
- sizeof(struct sbucket*)*num_indices);
- arr->buckets = new_buckets;
-#endif
-
- idxsize += num_indices;
- narrays += 1;
-
- return arr;
-}
diff --git a/gcc/objc/sarray.h b/gcc/objc/sarray.h
deleted file mode 100644
index 74fa38652ba..00000000000
--- a/gcc/objc/sarray.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Sparse Arrays for Objective C dispatch tables
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup.
-
-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 files
- compiled with GCC to produce an executable, this does not 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. */
-
-#ifndef __sarray_INCLUDE_GNU
-#define __sarray_INCLUDE_GNU
-
-#define OBJC_SPARSE2 /* 2-level sparse array */
-/* #define OBJC_SPARSE3 */ /* 3-level sparse array */
-
-#ifdef OBJC_SPARSE2
-extern const char* __objc_sparse2_id;
-#endif
-
-#ifdef OBJC_SPARSE3
-extern const char* __objc_sparse3_id;
-#endif
-
-#include <stddef.h>
-
-#include "objc/thr.h"
-
-extern int nbuckets; /* for stats */
-extern int nindices;
-extern int narrays;
-extern int idxsize;
-
-#include <assert.h>
-
-/* An unsigned integer of same size as a pointer */
-#define SIZET_BITS (sizeof(size_t)*8)
-
-#if defined(__sparc__) || defined(OBJC_SPARSE2)
-#define PRECOMPUTE_SELECTORS
-#endif
-
-#ifdef OBJC_SPARSE3
-
-/* Buckets are 8 words each */
-#define BUCKET_BITS 3
-#define BUCKET_SIZE (1<<BUCKET_BITS)
-#define BUCKET_MASK (BUCKET_SIZE-1)
-
-/* Indices are 16 words each */
-#define INDEX_BITS 4
-#define INDEX_SIZE (1<<INDEX_BITS)
-#define INDEX_MASK (INDEX_SIZE-1)
-
-#define INDEX_CAPACITY (BUCKET_SIZE*INDEX_SIZE)
-
-#else /* OBJC_SPARSE2 */
-
-/* Buckets are 32 words each */
-#define BUCKET_BITS 5
-#define BUCKET_SIZE (1<<BUCKET_BITS)
-#define BUCKET_MASK (BUCKET_SIZE-1)
-
-#endif /* OBJC_SPARSE2 */
-
-typedef size_t sidx;
-
-#ifdef PRECOMPUTE_SELECTORS
-
-struct soffset {
-#ifdef OBJC_SPARSE3
- unsigned int unused : SIZET_BITS/4;
- unsigned int eoffset : SIZET_BITS/4;
- unsigned int boffset : SIZET_BITS/4;
- unsigned int ioffset : SIZET_BITS/4;
-#else /* OBJC_SPARSE2 */
-#ifdef __sparc__
- unsigned int boffset : (SIZET_BITS - 2) - BUCKET_BITS;
- unsigned int eoffset : BUCKET_BITS;
- unsigned int unused : 2;
-#else
- unsigned int boffset : SIZET_BITS/2;
- unsigned int eoffset : SIZET_BITS/2;
-#endif
-#endif /* OBJC_SPARSE2 */
-};
-
-union sofftype {
- struct soffset off;
- sidx idx;
-};
-
-#endif /* not PRECOMPUTE_SELECTORS */
-
-union sversion {
- int version;
- void *next_free;
-};
-
-struct sbucket {
- void* elems[BUCKET_SIZE]; /* elements stored in array */
- union sversion version; /* used for copy-on-write */
-};
-
-#ifdef OBJC_SPARSE3
-
-struct sindex {
- struct sbucket* buckets[INDEX_SIZE];
- union sversion version; /* used for copy-on-write */
-};
-
-#endif /* OBJC_SPARSE3 */
-
-struct sarray {
-#ifdef OBJC_SPARSE3
- struct sindex** indices;
- struct sindex* empty_index;
-#else /* OBJC_SPARSE2 */
- struct sbucket** buckets;
-#endif /* OBJC_SPARSE2 */
- struct sbucket* empty_bucket;
- union sversion version; /* used for copy-on-write */
- short ref_count;
- struct sarray* is_copy_of;
- size_t capacity;
-};
-
-struct sarray* sarray_new(int, void* default_element);
-void sarray_free(struct sarray*);
-struct sarray* sarray_lazy_copy(struct sarray*);
-void sarray_realloc(struct sarray*, int new_size);
-void sarray_at_put(struct sarray*, sidx index, void* elem);
-void sarray_at_put_safe(struct sarray*, sidx index, void* elem);
-
-struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
-void sarray_remove_garbage(void);
-
-
-#ifdef PRECOMPUTE_SELECTORS
-/* Transform soffset values to ints and vica verca */
-static inline unsigned int
-soffset_decode(sidx index)
-{
- union sofftype x;
- x.idx = index;
-#ifdef OBJC_SPARSE3
- return x.off.eoffset
- + (x.off.boffset*BUCKET_SIZE)
- + (x.off.ioffset*INDEX_CAPACITY);
-#else /* OBJC_SPARSE2 */
- return x.off.eoffset + (x.off.boffset*BUCKET_SIZE);
-#endif /* OBJC_SPARSE2 */
-}
-
-static inline sidx
-soffset_encode(size_t offset)
-{
- union sofftype x;
- x.off.eoffset = offset%BUCKET_SIZE;
-#ifdef OBJC_SPARSE3
- x.off.boffset = (offset/BUCKET_SIZE)%INDEX_SIZE;
- x.off.ioffset = offset/INDEX_CAPACITY;
-#else /* OBJC_SPARSE2 */
- x.off.boffset = offset/BUCKET_SIZE;
-#endif
- return (sidx)x.idx;
-}
-
-#else /* not PRECOMPUTE_SELECTORS */
-
-static inline size_t
-soffset_decode(sidx index)
-{
- return index;
-}
-
-static inline sidx
-soffset_encode(size_t offset)
-{
- return offset;
-}
-#endif /* not PRECOMPUTE_SELECTORS */
-
-/* Get element from the Sparse array `array' at offset `index' */
-
-static inline void* sarray_get(struct sarray* array, sidx index)
-{
-#ifdef PRECOMPUTE_SELECTORS
- union sofftype x;
- x.idx = index;
-#ifdef OBJC_SPARSE3
- return
- array->
- indices[x.off.ioffset]->
- buckets[x.off.boffset]->
- elems[x.off.eoffset];
-#else /* OBJC_SPARSE2 */
- return array->buckets[x.off.boffset]->elems[x.off.eoffset];
-#endif /* OBJC_SPARSE2 */
-#else /* not PRECOMPUTE_SELECTORS */
-#ifdef OBJC_SPARSE3
- return array->
- indices[index/INDEX_CAPACITY]->
- buckets[(index/BUCKET_SIZE)%INDEX_SIZE]->
- elems[index%BUCKET_SIZE];
-#else /* OBJC_SPARSE2 */
- return array->buckets[index/BUCKET_SIZE]->elems[index%BUCKET_SIZE];
-#endif /* not OBJC_SPARSE3 */
-#endif /* not PRECOMPUTE_SELECTORS */
-}
-
-static inline void* sarray_get_safe(struct sarray* array, sidx index)
-{
- if(soffset_decode(index) < array->capacity)
- return sarray_get(array, index);
- else
- return (array->empty_bucket->elems[0]);
-}
-
-#endif /* __sarray_INCLUDE_GNU */
diff --git a/gcc/objc/selector.c b/gcc/objc/selector.c
deleted file mode 100644
index 83c70e4ae0f..00000000000
--- a/gcc/objc/selector.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* GNU Objective C Runtime selector related functions
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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 "runtime.h"
-#include "objc/sarray.h"
-#include "encoding.h"
-
-/* Initial selector hash table size. Value doesn't matter much */
-#define SELECTOR_HASH_SIZE 128
-
-/* Tables mapping selector names to uid and opposite */
-static struct sarray* __objc_selector_array = 0; /* uid -> sel !T:MUTEX */
-static struct sarray* __objc_selector_names = 0; /* uid -> name !T:MUTEX */
-static cache_ptr __objc_selector_hash = 0; /* name -> uid !T:MUTEX */
-
-static void register_selectors_from_list(MethodList_t);
-
-/* Number of selectors stored in each of the above tables */
-int __objc_selector_max_index = 0; /* !T:MUTEX */
-
-void __objc_init_selector_tables()
-{
- __objc_selector_array = sarray_new (SELECTOR_HASH_SIZE, 0);
- __objc_selector_names = sarray_new (SELECTOR_HASH_SIZE, 0);
- __objc_selector_hash
- = hash_new (SELECTOR_HASH_SIZE,
- (hash_func_type) hash_string,
- (compare_func_type) compare_strings);
-}
-
-/* This routine is given a class and records all of the methods in its class
- structure in the record table. */
-void
-__objc_register_selectors_from_class (Class class)
-{
- MethodList_t method_list;
-
- method_list = class->methods;
- while (method_list)
- {
- register_selectors_from_list (method_list);
- method_list = method_list->method_next;
- }
-}
-
-
-/* This routine is given a list of methods and records each of the methods in
- the record table. This is the routine that does the actual recording
- work.
-
- This one is only called for Class objects. For categories,
- class_add_method_list is called.
- */
-static void
-register_selectors_from_list (MethodList_t method_list)
-{
- int i = 0;
- while (i < method_list->method_count)
- {
- Method_t method = &method_list->method_list[i];
- method->method_name
- = sel_register_typed_name ((const char*)method->method_name,
- method->method_types);
- i += 1;
- }
-}
-
-
-/* Register instance methods as class methods for root classes */
-void __objc_register_instance_methods_to_class(Class class)
-{
- MethodList_t method_list;
- MethodList_t class_method_list;
- int max_methods_no = 16;
- MethodList_t new_list;
- Method_t curr_method;
-
- /* Only if a root class. */
- if(class->super_class)
- return;
-
- /* Allocate a method list to hold the new class methods */
- new_list = objc_calloc(sizeof(struct objc_method_list)
- + sizeof(struct objc_method[max_methods_no]), 1);
- method_list = class->methods;
- class_method_list = class->class_pointer->methods;
- curr_method = &new_list->method_list[0];
-
- /* Iterate through the method lists for the class */
- while (method_list)
- {
- int i;
-
- /* Iterate through the methods from this method list */
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t mth = &method_list->method_list[i];
- if (mth->method_name
- && !search_for_method_in_list (class_method_list,
- mth->method_name))
- {
- /* This instance method isn't a class method.
- Add it into the new_list. */
- *curr_method = *mth;
-
- /* Reallocate the method list if necessary */
- if(++new_list->method_count == max_methods_no)
- new_list =
- objc_realloc(new_list, sizeof(struct objc_method_list)
- + sizeof(struct
- objc_method[max_methods_no += 16]));
- curr_method = &new_list->method_list[new_list->method_count];
- }
- }
-
- method_list = method_list->method_next;
- }
-
- /* If we created any new class methods
- then attach the method list to the class */
- if (new_list->method_count)
- {
- new_list =
- objc_realloc(new_list, sizeof(struct objc_method_list)
- + sizeof(struct objc_method[new_list->method_count]));
- new_list->method_next = class->class_pointer->methods;
- class->class_pointer->methods = new_list;
- }
-
- __objc_update_dispatch_table_for_class (class->class_pointer);
-}
-
-
-/* Returns YES iff t1 and t2 have same method types, but we ignore
- the argframe layout */
-BOOL
-sel_types_match (const char* t1, const char* t2)
-{
- if (!t1 || !t2)
- return NO;
- while (*t1 && *t2)
- {
- if (*t1 == '+') t1++;
- if (*t2 == '+') t2++;
- while (isdigit(*t1)) t1++;
- while (isdigit(*t2)) t2++;
- /* xxx Remove these next two lines when qualifiers are put in
- all selectors, not just Protocol selectors. */
- t1 = objc_skip_type_qualifiers(t1);
- t2 = objc_skip_type_qualifiers(t2);
- if (!*t1 && !*t2)
- return YES;
- if (*t1 != *t2)
- return NO;
- t1++;
- t2++;
- }
- return NO;
-}
-
-/* return selector representing name */
-SEL
-sel_get_typed_uid (const char *name, const char *types)
-{
- struct objc_list *l;
- sidx i;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (i == 0)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
- }
-
- for (l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- l; l = l->tail)
- {
- SEL s = (SEL)l->head;
- if (types == 0 || s->sel_types == 0)
- {
- if (s->sel_types == types)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
- }
- }
- else if (sel_types_match (s->sel_types, types))
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
-}
-
-/* Return selector representing name; prefer a selector with non-NULL type */
-SEL
-sel_get_any_typed_uid (const char *name)
-{
- struct objc_list *l;
- sidx i;
- SEL s = NULL;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (i == 0)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
- }
-
- for (l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- l; l = l->tail)
- {
- s = (SEL) l->head;
- if (s->sel_types)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
- }
- }
-
- objc_mutex_unlock(__objc_runtime_mutex);
- return s;
-}
-
-/* return selector representing name */
-SEL
-sel_get_any_uid (const char *name)
-{
- struct objc_list *l;
- sidx i;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (soffset_decode (i) == 0)
- {
- objc_mutex_unlock(__objc_runtime_mutex);
- return 0;
- }
-
- l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- objc_mutex_unlock(__objc_runtime_mutex);
-
- if (l == 0)
- return 0;
-
- return (SEL)l->head;
-}
-
-/* return selector representing name */
-SEL
-sel_get_uid (const char *name)
-{
- return sel_register_typed_name (name, 0);
-}
-
-/* Get name of selector. If selector is unknown, the empty string ""
- is returned */
-const char*
-sel_get_name (SEL selector)
-{
- const char *ret;
-
- objc_mutex_lock(__objc_runtime_mutex);
- if ((soffset_decode((sidx)selector->sel_id) > 0)
- && (soffset_decode((sidx)selector->sel_id) <= __objc_selector_max_index))
- ret = sarray_get_safe (__objc_selector_names, (sidx) selector->sel_id);
- else
- ret = 0;
- objc_mutex_unlock(__objc_runtime_mutex);
- return ret;
-}
-
-BOOL
-sel_is_mapped (SEL selector)
-{
- unsigned int idx = soffset_decode ((sidx)selector->sel_id);
- return ((idx > 0) && (idx <= __objc_selector_max_index));
-}
-
-
-const char*
-sel_get_type (SEL selector)
-{
- if (selector)
- return selector->sel_types;
- else
- return 0;
-}
-
-/* The uninstalled dispatch table */
-extern struct sarray* __objc_uninstalled_dtable;
-
-/* Store the passed selector name in the selector record and return its
- selector value (value returned by sel_get_uid).
- Assumes that the calling function has locked down __objc_runtime_mutex. */
-/* is_const parameter tells us if the name and types parameters
- are really constant or not. If YES then they are constant and
- we can just store the pointers. If NO then we need to copy
- name and types because the pointers may disappear later on. */
-SEL
-__sel_register_typed_name (const char *name, const char *types,
- struct objc_selector *orig, BOOL is_const)
-{
- struct objc_selector* j;
- sidx i;
- struct objc_list *l;
-
- i = (sidx) hash_value_for_key (__objc_selector_hash, name);
- if (soffset_decode (i) != 0)
- {
- for (l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- l; l = l->tail)
- {
- SEL s = (SEL)l->head;
- if (types == 0 || s->sel_types == 0)
- {
- if (s->sel_types == types)
- {
- if (orig)
- {
- orig->sel_id = (void*)i;
- return orig;
- }
- else
- return s;
- }
- }
- else if (!strcmp (s->sel_types, types))
- {
- if (orig)
- {
- orig->sel_id = (void*)i;
- return orig;
- }
- else
- return s;
- }
- }
- if (orig)
- j = orig;
- else
- j = objc_malloc (sizeof (struct objc_selector));
-
- j->sel_id = (void*)i;
- /* Can we use the pointer or must copy types? Don't copy if NULL */
- if ((is_const) || (types == 0))
- j->sel_types = (const char*)types;
- else {
- j->sel_types = (char *) objc_malloc(strlen(types)+1);
- strcpy((char *)j->sel_types, types);
- }
- l = (struct objc_list*)sarray_get_safe (__objc_selector_array, i);
- }
- else
- {
- __objc_selector_max_index += 1;
- i = soffset_encode(__objc_selector_max_index);
- if (orig)
- j = orig;
- else
- j = objc_malloc (sizeof (struct objc_selector));
-
- j->sel_id = (void*)i;
- /* Can we use the pointer or must copy types? Don't copy if NULL */
- if ((is_const) || (types == 0))
- j->sel_types = (const char*)types;
- else {
- j->sel_types = (char *) objc_malloc(strlen(types)+1);
- strcpy((char *)j->sel_types, types);
- }
- l = 0;
- }
-
- DEBUG_PRINTF ("Record selector %s[%s] as: %ld\n", name, types,
- soffset_decode (i));
-
- {
- int is_new = (l == 0);
- const char *new_name;
-
- /* Can we use the pointer or must copy name? Don't copy if NULL */
- if ((is_const) || (name == 0))
- new_name = name;
- else {
- new_name = (char *) objc_malloc(strlen(name)+1);
- strcpy((char *)new_name, name);
- }
-
- l = list_cons ((void*)j, l);
- sarray_at_put_safe (__objc_selector_names, i, (void *) new_name);
- sarray_at_put_safe (__objc_selector_array, i, (void *) l);
- if (is_new)
- hash_add (&__objc_selector_hash, (void *) new_name, (void *) i);
- }
-
- sarray_realloc(__objc_uninstalled_dtable, __objc_selector_max_index+1);
-
- return (SEL) j;
-}
-
-SEL
-sel_register_name (const char *name)
-{
- SEL ret;
-
- objc_mutex_lock(__objc_runtime_mutex);
- /* Assume that name is not constant static memory and needs to be
- copied before put into a runtime structure. is_const == NO */
- ret = __sel_register_typed_name (name, 0, 0, NO);
- objc_mutex_unlock(__objc_runtime_mutex);
-
- return ret;
-}
-
-SEL
-sel_register_typed_name (const char *name, const char *type)
-{
- SEL ret;
-
- objc_mutex_lock(__objc_runtime_mutex);
- /* Assume that name and type are not constant static memory and need to
- be copied before put into a runtime structure. is_const == NO */
- ret = __sel_register_typed_name (name, type, 0, NO);
- objc_mutex_unlock(__objc_runtime_mutex);
-
- return ret;
-}
-
diff --git a/gcc/objc/sendmsg.c b/gcc/objc/sendmsg.c
deleted file mode 100644
index f0d3957f3d8..00000000000
--- a/gcc/objc/sendmsg.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/* GNU Objective C Runtime message lookup
- Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- Contributed by Kresten Krab Thorup
-
-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 files compiled with
- GCC to produce an executable, this does not 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 "runtime.h"
-#include "sarray.h"
-#include "encoding.h"
-#include "runtime-info.h"
-
-/* this is how we hack STRUCT_VALUE to be 1 or 0 */
-#define gen_rtx(args...) 1
-#define gen_rtx_MEM(args...) 1
-#define rtx int
-
-#if !defined(STRUCT_VALUE) || STRUCT_VALUE == 0
-#define INVISIBLE_STRUCT_RETURN 1
-#else
-#define INVISIBLE_STRUCT_RETURN 0
-#endif
-
-/* The uninstalled dispatch table */
-struct sarray* __objc_uninstalled_dtable = 0; /* !T:MUTEX */
-
-/* Send +initialize to class */
-static void __objc_send_initialize(Class);
-
-static void __objc_install_dispatch_table_for_class (Class);
-
-/* Forward declare some functions */
-static void __objc_init_install_dtable(id, SEL);
-
-/* Various forwarding functions that are used based upon the
- return type for the selector.
- __objc_block_forward for structures.
- __objc_double_forward for floats/doubles.
- __objc_word_forward for pointers or types that fit in registers.
- */
-static double __objc_double_forward(id, SEL, ...);
-static id __objc_word_forward(id, SEL, ...);
-typedef struct { id many[8]; } __big;
-#if INVISIBLE_STRUCT_RETURN
-static __big
-#else
-static id
-#endif
-__objc_block_forward(id, SEL, ...);
-static Method_t search_for_method_in_hierarchy (Class class, SEL sel);
-Method_t search_for_method_in_list(MethodList_t list, SEL op);
-id nil_method(id, SEL, ...);
-
-/* Given a selector, return the proper forwarding implementation. */
-__inline__
-IMP
-__objc_get_forward_imp (SEL sel)
-{
- const char *t = sel->sel_types;
-
- if (t && (*t == '[' || *t == '(' || *t == '{')
-#ifdef OBJC_MAX_STRUCT_BY_VALUE
- && objc_sizeof_type(t) > OBJC_MAX_STRUCT_BY_VALUE
-#endif
- )
- return (IMP)__objc_block_forward;
- else if (t && (*t == 'f' || *t == 'd'))
- return (IMP)__objc_double_forward;
- else
- return (IMP)__objc_word_forward;
-}
-
-/* Given a class and selector, return the selector's implementation. */
-__inline__
-IMP
-get_imp (Class class, SEL sel)
-{
- void* res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
- if (res == 0)
- {
- /* Not a valid method */
- if(class->dtable == __objc_uninstalled_dtable)
- {
- /* The dispatch table needs to be installed. */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (class);
- objc_mutex_unlock(__objc_runtime_mutex);
- /* Call ourselves with the installed dispatch table
- and get the real method */
- res = get_imp(class, sel);
- }
- else
- {
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Return the forwarding implementation. */
- res = __objc_get_forward_imp(sel);
- }
- }
- return res;
-}
-
-/* Query if an object can respond to a selector, returns YES if the
-object implements the selector otherwise NO. Does not check if the
-method can be forwarded. */
-__inline__
-BOOL
-__objc_responds_to (id object, SEL sel)
-{
- void* res;
-
- /* Install dispatch table if need be */
- if (object->class_pointer->dtable == __objc_uninstalled_dtable)
- {
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_install_dispatch_table_for_class (object->class_pointer);
- objc_mutex_unlock(__objc_runtime_mutex);
- }
-
- /* Get the method from the dispatch table */
- res = sarray_get_safe (object->class_pointer->dtable, (size_t) sel->sel_id);
- return (res != 0);
-}
-
-/* This is the lookup function. All entries in the table are either a
- valid method *or* zero. If zero then either the dispatch table
- needs to be installed or it doesn't exist and forwarding is attempted. */
-__inline__
-IMP
-objc_msg_lookup(id receiver, SEL op)
-{
- IMP result;
- if(receiver)
- {
- result = sarray_get_safe (receiver->class_pointer->dtable,
- (sidx)op->sel_id);
- if (result == 0)
- {
- /* Not a valid method */
- if(receiver->class_pointer->dtable == __objc_uninstalled_dtable)
- {
- /* The dispatch table needs to be installed.
- This happens on the very first method call to the class. */
- __objc_init_install_dtable(receiver, op);
-
- /* Get real method for this in newly installed dtable */
- result = get_imp(receiver->class_pointer, op);
- }
- else
- {
- /* The dispatch table has been installed so the
- method just doesn't exist for the class.
- Attempt to forward the method. */
- result = __objc_get_forward_imp(op);
- }
- }
- return result;
- }
- else
- return nil_method;
-}
-
-IMP
-objc_msg_lookup_super (Super_t super, SEL sel)
-{
- if (super->self)
- return get_imp (super->class, sel);
- else
- return nil_method;
-}
-
-int method_get_sizeof_arguments (Method*);
-
-retval_t
-objc_msg_sendv(id object, SEL op, arglist_t arg_frame)
-{
- Method* m = class_get_instance_method(object->class_pointer, op);
- const char *type;
- *((id*)method_get_first_argument (m, arg_frame, &type)) = object;
- *((SEL*)method_get_next_argument (arg_frame, &type)) = op;
- return __builtin_apply((apply_t)m->method_imp,
- arg_frame,
- method_get_sizeof_arguments (m));
-}
-
-void
-__objc_init_dispatch_tables()
-{
- __objc_uninstalled_dtable
- = sarray_new(200, 0);
-}
-
-/* This function is called by objc_msg_lookup when the
- dispatch table needs to be installed; thus it is called once
- for each class, namely when the very first message is sent to it. */
-static void
-__objc_init_install_dtable(id receiver, SEL op)
-{
- /* This may happen, if the programmer has taken the address of a
- method before the dtable was initialized... too bad for him! */
- if(receiver->class_pointer->dtable != __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- if(CLS_ISCLASS(receiver->class_pointer))
- {
- /* receiver is an ordinary object */
- assert(CLS_ISCLASS(receiver->class_pointer));
-
- /* install instance methods table */
- __objc_install_dispatch_table_for_class (receiver->class_pointer);
-
- /* call +initialize -- this will in turn install the factory
- dispatch table if not already done :-) */
- __objc_send_initialize(receiver->class_pointer);
- }
- else
- {
- /* receiver is a class object */
- assert(CLS_ISCLASS((Class)receiver));
- assert(CLS_ISMETA(receiver->class_pointer));
-
- /* Install real dtable for factory methods */
- __objc_install_dispatch_table_for_class (receiver->class_pointer);
-
- if (strcmp (sel_get_name (op), "initialize"))
- __objc_send_initialize((Class)receiver);
- else
- CLS_SETINITIALIZED((Class)receiver);
- }
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Install dummy table for class which causes the first message to
- that class (or instances hereof) to be initialized properly */
-void
-__objc_install_premature_dtable(Class class)
-{
- assert(__objc_uninstalled_dtable);
- class->dtable = __objc_uninstalled_dtable;
-}
-
-/* Send +initialize to class if not already done */
-static void
-__objc_send_initialize(Class class)
-{
- /* This *must* be a class object */
- assert(CLS_ISCLASS(class));
- assert(!CLS_ISMETA(class));
-
- if (!CLS_ISINITIALIZED(class))
- {
- CLS_SETINITIALIZED(class);
- CLS_SETINITIALIZED(class->class_pointer);
-
- if(class->super_class)
- __objc_send_initialize(class->super_class);
-
- {
- SEL op = sel_register_name ("initialize");
- Class tmpclass = class;
- IMP imp = 0;
-
- while (!imp && tmpclass) {
- MethodList_t method_list = tmpclass->class_pointer->methods;
-
- while(!imp && method_list) {
- int i;
- Method_t method;
-
- for (i=0;i<method_list->method_count;i++) {
- method = &(method_list->method_list[i]);
- if (method->method_name
- && method->method_name->sel_id == op->sel_id) {
- imp = method->method_imp;
- break;
- }
- }
-
- method_list = method_list->method_next;
-
- }
-
- tmpclass = tmpclass->super_class;
- }
- if (imp)
- (*imp)((id)class, op);
-
- }
- }
-}
-
-/* Walk on the methods list of class and install the methods in the reverse
- order of the lists. Since methods added by categories are before the methods
- of class in the methods list, this allows categories to substitute methods
- declared in class. However if more than one category replaces the same
- method nothing is guaranteed about what method will be used.
- Assumes that __objc_runtime_mutex is locked down. */
-static void
-__objc_install_methods_in_dtable (Class class, MethodList_t method_list)
-{
- int i;
-
- if (!method_list)
- return;
-
- if (method_list->method_next)
- __objc_install_methods_in_dtable (class, method_list->method_next);
-
- for (i = 0; i < method_list->method_count; i++)
- {
- Method_t method = &(method_list->method_list[i]);
- sarray_at_put_safe (class->dtable,
- (sidx) method->method_name->sel_id,
- method->method_imp);
- }
-}
-
-/* Assumes that __objc_runtime_mutex is locked down. */
-static void
-__objc_install_dispatch_table_for_class (Class class)
-{
- Class super;
-
- /* If the class has not yet had it's class links resolved, we must
- re-compute all class links */
- if(!CLS_ISRESOLV(class))
- __objc_resolve_class_links();
-
- super = class->super_class;
-
- if (super != 0 && (super->dtable == __objc_uninstalled_dtable))
- __objc_install_dispatch_table_for_class (super);
-
- /* Allocate dtable if necessary */
- if (super == 0)
- {
- objc_mutex_lock(__objc_runtime_mutex);
- class->dtable = sarray_new (__objc_selector_max_index, 0);
- objc_mutex_unlock(__objc_runtime_mutex);
- }
- else
- class->dtable = sarray_lazy_copy (super->dtable);
-
- __objc_install_methods_in_dtable (class, class->methods);
-}
-
-void
-__objc_update_dispatch_table_for_class (Class class)
-{
- Class next;
- struct sarray *arr;
-
- /* not yet installed -- skip it */
- if (class->dtable == __objc_uninstalled_dtable)
- return;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- arr = class->dtable;
- __objc_install_premature_dtable (class); /* someone might require it... */
- sarray_free (arr); /* release memory */
-
- /* could have been lazy... */
- __objc_install_dispatch_table_for_class (class);
-
- if (class->subclass_list) /* Traverse subclasses */
- for (next = class->subclass_list; next; next = next->sibling_class)
- __objc_update_dispatch_table_for_class (next);
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-
-/* This function adds a method list to a class. This function is
- typically called by another function specific to the run-time. As
- such this function does not worry about thread safe issues.
-
- This one is only called for categories. Class objects have their
- methods installed right away, and their selectors are made into
- SEL's by the function __objc_register_selectors_from_class. */
-void
-class_add_method_list (Class class, MethodList_t list)
-{
- int i;
-
- /* Passing of a linked list is not allowed. Do multiple calls. */
- assert (!list->method_next);
-
- /* Check for duplicates. */
- for (i = 0; i < list->method_count; ++i)
- {
- Method_t method = &list->method_list[i];
-
- if (method->method_name) /* Sometimes these are NULL */
- {
- /* This is where selector names are transmogrified to SEL's */
- method->method_name =
- sel_register_typed_name ((const char*)method->method_name,
- method->method_types);
- }
- }
-
- /* Add the methods to the class's method list. */
- list->method_next = class->methods;
- class->methods = list;
-
- /* Update the dispatch table of class */
- __objc_update_dispatch_table_for_class (class);
-}
-
-Method_t
-class_get_instance_method(Class class, SEL op)
-{
- return search_for_method_in_hierarchy(class, op);
-}
-
-Method_t
-class_get_class_method(MetaClass class, SEL op)
-{
- return search_for_method_in_hierarchy(class, op);
-}
-
-
-/* Search for a method starting from the current class up its hierarchy.
- Return a pointer to the method's method structure if found. NULL
- otherwise. */
-
-static Method_t
-search_for_method_in_hierarchy (Class cls, SEL sel)
-{
- Method_t method = NULL;
- Class class;
-
- if (! sel_is_mapped (sel))
- return NULL;
-
- /* Scan the method list of the class. If the method isn't found in the
- list then step to its super class. */
- for (class = cls; ((! method) && class); class = class->super_class)
- method = search_for_method_in_list (class->methods, sel);
-
- return method;
-}
-
-
-
-/* Given a linked list of method and a method's name. Search for the named
- method's method structure. Return a pointer to the method's method
- structure if found. NULL otherwise. */
-Method_t
-search_for_method_in_list (MethodList_t list, SEL op)
-{
- MethodList_t method_list = list;
-
- if (! sel_is_mapped (op))
- return NULL;
-
- /* If not found then we'll search the list. */
- while (method_list)
- {
- int i;
-
- /* Search the method list. */
- for (i = 0; i < method_list->method_count; ++i)
- {
- Method_t method = &method_list->method_list[i];
-
- if (method->method_name)
- if (method->method_name->sel_id == op->sel_id)
- return method;
- }
-
- /* The method wasn't found. Follow the link to the next list of
- methods. */
- method_list = method_list->method_next;
- }
-
- return NULL;
-}
-
-static retval_t __objc_forward (id object, SEL sel, arglist_t args);
-
-/* Forwarding pointers/integers through the normal registers */
-static id
-__objc_word_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- if (res)
- __builtin_return (res);
- else
- return res;
-}
-
-/* Specific routine for forwarding floats/double because of
- architectural differences on some processors. i386s for
- example which uses a floating point stack versus general
- registers for floating point numbers. This forward routine
- makes sure that GCC restores the proper return values */
-static double
-__objc_double_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- __builtin_return (res);
-}
-
-#if INVISIBLE_STRUCT_RETURN
-static __big
-#else
-static id
-#endif
-__objc_block_forward (id rcv, SEL op, ...)
-{
- void *args, *res;
-
- args = __builtin_apply_args ();
- res = __objc_forward (rcv, op, args);
- if (res)
- __builtin_return (res);
- else
-#if INVISIBLE_STRUCT_RETURN
- return (__big) {{0, 0, 0, 0, 0, 0, 0, 0}};
-#else
- return nil;
-#endif
-}
-
-
-/* This function is installed in the dispatch table for all methods which are
- not implemented. Thus, it is called when a selector is not recognized. */
-static retval_t
-__objc_forward (id object, SEL sel, arglist_t args)
-{
- IMP imp;
- static SEL frwd_sel = 0; /* !T:SAFE2 */
- SEL err_sel;
-
- /* first try if the object understands forward:: */
- if (!frwd_sel)
- frwd_sel = sel_get_any_uid("forward::");
-
- if (__objc_responds_to (object, frwd_sel))
- {
- imp = get_imp(object->class_pointer, frwd_sel);
- return (*imp)(object, frwd_sel, sel, args);
- }
-
- /* If the object recognizes the doesNotRecognize: method then we're going
- to send it. */
- err_sel = sel_get_any_uid ("doesNotRecognize:");
- if (__objc_responds_to (object, err_sel))
- {
- imp = get_imp (object->class_pointer, err_sel);
- return (*imp) (object, err_sel, sel);
- }
-
- /* The object doesn't recognize the method. Check for responding to
- error:. If it does then sent it. */
- {
- size_t strlen (const char*);
- char msg[256 + strlen ((const char*)sel_get_name (sel))
- + strlen ((const char*)object->class_pointer->name)];
-
- sprintf (msg, "(%s) %s does not recognize %s",
- (CLS_ISMETA(object->class_pointer)
- ? "class"
- : "instance" ),
- object->class_pointer->name, sel_get_name (sel));
-
- err_sel = sel_get_any_uid ("error:");
- if (__objc_responds_to (object, err_sel))
- {
- imp = get_imp (object->class_pointer, err_sel);
- return (*imp) (object, sel_get_any_uid ("error:"), msg);
- }
-
- /* The object doesn't respond to doesNotRecognize: or error:; Therefore,
- a default action is taken. */
- objc_error (object, OBJC_ERR_UNIMPLEMENTED, "%s\n", msg);
-
- return 0;
- }
-}
-
-void
-__objc_print_dtable_stats()
-{
- int total = 0;
-
- objc_mutex_lock(__objc_runtime_mutex);
-
- printf("memory usage: (%s)\n",
-#ifdef OBJC_SPARSE2
- "2-level sparse arrays"
-#else
- "3-level sparse arrays"
-#endif
- );
-
- printf("arrays: %d = %ld bytes\n", narrays,
- (long)narrays*sizeof(struct sarray));
- total += narrays*sizeof(struct sarray);
- printf("buckets: %d = %ld bytes\n", nbuckets,
- (long)nbuckets*sizeof(struct sbucket));
- total += nbuckets*sizeof(struct sbucket);
-
- printf("idxtables: %d = %ld bytes\n", idxsize, (long)idxsize*sizeof(void*));
- total += idxsize*sizeof(void*);
- printf("-----------------------------------\n");
- printf("total: %d bytes\n", total);
- printf("===================================\n");
-
- objc_mutex_unlock(__objc_runtime_mutex);
-}
-
-/* Returns the uninstalled dispatch table indicator.
- If a class' dispatch table points to __objc_uninstalled_dtable
- then that means it needs its dispatch table to be installed. */
-__inline__
-struct sarray*
-objc_get_uninstalled_dtable()
-{
- return __objc_uninstalled_dtable;
-}
diff --git a/gcc/objc/thr-dce.c b/gcc/objc/thr-dce.c
deleted file mode 100644
index 0f7063b7e83..00000000000
--- a/gcc/objc/thr-dce.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <pthread.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_keycreate(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* Destroy the thread storage key */
- /* Not implemented yet */
- /* return pthread_key_delete(&_objc_thread_storage); */
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if (pthread_create(&new_thread_handle, pthread_attr_default,
- (void *)func, arg) == 0)
- {
- /* ??? May not work! (64bit) */
- thread_id = *(objc_thread_t *)&new_thread_handle;
- pthread_detach(&new_thread_handle); /* Fully detach thread. */
- }
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- }
-
- /* Change the priority. */
- if (pthread_setprio(pthread_self(), sys_priority) >= 0)
- return 0;
- else
- /* Failed */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- if ((sys_priority = pthread_getprio(pthread_self())) >= 0) {
- if (sys_priority >= PRI_FG_MIN_NP && sys_priority <= PRI_FG_MAX_NP)
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- if (sys_priority >= PRI_BG_MIN_NP && sys_priority <= PRI_BG_MAX_NP)
- return OBJC_THREAD_BACKGROUND_PRIORITY;
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Failed */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- pthread_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return (objc_thread_t) pthread_getunique_np (&self);
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)),
- pthread_mutexattr_default))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
- return -1;
- else
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend))) != 1)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
- return -1;
- else
- return 0;
- */
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
- (pthread_mutex_t *)(&(mutex->backend)));
- */
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-decosf1.c b/gcc/objc/thr-decosf1.c
deleted file mode 100644
index 0f7063b7e83..00000000000
--- a/gcc/objc/thr-decosf1.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <pthread.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_keycreate(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* Destroy the thread storage key */
- /* Not implemented yet */
- /* return pthread_key_delete(&_objc_thread_storage); */
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if (pthread_create(&new_thread_handle, pthread_attr_default,
- (void *)func, arg) == 0)
- {
- /* ??? May not work! (64bit) */
- thread_id = *(objc_thread_t *)&new_thread_handle;
- pthread_detach(&new_thread_handle); /* Fully detach thread. */
- }
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
- break;
- }
-
- /* Change the priority. */
- if (pthread_setprio(pthread_self(), sys_priority) >= 0)
- return 0;
- else
- /* Failed */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- if ((sys_priority = pthread_getprio(pthread_self())) >= 0) {
- if (sys_priority >= PRI_FG_MIN_NP && sys_priority <= PRI_FG_MAX_NP)
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- if (sys_priority >= PRI_BG_MIN_NP && sys_priority <= PRI_BG_MAX_NP)
- return OBJC_THREAD_BACKGROUND_PRIORITY;
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Failed */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- pthread_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return (objc_thread_t) pthread_getunique_np (&self);
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)),
- pthread_mutexattr_default))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
- return -1;
- else
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend))) != 1)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
- return -1;
- else
- return 0;
- */
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
- (pthread_mutex_t *)(&(mutex->backend)));
- */
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-
- /*
- return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
- */
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-irix.c b/gcc/objc/thr-irix.c
deleted file mode 100644
index 528a3e3a434..00000000000
--- a/gcc/objc/thr-irix.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* GNU Objective C Runtime Thread Interface - SGI IRIX Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <stdlib.h>
-#include <sys/types.h>
-#include <sys/sysmp.h>
-#include <sys/prctl.h>
-#include <ulocks.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static void * __objc_shared_arena_handle = NULL;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Name of IRIX arena. */
- char arena_name[64];
-
- DEBUG_PRINTF("__objc_init_thread_system\n");
-
- /* Construct a temporary name for arena. */
- sprintf(arena_name, "/usr/tmp/objc_%05u", (unsigned)getpid());
-
- /* Up to 256 threads. Arena only for threads. */
- usconfig(CONF_INITUSERS, 256);
- usconfig(CONF_ARENATYPE, US_SHAREDONLY);
-
- /* Initialize the arena */
- if (!(__objc_shared_arena_handle = usinit(arena_name)))
- /* Failed */
- return -1;
-
- return 0;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- int sys_id;
-
- if ((sys_id = sproc((void *)func, PR_SALL, arg)) >= 0)
- thread_id = (objc_thread_t)sys_id;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- /* Not implemented yet */
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- sginap(0);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* IRIX only has exit. */
- exit(__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- /* Threads are processes. */
- return (objc_thread_t)get_pid();
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- *((void **)&PRDA->usr_prda) = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return *((void **)&PRDA->usr_prda);
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (!( (ulock_t)(mutex->backend) = usnewlock(__objc_shared_arena_handle) ))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- usfreelock((ulock_t)(mutex->backend), __objc_shared_arena_handle);
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- if (ussetlock((ulock_t)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (ustestlock((ulock_t)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- usunsetlock((ulock_t)(mutex->backend));
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-mach.c b/gcc/objc/thr-mach.c
deleted file mode 100644
index 44af0c1e286..00000000000
--- a/gcc/objc/thr-mach.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
- Modified for Mach threads by Bill Bumgarner <bbum@friday.com>
- Condition functions added by Mircea Oancea <mircea@first.elcom.pub.ro>
-
-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 files compiled with
- GCC to produce an executable, this does not 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 <mach/mach.h>
-#include <mach/cthreads.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/*
- Obtain the maximum thread priority that can set for t. Under the
- mach threading model, it is possible for the developer to adjust the
- maximum priority downward only-- cannot be raised without superuser
- privileges. Once lowered, it cannot be raised.
- */
-static int __mach_get_max_thread_priority(cthread_t t, int *base)
-{
- thread_t threadP;
- kern_return_t error;
- struct thread_sched_info info;
- unsigned int info_count=THREAD_SCHED_INFO_COUNT;
-
- if (t == NULL)
- return -1;
-
- threadP = cthread_thread(t); /* get thread underlying */
-
- error=thread_info(threadP, THREAD_SCHED_INFO,
- (thread_info_t)&info, &info_count);
-
- if (error != KERN_SUCCESS)
- return -1;
-
- if (base != NULL)
- *base = info.base_priority;
-
- return info.max_priority;
-}
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- return 0;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- cthread_t new_thread_handle;
-
- /* create thread */
- new_thread_handle = cthread_fork((cthread_fn_t)func, arg);
-
- if(new_thread_handle)
- {
- /* this is not terribly portable */
- thread_id = *(objc_thread_t *)&new_thread_handle;
- cthread_detach(new_thread_handle);
- }
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- objc_thread_t *t = objc_thread_id();
- cthread_t cT = (cthread_t) t;
- int maxPriority = __mach_get_max_thread_priority(cT, NULL);
- int sys_priority = 0;
-
- if (maxPriority == -1)
- return -1;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = maxPriority;
- break;
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = (maxPriority * 2) / 3;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = maxPriority / 3;
- break;
- default:
- return -1;
- }
-
- if (sys_priority == 0)
- return -1;
-
- /* Change the priority */
- if (cthread_priority(cT, sys_priority, 0) == KERN_SUCCESS)
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- objc_thread_t *t = objc_thread_id();
- cthread_t cT = (cthread_t) t; /* see objc_thread_id() */
- int basePriority;
- int maxPriority;
- int sys_priority = 0;
-
- int interactiveT, backgroundT, lowT; /* thresholds */
-
- maxPriority = __mach_get_max_thread_priority(cT, &basePriority);
-
- if(maxPriority == -1)
- return -1;
-
- if (basePriority > ( (maxPriority * 2) / 3))
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-
- if (basePriority > ( maxPriority / 3))
- return OBJC_THREAD_BACKGROUND_PRIORITY;
-
- return OBJC_THREAD_LOW_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- cthread_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- cthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- cthread_t self = cthread_self();
-
- return *(objc_thread_t *)&self;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- cthread_set_data(cthread_self(), (any_t) value);
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return (void *) cthread_data(cthread_self());
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- int err = 0;
- mutex->backend = objc_malloc(sizeof(struct mutex));
-
- err = mutex_init((mutex_t)(mutex->backend));
-
- if (err != 0)
- {
- objc_free(mutex->backend);
- return -1;
- }
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- mutex_clear((mutex_t)(mutex->backend));
-
- objc_free(mutex->backend);
- mutex->backend = NULL;
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- mutex_lock((mutex_t)(mutex->backend));
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (mutex_try_lock((mutex_t)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- mutex_unlock((mutex_t)(mutex->backend));
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- condition->backend = objc_malloc(sizeof(struct condition));
- condition_init((condition_t)(condition->backend));
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- condition_clear((condition_t)(condition->backend));
- objc_free(condition->backend);
- condition->backend = NULL;
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- condition_wait((condition_t)(condition->backend),
- (mutex_t)(mutex->backend));
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- condition_broadcast((condition_t)(condition->backend));
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- condition_signal((condition_t)(condition->backend));
- return 0;
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-os2.c b/gcc/objc/thr-os2.c
deleted file mode 100644
index a0d7d436613..00000000000
--- a/gcc/objc/thr-os2.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/* GNU Objective C Runtime Thread Interface - OS/2 emx Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Thomas Baier (baier@ci.tuwien.ac.at)
-
-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 files compiled with
- GCC to produce an executable, this does not 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 <objc/thr.h>
-#include "runtime.h"
-
-#define INCL_DOSSEMAPHORES
-#define INCL_DOSPROCESS
-
-/*
- * conflicts with objc.h: SEL, BOOL, id
- * solution: prefixing those with _OS2_ before including <os2.h>
- */
-#define SEL _OS2_SEL
-#define BOOL _OS2_BOOL
-#define id _OS2_id
-#include <os2.h>
-#undef id
-#undef SEL
-#undef BOOL
-
-#include <stdlib.h>
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- return 0;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- int thread_id = 0;
-
- if ((thread_id = _beginthread (func,NULL,32768,arg)) < 0)
- thread_id = 0;
-
- return (objc_thread_t)thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- ULONG sys_class = 0;
- ULONG sys_priority = 0;
-
- /* OBJC_THREAD_INTERACTIVE_PRIORITY -> PRTYC_FOREGROUNDSERVER
- * OBJC_THREAD_BACKGROUND_PRIORITY -> PRTYC_REGULAR
- * OBJC_THREAD_LOW_PRIORITY -> PRTYC_IDLETIME */
-
- switch (priority) {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_class = PRTYC_REGULAR;
- sys_priority = 10;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_class = PRTYC_IDLETIME;
- sys_priority = 25;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_class = PRTYC_IDLETIME;
- sys_priority = 0;
- break;
- }
-
- /* Change priority */
- if (!DosSetPriority (PRTYS_THREAD,sys_class,sys_priority,*_threadid))
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- PTIB ptib;
- PPIB ppib;
-
- /* get information about current thread */
- DosGetInfoBlocks (&ptib,&ppib);
-
- switch (ptib->tib_ptib2->tib2_ulpri)
- {
- case PRTYC_IDLETIME:
- case PRTYC_REGULAR:
- case PRTYC_TIMECRITICAL:
- case PRTYC_FOREGROUNDSERVER:
- default:
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- }
-
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- DosSleep (0);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* terminate the thread, NEVER use DosExit () */
- _endthread ();
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- return (objc_thread_t) *_threadid;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- *_threadstore () = value;
-
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return *_threadstore ();
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (DosCreateMutexSem (NULL, (HMTX)(&(mutex->backend)),0L,0) > 0)
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- DosCloseMutexSem ((HMTX)(mutex->backend));
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- if (DosRequestMutexSem ((HMTX)(mutex->backend),-1L) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (DosRequestMutexSem ((HMTX)(mutex->backend),0L) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- if (DosReleaseMutexSem((HMTX)(mutex->backend)) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-posix.c b/gcc/objc/thr-posix.c
deleted file mode 100644
index 5b40f711be8..00000000000
--- a/gcc/objc/thr-posix.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* GNU Objective C Runtime Thread Interface for POSIX compliant threads
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
- Modified for Linux/Pthreads by Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de)
-
-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 files compiled with
- GCC to produce an executable, this does not 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 <objc/thr.h>
-#include "runtime.h"
-#include <pthread.h>
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_key_create(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
- thread_id = *(objc_thread_t *)&new_thread_handle;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- sched_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return *(objc_thread_t *)&self;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return pthread_getspecific(_objc_thread_storage);
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- mutex->backend = objc_malloc(sizeof(pthread_mutex_t));
-
- if (pthread_mutex_init((pthread_mutex_t *)mutex->backend, NULL))
- {
- objc_free(mutex->backend);
- mutex->backend = NULL;
- return -1;
- }
-
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
- return -1;
-
- objc_free(mutex->backend);
- mutex->backend = NULL;
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)mutex->backend);
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- return pthread_mutex_trylock((pthread_mutex_t *)mutex->backend);
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)mutex->backend);
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- condition->backend = objc_malloc(sizeof(pthread_cond_t));
-
- if (pthread_cond_init((pthread_cond_t *)condition->backend, NULL))
- {
- objc_free(condition->backend);
- condition->backend = NULL;
- return -1;
- }
-
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- if (pthread_cond_destroy((pthread_cond_t *)condition->backend))
- return -1;
-
- objc_free(condition->backend);
- condition->backend = NULL;
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return pthread_cond_wait((pthread_cond_t *)condition->backend,
- (pthread_mutex_t *)mutex->backend);
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return pthread_cond_broadcast((pthread_cond_t *)condition->backend);
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return pthread_cond_signal((pthread_cond_t *)condition->backend);
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-pthreads.c b/gcc/objc/thr-pthreads.c
deleted file mode 100644
index 2efdd15bc54..00000000000
--- a/gcc/objc/thr-pthreads.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation for PCThreads under GNU/Linux.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Scott Christley <scottc@net-community.com>
- Condition functions added by: Mircea Oancea <mircea@first.elcom.pub.ro>
-
-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 files compiled with
- GCC to produce an executable, this does not 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 <pcthread.h>
-#include <objc/thr.h>
-#include "runtime.h"
-
-/* Key structure for maintaining thread specific storage */
-static pthread_key_t _objc_thread_storage;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- return pthread_key_create(&_objc_thread_storage, NULL);
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* Destroy the thread storage key */
- /* Not implemented yet */
- /* return pthread_key_delete(&_objc_thread_storage); */
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- pthread_t new_thread_handle;
-
- if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
- thread_id = *(objc_thread_t *)&new_thread_handle;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* Not implemented yet */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- /* Not implemented yet */
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- pthread_yield(NULL);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- pthread_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- pthread_t self = pthread_self();
-
- return *(objc_thread_t *)&self;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- return pthread_setspecific(_objc_thread_storage, value);
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)), NULL))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
- return -1;
- else
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- return pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
- (pthread_mutex_t *)(&(mutex->backend)));
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-single.c b/gcc/objc/thr-single.c
deleted file mode 100644
index b196677c6b6..00000000000
--- a/gcc/objc/thr-single.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <objc/thr.h>
-#include "runtime.h"
-
-/* Thread local storage for a single thread */
-static void *thread_local_storage = NULL;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- /* No thread support available */
- return NULL;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- return;
-}
-
-/* Terminate the current thread. */
-int
-__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
-__objc_thread_id(void)
-{
- /* No thread support, use 1. */
- return (objc_thread_t)1;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- thread_local_storage = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return thread_local_storage;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__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
-__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
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return 0;
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-solaris.c b/gcc/objc/thr-solaris.c
deleted file mode 100644
index 90351b43cf6..00000000000
--- a/gcc/objc/thr-solaris.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
- Conditions added by Mircea Oancea (mircea@first.elcom.pub.ro)
-
-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 files compiled with
- GCC to produce an executable, this does not 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 <objc/thr.h>
-#include "runtime.h"
-
-#include <thread.h>
-#include <synch.h>
-#include <errno.h>
-
-/* Key structure for maintaining thread specific storage */
-static thread_key_t __objc_thread_data_key;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- if (thr_keycreate(&__objc_thread_data_key, NULL) == 0)
- return 0;
- else
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- objc_thread_t thread_id;
- thread_t new_thread_id = 0;
-
- if (thr_create(NULL, 0, (void *)func, arg,
- THR_DETACHED | THR_NEW_LWP,
- &new_thread_id) == 0)
- thread_id = *(objc_thread_t *)&new_thread_id;
- else
- thread_id = NULL;
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = 300;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = 200;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = 1000;
- break;
- }
-
- /* Change priority */
- if (thr_setprio(thr_self(), sys_priority) == 0)
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- if (thr_getprio(thr_self(), &sys_priority) == 0)
- {
- if (sys_priority >= 250)
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
- else if (sys_priority >= 150)
- return OBJC_THREAD_BACKGROUND_PRIORITY;
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Couldn't get priority. */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- thr_yield();
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- thr_exit(&__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- return (objc_thread_t)thr_self();
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- if (thr_setspecific(__objc_thread_data_key, value) == 0)
- return 0;
- else
- return -1;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- void *value = NULL;
-
- if (thr_getspecific(__objc_thread_data_key, &value) == 0)
- return value;
-
- return NULL;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if (mutex_init( (mutex_t *)(&(mutex->backend)), USYNC_THREAD, 0))
- return -1;
- else
- return 0;
-}
-
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- mutex_destroy((mutex_t *)(&(mutex->backend)));
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- if (mutex_lock((mutex_t *)(&(mutex->backend))) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- if (mutex_trylock((mutex_t *)(&(mutex->backend))) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- if (mutex_unlock((mutex_t *)(&(mutex->backend))) != 0)
- return -1;
- else
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- return cond_init((cond_t *)(&(condition->backend)), USYNC_THREAD, NULL);
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return cond_destroy((cond_t *)(&(condition->backend)));
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return cond_wait((cond_t *)(&(condition->backend)),
- (mutex_t *)(&(mutex->backend)));
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return cond_broadcast((cond_t *)(&(condition->backend)));
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return cond_signal((cond_t *)(&(condition->backend)));
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-vxworks.c b/gcc/objc/thr-vxworks.c
deleted file mode 100644
index b196677c6b6..00000000000
--- a/gcc/objc/thr-vxworks.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* GNU Objective C Runtime Thread Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <objc/thr.h>
-#include "runtime.h"
-
-/* Thread local storage for a single thread */
-static void *thread_local_storage = NULL;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- /* No thread support available */
- return NULL;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- return;
-}
-
-/* Terminate the current thread. */
-int
-__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
-__objc_thread_id(void)
-{
- /* No thread support, use 1. */
- return (objc_thread_t)1;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- thread_local_storage = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return thread_local_storage;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__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
-__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
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- return 0;
-}
-
-/* End of File */
diff --git a/gcc/objc/thr-win32.c b/gcc/objc/thr-win32.c
deleted file mode 100644
index 8570ffd997e..00000000000
--- a/gcc/objc/thr-win32.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/* GNU Objective C Runtime Thread Interface - Win32 Implementation
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <objc/thr.h>
-#include "runtime.h"
-
-#ifndef __OBJC__
-#define __OBJC__
-#endif
-#include <windows.h>
-
-/* Key structure for maintaining thread specific storage */
-static DWORD __objc_data_tls = (DWORD)-1;
-
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__objc_init_thread_system(void)
-{
- /* Initialize the thread storage key */
- if ((__objc_data_tls = TlsAlloc()) != (DWORD)-1)
- return 0;
- else
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__objc_close_thread_system(void)
-{
- if (__objc_data_tls != (DWORD)-1)
- TlsFree(__objc_data_tls);
- return 0;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__objc_thread_detach(void (*func)(void *arg), void *arg)
-{
- DWORD thread_id = 0;
- HANDLE win32_handle;
-
- if (!(win32_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func,
- arg, 0, &thread_id)))
- thread_id = 0;
-
- return (objc_thread_t)thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-__objc_thread_set_priority(int priority)
-{
- int sys_priority = 0;
-
- switch (priority)
- {
- case OBJC_THREAD_INTERACTIVE_PRIORITY:
- sys_priority = THREAD_PRIORITY_NORMAL;
- break;
- default:
- case OBJC_THREAD_BACKGROUND_PRIORITY:
- sys_priority = THREAD_PRIORITY_BELOW_NORMAL;
- break;
- case OBJC_THREAD_LOW_PRIORITY:
- sys_priority = THREAD_PRIORITY_LOWEST;
- break;
- }
-
- /* Change priority */
- if (SetThreadPriority(GetCurrentThread(), sys_priority))
- return 0;
- else
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__objc_thread_get_priority(void)
-{
- int sys_priority;
-
- sys_priority = GetThreadPriority(GetCurrentThread());
-
- switch (sys_priority)
- {
- case THREAD_PRIORITY_HIGHEST:
- case THREAD_PRIORITY_TIME_CRITICAL:
- case THREAD_PRIORITY_ABOVE_NORMAL:
- case THREAD_PRIORITY_NORMAL:
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-
- default:
- case THREAD_PRIORITY_BELOW_NORMAL:
- return OBJC_THREAD_BACKGROUND_PRIORITY;
-
- case THREAD_PRIORITY_IDLE:
- case THREAD_PRIORITY_LOWEST:
- return OBJC_THREAD_LOW_PRIORITY;
- }
-
- /* Couldn't get priority. */
- return -1;
-}
-
-/* Yield our process time to another thread. */
-void
-__objc_thread_yield(void)
-{
- Sleep(0);
-}
-
-/* Terminate the current thread. */
-int
-__objc_thread_exit(void)
-{
- /* exit the thread */
- ExitThread(__objc_thread_exit_status);
-
- /* Failed if we reached here */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__objc_thread_id(void)
-{
- return (objc_thread_t)GetCurrentThreadId();
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__objc_thread_set_data(void *value)
-{
- if (TlsSetValue(__objc_data_tls, value))
- return 0;
- else
- return -1;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__objc_thread_get_data(void)
-{
- return TlsGetValue(__objc_data_tls); /* Return thread data. */
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__objc_mutex_allocate(objc_mutex_t mutex)
-{
- if ((mutex->backend = (void *)CreateMutex(NULL, 0, NULL)) == NULL)
- return -1;
- else
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__objc_mutex_deallocate(objc_mutex_t mutex)
-{
- CloseHandle((HANDLE)(mutex->backend));
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__objc_mutex_lock(objc_mutex_t mutex)
-{
- int status;
-
- status = WaitForSingleObject((HANDLE)(mutex->backend), INFINITE);
- if (status != WAIT_OBJECT_0 && status != WAIT_ABANDONED)
- return -1;
- else
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__objc_mutex_trylock(objc_mutex_t mutex)
-{
- int status;
-
- status = WaitForSingleObject((HANDLE)(mutex->backend), 0);
- if (status != WAIT_OBJECT_0 && status != WAIT_ABANDONED)
- return -1;
- else
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__objc_mutex_unlock(objc_mutex_t mutex)
-{
- if (ReleaseMutex((HANDLE)(mutex->backend)) == 0)
- return -1;
- else
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__objc_condition_allocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Deallocate a condition. */
-int
-__objc_condition_deallocate(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wait on the condition */
-int
-__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__objc_condition_broadcast(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__objc_condition_signal(objc_condition_t condition)
-{
- /* Unimplemented. */
- return -1;
-}
-
-/* End of File */
diff --git a/gcc/objc/thr.c b/gcc/objc/thr.c
deleted file mode 100644
index f1c957aaa15..00000000000
--- a/gcc/objc/thr.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/* GNU Objective C Runtime Thread Interface
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not 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 <stdlib.h>
-#include "runtime.h"
-
-/* Global exit status. */
-int __objc_thread_exit_status = 0;
-
-/* Flag which lets us know if we ever became multi threaded */
-int __objc_is_multi_threaded = 0;
-
-/* The hook function called when the runtime becomes multi threaded */
-objc_thread_callback _objc_became_multi_threaded = NULL;
-
-/*
- Use this to set the hook function that will be called when the
- runtime initially becomes multi threaded.
- The hook function is only called once, meaning only when the
- 2nd thread is spawned, not for each and every thread.
-
- It returns the previous hook function or NULL if there is none.
-
- A program outside of the runtime could set this to some function so
- it can be informed; for example, the GNUstep Base Library sets it
- so it can implement the NSBecomingMultiThreaded notification.
- */
-objc_thread_callback objc_set_thread_callback(objc_thread_callback func)
-{
- objc_thread_callback temp = _objc_became_multi_threaded;
- _objc_became_multi_threaded = func;
- return temp;
-}
-
-/*
- Private functions
-
- These functions are utilized by the frontend, but they are not
- considered part of the public interface.
- */
-
-/*
- First function called in a thread, starts everything else.
-
- This function is passed to the backend by objc_thread_detach
- as the starting function for a new thread.
- */
-struct __objc_thread_start_state
-{
- SEL selector;
- id object;
- id argument;
-};
-
-static volatile void
-__objc_thread_detach_function(struct __objc_thread_start_state *istate)
-{
- /* Valid state? */
- if (istate) {
- id (*imp)(id,SEL,id);
- SEL selector = istate->selector;
- id object = istate->object;
- id argument = istate->argument;
-
- /* Don't need anymore so free it */
- objc_free(istate);
-
- /* Clear out the thread local storage */
- objc_thread_set_data(NULL);
-
- /* Check to see if we just became multi threaded */
- if (!__objc_is_multi_threaded)
- {
- __objc_is_multi_threaded = 1;
-
- /* Call the hook function */
- if (_objc_became_multi_threaded != NULL)
- (*_objc_became_multi_threaded)();
- }
-
- /* Call the method */
- if ((imp = (id(*)(id, SEL, id))objc_msg_lookup(object, selector)))
- (*imp)(object, selector, argument);
- else
- objc_error(object, OBJC_ERR_UNIMPLEMENTED,
- "objc_thread_detach called with bad selector.\n");
- }
- else
- objc_error(nil, OBJC_ERR_BAD_STATE,
- "objc_thread_detach called with NULL state.\n");
-
- /* Exit the thread */
- objc_thread_exit();
-}
-
-/*
- Frontend functions
-
- These functions constitute the public interface to the Objective-C thread
- and mutex functionality.
- */
-
-/* Frontend thread functions */
-
-/*
- Detach a new thread of execution and return its id. Returns NULL if fails.
- Thread is started by sending message with selector to object. Message
- takes a single argument.
- */
-objc_thread_t
-objc_thread_detach(SEL selector, id object, id argument)
-{
- struct __objc_thread_start_state *istate;
- objc_thread_t thread_id = NULL;
-
- /* Allocate the state structure */
- if (!(istate = (struct __objc_thread_start_state *)
- objc_malloc(sizeof(*istate))))
- return NULL;
-
- /* Initialize the state structure */
- istate->selector = selector;
- istate->object = object;
- istate->argument = argument;
-
- /* lock access */
- objc_mutex_lock(__objc_runtime_mutex);
-
- /* Call the backend to spawn the thread */
- if ((thread_id = __objc_thread_detach((void *)__objc_thread_detach_function,
- istate)) == NULL)
- {
- /* failed! */
- objc_mutex_unlock(__objc_runtime_mutex);
- objc_free(istate);
- return NULL;
- }
-
- /* Increment our thread counter */
- __objc_runtime_threads_alive++;
- objc_mutex_unlock(__objc_runtime_mutex);
-
- return thread_id;
-}
-
-/* Set the current thread's priority. */
-int
-objc_thread_set_priority(int priority)
-{
- /* Call the backend */
- return __objc_thread_set_priority(priority);
-}
-
-/* Return the current thread's priority. */
-int
-objc_thread_get_priority(void)
-{
- /* Call the backend */
- return __objc_thread_get_priority();
-}
-
-/*
- Yield our process time to another thread. Any BUSY waiting that is done
- by a thread should use this function to make sure that other threads can
- make progress even on a lazy uniprocessor system.
- */
-void
-objc_thread_yield(void)
-{
- /* Call the backend */
- __objc_thread_yield();
-}
-
-/*
- Terminate the current tread. Doesn't return.
- Actually, if it failed returns -1.
- */
-int
-objc_thread_exit(void)
-{
- /* Decrement our counter of the number of threads alive */
- objc_mutex_lock(__objc_runtime_mutex);
- __objc_runtime_threads_alive--;
- objc_mutex_unlock(__objc_runtime_mutex);
-
- /* Call the backend to terminate the thread */
- return __objc_thread_exit();
-}
-
-/*
- Returns an integer value which uniquely describes a thread. Must not be
- NULL which is reserved as a marker for "no thread".
- */
-objc_thread_t
-objc_thread_id(void)
-{
- /* Call the backend */
- return __objc_thread_id();
-}
-
-/*
- Sets the thread's local storage pointer.
- Returns 0 if successful or -1 if failed.
- */
-int
-objc_thread_set_data(void *value)
-{
- /* Call the backend */
- return __objc_thread_set_data(value);
-}
-
-/*
- Returns the thread's local storage pointer. Returns NULL on failure.
- */
-void *
-objc_thread_get_data(void)
-{
- /* Call the backend */
- return __objc_thread_get_data();
-}
-
-/* Frontend mutex functions */
-
-/*
- Allocate a mutex. Return the mutex pointer if successful or NULL if the
- allocation failed for any reason.
- */
-objc_mutex_t
-objc_mutex_allocate(void)
-{
- objc_mutex_t mutex;
-
- /* Allocate the mutex structure */
- if (!(mutex = (objc_mutex_t)objc_malloc(sizeof(struct objc_mutex))))
- return NULL;
-
- /* Call backend to create the mutex */
- if (__objc_mutex_allocate(mutex))
- {
- /* failed! */
- objc_free(mutex);
- return NULL;
- }
-
- /* Initialize mutex */
- mutex->owner = NULL;
- mutex->depth = 0;
- return mutex;
-}
-
-/*
- Deallocate a mutex. Note that this includes an implicit mutex_lock to
- insure that no one else is using the lock. It is legal to deallocate
- a lock if we have a lock on it, but illegal to deallocate a lock held
- by anyone else.
- Returns the number of locks on the thread. (1 for deallocate).
- */
-int
-objc_mutex_deallocate(objc_mutex_t mutex)
-{
- int depth;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* Acquire lock on mutex */
- depth = objc_mutex_lock(mutex);
-
- /* Call backend to destroy mutex */
- if (__objc_mutex_deallocate(mutex))
- return -1;
-
- /* Free the mutex structure */
- objc_free(mutex);
-
- /* Return last depth */
- return depth;
-}
-
-/*
- Grab a lock on a mutex. If this thread already has a lock on this mutex
- then we increment the lock count. If another thread has a lock on the
- mutex we block and wait for the thread to release the lock.
- Returns the lock count on the mutex held by this thread.
- */
-int
-objc_mutex_lock(objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
- int status;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* If we already own the lock then increment depth */
- thread_id = objc_thread_id();
- if (mutex->owner == thread_id)
- return ++mutex->depth;
-
- /* Call the backend to lock the mutex */
- status = __objc_mutex_lock(mutex);
-
- /* Failed? */
- if (status)
- return status;
-
- /* Successfully locked the thread */
- mutex->owner = thread_id;
- return mutex->depth = 1;
-}
-
-/*
- Try to grab a lock on a mutex. If this thread already has a lock on
- this mutex then we increment the lock count and return it. If another
- thread has a lock on the mutex returns -1.
- */
-int
-objc_mutex_trylock(objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
- int status;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* If we already own the lock then increment depth */
- thread_id = objc_thread_id();
- if (mutex->owner == thread_id)
- return ++mutex->depth;
-
- /* Call the backend to try to lock the mutex */
- status = __objc_mutex_trylock(mutex);
-
- /* Failed? */
- if (status)
- return status;
-
- /* Successfully locked the thread */
- mutex->owner = thread_id;
- return mutex->depth = 1;
-}
-
-/*
- Unlocks the mutex by one level.
- Decrements the lock count on this mutex by one.
- If the lock count reaches zero, release the lock on the mutex.
- Returns the lock count on the mutex.
- It is an error to attempt to unlock a mutex which this thread
- doesn't hold in which case return -1 and the mutex is unaffected.
- */
-int
-objc_mutex_unlock(objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
- int status;
-
- /* Valid mutex? */
- if (!mutex)
- return -1;
-
- /* If another thread owns the lock then abort */
- thread_id = objc_thread_id();
- if (mutex->owner != thread_id)
- return -1;
-
- /* Decrement depth and return */
- if (mutex->depth > 1)
- return --mutex->depth;
-
- /* Depth down to zero so we are no longer the owner */
- mutex->depth = 0;
- mutex->owner = NULL;
-
- /* Have the backend unlock the mutex */
- status = __objc_mutex_unlock(mutex);
-
- /* Failed? */
- if (status)
- return status;
-
- return 0;
-}
-
-/* Frontend condition mutex functions */
-
-/*
- Allocate a condition. Return the condition pointer if successful or NULL
- if the allocation failed for any reason.
- */
-objc_condition_t
-objc_condition_allocate(void)
-{
- objc_condition_t condition;
-
- /* Allocate the condition mutex structure */
- if (!(condition =
- (objc_condition_t)objc_malloc(sizeof(struct objc_condition))))
- return NULL;
-
- /* Call the backend to create the condition mutex */
- if (__objc_condition_allocate(condition))
- {
- /* failed! */
- objc_free(condition);
- return NULL;
- }
-
- /* Success! */
- return condition;
-}
-
-/*
- Deallocate a condition. Note that this includes an implicit
- condition_broadcast to insure that waiting threads have the opportunity
- to wake. It is legal to dealloc a condition only if no other
- thread is/will be using it. Here we do NOT check for other threads
- waiting but just wake them up.
- */
-int
-objc_condition_deallocate(objc_condition_t condition)
-{
- /* Broadcast the condition */
- if (objc_condition_broadcast(condition))
- return -1;
-
- /* Call the backend to destroy */
- if (__objc_condition_deallocate(condition))
- return -1;
-
- /* Free the condition mutex structure */
- objc_free(condition);
-
- return 0;
-}
-
-/*
- Wait on the condition unlocking the mutex until objc_condition_signal()
- or objc_condition_broadcast() are called for the same condition. The
- given mutex *must* have the depth set to 1 so that it can be unlocked
- here, so that someone else can lock it and signal/broadcast the condition.
- The mutex is used to lock access to the shared data that make up the
- "condition" predicate.
- */
-int
-objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
-{
- objc_thread_t thread_id;
-
- /* Valid arguments? */
- if (!mutex || !condition)
- return -1;
-
- /* Make sure we are owner of mutex */
- thread_id = objc_thread_id();
- if (mutex->owner != thread_id)
- return -1;
-
- /* Cannot be locked more than once */
- if (mutex->depth > 1)
- return -1;
-
- /* Virtually unlock the mutex */
- mutex->depth = 0;
- mutex->owner = (objc_thread_t)NULL;
-
- /* Call the backend to wait */
- __objc_condition_wait(condition, mutex);
-
- /* Make ourselves owner of the mutex */
- mutex->owner = thread_id;
- mutex->depth = 1;
-
- return 0;
-}
-
-/*
- Wake up all threads waiting on this condition. It is recommended that
- the called would lock the same mutex as the threads in objc_condition_wait
- before changing the "condition predicate" and make this call and unlock it
- right away after this call.
- */
-int
-objc_condition_broadcast(objc_condition_t condition)
-{
- /* Valid condition mutex? */
- if (!condition)
- return -1;
-
- return __objc_condition_broadcast(condition);
-}
-
-/*
- Wake up one thread waiting on this condition. It is recommended that
- the called would lock the same mutex as the threads in objc_condition_wait
- before changing the "condition predicate" and make this call and unlock it
- right away after this call.
- */
-int
-objc_condition_signal(objc_condition_t condition)
-{
- /* Valid condition mutex? */
- if (!condition)
- return -1;
-
- return __objc_condition_signal(condition);
-}
-
-/* End of File */
diff --git a/gcc/objc/thr.h b/gcc/objc/thr.h
deleted file mode 100644
index f904733695a..00000000000
--- a/gcc/objc/thr.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Thread and mutex controls for Objective C.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- Contributed by Galen C. Hunt (gchunt@cs.rochester.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.
-
-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 files
- compiled with GCC to produce an executable, this does not 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. */
-
-
-#ifndef __thread_INCLUDE_GNU
-#define __thread_INCLUDE_GNU
-
-#include "objc/objc.h"
-
-/*************************************************************************
- * Universal static variables:
- */
-extern int __objc_thread_exit_status; /* Global exit status. */
-
-/********
- * Thread safe implementation types and functions.
- */
-
-/* Thread priorities */
-#define OBJC_THREAD_INTERACTIVE_PRIORITY 2
-#define OBJC_THREAD_BACKGROUND_PRIORITY 1
-#define OBJC_THREAD_LOW_PRIORITY 0
-
-/* A thread */
-typedef void * objc_thread_t;
-
-/* This structure represents a single mutual exclusion lock. */
-struct objc_mutex
-{
- volatile objc_thread_t owner; /* Id of thread that owns. */
- volatile int depth; /* # of acquires. */
- void * backend; /* Specific to backend */
-};
-typedef struct objc_mutex *objc_mutex_t;
-
-/* This structure represents a single condition mutex */
-struct objc_condition
-{
- void * backend; /* Specific to backend */
-};
-typedef struct objc_condition *objc_condition_t;
-
-/* Frontend mutex functions */
-objc_mutex_t objc_mutex_allocate(void);
-int objc_mutex_deallocate(objc_mutex_t mutex);
-int objc_mutex_lock(objc_mutex_t mutex);
-int objc_mutex_unlock(objc_mutex_t mutex);
-int objc_mutex_trylock(objc_mutex_t mutex);
-
-/* Frontend condition mutex functions */
-objc_condition_t objc_condition_allocate(void);
-int objc_condition_deallocate(objc_condition_t condition);
-int objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
-int objc_condition_signal(objc_condition_t condition);
-int objc_condition_broadcast(objc_condition_t condition);
-
-/* Frontend thread functions */
-objc_thread_t objc_thread_detach(SEL selector, id object, id argument);
-void objc_thread_yield(void);
-int objc_thread_exit(void);
-int objc_thread_set_priority(int priority);
-int objc_thread_get_priority(void);
-void * objc_thread_get_data(void);
-int objc_thread_set_data(void *value);
-objc_thread_t objc_thread_id(void);
-
-/*
- Use this to set the hook function that will be called when the
- runtime initially becomes multi threaded.
- The hook function is only called once, meaning only when the
- 2nd thread is spawned, not for each and every thread.
-
- It returns the previous hook function or NULL if there is none.
-
- A program outside of the runtime could set this to some function so
- it can be informed; for example, the GNUstep Base Library sets it
- so it can implement the NSBecomingMultiThreaded notification.
- */
-typedef void (*objc_thread_callback)();
-objc_thread_callback objc_set_thread_callback(objc_thread_callback func);
-
-/* Backend initialization functions */
-int __objc_init_thread_system(void);
-int __objc_fini_thread_system(void);
-
-/* Backend mutex functions */
-int __objc_mutex_allocate(objc_mutex_t mutex);
-int __objc_mutex_deallocate(objc_mutex_t mutex);
-int __objc_mutex_lock(objc_mutex_t mutex);
-int __objc_mutex_trylock(objc_mutex_t mutex);
-int __objc_mutex_unlock(objc_mutex_t mutex);
-
-/* Backend condition mutex functions */
-int __objc_condition_allocate(objc_condition_t condition);
-int __objc_condition_deallocate(objc_condition_t condition);
-int __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
-int __objc_condition_broadcast(objc_condition_t condition);
-int __objc_condition_signal(objc_condition_t condition);
-
-/* Backend thread functions */
-objc_thread_t __objc_thread_detach(void (*func)(void *arg), void *arg);
-int __objc_thread_set_priority(int priority);
-int __objc_thread_get_priority(void);
-void __objc_thread_yield(void);
-int __objc_thread_exit(void);
-objc_thread_t __objc_thread_id(void);
-int __objc_thread_set_data(void *value);
-void * __objc_thread_get_data(void);
-
-#endif /* not __thread_INCLUDE_GNU */
diff --git a/gcc/objc/typedstream.h b/gcc/objc/typedstream.h
deleted file mode 100644
index eb4642f344b..00000000000
--- a/gcc/objc/typedstream.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* GNU Objective-C Typed Streams interface.
- Copyright (C) 1993, 1995 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. */
-
-/* As a special exception, if you link this library with files compiled
- with GCC to produce an executable, this does not 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. */
-
-#ifndef __typedstream_INCLUDE_GNU
-#define __typedstream_INCLUDE_GNU
-
-#include "objc/objc.h"
-#include "objc/hash.h"
-#include <stdio.h>
-
-typedef int (*objc_typed_read_func)(void*, char*, int);
-typedef int (*objc_typed_write_func)(void*, const char*, int);
-typedef int (*objc_typed_flush_func)(void*);
-typedef int (*objc_typed_eof_func)(void*);
-
-#define OBJC_READONLY 0x01
-#define OBJC_WRITEONLY 0x02
-
-#define OBJC_MANAGED_STREAM 0x01
-#define OBJC_FILE_STREAM 0x02
-#define OBJC_MEMORY_STREAM 0x04
-
-#define OBJC_TYPED_STREAM_VERSION 0x01
-
-typedef struct objc_typed_stream {
- void* physical;
- cache_ptr object_table; /* read/written objects */
- cache_ptr stream_table; /* other read/written but shared things.. */
- cache_ptr class_table; /* class version mapping */
- cache_ptr object_refs; /* forward references */
- int mode; /* OBJC_READONLY or OBJC_WRITEONLY */
- int type; /* MANAGED, FILE, MEMORY etc bit string */
- int version; /* version used when writing */
- int writing_root_p;
- objc_typed_read_func read;
- objc_typed_write_func write;
- objc_typed_eof_func eof;
- objc_typed_flush_func flush;
-} TypedStream;
-
-/* opcode masks */
-#define _B_VALUE 0x1fU
-#define _B_CODE 0xe0U
-#define _B_SIGN 0x10U
-#define _B_NUMBER 0x0fU
-
-/* standard opcodes */
-#define _B_INVALID 0x00U
-#define _B_SINT 0x20U
-#define _B_NINT 0x40U
-#define _B_SSTR 0x60U
-#define _B_NSTR 0x80U
-#define _B_RCOMM 0xa0U
-#define _B_UCOMM 0xc0U
-#define _B_EXT 0xe0U
-
-/* eXtension opcodes */
-#define _BX_OBJECT 0x00U
-#define _BX_CLASS 0x01U
-#define _BX_SEL 0x02U
-#define _BX_OBJREF 0x03U
-#define _BX_OBJROOT 0x04U
-#define _BX_EXT 0x1fU
-
-/*
-** Read and write objects as specified by TYPE. All the `last'
-** arguments are pointers to the objects to read/write.
-*/
-
-int objc_write_type (TypedStream* stream, const char* type, const void* data);
-int objc_read_type (TypedStream* stream, const char* type, void* data);
-
-int objc_write_types (TypedStream* stream, const char* type, ...);
-int objc_read_types (TypedStream* stream, const char* type, ...);
-
-int objc_write_object_reference (TypedStream* stream, id object);
-int objc_write_root_object (TypedStream* stream, id object);
-
-long objc_get_stream_class_version (TypedStream* stream, Class class);
-
-
-/*
-** Convenience functions
-*/
-
-int objc_write_array (TypedStream* stream, const char* type,
- int count, const void* data);
-int objc_read_array (TypedStream* stream, const char* type,
- int count, void* data);
-
-int objc_write_object (TypedStream* stream, id object);
-int objc_read_object (TypedStream* stream, id* object);
-
-
-
-/*
-** Open a typed stream for reading or writing. MODE may be either of
-** OBJC_READONLY or OBJC_WRITEONLY.
-*/
-
-TypedStream* objc_open_typed_stream (FILE* physical, int mode);
-TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode);
-
-void objc_close_typed_stream (TypedStream* stream);
-
-BOOL objc_end_of_typed_stream (TypedStream* stream);
-void objc_flush_typed_stream (TypedStream* stream);
-
-#endif /* not __typedstream_INCLUDE_GNU */
diff --git a/gcc/obstack.c b/gcc/obstack.c
deleted file mode 100644
index bc318b37790..00000000000
--- a/gcc/obstack.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/* obstack.c - subroutines used implicitly by object stack macros
- Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "obstack.h"
-
-/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
- incremented whenever callers compiled using an old obstack.h can no
- longer properly call the functions in this obstack.c. */
-#define OBSTACK_INTERFACE_VERSION 1
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself, and the installed library
- supports the same library interface we do. This code is part of the GNU
- C Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object
- files, it is simpler to just do this in the source for each such file. */
-
-#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
-#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
-#include <gnu-versions.h>
-#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-
-#ifndef ELIDE_CODE
-
-
-#if defined (__STDC__) && __STDC__
-#define POINTER void *
-#else
-#define POINTER char *
-#endif
-
-/* Determine default alignment. */
-struct fooalign {char x; double d;};
-#define DEFAULT_ALIGNMENT \
- ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
-/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
- But in fact it might be less smart and round addresses to as much as
- DEFAULT_ROUNDING. So we prepare for it to do that. */
-union fooround {long x; double d;};
-#define DEFAULT_ROUNDING (sizeof (union fooround))
-
-/* When we copy a long block of data, this is the unit to do it with.
- On some machines, copying successive ints does not work;
- in such a case, redefine COPYING_UNIT to `long' (if that works)
- or `char' as a last resort. */
-#ifndef COPYING_UNIT
-#define COPYING_UNIT int
-#endif
-
-
-/* The functions allocating more room by calling `obstack_chunk_alloc'
- jump to the handler pointed to by `obstack_alloc_failed_handler'.
- This variable by default points to the internal function
- `print_and_abort'. */
-#if defined (__STDC__) && __STDC__
-static void print_and_abort (void);
-void (*obstack_alloc_failed_handler) (void) = print_and_abort;
-#else
-static void print_and_abort ();
-void (*obstack_alloc_failed_handler) () = print_and_abort;
-#endif
-
-/* Exit value used when `print_and_abort' is used. */
-#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif
-int obstack_exit_failure = EXIT_FAILURE;
-
-/* The non-GNU-C macros copy the obstack into this global variable
- to avoid multiple evaluation. */
-
-struct obstack *_obstack;
-
-/* Define a macro that either calls functions with the traditional malloc/free
- calling interface, or calls functions with the mmalloc/mfree interface
- (that adds an extra first argument), based on the state of use_extra_arg.
- For free, do not use ?:, since some compilers, like the MIPS compilers,
- do not allow (expr) ? void : void. */
-
-#if defined (__STDC__) && __STDC__
-#define CALL_CHUNKFUN(h, size) \
- (((h) -> use_extra_arg) \
- ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
- : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
-
-#define CALL_FREEFUN(h, old_chunk) \
- do { \
- if ((h) -> use_extra_arg) \
- (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
- else \
- (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
- } while (0)
-#else
-#define CALL_CHUNKFUN(h, size) \
- (((h) -> use_extra_arg) \
- ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
- : (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
-
-#define CALL_FREEFUN(h, old_chunk) \
- do { \
- if ((h) -> use_extra_arg) \
- (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
- else \
- (*(void (*) ()) (h)->freefun) ((old_chunk)); \
- } while (0)
-#endif
-
-
-/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
- Objects start on multiples of ALIGNMENT (0 means use default).
- CHUNKFUN is the function to use to allocate chunks,
- and FREEFUN the function to free them.
-
- Return nonzero if successful, zero if out of memory.
- To recover from an out of memory error,
- free up some memory, then call this again. */
-
-int
-_obstack_begin (h, size, alignment, chunkfun, freefun)
- struct obstack *h;
- int size;
- int alignment;
-#if defined (__STDC__) && __STDC__
- POINTER (*chunkfun) (long);
- void (*freefun) (void *);
-#else
- POINTER (*chunkfun) ();
- void (*freefun) ();
-#endif
-{
- register struct _obstack_chunk *chunk; /* points to new chunk */
-
- if (alignment == 0)
- alignment = (int) DEFAULT_ALIGNMENT;
- if (size == 0)
- /* Default size is what GNU malloc can fit in a 4096-byte block. */
- {
- /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
- Use the values for range checking, because if range checking is off,
- the extra bytes won't be missed terribly, but if range checking is on
- and we used a larger request, a whole extra 4096 bytes would be
- allocated.
-
- These number are irrelevant to the new GNU malloc. I suspect it is
- less sensitive to the size of the request. */
- int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
- + 4 + DEFAULT_ROUNDING - 1)
- & ~(DEFAULT_ROUNDING - 1));
- size = 4096 - extra;
- }
-
-#if defined (__STDC__) && __STDC__
- h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
- h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
-#else
- h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
- h->freefun = freefun;
-#endif
- h->chunk_size = size;
- h->alignment_mask = alignment - 1;
- h->use_extra_arg = 0;
-
- chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
- if (!chunk)
- (*obstack_alloc_failed_handler) ();
- h->next_free = h->object_base = chunk->contents;
- h->chunk_limit = chunk->limit
- = (char *) chunk + h->chunk_size;
- chunk->prev = 0;
- /* The initial chunk now contains no empty object. */
- h->maybe_empty_object = 0;
- h->alloc_failed = 0;
- return 1;
-}
-
-int
-_obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
- struct obstack *h;
- int size;
- int alignment;
-#if defined (__STDC__) && __STDC__
- POINTER (*chunkfun) (POINTER, long);
- void (*freefun) (POINTER, POINTER);
-#else
- POINTER (*chunkfun) ();
- void (*freefun) ();
-#endif
- POINTER arg;
-{
- register struct _obstack_chunk *chunk; /* points to new chunk */
-
- if (alignment == 0)
- alignment = (int) DEFAULT_ALIGNMENT;
- if (size == 0)
- /* Default size is what GNU malloc can fit in a 4096-byte block. */
- {
- /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
- Use the values for range checking, because if range checking is off,
- the extra bytes won't be missed terribly, but if range checking is on
- and we used a larger request, a whole extra 4096 bytes would be
- allocated.
-
- These number are irrelevant to the new GNU malloc. I suspect it is
- less sensitive to the size of the request. */
- int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
- + 4 + DEFAULT_ROUNDING - 1)
- & ~(DEFAULT_ROUNDING - 1));
- size = 4096 - extra;
- }
-
-#if defined(__STDC__) && __STDC__
- h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
- h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
-#else
- h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
- h->freefun = freefun;
-#endif
- h->chunk_size = size;
- h->alignment_mask = alignment - 1;
- h->extra_arg = arg;
- h->use_extra_arg = 1;
-
- chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
- if (!chunk)
- (*obstack_alloc_failed_handler) ();
- h->next_free = h->object_base = chunk->contents;
- h->chunk_limit = chunk->limit
- = (char *) chunk + h->chunk_size;
- chunk->prev = 0;
- /* The initial chunk now contains no empty object. */
- h->maybe_empty_object = 0;
- h->alloc_failed = 0;
- return 1;
-}
-
-/* Allocate a new current chunk for the obstack *H
- on the assumption that LENGTH bytes need to be added
- to the current object, or a new object of length LENGTH allocated.
- Copies any partial object from the end of the old chunk
- to the beginning of the new one. */
-
-void
-_obstack_newchunk (h, length)
- struct obstack *h;
- int length;
-{
- register struct _obstack_chunk *old_chunk = h->chunk;
- register struct _obstack_chunk *new_chunk;
- register long new_size;
- register long obj_size = h->next_free - h->object_base;
- register long i;
- long already;
-
- /* Compute size for new chunk. */
- new_size = (obj_size + length) + (obj_size >> 3) + 100;
- if (new_size < h->chunk_size)
- new_size = h->chunk_size;
-
- /* Allocate and initialize the new chunk. */
- new_chunk = CALL_CHUNKFUN (h, new_size);
- if (!new_chunk)
- (*obstack_alloc_failed_handler) ();
- h->chunk = new_chunk;
- new_chunk->prev = old_chunk;
- new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
-
- /* Move the existing object to the new chunk.
- Word at a time is fast and is safe if the object
- is sufficiently aligned. */
- if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)
- {
- for (i = obj_size / sizeof (COPYING_UNIT) - 1;
- i >= 0; i--)
- ((COPYING_UNIT *)new_chunk->contents)[i]
- = ((COPYING_UNIT *)h->object_base)[i];
- /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
- but that can cross a page boundary on a machine
- which does not do strict alignment for COPYING_UNITS. */
- already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);
- }
- else
- already = 0;
- /* Copy remaining bytes one by one. */
- for (i = already; i < obj_size; i++)
- new_chunk->contents[i] = h->object_base[i];
-
- /* If the object just copied was the only data in OLD_CHUNK,
- free that chunk and remove it from the chain.
- But not if that chunk might contain an empty object. */
- if (h->object_base == old_chunk->contents && ! h->maybe_empty_object)
- {
- new_chunk->prev = old_chunk->prev;
- CALL_FREEFUN (h, old_chunk);
- }
-
- h->object_base = new_chunk->contents;
- h->next_free = h->object_base + obj_size;
- /* The new chunk certainly contains no empty object yet. */
- h->maybe_empty_object = 0;
-}
-
-/* Return nonzero if object OBJ has been allocated from obstack H.
- This is here for debugging.
- If you use it in a program, you are probably losing. */
-
-#if defined (__STDC__) && __STDC__
-/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
- obstack.h because it is just for debugging. */
-int _obstack_allocated_p (struct obstack *h, POINTER obj);
-#endif
-
-int
-_obstack_allocated_p (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk *plp; /* point to previous chunk if any */
-
- lp = (h)->chunk;
- /* We use >= rather than > since the object cannot be exactly at
- the beginning of the chunk but might be an empty object exactly
- at the end of an adjacent chunk. */
- while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
- {
- plp = lp->prev;
- lp = plp;
- }
- return lp != 0;
-}
-
-/* Free objects in obstack H, including OBJ and everything allocate
- more recently than OBJ. If OBJ is zero, free everything in H. */
-
-#undef obstack_free
-
-/* This function has two names with identical definitions.
- This is the first one, called from non-ANSI code. */
-
-void
-_obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk *plp; /* point to previous chunk if any */
-
- lp = h->chunk;
- /* We use >= because there cannot be an object at the beginning of a chunk.
- But there can be an empty object at that address
- at the end of another chunk. */
- while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
- {
- plp = lp->prev;
- CALL_FREEFUN (h, lp);
- lp = plp;
- /* If we switch chunks, we can't tell whether the new current
- chunk contains an empty object, so assume that it may. */
- h->maybe_empty_object = 1;
- }
- if (lp)
- {
- h->object_base = h->next_free = (char *) (obj);
- h->chunk_limit = lp->limit;
- h->chunk = lp;
- }
- else if (obj != 0)
- /* obj is not in any of the chunks! */
- abort ();
-}
-
-/* This function is used from ANSI code. */
-
-void
-obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk *plp; /* point to previous chunk if any */
-
- lp = h->chunk;
- /* We use >= because there cannot be an object at the beginning of a chunk.
- But there can be an empty object at that address
- at the end of another chunk. */
- while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
- {
- plp = lp->prev;
- CALL_FREEFUN (h, lp);
- lp = plp;
- /* If we switch chunks, we can't tell whether the new current
- chunk contains an empty object, so assume that it may. */
- h->maybe_empty_object = 1;
- }
- if (lp)
- {
- h->object_base = h->next_free = (char *) (obj);
- h->chunk_limit = lp->limit;
- h->chunk = lp;
- }
- else if (obj != 0)
- /* obj is not in any of the chunks! */
- abort ();
-}
-
-int
-_obstack_memory_used (h)
- struct obstack *h;
-{
- register struct _obstack_chunk* lp;
- register int nbytes = 0;
-
- for (lp = h->chunk; lp != 0; lp = lp->prev)
- {
- nbytes += lp->limit - (char *) lp;
- }
- return nbytes;
-}
-
-/* Define the error handler. */
-#ifndef _
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# ifndef _
-# define _(Str) gettext (Str)
-# endif
-# else
-# define _(Str) (Str)
-# endif
-#endif
-
-static void
-print_and_abort ()
-{
- fputs (_("memory exhausted\n"), stderr);
- exit (obstack_exit_failure);
-}
-
-#if 0
-/* These are now turned off because the applications do not use it
- and it uses bcopy via obstack_grow, which causes trouble on sysV. */
-
-/* Now define the functional versions of the obstack macros.
- Define them to simply use the corresponding macros to do the job. */
-
-#if defined (__STDC__) && __STDC__
-/* These function definitions do not work with non-ANSI preprocessors;
- they won't pass through the macro names in parentheses. */
-
-/* The function names appear in parentheses in order to prevent
- the macro-definitions of the names from being expanded there. */
-
-POINTER (obstack_base) (obstack)
- struct obstack *obstack;
-{
- return obstack_base (obstack);
-}
-
-POINTER (obstack_next_free) (obstack)
- struct obstack *obstack;
-{
- return obstack_next_free (obstack);
-}
-
-int (obstack_object_size) (obstack)
- struct obstack *obstack;
-{
- return obstack_object_size (obstack);
-}
-
-int (obstack_room) (obstack)
- struct obstack *obstack;
-{
- return obstack_room (obstack);
-}
-
-int (obstack_make_room) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- return obstack_make_room (obstack, length);
-}
-
-void (obstack_grow) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- obstack_grow (obstack, pointer, length);
-}
-
-void (obstack_grow0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- obstack_grow0 (obstack, pointer, length);
-}
-
-void (obstack_1grow) (obstack, character)
- struct obstack *obstack;
- int character;
-{
- obstack_1grow (obstack, character);
-}
-
-void (obstack_blank) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- obstack_blank (obstack, length);
-}
-
-void (obstack_1grow_fast) (obstack, character)
- struct obstack *obstack;
- int character;
-{
- obstack_1grow_fast (obstack, character);
-}
-
-void (obstack_blank_fast) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- obstack_blank_fast (obstack, length);
-}
-
-POINTER (obstack_finish) (obstack)
- struct obstack *obstack;
-{
- return obstack_finish (obstack);
-}
-
-POINTER (obstack_alloc) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- return obstack_alloc (obstack, length);
-}
-
-POINTER (obstack_copy) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- return obstack_copy (obstack, pointer, length);
-}
-
-POINTER (obstack_copy0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- return obstack_copy0 (obstack, pointer, length);
-}
-
-#endif /* __STDC__ */
-
-#endif /* 0 */
-
-#endif /* !ELIDE_CODE */
diff --git a/gcc/obstack.h b/gcc/obstack.h
deleted file mode 100644
index 38e96777660..00000000000
--- a/gcc/obstack.h
+++ /dev/null
@@ -1,593 +0,0 @@
-/* obstack.h - object stack macros
- Copyright (C) 1988,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
-
-
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@gnu.org.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-/* Summary:
-
-All the apparent functions defined here are macros. The idea
-is that you would use these pre-tested macros to solve a
-very specific set of problems, and they would run fast.
-Caution: no side-effects in arguments please!! They may be
-evaluated MANY times!!
-
-These macros operate a stack of objects. Each object starts life
-small, and may grow to maturity. (Consider building a word syllable
-by syllable.) An object can move while it is growing. Once it has
-been "finished" it never changes address again. So the "top of the
-stack" is typically an immature growing object, while the rest of the
-stack is of mature, fixed size and fixed address objects.
-
-These routines grab large chunks of memory, using a function you
-supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
-by calling `obstack_chunk_free'. You must define them and declare
-them before using any obstack macros.
-
-Each independent stack is represented by a `struct obstack'.
-Each of the obstack macros expects a pointer to such a structure
-as the first argument.
-
-One motivation for this package is the problem of growing char strings
-in symbol tables. Unless you are "fascist pig with a read-only mind"
---Gosper's immortal quote from HAKMEM item 154, out of context--you
-would not like to put any arbitrary upper limit on the length of your
-symbols.
-
-In practice this often means you will build many short symbols and a
-few long symbols. At the time you are reading a symbol you don't know
-how long it is. One traditional method is to read a symbol into a
-buffer, realloc()ating the buffer every time you try to read a symbol
-that is longer than the buffer. This is beaut, but you still will
-want to copy the symbol from the buffer to a more permanent
-symbol-table entry say about half the time.
-
-With obstacks, you can work differently. Use one obstack for all symbol
-names. As you read a symbol, grow the name in the obstack gradually.
-When the name is complete, finalize it. Then, if the symbol exists already,
-free the newly read name.
-
-The way we do this is to take a large chunk, allocating memory from
-low addresses. When you want to build a symbol in the chunk you just
-add chars above the current "high water mark" in the chunk. When you
-have finished adding chars, because you got to the end of the symbol,
-you know how long the chars are, and you can create a new object.
-Mostly the chars will not burst over the highest address of the chunk,
-because you would typically expect a chunk to be (say) 100 times as
-long as an average object.
-
-In case that isn't clear, when we have enough chars to make up
-the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
-so we just point to it where it lies. No moving of chars is
-needed and this is the second win: potentially long strings need
-never be explicitly shuffled. Once an object is formed, it does not
-change its address during its lifetime.
-
-When the chars burst over a chunk boundary, we allocate a larger
-chunk, and then copy the partly formed object from the end of the old
-chunk to the beginning of the new larger chunk. We then carry on
-accreting characters to the end of the object as we normally would.
-
-A special macro is provided to add a single char at a time to a
-growing object. This allows the use of register variables, which
-break the ordinary 'growth' macro.
-
-Summary:
- We allocate large chunks.
- We carve out one object at a time from the current chunk.
- Once carved, an object never moves.
- We are free to append data of any size to the currently
- growing object.
- Exactly one object is growing in an obstack at any one time.
- You can run one obstack per control block.
- You may have as many control blocks as you dare.
- Because of the way we do it, you can `unwind' an obstack
- back to a previous state. (You may remove objects much
- as you would with a stack.)
-*/
-
-
-/* Don't do the contents of this file more than once. */
-
-#ifndef _OBSTACK_H
-#define _OBSTACK_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* We use subtraction of (char *) 0 instead of casting to int
- because on word-addressable machines a simple cast to int
- may ignore the byte-within-word field of the pointer. */
-
-#ifndef __PTR_TO_INT
-# define __PTR_TO_INT(P) ((P) - (char *) 0)
-#endif
-
-#ifndef __INT_TO_PTR
-# define __INT_TO_PTR(P) ((P) + (char *) 0)
-#endif
-
-/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
- defined, as with GNU C, use that; that way we don't pollute the
- namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
- available, include it and use ptrdiff_t. In traditional C, long is
- the best that we can do. */
-
-#ifdef __PTRDIFF_TYPE__
-# define PTR_INT_TYPE __PTRDIFF_TYPE__
-#else
-# ifdef HAVE_STDDEF_H
-# include <stddef.h>
-# define PTR_INT_TYPE ptrdiff_t
-# else
-# define PTR_INT_TYPE long
-# endif
-#endif
-
-#if defined _LIBC || defined HAVE_STRING_H
-# include <string.h>
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
-#else
-# ifdef memcpy
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
-# else
-# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
-# endif
-#endif
-
-struct _obstack_chunk /* Lives at front of each chunk. */
-{
- char *limit; /* 1 past end of this chunk */
- struct _obstack_chunk *prev; /* address of prior chunk or NULL */
- char contents[4]; /* objects begin here */
-};
-
-struct obstack /* control current object in current chunk */
-{
- long chunk_size; /* preferred size to allocate chunks in */
- struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
- char *object_base; /* address of object we are building */
- char *next_free; /* where to add next char to current object */
- char *chunk_limit; /* address of char after current chunk */
- PTR_INT_TYPE temp; /* Temporary for some macros. */
- int alignment_mask; /* Mask of alignment for each object. */
-#if defined __STDC__ && __STDC__
- /* These prototypes vary based on `use_extra_arg', and we use
- casts to the prototypeless function type in all assignments,
- but having prototypes here quiets -Wstrict-prototypes. */
- struct _obstack_chunk *(*chunkfun) (void *, long);
- void (*freefun) (void *, struct _obstack_chunk *);
- void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
-#else
- struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
- void (*freefun) (); /* User's function to free a chunk. */
- char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
-#endif
- unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
- unsigned maybe_empty_object:1;/* There is a possibility that the current
- chunk contains a zero-length object. This
- prevents freeing the chunk if we allocate
- a bigger chunk to replace it. */
- unsigned alloc_failed:1; /* No longer used, as we now call the failed
- handler on error, but retained for binary
- compatibility. */
-};
-
-/* Declare the external functions we use; they are in obstack.c. */
-
-#if defined __STDC__ && __STDC__
-extern void _obstack_newchunk (struct obstack *, int);
-extern void _obstack_free (struct obstack *, void *);
-extern int _obstack_begin (struct obstack *, int, int,
- void *(*) (long), void (*) (void *));
-extern int _obstack_begin_1 (struct obstack *, int, int,
- void *(*) (void *, long),
- void (*) (void *, void *), void *);
-extern int _obstack_memory_used (struct obstack *);
-#else
-extern void _obstack_newchunk ();
-extern void _obstack_free ();
-extern int _obstack_begin ();
-extern int _obstack_begin_1 ();
-extern int _obstack_memory_used ();
-#endif
-
-#if defined __STDC__ && __STDC__
-
-/* Do the function-declarations after the structs
- but before defining the macros. */
-
-void obstack_init (struct obstack *obstack);
-
-void * obstack_alloc (struct obstack *obstack, int size);
-
-void * obstack_copy (struct obstack *obstack, void *address, int size);
-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
-
-void obstack_free (struct obstack *obstack, void *block);
-
-void obstack_blank (struct obstack *obstack, int size);
-
-void obstack_grow (struct obstack *obstack, void *data, int size);
-void obstack_grow0 (struct obstack *obstack, void *data, int size);
-
-void obstack_1grow (struct obstack *obstack, int data_char);
-void obstack_ptr_grow (struct obstack *obstack, void *data);
-void obstack_int_grow (struct obstack *obstack, int data);
-
-void * obstack_finish (struct obstack *obstack);
-
-int obstack_object_size (struct obstack *obstack);
-
-int obstack_room (struct obstack *obstack);
-void obstack_make_room (struct obstack *obstack, int size);
-void obstack_1grow_fast (struct obstack *obstack, int data_char);
-void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
-void obstack_int_grow_fast (struct obstack *obstack, int data);
-void obstack_blank_fast (struct obstack *obstack, int size);
-
-void * obstack_base (struct obstack *obstack);
-void * obstack_next_free (struct obstack *obstack);
-int obstack_alignment_mask (struct obstack *obstack);
-int obstack_chunk_size (struct obstack *obstack);
-int obstack_memory_used (struct obstack *obstack);
-
-#endif /* __STDC__ */
-
-/* Non-ANSI C cannot really support alternative functions for these macros,
- so we do not declare them. */
-
-/* Error handler called when `obstack_chunk_alloc' failed to allocate
- more memory. This can be set to a user defined function. The
- default action is to print a message and abort. */
-#if defined __STDC__ && __STDC__
-extern void (*obstack_alloc_failed_handler) (void);
-#else
-extern void (*obstack_alloc_failed_handler) ();
-#endif
-
-/* Exit value used when `print_and_abort' is used. */
-extern int obstack_exit_failure;
-
-/* Pointer to beginning of object being allocated or to be allocated next.
- Note that this might not be the final address of the object
- because a new chunk might be needed to hold the final size. */
-
-#define obstack_base(h) ((h)->object_base)
-
-/* Size for allocating ordinary chunks. */
-
-#define obstack_chunk_size(h) ((h)->chunk_size)
-
-/* Pointer to next byte not yet allocated in current chunk. */
-
-#define obstack_next_free(h) ((h)->next_free)
-
-/* Mask specifying low bits that should be clear in address of an object. */
-
-#define obstack_alignment_mask(h) ((h)->alignment_mask)
-
-/* To prevent prototype warnings provide complete argument list in
- standard C version. */
-#if defined __STDC__ && __STDC__
-
-# define obstack_init(h) \
- _obstack_begin ((h), 0, 0, \
- (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
-
-# define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, \
- (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
-
-# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
- _obstack_begin ((h), (size), (alignment), \
- (void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
-
-# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
- _obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) (void *, long)) (chunkfun), \
- (void (*) (void *, void *)) (freefun), (arg))
-
-# define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
-
-# define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
-
-#else
-
-# define obstack_init(h) \
- _obstack_begin ((h), 0, 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
- _obstack_begin ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun))
-
-# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
- _obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
-
-# define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
-
-# define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)()) (newfreefun))
-
-#endif
-
-#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
-
-#define obstack_blank_fast(h,n) ((h)->next_free += (n))
-
-#define obstack_memory_used(h) _obstack_memory_used (h)
-
-#if defined __GNUC__ && defined __STDC__ && __STDC__
-/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
- does not implement __extension__. But that compiler doesn't define
- __GNUC_MINOR__. */
-# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
-# define __extension__
-# endif
-
-/* For GNU C, if not -traditional,
- we can define these macros to compute all args only once
- without using a global variable.
- Also, we can avoid using the `temp' slot, to make faster code. */
-
-# define obstack_object_size(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->next_free - __o->object_base); })
-
-# define obstack_room(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->chunk_limit - __o->next_free); })
-
-# define obstack_make_room(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->chunk_limit - __o->next_free < __len) \
- _obstack_newchunk (__o, __len); \
- (void) 0; })
-
-# define obstack_empty_p(OBSTACK) \
- __extension__ \
- ({ struct obstack *__o = (OBSTACK); \
- (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
-
-# define obstack_grow(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->next_free + __len > __o->chunk_limit) \
- _obstack_newchunk (__o, __len); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
- __o->next_free += __len; \
- (void) 0; })
-
-# define obstack_grow0(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->next_free + __len + 1 > __o->chunk_limit) \
- _obstack_newchunk (__o, __len + 1); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
- __o->next_free += __len; \
- *(__o->next_free)++ = 0; \
- (void) 0; })
-
-# define obstack_1grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + 1 > __o->chunk_limit) \
- _obstack_newchunk (__o, 1); \
- *(__o->next_free)++ = (datum); \
- (void) 0; })
-
-/* These assume that the obstack alignment is good enough for pointers or ints,
- and that the data added so far to the current object
- shares that much alignment. */
-
-# define obstack_ptr_grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
- _obstack_newchunk (__o, sizeof (void *)); \
- *((void **)__o->next_free)++ = ((void *)datum); \
- (void) 0; })
-
-# define obstack_int_grow(OBSTACK,datum) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- if (__o->next_free + sizeof (int) > __o->chunk_limit) \
- _obstack_newchunk (__o, sizeof (int)); \
- *((int *)__o->next_free)++ = ((int)datum); \
- (void) 0; })
-
-# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
-# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
-
-# define obstack_blank(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- if (__o->chunk_limit - __o->next_free < __len) \
- _obstack_newchunk (__o, __len); \
- __o->next_free += __len; \
- (void) 0; })
-
-# define obstack_alloc(OBSTACK,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_blank (__h, (length)); \
- obstack_finish (__h); })
-
-# define obstack_copy(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow (__h, (where), (length)); \
- obstack_finish (__h); })
-
-# define obstack_copy0(OBSTACK,where,length) \
-__extension__ \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow0 (__h, (where), (length)); \
- obstack_finish (__h); })
-
-/* The local variable is named __o1 to avoid a name conflict
- when obstack_blank is called. */
-# define obstack_finish(OBSTACK) \
-__extension__ \
-({ struct obstack *__o1 = (OBSTACK); \
- void *value; \
- value = (void *) __o1->object_base; \
- if (__o1->next_free == value) \
- __o1->maybe_empty_object = 1; \
- __o1->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
- & ~ (__o1->alignment_mask)); \
- if (__o1->next_free - (char *)__o1->chunk \
- > __o1->chunk_limit - (char *)__o1->chunk) \
- __o1->next_free = __o1->chunk_limit; \
- __o1->object_base = __o1->next_free; \
- value; })
-
-# define obstack_free(OBSTACK, OBJ) \
-__extension__ \
-({ struct obstack *__o = (OBSTACK); \
- void *__obj = (OBJ); \
- if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
- __o->next_free = __o->object_base = __obj; \
- else (obstack_free) (__o, __obj); })
-
-#else /* not __GNUC__ or not __STDC__ */
-
-# define obstack_object_size(h) \
- (unsigned) ((h)->next_free - (h)->object_base)
-
-# define obstack_room(h) \
- (unsigned) ((h)->chunk_limit - (h)->next_free)
-
-# define obstack_empty_p(h) \
- ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
-
-/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
- so that we can avoid having void expressions
- in the arms of the conditional expression.
- Casting the third operand to void was tried before,
- but some compilers won't accept it. */
-
-# define obstack_make_room(h,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
-
-# define obstack_grow(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
- (h)->next_free += (h)->temp)
-
-# define obstack_grow0(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
- (h)->next_free += (h)->temp, \
- *((h)->next_free)++ = 0)
-
-# define obstack_1grow(h,datum) \
-( (((h)->next_free + 1 > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), 1), 0) : 0), \
- (*((h)->next_free)++ = (datum)))
-
-# define obstack_ptr_grow(h,datum) \
-( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
- (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
-
-# define obstack_int_grow(h,datum) \
-( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
- ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
- (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
-
-# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
-# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
-
-# define obstack_blank(h,length) \
-( (h)->temp = (length), \
- (((h)->chunk_limit - (h)->next_free < (h)->temp) \
- ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- ((h)->next_free += (h)->temp))
-
-# define obstack_alloc(h,length) \
- (obstack_blank ((h), (length)), obstack_finish ((h)))
-
-# define obstack_copy(h,where,length) \
- (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
-
-# define obstack_copy0(h,where,length) \
- (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
-
-# define obstack_finish(h) \
-( ((h)->next_free == (h)->object_base \
- ? (((h)->maybe_empty_object = 1), 0) \
- : 0), \
- (h)->temp = __PTR_TO_INT ((h)->object_base), \
- (h)->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
- & ~ ((h)->alignment_mask)), \
- (((h)->next_free - (char *) (h)->chunk \
- > (h)->chunk_limit - (char *) (h)->chunk) \
- ? ((h)->next_free = (h)->chunk_limit) : 0), \
- (h)->object_base = (h)->next_free, \
- __INT_TO_PTR ((h)->temp))
-
-# if defined __STDC__ && __STDC__
-# define obstack_free(h,obj) \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
-# else
-# define obstack_free(h,obj) \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
-# endif
-
-#endif /* not __GNUC__ or not __STDC__ */
-
-#ifdef __cplusplus
-} /* C++ */
-#endif
-
-#endif /* obstack.h */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 2e27efd23b8..878a2eaee38 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -56,7 +56,7 @@ optab code_to_optab[NUM_RTX_CODE + 1];
/* SYMBOL_REF rtx's for the library functions that are called
implicitly and not via optabs. */
-rtx all_libfuncs[93];
+rtx all_libfuncs[96];
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
gives the gen_function to make a branch to test that condition. */
@@ -90,6 +90,9 @@ static optab init_optab PROTO((enum rtx_code));
static void init_libfuncs PROTO((optab, int, int, char *, int));
static void init_integral_libfuncs PROTO((optab, char *, int));
static void init_floating_libfuncs PROTO((optab, char *, int));
+#ifdef HAVE_conditional_trap
+static void init_traps PROTO((void));
+#endif
/* Add a REG_EQUAL note to the last insn in SEQ. TARGET is being set to
the result of operation CODE applied to OP0 (and OP1 if it is a binary
@@ -134,13 +137,13 @@ add_equal_note (seq, target, code, op0, op1)
return 0;
if (GET_RTX_CLASS (code) == '1')
- note = gen_rtx (code, GET_MODE (target), copy_rtx (op0));
+ note = gen_rtx_fmt_e (code, GET_MODE (target), copy_rtx (op0));
else
- note = gen_rtx (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
+ note = gen_rtx_fmt_ee (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1))
- = gen_rtx (EXPR_LIST, REG_EQUAL, note,
- REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1)));
+ = gen_rtx_EXPR_LIST (REG_EQUAL, note,
+ REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1)));
return 1;
}
@@ -171,13 +174,13 @@ widen_operand (op, mode, oldmode, unsignedp, no_extend)
/* If MODE is no wider than a single word, we return a paradoxical
SUBREG. */
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
- return gen_rtx (SUBREG, mode, force_reg (GET_MODE (op), op), 0);
+ return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
/* Otherwise, get an object of MODE, clobber it, and set the low-order
part to OP. */
result = gen_reg_rtx (mode);
- emit_insn (gen_rtx (CLOBBER, VOIDmode, result));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, result));
emit_move_insn (gen_lowpart (GET_MODE (op), result), op);
return result;
}
@@ -471,7 +474,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{
if (binoptab->code != UNKNOWN)
equiv_value
- = gen_rtx (binoptab->code, mode, copy_rtx (op0), copy_rtx (op1));
+ = gen_rtx_fmt_ee (binoptab->code, mode,
+ copy_rtx (op0), copy_rtx (op1));
else
equiv_value = 0;
@@ -590,7 +594,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
if (inter != 0)
{
if (binoptab->code != UNKNOWN)
- equiv_value = gen_rtx (binoptab->code, mode, op0, op1);
+ equiv_value = gen_rtx_fmt_ee (binoptab->code, mode, op0, op1);
else
equiv_value = 0;
@@ -704,7 +708,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
if (inter != 0)
{
if (binoptab->code != UNKNOWN)
- equiv_value = gen_rtx (binoptab->code, mode, op0, op1);
+ equiv_value = gen_rtx_fmt_ee (binoptab->code, mode, op0, op1);
else
equiv_value = 0;
@@ -753,7 +757,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
/* Indicate for flow that the entire target reg is being set. */
if (GET_CODE (target) == REG)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
/* Do the actual arithmetic. */
for (i = 0; i < nwords; i++)
@@ -822,11 +826,12 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{
rtx temp = emit_move_insn (target, target);
- REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (binoptab->code, mode,
- copy_rtx (xop0),
- copy_rtx (xop1)),
- REG_NOTES (temp));
+ REG_NOTES (temp)
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_fmt_ee (binoptab->code, mode,
+ copy_rtx (xop0),
+ copy_rtx (xop1)),
+ REG_NOTES (temp));
}
return target;
}
@@ -1004,11 +1009,12 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
{
temp = emit_move_insn (product, product);
- REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (MULT, mode,
- copy_rtx (op0),
- copy_rtx (op1)),
- REG_NOTES (temp));
+ REG_NOTES (temp)
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_fmt_ee (MULT, mode,
+ copy_rtx (op0),
+ copy_rtx (op1)),
+ REG_NOTES (temp));
}
return product;
}
@@ -1342,7 +1348,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{
if (binoptab->code != UNKNOWN)
equiv_value
- = gen_rtx (binoptab->code, mode, copy_rtx (op0), copy_rtx (op1));
+ = gen_rtx_fmt_ee (binoptab->code, mode,
+ copy_rtx (op0), copy_rtx (op1));
else
equiv_value = 0;
@@ -1388,7 +1395,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
target = gen_reg_rtx (mode);
emit_libcall_block (insns, target, value,
- gen_rtx (binoptab->code, mode, op0, op1));
+ gen_rtx_fmt_ee (binoptab->code, mode, op0, op1));
return target;
}
@@ -1802,7 +1809,8 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
end_sequence ();
emit_no_conflict_block (insns, target, op0, NULL_RTX,
- gen_rtx (unoptab->code, mode, copy_rtx (op0)));
+ gen_rtx_fmt_e (unoptab->code, mode,
+ copy_rtx (op0)));
return target;
}
@@ -1846,7 +1854,8 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
end_sequence ();
emit_no_conflict_block (seq, target, op0, 0,
- gen_rtx (unoptab->code, mode, copy_rtx (op0)));
+ gen_rtx_fmt_e (unoptab->code, mode,
+ copy_rtx (op0)));
return target;
}
@@ -1867,7 +1876,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
target = gen_reg_rtx (mode);
emit_libcall_block (insns, target, value,
- gen_rtx (unoptab->code, mode, op0));
+ gen_rtx_fmt_e (unoptab->code, mode, op0));
return target;
}
@@ -2176,7 +2185,7 @@ expand_complex_abs (mode, op0, target, unsignedp)
target = gen_reg_rtx (submode);
emit_libcall_block (insns, target, value,
- gen_rtx (abs_optab->code, mode, op0));
+ gen_rtx_fmt_e (abs_optab->code, mode, op0));
return target;
}
@@ -2352,7 +2361,7 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
/* Now write the CLOBBER of the output, followed by the setting of each
of the words, followed by the final copy. */
if (target != op0 && target != op1)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
for (insn = insns; insn; insn = next)
{
@@ -2360,12 +2369,12 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
add_insn (insn);
if (op1 && GET_CODE (op1) == REG)
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_NO_CONFLICT, op1,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_NO_CONFLICT, op1,
+ REG_NOTES (insn));
if (op0 && GET_CODE (op0) == REG)
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_NO_CONFLICT, op0,
- REG_NOTES (insn));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_NO_CONFLICT, op0,
+ REG_NOTES (insn));
}
if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
@@ -2374,7 +2383,7 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
last = emit_move_insn (target, target);
if (equiv)
REG_NOTES (last)
- = gen_rtx (EXPR_LIST, REG_EQUAL, equiv, REG_NOTES (last));
+ = gen_rtx_EXPR_LIST (REG_EQUAL, equiv, REG_NOTES (last));
}
else
last = get_last_insn ();
@@ -2385,9 +2394,9 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
first = NEXT_INSN (prev);
/* Encapsulate the block so it gets manipulated as a unit. */
- REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
- REG_NOTES (first));
- REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
+ REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
+ REG_NOTES (first));
+ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
return last;
}
@@ -2472,8 +2481,8 @@ emit_libcall_block (insns, target, result, equiv)
last = emit_move_insn (target, result);
if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
!= CODE_FOR_nothing)
- REG_NOTES (last) = gen_rtx (EXPR_LIST,
- REG_EQUAL, copy_rtx (equiv), REG_NOTES (last));
+ REG_NOTES (last) = gen_rtx_EXPR_LIST (REG_EQUAL, copy_rtx (equiv),
+ REG_NOTES (last));
if (prev == 0)
first = get_insns ();
@@ -2481,9 +2490,9 @@ emit_libcall_block (insns, target, result, equiv)
first = NEXT_INSN (prev);
/* Encapsulate the block so it gets manipulated as a unit. */
- REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
- REG_NOTES (first));
- REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
+ REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
+ REG_NOTES (first));
+ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
}
/* Generate code to store zero in X. */
@@ -3217,7 +3226,7 @@ gen_move_insn (x, y)
x = gen_lowpart_common (tmode, x1);
if (x == 0 && GET_CODE (x1) == MEM)
{
- x = gen_rtx (MEM, tmode, XEXP (x1, 0));
+ x = gen_rtx_MEM (tmode, XEXP (x1, 0));
RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (x1);
MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (x1);
MEM_VOLATILE_P (x) = MEM_VOLATILE_P (x1);
@@ -3227,7 +3236,7 @@ gen_move_insn (x, y)
y = gen_lowpart_common (tmode, y1);
if (y == 0 && GET_CODE (y1) == MEM)
{
- y = gen_rtx (MEM, tmode, XEXP (y1, 0));
+ y = gen_rtx_MEM (tmode, XEXP (y1, 0));
RTX_UNCHANGING_P (y) = RTX_UNCHANGING_P (y1);
MEM_IN_STRUCT_P (y) = MEM_IN_STRUCT_P (y1);
MEM_VOLATILE_P (y) = MEM_VOLATILE_P (y1);
@@ -3555,7 +3564,7 @@ expand_float (to, from, unsignedp)
end_sequence ();
emit_libcall_block (insns, target, value,
- gen_rtx (FLOAT, GET_MODE (to), from));
+ gen_rtx_FLOAT (GET_MODE (to), from));
}
done:
@@ -3701,10 +3710,12 @@ expand_fix (to, from, unsignedp)
{
/* Make a place for a REG_NOTE and add it. */
insn = emit_move_insn (to, to);
- REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL,
- gen_rtx (UNSIGNED_FIX, GET_MODE (to),
- copy_rtx (from)),
- REG_NOTES (insn));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_EQUAL,
+ gen_rtx_fmt_e (UNSIGNED_FIX,
+ GET_MODE (to),
+ copy_rtx (from)),
+ REG_NOTES (insn));
}
return;
}
@@ -3787,8 +3798,8 @@ expand_fix (to, from, unsignedp)
end_sequence ();
emit_libcall_block (insns, target, value,
- gen_rtx (unsignedp ? UNSIGNED_FIX : FIX,
- GET_MODE (to), from));
+ gen_rtx_fmt_e (unsignedp ? UNSIGNED_FIX : FIX,
+ GET_MODE (to), from));
}
if (target != to)
@@ -3867,7 +3878,7 @@ init_libfuncs (optable, first_mode, last_mode, opname, suffix)
*p++ = suffix;
*p++ = '\0';
optable->handlers[(int) mode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, libfunc_name);
+ = gen_rtx_SYMBOL_REF (Pmode, libfunc_name);
}
}
@@ -4058,181 +4069,192 @@ init_optabs ()
#ifdef MULSI3_LIBCALL
smul_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MULSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MULSI3_LIBCALL);
#endif
#ifdef MULDI3_LIBCALL
smul_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MULDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MULDI3_LIBCALL);
#endif
#ifdef DIVSI3_LIBCALL
sdiv_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, DIVSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, DIVSI3_LIBCALL);
#endif
#ifdef DIVDI3_LIBCALL
sdiv_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, DIVDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, DIVDI3_LIBCALL);
#endif
#ifdef UDIVSI3_LIBCALL
udiv_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UDIVSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UDIVSI3_LIBCALL);
#endif
#ifdef UDIVDI3_LIBCALL
udiv_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UDIVDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UDIVDI3_LIBCALL);
#endif
#ifdef MODSI3_LIBCALL
smod_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MODSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MODSI3_LIBCALL);
#endif
#ifdef MODDI3_LIBCALL
smod_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, MODDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, MODDI3_LIBCALL);
#endif
#ifdef UMODSI3_LIBCALL
umod_optab->handlers[(int) SImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UMODSI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UMODSI3_LIBCALL);
#endif
#ifdef UMODDI3_LIBCALL
umod_optab->handlers[(int) DImode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, UMODDI3_LIBCALL);
+ = gen_rtx_SYMBOL_REF (Pmode, UMODDI3_LIBCALL);
#endif
/* Use cabs for DC complex abs, since systems generally have cabs.
Don't define any libcall for SCmode, so that cabs will be used. */
abs_optab->handlers[(int) DCmode].libfunc
- = gen_rtx (SYMBOL_REF, Pmode, "cabs");
+ = gen_rtx_SYMBOL_REF (Pmode, "cabs");
/* The ffs function operates on `int'. */
#ifndef INT_TYPE_SIZE
#define INT_TYPE_SIZE BITS_PER_WORD
#endif
ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)] .libfunc
- = gen_rtx (SYMBOL_REF, Pmode, "ffs");
-
- extendsfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extendsfdf2");
- extendsfxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extendsfxf2");
- extendsftf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extendsftf2");
- extenddfxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extenddfxf2");
- extenddftf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__extenddftf2");
-
- truncdfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__truncdfsf2");
- truncxfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__truncxfsf2");
- trunctfsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__trunctfsf2");
- truncxfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__truncxfdf2");
- trunctfdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__trunctfdf2");
-
- memcpy_libfunc = gen_rtx (SYMBOL_REF, Pmode, "memcpy");
- bcopy_libfunc = gen_rtx (SYMBOL_REF, Pmode, "bcopy");
- memcmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "memcmp");
- bcmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gcc_bcmp");
- memset_libfunc = gen_rtx (SYMBOL_REF, Pmode, "memset");
- bzero_libfunc = gen_rtx (SYMBOL_REF, Pmode, "bzero");
-
- throw_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__throw");
- sjthrow_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__sjthrow");
- sjpopnthrow_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__sjpopnthrow");
- terminate_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__terminate");
+ = gen_rtx_SYMBOL_REF (Pmode, "ffs");
+
+ extendsfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extendsfdf2");
+ extendsfxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extendsfxf2");
+ extendsftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extendsftf2");
+ extenddfxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extenddfxf2");
+ extenddftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__extenddftf2");
+
+ truncdfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__truncdfsf2");
+ truncxfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__truncxfsf2");
+ trunctfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__trunctfsf2");
+ truncxfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__truncxfdf2");
+ trunctfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__trunctfdf2");
+
+ memcpy_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memcpy");
+ bcopy_libfunc = gen_rtx_SYMBOL_REF (Pmode, "bcopy");
+ memcmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memcmp");
+ bcmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gcc_bcmp");
+ memset_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memset");
+ bzero_libfunc = gen_rtx_SYMBOL_REF (Pmode, "bzero");
+
+ throw_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__throw");
+ sjthrow_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__sjthrow");
+ sjpopnthrow_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__sjpopnthrow");
+ terminate_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__terminate");
+ eh_rtime_match_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eh_rtime_match");
#ifndef DONT_USE_BUILTIN_SETJMP
- setjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__builtin_setjmp");
- longjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__builtin_longjmp");
+ setjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__builtin_setjmp");
+ longjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__builtin_longjmp");
#else
- setjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "setjmp");
- longjmp_libfunc = gen_rtx (SYMBOL_REF, Pmode, "longjmp");
+ setjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "setjmp");
+ longjmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "longjmp");
#endif
- eqhf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqhf2");
- nehf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nehf2");
- gthf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gthf2");
- gehf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gehf2");
- lthf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lthf2");
- lehf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lehf2");
-
- eqsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqsf2");
- nesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nesf2");
- gtsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gtsf2");
- gesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gesf2");
- ltsf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ltsf2");
- lesf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lesf2");
-
- eqdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqdf2");
- nedf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nedf2");
- gtdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gtdf2");
- gedf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gedf2");
- ltdf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ltdf2");
- ledf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ledf2");
-
- eqxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqxf2");
- nexf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__nexf2");
- gtxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gtxf2");
- gexf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gexf2");
- ltxf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__ltxf2");
- lexf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lexf2");
-
- eqtf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__eqtf2");
- netf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__netf2");
- gttf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__gttf2");
- getf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__getf2");
- lttf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__lttf2");
- letf2_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__letf2");
-
- floatsisf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsisf");
- floatdisf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatdisf");
- floattisf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattisf");
-
- floatsidf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsidf");
- floatdidf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatdidf");
- floattidf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattidf");
-
- floatsixf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsixf");
- floatdixf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatdixf");
- floattixf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattixf");
-
- floatsitf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatsitf");
- floatditf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floatditf");
- floattitf_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__floattitf");
-
- fixsfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixsfsi");
- fixsfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixsfdi");
- fixsfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixsfti");
-
- fixdfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixdfsi");
- fixdfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixdfdi");
- fixdfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixdfti");
-
- fixxfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixxfsi");
- fixxfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixxfdi");
- fixxfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixxfti");
-
- fixtfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixtfsi");
- fixtfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixtfdi");
- fixtfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixtfti");
-
- fixunssfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunssfsi");
- fixunssfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunssfdi");
- fixunssfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunssfti");
-
- fixunsdfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsdfsi");
- fixunsdfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsdfdi");
- fixunsdfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsdfti");
-
- fixunsxfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsxfsi");
- fixunsxfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsxfdi");
- fixunsxfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunsxfti");
-
- fixunstfsi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunstfsi");
- fixunstfdi_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunstfdi");
- fixunstfti_libfunc = gen_rtx (SYMBOL_REF, Pmode, "__fixunstfti");
+ eqhf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqhf2");
+ nehf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nehf2");
+ gthf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gthf2");
+ gehf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gehf2");
+ lthf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lthf2");
+ lehf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lehf2");
+
+ eqsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqsf2");
+ nesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nesf2");
+ gtsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gtsf2");
+ gesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gesf2");
+ ltsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ltsf2");
+ lesf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lesf2");
+
+ eqdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqdf2");
+ nedf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nedf2");
+ gtdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gtdf2");
+ gedf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gedf2");
+ ltdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ltdf2");
+ ledf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ledf2");
+
+ eqxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqxf2");
+ nexf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__nexf2");
+ gtxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gtxf2");
+ gexf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gexf2");
+ ltxf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__ltxf2");
+ lexf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lexf2");
+
+ eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__eqtf2");
+ netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__netf2");
+ gttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gttf2");
+ getf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__getf2");
+ lttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__lttf2");
+ letf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__letf2");
+
+ floatsisf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsisf");
+ floatdisf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatdisf");
+ floattisf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattisf");
+
+ floatsidf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsidf");
+ floatdidf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatdidf");
+ floattidf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattidf");
+
+ floatsixf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsixf");
+ floatdixf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatdixf");
+ floattixf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattixf");
+
+ floatsitf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatsitf");
+ floatditf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floatditf");
+ floattitf_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__floattitf");
+
+ fixsfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixsfsi");
+ fixsfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixsfdi");
+ fixsfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixsfti");
+
+ fixdfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixdfsi");
+ fixdfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixdfdi");
+ fixdfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixdfti");
+
+ fixxfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixxfsi");
+ fixxfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixxfdi");
+ fixxfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixxfti");
+
+ fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixtfsi");
+ fixtfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixtfdi");
+ fixtfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixtfti");
+
+ fixunssfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunssfsi");
+ fixunssfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunssfdi");
+ fixunssfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunssfti");
+
+ fixunsdfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsdfsi");
+ fixunsdfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsdfdi");
+ fixunsdfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsdfti");
+
+ fixunsxfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsxfsi");
+ fixunsxfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsxfdi");
+ fixunsxfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunsxfti");
+
+ fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunstfsi");
+ fixunstfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunstfdi");
+ fixunstfti_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__fixunstfti");
/* For check-memory-usage. */
- chkr_check_addr_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_check_addr");
- chkr_set_right_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_set_right");
- chkr_copy_bitmap_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_copy_bitmap");
- chkr_check_exec_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_check_exec");
- chkr_check_str_libfunc = gen_rtx (SYMBOL_REF, VOIDmode, "chkr_check_str");
+ chkr_check_addr_libfunc = gen_rtx_SYMBOL_REF (VOIDmode, "chkr_check_addr");
+ chkr_set_right_libfunc = gen_rtx_SYMBOL_REF (VOIDmode, "chkr_set_right");
+ chkr_copy_bitmap_libfunc = gen_rtx_SYMBOL_REF (VOIDmode, "chkr_copy_bitmap");
+ chkr_check_exec_libfunc = gen_rtx_SYMBOL_REF (VOIDmode, "chkr_check_exec");
+ chkr_check_str_libfunc = gen_rtx_SYMBOL_REF (VOIDmode, "chkr_check_str");
+
+ /* For function entry/exit instrumentation. */
+ profile_function_entry_libfunc
+ = gen_rtx_SYMBOL_REF (VOIDmode, "__cyg_profile_func_enter");
+ profile_function_exit_libfunc
+ = gen_rtx_SYMBOL_REF (VOIDmode, "__cyg_profile_func_exit");
+
+#ifdef HAVE_conditional_trap
+ init_traps ();
+#endif
#ifdef INIT_TARGET_OPTABS
/* Allow the target to add more libcalls or rename some, etc. */
@@ -4261,3 +4283,49 @@ ldexp(x,n)
return x;
}
#endif /* BROKEN_LDEXP */
+
+#ifdef HAVE_conditional_trap
+/* The insn generating function can not take an rtx_code argument.
+ TRAP_RTX is used as an rtx argument. Its code is replaced with
+ the code to be used in the trap insn and all other fields are
+ ignored.
+
+ ??? Will need to change to support garbage collection. */
+static rtx trap_rtx;
+
+static void
+init_traps ()
+{
+ if (HAVE_conditional_trap)
+ trap_rtx = gen_rtx_fmt_ee (EQ, VOIDmode, NULL_RTX, NULL_RTX);
+}
+#endif
+
+/* Generate insns to trap with code TCODE if OP1 and OP2 satisfy condition
+ CODE. Return 0 on failure. */
+
+rtx
+gen_cond_trap (code, op1, op2, tcode)
+ enum rtx_code code;
+ rtx op1, op2, tcode;
+{
+ enum machine_mode mode = GET_MODE (op1);
+
+ if (mode == VOIDmode)
+ return 0;
+
+#ifdef HAVE_conditional_trap
+ if (HAVE_conditional_trap
+ && cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+ {
+ rtx insn;
+ emit_insn (GEN_FCN (cmp_optab->handlers[(int) mode].insn_code) (op1, op2));
+ PUT_CODE (trap_rtx, code);
+ insn = gen_conditional_trap (trap_rtx, tcode);
+ if (insn)
+ return insn;
+ }
+#endif
+
+ return 0;
+}
diff --git a/gcc/output.h b/gcc/output.h
index de06f45b956..1d1a2afd8cd 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -83,6 +83,15 @@ extern void output_operand_lossage PROTO((char *));
Defined in final.c. */
extern void output_asm_insn PROTO((char *, rtx *));
+/* Compute a worst-case reference address of a branch so that it
+ can be safely used in the presence of aligned labels.
+ Defined in final.c. */
+extern int insn_current_reference_address PROTO((rtx));
+
+/* Find the alignment associated with a CODE_LABEL.
+ Defined in final.c. */
+extern int label_to_alignment PROTO((rtx));
+
/* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */
extern void output_asm_label PROTO((rtx));
@@ -119,7 +128,10 @@ extern void allocate_for_life_analysis PROTO((void));
extern int regno_uninitialized PROTO((int));
extern int regno_clobbered_at_setjmp PROTO((int));
extern void dump_flow_info PROTO((FILE *));
-extern void flow_analysis PROTO((rtx, int, FILE *));
+extern void find_basic_blocks PROTO((rtx, int, FILE *, int));
+extern void free_basic_block_vars PROTO((int));
+extern void set_block_num PROTO((rtx, int));
+extern void life_analysis PROTO((rtx, int, FILE *));
#endif
/* Functions in varasm.c. */
@@ -137,6 +149,10 @@ extern void readonly_data_section PROTO((void));
/* Determine if we're in the text section. */
extern int in_text_section PROTO((void));
+#ifdef EH_FRAME_SECTION_ASM_OP
+extern void eh_frame_section PROTO ((void));
+#endif
+
#ifdef TREE_CODE
/* Tell assembler to change to section NAME for DECL.
If DECL is NULL, just switch to section NAME.
@@ -155,6 +171,13 @@ extern void exception_section PROTO((void));
The rtl is stored into DECL. */
extern void make_function_rtl PROTO((tree));
+/* Declare DECL to be a weak symbol. */
+extern void declare_weak PROTO ((tree));
+#endif /* TREE_CODE */
+
+/* Emit any pending weak declarations. */
+extern void weak_finish PROTO ((void));
+
/* Decode an `asm' spec for a declaration as a register name.
Return the register number, or -1 if nothing specified,
or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
@@ -164,6 +187,7 @@ extern void make_function_rtl PROTO((tree));
Prefixes such as % are optional. */
extern int decode_reg_name PROTO((char *));
+#ifdef TREE_CODE
/* Create the DECL_RTL for a declaration for a static or external variable
or static or external function.
ASMSPEC, if not 0, is the string which the user specified
@@ -180,6 +204,8 @@ extern void make_var_volatile PROTO((tree));
/* Output alignment directive to align for constant expression EXP. */
extern void assemble_constant_align PROTO((tree));
+extern void assemble_alias PROTO((tree, tree));
+
/* Output a string of literal assembler code
for an `asm' keyword used between functions. */
extern void assemble_asm PROTO((tree));
@@ -232,7 +258,7 @@ extern void assemble_variable PROTO((tree, int, int, int));
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
extern void assemble_external PROTO((tree));
-#endif
+#endif /* TREE_CODE */
#ifdef RTX_CODE
/* Similar, for calling a library function FUN. */
@@ -418,6 +444,9 @@ extern int current_function_uses_pic_offset_table;
/* This is nonzero if the current function uses the constant pool. */
extern int current_function_uses_const_pool;
+/* Language-specific reason why the current function cannot be made inline. */
+extern char *current_function_cannot_inline;
+
/* The line number of the beginning of the current function.
sdbout.c needs this so that it can output relative linenumbers. */
diff --git a/gcc/pexecute.c b/gcc/pexecute.c
deleted file mode 100644
index 29148159202..00000000000
--- a/gcc/pexecute.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/* Utilities to execute a program in a subprocess (possibly linked by pipes
- with other subprocesses), and wait for it.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB. If not,
-write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file exports two functions: pexecute and pwait. */
-
-/* This file lives in at least two places: libiberty and gcc.
- Don't change one without the other. */
-
-#ifdef IN_GCC
-#include "config.h"
-#endif
-
-#include "system.h"
-
-#ifdef IN_GCC
-#include "gansidecl.h"
-/* ??? Need to find a suitable header file. */
-#define PEXECUTE_FIRST 1
-#define PEXECUTE_LAST 2
-#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
-#define PEXECUTE_SEARCH 4
-#define PEXECUTE_VERBOSE 8
-#else
-#include "libiberty.h"
-#endif
-
-/* stdin file number. */
-#define STDIN_FILE_NO 0
-
-/* stdout file number. */
-#define STDOUT_FILE_NO 1
-
-/* value of `pipe': port index for reading. */
-#define READ_PORT 0
-
-/* value of `pipe': port index for writing. */
-#define WRITE_PORT 1
-
-static char *install_error_msg = "installation problem, cannot exec `%s'";
-
-/* pexecute: execute a program.
-
- PROGRAM and ARGV are the arguments to execv/execvp.
-
- THIS_PNAME is name of the calling program (i.e. argv[0]).
-
- TEMP_BASE is the path name, sans suffix, of a temporary file to use
- if needed. This is currently only needed for MSDOS ports that don't use
- GO32 (do any still exist?). Ports that don't need it can pass NULL.
-
- (FLAGS & PEXECUTE_SEARCH) is non-zero if $PATH should be searched
- (??? It's not clear that GCC passes this flag correctly).
- (FLAGS & PEXECUTE_FIRST) is nonzero for the first process in chain.
- (FLAGS & PEXECUTE_FIRST) is nonzero for the last process in chain.
- FIRST_LAST could be simplified to only mark the last of a chain of processes
- but that requires the caller to always mark the last one (and not give up
- early if some error occurs). It's more robust to require the caller to
- mark both ends of the chain.
-
- The result is the pid on systems like Unix where we fork/exec and on systems
- like WIN32 and OS2 where we use spawn. It is up to the caller to wait for
- the child.
-
- The result is the WEXITSTATUS on systems like MSDOS where we spawn and wait
- for the child here.
-
- Upon failure, ERRMSG_FMT and ERRMSG_ARG are set to the text of the error
- message with an optional argument (if not needed, ERRMSG_ARG is set to
- NULL), and -1 is returned. `errno' is available to the caller to use.
-
- pwait: cover function for wait.
-
- PID is the process id of the task to wait for.
- STATUS is the `status' argument to wait.
- FLAGS is currently unused (allows future enhancement without breaking
- upward compatibility). Pass 0 for now.
-
- The result is the pid of the child reaped,
- or -1 for failure (errno says why).
-
- On systems that don't support waiting for a particular child, PID is
- ignored. On systems like MSDOS that don't really multitask pwait
- is just a mechanism to provide a consistent interface for the caller.
-
- pfinish: finish generation of script
-
- pfinish is necessary for systems like MPW where a script is generated that
- runs the requested programs.
-*/
-
-#ifdef __MSDOS__
-
-/* MSDOS doesn't multitask, but for the sake of a consistent interface
- the code behaves like it does. pexecute runs the program, tucks the
- exit code away, and returns a "pid". pwait must be called to fetch the
- exit code. */
-
-#include <process.h>
-
-/* For communicating information from pexecute to pwait. */
-static int last_pid = 0;
-static int last_status = 0;
-static int last_reaped = 0;
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int rc;
-
- last_pid++;
- if (last_pid < 0)
- last_pid = 1;
-
- if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
- abort ();
-
-#ifdef __GO32__
- /* ??? What are the possible return values from spawnv? */
- rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
-#else
- char *scmd, *rf;
- FILE *argfile;
- int i, el = flags & PEXECUTE_SEARCH ? 4 : 0;
-
- scmd = (char *) xmalloc (strlen (program) + strlen (temp_base) + 6 + el);
- rf = scmd + strlen(program) + 2 + el;
- sprintf (scmd, "%s%s @%s.gp", program,
- (flags & PEXECUTE_SEARCH ? ".exe" : ""), temp_base);
- argfile = fopen (rf, "w");
- if (argfile == 0)
- {
- int errno_save = errno;
- free (scmd);
- errno = errno_save;
- *errmsg_fmt = "cannot open `%s.gp'";
- *errmsg_arg = temp_base;
- return -1;
- }
-
- for (i=1; argv[i]; i++)
- {
- char *cp;
- for (cp = argv[i]; *cp; cp++)
- {
- if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp))
- fputc ('\\', argfile);
- fputc (*cp, argfile);
- }
- fputc ('\n', argfile);
- }
- fclose (argfile);
-
- rc = system (scmd);
-
- {
- int errno_save = errno;
- remove (rf);
- free (scmd);
- errno = errno_save;
- }
-#endif
-
- if (rc == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
-
- /* Tuck the status away for pwait, and return a "pid". */
- last_status = rc << 8;
- return last_pid;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* On MSDOS each pexecute must be followed by it's associated pwait. */
- if (pid != last_pid
- /* Called twice for the same child? */
- || pid == last_reaped)
- {
- /* ??? ECHILD would be a better choice. Can we use it here? */
- errno = EINVAL;
- return -1;
- }
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
- *status = last_status;
- last_reaped = last_pid;
- return last_pid;
-}
-
-#endif /* MSDOS */
-
-#if defined (_WIN32)
-
-#include <process.h>
-
-#ifdef __CYGWIN32__
-
-#define fix_argv(argvec) (argvec)
-
-extern int _spawnv ();
-extern int _spawnvp ();
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int pid;
-
- if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
- abort ();
- pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
- (_P_NOWAIT, program, fix_argv(argv));
- if (pid == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
- return pid;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
- return cwait (status, pid, WAIT_CHILD);
-}
-
-#else /* ! __CYGWIN32__ */
-
-/* This is a kludge to get around the Microsoft C spawn functions' propensity
- to remove the outermost set of double quotes from all arguments. */
-
-const char * const *
-fix_argv (argvec)
- char **argvec;
-{
- int i;
-
- for (i = 1; argvec[i] != 0; i++)
- {
- int len, j;
- char *temp, *newtemp;
-
- temp = argvec[i];
- len = strlen (temp);
- for (j = 0; j < len; j++)
- {
- if (temp[j] == '"')
- {
- newtemp = xmalloc (len + 2);
- strncpy (newtemp, temp, j);
- newtemp [j] = '\\';
- strncpy (&newtemp [j+1], &temp [j], len-j);
- newtemp [len+1] = 0;
- temp = newtemp;
- len++;
- j++;
- }
- }
-
- argvec[i] = temp;
- }
-
- return (const char * const *) argvec;
-}
-
-#include <io.h>
-#include <fcntl.h>
-#include <signal.h>
-
-/* mingw32 headers may not define the following. */
-
-#ifndef _P_WAIT
-# define _P_WAIT 0
-# define _P_NOWAIT 1
-# define _P_OVERLAY 2
-# define _P_NOWAITO 3
-# define _P_DETACH 4
-
-# define WAIT_CHILD 0
-# define WAIT_GRANDCHILD 1
-#endif
-
-/* Win32 supports pipes */
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int pid;
- int pdes[2], org_stdin, org_stdout;
- int input_desc, output_desc;
- int retries, sleep_interval;
-
- /* Pipe waiting from last process, to be used as input for the next one.
- Value is STDIN_FILE_NO if no pipe is waiting
- (i.e. the next command is the first of a group). */
- static int last_pipe_input;
-
- /* If this is the first process, initialize. */
- if (flags & PEXECUTE_FIRST)
- last_pipe_input = STDIN_FILE_NO;
-
- input_desc = last_pipe_input;
-
- /* If this isn't the last process, make a pipe for its output,
- and record it as waiting to be the input to the next process. */
- if (! (flags & PEXECUTE_LAST))
- {
- if (_pipe (pdes, 256, O_BINARY) < 0)
- {
- *errmsg_fmt = "pipe";
- *errmsg_arg = NULL;
- return -1;
- }
- output_desc = pdes[WRITE_PORT];
- last_pipe_input = pdes[READ_PORT];
- }
- else
- {
- /* Last process. */
- output_desc = STDOUT_FILE_NO;
- last_pipe_input = STDIN_FILE_NO;
- }
-
- if (input_desc != STDIN_FILE_NO)
- {
- org_stdin = dup (STDIN_FILE_NO);
- dup2 (input_desc, STDIN_FILE_NO);
- close (input_desc);
- }
-
- if (output_desc != STDOUT_FILE_NO)
- {
- org_stdout = dup (STDOUT_FILE_NO);
- dup2 (output_desc, STDOUT_FILE_NO);
- close (output_desc);
- }
-
- pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
- (_P_NOWAIT, program, fix_argv(argv));
-
- if (input_desc != STDIN_FILE_NO)
- {
- dup2 (org_stdin, STDIN_FILE_NO);
- close (org_stdin);
- }
-
- if (output_desc != STDOUT_FILE_NO)
- {
- dup2 (org_stdout, STDOUT_FILE_NO);
- close (org_stdout);
- }
-
- if (pid == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
-
- return pid;
-}
-
-/* MS CRTDLL doesn't return enough information in status to decide if the
- child exited due to a signal or not, rather it simply returns an
- integer with the exit code of the child; eg., if the child exited with
- an abort() call and didn't have a handler for SIGABRT, it simply returns
- with status = 3. We fix the status code to conform to the usual WIF*
- macros. Note that WIFSIGNALED will never be true under CRTDLL. */
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- int termstat;
-
- pid = _cwait (&termstat, pid, WAIT_CHILD);
-
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
-
- /* cwait returns the child process exit code in termstat.
- A value of 3 indicates that the child caught a signal, but not
- which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we
- report SIGABRT. */
- if (termstat == 3)
- *status = SIGABRT;
- else
- *status = (((termstat) & 0xff) << 8);
-
- return pid;
-}
-
-#endif /* ! defined (__CYGWIN32__) */
-
-#endif /* _WIN32 */
-
-#ifdef OS2
-
-/* ??? Does OS2 have process.h? */
-extern int spawnv ();
-extern int spawnvp ();
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int pid;
-
- if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
- abort ();
- /* ??? Presumably 1 == _P_NOWAIT. */
- pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
- if (pid == -1)
- {
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = program;
- return -1;
- }
- return pid;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
- int pid = wait (status);
- return pid;
-}
-
-#endif /* OS2 */
-
-#ifdef MPW
-
-/* MPW pexecute doesn't actually run anything; instead, it writes out
- script commands that, when run, will do the actual executing.
-
- For example, in GCC's case, GCC will write out several script commands:
-
- cpp ...
- cc1 ...
- as ...
- ld ...
-
- and then exit. None of the above programs will have run yet. The task
- that called GCC will then execute the script and cause cpp,etc. to run.
- The caller must invoke pfinish before calling exit. This adds
- the finishing touches to the generated script. */
-
-static int first_time = 1;
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- char tmpprogram[255];
- char *cp, *tmpname;
- int i;
-
- mpwify_filename (program, tmpprogram);
- if (first_time)
- {
- printf ("Set Failed 0\n");
- first_time = 0;
- }
-
- fputs ("If {Failed} == 0\n", stdout);
- /* If being verbose, output a copy of the command. It should be
- accurate enough and escaped enough to be "clickable". */
- if (flags & PEXECUTE_VERBOSE)
- {
- fputs ("\tEcho ", stdout);
- fputc ('\'', stdout);
- fputs (tmpprogram, stdout);
- fputc ('\'', stdout);
- fputc (' ', stdout);
- for (i=1; argv[i]; i++)
- {
- fputc ('\'', stdout);
- /* See if we have an argument that needs fixing. */
- if (strchr(argv[i], '/'))
- {
- tmpname = (char *) xmalloc (256);
- mpwify_filename (argv[i], tmpname);
- argv[i] = tmpname;
- }
- for (cp = argv[i]; *cp; cp++)
- {
- /* Write an Option-d escape char in front of special chars. */
- if (strchr("'+", *cp))
- fputc ('\266', stdout);
- fputc (*cp, stdout);
- }
- fputc ('\'', stdout);
- fputc (' ', stdout);
- }
- fputs ("\n", stdout);
- }
- fputs ("\t", stdout);
- fputs (tmpprogram, stdout);
- fputc (' ', stdout);
-
- for (i=1; argv[i]; i++)
- {
- /* See if we have an argument that needs fixing. */
- if (strchr(argv[i], '/'))
- {
- tmpname = (char *) xmalloc (256);
- mpwify_filename (argv[i], tmpname);
- argv[i] = tmpname;
- }
- if (strchr (argv[i], ' '))
- fputc ('\'', stdout);
- for (cp = argv[i]; *cp; cp++)
- {
- /* Write an Option-d escape char in front of special chars. */
- if (strchr("'+", *cp))
- fputc ('\266', stdout);
- fputc (*cp, stdout);
- }
- if (strchr (argv[i], ' '))
- fputc ('\'', stdout);
- fputc (' ', stdout);
- }
-
- fputs ("\n", stdout);
-
- /* Output commands that arrange to clean up and exit if a failure occurs.
- We have to be careful to collect the status from the program that was
- run, rather than some other script command. Also, we don't exit
- immediately, since necessary cleanups are at the end of the script. */
- fputs ("\tSet TmpStatus {Status}\n", stdout);
- fputs ("\tIf {TmpStatus} != 0\n", stdout);
- fputs ("\t\tSet Failed {TmpStatus}\n", stdout);
- fputs ("\tEnd\n", stdout);
- fputs ("End\n", stdout);
-
- /* We're just composing a script, can't fail here. */
- return 0;
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- *status = 0;
- return 0;
-}
-
-/* Write out commands that will exit with the correct error code
- if something in the script failed. */
-
-void
-pfinish ()
-{
- printf ("\tExit \"{Failed}\"\n");
-}
-
-#endif /* MPW */
-
-/* include for Unix-like environments but not for Dos-like environments */
-#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \
- && ! defined (_WIN32)
-
-#ifdef VMS
-#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
- lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
-#else
-#ifdef USG
-#define vfork fork
-#endif
-#endif
-
-extern int execv ();
-extern int execvp ();
-#ifdef IN_GCC
-extern char * my_strerror();
-#endif
-
-int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
-{
- int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv);
- int pid;
- int pdes[2];
- int input_desc, output_desc;
- int retries, sleep_interval;
- /* Pipe waiting from last process, to be used as input for the next one.
- Value is STDIN_FILE_NO if no pipe is waiting
- (i.e. the next command is the first of a group). */
- static int last_pipe_input;
-
- /* If this is the first process, initialize. */
- if (flags & PEXECUTE_FIRST)
- last_pipe_input = STDIN_FILE_NO;
-
- input_desc = last_pipe_input;
-
- /* If this isn't the last process, make a pipe for its output,
- and record it as waiting to be the input to the next process. */
- if (! (flags & PEXECUTE_LAST))
- {
- if (pipe (pdes) < 0)
- {
- *errmsg_fmt = "pipe";
- *errmsg_arg = NULL;
- return -1;
- }
- output_desc = pdes[WRITE_PORT];
- last_pipe_input = pdes[READ_PORT];
- }
- else
- {
- /* Last process. */
- output_desc = STDOUT_FILE_NO;
- last_pipe_input = STDIN_FILE_NO;
- }
-
- /* Fork a subprocess; wait and retry if it fails. */
- sleep_interval = 1;
- for (retries = 0; retries < 4; retries++)
- {
- pid = vfork ();
- if (pid >= 0)
- break;
- sleep (sleep_interval);
- sleep_interval *= 2;
- }
-
- switch (pid)
- {
- case -1:
- {
-#ifdef vfork
- *errmsg_fmt = "fork";
-#else
- *errmsg_fmt = "vfork";
-#endif
- *errmsg_arg = NULL;
- return -1;
- }
-
- case 0: /* child */
- /* Move the input and output pipes into place, if necessary. */
- if (input_desc != STDIN_FILE_NO)
- {
- close (STDIN_FILE_NO);
- dup (input_desc);
- close (input_desc);
- }
- if (output_desc != STDOUT_FILE_NO)
- {
- close (STDOUT_FILE_NO);
- dup (output_desc);
- close (output_desc);
- }
-
- /* Close the parent's descs that aren't wanted here. */
- if (last_pipe_input != STDIN_FILE_NO)
- close (last_pipe_input);
-
- /* Exec the program. */
- (*func) (program, argv);
-
- /* Note: Calling fprintf and exit here doesn't seem right for vfork. */
- fprintf (stderr, "%s: ", this_pname);
- fprintf (stderr, install_error_msg, program);
-#ifdef IN_GCC
- fprintf (stderr, ": %s\n", my_strerror (errno));
-#else
- fprintf (stderr, ": %s\n", xstrerror (errno));
-#endif
- exit (-1);
- /* NOTREACHED */
- return 0;
-
- default:
- /* In the parent, after forking.
- Close the descriptors that we made for this child. */
- if (input_desc != STDIN_FILE_NO)
- close (input_desc);
- if (output_desc != STDOUT_FILE_NO)
- close (output_desc);
-
- /* Return child's process number. */
- return pid;
- }
-}
-
-int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
-{
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
-#ifdef VMS
- pid = waitpid (-1, status, 0);
-#else
- pid = wait (status);
-#endif
- return pid;
-}
-
-#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! _WIN32 */
diff --git a/gcc/prefix.c b/gcc/prefix.c
index 1c96c58e54a..778600bff8d 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -64,11 +64,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#ifdef _WIN32
#include <windows.h>
@@ -255,7 +250,7 @@ translate_name (name)
keylen++)
;
- key = alloca (keylen + 1);
+ key = (char *) alloca (keylen + 1);
strncpy (key, &name[1], keylen);
key[keylen] = 0;
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 2bdc6122c8d..e3b36fe0a26 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -22,6 +22,9 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "rtl.h"
+#include "bitmap.h"
+#include "real.h"
+#include "flags.h"
/* How to print out a register name.
@@ -52,6 +55,11 @@ static int indent;
extern char **insn_name_ptr;
+/* Nonzero means suppress output of instruction numbers and line number
+ notes in debugging dumps.
+ This must be defined here so that programs like gencodes can be linked. */
+int flag_dump_unnumbered = 0;
+
/* Print IN_RTX onto OUTFILE. This is the recursive part of printing. */
static void
@@ -110,12 +118,28 @@ print_rtx (in_rtx)
case 's':
if (i == 3 && GET_CODE (in_rtx) == NOTE
&& (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END))
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END))
{
fprintf (outfile, " %d", NOTE_BLOCK_NUMBER (in_rtx));
sawclose = 1;
break;
}
+
+ if (i == 3 && GET_CODE (in_rtx) == NOTE
+ && (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_RANGE_START
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_RANGE_END
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_LIVE))
+ {
+ indent += 2;
+ if (!sawclose)
+ fprintf (outfile, " ");
+ print_rtx (NOTE_RANGE_INFO (in_rtx));
+ indent -= 2;
+ break;
+ }
+
if (XSTR (in_rtx, i) == 0)
fprintf (outfile, " \"\"");
else
@@ -179,6 +203,9 @@ print_rtx (in_rtx)
fputc (' ', outfile);
DEBUG_PRINT_REG (in_rtx, 0, outfile);
}
+ else if (flag_dump_unnumbered
+ && (is_insn || GET_CODE (in_rtx) == NOTE))
+ fprintf (outfile, "#");
else
fprintf (outfile, " %d", value);
}
@@ -201,12 +228,30 @@ print_rtx (in_rtx)
case 'u':
if (XEXP (in_rtx, i) != NULL)
- fprintf (outfile, " %d", INSN_UID (XEXP (in_rtx, i)));
+ {
+ if (flag_dump_unnumbered)
+ fprintf (outfile, "#");
+ else
+ fprintf (outfile, " %d", INSN_UID (XEXP (in_rtx, i)));
+ }
else
fprintf (outfile, " 0");
sawclose = 0;
break;
+ case 'b':
+ if (XBITMAP (in_rtx, i) == NULL)
+ fprintf (outfile, " {null}");
+ else
+ bitmap_print (outfile, XBITMAP (in_rtx, i), " {", "}");
+ sawclose = 0;
+ break;
+
+ case 't':
+ putc (' ', outfile);
+ fprintf (outfile, HOST_PTR_PRINTF, (char *) XTREE (in_rtx, i));
+ break;
+
case '*':
fprintf (outfile, " Unknown");
sawclose = 0;
@@ -219,6 +264,18 @@ print_rtx (in_rtx)
abort ();
}
+ if (GET_CODE (in_rtx) == MEM)
+ fprintf (outfile, " %d", MEM_ALIAS_SET (in_rtx));
+
+#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT && LONG_DOUBLE_TYPE_SIZE == 64
+ if (GET_CODE (in_rtx) == CONST_DOUBLE && FLOAT_MODE_P (GET_MODE (in_rtx)))
+ {
+ double val;
+ REAL_VALUE_FROM_CONST_DOUBLE (val, in_rtx);
+ fprintf (outfile, " [%.16g]", val);
+ }
+#endif
+
fprintf (outfile, ")");
sawclose = 1;
}
@@ -341,8 +398,13 @@ print_rtl (outf, rtx_first)
case BARRIER:
for (tmp_rtx = rtx_first; NULL != tmp_rtx; tmp_rtx = NEXT_INSN (tmp_rtx))
{
- print_rtx (tmp_rtx);
- fprintf (outfile, "\n");
+ if (! flag_dump_unnumbered
+ || GET_CODE (tmp_rtx) != NOTE
+ || NOTE_LINE_NUMBER (tmp_rtx) < 0)
+ {
+ print_rtx (tmp_rtx);
+ fprintf (outfile, "\n");
+ }
}
break;
@@ -352,14 +414,21 @@ print_rtl (outf, rtx_first)
}
/* Like print_rtx, except specify a file. */
+/* Return nonzero if we actually printed anything. */
-void
+int
print_rtl_single (outf, x)
FILE *outf;
rtx x;
{
outfile = outf;
sawclose = 0;
- print_rtx (x);
- putc ('\n', outf);
+ if (! flag_dump_unnumbered
+ || GET_CODE (x) != NOTE || NOTE_LINE_NUMBER (x) < 0)
+ {
+ print_rtx (x);
+ putc ('\n', outf);
+ return 1;
+ }
+ return 0;
}
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index d7ceb10a4df..096218fac1d 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -481,6 +481,7 @@ print_node (file, prefix, node, indent)
fprintf (file, " align %d", TYPE_ALIGN (node));
fprintf (file, " symtab %d", TYPE_SYMTAB_ADDRESS (node));
+ fprintf (file, " alias set %d", TYPE_ALIAS_SET (node));
print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4);
diff --git a/gcc/profile.c b/gcc/profile.c
index 060ecfc81af..b06f91bb4fc 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -957,7 +957,10 @@ branch_prob (f, dump_file)
/* For each arc not on the spanning tree, add counting code as rtl. */
if (profile_arc_flag)
- instrument_arcs (f, num_blocks, dump_file);
+ {
+ instrument_arcs (f, num_blocks, dump_file);
+ allocate_reg_info (max_reg_num (), FALSE, FALSE);
+ }
/* Execute the rest only if doing branch probabilities. */
if (! flag_branch_probabilities)
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 4b5b13f3a42..a7a5ae92e2b 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -57,11 +57,6 @@ Boston, MA 02111-1307, USA. */
#define _POSIX_SOURCE
#endif
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include <sys/stat.h>
#if ! defined (_WIN32) || defined (__CYGWIN32__)
@@ -93,13 +88,6 @@ Boston, MA 02111-1307, USA. */
#include "getopt.h"
#undef getopt
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else
-extern char *strerror();
-#endif
-
extern char *version_string;
/* Systems which are compatible only with POSIX 1003.1-1988 (but *not*
@@ -123,6 +111,7 @@ extern char *version_string;
extern char *getpwd ();
extern char *choose_temp_base PROTO ((void));
+extern char * my_strerror PROTO ((int));
extern int pexecute PROTO ((const char *, char * const *, const char *,
const char *, char **, char **, int));
@@ -201,14 +190,6 @@ extern size_t strlen ()
#define NONCONST
-/* Define a STRINGIFY macro that's right for ANSI or traditional C. */
-
-#if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__))
-#define STRINGIFY(STRING) #STRING
-#else
-#define STRINGIFY(STRING) "STRING"
-#endif
-
/* Define a default place to find the SYSCALLS.X file. */
#ifndef STD_PROTO_DIR
@@ -1931,7 +1912,7 @@ save_def_or_dec (l, is_syscalls)
}
/* Handle a special case. If we have a function definition marked as
- being in "old" style, and if it's formal names list is empty, then
+ being in "old" style, and if its formal names list is empty, then
it may actually have the string "void" in its real formals list
in the original source code. Just to make sure, we will get setup
to convert such things anyway.
@@ -2781,7 +2762,7 @@ connect_defs_and_decs (hp)
Also, for each item which is only a function declaration, but which
nonetheless has its own prototype already (obviously supplied by the user)
- declare the item as it's own definition.
+ declare the item as its own definition.
Note that when/if there are multiple user-supplied prototypes already
present for multiple declarations of any given function, these multiple
diff --git a/gcc/real.c b/gcc/real.c
index ac560499d61..ed854e02625 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -51,7 +51,7 @@ XFmode and TFmode transcendental functions, can be obtained by ftp from
netlib.att.com: netlib/cephes. */
/* Type of computer arithmetic.
- Only one of DEC, IBM, IEEE, or UNK should get defined.
+ Only one of DEC, IBM, IEEE, C4X, or UNK should get defined.
`IEEE', when REAL_WORDS_BIG_ENDIAN is non-zero, refers generically
to big-endian IEEE floating-point data structure. This definition
@@ -76,6 +76,11 @@ netlib.att.com: netlib/cephes. */
no type wider than DFmode. The IBM conversions were contributed by
frank@atom.ansto.gov.au (Frank Crawford).
+ `C4X' refers specifically to the floating point format used on
+ Texas Instruments TMS320C3x and TMS320C4x digital signal
+ processors. This supports QFmode (32-bit float, double) and HFmode
+ (40-bit long double) where BITS_PER_BYTE is 32.
+
If LONG_DOUBLE_TYPE_SIZE = 64 (the default, unless tm.h defines it)
then `long double' and `double' are both implemented, but they
both mean DFmode. In this case, the software floating-point
@@ -325,7 +330,9 @@ static void endian PROTO((unsigned EMUSHORT *, long *,
enum machine_mode));
static void eclear PROTO((unsigned EMUSHORT *));
static void emov PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+#if 0
static void eabs PROTO((unsigned EMUSHORT *));
+#endif
static void eneg PROTO((unsigned EMUSHORT *));
static int eisneg PROTO((unsigned EMUSHORT *));
static int eisinf PROTO((unsigned EMUSHORT *));
@@ -340,7 +347,9 @@ static void emovz PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void einan PROTO((unsigned EMUSHORT *));
static int eiisnan PROTO((unsigned EMUSHORT *));
static int eiisneg PROTO((unsigned EMUSHORT *));
+#if 0
static void eiinfin PROTO((unsigned EMUSHORT *));
+#endif
static int eiisinf PROTO((unsigned EMUSHORT *));
static int ecmpm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void eshdn1 PROTO((unsigned EMUSHORT *));
@@ -379,7 +388,9 @@ static void toe53 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void etoe24 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void toe24 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static int ecmp PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+#if 0
static void eround PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
+#endif
static void ltoe PROTO((HOST_WIDE_INT *, unsigned EMUSHORT *));
static void ultoe PROTO((unsigned HOST_WIDE_INT *, unsigned EMUSHORT *));
static void eifrac PROTO((unsigned EMUSHORT *, HOST_WIDE_INT *,
@@ -388,10 +399,12 @@ static void euifrac PROTO((unsigned EMUSHORT *, unsigned HOST_WIDE_INT *,
unsigned EMUSHORT *));
static int eshift PROTO((unsigned EMUSHORT *, int));
static int enormlz PROTO((unsigned EMUSHORT *));
+#if 0
static void e24toasc PROTO((unsigned EMUSHORT *, char *, int));
static void e53toasc PROTO((unsigned EMUSHORT *, char *, int));
static void e64toasc PROTO((unsigned EMUSHORT *, char *, int));
static void e113toasc PROTO((unsigned EMUSHORT *, char *, int));
+#endif /* 0 */
static void etoasc PROTO((unsigned EMUSHORT *, char *, int));
static void asctoe24 PROTO((char *, unsigned EMUSHORT *));
static void asctoe53 PROTO((char *, unsigned EMUSHORT *));
@@ -678,7 +691,16 @@ ereal_atof (s, t)
switch (t)
{
+#ifdef C4X
+ case QFmode:
case HFmode:
+ asctoe53 (s, tem);
+ e53toe (tem, e);
+ break;
+#else
+ case HFmode:
+#endif
+
case SFmode:
asctoe24 (s, tem);
e24toe (tem, e);
@@ -1037,11 +1059,21 @@ real_value_truncate (mode, arg)
break;
case SFmode:
+#ifndef C4X
case HFmode:
+#endif
etoe24 (e, t);
e24toe (t, t);
break;
+#ifdef C4X
+ case HFmode:
+ case QFmode:
+ etoe53 (e, t);
+ e53toe (t, t);
+ break;
+#endif
+
case SImode:
r = etrunci (arg);
return (r);
@@ -1292,7 +1324,9 @@ ereal_isneg (x)
e53toe (&d, e) IEEE double precision to e type
e64toe (&d, e) IEEE long double precision to e type
e113toe (&d, e) 128-bit long double precision to e type
+#if 0
eabs (e) absolute value
+#endif
eadd (a, b, c) c = b + a
eclear (e) e = 0
ecmp (a, b) Returns 1 if a > b, 0 if a == b,
@@ -1307,12 +1341,16 @@ ereal_isneg (x)
emov (a, b) b = a
emul (a, b, c) c = b * a
eneg (e) e = -e
+#if 0
eround (a, b) b = nearest integer value to a
+#endif
esub (a, b, c) c = b - a
+#if 0
e24toasc (&f, str, n) single to ASCII string, n digits after decimal
e53toasc (&d, str, n) double to ASCII string, n digits after decimal
e64toasc (&d, str, n) 80-bit long double to ASCII string
e113toasc (&d, str, n) 128-bit long double to ASCII string
+#endif
etoasc (e, str, n) e to ASCII string, n digits after decimal
etoe24 (e, &f) convert e type to IEEE single precision
etoe53 (e, &d) convert e type to IEEE double precision
@@ -1350,7 +1388,9 @@ ereal_isneg (x)
eiisnan (ai) 1 if a NaN
eiisneg (ai) 1 if sign bit of ai != 0, else 0
einan (ai) set ai = NaN
+#if 0
eiinfin (ai) set ai = infinity
+#endif
The result is always normalized and rounded to NI-4 word precision
after each arithmetic operation.
@@ -1520,6 +1560,7 @@ emov (a, b)
}
+#if 0
/* Absolute value of e-type X. */
static void
@@ -1529,6 +1570,7 @@ eabs (x)
/* sign is top bit of last word of external format */
x[NE - 1] &= 0x7fff;
}
+#endif /* 0 */
/* Negate the e-type number X. */
@@ -1821,6 +1863,7 @@ eiisneg (x)
return x[0] != 0;
}
+#if 0
/* Fill exploded e-type X with infinity pattern.
This has maximum exponent and significand all zeros. */
@@ -1832,6 +1875,7 @@ eiinfin (x)
ecleaz (x);
x[E] = 0x7fff;
}
+#endif /* 0 */
/* Return nonzero if exploded e-type X is infinite. */
@@ -3694,7 +3738,7 @@ toe53 (x, y)
#else /* it's neither DEC nor IBM */
#ifdef C4X
-/* Convert e-type X to C4X-format double E. */
+/* Convert e-type X to C4X-format long double E. */
static void
etoe53 (x, e)
@@ -4083,6 +4127,7 @@ ecmp (a, b)
return (-msign); /* p is littler */
}
+#if 0
/* Find e-type nearest integer to X, as floor (X + 0.5). */
static void
@@ -4092,6 +4137,7 @@ eround (x, y)
eadd (ehalf, x, y);
efloor (y, y);
}
+#endif /* 0 */
/* Convert HOST_WIDE_INT LP to e type Y. */
@@ -4563,6 +4609,7 @@ static unsigned EMUSHORT emtens[NTEN + 1][NE] =
};
#endif
+#if 0
/* Convert float value X to ASCII string STRING with NDIG digits after
the decimal point. */
@@ -4622,6 +4669,7 @@ e113toasc (x, string, ndigs)
e113toe (x, w);
etoasc (w, string, ndigs);
}
+#endif /* 0 */
/* Convert e-type X to ASCII string STRING with NDIGS digits after
the decimal point. */
diff --git a/gcc/real.h b/gcc/real.h
index 848ef184f2f..0719c26654d 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -264,10 +264,18 @@ typedef struct {
value in host format and then to a single type `long' value which
is the bitwise equivalent of the `float' value. */
#ifndef REAL_VALUE_TO_TARGET_SINGLE
-#define REAL_VALUE_TO_TARGET_SINGLE(IN, OUT) \
-do { float f = (float) (IN); \
- (OUT) = *(long *) &f; \
- } while (0)
+#define REAL_VALUE_TO_TARGET_SINGLE(IN, OUT) \
+do { \
+ union { \
+ float f; \
+ HOST_WIDE_INT l; \
+ } u; \
+ if (sizeof(HOST_WIDE_INT) < sizeof(float)) \
+ abort(); \
+ u.l = 0; \
+ u.f = (IN); \
+ (OUT) = u.l; \
+} while (0)
#endif
/* Convert a type `double' value in host format to a pair of type `long'
@@ -275,18 +283,20 @@ do { float f = (float) (IN); \
proper word order for the target. */
#ifndef REAL_VALUE_TO_TARGET_DOUBLE
#define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) \
-do { REAL_VALUE_TYPE in = (IN); /* Make sure it's not in a register. */\
- if (HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN) \
- { \
- (OUT)[0] = ((long *) &in)[0]; \
- (OUT)[1] = ((long *) &in)[1]; \
- } \
- else \
- { \
- (OUT)[1] = ((long *) &in)[0]; \
- (OUT)[0] = ((long *) &in)[1]; \
- } \
- } while (0)
+do { \
+ union { \
+ REAL_VALUE_TYPE f; \
+ HOST_WIDE_INT l[2]; \
+ } u; \
+ if (sizeof(HOST_WIDE_INT) * 2 < sizeof(REAL_VALUE_TYPE)) \
+ abort(); \
+ u.l[0] = u.l[1] = 0; \
+ u.f = (IN); \
+ if (HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN) \
+ (OUT)[0] = u.l[0], (OUT)[1] = u.l[1]; \
+ else \
+ (OUT)[1] = u.l[0], (OUT)[0] = u.l[1]; \
+} while (0)
#endif
#endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */
diff --git a/gcc/recog.c b/gcc/recog.c
index 8b7d5ac9483..1127cb801e3 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -40,9 +40,6 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
-/* Import from final.c: */
-extern rtx alter_subreg ();
-
static void validate_replace_rtx_1 PROTO((rtx *, rtx, rtx, rtx));
static rtx *find_single_use_1 PROTO((rtx, rtx *));
static rtx *find_constant_term_loc PROTO((rtx *));
@@ -128,19 +125,18 @@ check_asm_operands (x)
return 1;
}
-/* Static data for the next two routines.
-
- The maximum number of changes supported is defined as the maximum
- number of operands times 5. This allows for repeated substitutions
- inside complex indexed address, or, alternatively, changes in up
- to 5 insns. */
+/* Static data for the next two routines. */
-#define MAX_CHANGE_LOCS (MAX_RECOG_OPERANDS * 5)
+typedef struct change_t
+{
+ rtx object;
+ int old_code;
+ rtx *loc;
+ rtx old;
+} change_t;
-static rtx change_objects[MAX_CHANGE_LOCS];
-static int change_old_codes[MAX_CHANGE_LOCS];
-static rtx *change_locs[MAX_CHANGE_LOCS];
-static rtx change_olds[MAX_CHANGE_LOCS];
+static change_t *changes;
+static int changes_allocated;
static int num_changes = 0;
@@ -174,22 +170,35 @@ validate_change (object, loc, new, in_group)
if (old == new || rtx_equal_p (old, new))
return 1;
- if (num_changes >= MAX_CHANGE_LOCS
- || (in_group == 0 && num_changes != 0))
+ if (in_group == 0 && num_changes != 0)
abort ();
*loc = new;
/* Save the information describing this change. */
- change_objects[num_changes] = object;
- change_locs[num_changes] = loc;
- change_olds[num_changes] = old;
+ if (num_changes >= changes_allocated)
+ {
+ if (changes_allocated == 0)
+ /* This value allows for repeated substitutions inside complex
+ indexed addresses, or changes in up to 5 insns. */
+ changes_allocated = MAX_RECOG_OPERANDS * 5;
+ else
+ changes_allocated *= 2;
+
+ changes =
+ (change_t*) xrealloc (changes,
+ sizeof (change_t) * changes_allocated);
+ }
+
+ changes[num_changes].object = object;
+ changes[num_changes].loc = loc;
+ changes[num_changes].old = old;
if (object && GET_CODE (object) != MEM)
{
/* Set INSN_CODE to force rerecognition of insn. Save old code in
case invalid. */
- change_old_codes[num_changes] = INSN_CODE (object);
+ changes[num_changes].old_code = INSN_CODE (object);
INSN_CODE (object) = -1;
}
@@ -224,7 +233,7 @@ apply_change_group ()
for (i = 0; i < num_changes; i++)
{
- rtx object = change_objects[i];
+ rtx object = changes[i].object;
if (object == 0)
continue;
@@ -319,9 +328,9 @@ cancel_changes (num)
they were made. */
for (i = num_changes - 1; i >= num; i--)
{
- *change_locs[i] = change_olds[i];
- if (change_objects[i] && GET_CODE (change_objects[i]) != MEM)
- INSN_CODE (change_objects[i]) = change_old_codes[i];
+ *changes[i].loc = changes[i].old;
+ if (changes[i].object && GET_CODE (changes[i].object) != MEM)
+ INSN_CODE (changes[i].object) = changes[i].old_code;
}
num_changes = num;
}
@@ -472,11 +481,19 @@ validate_replace_rtx_1 (loc, from, to, object)
#ifdef HAVE_extzv
if (code == ZERO_EXTRACT)
- wanted_mode = insn_operand_mode[(int) CODE_FOR_extzv][1];
+ {
+ wanted_mode = insn_operand_mode[(int) CODE_FOR_extzv][1];
+ if (wanted_mode == VOIDmode)
+ wanted_mode = word_mode;
+ }
#endif
#ifdef HAVE_extv
if (code == SIGN_EXTRACT)
- wanted_mode = insn_operand_mode[(int) CODE_FOR_extv][1];
+ {
+ wanted_mode = insn_operand_mode[(int) CODE_FOR_extv][1];
+ if (wanted_mode == VOIDmode)
+ wanted_mode = word_mode;
+ }
#endif
/* If we have a narrower mode, we can do something. */
@@ -537,6 +554,35 @@ validate_replace_rtx (from, to, insn)
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
return apply_change_group ();
}
+
+/* Try replacing every occurrence of FROM in INSN with TO. After all
+ changes have been made, validate by seeing if INSN is still valid. */
+
+void
+validate_replace_rtx_group (from, to, insn)
+ rtx from, to, insn;
+{
+ validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
+}
+
+/* Try replacing every occurrence of FROM in INSN with TO, avoiding
+ SET_DESTs. After all changes have been made, validate by seeing if
+ INSN is still valid. */
+
+int
+validate_replace_src (from, to, insn)
+ rtx from, to, insn;
+{
+ if ((GET_CODE (insn) != INSN && GET_CODE (insn) != JUMP_INSN)
+ || GET_CODE (PATTERN (insn)) != SET)
+ abort ();
+
+ validate_replace_rtx_1 (&SET_SRC (PATTERN (insn)), from, to, insn);
+ if (GET_CODE (SET_DEST (PATTERN (insn))) == MEM)
+ validate_replace_rtx_1 (&XEXP (SET_DEST (PATTERN (insn)), 0),
+ from, to, insn);
+ return apply_change_group ();
+}
#ifdef HAVE_cc0
/* Return 1 if the insn using CC0 set by INSN does not contain
diff --git a/gcc/recog.h b/gcc/recog.h
index 8918c8950b1..980b76f70d7 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -32,6 +32,8 @@ extern int constrain_operands PROTO((int, int));
extern int memory_address_p PROTO((enum machine_mode, rtx));
extern int strict_memory_address_p PROTO((enum machine_mode, rtx));
extern int validate_replace_rtx PROTO((rtx, rtx, rtx));
+extern void validate_replace_rtx_group PROTO((rtx, rtx, rtx));
+extern int validate_replace_src PROTO((rtx, rtx, rtx));
extern int reg_fits_class_p PROTO((rtx, enum reg_class, int,
enum machine_mode));
extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 6496badbef8..a7a5fb7cd90 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -309,6 +309,13 @@ straighten_stack (insn, regstack)
struct stack_def temp_stack;
int top;
+ /* If there is only a single register on the stack, then the stack is
+ already in increasing order and no reorganization is needed.
+
+ Similarly if the stack is empty. */
+ if (regstack->top <= 0)
+ return;
+
temp_stack.reg_set = regstack->reg_set;
for (top = temp_stack.top = regstack->top; top >= 0; top--)
@@ -2344,6 +2351,15 @@ subst_stack_regs_pat (insn, regstack, pat)
case IF_THEN_ELSE:
/* This insn requires the top of stack to be the destination. */
+ /* If the comparison operator is an FP comparison operator,
+ it is handled correctly by compare_for_stack_reg () who
+ will move the destination to the top of stack. But if the
+ comparison operator is not an FP comparison operator, we
+ have to handle it here. */
+ if (get_hard_regnum (regstack, *dest) >= FIRST_STACK_REG
+ && REGNO (*dest) != regstack->reg[regstack->top])
+ emit_swap_insn (insn, regstack, *dest);
+
src1 = get_true_reg (&XEXP (SET_SRC (pat), 1));
src2 = get_true_reg (&XEXP (SET_SRC (pat), 2));
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 5fef265dda6..cd882df5cd1 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "reload.h"
#include "real.h"
#include "toplev.h"
+#include "output.h"
#ifndef REGISTER_MOVE_COST
#define REGISTER_MOVE_COST(x, y) 2
@@ -55,7 +56,7 @@ Boston, MA 02111-1307, USA. */
/* Indexed by hard register number, contains 1 for registers
that are fixed use (stack pointer, pc, frame pointer, etc.).
These are the registers that cannot be used to allocate
- a pseudo reg whose life does not cross calls. */
+ a pseudo reg for general use. */
char fixed_regs[FIRST_PSEUDO_REGISTER];
@@ -70,7 +71,8 @@ static char initial_fixed_regs[] = FIXED_REGISTERS;
/* Indexed by hard register number, contains 1 for registers
that are fixed use or are clobbered by function calls.
These are the registers that cannot be used to allocate
- a pseudo reg whose life crosses calls. */
+ a pseudo reg whose life crosses calls unless we are able
+ to save/restore them across the calls. */
char call_used_regs[FIRST_PSEUDO_REGISTER];
@@ -86,10 +88,9 @@ HARD_REG_SET losing_caller_save_reg_set;
static char initial_call_used_regs[] = CALL_USED_REGISTERS;
/* Indexed by hard register number, contains 1 for registers that are
- fixed use -- i.e. in fixed_regs -- or a function value return register
- or STRUCT_VALUE_REGNUM or STATIC_CHAIN_REGNUM. These are the
- registers that cannot hold quantities across calls even if we are
- willing to save and restore them. */
+ fixed use or call used registers that cannot hold quantities across
+ calls even if we are willing to save and restore them. call fixed
+ registers are a subset of call used registers. */
char call_fixed_regs[FIRST_PSEUDO_REGISTER];
@@ -192,6 +193,21 @@ static rtx top_of_stack[MAX_MACHINE_MODE];
#endif /* HAVE_SECONDARY_RELOADS */
+/* Linked list of reg_info structures allocated for reg_n_info array.
+ Grouping all of the allocated structures together in one lump
+ means only one call to bzero to clear them, rather than n smaller
+ calls. */
+struct reg_info_data {
+ struct reg_info_data *next; /* next set of reg_info structures */
+ size_t min_index; /* minimum index # */
+ size_t max_index; /* maximum index # */
+ char used_p; /* non-zero if this has been used previously */
+ reg_info data[1]; /* beginning of the reg_info data */
+};
+
+static struct reg_info_data *reg_info_head;
+
+
/* Function called only once to initialize the above data on reg usage.
Once this is done, various switches may override. */
@@ -438,7 +454,7 @@ init_regs ()
memory_move_secondary_cost. */
int i;
for (i = 0; i < MAX_MACHINE_MODE; i++)
- top_of_stack[i] = gen_rtx (MEM, i, stack_pointer_rtx);
+ top_of_stack[i] = gen_rtx_MEM (i, stack_pointer_rtx);
}
#endif
}
@@ -636,6 +652,10 @@ static char *prefclass;
static char *altclass;
+/* Allocated buffers for prefclass and altclass. */
+static char *prefclass_buffer;
+static char *altclass_buffer;
+
/* Record the depth of loops that we are in. */
static int loop_depth;
@@ -653,7 +673,7 @@ static void record_address_regs PROTO((rtx, enum reg_class, int));
#ifdef FORBIDDEN_INC_DEC_CLASSES
static int auto_inc_dec_reg_p PROTO((rtx, enum machine_mode));
#endif
-static void reg_scan_mark_refs PROTO((rtx, rtx, int));
+static void reg_scan_mark_refs PROTO((rtx, rtx, int, int));
/* Return the reg_class in which pseudo reg number REGNO is best allocated.
This function is sometimes called before the info has been computed.
@@ -706,7 +726,7 @@ regclass (f, nregs)
init_recog ();
- costs = (struct costs *) alloca (nregs * sizeof (struct costs));
+ costs = (struct costs *) xmalloc (nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
@@ -986,8 +1006,8 @@ regclass (f, nregs)
if (pass == 0)
{
- prefclass = (char *) oballoc (nregs);
- altclass = (char *) oballoc (nregs);
+ prefclass = prefclass_buffer;
+ altclass = altclass_buffer;
}
for (i = FIRST_PSEUDO_REGISTER; i < nregs; i++)
@@ -1047,6 +1067,8 @@ regclass (f, nregs)
}
}
#endif /* REGISTER_CONSTRAINTS */
+
+ free (costs);
}
#ifdef REGISTER_CONSTRAINTS
@@ -1749,81 +1771,140 @@ auto_inc_dec_reg_p (reg, mode)
void
allocate_reg_info (num_regs, new_p, renumber_p)
- int num_regs;
+ size_t num_regs;
int new_p;
int renumber_p;
{
- static int regno_allocated = 0;
- static int regno_max = 0;
+ static size_t regno_allocated = 0;
static short *renumber = (short *)0;
int i;
- int size_info;
- int size_renumber;
- int min = (new_p) ? 0 : regno_max;
-
- /* If this message come up, and you want to fix it, then all of the tables
- like reg_renumber, etc. that use short will have to be found and lengthed
- to int or HOST_WIDE_INT. */
+ size_t size_info;
+ size_t size_renumber;
+ size_t min = (new_p) ? 0 : reg_n_max;
+ struct reg_info_data *reg_data;
+ struct reg_info_data *reg_next;
/* Free up all storage allocated */
if (num_regs < 0)
{
if (reg_n_info)
{
- free ((char *)reg_n_info);
- free ((char *)renumber);
- reg_n_info = (reg_info *)0;
+ VARRAY_FREE (reg_n_info);
+ for (reg_data = reg_info_head; reg_data; reg_data = reg_next)
+ {
+ reg_next = reg_data->next;
+ free ((char *)reg_data);
+ }
+
+ free (prefclass_buffer);
+ free (altclass_buffer);
+ prefclass_buffer = (char *)0;
+ altclass_buffer = (char *)0;
+ reg_info_head = (struct reg_info_data *)0;
renumber = (short *)0;
}
regno_allocated = 0;
- regno_max = 0;
+ reg_n_max = 0;
return;
}
if (num_regs > regno_allocated)
{
+ size_t old_allocated = regno_allocated;
+
regno_allocated = num_regs + (num_regs / 20); /* add some slop space */
- size_info = regno_allocated * sizeof (reg_info);
size_renumber = regno_allocated * sizeof (short);
if (!reg_n_info)
{
- reg_n_info = (reg_info *) xmalloc (size_info);
- renumber = (short *) xmalloc (size_renumber);
- }
-
- else if (new_p) /* if we're zapping everything, no need to realloc */
- {
- free ((char *)reg_n_info);
- free ((char *)renumber);
- reg_n_info = (reg_info *) xmalloc (size_info);
+ VARRAY_REG_INIT (reg_n_info, regno_allocated, "reg_n_info");
renumber = (short *) xmalloc (size_renumber);
+ prefclass_buffer = (char *) xmalloc (regno_allocated);
+ altclass_buffer = (char *) xmalloc (regno_allocated);
}
else
{
- reg_n_info = (reg_info *) xrealloc ((char *)reg_n_info, size_info);
- renumber = (short *) xrealloc ((char *)renumber, size_renumber);
+ VARRAY_GROW (reg_n_info, regno_allocated);
+
+ if (new_p) /* if we're zapping everything, no need to realloc */
+ {
+ free ((char *)renumber);
+ free ((char *)prefclass_buffer);
+ free ((char *)altclass_buffer);
+ renumber = (short *) xmalloc (size_renumber);
+ prefclass_buffer = (char *) xmalloc (regno_allocated);
+ altclass_buffer = (char *) xmalloc (regno_allocated);
+ }
+
+ else
+ {
+ renumber = (short *) xrealloc ((char *)renumber, size_renumber);
+ prefclass_buffer = (char *) xrealloc ((char *)prefclass_buffer,
+ regno_allocated);
+
+ altclass_buffer = (char *) xrealloc ((char *)altclass_buffer,
+ regno_allocated);
+ }
}
+
+ size_info = (regno_allocated - old_allocated) * sizeof (reg_info)
+ + sizeof (struct reg_info_data) - sizeof (reg_info);
+ reg_data = (struct reg_info_data *) xcalloc (size_info, 1);
+ reg_data->min_index = old_allocated;
+ reg_data->max_index = regno_allocated - 1;
+ reg_data->next = reg_info_head;
+ reg_info_head = reg_data;
}
+ reg_n_max = num_regs;
if (min < num_regs)
{
- bzero ((char *) &reg_n_info[min], (num_regs - min) * sizeof (reg_info));
- for (i = min; i < num_regs; i++)
+ /* Loop through each of the segments allocated for the actual
+ reg_info pages, and set up the pointers, zero the pages, etc. */
+ for (reg_data = reg_info_head; reg_data; reg_data = reg_next)
{
- REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
- renumber[i] = -1;
+ size_t min_index = reg_data->min_index;
+ size_t max_index = reg_data->max_index;
+
+ reg_next = reg_data->next;
+ if (min <= max_index)
+ {
+ size_t max = max_index;
+ size_t local_min = min - min_index;
+ if (min < min_index)
+ local_min = 0;
+ if (!reg_data->used_p) /* page just allocated with calloc */
+ reg_data->used_p = 1; /* no need to zero */
+ else
+ bzero ((char *) &reg_data->data[local_min],
+ sizeof (reg_info) * (max - min_index - local_min + 1));
+
+ for (i = min_index+local_min; i <= max; i++)
+ {
+ VARRAY_REG (reg_n_info, i) = &reg_data->data[i-min_index];
+ REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
+ renumber[i] = -1;
+ prefclass_buffer[i] = (char) NO_REGS;
+ altclass_buffer[i] = (char) NO_REGS;
+ }
+ }
}
}
+ /* If {pref,alt}class have already been allocated, update the pointers to
+ the newly realloced ones. */
+ if (prefclass)
+ {
+ prefclass = prefclass_buffer;
+ altclass = altclass_buffer;
+ }
+
if (renumber_p)
reg_renumber = renumber;
/* Tell the regset code about the new number of registers */
MAX_REGNO_REG_SET (num_regs, new_p, renumber_p);
-
- regno_max = num_regs;
}
@@ -1861,26 +1942,60 @@ reg_scan (f, nregs, repeat)
if (GET_CODE (PATTERN (insn)) == PARALLEL
&& XVECLEN (PATTERN (insn), 0) > max_parallel)
max_parallel = XVECLEN (PATTERN (insn), 0);
- reg_scan_mark_refs (PATTERN (insn), insn, 0);
+ reg_scan_mark_refs (PATTERN (insn), insn, 0, 0);
+
+ if (REG_NOTES (insn))
+ reg_scan_mark_refs (REG_NOTES (insn), insn, 1, 0);
+ }
+}
+
+/* Update 'regscan' information by looking at the insns
+ from FIRST to LAST. Some new REGs have been created,
+ and any REG with number greater than OLD_MAX_REGNO is
+ such a REG. We only update information for those. */
+
+void
+reg_scan_update(first, last, old_max_regno)
+ rtx first;
+ rtx last;
+ int old_max_regno;
+{
+ register rtx insn;
+
+ allocate_reg_info (max_reg_num (), FALSE, FALSE);
+
+ for (insn = first; insn != last; insn = NEXT_INSN (insn))
+ if (GET_CODE (insn) == INSN
+ || GET_CODE (insn) == CALL_INSN
+ || GET_CODE (insn) == JUMP_INSN)
+ {
+ if (GET_CODE (PATTERN (insn)) == PARALLEL
+ && XVECLEN (PATTERN (insn), 0) > max_parallel)
+ max_parallel = XVECLEN (PATTERN (insn), 0);
+ reg_scan_mark_refs (PATTERN (insn), insn, 0, old_max_regno);
if (REG_NOTES (insn))
- reg_scan_mark_refs (REG_NOTES (insn), insn, 1);
+ reg_scan_mark_refs (REG_NOTES (insn), insn, 1, old_max_regno);
}
}
/* X is the expression to scan. INSN is the insn it appears in.
- NOTE_FLAG is nonzero if X is from INSN's notes rather than its body. */
+ NOTE_FLAG is nonzero if X is from INSN's notes rather than its body.
+ We should only record information for REGs with numbers
+ greater than or equal to MIN_REGNO. */
static void
-reg_scan_mark_refs (x, insn, note_flag)
+reg_scan_mark_refs (x, insn, note_flag, min_regno)
rtx x;
rtx insn;
int note_flag;
+ int min_regno;
{
- register enum rtx_code code = GET_CODE (x);
+ register enum rtx_code code;
register rtx dest;
register rtx note;
+ code = GET_CODE (x);
switch (code)
{
case CONST_INT:
@@ -1898,24 +2013,27 @@ reg_scan_mark_refs (x, insn, note_flag)
{
register int regno = REGNO (x);
- REGNO_LAST_NOTE_UID (regno) = INSN_UID (insn);
- if (!note_flag)
- REGNO_LAST_UID (regno) = INSN_UID (insn);
- if (REGNO_FIRST_UID (regno) == 0)
- REGNO_FIRST_UID (regno) = INSN_UID (insn);
+ if (regno >= min_regno)
+ {
+ REGNO_LAST_NOTE_UID (regno) = INSN_UID (insn);
+ if (!note_flag)
+ REGNO_LAST_UID (regno) = INSN_UID (insn);
+ if (REGNO_FIRST_UID (regno) == 0)
+ REGNO_FIRST_UID (regno) = INSN_UID (insn);
+ }
}
break;
case EXPR_LIST:
if (XEXP (x, 0))
- reg_scan_mark_refs (XEXP (x, 0), insn, note_flag);
+ reg_scan_mark_refs (XEXP (x, 0), insn, note_flag, min_regno);
if (XEXP (x, 1))
- reg_scan_mark_refs (XEXP (x, 1), insn, note_flag);
+ reg_scan_mark_refs (XEXP (x, 1), insn, note_flag, min_regno);
break;
case INSN_LIST:
if (XEXP (x, 1))
- reg_scan_mark_refs (XEXP (x, 1), insn, note_flag);
+ reg_scan_mark_refs (XEXP (x, 1), insn, note_flag, min_regno);
break;
case SET:
@@ -1926,7 +2044,8 @@ reg_scan_mark_refs (x, insn, note_flag)
dest = XEXP (dest, 0))
;
- if (GET_CODE (dest) == REG)
+ if (GET_CODE (dest) == REG
+ && REGNO (dest) >= min_regno)
REG_N_SETS (REGNO (dest))++;
/* If this is setting a pseudo from another pseudo or the sum of a
@@ -1943,6 +2062,7 @@ reg_scan_mark_refs (x, insn, note_flag)
if (GET_CODE (SET_DEST (x)) == REG
&& REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER
+ && REGNO (SET_DEST (x)) >= min_regno
/* If the destination pseudo is set more than once, then other
sets might not be to a pointer value (consider access to a
union in two threads of control in the presense of global
@@ -1985,12 +2105,12 @@ reg_scan_mark_refs (x, insn, note_flag)
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
- reg_scan_mark_refs (XEXP (x, i), insn, note_flag);
+ reg_scan_mark_refs (XEXP (x, i), insn, note_flag, min_regno);
else if (fmt[i] == 'E' && XVEC (x, i) != 0)
{
register int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- reg_scan_mark_refs (XVECEXP (x, i, j), insn, note_flag);
+ reg_scan_mark_refs (XVECEXP (x, i, j), insn, note_flag, min_regno);
}
}
}
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 81a987035f1..41235f13704 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -24,16 +24,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
instruction to avoid the move instruction. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/* stdio.h must precede rtl.h for FFS. */
#include "system.h"
-
-#include "rtl.h"
+#include "rtl.h" /* stdio.h must precede rtl.h for FFS. */
#include "insn-config.h"
#include "recog.h"
#include "output.h"
@@ -43,10 +35,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "flags.h"
#include "expr.h"
#include "insn-flags.h"
+#include "basic-block.h"
+#include "toplev.h"
static int optimize_reg_copy_1 PROTO((rtx, rtx, rtx));
static void optimize_reg_copy_2 PROTO((rtx, rtx, rtx));
static void optimize_reg_copy_3 PROTO((rtx, rtx, rtx));
+static rtx gen_add3_insn PROTO((rtx, rtx, rtx));
+static void copy_src_to_dest PROTO((rtx, rtx, rtx, int));
+static int *regmove_bb_head;
struct match {
int with[MAX_RECOG_OPERANDS];
@@ -63,8 +60,39 @@ static int fixup_match_1 PROTO((rtx, rtx, rtx, rtx, rtx, int, int, int, FILE *))
;
static int reg_is_remote_constant_p PROTO((rtx, rtx, rtx));
static int stable_but_for_p PROTO((rtx, rtx, rtx));
+static int regclass_compatible_p PROTO((int, int));
static int loop_depth;
+/* Return non-zero if registers with CLASS1 and CLASS2 can be merged without
+ causing too much register allocation problems. */
+static int
+regclass_compatible_p (class0, class1)
+ int class0, class1;
+{
+ return (class0 == class1
+ || (reg_class_subset_p (class0, class1)
+ && ! CLASS_LIKELY_SPILLED_P (class0))
+ || (reg_class_subset_p (class1, class0)
+ && ! CLASS_LIKELY_SPILLED_P (class1)));
+}
+
+/* Generate and return an insn body to add r1 and c,
+ storing the result in r0. */
+static rtx
+gen_add3_insn (r0, r1, c)
+ rtx r0, r1, c;
+{
+ int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code;
+
+ if (icode == CODE_FOR_nothing
+ || ! (*insn_operand_predicate[icode][0]) (r0, insn_operand_mode[icode][0])
+ || ! (*insn_operand_predicate[icode][1]) (r1, insn_operand_mode[icode][1])
+ || ! (*insn_operand_predicate[icode][2]) (c, insn_operand_mode[icode][2]))
+ return NULL_RTX;
+
+ return (GEN_FCN (icode) (r0, r1, c));
+}
+
#ifdef AUTO_INC_DEC
/* INC_INSN is an instruction that adds INCREMENT to REG.
@@ -266,12 +294,45 @@ optimize_reg_copy_1 (insn, dest, src)
PATTERN (q))))
{
/* We assume that a register is used exactly once per
- insn in the updates below. If this is not correct,
- no great harm is done. */
+ insn in the REG_N_REFS updates below. If this is not
+ correct, no great harm is done.
+
+
+ We do not undo this substitution if something later
+ fails. Therefore, we must update the other REG_N_*
+ counters now to keep them accurate. */
if (sregno >= FIRST_PSEUDO_REGISTER)
- REG_N_REFS (sregno) -= loop_depth;
+ {
+ REG_N_REFS (sregno) -= loop_depth;
+
+ if (REG_LIVE_LENGTH (sregno) >= 0)
+ {
+ REG_LIVE_LENGTH (sregno) -= length;
+ /* REG_LIVE_LENGTH is only an approximation after
+ combine if sched is not run, so make sure that
+ we still have a reasonable value. */
+ if (REG_LIVE_LENGTH (sregno) < 2)
+ REG_LIVE_LENGTH (sregno) = 2;
+ }
+
+ REG_N_CALLS_CROSSED (sregno) -= n_calls;
+ }
+
if (dregno >= FIRST_PSEUDO_REGISTER)
- REG_N_REFS (dregno) += loop_depth;
+ {
+ REG_N_REFS (dregno) += loop_depth;
+
+ if (REG_LIVE_LENGTH (dregno) >= 0)
+ REG_LIVE_LENGTH (dregno) += d_length;
+
+ REG_N_CALLS_CROSSED (dregno) += d_n_calls;
+ }
+
+ /* We've done a substitution, clear the counters. */
+ length = 0;
+ d_length = 0;
+ n_calls = 0;
+ d_n_calls = 0;
}
else
{
@@ -494,22 +555,146 @@ optimize_reg_copy_3 (insn, dest, src)
old_mode = GET_MODE (src_reg);
PUT_MODE (src_reg, GET_MODE (src));
XEXP (src, 0) = SET_SRC (set);
- if (! validate_change (p, &SET_SRC (set), src, 0))
- {
- PUT_MODE (src_reg, old_mode);
- XEXP (src, 0) = src_reg;
- return;
- }
+
+ /* Include this change in the group so that it's easily undone if
+ one of the changes in the group is invalid. */
+ validate_change (p, &SET_SRC (set), src, 1);
+
+ /* Now walk forward making additional replacements. We want to be able
+ to undo all the changes if a later substitution fails. */
subreg = gen_rtx_SUBREG (old_mode, src_reg, 0);
while (p = NEXT_INSN (p), p != insn)
{
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
- validate_replace_rtx (src_reg, subreg, p);
+
+ /* Make a tenative change. */
+ validate_replace_rtx_group (src_reg, subreg, p);
+ }
+
+ validate_replace_rtx_group (src, src_reg, insn);
+
+ /* Now see if all the changes are valid. */
+ if (! apply_change_group ())
+ {
+ /* One or more changes were no good. Back out everything. */
+ PUT_MODE (src_reg, old_mode);
+ XEXP (src, 0) = src_reg;
+ }
+}
+
+
+/* If we were not able to update the users of src to use dest directly, try
+ instead moving the value to dest directly before the operation. */
+
+static void
+copy_src_to_dest (insn, src, dest, loop_depth)
+ rtx insn;
+ rtx src;
+ rtx dest;
+ int loop_depth;
+{
+ rtx seq;
+ rtx link;
+ rtx next;
+ rtx set;
+ rtx move_insn;
+ rtx *p_insn_notes;
+ rtx *p_move_notes;
+ int src_regno;
+ int dest_regno;
+ int bb;
+ int insn_uid;
+ int move_uid;
+
+ /* A REG_LIVE_LENGTH of -1 indicates the register is equivalent to a constant
+ or memory location and is used infrequently; a REG_LIVE_LENGTH of -2 is
+ parameter when there is no frame pointer that is not allocated a register.
+ For now, we just reject them, rather than incrementing the live length. */
+
+ if (GET_CODE (src) == REG
+ && REG_LIVE_LENGTH (REGNO (src)) > 0
+ && GET_CODE (dest) == REG
+ && REG_LIVE_LENGTH (REGNO (dest)) > 0
+ && (set = single_set (insn)) != NULL_RTX
+ && !reg_mentioned_p (dest, SET_SRC (set))
+ && GET_MODE (src) == GET_MODE (dest))
+ {
+ int old_num_regs = reg_rtx_no;
+
+ /* Generate the src->dest move. */
+ start_sequence ();
+ emit_move_insn (dest, src);
+ seq = gen_sequence ();
+ end_sequence ();
+ /* If this sequence uses new registers, we may not use it. */
+ if (old_num_regs != reg_rtx_no
+ || ! validate_replace_rtx (src, dest, insn))
+ {
+ /* We have to restore reg_rtx_no to its old value, lest
+ recompute_reg_usage will try to compute the usage of the
+ new regs, yet reg_n_info is not valid for them. */
+ reg_rtx_no = old_num_regs;
+ return;
+ }
+ emit_insn_before (seq, insn);
+ move_insn = PREV_INSN (insn);
+ p_move_notes = &REG_NOTES (move_insn);
+ p_insn_notes = &REG_NOTES (insn);
+
+ /* Move any notes mentioning src to the move instruction */
+ for (link = REG_NOTES (insn); link != NULL_RTX; link = next)
+ {
+ next = XEXP (link, 1);
+ if (XEXP (link, 0) == src)
+ {
+ *p_move_notes = link;
+ p_move_notes = &XEXP (link, 1);
+ }
+ else
+ {
+ *p_insn_notes = link;
+ p_insn_notes = &XEXP (link, 1);
+ }
+ }
+
+ *p_move_notes = NULL_RTX;
+ *p_insn_notes = NULL_RTX;
+
+ /* Is the insn the head of a basic block? If so extend it */
+ insn_uid = INSN_UID (insn);
+ move_uid = INSN_UID (move_insn);
+ bb = regmove_bb_head[insn_uid];
+ if (bb >= 0)
+ {
+ basic_block_head[bb] = move_insn;
+ regmove_bb_head[insn_uid] = -1;
+ }
+
+ /* Update the various register tables. */
+ dest_regno = REGNO (dest);
+ REG_N_SETS (dest_regno) += loop_depth;
+ REG_N_REFS (dest_regno) += loop_depth;
+ REG_LIVE_LENGTH (dest_regno)++;
+ if (REGNO_FIRST_UID (dest_regno) == insn_uid)
+ REGNO_FIRST_UID (dest_regno) = move_uid;
+
+ src_regno = REGNO (src);
+ if (! find_reg_note (move_insn, REG_DEAD, src))
+ REG_LIVE_LENGTH (src_regno)++;
+
+ if (REGNO_FIRST_UID (src_regno) == insn_uid)
+ REGNO_FIRST_UID (src_regno) = move_uid;
+
+ if (REGNO_LAST_UID (src_regno) == insn_uid)
+ REGNO_LAST_UID (src_regno) = move_uid;
+
+ if (REGNO_LAST_NOTE_UID (src_regno) == insn_uid)
+ REGNO_LAST_NOTE_UID (src_regno) = move_uid;
}
- validate_replace_rtx (src, src_reg, insn);
}
+
/* Return whether REG is set in only one location, and is set to a
constant, but is set in a different basic block from INSN (an
instructions which uses REG). In this case REG is equivalent to a
@@ -570,8 +755,24 @@ reg_is_remote_constant_p (reg, insn, first)
return 0;
}
+/* INSN is adding a CONST_INT to a REG. We search backwards looking for
+ another add immediate instruction with the same source and dest registers,
+ and if we find one, we change INSN to an increment, and return 1. If
+ no changes are made, we return 0.
+
+ This changes
+ (set (reg100) (plus reg1 offset1))
+ ...
+ (set (reg100) (plus reg1 offset2))
+ to
+ (set (reg100) (plus reg1 offset1))
+ ...
+ (set (reg100) (plus reg100 offset2-offset1)) */
+
+/* ??? What does this comment mean? */
/* cse disrupts preincrement / postdecrement squences when it finds a
hard register as ultimate source, like the frame pointer. */
+
int
fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
rtx insn, dst, src, offset;
@@ -623,8 +824,9 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
{
HOST_WIDE_INT newconst
= INTVAL (offset) - INTVAL (XEXP (SET_SRC (pset), 1));
- if (validate_change (insn, &PATTERN (insn),
- gen_addsi3 (dst, dst, GEN_INT (newconst)), 0))
+ rtx add = gen_add3_insn (dst, dst, GEN_INT (newconst));
+
+ if (add && validate_change (insn, &PATTERN (insn), add, 0))
{
/* Remove the death note for DST from DST_DEATH. */
if (dst_death)
@@ -651,6 +853,8 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
&& (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
+ continue;
if (reg_overlap_mentioned_p (dst, PATTERN (p)))
{
if (try_auto_increment (p, insn, 0, dst, newconst, 0))
@@ -666,6 +870,8 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
&& (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
+ continue;
if (reg_overlap_mentioned_p (dst, PATTERN (p)))
{
try_auto_increment (p, insn, 0, dst, newconst, 1);
@@ -711,13 +917,20 @@ regmove_optimize (f, nregs, regmove_dump_file)
int nregs;
FILE *regmove_dump_file;
{
+ int old_max_uid = get_max_uid ();
rtx insn;
struct match match;
int pass;
- int maxregnum = max_reg_num (), i;
+ int i;
+ rtx copy_src, copy_dst;
- regno_src_regno = (int *)alloca (sizeof *regno_src_regno * maxregnum);
- for (i = maxregnum; --i >= 0; ) regno_src_regno[i] = -1;
+ regno_src_regno = (int *)alloca (sizeof *regno_src_regno * nregs);
+ for (i = nregs; --i >= 0; ) regno_src_regno[i] = -1;
+
+ regmove_bb_head = (int *)alloca (sizeof (int) * (old_max_uid + 1));
+ for (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1;
+ for (i = 0; i < n_basic_blocks; i++)
+ regmove_bb_head[INSN_UID (basic_block_head[i])] = i;
/* A forward/backward pass. Replace output operands with input operands. */
@@ -866,11 +1079,7 @@ regmove_optimize (f, nregs, regmove_dump_file)
src_class = reg_preferred_class (REGNO (src));
dst_class = reg_preferred_class (REGNO (dst));
- if (src_class != dst_class
- && (! reg_class_subset_p (src_class, dst_class)
- || CLASS_LIKELY_SPILLED_P (src_class))
- && (! reg_class_subset_p (dst_class, src_class)
- || CLASS_LIKELY_SPILLED_P (dst_class)))
+ if (! regclass_compatible_p (src_class, dst_class))
continue;
if (fixup_match_1 (insn, set, src, src_subreg, dst, pass,
@@ -901,6 +1110,7 @@ regmove_optimize (f, nregs, regmove_dump_file)
{
int insn_code_number = find_matches (insn, &match);
int operand_number, match_number;
+ int success = 0;
if (insn_code_number < 0)
continue;
@@ -911,13 +1121,14 @@ regmove_optimize (f, nregs, regmove_dump_file)
operand. If safe, then replace the source operand with the
dest operand in both instructions. */
+ copy_src = NULL_RTX;
+ copy_dst = NULL_RTX;
for (operand_number = 0;
operand_number < insn_n_operands[insn_code_number];
operand_number++)
{
rtx set, p, src, dst;
rtx src_note, dst_note;
- int success = 0;
int num_calls = 0;
enum reg_class src_class, dst_class;
int length;
@@ -976,32 +1187,59 @@ regmove_optimize (f, nregs, regmove_dump_file)
}
src_class = reg_preferred_class (REGNO (src));
dst_class = reg_preferred_class (REGNO (dst));
- if (src_class != dst_class
- && (! reg_class_subset_p (src_class, dst_class)
- || CLASS_LIKELY_SPILLED_P (src_class))
- && (! reg_class_subset_p (dst_class, src_class)
- || CLASS_LIKELY_SPILLED_P (dst_class)))
- continue;
-
- if (! (src_note = find_reg_note (insn, REG_DEAD, src)))
- continue;
+ if (! regclass_compatible_p (src_class, dst_class))
+ {
+ if (!copy_src)
+ {
+ copy_src = src;
+ copy_dst = dst;
+ }
+ continue;
+ }
/* Can not modify an earlier insn to set dst if this insn
uses an old value in the source. */
if (reg_overlap_mentioned_p (dst, SET_SRC (set)))
- continue;
+ {
+ if (!copy_src)
+ {
+ copy_src = src;
+ copy_dst = dst;
+ }
+ continue;
+ }
+
+ if (! (src_note = find_reg_note (insn, REG_DEAD, src)))
+ {
+ if (!copy_src)
+ {
+ copy_src = src;
+ copy_dst = dst;
+ }
+ continue;
+ }
- if (regmove_dump_file)
- fprintf (regmove_dump_file,
- "Could fix operand %d of insn %d matching operand %d.\n",
- operand_number, INSN_UID (insn), match_number);
/* If src is set once in a different basic block,
and is set equal to a constant, then do not use
it for this optimization, as this would make it
no longer equivalent to a constant. */
- if (reg_is_remote_constant_p (src, insn, f))
- continue;
+
+ if (reg_is_remote_constant_p (src, insn, f))
+ {
+ if (!copy_src)
+ {
+ copy_src = src;
+ copy_dst = dst;
+ }
+ continue;
+ }
+
+
+ if (regmove_dump_file)
+ fprintf (regmove_dump_file,
+ "Could fix operand %d of insn %d matching operand %d.\n",
+ operand_number, INSN_UID (insn), match_number);
/* Scan backward to find the first instruction that uses
the input operand. If the operand is set here, then
@@ -1138,11 +1376,35 @@ regmove_optimize (f, nregs, regmove_dump_file)
break;
}
}
+
+ /* If we weren't able to replace any of the alternatives, try an
+ alternative appoach of copying the source to the destination. */
+ if (!success && copy_src != NULL_RTX)
+ copy_src_to_dest (insn, copy_src, copy_dst, loop_depth);
+
}
}
#endif /* REGISTER_CONSTRAINTS */
+
+ /* In fixup_match_1, some insns may have been inserted after basic block
+ ends. Fix that here. */
+ for (i = 0; i < n_basic_blocks; i++)
+ {
+ rtx end = basic_block_end[i];
+ rtx new = end;
+ rtx next = NEXT_INSN (new);
+ while (next != 0 && INSN_UID (next) >= old_max_uid
+ && (i == n_basic_blocks - 1 || basic_block_head[i + 1] != next))
+ new = next, next = NEXT_INSN (new);
+ basic_block_end[i] = new;
+ }
}
+/* Returns the INSN_CODE for INSN if its pattern has matching constraints for
+ any operand. Returns -1 if INSN can't be recognized, or if the alternative
+ can't be determined.
+
+ Initialize the info in MATCHP based on the constraints. */
static int
find_matches (insn, matchp)
@@ -1374,6 +1636,14 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
This also gives opportunities for subsequent
optimizations in the backward pass, so do it there. */
if (code == PLUS && backward
+ /* Don't do this if we can likely tie DST to SET_DEST
+ of P later; we can't do this tying here if we got a
+ hard register. */
+ && ! (dst_note && ! REG_N_CALLS_CROSSED (REGNO (dst))
+ && single_set (p)
+ && GET_CODE (SET_DEST (single_set (p))) == REG
+ && (REGNO (SET_DEST (single_set (p)))
+ < FIRST_PSEUDO_REGISTER))
#ifdef HAVE_cc0
/* We may not emit an insn directly
after P if the latter sets CC0. */
@@ -1711,7 +1981,10 @@ stable_but_for_p (x, src, dst)
}
}
-/* Test if regmove seems profitable for this target. */
+/* Test if regmove seems profitable for this target. Regmove is useful only
+ if some common patterns are two address, i.e. require matching constraints,
+ so we check that condition here. */
+
int
regmove_profitable_p ()
{
diff --git a/gcc/regs.h b/gcc/regs.h
index fe1dbfe6b7a..1ececb3c6a7 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -1,5 +1,5 @@
/* Define per-register tables for data flow info and register allocation.
- Copyright (C) 1987, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -19,6 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "varray.h"
#define REG_BYTES(R) mode_size[(int) GET_MODE (R)]
@@ -60,18 +61,20 @@ typedef struct reg_info_def {
char changes_size; /* whether (SUBREG (REG n)) changes size */
} reg_info;
-extern reg_info *reg_n_info;
+extern varray_type reg_n_info;
+
+extern unsigned int reg_n_max;
/* Indexed by n, gives number of times (REG n) is used or set.
References within loops may be counted more times. */
-#define REG_N_REFS(N) (reg_n_info[(N)].refs)
+#define REG_N_REFS(N) (VARRAY_REG (reg_n_info, N)->refs)
/* Indexed by n, gives number of times (REG n) is set.
??? both regscan and flow allocate space for this. We should settle
on just copy. */
-#define REG_N_SETS(N) (reg_n_info[(N)].sets)
+#define REG_N_SETS(N) (VARRAY_REG (reg_n_info, N)->sets)
/* Indexed by N, gives number of insns in which register N dies.
Note that if register N is live around loops, it can die
@@ -79,13 +82,13 @@ extern reg_info *reg_n_info;
So this is only a reliable indicator of how many regions of life there are
for registers that are contained in one basic block. */
-#define REG_N_DEATHS(N) (reg_n_info[(N)].deaths)
+#define REG_N_DEATHS(N) (VARRAY_REG (reg_n_info, N)->deaths)
/* Indexed by N; says whether a pseudo register N was ever used
within a SUBREG that changes the size of the reg. Some machines prohibit
such objects to be in certain (usually floating-point) registers. */
-#define REG_CHANGES_SIZE(N) (reg_n_info[(N)].changes_size)
+#define REG_CHANGES_SIZE(N) (VARRAY_REG (reg_n_info, N)->changes_size)
/* Get the number of consecutive words required to hold pseudo-reg N. */
@@ -104,7 +107,7 @@ extern reg_info *reg_n_info;
/* Indexed by N, gives number of CALL_INSNS across which (REG n) is live. */
-#define REG_N_CALLS_CROSSED(N) (reg_n_info[(N)].calls_crossed)
+#define REG_N_CALLS_CROSSED(N) (VARRAY_REG (reg_n_info, N)->calls_crossed)
/* Total number of instructions at which (REG n) is live.
The larger this is, the less priority (REG n) gets for
@@ -121,7 +124,7 @@ extern reg_info *reg_n_info;
is not required. global.c makes an allocno for this but does
not try to assign a hard register to it. */
-#define REG_LIVE_LENGTH(N) (reg_n_info[(N)].live_length)
+#define REG_LIVE_LENGTH(N) (VARRAY_REG (reg_n_info, N)->live_length)
/* Vector of substitutions of register numbers,
used to map pseudo regs into hardware regs.
@@ -153,7 +156,7 @@ extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
It is sometimes adjusted for subsequent changes during loop,
but not adjusted by cse even if cse invalidates it. */
-#define REGNO_FIRST_UID(N) (reg_n_info[(N)].first_uid)
+#define REGNO_FIRST_UID(N) (VARRAY_REG (reg_n_info, N)->first_uid)
/* Vector indexed by regno; gives uid of last insn using that reg.
This is computed by reg_scan for use by cse and loop.
@@ -161,11 +164,11 @@ extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
but not adjusted by cse even if cse invalidates it.
This is harmless since cse won't scan through a loop end. */
-#define REGNO_LAST_UID(N) (reg_n_info[(N)].last_uid)
+#define REGNO_LAST_UID(N) (VARRAY_REG (reg_n_info, N)->last_uid)
/* Similar, but includes insns that mention the reg in their notes. */
-#define REGNO_LAST_NOTE_UID(N) (reg_n_info[(N)].last_note_uid)
+#define REGNO_LAST_NOTE_UID(N) (VARRAY_REG (reg_n_info, N)->last_note_uid)
/* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
After rtl generation, it is 1 plus the largest register number used. */
@@ -208,14 +211,17 @@ extern int caller_save_needed;
#define CLASS_LIKELY_SPILLED_P(CLASS) (reg_class_size[(int) (CLASS)] == 1)
#endif
-/* Allocated in local_alloc. */
+/* Select a register mode required for caller save of hard regno REGNO. */
+#ifndef HARD_REGNO_CALLER_SAVE_MODE
+#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS) \
+ choose_hard_reg_mode (REGNO, NREGS)
+#endif
-/* A list of SCRATCH rtl allocated by local-alloc. */
-extern rtx *scratch_list;
-/* The basic block in which each SCRATCH is used. */
-extern int *scratch_block;
-/* The length of the arrays pointed to by scratch_block and scratch_list. */
-extern int scratch_list_length;
+/* Registers that get partially clobbered by a call in a given mode.
+ These must not be call used registers. */
+#ifndef HARD_REGNO_CALL_PART_CLOBBERED
+#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
+#endif
/* Allocate reg_n_info tables */
-extern void allocate_reg_info PROTO((int, int, int));
+extern void allocate_reg_info PROTO((size_t, int, int));
diff --git a/gcc/reload.c b/gcc/reload.c
index 7d7350e29fa..428ce879894 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1506,6 +1506,21 @@ transfer_replacements (to, from)
replacements[i].what = to;
}
+/* Remove all replacements in reload FROM. */
+void
+remove_replacements (from)
+ int from;
+{
+ int i, j;
+
+ for (i = 0, j = 0; i < n_replacements; i++)
+ {
+ if (replacements[i].what == from)
+ continue;
+ replacements[j++] = replacements[i];
+ }
+}
+
/* If there is only one output reload, and it is not for an earlyclobber
operand, try to combine it with a (logically unrelated) input reload
to reduce the number of reload registers needed.
@@ -2016,7 +2031,7 @@ operands_match_p (x, y)
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
- int val;
+ int val, j;
switch (fmt[i])
{
case 'w':
@@ -2042,6 +2057,19 @@ operands_match_p (x, y)
case '0':
break;
+ case 'E':
+ if (XVECLEN (x, i) != XVECLEN (y, i))
+ return 0;
+ for (j = XVECLEN (x, i) - 1; j >= 0; --j)
+ {
+ val = operands_match_p (XVECEXP (x, i, j), XVECEXP (y, i, j));
+ if (val == 0)
+ return 0;
+ if (val == 2)
+ success_2 = 1;
+ }
+ break;
+
/* It is believed that rtx's at this level will never
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
@@ -2329,6 +2357,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
rtx set = single_set (insn);
int goal_earlyclobber, this_earlyclobber;
enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
+ /* Cache the last regno for the last pseudo we did an output reload
+ for in case the next insn uses it. */
+ static int last_output_reload_regno = -1;
this_insn = insn;
this_insn_is_asm = 0; /* Tentative. */
@@ -2626,8 +2657,16 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
register int regno = REGNO (recog_operand[i]);
if (reg_equiv_constant[regno] != 0
&& (set == 0 || &SET_DEST (set) != recog_operand_loc[i]))
- substed_operand[i] = recog_operand[i]
- = reg_equiv_constant[regno];
+ {
+ /* Record the existing mode so that the check if constants are
+ allowed will work when operand_mode isn't specified. */
+
+ if (operand_mode[i] == VOIDmode)
+ operand_mode[i] = GET_MODE (recog_operand[i]);
+
+ substed_operand[i] = recog_operand[i]
+ = reg_equiv_constant[regno];
+ }
#if 0 /* This might screw code in reload1.c to delete prior output-reload
that feeds this insn. */
if (reg_equiv_mem[regno] != 0)
@@ -2748,8 +2787,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
int earlyclobber = 0;
/* If the predicate accepts a unary operator, it means that
- we need to reload the operand. */
- if (GET_RTX_CLASS (GET_CODE (operand)) == '1')
+ we need to reload the operand, but do not do this for
+ match_operator and friends. */
+ if (GET_RTX_CLASS (GET_CODE (operand)) == '1' && *p != 0)
operand = XEXP (operand, 0);
/* If the operand is a SUBREG, extract
@@ -3195,6 +3235,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&& this_alternative_matches[i] < 0)
bad = 1;
+#if 0
+ /* If this is a pseudo-register that is set in the previous
+ insns, there's a good chance that it will already be in a
+ spill register and we can use that spill register. So
+ make this case cheaper.
+
+ Disabled for egcs. egcs has better inheritance code and
+ this change causes problems with the improved reload
+ inheritance code. */
+ if (GET_CODE (operand) == REG
+ && REGNO (operand) >= FIRST_PSEUDO_REGISTER
+ && REGNO (operand) == last_output_reload_regno)
+ reject--;
+#endif
+
/* If this is a constant that is reloaded into the desired
class by copying it to memory first, count that as another
reload. This is consistent with other code and is
@@ -3257,7 +3312,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
/* Input reloads can be inherited more often than output
reloads can be removed, so penalize output reloads. */
- if (operand_type[i] != RELOAD_FOR_INPUT)
+ if (operand_type[i] != RELOAD_FOR_INPUT
+ && GET_CODE (operand) != SCRATCH)
reject++;
}
@@ -3474,7 +3530,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
that we could reach by reloading the fewest operands.
Reload so as to fit it. */
- if (best == MAX_RECOG_OPERANDS + 300)
+ if (best == MAX_RECOG_OPERANDS * 2 + 600)
{
/* No alternative works with reloads?? */
if (insn_code_number >= 0)
@@ -3549,11 +3605,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
a SCRATCH). In this case, we only need have the reload live
through the insn itself, but not for any of our input or output
reloads.
+ But we must not accidentally narrow the scope of an existing
+ RELOAD_OTHER reload - leave these alone.
In any case, anything needed to address this operand can remain
however they were previously categorized. */
- if (goal_alternative_earlyclobber[i])
+ if (goal_alternative_earlyclobber[i] && operand_type[i] != RELOAD_OTHER)
operand_type[i]
= (find_reg_note (insn, REG_UNUSED, recog_operand[i])
? RELOAD_FOR_INSN : RELOAD_OTHER);
@@ -3588,6 +3646,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
reload_earlyclobbers[n_earlyclobbers++] = recog_operand[i];
/* Now record reloads for all the operands that need them. */
+ last_output_reload_regno = -1;
for (i = 0; i < noperands; i++)
if (! goal_alternative_win[i])
{
@@ -3634,20 +3693,27 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
}
}
else if (goal_alternative_matched[i] == -1)
- operand_reloadnum[i]
- = push_reload (modified[i] != RELOAD_WRITE ? recog_operand[i] : 0,
- modified[i] != RELOAD_READ ? recog_operand[i] : 0,
- (modified[i] != RELOAD_WRITE
- ? recog_operand_loc[i] : 0),
- modified[i] != RELOAD_READ ? recog_operand_loc[i] : 0,
- (enum reg_class) goal_alternative[i],
- (modified[i] == RELOAD_WRITE
- ? VOIDmode : operand_mode[i]),
- (modified[i] == RELOAD_READ
- ? VOIDmode : operand_mode[i]),
- (insn_code_number < 0 ? 0
- : insn_operand_strict_low[insn_code_number][i]),
- 0, i, operand_type[i]);
+ {
+ operand_reloadnum[i]
+ = push_reload ((modified[i] != RELOAD_WRITE
+ ? recog_operand[i] : 0),
+ modified[i] != RELOAD_READ ? recog_operand[i] : 0,
+ (modified[i] != RELOAD_WRITE
+ ? recog_operand_loc[i] : 0),
+ (modified[i] != RELOAD_READ
+ ? recog_operand_loc[i] : 0),
+ (enum reg_class) goal_alternative[i],
+ (modified[i] == RELOAD_WRITE
+ ? VOIDmode : operand_mode[i]),
+ (modified[i] == RELOAD_READ
+ ? VOIDmode : operand_mode[i]),
+ (insn_code_number < 0 ? 0
+ : insn_operand_strict_low[insn_code_number][i]),
+ 0, i, operand_type[i]);
+ if (modified[i] != RELOAD_READ
+ && GET_CODE (recog_operand[i]) == REG)
+ last_output_reload_regno = REGNO (recog_operand[i]);
+ }
/* In a matching pair of operands, one must be input only
and the other must be output only.
Pass the input operand as IN and the other as OUT. */
@@ -3664,6 +3730,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
operand_mode[goal_alternative_matched[i]],
0, 0, i, RELOAD_OTHER);
operand_reloadnum[goal_alternative_matched[i]] = output_reloadnum;
+ if (GET_CODE (recog_operand[goal_alternative_matched[i]]) == REG)
+ last_output_reload_regno
+ = REGNO (recog_operand[goal_alternative_matched[i]]);
}
else if (modified[i] == RELOAD_WRITE
&& modified[goal_alternative_matched[i]] == RELOAD_READ)
@@ -3678,6 +3747,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
operand_mode[i],
0, 0, i, RELOAD_OTHER);
operand_reloadnum[i] = output_reloadnum;
+ if (GET_CODE (recog_operand[i]) == REG)
+ last_output_reload_regno = REGNO (recog_operand[i]);
}
else if (insn_code_number >= 0)
abort ();
@@ -3942,17 +4013,99 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
actually fail are extremely rare, so it turns out to be better to fix
the problem here by not generating cases that choose_reload_regs will
fail for. */
-
+ /* There is a similar problem with RELOAD_FOR_INPUT_ADDRESS /
+ RELOAD_FOR_OUTPUT_ADDRESS when there is more than one of a kind for
+ a single operand.
+ We can reduce the register pressure by exploiting that a
+ RELOAD_FOR_X_ADDR_ADDR that precedes all RELOAD_FOR_X_ADDRESS reloads
+ does not conflict with any of them, if it is only used for the first of
+ the RELOAD_FOR_X_ADDRESS reloads. */
{
- int op_addr_reloads = 0;
- for (i = 0; i < n_reloads; i++)
- if (reload_when_needed[i] == RELOAD_FOR_OPERAND_ADDRESS)
- op_addr_reloads++;
+ int first_op_addr_num = -2;
+ int first_inpaddr_num[MAX_RECOG_OPERANDS];
+ int first_outpaddr_num[MAX_RECOG_OPERANDS];
+ int need_change= 0;
+ /* We use last_op_addr_reload and the contents of the above arrays
+ first as flags - -2 means no instance encountered, -1 means exactly
+ one instance encountered.
+ If more than one instance has been encountered, we store the reload
+ number of the first reload of the kind in question; reload numbers
+ are known to be non-negative. */
+ for (i = 0; i < noperands; i++)
+ first_inpaddr_num[i] = first_outpaddr_num[i] = -2;
+ for (i = n_reloads - 1; i >= 0; i--)
+ {
+ switch (reload_when_needed[i])
+ {
+ case RELOAD_FOR_OPERAND_ADDRESS:
+ if (++first_op_addr_num >= 0)
+ {
+ first_op_addr_num = i;
+ need_change = 1;
+ }
+ break;
+ case RELOAD_FOR_INPUT_ADDRESS:
+ if (++first_inpaddr_num[reload_opnum[i]] >= 0)
+ {
+ first_inpaddr_num[reload_opnum[i]] = i;
+ need_change = 1;
+ }
+ break;
+ case RELOAD_FOR_OUTPUT_ADDRESS:
+ if (++first_outpaddr_num[reload_opnum[i]] >= 0)
+ {
+ first_outpaddr_num[reload_opnum[i]] = i;
+ need_change = 1;
+ }
+ break;
+ default:
+ break;
+ }
+ }
- if (op_addr_reloads > 1)
- for (i = 0; i < n_reloads; i++)
- if (reload_when_needed[i] == RELOAD_FOR_OPADDR_ADDR)
- reload_when_needed[i] = RELOAD_FOR_OPERAND_ADDRESS;
+ if (need_change)
+ {
+ for (i = 0; i < n_reloads; i++)
+ {
+ int first_num, type;
+
+ switch (reload_when_needed[i])
+ {
+ case RELOAD_FOR_OPADDR_ADDR:
+ first_num = first_op_addr_num;
+ type = RELOAD_FOR_OPERAND_ADDRESS;
+ break;
+ case RELOAD_FOR_INPADDR_ADDRESS:
+ first_num = first_inpaddr_num[reload_opnum[i]];
+ type = RELOAD_FOR_INPUT_ADDRESS;
+ break;
+ case RELOAD_FOR_OUTADDR_ADDRESS:
+ first_num = first_outpaddr_num[reload_opnum[i]];
+ type = RELOAD_FOR_OUTPUT_ADDRESS;
+ break;
+ default:
+ continue;
+ }
+ if (first_num < 0)
+ continue;
+ else if (i > first_num)
+ reload_when_needed[i] = type;
+ else
+ {
+ /* Check if the only TYPE reload that uses reload I is
+ reload FIRST_NUM. */
+ for (j = n_reloads - 1; j > first_num; j--)
+ {
+ if (reload_when_needed[j] == type
+ && reg_mentioned_p (reload_in[i], reload_in[j]))
+ {
+ reload_when_needed[i] = type;
+ break;
+ }
+ }
+ }
+ }
+ }
}
/* See if we have any reloads that are now allowed to be merged
@@ -4264,7 +4417,18 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest)
&& (tem = operand_subword (reg_equiv_constant[regno],
SUBREG_WORD (x), 0,
GET_MODE (SUBREG_REG (x)))) != 0)
- return tem;
+ {
+ /* TEM is now a word sized constant for the bits from X that
+ we wanted. However, TEM may be the wrong representation.
+
+ Use gen_lowpart_common to convert a CONST_INT into a
+ CONST_DOUBLE and vice versa as needed according to by the mode
+ of the SUBREG. */
+ tem = gen_lowpart_common (GET_MODE (x), tem);
+ if (!tem)
+ abort ();
+ return tem;
+ }
/* If the SUBREG is wider than a word, the above test will fail.
For example, we might have a SImode SUBREG of a DImode SUBREG_REG
@@ -5688,7 +5852,14 @@ reg_overlap_mentioned_for_reload_p (x, in)
{
int regno, endregno;
- if (GET_CODE (x) == SUBREG)
+ /* Overly conservative. */
+ if (GET_CODE (x) == STRICT_LOW_PART)
+ x = XEXP (x, 0);
+
+ /* If either argument is a constant, then modifying X can not affect IN. */
+ if (CONSTANT_P (x) || CONSTANT_P (in))
+ return 0;
+ else if (GET_CODE (x) == SUBREG)
{
regno = REGNO (SUBREG_REG (x));
if (regno < FIRST_PSEUDO_REGISTER)
@@ -5710,8 +5881,6 @@ reg_overlap_mentioned_for_reload_p (x, in)
abort ();
}
}
- else if (CONSTANT_P (x))
- return 0;
else if (GET_CODE (x) == MEM)
return refers_to_mem_for_reload_p (in);
else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
@@ -5883,6 +6052,9 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
&& (valueno = true_regnum (valtry = SET_SRC (pat))) >= 0)
||
(goal_const && rtx_equal_p (SET_SRC (pat), goal)
+ /* When looking for stack pointer + const,
+ make sure we don't use a stack adjust. */
+ && !reg_overlap_mentioned_for_reload_p (SET_DEST (pat), goal)
&& (valueno = true_regnum (valtry = SET_DEST (pat))) >= 0)
|| (goal_mem
&& (valueno = true_regnum (valtry = SET_DEST (pat))) >= 0
@@ -6056,12 +6228,17 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
if (GET_RTX_CLASS (GET_CODE (p)) == 'i')
{
+ pat = PATTERN (p);
+
+ /* Watch out for unspec_volatile, and volatile asms. */
+ if (volatile_insn_p (pat))
+ return 0;
+
/* If this insn P stores in either GOAL or VALUE, return 0.
If GOAL is a memory ref and this insn writes memory, return 0.
If GOAL is a memory ref and its address is not constant,
and this insn P changes a register used in GOAL, return 0. */
- pat = PATTERN (p);
if (GET_CODE (pat) == SET || GET_CODE (pat) == CLOBBER)
{
register rtx dest = SET_DEST (pat);
@@ -6086,6 +6263,8 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
if (goal_mem_addr_varies
&& reg_overlap_mentioned_for_reload_p (dest, goal))
return 0;
+ if (xregno == STACK_POINTER_REGNUM && need_stable_sp)
+ return 0;
}
else if (goal_mem && GET_CODE (dest) == MEM
&& ! push_operand (dest, GET_MODE (dest)))
@@ -6128,6 +6307,8 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
&& reg_overlap_mentioned_for_reload_p (dest,
goal))
return 0;
+ if (xregno == STACK_POINTER_REGNUM && need_stable_sp)
+ return 0;
}
else if (goal_mem && GET_CODE (dest) == MEM
&& ! push_operand (dest, GET_MODE (dest)))
diff --git a/gcc/reload.h b/gcc/reload.h
index 3ca2e98b61a..e86296cb87c 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -142,6 +142,81 @@ extern enum insn_code reload_in_optab[];
extern enum insn_code reload_out_optab[];
#endif
+struct needs
+{
+ /* [0] is normal, [1] is nongroup. */
+ short regs[2][N_REG_CLASSES];
+ short groups[N_REG_CLASSES];
+};
+
+#if defined SET_HARD_REG_BIT && defined CLEAR_REG_SET
+/* This structure describes instructions which are relevant for reload.
+ Apart from all regular insns, this also includes CODE_LABELs, since they
+ must be examined for register elimination. */
+struct insn_chain
+{
+ /* Links to the neighbour instructions. */
+ struct insn_chain *next, *prev;
+
+ /* Link through a chains set up by calculate_needs_all_insns, containing
+ all insns that need reloading. */
+ struct insn_chain *next_need_reload;
+
+ /* The basic block this insn is in. */
+ int block;
+ /* The rtx of the insn. */
+ rtx insn;
+ /* Register life information: record all live hard registers, and all
+ live pseudos that have a hard register.
+ This information is recorded for the point immediately before the insn
+ (in live_before), and for the point within the insn at which all
+ outputs have just been written to (in live_after). */
+ regset live_before;
+ regset live_after;
+
+ /* For each class, size of group of consecutive regs
+ that is needed for the reloads of this class. */
+ char group_size[N_REG_CLASSES];
+ /* For each class, the machine mode which requires consecutive
+ groups of regs of that class.
+ If two different modes ever require groups of one class,
+ they must be the same size and equally restrictive for that class,
+ otherwise we can't handle the complexity. */
+ enum machine_mode group_mode[N_REG_CLASSES];
+
+ /* Indicates if a register was counted against the need for
+ groups. 0 means it can count against max_nongroup instead. */
+ HARD_REG_SET counted_for_groups;
+
+ /* Indicates if a register was counted against the need for
+ non-groups. 0 means it can become part of a new group.
+ During choose_reload_regs, 1 here means don't use this reg
+ as part of a group, even if it seems to be otherwise ok. */
+ HARD_REG_SET counted_for_nongroups;
+
+ /* Indicates which registers have already been used for spills. */
+ HARD_REG_SET used_spill_regs;
+
+ /* Describe the needs for reload registers of this insn. */
+ struct needs need;
+
+ /* Nonzero if find_reloads said the insn requires reloading. */
+ unsigned int need_reload:1;
+ /* Nonzero if eliminate_regs_in_insn said it requires eliminations. */
+ unsigned int need_elim:1;
+ /* Nonzero if this insn was inserted by perform_caller_saves. */
+ unsigned int is_caller_save_insn:1;
+};
+
+/* A chain of insn_chain structures to describe all non-note insns in
+ a function. */
+extern struct insn_chain *reload_insn_chain;
+
+/* Allocate a new insn_chain structure. */
+extern struct insn_chain *new_insn_chain PROTO((void));
+
+#endif
+
/* Functions from reload.c: */
/* Return a memory location that will be used to copy X in mode MODE.
@@ -157,6 +232,9 @@ extern void clear_secondary_mem PROTO((void));
reload TO. */
extern void transfer_replacements PROTO((int, int));
+/* Remove all replacements in reload FROM. */
+extern void remove_replacements PROTO((int));
+
/* Like rtx_equal_p except that it allows a REG and a SUBREG to match
if they are the same hard reg, and has special hacks for
autoincrement and autodecrement. */
@@ -217,6 +295,8 @@ extern int regno_clobbered_p PROTO((int, rtx));
/* Functions in reload1.c: */
+extern int reloads_conflict PROTO ((int, int));
+
int count_occurrences PROTO((rtx, rtx));
/* Initialize the reload pass once per compilation. */
@@ -247,7 +327,7 @@ extern void init_caller_save PROTO((void));
extern void init_save_areas PROTO((void));
/* Allocate save areas for any hard registers that might need saving. */
-extern int setup_save_areas PROTO((int *));
+extern void setup_save_areas PROTO((void));
/* Find the places where hard regs are live across calls and save them. */
-extern void save_call_clobbered_regs PROTO((enum machine_mode));
+extern void save_call_clobbered_regs PROTO((void));
diff --git a/gcc/reload1.c b/gcc/reload1.c
index fc399dfa3cb..15a43eeca41 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+
+#include "machmode.h"
+#include "hard-reg-set.h"
#include "rtl.h"
#include "obstack.h"
#include "insn-config.h"
@@ -29,10 +32,9 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "expr.h"
#include "regs.h"
-#include "hard-reg-set.h"
+#include "basic-block.h"
#include "reload.h"
#include "recog.h"
-#include "basic-block.h"
#include "output.h"
#include "real.h"
#include "toplev.h"
@@ -277,6 +279,13 @@ enum insn_code reload_out_optab[NUM_MACHINE_MODES];
insn. */
struct obstack reload_obstack;
+
+/* Points to the beginning of the reload_obstack. All insn_chain structures
+ are allocated first. */
+char *reload_startobj;
+
+/* The point after all insn_chain structures. Used to quickly deallocate
+ memory used while processing one insn. */
char *reload_firstobj;
#define obstack_chunk_alloc xmalloc
@@ -285,8 +294,9 @@ char *reload_firstobj;
/* List of labels that must never be deleted. */
extern rtx forced_labels;
-/* Allocation number table from global register allocation. */
-extern int *reg_allocno;
+/* List of insn_chain instructions, one for every insn that reload needs to
+ examine. */
+struct insn_chain *reload_insn_chain;
/* This structure is used to record information about register eliminations.
Each array entry describes one possible way of eliminating a register
@@ -349,25 +359,34 @@ static int num_labels;
struct hard_reg_n_uses { int regno; int uses; };
+static void dump_needs PROTO((FILE *));
+static int calculate_needs_all_insns PROTO((rtx, int));
+static int calculate_needs PROTO((int, rtx, rtx, int));
+static int find_reload_regs PROTO((int, FILE *));
+static int find_tworeg_group PROTO((int, int, FILE *));
+static int find_group PROTO((int, int, FILE *));
static int possible_group_p PROTO((int, int *));
static void count_possible_groups PROTO((int *, enum machine_mode *,
int *, int));
static int modes_equiv_for_class_p PROTO((enum machine_mode,
enum machine_mode,
enum reg_class));
+static void delete_caller_save_insns PROTO((rtx));
static void spill_failure PROTO((rtx));
static int new_spill_reg PROTO((int, int, int *, int *, int,
FILE *));
static void delete_dead_insn PROTO((rtx));
static void alter_reg PROTO((int, int));
-static void mark_scratch_live PROTO((rtx));
static void set_label_offsets PROTO((rtx, rtx, int));
static int eliminate_regs_in_insn PROTO((rtx, int));
static void mark_not_eliminable PROTO((rtx, rtx));
+static void set_initial_elim_offsets PROTO((void));
+static void init_elim_table PROTO((void));
+static void update_eliminables PROTO((HARD_REG_SET *));
static int spill_hard_reg PROTO((int, int, FILE *, int));
static void scan_paradoxical_subregs PROTO((rtx));
static int hard_reg_use_compare PROTO((const GENERIC_PTR, const GENERIC_PTR));
-static void order_regs_for_reload PROTO((int));
+static void order_regs_for_reload PROTO((void));
static int compare_spill_regs PROTO((const GENERIC_PTR, const GENERIC_PTR));
static void reload_as_needed PROTO((rtx, int));
static void forget_old_reloads_1 PROTO((rtx, rtx));
@@ -377,15 +396,20 @@ static void mark_reload_reg_in_use PROTO((int, int, enum reload_type,
static void clear_reload_reg_in_use PROTO((int, int, enum reload_type,
enum machine_mode));
static int reload_reg_free_p PROTO((int, int, enum reload_type));
-static int reload_reg_free_before_p PROTO((int, int, enum reload_type));
+static int reload_reg_free_before_p PROTO((int, int, enum reload_type, int));
+static int reload_reg_free_for_value_p PROTO((int, int, enum reload_type, rtx, rtx, int));
static int reload_reg_reaches_end_p PROTO((int, int, enum reload_type));
static int allocate_reload_reg PROTO((int, rtx, int, int));
static void choose_reload_regs PROTO((rtx, rtx));
static void merge_assigned_reloads PROTO((rtx));
-static void emit_reload_insns PROTO((rtx));
+static void emit_reload_insns PROTO((rtx, int));
static void delete_output_reload PROTO((rtx, int, rtx));
static void inc_for_reload PROTO((rtx, rtx, int));
static int constraint_accepts_reg_p PROTO((char *, rtx));
+static void find_set_and_used_regs PROTO((rtx, int, int));
+static void calc_reg_usage PROTO((rtx, int));
+
+static void reload_cse_regs_1 PROTO((rtx));
static void reload_cse_invalidate_regno PROTO((int, enum machine_mode, int));
static int reload_cse_mem_conflict_p PROTO((rtx, rtx));
static void reload_cse_invalidate_mem PROTO((rtx));
@@ -396,8 +420,11 @@ static int reload_cse_simplify_set PROTO((rtx, rtx));
static int reload_cse_simplify_operands PROTO((rtx));
static void reload_cse_check_clobber PROTO((rtx, rtx));
static void reload_cse_record_set PROTO((rtx, rtx));
-static void reload_cse_delete_death_notes PROTO((rtx));
-static void reload_cse_no_longer_dead PROTO((int, enum machine_mode));
+static void reload_combine PROTO((void));
+static void reload_combine_note_use PROTO((rtx *, rtx));
+static void reload_combine_note_store PROTO((rtx, rtx));
+static void reload_cse_move2add PROTO((rtx));
+static void move2add_note_store PROTO((rtx, rtx));
/* Initialize the reload pass once per compilation. */
@@ -447,7 +474,7 @@ init_reload ()
/* Initialize obstack for our rtl allocation. */
gcc_obstack_init (&reload_obstack);
- reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_startobj = (char *) obstack_alloc (&reload_obstack, 0);
/* Decide which register class should be used when reloading
addresses. If we are using SMALL_REGISTER_CLASSES, and any
@@ -508,6 +535,71 @@ init_reload ()
}
}
+/* List of insn chains that are currently unused. */
+static struct insn_chain *unused_insn_chains = 0;
+
+/* Allocate an empty insn_chain structure. */
+struct insn_chain *
+new_insn_chain ()
+{
+ struct insn_chain *c;
+
+ if (unused_insn_chains == 0)
+ {
+ c = obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
+ c->live_before = OBSTACK_ALLOC_REG_SET (&reload_obstack);
+ c->live_after = OBSTACK_ALLOC_REG_SET (&reload_obstack);
+ }
+ else
+ {
+ c = unused_insn_chains;
+ unused_insn_chains = c->next;
+ }
+ c->is_caller_save_insn = 0;
+ c->need_reload = 0;
+ c->need_elim = 0;
+ return c;
+}
+
+/* Global variables used by reload and its subroutines. */
+
+/* Set during calculate_needs if an insn needs reloading. */
+static int something_needs_reloads;
+/* Set during calculate_needs if an insn needs register elimination. */
+static int something_needs_elimination;
+
+/* For each class, number of reload regs needed in that class.
+ This is the maximum over all insns of the needs in that class
+ of the individual insn. */
+static int max_needs[N_REG_CLASSES];
+
+/* For each class, size of group of consecutive regs
+ that is needed for the reloads of this class. */
+static int group_size[N_REG_CLASSES];
+
+/* For each class, max number of consecutive groups needed.
+ (Each group contains group_size[CLASS] consecutive registers.) */
+static int max_groups[N_REG_CLASSES];
+
+/* For each class, max number needed of regs that don't belong
+ to any of the groups. */
+static int max_nongroups[N_REG_CLASSES];
+
+/* For each class, the machine mode which requires consecutive
+ groups of regs of that class.
+ If two different modes ever require groups of one class,
+ they must be the same size and equally restrictive for that class,
+ otherwise we can't handle the complexity. */
+static enum machine_mode group_mode[N_REG_CLASSES];
+
+/* Record the insn where each maximum need is first found. */
+static rtx max_needs_insn[N_REG_CLASSES];
+static rtx max_groups_insn[N_REG_CLASSES];
+static rtx max_nongroups_insn[N_REG_CLASSES];
+
+/* Nonzero means we couldn't get enough spill regs. */
+static int failure;
+
/* Main entry point for the reload pass.
FIRST is the first insn of the function being compiled.
@@ -532,8 +624,7 @@ reload (first, global, dumpfile)
int global;
FILE *dumpfile;
{
- register int class;
- register int i, j, k;
+ register int i, j;
register rtx insn;
register struct elim_table *ep;
@@ -543,21 +634,18 @@ reload (first, global, dumpfile)
int (*real_at_ptr)[NUM_ELIMINABLE_REGS];
int something_changed;
- int something_needs_reloads;
- int something_needs_elimination;
- int new_basic_block_needs;
- enum reg_class caller_save_spill_class = NO_REGS;
- int caller_save_group_size = 1;
-
- /* Nonzero means we couldn't get enough spill regs. */
- int failure = 0;
-
- /* The basic block number currently being processed for INSN. */
- int this_block;
/* Make sure even insns with volatile mem refs are recognizable. */
init_recog ();
+ failure = 0;
+
+ reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+
+ /* Make sure that the last insn in the chain
+ is not something that needs reloading. */
+ emit_note (NULL_PTR, NOTE_INSN_DELETED);
+
/* Enable find_equiv_reg to distinguish insns made by reload. */
reload_first_uid = get_max_uid ();
@@ -598,14 +686,6 @@ reload (first, global, dumpfile)
regs_ever_live[i] = 1;
}
- for (i = 0; i < scratch_list_length; i++)
- if (scratch_list[i])
- mark_scratch_live (scratch_list[i]);
-
- /* Make sure that the last insn in the chain
- is not something that needs reloading. */
- emit_note (NULL_PTR, NOTE_INSN_DELETED);
-
/* Find all the pseudo registers that didn't get hard regs
but do have known equivalent constants or memory slots.
These include parameters (known equivalent to parameter slots)
@@ -616,17 +696,17 @@ reload (first, global, dumpfile)
Record memory equivalents in reg_mem_equiv so they can
be substituted eventually by altering the REG-rtx's. */
- reg_equiv_constant = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_constant = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_constant, max_regno * sizeof (rtx));
- reg_equiv_memory_loc = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_memory_loc = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_memory_loc, max_regno * sizeof (rtx));
- reg_equiv_mem = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_mem = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_mem, max_regno * sizeof (rtx));
- reg_equiv_init = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_init = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_init, max_regno * sizeof (rtx));
- reg_equiv_address = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_address = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_address, max_regno * sizeof (rtx));
- reg_max_ref_width = (int *) alloca (max_regno * sizeof (int));
+ reg_max_ref_width = (int *) xmalloc (max_regno * sizeof (int));
bzero ((char *) reg_max_ref_width, max_regno * sizeof (int));
if (SMALL_REGISTER_CLASSES)
@@ -707,46 +787,7 @@ reload (first, global, dumpfile)
scan_paradoxical_subregs (PATTERN (insn));
}
- /* Does this function require a frame pointer? */
-
- frame_pointer_needed = (! flag_omit_frame_pointer
-#ifdef EXIT_IGNORE_STACK
- /* ?? If EXIT_IGNORE_STACK is set, we will not save
- and restore sp for alloca. So we can't eliminate
- the frame pointer in that case. At some point,
- we should improve this by emitting the
- sp-adjusting insns for this case. */
- || (current_function_calls_alloca
- && EXIT_IGNORE_STACK)
-#endif
- || FRAME_POINTER_REQUIRED);
-
- num_eliminable = 0;
-
- /* Initialize the table of registers to eliminate. The way we do this
- depends on how the eliminable registers were defined. */
-#ifdef ELIMINABLE_REGS
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- {
- ep->can_eliminate = ep->can_eliminate_previous
- = (CAN_ELIMINATE (ep->from, ep->to)
- && ! (ep->to == STACK_POINTER_REGNUM && frame_pointer_needed));
- }
-#else
- reg_eliminate[0].can_eliminate = reg_eliminate[0].can_eliminate_previous
- = ! frame_pointer_needed;
-#endif
-
- /* Count the number of eliminable registers and build the FROM and TO
- REG rtx's. Note that code in gen_rtx will cause, e.g.,
- gen_rtx (REG, Pmode, STACK_POINTER_REGNUM) to equal stack_pointer_rtx.
- We depend on this. */
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- {
- num_eliminable += ep->can_eliminate;
- ep->from_rtx = gen_rtx_REG (Pmode, ep->from);
- ep->to_rtx = gen_rtx_REG (Pmode, ep->to);
- }
+ init_elim_table ();
num_labels = max_label_num () - get_first_label_num ();
@@ -796,14 +837,20 @@ reload (first, global, dumpfile)
{
free (real_known_ptr);
free (real_at_ptr);
- return;
+ free (reg_equiv_constant);
+ free (reg_equiv_memory_loc);
+ free (reg_equiv_mem);
+ free (reg_equiv_init);
+ free (reg_equiv_address);
+ free (reg_max_ref_width);
+ return 0;
}
#endif
/* Compute the order of preference for hard registers to spill.
Store them by decreasing preference in potential_reload_regs. */
- order_regs_for_reload (global);
+ order_regs_for_reload ();
/* So far, no hard regs have been spilled. */
n_spills = 0;
@@ -855,37 +902,7 @@ reload (first, global, dumpfile)
something_needs_elimination = 0;
while (something_changed)
{
- rtx after_call = 0;
-
- /* For each class, number of reload regs needed in that class.
- This is the maximum over all insns of the needs in that class
- of the individual insn. */
- int max_needs[N_REG_CLASSES];
- /* For each class, size of group of consecutive regs
- that is needed for the reloads of this class. */
- int group_size[N_REG_CLASSES];
- /* For each class, max number of consecutive groups needed.
- (Each group contains group_size[CLASS] consecutive registers.) */
- int max_groups[N_REG_CLASSES];
- /* For each class, max number needed of regs that don't belong
- to any of the groups. */
- int max_nongroups[N_REG_CLASSES];
- /* For each class, the machine mode which requires consecutive
- groups of regs of that class.
- If two different modes ever require groups of one class,
- they must be the same size and equally restrictive for that class,
- otherwise we can't handle the complexity. */
- enum machine_mode group_mode[N_REG_CLASSES];
- /* Record the insn where each maximum need is first found. */
- rtx max_needs_insn[N_REG_CLASSES];
- rtx max_groups_insn[N_REG_CLASSES];
- rtx max_nongroups_insn[N_REG_CLASSES];
- rtx x;
HOST_WIDE_INT starting_frame_size;
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- int previous_frame_pointer_needed = frame_pointer_needed;
-#endif
- static char *reg_class_names[] = REG_CLASS_NAMES;
something_changed = 0;
bzero ((char *) max_needs, sizeof max_needs);
@@ -898,13 +915,6 @@ reload (first, global, dumpfile)
for (i = 0; i < N_REG_CLASSES; i++)
group_mode[i] = VOIDmode;
- /* Keep track of which basic blocks are needing the reloads. */
- this_block = 0;
-
- /* Remember whether any element of basic_block_needs
- changes from 0 to 1 in this pass. */
- new_basic_block_needs = 0;
-
/* Round size of stack frame to BIGGEST_ALIGNMENT. This must be done
here because the stack size may be a part of the offset computation
for register elimination, and there might have been new stack slots
@@ -913,39 +923,8 @@ reload (first, global, dumpfile)
starting_frame_size = get_frame_size ();
- /* Reset all offsets on eliminable registers to their initial values. */
-#ifdef ELIMINABLE_REGS
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- {
- INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, ep->initial_offset);
- ep->previous_offset = ep->offset
- = ep->max_offset = ep->initial_offset;
- }
-#else
-#ifdef INITIAL_FRAME_POINTER_OFFSET
- INITIAL_FRAME_POINTER_OFFSET (reg_eliminate[0].initial_offset);
-#else
- if (!FRAME_POINTER_REQUIRED)
- abort ();
- reg_eliminate[0].initial_offset = 0;
-#endif
- reg_eliminate[0].previous_offset = reg_eliminate[0].max_offset
- = reg_eliminate[0].offset = reg_eliminate[0].initial_offset;
-#endif
-
- num_not_at_initial_offset = 0;
-
- bzero ((char *) &offsets_known_at[get_first_label_num ()], num_labels);
-
- /* Set a known offset for each forced label to be at the initial offset
- of each elimination. We do this because we assume that all
- computed jumps occur from a location where each elimination is
- at its initial offset. */
-
- for (x = forced_labels; x; x = XEXP (x, 1))
- if (XEXP (x, 0))
- set_label_offsets (XEXP (x, 0), NULL_RTX, 1);
-
+ set_initial_elim_offsets ();
+
/* For each pseudo register that has an equivalent location defined,
try to eliminate any eliminable registers (such as the frame pointer)
assuming initial offsets for the replacement register, which
@@ -1002,525 +981,29 @@ reload (first, global, dumpfile)
}
}
+ /* Insert code to save and restore call-clobbered hard regs
+ around calls. Tell if what mode to use so that we will process
+ those insns in reload_as_needed if we have to. */
+
+ if (caller_save_needed)
+ setup_save_areas ();
+
+ if (starting_frame_size != get_frame_size ())
+ something_changed = 1;
+
/* If we allocated another pseudo to the stack, redo elimination
bookkeeping. */
if (something_changed)
continue;
- /* If caller-saves needs a group, initialize the group to include
- the size and mode required for caller-saves. */
-
- if (caller_save_group_size > 1)
+ if (caller_save_needed)
{
- group_mode[(int) caller_save_spill_class] = Pmode;
- group_size[(int) caller_save_spill_class] = caller_save_group_size;
+ save_call_clobbered_regs ();
+ /* That might have allocated new insn_chain structures. */
+ reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
}
- /* Compute the most additional registers needed by any instruction.
- Collect information separately for each class of regs. */
-
- for (insn = first; insn; insn = NEXT_INSN (insn))
- {
- if (global && this_block + 1 < n_basic_blocks
- && insn == basic_block_head[this_block+1])
- ++this_block;
-
- /* If this is a label, a JUMP_INSN, or has REG_NOTES (which
- might include REG_LABEL), we need to see what effects this
- has on the known offsets at labels. */
-
- if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN
- || (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && REG_NOTES (insn) != 0))
- set_label_offsets (insn, insn, 0);
-
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- {
- /* Nonzero means don't use a reload reg that overlaps
- the place where a function value can be returned. */
- rtx avoid_return_reg = 0;
-
- rtx old_body = PATTERN (insn);
- int old_code = INSN_CODE (insn);
- rtx old_notes = REG_NOTES (insn);
- int did_elimination = 0;
-
- /* To compute the number of reload registers of each class
- needed for an insn, we must simulate what choose_reload_regs
- can do. We do this by splitting an insn into an "input" and
- an "output" part. RELOAD_OTHER reloads are used in both.
- The input part uses those reloads, RELOAD_FOR_INPUT reloads,
- which must be live over the entire input section of reloads,
- and the maximum of all the RELOAD_FOR_INPUT_ADDRESS and
- RELOAD_FOR_OPERAND_ADDRESS reloads, which conflict with the
- inputs.
-
- The registers needed for output are RELOAD_OTHER and
- RELOAD_FOR_OUTPUT, which are live for the entire output
- portion, and the maximum of all the RELOAD_FOR_OUTPUT_ADDRESS
- reloads for each operand.
-
- The total number of registers needed is the maximum of the
- inputs and outputs. */
-
- struct needs
- {
- /* [0] is normal, [1] is nongroup. */
- int regs[2][N_REG_CLASSES];
- int groups[N_REG_CLASSES];
- };
-
- /* Each `struct needs' corresponds to one RELOAD_... type. */
- struct {
- struct needs other;
- struct needs input;
- struct needs output;
- struct needs insn;
- struct needs other_addr;
- struct needs op_addr;
- struct needs op_addr_reload;
- struct needs in_addr[MAX_RECOG_OPERANDS];
- struct needs in_addr_addr[MAX_RECOG_OPERANDS];
- struct needs out_addr[MAX_RECOG_OPERANDS];
- struct needs out_addr_addr[MAX_RECOG_OPERANDS];
- } insn_needs;
-
- /* If needed, eliminate any eliminable registers. */
- if (num_eliminable)
- did_elimination = eliminate_regs_in_insn (insn, 0);
-
- /* Set avoid_return_reg if this is an insn
- that might use the value of a function call. */
- if (SMALL_REGISTER_CLASSES && GET_CODE (insn) == CALL_INSN)
- {
- if (GET_CODE (PATTERN (insn)) == SET)
- after_call = SET_DEST (PATTERN (insn));
- else if (GET_CODE (PATTERN (insn)) == PARALLEL
- && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == SET)
- after_call = SET_DEST (XVECEXP (PATTERN (insn), 0, 0));
- else
- after_call = 0;
- }
- else if (SMALL_REGISTER_CLASSES && after_call != 0
- && !(GET_CODE (PATTERN (insn)) == SET
- && SET_DEST (PATTERN (insn)) == stack_pointer_rtx)
- && GET_CODE (PATTERN (insn)) != USE)
- {
- if (reg_referenced_p (after_call, PATTERN (insn)))
- avoid_return_reg = after_call;
- after_call = 0;
- }
-
- /* Analyze the instruction. */
- find_reloads (insn, 0, spill_indirect_levels, global,
- spill_reg_order);
-
- /* Remember for later shortcuts which insns had any reloads or
- register eliminations.
-
- One might think that it would be worthwhile to mark insns
- that need register replacements but not reloads, but this is
- not safe because find_reloads may do some manipulation of
- the insn (such as swapping commutative operands), which would
- be lost when we restore the old pattern after register
- replacement. So the actions of find_reloads must be redone in
- subsequent passes or in reload_as_needed.
-
- However, it is safe to mark insns that need reloads
- but not register replacement. */
-
- PUT_MODE (insn, (did_elimination ? QImode
- : n_reloads ? HImode
- : GET_MODE (insn) == DImode ? DImode
- : VOIDmode));
-
- /* Discard any register replacements done. */
- if (did_elimination)
- {
- obstack_free (&reload_obstack, reload_firstobj);
- PATTERN (insn) = old_body;
- INSN_CODE (insn) = old_code;
- REG_NOTES (insn) = old_notes;
- something_needs_elimination = 1;
- }
-
- /* If this insn has no reloads, we need not do anything except
- in the case of a CALL_INSN when we have caller-saves and
- caller-save needs reloads. */
-
- if (n_reloads == 0
- && ! (GET_CODE (insn) == CALL_INSN
- && caller_save_spill_class != NO_REGS))
- continue;
-
- something_needs_reloads = 1;
- bzero ((char *) &insn_needs, sizeof insn_needs);
-
- /* Count each reload once in every class
- containing the reload's own class. */
-
- for (i = 0; i < n_reloads; i++)
- {
- register enum reg_class *p;
- enum reg_class class = reload_reg_class[i];
- int size;
- enum machine_mode mode;
- struct needs *this_needs;
-
- /* Don't count the dummy reloads, for which one of the
- regs mentioned in the insn can be used for reloading.
- Don't count optional reloads.
- Don't count reloads that got combined with others. */
- if (reload_reg_rtx[i] != 0
- || reload_optional[i] != 0
- || (reload_out[i] == 0 && reload_in[i] == 0
- && ! reload_secondary_p[i]))
- continue;
-
- /* Show that a reload register of this class is needed
- in this basic block. We do not use insn_needs and
- insn_groups because they are overly conservative for
- this purpose. */
- if (global && ! basic_block_needs[(int) class][this_block])
- {
- basic_block_needs[(int) class][this_block] = 1;
- new_basic_block_needs = 1;
- }
-
- mode = reload_inmode[i];
- if (GET_MODE_SIZE (reload_outmode[i]) > GET_MODE_SIZE (mode))
- mode = reload_outmode[i];
- size = CLASS_MAX_NREGS (class, mode);
-
- /* Decide which time-of-use to count this reload for. */
- switch (reload_when_needed[i])
- {
- case RELOAD_OTHER:
- this_needs = &insn_needs.other;
- break;
- case RELOAD_FOR_INPUT:
- this_needs = &insn_needs.input;
- break;
- case RELOAD_FOR_OUTPUT:
- this_needs = &insn_needs.output;
- break;
- case RELOAD_FOR_INSN:
- this_needs = &insn_needs.insn;
- break;
- case RELOAD_FOR_OTHER_ADDRESS:
- this_needs = &insn_needs.other_addr;
- break;
- case RELOAD_FOR_INPUT_ADDRESS:
- this_needs = &insn_needs.in_addr[reload_opnum[i]];
- break;
- case RELOAD_FOR_INPADDR_ADDRESS:
- this_needs = &insn_needs.in_addr_addr[reload_opnum[i]];
- break;
- case RELOAD_FOR_OUTPUT_ADDRESS:
- this_needs = &insn_needs.out_addr[reload_opnum[i]];
- break;
- case RELOAD_FOR_OUTADDR_ADDRESS:
- this_needs = &insn_needs.out_addr_addr[reload_opnum[i]];
- break;
- case RELOAD_FOR_OPERAND_ADDRESS:
- this_needs = &insn_needs.op_addr;
- break;
- case RELOAD_FOR_OPADDR_ADDR:
- this_needs = &insn_needs.op_addr_reload;
- break;
- }
-
- if (size > 1)
- {
- enum machine_mode other_mode, allocate_mode;
-
- /* Count number of groups needed separately from
- number of individual regs needed. */
- this_needs->groups[(int) class]++;
- p = reg_class_superclasses[(int) class];
- while (*p != LIM_REG_CLASSES)
- this_needs->groups[(int) *p++]++;
-
- /* Record size and mode of a group of this class. */
- /* If more than one size group is needed,
- make all groups the largest needed size. */
- if (group_size[(int) class] < size)
- {
- other_mode = group_mode[(int) class];
- allocate_mode = mode;
-
- group_size[(int) class] = size;
- group_mode[(int) class] = mode;
- }
- else
- {
- other_mode = mode;
- allocate_mode = group_mode[(int) class];
- }
-
- /* Crash if two dissimilar machine modes both need
- groups of consecutive regs of the same class. */
-
- if (other_mode != VOIDmode && other_mode != allocate_mode
- && ! modes_equiv_for_class_p (allocate_mode,
- other_mode, class))
- fatal_insn ("Two dissimilar machine modes both need groups of consecutive regs of the same class",
- insn);
- }
- else if (size == 1)
- {
- this_needs->regs[reload_nongroup[i]][(int) class] += 1;
- p = reg_class_superclasses[(int) class];
- while (*p != LIM_REG_CLASSES)
- this_needs->regs[reload_nongroup[i]][(int) *p++] += 1;
- }
- else
- abort ();
- }
-
- /* All reloads have been counted for this insn;
- now merge the various times of use.
- This sets insn_needs, etc., to the maximum total number
- of registers needed at any point in this insn. */
-
- for (i = 0; i < N_REG_CLASSES; i++)
- {
- int in_max, out_max;
-
- /* Compute normal and nongroup needs. */
- for (j = 0; j <= 1; j++)
- {
- for (in_max = 0, out_max = 0, k = 0;
- k < reload_n_operands; k++)
- {
- in_max
- = MAX (in_max,
- (insn_needs.in_addr[k].regs[j][i]
- + insn_needs.in_addr_addr[k].regs[j][i]));
- out_max
- = MAX (out_max, insn_needs.out_addr[k].regs[j][i]);
- out_max
- = MAX (out_max,
- insn_needs.out_addr_addr[k].regs[j][i]);
- }
-
- /* RELOAD_FOR_INSN reloads conflict with inputs, outputs,
- and operand addresses but not things used to reload
- them. Similarly, RELOAD_FOR_OPERAND_ADDRESS reloads
- don't conflict with things needed to reload inputs or
- outputs. */
-
- in_max = MAX (MAX (insn_needs.op_addr.regs[j][i],
- insn_needs.op_addr_reload.regs[j][i]),
- in_max);
-
- out_max = MAX (out_max, insn_needs.insn.regs[j][i]);
-
- insn_needs.input.regs[j][i]
- = MAX (insn_needs.input.regs[j][i]
- + insn_needs.op_addr.regs[j][i]
- + insn_needs.insn.regs[j][i],
- in_max + insn_needs.input.regs[j][i]);
-
- insn_needs.output.regs[j][i] += out_max;
- insn_needs.other.regs[j][i]
- += MAX (MAX (insn_needs.input.regs[j][i],
- insn_needs.output.regs[j][i]),
- insn_needs.other_addr.regs[j][i]);
-
- }
-
- /* Now compute group needs. */
- for (in_max = 0, out_max = 0, j = 0;
- j < reload_n_operands; j++)
- {
- in_max = MAX (in_max, insn_needs.in_addr[j].groups[i]);
- in_max = MAX (in_max,
- insn_needs.in_addr_addr[j].groups[i]);
- out_max
- = MAX (out_max, insn_needs.out_addr[j].groups[i]);
- out_max
- = MAX (out_max, insn_needs.out_addr_addr[j].groups[i]);
- }
-
- in_max = MAX (MAX (insn_needs.op_addr.groups[i],
- insn_needs.op_addr_reload.groups[i]),
- in_max);
- out_max = MAX (out_max, insn_needs.insn.groups[i]);
-
- insn_needs.input.groups[i]
- = MAX (insn_needs.input.groups[i]
- + insn_needs.op_addr.groups[i]
- + insn_needs.insn.groups[i],
- in_max + insn_needs.input.groups[i]);
-
- insn_needs.output.groups[i] += out_max;
- insn_needs.other.groups[i]
- += MAX (MAX (insn_needs.input.groups[i],
- insn_needs.output.groups[i]),
- insn_needs.other_addr.groups[i]);
- }
-
- /* If this is a CALL_INSN and caller-saves will need
- a spill register, act as if the spill register is
- needed for this insn. However, the spill register
- can be used by any reload of this insn, so we only
- need do something if no need for that class has
- been recorded.
-
- The assumption that every CALL_INSN will trigger a
- caller-save is highly conservative, however, the number
- of cases where caller-saves will need a spill register but
- a block containing a CALL_INSN won't need a spill register
- of that class should be quite rare.
-
- If a group is needed, the size and mode of the group will
- have been set up at the beginning of this loop. */
-
- if (GET_CODE (insn) == CALL_INSN
- && caller_save_spill_class != NO_REGS)
- {
- /* See if this register would conflict with any reload that
- needs a group or any reload that needs a nongroup. */
- int nongroup_need = 0;
- int *caller_save_needs;
-
- for (j = 0; j < n_reloads; j++)
- if (reg_classes_intersect_p (caller_save_spill_class,
- reload_reg_class[j])
- && ((CLASS_MAX_NREGS
- (reload_reg_class[j],
- (GET_MODE_SIZE (reload_outmode[j])
- > GET_MODE_SIZE (reload_inmode[j]))
- ? reload_outmode[j] : reload_inmode[j])
- > 1)
- || reload_nongroup[j]))
- {
- nongroup_need = 1;
- break;
- }
-
- caller_save_needs
- = (caller_save_group_size > 1
- ? insn_needs.other.groups
- : insn_needs.other.regs[nongroup_need]);
-
- if (caller_save_needs[(int) caller_save_spill_class] == 0)
- {
- register enum reg_class *p
- = reg_class_superclasses[(int) caller_save_spill_class];
-
- caller_save_needs[(int) caller_save_spill_class]++;
-
- while (*p != LIM_REG_CLASSES)
- caller_save_needs[(int) *p++] += 1;
- }
-
- /* Show that this basic block will need a register of
- this class. */
-
- if (global
- && ! (basic_block_needs[(int) caller_save_spill_class]
- [this_block]))
- {
- basic_block_needs[(int) caller_save_spill_class]
- [this_block] = 1;
- new_basic_block_needs = 1;
- }
- }
-
- /* If this insn stores the value of a function call,
- and that value is in a register that has been spilled,
- and if the insn needs a reload in a class
- that might use that register as the reload register,
- then add an extra need in that class.
- This makes sure we have a register available that does
- not overlap the return value. */
-
- if (SMALL_REGISTER_CLASSES && avoid_return_reg)
- {
- int regno = REGNO (avoid_return_reg);
- int nregs
- = HARD_REGNO_NREGS (regno, GET_MODE (avoid_return_reg));
- int r;
- int basic_needs[N_REG_CLASSES], basic_groups[N_REG_CLASSES];
-
- /* First compute the "basic needs", which counts a
- need only in the smallest class in which it
- is required. */
-
- bcopy ((char *) insn_needs.other.regs[0],
- (char *) basic_needs, sizeof basic_needs);
- bcopy ((char *) insn_needs.other.groups,
- (char *) basic_groups, sizeof basic_groups);
-
- for (i = 0; i < N_REG_CLASSES; i++)
- {
- enum reg_class *p;
-
- if (basic_needs[i] >= 0)
- for (p = reg_class_superclasses[i];
- *p != LIM_REG_CLASSES; p++)
- basic_needs[(int) *p] -= basic_needs[i];
-
- if (basic_groups[i] >= 0)
- for (p = reg_class_superclasses[i];
- *p != LIM_REG_CLASSES; p++)
- basic_groups[(int) *p] -= basic_groups[i];
- }
-
- /* Now count extra regs if there might be a conflict with
- the return value register. */
-
- for (r = regno; r < regno + nregs; r++)
- if (spill_reg_order[r] >= 0)
- for (i = 0; i < N_REG_CLASSES; i++)
- if (TEST_HARD_REG_BIT (reg_class_contents[i], r))
- {
- if (basic_needs[i] > 0)
- {
- enum reg_class *p;
-
- insn_needs.other.regs[0][i]++;
- p = reg_class_superclasses[i];
- while (*p != LIM_REG_CLASSES)
- insn_needs.other.regs[0][(int) *p++]++;
- }
- if (basic_groups[i] > 0)
- {
- enum reg_class *p;
-
- insn_needs.other.groups[i]++;
- p = reg_class_superclasses[i];
- while (*p != LIM_REG_CLASSES)
- insn_needs.other.groups[(int) *p++]++;
- }
- }
- }
-
- /* For each class, collect maximum need of any insn. */
-
- for (i = 0; i < N_REG_CLASSES; i++)
- {
- if (max_needs[i] < insn_needs.other.regs[0][i])
- {
- max_needs[i] = insn_needs.other.regs[0][i];
- max_needs_insn[i] = insn;
- }
- if (max_groups[i] < insn_needs.other.groups[i])
- {
- max_groups[i] = insn_needs.other.groups[i];
- max_groups_insn[i] = insn;
- }
- if (max_nongroups[i] < insn_needs.other.regs[1][i])
- {
- max_nongroups[i] = insn_needs.other.regs[1][i];
- max_nongroups_insn[i] = insn;
- }
- }
- }
- /* Note that there is a continue statement above. */
- }
+ something_changed |= calculate_needs_all_insns (first, global);
/* If we allocated any new memory locations, make another pass
since it might have changed elimination offsets. */
@@ -1528,136 +1011,26 @@ reload (first, global, dumpfile)
something_changed = 1;
if (dumpfile)
- for (i = 0; i < N_REG_CLASSES; i++)
- {
- if (max_needs[i] > 0)
- fprintf (dumpfile,
- ";; Need %d reg%s of class %s (for insn %d).\n",
- max_needs[i], max_needs[i] == 1 ? "" : "s",
- reg_class_names[i], INSN_UID (max_needs_insn[i]));
- if (max_nongroups[i] > 0)
- fprintf (dumpfile,
- ";; Need %d nongroup reg%s of class %s (for insn %d).\n",
- max_nongroups[i], max_nongroups[i] == 1 ? "" : "s",
- reg_class_names[i], INSN_UID (max_nongroups_insn[i]));
- if (max_groups[i] > 0)
- fprintf (dumpfile,
- ";; Need %d group%s (%smode) of class %s (for insn %d).\n",
- max_groups[i], max_groups[i] == 1 ? "" : "s",
- mode_name[(int) group_mode[i]],
- reg_class_names[i], INSN_UID (max_groups_insn[i]));
- }
-
- /* If we have caller-saves, set up the save areas and see if caller-save
- will need a spill register. */
-
- if (caller_save_needed)
- {
- /* Set the offsets for setup_save_areas. */
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS];
- ep++)
- ep->previous_offset = ep->max_offset;
-
- if ( ! setup_save_areas (&something_changed)
- && caller_save_spill_class == NO_REGS)
- {
- /* The class we will need depends on whether the machine
- supports the sum of two registers for an address; see
- find_address_reloads for details. */
-
- caller_save_spill_class
- = double_reg_address_ok ? INDEX_REG_CLASS : BASE_REG_CLASS;
- caller_save_group_size
- = CLASS_MAX_NREGS (caller_save_spill_class, Pmode);
- something_changed = 1;
- }
- }
-
- /* See if anything that happened changes which eliminations are valid.
- For example, on the Sparc, whether or not the frame pointer can
- be eliminated can depend on what registers have been used. We need
- not check some conditions again (such as flag_omit_frame_pointer)
- since they can't have changed. */
-
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- if ((ep->from == HARD_FRAME_POINTER_REGNUM && FRAME_POINTER_REQUIRED)
-#ifdef ELIMINABLE_REGS
- || ! CAN_ELIMINATE (ep->from, ep->to)
-#endif
- )
- ep->can_eliminate = 0;
-
- /* Look for the case where we have discovered that we can't replace
- register A with register B and that means that we will now be
- trying to replace register A with register C. This means we can
- no longer replace register C with register B and we need to disable
- such an elimination, if it exists. This occurs often with A == ap,
- B == sp, and C == fp. */
-
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- {
- struct elim_table *op;
- register int new_to = -1;
-
- if (! ep->can_eliminate && ep->can_eliminate_previous)
- {
- /* Find the current elimination for ep->from, if there is a
- new one. */
- for (op = reg_eliminate;
- op < &reg_eliminate[NUM_ELIMINABLE_REGS]; op++)
- if (op->from == ep->from && op->can_eliminate)
- {
- new_to = op->to;
- break;
- }
-
- /* See if there is an elimination of NEW_TO -> EP->TO. If so,
- disable it. */
- for (op = reg_eliminate;
- op < &reg_eliminate[NUM_ELIMINABLE_REGS]; op++)
- if (op->from == new_to && op->to == ep->to)
- op->can_eliminate = 0;
- }
- }
-
- /* See if any registers that we thought we could eliminate the previous
- time are no longer eliminable. If so, something has changed and we
- must spill the register. Also, recompute the number of eliminable
- registers and see if the frame pointer is needed; it is if there is
- no elimination of the frame pointer that we can perform. */
-
- frame_pointer_needed = 1;
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- {
- if (ep->can_eliminate && ep->from == FRAME_POINTER_REGNUM
- && ep->to != HARD_FRAME_POINTER_REGNUM)
- frame_pointer_needed = 0;
+ dump_needs (dumpfile);
- if (! ep->can_eliminate && ep->can_eliminate_previous)
+ {
+ HARD_REG_SET to_spill;
+ CLEAR_HARD_REG_SET (to_spill);
+ update_eliminables (&to_spill);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (TEST_HARD_REG_BIT (to_spill, i))
{
- ep->can_eliminate_previous = 0;
- spill_hard_reg (ep->from, global, dumpfile, 1);
+ spill_hard_reg (i, global, dumpfile, 1);
something_changed = 1;
- num_eliminable--;
}
- }
-
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- /* If we didn't need a frame pointer last time, but we do now, spill
- the hard frame pointer. */
- if (frame_pointer_needed && ! previous_frame_pointer_needed)
- {
- spill_hard_reg (HARD_FRAME_POINTER_REGNUM, global, dumpfile, 1);
- something_changed = 1;
- }
-#endif
+ }
/* If all needs are met, we win. */
for (i = 0; i < N_REG_CLASSES; i++)
if (max_needs[i] > 0 || max_groups[i] > 0 || max_nongroups[i] > 0)
break;
- if (i == N_REG_CLASSES && !new_basic_block_needs && ! something_changed)
+ if (i == N_REG_CLASSES && ! something_changed)
break;
/* Not all needs are met; must spill some hard regs. */
@@ -1699,305 +1072,12 @@ reload (first, global, dumpfile)
n_spills = 0;
}
- /* Now find more reload regs to satisfy the remaining need
- Do it by ascending class number, since otherwise a reg
- might be spilled for a big class and might fail to count
- for a smaller class even though it belongs to that class.
-
- Count spilled regs in `spills', and add entries to
- `spill_regs' and `spill_reg_order'.
-
- ??? Note there is a problem here.
- When there is a need for a group in a high-numbered class,
- and also need for non-group regs that come from a lower class,
- the non-group regs are chosen first. If there aren't many regs,
- they might leave no room for a group.
-
- This was happening on the 386. To fix it, we added the code
- that calls possible_group_p, so that the lower class won't
- break up the last possible group.
-
- Really fixing the problem would require changes above
- in counting the regs already spilled, and in choose_reload_regs.
- It might be hard to avoid introducing bugs there. */
-
- CLEAR_HARD_REG_SET (counted_for_groups);
- CLEAR_HARD_REG_SET (counted_for_nongroups);
-
- for (class = 0; class < N_REG_CLASSES; class++)
- {
- /* First get the groups of registers.
- If we got single registers first, we might fragment
- possible groups. */
- while (max_groups[class] > 0)
- {
- /* If any single spilled regs happen to form groups,
- count them now. Maybe we don't really need
- to spill another group. */
- count_possible_groups (group_size, group_mode, max_groups,
- class);
-
- if (max_groups[class] <= 0)
- break;
-
- /* Groups of size 2 (the only groups used on most machines)
- are treated specially. */
- if (group_size[class] == 2)
- {
- /* First, look for a register that will complete a group. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
- int other;
-
- j = potential_reload_regs[i];
- if (j >= 0 && ! TEST_HARD_REG_BIT (bad_spill_regs, j)
- &&
- ((j > 0 && (other = j - 1, spill_reg_order[other] >= 0)
- && TEST_HARD_REG_BIT (reg_class_contents[class], j)
- && TEST_HARD_REG_BIT (reg_class_contents[class], other)
- && HARD_REGNO_MODE_OK (other, group_mode[class])
- && ! TEST_HARD_REG_BIT (counted_for_nongroups,
- other)
- /* We don't want one part of another group.
- We could get "two groups" that overlap! */
- && ! TEST_HARD_REG_BIT (counted_for_groups, other))
- ||
- (j < FIRST_PSEUDO_REGISTER - 1
- && (other = j + 1, spill_reg_order[other] >= 0)
- && TEST_HARD_REG_BIT (reg_class_contents[class], j)
- && TEST_HARD_REG_BIT (reg_class_contents[class], other)
- && HARD_REGNO_MODE_OK (j, group_mode[class])
- && ! TEST_HARD_REG_BIT (counted_for_nongroups,
- other)
- && ! TEST_HARD_REG_BIT (counted_for_groups,
- other))))
- {
- register enum reg_class *p;
-
- /* We have found one that will complete a group,
- so count off one group as provided. */
- max_groups[class]--;
- p = reg_class_superclasses[class];
- while (*p != LIM_REG_CLASSES)
- {
- if (group_size [(int) *p] <= group_size [class])
- max_groups[(int) *p]--;
- p++;
- }
-
- /* Indicate both these regs are part of a group. */
- SET_HARD_REG_BIT (counted_for_groups, j);
- SET_HARD_REG_BIT (counted_for_groups, other);
- break;
- }
- }
- /* We can't complete a group, so start one. */
- /* Look for a pair neither of which is explicitly used. */
- if (SMALL_REGISTER_CLASSES && i == FIRST_PSEUDO_REGISTER)
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
- int k;
- j = potential_reload_regs[i];
- /* Verify that J+1 is a potential reload reg. */
- for (k = 0; k < FIRST_PSEUDO_REGISTER; k++)
- if (potential_reload_regs[k] == j + 1)
- break;
- if (j >= 0 && j + 1 < FIRST_PSEUDO_REGISTER
- && k < FIRST_PSEUDO_REGISTER
- && spill_reg_order[j] < 0 && spill_reg_order[j + 1] < 0
- && TEST_HARD_REG_BIT (reg_class_contents[class], j)
- && TEST_HARD_REG_BIT (reg_class_contents[class], j + 1)
- && HARD_REGNO_MODE_OK (j, group_mode[class])
- && ! TEST_HARD_REG_BIT (counted_for_nongroups,
- j + 1)
- && ! TEST_HARD_REG_BIT (bad_spill_regs, j + 1)
- /* Reject J at this stage
- if J+1 was explicitly used. */
- && ! regs_explicitly_used[j + 1])
- break;
- }
- /* Now try any group at all
- whose registers are not in bad_spill_regs. */
- if (i == FIRST_PSEUDO_REGISTER)
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
- int k;
- j = potential_reload_regs[i];
- /* Verify that J+1 is a potential reload reg. */
- for (k = 0; k < FIRST_PSEUDO_REGISTER; k++)
- if (potential_reload_regs[k] == j + 1)
- break;
- if (j >= 0 && j + 1 < FIRST_PSEUDO_REGISTER
- && k < FIRST_PSEUDO_REGISTER
- && spill_reg_order[j] < 0 && spill_reg_order[j + 1] < 0
- && TEST_HARD_REG_BIT (reg_class_contents[class], j)
- && TEST_HARD_REG_BIT (reg_class_contents[class], j + 1)
- && HARD_REGNO_MODE_OK (j, group_mode[class])
- && ! TEST_HARD_REG_BIT (counted_for_nongroups,
- j + 1)
- && ! TEST_HARD_REG_BIT (bad_spill_regs, j + 1))
- break;
- }
-
- /* I should be the index in potential_reload_regs
- of the new reload reg we have found. */
-
- if (i >= FIRST_PSEUDO_REGISTER)
- {
- /* There are no groups left to spill. */
- spill_failure (max_groups_insn[class]);
- failure = 1;
- goto failed;
- }
- else
- something_changed
- |= new_spill_reg (i, class, max_needs, NULL_PTR,
- global, dumpfile);
- }
- else
- {
- /* For groups of more than 2 registers,
- look for a sufficient sequence of unspilled registers,
- and spill them all at once. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- {
- int k;
+ something_changed |= find_reload_regs (global, dumpfile);
+ if (failure)
+ goto failed;
- j = potential_reload_regs[i];
- if (j >= 0
- && j + group_size[class] <= FIRST_PSEUDO_REGISTER
- && HARD_REGNO_MODE_OK (j, group_mode[class]))
- {
- /* Check each reg in the sequence. */
- for (k = 0; k < group_size[class]; k++)
- if (! (spill_reg_order[j + k] < 0
- && ! TEST_HARD_REG_BIT (bad_spill_regs, j + k)
- && TEST_HARD_REG_BIT (reg_class_contents[class], j + k)))
- break;
- /* We got a full sequence, so spill them all. */
- if (k == group_size[class])
- {
- register enum reg_class *p;
- for (k = 0; k < group_size[class]; k++)
- {
- int idx;
- SET_HARD_REG_BIT (counted_for_groups, j + k);
- for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++)
- if (potential_reload_regs[idx] == j + k)
- break;
- something_changed
- |= new_spill_reg (idx, class,
- max_needs, NULL_PTR,
- global, dumpfile);
- }
-
- /* We have found one that will complete a group,
- so count off one group as provided. */
- max_groups[class]--;
- p = reg_class_superclasses[class];
- while (*p != LIM_REG_CLASSES)
- {
- if (group_size [(int) *p]
- <= group_size [class])
- max_groups[(int) *p]--;
- p++;
- }
- break;
- }
- }
- }
- /* We couldn't find any registers for this reload.
- Avoid going into an infinite loop. */
- if (i >= FIRST_PSEUDO_REGISTER)
- {
- /* There are no groups left. */
- spill_failure (max_groups_insn[class]);
- failure = 1;
- goto failed;
- }
- }
- }
-
- /* Now similarly satisfy all need for single registers. */
-
- while (max_needs[class] > 0 || max_nongroups[class] > 0)
- {
- /* If we spilled enough regs, but they weren't counted
- against the non-group need, see if we can count them now.
- If so, we can avoid some actual spilling. */
- if (max_needs[class] <= 0 && max_nongroups[class] > 0)
- for (i = 0; i < n_spills; i++)
- if (TEST_HARD_REG_BIT (reg_class_contents[class],
- spill_regs[i])
- && !TEST_HARD_REG_BIT (counted_for_groups,
- spill_regs[i])
- && !TEST_HARD_REG_BIT (counted_for_nongroups,
- spill_regs[i])
- && max_nongroups[class] > 0)
- {
- register enum reg_class *p;
-
- SET_HARD_REG_BIT (counted_for_nongroups, spill_regs[i]);
- max_nongroups[class]--;
- p = reg_class_superclasses[class];
- while (*p != LIM_REG_CLASSES)
- max_nongroups[(int) *p++]--;
- }
- if (max_needs[class] <= 0 && max_nongroups[class] <= 0)
- break;
-
- /* Consider the potential reload regs that aren't
- yet in use as reload regs, in order of preference.
- Find the most preferred one that's in this class. */
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (potential_reload_regs[i] >= 0
- && TEST_HARD_REG_BIT (reg_class_contents[class],
- potential_reload_regs[i])
- /* If this reg will not be available for groups,
- pick one that does not foreclose possible groups.
- This is a kludge, and not very general,
- but it should be sufficient to make the 386 work,
- and the problem should not occur on machines with
- more registers. */
- && (max_nongroups[class] == 0
- || possible_group_p (potential_reload_regs[i], max_groups)))
- break;
-
- /* If we couldn't get a register, try to get one even if we
- might foreclose possible groups. This may cause problems
- later, but that's better than aborting now, since it is
- possible that we will, in fact, be able to form the needed
- group even with this allocation. */
-
- if (i >= FIRST_PSEUDO_REGISTER
- && (asm_noperands (max_needs[class] > 0
- ? max_needs_insn[class]
- : max_nongroups_insn[class])
- < 0))
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (potential_reload_regs[i] >= 0
- && TEST_HARD_REG_BIT (reg_class_contents[class],
- potential_reload_regs[i]))
- break;
-
- /* I should be the index in potential_reload_regs
- of the new reload reg we have found. */
-
- if (i >= FIRST_PSEUDO_REGISTER)
- {
- /* There are no possible registers left to spill. */
- spill_failure (max_needs[class] > 0 ? max_needs_insn[class]
- : max_nongroups_insn[class]);
- failure = 1;
- goto failed;
- }
- else
- something_changed
- |= new_spill_reg (i, class, max_needs, max_nongroups,
- global, dumpfile);
- }
- }
+ if (something_changed)
+ delete_caller_save_insns (first);
}
/* If global-alloc was run, notify it of any register eliminations we have
@@ -2007,15 +1087,6 @@ reload (first, global, dumpfile)
if (ep->can_eliminate)
mark_elimination (ep->from, ep->to);
- /* Insert code to save and restore call-clobbered hard regs
- around calls. Tell if what mode to use so that we will process
- those insns in reload_as_needed if we have to. */
-
- if (caller_save_needed)
- save_call_clobbered_regs (num_eliminable ? QImode
- : caller_save_spill_class != NO_REGS ? HImode
- : VOIDmode);
-
/* If a pseudo has no hard reg, delete the insns that made the equivalence.
If that insn didn't set the register (i.e., it copied the register to
memory), just delete that insn instead of the equivalencing insn plus
@@ -2041,9 +1112,7 @@ reload (first, global, dumpfile)
by generating move instructions to move the must-be-register
values into or out of the reload registers. */
- if (something_needs_reloads || something_needs_elimination
- || (caller_save_needed && num_eliminable)
- || caller_save_spill_class != NO_REGS)
+ if (something_needs_reloads || something_needs_elimination)
reload_as_needed (first, global);
/* If we were able to eliminate the frame pointer, show that it is no
@@ -2077,13 +1146,20 @@ reload (first, global, dumpfile)
{
rtx addr = 0;
int in_struct = 0;
- if (reg_equiv_mem[i])
+ int is_readonly = 0;
+
+ if (reg_equiv_memory_loc[i])
{
- addr = XEXP (reg_equiv_mem[i], 0);
- in_struct = MEM_IN_STRUCT_P (reg_equiv_mem[i]);
+ in_struct = MEM_IN_STRUCT_P (reg_equiv_memory_loc[i]);
+ is_readonly = RTX_UNCHANGING_P (reg_equiv_memory_loc[i]);
}
+
+ if (reg_equiv_mem[i])
+ addr = XEXP (reg_equiv_mem[i], 0);
+
if (reg_equiv_address[i])
addr = reg_equiv_address[i];
+
if (addr)
{
if (reg_renumber[i] < 0)
@@ -2091,7 +1167,11 @@ reload (first, global, dumpfile)
rtx reg = regno_reg_rtx[i];
XEXP (reg, 0) = addr;
REG_USERVAR_P (reg) = 0;
+ RTX_UNCHANGING_P (reg) = is_readonly;
MEM_IN_STRUCT_P (reg) = in_struct;
+ /* We have no alias information about this newly created
+ MEM. */
+ MEM_ALIAS_SET (reg) = 0;
PUT_CODE (reg, MEM);
}
else if (reg_equiv_mem[i])
@@ -2100,17 +1180,15 @@ reload (first, global, dumpfile)
}
/* Make a pass over all the insns and delete all USEs which we inserted
- only to tag a REG_EQUAL note on them; if PRESERVE_DEATH_INFO_REGNO_P
- is defined, also remove death notes for things that are no longer
- registers or no longer die in the insn (e.g., an input and output
- pseudo being tied). */
+ only to tag a REG_EQUAL note on them. Also remove all REG_DEAD and
+ REG_UNUSED notes. */
for (insn = first; insn; insn = NEXT_INSN (insn))
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{
- rtx note, next;
+ rtx *pnote;
- if (GET_CODE (insn) == USE
+ if (GET_CODE (PATTERN (insn)) == USE
&& find_reg_note (insn, REG_EQUAL, NULL_RTX))
{
PUT_CODE (insn, NOTE);
@@ -2118,16 +1196,16 @@ reload (first, global, dumpfile)
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
continue;
}
-#ifdef PRESERVE_DEATH_INFO_REGNO_P
- for (note = REG_NOTES (insn); note; note = next)
+
+ pnote = &REG_NOTES (insn);
+ while (*pnote != 0)
{
- next = XEXP (note, 1);
- if (REG_NOTE_KIND (note) == REG_DEAD
- && (GET_CODE (XEXP (note, 0)) != REG
- || reg_set_p (XEXP (note, 0), PATTERN (insn))))
- remove_note (insn, note);
+ if (REG_NOTE_KIND (*pnote) == REG_DEAD
+ || REG_NOTE_KIND (*pnote) == REG_UNUSED)
+ *pnote = XEXP (*pnote, 1);
+ else
+ pnote = &XEXP (*pnote, 1);
}
-#endif
}
/* If we are doing stack checking, give a warning if this function's
@@ -2143,7 +1221,9 @@ reload (first, global, dumpfile)
if (size > STACK_CHECK_MAX_FRAME_SIZE)
warning ("frame size too large for reliable stack checking");
}
-
+
+ obstack_free (&reload_obstack, reload_startobj);
+
/* Indicate that we no longer have known memory locations or constants. */
reg_equiv_constant = 0;
reg_equiv_memory_loc = 0;
@@ -2153,12 +1233,12 @@ reload (first, global, dumpfile)
if (real_at_ptr)
free (real_at_ptr);
- if (scratch_list)
- free (scratch_list);
- scratch_list = 0;
- if (scratch_block)
- free (scratch_block);
- scratch_block = 0;
+ free (reg_equiv_constant);
+ free (reg_equiv_memory_loc);
+ free (reg_equiv_mem);
+ free (reg_equiv_init);
+ free (reg_equiv_address);
+ free (reg_max_ref_width);
CLEAR_HARD_REG_SET (used_spill_regs);
for (i = 0; i < n_spills; i++)
@@ -2166,6 +1246,856 @@ reload (first, global, dumpfile)
return failure;
}
+
+/* Walk the insns of the current function, starting with FIRST, and collect
+ information about the need to do register elimination and the need to
+ perform reloads. */
+static int
+calculate_needs_all_insns (first, global)
+ rtx first;
+ int global;
+{
+ rtx insn;
+ int something_changed = 0;
+ rtx after_call = 0;
+ /* Keep track of which basic blocks are needing the reloads. */
+ int this_block = 0;
+
+ /* Compute the most additional registers needed by any instruction.
+ Collect information separately for each class of regs. */
+
+ for (insn = first; insn; insn = NEXT_INSN (insn))
+ {
+ if (global && this_block + 1 < n_basic_blocks
+ && insn == basic_block_head[this_block+1])
+ ++this_block;
+
+ /* If this is a label, a JUMP_INSN, or has REG_NOTES (which
+ might include REG_LABEL), we need to see what effects this
+ has on the known offsets at labels. */
+
+ if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN
+ || (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
+ && REG_NOTES (insn) != 0))
+ set_label_offsets (insn, insn, 0);
+
+ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
+ {
+ rtx old_body = PATTERN (insn);
+ int old_code = INSN_CODE (insn);
+ rtx old_notes = REG_NOTES (insn);
+ int did_elimination = 0;
+
+ /* Nonzero means don't use a reload reg that overlaps
+ the place where a function value can be returned. */
+ rtx avoid_return_reg = 0;
+
+ /* Set avoid_return_reg if this is an insn
+ that might use the value of a function call. */
+ if (SMALL_REGISTER_CLASSES && GET_CODE (insn) == CALL_INSN)
+ {
+ if (GET_CODE (PATTERN (insn)) == SET)
+ after_call = SET_DEST (PATTERN (insn));
+ else if (GET_CODE (PATTERN (insn)) == PARALLEL
+ && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == SET)
+ after_call = SET_DEST (XVECEXP (PATTERN (insn), 0, 0));
+ else
+ after_call = 0;
+ }
+ else if (SMALL_REGISTER_CLASSES && after_call != 0
+ && !(GET_CODE (PATTERN (insn)) == SET
+ && SET_DEST (PATTERN (insn)) == stack_pointer_rtx)
+ && GET_CODE (PATTERN (insn)) != USE)
+ {
+ if (reg_referenced_p (after_call, PATTERN (insn)))
+ avoid_return_reg = after_call;
+ after_call = 0;
+ }
+
+ /* If needed, eliminate any eliminable registers. */
+ if (num_eliminable)
+ did_elimination = eliminate_regs_in_insn (insn, 0);
+
+ /* Analyze the instruction. */
+ find_reloads (insn, 0, spill_indirect_levels, global,
+ spill_reg_order);
+
+ /* Remember for later shortcuts which insns had any reloads or
+ register eliminations.
+
+ One might think that it would be worthwhile to mark insns
+ that need register replacements but not reloads, but this is
+ not safe because find_reloads may do some manipulation of
+ the insn (such as swapping commutative operands), which would
+ be lost when we restore the old pattern after register
+ replacement. So the actions of find_reloads must be redone in
+ subsequent passes or in reload_as_needed.
+
+ However, it is safe to mark insns that need reloads
+ but not register replacement. */
+
+ PUT_MODE (insn, (did_elimination ? QImode
+ : n_reloads ? HImode
+ : GET_MODE (insn) == DImode ? DImode
+ : VOIDmode));
+
+ /* Discard any register replacements done. */
+ if (did_elimination)
+ {
+ obstack_free (&reload_obstack, reload_firstobj);
+ PATTERN (insn) = old_body;
+ INSN_CODE (insn) = old_code;
+ REG_NOTES (insn) = old_notes;
+ something_needs_elimination = 1;
+ }
+
+ if (n_reloads != 0)
+ something_changed |= calculate_needs (this_block, insn,
+ avoid_return_reg, global);
+ }
+
+ /* Note that there is a continue statement above. */
+ }
+ return something_changed;
+}
+
+/* To compute the number of reload registers of each class
+ needed for an insn, we must simulate what choose_reload_regs
+ can do. We do this by splitting an insn into an "input" and
+ an "output" part. RELOAD_OTHER reloads are used in both.
+ The input part uses those reloads, RELOAD_FOR_INPUT reloads,
+ which must be live over the entire input section of reloads,
+ and the maximum of all the RELOAD_FOR_INPUT_ADDRESS and
+ RELOAD_FOR_OPERAND_ADDRESS reloads, which conflict with the
+ inputs.
+
+ The registers needed for output are RELOAD_OTHER and
+ RELOAD_FOR_OUTPUT, which are live for the entire output
+ portion, and the maximum of all the RELOAD_FOR_OUTPUT_ADDRESS
+ reloads for each operand.
+
+ The total number of registers needed is the maximum of the
+ inputs and outputs. */
+
+static int
+calculate_needs (this_block, insn, avoid_return_reg, global)
+ int this_block;
+ rtx insn, avoid_return_reg;
+ int global;
+{
+ int something_changed = 0;
+ int i;
+
+ struct needs
+ {
+ /* [0] is normal, [1] is nongroup. */
+ int regs[2][N_REG_CLASSES];
+ int groups[N_REG_CLASSES];
+ };
+
+ /* Each `struct needs' corresponds to one RELOAD_... type. */
+ struct {
+ struct needs other;
+ struct needs input;
+ struct needs output;
+ struct needs insn;
+ struct needs other_addr;
+ struct needs op_addr;
+ struct needs op_addr_reload;
+ struct needs in_addr[MAX_RECOG_OPERANDS];
+ struct needs in_addr_addr[MAX_RECOG_OPERANDS];
+ struct needs out_addr[MAX_RECOG_OPERANDS];
+ struct needs out_addr_addr[MAX_RECOG_OPERANDS];
+ } insn_needs;
+
+ something_needs_reloads = 1;
+ bzero ((char *) &insn_needs, sizeof insn_needs);
+
+ /* Count each reload once in every class
+ containing the reload's own class. */
+
+ for (i = 0; i < n_reloads; i++)
+ {
+ register enum reg_class *p;
+ enum reg_class class = reload_reg_class[i];
+ int size;
+ enum machine_mode mode;
+ struct needs *this_needs;
+
+ /* Don't count the dummy reloads, for which one of the
+ regs mentioned in the insn can be used for reloading.
+ Don't count optional reloads.
+ Don't count reloads that got combined with others. */
+ if (reload_reg_rtx[i] != 0
+ || reload_optional[i] != 0
+ || (reload_out[i] == 0 && reload_in[i] == 0
+ && ! reload_secondary_p[i]))
+ continue;
+
+ /* Show that a reload register of this class is needed
+ in this basic block. We do not use insn_needs and
+ insn_groups because they are overly conservative for
+ this purpose. */
+ if (global && ! basic_block_needs[(int) class][this_block])
+ {
+ basic_block_needs[(int) class][this_block] = 1;
+ something_changed = 1;
+ }
+
+ mode = reload_inmode[i];
+ if (GET_MODE_SIZE (reload_outmode[i]) > GET_MODE_SIZE (mode))
+ mode = reload_outmode[i];
+ size = CLASS_MAX_NREGS (class, mode);
+
+ /* Decide which time-of-use to count this reload for. */
+ switch (reload_when_needed[i])
+ {
+ case RELOAD_OTHER:
+ this_needs = &insn_needs.other;
+ break;
+ case RELOAD_FOR_INPUT:
+ this_needs = &insn_needs.input;
+ break;
+ case RELOAD_FOR_OUTPUT:
+ this_needs = &insn_needs.output;
+ break;
+ case RELOAD_FOR_INSN:
+ this_needs = &insn_needs.insn;
+ break;
+ case RELOAD_FOR_OTHER_ADDRESS:
+ this_needs = &insn_needs.other_addr;
+ break;
+ case RELOAD_FOR_INPUT_ADDRESS:
+ this_needs = &insn_needs.in_addr[reload_opnum[i]];
+ break;
+ case RELOAD_FOR_INPADDR_ADDRESS:
+ this_needs = &insn_needs.in_addr_addr[reload_opnum[i]];
+ break;
+ case RELOAD_FOR_OUTPUT_ADDRESS:
+ this_needs = &insn_needs.out_addr[reload_opnum[i]];
+ break;
+ case RELOAD_FOR_OUTADDR_ADDRESS:
+ this_needs = &insn_needs.out_addr_addr[reload_opnum[i]];
+ break;
+ case RELOAD_FOR_OPERAND_ADDRESS:
+ this_needs = &insn_needs.op_addr;
+ break;
+ case RELOAD_FOR_OPADDR_ADDR:
+ this_needs = &insn_needs.op_addr_reload;
+ break;
+ }
+
+ if (size > 1)
+ {
+ enum machine_mode other_mode, allocate_mode;
+
+ /* Count number of groups needed separately from
+ number of individual regs needed. */
+ this_needs->groups[(int) class]++;
+ p = reg_class_superclasses[(int) class];
+ while (*p != LIM_REG_CLASSES)
+ this_needs->groups[(int) *p++]++;
+
+ /* Record size and mode of a group of this class. */
+ /* If more than one size group is needed,
+ make all groups the largest needed size. */
+ if (group_size[(int) class] < size)
+ {
+ other_mode = group_mode[(int) class];
+ allocate_mode = mode;
+
+ group_size[(int) class] = size;
+ group_mode[(int) class] = mode;
+ }
+ else
+ {
+ other_mode = mode;
+ allocate_mode = group_mode[(int) class];
+ }
+
+ /* Crash if two dissimilar machine modes both need
+ groups of consecutive regs of the same class. */
+
+ if (other_mode != VOIDmode && other_mode != allocate_mode
+ && ! modes_equiv_for_class_p (allocate_mode,
+ other_mode, class))
+ fatal_insn ("Two dissimilar machine modes both need groups of consecutive regs of the same class",
+ insn);
+ }
+ else if (size == 1)
+ {
+ this_needs->regs[reload_nongroup[i]][(int) class] += 1;
+ p = reg_class_superclasses[(int) class];
+ while (*p != LIM_REG_CLASSES)
+ this_needs->regs[reload_nongroup[i]][(int) *p++] += 1;
+ }
+ else
+ abort ();
+ }
+
+ /* All reloads have been counted for this insn;
+ now merge the various times of use.
+ This sets insn_needs, etc., to the maximum total number
+ of registers needed at any point in this insn. */
+
+ for (i = 0; i < N_REG_CLASSES; i++)
+ {
+ int j, in_max, out_max;
+
+ /* Compute normal and nongroup needs. */
+ for (j = 0; j <= 1; j++)
+ {
+ int k;
+ for (in_max = 0, out_max = 0, k = 0; k < reload_n_operands; k++)
+ {
+ in_max = MAX (in_max,
+ (insn_needs.in_addr[k].regs[j][i]
+ + insn_needs.in_addr_addr[k].regs[j][i]));
+ out_max = MAX (out_max, insn_needs.out_addr[k].regs[j][i]);
+ out_max = MAX (out_max,
+ insn_needs.out_addr_addr[k].regs[j][i]);
+ }
+
+ /* RELOAD_FOR_INSN reloads conflict with inputs, outputs,
+ and operand addresses but not things used to reload
+ them. Similarly, RELOAD_FOR_OPERAND_ADDRESS reloads
+ don't conflict with things needed to reload inputs or
+ outputs. */
+
+ in_max = MAX (MAX (insn_needs.op_addr.regs[j][i],
+ insn_needs.op_addr_reload.regs[j][i]),
+ in_max);
+
+ out_max = MAX (out_max, insn_needs.insn.regs[j][i]);
+
+ insn_needs.input.regs[j][i]
+ = MAX (insn_needs.input.regs[j][i]
+ + insn_needs.op_addr.regs[j][i]
+ + insn_needs.insn.regs[j][i],
+ in_max + insn_needs.input.regs[j][i]);
+
+ insn_needs.output.regs[j][i] += out_max;
+ insn_needs.other.regs[j][i]
+ += MAX (MAX (insn_needs.input.regs[j][i],
+ insn_needs.output.regs[j][i]),
+ insn_needs.other_addr.regs[j][i]);
+
+ }
+
+ /* Now compute group needs. */
+ for (in_max = 0, out_max = 0, j = 0; j < reload_n_operands; j++)
+ {
+ in_max = MAX (in_max, insn_needs.in_addr[j].groups[i]);
+ in_max = MAX (in_max, insn_needs.in_addr_addr[j].groups[i]);
+ out_max = MAX (out_max, insn_needs.out_addr[j].groups[i]);
+ out_max = MAX (out_max, insn_needs.out_addr_addr[j].groups[i]);
+ }
+
+ in_max = MAX (MAX (insn_needs.op_addr.groups[i],
+ insn_needs.op_addr_reload.groups[i]),
+ in_max);
+ out_max = MAX (out_max, insn_needs.insn.groups[i]);
+
+ insn_needs.input.groups[i]
+ = MAX (insn_needs.input.groups[i]
+ + insn_needs.op_addr.groups[i]
+ + insn_needs.insn.groups[i],
+ in_max + insn_needs.input.groups[i]);
+
+ insn_needs.output.groups[i] += out_max;
+ insn_needs.other.groups[i]
+ += MAX (MAX (insn_needs.input.groups[i],
+ insn_needs.output.groups[i]),
+ insn_needs.other_addr.groups[i]);
+ }
+
+ /* If this insn stores the value of a function call,
+ and that value is in a register that has been spilled,
+ and if the insn needs a reload in a class
+ that might use that register as the reload register,
+ then add an extra need in that class.
+ This makes sure we have a register available that does
+ not overlap the return value. */
+
+ if (SMALL_REGISTER_CLASSES && avoid_return_reg)
+ {
+ int regno = REGNO (avoid_return_reg);
+ int nregs
+ = HARD_REGNO_NREGS (regno, GET_MODE (avoid_return_reg));
+ int r;
+ int basic_needs[N_REG_CLASSES], basic_groups[N_REG_CLASSES];
+
+ /* First compute the "basic needs", which counts a
+ need only in the smallest class in which it
+ is required. */
+
+ bcopy ((char *) insn_needs.other.regs[0],
+ (char *) basic_needs, sizeof basic_needs);
+ bcopy ((char *) insn_needs.other.groups,
+ (char *) basic_groups, sizeof basic_groups);
+
+ for (i = 0; i < N_REG_CLASSES; i++)
+ {
+ enum reg_class *p;
+
+ if (basic_needs[i] >= 0)
+ for (p = reg_class_superclasses[i];
+ *p != LIM_REG_CLASSES; p++)
+ basic_needs[(int) *p] -= basic_needs[i];
+
+ if (basic_groups[i] >= 0)
+ for (p = reg_class_superclasses[i];
+ *p != LIM_REG_CLASSES; p++)
+ basic_groups[(int) *p] -= basic_groups[i];
+ }
+
+ /* Now count extra regs if there might be a conflict with
+ the return value register. */
+
+ for (r = regno; r < regno + nregs; r++)
+ if (spill_reg_order[r] >= 0)
+ for (i = 0; i < N_REG_CLASSES; i++)
+ if (TEST_HARD_REG_BIT (reg_class_contents[i], r))
+ {
+ if (basic_needs[i] > 0)
+ {
+ enum reg_class *p;
+
+ insn_needs.other.regs[0][i]++;
+ p = reg_class_superclasses[i];
+ while (*p != LIM_REG_CLASSES)
+ insn_needs.other.regs[0][(int) *p++]++;
+ }
+ if (basic_groups[i] > 0)
+ {
+ enum reg_class *p;
+
+ insn_needs.other.groups[i]++;
+ p = reg_class_superclasses[i];
+ while (*p != LIM_REG_CLASSES)
+ insn_needs.other.groups[(int) *p++]++;
+ }
+ }
+ }
+
+ /* For each class, collect maximum need of any insn. */
+
+ for (i = 0; i < N_REG_CLASSES; i++)
+ {
+ if (max_needs[i] < insn_needs.other.regs[0][i])
+ {
+ max_needs[i] = insn_needs.other.regs[0][i];
+ max_needs_insn[i] = insn;
+ }
+ if (max_groups[i] < insn_needs.other.groups[i])
+ {
+ max_groups[i] = insn_needs.other.groups[i];
+ max_groups_insn[i] = insn;
+ }
+ if (max_nongroups[i] < insn_needs.other.regs[1][i])
+ {
+ max_nongroups[i] = insn_needs.other.regs[1][i];
+ max_nongroups_insn[i] = insn;
+ }
+ }
+ return something_changed;
+}
+
+/* Find a group of exactly 2 registers.
+
+ First try to fill out the group by spilling a single register which
+ would allow completion of the group.
+
+ Then try to create a new group from a pair of registers, neither of
+ which are explicitly used.
+
+ Then try to create a group from any pair of registers. */
+static int
+find_tworeg_group (global, class, dumpfile)
+ int global;
+ int class;
+ FILE *dumpfile;
+{
+ int i;
+ /* First, look for a register that will complete a group. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j, other;
+
+ j = potential_reload_regs[i];
+ if (j >= 0 && ! TEST_HARD_REG_BIT (bad_spill_regs, j)
+ && ((j > 0 && (other = j - 1, spill_reg_order[other] >= 0)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], other)
+ && HARD_REGNO_MODE_OK (other, group_mode[class])
+ && ! TEST_HARD_REG_BIT (counted_for_nongroups, other)
+ /* We don't want one part of another group.
+ We could get "two groups" that overlap! */
+ && ! TEST_HARD_REG_BIT (counted_for_groups, other))
+ || (j < FIRST_PSEUDO_REGISTER - 1
+ && (other = j + 1, spill_reg_order[other] >= 0)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], other)
+ && HARD_REGNO_MODE_OK (j, group_mode[class])
+ && ! TEST_HARD_REG_BIT (counted_for_nongroups, other)
+ && ! TEST_HARD_REG_BIT (counted_for_groups, other))))
+ {
+ register enum reg_class *p;
+
+ /* We have found one that will complete a group,
+ so count off one group as provided. */
+ max_groups[class]--;
+ p = reg_class_superclasses[class];
+ while (*p != LIM_REG_CLASSES)
+ {
+ if (group_size [(int) *p] <= group_size [class])
+ max_groups[(int) *p]--;
+ p++;
+ }
+
+ /* Indicate both these regs are part of a group. */
+ SET_HARD_REG_BIT (counted_for_groups, j);
+ SET_HARD_REG_BIT (counted_for_groups, other);
+ break;
+ }
+ }
+ /* We can't complete a group, so start one. */
+ /* Look for a pair neither of which is explicitly used. */
+ if (SMALL_REGISTER_CLASSES && i == FIRST_PSEUDO_REGISTER)
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j, k;
+ j = potential_reload_regs[i];
+ /* Verify that J+1 is a potential reload reg. */
+ for (k = 0; k < FIRST_PSEUDO_REGISTER; k++)
+ if (potential_reload_regs[k] == j + 1)
+ break;
+ if (j >= 0 && j + 1 < FIRST_PSEUDO_REGISTER
+ && k < FIRST_PSEUDO_REGISTER
+ && spill_reg_order[j] < 0 && spill_reg_order[j + 1] < 0
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j + 1)
+ && HARD_REGNO_MODE_OK (j, group_mode[class])
+ && ! TEST_HARD_REG_BIT (counted_for_nongroups,
+ j + 1)
+ && ! TEST_HARD_REG_BIT (bad_spill_regs, j + 1)
+ /* Reject J at this stage
+ if J+1 was explicitly used. */
+ && ! regs_explicitly_used[j + 1])
+ break;
+ }
+ /* Now try any group at all
+ whose registers are not in bad_spill_regs. */
+ if (i == FIRST_PSEUDO_REGISTER)
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j, k;
+ j = potential_reload_regs[i];
+ /* Verify that J+1 is a potential reload reg. */
+ for (k = 0; k < FIRST_PSEUDO_REGISTER; k++)
+ if (potential_reload_regs[k] == j + 1)
+ break;
+ if (j >= 0 && j + 1 < FIRST_PSEUDO_REGISTER
+ && k < FIRST_PSEUDO_REGISTER
+ && spill_reg_order[j] < 0 && spill_reg_order[j + 1] < 0
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j + 1)
+ && HARD_REGNO_MODE_OK (j, group_mode[class])
+ && ! TEST_HARD_REG_BIT (counted_for_nongroups, j + 1)
+ && ! TEST_HARD_REG_BIT (bad_spill_regs, j + 1))
+ break;
+ }
+
+ /* I should be the index in potential_reload_regs
+ of the new reload reg we have found. */
+
+ if (i < FIRST_PSEUDO_REGISTER)
+ return new_spill_reg (i, class, max_needs, NULL_PTR,
+ global, dumpfile);
+
+ /* There are no groups left to spill. */
+ spill_failure (max_groups_insn[class]);
+ failure = 1;
+ return 1;
+}
+
+/* Find a group of more than 2 registers.
+ Look for a sufficient sequence of unspilled registers, and spill them all
+ at once. */
+static int
+find_group (global, class, dumpfile)
+ int global;
+ int class;
+ FILE *dumpfile;
+{
+ int something_changed = 0;
+ int i;
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j, k;
+
+ j = potential_reload_regs[i];
+ if (j >= 0
+ && j + group_size[class] <= FIRST_PSEUDO_REGISTER
+ && HARD_REGNO_MODE_OK (j, group_mode[class]))
+ {
+ /* Check each reg in the sequence. */
+ for (k = 0; k < group_size[class]; k++)
+ if (! (spill_reg_order[j + k] < 0
+ && ! TEST_HARD_REG_BIT (bad_spill_regs, j + k)
+ && TEST_HARD_REG_BIT (reg_class_contents[class], j + k)))
+ break;
+ /* We got a full sequence, so spill them all. */
+ if (k == group_size[class])
+ {
+ register enum reg_class *p;
+ for (k = 0; k < group_size[class]; k++)
+ {
+ int idx;
+ SET_HARD_REG_BIT (counted_for_groups, j + k);
+ for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++)
+ if (potential_reload_regs[idx] == j + k)
+ break;
+ something_changed |= new_spill_reg (idx, class, max_needs,
+ NULL_PTR, global,
+ dumpfile);
+ }
+
+ /* We have found one that will complete a group,
+ so count off one group as provided. */
+ max_groups[class]--;
+ p = reg_class_superclasses[class];
+ while (*p != LIM_REG_CLASSES)
+ {
+ if (group_size [(int) *p]
+ <= group_size [class])
+ max_groups[(int) *p]--;
+ p++;
+ }
+ return something_changed;
+ }
+ }
+ }
+ /* There are no groups left. */
+ spill_failure (max_groups_insn[class]);
+ failure = 1;
+ return 1;
+}
+
+/* Find more reload regs to satisfy the remaining need.
+ Do it by ascending class number, since otherwise a reg
+ might be spilled for a big class and might fail to count
+ for a smaller class even though it belongs to that class.
+
+ Count spilled regs in `spills', and add entries to
+ `spill_regs' and `spill_reg_order'.
+
+ ??? Note there is a problem here.
+ When there is a need for a group in a high-numbered class,
+ and also need for non-group regs that come from a lower class,
+ the non-group regs are chosen first. If there aren't many regs,
+ they might leave no room for a group.
+
+ This was happening on the 386. To fix it, we added the code
+ that calls possible_group_p, so that the lower class won't
+ break up the last possible group.
+
+ Really fixing the problem would require changes above
+ in counting the regs already spilled, and in choose_reload_regs.
+ It might be hard to avoid introducing bugs there. */
+
+static int
+find_reload_regs (global, dumpfile)
+ int global;
+ FILE *dumpfile;
+{
+ int class;
+ int something_changed = 0;
+
+ CLEAR_HARD_REG_SET (counted_for_groups);
+ CLEAR_HARD_REG_SET (counted_for_nongroups);
+
+ for (class = 0; class < N_REG_CLASSES; class++)
+ {
+ /* First get the groups of registers.
+ If we got single registers first, we might fragment
+ possible groups. */
+ while (max_groups[class] > 0)
+ {
+ /* If any single spilled regs happen to form groups,
+ count them now. Maybe we don't really need
+ to spill another group. */
+ count_possible_groups (group_size, group_mode, max_groups, class);
+
+ if (max_groups[class] <= 0)
+ break;
+
+ /* Groups of size 2 (the only groups used on most machines)
+ are treated specially. */
+ if (group_size[class] == 2)
+ something_changed |= find_tworeg_group (global, class, dumpfile);
+ else
+ something_changed |= find_group (global, class, dumpfile);
+
+ if (failure)
+ return 1;
+ }
+
+ /* Now similarly satisfy all need for single registers. */
+
+ while (max_needs[class] > 0 || max_nongroups[class] > 0)
+ {
+ int i;
+ /* If we spilled enough regs, but they weren't counted
+ against the non-group need, see if we can count them now.
+ If so, we can avoid some actual spilling. */
+ if (max_needs[class] <= 0 && max_nongroups[class] > 0)
+ for (i = 0; i < n_spills; i++)
+ {
+ int regno = spill_regs[i];
+ if (TEST_HARD_REG_BIT (reg_class_contents[class], regno)
+ && !TEST_HARD_REG_BIT (counted_for_groups, regno)
+ && !TEST_HARD_REG_BIT (counted_for_nongroups, regno)
+ && max_nongroups[class] > 0)
+ {
+ register enum reg_class *p;
+
+ SET_HARD_REG_BIT (counted_for_nongroups, regno);
+ max_nongroups[class]--;
+ p = reg_class_superclasses[class];
+ while (*p != LIM_REG_CLASSES)
+ max_nongroups[(int) *p++]--;
+ }
+ }
+ if (max_needs[class] <= 0 && max_nongroups[class] <= 0)
+ break;
+
+ /* Consider the potential reload regs that aren't
+ yet in use as reload regs, in order of preference.
+ Find the most preferred one that's in this class. */
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int regno = potential_reload_regs[i];
+ if (regno >= 0
+ && TEST_HARD_REG_BIT (reg_class_contents[class], regno)
+ /* If this reg will not be available for groups,
+ pick one that does not foreclose possible groups.
+ This is a kludge, and not very general,
+ but it should be sufficient to make the 386 work,
+ and the problem should not occur on machines with
+ more registers. */
+ && (max_nongroups[class] == 0
+ || possible_group_p (regno, max_groups)))
+ break;
+ }
+
+ /* If we couldn't get a register, try to get one even if we
+ might foreclose possible groups. This may cause problems
+ later, but that's better than aborting now, since it is
+ possible that we will, in fact, be able to form the needed
+ group even with this allocation. */
+
+ if (i >= FIRST_PSEUDO_REGISTER
+ && (asm_noperands (max_needs[class] > 0
+ ? max_needs_insn[class]
+ : max_nongroups_insn[class])
+ < 0))
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (potential_reload_regs[i] >= 0
+ && TEST_HARD_REG_BIT (reg_class_contents[class],
+ potential_reload_regs[i]))
+ break;
+
+ /* I should be the index in potential_reload_regs
+ of the new reload reg we have found. */
+
+ if (i >= FIRST_PSEUDO_REGISTER)
+ {
+ /* There are no possible registers left to spill. */
+ spill_failure (max_needs[class] > 0 ? max_needs_insn[class]
+ : max_nongroups_insn[class]);
+ failure = 1;
+ return 1;
+ }
+ else
+ something_changed |= new_spill_reg (i, class, max_needs,
+ max_nongroups, global,
+ dumpfile);
+ }
+ }
+ return something_changed;
+}
+
+static void
+dump_needs (dumpfile)
+ FILE *dumpfile;
+{
+ static char *reg_class_names[] = REG_CLASS_NAMES;
+ int i;
+
+ for (i = 0; i < N_REG_CLASSES; i++)
+ {
+ if (max_needs[i] > 0)
+ fprintf (dumpfile,
+ ";; Need %d reg%s of class %s (for insn %d).\n",
+ max_needs[i], max_needs[i] == 1 ? "" : "s",
+ reg_class_names[i], INSN_UID (max_needs_insn[i]));
+ if (max_nongroups[i] > 0)
+ fprintf (dumpfile,
+ ";; Need %d nongroup reg%s of class %s (for insn %d).\n",
+ max_nongroups[i], max_nongroups[i] == 1 ? "" : "s",
+ reg_class_names[i], INSN_UID (max_nongroups_insn[i]));
+ if (max_groups[i] > 0)
+ fprintf (dumpfile,
+ ";; Need %d group%s (%smode) of class %s (for insn %d).\n",
+ max_groups[i], max_groups[i] == 1 ? "" : "s",
+ mode_name[(int) group_mode[i]],
+ reg_class_names[i], INSN_UID (max_groups_insn[i]));
+ }
+}
+
+/* Delete all insns that were inserted by emit_caller_save_insns during
+ this iteration. */
+static void
+delete_caller_save_insns (first)
+ rtx first;
+{
+ rtx insn = first;
+ int b = -1;
+
+ while (insn != 0)
+ {
+ if (b + 1 != n_basic_blocks
+ && basic_block_head[b + 1] == insn)
+ b++;
+
+ while (insn != 0 && INSN_UID (insn) >= reload_first_uid)
+ {
+ rtx next = NEXT_INSN (insn);
+ rtx prev = PREV_INSN (insn);
+
+ if (insn == basic_block_head[b])
+ basic_block_head[b] = next;
+ if (insn == basic_block_end[b])
+ basic_block_end[b] = prev;
+
+ if (next != 0)
+ PREV_INSN (next) = prev;
+ if (prev != 0)
+ NEXT_INSN (prev) = next;
+
+ insn = next;
+
+ if (b + 1 != n_basic_blocks
+ && basic_block_head[b + 1] == insn)
+ b++;
+ }
+ if (insn != 0)
+ insn = NEXT_INSN (insn);
+ }
+}
/* Nonzero if, after spilling reg REGNO for non-groups,
it will still be possible to find a group if we still need one. */
@@ -2433,7 +2363,8 @@ delete_dead_insn (insn)
if (prev && GET_CODE (PATTERN (prev)) == SET
&& (prev_dest = SET_DEST (PATTERN (prev)), GET_CODE (prev_dest) == REG)
&& reg_mentioned_p (prev_dest, PATTERN (insn))
- && find_regno_note (insn, REG_DEAD, REGNO (prev_dest)))
+ && find_regno_note (insn, REG_DEAD, REGNO (prev_dest))
+ && ! side_effects_p (SET_SRC (PATTERN (prev))))
delete_dead_insn (prev);
PUT_CODE (insn, NOTE);
@@ -2557,7 +2488,14 @@ alter_reg (i, from_reg)
{
x = gen_rtx_MEM (GET_MODE (regno_reg_rtx[i]),
plus_constant (XEXP (x, 0), adjust));
- RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (regno_reg_rtx[i]);
+
+ /* If this was shared among registers, must ensure we never
+ set it readonly since that can cause scheduling
+ problems. Note we would only have in this adjustment
+ case in any event, since the code above doesn't set it. */
+
+ if (from_reg == -1)
+ RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (regno_reg_rtx[i]);
}
/* Save the stack slot for later. */
@@ -2580,20 +2518,6 @@ mark_home_live (regno)
while (i < lim)
regs_ever_live[i++] = 1;
}
-
-/* Mark the registers used in SCRATCH as being live. */
-
-static void
-mark_scratch_live (scratch)
- rtx scratch;
-{
- register int i;
- int regno = REGNO (scratch);
- int lim = regno + HARD_REGNO_NREGS (regno, GET_MODE (scratch));
-
- for (i = regno; i < lim; i++)
- regs_ever_live[i] = 1;
-}
/* This function handles the tracking of elimination offsets around branches.
@@ -3392,8 +3316,13 @@ eliminate_regs_in_insn (insn, replace)
if (src == ep->to_rtx)
offset = 0, ok = 1;
else if (GET_CODE (src) == PLUS
- && GET_CODE (XEXP (src, 0)) == CONST_INT)
+ && GET_CODE (XEXP (src, 0)) == CONST_INT
+ && XEXP (src, 1) == ep->to_rtx)
offset = INTVAL (XEXP (src, 0)), ok = 1;
+ else if (GET_CODE (src) == PLUS
+ && GET_CODE (XEXP (src, 1)) == CONST_INT
+ && XEXP (src, 0) == ep->to_rtx)
+ offset = INTVAL (XEXP (src, 1)), ok = 1;
else if ((prev_insn = prev_nonnote_insn (insn)) != 0
&& (prev_set = single_set (prev_insn)) != 0
&& rtx_equal_p (SET_DEST (prev_set), src))
@@ -3634,6 +3563,178 @@ mark_not_eliminable (dest, x)
num_eliminable--;
}
}
+
+/* Reset all offsets on eliminable registers to their initial values. */
+static void
+set_initial_elim_offsets ()
+{
+ rtx x;
+
+#ifdef ELIMINABLE_REGS
+ struct elim_table *ep;
+
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ {
+ INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, ep->initial_offset);
+ ep->previous_offset = ep->offset
+ = ep->max_offset = ep->initial_offset;
+ }
+#else
+#ifdef INITIAL_FRAME_POINTER_OFFSET
+ INITIAL_FRAME_POINTER_OFFSET (reg_eliminate[0].initial_offset);
+#else
+ if (!FRAME_POINTER_REQUIRED)
+ abort ();
+ reg_eliminate[0].initial_offset = 0;
+#endif
+ reg_eliminate[0].previous_offset = reg_eliminate[0].max_offset
+ = reg_eliminate[0].offset = reg_eliminate[0].initial_offset;
+#endif
+
+ num_not_at_initial_offset = 0;
+
+ bzero ((char *) &offsets_known_at[get_first_label_num ()], num_labels);
+
+ /* Set a known offset for each forced label to be at the initial offset
+ of each elimination. We do this because we assume that all
+ computed jumps occur from a location where each elimination is
+ at its initial offset. */
+
+ for (x = forced_labels; x; x = XEXP (x, 1))
+ if (XEXP (x, 0))
+ set_label_offsets (XEXP (x, 0), NULL_RTX, 1);
+}
+
+/* See if anything that happened changes which eliminations are valid.
+ For example, on the Sparc, whether or not the frame pointer can
+ be eliminated can depend on what registers have been used. We need
+ not check some conditions again (such as flag_omit_frame_pointer)
+ since they can't have changed. */
+
+static void
+update_eliminables (pset)
+ HARD_REG_SET *pset;
+{
+#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
+ int previous_frame_pointer_needed = frame_pointer_needed;
+#endif
+ struct elim_table *ep;
+
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ if ((ep->from == HARD_FRAME_POINTER_REGNUM && FRAME_POINTER_REQUIRED)
+#ifdef ELIMINABLE_REGS
+ || ! CAN_ELIMINATE (ep->from, ep->to)
+#endif
+ )
+ ep->can_eliminate = 0;
+
+ /* Look for the case where we have discovered that we can't replace
+ register A with register B and that means that we will now be
+ trying to replace register A with register C. This means we can
+ no longer replace register C with register B and we need to disable
+ such an elimination, if it exists. This occurs often with A == ap,
+ B == sp, and C == fp. */
+
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ {
+ struct elim_table *op;
+ register int new_to = -1;
+
+ if (! ep->can_eliminate && ep->can_eliminate_previous)
+ {
+ /* Find the current elimination for ep->from, if there is a
+ new one. */
+ for (op = reg_eliminate;
+ op < &reg_eliminate[NUM_ELIMINABLE_REGS]; op++)
+ if (op->from == ep->from && op->can_eliminate)
+ {
+ new_to = op->to;
+ break;
+ }
+
+ /* See if there is an elimination of NEW_TO -> EP->TO. If so,
+ disable it. */
+ for (op = reg_eliminate;
+ op < &reg_eliminate[NUM_ELIMINABLE_REGS]; op++)
+ if (op->from == new_to && op->to == ep->to)
+ op->can_eliminate = 0;
+ }
+ }
+
+ /* See if any registers that we thought we could eliminate the previous
+ time are no longer eliminable. If so, something has changed and we
+ must spill the register. Also, recompute the number of eliminable
+ registers and see if the frame pointer is needed; it is if there is
+ no elimination of the frame pointer that we can perform. */
+
+ frame_pointer_needed = 1;
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ {
+ if (ep->can_eliminate && ep->from == FRAME_POINTER_REGNUM
+ && ep->to != HARD_FRAME_POINTER_REGNUM)
+ frame_pointer_needed = 0;
+
+ if (! ep->can_eliminate && ep->can_eliminate_previous)
+ {
+ ep->can_eliminate_previous = 0;
+ SET_HARD_REG_BIT (*pset, ep->from);
+ num_eliminable--;
+ }
+ }
+
+#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
+ /* If we didn't need a frame pointer last time, but we do now, spill
+ the hard frame pointer. */
+ if (frame_pointer_needed && ! previous_frame_pointer_needed)
+ SET_HARD_REG_BIT (*pset, HARD_FRAME_POINTER_REGNUM);
+#endif
+}
+
+/* Initialize the table of registers to eliminate. */
+static void
+init_elim_table ()
+{
+ struct elim_table *ep;
+
+ /* Does this function require a frame pointer? */
+
+ frame_pointer_needed = (! flag_omit_frame_pointer
+#ifdef EXIT_IGNORE_STACK
+ /* ?? If EXIT_IGNORE_STACK is set, we will not save
+ and restore sp for alloca. So we can't eliminate
+ the frame pointer in that case. At some point,
+ we should improve this by emitting the
+ sp-adjusting insns for this case. */
+ || (current_function_calls_alloca
+ && EXIT_IGNORE_STACK)
+#endif
+ || FRAME_POINTER_REQUIRED);
+
+ num_eliminable = 0;
+
+#ifdef ELIMINABLE_REGS
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ {
+ ep->can_eliminate = ep->can_eliminate_previous
+ = (CAN_ELIMINATE (ep->from, ep->to)
+ && ! (ep->to == STACK_POINTER_REGNUM && frame_pointer_needed));
+ }
+#else
+ reg_eliminate[0].can_eliminate = reg_eliminate[0].can_eliminate_previous
+ = ! frame_pointer_needed;
+#endif
+
+ /* Count the number of eliminable registers and build the FROM and TO
+ REG rtx's. Note that code in gen_rtx will cause, e.g.,
+ gen_rtx (REG, Pmode, STACK_POINTER_REGNUM) to equal stack_pointer_rtx.
+ We depend on this. */
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ {
+ num_eliminable += ep->can_eliminate;
+ ep->from_rtx = gen_rtx_REG (Pmode, ep->from);
+ ep->to_rtx = gen_rtx_REG (Pmode, ep->to);
+ }
+}
/* Kick all pseudos out of hard register REGNO.
If GLOBAL is nonzero, try to find someplace else to put them.
@@ -3712,29 +3813,6 @@ spill_hard_reg (regno, global, dumpfile, cant_eliminate)
i, reg_renumber[i]);
}
}
- for (i = 0; i < scratch_list_length; i++)
- {
- if (scratch_list[i] && REGNO (scratch_list[i]) == regno)
- {
- if (! cant_eliminate && basic_block_needs[0]
- && ! basic_block_needs[(int) class][scratch_block[i]])
- {
- enum reg_class *p;
-
- for (p = reg_class_superclasses[(int) class];
- *p != LIM_REG_CLASSES; p++)
- if (basic_block_needs[(int) *p][scratch_block[i]] > 0)
- break;
-
- if (*p == LIM_REG_CLASSES)
- continue;
- }
- PUT_CODE (scratch_list[i], SCRATCH);
- scratch_list[i] = 0;
- something_changed = 1;
- continue;
- }
- }
return something_changed;
}
@@ -3814,8 +3892,7 @@ hard_reg_use_compare (p1p, p2p)
Store them in order of decreasing preference in potential_reload_regs. */
static void
-order_regs_for_reload (global)
- int global;
+order_regs_for_reload ()
{
register int i;
register int o = 0;
@@ -3844,15 +3921,7 @@ order_regs_for_reload (global)
{
int lim = regno + HARD_REGNO_NREGS (regno, PSEUDO_REGNO_MODE (i));
while (regno < lim)
- {
- /* If allocated by local-alloc, show more uses since
- we're not going to be able to reallocate it, but
- we might if allocated by global alloc. */
- if (global && reg_allocno[i] < 0)
- hard_reg_n_uses[regno].uses += (REG_N_REFS (i) + 1) / 2;
-
- hard_reg_n_uses[regno++].uses += REG_N_REFS (i);
- }
+ hard_reg_n_uses[regno++].uses += REG_N_REFS (i);
}
large += REG_N_REFS (i);
}
@@ -4119,7 +4188,7 @@ reload_as_needed (first, live_known)
/* Generate the insns to reload operands into or out of
their reload regs. */
- emit_reload_insns (insn);
+ emit_reload_insns (insn, this_block);
/* Substitute the chosen reload regs from reload_reg_rtx
into the insn's body (or perhaps into the bodies of other
@@ -4215,7 +4284,7 @@ reload_as_needed (first, live_known)
static void
forget_old_reloads_1 (x, ignored)
rtx x;
- rtx ignored;
+ rtx ignored ATTRIBUTE_UNUSED;
{
register int regno;
int nr;
@@ -4627,13 +4696,21 @@ reload_reg_free_p (regno, opnum, type)
We can assume that the reload reg was already tested for availability
at the time it is needed, and we should not check this again,
- in case the reg has already been marked in use. */
+ in case the reg has already been marked in use.
+
+ However, if EQUIV is set, we are checking the availability of a register
+ holding an equivalence to the value to be loaded into the reload register,
+ not the availability of the reload register itself.
+
+ This is still less stringent than what reload_reg_free_p checks; for
+ example, compare the checks for RELOAD_OTHER. */
static int
-reload_reg_free_before_p (regno, opnum, type)
+reload_reg_free_before_p (regno, opnum, type, equiv)
int regno;
int opnum;
enum reload_type type;
+ int equiv;
{
int i;
@@ -4641,9 +4718,13 @@ reload_reg_free_before_p (regno, opnum, type)
{
case RELOAD_FOR_OTHER_ADDRESS:
/* These always come first. */
+ if (equiv && TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno))
+ return 0;
return 1;
case RELOAD_OTHER:
+ if (equiv && TEST_HARD_REG_BIT (reload_reg_used, regno))
+ return 0;
return ! TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno);
/* If this use is for part of the insn,
@@ -4655,15 +4736,25 @@ reload_reg_free_before_p (regno, opnum, type)
the first place, since we know that it was allocated. */
case RELOAD_FOR_OUTPUT_ADDRESS:
+ if (equiv
+ && TEST_HARD_REG_BIT (reload_reg_used_in_output_addr[opnum], regno))
+ return 0;
+ /* Earlier reloads include RELOAD_FOR_OUTADDR_ADDRESS reloads. */
+ if (TEST_HARD_REG_BIT (reload_reg_used_in_outaddr_addr[opnum], regno))
+ return 0;
+ /* ... fall through ... */
case RELOAD_FOR_OUTADDR_ADDRESS:
+ if (equiv
+ && (TEST_HARD_REG_BIT (reload_reg_used_in_outaddr_addr[opnum], regno)
+ || TEST_HARD_REG_BIT (reload_reg_used, regno)))
+ return 0;
/* Earlier reloads are for earlier outputs or their addresses,
any RELOAD_FOR_INSN reloads, any inputs or their addresses, or any
RELOAD_FOR_OTHER_ADDRESS reloads (we know it can't conflict with
RELOAD_OTHER).. */
for (i = 0; i < opnum; i++)
if (TEST_HARD_REG_BIT (reload_reg_used_in_output_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_outaddr_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_output[i], regno))
+ || TEST_HARD_REG_BIT (reload_reg_used_in_outaddr_addr[i], regno))
return 0;
if (TEST_HARD_REG_BIT (reload_reg_used_in_insn, regno))
@@ -4672,38 +4763,25 @@ reload_reg_free_before_p (regno, opnum, type)
for (i = 0; i < reload_n_operands; i++)
if (TEST_HARD_REG_BIT (reload_reg_used_in_input_addr[i], regno)
|| TEST_HARD_REG_BIT (reload_reg_used_in_inpaddr_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_input[i], regno))
+ || TEST_HARD_REG_BIT (reload_reg_used_in_input[i], regno)
+ || TEST_HARD_REG_BIT (reload_reg_used_in_output[i], regno))
return 0;
return (! TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno)
&& ! TEST_HARD_REG_BIT (reload_reg_used_in_insn, regno)
+ && ! TEST_HARD_REG_BIT (reload_reg_used_in_op_addr_reload, regno)
&& ! TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno));
case RELOAD_FOR_OUTPUT:
- /* This can't be used in the output address for this operand and
- anything that can't be used for it, except that we've already
- tested for RELOAD_FOR_INSN objects. */
+ case RELOAD_FOR_INSN:
+ /* There is no reason to call this function for output reloads, thus
+ anything we'd put here wouldn't be tested. So just abort. */
+ abort ();
- if (TEST_HARD_REG_BIT (reload_reg_used_in_output_addr[opnum], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_outaddr_addr[opnum], regno))
+ case RELOAD_FOR_OPERAND_ADDRESS:
+ if (equiv && TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno))
return 0;
- for (i = 0; i < opnum; i++)
- if (TEST_HARD_REG_BIT (reload_reg_used_in_output_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_outaddr_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_output[i], regno))
- return 0;
-
- for (i = 0; i < reload_n_operands; i++)
- if (TEST_HARD_REG_BIT (reload_reg_used_in_input_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_inpaddr_addr[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_input[i], regno)
- || TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno))
- return 0;
-
- return ! TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno);
-
- case RELOAD_FOR_OPERAND_ADDRESS:
/* Earlier reloads include RELOAD_FOR_OPADDR_ADDR reloads. */
if (TEST_HARD_REG_BIT (reload_reg_used_in_op_addr_reload, regno))
return 0;
@@ -4711,7 +4789,15 @@ reload_reg_free_before_p (regno, opnum, type)
/* ... fall through ... */
case RELOAD_FOR_OPADDR_ADDR:
- case RELOAD_FOR_INSN:
+ if (equiv)
+ {
+ if (TEST_HARD_REG_BIT (reload_reg_used_in_op_addr_reload, regno)
+ || TEST_HARD_REG_BIT (reload_reg_used, regno))
+ return 0;
+ for (i = 0; i < reload_n_operands; i++)
+ if (TEST_HARD_REG_BIT (reload_reg_used_in_input[i], regno))
+ return 0;
+ }
/* These can't conflict with inputs, or each other, so all we have to
test is input addresses and the addresses of OTHER items. */
@@ -4723,6 +4809,9 @@ reload_reg_free_before_p (regno, opnum, type)
return ! TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno);
case RELOAD_FOR_INPUT:
+ if (equiv && TEST_HARD_REG_BIT (reload_reg_used, regno))
+ return 0;
+
/* The only things earlier are the address for this and
earlier inputs, other inputs (which we know we don't conflict
with), and addresses of RELOAD_OTHER objects. */
@@ -4735,7 +4824,14 @@ reload_reg_free_before_p (regno, opnum, type)
return ! TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno);
case RELOAD_FOR_INPUT_ADDRESS:
+ /* Earlier reloads include RELOAD_FOR_INPADDR_ADDRESS reloads. */
+ if (TEST_HARD_REG_BIT (reload_reg_used_in_inpaddr_addr[opnum], regno))
+ return 0;
+ /* ... fall through ... */
case RELOAD_FOR_INPADDR_ADDRESS:
+ if (equiv && TEST_HARD_REG_BIT (reload_reg_used, regno))
+ return 0;
+
/* Similarly, all we have to check is for use in earlier inputs'
addresses. */
for (i = 0; i < opnum; i++)
@@ -4977,6 +5073,134 @@ rtx reload_override_in[MAX_RELOADS];
or -1 if we did not need a register for this reload. */
int reload_spill_index[MAX_RELOADS];
+/* Return 1 if the value in reload reg REGNO, as used by a reload
+ needed for the part of the insn specified by OPNUM and TYPE,
+ may be used to load VALUE into it.
+
+ Other read-only reloads with the same value do not conflict
+ unless OUT is non-zero and these other reloads have to live while
+ output reloads live.
+
+ RELOADNUM is the number of the reload we want to load this value for;
+ a reload does not conflict with itself.
+
+ The caller has to make sure that there is no conflict with the return
+ register. */
+static int
+reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum)
+ int regno;
+ int opnum;
+ enum reload_type type;
+ rtx value, out;
+ int reloadnum;
+{
+ int time1;
+ int i;
+
+ /* We use some pseudo 'time' value to check if the lifetimes of the
+ new register use would overlap with the one of a previous reload
+ that is not read-only or uses a different value.
+ The 'time' used doesn't have to be linear in any shape or form, just
+ monotonic.
+ Some reload types use different 'buckets' for each operand.
+ So there are MAX_RECOG_OPERANDS different time values for each
+ such reload type.
+ We compute TIME1 as the time when the register for the prospective
+ new reload ceases to be live, and TIME2 for each existing
+ reload as the time when that the reload register of that reload
+ becomes live.
+ Where there is little to be gained by exact lifetime calculations,
+ we just make conservative assumptions, i.e. a longer lifetime;
+ this is done in the 'default:' cases. */
+ switch (type)
+ {
+ case RELOAD_FOR_OTHER_ADDRESS:
+ time1 = 0;
+ break;
+ /* For each input, we might have a sequence of RELOAD_FOR_INPADDR_ADDRESS,
+ RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_INPUT. By adding 0 / 1 / 2 ,
+ respectively, to the time values for these, we get distinct time
+ values. To get distinct time values for each operand, we have to
+ multiply opnum by at least three. We round that up to four because
+ multiply by four is often cheaper. */
+ case RELOAD_FOR_INPADDR_ADDRESS:
+ time1 = opnum * 4 + 1;
+ break;
+ case RELOAD_FOR_INPUT_ADDRESS:
+ time1 = opnum * 4 + 2;
+ break;
+ case RELOAD_FOR_INPUT:
+ /* All RELOAD_FOR_INPUT reloads remain live till just before the
+ instruction is executed. */
+ time1 = (MAX_RECOG_OPERANDS - 1) * 4 + 3;
+ break;
+ /* opnum * 4 + 3 < opnum * 4 + 4
+ <= (MAX_RECOG_OPERANDS - 1) * 4 + 4 == MAX_RECOG_OPERANDS * 4 */
+ case RELOAD_FOR_OUTPUT_ADDRESS:
+ time1 = MAX_RECOG_OPERANDS * 4 + opnum;
+ break;
+ default:
+ time1 = MAX_RECOG_OPERANDS * 5;
+ }
+
+ for (i = 0; i < n_reloads; i++)
+ {
+ rtx reg = reload_reg_rtx[i];
+ if (reg && GET_CODE (reg) == REG
+ && ((unsigned) regno - true_regnum (reg)
+ <= HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)) - (unsigned)1)
+ && i != reloadnum)
+ {
+ if (out
+ && reload_when_needed[i] != RELOAD_FOR_INPUT
+ && reload_when_needed[i] != RELOAD_FOR_INPUT_ADDRESS
+ && reload_when_needed[i] != RELOAD_FOR_INPADDR_ADDRESS)
+ return 0;
+ if (! reload_in[i] || ! rtx_equal_p (reload_in[i], value)
+ || reload_out[i])
+ {
+ int time2;
+ switch (reload_when_needed[i])
+ {
+ case RELOAD_FOR_OTHER_ADDRESS:
+ time2 = 0;
+ break;
+ case RELOAD_FOR_INPADDR_ADDRESS:
+ time2 = reload_opnum[i] * 4 + 1;
+ break;
+ case RELOAD_FOR_INPUT_ADDRESS:
+ time2 = reload_opnum[i] * 4 + 2;
+ break;
+ case RELOAD_FOR_INPUT:
+ time2 = reload_opnum[i] * 4 + 3;
+ break;
+ case RELOAD_FOR_OUTPUT:
+ /* All RELOAD_FOR_OUTPUT reloads become live just after the
+ instruction is executed. */
+ time2 = MAX_RECOG_OPERANDS * 4;
+ break;
+ /* The first RELOAD_FOR_OUTPUT_ADDRESS reload conflicts with the
+ RELOAD_FOR_OUTPUT reloads, so assign it the same time value. */
+ case RELOAD_FOR_OUTPUT_ADDRESS:
+ time2 = MAX_RECOG_OPERANDS * 4 + reload_opnum[i];
+ break;
+ case RELOAD_OTHER:
+ if (! reload_in[i] || rtx_equal_p (reload_in[i], value))
+ {
+ time2 = MAX_RECOG_OPERANDS * 4;
+ break;
+ }
+ default:
+ time2 = 0;
+ }
+ if (time1 >= time2)
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
/* Find a spill register to use as a reload register for reload R.
LAST_RELOAD is non-zero if this is the last reload for the insn being
processed.
@@ -5049,8 +5273,17 @@ allocate_reload_reg (r, insn, last_reload, noerror)
i = (i + 1) % n_spills;
- if (reload_reg_free_p (spill_regs[i], reload_opnum[r],
- reload_when_needed[r])
+ if ((reload_reg_free_p (spill_regs[i], reload_opnum[r],
+ reload_when_needed[r])
+ || (reload_in[r]
+ /* We check reload_reg_used to make sure we
+ don't clobber the return register. */
+ && ! TEST_HARD_REG_BIT (reload_reg_used, spill_regs[i])
+ && reload_reg_free_for_value_p (spill_regs[i],
+ reload_opnum[r],
+ reload_when_needed[r],
+ reload_in[r],
+ reload_out[r], r)))
&& TEST_HARD_REG_BIT (reg_class_contents[class], spill_regs[i])
&& HARD_REGNO_MODE_OK (spill_regs[i], reload_mode[r])
/* Look first for regs to share, then for unshared. But
@@ -5405,13 +5638,16 @@ choose_reload_regs (insn, avoid_return_reg)
&& ! reload_secondary_p[r])
continue;
- /* If find_reloads chose a to use reload_in or reload_out as a reload
+ /* If find_reloads chose to use reload_in or reload_out as a reload
register, we don't need to chose one. Otherwise, try even if it
found one since we might save an insn if we find the value lying
- around. */
+ around.
+ Try also when reload_in is a pseudo without a hard reg. */
if (reload_in[r] != 0 && reload_reg_rtx[r] != 0
&& (rtx_equal_p (reload_in[r], reload_reg_rtx[r])
- || rtx_equal_p (reload_out[r], reload_reg_rtx[r])))
+ || (rtx_equal_p (reload_out[r], reload_reg_rtx[r])
+ && GET_CODE (reload_in[r]) != MEM
+ && true_regnum (reload_in[r]) < FIRST_PSEUDO_REGISTER)))
continue;
#if 0 /* No longer needed for correct operation.
@@ -5448,7 +5684,6 @@ choose_reload_regs (insn, avoid_return_reg)
{
register int regno = -1;
enum machine_mode mode;
- rtx in, use_insn = 0;
if (reload_in[r] == 0)
;
@@ -5486,7 +5721,6 @@ choose_reload_regs (insn, avoid_return_reg)
{
regno = REGNO (XEXP (PATTERN (prev), 0));
mode = GET_MODE (reload_in[r]);
- use_insn = prev;
}
}
}
@@ -5513,10 +5747,15 @@ choose_reload_regs (insn, avoid_return_reg)
&& (reload_nregs[r] == max_group_size
|| ! TEST_HARD_REG_BIT (reg_class_contents[(int) group_class],
i))
- && reload_reg_free_p (i, reload_opnum[r],
- reload_when_needed[r])
- && reload_reg_free_before_p (i, reload_opnum[r],
- reload_when_needed[r]))
+ && ((reload_reg_free_p (i, reload_opnum[r],
+ reload_when_needed[r])
+ && reload_reg_free_before_p (i, reload_opnum[r],
+ reload_when_needed[r],
+ 0))
+ || reload_reg_free_for_value_p (i, reload_opnum[r],
+ reload_when_needed[r],
+ reload_in[r],
+ reload_out[r], r)))
{
/* If a group is needed, verify that all the subsequent
registers still have their values intact. */
@@ -5554,7 +5793,13 @@ choose_reload_regs (insn, avoid_return_reg)
/* Don't really use the inherited spill reg
if we need it wider than we've got it. */
|| (GET_MODE_SIZE (reload_mode[r])
- > GET_MODE_SIZE (mode)))
+ > GET_MODE_SIZE (mode))
+ /* If find_reloads chose reload_out as reload
+ register, stay with it - that leaves the
+ inherited register for subsequent reloads. */
+ || (reload_out[r] && reload_reg_rtx
+ && rtx_equal_p (reload_out[r],
+ reload_reg_rtx[r])))
reload_override_in[r] = reg_last_reload_reg[regno];
else
{
@@ -5618,8 +5863,13 @@ choose_reload_regs (insn, avoid_return_reg)
and of the desired class. */
if (equiv != 0
&& ((spill_reg_order[regno] >= 0
- && ! reload_reg_free_before_p (regno, reload_opnum[r],
- reload_when_needed[r]))
+ && ! (reload_reg_free_before_p (regno, reload_opnum[r],
+ reload_when_needed[r], 1)
+ || reload_reg_free_for_value_p (regno,
+ reload_opnum[r],
+ reload_when_needed[r],
+ reload_in[r],
+ reload_out[r], r)))
|| ! TEST_HARD_REG_BIT (reg_class_contents[(int) reload_reg_class[r]],
regno)))
equiv = 0;
@@ -5645,14 +5895,30 @@ choose_reload_regs (insn, avoid_return_reg)
break;
}
- /* JRV: If the equiv register we have found is
- explicitly clobbered in the current insn, mark but
- don't use, as above. */
+ /* If the equiv register we have found is explicitly clobbered
+ in the current insn, it depends on the reload type if we
+ can use it, use it for reload_override_in, or not at all.
+ In particular, we then can't use EQUIV for a
+ RELOAD_FOR_OUTPUT_ADDRESS reload. */
if (equiv != 0 && regno_clobbered_p (regno, insn))
{
- reload_override_in[r] = equiv;
- equiv = 0;
+ switch (reload_when_needed[r])
+ {
+ case RELOAD_FOR_OTHER_ADDRESS:
+ case RELOAD_FOR_INPADDR_ADDRESS:
+ case RELOAD_FOR_INPUT_ADDRESS:
+ case RELOAD_FOR_OPADDR_ADDR:
+ break;
+ case RELOAD_OTHER:
+ case RELOAD_FOR_INPUT:
+ case RELOAD_FOR_OPERAND_ADDRESS:
+ reload_override_in[r] = equiv;
+ /* Fall through. */
+ default:
+ equiv = 0;
+ break;
+ }
}
/* If we found an equivalent reg, say no code need be generated
@@ -5664,6 +5930,12 @@ choose_reload_regs (insn, avoid_return_reg)
reload_reg_rtx[r] = equiv;
reload_inherited[r] = 1;
+ /* If reg_reloaded_valid is not set for this register,
+ there might be a stale spill_reg_store lying around.
+ We must clear it, since otherwise emit_reload_insns
+ might delete the store. */
+ if (! TEST_HARD_REG_BIT (reg_reloaded_valid, regno))
+ spill_reg_store[regno] = NULL_RTX;
/* If any of the hard registers in EQUIV are spill
registers, mark them as in use for this insn. */
for (k = 0; k < nr; k++)
@@ -5796,10 +6068,56 @@ choose_reload_regs (insn, avoid_return_reg)
register int r = reload_order[j];
if (reload_inherited[r] && reload_reg_rtx[r] != 0
- && ! reload_reg_free_before_p (true_regnum (reload_reg_rtx[r]),
- reload_opnum[r],
- reload_when_needed[r]))
+ && ! (reload_reg_free_before_p (true_regnum (reload_reg_rtx[r]),
+ reload_opnum[r],
+ reload_when_needed[r], 0)
+ || reload_reg_free_for_value_p (true_regnum (reload_reg_rtx[r]),
+ reload_opnum[r],
+ reload_when_needed[r],
+ reload_in[r],
+ reload_out[r], r)))
reload_inherited[r] = 0;
+ /* If we can inherit a RELOAD_FOR_INPUT, then we do not need its related
+ RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS reloads.
+ ??? This could be extended to other reload types, but these are
+ more tricky to handle:
+ RELOAD_FOR_OTHER_ADDRESS reloads might have been merged, so we
+ can't eliminate them without a check that *all* references are
+ now unused due to inheritance.
+ While RELOAD_FOR_INPADDR_ADDRESS and RELOAD_FOR_OUTADDR_ADDRESS are
+ not merged, we can't be sure that we have eliminated the use of
+ that particular reload if we have seen just one
+ RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_OUTPUT_ADDRESS being inherited,
+ since there might be multiple of the latter two reloads for a single
+ operand.
+ RELOAD_FOR_OPADDR_ADDR reloads for different operands are not
+ merged, but might share the same register by courtesy of
+ reload_reg_free_for_value_p. reload_reg_used_in_op_addr_reload
+ does not differentiate by opnum, thus calling clear_reload_reg_in_use
+ for one of these reloads would mark the register as free even though
+ another RELOAD_FOR_OPADDR_ADDR reload might still use it. */
+ else if (reload_inherited[r] && reload_when_needed[r] == RELOAD_FOR_INPUT)
+ {
+ for (i = 0; i < n_reloads; i++)
+ {
+ if ((reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS
+ || reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS)
+ && reload_opnum[i] == reload_opnum[r]
+ && reload_in[i] && reload_reg_rtx[i])
+ {
+ int regno = true_regnum (reload_reg_rtx[i]);
+
+ reload_in[i] = 0;
+ if (spill_reg_order[regno] >= 0)
+ clear_reload_reg_in_use (regno, reload_opnum[i],
+ reload_when_needed[i],
+ reload_mode[i]);
+ reload_reg_rtx[i] = 0;
+ reload_spill_index[i] = -1;
+ remove_replacements (i);
+ }
+ }
+ }
/* If we found a better place to reload from,
validate it in the same fashion, if it is a reload reg. */
@@ -5810,7 +6128,7 @@ choose_reload_regs (insn, avoid_return_reg)
int regno = true_regnum (reload_override_in[r]);
if (spill_reg_order[regno] >= 0
&& ! reload_reg_free_before_p (regno, reload_opnum[r],
- reload_when_needed[r]))
+ reload_when_needed[r], 1))
reload_override_in[r] = 0;
}
}
@@ -5900,6 +6218,10 @@ merge_assigned_reloads (insn)
for (i = 0; i < n_reloads; i++)
{
+ int conflicting_input = 0;
+ int max_input_address_opnum = -1;
+ int min_conflicting_input_opnum = MAX_RECOG_OPERANDS;
+
if (reload_in[i] == 0 || reload_when_needed[i] == RELOAD_OTHER
|| reload_out[i] != 0 || reload_reg_rtx[i] == 0
|| reg_set_p (reload_reg_rtx[i], insn))
@@ -5918,27 +6240,46 @@ merge_assigned_reloads (insn)
reload_reg_rtx[i]))
continue;
+ if (reload_when_needed[j] == RELOAD_FOR_INPUT_ADDRESS
+ && reload_opnum[j] > max_input_address_opnum)
+ max_input_address_opnum = reload_opnum[j];
+
/* If the reload regs aren't exactly the same (e.g, different modes)
- or if the values are different, we can't merge anything with this
- reload register. */
+ or if the values are different, we can't merge this reload.
+ But if it is an input reload, we might still merge
+ RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS reloads. */
if (! rtx_equal_p (reload_reg_rtx[i], reload_reg_rtx[j])
|| reload_out[j] != 0 || reload_in[j] == 0
|| ! rtx_equal_p (reload_in[i], reload_in[j]))
- break;
+ {
+ if (reload_when_needed[j] != RELOAD_FOR_INPUT
+ || ((reload_when_needed[i] != RELOAD_FOR_INPUT_ADDRESS
+ || reload_opnum[i] > reload_opnum[j])
+ && reload_when_needed[i] != RELOAD_FOR_OTHER_ADDRESS))
+ break;
+ conflicting_input = 1;
+ if (min_conflicting_input_opnum > reload_opnum[j])
+ min_conflicting_input_opnum = reload_opnum[j];
+ }
}
/* If all is OK, merge the reloads. Only set this to RELOAD_OTHER if
we, in fact, found any matching reloads. */
- if (j == n_reloads)
+ if (j == n_reloads
+ && max_input_address_opnum <= min_conflicting_input_opnum)
{
for (j = 0; j < n_reloads; j++)
if (i != j && reload_reg_rtx[j] != 0
- && rtx_equal_p (reload_reg_rtx[i], reload_reg_rtx[j]))
+ && rtx_equal_p (reload_reg_rtx[i], reload_reg_rtx[j])
+ && (! conflicting_input
+ || reload_when_needed[j] == RELOAD_FOR_INPUT_ADDRESS
+ || reload_when_needed[j] == RELOAD_FOR_OTHER_ADDRESS))
{
reload_when_needed[i] = RELOAD_OTHER;
reload_in[j] = 0;
+ reload_spill_index[j] = -1;
transfer_replacements (i, j);
}
@@ -5966,8 +6307,9 @@ merge_assigned_reloads (insn)
/* Output insns to reload values in and out of the chosen reload regs. */
static void
-emit_reload_insns (insn)
+emit_reload_insns (insn, bb)
rtx insn;
+ int bb;
{
register int j;
rtx input_reload_insns[MAX_RECOG_OPERANDS];
@@ -5982,7 +6324,7 @@ emit_reload_insns (insn)
rtx other_operand_reload_insns = 0;
rtx other_output_reload_insns[MAX_RECOG_OPERANDS];
rtx following_insn = NEXT_INSN (insn);
- rtx before_insn = insn;
+ rtx before_insn = PREV_INSN (insn);
int special;
/* Values to be put in spill_reg_store are put here first. */
rtx new_spill_reg_store[FIRST_PSEUDO_REGISTER];
@@ -6100,7 +6442,7 @@ emit_reload_insns (insn)
&& (! reload_reg_free_p (regno, reload_opnum[j],
reload_when_needed[j])
|| ! reload_reg_free_before_p (regno, reload_opnum[j],
- reload_when_needed[j])))
+ reload_when_needed[j], 1)))
oldequiv = 0;
/* If OLDEQUIV is not a spill register,
@@ -6127,16 +6469,15 @@ emit_reload_insns (insn)
&& ((REGNO_REG_CLASS (regno) != reload_reg_class[j]
&& (REGISTER_MOVE_COST (REGNO_REG_CLASS (regno),
reload_reg_class[j])
- >= MEMORY_MOVE_COST (mode, REGNO_REG_CLASS (regno),
- 1)))
+ >= MEMORY_MOVE_COST (mode, reload_reg_class[j], 1)))
#ifdef SECONDARY_INPUT_RELOAD_CLASS
|| (SECONDARY_INPUT_RELOAD_CLASS (reload_reg_class[j],
mode, oldequiv)
!= NO_REGS)
#endif
#ifdef SECONDARY_MEMORY_NEEDED
- || SECONDARY_MEMORY_NEEDED (reload_reg_class[j],
- REGNO_REG_CLASS (regno),
+ || SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (regno),
+ reload_reg_class[j],
mode)
#endif
))
@@ -6242,7 +6583,7 @@ emit_reload_insns (insn)
uses the same reg first. */
&& reload_reg_free_before_p (REGNO (reloadreg),
reload_opnum[j],
- reload_when_needed[j]))
+ reload_when_needed[j], 0))
{
rtx temp = PREV_INSN (insn);
while (temp && GET_CODE (temp) == NOTE)
@@ -6411,28 +6752,6 @@ emit_reload_insns (insn)
gen_reload (reloadreg, oldequiv, reload_opnum[j],
reload_when_needed[j]);
-#if defined(SECONDARY_INPUT_RELOAD_CLASS) && defined(PRESERVE_DEATH_INFO_REGNO_P)
- /* We may have to make a REG_DEAD note for the secondary reload
- register in the insns we just made. Find the last insn that
- mentioned the register. */
- if (! special && second_reload_reg
- && PRESERVE_DEATH_INFO_REGNO_P (REGNO (second_reload_reg)))
- {
- rtx prev;
-
- for (prev = get_last_insn (); prev;
- prev = PREV_INSN (prev))
- if (GET_RTX_CLASS (GET_CODE (prev) == 'i')
- && reg_overlap_mentioned_for_reload_p (second_reload_reg,
- PATTERN (prev)))
- {
- REG_NOTES (prev) = gen_rtx_EXPR_LIST (REG_DEAD,
- second_reload_reg,
- REG_NOTES (prev));
- break;
- }
- }
-#endif
}
this_reload_insn = get_last_insn ();
@@ -6454,118 +6773,6 @@ emit_reload_insns (insn)
reload_in[j]
= regno_reg_rtx[reg_reloaded_contents[reload_spill_index[j]]];
}
- /* Add a note saying the input reload reg
- dies in this insn, if anyone cares. */
-#ifdef PRESERVE_DEATH_INFO_REGNO_P
- if (old != 0
- && reload_reg_rtx[j] != old
- && reload_reg_rtx[j] != 0
- && reload_out[j] == 0
- && ! reload_inherited[j]
- && PRESERVE_DEATH_INFO_REGNO_P (REGNO (reload_reg_rtx[j])))
- {
- register rtx reloadreg = reload_reg_rtx[j];
-
-#if 0
- /* We can't abort here because we need to support this for sched.c.
- It's not terrible to miss a REG_DEAD note, but we should try
- to figure out how to do this correctly. */
- /* The code below is incorrect for address-only reloads. */
- if (reload_when_needed[j] != RELOAD_OTHER
- && reload_when_needed[j] != RELOAD_FOR_INPUT)
- abort ();
-#endif
-
- /* Add a death note to this insn, for an input reload. */
-
- if ((reload_when_needed[j] == RELOAD_OTHER
- || reload_when_needed[j] == RELOAD_FOR_INPUT)
- && ! dead_or_set_p (insn, reloadreg))
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_DEAD,
- reloadreg, REG_NOTES (insn));
- }
-
- /* When we inherit a reload, the last marked death of the reload reg
- may no longer really be a death. */
- if (reload_reg_rtx[j] != 0
- && PRESERVE_DEATH_INFO_REGNO_P (REGNO (reload_reg_rtx[j]))
- && reload_inherited[j])
- {
- /* Handle inheriting an output reload.
- Remove the death note from the output reload insn. */
- if (reload_spill_index[j] >= 0
- && GET_CODE (reload_in[j]) == REG
- && spill_reg_store[reload_spill_index[j]] != 0
- && find_regno_note (spill_reg_store[reload_spill_index[j]],
- REG_DEAD, REGNO (reload_reg_rtx[j])))
- remove_death (REGNO (reload_reg_rtx[j]),
- spill_reg_store[reload_spill_index[j]]);
- /* Likewise for input reloads that were inherited. */
- else if (reload_spill_index[j] >= 0
- && GET_CODE (reload_in[j]) == REG
- && spill_reg_store[reload_spill_index[j]] == 0
- && reload_inheritance_insn[j] != 0
- && find_regno_note (reload_inheritance_insn[j], REG_DEAD,
- REGNO (reload_reg_rtx[j])))
- remove_death (REGNO (reload_reg_rtx[j]),
- reload_inheritance_insn[j]);
- else
- {
- rtx prev;
-
- /* We got this register from find_equiv_reg.
- Search back for its last death note and get rid of it.
- But don't search back too far.
- Don't go past a place where this reg is set,
- since a death note before that remains valid. */
- for (prev = PREV_INSN (insn);
- prev && GET_CODE (prev) != CODE_LABEL;
- prev = PREV_INSN (prev))
- if (GET_RTX_CLASS (GET_CODE (prev)) == 'i'
- && dead_or_set_p (prev, reload_reg_rtx[j]))
- {
- if (find_regno_note (prev, REG_DEAD,
- REGNO (reload_reg_rtx[j])))
- remove_death (REGNO (reload_reg_rtx[j]), prev);
- break;
- }
- }
- }
-
- /* We might have used find_equiv_reg above to choose an alternate
- place from which to reload. If so, and it died, we need to remove
- that death and move it to one of the insns we just made. */
-
- if (oldequiv_reg != 0
- && PRESERVE_DEATH_INFO_REGNO_P (true_regnum (oldequiv_reg)))
- {
- rtx prev, prev1;
-
- for (prev = PREV_INSN (insn); prev && GET_CODE (prev) != CODE_LABEL;
- prev = PREV_INSN (prev))
- if (GET_RTX_CLASS (GET_CODE (prev)) == 'i'
- && dead_or_set_p (prev, oldequiv_reg))
- {
- if (find_regno_note (prev, REG_DEAD, REGNO (oldequiv_reg)))
- {
- for (prev1 = this_reload_insn;
- prev1; prev1 = PREV_INSN (prev1))
- if (GET_RTX_CLASS (GET_CODE (prev1) == 'i')
- && reg_overlap_mentioned_for_reload_p (oldequiv_reg,
- PATTERN (prev1)))
- {
- REG_NOTES (prev1) = gen_rtx_EXPR_LIST (REG_DEAD,
- oldequiv_reg,
- REG_NOTES (prev1));
- break;
- }
- remove_death (REGNO (oldequiv_reg), prev);
- }
- break;
- }
- }
-#endif
/* If we are reloading a register that was recently stored in with an
output-reload, see if we can prove there was
@@ -6583,7 +6790,8 @@ emit_reload_insns (insn)
&& spill_reg_store[reload_spill_index[j]] != 0
/* This is unsafe if some other reload uses the same reg first. */
&& reload_reg_free_before_p (reload_spill_index[j],
- reload_opnum[j], reload_when_needed[j])
+ reload_opnum[j], reload_when_needed[j],
+ 0)
&& dead_or_set_p (insn, reload_in[j])
/* This is unsafe if operand occurs more than once in current
insn. Perhaps some occurrences weren't reloaded. */
@@ -6755,33 +6963,21 @@ emit_reload_insns (insn)
/* Output the last reload insn. */
if (! special)
- gen_reload (old, reloadreg, reload_opnum[j],
- reload_when_needed[j]);
-
-#ifdef PRESERVE_DEATH_INFO_REGNO_P
- /* If final will look at death notes for this reg,
- put one on the last output-reload insn to use it. Similarly
- for any secondary register. */
- if (PRESERVE_DEATH_INFO_REGNO_P (REGNO (reloadreg)))
- for (p = get_last_insn (); p; p = PREV_INSN (p))
- if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
- && reg_overlap_mentioned_for_reload_p (reloadreg,
- PATTERN (p)))
- REG_NOTES (p) = gen_rtx_EXPR_LIST (REG_DEAD,
- reloadreg, REG_NOTES (p));
+ {
+ rtx set;
+
+ /* Don't output the last reload if OLD is not the dest of
+ INSN and is in the src and is clobbered by INSN. */
+ if (! flag_expensive_optimizations
+ || GET_CODE (old) != REG
+ || !(set = single_set (insn))
+ || rtx_equal_p (old, SET_DEST (set))
+ || !reg_mentioned_p (old, SET_SRC (set))
+ || !regno_clobbered_p (REGNO (old), insn))
+ gen_reload (old, reloadreg, reload_opnum[j],
+ reload_when_needed[j]);
+ }
-#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
- if (! special && second_reloadreg
- && PRESERVE_DEATH_INFO_REGNO_P (REGNO (second_reloadreg)))
- for (p = get_last_insn (); p; p = PREV_INSN (p))
- if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
- && reg_overlap_mentioned_for_reload_p (second_reloadreg,
- PATTERN (p)))
- REG_NOTES (p) = gen_rtx_EXPR_LIST (REG_DEAD,
- second_reloadreg,
- REG_NOTES (p));
-#endif
-#endif
/* Look at all insns we emitted, just to be safe. */
for (p = get_insns (); p; p = NEXT_INSN (p))
if (GET_RTX_CLASS (GET_CODE (p)) == 'i')
@@ -6808,7 +7004,35 @@ emit_reload_insns (insn)
SET_HARD_REG_BIT (reg_reloaded_died, src);
}
if (reload_spill_index[j] >= 0)
- new_spill_reg_store[reload_spill_index[j]] = p;
+ {
+ int s = reload_secondary_out_reload[j];
+ rtx set = single_set (p);
+ /* If this reload copies only to the secondary reload
+ register, the secondary reload does the actual
+ store. */
+ if (s >= 0 && set == NULL_RTX)
+ ; /* We can't tell what function the secondary reload
+ has and where the actual store to the pseudo is
+ made; leave new_spill_reg_store alone. */
+ else if (s >= 0
+ && SET_SRC (set) == reload_reg_rtx[j]
+ && SET_DEST (set) == reload_reg_rtx[s])
+ {
+ /* Usually the next instruction will be the
+ secondary reload insn; if we can confirm
+ that it is, setting new_spill_reg_store to
+ that insn will allow an extra optimization. */
+ rtx s_reg = reload_reg_rtx[s];
+ rtx next = NEXT_INSN (p);
+ reload_out[s] = reload_out[j];
+ set = single_set (next);
+ if (set && SET_SRC (set) == s_reg
+ && ! new_spill_reg_store[REGNO (s_reg)])
+ new_spill_reg_store[REGNO (s_reg)] = next;
+ }
+ else
+ new_spill_reg_store[reload_spill_index[j]] = p;
+ }
}
}
@@ -6848,18 +7072,18 @@ emit_reload_insns (insn)
reloads for the operand. The RELOAD_OTHER output reloads are
output in descending order by reload number. */
- emit_insns_before (other_input_address_reload_insns, before_insn);
- emit_insns_before (other_input_reload_insns, before_insn);
+ emit_insns_before (other_input_address_reload_insns, insn);
+ emit_insns_before (other_input_reload_insns, insn);
for (j = 0; j < reload_n_operands; j++)
{
- emit_insns_before (inpaddr_address_reload_insns[j], before_insn);
- emit_insns_before (input_address_reload_insns[j], before_insn);
- emit_insns_before (input_reload_insns[j], before_insn);
+ emit_insns_before (inpaddr_address_reload_insns[j], insn);
+ emit_insns_before (input_address_reload_insns[j], insn);
+ emit_insns_before (input_reload_insns[j], insn);
}
- emit_insns_before (other_operand_reload_insns, before_insn);
- emit_insns_before (operand_reload_insns, before_insn);
+ emit_insns_before (other_operand_reload_insns, insn);
+ emit_insns_before (operand_reload_insns, insn);
for (j = 0; j < reload_n_operands; j++)
{
@@ -6869,49 +7093,14 @@ emit_reload_insns (insn)
emit_insns_before (other_output_reload_insns[j], following_insn);
}
- /* Move death notes from INSN
- to output-operand-address and output reload insns. */
-#ifdef PRESERVE_DEATH_INFO_REGNO_P
- {
- rtx insn1;
- /* Loop over those insns, last ones first. */
- for (insn1 = PREV_INSN (following_insn); insn1 != insn;
- insn1 = PREV_INSN (insn1))
- if (GET_CODE (insn1) == INSN && GET_CODE (PATTERN (insn1)) == SET)
- {
- rtx source = SET_SRC (PATTERN (insn1));
- rtx dest = SET_DEST (PATTERN (insn1));
-
- /* The note we will examine next. */
- rtx reg_notes = REG_NOTES (insn);
- /* The place that pointed to this note. */
- rtx *prev_reg_note = &REG_NOTES (insn);
-
- /* If the note is for something used in the source of this
- reload insn, or in the output address, move the note. */
- while (reg_notes)
- {
- rtx next_reg_notes = XEXP (reg_notes, 1);
- if (REG_NOTE_KIND (reg_notes) == REG_DEAD
- && GET_CODE (XEXP (reg_notes, 0)) == REG
- && ((GET_CODE (dest) != REG
- && reg_overlap_mentioned_for_reload_p (XEXP (reg_notes, 0),
- dest))
- || reg_overlap_mentioned_for_reload_p (XEXP (reg_notes, 0),
- source)))
- {
- *prev_reg_note = next_reg_notes;
- XEXP (reg_notes, 1) = REG_NOTES (insn1);
- REG_NOTES (insn1) = reg_notes;
- }
- else
- prev_reg_note = &XEXP (reg_notes, 1);
-
- reg_notes = next_reg_notes;
- }
- }
- }
-#endif
+ /* Keep basic block info up to date. */
+ if (n_basic_blocks)
+ {
+ if (basic_block_head[bb] == insn)
+ basic_block_head[bb] = NEXT_INSN (before_insn);
+ if (basic_block_end[bb] == insn)
+ basic_block_end[bb] = PREV_INSN (following_insn);
+ }
/* For all the spill regs newly reloaded in this instruction,
record what they were reloaded from, so subsequent instructions
@@ -7233,13 +7422,19 @@ gen_reload (out, in, opnum, type)
its validity determination, i.e., the way it would after reload
has completed. */
if (constrain_operands (code, 1))
- return insn;
+ {
+ /* Add a REG_EQUIV note so that find_equiv_reg can find it. */
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_EQUIV, in, REG_NOTES (insn));
+ return insn;
+ }
}
delete_insns_since (last);
gen_reload (out, op1, opnum, type);
- emit_insn (gen_add2_insn (out, op0));
+ insn = emit_insn (gen_add2_insn (out, op0));
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUIV, in, REG_NOTES (insn));
}
#ifdef SECONDARY_MEMORY_NEEDED
@@ -7320,20 +7515,40 @@ delete_output_reload (insn, j, output_reload_insn)
return;
if ((GET_CODE (i1) == INSN || GET_CODE (i1) == CALL_INSN)
&& reg_mentioned_p (reg, PATTERN (i1)))
- return;
+ {
+ /* If this is just a single USE with an REG_EQUAL note in front
+ of INSN, this is no problem, because this mentions just the
+ address that we are using here.
+ But if there is more than one such USE, the insn might use
+ the operand directly, or another reload might do that.
+ This is analogous to the count_occurences check in the callers. */
+ int num_occurences = 0;
+
+ while (GET_CODE (i1) == INSN && GET_CODE (PATTERN (i1)) == USE
+ && find_reg_note (i1, REG_EQUAL, NULL_RTX))
+ {
+ num_occurences += rtx_equal_p (reg, XEXP (PATTERN (i1), 0)) != 0;
+ i1 = NEXT_INSN (i1);
+ }
+ if (num_occurences == 1 && i1 == insn)
+ break;
+ return;
+ }
}
- /* If this insn will store in the pseudo again,
- the previous store can be removed. */
- if (reload_out[j] == reload_in[j])
- delete_insn (output_reload_insn);
-
- /* See if the pseudo reg has been completely replaced
+ /* The caller has already checked that REG dies or is set in INSN.
+ It has also checked that we are optimizing, and thus some inaccurancies
+ in the debugging information are acceptable.
+ So we could just delete output_reload_insn.
+ But in some cases we can improve the debugging information without
+ sacrificing optimization - maybe even improving the code:
+ See if the pseudo reg has been completely replaced
with reload regs. If so, delete the store insn
and forget we had a stack slot for the pseudo. */
- else if (REG_N_DEATHS (REGNO (reg)) == 1
- && REG_BASIC_BLOCK (REGNO (reg)) >= 0
- && find_regno_note (insn, REG_DEAD, REGNO (reg)))
+ if (reload_out[j] != reload_in[j]
+ && REG_N_DEATHS (REGNO (reg)) == 1
+ && REG_BASIC_BLOCK (REGNO (reg)) >= 0
+ && find_regno_note (insn, REG_DEAD, REGNO (reg)))
{
rtx i2;
@@ -7355,9 +7570,12 @@ delete_output_reload (insn, j, output_reload_insn)
break;
if ((GET_CODE (i2) == INSN || GET_CODE (i2) == CALL_INSN)
&& reg_mentioned_p (reg, PATTERN (i2)))
- /* Some other ref remains;
- we can't do anything. */
- return;
+ {
+ /* Some other ref remains; just delete the output reload we
+ know to be dead. */
+ delete_insn (output_reload_insn);
+ return;
+ }
}
/* Delete the now-dead stores into this pseudo. */
@@ -7383,6 +7601,8 @@ delete_output_reload (insn, j, output_reload_insn)
reg_renumber[REGNO (reg)] = REGNO (reload_reg_rtx[j]);
alter_reg (REGNO (reg), -1);
}
+ delete_insn (output_reload_insn);
+
}
/* Output reload-insns to reload VALUE into RELOADREG.
@@ -7589,6 +7809,270 @@ count_occurrences (x, find)
return count;
}
+static HARD_REG_SET set_regs;
+static HARD_REG_SET used_regs;
+static HARD_REG_SET live_regs;
+
+/* Walk the rtx X recursively, calling WORKER for every sub-expression with
+ the type of access as parameter. */
+static void
+find_set_and_used_regs (x, read, written)
+ rtx x;
+ int read, written;
+{
+ enum rtx_code code;
+ const char *fmt;
+ int i, regno, nregs;
+
+ if (0 && x == 0)
+ return;
+
+ code = GET_CODE (x);
+ if (code == SUBREG)
+ {
+ x = SUBREG_REG (x);
+ code = GET_CODE (x);
+ }
+
+ switch (code)
+ {
+ case PC:
+ case CC0:
+ case SCRATCH:
+ case LABEL_REF:
+ case SYMBOL_REF:
+ return;
+
+ case REG:
+ regno = REGNO (x);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ return;
+ nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
+ while (nregs-- > 0)
+ {
+ if (written)
+ SET_HARD_REG_BIT (set_regs, regno + nregs);
+ if (read)
+ SET_HARD_REG_BIT (used_regs, regno + nregs);
+ }
+ return;
+
+ case ZERO_EXTRACT:
+ case SIGN_EXTRACT:
+ find_set_and_used_regs (XEXP (x, 0), read, written);
+ find_set_and_used_regs (XEXP (x, 1), 1, 0);
+ find_set_and_used_regs (XEXP (x, 2), 1, 0);
+ return;
+
+ case PRE_DEC:
+ case POST_DEC:
+ case PRE_INC:
+ case POST_INC:
+ find_set_and_used_regs (XEXP (x, 0), 1, 1);
+ return;
+
+ case SET:
+ find_set_and_used_regs (SET_SRC (x), 1, 0);
+
+ /* fall through */
+ case CLOBBER:
+ find_set_and_used_regs (SET_DEST (x), 0, 1);
+ return;
+
+ default:
+ break;
+ }
+
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ find_set_and_used_regs (XEXP (x, i), 1, 0);
+ else if (fmt[i] == 'E')
+ {
+ int j;
+
+ for (j = 0; j < XVECLEN (x, i); j++)
+ find_set_and_used_regs (XVECEXP (x, i, j), 1, 0);
+ }
+ }
+}
+
+static void
+calc_reg_usage (insn, make_notes)
+ rtx insn;
+ int make_notes;
+{
+ int i;
+
+ CLEAR_HARD_REG_SET (set_regs);
+ CLEAR_HARD_REG_SET (used_regs);
+ find_set_and_used_regs (PATTERN (insn), 0, 0);
+
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ rtx x;
+ for (x = CALL_INSN_FUNCTION_USAGE (insn); x != 0; x = XEXP (x, 1))
+ find_set_and_used_regs (XEXP (x, 0), 0, 0);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (call_used_regs[i] && ! fixed_regs[i] && ! global_regs[i])
+ SET_HARD_REG_BIT (set_regs, i);
+ }
+
+ if (! make_notes)
+ return;
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ if (TEST_HARD_REG_BIT (live_regs, i))
+ continue;
+ if (TEST_HARD_REG_BIT (set_regs, i))
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_UNUSED,
+ gen_rtx_REG (reg_raw_mode[i], i),
+ REG_NOTES (insn));
+ else if (TEST_HARD_REG_BIT (used_regs, i))
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD,
+ gen_rtx_REG (reg_raw_mode[i], i),
+ REG_NOTES (insn));
+ }
+ AND_COMPL_HARD_REG_SET (live_regs, set_regs);
+ IOR_HARD_REG_SET (live_regs, used_regs);
+}
+
+/* Now that all pseudo registers have been eliminated, calculate hard register
+ life information. */
+void
+reload_life_analysis (first)
+ rtx first;
+{
+ rtx insn, last;
+ int b;
+ int_list_ptr *s_preds, *s_succs;
+ int *num_preds, *num_succs;
+ HARD_REG_SET *block_sets;
+ HARD_REG_SET *block_uses;
+ HARD_REG_SET *live_at_start;
+ HARD_REG_SET *live_at_end;
+ int outside_block = 1;
+
+ s_preds = (int_list_ptr *) xmalloc (n_basic_blocks * sizeof (int_list_ptr));
+ s_succs = (int_list_ptr *) xmalloc (n_basic_blocks * sizeof (int_list_ptr));
+ num_preds = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ num_succs = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ block_sets = (HARD_REG_SET *) xmalloc (n_basic_blocks * sizeof (HARD_REG_SET));
+ block_uses = (HARD_REG_SET *) xmalloc (n_basic_blocks * sizeof (HARD_REG_SET));
+ live_at_start = (HARD_REG_SET *) xmalloc (n_basic_blocks * sizeof (HARD_REG_SET));
+ live_at_end = (HARD_REG_SET *) xmalloc (n_basic_blocks * sizeof (HARD_REG_SET));
+
+ bzero (block_sets, n_basic_blocks * sizeof (HARD_REG_SET));
+ bzero (block_uses, n_basic_blocks * sizeof (HARD_REG_SET));
+ bzero (live_at_start, n_basic_blocks * sizeof (HARD_REG_SET));
+ bzero (live_at_end, n_basic_blocks * sizeof (HARD_REG_SET));
+
+ compute_preds_succs (s_preds, s_succs, num_preds, num_succs);
+
+ b = n_basic_blocks;
+ for (last = first; NEXT_INSN (last); last = NEXT_INSN (last))
+ ;
+ for (insn = last; insn; insn = PREV_INSN (insn))
+ {
+ enum rtx_code code = GET_CODE (insn);
+
+ /* Start with fresh live info at the end of every basic block. */
+ if (b > 0 && basic_block_end[b - 1] == insn)
+ {
+ outside_block = 0;
+ b--;
+ }
+ if (GET_RTX_CLASS (code) == 'i' && outside_block)
+ abort ();
+
+ /* Clobbers are inserted during rtl expansion to show flow.c that some
+ values die when that is non-obvious. Once all pseudos are converted
+ tohard regs, that information is no longer needed, and can in fact
+ be incorrect. */
+ if (GET_RTX_CLASS (code) == 'i' && GET_CODE (PATTERN (insn)) == CLOBBER)
+ {
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ code = NOTE;
+ }
+ if (GET_RTX_CLASS (code) == 'i')
+ {
+ calc_reg_usage (insn, 0);
+
+ IOR_HARD_REG_SET (block_sets[b], set_regs);
+ AND_COMPL_HARD_REG_SET (block_sets[b], used_regs);
+
+ AND_COMPL_HARD_REG_SET (block_uses[b], set_regs);
+ IOR_HARD_REG_SET (block_uses[b], used_regs);
+ }
+
+ if (insn == basic_block_head[b])
+ {
+ outside_block = 1;
+ }
+ }
+ for (;;)
+ {
+ int something_changed = 0;
+
+ for (b = n_basic_blocks - 1; b >= 0; b--)
+ {
+ int_list_ptr psucc;
+ HARD_REG_SET tmp;
+
+ CLEAR_HARD_REG_SET (live_at_end[b]);
+ for (psucc = s_succs[b]; psucc; psucc = psucc->next)
+ IOR_HARD_REG_SET (live_at_end[b],
+ live_at_start[INT_LIST_VAL (psucc)]);
+ COPY_HARD_REG_SET (tmp, live_at_end[b]);
+ AND_COMPL_HARD_REG_SET (tmp, block_sets[b]);
+ IOR_HARD_REG_SET (tmp, block_uses[b]);
+ GO_IF_HARD_REG_EQUAL (tmp, live_at_start[b], win);
+ COPY_HARD_REG_SET (live_at_start[b], tmp);
+ something_changed = 1;
+
+ win:
+ ;
+ }
+ if (! something_changed)
+ break;
+ }
+ for (b = 0; b < n_basic_blocks; b++)
+ {
+ int i;
+ CLEAR_REG_SET (basic_block_live_at_start[b]);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (TEST_HARD_REG_BIT (live_at_start[b], i))
+ SET_REGNO_REG_SET (basic_block_live_at_start[b], i);
+ }
+ for (insn = last; insn; insn = PREV_INSN (insn))
+ {
+ enum rtx_code code = GET_CODE (insn);
+
+ /* Start with fresh live info at the end of every basic block. */
+ if (b > 0 && basic_block_end[b - 1] == insn)
+ {
+ b--;
+ COPY_HARD_REG_SET (live_regs, live_at_end[b]);
+ }
+
+ if (GET_RTX_CLASS (code) == 'i')
+ calc_reg_usage (insn, 1);
+ }
+
+ free (s_preds);
+ free (s_succs);
+ free (num_preds);
+ free (num_succs);
+ free (block_sets);
+ free (block_uses);
+ free (live_at_end);
+ free (live_at_start);
+}
+
/* This array holds values which are equivalent to a hard register
during reload_cse_regs. Each array element is an EXPR_LIST of
values. Each time a hard register is set, we set the corresponding
@@ -7611,13 +8095,6 @@ static rtx *reg_values;
static rtx invalidate_regno_rtx;
-/* This is a set of registers for which we must remove REG_DEAD notes in
- previous insns, because our modifications made them invalid. That can
- happen if we introduced the register into the current insn, or we deleted
- the current insn which used to set the register. */
-
-static HARD_REG_SET no_longer_dead_regs;
-
/* Invalidate any entries in reg_values which depend on REGNO,
including those for REGNO itself. This is called if REGNO is
changing. If CLOBBER is true, then always forget anything we
@@ -7806,7 +8283,7 @@ reload_cse_invalidate_mem (mem_rtx)
static void
reload_cse_invalidate_rtx (dest, ignore)
rtx dest;
- rtx ignore;
+ rtx ignore ATTRIBUTE_UNUSED;
{
while (GET_CODE (dest) == STRICT_LOW_PART
|| GET_CODE (dest) == SIGN_EXTRACT
@@ -7820,55 +8297,6 @@ reload_cse_invalidate_rtx (dest, ignore)
reload_cse_invalidate_mem (dest);
}
-/* Possibly delete death notes on the insns before INSN if modifying INSN
- extended the lifespan of the registers. */
-
-static void
-reload_cse_delete_death_notes (insn)
- rtx insn;
-{
- int dreg;
-
- for (dreg = 0; dreg < FIRST_PSEUDO_REGISTER; dreg++)
- {
- rtx trial;
-
- if (! TEST_HARD_REG_BIT (no_longer_dead_regs, dreg))
- continue;
-
- for (trial = prev_nonnote_insn (insn);
- (trial
- && GET_CODE (trial) != CODE_LABEL
- && GET_CODE (trial) != BARRIER);
- trial = prev_nonnote_insn (trial))
- {
- if (find_regno_note (trial, REG_DEAD, dreg))
- {
- remove_death (dreg, trial);
- break;
- }
- }
- }
-}
-
-/* Record that the current insn uses hard reg REGNO in mode MODE. This
- will be used in reload_cse_delete_death_notes to delete prior REG_DEAD
- notes for this register. */
-
-static void
-reload_cse_no_longer_dead (regno, mode)
- int regno;
- enum machine_mode mode;
-{
- int nregs = HARD_REGNO_NREGS (regno, mode);
- while (nregs-- > 0)
- {
- SET_HARD_REG_BIT (no_longer_dead_regs, regno);
- regno++;
- }
-}
-
-
/* Do a very simple CSE pass over the hard registers.
This function detects no-op moves where we happened to assign two
@@ -7886,8 +8314,8 @@ reload_cse_no_longer_dead (regno, mode)
hard register. It then replaces the operand with the hard register
if possible, much like an optional reload would. */
-void
-reload_cse_regs (first)
+static void
+reload_cse_regs_1 (first)
rtx first;
{
char *firstobj;
@@ -7898,8 +8326,7 @@ reload_cse_regs (first)
init_alias_analysis ();
reg_values = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- reg_values[i] = 0;
+ bzero ((char *)reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
/* Create our EXPR_LIST structures on reload_obstack, so that we can
free them when we are done. */
@@ -7942,8 +8369,6 @@ reload_cse_regs (first)
if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
continue;
- CLEAR_HARD_REG_SET (no_longer_dead_regs);
-
/* If this is a call instruction, forget anything stored in a
call clobbered register, or, if this is not a const call, in
memory. */
@@ -7963,58 +8388,96 @@ reload_cse_regs (first)
int count = 0;
if (reload_cse_noop_set_p (body, insn))
{
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
- reload_cse_delete_death_notes (insn);
+ /* If this sets the return value of the function, we must keep
+ a USE around, in case this is in a different basic block
+ than the final USE. Otherwise, we could loose important
+ register lifeness information on SMALL_REGISTER_CLASSES
+ machines, where return registers might be used as spills:
+ subsequent passes assume that spill registers are dead at
+ the end of a basic block. */
+ if (REG_FUNCTION_VALUE_P (SET_DEST (body)))
+ {
+ pop_obstacks ();
+ PATTERN (insn) = gen_rtx_USE (VOIDmode, SET_DEST (body));
+ INSN_CODE (insn) = -1;
+ REG_NOTES (insn) = NULL_RTX;
+ push_obstacks (&reload_obstack, &reload_obstack);
+ }
+ else
+ {
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ }
/* We're done with this insn. */
continue;
}
/* It's not a no-op, but we can try to simplify it. */
- CLEAR_HARD_REG_SET (no_longer_dead_regs);
count += reload_cse_simplify_set (body, insn);
- if (count > 0 && apply_change_group ())
- reload_cse_delete_death_notes (insn);
- else if (reload_cse_simplify_operands (insn))
- reload_cse_delete_death_notes (insn);
+ if (count > 0)
+ apply_change_group ();
+ else
+ reload_cse_simplify_operands (insn);
reload_cse_record_set (body, body);
}
else if (GET_CODE (body) == PARALLEL)
{
int count = 0;
+ rtx value = NULL_RTX;
/* If every action in a PARALLEL is a noop, we can delete
the entire PARALLEL. */
for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
- if ((GET_CODE (XVECEXP (body, 0, i)) != SET
- || ! reload_cse_noop_set_p (XVECEXP (body, 0, i), insn))
- && GET_CODE (XVECEXP (body, 0, i)) != CLOBBER)
- break;
+ {
+ rtx part = XVECEXP (body, 0, i);
+ if (GET_CODE (part) == SET)
+ {
+ if (! reload_cse_noop_set_p (part, insn))
+ break;
+ if (REG_FUNCTION_VALUE_P (SET_DEST (part)))
+ {
+ if (value)
+ break;
+ value = SET_DEST (part);
+ }
+ }
+ else if (GET_CODE (part) != CLOBBER)
+ break;
+ }
if (i < 0)
{
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
- reload_cse_delete_death_notes (insn);
+ if (value)
+ {
+ pop_obstacks ();
+ PATTERN (insn) = gen_rtx_USE (VOIDmode, value);
+ INSN_CODE (insn) = -1;
+ REG_NOTES (insn) = NULL_RTX;
+ push_obstacks (&reload_obstack, &reload_obstack);
+ }
+ else
+ {
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ }
/* We're done with this insn. */
continue;
}
/* It's not a no-op, but we can try to simplify it. */
- CLEAR_HARD_REG_SET (no_longer_dead_regs);
for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
if (GET_CODE (XVECEXP (body, 0, i)) == SET)
count += reload_cse_simplify_set (XVECEXP (body, 0, i), insn);
- if (count > 0 && apply_change_group ())
- reload_cse_delete_death_notes (insn);
- else if (reload_cse_simplify_operands (insn))
- reload_cse_delete_death_notes (insn);
+ if (count > 0)
+ apply_change_group ();
+ else
+ reload_cse_simplify_operands (insn);
/* Look through the PARALLEL and record the values being
set, if possible. Also handle any CLOBBERs. */
@@ -8062,6 +8525,19 @@ reload_cse_regs (first)
pop_obstacks ();
}
+/* Call cse / combine like post-reload optimization phases.
+ FIRST is the first instruction. */
+void
+reload_cse_regs (first)
+ rtx first;
+{
+ reload_cse_regs_1 (first);
+ reload_combine ();
+ reload_cse_move2add (first);
+ if (flag_expensive_optimizations)
+ reload_cse_regs_1 (first);
+}
+
/* Return whether the values known for REGNO are equal to VAL. MODE
is the mode of the object that VAL is being copied to; this matters
if VAL is a CONST_INT. */
@@ -8080,6 +8556,8 @@ reload_cse_regno_equal_p (regno, val, mode)
for (x = reg_values[regno]; x; x = XEXP (x, 1))
if (XEXP (x, 0) != 0
&& rtx_equal_p (XEXP (x, 0), val)
+ && (! flag_float_store || GET_CODE (XEXP (x, 0)) != MEM
+ || GET_MODE_CLASS (GET_MODE (x)) != MODE_FLOAT)
&& (GET_CODE (val) != CONST_INT
|| mode == GET_MODE (x)
|| (GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (x))
@@ -8178,14 +8656,6 @@ reload_cse_noop_set_p (set, insn)
ret = 1;
}
- /* If we can delete this SET, then we need to look for an earlier
- REG_DEAD note on DREG, and remove it if it exists. */
- if (ret && dreg >= 0)
- {
- if (! find_regno_note (insn, REG_UNUSED, dreg))
- reload_cse_no_longer_dead (dreg, dest_mode);
- }
-
return ret;
}
@@ -8216,12 +8686,16 @@ reload_cse_simplify_set (set, insn)
dclass = REGNO_REG_CLASS (dreg);
- /* If memory loads are cheaper than register copies, don't change
- them. */
+ /* If memory loads are cheaper than register copies, don't change them. */
if (GET_CODE (src) == MEM
&& MEMORY_MOVE_COST (GET_MODE (src), dclass, 1) < 2)
return 0;
+ /* If the constant is cheaper than a register, don't change it. */
+ if (CONSTANT_P (src)
+ && rtx_cost (src, SET) < 2)
+ return 0;
+
dest_mode = GET_MODE (SET_DEST (set));
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
@@ -8241,11 +8715,8 @@ reload_cse_simplify_set (set, insn)
storage. */
push_obstacks (&reload_obstack, &reload_obstack);
- if (validated && ! find_regno_note (insn, REG_UNUSED, i))
- {
- reload_cse_no_longer_dead (i, dest_mode);
- return 1;
- }
+ if (validated)
+ return 1;
}
}
return 0;
@@ -8283,6 +8754,7 @@ reload_cse_simplify_operands (insn)
int *op_alt_regno[MAX_RECOG_OPERANDS];
/* Array of alternatives, sorted in order of decreasing desirability. */
int *alternative_order;
+ rtx reg = gen_rtx_REG (VOIDmode, -1);
/* Find out some information about this insn. */
insn_code_number = recog_memoized (insn);
@@ -8299,7 +8771,7 @@ reload_cse_simplify_operands (insn)
/* Figure out which alternative currently matches. */
if (! constrain_operands (insn_code_number, 1))
- abort ();
+ fatal_insn_not_found (insn);
alternative_reject = (int *) alloca (n_alternatives * sizeof (int));
alternative_nregs = (int *) alloca (n_alternatives * sizeof (int));
@@ -8349,6 +8821,9 @@ reload_cse_simplify_operands (insn)
if (! reload_cse_regno_equal_p (regno, recog_operand[i], mode))
continue;
+ REGNO (reg) = regno;
+ PUT_MODE (reg, mode);
+
/* We found a register equal to this operand. Now look for all
alternatives that can accept this register and have not been
assigned a register they can use yet. */
@@ -8388,10 +8863,12 @@ reload_cse_simplify_operands (insn)
case ',': case '\0':
/* See if REGNO fits this alternative, and set it up as the
replacement register if we don't have one for this
- alternative yet. */
+ alternative yet and the operand being replaced is not
+ a cheap CONST_INT. */
if (op_alt_regno[i][j] == -1
- && reg_fits_class_p (gen_rtx_REG (mode, regno), class,
- 0, mode))
+ && reg_fits_class_p (reg, class, 0, mode)
+ && (GET_CODE (recog_operand[i]) != CONST_INT
+ || rtx_cost (recog_operand[i], SET) > rtx_cost (reg, SET)))
{
alternative_nregs[j]++;
op_alt_regno[i][j] = regno;
@@ -8444,7 +8921,6 @@ reload_cse_simplify_operands (insn)
/* Substitute the operands as determined by op_alt_regno for the best
alternative. */
j = alternative_order[0];
- CLEAR_HARD_REG_SET (no_longer_dead_regs);
/* Pop back to the real obstacks while changing the insn. */
pop_obstacks ();
@@ -8455,7 +8931,6 @@ reload_cse_simplify_operands (insn)
if (op_alt_regno[i][j] == -1)
continue;
- reload_cse_no_longer_dead (op_alt_regno[i][j], mode);
validate_change (insn, recog_operand_loc[i],
gen_rtx_REG (mode, op_alt_regno[i][j]), 1);
}
@@ -8468,7 +8943,6 @@ reload_cse_simplify_operands (insn)
if (op_alt_regno[op][j] == -1)
continue;
- reload_cse_no_longer_dead (op_alt_regno[op][j], mode);
validate_change (insn, recog_dup_loc[i],
gen_rtx_REG (mode, op_alt_regno[op][j]), 1);
}
@@ -8496,7 +8970,7 @@ static rtx reload_cse_check_src;
static void
reload_cse_check_clobber (dest, ignore)
rtx dest;
- rtx ignore;
+ rtx ignore ATTRIBUTE_UNUSED;
{
if (reg_overlap_mentioned_p (dest, reload_cse_check_src))
reload_cse_check_clobbered = 1;
@@ -8647,3 +9121,648 @@ reload_cse_record_set (set, body)
abort ();
}
}
+
+/* If reload couldn't use reg+reg+offset addressing, try to use reg+reg
+ addressing now.
+ This code might also be useful when reload gave up on reg+reg addresssing
+ because of clashes between the return register and INDEX_REG_CLASS. */
+
+/* The maximum number of uses of a register we can keep track of to
+ replace them with reg+reg addressing. */
+#define RELOAD_COMBINE_MAX_USES 6
+
+/* INSN is the insn where a register has ben used, and USEP points to the
+ location of the register within the rtl. */
+struct reg_use { rtx insn, *usep; };
+
+/* If the register is used in some unknown fashion, USE_INDEX is negative.
+ If it is dead, USE_INDEX is RELOAD_COMBINE_MAX_USES, and STORE_RUID
+ indicates where it becomes live again.
+ Otherwise, USE_INDEX is the index of the last encountered use of the
+ register (which is first among these we have seen since we scan backwards),
+ OFFSET contains the constant offset that is added to the register in
+ all encountered uses, and USE_RUID indicates the first encountered, i.e.
+ last, of these uses. */
+static struct
+ {
+ struct reg_use reg_use[RELOAD_COMBINE_MAX_USES];
+ int use_index;
+ rtx offset;
+ int store_ruid;
+ int use_ruid;
+ } reg_state[FIRST_PSEUDO_REGISTER];
+
+/* Reverse linear uid. This is increased in reload_combine while scanning
+ the instructions from last to first. It is used to set last_label_ruid
+ and the store_ruid / use_ruid fields in reg_state. */
+static int reload_combine_ruid;
+
+static void
+reload_combine ()
+{
+ rtx insn, set;
+ int first_index_reg = 1, last_index_reg = 0;
+ int i;
+ int last_label_ruid;
+
+ /* If reg+reg can be used in offsetable memory adresses, the main chunk of
+ reload has already used it where appropriate, so there is no use in
+ trying to generate it now. */
+ if (double_reg_address_ok && reload_address_index_reg_class != NO_REGS)
+ return;
+
+ /* To avoid wasting too much time later searching for an index register,
+ determine the minimum and maximum index register numbers. */
+ for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; --i)
+ {
+ if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], i))
+ {
+ if (! last_index_reg)
+ last_index_reg = i;
+ first_index_reg = i;
+ }
+ }
+ /* If no index register is available, we can quit now. */
+ if (first_index_reg > last_index_reg)
+ return;
+
+ /* Initialize last_label_ruid, reload_combine_ruid and reg_state. */
+ last_label_ruid = reload_combine_ruid = 0;
+ for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; --i)
+ {
+ if (fixed_regs[i])
+ reg_state[i].use_index = -1;
+ else
+ {
+ reg_state[i].use_index = RELOAD_COMBINE_MAX_USES;
+ reg_state[i].store_ruid = reload_combine_ruid;
+ }
+ }
+
+ for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
+ {
+ rtx note;
+
+ /* We cannot do our optimization across labels. Invalidating all the use
+ information we have would be costly, so we just note where the label
+ is and then later disable any optimization that would cross it. */
+ if (GET_CODE (insn) == CODE_LABEL)
+ last_label_ruid = reload_combine_ruid;
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ continue;
+ reload_combine_ruid++;
+
+ /* Look for (set (REGX) (CONST_INT))
+ (set (REGX) (PLUS (REGX) (REGY)))
+ ...
+ ... (MEM (REGX)) ...
+ and convert it to
+ (set (REGZ) (CONST_INT))
+ ...
+ ... (MEM (PLUS (REGZ) (REGY)))... .
+
+ First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
+ and that we know all uses of REGX before it dies. */
+ set = single_set (insn);
+ if (set != NULL_RTX
+ && GET_CODE (SET_DEST (set)) == REG
+ && (HARD_REGNO_NREGS (REGNO (SET_DEST (set)),
+ GET_MODE (SET_DEST (set)))
+ == 1)
+ && GET_CODE (SET_SRC (set)) == PLUS
+ && GET_CODE (XEXP (SET_SRC (set), 1)) == REG
+ && rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set))
+ && last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid)
+ {
+ rtx reg = SET_DEST (set);
+ rtx plus = SET_SRC (set);
+ rtx base = XEXP (plus, 1);
+ rtx prev = prev_nonnote_insn (insn);
+ rtx prev_set = prev ? single_set (prev) : NULL_RTX;
+ int regno = REGNO (reg);
+ rtx const_reg;
+ rtx reg_sum = NULL_RTX;
+
+ /* Now, we need an index register.
+ We'll set index_reg to this index register, const_reg to the
+ register that is to be loaded with the constant
+ (denoted as REGZ in the substitution illustration above),
+ and reg_sum to the register-register that we want to use to
+ substitute uses of REG (typically in MEMs) with.
+ First check REG and BASE for being index registers;
+ we can use them even if they are not dead. */
+ if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], regno)
+ || TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
+ REGNO (base)))
+ {
+ const_reg = reg;
+ reg_sum = plus;
+ }
+ else
+ {
+ /* Otherwise, look for a free index register. Since we have
+ checked above that neiter REG nor BASE are index registers,
+ if we find anything at all, it will be different from these
+ two registers. */
+ for (i = first_index_reg; i <= last_index_reg; i++)
+ {
+ if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], i)
+ && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES
+ && reg_state[i].store_ruid <= reg_state[regno].use_ruid
+ && HARD_REGNO_NREGS (i, GET_MODE (reg)) == 1)
+ {
+ rtx index_reg = gen_rtx_REG (GET_MODE (reg), i);
+ const_reg = index_reg;
+ reg_sum = gen_rtx_PLUS (GET_MODE (reg), index_reg, base);
+ break;
+ }
+ }
+ }
+ if (prev_set
+ && GET_CODE (SET_SRC (prev_set)) == CONST_INT
+ && rtx_equal_p (SET_DEST (prev_set), reg)
+ && reg_state[regno].use_index >= 0
+ && reg_sum)
+ {
+ int i;
+
+ /* Change destination register and - if necessary - the
+ constant value in PREV, the constant loading instruction. */
+ validate_change (prev, &SET_DEST (prev_set), const_reg, 1);
+ if (reg_state[regno].offset != const0_rtx)
+ validate_change (prev,
+ &SET_SRC (prev_set),
+ GEN_INT (INTVAL (SET_SRC (prev_set))
+ + INTVAL (reg_state[regno].offset)),
+ 1);
+ /* Now for every use of REG that we have recorded, replace REG
+ with REG_SUM. */
+ for (i = reg_state[regno].use_index;
+ i < RELOAD_COMBINE_MAX_USES; i++)
+ validate_change (reg_state[regno].reg_use[i].insn,
+ reg_state[regno].reg_use[i].usep,
+ reg_sum, 1);
+
+ if (apply_change_group ())
+ {
+ rtx *np;
+
+ /* Delete the reg-reg addition. */
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+
+ if (reg_state[regno].offset != const0_rtx)
+ {
+ /* Previous REG_EQUIV / REG_EQUAL notes for PREV
+ are now invalid. */
+ for (np = &REG_NOTES (prev); *np; )
+ {
+ if (REG_NOTE_KIND (*np) == REG_EQUAL
+ || REG_NOTE_KIND (*np) == REG_EQUIV)
+ *np = XEXP (*np, 1);
+ else
+ np = &XEXP (*np, 1);
+ }
+ }
+ reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES;
+ reg_state[REGNO (const_reg)].store_ruid = reload_combine_ruid;
+ continue;
+ }
+ }
+ }
+ note_stores (PATTERN (insn), reload_combine_note_store);
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ rtx link;
+
+ for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; --i)
+ {
+ if (call_used_regs[i])
+ {
+ reg_state[i].use_index = RELOAD_COMBINE_MAX_USES;
+ reg_state[i].store_ruid = reload_combine_ruid;
+ }
+ }
+ for (link = CALL_INSN_FUNCTION_USAGE (insn); link;
+ link = XEXP (link, 1))
+ {
+ rtx use = XEXP (link, 0);
+ int regno = REGNO (XEXP (use, 0));
+ if (GET_CODE (use) == CLOBBER)
+ {
+ reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES;
+ reg_state[regno].store_ruid = reload_combine_ruid;
+ }
+ else
+ reg_state[regno].use_index = -1;
+ }
+ }
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ /* Non-spill registers might be used at the call destination in
+ some unknown fashion, so we have to mark the unknown use. */
+ for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; --i)
+ {
+ if (! TEST_HARD_REG_BIT (used_spill_regs, i))
+ reg_state[i].use_index = -1;
+ }
+ }
+ reload_combine_note_use (&PATTERN (insn), insn);
+ for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
+ {
+ if (REG_NOTE_KIND (note) == REG_INC
+ && GET_CODE (XEXP (note, 0)) == REG)
+ reg_state[REGNO (XEXP (note, 0))].use_index = -1;
+ }
+ }
+}
+
+/* Check if DST is a register or a subreg of a register; if it is,
+ update reg_state[regno].store_ruid and reg_state[regno].use_index
+ accordingly. Called via note_stores from reload_combine.
+ The second argument, SET, is ignored. */
+static void
+reload_combine_note_store (dst, set)
+ rtx dst, set;
+{
+ int regno = 0;
+ int i;
+ unsigned size = GET_MODE_SIZE (GET_MODE (dst));
+
+ if (GET_CODE (dst) == SUBREG)
+ {
+ regno = SUBREG_WORD (dst);
+ dst = SUBREG_REG (dst);
+ }
+ if (GET_CODE (dst) != REG)
+ return;
+ regno += REGNO (dst);
+ /* note_stores might have stripped a STRICT_LOW_PART, so we have to be
+ careful with registers / register parts that are not full words. */
+ if (size < UNITS_PER_WORD)
+ reg_state[regno].use_index = -1;
+ else
+ {
+ for (i = size / UNITS_PER_WORD - 1 + regno; i >= regno; i--)
+ {
+ reg_state[i].store_ruid = reload_combine_ruid;
+ reg_state[i].use_index = RELOAD_COMBINE_MAX_USES;
+ }
+ }
+}
+
+/* XP points to a piece of rtl that has to be checked for any uses of
+ registers.
+ *XP is the pattern of INSN, or a part of it.
+ Called from reload_combine, and recursively by itself. */
+static void
+reload_combine_note_use (xp, insn)
+ rtx *xp, insn;
+{
+ rtx x = *xp;
+ enum rtx_code code = x->code;
+ char *fmt;
+ int i, j;
+ rtx offset = const0_rtx; /* For the REG case below. */
+
+ switch (code)
+ {
+ case SET:
+ if (GET_CODE (SET_DEST (x)) == REG)
+ {
+ reload_combine_note_use (&SET_SRC (x), insn);
+ return;
+ }
+ break;
+
+ case CLOBBER:
+ if (GET_CODE (SET_DEST (x)) == REG)
+ return;
+ break;
+
+ case PLUS:
+ /* We are interested in (plus (reg) (const_int)) . */
+ if (GET_CODE (XEXP (x, 0)) != REG || GET_CODE (XEXP (x, 1)) != CONST_INT)
+ break;
+ offset = XEXP (x, 1);
+ x = XEXP (x, 0);
+ /* Fall through. */
+ case REG:
+ {
+ int regno = REGNO (x);
+ int use_index;
+
+ /* Some spurious USEs of pseudo registers might remain.
+ Just ignore them. */
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ return;
+
+ /* If this register is already used in some unknown fashion, we
+ can't do anything.
+ If we decrement the index from zero to -1, we can't store more
+ uses, so this register becomes used in an unknown fashion. */
+ use_index = --reg_state[regno].use_index;
+ if (use_index < 0)
+ return;
+
+ if (use_index != RELOAD_COMBINE_MAX_USES - 1)
+ {
+ /* We have found another use for a register that is already
+ used later. Check if the offsets match; if not, mark the
+ register as used in an unknown fashion. */
+ if (! rtx_equal_p (offset, reg_state[regno].offset))
+ {
+ reg_state[regno].use_index = -1;
+ return;
+ }
+ }
+ else
+ {
+ /* This is the first use of this register we have seen since we
+ marked it as dead. */
+ reg_state[regno].offset = offset;
+ reg_state[regno].use_ruid = reload_combine_ruid;
+ }
+ reg_state[regno].reg_use[use_index].insn = insn;
+ reg_state[regno].reg_use[use_index].usep = xp;
+ return;
+ }
+
+ default:
+ break;
+ }
+
+ /* Recursively process the components of X. */
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ reload_combine_note_use (&XEXP (x, i), insn);
+ else if (fmt[i] == 'E')
+ {
+ for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+ reload_combine_note_use (&XVECEXP (x, i, j), insn);
+ }
+ }
+}
+
+/* See if we can reduce the cost of a constant by replacing a move with
+ an add. */
+/* We cannot do our optimization across labels. Invalidating all the
+ information about register contents we have would be costly, so we
+ use last_label_luid (local variable of reload_cse_move2add) to note
+ where the label is and then later disable any optimization that would
+ cross it.
+ reg_offset[n] / reg_base_reg[n] / reg_mode[n] are only valid if
+ reg_set_luid[n] is larger than last_label_luid[n] . */
+static int reg_set_luid[FIRST_PSEUDO_REGISTER];
+/* reg_offset[n] has to be CONST_INT for it and reg_base_reg[n] /
+ reg_mode[n] to be valid.
+ If reg_offset[n] is a CONST_INT and reg_base_reg[n] is negative, register n
+ has been set to reg_offset[n] in mode reg_mode[n] .
+ If reg_offset[n] is a CONST_INT and reg_base_reg[n] is non-negative,
+ register n has been set to the sum of reg_offset[n] and register
+ reg_base_reg[n], calculated in mode reg_mode[n] . */
+static rtx reg_offset[FIRST_PSEUDO_REGISTER];
+static int reg_base_reg[FIRST_PSEUDO_REGISTER];
+static enum machine_mode reg_mode[FIRST_PSEUDO_REGISTER];
+/* move2add_luid is linearily increased while scanning the instructions
+ from first to last. It is used to set reg_set_luid in
+ reload_cse_move2add and move2add_note_store. */
+static int move2add_luid;
+
+static void
+reload_cse_move2add (first)
+ rtx first;
+{
+ int i;
+ rtx insn;
+ int last_label_luid;
+
+ for (i = FIRST_PSEUDO_REGISTER-1; i >= 0; i--)
+ reg_set_luid[i] = 0;
+
+ last_label_luid = 0;
+ move2add_luid = 1;
+ for (insn = first; insn; insn = NEXT_INSN (insn), move2add_luid++)
+ {
+ rtx pat, note;
+
+ if (GET_CODE (insn) == CODE_LABEL)
+ last_label_luid = move2add_luid;
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ continue;
+ pat = PATTERN (insn);
+ /* For simplicity, we only perform this optimization on
+ straightforward SETs. */
+ if (GET_CODE (pat) == SET
+ && GET_CODE (SET_DEST (pat)) == REG)
+ {
+ rtx reg = SET_DEST (pat);
+ int regno = REGNO (reg);
+ rtx src = SET_SRC (pat);
+
+ /* Check if we have valid information on the contents of this
+ register in the mode of REG. */
+ /* ??? We don't know how zero / sign extension is handled, hence
+ we can't go from a narrower to a wider mode. */
+ if (reg_set_luid[regno] > last_label_luid
+ && (GET_MODE_SIZE (GET_MODE (reg))
+ <= GET_MODE_SIZE (reg_mode[regno]))
+ && GET_CODE (reg_offset[regno]) == CONST_INT)
+ {
+ /* Try to transform (set (REGX) (CONST_INT A))
+ ...
+ (set (REGX) (CONST_INT B))
+ to
+ (set (REGX) (CONST_INT A))
+ ...
+ (set (REGX) (plus (REGX) (CONST_INT B-A))) */
+
+ if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0)
+ {
+ int success = 0;
+ rtx new_src = GEN_INT (INTVAL (src)
+ - INTVAL (reg_offset[regno]));
+ /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
+ 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
+ no-op moves. */
+ if (new_src == const0_rtx)
+ success = validate_change (insn, &SET_SRC (pat), reg, 0);
+ else if (rtx_cost (new_src, PLUS) < rtx_cost (src, SET)
+ && have_add2_insn (GET_MODE (reg)))
+ success = validate_change (insn, &PATTERN (insn),
+ gen_add2_insn (reg, new_src), 0);
+ reg_set_luid[regno] = move2add_luid;
+ reg_mode[regno] = GET_MODE (reg);
+ reg_offset[regno] = src;
+ continue;
+ }
+
+ /* Try to transform (set (REGX) (REGY))
+ (set (REGX) (PLUS (REGX) (CONST_INT A)))
+ ...
+ (set (REGX) (REGY))
+ (set (REGX) (PLUS (REGX) (CONST_INT B)))
+ to
+ (REGX) (REGY))
+ (set (REGX) (PLUS (REGX) (CONST_INT A)))
+ ...
+ (set (REGX) (plus (REGX) (CONST_INT B-A))) */
+ else if (GET_CODE (src) == REG
+ && reg_base_reg[regno] == REGNO (src)
+ && reg_set_luid[regno] > reg_set_luid[REGNO (src)])
+ {
+ rtx next = next_nonnote_insn (insn);
+ rtx set;
+ if (next)
+ set = single_set (next);
+ if (next
+ && set
+ && SET_DEST (set) == reg
+ && GET_CODE (SET_SRC (set)) == PLUS
+ && XEXP (SET_SRC (set), 0) == reg
+ && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT)
+ {
+ rtx src2 = SET_SRC (set);
+ rtx src3 = XEXP (SET_SRC (set), 1);
+ rtx new_src = GEN_INT (INTVAL (src3)
+ - INTVAL (reg_offset[regno]));
+ int success = 0;
+
+ if (new_src == const0_rtx)
+ /* See above why we create (set (reg) (reg)) here. */
+ success
+ = validate_change (next, &SET_SRC (set), reg, 0);
+ else if ((rtx_cost (new_src, PLUS)
+ < 2 + rtx_cost (src3, SET))
+ && have_add2_insn (GET_MODE (reg)))
+ success
+ = validate_change (next, &PATTERN (next),
+ gen_add2_insn (reg, new_src), 0);
+ if (success)
+ {
+ /* INSN might be the first insn in a basic block
+ if the preceding insn is a conditional jump
+ or a possible-throwing call. */
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ }
+ insn = next;
+ reg_set_luid[regno] = move2add_luid;
+ reg_mode[regno] = GET_MODE (reg);
+ reg_offset[regno] = src3;
+ continue;
+ }
+ }
+ }
+ }
+
+ for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
+ {
+ if (REG_NOTE_KIND (note) == REG_INC
+ && GET_CODE (XEXP (note, 0)) == REG)
+ {
+ /* Indicate that this register has been recently written to,
+ but the exact contents are not available. */
+ int regno = REGNO (XEXP (note, 0));
+ if (regno < FIRST_PSEUDO_REGISTER)
+ {
+ reg_set_luid[regno] = move2add_luid;
+ reg_offset[regno] = note;
+ }
+ }
+ }
+ note_stores (PATTERN (insn), move2add_note_store);
+ /* If this is a CALL_INSN, all call used registers are stored with
+ unknown values. */
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ for (i = FIRST_PSEUDO_REGISTER-1; i >= 0; i--)
+ {
+ if (call_used_regs[i])
+ {
+ reg_set_luid[i] = move2add_luid;
+ reg_offset[i] = insn; /* Invalidate contents. */
+ }
+ }
+ }
+ }
+}
+
+/* SET is a SET or CLOBBER that sets DST.
+ Update reg_set_luid, reg_offset and reg_base_reg accordingly.
+ Called from reload_cse_move2add via note_stores. */
+static void
+move2add_note_store (dst, set)
+ rtx dst, set;
+{
+ int regno = 0;
+ int i;
+
+ enum machine_mode mode = GET_MODE (dst);
+ if (GET_CODE (dst) == SUBREG)
+ {
+ regno = SUBREG_WORD (dst);
+ dst = SUBREG_REG (dst);
+ }
+ if (GET_CODE (dst) != REG)
+ return;
+
+ regno += REGNO (dst);
+
+ if (HARD_REGNO_NREGS (regno, mode) == 1 && GET_CODE (set) == SET)
+ {
+ rtx src = SET_SRC (set);
+
+ reg_mode[regno] = mode;
+ switch (GET_CODE (src))
+ {
+ case PLUS:
+ {
+ rtx src0 = XEXP (src, 0);
+ if (GET_CODE (src0) == REG)
+ {
+ if (REGNO (src0) != regno
+ || reg_offset[regno] != const0_rtx)
+ {
+ reg_base_reg[regno] = REGNO (src0);
+ reg_set_luid[regno] = move2add_luid;
+ }
+ reg_offset[regno] = XEXP (src, 1);
+ break;
+ }
+ reg_set_luid[regno] = move2add_luid;
+ reg_offset[regno] = set; /* Invalidate contents. */
+ break;
+ }
+
+ case REG:
+ reg_base_reg[regno] = REGNO (SET_SRC (set));
+ reg_offset[regno] = const0_rtx;
+ reg_set_luid[regno] = move2add_luid;
+ break;
+
+ default:
+ reg_base_reg[regno] = -1;
+ reg_offset[regno] = SET_SRC (set);
+ reg_set_luid[regno] = move2add_luid;
+ break;
+ }
+ }
+ else
+ {
+ for (i = regno + HARD_REGNO_NREGS (regno, mode) - 1; i >= regno; i--)
+ {
+ /* Indicate that this register has been recently written to,
+ but the exact contents are not available. */
+ reg_set_luid[i] = move2add_luid;
+ reg_offset[i] = dst;
+ }
+ }
+}
diff --git a/gcc/reorg.c b/gcc/reorg.c
index f2ee5b8884b..71c1cf2c918 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -234,7 +234,7 @@ static int insn_sets_resource_p PROTO((rtx, struct resources *, int));
static rtx find_end_label PROTO((void));
static rtx emit_delay_sequence PROTO((rtx, rtx, int));
static rtx add_to_delay_list PROTO((rtx, rtx));
-static void delete_from_delay_slot PROTO((rtx));
+static rtx delete_from_delay_slot PROTO((rtx));
static void delete_scheduled_jump PROTO((rtx));
static void note_delay_statistics PROTO((int, int));
static rtx optimize_skip PROTO((rtx));
@@ -340,11 +340,14 @@ mark_referenced_resources (x, res, include_delayed_effects)
case UNSPEC_VOLATILE:
case ASM_INPUT:
- case TRAP_IF:
/* Traditional asm's are always volatile. */
res->volatil = 1;
return;
+ case TRAP_IF:
+ res->volatil = 1;
+ break;
+
case ASM_OPERANDS:
res->volatil = MEM_VOLATILE_P (x);
@@ -576,7 +579,7 @@ mark_set_resources (x, res, in_dest, include_delayed_effects)
SET_HARD_REG_SET (res->regs);
}
- /* ... and also what it's RTL says it modifies, if anything. */
+ /* ... and also what its RTL says it modifies, if anything. */
case JUMP_INSN:
case INSN:
@@ -980,7 +983,7 @@ add_to_delay_list (insn, delay_list)
rtx delay_list;
{
/* If we have an empty list, just make a new list element. If
- INSN has it's block number recorded, clear it since we may
+ INSN has its block number recorded, clear it since we may
be moving the insn to a new block. */
if (delay_list == 0)
@@ -1008,7 +1011,7 @@ add_to_delay_list (insn, delay_list)
/* Delete INSN from the delay slot of the insn that it is in. This may
produce an insn without anything in its delay slots. */
-static void
+static rtx
delete_from_delay_slot (insn)
rtx insn;
{
@@ -1057,6 +1060,8 @@ delete_from_delay_slot (insn)
/* Show we need to fill this insn again. */
obstack_ptr_grow (&unfilled_slots_obstack, trial);
+
+ return trial;
}
/* Delete INSN, a JUMP_INSN. If it is a conditional jump, we must track down
@@ -1621,6 +1626,31 @@ redirect_with_delay_list_safe_p (jump, newlabel, delay_list)
return (li == NULL);
}
+/* DELAY_LIST is a list of insns that have already been placed into delay
+ slots. See if all of them have the same annulling status as ANNUL_TRUE_P.
+ If not, return 0; otherwise return 1. */
+
+static int
+check_annul_list_true_false (annul_true_p, delay_list)
+ int annul_true_p;
+ rtx delay_list;
+{
+ rtx temp;
+
+ if (delay_list)
+ {
+ for (temp = delay_list; temp; temp = XEXP (temp, 1))
+ {
+ rtx trial = XEXP (temp, 0);
+
+ if ((annul_true_p && INSN_FROM_TARGET_P (trial))
+ || (!annul_true_p && !INSN_FROM_TARGET_P (trial)))
+ return 0;
+ }
+ }
+ return 1;
+}
+
/* INSN branches to an insn whose pattern SEQ is a SEQUENCE. Given that
the condition tested by INSN is CONDITION and the resources shown in
@@ -1662,6 +1692,7 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
rtx new_delay_list = 0;
int must_annul = *pannul_p;
int i;
+ int used_annul = 0;
/* We can't do anything if there are more delay slots in SEQ than we
can handle, or if we don't know that it will be a taken branch.
@@ -1711,9 +1742,15 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
|| (! insn_sets_resource_p (trial, other_needed, 0)
&& ! may_trap_p (PATTERN (trial)))))
? eligible_for_delay (insn, total_slots_filled, trial, flags)
- : (must_annul = 1,
- eligible_for_annul_false (insn, total_slots_filled, trial, flags)))
+ : (must_annul || (delay_list == NULL && new_delay_list == NULL))
+ && (must_annul = 1,
+ check_annul_list_true_false (0, delay_list)
+ && check_annul_list_true_false (0, new_delay_list)
+ && eligible_for_annul_false (insn, total_slots_filled,
+ trial, flags)))
{
+ if (must_annul)
+ used_annul = 1;
temp = copy_rtx (trial);
INSN_FROM_TARGET_P (temp) = 1;
new_delay_list = add_to_delay_list (temp, new_delay_list);
@@ -1732,7 +1769,8 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
/* Add any new insns to the delay list and update the count of the
number of slots filled. */
*pslots_filled = total_slots_filled;
- *pannul_p = must_annul;
+ if (used_annul)
+ *pannul_p = 1;
if (delay_list == 0)
return new_delay_list;
@@ -1762,6 +1800,8 @@ steal_delay_list_from_fallthrough (insn, condition, seq,
{
int i;
int flags;
+ int must_annul = *pannul_p;
+ int used_annul = 0;
flags = get_jump_flags (insn, JUMP_LABEL (insn));
@@ -1795,14 +1835,17 @@ steal_delay_list_from_fallthrough (insn, condition, seq,
continue;
}
- if (! *pannul_p
+ if (! must_annul
&& ((condition == const_true_rtx
|| (! insn_sets_resource_p (trial, other_needed, 0)
&& ! may_trap_p (PATTERN (trial)))))
? eligible_for_delay (insn, *pslots_filled, trial, flags)
- : (*pannul_p = 1,
- eligible_for_annul_true (insn, *pslots_filled, trial, flags)))
+ : (must_annul || delay_list == NULL) && (must_annul = 1,
+ check_annul_list_true_false (1, delay_list)
+ && eligible_for_annul_true (insn, *pslots_filled, trial, flags)))
{
+ if (must_annul)
+ used_annul = 1;
delete_from_delay_slot (trial);
delay_list = add_to_delay_list (trial, delay_list);
@@ -1813,8 +1856,11 @@ steal_delay_list_from_fallthrough (insn, condition, seq,
break;
}
+ if (used_annul)
+ *pannul_p = 1;
return delay_list;
}
+
/* Try merging insns starting at THREAD which match exactly the insns in
INSN's delay list.
@@ -1846,13 +1892,15 @@ try_merge_delay_insns (insn, thread)
CLEAR_RESOURCE (&set);
/* If this is not an annulling branch, take into account anything needed in
- NEXT_TO_MATCH. This prevents two increments from being incorrectly
+ INSN's delay slot. This prevents two increments from being incorrectly
folded into one. If we are annulling, this would be the correct
thing to do. (The alternative, looking at things set in NEXT_TO_MATCH
will essentially disable this optimization. This method is somewhat of
a kludge, but I don't see a better way.) */
if (! annul_p)
- mark_referenced_resources (next_to_match, &needed, 1);
+ for (i = 1 ; i < num_slots ; i++)
+ if (XVECEXP (PATTERN (insn), 0, i))
+ mark_referenced_resources (XVECEXP (PATTERN (insn), 0, i), &needed, 1);
for (trial = thread; !stop_search_p (trial, 1); trial = next_trial)
{
@@ -1901,8 +1949,6 @@ try_merge_delay_insns (insn, thread)
break;
next_to_match = XVECEXP (PATTERN (insn), 0, slot_number);
- if (! annul_p)
- mark_referenced_resources (next_to_match, &needed, 1);
}
mark_set_resources (trial, &set, 0, 1);
@@ -1938,8 +1984,12 @@ try_merge_delay_insns (insn, thread)
{
if (! annul_p)
{
+ rtx new;
+
update_block (dtrial, thread);
- delete_from_delay_slot (dtrial);
+ new = delete_from_delay_slot (dtrial);
+ if (INSN_DELETED_P (thread))
+ thread = new;
INSN_FROM_TARGET_P (next_to_match) = 0;
}
else
@@ -1951,6 +2001,13 @@ try_merge_delay_insns (insn, thread)
next_to_match = XVECEXP (PATTERN (insn), 0, slot_number);
}
+ else
+ {
+ /* Keep track of the set/referenced resources for the delay
+ slots of any trial insns we encounter. */
+ mark_set_resources (dtrial, &set, 0, 1);
+ mark_referenced_resources (dtrial, &needed, 1);
+ }
}
}
@@ -1965,8 +2022,12 @@ try_merge_delay_insns (insn, thread)
{
if (GET_MODE (merged_insns) == SImode)
{
+ rtx new;
+
update_block (XEXP (merged_insns, 0), thread);
- delete_from_delay_slot (XEXP (merged_insns, 0));
+ new = delete_from_delay_slot (XEXP (merged_insns, 0));
+ if (INSN_DELETED_P (thread))
+ thread = new;
}
else
{
@@ -3019,8 +3080,20 @@ fill_simple_delay_slots (non_jumps_p)
else
flags = get_jump_flags (insn, NULL_RTX);
slots_to_fill = num_delay_slots (insn);
+
+ /* Some machine description have defined instructions to have
+ delay slots only in certain circumstances which may depend on
+ nearby insns (which change due to reorg's actions).
+
+ For example, the PA port normally has delay slots for unconditional
+ jumps.
+
+ However, the PA port claims such jumps do not have a delay slot
+ if they are immediate successors of certain CALL_INSNs. This
+ allows the port to favor filling the delay slot of the call with
+ the unconditional jump. */
if (slots_to_fill == 0)
- abort ();
+ continue;
/* This insn needs, or can use, some delay slots. SLOTS_TO_FILL
says how many. After initialization, first try optimizing
@@ -3585,9 +3658,10 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
/* There are two ways we can win: If TRIAL doesn't set anything
needed at the opposite thread and can't trap, or if it can
go into an annulled delay slot. */
- if (condition == const_true_rtx
- || (! insn_sets_resource_p (trial, &opposite_needed, 1)
- && ! may_trap_p (pat)))
+ if (!must_annul
+ && (condition == const_true_rtx
+ || (! insn_sets_resource_p (trial, &opposite_needed, 1)
+ && ! may_trap_p (pat))))
{
old_trial = trial;
trial = try_split (pat, trial, 0);
@@ -3615,9 +3689,11 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
if (thread == old_trial)
thread = trial;
pat = PATTERN (trial);
- if ((thread_if_true
- ? eligible_for_annul_false (insn, *pslots_filled, trial, flags)
- : eligible_for_annul_true (insn, *pslots_filled, trial, flags)))
+ if ((must_annul || delay_list == NULL) && (thread_if_true
+ ? check_annul_list_true_false (0, delay_list)
+ && eligible_for_annul_false (insn, *pslots_filled, trial, flags)
+ : check_annul_list_true_false (1, delay_list)
+ && eligible_for_annul_true (insn, *pslots_filled, trial, flags)))
{
rtx temp;
@@ -3893,8 +3969,19 @@ fill_eager_delay_slots ()
continue;
slots_to_fill = num_delay_slots (insn);
+ /* Some machine description have defined instructions to have
+ delay slots only in certain circumstances which may depend on
+ nearby insns (which change due to reorg's actions).
+
+ For example, the PA port normally has delay slots for unconditional
+ jumps.
+
+ However, the PA port claims such jumps do not have a delay slot
+ if they are immediate successors of certain CALL_INSNs. This
+ allows the port to favor filling the delay slot of the call with
+ the unconditional jump. */
if (slots_to_fill == 0)
- abort ();
+ continue;
slots_filled = 0;
target_label = JUMP_LABEL (insn);
@@ -4657,6 +4744,13 @@ dbr_schedule (first, file)
{
int pred_flags;
+ if (GET_CODE (insn) == INSN)
+ {
+ rtx pat = PATTERN (insn);
+
+ if (GET_CODE (pat) == SEQUENCE)
+ insn = XVECEXP (pat, 0, 0);
+ }
if (GET_CODE (insn) != JUMP_INSN)
continue;
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 51e7da067e1..63faf506ea4 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "rtl.h"
#include "real.h"
+#include "bitmap.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
@@ -59,13 +60,15 @@ char *rtx_name[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) NAME,
-char *mode_name[(int) MAX_MACHINE_MODE] = {
+char *mode_name[(int) MAX_MACHINE_MODE + 1] = {
#include "machmode.def"
#ifdef EXTRA_CC_MODES
- EXTRA_CC_NAMES
+ EXTRA_CC_NAMES,
#endif
-
+ /* Add an extra field to avoid a core dump if someone tries to convert
+ MAX_MACHINE_MODE to a string. */
+ ""
};
#undef DEF_MACHMODE
@@ -108,14 +111,23 @@ int mode_unit_size[(int) MAX_MACHINE_MODE] = {
use this. */
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) \
- (enum machine_mode) WIDER,
+ (unsigned char) WIDER,
-enum machine_mode mode_wider_mode[(int) MAX_MACHINE_MODE] = {
+unsigned char mode_wider_mode[(int) MAX_MACHINE_MODE] = {
#include "machmode.def" /* machine modes are documented here */
};
#undef DEF_MACHMODE
+#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) \
+ ((SIZE) * BITS_PER_UNIT >= HOST_BITS_PER_WIDE_INT) ? ~(unsigned HOST_WIDE_INT)0 : ((unsigned HOST_WIDE_INT) 1 << (SIZE) * BITS_PER_UNIT) - 1,
+
+/* Indexed by machine mode, gives mask of significant bits in mode. */
+
+const unsigned HOST_WIDE_INT mode_mask_array[(int) MAX_MACHINE_MODE] = {
+#include "machmode.def"
+};
+
/* Indexed by mode class, gives the narrowest mode for each class. */
enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS];
@@ -145,7 +157,9 @@ char *rtx_format[] = {
"V" like "E", but optional:
the containing rtx may end before this operand
"u" a pointer to another insn
- prints the uid of the insn. */
+ prints the uid of the insn.
+ "b" is a pointer to a bitmap header.
+ "t" is a tree pointer. */
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) FORMAT ,
#include "rtl.def" /* rtl expressions are defined here */
@@ -171,7 +185,8 @@ char *note_insn_name[] = { 0 , "NOTE_INSN_DELETED",
"NOTE_INSN_PROLOGUE_END", "NOTE_INSN_EPILOGUE_BEG",
"NOTE_INSN_DELETED_LABEL", "NOTE_INSN_FUNCTION_BEG",
"NOTE_INSN_EH_REGION_BEG", "NOTE_INSN_EH_REGION_END",
- "NOTE_REPEATED_LINE_NUMBER" };
+ "NOTE_REPEATED_LINE_NUMBER", "NOTE_INSN_RANGE_START",
+ "NOTE_INSN_RANGE_END", "NOTE_INSN_LIVE" };
char *reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0",
"REG_EQUAL", "REG_RETVAL", "REG_LIBCALL",
@@ -179,7 +194,8 @@ char *reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0",
"REG_CC_SETTER", "REG_CC_USER", "REG_LABEL",
"REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_BR_PROB",
"REG_EXEC_COUNT", "REG_NOALIAS", "REG_SAVE_AREA",
- "REG_BR_PRED", "REG_EH_CONTEXT" };
+ "REG_BR_PRED", "REG_EH_CONTEXT",
+ "REG_FRAME_RELATED_EXPR" };
static void dump_and_abort PROTO((int, int, FILE *));
static void read_name PROTO((char *, FILE *));
@@ -301,6 +317,18 @@ copy_rtx (orig)
}
break;
+ case 'b':
+ {
+ bitmap new_bits = BITMAP_OBSTACK_ALLOC (rtl_obstack);
+ bitmap_copy (new_bits, XBITMAP (orig, i));
+ XBITMAP (copy, i) = new_bits;
+ break;
+ }
+
+ case 't':
+ XTREE (copy, i) = XTREE (orig, i);
+ break;
+
case 'w':
XWINT (copy, i) = XWINT (orig, i);
break;
@@ -838,8 +866,8 @@ init_rtl ()
mode_class[i] = MODE_CC;
mode_size[i] = mode_size[(int) CCmode];
mode_unit_size[i] = mode_unit_size[(int) CCmode];
- mode_wider_mode[i - 1] = (enum machine_mode) i;
- mode_wider_mode[i] = VOIDmode;
+ mode_wider_mode[i - 1] = i;
+ mode_wider_mode[i] = (unsigned char)VOIDmode;
}
#endif
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 25dab98168f..a411ce36ea8 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -506,7 +506,7 @@ DEF_RTL_EXPR(RETURN, "return", "", 'x')
Operand 1 is the condition.
Operand 2 is the trap code.
For an unconditional trap, make the condition (const_int 1). */
-DEF_RTL_EXPR(TRAP_IF, "trap_if", "ei", 'x')
+DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", 'x')
/* ----------------------------------------------------------------------
Primitive values for use in expressions.
@@ -537,10 +537,16 @@ DEF_RTL_EXPR(CONST, "const", "e", 'o')
by a SET whose first operand is (PC). */
DEF_RTL_EXPR(PC, "pc", "", 'o')
-/* A register. The "operand" is the register number, accessed
- with the REGNO macro. If this number is less than FIRST_PSEUDO_REGISTER
- than a hardware register is being referred to. */
-DEF_RTL_EXPR(REG, "reg", "i", 'o')
+/* A register. The "operand" is the register number, accessed with
+ the REGNO macro. If this number is less than FIRST_PSEUDO_REGISTER
+ than a hardware register is being referred to. The second operand
+ doesn't really exist. Unfortunately, however, the compiler
+ implicitly assumes that a REG can be transformed in place into a
+ MEM, and therefore that a REG is at least as big as a MEM. To
+ avoid this memory overhead, which is likely to be substantial,
+ search for uses of PUT_CODE that turn REGs into MEMs, and fix them
+ somehow. Then, the trailing `0' can be removed here. */
+DEF_RTL_EXPR(REG, "reg", "i0", 'o')
/* A scratch register. This represents a register used only within a
single insn. It will be turned into a REG during register allocation
@@ -578,9 +584,11 @@ DEF_RTL_EXPR(STRICT_LOW_PART, "strict_low_part", "e", 'x')
in DECL_RTLs and during RTL generation, but not in the insn chain. */
DEF_RTL_EXPR(CONCAT, "concat", "ee", 'o')
-/* A memory location; operand is the address.
- Can be nested inside a VOLATILE. */
-DEF_RTL_EXPR(MEM, "mem", "e", 'o')
+/* A memory location; operand is the address. Can be nested inside a
+ VOLATILE. The second operand is the alias set to which this MEM
+ belongs. We use `0' instead of `i' for this field so that the
+ field need not be specified in machine descriptions. */
+DEF_RTL_EXPR(MEM, "mem", "e0", 'o')
/* Reference to an assembler label in the code for this function.
The operand is a CODE_LABEL found in the insn chain.
@@ -796,6 +804,49 @@ DEF_RTL_EXPR(HIGH, "high", "e", 'o')
of a constant expression. */
DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", 'o')
+/* Header for range information. Operand 0 is the NOTE_INSN_RANGE_START insn.
+ Operand 1 is the NOTE_INSN_RANGE_END insn. Operand 2 is a vector of all of
+ the registers that can be substituted within this range. Operand 3 is the
+ number of calls in the range. Operand 4 is the number of insns in the
+ range. Operand 5 is the unique range number for this range. Operand 6 is
+ the basic block # of the start of the live range. Operand 7 is the basic
+ block # of the end of the live range. Operand 8 is the loop depth. Operand
+ 9 is a bitmap of the registers live at the start of the range. Operand 10
+ is a bitmap of the registers live at the end of the range. Operand 11 is
+ marker number for the start of the range. Operand 12 is the marker number
+ for the end of the range. */
+DEF_RTL_EXPR(RANGE_INFO, "range_info", "uuEiiiiiibbii", 'x')
+
+/* Registers that can be substituted within the range. Operand 0 is the
+ original pseudo register number. Operand 1 will be filled in with the
+ pseudo register the value is copied for the duration of the range. Operand
+ 2 is the number of references within the range to the register. Operand 3
+ is the number of sets or clobbers of the register in the range. Operand 4
+ is the number of deaths the register has. Operand 5 is the copy flags that
+ give the status of whether a copy is needed from the original register to
+ the new register at the beginning of the range, or whether a copy from the
+ new register back to the original at the end of the range. Operand 6 is the
+ live length. Operand 7 is the number of calls that this register is live
+ across. Operand 8 is the symbol node of the variable if the register is a
+ user variable. Operand 9 is the block node that the variable is declared
+ in if the register is a user variable. */
+DEF_RTL_EXPR(RANGE_REG, "range_reg", "iiiiiiiitt", 'x')
+
+/* Information about a local variable's ranges. Operand 0 is an EXPR_LIST of
+ the different ranges a variable is in where it is copied to a different
+ pseudo register. Operand 1 is the block that the variable is declared in.
+ Operand 2 is the number of distinct ranges. */
+DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", 'x')
+
+/* Information about the registers that are live at the current point. Operand
+ 0 is the live bitmap. Operand 1 is the original block number. */
+DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", 'x')
+
+/* A unary `__builtin_constant_p' expression. These are only emitted
+ during RTL generation, and then only if optimize > 0. They are
+ eliminated by the first CSE pass. */
+DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", 'x')
+
/*
Local variables:
mode:c
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 8e089b6a508..ec78c66ad17 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -89,6 +89,8 @@ typedef union rtunion_def
struct rtvec_def *rtvec;
enum machine_mode rttype;
addr_diff_vec_flags rt_addr_diff_vec_flags;
+ struct bitmap_head_def *rtbit;
+ union tree_node *rttree;
} rtunion;
/* RTL expression ("rtx"). */
@@ -134,7 +136,7 @@ typedef struct rtx_def
In a SYMBOL_REF, this flag is used for machine-specific purposes.
In a LABEL_REF or in a REG_LABEL note, this is LABEL_REF_NONLOCAL_P. */
unsigned int volatil : 1;
- /* 1 in a MEM referring to a field of a structure (not a union!).
+ /* 1 in a MEM referring to a field of an aggregate.
0 if the MEM was a variable or the result of a * operator in C;
1 if it was the result of a . or -> operator (on a struct) in C.
1 in a REG if the register is used only in exit code a loop.
@@ -222,7 +224,8 @@ typedef struct rtvec_def{
#define CONSTANT_P(X) \
(GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
- || GET_CODE (X) == CONST || GET_CODE (X) == HIGH)
+ || GET_CODE (X) == CONST || GET_CODE (X) == HIGH \
+ || GET_CODE (X) == CONSTANT_P_RTX)
/* General accessor macros for accessing the fields of an rtx. */
@@ -233,6 +236,9 @@ typedef struct rtvec_def{
#define XVEC(RTX, N) ((RTX)->fld[N].rtvec)
#define XVECLEN(RTX, N) ((RTX)->fld[N].rtvec->num_elem)
#define XVECEXP(RTX,N,M)((RTX)->fld[N].rtvec->elem[M].rtx)
+#define XBITMAP(RTX, N) ((RTX)->fld[N].rtbit)
+#define XTREE(RTX, N) ((RTX)->fld[N].rttree)
+
/* ACCESS MACROS for particular fields of insns. */
@@ -337,8 +343,10 @@ typedef struct rtvec_def{
REG_SAVE_AREA is used to optimize rtl generated by dynamic stack
allocations for targets where SETJMP_VIA_SAVE_AREA is true.
REG_BR_PRED is attached to JUMP_INSNs only, it holds the branch prediction
- flags computed by get_jump_flags() after dbr scheduling is complete. */
-
+ flags computed by get_jump_flags() after dbr scheduling is complete.
+ REG_FRAME_RELATED_EXPR is attached to insns that are RTX_FRAME_RELATED_P,
+ but are too complex for DWARF to interpret what they imply. The attached
+ rtx is used instead of intuition. */
#define REG_NOTES(INSN) ((INSN)->fld[6].rtx)
@@ -351,7 +359,8 @@ enum reg_note { REG_DEAD = 1, REG_INC = 2, REG_EQUIV = 3, REG_WAS_0 = 4,
REG_CC_SETTER = 11, REG_CC_USER = 12, REG_LABEL = 13,
REG_DEP_ANTI = 14, REG_DEP_OUTPUT = 15, REG_BR_PROB = 16,
REG_EXEC_COUNT = 17, REG_NOALIAS = 18, REG_SAVE_AREA = 19,
- REG_BR_PRED = 20, REG_EH_CONTEXT = 21 };
+ REG_BR_PRED = 20, REG_EH_CONTEXT = 21,
+ REG_FRAME_RELATED_EXPR = 22 };
/* The base value for branch probability notes. */
#define REG_BR_PROB_BASE 10000
@@ -380,14 +389,21 @@ extern char *reg_note_name[];
#define LINE_NUMBER NOTE
-/* In a NOTE that is a line number, this is a string for the file name
- that the line is in. We use the same field to record block numbers
- temporarily in NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes.
- (We avoid lots of casts between ints and pointers if we use a
- different macro for the bock number.) */
+/* In a NOTE that is a line number, this is a string for the file name that the
+ line is in. We use the same field to record block numbers temporarily in
+ NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes. (We avoid lots of casts
+ between ints and pointers if we use a different macro for the block number.)
+ The NOTE_INSN_RANGE_{START,END} and NOTE_INSN_LIVE notes record their
+ information as a rtx in the field. */
#define NOTE_SOURCE_FILE(INSN) ((INSN)->fld[3].rtstr)
#define NOTE_BLOCK_NUMBER(INSN) ((INSN)->fld[3].rtint)
+#define NOTE_RANGE_INFO(INSN) ((INSN)->fld[3].rtx)
+#define NOTE_LIVE_INFO(INSN) ((INSN)->fld[3].rtx)
+
+/* If the NOTE_BLOCK_NUMBER field gets a -1, it means create a new
+ block node for a live range block. */
+#define NOTE_BLOCK_LIVE_RANGE_BLOCK -1
/* In a NOTE that is a line number, this is the line number.
Other kinds of NOTEs are identified by negative numbers here. */
@@ -443,6 +459,12 @@ extern char *reg_note_name[];
the line containing the inline call from being counted twice in gcov. */
#define NOTE_REPEATED_LINE_NUMBER -16
+/* Start/end of a live range region, where pseudos allocated on the stack can
+ be allocated to temporary registers. */
+#define NOTE_INSN_RANGE_START -17
+#define NOTE_INSN_RANGE_END -18
+/* Record which registers are currently live. */
+#define NOTE_INSN_LIVE -19
#if 0 /* These are not used, and I don't know what they were for. --rms. */
#define NOTE_DECL_NAME(INSN) ((INSN)->fld[3].rtstr)
@@ -545,9 +567,20 @@ extern char *note_insn_name[];
Also in an ASM_OPERANDS rtx. */
#define MEM_VOLATILE_P(RTX) ((RTX)->volatil)
-/* For a MEM rtx, 1 if it refers to a structure or union component. */
+/* For a MEM rtx, 1 if it refers to a field of an aggregate. */
#define MEM_IN_STRUCT_P(RTX) ((RTX)->in_struct)
+/* For a MEM rtx, the alias set. If 0, this MEM is not in any alias
+ set, and may alias anything. Otherwise, the MEM can only alias
+ MEMs in the same alias set. This value is set in a
+ language-dependent manner in the front-end, and should not be
+ altered in the back-end. These set numbers are tested for zero,
+ and compared for equality; they have no other significance. In
+ some front-ends, these numbers may correspond in some way to types,
+ or other language-level entities, but they need not, and the
+ back-end makes no such assumptions. */
+#define MEM_ALIAS_SET(RTX) (XINT (RTX, 1))
+
/* For a LABEL_REF, 1 means that this reference is to a label outside the
loop containing the reference. */
#define LABEL_OUTSIDE_LOOP_P(RTX) ((RTX)->in_struct)
@@ -583,6 +616,7 @@ extern char *note_insn_name[];
/* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
#define TRAP_CONDITION(RTX) ((RTX)->fld[0].rtx)
+#define TRAP_CODE(RTX) (RTX)->fld[1].rtx
/* 1 in a SYMBOL_REF if it addresses this function's constants pool. */
#define CONSTANT_POOL_ADDRESS_P(RTX) ((RTX)->unchanging)
@@ -671,6 +705,99 @@ extern char *note_insn_name[];
#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
#define AUTO_INC_DEC
#endif
+
+/* Accessors for RANGE_INFO. */
+/* For RANGE_{START,END} notes return the RANGE_START note. */
+#define RANGE_INFO_NOTE_START(INSN) (XEXP (INSN, 0))
+
+/* For RANGE_{START,END} notes return the RANGE_START note. */
+#define RANGE_INFO_NOTE_END(INSN) (XEXP (INSN, 1))
+
+/* For RANGE_{START,END} notes, return the vector containing the registers used
+ in the range. */
+#define RANGE_INFO_REGS(INSN) (XVEC (INSN, 2))
+#define RANGE_INFO_REGS_REG(INSN, N) (XVECEXP (INSN, 2, N))
+#define RANGE_INFO_NUM_REGS(INSN) (XVECLEN (INSN, 2))
+
+/* For RANGE_{START,END} notes, the number of calls within the range. */
+#define RANGE_INFO_NCALLS(INSN) (XINT (INSN, 3))
+
+/* For RANGE_{START,END} notes, the number of insns within the range. */
+#define RANGE_INFO_NINSNS(INSN) (XINT (INSN, 4))
+
+/* For RANGE_{START,END} notes, a unique # to identify this range. */
+#define RANGE_INFO_UNIQUE(INSN) (XINT (INSN, 5))
+
+/* For RANGE_{START,END} notes, the basic block # the range starts with. */
+#define RANGE_INFO_BB_START(INSN) (XINT (INSN, 6))
+
+/* For RANGE_{START,END} notes, the basic block # the range ends with. */
+#define RANGE_INFO_BB_END(INSN) (XINT (INSN, 7))
+
+/* For RANGE_{START,END} notes, the loop depth the range is in. */
+#define RANGE_INFO_LOOP_DEPTH(INSN) (XINT (INSN, 8))
+
+/* For RANGE_{START,END} notes, the bitmap of live registers at the start
+ of the range. */
+#define RANGE_INFO_LIVE_START(INSN) (XBITMAP (INSN, 9))
+
+/* For RANGE_{START,END} notes, the bitmap of live registers at the end
+ of the range. */
+#define RANGE_INFO_LIVE_END(INSN) (XBITMAP (INSN, 10))
+
+/* For RANGE_START notes, the marker # of the start of the range. */
+#define RANGE_INFO_MARKER_START(INSN) (XINT (INSN, 11))
+
+/* For RANGE_START notes, the marker # of the end of the range. */
+#define RANGE_INFO_MARKER_END(INSN) (XINT (INSN, 12))
+
+/* Original pseudo register # for a live range note. */
+#define RANGE_REG_PSEUDO(INSN,N) (XINT (XVECEXP (INSN, 2, N), 0))
+
+/* Pseudo register # original register is copied into or -1. */
+#define RANGE_REG_COPY(INSN,N) (XINT (XVECEXP (INSN, 2, N), 1))
+
+/* How many times a register in a live range note was referenced. */
+#define RANGE_REG_REFS(INSN,N) (XINT (XVECEXP (INSN, 2, N), 2))
+
+/* How many times a register in a live range note was set. */
+#define RANGE_REG_SETS(INSN,N) (XINT (XVECEXP (INSN, 2, N), 3))
+
+/* How many times a register in a live range note died. */
+#define RANGE_REG_DEATHS(INSN,N) (XINT (XVECEXP (INSN, 2, N), 4))
+
+/* Whether the original value is needed to be copied into the range register at
+ the start of the range. */
+#define RANGE_REG_COPY_FLAGS(INSN,N) (XINT (XVECEXP (INSN, 2, N), 5))
+
+/* # of insns the register copy is live over. */
+#define RANGE_REG_LIVE_LENGTH(INSN,N) (XINT (XVECEXP (INSN, 2, N), 6))
+
+/* # of calls the register copy is live over. */
+#define RANGE_REG_N_CALLS(INSN,N) (XINT (XVECEXP (INSN, 2, N), 7))
+
+/* DECL_NODE pointer of the declaration if the register is a user defined
+ variable. */
+#define RANGE_REG_SYMBOL_NODE(INSN,N) (XTREE (XVECEXP (INSN, 2, N), 8))
+
+/* BLOCK_NODE pointer to the block the variable is declared in if the
+ register is a user defined variable. */
+#define RANGE_REG_BLOCK_NODE(INSN,N) (XTREE (XVECEXP (INSN, 2, N), 9))
+
+/* EXPR_LIST of the distinct ranges a variable is in. */
+#define RANGE_VAR_LIST(INSN) (XEXP (INSN, 0))
+
+/* Block a variable is declared in. */
+#define RANGE_VAR_BLOCK(INSN) (XTREE (INSN, 1))
+
+/* # of distinct ranges a variable is in. */
+#define RANGE_VAR_NUM(INSN) (XINT (INSN, 2))
+
+/* For a NOTE_INSN_LIVE note, the registers which are currently live. */
+#define RANGE_LIVE_BITMAP(INSN) (XBITMAP (INSN, 0))
+
+/* For a NOTE_INSN_LIVE note, the original basic block number. */
+#define RANGE_LIVE_ORIG_BLOCK(INSN) (XINT (INSN, 1))
/* Generally useful functions. */
@@ -693,8 +820,10 @@ extern int ceil_log2 PROTO((unsigned HOST_WIDE_INT));
#define plus_constant_for_output(X,C) \
plus_constant_for_output_wide (X, (HOST_WIDE_INT) (C))
+/* In explow.c */
extern rtx plus_constant_wide PROTO((rtx, HOST_WIDE_INT));
extern rtx plus_constant_for_output_wide PROTO((rtx, HOST_WIDE_INT));
+extern void optimize_save_area_alloca PROTO((rtx));
extern rtx gen_rtx PVPROTO((enum rtx_code,
enum machine_mode, ...));
@@ -837,10 +966,8 @@ extern int side_effects_p PROTO((rtx));
extern int volatile_refs_p PROTO((rtx));
extern int volatile_insn_p PROTO((rtx));
extern void remove_note PROTO((rtx, rtx));
-extern void note_stores PROTO((rtx, void (*) (rtx, rtx)));
extern int refers_to_regno_p PROTO((int, int, rtx, rtx *));
extern int reg_overlap_mentioned_p PROTO((rtx, rtx));
-extern rtx find_use_as_address PROTO((rtx, rtx, HOST_WIDE_INT));
/* Functions in rtlanal.c */
@@ -862,6 +989,8 @@ extern rtx single_set PROTO((rtx));
extern rtx find_last_value PROTO((rtx, rtx *, rtx));
extern int refers_to_regno_p PROTO((int, int, rtx, rtx *));
extern int reg_overlap_mentioned_p PROTO((rtx, rtx));
+extern rtx find_use_as_address PROTO((rtx, rtx, HOST_WIDE_INT));
+extern void note_stores PROTO((rtx, void (*)()));
extern rtx reg_set_last PROTO((rtx, rtx));
extern int rtx_equal_p PROTO((rtx, rtx));
extern int dead_or_set_p PROTO((rtx, rtx));
@@ -879,6 +1008,8 @@ extern int inequality_comparison_p PROTO((rtx));
extern rtx replace_rtx PROTO((rtx, rtx, rtx));
extern rtx replace_regs PROTO((rtx, rtx *, int, int));
extern int computed_jump_p PROTO((rtx));
+typedef int (*rtx_function) PROTO((rtx *, void *));
+extern int for_each_rtx PROTO((rtx *, rtx_function, void *));
/* Maximum number of parallel sets and clobbers in any insn in this fn.
Always at least 3, since the combiner could put that many togetherm
@@ -929,6 +1060,7 @@ extern struct _global_rtl
struct rtx_def virtual_stack_vars_val;
struct rtx_def virtual_stack_dynamic_val;
struct rtx_def virtual_outgoing_args_val;
+ struct rtx_def virtual_cfa_val;
} global_rtl;
/* All references to certain hard regs, except those created
@@ -942,7 +1074,7 @@ extern rtx struct_value_rtx;
extern rtx struct_value_incoming_rtx;
extern rtx static_chain_rtx;
extern rtx static_chain_incoming_rtx;
-
+extern rtx return_address_pointer_rtx;
/* Include the RTL generation functions. */
@@ -950,11 +1082,14 @@ extern rtx static_chain_incoming_rtx;
#include "genrtl.h"
#endif
-/* There are two RTL codes that require special attention; the generation
- functions included above do the raw handling. */
+/* There are some RTL codes that require special attention; the
+ generation functions included above do the raw handling. If you
+ add to this list, modify special_rtx in gengenrtl.c as well. You
+ should also modify gen_rtx to use the special function. */
extern rtx gen_rtx_CONST_INT PROTO((enum machine_mode, HOST_WIDE_INT));
extern rtx gen_rtx_REG PROTO((enum machine_mode, int));
+extern rtx gen_rtx_MEM PROTO((enum machine_mode, rtx));
/* We need the cast here to ensure that we get the same result both with
and without prototypes. */
@@ -1030,24 +1165,25 @@ extern rtx gen_rtx_REG PROTO((enum machine_mode, int));
#define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
-#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 3)
+/* This points to the Canonical Frame Address of the function. This
+ should corrospond to the CFA produced by INCOMING_FRAME_SP_OFFSET,
+ but is calculated relative to the arg pointer for simplicity; the
+ frame pointer nor stack pointer are necessarily fixed relative to
+ the CFA until after reload. */
-extern rtx find_next_ref PROTO((rtx, rtx));
-extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
+#define virtual_cfa_rtx (&global_rtl.virtual_cfa_val)
+
+#define VIRTUAL_CFA_REGNUM ((FIRST_VIRTUAL_REGISTER) + 4)
-/* It is hard to write the prototype for expand_expr, since it needs
- expr.h to be included for the enumeration. */
+#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
-extern rtx expand_expr ();
+extern rtx find_next_ref PROTO((rtx, rtx));
+extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
extern rtx output_constant_def PROTO((union tree_node *));
extern rtx immed_real_const PROTO((union tree_node *));
extern union tree_node *make_tree PROTO((union tree_node *, rtx));
-/* Abort routines */
-extern void fatal_insn_not_found PROTO((rtx));
-extern void fatal_insn PROTO((char *, rtx));
-
/* Define a default value for STORE_FLAG_VALUE. */
#ifndef STORE_FLAG_VALUE
@@ -1179,6 +1315,7 @@ extern void add_insn_after PROTO ((rtx, rtx));
extern void reorder_insns_with_line_notes PROTO ((rtx, rtx, rtx));
extern void emit_insn_after_with_line_notes PROTO ((rtx, rtx, rtx));
extern enum rtx_code classify_insn PROTO ((rtx));
+extern void init_virtual_regs PROTO ((void));
extern rtx emit PROTO ((rtx));
/* Query and clear/ restore no_line_numbers. This is used by the
switch / case handling in stmt.c to give proper line numbers in
@@ -1202,6 +1339,9 @@ extern void dump_combine_total_stats PROTO ((FILE *));
#ifdef BUFSIZ
extern void schedule_insns PROTO ((FILE *));
#endif
+#ifdef HAIFA
+extern void fix_sched_param PROTO ((char *, char *));
+#endif
/* In print-rtl.c */
extern void debug_rtx PROTO ((rtx));
@@ -1209,13 +1349,14 @@ extern void debug_rtx_list PROTO ((rtx, int));
extern rtx debug_rtx_find PROTO ((rtx, int));
#ifdef BUFSIZ
extern void print_rtl PROTO ((FILE *, rtx));
+extern int print_rtl_single PROTO ((FILE *, rtx));
extern void print_inline_rtx PROTO ((FILE *, rtx, int));
#endif
/* In loop.c */
extern void init_loop PROTO ((void));
#ifdef BUFSIZ
-extern void loop_optimize PROTO ((rtx, FILE *, int));
+extern void loop_optimize PROTO ((rtx, FILE *, int, int));
#endif
extern void record_excess_regs PROTO ((rtx, rtx, rtx *));
@@ -1228,56 +1369,24 @@ extern void preserve_rtl_expr_result PROTO ((rtx));
extern void mark_temp_addr_taken PROTO ((rtx));
extern void update_temp_slot_address PROTO ((rtx, rtx));
extern void use_variable_after PROTO ((rtx, rtx));
+extern void purge_addressof PROTO ((rtx));
/* In reload.c */
extern int operands_match_p PROTO ((rtx, rtx));
extern int safe_from_earlyclobber PROTO ((rtx, rtx));
-extern int strict_memory_address_p PROTO ((enum machine_mode, rtx));
-
-/* In recog.c */
-extern int memory_address_p PROTO ((enum machine_mode, rtx));
-extern int constrain_operands PROTO ((int, int));
-extern int mode_dependent_address_p PROTO ((rtx));
-extern void init_recog_no_volatile PROTO ((void));
-extern int offsettable_memref_p PROTO ((rtx));
-extern int offsettable_nonstrict_memref_p PROTO ((rtx));
-extern int reg_fits_class_p PROTO ((rtx, register enum reg_class,
- int, enum machine_mode));
-extern int check_asm_operands PROTO ((rtx));
-extern int address_operand PROTO ((rtx, enum machine_mode));
-extern int const_int_operand PROTO ((rtx, enum machine_mode));
-extern int const_double_operand PROTO ((rtx, enum machine_mode));
-extern int general_operand PROTO ((rtx, enum machine_mode));
-extern int immediate_operand PROTO ((rtx, enum machine_mode));
-extern int nonimmediate_operand PROTO ((rtx, enum machine_mode));
-extern int memory_operand PROTO ((rtx, enum machine_mode));
-extern int nonmemory_operand PROTO ((rtx, enum machine_mode));
-extern int push_operand PROTO ((rtx, enum machine_mode));
-extern int register_operand PROTO ((rtx, enum machine_mode));
-extern int scratch_operand PROTO ((rtx, enum machine_mode));
-extern int indirect_operand PROTO ((rtx, enum machine_mode));
-extern int mode_independent_operand PROTO ((rtx, enum machine_mode));
-extern int comparison_operator PROTO ((rtx, enum machine_mode));
-extern void init_recog_no_volatile PROTO ((void));
-extern void init_recog PROTO ((void));
-extern int validate_replace_rtx PROTO ((rtx, rtx, rtx));
-extern int offsettable_address_p PROTO ((int, enum machine_mode, rtx));
-extern int next_insn_tests_no_inequality PROTO ((rtx));
-extern int recog_memoized PROTO ((rtx));
-extern int validate_change PROTO ((rtx, rtx *, rtx, int));
-extern int apply_change_group PROTO ((void));
-extern void cancel_changes PROTO ((int));
-extern int num_validated_changes PROTO ((void));
/* In insn-recog.c */
extern int recog PROTO ((rtx, rtx, int *));
/* In stmt.c */
+extern void expand_null_return PROTO((void));
extern void emit_jump PROTO ((rtx));
extern int preserve_subexpressions_p PROTO ((void));
/* In expr.c */
extern void init_expr_once PROTO ((void));
+extern void move_by_pieces PROTO ((rtx, rtx, int, int));
+
/* In stupid.c */
#ifdef BUFSIZ
@@ -1286,6 +1395,7 @@ extern void stupid_life_analysis PROTO ((rtx, int, FILE *));
/* In flow.c */
extern void allocate_for_life_analysis PROTO ((void));
+extern void recompute_reg_usage PROTO ((rtx));
#ifdef BUFSIZ
extern void dump_flow_info PROTO ((FILE *));
#endif
@@ -1298,13 +1408,24 @@ extern rtx expand_mult_highpart PROTO ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT, rtx,
int, int));
+/* In gcse.c */
+#ifdef BUFSIZ
+extern void gcse_main PROTO ((rtx, FILE *));
+#endif
+
/* In global.c */
+extern void mark_elimination PROTO ((int, int));
#ifdef BUFSIZ
extern int global_alloc PROTO ((FILE *));
extern void dump_global_regs PROTO ((FILE *));
#endif
+#ifdef HARD_CONST
+extern void retry_global_alloc PROTO ((int, HARD_REG_SET));
+#endif
/* In regclass.c */
+extern int reg_classes_intersect_p PROTO ((enum reg_class, enum reg_class));
+extern int reg_class_subset_p PROTO ((enum reg_class, enum reg_class));
extern void globalize_reg PROTO ((int));
extern void init_regs PROTO ((void));
extern void init_reg_sets PROTO ((void));
@@ -1312,8 +1433,19 @@ extern void regset_release_memory PROTO ((void));
extern void regclass_init PROTO ((void));
extern void regclass PROTO ((rtx, int));
extern void reg_scan PROTO ((rtx, int, int));
+extern void reg_scan_update PROTO ((rtx, rtx, int));
extern void fix_register PROTO ((char *, int, int));
+/* In regmove.c */
+#ifdef BUFSIZ
+extern void regmove_optimize PROTO ((rtx, int, FILE *));
+#endif
+
+/* In reorg.c */
+#ifdef BUFSIZ
+extern void dbr_schedule PROTO ((rtx, FILE *));
+#endif
+
/* In optabs.c */
extern void init_optabs PROTO ((void));
@@ -1336,6 +1468,11 @@ extern void init_caller_save PROTO ((void));
/* In profile.c */
extern void init_branch_prob PROTO ((char *));
+#ifdef BUFSIZ
+extern void branch_prob PROTO ((rtx, FILE *));
+extern void end_branch_prob PROTO ((FILE *));
+#endif
+extern void output_func_start_profiler PROTO ((void));
/* In reg-stack.c */
#ifdef BUFSIZ
diff --git a/gcc/rtl.texi b/gcc/rtl.texi
index 0127fcea456..9b69eaebaba 100644
--- a/gcc/rtl.texi
+++ b/gcc/rtl.texi
@@ -287,9 +287,9 @@ to access them.
@section Flags in an RTL Expression
@cindex flags in RTL expression
-RTL expressions contain several flags (one-bit bitfields) that are used
-in certain types of expression. Most often they are accessed with the
-following macros:
+RTL expressions contain several flags (one-bit bitfields) and other
+values that are used in certain types of expression. Most often they
+are accessed with the following macros:
@table @code
@findex MEM_VOLATILE_P
@@ -310,6 +310,15 @@ structure, union or array, or to a component of one. Zero for
references to a scalar variable or through a pointer to a scalar.
Stored in the @code{in_struct} field and printed as @samp{/s}.
+@findex MEM_ALIAS_SET
+@item MEM_ALIAS_SET (@var{x})
+In @code{mem} expressions, the alias set to which @var{x} belongs. If
+zero, @var{x} is not in any alias set, and may alias anything. If
+nonzero, @var{x} may only alias objects in the same alias set. This
+value is set (in a language-specific manner) by the front-end. This
+field is not a bit-field; it is in an integer, found as the second
+argument to the @code{mem}.
+
@findex REG_LOOP_TEST_P
@cindex @code{reg} and @samp{/s}
@cindex @code{in_struct}, in @code{reg}
@@ -380,8 +389,7 @@ other functions or by aliasing.) Stored in the
@cindex @code{integrated}, in @code{insn}
@item RTX_INTEGRATED_P (@var{insn})
Nonzero in an insn if it resulted from an in-line function call.
-Stored in the @code{integrated} field and printed as @samp{/i}. This
-may be deleted; nothing currently depends on it.
+Stored in the @code{integrated} field and printed as @samp{/i}.
@findex SYMBOL_REF_USED
@cindex @code{used}, in @code{symbol_ref}
@@ -2360,14 +2368,23 @@ Appears following each call to @code{setjmp} or a related function.
These codes are printed symbolically when they appear in debugging dumps.
@end table
+@cindex @code{TImode}, in @code{insn}
@cindex @code{HImode}, in @code{insn}
@cindex @code{QImode}, in @code{insn}
The machine mode of an insn is normally @code{VOIDmode}, but some
phases use the mode for various purposes; for example, the reload pass
sets it to @code{HImode} if the insn needs reloading but not register
-elimination and @code{QImode} if both are required. The common
-subexpression elimination pass sets the mode of an insn to @code{QImode}
-when it is the first insn in a block that has already been processed.
+elimination and @code{QImode} if both are required.
+
+The common subexpression elimination pass sets the mode of an insn to
+@code{QImode} when it is the first insn in a block that has already
+been processed.
+
+The second Haifa scheduling pass, for targets that can multiple issue,
+sets the mode of an insn to @code{TImode} when it is believed that the
+instruction begins an issue group. That is, when the instruction
+cannot issue simultaneously with the previous. This may be relied on
+by later passes, in particular machine-dependant reorg.
Here is a table of the extra fields of @code{insn}, @code{jump_insn}
and @code{call_insn} insns:
@@ -2674,6 +2691,12 @@ probability that the branch will be taken.
These notes are found in JUMP insns after delayed branch scheduling
has taken place. They indicate both the direction and the likelyhood
of the JUMP. The format is a bitmask of ATTR_FLAG_* values.
+
+@findex REG_FRAME_RELATED_EXPR
+@item REG_FRAME_RELATED_EXPR
+This is used on an RTX_FRAME_RELATED_P insn wherein the attached expression
+is used in place of the actual insn pattern. This is done in cases where
+the pattern is either complex or misleading.
@end table
For convenience, the machine mode in an @code{insn_list} or
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 22215ae0cde..6e5fa77fd3e 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -455,7 +455,8 @@ static int reg_set_flag;
static void
reg_set_p_1 (x, pat)
- rtx x, pat;
+ rtx x;
+ rtx pat ATTRIBUTE_UNUSED;
{
/* We don't want to return 1 if X is a MEM that contains a register
within REG_SET_REG. */
@@ -816,7 +817,14 @@ reg_overlap_mentioned_p (x, in)
{
int regno, endregno;
- if (GET_CODE (x) == SUBREG)
+ /* Overly conservative. */
+ if (GET_CODE (x) == STRICT_LOW_PART)
+ x = XEXP (x, 0);
+
+ /* If either argument is a constant, then modifying X can not affect IN. */
+ if (CONSTANT_P (x) || CONSTANT_P (in))
+ return 0;
+ else if (GET_CODE (x) == SUBREG)
{
regno = REGNO (SUBREG_REG (x));
if (regno < FIRST_PSEUDO_REGISTER)
@@ -824,8 +832,6 @@ reg_overlap_mentioned_p (x, in)
}
else if (GET_CODE (x) == REG)
regno = REGNO (x);
- else if (CONSTANT_P (x))
- return 0;
else if (GET_CODE (x) == MEM)
{
char *fmt;
@@ -845,6 +851,18 @@ reg_overlap_mentioned_p (x, in)
else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
|| GET_CODE (x) == CC0)
return reg_mentioned_p (x, in);
+ else if (GET_CODE (x) == PARALLEL
+ && GET_MODE (x) == BLKmode)
+ {
+ register int i;
+
+ /* If any register in here refers to it
+ we return true. */
+ for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ if (reg_overlap_mentioned_p (SET_DEST (XVECEXP (x, 0, i)), in))
+ return 1;
+ return 0;
+ }
else
abort ();
@@ -1080,7 +1098,16 @@ note_stores (x, fun)
|| GET_CODE (dest) == SIGN_EXTRACT
|| GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
- (*fun) (dest, x);
+
+ if (GET_CODE (dest) == PARALLEL
+ && GET_MODE (dest) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
+ (*fun) (SET_DEST (XVECEXP (dest, 0, i)), x);
+ }
+ else
+ (*fun) (dest, x);
}
else if (GET_CODE (x) == PARALLEL)
{
@@ -1099,7 +1126,15 @@ note_stores (x, fun)
|| GET_CODE (dest) == SIGN_EXTRACT
|| GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
- (*fun) (dest, y);
+ if (GET_CODE (dest) == PARALLEL
+ && GET_MODE (dest) == BLKmode)
+ {
+ register int i;
+ for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
+ (*fun) (SET_DEST (XVECEXP (dest, 0, i)), y);
+ }
+ else
+ (*fun) (dest, y);
}
}
}
@@ -1258,6 +1293,10 @@ find_reg_note (insn, kind, datum)
{
register rtx link;
+ /* Ignore anything that is not an INSN, JUMP_INSN or CALL_INSN. */
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ return 0;
+
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
if (REG_NOTE_KIND (link) == kind
&& (datum == 0 || datum == XEXP (link, 0)))
@@ -1278,6 +1317,10 @@ find_regno_note (insn, kind, regno)
{
register rtx link;
+ /* Ignore anything that is not an INSN, JUMP_INSN or CALL_INSN. */
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ return 0;
+
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
if (REG_NOTE_KIND (link) == kind
/* Verify that it is a register, so that scratch and MEM won't cause a
@@ -1751,7 +1794,8 @@ inequality_comparisons_p (x)
return 0;
}
-/* Replace any occurrence of FROM in X with TO.
+/* Replace any occurrence of FROM in X with TO. The function does
+ not enter into CONST_DOUBLE for the replace.
Note that copying is not done so X must not be shared unless all copies
are to be modified. */
@@ -1763,6 +1807,11 @@ replace_rtx (x, from, to)
register int i, j;
register char *fmt;
+ /* The following prevents loops occurrence when we change MEM in
+ CONST_DOUBLE onto the same CONST_DOUBLE. */
+ if (x != 0 && GET_CODE (x) == CONST_DOUBLE)
+ return x;
+
if (x == from)
return to;
@@ -1995,3 +2044,76 @@ computed_jump_p (insn)
}
return 0;
}
+
+/* Traverse X via depth-first search, calling F for each
+ sub-expression (including X itself). F is also passed the DATA.
+ If F returns -1, do not traverse sub-expressions, but continue
+ traversing the rest of the tree. If F ever returns any other
+ non-zero value, stop the traversal, and return the value returned
+ by F. Otherwise, return 0. This function does not traverse inside
+ tree structure that contains RTX_EXPRs, or into sub-expressions
+ whose format code is `0' since it is not known whether or not those
+ codes are actually RTL.
+
+ This routine is very general, and could (should?) be used to
+ implement many of the other routines in this file. */
+
+int for_each_rtx (x, f, data)
+ rtx* x;
+ rtx_function f;
+ void* data;
+{
+ int result;
+ int length;
+ char* format;
+ int i;
+
+ /* Call F on X. */
+ result = (*f)(x, data);
+ if (result == -1)
+ /* Do not traverse sub-expressions. */
+ return 0;
+ else if (result != 0)
+ /* Stop the traversal. */
+ return result;
+
+ if (*x == NULL_RTX)
+ /* There are no sub-expressions. */
+ return 0;
+
+ length = GET_RTX_LENGTH (GET_CODE (*x));
+ format = GET_RTX_FORMAT (GET_CODE (*x));
+
+ for (i = 0; i < length; ++i)
+ {
+ switch (format[i])
+ {
+ case 'e':
+ result = for_each_rtx (&XEXP (*x, i), f, data);
+ if (result != 0)
+ return result;
+ break;
+
+ case 'V':
+ case 'E':
+ if (XVEC (*x, i) != 0)
+ {
+ int j;
+ for (j = 0; j < XVECLEN (*x, i); ++j)
+ {
+ result = for_each_rtx (&XVECEXP (*x, i, j), f, data);
+ if (result != 0)
+ return result;
+ }
+ }
+ break;
+
+ default:
+ /* Nothing to do. */
+ break;
+ }
+
+ }
+
+ return 0;
+}
diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c
index aa9390b7c74..d2f32a86cf9 100644
--- a/gcc/scan-decls.c
+++ b/gcc/scan-decls.c
@@ -19,7 +19,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hconfig.h"
#include "system.h"
+#include "gansidecl.h"
#include "cpplib.h"
+#include "scan.h"
int brace_nesting = 0;
diff --git a/gcc/scan.h b/gcc/scan.h
index 929a1ef5fee..12879c015bf 100644
--- a/gcc/scan.h
+++ b/gcc/scan.h
@@ -60,6 +60,8 @@ extern int read_upto _PARAMS((FILE *, sstring *, int));
extern char *xmalloc _PARAMS((unsigned));
extern char *xrealloc _PARAMS((char *, unsigned));
extern unsigned long hash _PARAMS((const char *));
+extern void recognized_function _PARAMS((char *, int, int, char *, int, int, char *, int));
+extern void recognized_extern _PARAMS((char *, int, char *, int));
/* get_token is a simple C lexer. */
#define IDENTIFIER_TOKEN 300
diff --git a/gcc/sched.c b/gcc/sched.c
index a51d1281ed9..5fbf7609f4d 100644
--- a/gcc/sched.c
+++ b/gcc/sched.c
@@ -127,10 +127,17 @@ Boston, MA 02111-1307, USA. */
#include "insn-config.h"
#include "insn-attr.h"
+#ifndef INSN_SCHEDULING
+void
+schedule_insns (dump_file)
+ FILE *dump_file ATTRIBUTE_UNUSED;
+{
+}
+#else /* INSN_SCHEDULING -- rest of file */
+
extern char *reg_known_equiv_p;
extern rtx *reg_known_value;
-#ifdef INSN_SCHEDULING
/* Arrays set up by scheduling for the same respective purposes as
similar-named arrays set up by flow analysis. We work with these
arrays during the scheduling pass so we can compare values against
@@ -342,8 +349,6 @@ static void update_flow_info PROTO((rtx, rtx, rtx, rtx));
/* Main entry point of this file. */
void schedule_insns PROTO((FILE *));
-
-#endif /* INSN_SCHEDULING */
#define SIZE_FOR_MODE(X) (GET_MODE_SIZE (GET_MODE (X)))
@@ -451,13 +456,6 @@ remove_dependence (insn, elem)
return;
}
-#ifndef INSN_SCHEDULING
-void
-schedule_insns (dump_file)
- FILE *dump_file;
-{
-}
-#else
#ifndef __GNUC__
#define __inline
#endif
@@ -1737,6 +1735,8 @@ sched_analyze (head, tail)
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_RANGE_START
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_RANGE_END
|| (NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP
&& GET_CODE (PREV_INSN (insn)) != CALL_INSN)))
{
@@ -2516,6 +2516,8 @@ unlink_notes (insn, tail)
else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_SETJMP
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_START
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_RANGE_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END)
{
@@ -4289,14 +4291,18 @@ schedule_insns (dump_file)
remember how far we can cut back the stack on exit. */
/* Allocate data for this pass. See comments, above,
- for what these vectors do. */
- insn_luid = (int *) alloca (max_uid * sizeof (int));
- insn_priority = (int *) alloca (max_uid * sizeof (int));
- insn_tick = (int *) alloca (max_uid * sizeof (int));
- insn_costs = (short *) alloca (max_uid * sizeof (short));
- insn_units = (short *) alloca (max_uid * sizeof (short));
- insn_blockage = (unsigned int *) alloca (max_uid * sizeof (unsigned int));
- insn_ref_count = (int *) alloca (max_uid * sizeof (int));
+ for what these vectors do.
+
+ We use xmalloc instead of alloca, because max_uid can be very large
+ when there is a lot of function inlining. If we used alloca, we could
+ exceed stack limits on some hosts for some inputs. */
+ insn_luid = (int *) xmalloc (max_uid * sizeof (int));
+ insn_priority = (int *) xmalloc (max_uid * sizeof (int));
+ insn_tick = (int *) xmalloc (max_uid * sizeof (int));
+ insn_costs = (short *) xmalloc (max_uid * sizeof (short));
+ insn_units = (short *) xmalloc (max_uid * sizeof (short));
+ insn_blockage = (unsigned int *) xmalloc (max_uid * sizeof (unsigned int));
+ insn_ref_count = (int *) xmalloc (max_uid * sizeof (int));
if (reload_completed == 0)
{
@@ -4320,7 +4326,7 @@ schedule_insns (dump_file)
{
rtx line;
- line_note = (rtx *) alloca (max_uid * sizeof (rtx));
+ line_note = (rtx *) xmalloc (max_uid * sizeof (rtx));
bzero ((char *) line_note, max_uid * sizeof (rtx));
line_note_head = (rtx *) alloca (n_basic_blocks * sizeof (rtx));
bzero ((char *) line_note_head, n_basic_blocks * sizeof (rtx));
@@ -4557,6 +4563,17 @@ schedule_insns (dump_file)
}
}
+ free (insn_luid);
+ free (insn_priority);
+ free (insn_tick);
+ free (insn_costs);
+ free (insn_units);
+ free (insn_blockage);
+ free (insn_ref_count);
+
+ if (write_symbols != NO_DEBUG)
+ free (line_note);
+
if (reload_completed == 0)
{
FREE_REG_SET (bb_dead_regs);
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 7aeb29edafd..1823155cea5 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -52,6 +52,8 @@ AT&T C compiler. From the example below I would conclude the following:
#include "flags.h"
#include "insn-config.h"
#include "reload.h"
+#include "output.h"
+#include "toplev.h"
/* Mips systems use the SDB functions to dump out symbols, but do not
supply usable syms.h include files. Which syms.h file to use is a
@@ -100,9 +102,7 @@ extern FILE *asm_out_file;
extern tree current_function_decl;
-void sdbout_init ();
-void sdbout_symbol ();
-void sdbout_types();
+#include "sdbout.h"
static char *gen_fake_label PROTO((void));
static int plain_type PROTO((tree));
@@ -173,7 +173,13 @@ static void sdbout_reg_parms PROTO((tree));
#endif
#ifndef PUT_SDB_INT_VAL
-#define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\t.val\t%d%s", (a), SDB_DELIM)
+#define PUT_SDB_INT_VAL(a) \
+ do { \
+ fputs ("\t.val\t", asm_out_file); \
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a)); \
+ fprintf (asm_out_file, "%s", SDB_DELIM); \
+ } while (0)
+
#endif
#ifndef PUT_SDB_VAL
@@ -203,7 +209,12 @@ do { fprintf (asm_out_file, "\t.def\t"); \
#endif
#ifndef PUT_SDB_SIZE
-#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\t.size\t%d%s", a, SDB_DELIM)
+#define PUT_SDB_SIZE(a) \
+ do { \
+ fputs ("\t.size\t", asm_out_file); \
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a)); \
+ fprintf (asm_out_file, "%s", SDB_DELIM); \
+ } while(0)
#endif
#ifndef PUT_SDB_START_DIM
@@ -1071,10 +1082,18 @@ sdbout_field_types (type)
tree tail;
for (tail = TYPE_FIELDS (type); tail; tail = TREE_CHAIN (tail))
- if (POINTER_TYPE_P (TREE_TYPE (tail)))
- sdbout_one_type (TREE_TYPE (TREE_TYPE (tail)));
- else
- sdbout_one_type (TREE_TYPE (tail));
+ /* This condition should match the one for emitting the actual members
+ below. */
+ if (TREE_CODE (tail) == FIELD_DECL
+ && DECL_NAME (tail) != 0
+ && TREE_CODE (DECL_SIZE (tail)) == INTEGER_CST
+ && TREE_CODE (DECL_FIELD_BITPOS (tail)) == INTEGER_CST)
+ {
+ if (POINTER_TYPE_P (TREE_TYPE (tail)))
+ sdbout_one_type (TREE_TYPE (TREE_TYPE (tail)));
+ else
+ sdbout_one_type (TREE_TYPE (tail));
+ }
}
/* Use this to put out the top level defined record and union types
@@ -1187,34 +1206,41 @@ sdbout_one_type (type)
/* Print out the base class information with fields
named after the types they hold. */
- if (TYPE_BINFO (type)
- && TYPE_BINFO_BASETYPES (type))
- n_baseclasses = TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type));
- for (i = 0; i < n_baseclasses; i++)
+ /* This is only relevent to aggregate types. TYPE_BINFO is used
+ for other purposes in an ENUMERAL_TYPE, so we must exclude that
+ case. */
+ if (TREE_CODE (type) != ENUMERAL_TYPE)
{
- tree child = TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (type)), i);
- tree child_type = BINFO_TYPE (child);
- tree child_type_name;
- if (TYPE_NAME (child_type) == 0)
- continue;
- if (TREE_CODE (TYPE_NAME (child_type)) == IDENTIFIER_NODE)
- child_type_name = TYPE_NAME (child_type);
- else if (TREE_CODE (TYPE_NAME (child_type)) == TYPE_DECL)
+ if (TYPE_BINFO (type)
+ && TYPE_BINFO_BASETYPES (type))
+ n_baseclasses = TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type));
+ for (i = 0; i < n_baseclasses; i++)
{
- child_type_name = DECL_NAME (TYPE_NAME (child_type));
- if (child_type_name && template_name_p (child_type_name))
- child_type_name
- = DECL_ASSEMBLER_NAME (TYPE_NAME (child_type));
- }
- else
- continue;
+ tree child = TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (type)),
+ i);
+ tree child_type = BINFO_TYPE (child);
+ tree child_type_name;
+ if (TYPE_NAME (child_type) == 0)
+ continue;
+ if (TREE_CODE (TYPE_NAME (child_type)) == IDENTIFIER_NODE)
+ child_type_name = TYPE_NAME (child_type);
+ else if (TREE_CODE (TYPE_NAME (child_type)) == TYPE_DECL)
+ {
+ child_type_name = DECL_NAME (TYPE_NAME (child_type));
+ if (child_type_name && template_name_p (child_type_name))
+ child_type_name
+ = DECL_ASSEMBLER_NAME (TYPE_NAME (child_type));
+ }
+ else
+ continue;
- CONTIN;
- PUT_SDB_DEF (IDENTIFIER_POINTER (child_type_name));
- PUT_SDB_INT_VAL (TREE_INT_CST_LOW (BINFO_OFFSET (child)));
- PUT_SDB_SCL (member_scl);
- sdbout_type (BINFO_TYPE (child));
- PUT_SDB_ENDEF;
+ CONTIN;
+ PUT_SDB_DEF (IDENTIFIER_POINTER (child_type_name));
+ PUT_SDB_INT_VAL (TREE_INT_CST_LOW (BINFO_OFFSET (child)));
+ PUT_SDB_SCL (member_scl);
+ sdbout_type (BINFO_TYPE (child));
+ PUT_SDB_ENDEF;
+ }
}
/* output the individual fields */
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 13705e61b9b..dc90d6ccd5a 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -51,6 +51,7 @@ Boston, MA 02111-1307, USA. */
#include "recog.h"
#include "machmode.h"
#include "toplev.h"
+#include "output.h"
#include "ggc.h"
#define obstack_chunk_alloc xmalloc
@@ -1650,7 +1651,9 @@ expand_expr_stmt (exp)
exp = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (exp)), exp);
last_expr_type = TREE_TYPE (exp);
- if (! flag_syntax_only || expr_stmts_for_value)
+ if (flag_syntax_only && ! expr_stmts_for_value)
+ last_expr_value = 0;
+ else
last_expr_value = expand_expr (exp,
(expr_stmts_for_value
? NULL_RTX : const0_rtx),
@@ -2026,13 +2029,8 @@ expand_loop_continue_here ()
void
expand_end_loop ()
{
- register rtx insn;
- register rtx start_label;
- rtx last_test_insn = 0;
- int num_insns = 0;
-
- insn = get_last_insn ();
- start_label = loop_stack->data.loop.start_label;
+ rtx start_label = loop_stack->data.loop.start_label;
+ rtx insn = get_last_insn ();
/* Mark the continue-point at the top of the loop if none elsewhere. */
if (start_label == loop_stack->data.loop.continue_label)
@@ -2040,16 +2038,33 @@ expand_end_loop ()
do_pending_stack_adjust ();
- /* If optimizing, perhaps reorder the loop. If the loop
- starts with a conditional exit, roll that to the end
- where it will optimize together with the jump back.
+ /* If optimizing, perhaps reorder the loop. If the loop starts with
+ a loop exit, roll that to the end where it will optimize together
+ with the jump back.
+
+ We look for the conditional branch to the exit, except that once
+ we find such a branch, we don't look past 30 instructions.
+
+ In more detail, if the loop presently looks like this (in pseudo-C):
+
+ start_label:
+ if (test) goto end_label;
+ body;
+ goto start_label;
+ end_label:
+
+ transform it to look like:
- We look for the last conditional branch to the exit that we encounter
- before hitting 30 insns or a CALL_INSN. If we see an unconditional
- branch to the exit first, use it.
+ goto start_label;
+ newstart_label:
+ body;
+ start_label:
+ if (test) goto end_label;
+ goto newstart_label;
+ end_label:
- We must also stop at NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes
- because moving them is not valid. */
+ Here, the `test' may actually consist of some reasonably complex
+ code, terminating in a test. */
if (optimize
&&
@@ -2058,18 +2073,48 @@ expand_end_loop ()
&& SET_DEST (PATTERN (insn)) == pc_rtx
&& GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE))
{
+ int eh_regions = 0;
+ int num_insns = 0;
+ rtx last_test_insn = NULL_RTX;
+
/* Scan insns from the top of the loop looking for a qualified
conditional exit. */
for (insn = NEXT_INSN (loop_stack->data.loop.start_label); insn;
insn = NEXT_INSN (insn))
{
- if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == CODE_LABEL)
- break;
+ if (GET_CODE (insn) == NOTE)
+ {
+ if (optimize < 2
+ && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
+ /* The code that actually moves the exit test will
+ carefully leave BLOCK notes in their original
+ location. That means, however, that we can't debug
+ the exit test itself. So, we refuse to move code
+ containing BLOCK notes at low optimization levels. */
+ break;
+
+ if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
+ ++eh_regions;
+ else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
+ {
+ --eh_regions;
+ if (eh_regions < 0)
+ /* We've come to the end of an EH region, but
+ never saw the beginning of that region. That
+ means that an EH region begins before the top
+ of the loop, and ends in the middle of it. The
+ existence of such a situation violates a basic
+ assumption in this code, since that would imply
+ that even when EH_REGIONS is zero, we might
+ move code out of an exception region. */
+ abort ();
+ }
- if (GET_CODE (insn) == NOTE
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
- break;
+ /* We already know this INSN is a NOTE, so there's no
+ point in looking at it to see if it's a JUMP. */
+ continue;
+ }
if (GET_CODE (insn) == JUMP_INSN || GET_CODE (insn) == INSN)
num_insns++;
@@ -2077,31 +2122,76 @@ expand_end_loop ()
if (last_test_insn && num_insns > 30)
break;
- if (GET_CODE (insn) == JUMP_INSN && GET_CODE (PATTERN (insn)) == SET
- && SET_DEST (PATTERN (insn)) == pc_rtx
- && GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE
- && ((GET_CODE (XEXP (SET_SRC (PATTERN (insn)), 1)) == LABEL_REF
- && ((XEXP (XEXP (SET_SRC (PATTERN (insn)), 1), 0)
- == loop_stack->data.loop.end_label)
- || (XEXP (XEXP (SET_SRC (PATTERN (insn)), 1), 0)
- == loop_stack->data.loop.alt_end_label)))
- || (GET_CODE (XEXP (SET_SRC (PATTERN (insn)), 2)) == LABEL_REF
- && ((XEXP (XEXP (SET_SRC (PATTERN (insn)), 2), 0)
- == loop_stack->data.loop.end_label)
- || (XEXP (XEXP (SET_SRC (PATTERN (insn)), 2), 0)
- == loop_stack->data.loop.alt_end_label)))))
- last_test_insn = insn;
-
- if (last_test_insn == 0 && GET_CODE (insn) == JUMP_INSN
+ if (eh_regions > 0)
+ /* We don't want to move a partial EH region. Consider:
+
+ while ( ( { try {
+ if (cond ()) 0;
+ else {
+ bar();
+ 1;
+ }
+ } catch (...) {
+ 1;
+ } )) {
+ body;
+ }
+
+ This isn't legal C++, but here's what it's supposed to
+ mean: if cond() is true, stop looping. Otherwise,
+ call bar, and keep looping. In addition, if cond
+ throws an exception, catch it and keep looping. Such
+ constructs are certainy legal in LISP.
+
+ We should not move the `if (cond()) 0' test since then
+ the EH-region for the try-block would be broken up.
+ (In this case we would the EH_BEG note for the `try'
+ and `if cond()' but not the call to bar() or the
+ EH_END note.)
+
+ So we don't look for tests within an EH region. */
+ continue;
+
+ if (GET_CODE (insn) == JUMP_INSN
&& GET_CODE (PATTERN (insn)) == SET
- && SET_DEST (PATTERN (insn)) == pc_rtx
- && GET_CODE (SET_SRC (PATTERN (insn))) == LABEL_REF
- && ((XEXP (SET_SRC (PATTERN (insn)), 0)
- == loop_stack->data.loop.end_label)
- || (XEXP (SET_SRC (PATTERN (insn)), 0)
- == loop_stack->data.loop.alt_end_label)))
- /* Include BARRIER. */
- last_test_insn = NEXT_INSN (insn);
+ && SET_DEST (PATTERN (insn)) == pc_rtx)
+ {
+ /* This is indeed a jump. */
+ rtx dest1 = NULL_RTX;
+ rtx dest2 = NULL_RTX;
+ rtx potential_last_test;
+ if (GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE)
+ {
+ /* A conditional jump. */
+ dest1 = XEXP (SET_SRC (PATTERN (insn)), 1);
+ dest2 = XEXP (SET_SRC (PATTERN (insn)), 2);
+ potential_last_test = insn;
+ }
+ else
+ {
+ /* An unconditional jump. */
+ dest1 = SET_SRC (PATTERN (insn));
+ /* Include the BARRIER after the JUMP. */
+ potential_last_test = NEXT_INSN (insn);
+ }
+
+ do {
+ if (dest1 && GET_CODE (dest1) == LABEL_REF
+ && ((XEXP (dest1, 0)
+ == loop_stack->data.loop.alt_end_label)
+ || (XEXP (dest1, 0)
+ == loop_stack->data.loop.end_label)))
+ {
+ last_test_insn = potential_last_test;
+ break;
+ }
+
+ /* If this was a conditional jump, there may be
+ another label at which we should look. */
+ dest1 = dest2;
+ dest2 = NULL_RTX;
+ } while (dest1);
+ }
}
if (last_test_insn != 0 && last_test_insn != get_last_insn ())
@@ -2111,6 +2201,7 @@ expand_end_loop ()
to jump to there. */
register rtx newstart_label = gen_label_rtx ();
register rtx start_move = start_label;
+ rtx next_insn;
/* If the start label is preceded by a NOTE_INSN_LOOP_CONT note,
then we want to move this note also. */
@@ -2120,7 +2211,38 @@ expand_end_loop ()
start_move = PREV_INSN (start_move);
emit_label_after (newstart_label, PREV_INSN (start_move));
- reorder_insns (start_move, last_test_insn, get_last_insn ());
+
+ /* Actually move the insns. Start at the beginning, and
+ keep copying insns until we've copied the
+ last_test_insn. */
+ for (insn = start_move; insn; insn = next_insn)
+ {
+ /* Figure out which insn comes after this one. We have
+ to do this before we move INSN. */
+ if (insn == last_test_insn)
+ /* We've moved all the insns. */
+ next_insn = NULL_RTX;
+ else
+ next_insn = NEXT_INSN (insn);
+
+ if (GET_CODE (insn) == NOTE
+ && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
+ /* We don't want to move NOTE_INSN_BLOCK_BEGs or
+ NOTE_INSN_BLOCK_ENDs because the correct generation
+ of debugging information depends on these appearing
+ in the same order in the RTL and in the tree
+ structure, where they are represented as BLOCKs.
+ So, we don't move block notes. Of course, moving
+ the code inside the block is likely to make it
+ impossible to debug the instructions in the exit
+ test, but such is the price of optimization. */
+ continue;
+
+ /* Move the INSN. */
+ reorder_insns (insn, insn, get_last_insn ());
+ }
+
emit_jump_insn_after (gen_jump (start_label),
PREV_INSN (newstart_label));
emit_barrier_after (PREV_INSN (newstart_label));
@@ -2569,7 +2691,7 @@ expand_return (retval)
int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (retval_rhs)),BITS_PER_WORD);
rtx *result_pseudos = (rtx *) alloca (sizeof (rtx) * n_regs);
- rtx result_reg, src, dst;
+ rtx result_reg, src = NULL_RTX, dst = NULL_RTX;
rtx result_val = expand_expr (retval_rhs, NULL_RTX, VOIDmode, 0);
enum machine_mode tmpmode, result_reg_mode;
@@ -3295,6 +3417,8 @@ expand_decl (decl)
if (flag_float_store && TREE_CODE (type) == REAL_TYPE)
MEM_VOLATILE_P (DECL_RTL (decl)) = 1;
#endif
+
+ MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl);
}
else
/* Dynamic-size object: must push space on the stack. */
@@ -4640,11 +4764,11 @@ check_for_full_enumeration_handling (type)
if (!chain)
{
if (TYPE_NAME (type) == 0)
- warning ("case value `%d' not in enumerated type",
- TREE_INT_CST_LOW (n->low));
+ warning ("case value `%ld' not in enumerated type",
+ (long) TREE_INT_CST_LOW (n->low));
else
- warning ("case value `%d' not in enumerated type `%s'",
- TREE_INT_CST_LOW (n->low),
+ warning ("case value `%ld' not in enumerated type `%s'",
+ (long) TREE_INT_CST_LOW (n->low),
IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
== IDENTIFIER_NODE)
? TYPE_NAME (type)
@@ -4660,11 +4784,11 @@ check_for_full_enumeration_handling (type)
if (!chain)
{
if (TYPE_NAME (type) == 0)
- warning ("case value `%d' not in enumerated type",
- TREE_INT_CST_LOW (n->high));
+ warning ("case value `%ld' not in enumerated type",
+ (long) TREE_INT_CST_LOW (n->high));
else
- warning ("case value `%d' not in enumerated type `%s'",
- TREE_INT_CST_LOW (n->high),
+ warning ("case value `%ld' not in enumerated type `%s'",
+ (long) TREE_INT_CST_LOW (n->high),
IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
== IDENTIFIER_NODE)
? TYPE_NAME (type)
@@ -5531,11 +5655,11 @@ emit_case_nodes (index, node, default_label, index_type)
{
/* If INDEX has an unsigned type, we must make unsigned branches. */
int unsignedp = TREE_UNSIGNED (index_type);
- typedef rtx rtx_function ();
- rtx_function *gen_bgt_pat = unsignedp ? gen_bgtu : gen_bgt;
- rtx_function *gen_bge_pat = unsignedp ? gen_bgeu : gen_bge;
- rtx_function *gen_blt_pat = unsignedp ? gen_bltu : gen_blt;
- rtx_function *gen_ble_pat = unsignedp ? gen_bleu : gen_ble;
+ typedef rtx rtx_fn ();
+ rtx_fn *gen_bgt_pat = unsignedp ? gen_bgtu : gen_bgt;
+ rtx_fn *gen_bge_pat = unsignedp ? gen_bgeu : gen_bge;
+ rtx_fn *gen_blt_pat = unsignedp ? gen_bltu : gen_blt;
+ rtx_fn *gen_ble_pat = unsignedp ? gen_bleu : gen_ble;
enum machine_mode mode = GET_MODE (index);
/* See if our parents have already tested everything for us.
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 1384d0026e9..d918496dbda 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -23,10 +23,10 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "tree.h"
+#include "rtl.h"
#include "flags.h"
#include "except.h"
#include "function.h"
-#include "rtl.h"
#include "expr.h"
#include "toplev.h"
#include "ggc.h"
@@ -550,6 +550,11 @@ layout_record (rec)
TYPE_ALIGN (rec) = MAX (TYPE_ALIGN (rec), record_align);
#endif
+ /* Record the un-rounded size in the binfo node. But first we check
+ the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */
+ if (TYPE_BINFO (rec) && TREE_VEC_LENGTH (TYPE_BINFO (rec)) > 6)
+ TYPE_BINFO_SIZE (rec) = TYPE_SIZE (rec);
+
#ifdef ROUND_TYPE_SIZE
TYPE_SIZE (rec) = ROUND_TYPE_SIZE (rec, TYPE_SIZE (rec), TYPE_ALIGN (rec));
#else
@@ -716,11 +721,13 @@ layout_type (type)
TYPE_MODE (type) = smallest_mode_for_size (TYPE_PRECISION (type),
MODE_INT);
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
+ TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
break;
case REAL_TYPE:
TYPE_MODE (type) = mode_for_size (TYPE_PRECISION (type), MODE_FLOAT, 0);
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
+ TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
break;
case COMPLEX_TYPE:
@@ -731,29 +738,34 @@ layout_type (type)
? MODE_COMPLEX_INT : MODE_COMPLEX_FLOAT),
0);
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
+ TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
break;
case VOID_TYPE:
TYPE_SIZE (type) = size_zero_node;
+ TYPE_SIZE_UNIT (type) = size_zero_node;
TYPE_ALIGN (type) = 1;
TYPE_MODE (type) = VOIDmode;
break;
case OFFSET_TYPE:
TYPE_SIZE (type) = bitsize_int (POINTER_SIZE, 0L);
+ TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
TYPE_MODE (type) = ptr_mode;
break;
case FUNCTION_TYPE:
case METHOD_TYPE:
TYPE_MODE (type) = mode_for_size (2 * POINTER_SIZE, MODE_INT, 0);
- TYPE_SIZE (type) = size_int (2 * POINTER_SIZE);
+ TYPE_SIZE (type) = bitsize_int (2 * POINTER_SIZE, 0);
+ TYPE_SIZE_UNIT (type) = size_int ((2 * POINTER_SIZE) / BITS_PER_UNIT);
break;
case POINTER_TYPE:
case REFERENCE_TYPE:
TYPE_MODE (type) = ptr_mode;
TYPE_SIZE (type) = bitsize_int (POINTER_SIZE, 0L);
+ TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
TREE_UNSIGNED (type) = 1;
TYPE_PRECISION (type) = POINTER_SIZE;
break;
@@ -772,6 +784,7 @@ layout_type (type)
tree ub = TYPE_MAX_VALUE (index);
tree lb = TYPE_MIN_VALUE (index);
tree length;
+ tree element_size;
/* If UB is max (lb - 1, x), remove the MAX_EXPR since the
test for negative below covers it. */
@@ -804,8 +817,34 @@ layout_type (type)
&& TREE_CODE (TYPE_MAX_VALUE (index)) != INTEGER_CST)
length = size_binop (MAX_EXPR, length, size_zero_node);
- TYPE_SIZE (type) = size_binop (MULT_EXPR, TYPE_SIZE (element),
- length);
+ /* Special handling for arrays of bits (for Chill). */
+ element_size = TYPE_SIZE (element);
+ if (TYPE_PACKED (type) && INTEGRAL_TYPE_P (element))
+ {
+ HOST_WIDE_INT maxvalue, minvalue;
+ maxvalue = TREE_INT_CST_LOW (TYPE_MAX_VALUE (element));
+ minvalue = TREE_INT_CST_LOW (TYPE_MIN_VALUE (element));
+ if (maxvalue - minvalue == 1
+ && (maxvalue == 1 || maxvalue == 0))
+ element_size = integer_one_node;
+ }
+
+ TYPE_SIZE (type) = size_binop (MULT_EXPR, element_size, length);
+
+ /* If we know the size of the element, calculate the total
+ size directly, rather than do some division thing below.
+ This optimization helps Fortran assumed-size arrays
+ (where the size of the array is determined at runtime)
+ substantially.
+ Note that we can't do this in the case where the size of
+ the elements is one bit since TYPE_SIZE_UNIT cannot be
+ set correctly in that case. */
+ if (TYPE_SIZE_UNIT (element) != 0
+ && element_size != integer_one_node)
+ {
+ TYPE_SIZE_UNIT (type)
+ = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (element), length);
+ }
}
/* Now round the alignment and size,
@@ -820,8 +859,15 @@ layout_type (type)
#ifdef ROUND_TYPE_SIZE
if (TYPE_SIZE (type) != 0)
- TYPE_SIZE (type)
- = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
+ {
+ tree tmp;
+ tmp = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
+ /* If the rounding changed the size of the type, remove any
+ pre-calculated TYPE_SIZE_UNIT. */
+ if (simple_cst_equal (TYPE_SIZE (type), tmp) != 1)
+ TYPE_SIZE_UNIT (type) = NULL;
+ TYPE_SIZE (type) = tmp;
+ }
#endif
TYPE_MODE (type) = BLKmode;
@@ -979,6 +1025,7 @@ layout_type (type)
else
TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
TYPE_SIZE (type) = bitsize_int (rounded_size, 0L);
+ TYPE_SIZE_UNIT (type) = size_int (rounded_size / BITS_PER_UNIT);
TYPE_ALIGN (type) = alignment;
TYPE_PRECISION (type) = size_in_bits;
}
@@ -1011,6 +1058,19 @@ layout_type (type)
if (TYPE_SIZE (type) != 0 && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
TYPE_SIZE (type) = variable_size (TYPE_SIZE (type));
+ /* If we failed to find a simple way to calculate the unit size
+ of the type above, find it by division. */
+ if (TYPE_SIZE_UNIT (type) == 0 && TYPE_SIZE (type) != 0)
+ {
+ TYPE_SIZE_UNIT (type) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type),
+ size_int (BITS_PER_UNIT));
+ }
+
+ /* Once again evaluate only once, either now or as soon as safe. */
+ if (TYPE_SIZE_UNIT (type) != 0
+ && TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST)
+ TYPE_SIZE_UNIT (type) = variable_size (TYPE_SIZE_UNIT (type));
+
/* Also layout any other variants of the type. */
if (TYPE_NEXT_VARIANT (type)
|| type != TYPE_MAIN_VARIANT (type))
@@ -1018,6 +1078,7 @@ layout_type (type)
tree variant;
/* Record layout info of this variant. */
tree size = TYPE_SIZE (type);
+ tree size_unit = TYPE_SIZE_UNIT (type);
int align = TYPE_ALIGN (type);
enum machine_mode mode = TYPE_MODE (type);
@@ -1027,6 +1088,7 @@ layout_type (type)
variant = TYPE_NEXT_VARIANT (variant))
{
TYPE_SIZE (variant) = size;
+ TYPE_SIZE_UNIT (variant) = size_unit;
TYPE_ALIGN (variant) = align;
TYPE_MODE (variant) = mode;
}
@@ -1124,6 +1186,8 @@ set_sizetype (type)
individually in each front end. */
if (! bitsizetype)
bitsizetype = make_node (INTEGER_TYPE);
+ if (TYPE_NAME (sizetype) && ! TYPE_NAME (bitsizetype))
+ TYPE_NAME (bitsizetype) = TYPE_NAME (sizetype);
precision = oprecision + BITS_PER_UNIT_LOG + 1;
/* However, when cross-compiling from a 32 bit to a 64 bit host,
diff --git a/gcc/stupid.c b/gcc/stupid.c
index d064f979e87..cd1329f83d7 100644
--- a/gcc/stupid.c
+++ b/gcc/stupid.c
@@ -47,8 +47,12 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "hard-reg-set.h"
+#include "basic-block.h"
#include "regs.h"
+#include "insn-config.h"
+#include "reload.h"
#include "flags.h"
+#include "toplev.h"
/* Vector mapping INSN_UIDs to suids.
The suids are like uids but increase monotonically always.
@@ -76,9 +80,21 @@ static int last_setjmp_suid;
static int *reg_where_dead;
+/* Likewise, but point to the insn_chain structure of the insn at which
+ the reg dies. */
+static struct insn_chain **reg_where_dead_chain;
+
/* Element N is suid of insn where life span of pseudo reg N begins. */
+static int *reg_where_born_exact;
+
+/* Element N is 1 if the birth of pseudo reg N is due to a CLOBBER,
+ 0 otherwise. */
+static int *reg_where_born_clobber;
-static int *reg_where_born;
+/* Return the suid of the insn where the register is born, or the suid
+ of the insn before if the birth is due to a CLOBBER. */
+#define REG_WHERE_BORN(N) \
+ (reg_where_born_exact[(N)] - reg_where_born_clobber[(N)])
/* Numbers of pseudo-regs to be allocated, highest priority first. */
@@ -110,7 +126,43 @@ static HARD_REG_SET *after_insn_hard_regs;
static int stupid_reg_compare PROTO((const GENERIC_PTR,const GENERIC_PTR));
static int stupid_find_reg PROTO((int, enum reg_class, enum machine_mode,
int, int, int));
-static void stupid_mark_refs PROTO((rtx, rtx));
+static void stupid_mark_refs PROTO((rtx, struct insn_chain *));
+static void find_clobbered_regs PROTO((rtx, rtx));
+
+/* For communication between stupid_life_analysis and find_clobbered_regs. */
+static struct insn_chain *current_chain;
+
+/* This function, called via note_stores, marks any hard registers that are
+ clobbered in an insn as being live in the live_after and live_before fields
+ of the appropriate insn_chain structure. */
+
+static void
+find_clobbered_regs (reg, setter)
+ rtx reg, setter;
+{
+ int regno, nregs;
+ if (setter == 0 || GET_CODE (setter) != CLOBBER)
+ return;
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+
+ if (GET_CODE (reg) != REG)
+ return;
+ regno = REGNO (reg);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ return;
+
+ if (GET_MODE (reg) == VOIDmode)
+ abort ();
+ else
+ nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
+ while (nregs-- > 0)
+ {
+ SET_REGNO_REG_SET (current_chain->live_after, regno);
+ SET_REGNO_REG_SET (current_chain->live_before, regno++);
+ }
+}
/* Stupid life analysis is for the case where only variables declared
`register' go in registers. For this case, we mark all
@@ -134,7 +186,7 @@ stupid_life_analysis (f, nregs, file)
bzero (regs_ever_live, sizeof regs_ever_live);
- regs_live = (char *) alloca (nregs);
+ regs_live = (char *) xmalloc (nregs);
/* First find the last real insn, and count the number of insns,
and assign insns their suids. */
@@ -144,7 +196,7 @@ stupid_life_analysis (f, nregs, file)
i = INSN_UID (insn);
max_uid = i + 1;
- uid_suid = (int *) alloca ((i + 1) * sizeof (int));
+ uid_suid = (int *) xmalloc ((i + 1) * sizeof (int));
/* Compute the mapping from uids to suids.
Suids are numbers assigned to insns, like uids,
@@ -167,19 +219,25 @@ stupid_life_analysis (f, nregs, file)
/* Allocate tables to record info about regs. */
- reg_where_dead = (int *) alloca (nregs * sizeof (int));
+ reg_where_dead = (int *) xmalloc (nregs * sizeof (int));
bzero ((char *) reg_where_dead, nregs * sizeof (int));
- reg_where_born = (int *) alloca (nregs * sizeof (int));
- bzero ((char *) reg_where_born, nregs * sizeof (int));
+ reg_where_born_exact = (int *) xmalloc (nregs * sizeof (int));
+ bzero ((char *) reg_where_born_exact, nregs * sizeof (int));
- reg_order = (int *) alloca (nregs * sizeof (int));
+ reg_where_born_clobber = (int *) xmalloc (nregs * sizeof (int));
+ bzero ((char *) reg_where_born_clobber, nregs * sizeof (int));
+
+ reg_where_dead_chain = (struct insn_chain **) xmalloc (nregs * sizeof (struct insn_chain *));
+ bzero ((char *) reg_where_dead_chain, nregs * sizeof (struct insn_chain *));
+
+ reg_order = (int *) xmalloc (nregs * sizeof (int));
bzero ((char *) reg_order, nregs * sizeof (int));
- regs_change_size = (char *) alloca (nregs * sizeof (char));
+ regs_change_size = (char *) xmalloc (nregs * sizeof (char));
bzero ((char *) regs_change_size, nregs * sizeof (char));
- regs_crosses_setjmp = (char *) alloca (nregs * sizeof (char));
+ regs_crosses_setjmp = (char *) xmalloc (nregs * sizeof (char));
bzero ((char *) regs_crosses_setjmp, nregs * sizeof (char));
/* Allocate the reg_renumber array */
@@ -188,7 +246,7 @@ stupid_life_analysis (f, nregs, file)
reg_renumber[i] = i;
after_insn_hard_regs
- = (HARD_REG_SET *) alloca (max_suid * sizeof (HARD_REG_SET));
+ = (HARD_REG_SET *) xmalloc (max_suid * sizeof (HARD_REG_SET));
bzero ((char *) after_insn_hard_regs, max_suid * sizeof (HARD_REG_SET));
@@ -209,11 +267,15 @@ stupid_life_analysis (f, nregs, file)
Also find where each hard register is live
and record that info in after_insn_hard_regs.
regs_live[I] is 1 if hard reg I is live
- at the current point in the scan. */
+ at the current point in the scan.
+
+ Build reload_insn_chain while we're walking the insns. */
+ reload_insn_chain = 0;
for (insn = last; insn; insn = PREV_INSN (insn))
{
register HARD_REG_SET *p = after_insn_hard_regs + INSN_SUID (insn);
+ struct insn_chain *chain;
/* Copy the info in regs_live into the element of after_insn_hard_regs
for the current position in the rtl code. */
@@ -222,12 +284,27 @@ stupid_life_analysis (f, nregs, file)
if (regs_live[i])
SET_HARD_REG_BIT (*p, i);
+ if (GET_CODE (insn) != NOTE && GET_CODE (insn) != BARRIER)
+ {
+ chain = new_insn_chain ();
+ if (reload_insn_chain)
+ reload_insn_chain->prev = chain;
+ chain->next = reload_insn_chain;
+ chain->prev = 0;
+ reload_insn_chain = chain;
+ chain->block = 0;
+ chain->insn = insn;
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (regs_live[i])
+ SET_REGNO_REG_SET (chain->live_before, i);
+ }
+
/* Update which hard regs are currently live
and also the birth and death suids of pseudo regs
based on the pattern of this insn. */
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
- stupid_mark_refs (PATTERN (insn), insn);
+ stupid_mark_refs (PATTERN (insn), chain);
if (GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
@@ -265,8 +342,23 @@ stupid_life_analysis (f, nregs, file)
/* It is important that this be done after processing the insn's
pattern because we want the function result register to still
be live if it's also used to pass arguments. */
- stupid_mark_refs (CALL_INSN_FUNCTION_USAGE (insn), insn);
+ stupid_mark_refs (CALL_INSN_FUNCTION_USAGE (insn), chain);
}
+
+ if (GET_CODE (insn) != NOTE && GET_CODE (insn) != BARRIER)
+ {
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (regs_live[i])
+ SET_REGNO_REG_SET (chain->live_after, i);
+
+ /* The regs_live array doesn't say anything about hard registers
+ clobbered by this insn. So we need an extra pass over the
+ pattern. */
+ current_chain = chain;
+ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
+ note_stores (PATTERN (insn), find_clobbered_regs);
+ }
+
if (GET_CODE (insn) == JUMP_INSN && computed_jump_p (insn))
current_function_has_computed_jump = 1;
}
@@ -288,8 +380,10 @@ stupid_life_analysis (f, nregs, file)
/* Some regnos disappear from the rtl. Ignore them to avoid crash.
Also don't allocate registers that cross a setjmp, or live across
- a call if this function receives a nonlocal goto. */
+ a call if this function receives a nonlocal goto.
+ Also ignore registers we didn't see during the scan. */
if (regno_reg_rtx[r] == 0 || regs_crosses_setjmp[r]
+ || (reg_where_born_exact[r] == 0 && reg_where_dead[r] == 0)
|| (REG_N_CALLS_CROSSED (r) > 0
&& current_function_has_nonlocal_label))
continue;
@@ -299,7 +393,7 @@ stupid_life_analysis (f, nregs, file)
reg_renumber[r] = stupid_find_reg (REG_N_CALLS_CROSSED (r),
reg_preferred_class (r),
PSEUDO_REGNO_MODE (r),
- reg_where_born[r],
+ REG_WHERE_BORN (r),
reg_where_dead[r],
regs_change_size[r]);
@@ -308,13 +402,52 @@ stupid_life_analysis (f, nregs, file)
reg_renumber[r] = stupid_find_reg (REG_N_CALLS_CROSSED (r),
reg_alternate_class (r),
PSEUDO_REGNO_MODE (r),
- reg_where_born[r],
+ REG_WHERE_BORN (r),
reg_where_dead[r],
regs_change_size[r]);
}
+ /* Fill in the pseudo reg life information into the insn chain. */
+ for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
+ {
+ struct insn_chain *chain;
+ int regno;
+
+ regno = reg_renumber[i];
+ if (regno < 0)
+ continue;
+
+ chain = reg_where_dead_chain[i];
+ if (reg_where_dead[i] > INSN_SUID (chain->insn))
+ SET_REGNO_REG_SET (chain->live_after, i);
+
+ while (INSN_SUID (chain->insn) > reg_where_born_exact[i])
+ {
+ SET_REGNO_REG_SET (chain->live_before, i);
+ chain = chain->prev;
+ if (!chain)
+ break;
+ SET_REGNO_REG_SET (chain->live_after, i);
+ }
+
+ if (INSN_SUID (chain->insn) == reg_where_born_exact[i]
+ && reg_where_born_clobber[i])
+ SET_REGNO_REG_SET (chain->live_before, i);
+ }
+
if (file)
dump_flow_info (file);
+
+ free (regs_live);
+ free (uid_suid);
+ free (reg_where_dead);
+ free (reg_where_born_exact);
+ free (reg_where_born_clobber);
+ free (reg_where_dead_chain);
+ free (reg_order);
+ free (regs_change_size);
+ free (regs_crosses_setjmp);
+ free (after_insn_hard_regs);
}
/* Comparison function for qsort.
@@ -326,8 +459,8 @@ stupid_reg_compare (r1p, r2p)
const GENERIC_PTR r2p;
{
register int r1 = *(int *)r1p, r2 = *(int *)r2p;
- register int len1 = reg_where_dead[r1] - reg_where_born[r1];
- register int len2 = reg_where_dead[r2] - reg_where_born[r2];
+ register int len1 = reg_where_dead[r1] - REG_WHERE_BORN (r1);
+ register int len2 = reg_where_dead[r2] - REG_WHERE_BORN (r2);
int tem;
tem = len2 - len1;
@@ -460,12 +593,14 @@ stupid_find_reg (call_preserved, class, mode,
INSN is the current insn, supplied so we can find its suid. */
static void
-stupid_mark_refs (x, insn)
- rtx x, insn;
+stupid_mark_refs (x, chain)
+ rtx x;
+ struct insn_chain *chain;
{
register RTX_CODE code;
register char *fmt;
register int regno, i;
+ rtx insn = chain->insn;
if (x == 0)
return;
@@ -520,7 +655,11 @@ stupid_mark_refs (x, insn)
the clobbering insn. When setting, just after. */
int where_born = INSN_SUID (insn) - (code == CLOBBER);
- reg_where_born[regno] = where_born;
+ reg_where_born_exact[regno] = INSN_SUID (insn);
+ reg_where_born_clobber[regno] = (code == CLOBBER);
+
+ if (reg_where_dead_chain[regno] == 0)
+ reg_where_dead_chain[regno] = chain;
/* The reg must live at least one insn even
in it is never again used--because it has to go
@@ -563,9 +702,9 @@ stupid_mark_refs (x, insn)
If setting a SUBREG, we treat the entire reg as *used*. */
if (code == SET)
{
- stupid_mark_refs (SET_SRC (x), insn);
+ stupid_mark_refs (SET_SRC (x), chain);
if (GET_CODE (SET_DEST (x)) != REG)
- stupid_mark_refs (SET_DEST (x), insn);
+ stupid_mark_refs (SET_DEST (x), chain);
}
return;
}
@@ -598,12 +737,14 @@ stupid_mark_refs (x, insn)
{
/* Pseudo reg: record first use, last use and number of uses. */
- reg_where_born[regno] = INSN_SUID (insn);
+ reg_where_born_exact[regno] = INSN_SUID (insn);
+ reg_where_born_clobber[regno] = 0;
REG_N_REFS (regno)++;
if (regs_live[regno] == 0)
{
regs_live[regno] = 1;
reg_where_dead[regno] = INSN_SUID (insn);
+ reg_where_dead_chain[regno] = chain;
}
}
return;
@@ -615,12 +756,12 @@ stupid_mark_refs (x, insn)
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
- stupid_mark_refs (XEXP (x, i), insn);
+ stupid_mark_refs (XEXP (x, i), chain);
if (fmt[i] == 'E')
{
register int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- stupid_mark_refs (XVECEXP (x, i, j), insn);
+ stupid_mark_refs (XVECEXP (x, i, j), chain);
}
}
}
diff --git a/gcc/system.h b/gcc/system.h
index a3ff5bd3058..0e78de09681 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -7,11 +7,24 @@
#ifndef __GCC_SYSTEM_H__
#define __GCC_SYSTEM_H__
+/* We must include stdarg.h/varargs.h before stdio.h. */
+#ifdef __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
#include <stdio.h>
+
+/* Define a generic NULL if one hasn't already been defined. */
+#ifndef NULL
+#define NULL 0
+#endif
+
#include <ctype.h>
/* Jim Meyering writes:
-
+
"... Some ctype macros are valid only for character codes that
isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
using /bin/cc or gcc but without giving an ansi option). So, all
@@ -20,21 +33,21 @@
macros don't need to be guarded with references to isascii. ...
Defining isascii to 1 should let any compiler worth its salt
eliminate the && through constant folding."
-
+
Bruno Haible adds:
-
+
"... Furthermore, isupper(c) etc. have an undefined result if c is
outside the range -1 <= c <= 255. One is tempted to write isupper(c)
with c being of type `char', but this is wrong if c is an 8-bit
character >= 128 which gets sign-extended to a negative value.
The macro ISUPPER protects against this as well." */
-
+
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
-
+
#ifdef isblank
# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
#else
@@ -45,7 +58,7 @@
#else
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c))
#endif
-
+
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
@@ -56,7 +69,7 @@
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-
+
/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
- It's guaranteed to evaluate its argument exactly once.
@@ -75,11 +88,16 @@
extern int errno;
#endif
-#ifdef HAVE_STRING_H
+#ifdef STRING_WITH_STRINGS
# include <string.h>
+# include <strings.h>
#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
# endif
#endif
@@ -202,14 +220,69 @@ extern long atol();
extern void free ();
#endif
+#ifdef NEED_DECLARATION_GETCWD
+extern char *getcwd ();
+#endif
+
#ifdef NEED_DECLARATION_GETENV
extern char *getenv ();
#endif
+#ifdef NEED_DECLARATION_GETWD
+extern char *getwd ();
+#endif
+
#ifdef NEED_DECLARATION_SBRK
extern char *sbrk ();
#endif
+#ifdef HAVE_STRERROR
+# ifdef NEED_DECLARATION_STRERROR
+# ifndef strerror
+extern char *strerror ();
+# endif
+# endif
+#else /* ! HAVE_STRERROR */
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif /* HAVE_STRERROR */
+
+#ifdef HAVE_STRSIGNAL
+# ifdef NEED_DECLARATION_STRSIGNAL
+# ifndef strsignal
+extern char * strsignal ();
+# endif
+# endif
+#else /* ! HAVE_STRSIGNAL */
+# ifndef SYS_SIGLIST_DECLARED
+# ifndef NO_SYS_SIGLIST
+extern char * sys_siglist[];
+# endif
+# endif
+#endif /* HAVE_STRSIGNAL */
+
+#ifdef HAVE_GETRLIMIT
+# ifdef NEED_DECLARATION_GETRLIMIT
+# ifndef getrlimit
+extern int getrlimit ();
+# endif
+# endif
+#endif
+
+#ifdef HAVE_SETRLIMIT
+# ifdef NEED_DECLARATION_SETRLIMIT
+# ifndef setrlimit
+extern int setrlimit ();
+# endif
+# endif
+#endif
+
+/* HAVE_VOLATILE only refers to the stage1 compiler. We also check
+ __STDC__ and assume gcc sets it and has volatile in stage >=2. */
+#if !defined(HAVE_VOLATILE) && !defined(__STDC__) && !defined(volatile)
+#define volatile
+#endif
+
/* Redefine abort to report an internal error w/o coredump, and reporting the
location of the error in the source file. */
#ifndef abort
@@ -223,7 +296,7 @@ extern char *sbrk ();
#ifdef USE_SYSTEM_ABORT
# ifdef NEED_DECLARATION_ABORT
-void abort ();
+extern void abort ();
# endif
#else
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
@@ -243,4 +316,27 @@ void abort ();
#endif /* USE_SYSTEM_ABORT */
#endif /* !abort */
+
+/* Define a STRINGIFY macro that's right for ANSI or traditional C.
+ HAVE_CPP_STRINGIFY only refers to the stage1 compiler. Assume that
+ (non-traditional) gcc used in stage2 or later has this feature.
+
+ Note: if the argument passed to STRINGIFY is itself a macro, eg
+ #define foo bar, STRINGIFY(foo) will produce "foo", not "bar".
+ Although the __STDC__ case could be made to expand this via a layer
+ of indirection, the traditional C case can not do so. Therefore
+ this behavior is not supported. */
+#ifndef STRINGIFY
+# if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__))
+# define STRINGIFY(STRING) #STRING
+# else
+# define STRINGIFY(STRING) "STRING"
+# endif
+#endif /* ! STRINGIFY */
+
+
+/* These macros are here in preparation for the use of gettext in egcs. */
+#define _(String) String
+#define N_(String) String
+
#endif /* __GCC_SYSTEM_H__ */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a572090a3f4..b15599cd813 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,498 @@
+1998-10-08 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/using4.C: New test. Test using
+ declarations of methods from base classes.
+
+ * g++.old-deja/g++.ns/extern1.C: New test. Extern declarations
+ within functions should introduce names into the innermost
+ enclosing namespace
+
+ * g++.old-deja/g++.other/init7.C: New test. Retry initialization
+ of static locals if first initialization throws
+
+Wed Oct 7 12:00:20 1998 Jim Wilson <wilson@cygnus.com>
+
+ * gcc.c-torture/compile/981007-1.c: New test for irix6 -O0 core dump.
+
+1998-10-06 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.pt/friend35.C: New test. A template function
+ must be declared before its specializations can be named in friend
+ declarations.
+
+1998-10-05 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/u77-test.f: Add regression test for RAND.
+
+ * g77.f-torture/execute/io1.f: New test.
+
+1998-10-04 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.pt/overload5.C: New test; initialize variable
+ with pointer to template function, for which no argument deduction
+ is possible
+
+ * g++.old-deja/g++.pt/overload4.C: New test; passing pointer to
+ specialization of template function as argument to template
+ function
+
+ * g++.old-deja/g++.other/access2.C: New test; Inner class
+ shouldn't have privileged access to Outer's names
+
+1998-10-03 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.pt/friend34.C: New test; name injection of
+ friend template declared within template class conflicts with
+ nested class of the same name
+
+ * g++.old-deja/g++.other/badopt1.C: New test; post-increment
+ is ignored
+
+ * g++.old-deja/g++.other/decl1.C: New test; incorrect parsing of
+ object with direct initializer as function declaration
+
+ * g++.old-deja/g++.other/decl2.C: New test; duplicate initializers
+
+ * g++.old-deja/g++.other/null2.C: New test; conditional operator
+ involving const pointer and NULL produces incorrect result
+
+ * g++.old-deja/g++.other/typename1.C: New test; template-dependent
+ type name without `typename' should be rejected with -pedantic
+
+Fri Oct 2 21:55:58 1998 Richard Henderson <rth@cygnus.com>
+
+ * g++.old-deja/g++.other/addrof1.C: New test.
+
+Thu Oct 1 19:05:20 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/981001-2.c: New test.
+ * gcc.c-torture/compile/981001-3.c: New test.
+ * gcc.c-torture/compile/981001-4.c: New test.
+
+1998-10-01 Robert Lipe <robertl@dgii.com>
+
+ * lib/objc.exp (objc_target_compile): Add -L during compiles for
+ multilibbed hosts. Idea grafted from g77.exp.
+
+1998-09-30 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/u77-test.f (main): Excise `hostnm' to
+ avoid losing on systems which need -lsocket.
+
+1998-09-28 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/bitfld1.C: expected failure
+ * g++.old-deja/g++.other/nested2.C: ditto
+ * g++.old-deja/g++.robertl/eb132.C: no longer an expected failure
+
+1998-09-26 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/bitfld1.C: built-in operator!= should be
+ preferred over template operator!= for enum bitfields
+
+1998-09-18 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/nested2.C: different virtual base classes
+ that happen to have the same base name, but in different scopes,
+ are incorrectly rejected
+
+1998-09-16 Richard Henderson <rth@cygnus.com>
+
+ * g++.old-deja/g++.brendan/array1.C: Size array via arithmetic based
+ on the native word size instead of an integer literal.
+
+1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/static2.C: invocation of static data
+ member of type pointer-to-function denoted as non-static member
+
+ * g++.old-deja/g++.other/typedef5.C: add some more tests involving
+ checks involving function types and aliases
+
+1998-09-12 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/typedef5.C: check whether typedefs can be
+ redefined to the same non-trivial type
+
+ * g++.old-deja/g++.pt/explicit73.C: test for proper
+ namespace-qualification of template specializations declared in
+ other namespaces
+
+ * g++.old-deja/g++.other/friend4.C: check whether it is possible
+ to declare a subset of the specializations of a template function
+ as friends of specializations of a template class
+
+ * g++.old-deja/g++.pt/explicit71.C: make sure specializations of
+ member templates that do not fully specialize the enclosing
+ template class are rejected
+
+1998-09-11 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/u77-test.f: Fix bad consistency checks.
+
+1998-09-08 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/u77-test.f (main): New file, somewhat
+ altered from libf2c/libU77 version.
+
+1998-09-06 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/io0.f: Test formatted direct i/o too.
+
+1998-09-04 Reid M. Pinchback <reidmp@MIT.EDU>, Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.pt/explicit72.C: ensure that char and
+ (un)signed char are different types for template specialization
+ purposes.
+
+Thu Sep 3 00:40:32 1998 Ovidiu Predescu <ovidiu@aracnet.com>
+
+ * lib/{objc.exp,objc-torture.exp}: New files for objc testing harness.
+ * objc: ObjC testsuite.
+
+Mon Aug 31 15:19:32 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lib/c-torture.exp: Add support for
+ torture_eval_before_compile and torture_eval_before_execute
+ variables.
+
+Sun Aug 30 17:38:20 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980626-1.c: Delete this test. We've declared the warning
+ this test triggers valid.
+
+Thu Aug 27 23:59:18 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980827-1.c: New test.
+
+Tue Aug 25 19:42:13 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/980825-1.c: New test.
+
+Mon Aug 24 16:38:52 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/930326-1.x: Fix typo.
+
+1998-08-23 Mark Mitchell <mark@markmitchell.com>
+
+ * lib/old-dejagnu.exp: Make it possible to XFAIL a test that
+ causes an ICE.
+
+Fri Aug 21 23:59:18 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/unsorted/memtst.c: Reduce size of array when
+ STACK_SIZE is defined.
+ * gcc.c-torture/unsorted/stuct.c: Similarly.
+
+ * gcc.c-torture/compile/980821-1.c: New test.
+
+Fri Aug 21 03:14:04 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980526-2.c: Disable for targets with 16bit ints.
+
+1998-08-19 Mark Mitchell <mark@markmitchell.com>
+
+ * lib/old-dejagnu.exp (old-dejagnu): Remove sig6/sig11 handling
+ code.
+
+1998-08-09 Mark Mitchell <mark@markmitchell.com>
+
+ * lib/old-dejagnu.exp: Revise handling of `Internal compiler
+ error'.
+
+Tue Aug 18 19:19:50 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/*.x: Some updates for the h8300 targets.
+
+Sun Aug 16 01:29:19 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/980816-1.c: New test.
+
+ * gcc.dg/980816-1.c: New test.
+
+1998-08-01 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/compile/980729-0.f: New test.
+
+1998-07-30 Ken Raeburn <raeburn@cygnus.com>
+
+ * gcc.c-torture/special/eeprof-1.c: New test, for
+ -finstrument-functions.
+ * gcc.c-torture/special/special.exp: Run it.
+
+Wed Jul 29 00:17:18 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/980729-1.c: New test.
+
+1998-07-26 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/noncompile/980615-0.f: New test.
+
+Sun Jul 26 01:15:56 1998 H.J. Lu (hjl@gnu.org)
+
+ * gcc.dg/980312-1.c: Do link instead of compile.
+ * gcc.dg/980313-1.c: Likewise.
+
+Sun Jul 26 01:05:02 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/980726-1.c: New test.
+
+1998-07-25 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/io0.f: New test.
+
+Fri Jul 17 14:19:32 1998 Nick Clifton <nickc@cygnus.com>
+
+ * gcc.dg/980626-1.c: Expect failures for all toolchains until
+ c-decl.c:grokdeclarator can handle mode attributes.
+
+Thu Jul 16 21:42:50 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980716-1.c: New test.
+
+Mon Jul 13 22:26:37 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/920715-1.x: No longer expected to fail on
+ the mn10200.
+ * gcc.c-torture/execute/strct-varg-1.x: New file. Expect failure on
+ the mn10200.
+ * gcc.c-torture/execute/va-arg-3.x: Similarly.
+ * gcc.c-torture/compile/930326-1.x: Similarly.
+
+1998-07-13 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/auto0.f, g77.f-torture/execute/auto1.f:
+ New test from Craig.
+
+1998-07-12 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/noncompile/980616-0.f: New test.
+
+ * g77.f-torture/execute/970816-3.f: New test from Craig.
+
+Fri Jul 10 23:43:33 1998 Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
+
+ * g++.other/singleton.C: Return error value instead of taking
+ SIGSEGV.
+
+Fri Jul 10 10:02:03 1998 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
+
+ * g++.other/singleton.C: New test. Warning is under dispute.
+ Runtime crash is not.
+
+Thu Jul 9 23:07:45 1998 Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
+
+ * g++.ns/{alias2.C, alias5.C, koenig4.C, lookup3.C ns13.C,
+ ns14.C, ns15.C, template3.C, undef1.C, using4.C, using5.C,
+ using6.C, using7.C}: New namespace tests.
+
+Thu Jul 9 22:44:49 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.other/partspec1.C: test matching of partial
+ specialization with typedef'ed names used as array indexes.
+
+Thu Jul 9 00:38:51 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980709-1.c: New test.
+
+ * gcc.dg/980709-1.c: New test.
+
+Tue Jul 7 13:41:27 1998 Richard Henderson <rth@cygnus.com>
+
+ * gcc.c-torture/execute/bcp-1.c: New test.
+
+Tue Jul 7 11:49:04 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980707-1.c: New test.
+
+Mon Jul 6 18:20:27 1998 Kamil Iskra <iskra@student.uci.agh.edu.pl>
+
+ * gcc.c-torture/compile/980706-1.c: New test.
+
+1998-07-01 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/980701-0.f,
+ g77.f-torture/execute/980701-1.f: New test from Craig.
+
+Wed Jul 1 00:52:51 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/980701-1.c: New test.
+
+ * gcc.c-torture/execute/980701-1.c: New test.
+
+Tue Jun 30 11:51:42 1998 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-ka
+rlsruhe.de>
+
+ * g++.old-deja/g++.robertl/eb132.C: New test.
+ * g++.old-deja/g++.robertl/eb133.C: Likewise.
+
+1998-06-29 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/980628-7.f,
+ g77.f-torture/execute/980628-8.f,
+ g77.f-torture/execute/980628-9.f,
+ g77.f-torture/execute/980628-10.f: New tests from Craig.
+
+ * g77.f-torture/execute/980628-3.f: Remove mail headers.
+
+Sun Jun 28 12:49:02 1998 Jeffrey A Law (law@cygnus.com)
+
+ * g77.f-torture/execute/980628-4.f: New test from Craig.
+ * g77.f-torture/execute/980628-5.f: Likewise.
+ * g77.f-torture/execute/980628-2.f: Likewise.
+ * g77.f-torture/execute/980628-0.f: Likewise.
+ * g77.f-torture/execute/980628-1.f: Likewise.
+ * g77.f-torture/execute/980628-3.f: Likewise.
+ * g77.f-torture/execute/980628-6.f: Likewise.
+
+Sun Jun 28 00:37:26 1998 Jeffrey A Law (law@cygnus.com)
+
+ * lib/g77.exp (default_g77_version): Tweak to make it work in a build
+ directory when nothing has been installed yet.
+
+Sat Jun 27 23:23:18 1998 Carlo Wood <carlo@runaway.xs4all.nl>
+
+ * gcc.c-torture/special/special.exp: Handle newer versions of
+ dejagnu.
+
+Fri Jun 26 17:57:40 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980626-1.c: New test.
+
+Fri Jun 19 23:26:12 1998 Bruno Haible <haible@ilog.fr>
+
+ * gcc.misc-tests/m-un-2.c: New test.
+ * g++.old-deja/g++.other/warn01.c: Likewise.
+
+Fri Jun 19 14:06:36 1998 Robert Lipe <robertl@dgii.com>
+
+ * gcc.dg/980414-1.c: Move comments outside of ASM to improve
+ compatibility with assmblers with a different comment character.
+ Eliminate use of GAS-specific extensions.
+
+Fri Jun 19 02:05:14 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/ieee/980619-1.c: New test.
+
+Fri Jun 19 00:58:11 1998 Robert Lipe <robertl@dgii.com>
+
+ *lib/g77.exp: Replace search for libf2c.a with search for newly
+ renamed libg2c.a
+
+Wed Jun 17 18:53:12 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980617-1.c: New test.
+
+Fri Jun 12 01:08:49 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980612-1.c: New test.
+
+Mon Jun 8 02:13:42 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980523-1.c: Only test on ppc-linux.
+ * gcc.dg/980526-1.c, gcc.dg/switch-1.c: Likewise.
+
+ * gcc.c-torture/execute/980608-1.c: New test.
+
+Thu Jun 4 01:39:24 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980604-1.c: New test.
+
+Tue Jun 2 20:51:43 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/execute/980602-1.c: New test.
+ * gcc.c-torture/execute/980602-2.c: Likewise.
+
+1998-06-02 Dave Love <d.love@dl.ac.uk>
+
+ * 970125-0.f: Fix per JCB. Add commentary.
+
+Fri May 29 01:10:12 1998 Peter Leven <leven@lpr.e-technik.tu-muenchen.de>
+
+ * gcc.c-torture/execute/ieee/fp-cmp-1.c: Set up signal handler
+ earlier.
+
+Thu May 28 00:17:42 1998 Catherine Moore <clm@cygnus.com>
+
+ * gcc.c-torture/execute/980526-3.c: New test.
+
+1998-05-27 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * g++.old-deja/g++.jason/thunk2.C: Setup this test to be expected to
+ fail on m68k-motorola-sysv and m88k-motorola-sysv3.
+ * g++.old-deja/g++.jason/thunk3.C: Add m68k-motorola-sysv and
+ m88k-motorola-sysv3 to XFAIL.
+
+Tue May 26 23:58:03 1998 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.dg/980526-1.c: New test.
+ * gcc.c-torture/execute/980526-2.c: New test.
+
+Tue May 26 23:40:40 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980523-1.c: Change "ppc" to "powerpc".
+
+ * gcc.c-torture/execute/980526-1.c: New test.
+
+1998-05-26 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/alpha2.f: Add runtime test.
+
+1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * g++.old-deja/old-deja.exp: Strip leading directories.
+
+ * lib/old-dejagnu.exp: All tests fail if we got an internal compiler
+ error for the line. Don't run multiple tests for the same line.
+
+Sat May 23 23:27:10 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980523-1.c: New test.
+
+1998-05-23 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/compile/970915-0.f: New test.
+
+1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
+
+ * lib/old-dejagnu.exp: Ignore C++ "instantiated from" mesages.
+
+Thu May 21 23:23:21 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/980520-1.c: New test.
+
+Wed May 20 14:37:15 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * gcc.dg/980502-1.c: Fix return type.
+
+Wed May 20 11:29:48 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.dg/{980502-1.c, clobbers.c}: New tests.
+ * gcc.c-torture/compile/{980504-1.c, 980506-1.c}: Likewise.
+ * gcc.c-torture/compile/{980506-2.c, 980611-1.c}: Likewise.
+ * gcc.c-torture/execute/{980505-1.c, 980505-2.c, 980506-1.c}: Likewise.
+ * gcc.c-torture/execute/{980506-2.c, 980506-3.c}: Likewise.
+
+1998-05-20 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/980520-1.f: New test.
+
+1998-05-15 Dave Love <d.love@dl.ac.uk>
+
+ * lib/mike-g77.exp: New file.
+
+ * g77.f-torture/noncompile/noncompile.exp,
+ g77.f-torture/noncompile/check0.f: New files.
+
+1998-05-14 Dave Love <d.love@dl.ac.uk>
+
+ * g77.f-torture/execute/short.f, g77.f-torture/execute/le.f,
+ g77.f-torture/execute/exp.f, g77.f-torture/execute/erfc.f,
+ g77.f-torture/execute/dnrm2.f, g77.f-torture/execute/dcomplex.f,
+ g77.f-torture/execute/cpp.F, g77.f-torture/execute/complex_1.f,
+ g77.f-torture/execute/claus.f, g77.f-torture/execute/cabs.f: Call
+ abort where appropriate.
+
Tue May 5 19:20:13 1998 Michael Meissner <meissner@cygnus.com>
* lib/c-torture.exp (TORTURE_OPTIONS): Add -Os to options.
diff --git a/gcc/testsuite/README.gcc b/gcc/testsuite/README.gcc
index 74285058595..c4a9ffa8f01 100644
--- a/gcc/testsuite/README.gcc
+++ b/gcc/testsuite/README.gcc
@@ -1,71 +1,26 @@
-This file contains a list of notes for those writing testcases and those
-writing expect scripts. At present, they're in random order.
-
-Verbosity Levels
-
-- each level adds verbosity so level 2 prints all level 1 and level 2 stuff.
-
-1) Print a one-liner indicating the testcase being run (and maybe special
- compiler options).
-
-2) Print compiler and program invocation including arguments and their output.
- Proc's gcc_load and gcc_start handle the latter two.
-
-3) Print detailed testcase analysis like "Looking for pattern ...", etc.
-
-4) Maximum verbosity. Print anything else of interest.
-
-send_log conventions
+DO NOT PUT NON-PORTABLE TESTCASES IN gcc.c-torture.
-Various messages are stored in gcc.log by the testing framework and we
-try to augment them with some of our own. The format of the framework
-messages are:
+ANY TARGET SPECIFIC TESTCASE MUST HAVE APPROPRIATE CODE TO PREVENT IT FROM
+CAUSING A `FAILURE' ON UNSUPPORTED PLATFORMS.
-PASS: blah blah ...
-FAIL: blah blah ...
+The "torture" tests are meant to be generic tests that can run on any
+target. So you have to be careful about endianness, assumptions about
+sizes of datatypes, etc etc.
-so we use
+For tests that merely need to compile, put them in the "compile" directory.
-XXXX: blah blah ...
+For tests which should give an error, put them in the "noncompile" directory
+and update noncompile.exp appropriately (see examples in noncompile.exp).
-Current messages are:
+For IEEE FP specific tests, put them in execute/ieee.
-EXEC: program being executed (so compiler path and args are recorded)
-STAT: intermediate pass/fail statistics
-
-DO NOT PUT NON-PORTABLE TESTCASES IN gcc.c-torture.
+For execution tests, put them in execute.
-ANY TARGET SPECIFIC TESTCASE MUST HAVE APPROPRIATE CODE TO PREVENT IT FROM
-CAUSING A `FAILURE' ON UNSUPPORTED PLATFORMS.
-
-Test scripts must ignore the compiler messages "path prefix never used"
-and "linker input file unused". Don't let their appearance cause a testcase
-to fail. See lib/dg.exp for the exact regsub to use.
-
-If you're unclear about which directory a testcase should be installed in,
-ask gcc-local.
-
Always use abort() for runtime failures, and exit(0) for success.
The testing harness is set up to watch for these and do something appropriate
(when necessary) for target boards.
-
-Have the text of a fail message be the same as that for pass.
-IE: have
-
- if ...success...
- pass "pr 1234"
- else
- fail "pr 1234"
-
-not
- if ...success...
- pass "pr 1234 passed"
- else
- fail "pr 1234 failed"
+If a test does not fit into the torture framework, use the dg framework.
-This lets test-tool (which drives the nightly tests) do a better job
-at tracking which tests have digressed or been fixed.
-Add more notes here. \ No newline at end of file
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/p12475.C b/gcc/testsuite/g++.old-deja/g++.benjamin/p12475.C
index ee1e39f0203..6e911a384bc 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/p12475.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/p12475.C
@@ -1,5 +1,5 @@
// Build don't link:
// prms-id: 12475
+// excess errors test - XFAIL alpha*-*-* mips64*-*-*
-enum huh { start =-2147483648, next }; // WARNING -
-
+enum huh { start =-2147483648, next }; // WARNING - , XFAIL sparc64-*-* alpha*-*-*
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/warn03.C b/gcc/testsuite/g++.old-deja/g++.benjamin/warn03.C
index 2f3b56fb7f3..b3bd3affc9d 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/warn03.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/warn03.C
@@ -1,7 +1,7 @@
// 980420 bkoz
// from g++/15307, tests for -Wredundant-decls for decls
-// Build don't link: Special g++ Options:
-// -Wredundant-decls
+// Build don't link:
+// Special g++ Options: -Wredundant-decls
//shouldn't crash
extern unsigned char *foo5[];
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/array1.C b/gcc/testsuite/g++.old-deja/g++.brendan/array1.C
index 64924639f6f..3dfa65981fa 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/array1.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/array1.C
@@ -1,7 +1,2 @@
-// Build don't link:
-// Special g++ Options: -fconserve-space -fcommon
-// GROUPS passed array-bindings
-// excess errors test - XFAIL sparc64-*-*
-extern "C" void printf (char *, ...);
-char array[(unsigned) 0x90000000];// ERROR - overflow in array dimension.* , XFAIL sparc64-*-* alpha*-*-*
-int main () { printf ("PASS\n"); return 0; }
+
+char array[~(~0ul>>1)|~(0ul>>3)]; // ERROR - overflow in array dimension.*
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash39.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash39.C
index 67f5538756b..a19187295ec 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash39.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash39.C
@@ -29,5 +29,5 @@ public:
#include <string>
class foo {public: foo () {}};
-class bar {public: bar (foo& dflt);};
+class bar {public: bar (const foo& dflt);};
class baz: public bar {public: baz (): bar (foo ()) {}};
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
index 7b470678a78..75658ec469c 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
@@ -1,383 +1,4 @@
-// Build don't link:
-// GROUPS passed old-abort
-const bool FALSE = 0;
-const bool TRUE = 1;
-class ListDProto {
-public:
- ListDProto();
- ListDProto(const ListDProto&);
- virtual ~ListDProto();
- void operator=(const ListDProto&);
- unsigned length() const;
- bool empty() const;
- void clear();
- void remove_head();
- void remove_tail();
- class link;
- class Vix {
- public:
- Vix();
- friend int operator==(void *v, const Vix& x)
- { return v == x.item; }// ERROR - list of candidates
- friend int operator==(const Vix& x, void *v)
- { return v == x.item; }// ERROR - candidate for call
- friend int operator!=(void *v, const Vix& x)
- { return v != x.item; }
- friend int operator!=(const Vix& x, void *v)
- { return v != x.item; }
- friend int operator==(const Vix& x1, const Vix& x2)
- { return x1.owner == x2.owner && x1.item == x2.item; }// ERROR - candidate for call
- friend int operator!=(const Vix& x1, const Vix& x2)
- { return x1.owner != x2.owner || x1.item != x2.item; }
- bool first;
- bool last;
- protected:
- friend class ListDProto;
- Vix(const ListDProto *o, link *i);
- const ListDProto *owner;
- private:
- link *item;
- };
- enum Action { NORMAL, REMOVE_CURRENT };
- Vix first() const;
- void first(Vix& x) const;
- void next(Vix& x) const;// ERROR - candidate for call
- void next(Vix& x, Action a = NORMAL);// ERROR - list of candidates
- Vix last() const;
- void last(Vix& x) const;
- void prev(Vix& x) const;
- void prev(Vix& x, Action a = NORMAL);
-protected:
- struct link {
- link *next;
- link *prev;
- link(link *n = 0, link *p = 0);
- virtual ~link();
- private:
- link(const link&);
- void operator=(const link&);
- };
- unsigned count;
- link *list_head;
- link *list_tail;
- virtual link *copy_item(link *old_item) const = 0;
- void prepend(link *item);
- void append(link *item);
- void prepend(const ListDProto& proto);
- void append(const ListDProto& proto);
- void remove(link *item);
- link *ref(const Vix&) const;
-};
-template<class T>
-class ListD: public ListDProto {
-public:
- void prepend(const T& item);
- void append(const T& item);
- const T& head() const;
- T& head();
- void head(T& fill) const;
- void remove_head()
- { ListDProto::remove_head(); }
- void remove_head(T& fill);
- const T& tail() const;
- T& tail();
- void tail(T& fill) const;
- void remove_tail()
- { ListDProto::remove_tail(); }
- void remove_tail(T& fill);
- class Vix: public ListDProto::Vix {
- public:
- Vix(): ListDProto::Vix()
- { }
- protected:
- friend class ListD<T>;
- Vix(const ListDProto::Vix& x): ListDProto::Vix(x)
- { }
- };
- Vix first() const
- { return ListDProto::first(); };
- void first(Vix& x) const
- { ListDProto::first(x); };
- void next(Vix& x, ListDProto::Action a = NORMAL) const
- { ListDProto::next(x, a); }// ERROR - .*// ERROR - .*
- Vix last() const
- { return ListDProto::last(); }
- void last(Vix& x) const
- { return ListDProto::last(x); }
- void prev(Vix& x, ListDProto::Action a = NORMAL) const
- { return ListDProto::prev(x, a); }
-protected:
- struct link_item: public ListDProto::link {
- T item;
- link_item(const T& i): link(0, 0), item(i)
- { }
- private:
- link_item(const link_item&);
- void operator=(const link_item&);
- };
-public:
- T& operator()(const Vix& x)
- { link_item *li = (link_item *) ref(x);
- return li->item; }
- const T& operator()(const Vix& x) const
- { link_item *li = (link_item *) ref(x);
- return li->item; }
-private:
- ListDProto::link *copy_item(ListDProto::link *old_item) const;
-};
-template<class T>
-class SetLD: private ListD<T> {
-public:
- SetLD();
- SetLD(const ListD<T>&);
- void add(const T& item);
- void add(const ListD<T>& other);
- void add(const SetLD<T>& other);
- void remove(const T& item);
- bool contains(const T& item) const;
- ListD<T>::length;
- ListD<T>::empty;
- ListD<T>::clear;
- typedef ListD<T>::Vix Vix;
- ListD<T>::first;
- ListD<T>::next;
- ListD<T>::operator();
-};
-extern "C" {
-extern void __eprintf (const char *, const char *, unsigned, const char *);
-}
-extern "C" {
-extern void __eprintf (const char *, const char *, unsigned, const char *);
-}
-template<class T>
-void
-ListD<T>::prepend(const T& item)
-{
- link *newl = new link_item(item);
- ListDProto::prepend(newl);
-}
-template<class T>
-void
-ListD<T>::append(const T& item)
-{
- link *newl = new link_item(item);
- ListDProto::append(newl);
-}
-template<class T>
-const T&
-ListD<T>::head() const
-{
- ((void) (( 0 != list_head ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 50 , "0 != list_head" ), 0) )) ;
- link_item *h = (link_item *) list_head;
- return h->item;
-}
-template<class T>
-T&
-ListD<T>::head()
-{
- ((void) (( 0 != list_head ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 59 , "0 != list_head" ), 0) )) ;
- link_item *h = (link_item *) list_head;
- return h->item;
-}
-template<class T>
-void
-ListD<T>::head(T& fill) const
-{
- ((void) (( 0 != list_head ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 68 , "0 != list_head" ), 0) )) ;
- link_item *h = (link_item *) list_head;
- fill = h->item;
-}
-template<class T>
-void
-ListD<T>::remove_head(T& fill)
-{
- head(fill);
- remove_head();
-}
-template<class T>
-const T&
-ListD<T>::tail() const
-{
- ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 85 , "0 != list_tail" ), 0) )) ;
- link_item *h = (link_item *) list_tail;
- return h->item;
-}
-template<class T>
-T&
-ListD<T>::tail()
-{
- ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 94 , "0 != list_tail" ), 0) )) ;
- link_item *h = (link_item *) list_tail;
- return h->item;
-}
-template<class T>
-void
-ListD<T>::tail(T& fill) const
-{
- ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 103 , "0 != list_tail" ), 0) )) ;
- link_item *h = (link_item *) list_tail;
- fill = h->item;
-}
-template<class T>
-void
-ListD<T>::remove_tail(T& fill)
-{
- ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 112 , "0 != list_tail" ), 0) )) ;
- link_item *h = (link_item *) list_tail;
- fill = h->item;
-}
-template<class T>
-ListDProto::link *
-ListD<T>::copy_item(ListDProto::link *old) const
-{
- link_item *old_item = (link_item *) old;
- link_item *new_item = new link_item(old_item->item);
- return new_item;
-}
-template<class T>
-SetLD<T>::SetLD():
-ListD<T>()
-{ }
-template<class T>
-SetLD<T>::SetLD(const ListD<T>& other):
-ListD<T>(other)
-{ }
-template<class T>
-void
-SetLD<T>::add(const T& item)
-{
- if ( ! contains(item) )
- append(item);
-}
-template<class T>
-void
-SetLD<T>::add(const ListD<T>& other)
-{
- ListD<T>::Vix x;
- for (first(x); 0 != x; next(x))
- add(other(x));
-}
-template<class T>
-void
-SetLD<T>::add(const SetLD<T>& other)
-{
- const ListD<T>& lother = other;
- add(lother);
-}
-template<class T>
-void
-SetLD<T>::remove(const T& item)
-{
- Action a = NORMAL;
- Vix x;
- for (first(x); 0 != x && REMOVE_CURRENT != a; next(x, a))
- a = operator()(x) == item ? REMOVE_CURRENT: NORMAL;// ERROR - .*
-}
-template<class T>
-bool
-SetLD<T>::contains(const T& item) const
-{
- Vix x;
- for (first(x); 0 != x; next(x)) {
- if (operator()(x) == item)// ERROR - .*
- return TRUE;
- }
- return FALSE;
-}
-template<class T>
-int
-operator==(const SetLD<T>& a, const SetLD<T>& b)
-{
- if (a.length() != b.length())
- return FALSE;
- SetLD<T>::Vix x;
- for (a.first(x); 0 != x; a.next(x)) {
- if ( ! b.contains(a(x)) )
- return FALSE;
- }
- for (b.first(x); 0 != x; b.next(x)) {
- if ( ! a.contains(b(x)) )
- return FALSE;
- }
- return TRUE;
-}
-template<class T>
-int
-operator!=(const SetLD<T>& a, const SetLD<T>& b)
-{ return ! (a == b); }
-template<class T>
-int
-operator<=(const SetLD<T>& a, const SetLD<T>& b)
-{
- if (a.length() > b.length())
- return FALSE;
- SetLD<T>::Vix x;
- for (x=a.first(); 0 != x; a.next(x)) {
- if ( ! b.contains(a(x)) )
- return FALSE;
- }
- return TRUE;
-}
-template<class T>
-int
-operator<(const SetLD<T>& a, const SetLD<T>& b)
-{
- if (a.length() >= b.length())
- return FALSE;
- return a <= b;
-}
-template<class T>
-int
-operator>(const SetLD<T>& a, const SetLD<T>& b)
-{ return ! (a <= b); }
-template<class T>
-int
-operator>=(const SetLD<T>& a, const SetLD<T>& b)
-{ return ! (a < b); }
-class String { };
-class IcaseString: public String { };
-class SetLD< IcaseString >: public SetLD< String > { public: SetLD (): SetLD< String >() { }; SetLD (const ListD< IcaseString >& other): SetLD< String >() { ListD< IcaseString >::Vix x; for (other.first(x); 0 != x; other.next(x)) add(other(x)); }; SetLD (const SetLD & other): SetLD< String >(other) { }; const IcaseString & operator()(const Vix& x) const { return ( IcaseString &) SetLD< String >::operator()(x); } }; typedef SetLD< String > SetLD_String_IcaseString_old_tmp99; typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99;
-inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
-{// ERROR - candidate for call
-const SetLD_String_IcaseString_old_tmp99& oa = a;
-const SetLD_String_IcaseString_old_tmp99& ob = b;
-return operator== (oa, ob); }
-inline int operator!= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
-{
-const SetLD_String_IcaseString_old_tmp99& oa = a;
-const SetLD_String_IcaseString_old_tmp99& ob = b;
-return operator!= (oa, ob); }
-inline int operator< (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
-{
-const SetLD_String_IcaseString_old_tmp99& oa = a;
-const SetLD_String_IcaseString_old_tmp99& ob = b;
-return operator< (oa, ob); }
-inline int operator<= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
-{
-const SetLD_String_IcaseString_old_tmp99& oa = a;
-const SetLD_String_IcaseString_old_tmp99& ob = b;
-return operator<= (oa, ob); }
-inline int operator> (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
-{
-const SetLD_String_IcaseString_old_tmp99& oa = a;
-const SetLD_String_IcaseString_old_tmp99& ob = b;
-return operator> (oa, ob); }
-inline int operator>= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
-{
-const SetLD_String_IcaseString_old_tmp99& oa = a;
-const SetLD_String_IcaseString_old_tmp99& ob = b;
-return operator>= (oa, ob); } ;
-typedef SetLD<IcaseString> SLDiS;
-static void
-nop(int i)
-{
- SetLD<IcaseString> x, y;
- nop(x == y);
- nop(x != y);
-nop(x < y);
-nop(x <= y);
-nop(x > y);
-nop(x >= y);
-}
+// Special g++ Options:
-template class SetLD<String>;
+ void next(Vix& x) const;
+ void next(Vix& x, Action a = NORMAL);
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash8.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash8.C
index 2b5dece65c1..8990c465677 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash8.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash8.C
@@ -6,7 +6,7 @@ class Elvis
} ;
template<int a>
-class Elvis<0>// ERROR - .*
-{ // ERROR -
+class Elvis<0>
+{ // ERROR - incorrect number of parameters
int geta() { return a ; }
} ;
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/groff1.C b/gcc/testsuite/g++.old-deja/g++.brendan/groff1.C
index 79c5b51371d..07604c9de09 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/groff1.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/groff1.C
@@ -1,33 +1 @@
-// GROUPS passed groff
-/* This should compile properly with the new overloading scheme. */
-
-extern "C" void printf (char *, ...);
-extern "C" void exit (int);
-
-int win = 0;
-
-class symbol
-{
-public:
- symbol(const char *p, int how = 0) {}
- symbol() {}
-};
-
-class dictionary
-{
-public:
- void *lookup(symbol s, void *v=0) { win = 1; }
- void *lookup(const char *) {}
-};
-
-main()
-{
- char buf[2048];
- dictionary exceptions;
- unsigned char *tem = new unsigned char[19 + 1];
-
- exceptions.lookup (symbol (buf), tem);
-
- printf (win ? "PASS\n" : "FAIL\n");
- exit (! win);
-}
+extern "C" void printf (const char *, ...);
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/reference1.C b/gcc/testsuite/g++.old-deja/g++.brendan/reference1.C
index 2a0c2939e4f..9d877546ac8 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/reference1.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/reference1.C
@@ -1,53 +1,4 @@
-// Special g++ Options: -w
-// GROUPS passed references
-// Check that if a reference is initialized to refer to a value
-// which is returned from a function call, the actual call to
-// the function is only invoked for the original initialization
-// of the reference, and not for each subsequent use of the
-// reference.
-//
-// This test fails with G++ 1.35.0- (pre-release).
-// Reported 4/4/89 by Kim Smith
-
-extern "C" void printf (char *, ...);
-
-struct base {
- int data_member;
-
- base () {}
- void function_member ();
-};
-
-base base_object;
-
-base base_returning_function ();
-
-int call_count = 0;
-
-int main ()
-{
- base& base_ref = base_returning_function ();
-
- base_ref.function_member ();
- base_ref.function_member ();
- base_ref.data_member = 99;
-
- if (call_count == 1)
- printf ("PASS\n");
- else
- printf ("FAIL\n");
-
- return 0;
-}
-
-base base_returning_function ()
-{
- base local_base_object;
-
- call_count++;
- return local_base_object;
-}
-
-void base::function_member ()
-{
-}
+ mutable int data_member;
+ void function_member () const;
+ const base& base_ref = base_returning_function ();
+void base::function_member () const
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C
index 4e636b5ece9..d2807be0514 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900402_01.C
@@ -1,15 +1 @@
-// g++ 1.37.1 bug 900402_01
-
-// The following erroneous code causes g++ to abort.
-
-// Cfront 2.0 passes this test.
-
-// keywords: abort, bit-fields, function types
-
-typedef void (func_type) ();
-
-struct s {
- func_type f:32; // ERROR - XFAIL *-*-*
-};
-
-int main () { return 0; }
+ func_type f:32; // ERROR - bitified with function type
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C b/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
index b6d4830b14d..8cc9d20e6ed 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
@@ -1,20 +1,5 @@
-// g++ 1.37.1 bug 900404_04
-
-// The ANSI C does not allow vacuous statements (i.e. just semicolons)
-// at the file-scope level.
-
-// The current C++ Reference Manual does not indicate whether these should
-// be considered legal or not.
-
-// I am forced to conclude that C++ will follow ANSI C in this regard,
-// and that these are therefore not legal.
-
-// g++ fails to flag errors for such usage.
-
-// keywords: semicolon, vacuous, file scope, declaration
-
-int i;
-
-; // ERROR - , XFAIL *-*-*
-
-int main () { return 0; }
+// [dcl.dcl] explains that simple-declarations may omit the
+// init-declarator-list only if the decl-specifier-seq declares a
+// class, i.e. if it contains a class-specifier, an
+// elaborated-type-specifier with class key, or an enum-specifier. The
+// declaration below contains neither.
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C b/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C
index 05d2ea03d3d..c7041d9c89a 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900519_05.C
@@ -1,18 +1,2 @@
-// g++ 1.37.1 bug 900519_05
-
-// g++ fails to allow the use of function-reference types.
-
-// cfront 2.0 passes this test.
-
-// keywords: function types, reference types
-
-typedef void (func_type) (int, int);
-typedef func_type& func_ref_type; // gets bogus error, XFAIL *-*-*
-
-void function (int arg1, int arg2)
-{
-}
-
-func_type& global_func_ref1 = function; // gets bogus error, XFAIL *-*-*
-
-int main () { return 0; }
+typedef func_type& func_ref_type;
+func_type& global_func_ref1 = function;
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C b/gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C
index 355bedc64c9..bea447bf27f 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C
@@ -33,6 +33,6 @@ eh_test (int level)
main ()
{
- set_terminate (&eh_terminate);
+ std::set_terminate (&eh_terminate);
eh_test (0);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec1.C b/gcc/testsuite/g++.old-deja/g++.eh/spec1.C
index 73ee960f120..8f450706b04 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/spec1.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec1.C
@@ -8,15 +8,15 @@ void my_term () { exit (1); }
void my_unexp () { throw 42; }
void
-f () throw (char, int, bad_exception)
+f () throw (char, int, std::bad_exception)
{
throw 'a';
}
main ()
{
- set_terminate (my_term);
- set_unexpected (my_unexp);
+ std::set_terminate (my_term);
+ std::set_unexpected (my_unexp);
try
{
@@ -30,7 +30,7 @@ main ()
{
return 3;
}
- catch (bad_exception)
+ catch (std::bad_exception)
{
return 4;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec2.C b/gcc/testsuite/g++.old-deja/g++.eh/spec2.C
index 44013775761..41774bf7de4 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/spec2.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec2.C
@@ -8,15 +8,15 @@ void my_term () { exit (1); }
void my_unexp () { throw 42; }
void
-f () throw (int, bad_exception)
+f () throw (int, std::bad_exception)
{
throw 'a';
}
main ()
{
- set_terminate (my_term);
- set_unexpected (my_unexp);
+ std::set_terminate (my_term);
+ std::set_unexpected (my_unexp);
try
{
@@ -30,7 +30,7 @@ main ()
{
return 0;
}
- catch (bad_exception)
+ catch (std::bad_exception)
{
return 4;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec3.C b/gcc/testsuite/g++.old-deja/g++.eh/spec3.C
index 148be763214..602cd6f5b61 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/spec3.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec3.C
@@ -8,15 +8,15 @@ void my_term () { exit (1); }
void my_unexp () { throw 42; }
void
-f () throw (bad_exception)
+f () throw (std::bad_exception)
{
throw 'a';
}
main ()
{
- set_terminate (my_term);
- set_unexpected (my_unexp);
+ std::set_terminate (my_term);
+ std::set_unexpected (my_unexp);
try
{
@@ -30,7 +30,7 @@ main ()
{
return 3;
}
- catch (bad_exception)
+ catch (std::bad_exception)
{
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec4.C b/gcc/testsuite/g++.old-deja/g++.eh/spec4.C
index d8b8ce7ed32..adcf6751b1a 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/spec4.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec4.C
@@ -15,8 +15,8 @@ f () throw (short)
main ()
{
- set_terminate (my_term);
- set_unexpected (my_unexp);
+ std::set_terminate (my_term);
+ std::set_unexpected (my_unexp);
try
{
@@ -30,7 +30,7 @@ main ()
{
return 3;
}
- catch (bad_exception)
+ catch (std::bad_exception)
{
return 4;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/ref4.C b/gcc/testsuite/g++.old-deja/g++.jason/ref4.C
index 422c58cab70..1b442f94e51 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/ref4.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/ref4.C
@@ -1,4 +1 @@
-// Build don't link:
-
-void f ();
-void (&fr)() = f; // gets bogus error - references to functions XFAIL *-*-*
+void (&fr)() = f;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rfg15.C b/gcc/testsuite/g++.old-deja/g++.jason/rfg15.C
deleted file mode 100644
index 1f0ff3b64e7..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.jason/rfg15.C
+++ /dev/null
@@ -1,6 +0,0 @@
-const void *cvp;
-
-const void func1 ()
-{
- return *cvp; /* ERROR - returning a value from a void function */
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C b/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C
index ef2f178a186..c02abd44f3b 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C
@@ -1,9 +1 @@
-void f ()
-{
- struct A {
- friend void g ();
- };
-}
-void h () {
- g (); // ERROR - no g in scope
-}
+// Build don't link:
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C b/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C
index bbc6afeb77e..8a1aa548e77 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C
@@ -1,8 +1 @@
-// Bug: member initializers are allowed where they shouldn't be.
-// Build don't link:
-
-template <class T>
-class A {
- int i;
- Blarg () : i(0) { } // ERROR -
-};
+struct A {
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template31.C b/gcc/testsuite/g++.old-deja/g++.jason/template31.C
index 8870bf4ec4e..2ef14761bd4 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/template31.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template31.C
@@ -1,38 +1,4 @@
-// PRMS Id: 8569
-#include <iostream.h>
-#include <vector>
-
-class Component {
- int george;
- char mabel[128];
-};
-class CopyMe {
-public:
- CopyMe(){;}
-private:
- vector<Component> strvec;
-};
-
-class IncludeIt {
-public:
- IncludeIt() {}
- ~IncludeIt() {}
- IncludeIt(const IncludeIt& i) {
- myStrvec = i.myStrvec;
- }
- IncludeIt& operator=(const IncludeIt& i) {
- myStrvec = i.myStrvec;
- }
-private:
- CopyMe myStrvec;
-};
-
-main(int argc, char**argv) {
- IncludeIt foo;
- IncludeIt* bar;
- exit(0);
-}
-
-template class __malloc_alloc_template<0>;
-template class __default_alloc_template<false, 0>;
+using std::vector;
+template class std::__malloc_alloc_template<0>;
+template class std::__default_alloc_template<false, 0>;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
index d4ba59bbf00..6d04058913d 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
@@ -1,48 +1 @@
-// Test that non-variadic function calls using thunks and PIC work right.
-// Skip if not native
-// Special g++ Options: -fvtable-thunks -fPIC
-
-struct A {
- void* p;
- A (void* q): p (q) { }
- A (const A& a): p (a.p) { }
-};
-
-class CBase {
-public:
- void BaseFunc();
-};
-
-class MMixin {
-public:
- virtual A MixinFunc(int arg, A arg2) = 0;
-};
-
-class CExample : public CBase, public MMixin {
-public:
- A MixinFunc(int arg, A arg2);
-};
-
-void CBase::BaseFunc()
-{
-}
-
-A CExample::MixinFunc(int arg, A arg2)
-{
- if (arg != 1 || arg2.p != 0)
- return 0;
- return this;
-}
-
-void* test(MMixin& anExample)
-{
- return anExample.MixinFunc(1,A(0)).p;
-}
-
-main ()
-{
- CExample c;
-
- if (test(c) != &c)
- return 1;
-}
+// excess errors test - XFAIL m68k-motorola-sysv m88k-motorola-sysv3
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
index 50f008655ea..083eb045e54 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
@@ -1,56 +1 @@
-// Test that function calls using thunks work right.
-// Special g++ Options: -fvtable-thunks
-// excess errors test - XFAIL mips*-*-* alpha*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff
-
-#include <stdarg.h>
-
-struct A {
- void* p;
- A (void* q): p (q) { }
- A (const A& a): p (a.p) { }
-};
-
-class CBase {
-public:
- void BaseFunc();
-};
-
-class MMixin {
-public:
- virtual A MixinFunc(int arg, ...) = 0;
-};
-
-class CExample : public CBase, public MMixin {
-public:
- A MixinFunc(int arg, ...);
-};
-
-void CBase::BaseFunc()
-{
-}
-
-A CExample::MixinFunc(int arg, ...)
-{
- va_list ap;
- va_start (ap, arg);
-
- if (arg != 1 || va_arg (ap, int) != 2 || va_arg (ap, int) != 3
- || va_arg (ap, int) != 4 || va_arg (ap, int) != 5
- || va_arg (ap, int) != 6 || va_arg (ap, int) != 7
- || va_arg (ap, int) != 8 || va_arg (ap, int) != 9)
- return 0;
- return this;
-}
-
-void* test(MMixin& anExample)
-{
- return anExample.MixinFunc(1,2,3,4,5,6,7,8,9).p;
-}
-
-main ()
-{
- CExample c;
-
- if (test(c) != &c)
- return 1;
-}
+// excess errors test - XFAIL mips*-*-* alpha*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C b/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
index 90eeb4558fe..03601d670e1 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
@@ -1,11 +1 @@
-#include <typeinfo>
-#include <iostream.h>
-
-struct foo { double f(int); };
-
-main() {
- double f (int);
- const type_info &r = typeid (f);
- cout << typeid(f).name() << endl;
- cout << typeid(foo::f).name() << endl;
-}
+ const std::type_info &r = typeid (f);
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm13.C b/gcc/testsuite/g++.old-deja/g++.law/arm13.C
index 565fbec3da8..e69de29bb2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/arm13.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/arm13.C
@@ -1,16 +0,0 @@
-// GROUPS passed ARM-compliance
-#include <stdio.h>
-#include <stdlib.h>
-
-inline void *operator new(size_t, void *place) { return place; }
-void* malloc(size_t);
-void free(void*);
-
-main()
-{
- int* p = (int*) malloc(sizeof(int));
- (void) new (p) int(1);
- p->int::~int();
- free(p);
- printf ("PASS\n");
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm2.C b/gcc/testsuite/g++.old-deja/g++.law/arm2.C
index de8fe425bda..0ed556c7981 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/arm2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/arm2.C
@@ -1,17 +1 @@
-// Build don't link:
-// GROUPS passed ARM-compliance
-// excess errors test - XFAIL *-*-*
-// arm file
-// Message-Id: <199301260140.AA13734@world.std.com>
-// From: gparker@world.std.com (Glenn P Parker)
-// Subject: gcc bug
-// Date: Mon, 25 Jan 1993 20:40:44 -0500
-
-int f() { return 1; }
-
-int main()
-{
- int (&fr)() = f; // g++ cannot compile it
-
- return 0;
-}
+ int (&fr)() = f;
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators27.C b/gcc/testsuite/g++.old-deja/g++.law/operators27.C
index f8ca9d17317..a23dfd75988 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/operators27.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators27.C
@@ -1,33 +1,2 @@
-// GROUPS passed operators
-// opr-new file
-// From: David Binderman 3841 <dcb@us-es.sel.de>
-// Date: Mon, 21 Jun 93 11:42:11 +0200
-// Subject: G++ 2.4.3 and operator new
-// Message-ID: <9306210942.AA10276@slsvitt.us-es.sel.de>
-
-int FLAG=0;
-
-#include <new>
-
-extern "C" int printf( const char *, ...);
-
-void * operator new(size_t, const nothrow_t&) throw() { FLAG=1; return 0; }
-
-class K {
-private:
- int i;
-public:
- K( int j) {
- i = j;
- }
-};
-
-int main(void)
-{
- K * pK = new (nothrow) K( 10);
- if ( FLAG != 1 )
- printf ("FAIL\n");
- else
- printf ("PASS\n");
- return 0;
-}
+void * operator new(size_t, const std::nothrow_t&) throw() { FLAG=1; return 0; }
+ K * pK = new (std::nothrow) K( 10);
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators29.C b/gcc/testsuite/g++.old-deja/g++.law/operators29.C
index ec0d47c3dc4..e69de29bb2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/operators29.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators29.C
@@ -1,24 +0,0 @@
-// Build don't link:
-// GROUPS passed operators
-// excess errors test - XFAIL *-*-*
-// (Message bugs/opr-del:4)
-// From: jamshid@ses.com (Jamshid Afshar)
-// Date: Fri, 25 Feb 94 18:44:01 CST
-// Subject: Re: delete on "smart pointers"
-// Message-ID: <9402262328.AA16321@pancake>
-//
-// Who was apparently replying to kuhlins@hawk.wifo.uni-mannheim.de
-
-
-template<class T> class Ptr {
-public:
- Ptr(T*);
- operator T*();
-};
-
-int main() {
- Ptr<int> ip = new int(2);
- delete ip;
- operator delete(ip);
- return 0;
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
index 6e53fc739c5..8bd6a851b71 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
@@ -14,7 +14,7 @@
const int ArraySize = 12;
template <class Type>
-class Array {
+class Array { // ERROR - .struct Array_RC redecl.*
friend class Array_RC;
public:
Array(const Type *ar, int sz) { init(ar,sz); }
@@ -97,7 +97,7 @@ try_array( Array_RC<Type> &rc )
main()
{
static int ia[10] = { 12, 7, 14, 9, 128, 17, 6, 3, 27, 5 };
- Array_RC<int> iA(ia, 10);// ERROR - .struct Array_RC redecl.*
+ Array_RC<int> iA(ia, 10);// ERROR - instantiated from here
cout << "template Array_RC class" << endl;
try_array(iA);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C
index 0b6fd383d99..fbcc489eaaf 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C
@@ -15,7 +15,7 @@ main() {
B b;
try {
(void)dynamic_cast<D&>(b);
- } catch (bad_cast) {
+ } catch (std::bad_cast) {
return 0;
}
return 1;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
index dbad6414ae4..ba7a39edbaa 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
@@ -18,7 +18,7 @@ main() {
try {
void *vp = &dynamic_cast<D&>(*b);
return 1;
- } catch (bad_cast) {
+ } catch (std::bad_cast) {
return 0;
}
return 1;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C b/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C
index 1373d0f5f6e..eee68d2e327 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C
@@ -1,28 +1 @@
-// Special g++ Options: -fexceptions
-
-#include <typeinfo>
-#include <stdexcept>
-
-class A {
-public:
- virtual void j () {}
-};
-
-class B : public A { };
-
-void x (A& a) {
- // These should all work.
- const B& b2 = dynamic_cast<B&>(a);
- const B& b3 = dynamic_cast<const B&>((const A&)a);
- const B& b4 = dynamic_cast<const B&>(a);
-}
-
-int main() {
- try {
- B b;
- x (b);
- } catch (exception& e) {
- // If we get a bad_cast, it is wrong.
- return 1;
- }
-}
+ } catch (std::exception& e) {
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh19.C b/gcc/testsuite/g++.old-deja/g++.mike/eh19.C
index 3d9aee14ece..38b4bf16d8b 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh19.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh19.C
@@ -1,23 +1 @@
-// Special g++ Options: -fexceptions
-// Build don't link:
-
-class test1 {
-public:
- class fehler{public:fehler(){};};
- func(int a) {
- if( a == 0 )
- throw fehler();
- }
-};
-
-main() {
- test1 var;
-
- try {
- var.func(1);
- var.func(0);
- } catch(test1::fehler()) // ERROR - cannot have function type
- {
- ;
- }
-}
+ } catch(test1::fehler()) // function type promoted to pointer
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C
index 17a9669388f..88d517a43d6 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C
@@ -1,46 +1 @@
-// Special g++ Options: -fexceptions
-// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
-
-#include <exception>
-
-struct double_fault { };
-int fault_now;
-
-class E {
-public:
- E() { }
- E(const E&) {
- if (fault_now)
- throw double_fault();
- }
-};
-
-void foo() {
- try {
- throw E();
- } catch (...) {
- fault_now = 1;
- throw;
- }
-}
-
-void bar() {
- try {
- foo();
- } catch (E e) { // double fault here
- }
-}
-
-void my_terminate() {
- exit (0); // double faults should call terminate
-}
-
-main() {
- set_terminate (my_terminate);
- try {
- bar();
- } catch (...) {
- return 1;
- }
- return 1;
-}
+ std::set_terminate (my_terminate);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
index 66045b1cf56..b74605b74bf 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
@@ -1,30 +1 @@
-// Special g++ Options: -fexceptions
-// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
-
-#include <exception>
-
-void my_terminate() {
- exit (0); // Double faults should call terminate
-}
-
-struct A {
- A() { }
- ~A() {
- set_terminate (my_terminate);
- throw 1; // This throws from EH dtor, should call my_terminate
- }
-};
-
-main() {
- try {
- try {
- throw 1;
- } catch (int i) {
- A a; // A hit on this EH dtor went to the wrong place
- throw 1;
- }
- } catch (...) {
- return 1;
- }
- return 1;
-}
+ std::set_terminate (my_terminate);
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
index ce57067c6ef..49214f12c88 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
@@ -10,7 +10,7 @@ void my_unexpected() {
foo() throw (int) { throw "Hi"; }
main() {
- set_unexpected (my_unexpected);
+ std::set_unexpected (my_unexpected);
try {
foo();
} catch (int i) {
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh34.C b/gcc/testsuite/g++.old-deja/g++.mike/eh34.C
index 986db272429..0f278010023 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh34.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh34.C
@@ -10,7 +10,7 @@ void my_unexpected() {
foo() throw () { throw "Hi"; }
main() {
- set_unexpected (my_unexpected);
+ std::set_unexpected (my_unexpected);
foo();
return 1;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C
index 708de10d9a5..043a6174a6f 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C
@@ -14,7 +14,7 @@ main() {
} catch (...) {
}
try {
- set_terminate (myterm);
+ std::set_terminate (myterm);
throw;
} catch (...) {
return 1;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh48.C b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
index 5cefacd5f1e..db8dc1bbf37 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh48.C
@@ -1,32 +1 @@
-// Special g++ Options: -fexceptions
-// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
-
-#include <exception>
-
-class A {
-public:
- ~A() {
- if (uncaught_exception ())
- exit (0);
- }
-};
-
-int main() {
- if (uncaught_exception ())
- return 1;
- try {
- throw "";
- } catch (...) {
- if (uncaught_exception ())
- return 1;
- }
- if (uncaught_exception ())
- return 1;
- try {
- A a;
- throw "";
- } catch (...) {
- return 1;
- }
- return 1;
-}
+using std::uncaught_exception;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh5.C b/gcc/testsuite/g++.old-deja/g++.mike/eh5.C
index 6bc1dc045fd..6454dd6ce5e 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh5.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh5.C
@@ -1,21 +1 @@
-// Special g++ Options: -fexceptions
-// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
-
-class foo {
-public:
- class error {};
-
- void cause_error(void) { throw "Hello World!"; }
-};
-
-int main(void)
-{
- foo f;
- try {
- f.cause_error();
- }
- catch (char cp[]) {
- return 0;
- }
- return 1;
-}
+ catch (const char cp[]) {
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
index 1ae2d9cc937..0747e1032ef 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
@@ -10,7 +10,7 @@ void my_unexpected() {
template <class T> int foo(T) throw (int) { throw "Hi"; }
main() {
- set_unexpected (my_unexpected);
+ std::set_unexpected (my_unexpected);
try {
foo(1);
} catch (int i) {
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C
index 56943d4e667..ac7f620df42 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C
@@ -10,7 +10,7 @@ void my_unexpected() {
template <class T> int foo(T) throw (T) { throw "Hi"; }
main() {
- set_unexpected (my_unexpected);
+ std::set_unexpected (my_unexpected);
try {
foo(1);
} catch (int i) {
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh55.C b/gcc/testsuite/g++.old-deja/g++.mike/eh55.C
index 7e83aaf0c8b..e64bcf82374 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh55.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh55.C
@@ -12,7 +12,7 @@ void throw_an_unexpected_exception() throw() {
}
int main() {
- set_terminate(my_terminate_handler);
+ std::set_terminate(my_terminate_handler);
throw_an_unexpected_exception();
return 1;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns11.C b/gcc/testsuite/g++.old-deja/g++.mike/ns11.C
index f0243ca41c5..e69de29bb2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/ns11.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns11.C
@@ -1,19 +0,0 @@
-// excess errors test - XFAIL *-*-*
-class Foo {
-};
-
-namespace A {
- namespace Foo {
- bar() {
- return 0;
- }
- }
-
- mymain() {
- return Foo::bar();
- }
-}
-
-main() {
- return A::mymain();
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns13.C b/gcc/testsuite/g++.old-deja/g++.mike/ns13.C
index d0eb3cd5244..e69de29bb2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/ns13.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns13.C
@@ -1,14 +0,0 @@
-// Build don't link:
-// excess errors test - XFAIL *-*-*
-
-namespace N {
- struct C {
- C();
- };
-}
-
-namespace M {
- struct C {
- C();
- };
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns14.C b/gcc/testsuite/g++.old-deja/g++.mike/ns14.C
index 62ac4566359..e69de29bb2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/ns14.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns14.C
@@ -1,12 +0,0 @@
-// Build don't link:
-// excess errors test - XFAIL *-*-*
-
-namespace Jazz {
- int horn( int h ) { return 1; }
-}
-
-using Jazz::horn;
-
-namespace Jazz {
- int horn ( char c ) { return 0; }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/ns9.C b/gcc/testsuite/g++.old-deja/g++.mike/ns9.C
index b88ae278e39..e69de29bb2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/ns9.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/ns9.C
@@ -1,12 +0,0 @@
-// excess errors test - XFAIL *-*-*
-namespace Foo {
- bar() {
- return 0;
- }
-}
-
-using Foo::bar;
-
-main() {
- return bar();
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
index c64aa75bd11..7e1886922eb 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
@@ -336,7 +336,7 @@ struct vertex {
vertex(): item(), fanout() // gets bogus error
{ };
- vertex(const T& i): item(), fanout() // gets bogus error - XFAIL *-*-*
+ vertex(const T& i): item(), fanout() // gets bogus error
{ };
};
@@ -439,7 +439,7 @@ Graph<T>::lookup_new(const T& from)
{
vertex<T> *v = lookup(from);
if (0 == v) {
- vertices.append(from); // gets bogus error
+ vertices.append(from);
return &vertices(vertices.last());
}
return v;
@@ -458,7 +458,7 @@ void
Graph<T>::nextV1(Pix vx, Pix& x) const
{
vertex<T> *v = (vertex<T> *) vx;
- return v->fanout.next(x); // ERROR - return from void method
+ return v->fanout.next(x);
}
template<class T>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p785.C b/gcc/testsuite/g++.old-deja/g++.mike/p785.C
index 2188707cade..7d61b093edd 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p785.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p785.C
@@ -6883,7 +6883,8 @@ and this notice must be preserved on all copies.
typedef void (*GctNameRefProcedure)(GctNameRef&);
typedef GctNameRef (*GctNameRefMapper)(GctNameRef&);
-typedef GctNameRef (*GctNameRefCombiner)(GctNameRef&, GctNameRef&);
+typedef GctNameRef& (*GctNameRefCombiner)(const GctNameRef&,
+ const GctNameRef&);
typedef int (*GctNameRefPredicate)(GctNameRef&);
typedef int (*GctNameRefComparator)(GctNameRef&, GctNameRef&);
@@ -6916,11 +6917,11 @@ public:
GctNameRefList();
GctNameRefList(GctNameRef& head);
GctNameRefList(GctNameRef& head, GctNameRefList& tl);
- GctNameRefList(GctNameRefList& a);
+ GctNameRefList(const GctNameRefList& a);
GctNameRefList(Pix p);
~GctNameRefList();
- GctNameRefList& operator = (GctNameRefList& a);
+ GctNameRefList& operator = (const GctNameRefList& a);
int null();
int valid();
@@ -7003,11 +7004,11 @@ inline void dereference(GctNameRefListNode* p)
}
-inline GctNameRefListNode* newGctNameRefListNode(GctNameRef& h)
+inline GctNameRefListNode* newGctNameRefListNode(const GctNameRef& h)
{
GctNameRefListNode* p = new GctNameRefListNode;
p->ref = 1;
- p->hd = h;
+ p->hd = (GctNameRef&) h;
return p;
}
@@ -7048,9 +7049,10 @@ inline GctNameRefList::GctNameRefList(GctNameRef& head, GctNameRefList& tl)
reference(P->tl);
}
-inline GctNameRefList::GctNameRefList(GctNameRefList& a)
+inline GctNameRefList::GctNameRefList(const GctNameRefList& a)
{
- reference(a.P);
+ GctNameRefList& gl = (GctNameRefList&) a;
+ reference(gl.P);
P = a.P;
}
@@ -7151,7 +7153,7 @@ public:
static init_NilGctNameRefListNode NilGctNameRefListNode_initializer;
-GctNameRefList& GctNameRefList::operator = (GctNameRefList& a)
+GctNameRefList& GctNameRefList::operator = (const GctNameRefList& a)
{
reference(a.P);
dereference(P);
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using1.C b/gcc/testsuite/g++.old-deja/g++.other/using1.C
index 9e5615fa2c1..d22d512f64b 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/using1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/using1.C
@@ -2,7 +2,7 @@ class D2;
class B {
private:
- int a;
+ int a; // ERROR - B::a is private
protected:
int b;
@@ -13,7 +13,7 @@ class D : public B {
public:
using B::a;
using B::b;
-};
+}; // ERROR - within this context
class D2 : public B {
public:
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C
index 83ebcc16cc7..0defb196116 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C
@@ -5,11 +5,13 @@ struct S
{
template <class T>
void foo(T t);
-
- template <>
- void foo<int>(int) {}
};
+
+template <>
+template <>
+void S<char*>::foo<int>(int) {}
+
int main()
{
S<char*> s;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C
index 73e0e19e85f..fbb79013038 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C
@@ -7,13 +7,14 @@ struct S
template <class T>
void foo(T t);
- template <>
- void foo(int) { }
-
template <class T>
void bar(T t) { this->template foo<U>(3.74); }
};
+template <>
+template <>
+void S<int>::foo(int) { }
+
int main()
{
S<int> s;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C
index 487525eb933..0aede3824bd 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C
@@ -4,7 +4,7 @@ template <class T>
void foo(T t);
template <>
-void foo(int) {};
+void foo(int) {}; // ERROR - previously defined here.
template <>
void foo<int>(int) {} // ERROR - duplicate specialization.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C
index 9f714427459..c9282632aa1 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C
@@ -4,11 +4,11 @@ struct S
{
template <class T>
void foo(T t);
-
- template <>
- void foo<int>(int i) { }
};
+template <>
+void S::foo<int>(int i) { }
+
int main()
{
S s;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit7.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit7.C
deleted file mode 100644
index 9f714427459..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit7.C
+++ /dev/null
@@ -1,16 +0,0 @@
-// Build don't run:
-// GROUPS passed templates
-struct S
-{
- template <class T>
- void foo(T t);
-
- template <>
- void foo<int>(int i) { }
-};
-
-int main()
-{
- S s;
- s.template foo<int>(3.0);
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/instantiate1.C b/gcc/testsuite/g++.old-deja/g++.pt/instantiate1.C
index 1d9c7580a68..11f9c781988 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/instantiate1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/instantiate1.C
@@ -1,7 +1,7 @@
// Build don't link:
template <class T>
-void f(T t);
+void f(T t) {}
template void f<int>(int);
template void f<>(long);
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C
index 08166b0220d..1a5cabe67a1 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C
@@ -4,12 +4,13 @@ struct S
struct Y {
template <class T>
void foo(T t);
-
- template <>
- void foo<int>(int i) { }
};
};
+template <>
+template <>
+void S::Y<char>::foo<int>(int i) { }
+
int main()
{
S::Y<char> s;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass8.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass8.C
index c0bf0cd83ab..431d41d64e8 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memclass8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass8.C
@@ -4,7 +4,7 @@ template <class T>
class S
{
template <class U>
- class S2 {
+ struct S2 {
S2(const S2<U>& s2u) {}
};
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C
index 99e4f7299eb..7358d7225f7 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp60.C
@@ -1,7 +1,7 @@
// Build don't link:
// GROUPS passed membertemplates
template <class T>
-class S
+struct S
{
S(const S<T>& x) {}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C
index d67da394c3e..1fdb055b357 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp61.C
@@ -4,9 +4,6 @@ struct S
{
template <class T>
void foo(T t);
-
- template <>
- void foo(int i);
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C
index 2efd4d6d73c..8cfadeffd3e 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp62.C
@@ -4,9 +4,6 @@ struct S
{
template <class T>
void foo(T t);
-
- template <>
- void foo(int i);
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp71.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp71.C
index f3b72be28cc..38cf5c78549 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp71.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp71.C
@@ -3,4 +3,4 @@
class A
{
template<class T>T epsilon; // ERROR - invalid member template
-}; // ERROR - the compiler crashes here
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C b/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C
index 7bc3eaae26b..283d83f2aff 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C
@@ -6,7 +6,7 @@ struct S1; // ERROR - previous declaration
template <class T, class U>
struct S1 {}; // ERROR - used 1 template parameter
-template <class T = int>
+template <class T = int> // ERROR - original def of default
struct S2;
template <class T = int>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec10.C b/gcc/testsuite/g++.old-deja/g++.pt/spec10.C
index 10947aa8e8c..5d53e2d76b1 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec10.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec10.C
@@ -5,14 +5,15 @@ struct S
{
template <int i>
int f(int j) { abort(); return 0; }
-
- template <>
- int f<7>(int j) { return j + 7; }
-
- template <>
- int f<8>(int j) { return j + 8; }
};
+template <>
+template <>
+int S<double>::f<7>(int j) { return j + 7; }
+
+template <>
+template <>
+int S<double>::f<8>(int j) { return j + 8; }
int main()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec11.C b/gcc/testsuite/g++.old-deja/g++.pt/spec11.C
index 4369f18f15a..340b58e73ec 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec11.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec11.C
@@ -7,9 +7,9 @@ struct S
int f(U u);
};
-template <class T>
template <>
-int S<T>::f(int i) { return 1; }
+template <>
+int S<char>::f(int i) { return 1; }
int main()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec12.C b/gcc/testsuite/g++.old-deja/g++.pt/spec12.C
index 71676ff6cbc..d9c39654e93 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec12.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec12.C
@@ -8,9 +8,9 @@ struct S
};
-template <class T>
template <>
-int S<T>::f<int>(int i) { return 1; }
+template <>
+int S<char>::f<int>(int i) { return 1; }
int main()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec13.C b/gcc/testsuite/g++.old-deja/g++.pt/spec13.C
index 8f94570db84..e5748f56c14 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec13.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec13.C
@@ -14,11 +14,11 @@ struct S1
template <class T>
void f(T* t);
-
- template <>
- void f(int* ip) {}
};
+template <>
+void S1::f(int* ip) {}
+
template <class U>
struct S2
{
@@ -27,11 +27,12 @@ struct S2
template <class T>
void f(T* t);
-
- template <>
- void f(int* ip) {}
};
+template <>
+template <>
+void S2<double>::f(int* ip) {}
+
int main()
{
int* ip;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec15.C b/gcc/testsuite/g++.old-deja/g++.pt/spec15.C
index 0aec14336af..2e97b046265 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec15.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec15.C
@@ -28,9 +28,9 @@ struct S3
static int h(U);
};
-template <class T>
template <>
-int S3<T>::h(int) { return 0; }
+template <>
+int S3<double>::h(int) { return 0; }
template <>
template <>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec6.C b/gcc/testsuite/g++.old-deja/g++.pt/spec6.C
index b41ad9d8da6..4ef8e651594 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/spec6.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec6.C
@@ -4,21 +4,23 @@ struct S1
{
template <class T>
void f(T t1, T t2);
-
- template <>
- void f(int i1, int i2);
};
+
+template <>
+void S1::f(int i1, int i2);
+
template <class U>
struct S2
{
template <class T>
void f(T t1, T t2);
-
- template <>
- void f(int i1, int i2);
};
+template <>
+template <>
+void S2<char>::f(int i1, int i2);
+
void h()
{
S1 s1;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/t05.C b/gcc/testsuite/g++.old-deja/g++.pt/t05.C
index 888f1de95ea..ea68d725b0b 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/t05.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/t05.C
@@ -1,9 +1,5 @@
-// Build don't link:
-
-template <class A> class B {
- A a;
- public:
- B(A&aa); // ERROR -
- ~B();
-};
-static B<int> b_int (3); // ERROR -
+template <class A> class B {
+ A a;
+ B(A&aa); // ERROR - near match
+}; // ERROR - candidates
+static B<int> b_int (3); // ERROR - no matching function
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp3.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp3.C
index db22c6f0c65..9a047a846f0 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ttp3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp3.C
@@ -5,7 +5,7 @@ template<class E,class F> class D
};
template<template<class> class D,class E> class C
-{ // ERROR - ref below
+{
};
int main()
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typedef1.C b/gcc/testsuite/g++.old-deja/g++.pt/typedef1.C
index 5de152ef7dc..8d674c9f127 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/typedef1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typedef1.C
@@ -2,7 +2,7 @@
// Build don't link:
template <class T>
-class A
+struct A
{
typedef enum
{
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename3.C b/gcc/testsuite/g++.old-deja/g++.pt/typename3.C
index 4a8f05b08e3..0b19d54723e 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/typename3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typename3.C
@@ -1,4 +1,5 @@
// Build don't link:
+// Special g++ Options:
template <class T>
struct A
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename4.C b/gcc/testsuite/g++.old-deja/g++.pt/typename4.C
index 67ac939b58a..6f9362fe8e7 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/typename4.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typename4.C
@@ -1,4 +1,5 @@
// Build don't link:
+// Special g++ Options:
template <class T>
struct A
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename5.C b/gcc/testsuite/g++.old-deja/g++.pt/typename5.C
index 202dadf12b6..e967d143f37 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/typename5.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typename5.C
@@ -1,4 +1,5 @@
// Build don't link:
+// Special g++ Options:
template <class T>
struct A
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename6.C b/gcc/testsuite/g++.old-deja/g++.pt/typename6.C
index 4a8f05b08e3..0b19d54723e 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/typename6.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typename6.C
@@ -1,4 +1,5 @@
// Build don't link:
+// Special g++ Options:
template <class T>
struct A
diff --git a/gcc/testsuite/g++.old-deja/old-deja.exp b/gcc/testsuite/g++.old-deja/old-deja.exp
index 87cdb2eeadc..072ed14d173 100644
--- a/gcc/testsuite/g++.old-deja/old-deja.exp
+++ b/gcc/testsuite/g++.old-deja/old-deja.exp
@@ -1,64 +1,3 @@
-# Copyright (C) 1988, 90, 91, 92, 1994, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-g++@prep.ai.mit.edu
-
-# This file was written by Rob Savoye. (rob@cygnus.com)
-
-#
-# these tests come from the original DejaGnu test suite
-# developed at Cygnus Support. If this isn't deja gnu, I
-# don't know what is...
-#
-
-# load support procs
-load_lib old-dejagnu.exp
-load_lib g++.exp
-
-
-# When a testcase doesn't have any special options, use these.
-if ![info exists DEFAULT_CXXFLAGS] {
- set DEFAULT_CXXFLAGS "-ansi -pedantic-errors"
-
-}
-
-old-dejagnu-init
-global GXX_UNDER_TEST
-
-#
-# main test loop
-#
-
-
-foreach file [lsort [find $srcdir/$subdir *.C]] {
- # If we're only testing specific files and this isn't one of them, skip it.
- if ![runtest_file_p $runtests $file] then {
- continue
- }
- verbose "Testing $file"
-
- # We don't want old-dejagnu.exp to have to know about all the global
- # variables we use. For now we tell it about CXXFLAGS and LIBS and
- # leave LDFLAGS alone.
- old-dejagnu $GXX_UNDER_TEST "$file" "" "$DEFAULT_CXXFLAGS" "-lstdc++"
-}
-
-# The framework doesn't like to see any error remnants,
-# so remove them.
-if [info exists errorInfo] then {
- unset errorInfo
-}
+set dirlen [expr [string length "$srcdir/$subdir"] + 1];
+ set tfile [string range $file $dirlen end];
+ if ![runtest_file_p $runtests $tfile] then {
diff --git a/gcc/testsuite/g77.f-torture/compile/970125-0.f b/gcc/testsuite/g77.f-torture/compile/970125-0.f
index d2098bafe39..004f5584f3e 100644
--- a/gcc/testsuite/g77.f-torture/compile/970125-0.f
+++ b/gcc/testsuite/g77.f-torture/compile/970125-0.f
@@ -1,16 +1,40 @@
- integer*4 i4
- integer*8 i8
- integer*8 max4
- data max4/2147483647/
- i4 = %loc(i4)
- i8 = %loc(i8)
- print *, max4
- print *, i4, %loc(i4)
- print *, i8, %loc(i8)
- call foo(i4, %loc(i4), i8, %loc(i8))
- end
- subroutine foo(i4, i4a, i8, i8a)
- integer*8 i8
- print *, i4, i4a
- print *, i8, i8a
- end
+C JCB comments:
+C g77 doesn't accept the added line "integer(kind=7) ..." --
+C it crashes!
+C
+C It's questionable that g77 DTRT with regarding to passing
+C %LOC() as an argument (thus by reference) and the new global
+C analysis. I need to look into that further; my feeling is that
+C passing %LOC() as an argument should be treated like passing an
+C INTEGER(KIND=7) by reference, and no more specially than that
+C (and that INTEGER(KIND=7) should be permitted as equivalent to
+C INTEGER(KIND=1), INTEGER(KIND=2), or whatever, depending on the
+C system's pointer size).
+C
+C The back end *still* has a bug here, which should be fixed,
+C because, currently, what g77 is passing to it is, IMO, correct.
+
+C No options:
+C ../../egcs/gcc/f/info.c:259: failed assertion `ffeinfo_types_[basictype][kindtype] != NULL'
+C -fno-globals -O:
+C ../../egcs/gcc/expr.c:7291: Internal compiler error in function expand_expr
+
+c Frontend bug fixed by JCB 1998-06-01 com.c &c changes.
+
+ integer*4 i4
+ integer*8 i8
+ integer*8 max4
+ data max4/2147483647/
+ i4 = %loc(i4)
+ i8 = %loc(i8)
+ print *, max4
+ print *, i4, %loc(i4)
+ print *, i8, %loc(i8)
+ call foo(i4, %loc(i4), i8, %loc(i8))
+ end
+ subroutine foo(i4, i4a, i8, i8a)
+ integer(kind=7) i4a, i8a
+ integer*8 i8
+ print *, i4, i4a
+ print *, i8, i8a
+ end
diff --git a/gcc/testsuite/g77.f-torture/compile/971014-1.f b/gcc/testsuite/g77.f-torture/compile/971014-1.f
deleted file mode 100644
index 1d95d52e101..00000000000
--- a/gcc/testsuite/g77.f-torture/compile/971014-1.f
+++ /dev/null
@@ -1,12 +0,0 @@
-C
-C RND - Return a random integer mod n
-C
- INTEGER FUNCTION RND (N)
- IMPLICIT INTEGER (A-Z)
- REAL RAND
- COMMON /SEED/ RNSEED
-
- RND = RAND(RNSEED)*FLOAT(N)
- RETURN
-
- END
diff --git a/gcc/testsuite/g77.f-torture/execute/alpha2.f b/gcc/testsuite/g77.f-torture/execute/alpha2.f
index c2241713702..208dec2582d 100644
--- a/gcc/testsuite/g77.f-torture/execute/alpha2.f
+++ b/gcc/testsuite/g77.f-torture/execute/alpha2.f
@@ -1,9 +1,11 @@
- IMPLICIT REAL*8 (A-H,O-Z)
- COMMON /C/ A(9), INT
- DATA A /
- 1 0.49999973986348730D01, 0.40000399113084100D01,
- 2 0.29996921166596490D01, 0.20016917082678680D01,
- 3 0.99126390351864390D00, 0.97963256554443300D-01,
- 4 -0.87360964813570100D-02, 0.16917082678692080D-02,
- 5 -0.26013651283774820D-05 /
- END
+c This was originally a compile test.
+ 5 7./
+C Data values were once mis-compiled on (OSF/1 ?) Alpha with -O2
+c such that, for instance, `7.' appeared as `4.' in the assembler
+c output.
+ call test(a(9), 7)
+ subroutine test(r, i)
+ double precision r
+ if (nint(r)/=i) call abort
+ end
+
diff --git a/gcc/testsuite/g77.f-torture/execute/cabs.f b/gcc/testsuite/g77.f-torture/execute/cabs.f
index 85ee44e573c..406730072d2 100644
--- a/gcc/testsuite/g77.f-torture/execute/cabs.f
+++ b/gcc/testsuite/g77.f-torture/execute/cabs.f
@@ -1,14 +1,2 @@
- program cabs_1
- complex z0
- real r0
- complex*16 z1
- real*8 r1
-
- z0 = cmplx(3.,4.)
- r0 = cabs(z0)
- if (r0 .ne. 5.) call exit(1)
-
- z1 = dcmplx(3.d0,4.d0)
- r1 = zabs(z1)
- if (r1 .ne. 5.d0) call exit(1)
- end
+ if (r0 .ne. 5.) call abort
+ if (r1 .ne. 5.d0) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/claus.f b/gcc/testsuite/g77.f-torture/execute/claus.f
index 051fdff59a9..7f774de4366 100644
--- a/gcc/testsuite/g77.f-torture/execute/claus.f
+++ b/gcc/testsuite/g77.f-torture/execute/claus.f
@@ -1,13 +1,4 @@
- PROGRAM TEST
- REAL AB(3)
- do i=1,3
- AB(i)=i
- enddo
- k=1
- n=2
- ind=k-n+2
- if (ind /= 1) call exit(1)
- if (ab(ind) /= 1) call exit(1)
- if (k-n+2 /= 1) call exit(1)
- if (ab(k-n+2) /= 1) call exit(1)
- END
+ if (ind /= 1) call abort
+ if (ab(ind) /= 1) call abort
+ if (k-n+2 /= 1) call abort
+ if (ab(k-n+2) /= 1) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/complex_1.f b/gcc/testsuite/g77.f-torture/execute/complex_1.f
index 0569be0cdfc..985f0a30246 100644
--- a/gcc/testsuite/g77.f-torture/execute/complex_1.f
+++ b/gcc/testsuite/g77.f-torture/execute/complex_1.f
@@ -1,18 +1,4 @@
- program complex_1
- complex z0, z1, z2
-
- z0 = cmplx(0.,.5)
- z1 = 1./z0
- if (z1 .ne. cmplx(0.,-2)) call exit(1)
-
- z0 = 10.*z0
- if (z0 .ne. cmplx(0.,5.)) call exit(1)
-
- z2 = cmplx(1.,2.)
- z1 = z0/z2
- if (z1 .ne. cmplx(2.,1.)) call exit(1)
-
- z1 = z0*z2
- if (z1 .ne. cmplx(-10.,5.)) call exit(1)
- end
-
+ if (z1 .ne. cmplx(0.,-2)) call abort
+ if (z0 .ne. cmplx(0.,5.)) call abort
+ if (z1 .ne. cmplx(2.,1.)) call abort
+ if (z1 .ne. cmplx(-10.,5.)) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/cpp.F b/gcc/testsuite/g77.f-torture/execute/cpp.F
index 9156cd5b6b1..3efe868c79b 100644
--- a/gcc/testsuite/g77.f-torture/execute/cpp.F
+++ b/gcc/testsuite/g77.f-torture/execute/cpp.F
@@ -1,5 +1 @@
-! Some versions of cpp will delete "//'World' as a C++ comment.
- character*40 title
- title = 'Hello '//'World'
- if (title .ne. 'Hello World') stop 1
- end
+ if (title .ne. 'Hello World') call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/dcomplex.f b/gcc/testsuite/g77.f-torture/execute/dcomplex.f
index 7848ab38f99..7ab9368988f 100644
--- a/gcc/testsuite/g77.f-torture/execute/dcomplex.f
+++ b/gcc/testsuite/g77.f-torture/execute/dcomplex.f
@@ -1,18 +1,4 @@
- program foo
- complex*16 z0, z1, z2
-
- z0 = dcmplx(0.,.5)
- z1 = 1./z0
- if (z1 .ne. dcmplx(0.,-2)) call exit(1)
-
- z0 = 10.*z0
- if (z0 .ne. dcmplx(0.,5.)) call exit(1)
-
- z2 = cmplx(1.,2.)
- z1 = z0/z2
- if (z1 .ne. dcmplx(2.,1.)) call exit(1)
-
- z1 = z0*z2
- if (z1 .ne. dcmplx(-10.,5.)) call exit(1)
- end
-
+ if (z1 .ne. dcmplx(0.,-2)) call abort
+ if (z0 .ne. dcmplx(0.,5.)) call abort
+ if (z1 .ne. dcmplx(2.,1.)) call abort
+ if (z1 .ne. dcmplx(-10.,5.)) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/dnrm2.f b/gcc/testsuite/g77.f-torture/execute/dnrm2.f
index 9668966ac94..c69608786b9 100644
--- a/gcc/testsuite/g77.f-torture/execute/dnrm2.f
+++ b/gcc/testsuite/g77.f-torture/execute/dnrm2.f
@@ -19,7 +19,7 @@ c current Netlib BLAS.)
do i=1,100
a(i)=0.D0
enddo
- if (dnrm2(100,a,1) .ne. 0.0) call exit(1)
+ if (dnrm2(100,a,1) .ne. 0.0) call abort
end
double precision function dnrm2 ( n, dx, incx)
diff --git a/gcc/testsuite/g77.f-torture/execute/erfc.f b/gcc/testsuite/g77.f-torture/execute/erfc.f
index b3cf7f6b36f..4123091825b 100644
--- a/gcc/testsuite/g77.f-torture/execute/erfc.f
+++ b/gcc/testsuite/g77.f-torture/execute/erfc.f
@@ -1,37 +1,6 @@
-c============================================== test.f
- real x, y
- real*8 x1, y1
- x=0.
- y = erfc(x)
- if (y .ne. 1.) call exit(1)
-
- x=1.1
- y = erfc(x)
- if (abs(y - .1197949) .ge. 1.e-6) call exit(1)
-
- x=10
- y = erfc(x)
- if (y .gt. 1.5e-44) call exit(1)
-
- x1=0.
- y1 = erfc(x1)
- if (y1 .ne. 1.) call exit(1)
-
- x1=1.1d0
- y1 = erfc(x1)
- if (abs(y1 - .1197949d0) .ge. 1.d-6) call exit(1)
-
- x1=10
- y1 = erfc(x1)
- if (y1 .gt. 1.5d-44) call exit(1)
- end
-c=================================================
-!output:
-! 0. 1.875
-! 1.10000002 1.48958981
-! 10. 5.00220949E-06
-!
-!The values should be:
-!erfc(0)=1
-!erfc(1.1)= 0.1197949
-!erfc(10)<1.543115467311259E-044
+ if (y .ne. 1.) call abort
+ if (abs(y - .1197949) .ge. 1.e-6) call abort
+ if (y .gt. 1.5e-44) call abort
+ if (y1 .ne. 1.) call abort
+ if (abs(y1 - .1197949d0) .ge. 1.d-6) call abort
+ if (y1 .gt. 1.5d-44) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/exp.f b/gcc/testsuite/g77.f-torture/execute/exp.f
index 6ae7ae354f9..5f0e0ce0735 100644
--- a/gcc/testsuite/g77.f-torture/execute/exp.f
+++ b/gcc/testsuite/g77.f-torture/execute/exp.f
@@ -1,3 +1 @@
- a = 2**-2*1.
- if (a .ne. .25) call exit(1)
- end
+ if (a .ne. .25) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/le.f b/gcc/testsuite/g77.f-torture/execute/le.f
index e315671760e..40c74972863 100644
--- a/gcc/testsuite/g77.f-torture/execute/le.f
+++ b/gcc/testsuite/g77.f-torture/execute/le.f
@@ -1,29 +1,9 @@
- program fool
-
- real foo
- integer n
- logical t
-
- foo = 2.5
- n = 5
-
- t = (n > foo)
- if (t .neqv. .true.) call exit(1)
- t = (n >= foo)
- if (t .neqv. .true.) call exit(1)
- t = (n < foo)
- if (t .neqv. .false.) call exit(1)
- t = (n <= 5)
- if (t .neqv. .true.) call exit(1)
- t = (n >= 5 )
- if (t .neqv. .true.) call exit(1)
- t = (n == 5)
- if (t .neqv. .true.) call exit(1)
- t = (n /= 5)
- if (t .neqv. .false.) call exit(1)
- t = (n /= foo)
- if (t .neqv. .true.) call exit(1)
- t = (n == foo)
- if (t .neqv. .false.) call exit(1)
-
- end
+ if (t .neqv. .true.) call abort
+ if (t .neqv. .true.) call abort
+ if (t .neqv. .false.) call abort
+ if (t .neqv. .true.) call abort
+ if (t .neqv. .true.) call abort
+ if (t .neqv. .true.) call abort
+ if (t .neqv. .false.) call abort
+ if (t .neqv. .true.) call abort
+ if (t .neqv. .false.) call abort
diff --git a/gcc/testsuite/g77.f-torture/execute/short.f b/gcc/testsuite/g77.f-torture/execute/short.f
index b5964b51489..908e8e3c9f0 100644
--- a/gcc/testsuite/g77.f-torture/execute/short.f
+++ b/gcc/testsuite/g77.f-torture/execute/short.f
@@ -1,57 +1,4 @@
- program short
-
- parameter ( N=2 )
- common /chb/ pi,sig(0:N)
- common /parm/ h(2,2)
-
-c initialize some variables
- h(2,2) = 1117
- h(2,1) = 1178
- h(1,2) = 1568
- h(1,1) = 1621
- sig(0) = -1.
- sig(1) = 0.
- sig(2) = 1.
-
- call printout
- stop
- end
-
-c ******************************************************************
-
- subroutine printout
- parameter ( N=2 )
- common /chb/ pi,sig(0:N)
- common /parm/ h(2,2)
- dimension yzin1(0:N), yzin2(0:N)
-
-c function subprograms
- z(i,j,k) = 0.5*h(i,j)*(sig(k)-1.)
-
-c a four-way average of rhobar
- do 260 k=0,N
- yzin1(k) = 0.25 *
- & ( z(2,2,k) + z(1,2,k) +
- & z(2,1,k) + z(1,1,k) )
- 260 continue
-
-c another four-way average of rhobar
- do 270 k=0,N
- rtmp1 = z(2,2,k)
- rtmp2 = z(1,2,k)
- rtmp3 = z(2,1,k)
- rtmp4 = z(1,1,k)
- yzin2(k) = 0.25 *
- & ( rtmp1 + rtmp2 + rtmp3 + rtmp4 )
- 270 continue
-
- do k=0,N
- if (yzin1(k) .ne. yzin2(k)) call exit(1)
- enddo
- if (yzin1(0) .ne. -1371.) call exit(1)
- if (yzin1(1) .ne. -685.5) call exit(1)
- if (yzin1(2) .ne. 0.) call exit(1)
-
- return
- end
-
+ if (yzin1(k) .ne. yzin2(k)) call abort
+ if (yzin1(0) .ne. -1371.) call abort
+ if (yzin1(1) .ne. -685.5) call abort
+ if (yzin1(2) .ne. 0.) call abort
diff --git a/gcc/testsuite/gcc.c-torture/980408-1.c b/gcc/testsuite/gcc.c-torture/980408-1.c
deleted file mode 100644
index 09bf430406e..00000000000
--- a/gcc/testsuite/gcc.c-torture/980408-1.c
+++ /dev/null
@@ -1,129 +0,0 @@
-typedef struct _RunlengthPacket
-{
- unsigned short
- red,
- green,
- blue,
- length;
- unsigned short
- index;
-} RunlengthPacket;
-typedef struct _Image
-{
- int
- status,
- temporary;
- char
- filename[1664 ];
- long int
- filesize;
- int
- pipe;
- char
- magick[1664 ],
- *comments,
- *label,
- *text;
- unsigned int
- matte;
- unsigned int
- columns,
- rows,
- depth;
- unsigned int
- scene,
- number_scenes;
- char
- *montage,
- *directory;
- unsigned int
- colors;
- double
- gamma;
- float
- x_resolution,
- y_resolution;
- unsigned int
- mean_error_per_pixel;
- double
- normalized_mean_error,
- normalized_maximum_error;
- unsigned long
- total_colors;
- char
- *signature;
- unsigned int
- packets,
- runlength,
- packet_size;
- unsigned char
- *packed_pixels;
- long int
- magick_time;
- char
- magick_filename[1664 ];
- unsigned int
- magick_columns,
- magick_rows;
- char
- *geometry,
- *page;
- unsigned int
- dispose,
- delay,
- iterations;
- unsigned int
- orphan;
- struct _Image
- *previous,
- *list,
- *next;
-} Image;
- Image *MinifyImage(Image *image)
-{
- Image
- *minified_image;
- register RunlengthPacket
- *q,
- *s,
- *s0,
- *s1,
- *s2,
- *s3;
- register unsigned int
- x;
- unsigned int
- blue,
- green,
- red;
- unsigned long
- total_matte,
- total_blue,
- total_green,
- total_red;
- unsigned short
- index;
- for (x=0; x < (image->columns-1); x+=2)
- {
- total_red=0;
- total_green=0;
- total_blue=0;
- total_matte=0;
- s=s0;
- total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ;
- s=s1;
- total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ;
- s=s2;
- total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ;
- s=s3;
- total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ;
- red=(unsigned short) ((total_red+63) >> 7);
- green=(unsigned short) ((total_green+63) >> 7);
- blue=(unsigned short) ((total_blue+63) >> 7);
- index=(unsigned short) ((total_matte+63) >> 7);
- if ((red == q->red) && (green == q->green) && (blue == q->blue) &&
- (index == q->index) && ((int) q->length < 65535L ))
- q->length++;
- }
- return(minified_image);
-}
diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog
index 773bc647b21..6663d8a8dbb 100644
--- a/gcc/testsuite/gcc.c-torture/ChangeLog
+++ b/gcc/testsuite/gcc.c-torture/ChangeLog
@@ -1,3 +1,49 @@
+1998-10-06 Ken Raeburn <raeburn@cygnus.com>
+
+ * special/981006-1.c: New test. Make sure gcc doesn't lose track
+ of the possible targets of tablejump insns.
+ * special/special.exp: Run it.
+
+Thu Oct 1 17:15:26 1998 Nick Clifton <nickc@cygnus.com>
+
+ * compile/981001-1.c: New test.
+ * execute/981001-1.c: New test.
+
+Wed Aug 26 16:10:00 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * execute/loop-4b.c: New test.
+
+Mon Aug 24 14:20:32 1998 Nick Clifton <nickc@cygnus.com>
+
+ * execute/bcp-1.c (main): Fix optimize test loop to count number
+ tests in opt_t0 not good_t0.
+
+Thu Aug 13 00:13:55 1998 Jeffrey A Law (law@cygnus.com)
+
+ * execute/ieee/ieee.exp: Pass -ffloat-store to compiler for
+ ieee tests.
+
+Mon Jul 27 11:05:07 1998 Nick Clifton <nickc@cygnus.com>
+
+ * execute/ieee/930529-1.c (main): Check to see if __thumb__ is
+ defined, and test for ARM style doubles if so.
+
+Fri Jul 24 11:02:43 1998 Nick Clifton <nickc@cygnus.com>
+
+ * execute/comp-goto-1.c (main): Make main() return an int.
+
+Thu Jun 18 15:12:30 1998 Michael Meissner <meissner@cygnus.com>
+
+ * execute/980618-{1,2}.c: New tests that showed up m32r bugs.
+
+Fri Jun 5 21:54:26 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * execute/980605-1.c: New test.
+
+Sun May 31 23:23:29 1998 Michael Meissner <meissner@cygnus.com>
+
+ * execute/ieee/mzero2.c: New test to better test IEEE -0 support.
+
Wed Apr 8 13:09:15 1998 Jim Wilson <wilson@cygnus.com>
* execute/980407-1.c: Delete test. Is duplicate of loop-4.c.
diff --git a/gcc/testsuite/gcc.c-torture/execute/920715-1.x b/gcc/testsuite/gcc.c-torture/execute/920715-1.x
index 28da30bbcd3..e6ecdff07d8 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920715-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/920715-1.x
@@ -1,10 +1,4 @@
-# This doesn't work on h8300s
-# It also doesn't work on d10v if doubles are not 64 bits
-
-if { [istarget "h8300*-*-*"] || [istarget "mn10200*-*-*"] } {
- set torture_execute_xfail "h8300*-*-*"
- set torture_execute_xfail "mn10200*-*-*"
-}
+# It doesn't work on d10v if doubles are not 64 bits
if { [istarget "d10v-*-*"] && ! [string-match "*-mdouble64*" $CFLAGS] } {
set torture_execute_xfail "d10v-*-*"
diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
index 04c7503115d..b5287f33795 100644
--- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
@@ -1,164 +1 @@
-#include <stdlib.h>
-
-#ifndef NO_LABEL_VALUES
-typedef unsigned int uint32;
-typedef signed int sint32;
-
-typedef uint32 reg_t;
-
-typedef unsigned long int host_addr_t;
-typedef uint32 target_addr_t;
-typedef sint32 target_saddr_t;
-
-typedef union
-{
- struct
- {
- unsigned int offset:18;
- unsigned int ignore:4;
- unsigned int s1:8;
- int :2;
- signed int simm:14;
- unsigned int s3:8;
- unsigned int s2:8;
- int pad2:2;
- } f1;
- long long ll;
- double d;
-} insn_t;
-
-typedef struct
-{
- target_addr_t vaddr_tag;
- unsigned long int rigged_paddr;
-} tlb_entry_t;
-
-typedef struct
-{
- insn_t *pc;
- reg_t registers[256];
- insn_t *program;
- tlb_entry_t tlb_tab[0x100];
-} environment_t;
-
-enum operations
-{
- LOAD32_RR,
- METAOP_DONE
-};
-
-host_addr_t
-f ()
-{
- abort ();
-}
-
-reg_t
-simulator_kernel (int what, environment_t *env)
-{
- register insn_t *pc = env->pc;
- register reg_t *regs = env->registers;
- register insn_t insn;
- register int s1;
- register reg_t r2;
- register void *base_addr = &&sim_base_addr;
- register tlb_entry_t *tlb = env->tlb_tab;
-
- if (what != 0)
- {
- int i;
- static void *op_map[] =
- {
- &&L_LOAD32_RR,
- &&L_METAOP_DONE,
- };
- insn_t *program = env->program;
- for (i = 0; i < what; i++)
- program[i].f1.offset = op_map[program[i].f1.offset] - base_addr;
- }
-
- sim_base_addr:;
-
- insn = *pc++;
- r2 = (*(reg_t *) (((char *) regs) + (insn.f1.s2 << 2)));
- s1 = (insn.f1.s1 << 2);
- goto *(base_addr + insn.f1.offset);
-
- L_LOAD32_RR:
- {
- target_addr_t vaddr_page = r2 / 4096;
- unsigned int x = vaddr_page % 0x100;
- insn = *pc++;
-
- for (;;)
- {
- target_addr_t tag = tlb[x].vaddr_tag;
- host_addr_t rigged_paddr = tlb[x].rigged_paddr;
-
- if (tag == vaddr_page)
- {
- *(reg_t *) (((char *) regs) + s1) = *(uint32 *) (rigged_paddr + r2);
- r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2));
- s1 = insn.f1.s1 << 2;
- goto *(base_addr + insn.f1.offset);
- }
-
- if (((target_saddr_t) tag < 0))
- {
- *(reg_t *) (((char *) regs) + s1) = *(uint32 *) f ();
- r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2));
- s1 = insn.f1.s1 << 2;
- goto *(base_addr + insn.f1.offset);
- }
-
- x = (x - 1) % 0x100;
- }
-
- L_METAOP_DONE:
- return (*(reg_t *) (((char *) regs) + s1));
- }
-}
-
-insn_t program[2 + 1];
-
-void *malloc ();
-
-void
-main ()
-{
- environment_t env;
- insn_t insn;
- int i, res;
- host_addr_t a_page = (host_addr_t) malloc (2 * 4096);
- target_addr_t a_vaddr = 0x123450;
- target_addr_t vaddr_page = a_vaddr / 4096;
- a_page = (a_page + 4096 - 1) & -4096;
-
- env.tlb_tab[((vaddr_page) % 0x100)].vaddr_tag = vaddr_page;
- env.tlb_tab[((vaddr_page) % 0x100)].rigged_paddr = a_page - vaddr_page * 4096;
- insn.f1.offset = LOAD32_RR;
- env.registers[0] = 0;
- env.registers[2] = a_vaddr;
- *(int *) (a_page + a_vaddr % 4096) = 88;
- insn.f1.s1 = 0;
- insn.f1.s2 = 2;
-
- for (i = 0; i < 2; i++)
- program[i] = insn;
-
- insn.f1.offset = METAOP_DONE;
- insn.f1.s1 = 0;
- program[2] = insn;
-
- env.pc = program;
- env.program = program;
-
- res = simulator_kernel (2 + 1, &env);
-
- if (res != 88)
- abort ();
- exit (0);
-}
-#else
-main(){ exit (0); }
-#endif
+int
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c
index 0b5eda4ac9a..596f816c13f 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c
@@ -1,27 +1 @@
-main ()
-{
- union {
- double d;
- unsigned char c[8];
- } d;
-
- d.d = 1.0/7.0;
-
- if (sizeof (char) * 8 == sizeof (double))
- {
- if (d.c[0] == 0x92 && d.c[1] == 0x24 && d.c[2] == 0x49 && d.c[3] == 0x92
- && d.c[4] == 0x24 && d.c[5] == 0x49 && d.c[6] == 0xc2 && d.c[7] == 0x3f)
- exit (0);
- if (d.c[7] == 0x92 && d.c[6] == 0x24 && d.c[5] == 0x49 && d.c[4] == 0x92
- && d.c[3] == 0x24 && d.c[2] == 0x49 && d.c[1] == 0xc2 && d.c[0] == 0x3f)
- exit (0);
-#ifdef __arm__
- if (d.c[4] == 0x92 && d.c[5] == 0x24 && d.c[6] == 0x49 && d.c[7] == 0x92
- && d.c[0] == 0x24 && d.c[1] == 0x49 && d.c[2] == 0xc2 && d.c[3] == 0x3f)
- exit (0);
-#endif
- abort ();
- }
-
- exit (0);
-}
+#if defined __arm__ || defined __thumb__
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c
index 3c3ccb65c09..32691b275b1 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c
@@ -1,40 +1,7 @@
-#include <signal.h>
-
-double nan = 1.0/0.0 - 1.0/0.0;
-double x = 1.0;
-
-void leave ()
-{
- exit (0);
-}
-
-main ()
-{
-#if ! defined (__vax__) && ! defined (_CRAY)
- /* NaN is an IEEE unordered operand. All these test should be false. */
- if (nan == nan)
- abort ();
- if (nan != x)
- x = 1.0;
- else
- abort ();
-
+ /* Move this line earlier, for architectures (like alpha) that issue
+ SIGFPE on the first comparisons. */
#ifndef SIGNAL_SUPPRESS
/* Some machines catches a SIGFPE when a NaN is compared.
Let this test succeed o such machines. */
signal (SIGFPE, leave);
#endif
-
- if (nan < x)
- abort ();
- if (nan > x)
- abort ();
- if (nan <= x)
- abort ();
- if (nan >= x)
- abort ();
- if (nan == x)
- abort ();
-#endif
- exit (0);
-}
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
index 55f7f27625b..903d5cef147 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
@@ -34,6 +34,10 @@ if [target_info exists ieee_multilib_flags] {
set additional_flags "";
}
+# We must use -ffloat-store to ensure that excess precision on some machines
+# does not cause problems
+lappend additional_flags "-ffloat-store"
+
# load support procs
load_lib c-torture.exp
diff --git a/gcc/testsuite/gcc.c-torture/special/special.exp b/gcc/testsuite/gcc.c-torture/special/special.exp
index 9b1142149e6..3e2bc044e29 100644
--- a/gcc/testsuite/gcc.c-torture/special/special.exp
+++ b/gcc/testsuite/gcc.c-torture/special/special.exp
@@ -1,100 +1,17 @@
-# Copyright (C) 1988, 90-96, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gcc@prep.ai.mit.edu
-
-# This file was written by Rob Savoye. (rob@cygnus.com)
-
-#
-# These tests come from Torbjorn Granlund (tege@cygnus.com)
-# C torture test suite.
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-# load support procs
-load_lib c-torture.exp
-load_lib gcc-dg.exp
-
-################## ADD NEXT CASE HERE (NOT AT THE END) ##################
-
-# 921210-1
-set lines [gcc_target_compile $srcdir/$subdir/921210-1.c "" preprocess ""]
-set lines [split [prune_warnings [prune_gcc_output $lines]] "\n"]
-set line [lindex $lines [expr [llength $lines]-1]]
-regsub -all " " $line "" clean
-if [expr [string compare $clean "(a->f+1)+1"]==0] then {
- pass "921210-1.c"
+# 981006-1
+# For MIPS at least, pic is needed to trigger the problem.
+dg-init
+if { [istarget rs6000-*-aix*]
+ || [istarget powerpc*-*-aix*]
+ || [istarget arm*-*-*]
+} {
+ set extra_flags ""
} else {
- fail "921210-1.c"
+ set extra_flags "-fpic"
}
-
-# 920521-1
-c-torture 920521-1.c "-S"
-
-# 920520-1
-c-torture 920520-1.c "-S"
-
-# 920717-1
-if [isnative] then {
- set lines [gcc_target_compile "$srcdir/$subdir/920717-x.c" "920717-x.o" object {additional_flags="-w"}]
- if ![string match "" $lines] then {
- fail "920717-x.c"
- } else {
- # This is a completely bogus test. Sorry.
- catch exec "rm -f 920717-y.o"
- send_log "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
- catch exec "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
- if ![file exists "920717-y.o"] then {
- send_log "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
- catch exec "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
- }
- if [file exists "920717-y.o"] then {
- set lines [gcc_target_compile "920717-y.o x.o" "x" executable ""]
- if [string match "" $lines] then {
- pass "920717-1.c"
- } else {
- fail "920717-1.c"
- }
- }
- }
-}
-
-# 920730-1
-if [isnative] then {
- c-torture "920730-1.c"
- c-torture "920730-1.c" "-traditional"
-}
-
-# 920413-1
-c-torture 920413-1.c "-Wtraditional"
-
-# 930510-1
-dg-init
-dg-runtest $srcdir/$subdir/930510-1.c "" ""
+dg-runtest $srcdir/$subdir/981006-1.c "-Wuninitialized -O2 $extra_flags" ""
dg-finish
-# 951130-1
-c-torture 951130-1.c "-Werror"
-
-# 960224-1
-c-torture 960224-1.c "-E -ansi -pedantic-errors"
+set lines [prune [split [prune_warnings [prune_gcc_output $lines]] "\n"] ""]
-# 960224-2
-#c-torture 960224-2.c "-E -ansi -pedantic-errors"
+c-torture-execute $srcdir/$subdir/eeprof-1.c "-finstrument-functions"
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/memtst.c b/gcc/testsuite/gcc.c-torture/unsorted/memtst.c
index b345ba00b3c..127aa2005a2 100644
--- a/gcc/testsuite/gcc.c-torture/unsorted/memtst.c
+++ b/gcc/testsuite/gcc.c-torture/unsorted/memtst.c
@@ -1,20 +1,9 @@
-memtst (int *p, int a)
-{
- do
- {
- if (p[a] == 1)
- break;
- }
- while (--a);
-}
+#ifdef STACK_SIZE
+#define SIZE STACK_SIZE / 8
+#else
+#define SIZE 65536
+#endif
-main ()
-{
- int a[65536];
- int i;
- bzero (a, 65536 * 4);
- for (i = 0; i < 100; i++)
- {
- memtst (a, 65536);
- }
-}
+ int a[SIZE];
+ bzero (a, SIZE * 4);
+ memtst (a, SIZE);
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/stuct.c b/gcc/testsuite/gcc.c-torture/unsorted/stuct.c
index bf7e2329bd9..4fe4d0ad559 100644
--- a/gcc/testsuite/gcc.c-torture/unsorted/stuct.c
+++ b/gcc/testsuite/gcc.c-torture/unsorted/stuct.c
@@ -1,16 +1,7 @@
-struct foo
-{
- int a, b, c;
- int arr[10000000];
-};
+#ifdef STACK_SIZE
+#define SIZE STACK_SIZE / 8
+#else
+#define SIZE 10000000
+#endif
-struct foo s, ss;
-
-main ()
-{
-
- s.b = 2;
- s.c = 3;
- ss.b = 2;
- ss.c = 3;
-}
+ int arr[SIZE];
diff --git a/gcc/testsuite/gcc.dg/980312-1.c b/gcc/testsuite/gcc.dg/980312-1.c
index 3defda28cce..8f72c31d341 100644
--- a/gcc/testsuite/gcc.dg/980312-1.c
+++ b/gcc/testsuite/gcc.dg/980312-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target i?86-*-* } } */
+/* { dg-do link { target i?86-*-* } } */
/* { dg-options "-O2 -march=pentiumpro" } */
extern __inline double
@@ -18,3 +18,7 @@ tanh (double __x)
{
return __expm1 (__x) * __sgn1 (-__x);
}
+main ()
+{
+ return tanh (3.45) != 0;
+}
diff --git a/gcc/testsuite/gcc.dg/980313-1.c b/gcc/testsuite/gcc.dg/980313-1.c
index 746e4631b08..1036339b076 100644
--- a/gcc/testsuite/gcc.dg/980313-1.c
+++ b/gcc/testsuite/gcc.dg/980313-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target i?86-*-* } } */
+/* { dg-do link { target i?86-*-* } } */
/* { dg-options "-O2 -march=pentiumpro" } */
extern __inline double
@@ -19,3 +19,7 @@ tanh (double __x)
register double __exm1 = __expm1 (__x);
return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x);
}
+main ()
+{
+ return tanh (3.45) != 0;
+}
diff --git a/gcc/testsuite/gcc.dg/980414-1.c b/gcc/testsuite/gcc.dg/980414-1.c
index 9646f6dd615..8fd0e127296 100644
--- a/gcc/testsuite/gcc.dg/980414-1.c
+++ b/gcc/testsuite/gcc.dg/980414-1.c
@@ -29,12 +29,12 @@ mypow (double __x, double __y)
}
}
__asm __volatile__
- ("fmul %%st(1) # y * log2(x)\n\t"
- "fstl %%st(1)\n\t"
- "frndint # int(y * log2(x))\n\t"
+ ("fmul %%st(1),%%st\n\t" /* y * log2(x) */
+ "fst %%st(1)\n\t"
+ "frndint\n\t" /* int(y * log2(x)) */
"fxch\n\t"
- "fsub %%st(1) # fract(y * log2(x))\n\t"
- "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t"
+ "fsub %%st(1),%%st\n\t" /* fract(y * log2(x)) */
+ "f2xm1\n\t" /* 2^(fract(y * log2(x))) - 1 */
: "=t" (__value), "=u" (__exponent) : "0" (__x), "1" (__y));
__value += 1.0;
__asm __volatile__
diff --git a/gcc/testsuite/gcc.dg/980502-1.c b/gcc/testsuite/gcc.dg/980502-1.c
index ec4749d52b1..f06491cd96c 100644
--- a/gcc/testsuite/gcc.dg/980502-1.c
+++ b/gcc/testsuite/gcc.dg/980502-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile }*/
/* { dg-options "-O2" } */
-void f(void)
+char *const f(void)
{
char *const line = "/dev/ptyXX";
line[8] = 1;
diff --git a/gcc/testsuite/gcc.dg/switch-1.c b/gcc/testsuite/gcc.dg/switch-1.c
index 480f077d908..457c5205388 100644
--- a/gcc/testsuite/gcc.dg/switch-1.c
+++ b/gcc/testsuite/gcc.dg/switch-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile }*/
+/* { dg-do compile { target rs6000-*-linux* powerpc-*-linux*} } */
/* { dg-options "-fpic -O2" } */
void f (char *s)
diff --git a/gcc/testsuite/lib/c-torture.exp b/gcc/testsuite/lib/c-torture.exp
index e7d559767dd..3ff1de0e459 100644
--- a/gcc/testsuite/lib/c-torture.exp
+++ b/gcc/testsuite/lib/c-torture.exp
@@ -15,7 +15,7 @@
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-dejagnu.prep.ai.mit.edu
+# bug-dejagnu@gnu.org.
# This file was written by Rob Savoye. (rob@cygnus.com)
@@ -184,6 +184,13 @@ proc c-torture-execute { src args } {
if [info exists torture_compile_xfail] {
setup_xfail $torture_compile_xfail
}
+
+ # torture_execute_before_{compile,execute} can be set by the .x script
+ # (if present)
+ if [info exists torture_eval_before_compile] {
+ set ignore_me [eval $torture_eval_before_compile]
+ }
+
remote_file build delete $execname;
verbose "Testing $testcase, $option" 1
@@ -252,6 +259,11 @@ proc c-torture-execute { src args } {
if [info exists torture_execute_xfail] {
setup_xfail $torture_execute_xfail
}
+
+ if [info exists torture_eval_before_execute] {
+ set ignore_me [eval $torture_eval_before_execute]
+ }
+
set skip 0;
if [info exists oldexec] {
if { [remote_file build cmp $oldexec $execname] == 0 } {
@@ -343,6 +355,11 @@ proc c-torture { args } {
setup_xfail $torture_compile_xfail
}
+ # torture_execute_before_compile is set by the .x script (if present)
+ if [info exists torture_eval_before_compile] {
+ set ignore_me [eval $torture_eval_before_compile]
+ }
+
c-torture-compile $src "$option $options"
}
}
diff --git a/gcc/testsuite/lib/f-torture.exp b/gcc/testsuite/lib/f-torture.exp
index 465b932f854..2be2b3abef7 100644
--- a/gcc/testsuite/lib/f-torture.exp
+++ b/gcc/testsuite/lib/f-torture.exp
@@ -15,7 +15,7 @@
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-dejagnu.prep.ai.mit.edu
+# bug-dejagnu@gnu.org.
# This file was written by Rob Savoye. (rob@cygnus.com)
diff --git a/gcc/testsuite/lib/g77.exp b/gcc/testsuite/lib/g77.exp
index ba46a9f5499..3b2beb34b56 100644
--- a/gcc/testsuite/lib/g77.exp
+++ b/gcc/testsuite/lib/g77.exp
@@ -51,14 +51,15 @@ proc default_g77_version { } {
# verify that the compiler exists
if { $compiler_name != 0 } then {
- set tmp [remote_exec host "$compiler -v"]
- set status [lindex $tmp 0];
- set output [lindex $tmp 1];
- regexp "version.*$" $output version
- if { $status == 0 && [info exists version] } then {
+ set options ""
+
+ lappend options "additional_flags=-v"
+ set tmp [g77_target_compile "" "" "none" $options]
+ regexp "g77 version\[^\n\]*" $tmp version
+ if { [info exists version] } then {
clone_output "$compiler_name $version\n"
} else {
- clone_output "Couldn't determine version of $compiler_name: $output\n"
+ clone_output "Couldn't determine version of $compiler_name: $tmp\n"
}
} else {
# compiler does not exist (this should have already been detected)
@@ -143,10 +144,10 @@ proc g77_target_compile { source dest type options } {
}
if ![is_remote host] {
set gccpath "[get_multilibs]"
- set libf2c_dir [lookfor_file ${gccpath} libf2c/libf2c.a]
- if { $libf2c_dir != "" } {
- set libf2c_link_flags "-L[file dirname ${libf2c_dir}]"
- lappend options "additional_flags=${libf2c_link_flags}"
+ set libg2c_dir [lookfor_file ${gccpath} libf2c/libg2c.a]
+ if { $libg2c_dir != "" } {
+ set libg2c_link_flags "-L[file dirname ${libg2c_dir}]"
+ lappend options "additional_flags=${libg2c_link_flags}"
}
}
lappend options "compiler=$G77_UNDER_TEST"
diff --git a/gcc/testsuite/lib/old-dejagnu.exp b/gcc/testsuite/lib/old-dejagnu.exp
index 3f6e9675119..30d2236d423 100644
--- a/gcc/testsuite/lib/old-dejagnu.exp
+++ b/gcc/testsuite/lib/old-dejagnu.exp
@@ -382,6 +382,15 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
set message [concat $message $tmp]
}
+ set expect_crash \
+ [process-option $prog "crash test - " "a crash" CRASH $text]
+ if {$expect_crash != ""
+ && [lindex [lindex $expect_crash 0] 1] == "XCRASH"} then {
+ set expect_crash 1
+ } else {
+ set expect_crash 0
+ }
+
#
# run the compiler and analyze the results
#
@@ -394,21 +403,20 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
# Delete things like "ld.so: warning" messages.
set comp_output [prune_warnings $comp_output]
- if [string match "*Internal compiler error: program*got fatal signal 6" $comp_output] then {
- fail "$name Got Signal 6"
- remote_file build delete $output
- return 1
- }
- if [string match "*Internal compiler error: program*got fatal signal 11" $comp_output] then {
- fail "$name Got Signal 11"
- remote_file build delete $output
- return 1
+ if [string match "*Internal compiler error*" $comp_output] then {
+ if $expect_crash then {
+ setup_xfail "*-*-*"
+ }
+ fail "$name caused compiler crash"
+ remote_file build delete $output
+ return 1
}
#send_user "\nold_dejagnu.exp: comp_output1 = :$comp_output:\n\n"
#send_user "\nold_dejagnu.exp: message = :$message:\n\n"
#send_user "\nold_dejagnu.exp: message length = [llength $message]\n\n"
+ set last_line 0
foreach i $message {
#send_user "\nold_dejagnu.exp: i = :$i:\n\n"
@@ -417,7 +425,15 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
# in the source file. If we find any, success!
set line [lindex $i 0]
set pattern [lindex $i 2]
- if [regsub -all "(^|\n)\[^\n\]+:$line:\[^\n\]*" $comp_output "" comp_output] then {
+
+ # Multiple tests one one line don't work, because we remove all
+ # messages on the line for the first test. So skip later ones.
+ if { $line == $last_line } {
+ continue
+ }
+ set last_line $line
+
+ if [regsub -all "(^|\n)\[^\n\]+:$line:\[^\n\]*" $comp_output "" comp_output] {
set comp_output [string trimleft $comp_output]
set ok pass
set uhoh fail
@@ -489,6 +505,8 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
#look to see if this is all thats left, if so, all messages have been handled
#send_user "comp_output: $comp_output\n"
regsub -all "(^|\n)\[^\n\]*: In (function|method) \[^\n\]*" $comp_output "" comp_output
+ regsub -all "(^|\n)\[^\n\]*: In instantiation of \[^\n\]*" $comp_output "" comp_output
+ regsub -all "(^|\n)\[^\n\]*: instantiated from \[^\n\]*" $comp_output "" comp_output
regsub -all "(^|\n)\[^\n\]*: At top level:\[^\n\]*" $comp_output "" comp_output
regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output
regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output
diff --git a/gcc/texinfo.tex b/gcc/texinfo.tex
index 44ea22c38ae..4327aa3ecc2 100644
--- a/gcc/texinfo.tex
+++ b/gcc/texinfo.tex
@@ -25,21 +25,19 @@
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
-% (and all GNU mirrors)
-% ftp://tug.org/tex/texinfo.tex
-% ftp://ctan.org/macros/texinfo/texinfo.tex
-% (and all CTAN mirrors, finger ctan@tug.org for a list).
+% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% (and all GNU mirrors, see ftp://ftp.gnu.org/pub/gnu/README.mirrors)
+% ftp://tug.org/tex/texinfo.tex
+% ftp://ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@tug.org for a list).
+% The texinfo.tex in the texinfo distribution itself could well be out
+% of date, so if that's what you're using, please check.
%
% Send bug reports to bug-texinfo@gnu.org.
% Please include a precise test case in each bug report,
% including a complete document with which we can reproduce the problem.
%
-% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
-% have to run makeinfo -E to expand macros first; the texi2dvi script
-% does this.
-%
% To process a Texinfo manual with TeX, it's most reliable to use the
% texi2dvi shell script that comes with the distribution. For simple
% manuals, you can get away with:
@@ -147,15 +145,10 @@
% Dimensions to add cropmarks at corners.
% Added by P. A. MacKay, 12 Nov. 1986
%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen\topandbottommargin
-\newdimen\outerhsize \newdimen\outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
% Main output routine.
\chardef\PAGE = 255
@@ -791,13 +784,6 @@ where each line of input produces a line of output.}
\def\menu{\doignore{menu}}
\def\direntry{\doignore{direntry}}
-% Also ignore @macro ... @end macro. The user must run texi2dvi,
-% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
-\def\macro{\doignore{macro}}
-\def\macrocsname{macro}
-\let\unmacro = \comment
-
-
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
\let\dircategory = \comment
@@ -828,13 +814,7 @@ where each line of input produces a line of output.}
% @c @end ifinfo
% and the @end ifinfo will be properly ignored.
% (We've just changed @ to catcode 12.)
- %
- % But we can't do this if #1 is `macro', since that actually contains a c.
- % Happily, none of the other conditionals have the letter `c' in their names!
- \def\temp{#1}%
- \ifx\temp\macrocsname \else
- \catcode`\c = 14
- \fi
+ \catcode`\c = 14
%
% And now expand that command.
\doignoretext
@@ -965,13 +945,24 @@ where each line of input produces a line of output.}
\def\value{\begingroup
\catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
\valuexxx}
-\def\valuexxx#1{%
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}%
+ {[No value for ``#1'']v}%
\else
\csname SET#1\endcsname
\fi
-\endgroup}
+}
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
@@ -1079,12 +1070,21 @@ where each line of input produces a line of output.}
% @refill is a no-op.
\let\refill=\relax
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
- \readauxfile
- \opencontents
+ \iflinks
+ \readauxfile
+ \opencontents
+ \fi % \openindices needs to do some work in any case.
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
@@ -1100,30 +1100,25 @@ where each line of input produces a line of output.}
\comment % Ignore the actual filename.
}
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
-% \def\macroxxx#1#2 \end macro{%
-% \expandafter\gdef\macrotemp#1{#2}%
-% \endgroup}
-
-%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
-%\def\linemacroxxx#1#2 \end linemacro{%
-%\let\parsearg=\relax
-%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
-%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
-%\expandafter\gdef\macrotempx#1{#2}%
-%\endgroup}
-
-%\def\butfirst#1{}
-
\message{fonts,}
-
% Font-change commands.
-% Texinfo supports the sans serif font style, which plain TeX does not.
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
@@ -1898,7 +1893,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemize{\parsearg\itemizezzz}
\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
+ \begingroup % ended by the @end itemize
\itemizey {#1}{\Eitemize}
}
@@ -2264,12 +2259,14 @@ width0pt\relax} \fi
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
}
% @defindex foo == \newindex{foo}
@@ -2278,11 +2275,13 @@ width0pt\relax} \fi
% Define @defcodeindex, like @defindex except put all entries in @code.
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}
}
\def\defcodeindex{\parsearg\newcodeindex}
@@ -2369,7 +2368,6 @@ width0pt\relax} \fi
\def\gtr{\realbackslash gtr}%
\def\less{\realbackslash less}%
\def\hat{\realbackslash hat}%
-%\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }%
\def\result{\realbackslash result}%
@@ -2396,7 +2394,12 @@ width0pt\relax} \fi
\def\kbd##1{\realbackslash kbd {##1}}%
\def\dfn##1{\realbackslash dfn {##1}}%
\def\emph##1{\realbackslash emph {##1}}%
-\def\value##1{\realbackslash value {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
\unsepspaces
}
@@ -2469,14 +2472,24 @@ width0pt\relax} \fi
% so we do not become unable to do a definition.
{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
+ @gdef@realbackslash{\}}
\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
-\let\SETmarginindex=\relax %initialize!
-% workhorse for all \fooindexes
-% #1 is name of index, #2 is stuff to put there
-\def\doind #1#2{%
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
@@ -2487,13 +2500,22 @@ width0pt\relax} \fi
\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\
{%
- \let\folio=0% We will expand all macros now EXCEPT \folio.
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
+ \def\thirdarg{#3}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
% First process the index-string with all font commands turned off
% to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2}}%
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
%
% Now produce the complete index entry, with both the sort key and the
% original text, including any font commands.
@@ -2502,33 +2524,35 @@ width0pt\relax} \fi
\write\csname#1indfile\endcsname{%
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
}%
- \temp
+ %
+ % If third (subentry) arg is present, add it to the index string.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = {#3}%
+ \edef\temp{\temp{\the\toks0}}%
+ \fi
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ \iflinks
+ \skip0 = \lastskip \ifdim\lastskip = 0pt \else \vskip-\lastskip \fi
+ \temp
+ \ifdim\skip0 = 0pt \else \vskip\skip0 \fi
+ \fi
}%
}%
\penalty\count255
}%
}
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
@@ -2952,7 +2976,7 @@ width0pt\relax} \fi
\toks0 = {#1}%
\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\donoderef %
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
@@ -2973,7 +2997,7 @@ width0pt\relax} \fi
\edef\temp{{\realbackslash chapentry{\the\toks0}%
{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\appendixnoderef %
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
@@ -3008,7 +3032,7 @@ width0pt\relax} \fi
\toks0 = {#1}%
\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\unnumbnoderef %
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
@@ -3025,7 +3049,7 @@ width0pt\relax} \fi
\edef\temp{{\realbackslash secentry %
{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\donoderef %
\penalty 10000 %
}}
@@ -3041,7 +3065,7 @@ width0pt\relax} \fi
\edef\temp{{\realbackslash secentry %
{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\appendixnoderef %
\penalty 10000 %
}}
@@ -3054,7 +3078,7 @@ width0pt\relax} \fi
\toks0 = {#1}%
\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\unnumbnoderef %
\penalty 10000 %
}}
@@ -3069,7 +3093,7 @@ width0pt\relax} \fi
\edef\temp{{\realbackslash subsecentry %
{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\donoderef %
\penalty 10000 %
}}
@@ -3084,7 +3108,7 @@ width0pt\relax} \fi
\edef\temp{{\realbackslash subsecentry %
{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\appendixnoderef %
\penalty 10000 %
}}
@@ -3097,7 +3121,7 @@ width0pt\relax} \fi
\toks0 = {#1}%
\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\unnumbnoderef %
\penalty 10000 %
}}
@@ -3114,7 +3138,7 @@ width0pt\relax} \fi
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\donoderef %
\penalty 10000 %
}}
@@ -3131,7 +3155,7 @@ width0pt\relax} \fi
{\appendixletter}
{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\appendixnoderef %
\penalty 10000 %
}}
@@ -3144,7 +3168,7 @@ width0pt\relax} \fi
\toks0 = {#1}%
\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}%
\escapechar=`\\%
-\write \contentsfile \temp %
+\iflinks \write\contentsfile\temp \fi
\unnumbnoderef %
\penalty 10000 %
}}
@@ -3944,13 +3968,18 @@ width0pt\relax} \fi
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
% @deftypemethod has an extra argument that nothing else does. Sigh.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+% #5 is the method's return type.
%
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
@@ -4173,7 +4202,7 @@ width0pt\relax} \fi
\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
+\def\deftypefunx #1 {\errmessage{@deftypeunx in invalid context}}
% @defmethod, and so on
@@ -4329,7 +4358,220 @@ width0pt\relax} \fi
\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
-\message{cross reference,}
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+% \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{#1}%\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% Utility: does \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=10
+ \usembodybackslash}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 \catcode`\\=\active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+% The catcode games are necessary because @macro may or may not
+% have a brace-surrounded list of arguments, and we need to do
+% different stuff in each case. Making {, } \other is the only
+% way to prevent their being deleted by the tokenizer.
+\def\macro{\recursivefalse
+ \bgroup\catcode`\{=\other\catcode`\}=\other\parsearg\macroxxx}
+\def\rmacro{\recursivetrue
+ \bgroup\catcode`\{=\other\catcode`\}=\other\parsearg\macroxxx}
+
+\def\macroxxx#1{\egroup % started in \macro
+ \getargs{#1}% now \macname is the macname and \toks0 the arglist
+ \edef\temp{\the\toks0}%
+ \ifx\temp\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \the\toks0;%
+ \fi
+ \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
+ \cslet{macsave.\the\macname}{\the\macname}%
+ \else
+ \message{Warning: redefining \the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{
+ \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
+ \errmessage{Macro \the\macname\ not defined.}%
+ \else
+ \cslet{#1}{macsave.#1}%
+ \expandafter\let \csname macsave.\the\macname\endcsname \undefined
+ \fi
+}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% This code has to take great care with `macro parameter char #'. The
+% eight hashes in a row on the macarg.#1 line collapse to four in the
+% definition of \macarg.blah, to two when \parsemacbody expands the
+% macro replacement text, and to one when \defmacro writes the macro
+% definiton. The games with \twohash are to postpone expansion till
+% the very end, when \parsemargdefyyy crunches \paramlist into
+% something that can be splatted into a \expandafter\def\blah line (in
+% \defmacro).
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \let\twohash\relax
+ \if#1;\let\next=\parsemargdefyyy
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.#1\endcsname{########\the\paramno}%
+ \edef\paramlist{\paramlist\twohash\twohash\the\paramno,}%
+ \fi\next}
+\def\parsemargdefyyy{\let\twohash##\relax \edef\paramlist{\paramlist}}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{#1} \endgroup\defmacro}%
+\long\def\parsermacbody#1@end macro%
+{\xdef\temp{#1} \endgroup\defmacro}%
+
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+\def\defmacro{%
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\edef\csname\the\macname\endcsname{%
+ \noexpand\scantokens{\temp}}%
+ \or % 1
+ \expandafter\edef\csname\the\macname\endcsname{%
+ \noexpand\braceorline\csname\the\macname xxx\endcsname}%
+ \expandafter\edef\csname\the\macname xxx\endcsname##1{%
+ \noexpand\scantokens{\temp}}%
+ \else % many
+ \expandafter\edef\csname\the\macname\endcsname##1{%
+ \csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\edef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\noexpand\scantokens{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\edef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scantokens{\temp}\egroup}%
+ \or % 1
+ \expandafter\edef\csname\the\macname\endcsname{%
+ \noexpand\braceorline\csname\the\macname xxx\endcsname}%
+ \expandafter\edef\csname\the\macname xxx\endcsname##1{%
+ \noexpand\norecurse{\the\macname}
+ \noexpand\scantokens{\temp}\egroup}%
+ \else % many
+ \expandafter\edef\csname\the\macname\endcsname##1{%
+ \csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\edef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \noexpand\norecurse{\the\macname}
+ \noexpand\scantokens{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+% We need {} to be \other inside these commands. [] are temporary
+% grouping symbols.
+\begingroup
+\catcode`\{=\other \catcode`\}=\other
+\catcode`\[=1 \catcode`\]=2
+
+% @macro can be called with or without a brace-surrounded macro
+% argument list. These three sequences extract the macro name and arg
+% list in hopefully all cases. Note that anything on the line after the
+% first pair of braces will be thrown out (Makeinfo puts it into the
+% macro body).
+\gdef\getargs#1[\getargsxxx|#1 {}|]
+\gdef\getargsxxx|#1 {#2}#3|[%
+ \toks0=[#2]%
+ \edef\tmp[\the\toks0]%
+ \ifx\tmp\empty
+ \getargsnospaces|#1{}|%
+ \else
+ \macname=[#1]%
+ \fi]
+\gdef\getargsnospaces|#1{#2}#3|[\macname=[#1]\toks0=[#2]]
+
+\endgroup
+
+
+\message{cross references,}
\newwrite\auxfile
\newif\ifhavexrefs % True if xref values are known.
@@ -4422,7 +4664,9 @@ width0pt\relax} \fi
{\let\folio=0
\normalturnoffactive
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
- \next
+ \iflinks
+ \next
+ \fi
}%
}
@@ -4476,12 +4720,14 @@ width0pt\relax} \fi
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
\angleleft un\-de\-fined\angleright
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
\fi
\fi
\else
@@ -4724,7 +4970,9 @@ width0pt\relax} \fi
\openin 1 = epsf.tex
\ifeof 1 \else
\closein 1
- \def\epsfannounce{\toks0 = }% do not bother showing banner
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
\input epsf.tex
\fi
%
@@ -4754,39 +5002,26 @@ width0pt\relax} \fi
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
+ % If the image is by itself, center it.
+ \ifvmode
+ \centerline{\epsfbox{#1.eps}}%
+ \else
+ \epsfbox{#1.eps}%
+ \fi
}
-% End of control word definitions.
-
-
-\message{and turning on texinfo input format.}
-
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-% Set some numeric style parameters, for 8.5 x 11 format.
+\message{paper sizes,}
+% And other related parameters.
-\hsize = 6in
-\hoffset = .25in
\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 3pt plus 2pt minus 1pt
-\setleading{13.2pt}
-\advance\topskip by 1.2cm
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
-\vbadness=10000
+\vbadness = 10000
% Following George Bush, just get rid of widows and orphans.
\widowpenalty=10000
@@ -4795,101 +5030,125 @@ width0pt\relax} \fi
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
+% \hsize. This makes it come to about 9pt for the 8.5x11 format. We
+% call this whenever the paper size is set.
%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = \hsize
+ \divide\emergencystretch by 45
+ \fi
+}
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
- \global\chapheadingskip = 15pt plus 4pt minus 2pt
- \global\secheadingskip = 12pt plus 3pt minus 2pt
- \global\subsecheadingskip = 9pt plus 2pt minus 2pt
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
%
- \global\lispnarrowing = 0.3in
- \setleading{12pt}
- \advance\topskip by -1cm
- \global\parskip 2pt plus 1pt
- \global\hsize = 5in
- \global\vsize=7.5in
- \global\tolerance=700
- \global\hfuzz=1pt
- \global\contentsrightmargin=0pt
- \global\deftypemargin=0pt
- \global\defbodyindent=.5cm
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 0.6in
+ \pageheight = \vsize
%
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
%
- \global\let\smalllisp=\smalllispx
- \global\let\smallexample=\smalllispx
- \global\def\Esmallexample{\Esmalllisp}
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
}
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalllisp = \smalllispx
+ \let\smallexample = \smalllispx
+ \def\Esmallexample{\Esmalllisp}%
+}}
-\bindingoffset=0pt
-\normaloffset=\hoffset
-\pagewidth=\hsize
-\pageheight=\vsize
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; voffset; hoffset; binding offset; topskip.
-% All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5#6{
- \global\vsize= #1
- \global\topskip= #6
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{6.5in}{\voffset}{.25in}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex
- {\global\tolerance=700
- \global\hfuzz=1pt
- \setleading{12pt}
- \global\parskip 15pt plus 1pt
- \advance\baselineskip by 1.6pt
- \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
- }
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{\afourpaper
-\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+\message{and turning on texinfo input format.}
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
diff --git a/gcc/tlink.c b/gcc/tlink.c
index d5fa00cb668..a4c5b5311cd 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -550,26 +550,29 @@ scan_linker_output (fname)
sym = symbol_hash_lookup (p, false);
if (! sym && ! end)
- /* Try a mangled name in `quotes'. */
+ /* Try a mangled name in quotes. */
{
+ char *oldq = q+1;
demangled *dem = 0;
- p = index (q+1, '`');
q = 0;
-#define MUL "multiple definition of "
-#define UND "undefined reference to "
+ /* First try `GNU style'. */
+ p = index (oldq, '`');
+ if (p)
+ p++, q = index (p, '\'');
+ /* Then try "double quotes". */
+ else if (p = index (oldq, '"'), p)
+ p++, q = index (p, '"');
- if (p && (p - line > sizeof (MUL)))
+ if (q)
{
- char *beg = p - sizeof (MUL) + 1;
- *p = 0;
- if (!strcmp (beg, MUL) || !strcmp (beg, UND))
- p++, q = index (p, '\'');
+ *q = 0;
+ dem = demangled_hash_lookup (p, false);
+ if (dem)
+ sym = symbol_hash_lookup (dem->mangled, false);
+ else
+ sym = symbol_hash_lookup (p, false);
}
- if (q)
- *q = 0, dem = demangled_hash_lookup (p, false);
- if (dem)
- sym = symbol_hash_lookup (dem->mangled, false);
}
if (sym && sym->tweaked)
diff --git a/gcc/tm.texi b/gcc/tm.texi
index a74bcfbea84..cf11d7b5aff 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -76,6 +76,21 @@ wish to add additional options which take arguments. Any redefinition
should call @code{DEFAULT_WORD_SWITCH_TAKES_ARG} and then check for
additional options.
+@findex SWITCH_CURTAILS_COMPILATION
+@item SWITCH_CURTAILS_COMPILATION (@var{char})
+A C expression which determines whether the option @samp{-@var{char}}
+stops compilation before the generation of an executable. The value is
+boolean, non-zero if the option does stop an executable from being
+generated, zero otherwise.
+
+By default, this macro is defined as
+@code{DEFAULT_SWITCH_CURTAILS_COMPILATION}, which handles the standard
+options properly. You need not define
+@code{SWITCH_CURTAILS_COMPILATION} unless you wish to add additional
+options which affect the generation of an executable. Any redefinition
+should call @code{DEFAULT_SWITCH_CURTAILS_COMPILATION} and then check
+for additional options.
+
@findex SWITCHES_NEED_SPACES
@item SWITCHES_NEED_SPACES
A string-valued C expression which enumerates the options for which
@@ -268,6 +283,15 @@ the argument @samp{-lgcc} to tell the linker to do the search.
This macro is similar to @code{LINK_LIBGCC_SPECIAL}, except that it does
not affect @samp{-L} options.
+@findex LINK_COMMAND_SPEC
+@item LINK_COMMAND_SPEC
+A C string constant giving the complete command line need to execute the
+linker. When you do this, you will need to update your port each time a
+change is made to the link command line within @file{gcc.c}. Therefore,
+define this macro only if you need to completely redefine the command
+line for invoking the linker and there is no other way to accomplish
+the effect you need.
+
@findex MULTILIB_DEFAULTS
@item MULTILIB_DEFAULTS
Define this macro as a C expression for the initializer of an array of
@@ -522,10 +546,13 @@ bits in @code{target_flags}. Its definition is an initializer
with a subgrouping for each command option.
Each subgrouping contains a string constant, that defines the option
-name, and a number, which contains the bits to set in
-@code{target_flags}. A negative number says to clear bits instead;
-the negative of the number is which bits to clear. The actual option
-name is made by appending @samp{-m} to the specified name.
+name, a number, which contains the bits to set in
+@code{target_flags}, and a second string which is the description
+displayed by --help. If the number is negative then the bits specified
+by the number are cleared instead of being set. If the description
+string is present but empty, then no help information will be displayed
+for that option, but it will not count as an undocumented option. The
+actual option name is made by appending @samp{-m} to the specified name.
One of the subgroupings should have a null string. The number in
this grouping is the default value for @code{target_flags}. Any
@@ -536,9 +563,9 @@ with opposite meanings, and picks the latter as the default:
@smallexample
#define TARGET_SWITCHES \
- @{ @{ "68020", 1@}, \
- @{ "68000", -1@}, \
- @{ "", 1@}@}
+ @{ @{ "68020", 1, "" @}, \
+ @{ "68000", -1, "Compile for the 68000" @}, \
+ @{ "", 1, "" @}@}
@end smallexample
@findex TARGET_OPTIONS
@@ -548,10 +575,10 @@ options that have values. Its definition is an initializer with a
subgrouping for each command option.
Each subgrouping contains a string constant, that defines the fixed part
-of the option name, and the address of a variable. The variable, type
-@code{char *}, is set to the variable part of the given option if the fixed
-part matches. The actual option name is made by appending @samp{-m} to the
-specified name.
+of the option name, the address of a variable, and a description string.
+The variable, type @code{char *}, is set to the variable part of the
+given option if the fixed part matches. The actual option name is made
+by appending @samp{-m} to the specified name.
Here is an example which defines @samp{-mshort-data-@var{number}}. If the
given option is @samp{-mshort-data-512}, the variable @code{m88k_short_data}
@@ -560,7 +587,7 @@ will be set to the string @code{"512"}.
@smallexample
extern char *m88k_short_data;
#define TARGET_OPTIONS \
- @{ @{ "short-data-", &m88k_short_data @} @}
+ @{ @{ "short-data-", &m88k_short_data, "Specify the size of the short data section" @} @}
@end smallexample
@findex TARGET_VERSION
@@ -810,9 +837,9 @@ the default value is @code{BIGGEST_ALIGNMENT}.
@findex DATA_ALIGNMENT
@item DATA_ALIGNMENT (@var{type}, @var{basic-align})
-If defined, a C expression to compute the alignment for a static
-variable. @var{type} is the data type, and @var{basic-align} is the
-alignment that the object would ordinarily have. The value of this
+If defined, a C expression to compute the alignment for a variables in
+the static store. @var{type} is the data type, and @var{basic-align} is
+the alignment that the object would ordinarily have. The value of this
macro is used instead of that alignment to align the object.
If this macro is not defined, then @var{basic-align} is used.
@@ -955,6 +982,30 @@ this size or smaller can be used for structures and unions with the
appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE
(DImode)} is assumed.
+@findex STACK_SAVEAREA_MODE
+@item STACK_SAVEAREA_MODE (@var{save_level})
+If defined, an expression of type @code{enum machine_mode} that
+specifies the mode of the save area operand of a
+@code{save_stack_@var{level}} named pattern (@pxref{Standard Names}).
+@var{save_level} is one of @code{SAVE_BLOCK}, @code{SAVE_FUNCTION}, or
+@code{SAVE_NONLOCAL} and selects which of the three named patterns is
+having its mode specified.
+
+You need not define this macro if it always returns @code{Pmode}. You
+would most commonly define this macro if the
+@code{save_stack_@var{level}} patterns need to support both a 32- and a
+64-bit mode.
+
+@findex STACK_SIZE_MODE
+@item STACK_SIZE_MODE
+If defined, an expression of type @code{enum machine_mode} that
+specifies the mode of the size increment operand of an
+@code{allocate_stack} named pattern (@pxref{Standard Names}).
+
+You need not define this macro if it always returns @code{word_mode}.
+You would most commonly define this macro if the @code{allocate_stack}
+pattern needs to support both a 32- and a 64-bit mode.
+
@findex CHECK_FLOAT_VALUE
@item CHECK_FLOAT_VALUE (@var{mode}, @var{value}, @var{overflow})
A C statement to validate the value @var{value} (of type
@@ -1282,6 +1333,17 @@ If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
+@findex HARD_REGNO_CALL_PART_CLOBBERED
+@item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
+@cindex call-used register
+@cindex call-clobbered register
+@cindex call-saved register
+A C expression that is non-zero if it is not permissible to store a
+value of mode @var{mode} in hard register number @var{regno} across a
+call without some part of it being clobbered. For most machines this
+macro need not be defined. It is only required for machines that do not
+preserve the entire contents of a register across a call.
+
@findex CONDITIONAL_REGISTER_USAGE
@findex fixed_regs
@findex call_used_regs
@@ -1490,6 +1552,12 @@ accessibility of the value in a narrower mode.
You should define this macro to return nonzero in as many cases as
possible since doing so will allow GNU CC to perform better register
allocation.
+
+@findex AVOID_CCMODE_COPIES
+@item AVOID_CCMODE_COPIES
+Define this macro if the compiler should avoid copies to/from @code{CCmode}
+registers. You should only define this macro if support fo copying to/from
+@code{CCmode} is incomplete.
@end table
@node Leaf Functions
@@ -2167,12 +2235,20 @@ of @var{frameaddr}---that is, the stack frame address is also the
address of the stack word that points to the previous frame.
@findex SETUP_FRAME_ADDRESSES
-@item SETUP_FRAME_ADDRESSES ()
+@item SETUP_FRAME_ADDRESSES
If defined, a C expression that produces the machine-specific code to
setup the stack so that arbitrary frames can be accessed. For example,
on the Sparc, we must flush all of the register windows to the stack
-before we can access arbitrary stack frames.
-This macro will seldom need to be defined.
+before we can access arbitrary stack frames. You will seldom need to
+define this macro.
+
+@findex BUILTIN_SETJMP_FRAME_VALUE
+@item BUILTIN_SETJMP_FRAME_VALUE
+If defined, a C expression that contains an rtx that is used to store
+the address of the current frame into the built in @code{setjmp} buffer.
+The default value, @code{virtual_stack_vars_rtx}, is correct for most
+machines. One reason you may need to define this macro is if
+@code{hard_frame_pointer_rtx} is the appropriate value on your machine.
@findex RETURN_ADDR_RTX
@item RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
@@ -2212,6 +2288,17 @@ previous frame, just before the call instruction.
You only need to define this macro if you want to support call frame
debugging information like that provided by DWARF 2.
+
+@findex ARG_POINTER_CFA_OFFSET
+@item ARG_POINTER_CFA_OFFSET
+A C expression whose value is an integer giving the offset, in bytes,
+from the argument pointer to the canonical frame address (cfa). The
+final value should coincide with that calculated by
+@code{INCOMING_FRAME_SP_OFFSET}. Which is unfortunately not usable
+during virtual register instantiation.
+
+You only need to define this macro if you want to support call frame
+debugging information like that provided by DWARF 2.
@end table
@node Stack Checking
@@ -3085,9 +3172,9 @@ must live across calls.
@item DEFAULT_CALLER_SAVES
Define this macro if function calls on the target machine do not preserve
any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
-for all registers. This macro enables @samp{-fcaller-saves} by default.
-Eventually that option will be enabled by default on all machines and both
-the option and this macro will be eliminated.
+for all registers. When defined, this macro enables @samp{-fcaller-saves}
+by default for all optimization levels. It has no effect for optimization
+levels 2 and higher, where @samp{-fcaller-saves} is the default.
@findex CALLER_SAVE_PROFITABLE
@item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
@@ -3098,6 +3185,14 @@ this is worth doing, and 0 otherwise.
If you don't define this macro, a default is used which is good on most
machines: @code{4 * @var{calls} < @var{refs}}.
+
+@findex HARD_REGNO_CALLER_SAVE_MODE
+@item HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
+A C expression specifying which mode is required for saving @var{nregs}
+of a pseudo-register in call-clobbered hard register @var{regno}. If
+@var{regno} is unsuitable for caller save, @code{VOIDmode} should be
+returned. For most machines this macro need not be defined since GCC
+will select the smallest suitable mode.
@end table
@node Function Entry
@@ -4248,6 +4343,10 @@ to know something of how reload works in order to effectively use this,
and it is quite easy to produce macros that build in too much knowledge
of reload internals.
+@emph{Note}: This macro must be able to reload an address created by a
+previous invocation of this macro. If it fails to handle such addresses
+then the compiler may generate incorrect code or abort.
+
@findex push_reload
The macro definition should use @code{push_reload} to indicate parts that
need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually
@@ -4658,10 +4757,14 @@ than good.)
@findex MOVE_RATIO
@item MOVE_RATIO
-The number of scalar move insns which should be generated instead of a
+The threshold of number of scalar memory-to-memory move insns, @emph{below}
+which a sequence of insns should be generated instead of a
string move insn or a library call. Increasing the value will always
make code faster, but eventually incurs high cost in increased code size.
+Note that on machines with no memory-to-memory move insns, this macro denotes
+the corresponding number of memory-to-memory @emph{sequences}.
+
If you don't define this, a reasonable default is used.
@findex NO_FUNCTION_CSE
@@ -4805,9 +4908,10 @@ data section.
@findex JUMP_TABLES_IN_TEXT_SECTION
@item JUMP_TABLES_IN_TEXT_SECTION
-Define this macro if jump tables (for @code{tablejump} insns) should be
-output in the text section, along with the assembler instructions.
-Otherwise, the readonly data section is used.
+Define this macro to be an expression with a non-zero value if jump
+tables (for @code{tablejump} insns) should be output in the text
+section, along with the assembler instructions. Otherwise, the
+readonly data section is used.
This macro is irrelevant if there is no separate readonly data section.
@@ -4882,7 +4986,7 @@ necessary).
@item PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
Define this macro if the register defined by
@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls. Do not define
-this macro if @code{PPIC_OFFSET_TABLE_REGNUM} is not defined.
+this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
@findex FINALIZE_PIC
@item FINALIZE_PIC
@@ -6693,6 +6797,13 @@ define @code{INCOMING_RETURN_ADDR_RTX} and either set
prologue, or call @code{dwarf2out_def_cfa} and @code{dwarf2out_reg_save}
as appropriate from @code{FUNCTION_PROLOGUE} if you don't.
+@findex DWARF2_FRAME_INFO
+@item DWARF2_FRAME_INFO
+Define this macro to a nonzero value if GNU CC should always output
+Dwarf 2 frame information. If @code{DWARF2_UNWIND_INFO}
+(@pxref{Exception Region Output} is nonzero, GNU CC will output this
+information not matter how you define @code{DWARF2_FRAME_INFO}.
+
@findex LINKER_DOES_NOT_WORK_WITH_DWARF2
@item LINKER_DOES_NOT_WORK_WITH_DWARF2
Define this macro if the linker does not work with Dwarf version 2.
@@ -6954,7 +7065,7 @@ when the minimum and maximum offset are known. If you define this,
it enables extra code in branch shortening to deal with @code{addr_diff_vec}.
To make this work, you also have to define INSN_ALIGN and
make the alignment for @code{addr_diff_vec} explicit.
-The @var{body} argument is provided so that teh offset_unsigned and scale
+The @var{body} argument is provided so that the offset_unsigned and scale
flags can be updated.
@findex CASE_VECTOR_PC_RELATIVE
@@ -7234,18 +7345,63 @@ C++, which is to pretend that the file's contents are enclosed in
@findex HANDLE_PRAGMA
@findex #pragma
@findex pragma
-@item HANDLE_PRAGMA (@var{stream}, @var{node})
+@item HANDLE_PRAGMA (@var{getc}, @var{ungetc}, @var{name})
Define this macro if you want to implement any pragmas. If defined, it
-is a C expression whose value is 1 if the pragma was handled by the function.
-The argument @var{stream} is the stdio input stream from which the source text
-can be read. @var{node} is the tree node for the identifier after the
-@code{#pragma}.
+is a C expression whose value is 1 if the pragma was handled by the
+macro, zero otherwise. The argument @var{getc} is a function of type
+@samp{int (*)(void)} which will return the next character in the input
+stream, or EOF if no characters are left. The argument @var{ungetc} is
+a function of type @samp{void (*)(int)} which will push a character back
+into the input stream. The argument @var{name} is the word following
+#pragma in the input stream. The input stream pointer will be pointing
+just beyond the end of this word. The input stream should be left
+undistrubed if the expression returns zero, otherwise it should be
+pointing at the next character after the end of the pragma. Any
+characters remaining on the line will be ignored.
It is generally a bad idea to implement new uses of @code{#pragma}. The
only reason to define this macro is for compatibility with other
compilers that do support @code{#pragma} for the sake of any user
programs which already use it.
+If the pragma can be implemented by atttributes then the macro
+@samp{INSERT_ATTRIBUTES} might be a useful one to define as well.
+
+Note: older versions of this macro only had two arguments: @var{stream}
+and @var{token}. The macro was changed in order to allow it to work
+when gcc is built both with and without a cpp library.
+
+@findex HANDLE_SYSV_PRAGMA
+@findex #pragma
+@findex pragma
+@item HANDLE_SYSV_PRAGMA
+Define this macro (to a value of 1) if you want the System V style
+pragmas @samp{#pragma pack(<n>)} and @samp{#pragma weak <name>
+[=<value>]} to be supported by gcc.
+
+The pack pragma specifies the maximum alignment (in bytes) of fields
+within a structure, in much the same way as the @samp{__aligned__} and
+@samp{__packed__} @code{__attribute__}s do. A pack value of zero resets
+the behaviour to the default.
+
+The weak pragma only works if @code{SUPPORTS_WEAK} and
+@code{ASM_WEAKEN_LABEL} are defined. If enabled it allows the creation
+of specifically named weak labels, optionally with a value.
+
+@findex HANDLE_PRAGMA_PACK_PUSH_POP
+@findex #pragma
+@findex pragma
+@item HANDLE_PRAGMA_PACK_PUSH_POP
+Define this macro (to a value of 1) if you want to support the Win32
+style pragmas @samp{#pragma pack(push,<n>)} and @samp{#pragma
+pack(pop)}. The pack(push,<n>) pragma specifies the maximum alignment
+(in bytes) of fields within a structure, in much the same way as the
+@samp{__aligned__} and @samp{__packed__} @code{__attribute__}s do. A
+pack value of zero resets the behaviour to the default. Successive
+invocations of this pragma cause the previous values to be stacked, so
+that invocations of @samp{#pragma pack(pop)} will return to the previous
+value.
+
@findex VALID_MACHINE_DECL_ATTRIBUTE
@item VALID_MACHINE_DECL_ATTRIBUTE (@var{decl}, @var{attributes}, @var{identifier}, @var{args})
If defined, a C expression whose value is nonzero if @var{identifier} with
@@ -7286,6 +7442,22 @@ of @var{olddecl}. Examples of when this is needed are when one attribute
overrides another, or when an attribute is nullified by a subsequent
definition.
+@findex INSERT_ATTRIBUTES
+@item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr}, @var{prefix_ptr})
+Define this macro if you want to be able to add attributes to a decl
+when it is being created. This is normally useful for backends which
+wish to implement a pragma by using the attributes which correspond to
+the pragma's effect. The @var{node} argument is the decl which is being
+created. The @var{attr_ptr} argument is a pointer to the attribute list
+for this decl. The @var{prefix_ptr} is a pointer to the list of
+attributes that have appeared after the specifiers and modifiers of the
+declaration, but before the declaration proper.
+
+@findex SET_DEFAULT_DECL_ATTRIBUTES
+@item SET_DEFAULT_DECL_ATTRIBUTES (@var{decl}, @var{attributes})
+If defined, a C statement that assigns default attributes to
+newly defined @var{decl}.
+
@findex DOLLARS_IN_IDENTIFIERS
@item DOLLARS_IN_IDENTIFIERS
Define this macro to control use of the character @samp{$} in identifier
@@ -7372,19 +7544,58 @@ unit may not be bound to undefined symbols in another translation unit
without user intervention. For instance, under Microsoft Windows
symbols must be explicitly imported from shared libraries (DLLs).
-@findex GIV_SORT_CRITERION
-@item GIV_SORT_CRITERION (@var{giv1}, @var{giv2})
-In some cases, the strength reduction optimization pass can produce better
-code if this is defined. This macro controls the order that induction
-variables are combined. This macro is particularly useful if the target has
-limited addressing modes. For instance, the SH target has only positive
-offsets in addresses. Thus sorting to put the smallest address first
-allows the most combinations to be found.
-
@findex ISSUE_RATE
@item ISSUE_RATE
A C expression that returns how many instructions can be issued at the
same time if the machine is a superscalar machine. This is only used by
the @samp{Haifa} scheduler, and not the traditional scheduler.
+@findex MD_SCHED_INIT
+@item MD_SCHED_INIT (@var{file}, @var{verbose}
+A C statement which is executed by the @samp{Haifa} scheduler at the
+beginning of each block of instructions that are to be scheduled.
+@var{file} is either a null pointer, or a stdio stream to write any
+debug output to. @var{verbose} is the verbose level provided by
+@samp{-fsched-verbose-}@var{n}.
+
+@findex MD_SCHED_REORDER
+@item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready})
+A C statement which is executed by the @samp{Haifa} scheduler after it
+has scheduled the ready list to allow the machine description to reorder
+it (for example to combine two small instructions together on
+@samp{VLIW} machines). @var{file} is either a null pointer, or a stdio
+stream to write any debug output to. @var{verbose} is the verbose level
+provided by @samp{-fsched-verbose-}@var{n}. @var{ready} is a pointer to
+the ready list of instructions that are ready to be scheduled.
+@var{n_ready} is the number of elements in the ready list. The
+scheduler reads the ready list in reverse order, starting with
+@var{ready}[@var{n_ready}-1] and going to @var{ready}[0].
+
+@findex MD_SCHED_VARIABLE_ISSUE
+@item MD_SCHED_VARIABLE_ISSUE (@var{file}, @var{verbose}, @var{insn}, @var{more})
+A C statement which is executed by the @samp{Haifa} scheduler after it
+has scheduled an insn from the ready list. @var{file} is either a null
+pointer, or a stdio stream to write any debug output to. @var{verbose}
+is the verbose level provided by @samp{-fsched-verbose-}@var{n}.
+@var{insn} is the instruction that was scheduled. @var{more} is the
+number of instructions that can be issued in the current cycle. The
+@samp{MD_SCHED_VARIABLE_ISSUE} macro is responsible for updating the
+value of @var{more} (typically by @var{more}--).
+
+@findex MAX_INTEGER_COMPUTATION_MODE
+@item MAX_INTEGER_COMPUTATION_MODE
+Define this to the largest integer machine mode which can be used for
+operations other than load, store and copy operations.
+
+You need only define this macro if the target holds values larger than
+@code{word_mode} in general purpose registers. Most targets should not define
+this macro.
+
+@findex MATH_LIBRARY
+@item MATH_LIBRARY
+Define this macro as a C string constant for the linker argument to link
+in the system math library, or @samp{""} if the target does not have a
+separate math library.
+
+You need only define this macro if the default of @samp{"-lm"} is wrong.
@end table
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 599c210adce..1e036c6b5d3 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */
Error messages and low-level interface to malloc also handled here. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#undef FLOAT /* This is for hpux. They should change hpux. */
#undef FFS /* Some systems define this in param.h. */
#include "system.h"
@@ -56,8 +51,25 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "except.h"
#include "toplev.h"
+#include "expr.h"
#include "ggc.h"
+#ifdef DWARF_DEBUGGING_INFO
+#include "dwarfout.h"
+#endif
+
+#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
+#include "dwarf2out.h"
+#endif
+
+#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
+#include "dbxout.h"
+#endif
+
+#ifdef SDB_DEBUGGING_INFO
+#include "sdbout.h"
+#endif
+
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
#endif
@@ -154,20 +166,16 @@ extern void print_rtl_with_bb ();
void rest_of_decl_compilation ();
void error_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
void error_with_decl PVPROTO((tree decl, char *s, ...));
-void error_for_asm PVPROTO((rtx insn, char *s, ...));
void error PVPROTO((char *s, ...));
void fatal PVPROTO((char *s, ...));
void warning_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
void warning_with_decl PVPROTO((tree decl, char *s, ...));
-void warning_for_asm PVPROTO((rtx insn, char *s, ...));
void warning PVPROTO((char *s, ...));
void pedwarn PVPROTO((char *s, ...));
void pedwarn_with_decl PVPROTO((tree decl, char *s, ...));
void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
void sorry PVPROTO((char *s, ...));
-void really_sorry PVPROTO((char *s, ...));
-void fancy_abort ();
-void set_target_switch ();
+static void set_target_switch PROTO((char *));
static char *decl_name PROTO((tree, int));
static void vmessage PROTO((char *, char *, va_list));
static void v_message_with_file_and_line PROTO((char *, int, char *,
@@ -178,7 +186,7 @@ static void v_error_with_file_and_line PROTO((char *, int, char *, va_list));
static void v_error_with_decl PROTO((tree, char *, va_list));
static void v_error_for_asm PROTO((rtx, char *, va_list));
static void verror PROTO((char *, va_list));
-static void vfatal PROTO((char *, va_list));
+static void vfatal PROTO((char *, va_list)) ATTRIBUTE_NORETURN;
static void v_warning_with_file_and_line PROTO ((char *, int, char *, va_list));
static void v_warning_with_decl PROTO((tree, char *, va_list));
static void v_warning_for_asm PROTO((rtx, char *, va_list));
@@ -187,7 +195,7 @@ static void vpedwarn PROTO((char *, va_list));
static void v_pedwarn_with_decl PROTO((tree, char *, va_list));
static void v_pedwarn_with_file_and_line PROTO((char *, int, char *, va_list));
static void vsorry PROTO((char *, va_list));
-static void v_really_sorry PROTO((char *, va_list));
+static void v_really_sorry PROTO((char *, va_list)) ATTRIBUTE_NORETURN;
static void float_signal PROTO((int));
static void pipe_closed PROTO((int));
static void output_lang_identify PROTO((FILE *));
@@ -196,10 +204,13 @@ static void close_dump_file PROTO((void (*) (FILE *, rtx), rtx));
static void dump_rtl PROTO((char *, tree, void (*) (FILE *, rtx), rtx));
static void clean_dump_file PROTO((char *));
static void compile_file PROTO((char *));
+static void display_help PROTO ((void));
-void print_version ();
-int print_single_switch ();
-void print_switch_values ();
+static void print_version PROTO((FILE *, char *));
+static int print_single_switch PROTO((FILE *, int, int, char *, char *, char *,
+ char *, char *));
+static void print_switch_values PROTO((FILE *, int, int, char *, char *,
+ char *));
/* Length of line when printing switch values. */
#define MAX_LINE 75
@@ -254,6 +265,7 @@ int rtl_dump_and_exit = 0;
int jump_opt_dump = 0;
int addressof_dump = 0;
int cse_dump = 0;
+int gcse_dump = 0;
int loop_dump = 0;
int cse2_dump = 0;
int branch_prob_dump = 0;
@@ -329,16 +341,20 @@ int sorrycount = 0;
2: and any other information that might be interesting, such as function
parameter types in C++. */
-char *(*decl_printable_name) (/* tree decl, int verbosity */);
+char *(*decl_printable_name) PROTO ((tree, int));
/* Pointer to function to compute rtl for a language-specific tree code. */
-struct rtx_def *(*lang_expand_expr) ();
+typedef rtx (*lang_expand_expr_t)
+ PROTO ((union tree_node *, rtx, enum machine_mode,
+ enum expand_modifier modifier));
+
+lang_expand_expr_t lang_expand_expr = 0;
/* Pointer to function to finish handling an incomplete decl at the
end of compilation. */
-void (*incomplete_decl_finalize_hook) () = 0;
+void (*incomplete_decl_finalize_hook) PROTO((tree)) = 0;
/* Highest label number used at the end of reload. */
@@ -481,6 +497,11 @@ int flag_move_all_movables = 0;
int flag_reduce_all_givs = 0;
+/* Nonzero to perform full register move optimization passes. This is the
+ default for -O2. */
+
+int flag_regmove = 0;
+
/* Nonzero for -fwritable-strings:
store string constants in data segment and don't uniquize them. */
@@ -502,6 +523,10 @@ int flag_omit_frame_pointer = 0;
int flag_function_sections = 0;
+/* ... and similar for data. */
+
+int flag_data_sections = 0;
+
/* Nonzero to inhibit use of define_optimization peephole opts. */
int flag_no_peephole = 0;
@@ -525,6 +550,10 @@ int flag_volatile_global;
int flag_syntax_only = 0;
+/* Nonzero means perform global cse. */
+
+static int flag_gcse;
+
/* Nonzero means to rerun cse after loop optimization. This increases
compilation time about 20% and picks up a few more common expressions. */
@@ -580,7 +609,12 @@ int flag_pic;
/* Nonzero means generate extra code for exception handling and enable
exception handling. */
-int flag_exceptions = 2;
+int flag_exceptions;
+
+/* Nonzero means use the new model for exception handling. Replaces
+ -DNEW_EH_MODEL as a compile option. */
+
+int flag_new_exceptions = 0;
/* Nonzero means don't place uninitialized global data in common storage
by default. */
@@ -678,8 +712,6 @@ int flag_check_memory_usage = 0;
-fcheck-memory-usage. */
int flag_prefix_function_name = 0;
-int flag_regmove = 0;
-
/* 0 if pointer arguments may alias each other. True in C.
1 if pointer arguments may not alias each other but may alias
global variables.
@@ -688,190 +720,394 @@ int flag_regmove = 0;
This defaults to 0 for C. */
int flag_argument_noalias = 0;
+/* Nonzero if we should do (language-dependent) alias analysis.
+ Typically, this analysis will assume that expressions of certain
+ types do not alias expressions of certain other types. Only used
+ if alias analysis (in general) is enabled. */
+int flag_strict_aliasing = 0;
+
+/* Instrument functions with calls at entry and exit, for profiling. */
+int flag_instrument_function_entry_exit = 0;
+
+
+/* Table of supported debugging formats. */
+static struct
+{
+ char * arg;
+ /* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
+ constant expression, we use NO_DEBUG in its place. */
+ enum debug_info_type debug_type;
+ int use_extensions_p;
+ char * description;
+} *da,
+debug_args[] =
+{
+ { "g", NO_DEBUG, DEFAULT_GDB_EXTENSIONS,
+ "Generate default debug format output" },
+ { "ggdb", NO_DEBUG, 1, "Generate default extended debug format output" },
+#ifdef DBX_DEBUGGING_INFO
+ { "gstabs", DBX_DEBUG, 0, "Generate STABS format debug output" },
+ { "gstabs+", DBX_DEBUG, 1, "Generate extended STABS format debug output" },
+#endif
+#ifdef DWARF_DEBUGGING_INFO
+ { "gdwarf", DWARF_DEBUG, 0, "Generate DWARF-1 format debug output"},
+ { "gdwarf+", DWARF_DEBUG, 1,
+ "Generated extended DWARF-1 format debug output" },
+#endif
+#ifdef DWARF2_DEBUGGING_INFO
+ { "gdwarf-2", DWARF2_DEBUG, 0, "Enable DWARF-2 debug output" },
+#endif
+#ifdef XCOFF_DEBUGGING_INFO
+ { "gxcoff", XCOFF_DEBUG, 0, "Generate XCOFF format debug output" },
+ { "gxcoff+", XCOFF_DEBUG, 1, "Generate extended XCOFF format debug output" },
+#endif
+#ifdef SDB_DEBUGGING_INFO
+ { "gcoff", SDB_DEBUG, 0, "Generate COFF format debug output" },
+#endif
+ { 0, 0, 0 }
+};
+
+typedef struct
+{
+ char * string;
+ int * variable;
+ int on_value;
+ char * description;
+}
+lang_independent_options;
+
/* Table of language-independent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
if `-fSTRING' is seen as an option.
(If `-fno-STRING' is seen as an option, the opposite value is stored.) */
-struct { char *string; int *variable; int on_value;} f_options[] =
+lang_independent_options f_options[] =
{
- {"float-store", &flag_float_store, 1},
- {"volatile", &flag_volatile, 1},
- {"volatile-global", &flag_volatile_global, 1},
- {"defer-pop", &flag_defer_pop, 1},
- {"omit-frame-pointer", &flag_omit_frame_pointer, 1},
- {"cse-follow-jumps", &flag_cse_follow_jumps, 1},
- {"cse-skip-blocks", &flag_cse_skip_blocks, 1},
- {"expensive-optimizations", &flag_expensive_optimizations, 1},
- {"thread-jumps", &flag_thread_jumps, 1},
- {"strength-reduce", &flag_strength_reduce, 1},
- {"unroll-loops", &flag_unroll_loops, 1},
- {"unroll-all-loops", &flag_unroll_all_loops, 1},
- {"move-all-movables", &flag_move_all_movables, 1},
- {"reduce-all-givs", &flag_reduce_all_givs, 1},
- {"writable-strings", &flag_writable_strings, 1},
- {"peephole", &flag_no_peephole, 0},
- {"force-mem", &flag_force_mem, 1},
- {"force-addr", &flag_force_addr, 1},
- {"function-cse", &flag_no_function_cse, 0},
- {"inline-functions", &flag_inline_functions, 1},
- {"keep-inline-functions", &flag_keep_inline_functions, 1},
- {"inline", &flag_no_inline, 0},
- {"keep-static-consts", &flag_keep_static_consts, 1},
- {"syntax-only", &flag_syntax_only, 1},
- {"shared-data", &flag_shared_data, 1},
- {"caller-saves", &flag_caller_saves, 1},
- {"pcc-struct-return", &flag_pcc_struct_return, 1},
- {"reg-struct-return", &flag_pcc_struct_return, 0},
- {"delayed-branch", &flag_delayed_branch, 1},
- {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1},
- {"rerun-loop-opt", &flag_rerun_loop_opt, 1},
- {"pretend-float", &flag_pretend_float, 1},
- {"schedule-insns", &flag_schedule_insns, 1},
- {"schedule-insns2", &flag_schedule_insns_after_reload, 1},
+ {"float-store", &flag_float_store, 1,
+ "Do not store floats in registers" },
+ {"volatile", &flag_volatile, 1,
+ "Consider all mem refs through pointers as volatile"},
+ {"volatile-global", &flag_volatile_global, 1,
+ "Consider all mem refs to global data to be volatile" },
+ {"defer-pop", &flag_defer_pop, 1,
+ "Defer popping functions args from stack until later" },
+ {"omit-frame-pointer", &flag_omit_frame_pointer, 1,
+ "When possible do not generate stack frames"},
+ {"cse-follow-jumps", &flag_cse_follow_jumps, 1,
+ "When running CSE, follow jumps to their targets" },
+ {"cse-skip-blocks", &flag_cse_skip_blocks, 1,
+ "When running CSE, follow conditional jumps" },
+ {"expensive-optimizations", &flag_expensive_optimizations, 1,
+ "Perform a number of minor, expensive optimisations" },
+ {"thread-jumps", &flag_thread_jumps, 1,
+ "Perform jump threading optimisations"},
+ {"strength-reduce", &flag_strength_reduce, 1,
+ "Perform strength reduction optimisations" },
+ {"unroll-loops", &flag_unroll_loops, 1,
+ "Perform loop unrolling when interation count is known" },
+ {"unroll-all-loops", &flag_unroll_all_loops, 1,
+ "Perofm loop onrolling for all loops" },
+ {"move-all-movables", &flag_move_all_movables, 1,
+ "Force all loop invariant computations out of loops" },
+ {"reduce-all-givs", &flag_reduce_all_givs, 1,
+ "Strength reduce all loop general induction variables" },
+ {"writable-strings", &flag_writable_strings, 1,
+ "Store strings in writable data section" },
+ {"peephole", &flag_no_peephole, 0,
+ "Enable machine specific peephole optimisations" },
+ {"force-mem", &flag_force_mem, 1,
+ "Copy memory operands into registers before using" },
+ {"force-addr", &flag_force_addr, 1,
+ "Copy memory address constants into regs before using" },
+ {"function-cse", &flag_no_function_cse, 0,
+ "Allow function addresses to be held in registers" },
+ {"inline-functions", &flag_inline_functions, 1,
+ "Integrate simple functions into their callers" },
+ {"keep-inline-functions", &flag_keep_inline_functions, 1,
+ "Generate code for funcs even if they are fully inlined" },
+ {"inline", &flag_no_inline, 0,
+ "Pay attention to the 'inline' keyword"},
+ {"keep-static-consts", &flag_keep_static_consts, 1,
+ "Emit static const variables even if they are not used" },
+ {"syntax-only", &flag_syntax_only, 1,
+ "Check for syntax errors, then stop" },
+ {"shared-data", &flag_shared_data, 1,
+ "Mark data as shared rather than private" },
+ {"caller-saves", &flag_caller_saves, 1,
+ "Enable saving registers around function calls" },
+ {"pcc-struct-return", &flag_pcc_struct_return, 1,
+ "Return 'short' aggregates in memory, not registers" },
+ {"reg-struct-return", &flag_pcc_struct_return, 0,
+ "Return 'short' aggregates in registers" },
+ {"delayed-branch", &flag_delayed_branch, 1,
+ "Attempt to fill delay slots of branch instructions" },
+ {"gcse", &flag_gcse, 1,
+ "Perform the global common subexpression elimination" },
+ {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
+ "Run CSE pass after loop optimisations"},
+ {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
+ "Run the loop optimiser twice"},
+ {"pretend-float", &flag_pretend_float, 1,
+ "Pretend that host and target use the same FP format"},
+ {"schedule-insns", &flag_schedule_insns, 1,
+ "Reschedule instructions to avoid pipeline stalls"},
+ {"schedule-insns2", &flag_schedule_insns_after_reload, 1,
+ "Run two passes of the instruction scheduler"},
#ifdef HAIFA
- {"sched-interblock",&flag_schedule_interblock, 1},
- {"sched-spec",&flag_schedule_speculative, 1},
- {"sched-spec-load",&flag_schedule_speculative_load, 1},
- {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1},
- {"branch-count-reg",&flag_branch_on_count_reg, 1},
+ {"sched-interblock",&flag_schedule_interblock, 1,
+ "Enable scheduling across basic blocks" },
+ {"sched-spec",&flag_schedule_speculative, 1,
+ "Allow speculative motion of non-loads" },
+ {"sched-spec-load",&flag_schedule_speculative_load, 1,
+ "Allow speculative motion of some loads" },
+ {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
+ "Allow speculative motion of more loads" },
+ {"branch-count-reg",&flag_branch_on_count_reg, 1,
+ "Replace add,compare,branch with branch on count reg"},
#endif /* HAIFA */
- {"pic", &flag_pic, 1},
- {"PIC", &flag_pic, 2},
- {"exceptions", &flag_exceptions, 1},
- {"sjlj-exceptions", &exceptions_via_longjmp, 1},
- {"asynchronous-exceptions", &asynchronous_exceptions, 1},
- {"profile-arcs", &profile_arc_flag, 1},
- {"test-coverage", &flag_test_coverage, 1},
- {"branch-probabilities", &flag_branch_probabilities, 1},
- {"fast-math", &flag_fast_math, 1},
- {"common", &flag_no_common, 0},
- {"inhibit-size-directive", &flag_inhibit_size_directive, 1},
- {"function-sections", &flag_function_sections, 1},
- {"verbose-asm", &flag_verbose_asm, 1},
- {"gnu-linker", &flag_gnu_linker, 1},
- {"regmove", &flag_regmove, 1},
- {"pack-struct", &flag_pack_struct, 1},
- {"stack-check", &flag_stack_check, 1},
- {"argument-alias", &flag_argument_noalias, 0},
- {"argument-noalias", &flag_argument_noalias, 1},
- {"argument-noalias-global", &flag_argument_noalias, 2},
- {"check-memory-usage", &flag_check_memory_usage, 1},
- {"prefix-function-name", &flag_prefix_function_name, 1}
+ {"pic", &flag_pic, 1,
+ "Generate position independent code, if possible"},
+ {"PIC", &flag_pic, 2, ""},
+ {"exceptions", &flag_exceptions, 1,
+ "Enable exception handling" },
+ {"new-exceptions", &flag_new_exceptions, 1,
+ "Use the new model for exception handling" },
+ {"sjlj-exceptions", &exceptions_via_longjmp, 1,
+ "Use setjmp/longjmp to handle exceptions" },
+ {"asynchronous-exceptions", &asynchronous_exceptions, 1,
+ "Support asynchronous exceptions" },
+ {"profile-arcs", &profile_arc_flag, 1,
+ "Insert arc based program profiling code" },
+ {"test-coverage", &flag_test_coverage, 1,
+ "Create data files needed by gcov" },
+ {"branch-probabilities", &flag_branch_probabilities, 1,
+ "Use profiling information for branch porbabilities" },
+ {"fast-math", &flag_fast_math, 1,
+ "Improve FP speed by violating ANSI & IEEE rules" },
+ {"common", &flag_no_common, 0,
+ "Do not put unitialised globals in the common section" },
+ {"inhibit-size-directive", &flag_inhibit_size_directive, 1,
+ "Do not generate .size directives" },
+ {"function-sections", &flag_function_sections, 1,
+ "place each function into its own section" },
+ {"data-sections", &flag_data_sections, 1,
+ "place data items into their own section" },
+ {"verbose-asm", &flag_verbose_asm, 1,
+ "Add extra commentry to assembler output"},
+ {"gnu-linker", &flag_gnu_linker, 1,
+ "Output GNU ld formatted global initialisers"},
+ {"regmove", &flag_regmove, 1,
+ "Enables a regoster move optimisation"},
+ {"optimize-register-move", &flag_regmove, 1},
+ {"pack-struct", &flag_pack_struct, 1,
+ "Pack structure members together without holes" },
+ {"stack-check", &flag_stack_check, 1,
+ "Insert stack checking code into the program" },
+ {"argument-alias", &flag_argument_noalias, 0,
+ "Specify that arguments may alias each other & globals"},
+ {"argument-noalias", &flag_argument_noalias, 1,
+ "Assume arguments may alias globals but not each other"},
+ {"argument-noalias-global", &flag_argument_noalias, 2,
+ "Assume arguments do not alias each other or globals" },
+ {"strict-aliasing", &flag_strict_aliasing, 1,
+ "Assume strict aliasing rules apply" },
+ {"check-memory-usage", &flag_check_memory_usage, 1,
+ "Generate code to check every memory access" },
+ {"prefix-function-name", &flag_prefix_function_name, 1,
+ "Add a prefix to all function names" },
+ {"dump-unnumbered", &flag_dump_unnumbered, 1},
+ {"instrument-functions", &flag_instrument_function_entry_exit, 1,
+ "Instrument function entry/exit with profiling calls"},
};
+#define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0]))
+
/* Table of language-specific options. */
-char *lang_options[] =
+static struct lang_opt
+{
+ char * option;
+ char * description;
+}
+documented_lang_options[] =
{
- "-ansi",
- "-fallow-single-precision",
-
- "-fsigned-bitfields",
- "-funsigned-bitfields",
- "-fno-signed-bitfields",
- "-fno-unsigned-bitfields",
- "-fsigned-char",
- "-funsigned-char",
- "-fno-signed-char",
- "-fno-unsigned-char",
-
- "-ftraditional",
- "-traditional",
- "-fnotraditional",
- "-fno-traditional",
-
- "-fasm",
- "-fno-asm",
- "-fbuiltin",
- "-fno-builtin",
- "-fhosted",
- "-fno-hosted",
- "-ffreestanding",
- "-fno-freestanding",
- "-fcond-mismatch",
- "-fno-cond-mismatch",
- "-fdollars-in-identifiers",
- "-fno-dollars-in-identifiers",
- "-fident",
- "-fno-ident",
- "-fshort-double",
- "-fno-short-double",
- "-fshort-enums",
- "-fno-short-enums",
-
- "-Wall",
- "-Wbad-function-cast",
- "-Wno-bad-function-cast",
- "-Wcast-qual",
- "-Wno-cast-qual",
- "-Wchar-subscripts",
- "-Wno-char-subscripts",
- "-Wcomment",
- "-Wno-comment",
- "-Wcomments",
- "-Wno-comments",
- "-Wconversion",
- "-Wno-conversion",
- "-Wformat",
- "-Wno-format",
- "-Wimport",
- "-Wno-import",
- "-Wimplicit-function-declaration",
- "-Wno-implicit-function-declaration",
- "-Werror-implicit-function-declaration",
- "-Wimplicit-int",
- "-Wno-implicit-int",
- "-Wimplicit",
- "-Wno-implicit",
- "-Wmain",
- "-Wno-main",
- "-Wmissing-braces",
- "-Wno-missing-braces",
- "-Wmissing-declarations",
- "-Wno-missing-declarations",
- "-Wmissing-prototypes",
- "-Wno-missing-prototypes",
- "-Wnested-externs",
- "-Wno-nested-externs",
- "-Wparentheses",
- "-Wno-parentheses",
- "-Wpointer-arith",
- "-Wno-pointer-arith",
- "-Wredundant-decls",
- "-Wno-redundant-decls",
- "-Wsign-compare",
- "-Wno-sign-compare",
- "-Wunknown-pragmas",
- "-Wno-unknown-pragmas",
- "-Wstrict-prototypes",
- "-Wno-strict-prototypes",
- "-Wtraditional",
- "-Wno-traditional",
- "-Wtrigraphs",
- "-Wno-trigraphs",
- "-Wundef",
- "-Wno-undef",
- "-Wwrite-strings",
- "-Wno-write-strings",
-
- /* these are for obj c */
- "-lang-objc",
- "-gen-decls",
- "-fgnu-runtime",
- "-fno-gnu-runtime",
- "-fnext-runtime",
- "-fno-next-runtime",
- "-Wselector",
- "-Wno-selector",
- "-Wprotocol",
- "-Wno-protocol",
- "-print-objc-runtime-info",
+ /* In order not to overload the --help output, the convention
+ used here is to only describe those options which are not
+ enabled by default. */
+
+ { "-ansi", "Compile just for ANSI C" },
+ { "-fallow-single-precision",
+ "Do not promote floats to double if using -traditional" },
+
+ { "-fsigned-bitfields", "" },
+ { "-funsigned-bitfields","Make bitfields by unsigned by default" },
+ { "-fno-signed-bitfields", "" },
+ { "-fno-unsigned-bitfields","" },
+ { "-fsigned-char", "Make 'char' be signed by default"},
+ { "-funsigned-char", "Make 'char' be unsigned by default"},
+ { "-fno-signed-char", "" },
+ { "-fno-unsigned-char", "" },
+
+ { "-ftraditional", "" },
+ { "-traditional", "Attempt to support traditional K&R style C"},
+ { "-fnotraditional", "" },
+ { "-fno-traditional", "" },
+
+ { "-fasm", "" },
+ { "-fno-asm", "Do not recognise the 'asm' keyword" },
+ { "-fbuiltin", "" },
+ { "-fno-builtin", "Do not recognise any built in functions" },
+ { "-fhosted", "Assume normal C execution environment" },
+ { "-fno-hosted", "" },
+ { "-ffreestanding",
+ "Assume that standard libraries & main might not exist" },
+ { "-fno-freestanding", "" },
+ { "-fcond-mismatch", "Allow different types as args of ? operator"},
+ { "-fno-cond-mismatch", "" },
+ { "-fdollars-in-identifiers", "Allow the use of $ inside indentifiers" },
+ { "-fno-dollars-in-identifiers", "" },
+ { "-fident", "" },
+ { "-fno-ident", "Ignore #ident directives" },
+ { "-fshort-double", "Use the same size for double as for float" },
+ { "-fno-short-double", "" },
+ { "-fshort-enums", "Use the smallest fitting integer to hold enums"},
+ { "-fno-short-enums", "" },
+
+ { "-Wall", "Enable most warning messages" },
+ { "-Wbad-function-cast",
+ "Warn about casting functions to incompatible types" },
+ { "-Wno-bad-function-cast", "" },
+ { "-Wcast-qual", "Warn about casts which discard qualifiers"},
+ { "-Wno-cast-qual", "" },
+ { "-Wchar-subscripts", "Warn about subscripts whose type is 'char'"},
+ { "-Wno-char-subscripts", "" },
+ { "-Wcomment", "Warn if nested comments are detected" },
+ { "-Wno-comment", },
+ { "-Wcomments", },
+ { "-Wno-comments", },
+ { "-Wconversion", "Warn about possibly confusing type conversions" },
+ { "-Wno-conversion", "" },
+ { "-Wformat", "Warn about printf format anomalies" },
+ { "-Wno-format", "" },
+ { "-Wimplicit-function-declaration",
+ "Warn about implicit function declarations" },
+ { "-Wno-implicit-function-declaration", "" },
+ { "-Werror-implicit-function-declaration", "" },
+ { "-Wimplicit-int", "Warn when a declaration does not specify a type" },
+ { "-Wno-implicit-int", "" },
+ { "-Wimplicit", "" },
+ { "-Wno-implicit", "" },
+ { "-Wimport", "Warn about the use of the #import directive" },
+ { "-Wno-import", "" },
+ { "-Wlong-long","" },
+ { "-Wno-long-long", "Do not warn about using 'long long' when -pedantic" },
+ { "-Wmain", "Warn about suspicious declarations of main" },
+ { "-Wno-main", "" },
+ { "-Wmissing-braces",
+ "Warn about possibly missing braces around initialisers" },
+ { "-Wno-missing-braces", "" },
+ { "-Wmissing-declarations",
+ "Warn about global funcs without previous declarations"},
+ { "-Wno-missing-declarations", "" },
+ { "-Wmissing-prototypes", "Warn about global funcs without prototypes" },
+ { "-Wno-missing-prototypes", "" },
+ { "-Wmultichar", "Warn about use of multicharacter literals"},
+ { "-Wno-multichar", "" },
+ { "-Wnested-externs", "Warn about externs not at file scope level" },
+ { "-Wno-nested-externs", "" },
+ { "-Wparentheses", "Warn about possible missing parentheses" },
+ { "-Wno-parentheses", "" },
+ { "-Wpointer-arith", "Warn about function pointer arithmetic" },
+ { "-Wno-pointer-arith", "" },
+ { "-Wredundant-decls",
+ "Warn about multiple declarations of the same object" },
+ { "-Wno-redundant-decls", "" },
+ { "-Wsign-compare", "Warn about signed/unsigned comparisons" },
+ { "-Wno-sign-compare", "" },
+ { "-Wunknown-pragmas", "Warn about unrecognised pragmas" },
+ { "-Wno-unknown-pragmas", "" },
+ { "-Wstrict-prototypes", "Warn about non-prototyped function decls" },
+ { "-Wno-strict-prototypes", "" },
+ { "-Wtraditional", "Warn about constructs whose meaning change in ANSI C"},
+ { "-Wno-traditional", "" },
+ { "-Wtrigraphs", "Warn when trigraphs are encountered" },
+ { "-Wno-trigraphs", "" },
+ { "-Wundef", "" },
+ { "-Wno-undef", "" },
+ { "-Wwrite-strings", "Mark strings as 'const char *'"},
+ { "-Wno-write-strings", "" },
+
+ /* These are for languages with USE_CPPLIB. */
+ /* These options are already documented in cpplib.c */
+ { "--help", "" },
+ { "-A", "" },
+ { "-D", "" },
+ { "-I", "" },
+ { "-U", "" },
+ { "-idirafter", "" },
+ { "-imacros", "" },
+ { "-include", "" },
+ { "-iprefix", "" },
+ { "-isystem", "" },
+ { "-iwithprefix", "" },
+ { "-iwithprefixbefore", "" },
+ { "-lang-c", "" },
+ { "-lang-c89", "" },
+ { "-lang-c++", "" },
+ { "-remap", "" },
+ { "-nostdinc", "" },
+ { "-nostdinc++", "" },
+ { "-trigraphs", "" },
+ { "-undef", "" },
+
+#define DEFINE_LANG_NAME(NAME) { NULL, NAME },
+
+ /* These are for obj c. */
+ DEFINE_LANG_NAME ("Objective C")
+
+ { "-lang-objc", "" },
+ { "-gen-decls", "Dump decls to a .decl file" },
+ { "-fgnu-runtime", "Generate code for GNU runtime envrionment" },
+ { "-fno-gnu-runtime", "" },
+ { "-fnext-runtime", "Generate code for NeXT runtime environment" },
+ { "-fno-next-runtime", "" },
+ { "-Wselector", "Warn if a selector has multiple methods" },
+ { "-Wno-selector", "" },
+ { "-Wprotocol", "" },
+ { "-Wno-protocol", "Do not warn if inherited methods are unimplemented"},
+ { "-print-objc-runtime-info",
+ "Generate C header of platform specific features" },
#include "options.h"
- 0
+
};
+
+/* Here is a table, controlled by the tm.h file, listing each -m switch
+ and which bits in `target_switches' it should set or clear.
+ If VALUE is positive, it is bits to set.
+ If VALUE is negative, -VALUE is bits to clear.
+ (The sign bit is not used so there is no confusion.) */
+
+struct
+{
+ char * name;
+ int value;
+ char * description;
+}
+target_switches [] = TARGET_SWITCHES;
+
+/* This table is similar, but allows the switch to have a value. */
+
+#ifdef TARGET_OPTIONS
+struct
+{
+ char * prefix;
+ char ** variable;
+ char * description;
+}
+target_options [] = TARGET_OPTIONS;
+#endif
/* Options controlling warnings */
@@ -938,16 +1174,21 @@ int warn_aggregate_return;
/* Likewise for -W. */
-struct { char *string; int *variable; int on_value;} W_options[] =
+lang_independent_options W_options[] =
{
- {"unused", &warn_unused, 1},
- {"error", &warnings_are_errors, 1},
- {"shadow", &warn_shadow, 1},
- {"switch", &warn_switch, 1},
- {"aggregate-return", &warn_aggregate_return, 1},
- {"cast-align", &warn_cast_align, 1},
- {"uninitialized", &warn_uninitialized, 1},
- {"inline", &warn_inline, 1}
+ {"unused", &warn_unused, 1, "Warn when a variable is unused" },
+ {"error", &warnings_are_errors, 1, ""},
+ {"shadow", &warn_shadow, 1, "Warn when one local variable shadows another" },
+ {"switch", &warn_switch, 1,
+ "Warn about enumerated switches missing a specific case" },
+ {"aggregate-return", &warn_aggregate_return, 1,
+ "Warn about returning structures, unions or arrays" },
+ {"cast-align", &warn_cast_align, 1,
+ "Warn about pointer casts which increase alignment" },
+ {"uninitialized", &warn_uninitialized, 1,
+ "Warn about unitialized automatic variables"},
+ {"inline", &warn_inline, 1,
+ "Warn when an inlined function cannot be inlined"}
};
/* Output files for assembler code (real compiler output)
@@ -964,6 +1205,7 @@ int varconst_time;
int integration_time;
int jump_time;
int cse_time;
+int gcse_time;
int loop_time;
int cse2_time;
int branch_prob_time;
@@ -1154,7 +1396,7 @@ fatal_insn_not_found (insn)
static char *
decl_name (decl, verbosity)
tree decl;
- int verbosity;
+ int verbosity ATTRIBUTE_UNUSED;
{
return IDENTIFIER_POINTER (DECL_NAME (decl));
}
@@ -1903,7 +2145,7 @@ do_abort ()
void
botch (s)
- char * s;
+ char * s ATTRIBUTE_UNUSED;
{
abort ();
}
@@ -1914,8 +2156,13 @@ char *
xmalloc (size)
unsigned size;
{
- register char *value = (char *) malloc (size);
- if (value == 0 && size != 0)
+ register char *value;
+
+ if (size == 0)
+ size = 1;
+
+ value = (char *) malloc (size);
+ if (value == 0)
fatal ("virtual memory exhausted");
return value;
}
@@ -1923,11 +2170,16 @@ xmalloc (size)
/* Same as `calloc' but report error if no memory available. */
char *
-xcalloc (nelt, size)
- unsigned nelt, size;
+xcalloc (size1, size2)
+ unsigned size1, size2;
{
- register char *value = (char *) calloc (nelt, size);
- if (value == 0 && nelt != 0 && size != 0)
+ register char *value;
+
+ if (size1 == 0 || size2 == 0)
+ size1 = size2 = 1;
+
+ value = (char *) calloc (size1, size2);
+ if (value == 0)
fatal ("virtual memory exhausted");
return value;
}
@@ -1940,11 +2192,18 @@ xrealloc (ptr, size)
char *ptr;
int size;
{
- char *result = (ptr
- ? (char *) realloc (ptr, size)
- : (char *) malloc (size));
+ char *result;
+
+ if (size == 0)
+ size = 1;
+
+ result = (ptr
+ ? (char *) realloc (ptr, size)
+ : (char *) malloc (size));
+
if (!result)
fatal ("virtual memory exhausted");
+
return result;
}
@@ -2005,7 +2264,7 @@ jmp_buf float_handler;
static void
float_signal (signo)
/* If this is missing, some compilers complain. */
- int signo;
+ int signo ATTRIBUTE_UNUSED;
{
if (float_handled == 0)
abort ();
@@ -2047,10 +2306,10 @@ push_float_handler (handler, old_handler)
float_handled = 1;
if (was_handled)
- bcopy ((char *) float_handler, (char *) old_handler,
+ memcpy ((char *) old_handler, (char *) float_handler,
sizeof (float_handler));
- bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
+ memcpy ((char *) float_handler, (char *) handler, sizeof (float_handler));
return was_handled;
}
@@ -2072,7 +2331,7 @@ pop_float_handler (handled, handler)
static void
pipe_closed (signo)
/* If this is missing, some compilers complain. */
- int signo;
+ int signo ATTRIBUTE_UNUSED;
{
fatal ("output pipe has been closed");
}
@@ -2276,6 +2535,7 @@ compile_file (name)
integration_time = 0;
jump_time = 0;
cse_time = 0;
+ gcse_time = 0;
loop_time = 0;
cse2_time = 0;
branch_prob_time = 0;
@@ -2364,6 +2624,8 @@ compile_file (name)
if (dbr_sched_dump)
clean_dump_file (".dbr");
#endif
+ if (gcse_dump)
+ clean_dump_file (".gcse");
#ifdef STACK_REGS
if (stack_reg_dump)
clean_dump_file (".stack");
@@ -2410,32 +2672,10 @@ compile_file (name)
input_file_stack->next = 0;
input_file_stack->name = input_filename;
- /* Gross. Gross. lang_init is (I think) the first callback into
- the language front end, and is thus the first opportunity to
- have the selected language override the default value for any
- -f option.
-
- So the default value for flag_exceptions is 2 (uninitialized).
- If we encounter -fno-exceptions or -fexceptions, then flag_exceptions
- will be set to zero or one respectively.
-
- flag_exceptions can also be set by lang_init to something other
- than the default "uninitialized" value of 2.
-
- After lang_init, if the value is still 2, then we default to
- -fno-exceptions (value will be reset to zero).
-
- When our EH mechanism is low enough overhead that we can enable
- it by default for languages other than C++, then all this braindamage
- will go away. */
-
/* Perform language-specific initialization.
This may set main_input_filename. */
lang_init ();
- if (flag_exceptions == 2)
- flag_exceptions = 0;
-
/* If the input doesn't start with a #line, use the input name
as the official input file name. */
if (main_input_filename == 0)
@@ -2474,6 +2714,11 @@ compile_file (name)
warning ("-ffunction-sections not supported for this target.");
flag_function_sections = 0;
}
+ if (flag_data_sections)
+ {
+ warning ("-fdata-sections not supported for this target.");
+ flag_data_sections = 0;
+ }
#endif
if (flag_function_sections
@@ -2846,6 +3091,7 @@ compile_file (name)
print_time ("integration", integration_time);
print_time ("jump", jump_time);
print_time ("cse", cse_time);
+ print_time ("gcse", gcse_time);
print_time ("loop", loop_time);
print_time ("cse2", cse2_time);
print_time ("branch-prob", branch_prob_time);
@@ -2948,8 +3194,13 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
void
rest_of_type_compilation (type, toplev)
+#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO) || defined (SDB_DEBUGGING_INFO)
tree type;
int toplev;
+#else
+ tree type ATTRIBUTE_UNUSED;
+ int toplev ATTRIBUTE_UNUSED;
+#endif
{
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
@@ -3042,7 +3293,8 @@ rest_of_compilation (decl)
for those functions that need to be output. Also defer those
functions that we are supposed to defer. We cannot defer
functions containing nested functions since the nested function
- data is in our non-saved obstack. */
+ data is in our non-saved obstack. We cannot defer nested
+ functions for the same reason. */
/* If this is a nested inline, remove ADDRESSOF now so we can
finish compiling ourselves. Otherwise, wait until EOF.
@@ -3145,8 +3397,9 @@ rest_of_compilation (decl)
}
/* If specified extern inline but we aren't inlining it, we are
- done. */
- if (DECL_INLINE (decl) && DECL_EXTERNAL (decl))
+ done. This goes for anything that gets here with DECL_EXTERNAL
+ set, not just things with DECL_INLINE. */
+ if (DECL_EXTERNAL (decl))
goto exit_rest_of_compilation;
}
@@ -3262,6 +3515,18 @@ rest_of_compilation (decl)
if (addressof_dump)
dump_rtl (".addressof", decl, print_rtl, insns);
+ /* Perform global cse. */
+
+ if (optimize > 0 && flag_gcse)
+ {
+ if (gcse_dump)
+ open_dump_file (".gcse", IDENTIFIER_POINTER (DECL_NAME (decl)));
+
+ TIMEVAR (gcse_time, gcse_main (insns, rtl_dump_file));
+
+ if (gcse_dump)
+ close_dump_file (print_rtl, insns);
+ }
/* Move constant computations out of loops. */
if (optimize > 0)
@@ -3276,7 +3541,7 @@ rest_of_compilation (decl)
{
/* We only want to perform unrolling once. */
- loop_optimize (insns, rtl_dump_file, 0);
+ loop_optimize (insns, rtl_dump_file, 0, 0);
/* The first call to loop_optimize makes some instructions
@@ -3289,7 +3554,7 @@ rest_of_compilation (decl)
analysis code depends on this information. */
reg_scan (insns, max_reg_num (), 1);
}
- loop_optimize (insns, rtl_dump_file, flag_unroll_loops);
+ loop_optimize (insns, rtl_dump_file, flag_unroll_loops, 1);
});
/* Dump rtl code after loop opt, if we are doing that. */
@@ -3456,6 +3721,7 @@ rest_of_compilation (decl)
if (!obey_regdecls)
TIMEVAR (local_alloc_time,
{
+ recompute_reg_usage (insns);
regclass (insns, max_reg_num ());
local_alloc ();
});
@@ -3491,11 +3757,6 @@ rest_of_compilation (decl)
failure = reload (insns, 0, rtl_dump_file);
});
- if (global_reg_dump)
- {
- TIMEVAR (dump_time, dump_global_regs (rtl_dump_file));
- close_dump_file (print_rtl_with_bb, insns);
- }
if (failure)
goto exit_rest_of_compilation;
@@ -3513,6 +3774,11 @@ rest_of_compilation (decl)
thread_prologue_and_epilogue_insns (insns);
+ if (global_reg_dump)
+ {
+ TIMEVAR (dump_time, dump_global_regs (rtl_dump_file));
+ close_dump_file (print_rtl_with_bb, insns);
+ }
if (optimize > 0 && flag_schedule_insns_after_reload)
{
if (sched2_dump)
@@ -3580,6 +3846,9 @@ rest_of_compilation (decl)
});
#ifdef STACK_REGS
+ if (stack_reg_dump)
+ open_dump_file (".stack", decl_printable_name (decl, 2));
+
TIMEVAR (stack_reg_time, reg_to_stack (insns, rtl_dump_file));
if (stack_reg_dump)
@@ -3666,21 +3935,22 @@ rest_of_compilation (decl)
reload_completed = 0;
- /* Clear out the insn_length contents now that they are no longer valid. */
- init_insn_lengths ();
-
- /* Clear out the real_constant_chain before some of the rtx's
- it runs through become garbage. */
-
- clear_const_double_mem ();
-
- /* Cancel the effect of rtl_in_current_obstack. */
+ TIMEVAR (final_time,
+ {
+ /* Clear out the insn_length contents now that they are no
+ longer valid. */
+ init_insn_lengths ();
- resume_temporary_allocation ();
+ /* Clear out the real_constant_chain before some of the rtx's
+ it runs through become garbage. */
+ clear_const_double_mem ();
- /* Show no temporary slots allocated. */
+ /* Cancel the effect of rtl_in_current_obstack. */
+ resume_temporary_allocation ();
- init_temp_slots ();
+ /* Show no temporary slots allocated. */
+ init_temp_slots ();
+ });
/* Make sure volatile mem refs aren't considered valid operands for
arithmetic insns. We must call this here if this is a nested inline
@@ -3701,15 +3971,242 @@ rest_of_compilation (decl)
parse_time -= get_run_time () - start_time;
}
+static void
+display_help ()
+{
+ int undoc;
+ unsigned long i;
+ char * lang;
+
+#ifndef USE_CPPLIB
+ printf ("Usage: %s input [switches]\n", progname);
+ printf ("Switches:\n");
+#endif
+ printf (" -ffixed-<register> Mark <register> as being unavailable to the compiler\n");
+ printf (" -fcall-used-<register> Mark <register> as being corrupted by function calls\n");
+ printf (" -fcall-saved-<register> Mark <register> as being preserved across functions\n");
+
+ for (i = NUM_ELEM (f_options); i--;)
+ {
+ char * description = f_options[i].description;
+
+ if (description != NULL && * description != 0)
+ printf (" -f%-21s %s\n",
+ f_options[i].string, description);
+ }
+
+ printf (" -O[number] Set optimisation level to [number]\n");
+ printf (" -Os Optimise for space rather than speed\n");
+ printf (" -pedantic Issue warnings needed by strict compliance to ANSI C\n");
+ printf (" -pedantic-errors Like -pedantic except that errors are produced\n");
+ printf (" -w Suppress warnings\n");
+ printf (" -W Enable extra warnings\n");
+
+ for (i = NUM_ELEM (W_options); i--;)
+ {
+ char * description = W_options[i].description;
+
+ if (description != NULL && * description != 0)
+ printf (" -W%-21s %s\n",
+ W_options[i].string, description);
+ }
+
+ printf (" -Wid-clash-<num> Warn if 2 identifiers have the same first <num> chars\n");
+ printf (" -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n");
+ printf (" -p Enable function profiling\n");
+#if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER)
+ printf (" -a Enable block profiling \n");
+#endif
+#if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER) || defined FUNCTION_BLOCK_PROFILER_EXIT
+ printf (" -ax Enable jump profiling \n");
+#endif
+ printf (" -o <file> Place output into <file> \n");
+ printf (" -G <number> Put global and static data smaller than <number>\n");
+ printf (" bytes into a special section (on some targets)\n");
+
+ for (i = NUM_ELEM (debug_args); i--;)
+ {
+ if (debug_args[i].description != NULL)
+ printf (" -%-22s %s\n", debug_args[i].arg, debug_args[i].description);
+ }
+
+ printf (" -aux-info <file> Emit declaration info into <file>.X\n");
+ printf (" -quiet Do not display functions compiled or elapsed time\n");
+ printf (" -version Display the compiler's version\n");
+ printf (" -d[letters] Enable dumps from specific passes of the compiler\n");
+ printf (" -dumpbase <file> Base name to be used for dumps from specific passes\n");
+#if defined HAIFA || defined INSN_SCHEDULING
+ printf (" -sched-verbose-<number> Set the verbosity level of the scheduler\n");
+#endif
+ printf (" --help Display this information\n");
+
+ undoc = 0;
+ lang = "language";
+
+ /* Display descriptions of language specific options.
+ If there is no description, note that there is an undocumented option.
+ If the description is empty, do not display anything. (This allows
+ options to be deliberately undocumented, for whatever reason).
+ If the option string is missing, then this is a marker, indicating
+ that the description string is in fact the name of a language, whose
+ language specific options are to follow. */
+
+ if (NUM_ELEM (documented_lang_options) > 1)
+ {
+ printf ("\nLanguage specific options:\n");
+
+ for (i = 0; i < NUM_ELEM (documented_lang_options); i++)
+ {
+ char * description = documented_lang_options[i].description;
+ char * option = documented_lang_options[i].option;
+
+ if (description == NULL)
+ undoc = 1;
+ else if (* description == 0)
+ continue;
+ else if (option == NULL)
+ {
+ if (undoc)
+ printf
+ ("\nThere are undocumented %s specific options as well.\n",
+ lang);
+ undoc = 0;
+
+ printf ("\n Options for %s:\n", description);
+
+ lang = description;
+ }
+ else
+ printf (" %-23.23s %s\n", option, description);
+ }
+ }
+
+ if (undoc)
+ printf ("\nThere are undocumented %s specific options as well.\n", lang);
+
+ if (NUM_ELEM (target_switches) > 1
+#ifdef TARGET_OPTIONS
+ || NUM_ELEM (target_options) > 1
+#endif
+ )
+ {
+ int doc = 0;
+
+ undoc = 0;
+
+ printf ("\nTarget specific options:\n");
+
+ for (i = NUM_ELEM (target_switches); i--;)
+ {
+ char * option = target_switches[i].name;
+ char * description = target_switches[i].description;
+
+ if (option == NULL)
+ continue;
+ else if (description == NULL)
+ undoc = 1;
+ else if (* description != 0)
+ doc += printf (" %-23.23s %s\n", option, description);
+ }
+
+#ifdef TARGET_OPTIONS
+ for (i = NUM_ELEM (target_options); i--;)
+ {
+ char * option = target_options[i].prefix;
+ char * description = target_options[i].description;
+
+ if (option == NULL)
+ continue;
+ else if (description == NULL)
+ undoc = 1;
+ else if (* description != 0)
+ doc += printf (" %-23.23s %s\n", option, description);
+ }
+#endif
+ if (undoc)
+ {
+ if (doc)
+ printf ("\nThere are undocumented target specific options as well.\n");
+ else
+ printf (" They exist, but they are not documented.\n");
+ }
+ }
+}
+
+/* Compare the user specified 'option' with the language
+ specific 'lang_option'. Return true if they match, or
+ if 'option' is a viable prefix of 'lang_option'. */
+
+static int
+check_lang_option (option, lang_option)
+ char * option;
+ char * lang_option;
+{
+ lang_independent_options * indep_options;
+ int len;
+ long k;
+
+ /* Ignore NULL entries. */
+ if (option == NULL || lang_option == NULL)
+ return 0;
+
+ len = strlen (lang_option);
+
+ /* If they do not match to the first n characters then fail. */
+ if (strncmp (option, lang_option, len) != 0)
+ return 0;
+
+ /* Do not accept a lang option, if it matches a normal -f or -W
+ option. Chill defines a -fpack, but we want to support
+ -fpack-struct. */
+
+ /* An exact match is OK */
+ if (strlen (option) == len)
+ return 1;
+
+ /* If it is not an -f or -W option allow the match */
+ if (option[0] != '-')
+ return 1;
+
+ switch (option[1])
+ {
+ case 'f': indep_options = f_options; break;
+ case 'W': indep_options = W_options; break;
+ default: return 1;
+ }
+
+ /* The option is a -f or -W option.
+ Skip past the prefix and search for the remainder in the
+ appropriate table of options. */
+ option += 2;
+
+ if (option[0] == 'n' && option[1] == 'o' && option[2] == '-')
+ option += 3;
+
+ for (k = NUM_ELEM (indep_options); k--;)
+ {
+ if (!strcmp (option, indep_options[k].string))
+ {
+ /* The option matched a language independent option,
+ do not allow the language specific match. */
+
+ return 0;
+ }
+ }
+
+ /* The option matches the start of the langauge specific option
+ and it is not an exact match for a language independent option. */
+ return 1;
+}
+
/* Entry point of cc1/c++. Decode command args, then call compile_file.
Exit code is 35 if can't open files, 34 if fatal error,
33 if had nonfatal errors, else success. */
int
-main (argc, argv, envp)
+main (argc, argv)
int argc;
char **argv;
- char **envp;
{
register int i;
char *filename = 0;
@@ -3749,7 +4246,7 @@ main (argc, argv, envp)
#endif
decl_printable_name = decl_name;
- lang_expand_expr = (struct rtx_def *(*)()) do_abort;
+ lang_expand_expr = (lang_expand_expr_t) do_abort;
/* Initialize whether `char' is signed. */
flag_signed_char = DEFAULT_SIGNED_CHAR;
@@ -3758,6 +4255,9 @@ main (argc, argv, envp)
flag_short_enums = DEFAULT_SHORT_ENUMS;
#endif
+ /* Perform language-specific options intialization. */
+ lang_init_options ();
+
/* Scan to see what optimization level has been specified. That will
determine the default value of many flags. */
for (i = 1; i < argc; i++)
@@ -3807,6 +4307,7 @@ main (argc, argv, envp)
{
flag_cse_follow_jumps = 1;
flag_cse_skip_blocks = 1;
+ flag_gcse = 1;
flag_expensive_optimizations = 1;
flag_strength_reduce = 1;
flag_rerun_cse_after_loop = 1;
@@ -3818,6 +4319,7 @@ main (argc, argv, envp)
flag_schedule_insns_after_reload = 1;
#endif
flag_regmove = 1;
+ flag_strict_aliasing = 1;
}
if (optimize >= 3)
@@ -3841,16 +4343,28 @@ main (argc, argv, envp)
for (i = 1; i < argc; i++)
{
size_t j;
+
/* If this is a language-specific option,
decode it in a language-specific way. */
- for (j = 0; lang_options[j] != 0; j++)
- if (!strncmp (argv[i], lang_options[j],
- strlen (lang_options[j])))
+ for (j = NUM_ELEM (documented_lang_options); j--;)
+ if (check_lang_option (argv[i], documented_lang_options[j].option))
break;
- if (lang_options[j] != 0)
- /* If the option is valid for *some* language,
- treat it as valid even if this language doesn't understand it. */
- lang_decode_option (argv[i]);
+
+ if (j != (size_t)-1)
+ {
+ /* If the option is valid for *some* language,
+ treat it as valid even if this language doesn't understand it. */
+ int strings_processed = lang_decode_option (argc - i, argv + i);
+
+ if (!strcmp (argv[i], "--help"))
+ {
+ display_help ();
+ exit (0);
+ }
+
+ if (strings_processed != 0)
+ i += strings_processed - 1;
+ }
else if (argv[i][0] == '-' && argv[i][1] != 0)
{
register char *str = argv[i] + 1;
@@ -3885,6 +4399,7 @@ main (argc, argv, envp)
regmove_dump = 1;
rtl_dump = 1;
cse_dump = 1, cse2_dump = 1;
+ gcse_dump = 1;
sched_dump = 1;
sched2_dump = 1;
#ifdef STACK_REGS
@@ -3917,6 +4432,9 @@ main (argc, argv, envp)
case 'g':
global_reg_dump = 1;
break;
+ case 'G':
+ gcse_dump = 1;
+ break;
case 'j':
jump_opt_dump = 1;
break;
@@ -4155,38 +4673,9 @@ main (argc, argv, envp)
-g and -ggdb don't explicitly set the debugging format so
-gdwarf -g3 is equivalent to -gdwarf3. */
static int type_explicitly_set_p = 0;
- /* Table of supported debugging formats. */
- static struct {
- char *arg;
- /* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
- constant expression, we use NO_DEBUG in its place. */
- enum debug_info_type debug_type;
- int use_extensions_p;
- } *da, debug_args[] = {
- { "g", NO_DEBUG, DEFAULT_GDB_EXTENSIONS },
- { "ggdb", NO_DEBUG, 1 },
-#ifdef DBX_DEBUGGING_INFO
- { "gstabs", DBX_DEBUG, 0 },
- { "gstabs+", DBX_DEBUG, 1 },
-#endif
-#ifdef DWARF_DEBUGGING_INFO
- { "gdwarf", DWARF_DEBUG, 0 },
- { "gdwarf+", DWARF_DEBUG, 1 },
-#endif
-#ifdef DWARF2_DEBUGGING_INFO
- { "gdwarf-2", DWARF2_DEBUG, 0 },
-#endif
-#ifdef XCOFF_DEBUGGING_INFO
- { "gxcoff", XCOFF_DEBUG, 0 },
- { "gxcoff+", XCOFF_DEBUG, 1 },
-#endif
-#ifdef SDB_DEBUGGING_INFO
- { "gcoff", SDB_DEBUG, 0 },
-#endif
- { 0, 0, 0 }
- };
/* Indexed by enum debug_info_type. */
- static char *debug_type_names[] = {
+ static char *debug_type_names[] =
+ {
"none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
};
@@ -4293,6 +4782,11 @@ main (argc, argv, envp)
flag_gen_aux_info = 1;
aux_info_file_name = (str[8] != '\0' ? str+8 : argv[++i]);
}
+ else if (!strcmp (str, "-help"))
+ {
+ display_help ();
+ exit (0);
+ }
else
error ("Invalid option `%s'", argv[i]);
}
@@ -4380,8 +4874,7 @@ main (argc, argv, envp)
{
char *lim = (char *) sbrk (0);
- fprintf (stderr, "Data size %d.\n",
- lim - (char *) &environ);
+ fprintf (stderr, "Data size %ld.\n", (long)(lim - (char *) &environ));
fflush (stderr);
#ifndef __MSDOS__
@@ -4403,26 +4896,9 @@ main (argc, argv, envp)
}
/* Decode -m switches. */
-
-/* Here is a table, controlled by the tm.h file, listing each -m switch
- and which bits in `target_switches' it should set or clear.
- If VALUE is positive, it is bits to set.
- If VALUE is negative, -VALUE is bits to clear.
- (The sign bit is not used so there is no confusion.) */
-
-struct {char *name; int value;} target_switches []
- = TARGET_SWITCHES;
-
-/* This table is similar, but allows the switch to have a value. */
-
-#ifdef TARGET_OPTIONS
-struct {char *prefix; char ** variable;} target_options []
- = TARGET_OPTIONS;
-#endif
-
/* Decode the switch -mNAME. */
-void
+static void
set_target_switch (name)
char *name;
{
@@ -4460,7 +4936,7 @@ set_target_switch (name)
Each line begins with INDENT (for the case where FILE is the
assembler output file). */
-void
+static void
print_version (file, indent)
FILE *file;
char *indent;
@@ -4482,7 +4958,7 @@ print_version (file, indent)
??? We don't handle error returns from fprintf (disk full); presumably
other code will catch a disk full though. */
-int
+static int
print_single_switch (file, pos, max, indent, sep, term, type, name)
FILE *file;
int pos, max;
@@ -4513,7 +4989,7 @@ print_single_switch (file, pos, max, indent, sep, term, type, name)
Each line begins with INDENT and ends with TERM.
Each switch is separated from the next by SEP. */
-void
+static void
print_switch_values (file, pos, max, indent, sep, term)
FILE *file;
int pos, max;
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 55790e5bb3a..740dda12c31 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -5,6 +5,13 @@
#ifndef __GCC_TOPLEV_H__
#define __GCC_TOPLEV_H__
+#ifdef __STDC__
+union tree_node;
+struct rtx_def;
+#endif
+
+extern int count_error PROTO ((int));
+extern void strip_off_ending PROTO ((char *, int));
extern void print_time PROTO ((char *, int));
extern int get_run_time PROTO ((void));
extern void debug_start_source_file PROTO ((char *));
@@ -12,9 +19,13 @@ extern void debug_end_source_file PROTO ((unsigned));
extern void debug_define PROTO ((unsigned, char *));
extern void debug_undef PROTO ((unsigned, char *));
extern void fatal PVPROTO ((char *, ...))
- ATTRIBUTE_PRINTF_1;
-extern void fatal_io_error PROTO ((char *));
-extern void pfatal_with_name PROTO ((char *));
+ ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+extern void fatal_io_error PROTO ((char *)) ATTRIBUTE_NORETURN;
+extern void pfatal_with_name PROTO ((char *)) ATTRIBUTE_NORETURN;
+extern void fatal_insn_not_found PROTO ((struct rtx_def *))
+ ATTRIBUTE_NORETURN;
+extern void fatal_insn PROTO ((char *, struct rtx_def *))
+ ATTRIBUTE_NORETURN;
extern void warning PVPROTO ((char *, ...))
ATTRIBUTE_PRINTF_1;
extern void error PVPROTO ((char *, ...))
@@ -29,6 +40,8 @@ extern void error_with_file_and_line PVPROTO ((char *, int, char *, ...))
ATTRIBUTE_PRINTF_3;
extern void sorry PVPROTO ((char *s, ...))
ATTRIBUTE_PRINTF_1;
+extern void really_sorry PVPROTO((char *s, ...))
+ ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void default_print_error_function PROTO ((char *));
extern void report_error_function PROTO ((char *));
@@ -40,4 +53,23 @@ extern void warning_with_decl PVPROTO ((union tree_node *, char *, ...));
extern void error_with_decl PVPROTO ((union tree_node *, char *, ...));
extern void announce_function PROTO ((union tree_node *));
+extern void error_for_asm PVPROTO((struct rtx_def *, char *, ...))
+ ATTRIBUTE_PRINTF_2;
+extern void warning_for_asm PVPROTO((struct rtx_def *, char *, ...))
+ ATTRIBUTE_PRINTF_2;
+#ifdef _JBLEN
+extern void set_float_handler PROTO((jmp_buf));
+extern int push_float_handler PROTO((jmp_buf, jmp_buf));
+extern void pop_float_handler PROTO((int, jmp_buf));
+#endif
+
+#ifdef BUFSIZ
+extern void output_quoted_string PROTO ((FILE *, char *));
+extern void output_file_directive PROTO ((FILE *, char *));
+#endif
+
+extern void fancy_abort PROTO ((void)) ATTRIBUTE_NORETURN;
+extern void do_abort PROTO ((void)) ATTRIBUTE_NORETURN;
+extern void botch PROTO ((char *)) ATTRIBUTE_NORETURN;
+
#endif /* __GCC_TOPLEV_H */
diff --git a/gcc/tree.c b/gcc/tree.c
index 10e4e8bd456..a9464c056ba 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -34,11 +34,6 @@ Boston, MA 02111-1307, USA. */
by all passes of the compiler. */
#include "config.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "system.h"
#include <setjmp.h>
#include "flags.h"
@@ -51,6 +46,8 @@ Boston, MA 02111-1307, USA. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
+/* obstack.[ch] explicitly declined to prototype this. */
+extern int _obstack_allocated_p PROTO ((struct obstack *h, GENERIC_PTR obj));
/* Tree nodes of permanent duration are allocated in this obstack.
They are the identifier nodes, and everything outside of
@@ -260,6 +257,10 @@ static int next_decl_uid;
/* Unique id for next type created. */
static int next_type_uid = 1;
+/* The language-specific function for alias analysis. If NULL, the
+ language does not do any special alias analysis. */
+int (*lang_get_alias_set) PROTO((tree));
+
/* Here is how primitive or already-canonicalized types' hash
codes are made. */
#define TYPE_HASH(TYPE) ((unsigned long) (TYPE) & 0777777)
@@ -912,7 +913,7 @@ make_node (code)
{
register tree t;
register int type = TREE_CODE_CLASS (code);
- register int length;
+ register int length = 0;
register struct obstack *obstack = current_obstack;
register int i;
#ifdef GATHER_STATISTICS
@@ -1081,6 +1082,9 @@ make_node (code)
#ifdef SET_DEFAULT_TYPE_ATTRIBUTES
SET_DEFAULT_TYPE_ATTRIBUTES (t);
#endif
+ /* Note that we have not yet computed the alias set for this
+ type. */
+ TYPE_ALIAS_SET (t) = -1;
break;
case 'c':
@@ -2127,16 +2131,17 @@ size_in_bytes (type)
if (type == error_mark_node)
return integer_zero_node;
+
type = TYPE_MAIN_VARIANT (type);
- if (TYPE_SIZE (type) == 0)
+ t = TYPE_SIZE_UNIT (type);
+ if (t == 0)
{
incomplete_type_error (NULL_TREE, type);
return integer_zero_node;
}
- t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type),
- size_int (BITS_PER_UNIT));
if (TREE_CODE (t) == INTEGER_CST)
force_fit_type (t, 0);
+
return t;
}
@@ -2153,16 +2158,10 @@ int_size_in_bytes (type)
return 0;
type = TYPE_MAIN_VARIANT (type);
- if (TYPE_SIZE (type) == 0
- || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
- return -1;
-
- if (TREE_INT_CST_HIGH (TYPE_SIZE (type)) == 0)
- return ((TREE_INT_CST_LOW (TYPE_SIZE (type)) + BITS_PER_UNIT - 1)
- / BITS_PER_UNIT);
-
- t = size_binop (CEIL_DIV_EXPR, TYPE_SIZE (type), size_int (BITS_PER_UNIT));
- if (TREE_CODE (t) != INTEGER_CST || TREE_INT_CST_HIGH (t) != 0)
+ t = TYPE_SIZE_UNIT (type);
+ if (t == 0
+ || TREE_CODE (t) != INTEGER_CST
+ || TREE_INT_CST_HIGH (t) != 0)
return -1;
return TREE_INT_CST_LOW (t);
@@ -2226,9 +2225,12 @@ staticp (arg)
case FUNCTION_DECL:
/* Nested functions aren't static, since taking their address
involves a trampoline. */
- return decl_function_context (arg) == 0 || DECL_NO_STATIC_CHAIN (arg);
+ return (decl_function_context (arg) == 0 || DECL_NO_STATIC_CHAIN (arg))
+ && ! DECL_NON_ADDR_CONST_P (arg);
+
case VAR_DECL:
- return TREE_STATIC (arg) || DECL_EXTERNAL (arg);
+ return (TREE_STATIC (arg) || DECL_EXTERNAL (arg))
+ && ! DECL_NON_ADDR_CONST_P (arg);
case CONSTRUCTOR:
return TREE_STATIC (arg);
@@ -3331,7 +3333,10 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
#endif
#ifdef VALID_MACHINE_TYPE_ATTRIBUTE
- if (VALID_MACHINE_TYPE_ATTRIBUTE (type, type_attr_list, attr_name, attr_args))
+ if (valid)
+ /* Don't apply the attribute to both the decl and the type. */;
+ else if (VALID_MACHINE_TYPE_ATTRIBUTE (type, type_attr_list, attr_name,
+ attr_args))
{
tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
type_attr_list);
@@ -3346,8 +3351,14 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
}
else
{
+ /* If this is part of a declaration, create a type variant,
+ otherwise, this is part of a type definition, so add it
+ to the base type. */
type_attr_list = tree_cons (attr_name, attr_args, type_attr_list);
- type = build_type_attribute_variant (type, type_attr_list);
+ if (decl != 0)
+ type = build_type_attribute_variant (type, type_attr_list);
+ else
+ TYPE_ATTRIBUTES (type) = type_attr_list;
}
if (decl != 0)
TREE_TYPE (decl) = type;
@@ -3909,10 +3920,13 @@ simple_cst_equal (t1, t2)
code2 = TREE_CODE (t2);
if (code1 == NOP_EXPR || code1 == CONVERT_EXPR || code1 == NON_LVALUE_EXPR)
- if (code2 == NOP_EXPR || code2 == CONVERT_EXPR || code2 == NON_LVALUE_EXPR)
- return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- else
- return simple_cst_equal (TREE_OPERAND (t1, 0), t2);
+ {
+ if (code2 == NOP_EXPR || code2 == CONVERT_EXPR
+ || code2 == NON_LVALUE_EXPR)
+ return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
+ else
+ return simple_cst_equal (TREE_OPERAND (t1, 0), t2);
+ }
else if (code2 == NOP_EXPR || code2 == CONVERT_EXPR
|| code2 == NON_LVALUE_EXPR)
return simple_cst_equal (t1, TREE_OPERAND (t2, 0));
@@ -3935,7 +3949,10 @@ simple_cst_equal (t1, t2)
TREE_STRING_LENGTH (t1));
case CONSTRUCTOR:
- abort ();
+ if (CONSTRUCTOR_ELTS (t1) == CONSTRUCTOR_ELTS (t2))
+ return 1;
+ else
+ abort ();
case SAVE_EXPR:
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
@@ -4077,6 +4094,7 @@ build_index_type (maxval)
TYPE_MODE (itype) = TYPE_MODE (sizetype);
TYPE_SIZE (itype) = TYPE_SIZE (sizetype);
+ TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (sizetype);
TYPE_ALIGN (itype) = TYPE_ALIGN (sizetype);
if (TREE_CODE (maxval) == INTEGER_CST)
{
@@ -4117,6 +4135,7 @@ build_range_type (type, lowval, highval)
TYPE_PRECISION (itype) = TYPE_PRECISION (type);
TYPE_MODE (itype) = TYPE_MODE (type);
TYPE_SIZE (itype) = TYPE_SIZE (type);
+ TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (type);
TYPE_ALIGN (itype) = TYPE_ALIGN (type);
if (TREE_CODE (lowval) == INTEGER_CST)
{
@@ -4213,6 +4232,21 @@ build_array_type (elt_type, index_type)
return t;
}
+/* Return the TYPE of the elements comprising
+ the innermost dimension of ARRAY. */
+
+tree
+get_inner_array_type (array)
+ tree array;
+{
+ tree type = TREE_TYPE (array);
+
+ while (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+
+ return type;
+}
+
/* Construct, lay out and return
the type of functions returning type VALUE_TYPE
given arguments of types ARG_TYPES.
@@ -4737,41 +4771,45 @@ dump_tree_statistics ()
#define FILE_FUNCTION_PREFIX_LEN 9
#ifndef NO_DOLLAR_IN_LABEL
-#define FILE_FUNCTION_FORMAT "_GLOBAL_$D$%s"
+#define FILE_FUNCTION_FORMAT "_GLOBAL_$%s$%s"
#else /* NO_DOLLAR_IN_LABEL */
#ifndef NO_DOT_IN_LABEL
-#define FILE_FUNCTION_FORMAT "_GLOBAL_.D.%s"
+#define FILE_FUNCTION_FORMAT "_GLOBAL_.%s.%s"
#else /* NO_DOT_IN_LABEL */
-#define FILE_FUNCTION_FORMAT "_GLOBAL__D_%s"
+#define FILE_FUNCTION_FORMAT "_GLOBAL__%s_%s"
#endif /* NO_DOT_IN_LABEL */
#endif /* NO_DOLLAR_IN_LABEL */
extern char * first_global_object_name;
+extern char * weak_global_object_name;
-/* If KIND=='I', return a suitable global initializer (constructor) name.
- If KIND=='D', return a suitable global clean-up (destructor) name. */
+/* TYPE is some string to identify this function to the linker or
+ collect2. */
tree
-get_file_function_name (kind)
- int kind;
+get_file_function_name_long (type)
+ char *type;
{
char *buf;
register char *p;
if (first_global_object_name)
p = first_global_object_name;
+ else if (weak_global_object_name)
+ p = weak_global_object_name;
else if (main_input_filename)
p = main_input_filename;
else
p = input_filename;
- buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p));
+ buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p)
+ + strlen (type));
/* Set up the name of the file-level functions we may need. */
/* Use a global object (which is already required to be unique over
the program) rather than the file name (which imposes extra
constraints). -- Raeburn@MIT.EDU, 10 Jan 1990. */
- sprintf (buf, FILE_FUNCTION_FORMAT, p);
+ sprintf (buf, FILE_FUNCTION_FORMAT, type, p);
/* Don't need to pull weird characters out of global names. */
if (p != first_global_object_name)
@@ -4794,10 +4832,23 @@ get_file_function_name (kind)
*p = '_';
}
- buf[FILE_FUNCTION_PREFIX_LEN] = kind;
-
return get_identifier (buf);
}
+
+/* If KIND=='I', return a suitable global initializer (constructor) name.
+ If KIND=='D', return a suitable global clean-up (destructor) name. */
+
+tree
+get_file_function_name (kind)
+ int kind;
+{
+ char p[2];
+ p[0] = kind;
+ p[1] = 0;
+
+ return get_file_function_name_long (p);
+}
+
/* Expand (the constant part of) a SET_TYPE CONSTRUCTOR node.
The result is placed in BUFFER (which has length BIT_SIZE),
@@ -4940,4 +4991,105 @@ init_obstacks ()
ggc_add_root (type_hash_table, TYPE_HASH_SIZE, sizeof(*type_hash_table),
mark_type_hash);
}
+
+#ifdef ENABLE_CHECKING
+
+/* Complain if the tree code does not match the expected one.
+ NODE is the tree node in question, CODE is the expected tree code,
+ and FILE and LINE are the filename and line number, respectively,
+ of the line on which the check was done. If NONFATAL is nonzero,
+ don't abort if the reference is invalid; instead, return 0.
+ If the reference is valid, return NODE. */
+tree
+tree_check (node, code, file, line, nofatal)
+ tree node;
+ enum tree_code code;
+ char *file;
+ int line;
+ int nofatal;
+{
+ if (TREE_CODE (node) == code)
+ return node;
+ else if (nofatal)
+ return 0;
+ else
+ fatal ("%s:%d: Expect %s, have %s\n", file, line,
+ tree_code_name[code], tree_code_name[TREE_CODE (node)]);
+}
+
+/* Similar to above, except that we check for a class of tree
+ code, given in CL. */
+
+tree
+tree_class_check (node, cl, file, line, nofatal)
+ tree node;
+ char cl;
+ char *file;
+ int line;
+ int nofatal;
+{
+ if (TREE_CODE_CLASS (TREE_CODE (node)) == cl)
+ return node;
+ else if (nofatal)
+ return 0;
+ else
+ fatal ("%s:%d: Expect '%c', have '%s'\n", file, line,
+ cl, tree_code_name[TREE_CODE (node)]);
+}
+
+/* Likewise, but complain if the tree node is not an expression. */
+
+tree
+expr_check (node, ignored, file, line, nofatal)
+ tree node;
+ int ignored;
+ char *file;
+ int line;
+ int nofatal;
+{
+ switch (TREE_CODE_CLASS (TREE_CODE (node)))
+ {
+ case 'r':
+ case 's':
+ case 'e':
+ case '<':
+ case '1':
+ case '2':
+ break;
+
+ default:
+ if (nofatal)
+ return 0;
+ else
+ fatal ("%s:%d: Expect expression, have '%s'\n", file, line,
+ tree_code_name[TREE_CODE (node)]);
+ }
+
+ return node;
+}
+#endif
+
+/* Return the alias set for T, which may be either a type or an
+ expression. */
+
+int
+get_alias_set (t)
+ tree t;
+{
+ if (!flag_strict_aliasing || !lang_get_alias_set)
+ /* If we're not doing any lanaguage-specific alias analysis, just
+ assume everything aliases everything else. */
+ return 0;
+ else
+ return (*lang_get_alias_set) (t);
+}
+
+/* Return a brand-new alias set. */
+
+int
+new_alias_set ()
+{
+ static int last_alias_set;
+ return ++last_alias_set;
+}
diff --git a/gcc/tree.def b/gcc/tree.def
index 632358b8aea..71d0687043c 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -306,11 +306,10 @@ DEFTREECODE (STRING_CST, "string_cst", 'c', 3)
DECL_RESULT holds a RESULT_DECL node for the value of a function,
or it is 0 for a function that returns no value.
(C functions returning void have zero here.)
- DECL_RESULT_TYPE holds the type in which the result is actually
- returned. This is usually the same as the type of DECL_RESULT,
- but (1) it may be a wider integer type and
- (2) it remains valid, for the sake of inlining, even after the
- function's compilation is done.
+ The TREE_TYPE field is the type in which the result is actually
+ returned. This is usually the same as the return type of the
+ FUNCTION_DECL, but it may be a wider integer type because of
+ promotion.
DECL_FUNCTION_CODE is a code number that is nonzero for
built-in functions. Its value is an enum built_in_function
that says which built-in function it is.
@@ -359,8 +358,7 @@ DEFTREECODE (INDIRECT_REF, "indirect_ref", 'r', 1)
DEFTREECODE (BUFFER_REF, "buffer_ref", 'r', 1)
/* Array indexing in languages other than C.
- Operand 0 is the array; operand 1 is a list of indices
- stored as a chain of TREE_LIST nodes. */
+ Operand 0 is the array; operand 1 is a (single) array index. */
DEFTREECODE (ARRAY_REF, "array_ref", 'r', 2)
/* Constructor: return an aggregate value made from specified components.
@@ -723,7 +721,7 @@ DEFTREECODE (POPDCC_EXPR, "popdcc_expr", 's', 0)
The type should be void and the value should be ignored. */
DEFTREECODE (LABEL_EXPR, "label_expr", 's', 1)
-/* GOTO. Operand 0 is a LABEL_DECL node.
+/* GOTO. Operand 0 is a LABEL_DECL node or an expression.
The type should be void and the value should be ignored. */
DEFTREECODE (GOTO_EXPR, "goto_expr", 's', 1)
@@ -743,11 +741,28 @@ DEFTREECODE (EXIT_EXPR, "exit_expr", 's', 1)
The type should be void and the value should be ignored. */
DEFTREECODE (LOOP_EXPR, "loop_expr", 's', 1)
-/* Used to represent a tree node, such as IDENTIFIER_NODE or an EXPR
- node, adding several location information: a file name, a line
- number and column number. It is expanded as the node it refers to
- and can be considered a no-op "conversion" with an annotation. */
-DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", '1', 2)
+/* A labeled block. Operand 0 is the label that will be generated to
+ mark the end of the block.
+ Operand 1 is the labeled block body. */
+DEFTREECODE (LABELED_BLOCK_EXPR, "labeled_block_expr", 'e', 2)
+
+/* Exit a labeled block, possibly returning a value. Operand 0 is a
+ LABELED_BLOCK_EXPR to exit. Operand 1 is the value to return. It
+ may be left null. */
+DEFTREECODE (EXIT_BLOCK_EXPR, "exit_block_expr", 'e', 2)
+
+/* Annotates a tree node (usually an expression) with source location
+ information: a file name (EXPR_WFL_FILENAME); a line number
+ (EXPR_WFL_LINENO); and column number (EXPR_WFL_COLNO). It is
+ expanded as the contained node (EXPR_WFL_NODE); a line note should
+ be emitted first if EXPR_WFL_EMIT_LINE_NOTE. */
+DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 2)
+
+/* Switch expression.
+ Operand 0 is the expression used to perform the branch,
+ Operand 1 contains the case values. The way they're organized is
+ front-end implementation defined. */
+DEFTREECODE (SWITCH_EXPR, "switch_expr", 'e', 2)
/*
Local variables:
mode:c
diff --git a/gcc/tree.h b/gcc/tree.h
index a1a5f58a7dd..9b0d57fafc5 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -101,23 +101,21 @@ enum built_in_function
BUILT_IN_FRAME_ADDRESS,
BUILT_IN_RETURN_ADDRESS,
BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
- BUILT_IN_CALLER_RETURN_ADDRESS,
BUILT_IN_APPLY_ARGS,
BUILT_IN_APPLY,
BUILT_IN_RETURN,
BUILT_IN_SETJMP,
BUILT_IN_LONGJMP,
+ BUILT_IN_TRAP,
/* Various hooks for the DWARF 2 __throw routine. */
- BUILT_IN_FP, BUILT_IN_SP,
BUILT_IN_UNWIND_INIT,
+ BUILT_IN_DWARF_CFA,
BUILT_IN_DWARF_FP_REGNUM,
BUILT_IN_DWARF_REG_SIZE,
BUILT_IN_FROB_RETURN_ADDR,
BUILT_IN_EXTRACT_RETURN_ADDR,
- BUILT_IN_SET_RETURN_ADDR_REG,
- BUILT_IN_EH_STUB,
- BUILT_IN_SET_EH_REGS,
+ BUILT_IN_EH_RETURN,
/* C++ extensions */
BUILT_IN_NEW,
@@ -152,7 +150,11 @@ typedef union tree_node *tree;
/* Every kind of tree node starts with this structure,
so all nodes have these fields.
- See the accessor macros, defined below, for documentation of the fields. */
+ See the accessor macros, defined below, for documentation of the fields.
+
+ DO NOT change the layout of tree_common unless absolutely necessary. Some
+ front-ends (namely g++) depend on the internal layout of this tructure.
+ See my_tree_cons in the cp subdir for such uglyness. Ugh. */
struct tree_common
{
@@ -224,6 +226,8 @@ struct tree_common
VAR_DECL or FUNCTION_DECL
TREE_VIA_PUBLIC in
TREE_LIST or TREE_VEC
+ EXPR_WFL_EMIT_LINE_NOTE in
+ EXPR_WITH_FILE_LOCATION
private_flag:
@@ -304,6 +308,40 @@ struct tree_common
#define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (int) (VALUE))
+/* When checking is enabled, errors will be generated if a tree node
+ is accessed incorrectly. The macros abort with a fatal error,
+ except for the *1 variants, which just return 0 on failure. The
+ latter variants should only be used for combination checks, which
+ succeed when one of the checks succeed. The CHAIN_CHECK macro helps
+ defining such checks. */
+
+#ifdef ENABLE_CHECKING
+#define DO_CHECK(FUNC, t, param) FUNC (t, param, __FILE__, __LINE__, 0)
+#define DO_CHECK1(FUNC, t, param) FUNC (t, param, __FILE__, __LINE__, 1)
+#define CHAIN_CHECK(t, c1, c2) (c1 (t) ? t : c2 (t))
+#else
+#define DO_CHECK(FUNC, t, param) (t)
+#define DO_CHECK1(FUNC, t, param) (t)
+#define CHAIN_CHECK(t, c1, c2) (t)
+#endif
+
+#define TREE_CHECK(t, code) DO_CHECK (tree_check, t, code)
+#define TREE_CHECK1(t, code) DO_CHECK1 (tree_check, t, code)
+
+#include "tree-check.h"
+
+#define TYPE_CHECK(t) DO_CHECK (tree_class_check, t, 't')
+#define TYPE_CHECK1(t) DO_CHECK1 (tree_class_check, t, 't')
+#define DECL_CHECK(t) DO_CHECK (tree_class_check, t, 'd')
+#define DECL_CHECK1(t) DO_CHECK1 (tree_class_check, t, 'd')
+#define CST_CHECK(t) DO_CHECK (tree_class_check, t, 'c')
+#define CST_CHECK1(t) DO_CHECK1 (tree_class_check, t, 'c')
+#define EXPR_CHECK(t) DO_CHECK (expr_check, t, 0)
+
+/* Chained checks. The last check has to succeed, the others may fail. */
+#define CST_OR_CONSTRUCTOR_CHECK(t) \
+ CHAIN_CHECK (t, CST_CHECK1, CONSTRUCTOR_CHECK)
+
/* In all nodes that are expressions, this is the data type of the expression.
In POINTER_TYPE nodes, this is the type that the pointer points to.
In ARRAY_TYPE nodes, this is the type of the elements. */
@@ -367,6 +405,10 @@ struct tree_common
#define POINTER_TYPE_P(TYPE) \
(TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
+
+/* Nonzero if TYPE represents a type. */
+
+#define TYPE_P(TYPE) (TREE_CODE_CLASS (TREE_CODE (TYPE)) == 't')
/* Define many boolean fields that all tree nodes have. */
@@ -514,8 +556,8 @@ struct tree_common
If the data type is signed, the value is sign-extended to 2 words
even though not all of them may really be in use.
In an unsigned constant shorter than 2 words, the extra bits are 0. */
-#define TREE_INT_CST_LOW(NODE) ((NODE)->int_cst.int_cst_low)
-#define TREE_INT_CST_HIGH(NODE) ((NODE)->int_cst.int_cst_high)
+#define TREE_INT_CST_LOW(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst_low)
+#define TREE_INT_CST_HIGH(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst_high)
#define INT_CST_LT(A, B) \
(TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \
@@ -544,14 +586,14 @@ struct tree_int_cst
and generally in all kinds of constants that could
be given labels (rather than being immediate). */
-#define TREE_CST_RTL(NODE) ((NODE)->real_cst.rtl)
+#define TREE_CST_RTL(NODE) (CST_OR_CONSTRUCTOR_CHECK (NODE)->real_cst.rtl)
/* In a REAL_CST node. */
/* We can represent a real value as either a `double' or a string.
Strings don't allow for any optimization, but they do allow
for cross-compilation. */
-#define TREE_REAL_CST(NODE) ((NODE)->real_cst.real_cst)
+#define TREE_REAL_CST(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst)
#include "real.h"
@@ -564,8 +606,8 @@ struct tree_real_cst
};
/* In a STRING_CST */
-#define TREE_STRING_LENGTH(NODE) ((NODE)->string.length)
-#define TREE_STRING_POINTER(NODE) ((NODE)->string.pointer)
+#define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
+#define TREE_STRING_POINTER(NODE) (STRING_CST_CHECK (NODE)->string.pointer)
struct tree_string
{
@@ -577,8 +619,8 @@ struct tree_string
};
/* In a COMPLEX_CST node. */
-#define TREE_REALPART(NODE) ((NODE)->complex.real)
-#define TREE_IMAGPART(NODE) ((NODE)->complex.imag)
+#define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
+#define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
struct tree_complex
{
@@ -591,8 +633,8 @@ struct tree_complex
/* Define fields and accessors for some special-purpose tree nodes. */
-#define IDENTIFIER_LENGTH(NODE) ((NODE)->identifier.length)
-#define IDENTIFIER_POINTER(NODE) ((NODE)->identifier.pointer)
+#define IDENTIFIER_LENGTH(NODE) (IDENTIFIER_NODE_CHECK (NODE)->identifier.length)
+#define IDENTIFIER_POINTER(NODE) (IDENTIFIER_NODE_CHECK (NODE)->identifier.pointer)
struct tree_identifier
{
@@ -602,8 +644,8 @@ struct tree_identifier
};
/* In a TREE_LIST node. */
-#define TREE_PURPOSE(NODE) ((NODE)->list.purpose)
-#define TREE_VALUE(NODE) ((NODE)->list.value)
+#define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
+#define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
struct tree_list
{
@@ -613,9 +655,9 @@ struct tree_list
};
/* In a TREE_VEC node. */
-#define TREE_VEC_LENGTH(NODE) ((NODE)->vec.length)
-#define TREE_VEC_ELT(NODE,I) ((NODE)->vec.a[I])
-#define TREE_VEC_END(NODE) (&((NODE)->vec.a[(NODE)->vec.length]))
+#define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
+#define TREE_VEC_ELT(NODE,I) (TREE_VEC_CHECK (NODE)->vec.a[I])
+#define TREE_VEC_END(NODE) ((void) TREE_VEC_CHECK (NODE),&((NODE)->vec.a[(NODE)->vec.length]))
struct tree_vec
{
@@ -628,33 +670,44 @@ struct tree_vec
/* In a SAVE_EXPR node. */
#define SAVE_EXPR_CONTEXT(NODE) TREE_OPERAND(NODE, 1)
-#define SAVE_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[2])
+#define SAVE_EXPR_RTL(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[2])
#define SAVE_EXPR_NOPLACEHOLDER(NODE) TREE_UNSIGNED (NODE)
/* In a RTL_EXPR node. */
-#define RTL_EXPR_SEQUENCE(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[0])
-#define RTL_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[1])
+#define RTL_EXPR_SEQUENCE(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[0])
+#define RTL_EXPR_RTL(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[1])
/* In a CALL_EXPR node. */
-#define CALL_EXPR_RTL(NODE) (*(struct rtx_def **) &(NODE)->exp.operands[2])
+#define CALL_EXPR_RTL(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[2])
/* In a CONSTRUCTOR node. */
#define CONSTRUCTOR_ELTS(NODE) TREE_OPERAND (NODE, 1)
/* In ordinary expression nodes. */
-#define TREE_OPERAND(NODE, I) ((NODE)->exp.operands[I])
-#define TREE_COMPLEXITY(NODE) ((NODE)->exp.complexity)
+#define TREE_OPERAND(NODE, I) (EXPR_CHECK (NODE)->exp.operands[I])
+#define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
+
+/* In a LABELED_BLOCK_EXPR node. */
+#define LABELED_BLOCK_LABEL(NODE) TREE_OPERAND (NODE, 0)
+#define LABELED_BLOCK_BODY(NODE) TREE_OPERAND (NODE, 1)
-/* In expression with file location information. */
+/* In a EXIT_BLOCK_EXPR node. */
+#define EXIT_BLOCK_LABELED_BLOCK(NODE) TREE_OPERAND (NODE, 0)
+#define EXIT_BLOCK_RETURN(NODE) TREE_OPERAND (NODE, 1)
+
+/* In a LOOP_EXPR node. */
+#define LOOP_EXPR_BODY(NODE) TREE_OPERAND (NODE, 0)
+
+/* In a EXPR_WITH_FILE_LOCATION node. */
#define EXPR_WFL_NODE(NODE) TREE_OPERAND((NODE), 0)
#define EXPR_WFL_FILENAME(NODE) (IDENTIFIER_POINTER ((NODE)->common.chain))
#define EXPR_WFL_FILENAME_NODE(NODE) ((NODE)->common.chain)
-#define EXPR_WFL_LINENO(NODE) ((NODE)->exp.complexity >> 12)
-#define EXPR_WFL_COLNO(NODE) ((NODE)->exp.complexity & 0xfff)
-#define EXPR_WFL_LINECOL(NODE) ((NODE)->exp.complexity)
+#define EXPR_WFL_LINENO(NODE) (EXPR_CHECK (NODE)->exp.complexity >> 12)
+#define EXPR_WFL_COLNO(NODE) (EXPR_CHECK (NODE)->exp.complexity & 0xfff)
+#define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity)
#define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \
(EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff))
-#define EXPR_WFL_EMIT_LINE_NOTE(NODE) ((NODE)->common.lang_flag_0)
+#define EXPR_WFL_EMIT_LINE_NOTE(NODE) ((NODE)->common.public_flag)
struct tree_exp
{
@@ -664,20 +717,32 @@ struct tree_exp
};
/* In a BLOCK node. */
-#define BLOCK_VARS(NODE) ((NODE)->block.vars)
-#define BLOCK_TYPE_TAGS(NODE) ((NODE)->block.type_tags)
-#define BLOCK_SUBBLOCKS(NODE) ((NODE)->block.subblocks)
-#define BLOCK_SUPERCONTEXT(NODE) ((NODE)->block.supercontext)
+#define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
+#define BLOCK_TYPE_TAGS(NODE) (BLOCK_CHECK (NODE)->block.type_tags)
+#define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
+#define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
/* Note: when changing this, make sure to find the places
that use chainon or nreverse. */
#define BLOCK_CHAIN(NODE) TREE_CHAIN (NODE)
-#define BLOCK_ABSTRACT_ORIGIN(NODE) ((NODE)->block.abstract_origin)
-#define BLOCK_ABSTRACT(NODE) ((NODE)->block.abstract_flag)
-#define BLOCK_END_NOTE(NODE) ((NODE)->block.end_note)
+#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
+#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
+#define BLOCK_END_NOTE(NODE) (BLOCK_CHECK (NODE)->block.end_note)
+/* Nonzero means that this block has separate live range regions */
+#define BLOCK_LIVE_RANGE_FLAG(NOTE) (BLOCK_CHECK (NOTE)->block.live_range_flag)
+
+/* Nonzero means that this block has a variable declared in it
+ that is split into separate live ranges. */
+#define BLOCK_LIVE_RANGE_VAR_FLAG(NOTE) (BLOCK_CHECK (NOTE)->block.live_range_var_flag)
+
+/* Index for marking the start of the block for live ranges. */
+#define BLOCK_LIVE_RANGE_START(NOTE) (BLOCK_CHECK (NOTE)->block.live_range_start)
+
+/* Index for marking the end of the block for live ranges. */
+#define BLOCK_LIVE_RANGE_END(NOTE) (BLOCK_CHECK (NOTE)->block.live_range_end)
/* Nonzero means that this block is prepared to handle exceptions
listed in the BLOCK_VARS slot. */
-#define BLOCK_HANDLER_BLOCK(NODE) ((NODE)->block.handler_block_flag)
+#define BLOCK_HANDLER_BLOCK(NODE) (BLOCK_CHECK (NODE)->block.handler_block_flag)
struct tree_block
{
@@ -685,6 +750,8 @@ struct tree_block
unsigned handler_block_flag : 1;
unsigned abstract_flag : 1;
+ unsigned live_range_flag : 1;
+ unsigned live_range_var_flag : 1;
union tree_node *vars;
union tree_node *type_tags;
@@ -692,6 +759,8 @@ struct tree_block
union tree_node *supercontext;
union tree_node *abstract_origin;
struct rtx_def *end_note;
+ int live_range_start;
+ int live_range_end;
};
/* Define fields and accessors for nodes representing data types. */
@@ -699,47 +768,64 @@ struct tree_block
/* See tree.def for documentation of the use of these fields.
Look at the documentation of the various ..._TYPE tree codes. */
-#define TYPE_UID(NODE) ((NODE)->type.uid)
-#define TYPE_SIZE(NODE) ((NODE)->type.size)
-#define TYPE_MODE(NODE) ((NODE)->type.mode)
-#define TYPE_VALUES(NODE) ((NODE)->type.values)
-#define TYPE_DOMAIN(NODE) ((NODE)->type.values)
-#define TYPE_FIELDS(NODE) ((NODE)->type.values)
-#define TYPE_METHODS(NODE) ((NODE)->type.maxval)
-#define TYPE_VFIELD(NODE) ((NODE)->type.minval)
-#define TYPE_ARG_TYPES(NODE) ((NODE)->type.values)
-#define TYPE_METHOD_BASETYPE(NODE) ((NODE)->type.maxval)
-#define TYPE_OFFSET_BASETYPE(NODE) ((NODE)->type.maxval)
-#define TYPE_POINTER_TO(NODE) ((NODE)->type.pointer_to)
-#define TYPE_REFERENCE_TO(NODE) ((NODE)->type.reference_to)
-#define TYPE_MIN_VALUE(NODE) ((NODE)->type.minval)
-#define TYPE_MAX_VALUE(NODE) ((NODE)->type.maxval)
-#define TYPE_PRECISION(NODE) ((NODE)->type.precision)
-#define TYPE_SYMTAB_ADDRESS(NODE) ((NODE)->type.symtab.address)
-#define TYPE_SYMTAB_POINTER(NODE) ((NODE)->type.symtab.pointer)
-#define TYPE_NAME(NODE) ((NODE)->type.name)
-#define TYPE_NEXT_VARIANT(NODE) ((NODE)->type.next_variant)
-#define TYPE_MAIN_VARIANT(NODE) ((NODE)->type.main_variant)
-#define TYPE_BINFO(NODE) ((NODE)->type.binfo)
-#define TYPE_NONCOPIED_PARTS(NODE) ((NODE)->type.noncopied_parts)
-#define TYPE_CONTEXT(NODE) ((NODE)->type.context)
-#define TYPE_OBSTACK(NODE) ((NODE)->type.obstack)
-#define TYPE_LANG_SPECIFIC(NODE) ((NODE)->type.lang_specific)
+#define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
+#define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size)
+#define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
+#define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
+#define TYPE_VALUES(NODE) (TYPE_CHECK (NODE)->type.values)
+#define TYPE_DOMAIN(NODE) (TYPE_CHECK (NODE)->type.values)
+#define TYPE_FIELDS(NODE) (TYPE_CHECK (NODE)->type.values)
+#define TYPE_METHODS(NODE) (TYPE_CHECK (NODE)->type.maxval)
+#define TYPE_VFIELD(NODE) (TYPE_CHECK (NODE)->type.minval)
+#define TYPE_ARG_TYPES(NODE) (TYPE_CHECK (NODE)->type.values)
+#define TYPE_METHOD_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval)
+#define TYPE_OFFSET_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval)
+#define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
+#define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
+#define TYPE_MIN_VALUE(NODE) (TYPE_CHECK (NODE)->type.minval)
+#define TYPE_MAX_VALUE(NODE) (TYPE_CHECK (NODE)->type.maxval)
+#define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
+#define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
+#define TYPE_SYMTAB_POINTER(NODE) (TYPE_CHECK (NODE)->type.symtab.pointer)
+#define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name)
+#define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant)
+#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
+#define TYPE_NONCOPIED_PARTS(NODE) (TYPE_CHECK (NODE)->type.noncopied_parts)
+#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
+#define TYPE_OBSTACK(NODE) (TYPE_CHECK (NODE)->type.obstack)
+#define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
+
+/* For aggregate types, information about this type, as a base type
+ for itself. Used in a language-dependent way for types that are
+ neither a RECORD_TYPE, QUAL_UNION_TYPE, nor a UNION_TYPE. */
+#define TYPE_BINFO(NODE) (TYPE_CHECK (NODE)->type.binfo)
+
+/* The (language-specific) typed-based alias set for this type.
+ Objects whose TYPE_ALIAS_SETs are different cannot alias each
+ other. If the TYPE_ALIAS_SET is -1, no alias set has yet been
+ assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this
+ type can alias objects of any type. */
+#define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type.alias_set)
+
+/* Nonzero iff the typed-based alias set for this type has been
+ calculated. */
+#define TYPE_ALIAS_SET_KNOWN_P(NODE) \
+ (TYPE_CHECK (NODE)->type.alias_set != -1)
/* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
to this type. */
-#define TYPE_ATTRIBUTES(NODE) ((NODE)->type.attributes)
+#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type.attributes)
/* The alignment necessary for objects of this type.
The value is an int, measured in bits. */
-#define TYPE_ALIGN(NODE) ((NODE)->type.align)
+#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type.align)
#define TYPE_STUB_DECL(NODE) (TREE_CHAIN (NODE))
/* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type
has BLKmode only because it lacks the alignment requirement for
its size. */
-#define TYPE_NO_FORCE_BLK(NODE) ((NODE)->type.no_force_blk_flag)
+#define TYPE_NO_FORCE_BLK(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag)
/* Nonzero in a type considered volatile as a whole. */
#define TYPE_VOLATILE(NODE) ((NODE)->common.volatile_flag)
@@ -748,18 +834,18 @@ struct tree_block
#define TYPE_READONLY(NODE) ((NODE)->common.readonly_flag)
/* These flags are available for each language front end to use internally. */
-#define TYPE_LANG_FLAG_0(NODE) ((NODE)->type.lang_flag_0)
-#define TYPE_LANG_FLAG_1(NODE) ((NODE)->type.lang_flag_1)
-#define TYPE_LANG_FLAG_2(NODE) ((NODE)->type.lang_flag_2)
-#define TYPE_LANG_FLAG_3(NODE) ((NODE)->type.lang_flag_3)
-#define TYPE_LANG_FLAG_4(NODE) ((NODE)->type.lang_flag_4)
-#define TYPE_LANG_FLAG_5(NODE) ((NODE)->type.lang_flag_5)
-#define TYPE_LANG_FLAG_6(NODE) ((NODE)->type.lang_flag_6)
+#define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type.lang_flag_0)
+#define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type.lang_flag_1)
+#define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type.lang_flag_2)
+#define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type.lang_flag_3)
+#define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type.lang_flag_4)
+#define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5)
+#define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type.lang_flag_6)
/* If set in an ARRAY_TYPE, indicates a string type (for languages
that distinguish string from array of char).
If set in a SET_TYPE, indicates a bitstring type. */
-#define TYPE_STRING_FLAG(NODE) ((NODE)->type.string_flag)
+#define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag)
/* If non-NULL, this is a upper bound of the size (in bytes) of an
object of the given ARRAY_TYPE. This allows temporaries to be allocated. */
@@ -767,21 +853,22 @@ struct tree_block
/* Indicates that objects of this type must be initialized by calling a
function when they are created. */
-#define TYPE_NEEDS_CONSTRUCTING(NODE) ((NODE)->type.needs_constructing_flag)
+#define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_CHECK (NODE)->type.needs_constructing_flag)
/* Indicates that objects of this type (a UNION_TYPE), should be passed
the same way that the first union alternative would be passed. */
-#define TYPE_TRANSPARENT_UNION(NODE) ((NODE)->type.transparent_union_flag)
+#define TYPE_TRANSPARENT_UNION(NODE) (TYPE_CHECK (NODE)->type.transparent_union_flag)
/* Indicated that objects of this type should be laid out in as
compact a way as possible. */
-#define TYPE_PACKED(NODE) ((NODE)->type.packed_flag)
+#define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag)
struct tree_type
{
char common[sizeof (struct tree_common)];
union tree_node *values;
union tree_node *size;
+ union tree_node *size_unit;
union tree_node *attributes;
unsigned uid;
@@ -819,6 +906,7 @@ struct tree_type
union tree_node *noncopied_parts;
union tree_node *context;
struct obstack *obstack;
+ int alias_set;
/* Points to a structure whose details depend on the language in use. */
struct lang_type *lang_specific;
};
@@ -886,7 +974,8 @@ struct tree_type
class pointer" for the given inheritance. */
#define BINFO_VPTR_FIELD(NODE) TREE_VEC_ELT ((NODE), 5)
-/* The size of a base class subobject of this type. */
+/* The size of a base class subobject of this type. Not all frontends
+ currently allocate the space for this field. */
#define BINFO_SIZE(NODE) TREE_VEC_ELT ((NODE), 6)
#define TYPE_BINFO_SIZE(NODE) BINFO_SIZE (TYPE_BINFO (NODE))
@@ -907,87 +996,90 @@ struct tree_type
/* This is the name of the object as written by the user.
It is an IDENTIFIER_NODE. */
-#define DECL_NAME(NODE) ((NODE)->decl.name)
+#define DECL_NAME(NODE) (DECL_CHECK (NODE)->decl.name)
/* This is the name of the object as the assembler will see it
(but before any translations made by ASM_OUTPUT_LABELREF).
Often this is the same as DECL_NAME.
It is an IDENTIFIER_NODE. */
-#define DECL_ASSEMBLER_NAME(NODE) ((NODE)->decl.assembler_name)
+#define DECL_ASSEMBLER_NAME(NODE) (DECL_CHECK (NODE)->decl.assembler_name)
/* Records the section name in a section attribute. Used to pass
the name from decl_attributes to make_function_rtl and make_decl_rtl. */
-#define DECL_SECTION_NAME(NODE) ((NODE)->decl.section_name)
+#define DECL_SECTION_NAME(NODE) (DECL_CHECK (NODE)->decl.section_name)
/* For FIELD_DECLs, this is the
RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is
a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
and CONST_DECL nodes, this points to either the FUNCTION_DECL for the
containing function, the RECORD_TYPE or UNION_TYPE for the containing
type, or NULL_TREE if the given decl has "file scope". */
-#define DECL_CONTEXT(NODE) ((NODE)->decl.context)
-#define DECL_FIELD_CONTEXT(NODE) ((NODE)->decl.context)
+#define DECL_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context)
+#define DECL_FIELD_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context)
/* In a DECL this is the field where configuration dependent machine
attributes are store */
-#define DECL_MACHINE_ATTRIBUTES(NODE) ((NODE)->decl.machine_attributes)
+#define DECL_MACHINE_ATTRIBUTES(NODE) (DECL_CHECK (NODE)->decl.machine_attributes)
/* In a FIELD_DECL, this is the field position, counting in bits,
of the bit closest to the beginning of the structure. */
-#define DECL_FIELD_BITPOS(NODE) ((NODE)->decl.arguments)
+#define DECL_FIELD_BITPOS(NODE) (DECL_CHECK (NODE)->decl.arguments)
/* In a FIELD_DECL, this indicates whether the field was a bit-field and
if so, the type that was originally specified for it.
TREE_TYPE may have been modified (in finish_struct). */
-#define DECL_BIT_FIELD_TYPE(NODE) ((NODE)->decl.result)
+#define DECL_BIT_FIELD_TYPE(NODE) (DECL_CHECK (NODE)->decl.result)
/* In FUNCTION_DECL, a chain of ..._DECL nodes. */
/* VAR_DECL and PARM_DECL reserve the arguments slot
for language-specific uses. */
-#define DECL_ARGUMENTS(NODE) ((NODE)->decl.arguments)
+#define DECL_ARGUMENTS(NODE) (DECL_CHECK (NODE)->decl.arguments)
/* In FUNCTION_DECL, holds the decl for the return value. */
-#define DECL_RESULT(NODE) ((NODE)->decl.result)
+#define DECL_RESULT(NODE) (DECL_CHECK (NODE)->decl.result)
/* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
-#define DECL_ORIGINAL_TYPE(NODE) ((NODE)->decl.result)
+#define DECL_ORIGINAL_TYPE(NODE) (DECL_CHECK (NODE)->decl.result)
/* In PARM_DECL, holds the type as written (perhaps a function or array). */
-#define DECL_ARG_TYPE_AS_WRITTEN(NODE) ((NODE)->decl.result)
+#define DECL_ARG_TYPE_AS_WRITTEN(NODE) (DECL_CHECK (NODE)->decl.result)
/* For a FUNCTION_DECL, holds the tree of BINDINGs.
For a VAR_DECL, holds the initial value.
For a PARM_DECL, not used--default
values for parameters are encoded in the type of the function,
not in the PARM_DECL slot. */
-#define DECL_INITIAL(NODE) ((NODE)->decl.initial)
+#define DECL_INITIAL(NODE) (DECL_CHECK (NODE)->decl.initial)
/* For a PARM_DECL, records the data type used to pass the argument,
which may be different from the type seen in the program. */
-#define DECL_ARG_TYPE(NODE) ((NODE)->decl.initial) /* In PARM_DECL. */
+#define DECL_ARG_TYPE(NODE) (DECL_CHECK (NODE)->decl.initial) /* In PARM_DECL. */
/* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
if nonzero, indicates that the field occupies the type. */
-#define DECL_QUALIFIER(NODE) ((NODE)->decl.initial)
+#define DECL_QUALIFIER(NODE) (DECL_CHECK (NODE)->decl.initial)
/* These two fields describe where in the source code the declaration was. */
-#define DECL_SOURCE_FILE(NODE) ((NODE)->decl.filename)
-#define DECL_SOURCE_LINE(NODE) ((NODE)->decl.linenum)
+#define DECL_SOURCE_FILE(NODE) (DECL_CHECK (NODE)->decl.filename)
+#define DECL_SOURCE_LINE(NODE) (DECL_CHECK (NODE)->decl.linenum)
/* Holds the size of the datum, as a tree expression.
Need not be constant. */
-#define DECL_SIZE(NODE) ((NODE)->decl.size)
+#define DECL_SIZE(NODE) (DECL_CHECK (NODE)->decl.size)
/* Holds the alignment required for the datum. */
-#define DECL_ALIGN(NODE) ((NODE)->decl.frame_size.u)
+#define DECL_ALIGN(NODE) (DECL_CHECK (NODE)->decl.frame_size.u)
/* Holds the machine mode corresponding to the declaration of a variable or
field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
FIELD_DECL. */
-#define DECL_MODE(NODE) ((NODE)->decl.mode)
+#define DECL_MODE(NODE) (DECL_CHECK (NODE)->decl.mode)
/* Holds the RTL expression for the value of a variable or function. If
PROMOTED_MODE is defined, the mode of this expression may not be same
as DECL_MODE. In that case, DECL_MODE contains the mode corresponding
to the variable's data type, while the mode
of DECL_RTL is the mode actually used to contain the data. */
-#define DECL_RTL(NODE) ((NODE)->decl.rtl)
+#define DECL_RTL(NODE) (DECL_CHECK (NODE)->decl.rtl)
+/* Holds an INSN_LIST of all of the live ranges in which the variable
+ has been moved to a possibly different register. */
+#define DECL_LIVE_RANGE_RTL(NODE) (DECL_CHECK (NODE)->decl.live_range_rtl)
/* For PARM_DECL, holds an RTL for the stack slot or register
where the data was actually passed. */
-#define DECL_INCOMING_RTL(NODE) ((NODE)->decl.saved_insns.r)
+#define DECL_INCOMING_RTL(NODE) (DECL_CHECK (NODE)->decl.saved_insns.r)
/* For FUNCTION_DECL, if it is inline, holds the saved insn chain. */
-#define DECL_SAVED_INSNS(NODE) ((NODE)->decl.saved_insns.r)
+#define DECL_SAVED_INSNS(NODE) (DECL_CHECK (NODE)->decl.saved_insns.r)
/* For FUNCTION_DECL, if it is inline,
holds the size of the stack frame, as an integer. */
-#define DECL_FRAME_SIZE(NODE) ((NODE)->decl.frame_size.i)
+#define DECL_FRAME_SIZE(NODE) (DECL_CHECK (NODE)->decl.frame_size.i)
/* For FUNCTION_DECL, if it is built-in,
this identifies which built-in operation it is. */
-#define DECL_FUNCTION_CODE(NODE) ((NODE)->decl.frame_size.f)
-#define DECL_SET_FUNCTION_CODE(NODE,VAL) ((NODE)->decl.frame_size.f = (VAL))
+#define DECL_FUNCTION_CODE(NODE) (DECL_CHECK (NODE)->decl.frame_size.f)
+#define DECL_SET_FUNCTION_CODE(NODE,VAL) (DECL_CHECK (NODE)->decl.frame_size.f = (VAL))
/* For a FIELD_DECL, holds the size of the member as an integer. */
-#define DECL_FIELD_SIZE(NODE) ((NODE)->decl.saved_insns.i)
+#define DECL_FIELD_SIZE(NODE) (DECL_CHECK (NODE)->decl.saved_insns.i)
/* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
Before the struct containing the FUNCTION_DECL is laid out,
@@ -996,21 +1088,26 @@ struct tree_type
function. When the class is laid out, this pointer is changed
to an INTEGER_CST node which is suitable for use as an index
into the virtual function table. */
-#define DECL_VINDEX(NODE) ((NODE)->decl.vindex)
+#define DECL_VINDEX(NODE) (DECL_CHECK (NODE)->decl.vindex)
/* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
which this FIELD_DECL is defined. This information is needed when
writing debugging information about vfield and vbase decls for C++. */
-#define DECL_FCONTEXT(NODE) ((NODE)->decl.vindex)
+#define DECL_FCONTEXT(NODE) (DECL_CHECK (NODE)->decl.vindex)
/* Every ..._DECL node gets a unique number. */
-#define DECL_UID(NODE) ((NODE)->decl.uid)
+#define DECL_UID(NODE) (DECL_CHECK (NODE)->decl.uid)
/* For any sort of a ..._DECL node, this points to the original (abstract)
decl node which this decl is an instance of, or else it is NULL indicating
that this decl is not an instance of some other decl. For example,
in a nested declaration of an inline function, this points back to the
definition. */
-#define DECL_ABSTRACT_ORIGIN(NODE) ((NODE)->decl.abstract_origin)
+#define DECL_ABSTRACT_ORIGIN(NODE) (DECL_CHECK (NODE)->decl.abstract_origin)
+
+/* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
+ origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */
+#define DECL_ORIGIN(NODE) \
+ (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : NODE)
/* Nonzero for any sort of ..._DECL node means this decl node represents
an inline instance of some original (abstract) decl from an inline function;
@@ -1019,7 +1116,7 @@ struct tree_type
/* Nonzero if a _DECL means that the name of this decl should be ignored
for symbolic debug purposes. */
-#define DECL_IGNORED_P(NODE) ((NODE)->decl.ignored_flag)
+#define DECL_IGNORED_P(NODE) (DECL_CHECK (NODE)->decl.ignored_flag)
/* Nonzero for a given ..._DECL node means that this node represents an
"abstract instance" of the given declaration (e.g. in the original
@@ -1027,42 +1124,47 @@ struct tree_type
information, we mustn't try to generate any address information for nodes
marked as "abstract instances" because we don't actually generate
any code or allocate any data space for such instances. */
-#define DECL_ABSTRACT(NODE) ((NODE)->decl.abstract_flag)
+#define DECL_ABSTRACT(NODE) (DECL_CHECK (NODE)->decl.abstract_flag)
/* Nonzero if a _DECL means that no warnings should be generated just
because this decl is unused. */
-#define DECL_IN_SYSTEM_HEADER(NODE) ((NODE)->decl.in_system_header_flag)
+#define DECL_IN_SYSTEM_HEADER(NODE) (DECL_CHECK (NODE)->decl.in_system_header_flag)
/* Nonzero for a given ..._DECL node means that this node should be
put in .common, if possible. If a DECL_INITIAL is given, and it
is not error_mark_node, then the decl cannot be put in .common. */
-#define DECL_COMMON(NODE) ((NODE)->decl.common_flag)
+#define DECL_COMMON(NODE) (DECL_CHECK (NODE)->decl.common_flag)
/* Language-specific decl information. */
-#define DECL_LANG_SPECIFIC(NODE) ((NODE)->decl.lang_specific)
+#define DECL_LANG_SPECIFIC(NODE) (DECL_CHECK (NODE)->decl.lang_specific)
/* In a VAR_DECL or FUNCTION_DECL,
nonzero means external reference:
do not allocate storage, and refer to a definition elsewhere. */
-#define DECL_EXTERNAL(NODE) ((NODE)->decl.external_flag)
+#define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag)
+
+/* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority
+ initializatons. */
+#define DEFAULT_INIT_PRIORITY 65535
+#define MAX_INIT_PRIORITY 65535
/* In a TYPE_DECL
nonzero means the detail info about this type is not dumped into stabs.
Instead it will generate cross reference ('x') of names.
This uses the same flag as DECL_EXTERNAL. */
-#define TYPE_DECL_SUPPRESS_DEBUG(NODE) ((NODE)->decl.external_flag)
+#define TYPE_DECL_SUPPRESS_DEBUG(NODE) (DECL_CHECK (NODE)->decl.external_flag)
/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
-#define DECL_REGISTER(NODE) ((NODE)->decl.regdecl_flag)
+#define DECL_REGISTER(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
/* In LABEL_DECL nodes, nonzero means that an error message about
jumping into such a binding contour has been printed for this label. */
-#define DECL_ERROR_ISSUED(NODE) ((NODE)->decl.regdecl_flag)
+#define DECL_ERROR_ISSUED(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
/* In a FIELD_DECL, indicates this field should be bit-packed. */
-#define DECL_PACKED(NODE) ((NODE)->decl.regdecl_flag)
+#define DECL_PACKED(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
/* In a FUNCTION_DECL with a non-zero DECL_CONTEXT, indicates that a
static chain is not needed. */
-#define DECL_NO_STATIC_CHAIN(NODE) ((NODE)->decl.regdecl_flag)
+#define DECL_NO_STATIC_CHAIN(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
/* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
@@ -1071,11 +1173,11 @@ struct tree_type
Also set in some languages for variables, etc., outside the normal
lexical scope, such as class instance variables. */
-#define DECL_NONLOCAL(NODE) ((NODE)->decl.nonlocal_flag)
+#define DECL_NONLOCAL(NODE) (DECL_CHECK (NODE)->decl.nonlocal_flag)
/* Nonzero in a FUNCTION_DECL means this function can be substituted
where it is called. */
-#define DECL_INLINE(NODE) ((NODE)->decl.inline_flag)
+#define DECL_INLINE(NODE) (DECL_CHECK (NODE)->decl.inline_flag)
/* Nonzero in a FUNCTION_DECL means this is a built-in function
that is not specified by ansi C and that users are supposed to be allowed
@@ -1084,54 +1186,62 @@ struct tree_type
/* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
specially. */
-#define DECL_BIT_FIELD(NODE) ((NODE)->decl.bit_field_flag)
+#define DECL_BIT_FIELD(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
/* In a LABEL_DECL, nonzero means label was defined inside a binding
contour that restored a stack level and which is now exited. */
-#define DECL_TOO_LATE(NODE) ((NODE)->decl.bit_field_flag)
+#define DECL_TOO_LATE(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
/* In a FUNCTION_DECL, nonzero means a built in function. */
-#define DECL_BUILT_IN(NODE) ((NODE)->decl.bit_field_flag)
+#define DECL_BUILT_IN(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
/* In a VAR_DECL that's static,
nonzero if the space is in the text section. */
-#define DECL_IN_TEXT_SECTION(NODE) ((NODE)->decl.bit_field_flag)
+#define DECL_IN_TEXT_SECTION(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
/* Used in VAR_DECLs to indicate that the variable is a vtable.
Used in FIELD_DECLs for vtable pointers.
Used in FUNCTION_DECLs to indicate that the function is virtual. */
-#define DECL_VIRTUAL_P(NODE) ((NODE)->decl.virtual_flag)
+#define DECL_VIRTUAL_P(NODE) (DECL_CHECK (NODE)->decl.virtual_flag)
/* Used to indicate that the linkage status of this DECL is not yet known,
so it should not be output now. */
-#define DECL_DEFER_OUTPUT(NODE) ((NODE)->decl.defer_output)
+#define DECL_DEFER_OUTPUT(NODE) (DECL_CHECK (NODE)->decl.defer_output)
/* Used in PARM_DECLs whose type are unions to indicate that the
argument should be passed in the same way that the first union
alternative would be passed. */
-#define DECL_TRANSPARENT_UNION(NODE) ((NODE)->decl.transparent_union)
+#define DECL_TRANSPARENT_UNION(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
/* Used in FUNCTION_DECLs to indicate that they should be run automatically
at the beginning or end of execution. */
-#define DECL_STATIC_CONSTRUCTOR(NODE) ((NODE)->decl.static_ctor_flag)
-#define DECL_STATIC_DESTRUCTOR(NODE) ((NODE)->decl.static_dtor_flag)
+#define DECL_STATIC_CONSTRUCTOR(NODE) (DECL_CHECK (NODE)->decl.static_ctor_flag)
+#define DECL_STATIC_DESTRUCTOR(NODE) (DECL_CHECK (NODE)->decl.static_dtor_flag)
/* Used to indicate that this DECL represents a compiler-generated entity. */
-#define DECL_ARTIFICIAL(NODE) ((NODE)->decl.artificial_flag)
+#define DECL_ARTIFICIAL(NODE) (DECL_CHECK (NODE)->decl.artificial_flag)
/* Used to indicate that this DECL has weak linkage. */
-#define DECL_WEAK(NODE) ((NODE)->decl.weak_flag)
+#define DECL_WEAK(NODE) (DECL_CHECK (NODE)->decl.weak_flag)
/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
multiple translation units should be merged. */
-#define DECL_ONE_ONLY(NODE) ((NODE)->decl.transparent_union)
+#define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
+
+/* Used in FUNCTION_DECLs to indicate that function entry and exit should
+ be instrumented with calls to support routines. */
+#define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) ((NODE)->decl.no_instrument_function_entry_exit)
/* Additional flags for language-specific uses. */
-#define DECL_LANG_FLAG_0(NODE) ((NODE)->decl.lang_flag_0)
-#define DECL_LANG_FLAG_1(NODE) ((NODE)->decl.lang_flag_1)
-#define DECL_LANG_FLAG_2(NODE) ((NODE)->decl.lang_flag_2)
-#define DECL_LANG_FLAG_3(NODE) ((NODE)->decl.lang_flag_3)
-#define DECL_LANG_FLAG_4(NODE) ((NODE)->decl.lang_flag_4)
-#define DECL_LANG_FLAG_5(NODE) ((NODE)->decl.lang_flag_5)
-#define DECL_LANG_FLAG_6(NODE) ((NODE)->decl.lang_flag_6)
-#define DECL_LANG_FLAG_7(NODE) ((NODE)->decl.lang_flag_7)
+#define DECL_LANG_FLAG_0(NODE) (DECL_CHECK (NODE)->decl.lang_flag_0)
+#define DECL_LANG_FLAG_1(NODE) (DECL_CHECK (NODE)->decl.lang_flag_1)
+#define DECL_LANG_FLAG_2(NODE) (DECL_CHECK (NODE)->decl.lang_flag_2)
+#define DECL_LANG_FLAG_3(NODE) (DECL_CHECK (NODE)->decl.lang_flag_3)
+#define DECL_LANG_FLAG_4(NODE) (DECL_CHECK (NODE)->decl.lang_flag_4)
+#define DECL_LANG_FLAG_5(NODE) (DECL_CHECK (NODE)->decl.lang_flag_5)
+#define DECL_LANG_FLAG_6(NODE) (DECL_CHECK (NODE)->decl.lang_flag_6)
+#define DECL_LANG_FLAG_7(NODE) (DECL_CHECK (NODE)->decl.lang_flag_7)
+
+/* Used to indicate that the pointer to this DECL cannot be treated as
+ an address constant. */
+#define DECL_NON_ADDR_CONST_P(NODE) (DECL_CHECK (NODE)->decl.non_addr_const_p)
struct tree_decl
{
@@ -1163,7 +1273,6 @@ struct tree_decl
unsigned static_dtor_flag : 1;
unsigned artificial_flag : 1;
unsigned weak_flag : 1;
- /* room for no more */
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
@@ -1174,6 +1283,9 @@ struct tree_decl
unsigned lang_flag_6 : 1;
unsigned lang_flag_7 : 1;
+ unsigned non_addr_const_p : 1;
+ unsigned no_instrument_function_entry_exit : 1;
+
/* For a FUNCTION_DECL, if inline, this is the size of frame needed.
If built-in, this is the code for which built-in function.
For other kinds of decls, this is DECL_ALIGN. */
@@ -1194,6 +1306,7 @@ struct tree_decl
union tree_node *machine_attributes;
struct rtx_def *rtl; /* acts as link to register transfer language
(rtl) info */
+ struct rtx_def *live_range_rtl;
/* For FUNCTION_DECLs: points to insn that constitutes its definition
on the permanent obstack. For FIELD_DECL, this is DECL_FIELD_SIZE. */
union {
@@ -1341,6 +1454,7 @@ extern int tree_int_cst_equal PROTO((tree, tree));
extern int tree_int_cst_lt PROTO((tree, tree));
extern int tree_int_cst_sgn PROTO((tree));
extern int index_type_equal PROTO((tree, tree));
+extern tree get_inner_array_type PROTO((tree));
/* From expmed.c. Since rtl.h is included after tree.h, we can't
put the prototype here. Rtl.h does declare the prototype if
@@ -1432,6 +1546,7 @@ extern tree convert PROTO((tree, tree));
extern tree size_in_bytes PROTO((tree));
extern HOST_WIDE_INT int_size_in_bytes PROTO((tree));
extern tree size_binop PROTO((enum tree_code, tree, tree));
+extern tree ssize_binop PROTO((enum tree_code, tree, tree));
extern tree size_int_wide PROTO((unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT, int));
#define size_int(L) size_int_2 ((L), 0, 0)
@@ -1541,7 +1656,7 @@ extern tree save_expr PROTO((tree));
extern int first_rtl_op PROTO((enum tree_code));
/* unsave_expr (EXP) returns an expression equivalent to EXP but it
- can be used multiple times and will evaluate EXP, in it's entirety
+ can be used multiple times and will evaluate EXP, in its entirety
each time. */
extern tree unsave_expr PROTO((tree));
@@ -1752,9 +1867,13 @@ extern void (*incomplete_decl_finalize_hook) PROTO((tree));
/* In tree.c */
extern char *perm_calloc PROTO((int, long));
extern tree get_file_function_name PROTO((int));
+extern tree get_file_function_name_long PROTO((char *));
extern tree get_set_constructor_bits PROTO((tree, char *, int));
extern tree get_set_constructor_bytes PROTO((tree,
unsigned char *, int));
+extern int get_alias_set PROTO((tree));
+extern int new_alias_set PROTO((void));
+extern int (*lang_get_alias_set) PROTO((tree));
/* In stmt.c */
@@ -1804,6 +1923,7 @@ extern int pushcase PROTO((tree,
extern int pushcase_range PROTO((tree, tree,
tree (*) (tree, tree),
tree, tree *));
+extern void using_eh_for_cleanups PROTO((void));
/* In fold-const.c */
@@ -1887,6 +2007,9 @@ extern void dwarf2out_end_epilogue PROTO((void));
/* The language front-end must define these functions. */
+/* Function of no arguments for initializing options. */
+extern void lang_init_options PROTO((void));
+
/* Function of no arguments for initializing lexical scanning. */
extern void init_lex PROTO((void));
/* Function of no arguments for initializing the symbol table. */
@@ -1908,7 +2031,7 @@ extern int yyparse PROTO((void));
/* Function called with option as argument
to decode options starting with -f or -W or +.
It should return nonzero if it handles the option. */
-extern int lang_decode_option PROTO((char *));
+extern int lang_decode_option PROTO((int, char **));
/* Functions for processing symbol declarations. */
/* Function to enter a new lexical scope.
@@ -2010,6 +2133,9 @@ extern void start_identifier_warnings PROTO ((void));
extern void gcc_obstack_init PROTO ((struct obstack *));
extern void init_obstacks PROTO ((void));
extern void obfree PROTO ((char *));
+extern tree tree_check PROTO ((tree, enum tree_code, char*, int, int));
+extern tree tree_class_check PROTO ((tree, char, char*, int, int));
+extern tree expr_check PROTO ((tree, int, char*, int, int));
/* In function.c */
extern void setjmp_protect_args PROTO ((void));
@@ -2061,6 +2187,7 @@ extern void do_pending_stack_adjust PROTO ((void));
extern struct rtx_def *expand_assignment PROTO ((tree, tree, int, int));
extern struct rtx_def *store_expr PROTO ((tree, struct rtx_def *,
int));
+extern void check_max_integer_computation_mode PROTO ((tree));
/* In emit-rtl.c */
extern void start_sequence_for_rtl_expr PROTO ((tree));
@@ -2105,6 +2232,7 @@ extern void fixup_signed_type PROTO ((tree));
/* varasm.c */
extern void make_decl_rtl PROTO ((tree, char *, int));
extern void make_decl_one_only PROTO ((tree));
+extern int supports_one_only PROTO ((void));
extern void variable_section PROTO ((tree, int));
/* In fold-const.c */
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 2f6a2e80c37..3222e207890 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -156,6 +156,7 @@ enum unroll_types { UNROLL_COMPLETELY, UNROLL_MODULO, UNROLL_NAIVE };
#include "flags.h"
#include "expr.h"
#include "loop.h"
+#include "toplev.h"
/* This controls which loops are unrolled, and by how much we unroll
them. */
@@ -188,11 +189,11 @@ static int *splittable_regs_updates;
/* Values describing the current loop's iteration variable. These are set up
by loop_iterations, and used by precondition_loop_p. */
-static rtx loop_iteration_var;
-static rtx loop_initial_value;
-static rtx loop_increment;
-static rtx loop_final_value;
-static enum rtx_code loop_comparison_code;
+rtx loop_iteration_var;
+rtx loop_initial_value;
+rtx loop_increment;
+rtx loop_final_value;
+enum rtx_code loop_comparison_code;
/* Forward declarations. */
@@ -312,8 +313,11 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
loop_n_iterations = 0;
if (loop_dump_stream && loop_n_iterations > 0)
- fprintf (loop_dump_stream,
- "Loop unrolling: %d iterations.\n", loop_n_iterations);
+ {
+ fputs ("Loop unrolling: ", loop_dump_stream);
+ fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC, loop_n_iterations);
+ fputs (" iterations.\n", loop_dump_stream);
+ }
/* Find and save a pointer to the last nonnote insn in the loop. */
@@ -427,15 +431,34 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
if (unroll_type == UNROLL_COMPLETELY || unroll_type == UNROLL_MODULO)
{
- /* Loops of these types should never start with a jump down to
- the exit condition test. For now, check for this case just to
- be sure. UNROLL_NAIVE loops can be of this form, this case is
- handled below. */
+ /* Loops of these types can start with jump down to the exit condition
+ in rare circumstances.
+
+ Consider a pair of nested loops where the inner loop is part
+ of the exit code for the outer loop.
+
+ In this case jump.c will not duplicate the exit test for the outer
+ loop, so it will start with a jump to the exit code.
+
+ Then consider if the inner loop turns out to iterate once and
+ only once. We will end up deleting the jumps associated with
+ the inner loop. However, the loop notes are not removed from
+ the instruction stream.
+
+ And finally assume that we can compute the number of iterations
+ for the outer loop.
+
+ In this case unroll may want to unroll the outer loop even though
+ it starts with a jump to the outer loop's exit code.
+
+ We could try to optimize this case, but it hardly seems worth it.
+ Just return without unrolling the loop in such cases. */
+
insn = loop_start;
while (GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != JUMP_INSN)
insn = NEXT_INSN (insn);
if (GET_CODE (insn) == JUMP_INSN)
- abort ();
+ return;
}
if (unroll_type == UNROLL_COMPLETELY)
@@ -687,6 +710,8 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
for (insn = copy_start; insn != loop_end; insn = NEXT_INSN (insn))
{
+ rtx note;
+
if (GET_CODE (insn) == CODE_LABEL)
local_label[CODE_LABEL_NUMBER (insn)] = 1;
else if (GET_CODE (insn) == JUMP_INSN)
@@ -712,6 +737,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
}
}
}
+ else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)))
+ set_label_in_map (map, CODE_LABEL_NUMBER (XEXP (note, 0)),
+ XEXP (note, 0));
}
/* Allocate space for the insn map. */
@@ -1099,13 +1127,6 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
/* Set unroll type to MODULO now. */
unroll_type = UNROLL_MODULO;
loop_preconditioned = 1;
-
-#ifdef HAIFA
- /* Fix the initial value for the loop as needed. */
- if (loop_n_iterations <= 0)
- loop_start_value [uid_loop_num [INSN_UID (loop_start)]]
- = initial_value;
-#endif
}
}
@@ -1311,9 +1332,13 @@ precondition_loop_p (initial_value, final_value, increment, loop_start,
*final_value = GEN_INT (loop_n_iterations);
if (loop_dump_stream)
- fprintf (loop_dump_stream,
- "Preconditioning: Success, number of iterations known, %d.\n",
- loop_n_iterations);
+ {
+ fputs ("Preconditioning: Success, number of iterations known, ",
+ loop_dump_stream);
+ fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC,
+ loop_n_iterations);
+ fputs (".\n", loop_dump_stream);
+ }
return 1;
}
@@ -2664,9 +2689,10 @@ verify_addresses (v, giv_inc, unroll_number)
|| ! validate_replace_rtx (*v->location, last_addr, v->insn))
ret = 0;
- /* Now put things back the way they were before. This will always
+ /* Now put things back the way they were before. This should always
succeed. */
- validate_change (v->insn, v->location, orig_addr, 0);
+ if (! validate_replace_rtx (*v->location, orig_addr, v->insn))
+ abort ();
return ret;
}
@@ -2906,7 +2932,6 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
rtx tem = gen_reg_rtx (v->mode);
record_base_value (REGNO (tem), v->add_val, 0);
- v->unrolled = 1;
/* If the address giv has a constant in its new_reg value,
then this constant can be pulled out and put in value,
@@ -2959,6 +2984,10 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
continue;
}
+ /* We set this after the address check, to guarantee that
+ the register will be initialized. */
+ v->unrolled = 1;
+
/* To initialize the new register, just move the value of
new_reg into it. This is not guaranteed to give a valid
instruction on machines with complex addressing modes.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 833c077ef28..4b96685ab93 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -42,6 +42,8 @@ Boston, MA 02111-1307, USA. */
#include "defaults.h"
#include "real.h"
#include "toplev.h"
+#include "dbxout.h"
+#include "sdbout.h"
#include "ggc.h"
#include "obstack.h"
@@ -85,6 +87,7 @@ extern FILE *asm_out_file;
/* The (assembler) name of the first globally-visible object output. */
char *first_global_object_name;
+char *weak_global_object_name;
extern struct obstack *current_obstack;
extern struct obstack *saveable_obstack;
@@ -114,20 +117,6 @@ int size_directive_output;
tree last_assemble_variable_decl;
-
-#ifdef HANDLE_PRAGMA_WEAK
-/* Any weak symbol declarations waiting to be emitted. */
-
-struct weak_syms
-{
- struct weak_syms *next;
- char *name;
- char *value;
-};
-
-static struct weak_syms *weak_decls;
-#endif
-
/* Nonzero if at least one function definition has been seen. */
static int function_defined;
@@ -164,9 +153,11 @@ static void output_constructor PROTO((tree, int));
#ifdef ASM_OUTPUT_BSS
static void asm_output_bss PROTO((FILE *, tree, char *, int, int));
#endif
+#ifdef BSS_SECTION_ASM_OP
#ifdef ASM_OUTPUT_ALIGNED_BSS
static void asm_output_aligned_bss PROTO((FILE *, tree, char *, int, int));
#endif
+#endif /* BSS_SECTION_ASM_OP */
static enum in_section { no_section, in_text, in_data, in_named
#ifdef BSS_SECTION_ASM_OP
@@ -658,8 +649,6 @@ make_decl_rtl (decl, asmspec, top_level)
same DECL node. Don't discard the RTL already made. */
if (DECL_RTL (decl) == 0)
{
- DECL_RTL (decl) = 0;
-
/* First detect errors in declaring global registers. */
if (TREE_CODE (decl) != FUNCTION_DECL
&& DECL_REGISTER (decl) && reg_number == -1)
@@ -742,12 +731,6 @@ make_decl_rtl (decl, asmspec, top_level)
ASM_FORMAT_PRIVATE_NAME (label, name, var_labelno);
name = obstack_copy0 (saveable_obstack, label, strlen (label));
var_labelno++;
-
- /* We've changed the name by which this entity is
- known. In order that we can generate
- correct references to it, we update its
- DECL_ASSEMBLER_NAME. */
- DECL_ASSEMBLER_NAME (decl) = get_identifier (name);
}
if (name == 0)
@@ -769,7 +752,8 @@ make_decl_rtl (decl, asmspec, top_level)
DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
gen_rtx_SYMBOL_REF (Pmode, name));
-
+ MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl);
+
/* If this variable is to be treated as volatile, show its
tree node has side effects. If it has side effects, either
because of this test or from TREE_THIS_VOLATILE also
@@ -1007,22 +991,26 @@ assemble_start_function (decl, fnname)
if (TREE_PUBLIC (decl))
{
- if (!first_global_object_name && ! DECL_WEAK (decl)
- && ! DECL_ONE_ONLY (decl))
+ if (! first_global_object_name)
{
char *p;
+ char **name;
+
+ if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
+ name = &first_global_object_name;
+ else
+ name = &weak_global_object_name;
STRIP_NAME_ENCODING (p, fnname);
- first_global_object_name = permalloc (strlen (p) + 1);
- strcpy (first_global_object_name, p);
+ *name = permalloc (strlen (p) + 1);
+ strcpy (*name, p);
}
+ ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
#ifdef ASM_WEAKEN_LABEL
if (DECL_WEAK (decl))
ASM_WEAKEN_LABEL (asm_out_file, fnname);
- else
#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
}
/* Do any machine/system dependent processing of the function name */
@@ -1272,6 +1260,43 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
strcpy (first_global_object_name, p);
}
+ /* Compute the alignment of this data. */
+
+ align = DECL_ALIGN (decl);
+
+ /* In the case for initialing an array whose length isn't specified,
+ where we have not yet been able to do the layout,
+ figure out the proper alignment now. */
+ if (dont_output_data && DECL_SIZE (decl) == 0
+ && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
+ align = MAX (align, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
+
+ /* Some object file formats have a maximum alignment which they support.
+ In particular, a.out format supports a maximum alignment of 4. */
+#ifndef MAX_OFILE_ALIGNMENT
+#define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
+#endif
+ if (align > MAX_OFILE_ALIGNMENT)
+ {
+ warning_with_decl (decl,
+ "alignment of `%s' is greater than maximum object file alignment. Using %d.",
+ MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
+ align = MAX_OFILE_ALIGNMENT;
+ }
+
+ /* On some machines, it is good to increase alignment sometimes. */
+#ifdef DATA_ALIGNMENT
+ align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+#endif
+#ifdef CONSTANT_ALIGNMENT
+ if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node)
+ align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
+#endif
+
+ /* Reset the alignment in case we have made it tighter, so we can benefit
+ from it in get_pointer_alignment. */
+ DECL_ALIGN (decl) = align;
+
/* Handle uninitialized definitions. */
if ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)
@@ -1293,7 +1318,13 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1;
rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
* (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
-
+
+#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS)
+ if ( (DECL_ALIGN (decl) / BITS_PER_UNIT) > rounded)
+ warning_with_decl
+ (decl, "requested alignment for %s is greater than implemented alignment of %d.",rounded);
+#endif
+
#ifdef DBX_DEBUGGING_INFO
/* File-scope global variables are output here. */
if (write_symbols == DBX_DEBUG && top_level)
@@ -1395,12 +1426,11 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
/* First make the assembler name(s) global if appropriate. */
if (TREE_PUBLIC (decl) && DECL_NAME (decl))
{
+ ASM_GLOBALIZE_LABEL (asm_out_file, name);
#ifdef ASM_WEAKEN_LABEL
if (DECL_WEAK (decl))
ASM_WEAKEN_LABEL (asm_out_file, name);
- else
#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
}
#if 0
for (d = equivalents; d; d = TREE_CHAIN (d))
@@ -1419,7 +1449,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
reloc = output_addressed_constants (DECL_INITIAL (decl));
#ifdef ASM_OUTPUT_SECTION_NAME
- if (UNIQUE_SECTION_P (decl))
+ if ((flag_data_sections != 0
+ && DECL_SECTION_NAME (decl) == NULL_TREE)
+ || UNIQUE_SECTION_P (decl))
UNIQUE_SECTION (decl, reloc);
#endif
@@ -1461,42 +1493,10 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if (in_section != saved_in_section)
variable_section (decl, reloc);
- /* Compute and output the alignment of this data. */
-
- align = DECL_ALIGN (decl);
- /* In the case for initialing an array whose length isn't specified,
- where we have not yet been able to do the layout,
- figure out the proper alignment now. */
- if (dont_output_data && DECL_SIZE (decl) == 0
- && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
- align = MAX (align, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
-
- /* Some object file formats have a maximum alignment which they support.
- In particular, a.out format supports a maximum alignment of 4. */
-#ifndef MAX_OFILE_ALIGNMENT
-#define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
-#endif
- if (align > MAX_OFILE_ALIGNMENT)
- {
- warning_with_decl (decl,
- "alignment of `%s' is greater than maximum object file alignment");
- align = MAX_OFILE_ALIGNMENT;
- }
-#ifdef DATA_ALIGNMENT
- /* On some machines, it is good to increase alignment sometimes. */
- align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
-#endif
-#ifdef CONSTANT_ALIGNMENT
- if (DECL_INITIAL (decl))
- align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
-#endif
-
- /* Reset the alignment in case we have made it tighter, so we can benefit
- from it in get_pointer_alignment. */
- DECL_ALIGN (decl) = align;
-
+ /* Output the alignment of this data. */
if (align > BITS_PER_UNIT)
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
+ ASM_OUTPUT_ALIGN (asm_out_file,
+ floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT));
/* Do any machine/system dependent processing of the object. */
#ifdef ASM_DECLARE_OBJECT_NAME
@@ -1676,13 +1676,6 @@ assemble_static_space (size)
char name[12];
char *namestring;
rtx x;
-#ifndef ASM_OUTPUT_ALIGNED_LOCAL
- /* Round size up to multiple of BIGGEST_ALIGNMENT bits
- so that each uninitialized object starts on such a boundary. */
- int rounded = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
- / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
- * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
-#endif
#if 0
if (flag_shared_data)
@@ -1705,7 +1698,14 @@ assemble_static_space (size)
#ifdef ASM_OUTPUT_ALIGNED_LOCAL
ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, BIGGEST_ALIGNMENT);
#else
- ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
+ {
+ /* Round size up to multiple of BIGGEST_ALIGNMENT bits
+ so that each uninitialized object starts on such a boundary. */
+ int rounded = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
+ / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
+ * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
+ ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
+ }
#endif
#endif
return x;
@@ -2057,6 +2057,8 @@ immed_real_const_1 (d, mode)
else if (! REAL_VALUE_ISNAN (d) && REAL_VALUES_EQUAL (dconst1, d))
return CONST1_RTX (mode);
+ if (sizeof u == sizeof (HOST_WIDE_INT))
+ return immed_double_const (u.i[0], 0, mode);
if (sizeof u == 2 * sizeof (HOST_WIDE_INT))
return immed_double_const (u.i[0], u.i[1], mode);
@@ -2548,6 +2550,7 @@ compare_constant_1 (exp, p)
case PLUS_EXPR:
case MINUS_EXPR:
+ case RANGE_EXPR:
p = compare_constant_1 (TREE_OPERAND (exp, 0), p);
if (p == 0)
return 0;
@@ -2724,6 +2727,7 @@ record_constant_1 (exp)
case PLUS_EXPR:
case MINUS_EXPR:
+ case RANGE_EXPR:
record_constant_1 (TREE_OPERAND (exp, 0));
record_constant_1 (TREE_OPERAND (exp, 1));
return;
@@ -3439,6 +3443,10 @@ force_const_mem (mode, x)
align = (mode == VOIDmode) ? UNITS_PER_WORD : GET_MODE_SIZE (mode);
if (align > BIGGEST_ALIGNMENT / BITS_PER_UNIT)
align = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
+#ifdef CONSTANT_ALIGNMENT
+ align = CONSTANT_ALIGNMENT (make_tree (type_for_mode (mode, 0), x),
+ align * BITS_PER_UNIT) / BITS_PER_UNIT;
+#endif
pool_offset += align - 1;
pool_offset &= ~ (align - 1);
@@ -4242,38 +4250,6 @@ output_constructor (exp, size)
assemble_zeros (size - total_bytes);
}
-/* Output asm to handle ``#pragma weak'' */
-
-void
-handle_pragma_weak (what, name, value)
- enum pragma_state what;
- char *name, *value;
-{
-#ifdef HANDLE_PRAGMA_WEAK
- if (what == ps_name || what == ps_value)
- {
- struct weak_syms *weak =
- (struct weak_syms *)permalloc (sizeof (struct weak_syms));
- weak->next = weak_decls;
- weak->name = permalloc (strlen (name) + 1);
- strcpy (weak->name, name);
-
- if (what != ps_value)
- weak->value = NULL_PTR;
-
- else
- {
- weak->value = permalloc (strlen (value) + 1);
- strcpy (weak->value, value);
- }
-
- weak_decls = weak;
- }
- else if (! (what == ps_done || what == ps_start))
- warning ("malformed `#pragma weak'");
-#endif /* HANDLE_PRAGMA_WEAK */
-}
-
/* Declare DECL to be a weak symbol. */
void
@@ -4290,6 +4266,10 @@ declare_weak (decl)
/* Emit any pending weak declarations. */
+#ifdef HANDLE_PRAGMA_WEAK
+struct weak_syms * weak_decls;
+#endif
+
void
weak_finish ()
{
@@ -4299,6 +4279,7 @@ weak_finish ()
struct weak_syms *t;
for (t = weak_decls; t; t = t->next)
{
+ ASM_GLOBALIZE_LABEL (asm_out_file, t->name);
ASM_WEAKEN_LABEL (asm_out_file, t->name);
if (t->value)
ASM_OUTPUT_DEF (asm_out_file, t->name, t->value);
@@ -4321,12 +4302,11 @@ assemble_alias (decl, target)
if (TREE_PUBLIC (decl))
{
+ ASM_GLOBALIZE_LABEL (asm_out_file, name);
#ifdef ASM_WEAKEN_LABEL
if (DECL_WEAK (decl))
ASM_WEAKEN_LABEL (asm_out_file, name);
- else
#endif
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
}
ASM_OUTPUT_DEF (asm_out_file, name, IDENTIFIER_POINTER (target));
diff --git a/gcc/version.c b/gcc/version.c
index d20bbafcf48..c2623f48c36 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -1 +1 @@
-char *version_string = "egcs-2.91.27 19980502 (gcc2 ss-980502 experimental)";
+char *version_string = "egcs-2.92.13 19981007 (gcc2 ss-980609 experimental)";
diff --git a/gcc/vfprintf.c b/gcc/vfprintf.c
deleted file mode 100644
index db7b2ff4c19..00000000000
--- a/gcc/vfprintf.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Provide a version vfprintf in terms of _doprnt.
- By Kaveh Ghazi (ghazi@caip.rutgers.edu) 3/29/98
- Copyright (C) 1998 Free Software Foundation, Inc.
- */
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <stdio.h>
-#undef vfprintf
-
-int
-vfprintf (stream, format, ap)
- FILE * stream;
- const char * format;
- va_list ap;
-{
- return _doprnt (format, ap, stream);
-}
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 90ed5e3da62..baa0cd2ed01 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "rtl.h"
#include "flags.h"
+#include "toplev.h"
+#include "output.h"
#ifdef XCOFF_DEBUGGING_INFO
@@ -36,8 +38,9 @@ Boston, MA 02111-1307, USA. */
#include <dbxstclass.h>
#include "xcoffout.h"
+#include "dbxout.h"
-#if defined (USG) || defined (NO_STAB_H)
+#if defined (USG) || !defined (HAVE_STAB_H)
#include "gstab.h"
#else
#include <stab.h>
@@ -497,6 +500,16 @@ xcoffout_begin_function (file, last_linenum)
{
ASM_OUTPUT_LFB (file, last_linenum);
dbxout_parms (DECL_ARGUMENTS (current_function_decl));
+
+ /* Emit the symbols for the outermost BLOCK's variables. sdbout.c does this
+ in sdbout_begin_block, but there is no guarantee that there will be any
+ inner block 1, so we must do it here. This gives a result similar to
+ dbxout, so it does make some sense. */
+ do_block = 0;
+ next_block_number = 0;
+ xcoffout_block (DECL_INITIAL (current_function_decl), 0,
+ DECL_ARGUMENTS (current_function_decl));
+
ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
}
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index 8a97eaff3bd..2781a790324 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -166,3 +166,27 @@ extern char *xcoff_lastfile;
can't find them. */
#define DEBUG_SYMS_TEXT
+
+/* Prototype functions in xcoffout.c. */
+
+extern int stab_to_sclass PROTO ((int));
+#ifdef BUFSIZ
+extern void xcoffout_begin_function PROTO ((FILE *, int));
+extern void xcoffout_begin_block PROTO ((FILE *, int, int));
+extern void xcoffout_end_epilogue PROTO ((FILE *));
+extern void xcoffout_end_function PROTO ((FILE *, int));
+extern void xcoffout_end_block PROTO ((FILE *, int, int));
+#endif /* BUFSIZ */
+
+#ifdef TREE_CODE
+extern void xcoff_output_standard_types PROTO ((tree));
+#ifdef BUFSIZ
+extern void xcoffout_declare_function PROTO ((FILE *, tree, char *));
+#endif /* BUFSIZ */
+#endif /* TREE_CODE */
+
+#ifdef RTX_CODE
+#ifdef BUFSIZ
+extern void xcoffout_source_line PROTO ((FILE *, char *, rtx));
+#endif /* BUFSIZ */
+#endif /* RTX_CODE */